;(self.webpackChunk_N_E = self.webpackChunk_N_E || []).push([ [446], { 5569: function (t, n, r) { t.exports = (function () { var t return (function () { function e(t, n, r) { function i(a, s) { if (!n[a]) { if (!t[a]) { if (o) return o(a, !0) var l = new Error("Cannot find module '" + a + "'") throw ((l.code = 'MODULE_NOT_FOUND'), l) } var c = (n[a] = { exports: {} }) t[a][0].call( c.exports, function (e) { return i(t[a][1][e] || e) }, c, c.exports, e, t, n, r, ) } return n[a].exports } for (var o = void 0, a = 0; a < r.length; a++) i(r[a]) return i } return e })()( { 1: [ function (e, t, n) { var r = Object.prototype.toString function i(e) { return ( (e.BYTES_PER_ELEMENT && '[object ArrayBuffer]' === r.call(e.buffer)) || Array.isArray(e) ) } t.exports = i }, {}, ], 2: [ function (e, t, n) { t.exports = function (e, t) { return 'number' === typeof e ? e : 'number' === typeof t ? t : 0 } }, {}, ], 3: [ function (e, t, n) { 'use strict' ;(n.byteLength = u), (n.toByteArray = d), (n.fromByteArray = m) for ( var r = [], i = [], o = 'undefined' !== typeof Uint8Array ? Uint8Array : Array, a = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', s = 0, l = a.length; s < l; ++s ) (r[s] = a[s]), (i[a.charCodeAt(s)] = s) function c(e) { var t = e.length if (t % 4 > 0) throw new Error('Invalid string. Length must be a multiple of 4') var n = e.indexOf('=') return -1 === n && (n = t), [n, n === t ? 0 : 4 - (n % 4)] } function u(e) { var t = c(e), n = t[0], r = t[1] return (3 * (n + r)) / 4 - r } function h(e, t, n) { return (3 * (t + n)) / 4 - n } function d(e) { for ( var t, n = c(e), r = n[0], a = n[1], s = new o(h(e, r, a)), l = 0, u = a > 0 ? r - 4 : r, d = 0; d < u; d += 4 ) (t = (i[e.charCodeAt(d)] << 18) | (i[e.charCodeAt(d + 1)] << 12) | (i[e.charCodeAt(d + 2)] << 6) | i[e.charCodeAt(d + 3)]), (s[l++] = (t >> 16) & 255), (s[l++] = (t >> 8) & 255), (s[l++] = 255 & t) return ( 2 === a && ((t = (i[e.charCodeAt(d)] << 2) | (i[e.charCodeAt(d + 1)] >> 4)), (s[l++] = 255 & t)), 1 === a && ((t = (i[e.charCodeAt(d)] << 10) | (i[e.charCodeAt(d + 1)] << 4) | (i[e.charCodeAt(d + 2)] >> 2)), (s[l++] = (t >> 8) & 255), (s[l++] = 255 & t)), s ) } function p(e) { return r[(e >> 18) & 63] + r[(e >> 12) & 63] + r[(e >> 6) & 63] + r[63 & e] } function f(e, t, n) { for (var r, i = [], o = t; o < n; o += 3) (r = ((e[o] << 16) & 16711680) + ((e[o + 1] << 8) & 65280) + (255 & e[o + 2])), i.push(p(r)) return i.join('') } function m(e) { for ( var t, n = e.length, i = n % 3, o = [], a = 16383, s = 0, l = n - i; s < l; s += a ) o.push(f(e, s, s + a > l ? l : s + a)) return ( 1 === i ? ((t = e[n - 1]), o.push(r[t >> 2] + r[(t << 4) & 63] + '==')) : 2 === i && ((t = (e[n - 2] << 8) + e[n - 1]), o.push(r[t >> 10] + r[(t >> 4) & 63] + r[(t << 2) & 63] + '=')), o.join('') ) } ;(i['-'.charCodeAt(0)] = 62), (i['_'.charCodeAt(0)] = 63) }, {}, ], 4: [ function (e, t, n) { 'use strict' t.exports = { createLink: function (e, t) { var n = document.head || document.getElementsByTagName('head')[0], r = document.createElement('link') for (var i in ((r.href = e), (r.rel = 'stylesheet'), t)) if (t.hasOwnProperty(i)) { var o = t[i] r.setAttribute('data-' + i, o) } n.appendChild(r) }, createStyle: function (e, t) { var n = document.head || document.getElementsByTagName('head')[0], r = document.createElement('style') for (var i in ((r.type = 'text/css'), t)) if (t.hasOwnProperty(i)) { var o = t[i] r.setAttribute('data-' + i, o) } r.sheet ? ((r.innerHTML = e), (r.sheet.cssText = e), n.appendChild(r)) : r.styleSheet ? (n.appendChild(r), (r.styleSheet.cssText = e)) : (r.appendChild(document.createTextNode(e)), n.appendChild(r)) }, } }, {}, ], 5: [ function (e, t, n) { var r = e('buffer').Buffer t.exports = function (e, t) { if (r.isBuffer(e) && r.isBuffer(t)) { if ('function' === typeof e.equals) return e.equals(t) if (e.length !== t.length) return !1 for (var n = 0; n < e.length; n++) if (e[n] !== t[n]) return !1 return !0 } } }, { buffer: 6 }, ], 6: [ function (t, n, i) { ;(function (n, r) { 'use strict' var o = t('base64-js'), a = t('ieee754'), s = t('isarray') function l() { try { var t = new Uint8Array(1) return ( (t.__proto__ = { __proto__: Uint8Array.prototype, foo: function () { return 42 }, }), 42 === t.foo() && 'function' === typeof t.subarray && 0 === t.subarray(1, 1).byteLength ) } catch (e) { return !1 } } function c() { return r.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823 } function u(e, t) { if (c() < t) throw new RangeError('Invalid typed array length') return ( r.TYPED_ARRAY_SUPPORT ? ((e = new Uint8Array(t)).__proto__ = r.prototype) : (null === e && (e = new r(t)), (e.length = t)), e ) } function r(e, t, n) { if (!r.TYPED_ARRAY_SUPPORT && !(this instanceof r)) return new r(e, t, n) if ('number' === typeof e) { if ('string' === typeof t) throw new Error( 'If encoding is specified then the first argument must be a string', ) return f(this, e) } return h(this, e, t, n) } function h(e, t, n, r) { if ('number' === typeof t) throw new TypeError('"value" argument must not be a number') return 'undefined' !== typeof ArrayBuffer && t instanceof ArrayBuffer ? g(e, t, n, r) : 'string' === typeof t ? m(e, t, n) : y(e, t) } function d(e) { if ('number' !== typeof e) throw new TypeError('"size" argument must be a number') if (e < 0) throw new RangeError('"size" argument must not be negative') } function p(e, t, n, r) { return ( d(t), t <= 0 ? u(e, t) : void 0 !== n ? 'string' === typeof r ? u(e, t).fill(n, r) : u(e, t).fill(n) : u(e, t) ) } function f(e, t) { if ((d(t), (e = u(e, t < 0 ? 0 : 0 | b(t))), !r.TYPED_ARRAY_SUPPORT)) for (var n = 0; n < t; ++n) e[n] = 0 return e } function m(e, t, n) { if ((('string' === typeof n && '' !== n) || (n = 'utf8'), !r.isEncoding(n))) throw new TypeError('"encoding" must be a valid string encoding') var i = 0 | w(t, n), o = (e = u(e, i)).write(t, n) return o !== i && (e = e.slice(0, o)), e } function v(e, t) { var n = t.length < 0 ? 0 : 0 | b(t.length) e = u(e, n) for (var r = 0; r < n; r += 1) e[r] = 255 & t[r] return e } function g(e, t, n, i) { if ((t.byteLength, n < 0 || t.byteLength < n)) throw new RangeError("'offset' is out of bounds") if (t.byteLength < n + (i || 0)) throw new RangeError("'length' is out of bounds") return ( (t = void 0 === n && void 0 === i ? new Uint8Array(t) : void 0 === i ? new Uint8Array(t, n) : new Uint8Array(t, n, i)), r.TYPED_ARRAY_SUPPORT ? ((e = t).__proto__ = r.prototype) : (e = v(e, t)), e ) } function y(e, t) { if (r.isBuffer(t)) { var n = 0 | b(t.length) return 0 === (e = u(e, n)).length || t.copy(e, 0, 0, n), e } if (t) { if ( ('undefined' !== typeof ArrayBuffer && t.buffer instanceof ArrayBuffer) || 'length' in t ) return 'number' !== typeof t.length || ne(t.length) ? u(e, 0) : v(e, t) if ('Buffer' === t.type && s(t.data)) return v(e, t.data) } throw new TypeError( 'First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.', ) } function b(e) { if (e >= c()) throw new RangeError( 'Attempt to allocate Buffer larger than maximum size: 0x' + c().toString(16) + ' bytes', ) return 0 | e } function A(e) { return +e != e && (e = 0), r.alloc(+e) } function w(e, t) { if (r.isBuffer(e)) return e.length if ( 'undefined' !== typeof ArrayBuffer && 'function' === typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer) ) return e.byteLength 'string' !== typeof e && (e = '' + e) var n = e.length if (0 === n) return 0 for (var i = !1; ; ) switch (t) { case 'ascii': case 'latin1': case 'binary': return n case 'utf8': case 'utf-8': case void 0: return K(e).length case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return 2 * n case 'hex': return n >>> 1 case 'base64': return ee(e).length default: if (i) return K(e).length ;(t = ('' + t).toLowerCase()), (i = !0) } } function x(e, t, n) { var r = !1 if (((void 0 === t || t < 0) && (t = 0), t > this.length)) return '' if (((void 0 === n || n > this.length) && (n = this.length), n <= 0)) return '' if ((n >>>= 0) <= (t >>>= 0)) return '' for (e || (e = 'utf8'); ; ) switch (e) { case 'hex': return N(this, t, n) case 'utf8': case 'utf-8': return O(this, t, n) case 'ascii': return F(this, t, n) case 'latin1': case 'binary': return k(this, t, n) case 'base64': return D(this, t, n) case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return U(this, t, n) default: if (r) throw new TypeError('Unknown encoding: ' + e) ;(e = (e + '').toLowerCase()), (r = !0) } } function E(e, t, n) { var r = e[t] ;(e[t] = e[n]), (e[n] = r) } function M(e, t, n, i, o) { if (0 === e.length) return -1 if ( ('string' === typeof n ? ((i = n), (n = 0)) : n > 2147483647 ? (n = 2147483647) : n < -2147483648 && (n = -2147483648), (n = +n), isNaN(n) && (n = o ? 0 : e.length - 1), n < 0 && (n = e.length + n), n >= e.length) ) { if (o) return -1 n = e.length - 1 } else if (n < 0) { if (!o) return -1 n = 0 } if (('string' === typeof t && (t = r.from(t, i)), r.isBuffer(t))) return 0 === t.length ? -1 : _(e, t, n, i, o) if ('number' === typeof t) return ( (t &= 255), r.TYPED_ARRAY_SUPPORT && 'function' === typeof Uint8Array.prototype.indexOf ? o ? Uint8Array.prototype.indexOf.call(e, t, n) : Uint8Array.prototype.lastIndexOf.call(e, t, n) : _(e, [t], n, i, o) ) throw new TypeError('val must be string, number or Buffer') } function _(e, t, n, r, i) { var o, a = 1, s = e.length, l = t.length if ( void 0 !== r && ('ucs2' === (r = String(r).toLowerCase()) || 'ucs-2' === r || 'utf16le' === r || 'utf-16le' === r) ) { if (e.length < 2 || t.length < 2) return -1 ;(a = 2), (s /= 2), (l /= 2), (n /= 2) } function c(e, t) { return 1 === a ? e[t] : e.readUInt16BE(t * a) } if (i) { var u = -1 for (o = n; o < s; o++) if (c(e, o) === c(t, -1 === u ? 0 : o - u)) { if ((-1 === u && (u = o), o - u + 1 === l)) return u * a } else -1 !== u && (o -= o - u), (u = -1) } else for (n + l > s && (n = s - l), o = n; o >= 0; o--) { for (var h = !0, d = 0; d < l; d++) if (c(e, o + d) !== c(t, d)) { h = !1 break } if (h) return o } return -1 } function T(e, t, n, r) { n = Number(n) || 0 var i = e.length - n r ? (r = Number(r)) > i && (r = i) : (r = i) var o = t.length if (o % 2 !== 0) throw new TypeError('Invalid hex string') r > o / 2 && (r = o / 2) for (var a = 0; a < r; ++a) { var s = parseInt(t.substr(2 * a, 2), 16) if (isNaN(s)) return a e[n + a] = s } return a } function S(e, t, n, r) { return te(K(t, e.length - n), e, n, r) } function C(e, t, n, r) { return te(J(t), e, n, r) } function L(e, t, n, r) { return C(e, t, n, r) } function R(e, t, n, r) { return te(ee(t), e, n, r) } function P(e, t, n, r) { return te($(t, e.length - n), e, n, r) } function D(e, t, n) { return 0 === t && n === e.length ? o.fromByteArray(e) : o.fromByteArray(e.slice(t, n)) } function O(e, t, n) { n = Math.min(e.length, n) for (var r = [], i = t; i < n; ) { var o, a, s, l, c = e[i], u = null, h = c > 239 ? 4 : c > 223 ? 3 : c > 191 ? 2 : 1 if (i + h <= n) switch (h) { case 1: c < 128 && (u = c) break case 2: 128 === (192 & (o = e[i + 1])) && (l = ((31 & c) << 6) | (63 & o)) > 127 && (u = l) break case 3: ;(o = e[i + 1]), (a = e[i + 2]), 128 === (192 & o) && 128 === (192 & a) && (l = ((15 & c) << 12) | ((63 & o) << 6) | (63 & a)) > 2047 && (l < 55296 || l > 57343) && (u = l) break case 4: ;(o = e[i + 1]), (a = e[i + 2]), (s = e[i + 3]), 128 === (192 & o) && 128 === (192 & a) && 128 === (192 & s) && (l = ((15 & c) << 18) | ((63 & o) << 12) | ((63 & a) << 6) | (63 & s)) > 65535 && l < 1114112 && (u = l) } null === u ? ((u = 65533), (h = 1)) : u > 65535 && ((u -= 65536), r.push(((u >>> 10) & 1023) | 55296), (u = 56320 | (1023 & u))), r.push(u), (i += h) } return B(r) } ;(i.Buffer = r), (i.SlowBuffer = A), (i.INSPECT_MAX_BYTES = 50), (r.TYPED_ARRAY_SUPPORT = void 0 !== n.TYPED_ARRAY_SUPPORT ? n.TYPED_ARRAY_SUPPORT : l()), (i.kMaxLength = c()), (r.poolSize = 8192), (r._augment = function (e) { return (e.__proto__ = r.prototype), e }), (r.from = function (e, t, n) { return h(null, e, t, n) }), r.TYPED_ARRAY_SUPPORT && ((r.prototype.__proto__ = Uint8Array.prototype), (r.__proto__ = Uint8Array), 'undefined' !== typeof Symbol && Symbol.species && r[Symbol.species] === r && Object.defineProperty(r, Symbol.species, { value: null, configurable: !0, })), (r.alloc = function (e, t, n) { return p(null, e, t, n) }), (r.allocUnsafe = function (e) { return f(null, e) }), (r.allocUnsafeSlow = function (e) { return f(null, e) }), (r.isBuffer = function (e) { return !(null == e || !e._isBuffer) }), (r.compare = function (e, t) { if (!r.isBuffer(e) || !r.isBuffer(t)) throw new TypeError('Arguments must be Buffers') if (e === t) return 0 for (var n = e.length, i = t.length, o = 0, a = Math.min(n, i); o < a; ++o) if (e[o] !== t[o]) { ;(n = e[o]), (i = t[o]) break } return n < i ? -1 : i < n ? 1 : 0 }), (r.isEncoding = function (e) { switch (String(e).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 } }), (r.concat = function (e, t) { if (!s(e)) throw new TypeError('"list" argument must be an Array of Buffers') if (0 === e.length) return r.alloc(0) var n if (void 0 === t) for (t = 0, n = 0; n < e.length; ++n) t += e[n].length var i = r.allocUnsafe(t), o = 0 for (n = 0; n < e.length; ++n) { var a = e[n] if (!r.isBuffer(a)) throw new TypeError('"list" argument must be an Array of Buffers') a.copy(i, o), (o += a.length) } return i }), (r.byteLength = w), (r.prototype._isBuffer = !0), (r.prototype.swap16 = function () { var e = this.length if (e % 2 !== 0) throw new RangeError('Buffer size must be a multiple of 16-bits') for (var t = 0; t < e; t += 2) E(this, t, t + 1) return this }), (r.prototype.swap32 = function () { var e = this.length if (e % 4 !== 0) throw new RangeError('Buffer size must be a multiple of 32-bits') for (var t = 0; t < e; t += 4) E(this, t, t + 3), E(this, t + 1, t + 2) return this }), (r.prototype.swap64 = function () { var e = this.length if (e % 8 !== 0) throw new RangeError('Buffer size must be a multiple of 64-bits') for (var t = 0; t < e; t += 8) E(this, t, t + 7), E(this, t + 1, t + 6), E(this, t + 2, t + 5), E(this, t + 3, t + 4) return this }), (r.prototype.toString = function () { var e = 0 | this.length return 0 === e ? '' : 0 === arguments.length ? O(this, 0, e) : x.apply(this, arguments) }), (r.prototype.equals = function (e) { if (!r.isBuffer(e)) throw new TypeError('Argument must be a Buffer') return this === e || 0 === r.compare(this, e) }), (r.prototype.inspect = function () { var e = '', t = i.INSPECT_MAX_BYTES return ( this.length > 0 && ((e = this.toString('hex', 0, t).match(/.{2}/g).join(' ')), this.length > t && (e += ' ... ')), '' ) }), (r.prototype.compare = function (e, t, n, i, o) { if (!r.isBuffer(e)) throw new TypeError('Argument must be a Buffer') if ( (void 0 === t && (t = 0), void 0 === n && (n = e ? e.length : 0), void 0 === i && (i = 0), void 0 === o && (o = this.length), t < 0 || n > e.length || i < 0 || o > this.length) ) throw new RangeError('out of range index') if (i >= o && t >= n) return 0 if (i >= o) return -1 if (t >= n) return 1 if (this === e) return 0 for ( var a = (o >>>= 0) - (i >>>= 0), s = (n >>>= 0) - (t >>>= 0), l = Math.min(a, s), c = this.slice(i, o), u = e.slice(t, n), h = 0; h < l; ++h ) if (c[h] !== u[h]) { ;(a = c[h]), (s = u[h]) break } return a < s ? -1 : s < a ? 1 : 0 }), (r.prototype.includes = function (e, t, n) { return -1 !== this.indexOf(e, t, n) }), (r.prototype.indexOf = function (e, t, n) { return M(this, e, t, n, !0) }), (r.prototype.lastIndexOf = function (e, t, n) { return M(this, e, t, n, !1) }), (r.prototype.write = function (e, t, n, r) { if (void 0 === t) (r = 'utf8'), (n = this.length), (t = 0) else if (void 0 === n && 'string' === typeof t) (r = t), (n = this.length), (t = 0) else { if (!isFinite(t)) throw new Error( 'Buffer.write(string, encoding, offset[, length]) is no longer supported', ) ;(t |= 0), isFinite(n) ? ((n |= 0), void 0 === r && (r = 'utf8')) : ((r = n), (n = void 0)) } var i = this.length - t if ( ((void 0 === n || n > i) && (n = i), (e.length > 0 && (n < 0 || t < 0)) || t > this.length) ) throw new RangeError('Attempt to write outside buffer bounds') r || (r = 'utf8') for (var o = !1; ; ) switch (r) { case 'hex': return T(this, e, t, n) case 'utf8': case 'utf-8': return S(this, e, t, n) case 'ascii': return C(this, e, t, n) case 'latin1': case 'binary': return L(this, e, t, n) case 'base64': return R(this, e, t, n) case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return P(this, e, t, n) default: if (o) throw new TypeError('Unknown encoding: ' + r) ;(r = ('' + r).toLowerCase()), (o = !0) } }), (r.prototype.toJSON = function () { return { type: 'Buffer', data: Array.prototype.slice.call(this._arr || this, 0), } }) var I = 4096 function B(e) { var t = e.length if (t <= I) return String.fromCharCode.apply(String, e) for (var n = '', r = 0; r < t; ) n += String.fromCharCode.apply(String, e.slice(r, (r += I))) return n } function F(e, t, n) { var r = '' n = Math.min(e.length, n) for (var i = t; i < n; ++i) r += String.fromCharCode(127 & e[i]) return r } function k(e, t, n) { var r = '' n = Math.min(e.length, n) for (var i = t; i < n; ++i) r += String.fromCharCode(e[i]) return r } function N(e, t, n) { var r = e.length ;(!t || t < 0) && (t = 0), (!n || n < 0 || n > r) && (n = r) for (var i = '', o = t; o < n; ++o) i += Z(e[o]) return i } function U(e, t, n) { for (var r = e.slice(t, n), i = '', o = 0; o < r.length; o += 2) i += String.fromCharCode(r[o] + 256 * r[o + 1]) return i } function H(e, t, n) { if (e % 1 !== 0 || e < 0) throw new RangeError('offset is not uint') if (e + t > n) throw new RangeError('Trying to access beyond buffer length') } function G(e, t, n, i, o, a) { if (!r.isBuffer(e)) throw new TypeError('"buffer" argument must be a Buffer instance') if (t > o || t < a) throw new RangeError('"value" argument is out of bounds') if (n + i > e.length) throw new RangeError('Index out of range') } function z(e, t, n, r) { t < 0 && (t = 65535 + t + 1) for (var i = 0, o = Math.min(e.length - n, 2); i < o; ++i) e[n + i] = (t & (255 << (8 * (r ? i : 1 - i)))) >>> (8 * (r ? i : 1 - i)) } function j(e, t, n, r) { t < 0 && (t = 4294967295 + t + 1) for (var i = 0, o = Math.min(e.length - n, 4); i < o; ++i) e[n + i] = (t >>> (8 * (r ? i : 3 - i))) & 255 } function V(e, t, n, r, i, o) { if (n + r > e.length) throw new RangeError('Index out of range') if (n < 0) throw new RangeError('Index out of range') } function W(e, t, n, r, i) { return ( i || V(e, t, n, 4, 34028234663852886e22, -34028234663852886e22), a.write(e, t, n, r, 23, 4), n + 4 ) } function q(e, t, n, r, i) { return ( i || V(e, t, n, 8, 17976931348623157e292, -17976931348623157e292), a.write(e, t, n, r, 52, 8), n + 8 ) } ;(r.prototype.slice = function (e, t) { var n, i = this.length if ( ((e = ~~e) < 0 ? (e += i) < 0 && (e = 0) : e > i && (e = i), (t = void 0 === t ? i : ~~t) < 0 ? (t += i) < 0 && (t = 0) : t > i && (t = i), t < e && (t = e), r.TYPED_ARRAY_SUPPORT) ) (n = this.subarray(e, t)).__proto__ = r.prototype else { var o = t - e n = new r(o, void 0) for (var a = 0; a < o; ++a) n[a] = this[a + e] } return n }), (r.prototype.readUIntLE = function (e, t, n) { ;(e |= 0), (t |= 0), n || H(e, t, this.length) for (var r = this[e], i = 1, o = 0; ++o < t && (i *= 256); ) r += this[e + o] * i return r }), (r.prototype.readUIntBE = function (e, t, n) { ;(e |= 0), (t |= 0), n || H(e, t, this.length) for (var r = this[e + --t], i = 1; t > 0 && (i *= 256); ) r += this[e + --t] * i return r }), (r.prototype.readUInt8 = function (e, t) { return t || H(e, 1, this.length), this[e] }), (r.prototype.readUInt16LE = function (e, t) { return t || H(e, 2, this.length), this[e] | (this[e + 1] << 8) }), (r.prototype.readUInt16BE = function (e, t) { return t || H(e, 2, this.length), (this[e] << 8) | this[e + 1] }), (r.prototype.readUInt32LE = function (e, t) { return ( t || H(e, 4, this.length), (this[e] | (this[e + 1] << 8) | (this[e + 2] << 16)) + 16777216 * this[e + 3] ) }), (r.prototype.readUInt32BE = function (e, t) { return ( t || H(e, 4, this.length), 16777216 * this[e] + ((this[e + 1] << 16) | (this[e + 2] << 8) | this[e + 3]) ) }), (r.prototype.readIntLE = function (e, t, n) { ;(e |= 0), (t |= 0), n || H(e, t, this.length) for (var r = this[e], i = 1, o = 0; ++o < t && (i *= 256); ) r += this[e + o] * i return r >= (i *= 128) && (r -= Math.pow(2, 8 * t)), r }), (r.prototype.readIntBE = function (e, t, n) { ;(e |= 0), (t |= 0), n || H(e, t, this.length) for (var r = t, i = 1, o = this[e + --r]; r > 0 && (i *= 256); ) o += this[e + --r] * i return o >= (i *= 128) && (o -= Math.pow(2, 8 * t)), o }), (r.prototype.readInt8 = function (e, t) { return ( t || H(e, 1, this.length), 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e] ) }), (r.prototype.readInt16LE = function (e, t) { t || H(e, 2, this.length) var n = this[e] | (this[e + 1] << 8) return 32768 & n ? 4294901760 | n : n }), (r.prototype.readInt16BE = function (e, t) { t || H(e, 2, this.length) var n = this[e + 1] | (this[e] << 8) return 32768 & n ? 4294901760 | n : n }), (r.prototype.readInt32LE = function (e, t) { return ( t || H(e, 4, this.length), this[e] | (this[e + 1] << 8) | (this[e + 2] << 16) | (this[e + 3] << 24) ) }), (r.prototype.readInt32BE = function (e, t) { return ( t || H(e, 4, this.length), (this[e] << 24) | (this[e + 1] << 16) | (this[e + 2] << 8) | this[e + 3] ) }), (r.prototype.readFloatLE = function (e, t) { return t || H(e, 4, this.length), a.read(this, e, !0, 23, 4) }), (r.prototype.readFloatBE = function (e, t) { return t || H(e, 4, this.length), a.read(this, e, !1, 23, 4) }), (r.prototype.readDoubleLE = function (e, t) { return t || H(e, 8, this.length), a.read(this, e, !0, 52, 8) }), (r.prototype.readDoubleBE = function (e, t) { return t || H(e, 8, this.length), a.read(this, e, !1, 52, 8) }), (r.prototype.writeUIntLE = function (e, t, n, r) { ;(e = +e), (t |= 0), (n |= 0), r || G(this, e, t, n, Math.pow(2, 8 * n) - 1, 0) var i = 1, o = 0 for (this[t] = 255 & e; ++o < n && (i *= 256); ) this[t + o] = (e / i) & 255 return t + n }), (r.prototype.writeUIntBE = function (e, t, n, r) { ;(e = +e), (t |= 0), (n |= 0), r || G(this, e, t, n, Math.pow(2, 8 * n) - 1, 0) var i = n - 1, o = 1 for (this[t + i] = 255 & e; --i >= 0 && (o *= 256); ) this[t + i] = (e / o) & 255 return t + n }), (r.prototype.writeUInt8 = function (e, t, n) { return ( (e = +e), (t |= 0), n || G(this, e, t, 1, 255, 0), r.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), (this[t] = 255 & e), t + 1 ) }), (r.prototype.writeUInt16LE = function (e, t, n) { return ( (e = +e), (t |= 0), n || G(this, e, t, 2, 65535, 0), r.TYPED_ARRAY_SUPPORT ? ((this[t] = 255 & e), (this[t + 1] = e >>> 8)) : z(this, e, t, !0), t + 2 ) }), (r.prototype.writeUInt16BE = function (e, t, n) { return ( (e = +e), (t |= 0), n || G(this, e, t, 2, 65535, 0), r.TYPED_ARRAY_SUPPORT ? ((this[t] = e >>> 8), (this[t + 1] = 255 & e)) : z(this, e, t, !1), t + 2 ) }), (r.prototype.writeUInt32LE = function (e, t, n) { return ( (e = +e), (t |= 0), n || G(this, e, t, 4, 4294967295, 0), r.TYPED_ARRAY_SUPPORT ? ((this[t + 3] = e >>> 24), (this[t + 2] = e >>> 16), (this[t + 1] = e >>> 8), (this[t] = 255 & e)) : j(this, e, t, !0), t + 4 ) }), (r.prototype.writeUInt32BE = function (e, t, n) { return ( (e = +e), (t |= 0), n || G(this, e, t, 4, 4294967295, 0), r.TYPED_ARRAY_SUPPORT ? ((this[t] = e >>> 24), (this[t + 1] = e >>> 16), (this[t + 2] = e >>> 8), (this[t + 3] = 255 & e)) : j(this, e, t, !1), t + 4 ) }), (r.prototype.writeIntLE = function (e, t, n, r) { if (((e = +e), (t |= 0), !r)) { var i = Math.pow(2, 8 * n - 1) G(this, e, t, n, i - 1, -i) } var o = 0, a = 1, s = 0 for (this[t] = 255 & e; ++o < n && (a *= 256); ) e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1), (this[t + o] = (((e / a) >> 0) - s) & 255) return t + n }), (r.prototype.writeIntBE = function (e, t, n, r) { if (((e = +e), (t |= 0), !r)) { var i = Math.pow(2, 8 * n - 1) G(this, e, t, n, i - 1, -i) } var o = n - 1, a = 1, s = 0 for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); ) e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1), (this[t + o] = (((e / a) >> 0) - s) & 255) return t + n }), (r.prototype.writeInt8 = function (e, t, n) { return ( (e = +e), (t |= 0), n || G(this, e, t, 1, 127, -128), r.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), e < 0 && (e = 255 + e + 1), (this[t] = 255 & e), t + 1 ) }), (r.prototype.writeInt16LE = function (e, t, n) { return ( (e = +e), (t |= 0), n || G(this, e, t, 2, 32767, -32768), r.TYPED_ARRAY_SUPPORT ? ((this[t] = 255 & e), (this[t + 1] = e >>> 8)) : z(this, e, t, !0), t + 2 ) }), (r.prototype.writeInt16BE = function (e, t, n) { return ( (e = +e), (t |= 0), n || G(this, e, t, 2, 32767, -32768), r.TYPED_ARRAY_SUPPORT ? ((this[t] = e >>> 8), (this[t + 1] = 255 & e)) : z(this, e, t, !1), t + 2 ) }), (r.prototype.writeInt32LE = function (e, t, n) { return ( (e = +e), (t |= 0), n || G(this, e, t, 4, 2147483647, -2147483648), r.TYPED_ARRAY_SUPPORT ? ((this[t] = 255 & e), (this[t + 1] = e >>> 8), (this[t + 2] = e >>> 16), (this[t + 3] = e >>> 24)) : j(this, e, t, !0), t + 4 ) }), (r.prototype.writeInt32BE = function (e, t, n) { return ( (e = +e), (t |= 0), n || G(this, e, t, 4, 2147483647, -2147483648), e < 0 && (e = 4294967295 + e + 1), r.TYPED_ARRAY_SUPPORT ? ((this[t] = e >>> 24), (this[t + 1] = e >>> 16), (this[t + 2] = e >>> 8), (this[t + 3] = 255 & e)) : j(this, e, t, !1), t + 4 ) }), (r.prototype.writeFloatLE = function (e, t, n) { return W(this, e, t, !0, n) }), (r.prototype.writeFloatBE = function (e, t, n) { return W(this, e, t, !1, n) }), (r.prototype.writeDoubleLE = function (e, t, n) { return q(this, e, t, !0, n) }), (r.prototype.writeDoubleBE = function (e, t, n) { return q(this, e, t, !1, n) }), (r.prototype.copy = function (e, t, n, i) { if ( (n || (n = 0), i || 0 === i || (i = this.length), t >= e.length && (t = e.length), t || (t = 0), i > 0 && i < n && (i = n), i === n) ) return 0 if (0 === e.length || 0 === this.length) return 0 if (t < 0) throw new RangeError('targetStart out of bounds') if (n < 0 || n >= this.length) throw new RangeError('sourceStart out of bounds') if (i < 0) throw new RangeError('sourceEnd out of bounds') i > this.length && (i = this.length), e.length - t < i - n && (i = e.length - t + n) var o, a = i - n if (this === e && n < t && t < i) for (o = a - 1; o >= 0; --o) e[o + t] = this[o + n] else if (a < 1e3 || !r.TYPED_ARRAY_SUPPORT) for (o = 0; o < a; ++o) e[o + t] = this[o + n] else Uint8Array.prototype.set.call(e, this.subarray(n, n + a), t) return a }), (r.prototype.fill = function (e, t, n, i) { if ('string' === typeof e) { if ( ('string' === typeof t ? ((i = t), (t = 0), (n = this.length)) : 'string' === typeof n && ((i = n), (n = this.length)), 1 === e.length) ) { var o = e.charCodeAt(0) o < 256 && (e = o) } if (void 0 !== i && 'string' !== typeof i) throw new TypeError('encoding must be a string') if ('string' === typeof i && !r.isEncoding(i)) throw new TypeError('Unknown encoding: ' + i) } else 'number' === typeof e && (e &= 255) if (t < 0 || this.length < t || this.length < n) throw new RangeError('Out of range index') if (n <= t) return this var a if ( ((t >>>= 0), (n = void 0 === n ? this.length : n >>> 0), e || (e = 0), 'number' === typeof e) ) for (a = t; a < n; ++a) this[a] = e else { var s = r.isBuffer(e) ? e : K(new r(e, i).toString()), l = s.length for (a = 0; a < n - t; ++a) this[a + t] = s[a % l] } return this }) var X = /[^+\/0-9A-Za-z-_]/g function Y(e) { if ((e = Q(e).replace(X, '')).length < 2) return '' for (; e.length % 4 !== 0; ) e += '=' return e } function Q(e) { return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, '') } function Z(e) { return e < 16 ? '0' + e.toString(16) : e.toString(16) } function K(e, t) { var n t = t || 1 / 0 for (var r = e.length, i = null, o = [], a = 0; a < r; ++a) { if ((n = e.charCodeAt(a)) > 55295 && n < 57344) { if (!i) { if (n > 56319) { ;(t -= 3) > -1 && o.push(239, 191, 189) continue } if (a + 1 === r) { ;(t -= 3) > -1 && o.push(239, 191, 189) continue } i = n continue } if (n < 56320) { ;(t -= 3) > -1 && o.push(239, 191, 189), (i = n) continue } n = 65536 + (((i - 55296) << 10) | (n - 56320)) } else i && (t -= 3) > -1 && o.push(239, 191, 189) if (((i = null), n < 128)) { if ((t -= 1) < 0) break o.push(n) } else if (n < 2048) { if ((t -= 2) < 0) break o.push((n >> 6) | 192, (63 & n) | 128) } else if (n < 65536) { if ((t -= 3) < 0) break o.push((n >> 12) | 224, ((n >> 6) & 63) | 128, (63 & n) | 128) } else { if (!(n < 1114112)) throw new Error('Invalid code point') if ((t -= 4) < 0) break o.push( (n >> 18) | 240, ((n >> 12) & 63) | 128, ((n >> 6) & 63) | 128, (63 & n) | 128, ) } } return o } function J(e) { for (var t = [], n = 0; n < e.length; ++n) t.push(255 & e.charCodeAt(n)) return t } function $(e, t) { for (var n, r, i, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a) (r = (n = e.charCodeAt(a)) >> 8), (i = n % 256), o.push(i), o.push(r) return o } function ee(e) { return o.toByteArray(Y(e)) } function te(e, t, n, r) { for (var i = 0; i < r && !(i + n >= t.length || i >= e.length); ++i) t[i + n] = e[i] return i } function ne(e) { return e !== e } }.call( this, 'undefined' !== typeof r.g ? r.g : 'undefined' !== typeof self ? self : 'undefined' !== typeof window ? window : {}, t('buffer').Buffer, )) }, { 'base64-js': 3, buffer: 6, ieee754: 29, isarray: 35 }, ], 7: [ function (t, n, r) { !(function () { if ('undefined' !== typeof window) try { var t = new window.CustomEvent('test', { cancelable: !0 }) if ((t.preventDefault(), !0 !== t.defaultPrevented)) throw new Error('Could not prevent default') } catch (e) { var n = function (e, n) { var r, i return ( ((n = n || {}).bubbles = !!n.bubbles), (n.cancelable = !!n.cancelable), (r = document.createEvent('CustomEvent')).initCustomEvent( e, n.bubbles, n.cancelable, n.detail, ), (i = r.preventDefault), (r.preventDefault = function () { i.call(this) try { Object.defineProperty(this, 'defaultPrevented', { get: function () { return !0 }, }) } catch (t) { this.defaultPrevented = !0 } }), r ) } ;(n.prototype = window.Event.prototype), (window.CustomEvent = n) } })() }, {}, ], 8: [ function (t, n, r) { function i() { 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 o() { var e = arguments, t = this.useColors if ( ((e[0] = (t ? '%c' : '') + this.namespace + (t ? ' %c' : ' ') + e[0] + (t ? '%c ' : ' ')), !t) ) return e var n = 'color: ' + this.color e = [e[0], n, 'color: inherit'].concat(Array.prototype.slice.call(e, 1)) var r = 0, i = 0 return ( e[0].replace(/%[a-z%]/g, function (e) { '%%' !== e && (r++, '%c' === e && (i = r)) }), e.splice(i, 0, n), e ) } function a() { return ( 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments) ) } function s(t) { try { null == t ? r.storage.removeItem('debug') : (r.storage.debug = t) } catch (e) {} } function l() { var t try { t = r.storage.debug } catch (e) {} return t } function c() { try { return window.localStorage } catch (e) {} } ;((r = n.exports = t('./debug')).log = a), (r.formatArgs = o), (r.save = s), (r.load = l), (r.useColors = i), (r.storage = 'undefined' != typeof chrome && 'undefined' != typeof chrome.storage ? chrome.storage.local : c()), (r.colors = [ 'lightseagreen', 'forestgreen', 'goldenrod', 'dodgerblue', 'darkorchid', 'crimson', ]), (r.formatters.j = function (e) { return JSON.stringify(e) }), r.enable(l()) }, { './debug': 9 }, ], 9: [ function (e, t, n) { ;((n = t.exports = o).coerce = c), (n.disable = s), (n.enable = a), (n.enabled = l), (n.names = []), (n.skips = []), (n.formatters = {}) var r = 0 function i() { return n.colors[r++ % n.colors.length] } function o(e) { function t() {} function r() { var e = r null == e.useColors && (e.useColors = n.useColors()), null == e.color && e.useColors && (e.color = i()) var t = Array.prototype.slice.call(arguments) ;(t[0] = n.coerce(t[0])), 'string' !== typeof t[0] && (t = ['%o'].concat(t)) var o = 0 ;(t[0] = t[0].replace(/%([a-z%])/g, function (r, i) { if ('%%' === r) return r o++ var a = n.formatters[i] if ('function' === typeof a) { var s = t[o] ;(r = a.call(e, s)), t.splice(o, 1), o-- } return r })), 'function' === typeof n.formatArgs && (t = n.formatArgs.apply(e, t)), (r.log || n.log || console.log.bind(console)).apply(e, t) } ;(t.enabled = !1), (r.enabled = !0) var o = n.enabled(e) ? r : t return (o.namespace = e), o } function a(e) { n.save(e) for (var t = (e || '').split(/[\s,]+/), r = t.length, i = 0; i < r; i++) t[i] && ('-' === (e = t[i].replace(/\*/g, '.*?'))[0] ? n.skips.push(new RegExp('^' + e.substr(1) + '$')) : n.names.push(new RegExp('^' + e + '$'))) } function s() { n.enable('') } function l(e) { var t, r for (t = 0, r = n.skips.length; t < r; t++) if (n.skips[t].test(e)) return !1 for (t = 0, r = n.names.length; t < r; t++) if (n.names[t].test(e)) return !0 return !1 } function c(e) { return e instanceof Error ? e.stack || e.message : e } }, {}, ], 10: [ function (e, t, n) { 'use strict' var r = e('is-obj'), i = Object.prototype.hasOwnProperty, o = Object.prototype.propertyIsEnumerable function a(e) { if (null === e || void 0 === e) throw new TypeError('Sources cannot be null or undefined') return Object(e) } function s(e, t, n) { var o = t[n] if (void 0 !== o && null !== o) { if (i.call(e, n) && (void 0 === e[n] || null === e[n])) throw new TypeError('Cannot convert undefined or null to object (' + n + ')') i.call(e, n) && r(o) ? (e[n] = l(Object(e[n]), t[n])) : (e[n] = o) } } function l(e, t) { if (e === t) return e for (var n in (t = Object(t))) i.call(t, n) && s(e, t, n) if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(t), a = 0; a < r.length; a++) o.call(t, r[a]) && s(e, t, r[a]) return e } t.exports = function (e) { e = a(e) for (var t = 1; t < arguments.length; t++) l(e, arguments[t]) return e } }, { 'is-obj': 34 }, ], 11: [ function (t, n, r) { 'use strict' var i = t('object-keys'), o = 'function' === typeof Symbol && 'symbol' === typeof Symbol('foo'), a = Object.prototype.toString, s = Array.prototype.concat, l = Object.defineProperty, c = function (e) { return 'function' === typeof e && '[object Function]' === a.call(e) }, u = function () { var t = {} try { for (var n in (l(t, 'x', { enumerable: !1, value: t }), t)) return !1 return t.x === t } catch (e) { return !1 } }, h = l && u(), d = function (e, t, n, r) { ;(!(t in e) || (c(r) && r())) && (h ? l(e, t, { configurable: !0, enumerable: !1, value: n, writable: !0 }) : (e[t] = n)) }, p = function (e, t) { var n = arguments.length > 2 ? arguments[2] : {}, r = i(t) o && (r = s.call(r, Object.getOwnPropertySymbols(t))) for (var a = 0; a < r.length; a += 1) d(e, r[a], t[r[a]], n[r[a]]) } ;(p.supportsDescriptors = !!h), (n.exports = p) }, { 'object-keys': 41 }, ], 12: [ function (t, n, r) { !(function (t, n, r, i) { 'use strict' function o(e, t) { for (var n = 0, r = e.length; n < r; n++) g(e[n], t) } function a(e) { for (var t, n = 0, r = e.length; n < r; n++) (t = e[n]), M(t, H[l(t)]) } function s(e) { return function (t) { ie(t) && (g(t, e), o(t.querySelectorAll(G), e)) } } function l(e) { var t = se.call(e, 'is'), n = e.nodeName.toUpperCase(), r = j.call(U, t ? F + t.toUpperCase() : B + n) return t && -1 < r && !c(n, t) ? -1 : r } function c(e, t) { return -1 < G.indexOf(e + '[is="' + t + '"]') } function u(e) { var t = e.currentTarget, n = e.attrChange, r = e.attrName, i = e.target ge && (!i || i === t) && t.attributeChangedCallback && 'style' !== r && e.prevValue !== e.newValue && t.attributeChangedCallback( r, n === e[L] ? null : e.prevValue, n === e[P] ? null : e.newValue, ) } function h(e) { var t = s(e) return function (e) { y.push(t, e.target) } } function d(e) { ve && ((ve = !1), e.currentTarget.removeEventListener(O, d)), o((e.target || n).querySelectorAll(G), e.detail === S ? S : T), re && m() } function p(e, t) { var n = this le.call(n, e, t), b.call(n, { target: n }) } function f(e, t) { ee(e, t), x ? x.observe(e, he) : (me && ((e.setAttribute = p), (e[_] = w(e)), e.addEventListener(I, b)), e.addEventListener(D, u)), e.createdCallback && ge && ((e.created = !0), e.createdCallback(), (e.created = !1)) } function m() { for (var e, t = 0, n = oe.length; t < n; t++) (e = oe[t]), z.contains(e) || (n--, oe.splice(t--, 1), g(e, S)) } function v(e) { throw new Error('A ' + e + ' type is already registered') } function g(e, t) { var n, r = l(e) ;-1 < r && (E(e, H[r]), (r = 0), t !== T || e[T] ? t === S && !e[S] && ((e[T] = !1), (e[S] = !0), (r = 1)) : ((e[S] = !1), (e[T] = !0), (r = 1), re && j.call(oe, e) < 0 && oe.push(e)), r && (n = e[t + 'Callback']) && n.call(e)) } if (!(i in n)) { var y, b, A, w, x, E, M, _ = '__' + i + ((1e5 * Math.random()) >> 0), T = 'attached', S = 'detached', C = 'extends', L = 'ADDITION', R = 'MODIFICATION', P = 'REMOVAL', D = 'DOMAttrModified', O = 'DOMContentLoaded', I = 'DOMSubtreeModified', B = '<', F = '=', k = /^[A-Z][A-Z0-9]*(?:-[A-Z0-9]+)+$/, N = [ 'ANNOTATION-XML', 'COLOR-PROFILE', 'FONT-FACE', 'FONT-FACE-SRC', 'FONT-FACE-URI', 'FONT-FACE-FORMAT', 'FONT-FACE-NAME', 'MISSING-GLYPH', ], U = [], H = [], G = '', z = n.documentElement, j = U.indexOf || function (e) { for (var t = this.length; t-- && this[t] !== e; ); return t }, V = r.prototype, W = V.hasOwnProperty, q = V.isPrototypeOf, X = r.defineProperty, Y = r.getOwnPropertyDescriptor, Q = r.getOwnPropertyNames, Z = r.getPrototypeOf, K = r.setPrototypeOf, J = !!r.__proto__, $ = r.create || function e(t) { return t ? ((e.prototype = t), new e()) : this }, ee = K || (J ? function (e, t) { return (e.__proto__ = t), e } : Q && Y ? (function () { function e(e, t) { for (var n, r = Q(t), i = 0, o = r.length; i < o; i++) (n = r[i]), W.call(e, n) || X(e, n, Y(t, n)) } return function (t, n) { do { e(t, n) } while ((n = Z(n)) && !q.call(n, t)) return t } })() : function (e, t) { for (var n in t) e[n] = t[n] return e }), te = t.MutationObserver || t.WebKitMutationObserver, ne = (t.HTMLElement || t.Element || t.Node).prototype, re = !q.call(ne, z), ie = re ? function (e) { return 1 === e.nodeType } : function (e) { return q.call(ne, e) }, oe = re && [], ae = ne.cloneNode, se = ne.getAttribute, le = ne.setAttribute, ce = ne.removeAttribute, ue = n.createElement, he = te && { attributes: !0, characterData: !0, attributeOldValue: !0 }, de = te || function (e) { ;(me = !1), z.removeEventListener(D, de) }, pe = t.requestAnimationFrame || t.webkitRequestAnimationFrame || t.mozRequestAnimationFrame || t.msRequestAnimationFrame || function (e) { setTimeout(e, 10) }, fe = !1, me = !0, ve = !0, ge = !0 K || J ? ((E = function (e, t) { q.call(t, e) || f(e, t) }), (M = f)) : (M = E = function (e, t) { e[_] || ((e[_] = r(!0)), f(e, t)) }), re ? ((me = !1), (function () { var t = Y(ne, 'addEventListener'), n = t.value, r = function (e) { var t = new CustomEvent(D, { bubbles: !0 }) ;(t.attrName = e), (t.prevValue = se.call(this, e)), (t.newValue = null), (t[P] = t.attrChange = 2), ce.call(this, e), this.dispatchEvent(t) }, i = function (t, n) { var r = this.hasAttribute(t), i = r && se.call(this, t) ;(e = new CustomEvent(D, { bubbles: !0 })), le.call(this, t, n), (e.attrName = t), (e.prevValue = r ? i : null), (e.newValue = n), r ? (e[R] = e.attrChange = 1) : (e[L] = e.attrChange = 0), this.dispatchEvent(e) }, o = function (e) { var t, n = e.currentTarget, r = n[_], i = e.propertyName r.hasOwnProperty(i) && ((r = r[i]), ((t = new CustomEvent(D, { bubbles: !0 })).attrName = r.name), (t.prevValue = r.value || null), (t.newValue = r.value = n[i] || null), null == t.prevValue ? (t[L] = t.attrChange = 0) : (t[R] = t.attrChange = 1), n.dispatchEvent(t)) } ;(t.value = function (e, t, a) { e === D && this.attributeChangedCallback && this.setAttribute !== i && ((this[_] = { className: { name: 'class', value: this.className }, }), (this.setAttribute = i), (this.removeAttribute = r), n.call(this, 'propertychange', o)), n.call(this, e, t, a) }), X(ne, 'addEventListener', t) })()) : te || (z.addEventListener(D, de), z.setAttribute(_, 1), z.removeAttribute(_), me && ((b = function (e) { var t, n, r, i = this if (i === e.target) { for (r in ((t = i[_]), (i[_] = n = w(i)), n)) { if (!(r in t)) return A(0, i, r, t[r], n[r], L) if (n[r] !== t[r]) return A(1, i, r, t[r], n[r], R) } for (r in t) if (!(r in n)) return A(2, i, r, t[r], n[r], P) } }), (A = function (e, t, n, r, i, o) { var a = { attrChange: e, currentTarget: t, attrName: n, prevValue: r, newValue: i, } ;(a[o] = e), u(a) }), (w = function (e) { for ( var t, n, r = {}, i = e.attributes, o = 0, a = i.length; o < a; o++ ) 'setAttribute' !== (n = (t = i[o]).name) && (r[n] = t.value) return r }))), (n[i] = function (e, t) { if ( ((r = e.toUpperCase()), fe || ((fe = !0), te ? (x = (function (e, t) { function n(e, t) { for (var n = 0, r = e.length; n < r; t(e[n++])); } return new te(function (r) { for (var i, o, a, s = 0, l = r.length; s < l; s++) 'childList' === (i = r[s]).type ? (n(i.addedNodes, e), n(i.removedNodes, t)) : ((o = i.target), ge && o.attributeChangedCallback && 'style' !== i.attributeName && (a = se.call(o, i.attributeName)) !== i.oldValue && o.attributeChangedCallback( i.attributeName, i.oldValue, a, )) }) })(s(T), s(S))).observe(n, { childList: !0, subtree: !0 }) : ((y = []), pe(function e() { for (; y.length; ) y.shift().call(null, y.shift()) pe(e) }), n.addEventListener('DOMNodeInserted', h(T)), n.addEventListener('DOMNodeRemoved', h(S))), n.addEventListener(O, d), n.addEventListener('readystatechange', d), (n.createElement = function (e, t) { var r = ue.apply(n, arguments), i = '' + e, o = j.call(U, (t ? F : B) + (t || i).toUpperCase()), a = -1 < o return ( t && (r.setAttribute('is', (t = t.toLowerCase())), a && (a = c(i.toUpperCase(), t))), (ge = !n.createElement.innerHTMLHelper), a && M(r, H[o]), r ) }), (ne.cloneNode = function (e) { var t = ae.call(this, !!e), n = l(t) return -1 < n && M(t, H[n]), e && a(t.querySelectorAll(G)), t })), -2 < j.call(U, F + r) + j.call(U, B + r) && v(e), !k.test(r) || -1 < j.call(N, r)) ) throw new Error('The type ' + e + ' is invalid') var r, i, u = function () { return f ? n.createElement(m, r) : n.createElement(m) }, p = t || V, f = W.call(p, C), m = f ? t[C].toUpperCase() : r return ( f && -1 < j.call(U, B + m) && v(m), (i = U.push((f ? F : B) + r) - 1), (G = G.concat( G.length ? ',' : '', f ? m + '[is="' + e.toLowerCase() + '"]' : m, )), (u.prototype = H[i] = W.call(p, 'prototype') ? p.prototype : $(ne)), o(n.querySelectorAll(G), T), u ) }) } })(window, document, Object, 'registerElement') }, {}, ], 13: [ function (e, t, n) { t.exports = function (e) { switch (e) { 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 (e, t, n) { 'use strict' var r, i, o, a, s = Object.getOwnPropertyDescriptor ? (function () { return Object.getOwnPropertyDescriptor(arguments, 'callee').get })() : function () { throw new TypeError() }, l = 'function' === typeof Symbol && 'symbol' === typeof Symbol.iterator, c = Object.getPrototypeOf || function (e) { return e.__proto__ }, u = i ? c(i) : r, h = o ? o.constructor : r, d = a ? c(a) : r, p = a ? a() : r, f = 'undefined' === typeof Uint8Array ? r : c(Uint8Array), m = { '$ %Array%': Array, '$ %ArrayBuffer%': 'undefined' === typeof ArrayBuffer ? r : ArrayBuffer, '$ %ArrayBufferPrototype%': 'undefined' === typeof ArrayBuffer ? r : ArrayBuffer.prototype, '$ %ArrayIteratorPrototype%': l ? c([][Symbol.iterator]()) : r, '$ %ArrayPrototype%': Array.prototype, '$ %ArrayProto_entries%': Array.prototype.entries, '$ %ArrayProto_forEach%': Array.prototype.forEach, '$ %ArrayProto_keys%': Array.prototype.keys, '$ %ArrayProto_values%': Array.prototype.values, '$ %AsyncFromSyncIteratorPrototype%': r, '$ %AsyncFunction%': h, '$ %AsyncFunctionPrototype%': h ? h.prototype : r, '$ %AsyncGenerator%': a ? c(p) : r, '$ %AsyncGeneratorFunction%': d, '$ %AsyncGeneratorPrototype%': d ? d.prototype : r, '$ %AsyncIteratorPrototype%': p && l && Symbol.asyncIterator ? p[Symbol.asyncIterator]() : r, '$ %Atomics%': 'undefined' === typeof Atomics ? r : Atomics, '$ %Boolean%': Boolean, '$ %BooleanPrototype%': Boolean.prototype, '$ %DataView%': 'undefined' === typeof DataView ? r : DataView, '$ %DataViewPrototype%': 'undefined' === typeof DataView ? r : 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 ? r : Float32Array, '$ %Float32ArrayPrototype%': 'undefined' === typeof Float32Array ? r : Float32Array.prototype, '$ %Float64Array%': 'undefined' === typeof Float64Array ? r : Float64Array, '$ %Float64ArrayPrototype%': 'undefined' === typeof Float64Array ? r : Float64Array.prototype, '$ %Function%': Function, '$ %FunctionPrototype%': Function.prototype, '$ %Generator%': i ? c(i()) : r, '$ %GeneratorFunction%': u, '$ %GeneratorPrototype%': u ? u.prototype : r, '$ %Int8Array%': 'undefined' === typeof Int8Array ? r : Int8Array, '$ %Int8ArrayPrototype%': 'undefined' === typeof Int8Array ? r : Int8Array.prototype, '$ %Int16Array%': 'undefined' === typeof Int16Array ? r : Int16Array, '$ %Int16ArrayPrototype%': 'undefined' === typeof Int16Array ? r : Int8Array.prototype, '$ %Int32Array%': 'undefined' === typeof Int32Array ? r : Int32Array, '$ %Int32ArrayPrototype%': 'undefined' === typeof Int32Array ? r : Int32Array.prototype, '$ %isFinite%': isFinite, '$ %isNaN%': isNaN, '$ %IteratorPrototype%': l ? c(c([][Symbol.iterator]())) : r, '$ %JSON%': JSON, '$ %JSONParse%': JSON.parse, '$ %Map%': 'undefined' === typeof Map ? r : Map, '$ %MapIteratorPrototype%': 'undefined' !== typeof Map && l ? c(new Map()[Symbol.iterator]()) : r, '$ %MapPrototype%': 'undefined' === typeof Map ? r : 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 ? r : Promise, '$ %PromisePrototype%': 'undefined' === typeof Promise ? r : Promise.prototype, '$ %PromiseProto_then%': 'undefined' === typeof Promise ? r : Promise.prototype.then, '$ %Promise_all%': 'undefined' === typeof Promise ? r : Promise.all, '$ %Promise_reject%': 'undefined' === typeof Promise ? r : Promise.reject, '$ %Promise_resolve%': 'undefined' === typeof Promise ? r : Promise.resolve, '$ %Proxy%': 'undefined' === typeof Proxy ? r : Proxy, '$ %RangeError%': RangeError, '$ %RangeErrorPrototype%': RangeError.prototype, '$ %ReferenceError%': ReferenceError, '$ %ReferenceErrorPrototype%': ReferenceError.prototype, '$ %Reflect%': 'undefined' === typeof Reflect ? r : Reflect, '$ %RegExp%': RegExp, '$ %RegExpPrototype%': RegExp.prototype, '$ %Set%': 'undefined' === typeof Set ? r : Set, '$ %SetIteratorPrototype%': 'undefined' !== typeof Set && l ? c(new Set()[Symbol.iterator]()) : r, '$ %SetPrototype%': 'undefined' === typeof Set ? r : Set.prototype, '$ %SharedArrayBuffer%': 'undefined' === typeof SharedArrayBuffer ? r : SharedArrayBuffer, '$ %SharedArrayBufferPrototype%': 'undefined' === typeof SharedArrayBuffer ? r : SharedArrayBuffer.prototype, '$ %String%': String, '$ %StringIteratorPrototype%': l ? c(''[Symbol.iterator]()) : r, '$ %StringPrototype%': String.prototype, '$ %Symbol%': l ? Symbol : r, '$ %SymbolPrototype%': l ? Symbol.prototype : r, '$ %SyntaxError%': SyntaxError, '$ %SyntaxErrorPrototype%': SyntaxError.prototype, '$ %ThrowTypeError%': s, '$ %TypedArray%': f, '$ %TypedArrayPrototype%': f ? f.prototype : r, '$ %TypeError%': TypeError, '$ %TypeErrorPrototype%': TypeError.prototype, '$ %Uint8Array%': 'undefined' === typeof Uint8Array ? r : Uint8Array, '$ %Uint8ArrayPrototype%': 'undefined' === typeof Uint8Array ? r : Uint8Array.prototype, '$ %Uint8ClampedArray%': 'undefined' === typeof Uint8ClampedArray ? r : Uint8ClampedArray, '$ %Uint8ClampedArrayPrototype%': 'undefined' === typeof Uint8ClampedArray ? r : Uint8ClampedArray.prototype, '$ %Uint16Array%': 'undefined' === typeof Uint16Array ? r : Uint16Array, '$ %Uint16ArrayPrototype%': 'undefined' === typeof Uint16Array ? r : Uint16Array.prototype, '$ %Uint32Array%': 'undefined' === typeof Uint32Array ? r : Uint32Array, '$ %Uint32ArrayPrototype%': 'undefined' === typeof Uint32Array ? r : Uint32Array.prototype, '$ %URIError%': URIError, '$ %URIErrorPrototype%': URIError.prototype, '$ %WeakMap%': 'undefined' === typeof WeakMap ? r : WeakMap, '$ %WeakMapPrototype%': 'undefined' === typeof WeakMap ? r : WeakMap.prototype, '$ %WeakSet%': 'undefined' === typeof WeakSet ? r : WeakSet, '$ %WeakSetPrototype%': 'undefined' === typeof WeakSet ? r : WeakSet.prototype, } t.exports = function (e, t) { if (arguments.length > 1 && 'boolean' !== typeof t) throw new TypeError('"allowMissing" argument must be a boolean') var n = '$ ' + e if (!(n in m)) throw new SyntaxError('intrinsic ' + e + ' does not exist!') if ('undefined' === typeof m[n] && !t) throw new TypeError( 'intrinsic ' + e + ' exists, but is not available. Please file an issue!', ) return m[n] } }, {}, ], 15: [ function (e, t, n) { 'use strict' var r = e('./GetIntrinsic'), i = r('%Object%'), o = r('%TypeError%'), a = r('%String%'), s = e('./helpers/assertRecord'), l = e('./helpers/isNaN'), c = e('./helpers/isFinite'), u = e('./helpers/sign'), h = e('./helpers/mod'), d = e('is-callable'), p = e('es-to-primitive/es5'), f = e('has'), m = { ToPrimitive: p, ToBoolean: function (e) { return !!e }, ToNumber: function (e) { return +e }, ToInteger: function (e) { var t = this.ToNumber(e) return l(t) ? 0 : 0 !== t && c(t) ? u(t) * Math.floor(Math.abs(t)) : t }, ToInt32: function (e) { return this.ToNumber(e) >> 0 }, ToUint32: function (e) { return this.ToNumber(e) >>> 0 }, ToUint16: function (e) { var t = this.ToNumber(e) if (l(t) || 0 === t || !c(t)) return 0 var n = u(t) * Math.floor(Math.abs(t)) return h(n, 65536) }, ToString: function (e) { return a(e) }, ToObject: function (e) { return this.CheckObjectCoercible(e), i(e) }, CheckObjectCoercible: function (e, t) { if (null == e) throw new o(t || 'Cannot call method on ' + e) return e }, IsCallable: d, SameValue: function (e, t) { return e === t ? 0 !== e || 1 / e === 1 / t : l(e) && l(t) }, Type: function (e) { return null === e ? 'Null' : 'undefined' === typeof 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 t = { '[[Configurable]]': !0, '[[Enumerable]]': !0, '[[Get]]': !0, '[[Set]]': !0, '[[Value]]': !0, '[[Writable]]': !0, } for (var n in e) if (f(e, n) && !t[n]) return !1 var r = f(e, '[[Value]]'), i = f(e, '[[Get]]') || f(e, '[[Set]]') if (r && i) throw new o( 'Property Descriptors may not be both accessor and data descriptors', ) return !0 }, IsAccessorDescriptor: function (e) { return ( 'undefined' !== typeof e && (s(this, 'Property Descriptor', 'Desc', e), !(!f(e, '[[Get]]') && !f(e, '[[Set]]'))) ) }, IsDataDescriptor: function (e) { return ( 'undefined' !== typeof e && (s(this, 'Property Descriptor', 'Desc', e), !(!f(e, '[[Value]]') && !f(e, '[[Writable]]'))) ) }, IsGenericDescriptor: function (e) { return ( 'undefined' !== typeof e && (s(this, 'Property Descriptor', 'Desc', e), !this.IsAccessorDescriptor(e) && !this.IsDataDescriptor(e)) ) }, FromPropertyDescriptor: function (e) { if ('undefined' === typeof e) return e if ((s(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 o( 'FromPropertyDescriptor must be called with a fully populated Property Descriptor', ) }, ToPropertyDescriptor: function (e) { if ('Object' !== this.Type(e)) throw new o('ToPropertyDescriptor requires an object') var t = {} if ( (f(e, 'enumerable') && (t['[[Enumerable]]'] = this.ToBoolean(e.enumerable)), f(e, 'configurable') && (t['[[Configurable]]'] = this.ToBoolean(e.configurable)), f(e, 'value') && (t['[[Value]]'] = e.value), f(e, 'writable') && (t['[[Writable]]'] = this.ToBoolean(e.writable)), f(e, 'get')) ) { var n = e.get if ('undefined' !== typeof n && !this.IsCallable(n)) throw new TypeError('getter must be a function') t['[[Get]]'] = n } if (f(e, 'set')) { var r = e.set if ('undefined' !== typeof r && !this.IsCallable(r)) throw new o('setter must be a function') t['[[Set]]'] = r } if ( (f(t, '[[Get]]') || f(t, '[[Set]]')) && (f(t, '[[Value]]') || f(t, '[[Writable]]')) ) throw new o( 'Invalid property descriptor. Cannot both specify accessors and a value or writable attribute', ) return t }, } t.exports = m }, { './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 (e, t, n) { 'use strict' var r = e('../GetIntrinsic'), i = r('%TypeError%'), o = r('%SyntaxError%'), a = e('has'), s = { 'Property Descriptor': function (e, t) { if ('Object' !== e.Type(t)) return !1 var n = { '[[Configurable]]': !0, '[[Enumerable]]': !0, '[[Get]]': !0, '[[Set]]': !0, '[[Value]]': !0, '[[Writable]]': !0, } for (var r in t) if (a(t, r) && !n[r]) return !1 var o = a(t, '[[Value]]'), s = a(t, '[[Get]]') || a(t, '[[Set]]') if (o && s) throw new i( 'Property Descriptors may not be both accessor and data descriptors', ) return !0 }, } t.exports = function (e, t, n, r) { var a = s[t] if ('function' !== typeof a) throw new o('unknown record type: ' + t) if (!a(e, r)) throw new i(n + ' must be a ' + t) console.log(a(e, r), r) } }, { '../GetIntrinsic': 14, has: 28 }, ], 17: [ function (e, t, n) { var r = Number.isNaN || function (e) { return e !== e } t.exports = Number.isFinite || function (e) { return 'number' === typeof e && !r(e) && e !== 1 / 0 && e !== -1 / 0 } }, {}, ], 18: [ function (e, t, n) { t.exports = Number.isNaN || function (e) { return e !== e } }, {}, ], 19: [ function (e, t, n) { t.exports = function (e, t) { var n = e % t return Math.floor(n >= 0 ? n : n + t) } }, {}, ], 20: [ function (e, t, n) { t.exports = function (e) { return e >= 0 ? 1 : -1 } }, {}, ], 21: [ function (e, t, n) { 'use strict' var r = Object.prototype.toString, i = e('./helpers/isPrimitive'), o = e('is-callable'), a = { '[[DefaultValue]]': function (e) { var t if ( (t = arguments.length > 1 ? arguments[1] : '[object Date]' === r.call(e) ? String : Number) === String || t === Number ) { var n, a, s = t === String ? ['toString', 'valueOf'] : ['valueOf', 'toString'] for (a = 0; a < s.length; ++a) if (o(e[s[a]]) && ((n = e[s[a]]()), i(n))) return n throw new TypeError('No default value') } throw new TypeError('invalid [[DefaultValue]] hint supplied') }, } t.exports = function (e) { return i(e) ? e : arguments.length > 1 ? a['[[DefaultValue]]'](e, arguments[1]) : a['[[DefaultValue]]'](e) } }, { './helpers/isPrimitive': 22, 'is-callable': 32 }, ], 22: [ function (e, t, n) { t.exports = function (e) { return null === e || ('function' !== typeof e && 'object' !== typeof e) } }, {}, ], 23: [ function (e, t, n) { var r = e('dtype') function i(e, t, n) { if (!e) throw new TypeError('must specify data as first parameter') if ( ((n = 0 | +(n || 0)), Array.isArray(e) && e[0] && 'number' === typeof e[0][0]) ) { var i, o, a, s, l = e[0].length, c = e.length * l ;(t && 'string' !== typeof t) || (t = new (r(t || 'float32'))(c + n)) var u = t.length - n if (c !== u) throw new Error( 'source length ' + c + ' (' + l + 'x' + e.length + ') does not match destination length ' + u, ) for (i = 0, a = n; i < e.length; i++) for (o = 0; o < l; o++) t[a++] = null === e[i][o] ? NaN : e[i][o] } else if (t && 'string' !== typeof t) t.set(e, n) else { var h = r(t || 'float32') if (Array.isArray(e) || 'array' === t) for (i = 0, a = n, s = (t = new h(e.length + n)).length; a < s; a++, i++) t[a] = null === e[i] ? NaN : e[i] else 0 === n ? (t = new h(e)) : (t = new h(e.length + n)).set(e, n) } return t } t.exports = i }, { dtype: 13 }, ], 24: [ function (e, t, n) { 'use strict' var r = e('is-callable'), i = Object.prototype.toString, o = Object.prototype.hasOwnProperty, a = function (e, t, n) { for (var r = 0, i = e.length; r < i; r++) o.call(e, r) && (null == n ? t(e[r], r, e) : t.call(n, e[r], r, e)) }, s = function (e, t, n) { for (var r = 0, i = e.length; r < i; r++) null == n ? t(e.charAt(r), r, e) : t.call(n, e.charAt(r), r, e) }, l = function (e, t, n) { for (var r in e) o.call(e, r) && (null == n ? t(e[r], r, e) : t.call(n, e[r], r, e)) }, c = function (e, t, n) { if (!r(t)) throw new TypeError('iterator must be a function') var o arguments.length >= 3 && (o = n), '[object Array]' === i.call(e) ? a(e, t, o) : 'string' === typeof e ? s(e, t, o) : l(e, t, o) } t.exports = c }, { 'is-callable': 32 }, ], 25: [ function (e, t, n) { 'use strict' var r = 'Function.prototype.bind called on incompatible ', i = Array.prototype.slice, o = Object.prototype.toString, a = '[object Function]' t.exports = function (e) { var t = this if ('function' !== typeof t || o.call(t) !== a) throw new TypeError(r + t) for ( var n, s = i.call(arguments, 1), l = function () { if (this instanceof n) { var r = t.apply(this, s.concat(i.call(arguments))) return Object(r) === r ? r : this } return t.apply(e, s.concat(i.call(arguments))) }, c = Math.max(0, t.length - s.length), u = [], h = 0; h < c; h++ ) u.push('$' + h) if ( ((n = Function( 'binder', 'return function (' + u.join(',') + '){ return binder.apply(this,arguments); }', )(l)), t.prototype) ) { var d = function () {} ;(d.prototype = t.prototype), (n.prototype = new d()), (d.prototype = null) } return n } }, {}, ], 26: [ function (e, t, n) { 'use strict' var r = e('./implementation') t.exports = Function.prototype.bind || r }, { './implementation': 25 }, ], 27: [ function (e, t, n) { ;(function (e) { var n ;(n = 'undefined' !== typeof window ? window : 'undefined' !== typeof e ? e : 'undefined' !== typeof self ? self : {}), (t.exports = n) }.call( this, 'undefined' !== typeof r.g ? r.g : 'undefined' !== typeof self ? self : 'undefined' !== typeof window ? window : {}, )) }, {}, ], 28: [ function (e, t, n) { 'use strict' var r = e('function-bind') t.exports = r.call(Function.call, Object.prototype.hasOwnProperty) }, { 'function-bind': 26 }, ], 29: [ function (e, t, n) { ;(n.read = function (e, t, n, r, i) { var o, a, s = 8 * i - r - 1, l = (1 << s) - 1, c = l >> 1, u = -7, h = n ? i - 1 : 0, d = n ? -1 : 1, p = e[t + h] for ( h += d, o = p & ((1 << -u) - 1), p >>= -u, u += s; u > 0; o = 256 * o + e[t + h], h += d, u -= 8 ); for ( a = o & ((1 << -u) - 1), o >>= -u, u += r; u > 0; a = 256 * a + e[t + h], h += d, u -= 8 ); if (0 === o) o = 1 - c else { if (o === l) return a ? NaN : (1 / 0) * (p ? -1 : 1) ;(a += Math.pow(2, r)), (o -= c) } return (p ? -1 : 1) * a * Math.pow(2, o - r) }), (n.write = function (e, t, n, r, i, o) { var a, s, l, c = 8 * o - i - 1, u = (1 << c) - 1, h = u >> 1, d = 23 === i ? Math.pow(2, -24) - Math.pow(2, -77) : 0, p = r ? 0 : o - 1, f = r ? 1 : -1, m = t < 0 || (0 === t && 1 / t < 0) ? 1 : 0 for ( t = Math.abs(t), isNaN(t) || t === 1 / 0 ? ((s = isNaN(t) ? 1 : 0), (a = u)) : ((a = Math.floor(Math.log(t) / Math.LN2)), t * (l = Math.pow(2, -a)) < 1 && (a--, (l *= 2)), (t += a + h >= 1 ? d / l : d * Math.pow(2, 1 - h)) * l >= 2 && (a++, (l /= 2)), a + h >= u ? ((s = 0), (a = u)) : a + h >= 1 ? ((s = (t * l - 1) * Math.pow(2, i)), (a += h)) : ((s = t * Math.pow(2, h - 1) * Math.pow(2, i)), (a = 0))); i >= 8; e[n + p] = 255 & s, p += f, s /= 256, i -= 8 ); for ( a = (a << i) | s, c += i; c > 0; e[n + p] = 255 & a, p += f, a /= 256, c -= 8 ); e[n + p - f] |= 128 * m }) }, {}, ], 30: [ function (e, t, n) { 'function' === typeof Object.create ? (t.exports = function (e, t) { t && ((e.super_ = t), (e.prototype = Object.create(t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 }, }))) }) : (t.exports = function (e, t) { if (t) { e.super_ = t var n = function () {} ;(n.prototype = t.prototype), (e.prototype = new n()), (e.prototype.constructor = e) } }) }, {}, ], 31: [ function (e, t, n) { function r(e) { return ( !!e.constructor && 'function' === typeof e.constructor.isBuffer && e.constructor.isBuffer(e) ) } function i(e) { return ( 'function' === typeof e.readFloatLE && 'function' === typeof e.slice && r(e.slice(0, 0)) ) } t.exports = function (e) { return null != e && (r(e) || i(e) || !!e._isBuffer) } }, {}, ], 32: [ function (t, n, r) { 'use strict' var i = Function.prototype.toString, o = /^\s*class\b/, a = function (t) { try { var n = i.call(t) return o.test(n) } catch (e) { return !1 } }, s = function (t) { try { return !a(t) && (i.call(t), !0) } catch (e) { return !1 } }, l = Object.prototype.toString, c = '[object Function]', u = '[object GeneratorFunction]', h = 'function' === typeof Symbol && 'symbol' === typeof Symbol.toStringTag n.exports = function (e) { if (!e) return !1 if ('function' !== typeof e && 'object' !== typeof e) return !1 if ('function' === typeof e && !e.prototype) return !0 if (h) return s(e) if (a(e)) return !1 var t = l.call(e) return t === c || t === u } }, {}, ], 33: [ function (e, t, n) { t.exports = i var r = Object.prototype.toString function i(e) { var t = r.call(e) return ( '[object Function]' === t || ('function' === typeof e && '[object RegExp]' !== t) || ('undefined' !== typeof window && (e === window.setTimeout || e === window.alert || e === window.confirm || e === window.prompt)) ) } }, {}, ], 34: [ function (e, t, n) { 'use strict' t.exports = function (e) { var t = typeof e return null !== e && ('object' === t || 'function' === t) } }, {}, ], 35: [ function (e, t, n) { var r = {}.toString t.exports = Array.isArray || function (e) { return '[object Array]' == r.call(e) } }, {}, ], 36: [ function (e, t, n) { var r = e('word-wrapper'), i = e('xtend'), o = e('as-number'), a = ['x', 'e', 'a', 'o', 'n', 's', 'r', 'c', 'u', 'm', 'v', 'w', 'z'], s = ['m', 'w'], l = ['H', 'I', 'N', 'E', 'F', 'K', 'L', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'], c = '\t'.charCodeAt(0), u = ' '.charCodeAt(0), h = 0, d = 1, p = 2 function f(e) { ;(this.glyphs = []), (this._measure = this.computeMetrics.bind(this)), this.update(e) } function m(e) { Object.defineProperty(f.prototype, e, { get: v(e), configurable: !0 }) } function v(e) { return new Function( ['return function ' + e + '() {', ' return this._' + e, '}'].join('\n'), )() } function g(e, t) { if (!e.chars || 0 === e.chars.length) return null var n = E(e.chars, t) return n >= 0 ? e.chars[n] : null } function y(e) { for (var t = 0; t < a.length; t++) { var n = a[t].charCodeAt(0), r = E(e.chars, n) if (r >= 0) return e.chars[r].height } return 0 } function b(e) { for (var t = 0; t < s.length; t++) { var n = s[t].charCodeAt(0), r = E(e.chars, n) if (r >= 0) return e.chars[r] } return 0 } function A(e) { for (var t = 0; t < l.length; t++) { var n = l[t].charCodeAt(0), r = E(e.chars, n) if (r >= 0) return e.chars[r].height } return 0 } function w(e, t, n) { if (!e.kernings || 0 === e.kernings.length) return 0 for (var r = e.kernings, i = 0; i < r.length; i++) { var o = r[i] if (o.first === t && o.second === n) return o.amount } return 0 } function x(e) { return 'center' === e ? d : 'right' === e ? p : h } function E(e, t, n) { for (var r = (n = n || 0); r < e.length; r++) if (e[r].id === t) return r return -1 } ;(t.exports = function (e) { return new f(e) }), (f.prototype.update = function (e) { if ( ((e = i({ measure: this._measure }, e)), (this._opt = e), (this._opt.tabSize = o(this._opt.tabSize, 4)), !e.font) ) throw new Error('must provide a valid bitmap font') var t = this.glyphs, n = e.text || '', a = e.font this._setupSpaceGlyphs(a) var s = r.lines(n, e), l = e.width || 0 t.length = 0 var c = s.reduce(function (e, t) { return Math.max(e, t.width, l) }, 0), u = 0, h = 0, f = o(e.lineHeight, a.common.lineHeight), m = a.common.base, v = f - m, g = e.letterSpacing || 0, b = f * s.length - v, E = x(this._opt.align) ;(h -= b), (this._width = c), (this._height = b), (this._descender = f - m), (this._baseline = m), (this._xHeight = y(a)), (this._capHeight = A(a)), (this._lineHeight = f), (this._ascender = f - v - this._xHeight) var M = this s.forEach(function (e, r) { for (var i, o = e.start, s = e.end, l = e.width, m = o; m < s; m++) { var v = n.charCodeAt(m), y = M.getGlyph(a, v) if (y) { i && (u += w(a, i.id, y.id)) var b = u E === d ? (b += (c - l) / 2) : E === p && (b += c - l), t.push({ position: [b, h], data: y, index: m, line: r }), (u += y.xadvance + g), (i = y) } } ;(h += f), (u = 0) }), (this._linesTotal = s.length) }), (f.prototype._setupSpaceGlyphs = function (e) { if ( ((this._fallbackSpaceGlyph = null), (this._fallbackTabGlyph = null), e.chars && 0 !== e.chars.length) ) { var t = g(e, u) || b(e) || e.chars[0], n = this._opt.tabSize * t.xadvance ;(this._fallbackSpaceGlyph = t), (this._fallbackTabGlyph = i(t, { x: 0, y: 0, xadvance: n, id: c, xoffset: 0, yoffset: 0, width: 0, height: 0, })) } }), (f.prototype.getGlyph = function (e, t) { var n = g(e, t) return ( n || (t === c ? this._fallbackTabGlyph : t === u ? this._fallbackSpaceGlyph : null) ) }), (f.prototype.computeMetrics = function (e, t, n, r) { var i, o = this._opt.letterSpacing || 0, a = this._opt.font, s = 0, l = 0, c = 0 if (!a.chars || 0 === a.chars.length) return { start: t, end: t, width: 0 } n = Math.min(e.length, n) for (var u = t; u < n; u++) { var h, d = e.charCodeAt(u) if ((h = this.getGlyph(a, d))) { h.xoffset var p = (s += i ? w(a, i.id, h.id) : 0) + h.xadvance + o, f = s + h.width if (f >= r || p >= r) break ;(s = p), (l = f), (i = h) } c++ } return i && (l += i.xoffset), { start: t, end: t + c, width: l } }), [ 'width', 'height', 'descender', 'ascender', 'xHeight', 'baseline', 'capHeight', 'lineHeight', ].forEach(m) }, { 'as-number': 2, 'word-wrapper': 69, xtend: 72 }, ], 37: [ function (t, n, r) { ;(function (r) { var i = t('xhr'), o = function () {}, a = t('parse-bmfont-ascii'), s = t('parse-bmfont-xml'), l = t('parse-bmfont-binary'), c = t('./lib/is-binary'), u = t('xtend'), h = self.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest() function d(e) { return '[object ArrayBuffer]' === Object.prototype.toString.call(e) } function p(e) { if (h) return u(e, { responseType: 'arraybuffer' }) if ('undefined' === typeof self.XMLHttpRequest) throw new Error('your browser does not support XHR loading') var t = new self.XMLHttpRequest() return ( t.overrideMimeType('text/plain; charset=x-user-defined'), u({ xhr: t }, e) ) } n.exports = function (t, n) { ;(n = 'function' === typeof n ? n : o), 'string' === typeof t ? (t = { uri: t }) : t || (t = {}), t.binary && (t = p(t)), i(t, function (i, u, h) { if (i) return n(i) if (!/^2/.test(u.statusCode)) return n(new Error('http status code: ' + u.statusCode)) if (!h) return n(new Error('no body result')) var p, f = !1 if (d(h)) { var m = new Uint8Array(h) h = new r(m, 'binary') } c(h) && ((f = !0), 'string' === typeof h && (h = new r(h, 'binary'))), f || (r.isBuffer(h) && (h = h.toString(t.encoding)), (h = h.trim())) try { var v = u.headers['content-type'] p = f ? l(h) : /json/.test(v) || '{' === h.charAt(0) ? JSON.parse(h) : /xml/.test(v) || '<' === h.charAt(0) ? s(h) : a(h) } catch (e) { n(new Error('error parsing font ' + e.message)), (n = o) } n(null, p) }) } }.call(this, t('buffer').Buffer)) }, { './lib/is-binary': 38, buffer: 6, 'parse-bmfont-ascii': 43, 'parse-bmfont-binary': 44, 'parse-bmfont-xml': 45, xhr: 70, xtend: 72, }, ], 38: [ function (e, t, n) { ;(function (n) { var r = e('buffer-equal'), i = new n([66, 77, 70, 3]) t.exports = function (e) { return 'string' === typeof e ? 'BMF' === e.substring(0, 3) : e.length > 4 && r(e.slice(0, 4), i) } }.call(this, e('buffer').Buffer)) }, { buffer: 6, 'buffer-equal': 5 }, ], 39: [ function (e, t, n) { 'use strict' var r = Object.getOwnPropertySymbols, i = Object.prototype.hasOwnProperty, o = Object.prototype.propertyIsEnumerable function a(e) { if (null === e || void 0 === e) throw new TypeError('Object.assign cannot be called with null or undefined') return Object(e) } function s() { try { if (!Object.assign) return !1 var e = new String('abc') if (((e[5] = 'de'), '5' === Object.getOwnPropertyNames(e)[0])) return !1 for (var t = {}, n = 0; n < 10; n++) t['_' + String.fromCharCode(n)] = n if ( '0123456789' !== Object.getOwnPropertyNames(t) .map(function (e) { return t[e] }) .join('') ) return !1 var r = {} return ( 'abcdefghijklmnopqrst'.split('').forEach(function (e) { r[e] = e }), 'abcdefghijklmnopqrst' === Object.keys(Object.assign({}, r)).join('') ) } catch (i) { return !1 } } t.exports = s() ? Object.assign : function (e, t) { for (var n, s, l = a(e), c = 1; c < arguments.length; c++) { for (var u in (n = Object(arguments[c]))) i.call(n, u) && (l[u] = n[u]) if (r) { s = r(n) for (var h = 0; h < s.length; h++) o.call(n, s[h]) && (l[s[h]] = n[s[h]]) } } return l } }, {}, ], 40: [ function (t, n, r) { 'use strict' var i if (!Object.keys) { var o = Object.prototype.hasOwnProperty, a = Object.prototype.toString, s = t('./isArguments'), l = Object.prototype.propertyIsEnumerable, c = !l.call({ toString: null }, 'toString'), u = l.call(function () {}, 'prototype'), h = [ 'toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor', ], d = function (e) { var t = e.constructor return t && t.prototype === e }, p = { $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, }, f = (function () { if ('undefined' === typeof window) return !1 for (var t in window) try { if ( !p['$' + t] && o.call(window, t) && null !== window[t] && 'object' === typeof window[t] ) try { d(window[t]) } catch (e) { return !0 } } catch (e) { return !0 } return !1 })(), m = function (t) { if ('undefined' === typeof window || !f) return d(t) try { return d(t) } catch (e) { return !1 } } i = function (e) { var t = null !== e && 'object' === typeof e, n = '[object Function]' === a.call(e), r = s(e), i = t && '[object String]' === a.call(e), l = [] if (!t && !n && !r) throw new TypeError('Object.keys called on a non-object') var d = u && n if (i && e.length > 0 && !o.call(e, 0)) for (var p = 0; p < e.length; ++p) l.push(String(p)) if (r && e.length > 0) for (var f = 0; f < e.length; ++f) l.push(String(f)) else for (var v in e) (d && 'prototype' === v) || !o.call(e, v) || l.push(String(v)) if (c) for (var g = m(e), y = 0; y < h.length; ++y) (g && 'constructor' === h[y]) || !o.call(e, h[y]) || l.push(h[y]) return l } } n.exports = i }, { './isArguments': 42 }, ], 41: [ function (e, t, n) { 'use strict' var r = Array.prototype.slice, i = e('./isArguments'), o = Object.keys, a = o ? function (e) { return o(e) } : e('./implementation'), s = Object.keys ;(a.shim = function () { return ( Object.keys ? (function () { var e = Object.keys(arguments) return e && e.length === arguments.length })(1, 2) || (Object.keys = function (e) { return i(e) ? s(r.call(e)) : s(e) }) : (Object.keys = a), Object.keys || a ) }), (t.exports = a) }, { './implementation': 40, './isArguments': 42 }, ], 42: [ function (e, t, n) { 'use strict' var r = Object.prototype.toString t.exports = function (e) { var t = r.call(e), n = '[object Arguments]' === t return ( n || (n = '[object Array]' !== t && null !== e && 'object' === typeof e && 'number' === typeof e.length && e.length >= 0 && '[object Function]' === r.call(e.callee)), n ) } }, {}, ], 43: [ function (e, t, n) { function r(e, t) { if (!(e = e.replace(/\t+/g, ' ').trim())) return null var n = e.indexOf(' ') if (-1 === n) throw new Error('no named row at line ' + t) var r = e.substring(0, n) e = (e = (e = (e = e.substring(n + 1)).replace( /letter=[\'\"]\S+[\'\"]/gi, '', )).split('=')).map(function (e) { return e.trim().match(/(".*?"|[^"\s]+)+(?=\s*|\s*$)/g) }) for (var o = [], a = 0; a < e.length; a++) { var s = e[a] 0 === a ? o.push({ key: s[0], data: '' }) : a === e.length - 1 ? (o[o.length - 1].data = i(s[0])) : ((o[o.length - 1].data = i(s[0])), o.push({ key: s[1], data: '' })) } var l = { key: r, data: {} } return ( o.forEach(function (e) { l.data[e.key] = e.data }), l ) } function i(e) { return e && 0 !== e.length ? 0 === e.indexOf('"') || 0 === e.indexOf("'") ? e.substring(1, e.length - 1) : -1 !== e.indexOf(',') ? o(e) : parseInt(e, 10) : '' } function o(e) { return e.split(',').map(function (e) { return parseInt(e, 10) }) } t.exports = function (e) { if (!e) throw new Error('no data provided') var t = { pages: [], chars: [], kernings: [] }, n = (e = e.toString().trim()).split(/\r\n?|\n/g) if (0 === n.length) throw new Error('no data in BMFont file') for (var i = 0; i < n.length; i++) { var o = r(n[i], i) if (o) if ('page' === o.key) { if ('number' !== typeof o.data.id) throw new Error('malformed file at line ' + i + ' -- needs page id=N') if ('string' !== typeof o.data.file) throw new Error( 'malformed file at line ' + i + ' -- needs page file="path"', ) t.pages[o.data.id] = o.data.file } else 'chars' === o.key || 'kernings' === o.key || ('char' === o.key ? t.chars.push(o.data) : 'kerning' === o.key ? t.kernings.push(o.data) : (t[o.key] = o.data)) } return t } }, {}, ], 44: [ function (e, t, n) { var r = [66, 77, 70] function i(e, t, n) { if (n > t.length - 1) return 0 var r = t.readUInt8(n++), i = t.readInt32LE(n) switch (((n += 4), r)) { case 1: e.info = o(t, n) break case 2: e.common = a(t, n) break case 3: e.pages = s(t, n, i) break case 4: e.chars = l(t, n, i) break case 5: e.kernings = c(t, n, i) } return 5 + i } function o(e, t) { var n = {} n.size = e.readInt16LE(t) var r = e.readUInt8(t + 2) return ( (n.smooth = (r >> 7) & 1), (n.unicode = (r >> 6) & 1), (n.italic = (r >> 5) & 1), (n.bold = (r >> 4) & 1), (r >> 3) & 1 && (n.fixedHeight = 1), (n.charset = e.readUInt8(t + 3) || ''), (n.stretchH = e.readUInt16LE(t + 4)), (n.aa = e.readUInt8(t + 6)), (n.padding = [ e.readInt8(t + 7), e.readInt8(t + 8), e.readInt8(t + 9), e.readInt8(t + 10), ]), (n.spacing = [e.readInt8(t + 11), e.readInt8(t + 12)]), (n.outline = e.readUInt8(t + 13)), (n.face = h(e, t + 14)), n ) } function a(e, t) { var n = {} return ( (n.lineHeight = e.readUInt16LE(t)), (n.base = e.readUInt16LE(t + 2)), (n.scaleW = e.readUInt16LE(t + 4)), (n.scaleH = e.readUInt16LE(t + 6)), (n.pages = e.readUInt16LE(t + 8)), e.readUInt8(t + 10), (n.packed = 0), (n.alphaChnl = e.readUInt8(t + 11)), (n.redChnl = e.readUInt8(t + 12)), (n.greenChnl = e.readUInt8(t + 13)), (n.blueChnl = e.readUInt8(t + 14)), n ) } function s(e, t, n) { for (var r = [], i = u(e, t), o = i.length + 1, a = n / o, s = 0; s < a; s++) (r[s] = e.slice(t, t + i.length).toString('utf8')), (t += o) return r } function l(e, t, n) { for (var r = [], i = n / 20, o = 0; o < i; o++) { var a = {}, s = 20 * o ;(a.id = e.readUInt32LE(t + 0 + s)), (a.x = e.readUInt16LE(t + 4 + s)), (a.y = e.readUInt16LE(t + 6 + s)), (a.width = e.readUInt16LE(t + 8 + s)), (a.height = e.readUInt16LE(t + 10 + s)), (a.xoffset = e.readInt16LE(t + 12 + s)), (a.yoffset = e.readInt16LE(t + 14 + s)), (a.xadvance = e.readInt16LE(t + 16 + s)), (a.page = e.readUInt8(t + 18 + s)), (a.chnl = e.readUInt8(t + 19 + s)), (r[o] = a) } return r } function c(e, t, n) { for (var r = [], i = n / 10, o = 0; o < i; o++) { var a = {}, s = 10 * o ;(a.first = e.readUInt32LE(t + 0 + s)), (a.second = e.readUInt32LE(t + 4 + s)), (a.amount = e.readInt16LE(t + 8 + s)), (r[o] = a) } return r } function u(e, t) { for (var n = t; n < e.length && 0 !== e[n]; n++); return e.slice(t, n) } function h(e, t) { return u(e, t).toString('utf8') } t.exports = function (e) { if (e.length < 6) throw new Error('invalid buffer length for BMFont') if ( !r.every(function (t, n) { return e.readUInt8(n) === t }) ) throw new Error('BMFont missing BMF byte header') var t = 3 if (e.readUInt8(t++) > 3) throw new Error('Only supports BMFont Binary v3 (BMFont App v1.10)') for (var n = { kernings: [], chars: [] }, o = 0; o < 5; o++) t += i(n, e, t) return n } }, {}, ], 45: [ function (e, t, n) { var r = e('./parse-attribs'), i = e('xml-parse-from-string'), o = { scaleh: 'scaleH', scalew: 'scaleW', stretchh: 'stretchH', lineheight: 'lineHeight', alphachnl: 'alphaChnl', redchnl: 'redChnl', greenchnl: 'greenChnl', bluechnl: 'blueChnl', } function a(e) { return s(e).reduce(function (e, t) { return (e[l(t.nodeName)] = t.nodeValue), e }, {}) } function s(e) { for (var t = [], n = 0; n < e.attributes.length; n++) t.push(e.attributes[n]) return t } function l(e) { return o[e.toLowerCase()] || e } t.exports = function (e) { e = e.toString() var t = i(e), n = { pages: [], chars: [], kernings: [] } ;['info', 'common'].forEach(function (e) { var i = t.getElementsByTagName(e)[0] i && (n[e] = r(a(i))) }) var o = t.getElementsByTagName('pages')[0] if (!o) throw new Error('malformed file -- no element') for (var s = o.getElementsByTagName('page'), l = 0; l < s.length; l++) { var c = s[l], u = parseInt(c.getAttribute('id'), 10), h = c.getAttribute('file') if (isNaN(u)) throw new Error('malformed file -- page "id" attribute is NaN') if (!h) throw new Error('malformed file -- needs page "file" attribute') n.pages[parseInt(u, 10)] = h } return ( ['chars', 'kernings'].forEach(function (e) { var i = t.getElementsByTagName(e)[0] if (i) for ( var o = e.substring(0, e.length - 1), s = i.getElementsByTagName(o), l = 0; l < s.length; l++ ) { var c = s[l] n[e].push(r(a(c))) } }), n ) } }, { './parse-attribs': 46, 'xml-parse-from-string': 71 }, ], 46: [ function (e, t, n) { var r = 'chasrset' function i(e) { return e.split(',').map(function (e) { return parseInt(e, 10) }) } t.exports = function (e) { for (var t in (r in e && ((e.charset = e[r]), delete e[r]), e)) 'face' !== t && 'charset' !== t && (e[t] = 'padding' === t || 'spacing' === t ? i(e[t]) : parseInt(e[t], 10)) return e } }, {}, ], 47: [ function (e, t, n) { var r = e('string.prototype.trim'), i = e('for-each'), o = function (e) { return '[object Array]' === Object.prototype.toString.call(e) } t.exports = function (e) { if (!e) return {} var t = {} return ( i(r(e).split('\n'), function (e) { var n = e.indexOf(':'), i = r(e.slice(0, n)).toLowerCase(), a = r(e.slice(n + 1)) 'undefined' === typeof t[i] ? (t[i] = a) : o(t[i]) ? t[i].push(a) : (t[i] = [t[i], a]) }), t ) } }, { 'for-each': 24, 'string.prototype.trim': 53 }, ], 48: [ function (e, t, n) { ;(function (e) { var n = e.performance || {}, r = (function () { for (var e = ['now', 'webkitNow', 'msNow', 'mozNow', 'oNow']; e.length; ) { var t = e.shift() if (t in n) return n[t].bind(n) } var r = Date.now || function () { return new Date().getTime() }, i = (n.timing || {}).navigationStart || r() return function () { return r() - i } })() ;(r.performanceNow = n.now), (r.noConflict = function () { n.now = r.performanceNow }), (r.conflict = function () { n.now = r }), r.conflict(), (t.exports = r) }.call( this, 'undefined' !== typeof r.g ? r.g : 'undefined' !== typeof self ? self : 'undefined' !== typeof window ? window : {}, )) }, {}, ], 49: [ function (t, n, r) { var i, o, a = (n.exports = {}) function s() { throw new Error('setTimeout has not been defined') } function l() { throw new Error('clearTimeout has not been defined') } function c(t) { if (i === setTimeout) return setTimeout(t, 0) if ((i === s || !i) && setTimeout) return (i = setTimeout), setTimeout(t, 0) try { return i(t, 0) } catch (e) { try { return i.call(null, t, 0) } catch (e) { return i.call(this, t, 0) } } } function u(t) { if (o === clearTimeout) return clearTimeout(t) if ((o === l || !o) && clearTimeout) return (o = clearTimeout), clearTimeout(t) try { return o(t) } catch (e) { try { return o.call(null, t) } catch (e) { return o.call(this, t) } } } !(function () { try { i = 'function' === typeof setTimeout ? setTimeout : s } catch (e) { i = s } try { o = 'function' === typeof clearTimeout ? clearTimeout : l } catch (e) { o = l } })() var h, d = [], p = !1, f = -1 function m() { p && h && ((p = !1), h.length ? (d = h.concat(d)) : (f = -1), d.length && v()) } function v() { if (!p) { var e = c(m) p = !0 for (var t = d.length; t; ) { for (h = d, d = []; ++f < t; ) h && h[f].run() ;(f = -1), (t = d.length) } ;(h = null), (p = !1), u(e) } } function g(e, t) { ;(this.fun = e), (this.array = t) } function y() {} ;(a.nextTick = function (e) { var t = new Array(arguments.length - 1) if (arguments.length > 1) for (var n = 1; n < arguments.length; n++) t[n - 1] = arguments[n] d.push(new g(e, t)), 1 !== d.length || p || c(v) }), (g.prototype.run = function () { this.fun.apply(null, this.array) }), (a.title = 'browser'), (a.browser = !0), (a.env = {}), (a.argv = []), (a.version = ''), (a.versions = {}), (a.on = y), (a.addListener = y), (a.once = y), (a.off = y), (a.removeListener = y), (a.removeAllListeners = y), (a.emit = y), (a.prependListener = y), (a.prependOnceListener = y), (a.listeners = function (e) { return [] }), (a.binding = function (e) { throw new Error('process.binding is not supported') }), (a.cwd = function () { return '/' }), (a.chdir = function (e) { throw new Error('process.chdir is not supported') }), (a.umask = function () { return 0 }) }, {}, ], 50: [ function (t, n, r) { ;(function (t) { !(function (r) { var i = setTimeout, o = ('function' === typeof t && t) || function (e) { i(e, 1) } function a(e, t) { return function () { e.apply(t, arguments) } } var s = Array.isArray || function (e) { return '[object Array]' === Object.prototype.toString.call(e) } function l(e) { if ('object' !== typeof this) throw new TypeError('Promises must be constructed via new') if ('function' !== typeof e) throw new TypeError('not a function') ;(this._state = null), (this._value = null), (this._deferreds = []), f(e, a(u, this), a(h, this)) } function c(t) { var n = this null !== this._state ? o(function () { var r = n._state ? t.onFulfilled : t.onRejected if (null !== r) { var i try { i = r(n._value) } catch (e) { return void t.reject(e) } t.resolve(i) } else (n._state ? t.resolve : t.reject)(n._value) }) : this._deferreds.push(t) } function u(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(a(n, t), a(u, this), a(h, this)) } ;(this._state = !0), (this._value = t), d.call(this) } catch (e) { h.call(this, e) } } function h(e) { ;(this._state = !1), (this._value = e), d.call(this) } function d() { for (var e = 0, t = this._deferreds.length; e < t; e++) c.call(this, this._deferreds[e]) this._deferreds = null } function p(e, t, n, r) { ;(this.onFulfilled = 'function' === typeof e ? e : null), (this.onRejected = 'function' === typeof t ? t : null), (this.resolve = n), (this.reject = r) } function f(e, t, n) { var r = !1 try { e( function (e) { r || ((r = !0), t(e)) }, function (e) { r || ((r = !0), n(e)) }, ) } catch (i) { if (r) return ;(r = !0), n(i) } } ;(l.prototype.catch = function (e) { return this.then(null, e) }), (l.prototype.then = function (e, t) { var n = this return new l(function (r, i) { c.call(n, new p(e, t, r, i)) }) }), (l.all = function () { var e = Array.prototype.slice.call( 1 === arguments.length && s(arguments[0]) ? arguments[0] : arguments, ) return new l(function (t, n) { if (0 === e.length) return t([]) var r = e.length function i(o, a) { try { if (a && ('object' === typeof a || 'function' === typeof a)) { var s = a.then if ('function' === typeof s) return void s.call( a, function (e) { i(o, e) }, n, ) } ;(e[o] = a), 0 === --r && t(e) } catch (l) { n(l) } } for (var o = 0; o < e.length; o++) i(o, e[o]) }) }), (l.resolve = function (e) { return e && 'object' === typeof e && e.constructor === l ? e : new l(function (t) { t(e) }) }), (l.reject = function (e) { return new l(function (t, n) { n(e) }) }), (l.race = function (e) { return new l(function (t, n) { for (var r = 0, i = e.length; r < i; r++) e[r].then(t, n) }) }), (l._setImmediateFn = function (e) { o = e }), 'undefined' !== typeof n && n.exports ? (n.exports = l) : r.Promise || (r.Promise = l) })(this) }.call(this, t('timers').setImmediate)) }, { timers: 67 }, ], 51: [ function (e, t, n) { var r = e('dtype'), i = e('an-array'), o = e('is-buffer'), a = [0, 2, 3], s = [2, 1, 3] t.exports = function (e, t) { ;(e && (i(e) || o(e))) || ((t = e || {}), (e = null)) for ( var n = 'string' === typeof (t = 'number' === typeof t ? { count: t } : t || {}).type ? t.type : 'uint16', l = 'number' === typeof t.count ? t.count : 1, c = t.start || 0, u = !1 !== t.clockwise ? a : s, h = u[0], d = u[1], p = u[2], f = 6 * l, m = e || new (r(n))(f), v = 0, g = 0; v < f; v += 6, g += 4 ) { var y = v + c ;(m[y + 0] = g + 0), (m[y + 1] = g + 1), (m[y + 2] = g + 2), (m[y + 3] = g + h), (m[y + 4] = g + d), (m[y + 5] = g + p) } return m } }, { 'an-array': 1, dtype: 13, 'is-buffer': 31 }, ], 52: [ function (e, t, n) { 'use strict' var r = e('function-bind'), i = e('es-abstract/es5'), o = r.call(Function.call, String.prototype.replace), a = /^[\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]+/, s = /[\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]+$/ t.exports = function () { var e = i.ToString(i.CheckObjectCoercible(this)) return o(o(e, a, ''), s, '') } }, { 'es-abstract/es5': 15, 'function-bind': 26 }, ], 53: [ function (e, t, n) { 'use strict' var r = e('function-bind'), i = e('define-properties'), o = e('./implementation'), a = e('./polyfill'), s = e('./shim'), l = r.call(Function.call, a()) i(l, { getPolyfill: a, implementation: o, shim: s }), (t.exports = l) }, { './implementation': 52, './polyfill': 54, './shim': 55, 'define-properties': 11, 'function-bind': 26, }, ], 54: [ function (e, t, n) { 'use strict' var r = e('./implementation'), i = '\u200b' t.exports = function () { return String.prototype.trim && i.trim() === i ? String.prototype.trim : r } }, { './implementation': 52 }, ], 55: [ function (e, t, n) { 'use strict' var r = e('define-properties'), i = e('./polyfill') t.exports = function () { var e = i() return ( r( String.prototype, { trim: e }, { trim: function () { return String.prototype.trim !== e }, }, ), e ) } }, { './polyfill': 54, 'define-properties': 11 }, ], 56: [ function (t, n, r) { 'use strict' var i = { update: null, begin: null, loopBegin: null, changeBegin: null, change: null, changeComplete: null, loopComplete: null, complete: null, loop: 1, direction: 'normal', autoplay: !0, timelineOffset: 0, }, o = { duration: 1e3, delay: 0, endDelay: 0, easing: 'easeOutElastic(1, .5)', round: 0, }, a = [ 'translateX', 'translateY', 'translateZ', 'rotate', 'rotateX', 'rotateY', 'rotateZ', 'scale', 'scaleX', 'scaleY', 'scaleZ', 'skew', 'skewX', 'skewY', 'perspective', ], s = { CSS: {}, springs: {} } function l(e, t, n) { return Math.min(Math.max(e, t), n) } function c(e, t) { return e.indexOf(t) > -1 } function u(e, t) { return e.apply(null, t) } var h = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i, d = /^rgb/, p = /^hsl/, f = { arr: function (e) { return Array.isArray(e) }, obj: function (e) { return c(Object.prototype.toString.call(e), 'Object') }, pth: function (e) { return f.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 || f.svg(e) }, str: function (e) { return 'string' === typeof e }, fnc: function (e) { return 'function' === typeof e }, und: function (e) { return 'undefined' === typeof e }, hex: function (e) { return h.test(e) }, rgb: function (e) { return d.test(e) }, hsl: function (e) { return p.test(e) }, col: function (e) { return f.hex(e) || f.rgb(e) || f.hsl(e) }, key: function (e) { return ( !i.hasOwnProperty(e) && !o.hasOwnProperty(e) && 'targets' !== e && 'keyframes' !== e ) }, }, m = /\(([^)]+)\)/ function v(e) { var t = m.exec(e) return t ? t[1].split(',').map(function (e) { return parseFloat(e) }) : [] } function g(e, t) { var n = v(e), r = l(f.und(n[0]) ? 1 : n[0], 0.1, 100), i = l(f.und(n[1]) ? 100 : n[1], 0.1, 100), o = l(f.und(n[2]) ? 10 : n[2], 0.1, 100), a = l(f.und(n[3]) ? 0 : n[3], 0.1, 100), c = Math.sqrt(i / r), u = o / (2 * Math.sqrt(i * r)), h = u < 1 ? c * Math.sqrt(1 - u * u) : 0, d = 1, p = u < 1 ? (u * c - a) / h : -a + c function m(e) { var n = t ? (t * e) / 1e3 : e return ( (n = u < 1 ? Math.exp(-n * u * c) * (d * Math.cos(h * n) + p * Math.sin(h * n)) : (d + p * n) * Math.exp(-n * c)), 0 === e || 1 === e ? e : 1 - n ) } function g() { var t = s.springs[e] if (t) return t for (var n = 1 / 6, r = 0, i = 0; ; ) if (1 === m((r += n))) { if (++i >= 16) break } else i = 0 var o = r * n * 1e3 return (s.springs[e] = o), o } return t ? m : g } function y(e, t) { void 0 === e && (e = 1), void 0 === t && (t = 0.5) var n = l(e, 1, 10), r = l(t, 0.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 b(e) { return ( void 0 === e && (e = 10), function (t) { return Math.round(t * e) * (1 / e) } ) } var A = (function () { var e = 11, t = 1 / (e - 1) function n(e, t) { return 1 - 3 * t + 3 * e } function r(e, t) { return 3 * t - 6 * e } function i(e) { return 3 * e } function o(e, t, o) { return ((n(t, o) * e + r(t, o)) * e + i(t)) * e } function a(e, t, o) { return 3 * n(t, o) * e * e + 2 * r(t, o) * e + i(t) } function s(e, t, n, r, i) { var a, s, l = 0 do { ;(a = o((s = t + (n - t) / 2), r, i) - e) > 0 ? (n = s) : (t = s) } while (Math.abs(a) > 1e-7 && ++l < 10) return s } function l(e, t, n, r) { for (var i = 0; i < 4; ++i) { var s = a(t, n, r) if (0 === s) return t t -= (o(t, n, r) - e) / s } return t } function c(n, r, i, c) { if (0 <= n && n <= 1 && 0 <= i && i <= 1) { var u = new Float32Array(e) if (n !== r || i !== c) for (var h = 0; h < e; ++h) u[h] = o(h * t, n, i) return function (e) { return (n === r && i === c) || 0 === e || 1 === e ? e : o(d(e), r, c) } } function d(r) { for (var o = 0, c = 1, h = e - 1; c !== h && u[c] <= r; ++c) o += t --c var d = o + ((r - u[c]) / (u[c + 1] - u[c])) * t, p = a(d, n, i) return p >= 0.001 ? l(r, d, n, i) : 0 === p ? d : s(r, o, o + t, n, i) } } return c })(), w = (function () { var e = [ 'Quad', 'Cubic', 'Quart', 'Quint', 'Sine', 'Expo', 'Circ', 'Back', 'Elastic', ], t = { In: [ [0.55, 0.085, 0.68, 0.53], [0.55, 0.055, 0.675, 0.19], [0.895, 0.03, 0.685, 0.22], [0.755, 0.05, 0.855, 0.06], [0.47, 0, 0.745, 0.715], [0.95, 0.05, 0.795, 0.035], [0.6, 0.04, 0.98, 0.335], [0.6, -0.28, 0.735, 0.045], y, ], Out: [ [0.25, 0.46, 0.45, 0.94], [0.215, 0.61, 0.355, 1], [0.165, 0.84, 0.44, 1], [0.23, 1, 0.32, 1], [0.39, 0.575, 0.565, 1], [0.19, 1, 0.22, 1], [0.075, 0.82, 0.165, 1], [0.175, 0.885, 0.32, 1.275], function (e, t) { return function (n) { return 1 - y(e, t)(1 - n) } }, ], InOut: [ [0.455, 0.03, 0.515, 0.955], [0.645, 0.045, 0.355, 1], [0.77, 0, 0.175, 1], [0.86, 0, 0.07, 1], [0.445, 0.05, 0.55, 0.95], [1, 0, 0, 1], [0.785, 0.135, 0.15, 0.86], [0.68, -0.55, 0.265, 1.55], function (e, t) { return function (n) { return n < 0.5 ? y(e, t)(2 * n) / 2 : 1 - y(e, t)(-2 * n + 2) / 2 } }, ], }, n = { linear: [0.25, 0.25, 0.75, 0.75] } for (var r in t) for (var i = 0, o = t[r].length; i < o; i++) n['ease' + r + e[i]] = t[r][i] return n })() function x(e, t) { if (f.fnc(e)) return e var n = e.split('(')[0], r = w[n], i = v(e) switch (n) { case 'spring': return g(e, t) case 'cubicBezier': return u(A, i) case 'steps': return u(b, i) default: return f.fnc(r) ? u(r, i) : u(A, r) } } function E(t) { try { return document.querySelectorAll(t) } catch (e) { return } } var M = [] function _(e, t) { for ( var n = M, r = e.length, i = arguments.length >= 2 ? arguments[1] : void 0, o = 0; o < r; o++ ) if (o in e) { var a = e[o] t.call(i, a, o, e) && n.push(a) } return ((M = e).length = 0), n } function T(e, t) { t || (t = []) for (var n = 0, r = e.length; n < r; n++) { var i = e[n] Array.isArray(i) ? T(i, t) : t.push(i) } return t } function S(e) { return f.arr(e) ? e : (f.str(e) && (e = E(e) || e), e instanceof NodeList || e instanceof HTMLCollection ? [].slice.call(e) : [e]) } function C(e, t) { return e.some(function (e) { return e === t }) } function L(e) { var t = {} for (var n in e) t[n] = e[n] return t } function R(e, t) { var n = L(e) for (var r in e) n[r] = t.hasOwnProperty(r) ? t[r] : e[r] return n } function P(e, t) { var n = L(e) for (var r in t) n[r] = f.und(e[r]) ? t[r] : e[r] return n } var D = /rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g function O(e) { var t = D.exec(e) return t ? 'rgba(' + t[1] + ',1)' : e } var I = /^#?([a-f\d])([a-f\d])([a-f\d])$/i, B = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i function F(e) { var t = e.replace(I, function (e, t, n, r) { return t + t + n + n + r + r }), n = B.exec(t) return ( 'rgba(' + parseInt(n[1], 16) + ',' + parseInt(n[2], 16) + ',' + parseInt(n[3], 16) + ',1)' ) } var k = /hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g, N = /hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g function U(e) { var t, n, r, i = k.exec(e) || N.exec(e), o = parseInt(i[1], 10) / 360, a = parseInt(i[2], 10) / 100, s = parseInt(i[3], 10) / 100, l = i[4] || 1 function c(e, t, n) { return ( n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? e + 6 * (t - e) * n : n < 0.5 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e ) } if (0 == a) t = n = r = s else { var u = s < 0.5 ? s * (1 + a) : s + a - s * a, h = 2 * s - u ;(t = c(h, u, o + 1 / 3)), (n = c(h, u, o)), (r = c(h, u, o - 1 / 3)) } return 'rgba(' + 255 * t + ',' + 255 * n + ',' + 255 * r + ',' + l + ')' } function H(e) { return f.rgb(e) ? O(e) : f.hex(e) ? F(e) : f.hsl(e) ? U(e) : void 0 } var G = /([\+\-]?[0-9#\.]+)(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/ function z(e) { var t = G.exec(e) if (t) return t[2] } function j(e) { return c(e, 'translate') || 'perspective' === e ? 'px' : c(e, 'rotate') || c(e, 'skew') ? 'deg' : void 0 } function V(e, t) { return f.fnc(e) ? e(t.target, t.id, t.total) : e } function W(e, t) { return e.getAttribute(t) } function q(e, t, n) { if (C([n, 'deg', 'rad', 'turn'], z(t))) return t var r = s.CSS[t + n] if (!f.und(r)) return r var i = 100, o = document.createElement(e.tagName), a = e.parentNode && e.parentNode !== document ? e.parentNode : document.body a.appendChild(o), (o.style.position = 'absolute'), (o.style.width = i + n) var l = i / o.offsetWidth a.removeChild(o) var c = l * parseFloat(t) return (s.CSS[t + n] = c), c } function X(e, t, n) { if (t in e.style) { var r = t.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(), i = e.style[t] || getComputedStyle(e).getPropertyValue(r) || '0' return n ? q(e, i, n) : i } } function Y(e, t) { return f.dom(e) && !f.inp(e) && (W(e, t) || (f.svg(e) && e[t])) ? 'attribute' : f.dom(e) && C(a, t) ? 'transform' : f.dom(e) && 'transform' !== t && X(e, t) ? 'css' : null != e[t] ? 'object' : void 0 } var Q = /(\w+)\(([^)]*)\)/g function Z(e) { if (f.dom(e)) { for (var t, n = e.style.transform || '', r = new Map(); (t = Q.exec(n)); ) r.set(t[1], t[2]) return r } } function K(e, t, n, r) { var i = c(t, 'scale') ? 1 : 0 + j(t), o = Z(e).get(t) || i return ( n && (n.transforms.list.set(t, o), (n.transforms.last = t)), r ? q(e, o, r) : o ) } function J(e, t, n, r) { switch (Y(e, t)) { case 'transform': return K(e, t, r, n) case 'css': return X(e, t, n) case 'attribute': return W(e, t) default: return e[t] || 0 } } var $ = /^(\*=|\+=|-=)/ function ee(e, t) { var n = $.exec(e) if (!n) return e var r = z(e) || 0, i = parseFloat(t), o = parseFloat(e.replace(n[0], '')) switch (n[0][0]) { case '+': return i + o + r case '-': return i - o + r case '*': return i * o + r } } var te = /\s/g function ne(e, t) { if (f.col(e)) return H(e) var n = z(e), r = n ? e.substr(0, e.length - n.length) : e return t && !te.test(e) ? r + t : r } function re(e, t) { return Math.sqrt(Math.pow(t.x - e.x, 2) + Math.pow(t.y - e.y, 2)) } function ie(e) { return 2 * Math.PI * W(e, 'r') } function oe(e) { return 2 * W(e, 'width') + 2 * W(e, 'height') } function ae(e) { return re({ x: W(e, 'x1'), y: W(e, 'y1') }, { x: W(e, 'x2'), y: W(e, 'y2') }) } function se(e) { for (var t, n = e.points, r = 0, i = 0; i < n.numberOfItems; i++) { var o = n.getItem(i) i > 0 && (r += re(t, o)), (t = o) } return r } function le(e) { var t = e.points return se(e) + re(t.getItem(t.numberOfItems - 1), t.getItem(0)) } function ce(e) { if (e.getTotalLength) return e.getTotalLength() switch (e.tagName.toLowerCase()) { case 'circle': return ie(e) case 'rect': return oe(e) case 'line': return ae(e) case 'polyline': return se(e) case 'polygon': return le(e) } } function ue(e) { var t = ce(e) return e.setAttribute('stroke-dasharray', t), t } function he(e) { for ( var t = e.parentNode; f.svg(t) && ((t = t.parentNode), f.svg(t.parentNode)); ); return t } function de(e, t) { var n = t || {}, r = n.el || he(e), i = r.getBoundingClientRect(), o = W(r, 'viewBox'), a = i.width, s = i.height, l = n.viewBox || (o ? o.split(' ') : [0, 0, a, s]) return { el: r, viewBox: l, x: l[0] / 1, y: l[1] / 1, w: a / l[2], h: s / l[3] } } function pe(e, t) { var n = f.str(e) ? E(e)[0] : e, r = t || 100 return function (e) { return { property: e, el: n, svg: de(n), totalLength: ce(n) * (r / 100) } } } function fe(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 = de(e.el, e.svg), i = n(), o = n(-1), a = n(1) switch (e.property) { case 'x': return (i.x - r.x) * r.w case 'y': return (i.y - r.y) * r.h case 'angle': return (180 * Math.atan2(a.y - o.y, a.x - o.x)) / Math.PI } } var me = /-?\d*\.?\d+/g function ve(e, t) { var n = ne(f.pth(e) ? e.totalLength : e, t) + '' return { original: n, numbers: n.match(me) ? n.match(me).map(Number) : [0], strings: f.str(e) || t ? n.split(me) : [], } } function ge(e) { return _(e ? T(f.arr(e) ? e.map(S) : S(e)) : [], function (e, t, n) { return n.indexOf(e) === t }) } function ye(e) { var t = ge(e) return t.map(function (e, n) { return { target: e, id: n, total: t.length, transforms: { list: Z(e) } } }) } var be = /^spring/ function Ae(e, t) { var n = L(t) if ((be.test(n.easing) && (n.duration = g(n.easing)), f.arr(e))) { var r = e.length 2 !== r || f.obj(e[0]) ? f.fnc(t.duration) || (n.duration = t.duration / r) : (e = { value: e }) } var i = f.arr(e) ? e : [e] return i .map(function (e, n) { var r = f.obj(e) && !f.pth(e) ? e : { value: e } return ( f.und(r.delay) && (r.delay = n ? 0 : t.delay), f.und(r.endDelay) && (r.endDelay = n === i.length - 1 ? t.endDelay : 0), r ) }) .map(function (e) { return P(e, n) }) } function we(e) { for ( var t = _( T( e.map(function (e) { return Object.keys(e) }), ), function (e) { return f.key(e) }, ).reduce(function (e, t) { return e.indexOf(t) < 0 && e.push(t), e }, []), n = {}, r = function (r) { var i = t[r] n[i] = e.map(function (e) { var t = {} for (var n in e) f.key(n) ? n == i && (t.value = e[n]) : (t[n] = e[n]) return t }) }, i = 0; i < t.length; i++ ) r(i) return n } function xe(e, t) { var n = [], r = t.keyframes for (var i in (r && (t = P(we(r), t)), t)) f.key(i) && n.push({ name: i, tweens: Ae(t[i], e) }) return n } function Ee(e, t) { var n = {} for (var r in e) { var i = V(e[r], t) f.arr(i) && 1 === (i = i.map(function (e) { return V(e, t) })).length && (i = i[0]), (n[r] = i) } return (n.duration = parseFloat(n.duration)), (n.delay = parseFloat(n.delay)), n } function Me(e, t) { var n return e.tweens.map(function (r) { var i = Ee(r, t), o = i.value, a = f.arr(o) ? o[1] : o, s = z(a), l = J(t.target, e.name, s, t), c = n ? n.to.original : l, u = f.arr(o) ? o[0] : c, h = z(u) || z(l), d = s || h return ( f.und(a) && (a = c), (i.from = ve(u, d)), (i.to = ve(ee(a, u), d)), (i.start = n ? n.end : 0), (i.end = i.start + i.delay + i.duration + i.endDelay), (i.easing = x(i.easing, i.duration)), (i.isPath = f.pth(o)), (i.isColor = f.col(i.from.original)), i.isColor && (i.round = 1), (n = i), i ) }) } var _e = { 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, i) { if ((r.list.set(t, n), t === r.last || i)) { var o = '' r.list.forEach(function (e, t) { o += t + '(' + e + ') ' }), (e.style.transform = o) } }, } function Te(e, t) { for (var n = ye(e), r = 0, i = n.length; r < i; r++) { var o = n[r] for (var a in t) { var s = V(t[a], o), l = o.target, c = z(s), u = J(l, a, c, o), h = ee(ne(s, c || z(u)), u), d = Y(l, a) _e[d](l, a, h, o.transforms, !0) } } } function Se(e, t) { var n = Y(e.target, t.name) if (n) { var r = Me(t, e), i = r[r.length - 1] return { type: n, property: t.name, animatable: e, tweens: r, duration: i.end, delay: r[0].delay, endDelay: i.endDelay, } } } function Ce(e, t) { return _( T( e.map(function (e) { return t.map(function (t) { return Se(e, t) }) }), ), function (e) { return !f.und(e) }, ) } function Le(e, t) { var n = e.length, r = function (e) { return e.timelineOffset ? e.timelineOffset : 0 }, i = {} return ( (i.duration = n ? Math.max.apply( Math, e.map(function (e) { return r(e) + e.duration }), ) : t.duration), (i.delay = n ? Math.min.apply( Math, e.map(function (e) { return r(e) + e.delay }), ) : t.delay), (i.endDelay = n ? i.duration - Math.max.apply( Math, e.map(function (e) { return r(e) + e.duration - e.endDelay }), ) : t.endDelay), i ) } var Re = 0 function Pe(e) { var t = R(i, e), n = R(o, e), r = xe(n, e), a = ye(e.targets), s = Ce(a, r), l = Le(s, n), c = Re return ( Re++, P(t, { id: c, children: [], animatables: a, animations: s, duration: l.duration, delay: l.delay, endDelay: l.endDelay, }) ) } var De, Oe = [], Ie = [], Be = (function () { function e() { De = requestAnimationFrame(t) } function t(t) { var n = Oe.length if (n) { for (var r = 0; r < n; ) { var i = Oe[r] if (i.paused) { var o = Oe.indexOf(i) o > -1 && (Oe.splice(o, 1), (n = Oe.length)) } else i.tick(t) r++ } e() } else De = cancelAnimationFrame(De) } return e })() function Fe() { if (document.hidden) { for (var e = 0, t = Oe.length; e < t; e++) activeInstance[e].pause() ;(Ie = Oe.slice(0)), (Oe = []) } else for (var n = 0, r = Ie.length; n < r; n++) Ie[n].play() } function ke(e) { void 0 === e && (e = {}) var t, n = 0, r = 0, i = 0, o = 0, a = null function s() { return ( window.Promise && new Promise(function (e) { return (a = e) }) ) } var c = s(), u = Pe(e) function h() { u.reversed = !u.reversed for (var e = 0, n = t.length; e < n; e++) t[e].reversed = u.reversed } function d(e) { return u.reversed ? u.duration - e : e } function p() { ;(n = 0), (r = d(u.currentTime) * (1 / ke.speed)) } function f(e, t) { t && t.seek(e - t.timelineOffset) } function m(e) { if (u.reversePlayback) for (var n = o; n--; ) f(e, t[n]) else for (var r = 0; r < o; r++) f(e, t[r]) } function v(e) { for (var t = 0, n = u.animations, r = n.length; t < r; ) { var i = n[t], o = i.animatable, a = i.tweens, s = a.length - 1, c = a[s] s && (c = _(a, function (t) { return e < t.end })[0] || c) for ( var h = l(e - c.start - c.delay, 0, c.duration) / c.duration, d = isNaN(h) ? 1 : c.easing(h), p = c.to.strings, f = c.round, m = [], v = c.to.numbers.length, g = void 0, y = 0; y < v; y++ ) { var b = void 0, A = c.to.numbers[y], w = c.from.numbers[y] || 0 ;(b = c.isPath ? fe(c.value, d * A) : w + d * (A - w)), f && ((c.isColor && y > 2) || (b = Math.round(b * f) / f)), m.push(b) } var x = p.length if (x) { g = p[0] for (var E = 0; E < x; E++) { p[E] var M = p[E + 1], T = m[E] isNaN(T) || (g += M ? T + M : T + ' ') } } else g = m[0] _e[i.type](o.target, i.property, g, o.transforms), (i.currentValue = g), t++ } } function g(e) { u[e] && !u.passThrough && u[e](u) } function y() { u.remaining && !0 !== u.remaining && u.remaining-- } function b(e) { var o = u.duration, p = u.delay, f = o - u.endDelay, b = d(e) ;(u.progress = l((b / o) * 100, 0, 100)), (u.reversePlayback = b < u.currentTime), t && m(b), !u.began && u.currentTime > 0 && ((u.began = !0), g('begin'), g('loopBegin')), b <= p && 0 !== u.currentTime && v(0), ((b >= f && u.currentTime !== o) || !o) && v(o), b > p && b < f ? (u.changeBegan || ((u.changeBegan = !0), (u.changeCompleted = !1), g('changeBegin')), g('change'), v(b)) : u.changeBegan && ((u.changeCompleted = !0), (u.changeBegan = !1), g('changeComplete')), (u.currentTime = l(b, 0, o)), u.began && g('update'), e >= o && ((r = 0), y(), u.remaining ? ((n = i), g('loopComplete'), g('loopBegin'), 'alternate' === u.direction && h()) : ((u.paused = !0), u.completed || ((u.completed = !0), g('loopComplete'), g('complete'), 'Promise' in window && (a(), (c = s()))))) } return ( (u.reset = function () { var e = u.direction ;(u.passThrough = !1), (u.currentTime = 0), (u.progress = 0), (u.paused = !0), (u.began = !1), (u.changeBegan = !1), (u.completed = !1), (u.changeCompleted = !1), (u.reversePlayback = !1), (u.reversed = 'reverse' === e), (u.remaining = u.loop), (t = u.children) for (var n = (o = t.length); n--; ) u.children[n].reset() ;((u.reversed && !0 !== u.loop) || ('alternate' === e && 1 === u.loop)) && u.remaining++, v(0) }), (u.set = function (e, t) { return Te(e, t), u }), (u.tick = function (e) { ;(i = e), n || (n = i), b((i + (r - n)) * ke.speed) }), (u.seek = function (e) { b(d(e)) }), (u.pause = function () { ;(u.paused = !0), p() }), (u.play = function () { u.paused && ((u.paused = !1), Oe.push(u), p(), De || Be()) }), (u.reverse = function () { h(), p() }), (u.restart = function () { u.reset(), u.play() }), (u.finished = c), u.reset(), u.autoplay && u.play(), u ) } function Ne(e, t) { for (var n = t.length; n--; ) C(e, t[n].animatable.target) && t.splice(n, 1) } function Ue(e) { for (var t = ge(e), n = Oe.length; n--; ) { var r = Oe[n], i = r.animations, o = r.children Ne(t, i) for (var a = o.length; a--; ) { var s = o[a], l = s.animations Ne(t, l), l.length || s.children.length || o.splice(a, 1) } i.length || o.length || r.pause() } } function He(e, t) { void 0 === t && (t = {}) var n = t.direction || 'normal', r = t.easing ? x(t.easing) : null, i = t.grid, o = t.axis, a = t.from || 0, s = 'first' === a, l = 'center' === a, c = 'last' === a, u = f.arr(e), h = u ? parseFloat(e[0]) : parseFloat(e), d = u ? parseFloat(e[1]) : 0, p = z(u ? e[1] : e) || 0, m = t.start || 0 + (u ? h : 0), v = [], g = 0 return function (e, t, f) { if ((s && (a = 0), l && (a = (f - 1) / 2), c && (a = f - 1), !v.length)) { for (var y = 0; y < f; y++) { if (i) { var b = l ? (i[0] - 1) / 2 : a % i[0], A = l ? (i[1] - 1) / 2 : Math.floor(a / i[0]), w = b - (y % i[0]), x = A - Math.floor(y / i[0]), E = Math.sqrt(w * w + x * x) 'x' === o && (E = -w), 'y' === o && (E = -x), v.push(E) } else v.push(Math.abs(a - y)) g = Math.max.apply(Math, v) } r && (v = v.map(function (e) { return r(e / g) * g })), 'reverse' === n && (v = v.map(function (e) { return o ? (e < 0 ? -1 * e : -e) : Math.abs(g - e) })) } return m + (u ? (d - h) / g : h) * (Math.round(100 * v[t]) / 100) + p } } function Ge(e) { void 0 === e && (e = {}) var t = ke(e) return ( (t.duration = 0), (t.add = function (n, r) { var i = Oe.indexOf(t), a = t.children function s(e) { e.passThrough = !0 } i > -1 && Oe.splice(i, 1) for (var l = 0; l < a.length; l++) s(a[l]) var c = P(n, R(o, e)) c.targets = c.targets || e.targets var u = t.duration ;(c.autoplay = !1), (c.direction = t.direction), (c.timelineOffset = f.und(r) ? u : ee(r, u)), s(t), t.seek(c.timelineOffset) var h = ke(c) s(h), a.push(h) var d = Le(a, e) return ( (t.delay = d.delay), (t.endDelay = d.endDelay), (t.duration = d.duration), t.seek(0), t.reset(), t.autoplay && t.play(), t ) }), t ) } document.addEventListener('visibilitychange', Fe), (ke.version = '3.0.0'), (ke.speed = 1), (ke.running = Oe), (ke.remove = Ue), (ke.get = J), (ke.set = Te), (ke.convertPx = q), (ke.path = pe), (ke.setDashoffset = ue), (ke.stagger = He), (ke.timeline = Ge), (ke.easing = x), (ke.penner = w), (ke.random = function (e, t) { return Math.floor(Math.random() * (t - e + 1)) + e }), (n.exports = ke) }, {}, ], 57: [ function (n, r, i) { var o, a ;(o = this), (a = function (t) { 'use strict' 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 r = arguments[n] if (void 0 !== r && null !== r) for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && (t[i] = r[i]) } return t }) var n = (function (e) { var t, n = Object.prototype, r = n.hasOwnProperty, i = 'function' === typeof Symbol ? Symbol : {}, o = i.iterator || '@@iterator', a = i.asyncIterator || '@@asyncIterator', s = i.toStringTag || '@@toStringTag' function l(e, t, n) { return ( Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0, }), e[t] ) } try { l({}, '') } catch (D) { l = function (e, t, n) { return (e[t] = n) } } function c(e, t, n, r) { var i = t && t.prototype instanceof v ? t : v, o = Object.create(i.prototype), a = new L(r || []) return (o._invoke = _(e, n, a)), o } function u(e, t, n) { try { return { type: 'normal', arg: e.call(t, n) } } catch (D) { return { type: 'throw', arg: D } } } e.wrap = c var h = 'suspendedStart', d = 'suspendedYield', p = 'executing', f = 'completed', m = {} function v() {} function g() {} function y() {} var b = {} b[o] = function () { return this } var A = Object.getPrototypeOf, w = A && A(A(R([]))) w && w !== n && r.call(w, o) && (b = w) var x = (y.prototype = v.prototype = Object.create(b)) function E(e) { ;['next', 'throw', 'return'].forEach(function (t) { l(e, t, function (e) { return this._invoke(t, e) }) }) } function M(e, t) { function n(i, o, a, s) { var l = u(e[i], e, o) if ('throw' !== l.type) { var c = l.arg, h = c.value return h && 'object' === typeof h && r.call(h, '__await') ? t.resolve(h.__await).then( function (e) { n('next', e, a, s) }, function (e) { n('throw', e, a, s) }, ) : t.resolve(h).then( function (e) { ;(c.value = e), a(c) }, function (e) { return n('throw', e, a, s) }, ) } s(l.arg) } var i function o(e, r) { function o() { return new t(function (t, i) { n(e, r, t, i) }) } return (i = i ? i.then(o, o) : o()) } this._invoke = o } function _(e, t, n) { var r = h return function (i, o) { if (r === p) throw new Error('Generator is already running') if (r === f) { if ('throw' === i) throw o return P() } for (n.method = i, n.arg = o; ; ) { var a = n.delegate if (a) { var s = T(a, n) if (s) { if (s === m) continue return s } } if ('next' === n.method) n.sent = n._sent = n.arg else if ('throw' === n.method) { if (r === h) throw ((r = f), n.arg) n.dispatchException(n.arg) } else 'return' === n.method && n.abrupt('return', n.arg) r = p var l = u(e, t, n) if ('normal' === l.type) { if (((r = n.done ? f : d), l.arg === m)) continue return { value: l.arg, done: n.done } } 'throw' === l.type && ((r = f), (n.method = 'throw'), (n.arg = l.arg)) } } } function T(e, n) { var r = e.iterator[n.method] if (r === t) { if (((n.delegate = null), 'throw' === n.method)) { if ( e.iterator.return && ((n.method = 'return'), (n.arg = t), T(e, n), 'throw' === n.method) ) return m ;(n.method = 'throw'), (n.arg = new TypeError( "The iterator does not provide a 'throw' method", )) } return m } var i = u(r, e.iterator, n.arg) if ('throw' === i.type) return (n.method = 'throw'), (n.arg = i.arg), (n.delegate = null), m var o = i.arg return o ? o.done ? ((n[e.resultName] = o.value), (n.next = e.nextLoc), 'return' !== n.method && ((n.method = 'next'), (n.arg = t)), (n.delegate = null), m) : o : ((n.method = 'throw'), (n.arg = new TypeError('iterator result is not an object')), (n.delegate = null), m) } function S(e) { var t = { tryLoc: e[0] } 1 in e && (t.catchLoc = e[1]), 2 in e && ((t.finallyLoc = e[2]), (t.afterLoc = e[3])), this.tryEntries.push(t) } function C(e) { var t = e.completion || {} ;(t.type = 'normal'), delete t.arg, (e.completion = t) } function L(e) { ;(this.tryEntries = [{ tryLoc: 'root' }]), e.forEach(S, this), this.reset(!0) } function R(e) { if (e) { var n = e[o] if (n) return n.call(e) if ('function' === typeof e.next) return e if (!isNaN(e.length)) { var i = -1, a = function n() { for (; ++i < e.length; ) if (r.call(e, i)) return (n.value = e[i]), (n.done = !1), n return (n.value = t), (n.done = !0), n } return (a.next = a) } } return { next: P } } function P() { return { value: t, done: !0 } } return ( (g.prototype = x.constructor = y), (y.constructor = g), (g.displayName = l(y, s, 'GeneratorFunction')), (e.isGeneratorFunction = function (e) { var t = 'function' === typeof e && e.constructor return ( !!t && (t === g || 'GeneratorFunction' === (t.displayName || t.name)) ) }), (e.mark = function (e) { return ( Object.setPrototypeOf ? Object.setPrototypeOf(e, y) : ((e.__proto__ = y), l(e, s, 'GeneratorFunction')), (e.prototype = Object.create(x)), e ) }), (e.awrap = function (e) { return { __await: e } }), E(M.prototype), (M.prototype[a] = function () { return this }), (e.AsyncIterator = M), (e.async = function (t, n, r, i, o) { void 0 === o && (o = Promise) var a = new M(c(t, n, r, i), o) return e.isGeneratorFunction(n) ? a : a.next().then(function (e) { return e.done ? e.value : a.next() }) }), E(x), l(x, s, 'Generator'), (x[o] = function () { return this }), (x.toString = function () { return '[object Generator]' }), (e.keys = function (e) { var t = [] for (var n in e) t.push(n) return ( t.reverse(), function n() { for (; t.length; ) { var r = t.pop() if (r in e) return (n.value = r), (n.done = !1), n } return (n.done = !0), n } ) }), (e.values = R), (L.prototype = { constructor: L, reset: function (e) { if ( ((this.prev = 0), (this.next = 0), (this.sent = this._sent = t), (this.done = !1), (this.delegate = null), (this.method = 'next'), (this.arg = t), this.tryEntries.forEach(C), !e) ) for (var n in this) 't' === n.charAt(0) && r.call(this, n) && !isNaN(+n.slice(1)) && (this[n] = t) }, stop: function () { this.done = !0 var e = this.tryEntries[0].completion if ('throw' === e.type) throw e.arg return this.rval }, dispatchException: function (e) { if (this.done) throw e var n = this function i(r, i) { return ( (s.type = 'throw'), (s.arg = e), (n.next = r), i && ((n.method = 'next'), (n.arg = t)), !!i ) } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var a = this.tryEntries[o], s = a.completion if ('root' === a.tryLoc) return i('end') if (a.tryLoc <= this.prev) { var l = r.call(a, 'catchLoc'), c = r.call(a, 'finallyLoc') if (l && c) { if (this.prev < a.catchLoc) return i(a.catchLoc, !0) if (this.prev < a.finallyLoc) return i(a.finallyLoc) } else if (l) { if (this.prev < a.catchLoc) return i(a.catchLoc, !0) } else { if (!c) throw new Error('try statement without catch or finally') if (this.prev < a.finallyLoc) return i(a.finallyLoc) } } } }, abrupt: function (e, t) { for (var n = this.tryEntries.length - 1; n >= 0; --n) { var i = this.tryEntries[n] if ( i.tryLoc <= this.prev && r.call(i, 'finallyLoc') && this.prev < i.finallyLoc ) { var o = i break } } o && ('break' === e || 'continue' === e) && o.tryLoc <= t && t <= o.finallyLoc && (o = null) var a = o ? o.completion : {} return ( (a.type = e), (a.arg = t), o ? ((this.method = 'next'), (this.next = o.finallyLoc), m) : this.complete(a) ) }, complete: function (e, t) { if ('throw' === e.type) throw e.arg return ( 'break' === e.type || 'continue' === e.type ? (this.next = e.arg) : 'return' === e.type ? ((this.rval = this.arg = e.arg), (this.method = 'return'), (this.next = 'end')) : 'normal' === e.type && t && (this.next = t), m ) }, finish: function (e) { for (var t = this.tryEntries.length - 1; t >= 0; --t) { var n = this.tryEntries[t] if (n.finallyLoc === e) return this.complete(n.completion, n.afterLoc), C(n), m } }, catch: function (e) { for (var t = this.tryEntries.length - 1; t >= 0; --t) { var n = this.tryEntries[t] if (n.tryLoc === e) { var r = n.completion if ('throw' === r.type) { var i = r.arg C(n) } return i } } throw new Error('illegal catch attempt') }, delegateYield: function (e, n, r) { return ( (this.delegate = { iterator: R(e), resultName: n, nextLoc: r }), 'next' === this.method && (this.arg = t), m ) }, }), e ) })('object' === typeof r ? r.exports : {}) try { regeneratorRuntime = n } catch (ym) { Function('r', 'regeneratorRuntime = r')(n) } var i = '125', o = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 }, a = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 }, s = 0, l = 1, c = 2, u = 3, h = 0, d = 1, p = 2, f = 3, m = 0, v = 1, g = 2, y = 1, b = 2, A = 0, w = 1, x = 2, E = 3, M = 4, _ = 5, T = 100, S = 101, C = 102, L = 103, R = 104, P = 200, D = 201, O = 202, I = 203, B = 204, F = 205, k = 206, N = 207, U = 208, H = 209, G = 210, z = 0, j = 1, V = 2, W = 3, q = 4, X = 5, Y = 6, Q = 7, Z = 0, K = 1, J = 2, $ = 0, ee = 1, te = 2, ne = 3, re = 4, ie = 5, oe = 300, ae = 301, se = 302, le = 303, ce = 304, ue = 306, he = 307, de = 1e3, pe = 1001, fe = 1002, me = 1003, ve = 1004, ge = 1004, ye = 1005, be = 1005, Ae = 1006, we = 1007, xe = 1007, Ee = 1008, Me = 1008, _e = 1009, Te = 1010, Se = 1011, Ce = 1012, Le = 1013, Re = 1014, Pe = 1015, De = 1016, Oe = 1017, Ie = 1018, Be = 1019, Fe = 1020, ke = 1021, Ne = 1022, Ue = 1023, He = 1024, Ge = 1025, ze = Ue, je = 1026, Ve = 1027, We = 1028, qe = 1029, Xe = 1030, Ye = 1031, Qe = 1032, Ze = 1033, Ke = 33776, Je = 33777, $e = 33778, et = 33779, tt = 35840, nt = 35841, rt = 35842, it = 35843, ot = 36196, at = 37492, st = 37496, lt = 37808, ct = 37809, ut = 37810, ht = 37811, dt = 37812, pt = 37813, ft = 37814, mt = 37815, vt = 37816, gt = 37817, yt = 37818, bt = 37819, At = 37820, wt = 37821, xt = 36492, Et = 37840, Mt = 37841, _t = 37842, Tt = 37843, St = 37844, Ct = 37845, Lt = 37846, Rt = 37847, Pt = 37848, Dt = 37849, Ot = 37850, It = 37851, Bt = 37852, Ft = 37853, kt = 2200, Nt = 2201, Ut = 2202, Ht = 2300, Gt = 2301, zt = 2302, jt = 2400, Vt = 2401, Wt = 2402, qt = 2500, Xt = 2501, Yt = 0, Qt = 1, Zt = 2, Kt = 3e3, Jt = 3001, $t = 3007, en = 3002, tn = 3003, nn = 3004, rn = 3005, on = 3006, an = 3200, sn = 3201, ln = 0, cn = 1, un = 0, hn = 7680, dn = 7681, pn = 7682, fn = 7683, mn = 34055, vn = 34056, gn = 5386, yn = 512, bn = 513, An = 514, wn = 515, xn = 516, En = 517, Mn = 518, _n = 519, Tn = 35044, Sn = 35048, Cn = 35040, Ln = 35045, Rn = 35049, Pn = 35041, Dn = 35046, On = 35050, In = 35042, Bn = '100', Fn = '300 es' function kn(e, t, n, r, i, o, a) { try { var s = e[o](a), l = s.value } catch (c) { return void n(c) } s.done ? t(l) : Promise.resolve(l).then(r, i) } function Nn(e) { return function () { var t = this, n = arguments return new Promise(function (r, i) { var o = e.apply(t, n) function a(e) { kn(o, r, i, a, s, 'next', e) } function s(e) { kn(o, r, i, a, s, 'throw', e) } a(void 0) }) } } function Un(e, t) { for (var n = 0; n < t.length; n++) { var r = t[n] ;(r.enumerable = r.enumerable || !1), (r.configurable = !0), 'value' in r && (r.writable = !0), Object.defineProperty(e, r.key, r) } } function Hn(e, t, n) { return t && Un(e.prototype, t), n && Un(e, n), e } function Gn(e, t) { ;(e.prototype = Object.create(t.prototype)), (e.prototype.constructor = e), (e.__proto__ = t) } function zn(e) { if (void 0 === e) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ) return e } function jn(e, t) { if (e) { if ('string' === typeof e) return Vn(e, t) var n = Object.prototype.toString.call(e).slice(8, -1) return ( 'Object' === n && e.constructor && (n = e.constructor.name), 'Map' === n || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Vn(e, t) : void 0 ) } } function Vn(e, t) { ;(null == t || t > e.length) && (t = e.length) for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n] return r } function Wn(e, t) { var n if ('undefined' === typeof Symbol || null == e[Symbol.iterator]) { if ( Array.isArray(e) || (n = jn(e)) || (t && e && 'number' === typeof e.length) ) { n && (e = n) var r = 0 return function () { return r >= e.length ? { done: !0 } : { done: !1, value: e[r++] } } } throw new TypeError( 'Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.', ) } return (n = e[Symbol.iterator]()).next.bind(n) } function qn() {} Object.assign(qn.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[e] if (void 0 !== n) { var r = n.indexOf(t) ;-1 !== r && n.splice(r, 1) } } }, dispatchEvent: function (e) { if (void 0 !== this._listeners) { var t = this._listeners[e.type] if (void 0 !== t) { e.target = this for (var n = t.slice(0), r = 0, i = n.length; r < i; r++) n[r].call(this, e) } } }, }) for (var Xn = [], Yn = 0; Yn < 256; Yn++) Xn[Yn] = (Yn < 16 ? '0' : '') + Yn.toString(16) var Qn, Zn = 1234567, Kn = { 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, r = (4294967295 * Math.random()) | 0 return ( Xn[255 & e] + Xn[(e >> 8) & 255] + Xn[(e >> 16) & 255] + Xn[(e >> 24) & 255] + '-' + Xn[255 & t] + Xn[(t >> 8) & 255] + '-' + Xn[((t >> 16) & 15) | 64] + Xn[(t >> 24) & 255] + '-' + Xn[(63 & n) | 128] + Xn[(n >> 8) & 255] + '-' + Xn[(n >> 16) & 255] + Xn[(n >> 24) & 255] + Xn[255 & r] + Xn[(r >> 8) & 255] + Xn[(r >> 16) & 255] + Xn[(r >> 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, r, i) { return r + ((e - t) * (i - r)) / (n - t) }, lerp: function (e, t, n) { return (1 - n) * e + n * t }, damp: function (e, t, n, r) { return Kn.lerp(e, t, 1 - Math.exp(-n * r)) }, pingpong: function (e, t) { return ( void 0 === t && (t = 1), t - Math.abs(Kn.euclideanModulo(e, 2 * t) - 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 * (0.5 - Math.random()) }, seededRandom: function (e) { return ( void 0 !== e && (Zn = e % 2147483647), ((Zn = (16807 * Zn) % 2147483647) - 1) / 2147483646 ) }, degToRad: function (e) { return e * Kn.DEG2RAD }, radToDeg: function (e) { return e * Kn.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, r, i) { var o = Math.cos, a = Math.sin, s = o(n / 2), l = a(n / 2), c = o((t + r) / 2), u = a((t + r) / 2), h = o((t - r) / 2), d = a((t - r) / 2), p = o((r - t) / 2), f = a((r - t) / 2) switch (i) { case 'XYX': e.set(s * u, l * h, l * d, s * c) break case 'YZY': e.set(l * d, s * u, l * h, s * c) break case 'ZXZ': e.set(l * h, l * d, s * u, s * c) break case 'XZX': e.set(s * u, l * f, l * p, s * c) break case 'YXY': e.set(l * p, s * u, l * f, s * c) break case 'ZYZ': e.set(l * f, l * p, s * u, s * c) break default: console.warn( 'THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: ' + i, ) } }, }, Jn = (function () { function e(e, t) { void 0 === e && (e = 0), void 0 === t && (t = 0), Object.defineProperty(this, 'isVector2', { value: !0 }), (this.x = e), (this.y = t) } var t = e.prototype return ( (t.set = function (e, t) { return (this.x = e), (this.y = t), this }), (t.setScalar = function (e) { return (this.x = e), (this.y = e), this }), (t.setX = function (e) { return (this.x = e), this }), (t.setY = function (e) { return (this.y = e), this }), (t.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 }), (t.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) } }), (t.clone = function () { return new this.constructor(this.x, this.y) }), (t.copy = function (e) { return (this.x = e.x), (this.y = e.y), this }), (t.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) }), (t.addScalar = function (e) { return (this.x += e), (this.y += e), this }), (t.addVectors = function (e, t) { return (this.x = e.x + t.x), (this.y = e.y + t.y), this }), (t.addScaledVector = function (e, t) { return (this.x += e.x * t), (this.y += e.y * t), this }), (t.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) }), (t.subScalar = function (e) { return (this.x -= e), (this.y -= e), this }), (t.subVectors = function (e, t) { return (this.x = e.x - t.x), (this.y = e.y - t.y), this }), (t.multiply = function (e) { return (this.x *= e.x), (this.y *= e.y), this }), (t.multiplyScalar = function (e) { return (this.x *= e), (this.y *= e), this }), (t.divide = function (e) { return (this.x /= e.x), (this.y /= e.y), this }), (t.divideScalar = function (e) { return this.multiplyScalar(1 / e) }), (t.applyMatrix3 = function (e) { var t = this.x, n = this.y, r = e.elements return ( (this.x = r[0] * t + r[3] * n + r[6]), (this.y = r[1] * t + r[4] * n + r[7]), this ) }), (t.min = function (e) { return ( (this.x = Math.min(this.x, e.x)), (this.y = Math.min(this.y, e.y)), this ) }), (t.max = function (e) { return ( (this.x = Math.max(this.x, e.x)), (this.y = Math.max(this.y, e.y)), this ) }), (t.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 ) }), (t.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 ) }), (t.clampLength = function (e, t) { var n = this.length() return this.divideScalar(n || 1).multiplyScalar( Math.max(e, Math.min(t, n)), ) }), (t.floor = function () { return ( (this.x = Math.floor(this.x)), (this.y = Math.floor(this.y)), this ) }), (t.ceil = function () { return (this.x = Math.ceil(this.x)), (this.y = Math.ceil(this.y)), this }), (t.round = function () { return ( (this.x = Math.round(this.x)), (this.y = Math.round(this.y)), this ) }), (t.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 ) }), (t.negate = function () { return (this.x = -this.x), (this.y = -this.y), this }), (t.dot = function (e) { return this.x * e.x + this.y * e.y }), (t.cross = function (e) { return this.x * e.y - this.y * e.x }), (t.lengthSq = function () { return this.x * this.x + this.y * this.y }), (t.length = function () { return Math.sqrt(this.x * this.x + this.y * this.y) }), (t.manhattanLength = function () { return Math.abs(this.x) + Math.abs(this.y) }), (t.normalize = function () { return this.divideScalar(this.length() || 1) }), (t.angle = function () { var e = Math.atan2(-this.y, -this.x) + Math.PI return e }), (t.distanceTo = function (e) { return Math.sqrt(this.distanceToSquared(e)) }), (t.distanceToSquared = function (e) { var t = this.x - e.x, n = this.y - e.y return t * t + n * n }), (t.manhattanDistanceTo = function (e) { return Math.abs(this.x - e.x) + Math.abs(this.y - e.y) }), (t.setLength = function (e) { return this.normalize().multiplyScalar(e) }), (t.lerp = function (e, t) { return ( (this.x += (e.x - this.x) * t), (this.y += (e.y - this.y) * t), this ) }), (t.lerpVectors = function (e, t, n) { return ( (this.x = e.x + (t.x - e.x) * n), (this.y = e.y + (t.y - e.y) * n), this ) }), (t.equals = function (e) { return e.x === this.x && e.y === this.y }), (t.fromArray = function (e, t) { return ( void 0 === t && (t = 0), (this.x = e[t]), (this.y = e[t + 1]), this ) }), (t.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.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 ) }), (t.rotateAround = function (e, t) { var n = Math.cos(t), r = Math.sin(t), i = this.x - e.x, o = this.y - e.y return ( (this.x = i * n - o * r + e.x), (this.y = i * r + o * n + e.y), this ) }), (t.random = function () { return (this.x = Math.random()), (this.y = Math.random()), this }), Hn(e, [ { key: 'width', get: function () { return this.x }, set: function (e) { this.x = e }, }, { key: 'height', get: function () { return this.y }, set: function (e) { this.y = e }, }, ]), e ) })(), $n = (function () { function e() { Object.defineProperty(this, 'isMatrix3', { value: !0 }), (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.', ) } var t = e.prototype return ( (t.set = function (e, t, n, r, i, o, a, s, l) { var c = this.elements return ( (c[0] = e), (c[1] = r), (c[2] = a), (c[3] = t), (c[4] = i), (c[5] = s), (c[6] = n), (c[7] = o), (c[8] = l), this ) }), (t.identity = function () { return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this }), (t.clone = function () { return new this.constructor().fromArray(this.elements) }), (t.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 ) }), (t.extractBasis = function (e, t, n) { return ( e.setFromMatrix3Column(this, 0), t.setFromMatrix3Column(this, 1), n.setFromMatrix3Column(this, 2), this ) }), (t.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 ) }), (t.multiply = function (e) { return this.multiplyMatrices(this, e) }), (t.premultiply = function (e) { return this.multiplyMatrices(e, this) }), (t.multiplyMatrices = function (e, t) { var n = e.elements, r = t.elements, i = this.elements, o = n[0], a = n[3], s = n[6], l = n[1], c = n[4], u = n[7], h = n[2], d = n[5], p = n[8], f = r[0], m = r[3], v = r[6], g = r[1], y = r[4], b = r[7], A = r[2], w = r[5], x = r[8] return ( (i[0] = o * f + a * g + s * A), (i[3] = o * m + a * y + s * w), (i[6] = o * v + a * b + s * x), (i[1] = l * f + c * g + u * A), (i[4] = l * m + c * y + u * w), (i[7] = l * v + c * b + u * x), (i[2] = h * f + d * g + p * A), (i[5] = h * m + d * y + p * w), (i[8] = h * v + d * b + p * x), this ) }), (t.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 ) }), (t.determinant = function () { var e = this.elements, t = e[0], n = e[1], r = e[2], i = e[3], o = e[4], a = e[5], s = e[6], l = e[7], c = e[8] return ( t * o * c - t * a * l - n * i * c + n * a * s + r * i * l - r * o * s ) }), (t.invert = function () { var e = this.elements, t = e[0], n = e[1], r = e[2], i = e[3], o = e[4], a = e[5], s = e[6], l = e[7], c = e[8], u = c * o - a * l, h = a * s - c * i, d = l * i - o * s, p = t * u + n * h + r * d if (0 === p) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0) var f = 1 / p return ( (e[0] = u * f), (e[1] = (r * l - c * n) * f), (e[2] = (a * n - r * o) * f), (e[3] = h * f), (e[4] = (c * t - r * s) * f), (e[5] = (r * i - a * t) * f), (e[6] = d * f), (e[7] = (n * s - l * t) * f), (e[8] = (o * t - n * i) * f), this ) }), (t.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 ) }), (t.getNormalMatrix = function (e) { return this.setFromMatrix4(e).copy(this).invert().transpose() }), (t.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 ) }), (t.setUvTransform = function (e, t, n, r, i, o, a) { var s = Math.cos(i), l = Math.sin(i) return ( this.set( n * s, n * l, -n * (s * o + l * a) + o + e, -r * l, r * s, -r * (-l * o + s * a) + a + t, 0, 0, 1, ), this ) }), (t.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 ) }), (t.rotate = function (e) { var t = Math.cos(e), n = Math.sin(e), r = this.elements, i = r[0], o = r[3], a = r[6], s = r[1], l = r[4], c = r[7] return ( (r[0] = t * i + n * s), (r[3] = t * o + n * l), (r[6] = t * a + n * c), (r[1] = -n * i + t * s), (r[4] = -n * o + t * l), (r[7] = -n * a + t * c), this ) }), (t.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 ) }), (t.equals = function (e) { for (var t = this.elements, n = e.elements, r = 0; r < 9; r++) if (t[r] !== n[r]) return !1 return !0 }), (t.fromArray = function (e, t) { void 0 === t && (t = 0) for (var n = 0; n < 9; n++) this.elements[n] = e[n + t] return this }), (t.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 ) }), e ) })(), er = { getDataURL: function (e) { if (/^data:/i.test(e.src)) return e.src if ('undefined' == typeof HTMLCanvasElement) return e.src var t if (e instanceof HTMLCanvasElement) t = e else { void 0 === Qn && (Qn = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas', )), (Qn.width = e.width), (Qn.height = e.height) var n = Qn.getContext('2d') e instanceof ImageData ? n.putImageData(e, 0, 0) : n.drawImage(e, 0, 0, e.width, e.height), (t = Qn) } return t.width > 2048 || t.height > 2048 ? t.toDataURL('image/jpeg', 0.6) : t.toDataURL('image/png') }, }, tr = 0 function nr(e, t, n, r, i, o, a, s, l, c) { void 0 === e && (e = nr.DEFAULT_IMAGE), void 0 === t && (t = nr.DEFAULT_MAPPING), void 0 === n && (n = pe), void 0 === r && (r = pe), void 0 === i && (i = Ae), void 0 === o && (o = Ee), void 0 === a && (a = Ue), void 0 === s && (s = _e), void 0 === l && (l = 1), void 0 === c && (c = Kt), Object.defineProperty(this, 'id', { value: tr++ }), (this.uuid = Kn.generateUUID()), (this.name = ''), (this.image = e), (this.mipmaps = []), (this.mapping = t), (this.wrapS = n), (this.wrapT = r), (this.magFilter = i), (this.minFilter = o), (this.anisotropy = l), (this.format = a), (this.internalFormat = null), (this.type = s), (this.offset = new Jn(0, 0)), (this.repeat = new Jn(1, 1)), (this.center = new Jn(0, 0)), (this.rotation = 0), (this.matrixAutoUpdate = !0), (this.matrix = new $n()), (this.generateMipmaps = !0), (this.premultiplyAlpha = !1), (this.flipY = !0), (this.unpackAlignment = 4), (this.encoding = c), (this.version = 0), (this.onUpdate = null) } function rr(e) { return ('undefined' !== typeof HTMLImageElement && e instanceof HTMLImageElement) || ('undefined' !== typeof HTMLCanvasElement && e instanceof HTMLCanvasElement) || ('undefined' !== typeof ImageBitmap && e instanceof ImageBitmap) ? er.getDataURL(e) : e.data ? { data: Array.prototype.slice.call(e.data), width: e.width, height: e.height, type: e.data.constructor.name, } : (console.warn('THREE.Texture: Unable to serialize Texture.'), {}) } ;(nr.DEFAULT_IMAGE = void 0), (nr.DEFAULT_MAPPING = oe), (nr.prototype = Object.assign(Object.create(qn.prototype), { constructor: nr, 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 r = this.image if ( (void 0 === r.uuid && (r.uuid = Kn.generateUUID()), !t && void 0 === e.images[r.uuid]) ) { var i if (Array.isArray(r)) { i = [] for (var o = 0, a = r.length; o < a; o++) r[o].isDataTexture ? i.push(rr(r[o].image)) : i.push(rr(r[o])) } else i = rr(r) e.images[r.uuid] = { uuid: r.uuid, url: i } } n.image = r.uuid } return t || (e.textures[this.uuid] = n), n }, dispose: function () { this.dispatchEvent({ type: 'dispose' }) }, transformUv: function (e) { if (this.mapping !== oe) return e if ((e.applyMatrix3(this.matrix), e.x < 0 || e.x > 1)) switch (this.wrapS) { case de: e.x = e.x - Math.floor(e.x) break case pe: e.x = e.x < 0 ? 0 : 1 break case fe: 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 de: e.y = e.y - Math.floor(e.y) break case pe: e.y = e.y < 0 ? 0 : 1 break case fe: 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(nr.prototype, 'needsUpdate', { set: function (e) { !0 === e && this.version++ }, }) var ir = (function () { function e(e, t, n, r) { void 0 === e && (e = 0), void 0 === t && (t = 0), void 0 === n && (n = 0), void 0 === r && (r = 1), Object.defineProperty(this, 'isVector4', { value: !0 }), (this.x = e), (this.y = t), (this.z = n), (this.w = r) } var t = e.prototype return ( (t.set = function (e, t, n, r) { return (this.x = e), (this.y = t), (this.z = n), (this.w = r), this }), (t.setScalar = function (e) { return (this.x = e), (this.y = e), (this.z = e), (this.w = e), this }), (t.setX = function (e) { return (this.x = e), this }), (t.setY = function (e) { return (this.y = e), this }), (t.setZ = function (e) { return (this.z = e), this }), (t.setW = function (e) { return (this.w = e), this }), (t.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 }), (t.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) } }), (t.clone = function () { return new this.constructor(this.x, this.y, this.z, this.w) }), (t.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 ) }), (t.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) }), (t.addScalar = function (e) { return (this.x += e), (this.y += e), (this.z += e), (this.w += e), this }), (t.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 ) }), (t.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 ) }), (t.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) }), (t.subScalar = function (e) { return (this.x -= e), (this.y -= e), (this.z -= e), (this.w -= e), this }), (t.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 ) }), (t.multiply = function (e) { return ( (this.x *= e.x), (this.y *= e.y), (this.z *= e.z), (this.w *= e.w), this ) }), (t.multiplyScalar = function (e) { return (this.x *= e), (this.y *= e), (this.z *= e), (this.w *= e), this }), (t.applyMatrix4 = function (e) { var t = this.x, n = this.y, r = this.z, i = this.w, o = e.elements return ( (this.x = o[0] * t + o[4] * n + o[8] * r + o[12] * i), (this.y = o[1] * t + o[5] * n + o[9] * r + o[13] * i), (this.z = o[2] * t + o[6] * n + o[10] * r + o[14] * i), (this.w = o[3] * t + o[7] * n + o[11] * r + o[15] * i), this ) }), (t.divideScalar = function (e) { return this.multiplyScalar(1 / e) }), (t.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 ) }), (t.setAxisAngleFromRotationMatrix = function (e) { var t, n, r, i, o = 0.01, a = 0.1, s = e.elements, l = s[0], c = s[4], u = s[8], h = s[1], d = s[5], p = s[9], f = s[2], m = s[6], v = s[10] if (Math.abs(c - h) < o && Math.abs(u - f) < o && Math.abs(p - m) < o) { if ( Math.abs(c + h) < a && Math.abs(u + f) < a && Math.abs(p + m) < a && Math.abs(l + d + v - 3) < a ) return this.set(1, 0, 0, 0), this t = Math.PI var g = (l + 1) / 2, y = (d + 1) / 2, b = (v + 1) / 2, A = (c + h) / 4, w = (u + f) / 4, x = (p + m) / 4 return ( g > y && g > b ? g < o ? ((n = 0), (r = 0.707106781), (i = 0.707106781)) : ((r = A / (n = Math.sqrt(g))), (i = w / n)) : y > b ? y < o ? ((n = 0.707106781), (r = 0), (i = 0.707106781)) : ((n = A / (r = Math.sqrt(y))), (i = x / r)) : b < o ? ((n = 0.707106781), (r = 0.707106781), (i = 0)) : ((n = w / (i = Math.sqrt(b))), (r = x / i)), this.set(n, r, i, t), this ) } var E = Math.sqrt( (m - p) * (m - p) + (u - f) * (u - f) + (h - c) * (h - c), ) return ( Math.abs(E) < 0.001 && (E = 1), (this.x = (m - p) / E), (this.y = (u - f) / E), (this.z = (h - c) / E), (this.w = Math.acos((l + d + v - 1) / 2)), this ) }), (t.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 ) }), (t.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 ) }), (t.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 ) }), (t.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 ) }), (t.clampLength = function (e, t) { var n = this.length() return this.divideScalar(n || 1).multiplyScalar( Math.max(e, Math.min(t, n)), ) }), (t.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 ) }), (t.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 ) }), (t.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 ) }), (t.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 ) }), (t.negate = function () { return ( (this.x = -this.x), (this.y = -this.y), (this.z = -this.z), (this.w = -this.w), this ) }), (t.dot = function (e) { return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w }), (t.lengthSq = function () { return ( this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w ) }), (t.length = function () { return Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w, ) }), (t.manhattanLength = function () { return ( Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w) ) }), (t.normalize = function () { return this.divideScalar(this.length() || 1) }), (t.setLength = function (e) { return this.normalize().multiplyScalar(e) }), (t.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 ) }), (t.lerpVectors = function (e, t, n) { return ( (this.x = e.x + (t.x - e.x) * n), (this.y = e.y + (t.y - e.y) * n), (this.z = e.z + (t.z - e.z) * n), (this.w = e.w + (t.w - e.w) * n), this ) }), (t.equals = function (e) { return ( e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w ) }), (t.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 ) }), (t.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 ) }), (t.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 ) }), (t.random = function () { return ( (this.x = Math.random()), (this.y = Math.random()), (this.z = Math.random()), (this.w = Math.random()), this ) }), Hn(e, [ { key: 'width', get: function () { return this.z }, set: function (e) { this.z = e }, }, { key: 'height', get: function () { return this.w }, set: function (e) { this.w = e }, }, ]), e ) })(), or = (function (e) { function t(t, n, r) { var i return ( (i = e.call(this) || this), Object.defineProperty(zn(i), 'isWebGLRenderTarget', { value: !0 }), (i.width = t), (i.height = n), (i.scissor = new ir(0, 0, t, n)), (i.scissorTest = !1), (i.viewport = new ir(0, 0, t, n)), (r = r || {}), (i.texture = new nr( void 0, r.mapping, r.wrapS, r.wrapT, r.magFilter, r.minFilter, r.format, r.type, r.anisotropy, r.encoding, )), (i.texture.image = {}), (i.texture.image.width = t), (i.texture.image.height = n), (i.texture.generateMipmaps = void 0 !== r.generateMipmaps && r.generateMipmaps), (i.texture.minFilter = void 0 !== r.minFilter ? r.minFilter : Ae), (i.depthBuffer = void 0 === r.depthBuffer || r.depthBuffer), (i.stencilBuffer = void 0 !== r.stencilBuffer && r.stencilBuffer), (i.depthTexture = void 0 !== r.depthTexture ? r.depthTexture : null), i ) } Gn(t, e) var n = t.prototype return ( (n.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) }), (n.clone = function () { return new this.constructor().copy(this) }), (n.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 ) }), (n.dispose = function () { this.dispatchEvent({ type: 'dispose' }) }), t ) })(qn), ar = (function (e) { function t(t, n, r) { var i return ( (i = e.call(this, t, n, r) || this), Object.defineProperty(zn(i), 'isWebGLMultisampleRenderTarget', { value: !0, }), (i.samples = 4), i ) } return ( Gn(t, e), (t.prototype.copy = function (t) { return e.prototype.copy.call(this, t), (this.samples = t.samples), this }), t ) })(or), sr = (function () { function e(e, t, n, r) { void 0 === e && (e = 0), void 0 === t && (t = 0), void 0 === n && (n = 0), void 0 === r && (r = 1), Object.defineProperty(this, 'isQuaternion', { value: !0 }), (this._x = e), (this._y = t), (this._z = n), (this._w = r) } ;(e.slerp = function (e, t, n, r) { return n.copy(e).slerp(t, r) }), (e.slerpFlat = function (e, t, n, r, i, o, a) { var s = n[r + 0], l = n[r + 1], c = n[r + 2], u = n[r + 3], h = i[o + 0], d = i[o + 1], p = i[o + 2], f = i[o + 3] if (u !== f || s !== h || l !== d || c !== p) { var m = 1 - a, v = s * h + l * d + c * p + u * f, g = v >= 0 ? 1 : -1, y = 1 - v * v if (y > Number.EPSILON) { var b = Math.sqrt(y), A = Math.atan2(b, v * g) ;(m = Math.sin(m * A) / b), (a = Math.sin(a * A) / b) } var w = a * g if ( ((s = s * m + h * w), (l = l * m + d * w), (c = c * m + p * w), (u = u * m + f * w), m === 1 - a) ) { var x = 1 / Math.sqrt(s * s + l * l + c * c + u * u) ;(s *= x), (l *= x), (c *= x), (u *= x) } } ;(e[t] = s), (e[t + 1] = l), (e[t + 2] = c), (e[t + 3] = u) }), (e.multiplyQuaternionsFlat = function (e, t, n, r, i, o) { var a = n[r], s = n[r + 1], l = n[r + 2], c = n[r + 3], u = i[o], h = i[o + 1], d = i[o + 2], p = i[o + 3] return ( (e[t] = a * p + c * u + s * d - l * h), (e[t + 1] = s * p + c * h + l * u - a * d), (e[t + 2] = l * p + c * d + a * h - s * u), (e[t + 3] = c * p - a * u - s * h - l * d), e ) }) var t = e.prototype return ( (t.set = function (e, t, n, r) { return ( (this._x = e), (this._y = t), (this._z = n), (this._w = r), this._onChangeCallback(), this ) }), (t.clone = function () { return new this.constructor(this._x, this._y, this._z, this._w) }), (t.copy = function (e) { return ( (this._x = e.x), (this._y = e.y), (this._z = e.z), (this._w = e.w), this._onChangeCallback(), this ) }), (t.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, r = e._y, i = e._z, o = e._order, a = Math.cos, s = Math.sin, l = a(n / 2), c = a(r / 2), u = a(i / 2), h = s(n / 2), d = s(r / 2), p = s(i / 2) switch (o) { case 'XYZ': ;(this._x = h * c * u + l * d * p), (this._y = l * d * u - h * c * p), (this._z = l * c * p + h * d * u), (this._w = l * c * u - h * d * p) break case 'YXZ': ;(this._x = h * c * u + l * d * p), (this._y = l * d * u - h * c * p), (this._z = l * c * p - h * d * u), (this._w = l * c * u + h * d * p) break case 'ZXY': ;(this._x = h * c * u - l * d * p), (this._y = l * d * u + h * c * p), (this._z = l * c * p + h * d * u), (this._w = l * c * u - h * d * p) break case 'ZYX': ;(this._x = h * c * u - l * d * p), (this._y = l * d * u + h * c * p), (this._z = l * c * p - h * d * u), (this._w = l * c * u + h * d * p) break case 'YZX': ;(this._x = h * c * u + l * d * p), (this._y = l * d * u + h * c * p), (this._z = l * c * p - h * d * u), (this._w = l * c * u - h * d * p) break case 'XZY': ;(this._x = h * c * u - l * d * p), (this._y = l * d * u - h * c * p), (this._z = l * c * p + h * d * u), (this._w = l * c * u + h * d * p) break default: console.warn( 'THREE.Quaternion: .setFromEuler() encountered an unknown order: ' + o, ) } return !1 !== t && this._onChangeCallback(), this }), (t.setFromAxisAngle = function (e, t) { var n = t / 2, r = Math.sin(n) return ( (this._x = e.x * r), (this._y = e.y * r), (this._z = e.z * r), (this._w = Math.cos(n)), this._onChangeCallback(), this ) }), (t.setFromRotationMatrix = function (e) { var t = e.elements, n = t[0], r = t[4], i = t[8], o = t[1], a = t[5], s = t[9], l = t[2], c = t[6], u = t[10], h = n + a + u if (h > 0) { var d = 0.5 / Math.sqrt(h + 1) ;(this._w = 0.25 / d), (this._x = (c - s) * d), (this._y = (i - l) * d), (this._z = (o - r) * d) } else if (n > a && n > u) { var p = 2 * Math.sqrt(1 + n - a - u) ;(this._w = (c - s) / p), (this._x = 0.25 * p), (this._y = (r + o) / p), (this._z = (i + l) / p) } else if (a > u) { var f = 2 * Math.sqrt(1 + a - n - u) ;(this._w = (i - l) / f), (this._x = (r + o) / f), (this._y = 0.25 * f), (this._z = (s + c) / f) } else { var m = 2 * Math.sqrt(1 + u - n - a) ;(this._w = (o - r) / m), (this._x = (i + l) / m), (this._y = (s + c) / m), (this._z = 0.25 * m) } return this._onChangeCallback(), this }), (t.setFromUnitVectors = function (e, t) { var n = 1e-6, r = e.dot(t) + 1 return ( r < n ? ((r = 0), Math.abs(e.x) > Math.abs(e.z) ? ((this._x = -e.y), (this._y = e.x), (this._z = 0), (this._w = r)) : ((this._x = 0), (this._y = -e.z), (this._z = e.y), (this._w = r))) : ((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 = r)), this.normalize() ) }), (t.angleTo = function (e) { return 2 * Math.acos(Math.abs(Kn.clamp(this.dot(e), -1, 1))) }), (t.rotateTowards = function (e, t) { var n = this.angleTo(e) if (0 === n) return this var r = Math.min(1, t / n) return this.slerp(e, r), this }), (t.identity = function () { return this.set(0, 0, 0, 1) }), (t.invert = function () { return this.conjugate() }), (t.conjugate = function () { return ( (this._x *= -1), (this._y *= -1), (this._z *= -1), this._onChangeCallback(), this ) }), (t.dot = function (e) { return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w }), (t.lengthSq = function () { return ( this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w ) }), (t.length = function () { return Math.sqrt( this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w, ) }), (t.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 ) }), (t.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) }), (t.premultiply = function (e) { return this.multiplyQuaternions(e, this) }), (t.multiplyQuaternions = function (e, t) { var n = e._x, r = e._y, i = e._z, o = e._w, a = t._x, s = t._y, l = t._z, c = t._w return ( (this._x = n * c + o * a + r * l - i * s), (this._y = r * c + o * s + i * a - n * l), (this._z = i * c + o * l + n * s - r * a), (this._w = o * c - n * a - r * s - i * l), this._onChangeCallback(), this ) }), (t.slerp = function (e, t) { if (0 === t) return this if (1 === t) return this.copy(e) var n = this._x, r = this._y, i = this._z, o = this._w, a = o * e._w + n * e._x + r * e._y + i * e._z if ( (a < 0 ? ((this._w = -e._w), (this._x = -e._x), (this._y = -e._y), (this._z = -e._z), (a = -a)) : this.copy(e), a >= 1) ) return ( (this._w = o), (this._x = n), (this._y = r), (this._z = i), this ) var s = 1 - a * a if (s <= Number.EPSILON) { var l = 1 - t return ( (this._w = l * o + t * this._w), (this._x = l * n + t * this._x), (this._y = l * r + t * this._y), (this._z = l * i + t * this._z), this.normalize(), this._onChangeCallback(), this ) } var c = Math.sqrt(s), u = Math.atan2(c, a), h = Math.sin((1 - t) * u) / c, d = Math.sin(t * u) / c return ( (this._w = o * h + this._w * d), (this._x = n * h + this._x * d), (this._y = r * h + this._y * d), (this._z = i * h + this._z * d), this._onChangeCallback(), this ) }), (t.equals = function (e) { return ( e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w ) }), (t.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 ) }), (t.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 ) }), (t.fromBufferAttribute = function (e, t) { return ( (this._x = e.getX(t)), (this._y = e.getY(t)), (this._z = e.getZ(t)), (this._w = e.getW(t)), this ) }), (t._onChange = function (e) { return (this._onChangeCallback = e), this }), (t._onChangeCallback = function () {}), Hn(e, [ { key: 'x', get: function () { return this._x }, set: function (e) { ;(this._x = e), this._onChangeCallback() }, }, { key: 'y', get: function () { return this._y }, set: function (e) { ;(this._y = e), this._onChangeCallback() }, }, { key: 'z', get: function () { return this._z }, set: function (e) { ;(this._z = e), this._onChangeCallback() }, }, { key: 'w', get: function () { return this._w }, set: function (e) { ;(this._w = e), this._onChangeCallback() }, }, ]), e ) })(), lr = (function () { function e(e, t, n) { void 0 === e && (e = 0), void 0 === t && (t = 0), void 0 === n && (n = 0), Object.defineProperty(this, 'isVector3', { value: !0 }), (this.x = e), (this.y = t), (this.z = n) } var t = e.prototype return ( (t.set = function (e, t, n) { return ( void 0 === n && (n = this.z), (this.x = e), (this.y = t), (this.z = n), this ) }), (t.setScalar = function (e) { return (this.x = e), (this.y = e), (this.z = e), this }), (t.setX = function (e) { return (this.x = e), this }), (t.setY = function (e) { return (this.y = e), this }), (t.setZ = function (e) { return (this.z = e), this }), (t.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 }), (t.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) } }), (t.clone = function () { return new this.constructor(this.x, this.y, this.z) }), (t.copy = function (e) { return (this.x = e.x), (this.y = e.y), (this.z = e.z), this }), (t.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) }), (t.addScalar = function (e) { return (this.x += e), (this.y += e), (this.z += e), this }), (t.addVectors = function (e, t) { return ( (this.x = e.x + t.x), (this.y = e.y + t.y), (this.z = e.z + t.z), this ) }), (t.addScaledVector = function (e, t) { return ( (this.x += e.x * t), (this.y += e.y * t), (this.z += e.z * t), this ) }), (t.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) }), (t.subScalar = function (e) { return (this.x -= e), (this.y -= e), (this.z -= e), this }), (t.subVectors = function (e, t) { return ( (this.x = e.x - t.x), (this.y = e.y - t.y), (this.z = e.z - t.z), this ) }), (t.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) }), (t.multiplyScalar = function (e) { return (this.x *= e), (this.y *= e), (this.z *= e), this }), (t.multiplyVectors = function (e, t) { return ( (this.x = e.x * t.x), (this.y = e.y * t.y), (this.z = e.z * t.z), this ) }), (t.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(ur.setFromEuler(e)) ) }), (t.applyAxisAngle = function (e, t) { return this.applyQuaternion(ur.setFromAxisAngle(e, t)) }), (t.applyMatrix3 = function (e) { var t = this.x, n = this.y, r = this.z, i = e.elements return ( (this.x = i[0] * t + i[3] * n + i[6] * r), (this.y = i[1] * t + i[4] * n + i[7] * r), (this.z = i[2] * t + i[5] * n + i[8] * r), this ) }), (t.applyNormalMatrix = function (e) { return this.applyMatrix3(e).normalize() }), (t.applyMatrix4 = function (e) { var t = this.x, n = this.y, r = this.z, i = e.elements, o = 1 / (i[3] * t + i[7] * n + i[11] * r + i[15]) return ( (this.x = (i[0] * t + i[4] * n + i[8] * r + i[12]) * o), (this.y = (i[1] * t + i[5] * n + i[9] * r + i[13]) * o), (this.z = (i[2] * t + i[6] * n + i[10] * r + i[14]) * o), this ) }), (t.applyQuaternion = function (e) { var t = this.x, n = this.y, r = this.z, i = e.x, o = e.y, a = e.z, s = e.w, l = s * t + o * r - a * n, c = s * n + a * t - i * r, u = s * r + i * n - o * t, h = -i * t - o * n - a * r return ( (this.x = l * s + h * -i + c * -a - u * -o), (this.y = c * s + h * -o + u * -i - l * -a), (this.z = u * s + h * -a + l * -o - c * -i), this ) }), (t.project = function (e) { return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4( e.projectionMatrix, ) }), (t.unproject = function (e) { return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4( e.matrixWorld, ) }), (t.transformDirection = function (e) { var t = this.x, n = this.y, r = this.z, i = e.elements return ( (this.x = i[0] * t + i[4] * n + i[8] * r), (this.y = i[1] * t + i[5] * n + i[9] * r), (this.z = i[2] * t + i[6] * n + i[10] * r), this.normalize() ) }), (t.divide = function (e) { return (this.x /= e.x), (this.y /= e.y), (this.z /= e.z), this }), (t.divideScalar = function (e) { return this.multiplyScalar(1 / e) }), (t.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 ) }), (t.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 ) }), (t.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 ) }), (t.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 ) }), (t.clampLength = function (e, t) { var n = this.length() return this.divideScalar(n || 1).multiplyScalar( Math.max(e, Math.min(t, n)), ) }), (t.floor = function () { return ( (this.x = Math.floor(this.x)), (this.y = Math.floor(this.y)), (this.z = Math.floor(this.z)), this ) }), (t.ceil = function () { return ( (this.x = Math.ceil(this.x)), (this.y = Math.ceil(this.y)), (this.z = Math.ceil(this.z)), this ) }), (t.round = function () { return ( (this.x = Math.round(this.x)), (this.y = Math.round(this.y)), (this.z = Math.round(this.z)), this ) }), (t.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 ) }), (t.negate = function () { return (this.x = -this.x), (this.y = -this.y), (this.z = -this.z), this }), (t.dot = function (e) { return this.x * e.x + this.y * e.y + this.z * e.z }), (t.lengthSq = function () { return this.x * this.x + this.y * this.y + this.z * this.z }), (t.length = function () { return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z) }), (t.manhattanLength = function () { return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) }), (t.normalize = function () { return this.divideScalar(this.length() || 1) }), (t.setLength = function (e) { return this.normalize().multiplyScalar(e) }), (t.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 ) }), (t.lerpVectors = function (e, t, n) { return ( (this.x = e.x + (t.x - e.x) * n), (this.y = e.y + (t.y - e.y) * n), (this.z = e.z + (t.z - e.z) * n), this ) }), (t.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) }), (t.crossVectors = function (e, t) { var n = e.x, r = e.y, i = e.z, o = t.x, a = t.y, s = t.z return ( (this.x = r * s - i * a), (this.y = i * o - n * s), (this.z = n * a - r * o), this ) }), (t.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) }), (t.projectOnPlane = function (e) { return cr.copy(this).projectOnVector(e), this.sub(cr) }), (t.reflect = function (e) { return this.sub(cr.copy(e).multiplyScalar(2 * this.dot(e))) }), (t.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(Kn.clamp(n, -1, 1)) }), (t.distanceTo = function (e) { return Math.sqrt(this.distanceToSquared(e)) }), (t.distanceToSquared = function (e) { var t = this.x - e.x, n = this.y - e.y, r = this.z - e.z return t * t + n * n + r * r }), (t.manhattanDistanceTo = function (e) { return ( Math.abs(this.x - e.x) + Math.abs(this.y - e.y) + Math.abs(this.z - e.z) ) }), (t.setFromSpherical = function (e) { return this.setFromSphericalCoords(e.radius, e.phi, e.theta) }), (t.setFromSphericalCoords = function (e, t, n) { var r = Math.sin(t) * e return ( (this.x = r * Math.sin(n)), (this.y = Math.cos(t) * e), (this.z = r * Math.cos(n)), this ) }), (t.setFromCylindrical = function (e) { return this.setFromCylindricalCoords(e.radius, e.theta, e.y) }), (t.setFromCylindricalCoords = function (e, t, n) { return ( (this.x = e * Math.sin(t)), (this.y = n), (this.z = e * Math.cos(t)), this ) }), (t.setFromMatrixPosition = function (e) { var t = e.elements return (this.x = t[12]), (this.y = t[13]), (this.z = t[14]), this }), (t.setFromMatrixScale = function (e) { var t = this.setFromMatrixColumn(e, 0).length(), n = this.setFromMatrixColumn(e, 1).length(), r = this.setFromMatrixColumn(e, 2).length() return (this.x = t), (this.y = n), (this.z = r), this }), (t.setFromMatrixColumn = function (e, t) { return this.fromArray(e.elements, 4 * t) }), (t.setFromMatrix3Column = function (e, t) { return this.fromArray(e.elements, 3 * t) }), (t.equals = function (e) { return e.x === this.x && e.y === this.y && e.z === this.z }), (t.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 ) }), (t.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.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 ) }), (t.random = function () { return ( (this.x = Math.random()), (this.y = Math.random()), (this.z = Math.random()), this ) }), e ) })(), cr = new lr(), ur = new sr(), hr = (function () { function e(e, t) { Object.defineProperty(this, 'isBox3', { value: !0 }), (this.min = void 0 !== e ? e : new lr(1 / 0, 1 / 0, 1 / 0)), (this.max = void 0 !== t ? t : new lr(-1 / 0, -1 / 0, -1 / 0)) } var t = e.prototype return ( (t.set = function (e, t) { return this.min.copy(e), this.max.copy(t), this }), (t.setFromArray = function (e) { for ( var t = 1 / 0, n = 1 / 0, r = 1 / 0, i = -1 / 0, o = -1 / 0, a = -1 / 0, s = 0, l = e.length; s < l; s += 3 ) { var c = e[s], u = e[s + 1], h = e[s + 2] c < t && (t = c), u < n && (n = u), h < r && (r = h), c > i && (i = c), u > o && (o = u), h > a && (a = h) } return this.min.set(t, n, r), this.max.set(i, o, a), this }), (t.setFromBufferAttribute = function (e) { for ( var t = 1 / 0, n = 1 / 0, r = 1 / 0, i = -1 / 0, o = -1 / 0, a = -1 / 0, s = 0, l = e.count; s < l; s++ ) { var c = e.getX(s), u = e.getY(s), h = e.getZ(s) c < t && (t = c), u < n && (n = u), h < r && (r = h), c > i && (i = c), u > o && (o = u), h > a && (a = h) } return this.min.set(t, n, r), this.max.set(i, o, a), this }), (t.setFromPoints = function (e) { this.makeEmpty() for (var t = 0, n = e.length; t < n; t++) this.expandByPoint(e[t]) return this }), (t.setFromCenterAndSize = function (e, t) { var n = fr.copy(t).multiplyScalar(0.5) return this.min.copy(e).sub(n), this.max.copy(e).add(n), this }), (t.setFromObject = function (e) { return this.makeEmpty(), this.expandByObject(e) }), (t.clone = function () { return new this.constructor().copy(this) }), (t.copy = function (e) { return this.min.copy(e.min), this.max.copy(e.max), this }), (t.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 ) }), (t.isEmpty = function () { return ( this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z ) }), (t.getCenter = function (e) { return ( void 0 === e && (console.warn('THREE.Box3: .getCenter() target is now required'), (e = new lr())), this.isEmpty() ? e.set(0, 0, 0) : e.addVectors(this.min, this.max).multiplyScalar(0.5) ) }), (t.getSize = function (e) { return ( void 0 === e && (console.warn('THREE.Box3: .getSize() target is now required'), (e = new lr())), this.isEmpty() ? e.set(0, 0, 0) : e.subVectors(this.max, this.min) ) }), (t.expandByPoint = function (e) { return this.min.min(e), this.max.max(e), this }), (t.expandByVector = function (e) { return this.min.sub(e), this.max.add(e), this }), (t.expandByScalar = function (e) { return this.min.addScalar(-e), this.max.addScalar(e), this }), (t.expandByObject = function (e) { e.updateWorldMatrix(!1, !1) var t = e.geometry void 0 !== t && (null === t.boundingBox && t.computeBoundingBox(), mr.copy(t.boundingBox), mr.applyMatrix4(e.matrixWorld), this.union(mr)) for (var n = e.children, r = 0, i = n.length; r < i; r++) this.expandByObject(n[r]) return this }), (t.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 ) }), (t.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 ) }), (t.getParameter = function (e, t) { return ( void 0 === t && (console.warn('THREE.Box3: .getParameter() target is now required'), (t = new lr())), 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), ) ) }), (t.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 ) }), (t.intersectsSphere = function (e) { return ( this.clampPoint(e.center, fr), fr.distanceToSquared(e.center) <= e.radius * e.radius ) }), (t.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 ) }), (t.intersectsTriangle = function (e) { if (this.isEmpty()) return !1 this.getCenter(xr), Er.subVectors(this.max, xr), vr.subVectors(e.a, xr), gr.subVectors(e.b, xr), yr.subVectors(e.c, xr), br.subVectors(gr, vr), Ar.subVectors(yr, gr), wr.subVectors(vr, yr) var t = [ 0, -br.z, br.y, 0, -Ar.z, Ar.y, 0, -wr.z, wr.y, br.z, 0, -br.x, Ar.z, 0, -Ar.x, wr.z, 0, -wr.x, -br.y, br.x, 0, -Ar.y, Ar.x, 0, -wr.y, wr.x, 0, ] return ( !!dr(t, vr, gr, yr, Er) && !!dr((t = [1, 0, 0, 0, 1, 0, 0, 0, 1]), vr, gr, yr, Er) && (Mr.crossVectors(br, Ar), dr((t = [Mr.x, Mr.y, Mr.z]), vr, gr, yr, Er)) ) }), (t.clampPoint = function (e, t) { return ( void 0 === t && (console.warn('THREE.Box3: .clampPoint() target is now required'), (t = new lr())), t.copy(e).clamp(this.min, this.max) ) }), (t.distanceToPoint = function (e) { return fr.copy(e).clamp(this.min, this.max).sub(e).length() }), (t.getBoundingSphere = function (e) { return ( void 0 === e && console.error( 'THREE.Box3: .getBoundingSphere() target is now required', ), this.getCenter(e.center), (e.radius = 0.5 * this.getSize(fr).length()), e ) }), (t.intersect = function (e) { return ( this.min.max(e.min), this.max.min(e.max), this.isEmpty() && this.makeEmpty(), this ) }), (t.union = function (e) { return this.min.min(e.min), this.max.max(e.max), this }), (t.applyMatrix4 = function (e) { return ( this.isEmpty() || (pr[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e), pr[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e), pr[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e), pr[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e), pr[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e), pr[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e), pr[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e), pr[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e), this.setFromPoints(pr)), this ) }), (t.translate = function (e) { return this.min.add(e), this.max.add(e), this }), (t.equals = function (e) { return e.min.equals(this.min) && e.max.equals(this.max) }), e ) })() function dr(e, t, n, r, i) { for (var o = 0, a = e.length - 3; o <= a; o += 3) { _r.fromArray(e, o) var s = i.x * Math.abs(_r.x) + i.y * Math.abs(_r.y) + i.z * Math.abs(_r.z), l = t.dot(_r), c = n.dot(_r), u = r.dot(_r) if (Math.max(-Math.max(l, c, u), Math.min(l, c, u)) > s) return !1 } return !0 } var pr = [ new lr(), new lr(), new lr(), new lr(), new lr(), new lr(), new lr(), new lr(), ], fr = new lr(), mr = new hr(), vr = new lr(), gr = new lr(), yr = new lr(), br = new lr(), Ar = new lr(), wr = new lr(), xr = new lr(), Er = new lr(), Mr = new lr(), _r = new lr(), Tr = new hr(), Sr = (function () { function e(e, t) { ;(this.center = void 0 !== e ? e : new lr()), (this.radius = void 0 !== t ? t : -1) } var t = e.prototype return ( (t.set = function (e, t) { return this.center.copy(e), (this.radius = t), this }), (t.setFromPoints = function (e, t) { var n = this.center void 0 !== t ? n.copy(t) : Tr.setFromPoints(e).getCenter(n) for (var r = 0, i = 0, o = e.length; i < o; i++) r = Math.max(r, n.distanceToSquared(e[i])) return (this.radius = Math.sqrt(r)), this }), (t.clone = function () { return new this.constructor().copy(this) }), (t.copy = function (e) { return this.center.copy(e.center), (this.radius = e.radius), this }), (t.isEmpty = function () { return this.radius < 0 }), (t.makeEmpty = function () { return this.center.set(0, 0, 0), (this.radius = -1), this }), (t.containsPoint = function (e) { return e.distanceToSquared(this.center) <= this.radius * this.radius }), (t.distanceToPoint = function (e) { return e.distanceTo(this.center) - this.radius }), (t.intersectsSphere = function (e) { var t = this.radius + e.radius return e.center.distanceToSquared(this.center) <= t * t }), (t.intersectsBox = function (e) { return e.intersectsSphere(this) }), (t.intersectsPlane = function (e) { return Math.abs(e.distanceToPoint(this.center)) <= this.radius }), (t.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 lr())), t.copy(e), n > this.radius * this.radius && (t.sub(this.center).normalize(), t.multiplyScalar(this.radius).add(this.center)), t ) }), (t.getBoundingBox = function (e) { return ( void 0 === e && (console.warn( 'THREE.Sphere: .getBoundingBox() target is now required', ), (e = new hr())), this.isEmpty() ? (e.makeEmpty(), e) : (e.set(this.center, this.center), e.expandByScalar(this.radius), e) ) }), (t.applyMatrix4 = function (e) { return ( this.center.applyMatrix4(e), (this.radius = this.radius * e.getMaxScaleOnAxis()), this ) }), (t.translate = function (e) { return this.center.add(e), this }), (t.equals = function (e) { return e.center.equals(this.center) && e.radius === this.radius }), e ) })(), Cr = new lr(), Lr = new lr(), Rr = new lr(), Pr = new lr(), Dr = new lr(), Or = new lr(), Ir = new lr(), Br = (function () { function e(e, t) { ;(this.origin = void 0 !== e ? e : new lr()), (this.direction = void 0 !== t ? t : new lr(0, 0, -1)) } var t = e.prototype return ( (t.set = function (e, t) { return this.origin.copy(e), this.direction.copy(t), this }), (t.clone = function () { return new this.constructor().copy(this) }), (t.copy = function (e) { return ( this.origin.copy(e.origin), this.direction.copy(e.direction), this ) }), (t.at = function (e, t) { return ( void 0 === t && (console.warn('THREE.Ray: .at() target is now required'), (t = new lr())), t.copy(this.direction).multiplyScalar(e).add(this.origin) ) }), (t.lookAt = function (e) { return this.direction.copy(e).sub(this.origin).normalize(), this }), (t.recast = function (e) { return this.origin.copy(this.at(e, Cr)), this }), (t.closestPointToPoint = function (e, t) { void 0 === t && (console.warn( 'THREE.Ray: .closestPointToPoint() target is now required', ), (t = new lr())), 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) }), (t.distanceToPoint = function (e) { return Math.sqrt(this.distanceSqToPoint(e)) }), (t.distanceSqToPoint = function (e) { var t = Cr.subVectors(e, this.origin).dot(this.direction) return t < 0 ? this.origin.distanceToSquared(e) : (Cr.copy(this.direction).multiplyScalar(t).add(this.origin), Cr.distanceToSquared(e)) }), (t.distanceSqToSegment = function (e, t, n, r) { Lr.copy(e).add(t).multiplyScalar(0.5), Rr.copy(t).sub(e).normalize(), Pr.copy(this.origin).sub(Lr) var i, o, a, s, l = 0.5 * e.distanceTo(t), c = -this.direction.dot(Rr), u = Pr.dot(this.direction), h = -Pr.dot(Rr), d = Pr.lengthSq(), p = Math.abs(1 - c * c) if (p > 0) if (((o = c * u - h), (s = l * p), (i = c * h - u) >= 0)) if (o >= -s) if (o <= s) { var f = 1 / p a = (i *= f) * (i + c * (o *= f) + 2 * u) + o * (c * i + o + 2 * h) + d } else (o = l), (a = -(i = Math.max(0, -(c * o + u))) * i + o * (o + 2 * h) + d) else (o = -l), (a = -(i = Math.max(0, -(c * o + u))) * i + o * (o + 2 * h) + d) else o <= -s ? (a = -(i = Math.max(0, -(-c * l + u))) * i + (o = i > 0 ? -l : Math.min(Math.max(-l, -h), l)) * (o + 2 * h) + d) : o <= s ? ((i = 0), (a = (o = Math.min(Math.max(-l, -h), l)) * (o + 2 * h) + d)) : (a = -(i = Math.max(0, -(c * l + u))) * i + (o = i > 0 ? l : Math.min(Math.max(-l, -h), l)) * (o + 2 * h) + d) else (o = c > 0 ? -l : l), (a = -(i = Math.max(0, -(c * o + u))) * i + o * (o + 2 * h) + d) return ( n && n.copy(this.direction).multiplyScalar(i).add(this.origin), r && r.copy(Rr).multiplyScalar(o).add(Lr), a ) }), (t.intersectSphere = function (e, t) { Cr.subVectors(e.center, this.origin) var n = Cr.dot(this.direction), r = Cr.dot(Cr) - n * n, i = e.radius * e.radius if (r > i) return null var o = Math.sqrt(i - r), a = n - o, s = n + o return a < 0 && s < 0 ? null : a < 0 ? this.at(s, t) : this.at(a, t) }), (t.intersectsSphere = function (e) { return this.distanceSqToPoint(e.center) <= e.radius * e.radius }), (t.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 }), (t.intersectPlane = function (e, t) { var n = this.distanceToPlane(e) return null === n ? null : this.at(n, t) }), (t.intersectsPlane = function (e) { var t = e.distanceToPoint(this.origin) return 0 === t || e.normal.dot(this.direction) * t < 0 }), (t.intersectBox = function (e, t) { var n, r, i, o, a, s, l = 1 / this.direction.x, c = 1 / this.direction.y, u = 1 / this.direction.z, h = this.origin return ( l >= 0 ? ((n = (e.min.x - h.x) * l), (r = (e.max.x - h.x) * l)) : ((n = (e.max.x - h.x) * l), (r = (e.min.x - h.x) * l)), c >= 0 ? ((i = (e.min.y - h.y) * c), (o = (e.max.y - h.y) * c)) : ((i = (e.max.y - h.y) * c), (o = (e.min.y - h.y) * c)), n > o || i > r ? null : ((i > n || n !== n) && (n = i), (o < r || r !== r) && (r = o), u >= 0 ? ((a = (e.min.z - h.z) * u), (s = (e.max.z - h.z) * u)) : ((a = (e.max.z - h.z) * u), (s = (e.min.z - h.z) * u)), n > s || a > r ? null : ((a > n || n !== n) && (n = a), (s < r || r !== r) && (r = s), r < 0 ? null : this.at(n >= 0 ? n : r, t))) ) }), (t.intersectsBox = function (e) { return null !== this.intersectBox(e, Cr) }), (t.intersectTriangle = function (e, t, n, r, i) { Dr.subVectors(t, e), Or.subVectors(n, e), Ir.crossVectors(Dr, Or) var o, a = this.direction.dot(Ir) if (a > 0) { if (r) return null o = 1 } else { if (!(a < 0)) return null ;(o = -1), (a = -a) } Pr.subVectors(this.origin, e) var s = o * this.direction.dot(Or.crossVectors(Pr, Or)) if (s < 0) return null var l = o * this.direction.dot(Dr.cross(Pr)) if (l < 0) return null if (s + l > a) return null var c = -o * Pr.dot(Ir) return c < 0 ? null : this.at(c / a, i) }), (t.applyMatrix4 = function (e) { return ( this.origin.applyMatrix4(e), this.direction.transformDirection(e), this ) }), (t.equals = function (e) { return ( e.origin.equals(this.origin) && e.direction.equals(this.direction) ) }), e ) })(), Fr = (function () { function e() { Object.defineProperty(this, 'isMatrix4', { value: !0 }), (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.', ) } var t = e.prototype return ( (t.set = function (e, t, n, r, i, o, a, s, l, c, u, h, d, p, f, m) { var v = this.elements return ( (v[0] = e), (v[4] = t), (v[8] = n), (v[12] = r), (v[1] = i), (v[5] = o), (v[9] = a), (v[13] = s), (v[2] = l), (v[6] = c), (v[10] = u), (v[14] = h), (v[3] = d), (v[7] = p), (v[11] = f), (v[15] = m), this ) }), (t.identity = function () { return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this }), (t.clone = function () { return new e().fromArray(this.elements) }), (t.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 ) }), (t.copyPosition = function (e) { var t = this.elements, n = e.elements return (t[12] = n[12]), (t[13] = n[13]), (t[14] = n[14]), this }), (t.setFromMatrix3 = function (e) { var t = e.elements return ( this.set( t[0], t[3], t[6], 0, t[1], t[4], t[7], 0, t[2], t[5], t[8], 0, 0, 0, 0, 1, ), this ) }), (t.extractBasis = function (e, t, n) { return ( e.setFromMatrixColumn(this, 0), t.setFromMatrixColumn(this, 1), n.setFromMatrixColumn(this, 2), this ) }), (t.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 ) }), (t.extractRotation = function (e) { var t = this.elements, n = e.elements, r = 1 / kr.setFromMatrixColumn(e, 0).length(), i = 1 / kr.setFromMatrixColumn(e, 1).length(), o = 1 / kr.setFromMatrixColumn(e, 2).length() return ( (t[0] = n[0] * r), (t[1] = n[1] * r), (t[2] = n[2] * r), (t[3] = 0), (t[4] = n[4] * i), (t[5] = n[5] * i), (t[6] = n[6] * i), (t[7] = 0), (t[8] = n[8] * o), (t[9] = n[9] * o), (t[10] = n[10] * o), (t[11] = 0), (t[12] = 0), (t[13] = 0), (t[14] = 0), (t[15] = 1), this ) }), (t.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, r = e.y, i = e.z, o = Math.cos(n), a = Math.sin(n), s = Math.cos(r), l = Math.sin(r), c = Math.cos(i), u = Math.sin(i) if ('XYZ' === e.order) { var h = o * c, d = o * u, p = a * c, f = a * u ;(t[0] = s * c), (t[4] = -s * u), (t[8] = l), (t[1] = d + p * l), (t[5] = h - f * l), (t[9] = -a * s), (t[2] = f - h * l), (t[6] = p + d * l), (t[10] = o * s) } else if ('YXZ' === e.order) { var m = s * c, v = s * u, g = l * c, y = l * u ;(t[0] = m + y * a), (t[4] = g * a - v), (t[8] = o * l), (t[1] = o * u), (t[5] = o * c), (t[9] = -a), (t[2] = v * a - g), (t[6] = y + m * a), (t[10] = o * s) } else if ('ZXY' === e.order) { var b = s * c, A = s * u, w = l * c, x = l * u ;(t[0] = b - x * a), (t[4] = -o * u), (t[8] = w + A * a), (t[1] = A + w * a), (t[5] = o * c), (t[9] = x - b * a), (t[2] = -o * l), (t[6] = a), (t[10] = o * s) } else if ('ZYX' === e.order) { var E = o * c, M = o * u, _ = a * c, T = a * u ;(t[0] = s * c), (t[4] = _ * l - M), (t[8] = E * l + T), (t[1] = s * u), (t[5] = T * l + E), (t[9] = M * l - _), (t[2] = -l), (t[6] = a * s), (t[10] = o * s) } else if ('YZX' === e.order) { var S = o * s, C = o * l, L = a * s, R = a * l ;(t[0] = s * c), (t[4] = R - S * u), (t[8] = L * u + C), (t[1] = u), (t[5] = o * c), (t[9] = -a * c), (t[2] = -l * c), (t[6] = C * u + L), (t[10] = S - R * u) } else if ('XZY' === e.order) { var P = o * s, D = o * l, O = a * s, I = a * l ;(t[0] = s * c), (t[4] = -u), (t[8] = l * c), (t[1] = P * u + I), (t[5] = o * c), (t[9] = D * u - O), (t[2] = O * u - D), (t[6] = a * c), (t[10] = I * u + P) } return ( (t[3] = 0), (t[7] = 0), (t[11] = 0), (t[12] = 0), (t[13] = 0), (t[14] = 0), (t[15] = 1), this ) }), (t.makeRotationFromQuaternion = function (e) { return this.compose(Ur, e, Hr) }), (t.lookAt = function (e, t, n) { var r = this.elements return ( jr.subVectors(e, t), 0 === jr.lengthSq() && (jr.z = 1), jr.normalize(), Gr.crossVectors(n, jr), 0 === Gr.lengthSq() && (1 === Math.abs(n.z) ? (jr.x += 1e-4) : (jr.z += 1e-4), jr.normalize(), Gr.crossVectors(n, jr)), Gr.normalize(), zr.crossVectors(jr, Gr), (r[0] = Gr.x), (r[4] = zr.x), (r[8] = jr.x), (r[1] = Gr.y), (r[5] = zr.y), (r[9] = jr.y), (r[2] = Gr.z), (r[6] = zr.z), (r[10] = jr.z), this ) }), (t.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) }), (t.premultiply = function (e) { return this.multiplyMatrices(e, this) }), (t.multiplyMatrices = function (e, t) { var n = e.elements, r = t.elements, i = this.elements, o = n[0], a = n[4], s = n[8], l = n[12], c = n[1], u = n[5], h = n[9], d = n[13], p = n[2], f = n[6], m = n[10], v = n[14], g = n[3], y = n[7], b = n[11], A = n[15], w = r[0], x = r[4], E = r[8], M = r[12], _ = r[1], T = r[5], S = r[9], C = r[13], L = r[2], R = r[6], P = r[10], D = r[14], O = r[3], I = r[7], B = r[11], F = r[15] return ( (i[0] = o * w + a * _ + s * L + l * O), (i[4] = o * x + a * T + s * R + l * I), (i[8] = o * E + a * S + s * P + l * B), (i[12] = o * M + a * C + s * D + l * F), (i[1] = c * w + u * _ + h * L + d * O), (i[5] = c * x + u * T + h * R + d * I), (i[9] = c * E + u * S + h * P + d * B), (i[13] = c * M + u * C + h * D + d * F), (i[2] = p * w + f * _ + m * L + v * O), (i[6] = p * x + f * T + m * R + v * I), (i[10] = p * E + f * S + m * P + v * B), (i[14] = p * M + f * C + m * D + v * F), (i[3] = g * w + y * _ + b * L + A * O), (i[7] = g * x + y * T + b * R + A * I), (i[11] = g * E + y * S + b * P + A * B), (i[15] = g * M + y * C + b * D + A * F), this ) }), (t.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 ) }), (t.determinant = function () { var e = this.elements, t = e[0], n = e[4], r = e[8], i = e[12], o = e[1], a = e[5], s = e[9], l = e[13], c = e[2], u = e[6], h = e[10], d = e[14] return ( e[3] * (+i * s * u - r * l * u - i * a * h + n * l * h + r * a * d - n * s * d) + e[7] * (+t * s * d - t * l * h + i * o * h - r * o * d + r * l * c - i * s * c) + e[11] * (+t * l * u - t * a * d - i * o * u + n * o * d + i * a * c - n * l * c) + e[15] * (-r * a * c - t * s * u + t * a * h + r * o * u - n * o * h + n * s * c) ) }), (t.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 ) }), (t.setPosition = function (e, t, n) { var r = this.elements return ( e.isVector3 ? ((r[12] = e.x), (r[13] = e.y), (r[14] = e.z)) : ((r[12] = e), (r[13] = t), (r[14] = n)), this ) }), (t.invert = function () { var e = this.elements, t = e[0], n = e[1], r = e[2], i = e[3], o = e[4], a = e[5], s = e[6], l = e[7], c = e[8], u = e[9], h = e[10], d = e[11], p = e[12], f = e[13], m = e[14], v = e[15], g = u * m * l - f * h * l + f * s * d - a * m * d - u * s * v + a * h * v, y = p * h * l - c * m * l - p * s * d + o * m * d + c * s * v - o * h * v, b = c * f * l - p * u * l + p * a * d - o * f * d - c * a * v + o * u * v, A = p * u * s - c * f * s - p * a * h + o * f * h + c * a * m - o * u * m, w = t * g + n * y + r * b + i * A if (0 === w) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) var x = 1 / w return ( (e[0] = g * x), (e[1] = (f * h * i - u * m * i - f * r * d + n * m * d + u * r * v - n * h * v) * x), (e[2] = (a * m * i - f * s * i + f * r * l - n * m * l - a * r * v + n * s * v) * x), (e[3] = (u * s * i - a * h * i - u * r * l + n * h * l + a * r * d - n * s * d) * x), (e[4] = y * x), (e[5] = (c * m * i - p * h * i + p * r * d - t * m * d - c * r * v + t * h * v) * x), (e[6] = (p * s * i - o * m * i - p * r * l + t * m * l + o * r * v - t * s * v) * x), (e[7] = (o * h * i - c * s * i + c * r * l - t * h * l - o * r * d + t * s * d) * x), (e[8] = b * x), (e[9] = (p * u * i - c * f * i - p * n * d + t * f * d + c * n * v - t * u * v) * x), (e[10] = (o * f * i - p * a * i + p * n * l - t * f * l - o * n * v + t * a * v) * x), (e[11] = (c * a * i - o * u * i - c * n * l + t * u * l + o * n * d - t * a * d) * x), (e[12] = A * x), (e[13] = (c * f * r - p * u * r + p * n * h - t * f * h - c * n * m + t * u * m) * x), (e[14] = (p * a * r - o * f * r - p * n * s + t * f * s + o * n * m - t * a * m) * x), (e[15] = (o * u * r - c * a * r + c * n * s - t * u * s - o * n * h + t * a * h) * x), this ) }), (t.scale = function (e) { var t = this.elements, n = e.x, r = e.y, i = e.z return ( (t[0] *= n), (t[4] *= r), (t[8] *= i), (t[1] *= n), (t[5] *= r), (t[9] *= i), (t[2] *= n), (t[6] *= r), (t[10] *= i), (t[3] *= n), (t[7] *= r), (t[11] *= i), this ) }), (t.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], r = e[8] * e[8] + e[9] * e[9] + e[10] * e[10] return Math.sqrt(Math.max(t, n, r)) }), (t.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 }), (t.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 }), (t.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 }), (t.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 }), (t.makeRotationAxis = function (e, t) { var n = Math.cos(t), r = Math.sin(t), i = 1 - n, o = e.x, a = e.y, s = e.z, l = i * o, c = i * a return ( this.set( l * o + n, l * a - r * s, l * s + r * a, 0, l * a + r * s, c * a + n, c * s - r * o, 0, l * s - r * a, c * s + r * o, i * s * s + n, 0, 0, 0, 0, 1, ), this ) }), (t.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 }), (t.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 }), (t.compose = function (e, t, n) { var r = this.elements, i = t._x, o = t._y, a = t._z, s = t._w, l = i + i, c = o + o, u = a + a, h = i * l, d = i * c, p = i * u, f = o * c, m = o * u, v = a * u, g = s * l, y = s * c, b = s * u, A = n.x, w = n.y, x = n.z return ( (r[0] = (1 - (f + v)) * A), (r[1] = (d + b) * A), (r[2] = (p - y) * A), (r[3] = 0), (r[4] = (d - b) * w), (r[5] = (1 - (h + v)) * w), (r[6] = (m + g) * w), (r[7] = 0), (r[8] = (p + y) * x), (r[9] = (m - g) * x), (r[10] = (1 - (h + f)) * x), (r[11] = 0), (r[12] = e.x), (r[13] = e.y), (r[14] = e.z), (r[15] = 1), this ) }), (t.decompose = function (e, t, n) { var r = this.elements, i = kr.set(r[0], r[1], r[2]).length(), o = kr.set(r[4], r[5], r[6]).length(), a = kr.set(r[8], r[9], r[10]).length() this.determinant() < 0 && (i = -i), (e.x = r[12]), (e.y = r[13]), (e.z = r[14]), Nr.copy(this) var s = 1 / i, l = 1 / o, c = 1 / a return ( (Nr.elements[0] *= s), (Nr.elements[1] *= s), (Nr.elements[2] *= s), (Nr.elements[4] *= l), (Nr.elements[5] *= l), (Nr.elements[6] *= l), (Nr.elements[8] *= c), (Nr.elements[9] *= c), (Nr.elements[10] *= c), t.setFromRotationMatrix(Nr), (n.x = i), (n.y = o), (n.z = a), this ) }), (t.makePerspective = function (e, t, n, r, i, o) { void 0 === o && console.warn( 'THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.', ) var a = this.elements, s = (2 * i) / (t - e), l = (2 * i) / (n - r), c = (t + e) / (t - e), u = (n + r) / (n - r), h = -(o + i) / (o - i), d = (-2 * o * i) / (o - i) return ( (a[0] = s), (a[4] = 0), (a[8] = c), (a[12] = 0), (a[1] = 0), (a[5] = l), (a[9] = u), (a[13] = 0), (a[2] = 0), (a[6] = 0), (a[10] = h), (a[14] = d), (a[3] = 0), (a[7] = 0), (a[11] = -1), (a[15] = 0), this ) }), (t.makeOrthographic = function (e, t, n, r, i, o) { var a = this.elements, s = 1 / (t - e), l = 1 / (n - r), c = 1 / (o - i), u = (t + e) * s, h = (n + r) * l, d = (o + i) * c return ( (a[0] = 2 * s), (a[4] = 0), (a[8] = 0), (a[12] = -u), (a[1] = 0), (a[5] = 2 * l), (a[9] = 0), (a[13] = -h), (a[2] = 0), (a[6] = 0), (a[10] = -2 * c), (a[14] = -d), (a[3] = 0), (a[7] = 0), (a[11] = 0), (a[15] = 1), this ) }), (t.equals = function (e) { for (var t = this.elements, n = e.elements, r = 0; r < 16; r++) if (t[r] !== n[r]) return !1 return !0 }), (t.fromArray = function (e, t) { void 0 === t && (t = 0) for (var n = 0; n < 16; n++) this.elements[n] = e[n + t] return this }), (t.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 ) }), e ) })(), kr = new lr(), Nr = new Fr(), Ur = new lr(0, 0, 0), Hr = new lr(1, 1, 1), Gr = new lr(), zr = new lr(), jr = new lr(), Vr = (function () { function e(t, n, r, i) { void 0 === t && (t = 0), void 0 === n && (n = 0), void 0 === r && (r = 0), void 0 === i && (i = e.DefaultOrder), Object.defineProperty(this, 'isEuler', { value: !0 }), (this._x = t), (this._y = n), (this._z = r), (this._order = i) } var t = e.prototype return ( (t.set = function (e, t, n, r) { return ( (this._x = e), (this._y = t), (this._z = n), (this._order = r || this._order), this._onChangeCallback(), this ) }), (t.clone = function () { return new this.constructor(this._x, this._y, this._z, this._order) }), (t.copy = function (e) { return ( (this._x = e._x), (this._y = e._y), (this._z = e._z), (this._order = e._order), this._onChangeCallback(), this ) }), (t.setFromRotationMatrix = function (e, t, n) { var r = Kn.clamp, i = e.elements, o = i[0], a = i[4], s = i[8], l = i[1], c = i[5], u = i[9], h = i[2], d = i[6], p = i[10] switch ((t = t || this._order)) { case 'XYZ': ;(this._y = Math.asin(r(s, -1, 1))), Math.abs(s) < 0.9999999 ? ((this._x = Math.atan2(-u, p)), (this._z = Math.atan2(-a, o))) : ((this._x = Math.atan2(d, c)), (this._z = 0)) break case 'YXZ': ;(this._x = Math.asin(-r(u, -1, 1))), Math.abs(u) < 0.9999999 ? ((this._y = Math.atan2(s, p)), (this._z = Math.atan2(l, c))) : ((this._y = Math.atan2(-h, o)), (this._z = 0)) break case 'ZXY': ;(this._x = Math.asin(r(d, -1, 1))), Math.abs(d) < 0.9999999 ? ((this._y = Math.atan2(-h, p)), (this._z = Math.atan2(-a, c))) : ((this._y = 0), (this._z = Math.atan2(l, o))) break case 'ZYX': ;(this._y = Math.asin(-r(h, -1, 1))), Math.abs(h) < 0.9999999 ? ((this._x = Math.atan2(d, p)), (this._z = Math.atan2(l, o))) : ((this._x = 0), (this._z = Math.atan2(-a, c))) break case 'YZX': ;(this._z = Math.asin(r(l, -1, 1))), Math.abs(l) < 0.9999999 ? ((this._x = Math.atan2(-u, c)), (this._y = Math.atan2(-h, o))) : ((this._x = 0), (this._y = Math.atan2(s, p))) break case 'XZY': ;(this._z = Math.asin(-r(a, -1, 1))), Math.abs(a) < 0.9999999 ? ((this._x = Math.atan2(d, c)), (this._y = Math.atan2(s, o))) : ((this._x = Math.atan2(-u, p)), (this._y = 0)) break default: console.warn( 'THREE.Euler: .setFromRotationMatrix() encountered an unknown order: ' + t, ) } return (this._order = t), !1 !== n && this._onChangeCallback(), this }), (t.setFromQuaternion = function (e, t, n) { return ( Wr.makeRotationFromQuaternion(e), this.setFromRotationMatrix(Wr, t, n) ) }), (t.setFromVector3 = function (e, t) { return this.set(e.x, e.y, e.z, t || this._order) }), (t.reorder = function (e) { return qr.setFromEuler(this), this.setFromQuaternion(qr, e) }), (t.equals = function (e) { return ( e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order ) }), (t.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 ) }), (t.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 ) }), (t.toVector3 = function (e) { return e ? e.set(this._x, this._y, this._z) : new lr(this._x, this._y, this._z) }), (t._onChange = function (e) { return (this._onChangeCallback = e), this }), (t._onChangeCallback = function () {}), Hn(e, [ { key: 'x', get: function () { return this._x }, set: function (e) { ;(this._x = e), this._onChangeCallback() }, }, { key: 'y', get: function () { return this._y }, set: function (e) { ;(this._y = e), this._onChangeCallback() }, }, { key: 'z', get: function () { return this._z }, set: function (e) { ;(this._z = e), this._onChangeCallback() }, }, { key: 'order', get: function () { return this._order }, set: function (e) { ;(this._order = e), this._onChangeCallback() }, }, ]), e ) })() ;(Vr.DefaultOrder = 'XYZ'), (Vr.RotationOrders = ['XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX']) var Wr = new Fr(), qr = new sr(), Xr = (function () { function e() { this.mask = 1 } var t = e.prototype return ( (t.set = function (e) { this.mask = (1 << e) | 0 }), (t.enable = function (e) { this.mask |= (1 << e) | 0 }), (t.enableAll = function () { this.mask = -1 }), (t.toggle = function (e) { this.mask ^= (1 << e) | 0 }), (t.disable = function (e) { this.mask &= ~((1 << e) | 0) }), (t.disableAll = function () { this.mask = 0 }), (t.test = function (e) { return 0 !== (this.mask & e.mask) }), e ) })(), Yr = 0, Qr = new lr(), Zr = new sr(), Kr = new Fr(), Jr = new lr(), $r = new lr(), ei = new lr(), ti = new sr(), ni = new lr(1, 0, 0), ri = new lr(0, 1, 0), ii = new lr(0, 0, 1), oi = { type: 'added' }, ai = { type: 'removed' } function si() { Object.defineProperty(this, 'id', { value: Yr++ }), (this.uuid = Kn.generateUUID()), (this.name = ''), (this.type = 'Object3D'), (this.parent = null), (this.children = []), (this.up = si.DefaultUp.clone()) var e = new lr(), t = new Vr(), n = new sr(), r = new lr(1, 1, 1) function i() { n.setFromEuler(t, !1) } function o() { t.setFromQuaternion(n, void 0, !1) } t._onChange(i), n._onChange(o), Object.defineProperties(this, { position: { configurable: !0, enumerable: !0, value: e }, rotation: { configurable: !0, enumerable: !0, value: t }, quaternion: { configurable: !0, enumerable: !0, value: n }, scale: { configurable: !0, enumerable: !0, value: r }, modelViewMatrix: { value: new Fr() }, normalMatrix: { value: new $n() }, }), (this.matrix = new Fr()), (this.matrixWorld = new Fr()), (this.matrixAutoUpdate = si.DefaultMatrixAutoUpdate), (this.matrixWorldNeedsUpdate = !1), (this.layers = new Xr()), (this.visible = !0), (this.castShadow = !1), (this.receiveShadow = !1), (this.frustumCulled = !0), (this.renderOrder = 0), (this.animations = []), (this.userData = {}) } ;(si.DefaultUp = new lr(0, 1, 0)), (si.DefaultMatrixAutoUpdate = !0), (si.prototype = Object.assign(Object.create(qn.prototype), { constructor: si, 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 Zr.setFromAxisAngle(e, t), this.quaternion.multiply(Zr), this }, rotateOnWorldAxis: function (e, t) { return Zr.setFromAxisAngle(e, t), this.quaternion.premultiply(Zr), this }, rotateX: function (e) { return this.rotateOnAxis(ni, e) }, rotateY: function (e) { return this.rotateOnAxis(ri, e) }, rotateZ: function (e) { return this.rotateOnAxis(ii, e) }, translateOnAxis: function (e, t) { return ( Qr.copy(e).applyQuaternion(this.quaternion), this.position.add(Qr.multiplyScalar(t)), this ) }, translateX: function (e) { return this.translateOnAxis(ni, e) }, translateY: function (e) { return this.translateOnAxis(ri, e) }, translateZ: function (e) { return this.translateOnAxis(ii, e) }, localToWorld: function (e) { return e.applyMatrix4(this.matrixWorld) }, worldToLocal: function (e) { return e.applyMatrix4(Kr.copy(this.matrixWorld).invert()) }, lookAt: function (e, t, n) { e.isVector3 ? Jr.copy(e) : Jr.set(e, t, n) var r = this.parent this.updateWorldMatrix(!0, !1), $r.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ? Kr.lookAt($r, Jr, this.up) : Kr.lookAt(Jr, $r, this.up), this.quaternion.setFromRotationMatrix(Kr), r && (Kr.extractRotation(r.matrixWorld), Zr.setFromRotationMatrix(Kr), this.quaternion.premultiply(Zr.invert())) }, 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(oi)) : 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(ai)), this ) }, clear: function () { for (var e = 0; e < this.children.length; e++) { var t = this.children[e] ;(t.parent = null), t.dispatchEvent(ai) } return (this.children.length = 0), this }, attach: function (e) { return ( this.updateWorldMatrix(!0, !1), Kr.copy(this.matrixWorld).invert(), null !== e.parent && (e.parent.updateWorldMatrix(!0, !1), Kr.multiply(e.parent.matrixWorld)), e.applyMatrix4(Kr), 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, r = this.children.length; n < r; n++) { var i = this.children[n].getObjectByProperty(e, t) if (void 0 !== i) return i } }, getWorldPosition: function (e) { return ( void 0 === e && (console.warn( 'THREE.Object3D: .getWorldPosition() target is now required', ), (e = new lr())), this.updateWorldMatrix(!0, !1), e.setFromMatrixPosition(this.matrixWorld) ) }, getWorldQuaternion: function (e) { return ( void 0 === e && (console.warn( 'THREE.Object3D: .getWorldQuaternion() target is now required', ), (e = new sr())), this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose($r, e, ei), e ) }, getWorldScale: function (e) { return ( void 0 === e && (console.warn( 'THREE.Object3D: .getWorldScale() target is now required', ), (e = new lr())), this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose($r, ti, e), e ) }, getWorldDirection: function (e) { void 0 === e && (console.warn( 'THREE.Object3D: .getWorldDirection() target is now required', ), (e = new lr())), this.updateWorldMatrix(!0, !1) 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, r = t.length; n < r; n++) t[n].traverse(e) }, traverseVisible: function (e) { if (!1 !== this.visible) { e(this) for (var t = this.children, n = 0, r = t.length; n < r; 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, r = t.length; n < r; 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 r = this.children, i = 0, o = r.length; i < o; i++) r[i].updateWorldMatrix(!1, !0) }, toJSON: function (e) { var t = void 0 === e || 'string' === typeof e, n = {} t && ((e = { geometries: {}, materials: {}, textures: {}, images: {}, shapes: {}, skeletons: {}, animations: {}, }), (n.metadata = { version: 4.5, type: 'Object', generator: 'Object3D.toJSON', })) var r = {} function i(t, n) { return void 0 === t[n.uuid] && (t[n.uuid] = n.toJSON(e)), n.uuid } if ( ((r.uuid = this.uuid), (r.type = this.type), '' !== this.name && (r.name = this.name), !0 === this.castShadow && (r.castShadow = !0), !0 === this.receiveShadow && (r.receiveShadow = !0), !1 === this.visible && (r.visible = !1), !1 === this.frustumCulled && (r.frustumCulled = !1), 0 !== this.renderOrder && (r.renderOrder = this.renderOrder), '{}' !== JSON.stringify(this.userData) && (r.userData = this.userData), (r.layers = this.layers.mask), (r.matrix = this.matrix.toArray()), !1 === this.matrixAutoUpdate && (r.matrixAutoUpdate = !1), this.isInstancedMesh && ((r.type = 'InstancedMesh'), (r.count = this.count), (r.instanceMatrix = this.instanceMatrix.toJSON())), this.isMesh || this.isLine || this.isPoints) ) { r.geometry = i(e.geometries, this.geometry) var o = this.geometry.parameters if (void 0 !== o && void 0 !== o.shapes) { var a = o.shapes if (Array.isArray(a)) for (var s = 0, l = a.length; s < l; s++) { var c = a[s] i(e.shapes, c) } else i(e.shapes, a) } } if ( (this.isSkinnedMesh && ((r.bindMode = this.bindMode), (r.bindMatrix = this.bindMatrix.toArray()), void 0 !== this.skeleton && (i(e.skeletons, this.skeleton), (r.skeleton = this.skeleton.uuid))), void 0 !== this.material) ) if (Array.isArray(this.material)) { for (var u = [], h = 0, d = this.material.length; h < d; h++) u.push(i(e.materials, this.material[h])) r.material = u } else r.material = i(e.materials, this.material) if (this.children.length > 0) { r.children = [] for (var p = 0; p < this.children.length; p++) r.children.push(this.children[p].toJSON(e).object) } if (this.animations.length > 0) { r.animations = [] for (var f = 0; f < this.animations.length; f++) { var m = this.animations[f] r.animations.push(i(e.animations, m)) } } if (t) { var v = E(e.geometries), g = E(e.materials), y = E(e.textures), b = E(e.images), A = E(e.shapes), w = E(e.skeletons), x = E(e.animations) v.length > 0 && (n.geometries = v), g.length > 0 && (n.materials = g), y.length > 0 && (n.textures = y), b.length > 0 && (n.images = b), A.length > 0 && (n.shapes = A), w.length > 0 && (n.skeletons = w), x.length > 0 && (n.animations = x) } return (n.object = r), n function E(e) { var t = [] for (var n in e) { var r = e[n] delete r.metadata, t.push(r) } return t } }, 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.rotation.order = e.rotation.order), 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 r = e.children[n] this.add(r.clone()) } return this }, })) var li = new lr(), ci = new lr(), ui = new $n(), hi = (function () { function e(e, t) { Object.defineProperty(this, 'isPlane', { value: !0 }), (this.normal = void 0 !== e ? e : new lr(1, 0, 0)), (this.constant = void 0 !== t ? t : 0) } var t = e.prototype return ( (t.set = function (e, t) { return this.normal.copy(e), (this.constant = t), this }), (t.setComponents = function (e, t, n, r) { return this.normal.set(e, t, n), (this.constant = r), this }), (t.setFromNormalAndCoplanarPoint = function (e, t) { return this.normal.copy(e), (this.constant = -t.dot(this.normal)), this }), (t.setFromCoplanarPoints = function (e, t, n) { var r = li.subVectors(n, t).cross(ci.subVectors(e, t)).normalize() return this.setFromNormalAndCoplanarPoint(r, e), this }), (t.clone = function () { return new this.constructor().copy(this) }), (t.copy = function (e) { return this.normal.copy(e.normal), (this.constant = e.constant), this }), (t.normalize = function () { var e = 1 / this.normal.length() return this.normal.multiplyScalar(e), (this.constant *= e), this }), (t.negate = function () { return (this.constant *= -1), this.normal.negate(), this }), (t.distanceToPoint = function (e) { return this.normal.dot(e) + this.constant }), (t.distanceToSphere = function (e) { return this.distanceToPoint(e.center) - e.radius }), (t.projectPoint = function (e, t) { return ( void 0 === t && (console.warn( 'THREE.Plane: .projectPoint() target is now required', ), (t = new lr())), t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e) ) }), (t.intersectLine = function (e, t) { void 0 === t && (console.warn('THREE.Plane: .intersectLine() target is now required'), (t = new lr())) var n = e.delta(li), r = this.normal.dot(n) if (0 === r) return 0 === this.distanceToPoint(e.start) ? t.copy(e.start) : void 0 var i = -(e.start.dot(this.normal) + this.constant) / r return i < 0 || i > 1 ? void 0 : t.copy(n).multiplyScalar(i).add(e.start) }), (t.intersectsLine = function (e) { var t = this.distanceToPoint(e.start), n = this.distanceToPoint(e.end) return (t < 0 && n > 0) || (n < 0 && t > 0) }), (t.intersectsBox = function (e) { return e.intersectsPlane(this) }), (t.intersectsSphere = function (e) { return e.intersectsPlane(this) }), (t.coplanarPoint = function (e) { return ( void 0 === e && (console.warn( 'THREE.Plane: .coplanarPoint() target is now required', ), (e = new lr())), e.copy(this.normal).multiplyScalar(-this.constant) ) }), (t.applyMatrix4 = function (e, t) { var n = t || ui.getNormalMatrix(e), r = this.coplanarPoint(li).applyMatrix4(e), i = this.normal.applyMatrix3(n).normalize() return (this.constant = -r.dot(i)), this }), (t.translate = function (e) { return (this.constant -= e.dot(this.normal)), this }), (t.equals = function (e) { return e.normal.equals(this.normal) && e.constant === this.constant }), e ) })(), di = new lr(), pi = new lr(), fi = new lr(), mi = new lr(), vi = new lr(), gi = new lr(), yi = new lr(), bi = new lr(), Ai = new lr(), wi = new lr(), xi = (function () { function e(e, t, n) { ;(this.a = void 0 !== e ? e : new lr()), (this.b = void 0 !== t ? t : new lr()), (this.c = void 0 !== n ? n : new lr()) } ;(e.getNormal = function (e, t, n, r) { void 0 === r && (console.warn('THREE.Triangle: .getNormal() target is now required'), (r = new lr())), r.subVectors(n, t), di.subVectors(e, t), r.cross(di) var i = r.lengthSq() return i > 0 ? r.multiplyScalar(1 / Math.sqrt(i)) : r.set(0, 0, 0) }), (e.getBarycoord = function (e, t, n, r, i) { di.subVectors(r, t), pi.subVectors(n, t), fi.subVectors(e, t) var o = di.dot(di), a = di.dot(pi), s = di.dot(fi), l = pi.dot(pi), c = pi.dot(fi), u = o * l - a * a if ( (void 0 === i && (console.warn( 'THREE.Triangle: .getBarycoord() target is now required', ), (i = new lr())), 0 === u) ) return i.set(-2, -1, -1) var h = 1 / u, d = (l * s - a * c) * h, p = (o * c - a * s) * h return i.set(1 - d - p, p, d) }), (e.containsPoint = function (e, t, n, r) { return ( this.getBarycoord(e, t, n, r, mi), mi.x >= 0 && mi.y >= 0 && mi.x + mi.y <= 1 ) }), (e.getUV = function (e, t, n, r, i, o, a, s) { return ( this.getBarycoord(e, t, n, r, mi), s.set(0, 0), s.addScaledVector(i, mi.x), s.addScaledVector(o, mi.y), s.addScaledVector(a, mi.z), s ) }), (e.isFrontFacing = function (e, t, n, r) { return di.subVectors(n, t), pi.subVectors(e, t), di.cross(pi).dot(r) < 0 }) var t = e.prototype return ( (t.set = function (e, t, n) { return this.a.copy(e), this.b.copy(t), this.c.copy(n), this }), (t.setFromPointsAndIndices = function (e, t, n, r) { return this.a.copy(e[t]), this.b.copy(e[n]), this.c.copy(e[r]), this }), (t.clone = function () { return new this.constructor().copy(this) }), (t.copy = function (e) { return this.a.copy(e.a), this.b.copy(e.b), this.c.copy(e.c), this }), (t.getArea = function () { return ( di.subVectors(this.c, this.b), pi.subVectors(this.a, this.b), 0.5 * di.cross(pi).length() ) }), (t.getMidpoint = function (e) { return ( void 0 === e && (console.warn( 'THREE.Triangle: .getMidpoint() target is now required', ), (e = new lr())), e .addVectors(this.a, this.b) .add(this.c) .multiplyScalar(1 / 3) ) }), (t.getNormal = function (t) { return e.getNormal(this.a, this.b, this.c, t) }), (t.getPlane = function (e) { return ( void 0 === e && (console.warn('THREE.Triangle: .getPlane() target is now required'), (e = new hi())), e.setFromCoplanarPoints(this.a, this.b, this.c) ) }), (t.getBarycoord = function (t, n) { return e.getBarycoord(t, this.a, this.b, this.c, n) }), (t.getUV = function (t, n, r, i, o) { return e.getUV(t, this.a, this.b, this.c, n, r, i, o) }), (t.containsPoint = function (t) { return e.containsPoint(t, this.a, this.b, this.c) }), (t.isFrontFacing = function (t) { return e.isFrontFacing(this.a, this.b, this.c, t) }), (t.intersectsBox = function (e) { return e.intersectsTriangle(this) }), (t.closestPointToPoint = function (e, t) { void 0 === t && (console.warn( 'THREE.Triangle: .closestPointToPoint() target is now required', ), (t = new lr())) var n, r, i = this.a, o = this.b, a = this.c vi.subVectors(o, i), gi.subVectors(a, i), bi.subVectors(e, i) var s = vi.dot(bi), l = gi.dot(bi) if (s <= 0 && l <= 0) return t.copy(i) Ai.subVectors(e, o) var c = vi.dot(Ai), u = gi.dot(Ai) if (c >= 0 && u <= c) return t.copy(o) var h = s * u - c * l if (h <= 0 && s >= 0 && c <= 0) return (n = s / (s - c)), t.copy(i).addScaledVector(vi, n) wi.subVectors(e, a) var d = vi.dot(wi), p = gi.dot(wi) if (p >= 0 && d <= p) return t.copy(a) var f = d * l - s * p if (f <= 0 && l >= 0 && p <= 0) return (r = l / (l - p)), t.copy(i).addScaledVector(gi, r) var m = c * p - d * u if (m <= 0 && u - c >= 0 && d - p >= 0) return ( yi.subVectors(a, o), (r = (u - c) / (u - c + (d - p))), t.copy(o).addScaledVector(yi, r) ) var v = 1 / (m + f + h) return ( (n = f * v), (r = h * v), t.copy(i).addScaledVector(vi, n).addScaledVector(gi, r) ) }), (t.equals = function (e) { return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c) }), e ) })(), Ei = { 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, }, Mi = { h: 0, s: 0, l: 0 }, _i = { h: 0, s: 0, l: 0 } function Ti(e, t, n) { return ( n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? e + 6 * (t - e) * n : n < 0.5 ? t : n < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - n) : e ) } function Si(e) { return e < 0.04045 ? 0.0773993808 * e : Math.pow(0.9478672986 * e + 0.0521327014, 2.4) } function Ci(e) { return e < 0.0031308 ? 12.92 * e : 1.055 * Math.pow(e, 0.41666) - 0.055 } var Li = (function () { function e(e, t, n) { return ( Object.defineProperty(this, 'isColor', { value: !0 }), void 0 === t && void 0 === n ? this.set(e) : this.setRGB(e, t, n) ) } var t = e.prototype return ( (t.set = function (e) { return ( e && e.isColor ? this.copy(e) : 'number' === typeof e ? this.setHex(e) : 'string' === typeof e && this.setStyle(e), this ) }), (t.setScalar = function (e) { return (this.r = e), (this.g = e), (this.b = e), this }), (t.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 ) }), (t.setRGB = function (e, t, n) { return (this.r = e), (this.g = t), (this.b = n), this }), (t.setHSL = function (e, t, n) { if ( ((e = Kn.euclideanModulo(e, 1)), (t = Kn.clamp(t, 0, 1)), (n = Kn.clamp(n, 0, 1)), 0 === t) ) this.r = this.g = this.b = n else { var r = n <= 0.5 ? n * (1 + t) : n + t - n * t, i = 2 * n - r ;(this.r = Ti(i, r, e + 1 / 3)), (this.g = Ti(i, r, e)), (this.b = Ti(i, r, e - 1 / 3)) } return this }), (t.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?)\(([^\)]*)\)/.exec(e))) { var r, i = n[1], o = n[2] switch (i) { case 'rgb': case 'rgba': if ( (r = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec( o, )) ) return ( (this.r = Math.min(255, parseInt(r[1], 10)) / 255), (this.g = Math.min(255, parseInt(r[2], 10)) / 255), (this.b = Math.min(255, parseInt(r[3], 10)) / 255), t(r[4]), this ) if ( (r = /^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec( o, )) ) return ( (this.r = Math.min(100, parseInt(r[1], 10)) / 100), (this.g = Math.min(100, parseInt(r[2], 10)) / 100), (this.b = Math.min(100, parseInt(r[3], 10)) / 100), t(r[4]), this ) break case 'hsl': case 'hsla': if ( (r = /^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec( o, )) ) { var a = parseFloat(r[1]) / 360, s = parseInt(r[2], 10) / 100, l = parseInt(r[3], 10) / 100 return t(r[4]), this.setHSL(a, s, l) } } } else if ((n = /^\#([A-Fa-f\d]+)$/.exec(e))) { var c = n[1], u = c.length if (3 === u) return ( (this.r = parseInt(c.charAt(0) + c.charAt(0), 16) / 255), (this.g = parseInt(c.charAt(1) + c.charAt(1), 16) / 255), (this.b = parseInt(c.charAt(2) + c.charAt(2), 16) / 255), this ) if (6 === u) return ( (this.r = parseInt(c.charAt(0) + c.charAt(1), 16) / 255), (this.g = parseInt(c.charAt(2) + c.charAt(3), 16) / 255), (this.b = parseInt(c.charAt(4) + c.charAt(5), 16) / 255), this ) } return e && e.length > 0 ? this.setColorName(e) : this }), (t.setColorName = function (e) { var t = Ei[e] return ( void 0 !== t ? this.setHex(t) : console.warn('THREE.Color: Unknown color ' + e), this ) }), (t.clone = function () { return new this.constructor(this.r, this.g, this.b) }), (t.copy = function (e) { return (this.r = e.r), (this.g = e.g), (this.b = e.b), this }), (t.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 ) }), (t.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 ) }), (t.convertGammaToLinear = function (e) { return this.copyGammaToLinear(this, e), this }), (t.convertLinearToGamma = function (e) { return this.copyLinearToGamma(this, e), this }), (t.copySRGBToLinear = function (e) { return (this.r = Si(e.r)), (this.g = Si(e.g)), (this.b = Si(e.b)), this }), (t.copyLinearToSRGB = function (e) { return (this.r = Ci(e.r)), (this.g = Ci(e.g)), (this.b = Ci(e.b)), this }), (t.convertSRGBToLinear = function () { return this.copySRGBToLinear(this), this }), (t.convertLinearToSRGB = function () { return this.copyLinearToSRGB(this), this }), (t.getHex = function () { return ( ((255 * this.r) << 16) ^ ((255 * this.g) << 8) ^ ((255 * this.b) << 0) ) }), (t.getHexString = function () { return ('000000' + this.getHex().toString(16)).slice(-6) }), (t.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, r = this.r, i = this.g, o = this.b, a = Math.max(r, i, o), s = Math.min(r, i, o), l = (s + a) / 2 if (s === a) (t = 0), (n = 0) else { var c = a - s switch (((n = l <= 0.5 ? c / (a + s) : c / (2 - a - s)), a)) { case r: t = (i - o) / c + (i < o ? 6 : 0) break case i: t = (o - r) / c + 2 break case o: t = (r - i) / c + 4 } t /= 6 } return (e.h = t), (e.s = n), (e.l = l), e }), (t.getStyle = function () { return ( 'rgb(' + ((255 * this.r) | 0) + ',' + ((255 * this.g) | 0) + ',' + ((255 * this.b) | 0) + ')' ) }), (t.offsetHSL = function (e, t, n) { return ( this.getHSL(Mi), (Mi.h += e), (Mi.s += t), (Mi.l += n), this.setHSL(Mi.h, Mi.s, Mi.l), this ) }), (t.add = function (e) { return (this.r += e.r), (this.g += e.g), (this.b += e.b), this }), (t.addColors = function (e, t) { return ( (this.r = e.r + t.r), (this.g = e.g + t.g), (this.b = e.b + t.b), this ) }), (t.addScalar = function (e) { return (this.r += e), (this.g += e), (this.b += e), this }), (t.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 ) }), (t.multiply = function (e) { return (this.r *= e.r), (this.g *= e.g), (this.b *= e.b), this }), (t.multiplyScalar = function (e) { return (this.r *= e), (this.g *= e), (this.b *= e), this }), (t.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 ) }), (t.lerpColors = function (e, t, n) { return ( (this.r = e.r + (t.r - e.r) * n), (this.g = e.g + (t.g - e.g) * n), (this.b = e.b + (t.b - e.b) * n), this ) }), (t.lerpHSL = function (e, t) { this.getHSL(Mi), e.getHSL(_i) var n = Kn.lerp(Mi.h, _i.h, t), r = Kn.lerp(Mi.s, _i.s, t), i = Kn.lerp(Mi.l, _i.l, t) return this.setHSL(n, r, i), this }), (t.equals = function (e) { return e.r === this.r && e.g === this.g && e.b === this.b }), (t.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 ) }), (t.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 ) }), (t.fromBufferAttribute = function (e, t) { return ( (this.r = e.getX(t)), (this.g = e.getY(t)), (this.b = e.getZ(t)), !0 === e.normalized && ((this.r /= 255), (this.g /= 255), (this.b /= 255)), this ) }), (t.toJSON = function () { return this.getHex() }), e ) })() ;(Li.NAMES = Ei), (Li.prototype.r = 1), (Li.prototype.g = 1), (Li.prototype.b = 1) var Ri = (function () { function e(e, t, n, r, i, o) { void 0 === o && (o = 0), (this.a = e), (this.b = t), (this.c = n), (this.normal = r && r.isVector3 ? r : new lr()), (this.vertexNormals = Array.isArray(r) ? r : []), (this.color = i && i.isColor ? i : new Li()), (this.vertexColors = Array.isArray(i) ? i : []), (this.materialIndex = o) } var t = e.prototype return ( (t.clone = function () { return new this.constructor().copy(this) }), (t.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 r = 0, i = e.vertexColors.length; r < i; r++) this.vertexColors[r] = e.vertexColors[r].clone() return this }), e ) })(), Pi = 0 function Di() { Object.defineProperty(this, 'id', { value: Pi++ }), (this.uuid = Kn.generateUUID()), (this.name = ''), (this.type = 'Material'), (this.fog = !0), (this.blending = w), (this.side = m), (this.flatShading = !1), (this.vertexColors = !1), (this.opacity = 1), (this.transparent = !1), (this.blendSrc = B), (this.blendDst = F), (this.blendEquation = T), (this.blendSrcAlpha = null), (this.blendDstAlpha = null), (this.blendEquationAlpha = null), (this.depthFunc = W), (this.depthTest = !0), (this.depthWrite = !0), (this.stencilWriteMask = 255), (this.stencilFunc = _n), (this.stencilRef = 0), (this.stencilFuncMask = 255), (this.stencilFail = hn), (this.stencilZFail = hn), (this.stencilZPass = hn), (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 Oi(e) { Di.call(this), (this.type = 'MeshBasicMaterial'), (this.color = new Li(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 = Z), (this.reflectivity = 1), (this.refractionRatio = 0.98), (this.wireframe = !1), (this.wireframeLinewidth = 1), (this.wireframeLinecap = 'round'), (this.wireframeLinejoin = 'round'), (this.skinning = !1), (this.morphTargets = !1), this.setValues(e) } ;(Di.prototype = Object.assign(Object.create(qn.prototype), { constructor: Di, isMaterial: !0, onBeforeCompile: function () {}, customProgramCacheKey: function () { return this.onBeforeCompile.toString() }, setValues: function (e) { if (void 0 !== e) for (var t in e) { var n = e[t] if (void 0 !== n) if ('shading' !== t) { var r = this[t] void 0 !== r ? r && r.isColor ? r.set(n) : r && r.isVector3 && n && n.isVector3 ? r.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 = n === y) else console.warn("THREE.Material: '" + t + "' parameter is undefined.") } }, toJSON: function (e) { var t = void 0 === e || 'string' === typeof e t && (e = { textures: {}, images: {} }) var n = { metadata: { version: 4.5, type: 'Material', generator: 'Material.toJSON', }, } function r(e) { var t = [] for (var n in e) { var r = e[n] delete r.metadata, t.push(r) } return t } if ( ((n.uuid = this.uuid), (n.type = this.type), '' !== this.name && (n.name = this.name), this.color && this.color.isColor && (n.color = this.color.getHex()), void 0 !== this.roughness && (n.roughness = this.roughness), void 0 !== this.metalness && (n.metalness = this.metalness), this.sheen && this.sheen.isColor && (n.sheen = this.sheen.getHex()), this.emissive && this.emissive.isColor && (n.emissive = this.emissive.getHex()), this.emissiveIntensity && 1 !== this.emissiveIntensity && (n.emissiveIntensity = this.emissiveIntensity), this.specular && this.specular.isColor && (n.specular = this.specular.getHex()), void 0 !== this.shininess && (n.shininess = this.shininess), void 0 !== this.clearcoat && (n.clearcoat = this.clearcoat), void 0 !== this.clearcoatRoughness && (n.clearcoatRoughness = this.clearcoatRoughness), this.clearcoatMap && this.clearcoatMap.isTexture && (n.clearcoatMap = this.clearcoatMap.toJSON(e).uuid), this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture && (n.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(e).uuid), this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture && ((n.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(e).uuid), (n.clearcoatNormalScale = this.clearcoatNormalScale.toArray())), this.map && this.map.isTexture && (n.map = this.map.toJSON(e).uuid), this.matcap && this.matcap.isTexture && (n.matcap = this.matcap.toJSON(e).uuid), this.alphaMap && this.alphaMap.isTexture && (n.alphaMap = this.alphaMap.toJSON(e).uuid), this.lightMap && this.lightMap.isTexture && (n.lightMap = this.lightMap.toJSON(e).uuid), this.aoMap && this.aoMap.isTexture && ((n.aoMap = this.aoMap.toJSON(e).uuid), (n.aoMapIntensity = this.aoMapIntensity)), this.bumpMap && this.bumpMap.isTexture && ((n.bumpMap = this.bumpMap.toJSON(e).uuid), (n.bumpScale = this.bumpScale)), this.normalMap && this.normalMap.isTexture && ((n.normalMap = this.normalMap.toJSON(e).uuid), (n.normalMapType = this.normalMapType), (n.normalScale = this.normalScale.toArray())), this.displacementMap && this.displacementMap.isTexture && ((n.displacementMap = this.displacementMap.toJSON(e).uuid), (n.displacementScale = this.displacementScale), (n.displacementBias = this.displacementBias)), this.roughnessMap && this.roughnessMap.isTexture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid), this.metalnessMap && this.metalnessMap.isTexture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid), this.emissiveMap && this.emissiveMap.isTexture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid), this.specularMap && this.specularMap.isTexture && (n.specularMap = this.specularMap.toJSON(e).uuid), this.envMap && this.envMap.isTexture && ((n.envMap = this.envMap.toJSON(e).uuid), (n.reflectivity = this.reflectivity), (n.refractionRatio = this.refractionRatio), void 0 !== this.combine && (n.combine = this.combine), void 0 !== this.envMapIntensity && (n.envMapIntensity = this.envMapIntensity)), this.gradientMap && this.gradientMap.isTexture && (n.gradientMap = this.gradientMap.toJSON(e).uuid), void 0 !== this.size && (n.size = this.size), void 0 !== this.sizeAttenuation && (n.sizeAttenuation = this.sizeAttenuation), this.blending !== w && (n.blending = this.blending), !0 === this.flatShading && (n.flatShading = this.flatShading), this.side !== m && (n.side = this.side), this.vertexColors && (n.vertexColors = !0), this.opacity < 1 && (n.opacity = this.opacity), !0 === this.transparent && (n.transparent = this.transparent), (n.depthFunc = this.depthFunc), (n.depthTest = this.depthTest), (n.depthWrite = this.depthWrite), (n.stencilWrite = this.stencilWrite), (n.stencilWriteMask = this.stencilWriteMask), (n.stencilFunc = this.stencilFunc), (n.stencilRef = this.stencilRef), (n.stencilFuncMask = this.stencilFuncMask), (n.stencilFail = this.stencilFail), (n.stencilZFail = this.stencilZFail), (n.stencilZPass = this.stencilZPass), this.rotation && 0 !== this.rotation && (n.rotation = this.rotation), !0 === this.polygonOffset && (n.polygonOffset = !0), 0 !== this.polygonOffsetFactor && (n.polygonOffsetFactor = this.polygonOffsetFactor), 0 !== this.polygonOffsetUnits && (n.polygonOffsetUnits = this.polygonOffsetUnits), this.linewidth && 1 !== this.linewidth && (n.linewidth = this.linewidth), void 0 !== this.dashSize && (n.dashSize = this.dashSize), void 0 !== this.gapSize && (n.gapSize = this.gapSize), void 0 !== this.scale && (n.scale = this.scale), !0 === this.dithering && (n.dithering = !0), this.alphaTest > 0 && (n.alphaTest = this.alphaTest), !0 === this.premultipliedAlpha && (n.premultipliedAlpha = this.premultipliedAlpha), !0 === this.wireframe && (n.wireframe = this.wireframe), this.wireframeLinewidth > 1 && (n.wireframeLinewidth = this.wireframeLinewidth), 'round' !== this.wireframeLinecap && (n.wireframeLinecap = this.wireframeLinecap), 'round' !== this.wireframeLinejoin && (n.wireframeLinejoin = this.wireframeLinejoin), !0 === this.morphTargets && (n.morphTargets = !0), !0 === this.morphNormals && (n.morphNormals = !0), !0 === this.skinning && (n.skinning = !0), !1 === this.visible && (n.visible = !1), !1 === this.toneMapped && (n.toneMapped = !1), '{}' !== JSON.stringify(this.userData) && (n.userData = this.userData), t) ) { var i = r(e.textures), o = r(e.images) i.length > 0 && (n.textures = i), o.length > 0 && (n.images = o) } return n }, 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.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 r = t.length n = new Array(r) for (var i = 0; i !== r; ++i) n[i] = t[i].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(Di.prototype, 'needsUpdate', { set: function (e) { !0 === e && this.version++ }, }), (Oi.prototype = Object.create(Di.prototype)), (Oi.prototype.constructor = Oi), (Oi.prototype.isMeshBasicMaterial = !0), (Oi.prototype.copy = function (e) { return ( Di.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 Ii = new lr(), Bi = new Jn() function Fi(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 = Tn), (this.updateRange = { offset: 0, count: -1 }), (this.version = 0) } function ki(e, t, n) { Fi.call(this, new Int8Array(e), t, n) } function Ni(e, t, n) { Fi.call(this, new Uint8Array(e), t, n) } function Ui(e, t, n) { Fi.call(this, new Uint8ClampedArray(e), t, n) } function Hi(e, t, n) { Fi.call(this, new Int16Array(e), t, n) } function Gi(e, t, n) { Fi.call(this, new Uint16Array(e), t, n) } function zi(e, t, n) { Fi.call(this, new Int32Array(e), t, n) } function ji(e, t, n) { Fi.call(this, new Uint32Array(e), t, n) } function Vi(e, t, n) { Fi.call(this, new Uint16Array(e), t, n) } function Wi(e, t, n) { Fi.call(this, new Float32Array(e), t, n) } function qi(e, t, n) { Fi.call(this, new Float64Array(e), t, n) } function Xi(e) { if (0 === e.length) return -1 / 0 for (var t = e[0], n = 1, r = e.length; n < r; ++n) e[n] > t && (t = e[n]) return t } Object.defineProperty(Fi.prototype, 'needsUpdate', { set: function (e) { !0 === e && this.version++ }, }), Object.assign(Fi.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 r = 0, i = this.itemSize; r < i; r++) this.array[e + r] = t.array[n + r] return this }, copyArray: function (e) { return this.array.set(e), this }, copyColorsArray: function (e) { for (var t = this.array, n = 0, r = 0, i = e.length; r < i; r++) { var o = e[r] void 0 === o && (console.warn( 'THREE.BufferAttribute.copyColorsArray(): color is undefined', r, ), (o = new Li())), (t[n++] = o.r), (t[n++] = o.g), (t[n++] = o.b) } return this }, copyVector2sArray: function (e) { for (var t = this.array, n = 0, r = 0, i = e.length; r < i; r++) { var o = e[r] void 0 === o && (console.warn( 'THREE.BufferAttribute.copyVector2sArray(): vector is undefined', r, ), (o = new Jn())), (t[n++] = o.x), (t[n++] = o.y) } return this }, copyVector3sArray: function (e) { for (var t = this.array, n = 0, r = 0, i = e.length; r < i; r++) { var o = e[r] void 0 === o && (console.warn( 'THREE.BufferAttribute.copyVector3sArray(): vector is undefined', r, ), (o = new lr())), (t[n++] = o.x), (t[n++] = o.y), (t[n++] = o.z) } return this }, copyVector4sArray: function (e) { for (var t = this.array, n = 0, r = 0, i = e.length; r < i; r++) { var o = e[r] void 0 === o && (console.warn( 'THREE.BufferAttribute.copyVector4sArray(): vector is undefined', r, ), (o = new ir())), (t[n++] = o.x), (t[n++] = o.y), (t[n++] = o.z), (t[n++] = o.w) } return this }, applyMatrix3: function (e) { if (2 === this.itemSize) for (var t = 0, n = this.count; t < n; t++) Bi.fromBufferAttribute(this, t), Bi.applyMatrix3(e), this.setXY(t, Bi.x, Bi.y) else if (3 === this.itemSize) for (var r = 0, i = this.count; r < i; r++) Ii.fromBufferAttribute(this, r), Ii.applyMatrix3(e), this.setXYZ(r, Ii.x, Ii.y, Ii.z) return this }, applyMatrix4: function (e) { for (var t = 0, n = this.count; t < n; t++) (Ii.x = this.getX(t)), (Ii.y = this.getY(t)), (Ii.z = this.getZ(t)), Ii.applyMatrix4(e), this.setXYZ(t, Ii.x, Ii.y, Ii.z) return this }, applyNormalMatrix: function (e) { for (var t = 0, n = this.count; t < n; t++) (Ii.x = this.getX(t)), (Ii.y = this.getY(t)), (Ii.z = this.getZ(t)), Ii.applyNormalMatrix(e), this.setXYZ(t, Ii.x, Ii.y, Ii.z) return this }, transformDirection: function (e) { for (var t = 0, n = this.count; t < n; t++) (Ii.x = this.getX(t)), (Ii.y = this.getY(t)), (Ii.z = this.getZ(t)), Ii.transformDirection(e), this.setXYZ(t, Ii.x, Ii.y, Ii.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, r) { return ( (e *= this.itemSize), (this.array[e + 0] = t), (this.array[e + 1] = n), (this.array[e + 2] = r), this ) }, setXYZW: function (e, t, n, r, i) { return ( (e *= this.itemSize), (this.array[e + 0] = t), (this.array[e + 1] = n), (this.array[e + 2] = r), (this.array[e + 3] = i), 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, } }, }), (ki.prototype = Object.create(Fi.prototype)), (ki.prototype.constructor = ki), (Ni.prototype = Object.create(Fi.prototype)), (Ni.prototype.constructor = Ni), (Ui.prototype = Object.create(Fi.prototype)), (Ui.prototype.constructor = Ui), (Hi.prototype = Object.create(Fi.prototype)), (Hi.prototype.constructor = Hi), (Gi.prototype = Object.create(Fi.prototype)), (Gi.prototype.constructor = Gi), (zi.prototype = Object.create(Fi.prototype)), (zi.prototype.constructor = zi), (ji.prototype = Object.create(Fi.prototype)), (ji.prototype.constructor = ji), (Vi.prototype = Object.create(Fi.prototype)), (Vi.prototype.constructor = Vi), (Vi.prototype.isFloat16BufferAttribute = !0), (Wi.prototype = Object.create(Fi.prototype)), (Wi.prototype.constructor = Wi), (qi.prototype = Object.create(Fi.prototype)), (qi.prototype.constructor = qi) var Yi = { Int8Array: Int8Array, Uint8Array: Uint8Array, Uint8ClampedArray: 'undefined' !== typeof Uint8ClampedArray ? Uint8ClampedArray : Uint8Array, Int16Array: Int16Array, Uint16Array: Uint16Array, Int32Array: Int32Array, Uint32Array: Uint32Array, Float32Array: Float32Array, Float64Array: Float64Array, } function Qi(e, t) { return new Yi[e](t) } var Zi = 0, Ki = new Fr(), Ji = new si(), $i = new lr(), eo = new hr(), to = new hr(), no = new lr() function ro() { Object.defineProperty(this, 'id', { value: Zi++ }), (this.uuid = Kn.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 = {}) } ro.prototype = Object.assign(Object.create(qn.prototype), { constructor: ro, isBufferGeometry: !0, getIndex: function () { return this.index }, setIndex: function (e) { return ( Array.isArray(e) ? (this.index = new (Xi(e) > 65535 ? ji : Gi)(e, 1)) : (this.index = e), this ) }, 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 }, hasAttribute: function (e) { return void 0 !== this.attributes[e] }, addGroup: function (e, t, n) { void 0 === n && (n = 0), this.groups.push({ start: e, count: t, materialIndex: n }) }, 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 $n().getNormalMatrix(e) n.applyNormalMatrix(r), (n.needsUpdate = !0) } var i = this.attributes.tangent return ( void 0 !== i && (i.transformDirection(e), (i.needsUpdate = !0)), null !== this.boundingBox && this.computeBoundingBox(), null !== this.boundingSphere && this.computeBoundingSphere(), this ) }, rotateX: function (e) { return Ki.makeRotationX(e), this.applyMatrix4(Ki), this }, rotateY: function (e) { return Ki.makeRotationY(e), this.applyMatrix4(Ki), this }, rotateZ: function (e) { return Ki.makeRotationZ(e), this.applyMatrix4(Ki), this }, translate: function (e, t, n) { return Ki.makeTranslation(e, t, n), this.applyMatrix4(Ki), this }, scale: function (e, t, n) { return Ki.makeScale(e, t, n), this.applyMatrix4(Ki), this }, lookAt: function (e) { return Ji.lookAt(e), Ji.updateMatrix(), this.applyMatrix4(Ji.matrix), this }, center: function () { return ( this.computeBoundingBox(), this.boundingBox.getCenter($i).negate(), this.translate($i.x, $i.y, $i.z), this ) }, setFromPoints: function (e) { for (var t = [], n = 0, r = e.length; n < r; n++) { var i = e[n] t.push(i.x, i.y, i.z || 0) } return this.setAttribute('position', new Wi(t, 3)), this }, computeBoundingBox: function () { null === this.boundingBox && (this.boundingBox = new hr()) var e = this.attributes.position, t = this.morphAttributes.position if (e && e.isGLBufferAttribute) return ( console.error( 'THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".', this, ), void this.boundingBox.set( new lr(-1 / 0, -1 / 0, -1 / 0), new lr(1 / 0, 1 / 0, 1 / 0), ) ) if (void 0 !== e) { if ((this.boundingBox.setFromBufferAttribute(e), t)) for (var n = 0, r = t.length; n < r; n++) { var i = t[n] eo.setFromBufferAttribute(i), this.morphTargetsRelative ? (no.addVectors(this.boundingBox.min, eo.min), this.boundingBox.expandByPoint(no), no.addVectors(this.boundingBox.max, eo.max), this.boundingBox.expandByPoint(no)) : (this.boundingBox.expandByPoint(eo.min), this.boundingBox.expandByPoint(eo.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 Sr()) var e = this.attributes.position, t = this.morphAttributes.position if (e && e.isGLBufferAttribute) return ( console.error( 'THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".', this, ), void this.boundingSphere.set(new lr(), 1 / 0) ) if (e) { var n = this.boundingSphere.center if ((eo.setFromBufferAttribute(e), t)) for (var r = 0, i = t.length; r < i; r++) { var o = t[r] to.setFromBufferAttribute(o), this.morphTargetsRelative ? (no.addVectors(eo.min, to.min), eo.expandByPoint(no), no.addVectors(eo.max, to.max), eo.expandByPoint(no)) : (eo.expandByPoint(to.min), eo.expandByPoint(to.max)) } eo.getCenter(n) for (var a = 0, s = 0, l = e.count; s < l; s++) no.fromBufferAttribute(e, s), (a = Math.max(a, n.distanceToSquared(no))) if (t) for (var c = 0, u = t.length; c < u; c++) for ( var h = t[c], d = this.morphTargetsRelative, p = 0, f = h.count; p < f; p++ ) no.fromBufferAttribute(h, p), d && ($i.fromBufferAttribute(e, p), no.add($i)), (a = Math.max(a, n.distanceToSquared(no))) ;(this.boundingSphere.radius = Math.sqrt(a)), 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 () {}, computeTangents: function () { var e = this.index, t = this.attributes if ( null !== e && void 0 !== t.position && void 0 !== t.normal && void 0 !== t.uv ) { var n = e.array, r = t.position.array, i = t.normal.array, o = t.uv.array, a = r.length / 3 void 0 === t.tangent && this.setAttribute('tangent', new Fi(new Float32Array(4 * a), 4)) for (var s = t.tangent.array, l = [], c = [], u = 0; u < a; u++) (l[u] = new lr()), (c[u] = new lr()) var h = new lr(), d = new lr(), p = new lr(), f = new Jn(), m = new Jn(), v = new Jn(), g = new lr(), y = new lr(), b = this.groups 0 === b.length && (b = [{ start: 0, count: n.length }]) for (var A = 0, w = b.length; A < w; ++A) for (var x = b[A], E = x.start, M = E, _ = E + x.count; M < _; M += 3) F(n[M + 0], n[M + 1], n[M + 2]) for ( var T = new lr(), S = new lr(), C = new lr(), L = new lr(), R = 0, P = b.length; R < P; ++R ) for (var D = b[R], O = D.start, I = O, B = O + D.count; I < B; I += 3) k(n[I + 0]), k(n[I + 1]), k(n[I + 2]) } else console.error( 'THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)', ) function F(e, t, n) { h.fromArray(r, 3 * e), d.fromArray(r, 3 * t), p.fromArray(r, 3 * n), f.fromArray(o, 2 * e), m.fromArray(o, 2 * t), v.fromArray(o, 2 * n), d.sub(h), p.sub(h), m.sub(f), v.sub(f) var i = 1 / (m.x * v.y - v.x * m.y) isFinite(i) && (g .copy(d) .multiplyScalar(v.y) .addScaledVector(p, -m.y) .multiplyScalar(i), y .copy(p) .multiplyScalar(m.x) .addScaledVector(d, -v.x) .multiplyScalar(i), l[e].add(g), l[t].add(g), l[n].add(g), c[e].add(y), c[t].add(y), c[n].add(y)) } function k(e) { C.fromArray(i, 3 * e), L.copy(C) var t = l[e] T.copy(t), T.sub(C.multiplyScalar(C.dot(t))).normalize(), S.crossVectors(L, t) var n = S.dot(c[e]) < 0 ? -1 : 1 ;(s[4 * e] = T.x), (s[4 * e + 1] = T.y), (s[4 * e + 2] = T.z), (s[4 * e + 3] = n) } }, computeVertexNormals: function () { var e = this.index, t = this.getAttribute('position') if (void 0 !== t) { var n = this.getAttribute('normal') if (void 0 === n) (n = new Fi(new Float32Array(3 * t.count), 3)), this.setAttribute('normal', n) else for (var r = 0, i = n.count; r < i; r++) n.setXYZ(r, 0, 0, 0) var o = new lr(), a = new lr(), s = new lr(), l = new lr(), c = new lr(), u = new lr(), h = new lr(), d = new lr() if (e) for (var p = 0, f = e.count; p < f; p += 3) { var m = e.getX(p + 0), v = e.getX(p + 1), g = e.getX(p + 2) o.fromBufferAttribute(t, m), a.fromBufferAttribute(t, v), s.fromBufferAttribute(t, g), h.subVectors(s, a), d.subVectors(o, a), h.cross(d), l.fromBufferAttribute(n, m), c.fromBufferAttribute(n, v), u.fromBufferAttribute(n, g), l.add(h), c.add(h), u.add(h), n.setXYZ(m, l.x, l.y, l.z), n.setXYZ(v, c.x, c.y, c.z), n.setXYZ(g, u.x, u.y, u.z) } else for (var y = 0, b = t.count; y < b; y += 3) o.fromBufferAttribute(t, y + 0), a.fromBufferAttribute(t, y + 1), s.fromBufferAttribute(t, y + 2), h.subVectors(s, a), d.subVectors(o, a), h.cross(d), n.setXYZ(y + 0, h.x, h.y, h.z), n.setXYZ(y + 1, h.x, h.y, h.z), n.setXYZ(y + 2, h.x, h.y, h.z) this.normalizeNormals(), (n.needsUpdate = !0) } }, merge: function (e, t) { if (e && e.isBufferGeometry) { 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 r in n) if (void 0 !== e.attributes[r]) for ( var i = n[r].array, o = e.attributes[r], a = o.array, s = o.itemSize * t, l = Math.min(a.length, i.length - s), c = 0, u = s; c < l; c++, u++ ) i[u] = a[c] return this } console.error( 'THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.', e, ) }, normalizeNormals: function () { for (var e = this.attributes.normal, t = 0, n = e.count; t < n; t++) no.fromBufferAttribute(e, t), no.normalize(), e.setXYZ(t, no.x, no.y, no.z) }, toNonIndexed: function () { function e(e, t) { for ( var n = e.array, r = e.itemSize, i = e.normalized, o = new n.constructor(t.length * r), a = 0, s = 0, l = 0, c = t.length; l < c; l++ ) { a = t[l] * r for (var u = 0; u < r; u++) o[s++] = n[a++] } return new Fi(o, r, i) } if (null === this.index) return ( console.warn( 'THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.', ), this ) var t = new ro(), n = this.index.array, r = this.attributes for (var i in r) { var o = e(r[i], n) t.setAttribute(i, o) } var a = this.morphAttributes for (var s in a) { for (var l = [], c = a[s], u = 0, h = c.length; u < h; u++) { var d = e(c[u], n) l.push(d) } t.morphAttributes[s] = l } t.morphTargetsRelative = this.morphTargetsRelative for (var p = this.groups, f = 0, m = p.length; f < m; f++) { var v = p[f] t.addGroup(v.start, v.count, v.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 r = this.index null !== r && (e.data.index = { type: r.array.constructor.name, array: Array.prototype.slice.call(r.array), }) var i = this.attributes for (var o in i) { var a = i[o], s = a.toJSON(e.data) '' !== a.name && (s.name = a.name), (e.data.attributes[o] = s) } var l = {}, c = !1 for (var u in this.morphAttributes) { for ( var h = this.morphAttributes[u], d = [], p = 0, f = h.length; p < f; p++ ) { var m = h[p], v = m.toJSON(e.data) '' !== m.name && (v.name = m.name), d.push(v) } d.length > 0 && ((l[u] = d), (c = !0)) } c && ((e.data.morphAttributes = l), (e.data.morphTargetsRelative = this.morphTargetsRelative)) var g = this.groups g.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(g))) var y = this.boundingSphere return ( null !== y && (e.data.boundingSphere = { center: y.center.toArray(), radius: y.radius, }), e ) }, clone: function () { return new ro().copy(this) }, copy: function (e) { ;(this.index = null), (this.attributes = {}), (this.morphAttributes = {}), (this.groups = []), (this.boundingBox = null), (this.boundingSphere = null) var t = {} this.name = e.name var n = e.index null !== n && this.setIndex(n.clone(t)) var r = e.attributes for (var i in r) { var o = r[i] this.setAttribute(i, o.clone(t)) } var a = e.morphAttributes for (var s in a) { for (var l = [], c = a[s], u = 0, h = c.length; u < h; u++) l.push(c[u].clone(t)) this.morphAttributes[s] = l } this.morphTargetsRelative = e.morphTargetsRelative for (var d = e.groups, p = 0, f = d.length; p < f; p++) { var m = d[p] this.addGroup(m.start, m.count, m.materialIndex) } var v = e.boundingBox null !== v && (this.boundingBox = v.clone()) var g = e.boundingSphere return ( null !== g && (this.boundingSphere = g.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 io = new Fr(), oo = new Br(), ao = new Sr(), so = new lr(), lo = new lr(), co = new lr(), uo = new lr(), ho = new lr(), po = new lr(), fo = new lr(), mo = new lr(), vo = new lr(), go = new Jn(), yo = new Jn(), bo = new Jn(), Ao = new lr(), wo = new lr() function xo(e, t) { void 0 === e && (e = new ro()), void 0 === t && (t = new Oi()), si.call(this), (this.type = 'Mesh'), (this.geometry = e), (this.material = t), this.updateMorphTargets() } function Eo(e, t, n, r, i, o, a, s) { if ( null === (t.side === v ? r.intersectTriangle(a, o, i, !0, s) : r.intersectTriangle(i, o, a, t.side !== g, s)) ) return null wo.copy(s), wo.applyMatrix4(e.matrixWorld) var l = n.ray.origin.distanceTo(wo) return l < n.near || l > n.far ? null : { distance: l, point: wo.clone(), object: e } } function Mo(e, t, n, r, i, o, a, s, l, c, u, h) { so.fromBufferAttribute(i, c), lo.fromBufferAttribute(i, u), co.fromBufferAttribute(i, h) var d = e.morphTargetInfluences if (t.morphTargets && o && d) { fo.set(0, 0, 0), mo.set(0, 0, 0), vo.set(0, 0, 0) for (var p = 0, f = o.length; p < f; p++) { var m = d[p], v = o[p] 0 !== m && (uo.fromBufferAttribute(v, c), ho.fromBufferAttribute(v, u), po.fromBufferAttribute(v, h), a ? (fo.addScaledVector(uo, m), mo.addScaledVector(ho, m), vo.addScaledVector(po, m)) : (fo.addScaledVector(uo.sub(so), m), mo.addScaledVector(ho.sub(lo), m), vo.addScaledVector(po.sub(co), m))) } so.add(fo), lo.add(mo), co.add(vo) } e.isSkinnedMesh && (e.boneTransform(c, so), e.boneTransform(u, lo), e.boneTransform(h, co)) var g = Eo(e, t, n, r, so, lo, co, Ao) if (g) { s && (go.fromBufferAttribute(s, c), yo.fromBufferAttribute(s, u), bo.fromBufferAttribute(s, h), (g.uv = xi.getUV(Ao, so, lo, co, go, yo, bo, new Jn()))), l && (go.fromBufferAttribute(l, c), yo.fromBufferAttribute(l, u), bo.fromBufferAttribute(l, h), (g.uv2 = xi.getUV(Ao, so, lo, co, go, yo, bo, new Jn()))) var y = new Ri(c, u, h) xi.getNormal(so, lo, co, y.normal), (g.face = y) } return g } xo.prototype = Object.assign(Object.create(si.prototype), { constructor: xo, isMesh: !0, copy: function (e) { return ( si.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.material = e.material), (this.geometry = e.geometry), this ) }, updateMorphTargets: function () { var e = this.geometry if (e.isBufferGeometry) { var t = e.morphAttributes, n = Object.keys(t) if (n.length > 0) { var r = t[n[0]] if (void 0 !== r) { ;(this.morphTargetInfluences = []), (this.morphTargetDictionary = {}) for (var i = 0, o = r.length; i < o; i++) { var a = r[i].name || String(i) this.morphTargetInfluences.push(0), (this.morphTargetDictionary[a] = i) } } } } else { var s = e.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 n, r = this.geometry, i = this.material, o = this.matrixWorld if ( void 0 !== i && (null === r.boundingSphere && r.computeBoundingSphere(), ao.copy(r.boundingSphere), ao.applyMatrix4(o), !1 !== e.ray.intersectsSphere(ao) && (io.copy(o).invert(), oo.copy(e.ray).applyMatrix4(io), null === r.boundingBox || !1 !== oo.intersectsBox(r.boundingBox))) ) if (r.isBufferGeometry) { var a = r.index, s = r.attributes.position, l = r.morphAttributes.position, c = r.morphTargetsRelative, u = r.attributes.uv, h = r.attributes.uv2, d = r.groups, p = r.drawRange if (null !== a) if (Array.isArray(i)) for (var f = 0, m = d.length; f < m; f++) for ( var v = d[f], g = i[v.materialIndex], y = Math.max(v.start, p.start), b = Math.min(v.start + v.count, p.start + p.count); y < b; y += 3 ) { var A = a.getX(y), w = a.getX(y + 1), x = a.getX(y + 2) ;(n = Mo(this, g, e, oo, s, l, c, u, h, A, w, x)) && ((n.faceIndex = Math.floor(y / 3)), (n.face.materialIndex = v.materialIndex), t.push(n)) } else for ( var E = Math.max(0, p.start), M = Math.min(a.count, p.start + p.count); E < M; E += 3 ) { var _ = a.getX(E), T = a.getX(E + 1), S = a.getX(E + 2) ;(n = Mo(this, i, e, oo, s, l, c, u, h, _, T, S)) && ((n.faceIndex = Math.floor(E / 3)), t.push(n)) } else if (void 0 !== s) if (Array.isArray(i)) for (var C = 0, L = d.length; C < L; C++) for ( var R = d[C], P = i[R.materialIndex], D = Math.max(R.start, p.start), O = Math.min(R.start + R.count, p.start + p.count); D < O; D += 3 ) (n = Mo(this, P, e, oo, s, l, c, u, h, D, D + 1, D + 2)) && ((n.faceIndex = Math.floor(D / 3)), (n.face.materialIndex = R.materialIndex), t.push(n)) else for ( var I = Math.max(0, p.start), B = Math.min(s.count, p.start + p.count); I < B; I += 3 ) (n = Mo(this, i, e, oo, s, l, c, u, h, I, I + 1, I + 2)) && ((n.faceIndex = Math.floor(I / 3)), t.push(n)) } else r.isGeometry && console.error( 'THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.', ) }, }) var _o = (function (e) { function t(t, n, r, i, o, a) { var s void 0 === t && (t = 1), void 0 === n && (n = 1), void 0 === r && (r = 1), void 0 === i && (i = 1), void 0 === o && (o = 1), void 0 === a && (a = 1), ((s = e.call(this) || this).type = 'BoxGeometry'), (s.parameters = { width: t, height: n, depth: r, widthSegments: i, heightSegments: o, depthSegments: a, }) var l = zn(s) ;(i = Math.floor(i)), (o = Math.floor(o)), (a = Math.floor(a)) var c = [], u = [], h = [], d = [], p = 0, f = 0 function m(e, t, n, r, i, o, a, s, m, v, g) { for ( var y = o / m, b = a / v, A = o / 2, w = a / 2, x = s / 2, E = m + 1, M = v + 1, _ = 0, T = 0, S = new lr(), C = 0; C < M; C++ ) for (var L = C * b - w, R = 0; R < E; R++) { var P = R * y - A ;(S[e] = P * r), (S[t] = L * i), (S[n] = x), u.push(S.x, S.y, S.z), (S[e] = 0), (S[t] = 0), (S[n] = s > 0 ? 1 : -1), h.push(S.x, S.y, S.z), d.push(R / m), d.push(1 - C / v), (_ += 1) } for (var D = 0; D < v; D++) for (var O = 0; O < m; O++) { var I = p + O + E * D, B = p + O + E * (D + 1), F = p + (O + 1) + E * (D + 1), k = p + (O + 1) + E * D c.push(I, B, k), c.push(B, F, k), (T += 6) } l.addGroup(f, T, g), (f += T), (p += _) } return ( m('z', 'y', 'x', -1, -1, r, n, t, a, o, 0), m('z', 'y', 'x', 1, -1, r, n, -t, a, o, 1), m('x', 'z', 'y', 1, 1, t, r, n, i, a, 2), m('x', 'z', 'y', 1, -1, t, r, -n, i, a, 3), m('x', 'y', 'z', 1, -1, t, n, r, i, o, 4), m('x', 'y', 'z', -1, -1, t, n, -r, i, o, 5), s.setIndex(c), s.setAttribute('position', new Wi(u, 3)), s.setAttribute('normal', new Wi(h, 3)), s.setAttribute('uv', new Wi(d, 2)), s ) } return Gn(t, e), t })(ro) function To(e) { var t = {} for (var n in e) for (var r in ((t[n] = {}), e[n])) { var i = e[n][r] i && (i.isColor || i.isMatrix3 || i.isMatrix4 || i.isVector2 || i.isVector3 || i.isVector4 || i.isTexture) ? (t[n][r] = i.clone()) : Array.isArray(i) ? (t[n][r] = i.slice()) : (t[n][r] = i) } return t } function So(e) { for (var t = {}, n = 0; n < e.length; n++) { var r = To(e[n]) for (var i in r) t[i] = r[i] } return t } var Co = { clone: To, merge: So }, Lo = 'void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}', Ro = 'void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}' function Po(e) { Di.call(this), (this.type = 'ShaderMaterial'), (this.defines = {}), (this.uniforms = {}), (this.vertexShader = Lo), (this.fragmentShader = Ro), (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), (this.glslVersion = null), void 0 !== e && (void 0 !== e.attributes && console.error( 'THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead.', ), this.setValues(e)) } function Do() { si.call(this), (this.type = 'Camera'), (this.matrixWorldInverse = new Fr()), (this.projectionMatrix = new Fr()), (this.projectionMatrixInverse = new Fr()) } function Oo(e, t, n, r) { void 0 === e && (e = 50), void 0 === t && (t = 1), void 0 === n && (n = 0.1), void 0 === r && (r = 2e3), Do.call(this), (this.type = 'PerspectiveCamera'), (this.fov = e), (this.zoom = 1), (this.near = n), (this.far = r), (this.focus = 10), (this.aspect = t), (this.view = null), (this.filmGauge = 35), (this.filmOffset = 0), this.updateProjectionMatrix() } ;(Po.prototype = Object.create(Di.prototype)), (Po.prototype.constructor = Po), (Po.prototype.isShaderMaterial = !0), (Po.prototype.copy = function (e) { return ( Di.prototype.copy.call(this, e), (this.fragmentShader = e.fragmentShader), (this.vertexShader = e.vertexShader), (this.uniforms = To(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 = Object.assign({}, e.extensions)), (this.glslVersion = e.glslVersion), this ) }), (Po.prototype.toJSON = function (e) { var t = Di.prototype.toJSON.call(this, e) for (var n in ((t.glslVersion = this.glslVersion), (t.uniforms = {}), this.uniforms)) { var r = this.uniforms[n].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 i = {} for (var o in this.extensions) !0 === this.extensions[o] && (i[o] = !0) return Object.keys(i).length > 0 && (t.extensions = i), t }), (Do.prototype = Object.assign(Object.create(si.prototype), { constructor: Do, isCamera: !0, copy: function (e, t) { return ( si.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 lr())), this.updateWorldMatrix(!0, !1) var t = this.matrixWorld.elements return e.set(-t[8], -t[9], -t[10]).normalize() }, updateMatrixWorld: function (e) { si.prototype.updateMatrixWorld.call(this, e), this.matrixWorldInverse.copy(this.matrixWorld).invert() }, updateWorldMatrix: function (e, t) { si.prototype.updateWorldMatrix.call(this, e, t), this.matrixWorldInverse.copy(this.matrixWorld).invert() }, clone: function () { return new this.constructor().copy(this) }, })), (Oo.prototype = Object.assign(Object.create(Do.prototype), { constructor: Oo, isPerspectiveCamera: !0, copy: function (e, t) { return ( Do.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 = (0.5 * this.getFilmHeight()) / e ;(this.fov = 2 * Kn.RAD2DEG * Math.atan(t)), this.updateProjectionMatrix() }, getFocalLength: function () { var e = Math.tan(0.5 * Kn.DEG2RAD * this.fov) return (0.5 * this.getFilmHeight()) / e }, getEffectiveFOV: function () { return ( 2 * Kn.RAD2DEG * Math.atan(Math.tan(0.5 * Kn.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, r, i, o) { ;(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 = r), (this.view.width = i), (this.view.height = o), this.updateProjectionMatrix() }, clearViewOffset: function () { null !== this.view && (this.view.enabled = !1), this.updateProjectionMatrix() }, updateProjectionMatrix: function () { var e = this.near, t = (e * Math.tan(0.5 * Kn.DEG2RAD * this.fov)) / this.zoom, n = 2 * t, r = this.aspect * n, i = -0.5 * r, o = this.view if (null !== this.view && this.view.enabled) { var a = o.fullWidth, s = o.fullHeight ;(i += (o.offsetX * r) / a), (t -= (o.offsetY * n) / s), (r *= o.width / a), (n *= o.height / s) } var l = this.filmOffset 0 !== l && (i += (e * l) / this.getFilmWidth()), this.projectionMatrix.makePerspective(i, i + r, t, t - n, e, this.far), this.projectionMatrixInverse.copy(this.projectionMatrix).invert() }, toJSON: function (e) { var t = si.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 Io = 90, Bo = 1 function Fo(e, t, n) { if ( (si.call(this), (this.type = 'CubeCamera'), !0 === n.isWebGLCubeRenderTarget) ) { this.renderTarget = n var r = new Oo(Io, Bo, e, t) ;(r.layers = this.layers), r.up.set(0, -1, 0), r.lookAt(new lr(1, 0, 0)), this.add(r) var i = new Oo(Io, Bo, e, t) ;(i.layers = this.layers), i.up.set(0, -1, 0), i.lookAt(new lr(-1, 0, 0)), this.add(i) var o = new Oo(Io, Bo, e, t) ;(o.layers = this.layers), o.up.set(0, 0, 1), o.lookAt(new lr(0, 1, 0)), this.add(o) var a = new Oo(Io, Bo, e, t) ;(a.layers = this.layers), a.up.set(0, 0, -1), a.lookAt(new lr(0, -1, 0)), this.add(a) var s = new Oo(Io, Bo, e, t) ;(s.layers = this.layers), s.up.set(0, -1, 0), s.lookAt(new lr(0, 0, 1)), this.add(s) var l = new Oo(Io, Bo, e, t) ;(l.layers = this.layers), l.up.set(0, -1, 0), l.lookAt(new lr(0, 0, -1)), this.add(l), (this.update = function (e, t) { null === this.parent && this.updateMatrixWorld() var c = e.xr.enabled, u = e.getRenderTarget() e.xr.enabled = !1 var h = n.texture.generateMipmaps ;(n.texture.generateMipmaps = !1), e.setRenderTarget(n, 0), e.render(t, r), e.setRenderTarget(n, 1), e.render(t, i), e.setRenderTarget(n, 2), e.render(t, o), e.setRenderTarget(n, 3), e.render(t, a), e.setRenderTarget(n, 4), e.render(t, s), (n.texture.generateMipmaps = h), e.setRenderTarget(n, 5), e.render(t, l), e.setRenderTarget(u), (e.xr.enabled = c) }) } else console.error( 'THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.', ) } function ko(e, t, n, r, i, o, a, s, l, c) { ;(e = void 0 !== e ? e : []), (t = void 0 !== t ? t : ae), (a = void 0 !== a ? a : Ne), nr.call(this, e, t, n, r, i, o, a, s, l, c), (this.flipY = !1), (this._needsFlipEnvMap = !0) } ;(Fo.prototype = Object.create(si.prototype)), (Fo.prototype.constructor = Fo), (ko.prototype = Object.create(nr.prototype)), (ko.prototype.constructor = ko), (ko.prototype.isCubeTexture = !0), Object.defineProperty(ko.prototype, 'images', { get: function () { return this.image }, set: function (e) { this.image = e }, }) var No = (function (e) { function t(t, n, r) { var i return ( Number.isInteger(n) && (console.warn( 'THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )', ), (n = r)), (i = e.call(this, t, t, n) || this), Object.defineProperty(zn(i), 'isWebGLCubeRenderTarget', { value: !0 }), (n = n || {}), (i.texture = new ko( void 0, n.mapping, n.wrapS, n.wrapT, n.magFilter, n.minFilter, n.format, n.type, n.anisotropy, n.encoding, )), (i.texture._needsFlipEnvMap = !1), i ) } Gn(t, e) var n = t.prototype return ( (n.fromEquirectangularTexture = function (e, t) { ;(this.texture.type = t.type), (this.texture.format = Ue), (this.texture.encoding = t.encoding), (this.texture.generateMipmaps = t.generateMipmaps), (this.texture.minFilter = t.minFilter), (this.texture.magFilter = t.magFilter) var n = { uniforms: { tEquirect: { value: null } }, vertexShader: '\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t', fragmentShader: '\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t', }, r = new _o(5, 5, 5), i = new Po({ name: 'CubemapFromEquirect', uniforms: To(n.uniforms), vertexShader: n.vertexShader, fragmentShader: n.fragmentShader, side: v, blending: A, }) i.uniforms.tEquirect.value = t var o = new xo(r, i), a = t.minFilter return ( t.minFilter === Ee && (t.minFilter = Ae), new Fo(1, 10, this).update(e, o), (t.minFilter = a), o.geometry.dispose(), o.material.dispose(), this ) }), (n.clear = function (e, t, n, r) { for (var i = e.getRenderTarget(), o = 0; o < 6; o++) e.setRenderTarget(this, o), e.clear(t, n, r) e.setRenderTarget(i) }), t ) })(or) function Uo(e, t, n, r, i, o, a, s, l, c, u, h) { nr.call(this, null, o, a, s, l, c, r, i, u, h), (this.image = { data: e || null, width: t || 1, height: n || 1 }), (this.magFilter = void 0 !== l ? l : me), (this.minFilter = void 0 !== c ? c : me), (this.generateMipmaps = !1), (this.flipY = !1), (this.unpackAlignment = 1), (this.needsUpdate = !0) } ;(Uo.prototype = Object.create(nr.prototype)), (Uo.prototype.constructor = Uo), (Uo.prototype.isDataTexture = !0) var Ho = new Sr(), Go = new lr(), zo = (function () { function e(e, t, n, r, i, o) { this.planes = [ void 0 !== e ? e : new hi(), void 0 !== t ? t : new hi(), void 0 !== n ? n : new hi(), void 0 !== r ? r : new hi(), void 0 !== i ? i : new hi(), void 0 !== o ? o : new hi(), ] } var t = e.prototype return ( (t.set = function (e, t, n, r, i, o) { var a = this.planes return ( a[0].copy(e), a[1].copy(t), a[2].copy(n), a[3].copy(r), a[4].copy(i), a[5].copy(o), this ) }), (t.clone = function () { return new this.constructor().copy(this) }), (t.copy = function (e) { for (var t = this.planes, n = 0; n < 6; n++) t[n].copy(e.planes[n]) return this }), (t.setFromProjectionMatrix = function (e) { var t = this.planes, n = e.elements, r = n[0], i = n[1], o = n[2], a = n[3], s = n[4], l = n[5], c = n[6], u = n[7], h = n[8], d = n[9], p = n[10], f = n[11], m = n[12], v = n[13], g = n[14], y = n[15] return ( t[0].setComponents(a - r, u - s, f - h, y - m).normalize(), t[1].setComponents(a + r, u + s, f + h, y + m).normalize(), t[2].setComponents(a + i, u + l, f + d, y + v).normalize(), t[3].setComponents(a - i, u - l, f - d, y - v).normalize(), t[4].setComponents(a - o, u - c, f - p, y - g).normalize(), t[5].setComponents(a + o, u + c, f + p, y + g).normalize(), this ) }), (t.intersectsObject = function (e) { var t = e.geometry return ( null === t.boundingSphere && t.computeBoundingSphere(), Ho.copy(t.boundingSphere).applyMatrix4(e.matrixWorld), this.intersectsSphere(Ho) ) }), (t.intersectsSprite = function (e) { return ( Ho.center.set(0, 0, 0), (Ho.radius = 0.7071067811865476), Ho.applyMatrix4(e.matrixWorld), this.intersectsSphere(Ho) ) }), (t.intersectsSphere = function (e) { for ( var t = this.planes, n = e.center, r = -e.radius, i = 0; i < 6; i++ ) if (t[i].distanceToPoint(n) < r) return !1 return !0 }), (t.intersectsBox = function (e) { for (var t = this.planes, n = 0; n < 6; n++) { var r = t[n] if ( ((Go.x = r.normal.x > 0 ? e.max.x : e.min.x), (Go.y = r.normal.y > 0 ? e.max.y : e.min.y), (Go.z = r.normal.z > 0 ? e.max.z : e.min.z), r.distanceToPoint(Go) < 0) ) return !1 } return !0 }), (t.containsPoint = function (e) { for (var t = this.planes, n = 0; n < 6; n++) if (t[n].distanceToPoint(e) < 0) return !1 return !0 }), e ) })() function jo() { var e = null, t = !1, n = null, r = null function i(t, o) { n(t, o), (r = e.requestAnimationFrame(i)) } return { start: function () { !0 !== t && null !== n && ((r = e.requestAnimationFrame(i)), (t = !0)) }, stop: function () { e.cancelAnimationFrame(r), (t = !1) }, setAnimationLoop: function (e) { n = e }, setContext: function (t) { e = t }, } } function Vo(e, t) { var n = t.isWebGL2, r = new WeakMap() function i(t, r) { var i = t.array, o = t.usage, a = e.createBuffer() e.bindBuffer(r, a), e.bufferData(r, i, o), t.onUploadCallback() var s = 5126 return ( i instanceof Float32Array ? (s = 5126) : i instanceof Float64Array ? console.warn( 'THREE.WebGLAttributes: Unsupported data buffer format: Float64Array.', ) : i instanceof Uint16Array ? t.isFloat16BufferAttribute ? n ? (s = 5131) : console.warn( 'THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.', ) : (s = 5123) : i instanceof Int16Array ? (s = 5122) : i instanceof Uint32Array ? (s = 5125) : i instanceof Int32Array ? (s = 5124) : i instanceof Int8Array ? (s = 5120) : i instanceof Uint8Array && (s = 5121), { buffer: a, type: s, bytesPerElement: i.BYTES_PER_ELEMENT, version: t.version, } ) } function o(t, r, i) { var o = r.array, a = r.updateRange e.bindBuffer(i, t), -1 === a.count ? e.bufferSubData(i, 0, o) : (n ? e.bufferSubData( i, a.offset * o.BYTES_PER_ELEMENT, o, a.offset, a.count, ) : e.bufferSubData( i, a.offset * o.BYTES_PER_ELEMENT, o.subarray(a.offset, a.offset + a.count), ), (a.count = -1)) } function a(e) { return e.isInterleavedBufferAttribute && (e = e.data), r.get(e) } function s(t) { t.isInterleavedBufferAttribute && (t = t.data) var n = r.get(t) n && (e.deleteBuffer(n.buffer), r.delete(t)) } function l(e, t) { if (e.isGLBufferAttribute) { var n = r.get(e) ;(!n || n.version < e.version) && r.set(e, { buffer: e.buffer, type: e.type, bytesPerElement: e.elementSize, version: e.version, }) } else { e.isInterleavedBufferAttribute && (e = e.data) var a = r.get(e) void 0 === a ? r.set(e, i(e, t)) : a.version < e.version && (o(a.buffer, e, t), (a.version = e.version)) } } return { get: a, remove: s, update: l } } var Wo = (function (e) { function t(t, n, r, i) { var o void 0 === t && (t = 1), void 0 === n && (n = 1), void 0 === r && (r = 1), void 0 === i && (i = 1), ((o = e.call(this) || this).type = 'PlaneGeometry'), (o.parameters = { width: t, height: n, widthSegments: r, heightSegments: i, }) for ( var a = t / 2, s = n / 2, l = Math.floor(r), c = Math.floor(i), u = l + 1, h = c + 1, d = t / l, p = n / c, f = [], m = [], v = [], g = [], y = 0; y < h; y++ ) for (var b = y * p - s, A = 0; A < u; A++) { var w = A * d - a m.push(w, -b, 0), v.push(0, 0, 1), g.push(A / l), g.push(1 - y / c) } for (var x = 0; x < c; x++) for (var E = 0; E < l; E++) { var M = E + u * x, _ = E + u * (x + 1), T = E + 1 + u * (x + 1), S = E + 1 + u * x f.push(M, _, S), f.push(_, T, S) } return ( o.setIndex(f), o.setAttribute('position', new Wi(m, 3)), o.setAttribute('normal', new Wi(v, 3)), o.setAttribute('uv', new Wi(g, 2)), o ) } return Gn(t, e), t })(ro), qo = { 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_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif', clipping_planes_pars_fragment: '#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif', clipping_planes_pars_vertex: '#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif', clipping_planes_vertex: '#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - 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: '#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif', color_vertex: '#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor.xyz *= color.xyz;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif', common: '#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\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\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}', cube_uv_reflection_fragment: '#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif', defaultnormal_vertex: 'vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * 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\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#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\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 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#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;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\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\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\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\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\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\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\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\t#pragma unroll_loop_end\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};\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};\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};\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;', lights_toon_pars_fragment: 'varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3 diffuseColor;\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}\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 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\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 = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.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 diffuseColor;\n\tfloat specularRoughness;\n\tvec3 specularColor;\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(\t\t0, 1,\t\t0 ),\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#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\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\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\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\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\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\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\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\t#pragma unroll_loop_end\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_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\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\t\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\t\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\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\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_pars_fragment: '#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#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\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ 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\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ 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\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ 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\ttexture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t\tf.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\ttexture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t\tf.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\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ 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\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ 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\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif', shadowmap_vertex: '#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\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\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\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;\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}\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 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3(\t1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108,\t1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605,\t1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }', transmissionmap_fragment: '#ifdef USE_TRANSMISSIONMAP\n\ttotalTransmission *= texture2D( transmissionMap, vUv ).r;\n#endif', transmissionmap_pars_fragment: '#ifdef USE_TRANSMISSIONMAP\n\tuniform sampler2D transmissionMap;\n#endif', 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 \n\t#include \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 \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include \n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}', cube_vert: 'varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}', depth_frag: '#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}', depth_vert: '#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}', distanceRGBA_frag: '#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}', equirect_frag: 'uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}', equirect_vert: 'varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}', linedashed_frag: 'uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}', linedashed_vert: 'uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}', meshbasic_frag: 'uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}', meshbasic_vert: '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \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 \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n}', meshmatcap_vert: '#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}', meshtoon_frag: '#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}', meshtoon_vert: '#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}', meshphong_frag: '#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}', meshphong_vert: '#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}', meshphysical_frag: '#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSMISSION\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSMISSION\n\tuniform float transmission;\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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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#ifdef TRANSMISSION\n\t\tfloat totalTransmission = transmission;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSMISSION\n\t\tdiffuseColor.a *= mix( saturate( 1. - totalTransmission + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) ), 1.0, metalness );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}', points_vert: 'uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n}', shadow_frag: 'uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}', shadow_vert: '#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}', sprite_frag: 'uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n}', sprite_vert: 'uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n}', }, Xo = { common: { diffuse: { value: new Li(15658734) }, opacity: { value: 1 }, map: { value: null }, uvTransform: { value: new $n() }, uv2Transform: { value: new $n() }, alphaMap: { value: null }, }, specularmap: { specularMap: { value: null } }, envmap: { envMap: { value: null }, flipEnvMap: { value: -1 }, reflectivity: { value: 1 }, refractionRatio: { value: 0.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 Jn(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 Li(16777215) }, }, lights: { ambientLightColor: { value: [] }, lightProbe: { value: [] }, directionalLights: { value: [], properties: { direction: {}, color: {} }, }, directionalLightShadows: { value: [], properties: { shadowBias: {}, shadowNormalBias: {}, shadowRadius: {}, shadowMapSize: {}, }, }, directionalShadowMap: { value: [] }, directionalShadowMatrix: { value: [] }, spotLights: { value: [], properties: { color: {}, position: {}, direction: {}, distance: {}, coneCos: {}, penumbraCos: {}, decay: {}, }, }, spotLightShadows: { value: [], properties: { shadowBias: {}, shadowNormalBias: {}, shadowRadius: {}, shadowMapSize: {}, }, }, spotShadowMap: { value: [] }, spotShadowMatrix: { value: [] }, pointLights: { value: [], properties: { color: {}, position: {}, decay: {}, distance: {} }, }, pointLightShadows: { value: [], properties: { shadowBias: {}, shadowNormalBias: {}, shadowRadius: {}, shadowMapSize: {}, shadowCameraNear: {}, shadowCameraFar: {}, }, }, pointShadowMap: { value: [] }, pointShadowMatrix: { value: [] }, hemisphereLights: { value: [], properties: { direction: {}, skyColor: {}, groundColor: {} }, }, rectAreaLights: { value: [], properties: { color: {}, position: {}, width: {}, height: {} }, }, ltc_1: { value: null }, ltc_2: { value: null }, }, points: { diffuse: { value: new Li(15658734) }, opacity: { value: 1 }, size: { value: 1 }, scale: { value: 1 }, map: { value: null }, alphaMap: { value: null }, uvTransform: { value: new $n() }, }, sprite: { diffuse: { value: new Li(15658734) }, opacity: { value: 1 }, center: { value: new Jn(0.5, 0.5) }, rotation: { value: 0 }, map: { value: null }, alphaMap: { value: null }, uvTransform: { value: new $n() }, }, }, Yo = { basic: { uniforms: So([ Xo.common, Xo.specularmap, Xo.envmap, Xo.aomap, Xo.lightmap, Xo.fog, ]), vertexShader: qo.meshbasic_vert, fragmentShader: qo.meshbasic_frag, }, lambert: { uniforms: So([ Xo.common, Xo.specularmap, Xo.envmap, Xo.aomap, Xo.lightmap, Xo.emissivemap, Xo.fog, Xo.lights, { emissive: { value: new Li(0) } }, ]), vertexShader: qo.meshlambert_vert, fragmentShader: qo.meshlambert_frag, }, phong: { uniforms: So([ Xo.common, Xo.specularmap, Xo.envmap, Xo.aomap, Xo.lightmap, Xo.emissivemap, Xo.bumpmap, Xo.normalmap, Xo.displacementmap, Xo.fog, Xo.lights, { emissive: { value: new Li(0) }, specular: { value: new Li(1118481) }, shininess: { value: 30 }, }, ]), vertexShader: qo.meshphong_vert, fragmentShader: qo.meshphong_frag, }, standard: { uniforms: So([ Xo.common, Xo.envmap, Xo.aomap, Xo.lightmap, Xo.emissivemap, Xo.bumpmap, Xo.normalmap, Xo.displacementmap, Xo.roughnessmap, Xo.metalnessmap, Xo.fog, Xo.lights, { emissive: { value: new Li(0) }, roughness: { value: 1 }, metalness: { value: 0 }, envMapIntensity: { value: 1 }, }, ]), vertexShader: qo.meshphysical_vert, fragmentShader: qo.meshphysical_frag, }, toon: { uniforms: So([ Xo.common, Xo.aomap, Xo.lightmap, Xo.emissivemap, Xo.bumpmap, Xo.normalmap, Xo.displacementmap, Xo.gradientmap, Xo.fog, Xo.lights, { emissive: { value: new Li(0) } }, ]), vertexShader: qo.meshtoon_vert, fragmentShader: qo.meshtoon_frag, }, matcap: { uniforms: So([ Xo.common, Xo.bumpmap, Xo.normalmap, Xo.displacementmap, Xo.fog, { matcap: { value: null } }, ]), vertexShader: qo.meshmatcap_vert, fragmentShader: qo.meshmatcap_frag, }, points: { uniforms: So([Xo.points, Xo.fog]), vertexShader: qo.points_vert, fragmentShader: qo.points_frag, }, dashed: { uniforms: So([ Xo.common, Xo.fog, { scale: { value: 1 }, dashSize: { value: 1 }, totalSize: { value: 2 }, }, ]), vertexShader: qo.linedashed_vert, fragmentShader: qo.linedashed_frag, }, depth: { uniforms: So([Xo.common, Xo.displacementmap]), vertexShader: qo.depth_vert, fragmentShader: qo.depth_frag, }, normal: { uniforms: So([ Xo.common, Xo.bumpmap, Xo.normalmap, Xo.displacementmap, { opacity: { value: 1 } }, ]), vertexShader: qo.normal_vert, fragmentShader: qo.normal_frag, }, sprite: { uniforms: So([Xo.sprite, Xo.fog]), vertexShader: qo.sprite_vert, fragmentShader: qo.sprite_frag, }, background: { uniforms: { uvTransform: { value: new $n() }, t2D: { value: null } }, vertexShader: qo.background_vert, fragmentShader: qo.background_frag, }, cube: { uniforms: So([Xo.envmap, { opacity: { value: 1 } }]), vertexShader: qo.cube_vert, fragmentShader: qo.cube_frag, }, equirect: { uniforms: { tEquirect: { value: null } }, vertexShader: qo.equirect_vert, fragmentShader: qo.equirect_frag, }, distanceRGBA: { uniforms: So([ Xo.common, Xo.displacementmap, { referencePosition: { value: new lr() }, nearDistance: { value: 1 }, farDistance: { value: 1e3 }, }, ]), vertexShader: qo.distanceRGBA_vert, fragmentShader: qo.distanceRGBA_frag, }, shadow: { uniforms: So([ Xo.lights, Xo.fog, { color: { value: new Li(0) }, opacity: { value: 1 } }, ]), vertexShader: qo.shadow_vert, fragmentShader: qo.shadow_frag, }, } function Qo(e, t, n, r, i) { var o, a, s = new Li(0), l = 0, c = null, u = 0, h = null function d(n, i, d, f) { var g = !0 === i.isScene ? i.background : null g && g.isTexture && (g = t.get(g)) var y = e.xr, b = y.getSession && y.getSession() b && 'additive' === b.environmentBlendMode && (g = null), null === g ? p(s, l) : g && g.isColor && (p(g, 1), (f = !0)), (e.autoClear || f) && e.clear(e.autoClearColor, e.autoClearDepth, e.autoClearStencil), g && (g.isCubeTexture || g.isWebGLCubeRenderTarget || g.mapping === ue) ? (void 0 === a && ((a = new xo( new _o(1, 1, 1), new Po({ name: 'BackgroundCubeMaterial', uniforms: To(Yo.cube.uniforms), vertexShader: Yo.cube.vertexShader, fragmentShader: Yo.cube.fragmentShader, side: v, depthTest: !1, depthWrite: !1, fog: !1, }), )).geometry.deleteAttribute('normal'), a.geometry.deleteAttribute('uv'), (a.onBeforeRender = function (e, t, n) { this.matrixWorld.copyPosition(n.matrixWorld) }), Object.defineProperty(a.material, 'envMap', { get: function () { return this.uniforms.envMap.value }, }), r.update(a)), g.isWebGLCubeRenderTarget && (g = g.texture), (a.material.uniforms.envMap.value = g), (a.material.uniforms.flipEnvMap.value = g.isCubeTexture && g._needsFlipEnvMap ? -1 : 1), (c === g && u === g.version && h === e.toneMapping) || ((a.material.needsUpdate = !0), (c = g), (u = g.version), (h = e.toneMapping)), n.unshift(a, a.geometry, a.material, 0, 0, null)) : g && g.isTexture && (void 0 === o && ((o = new xo( new Wo(2, 2), new Po({ name: 'BackgroundMaterial', uniforms: To(Yo.background.uniforms), vertexShader: Yo.background.vertexShader, fragmentShader: Yo.background.fragmentShader, side: m, depthTest: !1, depthWrite: !1, fog: !1, }), )).geometry.deleteAttribute('normal'), Object.defineProperty(o.material, 'map', { get: function () { return this.uniforms.t2D.value }, }), r.update(o)), (o.material.uniforms.t2D.value = g), !0 === g.matrixAutoUpdate && g.updateMatrix(), o.material.uniforms.uvTransform.value.copy(g.matrix), (c === g && u === g.version && h === e.toneMapping) || ((o.material.needsUpdate = !0), (c = g), (u = g.version), (h = e.toneMapping)), n.unshift(o, o.geometry, o.material, 0, 0, null)) } function p(e, t) { n.buffers.color.setClear(e.r, e.g, e.b, t, i) } return { getClearColor: function () { return s }, setClearColor: function (e, t) { void 0 === t && (t = 1), s.set(e), p(s, (l = t)) }, getClearAlpha: function () { return l }, setClearAlpha: function (e) { p(s, (l = e)) }, render: d, } } function Zo(e, t, n, r) { var i = e.getParameter(34921), o = r.isWebGL2 ? null : t.get('OES_vertex_array_object'), a = r.isWebGL2 || null !== o, s = {}, l = m(null), c = l function u(t, r, i, o, s) { var l = !1 if (a) { var u = f(o, i, r) c !== u && d((c = u).object), (l = v(o, s)) && g(o, s) } else { var h = !0 === r.wireframe ;(c.geometry === o.id && c.program === i.id && c.wireframe === h) || ((c.geometry = o.id), (c.program = i.id), (c.wireframe = h), (l = !0)) } !0 === t.isInstancedMesh && (l = !0), null !== s && n.update(s, 34963), l && (E(t, r, i, o), null !== s && e.bindBuffer(34963, n.get(s).buffer)) } function h() { return r.isWebGL2 ? e.createVertexArray() : o.createVertexArrayOES() } function d(t) { return r.isWebGL2 ? e.bindVertexArray(t) : o.bindVertexArrayOES(t) } function p(t) { return r.isWebGL2 ? e.deleteVertexArray(t) : o.deleteVertexArrayOES(t) } function f(e, t, n) { var r = !0 === n.wireframe, i = s[e.id] void 0 === i && ((i = {}), (s[e.id] = i)) var o = i[t.id] void 0 === o && ((o = {}), (i[t.id] = o)) var a = o[r] return void 0 === a && ((a = m(h())), (o[r] = a)), a } function m(e) { for (var t = [], n = [], r = [], o = 0; o < i; o++) (t[o] = 0), (n[o] = 0), (r[o] = 0) return { geometry: null, program: null, wireframe: !1, newAttributes: t, enabledAttributes: n, attributeDivisors: r, object: e, attributes: {}, index: null, } } function v(e, t) { var n = c.attributes, r = e.attributes, i = 0 for (var o in r) { var a = n[o], s = r[o] if (void 0 === a) return !0 if (a.attribute !== s) return !0 if (a.data !== s.data) return !0 i++ } return c.attributesNum !== i || c.index !== t } function g(e, t) { var n = {}, r = e.attributes, i = 0 for (var o in r) { var a = r[o], s = {} ;(s.attribute = a), a.data && (s.data = a.data), (n[o] = s), i++ } ;(c.attributes = n), (c.attributesNum = i), (c.index = t) } function y() { for (var e = c.newAttributes, t = 0, n = e.length; t < n; t++) e[t] = 0 } function b(e) { A(e, 0) } function A(n, i) { var o = c.newAttributes, a = c.enabledAttributes, s = c.attributeDivisors ;(o[n] = 1), 0 === a[n] && (e.enableVertexAttribArray(n), (a[n] = 1)), s[n] !== i && ((r.isWebGL2 ? e : t.get('ANGLE_instanced_arrays'))[ r.isWebGL2 ? 'vertexAttribDivisor' : 'vertexAttribDivisorANGLE' ](n, i), (s[n] = i)) } function w() { for ( var t = c.newAttributes, n = c.enabledAttributes, r = 0, i = n.length; r < i; r++ ) n[r] !== t[r] && (e.disableVertexAttribArray(r), (n[r] = 0)) } function x(t, n, i, o, a, s) { !0 !== r.isWebGL2 || (5124 !== i && 5125 !== i) ? e.vertexAttribPointer(t, n, i, o, a, s) : e.vertexAttribIPointer(t, n, i, a, s) } function E(i, o, a, s) { if ( !1 !== r.isWebGL2 || (!i.isInstancedMesh && !s.isInstancedBufferGeometry) || null !== t.get('ANGLE_instanced_arrays') ) { y() var l = s.attributes, c = a.getAttributes(), u = o.defaultAttributeValues for (var h in c) { var d = c[h] if (d >= 0) { var p = l[h] if (void 0 !== p) { var f = p.normalized, m = p.itemSize, v = n.get(p) if (void 0 === v) continue var g = v.buffer, E = v.type, M = v.bytesPerElement if (p.isInterleavedBufferAttribute) { var _ = p.data, T = _.stride, S = p.offset _ && _.isInstancedInterleavedBuffer ? (A(d, _.meshPerAttribute), void 0 === s._maxInstanceCount && (s._maxInstanceCount = _.meshPerAttribute * _.count)) : b(d), e.bindBuffer(34962, g), x(d, m, E, f, T * M, S * M) } else p.isInstancedBufferAttribute ? (A(d, p.meshPerAttribute), void 0 === s._maxInstanceCount && (s._maxInstanceCount = p.meshPerAttribute * p.count)) : b(d), e.bindBuffer(34962, g), x(d, m, E, f, 0, 0) } else if ('instanceMatrix' === h) { var C = n.get(i.instanceMatrix) if (void 0 === C) continue var L = C.buffer, R = C.type A(d + 0, 1), A(d + 1, 1), A(d + 2, 1), A(d + 3, 1), e.bindBuffer(34962, L), e.vertexAttribPointer(d + 0, 4, R, !1, 64, 0), e.vertexAttribPointer(d + 1, 4, R, !1, 64, 16), e.vertexAttribPointer(d + 2, 4, R, !1, 64, 32), e.vertexAttribPointer(d + 3, 4, R, !1, 64, 48) } else if ('instanceColor' === h) { var P = n.get(i.instanceColor) if (void 0 === P) continue var D = P.buffer, O = P.type A(d, 1), e.bindBuffer(34962, D), e.vertexAttribPointer(d, 3, O, !1, 12, 0) } else if (void 0 !== u) { var I = u[h] if (void 0 !== I) switch (I.length) { case 2: e.vertexAttrib2fv(d, I) break case 3: e.vertexAttrib3fv(d, I) break case 4: e.vertexAttrib4fv(d, I) break default: e.vertexAttrib1fv(d, I) } } } } w() } } function M() { for (var e in (S(), s)) { var t = s[e] for (var n in t) { var r = t[n] for (var i in r) p(r[i].object), delete r[i] delete t[n] } delete s[e] } } function _(e) { if (void 0 !== s[e.id]) { var t = s[e.id] for (var n in t) { var r = t[n] for (var i in r) p(r[i].object), delete r[i] delete t[n] } delete s[e.id] } } function T(e) { for (var t in s) { var n = s[t] if (void 0 !== n[e.id]) { var r = n[e.id] for (var i in r) p(r[i].object), delete r[i] delete n[e.id] } } } function S() { C(), c !== l && d((c = l).object) } function C() { ;(l.geometry = null), (l.program = null), (l.wireframe = !1) } return { setup: u, reset: S, resetDefaultState: C, dispose: M, releaseStatesOfGeometry: _, releaseStatesOfProgram: T, initAttributes: y, enableAttribute: b, disableUnusedAttributes: w, } } function Ko(e, t, n, r) { var i, o = r.isWebGL2 function a(e) { i = e } function s(t, r) { e.drawArrays(i, t, r), n.update(r, i, 1) } function l(r, a, s) { if (0 !== s) { var l, c if (o) (l = e), (c = 'drawArraysInstanced') else if ( ((c = 'drawArraysInstancedANGLE'), null === (l = t.get('ANGLE_instanced_arrays'))) ) return void console.error( 'THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.', ) l[c](i, r, a, s), n.update(a, i, s) } } ;(this.setMode = a), (this.render = s), (this.renderInstances = l) } function Jo(e, t, n) { var r function i() { if (void 0 !== r) return r var n = t.get('EXT_texture_filter_anisotropic') return (r = null !== n ? e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0) } function o(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 = ('undefined' !== typeof WebGL2RenderingContext && e instanceof WebGL2RenderingContext) || ('undefined' !== typeof WebGL2ComputeRenderingContext && e instanceof WebGL2ComputeRenderingContext), s = void 0 !== n.precision ? n.precision : 'highp', l = o(s) l !== s && (console.warn( 'THREE.WebGLRenderer:', s, 'not supported, using', l, 'instead.', ), (s = l)) var c = !0 === n.logarithmicDepthBuffer, u = e.getParameter(34930), h = e.getParameter(35660), d = e.getParameter(3379), p = e.getParameter(34076), f = e.getParameter(34921), m = e.getParameter(36347), v = e.getParameter(36348), g = e.getParameter(36349), y = h > 0, b = a || !!t.get('OES_texture_float') return { isWebGL2: a, getMaxAnisotropy: i, getMaxPrecision: o, precision: s, logarithmicDepthBuffer: c, maxTextures: u, maxVertexTextures: h, maxTextureSize: d, maxCubemapSize: p, maxAttributes: f, maxVertexUniforms: m, maxVaryings: v, maxFragmentUniforms: g, vertexTextures: y, floatFragmentTextures: b, floatVertexTextures: y && b, maxSamples: a ? e.getParameter(36183) : 0, } } function $o(e) { var t = this, n = null, r = 0, i = !1, o = !1, a = new hi(), s = new $n(), l = { value: null, needsUpdate: !1 } function c() { l.value !== n && ((l.value = n), (l.needsUpdate = r > 0)), (t.numPlanes = r), (t.numIntersection = 0) } function u(e, n, r, i) { var o = null !== e ? e.length : 0, c = null if (0 !== o) { if (((c = l.value), !0 !== i || null === c)) { var u = r + 4 * o, h = n.matrixWorldInverse s.getNormalMatrix(h), (null === c || c.length < u) && (c = new Float32Array(u)) for (var d = 0, p = r; d !== o; ++d, p += 4) a.copy(e[d]).applyMatrix4(h, s), a.normal.toArray(c, p), (c[p + 3] = a.constant) } ;(l.value = c), (l.needsUpdate = !0) } return (t.numPlanes = o), (t.numIntersection = 0), c } ;(this.uniform = l), (this.numPlanes = 0), (this.numIntersection = 0), (this.init = function (e, t, o) { var a = 0 !== e.length || t || 0 !== r || i return (i = t), (n = u(e, o, 0)), (r = e.length), a }), (this.beginShadows = function () { ;(o = !0), u(null) }), (this.endShadows = function () { ;(o = !1), c() }), (this.setState = function (t, a, s) { var h = t.clippingPlanes, d = t.clipIntersection, p = t.clipShadows, f = e.get(t) if (!i || null === h || 0 === h.length || (o && !p)) o ? u(null) : c() else { var m = o ? 0 : r, v = 4 * m, g = f.clippingState || null ;(l.value = g), (g = u(h, a, v, s)) for (var y = 0; y !== v; ++y) g[y] = n[y] ;(f.clippingState = g), (this.numIntersection = d ? this.numPlanes : 0), (this.numPlanes += m) } }) } function ea(e) { var t = new WeakMap() function n(e, t) { return t === le ? (e.mapping = ae) : t === ce && (e.mapping = se), e } function r(r) { if (r && r.isTexture) { var o = r.mapping if (o === le || o === ce) { if (t.has(r)) return n(t.get(r).texture, r.mapping) var a = r.image if (a && a.height > 0) { var s = e.getRenderList(), l = e.getRenderTarget(), c = new No(a.height / 2) return ( c.fromEquirectangularTexture(e, r), t.set(r, c), e.setRenderTarget(l), e.setRenderList(s), r.addEventListener('dispose', i), n(c.texture, r.mapping) ) } return null } } return r } function i(e) { var n = e.target n.removeEventListener('dispose', i) var r = t.get(n) void 0 !== r && (t.delete(n), r.dispose()) } function o() { t = new WeakMap() } return { get: r, dispose: o } } function ta(e) { var t = {} function n(n) { if (void 0 !== t[n]) return t[n] var r switch (n) { case 'WEBGL_depth_texture': r = e.getExtension('WEBGL_depth_texture') || e.getExtension('MOZ_WEBGL_depth_texture') || e.getExtension('WEBKIT_WEBGL_depth_texture') break case 'EXT_texture_filter_anisotropic': r = 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': r = 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': r = e.getExtension('WEBGL_compressed_texture_pvrtc') || e.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc') break default: r = e.getExtension(n) } return (t[n] = r), r } return { has: function (e) { return null !== n(e) }, init: function (e) { e.isWebGL2 ? n('EXT_color_buffer_float') : (n('WEBGL_depth_texture'), n('OES_texture_float'), n('OES_texture_half_float'), n('OES_texture_half_float_linear'), n('OES_standard_derivatives'), n('OES_element_index_uint'), n('OES_vertex_array_object'), n('ANGLE_instanced_arrays')), n('OES_texture_float_linear'), n('EXT_color_buffer_half_float') }, get: function (e) { var t = n(e) return ( null === t && console.warn( 'THREE.WebGLRenderer: ' + e + ' extension not supported.', ), t ) }, } } function na(e, t, n, r) { var i = {}, o = new WeakMap() function a(e) { var s = e.target for (var l in (null !== s.index && t.remove(s.index), s.attributes)) t.remove(s.attributes[l]) s.removeEventListener('dispose', a), delete i[s.id] var c = o.get(s) c && (t.remove(c), o.delete(s)), r.releaseStatesOfGeometry(s), !0 === s.isInstancedBufferGeometry && delete s._maxInstanceCount, n.memory.geometries-- } function s(e, t) { return ( !0 === i[t.id] || (t.addEventListener('dispose', a), (i[t.id] = !0), n.memory.geometries++), t ) } function l(e) { var n = e.attributes for (var r in n) t.update(n[r], 34962) var i = e.morphAttributes for (var o in i) for (var a = i[o], s = 0, l = a.length; s < l; s++) t.update(a[s], 34962) } function c(e) { var n = [], r = e.index, i = e.attributes.position, a = 0 if (null !== r) { var s = r.array a = r.version for (var l = 0, c = s.length; l < c; l += 3) { var u = s[l + 0], h = s[l + 1], d = s[l + 2] n.push(u, h, h, d, d, u) } } else { var p = i.array a = i.version for (var f = 0, m = p.length / 3 - 1; f < m; f += 3) { var v = f + 0, g = f + 1, y = f + 2 n.push(v, g, g, y, y, v) } } var b = new (Xi(n) > 65535 ? ji : Gi)(n, 1) b.version = a var A = o.get(e) A && t.remove(A), o.set(e, b) } function u(e) { var t = o.get(e) if (t) { var n = e.index null !== n && t.version < n.version && c(e) } else c(e) return o.get(e) } return { get: s, update: l, getWireframeAttribute: u } } function ra(e, t, n, r) { var i, o, a, s = r.isWebGL2 function l(e) { i = e } function c(e) { ;(o = e.type), (a = e.bytesPerElement) } function u(t, r) { e.drawElements(i, r, o, t * a), n.update(r, i, 1) } function h(r, l, c) { if (0 !== c) { var u, h if (s) (u = e), (h = 'drawElementsInstanced') else if ( ((h = 'drawElementsInstancedANGLE'), null === (u = t.get('ANGLE_instanced_arrays'))) ) return void console.error( 'THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.', ) u[h](i, l, o, r * a, c), n.update(l, i, c) } } ;(this.setMode = l), (this.setIndex = c), (this.render = u), (this.renderInstances = h) } function ia(e) { var t = { frame: 0, calls: 0, triangles: 0, points: 0, lines: 0 } function n(e, n, r) { switch ((t.calls++, n)) { case 4: t.triangles += r * (e / 3) break case 1: t.lines += r * (e / 2) break case 3: t.lines += r * (e - 1) break case 2: t.lines += r * e break case 0: t.points += r * e break default: console.error('THREE.WebGLInfo: Unknown draw mode:', n) } } function r() { t.frame++, (t.calls = 0), (t.triangles = 0), (t.points = 0), (t.lines = 0) } return { memory: { geometries: 0, textures: 0 }, render: t, programs: null, autoReset: !0, reset: r, update: n, } } function oa(e, t) { return e[0] - t[0] } function aa(e, t) { return Math.abs(t[1]) - Math.abs(e[1]) } function sa(e) { for (var t = {}, n = new Float32Array(8), r = [], i = 0; i < 8; i++) r[i] = [i, 0] function o(i, o, a, s) { var l = i.morphTargetInfluences, c = void 0 === l ? 0 : l.length, u = t[o.id] if (void 0 === u) { u = [] for (var h = 0; h < c; h++) u[h] = [h, 0] t[o.id] = u } for (var d = 0; d < c; d++) { var p = u[d] ;(p[0] = d), (p[1] = l[d]) } u.sort(aa) for (var f = 0; f < 8; f++) f < c && u[f][1] ? ((r[f][0] = u[f][0]), (r[f][1] = u[f][1])) : ((r[f][0] = Number.MAX_SAFE_INTEGER), (r[f][1] = 0)) r.sort(oa) for ( var m = a.morphTargets && o.morphAttributes.position, v = a.morphNormals && o.morphAttributes.normal, g = 0, y = 0; y < 8; y++ ) { var b = r[y], A = b[0], w = b[1] A !== Number.MAX_SAFE_INTEGER && w ? (m && o.getAttribute('morphTarget' + y) !== m[A] && o.setAttribute('morphTarget' + y, m[A]), v && o.getAttribute('morphNormal' + y) !== v[A] && o.setAttribute('morphNormal' + y, v[A]), (n[y] = w), (g += w)) : (m && !0 === o.hasAttribute('morphTarget' + y) && o.deleteAttribute('morphTarget' + y), v && !0 === o.hasAttribute('morphNormal' + y) && o.deleteAttribute('morphNormal' + y), (n[y] = 0)) } var x = o.morphTargetsRelative ? 1 : 1 - g s.getUniforms().setValue(e, 'morphTargetBaseInfluence', x), s.getUniforms().setValue(e, 'morphTargetInfluences', n) } return { update: o } } function la(e, t, n, r) { var i = new WeakMap() function o(e) { var o = r.render.frame, a = e.geometry, l = t.get(e, a) return ( i.get(l) !== o && (t.update(l), i.set(l, o)), e.isInstancedMesh && (!1 === e.hasEventListener('dispose', s) && e.addEventListener('dispose', s), n.update(e.instanceMatrix, 34962), null !== e.instanceColor && n.update(e.instanceColor, 34962)), l ) } function a() { i = new WeakMap() } function s(e) { var t = e.target t.removeEventListener('dispose', s), n.remove(t.instanceMatrix), null !== t.instanceColor && n.remove(t.instanceColor) } return { update: o, dispose: a } } function ca(e, t, n, r) { void 0 === e && (e = null), void 0 === t && (t = 1), void 0 === n && (n = 1), void 0 === r && (r = 1), nr.call(this, null), (this.image = { data: e, width: t, height: n, depth: r }), (this.magFilter = me), (this.minFilter = me), (this.wrapR = pe), (this.generateMipmaps = !1), (this.flipY = !1), (this.needsUpdate = !0) } function ua(e, t, n, r) { void 0 === e && (e = null), void 0 === t && (t = 1), void 0 === n && (n = 1), void 0 === r && (r = 1), nr.call(this, null), (this.image = { data: e, width: t, height: n, depth: r }), (this.magFilter = me), (this.minFilter = me), (this.wrapR = pe), (this.generateMipmaps = !1), (this.flipY = !1), (this.needsUpdate = !0) } ;(Yo.physical = { uniforms: So([ Yo.standard.uniforms, { clearcoat: { value: 0 }, clearcoatMap: { value: null }, clearcoatRoughness: { value: 0 }, clearcoatRoughnessMap: { value: null }, clearcoatNormalScale: { value: new Jn(1, 1) }, clearcoatNormalMap: { value: null }, sheen: { value: new Li(0) }, transmission: { value: 0 }, transmissionMap: { value: null }, }, ]), vertexShader: qo.meshphysical_vert, fragmentShader: qo.meshphysical_frag, }), (ca.prototype = Object.create(nr.prototype)), (ca.prototype.constructor = ca), (ca.prototype.isDataTexture2DArray = !0), (ua.prototype = Object.create(nr.prototype)), (ua.prototype.constructor = ua), (ua.prototype.isDataTexture3D = !0) var ha = new nr(), da = new ca(), pa = new ua(), fa = new ko(), ma = [], va = [], ga = new Float32Array(16), ya = new Float32Array(9), ba = new Float32Array(4) function Aa(e, t, n) { var r = e[0] if (r <= 0 || r > 0) return e var i = t * n, o = ma[i] if ((void 0 === o && ((o = new Float32Array(i)), (ma[i] = o)), 0 !== t)) { r.toArray(o, 0) for (var a = 1, s = 0; a !== t; ++a) (s += n), e[a].toArray(o, s) } return o } function wa(e, t) { if (e.length !== t.length) return !1 for (var n = 0, r = e.length; n < r; n++) if (e[n] !== t[n]) return !1 return !0 } function xa(e, t) { for (var n = 0, r = t.length; n < r; n++) e[n] = t[n] } function Ea(e, t) { var n = va[t] void 0 === n && ((n = new Int32Array(t)), (va[t] = n)) for (var r = 0; r !== t; ++r) n[r] = e.allocateTextureUnit() return n } function Ma(e, t) { var n = this.cache n[0] !== t && (e.uniform1f(this.addr, t), (n[0] = t)) } function _a(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 (wa(n, t)) return e.uniform2fv(this.addr, t), xa(n, t) } } function Ta(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 (wa(n, t)) return e.uniform3fv(this.addr, t), xa(n, t) } } function Sa(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 (wa(n, t)) return e.uniform4fv(this.addr, t), xa(n, t) } } function Ca(e, t) { var n = this.cache, r = t.elements if (void 0 === r) { if (wa(n, t)) return e.uniformMatrix2fv(this.addr, !1, t), xa(n, t) } else { if (wa(n, r)) return ba.set(r), e.uniformMatrix2fv(this.addr, !1, ba), xa(n, r) } } function La(e, t) { var n = this.cache, r = t.elements if (void 0 === r) { if (wa(n, t)) return e.uniformMatrix3fv(this.addr, !1, t), xa(n, t) } else { if (wa(n, r)) return ya.set(r), e.uniformMatrix3fv(this.addr, !1, ya), xa(n, r) } } function Ra(e, t) { var n = this.cache, r = t.elements if (void 0 === r) { if (wa(n, t)) return e.uniformMatrix4fv(this.addr, !1, t), xa(n, t) } else { if (wa(n, r)) return ga.set(r), e.uniformMatrix4fv(this.addr, !1, ga), xa(n, r) } } function Pa(e, t, n) { var r = this.cache, i = n.allocateTextureUnit() r[0] !== i && (e.uniform1i(this.addr, i), (r[0] = i)), n.safeSetTexture2D(t || ha, i) } function Da(e, t, n) { var r = this.cache, i = n.allocateTextureUnit() r[0] !== i && (e.uniform1i(this.addr, i), (r[0] = i)), n.setTexture2DArray(t || da, i) } function Oa(e, t, n) { var r = this.cache, i = n.allocateTextureUnit() r[0] !== i && (e.uniform1i(this.addr, i), (r[0] = i)), n.setTexture3D(t || pa, i) } function Ia(e, t, n) { var r = this.cache, i = n.allocateTextureUnit() r[0] !== i && (e.uniform1i(this.addr, i), (r[0] = i)), n.safeSetTextureCube(t || fa, i) } function Ba(e, t) { var n = this.cache n[0] !== t && (e.uniform1i(this.addr, t), (n[0] = t)) } function Fa(e, t) { var n = this.cache wa(n, t) || (e.uniform2iv(this.addr, t), xa(n, t)) } function ka(e, t) { var n = this.cache wa(n, t) || (e.uniform3iv(this.addr, t), xa(n, t)) } function Na(e, t) { var n = this.cache wa(n, t) || (e.uniform4iv(this.addr, t), xa(n, t)) } function Ua(e, t) { var n = this.cache n[0] !== t && (e.uniform1ui(this.addr, t), (n[0] = t)) } function Ha(e) { switch (e) { case 5126: return Ma case 35664: return _a case 35665: return Ta case 35666: return Sa case 35674: return Ca case 35675: return La case 35676: return Ra case 5124: case 35670: return Ba case 35667: case 35671: return Fa case 35668: case 35672: return ka case 35669: case 35673: return Na case 5125: return Ua case 35678: case 36198: case 36298: case 36306: case 35682: return Pa case 35679: case 36299: case 36307: return Oa case 35680: case 36300: case 36308: case 36293: return Ia case 36289: case 36303: case 36311: case 36292: return Da } } function Ga(e, t) { e.uniform1fv(this.addr, t) } function za(e, t) { e.uniform1iv(this.addr, t) } function ja(e, t) { e.uniform2iv(this.addr, t) } function Va(e, t) { e.uniform3iv(this.addr, t) } function Wa(e, t) { e.uniform4iv(this.addr, t) } function qa(e, t) { var n = Aa(t, this.size, 2) e.uniform2fv(this.addr, n) } function Xa(e, t) { var n = Aa(t, this.size, 3) e.uniform3fv(this.addr, n) } function Ya(e, t) { var n = Aa(t, this.size, 4) e.uniform4fv(this.addr, n) } function Qa(e, t) { var n = Aa(t, this.size, 4) e.uniformMatrix2fv(this.addr, !1, n) } function Za(e, t) { var n = Aa(t, this.size, 9) e.uniformMatrix3fv(this.addr, !1, n) } function Ka(e, t) { var n = Aa(t, this.size, 16) e.uniformMatrix4fv(this.addr, !1, n) } function Ja(e, t, n) { var r = t.length, i = Ea(n, r) e.uniform1iv(this.addr, i) for (var o = 0; o !== r; ++o) n.safeSetTexture2D(t[o] || ha, i[o]) } function $a(e, t, n) { var r = t.length, i = Ea(n, r) e.uniform1iv(this.addr, i) for (var o = 0; o !== r; ++o) n.safeSetTextureCube(t[o] || fa, i[o]) } function es(e) { switch (e) { case 5126: return Ga case 35664: return qa case 35665: return Xa case 35666: return Ya case 35674: return Qa case 35675: return Za case 35676: return Ka case 5124: case 35670: return za case 35667: case 35671: return ja case 35668: case 35672: return Va case 35669: case 35673: return Wa case 35678: case 36198: case 36298: case 36306: case 35682: return Ja case 35680: case 36300: case 36308: case 36293: return $a } } function ts(e, t, n) { ;(this.id = e), (this.addr = n), (this.cache = []), (this.setValue = Ha(t.type)) } function ns(e, t, n) { ;(this.id = e), (this.addr = n), (this.cache = []), (this.size = t.size), (this.setValue = es(t.type)) } function rs(e) { ;(this.id = e), (this.seq = []), (this.map = {}) } ;(ns.prototype.updateCache = function (e) { var t = this.cache e instanceof Float32Array && t.length !== e.length && (this.cache = new Float32Array(e.length)), xa(t, e) }), (rs.prototype.setValue = function (e, t, n) { for (var r = this.seq, i = 0, o = r.length; i !== o; ++i) { var a = r[i] a.setValue(e, t[a.id], n) } }) var is = /(\w+)(\])?(\[|\.)?/g function os(e, t) { e.seq.push(t), (e.map[t.id] = t) } function as(e, t, n) { var r = e.name, i = r.length for (is.lastIndex = 0; ; ) { var o = is.exec(r), a = is.lastIndex, s = o[1], l = ']' === o[2], c = o[3] if ((l && (s |= 0), void 0 === c || ('[' === c && a + 2 === i))) { os(n, void 0 === c ? new ts(s, e, t) : new ns(s, e, t)) break } var u = n.map[s] void 0 === u && os(n, (u = new rs(s))), (n = u) } } function ss(e, t) { ;(this.seq = []), (this.map = {}) for (var n = e.getProgramParameter(t, 35718), r = 0; r < n; ++r) { var i = e.getActiveUniform(t, r) as(i, e.getUniformLocation(t, i.name), this) } } function ls(e, t, n) { var r = e.createShader(t) return e.shaderSource(r, n), e.compileShader(r), r } ;(ss.prototype.setValue = function (e, t, n, r) { var i = this.map[t] void 0 !== i && i.setValue(e, n, r) }), (ss.prototype.setOptional = function (e, t, n) { var r = t[n] void 0 !== r && this.setValue(e, n, r) }), (ss.upload = function (e, t, n, r) { for (var i = 0, o = t.length; i !== o; ++i) { var a = t[i], s = n[a.id] !1 !== s.needsUpdate && a.setValue(e, s.value, r) } }), (ss.seqWithValue = function (e, t) { for (var n = [], r = 0, i = e.length; r !== i; ++r) { var o = e[r] o.id in t && n.push(o) } return n }) var cs = 0 function us(e) { for (var t = e.split('\n'), n = 0; n < t.length; n++) t[n] = n + 1 + ': ' + t[n] return t.join('\n') } function hs(e) { switch (e) { case Kt: return ['Linear', '( value )'] case Jt: return ['sRGB', '( value )'] case en: return ['RGBE', '( value )'] case nn: return ['RGBM', '( value, 7.0 )'] case rn: return ['RGBM', '( value, 16.0 )'] case on: return ['RGBD', '( value, 256.0 )'] case $t: return ['Gamma', '( value, float( GAMMA_FACTOR ) )'] case tn: return ['LogLuv', '( value )'] default: return ( console.warn('THREE.WebGLProgram: Unsupported encoding:', e), ['Linear', '( value )'] ) } } function ds(e, t, n) { var r = e.getShaderParameter(t, 35713), i = e.getShaderInfoLog(t).trim() return r && '' === i ? '' : 'THREE.WebGLShader: gl.getShaderInfoLog() ' + n + '\n' + i + us(e.getShaderSource(t)) } function ps(e, t) { var n = hs(t) return ( 'vec4 ' + e + '( vec4 value ) { return ' + n[0] + 'ToLinear' + n[1] + '; }' ) } function fs(e, t) { var n = hs(t) return 'vec4 ' + e + '( vec4 value ) { return LinearTo' + n[0] + n[1] + '; }' } function ms(e, t) { var n switch (t) { case ee: n = 'Linear' break case te: n = 'Reinhard' break case ne: n = 'OptimizedCineon' break case re: n = 'ACESFilmic' break case ie: n = 'Custom' break default: console.warn('THREE.WebGLProgram: Unsupported toneMapping:', t), (n = 'Linear') } return ( 'vec3 ' + e + '( vec3 color ) { return ' + n + 'ToneMapping( color ); }' ) } function vs(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(bs) .join('\n') } function gs(e) { var t = [] for (var n in e) { var r = e[n] !1 !== r && t.push('#define ' + n + ' ' + r) } return t.join('\n') } function ys(e, t) { for (var n = {}, r = e.getProgramParameter(t, 35721), i = 0; i < r; i++) { var o = e.getActiveAttrib(t, i).name n[o] = e.getAttribLocation(t, o) } return n } function bs(e) { return '' !== e } function As(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 ws(e, t) { return e .replace(/NUM_CLIPPING_PLANES/g, t.numClippingPlanes) .replace( /UNION_CLIPPING_PLANES/g, t.numClippingPlanes - t.numClipIntersection, ) } var xs = /^[ \t]*#include +<([\w\d./]+)>/gm function Es(e) { return e.replace(xs, Ms) } function Ms(e, t) { var n = qo[t] if (void 0 === n) throw new Error('Can not resolve #include <' + t + '>') return Es(n) } var _s = /#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g, Ts = /#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g function Ss(e) { return e.replace(Ts, Ls).replace(_s, Cs) } function Cs(e, t, n, r) { return ( console.warn( 'WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead.', ), Ls(e, t, n, r) ) } function Ls(e, t, n, r) { for (var i = '', o = parseInt(t); o < parseInt(n); o++) i += r .replace(/\[\s*i\s*\]/g, '[ ' + o + ' ]') .replace(/UNROLLED_LOOP_INDEX/g, o) return i } function Rs(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 Ps(e) { var t = 'SHADOWMAP_TYPE_BASIC' return ( e.shadowMapType === d ? (t = 'SHADOWMAP_TYPE_PCF') : e.shadowMapType === p ? (t = 'SHADOWMAP_TYPE_PCF_SOFT') : e.shadowMapType === f && (t = 'SHADOWMAP_TYPE_VSM'), t ) } function Ds(e) { var t = 'ENVMAP_TYPE_CUBE' if (e.envMap) switch (e.envMapMode) { case ae: case se: t = 'ENVMAP_TYPE_CUBE' break case ue: case he: t = 'ENVMAP_TYPE_CUBE_UV' } return t } function Os(e) { var t = 'ENVMAP_MODE_REFLECTION' if (e.envMap) switch (e.envMapMode) { case se: case he: t = 'ENVMAP_MODE_REFRACTION' } return t } function Is(e) { var t = 'ENVMAP_BLENDING_NONE' if (e.envMap) switch (e.combine) { case Z: t = 'ENVMAP_BLENDING_MULTIPLY' break case K: t = 'ENVMAP_BLENDING_MIX' break case J: t = 'ENVMAP_BLENDING_ADD' } return t } function Bs(e, t, n, r) { var i, o, a = e.getContext(), s = n.defines, l = n.vertexShader, c = n.fragmentShader, u = Ps(n), h = Ds(n), d = Os(n), p = Is(n), f = e.gammaFactor > 0 ? e.gammaFactor : 1, m = n.isWebGL2 ? '' : vs(n), v = gs(s), g = a.createProgram(), y = n.glslVersion ? '#version ' + n.glslVersion + '\n' : '' n.isRawShaderMaterial ? ((i = [v].filter(bs).join('\n')).length > 0 && (i += '\n'), (o = [m, v].filter(bs).join('\n')).length > 0 && (o += '\n')) : ((i = [ Rs(n), '#define SHADER_NAME ' + n.shaderName, v, n.instancing ? '#define USE_INSTANCING' : '', n.instancingColor ? '#define USE_INSTANCING_COLOR' : '', n.supportsVertexTextures ? '#define VERTEX_TEXTURES' : '', '#define GAMMA_FACTOR ' + f, '#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 ' + d : '', 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.clearcoatMap ? '#define USE_CLEARCOATMAP' : '', n.clearcoatRoughnessMap ? '#define USE_CLEARCOAT_ROUGHNESSMAP' : '', 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.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '', 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 ' + u : '', 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', '\tattribute mat4 instanceMatrix;', '#endif', '#ifdef USE_INSTANCING_COLOR', '\tattribute vec3 instanceColor;', '#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(bs) .join('\n')), (o = [ m, Rs(n), '#define SHADER_NAME ' + n.shaderName, v, n.alphaTest ? '#define ALPHATEST ' + n.alphaTest + (n.alphaTest % 1 ? '' : '.0') : '', '#define GAMMA_FACTOR ' + f, 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 ' + d : '', 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.clearcoatMap ? '#define USE_CLEARCOATMAP' : '', n.clearcoatRoughnessMap ? '#define USE_CLEARCOAT_ROUGHNESSMAP' : '', 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.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '', n.vertexTangents ? '#define USE_TANGENT' : '', n.vertexColors || n.instancingColor ? '#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 ' + u : '', 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 !== $ ? '#define TONE_MAPPING' : '', n.toneMapping !== $ ? qo.tonemapping_pars_fragment : '', n.toneMapping !== $ ? ms('toneMapping', n.toneMapping) : '', n.dithering ? '#define DITHERING' : '', qo.encodings_pars_fragment, n.map ? ps('mapTexelToLinear', n.mapEncoding) : '', n.matcap ? ps('matcapTexelToLinear', n.matcapEncoding) : '', n.envMap ? ps('envMapTexelToLinear', n.envMapEncoding) : '', n.emissiveMap ? ps('emissiveMapTexelToLinear', n.emissiveMapEncoding) : '', n.lightMap ? ps('lightMapTexelToLinear', n.lightMapEncoding) : '', fs('linearToOutputTexel', n.outputEncoding), n.depthPacking ? '#define DEPTH_PACKING ' + n.depthPacking : '', '\n', ] .filter(bs) .join('\n'))), (l = ws((l = As((l = Es(l)), n)), n)), (c = ws((c = As((c = Es(c)), n)), n)), (l = Ss(l)), (c = Ss(c)), n.isWebGL2 && !0 !== n.isRawShaderMaterial && ((y = '#version 300 es\n'), (i = [ '#define attribute in', '#define varying out', '#define texture2D texture', ].join('\n') + '\n' + i), (o = [ '#define varying in', n.glslVersion === Fn ? '' : 'out highp vec4 pc_fragColor;', n.glslVersion === Fn ? '' : '#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' + o)) var b, A, w = y + o + c, x = ls(a, 35633, y + i + l), E = ls(a, 35632, w) if ( (a.attachShader(g, x), a.attachShader(g, E), void 0 !== n.index0AttributeName ? a.bindAttribLocation(g, 0, n.index0AttributeName) : !0 === n.morphTargets && a.bindAttribLocation(g, 0, 'position'), a.linkProgram(g), e.debug.checkShaderErrors) ) { var M = a.getProgramInfoLog(g).trim(), _ = a.getShaderInfoLog(x).trim(), T = a.getShaderInfoLog(E).trim(), S = !0, C = !0 if (!1 === a.getProgramParameter(g, 35714)) { S = !1 var L = ds(a, x, 'vertex'), R = ds(a, E, 'fragment') console.error( 'THREE.WebGLProgram: shader error: ', a.getError(), '35715', a.getProgramParameter(g, 35715), 'gl.getProgramInfoLog', M, L, R, ) } else '' !== M ? console.warn('THREE.WebGLProgram: gl.getProgramInfoLog()', M) : ('' !== _ && '' !== T) || (C = !1) C && (this.diagnostics = { runnable: S, programLog: M, vertexShader: { log: _, prefix: i }, fragmentShader: { log: T, prefix: o }, }) } return ( a.deleteShader(x), a.deleteShader(E), (this.getUniforms = function () { return void 0 === b && (b = new ss(a, g)), b }), (this.getAttributes = function () { return void 0 === A && (A = ys(a, g)), A }), (this.destroy = function () { r.releaseStatesOfProgram(this), a.deleteProgram(g), (this.program = void 0) }), (this.name = n.shaderName), (this.id = cs++), (this.cacheKey = t), (this.usedTimes = 1), (this.program = g), (this.vertexShader = x), (this.fragmentShader = E), this ) } function Fs(e, t, n, r, i, o) { var a = [], s = r.isWebGL2, l = r.logarithmicDepthBuffer, c = r.floatVertexTextures, u = r.maxVertexUniforms, h = r.vertexTextures, d = r.precision, p = { 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', 'instancingColor', 'map', 'mapEncoding', 'matcap', 'matcapEncoding', 'envMap', 'envMapMode', 'envMapEncoding', 'envMapCubeUV', 'lightMap', 'lightMapEncoding', 'aoMap', 'emissiveMap', 'emissiveMapEncoding', 'bumpMap', 'normalMap', 'objectSpaceNormalMap', 'tangentSpaceNormalMap', 'clearcoatMap', 'clearcoatRoughnessMap', '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', 'transmissionMap', ] function m(e) { var t = e.skeleton.bones if (c) return 1024 var n = u, r = Math.floor((n - 20) / 4), i = Math.min(r, t.length) return i < t.length ? (console.warn( 'THREE.WebGLRenderer: Skeleton has ' + t.length + ' bones. This GPU supports ' + i + '.', ), 0) : i } function y(e) { var t return ( e && e.isTexture ? (t = e.encoding) : e && e.isWebGLRenderTarget ? (console.warn( "THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead.", ), (t = e.texture.encoding)) : (t = Kt), t ) } function b(i, a, u, f, b) { var A, w, x = f.fog, E = i.isMeshStandardMaterial ? f.environment : null, M = t.get(i.envMap || E), _ = p[i.type], T = b.isSkinnedMesh ? m(b) : 0 if ( (null !== i.precision && (d = r.getMaxPrecision(i.precision)) !== i.precision && console.warn( 'THREE.WebGLProgram.getParameters:', i.precision, 'not supported, using', d, 'instead.', ), _) ) { var S = Yo[_] ;(A = S.vertexShader), (w = S.fragmentShader) } else (A = i.vertexShader), (w = i.fragmentShader) var C = e.getRenderTarget() return { isWebGL2: s, shaderID: _, shaderName: i.type, vertexShader: A, fragmentShader: w, defines: i.defines, isRawShaderMaterial: !0 === i.isRawShaderMaterial, glslVersion: i.glslVersion, precision: d, instancing: !0 === b.isInstancedMesh, instancingColor: !0 === b.isInstancedMesh && null !== b.instanceColor, supportsVertexTextures: h, outputEncoding: null !== C ? y(C.texture) : e.outputEncoding, map: !!i.map, mapEncoding: y(i.map), matcap: !!i.matcap, matcapEncoding: y(i.matcap), envMap: !!M, envMapMode: M && M.mapping, envMapEncoding: y(M), envMapCubeUV: !!M && (M.mapping === ue || M.mapping === he), lightMap: !!i.lightMap, lightMapEncoding: y(i.lightMap), aoMap: !!i.aoMap, emissiveMap: !!i.emissiveMap, emissiveMapEncoding: y(i.emissiveMap), bumpMap: !!i.bumpMap, normalMap: !!i.normalMap, objectSpaceNormalMap: i.normalMapType === cn, tangentSpaceNormalMap: i.normalMapType === ln, clearcoatMap: !!i.clearcoatMap, clearcoatRoughnessMap: !!i.clearcoatRoughnessMap, clearcoatNormalMap: !!i.clearcoatNormalMap, displacementMap: !!i.displacementMap, roughnessMap: !!i.roughnessMap, metalnessMap: !!i.metalnessMap, specularMap: !!i.specularMap, alphaMap: !!i.alphaMap, gradientMap: !!i.gradientMap, sheen: !!i.sheen, transmissionMap: !!i.transmissionMap, combine: i.combine, vertexTangents: i.normalMap && i.vertexTangents, vertexColors: i.vertexColors, vertexUvs: !!i.map || !!i.bumpMap || !!i.normalMap || !!i.specularMap || !!i.alphaMap || !!i.emissiveMap || !!i.roughnessMap || !!i.metalnessMap || !!i.clearcoatMap || !!i.clearcoatRoughnessMap || !!i.clearcoatNormalMap || !!i.displacementMap || !!i.transmissionMap, uvsVertexOnly: !( i.map || i.bumpMap || i.normalMap || i.specularMap || i.alphaMap || i.emissiveMap || i.roughnessMap || i.metalnessMap || i.clearcoatNormalMap || i.transmissionMap ) && !!i.displacementMap, fog: !!x, useFog: i.fog, fogExp2: x && x.isFogExp2, flatShading: i.flatShading, sizeAttenuation: i.sizeAttenuation, logarithmicDepthBuffer: l, skinning: i.skinning && T > 0, maxBones: T, useVertexTexture: c, morphTargets: i.morphTargets, morphNormals: i.morphNormals, maxMorphTargets: e.maxMorphTargets, maxMorphNormals: e.maxMorphNormals, numDirLights: a.directional.length, numPointLights: a.point.length, numSpotLights: a.spot.length, numRectAreaLights: a.rectArea.length, numHemiLights: a.hemi.length, numDirLightShadows: a.directionalShadowMap.length, numPointLightShadows: a.pointShadowMap.length, numSpotLightShadows: a.spotShadowMap.length, numClippingPlanes: o.numPlanes, numClipIntersection: o.numIntersection, dithering: i.dithering, shadowMapEnabled: e.shadowMap.enabled && u.length > 0, shadowMapType: e.shadowMap.type, toneMapping: i.toneMapped ? e.toneMapping : $, physicallyCorrectLights: e.physicallyCorrectLights, premultipliedAlpha: i.premultipliedAlpha, alphaTest: i.alphaTest, doubleSided: i.side === g, flipSided: i.side === v, depthPacking: void 0 !== i.depthPacking && i.depthPacking, index0AttributeName: i.index0AttributeName, extensionDerivatives: i.extensions && i.extensions.derivatives, extensionFragDepth: i.extensions && i.extensions.fragDepth, extensionDrawBuffers: i.extensions && i.extensions.drawBuffers, extensionShaderTextureLOD: i.extensions && i.extensions.shaderTextureLOD, rendererExtensionFragDepth: s || n.has('EXT_frag_depth'), rendererExtensionDrawBuffers: s || n.has('WEBGL_draw_buffers'), rendererExtensionShaderTextureLod: s || n.has('EXT_shader_texture_lod'), customProgramCacheKey: i.customProgramCacheKey(), } } function A(t) { var n = [] if ( (t.shaderID ? n.push(t.shaderID) : (n.push(t.fragmentShader), n.push(t.vertexShader)), void 0 !== t.defines) ) for (var r in t.defines) n.push(r), n.push(t.defines[r]) if (!1 === t.isRawShaderMaterial) { for (var i = 0; i < f.length; i++) n.push(t[f[i]]) n.push(e.outputEncoding), n.push(e.gammaFactor) } return n.push(t.customProgramCacheKey), n.join() } function w(e) { var t, n = p[e.type] if (n) { var r = Yo[n] t = Co.clone(r.uniforms) } else t = e.uniforms return t } function x(t, n) { for (var r, o = 0, s = a.length; o < s; o++) { var l = a[o] if (l.cacheKey === n) { ++(r = l).usedTimes break } } return void 0 === r && ((r = new Bs(e, n, t, i)), a.push(r)), r } function E(e) { if (0 === --e.usedTimes) { var t = a.indexOf(e) ;(a[t] = a[a.length - 1]), a.pop(), e.destroy() } } return { getParameters: b, getProgramCacheKey: A, getUniforms: w, acquireProgram: x, releaseProgram: E, programs: a, } } function ks() { var e = new WeakMap() function t(t) { var n = e.get(t) return void 0 === n && ((n = {}), e.set(t, n)), n } function n(t) { e.delete(t) } function r(t, n, r) { e.get(t)[n] = r } function i() { e = new WeakMap() } return { get: t, remove: n, update: r, dispose: i } } function Ns(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 Us(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 Hs(e) { var t = [], n = 0, r = [], i = [], o = { id: -1 } function a() { ;(n = 0), (r.length = 0), (i.length = 0) } function s(r, i, a, s, l, c) { var u = t[n], h = e.get(a) return ( void 0 === u ? ((u = { id: r.id, object: r, geometry: i, material: a, program: h.program || o, groupOrder: s, renderOrder: r.renderOrder, z: l, group: c, }), (t[n] = u)) : ((u.id = r.id), (u.object = r), (u.geometry = i), (u.material = a), (u.program = h.program || o), (u.groupOrder = s), (u.renderOrder = r.renderOrder), (u.z = l), (u.group = c)), n++, u ) } function l(e, t, n, o, a, l) { var c = s(e, t, n, o, a, l) ;(!0 === n.transparent ? i : r).push(c) } function c(e, t, n, o, a, l) { var c = s(e, t, n, o, a, l) ;(!0 === n.transparent ? i : r).unshift(c) } function u(e, t) { r.length > 1 && r.sort(e || Ns), i.length > 1 && i.sort(t || Us) } function h() { for (var e = n, r = t.length; e < r; e++) { var i = t[e] if (null === i.id) break ;(i.id = null), (i.object = null), (i.geometry = null), (i.material = null), (i.program = null), (i.group = null) } } return { opaque: r, transparent: i, init: a, push: l, unshift: c, finish: h, sort: u, } } function Gs(e) { var t = new WeakMap() function n(n, r) { var i, o = t.get(n) return ( void 0 === o ? ((i = new Hs(e)), t.set(n, new WeakMap()), t.get(n).set(r, i)) : void 0 === (i = o.get(r)) && ((i = new Hs(e)), o.set(r, i)), i ) } function r() { t = new WeakMap() } return { get: n, dispose: r } } function zs() { var e = {} return { get: function (t) { if (void 0 !== e[t.id]) return e[t.id] var n switch (t.type) { case 'DirectionalLight': n = { direction: new lr(), color: new Li() } break case 'SpotLight': n = { position: new lr(), direction: new lr(), color: new Li(), distance: 0, coneCos: 0, penumbraCos: 0, decay: 0, } break case 'PointLight': n = { position: new lr(), color: new Li(), distance: 0, decay: 0 } break case 'HemisphereLight': n = { direction: new lr(), skyColor: new Li(), groundColor: new Li() } break case 'RectAreaLight': n = { color: new Li(), position: new lr(), halfWidth: new lr(), halfHeight: new lr(), } } return (e[t.id] = n), n }, } } function js() { var e = {} return { get: function (t) { if (void 0 !== e[t.id]) return e[t.id] var n switch (t.type) { case 'DirectionalLight': case 'SpotLight': n = { shadowBias: 0, shadowNormalBias: 0, shadowRadius: 1, shadowMapSize: new Jn(), } break case 'PointLight': n = { shadowBias: 0, shadowNormalBias: 0, shadowRadius: 1, shadowMapSize: new Jn(), shadowCameraNear: 1, shadowCameraFar: 1e3, } } return (e[t.id] = n), n }, } } var Vs = 0 function Ws(e, t) { return (t.castShadow ? 1 : 0) - (e.castShadow ? 1 : 0) } function qs(e, t) { for ( var n = new zs(), r = js(), i = { 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: [], directionalShadow: [], directionalShadowMap: [], directionalShadowMatrix: [], spot: [], spotShadow: [], spotShadowMap: [], spotShadowMatrix: [], rectArea: [], rectAreaLTC1: null, rectAreaLTC2: null, point: [], pointShadow: [], pointShadowMap: [], pointShadowMatrix: [], hemi: [], }, o = 0; o < 9; o++ ) i.probe.push(new lr()) var a = new lr(), s = new Fr(), l = new Fr() function c(o) { for (var a = 0, s = 0, l = 0, c = 0; c < 9; c++) i.probe[c].set(0, 0, 0) var u = 0, h = 0, d = 0, p = 0, f = 0, m = 0, v = 0, g = 0 o.sort(Ws) for (var y = 0, b = o.length; y < b; y++) { var A = o[y], w = A.color, x = A.intensity, E = A.distance, M = A.shadow && A.shadow.map ? A.shadow.map.texture : null if (A.isAmbientLight) (a += w.r * x), (s += w.g * x), (l += w.b * x) else if (A.isLightProbe) for (var _ = 0; _ < 9; _++) i.probe[_].addScaledVector(A.sh.coefficients[_], x) else if (A.isDirectionalLight) { var T = n.get(A) if ((T.color.copy(A.color).multiplyScalar(A.intensity), A.castShadow)) { var S = A.shadow, C = r.get(A) ;(C.shadowBias = S.bias), (C.shadowNormalBias = S.normalBias), (C.shadowRadius = S.radius), (C.shadowMapSize = S.mapSize), (i.directionalShadow[u] = C), (i.directionalShadowMap[u] = M), (i.directionalShadowMatrix[u] = A.shadow.matrix), m++ } ;(i.directional[u] = T), u++ } else if (A.isSpotLight) { var L = n.get(A) if ( (L.position.setFromMatrixPosition(A.matrixWorld), L.color.copy(w).multiplyScalar(x), (L.distance = E), (L.coneCos = Math.cos(A.angle)), (L.penumbraCos = Math.cos(A.angle * (1 - A.penumbra))), (L.decay = A.decay), A.castShadow) ) { var R = A.shadow, P = r.get(A) ;(P.shadowBias = R.bias), (P.shadowNormalBias = R.normalBias), (P.shadowRadius = R.radius), (P.shadowMapSize = R.mapSize), (i.spotShadow[d] = P), (i.spotShadowMap[d] = M), (i.spotShadowMatrix[d] = A.shadow.matrix), g++ } ;(i.spot[d] = L), d++ } else if (A.isRectAreaLight) { var D = n.get(A) D.color.copy(w).multiplyScalar(x), D.halfWidth.set(0.5 * A.width, 0, 0), D.halfHeight.set(0, 0.5 * A.height, 0), (i.rectArea[p] = D), p++ } else if (A.isPointLight) { var O = n.get(A) if ( (O.color.copy(A.color).multiplyScalar(A.intensity), (O.distance = A.distance), (O.decay = A.decay), A.castShadow) ) { var I = A.shadow, B = r.get(A) ;(B.shadowBias = I.bias), (B.shadowNormalBias = I.normalBias), (B.shadowRadius = I.radius), (B.shadowMapSize = I.mapSize), (B.shadowCameraNear = I.camera.near), (B.shadowCameraFar = I.camera.far), (i.pointShadow[h] = B), (i.pointShadowMap[h] = M), (i.pointShadowMatrix[h] = A.shadow.matrix), v++ } ;(i.point[h] = O), h++ } else if (A.isHemisphereLight) { var F = n.get(A) F.skyColor.copy(A.color).multiplyScalar(x), F.groundColor.copy(A.groundColor).multiplyScalar(x), (i.hemi[f] = F), f++ } } p > 0 && (t.isWebGL2 || !0 === e.has('OES_texture_float_linear') ? ((i.rectAreaLTC1 = Xo.LTC_FLOAT_1), (i.rectAreaLTC2 = Xo.LTC_FLOAT_2)) : !0 === e.has('OES_texture_half_float_linear') ? ((i.rectAreaLTC1 = Xo.LTC_HALF_1), (i.rectAreaLTC2 = Xo.LTC_HALF_2)) : console.error( 'THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.', )), (i.ambient[0] = a), (i.ambient[1] = s), (i.ambient[2] = l) var k = i.hash ;(k.directionalLength === u && k.pointLength === h && k.spotLength === d && k.rectAreaLength === p && k.hemiLength === f && k.numDirectionalShadows === m && k.numPointShadows === v && k.numSpotShadows === g) || ((i.directional.length = u), (i.spot.length = d), (i.rectArea.length = p), (i.point.length = h), (i.hemi.length = f), (i.directionalShadow.length = m), (i.directionalShadowMap.length = m), (i.pointShadow.length = v), (i.pointShadowMap.length = v), (i.spotShadow.length = g), (i.spotShadowMap.length = g), (i.directionalShadowMatrix.length = m), (i.pointShadowMatrix.length = v), (i.spotShadowMatrix.length = g), (k.directionalLength = u), (k.pointLength = h), (k.spotLength = d), (k.rectAreaLength = p), (k.hemiLength = f), (k.numDirectionalShadows = m), (k.numPointShadows = v), (k.numSpotShadows = g), (i.version = Vs++)) } function u(e, t) { for ( var n = 0, r = 0, o = 0, c = 0, u = 0, h = t.matrixWorldInverse, d = 0, p = e.length; d < p; d++ ) { var f = e[d] if (f.isDirectionalLight) { var m = i.directional[n] m.direction.setFromMatrixPosition(f.matrixWorld), a.setFromMatrixPosition(f.target.matrixWorld), m.direction.sub(a), m.direction.transformDirection(h), n++ } else if (f.isSpotLight) { var v = i.spot[o] v.position.setFromMatrixPosition(f.matrixWorld), v.position.applyMatrix4(h), v.direction.setFromMatrixPosition(f.matrixWorld), a.setFromMatrixPosition(f.target.matrixWorld), v.direction.sub(a), v.direction.transformDirection(h), o++ } else if (f.isRectAreaLight) { var g = i.rectArea[c] g.position.setFromMatrixPosition(f.matrixWorld), g.position.applyMatrix4(h), l.identity(), s.copy(f.matrixWorld), s.premultiply(h), l.extractRotation(s), g.halfWidth.set(0.5 * f.width, 0, 0), g.halfHeight.set(0, 0.5 * f.height, 0), g.halfWidth.applyMatrix4(l), g.halfHeight.applyMatrix4(l), c++ } else if (f.isPointLight) { var y = i.point[r] y.position.setFromMatrixPosition(f.matrixWorld), y.position.applyMatrix4(h), r++ } else if (f.isHemisphereLight) { var b = i.hemi[u] b.direction.setFromMatrixPosition(f.matrixWorld), b.direction.transformDirection(h), b.direction.normalize(), u++ } } } return { setup: c, setupView: u, state: i } } function Xs(e, t) { var n = new qs(e, t), r = [], i = [] function o() { ;(r.length = 0), (i.length = 0) } function a(e) { r.push(e) } function s(e) { i.push(e) } function l() { n.setup(r) } function c(e) { n.setupView(r, e) } return { init: o, state: { lightsArray: r, shadowsArray: i, lights: n }, setupLights: l, setupLightsView: c, pushLight: a, pushShadow: s, } } function Ys(e, t) { var n = new WeakMap() function r(r, i) { var o return ( void 0 === i && (i = 0), !1 === n.has(r) ? ((o = new Xs(e, t)), n.set(r, []), n.get(r).push(o)) : i >= n.get(r).length ? ((o = new Xs(e, t)), n.get(r).push(o)) : (o = n.get(r)[i]), o ) } function i() { n = new WeakMap() } return { get: r, dispose: i } } function Qs(e) { Di.call(this), (this.type = 'MeshDepthMaterial'), (this.depthPacking = an), (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 Zs(e) { Di.call(this), (this.type = 'MeshDistanceMaterial'), (this.referencePosition = new lr()), (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) } ;(Qs.prototype = Object.create(Di.prototype)), (Qs.prototype.constructor = Qs), (Qs.prototype.isMeshDepthMaterial = !0), (Qs.prototype.copy = function (e) { return ( Di.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 ) }), (Zs.prototype = Object.create(Di.prototype)), (Zs.prototype.constructor = Zs), (Zs.prototype.isMeshDistanceMaterial = !0), (Zs.prototype.copy = function (e) { return ( Di.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 Ks = 'uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\tfor ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean * HALF_SAMPLE_RATE;\n\tsquared_mean = squared_mean * HALF_SAMPLE_RATE;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}', Js = 'void main() {\n\tgl_Position = vec4( position, 1.0 );\n}' function $s(e, t, n) { var r = new zo(), i = new Jn(), o = new Jn(), a = new ir(), s = [], l = [], c = {}, u = { 0: v, 1: m, 2: g }, h = new Po({ defines: { SAMPLE_RATE: 2 / 8, HALF_SAMPLE_RATE: 1 / 8 }, uniforms: { shadow_pass: { value: null }, resolution: { value: new Jn() }, radius: { value: 4 }, }, vertexShader: Js, fragmentShader: Ks, }), p = h.clone() p.defines.HORIZONTAL_PASS = 1 var y = new ro() y.setAttribute( 'position', new Fi(new Float32Array([-1, -1, 0.5, 3, -1, 0.5, -1, 3, 0.5]), 3), ) var b = new xo(y, h), w = this function x(n, r) { var i = t.update(b) ;(h.uniforms.shadow_pass.value = n.map.texture), (h.uniforms.resolution.value = n.mapSize), (h.uniforms.radius.value = n.radius), e.setRenderTarget(n.mapPass), e.clear(), e.renderBufferDirect(r, null, i, h, b, null), (p.uniforms.shadow_pass.value = n.mapPass.texture), (p.uniforms.resolution.value = n.mapSize), (p.uniforms.radius.value = n.radius), e.setRenderTarget(n.map), e.clear(), e.renderBufferDirect(r, null, i, p, b, null) } function E(e, t, n) { var r = (e << 0) | (t << 1) | (n << 2), i = s[r] return ( void 0 === i && ((i = new Qs({ depthPacking: sn, morphTargets: e, skinning: t })), (s[r] = i)), i ) } function M(e, t, n) { var r = (e << 0) | (t << 1) | (n << 2), i = l[r] return ( void 0 === i && ((i = new Zs({ morphTargets: e, skinning: t })), (l[r] = i)), i ) } function _(t, n, r, i, o, a, s) { var l = null, h = E, d = t.customDepthMaterial if ( (!0 === i.isPointLight && ((h = M), (d = t.customDistanceMaterial)), void 0 === d) ) { var p = !1 !0 === r.morphTargets && (p = n.morphAttributes && n.morphAttributes.position && n.morphAttributes.position.length > 0) var m = !1 !0 === t.isSkinnedMesh && (!0 === r.skinning ? (m = !0) : console.warn( 'THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:', t, )), (l = h(p, m, !0 === t.isInstancedMesh)) } else l = d if ( e.localClippingEnabled && !0 === r.clipShadows && 0 !== r.clippingPlanes.length ) { var v = l.uuid, g = r.uuid, y = c[v] void 0 === y && ((y = {}), (c[v] = y)) var b = y[g] void 0 === b && ((b = l.clone()), (y[g] = b)), (l = b) } return ( (l.visible = r.visible), (l.wireframe = r.wireframe), (l.side = s === f ? null !== r.shadowSide ? r.shadowSide : r.side : null !== r.shadowSide ? r.shadowSide : u[r.side]), (l.clipShadows = r.clipShadows), (l.clippingPlanes = r.clippingPlanes), (l.clipIntersection = r.clipIntersection), (l.wireframeLinewidth = r.wireframeLinewidth), (l.linewidth = r.linewidth), !0 === i.isPointLight && !0 === l.isMeshDistanceMaterial && (l.referencePosition.setFromMatrixPosition(i.matrixWorld), (l.nearDistance = o), (l.farDistance = a)), l ) } function T(n, i, o, a, s) { if (!1 !== n.visible) { if ( n.layers.test(i.layers) && (n.isMesh || n.isLine || n.isPoints) && (n.castShadow || (n.receiveShadow && s === f)) && (!n.frustumCulled || r.intersectsObject(n)) ) { n.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse, n.matrixWorld) var l = t.update(n), c = n.material if (Array.isArray(c)) for (var u = l.groups, h = 0, d = u.length; h < d; h++) { var p = u[h], m = c[p.materialIndex] if (m && m.visible) { var v = _(n, l, m, a, o.near, o.far, s) e.renderBufferDirect(o, null, l, v, n, p) } } else if (c.visible) { var g = _(n, l, c, a, o.near, o.far, s) e.renderBufferDirect(o, null, l, g, n, null) } } for (var y = n.children, b = 0, A = y.length; b < A; b++) T(y[b], i, o, a, s) } } ;(this.enabled = !1), (this.autoUpdate = !0), (this.needsUpdate = !1), (this.type = d), (this.render = function (t, s, l) { if ( !1 !== w.enabled && (!1 !== w.autoUpdate || !1 !== w.needsUpdate) && 0 !== t.length ) { var c = e.getRenderTarget(), u = e.getActiveCubeFace(), h = e.getActiveMipmapLevel(), d = e.state d.setBlending(A), d.buffers.color.setClear(1, 1, 1, 1), d.buffers.depth.setTest(!0), d.setScissorTest(!1) for (var p = 0, m = t.length; p < m; p++) { var v = t[p], g = v.shadow if (void 0 !== g) { if (!1 !== g.autoUpdate || !1 !== g.needsUpdate) { i.copy(g.mapSize) var y = g.getFrameExtents() if ( (i.multiply(y), o.copy(g.mapSize), (i.x > n || i.y > n) && (i.x > n && ((o.x = Math.floor(n / y.x)), (i.x = o.x * y.x), (g.mapSize.x = o.x)), i.y > n && ((o.y = Math.floor(n / y.y)), (i.y = o.y * y.y), (g.mapSize.y = o.y))), null === g.map && !g.isPointLightShadow && this.type === f) ) { var b = { minFilter: Ae, magFilter: Ae, format: Ue } ;(g.map = new or(i.x, i.y, b)), (g.map.texture.name = v.name + '.shadowMap'), (g.mapPass = new or(i.x, i.y, b)), g.camera.updateProjectionMatrix() } if (null === g.map) { var E = { minFilter: me, magFilter: me, format: Ue } ;(g.map = new or(i.x, i.y, E)), (g.map.texture.name = v.name + '.shadowMap'), g.camera.updateProjectionMatrix() } e.setRenderTarget(g.map), e.clear() for (var M = g.getViewportCount(), _ = 0; _ < M; _++) { var S = g.getViewport(_) a.set(o.x * S.x, o.y * S.y, o.x * S.z, o.y * S.w), d.viewport(a), g.updateMatrices(v, _), (r = g.getFrustum()), T(s, l, g.camera, v, this.type) } g.isPointLightShadow || this.type !== f || x(g, l), (g.needsUpdate = !1) } } else console.warn('THREE.WebGLShadowMap:', v, 'has no shadow.') } ;(w.needsUpdate = !1), e.setRenderTarget(c, u, h) } }) } function el(e, t, n) { var r, i, o = n.isWebGL2 function a() { var t = !1, n = new ir(), r = null, i = new ir(0, 0, 0, 0) return { setMask: function (n) { r === n || t || (e.colorMask(n, n, n, n), (r = n)) }, setLocked: function (e) { t = e }, setClear: function (t, r, o, a, s) { !0 === s && ((t *= a), (r *= a), (o *= a)), n.set(t, r, o, a), !1 === i.equals(n) && (e.clearColor(t, r, o, a), i.copy(n)) }, reset: function () { ;(t = !1), (r = null), i.set(-1, 0, 0, 0) }, } } function u() { var t = !1, n = null, r = null, i = null return { setTest: function (e) { e ? be(2929) : Ae(2929) }, setMask: function (r) { n === r || t || (e.depthMask(r), (n = r)) }, setFunc: function (t) { if (r !== t) { if (t) switch (t) { case z: e.depthFunc(512) break case j: e.depthFunc(519) break case V: e.depthFunc(513) break case W: e.depthFunc(515) break case q: e.depthFunc(514) break case X: e.depthFunc(518) break case Y: e.depthFunc(516) break case Q: e.depthFunc(517) break default: e.depthFunc(515) } else e.depthFunc(515) r = t } }, setLocked: function (e) { t = e }, setClear: function (t) { i !== t && (e.clearDepth(t), (i = t)) }, reset: function () { ;(t = !1), (n = null), (r = null), (i = null) }, } } function h() { var t = !1, n = null, r = null, i = null, o = null, a = null, s = null, l = null, c = null return { setTest: function (e) { t || (e ? be(2960) : Ae(2960)) }, setMask: function (r) { n === r || t || (e.stencilMask(r), (n = r)) }, setFunc: function (t, n, a) { ;(r === t && i === n && o === a) || (e.stencilFunc(t, n, a), (r = t), (i = n), (o = a)) }, setOp: function (t, n, r) { ;(a === t && s === n && l === r) || (e.stencilOp(t, n, r), (a = t), (s = n), (l = r)) }, setLocked: function (e) { t = e }, setClear: function (t) { c !== t && (e.clearStencil(t), (c = t)) }, reset: function () { ;(t = !1), (n = null), (r = null), (i = null), (o = null), (a = null), (s = null), (l = null), (c = null) }, } } var d = new a(), p = new u(), f = new h(), m = {}, y = null, b = null, Z = null, K = null, J = null, $ = null, ee = null, te = null, ne = null, re = !1, ie = null, oe = null, ae = null, se = null, le = null, ce = e.getParameter(35661), ue = !1, he = 0, de = e.getParameter(7938) ;-1 !== de.indexOf('WebGL') ? ((he = parseFloat(/^WebGL (\d)/.exec(de)[1])), (ue = he >= 1)) : -1 !== de.indexOf('OpenGL ES') && ((he = parseFloat(/^OpenGL ES (\d)/.exec(de)[1])), (ue = he >= 2)) var pe = null, fe = {}, me = new ir(), ve = new ir() function ge(t, n, r) { var i = new Uint8Array(4), o = e.createTexture() e.bindTexture(t, o), e.texParameteri(t, 10241, 9728), e.texParameteri(t, 10240, 9728) for (var a = 0; a < r; a++) e.texImage2D(n + a, 0, 6408, 1, 1, 0, 6408, 5121, i) return o } var ye = {} function be(t) { !0 !== m[t] && (e.enable(t), (m[t] = !0)) } function Ae(t) { !1 !== m[t] && (e.disable(t), (m[t] = !1)) } function we(t) { return y !== t && (e.useProgram(t), (y = t), !0) } ;(ye[3553] = ge(3553, 3553, 1)), (ye[34067] = ge(34067, 34069, 6)), d.setClear(0, 0, 0, 1), p.setClear(1), f.setClear(0), be(2929), p.setFunc(W), Se(!1), Ce(l), be(2884), _e(A) var xe = (((r = {})[T] = 32774), (r[S] = 32778), (r[C] = 32779), r) if (o) (xe[L] = 32775), (xe[R] = 32776) else { var Ee = t.get('EXT_blend_minmax') null !== Ee && ((xe[L] = Ee.MIN_EXT), (xe[R] = Ee.MAX_EXT)) } var Me = (((i = {})[P] = 0), (i[D] = 1), (i[O] = 768), (i[B] = 770), (i[G] = 776), (i[U] = 774), (i[k] = 772), (i[I] = 769), (i[F] = 771), (i[H] = 775), (i[N] = 773), i) function _e(t, n, r, i, o, a, s, l) { if (t !== A) { if ((b || (be(3042), (b = !0)), t === _)) (o = o || n), (a = a || r), (s = s || i), (n === K && o === ee) || (e.blendEquationSeparate(xe[n], xe[o]), (K = n), (ee = o)), (r === J && i === $ && a === te && s === ne) || (e.blendFuncSeparate(Me[r], Me[i], Me[a], Me[s]), (J = r), ($ = i), (te = a), (ne = s)), (Z = t), (re = null) else if (t !== Z || l !== re) { if ( ((K === T && ee === T) || (e.blendEquation(32774), (K = T), (ee = T)), l) ) switch (t) { case w: e.blendFuncSeparate(1, 771, 1, 771) break case x: e.blendFunc(1, 1) break case E: e.blendFuncSeparate(0, 0, 769, 771) break case M: e.blendFuncSeparate(0, 768, 0, 770) break default: console.error('THREE.WebGLState: Invalid blending: ', t) } else switch (t) { case w: e.blendFuncSeparate(770, 771, 1, 771) break case x: e.blendFunc(770, 1) break case E: e.blendFunc(0, 769) break case M: e.blendFunc(0, 768) break default: console.error('THREE.WebGLState: Invalid blending: ', t) } ;(J = null), ($ = null), (te = null), (ne = null), (Z = t), (re = l) } } else b && (Ae(3042), (b = !1)) } function Te(e, t) { e.side === g ? Ae(2884) : be(2884) var n = e.side === v t && (n = !n), Se(n), e.blending === w && !1 === e.transparent ? _e(A) : _e( e.blending, e.blendEquation, e.blendSrc, e.blendDst, e.blendEquationAlpha, e.blendSrcAlpha, e.blendDstAlpha, e.premultipliedAlpha, ), p.setFunc(e.depthFunc), p.setTest(e.depthTest), p.setMask(e.depthWrite), d.setMask(e.colorWrite) var r = e.stencilWrite f.setTest(r), r && (f.setMask(e.stencilWriteMask), f.setFunc(e.stencilFunc, e.stencilRef, e.stencilFuncMask), f.setOp(e.stencilFail, e.stencilZFail, e.stencilZPass)), Re(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits) } function Se(t) { ie !== t && (t ? e.frontFace(2304) : e.frontFace(2305), (ie = t)) } function Ce(t) { t !== s ? (be(2884), t !== oe && (t === l ? e.cullFace(1029) : t === c ? e.cullFace(1028) : e.cullFace(1032))) : Ae(2884), (oe = t) } function Le(t) { t !== ae && (ue && e.lineWidth(t), (ae = t)) } function Re(t, n, r) { t ? (be(32823), (se === n && le === r) || (e.polygonOffset(n, r), (se = n), (le = r))) : Ae(32823) } function Pe(e) { e ? be(3089) : Ae(3089) } function De(t) { void 0 === t && (t = 33984 + ce - 1), pe !== t && (e.activeTexture(t), (pe = t)) } function Oe(t, n) { null === pe && De() var r = fe[pe] void 0 === r && ((r = { type: void 0, texture: void 0 }), (fe[pe] = r)), (r.type === t && r.texture === n) || (e.bindTexture(t, n || ye[t]), (r.type = t), (r.texture = n)) } function Ie() { var t = fe[pe] void 0 !== t && void 0 !== t.type && (e.bindTexture(t.type, null), (t.type = void 0), (t.texture = void 0)) } function Be() { try { e.compressedTexImage2D.apply(e, arguments) } catch (t) { console.error('THREE.WebGLState:', t) } } function Fe() { try { e.texImage2D.apply(e, arguments) } catch (t) { console.error('THREE.WebGLState:', t) } } function ke() { try { e.texImage3D.apply(e, arguments) } catch (t) { console.error('THREE.WebGLState:', t) } } function Ne(t) { !1 === me.equals(t) && (e.scissor(t.x, t.y, t.z, t.w), me.copy(t)) } function Ue(t) { !1 === ve.equals(t) && (e.viewport(t.x, t.y, t.z, t.w), ve.copy(t)) } function He() { ;(m = {}), (pe = null), (fe = {}), (y = null), (b = null), (Z = null), (K = null), (J = null), ($ = null), (ee = null), (te = null), (ne = null), (re = !1), (ie = null), (oe = null), (ae = null), (se = null), (le = null), d.reset(), p.reset(), f.reset() } return { buffers: { color: d, depth: p, stencil: f }, enable: be, disable: Ae, useProgram: we, setBlending: _e, setMaterial: Te, setFlipSided: Se, setCullFace: Ce, setLineWidth: Le, setPolygonOffset: Re, setScissorTest: Pe, activeTexture: De, bindTexture: Oe, unbindTexture: Ie, compressedTexImage2D: Be, texImage2D: Fe, texImage3D: ke, scissor: Ne, viewport: Ue, reset: He, } } function tl(e, t, n, r, i, o, a) { var s, l, c, u = i.isWebGL2, h = i.maxTextures, d = i.maxCubemapSize, p = i.maxTextureSize, f = i.maxSamples, m = new WeakMap(), v = !1 try { v = 'undefined' !== typeof OffscreenCanvas && null !== new OffscreenCanvas(1, 1).getContext('2d') } catch (te) {} function g(e, t) { return v ? new OffscreenCanvas(e, t) : document.createElementNS('http://www.w3.org/1999/xhtml', 'canvas') } function y(e, t, n, r) { var i = 1 if ( ((e.width > r || e.height > r) && (i = r / Math.max(e.width, e.height)), i < 1 || !0 === t) ) { if ( ('undefined' !== typeof HTMLImageElement && e instanceof HTMLImageElement) || ('undefined' !== typeof HTMLCanvasElement && e instanceof HTMLCanvasElement) || ('undefined' !== typeof ImageBitmap && e instanceof ImageBitmap) ) { var o = t ? Kn.floorPowerOfTwo : Math.floor, a = o(i * e.width), s = o(i * e.height) void 0 === c && (c = g(a, s)) var l = n ? g(a, s) : c return ( (l.width = a), (l.height = s), l.getContext('2d').drawImage(e, 0, 0, a, s), console.warn( 'THREE.WebGLRenderer: Texture has been resized from (' + e.width + 'x' + e.height + ') to (' + a + 'x' + s + ').', ), l ) } return ( 'data' in e && console.warn( 'THREE.WebGLRenderer: Image in DataTexture is too big (' + e.width + 'x' + e.height + ').', ), e ) } return e } function b(e) { return Kn.isPowerOfTwo(e.width) && Kn.isPowerOfTwo(e.height) } function A(e) { return ( !u && (e.wrapS !== pe || e.wrapT !== pe || (e.minFilter !== me && e.minFilter !== Ae)) ) } function w(e, t) { return e.generateMipmaps && t && e.minFilter !== me && e.minFilter !== Ae } function x(t, n, i, o) { e.generateMipmap(t), (r.get(n).__maxMipLevel = Math.log(Math.max(i, o)) * Math.LOG2E) } function E(n, r, i) { if (!1 === u) return r 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 o = r return ( 6403 === r && (5126 === i && (o = 33326), 5131 === i && (o = 33325), 5121 === i && (o = 33321)), 6407 === r && (5126 === i && (o = 34837), 5131 === i && (o = 34843), 5121 === i && (o = 32849)), 6408 === r && (5126 === i && (o = 34836), 5131 === i && (o = 34842), 5121 === i && (o = 32856)), (33325 !== o && 33326 !== o && 34842 !== o && 34836 !== o) || t.get('EXT_color_buffer_float'), o ) } function M(e) { return e === me || e === ve || e === ye ? 9728 : 9729 } function _(e) { var t = e.target t.removeEventListener('dispose', _), S(t), t.isVideoTexture && m.delete(t), a.memory.textures-- } function T(e) { var t = e.target t.removeEventListener('dispose', T), C(t), a.memory.textures-- } function S(t) { var n = r.get(t) void 0 !== n.__webglInit && (e.deleteTexture(n.__webglTexture), r.remove(t)) } function C(t) { var n = r.get(t), i = r.get(t.texture) if (t) { if ( (void 0 !== i.__webglTexture && e.deleteTexture(i.__webglTexture), t.depthTexture && t.depthTexture.dispose(), t.isWebGLCubeRenderTarget) ) for (var o = 0; o < 6; o++) e.deleteFramebuffer(n.__webglFramebuffer[o]), n.__webglDepthbuffer && e.deleteRenderbuffer(n.__webglDepthbuffer[o]) else e.deleteFramebuffer(n.__webglFramebuffer), n.__webglDepthbuffer && e.deleteRenderbuffer(n.__webglDepthbuffer), n.__webglMultisampledFramebuffer && e.deleteFramebuffer(n.__webglMultisampledFramebuffer), n.__webglColorRenderbuffer && e.deleteRenderbuffer(n.__webglColorRenderbuffer), n.__webglDepthRenderbuffer && e.deleteRenderbuffer(n.__webglDepthRenderbuffer) r.remove(t.texture), r.remove(t) } } var L = 0 function R() { L = 0 } function P() { var e = L return ( e >= h && console.warn( 'THREE.WebGLTextures: Trying to use ' + e + ' texture units while this GPU supports only ' + h, ), (L += 1), e ) } function D(e, t) { var i = r.get(e) if ( (e.isVideoTexture && Z(e), e.version > 0 && i.__version !== e.version) ) { var o = e.image if (void 0 === o) console.warn( 'THREE.WebGLRenderer: Texture marked for update but image is undefined', ) else { if (!1 !== o.complete) return void H(i, e, t) console.warn( 'THREE.WebGLRenderer: Texture marked for update but image is incomplete', ) } } n.activeTexture(33984 + t), n.bindTexture(3553, i.__webglTexture) } function O(e, t) { var i = r.get(e) e.version > 0 && i.__version !== e.version ? H(i, e, t) : (n.activeTexture(33984 + t), n.bindTexture(35866, i.__webglTexture)) } function I(e, t) { var i = r.get(e) e.version > 0 && i.__version !== e.version ? H(i, e, t) : (n.activeTexture(33984 + t), n.bindTexture(32879, i.__webglTexture)) } function B(e, t) { var i = r.get(e) e.version > 0 && i.__version !== e.version ? G(i, e, t) : (n.activeTexture(33984 + t), n.bindTexture(34067, i.__webglTexture)) } var F = (((s = {})[de] = 10497), (s[pe] = 33071), (s[fe] = 33648), s), k = (((l = {})[me] = 9728), (l[ve] = 9984), (l[ye] = 9986), (l[Ae] = 9729), (l[we] = 9985), (l[Ee] = 9987), l) function N(n, o, a) { a ? (e.texParameteri(n, 10242, F[o.wrapS]), e.texParameteri(n, 10243, F[o.wrapT]), (32879 !== n && 35866 !== n) || e.texParameteri(n, 32882, F[o.wrapR]), e.texParameteri(n, 10240, k[o.magFilter]), e.texParameteri(n, 10241, k[o.minFilter])) : (e.texParameteri(n, 10242, 33071), e.texParameteri(n, 10243, 33071), (32879 !== n && 35866 !== n) || e.texParameteri(n, 32882, 33071), (o.wrapS === pe && o.wrapT === pe) || 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, M(o.magFilter)), e.texParameteri(n, 10241, M(o.minFilter)), o.minFilter !== me && o.minFilter !== Ae && 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 (o.type === Pe && null === t.get('OES_texture_float_linear')) return if ( o.type === De && null === (u || t.get('OES_texture_half_float_linear')) ) return ;(o.anisotropy > 1 || r.get(o).__currentAnisotropy) && (e.texParameterf( n, s.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(o.anisotropy, i.getMaxAnisotropy()), ), (r.get(o).__currentAnisotropy = o.anisotropy)) } } function U(t, n) { void 0 === t.__webglInit && ((t.__webglInit = !0), n.addEventListener('dispose', _), (t.__webglTexture = e.createTexture()), a.memory.textures++) } function H(t, r, i) { var a = 3553 r.isDataTexture2DArray && (a = 35866), r.isDataTexture3D && (a = 32879), U(t, r), n.activeTexture(33984 + i), n.bindTexture(a, t.__webglTexture), e.pixelStorei(37440, r.flipY), e.pixelStorei(37441, r.premultiplyAlpha), e.pixelStorei(3317, r.unpackAlignment) var s, l = A(r) && !1 === b(r.image), c = y(r.image, l, !1, p), h = b(c) || u, d = o.convert(r.format), f = o.convert(r.type), m = E(r.internalFormat, d, f) N(a, r, h) var v = r.mipmaps if (r.isDepthTexture) (m = 6402), u ? (m = r.type === Pe ? 36012 : r.type === Re ? 33190 : r.type === Fe ? 35056 : 33189) : r.type === Pe && console.error( 'WebGLRenderer: Floating point depth texture requires WebGL2.', ), r.format === je && 6402 === m && r.type !== Ce && r.type !== Re && (console.warn( 'THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture.', ), (r.type = Ce), (f = o.convert(r.type))), r.format === Ve && 6402 === m && ((m = 34041), r.type !== Fe && (console.warn( 'THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture.', ), (r.type = Fe), (f = o.convert(r.type)))), n.texImage2D(3553, 0, m, c.width, c.height, 0, d, f, null) else if (r.isDataTexture) if (v.length > 0 && h) { for (var g = 0, M = v.length; g < M; g++) (s = v[g]), n.texImage2D(3553, g, m, s.width, s.height, 0, d, f, s.data) ;(r.generateMipmaps = !1), (t.__maxMipLevel = v.length - 1) } else n.texImage2D(3553, 0, m, c.width, c.height, 0, d, f, c.data), (t.__maxMipLevel = 0) else if (r.isCompressedTexture) { for (var _ = 0, T = v.length; _ < T; _++) (s = v[_]), r.format !== Ue && r.format !== Ne ? null !== d ? n.compressedTexImage2D(3553, _, m, s.width, s.height, 0, s.data) : console.warn( 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()', ) : n.texImage2D(3553, _, m, s.width, s.height, 0, d, f, s.data) t.__maxMipLevel = v.length - 1 } else if (r.isDataTexture2DArray) n.texImage3D(35866, 0, m, c.width, c.height, c.depth, 0, d, f, c.data), (t.__maxMipLevel = 0) else if (r.isDataTexture3D) n.texImage3D(32879, 0, m, c.width, c.height, c.depth, 0, d, f, c.data), (t.__maxMipLevel = 0) else if (v.length > 0 && h) { for (var S = 0, C = v.length; S < C; S++) (s = v[S]), n.texImage2D(3553, S, m, d, f, s) ;(r.generateMipmaps = !1), (t.__maxMipLevel = v.length - 1) } else n.texImage2D(3553, 0, m, d, f, c), (t.__maxMipLevel = 0) w(r, h) && x(a, r, c.width, c.height), (t.__version = r.version), r.onUpdate && r.onUpdate(r) } function G(t, r, i) { if (6 === r.image.length) { U(t, r), n.activeTexture(33984 + i), n.bindTexture(34067, t.__webglTexture), e.pixelStorei(37440, r.flipY), e.pixelStorei(37441, r.premultiplyAlpha), e.pixelStorei(3317, r.unpackAlignment) for ( var a = r && (r.isCompressedTexture || r.image[0].isCompressedTexture), s = r.image[0] && r.image[0].isDataTexture, l = [], c = 0; c < 6; c++ ) l[c] = a || s ? s ? r.image[c].image : r.image[c] : y(r.image[c], !1, !0, d) var h, p = l[0], f = b(p) || u, m = o.convert(r.format), v = o.convert(r.type), g = E(r.internalFormat, m, v) if ((N(34067, r, f), a)) { for (var A = 0; A < 6; A++) { h = l[A].mipmaps for (var M = 0; M < h.length; M++) { var _ = h[M] r.format !== Ue && r.format !== Ne ? null !== m ? n.compressedTexImage2D( 34069 + A, M, g, _.width, _.height, 0, _.data, ) : console.warn( 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()', ) : n.texImage2D( 34069 + A, M, g, _.width, _.height, 0, m, v, _.data, ) } } t.__maxMipLevel = h.length - 1 } else { h = r.mipmaps for (var T = 0; T < 6; T++) if (s) { n.texImage2D( 34069 + T, 0, g, l[T].width, l[T].height, 0, m, v, l[T].data, ) for (var S = 0; S < h.length; S++) { var C = h[S].image[T].image n.texImage2D( 34069 + T, S + 1, g, C.width, C.height, 0, m, v, C.data, ) } } else { n.texImage2D(34069 + T, 0, g, m, v, l[T]) for (var L = 0; L < h.length; L++) { var R = h[L] n.texImage2D(34069 + T, L + 1, g, m, v, R.image[T]) } } t.__maxMipLevel = h.length } w(r, f) && x(34067, r, p.width, p.height), (t.__version = r.version), r.onUpdate && r.onUpdate(r) } } function z(t, i, a, s) { var l = o.convert(i.texture.format), c = o.convert(i.texture.type), u = E(i.texture.internalFormat, l, c) n.texImage2D(s, 0, u, i.width, i.height, 0, l, c, null), e.bindFramebuffer(36160, t), e.framebufferTexture2D(36160, a, s, r.get(i.texture).__webglTexture, 0), e.bindFramebuffer(36160, null) } function j(t, n, r) { if ((e.bindRenderbuffer(36161, t), n.depthBuffer && !n.stencilBuffer)) { var i = 33189 if (r) { var a = n.depthTexture a && a.isDepthTexture && (a.type === Pe ? (i = 36012) : a.type === Re && (i = 33190)) var s = Q(n) e.renderbufferStorageMultisample(36161, s, i, n.width, n.height) } else e.renderbufferStorage(36161, i, n.width, n.height) e.framebufferRenderbuffer(36160, 36096, 36161, t) } else if (n.depthBuffer && n.stencilBuffer) { if (r) { var l = Q(n) e.renderbufferStorageMultisample(36161, l, 35056, n.width, n.height) } else e.renderbufferStorage(36161, 34041, n.width, n.height) e.framebufferRenderbuffer(36160, 33306, 36161, t) } else { var c = o.convert(n.texture.format), u = o.convert(n.texture.type), h = E(n.texture.internalFormat, c, u) if (r) { var d = Q(n) e.renderbufferStorageMultisample(36161, d, h, n.width, n.height) } else e.renderbufferStorage(36161, h, n.width, n.height) } e.bindRenderbuffer(36161, null) } function V(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', ) ;(r.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)), D(n.depthTexture, 0) var i = r.get(n.depthTexture).__webglTexture if (n.depthTexture.format === je) e.framebufferTexture2D(36160, 36096, 3553, i, 0) else { if (n.depthTexture.format !== Ve) throw new Error('Unknown depthTexture format') e.framebufferTexture2D(36160, 33306, 3553, i, 0) } } function W(t) { var n = r.get(t), i = !0 === t.isWebGLCubeRenderTarget if (t.depthTexture) { if (i) throw new Error( 'target.depthTexture not supported in Cube render targets', ) V(n.__webglFramebuffer, t) } else if (i) { n.__webglDepthbuffer = [] for (var o = 0; o < 6; o++) e.bindFramebuffer(36160, n.__webglFramebuffer[o]), (n.__webglDepthbuffer[o] = e.createRenderbuffer()), j(n.__webglDepthbuffer[o], t, !1) } else e.bindFramebuffer(36160, n.__webglFramebuffer), (n.__webglDepthbuffer = e.createRenderbuffer()), j(n.__webglDepthbuffer, t, !1) e.bindFramebuffer(36160, null) } function q(t) { var i = r.get(t), s = r.get(t.texture) t.addEventListener('dispose', T), (s.__webglTexture = e.createTexture()), a.memory.textures++ var l = !0 === t.isWebGLCubeRenderTarget, c = !0 === t.isWebGLMultisampleRenderTarget, h = b(t) || u if ( (!u || t.texture.format !== Ne || (t.texture.type !== Pe && t.texture.type !== De) || ((t.texture.format = Ue), console.warn( 'THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.', )), l) ) { i.__webglFramebuffer = [] for (var d = 0; d < 6; d++) i.__webglFramebuffer[d] = e.createFramebuffer() } else if (((i.__webglFramebuffer = e.createFramebuffer()), c)) if (u) { ;(i.__webglMultisampledFramebuffer = e.createFramebuffer()), (i.__webglColorRenderbuffer = e.createRenderbuffer()), e.bindRenderbuffer(36161, i.__webglColorRenderbuffer) var p = o.convert(t.texture.format), f = o.convert(t.texture.type), m = E(t.texture.internalFormat, p, f), v = Q(t) e.renderbufferStorageMultisample(36161, v, m, t.width, t.height), e.bindFramebuffer(36160, i.__webglMultisampledFramebuffer), e.framebufferRenderbuffer( 36160, 36064, 36161, i.__webglColorRenderbuffer, ), e.bindRenderbuffer(36161, null), t.depthBuffer && ((i.__webglDepthRenderbuffer = e.createRenderbuffer()), j(i.__webglDepthRenderbuffer, t, !0)), e.bindFramebuffer(36160, null) } else console.warn( 'THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.', ) if (l) { n.bindTexture(34067, s.__webglTexture), N(34067, t.texture, h) for (var g = 0; g < 6; g++) z(i.__webglFramebuffer[g], t, 36064, 34069 + g) w(t.texture, h) && x(34067, t.texture, t.width, t.height), n.bindTexture(34067, null) } else n.bindTexture(3553, s.__webglTexture), N(3553, t.texture, h), z(i.__webglFramebuffer, t, 36064, 3553), w(t.texture, h) && x(3553, t.texture, t.width, t.height), n.bindTexture(3553, null) t.depthBuffer && W(t) } function X(e) { var t = e.texture if (w(t, b(e) || u)) { var i = e.isWebGLCubeRenderTarget ? 34067 : 3553, o = r.get(t).__webglTexture n.bindTexture(i, o), x(i, t, e.width, e.height), n.bindTexture(i, null) } } function Y(t) { if (t.isWebGLMultisampleRenderTarget) if (u) { var n = r.get(t) e.bindFramebuffer(36008, n.__webglMultisampledFramebuffer), e.bindFramebuffer(36009, n.__webglFramebuffer) var i = t.width, o = t.height, a = 16384 t.depthBuffer && (a |= 256), t.stencilBuffer && (a |= 1024), e.blitFramebuffer(0, 0, i, o, 0, 0, i, o, a, 9728), e.bindFramebuffer(36160, n.__webglMultisampledFramebuffer) } else console.warn( 'THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.', ) } function Q(e) { return u && e.isWebGLMultisampleRenderTarget ? Math.min(f, e.samples) : 0 } function Z(e) { var t = a.render.frame m.get(e) !== t && (m.set(e, t), e.update()) } var K = !1, J = !1 function $(e, t) { e && e.isWebGLRenderTarget && (!1 === K && (console.warn( "THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead.", ), (K = !0)), (e = e.texture)), D(e, t) } function ee(e, t) { e && e.isWebGLCubeRenderTarget && (!1 === J && (console.warn( "THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead.", ), (J = !0)), (e = e.texture)), B(e, t) } ;(this.allocateTextureUnit = P), (this.resetTextureUnits = R), (this.setTexture2D = D), (this.setTexture2DArray = O), (this.setTexture3D = I), (this.setTextureCube = B), (this.setupRenderTarget = q), (this.updateRenderTargetMipmap = X), (this.updateMultisampleRenderTarget = Y), (this.safeSetTexture2D = $), (this.safeSetTextureCube = ee) } function nl(e, t, n) { var r = n.isWebGL2 function i(e) { var n if (e === _e) return 5121 if (e === Oe) return 32819 if (e === Ie) return 32820 if (e === Be) return 33635 if (e === Te) return 5120 if (e === Se) return 5122 if (e === Ce) return 5123 if (e === Le) return 5124 if (e === Re) return 5125 if (e === Pe) return 5126 if (e === De) return r ? 5131 : null !== (n = t.get('OES_texture_half_float')) ? n.HALF_FLOAT_OES : null if (e === ke) return 6406 if (e === Ne) return 6407 if (e === Ue) return 6408 if (e === He) return 6409 if (e === Ge) return 6410 if (e === je) return 6402 if (e === Ve) return 34041 if (e === We) return 6403 if (e === qe) return 36244 if (e === Xe) return 33319 if (e === Ye) return 33320 if (e === Qe) return 36248 if (e === Ze) return 36249 if (e === Ke || e === Je || e === $e || e === et) { if (null === (n = t.get('WEBGL_compressed_texture_s3tc'))) return null if (e === Ke) return n.COMPRESSED_RGB_S3TC_DXT1_EXT if (e === Je) return n.COMPRESSED_RGBA_S3TC_DXT1_EXT if (e === $e) return n.COMPRESSED_RGBA_S3TC_DXT3_EXT if (e === et) return n.COMPRESSED_RGBA_S3TC_DXT5_EXT } if (e === tt || e === nt || e === rt || e === it) { if (null === (n = t.get('WEBGL_compressed_texture_pvrtc'))) return null if (e === tt) return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG if (e === nt) return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG if (e === rt) return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG if (e === it) return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG } if (e === ot) return null !== (n = t.get('WEBGL_compressed_texture_etc1')) ? n.COMPRESSED_RGB_ETC1_WEBGL : null if ( (e === at || e === st) && null !== (n = t.get('WEBGL_compressed_texture_etc')) ) { if (e === at) return n.COMPRESSED_RGB8_ETC2 if (e === st) return n.COMPRESSED_RGBA8_ETC2_EAC } return e === lt || e === ct || e === ut || e === ht || e === dt || e === pt || e === ft || e === mt || e === vt || e === gt || e === yt || e === bt || e === At || e === wt || e === Et || e === Mt || e === _t || e === Tt || e === St || e === Ct || e === Lt || e === Rt || e === Pt || e === Dt || e === Ot || e === It || e === Bt || e === Ft ? null !== (n = t.get('WEBGL_compressed_texture_astc')) ? e : null : e === xt ? null !== (n = t.get('EXT_texture_compression_bptc')) ? e : null : e === Fe ? r ? 34042 : null !== (n = t.get('WEBGL_depth_texture')) ? n.UNSIGNED_INT_24_8_WEBGL : null : void 0 } return { convert: i } } function rl() { si.call(this), (this.type = 'Group') } function il(e) { void 0 === e && (e = []), Oo.call(this), (this.cameras = e) } ;(rl.prototype = Object.assign(Object.create(si.prototype), { constructor: rl, isGroup: !0, })), (il.prototype = Object.assign(Object.create(Oo.prototype), { constructor: il, isArrayCamera: !0, })) var ol = new lr(), al = new lr() function sl(e, t, n) { ol.setFromMatrixPosition(t.matrixWorld), al.setFromMatrixPosition(n.matrixWorld) var r = ol.distanceTo(al), i = t.projectionMatrix.elements, o = n.projectionMatrix.elements, a = i[14] / (i[10] - 1), s = i[14] / (i[10] + 1), l = (i[9] + 1) / i[5], c = (i[9] - 1) / i[5], u = (i[8] - 1) / i[0], h = (o[8] + 1) / o[0], d = a * u, p = a * h, f = r / (-u + h), m = f * -u 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 = a + f, g = s + f, y = d - m, b = p + (r - m), A = ((l * s) / g) * v, w = ((c * s) / g) * v e.projectionMatrix.makePerspective(y, b, A, w, v, g) } function ll(e) { var t, n, r = this, i = null, o = null, a = null, s = [], l = new Fr(), c = new Fr(), u = 1, h = 'local-floor' 'undefined' !== typeof window && 'VRFrameData' in window && ((o = new window.VRFrameData()), window.addEventListener('vrdisplaypresentchange', A, !1)) var d = new Fr(), p = new sr(), f = new lr(), m = new Oo() ;(m.viewport = new ir()), m.layers.enable(1) var v = new Oo() ;(v.viewport = new ir()), v.layers.enable(2) var g = new il([m, v]) g.layers.enable(1), g.layers.enable(2) var y, b = new Jn() function A() { if ((r.isPresenting = null !== i && !0 === i.isPresenting)) { var o = i.getEyeParameters('left') ;(t = 2 * o.renderWidth * u), (n = o.renderHeight * u), (y = e.getPixelRatio()), e.getSize(b), e.setDrawingBufferSize(t, n, 1), m.viewport.set(0, 0, t / 2, n), v.viewport.set(t / 2, 0, t / 2, n), T.start(), r.dispatchEvent({ type: 'sessionstart' }) } else r.enabled && e.setDrawingBufferSize(b.width, b.height, y), T.stop(), r.dispatchEvent({ type: 'sessionend' }) } var w = [], x = [] function E(e) { for ( var t = navigator.getGamepads && navigator.getGamepads(), n = 0, r = t.length; n < r; n++ ) { var i = t[n] if ( i && ('Daydream Controller' === i.id || 'Gear VR Controller' === i.id || 'Oculus Go Controller' === i.id || 'OpenVR Gamepad' === i.id || i.id.startsWith('Oculus Touch') || i.id.startsWith('HTC Vive Focus') || i.id.startsWith('Spatial Controller')) ) { var o = i.hand if (0 === e && ('' === o || 'right' === o)) return i if (1 === e && 'left' === o) return i } } } function M() { for (var e = 0; e < s.length; e++) { var t = s[e], n = E(e) if (void 0 !== n && void 0 !== n.pose) { if (null === n.pose) return var r = n.pose !1 === r.hasPosition && t.position.set(0.2, -0.6, -0.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(l), t.matrix.decompose(t.position, t.quaternion, t.scale), (t.matrixWorldNeedsUpdate = !0), (t.visible = !0) var i = 'Daydream Controller' === n.id ? 0 : 1 void 0 === w[e] && (w[e] = !1), w[e] !== n.buttons[i].pressed && ((w[e] = n.buttons[i].pressed), !0 === w[e] ? t.dispatchEvent({ type: 'selectstart' }) : (t.dispatchEvent({ type: 'selectend' }), t.dispatchEvent({ type: 'select' }))), (i = 2), void 0 === x[e] && (x[e] = !1), void 0 !== n.buttons[i] && x[e] !== n.buttons[i].pressed && ((x[e] = n.buttons[i].pressed), !0 === x[e] ? t.dispatchEvent({ type: 'squeezestart' }) : (t.dispatchEvent({ type: 'squeezeend' }), t.dispatchEvent({ type: 'squeeze' }))) } else t.visible = !1 } } function _(e, r) { null !== r && 4 === r.length && e.set(r[0] * t, r[1] * n, r[2] * t, r[3] * n) } ;(this.enabled = !1), (this.getController = function (e) { var t = s[e] return ( void 0 === t && (((t = new rl()).matrixAutoUpdate = !1), (t.visible = !1), (s[e] = t)), t ) }), (this.getDevice = function () { return i }), (this.setDevice = function (e) { void 0 !== e && (i = e), T.setContext(e) }), (this.setFramebufferScaleFactor = function (e) { u = e }), (this.setReferenceSpaceType = function (e) { h = e }), (this.setPoseTarget = function (e) { void 0 !== e && (a = e) }), (this.getCamera = function (e) { var t = 'local-floor' === h ? 1.6 : 0 if ( ((i.depthNear = e.near), (i.depthFar = e.far), i.getFrameData(o), 'local-floor' === h) ) { var n = i.stageParameters n ? l.fromArray(n.sittingToStandingTransform) : l.makeTranslation(0, t, 0) } var r = o.pose, s = null !== a ? a : e s.matrix.copy(l), s.matrix.decompose(s.position, s.quaternion, s.scale), null !== r.orientation && (p.fromArray(r.orientation), s.quaternion.multiply(p)), null !== r.position && (p.setFromRotationMatrix(l), f.fromArray(r.position), f.applyQuaternion(p), s.position.add(f)), s.updateMatrixWorld() for (var u = s.children, y = 0, b = u.length; y < b; y++) u[y].updateMatrixWorld(!0) ;(m.near = e.near), (v.near = e.near), (m.far = e.far), (v.far = e.far), m.matrixWorldInverse.fromArray(o.leftViewMatrix), v.matrixWorldInverse.fromArray(o.rightViewMatrix), c.getInverse(l), 'local-floor' === h && (m.matrixWorldInverse.multiply(c), v.matrixWorldInverse.multiply(c)) var A = s.parent null !== A && (d.getInverse(A.matrixWorld), m.matrixWorldInverse.multiply(d), v.matrixWorldInverse.multiply(d)), m.matrixWorld.getInverse(m.matrixWorldInverse), v.matrixWorld.getInverse(v.matrixWorldInverse), m.projectionMatrix.fromArray(o.leftProjectionMatrix), v.projectionMatrix.fromArray(o.rightProjectionMatrix), sl(g, m, v) var w = i.getLayers() if (w.length) { var x = w[0] _(m.viewport, x.leftBounds), _(v.viewport, x.rightBounds) } return M(), g }), (this.getStandingMatrix = function () { return l }), (this.isPresenting = !1) var T = new jo() ;(this.setAnimationLoop = function (e) { T.setAnimationLoop(e), this.isPresenting && T.start() }), (this.submitFrame = function () { this.isPresenting && i.submitFrame() }), (this.dispose = function () { 'undefined' !== typeof window && window.removeEventListener('vrdisplaypresentchange', A) }), (this.setFrameOfReferenceType = function () { console.warn( 'THREE.WebVRManager: setFrameOfReferenceType() has been deprecated.', ) }) } function cl() { ;(this._targetRay = null), (this._grip = null), (this._hand = null) } function ul(e, t) { var n, r = this, i = null, o = 1, a = null, s = 'local-floor', l = null, c = null, u = [], h = new Map(), d = [], p = new Oo() p.layers.enable(1), (p.viewport = new ir()) var f = new Oo() f.layers.enable(2), (f.viewport = new ir()) var m = [p, f], v = new il() v.layers.enable(1), v.layers.enable(2) var g = null, y = null function b(e) { var t = h.get(e.inputSource) t && t.dispatchEvent({ type: e.type, data: e.inputSource }) } function A() { h.forEach(function (e, t) { e.disconnect(t) }), h.clear(), (g = null), (y = null), e.setFramebuffer(null), e.setRenderTarget(e.getRenderTarget()), C.stop(), (r.isPresenting = !1), r.dispatchEvent({ type: 'sessionend' }) } function w(e) { for (var t = i.inputSources, n = 0; n < u.length; n++) h.set(t[n], u[n]) for (var r = 0; r < e.removed.length; r++) { var o = e.removed[r], a = h.get(o) a && (a.dispatchEvent({ type: 'disconnected', data: o }), h.delete(o)) } for (var s = 0; s < e.added.length; s++) { var l = e.added[s], c = h.get(l) c && c.dispatchEvent({ type: 'connected', data: l }) } } ;(this.layersEnabled = !1), (this.enabled = !1), (this.isPresenting = !1), (this.getCameraPose = function () { return l }), (this.getController = function (e) { var t = u[e] return void 0 === t && ((t = new cl()), (u[e] = t)), t.getTargetRaySpace() }), (this.getControllerGrip = function (e) { var t = u[e] return void 0 === t && ((t = new cl()), (u[e] = t)), t.getGripSpace() }), (this.getHand = function (e) { var t = u[e] return void 0 === t && ((t = new cl()), (u[e] = t)), t.getHandSpace() }), (this.setFramebufferScaleFactor = function (e) { ;(o = e), !0 === r.isPresenting && console.warn( 'THREE.WebXRManager: Cannot change framebuffer scale while presenting.', ) }), (this.setReferenceSpaceType = function (e) { ;(s = e), !0 === r.isPresenting && console.warn( 'THREE.WebXRManager: Cannot change reference space type while presenting.', ) }), (this.getReferenceSpace = function () { return a }), (this.getSession = function () { return i }), (this.setSession = (function () { var e = Nn( regeneratorRuntime.mark(function e(l) { var c, u return regeneratorRuntime.wrap( function (e) { for (;;) switch ((e.prev = e.next)) { case 0: if (null === (i = l)) { e.next = 24 break } if ( (i.addEventListener('select', b), i.addEventListener('selectstart', b), i.addEventListener('selectend', b), i.addEventListener('squeeze', b), i.addEventListener('squeezestart', b), i.addEventListener('squeezeend', b), i.addEventListener('end', A), i.addEventListener('inputsourceschange', w), !0 === (c = t.getContextAttributes()).xrCompatible) ) { e.next = 14 break } return (e.next = 14), t.makeXRCompatible() case 14: return ( (u = { antialias: c.antialias, alpha: c.alpha, depth: c.depth, stencil: c.stencil, framebufferScaleFactor: o, }), (n = new XRWebGLLayer(i, t, u)), window.XRWebGLBinding && this.layersEnabled ? this.addLayer(n) : i.updateRenderState({ baseLayer: n }), (e.next = 19), i.requestReferenceSpace(s) ) case 19: ;(a = e.sent), C.setContext(i), C.start(), (r.isPresenting = !0), r.dispatchEvent({ type: 'sessionstart' }) case 24: case 'end': return e.stop() } }, e, this, ) }), ) return function (t) { return e.apply(this, arguments) } })()), (this.addLayer = function (e) { window.XRWebGLBinding && this.layersEnabled && i && (d.push(e), i.updateRenderState({ layers: d })) }), (this.removeLayer = function (e) { window.XRWebGLBinding && this.layersEnabled && i && (d.splice(d.indexOf(e), 1), i.updateRenderState({ layers: d })) }) var x = new lr(), E = new lr() function M(e, t, n) { x.setFromMatrixPosition(t.matrixWorld), E.setFromMatrixPosition(n.matrixWorld) var r = x.distanceTo(E), i = t.projectionMatrix.elements, o = n.projectionMatrix.elements, a = i[14] / (i[10] - 1), s = i[14] / (i[10] + 1), l = (i[9] + 1) / i[5], c = (i[9] - 1) / i[5], u = (i[8] - 1) / i[0], h = (o[8] + 1) / o[0], d = a * u, p = a * h, f = r / (-u + h), m = f * -u 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.copy(e.matrixWorld).invert() var v = a + f, g = s + f, y = d - m, b = p + (r - m), A = ((l * s) / g) * v, w = ((c * s) / g) * v e.projectionMatrix.makePerspective(y, b, A, w, v, g) } function _(e, t) { null === t ? e.matrixWorld.copy(e.matrix) : e.matrixWorld.multiplyMatrices(t.matrixWorld, e.matrix), e.matrixWorldInverse.copy(e.matrixWorld).invert() } ;(this.setPoseTarget = function (e) { void 0 !== e && (c = e) }), (this.getCamera = function (e) { ;(v.near = f.near = p.near = e.near), (v.far = f.far = p.far = e.far), (g === v.near && y === v.far) || (i.updateRenderState({ depthNear: v.near, depthFar: v.far }), (g = v.near), (y = v.far)) var t = e.parent, n = v.cameras, r = c || e _(v, t) for (var o = 0; o < n.length; o++) _(n[o], t) r.matrixWorld.copy(v.matrixWorld) for (var a = r.children, s = 0, l = a.length; s < l; s++) a[s].updateMatrixWorld(!0) return ( 2 === n.length ? M(v, p, f) : v.projectionMatrix.copy(p.projectionMatrix), v ) }) var T = null function S(t, r) { if (null !== (l = r.getViewerPose(a))) { var o = l.views e.setFramebuffer(n.framebuffer) var s = !1 o.length !== v.cameras.length && ((v.cameras.length = 0), (s = !0)) for (var c = 0; c < o.length; c++) { var h = o[c], d = n.getViewport(h), p = m[c] p.matrix.fromArray(h.transform.matrix), p.projectionMatrix.fromArray(h.projectionMatrix), p.viewport.set(d.x, d.y, d.width, d.height), 0 === c && v.matrix.copy(p.matrix), !0 === s && v.cameras.push(p) } } for (var f = i.inputSources, g = 0; g < u.length; g++) { var y = u[g], b = f[g] y.update(b, r, a) } T && T(t, r) } var C = new jo() C.setAnimationLoop(S), (this.setAnimationLoop = function (e) { T = e }), (this.dispose = function () {}) } function hl(e) { function t(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 n(e, t, n, v) { t.isMeshBasicMaterial ? r(e, t) : t.isMeshLambertMaterial ? (r(e, t), l(e, t)) : t.isMeshToonMaterial ? (r(e, t), u(e, t)) : t.isMeshPhongMaterial ? (r(e, t), c(e, t)) : t.isMeshStandardMaterial ? (r(e, t), t.isMeshPhysicalMaterial ? d(e, t) : h(e, t)) : t.isMeshMatcapMaterial ? (r(e, t), p(e, t)) : t.isMeshDepthMaterial ? (r(e, t), f(e, t)) : t.isMeshDistanceMaterial ? (r(e, t), m(e, t)) : t.isMeshNormalMaterial ? (r(e, t), g(e, t)) : t.isLineBasicMaterial ? (i(e, t), t.isLineDashedMaterial && o(e, t)) : t.isPointsMaterial ? a(e, t, n, v) : t.isSpriteMaterial ? s(e, t) : t.isShadowMaterial ? (e.color.value.copy(t.color), (e.opacity.value = t.opacity)) : t.isShaderMaterial && (t.uniformsNeedUpdate = !1) } function r(t, n) { ;(t.opacity.value = n.opacity), n.color && t.diffuse.value.copy(n.color), n.emissive && t.emissive.value.copy(n.emissive).multiplyScalar(n.emissiveIntensity), n.map && (t.map.value = n.map), n.alphaMap && (t.alphaMap.value = n.alphaMap), n.specularMap && (t.specularMap.value = n.specularMap) var r, i, o = e.get(n).envMap if (o) { ;(t.envMap.value = o), (t.flipEnvMap.value = o.isCubeTexture && o._needsFlipEnvMap ? -1 : 1), (t.reflectivity.value = n.reflectivity), (t.refractionRatio.value = n.refractionRatio) var a = e.get(o).__maxMipLevel void 0 !== a && (t.maxMipLevel.value = a) } n.lightMap && ((t.lightMap.value = n.lightMap), (t.lightMapIntensity.value = n.lightMapIntensity)), n.aoMap && ((t.aoMap.value = n.aoMap), (t.aoMapIntensity.value = n.aoMapIntensity)), n.map ? (r = n.map) : n.specularMap ? (r = n.specularMap) : n.displacementMap ? (r = n.displacementMap) : n.normalMap ? (r = n.normalMap) : n.bumpMap ? (r = n.bumpMap) : n.roughnessMap ? (r = n.roughnessMap) : n.metalnessMap ? (r = n.metalnessMap) : n.alphaMap ? (r = n.alphaMap) : n.emissiveMap ? (r = n.emissiveMap) : n.clearcoatMap ? (r = n.clearcoatMap) : n.clearcoatNormalMap ? (r = n.clearcoatNormalMap) : n.clearcoatRoughnessMap && (r = n.clearcoatRoughnessMap), void 0 !== r && (r.isWebGLRenderTarget && (r = r.texture), !0 === r.matrixAutoUpdate && r.updateMatrix(), t.uvTransform.value.copy(r.matrix)), n.aoMap ? (i = n.aoMap) : n.lightMap && (i = n.lightMap), void 0 !== i && (i.isWebGLRenderTarget && (i = i.texture), !0 === i.matrixAutoUpdate && i.updateMatrix(), t.uv2Transform.value.copy(i.matrix)) } function i(e, t) { e.diffuse.value.copy(t.color), (e.opacity.value = t.opacity) } function o(e, t) { ;(e.dashSize.value = t.dashSize), (e.totalSize.value = t.dashSize + t.gapSize), (e.scale.value = t.scale) } function a(e, t, n, r) { var i e.diffuse.value.copy(t.color), (e.opacity.value = t.opacity), (e.size.value = t.size * n), (e.scale.value = 0.5 * r), t.map && (e.map.value = t.map), t.alphaMap && (e.alphaMap.value = t.alphaMap), t.map ? (i = t.map) : t.alphaMap && (i = t.alphaMap), void 0 !== i && (!0 === i.matrixAutoUpdate && i.updateMatrix(), e.uvTransform.value.copy(i.matrix)) } function s(e, t) { var n 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), 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 l(e, t) { t.emissiveMap && (e.emissiveMap.value = t.emissiveMap) } function c(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 === v && (e.bumpScale.value *= -1)), t.normalMap && ((e.normalMap.value = t.normalMap), e.normalScale.value.copy(t.normalScale), t.side === v && e.normalScale.value.negate()), t.displacementMap && ((e.displacementMap.value = t.displacementMap), (e.displacementScale.value = t.displacementScale), (e.displacementBias.value = t.displacementBias)) } function u(e, t) { 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 === v && (e.bumpScale.value *= -1)), t.normalMap && ((e.normalMap.value = t.normalMap), e.normalScale.value.copy(t.normalScale), t.side === v && e.normalScale.value.negate()), t.displacementMap && ((e.displacementMap.value = t.displacementMap), (e.displacementScale.value = t.displacementScale), (e.displacementBias.value = t.displacementBias)) } function h(t, n) { ;(t.roughness.value = n.roughness), (t.metalness.value = n.metalness), n.roughnessMap && (t.roughnessMap.value = n.roughnessMap), n.metalnessMap && (t.metalnessMap.value = n.metalnessMap), n.emissiveMap && (t.emissiveMap.value = n.emissiveMap), n.bumpMap && ((t.bumpMap.value = n.bumpMap), (t.bumpScale.value = n.bumpScale), n.side === v && (t.bumpScale.value *= -1)), n.normalMap && ((t.normalMap.value = n.normalMap), t.normalScale.value.copy(n.normalScale), n.side === v && t.normalScale.value.negate()), n.displacementMap && ((t.displacementMap.value = n.displacementMap), (t.displacementScale.value = n.displacementScale), (t.displacementBias.value = n.displacementBias)), e.get(n).envMap && (t.envMapIntensity.value = n.envMapIntensity) } function d(e, t) { h(e, t), (e.reflectivity.value = t.reflectivity), (e.clearcoat.value = t.clearcoat), (e.clearcoatRoughness.value = t.clearcoatRoughness), t.sheen && e.sheen.value.copy(t.sheen), t.clearcoatMap && (e.clearcoatMap.value = t.clearcoatMap), t.clearcoatRoughnessMap && (e.clearcoatRoughnessMap.value = t.clearcoatRoughnessMap), t.clearcoatNormalMap && (e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale), (e.clearcoatNormalMap.value = t.clearcoatNormalMap), t.side === v && e.clearcoatNormalScale.value.negate()), (e.transmission.value = t.transmission), t.transmissionMap && (e.transmissionMap.value = t.transmissionMap) } function p(e, t) { t.matcap && (e.matcap.value = t.matcap), t.bumpMap && ((e.bumpMap.value = t.bumpMap), (e.bumpScale.value = t.bumpScale), t.side === v && (e.bumpScale.value *= -1)), t.normalMap && ((e.normalMap.value = t.normalMap), e.normalScale.value.copy(t.normalScale), t.side === v && e.normalScale.value.negate()), t.displacementMap && ((e.displacementMap.value = t.displacementMap), (e.displacementScale.value = t.displacementScale), (e.displacementBias.value = t.displacementBias)) } function f(e, t) { t.displacementMap && ((e.displacementMap.value = t.displacementMap), (e.displacementScale.value = t.displacementScale), (e.displacementBias.value = t.displacementBias)) } function m(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 g(e, t) { t.bumpMap && ((e.bumpMap.value = t.bumpMap), (e.bumpScale.value = t.bumpScale), t.side === v && (e.bumpScale.value *= -1)), t.normalMap && ((e.normalMap.value = t.normalMap), e.normalScale.value.copy(t.normalScale), t.side === v && e.normalScale.value.negate()), t.displacementMap && ((e.displacementMap.value = t.displacementMap), (e.displacementScale.value = t.displacementScale), (e.displacementBias.value = t.displacementBias)) } return { refreshFogUniforms: t, refreshMaterialUniforms: n } } function dl() { var e = document.createElementNS('http://www.w3.org/1999/xhtml', 'canvas') return (e.style.display = 'block'), e } function pl(e) { var t = void 0 !== (e = e || {}).canvas ? e.canvas : dl(), n = void 0 !== e.context ? e.context : null, r = void 0 !== e.alpha && e.alpha, i = void 0 === e.depth || e.depth, o = void 0 === e.stencil || e.stencil, a = void 0 !== e.antialias && e.antialias, s = void 0 === e.premultipliedAlpha || e.premultipliedAlpha, l = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer, c = void 0 !== e.powerPreference ? e.powerPreference : 'default', u = void 0 !== e.failIfMajorPerformanceCaveat && e.failIfMajorPerformanceCaveat, h = null, d = null, p = [] ;(this.domElement = t), (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 = Kt), (this.physicallyCorrectLights = !1), (this.toneMapping = $), (this.toneMappingExposure = 1), (this.maxMorphTargets = 8), (this.maxMorphNormals = 4) var f = this, m = !1, v = null, g = 0, y = 0, b = null, A = null, w = -1, x = null, E = new ir(), M = new ir(), _ = null, T = t.width, S = t.height, C = 1, L = null, R = null, P = new ir(0, 0, T, S), D = new ir(0, 0, T, S), O = !1, I = new zo(), B = !1, F = !1, k = new Fr(), N = new lr(), U = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: !0, } function H() { return null === b ? C : 1 } var G, z, j, V, W, q, X, Y, Q, Z, K, J, ee, te, ne, re, ie, oe, ae, se, le, ce = n function ue(e, n) { for (var r = 0; r < e.length; r++) { var i = e[r], o = t.getContext(i, n) if (null !== o) return o } return null } try { var he = { alpha: r, depth: i, stencil: o, antialias: a, premultipliedAlpha: s, preserveDrawingBuffer: l, powerPreference: c, failIfMajorPerformanceCaveat: u, } if ( (t.addEventListener('webglcontextlost', ve, !1), t.addEventListener('webglcontextrestored', ge, !1), null === ce) ) { var de = ['webgl2', 'webgl', 'experimental-webgl'] if ((!0 === f.isWebGL1Renderer && de.shift(), null === (ce = ue(de, he)))) throw ue(de) ? new Error( 'Error creating WebGL context with your selected attributes.', ) : new Error('Error creating WebGL context.') } void 0 === ce.getShaderPrecisionFormat && (ce.getShaderPrecisionFormat = function () { return { rangeMin: 1, rangeMax: 1, precision: 1 } }) } catch (Be) { throw (console.error('THREE.WebGLRenderer: ' + Be.message), Be) } function pe() { ;(G = new ta(ce)), (z = new Jo(ce, G, e)), G.init(z), (se = new nl(ce, G, z)), (j = new el(ce, G, z)).scissor(M.copy(D).multiplyScalar(C).floor()), j.viewport(E.copy(P).multiplyScalar(C).floor()), (V = new ia(ce)), (W = new ks()), (q = new tl(ce, G, j, W, z, se, V)), (X = new ea(f)), (Y = new Vo(ce, z)), (le = new Zo(ce, G, Y, z)), (Q = new na(ce, Y, V, le)), (Z = new la(ce, Q, Y, V)), (ie = new sa(ce)), (ne = new $o(W)), (K = new Fs(f, X, G, z, le, ne)), (J = new hl(W)), (ee = new Gs(W)), (te = new Ys(G, z)), (re = new Qo(f, X, j, Z, s)), (oe = new Ko(ce, G, V, z)), (ae = new ra(ce, G, V, z)), (V.programs = K.programs), (f.capabilities = z), (f.extensions = G), (f.properties = W), (f.renderLists = ee), (f.state = j), (f.info = V) } pe() var fe = 'undefined' !== typeof navigator && 'xr' in navigator ? new ul(f, ce) : new ll(f) this.xr = fe var me = new $s(f, Z, z.maxTextureSize) function ve(e) { e.preventDefault(), console.log('THREE.WebGLRenderer: Context Lost.'), (m = !0) } function ge() { console.log('THREE.WebGLRenderer: Context Restored.'), (m = !1), pe() } function ye(e) { var t = e.target t.removeEventListener('dispose', ye), be(t) } function be(e) { Ae(e), W.remove(e) } function Ae(e) { var t = W.get(e).program void 0 !== t && K.releaseProgram(t) } function we(e, t) { e.render(function (e) { f.renderBufferImmediate(e, t) }) } ;(this.shadowMap = me), (this.getContext = function () { return ce }), (this.getContextAttributes = function () { return ce.getContextAttributes() }), (this.forceContextLoss = function () { var e = G.get('WEBGL_lose_context') e && e.loseContext() }), (this.forceContextRestore = function () { var e = G.get('WEBGL_lose_context') e && e.restoreContext() }), (this.getPixelRatio = function () { return C }), (this.setPixelRatio = function (e) { void 0 !== e && ((C = e), this.setSize(T, S, !1)) }), (this.getSize = function (e) { return ( void 0 === e && (console.warn( 'WebGLRenderer: .getsize() now requires a Vector2 as an argument', ), (e = new Jn())), e.set(T, S) ) }), (this.setSize = function (e, n, r) { fe.isPresenting ? console.warn( "THREE.WebGLRenderer: Can't change size while VR device is presenting.", ) : ((T = e), (S = n), (t.width = Math.floor(e * C)), (t.height = Math.floor(n * C)), !1 !== r && ((t.style.width = e + 'px'), (t.style.height = n + 'px')), this.setViewport(0, 0, e, n)) }), (this.getDrawingBufferSize = function (e) { return ( void 0 === e && (console.warn( 'WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument', ), (e = new Jn())), e.set(T * C, S * C).floor() ) }), (this.setDrawingBufferSize = function (e, n, r) { ;(T = e), (S = n), (C = r), (t.width = Math.floor(e * r)), (t.height = Math.floor(n * r)), this.setViewport(0, 0, e, n) }), (this.getCurrentViewport = function (e) { return ( void 0 === e && (console.warn( 'WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument', ), (e = new ir())), e.copy(E) ) }), (this.getViewport = function (e) { return e.copy(P) }), (this.setViewport = function (e, t, n, r) { e.isVector4 ? P.set(e.x, e.y, e.z, e.w) : P.set(e, t, n, r), j.viewport(E.copy(P).multiplyScalar(C).floor()) }), (this.getScissor = function (e) { return e.copy(D) }), (this.setScissor = function (e, t, n, r) { e.isVector4 ? D.set(e.x, e.y, e.z, e.w) : D.set(e, t, n, r), j.scissor(M.copy(D).multiplyScalar(C).floor()) }), (this.getScissorTest = function () { return O }), (this.setScissorTest = function (e) { j.setScissorTest((O = e)) }), (this.setOpaqueSort = function (e) { L = e }), (this.setTransparentSort = function (e) { R = e }), (this.getClearColor = function (e) { return ( void 0 === e && (console.warn( 'WebGLRenderer: .getClearColor() now requires a Color as an argument', ), (e = new Li())), e.copy(re.getClearColor()) ) }), (this.setClearColor = function () { re.setClearColor.apply(re, arguments) }), (this.getClearAlpha = function () { return re.getClearAlpha() }), (this.setClearAlpha = function () { re.setClearAlpha.apply(re, arguments) }), (this.clear = function (e, t, n) { var r = 0 ;(void 0 === e || e) && (r |= 16384), (void 0 === t || t) && (r |= 256), (void 0 === n || n) && (r |= 1024), ce.clear(r) }), (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 () { t.removeEventListener('webglcontextlost', ve, !1), t.removeEventListener('webglcontextrestored', ge, !1), ee.dispose(), te.dispose(), W.dispose(), X.dispose(), Z.dispose(), le.dispose(), fe.dispose(), Me.stop() }), (this.renderBufferImmediate = function (e, t) { le.initAttributes() var n = W.get(e) e.hasPositions && !n.position && (n.position = ce.createBuffer()), e.hasNormals && !n.normal && (n.normal = ce.createBuffer()), e.hasUvs && !n.uv && (n.uv = ce.createBuffer()), e.hasColors && !n.color && (n.color = ce.createBuffer()) var r = t.getAttributes() e.hasPositions && (ce.bindBuffer(34962, n.position), ce.bufferData(34962, e.positionArray, 35048), le.enableAttribute(r.position), ce.vertexAttribPointer(r.position, 3, 5126, !1, 0, 0)), e.hasNormals && (ce.bindBuffer(34962, n.normal), ce.bufferData(34962, e.normalArray, 35048), le.enableAttribute(r.normal), ce.vertexAttribPointer(r.normal, 3, 5126, !1, 0, 0)), e.hasUvs && (ce.bindBuffer(34962, n.uv), ce.bufferData(34962, e.uvArray, 35048), le.enableAttribute(r.uv), ce.vertexAttribPointer(r.uv, 2, 5126, !1, 0, 0)), e.hasColors && (ce.bindBuffer(34962, n.color), ce.bufferData(34962, e.colorArray, 35048), le.enableAttribute(r.color), ce.vertexAttribPointer(r.color, 3, 5126, !1, 0, 0)), le.disableUnusedAttributes(), ce.drawArrays(4, 0, e.count), (e.count = 0) }), (this.renderBufferDirect = function (e, t, n, r, i, o) { null === t && (t = U) var a = i.isMesh && i.matrixWorld.determinant() < 0, s = Re(e, t, r, i) j.setMaterial(r, a) var l = n.index, c = n.attributes.position if (null === l) { if (void 0 === c || 0 === c.count) return } else if (0 === l.count) return var u, h = 1 !0 === r.wireframe && ((l = Q.getWireframeAttribute(n)), (h = 2)), (r.morphTargets || r.morphNormals) && ie.update(i, n, r, s), le.setup(i, r, s, n, l) var d = oe null !== l && ((u = Y.get(l)), (d = ae).setIndex(u)) var p = null !== l ? l.count : c.count, f = n.drawRange.start * h, m = n.drawRange.count * h, v = null !== o ? o.start * h : 0, g = null !== o ? o.count * h : 1 / 0, y = Math.max(f, v), b = Math.min(p, f + m, v + g) - 1, A = Math.max(0, b - y + 1) if (0 !== A) { if (i.isMesh) !0 === r.wireframe ? (j.setLineWidth(r.wireframeLinewidth * H()), d.setMode(1)) : d.setMode(4) else if (i.isLine) { var w = r.linewidth void 0 === w && (w = 1), j.setLineWidth(w * H()), i.isLineSegments ? d.setMode(1) : i.isLineLoop ? d.setMode(2) : d.setMode(3) } else i.isPoints ? d.setMode(0) : i.isSprite && d.setMode(4) if (i.isInstancedMesh) d.renderInstances(y, A, i.count) else if (n.isInstancedBufferGeometry) { var x = Math.min(n.instanceCount, n._maxInstanceCount) d.renderInstances(y, A, x) } else d.render(y, A) } }), (this.compile = function (e, t) { ;(d = te.get(e)).init(), e.traverseVisible(function (e) { e.isLight && e.layers.test(t.layers) && (d.pushLight(e), e.castShadow && d.pushShadow(e)) }), d.setupLights() var n = new WeakMap() e.traverse(function (t) { var r = t.material if (r) if (Array.isArray(r)) for (var i = 0; i < r.length; i++) { var o = r[i] !1 === n.has(o) && (Le(o, e, t), n.set(o)) } else !1 === n.has(r) && (Le(r, e, t), n.set(r)) }) }) var xe = null function Ee(e) { fe.isPresenting || (xe && xe(e)) } var Me = new jo() function Te(e, t, n, r) { 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) d.pushLight(e), e.castShadow && d.pushShadow(e) else if (e.isSprite) { if (!e.frustumCulled || I.intersectsSprite(e)) { r && N.setFromMatrixPosition(e.matrixWorld).applyMatrix4(k) var i = Z.update(e), o = e.material o.visible && h.push(e, i, o, n, N.z, null) } } else if (e.isImmediateRenderObject) r && N.setFromMatrixPosition(e.matrixWorld).applyMatrix4(k), h.push(e, null, e.material, n, N.z, null) else if ( (e.isMesh || e.isLine || e.isPoints) && (e.isSkinnedMesh && e.skeleton.frame !== V.render.frame && (e.skeleton.update(), (e.skeleton.frame = V.render.frame)), !e.frustumCulled || I.intersectsObject(e)) ) { r && N.setFromMatrixPosition(e.matrixWorld).applyMatrix4(k) var a = Z.update(e), s = e.material if (Array.isArray(s)) for (var l = a.groups, c = 0, u = l.length; c < u; c++) { var p = l[c], f = s[p.materialIndex] f && f.visible && h.push(e, a, f, n, N.z, p) } else s.visible && h.push(e, a, s, n, N.z, null) } for (var m = e.children, v = 0, g = m.length; v < g; v++) Te(m[v], t, n, r) } } function Se(e, t, n) { for ( var r = !0 === t.isScene ? t.overrideMaterial : null, i = 0, o = e.length; i < o; i++ ) { var a = e[i], s = a.object, l = a.geometry, c = null === r ? a.material : r, u = a.group if (n.isArrayCamera) for (var h = n.cameras, p = 0, f = h.length; p < f; p++) { var m = h[p] s.layers.test(m.layers) && (j.viewport(E.copy(m.viewport)), d.setupLightsView(m), Ce(s, t, m, l, c, u)) } else Ce(s, t, n, l, c, u) } } function Ce(e, t, n, r, i, o) { if ( (e.onBeforeRender(f, t, n, r, i, o), e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse, e.matrixWorld), e.normalMatrix.getNormalMatrix(e.modelViewMatrix), e.isImmediateRenderObject) ) { var a = Re(n, t, i, e) j.setMaterial(i), le.reset(), we(e, a) } else f.renderBufferDirect(n, t, r, i, e, o) e.onAfterRender(f, t, n, r, i, o) } function Le(e, t, n) { !0 !== t.isScene && (t = U) var r = W.get(e), i = d.state.lights, o = d.state.shadowsArray, a = i.state.version, s = K.getParameters(e, i.state, o, t, n), l = K.getProgramCacheKey(s), c = r.program, u = !0 if ( ((r.environment = e.isMeshStandardMaterial ? t.environment : null), (r.fog = t.fog), (r.envMap = X.get(e.envMap || r.environment)), void 0 === c) ) e.addEventListener('dispose', ye) else if (c.cacheKey !== l) Ae(e) else if (r.lightsStateVersion !== a) u = !1 else { if (void 0 !== s.shaderID) return u = !1 } u && ((s.uniforms = K.getUniforms(e)), e.onBeforeCompile(s, f), (c = K.acquireProgram(s, l)), (r.program = c), (r.uniforms = s.uniforms), (r.outputEncoding = s.outputEncoding)) var h = r.uniforms ;((e.isShaderMaterial || e.isRawShaderMaterial) && !0 !== e.clipping) || ((r.numClippingPlanes = ne.numPlanes), (r.numIntersection = ne.numIntersection), (h.clippingPlanes = ne.uniform)), (r.needsLights = Ie(e)), (r.lightsStateVersion = a), r.needsLights && ((h.ambientLightColor.value = i.state.ambient), (h.lightProbe.value = i.state.probe), (h.directionalLights.value = i.state.directional), (h.directionalLightShadows.value = i.state.directionalShadow), (h.spotLights.value = i.state.spot), (h.spotLightShadows.value = i.state.spotShadow), (h.rectAreaLights.value = i.state.rectArea), (h.ltc_1.value = i.state.rectAreaLTC1), (h.ltc_2.value = i.state.rectAreaLTC2), (h.pointLights.value = i.state.point), (h.pointLightShadows.value = i.state.pointShadow), (h.hemisphereLights.value = i.state.hemi), (h.directionalShadowMap.value = i.state.directionalShadowMap), (h.directionalShadowMatrix.value = i.state.directionalShadowMatrix), (h.spotShadowMap.value = i.state.spotShadowMap), (h.spotShadowMatrix.value = i.state.spotShadowMatrix), (h.pointShadowMap.value = i.state.pointShadowMap), (h.pointShadowMatrix.value = i.state.pointShadowMatrix)) var p = r.program.getUniforms(), m = ss.seqWithValue(p.seq, h) r.uniformsList = m } function Re(e, t, n, r) { !0 !== t.isScene && (t = U), q.resetTextureUnits() var i = t.fog, o = n.isMeshStandardMaterial ? t.environment : null, a = null === b ? f.outputEncoding : b.texture.encoding, s = X.get(n.envMap || o), l = W.get(n), c = d.state.lights if (!0 === B && (!0 === F || e !== x)) { var u = e === x && n.id === w ne.setState(n, e, u) } n.version === l.__version ? (n.fog && l.fog !== i) || l.environment !== o || (l.needsLights && l.lightsStateVersion !== c.state.version) ? Le(n, t, r) : void 0 === l.numClippingPlanes || (l.numClippingPlanes === ne.numPlanes && l.numIntersection === ne.numIntersection) ? (l.outputEncoding !== a || l.envMap !== s) && Le(n, t, r) : Le(n, t, r) : (Le(n, t, r), (l.__version = n.version)) var h = !1, p = !1, m = !1, v = l.program, g = v.getUniforms(), y = l.uniforms if ( (j.useProgram(v.program) && ((h = !0), (p = !0), (m = !0)), n.id !== w && ((w = n.id), (p = !0)), h || x !== e) ) { if ( (g.setValue(ce, 'projectionMatrix', e.projectionMatrix), z.logarithmicDepthBuffer && g.setValue(ce, 'logDepthBufFC', 2 / (Math.log(e.far + 1) / Math.LN2)), x !== e && ((x = e), (p = !0), (m = !0)), n.isShaderMaterial || n.isMeshPhongMaterial || n.isMeshToonMaterial || n.isMeshStandardMaterial || n.envMap) ) { var A = g.map.cameraPosition void 0 !== A && A.setValue(ce, N.setFromMatrixPosition(e.matrixWorld)) } ;(n.isMeshPhongMaterial || n.isMeshToonMaterial || n.isMeshLambertMaterial || n.isMeshBasicMaterial || n.isMeshStandardMaterial || n.isShaderMaterial) && g.setValue(ce, 'isOrthographic', !0 === e.isOrthographicCamera), (n.isMeshPhongMaterial || n.isMeshToonMaterial || n.isMeshLambertMaterial || n.isMeshBasicMaterial || n.isMeshStandardMaterial || n.isShaderMaterial || n.isShadowMaterial || n.skinning) && g.setValue(ce, 'viewMatrix', e.matrixWorldInverse) } if (n.skinning) { g.setOptional(ce, r, 'bindMatrix'), g.setOptional(ce, r, 'bindMatrixInverse') var E = r.skeleton if (E) { var M = E.bones if (z.floatVertexTextures) { if (null === E.boneTexture) { var _ = Math.sqrt(4 * M.length) ;(_ = Kn.ceilPowerOfTwo(_)), (_ = Math.max(_, 4)) var T = new Float32Array(_ * _ * 4) T.set(E.boneMatrices) var L = new Uo(T, _, _, Ue, Pe) ;(E.boneMatrices = T), (E.boneTexture = L), (E.boneTextureSize = _) } g.setValue(ce, 'boneTexture', E.boneTexture, q), g.setValue(ce, 'boneTextureSize', E.boneTextureSize) } else g.setOptional(ce, E, 'boneMatrices') } } return ( (p || l.receiveShadow !== r.receiveShadow) && ((l.receiveShadow = r.receiveShadow), g.setValue(ce, 'receiveShadow', r.receiveShadow)), p && (g.setValue(ce, 'toneMappingExposure', f.toneMappingExposure), l.needsLights && Oe(y, m), i && n.fog && J.refreshFogUniforms(y, i), J.refreshMaterialUniforms(y, n, C, S), ss.upload(ce, l.uniformsList, y, q)), n.isShaderMaterial && !0 === n.uniformsNeedUpdate && (ss.upload(ce, l.uniformsList, y, q), (n.uniformsNeedUpdate = !1)), n.isSpriteMaterial && g.setValue(ce, 'center', r.center), g.setValue(ce, 'modelViewMatrix', r.modelViewMatrix), g.setValue(ce, 'normalMatrix', r.normalMatrix), g.setValue(ce, 'modelMatrix', r.matrixWorld), v ) } function Oe(e, t) { ;(e.ambientLightColor.needsUpdate = t), (e.lightProbe.needsUpdate = t), (e.directionalLights.needsUpdate = t), (e.directionalLightShadows.needsUpdate = t), (e.pointLights.needsUpdate = t), (e.pointLightShadows.needsUpdate = t), (e.spotLights.needsUpdate = t), (e.spotLightShadows.needsUpdate = t), (e.rectAreaLights.needsUpdate = t), (e.hemisphereLights.needsUpdate = t) } function Ie(e) { return ( e.isMeshLambertMaterial || e.isMeshToonMaterial || e.isMeshPhongMaterial || e.isMeshStandardMaterial || e.isShadowMaterial || (e.isShaderMaterial && !0 === e.lights) ) } Me.setAnimationLoop(Ee), 'undefined' !== typeof window && Me.setContext(window), (this.setAnimationLoop = function (e) { ;(xe = e), fe.setAnimationLoop(e), null === e ? Me.stop() : Me.start() }), (this.render = function (e, t) { var n, r 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.', ), (r = arguments[3])), void 0 === t || !0 === t.isCamera) ) { if (!0 !== m) { le.resetDefaultState(), (w = -1), (x = null), !0 === e.autoUpdate && e.updateMatrixWorld(), null === t.parent && t.updateMatrixWorld(), !0 === fe.enabled && !0 === fe.isPresenting && (t = fe.getCamera(t)), !0 === e.isScene && e.onBeforeRender(f, e, t, n || b), (d = te.get(e, p.length)).init(), p.push(d), k.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse), I.setFromProjectionMatrix(k), (F = this.localClippingEnabled), (B = ne.init(this.clippingPlanes, F, t)), (h = ee.get(e, t)).init(), Te(e, t, 0, f.sortObjects), h.finish(), !0 === f.sortObjects && h.sort(L, R), !0 === B && ne.beginShadows() var i = d.state.shadowsArray me.render(i, e, t), d.setupLights(), d.setupLightsView(t), !0 === B && ne.endShadows(), !0 === this.info.autoReset && this.info.reset(), void 0 !== n && this.setRenderTarget(n), re.render(h, e, t, r) var o = h.opaque, a = h.transparent o.length > 0 && Se(o, e, t), a.length > 0 && Se(a, e, t), !0 === e.isScene && e.onAfterRender(f, e, t), null !== b && (q.updateRenderTargetMipmap(b), q.updateMultisampleRenderTarget(b)), j.buffers.depth.setTest(!0), j.buffers.depth.setMask(!0), j.buffers.color.setMask(!0), j.setPolygonOffset(!1), fe.enabled && fe.submitFrame && fe.submitFrame(), p.pop(), (d = p.length > 0 ? p[p.length - 1] : null), (h = null) } } else console.error( 'THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.', ) }), (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)), q.setTexture2D(t, n) } })()), (this.setFramebuffer = function (e) { v !== e && null === b && ce.bindFramebuffer(36160, e), (v = e) }), (this.getActiveCubeFace = function () { return g }), (this.getActiveMipmapLevel = function () { return y }), (this.getRenderList = function () { return h }), (this.setRenderList = function (e) { h = e }), (this.getRenderTarget = function () { return b }), (this.setRenderTarget = function (e, t, n) { void 0 === t && (t = 0), void 0 === n && (n = 0), (b = e), (g = t), (y = n), e && void 0 === W.get(e).__webglFramebuffer && q.setupRenderTarget(e) var r = v, i = !1 if (e) { var o = W.get(e).__webglFramebuffer e.isWebGLCubeRenderTarget ? ((r = o[t]), (i = !0)) : (r = e.isWebGLMultisampleRenderTarget ? W.get(e).__webglMultisampledFramebuffer : o), E.copy(e.viewport), M.copy(e.scissor), (_ = e.scissorTest) } else E.copy(P).multiplyScalar(C).floor(), M.copy(D).multiplyScalar(C).floor(), (_ = O) if ( (A !== r && (ce.bindFramebuffer(36160, r), (A = r)), j.viewport(E), j.scissor(M), j.setScissorTest(_), i) ) { var a = W.get(e.texture) ce.framebufferTexture2D(36160, 36064, 34069 + t, a.__webglTexture, n) } }), (this.readRenderTargetPixels = function (e, t, n, r, i, o, a) { if (e && e.isWebGLRenderTarget) { var s = W.get(e).__webglFramebuffer if ((e.isWebGLCubeRenderTarget && void 0 !== a && (s = s[a]), s)) { var l = !1 s !== A && (ce.bindFramebuffer(36160, s), (l = !0)) try { var c = e.texture, u = c.format, h = c.type if (u !== Ue && se.convert(u) !== ce.getParameter(35739)) return void console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.', ) var d = h === De && (G.has('EXT_color_buffer_half_float') || (z.isWebGL2 && G.has('EXT_color_buffer_float'))) if ( h !== _e && se.convert(h) !== ce.getParameter(35738) && (h !== Pe || !( z.isWebGL2 || G.has('OES_texture_float') || G.has('WEBGL_color_buffer_float') )) && !d ) return void console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.', ) 36053 === ce.checkFramebufferStatus(36160) ? t >= 0 && t <= e.width - r && n >= 0 && n <= e.height - i && ce.readPixels(t, n, r, i, se.convert(u), se.convert(h), o) : console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.', ) } finally { l && ce.bindFramebuffer(36160, A) } } } else console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.', ) }), (this.copyFramebufferToTexture = function (e, t, n) { void 0 === n && (n = 0) var r = Math.pow(2, -n), i = Math.floor(t.image.width * r), o = Math.floor(t.image.height * r), a = se.convert(t.format) q.setTexture2D(t, 0), ce.copyTexImage2D(3553, n, a, e.x, e.y, i, o, 0), j.unbindTexture() }), (this.copyTextureToTexture = function (e, t, n, r) { void 0 === r && (r = 0) var i = t.image.width, o = t.image.height, a = se.convert(n.format), s = se.convert(n.type) q.setTexture2D(n, 0), ce.pixelStorei(37440, n.flipY), ce.pixelStorei(37441, n.premultiplyAlpha), ce.pixelStorei(3317, n.unpackAlignment), t.isDataTexture ? ce.texSubImage2D(3553, r, e.x, e.y, i, o, a, s, t.image.data) : t.isCompressedTexture ? ce.compressedTexSubImage2D( 3553, r, e.x, e.y, t.mipmaps[0].width, t.mipmaps[0].height, a, t.mipmaps[0].data, ) : ce.texSubImage2D(3553, r, e.x, e.y, a, s, t.image), 0 === r && n.generateMipmaps && ce.generateMipmap(3553), j.unbindTexture() }), (this.initTexture = function (e) { q.setTexture2D(e, 0), j.unbindTexture() }), (this.resetState = function () { j.reset(), le.reset() }), 'undefined' !== typeof __THREE_DEVTOOLS__ && __THREE_DEVTOOLS__.dispatchEvent( new CustomEvent('observe', { detail: this }), ) } function fl(e) { pl.call(this, e) } Object.assign(ll.prototype, qn.prototype), Object.assign(cl.prototype, { constructor: cl, getHandSpace: function () { return ( null === this._hand && ((this._hand = new rl()), (this._hand.matrixAutoUpdate = !1), (this._hand.visible = !1), (this._hand.joints = {}), (this._hand.inputState = { pinching: !1 })), this._hand ) }, getTargetRaySpace: function () { return ( null === this._targetRay && ((this._targetRay = new rl()), (this._targetRay.matrixAutoUpdate = !1), (this._targetRay.visible = !1)), this._targetRay ) }, getGripSpace: function () { return ( null === this._grip && ((this._grip = new rl()), (this._grip.matrixAutoUpdate = !1), (this._grip.visible = !1)), this._grip ) }, dispatchEvent: function (e) { return ( null !== this._targetRay && this._targetRay.dispatchEvent(e), null !== this._grip && this._grip.dispatchEvent(e), null !== this._hand && this._hand.dispatchEvent(e), this ) }, disconnect: function (e) { return ( this.dispatchEvent({ type: 'disconnected', data: e }), null !== this._targetRay && (this._targetRay.visible = !1), null !== this._grip && (this._grip.visible = !1), null !== this._hand && (this._hand.visible = !1), this ) }, update: function (e, t, n) { var r = null, i = null, o = null, a = this._targetRay, s = this._grip, l = this._hand if (e && 'visible-blurred' !== t.session.visibilityState) if (l && e.hand) { o = !0 for (var c, u = Wn(e.hand.values()); !(c = u()).done; ) { var h = c.value, d = t.getJointPose(h, n) if (void 0 === l.joints[h.jointName]) { var p = new rl() ;(p.matrixAutoUpdate = !1), (p.visible = !1), (l.joints[h.jointName] = p), l.add(p) } var f = l.joints[h.jointName] null !== d && (f.matrix.fromArray(d.transform.matrix), f.matrix.decompose(f.position, f.rotation, f.scale), (f.jointRadius = d.radius)), (f.visible = null !== d) } var m = l.joints['index-finger-tip'], v = l.joints['thumb-tip'], g = m.position.distanceTo(v.position), y = 0.02, b = 0.005 l.inputState.pinching && g > y + b ? ((l.inputState.pinching = !1), this.dispatchEvent({ type: 'pinchend', handedness: e.handedness, target: this, })) : !l.inputState.pinching && g <= y - b && ((l.inputState.pinching = !0), this.dispatchEvent({ type: 'pinchstart', handedness: e.handedness, target: this, })) } else null !== a && null !== (r = t.getPose(e.targetRaySpace, n)) && (a.matrix.fromArray(r.transform.matrix), a.matrix.decompose(a.position, a.rotation, a.scale)), null !== s && e.gripSpace && null !== (i = t.getPose(e.gripSpace, n)) && (s.matrix.fromArray(i.transform.matrix), s.matrix.decompose(s.position, s.rotation, s.scale)) return ( null !== a && (a.visible = null !== r), null !== s && (s.visible = null !== i), null !== l && (l.visible = null !== o), this ) }, }), Object.assign(ul.prototype, qn.prototype), (fl.prototype = Object.assign(Object.create(pl.prototype), { constructor: fl, isWebGL1Renderer: !0, })) var ml = (function () { function e(e, t) { Object.defineProperty(this, 'isFogExp2', { value: !0 }), (this.name = ''), (this.color = new Li(e)), (this.density = void 0 !== t ? t : 25e-5) } var t = e.prototype return ( (t.clone = function () { return new e(this.color, this.density) }), (t.toJSON = function () { return { type: 'FogExp2', color: this.color.getHex(), density: this.density, } }), e ) })(), vl = (function () { function e(e, t, n) { Object.defineProperty(this, 'isFog', { value: !0 }), (this.name = ''), (this.color = new Li(e)), (this.near = void 0 !== t ? t : 1), (this.far = void 0 !== n ? n : 1e3) } var t = e.prototype return ( (t.clone = function () { return new e(this.color, this.near, this.far) }), (t.toJSON = function () { return { type: 'Fog', color: this.color.getHex(), near: this.near, far: this.far, } }), e ) })(), gl = (function (e) { function t() { var t return ( (t = e.call(this) || this), Object.defineProperty(zn(t), 'isScene', { value: !0 }), (t.type = 'Scene'), (t.background = null), (t.environment = null), (t.fog = null), (t.overrideMaterial = null), (t.autoUpdate = !0), 'undefined' !== typeof __THREE_DEVTOOLS__ && __THREE_DEVTOOLS__.dispatchEvent( new CustomEvent('observe', { detail: zn(t) }), ), t ) } Gn(t, e) var n = t.prototype return ( (n.copy = function (t, n) { return ( e.prototype.copy.call(this, t, n), null !== t.background && (this.background = t.background.clone()), null !== t.environment && (this.environment = t.environment.clone()), null !== t.fog && (this.fog = t.fog.clone()), null !== t.overrideMaterial && (this.overrideMaterial = t.overrideMaterial.clone()), (this.autoUpdate = t.autoUpdate), (this.matrixAutoUpdate = t.matrixAutoUpdate), this ) }), (n.toJSON = function (t) { var n = e.prototype.toJSON.call(this, t) return ( null !== this.background && (n.object.background = this.background.toJSON(t)), null !== this.environment && (n.object.environment = this.environment.toJSON(t)), null !== this.fog && (n.object.fog = this.fog.toJSON()), n ) }), t ) })(si) function yl(e, t) { ;(this.array = e), (this.stride = t), (this.count = void 0 !== e ? e.length / t : 0), (this.usage = Tn), (this.updateRange = { offset: 0, count: -1 }), (this.version = 0), (this.uuid = Kn.generateUUID()) } Object.defineProperty(yl.prototype, 'needsUpdate', { set: function (e) { !0 === e && this.version++ }, }), Object.assign(yl.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 r = 0, i = this.stride; r < i; r++) this.array[e + r] = t.array[n + r] return this }, set: function (e, t) { return void 0 === t && (t = 0), this.array.set(e, t), this }, clone: function (e) { void 0 === e.arrayBuffers && (e.arrayBuffers = {}), void 0 === this.array.buffer._uuid && (this.array.buffer._uuid = Kn.generateUUID()), void 0 === e.arrayBuffers[this.array.buffer._uuid] && (e.arrayBuffers[this.array.buffer._uuid] = this.array.slice(0).buffer) var t = new yl( new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]), this.stride, ) return t.setUsage(this.usage), t }, onUpload: function (e) { return (this.onUploadCallback = e), this }, toJSON: function (e) { return ( void 0 === e.arrayBuffers && (e.arrayBuffers = {}), void 0 === this.array.buffer._uuid && (this.array.buffer._uuid = Kn.generateUUID()), void 0 === e.arrayBuffers[this.array.buffer._uuid] && (e.arrayBuffers[this.array.buffer._uuid] = Array.prototype.slice.call( new Uint32Array(this.array.buffer), )), { uuid: this.uuid, buffer: this.array.buffer._uuid, type: this.array.constructor.name, stride: this.stride, } ) }, }) var bl, Al = new lr() function wl(e, t, n, r) { ;(this.name = ''), (this.data = e), (this.itemSize = t), (this.offset = n), (this.normalized = !0 === r) } function xl(e) { Di.call(this), (this.type = 'SpriteMaterial'), (this.color = new Li(16777215)), (this.map = null), (this.alphaMap = null), (this.rotation = 0), (this.sizeAttenuation = !0), (this.transparent = !0), this.setValues(e) } Object.defineProperties(wl.prototype, { count: { get: function () { return this.data.count }, }, array: { get: function () { return this.data.array }, }, needsUpdate: { set: function (e) { this.data.needsUpdate = e }, }, }), Object.assign(wl.prototype, { isInterleavedBufferAttribute: !0, applyMatrix4: function (e) { for (var t = 0, n = this.data.count; t < n; t++) (Al.x = this.getX(t)), (Al.y = this.getY(t)), (Al.z = this.getZ(t)), Al.applyMatrix4(e), this.setXYZ(t, Al.x, Al.y, Al.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, 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] = r), this ) }, setXYZW: function (e, t, n, r, 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] = r), (this.data.array[e + 3] = i), this ) }, clone: function (e) { if (void 0 === e) { console.log( 'THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.', ) for (var t = [], n = 0; n < this.count; n++) for ( var r = n * this.data.stride + this.offset, i = 0; i < this.itemSize; i++ ) t.push(this.data.array[r + i]) return new Fi( new this.array.constructor(t), this.itemSize, this.normalized, ) } return ( void 0 === e.interleavedBuffers && (e.interleavedBuffers = {}), void 0 === e.interleavedBuffers[this.data.uuid] && (e.interleavedBuffers[this.data.uuid] = this.data.clone(e)), new wl( e.interleavedBuffers[this.data.uuid], this.itemSize, this.offset, this.normalized, ) ) }, toJSON: function (e) { if (void 0 === e) { console.log( 'THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.', ) for (var t = [], n = 0; n < this.count; n++) for ( var r = n * this.data.stride + this.offset, i = 0; i < this.itemSize; i++ ) t.push(this.data.array[r + i]) return { itemSize: this.itemSize, type: this.array.constructor.name, array: t, normalized: this.normalized, } } return ( void 0 === e.interleavedBuffers && (e.interleavedBuffers = {}), void 0 === e.interleavedBuffers[this.data.uuid] && (e.interleavedBuffers[this.data.uuid] = this.data.toJSON(e)), { isInterleavedBufferAttribute: !0, itemSize: this.itemSize, data: this.data.uuid, offset: this.offset, normalized: this.normalized, } ) }, }), (xl.prototype = Object.create(Di.prototype)), (xl.prototype.constructor = xl), (xl.prototype.isSpriteMaterial = !0), (xl.prototype.copy = function (e) { return ( Di.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 El = new lr(), Ml = new lr(), _l = new lr(), Tl = new Jn(), Sl = new Jn(), Cl = new Fr(), Ll = new lr(), Rl = new lr(), Pl = new lr(), Dl = new Jn(), Ol = new Jn(), Il = new Jn() function Bl(e) { if ((si.call(this), (this.type = 'Sprite'), void 0 === bl)) { bl = new ro() var t = new yl( new Float32Array([ -0.5, -0.5, 0, 0, 0, 0.5, -0.5, 0, 1, 0, 0.5, 0.5, 0, 1, 1, -0.5, 0.5, 0, 0, 1, ]), 5, ) bl.setIndex([0, 1, 2, 0, 2, 3]), bl.setAttribute('position', new wl(t, 3, 0, !1)), bl.setAttribute('uv', new wl(t, 2, 3, !1)) } ;(this.geometry = bl), (this.material = void 0 !== e ? e : new xl()), (this.center = new Jn(0.5, 0.5)) } function Fl(e, t, n, r, i, o) { Tl.subVectors(e, n).addScalar(0.5).multiply(r), void 0 !== i ? ((Sl.x = o * Tl.x - i * Tl.y), (Sl.y = i * Tl.x + o * Tl.y)) : Sl.copy(Tl), e.copy(t), (e.x += Sl.x), (e.y += Sl.y), e.applyMatrix4(Cl) } Bl.prototype = Object.assign(Object.create(si.prototype), { constructor: Bl, 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.', ), Ml.setFromMatrixScale(this.matrixWorld), Cl.copy(e.camera.matrixWorld), this.modelViewMatrix.multiplyMatrices( e.camera.matrixWorldInverse, this.matrixWorld, ), _l.setFromMatrixPosition(this.modelViewMatrix), e.camera.isPerspectiveCamera && !1 === this.material.sizeAttenuation && Ml.multiplyScalar(-_l.z) var n, r, i = this.material.rotation 0 !== i && ((r = Math.cos(i)), (n = Math.sin(i))) var o = this.center Fl(Ll.set(-0.5, -0.5, 0), _l, o, Ml, n, r), Fl(Rl.set(0.5, -0.5, 0), _l, o, Ml, n, r), Fl(Pl.set(0.5, 0.5, 0), _l, o, Ml, n, r), Dl.set(0, 0), Ol.set(1, 0), Il.set(1, 1) var a = e.ray.intersectTriangle(Ll, Rl, Pl, !1, El) if ( null !== a || (Fl(Rl.set(-0.5, 0.5, 0), _l, o, Ml, n, r), Ol.set(0, 1), null !== (a = e.ray.intersectTriangle(Ll, Pl, Rl, !1, El))) ) { var s = e.ray.origin.distanceTo(El) s < e.near || s > e.far || t.push({ distance: s, point: El.clone(), uv: xi.getUV(El, Ll, Rl, Pl, Dl, Ol, Il, new Jn()), face: null, object: this, }) } }, copy: function (e) { return ( si.prototype.copy.call(this, e), void 0 !== e.center && this.center.copy(e.center), (this.material = e.material), this ) }, }) var kl = new lr(), Nl = new lr() function Ul() { si.call(this), (this._currentLevel = 0), (this.type = 'LOD'), Object.defineProperties(this, { levels: { enumerable: !0, value: [] } }), (this.autoUpdate = !0) } Ul.prototype = Object.assign(Object.create(si.prototype), { constructor: Ul, isLOD: !0, copy: function (e) { si.prototype.copy.call(this, e, !1) for (var t = e.levels, n = 0, r = t.length; n < r; n++) { var i = t[n] this.addLevel(i.object.clone(), i.distance) } return (this.autoUpdate = e.autoUpdate), this }, addLevel: function (e, t) { void 0 === t && (t = 0), (t = Math.abs(t)) var n, r = this.levels for (n = 0; n < r.length && !(t < r[n].distance); n++); return r.splice(n, 0, { distance: t, object: e }), this.add(e), this }, getCurrentLevel: function () { return this._currentLevel }, getObjectForDistance: function (e) { var t = this.levels if (t.length > 0) { var n, r for (n = 1, r = t.length; n < r && !(e < t[n].distance); n++); return t[n - 1].object } return null }, raycast: function (e, t) { if (this.levels.length > 0) { kl.setFromMatrixPosition(this.matrixWorld) var n = e.ray.origin.distanceTo(kl) this.getObjectForDistance(n).raycast(e, t) } }, update: function (e) { var t = this.levels if (t.length > 1) { kl.setFromMatrixPosition(e.matrixWorld), Nl.setFromMatrixPosition(this.matrixWorld) var n, r, i = kl.distanceTo(Nl) / e.zoom for ( t[0].object.visible = !0, n = 1, r = t.length; n < r && i >= t[n].distance; n++ ) (t[n - 1].object.visible = !1), (t[n].object.visible = !0) for (this._currentLevel = n - 1; n < r; n++) t[n].object.visible = !1 } }, toJSON: function (e) { var t = si.prototype.toJSON.call(this, e) !1 === this.autoUpdate && (t.object.autoUpdate = !1), (t.object.levels = []) for (var n = this.levels, r = 0, i = n.length; r < i; r++) { var o = n[r] t.object.levels.push({ object: o.object.uuid, distance: o.distance }) } return t }, }) var Hl = new lr(), Gl = new ir(), zl = new ir(), jl = new lr(), Vl = new Fr() function Wl(e, t) { e && e.isGeometry && console.error( 'THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.', ), xo.call(this, e, t), (this.type = 'SkinnedMesh'), (this.bindMode = 'attached'), (this.bindMatrix = new Fr()), (this.bindMatrixInverse = new Fr()) } function ql() { si.call(this), (this.type = 'Bone') } ;(Wl.prototype = Object.assign(Object.create(xo.prototype), { constructor: Wl, isSkinnedMesh: !0, copy: function (e) { return ( xo.prototype.copy.call(this, e), (this.bindMode = e.bindMode), this.bindMatrix.copy(e.bindMatrix), this.bindMatrixInverse.copy(e.bindMatrixInverse), (this.skeleton = e.skeleton), this ) }, 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.copy(t).invert() }, pose: function () { this.skeleton.pose() }, normalizeSkinWeights: function () { for ( var e = new ir(), t = this.geometry.attributes.skinWeight, n = 0, r = t.count; n < r; n++ ) { ;(e.x = t.getX(n)), (e.y = t.getY(n)), (e.z = t.getZ(n)), (e.w = t.getW(n)) var i = 1 / e.manhattanLength() i !== 1 / 0 ? e.multiplyScalar(i) : e.set(1, 0, 0, 0), t.setXYZW(n, e.x, e.y, e.z, e.w) } }, updateMatrixWorld: function (e) { xo.prototype.updateMatrixWorld.call(this, e), 'attached' === this.bindMode ? this.bindMatrixInverse.copy(this.matrixWorld).invert() : 'detached' === this.bindMode ? this.bindMatrixInverse.copy(this.bindMatrix).invert() : console.warn( 'THREE.SkinnedMesh: Unrecognized bindMode: ' + this.bindMode, ) }, boneTransform: function (e, t) { var n = this.skeleton, r = this.geometry Gl.fromBufferAttribute(r.attributes.skinIndex, e), zl.fromBufferAttribute(r.attributes.skinWeight, e), Hl.fromBufferAttribute(r.attributes.position, e).applyMatrix4( this.bindMatrix, ), t.set(0, 0, 0) for (var i = 0; i < 4; i++) { var o = zl.getComponent(i) if (0 !== o) { var a = Gl.getComponent(i) Vl.multiplyMatrices(n.bones[a].matrixWorld, n.boneInverses[a]), t.addScaledVector(jl.copy(Hl).applyMatrix4(Vl), o) } } return t.applyMatrix4(this.bindMatrixInverse) }, })), (ql.prototype = Object.assign(Object.create(si.prototype), { constructor: ql, isBone: !0, })) var Xl = new Fr(), Yl = new Fr() function Ql(e, t) { void 0 === e && (e = []), void 0 === t && (t = []), (this.uuid = Kn.generateUUID()), (this.bones = e.slice(0)), (this.boneInverses = t), (this.boneMatrices = null), (this.boneTexture = null), (this.boneTextureSize = 0), (this.frame = -1), this.init() } Object.assign(Ql.prototype, { init: function () { var e = this.bones, t = this.boneInverses if (((this.boneMatrices = new Float32Array(16 * e.length)), 0 === t.length)) this.calculateInverses() else if (e.length !== t.length) { console.warn( 'THREE.Skeleton: Number of inverse bone matrices does not match amount of bones.', ), (this.boneInverses = []) for (var n = 0, r = this.bones.length; n < r; n++) this.boneInverses.push(new Fr()) } }, calculateInverses: function () { this.boneInverses.length = 0 for (var e = 0, t = this.bones.length; e < t; e++) { var n = new Fr() this.bones[e] && n.copy(this.bones[e].matrixWorld).invert(), this.boneInverses.push(n) } }, pose: function () { for (var e = 0, t = this.bones.length; e < t; e++) { var n = this.bones[e] n && n.matrixWorld.copy(this.boneInverses[e]).invert() } for (var r = 0, i = this.bones.length; r < i; r++) { var o = this.bones[r] o && (o.parent && o.parent.isBone ? (o.matrix.copy(o.parent.matrixWorld).invert(), o.matrix.multiply(o.matrixWorld)) : o.matrix.copy(o.matrixWorld), o.matrix.decompose(o.position, o.quaternion, o.scale)) } }, update: function () { for ( var e = this.bones, t = this.boneInverses, n = this.boneMatrices, r = this.boneTexture, i = 0, o = e.length; i < o; i++ ) { var a = e[i] ? e[i].matrixWorld : Yl Xl.multiplyMatrices(a, t[i]), Xl.toArray(n, 16 * i) } null !== r && (r.needsUpdate = !0) }, clone: function () { return new Ql(this.bones, this.boneInverses) }, getBoneByName: function (e) { for (var t = 0, n = this.bones.length; t < n; t++) { var r = this.bones[t] if (r.name === e) return r } }, dispose: function () { null !== this.boneTexture && (this.boneTexture.dispose(), (this.boneTexture = null)) }, fromJSON: function (e, t) { this.uuid = e.uuid for (var n = 0, r = e.bones.length; n < r; n++) { var i = e.bones[n], o = t[i] void 0 === o && (console.warn('THREE.Skeleton: No bone found with UUID:', i), (o = new ql())), this.bones.push(o), this.boneInverses.push(new Fr().fromArray(e.boneInverses[n])) } return this.init(), this }, toJSON: function () { var e = { metadata: { version: 4.5, type: 'Skeleton', generator: 'Skeleton.toJSON', }, bones: [], boneInverses: [], } e.uuid = this.uuid for ( var t = this.bones, n = this.boneInverses, r = 0, i = t.length; r < i; r++ ) { var o = t[r] e.bones.push(o.uuid) var a = n[r] e.boneInverses.push(a.toArray()) } return e }, }) var Zl = new Fr(), Kl = new Fr(), Jl = [], $l = new xo() function ec(e, t, n) { xo.call(this, e, t), (this.instanceMatrix = new Fi(new Float32Array(16 * n), 16)), (this.instanceColor = null), (this.count = n), (this.frustumCulled = !1) } function tc(e) { Di.call(this), (this.type = 'LineBasicMaterial'), (this.color = new Li(16777215)), (this.linewidth = 1), (this.linecap = 'round'), (this.linejoin = 'round'), (this.morphTargets = !1), this.setValues(e) } ;(ec.prototype = Object.assign(Object.create(xo.prototype), { constructor: ec, isInstancedMesh: !0, copy: function (e) { return ( xo.prototype.copy.call(this, e), this.instanceMatrix.copy(e.instanceMatrix), null !== e.instanceColor && (this.instanceColor = e.instanceColor.clone()), (this.count = e.count), this ) }, getColorAt: function (e, t) { t.fromArray(this.instanceColor.array, 3 * e) }, getMatrixAt: function (e, t) { t.fromArray(this.instanceMatrix.array, 16 * e) }, raycast: function (e, t) { var n = this.matrixWorld, r = this.count if ( (($l.geometry = this.geometry), ($l.material = this.material), void 0 !== $l.material) ) for (var i = 0; i < r; i++) { this.getMatrixAt(i, Zl), Kl.multiplyMatrices(n, Zl), ($l.matrixWorld = Kl), $l.raycast(e, Jl) for (var o = 0, a = Jl.length; o < a; o++) { var s = Jl[o] ;(s.instanceId = i), (s.object = this), t.push(s) } Jl.length = 0 } }, setColorAt: function (e, t) { null === this.instanceColor && (this.instanceColor = new Fi(new Float32Array(3 * this.count), 3)), t.toArray(this.instanceColor.array, 3 * e) }, setMatrixAt: function (e, t) { t.toArray(this.instanceMatrix.array, 16 * e) }, updateMorphTargets: function () {}, dispose: function () { this.dispatchEvent({ type: 'dispose' }) }, })), (tc.prototype = Object.create(Di.prototype)), (tc.prototype.constructor = tc), (tc.prototype.isLineBasicMaterial = !0), (tc.prototype.copy = function (e) { return ( Di.prototype.copy.call(this, e), this.color.copy(e.color), (this.linewidth = e.linewidth), (this.linecap = e.linecap), (this.linejoin = e.linejoin), (this.morphTargets = e.morphTargets), this ) }) var nc = new lr(), rc = new lr(), ic = new Fr(), oc = new Br(), ac = new Sr() function sc(e, t) { void 0 === e && (e = new ro()), void 0 === t && (t = new tc()), si.call(this), (this.type = 'Line'), (this.geometry = e), (this.material = t), this.updateMorphTargets() } sc.prototype = Object.assign(Object.create(si.prototype), { constructor: sc, isLine: !0, copy: function (e) { return ( si.prototype.copy.call(this, e), (this.material = e.material), (this.geometry = e.geometry), this ) }, computeLineDistances: function () { var e = this.geometry if (e.isBufferGeometry) if (null === e.index) { for ( var t = e.attributes.position, n = [0], r = 1, i = t.count; r < i; r++ ) nc.fromBufferAttribute(t, r - 1), rc.fromBufferAttribute(t, r), (n[r] = n[r - 1]), (n[r] += nc.distanceTo(rc)) e.setAttribute('lineDistance', new Wi(n, 1)) } else console.warn( 'THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.', ) else e.isGeometry && console.error( 'THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.', ) return this }, raycast: function (e, t) { var n = this.geometry, r = this.matrixWorld, i = e.params.Line.threshold if ( (null === n.boundingSphere && n.computeBoundingSphere(), ac.copy(n.boundingSphere), ac.applyMatrix4(r), (ac.radius += i), !1 !== e.ray.intersectsSphere(ac)) ) { ic.copy(r).invert(), oc.copy(e.ray).applyMatrix4(ic) var o = i / ((this.scale.x + this.scale.y + this.scale.z) / 3), a = o * o, s = new lr(), l = new lr(), c = new lr(), u = new lr(), h = this.isLineSegments ? 2 : 1 if (n.isBufferGeometry) { var d = n.index, p = n.attributes.position if (null !== d) for (var f = d.array, m = 0, v = f.length - 1; m < v; m += h) { var g = f[m], y = f[m + 1] if ( (s.fromBufferAttribute(p, g), l.fromBufferAttribute(p, y), !(oc.distanceSqToSegment(s, l, u, c) > a)) ) { u.applyMatrix4(this.matrixWorld) var b = e.ray.origin.distanceTo(u) b < e.near || b > e.far || t.push({ distance: b, point: c.clone().applyMatrix4(this.matrixWorld), index: m, face: null, faceIndex: null, object: this, }) } } else for (var A = 0, w = p.count - 1; A < w; A += h) if ( (s.fromBufferAttribute(p, A), l.fromBufferAttribute(p, A + 1), !(oc.distanceSqToSegment(s, l, u, c) > a)) ) { u.applyMatrix4(this.matrixWorld) var x = e.ray.origin.distanceTo(u) x < e.near || x > e.far || t.push({ distance: x, point: c.clone().applyMatrix4(this.matrixWorld), index: A, face: null, faceIndex: null, object: this, }) } } else n.isGeometry && console.error( 'THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.', ) } }, updateMorphTargets: function () { var e = this.geometry if (e.isBufferGeometry) { var t = e.morphAttributes, n = Object.keys(t) if (n.length > 0) { var r = t[n[0]] if (void 0 !== r) { ;(this.morphTargetInfluences = []), (this.morphTargetDictionary = {}) for (var i = 0, o = r.length; i < o; i++) { var a = r[i].name || String(i) this.morphTargetInfluences.push(0), (this.morphTargetDictionary[a] = i) } } } } else { var s = e.morphTargets void 0 !== s && s.length > 0 && console.error( 'THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.', ) } }, }) var lc = new lr(), cc = new lr() function uc(e, t) { sc.call(this, e, t), (this.type = 'LineSegments') } function hc(e, t) { sc.call(this, e, t), (this.type = 'LineLoop') } function dc(e) { Di.call(this), (this.type = 'PointsMaterial'), (this.color = new Li(16777215)), (this.map = null), (this.alphaMap = null), (this.size = 1), (this.sizeAttenuation = !0), (this.morphTargets = !1), this.setValues(e) } ;(uc.prototype = Object.assign(Object.create(sc.prototype), { constructor: uc, isLineSegments: !0, computeLineDistances: function () { var e = this.geometry if (e.isBufferGeometry) if (null === e.index) { for ( var t = e.attributes.position, n = [], r = 0, i = t.count; r < i; r += 2 ) lc.fromBufferAttribute(t, r), cc.fromBufferAttribute(t, r + 1), (n[r] = 0 === r ? 0 : n[r - 1]), (n[r + 1] = n[r] + lc.distanceTo(cc)) e.setAttribute('lineDistance', new Wi(n, 1)) } else console.warn( 'THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.', ) else e.isGeometry && console.error( 'THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.', ) return this }, })), (hc.prototype = Object.assign(Object.create(sc.prototype), { constructor: hc, isLineLoop: !0, })), (dc.prototype = Object.create(Di.prototype)), (dc.prototype.constructor = dc), (dc.prototype.isPointsMaterial = !0), (dc.prototype.copy = function (e) { return ( Di.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 pc = new Fr(), fc = new Br(), mc = new Sr(), vc = new lr() function gc(e, t) { void 0 === e && (e = new ro()), void 0 === t && (t = new dc()), si.call(this), (this.type = 'Points'), (this.geometry = e), (this.material = t), this.updateMorphTargets() } function yc(e, t, n, r, i, o, a) { var s = fc.distanceSqToPoint(e) if (s < n) { var l = new lr() fc.closestPointToPoint(e, l), l.applyMatrix4(r) var c = i.ray.origin.distanceTo(l) if (c < i.near || c > i.far) return o.push({ distance: c, distanceToRay: Math.sqrt(s), point: l, index: t, face: null, object: a, }) } } function bc(e, t, n, r, i, o, a, s, l) { nr.call(this, e, t, n, r, i, o, a, s, l), (this.format = void 0 !== a ? a : Ne), (this.minFilter = void 0 !== o ? o : Ae), (this.magFilter = void 0 !== i ? i : Ae), (this.generateMipmaps = !1) var c = this function u() { ;(c.needsUpdate = !0), e.requestVideoFrameCallback(u) } 'requestVideoFrameCallback' in e && e.requestVideoFrameCallback(u) } function Ac(e, t, n, r, i, o, a, s, l, c, u, h) { nr.call(this, null, o, a, s, l, c, r, i, u, h), (this.image = { width: t, height: n }), (this.mipmaps = e), (this.flipY = !1), (this.generateMipmaps = !1) } function wc(e, t, n, r, i, o, a, s, l) { nr.call(this, e, t, n, r, i, o, a, s, l), (this.needsUpdate = !0) } function xc(e, t, n, r, i, o, a, s, l, c) { if ((c = void 0 !== c ? c : je) !== je && c !== Ve) throw new Error( 'DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat', ) void 0 === n && c === je && (n = Ce), void 0 === n && c === Ve && (n = Fe), nr.call(this, null, r, i, o, a, s, c, n, l), (this.image = { width: e, height: t }), (this.magFilter = void 0 !== a ? a : me), (this.minFilter = void 0 !== s ? s : me), (this.flipY = !1), (this.generateMipmaps = !1) } ;(gc.prototype = Object.assign(Object.create(si.prototype), { constructor: gc, isPoints: !0, copy: function (e) { return ( si.prototype.copy.call(this, e), (this.material = e.material), (this.geometry = e.geometry), this ) }, raycast: function (e, t) { var n = this.geometry, r = this.matrixWorld, i = e.params.Points.threshold if ( (null === n.boundingSphere && n.computeBoundingSphere(), mc.copy(n.boundingSphere), mc.applyMatrix4(r), (mc.radius += i), !1 !== e.ray.intersectsSphere(mc)) ) { pc.copy(r).invert(), fc.copy(e.ray).applyMatrix4(pc) var o = i / ((this.scale.x + this.scale.y + this.scale.z) / 3), a = o * o if (n.isBufferGeometry) { var s = n.index, l = n.attributes.position if (null !== s) for (var c = s.array, u = 0, h = c.length; u < h; u++) { var d = c[u] vc.fromBufferAttribute(l, d), yc(vc, d, a, r, e, t, this) } else for (var p = 0, f = l.count; p < f; p++) vc.fromBufferAttribute(l, p), yc(vc, p, a, r, e, t, this) } else console.error( 'THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.', ) } }, updateMorphTargets: function () { var e = this.geometry if (e.isBufferGeometry) { var t = e.morphAttributes, n = Object.keys(t) if (n.length > 0) { var r = t[n[0]] if (void 0 !== r) { ;(this.morphTargetInfluences = []), (this.morphTargetDictionary = {}) for (var i = 0, o = r.length; i < o; i++) { var a = r[i].name || String(i) this.morphTargetInfluences.push(0), (this.morphTargetDictionary[a] = i) } } } } else { var s = e.morphTargets void 0 !== s && s.length > 0 && console.error( 'THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.', ) } }, })), (bc.prototype = Object.assign(Object.create(nr.prototype), { constructor: bc, clone: function () { return new this.constructor(this.image).copy(this) }, isVideoTexture: !0, update: function () { var e = this.image !1 === 'requestVideoFrameCallback' in e && e.readyState >= e.HAVE_CURRENT_DATA && (this.needsUpdate = !0) }, })), (Ac.prototype = Object.create(nr.prototype)), (Ac.prototype.constructor = Ac), (Ac.prototype.isCompressedTexture = !0), (wc.prototype = Object.create(nr.prototype)), (wc.prototype.constructor = wc), (wc.prototype.isCanvasTexture = !0), (xc.prototype = Object.create(nr.prototype)), (xc.prototype.constructor = xc), (xc.prototype.isDepthTexture = !0) var Ec = (function (e) { function t(t, n, r, i) { var o void 0 === t && (t = 1), void 0 === n && (n = 8), void 0 === r && (r = 0), void 0 === i && (i = 2 * Math.PI), ((o = e.call(this) || this).type = 'CircleGeometry'), (o.parameters = { radius: t, segments: n, thetaStart: r, thetaLength: i, }), (n = Math.max(3, n)) var a = [], s = [], l = [], c = [], u = new lr(), h = new Jn() s.push(0, 0, 0), l.push(0, 0, 1), c.push(0.5, 0.5) for (var d = 0, p = 3; d <= n; d++, p += 3) { var f = r + (d / n) * i ;(u.x = t * Math.cos(f)), (u.y = t * Math.sin(f)), s.push(u.x, u.y, u.z), l.push(0, 0, 1), (h.x = (s[p] / t + 1) / 2), (h.y = (s[p + 1] / t + 1) / 2), c.push(h.x, h.y) } for (var m = 1; m <= n; m++) a.push(m, m + 1, 0) return ( o.setIndex(a), o.setAttribute('position', new Wi(s, 3)), o.setAttribute('normal', new Wi(l, 3)), o.setAttribute('uv', new Wi(c, 2)), o ) } return Gn(t, e), t })(ro), Mc = (function (e) { function t(t, n, r, i, o, a, s, l) { var c void 0 === t && (t = 1), void 0 === n && (n = 1), void 0 === r && (r = 1), void 0 === i && (i = 8), void 0 === o && (o = 1), void 0 === a && (a = !1), void 0 === s && (s = 0), void 0 === l && (l = 2 * Math.PI), ((c = e.call(this) || this).type = 'CylinderGeometry'), (c.parameters = { radiusTop: t, radiusBottom: n, height: r, radialSegments: i, heightSegments: o, openEnded: a, thetaStart: s, thetaLength: l, }) var u = zn(c) ;(i = Math.floor(i)), (o = Math.floor(o)) var h = [], d = [], p = [], f = [], m = 0, v = [], g = r / 2, y = 0 function b() { for ( var e = new lr(), a = new lr(), c = 0, b = (n - t) / r, A = 0; A <= o; A++ ) { for (var w = [], x = A / o, E = x * (n - t) + t, M = 0; M <= i; M++) { var _ = M / i, T = _ * l + s, S = Math.sin(T), C = Math.cos(T) ;(a.x = E * S), (a.y = -x * r + g), (a.z = E * C), d.push(a.x, a.y, a.z), e.set(S, b, C).normalize(), p.push(e.x, e.y, e.z), f.push(_, 1 - x), w.push(m++) } v.push(w) } for (var L = 0; L < i; L++) for (var R = 0; R < o; R++) { var P = v[R][L], D = v[R + 1][L], O = v[R + 1][L + 1], I = v[R][L + 1] h.push(P, D, I), h.push(D, O, I), (c += 6) } u.addGroup(y, c, 0), (y += c) } function A(e) { for ( var r = m, o = new Jn(), a = new lr(), c = 0, v = !0 === e ? t : n, b = !0 === e ? 1 : -1, A = 1; A <= i; A++ ) d.push(0, g * b, 0), p.push(0, b, 0), f.push(0.5, 0.5), m++ for (var w = m, x = 0; x <= i; x++) { var E = (x / i) * l + s, M = Math.cos(E), _ = Math.sin(E) ;(a.x = v * _), (a.y = g * b), (a.z = v * M), d.push(a.x, a.y, a.z), p.push(0, b, 0), (o.x = 0.5 * M + 0.5), (o.y = 0.5 * _ * b + 0.5), f.push(o.x, o.y), m++ } for (var T = 0; T < i; T++) { var S = r + T, C = w + T !0 === e ? h.push(C, C + 1, S) : h.push(C + 1, C, S), (c += 3) } u.addGroup(y, c, !0 === e ? 1 : 2), (y += c) } return ( b(), !1 === a && (t > 0 && A(!0), n > 0 && A(!1)), c.setIndex(h), c.setAttribute('position', new Wi(d, 3)), c.setAttribute('normal', new Wi(p, 3)), c.setAttribute('uv', new Wi(f, 2)), c ) } return Gn(t, e), t })(ro), _c = (function (e) { function t(t, n, r, i, o, a, s) { var l return ( void 0 === t && (t = 1), void 0 === n && (n = 1), void 0 === r && (r = 8), void 0 === i && (i = 1), void 0 === o && (o = !1), void 0 === a && (a = 0), void 0 === s && (s = 2 * Math.PI), ((l = e.call(this, 0, t, n, r, i, o, a, s) || this).type = 'ConeGeometry'), (l.parameters = { radius: t, height: n, radialSegments: r, heightSegments: i, openEnded: o, thetaStart: a, thetaLength: s, }), l ) } return Gn(t, e), t })(Mc), Tc = (function (e) { function t(t, n, r, i) { var o void 0 === r && (r = 1), void 0 === i && (i = 0), ((o = e.call(this) || this).type = 'PolyhedronGeometry'), (o.parameters = { vertices: t, indices: n, radius: r, detail: i }) var a = [], s = [] function l(e) { for ( var t = new lr(), r = new lr(), i = new lr(), o = 0; o < n.length; o += 3 ) f(n[o + 0], t), f(n[o + 1], r), f(n[o + 2], i), c(t, r, i, e) } function c(e, t, n, r) { for (var i = r + 1, o = [], a = 0; a <= i; a++) { o[a] = [] for ( var s = e.clone().lerp(n, a / i), l = t.clone().lerp(n, a / i), c = i - a, u = 0; u <= c; u++ ) o[a][u] = 0 === u && a === i ? s : s.clone().lerp(l, u / c) } for (var h = 0; h < i; h++) for (var d = 0; d < 2 * (i - h) - 1; d++) { var f = Math.floor(d / 2) d % 2 === 0 ? (p(o[h][f + 1]), p(o[h + 1][f]), p(o[h][f])) : (p(o[h][f + 1]), p(o[h + 1][f + 1]), p(o[h + 1][f])) } } function u(e) { for (var t = new lr(), n = 0; n < a.length; n += 3) (t.x = a[n + 0]), (t.y = a[n + 1]), (t.z = a[n + 2]), t.normalize().multiplyScalar(e), (a[n + 0] = t.x), (a[n + 1] = t.y), (a[n + 2] = t.z) } function h() { for (var e = new lr(), t = 0; t < a.length; t += 3) { ;(e.x = a[t + 0]), (e.y = a[t + 1]), (e.z = a[t + 2]) var n = g(e) / 2 / Math.PI + 0.5, r = y(e) / Math.PI + 0.5 s.push(n, 1 - r) } m(), d() } function d() { for (var e = 0; e < s.length; e += 6) { var t = s[e + 0], n = s[e + 2], r = s[e + 4], i = Math.max(t, n, r), o = Math.min(t, n, r) i > 0.9 && o < 0.1 && (t < 0.2 && (s[e + 0] += 1), n < 0.2 && (s[e + 2] += 1), r < 0.2 && (s[e + 4] += 1)) } } function p(e) { a.push(e.x, e.y, e.z) } function f(e, n) { var r = 3 * e ;(n.x = t[r + 0]), (n.y = t[r + 1]), (n.z = t[r + 2]) } function m() { for ( var e = new lr(), t = new lr(), n = new lr(), r = new lr(), i = new Jn(), o = new Jn(), l = new Jn(), c = 0, u = 0; c < a.length; c += 9, u += 6 ) { e.set(a[c + 0], a[c + 1], a[c + 2]), t.set(a[c + 3], a[c + 4], a[c + 5]), n.set(a[c + 6], a[c + 7], a[c + 8]), i.set(s[u + 0], s[u + 1]), o.set(s[u + 2], s[u + 3]), l.set(s[u + 4], s[u + 5]), r.copy(e).add(t).add(n).divideScalar(3) var h = g(r) v(i, u + 0, e, h), v(o, u + 2, t, h), v(l, u + 4, n, h) } } function v(e, t, n, r) { r < 0 && 1 === e.x && (s[t] = e.x - 1), 0 === n.x && 0 === n.z && (s[t] = r / 2 / Math.PI + 0.5) } function g(e) { return Math.atan2(e.z, -e.x) } function y(e) { return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z)) } return ( l(i), u(r), h(), o.setAttribute('position', new Wi(a, 3)), o.setAttribute('normal', new Wi(a.slice(), 3)), o.setAttribute('uv', new Wi(s, 2)), 0 === i ? o.computeVertexNormals() : o.normalizeNormals(), o ) } return Gn(t, e), t })(ro), Sc = (function (e) { function t(t, n) { var r void 0 === t && (t = 1), void 0 === n && (n = 0) var i = (1 + Math.sqrt(5)) / 2, o = 1 / i, a = [ -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, -o, -i, 0, -o, i, 0, o, -i, 0, o, i, -o, -i, 0, -o, i, 0, o, -i, 0, o, i, 0, -i, 0, -o, i, 0, -o, -i, 0, o, i, 0, o, ], s = [ 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, ] return ( ((r = e.call(this, a, s, t, n) || this).type = 'DodecahedronGeometry'), (r.parameters = { radius: t, detail: n }), r ) } return Gn(t, e), t })(Tc), Cc = new lr(), Lc = new lr(), Rc = new lr(), Pc = new xi(), Dc = (function (e) { function t(t, n) { var r if ( (((r = e.call(this) || this).type = 'EdgesGeometry'), (r.parameters = { thresholdAngle: n }), (n = void 0 !== n ? n : 1), !0 === t.isGeometry) ) return ( console.error( 'THREE.EdgesGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.', ), zn(r) ) for ( var i = 4, o = Math.pow(10, i), a = Math.cos(Kn.DEG2RAD * n), s = t.getIndex(), l = t.getAttribute('position'), c = s ? s.count : l.count, u = [0, 0, 0], h = ['a', 'b', 'c'], d = new Array(3), p = {}, f = [], m = 0; m < c; m += 3 ) { s ? ((u[0] = s.getX(m)), (u[1] = s.getX(m + 1)), (u[2] = s.getX(m + 2))) : ((u[0] = m), (u[1] = m + 1), (u[2] = m + 2)) var v = Pc.a, g = Pc.b, y = Pc.c if ( (v.fromBufferAttribute(l, u[0]), g.fromBufferAttribute(l, u[1]), y.fromBufferAttribute(l, u[2]), Pc.getNormal(Rc), (d[0] = Math.round(v.x * o) + ',' + Math.round(v.y * o) + ',' + Math.round(v.z * o)), (d[1] = Math.round(g.x * o) + ',' + Math.round(g.y * o) + ',' + Math.round(g.z * o)), (d[2] = Math.round(y.x * o) + ',' + Math.round(y.y * o) + ',' + Math.round(y.z * o)), d[0] !== d[1] && d[1] !== d[2] && d[2] !== d[0]) ) for (var b = 0; b < 3; b++) { var A = (b + 1) % 3, w = d[b], x = d[A], E = Pc[h[b]], M = Pc[h[A]], _ = w + '_' + x, T = x + '_' + w T in p && p[T] ? (Rc.dot(p[T].normal) <= a && (f.push(E.x, E.y, E.z), f.push(M.x, M.y, M.z)), (p[T] = null)) : _ in p || (p[_] = { index0: u[b], index1: u[A], normal: Rc.clone() }) } } for (var S in p) if (p[S]) { var C = p[S], L = C.index0, R = C.index1 Cc.fromBufferAttribute(l, L), Lc.fromBufferAttribute(l, R), f.push(Cc.x, Cc.y, Cc.z), f.push(Lc.x, Lc.y, Lc.z) } return r.setAttribute('position', new Wi(f, 3)), r } return Gn(t, e), t })(ro), Oc = { triangulate: function (e, t, n) { n = n || 2 var r, i, o, a, s, l, c, u = t && t.length, h = u ? t[0] * n : e.length, d = Ic(e, 0, h, n, !0), p = [] if (!d || d.next === d.prev) return p if ((u && (d = Gc(e, t, d, n)), e.length > 80 * n)) { ;(r = o = e[0]), (i = a = e[1]) for (var f = n; f < h; f += n) (s = e[f]) < r && (r = s), (l = e[f + 1]) < i && (i = l), s > o && (o = s), l > a && (a = l) c = 0 !== (c = Math.max(o - r, a - i)) ? 1 / c : 0 } return Fc(d, p, n, r, i, c), p }, } function Ic(e, t, n, r, i) { var o, a if (i === uu(e, t, n, r) > 0) for (o = t; o < n; o += r) a = su(o, e[o], e[o + 1], a) else for (o = n - r; o >= t; o -= r) a = su(o, e[o], e[o + 1], a) return a && $c(a, a.next) && (lu(a), (a = a.next)), a } function Bc(e, t) { if (!e) return e t || (t = e) var n, r = e do { if ( ((n = !1), r.steiner || (!$c(r, r.next) && 0 !== Jc(r.prev, r, r.next))) ) r = r.next else { if ((lu(r), (r = t = r.prev) === r.next)) break n = !0 } } while (n || r !== t) return t } function Fc(e, t, n, r, i, o, a) { if (e) { !a && o && qc(e, r, i, o) for (var s, l, c = e; e.prev !== e.next; ) if (((s = e.prev), (l = e.next), o ? Nc(e, r, i, o) : kc(e))) t.push(s.i / n), t.push(e.i / n), t.push(l.i / n), lu(e), (e = l.next), (c = l.next) else if ((e = l) === c) { a ? 1 === a ? Fc((e = Uc(Bc(e), t, n)), t, n, r, i, o, 2) : 2 === a && Hc(e, t, n, r, i, o) : Fc(Bc(e), t, n, r, i, o, 1) break } } } function kc(e) { var t = e.prev, n = e, r = e.next if (Jc(t, n, r) >= 0) return !1 for (var i = e.next.next; i !== e.prev; ) { if ( Zc(t.x, t.y, n.x, n.y, r.x, r.y, i.x, i.y) && Jc(i.prev, i, i.next) >= 0 ) return !1 i = i.next } return !0 } function Nc(e, t, n, r) { var i = e.prev, o = e, a = e.next if (Jc(i, o, a) >= 0) return !1 for ( var s = i.x < o.x ? (i.x < a.x ? i.x : a.x) : o.x < a.x ? o.x : a.x, l = i.y < o.y ? (i.y < a.y ? i.y : a.y) : o.y < a.y ? o.y : a.y, c = i.x > o.x ? (i.x > a.x ? i.x : a.x) : o.x > a.x ? o.x : a.x, u = i.y > o.y ? (i.y > a.y ? i.y : a.y) : o.y > a.y ? o.y : a.y, h = Yc(s, l, t, n, r), d = Yc(c, u, t, n, r), p = e.prevZ, f = e.nextZ; p && p.z >= h && f && f.z <= d; ) { if ( p !== e.prev && p !== e.next && Zc(i.x, i.y, o.x, o.y, a.x, a.y, p.x, p.y) && Jc(p.prev, p, p.next) >= 0 ) return !1 if ( ((p = p.prevZ), f !== e.prev && f !== e.next && Zc(i.x, i.y, o.x, o.y, a.x, a.y, f.x, f.y) && Jc(f.prev, f, f.next) >= 0) ) return !1 f = f.nextZ } for (; p && p.z >= h; ) { if ( p !== e.prev && p !== e.next && Zc(i.x, i.y, o.x, o.y, a.x, a.y, p.x, p.y) && Jc(p.prev, p, p.next) >= 0 ) return !1 p = p.prevZ } for (; f && f.z <= d; ) { if ( f !== e.prev && f !== e.next && Zc(i.x, i.y, o.x, o.y, a.x, a.y, f.x, f.y) && Jc(f.prev, f, f.next) >= 0 ) return !1 f = f.nextZ } return !0 } function Uc(e, t, n) { var r = e do { var i = r.prev, o = r.next.next !$c(i, o) && eu(i, r, r.next, o) && iu(i, o) && iu(o, i) && (t.push(i.i / n), t.push(r.i / n), t.push(o.i / n), lu(r), lu(r.next), (r = e = o)), (r = r.next) } while (r !== e) return Bc(r) } function Hc(e, t, n, r, i, o) { var a = e do { for (var s = a.next.next; s !== a.prev; ) { if (a.i !== s.i && Kc(a, s)) { var l = au(a, s) return ( (a = Bc(a, a.next)), (l = Bc(l, l.next)), Fc(a, t, n, r, i, o), void Fc(l, t, n, r, i, o) ) } s = s.next } a = a.next } while (a !== e) } function Gc(e, t, n, r) { var i, o, a, s = [] for (i = 0, o = t.length; i < o; i++) (a = Ic(e, t[i] * r, i < o - 1 ? t[i + 1] * r : e.length, r, !1)) === a.next && (a.steiner = !0), s.push(Qc(a)) for (s.sort(zc), i = 0; i < s.length; i++) jc(s[i], n), (n = Bc(n, n.next)) return n } function zc(e, t) { return e.x - t.x } function jc(e, t) { if ((t = Vc(e, t))) { var n = au(t, e) Bc(t, t.next), Bc(n, n.next) } } function Vc(e, t) { var n, r = t, i = e.x, o = e.y, a = -1 / 0 do { if (o <= r.y && o >= r.next.y && r.next.y !== r.y) { var s = r.x + ((o - r.y) * (r.next.x - r.x)) / (r.next.y - r.y) if (s <= i && s > a) { if (((a = s), s === i)) { if (o === r.y) return r if (o === r.next.y) return r.next } n = r.x < r.next.x ? r : r.next } } r = r.next } while (r !== t) if (!n) return null if (i === a) return n var l, c = n, u = n.x, h = n.y, d = 1 / 0 r = n do { i >= r.x && r.x >= u && i !== r.x && Zc(o < h ? i : a, o, u, h, o < h ? a : i, o, r.x, r.y) && ((l = Math.abs(o - r.y) / (i - r.x)), iu(r, e) && (l < d || (l === d && (r.x > n.x || (r.x === n.x && Wc(n, r))))) && ((n = r), (d = l))), (r = r.next) } while (r !== c) return n } function Wc(e, t) { return Jc(e.prev, e, t.prev) < 0 && Jc(t.next, e, e.next) < 0 } function qc(e, t, n, r) { var i = e do { null === i.z && (i.z = Yc(i.x, i.y, t, n, r)), (i.prevZ = i.prev), (i.nextZ = i.next), (i = i.next) } while (i !== e) ;(i.prevZ.nextZ = null), (i.prevZ = null), Xc(i) } function Xc(e) { var t, n, r, i, o, a, s, l, c = 1 do { for (n = e, e = null, o = null, a = 0; n; ) { for (a++, r = n, s = 0, t = 0; t < c && (s++, (r = r.nextZ)); t++); for (l = c; s > 0 || (l > 0 && r); ) 0 !== s && (0 === l || !r || n.z <= r.z) ? ((i = n), (n = n.nextZ), s--) : ((i = r), (r = r.nextZ), l--), o ? (o.nextZ = i) : (e = i), (i.prevZ = o), (o = i) n = r } ;(o.nextZ = null), (c *= 2) } while (a > 1) return e } function Yc(e, t, n, r, i) { return ( (e = 1431655765 & ((e = 858993459 & ((e = 252645135 & ((e = 16711935 & ((e = 32767 * (e - n) * i) | (e << 8))) | (e << 4))) | (e << 2))) | (e << 1))) | ((t = 1431655765 & ((t = 858993459 & ((t = 252645135 & ((t = 16711935 & ((t = 32767 * (t - r) * i) | (t << 8))) | (t << 4))) | (t << 2))) | (t << 1))) << 1) ) } function Qc(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 Zc(e, t, n, r, i, o, a, s) { return ( (i - a) * (t - s) - (e - a) * (o - s) >= 0 && (e - a) * (r - s) - (n - a) * (t - s) >= 0 && (n - a) * (o - s) - (i - a) * (r - s) >= 0 ) } function Kc(e, t) { return ( e.next.i !== t.i && e.prev.i !== t.i && !ru(e, t) && ((iu(e, t) && iu(t, e) && ou(e, t) && (Jc(e.prev, e, t.prev) || Jc(e, t.prev, t))) || ($c(e, t) && Jc(e.prev, e, e.next) > 0 && Jc(t.prev, t, t.next) > 0)) ) } function Jc(e, t, n) { return (t.y - e.y) * (n.x - t.x) - (t.x - e.x) * (n.y - t.y) } function $c(e, t) { return e.x === t.x && e.y === t.y } function eu(e, t, n, r) { var i = nu(Jc(e, t, n)), o = nu(Jc(e, t, r)), a = nu(Jc(n, r, e)), s = nu(Jc(n, r, t)) return ( (i !== o && a !== s) || !(0 !== i || !tu(e, n, t)) || !(0 !== o || !tu(e, r, t)) || !(0 !== a || !tu(n, e, r)) || !(0 !== s || !tu(n, t, r)) ) } function tu(e, t, n) { return ( t.x <= Math.max(e.x, n.x) && t.x >= Math.min(e.x, n.x) && t.y <= Math.max(e.y, n.y) && t.y >= Math.min(e.y, n.y) ) } function nu(e) { return e > 0 ? 1 : e < 0 ? -1 : 0 } function ru(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 && eu(n, n.next, e, t) ) return !0 n = n.next } while (n !== e) return !1 } function iu(e, t) { return Jc(e.prev, e, e.next) < 0 ? Jc(e, t, e.next) >= 0 && Jc(e, e.prev, t) >= 0 : Jc(e, t, e.prev) < 0 || Jc(e, e.next, t) < 0 } function ou(e, t) { var n = e, r = !1, i = (e.x + t.x) / 2, o = (e.y + t.y) / 2 do { n.y > o !== n.next.y > o && n.next.y !== n.y && i < ((n.next.x - n.x) * (o - n.y)) / (n.next.y - n.y) + n.x && (r = !r), (n = n.next) } while (n !== e) return r } function au(e, t) { var n = new cu(e.i, e.x, e.y), r = new cu(t.i, t.x, t.y), i = e.next, o = t.prev return ( (e.next = t), (t.prev = e), (n.next = i), (i.prev = n), (r.next = n), (n.prev = r), (o.next = r), (r.prev = o), r ) } function su(e, t, n, r) { var i = new cu(e, t, n) return ( r ? ((i.next = r.next), (i.prev = r), (r.next.prev = i), (r.next = i)) : ((i.prev = i), (i.next = i)), i ) } function lu(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 cu(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 uu(e, t, n, r) { for (var i = 0, o = t, a = n - r; o < n; o += r) (i += (e[a] - e[o]) * (e[o + 1] + e[a + 1])), (a = o) return i } var hu = { area: function (e) { for (var t = e.length, n = 0, r = t - 1, i = 0; i < t; r = i++) n += e[r].x * e[i].y - e[i].x * e[r].y return 0.5 * n }, isClockWise: function (e) { return hu.area(e) < 0 }, triangulateShape: function (e, t) { var n = [], r = [], i = [] du(e), pu(n, e) var o = e.length t.forEach(du) for (var a = 0; a < t.length; a++) r.push(o), (o += t[a].length), pu(n, t[a]) for (var s = Oc.triangulate(n, r), l = 0; l < s.length; l += 3) i.push(s.slice(l, l + 3)) return i }, } function du(e) { var t = e.length t > 2 && e[t - 1].equals(e[0]) && e.pop() } function pu(e, t) { for (var n = 0; n < t.length; n++) e.push(t[n].x), e.push(t[n].y) } var fu = (function (e) { function t(t, n) { var r ;((r = e.call(this) || this).type = 'ExtrudeGeometry'), (r.parameters = { shapes: t, options: n }), (t = Array.isArray(t) ? t : [t]) for (var i = zn(r), o = [], a = [], s = 0, l = t.length; s < l; s++) c(t[s]) function c(e) { var t = [], r = void 0 !== n.curveSegments ? n.curveSegments : 12, s = void 0 !== n.steps ? n.steps : 1, l = void 0 !== n.depth ? n.depth : 100, c = void 0 === n.bevelEnabled || n.bevelEnabled, u = void 0 !== n.bevelThickness ? n.bevelThickness : 6, h = void 0 !== n.bevelSize ? n.bevelSize : u - 2, d = void 0 !== n.bevelOffset ? n.bevelOffset : 0, p = void 0 !== n.bevelSegments ? n.bevelSegments : 3, f = n.extrudePath, m = void 0 !== n.UVGenerator ? n.UVGenerator : mu void 0 !== n.amount && (console.warn( 'THREE.ExtrudeBufferGeometry: amount has been renamed to depth.', ), (l = n.amount)) var v, g, y, b, A, w = !1 f && ((v = f.getSpacedPoints(s)), (w = !0), (c = !1), (g = f.computeFrenetFrames(s, !1)), (y = new lr()), (b = new lr()), (A = new lr())), c || ((p = 0), (u = 0), (h = 0), (d = 0)) var x = e.extractPoints(r), E = x.shape, M = x.holes if (!hu.isClockWise(E)) { E = E.reverse() for (var _ = 0, T = M.length; _ < T; _++) { var S = M[_] hu.isClockWise(S) && (M[_] = S.reverse()) } } for ( var C = hu.triangulateShape(E, M), L = E, R = 0, P = M.length; R < P; R++ ) { var D = M[R] E = E.concat(D) } function O(e, t, n) { return ( t || console.error('THREE.ExtrudeGeometry: vec does not exist'), t.clone().multiplyScalar(n).add(e) ) } var I = E.length, B = C.length function F(e, t, n) { var r, i, o, a = e.x - t.x, s = e.y - t.y, l = n.x - e.x, c = n.y - e.y, u = a * a + s * s, h = a * c - s * l if (Math.abs(h) > Number.EPSILON) { var d = Math.sqrt(u), p = Math.sqrt(l * l + c * c), f = t.x - s / d, m = t.y + a / d, v = ((n.x - c / p - f) * c - (n.y + l / p - m) * l) / (a * c - s * l), g = (r = f + a * v - e.x) * r + (i = m + s * v - e.y) * i if (g <= 2) return new Jn(r, i) o = Math.sqrt(g / 2) } else { var y = !1 a > Number.EPSILON ? l > Number.EPSILON && (y = !0) : a < -Number.EPSILON ? l < -Number.EPSILON && (y = !0) : Math.sign(s) === Math.sign(c) && (y = !0), y ? ((r = -s), (i = a), (o = Math.sqrt(u))) : ((r = a), (i = s), (o = Math.sqrt(u / 2))) } return new Jn(r / o, i / o) } for ( var k = [], N = 0, U = L.length, H = U - 1, G = N + 1; N < U; N++, H++, G++ ) H === U && (H = 0), G === U && (G = 0), (k[N] = F(L[N], L[H], L[G])) for (var z, j = [], V = k.concat(), W = 0, q = M.length; W < q; W++) { var X = M[W] z = [] for ( var Y = 0, Q = X.length, Z = Q - 1, K = Y + 1; Y < Q; Y++, Z++, K++ ) Z === Q && (Z = 0), K === Q && (K = 0), (z[Y] = F(X[Y], X[Z], X[K])) j.push(z), (V = V.concat(z)) } for (var J = 0; J < p; J++) { for ( var $ = J / p, ee = u * Math.cos(($ * Math.PI) / 2), te = h * Math.sin(($ * Math.PI) / 2) + d, ne = 0, re = L.length; ne < re; ne++ ) { var ie = O(L[ne], k[ne], te) Oe(ie.x, ie.y, -ee) } for (var oe = 0, ae = M.length; oe < ae; oe++) { var se = M[oe] z = j[oe] for (var le = 0, ce = se.length; le < ce; le++) { var ue = O(se[le], z[le], te) Oe(ue.x, ue.y, -ee) } } } for (var he = h + d, de = 0; de < I; de++) { var pe = c ? O(E[de], V[de], he) : E[de] w ? (b.copy(g.normals[0]).multiplyScalar(pe.x), y.copy(g.binormals[0]).multiplyScalar(pe.y), A.copy(v[0]).add(b).add(y), Oe(A.x, A.y, A.z)) : Oe(pe.x, pe.y, 0) } for (var fe = 1; fe <= s; fe++) for (var me = 0; me < I; me++) { var ve = c ? O(E[me], V[me], he) : E[me] w ? (b.copy(g.normals[fe]).multiplyScalar(ve.x), y.copy(g.binormals[fe]).multiplyScalar(ve.y), A.copy(v[fe]).add(b).add(y), Oe(A.x, A.y, A.z)) : Oe(ve.x, ve.y, (l / s) * fe) } for (var ge = p - 1; ge >= 0; ge--) { for ( var ye = ge / p, be = u * Math.cos((ye * Math.PI) / 2), Ae = h * Math.sin((ye * Math.PI) / 2) + d, we = 0, xe = L.length; we < xe; we++ ) { var Ee = O(L[we], k[we], Ae) Oe(Ee.x, Ee.y, l + be) } for (var Me = 0, _e = M.length; Me < _e; Me++) { var Te = M[Me] z = j[Me] for (var Se = 0, Ce = Te.length; Se < Ce; Se++) { var Le = O(Te[Se], z[Se], Ae) w ? Oe(Le.x, Le.y + v[s - 1].y, v[s - 1].x + be) : Oe(Le.x, Le.y, l + be) } } } function Re() { var e = o.length / 3 if (c) { for (var t = 0, n = I * t, r = 0; r < B; r++) { var a = C[r] Ie(a[2] + n, a[1] + n, a[0] + n) } n = I * (t = s + 2 * p) for (var l = 0; l < B; l++) { var u = C[l] Ie(u[0] + n, u[1] + n, u[2] + n) } } else { for (var h = 0; h < B; h++) { var d = C[h] Ie(d[2], d[1], d[0]) } for (var f = 0; f < B; f++) { var m = C[f] Ie(m[0] + I * s, m[1] + I * s, m[2] + I * s) } } i.addGroup(e, o.length / 3 - e, 0) } function Pe() { var e = o.length / 3, t = 0 De(L, t), (t += L.length) for (var n = 0, r = M.length; n < r; n++) { var a = M[n] De(a, t), (t += a.length) } i.addGroup(e, o.length / 3 - e, 1) } function De(e, t) { for (var n = e.length; --n >= 0; ) { var r = n, i = n - 1 i < 0 && (i = e.length - 1) for (var o = 0, a = s + 2 * p; o < a; o++) { var l = I * o, c = I * (o + 1) Be(t + r + l, t + i + l, t + i + c, t + r + c) } } } function Oe(e, n, r) { t.push(e), t.push(n), t.push(r) } function Ie(e, t, n) { Fe(e), Fe(t), Fe(n) var r = o.length / 3, a = m.generateTopUV(i, o, r - 3, r - 2, r - 1) ke(a[0]), ke(a[1]), ke(a[2]) } function Be(e, t, n, r) { Fe(e), Fe(t), Fe(r), Fe(t), Fe(n), Fe(r) var a = o.length / 3, s = m.generateSideWallUV(i, o, a - 6, a - 3, a - 2, a - 1) ke(s[0]), ke(s[1]), ke(s[3]), ke(s[1]), ke(s[2]), ke(s[3]) } function Fe(e) { o.push(t[3 * e + 0]), o.push(t[3 * e + 1]), o.push(t[3 * e + 2]) } function ke(e) { a.push(e.x), a.push(e.y) } Re(), Pe() } return ( r.setAttribute('position', new Wi(o, 3)), r.setAttribute('uv', new Wi(a, 2)), r.computeVertexNormals(), r ) } return ( Gn(t, e), (t.prototype.toJSON = function () { var e = ro.prototype.toJSON.call(this) return vu(this.parameters.shapes, this.parameters.options, e) }), t ) })(ro), mu = { generateTopUV: function (e, t, n, r, i) { var o = t[3 * n], a = t[3 * n + 1], s = t[3 * r], l = t[3 * r + 1], c = t[3 * i], u = t[3 * i + 1] return [new Jn(o, a), new Jn(s, l), new Jn(c, u)] }, generateSideWallUV: function (e, t, n, r, i, o) { var a = t[3 * n], s = t[3 * n + 1], l = t[3 * n + 2], c = t[3 * r], u = t[3 * r + 1], h = t[3 * r + 2], d = t[3 * i], p = t[3 * i + 1], f = t[3 * i + 2], m = t[3 * o], v = t[3 * o + 1], g = t[3 * o + 2] return Math.abs(s - u) < 0.01 ? [ new Jn(a, 1 - l), new Jn(c, 1 - h), new Jn(d, 1 - f), new Jn(m, 1 - g), ] : [ new Jn(s, 1 - l), new Jn(u, 1 - h), new Jn(p, 1 - f), new Jn(v, 1 - g), ] }, } function vu(e, t, n) { if (((n.shapes = []), Array.isArray(e))) for (var r = 0, i = e.length; r < i; r++) { var o = e[r] n.shapes.push(o.uuid) } else n.shapes.push(e.uuid) return ( void 0 !== t.extrudePath && (n.options.extrudePath = t.extrudePath.toJSON()), n ) } var gu = (function (e) { function t(t, n) { var r void 0 === t && (t = 1), void 0 === n && (n = 0) var i = (1 + Math.sqrt(5)) / 2, o = [ -1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, 0, 0, -1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, i, 0, -1, i, 0, 1, -i, 0, -1, -i, 0, 1, ], a = [ 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, ] return ( ((r = e.call(this, o, a, t, n) || this).type = 'IcosahedronGeometry'), (r.parameters = { radius: t, detail: n }), r ) } return Gn(t, e), t })(Tc), yu = (function (e) { function t(t, n, r, i) { var o void 0 === n && (n = 12), void 0 === r && (r = 0), void 0 === i && (i = 2 * Math.PI), ((o = e.call(this) || this).type = 'LatheGeometry'), (o.parameters = { points: t, segments: n, phiStart: r, phiLength: i }), (n = Math.floor(n)), (i = Kn.clamp(i, 0, 2 * Math.PI)) for ( var a = [], s = [], l = [], c = 1 / n, u = new lr(), h = new Jn(), d = 0; d <= n; d++ ) for ( var p = r + d * c * i, f = Math.sin(p), m = Math.cos(p), v = 0; v <= t.length - 1; v++ ) (u.x = t[v].x * f), (u.y = t[v].y), (u.z = t[v].x * m), s.push(u.x, u.y, u.z), (h.x = d / n), (h.y = v / (t.length - 1)), l.push(h.x, h.y) for (var g = 0; g < n; g++) for (var y = 0; y < t.length - 1; y++) { var b = y + g * t.length, A = b, w = b + t.length, x = b + t.length + 1, E = b + 1 a.push(A, w, E), a.push(w, x, E) } if ( (o.setIndex(a), o.setAttribute('position', new Wi(s, 3)), o.setAttribute('uv', new Wi(l, 2)), o.computeVertexNormals(), i === 2 * Math.PI) ) for ( var M = o.attributes.normal.array, _ = new lr(), T = new lr(), S = new lr(), C = n * t.length * 3, L = 0, R = 0; L < t.length; L++, R += 3 ) (_.x = M[R + 0]), (_.y = M[R + 1]), (_.z = M[R + 2]), (T.x = M[C + R + 0]), (T.y = M[C + R + 1]), (T.z = M[C + R + 2]), S.addVectors(_, T).normalize(), (M[R + 0] = M[C + R + 0] = S.x), (M[R + 1] = M[C + R + 1] = S.y), (M[R + 2] = M[C + R + 2] = S.z) return o } return Gn(t, e), t })(ro), bu = (function (e) { function t(t, n) { var r void 0 === t && (t = 1), void 0 === n && (n = 0) var i = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1], o = [ 0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4, 1, 4, 2, ] return ( ((r = e.call(this, i, o, t, n) || this).type = 'OctahedronGeometry'), (r.parameters = { radius: t, detail: n }), r ) } return Gn(t, e), t })(Tc) function Au(e, t, n) { ro.call(this), (this.type = 'ParametricGeometry'), (this.parameters = { func: e, slices: t, stacks: n }) var r = [], i = [], o = [], a = [], s = 1e-5, l = new lr(), c = new lr(), u = new lr(), h = new lr(), d = new lr() e.length < 3 && console.error( 'THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.', ) for (var p = t + 1, f = 0; f <= n; f++) for (var m = f / n, v = 0; v <= t; v++) { var g = v / t e(g, m, c), i.push(c.x, c.y, c.z), g - s >= 0 ? (e(g - s, m, u), h.subVectors(c, u)) : (e(g + s, m, u), h.subVectors(u, c)), m - s >= 0 ? (e(g, m - s, u), d.subVectors(c, u)) : (e(g, m + s, u), d.subVectors(u, c)), l.crossVectors(h, d).normalize(), o.push(l.x, l.y, l.z), a.push(g, m) } for (var y = 0; y < n; y++) for (var b = 0; b < t; b++) { var A = y * p + b, w = y * p + b + 1, x = (y + 1) * p + b + 1, E = (y + 1) * p + b r.push(A, w, E), r.push(w, x, E) } this.setIndex(r), this.setAttribute('position', new Wi(i, 3)), this.setAttribute('normal', new Wi(o, 3)), this.setAttribute('uv', new Wi(a, 2)) } ;(Au.prototype = Object.create(ro.prototype)), (Au.prototype.constructor = Au) var wu = (function (e) { function t(t, n, r, i, o, a) { var s void 0 === t && (t = 0.5), void 0 === n && (n = 1), void 0 === r && (r = 8), void 0 === i && (i = 1), void 0 === o && (o = 0), void 0 === a && (a = 2 * Math.PI), ((s = e.call(this) || this).type = 'RingGeometry'), (s.parameters = { innerRadius: t, outerRadius: n, thetaSegments: r, phiSegments: i, thetaStart: o, thetaLength: a, }), (r = Math.max(3, r)) for ( var l = [], c = [], u = [], h = [], d = t, p = (n - t) / (i = Math.max(1, i)), f = new lr(), m = new Jn(), v = 0; v <= i; v++ ) { for (var g = 0; g <= r; g++) { var y = o + (g / r) * a ;(f.x = d * Math.cos(y)), (f.y = d * Math.sin(y)), c.push(f.x, f.y, f.z), u.push(0, 0, 1), (m.x = (f.x / n + 1) / 2), (m.y = (f.y / n + 1) / 2), h.push(m.x, m.y) } d += p } for (var b = 0; b < i; b++) for (var A = b * (r + 1), w = 0; w < r; w++) { var x = w + A, E = x, M = x + r + 1, _ = x + r + 2, T = x + 1 l.push(E, M, T), l.push(M, _, T) } return ( s.setIndex(l), s.setAttribute('position', new Wi(c, 3)), s.setAttribute('normal', new Wi(u, 3)), s.setAttribute('uv', new Wi(h, 2)), s ) } return Gn(t, e), t })(ro), xu = (function (e) { function t(t, n) { var r void 0 === n && (n = 12), ((r = e.call(this) || this).type = 'ShapeGeometry'), (r.parameters = { shapes: t, curveSegments: n }) var i = [], o = [], a = [], s = [], l = 0, c = 0 if (!1 === Array.isArray(t)) h(t) else for (var u = 0; u < t.length; u++) h(t[u]), r.addGroup(l, c, u), (l += c), (c = 0) function h(e) { var t = o.length / 3, r = e.extractPoints(n), l = r.shape, u = r.holes !1 === hu.isClockWise(l) && (l = l.reverse()) for (var h = 0, d = u.length; h < d; h++) { var p = u[h] !0 === hu.isClockWise(p) && (u[h] = p.reverse()) } for ( var f = hu.triangulateShape(l, u), m = 0, v = u.length; m < v; m++ ) { var g = u[m] l = l.concat(g) } for (var y = 0, b = l.length; y < b; y++) { var A = l[y] o.push(A.x, A.y, 0), a.push(0, 0, 1), s.push(A.x, A.y) } for (var w = 0, x = f.length; w < x; w++) { var E = f[w], M = E[0] + t, _ = E[1] + t, T = E[2] + t i.push(M, _, T), (c += 3) } } return ( r.setIndex(i), r.setAttribute('position', new Wi(o, 3)), r.setAttribute('normal', new Wi(a, 3)), r.setAttribute('uv', new Wi(s, 2)), r ) } return ( Gn(t, e), (t.prototype.toJSON = function () { var e = ro.prototype.toJSON.call(this) return Eu(this.parameters.shapes, e) }), t ) })(ro) function Eu(e, t) { if (((t.shapes = []), Array.isArray(e))) for (var n = 0, r = e.length; n < r; n++) { var i = e[n] t.shapes.push(i.uuid) } else t.shapes.push(e.uuid) return t } var Mu = (function (e) { function t(t, n, r, i, o, a, s) { var l void 0 === t && (t = 1), void 0 === n && (n = 8), void 0 === r && (r = 6), void 0 === i && (i = 0), void 0 === o && (o = 2 * Math.PI), void 0 === a && (a = 0), void 0 === s && (s = Math.PI), ((l = e.call(this) || this).type = 'SphereGeometry'), (l.parameters = { radius: t, widthSegments: n, heightSegments: r, phiStart: i, phiLength: o, thetaStart: a, thetaLength: s, }), (n = Math.max(3, Math.floor(n))), (r = Math.max(2, Math.floor(r))) for ( var c = Math.min(a + s, Math.PI), u = 0, h = [], d = new lr(), p = new lr(), f = [], m = [], v = [], g = [], y = 0; y <= r; y++ ) { var b = [], A = y / r, w = 0 0 == y && 0 == a ? (w = 0.5 / n) : y == r && c == Math.PI && (w = -0.5 / n) for (var x = 0; x <= n; x++) { var E = x / n ;(d.x = -t * Math.cos(i + E * o) * Math.sin(a + A * s)), (d.y = t * Math.cos(a + A * s)), (d.z = t * Math.sin(i + E * o) * Math.sin(a + A * s)), m.push(d.x, d.y, d.z), p.copy(d).normalize(), v.push(p.x, p.y, p.z), g.push(E + w, 1 - A), b.push(u++) } h.push(b) } for (var M = 0; M < r; M++) for (var _ = 0; _ < n; _++) { var T = h[M][_ + 1], S = h[M][_], C = h[M + 1][_], L = h[M + 1][_ + 1] ;(0 !== M || a > 0) && f.push(T, S, L), (M !== r - 1 || c < Math.PI) && f.push(S, C, L) } return ( l.setIndex(f), l.setAttribute('position', new Wi(m, 3)), l.setAttribute('normal', new Wi(v, 3)), l.setAttribute('uv', new Wi(g, 2)), l ) } return Gn(t, e), t })(ro), _u = (function (e) { function t(t, n) { var r void 0 === t && (t = 1), void 0 === n && (n = 0) var i = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1], o = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1] return ( ((r = e.call(this, i, o, t, n) || this).type = 'TetrahedronGeometry'), (r.parameters = { radius: t, detail: n }), r ) } return Gn(t, e), t })(Tc), Tu = (function (e) { function t(t, n) { var r void 0 === n && (n = {}) var i = n.font if (!i || !i.isFont) return ( console.error( 'THREE.TextGeometry: font parameter is not an instance of THREE.Font.', ), new ro() || zn(r) ) var o = i.generateShapes(t, n.size) return ( (n.depth = void 0 !== n.height ? n.height : 50), void 0 === n.bevelThickness && (n.bevelThickness = 10), void 0 === n.bevelSize && (n.bevelSize = 8), void 0 === n.bevelEnabled && (n.bevelEnabled = !1), ((r = e.call(this, o, n) || this).type = 'TextGeometry'), r ) } return Gn(t, e), t })(fu), Su = (function (e) { function t(t, n, r, i, o) { var a void 0 === t && (t = 1), void 0 === n && (n = 0.4), void 0 === r && (r = 8), void 0 === i && (i = 6), void 0 === o && (o = 2 * Math.PI), ((a = e.call(this) || this).type = 'TorusGeometry'), (a.parameters = { radius: t, tube: n, radialSegments: r, tubularSegments: i, arc: o, }), (r = Math.floor(r)), (i = Math.floor(i)) for ( var s = [], l = [], c = [], u = [], h = new lr(), d = new lr(), p = new lr(), f = 0; f <= r; f++ ) for (var m = 0; m <= i; m++) { var v = (m / i) * o, g = (f / r) * Math.PI * 2 ;(d.x = (t + n * Math.cos(g)) * Math.cos(v)), (d.y = (t + n * Math.cos(g)) * Math.sin(v)), (d.z = n * Math.sin(g)), l.push(d.x, d.y, d.z), (h.x = t * Math.cos(v)), (h.y = t * Math.sin(v)), p.subVectors(d, h).normalize(), c.push(p.x, p.y, p.z), u.push(m / i), u.push(f / r) } for (var y = 1; y <= r; y++) for (var b = 1; b <= i; b++) { var A = (i + 1) * y + b - 1, w = (i + 1) * (y - 1) + b - 1, x = (i + 1) * (y - 1) + b, E = (i + 1) * y + b s.push(A, w, E), s.push(w, x, E) } return ( a.setIndex(s), a.setAttribute('position', new Wi(l, 3)), a.setAttribute('normal', new Wi(c, 3)), a.setAttribute('uv', new Wi(u, 2)), a ) } return Gn(t, e), t })(ro), Cu = (function (e) { function t(t, n, r, i, o, a) { var s void 0 === t && (t = 1), void 0 === n && (n = 0.4), void 0 === r && (r = 64), void 0 === i && (i = 8), void 0 === o && (o = 2), void 0 === a && (a = 3), ((s = e.call(this) || this).type = 'TorusKnotGeometry'), (s.parameters = { radius: t, tube: n, tubularSegments: r, radialSegments: i, p: o, q: a, }), (r = Math.floor(r)), (i = Math.floor(i)) for ( var l = [], c = [], u = [], h = [], d = new lr(), p = new lr(), f = new lr(), m = new lr(), v = new lr(), g = new lr(), y = new lr(), b = 0; b <= r; ++b ) { var A = (b / r) * o * Math.PI * 2 P(A, o, a, t, f), P(A + 0.01, o, a, t, m), g.subVectors(m, f), y.addVectors(m, f), v.crossVectors(g, y), y.crossVectors(v, g), v.normalize(), y.normalize() for (var w = 0; w <= i; ++w) { var x = (w / i) * Math.PI * 2, E = -n * Math.cos(x), M = n * Math.sin(x) ;(d.x = f.x + (E * y.x + M * v.x)), (d.y = f.y + (E * y.y + M * v.y)), (d.z = f.z + (E * y.z + M * v.z)), c.push(d.x, d.y, d.z), p.subVectors(d, f).normalize(), u.push(p.x, p.y, p.z), h.push(b / r), h.push(w / i) } } for (var _ = 1; _ <= r; _++) for (var T = 1; T <= i; T++) { var S = (i + 1) * (_ - 1) + (T - 1), C = (i + 1) * _ + (T - 1), L = (i + 1) * _ + T, R = (i + 1) * (_ - 1) + T l.push(S, C, R), l.push(C, L, R) } function P(e, t, n, r, i) { var o = Math.cos(e), a = Math.sin(e), s = (n / t) * e, l = Math.cos(s) ;(i.x = r * (2 + l) * 0.5 * o), (i.y = r * (2 + l) * a * 0.5), (i.z = r * Math.sin(s) * 0.5) } return ( s.setIndex(l), s.setAttribute('position', new Wi(c, 3)), s.setAttribute('normal', new Wi(u, 3)), s.setAttribute('uv', new Wi(h, 2)), s ) } return Gn(t, e), t })(ro), Lu = (function (e) { function t(t, n, r, i, o) { var a void 0 === n && (n = 64), void 0 === r && (r = 1), void 0 === i && (i = 8), void 0 === o && (o = !1), ((a = e.call(this) || this).type = 'TubeGeometry'), (a.parameters = { path: t, tubularSegments: n, radius: r, radialSegments: i, closed: o, }) var s = t.computeFrenetFrames(n, o) ;(a.tangents = s.tangents), (a.normals = s.normals), (a.binormals = s.binormals) var l = new lr(), c = new lr(), u = new Jn(), h = new lr(), d = [], p = [], f = [], m = [] function v() { for (var e = 0; e < n; e++) g(e) g(!1 === o ? n : 0), b(), y() } function g(e) { h = t.getPointAt(e / n, h) for (var o = s.normals[e], a = s.binormals[e], u = 0; u <= i; u++) { var f = (u / i) * Math.PI * 2, m = Math.sin(f), v = -Math.cos(f) ;(c.x = v * o.x + m * a.x), (c.y = v * o.y + m * a.y), (c.z = v * o.z + m * a.z), c.normalize(), p.push(c.x, c.y, c.z), (l.x = h.x + r * c.x), (l.y = h.y + r * c.y), (l.z = h.z + r * c.z), d.push(l.x, l.y, l.z) } } function y() { for (var e = 1; e <= n; e++) for (var t = 1; t <= i; t++) { var r = (i + 1) * (e - 1) + (t - 1), o = (i + 1) * e + (t - 1), a = (i + 1) * e + t, s = (i + 1) * (e - 1) + t m.push(r, o, s), m.push(o, a, s) } } function b() { for (var e = 0; e <= n; e++) for (var t = 0; t <= i; t++) (u.x = e / n), (u.y = t / i), f.push(u.x, u.y) } return ( v(), a.setIndex(m), a.setAttribute('position', new Wi(d, 3)), a.setAttribute('normal', new Wi(p, 3)), a.setAttribute('uv', new Wi(f, 2)), a ) } return ( Gn(t, e), (t.prototype.toJSON = function () { var e = ro.prototype.toJSON.call(this) return (e.path = this.parameters.path.toJSON()), e }), t ) })(ro), Ru = (function (e) { function t(t) { var n if ( (((n = e.call(this) || this).type = 'WireframeGeometry'), !0 === t.isGeometry) ) return ( console.error( 'THREE.WireframeGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.', ), zn(n) ) var r = [], i = [0, 0], o = {}, a = new lr() if (null !== t.index) { var s = t.attributes.position, l = t.index, c = t.groups 0 === c.length && (c = [{ start: 0, count: l.count, materialIndex: 0 }]) for (var u = 0, h = c.length; u < h; ++u) for (var d = c[u], p = d.start, f = p, m = p + d.count; f < m; f += 3) for (var v = 0; v < 3; v++) { var g = l.getX(f + v), y = l.getX(f + ((v + 1) % 3)) ;(i[0] = Math.min(g, y)), (i[1] = Math.max(g, y)) var b = i[0] + ',' + i[1] void 0 === o[b] && (o[b] = { index1: i[0], index2: i[1] }) } for (var A in o) { var w = o[A] a.fromBufferAttribute(s, w.index1), r.push(a.x, a.y, a.z), a.fromBufferAttribute(s, w.index2), r.push(a.x, a.y, a.z) } } else for (var x = t.attributes.position, E = 0, M = x.count / 3; E < M; E++) for (var _ = 0; _ < 3; _++) { var T = 3 * E + _ a.fromBufferAttribute(x, T), r.push(a.x, a.y, a.z) var S = 3 * E + ((_ + 1) % 3) a.fromBufferAttribute(x, S), r.push(a.x, a.y, a.z) } return n.setAttribute('position', new Wi(r, 3)), n } return Gn(t, e), t })(ro), Pu = Object.freeze({ __proto__: null, BoxGeometry: _o, BoxBufferGeometry: _o, CircleGeometry: Ec, CircleBufferGeometry: Ec, ConeGeometry: _c, ConeBufferGeometry: _c, CylinderGeometry: Mc, CylinderBufferGeometry: Mc, DodecahedronGeometry: Sc, DodecahedronBufferGeometry: Sc, EdgesGeometry: Dc, ExtrudeGeometry: fu, ExtrudeBufferGeometry: fu, IcosahedronGeometry: gu, IcosahedronBufferGeometry: gu, LatheGeometry: yu, LatheBufferGeometry: yu, OctahedronGeometry: bu, OctahedronBufferGeometry: bu, ParametricGeometry: Au, ParametricBufferGeometry: Au, PlaneGeometry: Wo, PlaneBufferGeometry: Wo, PolyhedronGeometry: Tc, PolyhedronBufferGeometry: Tc, RingGeometry: wu, RingBufferGeometry: wu, ShapeGeometry: xu, ShapeBufferGeometry: xu, SphereGeometry: Mu, SphereBufferGeometry: Mu, TetrahedronGeometry: _u, TetrahedronBufferGeometry: _u, TextGeometry: Tu, TextBufferGeometry: Tu, TorusGeometry: Su, TorusBufferGeometry: Su, TorusKnotGeometry: Cu, TorusKnotBufferGeometry: Cu, TubeGeometry: Lu, TubeBufferGeometry: Lu, WireframeGeometry: Ru, }) function Du(e) { Di.call(this), (this.type = 'ShadowMaterial'), (this.color = new Li(0)), (this.transparent = !0), this.setValues(e) } function Ou(e) { Po.call(this, e), (this.type = 'RawShaderMaterial') } function Iu(e) { Di.call(this), (this.defines = { STANDARD: '' }), (this.type = 'MeshStandardMaterial'), (this.color = new Li(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 Li(0)), (this.emissiveIntensity = 1), (this.emissiveMap = null), (this.bumpMap = null), (this.bumpScale = 1), (this.normalMap = null), (this.normalMapType = ln), (this.normalScale = new Jn(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 = 0.98), (this.wireframe = !1), (this.wireframeLinewidth = 1), (this.wireframeLinecap = 'round'), (this.wireframeLinejoin = 'round'), (this.skinning = !1), (this.morphTargets = !1), (this.morphNormals = !1), (this.vertexTangents = !1), this.setValues(e) } function Bu(e) { Iu.call(this), (this.defines = { STANDARD: '', PHYSICAL: '' }), (this.type = 'MeshPhysicalMaterial'), (this.clearcoat = 0), (this.clearcoatMap = null), (this.clearcoatRoughness = 0), (this.clearcoatRoughnessMap = null), (this.clearcoatNormalScale = new Jn(1, 1)), (this.clearcoatNormalMap = null), (this.reflectivity = 0.5), Object.defineProperty(this, 'ior', { get: function () { return (1 + 0.4 * this.reflectivity) / (1 - 0.4 * this.reflectivity) }, set: function (e) { this.reflectivity = Kn.clamp((2.5 * (e - 1)) / (e + 1), 0, 1) }, }), (this.sheen = null), (this.transmission = 0), (this.transmissionMap = null), this.setValues(e) } function Fu(e) { Di.call(this), (this.type = 'MeshPhongMaterial'), (this.color = new Li(16777215)), (this.specular = new Li(1118481)), (this.shininess = 30), (this.map = null), (this.lightMap = null), (this.lightMapIntensity = 1), (this.aoMap = null), (this.aoMapIntensity = 1), (this.emissive = new Li(0)), (this.emissiveIntensity = 1), (this.emissiveMap = null), (this.bumpMap = null), (this.bumpScale = 1), (this.normalMap = null), (this.normalMapType = ln), (this.normalScale = new Jn(1, 1)), (this.displacementMap = null), (this.displacementScale = 1), (this.displacementBias = 0), (this.specularMap = null), (this.alphaMap = null), (this.envMap = null), (this.combine = Z), (this.reflectivity = 1), (this.refractionRatio = 0.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 ku(e) { Di.call(this), (this.defines = { TOON: '' }), (this.type = 'MeshToonMaterial'), (this.color = new Li(16777215)), (this.map = null), (this.gradientMap = null), (this.lightMap = null), (this.lightMapIntensity = 1), (this.aoMap = null), (this.aoMapIntensity = 1), (this.emissive = new Li(0)), (this.emissiveIntensity = 1), (this.emissiveMap = null), (this.bumpMap = null), (this.bumpScale = 1), (this.normalMap = null), (this.normalMapType = ln), (this.normalScale = new Jn(1, 1)), (this.displacementMap = null), (this.displacementScale = 1), (this.displacementBias = 0), (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 Nu(e) { Di.call(this), (this.type = 'MeshNormalMaterial'), (this.bumpMap = null), (this.bumpScale = 1), (this.normalMap = null), (this.normalMapType = ln), (this.normalScale = new Jn(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 Uu(e) { Di.call(this), (this.type = 'MeshLambertMaterial'), (this.color = new Li(16777215)), (this.map = null), (this.lightMap = null), (this.lightMapIntensity = 1), (this.aoMap = null), (this.aoMapIntensity = 1), (this.emissive = new Li(0)), (this.emissiveIntensity = 1), (this.emissiveMap = null), (this.specularMap = null), (this.alphaMap = null), (this.envMap = null), (this.combine = Z), (this.reflectivity = 1), (this.refractionRatio = 0.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 Hu(e) { Di.call(this), (this.defines = { MATCAP: '' }), (this.type = 'MeshMatcapMaterial'), (this.color = new Li(16777215)), (this.matcap = null), (this.map = null), (this.bumpMap = null), (this.bumpScale = 1), (this.normalMap = null), (this.normalMapType = ln), (this.normalScale = new Jn(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 Gu(e) { tc.call(this), (this.type = 'LineDashedMaterial'), (this.scale = 1), (this.dashSize = 3), (this.gapSize = 1), this.setValues(e) } ;(Du.prototype = Object.create(Di.prototype)), (Du.prototype.constructor = Du), (Du.prototype.isShadowMaterial = !0), (Du.prototype.copy = function (e) { return Di.prototype.copy.call(this, e), this.color.copy(e.color), this }), (Ou.prototype = Object.create(Po.prototype)), (Ou.prototype.constructor = Ou), (Ou.prototype.isRawShaderMaterial = !0), (Iu.prototype = Object.create(Di.prototype)), (Iu.prototype.constructor = Iu), (Iu.prototype.isMeshStandardMaterial = !0), (Iu.prototype.copy = function (e) { return ( Di.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.vertexTangents = e.vertexTangents), this ) }), (Bu.prototype = Object.create(Iu.prototype)), (Bu.prototype.constructor = Bu), (Bu.prototype.isMeshPhysicalMaterial = !0), (Bu.prototype.copy = function (e) { return ( Iu.prototype.copy.call(this, e), (this.defines = { STANDARD: '', PHYSICAL: '' }), (this.clearcoat = e.clearcoat), (this.clearcoatMap = e.clearcoatMap), (this.clearcoatRoughness = e.clearcoatRoughness), (this.clearcoatRoughnessMap = e.clearcoatRoughnessMap), (this.clearcoatNormalMap = e.clearcoatNormalMap), this.clearcoatNormalScale.copy(e.clearcoatNormalScale), (this.reflectivity = e.reflectivity), e.sheen ? (this.sheen = (this.sheen || new Li()).copy(e.sheen)) : (this.sheen = null), (this.transmission = e.transmission), (this.transmissionMap = e.transmissionMap), this ) }), (Fu.prototype = Object.create(Di.prototype)), (Fu.prototype.constructor = Fu), (Fu.prototype.isMeshPhongMaterial = !0), (Fu.prototype.copy = function (e) { return ( Di.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 ) }), (ku.prototype = Object.create(Di.prototype)), (ku.prototype.constructor = ku), (ku.prototype.isMeshToonMaterial = !0), (ku.prototype.copy = function (e) { return ( Di.prototype.copy.call(this, e), this.color.copy(e.color), (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.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 ) }), (Nu.prototype = Object.create(Di.prototype)), (Nu.prototype.constructor = Nu), (Nu.prototype.isMeshNormalMaterial = !0), (Nu.prototype.copy = function (e) { return ( Di.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 ) }), (Uu.prototype = Object.create(Di.prototype)), (Uu.prototype.constructor = Uu), (Uu.prototype.isMeshLambertMaterial = !0), (Uu.prototype.copy = function (e) { return ( Di.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 ) }), (Hu.prototype = Object.create(Di.prototype)), (Hu.prototype.constructor = Hu), (Hu.prototype.isMeshMatcapMaterial = !0), (Hu.prototype.copy = function (e) { return ( Di.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 ) }), (Gu.prototype = Object.create(tc.prototype)), (Gu.prototype.constructor = Gu), (Gu.prototype.isLineDashedMaterial = !0), (Gu.prototype.copy = function (e) { return ( tc.prototype.copy.call(this, e), (this.scale = e.scale), (this.dashSize = e.dashSize), (this.gapSize = e.gapSize), this ) }) var zu = Object.freeze({ __proto__: null, ShadowMaterial: Du, SpriteMaterial: xl, RawShaderMaterial: Ou, ShaderMaterial: Po, PointsMaterial: dc, MeshPhysicalMaterial: Bu, MeshStandardMaterial: Iu, MeshPhongMaterial: Fu, MeshToonMaterial: ku, MeshNormalMaterial: Nu, MeshLambertMaterial: Uu, MeshDepthMaterial: Qs, MeshDistanceMaterial: Zs, MeshBasicMaterial: Oi, MeshMatcapMaterial: Hu, LineDashedMaterial: Gu, LineBasicMaterial: tc, Material: Di, }), ju = { arraySlice: function (e, t, n) { return ju.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, r = new Array(n), i = 0; i !== n; ++i) r[i] = i return r.sort(t), r }, sortedArray: function (e, t, n) { for ( var r = e.length, i = new e.constructor(r), o = 0, a = 0; a !== r; ++o ) for (var s = n[o] * t, l = 0; l !== t; ++l) i[a++] = e[s + l] return i }, flattenJSON: function (e, t, n, r) { for (var i = 1, o = e[0]; void 0 !== o && void 0 === o[r]; ) o = e[i++] if (void 0 !== o) { var a = o[r] if (void 0 !== a) if (Array.isArray(a)) do { void 0 !== (a = o[r]) && (t.push(o.time), n.push.apply(n, a)), (o = e[i++]) } while (void 0 !== o) else if (void 0 !== a.toArray) do { void 0 !== (a = o[r]) && (t.push(o.time), a.toArray(n, n.length)), (o = e[i++]) } while (void 0 !== o) else do { void 0 !== (a = o[r]) && (t.push(o.time), n.push(a)), (o = e[i++]) } while (void 0 !== o) } }, subclip: function (e, t, n, r, i) { void 0 === i && (i = 30) var o = e.clone() o.name = t for (var a = [], s = 0; s < o.tracks.length; ++s) { for ( var l = o.tracks[s], c = l.getValueSize(), u = [], h = [], d = 0; d < l.times.length; ++d ) { var p = l.times[d] * i if (!(p < n || p >= r)) { u.push(l.times[d]) for (var f = 0; f < c; ++f) h.push(l.values[d * c + f]) } } 0 !== u.length && ((l.times = ju.convertArray(u, l.times.constructor)), (l.values = ju.convertArray(h, l.values.constructor)), a.push(l)) } o.tracks = a for (var m = 1 / 0, v = 0; v < o.tracks.length; ++v) m > o.tracks[v].times[0] && (m = o.tracks[v].times[0]) for (var g = 0; g < o.tracks.length; ++g) o.tracks[g].shift(-1 * m) return o.resetDuration(), o }, makeClipAdditive: function (e, t, n, r) { void 0 === t && (t = 0), void 0 === n && (n = e), void 0 === r && (r = 30), r <= 0 && (r = 30) for ( var i = n.tracks.length, o = t / r, a = function (t) { var r = n.tracks[t], i = r.ValueTypeName if ('bool' === i || 'string' === i) return 'continue' var a = e.tracks.find(function (e) { return e.name === r.name && e.ValueTypeName === i }) if (void 0 === a) return 'continue' var s = 0, l = r.getValueSize() r.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline && (s = l / 3) var c = 0, u = a.getValueSize() a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline && (c = u / 3) var h = r.times.length - 1, d = void 0 if (o <= r.times[0]) { var p = s, f = l - s d = ju.arraySlice(r.values, p, f) } else if (o >= r.times[h]) { var m = h * l + s, v = m + l - s d = ju.arraySlice(r.values, m, v) } else { var g = r.createInterpolant(), y = s, b = l - s g.evaluate(o), (d = ju.arraySlice(g.resultBuffer, y, b)) } 'quaternion' === i && new sr().fromArray(d).normalize().conjugate().toArray(d) for (var A = a.times.length, w = 0; w < A; ++w) { var x = w * u + c if ('quaternion' === i) sr.multiplyQuaternionsFlat(a.values, x, d, 0, a.values, x) else for (var E = u - 2 * c, M = 0; M < E; ++M) a.values[x + M] -= d[M] } }, s = 0; s < i; ++s ) a(s) return (e.blendMode = Xt), e }, } function Vu(e, t, n, r) { ;(this.parameterPositions = e), (this._cachedIndex = 0), (this.resultBuffer = void 0 !== r ? r : new t.constructor(n)), (this.sampleValues = t), (this.valueSize = n) } function Wu(e, t, n, r) { Vu.call(this, e, t, n, r), (this._weightPrev = -0), (this._offsetPrev = -0), (this._weightNext = -0), (this._offsetNext = -0) } function qu(e, t, n, r) { Vu.call(this, e, t, n, r) } function Xu(e, t, n, r) { Vu.call(this, e, t, n, r) } function Yu(e, t, n, r) { 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 = ju.convertArray(t, this.TimeBufferType)), (this.values = ju.convertArray(n, this.ValueBufferType)), this.setInterpolation(r || this.DefaultInterpolation) } function Qu(e, t, n) { Yu.call(this, e, t, n) } function Zu(e, t, n, r) { Yu.call(this, e, t, n, r) } function Ku(e, t, n, r) { Yu.call(this, e, t, n, r) } function Ju(e, t, n, r) { Vu.call(this, e, t, n, r) } function $u(e, t, n, r) { Yu.call(this, e, t, n, r) } function eh(e, t, n, r) { Yu.call(this, e, t, n, r) } function th(e, t, n, r) { Yu.call(this, e, t, n, r) } function nh(e, t, n, r) { void 0 === t && (t = -1), void 0 === r && (r = qt), (this.name = e), (this.tracks = n), (this.duration = t), (this.blendMode = r), (this.uuid = Kn.generateUUID()), this.duration < 0 && this.resetDuration() } function rh(e) { switch (e.toLowerCase()) { case 'scalar': case 'double': case 'float': case 'number': case 'integer': return Ku case 'vector': case 'vector2': case 'vector3': case 'vector4': return th case 'color': return Zu case 'quaternion': return $u case 'bool': case 'boolean': return Qu case 'string': return eh } throw new Error('THREE.KeyframeTrack: Unsupported typeName: ' + e) } function ih(e) { if (void 0 === e.type) throw new Error('THREE.KeyframeTrack: track type undefined, can not parse') var t = rh(e.type) if (void 0 === e.times) { var n = [], r = [] ju.flattenJSON(e.keys, n, r, 'value'), (e.times = n), (e.values = r) } return void 0 !== t.parse ? t.parse(e) : new t(e.name, e.times, e.values, e.interpolation) } Object.assign(Vu.prototype, { evaluate: function (e) { var t = this.parameterPositions, n = this._cachedIndex, r = t[n], i = t[n - 1] e: { t: { var o n: { r: if (!(e < r)) { for (var a = n + 2; ; ) { if (void 0 === r) { if (e < i) break r return ( (n = t.length), (this._cachedIndex = n), this.afterEnd_(n - 1, e, i) ) } if (n === a) break if (((i = r), e < (r = t[++n]))) break t } o = t.length break n } if (e >= i) break e var s = t[1] e < s && ((n = 2), (i = s)) for (var l = n - 2; ; ) { if (void 0 === i) return (this._cachedIndex = 0), this.beforeStart_(0, e, r) if (n === l) break if (((r = i), e >= (i = t[--n - 1]))) break t } ;(o = n), (n = 0) } for (; n < o; ) { var c = (n + o) >>> 1 e < t[c] ? (o = c) : (n = c + 1) } if (((r = t[n]), void 0 === (i = t[n - 1]))) return (this._cachedIndex = 0), this.beforeStart_(0, e, r) if (void 0 === r) return ( (n = t.length), (this._cachedIndex = n), this.afterEnd_(n - 1, i, e) ) } ;(this._cachedIndex = n), this.intervalChanged_(n, i, r) } return this.interpolate_(n, i, e, r) }, settings: null, DefaultSettings_: {}, getSettings_: function () { return this.settings || this.DefaultSettings_ }, copySampleValue_: function (e) { for ( var t = this.resultBuffer, n = this.sampleValues, r = this.valueSize, i = e * r, o = 0; o !== r; ++o ) t[o] = n[i + o] return t }, interpolate_: function () { throw new Error('call to abstract method') }, intervalChanged_: function () {}, }), Object.assign(Vu.prototype, { beforeStart_: Vu.prototype.copySampleValue_, afterEnd_: Vu.prototype.copySampleValue_, }), (Wu.prototype = Object.assign(Object.create(Vu.prototype), { constructor: Wu, DefaultSettings_: { endingStart: jt, endingEnd: jt }, intervalChanged_: function (e, t, n) { var r = this.parameterPositions, i = e - 2, o = e + 1, a = r[i], s = r[o] if (void 0 === a) switch (this.getSettings_().endingStart) { case Vt: ;(i = e), (a = 2 * t - n) break case Wt: a = t + r[(i = r.length - 2)] - r[i + 1] break default: ;(i = e), (a = n) } if (void 0 === s) switch (this.getSettings_().endingEnd) { case Vt: ;(o = e), (s = 2 * n - t) break case Wt: ;(o = 1), (s = n + r[1] - r[0]) break default: ;(o = e - 1), (s = t) } var l = 0.5 * (n - t), c = this.valueSize ;(this._weightPrev = l / (t - a)), (this._weightNext = l / (s - n)), (this._offsetPrev = i * c), (this._offsetNext = o * c) }, interpolate_: function (e, t, n, r) { for ( var i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = e * a, l = s - a, c = this._offsetPrev, u = this._offsetNext, h = this._weightPrev, d = this._weightNext, p = (n - t) / (r - t), f = p * p, m = f * p, v = -h * m + 2 * h * f - h * p, g = (1 + h) * m + (-1.5 - 2 * h) * f + (-0.5 + h) * p + 1, y = (-1 - d) * m + (1.5 + d) * f + 0.5 * p, b = d * m - d * f, A = 0; A !== a; ++A ) i[A] = v * o[c + A] + g * o[l + A] + y * o[s + A] + b * o[u + A] return i }, })), (qu.prototype = Object.assign(Object.create(Vu.prototype), { constructor: qu, interpolate_: function (e, t, n, r) { for ( var i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = e * a, l = s - a, c = (n - t) / (r - t), u = 1 - c, h = 0; h !== a; ++h ) i[h] = o[l + h] * u + o[s + h] * c return i }, })), (Xu.prototype = Object.assign(Object.create(Vu.prototype), { constructor: Xu, interpolate_: function (e) { return this.copySampleValue_(e - 1) }, })), Object.assign(Yu, { toJSON: function (e) { var t, n = e.constructor if (void 0 !== n.toJSON) t = n.toJSON(e) else { t = { name: e.name, times: ju.convertArray(e.times, Array), values: ju.convertArray(e.values, Array), } var r = e.getInterpolation() r !== e.DefaultInterpolation && (t.interpolation = r) } return (t.type = e.ValueTypeName), t }, }), Object.assign(Yu.prototype, { constructor: Yu, TimeBufferType: Float32Array, ValueBufferType: Float32Array, DefaultInterpolation: Gt, InterpolantFactoryMethodDiscrete: function (e) { return new Xu(this.times, this.values, this.getValueSize(), e) }, InterpolantFactoryMethodLinear: function (e) { return new qu(this.times, this.values, this.getValueSize(), e) }, InterpolantFactoryMethodSmooth: function (e) { return new Wu(this.times, this.values, this.getValueSize(), e) }, setInterpolation: function (e) { var t switch (e) { case Ht: t = this.InterpolantFactoryMethodDiscrete break case Gt: t = this.InterpolantFactoryMethodLinear break case zt: 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 Ht case this.InterpolantFactoryMethodLinear: return Gt case this.InterpolantFactoryMethodSmooth: return zt } }, getValueSize: function () { return this.values.length / this.times.length }, shift: function (e) { if (0 !== e) for (var t = this.times, n = 0, r = t.length; n !== r; ++n) t[n] += e return this }, scale: function (e) { if (1 !== e) for (var t = this.times, n = 0, r = t.length; n !== r; ++n) t[n] *= e return this }, trim: function (e, t) { for ( var n = this.times, r = n.length, i = 0, o = r - 1; i !== r && n[i] < e; ) ++i for (; -1 !== o && n[o] > t; ) --o if ((++o, 0 !== i || o !== r)) { i >= o && (i = (o = Math.max(o, 1)) - 1) var a = this.getValueSize() ;(this.times = ju.arraySlice(n, i, o)), (this.values = ju.arraySlice(this.values, i * a, o * a)) } 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, r = this.values, i = n.length 0 === i && (console.error('THREE.KeyframeTrack: Track is empty.', this), (e = !1)) for (var o = null, a = 0; a !== i; a++) { var s = n[a] if ('number' === typeof s && isNaN(s)) { console.error( 'THREE.KeyframeTrack: Time is not a valid number.', this, a, s, ), (e = !1) break } if (null !== o && o > s) { console.error( 'THREE.KeyframeTrack: Out of order keys.', this, a, s, o, ), (e = !1) break } o = s } if (void 0 !== r && ju.isTypedArray(r)) for (var l = 0, c = r.length; l !== c; ++l) { var u = r[l] if (isNaN(u)) { console.error( 'THREE.KeyframeTrack: Value is not a valid number.', this, l, u, ), (e = !1) break } } return e }, optimize: function () { for ( var e = ju.arraySlice(this.times), t = ju.arraySlice(this.values), n = this.getValueSize(), r = this.getInterpolation() === zt, i = e.length - 1, o = 1, a = 1; a < i; ++a ) { var s = !1, l = e[a] if (l !== e[a + 1] && (1 !== a || l !== e[0])) if (r) s = !0 else for (var c = a * n, u = c - n, h = c + n, d = 0; d !== n; ++d) { var p = t[c + d] if (p !== t[u + d] || p !== t[h + d]) { s = !0 break } } if (s) { if (a !== o) { e[o] = e[a] for (var f = a * n, m = o * n, v = 0; v !== n; ++v) t[m + v] = t[f + v] } ++o } } if (i > 0) { e[o] = e[i] for (var g = i * n, y = o * n, b = 0; b !== n; ++b) t[y + b] = t[g + b] ++o } return ( o !== e.length ? ((this.times = ju.arraySlice(e, 0, o)), (this.values = ju.arraySlice(t, 0, o * n))) : ((this.times = e), (this.values = t)), this ) }, clone: function () { var e = ju.arraySlice(this.times, 0), t = ju.arraySlice(this.values, 0), n = new (0, this.constructor)(this.name, e, t) return (n.createInterpolant = this.createInterpolant), n }, }), (Qu.prototype = Object.assign(Object.create(Yu.prototype), { constructor: Qu, ValueTypeName: 'bool', ValueBufferType: Array, DefaultInterpolation: Ht, InterpolantFactoryMethodLinear: void 0, InterpolantFactoryMethodSmooth: void 0, })), (Zu.prototype = Object.assign(Object.create(Yu.prototype), { constructor: Zu, ValueTypeName: 'color', })), (Ku.prototype = Object.assign(Object.create(Yu.prototype), { constructor: Ku, ValueTypeName: 'number', })), (Ju.prototype = Object.assign(Object.create(Vu.prototype), { constructor: Ju, interpolate_: function (e, t, n, r) { for ( var i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = (n - t) / (r - t), l = e * a, c = l + a; l !== c; l += 4 ) sr.slerpFlat(i, 0, o, l - a, o, l, s) return i }, })), ($u.prototype = Object.assign(Object.create(Yu.prototype), { constructor: $u, ValueTypeName: 'quaternion', DefaultInterpolation: Gt, InterpolantFactoryMethodLinear: function (e) { return new Ju(this.times, this.values, this.getValueSize(), e) }, InterpolantFactoryMethodSmooth: void 0, })), (eh.prototype = Object.assign(Object.create(Yu.prototype), { constructor: eh, ValueTypeName: 'string', ValueBufferType: Array, DefaultInterpolation: Ht, InterpolantFactoryMethodLinear: void 0, InterpolantFactoryMethodSmooth: void 0, })), (th.prototype = Object.assign(Object.create(Yu.prototype), { constructor: th, ValueTypeName: 'vector', })), Object.assign(nh, { parse: function (e) { for ( var t = [], n = e.tracks, r = 1 / (e.fps || 1), i = 0, o = n.length; i !== o; ++i ) t.push(ih(n[i]).scale(r)) var a = new nh(e.name, e.duration, t, e.blendMode) return (a.uuid = e.uuid), a }, toJSON: function (e) { for ( var t = [], n = e.tracks, r = { name: e.name, duration: e.duration, tracks: t, uuid: e.uuid, blendMode: e.blendMode, }, i = 0, o = n.length; i !== o; ++i ) t.push(Yu.toJSON(n[i])) return r }, CreateFromMorphTargetSequence: function (e, t, n, r) { for (var i = t.length, o = [], a = 0; a < i; a++) { var s = [], l = [] s.push((a + i - 1) % i, a, (a + 1) % i), l.push(0, 1, 0) var c = ju.getKeyframeOrder(s) ;(s = ju.sortedArray(s, 1, c)), (l = ju.sortedArray(l, 1, c)), r || 0 !== s[0] || (s.push(i), l.push(l[0])), o.push( new Ku('.morphTargetInfluences[' + t[a].name + ']', s, l).scale( 1 / n, ), ) } return new nh(e, -1, o) }, findByName: function (e, t) { var n = e if (!Array.isArray(e)) { var r = e n = (r.geometry && r.geometry.animations) || r.animations } for (var i = 0; i < n.length; i++) if (n[i].name === t) return n[i] return null }, CreateClipsFromMorphTargetSequences: function (e, t, n) { for ( var r = {}, i = /^([\w-]*?)([\d]+)$/, o = 0, a = e.length; o < a; o++ ) { var s = e[o], l = s.name.match(i) if (l && l.length > 1) { var c = l[1], u = r[c] u || (r[c] = u = []), u.push(s) } } var h = [] for (var d in r) h.push(nh.CreateFromMorphTargetSequence(d, r[d], t, n)) return h }, parseAnimation: function (e, t) { if (!e) return ( console.error( 'THREE.AnimationClip: No animation in JSONLoader data.', ), null ) for ( var n = function (e, t, n, r, i) { if (0 !== n.length) { var o = [], a = [] ju.flattenJSON(n, o, a, r), 0 !== o.length && i.push(new e(t, o, a)) } }, r = [], i = e.name || 'default', o = e.fps || 30, a = e.blendMode, s = e.length || -1, l = e.hierarchy || [], c = 0; c < l.length; c++ ) { var u = l[c].keys if (u && 0 !== u.length) if (u[0].morphTargets) { var h = {}, d = void 0 for (d = 0; d < u.length; d++) if (u[d].morphTargets) for (var p = 0; p < u[d].morphTargets.length; p++) h[u[d].morphTargets[p]] = -1 for (var f in h) { for ( var m = [], v = [], g = 0; g !== u[d].morphTargets.length; ++g ) { var y = u[d] m.push(y.time), v.push(y.morphTarget === f ? 1 : 0) } r.push(new Ku('.morphTargetInfluence[' + f + ']', m, v)) } s = h.length * (o || 1) } else { var b = '.bones[' + t[c].name + ']' n(th, b + '.position', u, 'pos', r), n($u, b + '.quaternion', u, 'rot', r), n(th, b + '.scale', u, 'scl', r) } } return 0 === r.length ? null : new nh(i, s, r, a) }, }), Object.assign(nh.prototype, { resetDuration: function () { for (var e = 0, t = 0, n = this.tracks.length; t !== n; ++t) { var r = this.tracks[t] e = Math.max(e, r.times[r.times.length - 1]) } return (this.duration = e), 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 nh(this.name, this.duration, e, this.blendMode) }, toJSON: function () { return nh.toJSON(this) }, }) var oh = { 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 = {} }, } function ah(e, t, n) { var r = this, i = !1, o = 0, a = 0, s = void 0, l = [] ;(this.onStart = void 0), (this.onLoad = e), (this.onProgress = t), (this.onError = n), (this.itemStart = function (e) { a++, !1 === i && void 0 !== r.onStart && r.onStart(e, o, a), (i = !0) }), (this.itemEnd = function (e) { o++, void 0 !== r.onProgress && r.onProgress(e, o, a), o === a && ((i = !1), void 0 !== r.onLoad && r.onLoad()) }), (this.itemError = function (e) { void 0 !== r.onError && r.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 l.push(e, t), this }), (this.removeHandler = function (e) { var t = l.indexOf(e) return -1 !== t && l.splice(t, 2), this }), (this.getHandler = function (e) { for (var t = 0, n = l.length; t < n; t += 2) { var r = l[t], i = l[t + 1] if ((r.global && (r.lastIndex = 0), r.test(e))) return i } return null }) } var sh = new ah() function lh(e) { ;(this.manager = void 0 !== e ? e : sh), (this.crossOrigin = 'anonymous'), (this.withCredentials = !1), (this.path = ''), (this.resourcePath = ''), (this.requestHeader = {}) } Object.assign(lh.prototype, { load: function () {}, loadAsync: function (e, t) { var n = this return new Promise(function (r, i) { n.load(e, r, t, i) }) }, parse: function () {}, setCrossOrigin: function (e) { return (this.crossOrigin = e), this }, setWithCredentials: function (e) { return (this.withCredentials = e), this }, setPath: function (e) { return (this.path = e), this }, setResourcePath: function (e) { return (this.resourcePath = e), this }, setRequestHeader: function (e) { return (this.requestHeader = e), this }, }) var ch = {} function uh(e) { lh.call(this, e) } function hh(e) { lh.call(this, e) } function dh(e) { lh.call(this, e) } function ph(e) { lh.call(this, e) } function fh(e) { lh.call(this, e) } function mh(e) { lh.call(this, e) } function vh(e) { lh.call(this, e) } function gh() { ;(this.type = 'Curve'), (this.arcLengthDivisions = 200) } function yh(e, t, n, r, i, o, a, s) { gh.call(this), (this.type = 'EllipseCurve'), (this.aX = e || 0), (this.aY = t || 0), (this.xRadius = n || 1), (this.yRadius = r || 1), (this.aStartAngle = i || 0), (this.aEndAngle = o || 2 * Math.PI), (this.aClockwise = a || !1), (this.aRotation = s || 0) } function bh(e, t, n, r, i, o) { yh.call(this, e, t, n, n, r, i, o), (this.type = 'ArcCurve') } function Ah() { var e = 0, t = 0, n = 0, r = 0 function i(i, o, a, s) { ;(e = i), (t = a), (n = -3 * i + 3 * o - 2 * a - s), (r = 2 * i - 2 * o + a + s) } return { initCatmullRom: function (e, t, n, r, o) { i(t, n, o * (n - e), o * (r - t)) }, initNonuniformCatmullRom: function (e, t, n, r, o, a, s) { var l = (t - e) / o - (n - e) / (o + a) + (n - t) / a, c = (n - t) / a - (r - t) / (a + s) + (r - n) / s i(t, n, (l *= a), (c *= a)) }, calc: function (i) { var o = i * i return e + t * i + n * o + r * (o * i) }, } } ;(uh.prototype = Object.assign(Object.create(lh.prototype), { constructor: uh, load: function (e, t, n, r) { void 0 === e && (e = ''), void 0 !== this.path && (e = this.path + e), (e = this.manager.resolveURL(e)) var i = this, o = oh.get(e) if (void 0 !== o) return ( i.manager.itemStart(e), setTimeout(function () { t && t(o), i.manager.itemEnd(e) }, 0), o ) if (void 0 === ch[e]) { var a, s = /^data:(.*?)(;base64)?,(.*)$/, l = e.match(s) if (l) { var c = l[1], u = !!l[2], h = l[3] ;(h = decodeURIComponent(h)), u && (h = atob(h)) try { var d, p = (this.responseType || '').toLowerCase() switch (p) { case 'arraybuffer': case 'blob': for (var f = new Uint8Array(h.length), m = 0; m < h.length; m++) f[m] = h.charCodeAt(m) d = 'blob' === p ? new Blob([f.buffer], { type: c }) : f.buffer break case 'document': var v = new DOMParser() d = v.parseFromString(h, c) break case 'json': d = JSON.parse(h) break default: d = h } setTimeout(function () { t && t(d), i.manager.itemEnd(e) }, 0) } catch (y) { setTimeout(function () { r && r(y), i.manager.itemError(e), i.manager.itemEnd(e) }, 0) } } else { for (var g in ((ch[e] = []), ch[e].push({ onLoad: t, onProgress: n, onError: r }), (a = new XMLHttpRequest()).open('GET', e, !0), a.addEventListener( 'load', function (t) { var n = this.response, r = ch[e] if ((delete ch[e], 200 === this.status || 0 === this.status)) { 0 === this.status && console.warn('THREE.FileLoader: HTTP Status 0 received.'), oh.add(e, n) for (var o = 0, a = r.length; o < a; o++) { var s = r[o] s.onLoad && s.onLoad(n) } i.manager.itemEnd(e) } else { for (var l = 0, c = r.length; l < c; l++) { var u = r[l] u.onError && u.onError(t) } i.manager.itemError(e), i.manager.itemEnd(e) } }, !1, ), a.addEventListener( 'progress', function (t) { for (var n = ch[e], r = 0, i = n.length; r < i; r++) { var o = n[r] o.onProgress && o.onProgress(t) } }, !1, ), a.addEventListener( 'error', function (t) { var n = ch[e] delete ch[e] for (var r = 0, o = n.length; r < o; r++) { var a = n[r] a.onError && a.onError(t) } i.manager.itemError(e), i.manager.itemEnd(e) }, !1, ), a.addEventListener( 'abort', function (t) { var n = ch[e] delete ch[e] for (var r = 0, o = n.length; r < o; r++) { var a = n[r] a.onError && a.onError(t) } i.manager.itemError(e), i.manager.itemEnd(e) }, !1, ), void 0 !== this.responseType && (a.responseType = this.responseType), void 0 !== this.withCredentials && (a.withCredentials = this.withCredentials), a.overrideMimeType && a.overrideMimeType( void 0 !== this.mimeType ? this.mimeType : 'text/plain', ), this.requestHeader)) a.setRequestHeader(g, this.requestHeader[g]) a.send(null) } return i.manager.itemStart(e), a } ch[e].push({ onLoad: t, onProgress: n, onError: r }) }, setResponseType: function (e) { return (this.responseType = e), this }, setMimeType: function (e) { return (this.mimeType = e), this }, })), (hh.prototype = Object.assign(Object.create(lh.prototype), { constructor: hh, load: function (t, n, r, i) { var o = this, a = new uh(o.manager) a.setPath(o.path), a.setRequestHeader(o.requestHeader), a.setWithCredentials(o.withCredentials), a.load( t, function (r) { try { n(o.parse(JSON.parse(r))) } catch (e) { i ? i(e) : console.error(e), o.manager.itemError(t) } }, r, i, ) }, parse: function (e) { for (var t = [], n = 0; n < e.length; n++) { var r = nh.parse(e[n]) t.push(r) } return t }, })), (dh.prototype = Object.assign(Object.create(lh.prototype), { constructor: dh, load: function (e, t, n, r) { var i = this, o = [], a = new Ac(), s = new uh(this.manager) s.setPath(this.path), s.setResponseType('arraybuffer'), s.setRequestHeader(this.requestHeader), s.setWithCredentials(i.withCredentials) var l = 0 function c(c) { s.load( e[c], function (e) { var n = i.parse(e, !0) ;(o[c] = { width: n.width, height: n.height, format: n.format, mipmaps: n.mipmaps, }), 6 === (l += 1) && (1 === n.mipmapCount && (a.minFilter = Ae), (a.image = o), (a.format = n.format), (a.needsUpdate = !0), t && t(a)) }, n, r, ) } if (Array.isArray(e)) for (var u = 0, h = e.length; u < h; ++u) c(u) else s.load( e, function (e) { var n = i.parse(e, !0) if (n.isCubemap) { for ( var r = n.mipmaps.length / n.mipmapCount, s = 0; s < r; s++ ) { o[s] = { mipmaps: [] } for (var l = 0; l < n.mipmapCount; l++) o[s].mipmaps.push(n.mipmaps[s * n.mipmapCount + l]), (o[s].format = n.format), (o[s].width = n.width), (o[s].height = n.height) } a.image = o } else (a.image.width = n.width), (a.image.height = n.height), (a.mipmaps = n.mipmaps) 1 === n.mipmapCount && (a.minFilter = Ae), (a.format = n.format), (a.needsUpdate = !0), t && t(a) }, n, r, ) return a }, })), (ph.prototype = Object.assign(Object.create(lh.prototype), { constructor: ph, load: function (e, t, n, r) { void 0 !== this.path && (e = this.path + e), (e = this.manager.resolveURL(e)) var i = this, o = oh.get(e) if (void 0 !== o) return ( i.manager.itemStart(e), setTimeout(function () { t && t(o), i.manager.itemEnd(e) }, 0), o ) var a = document.createElementNS('http://www.w3.org/1999/xhtml', 'img') function s() { a.removeEventListener('load', s, !1), a.removeEventListener('error', l, !1), oh.add(e, this), t && t(this), i.manager.itemEnd(e) } function l(t) { a.removeEventListener('load', s, !1), a.removeEventListener('error', l, !1), r && r(t), i.manager.itemError(e), i.manager.itemEnd(e) } return ( a.addEventListener('load', s, !1), a.addEventListener('error', l, !1), 'data:' !== e.substr(0, 5) && void 0 !== this.crossOrigin && (a.crossOrigin = this.crossOrigin), i.manager.itemStart(e), (a.src = e), a ) }, })), (fh.prototype = Object.assign(Object.create(lh.prototype), { constructor: fh, load: function (e, t, n, r) { var i = new ko(), o = new ph(this.manager) o.setCrossOrigin(this.crossOrigin), o.setPath(this.path) var a = 0 function s(n) { o.load( e[n], function (e) { ;(i.images[n] = e), 6 === ++a && ((i.needsUpdate = !0), t && t(i)) }, void 0, r, ) } for (var l = 0; l < e.length; ++l) s(l) return i }, })), (mh.prototype = Object.assign(Object.create(lh.prototype), { constructor: mh, load: function (e, t, n, r) { var i = this, o = new Uo(), a = new uh(this.manager) return ( a.setResponseType('arraybuffer'), a.setRequestHeader(this.requestHeader), a.setPath(this.path), a.setWithCredentials(i.withCredentials), a.load( e, function (e) { var n = i.parse(e) n && (void 0 !== n.image ? (o.image = n.image) : void 0 !== n.data && ((o.image.width = n.width), (o.image.height = n.height), (o.image.data = n.data)), (o.wrapS = void 0 !== n.wrapS ? n.wrapS : pe), (o.wrapT = void 0 !== n.wrapT ? n.wrapT : pe), (o.magFilter = void 0 !== n.magFilter ? n.magFilter : Ae), (o.minFilter = void 0 !== n.minFilter ? n.minFilter : Ae), (o.anisotropy = void 0 !== n.anisotropy ? n.anisotropy : 1), void 0 !== n.encoding && (o.encoding = n.encoding), void 0 !== n.flipY && (o.flipY = n.flipY), void 0 !== n.format && (o.format = n.format), void 0 !== n.type && (o.type = n.type), void 0 !== n.mipmaps && ((o.mipmaps = n.mipmaps), (o.minFilter = Ee)), 1 === n.mipmapCount && (o.minFilter = Ae), (o.needsUpdate = !0), t && t(o, n)) }, n, r, ), o ) }, })), (vh.prototype = Object.assign(Object.create(lh.prototype), { constructor: vh, load: function (e, t, n, r) { var i = new nr(), o = new ph(this.manager) return ( o.setCrossOrigin(this.crossOrigin), o.setPath(this.path), o.load( e, function (n) { i.image = n var r = e.search(/\.jpe?g($|\?)/i) > 0 || 0 === e.search(/^data\:image\/jpeg/) ;(i.format = r ? Ne : Ue), (i.needsUpdate = !0), void 0 !== t && t(i) }, n, r, ), i ) }, })), Object.assign(gh.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 = [], r = this.getPoint(0), i = 0 n.push(0) for (var o = 1; o <= e; o++) (i += (t = this.getPoint(o / e)).distanceTo(r)), n.push(i), (r = t) return (this.cacheArcLengths = n), n }, updateArcLengths: function () { ;(this.needsUpdate = !0), this.getLengths() }, getUtoTmapping: function (e, t) { var n, r = this.getLengths(), i = 0, o = r.length n = t || e * r[o - 1] for (var a, s = 0, l = o - 1; s <= l; ) if ((a = r[(i = Math.floor(s + (l - s) / 2))] - n) < 0) s = i + 1 else { if (!(a > 0)) { l = i break } l = i - 1 } if (r[(i = l)] === n) return i / (o - 1) var c = r[i] return (i + (n - c) / (r[i + 1] - c)) / (o - 1) }, getTangent: function (e, t) { var n = 1e-4, r = e - n, i = e + n r < 0 && (r = 0), i > 1 && (i = 1) var o = this.getPoint(r), a = this.getPoint(i), s = t || (o.isVector2 ? new Jn() : new lr()) return s.copy(a).sub(o).normalize(), s }, getTangentAt: function (e, t) { var n = this.getUtoTmapping(e) return this.getTangent(n, t) }, computeFrenetFrames: function (e, t) { for ( var n = new lr(), r = [], i = [], o = [], a = new lr(), s = new Fr(), l = 0; l <= e; l++ ) { var c = l / e ;(r[l] = this.getTangentAt(c, new lr())), r[l].normalize() } ;(i[0] = new lr()), (o[0] = new lr()) var u = Number.MAX_VALUE, h = Math.abs(r[0].x), d = Math.abs(r[0].y), p = Math.abs(r[0].z) h <= u && ((u = h), n.set(1, 0, 0)), d <= u && ((u = d), n.set(0, 1, 0)), p <= u && n.set(0, 0, 1), a.crossVectors(r[0], n).normalize(), i[0].crossVectors(r[0], a), o[0].crossVectors(r[0], i[0]) for (var f = 1; f <= e; f++) { if ( ((i[f] = i[f - 1].clone()), (o[f] = o[f - 1].clone()), a.crossVectors(r[f - 1], r[f]), a.length() > Number.EPSILON) ) { a.normalize() var m = Math.acos(Kn.clamp(r[f - 1].dot(r[f]), -1, 1)) i[f].applyMatrix4(s.makeRotationAxis(a, m)) } o[f].crossVectors(r[f], i[f]) } if (!0 === t) { var v = Math.acos(Kn.clamp(i[0].dot(i[e]), -1, 1)) ;(v /= e), r[0].dot(a.crossVectors(i[0], i[e])) > 0 && (v = -v) for (var g = 1; g <= e; g++) i[g].applyMatrix4(s.makeRotationAxis(r[g], v * g)), o[g].crossVectors(r[g], i[g]) } return { tangents: r, normals: i, binormals: o } }, 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 }, }), (yh.prototype = Object.create(gh.prototype)), (yh.prototype.constructor = yh), (yh.prototype.isEllipseCurve = !0), (yh.prototype.getPoint = function (e, t) { for ( var n = t || new Jn(), r = 2 * Math.PI, i = this.aEndAngle - this.aStartAngle, o = Math.abs(i) < Number.EPSILON; i < 0; ) i += r for (; i > r; ) i -= r i < Number.EPSILON && (i = o ? 0 : r), !0 !== this.aClockwise || o || (i === r ? (i = -r) : (i -= r)) var a = this.aStartAngle + e * i, s = this.aX + this.xRadius * Math.cos(a), l = this.aY + this.yRadius * Math.sin(a) if (0 !== this.aRotation) { var c = Math.cos(this.aRotation), u = Math.sin(this.aRotation), h = s - this.aX, d = l - this.aY ;(s = h * c - d * u + this.aX), (l = h * u + d * c + this.aY) } return n.set(s, l) }), (yh.prototype.copy = function (e) { return ( gh.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 ) }), (yh.prototype.toJSON = function () { var e = gh.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 ) }), (yh.prototype.fromJSON = function (e) { return ( gh.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 ) }), (bh.prototype = Object.create(yh.prototype)), (bh.prototype.constructor = bh), (bh.prototype.isArcCurve = !0) var wh = new lr(), xh = new Ah(), Eh = new Ah(), Mh = new Ah() function _h(e, t, n, r) { void 0 === e && (e = []), void 0 === t && (t = !1), void 0 === n && (n = 'centripetal'), void 0 === r && (r = 0.5), gh.call(this), (this.type = 'CatmullRomCurve3'), (this.points = e), (this.closed = t), (this.curveType = n), (this.tension = r) } function Th(e, t, n, r, i) { var o = 0.5 * (r - t), a = 0.5 * (i - n), s = e * e return ( (2 * n - 2 * r + o + a) * (e * s) + (-3 * n + 3 * r - 2 * o - a) * s + o * e + n ) } function Sh(e, t) { var n = 1 - e return n * n * t } function Ch(e, t) { return 2 * (1 - e) * e * t } function Lh(e, t) { return e * e * t } function Rh(e, t, n, r) { return Sh(e, t) + Ch(e, n) + Lh(e, r) } function Ph(e, t) { var n = 1 - e return n * n * n * t } function Dh(e, t) { var n = 1 - e return 3 * n * n * e * t } function Oh(e, t) { return 3 * (1 - e) * e * e * t } function Ih(e, t) { return e * e * e * t } function Bh(e, t, n, r, i) { return Ph(e, t) + Dh(e, n) + Oh(e, r) + Ih(e, i) } function Fh(e, t, n, r) { void 0 === e && (e = new Jn()), void 0 === t && (t = new Jn()), void 0 === n && (n = new Jn()), void 0 === r && (r = new Jn()), gh.call(this), (this.type = 'CubicBezierCurve'), (this.v0 = e), (this.v1 = t), (this.v2 = n), (this.v3 = r) } function kh(e, t, n, r) { void 0 === e && (e = new lr()), void 0 === t && (t = new lr()), void 0 === n && (n = new lr()), void 0 === r && (r = new lr()), gh.call(this), (this.type = 'CubicBezierCurve3'), (this.v0 = e), (this.v1 = t), (this.v2 = n), (this.v3 = r) } function Nh(e, t) { void 0 === e && (e = new Jn()), void 0 === t && (t = new Jn()), gh.call(this), (this.type = 'LineCurve'), (this.v1 = e), (this.v2 = t) } function Uh(e, t) { void 0 === e && (e = new lr()), void 0 === t && (t = new lr()), gh.call(this), (this.type = 'LineCurve3'), (this.v1 = e), (this.v2 = t) } function Hh(e, t, n) { void 0 === e && (e = new Jn()), void 0 === t && (t = new Jn()), void 0 === n && (n = new Jn()), gh.call(this), (this.type = 'QuadraticBezierCurve'), (this.v0 = e), (this.v1 = t), (this.v2 = n) } function Gh(e, t, n) { void 0 === e && (e = new lr()), void 0 === t && (t = new lr()), void 0 === n && (n = new lr()), gh.call(this), (this.type = 'QuadraticBezierCurve3'), (this.v0 = e), (this.v1 = t), (this.v2 = n) } function zh(e) { void 0 === e && (e = []), gh.call(this), (this.type = 'SplineCurve'), (this.points = e) } ;(_h.prototype = Object.create(gh.prototype)), (_h.prototype.constructor = _h), (_h.prototype.isCatmullRomCurve3 = !0), (_h.prototype.getPoint = function (e, t) { void 0 === t && (t = new lr()) var n, r, i = t, o = this.points, a = o.length, s = (a - (this.closed ? 0 : 1)) * e, l = Math.floor(s), c = s - l this.closed ? (l += l > 0 ? 0 : (Math.floor(Math.abs(l) / a) + 1) * a) : 0 === c && l === a - 1 && ((l = a - 2), (c = 1)), this.closed || l > 0 ? (n = o[(l - 1) % a]) : (wh.subVectors(o[0], o[1]).add(o[0]), (n = wh)) var u = o[l % a], h = o[(l + 1) % a] if ( (this.closed || l + 2 < a ? (r = o[(l + 2) % a]) : (wh.subVectors(o[a - 1], o[a - 2]).add(o[a - 1]), (r = wh)), 'centripetal' === this.curveType || 'chordal' === this.curveType) ) { var d = 'chordal' === this.curveType ? 0.5 : 0.25, p = Math.pow(n.distanceToSquared(u), d), f = Math.pow(u.distanceToSquared(h), d), m = Math.pow(h.distanceToSquared(r), d) f < 1e-4 && (f = 1), p < 1e-4 && (p = f), m < 1e-4 && (m = f), xh.initNonuniformCatmullRom(n.x, u.x, h.x, r.x, p, f, m), Eh.initNonuniformCatmullRom(n.y, u.y, h.y, r.y, p, f, m), Mh.initNonuniformCatmullRom(n.z, u.z, h.z, r.z, p, f, m) } else 'catmullrom' === this.curveType && (xh.initCatmullRom(n.x, u.x, h.x, r.x, this.tension), Eh.initCatmullRom(n.y, u.y, h.y, r.y, this.tension), Mh.initCatmullRom(n.z, u.z, h.z, r.z, this.tension)) return i.set(xh.calc(c), Eh.calc(c), Mh.calc(c)), i }), (_h.prototype.copy = function (e) { gh.prototype.copy.call(this, e), (this.points = []) for (var t = 0, n = e.points.length; t < n; t++) { var r = e.points[t] this.points.push(r.clone()) } return ( (this.closed = e.closed), (this.curveType = e.curveType), (this.tension = e.tension), this ) }), (_h.prototype.toJSON = function () { var e = gh.prototype.toJSON.call(this) e.points = [] for (var t = 0, n = this.points.length; t < n; t++) { var r = this.points[t] e.points.push(r.toArray()) } return ( (e.closed = this.closed), (e.curveType = this.curveType), (e.tension = this.tension), e ) }), (_h.prototype.fromJSON = function (e) { gh.prototype.fromJSON.call(this, e), (this.points = []) for (var t = 0, n = e.points.length; t < n; t++) { var r = e.points[t] this.points.push(new lr().fromArray(r)) } return ( (this.closed = e.closed), (this.curveType = e.curveType), (this.tension = e.tension), this ) }), (Fh.prototype = Object.create(gh.prototype)), (Fh.prototype.constructor = Fh), (Fh.prototype.isCubicBezierCurve = !0), (Fh.prototype.getPoint = function (e, t) { void 0 === t && (t = new Jn()) var n = t, r = this.v0, i = this.v1, o = this.v2, a = this.v3 return n.set(Bh(e, r.x, i.x, o.x, a.x), Bh(e, r.y, i.y, o.y, a.y)), n }), (Fh.prototype.copy = function (e) { return ( gh.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 ) }), (Fh.prototype.toJSON = function () { var e = gh.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 ) }), (Fh.prototype.fromJSON = function (e) { return ( gh.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 ) }), (kh.prototype = Object.create(gh.prototype)), (kh.prototype.constructor = kh), (kh.prototype.isCubicBezierCurve3 = !0), (kh.prototype.getPoint = function (e, t) { void 0 === t && (t = new lr()) var n = t, r = this.v0, i = this.v1, o = this.v2, a = this.v3 return ( n.set( Bh(e, r.x, i.x, o.x, a.x), Bh(e, r.y, i.y, o.y, a.y), Bh(e, r.z, i.z, o.z, a.z), ), n ) }), (kh.prototype.copy = function (e) { return ( gh.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 ) }), (kh.prototype.toJSON = function () { var e = gh.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 ) }), (kh.prototype.fromJSON = function (e) { return ( gh.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 ) }), (Nh.prototype = Object.create(gh.prototype)), (Nh.prototype.constructor = Nh), (Nh.prototype.isLineCurve = !0), (Nh.prototype.getPoint = function (e, t) { void 0 === t && (t = new Jn()) var n = t return ( 1 === e ? n.copy(this.v2) : (n.copy(this.v2).sub(this.v1), n.multiplyScalar(e).add(this.v1)), n ) }), (Nh.prototype.getPointAt = function (e, t) { return this.getPoint(e, t) }), (Nh.prototype.getTangent = function (e, t) { var n = t || new Jn() return n.copy(this.v2).sub(this.v1).normalize(), n }), (Nh.prototype.copy = function (e) { return ( gh.prototype.copy.call(this, e), this.v1.copy(e.v1), this.v2.copy(e.v2), this ) }), (Nh.prototype.toJSON = function () { var e = gh.prototype.toJSON.call(this) return (e.v1 = this.v1.toArray()), (e.v2 = this.v2.toArray()), e }), (Nh.prototype.fromJSON = function (e) { return ( gh.prototype.fromJSON.call(this, e), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this ) }), (Uh.prototype = Object.create(gh.prototype)), (Uh.prototype.constructor = Uh), (Uh.prototype.isLineCurve3 = !0), (Uh.prototype.getPoint = function (e, t) { void 0 === t && (t = new lr()) var n = t return ( 1 === e ? n.copy(this.v2) : (n.copy(this.v2).sub(this.v1), n.multiplyScalar(e).add(this.v1)), n ) }), (Uh.prototype.getPointAt = function (e, t) { return this.getPoint(e, t) }), (Uh.prototype.copy = function (e) { return ( gh.prototype.copy.call(this, e), this.v1.copy(e.v1), this.v2.copy(e.v2), this ) }), (Uh.prototype.toJSON = function () { var e = gh.prototype.toJSON.call(this) return (e.v1 = this.v1.toArray()), (e.v2 = this.v2.toArray()), e }), (Uh.prototype.fromJSON = function (e) { return ( gh.prototype.fromJSON.call(this, e), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this ) }), (Hh.prototype = Object.create(gh.prototype)), (Hh.prototype.constructor = Hh), (Hh.prototype.isQuadraticBezierCurve = !0), (Hh.prototype.getPoint = function (e, t) { void 0 === t && (t = new Jn()) var n = t, r = this.v0, i = this.v1, o = this.v2 return n.set(Rh(e, r.x, i.x, o.x), Rh(e, r.y, i.y, o.y)), n }), (Hh.prototype.copy = function (e) { return ( gh.prototype.copy.call(this, e), this.v0.copy(e.v0), this.v1.copy(e.v1), this.v2.copy(e.v2), this ) }), (Hh.prototype.toJSON = function () { var e = gh.prototype.toJSON.call(this) return ( (e.v0 = this.v0.toArray()), (e.v1 = this.v1.toArray()), (e.v2 = this.v2.toArray()), e ) }), (Hh.prototype.fromJSON = function (e) { return ( gh.prototype.fromJSON.call(this, e), this.v0.fromArray(e.v0), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this ) }), (Gh.prototype = Object.create(gh.prototype)), (Gh.prototype.constructor = Gh), (Gh.prototype.isQuadraticBezierCurve3 = !0), (Gh.prototype.getPoint = function (e, t) { void 0 === t && (t = new lr()) var n = t, r = this.v0, i = this.v1, o = this.v2 return ( n.set(Rh(e, r.x, i.x, o.x), Rh(e, r.y, i.y, o.y), Rh(e, r.z, i.z, o.z)), n ) }), (Gh.prototype.copy = function (e) { return ( gh.prototype.copy.call(this, e), this.v0.copy(e.v0), this.v1.copy(e.v1), this.v2.copy(e.v2), this ) }), (Gh.prototype.toJSON = function () { var e = gh.prototype.toJSON.call(this) return ( (e.v0 = this.v0.toArray()), (e.v1 = this.v1.toArray()), (e.v2 = this.v2.toArray()), e ) }), (Gh.prototype.fromJSON = function (e) { return ( gh.prototype.fromJSON.call(this, e), this.v0.fromArray(e.v0), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this ) }), (zh.prototype = Object.create(gh.prototype)), (zh.prototype.constructor = zh), (zh.prototype.isSplineCurve = !0), (zh.prototype.getPoint = function (e, t) { void 0 === t && (t = new Jn()) var n = t, r = this.points, i = (r.length - 1) * e, o = Math.floor(i), a = i - o, s = r[0 === o ? o : o - 1], l = r[o], c = r[o > r.length - 2 ? r.length - 1 : o + 1], u = r[o > r.length - 3 ? r.length - 1 : o + 2] return n.set(Th(a, s.x, l.x, c.x, u.x), Th(a, s.y, l.y, c.y, u.y)), n }), (zh.prototype.copy = function (e) { gh.prototype.copy.call(this, e), (this.points = []) for (var t = 0, n = e.points.length; t < n; t++) { var r = e.points[t] this.points.push(r.clone()) } return this }), (zh.prototype.toJSON = function () { var e = gh.prototype.toJSON.call(this) e.points = [] for (var t = 0, n = this.points.length; t < n; t++) { var r = this.points[t] e.points.push(r.toArray()) } return e }), (zh.prototype.fromJSON = function (e) { gh.prototype.fromJSON.call(this, e), (this.points = []) for (var t = 0, n = e.points.length; t < n; t++) { var r = e.points[t] this.points.push(new Jn().fromArray(r)) } return this }) var jh = Object.freeze({ __proto__: null, ArcCurve: bh, CatmullRomCurve3: _h, CubicBezierCurve: Fh, CubicBezierCurve3: kh, EllipseCurve: yh, LineCurve: Nh, LineCurve3: Uh, QuadraticBezierCurve: Hh, QuadraticBezierCurve3: Gh, SplineCurve: zh, }) function Vh() { gh.call(this), (this.type = 'CurvePath'), (this.curves = []), (this.autoClose = !1) } function Wh(e) { Vh.call(this), (this.type = 'Path'), (this.currentPoint = new Jn()), e && this.setFromPoints(e) } function qh(e) { Wh.call(this, e), (this.uuid = Kn.generateUUID()), (this.type = 'Shape'), (this.holes = []) } function Xh(e, t) { void 0 === t && (t = 1), si.call(this), (this.type = 'Light'), (this.color = new Li(e)), (this.intensity = t) } function Yh(e, t, n) { Xh.call(this, e, n), (this.type = 'HemisphereLight'), this.position.copy(si.DefaultUp), this.updateMatrix(), (this.groundColor = new Li(t)) } function Qh(e) { ;(this.camera = e), (this.bias = 0), (this.normalBias = 0), (this.radius = 1), (this.mapSize = new Jn(512, 512)), (this.map = null), (this.mapPass = null), (this.matrix = new Fr()), (this.autoUpdate = !0), (this.needsUpdate = !1), (this._frustum = new zo()), (this._frameExtents = new Jn(1, 1)), (this._viewportCount = 1), (this._viewports = [new ir(0, 0, 1, 1)]) } function Zh() { Qh.call(this, new Oo(50, 1, 0.5, 500)), (this.focus = 1) } function Kh(e, t, n, r, i, o) { Xh.call(this, e, t), (this.type = 'SpotLight'), this.position.copy(si.DefaultUp), this.updateMatrix(), (this.target = new si()), 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 !== r ? r : Math.PI / 3), (this.penumbra = void 0 !== i ? i : 0), (this.decay = void 0 !== o ? o : 1), (this.shadow = new Zh()) } function Jh() { Qh.call(this, new Oo(90, 1, 0.5, 500)), (this._frameExtents = new Jn(4, 2)), (this._viewportCount = 6), (this._viewports = [ new ir(2, 1, 1, 1), new ir(0, 1, 1, 1), new ir(3, 1, 1, 1), new ir(1, 1, 1, 1), new ir(3, 0, 1, 1), new ir(1, 0, 1, 1), ]), (this._cubeDirections = [ new lr(1, 0, 0), new lr(-1, 0, 0), new lr(0, 0, 1), new lr(0, 0, -1), new lr(0, 1, 0), new lr(0, -1, 0), ]), (this._cubeUps = [ new lr(0, 1, 0), new lr(0, 1, 0), new lr(0, 1, 0), new lr(0, 1, 0), new lr(0, 0, 1), new lr(0, 0, -1), ]) } function $h(e, t, n, r) { Xh.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 !== r ? r : 1), (this.shadow = new Jh()) } function ed(e, t, n, r, i, o) { void 0 === e && (e = -1), void 0 === t && (t = 1), void 0 === n && (n = 1), void 0 === r && (r = -1), void 0 === i && (i = 0.1), void 0 === o && (o = 2e3), Do.call(this), (this.type = 'OrthographicCamera'), (this.zoom = 1), (this.view = null), (this.left = e), (this.right = t), (this.top = n), (this.bottom = r), (this.near = i), (this.far = o), this.updateProjectionMatrix() } function td() { Qh.call(this, new ed(-5, 5, 5, -5, 0.5, 500)) } function nd(e, t) { Xh.call(this, e, t), (this.type = 'DirectionalLight'), this.position.copy(si.DefaultUp), this.updateMatrix(), (this.target = new si()), (this.shadow = new td()) } function rd(e, t) { Xh.call(this, e, t), (this.type = 'AmbientLight') } function id(e, t, n, r) { Xh.call(this, e, t), (this.type = 'RectAreaLight'), (this.width = void 0 !== n ? n : 10), (this.height = void 0 !== r ? r : 10) } ;(Vh.prototype = Object.assign(Object.create(gh.prototype), { constructor: Vh, 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 Nh(t, e)) }, getPoint: function (e) { for ( var t = e * this.getLength(), n = this.getCurveLengths(), r = 0; r < n.length; ) { if (n[r] >= t) { var i = n[r] - t, o = this.curves[r], a = o.getLength(), s = 0 === a ? 0 : 1 - i / a return o.getPointAt(s) } r++ } 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, r = this.curves.length; n < r; 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) { void 0 === e && (e = 12) for (var t, n = [], r = 0, i = this.curves; r < i.length; r++) for ( var o = i[r], a = o && o.isEllipseCurve ? 2 * e : o && (o.isLineCurve || o.isLineCurve3) ? 1 : o && o.isSplineCurve ? e * o.points.length : e, s = o.getPoints(a), l = 0; l < s.length; l++ ) { var c = s[l] ;(t && t.equals(c)) || (n.push(c), (t = c)) } return ( this.autoClose && n.length > 1 && !n[n.length - 1].equals(n[0]) && n.push(n[0]), n ) }, copy: function (e) { gh.prototype.copy.call(this, e), (this.curves = []) for (var t = 0, n = e.curves.length; t < n; t++) { var r = e.curves[t] this.curves.push(r.clone()) } return (this.autoClose = e.autoClose), this }, toJSON: function () { var e = gh.prototype.toJSON.call(this) ;(e.autoClose = this.autoClose), (e.curves = []) for (var t = 0, n = this.curves.length; t < n; t++) { var r = this.curves[t] e.curves.push(r.toJSON()) } return e }, fromJSON: function (e) { gh.prototype.fromJSON.call(this, e), (this.autoClose = e.autoClose), (this.curves = []) for (var t = 0, n = e.curves.length; t < n; t++) { var r = e.curves[t] this.curves.push(new jh[r.type]().fromJSON(r)) } return this }, })), (Wh.prototype = Object.assign(Object.create(Vh.prototype), { constructor: Wh, 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 n = new Nh(this.currentPoint.clone(), new Jn(e, t)) return this.curves.push(n), this.currentPoint.set(e, t), this }, quadraticCurveTo: function (e, t, n, r) { var i = new Hh(this.currentPoint.clone(), new Jn(e, t), new Jn(n, r)) return this.curves.push(i), this.currentPoint.set(n, r), this }, bezierCurveTo: function (e, t, n, r, i, o) { var a = new Fh( this.currentPoint.clone(), new Jn(e, t), new Jn(n, r), new Jn(i, o), ) return this.curves.push(a), this.currentPoint.set(i, o), this }, splineThru: function (e) { var t = new zh([this.currentPoint.clone()].concat(e)) return this.curves.push(t), this.currentPoint.copy(e[e.length - 1]), this }, arc: function (e, t, n, r, i, o) { var a = this.currentPoint.x, s = this.currentPoint.y return this.absarc(e + a, t + s, n, r, i, o), this }, absarc: function (e, t, n, r, i, o) { return this.absellipse(e, t, n, n, r, i, o), this }, ellipse: function (e, t, n, r, i, o, a, s) { var l = this.currentPoint.x, c = this.currentPoint.y return this.absellipse(e + l, t + c, n, r, i, o, a, s), this }, absellipse: function (e, t, n, r, i, o, a, s) { var l = new yh(e, t, n, r, i, o, a, s) if (this.curves.length > 0) { var c = l.getPoint(0) c.equals(this.currentPoint) || this.lineTo(c.x, c.y) } this.curves.push(l) var u = l.getPoint(1) return this.currentPoint.copy(u), this }, copy: function (e) { return ( Vh.prototype.copy.call(this, e), this.currentPoint.copy(e.currentPoint), this ) }, toJSON: function () { var e = Vh.prototype.toJSON.call(this) return (e.currentPoint = this.currentPoint.toArray()), e }, fromJSON: function (e) { return ( Vh.prototype.fromJSON.call(this, e), this.currentPoint.fromArray(e.currentPoint), this ) }, })), (qh.prototype = Object.assign(Object.create(Wh.prototype), { constructor: qh, getPointsHoles: function (e) { for (var t = [], n = 0, r = this.holes.length; n < r; 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) { Wh.prototype.copy.call(this, e), (this.holes = []) for (var t = 0, n = e.holes.length; t < n; t++) { var r = e.holes[t] this.holes.push(r.clone()) } return this }, toJSON: function () { var e = Wh.prototype.toJSON.call(this) ;(e.uuid = this.uuid), (e.holes = []) for (var t = 0, n = this.holes.length; t < n; t++) { var r = this.holes[t] e.holes.push(r.toJSON()) } return e }, fromJSON: function (e) { Wh.prototype.fromJSON.call(this, e), (this.uuid = e.uuid), (this.holes = []) for (var t = 0, n = e.holes.length; t < n; t++) { var r = e.holes[t] this.holes.push(new Wh().fromJSON(r)) } return this }, })), (Xh.prototype = Object.assign(Object.create(si.prototype), { constructor: Xh, isLight: !0, copy: function (e) { return ( si.prototype.copy.call(this, e), this.color.copy(e.color), (this.intensity = e.intensity), this ) }, toJSON: function (e) { var t = si.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 ) }, })), (Yh.prototype = Object.assign(Object.create(Xh.prototype), { constructor: Yh, isHemisphereLight: !0, copy: function (e) { return ( Xh.prototype.copy.call(this, e), this.groundColor.copy(e.groundColor), this ) }, })), Object.assign(Qh.prototype, { _projScreenMatrix: new Fr(), _lightPositionWorld: new lr(), _lookTarget: new lr(), getViewportCount: function () { return this._viewportCount }, getFrustum: function () { return this._frustum }, updateMatrices: function (e) { var t = this.camera, n = this.matrix, r = this._projScreenMatrix, i = this._lookTarget, o = this._lightPositionWorld o.setFromMatrixPosition(e.matrixWorld), t.position.copy(o), i.setFromMatrixPosition(e.target.matrixWorld), t.lookAt(i), t.updateMatrixWorld(), r.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse), this._frustum.setFromProjectionMatrix(r), n.set(0.5, 0, 0, 0.5, 0, 0.5, 0, 0.5, 0, 0, 0.5, 0.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), 0 !== this.normalBias && (e.normalBias = this.normalBias), 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 ) }, }), (Zh.prototype = Object.assign(Object.create(Qh.prototype), { constructor: Zh, isSpotLightShadow: !0, updateMatrices: function (e) { var t = this.camera, n = 2 * Kn.RAD2DEG * e.angle * this.focus, r = this.mapSize.width / this.mapSize.height, i = e.distance || t.far ;(n === t.fov && r === t.aspect && i === t.far) || ((t.fov = n), (t.aspect = r), (t.far = i), t.updateProjectionMatrix()), Qh.prototype.updateMatrices.call(this, e) }, })), (Kh.prototype = Object.assign(Object.create(Xh.prototype), { constructor: Kh, isSpotLight: !0, copy: function (e) { return ( Xh.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 ) }, })), (Jh.prototype = Object.assign(Object.create(Qh.prototype), { constructor: Jh, isPointLightShadow: !0, updateMatrices: function (e, t) { void 0 === t && (t = 0) var n = this.camera, r = this.matrix, i = this._lightPositionWorld, o = this._lookTarget, a = this._projScreenMatrix i.setFromMatrixPosition(e.matrixWorld), n.position.copy(i), o.copy(n.position), o.add(this._cubeDirections[t]), n.up.copy(this._cubeUps[t]), n.lookAt(o), n.updateMatrixWorld(), r.makeTranslation(-i.x, -i.y, -i.z), a.multiplyMatrices(n.projectionMatrix, n.matrixWorldInverse), this._frustum.setFromProjectionMatrix(a) }, })), ($h.prototype = Object.assign(Object.create(Xh.prototype), { constructor: $h, isPointLight: !0, copy: function (e) { return ( Xh.prototype.copy.call(this, e), (this.distance = e.distance), (this.decay = e.decay), (this.shadow = e.shadow.clone()), this ) }, })), (ed.prototype = Object.assign(Object.create(Do.prototype), { constructor: ed, isOrthographicCamera: !0, copy: function (e, t) { return ( Do.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, r, i, o) { 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 = r), (this.view.width = i), (this.view.height = o), 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, r = (this.top + this.bottom) / 2, i = n - e, o = n + e, a = r + t, s = r - t if (null !== this.view && this.view.enabled) { var l = (this.right - this.left) / this.view.fullWidth / this.zoom, c = (this.top - this.bottom) / this.view.fullHeight / this.zoom ;(o = (i += l * this.view.offsetX) + l * this.view.width), (s = (a -= c * this.view.offsetY) - c * this.view.height) } this.projectionMatrix.makeOrthographic(i, o, a, s, this.near, this.far), this.projectionMatrixInverse.copy(this.projectionMatrix).invert() }, toJSON: function (e) { var t = si.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 ) }, })), (td.prototype = Object.assign(Object.create(Qh.prototype), { constructor: td, isDirectionalLightShadow: !0, updateMatrices: function (e) { Qh.prototype.updateMatrices.call(this, e) }, })), (nd.prototype = Object.assign(Object.create(Xh.prototype), { constructor: nd, isDirectionalLight: !0, copy: function (e) { return ( Xh.prototype.copy.call(this, e), (this.target = e.target.clone()), (this.shadow = e.shadow.clone()), this ) }, })), (rd.prototype = Object.assign(Object.create(Xh.prototype), { constructor: rd, isAmbientLight: !0, })), (id.prototype = Object.assign(Object.create(Xh.prototype), { constructor: id, isRectAreaLight: !0, copy: function (e) { return ( Xh.prototype.copy.call(this, e), (this.width = e.width), (this.height = e.height), this ) }, toJSON: function (e) { var t = Xh.prototype.toJSON.call(this, e) return (t.object.width = this.width), (t.object.height = this.height), t }, })) var od = (function () { function e() { Object.defineProperty(this, 'isSphericalHarmonics3', { value: !0 }), (this.coefficients = []) for (var e = 0; e < 9; e++) this.coefficients.push(new lr()) } var t = e.prototype return ( (t.set = function (e) { for (var t = 0; t < 9; t++) this.coefficients[t].copy(e[t]) return this }), (t.zero = function () { for (var e = 0; e < 9; e++) this.coefficients[e].set(0, 0, 0) return this }), (t.getAt = function (e, t) { var n = e.x, r = e.y, i = e.z, o = this.coefficients return ( t.copy(o[0]).multiplyScalar(0.282095), t.addScaledVector(o[1], 0.488603 * r), t.addScaledVector(o[2], 0.488603 * i), t.addScaledVector(o[3], 0.488603 * n), t.addScaledVector(o[4], n * r * 1.092548), t.addScaledVector(o[5], r * i * 1.092548), t.addScaledVector(o[6], 0.315392 * (3 * i * i - 1)), t.addScaledVector(o[7], n * i * 1.092548), t.addScaledVector(o[8], 0.546274 * (n * n - r * r)), t ) }), (t.getIrradianceAt = function (e, t) { var n = e.x, r = e.y, i = e.z, o = this.coefficients return ( t.copy(o[0]).multiplyScalar(0.886227), t.addScaledVector(o[1], 1.023328 * r), t.addScaledVector(o[2], 1.023328 * i), t.addScaledVector(o[3], 1.023328 * n), t.addScaledVector(o[4], 0.858086 * n * r), t.addScaledVector(o[5], 0.858086 * r * i), t.addScaledVector(o[6], 0.743125 * i * i - 0.247708), t.addScaledVector(o[7], 0.858086 * n * i), t.addScaledVector(o[8], 0.429043 * (n * n - r * r)), t ) }), (t.add = function (e) { for (var t = 0; t < 9; t++) this.coefficients[t].add(e.coefficients[t]) return this }), (t.addScaledSH = function (e, t) { for (var n = 0; n < 9; n++) this.coefficients[n].addScaledVector(e.coefficients[n], t) return this }), (t.scale = function (e) { for (var t = 0; t < 9; t++) this.coefficients[t].multiplyScalar(e) return this }), (t.lerp = function (e, t) { for (var n = 0; n < 9; n++) this.coefficients[n].lerp(e.coefficients[n], t) return this }), (t.equals = function (e) { for (var t = 0; t < 9; t++) if (!this.coefficients[t].equals(e.coefficients[t])) return !1 return !0 }), (t.copy = function (e) { return this.set(e.coefficients) }), (t.clone = function () { return new this.constructor().copy(this) }), (t.fromArray = function (e, t) { void 0 === t && (t = 0) for (var n = this.coefficients, r = 0; r < 9; r++) n[r].fromArray(e, t + 3 * r) return this }), (t.toArray = function (e, t) { void 0 === e && (e = []), void 0 === t && (t = 0) for (var n = this.coefficients, r = 0; r < 9; r++) n[r].toArray(e, t + 3 * r) return e }), (e.getBasisAt = function (e, t) { var n = e.x, r = e.y, i = e.z ;(t[0] = 0.282095), (t[1] = 0.488603 * r), (t[2] = 0.488603 * i), (t[3] = 0.488603 * n), (t[4] = 1.092548 * n * r), (t[5] = 1.092548 * r * i), (t[6] = 0.315392 * (3 * i * i - 1)), (t[7] = 1.092548 * n * i), (t[8] = 0.546274 * (n * n - r * r)) }), e ) })() function ad(e, t) { Xh.call(this, void 0, t), (this.type = 'LightProbe'), (this.sh = void 0 !== e ? e : new od()) } function sd(e) { lh.call(this, e), (this.textures = {}) } ;(ad.prototype = Object.assign(Object.create(Xh.prototype), { constructor: ad, isLightProbe: !0, copy: function (e) { return Xh.prototype.copy.call(this, e), this.sh.copy(e.sh), this }, fromJSON: function (e) { return (this.intensity = e.intensity), this.sh.fromArray(e.sh), this }, toJSON: function (e) { var t = Xh.prototype.toJSON.call(this, e) return (t.object.sh = this.sh.toArray()), t }, })), (sd.prototype = Object.assign(Object.create(lh.prototype), { constructor: sd, load: function (t, n, r, i) { var o = this, a = new uh(o.manager) a.setPath(o.path), a.setRequestHeader(o.requestHeader), a.setWithCredentials(o.withCredentials), a.load( t, function (r) { try { n(o.parse(JSON.parse(r))) } catch (e) { i ? i(e) : console.error(e), o.manager.itemError(t) } }, r, i, ) }, parse: function (e) { var t = this.textures function n(e) { return ( void 0 === t[e] && console.warn('THREE.MaterialLoader: Undefined texture', e), t[e] ) } var r = new zu[e.type]() if ( (void 0 !== e.uuid && (r.uuid = e.uuid), void 0 !== e.name && (r.name = e.name), void 0 !== e.color && void 0 !== r.color && r.color.setHex(e.color), void 0 !== e.roughness && (r.roughness = e.roughness), void 0 !== e.metalness && (r.metalness = e.metalness), void 0 !== e.sheen && (r.sheen = new Li().setHex(e.sheen)), void 0 !== e.emissive && void 0 !== r.emissive && r.emissive.setHex(e.emissive), void 0 !== e.specular && void 0 !== r.specular && r.specular.setHex(e.specular), void 0 !== e.shininess && (r.shininess = e.shininess), void 0 !== e.clearcoat && (r.clearcoat = e.clearcoat), void 0 !== e.clearcoatRoughness && (r.clearcoatRoughness = e.clearcoatRoughness), void 0 !== e.fog && (r.fog = e.fog), void 0 !== e.flatShading && (r.flatShading = e.flatShading), void 0 !== e.blending && (r.blending = e.blending), void 0 !== e.combine && (r.combine = e.combine), void 0 !== e.side && (r.side = e.side), void 0 !== e.opacity && (r.opacity = e.opacity), void 0 !== e.transparent && (r.transparent = e.transparent), void 0 !== e.alphaTest && (r.alphaTest = e.alphaTest), void 0 !== e.depthTest && (r.depthTest = e.depthTest), void 0 !== e.depthWrite && (r.depthWrite = e.depthWrite), void 0 !== e.colorWrite && (r.colorWrite = e.colorWrite), void 0 !== e.stencilWrite && (r.stencilWrite = e.stencilWrite), void 0 !== e.stencilWriteMask && (r.stencilWriteMask = e.stencilWriteMask), void 0 !== e.stencilFunc && (r.stencilFunc = e.stencilFunc), void 0 !== e.stencilRef && (r.stencilRef = e.stencilRef), void 0 !== e.stencilFuncMask && (r.stencilFuncMask = e.stencilFuncMask), void 0 !== e.stencilFail && (r.stencilFail = e.stencilFail), void 0 !== e.stencilZFail && (r.stencilZFail = e.stencilZFail), void 0 !== e.stencilZPass && (r.stencilZPass = e.stencilZPass), void 0 !== e.wireframe && (r.wireframe = e.wireframe), void 0 !== e.wireframeLinewidth && (r.wireframeLinewidth = e.wireframeLinewidth), void 0 !== e.wireframeLinecap && (r.wireframeLinecap = e.wireframeLinecap), void 0 !== e.wireframeLinejoin && (r.wireframeLinejoin = e.wireframeLinejoin), void 0 !== e.rotation && (r.rotation = e.rotation), 1 !== e.linewidth && (r.linewidth = e.linewidth), void 0 !== e.dashSize && (r.dashSize = e.dashSize), void 0 !== e.gapSize && (r.gapSize = e.gapSize), void 0 !== e.scale && (r.scale = e.scale), void 0 !== e.polygonOffset && (r.polygonOffset = e.polygonOffset), void 0 !== e.polygonOffsetFactor && (r.polygonOffsetFactor = e.polygonOffsetFactor), void 0 !== e.polygonOffsetUnits && (r.polygonOffsetUnits = e.polygonOffsetUnits), void 0 !== e.skinning && (r.skinning = e.skinning), void 0 !== e.morphTargets && (r.morphTargets = e.morphTargets), void 0 !== e.morphNormals && (r.morphNormals = e.morphNormals), void 0 !== e.dithering && (r.dithering = e.dithering), void 0 !== e.vertexTangents && (r.vertexTangents = e.vertexTangents), void 0 !== e.visible && (r.visible = e.visible), void 0 !== e.toneMapped && (r.toneMapped = e.toneMapped), void 0 !== e.userData && (r.userData = e.userData), void 0 !== e.vertexColors && ('number' === typeof e.vertexColors ? (r.vertexColors = e.vertexColors > 0) : (r.vertexColors = e.vertexColors)), void 0 !== e.uniforms) ) for (var i in e.uniforms) { var o = e.uniforms[i] switch (((r.uniforms[i] = {}), o.type)) { case 't': r.uniforms[i].value = n(o.value) break case 'c': r.uniforms[i].value = new Li().setHex(o.value) break case 'v2': r.uniforms[i].value = new Jn().fromArray(o.value) break case 'v3': r.uniforms[i].value = new lr().fromArray(o.value) break case 'v4': r.uniforms[i].value = new ir().fromArray(o.value) break case 'm3': r.uniforms[i].value = new $n().fromArray(o.value) break case 'm4': r.uniforms[i].value = new Fr().fromArray(o.value) break default: r.uniforms[i].value = o.value } } if ( (void 0 !== e.defines && (r.defines = e.defines), void 0 !== e.vertexShader && (r.vertexShader = e.vertexShader), void 0 !== e.fragmentShader && (r.fragmentShader = e.fragmentShader), void 0 !== e.extensions) ) for (var a in e.extensions) r.extensions[a] = e.extensions[a] if ( (void 0 !== e.shading && (r.flatShading = 1 === e.shading), void 0 !== e.size && (r.size = e.size), void 0 !== e.sizeAttenuation && (r.sizeAttenuation = e.sizeAttenuation), void 0 !== e.map && (r.map = n(e.map)), void 0 !== e.matcap && (r.matcap = n(e.matcap)), void 0 !== e.alphaMap && (r.alphaMap = n(e.alphaMap)), void 0 !== e.bumpMap && (r.bumpMap = n(e.bumpMap)), void 0 !== e.bumpScale && (r.bumpScale = e.bumpScale), void 0 !== e.normalMap && (r.normalMap = n(e.normalMap)), void 0 !== e.normalMapType && (r.normalMapType = e.normalMapType), void 0 !== e.normalScale) ) { var s = e.normalScale !1 === Array.isArray(s) && (s = [s, s]), (r.normalScale = new Jn().fromArray(s)) } return ( void 0 !== e.displacementMap && (r.displacementMap = n(e.displacementMap)), void 0 !== e.displacementScale && (r.displacementScale = e.displacementScale), void 0 !== e.displacementBias && (r.displacementBias = e.displacementBias), void 0 !== e.roughnessMap && (r.roughnessMap = n(e.roughnessMap)), void 0 !== e.metalnessMap && (r.metalnessMap = n(e.metalnessMap)), void 0 !== e.emissiveMap && (r.emissiveMap = n(e.emissiveMap)), void 0 !== e.emissiveIntensity && (r.emissiveIntensity = e.emissiveIntensity), void 0 !== e.specularMap && (r.specularMap = n(e.specularMap)), void 0 !== e.envMap && (r.envMap = n(e.envMap)), void 0 !== e.envMapIntensity && (r.envMapIntensity = e.envMapIntensity), void 0 !== e.reflectivity && (r.reflectivity = e.reflectivity), void 0 !== e.refractionRatio && (r.refractionRatio = e.refractionRatio), void 0 !== e.lightMap && (r.lightMap = n(e.lightMap)), void 0 !== e.lightMapIntensity && (r.lightMapIntensity = e.lightMapIntensity), void 0 !== e.aoMap && (r.aoMap = n(e.aoMap)), void 0 !== e.aoMapIntensity && (r.aoMapIntensity = e.aoMapIntensity), void 0 !== e.gradientMap && (r.gradientMap = n(e.gradientMap)), void 0 !== e.clearcoatMap && (r.clearcoatMap = n(e.clearcoatMap)), void 0 !== e.clearcoatRoughnessMap && (r.clearcoatRoughnessMap = n(e.clearcoatRoughnessMap)), void 0 !== e.clearcoatNormalMap && (r.clearcoatNormalMap = n(e.clearcoatNormalMap)), void 0 !== e.clearcoatNormalScale && (r.clearcoatNormalScale = new Jn().fromArray(e.clearcoatNormalScale)), void 0 !== e.transmission && (r.transmission = e.transmission), void 0 !== e.transmissionMap && (r.transmissionMap = n(e.transmissionMap)), r ) }, setTextures: function (e) { return (this.textures = e), this }, })) var ld = { decodeText: function (t) { if ('undefined' !== typeof TextDecoder) return new TextDecoder().decode(t) for (var n = '', r = 0, i = t.length; r < i; r++) n += String.fromCharCode(t[r]) try { return decodeURIComponent(escape(n)) } catch (e) { return n } }, extractUrlBase: function (e) { var t = e.lastIndexOf('/') return -1 === t ? './' : e.substr(0, t + 1) }, } function cd() { ro.call(this), (this.type = 'InstancedBufferGeometry'), (this.instanceCount = 1 / 0) } function ud(e, t, n, r) { 'number' === typeof n && ((r = n), (n = !1), console.error( 'THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.', )), Fi.call(this, e, t, n), (this.meshPerAttribute = r || 1) } function hd(e) { lh.call(this, e) } ;(cd.prototype = Object.assign(Object.create(ro.prototype), { constructor: cd, isInstancedBufferGeometry: !0, copy: function (e) { return ( ro.prototype.copy.call(this, e), (this.instanceCount = e.instanceCount), this ) }, clone: function () { return new this.constructor().copy(this) }, toJSON: function () { var e = ro.prototype.toJSON.call(this) return ( (e.instanceCount = this.instanceCount), (e.isInstancedBufferGeometry = !0), e ) }, })), (ud.prototype = Object.assign(Object.create(Fi.prototype), { constructor: ud, isInstancedBufferAttribute: !0, copy: function (e) { return ( Fi.prototype.copy.call(this, e), (this.meshPerAttribute = e.meshPerAttribute), this ) }, toJSON: function () { var e = Fi.prototype.toJSON.call(this) return ( (e.meshPerAttribute = this.meshPerAttribute), (e.isInstancedBufferAttribute = !0), e ) }, })), (hd.prototype = Object.assign(Object.create(lh.prototype), { constructor: hd, load: function (t, n, r, i) { var o = this, a = new uh(o.manager) a.setPath(o.path), a.setRequestHeader(o.requestHeader), a.setWithCredentials(o.withCredentials), a.load( t, function (r) { try { n(o.parse(JSON.parse(r))) } catch (e) { i ? i(e) : console.error(e), o.manager.itemError(t) } }, r, i, ) }, parse: function (e) { var t = {}, n = {} function r(e, n) { if (void 0 !== t[n]) return t[n] var r = e.interleavedBuffers[n], o = i(e, r.buffer), a = new yl(Qi(r.type, o), r.stride) return (a.uuid = r.uuid), (t[n] = a), a } function i(e, t) { if (void 0 !== n[t]) return n[t] var r = e.arrayBuffers[t], i = new Uint32Array(r).buffer return (n[t] = i), i } var o = e.isInstancedBufferGeometry ? new cd() : new ro(), a = e.data.index if (void 0 !== a) { var s = Qi(a.type, a.array) o.setIndex(new Fi(s, 1)) } var l = e.data.attributes for (var c in l) { var u = l[c], h = void 0 if (u.isInterleavedBufferAttribute) h = new wl(r(e.data, u.data), u.itemSize, u.offset, u.normalized) else { var d = Qi(u.type, u.array) h = new (u.isInstancedBufferAttribute ? ud : Fi)( d, u.itemSize, u.normalized, ) } void 0 !== u.name && (h.name = u.name), o.setAttribute(c, h) } var p = e.data.morphAttributes if (p) for (var f in p) { for (var m = p[f], v = [], g = 0, y = m.length; g < y; g++) { var b = m[g], A = void 0 ;(A = b.isInterleavedBufferAttribute ? new wl(r(e.data, b.data), b.itemSize, b.offset, b.normalized) : new Fi(Qi(b.type, b.array), b.itemSize, b.normalized)), void 0 !== b.name && (A.name = b.name), v.push(A) } o.morphAttributes[f] = v } e.data.morphTargetsRelative && (o.morphTargetsRelative = !0) var w = e.data.groups || e.data.drawcalls || e.data.offsets if (void 0 !== w) for (var x = 0, E = w.length; x !== E; ++x) { var M = w[x] o.addGroup(M.start, M.count, M.materialIndex) } var _ = e.data.boundingSphere if (void 0 !== _) { var T = new lr() void 0 !== _.center && T.fromArray(_.center), (o.boundingSphere = new Sr(T, _.radius)) } return ( e.name && (o.name = e.name), e.userData && (o.userData = e.userData), o ) }, })) var dd = (function (e) { function t(t) { return e.call(this, t) || this } Gn(t, e) var n = t.prototype return ( (n.load = function (e, t, n, r) { var i = this, o = '' === this.path ? ld.extractUrlBase(e) : this.path this.resourcePath = this.resourcePath || o var a = new uh(this.manager) a.setPath(this.path), a.setRequestHeader(this.requestHeader), a.setWithCredentials(this.withCredentials), a.load( e, function (n) { var o = null try { o = JSON.parse(n) } catch (s) { return ( void 0 !== r && r(s), void console.error( "THREE:ObjectLoader: Can't parse " + e + '.', s.message, ) ) } var a = o.metadata void 0 !== a && void 0 !== a.type && 'geometry' !== a.type.toLowerCase() ? i.parse(o, t) : console.error("THREE.ObjectLoader: Can't load " + e) }, n, r, ) }), (n.parse = function (e, t) { var n = this.parseAnimations(e.animations), r = this.parseShapes(e.shapes), i = this.parseGeometries(e.geometries, r), o = this.parseImages(e.images, function () { void 0 !== t && t(l) }), a = this.parseTextures(e.textures, o), s = this.parseMaterials(e.materials, a), l = this.parseObject(e.object, i, s, n), c = this.parseSkeletons(e.skeletons, l) if ((this.bindSkeletons(l, c), void 0 !== t)) { var u = !1 for (var h in o) if (o[h] instanceof HTMLImageElement) { u = !0 break } !1 === u && t(l) } return l }), (n.parseShapes = function (e) { var t = {} if (void 0 !== e) for (var n = 0, r = e.length; n < r; n++) { var i = new qh().fromJSON(e[n]) t[i.uuid] = i } return t }), (n.parseSkeletons = function (e, t) { var n = {}, r = {} if ( (t.traverse(function (e) { e.isBone && (r[e.uuid] = e) }), void 0 !== e) ) for (var i = 0, o = e.length; i < o; i++) { var a = new Ql().fromJSON(e[i], r) n[a.uuid] = a } return n }), (n.parseGeometries = function (e, t) { var n, r = {} if (void 0 !== e) for (var i = new hd(), o = 0, a = e.length; o < a; o++) { var s = void 0, l = e[o] switch (l.type) { case 'PlaneGeometry': case 'PlaneBufferGeometry': s = new Pu[l.type]( l.width, l.height, l.widthSegments, l.heightSegments, ) break case 'BoxGeometry': case 'BoxBufferGeometry': s = new Pu[l.type]( l.width, l.height, l.depth, l.widthSegments, l.heightSegments, l.depthSegments, ) break case 'CircleGeometry': case 'CircleBufferGeometry': s = new Pu[l.type]( l.radius, l.segments, l.thetaStart, l.thetaLength, ) break case 'CylinderGeometry': case 'CylinderBufferGeometry': s = new Pu[l.type]( l.radiusTop, l.radiusBottom, l.height, l.radialSegments, l.heightSegments, l.openEnded, l.thetaStart, l.thetaLength, ) break case 'ConeGeometry': case 'ConeBufferGeometry': s = new Pu[l.type]( l.radius, l.height, l.radialSegments, l.heightSegments, l.openEnded, l.thetaStart, l.thetaLength, ) break case 'SphereGeometry': case 'SphereBufferGeometry': s = new Pu[l.type]( l.radius, l.widthSegments, l.heightSegments, l.phiStart, l.phiLength, l.thetaStart, l.thetaLength, ) break case 'DodecahedronGeometry': case 'DodecahedronBufferGeometry': case 'IcosahedronGeometry': case 'IcosahedronBufferGeometry': case 'OctahedronGeometry': case 'OctahedronBufferGeometry': case 'TetrahedronGeometry': case 'TetrahedronBufferGeometry': s = new Pu[l.type](l.radius, l.detail) break case 'RingGeometry': case 'RingBufferGeometry': s = new Pu[l.type]( l.innerRadius, l.outerRadius, l.thetaSegments, l.phiSegments, l.thetaStart, l.thetaLength, ) break case 'TorusGeometry': case 'TorusBufferGeometry': s = new Pu[l.type]( l.radius, l.tube, l.radialSegments, l.tubularSegments, l.arc, ) break case 'TorusKnotGeometry': case 'TorusKnotBufferGeometry': s = new Pu[l.type]( l.radius, l.tube, l.tubularSegments, l.radialSegments, l.p, l.q, ) break case 'TubeGeometry': case 'TubeBufferGeometry': s = new Pu[l.type]( new jh[l.path.type]().fromJSON(l.path), l.tubularSegments, l.radius, l.radialSegments, l.closed, ) break case 'LatheGeometry': case 'LatheBufferGeometry': s = new Pu[l.type]( l.points, l.segments, l.phiStart, l.phiLength, ) break case 'PolyhedronGeometry': case 'PolyhedronBufferGeometry': s = new Pu[l.type](l.vertices, l.indices, l.radius, l.details) break case 'ShapeGeometry': case 'ShapeBufferGeometry': n = [] for (var c = 0, u = l.shapes.length; c < u; c++) { var h = t[l.shapes[c]] n.push(h) } s = new Pu[l.type](n, l.curveSegments) break case 'ExtrudeGeometry': case 'ExtrudeBufferGeometry': n = [] for (var d = 0, p = l.shapes.length; d < p; d++) { var f = t[l.shapes[d]] n.push(f) } var m = l.options.extrudePath void 0 !== m && (l.options.extrudePath = new jh[m.type]().fromJSON(m)), (s = new Pu[l.type](n, l.options)) break case 'BufferGeometry': case 'InstancedBufferGeometry': s = i.parse(l) break case 'Geometry': 'THREE' in window && 'LegacyJSONLoader' in THREE ? (s = new THREE.LegacyJSONLoader().parse( l, this.resourcePath, ).geometry) : 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 "' + l.type + '"', ) continue } ;(s.uuid = l.uuid), void 0 !== l.name && (s.name = l.name), !0 === s.isBufferGeometry && void 0 !== l.userData && (s.userData = l.userData), (r[l.uuid] = s) } return r }), (n.parseMaterials = function (e, t) { var n = {}, r = {} if (void 0 !== e) { var i = new sd() i.setTextures(t) for (var o = 0, a = e.length; o < a; o++) { var s = e[o] if ('MultiMaterial' === s.type) { for (var l = [], c = 0; c < s.materials.length; c++) { var u = s.materials[c] void 0 === n[u.uuid] && (n[u.uuid] = i.parse(u)), l.push(n[u.uuid]) } r[s.uuid] = l } else void 0 === n[s.uuid] && (n[s.uuid] = i.parse(s)), (r[s.uuid] = n[s.uuid]) } } return r }), (n.parseAnimations = function (e) { var t = {} if (void 0 !== e) for (var n = 0; n < e.length; n++) { var r = e[n], i = nh.parse(r) t[i.uuid] = i } return t }), (n.parseImages = function (e, t) { var n, r = this, i = {} function o(e) { return ( r.manager.itemStart(e), n.load( e, function () { r.manager.itemEnd(e) }, void 0, function () { r.manager.itemError(e), r.manager.itemEnd(e) }, ) ) } function a(e) { if ('string' === typeof e) { var t = e return o( /^(\/\/)|([a-z]+:(\/\/)?)/i.test(t) ? t : r.resourcePath + t, ) } return e.data ? { data: Qi(e.type, e.data), width: e.width, height: e.height } : null } if (void 0 !== e && e.length > 0) { var s = new ah(t) ;(n = new ph(s)).setCrossOrigin(this.crossOrigin) for (var l = 0, c = e.length; l < c; l++) { var u = e[l], h = u.url if (Array.isArray(h)) { i[u.uuid] = [] for (var d = 0, p = h.length; d < p; d++) { var f = a(h[d]) null !== f && (f instanceof HTMLImageElement ? i[u.uuid].push(f) : i[u.uuid].push(new Uo(f.data, f.width, f.height))) } } else { var m = a(u.url) null !== m && (i[u.uuid] = m) } } } return i }), (n.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 r = {} if (void 0 !== e) for (var i = 0, o = e.length; i < o; i++) { var a = e[i] void 0 === a.image && console.warn( 'THREE.ObjectLoader: No "image" specified for', a.uuid, ), void 0 === t[a.image] && console.warn('THREE.ObjectLoader: Undefined image', a.image) var s = void 0, l = t[a.image] Array.isArray(l) ? ((s = new ko(l)), 6 === l.length && (s.needsUpdate = !0)) : ((s = l && l.data ? new Uo(l.data, l.width, l.height) : new nr(l)), l && (s.needsUpdate = !0)), (s.uuid = a.uuid), void 0 !== a.name && (s.name = a.name), void 0 !== a.mapping && (s.mapping = n(a.mapping, pd)), void 0 !== a.offset && s.offset.fromArray(a.offset), void 0 !== a.repeat && s.repeat.fromArray(a.repeat), void 0 !== a.center && s.center.fromArray(a.center), void 0 !== a.rotation && (s.rotation = a.rotation), void 0 !== a.wrap && ((s.wrapS = n(a.wrap[0], fd)), (s.wrapT = n(a.wrap[1], fd))), void 0 !== a.format && (s.format = a.format), void 0 !== a.type && (s.type = a.type), void 0 !== a.encoding && (s.encoding = a.encoding), void 0 !== a.minFilter && (s.minFilter = n(a.minFilter, md)), void 0 !== a.magFilter && (s.magFilter = n(a.magFilter, md)), void 0 !== a.anisotropy && (s.anisotropy = a.anisotropy), void 0 !== a.flipY && (s.flipY = a.flipY), void 0 !== a.premultiplyAlpha && (s.premultiplyAlpha = a.premultiplyAlpha), void 0 !== a.unpackAlignment && (s.unpackAlignment = a.unpackAlignment), (r[a.uuid] = s) } return r }), (n.parseObject = function (e, t, n, r) { var i, o, a function s(e) { return ( void 0 === t[e] && console.warn('THREE.ObjectLoader: Undefined geometry', e), t[e] ) } function l(e) { if (void 0 !== e) { if (Array.isArray(e)) { for (var t = [], r = 0, i = e.length; r < i; r++) { var o = e[r] void 0 === n[o] && console.warn('THREE.ObjectLoader: Undefined material', o), t.push(n[o]) } return t } return ( void 0 === n[e] && console.warn('THREE.ObjectLoader: Undefined material', e), n[e] ) } } switch (e.type) { case 'Scene': ;(i = new gl()), void 0 !== e.background && Number.isInteger(e.background) && (i.background = new Li(e.background)), void 0 !== e.fog && ('Fog' === e.fog.type ? (i.fog = new vl(e.fog.color, e.fog.near, e.fog.far)) : 'FogExp2' === e.fog.type && (i.fog = new ml(e.fog.color, e.fog.density))) break case 'PerspectiveCamera': ;(i = new Oo(e.fov, e.aspect, e.near, e.far)), void 0 !== e.focus && (i.focus = e.focus), void 0 !== e.zoom && (i.zoom = e.zoom), void 0 !== e.filmGauge && (i.filmGauge = e.filmGauge), void 0 !== e.filmOffset && (i.filmOffset = e.filmOffset), void 0 !== e.view && (i.view = Object.assign({}, e.view)) break case 'OrthographicCamera': ;(i = new ed(e.left, e.right, e.top, e.bottom, e.near, e.far)), void 0 !== e.zoom && (i.zoom = e.zoom), void 0 !== e.view && (i.view = Object.assign({}, e.view)) break case 'AmbientLight': i = new rd(e.color, e.intensity) break case 'DirectionalLight': i = new nd(e.color, e.intensity) break case 'PointLight': i = new $h(e.color, e.intensity, e.distance, e.decay) break case 'RectAreaLight': i = new id(e.color, e.intensity, e.width, e.height) break case 'SpotLight': i = new Kh( e.color, e.intensity, e.distance, e.angle, e.penumbra, e.decay, ) break case 'HemisphereLight': i = new Yh(e.color, e.groundColor, e.intensity) break case 'LightProbe': i = new ad().fromJSON(e) break case 'SkinnedMesh': ;(i = new Wl((o = s(e.geometry)), (a = l(e.material)))), void 0 !== e.bindMode && (i.bindMode = e.bindMode), void 0 !== e.bindMatrix && i.bindMatrix.fromArray(e.bindMatrix), void 0 !== e.skeleton && (i.skeleton = e.skeleton) break case 'Mesh': i = new xo((o = s(e.geometry)), (a = l(e.material))) break case 'InstancedMesh': ;(o = s(e.geometry)), (a = l(e.material)) var c = e.count, u = e.instanceMatrix ;(i = new ec(o, a, c)).instanceMatrix = new Fi( new Float32Array(u.array), 16, ) break case 'LOD': i = new Ul() break case 'Line': i = new sc(s(e.geometry), l(e.material)) break case 'LineLoop': i = new hc(s(e.geometry), l(e.material)) break case 'LineSegments': i = new uc(s(e.geometry), l(e.material)) break case 'PointCloud': case 'Points': i = new gc(s(e.geometry), l(e.material)) break case 'Sprite': i = new Bl(l(e.material)) break case 'Group': i = new rl() break case 'Bone': i = new ql() break default: i = new si() } if ( ((i.uuid = e.uuid), void 0 !== e.name && (i.name = e.name), void 0 !== e.matrix ? (i.matrix.fromArray(e.matrix), void 0 !== e.matrixAutoUpdate && (i.matrixAutoUpdate = e.matrixAutoUpdate), i.matrixAutoUpdate && i.matrix.decompose(i.position, i.quaternion, i.scale)) : (void 0 !== e.position && i.position.fromArray(e.position), void 0 !== e.rotation && i.rotation.fromArray(e.rotation), void 0 !== e.quaternion && i.quaternion.fromArray(e.quaternion), void 0 !== e.scale && i.scale.fromArray(e.scale)), void 0 !== e.castShadow && (i.castShadow = e.castShadow), void 0 !== e.receiveShadow && (i.receiveShadow = e.receiveShadow), e.shadow && (void 0 !== e.shadow.bias && (i.shadow.bias = e.shadow.bias), void 0 !== e.shadow.normalBias && (i.shadow.normalBias = e.shadow.normalBias), void 0 !== e.shadow.radius && (i.shadow.radius = e.shadow.radius), void 0 !== e.shadow.mapSize && i.shadow.mapSize.fromArray(e.shadow.mapSize), void 0 !== e.shadow.camera && (i.shadow.camera = this.parseObject(e.shadow.camera))), void 0 !== e.visible && (i.visible = e.visible), void 0 !== e.frustumCulled && (i.frustumCulled = e.frustumCulled), void 0 !== e.renderOrder && (i.renderOrder = e.renderOrder), void 0 !== e.userData && (i.userData = e.userData), void 0 !== e.layers && (i.layers.mask = e.layers), void 0 !== e.children) ) for (var h = e.children, d = 0; d < h.length; d++) i.add(this.parseObject(h[d], t, n, r)) if (void 0 !== e.animations) for (var p = e.animations, f = 0; f < p.length; f++) { var m = p[f] i.animations.push(r[m]) } if ('LOD' === e.type) { void 0 !== e.autoUpdate && (i.autoUpdate = e.autoUpdate) for (var v = e.levels, g = 0; g < v.length; g++) { var y = v[g], b = i.getObjectByProperty('uuid', y.object) void 0 !== b && i.addLevel(b, y.distance) } } return i }), (n.bindSkeletons = function (e, t) { 0 !== Object.keys(t).length && e.traverse(function (e) { if (!0 === e.isSkinnedMesh && void 0 !== e.skeleton) { var n = t[e.skeleton] void 0 === n ? console.warn( 'THREE.ObjectLoader: No skeleton found with UUID:', e.skeleton, ) : e.bind(n, e.bindMatrix) } }) }), (n.setTexturePath = function (e) { return ( console.warn( 'THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath().', ), this.setResourcePath(e) ) }), t ) })(lh), pd = { UVMapping: oe, CubeReflectionMapping: ae, CubeRefractionMapping: se, EquirectangularReflectionMapping: le, EquirectangularRefractionMapping: ce, CubeUVReflectionMapping: ue, CubeUVRefractionMapping: he, }, fd = { RepeatWrapping: de, ClampToEdgeWrapping: pe, MirroredRepeatWrapping: fe, }, md = { NearestFilter: me, NearestMipmapNearestFilter: ve, NearestMipmapLinearFilter: ye, LinearFilter: Ae, LinearMipmapNearestFilter: we, LinearMipmapLinearFilter: Ee, } function vd(e) { 'undefined' === typeof createImageBitmap && console.warn('THREE.ImageBitmapLoader: createImageBitmap() not supported.'), 'undefined' === typeof fetch && console.warn('THREE.ImageBitmapLoader: fetch() not supported.'), lh.call(this, e), (this.options = { premultiplyAlpha: 'none' }) } function gd() { ;(this.type = 'ShapePath'), (this.color = new Li()), (this.subPaths = []), (this.currentPath = null) } ;(vd.prototype = Object.assign(Object.create(lh.prototype), { constructor: vd, isImageBitmapLoader: !0, setOptions: function (e) { return (this.options = e), this }, load: function (e, t, n, r) { void 0 === e && (e = ''), void 0 !== this.path && (e = this.path + e), (e = this.manager.resolveURL(e)) var i = this, o = oh.get(e) if (void 0 !== o) return ( i.manager.itemStart(e), setTimeout(function () { t && t(o), i.manager.itemEnd(e) }, 0), o ) var a = {} ;(a.credentials = 'anonymous' === this.crossOrigin ? 'same-origin' : 'include'), fetch(e, a) .then(function (e) { return e.blob() }) .then(function (e) { return createImageBitmap(e, i.options) }) .then(function (n) { oh.add(e, n), t && t(n), i.manager.itemEnd(e) }) .catch(function (t) { r && r(t), i.manager.itemError(e), i.manager.itemEnd(e) }), i.manager.itemStart(e) }, })), Object.assign(gd.prototype, { moveTo: function (e, t) { return ( (this.currentPath = new Wh()), 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, r) { return this.currentPath.quadraticCurveTo(e, t, n, r), this }, bezierCurveTo: function (e, t, n, r, i, o) { return this.currentPath.bezierCurveTo(e, t, n, r, i, o), this }, splineThru: function (e) { return this.currentPath.splineThru(e), this }, toShapes: function (e, t) { function n(e) { for (var t = [], n = 0, r = e.length; n < r; n++) { var i = e[n], o = new qh() ;(o.curves = i.curves), t.push(o) } return t } function r(e, t) { for (var n = t.length, r = !1, i = n - 1, o = 0; o < n; i = o++) { var a = t[i], s = t[o], l = s.x - a.x, c = s.y - a.y if (Math.abs(c) > Number.EPSILON) { if ( (c < 0 && ((a = t[o]), (l = -l), (s = t[i]), (c = -c)), e.y < a.y || e.y > s.y) ) continue if (e.y === a.y) { if (e.x === a.x) return !0 } else { var u = c * (e.x - a.x) - l * (e.y - a.y) if (0 === u) return !0 if (u < 0) continue r = !r } } else { if (e.y !== a.y) continue if ((s.x <= e.x && e.x <= a.x) || (a.x <= e.x && e.x <= s.x)) return !0 } } return r } var i, o, a, s = hu.isClockWise, l = this.subPaths if (0 === l.length) return [] if (!0 === t) return n(l) var c = [] if (1 === l.length) return (o = l[0]), ((a = new qh()).curves = o.curves), c.push(a), c var u = !s(l[0].getPoints()) u = e ? !u : u var h, d, p = [], f = [], m = [], v = 0 ;(f[v] = void 0), (m[v] = []) for (var g = 0, y = l.length; g < y; g++) (i = s((h = (o = l[g]).getPoints()))), (i = e ? !i : i) ? (!u && f[v] && v++, (f[v] = { s: new qh(), p: h }), (f[v].s.curves = o.curves), u && v++, (m[v] = [])) : m[v].push({ h: o, p: h[0] }) if (!f[0]) return n(l) if (f.length > 1) { for (var b = !1, A = [], w = 0, x = f.length; w < x; w++) p[w] = [] for (var E = 0, M = f.length; E < M; E++) for (var _ = m[E], T = 0; T < _.length; T++) { for (var S = _[T], C = !0, L = 0; L < f.length; L++) r(S.p, f[L].p) && (E !== L && A.push({ froms: E, tos: L, hole: T }), C ? ((C = !1), p[L].push(S)) : (b = !0)) C && p[E].push(S) } A.length > 0 && (b || (m = p)) } for (var R = 0, P = f.length; R < P; R++) { ;(a = f[R].s), c.push(a) for (var D = 0, O = (d = m[R]).length; D < O; D++) a.holes.push(d[D].h) } return c }, }) var yd, bd = (function () { function e(e) { Object.defineProperty(this, 'isFont', { value: !0 }), (this.type = 'Font'), (this.data = e) } return ( (e.prototype.generateShapes = function (e, t) { void 0 === t && (t = 100) for ( var n = [], r = Ad(e, t, this.data), i = 0, o = r.length; i < o; i++ ) Array.prototype.push.apply(n, r[i].toShapes()) return n }), e ) })() function Ad(e, t, n) { for ( var r = Array.from ? Array.from(e) : String(e).split(''), i = t / n.resolution, o = (n.boundingBox.yMax - n.boundingBox.yMin + n.underlineThickness) * i, a = [], s = 0, l = 0, c = 0; c < r.length; c++ ) { var u = r[c] if ('\n' === u) (s = 0), (l -= o) else { var h = wd(u, i, s, l, n) ;(s += h.offsetX), a.push(h.path) } } return a } function wd(e, t, n, r, i) { var o = i.glyphs[e] || i.glyphs['?'] if (o) { var a, s, l, c, u, h, d, p, f = new gd() if (o.o) for ( var m = o._cachedOutline || (o._cachedOutline = o.o.split(' ')), v = 0, g = m.length; v < g; ) switch (m[v++]) { case 'm': ;(a = m[v++] * t + n), (s = m[v++] * t + r), f.moveTo(a, s) break case 'l': ;(a = m[v++] * t + n), (s = m[v++] * t + r), f.lineTo(a, s) break case 'q': ;(l = m[v++] * t + n), (c = m[v++] * t + r), (u = m[v++] * t + n), (h = m[v++] * t + r), f.quadraticCurveTo(u, h, l, c) break case 'b': ;(l = m[v++] * t + n), (c = m[v++] * t + r), (u = m[v++] * t + n), (h = m[v++] * t + r), (d = m[v++] * t + n), (p = m[v++] * t + r), f.bezierCurveTo(u, h, d, p, l, c) } return { offsetX: o.ha * t, path: f } } console.error( 'THREE.Font: character "' + e + '" does not exists in font family ' + i.familyName + '.', ) } function xd(e) { lh.call(this, e) } xd.prototype = Object.assign(Object.create(lh.prototype), { constructor: xd, load: function (t, n, r, i) { var o = this, a = new uh(this.manager) a.setPath(this.path), a.setRequestHeader(this.requestHeader), a.setWithCredentials(o.withCredentials), a.load( t, function (t) { var r try { r = JSON.parse(t) } catch (e) { console.warn( 'THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead.', ), (r = JSON.parse(t.substring(65, t.length - 2))) } var i = o.parse(r) n && n(i) }, r, i, ) }, parse: function (e) { return new bd(e) }, }) var Ed = { getContext: function () { return ( void 0 === yd && (yd = new (window.AudioContext || window.webkitAudioContext)()), yd ) }, setContext: function (e) { yd = e }, } function Md(e) { lh.call(this, e) } function _d(e, t, n) { ad.call(this, void 0, n) var r = new Li().set(e), i = new Li().set(t), o = new lr(r.r, r.g, r.b), a = new lr(i.r, i.g, i.b), s = Math.sqrt(Math.PI), l = s * Math.sqrt(0.75) this.sh.coefficients[0].copy(o).add(a).multiplyScalar(s), this.sh.coefficients[1].copy(o).sub(a).multiplyScalar(l) } function Td(e, t) { ad.call(this, void 0, t) var n = new Li().set(e) this.sh.coefficients[0] .set(n.r, n.g, n.b) .multiplyScalar(2 * Math.sqrt(Math.PI)) } ;(Md.prototype = Object.assign(Object.create(lh.prototype), { constructor: Md, load: function (t, n, r, i) { var o = this, a = new uh(o.manager) a.setResponseType('arraybuffer'), a.setPath(o.path), a.setRequestHeader(o.requestHeader), a.setWithCredentials(o.withCredentials), a.load( t, function (r) { try { var a = r.slice(0) Ed.getContext().decodeAudioData(a, function (e) { n(e) }) } catch (e) { i ? i(e) : console.error(e), o.manager.itemError(t) } }, r, i, ) }, })), (_d.prototype = Object.assign(Object.create(ad.prototype), { constructor: _d, isHemisphereLightProbe: !0, copy: function (e) { return ad.prototype.copy.call(this, e), this }, toJSON: function (e) { return ad.prototype.toJSON.call(this, e) }, })), (Td.prototype = Object.assign(Object.create(ad.prototype), { constructor: Td, isAmbientLightProbe: !0, copy: function (e) { return ad.prototype.copy.call(this, e), this }, toJSON: function (e) { return ad.prototype.toJSON.call(this, e) }, })) var Sd = new Fr(), Cd = new Fr() function Ld() { ;(this.type = 'StereoCamera'), (this.aspect = 1), (this.eyeSep = 0.064), (this.cameraL = new Oo()), this.cameraL.layers.enable(1), (this.cameraL.matrixAutoUpdate = !1), (this.cameraR = new Oo()), 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, }) } Object.assign(Ld.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, r, i = e.projectionMatrix.clone(), o = t.eyeSep / 2, a = (o * t.near) / t.focus, s = (t.near * Math.tan(Kn.DEG2RAD * t.fov * 0.5)) / t.zoom ;(Cd.elements[12] = -o), (Sd.elements[12] = o), (n = -s * t.aspect + a), (r = s * t.aspect + a), (i.elements[0] = (2 * t.near) / (r - n)), (i.elements[8] = (r + n) / (r - n)), this.cameraL.projectionMatrix.copy(i), (n = -s * t.aspect - a), (r = s * t.aspect - a), (i.elements[0] = (2 * t.near) / (r - n)), (i.elements[8] = (r + n) / (r - n)), this.cameraR.projectionMatrix.copy(i) } this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Cd), this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Sd) }, }) var Rd = (function () { function e(e) { ;(this.autoStart = void 0 === e || e), (this.startTime = 0), (this.oldTime = 0), (this.elapsedTime = 0), (this.running = !1) } var t = e.prototype return ( (t.start = function () { ;(this.startTime = Pd()), (this.oldTime = this.startTime), (this.elapsedTime = 0), (this.running = !0) }), (t.stop = function () { this.getElapsedTime(), (this.running = !1), (this.autoStart = !1) }), (t.getElapsedTime = function () { return this.getDelta(), this.elapsedTime }), (t.getDelta = function () { var e = 0 if (this.autoStart && !this.running) return this.start(), 0 if (this.running) { var t = Pd() ;(e = (t - this.oldTime) / 1e3), (this.oldTime = t), (this.elapsedTime += e) } return e }), e ) })() function Pd() { return ('undefined' === typeof performance ? Date : performance).now() } var Dd = new lr(), Od = new sr(), Id = new lr(), Bd = new lr(), Fd = (function (e) { function t() { var t return ( ((t = e.call(this) || this).type = 'AudioListener'), (t.context = Ed.getContext()), (t.gain = t.context.createGain()), t.gain.connect(t.context.destination), (t.filter = null), (t.timeDelta = 0), (t._clock = new Rd()), t ) } Gn(t, e) var n = t.prototype return ( (n.getInput = function () { return this.gain }), (n.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 ) }), (n.getFilter = function () { return this.filter }), (n.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 ) }), (n.getMasterVolume = function () { return this.gain.gain.value }), (n.setMasterVolume = function (e) { return ( this.gain.gain.setTargetAtTime(e, this.context.currentTime, 0.01), this ) }), (n.updateMatrixWorld = function (t) { e.prototype.updateMatrixWorld.call(this, t) var n = this.context.listener, r = this.up if ( ((this.timeDelta = this._clock.getDelta()), this.matrixWorld.decompose(Dd, Od, Id), Bd.set(0, 0, -1).applyQuaternion(Od), n.positionX) ) { var i = this.context.currentTime + this.timeDelta n.positionX.linearRampToValueAtTime(Dd.x, i), n.positionY.linearRampToValueAtTime(Dd.y, i), n.positionZ.linearRampToValueAtTime(Dd.z, i), n.forwardX.linearRampToValueAtTime(Bd.x, i), n.forwardY.linearRampToValueAtTime(Bd.y, i), n.forwardZ.linearRampToValueAtTime(Bd.z, i), n.upX.linearRampToValueAtTime(r.x, i), n.upY.linearRampToValueAtTime(r.y, i), n.upZ.linearRampToValueAtTime(r.z, i) } else n.setPosition(Dd.x, Dd.y, Dd.z), n.setOrientation(Bd.x, Bd.y, Bd.z, r.x, r.y, r.z) }), t ) })(si), kd = (function (e) { function t(t) { var n return ( ((n = e.call(this) || this).type = 'Audio'), (n.listener = t), (n.context = t.context), (n.gain = n.context.createGain()), n.gain.connect(t.getInput()), (n.autoplay = !1), (n.buffer = null), (n.detune = 0), (n.loop = !1), (n.loopStart = 0), (n.loopEnd = 0), (n.offset = 0), (n.duration = void 0), (n.playbackRate = 1), (n.isPlaying = !1), (n.hasPlaybackControl = !0), (n.source = null), (n.sourceType = 'empty'), (n._startedAt = 0), (n._progress = 0), (n._connected = !1), (n.filters = []), n ) } Gn(t, e) var n = t.prototype return ( (n.getOutput = function () { return this.gain }), (n.setNodeSource = function (e) { return ( (this.hasPlaybackControl = !1), (this.sourceType = 'audioNode'), (this.source = e), this.connect(), this ) }), (n.setMediaElementSource = function (e) { return ( (this.hasPlaybackControl = !1), (this.sourceType = 'mediaNode'), (this.source = this.context.createMediaElementSource(e)), this.connect(), this ) }), (n.setMediaStreamSource = function (e) { return ( (this.hasPlaybackControl = !1), (this.sourceType = 'mediaStreamNode'), (this.source = this.context.createMediaStreamSource(e)), this.connect(), this ) }), (n.setBuffer = function (e) { return ( (this.buffer = e), (this.sourceType = 'buffer'), this.autoplay && this.play(), this ) }), (n.play = function (e) { if ((void 0 === e && (e = 0), !0 !== this.isPlaying)) { if (!1 !== this.hasPlaybackControl) { 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._progress + this.offset, this.duration, ), (this.isPlaying = !0), (this.source = t), this.setDetune(this.detune), this.setPlaybackRate(this.playbackRate), this.connect() ) } console.warn('THREE.Audio: this Audio has no playback control.') } else console.warn('THREE.Audio: Audio is already playing.') }), (n.pause = function () { if (!1 !== this.hasPlaybackControl) return ( !0 === this.isPlaying && ((this._progress += Math.max(this.context.currentTime - this._startedAt, 0) * this.playbackRate), !0 === this.loop && (this._progress = this._progress % (this.duration || this.buffer.duration)), this.source.stop(), (this.source.onended = null), (this.isPlaying = !1)), this ) console.warn('THREE.Audio: this Audio has no playback control.') }), (n.stop = function () { if (!1 !== this.hasPlaybackControl) return ( (this._progress = 0), this.source.stop(), (this.source.onended = null), (this.isPlaying = !1), this ) console.warn('THREE.Audio: this Audio has no playback control.') }), (n.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._connected = !0), this }), (n.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._connected = !1), this }), (n.getFilters = function () { return this.filters }), (n.setFilters = function (e) { return ( e || (e = []), !0 === this._connected ? (this.disconnect(), (this.filters = e.slice()), this.connect()) : (this.filters = e.slice()), this ) }), (n.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, 0.01, ), this ) }), (n.getDetune = function () { return this.detune }), (n.getFilter = function () { return this.getFilters()[0] }), (n.setFilter = function (e) { return this.setFilters(e ? [e] : []) }), (n.setPlaybackRate = function (e) { if (!1 !== this.hasPlaybackControl) return ( (this.playbackRate = e), !0 === this.isPlaying && this.source.playbackRate.setTargetAtTime( this.playbackRate, this.context.currentTime, 0.01, ), this ) console.warn('THREE.Audio: this Audio has no playback control.') }), (n.getPlaybackRate = function () { return this.playbackRate }), (n.onEnded = function () { this.isPlaying = !1 }), (n.getLoop = function () { return !1 === this.hasPlaybackControl ? (console.warn('THREE.Audio: this Audio has no playback control.'), !1) : this.loop }), (n.setLoop = function (e) { if (!1 !== this.hasPlaybackControl) return ( (this.loop = e), !0 === this.isPlaying && (this.source.loop = this.loop), this ) console.warn('THREE.Audio: this Audio has no playback control.') }), (n.setLoopStart = function (e) { return (this.loopStart = e), this }), (n.setLoopEnd = function (e) { return (this.loopEnd = e), this }), (n.getVolume = function () { return this.gain.gain.value }), (n.setVolume = function (e) { return ( this.gain.gain.setTargetAtTime(e, this.context.currentTime, 0.01), this ) }), t ) })(si), Nd = new lr(), Ud = new sr(), Hd = new lr(), Gd = new lr(), zd = (function (e) { function t(t) { var n return ( ((n = e.call(this, t) || this).panner = n.context.createPanner()), (n.panner.panningModel = 'HRTF'), n.panner.connect(n.gain), n ) } Gn(t, e) var n = t.prototype return ( (n.getOutput = function () { return this.panner }), (n.getRefDistance = function () { return this.panner.refDistance }), (n.setRefDistance = function (e) { return (this.panner.refDistance = e), this }), (n.getRolloffFactor = function () { return this.panner.rolloffFactor }), (n.setRolloffFactor = function (e) { return (this.panner.rolloffFactor = e), this }), (n.getDistanceModel = function () { return this.panner.distanceModel }), (n.setDistanceModel = function (e) { return (this.panner.distanceModel = e), this }), (n.getMaxDistance = function () { return this.panner.maxDistance }), (n.setMaxDistance = function (e) { return (this.panner.maxDistance = e), this }), (n.setDirectionalCone = function (e, t, n) { return ( (this.panner.coneInnerAngle = e), (this.panner.coneOuterAngle = t), (this.panner.coneOuterGain = n), this ) }), (n.updateMatrixWorld = function (t) { if ( (e.prototype.updateMatrixWorld.call(this, t), !0 !== this.hasPlaybackControl || !1 !== this.isPlaying) ) { this.matrixWorld.decompose(Nd, Ud, Hd), Gd.set(0, 0, 1).applyQuaternion(Ud) var n = this.panner if (n.positionX) { var r = this.context.currentTime + this.listener.timeDelta n.positionX.linearRampToValueAtTime(Nd.x, r), n.positionY.linearRampToValueAtTime(Nd.y, r), n.positionZ.linearRampToValueAtTime(Nd.z, r), n.orientationX.linearRampToValueAtTime(Gd.x, r), n.orientationY.linearRampToValueAtTime(Gd.y, r), n.orientationZ.linearRampToValueAtTime(Gd.z, r) } else n.setPosition(Nd.x, Nd.y, Nd.z), n.setOrientation(Gd.x, Gd.y, Gd.z) } }), t ) })(kd), jd = (function () { function e(e, t) { void 0 === t && (t = 2048), (this.analyser = e.context.createAnalyser()), (this.analyser.fftSize = t), (this.data = new Uint8Array(this.analyser.frequencyBinCount)), e.getOutput().connect(this.analyser) } var t = e.prototype return ( (t.getFrequencyData = function () { return this.analyser.getByteFrequencyData(this.data), this.data }), (t.getAverageFrequency = function () { for (var e = 0, t = this.getFrequencyData(), n = 0; n < t.length; n++) e += t[n] return e / t.length }), e ) })() function Vd(e, t, n) { var r, i, o switch (((this.binding = e), (this.valueSize = n), t)) { case 'quaternion': ;(r = this._slerp), (i = this._slerpAdditive), (o = this._setAdditiveIdentityQuaternion), (this.buffer = new Float64Array(6 * n)), (this._workIndex = 5) break case 'string': case 'bool': ;(r = this._select), (i = this._select), (o = this._setAdditiveIdentityOther), (this.buffer = new Array(5 * n)) break default: ;(r = this._lerp), (i = this._lerpAdditive), (o = this._setAdditiveIdentityNumeric), (this.buffer = new Float64Array(5 * n)) } ;(this._mixBufferRegion = r), (this._mixBufferRegionAdditive = i), (this._setIdentity = o), (this._origIndex = 3), (this._addIndex = 4), (this.cumulativeWeight = 0), (this.cumulativeWeightAdditive = 0), (this.useCount = 0), (this.referenceCount = 0) } Object.assign(Vd.prototype, { accumulate: function (e, t) { var n = this.buffer, r = this.valueSize, i = e * r + r, o = this.cumulativeWeight if (0 === o) { for (var a = 0; a !== r; ++a) n[i + a] = n[a] o = t } else { var s = t / (o += t) this._mixBufferRegion(n, i, 0, s, r) } this.cumulativeWeight = o }, accumulateAdditive: function (e) { var t = this.buffer, n = this.valueSize, r = n * this._addIndex 0 === this.cumulativeWeightAdditive && this._setIdentity(), this._mixBufferRegionAdditive(t, r, 0, e, n), (this.cumulativeWeightAdditive += e) }, apply: function (e) { var t = this.valueSize, n = this.buffer, r = e * t + t, i = this.cumulativeWeight, o = this.cumulativeWeightAdditive, a = this.binding if ( ((this.cumulativeWeight = 0), (this.cumulativeWeightAdditive = 0), i < 1) ) { var s = t * this._origIndex this._mixBufferRegion(n, r, s, 1 - i, t) } o > 0 && this._mixBufferRegionAdditive(n, r, this._addIndex * t, 1, t) for (var l = t, c = t + t; l !== c; ++l) if (n[l] !== n[l + t]) { a.setValue(n, r) break } }, saveOriginalState: function () { var e = this.binding, t = this.buffer, n = this.valueSize, r = n * this._origIndex e.getValue(t, r) for (var i = n, o = r; i !== o; ++i) t[i] = t[r + (i % n)] this._setIdentity(), (this.cumulativeWeight = 0), (this.cumulativeWeightAdditive = 0) }, restoreOriginalState: function () { var e = 3 * this.valueSize this.binding.setValue(this.buffer, e) }, _setAdditiveIdentityNumeric: function () { for ( var e = this._addIndex * this.valueSize, t = e + this.valueSize, n = e; n < t; n++ ) this.buffer[n] = 0 }, _setAdditiveIdentityQuaternion: function () { this._setAdditiveIdentityNumeric(), (this.buffer[this._addIndex * this.valueSize + 3] = 1) }, _setAdditiveIdentityOther: function () { for ( var e = this._origIndex * this.valueSize, t = this._addIndex * this.valueSize, n = 0; n < this.valueSize; n++ ) this.buffer[t + n] = this.buffer[e + n] }, _select: function (e, t, n, r, i) { if (r >= 0.5) for (var o = 0; o !== i; ++o) e[t + o] = e[n + o] }, _slerp: function (e, t, n, r) { sr.slerpFlat(e, t, e, t, e, n, r) }, _slerpAdditive: function (e, t, n, r, i) { var o = this._workIndex * i sr.multiplyQuaternionsFlat(e, o, e, t, e, n), sr.slerpFlat(e, t, e, t, e, o, r) }, _lerp: function (e, t, n, r, i) { for (var o = 1 - r, a = 0; a !== i; ++a) { var s = t + a e[s] = e[s] * o + e[n + a] * r } }, _lerpAdditive: function (e, t, n, r, i) { for (var o = 0; o !== i; ++o) { var a = t + o e[a] = e[a] + e[n + o] * r } }, }) var Wd = '\\[\\]\\.:\\/', qd = new RegExp('[' + Wd + ']', 'g'), Xd = '[^' + Wd + ']', Yd = '[^' + Wd.replace('\\.', '') + ']', Qd = /((?:WC+[\/:])*)/.source.replace('WC', Xd), Zd = /(WCOD+)?/.source.replace('WCOD', Yd), Kd = /(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace('WC', Xd), Jd = /\.(WC+)(?:\[(.+)\])?/.source.replace('WC', Xd), $d = new RegExp('^' + Qd + Zd + Kd + Jd + '$'), ep = ['material', 'materials', 'bones'] function tp(e, t, n) { var r = n || np.parseTrackName(t) ;(this._targetGroup = e), (this._bindings = e.subscribe_(t, r)) } function np(e, t, n) { ;(this.path = t), (this.parsedPath = n || np.parseTrackName(t)), (this.node = np.findNode(e, this.parsedPath.nodeName) || e), (this.rootNode = e) } function rp() { ;(this.uuid = Kn.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 r = this this.stats = { objects: { get total() { return r._objects.length }, get inUse() { return this.total - r.nCachedObjects_ }, }, get bindingsPerObject() { return r._bindings.length }, } } Object.assign(tp.prototype, { getValue: function (e, t) { this.bind() var n = this._targetGroup.nCachedObjects_, r = this._bindings[n] void 0 !== r && r.getValue(e, t) }, setValue: function (e, t) { for ( var n = this._bindings, r = this._targetGroup.nCachedObjects_, i = n.length; r !== i; ++r ) n[r].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(np, { Composite: tp, create: function (e, t, n) { return e && e.isAnimationObjectGroup ? new np.Composite(e, t, n) : new np(e, t, n) }, sanitizeNodeName: function (e) { return e.replace(/\s/g, '_').replace(qd, '') }, parseTrackName: function (e) { var t = $d.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], }, r = n.nodeName && n.nodeName.lastIndexOf('.') if (void 0 !== r && -1 !== r) { var i = n.nodeName.substring(r + 1) ;-1 !== ep.indexOf(i) && ((n.nodeName = n.nodeName.substring(0, r)), (n.objectName = i)) } 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 || '.' === 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 r = (function e(n) { for (var r = 0; r < n.length; r++) { var i = n[r] if (i.name === t || i.uuid === t) return i var o = e(i.children) if (o) return o } return null })(e.children) if (r) return r } return null }, }), Object.assign(np.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, r = 0, i = n.length; r !== i; ++r) e[t++] = n[r] }, 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, r = 0, i = n.length; r !== i; ++r) n[r] = e[t++] }, function (e, t) { for (var n = this.resolvedProperty, r = 0, i = n.length; r !== i; ++r) n[r] = e[t++] this.targetObject.needsUpdate = !0 }, function (e, t) { for (var n = this.resolvedProperty, r = 0, i = n.length; r !== i; ++r) n[r] = 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, r = t.propertyName, i = t.propertyIndex if ( (e || ((e = np.findNode(this.rootNode, t.nodeName) || this.rootNode), (this.node = e)), (this.getValue = this._getValue_unavailable), (this.setValue = this._setValue_unavailable), e) ) { if (n) { var o = 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 a = 0; a < e.length; a++) if (e[a].name === o) { o = a 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 !== o) { if (void 0 === e[o]) return void console.error( 'THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.', this, e, ) e = e[o] } } var s = e[r] if (void 0 !== s) { 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 c = this.BindingType.Direct if (void 0 !== i) { if ('morphTargetInfluences' === r) { 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) return void console.error( 'THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.', this, ) if (!e.geometry.morphAttributes) return void console.error( 'THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.', this, ) void 0 !== e.morphTargetDictionary[i] && (i = e.morphTargetDictionary[i]) } ;(c = this.BindingType.ArrayElement), (this.resolvedProperty = s), (this.propertyIndex = i) } else void 0 !== s.fromArray && void 0 !== s.toArray ? ((c = this.BindingType.HasFromToArray), (this.resolvedProperty = s)) : Array.isArray(s) ? ((c = this.BindingType.EntireArray), (this.resolvedProperty = s)) : (this.propertyName = r) ;(this.getValue = this.GetterByBindingType[c]), (this.setValue = this.SetterByBindingTypeAndVersioning[c][l]) } else { var u = t.nodeName console.error( 'THREE.PropertyBinding: Trying to update property for track: ' + u + '.' + r + " but it wasn't found.", e, ) } } else console.error( 'THREE.PropertyBinding: Trying to update node for track: ' + this.path + " but it wasn't found.", ) }, unbind: function () { ;(this.node = null), (this.getValue = this._getValue_unbound), (this.setValue = this._setValue_unbound) }, }), Object.assign(np.prototype, { _getValue_unbound: np.prototype.getValue, _setValue_unbound: np.prototype.setValue, }), Object.assign(rp.prototype, { isAnimationObjectGroup: !0, add: function () { for ( var e = this._objects, t = this._indicesByUUID, n = this._paths, r = this._parsedPaths, i = this._bindings, o = i.length, a = void 0, s = e.length, l = this.nCachedObjects_, c = 0, u = arguments.length; c !== u; ++c ) { var h = arguments[c], d = h.uuid, p = t[d] if (void 0 === p) { ;(p = s++), (t[d] = p), e.push(h) for (var f = 0, m = o; f !== m; ++f) i[f].push(new np(h, n[f], r[f])) } else if (p < l) { a = e[p] var v = --l, g = e[v] ;(t[g.uuid] = p), (e[p] = g), (t[d] = v), (e[v] = h) for (var y = 0, b = o; y !== b; ++y) { var A = i[y], w = A[v], x = A[p] ;(A[p] = w), void 0 === x && (x = new np(h, n[y], r[y])), (A[v] = x) } } else e[p] !== a && console.error( 'THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.', ) } this.nCachedObjects_ = l }, remove: function () { for ( var e = this._objects, t = this._indicesByUUID, n = this._bindings, r = n.length, i = this.nCachedObjects_, o = 0, a = arguments.length; o !== a; ++o ) { var s = arguments[o], l = s.uuid, c = t[l] if (void 0 !== c && c >= i) { var u = i++, h = e[u] ;(t[h.uuid] = c), (e[c] = h), (t[l] = u), (e[u] = s) for (var d = 0, p = r; d !== p; ++d) { var f = n[d], m = f[u], v = f[c] ;(f[c] = m), (f[u] = v) } } } this.nCachedObjects_ = i }, uncache: function () { for ( var e = this._objects, t = this._indicesByUUID, n = this._bindings, r = n.length, i = this.nCachedObjects_, o = e.length, a = 0, s = arguments.length; a !== s; ++a ) { var l = arguments[a].uuid, c = t[l] if (void 0 !== c) if ((delete t[l], c < i)) { var u = --i, h = e[u], d = --o, p = e[d] ;(t[h.uuid] = c), (e[c] = h), (t[p.uuid] = u), (e[u] = p), e.pop() for (var f = 0, m = r; f !== m; ++f) { var v = n[f], g = v[u], y = v[d] ;(v[c] = g), (v[u] = y), v.pop() } } else { var b = --o, A = e[b] b > 0 && (t[A.uuid] = c), (e[c] = A), e.pop() for (var w = 0, x = r; w !== x; ++w) { var E = n[w] ;(E[c] = E[b]), E.pop() } } } this.nCachedObjects_ = i }, subscribe_: function (e, t) { var n = this._bindingsIndicesByPath, r = n[e], i = this._bindings if (void 0 !== r) return i[r] var o = this._paths, a = this._parsedPaths, s = this._objects, l = s.length, c = this.nCachedObjects_, u = new Array(l) ;(r = i.length), (n[e] = r), o.push(e), a.push(t), i.push(u) for (var h = c, d = s.length; h !== d; ++h) { var p = s[h] u[h] = new np(p, e, t) } return u }, unsubscribe_: function (e) { var t = this._bindingsIndicesByPath, n = t[e] if (void 0 !== n) { var r = this._paths, i = this._parsedPaths, o = this._bindings, a = o.length - 1, s = o[a] ;(t[e[a]] = n), (o[n] = s), o.pop(), (i[n] = i[a]), i.pop(), (r[n] = r[a]), r.pop() } }, }) var ip = (function () { function e(e, t, n, r) { void 0 === n && (n = null), void 0 === r && (r = t.blendMode), (this._mixer = e), (this._clip = t), (this._localRoot = n), (this.blendMode = r) for ( var i = t.tracks, o = i.length, a = new Array(o), s = { endingStart: jt, endingEnd: jt }, l = 0; l !== o; ++l ) { var c = i[l].createInterpolant(null) ;(a[l] = c), (c.settings = s) } ;(this._interpolantSettings = s), (this._interpolants = a), (this._propertyBindings = new Array(o)), (this._cacheIndex = null), (this._byClipCacheIndex = null), (this._timeScaleInterpolant = null), (this._weightInterpolant = null), (this.loop = Nt), (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) } var t = e.prototype return ( (t.play = function () { return this._mixer._activateAction(this), this }), (t.stop = function () { return this._mixer._deactivateAction(this), this.reset() }), (t.reset = function () { return ( (this.paused = !1), (this.enabled = !0), (this.time = 0), (this._loopCount = -1), (this._startTime = null), this.stopFading().stopWarping() ) }), (t.isRunning = function () { return ( this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this) ) }), (t.isScheduled = function () { return this._mixer._isActiveAction(this) }), (t.startAt = function (e) { return (this._startTime = e), this }), (t.setLoop = function (e, t) { return (this.loop = e), (this.repetitions = t), this }), (t.setEffectiveWeight = function (e) { return ( (this.weight = e), (this._effectiveWeight = this.enabled ? e : 0), this.stopFading() ) }), (t.getEffectiveWeight = function () { return this._effectiveWeight }), (t.fadeIn = function (e) { return this._scheduleFading(e, 0, 1) }), (t.fadeOut = function (e) { return this._scheduleFading(e, 1, 0) }), (t.crossFadeFrom = function (e, t, n) { if ((e.fadeOut(t), this.fadeIn(t), n)) { var r = this._clip.duration, i = e._clip.duration, o = i / r, a = r / i e.warp(1, o, t), this.warp(a, 1, t) } return this }), (t.crossFadeTo = function (e, t, n) { return e.crossFadeFrom(this, t, n) }), (t.stopFading = function () { var e = this._weightInterpolant return ( null !== e && ((this._weightInterpolant = null), this._mixer._takeBackControlInterpolant(e)), this ) }), (t.setEffectiveTimeScale = function (e) { return ( (this.timeScale = e), (this._effectiveTimeScale = this.paused ? 0 : e), this.stopWarping() ) }), (t.getEffectiveTimeScale = function () { return this._effectiveTimeScale }), (t.setDuration = function (e) { return (this.timeScale = this._clip.duration / e), this.stopWarping() }), (t.syncWith = function (e) { return ( (this.time = e.time), (this.timeScale = e.timeScale), this.stopWarping() ) }), (t.halt = function (e) { return this.warp(this._effectiveTimeScale, 0, e) }), (t.warp = function (e, t, n) { var r = this._mixer, i = r.time, o = this.timeScale, a = this._timeScaleInterpolant null === a && ((a = r._lendControlInterpolant()), (this._timeScaleInterpolant = a)) var s = a.parameterPositions, l = a.sampleValues return (s[0] = i), (s[1] = i + n), (l[0] = e / o), (l[1] = t / o), this }), (t.stopWarping = function () { var e = this._timeScaleInterpolant return ( null !== e && ((this._timeScaleInterpolant = null), this._mixer._takeBackControlInterpolant(e)), this ) }), (t.getMixer = function () { return this._mixer }), (t.getClip = function () { return this._clip }), (t.getRoot = function () { return this._localRoot || this._mixer._root }), (t._update = function (e, t, n, r) { if (this.enabled) { var i = this._startTime if (null !== i) { var o = (e - i) * n if (o < 0 || 0 === n) return ;(this._startTime = null), (t = n * o) } t *= this._updateTimeScale(e) var a = this._updateTime(t), s = this._updateWeight(e) if (s > 0) { var l = this._interpolants, c = this._propertyBindings switch (this.blendMode) { case Xt: for (var u = 0, h = l.length; u !== h; ++u) l[u].evaluate(a), c[u].accumulateAdditive(s) break case qt: default: for (var d = 0, p = l.length; d !== p; ++d) l[d].evaluate(a), c[d].accumulate(r, s) } } } else this._updateWeight(e) }), (t._updateWeight = function (e) { var t = 0 if (this.enabled) { t = this.weight var n = this._weightInterpolant if (null !== n) { var r = n.evaluate(e)[0] ;(t *= r), e > n.parameterPositions[1] && (this.stopFading(), 0 === r && (this.enabled = !1)) } } return (this._effectiveWeight = t), t }), (t._updateTimeScale = function (e) { var t = 0 if (!this.paused) { t = this.timeScale var n = this._timeScaleInterpolant 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 }), (t._updateTime = function (e) { var t = this._clip.duration, n = this.loop, r = this.time + e, i = this._loopCount, o = n === Ut if (0 === e) return -1 === i ? r : o && 1 === (1 & i) ? t - r : r if (n === kt) { ;-1 === i && ((this._loopCount = 0), this._setEndings(!0, !0, !1)) e: { if (r >= t) r = t else { if (!(r < 0)) { this.time = r break e } r = 0 } this.clampWhenFinished ? (this.paused = !0) : (this.enabled = !1), (this.time = r), this._mixer.dispatchEvent({ type: 'finished', action: this, direction: e < 0 ? -1 : 1, }) } } else { if ( (-1 === i && (e >= 0 ? ((i = 0), this._setEndings(!0, 0 === this.repetitions, o)) : this._setEndings(0 === this.repetitions, !0, o)), r >= t || r < 0) ) { var a = Math.floor(r / t) ;(r -= t * a), (i += Math.abs(a)) var s = this.repetitions - i if (s <= 0) this.clampWhenFinished ? (this.paused = !0) : (this.enabled = !1), (r = e > 0 ? t : 0), (this.time = r), this._mixer.dispatchEvent({ type: 'finished', action: this, direction: e > 0 ? 1 : -1, }) else { if (1 === s) { var l = e < 0 this._setEndings(l, !l, o) } else this._setEndings(!1, !1, o) ;(this._loopCount = i), (this.time = r), this._mixer.dispatchEvent({ type: 'loop', action: this, loopDelta: a, }) } } else this.time = r if (o && 1 === (1 & i)) return t - r } return r }), (t._setEndings = function (e, t, n) { var r = this._interpolantSettings n ? ((r.endingStart = Vt), (r.endingEnd = Vt)) : ((r.endingStart = e ? (this.zeroSlopeAtStart ? Vt : jt) : Wt), (r.endingEnd = t ? (this.zeroSlopeAtEnd ? Vt : jt) : Wt)) }), (t._scheduleFading = function (e, t, n) { var r = this._mixer, i = r.time, o = this._weightInterpolant null === o && ((o = r._lendControlInterpolant()), (this._weightInterpolant = o)) var a = o.parameterPositions, s = o.sampleValues return (a[0] = i), (s[0] = t), (a[1] = i + e), (s[1] = n), this }), e ) })() function op(e) { ;(this._root = e), this._initMemoryManager(), (this._accuIndex = 0), (this.time = 0), (this.timeScale = 1) } op.prototype = Object.assign(Object.create(qn.prototype), { constructor: op, _bindAction: function (e, t) { var n = e._localRoot || this._root, r = e._clip.tracks, i = r.length, o = e._propertyBindings, a = e._interpolants, s = n.uuid, l = this._bindingsByRootAndName, c = l[s] void 0 === c && ((c = {}), (l[s] = c)) for (var u = 0; u !== i; ++u) { var h = r[u], d = h.name, p = c[d] if (void 0 !== p) o[u] = p else { if (void 0 !== (p = o[u])) { null === p._cacheIndex && (++p.referenceCount, this._addInactiveBinding(p, s, d)) continue } var f = t && t._propertyBindings[u].binding.parsedPath ++(p = new Vd(np.create(n, d, f), h.ValueTypeName, h.getValueSize())) .referenceCount, this._addInactiveBinding(p, s, d), (o[u] = p) } a[u].resultBuffer = p.buffer } }, _activateAction: function (e) { if (!this._isActiveAction(e)) { if (null === e._cacheIndex) { var t = (e._localRoot || this._root).uuid, n = e._clip.uuid, r = this._actionsByClip[n] this._bindAction(e, r && r.knownActions[0]), this._addInactiveAction(e, n, t) } for (var i = e._propertyBindings, o = 0, a = i.length; o !== a; ++o) { var s = i[o] 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, r = t.length; n !== r; ++n) { var i = t[n] 0 === --i.useCount && (i.restoreOriginalState(), this._takeBackBinding(i)) } 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 r = this._actions, i = this._actionsByClip, o = i[t] if (void 0 === o) (o = { knownActions: [e], actionByRoot: {} }), (e._byClipCacheIndex = 0), (i[t] = o) else { var a = o.knownActions ;(e._byClipCacheIndex = a.length), a.push(e) } ;(e._cacheIndex = r.length), r.push(e), (o.actionByRoot[n] = e) }, _removeInactiveAction: function (e) { var t = this._actions, n = t[t.length - 1], r = e._cacheIndex ;(n._cacheIndex = r), (t[r] = n), t.pop(), (e._cacheIndex = null) var i = e._clip.uuid, o = this._actionsByClip, a = o[i], s = a.knownActions, l = s[s.length - 1], c = e._byClipCacheIndex ;(l._byClipCacheIndex = c), (s[c] = l), s.pop(), (e._byClipCacheIndex = null), delete a.actionByRoot[(e._localRoot || this._root).uuid], 0 === s.length && delete o[i], this._removeInactiveBindingsForAction(e) }, _removeInactiveBindingsForAction: function (e) { for (var t = e._propertyBindings, n = 0, r = t.length; n !== r; ++n) { var i = t[n] 0 === --i.referenceCount && this._removeInactiveBinding(i) } }, _lendAction: function (e) { var t = this._actions, n = e._cacheIndex, r = this._nActiveActions++, i = t[r] ;(e._cacheIndex = r), (t[r] = e), (i._cacheIndex = n), (t[n] = i) }, _takeBackAction: function (e) { var t = this._actions, n = e._cacheIndex, r = --this._nActiveActions, i = t[r] ;(e._cacheIndex = r), (t[r] = e), (i._cacheIndex = n), (t[n] = i) }, _addInactiveBinding: function (e, t, n) { var r = this._bindingsByRootAndName, i = this._bindings, o = r[t] void 0 === o && ((o = {}), (r[t] = o)), (o[n] = e), (e._cacheIndex = i.length), i.push(e) }, _removeInactiveBinding: function (e) { var t = this._bindings, n = e.binding, r = n.rootNode.uuid, i = n.path, o = this._bindingsByRootAndName, a = o[r], s = t[t.length - 1], l = e._cacheIndex ;(s._cacheIndex = l), (t[l] = s), t.pop(), delete a[i], 0 === Object.keys(a).length && delete o[r] }, _lendBinding: function (e) { var t = this._bindings, n = e._cacheIndex, r = this._nActiveBindings++, i = t[r] ;(e._cacheIndex = r), (t[r] = e), (i._cacheIndex = n), (t[n] = i) }, _takeBackBinding: function (e) { var t = this._bindings, n = e._cacheIndex, r = --this._nActiveBindings, i = t[r] ;(e._cacheIndex = r), (t[r] = e), (i._cacheIndex = n), (t[n] = i) }, _lendControlInterpolant: function () { var e = this._controlInterpolants, t = this._nActiveControlInterpolants++, n = e[t] return ( void 0 === n && (((n = new qu( new Float32Array(2), new Float32Array(2), 1, this._controlInterpolantsResultBuffer, )).__cacheIndex = t), (e[t] = n)), n ) }, _takeBackControlInterpolant: function (e) { var t = this._controlInterpolants, n = e.__cacheIndex, r = --this._nActiveControlInterpolants, i = t[r] ;(e.__cacheIndex = r), (t[r] = e), (i.__cacheIndex = n), (t[n] = i) }, _controlInterpolantsResultBuffer: new Float32Array(1), clipAction: function (e, t, n) { var r = t || this._root, i = r.uuid, o = 'string' === typeof e ? nh.findByName(r, e) : e, a = null !== o ? o.uuid : e, s = this._actionsByClip[a], l = null if ((void 0 === n && (n = null !== o ? o.blendMode : qt), void 0 !== s)) { var c = s.actionByRoot[i] if (void 0 !== c && c.blendMode === n) return c ;(l = s.knownActions[0]), null === o && (o = l._clip) } if (null === o) return null var u = new ip(this, o, t, n) return this._bindAction(u, l), this._addInactiveAction(u, a, i), u }, existingAction: function (e, t) { var n = t || this._root, r = n.uuid, i = 'string' === typeof e ? nh.findByName(n, e) : e, o = i ? i.uuid : e, a = this._actionsByClip[o] return (void 0 !== a && a.actionByRoot[r]) || null }, stopAllAction: function () { for (var e = this._actions, t = this._nActiveActions - 1; t >= 0; --t) e[t].stop() return this }, update: function (e) { e *= this.timeScale for ( var t = this._actions, n = this._nActiveActions, r = (this.time += e), i = Math.sign(e), o = (this._accuIndex ^= 1), a = 0; a !== n; ++a ) t[a]._update(r, e, i, o) for (var s = this._bindings, l = this._nActiveBindings, c = 0; c !== l; ++c) s[c].apply(o) 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, r = this._actionsByClip, i = r[n] if (void 0 !== i) { for (var o = i.knownActions, a = 0, s = o.length; a !== s; ++a) { var l = o[a] this._deactivateAction(l) var c = l._cacheIndex, u = t[t.length - 1] ;(l._cacheIndex = null), (l._byClipCacheIndex = null), (u._cacheIndex = c), (t[c] = u), t.pop(), this._removeInactiveBindingsForAction(l) } delete r[n] } }, uncacheRoot: function (e) { var t = e.uuid, n = this._actionsByClip for (var r in n) { var i = n[r].actionByRoot[t] void 0 !== i && (this._deactivateAction(i), this._removeInactiveAction(i)) } var o = this._bindingsByRootAndName[t] if (void 0 !== o) for (var a in o) { var s = o[a] s.restoreOriginalState(), this._removeInactiveBinding(s) } }, uncacheAction: function (e, t) { var n = this.existingAction(e, t) null !== n && (this._deactivateAction(n), this._removeInactiveAction(n)) }, }) var ap = (function () { function e(e) { 'string' === typeof e && (console.warn('THREE.Uniform: Type parameter is no longer needed.'), (e = arguments[1])), (this.value = e) } return ( (e.prototype.clone = function () { return new e( void 0 === this.value.clone ? this.value : this.value.clone(), ) }), e ) })() function sp(e, t, n) { yl.call(this, e, t), (this.meshPerAttribute = n || 1) } function lp(e, t, n, r, i) { ;(this.buffer = e), (this.type = t), (this.itemSize = n), (this.elementSize = r), (this.count = i), (this.version = 0) } function cp(e, t, n, r) { ;(this.ray = new Br(e, t)), (this.near = n || 0), (this.far = r || 1 / 0), (this.camera = null), (this.layers = new Xr()), (this.params = { Mesh: {}, Line: { threshold: 1 }, 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 up(e, t) { return e.distance - t.distance } function hp(e, t, n, r) { if ((e.layers.test(t.layers) && e.raycast(t, n), !0 === r)) for (var i = e.children, o = 0, a = i.length; o < a; o++) hp(i[o], t, n, !0) } ;(sp.prototype = Object.assign(Object.create(yl.prototype), { constructor: sp, isInstancedInterleavedBuffer: !0, copy: function (e) { return ( yl.prototype.copy.call(this, e), (this.meshPerAttribute = e.meshPerAttribute), this ) }, clone: function (e) { var t = yl.prototype.clone.call(this, e) return (t.meshPerAttribute = this.meshPerAttribute), t }, toJSON: function (e) { var t = yl.prototype.toJSON.call(this, e) return ( (t.isInstancedInterleavedBuffer = !0), (t.meshPerAttribute = this.meshPerAttribute), t ) }, })), Object.defineProperty(lp.prototype, 'needsUpdate', { set: function (e) { !0 === e && this.version++ }, }), Object.assign(lp.prototype, { isGLBufferAttribute: !0, setBuffer: function (e) { return (this.buffer = e), this }, setType: function (e, t) { return (this.type = e), (this.elementSize = t), this }, setItemSize: function (e) { return (this.itemSize = e), this }, setCount: function (e) { return (this.count = e), this }, }), Object.assign(cp.prototype, { 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, 0.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: ' + t.type) }, intersectObject: function (e, t, n) { var r = n || [] return hp(e, this, r, t), r.sort(up), r }, intersectObjects: function (e, t, n) { var r = n || [] if (!1 === Array.isArray(e)) return ( console.warn( 'THREE.Raycaster.intersectObjects: objects is not an Array.', ), r ) for (var i = 0, o = e.length; i < o; i++) hp(e[i], this, r, t) return r.sort(up), r }, }) var dp = (function () { function e(e, t, n) { return ( void 0 === e && (e = 1), void 0 === t && (t = 0), void 0 === n && (n = 0), (this.radius = e), (this.phi = t), (this.theta = n), this ) } var t = e.prototype return ( (t.set = function (e, t, n) { return (this.radius = e), (this.phi = t), (this.theta = n), this }), (t.clone = function () { return new this.constructor().copy(this) }), (t.copy = function (e) { return ( (this.radius = e.radius), (this.phi = e.phi), (this.theta = e.theta), this ) }), (t.makeSafe = function () { var e = 1e-6 return (this.phi = Math.max(e, Math.min(Math.PI - e, this.phi))), this }), (t.setFromVector3 = function (e) { return this.setFromCartesianCoords(e.x, e.y, e.z) }), (t.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(Kn.clamp(t / this.radius, -1, 1)))), this ) }), e ) })(), pp = (function () { function e(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 ) } var t = e.prototype return ( (t.set = function (e, t, n) { return (this.radius = e), (this.theta = t), (this.y = n), this }), (t.clone = function () { return new this.constructor().copy(this) }), (t.copy = function (e) { return ( (this.radius = e.radius), (this.theta = e.theta), (this.y = e.y), this ) }), (t.setFromVector3 = function (e) { return this.setFromCartesianCoords(e.x, e.y, e.z) }), (t.setFromCartesianCoords = function (e, t, n) { return ( (this.radius = Math.sqrt(e * e + n * n)), (this.theta = Math.atan2(e, n)), (this.y = t), this ) }), e ) })(), fp = new Jn(), mp = (function () { function e(e, t) { Object.defineProperty(this, 'isBox2', { value: !0 }), (this.min = void 0 !== e ? e : new Jn(1 / 0, 1 / 0)), (this.max = void 0 !== t ? t : new Jn(-1 / 0, -1 / 0)) } var t = e.prototype return ( (t.set = function (e, t) { return this.min.copy(e), this.max.copy(t), this }), (t.setFromPoints = function (e) { this.makeEmpty() for (var t = 0, n = e.length; t < n; t++) this.expandByPoint(e[t]) return this }), (t.setFromCenterAndSize = function (e, t) { var n = fp.copy(t).multiplyScalar(0.5) return this.min.copy(e).sub(n), this.max.copy(e).add(n), this }), (t.clone = function () { return new this.constructor().copy(this) }), (t.copy = function (e) { return this.min.copy(e.min), this.max.copy(e.max), this }), (t.makeEmpty = function () { return ( (this.min.x = this.min.y = 1 / 0), (this.max.x = this.max.y = -1 / 0), this ) }), (t.isEmpty = function () { return this.max.x < this.min.x || this.max.y < this.min.y }), (t.getCenter = function (e) { return ( void 0 === e && (console.warn('THREE.Box2: .getCenter() target is now required'), (e = new Jn())), this.isEmpty() ? e.set(0, 0) : e.addVectors(this.min, this.max).multiplyScalar(0.5) ) }), (t.getSize = function (e) { return ( void 0 === e && (console.warn('THREE.Box2: .getSize() target is now required'), (e = new Jn())), this.isEmpty() ? e.set(0, 0) : e.subVectors(this.max, this.min) ) }), (t.expandByPoint = function (e) { return this.min.min(e), this.max.max(e), this }), (t.expandByVector = function (e) { return this.min.sub(e), this.max.add(e), this }), (t.expandByScalar = function (e) { return this.min.addScalar(-e), this.max.addScalar(e), this }), (t.containsPoint = function (e) { return !( e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y ) }), (t.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 ) }), (t.getParameter = function (e, t) { return ( void 0 === t && (console.warn('THREE.Box2: .getParameter() target is now required'), (t = new Jn())), t.set( (e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y), ) ) }), (t.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 ) }), (t.clampPoint = function (e, t) { return ( void 0 === t && (console.warn('THREE.Box2: .clampPoint() target is now required'), (t = new Jn())), t.copy(e).clamp(this.min, this.max) ) }), (t.distanceToPoint = function (e) { return fp.copy(e).clamp(this.min, this.max).sub(e).length() }), (t.intersect = function (e) { return this.min.max(e.min), this.max.min(e.max), this }), (t.union = function (e) { return this.min.min(e.min), this.max.max(e.max), this }), (t.translate = function (e) { return this.min.add(e), this.max.add(e), this }), (t.equals = function (e) { return e.min.equals(this.min) && e.max.equals(this.max) }), e ) })(), vp = new lr(), gp = new lr(), yp = (function () { function e(e, t) { ;(this.start = void 0 !== e ? e : new lr()), (this.end = void 0 !== t ? t : new lr()) } var t = e.prototype return ( (t.set = function (e, t) { return this.start.copy(e), this.end.copy(t), this }), (t.clone = function () { return new this.constructor().copy(this) }), (t.copy = function (e) { return this.start.copy(e.start), this.end.copy(e.end), this }), (t.getCenter = function (e) { return ( void 0 === e && (console.warn('THREE.Line3: .getCenter() target is now required'), (e = new lr())), e.addVectors(this.start, this.end).multiplyScalar(0.5) ) }), (t.delta = function (e) { return ( void 0 === e && (console.warn('THREE.Line3: .delta() target is now required'), (e = new lr())), e.subVectors(this.end, this.start) ) }), (t.distanceSq = function () { return this.start.distanceToSquared(this.end) }), (t.distance = function () { return this.start.distanceTo(this.end) }), (t.at = function (e, t) { return ( void 0 === t && (console.warn('THREE.Line3: .at() target is now required'), (t = new lr())), this.delta(t).multiplyScalar(e).add(this.start) ) }), (t.closestPointToPointParameter = function (e, t) { vp.subVectors(e, this.start), gp.subVectors(this.end, this.start) var n = gp.dot(gp), r = gp.dot(vp) / n return t && (r = Kn.clamp(r, 0, 1)), r }), (t.closestPointToPoint = function (e, t, n) { var r = this.closestPointToPointParameter(e, t) return ( void 0 === n && (console.warn( 'THREE.Line3: .closestPointToPoint() target is now required', ), (n = new lr())), this.delta(n).multiplyScalar(r).add(this.start) ) }), (t.applyMatrix4 = function (e) { return this.start.applyMatrix4(e), this.end.applyMatrix4(e), this }), (t.equals = function (e) { return e.start.equals(this.start) && e.end.equals(this.end) }), e ) })() function bp(e) { si.call(this), (this.material = e), (this.render = function () {}), (this.hasPositions = !1), (this.hasNormals = !1), (this.hasColors = !1), (this.hasUvs = !1), (this.positionArray = null), (this.normalArray = null), (this.colorArray = null), (this.uvArray = null), (this.count = 0) } ;(bp.prototype = Object.create(si.prototype)), (bp.prototype.constructor = bp), (bp.prototype.isImmediateRenderObject = !0) var Ap = new lr(), wp = (function (e) { function t(t, n) { var r ;((r = e.call(this) || this).light = t), r.light.updateMatrixWorld(), (r.matrix = t.matrixWorld), (r.matrixAutoUpdate = !1), (r.color = n) for ( var i = new ro(), o = [ 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, ], a = 0, s = 1, l = 32; a < l; a++, s++ ) { var c = (a / l) * Math.PI * 2, u = (s / l) * Math.PI * 2 o.push(Math.cos(c), Math.sin(c), 1, Math.cos(u), Math.sin(u), 1) } i.setAttribute('position', new Wi(o, 3)) var h = new tc({ fog: !1, toneMapped: !1 }) return (r.cone = new uc(i, h)), r.add(r.cone), r.update(), r } Gn(t, e) var n = t.prototype return ( (n.dispose = function () { this.cone.geometry.dispose(), this.cone.material.dispose() }), (n.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), Ap.setFromMatrixPosition(this.light.target.matrixWorld), this.cone.lookAt(Ap), void 0 !== this.color ? this.cone.material.color.set(this.color) : this.cone.material.color.copy(this.light.color) }), t ) })(si), xp = new lr(), Ep = new Fr(), Mp = new Fr(), _p = (function (e) { function t(t) { for ( var n, r = Tp(t), i = new ro(), o = [], a = [], s = new Li(0, 0, 1), l = new Li(0, 1, 0), c = 0; c < r.length; c++ ) { var u = r[c] u.parent && u.parent.isBone && (o.push(0, 0, 0), o.push(0, 0, 0), a.push(s.r, s.g, s.b), a.push(l.r, l.g, l.b)) } i.setAttribute('position', new Wi(o, 3)), i.setAttribute('color', new Wi(a, 3)) var h = new tc({ vertexColors: !0, depthTest: !1, depthWrite: !1, toneMapped: !1, transparent: !0, }) return ( ((n = e.call(this, i, h) || this).type = 'SkeletonHelper'), (n.isSkeletonHelper = !0), (n.root = t), (n.bones = r), (n.matrix = t.matrixWorld), (n.matrixAutoUpdate = !1), n ) } return ( Gn(t, e), (t.prototype.updateMatrixWorld = function (t) { var n = this.bones, r = this.geometry, i = r.getAttribute('position') Mp.copy(this.root.matrixWorld).invert() for (var o = 0, a = 0; o < n.length; o++) { var s = n[o] s.parent && s.parent.isBone && (Ep.multiplyMatrices(Mp, s.matrixWorld), xp.setFromMatrixPosition(Ep), i.setXYZ(a, xp.x, xp.y, xp.z), Ep.multiplyMatrices(Mp, s.parent.matrixWorld), xp.setFromMatrixPosition(Ep), i.setXYZ(a + 1, xp.x, xp.y, xp.z), (a += 2)) } ;(r.getAttribute('position').needsUpdate = !0), e.prototype.updateMatrixWorld.call(this, t) }), t ) })(uc) function Tp(e) { var t = [] e && e.isBone && t.push(e) for (var n = 0; n < e.children.length; n++) t.push.apply(t, Tp(e.children[n])) return t } var Sp = (function (e) { function t(t, n, r) { var i, o = new Mu(n, 4, 2), a = new Oi({ wireframe: !0, fog: !1, toneMapped: !1 }) return ( ((i = e.call(this, o, a) || this).light = t), i.light.updateMatrixWorld(), (i.color = r), (i.type = 'PointLightHelper'), (i.matrix = i.light.matrixWorld), (i.matrixAutoUpdate = !1), i.update(), i ) } Gn(t, e) var n = t.prototype return ( (n.dispose = function () { this.geometry.dispose(), this.material.dispose() }), (n.update = function () { void 0 !== this.color ? this.material.color.set(this.color) : this.material.color.copy(this.light.color) }), t ) })(xo), Cp = new lr(), Lp = new Li(), Rp = new Li(), Pp = (function (e) { function t(t, n, r) { var i ;((i = e.call(this) || this).light = t), i.light.updateMatrixWorld(), (i.matrix = t.matrixWorld), (i.matrixAutoUpdate = !1), (i.color = r) var o = new bu(n) o.rotateY(0.5 * Math.PI), (i.material = new Oi({ wireframe: !0, fog: !1, toneMapped: !1 })), void 0 === i.color && (i.material.vertexColors = !0) var a = o.getAttribute('position'), s = new Float32Array(3 * a.count) return ( o.setAttribute('color', new Fi(s, 3)), i.add(new xo(o, i.material)), i.update(), i ) } Gn(t, e) var n = t.prototype return ( (n.dispose = function () { this.children[0].geometry.dispose(), this.children[0].material.dispose() }), (n.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') Lp.copy(this.light.color), Rp.copy(this.light.groundColor) for (var n = 0, r = t.count; n < r; n++) { var i = n < r / 2 ? Lp : Rp t.setXYZ(n, i.r, i.g, i.b) } t.needsUpdate = !0 } e.lookAt(Cp.setFromMatrixPosition(this.light.matrixWorld).negate()) }), t ) })(si), Dp = (function (e) { function t(t, n, r, i) { var o void 0 === t && (t = 10), void 0 === n && (n = 10), void 0 === r && (r = 4473924), void 0 === i && (i = 8947848), (r = new Li(r)), (i = new Li(i)) for ( var a = n / 2, s = t / n, l = t / 2, c = [], u = [], h = 0, d = 0, p = -l; h <= n; h++, p += s ) { c.push(-l, 0, p, l, 0, p), c.push(p, 0, -l, p, 0, l) var f = h === a ? r : i f.toArray(u, d), (d += 3), f.toArray(u, d), (d += 3), f.toArray(u, d), (d += 3), f.toArray(u, d), (d += 3) } var m = new ro() m.setAttribute('position', new Wi(c, 3)), m.setAttribute('color', new Wi(u, 3)) var v = new tc({ vertexColors: !0, toneMapped: !1 }) return ((o = e.call(this, m, v) || this).type = 'GridHelper'), o } return Gn(t, e), t })(uc), Op = (function (e) { function t(t, n, r, i, o, a) { var s void 0 === t && (t = 10), void 0 === n && (n = 16), void 0 === r && (r = 8), void 0 === i && (i = 64), void 0 === o && (o = 4473924), void 0 === a && (a = 8947848), (o = new Li(o)), (a = new Li(a)) for (var l = [], c = [], u = 0; u <= n; u++) { var h = (u / n) * (2 * Math.PI), d = Math.sin(h) * t, p = Math.cos(h) * t l.push(0, 0, 0), l.push(d, 0, p) var f = 1 & u ? o : a c.push(f.r, f.g, f.b), c.push(f.r, f.g, f.b) } for (var m = 0; m <= r; m++) for (var v = 1 & m ? o : a, g = t - (t / r) * m, y = 0; y < i; y++) { var b = (y / i) * (2 * Math.PI), A = Math.sin(b) * g, w = Math.cos(b) * g l.push(A, 0, w), c.push(v.r, v.g, v.b), (b = ((y + 1) / i) * (2 * Math.PI)), (A = Math.sin(b) * g), (w = Math.cos(b) * g), l.push(A, 0, w), c.push(v.r, v.g, v.b) } var x = new ro() x.setAttribute('position', new Wi(l, 3)), x.setAttribute('color', new Wi(c, 3)) var E = new tc({ vertexColors: !0, toneMapped: !1 }) return ((s = e.call(this, x, E) || this).type = 'PolarGridHelper'), s } return Gn(t, e), t })(uc), Ip = new lr(), Bp = new lr(), Fp = new lr(), kp = (function (e) { function t(t, n, r) { var i ;((i = e.call(this) || this).light = t), i.light.updateMatrixWorld(), (i.matrix = t.matrixWorld), (i.matrixAutoUpdate = !1), (i.color = r), void 0 === n && (n = 1) var o = new ro() o.setAttribute( 'position', new Wi([-n, n, 0, n, n, 0, n, -n, 0, -n, -n, 0, -n, n, 0], 3), ) var a = new tc({ fog: !1, toneMapped: !1 }) return ( (i.lightPlane = new sc(o, a)), i.add(i.lightPlane), (o = new ro()).setAttribute('position', new Wi([0, 0, 0, 0, 0, 1], 3)), (i.targetLine = new sc(o, a)), i.add(i.targetLine), i.update(), i ) } Gn(t, e) var n = t.prototype return ( (n.dispose = function () { this.lightPlane.geometry.dispose(), this.lightPlane.material.dispose(), this.targetLine.geometry.dispose(), this.targetLine.material.dispose() }), (n.update = function () { Ip.setFromMatrixPosition(this.light.matrixWorld), Bp.setFromMatrixPosition(this.light.target.matrixWorld), Fp.subVectors(Bp, Ip), this.lightPlane.lookAt(Bp), 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(Bp), (this.targetLine.scale.z = Fp.length()) }), t ) })(si), Np = new lr(), Up = new Do(), Hp = (function (e) { function t(t) { var n, r = new ro(), i = new tc({ color: 16777215, vertexColors: !0, toneMapped: !1 }), o = [], a = [], s = {}, l = new Li(16755200), c = new Li(16711680), u = new Li(43775), h = new Li(16777215), d = new Li(3355443) function p(e, t, n) { f(e, n), f(t, n) } function f(e, t) { o.push(0, 0, 0), a.push(t.r, t.g, t.b), void 0 === s[e] && (s[e] = []), s[e].push(o.length / 3 - 1) } return ( p('n1', 'n2', l), p('n2', 'n4', l), p('n4', 'n3', l), p('n3', 'n1', l), p('f1', 'f2', l), p('f2', 'f4', l), p('f4', 'f3', l), p('f3', 'f1', l), p('n1', 'f1', l), p('n2', 'f2', l), p('n3', 'f3', l), p('n4', 'f4', l), p('p', 'n1', c), p('p', 'n2', c), p('p', 'n3', c), p('p', 'n4', c), p('u1', 'u2', u), p('u2', 'u3', u), p('u3', 'u1', u), p('c', 't', h), p('p', 'c', d), p('cn1', 'cn2', d), p('cn3', 'cn4', d), p('cf1', 'cf2', d), p('cf3', 'cf4', d), r.setAttribute('position', new Wi(o, 3)), r.setAttribute('color', new Wi(a, 3)), ((n = e.call(this, r, i) || this).type = 'CameraHelper'), (n.camera = t), n.camera.updateProjectionMatrix && n.camera.updateProjectionMatrix(), (n.matrix = t.matrixWorld), (n.matrixAutoUpdate = !1), (n.pointMap = s), n.update(), n ) } return ( Gn(t, e), (t.prototype.update = function () { var e = this.geometry, t = this.pointMap, n = 1, r = 1 Up.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse), Gp('c', t, e, Up, 0, 0, -1), Gp('t', t, e, Up, 0, 0, 1), Gp('n1', t, e, Up, -n, -r, -1), Gp('n2', t, e, Up, n, -r, -1), Gp('n3', t, e, Up, -n, r, -1), Gp('n4', t, e, Up, n, r, -1), Gp('f1', t, e, Up, -n, -r, 1), Gp('f2', t, e, Up, n, -r, 1), Gp('f3', t, e, Up, -n, r, 1), Gp('f4', t, e, Up, n, r, 1), Gp('u1', t, e, Up, 0.7 * n, 1.1 * r, -1), Gp('u2', t, e, Up, 0.7 * -n, 1.1 * r, -1), Gp('u3', t, e, Up, 0, 2 * r, -1), Gp('cf1', t, e, Up, -n, 0, 1), Gp('cf2', t, e, Up, n, 0, 1), Gp('cf3', t, e, Up, 0, -r, 1), Gp('cf4', t, e, Up, 0, r, 1), Gp('cn1', t, e, Up, -n, 0, -1), Gp('cn2', t, e, Up, n, 0, -1), Gp('cn3', t, e, Up, 0, -r, -1), Gp('cn4', t, e, Up, 0, r, -1), (e.getAttribute('position').needsUpdate = !0) }), t ) })(uc) function Gp(e, t, n, r, i, o, a) { Np.set(i, o, a).unproject(r) var s = t[e] if (void 0 !== s) for (var l = n.getAttribute('position'), c = 0, u = s.length; c < u; c++) l.setXYZ(s[c], Np.x, Np.y, Np.z) } var zp, jp, Vp, Wp = new hr(), qp = (function (e) { function t(t, n) { var r void 0 === n && (n = 16776960) var i = new Uint16Array([ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7, ]), o = new Float32Array(24), a = new ro() return ( a.setIndex(new Fi(i, 1)), a.setAttribute('position', new Fi(o, 3)), ((r = e.call(this, a, new tc({ color: n, toneMapped: !1 })) || this).object = t), (r.type = 'BoxHelper'), (r.matrixAutoUpdate = !1), r.update(), r ) } Gn(t, e) var n = t.prototype return ( (n.update = function (e) { if ( (void 0 !== e && console.warn('THREE.BoxHelper: .update() has no longer arguments.'), void 0 !== this.object && Wp.setFromObject(this.object), !Wp.isEmpty()) ) { var t = Wp.min, n = Wp.max, r = this.geometry.attributes.position, i = r.array ;(i[0] = n.x), (i[1] = n.y), (i[2] = n.z), (i[3] = t.x), (i[4] = n.y), (i[5] = n.z), (i[6] = t.x), (i[7] = t.y), (i[8] = n.z), (i[9] = n.x), (i[10] = t.y), (i[11] = n.z), (i[12] = n.x), (i[13] = n.y), (i[14] = t.z), (i[15] = t.x), (i[16] = n.y), (i[17] = t.z), (i[18] = t.x), (i[19] = t.y), (i[20] = t.z), (i[21] = n.x), (i[22] = t.y), (i[23] = t.z), (r.needsUpdate = !0), this.geometry.computeBoundingSphere() } }), (n.setFromObject = function (e) { return (this.object = e), this.update(), this }), (n.copy = function (e) { return uc.prototype.copy.call(this, e), (this.object = e.object), this }), t ) })(uc), Xp = (function (e) { function t(t, n) { var r void 0 === n && (n = 16776960) var i = new Uint16Array([ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7, ]), o = [ 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, ], a = new ro() return ( a.setIndex(new Fi(i, 1)), a.setAttribute('position', new Wi(o, 3)), ((r = e.call(this, a, new tc({ color: n, toneMapped: !1 })) || this).box = t), (r.type = 'Box3Helper'), r.geometry.computeBoundingSphere(), r ) } return ( Gn(t, e), (t.prototype.updateMatrixWorld = function (t) { var n = this.box n.isEmpty() || (n.getCenter(this.position), n.getSize(this.scale), this.scale.multiplyScalar(0.5), e.prototype.updateMatrixWorld.call(this, t)) }), t ) })(uc), Yp = (function (e) { function t(t, n, r) { var i void 0 === n && (n = 1), void 0 === r && (r = 16776960) var o = r, a = [ 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, ], s = new ro() s.setAttribute('position', new Wi(a, 3)), s.computeBoundingSphere(), ((i = e.call(this, s, new tc({ color: o, toneMapped: !1 })) || this).type = 'PlaneHelper'), (i.plane = t), (i.size = n) var l = [1, 1, 1, -1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, 1, 1, -1, 1], c = new ro() return ( c.setAttribute('position', new Wi(l, 3)), c.computeBoundingSphere(), i.add( new xo( c, new Oi({ color: o, opacity: 0.2, transparent: !0, depthWrite: !1, toneMapped: !1, }), ), ), i ) } return ( Gn(t, e), (t.prototype.updateMatrixWorld = function (t) { var n = -this.plane.constant Math.abs(n) < 1e-8 && (n = 1e-8), this.scale.set(0.5 * this.size, 0.5 * this.size, n), (this.children[0].material.side = n < 0 ? v : m), this.lookAt(this.plane.normal), e.prototype.updateMatrixWorld.call(this, t) }), t ) })(sc), Qp = new lr(), Zp = (function (e) { function t(t, n, r, i, o, a) { var s return ( ((s = e.call(this) || this).type = 'ArrowHelper'), void 0 === t && (t = new lr(0, 0, 1)), void 0 === n && (n = new lr(0, 0, 0)), void 0 === r && (r = 1), void 0 === i && (i = 16776960), void 0 === o && (o = 0.2 * r), void 0 === a && (a = 0.2 * o), void 0 === zp && ((zp = new ro()).setAttribute( 'position', new Wi([0, 0, 0, 0, 1, 0], 3), ), (jp = new Mc(0, 0.5, 1, 5, 1)).translate(0, -0.5, 0)), s.position.copy(n), (s.line = new sc(zp, new tc({ color: i, toneMapped: !1 }))), (s.line.matrixAutoUpdate = !1), s.add(s.line), (s.cone = new xo(jp, new Oi({ color: i, toneMapped: !1 }))), (s.cone.matrixAutoUpdate = !1), s.add(s.cone), s.setDirection(t), s.setLength(r, o, a), s ) } Gn(t, e) var n = t.prototype return ( (n.setDirection = function (e) { if (e.y > 0.99999) this.quaternion.set(0, 0, 0, 1) else if (e.y < -0.99999) this.quaternion.set(1, 0, 0, 0) else { Qp.set(e.z, 0, -e.x).normalize() var t = Math.acos(e.y) this.quaternion.setFromAxisAngle(Qp, t) } }), (n.setLength = function (e, t, n) { void 0 === t && (t = 0.2 * e), void 0 === n && (n = 0.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() }), (n.setColor = function (e) { this.line.material.color.set(e), this.cone.material.color.set(e) }), (n.copy = function (t) { return ( e.prototype.copy.call(this, t, !1), this.line.copy(t.line), this.cone.copy(t.cone), this ) }), t ) })(si), Kp = (function (e) { function t(t) { var n void 0 === t && (t = 1) var r = [0, 0, 0, t, 0, 0, 0, 0, 0, 0, t, 0, 0, 0, 0, 0, 0, t], i = [1, 0, 0, 1, 0.6, 0, 0, 1, 0, 0.6, 1, 0, 0, 0, 1, 0, 0.6, 1], o = new ro() o.setAttribute('position', new Wi(r, 3)), o.setAttribute('color', new Wi(i, 3)) var a = new tc({ vertexColors: !0, toneMapped: !1 }) return ((n = e.call(this, o, a) || this).type = 'AxesHelper'), n } return Gn(t, e), t })(uc), Jp = new Float32Array(1), $p = new Int32Array(Jp.buffer), ef = { toHalfFloat: function (e) { Jp[0] = e var t = $p[0], n = (t >> 16) & 32768, r = (t >> 12) & 2047, i = (t >> 23) & 255 return i < 103 ? n : i > 142 ? ((n |= 31744), (n |= (255 == i ? 0 : 1) && 8388607 & t)) : i < 113 ? (n |= ((r |= 2048) >> (114 - i)) + ((r >> (113 - i)) & 1)) : ((n |= ((i - 112) << 10) | (r >> 1)), (n += 1 & r)) }, }, tf = 4, nf = 8, rf = Math.pow(2, nf), of = [0.125, 0.215, 0.35, 0.446, 0.526, 0.582], af = nf - tf + 1 + of.length, sf = 20, lf = (((Vp = {})[Kt] = 0), (Vp[Jt] = 1), (Vp[en] = 2), (Vp[nn] = 3), (Vp[rn] = 4), (Vp[on] = 5), (Vp[$t] = 6), Vp), cf = new Oi({ side: v, depthWrite: !1, depthTest: !1 }), uf = new xo(new _o(), cf), hf = new ed(), df = Mf(), pf = df._lodPlanes, ff = df._sizeLods, mf = df._sigmas, vf = new Li(), gf = null, yf = (1 + Math.sqrt(5)) / 2, bf = 1 / yf, Af = [ new lr(1, 1, 1), new lr(-1, 1, 1), new lr(1, 1, -1), new lr(-1, 1, -1), new lr(0, yf, bf), new lr(0, yf, -bf), new lr(bf, 0, yf), new lr(-bf, 0, yf), new lr(yf, bf, 0), new lr(-yf, bf, 0), ] function wf(e) { var t = Math.max(e.r, e.g, e.b), n = Math.min(Math.max(Math.ceil(Math.log2(t)), -128), 127) return e.multiplyScalar(Math.pow(2, -n)), (n + 128) / 255 } var xf = (function () { function e(e) { ;(this._renderer = e), (this._pingPongRenderTarget = null), (this._blurMaterial = Sf(sf)), (this._equirectShader = null), (this._cubemapShader = null), this._compileMaterial(this._blurMaterial) } var t = e.prototype return ( (t.fromScene = function (e, t, n, r) { void 0 === t && (t = 0), void 0 === n && (n = 0.1), void 0 === r && (r = 100), (gf = this._renderer.getRenderTarget()) var i = this._allocateTargets() return ( this._sceneToCubeUV(e, n, r, i), t > 0 && this._blur(i, 0, 0, t), this._applyPMREM(i), this._cleanup(i), i ) }), (t.fromEquirectangular = function (e) { return this._fromTexture(e) }), (t.fromCubemap = function (e) { return this._fromTexture(e) }), (t.compileCubemapShader = function () { null === this._cubemapShader && ((this._cubemapShader = Lf()), this._compileMaterial(this._cubemapShader)) }), (t.compileEquirectangularShader = function () { null === this._equirectShader && ((this._equirectShader = Cf()), this._compileMaterial(this._equirectShader)) }), (t.dispose = function () { this._blurMaterial.dispose(), null !== this._cubemapShader && this._cubemapShader.dispose(), null !== this._equirectShader && this._equirectShader.dispose() for (var e = 0; e < pf.length; e++) pf[e].dispose() }), (t._cleanup = function (e) { this._pingPongRenderTarget.dispose(), this._renderer.setRenderTarget(gf), (e.scissorTest = !1), Tf(e, 0, 0, e.width, e.height) }), (t._fromTexture = function (e) { gf = this._renderer.getRenderTarget() var t = this._allocateTargets(e) return ( this._textureToCubeUV(e, t), this._applyPMREM(t), this._cleanup(t), t ) }), (t._allocateTargets = function (e) { var t = { magFilter: me, minFilter: me, generateMipmaps: !1, type: _e, format: ze, encoding: Ef(e) ? e.encoding : en, depthBuffer: !1, }, n = _f(t) return (n.depthBuffer = !e), (this._pingPongRenderTarget = _f(t)), n }), (t._compileMaterial = function (e) { var t = new xo(pf[0], e) this._renderer.compile(t, hf) }), (t._sceneToCubeUV = function (e, t, n, r) { var i = new Oo(90, 1, t, n), o = [1, -1, 1, 1, 1, 1], a = [1, 1, 1, -1, -1, -1], s = this._renderer, l = s.autoClear, c = s.outputEncoding, u = s.toneMapping s.getClearColor(vf), (s.toneMapping = $), (s.outputEncoding = Kt), (s.autoClear = !1) var h = !1, d = e.background if (d) { if (d.isColor) { cf.color.copy(d).convertSRGBToLinear(), (e.background = null) var p = wf(cf.color) ;(cf.opacity = p), (h = !0) } } else { cf.color.copy(vf).convertSRGBToLinear() var f = wf(cf.color) ;(cf.opacity = f), (h = !0) } for (var m = 0; m < 6; m++) { var v = m % 3 0 == v ? (i.up.set(0, o[m], 0), i.lookAt(a[m], 0, 0)) : 1 == v ? (i.up.set(0, 0, o[m]), i.lookAt(0, a[m], 0)) : (i.up.set(0, o[m], 0), i.lookAt(0, 0, a[m])), Tf(r, v * rf, m > 2 ? rf : 0, rf, rf), s.setRenderTarget(r), h && s.render(uf, i), s.render(e, i) } ;(s.toneMapping = u), (s.outputEncoding = c), (s.autoClear = l) }), (t._textureToCubeUV = function (e, t) { var n = this._renderer e.isCubeTexture ? null == this._cubemapShader && (this._cubemapShader = Lf()) : null == this._equirectShader && (this._equirectShader = Cf()) var r = e.isCubeTexture ? this._cubemapShader : this._equirectShader, i = new xo(pf[0], r), o = r.uniforms ;(o.envMap.value = e), e.isCubeTexture || o.texelSize.value.set(1 / e.image.width, 1 / e.image.height), (o.inputEncoding.value = lf[e.encoding]), (o.outputEncoding.value = lf[t.texture.encoding]), Tf(t, 0, 0, 3 * rf, 2 * rf), n.setRenderTarget(t), n.render(i, hf) }), (t._applyPMREM = function (e) { var t = this._renderer, n = t.autoClear t.autoClear = !1 for (var r = 1; r < af; r++) { var i = Math.sqrt(mf[r] * mf[r] - mf[r - 1] * mf[r - 1]), o = Af[(r - 1) % Af.length] this._blur(e, r - 1, r, i, o) } t.autoClear = n }), (t._blur = function (e, t, n, r, i) { var o = this._pingPongRenderTarget this._halfBlur(e, o, t, n, r, 'latitudinal', i), this._halfBlur(o, e, n, n, r, 'longitudinal', i) }), (t._halfBlur = function (e, t, n, r, i, o, a) { var s = this._renderer, l = this._blurMaterial 'latitudinal' !== o && 'longitudinal' !== o && console.error( 'blur direction must be either latitudinal or longitudinal!', ) var c = 3, u = new xo(pf[r], l), h = l.uniforms, d = ff[n] - 1, p = isFinite(i) ? Math.PI / (2 * d) : (2 * Math.PI) / (2 * sf - 1), f = i / p, m = isFinite(i) ? 1 + Math.floor(c * f) : sf m > sf && console.warn( 'sigmaRadians, ' + i + ', is too large and will clip, as it requested ' + m + ' samples when the maximum is set to ' + sf, ) for (var v = [], g = 0, y = 0; y < sf; ++y) { var b = y / f, A = Math.exp((-b * b) / 2) v.push(A), 0 == y ? (g += A) : y < m && (g += 2 * A) } for (var w = 0; w < v.length; w++) v[w] = v[w] / g ;(h.envMap.value = e.texture), (h.samples.value = m), (h.weights.value = v), (h.latitudinal.value = 'latitudinal' === o), a && (h.poleAxis.value = a), (h.dTheta.value = p), (h.mipInt.value = nf - n), (h.inputEncoding.value = lf[e.texture.encoding]), (h.outputEncoding.value = lf[e.texture.encoding]) var x = ff[r] Tf( t, 3 * Math.max(0, rf - 2 * x), (0 === r ? 0 : 2 * rf) + 2 * x * (r > nf - tf ? r - nf + tf : 0), 3 * x, 2 * x, ), s.setRenderTarget(t), s.render(u, hf) }), e ) })() function Ef(e) { return ( void 0 !== e && e.type === _e && (e.encoding === Kt || e.encoding === Jt || e.encoding === $t) ) } function Mf() { for (var e = [], t = [], n = [], r = nf, i = 0; i < af; i++) { var o = Math.pow(2, r) t.push(o) var a = 1 / o i > nf - tf ? (a = of[i - nf + tf - 1]) : 0 == i && (a = 0), n.push(a) for ( var s = 1 / (o - 1), l = -s / 2, c = 1 + s / 2, u = [l, l, c, l, c, c, l, l, c, c, l, c], h = 6, d = 6, p = 3, f = 2, m = 1, v = new Float32Array(p * d * h), g = new Float32Array(f * d * h), y = new Float32Array(m * d * h), b = 0; b < h; b++ ) { var A = ((b % 3) * 2) / 3 - 1, w = b > 2 ? 0 : -1, x = [ A, w, 0, A + 2 / 3, w, 0, A + 2 / 3, w + 1, 0, A, w, 0, A + 2 / 3, w + 1, 0, A, w + 1, 0, ] v.set(x, p * d * b), g.set(u, f * d * b) var E = [b, b, b, b, b, b] y.set(E, m * d * b) } var M = new ro() M.setAttribute('position', new Fi(v, p)), M.setAttribute('uv', new Fi(g, f)), M.setAttribute('faceIndex', new Fi(y, m)), e.push(M), r > tf && r-- } return { _lodPlanes: e, _sizeLods: t, _sigmas: n } } function _f(e) { var t = new or(3 * rf, 3 * rf, e) return ( (t.texture.mapping = ue), (t.texture.name = 'PMREM.cubeUv'), (t.scissorTest = !0), t ) } function Tf(e, t, n, r, i) { e.viewport.set(t, n, r, i), e.scissor.set(t, n, r, i) } function Sf(e) { return new Ou({ name: 'SphericalGaussianBlur', defines: { n: e }, uniforms: { envMap: { value: null }, samples: { value: 1 }, weights: { value: new Float32Array(e) }, latitudinal: { value: !1 }, dTheta: { value: 0 }, mipInt: { value: 0 }, poleAxis: { value: new lr(0, 1, 0) }, inputEncoding: { value: lf[Kt] }, outputEncoding: { value: lf[Kt] }, }, vertexShader: Rf(), fragmentShader: '\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t' + Pf() + "\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include \n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\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\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t", blending: A, depthTest: !1, depthWrite: !1, }) } function Cf() { return new Ou({ name: 'EquirectangularToCubeUV', uniforms: { envMap: { value: null }, texelSize: { value: new Jn(1, 1) }, inputEncoding: { value: lf[Kt] }, outputEncoding: { value: lf[Kt] }, }, vertexShader: Rf(), fragmentShader: '\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform vec2 texelSize;\n\n\t\t\t' + Pf() + '\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tvec2 f = fract( uv / texelSize - 0.5 );\n\t\t\t\tuv -= f * texelSize;\n\t\t\t\tvec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x += texelSize.x;\n\t\t\t\tvec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.y += texelSize.y;\n\t\t\t\tvec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x -= texelSize.x;\n\t\t\t\tvec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\n\t\t\t\tvec3 tm = mix( tl, tr, f.x );\n\t\t\t\tvec3 bm = mix( bl, br, f.x );\n\t\t\t\tgl_FragColor.rgb = mix( tm, bm, f.y );\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t', blending: A, depthTest: !1, depthWrite: !1, }) } function Lf() { return new Ou({ name: 'CubemapToCubeUV', uniforms: { envMap: { value: null }, inputEncoding: { value: lf[Kt] }, outputEncoding: { value: lf[Kt] }, }, vertexShader: Rf(), fragmentShader: '\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\t' + Pf() + '\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb;\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t', blending: A, depthTest: !1, depthWrite: !1, }) } function Rf() { return '\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t' } function Pf() { return '\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include \n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t' } function Df(e, t, n, r, i, o, a) { return ( console.warn( 'THREE.Face4 has been removed. A THREE.Face3 will be created instead.', ), new Ri(e, t, n, i, o, a) ) } var Of = 0, If = 1, Bf = 0, Ff = 1, kf = 2 function Nf(e) { return ( console.warn( 'THREE.MeshFaceMaterial has been removed. Use an Array instead.', ), e ) } function Uf(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 Hf(e, t) { return ( console.warn('THREE.PointCloud has been renamed to THREE.Points.'), new gc(e, t) ) } function Gf(e) { return ( console.warn('THREE.Particle has been renamed to THREE.Sprite.'), new Bl(e) ) } function zf(e, t) { return ( console.warn('THREE.ParticleSystem has been renamed to THREE.Points.'), new gc(e, t) ) } function jf(e) { return ( console.warn( 'THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.', ), new dc(e) ) } function Vf(e) { return ( console.warn( 'THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.', ), new dc(e) ) } function Wf(e) { return ( console.warn( 'THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.', ), new dc(e) ) } function qf(e, t, n) { return ( console.warn('THREE.Vertex has been removed. Use THREE.Vector3 instead.'), new lr(e, t, n) ) } function Xf(e, t) { return ( console.warn( 'THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead.', ), new Fi(e, t).setUsage(Sn) ) } function Yf(e, t) { return ( console.warn( 'THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead.', ), new ki(e, t) ) } function Qf(e, t) { return ( console.warn( 'THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead.', ), new Ni(e, t) ) } function Zf(e, t) { return ( console.warn( 'THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead.', ), new Ui(e, t) ) } function Kf(e, t) { return ( console.warn( 'THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead.', ), new Hi(e, t) ) } function Jf(e, t) { return ( console.warn( 'THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead.', ), new Gi(e, t) ) } function $f(e, t) { return ( console.warn( 'THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead.', ), new zi(e, t) ) } function em(e, t) { return ( console.warn( 'THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead.', ), new ji(e, t) ) } function tm(e, t) { return ( console.warn( 'THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead.', ), new Wi(e, t) ) } function nm(e, t) { return ( console.warn( 'THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead.', ), new qi(e, t) ) } function rm(e) { console.warn( 'THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.', ), _h.call(this, e), (this.type = 'catmullrom'), (this.closed = !0) } function im(e) { console.warn( 'THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.', ), _h.call(this, e), (this.type = 'catmullrom') } function om(e) { console.warn( 'THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead.', ), _h.call(this, e), (this.type = 'catmullrom') } function am(e) { return ( console.warn('THREE.AxisHelper has been renamed to THREE.AxesHelper.'), new Kp(e) ) } function sm(e, t) { return ( console.warn( 'THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead.', ), new qp(e, t) ) } function lm(e, t) { return ( console.warn( 'THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead.', ), new uc(new Dc(e.geometry), new tc({ color: void 0 !== t ? t : 16777215 })) ) } function cm(e, t) { return ( console.warn( 'THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead.', ), new uc(new Ru(e.geometry), new tc({ color: void 0 !== t ? t : 16777215 })) ) } function um(e) { return ( console.warn('THREE.XHRLoader has been renamed to THREE.FileLoader.'), new uh(e) ) } function hm(e) { return ( console.warn( 'THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader.', ), new mh(e) ) } function dm(e, t, n) { return ( console.warn( 'THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options ).', ), new No(e, n) ) } ;(gh.create = function (e, t) { return ( console.log('THREE.Curve.create() has been deprecated'), (e.prototype = Object.create(gh.prototype)), (e.prototype.constructor = e), (e.prototype.getPoint = t), e ) }), Object.assign(Wh.prototype, { fromPoints: function (e) { return ( console.warn( 'THREE.Path: .fromPoints() has been renamed to .setFromPoints().', ), this.setFromPoints(e) ) }, }), (rm.prototype = Object.create(_h.prototype)), (im.prototype = Object.create(_h.prototype)), (om.prototype = Object.create(_h.prototype)), Object.assign(om.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.', ) }, }), (Dp.prototype.setColors = function () { console.error( 'THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.', ) }), (_p.prototype.update = function () { console.error( 'THREE.SkeletonHelper: update() no longer needs to be called.', ) }), Object.assign(lh.prototype, { extractUrlBase: function (e) { return ( console.warn( 'THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead.', ), ld.extractUrlBase(e) ) }, }), (lh.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(mp.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(hr.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) ) }, }), Object.assign(Sr.prototype, { empty: function () { return ( console.warn('THREE.Sphere: .empty() has been renamed to .isEmpty().'), this.isEmpty() ) }, }), (zo.prototype.setFromMatrix = function (e) { return ( console.warn( 'THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix().', ), this.setFromProjectionMatrix(e) ) }), (yp.prototype.center = function (e) { return ( console.warn('THREE.Line3: .center() has been renamed to .getCenter().'), this.getCenter(e) ) }), Object.assign(Kn, { 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().', ), Kn.floorPowerOfTwo(e) ) }, nextPowerOfTwo: function (e) { return ( console.warn( 'THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo().', ), Kn.ceilPowerOfTwo(e) ) }, }), Object.assign($n.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.') }, getInverse: function (e) { return ( console.warn( 'THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead.', ), this.copy(e).invert() ) }, }), Object.assign(Fr.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 lr().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, r, i, o) { return ( console.warn( 'THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead.', ), this.makePerspective(e, t, r, n, i, o) ) }, getInverse: function (e) { return ( console.warn( 'THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead.', ), this.copy(e).invert() ) }, }), (hi.prototype.isIntersectionLine = function (e) { return ( console.warn( 'THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine().', ), this.intersectsLine(e) ) }), Object.assign(sr.prototype, { multiplyVector3: function (e) { return ( console.warn( 'THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.', ), e.applyQuaternion(this) ) }, inverse: function () { return ( console.warn( 'THREE.Quaternion: .inverse() has been renamed to invert().', ), this.invert() ) }, }), Object.assign(Br.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(xi.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(xi, { barycoordFromPoint: function (e, t, n, r, i) { return ( console.warn( 'THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().', ), xi.getBarycoord(e, t, n, r, i) ) }, normal: function (e, t, n, r) { return ( console.warn( 'THREE.Triangle: .normal() has been renamed to .getNormal().', ), xi.getNormal(e, t, n, r) ) }, }), Object.assign(qh.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 fu(this, e) ) }, makeGeometry: function (e) { return ( console.warn( 'THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead.', ), new xu(this, e) ) }, }), Object.assign(Jn.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(lr.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(ir.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(si.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(si.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(xo.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(xo.prototype, { drawMode: { get: function () { return ( console.error( 'THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode.', ), Yt ) }, 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(Ul.prototype, { objects: { get: function () { return ( console.warn('THREE.LOD: .objects has been renamed to .levels.'), this.levels ) }, }, }), Object.defineProperty(Ql.prototype, 'useVertexTexture', { get: function () { console.warn('THREE.Skeleton: useVertexTexture has been removed.') }, set: function () { console.warn('THREE.Skeleton: useVertexTexture has been removed.') }, }), (Wl.prototype.initBones = function () { console.error('THREE.SkinnedMesh: initBones() has been removed.') }), Object.defineProperty(gh.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) }, }), (Oo.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(Xh.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(Fi.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 === Sn ) }, set: function () { console.warn( 'THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead.', ), this.setUsage(Sn) }, }, }), Object.assign(Fi.prototype, { setDynamic: function (e) { return ( console.warn( 'THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead.', ), this.setUsage(!0 === e ? Sn : Tn), 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(ro.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 Fi(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() }, 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(ro.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(cd.prototype, { maxInstancedCount: { get: function () { return ( console.warn( 'THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount.', ), this.instanceCount ) }, set: function (e) { console.warn( 'THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount.', ), (this.instanceCount = e) }, }, }), Object.defineProperties(cp.prototype, { linePrecision: { get: function () { return ( console.warn( 'THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead.', ), this.params.Line.threshold ) }, set: function (e) { console.warn( 'THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead.', ), (this.params.Line.threshold = e) }, }, }), Object.defineProperties(yl.prototype, { dynamic: { get: function () { return ( console.warn( 'THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead.', ), this.usage === Sn ) }, set: function (e) { console.warn( 'THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead.', ), this.setUsage(e) }, }, }), Object.assign(yl.prototype, { setDynamic: function (e) { return ( console.warn( 'THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead.', ), this.setUsage(!0 === e ? Sn : Tn), this ) }, setArray: function () { console.error( 'THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers', ) }, }), Object.assign(fu.prototype, { getArrays: function () { console.error('THREE.ExtrudeGeometry: .getArrays() has been removed.') }, addShapeList: function () { console.error('THREE.ExtrudeGeometry: .addShapeList() has been removed.') }, addShape: function () { console.error('THREE.ExtrudeGeometry: .addShape() has been removed.') }, }), Object.assign(gl.prototype, { dispose: function () { console.error('THREE.Scene: .dispose() has been removed.') }, }), Object.defineProperties(ap.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(Di.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 Li() ) }, }, 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 = e === y) }, }, 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(Fu.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(Bu.prototype, { transparency: { get: function () { return ( console.warn( 'THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission.', ), this.transmission ) }, set: function (e) { console.warn( 'THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission.', ), (this.transmission = e) }, }, }), Object.defineProperties(Po.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(pl.prototype, { clearTarget: function (e, t, n, r) { console.warn( 'THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead.', ), this.setRenderTarget(e), this.clear(t, n, r) }, 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(pl.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 ? Jt : Kt) }, }, toneMappingWhitePoint: { get: function () { return ( console.warn( 'THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.', ), 1 ) }, set: function () { console.warn( 'THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.', ) }, }, }), Object.defineProperties($s.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(or.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(kd.prototype, { load: { value: function (e) { console.warn( 'THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.', ) var t = this return ( new Md().load(e, function (e) { t.setBuffer(e) }), this ) }, }, startTime: { set: function () { console.warn('THREE.Audio: .startTime is now .play( delay ).') }, }, }), (jd.prototype.getData = function () { return ( console.warn( 'THREE.AudioAnalyser: .getData() is now .getFrequencyData().', ), this.getFrequencyData() ) }), (Fo.prototype.updateCubeMap = function (e, t) { return ( console.warn('THREE.CubeCamera: .updateCubeMap() is now .update().'), this.update(e, t) ) }), (Fo.prototype.clear = function (e, t, n, r) { return ( console.warn('THREE.CubeCamera: .clear() is now .renderTarget.clear().'), this.renderTarget.clear(e, t, n, r) ) }) var pm = { merge: function (e, t, n) { var r console.warn( 'THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.', ), t.isMesh && (t.matrixAutoUpdate && t.updateMatrix(), (r = t.matrix), (t = t.geometry)), e.merge(t, r, n) }, center: function (e) { return ( console.warn( 'THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.', ), e.center() ) }, } function fm() { console.error('THREE.CanvasRenderer has been removed') } function mm() { console.error('THREE.JSONLoader has been removed.') } ;(er.crossOrigin = void 0), (er.loadTexture = function (e, t, n, r) { console.warn( 'THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.', ) var i = new vh() i.setCrossOrigin(this.crossOrigin) var o = i.load(e, n, void 0, r) return t && (o.mapping = t), o }), (er.loadTextureCube = function (e, t, n, r) { console.warn( 'THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.', ) var i = new fh() i.setCrossOrigin(this.crossOrigin) var o = i.load(e, n, void 0, r) return t && (o.mapping = t), o }), (er.loadCompressedTexture = function () { console.error( 'THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.', ) }), (er.loadCompressedTextureCube = function () { console.error( 'THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.', ) }) var vm = { createMultiMaterialObject: function () { console.error( 'THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js', ) }, detach: function () { console.error( 'THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js', ) }, attach: function () { console.error( 'THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js', ) }, } function gm() { console.error( 'THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js', ) } 'undefined' !== typeof __THREE_DEVTOOLS__ && __THREE_DEVTOOLS__.dispatchEvent( new CustomEvent('register', { detail: { revision: i } }), ), 'undefined' !== typeof window && (window.__THREE__ ? console.warn('WARNING: Multiple instances of Three.js being imported.') : (window.__THREE__ = i)), (t.ACESFilmicToneMapping = re), (t.AddEquation = T), (t.AddOperation = J), (t.AdditiveAnimationBlendMode = Xt), (t.AdditiveBlending = x), (t.AlphaFormat = ke), (t.AlwaysDepth = j), (t.AlwaysStencilFunc = _n), (t.AmbientLight = rd), (t.AmbientLightProbe = Td), (t.AnimationClip = nh), (t.AnimationLoader = hh), (t.AnimationMixer = op), (t.AnimationObjectGroup = rp), (t.AnimationUtils = ju), (t.ArcCurve = bh), (t.ArrayCamera = il), (t.ArrowHelper = Zp), (t.Audio = kd), (t.AudioAnalyser = jd), (t.AudioContext = Ed), (t.AudioListener = Fd), (t.AudioLoader = Md), (t.AxesHelper = Kp), (t.AxisHelper = am), (t.BackSide = v), (t.BasicDepthPacking = an), (t.BasicShadowMap = h), (t.BinaryTextureLoader = hm), (t.Bone = ql), (t.BooleanKeyframeTrack = Qu), (t.BoundingBoxHelper = sm), (t.Box2 = mp), (t.Box3 = hr), (t.Box3Helper = Xp), (t.BoxBufferGeometry = _o), (t.BoxGeometry = _o), (t.BoxHelper = qp), (t.BufferAttribute = Fi), (t.BufferGeometry = ro), (t.BufferGeometryLoader = hd), (t.ByteType = Te), (t.Cache = oh), (t.Camera = Do), (t.CameraHelper = Hp), (t.CanvasRenderer = fm), (t.CanvasTexture = wc), (t.CatmullRomCurve3 = _h), (t.CineonToneMapping = ne), (t.CircleBufferGeometry = Ec), (t.CircleGeometry = Ec), (t.ClampToEdgeWrapping = pe), (t.Clock = Rd), (t.ClosedSplineCurve3 = rm), (t.Color = Li), (t.ColorKeyframeTrack = Zu), (t.CompressedTexture = Ac), (t.CompressedTextureLoader = dh), (t.ConeBufferGeometry = _c), (t.ConeGeometry = _c), (t.CubeCamera = Fo), (t.CubeReflectionMapping = ae), (t.CubeRefractionMapping = se), (t.CubeTexture = ko), (t.CubeTextureLoader = fh), (t.CubeUVReflectionMapping = ue), (t.CubeUVRefractionMapping = he), (t.CubicBezierCurve = Fh), (t.CubicBezierCurve3 = kh), (t.CubicInterpolant = Wu), (t.CullFaceBack = l), (t.CullFaceFront = c), (t.CullFaceFrontBack = u), (t.CullFaceNone = s), (t.Curve = gh), (t.CurvePath = Vh), (t.CustomBlending = _), (t.CustomToneMapping = ie), (t.CylinderBufferGeometry = Mc), (t.CylinderGeometry = Mc), (t.Cylindrical = pp), (t.DataTexture = Uo), (t.DataTexture2DArray = ca), (t.DataTexture3D = ua), (t.DataTextureLoader = mh), (t.DataUtils = ef), (t.DecrementStencilOp = fn), (t.DecrementWrapStencilOp = vn), (t.DefaultLoadingManager = sh), (t.DepthFormat = je), (t.DepthStencilFormat = Ve), (t.DepthTexture = xc), (t.DirectionalLight = nd), (t.DirectionalLightHelper = kp), (t.DiscreteInterpolant = Xu), (t.DodecahedronBufferGeometry = Sc), (t.DodecahedronGeometry = Sc), (t.DoubleSide = g), (t.DstAlphaFactor = k), (t.DstColorFactor = U), (t.DynamicBufferAttribute = Xf), (t.DynamicCopyUsage = On), (t.DynamicDrawUsage = Sn), (t.DynamicReadUsage = Rn), (t.EdgesGeometry = Dc), (t.EdgesHelper = lm), (t.EllipseCurve = yh), (t.EqualDepth = q), (t.EqualStencilFunc = An), (t.EquirectangularReflectionMapping = le), (t.EquirectangularRefractionMapping = ce), (t.Euler = Vr), (t.EventDispatcher = qn), (t.ExtrudeBufferGeometry = fu), (t.ExtrudeGeometry = fu), (t.Face3 = Ri), (t.Face4 = Df), (t.FaceColors = Ff), (t.FileLoader = uh), (t.FlatShading = y), (t.Float16BufferAttribute = Vi), (t.Float32Attribute = tm), (t.Float32BufferAttribute = Wi), (t.Float64Attribute = nm), (t.Float64BufferAttribute = qi), (t.FloatType = Pe), (t.Fog = vl), (t.FogExp2 = ml), (t.Font = bd), (t.FontLoader = xd), (t.FrontSide = m), (t.Frustum = zo), (t.GLBufferAttribute = lp), (t.GLSL1 = Bn), (t.GLSL3 = Fn), (t.GammaEncoding = $t), (t.GeometryUtils = pm), (t.GreaterDepth = Y), (t.GreaterEqualDepth = X), (t.GreaterEqualStencilFunc = Mn), (t.GreaterStencilFunc = xn), (t.GridHelper = Dp), (t.Group = rl), (t.HalfFloatType = De), (t.HemisphereLight = Yh), (t.HemisphereLightHelper = Pp), (t.HemisphereLightProbe = _d), (t.IcosahedronBufferGeometry = gu), (t.IcosahedronGeometry = gu), (t.ImageBitmapLoader = vd), (t.ImageLoader = ph), (t.ImageUtils = er), (t.ImmediateRenderObject = bp), (t.IncrementStencilOp = pn), (t.IncrementWrapStencilOp = mn), (t.InstancedBufferAttribute = ud), (t.InstancedBufferGeometry = cd), (t.InstancedInterleavedBuffer = sp), (t.InstancedMesh = ec), (t.Int16Attribute = Kf), (t.Int16BufferAttribute = Hi), (t.Int32Attribute = $f), (t.Int32BufferAttribute = zi), (t.Int8Attribute = Yf), (t.Int8BufferAttribute = ki), (t.IntType = Le), (t.InterleavedBuffer = yl), (t.InterleavedBufferAttribute = wl), (t.Interpolant = Vu), (t.InterpolateDiscrete = Ht), (t.InterpolateLinear = Gt), (t.InterpolateSmooth = zt), (t.InvertStencilOp = gn), (t.JSONLoader = mm), (t.KeepStencilOp = hn), (t.KeyframeTrack = Yu), (t.LOD = Ul), (t.LatheBufferGeometry = yu), (t.LatheGeometry = yu), (t.Layers = Xr), (t.LensFlare = gm), (t.LessDepth = V), (t.LessEqualDepth = W), (t.LessEqualStencilFunc = wn), (t.LessStencilFunc = bn), (t.Light = Xh), (t.LightProbe = ad), (t.Line = sc), (t.Line3 = yp), (t.LineBasicMaterial = tc), (t.LineCurve = Nh), (t.LineCurve3 = Uh), (t.LineDashedMaterial = Gu), (t.LineLoop = hc), (t.LinePieces = If), (t.LineSegments = uc), (t.LineStrip = Of), (t.LinearEncoding = Kt), (t.LinearFilter = Ae), (t.LinearInterpolant = qu), (t.LinearMipMapLinearFilter = Me), (t.LinearMipMapNearestFilter = xe), (t.LinearMipmapLinearFilter = Ee), (t.LinearMipmapNearestFilter = we), (t.LinearToneMapping = ee), (t.Loader = lh), (t.LoaderUtils = ld), (t.LoadingManager = ah), (t.LogLuvEncoding = tn), (t.LoopOnce = kt), (t.LoopPingPong = Ut), (t.LoopRepeat = Nt), (t.LuminanceAlphaFormat = Ge), (t.LuminanceFormat = He), (t.MOUSE = o), (t.Material = Di), (t.MaterialLoader = sd), (t.Math = Kn), (t.MathUtils = Kn), (t.Matrix3 = $n), (t.Matrix4 = Fr), (t.MaxEquation = R), (t.Mesh = xo), (t.MeshBasicMaterial = Oi), (t.MeshDepthMaterial = Qs), (t.MeshDistanceMaterial = Zs), (t.MeshFaceMaterial = Nf), (t.MeshLambertMaterial = Uu), (t.MeshMatcapMaterial = Hu), (t.MeshNormalMaterial = Nu), (t.MeshPhongMaterial = Fu), (t.MeshPhysicalMaterial = Bu), (t.MeshStandardMaterial = Iu), (t.MeshToonMaterial = ku), (t.MinEquation = L), (t.MirroredRepeatWrapping = fe), (t.MixOperation = K), (t.MultiMaterial = Uf), (t.MultiplyBlending = M), (t.MultiplyOperation = Z), (t.NearestFilter = me), (t.NearestMipMapLinearFilter = be), (t.NearestMipMapNearestFilter = ge), (t.NearestMipmapLinearFilter = ye), (t.NearestMipmapNearestFilter = ve), (t.NeverDepth = z), (t.NeverStencilFunc = yn), (t.NoBlending = A), (t.NoColors = Bf), (t.NoToneMapping = $), (t.NormalAnimationBlendMode = qt), (t.NormalBlending = w), (t.NotEqualDepth = Q), (t.NotEqualStencilFunc = En), (t.NumberKeyframeTrack = Ku), (t.Object3D = si), (t.ObjectLoader = dd), (t.ObjectSpaceNormalMap = cn), (t.OctahedronBufferGeometry = bu), (t.OctahedronGeometry = bu), (t.OneFactor = D), (t.OneMinusDstAlphaFactor = N), (t.OneMinusDstColorFactor = H), (t.OneMinusSrcAlphaFactor = F), (t.OneMinusSrcColorFactor = I), (t.OrthographicCamera = ed), (t.PCFShadowMap = d), (t.PCFSoftShadowMap = p), (t.PMREMGenerator = xf), (t.ParametricBufferGeometry = Au), (t.ParametricGeometry = Au), (t.Particle = Gf), (t.ParticleBasicMaterial = Vf), (t.ParticleSystem = zf), (t.ParticleSystemMaterial = Wf), (t.Path = Wh), (t.PerspectiveCamera = Oo), (t.Plane = hi), (t.PlaneBufferGeometry = Wo), (t.PlaneGeometry = Wo), (t.PlaneHelper = Yp), (t.PointCloud = Hf), (t.PointCloudMaterial = jf), (t.PointLight = $h), (t.PointLightHelper = Sp), (t.Points = gc), (t.PointsMaterial = dc), (t.PolarGridHelper = Op), (t.PolyhedronBufferGeometry = Tc), (t.PolyhedronGeometry = Tc), (t.PositionalAudio = zd), (t.PropertyBinding = np), (t.PropertyMixer = Vd), (t.QuadraticBezierCurve = Hh), (t.QuadraticBezierCurve3 = Gh), (t.Quaternion = sr), (t.QuaternionKeyframeTrack = $u), (t.QuaternionLinearInterpolant = Ju), (t.REVISION = i), (t.RGBADepthPacking = sn), (t.RGBAFormat = Ue), (t.RGBAIntegerFormat = Ze), (t.RGBA_ASTC_10x10_Format = bt), (t.RGBA_ASTC_10x5_Format = vt), (t.RGBA_ASTC_10x6_Format = gt), (t.RGBA_ASTC_10x8_Format = yt), (t.RGBA_ASTC_12x10_Format = At), (t.RGBA_ASTC_12x12_Format = wt), (t.RGBA_ASTC_4x4_Format = lt), (t.RGBA_ASTC_5x4_Format = ct), (t.RGBA_ASTC_5x5_Format = ut), (t.RGBA_ASTC_6x5_Format = ht), (t.RGBA_ASTC_6x6_Format = dt), (t.RGBA_ASTC_8x5_Format = pt), (t.RGBA_ASTC_8x6_Format = ft), (t.RGBA_ASTC_8x8_Format = mt), (t.RGBA_BPTC_Format = xt), (t.RGBA_ETC2_EAC_Format = st), (t.RGBA_PVRTC_2BPPV1_Format = it), (t.RGBA_PVRTC_4BPPV1_Format = rt), (t.RGBA_S3TC_DXT1_Format = Je), (t.RGBA_S3TC_DXT3_Format = $e), (t.RGBA_S3TC_DXT5_Format = et), (t.RGBDEncoding = on), (t.RGBEEncoding = en), (t.RGBEFormat = ze), (t.RGBFormat = Ne), (t.RGBIntegerFormat = Qe), (t.RGBM16Encoding = rn), (t.RGBM7Encoding = nn), (t.RGB_ETC1_Format = ot), (t.RGB_ETC2_Format = at), (t.RGB_PVRTC_2BPPV1_Format = nt), (t.RGB_PVRTC_4BPPV1_Format = tt), (t.RGB_S3TC_DXT1_Format = Ke), (t.RGFormat = Xe), (t.RGIntegerFormat = Ye), (t.RawShaderMaterial = Ou), (t.Ray = Br), (t.Raycaster = cp), (t.RectAreaLight = id), (t.RedFormat = We), (t.RedIntegerFormat = qe), (t.ReinhardToneMapping = te), (t.RepeatWrapping = de), (t.ReplaceStencilOp = dn), (t.ReverseSubtractEquation = C), (t.RingBufferGeometry = wu), (t.RingGeometry = wu), (t.SRGB8_ALPHA8_ASTC_10x10_Format = It), (t.SRGB8_ALPHA8_ASTC_10x5_Format = Pt), (t.SRGB8_ALPHA8_ASTC_10x6_Format = Dt), (t.SRGB8_ALPHA8_ASTC_10x8_Format = Ot), (t.SRGB8_ALPHA8_ASTC_12x10_Format = Bt), (t.SRGB8_ALPHA8_ASTC_12x12_Format = Ft), (t.SRGB8_ALPHA8_ASTC_4x4_Format = Et), (t.SRGB8_ALPHA8_ASTC_5x4_Format = Mt), (t.SRGB8_ALPHA8_ASTC_5x5_Format = _t), (t.SRGB8_ALPHA8_ASTC_6x5_Format = Tt), (t.SRGB8_ALPHA8_ASTC_6x6_Format = St), (t.SRGB8_ALPHA8_ASTC_8x5_Format = Ct), (t.SRGB8_ALPHA8_ASTC_8x6_Format = Lt), (t.SRGB8_ALPHA8_ASTC_8x8_Format = Rt), (t.Scene = gl), (t.SceneUtils = vm), (t.ShaderChunk = qo), (t.ShaderLib = Yo), (t.ShaderMaterial = Po), (t.ShadowMaterial = Du), (t.Shape = qh), (t.ShapeBufferGeometry = xu), (t.ShapeGeometry = xu), (t.ShapePath = gd), (t.ShapeUtils = hu), (t.ShortType = Se), (t.Skeleton = Ql), (t.SkeletonHelper = _p), (t.SkinnedMesh = Wl), (t.SmoothShading = b), (t.Sphere = Sr), (t.SphereBufferGeometry = Mu), (t.SphereGeometry = Mu), (t.Spherical = dp), (t.SphericalHarmonics3 = od), (t.Spline = om), (t.SplineCurve = zh), (t.SplineCurve3 = im), (t.SpotLight = Kh), (t.SpotLightHelper = wp), (t.Sprite = Bl), (t.SpriteMaterial = xl), (t.SrcAlphaFactor = B), (t.SrcAlphaSaturateFactor = G), (t.SrcColorFactor = O), (t.StaticCopyUsage = Dn), (t.StaticDrawUsage = Tn), (t.StaticReadUsage = Ln), (t.StereoCamera = Ld), (t.StreamCopyUsage = In), (t.StreamDrawUsage = Cn), (t.StreamReadUsage = Pn), (t.StringKeyframeTrack = eh), (t.SubtractEquation = S), (t.SubtractiveBlending = E), (t.TOUCH = a), (t.TangentSpaceNormalMap = ln), (t.TetrahedronBufferGeometry = _u), (t.TetrahedronGeometry = _u), (t.TextBufferGeometry = Tu), (t.TextGeometry = Tu), (t.Texture = nr), (t.TextureLoader = vh), (t.TorusBufferGeometry = Su), (t.TorusGeometry = Su), (t.TorusKnotBufferGeometry = Cu), (t.TorusKnotGeometry = Cu), (t.Triangle = xi), (t.TriangleFanDrawMode = Zt), (t.TriangleStripDrawMode = Qt), (t.TrianglesDrawMode = Yt), (t.TubeBufferGeometry = Lu), (t.TubeGeometry = Lu), (t.UVMapping = oe), (t.Uint16Attribute = Jf), (t.Uint16BufferAttribute = Gi), (t.Uint32Attribute = em), (t.Uint32BufferAttribute = ji), (t.Uint8Attribute = Qf), (t.Uint8BufferAttribute = Ni), (t.Uint8ClampedAttribute = Zf), (t.Uint8ClampedBufferAttribute = Ui), (t.Uniform = ap), (t.UniformsLib = Xo), (t.UniformsUtils = Co), (t.UnsignedByteType = _e), (t.UnsignedInt248Type = Fe), (t.UnsignedIntType = Re), (t.UnsignedShort4444Type = Oe), (t.UnsignedShort5551Type = Ie), (t.UnsignedShort565Type = Be), (t.UnsignedShortType = Ce), (t.VSMShadowMap = f), (t.Vector2 = Jn), (t.Vector3 = lr), (t.Vector4 = ir), (t.VectorKeyframeTrack = th), (t.Vertex = qf), (t.VertexColors = kf), (t.VideoTexture = bc), (t.WebGL1Renderer = fl), (t.WebGLCubeRenderTarget = No), (t.WebGLMultisampleRenderTarget = ar), (t.WebGLRenderTarget = or), (t.WebGLRenderTargetCube = dm), (t.WebGLRenderer = pl), (t.WebGLUtils = nl), (t.WireframeGeometry = Ru), (t.WireframeHelper = cm), (t.WrapAroundEnding = Wt), (t.XHRLoader = um), (t.ZeroCurvatureEnding = jt), (t.ZeroFactor = P), (t.ZeroSlopeEnding = Vt), (t.ZeroStencilOp = un), (t.sRGBEncoding = Jt), Object.defineProperty(t, '__esModule', { value: !0 }) }), 'object' === typeof i && 'undefined' !== typeof r ? a(i) : 'function' === typeof t && t.amd ? t(['exports'], a) : a( ((o = 'undefined' !== typeof globalThis ? globalThis : o || self).THREE = {}), ) }, {}, ], 58: [ function (e, t, n) { ;(THREE.DRACOLoader = function (e) { THREE.Loader.call(this, e), (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 (e) { return (this.decoderPath = e), this }, setDecoderConfig: function (e) { return (this.decoderConfig = e), this }, setWorkerLimit: function (e) { return (this.workerLimit = e), this }, setVerbosity: function () { console.warn( 'THREE.DRACOLoader: The .setVerbosity() method has been removed.', ) }, setDrawMode: function () { console.warn( 'THREE.DRACOLoader: The .setDrawMode() method has been removed.', ) }, setSkipDequantization: function () { console.warn( 'THREE.DRACOLoader: The .setSkipDequantization() method has been removed.', ) }, load: function (e, t, n, r) { var i = new THREE.FileLoader(this.manager) i.setPath(this.path), i.setResponseType('arraybuffer'), i.setRequestHeader(this.requestHeader), i.setWithCredentials(this.withCredentials), i.load( e, (e) => { var n = { attributeIDs: this.defaultAttributeIDs, attributeTypes: this.defaultAttributeTypes, useUniqueIDs: !1, } this.decodeGeometry(e, n).then(t).catch(r) }, n, r, ) }, decodeDracoFile: function (e, t, n, r) { var i = { attributeIDs: n || this.defaultAttributeIDs, attributeTypes: r || this.defaultAttributeTypes, useUniqueIDs: !!n, } this.decodeGeometry(e, i).then(t) }, decodeGeometry: function (e, t) { for (var n in t.attributeTypes) { var r = t.attributeTypes[n] void 0 !== r.BYTES_PER_ELEMENT && (t.attributeTypes[n] = r.name) } var i, o = JSON.stringify(t) if (THREE.DRACOLoader.taskCache.has(e)) { var a = THREE.DRACOLoader.taskCache.get(e) if (a.key === o) return a.promise if (0 === e.byteLength) throw new Error( 'THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.', ) } var s = this.workerNextTaskID++, l = e.byteLength, c = this._getWorker(s, l) .then( (n) => ( (i = n), new Promise((n, r) => { ;(i._callbacks[s] = { resolve: n, reject: r }), i.postMessage( { type: 'decode', id: s, taskConfig: t, buffer: e }, [e], ) }) ), ) .then((e) => this._createGeometry(e.geometry)) return ( c .catch(() => !0) .then(() => { i && s && this._releaseTask(i, s) }), THREE.DRACOLoader.taskCache.set(e, { key: o, promise: c }), c ) }, _createGeometry: function (e) { var t = new THREE.BufferGeometry() e.index && t.setIndex(new THREE.BufferAttribute(e.index.array, 1)) for (var n = 0; n < e.attributes.length; n++) { var r = e.attributes[n], i = r.name, o = r.array, a = r.itemSize t.setAttribute(i, new THREE.BufferAttribute(o, a)) } return t }, _loadLibrary: function (e, t) { var n = new THREE.FileLoader(this.manager) return ( n.setPath(this.decoderPath), n.setResponseType(t), n.setWithCredentials(this.withCredentials), new Promise((t, r) => { n.load(e, t, void 0, r) }) ) }, preload: function () { return this._initDecoder(), this }, _initDecoder: function () { if (this.decoderPending) return this.decoderPending var e = 'object' !== typeof WebAssembly || 'js' === this.decoderConfig.type, t = [] return ( e ? t.push(this._loadLibrary('draco_decoder.js', 'text')) : (t.push(this._loadLibrary('draco_wasm_wrapper.js', 'text')), t.push(this._loadLibrary('draco_decoder.wasm', 'arraybuffer'))), (this.decoderPending = Promise.all(t).then((t) => { var n = t[0] e || (this.decoderConfig.wasmBinary = t[1]) var r = THREE.DRACOLoader.DRACOWorker.toString(), i = [ '/* draco decoder */', n, '', '/* worker */', r.substring(r.indexOf('{') + 1, r.lastIndexOf('}')), ].join('\n') this.workerSourceURL = URL.createObjectURL(new Blob([i])) })), this.decoderPending ) }, _getWorker: function (e, t) { return this._initDecoder().then(() => { var n return ( this.workerPool.length < this.workerLimit ? (((n = new Worker(this.workerSourceURL))._callbacks = {}), (n._taskCosts = {}), (n._taskLoad = 0), n.postMessage({ type: 'init', decoderConfig: this.decoderConfig }), (n.onmessage = function (e) { var t = e.data switch (t.type) { case 'decode': n._callbacks[t.id].resolve(t) break case 'error': n._callbacks[t.id].reject(t) break default: console.error( 'THREE.DRACOLoader: Unexpected message, "' + t.type + '"', ) } }), this.workerPool.push(n)) : this.workerPool.sort(function (e, t) { return e._taskLoad > t._taskLoad ? -1 : 1 }), ((n = this.workerPool[this.workerPool.length - 1])._taskCosts[e] = t), (n._taskLoad += t), n ) }) }, _releaseTask: function (e, t) { ;(e._taskLoad -= e._taskCosts[t]), delete e._callbacks[t], delete e._taskCosts[t] }, debug: function () { console.log( 'Task load: ', this.workerPool.map((e) => e._taskLoad), ) }, dispose: function () { for (var e = 0; e < this.workerPool.length; ++e) this.workerPool[e].terminate() return (this.workerPool.length = 0), this }, }, )), (THREE.DRACOLoader.DRACOWorker = function () { var e, t function n(e, t, n, o) { var a, s, l = o.attributeIDs, c = o.attributeTypes, u = t.GetEncodedGeometryType(n) if (u === e.TRIANGULAR_MESH) (a = new e.Mesh()), (s = t.DecodeBufferToMesh(n, a)) else { if (u !== e.POINT_CLOUD) throw new Error('THREE.DRACOLoader: Unexpected geometry type.') ;(a = new e.PointCloud()), (s = t.DecodeBufferToPointCloud(n, a)) } if (!s.ok() || 0 === a.ptr) throw new Error('THREE.DRACOLoader: Decoding failed: ' + s.error_msg()) var h = { index: null, attributes: [] } for (var d in l) { var p, f, m = self[c[d]] if (o.useUniqueIDs) (f = l[d]), (p = t.GetAttributeByUniqueId(a, f)) else { if (-1 === (f = t.GetAttributeId(a, e[l[d]]))) continue p = t.GetAttribute(a, f) } h.attributes.push(i(e, t, a, d, m, p)) } return u === e.TRIANGULAR_MESH && (h.index = r(e, t, a)), e.destroy(a), h } function r(e, t, n) { var r = 3 * n.num_faces(), i = 4 * r, o = e._malloc(i) t.GetTrianglesUInt32Array(n, i, o) var a = new Uint32Array(e.HEAPF32.buffer, o, r).slice() return e._free(o), { array: a, itemSize: 1 } } function i(e, t, n, r, i, a) { var s = a.num_components(), l = n.num_points() * s, c = l * i.BYTES_PER_ELEMENT, u = o(e, i), h = e._malloc(c) t.GetAttributeDataArrayForAllPoints(n, a, u, c, h) var d = new i(e.HEAPF32.buffer, h, l).slice() return e._free(h), { name: r, array: d, itemSize: s } } function o(e, t) { switch (t) { case Float32Array: return e.DT_FLOAT32 case Int8Array: return e.DT_INT8 case Int16Array: return e.DT_INT16 case Int32Array: return e.DT_INT32 case Uint8Array: return e.DT_UINT8 case Uint16Array: return e.DT_UINT16 case Uint32Array: return e.DT_UINT32 } } onmessage = function (r) { var i = r.data switch (i.type) { case 'init': ;(e = i.decoderConfig), (t = new Promise(function (t) { ;(e.onModuleLoaded = function (e) { t({ draco: e }) }), DracoDecoderModule(e) })) break case 'decode': var o = i.buffer, a = i.taskConfig t.then((e) => { var t = e.draco, r = new t.Decoder(), s = new t.DecoderBuffer() s.Init(new Int8Array(o), o.byteLength) try { var l = n(t, r, s, a), c = l.attributes.map((e) => e.array.buffer) l.index && c.push(l.index.array.buffer), self.postMessage({ type: 'decode', id: i.id, geometry: l }, c) } catch (u) { console.error(u), self.postMessage({ type: 'error', id: i.id, error: u.message }) } finally { t.destroy(s), t.destroy(r) } }) } } }), (THREE.DRACOLoader.taskCache = new WeakMap()), (THREE.DRACOLoader.setDecoderPath = function () { console.warn( 'THREE.DRACOLoader: The .setDecoderPath() method has been removed. Use instance methods.', ) }), (THREE.DRACOLoader.setDecoderConfig = function () { console.warn( 'THREE.DRACOLoader: The .setDecoderConfig() method has been removed. Use instance methods.', ) }), (THREE.DRACOLoader.releaseDecoderModule = function () { console.warn( 'THREE.DRACOLoader: The .releaseDecoderModule() method has been removed. Use instance methods.', ) }), (THREE.DRACOLoader.getDecoderModule = function () { console.warn( 'THREE.DRACOLoader: The .getDecoderModule() method has been removed. Use instance methods.', ) }) }, {}, ], 59: [ function (t, n, r) { THREE.GLTFLoader = (function () { function t(e) { THREE.Loader.call(this, e), (this.dracoLoader = null), (this.ddsLoader = null), (this.ktx2Loader = null), (this.meshoptDecoder = null), (this.pluginCallbacks = []), this.register(function (e) { return new s(e) }), this.register(function (e) { return new c(e) }), this.register(function (e) { return new u(e) }), this.register(function (e) { return new l(e) }), this.register(function (e) { return new o(e) }), this.register(function (e) { return new h(e) }) } function n() { var e = {} return { get: function (t) { return e[t] }, add: function (t, n) { e[t] = n }, remove: function (t) { delete e[t] }, removeAll: function () { e = {} }, } } t.prototype = Object.assign(Object.create(THREE.Loader.prototype), { constructor: t, load: function (t, n, r, i) { var o, a = this ;(o = '' !== this.resourcePath ? this.resourcePath : '' !== this.path ? this.path : THREE.LoaderUtils.extractUrlBase(t)), this.manager.itemStart(t) var s = function (e) { i ? i(e) : console.error(e), a.manager.itemError(t), a.manager.itemEnd(t) }, l = new THREE.FileLoader(this.manager) l.setPath(this.path), l.setResponseType('arraybuffer'), l.setRequestHeader(this.requestHeader), l.setWithCredentials(this.withCredentials), l.load( t, function (r) { try { a.parse( r, o, function (e) { n(e), a.manager.itemEnd(t) }, s, ) } catch (e) { s(e) } }, r, s, ) }, setDRACOLoader: function (e) { return (this.dracoLoader = e), this }, setDDSLoader: function (e) { return (this.ddsLoader = e), this }, setKTX2Loader: function (e) { return (this.ktx2Loader = e), this }, setMeshoptDecoder: function (e) { return (this.meshoptDecoder = e), this }, register: function (e) { return ( -1 === this.pluginCallbacks.indexOf(e) && this.pluginCallbacks.push(e), this ) }, unregister: function (e) { return ( -1 !== this.pluginCallbacks.indexOf(e) && this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e), 1), this ) }, parse: function (e, t, n, o) { var s, l = {}, c = {} if ('string' === typeof e) s = e else if (THREE.LoaderUtils.decodeText(new Uint8Array(e, 0, 4)) === d) { try { l[r.KHR_BINARY_GLTF] = new m(e) } catch (x) { return void (o && o(x)) } s = l[r.KHR_BINARY_GLTF].content } else s = THREE.LoaderUtils.decodeText(new Uint8Array(e)) var u = JSON.parse(s) if (void 0 === u.asset || u.asset.version[0] < 2) o && o( new Error( 'THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.', ), ) else { var h = new U(u, { path: t || this.resourcePath || '', crossOrigin: this.crossOrigin, manager: this.manager, ktx2Loader: this.ktx2Loader, meshoptDecoder: this.meshoptDecoder, }) h.fileLoader.setRequestHeader(this.requestHeader) for (var p = 0; p < this.pluginCallbacks.length; p++) { var f = this.pluginCallbacks[p](h) ;(c[f.name] = f), (l[f.name] = !0) } if (u.extensionsUsed) for (p = 0; p < u.extensionsUsed.length; ++p) { var y = u.extensionsUsed[p], w = u.extensionsRequired || [] switch (y) { case r.KHR_MATERIALS_UNLIT: l[y] = new a() break case r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS: l[y] = new b() break case r.KHR_DRACO_MESH_COMPRESSION: l[y] = new v(u, this.dracoLoader) break case r.MSFT_TEXTURE_DDS: l[y] = new i(this.ddsLoader) break case r.KHR_TEXTURE_TRANSFORM: l[y] = new g() break case r.KHR_MESH_QUANTIZATION: l[y] = new A() break default: w.indexOf(y) >= 0 && void 0 === c[y] && console.warn('THREE.GLTFLoader: Unknown extension "' + y + '".') } } h.setExtensions(l), h.setPlugins(c), h.parse(n, o) } }, }) var r = { KHR_BINARY_GLTF: 'KHR_binary_glTF', KHR_DRACO_MESH_COMPRESSION: 'KHR_draco_mesh_compression', KHR_LIGHTS_PUNCTUAL: 'KHR_lights_punctual', KHR_MATERIALS_CLEARCOAT: 'KHR_materials_clearcoat', KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS: 'KHR_materials_pbrSpecularGlossiness', KHR_MATERIALS_TRANSMISSION: 'KHR_materials_transmission', KHR_MATERIALS_UNLIT: 'KHR_materials_unlit', KHR_TEXTURE_BASISU: 'KHR_texture_basisu', KHR_TEXTURE_TRANSFORM: 'KHR_texture_transform', KHR_MESH_QUANTIZATION: 'KHR_mesh_quantization', EXT_TEXTURE_WEBP: 'EXT_texture_webp', EXT_MESHOPT_COMPRESSION: 'EXT_meshopt_compression', MSFT_TEXTURE_DDS: 'MSFT_texture_dds', } function i(e) { if (!e) throw new Error( 'THREE.GLTFLoader: Attempting to load .dds texture without importing THREE.DDSLoader', ) ;(this.name = r.MSFT_TEXTURE_DDS), (this.ddsLoader = e) } function o(e) { ;(this.parser = e), (this.name = r.KHR_LIGHTS_PUNCTUAL), (this.cache = { refs: {}, uses: {} }) } function a() { this.name = r.KHR_MATERIALS_UNLIT } function s(e) { ;(this.parser = e), (this.name = r.KHR_MATERIALS_CLEARCOAT) } function l(e) { ;(this.parser = e), (this.name = r.KHR_MATERIALS_TRANSMISSION) } function c(e) { ;(this.parser = e), (this.name = r.KHR_TEXTURE_BASISU) } function u(e) { ;(this.parser = e), (this.name = r.EXT_TEXTURE_WEBP), (this.isSupported = null) } function h(e) { ;(this.name = r.EXT_MESHOPT_COMPRESSION), (this.parser = e) } ;(o.prototype._markDefs = function () { for ( var e = this.parser, t = this.parser.json.nodes || [], n = 0, r = t.length; n < r; n++ ) { var i = t[n] i.extensions && i.extensions[this.name] && void 0 !== i.extensions[this.name].light && e._addNodeRef(this.cache, i.extensions[this.name].light) } }), (o.prototype._loadLight = function (e) { var t = this.parser, n = 'light:' + e, r = t.cache.get(n) if (r) return r var i, o = t.json, a = (((o.extensions && o.extensions[this.name]) || {}).lights || [])[e], s = new THREE.Color(16777215) void 0 !== a.color && s.fromArray(a.color) var l = void 0 !== a.range ? a.range : 0 switch (a.type) { case 'directional': ;(i = new THREE.DirectionalLight(s)).target.position.set(0, 0, -1), i.add(i.target) break case 'point': ;(i = new THREE.PointLight(s)).distance = l break case 'spot': ;((i = new THREE.SpotLight(s)).distance = l), (a.spot = a.spot || {}), (a.spot.innerConeAngle = void 0 !== a.spot.innerConeAngle ? a.spot.innerConeAngle : 0), (a.spot.outerConeAngle = void 0 !== a.spot.outerConeAngle ? a.spot.outerConeAngle : Math.PI / 4), (i.angle = a.spot.outerConeAngle), (i.penumbra = 1 - a.spot.innerConeAngle / a.spot.outerConeAngle), i.target.position.set(0, 0, -1), i.add(i.target) break default: throw new Error('THREE.GLTFLoader: Unexpected light type: ' + a.type) } return ( i.position.set(0, 0, 0), (i.decay = 2), void 0 !== a.intensity && (i.intensity = a.intensity), (i.name = t.createUniqueName(a.name || 'light_' + e)), (r = Promise.resolve(i)), t.cache.add(n, r), r ) }), (o.prototype.createNodeAttachment = function (e) { var t = this, n = this.parser, r = n.json.nodes[e], i = ((r.extensions && r.extensions[this.name]) || {}).light return void 0 === i ? null : this._loadLight(i).then(function (e) { return n._getNodeRef(t.cache, i, e) }) }), (a.prototype.getMaterialType = function () { return THREE.MeshBasicMaterial }), (a.prototype.extendParams = function (e, t, n) { var r = [] ;(e.color = new THREE.Color(1, 1, 1)), (e.opacity = 1) var i = t.pbrMetallicRoughness if (i) { if (Array.isArray(i.baseColorFactor)) { var o = i.baseColorFactor e.color.fromArray(o), (e.opacity = o[3]) } void 0 !== i.baseColorTexture && r.push(n.assignTexture(e, 'map', i.baseColorTexture)) } return Promise.all(r) }), (s.prototype.getMaterialType = function (e) { var t = this.parser.json.materials[e] return t.extensions && t.extensions[this.name] ? THREE.MeshPhysicalMaterial : null }), (s.prototype.extendMaterialParams = function (e, t) { var n = this.parser, r = n.json.materials[e] if (!r.extensions || !r.extensions[this.name]) return Promise.resolve() var i = [], o = r.extensions[this.name] if ( (void 0 !== o.clearcoatFactor && (t.clearcoat = o.clearcoatFactor), void 0 !== o.clearcoatTexture && i.push(n.assignTexture(t, 'clearcoatMap', o.clearcoatTexture)), void 0 !== o.clearcoatRoughnessFactor && (t.clearcoatRoughness = o.clearcoatRoughnessFactor), void 0 !== o.clearcoatRoughnessTexture && i.push( n.assignTexture( t, 'clearcoatRoughnessMap', o.clearcoatRoughnessTexture, ), ), void 0 !== o.clearcoatNormalTexture && (i.push( n.assignTexture(t, 'clearcoatNormalMap', o.clearcoatNormalTexture), ), void 0 !== o.clearcoatNormalTexture.scale)) ) { var a = o.clearcoatNormalTexture.scale t.clearcoatNormalScale = new THREE.Vector2(a, -a) } return Promise.all(i) }), (l.prototype.getMaterialType = function (e) { var t = this.parser.json.materials[e] return t.extensions && t.extensions[this.name] ? THREE.MeshPhysicalMaterial : null }), (l.prototype.extendMaterialParams = function (e, t) { var n = this.parser, r = n.json.materials[e] if (!r.extensions || !r.extensions[this.name]) return Promise.resolve() var i = [], o = r.extensions[this.name] return ( void 0 !== o.transmissionFactor && (t.transmission = o.transmissionFactor), void 0 !== o.transmissionTexture && i.push(n.assignTexture(t, 'transmissionMap', o.transmissionTexture)), Promise.all(i) ) }), (c.prototype.loadTexture = function (e) { var t = this.parser, n = t.json, r = n.textures[e] if (!r.extensions || !r.extensions[this.name]) return null var i = r.extensions[this.name], o = n.images[i.source], a = t.options.ktx2Loader if (!a) { if (n.extensionsRequired && n.extensionsRequired.indexOf(this.name) >= 0) throw new Error( 'THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures', ) return null } return t.loadTextureImage(e, o, a) }), (u.prototype.loadTexture = function (e) { var t = this.name, n = this.parser, r = n.json, i = r.textures[e] if (!i.extensions || !i.extensions[t]) return null var o = i.extensions[t], a = r.images[o.source], s = a.uri ? n.options.manager.getHandler(a.uri) : n.textureLoader return this.detectSupport().then(function (i) { if (i) return n.loadTextureImage(e, a, s) if (r.extensionsRequired && r.extensionsRequired.indexOf(t) >= 0) throw new Error( 'THREE.GLTFLoader: WebP required by asset but unsupported.', ) return n.loadTexture(e) }) }), (u.prototype.detectSupport = function () { return ( this.isSupported || (this.isSupported = new Promise(function (e) { var t = new Image() ;(t.src = 'data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA'), (t.onload = t.onerror = function () { e(1 === t.height) }) })), this.isSupported ) }), (h.prototype.loadBufferView = function (e) { var t = this.parser.json, n = t.bufferViews[e] if (n.extensions && n.extensions[this.name]) { var r = n.extensions[this.name], i = this.parser.getDependency('buffer', r.buffer), o = this.parser.options.meshoptDecoder if (!o || !o.supported) { if (t.extensionsRequired && t.extensionsRequired.indexOf(this.name) >= 0) throw new Error( 'THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files', ) return null } return Promise.all([i, o.ready]).then(function (e) { var t = r.byteOffset || 0, n = r.byteLength || 0, i = r.count, a = r.byteStride, s = new ArrayBuffer(i * a), l = new Uint8Array(e[0], t, n) return o.decodeGltfBuffer(new Uint8Array(s), i, a, l, r.mode, r.filter), s }) } return null }) var d = 'glTF', p = 12, f = { JSON: 1313821514, BIN: 5130562 } function m(e) { ;(this.name = r.KHR_BINARY_GLTF), (this.content = null), (this.body = null) var t = new DataView(e, 0, p) 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 !== d) ) 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 n = this.header.length - p, i = new DataView(e, p), o = 0; o < n; ) { var a = i.getUint32(o, !0) o += 4 var s = i.getUint32(o, !0) if (((o += 4), s === f.JSON)) { var l = new Uint8Array(e, p + o, a) this.content = THREE.LoaderUtils.decodeText(l) } else if (s === f.BIN) { var c = p + o this.body = e.slice(c, c + a) } o += a } if (null === this.content) throw new Error('THREE.GLTFLoader: JSON content not found.') } function v(e, t) { if (!t) throw new Error('THREE.GLTFLoader: No DRACOLoader instance provided.') ;(this.name = r.KHR_DRACO_MESH_COMPRESSION), (this.json = e), (this.dracoLoader = t), this.dracoLoader.preload() } function g() { this.name = r.KHR_TEXTURE_TRANSFORM } function y(e) { THREE.MeshStandardMaterial.call(this), (this.isGLTFSpecularGlossinessMaterial = !0) var t = [ '#ifdef USE_SPECULARMAP', '\tuniform sampler2D specularMap;', '#endif', ].join('\n'), n = [ '#ifdef USE_GLOSSINESSMAP', '\tuniform sampler2D glossinessMap;', '#endif', ].join('\n'), r = [ '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'), i = [ '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'), o = [ 'PhysicalMaterial material;', 'material.diffuseColor = diffuseColor.rgb * ( 1. - max( specularFactor.r, max( specularFactor.g, specularFactor.b ) ) );', '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;', ].join('\n'), a = { specular: { value: new THREE.Color().setHex(16777215) }, glossiness: { value: 1 }, specularMap: { value: null }, glossinessMap: { value: null }, } ;(this._extraUniforms = a), (this.onBeforeCompile = function (e) { for (var s in a) e.uniforms[s] = a[s] e.fragmentShader = e.fragmentShader .replace('uniform float roughness;', 'uniform vec3 specular;') .replace('uniform float metalness;', 'uniform float glossiness;') .replace('#include ', t) .replace('#include ', n) .replace('#include ', r) .replace('#include ', i) .replace('#include ', o) }), Object.defineProperties(this, { specular: { get: function () { return a.specular.value }, set: function (e) { a.specular.value = e }, }, specularMap: { get: function () { return a.specularMap.value }, set: function (e) { ;(a.specularMap.value = e), e ? (this.defines.USE_SPECULARMAP = '') : delete this.defines.USE_SPECULARMAP }, }, glossiness: { get: function () { return a.glossiness.value }, set: function (e) { a.glossiness.value = e }, }, glossinessMap: { get: function () { return a.glossinessMap.value }, set: function (e) { ;(a.glossinessMap.value = e), e ? ((this.defines.USE_GLOSSINESSMAP = ''), (this.defines.USE_UV = '')) : (delete this.defines.USE_GLOSSINESSMAP, delete this.defines.USE_UV) }, }, }), delete this.metalness, delete this.roughness, delete this.metalnessMap, delete this.roughnessMap, this.setValues(e) } function b() { return { name: r.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 y }, extendParams: function (e, t, n) { var r = t.extensions[this.name] ;(e.color = new THREE.Color(1, 1, 1)), (e.opacity = 1) var i = [] if (Array.isArray(r.diffuseFactor)) { var o = r.diffuseFactor e.color.fromArray(o), (e.opacity = o[3]) } if ( (void 0 !== r.diffuseTexture && i.push(n.assignTexture(e, 'map', r.diffuseTexture)), (e.emissive = new THREE.Color(0, 0, 0)), (e.glossiness = void 0 !== r.glossinessFactor ? r.glossinessFactor : 1), (e.specular = new THREE.Color(1, 1, 1)), Array.isArray(r.specularFactor) && e.specular.fromArray(r.specularFactor), void 0 !== r.specularGlossinessTexture) ) { var a = r.specularGlossinessTexture i.push(n.assignTexture(e, 'glossinessMap', a)), i.push(n.assignTexture(e, 'specularMap', a)) } return Promise.all(i) }, createMaterial: function (e) { var t = new y(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 = 0.98), t ) }, } } function A() { this.name = r.KHR_MESH_QUANTIZATION } function w(e, t, n, r) { THREE.Interpolant.call(this, e, t, n, r) } ;(v.prototype.decodePrimitive = function (e, t) { var n = this.json, r = this.dracoLoader, i = e.extensions[this.name].bufferView, o = e.extensions[this.name].attributes, a = {}, s = {}, l = {} for (var c in o) { var u = S[c] || c.toLowerCase() a[u] = o[c] } for (c in e.attributes) if (((u = S[c] || c.toLowerCase()), void 0 !== o[c])) { var h = n.accessors[e.attributes[c]], d = E[h.componentType] ;(l[u] = d), (s[u] = !0 === h.normalized) } return t.getDependency('bufferView', i).then(function (e) { return new Promise(function (t) { r.decodeDracoFile( e, function (e) { for (var n in e.attributes) { var r = e.attributes[n], i = s[n] void 0 !== i && (r.normalized = i) } t(e) }, a, l, ) }) }) }), (g.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 ) }), (y.prototype = Object.create(THREE.MeshStandardMaterial.prototype)), (y.prototype.constructor = y), (y.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 ) }), (w.prototype = Object.create(THREE.Interpolant.prototype)), (w.prototype.constructor = w), (w.prototype.copySampleValue_ = function (e) { for ( var t = this.resultBuffer, n = this.sampleValues, r = this.valueSize, i = e * r * 3 + r, o = 0; o !== r; o++ ) t[o] = n[i + o] return t }), (w.prototype.beforeStart_ = w.prototype.copySampleValue_), (w.prototype.afterEnd_ = w.prototype.copySampleValue_), (w.prototype.interpolate_ = function (e, t, n, r) { for ( var i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = 2 * a, l = 3 * a, c = r - t, u = (n - t) / c, h = u * u, d = h * u, p = e * l, f = p - l, m = -2 * d + 3 * h, v = d - h, g = 1 - m, y = v - h + u, b = 0; b !== a; b++ ) { var A = o[f + b + a], w = o[f + b + s] * c, x = o[p + b + a], E = o[p + b] * c i[b] = g * A + y * w + m * x + v * E } return i }) 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, }, E = { 5120: Int8Array, 5121: Uint8Array, 5122: Int16Array, 5123: Uint16Array, 5125: Uint32Array, 5126: Float32Array, }, M = { 9728: THREE.NearestFilter, 9729: THREE.LinearFilter, 9984: THREE.NearestMipmapNearestFilter, 9985: THREE.LinearMipmapNearestFilter, 9986: THREE.NearestMipmapLinearFilter, 9987: THREE.LinearMipmapLinearFilter, }, _ = { 33071: THREE.ClampToEdgeWrapping, 33648: THREE.MirroredRepeatWrapping, 10497: THREE.RepeatWrapping, }, T = { SCALAR: 1, VEC2: 2, VEC3: 3, VEC4: 4, MAT2: 4, MAT3: 9, MAT4: 16 }, S = { POSITION: 'position', NORMAL: 'normal', TANGENT: 'tangent', TEXCOORD_0: 'uv', TEXCOORD_1: 'uv2', COLOR_0: 'color', WEIGHTS_0: 'skinWeight', JOINTS_0: 'skinIndex', }, C = { scale: 'scale', translation: 'position', rotation: 'quaternion', weights: 'morphTargetInfluences', }, L = { CUBICSPLINE: void 0, LINEAR: THREE.InterpolateLinear, STEP: THREE.InterpolateDiscrete, }, R = { OPAQUE: 'OPAQUE', MASK: 'MASK', BLEND: 'BLEND' } function P(e, t) { return 'string' !== typeof e || '' === e ? '' : (/^https?:\/\//i.test(t) && /^\//.test(e) && (t = t.replace(/(^https?:\/\/[^\/]+).*/i, '$1')), /^(https?:)?\/\//i.test(e) || /^data:.*,.*$/i.test(e) || /^blob:.*$/i.test(e) ? e : t + e) } function D(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 O(e, t, n) { for (var r in n.extensions) void 0 === e[r] && ((t.userData.gltfExtensions = t.userData.gltfExtensions || {}), (t.userData.gltfExtensions[r] = n.extensions[r])) } function I(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 B(e, t, n) { for ( var r = !1, i = !1, o = 0, a = t.length; o < a && (void 0 !== (c = t[o]).POSITION && (r = !0), void 0 !== c.NORMAL && (i = !0), !r || !i); o++ ); if (!r && !i) return Promise.resolve(e) var s = [], l = [] for (o = 0, a = t.length; o < a; o++) { var c = t[o] if (r) { var u = void 0 !== c.POSITION ? n.getDependency('accessor', c.POSITION) : e.attributes.position s.push(u) } i && ((u = void 0 !== c.NORMAL ? n.getDependency('accessor', c.NORMAL) : e.attributes.normal), l.push(u)) } return Promise.all([Promise.all(s), Promise.all(l)]).then(function (t) { var n = t[0], o = t[1] return ( r && (e.morphAttributes.position = n), i && (e.morphAttributes.normal = o), (e.morphTargetsRelative = !0), e ) }) } function F(e, t) { if ((e.updateMorphTargets(), void 0 !== t.weights)) for (var n = 0, r = t.weights.length; n < r; n++) e.morphTargetInfluences[n] = t.weights[n] if (t.extras && Array.isArray(t.extras.targetNames)) { var i = t.extras.targetNames if (e.morphTargetInfluences.length === i.length) for (e.morphTargetDictionary = {}, n = 0, r = i.length; n < r; n++) e.morphTargetDictionary[i[n]] = n else console.warn( 'THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.', ) } } function k(e) { var t = e.extensions && e.extensions[r.KHR_DRACO_MESH_COMPRESSION] return t ? 'draco:' + t.bufferView + ':' + t.indices + ':' + N(t.attributes) : e.indices + ':' + N(e.attributes) + ':' + e.mode } function N(e) { for (var t = '', n = Object.keys(e).sort(), r = 0, i = n.length; r < i; r++) t += n[r] + ':' + e[n[r]] + ';' return t } function U(e, t) { ;(this.json = e || {}), (this.extensions = {}), (this.plugins = {}), (this.options = t || {}), (this.cache = new n()), (this.associations = new Map()), (this.primitiveCache = {}), (this.meshCache = { refs: {}, uses: {} }), (this.cameraCache = { refs: {}, uses: {} }), (this.lightCache = { refs: {}, uses: {} }), (this.nodeNamesUsed = {}), 'undefined' !== typeof createImageBitmap && !1 === /Firefox/.test(navigator.userAgent) ? (this.textureLoader = new THREE.ImageBitmapLoader(this.options.manager)) : (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 H(e, t, n) { var r = t.attributes, i = new THREE.Box3() if (void 0 !== r.POSITION) { var o = (d = n.json.accessors[r.POSITION]).min, a = d.max if (void 0 !== o && void 0 !== a) { i.set( new THREE.Vector3(o[0], o[1], o[2]), new THREE.Vector3(a[0], a[1], a[2]), ) var s = t.targets if (void 0 !== s) { for ( var l = new THREE.Vector3(), c = new THREE.Vector3(), u = 0, h = s.length; u < h; u++ ) { var d, p = s[u] if (void 0 !== p.POSITION) (o = (d = n.json.accessors[p.POSITION]).min), (a = d.max), void 0 !== o && void 0 !== a ? (c.setX(Math.max(Math.abs(o[0]), Math.abs(a[0]))), c.setY(Math.max(Math.abs(o[1]), Math.abs(a[1]))), c.setZ(Math.max(Math.abs(o[2]), Math.abs(a[2]))), l.max(c)) : console.warn( 'THREE.GLTFLoader: Missing min/max properties for accessor POSITION.', ) } i.expandByVector(l) } e.boundingBox = i var f = new THREE.Sphere() i.getCenter(f.center), (f.radius = i.min.distanceTo(i.max) / 2), (e.boundingSphere = f) } else console.warn( 'THREE.GLTFLoader: Missing min/max properties for accessor POSITION.', ) } } function G(e, t, n) { var r = t.attributes, i = [] function o(t, r) { return n.getDependency('accessor', t).then(function (t) { e.setAttribute(r, t) }) } for (var a in r) { var s = S[a] || a.toLowerCase() s in e.attributes || i.push(o(r[a], s)) } if (void 0 !== t.indices && !e.index) { var l = n.getDependency('accessor', t.indices).then(function (t) { e.setIndex(t) }) i.push(l) } return ( I(e, t), H(e, t, n), Promise.all(i).then(function () { return void 0 !== t.targets ? B(e, t.targets, n) : e }) ) } function z(e, t) { var n = e.getIndex() if (null === n) { var r = [], i = e.getAttribute('position') if (void 0 === i) return ( console.error( 'THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible.', ), e ) for (var o = 0; o < i.count; o++) r.push(o) e.setIndex(r), (n = e.getIndex()) } var a = n.count - 2, s = [] if (t === THREE.TriangleFanDrawMode) for (o = 1; o <= a; o++) s.push(n.getX(0)), s.push(n.getX(o)), s.push(n.getX(o + 1)) else for (o = 0; o < a; o++) o % 2 === 0 ? (s.push(n.getX(o)), s.push(n.getX(o + 1)), s.push(n.getX(o + 2))) : (s.push(n.getX(o + 2)), s.push(n.getX(o + 1)), s.push(n.getX(o))) s.length / 3 !== a && console.error( 'THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.', ) var l = e.clone() return l.setIndex(s), l } return ( (U.prototype.setExtensions = function (e) { this.extensions = e }), (U.prototype.setPlugins = function (e) { this.plugins = e }), (U.prototype.parse = function (e, t) { var n = this, r = this.json, i = this.extensions this.cache.removeAll(), this._invokeAll(function (e) { return e._markDefs && e._markDefs() }), Promise.all([ this.getDependencies('scene'), this.getDependencies('animation'), this.getDependencies('camera'), ]) .then(function (t) { var o = { scene: t[0][r.scene || 0], scenes: t[0], animations: t[1], cameras: t[2], asset: r.asset, parser: n, userData: {}, } O(i, o, r), I(o, r), e(o) }) .catch(t) }), (U.prototype._markDefs = function () { for ( var e = this.json.nodes || [], t = this.json.skins || [], n = this.json.meshes || [], r = 0, i = t.length; r < i; r++ ) for (var o = t[r].joints, a = 0, s = o.length; a < s; a++) e[o[a]].isBone = !0 for (var l = 0, c = e.length; l < c; l++) { var u = e[l] void 0 !== u.mesh && (this._addNodeRef(this.meshCache, u.mesh), void 0 !== u.skin && (n[u.mesh].isSkinnedMesh = !0)), void 0 !== u.camera && this._addNodeRef(this.cameraCache, u.camera) } }), (U.prototype._addNodeRef = function (e, t) { void 0 !== t && (void 0 === e.refs[t] && (e.refs[t] = e.uses[t] = 0), e.refs[t]++) }), (U.prototype._getNodeRef = function (e, t, n) { if (e.refs[t] <= 1) return n var r = n.clone() return (r.name += '_instance_' + e.uses[t]++), r }), (U.prototype._invokeOne = function (e) { var t = Object.values(this.plugins) t.push(this) for (var n = 0; n < t.length; n++) { var r = e(t[n]) if (r) return r } }), (U.prototype._invokeAll = function (e) { var t = Object.values(this.plugins) t.unshift(this) for (var n = [], r = 0; r < t.length; r++) { var i = e(t[r]) i && n.push(i) } return n }), (U.prototype.getDependency = function (e, t) { var n = e + ':' + t, r = this.cache.get(n) if (!r) { switch (e) { case 'scene': r = this.loadScene(t) break case 'node': r = this.loadNode(t) break case 'mesh': r = this._invokeOne(function (e) { return e.loadMesh && e.loadMesh(t) }) break case 'accessor': r = this.loadAccessor(t) break case 'bufferView': r = this._invokeOne(function (e) { return e.loadBufferView && e.loadBufferView(t) }) break case 'buffer': r = this.loadBuffer(t) break case 'material': r = this._invokeOne(function (e) { return e.loadMaterial && e.loadMaterial(t) }) break case 'texture': r = this._invokeOne(function (e) { return e.loadTexture && e.loadTexture(t) }) break case 'skin': r = this.loadSkin(t) break case 'animation': r = this.loadAnimation(t) break case 'camera': r = this.loadCamera(t) break default: throw new Error('Unknown type: ' + e) } this.cache.add(n, r) } return r }), (U.prototype.getDependencies = function (e) { var t = this.cache.get(e) if (!t) { var n = this, r = this.json[e + ('mesh' === e ? 'es' : 's')] || [] ;(t = Promise.all( r.map(function (t, r) { return n.getDependency(e, r) }), )), this.cache.add(e, t) } return t }), (U.prototype.loadBuffer = function (e) { var t = this.json.buffers[e], n = 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[r.KHR_BINARY_GLTF].body) var i = this.options return new Promise(function (e, r) { n.load(P(t.uri, i.path), e, void 0, function () { r(new Error('THREE.GLTFLoader: Failed to load buffer "' + t.uri + '".')) }) }) }), (U.prototype.loadBufferView = function (e) { var t = this.json.bufferViews[e] return this.getDependency('buffer', t.buffer).then(function (e) { var n = t.byteLength || 0, r = t.byteOffset || 0 return e.slice(r, r + n) }) }), (U.prototype.loadAccessor = function (e) { var t = this, n = this.json, r = this.json.accessors[e] if (void 0 === r.bufferView && void 0 === r.sparse) return Promise.resolve(null) var i = [] return ( void 0 !== r.bufferView ? i.push(this.getDependency('bufferView', r.bufferView)) : i.push(null), void 0 !== r.sparse && (i.push(this.getDependency('bufferView', r.sparse.indices.bufferView)), i.push(this.getDependency('bufferView', r.sparse.values.bufferView))), Promise.all(i).then(function (e) { var i, o, a = e[0], s = T[r.type], l = E[r.componentType], c = l.BYTES_PER_ELEMENT, u = c * s, h = r.byteOffset || 0, d = void 0 !== r.bufferView ? n.bufferViews[r.bufferView].byteStride : void 0, p = !0 === r.normalized if (d && d !== u) { var f = Math.floor(h / d), m = 'InterleavedBuffer:' + r.bufferView + ':' + r.componentType + ':' + f + ':' + r.count, v = t.cache.get(m) v || ((i = new l(a, f * d, (r.count * d) / c)), (v = new THREE.InterleavedBuffer(i, d / c)), t.cache.add(m, v)), (o = new THREE.InterleavedBufferAttribute(v, s, (h % d) / c, p)) } else (i = null === a ? new l(r.count * s) : new l(a, h, r.count * s)), (o = new THREE.BufferAttribute(i, s, p)) if (void 0 !== r.sparse) { var g = T.SCALAR, y = E[r.sparse.indices.componentType], b = r.sparse.indices.byteOffset || 0, A = r.sparse.values.byteOffset || 0, w = new y(e[1], b, r.sparse.count * g), x = new l(e[2], A, r.sparse.count * s) null !== a && (o = new THREE.BufferAttribute( o.array.slice(), o.itemSize, o.normalized, )) for (var M = 0, _ = w.length; M < _; M++) { var S = w[M] if ( (o.setX(S, x[M * s]), s >= 2 && o.setY(S, x[M * s + 1]), s >= 3 && o.setZ(S, x[M * s + 2]), s >= 4 && o.setW(S, x[M * s + 3]), s >= 5) ) throw new Error( 'THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.', ) } } return o }) ) }), (U.prototype.loadTexture = function (e) { var t, n, i = this, o = this.json, a = this.options, s = o.textures[e], l = s.extensions || {} return ( (t = l[r.MSFT_TEXTURE_DDS] ? o.images[l[r.MSFT_TEXTURE_DDS].source] : o.images[s.source]).uri && (n = a.manager.getHandler(t.uri)), n || (n = l[r.MSFT_TEXTURE_DDS] ? i.extensions[r.MSFT_TEXTURE_DDS].ddsLoader : this.textureLoader), this.loadTextureImage(e, t, n) ) }), (U.prototype.loadTextureImage = function (e, t, n) { var r = this, i = this.json, o = this.options, a = i.textures[e], s = self.URL || self.webkitURL, l = t.uri, c = !1, u = !0 return ( 'image/jpeg' === t.mimeType && (u = !1), void 0 !== t.bufferView && (l = r.getDependency('bufferView', t.bufferView).then(function (e) { if ('image/png' === t.mimeType) { var n = new DataView(e, 25, 1).getUint8(0, !1) u = 6 === n || 4 === n || 3 === n } c = !0 var r = new Blob([e], { type: t.mimeType }) return (l = s.createObjectURL(r)) })), Promise.resolve(l) .then(function (e) { return new Promise(function (t, r) { var i = t !0 === n.isImageBitmapLoader && (i = function (e) { t(new THREE.CanvasTexture(e)) }), n.load(P(e, o.path), i, void 0, r) }) }) .then(function (t) { !0 === c && s.revokeObjectURL(l), (t.flipY = !1), a.name && (t.name = a.name), u || (t.format = THREE.RGBFormat) var n = (i.samplers || {})[a.sampler] || {} return ( (t.magFilter = M[n.magFilter] || THREE.LinearFilter), (t.minFilter = M[n.minFilter] || THREE.LinearMipmapLinearFilter), (t.wrapS = _[n.wrapS] || THREE.RepeatWrapping), (t.wrapT = _[n.wrapT] || THREE.RepeatWrapping), r.associations.set(t, { type: 'textures', index: e }), t ) }) ) }), (U.prototype.assignTexture = function (e, t, n) { var i = this return this.getDependency('texture', n.index).then(function (o) { if ( (void 0 === n.texCoord || 0 == n.texCoord || ('aoMap' === t && 1 == n.texCoord) || console.warn( 'THREE.GLTFLoader: Custom UV set ' + n.texCoord + ' for texture ' + t + ' not yet supported.', ), i.extensions[r.KHR_TEXTURE_TRANSFORM]) ) { var a = void 0 !== n.extensions ? n.extensions[r.KHR_TEXTURE_TRANSFORM] : void 0 if (a) { var s = i.associations.get(o) ;(o = i.extensions[r.KHR_TEXTURE_TRANSFORM].extendTexture(o, a)), i.associations.set(o, s) } } e[t] = o }) }), (U.prototype.assignFinalMaterial = function (e) { var t = e.geometry, n = e.material, r = void 0 !== t.attributes.tangent, i = void 0 !== t.attributes.color, o = void 0 === t.attributes.normal, a = !0 === e.isSkinnedMesh, s = Object.keys(t.morphAttributes).length > 0, l = s && void 0 !== t.morphAttributes.normal if (e.isPoints) { var c = 'PointsMaterial:' + n.uuid, u = this.cache.get(c) u || ((u = new THREE.PointsMaterial()), THREE.Material.prototype.copy.call(u, n), u.color.copy(n.color), (u.map = n.map), (u.sizeAttenuation = !1), this.cache.add(c, u)), (n = u) } else if (e.isLine) { c = 'LineBasicMaterial:' + n.uuid var h = this.cache.get(c) h || ((h = new THREE.LineBasicMaterial()), THREE.Material.prototype.copy.call(h, n), h.color.copy(n.color), this.cache.add(c, h)), (n = h) } if (r || i || o || a || s) { ;(c = 'ClonedMaterial:' + n.uuid + ':'), n.isGLTFSpecularGlossinessMaterial && (c += 'specular-glossiness:'), a && (c += 'skinning:'), r && (c += 'vertex-tangents:'), i && (c += 'vertex-colors:'), o && (c += 'flat-shading:'), s && (c += 'morph-targets:'), l && (c += 'morph-normals:') var d = this.cache.get(c) d || ((d = n.clone()), a && (d.skinning = !0), i && (d.vertexColors = !0), o && (d.flatShading = !0), s && (d.morphTargets = !0), l && (d.morphNormals = !0), r && ((d.vertexTangents = !0), n.normalScale && (n.normalScale.y *= -1), n.clearcoatNormalScale && (n.clearcoatNormalScale.y *= -1)), this.cache.add(c, d), this.associations.set(d, this.associations.get(n))), (n = d) } n.aoMap && void 0 === t.attributes.uv2 && void 0 !== t.attributes.uv && t.setAttribute('uv2', t.attributes.uv), (e.material = n) }), (U.prototype.getMaterialType = function () { return THREE.MeshStandardMaterial }), (U.prototype.loadMaterial = function (e) { var t, n = this, i = this.json, o = this.extensions, a = i.materials[e], s = {}, l = a.extensions || {}, c = [] if (l[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]) { var u = o[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS] ;(t = u.getMaterialType()), c.push(u.extendParams(s, a, n)) } else if (l[r.KHR_MATERIALS_UNLIT]) { var h = o[r.KHR_MATERIALS_UNLIT] ;(t = h.getMaterialType()), c.push(h.extendParams(s, a, n)) } else { var d = a.pbrMetallicRoughness || {} if ( ((s.color = new THREE.Color(1, 1, 1)), (s.opacity = 1), Array.isArray(d.baseColorFactor)) ) { var p = d.baseColorFactor s.color.fromArray(p), (s.opacity = p[3]) } void 0 !== d.baseColorTexture && c.push(n.assignTexture(s, 'map', d.baseColorTexture)), (s.metalness = void 0 !== d.metallicFactor ? d.metallicFactor : 1), (s.roughness = void 0 !== d.roughnessFactor ? d.roughnessFactor : 1), void 0 !== d.metallicRoughnessTexture && (c.push(n.assignTexture(s, 'metalnessMap', d.metallicRoughnessTexture)), c.push(n.assignTexture(s, 'roughnessMap', d.metallicRoughnessTexture))), (t = this._invokeOne(function (t) { return t.getMaterialType && t.getMaterialType(e) })), c.push( Promise.all( this._invokeAll(function (t) { return t.extendMaterialParams && t.extendMaterialParams(e, s) }), ), ) } !0 === a.doubleSided && (s.side = THREE.DoubleSide) var f = a.alphaMode || R.OPAQUE return ( f === R.BLEND ? ((s.transparent = !0), (s.depthWrite = !1)) : ((s.transparent = !1), f === R.MASK && (s.alphaTest = void 0 !== a.alphaCutoff ? a.alphaCutoff : 0.5)), void 0 !== a.normalTexture && t !== THREE.MeshBasicMaterial && (c.push(n.assignTexture(s, 'normalMap', a.normalTexture)), (s.normalScale = new THREE.Vector2(1, -1)), void 0 !== a.normalTexture.scale && s.normalScale.set(a.normalTexture.scale, -a.normalTexture.scale)), void 0 !== a.occlusionTexture && t !== THREE.MeshBasicMaterial && (c.push(n.assignTexture(s, 'aoMap', a.occlusionTexture)), void 0 !== a.occlusionTexture.strength && (s.aoMapIntensity = a.occlusionTexture.strength)), void 0 !== a.emissiveFactor && t !== THREE.MeshBasicMaterial && (s.emissive = new THREE.Color().fromArray(a.emissiveFactor)), void 0 !== a.emissiveTexture && t !== THREE.MeshBasicMaterial && c.push(n.assignTexture(s, 'emissiveMap', a.emissiveTexture)), Promise.all(c).then(function () { var i return ( (i = t === y ? o[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(s) : new t(s)), a.name && (i.name = a.name), i.map && (i.map.encoding = THREE.sRGBEncoding), i.emissiveMap && (i.emissiveMap.encoding = THREE.sRGBEncoding), I(i, a), n.associations.set(i, { type: 'materials', index: e }), a.extensions && O(o, i, a), i ) }) ) }), (U.prototype.createUniqueName = function (e) { for ( var t = THREE.PropertyBinding.sanitizeNodeName(e || ''), n = t, r = 1; this.nodeNamesUsed[n]; ++r ) n = t + '_' + r return (this.nodeNamesUsed[n] = !0), n }), (U.prototype.loadGeometries = function (e) { var t = this, n = this.extensions, i = this.primitiveCache function o(e) { return n[r.KHR_DRACO_MESH_COMPRESSION] .decodePrimitive(e, t) .then(function (n) { return G(n, e, t) }) } for (var a = [], s = 0, l = e.length; s < l; s++) { var c, u = e[s], h = k(u), d = i[h] d ? a.push(d.promise) : ((c = u.extensions && u.extensions[r.KHR_DRACO_MESH_COMPRESSION] ? o(u) : G(new THREE.BufferGeometry(), u, t)), (i[h] = { primitive: u, promise: c }), a.push(c)) } return Promise.all(a) }), (U.prototype.loadMesh = function (e) { for ( var t = this, n = this.json, r = this.extensions, i = n.meshes[e], o = i.primitives, a = [], s = 0, l = o.length; s < l; s++ ) { var c = void 0 === o[s].material ? D(this.cache) : this.getDependency('material', o[s].material) a.push(c) } return ( a.push(t.loadGeometries(o)), Promise.all(a).then(function (n) { for ( var a = n.slice(0, n.length - 1), s = n[n.length - 1], l = [], c = 0, u = s.length; c < u; c++ ) { var h, d = s[c], p = o[c], f = a[c] if ( p.mode === x.TRIANGLES || p.mode === x.TRIANGLE_STRIP || p.mode === x.TRIANGLE_FAN || void 0 === p.mode ) (h = !0 === i.isSkinnedMesh ? new THREE.SkinnedMesh(d, f) : new THREE.Mesh(d, f)), !0 === f.isMeshStandardMaterial && f.side === THREE.DoubleSide && null !== d.getIndex() && !0 === d.hasAttribute('position') && !0 === d.hasAttribute('normal') && !0 === d.hasAttribute('uv') && !1 === d.hasAttribute('tangent') && (d.computeTangents(), (f.vertexTangents = !0)), !0 !== h.isSkinnedMesh || h.geometry.attributes.skinWeight.normalized || h.normalizeSkinWeights(), p.mode === x.TRIANGLE_STRIP ? (h.geometry = z(h.geometry, THREE.TriangleStripDrawMode)) : p.mode === x.TRIANGLE_FAN && (h.geometry = z(h.geometry, THREE.TriangleFanDrawMode)) else if (p.mode === x.LINES) h = new THREE.LineSegments(d, f) else if (p.mode === x.LINE_STRIP) h = new THREE.Line(d, f) else if (p.mode === x.LINE_LOOP) h = new THREE.LineLoop(d, f) else { if (p.mode !== x.POINTS) throw new Error( 'THREE.GLTFLoader: Primitive mode unsupported: ' + p.mode, ) h = new THREE.Points(d, f) } Object.keys(h.geometry.morphAttributes).length > 0 && F(h, i), (h.name = t.createUniqueName(i.name || 'mesh_' + e)), I(h, i), p.extensions && O(r, h, p), t.assignFinalMaterial(h), l.push(h) } if (1 === l.length) return l[0] var m = new THREE.Group() for (c = 0, u = l.length; c < u; c++) m.add(l[c]) return m }) ) }), (U.prototype.loadCamera = function (e) { var t, n = this.json.cameras[e], r = n[n.type] if (r) return ( 'perspective' === n.type ? (t = new THREE.PerspectiveCamera( THREE.MathUtils.radToDeg(r.yfov), r.aspectRatio || 1, r.znear || 1, r.zfar || 2e6, )) : 'orthographic' === n.type && (t = new THREE.OrthographicCamera( -r.xmag, r.xmag, r.ymag, -r.ymag, r.znear, r.zfar, )), n.name && (t.name = this.createUniqueName(n.name)), I(t, n), Promise.resolve(t) ) console.warn('THREE.GLTFLoader: Missing camera parameters.') }), (U.prototype.loadSkin = function (e) { var t = this.json.skins[e], n = { joints: t.joints } return void 0 === t.inverseBindMatrices ? Promise.resolve(n) : this.getDependency('accessor', t.inverseBindMatrices).then(function (e) { return (n.inverseBindMatrices = e), n }) }), (U.prototype.loadAnimation = function (e) { for ( var t = this.json.animations[e], n = [], r = [], i = [], o = [], a = [], s = 0, l = t.channels.length; s < l; s++ ) { var c = t.channels[s], u = t.samplers[c.sampler], h = c.target, d = void 0 !== h.node ? h.node : h.id, p = void 0 !== t.parameters ? t.parameters[u.input] : u.input, f = void 0 !== t.parameters ? t.parameters[u.output] : u.output n.push(this.getDependency('node', d)), r.push(this.getDependency('accessor', p)), i.push(this.getDependency('accessor', f)), o.push(u), a.push(h) } return Promise.all([ Promise.all(n), Promise.all(r), Promise.all(i), Promise.all(o), Promise.all(a), ]).then(function (n) { for ( var r = n[0], i = n[1], o = n[2], a = n[3], s = n[4], l = [], c = 0, u = r.length; c < u; c++ ) { var h = r[c], d = i[c], p = o[c], f = a[c], m = s[c] if (void 0 !== h) { var v switch ((h.updateMatrix(), (h.matrixAutoUpdate = !0), C[m.path])) { case C.weights: v = THREE.NumberKeyframeTrack break case C.rotation: v = THREE.QuaternionKeyframeTrack break case C.position: case C.scale: default: v = THREE.VectorKeyframeTrack } var g = h.name ? h.name : h.uuid, y = void 0 !== f.interpolation ? L[f.interpolation] : THREE.InterpolateLinear, b = [] C[m.path] === C.weights ? h.traverse(function (e) { !0 === e.isMesh && e.morphTargetInfluences && b.push(e.name ? e.name : e.uuid) }) : b.push(g) var A = p.array if (p.normalized) { var x if (A.constructor === Int8Array) x = 1 / 127 else if (A.constructor === Uint8Array) x = 1 / 255 else if (A.constructor == Int16Array) x = 1 / 32767 else { if (A.constructor !== Uint16Array) throw new Error( 'THREE.GLTFLoader: Unsupported output accessor component type.', ) x = 1 / 65535 } for ( var E = new Float32Array(A.length), M = 0, _ = A.length; M < _; M++ ) E[M] = A[M] * x A = E } for (M = 0, _ = b.length; M < _; M++) { var T = new v(b[M] + '.' + C[m.path], d.array, A, y) 'CUBICSPLINE' === f.interpolation && ((T.createInterpolant = function (e) { return new w(this.times, this.values, this.getValueSize() / 3, e) }), (T.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0)), l.push(T) } } } var S = t.name ? t.name : 'animation_' + e return new THREE.AnimationClip(S, void 0, l) }) }), (U.prototype.loadNode = function (e) { var t = this.json, n = this.extensions, r = this, i = t.nodes[e], o = i.name ? r.createUniqueName(i.name) : '' return (function () { var t = [] return ( void 0 !== i.mesh && t.push( r.getDependency('mesh', i.mesh).then(function (e) { var t = r._getNodeRef(r.meshCache, i.mesh, e) return ( void 0 !== i.weights && t.traverse(function (e) { if (e.isMesh) for (var t = 0, n = i.weights.length; t < n; t++) e.morphTargetInfluences[t] = i.weights[t] }), t ) }), ), void 0 !== i.camera && t.push( r.getDependency('camera', i.camera).then(function (e) { return r._getNodeRef(r.cameraCache, i.camera, e) }), ), r ._invokeAll(function (t) { return t.createNodeAttachment && t.createNodeAttachment(e) }) .forEach(function (e) { t.push(e) }), Promise.all(t) ) })().then(function (t) { var a if ( (a = !0 === i.isBone ? new THREE.Bone() : t.length > 1 ? new THREE.Group() : 1 === t.length ? t[0] : new THREE.Object3D()) !== t[0] ) for (var s = 0, l = t.length; s < l; s++) a.add(t[s]) if ( (i.name && ((a.userData.name = i.name), (a.name = o)), I(a, i), i.extensions && O(n, a, i), void 0 !== i.matrix) ) { var c = new THREE.Matrix4() c.fromArray(i.matrix), a.applyMatrix4(c) } else void 0 !== i.translation && a.position.fromArray(i.translation), void 0 !== i.rotation && a.quaternion.fromArray(i.rotation), void 0 !== i.scale && a.scale.fromArray(i.scale) return r.associations.set(a, { type: 'nodes', index: e }), a }) }), (U.prototype.loadScene = (function () { function e(t, n, r, i) { var o = r.nodes[t] return i .getDependency('node', t) .then(function (e) { return void 0 === o.skin ? e : i .getDependency('skin', o.skin) .then(function (e) { for (var n = [], r = 0, o = (t = e).joints.length; r < o; r++) n.push(i.getDependency('node', t.joints[r])) return Promise.all(n) }) .then(function (n) { return ( e.traverse(function (e) { if (e.isMesh) { for ( var r = [], i = [], o = 0, a = n.length; o < a; o++ ) { var s = n[o] if (s) { r.push(s) var l = new THREE.Matrix4() void 0 !== t.inverseBindMatrices && l.fromArray(t.inverseBindMatrices.array, 16 * o), i.push(l) } else console.warn( 'THREE.GLTFLoader: Joint "%s" could not be found.', t.joints[o], ) } e.bind(new THREE.Skeleton(r, i), e.matrixWorld) } }), e ) }) var t }) .then(function (t) { n.add(t) var a = [] if (o.children) for (var s = o.children, l = 0, c = s.length; l < c; l++) { var u = s[l] a.push(e(u, t, r, i)) } return Promise.all(a) }) } return function (t) { var n = this.json, r = this.extensions, i = this.json.scenes[t], o = this, a = new THREE.Group() i.name && (a.name = o.createUniqueName(i.name)), I(a, i), i.extensions && O(r, a, i) for (var s = i.nodes || [], l = [], c = 0, u = s.length; c < u; c++) l.push(e(s[c], a, n, o)) return Promise.all(l).then(function () { return a }) } })()), t ) })() }, {}, ], 60: [ function (t, n, r) { ;(THREE.MTLLoader = function (e) { THREE.Loader.call(this, e) }), (THREE.MTLLoader.prototype = Object.assign( Object.create(THREE.Loader.prototype), { constructor: THREE.MTLLoader, load: function (t, n, r, i) { var o = this, a = '' === this.path ? THREE.LoaderUtils.extractUrlBase(t) : this.path, s = new THREE.FileLoader(this.manager) s.setPath(this.path), s.setRequestHeader(this.requestHeader), s.setWithCredentials(this.withCredentials), s.load( t, function (r) { try { n(o.parse(r, a)) } catch (e) { i ? i(e) : console.error(e), o.manager.itemError(t) } }, r, i, ) }, setMaterialOptions: function (e) { return (this.materialOptions = e), this }, parse: function (e, t) { for ( var n = e.split('\n'), r = {}, i = /\s+/, o = {}, a = 0; a < n.length; a++ ) { var s = n[a] if (0 !== (s = s.trim()).length && '#' !== s.charAt(0)) { var l = s.indexOf(' '), c = l >= 0 ? s.substring(0, l) : s c = c.toLowerCase() var u = l >= 0 ? s.substring(l + 1) : '' if (((u = u.trim()), 'newmtl' === c)) (r = { name: u }), (o[u] = r) else if ('ka' === c || 'kd' === c || 'ks' === c || 'ke' === c) { var h = u.split(i, 3) r[c] = [parseFloat(h[0]), parseFloat(h[1]), parseFloat(h[2])] } else r[c] = u } } var d = new THREE.MTLLoader.MaterialCreator( this.resourcePath || t, this.materialOptions, ) return ( d.setCrossOrigin(this.crossOrigin), d.setManager(this.manager), d.setMaterials(o), d ) }, }, )), (THREE.MTLLoader.MaterialCreator = function (e, t) { ;(this.baseUrl = e || ''), (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 (e) { return (this.crossOrigin = e), this }, setManager: function (e) { this.manager = e }, setMaterials: function (e) { ;(this.materialsInfo = this.convert(e)), (this.materials = {}), (this.materialsArray = []), (this.nameLookup = {}) }, convert: function (e) { if (!this.options) return e var t = {} for (var n in e) { var r = e[n], i = {} for (var o in ((t[n] = i), r)) { var a = !0, s = r[o], l = o.toLowerCase() switch (l) { case 'kd': case 'ka': case 'ks': this.options && this.options.normalizeRGB && (s = [s[0] / 255, s[1] / 255, s[2] / 255]), this.options && this.options.ignoreZeroRGBs && 0 === s[0] && 0 === s[1] && 0 === s[2] && (a = !1) } a && (i[l] = s) } } return t }, preload: function () { for (var e in this.materialsInfo) this.create(e) }, getIndex: function (e) { return this.nameLookup[e] }, getAsArray: function () { var e = 0 for (var t in this.materialsInfo) (this.materialsArray[e] = this.create(t)), (this.nameLookup[t] = e), e++ return this.materialsArray }, create: function (e) { return ( void 0 === this.materials[e] && this.createMaterial_(e), this.materials[e] ) }, createMaterial_: function (e) { var t = this, n = this.materialsInfo[e], r = { name: e, side: this.side } function i(e, t) { return 'string' !== typeof t || '' === t ? '' : /^https?:\/\//i.test(t) ? t : e + t } function o(e, n) { if (!r[e]) { var o = t.getTextureParams(n, r), a = t.loadTexture(i(t.baseUrl, o.url)) a.repeat.copy(o.scale), a.offset.copy(o.offset), (a.wrapS = t.wrap), (a.wrapT = t.wrap), (r[e] = a) } } for (var a in n) { var s, l = n[a] if ('' !== l) switch (a.toLowerCase()) { case 'kd': r.color = new THREE.Color().fromArray(l) break case 'ks': r.specular = new THREE.Color().fromArray(l) break case 'ke': r.emissive = new THREE.Color().fromArray(l) break case 'map_kd': o('map', l) break case 'map_ks': o('specularMap', l) break case 'map_ke': o('emissiveMap', l) break case 'norm': o('normalMap', l) break case 'map_bump': case 'bump': o('bumpMap', l) break case 'map_d': o('alphaMap', l), (r.transparent = !0) break case 'ns': r.shininess = parseFloat(l) break case 'd': ;(s = parseFloat(l)) < 1 && ((r.opacity = s), (r.transparent = !0)) break case 'tr': ;(s = parseFloat(l)), this.options && this.options.invertTrProperty && (s = 1 - s), s > 0 && ((r.opacity = 1 - s), (r.transparent = !0)) } } return (this.materials[e] = new THREE.MeshPhongMaterial(r)), this.materials[e] }, getTextureParams: function (e, t) { var n, r = { scale: new THREE.Vector2(1, 1), offset: new THREE.Vector2(0, 0) }, i = e.split(/\s+/) return ( (n = i.indexOf('-bm')) >= 0 && ((t.bumpScale = parseFloat(i[n + 1])), i.splice(n, 2)), (n = i.indexOf('-s')) >= 0 && (r.scale.set(parseFloat(i[n + 1]), parseFloat(i[n + 2])), i.splice(n, 4)), (n = i.indexOf('-o')) >= 0 && (r.offset.set(parseFloat(i[n + 1]), parseFloat(i[n + 2])), i.splice(n, 4)), (r.url = i.join(' ').trim()), r ) }, loadTexture: function (e, t, n, r, i) { var o, a = void 0 !== this.manager ? this.manager : THREE.DefaultLoadingManager, s = a.getHandler(e) return ( null === s && (s = new THREE.TextureLoader(a)), s.setCrossOrigin && s.setCrossOrigin(this.crossOrigin), (o = s.load(e, n, r, i)), void 0 !== t && (o.mapping = t), o ) }, }) }, {}, ], 61: [ function (t, n, r) { THREE.OBJLoader = (function () { var t = /^[og]\s*(.+)?/, n = /^mtllib /, r = /^usemtl /, i = /^usemap /, o = new THREE.Vector3(), a = new THREE.Vector3(), s = new THREE.Vector3(), l = new THREE.Vector3(), c = new THREE.Vector3() function u() { var e = { objects: [], object: {}, vertices: [], normals: [], colors: [], uvs: [], materials: {}, materialLibraries: [], startObject: function (e, t) { if (this.object && !1 === this.object.fromDeclaration) return ( (this.object.name = e), void (this.object.fromDeclaration = !1 !== t) ) var n = this.object && 'function' === typeof this.object.currentMaterial ? this.object.currentMaterial() : void 0 if ( (this.object && 'function' === typeof this.object._finalize && this.object._finalize(!0), (this.object = { name: e || '', fromDeclaration: !1 !== t, geometry: { vertices: [], normals: [], colors: [], uvs: [], hasUVIndices: !1, }, materials: [], smooth: !0, startMaterial: function (e, t) { var n = this._finalize(!1) n && (n.inherited || n.groupCount <= 0) && this.materials.splice(n.index, 1) var r = { index: this.materials.length, name: e || '', mtllib: Array.isArray(t) && t.length > 0 ? t[t.length - 1] : '', smooth: void 0 !== n ? n.smooth : this.smooth, groupStart: void 0 !== n ? n.groupEnd : 0, groupEnd: -1, groupCount: -1, inherited: !1, clone: function (e) { var t = { index: 'number' === typeof e ? e : this.index, name: this.name, mtllib: this.mtllib, smooth: this.smooth, groupStart: 0, groupEnd: -1, groupCount: -1, inherited: !1, } return (t.clone = this.clone.bind(t)), t }, } return this.materials.push(r), r }, currentMaterial: function () { if (this.materials.length > 0) return this.materials[this.materials.length - 1] }, _finalize: function (e) { var t = this.currentMaterial() if ( (t && -1 === t.groupEnd && ((t.groupEnd = this.geometry.vertices.length / 3), (t.groupCount = t.groupEnd - t.groupStart), (t.inherited = !1)), e && this.materials.length > 1) ) for (var n = this.materials.length - 1; n >= 0; n--) this.materials[n].groupCount <= 0 && this.materials.splice(n, 1) return ( e && 0 === this.materials.length && this.materials.push({ name: '', smooth: this.smooth }), t ) }, }), n && n.name && 'function' === typeof n.clone) ) { var r = n.clone(0) ;(r.inherited = !0), this.object.materials.push(r) } this.objects.push(this.object) }, finalize: function () { this.object && 'function' === typeof this.object._finalize && this.object._finalize(!0) }, parseVertexIndex: function (e, t) { var n = parseInt(e, 10) return 3 * (n >= 0 ? n - 1 : n + t / 3) }, parseNormalIndex: function (e, t) { var n = parseInt(e, 10) return 3 * (n >= 0 ? n - 1 : n + t / 3) }, parseUVIndex: function (e, t) { var n = parseInt(e, 10) return 2 * (n >= 0 ? n - 1 : n + t / 2) }, addVertex: function (e, t, n) { var r = this.vertices, i = this.object.geometry.vertices i.push(r[e + 0], r[e + 1], r[e + 2]), i.push(r[t + 0], r[t + 1], r[t + 2]), i.push(r[n + 0], r[n + 1], r[n + 2]) }, addVertexPoint: function (e) { var t = this.vertices this.object.geometry.vertices.push(t[e + 0], t[e + 1], t[e + 2]) }, addVertexLine: function (e) { var t = this.vertices this.object.geometry.vertices.push(t[e + 0], t[e + 1], t[e + 2]) }, addNormal: function (e, t, n) { var r = this.normals, i = this.object.geometry.normals i.push(r[e + 0], r[e + 1], r[e + 2]), i.push(r[t + 0], r[t + 1], r[t + 2]), i.push(r[n + 0], r[n + 1], r[n + 2]) }, addFaceNormal: function (e, t, n) { var r = this.vertices, i = this.object.geometry.normals o.fromArray(r, e), a.fromArray(r, t), s.fromArray(r, n), c.subVectors(s, a), l.subVectors(o, a), c.cross(l), c.normalize(), i.push(c.x, c.y, c.z), i.push(c.x, c.y, c.z), i.push(c.x, c.y, c.z) }, addColor: function (e, t, n) { var r = this.colors, i = this.object.geometry.colors void 0 !== r[e] && i.push(r[e + 0], r[e + 1], r[e + 2]), void 0 !== r[t] && i.push(r[t + 0], r[t + 1], r[t + 2]), void 0 !== r[n] && i.push(r[n + 0], r[n + 1], r[n + 2]) }, addUV: function (e, t, n) { var r = this.uvs, i = this.object.geometry.uvs i.push(r[e + 0], r[e + 1]), i.push(r[t + 0], r[t + 1]), i.push(r[n + 0], r[n + 1]) }, addDefaultUV: function () { var e = this.object.geometry.uvs e.push(0, 0), e.push(0, 0), e.push(0, 0) }, addUVLine: function (e) { var t = this.uvs this.object.geometry.uvs.push(t[e + 0], t[e + 1]) }, addFace: function (e, t, n, r, i, o, a, s, l) { var c = this.vertices.length, u = this.parseVertexIndex(e, c), h = this.parseVertexIndex(t, c), d = this.parseVertexIndex(n, c) if ( (this.addVertex(u, h, d), this.addColor(u, h, d), void 0 !== a && '' !== a) ) { var p = this.normals.length ;(u = this.parseNormalIndex(a, p)), (h = this.parseNormalIndex(s, p)), (d = this.parseNormalIndex(l, p)), this.addNormal(u, h, d) } else this.addFaceNormal(u, h, d) if (void 0 !== r && '' !== r) { var f = this.uvs.length ;(u = this.parseUVIndex(r, f)), (h = this.parseUVIndex(i, f)), (d = this.parseUVIndex(o, f)), this.addUV(u, h, d), (this.object.geometry.hasUVIndices = !0) } else this.addDefaultUV() }, addPointGeometry: function (e) { this.object.geometry.type = 'Points' for (var t = this.vertices.length, n = 0, r = e.length; n < r; n++) { var i = this.parseVertexIndex(e[n], t) this.addVertexPoint(i), this.addColor(i) } }, addLineGeometry: function (e, t) { this.object.geometry.type = 'Line' for ( var n = this.vertices.length, r = this.uvs.length, i = 0, o = e.length; i < o; i++ ) this.addVertexLine(this.parseVertexIndex(e[i], n)) var a = 0 for (o = t.length; a < o; a++) this.addUVLine(this.parseUVIndex(t[a], r)) }, } return e.startObject('', !1), e } function h(e) { THREE.Loader.call(this, e), (this.materials = null) } return ( (h.prototype = Object.assign(Object.create(THREE.Loader.prototype), { constructor: h, load: function (t, n, r, i) { var o = this, a = new THREE.FileLoader(this.manager) a.setPath(this.path), a.setRequestHeader(this.requestHeader), a.setWithCredentials(this.withCredentials), a.load( t, function (r) { try { n(o.parse(r)) } catch (e) { i ? i(e) : console.error(e), o.manager.itemError(t) } }, r, i, ) }, setMaterials: function (e) { return (this.materials = e), this }, parse: function (e) { var o = new u() ;-1 !== e.indexOf('\r\n') && (e = e.replace(/\r\n/g, '\n')), -1 !== e.indexOf('\\\n') && (e = e.replace(/\\\n/g, '')) for ( var a = e.split('\n'), s = '', l = '', c = [], h = 'function' === typeof ''.trimLeft, d = 0, p = a.length; d < p; d++ ) if ( ((s = a[d]), 0 !== (s = h ? s.trimLeft() : s.trim()).length && '#' !== (l = s.charAt(0))) ) if ('v' === l) { var f = s.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]), ) : o.colors.push(void 0, void 0, void 0) 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' === l) { for ( var m = s.substr(1).trim().split(/\s+/), v = [], g = 0, y = m.length; g < y; g++ ) { var b = m[g] if (b.length > 0) { var A = b.split('/') v.push(A) } } var w = v[0] for (g = 1, y = v.length - 1; g < y; g++) { var x = v[g], E = v[g + 1] o.addFace(w[0], x[0], E[0], w[1], x[1], E[1], w[2], x[2], E[2]) } } else if ('l' === l) { var M = s.substring(1).trim().split(' '), _ = [], T = [] if (-1 === s.indexOf('/')) _ = M else for (var S = 0, C = M.length; S < C; S++) { var L = M[S].split('/') '' !== L[0] && _.push(L[0]), '' !== L[1] && T.push(L[1]) } o.addLineGeometry(_, T) } else if ('p' === l) { var R = s.substr(1).trim().split(' ') o.addPointGeometry(R) } else if (null !== (c = t.exec(s))) { var P = (' ' + c[0].substr(1).trim()).substr(1) o.startObject(P) } else if (r.test(s)) o.object.startMaterial(s.substring(7).trim(), o.materialLibraries) else if (n.test(s)) o.materialLibraries.push(s.substring(7).trim()) else if (i.test(s)) console.warn( 'THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.', ) else if ('s' === l) { if ((c = s.split(' ')).length > 1) { var D = c[1].trim().toLowerCase() o.object.smooth = '0' !== D && 'off' !== D } else o.object.smooth = !0 ;(W = o.object.currentMaterial()) && (W.smooth = o.object.smooth) } else { if ('\0' === s) continue console.warn('THREE.OBJLoader: Unexpected line: "' + s + '"') } o.finalize() var O = new THREE.Group() if ( ((O.materialLibraries = [].concat(o.materialLibraries)), !0 === !( 1 === o.objects.length && 0 === o.objects[0].geometry.vertices.length )) ) for (d = 0, p = o.objects.length; d < p; d++) { var I = o.objects[d], B = I.geometry, F = I.materials, k = 'Line' === B.type, N = 'Points' === B.type, U = !1 if (0 !== B.vertices.length) { ;(Q = new THREE.BufferGeometry()).setAttribute( 'position', new THREE.Float32BufferAttribute(B.vertices, 3), ), B.normals.length > 0 && Q.setAttribute( 'normal', new THREE.Float32BufferAttribute(B.normals, 3), ), B.colors.length > 0 && ((U = !0), Q.setAttribute( 'color', new THREE.Float32BufferAttribute(B.colors, 3), )), !0 === B.hasUVIndices && Q.setAttribute('uv', new THREE.Float32BufferAttribute(B.uvs, 2)) for (var H, G = [], z = 0, j = F.length; z < j; z++) { var V = (Y = F[z]).name + '_' + Y.smooth + '_' + U, W = o.materials[V] if (null !== this.materials) if ( ((W = this.materials.create(Y.name)), !k || !W || W instanceof THREE.LineBasicMaterial) ) { if (N && W && !(W instanceof THREE.PointsMaterial)) { var q = new THREE.PointsMaterial({ size: 10, sizeAttenuation: !1, }) THREE.Material.prototype.copy.call(q, W), q.color.copy(W.color), (q.map = W.map), (W = q) } } else { var X = new THREE.LineBasicMaterial() THREE.Material.prototype.copy.call(X, W), X.color.copy(W.color), (W = X) } void 0 === W && (((W = k ? new THREE.LineBasicMaterial() : N ? new THREE.PointsMaterial({ size: 1, sizeAttenuation: !1 }) : new THREE.MeshPhongMaterial()).name = Y.name), (W.flatShading = !Y.smooth), (W.vertexColors = U), (o.materials[V] = W)), G.push(W) } if (G.length > 1) { for (z = 0, j = F.length; z < j; z++) { var Y = F[z] Q.addGroup(Y.groupStart, Y.groupCount, z) } H = k ? new THREE.LineSegments(Q, G) : N ? new THREE.Points(Q, G) : new THREE.Mesh(Q, G) } else H = k ? new THREE.LineSegments(Q, G[0]) : N ? new THREE.Points(Q, G[0]) : new THREE.Mesh(Q, G[0]) ;(H.name = I.name), O.add(H) } } else if (o.vertices.length > 0) { var Q ;(W = new THREE.PointsMaterial({ size: 1, sizeAttenuation: !1 })), (Q = new THREE.BufferGeometry()).setAttribute( 'position', new THREE.Float32BufferAttribute(o.vertices, 3), ), o.colors.length > 0 && void 0 !== o.colors[0] && (Q.setAttribute( 'color', new THREE.Float32BufferAttribute(o.colors, 3), ), (W.vertexColors = !0)) var Z = new THREE.Points(Q, W) O.add(Z) } return O }, })), h ) })() }, {}, ], 62: [ function (e, t, n) { THREE.BufferGeometryUtils = { computeTangents: function (e) { e.computeTangents(), console.warn( 'THREE.BufferGeometryUtils: .computeTangents() has been removed. Use BufferGeometry.computeTangents() instead.', ) }, mergeBufferGeometries: function (e, t) { for ( var n = null !== e[0].index, r = new Set(Object.keys(e[0].attributes)), i = new Set(Object.keys(e[0].morphAttributes)), o = {}, a = {}, s = e[0].morphTargetsRelative, l = new THREE.BufferGeometry(), c = 0, u = 0; u < e.length; ++u ) { var h = e[u], d = 0 if (n !== (null !== h.index)) return ( console.error( 'THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index ' + u + '. All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them.', ), null ) for (var p in h.attributes) { if (!r.has(p)) return ( console.error( 'THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index ' + u + '. All geometries must have compatible attributes; make sure "' + p + '" attribute exists among all geometries, or in none of them.', ), null ) void 0 === o[p] && (o[p] = []), o[p].push(h.attributes[p]), d++ } if (d !== r.size) return ( console.error( 'THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index ' + u + '. Make sure all geometries have the same number of attributes.', ), null ) if (s !== h.morphTargetsRelative) return ( console.error( 'THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index ' + u + '. .morphTargetsRelative must be consistent throughout all geometries.', ), null ) for (var p in h.morphAttributes) { if (!i.has(p)) return ( console.error( 'THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index ' + u + '. .morphAttributes must be consistent throughout all geometries.', ), null ) void 0 === a[p] && (a[p] = []), a[p].push(h.morphAttributes[p]) } if ( ((l.userData.mergedUserData = l.userData.mergedUserData || []), l.userData.mergedUserData.push(h.userData), t) ) { var f if (n) f = h.index.count else { if (void 0 === h.attributes.position) return ( console.error( 'THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index ' + u + '. The geometry must have either an index or a position attribute', ), null ) f = h.attributes.position.count } l.addGroup(c, f, u), (c += f) } } if (n) { var m = 0, v = [] for (u = 0; u < e.length; ++u) { for (var g = e[u].index, y = 0; y < g.count; ++y) v.push(g.getX(y) + m) m += e[u].attributes.position.count } l.setIndex(v) } for (var p in o) { var b = this.mergeBufferAttributes(o[p]) if (!b) return ( console.error( 'THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the ' + p + ' attribute.', ), null ) l.setAttribute(p, b) } for (var p in a) { var A = a[p][0].length if (0 === A) break for ( l.morphAttributes = l.morphAttributes || {}, l.morphAttributes[p] = [], u = 0; u < A; ++u ) { var w = [] for (y = 0; y < a[p].length; ++y) w.push(a[p][y][u]) var x = this.mergeBufferAttributes(w) if (!x) return ( console.error( 'THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the ' + p + ' morphAttribute.', ), null ) l.morphAttributes[p].push(x) } } return l }, mergeBufferAttributes: function (e) { for (var t, n, r, i = 0, o = 0; o < e.length; ++o) { var a = e[o] if (a.isInterleavedBufferAttribute) return ( console.error( 'THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. InterleavedBufferAttributes are not supported.', ), null ) if ((void 0 === t && (t = a.array.constructor), t !== a.array.constructor)) return ( console.error( 'THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes.', ), null ) if ((void 0 === n && (n = a.itemSize), n !== a.itemSize)) return ( console.error( 'THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes.', ), null ) if ((void 0 === r && (r = a.normalized), r !== a.normalized)) return ( console.error( 'THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes.', ), null ) i += a.array.length } var s = new t(i), l = 0 for (o = 0; o < e.length; ++o) s.set(e[o].array, l), (l += e[o].array.length) return new THREE.BufferAttribute(s, n, r) }, interleaveAttributes: function (e) { for (var t, n = 0, r = 0, i = 0, o = e.length; i < o; ++i) { var a = e[i] if ((void 0 === t && (t = a.array.constructor), t !== a.array.constructor)) return ( console.error( 'AttributeBuffers of different types cannot be interleaved', ), null ) ;(n += a.array.length), (r += a.itemSize) } var s = new THREE.InterleavedBuffer(new t(n), r), l = 0, c = [], u = ['getX', 'getY', 'getZ', 'getW'], h = ['setX', 'setY', 'setZ', 'setW'], d = 0 for (o = e.length; d < o; d++) { var p = (a = e[d]).itemSize, f = a.count, m = new THREE.InterleavedBufferAttribute(s, p, l, a.normalized) c.push(m), (l += p) for (var v = 0; v < f; v++) for (var g = 0; g < p; g++) m[h[g]](v, a[u[g]](v)) } return c }, estimateBytesUsed: function (e) { var t = 0 for (var n in e.attributes) { var r = e.getAttribute(n) t += r.count * r.itemSize * r.array.BYTES_PER_ELEMENT } var i = e.getIndex() return (t += i ? i.count * i.itemSize * i.array.BYTES_PER_ELEMENT : 0) }, mergeVertices: function (e, t = 1e-4) { t = Math.max(t, Number.EPSILON) for ( var n = {}, r = e.getIndex(), i = e.getAttribute('position'), o = r ? r.count : i.count, a = 0, s = Object.keys(e.attributes), l = {}, c = {}, u = [], h = ['getX', 'getY', 'getZ', 'getW'], d = 0, p = s.length; d < p; d++ ) (l[(b = s[d])] = []), (E = e.morphAttributes[b]) && (c[b] = new Array(E.length).fill().map(() => [])) var f = Math.log10(1 / t), m = Math.pow(10, f) for (d = 0; d < o; d++) { var v = r ? r.getX(d) : d, g = '', y = 0 for (p = s.length; y < p; y++) for (var b = s[y], A = (x = e.getAttribute(b)).itemSize, w = 0; w < A; w++) g += ~~(x[h[w]](v) * m) + ',' if (g in n) u.push(n[g]) else { for (y = 0, p = s.length; y < p; y++) { b = s[y] var x = e.getAttribute(b), E = e.morphAttributes[b], M = ((A = x.itemSize), l[b]), _ = c[b] for (w = 0; w < A; w++) { var T = h[w] if ((M.push(x[T](v)), E)) for (var S = 0, C = E.length; S < C; S++) _[S].push(E[S][T](v)) } } ;(n[g] = a), u.push(a), a++ } } const L = e.clone() for (d = 0, p = s.length; d < p; d++) { b = s[d] var R = e.getAttribute(b), P = new R.array.constructor(l[b]) if ( ((x = new THREE.BufferAttribute(P, R.itemSize, R.normalized)), L.setAttribute(b, x), b in c) ) for (y = 0; y < c[b].length; y++) { var D = e.morphAttributes[b][y], O = ((P = new D.array.constructor(c[b][y])), new THREE.BufferAttribute(P, D.itemSize, D.normalized)) L.morphAttributes[b][y] = O } } return L.setIndex(u), L }, toTrianglesDrawMode: function (e, t) { if (t === THREE.TrianglesDrawMode) return ( console.warn( 'THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles.', ), e ) if (t === THREE.TriangleFanDrawMode || t === THREE.TriangleStripDrawMode) { var n = e.getIndex() if (null === n) { var r = [], i = e.getAttribute('position') if (void 0 === i) return ( console.error( 'THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible.', ), e ) for (var o = 0; o < i.count; o++) r.push(o) e.setIndex(r), (n = e.getIndex()) } var a = n.count - 2, s = [] if (t === THREE.TriangleFanDrawMode) for (o = 1; o <= a; o++) s.push(n.getX(0)), s.push(n.getX(o)), s.push(n.getX(o + 1)) else for (o = 0; o < a; o++) o % 2 === 0 ? (s.push(n.getX(o)), s.push(n.getX(o + 1)), s.push(n.getX(o + 2))) : (s.push(n.getX(o + 2)), s.push(n.getX(o + 1)), s.push(n.getX(o))) s.length / 3 !== a && console.error( 'THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.', ) var l = e.clone() return l.setIndex(s), l.clearGroups(), l } return ( console.error( 'THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:', t, ), e ) }, computeMorphedAttributes: function (e) { if (!0 !== e.geometry.isBufferGeometry) return ( console.error( 'THREE.BufferGeometryUtils: Geometry is not of type THREE.BufferGeometry.', ), null ) var t = new THREE.Vector3(), n = new THREE.Vector3(), r = new THREE.Vector3(), i = new THREE.Vector3(), o = new THREE.Vector3(), a = new THREE.Vector3(), s = new THREE.Vector3(), l = new THREE.Vector3(), c = new THREE.Vector3() function u(e, u, h, d, p, f, m, v, g) { t.fromBufferAttribute(h, f), n.fromBufferAttribute(h, m), r.fromBufferAttribute(h, v) var y = e.morphTargetInfluences if (u.morphTargets && d && y) { s.set(0, 0, 0), l.set(0, 0, 0), c.set(0, 0, 0) for (var b = 0, A = d.length; b < A; b++) { var w = y[b] ;(d = d[b]), 0 !== w && (i.fromBufferAttribute(d, f), o.fromBufferAttribute(d, m), a.fromBufferAttribute(d, v), p ? (s.addScaledVector(i, w), l.addScaledVector(o, w), c.addScaledVector(a, w)) : (s.addScaledVector(i.sub(t), w), l.addScaledVector(o.sub(n), w), c.addScaledVector(a.sub(r), w))) } t.add(s), n.add(l), r.add(c) } e.isSkinnedMesh && (e.boneTransform(f, t), e.boneTransform(m, n), e.boneTransform(v, r)), (g[3 * f + 0] = t.x), (g[3 * f + 1] = t.y), (g[3 * f + 2] = t.z), (g[3 * m + 0] = n.x), (g[3 * m + 1] = n.y), (g[3 * m + 2] = n.z), (g[3 * v + 0] = r.x), (g[3 * v + 1] = r.y), (g[3 * v + 2] = r.z) } var h, d, p, f, m, v, g, y, b, A = e.geometry, w = e.material, x = A.index, E = A.attributes.position, M = A.morphAttributes.position, _ = A.morphTargetsRelative, T = A.attributes.normal, S = A.morphAttributes.position, C = A.groups, L = A.drawRange, R = new Float32Array(E.count * E.itemSize), P = new Float32Array(T.count * T.itemSize) if (null !== x) if (Array.isArray(w)) for (f = 0, v = C.length; f < v; f++) for ( b = w[(y = C[f]).materialIndex], m = Math.max(y.start, L.start), g = Math.min(y.start + y.count, L.start + L.count); m < g; m += 3 ) u( e, b, E, M, _, (h = x.getX(m)), (d = x.getX(m + 1)), (p = x.getX(m + 2)), R, ), u(e, b, T, S, _, h, d, p, P) else for ( f = Math.max(0, L.start), v = Math.min(x.count, L.start + L.count); f < v; f += 3 ) u( e, w, E, M, _, (h = x.getX(f)), (d = x.getX(f + 1)), (p = x.getX(f + 2)), R, ), u(e, w, T, S, _, h, d, p, P) else if (void 0 !== E) if (Array.isArray(w)) for (f = 0, v = C.length; f < v; f++) for ( b = w[(y = C[f]).materialIndex], m = Math.max(y.start, L.start), g = Math.min(y.start + y.count, L.start + L.count); m < g; m += 3 ) u(e, b, E, M, _, (h = m), (d = m + 1), (p = m + 2), R), u(e, b, T, S, _, h, d, p, P) else for ( f = Math.max(0, L.start), v = Math.min(E.count, L.start + L.count); f < v; f += 3 ) u(e, w, E, M, _, (h = f), (d = f + 1), (p = f + 2), R), u(e, w, T, S, _, h, d, p, P) return { positionAttribute: E, normalAttribute: T, morphedPositionAttribute: new THREE.Float32BufferAttribute(R, 3), morphedNormalAttribute: new THREE.Float32BufferAttribute(P, 3), } }, } }, {}, ], 63: [ function (e, t, n) { var r = e('layout-bmfont-text'), i = e('inherits'), o = e('quad-indices'), a = e('three-buffer-vertex-data'), s = e('object-assign'), l = e('./lib/vertices'), c = e('./lib/utils'), u = THREE.BufferGeometry function h(e) { u.call(this), 'string' === typeof e && (e = { text: e }), (this._opt = s({}, e)), e && this.update(e) } ;(t.exports = function (e) { return new h(e) }), i(h, u), (h.prototype.update = function (e) { if ( ('string' === typeof e && (e = { text: e }), !(e = s({}, this._opt, e)).font) ) throw new TypeError('must specify a { font } in options') this.layout = r(e) var t = !1 !== e.flipY, n = e.font, i = n.common.scaleW, c = n.common.scaleH, u = this.layout.glyphs.filter(function (e) { var t = e.data return t.width * t.height > 0 }) this.visibleGlyphs = u var h = l.positions(u), d = l.uvs(u, i, c, t), p = o({ clockwise: !0, type: 'uint16', count: u.length }) if ( (a.index(this, p, 1, 'uint16'), a.attr(this, 'position', h, 2), a.attr(this, 'uv', d, 2), !e.multipage && 'page' in this.attributes) ) this.removeAttribute('page') else if (e.multipage) { var f = l.pages(u) a.attr(this, 'page', f, 1) } }), (h.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) ) c.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.', ) }), (h.prototype.computeBoundingBox = function () { null === this.boundingBox && (this.boundingBox = new THREE.Box3()) var e = this.boundingBox, t = this.attributes.position.array, n = this.attributes.position.itemSize !t || !n || t.length < 2 ? e.makeEmpty() : c.computeBox(t, e) }) }, { './lib/utils': 64, './lib/vertices': 65, inherits: 30, 'layout-bmfont-text': 36, 'object-assign': 39, 'quad-indices': 51, 'three-buffer-vertex-data': 66, }, ], 64: [ function (e, t, n) { var r = 2, i = { min: [0, 0], max: [0, 0] } function o(e) { var t = e.length / r ;(i.min[0] = e[0]), (i.min[1] = e[1]), (i.max[0] = e[0]), (i.max[1] = e[1]) for (var n = 0; n < t; n++) { var o = e[n * r + 0], a = e[n * r + 1] ;(i.min[0] = Math.min(o, i.min[0])), (i.min[1] = Math.min(a, i.min[1])), (i.max[0] = Math.max(o, i.max[0])), (i.max[1] = Math.max(a, i.max[1])) } } ;(t.exports.computeBox = function (e, t) { o(e), t.min.set(i.min[0], i.min[1], 0), t.max.set(i.max[0], i.max[1], 0) }), (t.exports.computeSphere = function (e, t) { o(e) var n = i.min[0], r = i.min[1], a = i.max[0] - n, s = i.max[1] - r, l = Math.sqrt(a * a + s * s) t.center.set(n + a / 2, r + s / 2, 0), (t.radius = l / 2) }) }, {}, ], 65: [ function (e, t, n) { ;(t.exports.pages = function (e) { var t = new Float32Array(4 * e.length * 1), n = 0 return ( e.forEach(function (e) { var r = e.data.page || 0 ;(t[n++] = r), (t[n++] = r), (t[n++] = r), (t[n++] = r) }), t ) }), (t.exports.uvs = function (e, t, n, r) { var i = new Float32Array(4 * e.length * 2), o = 0 return ( e.forEach(function (e) { var a = e.data, s = a.x + a.width, l = a.y + a.height, c = a.x / t, u = a.y / n, h = s / t, d = l / n r && ((u = (n - a.y) / n), (d = (n - l) / n)), (i[o++] = c), (i[o++] = u), (i[o++] = c), (i[o++] = d), (i[o++] = h), (i[o++] = d), (i[o++] = h), (i[o++] = u) }), i ) }), (t.exports.positions = function (e) { var t = new Float32Array(4 * e.length * 2), n = 0 return ( e.forEach(function (e) { var r = e.data, i = e.position[0] + r.xoffset, o = e.position[1] + r.yoffset, a = r.width, s = r.height ;(t[n++] = i), (t[n++] = o), (t[n++] = i), (t[n++] = o + s), (t[n++] = i + a), (t[n++] = o + s), (t[n++] = i + a), (t[n++] = o) }), t ) }) }, {}, ], 66: [ function (e, t, n) { var r = e('flatten-vertex-data') function i(e, t, n, r) { 'number' !== typeof n && (n = 1), 'string' !== typeof r && (r = 'uint16') var i = !e.index && 'function' !== typeof e.setIndex, o = a(i ? e.getAttribute('index') : e.index, t, n, r) o && (i ? e.addAttribute('index', o) : (e.index = o)) } function o(e, t, n, r, i) { if ( ('number' !== typeof r && (r = 3), 'string' !== typeof i && (i = 'float32'), Array.isArray(n) && Array.isArray(n[0]) && n[0].length !== r) ) throw new Error( 'Nested vertex array has unexpected size; expected ' + r + ' but found ' + n[0].length, ) var o = a(e.getAttribute(t), n, r, i) e.setAttribute(t, o) } function a(e, t, n, i) { return ( (t = r((t = t || []), i)), ((e = new THREE.BufferAttribute(t, n)).itemSize = n), (e.needsUpdate = !0), e ) } ;(t.exports.attr = o), (t.exports.index = i) }, { 'flatten-vertex-data': 23 }, ], 67: [ function (e, t, n) { ;(function (t, r) { var i = e('process/browser.js').nextTick, o = Function.prototype.apply, a = Array.prototype.slice, s = {}, l = 0 function c(e, t) { ;(this._id = e), (this._clearFn = t) } ;(n.setTimeout = function () { return new c(o.call(setTimeout, window, arguments), clearTimeout) }), (n.setInterval = function () { return new c(o.call(setInterval, window, arguments), clearInterval) }), (n.clearTimeout = n.clearInterval = function (e) { e.close() }), (c.prototype.unref = c.prototype.ref = function () {}), (c.prototype.close = function () { this._clearFn.call(window, this._id) }), (n.enroll = function (e, t) { clearTimeout(e._idleTimeoutId), (e._idleTimeout = t) }), (n.unenroll = function (e) { clearTimeout(e._idleTimeoutId), (e._idleTimeout = -1) }), (n._unrefActive = n.active = function (e) { clearTimeout(e._idleTimeoutId) var t = e._idleTimeout t >= 0 && (e._idleTimeoutId = setTimeout(function () { e._onTimeout && e._onTimeout() }, t)) }), (n.setImmediate = 'function' === typeof t ? t : function (e) { var t = l++, r = !(arguments.length < 2) && a.call(arguments, 1) return ( (s[t] = !0), i(function () { s[t] && (r ? e.apply(null, r) : e.call(null), n.clearImmediate(t)) }), t ) }), (n.clearImmediate = 'function' === typeof r ? r : function (e) { delete s[e] }) }.call(this, e('timers').setImmediate, e('timers').clearImmediate)) }, { 'process/browser.js': 49, timers: 67 }, ], 68: [ function (e, n, i) { ;(function (e) { !(function (e, r) { 'object' === typeof i && 'undefined' !== typeof n ? (n.exports = r()) : 'function' === typeof t && t.amd ? t(r) : (e.WebVRPolyfill = r()) })(this, function () { 'use strict' var t = 'undefined' !== typeof window ? window : 'undefined' !== typeof e ? e : 'undefined' !== typeof self ? self : {} function n(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, 'default') ? e.default : e } function r(e, t) { return e((t = { exports: {} }), t.exports), t.exports } var i = function () { return ( /Android/i.test(navigator.userAgent) || /iPhone|iPad|iPod/i.test(navigator.userAgent) ) }, o = function (e, t) { for (var n = 0, r = e.length; n < r; n++) t[n] = e[n] }, a = function (e, t) { for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]) return e }, s = n( r(function (e, n) { var r ;(r = function () { var e = function (e, t) { if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function') }, n = (function () { function e(e, t) { for (var n = 0; n < t.length; n++) { var r = t[n] ;(r.enumerable = r.enumerable || !1), (r.configurable = !0), 'value' in r && (r.writable = !0), Object.defineProperty(e, r.key, r) } } return function (t, n, r) { return n && e(t.prototype, n), r && e(t, r), t } })(), r = (function () { function e(e, t) { var n = [], r = !0, i = !1, o = void 0 try { for ( var a, s = e[Symbol.iterator](); !(r = (a = s.next()).done) && (n.push(a.value), !t || n.length !== t); r = !0 ); } catch (l) { ;(i = !0), (o = l) } finally { try { !r && s.return && s.return() } finally { if (i) throw o } } return n } return function (t, n) { if (Array.isArray(t)) return t if (Symbol.iterator in Object(t)) return e(t, n) throw new TypeError( 'Invalid attempt to destructure non-iterable instance', ) } })(), i = 0.001, o = 1, a = function (e, t) { return 'data:' + e + ',' + encodeURIComponent(t) }, s = function (e, t, n) { return e + (t - e) * n }, l = (function () { var e = /iPad|iPhone|iPod/.test(navigator.platform) return function () { return e } })(), c = (function () { var e = -1 !== navigator.userAgent.indexOf('Version') && -1 !== navigator.userAgent.indexOf('Android') && -1 !== navigator.userAgent.indexOf('Chrome') return function () { return e } })(), u = (function () { var e = /^((?!chrome|android).)*safari/i.test(navigator.userAgent) return function () { return e } })(), h = (function () { var e = -1 !== navigator.userAgent.indexOf('Firefox') && -1 !== navigator.userAgent.indexOf('Android') return function () { return e } })(), d = (function () { var e = navigator.userAgent.match(/.*Chrome\/([0-9]+)/), t = e ? parseInt(e[1], 10) : null return function () { return t } })(), p = (function () { var e = !1 return ( (e = l() && u() && -1 !== navigator.userAgent.indexOf('13_4')), function () { return e } ) })(), f = (function () { var e = !1 if (65 === d()) { var t = navigator.userAgent.match(/.*Chrome\/([0-9\.]*)/) if (t) { var n = t[1].split('.'), i = r(n, 4), o = (i[0], i[1], i[2]), a = i[3] e = 3325 === parseInt(o, 10) && parseInt(a, 10) < 148 } } return function () { return e } })(), m = (function () { var e = -1 !== navigator.userAgent.indexOf('R7 Build') return function () { return e } })(), v = function () { var e = 90 == window.orientation || -90 == window.orientation return m() ? !e : e }, g = function (e) { return !isNaN(e) && !(e <= i) && !(e > o) }, y = function () { return ( Math.max(window.screen.width, window.screen.height) * window.devicePixelRatio ) }, b = function () { return ( Math.min(window.screen.width, window.screen.height) * window.devicePixelRatio ) }, A = function (e) { if (c()) 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 }, w = 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 }, x = function () { return ( document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement ) }, E = function (e, t, n, r) { var i = e.createShader(e.VERTEX_SHADER) e.shaderSource(i, t), e.compileShader(i) var o = e.createShader(e.FRAGMENT_SHADER) e.shaderSource(o, n), e.compileShader(o) var a = e.createProgram() for (var s in (e.attachShader(a, i), e.attachShader(a, o), r)) e.bindAttribLocation(a, r[s], s) return e.linkProgram(a), e.deleteShader(i), e.deleteShader(o), a }, M = function (e, t) { for ( var n = {}, r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), i = '', o = 0; o < r; o++ ) n[(i = e.getActiveUniform(t, o).name.replace('[0]', ''))] = e.getUniformLocation(t, i) return n }, _ = function (e, t, n, r, i, o, a) { var s = 1 / (t - n), l = 1 / (r - i), c = 1 / (o - a) return ( (e[0] = -2 * s), (e[1] = 0), (e[2] = 0), (e[3] = 0), (e[4] = 0), (e[5] = -2 * l), (e[6] = 0), (e[7] = 0), (e[8] = 0), (e[9] = 0), (e[10] = 2 * c), (e[11] = 0), (e[12] = (t + n) * s), (e[13] = (i + r) * l), (e[14] = (a + o) * c), (e[15] = 1), e ) }, T = function () { var e, t = !1 return ( (e = navigator.userAgent || navigator.vendor || window.opera), (/(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( e, ) || /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( e.substr(0, 4), )) && (t = !0), t ) }, S = function (e, t) { for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]) return e }, C = function (e) { if (l()) { var t = e.style.width, n = e.style.height ;(e.style.width = parseInt(t) + 1 + 'px'), (e.style.height = parseInt(n) + 'px'), setTimeout(function () { ;(e.style.width = t), (e.style.height = n) }, 100) } window.canvas = e }, L = (function () { var e = Math.PI / 180, t = 0.25 * Math.PI function n(n, r, i, o) { var a = Math.tan(r ? r.upDegrees * e : t), s = Math.tan(r ? r.downDegrees * e : t), l = Math.tan(r ? r.leftDegrees * e : t), c = Math.tan(r ? r.rightDegrees * e : t), u = 2 / (l + c), h = 2 / (a + s) return ( (n[0] = u), (n[1] = 0), (n[2] = 0), (n[3] = 0), (n[4] = 0), (n[5] = h), (n[6] = 0), (n[7] = 0), (n[8] = -(l - c) * u * 0.5), (n[9] = (a - s) * h * 0.5), (n[10] = o / (i - o)), (n[11] = -1), (n[12] = 0), (n[13] = 0), (n[14] = (o * i) / (i - o)), (n[15] = 0), n ) } function r(e, t, n) { var r = t[0], i = t[1], o = t[2], a = t[3], s = r + r, l = i + i, c = o + o, u = r * s, h = r * l, d = r * c, p = i * l, f = i * c, m = o * c, v = a * s, g = a * l, y = a * c return ( (e[0] = 1 - (p + m)), (e[1] = h + y), (e[2] = d - g), (e[3] = 0), (e[4] = h - y), (e[5] = 1 - (u + m)), (e[6] = f + v), (e[7] = 0), (e[8] = d + g), (e[9] = f - v), (e[10] = 1 - (u + p)), (e[11] = 0), (e[12] = n[0]), (e[13] = n[1]), (e[14] = n[2]), (e[15] = 1), e ) } function i(e, t, n) { var r, i, o, a, s, l, c, u, h, d, p, f, m = n[0], v = n[1], g = n[2] return ( t === e ? ((e[12] = t[0] * m + t[4] * v + t[8] * g + t[12]), (e[13] = t[1] * m + t[5] * v + t[9] * g + t[13]), (e[14] = t[2] * m + t[6] * v + t[10] * g + t[14]), (e[15] = t[3] * m + t[7] * v + t[11] * g + t[15])) : ((r = t[0]), (i = t[1]), (o = t[2]), (a = t[3]), (s = t[4]), (l = t[5]), (c = t[6]), (u = t[7]), (h = t[8]), (d = t[9]), (p = t[10]), (f = t[11]), (e[0] = r), (e[1] = i), (e[2] = o), (e[3] = a), (e[4] = s), (e[5] = l), (e[6] = c), (e[7] = u), (e[8] = h), (e[9] = d), (e[10] = p), (e[11] = f), (e[12] = r * m + s * v + h * g + t[12]), (e[13] = i * m + l * v + d * g + t[13]), (e[14] = o * m + c * v + p * g + t[14]), (e[15] = a * m + u * v + f * g + t[15])), e ) } function o(e, t) { var n = t[0], r = t[1], i = t[2], o = t[3], a = t[4], s = t[5], l = t[6], c = t[7], u = t[8], h = t[9], d = t[10], p = t[11], f = t[12], m = t[13], v = t[14], g = t[15], y = n * s - r * a, b = n * l - i * a, A = n * c - o * a, w = r * l - i * s, x = r * c - o * s, E = i * c - o * l, M = u * m - h * f, _ = u * v - d * f, T = u * g - p * f, S = h * v - d * m, C = h * g - p * m, L = d * g - p * v, R = y * L - b * C + A * S + w * T - x * _ + E * M return R ? ((R = 1 / R), (e[0] = (s * L - l * C + c * S) * R), (e[1] = (i * C - r * L - o * S) * R), (e[2] = (m * E - v * x + g * w) * R), (e[3] = (d * x - h * E - p * w) * R), (e[4] = (l * T - a * L - c * _) * R), (e[5] = (n * L - i * T + o * _) * R), (e[6] = (v * A - f * E - g * b) * R), (e[7] = (u * E - d * A + p * b) * R), (e[8] = (a * C - s * T + c * M) * R), (e[9] = (r * T - n * C - o * M) * R), (e[10] = (f * x - m * A + g * y) * R), (e[11] = (h * A - u * x - p * y) * R), (e[12] = (s * _ - a * S - l * M) * R), (e[13] = (n * S - r * _ + i * M) * R), (e[14] = (m * b - f * w - v * y) * R), (e[15] = (u * w - h * b + d * y) * R), e) : null } var a = new Float32Array([0, 0, 0, 1]), s = new Float32Array([0, 0, 0]) function l(e, t, l, c, u, h) { n(e, c || null, h.depthNear, h.depthFar), r(t, l.orientation || a, l.position || s), u && i(t, t, u), o(t, t) } return function (e, t, n) { return ( !(!e || !t) && ((e.pose = t), (e.timestamp = t.timestamp), l( e.leftProjectionMatrix, e.leftViewMatrix, t, n._getFieldOfView('left'), n._getEyeOffset('left'), n, ), l( e.rightProjectionMatrix, e.rightViewMatrix, t, n._getFieldOfView('right'), n._getEyeOffset('right'), n, ), !0) ) } })(), R = function () { var e = window.self !== window.top, t = P(document.referrer), n = P(window.location.href) return e && t !== n }, P = function (e) { var t, n = e.indexOf('://') t = -1 !== n ? n + 3 : 0 var r = e.indexOf('/', t) return -1 === r && (r = e.length), e.substring(0, r) }, D = function (e) { return e.w > 1 ? (console.warn('getQuaternionAngle: w > 1'), 0) : 2 * Math.acos(e.w) }, O = (function () { var e = {} return function (t, n) { void 0 === e[t] && (console.warn('webvr-polyfill: ' + n), (e[t] = !0)) } })(), I = function (e, t) { O( e, e + ' has been deprecated. This may not work on native WebVR displays. ' + (t ? 'Please use ' + t + ' instead.' : ''), ) } function B(e, t, n) { if (t) { for (var r = [], i = null, o = 0; o < t.length; ++o) switch ((a = t[o])) { case e.TEXTURE_BINDING_2D: case e.TEXTURE_BINDING_CUBE_MAP: if ((l = t[++o]) < e.TEXTURE0 || l > 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 } i || (i = e.getParameter(e.ACTIVE_TEXTURE)), e.activeTexture(l), r.push(e.getParameter(a), null) break case e.ACTIVE_TEXTURE: ;(i = e.getParameter(e.ACTIVE_TEXTURE)), r.push(null) break default: r.push(e.getParameter(a)) } for (n(e), o = 0; o < t.length; ++o) { var a = t[o], s = r[o] switch (a) { case e.ACTIVE_TEXTURE: break case e.ARRAY_BUFFER_BINDING: e.bindBuffer(e.ARRAY_BUFFER, s) break case e.COLOR_CLEAR_VALUE: e.clearColor(s[0], s[1], s[2], s[3]) break case e.COLOR_WRITEMASK: e.colorMask(s[0], s[1], s[2], s[3]) break case e.CURRENT_PROGRAM: e.useProgram(s) break case e.ELEMENT_ARRAY_BUFFER_BINDING: e.bindBuffer(e.ELEMENT_ARRAY_BUFFER, s) break case e.FRAMEBUFFER_BINDING: e.bindFramebuffer(e.FRAMEBUFFER, s) break case e.RENDERBUFFER_BINDING: e.bindRenderbuffer(e.RENDERBUFFER, s) break case e.TEXTURE_BINDING_2D: if ((l = t[++o]) < e.TEXTURE0 || l > e.TEXTURE31) break e.activeTexture(l), e.bindTexture(e.TEXTURE_2D, s) break case e.TEXTURE_BINDING_CUBE_MAP: var l if ((l = t[++o]) < e.TEXTURE0 || l > e.TEXTURE31) break e.activeTexture(l), e.bindTexture(e.TEXTURE_CUBE_MAP, s) break case e.VIEWPORT: e.viewport(s[0], s[1], s[2], s[3]) break case e.BLEND: case e.CULL_FACE: case e.DEPTH_TEST: case e.SCISSOR_TEST: case e.STENCIL_TEST: s ? e.enable(a) : e.disable(a) break default: console.log('No GL restore behavior for 0x' + a.toString(16)) } i && e.activeTexture(i) } } else n(e) } var F = B, k = [ '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'), N = [ 'precision mediump float;', 'uniform sampler2D diffuse;', 'varying vec2 vTexCoord;', 'void main() {', ' gl_FragColor = texture2D(diffuse, vTexCoord);', '}', ].join('\n') function U(e, t, n, r) { ;(this.gl = e), (this.cardboardUI = t), (this.bufferScale = n), (this.dirtySubmitFrameBindings = r), (this.ctxAttribs = e.getContextAttributes()), (this.instanceExt = e.getExtension('ANGLE_instanced_arrays')), (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), l() || ((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 = E(e, k, N, this.attribs)), (this.uniforms = M(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() } ;(U.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() }), (U.prototype.onResize = function () { var e = this.gl, t = this, n = [e.RENDERBUFFER_BINDING, e.TEXTURE_BINDING_2D, e.TEXTURE0] F(e, n, 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() }), (U.prototype.patch = function () { if (!this.isPatched) { var e = this, t = this.gl.canvas, n = this.gl l() || ((t.width = y() * this.bufferScale), (t.height = b() * this.bufferScale), Object.defineProperty(t, 'width', { configurable: !0, enumerable: !0, get: function () { return e.bufferWidth }, set: function (n) { ;(e.bufferWidth = n), e.realCanvasWidth.set.call(t, n), e.onResize() }, }), Object.defineProperty(t, 'height', { configurable: !0, enumerable: !0, get: function () { return e.bufferHeight }, set: function (n) { ;(e.bufferHeight = n), e.realCanvasHeight.set.call(t, n), e.onResize() }, })), (this.lastBoundFramebuffer = n.getParameter( n.FRAMEBUFFER_BINDING, )), null == this.lastBoundFramebuffer && ((this.lastBoundFramebuffer = this.framebuffer), this.gl.bindFramebuffer(n.FRAMEBUFFER, this.framebuffer)), (this.gl.bindFramebuffer = function (t, r) { ;(e.lastBoundFramebuffer = r || e.framebuffer), e.realBindFramebuffer.call(n, t, e.lastBoundFramebuffer) }), (this.cullFace = n.getParameter(n.CULL_FACE)), (this.depthTest = n.getParameter(n.DEPTH_TEST)), (this.blend = n.getParameter(n.BLEND)), (this.scissorTest = n.getParameter(n.SCISSOR_TEST)), (this.stencilTest = n.getParameter(n.STENCIL_TEST)), (n.enable = function (t) { switch (t) { case n.CULL_FACE: e.cullFace = !0 break case n.DEPTH_TEST: e.depthTest = !0 break case n.BLEND: e.blend = !0 break case n.SCISSOR_TEST: e.scissorTest = !0 break case n.STENCIL_TEST: e.stencilTest = !0 } e.realEnable.call(n, t) }), (n.disable = function (t) { switch (t) { case n.CULL_FACE: e.cullFace = !1 break case n.DEPTH_TEST: e.depthTest = !1 break case n.BLEND: e.blend = !1 break case n.SCISSOR_TEST: e.scissorTest = !1 break case n.STENCIL_TEST: e.stencilTest = !1 } e.realDisable.call(n, t) }), (this.colorMask = n.getParameter(n.COLOR_WRITEMASK)), (n.colorMask = function (t, r, i, o) { ;(e.colorMask[0] = t), (e.colorMask[1] = r), (e.colorMask[2] = i), (e.colorMask[3] = o), e.realColorMask.call(n, t, r, i, o) }), (this.clearColor = n.getParameter(n.COLOR_CLEAR_VALUE)), (n.clearColor = function (t, r, i, o) { ;(e.clearColor[0] = t), (e.clearColor[1] = r), (e.clearColor[2] = i), (e.clearColor[3] = o), e.realClearColor.call(n, t, r, i, o) }), (this.viewport = n.getParameter(n.VIEWPORT)), (n.viewport = function (t, r, i, o) { ;(e.viewport[0] = t), (e.viewport[1] = r), (e.viewport[2] = i), (e.viewport[3] = o), e.realViewport.call(n, t, r, i, o) }), (this.isPatched = !0), C(t) } }), (U.prototype.unpatch = function () { if (this.isPatched) { var e = this.gl, t = this.gl.canvas l() || (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 () { C(t) }, 1) } }), (U.prototype.setTextureBounds = function (e, t) { e || (e = [0, 0, 0.5, 1]), t || (t = [0.5, 0, 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]) }), (U.prototype.submitFrame = function () { var e = this.gl, t = this, n = [] if ( (this.dirtySubmitFrameBindings || n.push( e.CURRENT_PROGRAM, e.ARRAY_BUFFER_BINDING, e.ELEMENT_ARRAY_BUFFER_BINDING, e.TEXTURE_BINDING_2D, e.TEXTURE0, ), F(e, n, function (e) { t.realBindFramebuffer.call(e, e.FRAMEBUFFER, null) var n = 0, r = 0 t.instanceExt && ((n = e.getVertexAttrib( t.attribs.position, t.instanceExt.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE, )), (r = e.getVertexAttrib( t.attribs.texCoord, t.instanceExt.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE, ))), 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 || l()) && (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, ), t.instanceExt && (0 != n && t.instanceExt.vertexAttribDivisorANGLE( t.attribs.position, 0, ), 0 != r && t.instanceExt.vertexAttribDivisorANGLE( t.attribs.texCoord, 0, )), 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), t.instanceExt && (0 != n && t.instanceExt.vertexAttribDivisorANGLE( t.attribs.position, n, ), 0 != r && t.instanceExt.vertexAttribDivisorANGLE( t.attribs.texCoord, r, )) }), l()) ) { var r = e.canvas ;(r.width == t.bufferWidth && r.height == t.bufferHeight) || ((t.bufferWidth = r.width), (t.bufferHeight = r.height), t.onResize()) } }), (U.prototype.updateDeviceInfo = function (e) { var t = this.gl, n = this, r = [t.ARRAY_BUFFER_BINDING, t.ELEMENT_ARRAY_BUFFER_BINDING] F(t, r, function (t) { var r = n.computeMeshVertices_(n.meshWidth, n.meshHeight, e) if ( (t.bindBuffer(t.ARRAY_BUFFER, n.vertexBuffer), t.bufferData(t.ARRAY_BUFFER, r, t.STATIC_DRAW), !n.indexCount) ) { var i = n.computeMeshIndices_(n.meshWidth, n.meshHeight) t.bindBuffer(t.ELEMENT_ARRAY_BUFFER, n.indexBuffer), t.bufferData(t.ELEMENT_ARRAY_BUFFER, i, t.STATIC_DRAW), (n.indexCount = i.length) } }) }), (U.prototype.computeMeshVertices_ = function (e, t, n) { for ( var r = new Float32Array(2 * e * t * 5), i = n.getLeftEyeVisibleTanAngles(), o = n.getLeftEyeNoLensTanAngles(), a = n.getLeftEyeVisibleScreenRect(o), l = 0, c = 0; c < 2; c++ ) { for (var u = 0; u < t; u++) for (var h = 0; h < e; h++, l++) { var d = h / (e - 1), p = u / (t - 1), f = d, m = p, v = s(i[0], i[2], d), g = s(i[3], i[1], p), y = Math.sqrt(v * v + g * g), b = n.distortion.distortInverse(y), A = (g * b) / y ;(d = ((v * b) / y - o[0]) / (o[2] - o[0])), (p = (A - o[3]) / (o[1] - o[3])), (d = 2 * (a.x + d * a.width - 0.5)), (p = 2 * (a.y + p * a.height - 0.5)), (r[5 * l + 0] = d), (r[5 * l + 1] = p), (r[5 * l + 2] = f), (r[5 * l + 3] = m), (r[5 * l + 4] = c) } var w = i[2] - i[0] ;(i[0] = -(w + i[0])), (i[2] = w - i[2]), (w = o[2] - o[0]), (o[0] = -(w + o[0])), (o[2] = w - o[2]), (a.x = 1 - (a.x + a.width)) } return r }), (U.prototype.computeMeshIndices_ = function (e, t) { for ( var n = new Uint16Array(2 * (e - 1) * (t - 1) * 6), r = e / 2, i = t / 2, o = 0, a = 0, s = 0; s < 2; s++ ) for (var l = 0; l < t; l++) for (var c = 0; c < e; c++, o++) 0 != c && 0 != l && (c <= r == l <= i ? ((n[a++] = o), (n[a++] = o - e - 1), (n[a++] = o - e), (n[a++] = o - e - 1), (n[a++] = o), (n[a++] = o - 1)) : ((n[a++] = o - 1), (n[a++] = o - e), (n[a++] = o), (n[a++] = o - e), (n[a++] = o - 1), (n[a++] = o - e - 1))) return n }), (U.prototype.getOwnPropertyDescriptor_ = function (e, t) { var n = Object.getOwnPropertyDescriptor(e, t) return ( (void 0 !== n.get && void 0 !== n.set) || ((n.configurable = !0), (n.enumerable = !0), (n.get = function () { return this.getAttribute(t) }), (n.set = function (e) { this.setAttribute(t, e) })), n ) }) var H = [ 'attribute vec2 position;', 'uniform mat4 projectionMat;', 'void main() {', ' gl_Position = projectionMat * vec4( position, -1.0, 1.0 );', '}', ].join('\n'), G = [ 'precision mediump float;', 'uniform vec4 color;', 'void main() {', ' gl_FragColor = color;', '}', ].join('\n'), z = Math.PI / 180, j = 60, V = 12, W = 20, q = 1, X = 0.75, Y = 0.3125, Q = 4, Z = 28, K = 1.5 function J(e) { ;(this.gl = e), (this.attribs = { position: 0 }), (this.program = E(e, H, G, this.attribs)), (this.uniforms = M(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 $(e) { this.coefficients = e } ;(J.prototype.destroy = function () { var e = this.gl this.listener && e.canvas.removeEventListener('click', this.listener, !1), e.deleteProgram(this.program), e.deleteBuffer(this.vertexBuffer) }), (J.prototype.listen = function (e, t) { var n = this.gl.canvas ;(this.listener = function (r) { var i = n.clientWidth / 2, o = Z * K r.clientX > i - o && r.clientX < i + o && r.clientY > n.clientHeight - o ? e(r) : r.clientX < o && r.clientY < o && t(r) }), n.addEventListener('click', this.listener, !1) }), (J.prototype.onResize = function () { var e = this.gl, t = this, n = [e.ARRAY_BUFFER_BINDING] F(e, n, function (e) { var n = [], r = e.drawingBufferWidth / 2, i = Math.max(screen.width, screen.height) * window.devicePixelRatio, o = (e.drawingBufferWidth / i) * window.devicePixelRatio, a = (Q * o) / 2, s = Z * K * o, l = (Z * o) / 2, c = (Z * K - Z) * o function u(e, t) { var i = (90 - e) * z, o = Math.cos(i), a = Math.sin(i) n.push(Y * o * l + r, Y * a * l + l), n.push(t * o * l + r, t * a * l + l) } n.push(r - a, s), n.push(r - a, e.drawingBufferHeight), n.push(r + a, s), n.push(r + a, e.drawingBufferHeight), (t.gearOffset = n.length / 2) for (var h = 0; h <= 6; h++) { var d = h * j u(d, q), u(d + V, q), u(d + W, X), u(d + (j - W), X), u(d + (j - V), q) } function p(t, r) { n.push(c + t, e.drawingBufferHeight - c - r) } ;(t.gearVertexCount = n.length / 2 - t.gearOffset), (t.arrowOffset = n.length / 2) var f = a / Math.sin(45 * z) p(0, l), p(l, 0), p(l + f, f), p(f, l + f), p(f, l - f), p(0, l), p(l, 2 * l), p(l + f, 2 * l - f), p(f, l - f), p(0, l), p(f, l - a), p(Z * o, l - a), p(f, l + a), p(Z * o, l + a), (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) }) }), (J.prototype.render = function () { var e = this.gl, t = this, n = [ 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, ] F(e, n, 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() }) }), (J.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), _( this.projMat, 0, e.drawingBufferWidth, 0, e.drawingBufferHeight, 0.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, ) }), ($.prototype.distortInverse = function (e) { for ( var t = 0, n = 1, r = e - this.distort(t); Math.abs(n - t) > 1e-4; ) { var i = e - this.distort(n), o = n - i * ((n - t) / (i - r)) ;(t = n), (n = o), (r = i) } return n }), ($.prototype.distort = function (e) { for (var t = e * e, n = 0, r = 0; r < this.coefficients.length; r++) n = t * (n + this.coefficients[r]) return (n + 1) * e }) var ee = Math.PI / 180, te = 180 / Math.PI, ne = function (e, t, n) { ;(this.x = e || 0), (this.y = t || 0), (this.z = n || 0) } ne.prototype = { constructor: ne, set: function (e, t, n) { return (this.x = e), (this.y = t), (this.z = n), 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, n = this.y, r = this.z, i = e.x, o = e.y, a = e.z, s = e.w, l = s * t + o * r - a * n, c = s * n + a * t - i * r, u = s * r + i * n - o * t, h = -i * t - o * n - a * r return ( (this.x = l * s + h * -i + c * -a - u * -o), (this.y = c * s + h * -o + u * -i - l * -a), (this.z = u * s + h * -a + l * -o - c * -i), this ) }, dot: function (e) { return this.x * e.x + this.y * e.y + this.z * e.z }, crossVectors: function (e, t) { var n = e.x, r = e.y, i = e.z, o = t.x, a = t.y, s = t.z return ( (this.x = r * s - i * a), (this.y = i * o - n * s), (this.z = n * a - r * o), this ) }, } var re = function (e, t, n, r) { ;(this.x = e || 0), (this.y = t || 0), (this.z = n || 0), (this.w = void 0 !== r ? r : 1) } function ie(e) { ;(this.width = e.width || y()), (this.height = e.height || b()), (this.widthMeters = e.widthMeters), (this.heightMeters = e.heightMeters), (this.bevelMeters = e.bevelMeters) } re.prototype = { constructor: re, set: function (e, t, n, r) { return (this.x = e), (this.y = t), (this.z = n), (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, n) { var r = Math.cos(e / 2), i = Math.cos(t / 2), o = Math.cos(n / 2), a = Math.sin(e / 2), s = Math.sin(t / 2), l = Math.sin(n / 2) return ( (this.x = a * i * o + r * s * l), (this.y = r * s * o - a * i * l), (this.z = r * i * l + a * s * o), (this.w = r * i * o - a * s * l), this ) }, setFromEulerYXZ: function (e, t, n) { var r = Math.cos(e / 2), i = Math.cos(t / 2), o = Math.cos(n / 2), a = Math.sin(e / 2), s = Math.sin(t / 2), l = Math.sin(n / 2) return ( (this.x = a * i * o + r * s * l), (this.y = r * s * o - a * i * l), (this.z = r * i * l - a * s * o), (this.w = r * i * o + a * s * l), this ) }, setFromAxisAngle: function (e, t) { var n = t / 2, r = Math.sin(n) return ( (this.x = e.x * r), (this.y = e.y * r), (this.z = e.z * r), (this.w = Math.cos(n)), this ) }, multiply: function (e) { return this.multiplyQuaternions(this, e) }, multiplyQuaternions: function (e, t) { var n = e.x, r = e.y, i = e.z, o = e.w, a = t.x, s = t.y, l = t.z, c = t.w return ( (this.x = n * c + o * a + r * l - i * s), (this.y = r * c + o * s + i * a - n * l), (this.z = i * c + o * l + n * s - r * a), (this.w = o * c - n * a - r * s - i * l), 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 n = this.x, r = this.y, i = this.z, o = this.w, a = o * e.w + n * e.x + r * e.y + i * e.z if ( (a < 0 ? ((this.w = -e.w), (this.x = -e.x), (this.y = -e.y), (this.z = -e.z), (a = -a)) : this.copy(e), a >= 1) ) return ( (this.w = o), (this.x = n), (this.y = r), (this.z = i), this ) var s = Math.acos(a), l = Math.sqrt(1 - a * a) if (Math.abs(l) < 0.001) return ( (this.w = 0.5 * (o + this.w)), (this.x = 0.5 * (n + this.x)), (this.y = 0.5 * (r + this.y)), (this.z = 0.5 * (i + this.z)), this ) var c = Math.sin((1 - t) * s) / l, u = Math.sin(t * s) / l return ( (this.w = o * c + this.w * u), (this.x = n * c + this.x * u), (this.y = r * c + this.y * u), (this.z = i * c + this.z * u), this ) }, setFromUnitVectors: (function () { var e, t, n = 1e-6 return function (r, i) { return ( void 0 === e && (e = new ne()), (t = r.dot(i) + 1) < n ? ((t = 0), Math.abs(r.x) > Math.abs(r.z) ? e.set(-r.y, r.x, 0) : e.set(0, -r.z, r.y)) : e.crossVectors(r, i), (this.x = e.x), (this.y = e.y), (this.z = e.z), (this.w = t), this.normalize(), this ) } })(), } var oe = new ie({ widthMeters: 0.11, heightMeters: 0.062, bevelMeters: 0.004, }), ae = new ie({ widthMeters: 0.1038, heightMeters: 0.0584, bevelMeters: 0.004, }), se = { CardboardV1: new ce({ id: 'CardboardV1', label: 'Cardboard I/O 2014', fov: 40, interLensDistance: 0.06, baselineLensDistance: 0.035, screenLensDistance: 0.042, distortionCoefficients: [0.441, 0.156], inverseCoefficients: [ -0.4410035, 0.42756155, -0.4804439, 0.5460139, -0.58821183, 0.5733938, -0.48303202, 0.33299083, -0.17573841, 0.0651772, -0.01488963, 0.001559834, ], }), CardboardV2: new ce({ id: 'CardboardV2', label: 'Cardboard I/O 2015', fov: 60, interLensDistance: 0.064, baselineLensDistance: 0.035, screenLensDistance: 0.039, distortionCoefficients: [0.34, 0.55], inverseCoefficients: [ -0.33836704, -0.18162185, 0.862655, -1.2462051, 1.0560602, -0.58208317, 0.21609078, -0.05444823, 0.009177956, -0.0009904169, 6183535e-11, -16981803e-13, ], }), } function le(e, t) { ;(this.viewer = se.CardboardV2), this.updateDeviceParams(e), (this.distortion = new $(this.viewer.distortionCoefficients)) for (var n = 0; n < t.length; n++) { var r = t[n] se[r.id] = new ce(r) } } function ce(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) } ;(le.prototype.updateDeviceParams = function (e) { this.device = this.determineDevice_(e) || this.device }), (le.prototype.getDevice = function () { return this.device }), (le.prototype.setViewer = function (e) { ;(this.viewer = e), (this.distortion = new $(this.viewer.distortionCoefficients)) }), (le.prototype.determineDevice_ = function (e) { if (!e) return l() ? (console.warn('Using fallback iOS device measurements.'), ae) : (console.warn('Using fallback Android device measurements.'), oe) var t = 0.0254, n = t / e.xdpi, r = t / e.ydpi return new ie({ widthMeters: n * y(), heightMeters: r * b(), bevelMeters: 0.001 * e.bevelMm, }) }), (le.prototype.getDistortedFieldOfViewLeftEye = function () { var e = this.viewer, t = this.device, n = this.distortion, r = e.screenLensDistance, i = (t.widthMeters - e.interLensDistance) / 2, o = e.interLensDistance / 2, a = e.baselineLensDistance - t.bevelMeters, s = t.heightMeters - a, l = te * Math.atan(n.distort(i / r)), c = te * Math.atan(n.distort(o / r)), u = te * Math.atan(n.distort(a / r)), h = te * Math.atan(n.distort(s / r)) return { leftDegrees: Math.min(l, e.fov), rightDegrees: Math.min(c, e.fov), downDegrees: Math.min(u, e.fov), upDegrees: Math.min(h, e.fov), } }), (le.prototype.getLeftEyeVisibleTanAngles = function () { var e = this.viewer, t = this.device, n = this.distortion, r = Math.tan(-ee * e.fov), i = Math.tan(ee * e.fov), o = Math.tan(ee * e.fov), a = Math.tan(-ee * e.fov), s = t.widthMeters / 4, l = t.heightMeters / 2, c = e.baselineLensDistance - t.bevelMeters - l, u = e.interLensDistance / 2 - s, h = -c, d = e.screenLensDistance, p = n.distort((u - s) / d), f = n.distort((h + l) / d), m = n.distort((u + s) / d), v = n.distort((h - l) / d), g = new Float32Array(4) return ( (g[0] = Math.max(r, p)), (g[1] = Math.min(i, f)), (g[2] = Math.min(o, m)), (g[3] = Math.max(a, v)), g ) }), (le.prototype.getLeftEyeNoLensTanAngles = function () { var e = this.viewer, t = this.device, n = this.distortion, r = new Float32Array(4), i = n.distortInverse(Math.tan(-ee * e.fov)), o = n.distortInverse(Math.tan(ee * e.fov)), a = n.distortInverse(Math.tan(ee * e.fov)), s = n.distortInverse(Math.tan(-ee * e.fov)), l = t.widthMeters / 4, c = t.heightMeters / 2, u = e.baselineLensDistance - t.bevelMeters - c, h = e.interLensDistance / 2 - l, d = -u, p = e.screenLensDistance, f = (h - l) / p, m = (d + c) / p, v = (h + l) / p, g = (d - c) / p return ( (r[0] = Math.max(i, f)), (r[1] = Math.min(o, m)), (r[2] = Math.min(a, v)), (r[3] = Math.max(s, g)), r ) }), (le.prototype.getLeftEyeVisibleScreenRect = function (e) { var t = this.viewer, n = this.device, r = t.screenLensDistance, i = (n.widthMeters - t.interLensDistance) / 2, o = t.baselineLensDistance - n.bevelMeters, a = (e[0] * r + i) / n.widthMeters, s = (e[1] * r + o) / n.heightMeters, l = (e[2] * r + i) / n.widthMeters, c = (e[3] * r + o) / n.heightMeters return { x: a, y: c, width: l - a, height: s - c } }), (le.prototype.getFieldOfViewLeftEye = function (e) { return e ? this.getUndistortedFieldOfViewLeftEye() : this.getDistortedFieldOfViewLeftEye() }), (le.prototype.getFieldOfViewRightEye = function (e) { var t = this.getFieldOfViewLeftEye(e) return { leftDegrees: t.rightDegrees, rightDegrees: t.leftDegrees, upDegrees: t.upDegrees, downDegrees: t.downDegrees, } }), (le.prototype.getUndistortedFieldOfViewLeftEye = function () { var e = this.getUndistortedParams_() return { leftDegrees: te * Math.atan(e.outerDist), rightDegrees: te * Math.atan(e.innerDist), downDegrees: te * Math.atan(e.bottomDist), upDegrees: te * Math.atan(e.topDist), } }), (le.prototype.getUndistortedViewportLeftEye = function () { var e = this.getUndistortedParams_(), t = this.viewer, n = this.device, r = t.screenLensDistance, i = n.widthMeters / r, o = n.heightMeters / r, a = n.width / i, s = n.height / o, l = Math.round((e.eyePosX - e.outerDist) * a), c = Math.round((e.eyePosY - e.bottomDist) * s) return { x: l, y: c, width: Math.round((e.eyePosX + e.innerDist) * a) - l, height: Math.round((e.eyePosY + e.topDist) * s) - c, } }), (le.prototype.getUndistortedParams_ = function () { var e = this.viewer, t = this.device, n = this.distortion, r = e.screenLensDistance, i = e.interLensDistance / 2 / r, o = t.widthMeters / r, a = t.heightMeters / r, s = o / 2 - i, l = (e.baselineLensDistance - t.bevelMeters) / r, c = e.fov, u = n.distortInverse(Math.tan(ee * c)), h = Math.min(s, u), d = Math.min(i, u), p = Math.min(l, u) return { outerDist: h, innerDist: d, topDist: Math.min(a - l, u), bottomDist: p, eyePosX: s, eyePosY: l, } }), (le.Viewers = se) var ue = { format: 1, last_updated: '2019-11-09T17:36:14Z', devices: [ { type: 'android', rules: [{ mdmh: 'asus/*/Nexus 7/*' }, { ua: 'Nexus 7' }], dpi: [320.8, 323], bw: 3, ac: 500, }, { type: 'android', rules: [{ mdmh: 'asus/*/ASUS_X00PD/*' }, { ua: 'ASUS_X00PD' }], dpi: 245, bw: 3, ac: 500, }, { type: 'android', rules: [{ mdmh: 'asus/*/ASUS_X008D/*' }, { ua: 'ASUS_X008D' }], dpi: 282, 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 E1001/*' }, { ua: 'ONE E1001' }], dpi: [442.4, 441.4], bw: 3, ac: 1e3, }, { type: 'android', rules: [{ mdmh: 'OnePlus/*/ONE E1003/*' }, { ua: 'ONE E1003' }], dpi: [442.4, 441.4], 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 A2001/*' }, { ua: 'ONE A2001' }], dpi: [391.9, 405.4], bw: 3, ac: 1e3, }, { type: 'android', rules: [{ mdmh: 'OnePlus/*/ONE A2003/*' }, { ua: 'ONE A2003' }], dpi: [391.9, 405.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 A3000/*' }, { ua: 'ONEPLUS A3000' }, ], dpi: 401, bw: 3, ac: 500, }, { type: 'android', rules: [ { mdmh: 'OnePlus/*/ONEPLUS A3003/*' }, { ua: 'ONEPLUS A3003' }, ], dpi: 401, bw: 3, ac: 500, }, { type: 'android', rules: [ { mdmh: 'OnePlus/*/ONEPLUS A3010/*' }, { ua: 'ONEPLUS A3010' }, ], dpi: 401, bw: 3, ac: 500, }, { 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: 'OnePlus/*/ONEPLUS A6000/*' }, { ua: 'ONEPLUS A6000' }, ], dpi: 401, bw: 3, ac: 500, }, { type: 'android', rules: [ { mdmh: 'OnePlus/*/ONEPLUS A6003/*' }, { ua: 'ONEPLUS A6003' }, ], dpi: 401, bw: 3, ac: 500, }, { type: 'android', rules: [ { mdmh: 'OnePlus/*/ONEPLUS A6010/*' }, { ua: 'ONEPLUS A6010' }, ], dpi: 401, bw: 2, ac: 500, }, { type: 'android', rules: [ { mdmh: 'OnePlus/*/ONEPLUS A6013/*' }, { ua: 'ONEPLUS A6013' }, ], dpi: 401, bw: 2, ac: 500, }, { 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: 'samsung/*/SM-G960F/*' }, { ua: 'SM-G960F' }], dpi: [569.575, 571.5], bw: 3, ac: 1e3, }, { type: 'android', rules: [{ mdmh: 'samsung/*/SM-G9600/*' }, { ua: 'SM-G9600' }], dpi: [569.575, 571.5], bw: 3, ac: 1e3, }, { type: 'android', rules: [{ mdmh: 'samsung/*/SM-G960T/*' }, { ua: 'SM-G960T' }], dpi: [569.575, 571.5], bw: 3, ac: 1e3, }, { type: 'android', rules: [{ mdmh: 'samsung/*/SM-G960N/*' }, { ua: 'SM-G960N' }], dpi: [569.575, 571.5], bw: 3, ac: 1e3, }, { type: 'android', rules: [{ mdmh: 'samsung/*/SM-G960U/*' }, { ua: 'SM-G960U' }], dpi: [569.575, 571.5], bw: 3, ac: 1e3, }, { type: 'android', rules: [{ mdmh: 'samsung/*/SM-G9608/*' }, { ua: 'SM-G9608' }], dpi: [569.575, 571.5], bw: 3, ac: 1e3, }, { type: 'android', rules: [{ mdmh: 'samsung/*/SM-G960FD/*' }, { ua: 'SM-G960FD' }], dpi: [569.575, 571.5], bw: 3, ac: 1e3, }, { type: 'android', rules: [{ mdmh: 'samsung/*/SM-G960W/*' }, { ua: 'SM-G960W' }], dpi: [569.575, 571.5], bw: 3, ac: 1e3, }, { type: 'android', rules: [{ mdmh: 'samsung/*/SM-G965F/*' }, { ua: 'SM-G965F' }], dpi: 529, bw: 2, ac: 1e3, }, { 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, }, { type: 'android', rules: [{ mdmh: 'Huawei/*/EML-L29/*' }, { ua: 'EML-L29' }], dpi: 428, bw: 3.45, ac: 500, }, { type: 'android', rules: [{ mdmh: 'Nokia/*/Nokia 7.1/*' }, { ua: 'Nokia 7.1' }], dpi: [432, 431.9], bw: 3, ac: 500, }, { type: 'ios', rules: [{ res: [1242, 2688] }], dpi: 458, bw: 4, ac: 1e3, }, { type: 'android', rules: [{ mdmh: 'samsung/*/SM-G570M/*' }, { ua: 'SM-G570M' }], dpi: 320, bw: 3.684, ac: 1e3, }, { type: 'android', rules: [{ mdmh: 'samsung/*/SM-G970F/*' }, { ua: 'SM-G970F' }], dpi: 438, bw: 2.281, ac: 500, }, { type: 'android', rules: [{ mdmh: 'samsung/*/SM-G973F/*' }, { ua: 'SM-G973F' }], dpi: 550, bw: 2.002, ac: 500, }, { type: 'android', rules: [{ mdmh: 'samsung/*/SM-G975F/*' }, { ua: 'SM-G975F' }], dpi: 522, bw: 2.054, ac: 500, }, { type: 'android', rules: [{ mdmh: 'samsung/*/SM-G977F/*' }, { ua: 'SM-G977F' }], dpi: 505, bw: 2.334, ac: 500, }, { type: 'ios', rules: [{ res: [828, 1792] }], dpi: 326, bw: 5, ac: 500, }, ], } function he(e, t) { if (((this.dpdb = ue), this.recalculateDeviceParams_(), e)) { this.onDeviceParamsUpdated = t var n = new XMLHttpRequest(), r = this n.open('GET', e, !0), n.addEventListener('load', function () { ;(r.loading = !1), n.status >= 200 && n.status <= 299 ? ((r.dpdb = JSON.parse(n.response)), r.recalculateDeviceParams_()) : console.error('Error loading online DPDB!') }), n.send() } } function de(e) { ;(this.xdpi = e.xdpi), (this.ydpi = e.ydpi), (this.bevelMm = e.bevelMm) } function pe(e, t) { this.set(e, t) } function fe(e, t) { ;(this.kFilter = e), (this.isDebug = t), (this.currentAccelMeasurement = new pe()), (this.currentGyroMeasurement = new pe()), (this.previousGyroMeasurement = new pe()), l() ? (this.filterQ = new re(-1, 0, 0, 1)) : (this.filterQ = new re(1, 0, 0, 1)), (this.previousFilterQ = new re()), this.previousFilterQ.copy(this.filterQ), (this.accelQ = new re()), (this.isOrientationInitialized = !1), (this.estimatedGravity = new ne()), (this.measuredGravity = new ne()), (this.gyroIntegralQ = new re()) } function me(e, t) { ;(this.predictionTimeS = e), (this.isDebug = t), (this.previousQ = new re()), (this.previousTimestampS = null), (this.deltaQ = new re()), (this.outQ = new re()) } function ve(e, t, n, r) { ;(this.yawOnly = n), (this.accelerometer = new ne()), (this.gyroscope = new ne()), (this.filter = new fe(e, r)), (this.posePredictor = new me(t, r)), (this.isFirefoxAndroid = h()), (this.isIOS = l()) var i = d() ;(this.isDeviceMotionInRadians = !this.isIOS && i && i < 66), (this.isWithoutDeviceMotion = f() || p()), (this.filterToWorldQ = new re()), l() ? this.filterToWorldQ.setFromAxisAngle( new ne(1, 0, 0), Math.PI / 2, ) : this.filterToWorldQ.setFromAxisAngle( new ne(1, 0, 0), -Math.PI / 2, ), (this.inverseWorldToScreenQ = new re()), (this.worldToScreenQ = new re()), (this.originalPoseAdjustQ = new re()), this.originalPoseAdjustQ.setFromAxisAngle( new ne(0, 0, 1), (-window.orientation * Math.PI) / 180, ), this.setScreenTransform_(), v() && this.filterToWorldQ.multiply(this.inverseWorldToScreenQ), (this.resetQ = new re()), (this.orientationOut_ = new Float32Array(4)), this.start() } ;(he.prototype.getDeviceParams = function () { return this.deviceParams }), (he.prototype.recalculateDeviceParams_ = function () { var e = this.calcDeviceParams_() e ? ((this.deviceParams = e), this.onDeviceParamsUpdated && this.onDeviceParamsUpdated(this.deviceParams)) : console.error('Failed to recalculate device parameters.') }), (he.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, n = y(), r = b() if (!e.devices) return console.error('DPDB has no devices section.'), null for (var i = 0; i < e.devices.length; i++) { var o = e.devices[i] if (o.rules) if ('ios' == o.type || 'android' == o.type) { if (l() == ('ios' == o.type)) { for (var a = !1, s = 0; s < o.rules.length; s++) { var c = o.rules[s] if (this.ruleMatches_(c, t, n, r)) { a = !0 break } } if (a) return new de({ xdpi: o.dpi[0] || o.dpi, ydpi: o.dpi[1] || o.dpi, bevelMm: o.bw, }) } } else console.warn('Device[' + i + '] has invalid type.') else console.warn('Device[' + i + '] has no rules section.') } return console.warn('No DPDB device match.'), null }), (he.prototype.ruleMatches_ = function (e, t, n, 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 i = e.res[0], o = e.res[1] if ( Math.min(n, r) != Math.min(i, o) || Math.max(n, r) != Math.max(i, o) ) return !1 } return !0 }), (pe.prototype.set = function (e, t) { ;(this.sample = e), (this.timestampS = t) }), (pe.prototype.copy = function (e) { this.set(e.sample, e.timestampS) }), (fe.prototype.addAccelMeasurement = function (e, t) { this.currentAccelMeasurement.set(e, t) }), (fe.prototype.addGyroMeasurement = function (e, t) { this.currentGyroMeasurement.set(e, t) var n = t - this.previousGyroMeasurement.timestampS g(n) && this.run_(), this.previousGyroMeasurement.copy(this.currentGyroMeasurement) }), (fe.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 n = new re() n.copy(this.filterQ), n.inverse(), this.estimatedGravity.set(0, 0, -1), this.estimatedGravity.applyQuaternion(n), this.estimatedGravity.normalize(), this.measuredGravity.copy(this.currentAccelMeasurement.sample), this.measuredGravity.normalize() var r = new re() 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)', te * D(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 i = new re() i.copy(this.filterQ), i.multiply(r), this.filterQ.slerp(i, 1 - this.kFilter), this.previousFilterQ.copy(this.filterQ) }), (fe.prototype.getOrientation = function () { return this.filterQ }), (fe.prototype.accelToQuaternion_ = function (e) { var t = new ne() t.copy(e), t.normalize() var n = new re() return n.setFromUnitVectors(new ne(0, 0, -1), t), n.inverse(), n }), (fe.prototype.gyroToQuaternionDelta_ = function (e, t) { var n = new re(), r = new ne() return ( r.copy(e), r.normalize(), n.setFromAxisAngle(r, e.length() * t), n ) }), (me.prototype.getPrediction = function (e, t, n) { if (!this.previousTimestampS) return this.previousQ.copy(e), (this.previousTimestampS = n), e var r = new ne() r.copy(t), r.normalize() var i = t.length() if (i < 20 * ee) return ( this.isDebug && console.log( 'Moving slowly, at %s deg/s: no prediction', (te * i).toFixed(1), ), this.outQ.copy(e), this.previousQ.copy(e), this.outQ ) var o = i * this.predictionTimeS return ( this.deltaQ.setFromAxisAngle(r, o), this.outQ.copy(this.previousQ), this.outQ.multiply(this.deltaQ), this.previousQ.copy(e), (this.previousTimestampS = n), this.outQ ) }), (ve.prototype.getPosition = function () { return null }), (ve.prototype.getOrientation = function () { var e = void 0 if (this.isWithoutDeviceMotion && this._deviceOrientationQ) return ( (this.deviceOrientationFixQ = this.deviceOrientationFixQ || (function () { var e = new re().setFromAxisAngle(new ne(0, 0, -1), 0), t = new re() return ( -90 === window.orientation ? t.setFromAxisAngle(new ne(0, 1, 0), Math.PI / -2) : t.setFromAxisAngle(new ne(0, 1, 0), Math.PI / 2), e.multiply(t) ) })()), (this.deviceOrientationFilterToWorldQ = this.deviceOrientationFilterToWorldQ || (function () { var e = new re() return e.setFromAxisAngle(new ne(1, 0, 0), -Math.PI / 2), e })()), (e = this._deviceOrientationQ), (t = new re()).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 t, n = this.filter.getOrientation() return ( (e = this.posePredictor.getPrediction( n, this.gyroscope, this.previousTimestampS, )), (t = new re()).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_ ) }), (ve.prototype.resetPose = function () { this.resetQ.copy(this.filter.getOrientation()), (this.resetQ.x = 0), (this.resetQ.y = 0), (this.resetQ.z *= -1), this.resetQ.normalize(), v() && this.resetQ.multiply(this.inverseWorldToScreenQ), this.resetQ.multiply(this.originalPoseAdjustQ) }), (ve.prototype.onDeviceOrientation_ = function (e) { this._deviceOrientationQ = this._deviceOrientationQ || new re() var t = e.alpha, n = e.beta, r = e.gamma ;(t = ((t || 0) * Math.PI) / 180), (n = ((n || 0) * Math.PI) / 180), (r = ((r || 0) * Math.PI) / 180), this._deviceOrientationQ.setFromEulerYXZ(n, t, -r) }), (ve.prototype.onDeviceMotion_ = function (e) { this.updateDeviceMotion_(e) }), (ve.prototype.updateDeviceMotion_ = function (e) { var t = e.accelerationIncludingGravity, n = e.rotationRate, r = e.timeStamp / 1e3, a = r - this.previousTimestampS return a < 0 ? (O( 'fusion-pose-sensor:invalid:non-monotonic', 'Invalid timestamps detected: non-monotonic timestamp from devicemotion', ), void (this.previousTimestampS = r)) : a <= i || a > o ? (O( '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), n && (m() ? this.gyroscope.set(-n.beta, n.alpha, n.gamma) : this.gyroscope.set(n.alpha, n.beta, n.gamma), this.isDeviceMotionInRadians || this.gyroscope.multiplyScalar(Math.PI / 180), this.filter.addGyroMeasurement(this.gyroscope, r)), this.filter.addAccelMeasurement(this.accelerometer, r), void (this.previousTimestampS = r)) }), (ve.prototype.onOrientationChange_ = function (e) { this.setScreenTransform_() }), (ve.prototype.onMessage_ = function (e) { var t = e.data t && t.type && 'devicemotion' === t.type.toLowerCase() && this.updateDeviceMotion_(t.deviceMotionEvent) }), (ve.prototype.setScreenTransform_ = function () { switch ((this.worldToScreenQ.set(0, 0, 0, 1), window.orientation)) { case 0: break case 90: this.worldToScreenQ.setFromAxisAngle( new ne(0, 0, 1), -Math.PI / 2, ) break case -90: this.worldToScreenQ.setFromAxisAngle( new ne(0, 0, 1), Math.PI / 2, ) } this.inverseWorldToScreenQ.copy(this.worldToScreenQ), this.inverseWorldToScreenQ.inverse() }), (ve.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)), l() && R() && window.addEventListener('message', this.onMessageCallback_), window.addEventListener( 'orientationchange', this.onOrientationChangeCallback_, ), this.isWithoutDeviceMotion ? window.addEventListener( 'deviceorientation', this.onDeviceOrientationCallback_, ) : window.addEventListener( 'devicemotion', this.onDeviceMotionCallback_, ) }), (ve.prototype.stop = function () { window.removeEventListener( 'devicemotion', this.onDeviceMotionCallback_, ), window.removeEventListener( 'deviceorientation', this.onDeviceOrientationCallback_, ), window.removeEventListener( 'orientationchange', this.onOrientationChangeCallback_, ), window.removeEventListener('message', this.onMessageCallback_) }) var ge = 60, ye = new ne(1, 0, 0), be = new ne(0, 0, 1), Ae = new re() Ae.setFromAxisAngle(ye, -Math.PI / 2), Ae.multiply(new re().setFromAxisAngle(be, Math.PI / 2)) var we = (function () { function t(n) { e(this, t), (this.config = n), (this.sensor = null), (this.fusionSensor = null), (this._out = new Float32Array(4)), (this.api = null), (this.errors = []), (this._sensorQ = new re()), (this._outQ = new re()), (this._onSensorRead = this._onSensorRead.bind(this)), (this._onSensorError = this._onSensorError.bind(this)), this.init() } return ( n(t, [ { key: 'init', value: function () { var e = null try { ;(e = new RelativeOrientationSensor({ frequency: ge, referenceFrame: 'screen', })).addEventListener('error', this._onSensorError) } catch (t) { this.errors.push(t), 'SecurityError' === t.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' === t.name ? this.useDeviceMotion() : console.error(t) } 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 ve( 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(Ae), 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 () {} }, ]), t ) })(), xe = "" function Ee() { this.loadIcon_() var e = document.createElement('div') ;((o = e.style).position = 'fixed'), (o.top = 0), (o.right = 0), (o.bottom = 0), (o.left = 0), (o.backgroundColor = 'gray'), (o.fontFamily = 'sans-serif'), (o.zIndex = 1e6) var t = document.createElement('img') ;(t.src = this.icon), ((o = t.style).marginLeft = '25%'), (o.marginTop = '25%'), (o.width = '50%'), e.appendChild(t) var n = document.createElement('div') ;((o = n.style).textAlign = 'center'), (o.fontSize = '16px'), (o.lineHeight = '24px'), (o.margin = '24px 25%'), (o.width = '50%'), (n.innerHTML = 'Place your phone into your Cardboard viewer.'), e.appendChild(n) var r = document.createElement('div') ;((o = r.style).backgroundColor = '#CFD8DC'), (o.position = 'fixed'), (o.bottom = 0), (o.width = '100%'), (o.height = '48px'), (o.padding = '14px 24px'), (o.boxSizing = 'border-box'), (o.color = '#656A6B'), e.appendChild(r) var i = document.createElement('div') ;(i.style.float = 'left'), (i.innerHTML = 'No Cardboard viewer?') var o, a = document.createElement('a') ;(a.href = 'https://www.google.com/get/cardboard/get-cardboard/'), (a.innerHTML = 'get one'), (a.target = '_blank'), ((o = a.style).float = 'right'), (o.fontWeight = 600), (o.textTransform = 'uppercase'), (o.borderLeft = '1px solid gray'), (o.paddingLeft = '24px'), (o.textDecoration = 'none'), (o.color = '#656A6B'), r.appendChild(i), r.appendChild(a), (this.overlay = e), (this.text = n), this.hide() } ;(Ee.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').style v() ? ((t.width = '20%'), (t.marginLeft = '40%'), (t.marginTop = '3%')) : ((t.width = '50%'), (t.marginLeft = '25%'), (t.marginTop = '25%')) }), (Ee.prototype.hide = function () { this.overlay.style.display = 'none' }), (Ee.prototype.showTemporarily = function (e, t) { this.show(t), (this.timer = setTimeout(this.hide.bind(this), e)) }), (Ee.prototype.disableShowTemporarily = function () { clearTimeout(this.timer) }), (Ee.prototype.update = function () { this.disableShowTemporarily(), !v() && T() ? this.show() : this.hide() }), (Ee.prototype.loadIcon_ = function () { this.icon = a('image/svg+xml', xe) }) var Me = 'CardboardV1', _e = 'WEBVR_CARDBOARD_VIEWER', Te = 'webvr-polyfill-viewer-selector' function Se(e) { try { this.selectedKey = localStorage.getItem(_e) } catch (t) { console.error('Failed to load viewer profile: %s', t) } this.selectedKey || (this.selectedKey = e || Me), (this.dialog = this.createDialog_(le.Viewers)), (this.root = null), (this.onChangeCallbacks_ = []) } function Ce(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, 'default') ? e.default : e } function Le(e, t) { return e((t = { exports: {} }), t.exports), t.exports } ;(Se.prototype.show = function (e) { ;(this.root = e), e.appendChild(this.dialog), (this.dialog.querySelector('#' + this.selectedKey).checked = !0), (this.dialog.style.display = 'block') }), (Se.prototype.hide = function () { this.root && this.root.contains(this.dialog) && this.root.removeChild(this.dialog), (this.dialog.style.display = 'none') }), (Se.prototype.getCurrentViewer = function () { return le.Viewers[this.selectedKey] }), (Se.prototype.getSelectedKey_ = function () { var e = this.dialog.querySelector('input[name=field]:checked') return e ? e.id : null }), (Se.prototype.onChange = function (e) { this.onChangeCallbacks_.push(e) }), (Se.prototype.fireOnChange_ = function (e) { for (var t = 0; t < this.onChangeCallbacks_.length; t++) this.onChangeCallbacks_[t](e) }), (Se.prototype.onSave_ = function () { if ( ((this.selectedKey = this.getSelectedKey_()), this.selectedKey && le.Viewers[this.selectedKey]) ) { this.fireOnChange_(le.Viewers[this.selectedKey]) try { localStorage.setItem(_e, this.selectedKey) } catch (e) { console.error('Failed to save viewer profile: %s', e) } this.hide() } else console.error('ViewerSelector.onSave_: this should never happen!') }), (Se.prototype.createDialog_ = function (e) { var t = document.createElement('div') t.classList.add(Te), (t.style.display = 'none') var n = document.createElement('div') ;((o = n.style).position = 'fixed'), (o.left = 0), (o.top = 0), (o.width = '100%'), (o.height = '100%'), (o.background = 'rgba(0, 0, 0, 0.3)'), n.addEventListener('click', this.hide.bind(this)) var r = 280, i = document.createElement('div'), o = i.style for (var a in ((o.boxSizing = 'border-box'), (o.position = 'fixed'), (o.top = '24px'), (o.left = '50%'), (o.marginLeft = -r / 2 + 'px'), (o.width = r + 'px'), (o.padding = '24px'), (o.overflow = 'hidden'), (o.background = '#fafafa'), (o.fontFamily = "'Roboto', sans-serif"), (o.boxShadow = '0px 5px 20px #666'), i.appendChild(this.createH1_('Select your viewer')), e)) i.appendChild(this.createChoice_(a, e[a].label)) return ( i.appendChild( this.createButton_('Save', this.onSave_.bind(this)), ), t.appendChild(n), t.appendChild(i), t ) }), (Se.prototype.createH1_ = function (e) { var t = document.createElement('h1'), n = t.style return ( (n.color = 'black'), (n.fontSize = '20px'), (n.fontWeight = 'bold'), (n.marginTop = 0), (n.marginBottom = '24px'), (t.innerHTML = e), t ) }), (Se.prototype.createChoice_ = function (e, t) { var n = document.createElement('div') ;(n.style.marginTop = '8px'), (n.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 i = document.createElement('label') return ( (i.style.marginLeft = '4px'), i.setAttribute('for', e), (i.innerHTML = t), n.appendChild(r), n.appendChild(i), n ) }), (Se.prototype.createButton_ = function (e, t) { var n = document.createElement('button') n.innerHTML = e var r = n.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'), n.addEventListener('click', t), n ) }), 'undefined' !== typeof window ? window : 'undefined' !== typeof t || ('undefined' !== typeof self && self) var Re = Ce( Le(function (e, t) { var n ;(n = function () { return (function (e) { var t = {} function n(r) { if (t[r]) return t[r].exports var i = (t[r] = { i: r, l: !1, exports: {} }) return ( e[r].call(i.exports, i, i.exports, n), (i.l = !0), i.exports ) } return ( (n.m = e), (n.c = t), (n.d = function (e, t, r) { n.o(e, t) || Object.defineProperty(e, t, { configurable: !1, enumerable: !0, get: r, }) }), (n.n = function (e) { var t = e && e.__esModule ? function () { return e.default } : function () { return e } return n.d(t, 'a', t), t }), (n.o = function (e, t) { return Object.prototype.hasOwnProperty.call(e, t) }), (n.p = ''), n((n.s = 0)) ) })([ function (e, t, n) { var r = (function () { function e(e, t) { for (var n = 0; n < t.length; n++) { var r = t[n] ;(r.enumerable = r.enumerable || !1), (r.configurable = !0), 'value' in r && (r.writable = !0), Object.defineProperty(e, r.key, r) } } return function (t, n, r) { return n && e(t.prototype, n), r && e(t, r), t } })() function i(e, t) { if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function') } var o = n(1), a = '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, s = (function () { function e() { i(this, e), a ? (this.noSleepTimer = null) : ((this.noSleepVideo = document.createElement('video')), this.noSleepVideo.setAttribute( 'playsinline', '', ), this.noSleepVideo.setAttribute('src', o), this.noSleepVideo.addEventListener( 'timeupdate', function (e) { this.noSleepVideo.currentTime > 0.5 && (this.noSleepVideo.currentTime = Math.random()) }.bind(this), )) } return ( r(e, [ { key: 'enable', value: function () { a ? (this.disable(), (this.noSleepTimer = window.setInterval( function () { ;(window.location.href = '/'), window.setTimeout(window.stop, 0) }, 15e3, ))) : this.noSleepVideo.play() }, }, { key: 'disable', value: function () { a ? this.noSleepTimer && (window.clearInterval(this.noSleepTimer), (this.noSleepTimer = null)) : this.noSleepVideo.pause() }, }, ]), e ) })() e.exports = s }, function (e, t, n) { 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=' }, ]) }), (e.exports = n()) }), ), Pe = 1e3, De = [0, 0, 0.5, 1], Oe = [0.5, 0, 0.5, 1], Ie = window.requestAnimationFrame, Be = window.cancelAnimationFrame function Fe() { ;(this.leftProjectionMatrix = new Float32Array(16)), (this.leftViewMatrix = new Float32Array(16)), (this.rightProjectionMatrix = new Float32Array(16)), (this.rightViewMatrix = new Float32Array(16)), (this.pose = null) } function ke(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 ( I( 'VRDisplayCapabilities.prototype.hasOrientation', 'VRDisplay.prototype.getFrameData', ), e.hasOrientation ) }, }, }) } function Ne(e) { var t = !('wakelock' in (e = e || {})) || e.wakelock ;(this.isPolyfilled = !0), (this.displayId = Pe++), (this.displayName = ''), (this.depthNear = 0.01), (this.depthFar = 1e4), (this.isPresenting = !1), Object.defineProperty(this, 'isConnected', { get: function () { return ( I( 'VRDisplay.prototype.isConnected', 'VRDisplayCapabilities.prototype.hasExternalDisplay', ), !1 ) }, }), (this.capabilities = new ke({ 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 && T() && (this.wakelock_ = new Re()) } ;(Ne.prototype.getFrameData = function (e) { return L(e, this._getPose(), this) }), (Ne.prototype.getPose = function () { return ( I( 'VRDisplay.prototype.getPose', 'VRDisplay.prototype.getFrameData', ), this._getPose() ) }), (Ne.prototype.resetPose = function () { return I('VRDisplay.prototype.resetPose'), this._resetPose() }), (Ne.prototype.getImmediatePose = function () { return ( I( 'VRDisplay.prototype.getImmediatePose', 'VRDisplay.prototype.getFrameData', ), this._getPose() ) }), (Ne.prototype.requestAnimationFrame = function (e) { return Ie(e) }), (Ne.prototype.cancelAnimationFrame = function (e) { return Be(e) }), (Ne.prototype.wrapForFullscreen = function (e) { if (l()) 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 n = this.fullscreenElement_.parentElement n.insertBefore(this.fullscreenWrapper_, this.fullscreenElement_), n.removeChild(this.fullscreenElement_) } this.fullscreenWrapper_.insertBefore( this.fullscreenElement_, this.fullscreenWrapper_.firstChild, ), (this.fullscreenElementCachedStyle_ = this.fullscreenElement_.getAttribute('style')) var r = this function i() { 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('; ') + ';') } } return i(), this.fullscreenWrapper_ }), (Ne.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 ) } }), (Ne.prototype.requestPresent = function (e) { var t = this.isPresenting, n = this return ( e instanceof Array || (I( 'VRDisplay.prototype.requestPresent with non-array argument', 'an array of VRLayers as the first argument', ), (e = [e])), new Promise(function (r, i) { if (n.capabilities.canPresent) if (0 == e.length || e.length > n.capabilities.maxLayers) i(new Error('Invalid number of layers.')) else { var o = e[0] if (o.source) { var a = o.leftBounds || De, s = o.rightBounds || Oe if (t) { var u = n.layer_ u.source !== o.source && (u.source = o.source) for (var h = 0; h < 4; h++) (u.leftBounds[h] = a[h]), (u.rightBounds[h] = s[h]) return ( n.wrapForFullscreen(n.layer_.source), n.updatePresent_(), void r() ) } if ( ((n.layer_ = { predistorted: o.predistorted, source: o.source, leftBounds: a.slice(0), rightBounds: s.slice(0), }), (n.waitingForPresent_ = !1), n.layer_ && n.layer_.source) ) { var d = n.wrapForFullscreen(n.layer_.source), p = function () { var e = x() ;(n.isPresenting = d === e), n.isPresenting ? (screen.orientation && screen.orientation.lock && screen.orientation .lock('landscape-primary') .catch(function (e) { console.error( 'screen.orientation.lock() failed due to', e.message, ) }), (n.waitingForPresent_ = !1), n.beginPresent_(), r()) : (screen.orientation && screen.orientation.unlock && screen.orientation.unlock(), n.removeFullscreenWrapper(), n.disableWakeLock(), n.endPresent_(), n.removeFullscreenListeners_()), n.fireVRDisplayPresentChange_() }, f = function () { n.waitingForPresent_ && (n.removeFullscreenWrapper(), n.removeFullscreenListeners_(), n.disableWakeLock(), (n.waitingForPresent_ = !1), (n.isPresenting = !1), i(new Error('Unable to present.'))) } n.addFullscreenListeners_(d, p, f), A(d) ? (n.enableWakeLock(), (n.waitingForPresent_ = !0)) : (l() || c()) && (n.enableWakeLock(), (n.isPresenting = !0), n.beginPresent_(), n.fireVRDisplayPresentChange_(), r()) } n.waitingForPresent_ || l() || (w(), i(new Error('Unable to present.'))) } else r() } else i(new Error('VRDisplay is not capable of presenting.')) }) ) }), (Ne.prototype.exitPresent = function () { var e = this.isPresenting, t = this return ( (this.isPresenting = !1), (this.layer_ = null), this.disableWakeLock(), new Promise(function (n, r) { e ? (!w() && l() && (t.endPresent_(), t.fireVRDisplayPresentChange_()), c() && (t.removeFullscreenWrapper(), t.removeFullscreenListeners_(), t.endPresent_(), t.fireVRDisplayPresentChange_()), n()) : r(new Error('Was not presenting to VRDisplay.')) }) ) }), (Ne.prototype.getLayers = function () { return this.layer_ ? [this.layer_] : [] }), (Ne.prototype.fireVRDisplayPresentChange_ = function () { var e = new CustomEvent('vrdisplaypresentchange', { detail: { display: this }, }) window.dispatchEvent(e) }), (Ne.prototype.fireVRDisplayConnect_ = function () { var e = new CustomEvent('vrdisplayconnect', { detail: { display: this }, }) window.dispatchEvent(e) }), (Ne.prototype.addFullscreenListeners_ = function (e, t, n) { this.removeFullscreenListeners_(), (this.fullscreenEventTarget_ = e), (this.fullscreenChangeHandler_ = t), (this.fullscreenErrorHandler_ = n), 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)), n && (document.fullscreenEnabled ? e.addEventListener('fullscreenerror', n, !1) : document.webkitFullscreenEnabled ? e.addEventListener('webkitfullscreenerror', n, !1) : document.mozFullScreenEnabled ? document.addEventListener('mozfullscreenerror', n, !1) : document.msFullscreenEnabled && e.addEventListener('msfullscreenerror', n, !1)) }), (Ne.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 n = this.fullscreenErrorHandler_ e.removeEventListener('fullscreenerror', n, !1), e.removeEventListener('webkitfullscreenerror', n, !1), document.removeEventListener('mozfullscreenerror', n, !1), e.removeEventListener('msfullscreenerror', n, !1) } ;(this.fullscreenEventTarget_ = null), (this.fullscreenChangeHandler_ = null), (this.fullscreenErrorHandler_ = null) } }), (Ne.prototype.enableWakeLock = function () { this.wakelock_ && this.wakelock_.enable() }), (Ne.prototype.disableWakeLock = function () { this.wakelock_ && this.wakelock_.disable() }), (Ne.prototype.beginPresent_ = function () {}), (Ne.prototype.endPresent_ = function () {}), (Ne.prototype.submitFrame = function (e) {}), (Ne.prototype.getEyeParameters = function (e) { return null }) var Ue = { ADDITIONAL_VIEWERS: [], DEFAULT_VIEWER: '', MOBILE_WAKE_LOCK: !0, DEBUG: !1, DPDB_URL: 'https://dpdb.webvr.rocks/dpdb.json', K_FILTER: 0.98, PREDICTION_TIME_S: 0.04, CARDBOARD_UI_DISABLED: !1, ROTATE_INSTRUCTIONS_DISABLED: !1, YAW_ONLY: !1, BUFFER_SCALE: 0.5, DIRTY_SUBMIT_FRAME_BINDINGS: !1, }, He = { LEFT: 'left', RIGHT: 'right' } function Ge(e) { var t = S({}, Ue) ;(e = S(t, e || {})), Ne.call(this, { wakelock: e.MOBILE_WAKE_LOCK }), (this.config = e), (this.displayName = 'Cardboard VRDisplay'), (this.capabilities = new ke({ hasPosition: !1, hasOrientation: !0, hasExternalDisplay: !1, canPresent: !0, maxLayers: 1, })), (this.stageParameters = null), (this.bufferScale_ = this.config.BUFFER_SCALE), (this.poseSensor_ = new we(this.config)), (this.distorter_ = null), (this.cardboardUI_ = null), (this.dpdb_ = new he( this.config.DPDB_URL, this.onDeviceParamsUpdated_.bind(this), )), (this.deviceInfo_ = new le( this.dpdb_.getDeviceParams(), e.ADDITIONAL_VIEWERS, )), (this.viewerSelector_ = new Se(e.DEFAULT_VIEWER)), this.viewerSelector_.onChange(this.onViewerChanged_.bind(this)), this.deviceInfo_.setViewer(this.viewerSelector_.getCurrentViewer()), this.config.ROTATE_INSTRUCTIONS_DISABLED || (this.rotateInstructions_ = new Ee()), l() && window.addEventListener('resize', this.onResize_.bind(this)) } return ( (Ge.prototype = Object.create(Ne.prototype)), (Ge.prototype._getPose = function () { return { position: null, orientation: this.poseSensor_.getOrientation(), linearVelocity: null, linearAcceleration: null, angularVelocity: null, angularAcceleration: null, } }), (Ge.prototype._resetPose = function () { this.poseSensor_.resetPose && this.poseSensor_.resetPose() }), (Ge.prototype._getFieldOfView = function (e) { var t if (e == He.LEFT) t = this.deviceInfo_.getFieldOfViewLeftEye() else { if (e != He.RIGHT) return console.error('Invalid eye provided: %s', e), null t = this.deviceInfo_.getFieldOfViewRightEye() } return t }), (Ge.prototype._getEyeOffset = function (e) { var t if (e == He.LEFT) t = [0.5 * -this.deviceInfo_.viewer.interLensDistance, 0, 0] else { if (e != He.RIGHT) return console.error('Invalid eye provided: %s', e), null t = [0.5 * this.deviceInfo_.viewer.interLensDistance, 0, 0] } return t }), (Ge.prototype.getEyeParameters = function (e) { var t = this._getEyeOffset(e), n = this._getFieldOfView(e), r = { offset: t, renderWidth: 0.5 * this.deviceInfo_.device.width * this.bufferScale_, renderHeight: this.deviceInfo_.device.height * this.bufferScale_, } return ( Object.defineProperty(r, 'fieldOfView', { enumerable: !0, get: function () { return ( I('VRFieldOfView', "VRFrameData's projection matrices"), n ) }, }), r ) }), (Ge.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_) }), (Ge.prototype.updateBounds_ = function () { this.layer_ && this.distorter_ && (this.layer_.leftBounds || this.layer_.rightBounds) && this.distorter_.setTextureBounds( this.layer_.leftBounds, this.layer_.rightBounds, ) }), (Ge.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 = y() * this.bufferScale_), (e.canvas.height = b() * this.bufferScale_), (this.cardboardUI_ = new J(e))) : (this.config.CARDBOARD_UI_DISABLED || (this.cardboardUI_ = new J(e)), (this.distorter_ = new U( 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_ && (v() && T() ? 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_()) }), (Ge.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, ) }), (Ge.prototype.updatePresent_ = function () { this.endPresent_(), this.beginPresent_() }), (Ge.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') t || (t = this.layer_.source.getContext('experimental-webgl')), t || (t = this.layer_.source.getContext('webgl2')) var n = t.canvas ;(n.width == this.lastWidth && n.height == this.lastHeight) || this.cardboardUI_.onResize(), (this.lastWidth = n.width), (this.lastHeight = n.height), this.cardboardUI_.render() } }), (Ge.prototype.onOrientationChange_ = function (e) { this.viewerSelector_.hide(), this.rotateInstructions_ && this.rotateInstructions_.update(), this.onResize_() }), (Ge.prototype.onResize_ = function (e) { if (this.layer_) { var t = this.layer_.source.getContext('webgl') t || (t = this.layer_.source.getContext('experimental-webgl')), t || (t = this.layer_.source.getContext('webgl2')) var n = [ 'position: absolute', 'top: 0', 'left: 0', 'width: 100vw', 'height: 100vh', 'border: 0', 'margin: 0', 'padding: 0px', 'box-sizing: content-box', ] t.canvas.setAttribute('style', n.join('; ') + ';'), C(t.canvas) } }), (Ge.prototype.onViewerChanged_ = function (e) { this.deviceInfo_.setViewer(e), this.distorter_ && this.distorter_.updateDeviceInfo(this.deviceInfo_), this.fireVRDisplayDeviceParamsChange_() }), (Ge.prototype.fireVRDisplayDeviceParamsChange_ = function () { var e = new CustomEvent('vrdisplaydeviceparamschange', { detail: { vrdisplay: this, deviceInfo: this.deviceInfo_ }, }) window.dispatchEvent(e) }), (Ge.VRFrameData = Fe), (Ge.VRDisplay = Ne), Ge ) }), (e.exports = r()) }), ), l = '0.10.12', c = { ADDITIONAL_VIEWERS: [], DEFAULT_VIEWER: '', PROVIDE_MOBILE_VRDISPLAY: !0, MOBILE_WAKE_LOCK: !0, DEBUG: !1, DPDB_URL: 'https://dpdb.webvr.rocks/dpdb.json', K_FILTER: 0.98, PREDICTION_TIME_S: 0.04, CARDBOARD_UI_DISABLED: !1, ROTATE_INSTRUCTIONS_DISABLED: !1, YAW_ONLY: !1, BUFFER_SCALE: 0.5, DIRTY_SUBMIT_FRAME_BINDINGS: !1, } function u(e) { ;(this.config = a(a({}, c), 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_() })) } ;(u.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 }), (u.prototype.enable = function () { if (((this.enabled = !0), this.hasNative && this.native.VRFrameData)) { var e = this.native.VRFrameData, t = new this.native.VRFrameData(), n = this.native.VRDisplay.prototype.getFrameData window.VRDisplay.prototype.getFrameData = function (r) { r instanceof e ? n.call(this, r) : (n.call(this, t), (r.pose = t.pose), o(t.leftProjectionMatrix, r.leftProjectionMatrix), o(t.rightProjectionMatrix, r.rightProjectionMatrix), o(t.leftViewMatrix, r.leftViewMatrix), o(t.rightViewMatrix, r.rightViewMatrix)) } } ;(navigator.getVRDisplays = this.getVRDisplays.bind(this)), (window.VRDisplay = s.VRDisplay), (window.VRFrameData = s.VRFrameData) }), (u.prototype.getVRDisplays = function () { var e = this return ( this.config, this.hasNative ? this.native.getVRDisplays.call(navigator).then(function (t) { return t.length > 0 ? t : e.getPolyfillDisplays() }) : Promise.resolve(this.getPolyfillDisplays()) ) }), (u.version = l), (u.VRFrameData = s.VRFrameData), (u.VRDisplay = s.VRDisplay) var h = Object.freeze({ default: u }), d = (h && u) || h return ( 'undefined' !== typeof t && t.window && (t.document || (t.document = t.window.document), t.navigator || (t.navigator = t.window.navigator)), d ) }) }.call( this, 'undefined' !== typeof r.g ? r.g : 'undefined' !== typeof self ? self : 'undefined' !== typeof window ? window : {}, )) }, {}, ], 69: [ function (e, t, n) { var r = /\n/, i = '\n', o = /\s/ function a(e, t, n, r) { var i = e.indexOf(t, n) return -1 === i || i > r ? r : i } function s(e) { return o.test(e) } function l(e, t, n, i, o) { for (var a = [], s = n, l = n; l < i && l < t.length; l++) { var c = t.charAt(l), u = r.test(c) if (u || l === i - 1) { var h = e(t, s, u ? l : l + 1, o) a.push(h), (s = l + 1) } } return a } function c(e, t, n, r, o, l) { var c = [], u = o for ('nowrap' === l && (u = Number.MAX_VALUE); n < r && n < t.length; ) { for (var h = a(t, i, n, r); n < h && s(t.charAt(n)); ) n++ var d = e(t, n, h, u), p = n + (d.end - d.start), f = p + i.length if (p < h) { for (; p > n && !s(t.charAt(p)); ) p-- if (p === n) f > n + i.length && f--, (p = f) else for (f = p; p > n && s(t.charAt(p - i.length)); ) p-- } if (p >= n) { var m = e(t, n, p, u) c.push(m) } n = f } return c } function u(e, t, n, r) { return { start: t, end: t + Math.min(r, n - t) } } ;(t.exports = function (e, n) { return t.exports .lines(e, n) .map(function (t) { return e.substring(t.start, t.end) }) .join('\n') }), (t.exports.lines = function (e, t) { if (0 === (t = t || {}).width && 'nowrap' !== t.mode) return [] e = e || '' var n = 'number' === typeof t.width ? t.width : Number.MAX_VALUE, r = Math.max(0, t.start || 0), i = 'number' === typeof t.end ? t.end : e.length, o = t.mode, a = t.measure || u return 'pre' === o ? l(a, e, r, i, n) : c(a, e, r, i, n, o) }) }, {}, ], 70: [ function (t, n, r) { 'use strict' var i = t('global/window'), o = t('is-function'), a = t('parse-headers'), s = t('xtend') function l(e, t) { for (var n = 0; n < e.length; n++) t(e[n]) } function c(e) { for (var t in e) if (e.hasOwnProperty(t)) return !1 return !0 } function u(e, t, n) { var r = e return ( o(t) ? ((n = t), 'string' === typeof e && (r = { uri: e })) : (r = s(t, { uri: e })), (r.callback = n), r ) } function h(e, t, n) { return d((t = u(e, t, n))) } function d(t) { if ('undefined' === typeof t.callback) throw new Error('callback argument missing') var n = !1, r = function (e, r, i) { n || ((n = !0), t.callback(e, r, i)) } function i() { 4 === f.readyState && setTimeout(l, 0) } function o() { var t = void 0 if (((t = f.response ? f.response : f.responseText || p(f)), w)) try { t = JSON.parse(t) } catch (e) {} return t } function s(e) { return ( clearTimeout(m), e instanceof Error || (e = new Error('' + (e || 'Unknown XMLHttpRequest Error'))), (e.statusCode = 0), r(e, x) ) } function l() { if (!d) { var e clearTimeout(m), (e = t.useXDR && void 0 === f.status ? 200 : 1223 === f.status ? 204 : f.status) var n = x, i = null return ( 0 !== e ? ((n = { body: o(), statusCode: e, method: g, headers: {}, url: v, rawRequest: f, }), f.getAllResponseHeaders && (n.headers = a(f.getAllResponseHeaders()))) : (i = new Error('Internal XMLHttpRequest Error')), r(i, n, n.body) ) } } var u, d, f = t.xhr || null f || (f = t.cors || t.useXDR ? new h.XDomainRequest() : new h.XMLHttpRequest()) var m, v = (f.url = t.uri || t.url), g = (f.method = t.method || 'GET'), y = t.body || t.data, b = (f.headers = t.headers || {}), A = !!t.sync, w = !1, x = { body: void 0, headers: {}, statusCode: 0, method: g, url: v, rawRequest: f, } if ( ('json' in t && !1 !== t.json && ((w = !0), b.accept || b.Accept || (b.Accept = 'application/json'), 'GET' !== g && 'HEAD' !== g && (b['content-type'] || b['Content-Type'] || (b['Content-Type'] = 'application/json'), (y = JSON.stringify(!0 === t.json ? y : t.json)))), (f.onreadystatechange = i), (f.onload = l), (f.onerror = s), (f.onprogress = function () {}), (f.onabort = function () { d = !0 }), (f.ontimeout = s), f.open(g, v, !A, t.username, t.password), A || (f.withCredentials = !!t.withCredentials), !A && t.timeout > 0 && (m = setTimeout(function () { if (!d) { ;(d = !0), f.abort('timeout') var e = new Error('XMLHttpRequest timeout') ;(e.code = 'ETIMEDOUT'), s(e) } }, t.timeout)), f.setRequestHeader) ) for (u in b) b.hasOwnProperty(u) && f.setRequestHeader(u, b[u]) else if (t.headers && !c(t.headers)) throw new Error('Headers cannot be set on an XDomainRequest object') return ( 'responseType' in t && (f.responseType = t.responseType), 'beforeSend' in t && 'function' === typeof t.beforeSend && t.beforeSend(f), f.send(y || null), f ) } function p(t) { try { if ('document' === t.responseType) return t.responseXML var n = t.responseXML && 'parsererror' === t.responseXML.documentElement.nodeName if ('' === t.responseType && !n) return t.responseXML } catch (e) {} return null } function f() {} ;(n.exports = h), (n.exports.default = h), (h.XMLHttpRequest = i.XMLHttpRequest || f), (h.XDomainRequest = 'withCredentials' in new h.XMLHttpRequest() ? h.XMLHttpRequest : i.XDomainRequest), l(['get', 'put', 'post', 'patch', 'head', 'delete'], function (e) { h['delete' === e ? 'del' : e] = function (t, n, r) { return ((n = u(t, n, r)).method = e.toUpperCase()), d(n) } }) }, { 'global/window': 27, 'is-function': 33, 'parse-headers': 47, xtend: 72 }, ], 71: [ function (e, t, n) { t.exports = 'undefined' !== typeof self.DOMParser ? function (e) { return new self.DOMParser().parseFromString(e, 'application/xml') } : 'undefined' !== typeof self.ActiveXObject && new self.ActiveXObject('Microsoft.XMLDOM') ? function (e) { var t = new self.ActiveXObject('Microsoft.XMLDOM') return (t.async = 'false'), t.loadXML(e), t } : function (e) { var t = document.createElement('div') return (t.innerHTML = e), t } }, {}, ], 72: [ function (e, t, n) { t.exports = i var r = Object.prototype.hasOwnProperty function i() { for (var e = {}, t = 0; t < arguments.length; t++) { var n = arguments[t] for (var i in n) r.call(n, i) && (e[i] = n[i]) } return e } }, {}, ], 73: [ function (e, t, n) { t.exports = { name: 'aframe', version: '1.2.0', 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.4 1.1.0', 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.125.1', 'three-bmfont-text': 'dmarcos/three-bmfont-text#1babdf8507c731a18f8af3b807292e2b9740955e', 'webvr-polyfill': '^0.10.12', }, 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: !0, 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: !0 }, engines: { node: '>= 4.6.0', npm: '^2.15.9' }, } }, {}, ], 74: [ function (e, t, n) { var r = e('super-animejs'), i = e('../core/component').components, o = e('../core/component').registerComponent, a = e('../lib/three'), s = e('../utils'), l = new a.Color(), c = new a.Color(), u = s.entity.getComponentProperty, h = s.entity.setComponentProperty, d = {}, p = 'color', f = 'position', m = 'rotation', v = 'scale', g = 'components', y = 'object3D' function b(e, t) { var n, r, o, a return ( (r = (o = t.split('.'))[0]), (a = o[1]), (n = e.components[r] || i[r]) ? a && !n.schema[a] ? null : a ? n.schema[a].type : n.schema.type : null ) } function A(e) { ;(e.x = a.Math.degToRad(e.x)), (e.y = a.Math.degToRad(e.y)), (e.z = a.Math.degToRad(e.z)) } function w(e, t, n) { var r for (r = 0; r < t.length; r++) e.addEventListener(t[r], n) } function x(e, t, n) { var r for (r = 0; r < t.length; r++) e.removeEventListener(t[r], n) } function E(e, t) { var n, r, i for (r = _(t), i = e, n = 0; n < r.length; n++) i = i[r[n]] if (void 0 === i) throw ( (console.log(e), new Error('[animation] property (' + t + ') could not be found')) ) return i } function M(e, t, n, r) { var i, o, s, l for ( t.startsWith('object3D.rotation') && (n = a.Math.degToRad(n)), o = _(t), l = e, i = 0; i < o.length - 1; i++ ) l = l[o[i]] ;(s = o[o.length - 1]), r !== p ? (l[s] = n) : 'r' in l[s] ? ((l[s].r = n.r), (l[s].g = n.g), (l[s].b = n.b)) : ((l[s].x = n.r), (l[s].y = n.g), (l[s].z = n.b)) } function _(e) { return e in d || (d[e] = e.split('.')), d[e] } function T(e) { return e.isRawProperty || e.property.startsWith(g) || e.property.startsWith(y) } t.exports.Component = o('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 (e) { return ( !0 === e || 'true' === e || (!1 !== e && 'false' !== e && parseInt(e, 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 e = 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 () { ;(e.animationIsPlaying = !1), e.el.emit('animationcomplete', e.eventDetail, !1), e.id && e.el.emit('animationcomplete__' + e.id, e.eventDetail, !1) }, }) }, update: function (e) { var t = this.config, n = this.data ;(this.animationIsPlaying = !1), this.data.enabled && n.property && ((t.autoplay = !1), (t.direction = n.dir), (t.duration = n.dur), (t.easing = n.easing), (t.elasticity = n.elasticity), (t.loop = n.loop), (t.round = n.round), this.createAndStartAnimation()) }, tick: function (e, t) { this.animationIsPlaying && ((this.time += t), 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 e = this.data this.updateConfig(), (this.animationIsPlaying = !1), (this.animation = r(this.config)), (this.animation.began = !0), this.removeEventListeners(), this.addEventListeners(), !e.autoplay || (e.startEvents && e.startEvents.length) || (e.delay ? setTimeout(this.beginAnimation, e.delay) : 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 () { this.data.enabled && (this.updateConfig(), this.animation && this.animation.pause(), (this.animation = r(this.config)), this.data.delay ? setTimeout(this.beginAnimation, this.data.delay) : this.beginAnimation()) }, updateConfigForRawColor: function () { var e, t, n, r = this.config, i = this.data, o = this.el if (!this.waitComponentInitRawProperty(this.updateConfigForRawColor)) { for (t in ((e = '' === i.from ? E(o, i.property) : i.from), (n = i.to), this.setColorConfig(e, n), (e = this.fromColor), (n = this.toColor), (this.targetsArray.length = 0), this.targetsArray.push(e), (r.targets = this.targetsArray), n)) r[t] = n[t] r.update = (function () { var e = {} return function (t) { var n ;((n = t.animatables[0].target).r === e.r && n.g === e.g && n.b === e.b) || M(o, i.property, n, i.type) } })() } }, updateConfigForDefault: function () { var e, t, n, r = this.config, i = this.data, o = this.el this.waitComponentInitRawProperty(this.updateConfigForDefault) || ((e = '' === i.from ? (T(i) ? E(o, i.property) : u(o, i.property)) : i.from), (n = i.to), isNaN(e || n) ? ((e = e ? e.toString() : e), (n = n ? n.toString() : n)) : ((e = parseFloat(e)), (n = parseFloat(n))), (t = 'true' === i.to || 'false' === i.to || !0 === i.to || !1 === i.to) && ((e = 'true' === i.from || !0 === i.from ? 1 : 0), (n = 'true' === i.to || !0 === i.to ? 1 : 0)), (this.targets.aframeProperty = e), (r.targets = this.targets), (r.aframeProperty = n), (r.update = (function () { var e return function (n) { var r ;(r = n.animatables[0].target.aframeProperty) !== e && ((e = r), t && (r = r >= 1), T(i) ? M(o, i.property, r, i.type) : h(o, i.property, r)) } })())) }, updateConfigForVector: function () { var e, t, n, r = this.config, i = this.data, o = this.el for (e in ((t = '' !== i.from ? s.coordinates.parse(i.from) : u(o, i.property)), (n = s.coordinates.parse(i.to)), i.property === m && (A(t), A(n)), (this.targetsArray.length = 0), this.targetsArray.push(t), (r.targets = this.targetsArray), n)) r[e] = n[e] i.property !== f && i.property !== m && i.property !== v ? (r.update = (function () { var e = {} return function (t) { var n = t.animatables[0].target ;(n.x === e.x && n.y === e.y && n.z === e.z) || ((e.x = n.x), (e.y = n.y), (e.z = n.z), h(o, i.property, n)) } })()) : (r.update = (function () { var e = {} return function (t) { var n = t.animatables[0].target i.property === v && ((n.x = Math.max(1e-4, n.x)), (n.y = Math.max(1e-4, n.y)), (n.z = Math.max(1e-4, n.z))), (n.x === e.x && n.y === e.y && n.z === e.z) || ((e.x = n.x), (e.y = n.y), (e.z = n.z), o.object3D[i.property].set(n.x, n.y, n.z)) } })()) }, updateConfig: function () { var e ;(e = b(this.el, this.data.property)), T(this.data) && this.data.type === p ? this.updateConfigForRawColor() : 'vec2' === e || 'vec3' === e || 'vec4' === e ? this.updateConfigForVector() : this.updateConfigForDefault() }, waitComponentInitRawProperty: function (e) { var t, n = this.data, i = this.el, o = this return ( '' === n.from && !!n.property.startsWith(g) && ((t = _(n.property)[1]), !i.components[t] && (i.addEventListener('componentinitialized', function n(a) { a.detail.name === t && (e(), (o.animation = r(o.config)), i.removeEventListener('componentinitialized', n)) }), !0)) ) }, stopRelatedAnimations: function () { var e, t for (t in this.el.components) (e = this.el.components[t]), t !== this.attrName && 'animation' === e.name && e.animationIsPlaying && e.data.property === this.data.property && (e.animationIsPlaying = !1) }, addEventListeners: function () { var e = this.data, t = this.el w(t, e.startEvents, this.onStartEvent), w(t, e.pauseEvents, this.pauseAnimation), w(t, e.resumeEvents, this.resumeAnimation) }, removeEventListeners: function () { var e = this.data, t = this.el x(t, e.startEvents, this.onStartEvent), x(t, e.pauseEvents, this.pauseAnimation), x(t, e.resumeEvents, this.resumeAnimation) }, setColorConfig: function (e, t) { l.set(e), c.set(t), (e = this.fromColor), (t = this.toColor), (e.r = l.r), (e.g = l.g), (e.b = l.b), (t.r = c.r), (t.g = c.g), (t.b = c.b) }, }) }, { '../core/component': 131, '../lib/three': 179, '../utils': 205, 'super-animejs': 56, }, ], 75: [ function (e, t, n) { var r = e('../core/component').registerComponent, i = e('../lib/three') t.exports.Component = r('camera', { schema: { active: { default: !0 }, far: { default: 1e4 }, fov: { default: 80, min: 0 }, near: { default: 0.005, min: 0 }, spectator: { default: !1 }, zoom: { default: 1, min: 0 }, }, init: function () { var e, t = this.el ;(e = this.camera = new i.PerspectiveCamera()), t.setObject3D('camera', e) }, update: function (e) { var t = this.data, n = this.camera ;(n.aspect = t.aspect || window.innerWidth / window.innerHeight), (n.far = t.far), (n.fov = t.fov), (n.near = t.near), (n.zoom = t.zoom), n.updateProjectionMatrix(), this.updateActiveCamera(e), this.updateSpectatorCamera(e) }, updateActiveCamera: function (e) { var t = this.data, n = this.el, r = this.system ;(e && e.active === t.active) || t.spectator || (t.active && r.activeCameraEl !== n ? r.setActiveCamera(n) : t.active || r.activeCameraEl !== n || r.disableActiveCamera()) }, updateSpectatorCamera: function (e) { var t = this.data, n = this.el, r = this.system ;(e && e.spectator === t.spectator) || (t.spectator && r.spectatorCameraEl !== n ? r.setSpectatorCamera(n) : t.spectator || r.spectatorCameraEl !== n || r.disableSpectatorCamera()) }, remove: function () { this.el.removeObject3D('camera') }, }) }, { '../core/component': 131, '../lib/three': 179 }, ], 76: [ function (e, t, n) { var r = e('../core/component').registerComponent, i = e('../utils/'), o = i.bind, a = { CLICK: 'click', FUSING: 'fusing', MOUSEENTER: 'mouseenter', MOUSEDOWN: 'mousedown', MOUSELEAVE: 'mouseleave', MOUSEUP: 'mouseup', }, s = { FUSING: 'cursor-fusing', HOVERING: 'cursor-hovering', HOVERED: 'cursor-hovered', }, l = { DOWN: ['mousedown', 'touchstart'], UP: ['mouseup', 'touchend'] }, c = { DOWN: ['selectstart'], UP: ['selectend'] }, u = 'a-mouse-cursor-hover' t.exports.Component = r('cursor', { dependencies: ['raycaster'], schema: { downEvents: { default: [] }, fuse: { default: i.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 = i.debounce(function () { e.canvasBounds = e.el.sceneEl.canvas.getBoundingClientRect() }, 500)), (this.eventDetail = {}), (this.intersectedEventDetail = { cursorEl: this.el }), (this.onCursorDown = o(this.onCursorDown, this)), (this.onCursorUp = o(this.onCursorUp, this)), (this.onIntersection = o(this.onIntersection, this)), (this.onIntersectionCleared = o(this.onIntersectionCleared, this)), (this.onMouseMove = o(this.onMouseMove, this)), (this.onEnterVR = o(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(s.HOVERING), e.removeState(s.FUSING), clearTimeout(this.fuseTimeout), this.intersectedEl && this.intersectedEl.removeState(s.HOVERED), this.removeEventListeners() }, addEventListeners: function () { var e, t = this.data, n = this.el, r = this function i() { ;(e = n.sceneEl.canvas), t.downEvents.length || t.upEvents.length || (l.DOWN.forEach(function (t) { e.addEventListener(t, r.onCursorDown) }), l.UP.forEach(function (t) { e.addEventListener(t, r.onCursorUp) })) } ;(e = n.sceneEl.canvas) ? i() : n.sceneEl.addEventListener('render-target-loaded', i), t.downEvents.forEach(function (e) { n.addEventListener(e, r.onCursorDown) }), t.upEvents.forEach(function (e) { n.addEventListener(e, r.onCursorUp) }), n.addEventListener('raycaster-intersection', this.onIntersection), n.addEventListener( 'raycaster-intersection-cleared', this.onIntersectionCleared, ), n.sceneEl.addEventListener('rendererresize', this.updateCanvasBounds), n.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, r = this !(e = n.sceneEl.canvas) || t.downEvents.length || t.upEvents.length || (l.DOWN.forEach(function (t) { e.removeEventListener(t, r.onCursorDown) }), l.UP.forEach(function (t) { e.removeEventListener(t, r.onCursorUp) })), t.downEvents.forEach(function (e) { n.removeEventListener(e, r.onCursorDown) }), t.upEvents.forEach(function (e) { n.removeEventListener(e, r.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).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(), r = { origin: n, direction: e } return function (i) { var o, a, s, l = this.canvasBounds, c = this.el.sceneEl.camera c.parent.updateMatrixWorld(), (o = (a = 'touchmove' === i.type || 'touchstart' === i.type ? i.touches.item(0) : i).clientX - l.left), (s = a.clientY - l.top), (t.x = (o / l.width) * 2 - 1), (t.y = (-s / l.height) * 2 + 1), n.setFromMatrixPosition(c.matrixWorld), e.set(t.x, t.y, 0.5).unproject(c).sub(n).normalize(), this.el.setAttribute('raycaster', r), '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(a.MOUSEDOWN), (this.cursorDownEl = this.intersectedEl) }, onCursorUp: function (e) { if (this.isCursorDown) { this.isCursorDown = !1 var t = this.data this.twoWayEmit(a.MOUSEUP), this.cursorDownEl && this.cursorDownEl !== this.intersectedEl && ((this.intersectedEventDetail.intersection = null), this.cursorDownEl.emit(a.MOUSEUP, this.intersectedEventDetail)), (t.fuse && 'mouse' !== t.rayOrigin) || !this.intersectedEl || this.cursorDownEl !== this.intersectedEl || this.twoWayEmit(a.CLICK), (this.cursorDownEl = null), 'touchend' === e.type && e.preventDefault() } }, onIntersection: function (e) { var t, n, r, i, o = this.el ;(n = e.detail.els[0] === o ? 1 : 0), (i = e.detail.intersections[n]), (r = e.detail.els[n]) && this.intersectedEl !== r && ((this.intersectedEl && (t = this.el.components.raycaster.getIntersection(this.intersectedEl)) && t.distance <= i.distance) || (this.clearCurrentIntersection(!0), this.setIntersection(r, i))) }, onIntersectionCleared: function (e) { ;-1 !== e.detail.clearedEls.indexOf(this.intersectedEl) && this.clearCurrentIntersection() }, onEnterVR: function () { this.clearCurrentIntersection(!0) var e = this.el.sceneEl.xrSession, t = this e && 'mouse' !== this.data.rayOrigin && (c.DOWN.forEach(function (n) { e.addEventListener(n, t.onCursorDown) }), c.UP.forEach(function (n) { e.addEventListener(n, t.onCursorUp) })) }, setIntersection: function (e, t) { var n = this.el, r = this.data, i = this this.intersectedEl !== e && ((this.intersectedEl = e), n.addState(s.HOVERING), e.addState(s.HOVERED), this.twoWayEmit(a.MOUSEENTER), this.data.mouseCursorStylesEnabled && 'mouse' === this.data.rayOrigin && this.el.sceneEl.canvas.classList.add(u), 0 !== r.fuseTimeout && r.fuse && (n.addState(s.FUSING), this.twoWayEmit(a.FUSING), (this.fuseTimeout = setTimeout(function () { n.removeState(s.FUSING), i.twoWayEmit(a.CLICK) }, r.fuseTimeout)))) }, clearCurrentIntersection: function (e) { var t, n, r = this.el this.intersectedEl && (this.intersectedEl.removeState(s.HOVERED), r.removeState(s.HOVERING), r.removeState(s.FUSING), this.twoWayEmit(a.MOUSELEAVE), this.data.mouseCursorStylesEnabled && 'mouse' === this.data.rayOrigin && this.el.sceneEl.canvas.classList.remove(u), (this.intersectedEl = null), clearTimeout(this.fuseTimeout), !0 !== e && 0 !== (n = this.el.components.raycaster.intersections).length && (t = n[n[0].object.el === r ? 1 : 0]) && this.setIntersection(t.object.el, t)) }, twoWayEmit: function (e) { var t, n = this.el, r = this.intersectedEl ;(t = this.el.components.raycaster.getIntersection(r)), (this.eventDetail.intersectedEl = r), (this.eventDetail.intersection = t), n.emit(e, this.eventDetail), r && ((this.intersectedEventDetail.intersection = t), r.emit(e, this.intersectedEventDetail)) }, }) }, { '../core/component': 131, '../utils/': 205 }, ], 77: [ function (e, t, n) { var r = e('../core/component').registerComponent, i = e('../utils/bind'), o = e('../utils/tracked-controls'), a = o.checkControllerPresentAndSetup, s = o.emitIfAxesChanged, l = o.onButtonEvent, c = 'https://cdn.aframe.io/controllers/google/', u = c + 'vr_controller_daydream.obj', h = c + 'vr_controller_daydream.mtl', d = e('../utils/').device.isWebXRAvailable, p = d ? 'google-daydream' : 'Daydream Controller', f = d ? { axes: { touchpad: [0, 1] }, buttons: ['none', 'none', 'touchpad', 'menu', 'system'], } : { axes: { trackpad: [0, 1] }, buttons: ['trackpad', 'menu', 'system'] } t.exports.Component = r('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: f, bindMethods: function () { ;(this.onModelLoaded = i(this.onModelLoaded, this)), (this.onControllersUpdate = i(this.onControllersUpdate, this)), (this.checkIfControllerPresent = i(this.checkIfControllerPresent, this)), (this.removeControllersUpdateListener = i( this.removeControllersUpdateListener, this, )), (this.onAxisMoved = i(this.onAxisMoved, this)) }, init: function () { var e = this ;(this.onButtonChanged = i(this.onButtonChanged, this)), (this.onButtonDown = function (t) { l(t.detail.id, 'down', e) }), (this.onButtonUp = function (t) { l(t.detail.id, 'up', e) }), (this.onButtonTouchStart = function (t) { l(t.detail.id, 'touchstart', e) }), (this.onButtonTouchEnd = function (t) { l(t.detail.id, 'touchend', e) }), (this.controllerPresent = !1), (this.lastControllerCheck = 0), this.bindMethods() }, 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('model-loaded', this.onModelLoaded), e.addEventListener('axismove', this.onAxisMoved), (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('model-loaded', this.onModelLoaded), e.removeEventListener('axismove', this.onAxisMoved), (this.controllerEventsActive = !1) }, checkIfControllerPresent: function () { a(this, p, this.data.hand ? { hand: this.data.hand } : {}) }, play: function () { this.checkIfControllerPresent(), this.addControllersUpdateListener() }, pause: function () { this.removeEventListeners(), this.removeControllersUpdateListener() }, injectTrackedControls: function () { var e = this.el, t = this.data e.setAttribute('tracked-controls', { armModel: t.armModel, hand: t.hand, idPrefix: p, id: p, orientationOffset: t.orientationOffset, }), this.data.model && this.el.setAttribute('obj-model', { obj: u, mtl: h }) }, 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 (e) { var t, n = e.detail.model this.data.model && (((t = this.buttonMeshes = {}).menu = n.getObjectByName( 'AppButton_AppButton_Cylinder.004', )), (t.system = n.getObjectByName('HomeButton_HomeButton_Cylinder.005')), (t.trackpad = n.getObjectByName('TouchPad_TouchPad_Cylinder.003')), (t.touchpad = n.getObjectByName('TouchPad_TouchPad_Cylinder.003')), n.position.set(0, 0, -0.04)) }, onAxisMoved: function (e) { s(this, this.mapping.axes, e) }, onButtonChanged: function (e) { var t = this.mapping.buttons[e.detail.id] t && this.el.emit(t + 'changed', e.detail.state) }, updateModel: function (e, t) { this.data.model && this.updateButtonModel(e, t) }, updateButtonModel: function (e, t) { var n = this.buttonMeshes if (n && n[e]) { var r switch (t) { case 'down': r = this.data.buttonHighlightColor break case 'touchstart': r = this.data.buttonTouchedColor break default: r = this.data.buttonColor } n[e].material.color.set(r) } }, }) }, { '../core/component': 131, '../utils/': 205, '../utils/bind': 199, '../utils/tracked-controls': 214, }, ], 78: [ function (e, t, n) { var r = e('../core/component').registerComponent, i = e('../utils/bind'), o = e('../utils/tracked-controls'), a = o.checkControllerPresentAndSetup, s = o.emitIfAxesChanged, l = o.onButtonEvent, c = e('../utils/').device.isWebXRAvailable, u = 'https://cdn.aframe.io/controllers/samsung/', h = u + 'gear_vr_controller.obj', d = u + 'gear_vr_controller.mtl', p = c ? 'samsung-gearvr' : 'Gear VR', f = c ? { axes: { touchpad: [0, 1] }, buttons: ['trigger', 'none', 'touchpad', 'none', 'menu'], } : { axes: { trackpad: [0, 1] }, buttons: ['trackpad', 'trigger'] } t.exports.Component = r('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: f, bindMethods: function () { ;(this.onModelLoaded = i(this.onModelLoaded, this)), (this.onControllersUpdate = i(this.onControllersUpdate, this)), (this.checkIfControllerPresent = i(this.checkIfControllerPresent, this)), (this.removeControllersUpdateListener = i( this.removeControllersUpdateListener, this, )), (this.onAxisMoved = i(this.onAxisMoved, this)) }, init: function () { var e = this ;(this.onButtonChanged = i(this.onButtonChanged, this)), (this.onButtonDown = function (t) { l(t.detail.id, 'down', e) }), (this.onButtonUp = function (t) { l(t.detail.id, 'up', e) }), (this.onButtonTouchStart = function (t) { l(t.detail.id, 'touchstart', e) }), (this.onButtonTouchEnd = function (t) { l(t.detail.id, 'touchend', e) }), (this.controllerPresent = !1), (this.lastControllerCheck = 0), this.bindMethods() }, 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('model-loaded', this.onModelLoaded), e.addEventListener('axismove', this.onAxisMoved), (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('model-loaded', this.onModelLoaded), e.removeEventListener('axismove', this.onAxisMoved), (this.controllerEventsActive = !1) }, checkIfControllerPresent: function () { a(this, p, this.data.hand ? { hand: this.data.hand } : {}) }, play: function () { this.checkIfControllerPresent(), this.addControllersUpdateListener() }, pause: function () { this.removeEventListeners(), this.removeControllersUpdateListener() }, injectTrackedControls: function () { var e = this.el, t = this.data e.setAttribute('tracked-controls', { armModel: t.armModel, hand: t.hand, idPrefix: p, id: p, orientationOffset: t.orientationOffset, }), this.data.model && this.el.setAttribute('obj-model', { obj: h, mtl: d }) }, 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 (e) { var t, n = e.detail.model this.data.model && (((t = this.buttonMeshes = {}).trigger = n.children[2]), (t.trackpad = n.children[1]), (t.touchpad = n.children[1])) }, onButtonChanged: function (e) { var t = this.mapping.buttons[e.detail.id] t && this.el.emit(t + 'changed', e.detail.state) }, onAxisMoved: function (e) { s(this, this.mapping.axes, e) }, updateModel: function (e, t) { this.data.model && this.updateButtonModel(e, t) }, updateButtonModel: function (e, t) { var n = this.buttonMeshes if (n && n[e]) { var r switch (t) { case 'down': r = this.data.buttonHighlightColor break case 'touchstart': r = this.data.buttonTouchedColor break default: r = this.data.buttonColor } n[e].material.color.set(r) } }, }) }, { '../core/component': 131, '../utils/': 205, '../utils/bind': 199, '../utils/tracked-controls': 214, }, ], 79: [ function (e, t, n) { var r = e('../core/component').registerComponent, i = e('../utils/bind'), o = e('../utils/tracked-controls'), a = o.checkControllerPresentAndSetup, s = o.emitIfAxesChanged, l = o.onButtonEvent, c = 'generic', u = { axes: { touchpad: [0, 1], thumbstick: [2, 3] }, buttons: ['trigger', 'squeeze', 'touchpad', 'thumbstick'], } t.exports.Component = r('generic-tracked-controller-controls', { schema: { hand: { default: '' }, defaultModel: { default: !0 }, defaultModelColor: { default: 'gray' }, orientationOffset: { type: 'vec3' }, disabled: { default: !1 }, }, mapping: u, bindMethods: function () { ;(this.onControllersUpdate = i(this.onControllersUpdate, this)), (this.checkIfControllerPresent = i(this.checkIfControllerPresent, this)), (this.removeControllersUpdateListener = i( this.removeControllersUpdateListener, this, )), (this.onAxisMoved = i(this.onAxisMoved, this)) }, init: function () { var e = this ;(this.onButtonChanged = i(this.onButtonChanged, this)), (this.onButtonDown = function (t) { l(t.detail.id, 'down', e) }), (this.onButtonUp = function (t) { l(t.detail.id, 'up', e) }), (this.onButtonTouchStart = function (t) { l(t.detail.id, 'touchstart', e) }), (this.onButtonTouchEnd = function (t) { l(t.detail.id, 'touchend', e) }), (this.controllerPresent = !1), (this.wasControllerConnected = !1), (this.lastControllerCheck = 0), (this.rendererSystem = this.el.sceneEl.systems.renderer), this.bindMethods(), this.el.addEventListener('controllerconnected', function (t) { t.detail.name !== e.name && ((e.wasControllerConnected = !0), e.removeEventListeners(), e.removeControllersUpdateListener()) }) }, 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), (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), (this.controllerEventsActive = !1) }, checkIfControllerPresent: function () { var e = this.data, t = e.hand ? e.hand : void 0 a(this, c, { hand: t, iterateControllerProfiles: !0 }) }, play: function () { this.wasControllerConnected || (this.checkIfControllerPresent(), this.addControllersUpdateListener()) }, pause: function () { this.removeEventListeners(), this.removeControllersUpdateListener() }, injectTrackedControls: function () { var e = this.el, t = this.data this.el.components['tracked-controls'] ? this.removeEventListeners() : (e.setAttribute('tracked-controls', { hand: t.hand, idPrefix: c, orientationOffset: t.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 (e) { var t = this.mapping.buttons[e.detail.id] t && this.el.emit(t + 'changed', e.detail.state) }, onAxisMoved: function (e) { s(this, this.mapping.axes, e) }, initDefaultModel: function () { var e = (this.modelEl = document.createElement('a-entity')) e.setAttribute('geometry', { primitive: 'sphere', radius: 0.03 }), e.setAttribute('material', { color: this.data.color }), this.el.appendChild(e) }, }) }, { '../core/component': 131, '../utils/bind': 199, '../utils/tracked-controls': 214 }, ], 80: [ function (e, t, n) { var r = e('../core/geometry').geometries, i = e('../core/geometry').geometryNames, o = e('../core/component').registerComponent, a = e('../lib/three'), s = new a.BufferGeometry() t.exports.Component = o('geometry', { schema: { buffer: { default: !0 }, primitive: { default: 'box', oneOf: i, schemaChange: !0 }, skipCache: { default: !1 }, }, init: function () { this.geometry = null }, update: function (e) { var t, n = this.data, r = this.el, i = this.system this.geometry && (i.unuseGeometry(e), (this.geometry = null)), (this.geometry = i.getOrCreateGeometry(n)), (t = r.getObject3D('mesh')) ? (t.geometry = this.geometry) : (((t = new a.Mesh()).geometry = this.geometry), this.el.getAttribute('material') || (t.material = new a.MeshStandardMaterial({ color: 16777215 * Math.random(), metalness: 0, roughness: 0.5, })), r.setObject3D('mesh', t)) }, remove: function () { this.system.unuseGeometry(this.data), (this.el.getObject3D('mesh').geometry = s), (this.geometry = null) }, updateSchema: function (e) { var t = this.oldData && this.oldData.primitive, n = e.primitive, i = r[n] && r[n].schema if (!i) throw new Error('Unknown geometry schema `' + n + '`') ;(t && t === n) || this.extendSchema(i) }, }) }, { '../core/component': 131, '../core/geometry': 132, '../lib/three': 179 }, ], 81: [ function (e, t, n) { var r = e('../core/component').registerComponent, i = e('../lib/three'), o = e('../utils/').debug('components:gltf-model:warn') t.exports.Component = r('gltf-model', { schema: { type: 'model' }, init: function () { var e = this.system.getDRACOLoader() ;(this.model = null), (this.loader = new i.GLTFLoader()), e && this.loader.setDRACOLoader(e) }, update: function () { var e = this, t = this.el, n = this.data n && (this.remove(), this.loader.load( n, function (n) { ;(e.model = n.scene || n.scenes[0]), (e.model.animations = n.animations), t.setObject3D('mesh', e.model), t.emit('model-loaded', { format: 'gltf', model: e.model }) }, void 0, function (e) { var r = e && e.message ? e.message : 'Failed to load glTF model' o(r), t.emit('model-error', { format: 'gltf', src: n }) }, )) }, remove: function () { this.model && this.el.removeObject3D('mesh') }, }) }, { '../core/component': 131, '../lib/three': 179, '../utils/': 205 }, ], 82: [ function (e, t, n) { var r = e('../core/component').registerComponent, i = { 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', }, o = { open: 'Open', point: 'Point', pointThumb: 'Point + Thumb', fist: 'Fist', hold: 'Hold', thumbUp: 'Thumb Up', }, a = {} function s(e, t) { var n if (e) return 'grip' === (n = a[e]) ? n + (t ? 'close' : 'open') : 'point' === n ? n + (t ? 'up' : 'down') : 'pointing' === n || 'pistol' === n ? n + (t ? 'start' : 'end') : void 0 } function l(e) { var t = e && e.controller return ( t && ((t.id && 0 === t.id.indexOf('OpenVR ')) || (t.profiles && t.profiles[0] && 'htc-vive-controller-mv' === t.profiles[0])) ) } ;(a[o.fist] = 'grip'), (a[o.thumbUp] = 'pistol'), (a[o.point] = 'pointing'), (t.exports.Component = r('hand-controls', { schema: { color: { default: 'white', type: 'color' }, hand: { default: 'left' }, handModelStyle: { default: 'lowPoly', oneOf: ['lowPoly', 'highPoly', 'toon'], }, }, init: function () { var e = this, t = this.el ;(this.gesture = o.open), (this.pressedButtons = {}), (this.touchedButtons = {}), (this.loader = new THREE.GLTFLoader()), this.loader.setCrossOrigin('anonymous'), (this.onGripDown = function () { e.handleButton('grip', 'down') }), (this.onGripUp = function () { e.handleButton('grip', 'up') }), (this.onTrackpadDown = function () { e.handleButton('trackpad', 'down') }), (this.onTrackpadUp = function () { e.handleButton('trackpad', 'up') }), (this.onTrackpadTouchStart = function () { e.handleButton('trackpad', 'touchstart') }), (this.onTrackpadTouchEnd = function () { e.handleButton('trackpad', 'touchend') }), (this.onTriggerDown = function () { e.handleButton('trigger', 'down') }), (this.onTriggerUp = function () { e.handleButton('trigger', 'up') }), (this.onTriggerTouchStart = function () { e.handleButton('trigger', 'touchstart') }), (this.onTriggerTouchEnd = function () { e.handleButton('trigger', 'touchend') }), (this.onGripTouchStart = function () { e.handleButton('grip', 'touchstart') }), (this.onGripTouchEnd = function () { e.handleButton('grip', 'touchend') }), (this.onThumbstickDown = function () { e.handleButton('thumbstick', 'down') }), (this.onThumbstickUp = function () { e.handleButton('thumbstick', 'up') }), (this.onAorXTouchStart = function () { e.handleButton('AorX', 'touchstart') }), (this.onAorXTouchEnd = function () { e.handleButton('AorX', 'touchend') }), (this.onBorYTouchStart = function () { e.handleButton('BorY', 'touchstart') }), (this.onBorYTouchEnd = function () { e.handleButton('BorY', 'touchend') }), (this.onSurfaceTouchStart = function () { e.handleButton('surface', 'touchstart') }), (this.onSurfaceTouchEnd = function () { e.handleButton('surface', 'touchend') }), (this.onControllerConnected = this.onControllerConnected.bind(this)), (this.onControllerDisconnected = this.onControllerDisconnected.bind(this)), t.addEventListener('controllerconnected', this.onControllerConnected), t.addEventListener('controllerdisconnected', this.onControllerDisconnected), (t.object3D.visible = !1) }, play: function () { this.addEventListeners() }, pause: function () { this.removeEventListeners() }, tick: function (e, t) { var n = this.el.getObject3D('mesh') n && n.mixer && n.mixer.update(t / 1e3) }, onControllerConnected: function () { this.el.object3D.visible = !0 }, onControllerDisconnected: function () { this.el.object3D.visible = !1 }, addEventListeners: function () { var e = this.el e.addEventListener('gripdown', this.onGripDown), e.addEventListener('gripup', this.onGripUp), e.addEventListener('trackpaddown', this.onTrackpadDown), e.addEventListener('trackpadup', this.onTrackpadUp), e.addEventListener('trackpadtouchstart', this.onTrackpadTouchStart), e.addEventListener('trackpadtouchend', this.onTrackpadTouchEnd), e.addEventListener('triggerdown', this.onTriggerDown), e.addEventListener('triggerup', this.onTriggerUp), e.addEventListener('triggertouchstart', this.onTriggerTouchStart), e.addEventListener('triggertouchend', this.onTriggerTouchEnd), e.addEventListener('griptouchstart', this.onGripTouchStart), e.addEventListener('griptouchend', this.onGripTouchEnd), e.addEventListener('thumbstickdown', this.onThumbstickDown), e.addEventListener('thumbstickup', this.onThumbstickUp), e.addEventListener('abuttontouchstart', this.onAorXTouchStart), e.addEventListener('abuttontouchend', this.onAorXTouchEnd), e.addEventListener('bbuttontouchstart', this.onBorYTouchStart), e.addEventListener('bbuttontouchend', this.onBorYTouchEnd), e.addEventListener('xbuttontouchstart', this.onAorXTouchStart), e.addEventListener('xbuttontouchend', this.onAorXTouchEnd), e.addEventListener('ybuttontouchstart', this.onBorYTouchStart), e.addEventListener('ybuttontouchend', this.onBorYTouchEnd), e.addEventListener('surfacetouchstart', this.onSurfaceTouchStart), e.addEventListener('surfacetouchend', this.onSurfaceTouchEnd) }, removeEventListeners: function () { var e = this.el e.removeEventListener('gripdown', this.onGripDown), e.removeEventListener('gripup', this.onGripUp), e.removeEventListener('trackpaddown', this.onTrackpadDown), e.removeEventListener('trackpadup', this.onTrackpadUp), e.removeEventListener('trackpadtouchstart', this.onTrackpadTouchStart), e.removeEventListener('trackpadtouchend', this.onTrackpadTouchEnd), e.removeEventListener('triggerdown', this.onTriggerDown), e.removeEventListener('triggerup', this.onTriggerUp), e.removeEventListener('triggertouchstart', this.onTriggerTouchStart), e.removeEventListener('triggertouchend', this.onTriggerTouchEnd), e.removeEventListener('griptouchstart', this.onGripTouchStart), e.removeEventListener('griptouchend', this.onGripTouchEnd), e.removeEventListener('thumbstickdown', this.onThumbstickDown), e.removeEventListener('thumbstickup', this.onThumbstickUp), e.removeEventListener('abuttontouchstart', this.onAorXTouchStart), e.removeEventListener('abuttontouchend', this.onAorXTouchEnd), e.removeEventListener('bbuttontouchstart', this.onBorYTouchStart), e.removeEventListener('bbuttontouchend', this.onBorYTouchEnd), e.removeEventListener('xbuttontouchstart', this.onAorXTouchStart), e.removeEventListener('xbuttontouchend', this.onAorXTouchEnd), e.removeEventListener('ybuttontouchstart', this.onBorYTouchStart), e.removeEventListener('ybuttontouchend', this.onBorYTouchEnd), e.removeEventListener('surfacetouchstart', this.onSurfaceTouchStart), e.removeEventListener('surfacetouchend', this.onSurfaceTouchEnd) }, update: function (e) { var t, n = this.el, r = this.data.hand, o = this.data.handModelStyle, a = this.data.color, s = this if (((t = { hand: r, model: !1 }), r !== e)) { var l = i[o + r.charAt(0).toUpperCase() + r.slice(1)] this.loader.load(l, function (e) { var i = e.scene.children[0], o = 'left' === r ? Math.PI / 2 : -Math.PI / 2 ;(i.mixer = new THREE.AnimationMixer(i)), (s.clips = e.animations), n.setObject3D('mesh', i), (i.children[1].material.color = new THREE.Color(a)), i.position.set(0, 0, 0), i.rotation.set(0, 0, o), n.setAttribute('magicleap-controls', t), n.setAttribute('vive-controls', t), n.setAttribute('oculus-touch-controls', t), n.setAttribute('windows-motion-controls', t) }) } }, remove: function () { this.el.removeObject3D('mesh') }, handleButton: function (e, t) { var n, r = 'down' === t, i = 'touchstart' === t if (0 === t.indexOf('touch')) { if (i === this.touchedButtons[e]) return this.touchedButtons[e] = i } else { if (r === this.pressedButtons[e]) return this.pressedButtons[e] = r } ;(n = this.gesture), (this.gesture = this.determineGesture()), this.gesture !== n && (this.animateGesture(this.gesture, n), this.emitGestureEvents(this.gesture, n)) }, determineGesture: function () { var e, t = this.pressedButtons.grip, n = this.pressedButtons.surface || this.touchedButtons.surface, r = this.pressedButtons.trackpad || this.touchedButtons.trackpad, i = this.pressedButtons.trigger || this.touchedButtons.trigger, a = this.touchedButtons.AorX || this.touchedButtons.BorY return ( l(this.el.components['tracked-controls']) ? t || i ? (e = o.fist) : r && (e = o.point) : t ? (e = n || a || r ? (i ? o.fist : o.point) : i ? o.thumbUp : o.pointThumb) : i && (e = o.hold), e ) }, getClip: function (e) { var t, n for (n = 0; n < this.clips.length; n++) if ((t = this.clips[n]).name === e) return t }, animateGesture: function (e, t) { e ? this.playAnimation(e || o.open, t, !1) : this.playAnimation(t, t, !0) }, emitGestureEvents: function (e, t) { var n, r = this.el t !== e && ((n = s(t, !1)) && r.emit(n), (n = s(e, !0)) && r.emit(n)) }, playAnimation: function (e, t, n) { var r, i, o, a = this.el.getObject3D('mesh') if (a) { if ( (a.mixer.stopAllAction(), (r = this.getClip(e)), ((o = a.mixer.clipAction(r)).clampWhenFinished = !0), (o.loop = THREE.LoopRepeat), (o.repetitions = 0), (o.timeScale = n ? -1 : 1), (o.time = n ? r.duration : 0), (o.weight = 1), !t || e === t) ) return a.mixer.stopAllAction(), void o.play() ;(r = this.getClip(t)), ((i = a.mixer.clipAction(r)).weight = 0.15), i.play(), o.play(), i.crossFadeTo(o, 0.15, !0) } }, })) }, { '../core/component': 131 }, ], 83: [ function (e, t, n) { var r = e('../core/component').registerComponent, i = e('../utils/bind'), o = e('../utils/tracked-controls').checkControllerPresentAndSetup, a = 'https://cdn.aframe.io/controllers/oculus-hands/unity/left.glb', s = 'https://cdn.aframe.io/controllers/oculus-hands/unity/right.glb', l = { left: 'b_l_', right: 'b_r_' }, c = [ 'wrist', 'thumb-metacarpal', 'thumb-phalanx-proximal', 'thumb-phalanx-distal', 'thumb-tip', 'index-finger-metacarpal', 'index-finger-phalanx-proximal', 'index-finger-phalanx-intermediate', 'index-finger-phalanx-distal', 'index-finger-tip', 'middle-finger-metacarpal', 'middle-finger-phalanx-proximal', 'middle-finger-phalanx-intermediate', 'middle-finger-phalanx-distal', 'middle-finger-tip', 'ring-finger-metacarpal', 'ring-finger-phalanx-proximal', 'ring-finger-phalanx-intermediate', 'ring-finger-phalanx-distal', 'ring-finger-tip', 'pinky-finger-metacarpal', 'pinky-finger-phalanx-proximal', 'pinky-finger-phalanx-intermediate', 'pinky-finger-phalanx-distal', 'pinky-finger-tip', ], u = { wrist: 'wrist', 'thumb-metacarpal': 'thumb1', 'thumb-phalanx-proximal': 'thumb2', 'thumb-phalanx-distal': 'thumb3', 'thumb-tip': 'thumb_null', 'index-finger-phalanx-proximal': 'index1', 'index-finger-phalanx-intermediate': 'index2', 'index-finger-phalanx-distal': 'index3', 'index-finger-tip': 'index_null', 'middle-finger-phalanx-proximal': 'middle1', 'middle-finger-phalanx-intermediate': 'middle2', 'middle-finger-phalanx-distal': 'middle3', 'middle-finger-tip': 'middle_null', 'ring-finger-phalanx-proximal': 'ring1', 'ring-finger-phalanx-intermediate': 'ring2', 'ring-finger-phalanx-distal': 'ring3', 'ring-finger-tip': 'ring_null', 'pinky-finger-metacarpal': 'pinky0', 'pinky-finger-phalanx-proximal': 'pinky1', 'pinky-finger-phalanx-intermediate': 'pinky2', 'pinky-finger-phalanx-distal': 'pinky3', 'pinky-finger-tip': 'pinky_null', }, h = 0.015, d = 0.03, p = 0.5 t.exports.Component = r('hand-tracking-controls', { schema: { hand: { default: 'right', oneOf: ['left', 'right'] }, modelStyle: { default: 'mesh', oneOf: ['dots', 'mesh'] }, modelColor: { default: 'white' }, }, bindMethods: function () { ;(this.onControllersUpdate = i(this.onControllersUpdate, this)), (this.checkIfControllerPresent = i(this.checkIfControllerPresent, this)), (this.removeControllersUpdateListener = i( this.removeControllersUpdateListener, this, )) }, addEventListeners: function () { this.el.addEventListener('model-loaded', this.onModelLoaded) for (var e = 0; e < this.jointEls.length; ++e) this.jointEls[e].object3D.visible = !0 }, removeEventListeners: function () { this.el.removeEventListener('model-loaded', this.onModelLoaded) for (var e = 0; e < this.jointEls.length; ++e) this.jointEls[e].object3D.visible = !1 }, init: function () { var e = this.el.sceneEl, t = e.getAttribute('webxr').optionalFeatures t.push('hand-tracking'), e.setAttribute('webxr', { optionalFeatures: t }), (this.onModelLoaded = this.onModelLoaded.bind(this)), (this.jointEls = []), (this.controllerPresent = !1), (this.isPinched = !1), (this.pinchEventDetail = { position: new THREE.Vector3() }), (this.indexTipPosition = new THREE.Vector3()), this.bindMethods(), (this.updateReferenceSpace = this.updateReferenceSpace.bind(this)), this.el.sceneEl.addEventListener('enter-vr', this.updateReferenceSpace), this.el.sceneEl.addEventListener('exit-vr', this.updateReferenceSpace) }, updateReferenceSpace: function () { var e = this, t = this.el.sceneEl.xrSession if (((this.referenceSpace = void 0), t)) { var n = e.el.sceneEl.systems.webxr.sessionReferenceSpaceType t.requestReferenceSpace(n) .then(function (t) { e.referenceSpace = t.getOffsetReferenceSpace( new XRRigidTransform({ x: 0, y: 1.5, z: 0 }), ) }) .catch(function (t) { throw ( (e.el.sceneEl.systems.webxr.warnIfFeatureNotRequested( n, 'tracked-controls-webxr uses reference space ' + n, ), t) ) }) } }, checkIfControllerPresent: function () { var e = this.data, t = e.hand ? e.hand : void 0 o(this, '', { hand: t, iterateControllerProfiles: !0, handTracking: !0 }) }, play: function () { this.checkIfControllerPresent(), this.addControllersUpdateListener() }, tick: function () { var e = this.el.sceneEl, t = this.el.components['tracked-controls'] && this.el.components['tracked-controls'].controller, n = e.frame, r = this.el.components['tracked-controls-webxr'] t && n && r && t.hand && (this.el.object3D.position.set(0, 0, 0), this.el.object3D.rotation.set(0, 0, 0), n.getJointPose && this.updateHandModel(), this.detectGesture()) }, updateHandModel: function () { 'dots' === this.data.modelStyle && this.updateHandDotsModel(), 'mesh' === this.data.modelStyle && this.updateHandMeshModel() }, getBone: function (e) { for (var t = this.bones, n = 0; n < t.length; n++) if (t[n].name === e) return t[n] return null }, updateHandMeshModel: function () { var e = this.el.sceneEl.frame, t = this.el.components['tracked-controls'] && this.el.components['tracked-controls'].controller, n = this.referenceSpace if (t && this.mesh && n) for (var r of ((this.mesh.visible = !1), t.hand.values())) { var i, o, a ;(o = e.getJointPose(r, n)), u[r.jointName] && null != (i = this.getBone(l[this.data.hand] + u[r.jointName])) && o && ((a = o.transform), (this.mesh.visible = !0), i.position.copy(a.position).multiplyScalar(100), i.quaternion.set( a.orientation.x, a.orientation.y, a.orientation.z, a.orientation.w, )) } }, updateHandDotsModel: function () { var e, t, n, r = this.el.sceneEl.frame, i = this.el.components['tracked-controls'] && this.el.components['tracked-controls'].controller, o = this.el.components['tracked-controls-webxr'].system.referenceSpace, a = 0 for (var s of i.hand.values()) (t = (e = this.jointEls[a++]).object3D), (n = r.getJointPose(s, o)), (e.object3D.visible = !!n), n && ((t.matrix.elements = n.transform.matrix), t.matrix.decompose(t.position, t.rotation, t.scale), e.setAttribute('scale', { x: n.radius, y: n.radius, z: n.radius })) }, detectGesture: function () { this.detectPinch() }, detectPinch: (function () { var e = new THREE.Vector3() return function () { var t = this.el.sceneEl.frame, n = this.indexTipPosition, r = this.el.components['tracked-controls'] && this.el.components['tracked-controls'].controller, i = this.el.components['tracked-controls-webxr'], o = this.referenceSpace || i.system.referenceSpace, a = r.hand.get('index-finger-tip'), s = r.hand.get('thumb-tip') if (a && s) { var l = t.getJointPose(a, o), c = t.getJointPose(s, o) if (l && c) { e.copy(c.transform.position), n.copy(l.transform.position) var u = n.distanceTo(e) u < h && !1 === this.isPinched && ((this.isPinched = !0), this.pinchEventDetail.position.copy(n).lerp(e, p), (this.pinchEventDetail.position.y += 1.5), this.el.emit('pinchstarted', this.pinchEventDetail)), u > d && !0 === this.isPinched && ((this.isPinched = !1), this.pinchEventDetail.position.copy(n).lerp(e, p), (this.pinchEventDetail.position.y += 1.5), this.el.emit('pinchended', this.pinchEventDetail)), this.isPinched && (this.pinchEventDetail.position.copy(n).lerp(e, p), (this.pinchEventDetail.position.y += 1.5), this.el.emit('pinchmoved', this.pinchEventDetail)), (n.y += 1.5) } } } })(), pause: function () { this.removeEventListeners(), this.removeControllersUpdateListener() }, injectTrackedControls: function () { var e = this.el, t = this.data e.setAttribute('tracked-controls', { hand: t.hand, iterateControllerProfiles: !0, handTrackingEnabled: !0, }), this.initDefaultModel() }, addControllersUpdateListener: function () { this.el.sceneEl.addEventListener( 'controllersupdated', this.onControllersUpdate, !1, ) }, removeControllersUpdateListener: function () { this.el.sceneEl.removeEventListener( 'controllersupdated', this.onControllersUpdate, !1, ) }, onControllersUpdate: function () { var e this.checkIfControllerPresent(), (e = this.el.components['tracked-controls'] && this.el.components['tracked-controls'].controller), this.el.getObject3D('mesh') && ((e && e.hand && e.hand[0]) || (this.el.getObject3D('mesh').visible = !1)) }, initDefaultModel: function () { this.el.getObject3D('mesh') || ('dots' === this.data.modelStyle && this.initDotsModel(), 'mesh' === this.data.modelStyle && this.initMeshHandModel()) }, initDotsModel: function () { if (0 === this.jointEls.length) for (var e = 0; e < c.length; ++e) { var t = (this.jointEl = document.createElement('a-entity')) t.setAttribute('geometry', { primitive: 'sphere', radius: 1 }), t.setAttribute('material', { color: this.data.modelColor }), (t.object3D.visible = !1), this.el.appendChild(t), this.jointEls.push(t) } }, initMeshHandModel: function () { var e = 'left' === this.data.hand ? a : s this.el.setAttribute('gltf-model', e) }, onModelLoaded: function () { var e = (this.mesh = this.el.getObject3D('mesh').children[0]), t = (this.skinnedMesh = e.children[24]) this.skinnedMesh && ((this.bones = t.skeleton.bones), this.el.removeObject3D('mesh'), e.position.set(0, 1.5, 0), e.rotation.set(0, 0, 0), (t.frustumCulled = !1), (t.material = new THREE.MeshStandardMaterial({ skinning: !0, color: this.data.modelColor, })), this.el.setObject3D('mesh', e)) }, }) }, { '../core/component': 131, '../utils/bind': 199, '../utils/tracked-controls': 214 }, ], 84: [ function (e, t, n) { e('./animation'), e('./camera'), e('./cursor'), e('./daydream-controls'), e('./gearvr-controls'), e('./geometry'), e('./generic-tracked-controller-controls'), e('./gltf-model'), e('./hand-tracking-controls'), e('./hand-controls'), e('./layer'), e('./laser-controls'), e('./light'), e('./line'), e('./link'), e('./look-controls'), e('./magicleap-controls'), e('./material'), e('./obj-model'), e('./oculus-go-controls'), e('./oculus-touch-controls'), e('./position'), e('./raycaster'), e('./rotation'), e('./scale'), e('./shadow'), e('./sound'), e('./text'), e('./tracked-controls'), e('./tracked-controls-webvr'), e('./tracked-controls-webxr'), e('./visible'), e('./valve-index-controls'), e('./vive-controls'), e('./vive-focus-controls'), e('./wasd-controls'), e('./windows-motion-controls'), e('./scene/background'), e('./scene/debug'), e('./scene/device-orientation-permission-ui'), e('./scene/embedded'), e('./scene/inspector'), e('./scene/fog'), e('./scene/keyboard-shortcuts'), e('./scene/pool'), e('./scene/screenshot'), e('./scene/stats'), e('./scene/vr-mode-ui') }, { './animation': 74, './camera': 75, './cursor': 76, './daydream-controls': 77, './gearvr-controls': 78, './generic-tracked-controller-controls': 79, './geometry': 80, './gltf-model': 81, './hand-controls': 82, './hand-tracking-controls': 83, './laser-controls': 85, './layer': 86, './light': 87, './line': 88, './link': 89, './look-controls': 90, './magicleap-controls': 91, './material': 92, './obj-model': 93, './oculus-go-controls': 94, './oculus-touch-controls': 95, './position': 96, './raycaster': 97, './rotation': 98, './scale': 99, './scene/background': 100, './scene/debug': 101, './scene/device-orientation-permission-ui': 102, './scene/embedded': 103, './scene/fog': 104, './scene/inspector': 105, './scene/keyboard-shortcuts': 106, './scene/pool': 107, './scene/screenshot': 108, './scene/stats': 109, './scene/vr-mode-ui': 110, './shadow': 111, './sound': 112, './text': 113, './tracked-controls': 116, './tracked-controls-webvr': 114, './tracked-controls-webxr': 115, './valve-index-controls': 117, './visible': 118, './vive-controls': 119, './vive-focus-controls': 120, './wasd-controls': 121, './windows-motion-controls': 122, }, ], 85: [ function (e, t, n) { var r = e('../core/component').registerComponent, i = e('../utils/') r('laser-controls', { schema: { hand: { default: 'right' }, model: { default: !0 }, defaultModelColor: { type: 'color', default: 'grey' }, }, init: function () { var e = this.config, t = this.data, n = this.el, r = this, o = { hand: t.hand, model: t.model } function a(t) { var o = e[t.detail.name] if (o) { var a = i.extend({ showLine: !0 }, o.raycaster || {}) t.detail.rayOrigin && ((a.origin = t.detail.rayOrigin.origin), (a.direction = t.detail.rayOrigin.direction), (a.showLine = !0)), t.detail.rayOrigin || !r.modelReady ? n.setAttribute('raycaster', a) : n.setAttribute('raycaster', 'showLine', !0), n.setAttribute('cursor', i.extend({ fuse: !1 }, o.cursor)) } } function s() { n.setAttribute('raycaster', 'showLine', !1) } n.setAttribute('daydream-controls', o), n.setAttribute('gearvr-controls', o), n.setAttribute('magicleap-controls', o), n.setAttribute('oculus-go-controls', o), n.setAttribute('oculus-touch-controls', o), n.setAttribute('valve-index-controls', o), n.setAttribute('vive-controls', o), n.setAttribute('vive-focus-controls', o), n.setAttribute('windows-motion-controls', o), n.setAttribute('generic-tracked-controller-controls', o), n.addEventListener('controllerconnected', a), n.addEventListener('controllerdisconnected', s), n.addEventListener('controllermodelready', function (e) { a(e), (r.modelReady = !0) }) }, config: { 'daydream-controls': { cursor: { downEvents: ['trackpaddown', 'triggerdown'], upEvents: ['trackpadup', 'triggerup'], }, }, 'gearvr-controls': { cursor: { downEvents: ['triggerdown'], upEvents: ['triggerup'] }, raycaster: { origin: { x: 0, y: 0.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': 131, '../utils/': 205 }, ], 86: [ function (e, t, n) { var r = e('../core/component').registerComponent, i = e('../utils/').debug('components:layer:warn') function o(e, t, n, r) { var i = e.createFramebuffer() let o = n.viewport.x, a = n.viewport.y, s = n.viewport.x + n.viewport.width, l = n.viewport.y + n.viewport.height 'VIDEO' === r.tagName && (e.bindTexture(e.TEXTURE_2D, t), e.texSubImage2D( e.TEXTURE_2D, 0, 0, 0, r.width, r.height, e.RGB, e.UNSIGNED_BYTE, r, )), e.bindFramebuffer(e.READ_FRAMEBUFFER, i), e.framebufferTexture2D( e.READ_FRAMEBUFFER, e.COLOR_ATTACHMENT0, e.TEXTURE_2D, t, 0, ), e.readBuffer(e.COLOR_ATTACHMENT0), e.blitFramebuffer( 0, 0, r.width, r.height, o, a, s, l, e.COLOR_BUFFER_BIT, e.NEAREST, ), e.bindFramebuffer(e.READ_FRAMEBUFFER, null), e.deleteFramebuffer(i) } t.exports.Component = r('layer', { schema: { type: { default: 'quad', oneOf: ['quad', 'monocubemap', 'stereocubemap'] }, src: { type: 'map' }, rotateCubemap: { default: !1 }, width: { default: 0 }, height: { default: 0 }, }, init: function () { var e = this.el.sceneEl.renderer.getContext() ;(this.quaternion = new THREE.Quaternion()), (this.position = new THREE.Vector3()), this.bindMethods(), (this.needsRedraw = !1), (this.frameBuffer = e.createFramebuffer()) var t = this.el.sceneEl.getAttribute('webxr').requiredFeatures t.push('layers'), this.el.sceneEl.getAttribute('webxr', 'requiredFeatures', t), this.el.sceneEl.addEventListener('enter-vr', this.onEnterVR), this.el.sceneEl.addEventListener('exit-vr', this.onExitVR) }, bindMethods: function () { ;(this.onRequestedReferenceSpace = this.onRequestedReferenceSpace.bind(this)), (this.onEnterVR = this.onEnterVR.bind(this)), (this.onExitVR = this.onExitVR.bind(this)) }, update: function (e) { this.data.src !== e.src && this.updateSrc() }, updateSrc: function () { var e = this.data.type ;(this.texture = void 0), 'quad' !== e ? ('monocubemap' !== e && 'stereocubemap' !== e) || this.loadCubeMapImages() : this.loadQuadImage() }, loadCubeMapImages: function () { var e, t = this.data.type, n = this.xrGLFactory, r = this.el.sceneEl.frame, i = this.data.src ;(this.visibilityChanged = !1), this.layer && (i.complete ? (this.pendingCubeMapUpdate = !1) : (this.pendingCubeMapUpdate = !0), this.loadingScreen ? (this.loadingScreen = !1) : (this.loadingScreen = !0), 'monocubemap' === t ? ((e = n.getSubImage(this.layer, r)), this.loadCubeMapImage(e.colorTexture, i, 0)) : ((e = n.getSubImage(this.layer, r, 'left')), this.loadCubeMapImage(e.colorTexture, i, 0), (e = n.getSubImage(this.layer, r, 'right')), this.loadCubeMapImage(e.colorTexture, i, 6))) }, loadQuadImage: function () { var e = this.data.src, t = this this.el.sceneEl.systems.material.loadTexture(e, { src: e }, function (n) { t.el.sceneEl.renderer.initTexture(n), (t.texture = n), 'VIDEO' === e.tagName && setTimeout(function () { t.textureIsVideo = !0 }, 1e3), t.layer && ((t.layer.height = t.data.height / 2 || t.texture.image.height / 1e3), (t.layer.width = t.data.width / 2 || t.texture.image.width / 1e3), (t.needsRedraw = !0)), t.updateQuadPanel() }) }, preGenerateCubeMapTextures: function (e, t) { 'monocubemap' === this.data.type ? this.generateCubeMapTextures(e, 0, t) : (this.generateCubeMapTextures(e, 0, t), this.generateCubeMapTextures(e, 6, t)) }, generateCubeMapTextures: function (e, t, n) { for ( var r, i, o = this.data, a = this.cubeFaceSize, s = Math.min(e.width, e.height), l = [], c = 0; c < 6; c++ ) { var u = document.createElement('CANVAS') u.width = u.height = a var h = u.getContext('2d') o.rotateCubemap && ((2 !== c && 3 !== c) || (h.save(), h.translate(a, a), h.rotate(Math.PI))), h.drawImage(e, (c + t) * s, 0, s, s, 0, 0, a, a), h.restore(), n && n(), l.push(u) } return ( o.rotateCubemap && ((r = l[0]), (i = l[1]), (l[0] = i), (l[1] = r), (r = l[4]), (i = l[5]), (l[4] = i), (l[5] = r)), n && n(), l ) }, loadCubeMapImage: function (e, t, n) { var r, i = this.el.sceneEl.renderer.getContext() i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL, !1), i.bindTexture(i.TEXTURE_CUBE_MAP, e), (r = !t.complete || this.loadingScreen ? this.loadingScreenImages : this.generateCubeMapTextures(t, n)) var o = 0 r.forEach(function (e, t) { i.texSubImage2D( i.TEXTURE_CUBE_MAP_POSITIVE_X + t, 0, 0, 0, i.RGBA, i.UNSIGNED_BYTE, e, ), (o = i.getError()) }), 0 !== o && console.log('renderingError, WebGL Error Code: ' + o), i.bindTexture(i.TEXTURE_CUBE_MAP, null) }, tick: function () { this.el.sceneEl.xrSession && (!this.layer && this.el.sceneEl.is('vr-mode') && this.initLayer(), this.updateTransform(), this.data.src.complete && (this.pendingCubeMapUpdate || this.loadingScreen || this.visibilityChanged) && this.loadCubeMapImages(), (this.needsRedraw || this.layer.needsRedraw || this.textureIsVideo) && ('quad' === this.data.type && this.draw(), (this.needsRedraw = !1))) }, initLayer: function () { var e = this, t = this.data.type ;(this.el.sceneEl.xrSession.onvisibilitychange = function (t) { e.visibilityChanged = 'hidden' !== t.session.visibilityState }), 'quad' !== t ? ('monocubemap' !== t && 'stereocubemap' !== t) || this.initCubeMapLayer() : this.initQuadLayer() }, initQuadLayer: function () { var e = this.el.sceneEl, t = e.renderer.getContext(), n = (this.xrGLFactory = new XRWebGLBinding(e.xrSession, t)) this.texture && ((this.layer = n.createQuadLayer({ space: this.referenceSpace, viewPixelHeight: 2048, viewPixelWidth: 2048, height: this.data.height / 2 || this.texture.image.height / 1e3, width: this.data.width / 2 || this.texture.image.width / 1e3, })), e.renderer.xr.addLayer(this.layer)) }, initCubeMapLayer: function () { var e = this.data.src, t = this.el.sceneEl, n = t.renderer.getContext(), r = n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE), i = (this.cubeFaceSize = Math.min(r, Math.min(e.width, e.height))), o = (this.xrGLFactory = new XRWebGLBinding(t.xrSession, n)) ;(this.layer = o.createCubeLayer({ space: this.referenceSpace, viewPixelWidth: i, viewPixelHeight: i, layout: 'monocubemap' === this.data.type ? 'mono' : 'stereo', isStatic: !1, })), this.initLoadingScreenImages(), this.loadCubeMapImages(), t.renderer.xr.addLayer(this.layer) }, initLoadingScreenImages: function () { for ( var e = this.cubeFaceSize, t = (this.loadingScreenImages = []), n = 0; n < 6; n++ ) { var r = document.createElement('CANVAS') r.width = r.height = e var i = r.getContext('2d') ;(r.width = r.height = e), (i.fillStyle = 'black'), i.fillRect(0, 0, e, e), 2 !== n && 3 !== n && (i.translate(e, 0), i.scale(-1, 1), (i.fillStyle = 'white'), (i.font = '30px Arial'), i.fillText('Loading', e / 2, e / 2)), t.push(r) } }, destroyLayer: function () { this.layer && (this.el.sceneEl.renderer.xr.removeLayer(this.layer), this.layer.destroy(), (this.layer = void 0)) }, toggleCompositorLayer: function () { this.enableCompositorLayer(!this.layerEnabled) }, enableCompositorLayer: function (e) { ;(this.layerEnabled = e), (this.quadPanelEl.object3D.visible = !this.layerEnabled) }, updateQuadPanel: function () { var e = this.quadPanelEl this.quadPanelEl || ((e = this.quadPanelEl = document.createElement('a-entity')), this.el.appendChild(e)), e.setAttribute('material', { shader: 'flat', src: this.data.src, transparent: !0, }), e.setAttribute('geometry', { primitive: 'plane', height: this.data.height || this.texture.image.height / 1e3, width: this.data.width || this.texture.image.height / 1e3, }) }, draw: function () { var e = this.el.sceneEl, t = this.el.sceneEl.renderer.getContext(), n = this.xrGLFactory.getSubImage(this.layer, e.frame), r = e.renderer.properties.get(this.texture).__webglTexture, i = t.getParameter(t.FRAMEBUFFER_BINDING) t.viewport(n.viewport.x, n.viewport.y, n.viewport.width, n.viewport.height), t.bindFramebuffer(t.FRAMEBUFFER, this.frameBuffer), t.framebufferTexture2D( t.FRAMEBUFFER, t.COLOR_ATTACHMENT0, t.TEXTURE_2D, n.colorTexture, 0, ), o(t, r, n, this.data.src), t.bindFramebuffer(t.FRAMEBUFFER, i) }, updateTransform: function () { var e = this.el, t = this.position, n = this.quaternion e.object3D.updateMatrixWorld(), t.setFromMatrixPosition(e.object3D.matrixWorld), n.setFromRotationMatrix(e.object3D.matrixWorld), this.layerEnabled || t.set(0, 0, 1e8), (this.layer.transform = new XRRigidTransform(t, n)) }, onEnterVR: function () { var e = this.el.sceneEl, t = e.xrSession e.hasWebXR && XRWebGLBinding && t ? (t.requestReferenceSpace('local').then(this.onRequestedReferenceSpace), (this.needsRedraw = !0), (this.layerEnabled = !0), this.quadPanelEl && (this.quadPanelEl.object3D.visible = !1), this.data.src.play && this.data.src.play()) : i('The layer component requires WebXR and the layers API enabled') }, onExitVR: function () { this.quadPanelEl && (this.quadPanelEl.object3D.visible = !0), this.destroyLayer() }, onRequestedReferenceSpace: function (e) { this.referenceSpace = e }, }) }, { '../core/component': 131, '../utils/': 205 }, ], 87: [ function (e, t, n) { var r = e('../utils/bind'), i = e('../utils').diff, o = e('../utils/debug'), a = e('../core/component').registerComponent, s = e('../lib/three'), l = s.Math.degToRad, c = o('components:light:warn') t.exports.Component = a('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: 0.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 t = this.data, n = i(t, e), o = this.light, a = this.rendererSystem, s = this if (!o || 'type' in n) this.setLight(this.data), this.updateShadow() else { var c = !1 Object.keys(n).forEach(function (e) { var n = t[e] switch (e) { case 'color': o.color.set(n), a.applyColorCorrection(o.color) break case 'groundColor': o.groundColor.set(n), a.applyColorCorrection(o.groundColor) break case 'angle': o.angle = l(n) break case 'target': null === n ? ('spot' !== t.type && 'directional' !== t.type) || (o.target = s.defaultTarget) : n.hasLoaded ? s.onSetTarget(n, o) : n.addEventListener('loaded', r(s.onSetTarget, s, n, 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': c || (s.updateShadow(), (c = !0)) break default: o[e] = n } }) } }, setLight: function (e) { var t = this.el, n = this.getLight(e) n && (this.light && t.removeObject3D('light'), (this.light = n), (this.light.el = t), t.setObject3D('light', this.light), ('spot' !== e.type && 'directional' !== e.type && 'hemisphere' !== e.type) || t.getObject3D('light').translateY(-1), 'spot' === e.type && (t.setObject3D('light-target', this.defaultTarget), t.getObject3D('light-target').position.set(0, 0, -1))) }, updateShadow: function () { var e = this.el, t = this.data, n = this.light n.castShadow = t.castShadow var r = e.getObject3D('cameraHelper') if ( (t.shadowCameraVisible && !r ? e.setObject3D('cameraHelper', new s.CameraHelper(n.shadow.camera)) : !t.shadowCameraVisible && r && e.removeObject3D('cameraHelper'), !t.castShadow) ) return n ;(n.shadow.bias = t.shadowBias), (n.shadow.radius = t.shadowRadius), (n.shadow.mapSize.height = t.shadowMapHeight), (n.shadow.mapSize.width = t.shadowMapWidth), (n.shadow.camera.near = t.shadowCameraNear), (n.shadow.camera.far = t.shadowCameraFar), n.shadow.camera instanceof s.OrthographicCamera ? ((n.shadow.camera.top = t.shadowCameraTop), (n.shadow.camera.right = t.shadowCameraRight), (n.shadow.camera.bottom = t.shadowCameraBottom), (n.shadow.camera.left = t.shadowCameraLeft)) : (n.shadow.camera.fov = t.shadowCameraFov), n.shadow.camera.updateProjectionMatrix(), r && r.update() }, getLight: function (e) { var t = e.angle, n = new s.Color(e.color) this.rendererSystem.applyColorCorrection(n), (n = n.getHex()) var i = e.decay, o = e.distance, a = new s.Color(e.groundColor) this.rendererSystem.applyColorCorrection(a), (a = a.getHex()) var u = e.intensity, h = e.type, d = e.target, p = null switch (h.toLowerCase()) { case 'ambient': return new s.AmbientLight(n, u) case 'directional': return ( (p = new s.DirectionalLight(n, u)), (this.defaultTarget = p.target), d && (d.hasLoaded ? this.onSetTarget(d, p) : d.addEventListener('loaded', r(this.onSetTarget, this, d, p))), p ) case 'hemisphere': return new s.HemisphereLight(n, a, u) case 'point': return new s.PointLight(n, u, o, i) case 'spot': return ( (p = new s.SpotLight(n, u, o, l(t), e.penumbra, i)), (this.defaultTarget = p.target), d && (d.hasLoaded ? this.onSetTarget(d, p) : d.addEventListener('loaded', r(this.onSetTarget, this, d, p))), p ) default: c( '%s is not a valid light type. Choose from ambient, directional, hemisphere, point, spot.', h, ) } }, onSetTarget: function (e, t) { t.target = e.object3D }, remove: function () { var e = this.el e.removeObject3D('light'), e.getObject3D('cameraHelper') && e.removeObject3D('cameraHelper') }, }) }, { '../core/component': 131, '../lib/three': 179, '../utils': 205, '../utils/bind': 199, '../utils/debug': 201, }, ], 88: [ function (e, t, n) { var r = e('../core/component').registerComponent function i(e, t) { return !(!e || !t) && e.x === t.x && e.y === t.y && e.z === t.z } t.exports.Component = r('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, n = this.data ;(this.rendererSystem = this.el.sceneEl.systems.renderer), (t = this.material = new THREE.LineBasicMaterial({ color: n.color, opacity: n.opacity, transparent: n.opacity < 1, visible: n.visible, })), (e = this.geometry = new THREE.BufferGeometry()).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, n = this.geometry, r = !1, o = this.material, a = n.attributes.position.array i(t.start, e.start) || ((a[0] = t.start.x), (a[1] = t.start.y), (a[2] = t.start.z), (r = !0)), i(t.end, e.end) || ((a[3] = t.end.x), (a[4] = t.end.y), (a[5] = t.end.z), (r = !0)), r && ((n.attributes.position.needsUpdate = !0), n.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': 131 }, ], 89: [ function (e, t, n) { var r = e('../core/component').registerComponent, i = e('../core/shader').registerShader, o = e('../lib/three') ;(t.exports.Component = r('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 o.Quaternion()), (this.hiddenEls = []) }, update: function (e) { var t, n, r = this.data, i = this.el r.visualAspectEnabled && (this.initVisualAspect(), (t = r.highlighted ? r.highlightedColor : r.backgroundColor), (n = r.highlighted ? r.highlightedColor : r.borderColor), i.setAttribute('material', 'backgroundColor', t), i.setAttribute('material', 'strokeColor', n), r.on !== e.on && this.updateEventListener(), void 0 !== e.peekMode && r.peekMode !== e.peekMode && this.updatePeekMode(), r.image && e.image !== r.image && i.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, n, r = this.el this.data.visualAspectEnabled && !this.visualAspectInitialized && ((n = 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', }), n.setAttribute('text', { color: this.data.titleColor, align: 'center', font: 'kelsonsans', value: this.data.title || this.data.href, width: 4, }), n.setAttribute('position', '0 1.5 0'), r.appendChild(n), 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 o.Vector3(), t = new o.Vector3(), n = new o.Quaternion(), r = new o.Vector3() return function () { var i, o, a = this.el, s = a.object3D, l = a.sceneEl.camera, c = this.textEl if (this.data.visualAspectEnabled) if ( (s.updateMatrixWorld(), l.parent.updateMatrixWorld(), l.updateMatrixWorld(), s.matrix.decompose(t, n, r), t.setFromMatrixPosition(s.matrixWorld), e.setFromMatrixPosition(l.matrixWorld), (o = t.distanceTo(e)) > 20) ) this.previousQuaternion || (this.quaternionClone.copy(n), (this.previousQuaternion = this.quaternionClone)), s.lookAt(e) else { if (((i = this.calculateCameraPortalOrientation()), o < 0.5)) { if (!0 === this.semiSphereEl.getAttribute('visible')) return c.setAttribute('text', 'width', 1.5), i <= 0 ? (c.setAttribute('position', '0 0 0.75'), c.setAttribute('rotation', '0 180 0'), this.semiSphereEl.setAttribute('rotation', '0 0 0')) : (c.setAttribute('position', '0 0 -0.75'), c.setAttribute('rotation', '0 0 0'), this.semiSphereEl.setAttribute('rotation', '0 180 0')), (a.getObject3D('mesh').visible = !1), this.semiSphereEl.setAttribute('visible', !0), (this.peekCameraPortalOrientation = i) } else i <= 0 ? c.setAttribute('rotation', '0 180 0') : c.setAttribute('rotation', '0 0 0'), c.setAttribute('text', 'width', 5), c.setAttribute('position', '0 1.5 0'), (a.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, n = 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 !== n.sphereEl && r.el !== e.sceneEl.cameraEl && !1 !== r.el.getAttribute('visible') && r.el !== n.textEl && r.el !== n.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 o.Matrix4(), t = new o.Vector3(), n = new o.Vector3(0, 0, 1), r = new o.Vector3(0, 0, 0) return function () { var i = this.el, o = i.sceneEl.camera return ( t.set(0, 0, 0), n.set(0, 0, 1), r.set(0, 0, 0), i.object3D.matrixWorld.extractRotation(e), n.applyMatrix4(e), i.object3D.updateMatrixWorld(), i.object3D.localToWorld(r), o.parent.parent.updateMatrixWorld(), o.parent.updateMatrixWorld(), o.updateMatrixWorld(), o.localToWorld(t), t.sub(r).normalize(), n.normalize(), Math.sign(n.dot(t)) ) } })(), remove: function () { this.removeEventListener() }, })), i('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 = clamp(direction.y * 0.5 + 0.5, 0.0, 1.0);', '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': 131, '../core/shader': 141, '../lib/three': 179 }, ], 90: [ function (e, t, n) { var r = e('../core/component').registerComponent, i = e('../lib/three'), o = e('../utils/'), a = o.bind, s = Math.PI / 2 t.exports.Component = r('look-controls', { dependencies: ['position', 'rotation'], schema: { enabled: { default: !0 }, magicWindowTrackingEnabled: { default: !0 }, pointerLockEnabled: { default: !1 }, reverseMouseDrag: { default: !1 }, reverseTouchDrag: { default: !1 }, touchEnabled: { default: !0 }, mouseEnabled: { default: !0 }, }, init: function () { ;(this.deltaYaw = 0), (this.previousHMDPosition = new i.Vector3()), (this.hmdQuaternion = new i.Quaternion()), (this.magicWindowAbsoluteEuler = new i.Euler()), (this.magicWindowDeltaEuler = new i.Euler()), (this.position = new i.Vector3()), (this.magicWindowObject = new i.Object3D()), (this.rotation = {}), (this.deltaRotation = {}), (this.savedPose = null), (this.pointerLocked = !1), this.setupMouseControls(), this.bindMethods(), (this.previousMouseEvent = {}), this.setupMagicWindowControls(), (this.savedPose = { position: new i.Vector3(), rotation: new i.Euler() }), this.el.sceneEl.is('vr-mode') && this.onEnterVR() }, setupMagicWindowControls: function () { var e, t = this.data o.device.isMobile() && ((e = this.magicWindowControls = new i.DeviceOrientationControls(this.magicWindowObject)), 'undefined' !== typeof DeviceOrientationEvent && DeviceOrientationEvent.requestPermission && ((e.enabled = !1), this.el.sceneEl.components['device-orientation-permission-ui'] .permissionGranted ? (e.enabled = t.magicWindowTrackingEnabled) : this.el.sceneEl.addEventListener( 'deviceorientationpermissiongranted', function () { e.enabled = t.magicWindowTrackingEnabled }, ))) }, update: function (e) { var t = this.data t.enabled !== e.enabled && this.updateGrabCursor(t.enabled), e && !t.magicWindowTrackingEnabled && e.magicWindowTrackingEnabled && (this.magicWindowAbsoluteEuler.set(0, 0, 0), this.magicWindowDeltaEuler.set(0, 0, 0)), this.magicWindowControls && (this.magicWindowControls.enabled = t.magicWindowTrackingEnabled), 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 = a(this.onMouseDown, this)), (this.onMouseMove = a(this.onMouseMove, this)), (this.onMouseUp = a(this.onMouseUp, this)), (this.onTouchStart = a(this.onTouchStart, this)), (this.onTouchMove = a(this.onTouchMove, this)), (this.onTouchEnd = a(this.onTouchEnd, this)), (this.onEnterVR = a(this.onEnterVR, this)), (this.onExitVR = a(this.onExitVR, this)), (this.onPointerLockChange = a(this.onPointerLockChange, this)), (this.onPointerLockError = a(this.onPointerLockError, this)) }, setupMouseControls: function () { ;(this.mouseDown = !1), (this.pitchObject = new i.Object3D()), (this.yawObject = new i.Object3D()), (this.yawObject.position.y = 10), this.yawObject.add(this.pitchObject) }, addEventListeners: function () { var e = this.el.sceneEl, t = e.canvas t ? (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, ))) : e.addEventListener('render-target-loaded', a(this.addEventListeners, this)) }, 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 i.Matrix4() return function () { var t, n = this.el.object3D, r = this.pitchObject, i = this.yawObject, o = this.el.sceneEl o.is('vr-mode') && o.checkHeadsetConnected() ? o.hasWebXR && (t = o.renderer.xr.getCameraPose()) && ((e.elements = t.transform.matrix), e.decompose(n.position, n.rotation, n.scale)) : (this.updateMagicWindowOrientation(), (n.rotation.x = this.magicWindowDeltaEuler.x + r.rotation.x), (n.rotation.y = this.magicWindowDeltaEuler.y + i.rotation.y), (n.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, n, r, i = this.pitchObject, o = this.previousMouseEvent, a = this.yawObject this.data.enabled && (this.mouseDown || this.pointerLocked) && (this.pointerLocked ? ((n = e.movementX || e.mozMovementX || 0), (r = e.movementY || e.mozMovementY || 0)) : ((n = e.screenX - o.screenX), (r = e.screenY - o.screenY)), (this.previousMouseEvent.screenX = e.screenX), (this.previousMouseEvent.screenY = e.screenY), (t = this.data.reverseMouseDrag ? 1 : -1), (a.rotation.y += 0.002 * n * t), (i.rotation.x += 0.002 * r * t), (i.rotation.x = Math.max(-s, Math.min(s, i.rotation.x)))) }, onMouseDown: function (e) { var t = this.el.sceneEl if ( this.data.enabled && this.data.mouseEnabled && (!t.is('vr-mode') || !t.checkHeadsetConnected()) && 0 === e.button ) { var n = t && t.canvas ;(this.mouseDown = !0), (this.previousMouseEvent.screenX = e.screenX), (this.previousMouseEvent.screenY = e.screenY), this.showGrabbingCursor(), this.data.pointerLockEnabled && !this.pointerLocked && (n.requestPointerLock ? n.requestPointerLock() : n.mozRequestPointerLock && n.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, n, r = this.el.sceneEl.canvas, i = this.yawObject this.touchStarted && this.data.touchEnabled && ((n = (2 * Math.PI * (e.touches[0].pageX - this.touchStart.x)) / r.clientWidth), (t = this.data.reverseTouchDrag ? 1 : -1), (i.rotation.y -= 0.5 * n * 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) { var t = this.el.sceneEl function n() { t.canvas.classList.add('a-grab-cursor') } function r() { t.canvas.classList.remove('a-grab-cursor') } t.canvas ? e ? n() : r() : e ? t.addEventListener('render-target-loaded', n) : t.addEventListener('render-target-loaded', r) }, 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': 131, '../lib/three': 179, '../utils/': 205 }, ], 91: [ function (e, t, n) { var r = e('../utils/bind'), i = e('../core/component').registerComponent, o = e('../utils/tracked-controls'), a = o.checkControllerPresentAndSetup, s = o.emitIfAxesChanged, l = o.onButtonEvent, c = 'magicleap-one', u = 'https://cdn.aframe.io/controllers/magicleap/magicleap-one-controller.glb', h = { axes: { touchpad: [0, 1] }, buttons: ['trigger', 'grip', 'touchpad', 'menu'], } t.exports.Component = i('magicleap-controls', { schema: { hand: { default: 'none' }, model: { default: !0 }, orientationOffset: { type: 'vec3' }, }, mapping: h, init: function () { var e = this ;(this.controllerPresent = !1), (this.lastControllerCheck = 0), (this.onButtonChanged = r(this.onButtonChanged, this)), (this.onButtonDown = function (t) { l(t.detail.id, 'down', e) }), (this.onButtonUp = function (t) { l(t.detail.id, 'up', e) }), (this.onButtonTouchEnd = function (t) { l(t.detail.id, 'touchend', e) }), (this.onButtonTouchStart = function (t) { l(t.detail.id, 'touchstart', e) }), (this.previousButtonValues = {}), (this.rendererSystem = this.el.sceneEl.systems.renderer), this.bindMethods() }, update: function () { var e = this.data this.controllerIndex = 'right' === e.hand ? 0 : 'left' === e.hand ? 1 : 2 }, play: function () { this.checkIfControllerPresent(), this.addControllersUpdateListener() }, pause: function () { this.removeEventListeners(), this.removeControllersUpdateListener() }, bindMethods: function () { ;(this.onModelLoaded = r(this.onModelLoaded, this)), (this.onControllersUpdate = r(this.onControllersUpdate, this)), (this.checkIfControllerPresent = r(this.checkIfControllerPresent, this)), (this.removeControllersUpdateListener = r( this.removeControllersUpdateListener, this, )), (this.onAxisMoved = r(this.onAxisMoved, this)) }, 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-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-loaded', this.onModelLoaded), (this.controllerEventsActive = !1) }, checkIfControllerPresent: function () { var e = this.data a(this, c, { index: this.controllerIndex, hand: e.hand }) }, injectTrackedControls: function () { var e = this.el, t = this.data e.setAttribute('tracked-controls', { idPrefix: c, hand: t.hand, controller: this.controllerIndex, orientationOffset: t.orientationOffset, }), this.data.model && this.el.setAttribute('gltf-model', u) }, 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 (e) { var t, n = this.mapping.buttons[e.detail.id] n && ('trigger' === n && ((t = e.detail.state.value), console.log('analog value of trigger press: ' + t)), this.el.emit(n + 'changed', e.detail.state)) }, onModelLoaded: function (e) { e.detail.model.scale.set(0.01, 0.01, 0.01) }, onAxisMoved: function (e) { s(this, this.mapping.axes, e) }, updateModel: function (e, t) {}, setButtonColor: function (e, t) {}, }) }, { '../core/component': 131, '../utils/bind': 199, '../utils/tracked-controls': 214 }, ], 92: [ function (e, t, n) { var r = e('../utils/'), i = e('../core/component'), o = e('../lib/three'), a = e('../core/shader'), s = r.debug('components:material:error'), l = i.registerComponent, c = a.shaders, u = a.shaderNames function h(e) { switch (e) { case 'back': return o.BackSide case 'double': return o.DoubleSide default: return o.FrontSide } } function d(e) { switch (e) { case 'face': return o.FaceColors case 'vertex': return o.VertexColors default: return o.NoColors } } function p(e) { switch (e) { case 'none': return o.NoBlending case 'additive': return o.AdditiveBlending case 'subtractive': return o.SubtractiveBlending case 'multiply': return o.MultiplyBlending default: return o.NormalBlending } } function f(e, t) { e.dispose(), t.unregisterMaterial(e) } t.exports.Component = l('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: u, 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, n, r, i ;(n = e && e.shader), (t = this.oldData && this.oldData.shader), (r = c[(i = n || t)] && c[i].schema) || s('Unknown shader schema ' + i), (t && n === t) || (this.extendSchema(r), this.updateBehavior()) }, updateBehavior: function () { var e, t, n = this.el.sceneEl, r = this.schema, i = this function o(e, n) { var r for (r in t) t[r] = e i.shader.update(t) } for (e in ((this.tick = void 0), (t = {}), r)) 'time' === r[e].type && ((this.tick = o), (t[e] = !0)) n && (this.tick ? n.addBehavior(this) : n.removeBehavior(this)) }, updateShader: function (e) { var t, n = this.data, r = c[e] && c[e].Shader if (!r) throw new Error('Unknown shader ' + e) ;((t = this.shader = new r()).el = this.el), t.init(n), this.setMaterial(t.material), this.updateSchema(n) }, updateMaterial: function (e) { var t, n = this.data, r = this.material for (t in ((r.alphaTest = n.alphaTest), (r.depthTest = !1 !== n.depthTest), (r.depthWrite = !1 !== n.depthWrite), (r.opacity = n.opacity), (r.flatShading = n.flatShading), (r.side = h(n.side)), (r.transparent = !1 !== n.transparent || n.opacity < 1), (r.vertexColors = d(n.vertexColors)), (r.visible = n.visible), (r.blending = p(n.blending)), (r.dithering = n.dithering), e)) break !t || (e.alphaTest === n.alphaTest && e.side === n.side && e.vertexColors === n.vertexColors) || (r.needsUpdate = !0) }, remove: function () { var e = new o.MeshBasicMaterial(), t = this.material, n = this.el.getObject3D('mesh') n && (n.material = e), f(t, this.system) }, setMaterial: function (e) { var t, n = this.el, r = this.system this.material && f(this.material, r), (this.material = e), r.registerMaterial(e), (t = n.getObject3D('mesh')) ? (t.material = e) : n.addEventListener('object3dset', function t(r) { 'mesh' === r.detail.type && r.target === n && ((n.getObject3D('mesh').material = e), n.removeEventListener('object3dset', t)) }) }, }) }, { '../core/component': 131, '../core/shader': 141, '../lib/three': 179, '../utils/': 205, }, ], 93: [ function (e, t, n) { var r = e('../utils/debug'), i = e('../core/component').registerComponent, o = e('../lib/three'), a = r('components:obj-model:warn') t.exports.Component = i('obj-model', { schema: { mtl: { type: 'model' }, obj: { type: 'model' } }, init: function () { var e = this ;(this.model = null), (this.objLoader = new o.OBJLoader()), (this.mtlLoader = new o.MTLLoader(this.objLoader.manager)), (this.mtlLoader.crossOrigin = ''), this.el.addEventListener('componentinitialized', function (t) { e.model && 'material' === t.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, t) { var n = this, r = this.el, i = this.mtlLoader, o = this.objLoader, s = this.el.sceneEl.systems.renderer, l = t.substr(0, t.lastIndexOf('/') + 1) if (t) return ( r.hasAttribute('material') && a('Material component properties are ignored when a .MTL is provided'), i.setResourcePath(l), void i.load(t, function (t) { t.preload(), o.setMaterials(t), o.load(e, function (e) { ;(n.model = e), n.model.traverse(function (e) { if (e.isMesh) { var t = e.material t.color && s.applyColorCorrection(t.color), t.map && s.applyColorCorrection(t.map), t.emissive && s.applyColorCorrection(t.emissive), t.emissiveMap && s.applyColorCorrection(t.emissiveMap) } }), r.setObject3D('mesh', e), r.emit('model-loaded', { format: 'obj', model: e }) }) }) ) o.load(e, function (e) { ;(n.model = e), n.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 (t) { t instanceof o.Mesh && (t.material = e.material) }) }, }) }, { '../core/component': 131, '../lib/three': 179, '../utils/debug': 201 }, ], 94: [ function (e, t, n) { var r = e('../core/component').registerComponent, i = e('../utils/bind'), o = e('../utils/tracked-controls'), a = o.checkControllerPresentAndSetup, s = o.emitIfAxesChanged, l = o.onButtonEvent, c = e('../utils/').device.isWebXRAvailable, u = 'https://cdn.aframe.io/controllers/oculus/go/oculus-go-controller.gltf', h = c ? 'oculus-go' : 'Oculus Go', d = c ? { axes: { touchpad: [0, 1] }, buttons: ['trigger', 'none', 'touchpad'] } : { axes: { trackpad: [0, 1] }, buttons: ['trackpad', 'trigger'] } t.exports.Component = r('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: d, bindMethods: function () { ;(this.onModelLoaded = i(this.onModelLoaded, this)), (this.onControllersUpdate = i(this.onControllersUpdate, this)), (this.checkIfControllerPresent = i(this.checkIfControllerPresent, this)), (this.removeControllersUpdateListener = i( this.removeControllersUpdateListener, this, )), (this.onAxisMoved = i(this.onAxisMoved, this)) }, init: function () { var e = this ;(this.onButtonChanged = i(this.onButtonChanged, this)), (this.onButtonDown = function (t) { l(t.detail.id, 'down', e) }), (this.onButtonUp = function (t) { l(t.detail.id, 'up', e) }), (this.onButtonTouchStart = function (t) { l(t.detail.id, 'touchstart', e) }), (this.onButtonTouchEnd = function (t) { l(t.detail.id, 'touchend', e) }), (this.controllerPresent = !1), (this.lastControllerCheck = 0), (this.rendererSystem = this.el.sceneEl.systems.renderer), this.bindMethods() }, 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('model-loaded', this.onModelLoaded), e.addEventListener('axismove', this.onAxisMoved), (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('model-loaded', this.onModelLoaded), e.removeEventListener('axismove', this.onAxisMoved), (this.controllerEventsActive = !1) }, checkIfControllerPresent: function () { a(this, h, this.data.hand ? { hand: this.data.hand } : {}) }, play: function () { this.checkIfControllerPresent(), this.addControllersUpdateListener() }, pause: function () { this.removeEventListeners(), this.removeControllersUpdateListener() }, injectTrackedControls: function () { var e = this.el, t = this.data e.setAttribute('tracked-controls', { armModel: t.armModel, hand: t.hand, idPrefix: h, orientationOffset: t.orientationOffset, }), this.data.model && this.el.setAttribute('gltf-model', u) }, 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 (e) { var t, n = e.detail.model this.data.model && (((t = this.buttonMeshes = {}).trigger = n.getObjectByName( 'oculus_go_button_trigger', )), (t.trackpad = n.getObjectByName('oculus_go_touchpad')), (t.touchpad = n.getObjectByName('oculus_go_touchpad'))) }, onButtonChanged: function (e) { var t = this.mapping.buttons[e.detail.id] t && this.el.emit(t + 'changed', e.detail.state) }, onAxisMoved: function (e) { s(this, this.mapping.axes, e) }, updateModel: function (e, t) { this.data.model && this.updateButtonModel(e, t) }, updateButtonModel: function (e, t) { var n = this.buttonMeshes if (n && n[e]) { var r, i switch (t) { case 'down': r = this.data.buttonHighlightColor break case 'touchstart': r = this.data.buttonTouchedColor break default: r = this.data.buttonColor } ;(i = n[e]).material.color.set(r), this.rendererSystem.applyColorCorrection(i.material.color) } }, }) }, { '../core/component': 131, '../utils/': 205, '../utils/bind': 199, '../utils/tracked-controls': 214, }, ], 95: [ function (e, t, n) { var r = e('../utils/bind'), i = e('../core/component').registerComponent, o = e('../lib/three'), a = e('../utils/tracked-controls'), s = a.checkControllerPresentAndSetup, l = a.emitIfAxesChanged, c = a.onButtonEvent, u = e('../utils/').device.isWebXRAvailable, h = 'oculus-touch', d = u ? h : 'Oculus Touch', p = 'https://cdn.aframe.io/controllers/oculus/oculus-touch-controller-', f = { left: { modelUrl: p + 'left.gltf', rayOrigin: { origin: { x: 0.008, y: -0.01, z: 0 }, direction: { x: 0, y: -0.8, z: -1 }, }, modelPivotOffset: new o.Vector3(-0.005, 0.003, -0.055), modelPivotRotation: new o.Euler(0, 0, 0), }, right: { modelUrl: p + 'right.gltf', rayOrigin: { origin: { x: -0.008, y: -0.01, z: 0 }, direction: { x: 0, y: -0.8, z: -1 }, }, modelPivotOffset: new o.Vector3(0.005, 0.003, -0.055), modelPivotRotation: new o.Euler(0, 0, 0), }, }, m = { left: { modelUrl: p + 'left.gltf', rayOrigin: { origin: { x: 0.002, y: -0.005, z: -0.03 }, direction: { x: 0, y: -0.8, z: -1 }, }, modelPivotOffset: new o.Vector3(-0.005, 0.036, -0.037), modelPivotRotation: new o.Euler(Math.PI / 4.5, 0, 0), }, right: { modelUrl: p + 'right.gltf', rayOrigin: { origin: { x: -0.002, y: -0.005, z: -0.03 }, direction: { x: 0, y: -0.8, z: -1 }, }, modelPivotOffset: new o.Vector3(0.005, 0.036, -0.037), modelPivotRotation: new o.Euler(Math.PI / 4.5, 0, 0), }, }, v = 'oculus-touch', g = { 'oculus-touch': u ? m : f, 'oculus-touch-v2': { left: { modelUrl: p + 'gen2-left.gltf', rayOrigin: { origin: { x: -0.01, y: 0, z: -0.02 }, direction: { x: 0, y: -0.5, z: -1 }, }, modelPivotOffset: new o.Vector3(0, 0, 0), modelPivotRotation: new o.Euler(0, 0, 0), }, right: { modelUrl: p + 'gen2-right.gltf', rayOrigin: { origin: { x: 0.01, y: 0, z: -0.02 }, direction: { x: 0, y: -0.5, z: -1 }, }, modelPivotOffset: new o.Vector3(0, 0, 0), modelPivotRotation: new o.Euler(0, 0, 0), }, }, 'oculus-touch-v3': { left: { modelUrl: p + 'v3-left.glb', rayOrigin: { origin: { x: 0.015, y: 0.005, z: 0 }, direction: { x: 0, y: 0, z: -1 }, }, modelPivotOffset: new o.Vector3(0.01, -0.01, 0.05), modelPivotRotation: new o.Euler(Math.PI / 4, 0, 0), }, right: { modelUrl: p + 'v3-right.glb', rayOrigin: { origin: { x: -0.015, y: 0.005, z: 0 }, direction: { x: 0, y: 0, z: -1 }, }, modelPivotOffset: new o.Vector3(-0.01, -0.01, 0.05), modelPivotRotation: new o.Euler(Math.PI / 4, 0, 0), }, }, }, y = u ? { 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', ], }, } : { left: { axes: { thumbstick: [0, 1] }, buttons: [ 'thumbstick', 'trigger', 'grip', 'xbutton', 'ybutton', 'surface', ], }, right: { axes: { thumbstick: [0, 1] }, buttons: [ 'thumbstick', 'trigger', 'grip', 'abutton', 'bbutton', 'surface', ], }, } t.exports.Component = i('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', 'oculus-touch-v3'], }, orientationOffset: { type: 'vec3', default: { x: 43, y: 0, z: 0 } }, }, mapping: y, bindMethods: function () { ;(this.onModelLoaded = r(this.onModelLoaded, this)), (this.onControllersUpdate = r(this.onControllersUpdate, this)), (this.checkIfControllerPresent = r(this.checkIfControllerPresent, this)), (this.onAxisMoved = r(this.onAxisMoved, this)) }, init: function () { var e = this ;(this.onButtonChanged = r(this.onButtonChanged, this)), (this.onButtonDown = function (t) { c(t.detail.id, 'down', e, e.data.hand) }), (this.onButtonUp = function (t) { c(t.detail.id, 'up', e, e.data.hand) }), (this.onButtonTouchStart = function (t) { c(t.detail.id, 'touchstart', e, e.data.hand) }), (this.onButtonTouchEnd = function (t) { c(t.detail.id, 'touchend', e, e.data.hand) }), (this.controllerPresent = !1), (this.lastControllerCheck = 0), (this.previousButtonValues = {}), (this.rendererSystem = this.el.sceneEl.systems.renderer), this.bindMethods() }, 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-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-loaded', this.onModelLoaded), (this.controllerEventsActive = !1) }, checkIfControllerPresent: function () { s(this, d, { hand: this.data.hand }) }, play: function () { this.checkIfControllerPresent(), this.addControllersUpdateListener() }, pause: function () { this.removeEventListeners(), this.removeControllersUpdateListener() }, loadModel: function (e) { var t, n = this.data if (n.model) { if ( ((this.displayModel = g[n.controllerType] || g[v]), 'auto' === n.controllerType) ) { var r = this.el.sceneEl.systems['tracked-controls-webvr'] if (r && r.vrDisplay) { var i = r.vrDisplay.displayName ;/^Oculus Quest$/.test(i) && (this.displayModel = g['oculus-touch-v2']) } else (t = v), (t = -1 !== e.profiles.indexOf('oculus-touch-v2') ? 'oculus-touch-v2' : t), (t = -1 !== e.profiles.indexOf('oculus-touch-v3') ? 'oculus-touch-v3' : t), (this.displayModel = g[t]) } var o = this.displayModel[n.hand].modelUrl this.el.setAttribute('gltf-model', o) } }, injectTrackedControls: function (e) { var t = this.data, n = h, r = 'right' === t.hand ? 'Oculus Touch (Right)' : 'Oculus Touch (Left)', i = u ? n : r this.el.setAttribute('tracked-controls', { id: i, hand: t.hand, orientationOffset: t.orientationOffset, handTrackingEnabled: !1, }), this.loadModel(e) }, 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 (e) { var t, n = this.mapping[this.data.hand].buttons[e.detail.id], r = this.buttonMeshes n && (('trigger' !== n && 'grip' !== n) || (t = e.detail.state.value), r && ('trigger' === n && r.trigger && (r.trigger.rotation.x = this.originalXRotationTrigger - t * (Math.PI / 26)), 'grip' === n && r.grip && (r.grip.position.x = this.originalXPositionGrip + ('left' === this.data.hand ? -1 : 1) * t * 0.004)), this.el.emit(n + 'changed', e.detail.state)) }, onModelLoaded: function (e) { var t, n = (this.controllerObject3D = e.detail.model) this.data.model && (((t = this.buttonMeshes = {}).grip = n.getObjectByName('buttonHand')), (this.originalXPositionGrip = t.grip && t.grip.position.x), (t.thumbstick = n.getObjectByName('stick')), (t.trigger = n.getObjectByName('buttonTrigger')), (this.originalXRotationTrigger = t.trigger && t.trigger.rotation.x), (t.xbutton = n.getObjectByName('buttonX')), (t.abutton = n.getObjectByName('buttonA')), (t.ybutton = n.getObjectByName('buttonY')), (t.bbutton = n.getObjectByName('buttonB')), n.position.copy(this.displayModel[this.data.hand].modelPivotOffset), n.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 (e) { l(this, this.mapping[this.data.hand].axes, e) }, updateModel: function (e, t) { this.data.model && this.updateButtonModel(e, t) }, updateButtonModel: function (e, t) { var n, r = 'up' === t || 'touchend' === t ? this.data.buttonColor : 'touchstart' === t ? this.data.buttonTouchColor : this.data.buttonHighlightColor, i = this.buttonMeshes this.data.model && i && i[e] && ((n = i[e]).material.color.set(r), this.rendererSystem.applyColorCorrection(n.material.color)) }, }) }, { '../core/component': 131, '../lib/three': 179, '../utils/': 205, '../utils/bind': 199, '../utils/tracked-controls': 214, }, ], 96: [ function (e, t, n) { var r = e('../core/component').registerComponent t.exports.Component = r('position', { schema: { type: 'vec3' }, update: function () { var e = this.el.object3D, t = this.data e.position.set(t.x, t.y, t.z) }, remove: function () { this.el.object3D.position.set(0, 0, 0) }, }) }, { '../core/component': 131 }, ], 97: [ function (e, t, n) { var r = e('../core/component').registerComponent, i = e('../lib/three'), o = e('../utils/').debug('components:raycaster:warn'), a = /^[\w\s-.,[\]#]*$/, s = { childList: !0, attributes: !0, subtree: !0 }, l = { INTERSECT: 'raycaster-intersected', INTERSECTION: 'raycaster-intersection', INTERSECT_CLEAR: 'raycaster-intersected-cleared', INTERSECTION_CLEAR: 'raycaster-intersection-cleared', } function c(e, t) { var n for (e.length = t.length, n = 0; n < t.length; n++) e[n] = t[n] } t.exports.Component = r('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 }, lineColor: { default: 'white' }, lineOpacity: { default: 1 }, useWorldCoordinates: { default: !1 }, }, multiple: !0, init: function () { ;(this.clearedIntersectedEls = []), (this.unitLineEndVec3 = new i.Vector3()), (this.intersectedEls = []), (this.intersections = []), (this.newIntersectedEls = []), (this.newIntersections = []), (this.objects = []), (this.prevCheckTime = void 0), (this.prevIntersectedEls = []), (this.rawIntersections = []), (this.raycaster = new i.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 i.Vector3()), (this.otherLineEndVec3 = new i.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, n = this.el, r = this.raycaster ;(r.far = t.far), (r.near = t.near), !t.showLine || (t.far === e.far && t.origin === e.origin && t.direction === e.direction && e.showLine) || (this.unitLineEndVec3.copy(t.origin).add(t.direction).normalize(), this.drawLine()), !t.showLine && e.showLine && n.removeAttribute('line'), t.objects === e.objects || a.test(t.objects) || o( '[raycaster] Selector "' + t.objects + '" may not update automatically with DOM changes.', ), t.objects || o( '[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 && n.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, s), 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) }, tock: function (e) { var t = this.data, n = this.prevCheckTime t.enabled && ((n && e - n < t.interval) || ((this.prevCheckTime = e), this.checkIntersections())) }, checkIntersections: function () { var e, t, n = this.clearedIntersectedEls, r = this.el, i = this.data, o = this.intersectedEls, a = this.intersections, s = this.newIntersectedEls, u = this.newIntersections, h = this.prevIntersectedEls, d = this.rawIntersections for ( this.dirty && this.refreshObjects(), c(this.prevIntersectedEls, this.intersectedEls), this.updateOriginDirection(), d.length = 0, this.raycaster.intersectObjects(this.objects, !0, d), a.length = 0, o.length = 0, e = 0; e < d.length; e++ ) (t = d[e]), (i.showLine && t.object === r.getObject3D('line')) || (t.object.el && (a.push(t), o.push(t.object.el))) for (u.length = 0, s.length = 0, e = 0; e < a.length; e++) -1 === h.indexOf(a[e].object.el) && (u.push(a[e]), s.push(a[e].object.el)) for (n.length = 0, e = 0; e < h.length; e++) -1 === o.indexOf(h[e]) && (h[e].emit(l.INTERSECT_CLEAR, this.intersectedClearedDetail), n.push(h[e])) for ( n.length && r.emit(l.INTERSECTION_CLEAR, this.intersectionClearedDetail), e = 0; e < s.length; e++ ) s[e].emit(l.INTERSECT, this.intersectedDetail) u.length && ((this.intersectionDetail.els = s), (this.intersectionDetail.intersections = u), r.emit(l.INTERSECTION, this.intersectionDetail)), i.showLine && setTimeout(this.updateLine) }, updateLine: function () { var e, t = this.el, n = this.intersections n.length && (e = n[0].object.el === t && n[1] ? n[1].distance : n[0].distance), this.drawLine(e) }, getIntersection: function (e) { var t, n for (t = 0; t < this.intersections.length; t++) if ((n = this.intersections[t]).object.el === e) return n return null }, updateOriginDirection: (function () { var e = new i.Vector3(), t = new i.Vector3() return function () { var n = this.el, r = this.data r.useWorldCoordinates ? this.raycaster.set(r.origin, r.direction) : (n.object3D.updateMatrixWorld(), t.setFromMatrixPosition(n.object3D.matrixWorld), (0 === r.origin.x && 0 === r.origin.y && 0 === r.origin.z) || (t = n.object3D.localToWorld(t.copy(r.origin))), e .copy(r.direction) .transformDirection(n.object3D.matrixWorld) .normalize(), this.raycaster.set(t, e)) } })(), drawLine: function (e) { var t, n = this.data, r = this.el ;(t = this.lineData.end === this.lineEndVec3 ? this.otherLineEndVec3 : this.lineEndVec3), void 0 === e && (e = n.far === 1 / 0 ? 1e3 : n.far), (this.lineData.start = n.origin), (this.lineData.end = t.copy(this.unitLineEndVec3).multiplyScalar(e)), (this.lineData.color = n.lineColor), (this.lineData.opacity = n.lineOpacity), r.setAttribute('line', this.lineData) }, flattenObject3DMaps: function (e) { var t, n, r = this.objects for (r.length = 0, n = 0; n < e.length; n++) if (e[n].isEntity && e[n].object3D) for (t in e[n].object3DMap) r.push(e[n].getObject3D(t)) return r }, clearAllIntersections: function () { var e for (e = 0; e < this.intersectedEls.length; e++) this.intersectedEls[e].emit(l.INTERSECT_CLEAR, this.intersectedClearedDetail) c(this.clearedIntersectedEls, this.intersectedEls), (this.intersectedEls.length = 0), (this.intersections.length = 0), this.el.emit(l.INTERSECTION_CLEAR, this.intersectionClearedDetail) }, }) }, { '../core/component': 131, '../lib/three': 179, '../utils/': 205 }, ], 98: [ function (e, t, n) { var r = e('../lib/three').Math.degToRad, i = e('../core/component').registerComponent t.exports.Component = i('rotation', { schema: { type: 'vec3' }, update: function () { var e = this.data, t = this.el.object3D t.rotation.set(r(e.x), r(e.y), r(e.z)), (t.rotation.order = 'YXZ') }, remove: function () { this.el.object3D.rotation.set(0, 0, 0) }, }) }, { '../core/component': 131, '../lib/three': 179 }, ], 99: [ function (e, t, n) { var r = e('../core/component').registerComponent, i = 1e-5 t.exports.Component = r('scale', { schema: { type: 'vec3', default: { x: 1, y: 1, z: 1 } }, update: function () { var e = this.data, t = this.el.object3D, n = 0 === e.x ? i : e.x, r = 0 === e.y ? i : e.y, o = 0 === e.z ? i : e.z t.scale.set(n, r, o) }, remove: function () { this.el.object3D.scale.set(1, 1, 1) }, }) }, { '../core/component': 131 }, ], 100: [ function (e, t, n) { var r = e('../../core/component').registerComponent, i = e('../../core/component').components t.exports.Component = r('background', { schema: { color: { type: 'color', default: 'black' }, transparent: { default: !1 }, }, update: function () { var e = this.data, t = this.el.object3D e.transparent ? (t.background = null) : (t.background = new THREE.Color(e.color)) }, remove: function () { var e = this.data, t = this.el.object3D e.transparent ? (t.background = null) : (t.background = i[this.name].schema.color.default) }, }) }, { '../../core/component': 131 }, ], 101: [ function (e, t, n) { var r = e('../../core/component').registerComponent t.exports.Component = r('debug', { schema: { default: !0 } }) }, { '../../core/component': 131 }, ], 102: [ function (e, t, n) { var r = e('../../core/component').registerComponent, i = e('../../utils/'), o = i.bind, a = e('../../constants/'), s = 'a-modal', l = 'a-dialog', c = 'a-dialog-text', u = 'a-dialog-text-container', h = 'a-dialog-buttons-container', d = 'a-dialog-button', p = 'a-dialog-allow-button', f = 'a-dialog-deny-button', m = 'a-dialog-ok-button' function v(e, t, n, r, i) { var o, s, l return ( (o = document.createElement('div')).classList.add(h), (s = document.createElement('button')).classList.add(d, f), s.setAttribute(a.AFRAME_INJECTED, ''), (s.innerHTML = e), o.appendChild(s), (l = document.createElement('button')).classList.add(d, p), l.setAttribute(a.AFRAME_INJECTED, ''), (l.innerHTML = t), o.appendChild(l), l.addEventListener('click', function (e) { e.stopPropagation(), r() }), s.addEventListener('click', function (e) { e.stopPropagation(), i() }), y(n, o) ) } function g(e, t, n) { var r, i return ( (r = document.createElement('div')).classList.add(h), (i = document.createElement('button')).classList.add(d, m), i.setAttribute(a.AFRAME_INJECTED, ''), (i.innerHTML = e), r.appendChild(i), i.addEventListener('click', function (e) { e.stopPropagation(), n() }), y(t, r) ) } function y(e, t) { var n, r, i, o return ( (n = document.createElement('div')).classList.add(s), n.setAttribute(a.AFRAME_INJECTED, ''), ((r = document.createElement('div')).className = l), r.setAttribute(a.AFRAME_INJECTED, ''), n.appendChild(r), (i = document.createElement('div')).classList.add(u), r.appendChild(i), (o = document.createElement('div')).classList.add(c), (o.innerHTML = e), i.appendChild(o), r.appendChild(t), n ) } t.exports.Component = r('device-orientation-permission-ui', { schema: { enabled: { default: !0 }, deviceMotionMessage: { default: 'This immersive website requires access to your device motion sensors.', }, mobileDesktopMessage: { default: 'Set your browser to request the mobile version of the site and reload the page to enjoy immersive mode.', }, httpsMessage: { default: 'Access this site over HTTPS to enter VR mode and grant access to the device sensors.', }, denyButtonText: { default: 'Deny' }, allowButtonText: { default: 'Allow' }, cancelButtonText: { default: 'Cancel' }, }, init: function () { var e = this this.data.enabled && ('localhost' !== location.hostname && '127.0.0.1' !== location.hostname && 'http:' === location.protocol && this.showHTTPAlert(), i.device.isMobileDeviceRequestingDesktopSite() ? this.showMobileDesktopModeAlert() : 'undefined' !== typeof DeviceOrientationEvent && DeviceOrientationEvent.requestPermission ? ((this.onDeviceMotionDialogAllowClicked = o( this.onDeviceMotionDialogAllowClicked, this, )), (this.onDeviceMotionDialogDenyClicked = o( this.onDeviceMotionDialogDenyClicked, this, )), DeviceOrientationEvent.requestPermission() .catch(function () { ;(e.devicePermissionDialogEl = v( e.data.denyButtonText, e.data.allowButtonText, e.data.deviceMotionMessage, e.onDeviceMotionDialogAllowClicked, e.onDeviceMotionDialogDenyClicked, )), e.el.appendChild(e.devicePermissionDialogEl) }) .then(function () { e.el.emit('deviceorientationpermissiongranted'), (e.permissionGranted = !0) })) : (this.permissionGranted = !0)) }, remove: function () { this.devicePermissionDialogEl && this.el.removeChild(this.devicePermissionDialogEl) }, onDeviceMotionDialogDenyClicked: function () { this.remove() }, showMobileDesktopModeAlert: function () { var e = this, t = g(e.data.cancelButtonText, e.data.mobileDesktopMessage, function () { e.el.removeChild(t) }) this.el.appendChild(t) }, showHTTPAlert: function () { var e = this, t = g(e.data.cancelButtonText, e.data.httpsMessage, 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/': 123, '../../core/component': 131, '../../utils/': 205 }, ], 103: [ function (e, t, n) { var r = e('../../core/component').registerComponent t.exports.Component = r('embedded', { dependencies: ['vr-mode-ui'], schema: { default: !0 }, update: function () { var e = this.el, t = e.querySelector('.a-enter-vr') !0 === this.data ? (t && t.classList.add('embedded'), e.removeFullScreenStyles()) : (t && t.classList.remove('embedded'), e.addFullScreenStyles()) }, }) }, { '../../core/component': 131 }, ], 104: [ function (e, t, n) { var r = e('../../core/component').registerComponent, i = e('../../lib/three'), o = e('../../utils/debug')('components:fog:warn') function a(e) { var t return ( ((t = 'exponential' === e.type ? new i.FogExp2(e.color, e.density) : new i.Fog(e.color, e.near, e.far)).name = e.type), t ) } t.exports.Component = r('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, t = this.el, n = this.el.object3D.fog if (t.isScene) return n && e.type === n.name ? void Object.keys(this.schema).forEach(function (t) { var r = e[t] 'color' === t && (r = new i.Color(r)), (n[t] = r) }) : ((t.object3D.fog = a(e)), void t.systems.material.updateMaterials()) o('Fog component can only be applied to ') }, remove: function () { var e = this.el.object3D.fog e && ((e.far = 0), (e.near = 0.1)) }, }) }, { '../../core/component': 131, '../../lib/three': 179, '../../utils/debug': 201 }, ], 105: [ function (e, t, n) { ;(function (n) { var r = e('../../constants').AFRAME_INJECTED, i = e('../../../package'), o = e('../../core/component').registerComponent, a = e('../../utils/') function s(e) { var t = e.split('.') return (t[2] = 'x'), t.join('.') } var l = 'https://aframe.io/aframe-inspector/dist/aframe-inspector.js', c = 'https://unpkg.com/aframe-inspector@' + s(i.version) + '/dist/aframe-inspector.min.js', u = 'dev' === n.env.INSPECTOR_VERSION ? l : c, h = 'Loading Inspector', d = 'Error loading Inspector' t.exports.Component = o('inspector', { schema: { url: { default: u } }, 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 = a.getUrlParameter('inspector')) && e && (this.openInspector(), (this.firstPlay = !1)) }, initOverlay: function () { var e = '...' ;(this.loadingMessageEl = document.createElement('div')), this.loadingMessageEl.classList.add('a-inspector-loader'), (this.loadingMessageEl.innerHTML = h + e) }, remove: function () { this.removeEventListeners() }, onKeydown: function (e) { 73 === e.keyCode && ((e.ctrlKey && e.altKey) || e.getModifierState('AltGraph')) && 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 t, n = this AFRAME.INSPECTOR || AFRAME.inspectorInjected ? AFRAME.INSPECTOR.open(e) : (this.showLoader(), ((t = document.createElement('script')).src = this.data.url), t.setAttribute('data-name', 'aframe-inspector'), t.setAttribute(r, ''), (t.onload = function () { AFRAME.INSPECTOR.open(e), n.hideLoader(), n.removeEventListeners() }), (t.onerror = function () { n.loadingMessageEl.innerHTML = d }), document.head.appendChild(t), (AFRAME.inspectorInjected = !0)) }, removeEventListeners: function () { window.removeEventListener('keydown', this.onKeydown), window.removeEventListener('message', this.onMessage) }, }) }.call(this, e('_process'))) }, { '../../../package': 73, '../../constants': 123, '../../core/component': 131, '../../utils/': 205, _process: 49, }, ], 106: [ function (e, t, n) { var r = e('../../core/component').registerComponent, i = e('../../utils/').shouldCaptureKeyEvent t.exports.Component = r('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 i(e) && (this.enterVREnabled && 70 === e.keyCode && t.enterVR(), this.enterVREnabled && 27 === e.keyCode && t.exitVR()) }, }) }, { '../../core/component': 131, '../../utils/': 205 }, ], 107: [ function (e, t, n) { var r = e('../../utils/debug'), i = e('../../core/component').registerComponent, o = r('components:pool:warn') t.exports.Component = i('pool', { schema: { container: { default: '' }, mixin: { default: '' }, size: { default: 0 }, dynamic: { default: !1 }, }, multiple: !0, initPool: function () { var e for ( this.availableEls = [], this.usedEls = [], this.data.mixin || o('No mixin provided for pool component.'), this.data.container && ((this.container = document.querySelector(this.data.container)), this.container || o('Container ' + this.data.container + ' not found.')), this.container = this.container || this.el, e = 0; e < this.data.size; ++e ) this.createEntity() }, update: function (e) { var t = this.data ;(e.mixin === t.mixin && e.size === t.size) || this.initPool() }, createEntity: function () { var e ;((e = document.createElement('a-entity')).play = this.wrapPlay(e.play)), e.setAttribute('mixin', this.data.mixin), (e.object3D.visible = !1), e.pause(), this.container.appendChild(e), this.availableEls.push(e) }, wrapPlay: function (e) { var t = this.usedEls return function () { ;-1 !== t.indexOf(this) && e.call(this) } }, requestEntity: function () { var e if (0 === this.availableEls.length) { if (!1 === this.data.dynamic) return void o('Requested entity from empty pool: ' + this.attrName) o( '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 ( (e = this.availableEls.shift()), this.usedEls.push(e), (e.object3D.visible = !0), e ) }, returnEntity: function (e) { var t = this.usedEls.indexOf(e) if (-1 !== t) return ( this.usedEls.splice(t, 1), this.availableEls.push(e), (e.object3D.visible = !1), e.pause(), e ) o('The returned entity was not previously pooled from ' + this.attrName) }, }) }, { '../../core/component': 131, '../../utils/debug': 201 }, ], 108: [ function (e, t, n) { var r = e('../../core/component').registerComponent, i = e('../../lib/three'), o = [ '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'), a = [ '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') t.exports.Component = r('screenshot', { schema: { width: { default: 4096 }, height: { default: 2048 }, camera: { type: 'selector' }, }, init: function () { var e = this.el, t = this function n() { var n = e.renderer.getContext() n && ((t.cubeMapSize = n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE)), (t.material = new i.RawShaderMaterial({ uniforms: { map: { type: 't', value: null } }, vertexShader: o, fragmentShader: a, side: i.DoubleSide, })), (t.quad = new i.Mesh(new i.PlaneBufferGeometry(1, 1), t.material)), (t.quad.visible = !1), (t.camera = new i.OrthographicCamera(-0.5, 0.5, 0.5, -0.5, -1e4, 1e4)), (t.canvas = document.createElement('canvas')), (t.ctx = t.canvas.getContext('2d')), e.object3D.add(t.quad), (t.onKeyDown = t.onKeyDown.bind(t))) } e.renderer ? n() : e.addEventListener('render-target-loaded', n) }, getRenderTarget: function (e, t) { return new i.WebGLRenderTarget(e, t, { minFilter: i.LinearFilter, magFilter: i.LinearFilter, wrapS: i.ClampToEdgeWrapping, wrapT: i.ClampToEdgeWrapping, format: i.RGBAFormat, type: i.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 n = e.shiftKey ? 'equirectangular' : 'perspective' this.capture(n) } }, setCapture: function (e) { var t, n, r, o, a = this.el return ( 'perspective' === e ? ((this.quad.visible = !1), (n = (this.data.camera && this.data.camera.components.camera.camera) || a.camera), (t = { width: this.data.width, height: this.data.height })) : ((n = this.camera), (o = new i.WebGLCubeRenderTarget(Math.min(this.cubeMapSize, 2048), { format: i.RGBFormat, generateMipmaps: !0, minFilter: i.LinearMipmapLinearFilter, encoding: i.sRGBEncoding, })), (r = new i.CubeCamera(a.camera.near, a.camera.far, o)), a.camera.getWorldPosition(r.position), a.camera.getWorldQuaternion(r.quaternion), r.update(a.renderer, a.object3D), (this.quad.material.uniforms.map.value = r.renderTarget.texture), (t = { width: this.data.width, height: this.data.height }), (this.quad.visible = !0)), { camera: n, size: t, projection: e } ) }, capture: function (e) { var t, n = 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 = n) }, getCanvas: function (e) { var t = this.el.renderer.xr.enabled, n = this.el.renderer, r = this.setCapture(e) return ( (n.xr.enabled = !1), this.renderCapture(r.camera, r.size, r.projection), (n.xr.enabled = t), this.canvas ) }, renderCapture: function (e, t, n) { var r, i, o, a = this.el.renderer.autoClear, s = this.el, l = s.renderer ;(i = this.getRenderTarget(t.width, t.height)), (o = new Uint8Array(4 * t.width * t.height)), this.resize(t.width, t.height), (l.autoClear = !0), l.clear(), l.setRenderTarget(i), l.render(s.object3D, e), (l.autoClear = a), l.readRenderTargetPixels(i, 0, 0, t.width, t.height, o), l.setRenderTarget(null), 'perspective' === n && (o = this.flipPixelsVertically(o, t.width, t.height)), (r = new ImageData(new Uint8ClampedArray(o), t.width, t.height)), (this.quad.visible = !1), this.ctx.putImageData(r, 0, 0) }, flipPixelsVertically: function (e, t, n) { for (var r = e.slice(0), i = 0; i < t; ++i) for (var o = 0; o < n; ++o) (r[4 * i + o * t * 4] = e[4 * i + (n - o) * t * 4]), (r[4 * i + 1 + o * t * 4] = e[4 * i + 1 + (n - o) * t * 4]), (r[4 * i + 2 + o * t * 4] = e[4 * i + 2 + (n - o) * t * 4]), (r[4 * i + 3 + o * t * 4] = e[4 * i + 3 + (n - o) * t * 4]) return r }, saveCapture: function () { this.canvas.toBlob(function (e) { var t = 'screenshot-' + document.title.toLowerCase() + '-' + Date.now() + '.png', n = document.createElement('a'), r = URL.createObjectURL(e) ;(n.href = r), n.setAttribute('download', t), (n.innerHTML = 'downloading...'), (n.style.display = 'none'), document.body.appendChild(n), setTimeout(function () { n.click(), document.body.removeChild(n) }, 1) }, 'image/png') }, }) }, { '../../core/component': 131, '../../lib/three': 179 }, ], 109: [ function (e, t, n) { var r = e('../../core/component').registerComponent, i = e('../../../vendor/rStats'), o = e('../../utils') e('../../../vendor/rStats.extras'), e('../../lib/rStatsAframe') var a = window.aframeStats, s = o.bind, l = 'a-hidden', c = window.threeStats function u(e) { var t = new c(e.renderer), n = new a(e), r = e.isMobile ? [] : [t, n] return new i({ css: [], values: { fps: { caption: 'fps', below: 30 } }, groups: [{ caption: 'Framerate', values: ['fps', 'raf'] }], plugins: r, }) } t.exports.Component = r('stats', { schema: { default: !0 }, init: function () { var e = this.el 'false' !== o.getUrlParameter('stats') && ((this.stats = u(e)), (this.statsEl = document.querySelector('.rs-base')), (this.hideBound = s(this.hide, this)), (this.showBound = s(this.show, this)), e.addEventListener('enter-vr', this.hideBound), e.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 e = this.stats e && (e('rAF').tick(), e('FPS').frame(), e().update()) }, hide: function () { this.statsEl.classList.add(l) }, show: function () { this.statsEl.classList.remove(l) }, }) }, { '../../../vendor/rStats': 217, '../../../vendor/rStats.extras': 216, '../../core/component': 131, '../../lib/rStatsAframe': 178, '../../utils': 205, }, ], 110: [ function (e, t, n) { var r = e('../../core/component').registerComponent, i = e('../../constants/'), o = e('../../utils/'), a = o.bind, s = 'a-enter-vr', l = 'a-enter-ar', c = 'a-enter-vr-button', u = 'a-enter-ar-button', h = 'a-hidden', d = 'a-orientation-modal' function p(e) { var t, n return ( (n = document.createElement('div')).classList.add(s), n.setAttribute(i.AFRAME_INJECTED, ''), ((t = document.createElement('button')).className = c), t.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.', ), t.setAttribute(i.AFRAME_INJECTED, ''), o.device.isMobile() && v(t), n.appendChild(t), t.addEventListener('click', function (t) { e(), t.stopPropagation() }), n ) } function f(e) { var t, n return ( (n = document.createElement('div')).classList.add(l), n.setAttribute(i.AFRAME_INJECTED, ''), ((t = document.createElement('button')).className = u), t.setAttribute( 'title', 'Enter AR mode with a headset or handheld device. Visit https://webvr.rocks or https://webvr.info for more information.', ), t.setAttribute(i.AFRAME_INJECTED, ''), o.device.isMobile() && v(t), n.appendChild(t), t.addEventListener('click', function (t) { e(), t.stopPropagation() }), n ) } function m(e) { var t = document.createElement('div') ;(t.className = d), t.classList.add(h), t.setAttribute(i.AFRAME_INJECTED, '') var n = document.createElement('button') return ( n.setAttribute(i.AFRAME_INJECTED, ''), (n.innerHTML = 'Exit VR'), n.addEventListener('click', e), t.appendChild(n), t ) } function v(e) { e.addEventListener('touchstart', function () { e.classList.remove('resethover') }), e.addEventListener('touchend', function () { e.classList.add('resethover') }) } t.exports.Component = r('vr-mode-ui', { dependencies: ['canvas'], schema: { enabled: { default: !0 }, enterVRButton: { default: '' }, enterARButton: { default: '' }, }, init: function () { var e = this, t = this.el 'false' !== o.getUrlParameter('ui') && ((this.insideLoader = !1), (this.enterVREl = null), (this.enterAREl = null), (this.orientationModalEl = null), this.bindMethods(), t.addEventListener('enter-vr', this.updateEnterInterfaces), t.addEventListener('exit-vr', this.updateEnterInterfaces), t.addEventListener('update-vr-devices', this.updateEnterInterfaces), window.addEventListener('message', function (t) { 'loaderReady' === t.data.type && ((e.insideLoader = !0), e.remove()) }), window.addEventListener( 'orientationchange', this.toggleOrientationModalIfNeeded, )) }, bindMethods: function () { ;(this.onEnterVRButtonClick = a(this.onEnterVRButtonClick, this)), (this.onEnterARButtonClick = a(this.onEnterARButtonClick, this)), (this.onModalClick = a(this.onModalClick, this)), (this.toggleOrientationModalIfNeeded = a( this.toggleOrientationModalIfNeeded, this, )), (this.updateEnterInterfaces = a(this.updateEnterInterfaces, this)) }, onModalClick: function () { this.el.exitVR() }, onEnterVRButtonClick: function () { this.el.enterVR() }, onEnterARButtonClick: function () { this.el.enterAR() }, update: function () { var e = this.data, t = this.el if (!e.enabled || this.insideLoader || 'false' === o.getUrlParameter('ui')) return this.remove() this.enterVREl || this.enterAREl || this.orientationModalEl || (e.enterVRButton ? ((this.enterVREl = document.querySelector(e.enterVRButton)), this.enterVREl.addEventListener('click', this.onEnterVRButtonClick)) : ((this.enterVREl = p(this.onEnterVRButtonClick)), t.appendChild(this.enterVREl)), e.enterARButton ? ((this.enterAREl = document.querySelector(e.enterARButton)), this.enterAREl.addEventListener('click', this.onEnterARButtonClick)) : ((this.enterAREl = f(this.onEnterARButtonClick)), t.appendChild(this.enterAREl)), (this.orientationModalEl = m(this.onModalClick)), t.appendChild(this.orientationModalEl), this.updateEnterInterfaces()) }, remove: function () { ;[this.enterVREl, this.enterAREl, this.orientationModalEl].forEach(function ( e, ) { e && e.parentNode && e.parentNode.removeChild(e) }), (this.enterVREl = void 0), (this.enterAREl = void 0), (this.orientationModalEl = void 0) }, updateEnterInterfaces: function () { this.toggleEnterVRButtonIfNeeded(), this.toggleEnterARButtonIfNeeded(), this.toggleOrientationModalIfNeeded() }, toggleEnterVRButtonIfNeeded: function () { var e = this.el this.enterVREl && (e.is('vr-mode') ? this.enterVREl.classList.add(h) : this.enterVREl.classList.remove(h)) }, toggleEnterARButtonIfNeeded: function () { var e = this.el this.enterAREl && (e.is('vr-mode') || !o.device.checkARSupport() ? this.enterAREl.classList.add(h) : this.enterAREl.classList.remove(h)) }, toggleOrientationModalIfNeeded: function () { var e = this.el, t = this.orientationModalEl t && e.isMobile && (!o.device.isLandscape() && e.is('vr-mode') ? t.classList.remove(h) : t.classList.add(h)) }, }) }, { '../../constants/': 123, '../../core/component': 131, '../../utils/': 205 }, ], 111: [ function (e, t, n) { var r = e('../core/component'), i = e('../lib/three'), o = e('../utils/bind'), a = r.registerComponent t.exports.Component = a('shadow', { schema: { cast: { default: !0 }, receive: { default: !0 } }, init: function () { ;(this.onMeshChanged = o(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 (r) { if ( r instanceof i.Mesh && ((r.castShadow = e), (r.receiveShadow = t), n.hasLoaded && r.material) ) for ( var o = Array.isArray(r.material) ? r.material : [r.material], a = 0; a < o.length; a++ ) o[a].needsUpdate = !0 }) }, }) }, { '../core/component': 131, '../lib/three': 179, '../utils/bind': 199 }, ], 112: [ function (t, n, r) { var i = t('../core/component').registerComponent, o = t('../utils/debug'), a = t('../lib/three'), s = o('components:sound:warn') n.exports.Component = i('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 a.AudioLoader()), (this.pool = new a.Group()), (this.loaded = !1), (this.mustPlay = !1), (this.playSoundBound = function () { e.playSound() }) }, update: function (e) { var t, n, r = this.data, i = r.src !== e.src if (i) { if (!r.src) return this.setupSound() } for (t = 0; t < this.pool.children.length; t++) (n = this.pool.children[t]), r.positional && (n.setDistanceModel(r.distanceModel), n.setMaxDistance(r.maxDistance), n.setRefDistance(r.refDistance), n.setRolloffFactor(r.rolloffFactor)), n.setLoop(r.loop), n.setVolume(r.volume), (n.isPaused = !1) if ((r.on !== e.on && this.updateEventListener(e.on), i)) { var o = this ;(this.loaded = !1), this.audioLoader.load(r.src, function (e) { for (t = 0; t < o.pool.children.length; t++) (n = o.pool.children[t]).setBuffer(e) ;(o.loaded = !0), a.Cache.remove(r.src), (o.data.autoplay || o.mustPlay) && o.playSound(), o.el.emit('sound-loaded', o.evtDetail, !1) }) } }, pause: function () { this.stopSound(), this.removeEventListener() }, play: function () { this.data.autoplay && this.playSound(), this.updateEventListener() }, remove: function () { var t this.removeEventListener(), this.el.getObject3D(this.attrName) && this.el.removeObject3D(this.attrName) try { for (t = 0; t < this.pool.children.length; t++) this.pool.children[t].disconnect() } catch (e) { s('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, n = this.el, r = n.sceneEl, i = this this.pool.children.length > 0 && (this.stopSound(), n.removeObject3D('sound')) var o = (this.listener = r.audioListener || new a.AudioListener()) for ( r.audioListener = o, r.camera && r.camera.add(o), r.addEventListener('camera-set-active', function (e) { e.detail.cameraEl.getObject3D('camera').add(o) }), this.pool = new a.Group(), e = 0; e < this.data.poolSize; e++ ) (t = this.data.positional ? new a.PositionalAudio(o) : new a.Audio(o)), this.pool.add(t) for ( n.setObject3D(this.attrName, this.pool), e = 0; e < this.pool.children.length; e++ ) (t = this.pool.children[e]).onEnded = function () { ;(this.isPlaying = !1), i.el.emit('sound-ended', i.evtDetail, !1) } }, pauseSound: function () { var e, t for (this.isPlaying = !1, e = 0; e < this.pool.children.length; e++) (t = this.pool.children[e]).source && t.source.buffer && t.isPlaying && !t.isPaused && ((t.isPaused = !0), t.pause()) }, playSound: function (e) { var t, n, r if (!this.loaded) return ( s('Sound not loaded yet. It will be played once it finished loading'), void (this.mustPlay = !0) ) for (t = !1, this.isPlaying = !0, n = 0; n < this.pool.children.length; n++) (r = this.pool.children[n]).isPlaying || !r.buffer || t || (e && e(r), r.play(), (r.isPaused = !1), (t = !0)) t ? (this.mustPlay = !1) : s( '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, ) }, stopSound: function () { var e, t for (this.isPlaying = !1, e = 0; e < this.pool.children.length; e++) { if (!(t = this.pool.children[e]).source || !t.source.buffer) return t.stop() } }, }) }, { '../core/component': 131, '../lib/three': 179, '../utils/debug': 201 }, ], 113: [ function (e, t, n) { var r = e('three-bmfont-text'), i = e('load-bmfont'), o = e('../core/component').registerComponent, a = e('../core/shader'), s = e('../lib/three'), l = e('../utils/'), c = l.debug('components:text:error'), u = a.shaders, h = l.debug('components:text:warn'), d = 1, p = 16, f = 'https://cdn.aframe.io/fonts/', m = { aileronsemibold: f + 'Aileron-Semibold.fnt', dejavu: f + 'DejaVu-sdf.fnt', exo2bold: f + 'Exo2Bold.fnt', exo2semibold: f + 'Exo2SemiBold.fnt', kelsonsans: f + 'KelsonSans.fnt', monoid: f + 'Monoid.fnt', mozillavr: f + 'mozillavr.fnt', roboto: f + 'Roboto-msdf.json', sourcecodepro: f + 'SourceCodePro.fnt', }, v = ['roboto'], g = 'roboto' t.exports.FONTS = m var y = new C(), b = {}, A = {}, w = /^\w+:/ function x(e) { switch (e) { case 'back': return s.FrontSide case 'double': return s.DoubleSide default: return s.BackSide } } function E(e, t) { return new Promise(function (n, r) { i(e, function (i, o) { if (i) return c('Error loading font', e), void r(i) e.indexOf('/Roboto-msdf.json') >= 0 && (t = 30), t && o.chars.map(function (e) { e.yoffset += t }), n(o) }) }) } function M(e) { return new Promise(function (t, n) { new s.ImageLoader().load( e, function (e) { t(e) }, void 0, function () { c('Error loading font image', e), n(null) }, ) }) } function _(e, t, n) { var r, i return ( ((i = new u[t].Shader()).el = e), i.init(n), i.update(n), ((r = i.material).transparent = n.transparent), { material: r, shader: i } ) } function T(e, t, n) { return e || (0.5 + t) * n } function S(e) { var t = 0, n = 0, r = 0 return ( e.chars.map(function (e) { ;(t += e.xadvance), e.id >= 48 && e.id <= 57 && (r++, (n += e.xadvance)) }), r ? n / r : t / e.chars.length ) } function C() { var e = (this.cache = {}) this.get = function (t, n) { return t in e || (e[t] = n()), e[t] } } t.exports.Component = o('text', { multiple: !0, schema: { align: { type: 'string', default: 'left', oneOf: ['left', 'right', 'center'] }, alphaTest: { default: 0.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: g }, 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: u }, 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: 0.001 }, }, init: function () { ;(this.shaderData = {}), (this.geometry = r()), this.createOrUpdateMaterial() }, update: function (e) { var t = this.data, n = this.currentFont A[t.font] ? (this.texture = A[t.font]) : ((this.texture = A[t.font] = new s.Texture()), (this.texture.anisotropy = p)), this.createOrUpdateMaterial(), e.font === t.font ? n && (this.updateGeometry(this.geometry, n), this.updateLayout()) : this.updateFont() }, remove: function () { this.geometry.dispose(), (this.geometry = null), this.el.removeObject3D(this.attrName), this.material.dispose(), (this.material = null), this.texture.dispose(), (this.texture = null), this.shaderObject && delete this.shaderObject }, createOrUpdateMaterial: function () { var e, t, n, r = this.data, i = this.material, o = this.shaderData if ( ((n = r.shader), -1 !== v.indexOf(r.font) || r.font.indexOf('-msdf.') >= 0 ? (n = 'msdf') : r.font in m && -1 === v.indexOf(r.font) && (n = 'sdf'), (e = (this.shaderObject && this.shaderObject.name) !== n), (o.alphaTest = r.alphaTest), (o.color = r.color), (o.map = this.texture), (o.opacity = r.opacity), (o.side = x(r.side)), (o.transparent = r.transparent), (o.negate = r.negate), !e) ) return ( this.shaderObject.update(o), (i.transparent = o.transparent), void (i.side = o.side) ) ;(t = _(this.el, n, o)), (this.material = t.material), (this.shaderObject = t.shader), (this.material.side = o.side), this.mesh && (this.mesh.material = this.material) }, updateFont: function () { var e, t = this.data, n = this.el, r = this.geometry, i = this t.font || h('No font specified. Using the default font.'), this.mesh && (this.mesh.visible = !1), (e = this.lookupFont(t.font || g) || t.font), y .get(e, function () { return E(e, t.yOffset) }) .then(function (o) { var a if (1 !== o.pages.length) throw new Error( 'Currently only single-page bitmap fonts are supported.', ) b[e] || (o.widthFactor = b[o] = S(o)), (i.currentFont = o), (a = i.getFontImageSrc()), y .get(a, function () { return M(a) }) .then(function (e) { var a = i.texture ;(a.image = e), (a.needsUpdate = !0), (A[t.font] = a), (i.texture = a), i.initMesh(), (i.currentFont = o), i.updateGeometry(r, o), i.updateLayout(), (i.mesh.visible = !0), n.emit('textfontset', { font: t.font, fontObj: o }) }) .catch(function (e) { c(e.message), c(e.stack) }) }) .catch(function (e) { c(e.message), c(e.stack) }) }, initMesh: function () { this.mesh || ((this.mesh = new s.Mesh(this.geometry, this.material)), this.el.setObject3D(this.attrName, this.mesh)) }, getFontImageSrc: function () { if (this.data.fontImage) return this.data.fontImage var e = this.lookupFont(this.data.font || g) || this.data.font, t = this.currentFont.pages[0] return t.match(w) && 0 !== t.indexOf('http') ? e.replace(/(\.fnt)|(\.json)/, '.png') : s.LoaderUtils.extractUrlBase(e) + t }, updateLayout: function () { var e, t, n, r, i, o, a, s, l, c = this.el, u = this.data, h = this.geometry, p = this.mesh if (p && h.layout) { if ( ((n = c.getAttribute('geometry')), (r = (o = (a = u.width || (n && n.width) || d) / T(u.wrapPixels, u.wrapCount, this.currentFont.widthFactor)) * ((i = h.layout).height + i.descender)), n && 'plane' === n.primitive && (n.width || c.setAttribute('geometry', 'width', a), n.height || c.setAttribute('geometry', 'height', r)), 'left' === (e = 'align' === u.anchor ? u.align : u.anchor)) ) s = 0 else if ('right' === e) s = -1 * i.width else { if ('center' !== e) throw new TypeError('Invalid text.anchor property value', e) s = (-1 * i.width) / 2 } if ('bottom' === (t = u.baseline)) l = 0 else if ('top' === t) l = -1 * i.height + i.ascender else { if ('center' !== t) throw new TypeError('Invalid text.baseline property value', t) l = (-1 * i.height) / 2 } ;(p.position.x = s * o + u.xOffset), (p.position.y = l * o), (p.position.z = u.zOffset), p.scale.set(o, -1 * o, o) } }, lookupFont: function (e) { return m[e] }, updateGeometry: (function () { var e = {}, t = {}, n = /\\n/g, r = /\\t/g return function (i, o) { var a = this.data ;(t.font = o), (t.lineHeight = a.lineHeight && isFinite(a.lineHeight) ? a.lineHeight : o.common.lineHeight), (t.text = a.value.toString().replace(n, '\n').replace(r, '\t')), (t.width = T(a.wrapPixels, a.wrapCount, o.widthFactor)), i.update(l.extend(e, a, t)) } })(), }) }, { '../core/component': 131, '../core/shader': 141, '../lib/three': 179, '../utils/': 205, 'load-bmfont': 37, 'three-bmfont-text': 63, }, ], 114: [ function (e, t, n) { var r = e('../core/component').registerComponent, i = e('../utils/tracked-controls'), o = e('../constants').DEFAULT_CAMERA_HEIGHT, a = e('../lib/three'), s = e('../constants').DEFAULT_HANDEDNESS, l = { x: 0.175, y: -0.3, z: -0.03 }, c = { x: 0, y: 0, z: -0.175 }, u = { touches: [] }, h = { AXISMOVE: 'axismove', BUTTONCHANGED: 'buttonchanged', BUTTONDOWN: 'buttondown', BUTTONUP: 'buttonup', TOUCHSTART: 'touchstart', TOUCHEND: 'touchend', } t.exports.Component = r('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 a.Vector3()), (this.controllerQuaternion = new a.Quaternion()), (this.controllerEuler = new a.Euler()), this.updateGamepad(), (this.buttonEventDetails = {}) }, tick: function (e, t) { var n = this.el.getObject3D('mesh') n && n.update && n.update(t / 1e3), this.updateGamepad(), this.updatePose(), this.updateButtons() }, defaultUserHeight: function () { return o }, getHeadElement: function () { return this.data.headElement || this.el.sceneEl.camera.el }, updateGamepad: function () { var e = this.data, t = i.findMatchingControllerWebVR( this.system.controllers, e.id, e.idPrefix, e.hand, e.controller, ) ;(this.controller = t), (this.el.components['tracked-controls'].controller = t), this.data.autoHide && (this.el.object3D.visible = !!this.controller) }, applyArmModel: function (e) { var t, n, r, i, o = this.controller, a = this.controllerEuler, u = this.controllerQuaternion, h = this.deltaControllerPosition ;(n = this.getHeadElement().object3D), (i = this.defaultUserHeight()), (r = o.pose), (t = (o ? o.hand : void 0) || s), e.copy(n.position), h.set(l.x * ('left' === t ? -1 : 'right' === t ? 1 : 0), l.y, l.z), h.multiplyScalar(i), h.applyAxisAngle(n.up, n.rotation.y), e.add(h), h.set(c.x, c.y, c.z), h.multiplyScalar(i), r.orientation ? u.fromArray(r.orientation) : u.copy(n.quaternion), a.setFromQuaternion(u), a.set(a.x, a.y, 0), h.applyEuler(a), e.add(h) }, updatePose: function () { var e, t, n = this.controller, r = this.data, i = this.el.object3D, o = this.system.vrDisplay n && ((e = n.pose).position ? i.position.fromArray(e.position) : r.armModel && this.applyArmModel(i.position), e.orientation && i.quaternion.fromArray(e.orientation), o && e.position && ((t = this.el.sceneEl.renderer.xr.getStandingMatrix()), i.matrix.compose(i.position, i.quaternion, i.scale), i.matrix.multiplyMatrices(t, i.matrix), i.matrix.decompose(i.position, i.quaternion, i.scale)), i.rotateX(this.data.orientationOffset.x * a.Math.DEG2RAD), i.rotateY(this.data.orientationOffset.y * a.Math.DEG2RAD), i.rotateZ(this.data.orientationOffset.z * a.Math.DEG2RAD)) }, updateButtons: function () { var e, t, n = this.controller if (n) { for (t = 0; t < n.buttons.length; ++t) this.buttonStates[t] || (this.buttonStates[t] = { pressed: !1, touched: !1, value: 0 }), this.buttonEventDetails[t] || (this.buttonEventDetails[t] = { id: t, state: this.buttonStates[t] }), (e = n.buttons[t]), this.handleButton(t, e) this.handleAxes() } }, handleButton: function (e, t) { return ( !!( this.handlePress(e, t) | this.handleTouch(e, t) | this.handleValue(e, t) ) && (this.el.emit(h.BUTTONCHANGED, this.buttonEventDetails[e], !1), !0) ) }, handleAxes: function () { var e, t = !1, n = this.controller.axes, r = this.axis, i = this.changedAxes for ( this.changedAxes.splice(0, this.changedAxes.length), e = 0; e < n.length; ++e ) i.push(r[e] !== n[e]), i[e] && (t = !0) if (!t) return !1 for (this.axis.splice(0, this.axis.length), e = 0; e < n.length; e++) this.axis.push(n[e]) return this.el.emit(h.AXISMOVE, this.axisMoveEventDetail, !1), !0 }, handlePress: function (e, t) { var n, r = this.buttonStates[e] return ( t.pressed !== r.pressed && ((n = t.pressed ? h.BUTTONDOWN : h.BUTTONUP), this.el.emit(n, this.buttonEventDetails[e], !1), (r.pressed = t.pressed), !0) ) }, handleTouch: function (e, t) { var n, r = this.buttonStates[e] return ( t.touched !== r.touched && ((n = t.touched ? h.TOUCHSTART : h.TOUCHEND), this.el.emit(n, this.buttonEventDetails[e], !1, u), (r.touched = t.touched), !0) ) }, handleValue: function (e, t) { var n = this.buttonStates[e] return t.value !== n.value && ((n.value = t.value), !0) }, }) }, { '../constants': 123, '../core/component': 131, '../lib/three': 179, '../utils/tracked-controls': 214, }, ], 115: [ function (e, t, n) { var r = e('../utils/tracked-controls'), i = e('../core/component').registerComponent, o = { AXISMOVE: 'axismove', BUTTONCHANGED: 'buttonchanged', BUTTONDOWN: 'buttondown', BUTTONUP: 'buttonup', TOUCHSTART: 'touchstart', TOUCHEND: 'touchend', } t.exports.Component = i('tracked-controls-webxr', { schema: { id: { type: 'string', default: '' }, hand: { type: 'string', default: '' }, handTrackingEnabled: { default: !1 }, index: { type: 'int', default: -1 }, iterateControllerProfiles: { default: !1 }, }, init: function () { ;(this.updateController = this.updateController.bind(this)), (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 e = this.el.sceneEl this.updateController(), e.addEventListener('controllersupdated', this.updateController) }, pause: function () { this.el.sceneEl.removeEventListener('controllersupdated', this.updateController) }, isControllerPresent: function (e) { return ( !(!this.controller || this.controller.gamepad) && ('none' === e.inputSource.handedness || e.inputSource.handedness === this.data.hand) ) }, updateController: function () { ;(this.controller = r.findMatchingControllerWebXR( this.system.controllers, this.data.id, this.data.hand, this.data.index, this.data.iterateControllerProfiles, this.data.handTrackingEnabled, )), (this.el.components['tracked-controls'].controller = this.controller), this.data.autoHide && (this.el.object3D.visible = !!this.controller) }, tick: function () { var e = this.el.sceneEl, t = this.controller, n = e.frame t && e.frame && this.system.referenceSpace && (t.hand || ((this.pose = n.getPose(t.targetRaySpace, this.system.referenceSpace)), this.updatePose(), this.updateButtons())) }, updatePose: function () { var e = this.el.object3D, t = this.pose t && ((e.matrix.elements = t.transform.matrix), e.matrix.decompose(e.position, e.rotation, e.scale)) }, updateButtons: function () { var e, t, n, r = this.controller if (r && r.gamepad) { for (n = r.gamepad, t = 0; t < n.buttons.length; ++t) this.buttonStates[t] || (this.buttonStates[t] = { pressed: !1, touched: !1, value: 0 }), this.buttonEventDetails[t] || (this.buttonEventDetails[t] = { id: t, state: this.buttonStates[t] }), (e = n.buttons[t]), this.handleButton(t, e) this.handleAxes() } }, handleButton: function (e, t) { return ( !!( this.handlePress(e, t) | this.handleTouch(e, t) | this.handleValue(e, t) ) && (this.el.emit(o.BUTTONCHANGED, this.buttonEventDetails[e], !1), !0) ) }, handleAxes: function () { var e, t = !1, n = this.controller.gamepad.axes, r = this.axis, i = this.changedAxes for ( this.changedAxes.splice(0, this.changedAxes.length), e = 0; e < n.length; ++e ) i.push(r[e] !== n[e]), i[e] && (t = !0) if (!t) return !1 for (this.axis.splice(0, this.axis.length), e = 0; e < n.length; e++) this.axis.push(n[e]) return this.el.emit(o.AXISMOVE, this.axisMoveEventDetail, !1), !0 }, handlePress: function (e, t) { var n, r = this.buttonStates[e] return ( t.pressed !== r.pressed && ((n = t.pressed ? o.BUTTONDOWN : o.BUTTONUP), this.el.emit(n, this.buttonEventDetails[e], !1), (r.pressed = t.pressed), !0) ) }, handleTouch: function (e, t) { var n, r = this.buttonStates[e] return ( t.touched !== r.touched && ((n = t.touched ? o.TOUCHSTART : o.TOUCHEND), this.el.emit(n, this.buttonEventDetails[e], !1), (r.touched = t.touched), !0) ) }, handleValue: function (e, t) { var n = this.buttonStates[e] return t.value !== n.value && ((n.value = t.value), !0) }, }) }, { '../core/component': 131, '../utils/tracked-controls': 214 }, ], 116: [ function (e, t, n) { var r = e('../core/component').registerComponent t.exports.Component = r('tracked-controls', { schema: { autoHide: { default: !0 }, controller: { default: -1 }, id: { type: 'string', default: '' }, hand: { type: 'string', default: '' }, idPrefix: { type: 'string', default: '' }, handTrackingEnabled: { default: !1 }, 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, handTrackingEnabled: e.handTrackingEnabled, }) : t.setAttribute('tracked-controls-webvr', e) }, }) }, { '../core/component': 131 }, ], 117: [ function (e, t, n) { var r = e('../core/component').registerComponent, i = e('../utils/bind'), o = e('../lib/three'), a = e('../utils/tracked-controls'), s = a.checkControllerPresentAndSetup, l = a.emitIfAxesChanged, c = a.onButtonEvent, u = 'https://cdn.aframe.io/controllers/valve/index/valve-index-', h = { left: u + 'left.glb', right: u + 'right.glb' }, d = 'valve', p = e('../utils/').device.isWebXRAvailable, f = { left: { x: -0.00023692678902063457, y: 0.04724540367838371, z: -0.061959880395271096, }, right: { x: 0.002471558599671131, y: 0.055765208987076195, z: -0.061068168708348844, }, }, m = { left: { x: 0, y: -0.05, z: 0.06 }, right: { x: 0, y: -0.05, z: 0.06 } }, v = { left: { _x: 0.692295102620542, _y: -0.0627618864318427, _z: -0.06265893149611756, _order: 'XYZ', }, right: { _x: 0.6484021229942998, _y: -0.032563619881892894, _z: -0.1327973171917482, _order: 'XYZ', }, }, g = { left: { _x: Math.PI / 3, _y: 0, _z: 0, _order: 'XYZ' }, right: { _x: Math.PI / 3, _y: 0, _z: 0, _order: 'XYZ' }, }, y = p ? g : v, b = p ? m : f t.exports.Component = r('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], thumbstick: [2, 3] }, buttons: ['trigger', 'grip', 'trackpad', 'thumbstick', 'abutton'], }, init: function () { var e = this ;(this.controllerPresent = !1), (this.lastControllerCheck = 0), (this.onButtonChanged = i(this.onButtonChanged, this)), (this.onButtonDown = function (t) { c(t.detail.id, 'down', e) }), (this.onButtonUp = function (t) { c(t.detail.id, 'up', e) }), (this.onButtonTouchEnd = function (t) { c(t.detail.id, 'touchend', e) }), (this.onButtonTouchStart = function (t) { c(t.detail.id, 'touchstart', e) }), (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 = i(this.onModelLoaded, this)), (this.onControllersUpdate = i(this.onControllersUpdate, this)), (this.checkIfControllerPresent = i(this.checkIfControllerPresent, this)), (this.removeControllersUpdateListener = i( this.removeControllersUpdateListener, this, )), (this.onAxisMoved = i(this.onAxisMoved, this)) }, addEventListeners: function () { var e = this.el e.addEventListener('buttonchanged', this.onButtonChanged), e.addEventListener('buttondown', this.onButtonDown), e.addEventListener('buttonup', this.onButtonUp), e.addEventListener('touchend', this.onButtonTouchEnd), e.addEventListener('touchstart', this.onButtonTouchStart), e.addEventListener('model-loaded', this.onModelLoaded), e.addEventListener('axismove', this.onAxisMoved), (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('touchend', this.onButtonTouchEnd), e.removeEventListener('touchstart', this.onButtonTouchStart), e.removeEventListener('model-loaded', this.onModelLoaded), e.removeEventListener('axismove', this.onAxisMoved), (this.controllerEventsActive = !1) }, checkIfControllerPresent: function () { var e = this.data, t = 'right' === e.hand ? 0 : 'left' === e.hand ? 1 : 2 s(this, d, { index: t, iterateControllerProfiles: !0, hand: e.hand }) }, injectTrackedControls: function () { var e = this.el, t = this.data e.setAttribute('tracked-controls', { idPrefix: d, controller: 'right' === t.hand ? 1 : 'left' === t.hand ? 0 : 2, hand: t.hand, orientationOffset: t.orientationOffset, }), this.loadModel() }, loadModel: function () { var e = this.data e.model && this.el.setAttribute('gltf-model', '' + h[e.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 (e) { var t, n = this.mapping.buttons[e.detail.id], r = this.buttonMeshes n && ('trigger' === n && ((t = e.detail.state.value), r && r.trigger && (r.trigger.rotation.x = this.triggerOriginalRotationX - t * (Math.PI / 40))), this.el.emit(n + 'changed', e.detail.state)) }, onModelLoaded: function (e) { var t, n = e.detail.model, r = this this.data.model && (((t = this.buttonMeshes = {}).grip = { left: n.getObjectByName('leftgrip'), right: n.getObjectByName('rightgrip'), }), (t.menu = n.getObjectByName('menubutton')), (t.system = n.getObjectByName('systembutton')), (t.trackpad = n.getObjectByName('touchpad')), (t.trigger = n.getObjectByName('trigger')), (this.triggerOriginalRotationX = t.trigger.rotation.x), Object.keys(t).forEach(function (e) { r.setButtonColor(e, r.data.buttonColor) }), n.position.copy(b[this.data.hand]), n.rotation.copy(y[this.data.hand]), this.el.emit('controllermodelready', { name: 'valve-index-controlls', model: this.data.model, rayOrigin: new o.Vector3(0, 0, 0), })) }, onAxisMoved: function (e) { l(this, this.mapping.axes, e) }, updateModel: function (e, t) { var n this.data.model && (-1 !== t.indexOf('touch') || ((n = 'up' === t ? this.data.buttonColor : this.data.buttonHighlightColor), this.setButtonColor(e, n))) }, setButtonColor: function (e, t) {}, }) }, { '../core/component': 131, '../lib/three': 179, '../utils/': 205, '../utils/bind': 199, '../utils/tracked-controls': 214, }, ], 118: [ function (e, t, n) { var r = e('../core/component').registerComponent t.exports.Component = r('visible', { schema: { default: !0 }, update: function () { this.el.object3D.visible = this.data }, }) }, { '../core/component': 131 }, ], 119: [ function (e, t, n) { var r = e('../core/component').registerComponent, i = e('../utils/bind'), o = e('../utils/tracked-controls'), a = o.checkControllerPresentAndSetup, s = o.emitIfAxesChanged, l = o.onButtonEvent, c = 'https://cdn.aframe.io/controllers/vive/vr_controller_vive.obj', u = 'https://cdn.aframe.io/controllers/vive/vr_controller_vive.mtl', h = e('../utils/').device.isWebXRAvailable, d = h ? 'htc-vive-controller-mv' : 'OpenVR ', p = h ? { axes: { thumbstick: [0, 1] }, buttons: ['trigger', 'grip', 'trackpad', 'none', 'menu'], } : { axes: { trackpad: [0, 1] }, buttons: ['trackpad', 'trigger', 'grip', 'menu', 'system'], } t.exports.Component = r('vive-controls', { schema: { hand: { default: 'left' }, buttonColor: { type: 'color', default: '#FAFAFA' }, buttonHighlightColor: { type: 'color', default: '#22D1EE' }, model: { default: !0 }, orientationOffset: { type: 'vec3' }, }, mapping: p, init: function () { var e = this ;(this.controllerPresent = !1), (this.lastControllerCheck = 0), (this.onButtonChanged = i(this.onButtonChanged, this)), (this.onButtonDown = function (t) { l(t.detail.id, 'down', e) }), (this.onButtonUp = function (t) { l(t.detail.id, 'up', e) }), (this.onButtonTouchEnd = function (t) { l(t.detail.id, 'touchend', e) }), (this.onButtonTouchStart = function (t) { l(t.detail.id, 'touchstart', e) }), (this.previousButtonValues = {}), (this.rendererSystem = this.el.sceneEl.systems.renderer), this.bindMethods() }, update: function () { var e = this.data this.controllerIndex = 'right' === e.hand ? 0 : 'left' === e.hand ? 1 : 2 }, play: function () { this.checkIfControllerPresent(), this.addControllersUpdateListener() }, pause: function () { this.removeEventListeners(), this.removeControllersUpdateListener() }, bindMethods: function () { ;(this.onModelLoaded = i(this.onModelLoaded, this)), (this.onControllersUpdate = i(this.onControllersUpdate, this)), (this.checkIfControllerPresent = i(this.checkIfControllerPresent, this)), (this.removeControllersUpdateListener = i( this.removeControllersUpdateListener, this, )), (this.onAxisMoved = i(this.onAxisMoved, this)) }, addEventListeners: function () { var e = this.el e.addEventListener('buttonchanged', this.onButtonChanged), e.addEventListener('buttondown', this.onButtonDown), e.addEventListener('buttonup', this.onButtonUp), e.addEventListener('touchend', this.onButtonTouchEnd), e.addEventListener('touchstart', this.onButtonTouchStart), e.addEventListener('model-loaded', this.onModelLoaded), e.addEventListener('axismove', this.onAxisMoved), (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('touchend', this.onButtonTouchEnd), e.removeEventListener('touchstart', this.onButtonTouchStart), e.removeEventListener('model-loaded', this.onModelLoaded), e.removeEventListener('axismove', this.onAxisMoved), (this.controllerEventsActive = !1) }, checkIfControllerPresent: function () { var e = this.data a(this, d, { index: this.controllerIndex, hand: e.hand }) }, injectTrackedControls: function () { var e = this.el, t = this.data e.setAttribute('tracked-controls', { idPrefix: d, hand: t.hand, controller: this.controllerIndex, orientationOffset: t.orientationOffset, }), this.data.model && this.el.setAttribute('obj-model', { obj: c, mtl: u }) }, 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 (e) { var t, n = this.mapping.buttons[e.detail.id], r = this.buttonMeshes n && ('trigger' === n && ((t = e.detail.state.value), r && r.trigger && (r.trigger.rotation.x = -t * (Math.PI / 12))), this.el.emit(n + 'changed', e.detail.state)) }, onModelLoaded: function (e) { var t, n = e.detail.model, r = this this.data.model && (((t = this.buttonMeshes = {}).grip = { left: n.getObjectByName('leftgrip'), right: n.getObjectByName('rightgrip'), }), (t.menu = n.getObjectByName('menubutton')), (t.system = n.getObjectByName('systembutton')), (t.trackpad = n.getObjectByName('touchpad')), (t.trigger = n.getObjectByName('trigger')), Object.keys(t).forEach(function (e) { r.setButtonColor(e, r.data.buttonColor) }), n.position.set(0, -0.015, 0.04)) }, onAxisMoved: function (e) { s(this, this.mapping.axes, e) }, updateModel: function (e, t) { var n this.data.model && (-1 !== t.indexOf('touch') || ((n = 'up' === t ? this.data.buttonColor : this.data.buttonHighlightColor), this.setButtonColor(e, n))) }, setButtonColor: function (e, t) { var n = this.buttonMeshes, r = this.rendererSystem if (n) { if ('grip' === e) return ( n.grip.left.material.color.set(t), n.grip.right.material.color.set(t), r.applyColorCorrection(n.grip.left.material.color), void r.applyColorCorrection(n.grip.right.material.color) ) n[e].material.color.set(t), r.applyColorCorrection(n[e].material.color) } }, }) }, { '../core/component': 131, '../utils/': 205, '../utils/bind': 199, '../utils/tracked-controls': 214, }, ], 120: [ function (e, t, n) { var r = e('../core/component').registerComponent, i = e('../utils/bind'), o = e('../utils/tracked-controls'), a = o.checkControllerPresentAndSetup, s = o.emitIfAxesChanged, l = o.onButtonEvent, c = 'HTC Vive Focus', u = 'https://cdn.aframe.io/controllers/vive/focus-controller/focus-controller.gltf' t.exports.Component = r('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 = i(this.onModelLoaded, this)), (this.onControllersUpdate = i(this.onControllersUpdate, this)), (this.checkIfControllerPresent = i(this.checkIfControllerPresent, this)), (this.removeControllersUpdateListener = i( this.removeControllersUpdateListener, this, )), (this.onAxisMoved = i(this.onAxisMoved, this)) }, init: function () { var e = this ;(this.onButtonChanged = i(this.onButtonChanged, this)), (this.onButtonDown = function (t) { l(t.detail.id, 'down', e) }), (this.onButtonUp = function (t) { l(t.detail.id, 'up', e) }), (this.onButtonTouchStart = function (t) { l(t.detail.id, 'touchstart', e) }), (this.onButtonTouchEnd = function (t) { l(t.detail.id, 'touchend', e) }), (this.controllerPresent = !1), (this.lastControllerCheck = 0), this.bindMethods() }, 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('model-loaded', this.onModelLoaded), e.addEventListener('axismove', this.onAxisMoved), (this.controllerEventsActive = !0), this.addControllersUpdateListener() }, 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('model-loaded', this.onModelLoaded), e.removeEventListener('axismove', this.onAxisMoved), (this.controllerEventsActive = !1), this.removeControllersUpdateListener() }, checkIfControllerPresent: function () { a(this, c, this.data.hand ? { hand: this.data.hand } : {}) }, play: function () { this.checkIfControllerPresent(), this.addControllersUpdateListener() }, pause: function () { this.removeEventListeners(), this.removeControllersUpdateListener() }, injectTrackedControls: function () { var e = this.el, t = this.data e.setAttribute('tracked-controls', { armModel: t.armModel, idPrefix: c, orientationOffset: t.orientationOffset, }), this.data.model && this.el.setAttribute('gltf-model', u) }, 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 (e) { var t, n = e.detail.model this.data.model && (((t = this.buttonMeshes = {}).trigger = n.getObjectByName('BumperKey')), (t.triggerPressed = n.getObjectByName('BumperKey_Press')), t.triggerPressed && (t.triggerPressed.visible = !1), (t.trackpad = n.getObjectByName('TouchPad')), (t.trackpadPressed = n.getObjectByName('TouchPad_Press')), t.trackpadPressed && (t.trackpadPressed.visible = !1)) }, onButtonChanged: function (e) { var t = this.mapping.buttons[e.detail.id] t && this.el.emit(t + 'changed', e.detail.state) }, onAxisMoved: function (e) { s(this, this.mapping.axes, e) }, updateModel: function (e, t) { this.data.model && this.updateButtonModel(e, t) }, updateButtonModel: function (e, t) { var n = this.buttonMeshes, r = e + 'Pressed' if (n && n[e] && n[r]) { var i switch (t) { case 'down': i = this.data.buttonHighlightColor break case 'touchstart': i = this.data.buttonTouchedColor } i && n[r].material.color.set(i), (n[r].visible = !!i), (n[e].visible = !i) } }, }) }, { '../core/component': 131, '../utils/bind': 199, '../utils/tracked-controls': 214 }, ], 121: [ function (e, t, n) { var r = e('../constants').keyboardevent.KEYCODE_TO_CODE, i = e('../core/component').registerComponent, o = e('../lib/three'), a = e('../utils/'), s = a.bind, l = a.shouldCaptureKeyEvent, c = 1e-5, u = 0.2, h = [ 'KeyW', 'KeyA', 'KeyS', 'KeyD', 'ArrowUp', 'ArrowLeft', 'ArrowRight', 'ArrowDown', ] function d(e) { var t for (t in e) return !1 return !0 } t.exports.Component = i('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 o.Vector3()), (this.onBlur = s(this.onBlur, this)), (this.onContextMenu = s(this.onContextMenu, this)), (this.onFocus = s(this.onFocus, this)), (this.onKeyDown = s(this.onKeyDown, this)), (this.onKeyUp = s(this.onKeyUp, this)), (this.onVisibilityChange = s(this.onVisibilityChange, this)), this.attachVisibilityEventListeners() }, tick: function (e, t) { var n = this.data, r = this.el, i = this.velocity ;(i[n.adAxis] || i[n.wsAxis] || !d(this.keys)) && ((t /= 1e3), this.updateVelocity(t), (i[n.adAxis] || i[n.wsAxis]) && r.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, n, r, i, o, a = this.data, s = this.keys, l = this.velocity if (((n = a.adAxis), (i = a.wsAxis), e > u)) return (l[n] = 0), void (l[i] = 0) var h = Math.pow(1 / this.easing, 60 * e) 0 !== l[n] && (l[n] = l[n] * h), 0 !== l[i] && (l[i] = l[i] * h), Math.abs(l[n]) < c && (l[n] = 0), Math.abs(l[i]) < c && (l[i] = 0), a.enabled && ((t = a.acceleration), a.adEnabled && ((r = a.adInverted ? -1 : 1), (s.KeyA || s.ArrowLeft) && (l[n] -= r * t * e), (s.KeyD || s.ArrowRight) && (l[n] += r * t * e)), a.wsEnabled && ((o = a.wsInverted ? -1 : 1), (s.KeyW || s.ArrowUp) && (l[i] -= o * t * e), (s.KeyS || s.ArrowDown) && (l[i] += o * t * e))) }, getMovementVector: (function () { var e = new o.Vector3(0, 0, 0), t = new o.Euler(0, 0, 0, 'YXZ') return function (n) { var r, i = this.el.getAttribute('rotation'), a = this.velocity return ( e.copy(a), e.multiplyScalar(n), i ? ((r = this.data.fly ? i.x : 0), t.set(o.Math.degToRad(r), o.Math.degToRad(i.y), 0), e.applyEuler(t), e) : e ) } })(), attachVisibilityEventListeners: function () { ;(window.oncontextmenu = this.onContextMenu), 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) }, onContextMenu: function () { for (var e = Object.keys(this.keys), t = 0; t < e.length; t++) delete this.keys[e[t]] }, onBlur: function () { this.pause() }, onFocus: function () { this.play() }, onVisibilityChange: function () { document.hidden ? this.onBlur() : this.onFocus() }, onKeyDown: function (e) { var t l(e) && ((t = e.code || r[e.keyCode]), -1 !== h.indexOf(t) && (this.keys[t] = !0)) }, onKeyUp: function (e) { var t ;(t = e.code || r[e.keyCode]), delete this.keys[t] }, }) }, { '../constants': 123, '../core/component': 131, '../lib/three': 179, '../utils/': 205, }, ], 122: [ function (e, t, n) { var r = e('../core/component').registerComponent, i = e('../utils/bind'), o = e('../utils/tracked-controls'), a = o.checkControllerPresentAndSetup, s = o.emitIfAxesChanged, l = o.onButtonEvent, c = e('../utils/'), u = c.debug('components:windows-motion-controls:debug'), h = c.debug('components:windows-motion-controls:warn'), d = e('../constants').DEFAULT_HANDEDNESS, p = 'https://cdn.aframe.io/controllers/microsoft/', f = { left: 'left.glb', right: 'right.glb', default: 'universal.glb' }, m = e('../utils/').device.isWebXRAvailable, v = /([0-9a-zA-Z]+-[0-9a-zA-Z]+)$/, g = m ? 'windows-mixed-reality' : 'Spatial Controller (Spatial Interaction Source) ', y = m ? { 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', } : { 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', } t.exports.Component = r('windows-motion-controls', { schema: { hand: { default: d }, pair: { default: 0 }, model: { default: !0 }, hideDisconnected: { default: !0 }, }, mapping: y, bindMethods: function () { ;(this.onModelError = i(this.onModelError, this)), (this.onModelLoaded = i(this.onModelLoaded, this)), (this.onControllersUpdate = i(this.onControllersUpdate, this)), (this.checkIfControllerPresent = i(this.checkIfControllerPresent, this)), (this.onAxisMoved = i(this.onAxisMoved, this)) }, init: function () { var e = this, t = this.el ;(this.onButtonChanged = i(this.onButtonChanged, this)), (this.onButtonDown = function (t) { l(t.detail.id, 'down', e) }), (this.onButtonUp = function (t) { l(t.detail.id, 'up', e) }), (this.onButtonTouchStart = function (t) { l(t.detail.id, 'touchstart', e) }), (this.onButtonTouchEnd = function (t) { l(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 () { a(this, g, { 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) { var e = this.createControllerModelUrl() this.loadModel(e) } else this.modelReady() }, createControllerModelUrl: function (e) { var t, n = this.el.components['tracked-controls'], r = n ? n.controller : null, i = 'default', o = this.data.hand if (r && !window.hasNativeWebXRImplementation && ((o = r.hand), !e)) { var a = r.id.match(v) i = (a && a[0]) || i } return (t = f[o] || f.default), p + i + '/' + t }, injectTrackedControls: function () { var e = this.data this.el.setAttribute('tracked-controls', { idPrefix: g, 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 ? (h( 'Failed to load controller model for device, attempting to load default.', ), this.loadModel(t)) : h('Failed to load default controller model.') }, loadModel: function (e) { this.el.setAttribute('gltf-model', 'url(' + e + ')') }, onModelLoaded: function (e) { var t, n, r, i, o = (this.controllerModel = e.detail.model), a = this.loadedMeshInfo if ((u('Processing model'), (a.buttonMeshes = {}), (a.axisMeshes = {}), o)) { for (t = 0; t < this.mapping.buttons.length; t++) (n = this.mapping.buttonMeshNames[this.mapping.buttons[t]]) ? (r = o.getObjectByName(n)) ? (i = { index: t, value: s(r, 'VALUE'), pressed: s(r, 'PRESSED'), unpressed: s(r, 'UNPRESSED'), }).value && i.pressed && i.unpressed ? (a.buttonMeshes[this.mapping.buttons[t]] = i) : h( 'Missing button submesh under mesh with name: ' + n + '(VALUE: ' + !!i.value + ', PRESSED: ' + !!i.pressed + ', UNPRESSED:' + !!i.unpressed + ')', ) : h('Missing button mesh with name: ' + n) : u( 'Skipping unknown button at index: ' + t + ' with mapped name: ' + this.mapping.buttons[t], ) for (t = 0; t < this.mapping.axisMeshNames.length; t++) (n = this.mapping.axisMeshNames[t]) ? (r = o.getObjectByName(n)) ? (i = { index: t, value: s(r, 'VALUE'), min: s(r, 'MIN'), max: s(r, 'MAX'), }).value && i.min && i.max ? (a.axisMeshes[t] = i) : h( 'Missing axis submesh under mesh with name: ' + n + '(VALUE: ' + !!i.value + ', MIN: ' + !!i.min + ', MAX:' + !!i.max + ')', ) : h('Missing axis mesh with name: ' + n) : u('Skipping unknown axis at index: ' + t) this.calculateRayOriginFromMesh(o), this.setModelVisibility() } function s(e, t) { for (var n = 0, r = e.children.length; n < r; n++) { var i = e.children[n] if (i && i.name === t) return i } } u('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 r = t.parent r && ((t.parent = null), t.updateMatrixWorld(!0), (t.parent = r)), n.getWorldPosition(this.rayOrigin.origin), n.getWorldQuaternion(e), this.rayOrigin.direction.applyQuaternion(e), r && t.updateMatrixWorld(!0) } else u('Mesh does not contain pointing origin data, defaulting to none.') this.modelReady() } })(), lerpAxisTransform: (function () { var e = new THREE.Quaternion() return function (t, n) { var r = this.loadedMeshInfo.axisMeshes[t] if (r) { var i = r.min, o = r.max, a = r.value, s = 0.5 * n + 0.5 a.setRotationFromQuaternion(e.copy(i.quaternion).slerp(o.quaternion, s)), a.position.lerpVectors(i.position, o.position, s) } } })(), lerpButtonTransform: (function () { var e = new THREE.Quaternion() return function (t, n) { var r = this.loadedMeshInfo.buttonMeshes[t] if (r) { var i = r.unpressed, o = r.pressed, a = r.value a.setRotationFromQuaternion(e.copy(i.quaternion).slerp(o.quaternion, n)), a.position.lerpVectors(i.position, o.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) s(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': 123, '../core/component': 131, '../utils/': 205, '../utils/bind': 199, '../utils/tracked-controls': 214, }, ], 123: [ function (e, t, n) { t.exports = { AFRAME_INJECTED: 'aframe-injected', DEFAULT_CAMERA_HEIGHT: 1.6, DEFAULT_HANDEDNESS: 'right', keyboardevent: e('./keyboardevent'), } }, { './keyboardevent': 124 }, ], 124: [ function (e, t, n) { t.exports = { KEYCODE_TO_CODE: { 38: 'ArrowUp', 37: 'ArrowLeft', 40: 'ArrowDown', 39: 'ArrowRight', 87: 'KeyW', 65: 'KeyA', 83: 'KeyS', 68: 'KeyD', }, } }, {}, ], 125: [ function (e, t, n) { var r = e('./a-node'), i = e('../utils/bind'), o = e('../utils/debug'), a = e('./a-register-element').registerElement, s = e('../lib/three'), l = new s.FileLoader(), c = o('core:a-assets:warn') function u(e) { if (e.hasAttribute('autoplay') || 'auto' === e.getAttribute('preload')) return new Promise(function (t, n) { if (4 === e.readyState) return t() if (e.error) return n() function r() { for (var n = 0, r = 0; r < e.buffered.length; r++) n += e.buffered.end(r) - e.buffered.start(r) n >= e.duration && ('VIDEO' === e.tagName && (s.Cache.files[e.getAttribute('src')] = e), t()) } e.addEventListener('loadeddata', r, !1), e.addEventListener('progress', r, !1), e.addEventListener('error', n, !1) }) } function h(e) { var t = d(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 d(e) { var t if (e.hasAttribute('crossorigin')) return e if (null !== (t = e.getAttribute('src'))) { if (-1 === t.indexOf('://')) return e if (p(t) === window.location.host) return e } return ( c( 'Cross-origin element (e.g., ) was requested without `crossorigin` set. A-Frame will re-request the asset with `crossorigin` attribute set. Please set `crossorigin` on the element (e.g., )', t, ), (e.crossOrigin = 'anonymous'), e.cloneNode(!0) ) } function p(e) { var t = e.indexOf('://') > -1 ? e.split('/')[2] : e.split('/')[0] return t.substring(0, t.indexOf(':')) } function f(e) { var t = m(e), n = t.lastIndexOf('.') return n >= 0 && '.glb' === t.slice(n, e.search(/\?|#|$/)) ? 'arraybuffer' : 'text' } function m(e) { var t = document.createElement('a') t.href = e var n = t.search.replace(/^\?/, ''), r = e.replace(n, '').replace('?', '') return r.substring(r.lastIndexOf('/') + 1) } ;(t.exports = a('a-assets', { prototype: Object.create(r.prototype, { createdCallback: { value: function () { ;(this.isAssets = !0), (this.fileLoader = l), (this.timeout = null) }, }, attachedCallback: { value: function () { var e, t, n, r, o, a, l = this, d = [] if (!this.parentNode.isScene) throw new Error(' must be a child of a .') for (o = this.querySelectorAll('img'), e = 0; e < o.length; e++) (r = h(o[e])), d.push( new Promise(function (t, n) { ;(s.Cache.files[o[e].getAttribute('src')] = r), (r.onload = t), (r.onerror = n) }), ) for (n = this.querySelectorAll('audio, video'), e = 0; e < n.length; e++) (t = h(n[e])).src || t.srcObject || c('Audio/video asset has neither `src` nor `srcObject` attributes.'), d.push(u(t)) Promise.all(d).then(i(this.load, this)), (a = parseInt(this.getAttribute('timeout'), 10) || 3e3), (this.timeout = setTimeout(function () { l.hasLoaded || (c('Asset loading timed out in ', a, 'ms'), l.emit('timeout'), l.load()) }, a)) }, }, detachedCallback: { value: function () { this.timeout && clearTimeout(this.timeout) }, }, load: { value: function () { r.prototype.load.call(this, null, function (e) { return e.isAssetItem && e.hasAttribute('src') }) }, }, }), })), a('a-asset-item', { prototype: Object.create(r.prototype, { createdCallback: { value: function () { ;(this.data = null), (this.isAssetItem = !0) }, }, attachedCallback: { value: function () { var e = this, t = this.getAttribute('src') l.setResponseType(this.getAttribute('response-type') || f(t)), l.load( t, function (t) { ;(e.data = t), setTimeout(function () { r.prototype.load.call(e) }) }, function (t) { e.emit('progress', { loadedBytes: t.loaded, totalBytes: t.total, xhr: t, }) }, function (t) { e.emit('error', { xhr: t }) }, ) }, }, }), }), (t.exports.inferResponseType = f), (t.exports.getFileNameFromURL = m) }, { '../lib/three': 179, '../utils/bind': 199, '../utils/debug': 201, './a-node': 129, './a-register-element': 130, }, ], 126: [ function (e, t, n) { var r = e('../utils/debug'), i = e('./a-register-element').registerElement, o = r('core:cubemap:warn') t.exports = i('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]'), n = [] if (6 === t.length) { for (e = 0; e < t.length; e++) n.push(t[e].getAttribute('src')) return n } o( ' did not contain exactly six elements each with a `src` attribute.', ) }, writable: window.debug, }, }), }) }, { '../utils/debug': 201, './a-register-element': 130 }, ], 127: [ function (e, t, n) { var r, i = e('./a-node'), o = e('./component').components, a = e('./a-register-element').registerElement, s = e('../lib/three'), l = e('../utils/'), c = l.debug('core:a-entity:debug'), u = l.debug('core:a-entity:warn'), h = '__', d = ['position', 'rotation', 'scale', 'visible'], p = { once: !0 }, f = Object.create(i.prototype, { createdCallback: { value: function () { ;(this.components = {}), (this.initializingComponents = {}), (this.componentsToUpdate = {}), (this.isEntity = !0), (this.isPlaying = !1), (this.object3D = new s.Group()), (this.object3D.el = this), (this.object3DMap = {}), (this.parentEl = null), (this.rotationObj = {}), (this.states = []) }, }, attributeChangedCallback: { value: function (e, t, n) { var r = this.components[e] r && r.justInitialized && '' === n ? delete r.justInitialized : (r || null !== n) && this.setEntityAttribute(e, t, n) }, }, attachedCallback: { value: function () { var e, t = this.sceneEl, n = this this.addToParent(), this.isScene || (t ? !(e = t.querySelector('a-assets')) || e.hasLoaded ? this.load() : e.addEventListener('loaded', function () { n.load() }) : this.load()) }, }, detachedCallback: { value: function () { var e if (this.parentEl) { for (e in this.components) this.removeComponent(e, !1) this.isScene || (this.removeFromParent(), i.prototype.detachedCallback.call(this), (this.object3D.el = null)) } }, }, getObject3D: { value: function (e) { return this.object3DMap[e] }, }, setObject3D: { value: function (e, t) { var n, r = this if (!(t instanceof s.Object3D)) throw new Error( '`Entity.setObject3D` was called with an object that was not an instance of THREE.Object3D.', ) ;(n = this.getObject3D(e)) && this.object3D.remove(n), (t.el = this), t.children.length && t.traverse(function (e) { e.el = r }), this.object3D.add(t), (this.object3DMap[e] = t), this.emit('object3dset', { object: t, type: e }) }, }, removeObject3D: { value: function (e) { var t = this.getObject3D(e) t ? (this.object3D.remove(t), delete this.object3DMap[e], this.emit('object3dremove', { type: e })) : u('Tried to remove `Object3D` of type:', e, 'which was not defined.') }, }, getOrCreateObject3D: { value: function (e, t) { var n = this.getObject3D(e) return ( !n && t && ((n = new t()), this.setObject3D(e, n)), u( '`getOrCreateObject3D` has been deprecated. Use `setObject3D()` and `object3dset` event instead.', ), n ) }, }, add: { value: function (e) { if (!e.object3D) throw new Error( "Trying to add an element that doesn't have an `object3D`", ) this.object3D.add(e.object3D), this.emit('child-attached', { el: e }) }, }, addToParent: { value: function () { var e = (this.parentEl = this.parentNode) e && e.add && !this.attachedToParent && (e.add(this), (this.attachedToParent = !0)) }, }, removeFromParent: { value: function () { var e = this.parentEl this.parentEl.remove(this), (this.attachedToParent = !1), (this.parentEl = null), e.emit('child-detached', { el: this }) }, }, load: { value: function () { var e = this !this.hasLoaded && this.parentEl && i.prototype.load.call(this, function () { e.parentEl && (e.updateComponents(), (e.isScene || e.parentEl.isPlaying) && e.play()) }) }, writable: window.debug, }, remove: { value: function (e) { e ? this.object3D.remove(e.object3D) : this.parentNode.removeChild(this) }, }, getChildEntities: { value: function () { for (var e = this.children, t = [], n = 0; n < e.length; n++) { var i = e[n] i instanceof r && t.push(i) } return t }, }, initComponent: { value: function (e, t, n) { var r, i, a, s if ( ((s = (a = l.split(e, h))[0]), (i = a.length > 2 ? a.slice(1).join('__') : a[1]), o[s] && (m(this, e) || void 0 !== t || n) && !(e in this.components)) ) { if ((this.initComponentDependencies(s), i && !o[s].multiple)) throw new Error( 'Trying to initialize multiple components of type `' + s + '`. There can only be one component of this type per entity.', ) ;(r = new o[s].Component(this, t, i)), this.isPlaying && r.play(), this.hasAttribute(e) || ((r.justInitialized = !0), window.HTMLElement.prototype.setAttribute.call(this, e, '')), c('Component initialized: %s', e) } }, writable: window.debug, }, initComponentDependencies: { value: function (e) { var t, n, r = this if (o[e] && (t = o[e].dependencies)) for (n = 0; n < t.length; n++) r.initComponent( t[n], window.HTMLElement.prototype.getAttribute.call(r, t[n]) || void 0, !0, ) }, }, removeComponent: { value: function (e, t) { var n ;(n = this.components[e]) && (n.initialized ? (n.pause(), n.remove(), t && (n.destroy(), delete this.components[e]), this.emit('componentremoved', n.evtDetail, !1)) : this.addEventListener('componentinitialized', function n(r) { r.detail.name === e && (this.removeComponent(e, t), this.removeEventListener('componentinitialized', n)) })) }, writable: window.debug, }, updateComponents: { value: function () { var e, t, n, r, i = this.componentsToUpdate if (this.hasLoaded) { for (n = 0; n < this.mixinEls.length; n++) for (r in this.mixinEls[n].componentCache) y(r) && (i[r] = !0) if (this.getExtraComponents) for (r in (t = this.getExtraComponents())) y(r) && (i[r] = !0) for (n = 0; n < this.attributes.length; ++n) (r = this.attributes[n].name), -1 === d.indexOf(r) && y(r) && (i[r] = !0) for (n = 0; n < d.length; n++) (r = d[n]), this.hasAttribute(r) && this.updateComponent(r, this.getDOMAttribute(r)) for (r in i) (e = g(this.getDOMAttribute(r), t && t[r])), this.updateComponent(r, e), delete i[r] } }, writable: window.debug, }, updateComponent: { value: function (e, t, n) { var r = this.components[e] if (r) return null !== t || m(this, e) ? void r.updateProperties(t, n) : void this.removeComponent(e, !0) this.initComponent(e, t, !1) }, }, removeAttribute: { value: function (e, t) { var n = this.components[e] n && void 0 === t && this.removeComponent(e, !0), n && void 0 !== t ? n.resetProperty(t) : ('mixin' === e && this.mixinUpdate(''), window.HTMLElement.prototype.removeAttribute.call(this, e)) }, }, play: { value: function () { var e, t, n if (!this.isPlaying && this.hasLoaded) { for (n in ((this.isPlaying = !0), this.components)) this.components[n].play() for (e = this.getChildEntities(), t = 0; t < e.length; t++) e[t].play() this.emit('play') } }, writable: !0, }, pause: { value: function () { var e, t, n if (this.isPlaying) { for (n in ((this.isPlaying = !1), this.components)) this.components[n].pause() for (e = this.getChildEntities(), t = 0; t < e.length; t++) e[t].pause() this.emit('pause') } }, writable: !0, }, setEntityAttribute: { value: function (e, t, n) { if (o[e] || this.components[e]) this.updateComponent(e, n) else if ('mixin' === e) { if (n === this.computedMixinStr) return this.mixinUpdate(n, t) } }, }, mixinUpdate: { value: (function () { var e = [] return function (t, n) { var r, i, o, a, s = this if (this.hasLoaded) { for ( n = n || this.getAttribute('mixin'), o = this.updateMixins(t, n), e.length = 0, a = 0; a < this.mixinEls.length; a++ ) for (r in this.mixinEls[a].componentCache) -1 === e.indexOf(r) && (this.components[r] ? this.components[r].handleMixinUpdate() : this.initComponent(r, null), e.push(r)) for (a = 0; a < o.oldMixinIds.length; a++) if ((i = document.getElementById(o.oldMixinIds[a]))) for (r in i.componentCache) -1 === e.indexOf(r) && this.components[r] && (this.getDOMAttribute(r) ? this.components[r].handleMixinUpdate() : this.removeComponent(r, !0)) } else this.addEventListener( 'loaded', function () { s.mixinUpdate(t, n) }, p, ) } })(), }, setAttribute: { value: (function () { var e = {} return function (t, n, r) { var a, s, c, u, d if (((c = (u = t.indexOf(h)) > 0 ? t.substring(0, u) : t), !o[c])) return ( 'mixin' === t && this.mixinUpdate(n), void i.prototype.setAttribute.call(this, t, n) ) if ( (!this.components[t] && this.hasAttribute(t) && this.updateComponent( t, window.HTMLElement.prototype.getAttribute.call(this, t), ), 'undefined' !== typeof r && 'string' === typeof n && n.length > 0 && 'string' === typeof l.styleParser.parse(n)) ) { for (d in e) delete e[d] ;((a = e)[n] = r), (s = !1) } else (a = n), (s = !0 === r) this.updateComponent(t, a, s), this.sceneEl && this.sceneEl.getAttribute('debug') && this.components[t].flushToDOM() } })(), writable: window.debug, }, flushToDOM: { value: function (e) { var t, n, r, i = this.components, o = this.children for (r in i) i[r].flushToDOM() if (e) for (n = 0; n < o.length; ++n) (t = o[n]).flushToDOM && t.flushToDOM(e) }, }, getAttribute: { value: function (e) { var t return 'position' === e ? this.object3D.position : 'rotation' === e ? b(this) : 'scale' === e ? this.object3D.scale : 'visible' === e ? this.object3D.visible : (t = this.components[e]) ? t.data : window.HTMLElement.prototype.getAttribute.call(this, e) }, writable: window.debug, }, getDOMAttribute: { value: function (e) { var t = this.components[e] return t ? t.attrValue : window.HTMLElement.prototype.getAttribute.call(this, e) }, writable: window.debug, }, addState: { value: function (e) { this.is(e) || (this.states.push(e), this.emit('stateadded', e)) }, }, removeState: { value: function (e) { var t = this.states.indexOf(e) ;-1 !== t && (this.states.splice(t, 1), this.emit('stateremoved', e)) }, }, is: { value: function (e) { return -1 !== this.states.indexOf(e) }, }, inspect: { value: function () { this.sceneEl.components.inspector.openInspector(this) }, }, destroy: { value: function () { var e if (this.parentNode) u('Entity can only be destroyed if detached from scenegraph.') else for (e in this.components) this.components[e].destroy() }, }, }) function m(e, t) { return !(!e.components[t] || !e.components[t].attrValue) || v(t, e.mixinEls) } function v(e, t) { var n, r = !1 for (n = 0; n < t.length && !(r = t[n].hasAttribute(e)); ++n); return r } function g(e, t) { return t ? t.constructor === Object ? l.extend(t, l.styleParser.parse(e || {})) : e || t : e } function y(e) { return -1 !== e.indexOf(h) && (e = l.split(e, h)[0]), !!o[e] } function b(e) { var t = s.Math.radToDeg, n = e.object3D.rotation, r = e.rotationObj return (r.x = t(n.x)), (r.y = t(n.y)), (r.z = t(n.z)), r } ;(r = a('a-entity', { prototype: f })), (t.exports = r) }, { '../lib/three': 179, '../utils/': 205, './a-node': 129, './a-register-element': 130, './component': 131, }, ], 128: [ function (e, t, n) { var r = e('./a-node'), i = e('./a-register-element').registerElement, o = e('./component').components, a = e('../utils'), s = '__' t.exports = i('a-mixin', { prototype: Object.create(r.prototype, { createdCallback: { value: function () { ;(this.componentCache = {}), (this.id = this.getAttribute('id')), (this.isMixin = !0) }, }, attributeChangedCallback: { value: function (e, t, n) { this.cacheAttribute(e, n), this.updateEntities() }, }, attachedCallback: { value: function () { ;(this.sceneEl = this.closestScene()), this.cacheAttributes(), this.updateEntities(), this.load() }, }, setAttribute: { value: function (e, t) { window.HTMLElement.prototype.setAttribute.call(this, e, t), this.cacheAttribute(e, t) }, }, cacheAttribute: { value: function (e, t) { var n, r ;(r = a.split(e, s)[0]), (n = o[r]) && (void 0 === t && (t = window.HTMLElement.prototype.getAttribute.call(this, e)), (this.componentCache[e] = n.parseAttrValueForCache(t))) }, }, getAttribute: { value: function (e) { return ( this.componentCache[e] || window.HTMLElement.prototype.getAttribute.call(this, e) ) }, }, cacheAttributes: { value: function () { var e, t, n = this.attributes for (t = 0; t < n.length; t++) (e = n[t].name), this.cacheAttribute(e) }, }, updateEntities: { value: function () { var e, t, n if (this.sceneEl) for ( t = this.sceneEl.querySelectorAll('[mixin~=' + this.id + ']'), n = 0; n < t.length; n++ ) (e = t[n]).hasLoaded && !e.isMixin && e.mixinUpdate(this.id) }, }, }), }) }, { '../utils': 205, './a-node': 129, './a-register-element': 130, './component': 131 }, ], 129: [ function (e, t, n) { var r = e('./a-register-element').registerElement, i = e('./a-register-element').isNode, o = e('../utils/'), a = o.debug('core:a-node:warn'), s = o.debug('core:a-node:error') t.exports = r('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 e ;(this.sceneEl = this.closestScene()), this.sceneEl || a( 'You are attempting to attach <' + this.tagName + '> outside of an A-Frame scene. Append this element to `` instead.', ), (this.hasLoaded = !1), this.emit('nodeready', void 0, !1), this.isMixin || ((e = this.getAttribute('mixin')) && this.updateMixins(e)) }, writable: window.debug, }, attributeChangedCallback: { value: function (e, t, n) { n !== this.computedMixinStr && ('mixin' !== e || this.isMixin || this.updateMixins(n, t)) }, }, closestScene: { value: function () { for (var e = this; e && !e.isScene; ) e = e.parentElement return e }, }, closest: { value: function (e) { for ( var t = this.matches || this.mozMatchesSelector || this.msMatchesSelector || this.oMatchesSelector || this.webkitMatchesSelector, n = this; n && !t.call(n, e); ) n = n.parentElement return n }, }, detachedCallback: { value: function () { this.hasLoaded = !1 }, }, load: { value: function (e, t) { var n, r = this this.hasLoaded || ((t = t || i), (n = this.getChildren() .filter(t) .map(function (e) { return new Promise(function (t) { if (e.hasLoaded) return t() e.addEventListener('loaded', t) }) })), Promise.all(n) .then(function () { ;(r.hasLoaded = !0), e && e(), r.emit('loaded', void 0, !1) }) .catch(function (e) { s('Failure loading node: ', e) })) }, writable: !0, }, getChildren: { value: function () { return Array.prototype.slice.call(this.children, 0) }, }, updateMixins: { value: (function () { var e = [], t = [], n = {} return function (r, i) { var a, s, l for ( e.length = 0, t.length = 0, s = r ? o.split(r.trim(), /\s+/) : e, l = i ? o.split(i.trim(), /\s+/) : t, n.newMixinIds = s, n.oldMixinIds = l, a = 0; a < l.length; a++ ) -1 === s.indexOf(l[a]) && this.unregisterMixin(l[a]) for ( this.computedMixinStr = '', this.mixinEls.length = 0, a = 0; a < s.length; a++ ) this.registerMixin(document.getElementById(s[a])) return ( this.computedMixinStr && ((this.computedMixinStr = this.computedMixinStr.trim()), window.HTMLElement.prototype.setAttribute.call( this, 'mixin', this.computedMixinStr, )), n ) } })(), }, registerMixin: { value: function (e) { var t, n, r if (e) { if ((r = e.getAttribute('mixin'))) for (t = o.split(r.trim(), /\s+/), n = 0; n < t.length; n++) this.registerMixin(document.getElementById(t[n])) ;(this.computedMixinStr = this.computedMixinStr + ' ' + e.id), this.mixinEls.push(e) } }, }, setAttribute: { value: function (e, t) { 'mixin' === e && this.updateMixins(t), window.HTMLElement.prototype.setAttribute.call(this, e, t) }, }, unregisterMixin: { value: function (e) { var t, n = this.mixinEls for (t = 0; t < n.length; ++t) if (e === n[t].id) { n.splice(t, 1) break } }, }, emit: { value: (function () { var e = {} return function (t, n, r, i) { void 0 === r && (r = !0), (e.bubbles = !!r), (e.detail = n), i && (e = o.extend({}, i, e)), this.dispatchEvent(new CustomEvent(t, e)) } })(), writable: window.debug, }, }), }) }, { '../utils/': 205, './a-register-element': 130 }, ], 130: [ function (e, t, n) { var r, i e('document-register-element') var o = (t.exports.knownTags = {}) function a(e) { o[e.toLowerCase()] = !0 } function s(e) { var t = {} return ( c( t, [ 'attachedCallback', 'attributeChangedCallback', 'createdCallback', 'detachedCallback', ], e, r.prototype, ), h(e, t), t ) } function l(e) { var t = {}, n = [ 'attachedCallback', 'attributeChangedCallback', 'createdCallback', 'detachedCallback', ] return ( c( t, [ 'attachedCallback', 'attributeChangedCallback', 'createdCallback', 'detachedCallback', ], e, r.prototype, ), c(t, n, e, i.prototype), h(e, t), t ) } function c(e, t, n, r) { t.forEach(function (t) { u(e, t, n, r) }) } function u(e, t, n, r) { var i = n[t], o = r[t] i && o && i !== o && (e[t] = { value: function () { return o.apply(this, arguments), i.apply(this, arguments) }, writable: window.debug, }) } function h(e, t) { Object.getOwnPropertyNames(e).forEach(function (n) { var r t[n] || ((r = Object.getOwnPropertyDescriptor(e, n)), (t[n] = { value: e[n], writable: r.writable })) }) } ;(t.exports.isNode = function (e) { return e.tagName.toLowerCase() in o || e.isNode }), (t.exports.registerElement = function (e, t) { var n = Object.getPrototypeOf(t.prototype), o = t, c = r && n === r.prototype, u = i && n === i.prototype return ( (c || u) && a(e), c && ((o = s(t.prototype)), (o = { prototype: Object.create(n, o) })), u && ((o = l(t.prototype)), (o = { prototype: Object.create(n, o) })), Object.getOwnPropertyNames(o.prototype).forEach(function (e) { var t = o.prototype[e] 'function' === typeof t && (t.displayName = e) }), document.registerElement(e, o) ) }), (t.exports.wrapMethods = c), (r = e('./a-node')), (i = e('./a-entity')) }, { './a-entity': 127, './a-node': 129, 'document-register-element': 12 }, ], 131: [ function (e, t, n) { var r = e('./schema'), i = e('./scene/scenes'), o = e('./system'), a = e('../utils/'), s = (t.exports.components = {}), l = r.parseProperties, c = r.parseProperty, u = r.process, h = r.isSingleProperty, d = r.stringifyProperties, p = r.stringifyProperty, f = a.styleParser, m = a.debug('core:component:warn'), v = document.currentScript, g = new RegExp('[A-Z]+'), y = {}, b = (t.exports.Component = function (e, t, n) { var r = this ;(this.el = e), (this.id = n), (this.attrName = this.name + (n ? '__' + n : '')), (this.evtDetail = { id: this.id, name: this.name }), (this.initialized = !1), (this.isSingleProperty = h(this.schema)), (this.isSinglePropertyObject = this.isSingleProperty && S(c(void 0, this.schema)) && !(this.schema.default instanceof window.HTMLElement)), (this.isObjectBased = !this.isSingleProperty || this.isSinglePropertyObject), (this.el.components[this.attrName] = this), (this.objectPool = y[this.name]) const i = this.events ;(this.events = {}), A(this, i), (this.attrValue = void 0), this.isObjectBased ? ((this.nextData = this.objectPool.use()), a.objectPool.removeUnusedKeys(this.nextData, this.schema), (this.oldData = this.objectPool.use()), a.objectPool.removeUnusedKeys(this.oldData, this.schema), (this.previousOldData = this.objectPool.use()), a.objectPool.removeUnusedKeys(this.previousOldData, this.schema), (this.parsingAttrValue = this.objectPool.use()), a.objectPool.removeUnusedKeys(this.parsingAttrValue, this.schema)) : ((this.nextData = void 0), (this.oldData = void 0), (this.previousOldData = void 0), (this.parsingAttrValue = void 0)), (this.throttledEmitComponentChanged = a.throttle(function () { e.emit('componentchanged', r.evtDetail, !1) }, 200)), this.updateProperties(t) }) function A(e, t) { var n for (n in t) e.events[n] = t[n].bind(e) } if ( ((b.prototype = { schema: {}, init: function () {}, events: {}, update: function (e) {}, updateSchema: void 0, tick: void 0, tock: void 0, play: function () {}, pause: function () {}, remove: function () {}, parse: function (e, t) { var n = this.schema return this.isSingleProperty ? c(e, n) : l(f.parse(e), n, !0, this.name, t) }, stringify: function (e) { var t = this.schema return 'string' === typeof e ? e : this.isSingleProperty ? p(e, t) : ((e = d(e, t)), f.stringify(e)) }, updateCachedAttrValue: function (e, t) { var n, r, i if (void 0 !== e) { if (null === e) return ( this.isObjectBased && this.attrValue && this.objectPool.recycle(this.attrValue), void (this.attrValue = void 0) ) if ( (e instanceof Object && !(e instanceof window.HTMLElement) ? ((r = this.objectPool.use()), (n = a.extend(r, e))) : (n = this.parseAttrValueForCache(e)), this.isObjectBased && !t && this.attrValue) ) for (i in this.attrValue) void 0 === n[i] && (n[i] = this.attrValue[i]) this.isObjectBased && !this.attrValue && (this.attrValue = this.objectPool.use()), a.objectPool.clearObject(this.attrValue), (this.attrValue = E(this.attrValue, n, this.isObjectBased)), a.objectPool.clearObject(r) } }, parseAttrValueForCache: function (e) { var t return 'string' !== typeof e ? e : (this.isSingleProperty ? 'string' === typeof (t = this.schema.parse(e)) && (t = e) : (a.objectPool.clearObject(this.parsingAttrValue), (t = f.parse(e, this.parsingAttrValue))), t) }, flushToDOM: function (e) { var t = e ? this.data : this.attrValue null !== t && void 0 !== t && window.HTMLElement.prototype.setAttribute.call( this.el, this.attrName, this.stringify(t), ) }, updateProperties: function (e, t) { this.el.hasLoaded ? (null !== e && (e = this.parseAttrValueForCache(e)), this.updateCachedAttrValue(e, t), this.initialized ? (this.updateComponent(e, t), this.callUpdateHandler()) : this.initComponent()) : this.updateCachedAttrValue(e) }, initComponent: function () { var e, t = this.el this.updateSchema && this.updateSchema(this.buildData(this.attrValue, !1, !0)), (this.data = this.buildData(this.attrValue)), t.initializingComponents[this.name] || ((t.initializingComponents[this.name] = !0), this.init(), (this.initialized = !0), delete t.initializingComponents[this.name], (this.oldData = E(this.oldData, this.data, this.isObjectBased)), (e = this.isObjectBased ? this.objectPool.use() : void 0), this.update(e), this.isObjectBased && this.objectPool.recycle(e), t.isPlaying && this.play(), t.emit('componentinitialized', this.evtDetail, !1)) }, updateComponent: function (e, t) { var n, r if (t) 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 && c(e, this.schema), void (this.data = e) if ((l(e, this.schema, !0, this.name), this.schemaChangeKeys.length)) for (n in e) if (this.schema[n].schemaChange) { r = !0 break } if (r) return ( this.updateSchema && this.updateSchema(this.buildData(this.attrValue, !0, !0)), void (this.data = this.buildData(this.attrValue, !0, !1)) ) for (n in e) void 0 !== e[n] && (this.data[n] = e[n]) }, callUpdateHandler: function () { var e this.previousOldData instanceof Object && a.objectPool.clearObject(this.previousOldData), this.isObjectBased ? x(this.previousOldData, this.oldData) : (this.previousOldData = this.oldData), (e = !a.deepEqual(this.oldData, this.data)), (this.isPositionRotationScale || e) && (this.oldData instanceof Object && a.objectPool.clearObject(this.oldData), (this.oldData = E(this.oldData, this.data, this.isObjectBased)), this.update(this.previousOldData), this.throttledEmitComponentChanged()) }, handleMixinUpdate: function () { ;(this.data = this.buildData(this.attrValue)), this.callUpdateHandler() }, resetProperty: function (e) { if (this.isObjectBased) { if (!(e in this.attrValue)) return delete this.attrValue[e], (this.data[e] = this.schema[e].default) } else (this.attrValue = this.schema.default), (this.data = this.schema.default) this.updateProperties(this.attrValue) }, extendSchema: function (e) { var t ;(t = a.extend({}, s[this.name].schema)), a.extend(t, e), (this.schema = u(t)), this.el.emit('schemachanged', this.evtDetail) }, buildData: function (e, t, n) { var r, i, o, s, u, h, d, p = this.nextData, f = this.schema, m = this.el.mixinEls if ( ((r = e && e.constructor === Array ? e.length : void 0 !== e && null !== e), this.isObjectBased && a.objectPool.clearObject(p), this.isSingleProperty) ) i = this.isObjectBased ? x(p, f.default) : C(f.default) ? a.clone(f.default) : f.default else for (s in ((i = (d = !t && this.attrValue) instanceof Object ? x(p, d) : p), f)) (o = f[s].default), void 0 === i[s] && (i[s] = C(o) ? a.clone(o) : o) for (h = 0; h < m.length; h++) (u = m[h].getAttribute(this.attrName)) && (i = E(i, u, this.isObjectBased)) if (r) { if (this.isSingleProperty) return S(e) ? (x(this.parsingAttrValue, e), c(this.parsingAttrValue, f)) : c(e, f) i = E(i, e, this.isObjectBased) } else if (this.isSingleProperty) return c(i, f) return l(i, f, void 0, this.name, n) }, eventsAttach: function () { var e for (e in (this.eventsDetach(), this.events)) this.el.addEventListener(e, this.events[e]) }, eventsDetach: function () { var e for (e in this.events) this.el.removeEventListener(e, this.events[e]) }, 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 w = (t.exports.registrationOrderWarnings = {}) function x(e, t) { var n, r for (r in t) void 0 !== t[r] && ((n = t[r]), (e[r] = C(n) ? a.clone(n) : n)) return e } function E(e, t, n) { var r if (n && t.constructor === Object) { for (r in t) void 0 !== t[r] && (t[r] && t[r].constructor === Object ? (e[r] = a.clone(t[r])) : (e[r] = t[r])) return e } return t } function M(e) { return e.tick || e.tock } function _(e) { return function () { var t = this.el.sceneEl this.isPlaying && (e.call(this), (this.isPlaying = !1), this.eventsDetach(), M(this) && t.removeBehavior(this)) } } function T(e) { return function () { var t = this.el.sceneEl, n = this.el.isPlaying && !this.isPlaying this.initialized && n && (e.call(this), (this.isPlaying = !0), this.eventsAttach(), M(this) && t.addBehavior(this)) } } function S(e) { return e && e.constructor === Object && !(e instanceof window.HTMLElement) } function C(e) { return ( e && (e.constructor === Object || e.constructor === Array) && !(e instanceof window.HTMLElement) ) } t.exports.registerComponent = function (e, t) { var n, r, l, c, d = {} if ( (document.currentScript && document.currentScript !== v && i.forEach(function (t) { t.hasLoaded || (document.currentScript.compareDocumentPosition(t) !== Node.DOCUMENT_POSITION_FOLLOWING && (m( 'The component `' + e + '` was registered in a