@netless/app-slide 0.2.13 → 0.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.cjs.js +9 -9
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +12 -3
- package/dist/main.es.js.map +1 -1
- package/dist/main.iife.js +9 -9
- package/dist/main.iife.js.map +1 -1
- package/dist/utils/freezer.d.ts +3 -2
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/utils/freezer.ts +11 -2
package/dist/main.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var OS=Object.defineProperty,DS=Object.defineProperties;var FS=Object.getOwnPropertyDescriptors;var t_=Object.getOwnPropertySymbols;var kS=Object.prototype.hasOwnProperty,US=Object.prototype.propertyIsEnumerable;var e_=(m,y,d)=>y in m?OS(m,y,{enumerable:!0,configurable:!0,writable:!0,value:d}):m[y]=d,Vu=(m,y)=>{for(var d in y||(y={}))kS.call(y,d)&&e_(m,d,y[d]);if(t_)for(var d of t_(y))US.call(y,d)&&e_(m,d,y[d]);return m},n_=(m,y)=>DS(m,FS(y));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var Ze=function(m){var y={};function d(x){if(y[x])return y[x].exports;var b=y[x]={i:x,l:!1,exports:{}};return m[x].call(b.exports,b,b.exports,d),b.l=!0,b.exports}return d.m=m,d.c=y,d.d=function(x,b,R){d.o(x,b)||Object.defineProperty(x,b,{enumerable:!0,get:R})},d.r=function(x){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(x,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(x,"__esModule",{value:!0})},d.t=function(x,b){if(1&b&&(x=d(x)),8&b||4&b&&typeof x=="object"&&x&&x.__esModule)return x;var R=Object.create(null);if(d.r(R),Object.defineProperty(R,"default",{enumerable:!0,value:x}),2&b&&typeof x!="string")for(var T in x)d.d(R,T,function(S){return x[S]}.bind(null,T));return R},d.n=function(x){var b=x&&x.__esModule?function(){return x.default}:function(){return x};return d.d(b,"a",b),b},d.o=function(x,b){return Object.prototype.hasOwnProperty.call(x,b)},d.p="",d(d.s=185)}([function(m,y,d){var x=Object.prototype.hasOwnProperty,b="~";function R(){}function T(L,k,K){this.fn=L,this.context=k,this.once=K||!1}function S(L,k,K,ut,_t){if(typeof K!="function")throw new TypeError("The listener must be a function");var E=new T(K,ut||L,_t),I=b?b+k:k;return L._events[I]?L._events[I].fn?L._events[I]=[L._events[I],E]:L._events[I].push(E):(L._events[I]=E,L._eventsCount++),L}function N(L,k){--L._eventsCount==0?L._events=new R:delete L._events[k]}function C(){this._events=new R,this._eventsCount=0}Object.create&&(R.prototype=Object.create(null),new R().__proto__||(b=!1)),C.prototype.eventNames=function(){var L,k,K=[];if(this._eventsCount===0)return K;for(k in L=this._events)x.call(L,k)&&K.push(b?k.slice(1):k);return Object.getOwnPropertySymbols?K.concat(Object.getOwnPropertySymbols(L)):K},C.prototype.listeners=function(L){var k=b?b+L:L,K=this._events[k];if(!K)return[];if(K.fn)return[K.fn];for(var ut=0,_t=K.length,E=new Array(_t);ut<_t;ut++)E[ut]=K[ut].fn;return E},C.prototype.listenerCount=function(L){var k=b?b+L:L,K=this._events[k];return K?K.fn?1:K.length:0},C.prototype.emit=function(L,k,K,ut,_t,E){var I=b?b+L:L;if(!this._events[I])return!1;var D,F,P=this._events[I],B=arguments.length;if(P.fn){switch(P.once&&this.removeListener(L,P.fn,void 0,!0),B){case 1:return P.fn.call(P.context),!0;case 2:return P.fn.call(P.context,k),!0;case 3:return P.fn.call(P.context,k,K),!0;case 4:return P.fn.call(P.context,k,K,ut),!0;case 5:return P.fn.call(P.context,k,K,ut,_t),!0;case 6:return P.fn.call(P.context,k,K,ut,_t,E),!0}for(F=1,D=new Array(B-1);F<B;F++)D[F-1]=arguments[F];P.fn.apply(P.context,D)}else{var G,q=P.length;for(F=0;F<q;F++)switch(P[F].once&&this.removeListener(L,P[F].fn,void 0,!0),B){case 1:P[F].fn.call(P[F].context);break;case 2:P[F].fn.call(P[F].context,k);break;case 3:P[F].fn.call(P[F].context,k,K);break;case 4:P[F].fn.call(P[F].context,k,K,ut);break;default:if(!D)for(G=1,D=new Array(B-1);G<B;G++)D[G-1]=arguments[G];P[F].fn.apply(P[F].context,D)}}return!0},C.prototype.on=function(L,k,K){return S(this,L,k,K,!1)},C.prototype.once=function(L,k,K){return S(this,L,k,K,!0)},C.prototype.removeListener=function(L,k,K,ut){var _t=b?b+L:L;if(!this._events[_t])return this;if(!k)return N(this,_t),this;var E=this._events[_t];if(E.fn)E.fn!==k||ut&&!E.once||K&&E.context!==K||N(this,_t);else{for(var I=0,D=[],F=E.length;I<F;I++)(E[I].fn!==k||ut&&!E[I].once||K&&E[I].context!==K)&&D.push(E[I]);D.length?this._events[_t]=D.length===1?D[0]:D:N(this,_t)}return this},C.prototype.removeAllListeners=function(L){var k;return L?(k=b?b+L:L,this._events[k]&&N(this,k)):(this._events=new R,this._eventsCount=0),this},C.prototype.off=C.prototype.removeListener,C.prototype.addListener=C.prototype.on,C.prefixed=b,C.EventEmitter=C,m.exports=C},function(m,y){m.exports=function(d){return d===void 0}},function(m,y,d){var x=d(6),b=d(4);m.exports=function(R){return typeof R=="number"||b(R)&&x(R)=="[object Number]"}},function(m,y,d){var x=d(35),b=typeof self=="object"&&self&&self.Object===Object&&self,R=x||b||Function("return this")();m.exports=R},function(m,y){m.exports=function(d){return d!=null&&typeof d=="object"}},function(m,y,d){var x;(function(b){function R(P,B){var G=(65535&P)+(65535&B);return(P>>16)+(B>>16)+(G>>16)<<16|65535&G}function T(P,B,G,q,Rt,Xt){return R((at=R(R(B,P),R(q,Xt)))<<($=Rt)|at>>>32-$,G);var at,$}function S(P,B,G,q,Rt,Xt,at){return T(B&G|~B&q,P,B,Rt,Xt,at)}function N(P,B,G,q,Rt,Xt,at){return T(B&q|G&~q,P,B,Rt,Xt,at)}function C(P,B,G,q,Rt,Xt,at){return T(B^G^q,P,B,Rt,Xt,at)}function L(P,B,G,q,Rt,Xt,at){return T(G^(B|~q),P,B,Rt,Xt,at)}function k(P,B){var G,q,Rt,Xt,at;P[B>>5]|=128<<B%32,P[14+(B+64>>>9<<4)]=B;var $=1732584193,tt=-271733879,lt=-1732584194,w=271733878;for(G=0;G<P.length;G+=16)q=$,Rt=tt,Xt=lt,at=w,$=S($,tt,lt,w,P[G],7,-680876936),w=S(w,$,tt,lt,P[G+1],12,-389564586),lt=S(lt,w,$,tt,P[G+2],17,606105819),tt=S(tt,lt,w,$,P[G+3],22,-1044525330),$=S($,tt,lt,w,P[G+4],7,-176418897),w=S(w,$,tt,lt,P[G+5],12,1200080426),lt=S(lt,w,$,tt,P[G+6],17,-1473231341),tt=S(tt,lt,w,$,P[G+7],22,-45705983),$=S($,tt,lt,w,P[G+8],7,1770035416),w=S(w,$,tt,lt,P[G+9],12,-1958414417),lt=S(lt,w,$,tt,P[G+10],17,-42063),tt=S(tt,lt,w,$,P[G+11],22,-1990404162),$=S($,tt,lt,w,P[G+12],7,1804603682),w=S(w,$,tt,lt,P[G+13],12,-40341101),lt=S(lt,w,$,tt,P[G+14],17,-1502002290),$=N($,tt=S(tt,lt,w,$,P[G+15],22,1236535329),lt,w,P[G+1],5,-165796510),w=N(w,$,tt,lt,P[G+6],9,-1069501632),lt=N(lt,w,$,tt,P[G+11],14,643717713),tt=N(tt,lt,w,$,P[G],20,-373897302),$=N($,tt,lt,w,P[G+5],5,-701558691),w=N(w,$,tt,lt,P[G+10],9,38016083),lt=N(lt,w,$,tt,P[G+15],14,-660478335),tt=N(tt,lt,w,$,P[G+4],20,-405537848),$=N($,tt,lt,w,P[G+9],5,568446438),w=N(w,$,tt,lt,P[G+14],9,-1019803690),lt=N(lt,w,$,tt,P[G+3],14,-187363961),tt=N(tt,lt,w,$,P[G+8],20,1163531501),$=N($,tt,lt,w,P[G+13],5,-1444681467),w=N(w,$,tt,lt,P[G+2],9,-51403784),lt=N(lt,w,$,tt,P[G+7],14,1735328473),$=C($,tt=N(tt,lt,w,$,P[G+12],20,-1926607734),lt,w,P[G+5],4,-378558),w=C(w,$,tt,lt,P[G+8],11,-2022574463),lt=C(lt,w,$,tt,P[G+11],16,1839030562),tt=C(tt,lt,w,$,P[G+14],23,-35309556),$=C($,tt,lt,w,P[G+1],4,-1530992060),w=C(w,$,tt,lt,P[G+4],11,1272893353),lt=C(lt,w,$,tt,P[G+7],16,-155497632),tt=C(tt,lt,w,$,P[G+10],23,-1094730640),$=C($,tt,lt,w,P[G+13],4,681279174),w=C(w,$,tt,lt,P[G],11,-358537222),lt=C(lt,w,$,tt,P[G+3],16,-722521979),tt=C(tt,lt,w,$,P[G+6],23,76029189),$=C($,tt,lt,w,P[G+9],4,-640364487),w=C(w,$,tt,lt,P[G+12],11,-421815835),lt=C(lt,w,$,tt,P[G+15],16,530742520),$=L($,tt=C(tt,lt,w,$,P[G+2],23,-995338651),lt,w,P[G],6,-198630844),w=L(w,$,tt,lt,P[G+7],10,1126891415),lt=L(lt,w,$,tt,P[G+14],15,-1416354905),tt=L(tt,lt,w,$,P[G+5],21,-57434055),$=L($,tt,lt,w,P[G+12],6,1700485571),w=L(w,$,tt,lt,P[G+3],10,-1894986606),lt=L(lt,w,$,tt,P[G+10],15,-1051523),tt=L(tt,lt,w,$,P[G+1],21,-2054922799),$=L($,tt,lt,w,P[G+8],6,1873313359),w=L(w,$,tt,lt,P[G+15],10,-30611744),lt=L(lt,w,$,tt,P[G+6],15,-1560198380),tt=L(tt,lt,w,$,P[G+13],21,1309151649),$=L($,tt,lt,w,P[G+4],6,-145523070),w=L(w,$,tt,lt,P[G+11],10,-1120210379),lt=L(lt,w,$,tt,P[G+2],15,718787259),tt=L(tt,lt,w,$,P[G+9],21,-343485551),$=R($,q),tt=R(tt,Rt),lt=R(lt,Xt),w=R(w,at);return[$,tt,lt,w]}function K(P){var B,G="",q=32*P.length;for(B=0;B<q;B+=8)G+=String.fromCharCode(P[B>>5]>>>B%32&255);return G}function ut(P){var B,G=[];for(G[(P.length>>2)-1]=void 0,B=0;B<G.length;B+=1)G[B]=0;var q=8*P.length;for(B=0;B<q;B+=8)G[B>>5]|=(255&P.charCodeAt(B/8))<<B%32;return G}function _t(P){var B,G,q="";for(G=0;G<P.length;G+=1)B=P.charCodeAt(G),q+="0123456789abcdef".charAt(B>>>4&15)+"0123456789abcdef".charAt(15&B);return q}function E(P){return unescape(encodeURIComponent(P))}function I(P){return function(B){return K(k(ut(B),8*B.length))}(E(P))}function D(P,B){return function(G,q){var Rt,Xt,at=ut(G),$=[],tt=[];for($[15]=tt[15]=void 0,at.length>16&&(at=k(at,8*G.length)),Rt=0;Rt<16;Rt+=1)$[Rt]=909522486^at[Rt],tt[Rt]=1549556828^at[Rt];return Xt=k($.concat(ut(q)),512+8*q.length),K(k(tt.concat(Xt),640))}(E(P),E(B))}function F(P,B,G){return B?G?D(B,P):_t(D(B,P)):G?I(P):_t(I(P))}(x=function(){return F}.call(y,d,y,m))===void 0||(m.exports=x)})()},function(m,y,d){var x=d(12),b=d(97),R=d(98),T=x?x.toStringTag:void 0;m.exports=function(S){return S==null?S===void 0?"[object Undefined]":"[object Null]":T&&T in Object(S)?b(S):R(S)}},function(m,y){m.exports=function(d){var x=typeof d;return d!=null&&(x=="object"||x=="function")}},function(m,y,d){var x=d(123),b=d(126);m.exports=function(R,T){var S=b(R,T);return x(S)?S:void 0}},function(m,y,d){(function(x){m.exports=function b(R,T,S){function N(k,K){if(!T[k]){if(!R[k]){if(C)return C(k,!0);var ut=new Error("Cannot find module '"+k+"'");throw ut.code="MODULE_NOT_FOUND",ut}var _t=T[k]={exports:{}};R[k][0].call(_t.exports,function(E){var I=R[k][1][E];return N(I||E)},_t,_t.exports,b,R,T,S)}return T[k].exports}for(var C=!1,L=0;L<S.length;L++)N(S[L]);return N}({1:[function(b,R,T){(function(S){var N,C,L=S.MutationObserver||S.WebKitMutationObserver;if(L){var k=0,K=new L(I),ut=S.document.createTextNode("");K.observe(ut,{characterData:!0}),N=function(){ut.data=k=++k%2}}else if(S.setImmediate||S.MessageChannel===void 0)N="document"in S&&"onreadystatechange"in S.document.createElement("script")?function(){var D=S.document.createElement("script");D.onreadystatechange=function(){I(),D.onreadystatechange=null,D.parentNode.removeChild(D),D=null},S.document.documentElement.appendChild(D)}:function(){setTimeout(I,0)};else{var _t=new S.MessageChannel;_t.port1.onmessage=I,N=function(){_t.port2.postMessage(0)}}var E=[];function I(){var D,F;C=!0;for(var P=E.length;P;){for(F=E,E=[],D=-1;++D<P;)F[D]();P=E.length}C=!1}R.exports=function(D){E.push(D)!==1||C||N()}}).call(this,x!==void 0?x:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(b,R,T){var S=b(1);function N(){}var C={},L=["REJECTED"],k=["FULFILLED"],K=["PENDING"];function ut(P){if(typeof P!="function")throw new TypeError("resolver must be a function");this.state=K,this.queue=[],this.outcome=void 0,P!==N&&D(this,P)}function _t(P,B,G){this.promise=P,typeof B=="function"&&(this.onFulfilled=B,this.callFulfilled=this.otherCallFulfilled),typeof G=="function"&&(this.onRejected=G,this.callRejected=this.otherCallRejected)}function E(P,B,G){S(function(){var q;try{q=B(G)}catch(Rt){return C.reject(P,Rt)}q===P?C.reject(P,new TypeError("Cannot resolve promise with itself")):C.resolve(P,q)})}function I(P){var B=P&&P.then;if(P&&(typeof P=="object"||typeof P=="function")&&typeof B=="function")return function(){B.apply(P,arguments)}}function D(P,B){var G=!1;function q(at){G||(G=!0,C.reject(P,at))}function Rt(at){G||(G=!0,C.resolve(P,at))}var Xt=F(function(){B(Rt,q)});Xt.status==="error"&&q(Xt.value)}function F(P,B){var G={};try{G.value=P(B),G.status="success"}catch(q){G.status="error",G.value=q}return G}R.exports=ut,ut.prototype.catch=function(P){return this.then(null,P)},ut.prototype.then=function(P,B){if(typeof P!="function"&&this.state===k||typeof B!="function"&&this.state===L)return this;var G=new this.constructor(N);return this.state!==K?E(G,this.state===k?P:B,this.outcome):this.queue.push(new _t(G,P,B)),G},_t.prototype.callFulfilled=function(P){C.resolve(this.promise,P)},_t.prototype.otherCallFulfilled=function(P){E(this.promise,this.onFulfilled,P)},_t.prototype.callRejected=function(P){C.reject(this.promise,P)},_t.prototype.otherCallRejected=function(P){E(this.promise,this.onRejected,P)},C.resolve=function(P,B){var G=F(I,B);if(G.status==="error")return C.reject(P,G.value);var q=G.value;if(q)D(P,q);else{P.state=k,P.outcome=B;for(var Rt=-1,Xt=P.queue.length;++Rt<Xt;)P.queue[Rt].callFulfilled(B)}return P},C.reject=function(P,B){P.state=L,P.outcome=B;for(var G=-1,q=P.queue.length;++G<q;)P.queue[G].callRejected(B);return P},ut.resolve=function(P){return P instanceof this?P:C.resolve(new this(N),P)},ut.reject=function(P){var B=new this(N);return C.reject(B,P)},ut.all=function(P){var B=this;if(Object.prototype.toString.call(P)!=="[object Array]")return this.reject(new TypeError("must be an array"));var G=P.length,q=!1;if(!G)return this.resolve([]);for(var Rt=new Array(G),Xt=0,at=-1,$=new this(N);++at<G;)tt(P[at],at);return $;function tt(lt,w){B.resolve(lt).then(function(ot){Rt[w]=ot,++Xt!==G||q||(q=!0,C.resolve($,Rt))},function(ot){q||(q=!0,C.reject($,ot))})}},ut.race=function(P){var B=this;if(Object.prototype.toString.call(P)!=="[object Array]")return this.reject(new TypeError("must be an array"));var G=P.length,q=!1;if(!G)return this.resolve([]);for(var Rt,Xt=-1,at=new this(N);++Xt<G;)Rt=P[Xt],B.resolve(Rt).then(function($){q||(q=!0,C.resolve(at,$))},function($){q||(q=!0,C.reject(at,$))});return at}},{1:1}],3:[function(b,R,T){(function(S){typeof S.Promise!="function"&&(S.Promise=b(2))}).call(this,x!==void 0?x:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{2:2}],4:[function(b,R,T){var S=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(z){return typeof z}:function(z){return z&&typeof Symbol=="function"&&z.constructor===Symbol&&z!==Symbol.prototype?"symbol":typeof z},N=function(){try{if(typeof indexedDB!="undefined")return indexedDB;if(typeof webkitIndexedDB!="undefined")return webkitIndexedDB;if(typeof mozIndexedDB!="undefined")return mozIndexedDB;if(typeof OIndexedDB!="undefined")return OIndexedDB;if(typeof msIndexedDB!="undefined")return msIndexedDB}catch{return}}();function C(z,W){z=z||[],W=W||{};try{return new Blob(z,W)}catch(mt){if(mt.name!=="TypeError")throw mt;for(var Z=new(typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder),ft=0;ft<z.length;ft+=1)Z.append(z[ft]);return Z.getBlob(W.type)}}typeof Promise=="undefined"&&b(3);var L=Promise;function k(z,W){W&&z.then(function(Z){W(null,Z)},function(Z){W(Z)})}function K(z,W,Z){typeof W=="function"&&z.then(W),typeof Z=="function"&&z.catch(Z)}function ut(z){return typeof z!="string"&&(console.warn(z+" used as a key, but it is not a string."),z=String(z)),z}function _t(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var E=void 0,I={},D=Object.prototype.toString;function F(z){return typeof E=="boolean"?L.resolve(E):function(W){return new L(function(Z){var ft=W.transaction("local-forage-detect-blob-support","readwrite"),mt=C([""]);ft.objectStore("local-forage-detect-blob-support").put(mt,"key"),ft.onabort=function(vt){vt.preventDefault(),vt.stopPropagation(),Z(!1)},ft.oncomplete=function(){var vt=navigator.userAgent.match(/Chrome\/(\d+)/),Ct=navigator.userAgent.match(/Edge\//);Z(Ct||!vt||parseInt(vt[1],10)>=43)}}).catch(function(){return!1})}(z).then(function(W){return E=W})}function P(z){var W=I[z.name],Z={};Z.promise=new L(function(ft,mt){Z.resolve=ft,Z.reject=mt}),W.deferredOperations.push(Z),W.dbReady?W.dbReady=W.dbReady.then(function(){return Z.promise}):W.dbReady=Z.promise}function B(z){var W=I[z.name].deferredOperations.pop();if(W)return W.resolve(),W.promise}function G(z,W){var Z=I[z.name].deferredOperations.pop();if(Z)return Z.reject(W),Z.promise}function q(z,W){return new L(function(Z,ft){if(I[z.name]=I[z.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},z.db){if(!W)return Z(z.db);P(z),z.db.close()}var mt=[z.name];W&&mt.push(z.version);var vt=N.open.apply(N,mt);W&&(vt.onupgradeneeded=function(Ct){var zt=vt.result;try{zt.createObjectStore(z.storeName),Ct.oldVersion<=1&&zt.createObjectStore("local-forage-detect-blob-support")}catch(Ht){if(Ht.name!=="ConstraintError")throw Ht;console.warn('The database "'+z.name+'" has been upgraded from version '+Ct.oldVersion+" to version "+Ct.newVersion+', but the storage "'+z.storeName+'" already exists.')}}),vt.onerror=function(Ct){Ct.preventDefault(),ft(vt.error)},vt.onsuccess=function(){var Ct=vt.result;Ct.onversionchange=function(zt){zt.target.close()},Z(Ct),B(z)}})}function Rt(z){return q(z,!1)}function Xt(z){return q(z,!0)}function at(z,W){if(!z.db)return!0;var Z=!z.db.objectStoreNames.contains(z.storeName),ft=z.version<z.db.version,mt=z.version>z.db.version;if(ft&&(z.version!==W&&console.warn('The database "'+z.name+`" can't be downgraded from version `+z.db.version+" to version "+z.version+"."),z.version=z.db.version),mt||Z){if(Z){var vt=z.db.version+1;vt>z.version&&(z.version=vt)}return!0}return!1}function $(z){return C([function(W){for(var Z=W.length,ft=new ArrayBuffer(Z),mt=new Uint8Array(ft),vt=0;vt<Z;vt++)mt[vt]=W.charCodeAt(vt);return ft}(atob(z.data))],{type:z.type})}function tt(z){return z&&z.__local_forage_encoded_blob}function lt(z){var W=this,Z=W._initReady().then(function(){var ft=I[W._dbInfo.name];if(ft&&ft.dbReady)return ft.dbReady});return K(Z,z,z),Z}function w(z,W,Z,ft){ft===void 0&&(ft=1);try{var mt=z.db.transaction(z.storeName,W);Z(null,mt)}catch(vt){if(ft>0&&(!z.db||vt.name==="InvalidStateError"||vt.name==="NotFoundError"))return L.resolve().then(function(){if(!z.db||vt.name==="NotFoundError"&&!z.db.objectStoreNames.contains(z.storeName)&&z.version<=z.db.version)return z.db&&(z.version=z.db.version+1),Xt(z)}).then(function(){return function(Ct){P(Ct);for(var zt=I[Ct.name],Ht=zt.forages,Wt=0;Wt<Ht.length;Wt++){var ne=Ht[Wt];ne._dbInfo.db&&(ne._dbInfo.db.close(),ne._dbInfo.db=null)}return Ct.db=null,Rt(Ct).then(function(oe){return Ct.db=oe,at(Ct)?Xt(Ct):oe}).then(function(oe){Ct.db=zt.db=oe;for(var ye=0;ye<Ht.length;ye++)Ht[ye]._dbInfo.db=oe}).catch(function(oe){throw G(Ct,oe),oe})}(z).then(function(){w(z,W,Z,ft-1)})}).catch(Z);Z(vt)}}var ot={_driver:"asyncStorage",_initStorage:function(z){var W=this,Z={db:null};if(z)for(var ft in z)Z[ft]=z[ft];var mt=I[Z.name];mt||(mt={forages:[],db:null,dbReady:null,deferredOperations:[]},I[Z.name]=mt),mt.forages.push(W),W._initReady||(W._initReady=W.ready,W.ready=lt);var vt=[];function Ct(){return L.resolve()}for(var zt=0;zt<mt.forages.length;zt++){var Ht=mt.forages[zt];Ht!==W&&vt.push(Ht._initReady().catch(Ct))}var Wt=mt.forages.slice(0);return L.all(vt).then(function(){return Z.db=mt.db,Rt(Z)}).then(function(ne){return Z.db=ne,at(Z,W._defaultConfig.version)?Xt(Z):ne}).then(function(ne){Z.db=mt.db=ne,W._dbInfo=Z;for(var oe=0;oe<Wt.length;oe++){var ye=Wt[oe];ye!==W&&(ye._dbInfo.db=Z.db,ye._dbInfo.version=Z.version)}})},_support:function(){try{if(!N||!N.open)return!1;var z=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),W=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!z||W)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch{return!1}}(),iterate:function(z,W){var Z=this,ft=new L(function(mt,vt){Z.ready().then(function(){w(Z._dbInfo,"readonly",function(Ct,zt){if(Ct)return vt(Ct);try{var Ht=zt.objectStore(Z._dbInfo.storeName).openCursor(),Wt=1;Ht.onsuccess=function(){var ne=Ht.result;if(ne){var oe=ne.value;tt(oe)&&(oe=$(oe));var ye=z(oe,ne.key,Wt++);ye!==void 0?mt(ye):ne.continue()}else mt()},Ht.onerror=function(){vt(Ht.error)}}catch(ne){vt(ne)}})}).catch(vt)});return k(ft,W),ft},getItem:function(z,W){var Z=this;z=ut(z);var ft=new L(function(mt,vt){Z.ready().then(function(){w(Z._dbInfo,"readonly",function(Ct,zt){if(Ct)return vt(Ct);try{var Ht=zt.objectStore(Z._dbInfo.storeName).get(z);Ht.onsuccess=function(){var Wt=Ht.result;Wt===void 0&&(Wt=null),tt(Wt)&&(Wt=$(Wt)),mt(Wt)},Ht.onerror=function(){vt(Ht.error)}}catch(Wt){vt(Wt)}})}).catch(vt)});return k(ft,W),ft},setItem:function(z,W,Z){var ft=this;z=ut(z);var mt=new L(function(vt,Ct){var zt;ft.ready().then(function(){return zt=ft._dbInfo,D.call(W)==="[object Blob]"?F(zt.db).then(function(Ht){return Ht?W:(Wt=W,new L(function(ne,oe){var ye=new FileReader;ye.onerror=oe,ye.onloadend=function(Ce){var Ie=btoa(Ce.target.result||"");ne({__local_forage_encoded_blob:!0,data:Ie,type:Wt.type})},ye.readAsBinaryString(Wt)}));var Wt}):W}).then(function(Ht){w(ft._dbInfo,"readwrite",function(Wt,ne){if(Wt)return Ct(Wt);try{var oe=ne.objectStore(ft._dbInfo.storeName);Ht===null&&(Ht=void 0);var ye=oe.put(Ht,z);ne.oncomplete=function(){Ht===void 0&&(Ht=null),vt(Ht)},ne.onabort=ne.onerror=function(){var Ce=ye.error?ye.error:ye.transaction.error;Ct(Ce)}}catch(Ce){Ct(Ce)}})}).catch(Ct)});return k(mt,Z),mt},removeItem:function(z,W){var Z=this;z=ut(z);var ft=new L(function(mt,vt){Z.ready().then(function(){w(Z._dbInfo,"readwrite",function(Ct,zt){if(Ct)return vt(Ct);try{var Ht=zt.objectStore(Z._dbInfo.storeName).delete(z);zt.oncomplete=function(){mt()},zt.onerror=function(){vt(Ht.error)},zt.onabort=function(){var Wt=Ht.error?Ht.error:Ht.transaction.error;vt(Wt)}}catch(Wt){vt(Wt)}})}).catch(vt)});return k(ft,W),ft},clear:function(z){var W=this,Z=new L(function(ft,mt){W.ready().then(function(){w(W._dbInfo,"readwrite",function(vt,Ct){if(vt)return mt(vt);try{var zt=Ct.objectStore(W._dbInfo.storeName).clear();Ct.oncomplete=function(){ft()},Ct.onabort=Ct.onerror=function(){var Ht=zt.error?zt.error:zt.transaction.error;mt(Ht)}}catch(Ht){mt(Ht)}})}).catch(mt)});return k(Z,z),Z},length:function(z){var W=this,Z=new L(function(ft,mt){W.ready().then(function(){w(W._dbInfo,"readonly",function(vt,Ct){if(vt)return mt(vt);try{var zt=Ct.objectStore(W._dbInfo.storeName).count();zt.onsuccess=function(){ft(zt.result)},zt.onerror=function(){mt(zt.error)}}catch(Ht){mt(Ht)}})}).catch(mt)});return k(Z,z),Z},key:function(z,W){var Z=this,ft=new L(function(mt,vt){z<0?mt(null):Z.ready().then(function(){w(Z._dbInfo,"readonly",function(Ct,zt){if(Ct)return vt(Ct);try{var Ht=zt.objectStore(Z._dbInfo.storeName),Wt=!1,ne=Ht.openKeyCursor();ne.onsuccess=function(){var oe=ne.result;oe?z===0||Wt?mt(oe.key):(Wt=!0,oe.advance(z)):mt(null)},ne.onerror=function(){vt(ne.error)}}catch(oe){vt(oe)}})}).catch(vt)});return k(ft,W),ft},keys:function(z){var W=this,Z=new L(function(ft,mt){W.ready().then(function(){w(W._dbInfo,"readonly",function(vt,Ct){if(vt)return mt(vt);try{var zt=Ct.objectStore(W._dbInfo.storeName).openKeyCursor(),Ht=[];zt.onsuccess=function(){var Wt=zt.result;Wt?(Ht.push(Wt.key),Wt.continue()):ft(Ht)},zt.onerror=function(){mt(zt.error)}}catch(Wt){mt(Wt)}})}).catch(mt)});return k(Z,z),Z},dropInstance:function(z,W){W=_t.apply(this,arguments);var Z=this.config();(z=typeof z!="function"&&z||{}).name||(z.name=z.name||Z.name,z.storeName=z.storeName||Z.storeName);var ft,mt=this;if(z.name){var vt=z.name===Z.name&&mt._dbInfo.db,Ct=vt?L.resolve(mt._dbInfo.db):Rt(z).then(function(zt){var Ht=I[z.name],Wt=Ht.forages;Ht.db=zt;for(var ne=0;ne<Wt.length;ne++)Wt[ne]._dbInfo.db=zt;return zt});ft=z.storeName?Ct.then(function(zt){if(zt.objectStoreNames.contains(z.storeName)){var Ht=zt.version+1;P(z);var Wt=I[z.name],ne=Wt.forages;zt.close();for(var oe=0;oe<ne.length;oe++){var ye=ne[oe];ye._dbInfo.db=null,ye._dbInfo.version=Ht}return new L(function(Ce,Ie){var Ke=N.open(z.name,Ht);Ke.onerror=function(Tn){Ke.result.close(),Ie(Tn)},Ke.onupgradeneeded=function(){Ke.result.deleteObjectStore(z.storeName)},Ke.onsuccess=function(){var Tn=Ke.result;Tn.close(),Ce(Tn)}}).then(function(Ce){Wt.db=Ce;for(var Ie=0;Ie<ne.length;Ie++){var Ke=ne[Ie];Ke._dbInfo.db=Ce,B(Ke._dbInfo)}}).catch(function(Ce){throw(G(z,Ce)||L.resolve()).catch(function(){}),Ce})}}):Ct.then(function(zt){P(z);var Ht=I[z.name],Wt=Ht.forages;zt.close();for(var ne=0;ne<Wt.length;ne++)Wt[ne]._dbInfo.db=null;return new L(function(oe,ye){var Ce=N.deleteDatabase(z.name);Ce.onerror=function(){var Ie=Ce.result;Ie&&Ie.close(),ye(Ce.error)},Ce.onblocked=function(){console.warn('dropInstance blocked for database "'+z.name+'" until all open connections are closed')},Ce.onsuccess=function(){var Ie=Ce.result;Ie&&Ie.close(),oe(Ie)}}).then(function(oe){Ht.db=oe;for(var ye=0;ye<Wt.length;ye++)B(Wt[ye]._dbInfo)}).catch(function(oe){throw(G(z,oe)||L.resolve()).catch(function(){}),oe})})}else ft=L.reject("Invalid arguments");return k(ft,W),ft}},bt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",dt=/^~~local_forage_type~([^~]+)~/,yt=9,Ot=yt+4,kt=Object.prototype.toString;function Dt(z){var W,Z,ft,mt,vt,Ct=.75*z.length,zt=z.length,Ht=0;z[z.length-1]==="="&&(Ct--,z[z.length-2]==="="&&Ct--);var Wt=new ArrayBuffer(Ct),ne=new Uint8Array(Wt);for(W=0;W<zt;W+=4)Z=bt.indexOf(z[W]),ft=bt.indexOf(z[W+1]),mt=bt.indexOf(z[W+2]),vt=bt.indexOf(z[W+3]),ne[Ht++]=Z<<2|ft>>4,ne[Ht++]=(15&ft)<<4|mt>>2,ne[Ht++]=(3&mt)<<6|63&vt;return Wt}function te(z){var W,Z=new Uint8Array(z),ft="";for(W=0;W<Z.length;W+=3)ft+=bt[Z[W]>>2],ft+=bt[(3&Z[W])<<4|Z[W+1]>>4],ft+=bt[(15&Z[W+1])<<2|Z[W+2]>>6],ft+=bt[63&Z[W+2]];return Z.length%3==2?ft=ft.substring(0,ft.length-1)+"=":Z.length%3==1&&(ft=ft.substring(0,ft.length-2)+"=="),ft}var re={serialize:function(z,W){var Z="";if(z&&(Z=kt.call(z)),z&&(Z==="[object ArrayBuffer]"||z.buffer&&kt.call(z.buffer)==="[object ArrayBuffer]")){var ft,mt="__lfsc__:";z instanceof ArrayBuffer?(ft=z,mt+="arbf"):(ft=z.buffer,Z==="[object Int8Array]"?mt+="si08":Z==="[object Uint8Array]"?mt+="ui08":Z==="[object Uint8ClampedArray]"?mt+="uic8":Z==="[object Int16Array]"?mt+="si16":Z==="[object Uint16Array]"?mt+="ur16":Z==="[object Int32Array]"?mt+="si32":Z==="[object Uint32Array]"?mt+="ui32":Z==="[object Float32Array]"?mt+="fl32":Z==="[object Float64Array]"?mt+="fl64":W(new Error("Failed to get type for BinaryArray"))),W(mt+te(ft))}else if(Z==="[object Blob]"){var vt=new FileReader;vt.onload=function(){var Ct="~~local_forage_type~"+z.type+"~"+te(this.result);W("__lfsc__:blob"+Ct)},vt.readAsArrayBuffer(z)}else try{W(JSON.stringify(z))}catch(Ct){console.error("Couldn't convert value into a JSON string: ",z),W(null,Ct)}},deserialize:function(z){if(z.substring(0,yt)!=="__lfsc__:")return JSON.parse(z);var W,Z=z.substring(Ot),ft=z.substring(yt,Ot);if(ft==="blob"&&dt.test(Z)){var mt=Z.match(dt);W=mt[1],Z=Z.substring(mt[0].length)}var vt=Dt(Z);switch(ft){case"arbf":return vt;case"blob":return C([vt],{type:W});case"si08":return new Int8Array(vt);case"ui08":return new Uint8Array(vt);case"uic8":return new Uint8ClampedArray(vt);case"si16":return new Int16Array(vt);case"ur16":return new Uint16Array(vt);case"si32":return new Int32Array(vt);case"ui32":return new Uint32Array(vt);case"fl32":return new Float32Array(vt);case"fl64":return new Float64Array(vt);default:throw new Error("Unkown type: "+ft)}},stringToBuffer:Dt,bufferToString:te};function $t(z,W,Z,ft){z.executeSql("CREATE TABLE IF NOT EXISTS "+W.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],Z,ft)}function pe(z,W,Z,ft,mt,vt){z.executeSql(Z,ft,mt,function(Ct,zt){zt.code===zt.SYNTAX_ERR?Ct.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[W.storeName],function(Ht,Wt){Wt.rows.length?vt(Ht,zt):$t(Ht,W,function(){Ht.executeSql(Z,ft,mt,vt)},vt)},vt):vt(Ct,zt)},vt)}function le(z,W,Z,ft){var mt=this;z=ut(z);var vt=new L(function(Ct,zt){mt.ready().then(function(){W===void 0&&(W=null);var Ht=W,Wt=mt._dbInfo;Wt.serializer.serialize(W,function(ne,oe){oe?zt(oe):Wt.db.transaction(function(ye){pe(ye,Wt,"INSERT OR REPLACE INTO "+Wt.storeName+" (key, value) VALUES (?, ?)",[z,ne],function(){Ct(Ht)},function(Ce,Ie){zt(Ie)})},function(ye){if(ye.code===ye.QUOTA_ERR){if(ft>0)return void Ct(le.apply(mt,[z,Ht,Z,ft-1]));zt(ye)}})})}).catch(zt)});return k(vt,Z),vt}function Se(z){return new L(function(W,Z){z.transaction(function(ft){ft.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(mt,vt){for(var Ct=[],zt=0;zt<vt.rows.length;zt++)Ct.push(vt.rows.item(zt).name);W({db:z,storeNames:Ct})},function(mt,vt){Z(vt)})},function(ft){Z(ft)})})}var ue={_driver:"webSQLStorage",_initStorage:function(z){var W=this,Z={db:null};if(z)for(var ft in z)Z[ft]=typeof z[ft]!="string"?z[ft].toString():z[ft];var mt=new L(function(vt,Ct){try{Z.db=openDatabase(Z.name,String(Z.version),Z.description,Z.size)}catch(zt){return Ct(zt)}Z.db.transaction(function(zt){$t(zt,Z,function(){W._dbInfo=Z,vt()},function(Ht,Wt){Ct(Wt)})},Ct)});return Z.serializer=re,mt},_support:typeof openDatabase=="function",iterate:function(z,W){var Z=this,ft=new L(function(mt,vt){Z.ready().then(function(){var Ct=Z._dbInfo;Ct.db.transaction(function(zt){pe(zt,Ct,"SELECT * FROM "+Ct.storeName,[],function(Ht,Wt){for(var ne=Wt.rows,oe=ne.length,ye=0;ye<oe;ye++){var Ce=ne.item(ye),Ie=Ce.value;if(Ie&&(Ie=Ct.serializer.deserialize(Ie)),(Ie=z(Ie,Ce.key,ye+1))!==void 0)return void mt(Ie)}mt()},function(Ht,Wt){vt(Wt)})})}).catch(vt)});return k(ft,W),ft},getItem:function(z,W){var Z=this;z=ut(z);var ft=new L(function(mt,vt){Z.ready().then(function(){var Ct=Z._dbInfo;Ct.db.transaction(function(zt){pe(zt,Ct,"SELECT * FROM "+Ct.storeName+" WHERE key = ? LIMIT 1",[z],function(Ht,Wt){var ne=Wt.rows.length?Wt.rows.item(0).value:null;ne&&(ne=Ct.serializer.deserialize(ne)),mt(ne)},function(Ht,Wt){vt(Wt)})})}).catch(vt)});return k(ft,W),ft},setItem:function(z,W,Z){return le.apply(this,[z,W,Z,1])},removeItem:function(z,W){var Z=this;z=ut(z);var ft=new L(function(mt,vt){Z.ready().then(function(){var Ct=Z._dbInfo;Ct.db.transaction(function(zt){pe(zt,Ct,"DELETE FROM "+Ct.storeName+" WHERE key = ?",[z],function(){mt()},function(Ht,Wt){vt(Wt)})})}).catch(vt)});return k(ft,W),ft},clear:function(z){var W=this,Z=new L(function(ft,mt){W.ready().then(function(){var vt=W._dbInfo;vt.db.transaction(function(Ct){pe(Ct,vt,"DELETE FROM "+vt.storeName,[],function(){ft()},function(zt,Ht){mt(Ht)})})}).catch(mt)});return k(Z,z),Z},length:function(z){var W=this,Z=new L(function(ft,mt){W.ready().then(function(){var vt=W._dbInfo;vt.db.transaction(function(Ct){pe(Ct,vt,"SELECT COUNT(key) as c FROM "+vt.storeName,[],function(zt,Ht){var Wt=Ht.rows.item(0).c;ft(Wt)},function(zt,Ht){mt(Ht)})})}).catch(mt)});return k(Z,z),Z},key:function(z,W){var Z=this,ft=new L(function(mt,vt){Z.ready().then(function(){var Ct=Z._dbInfo;Ct.db.transaction(function(zt){pe(zt,Ct,"SELECT key FROM "+Ct.storeName+" WHERE id = ? LIMIT 1",[z+1],function(Ht,Wt){var ne=Wt.rows.length?Wt.rows.item(0).key:null;mt(ne)},function(Ht,Wt){vt(Wt)})})}).catch(vt)});return k(ft,W),ft},keys:function(z){var W=this,Z=new L(function(ft,mt){W.ready().then(function(){var vt=W._dbInfo;vt.db.transaction(function(Ct){pe(Ct,vt,"SELECT key FROM "+vt.storeName,[],function(zt,Ht){for(var Wt=[],ne=0;ne<Ht.rows.length;ne++)Wt.push(Ht.rows.item(ne).key);ft(Wt)},function(zt,Ht){mt(Ht)})})}).catch(mt)});return k(Z,z),Z},dropInstance:function(z,W){W=_t.apply(this,arguments);var Z=this.config();(z=typeof z!="function"&&z||{}).name||(z.name=z.name||Z.name,z.storeName=z.storeName||Z.storeName);var ft,mt=this;return k(ft=z.name?new L(function(vt){var Ct;Ct=z.name===Z.name?mt._dbInfo.db:openDatabase(z.name,"","",0),z.storeName?vt({db:Ct,storeNames:[z.storeName]}):vt(Se(Ct))}).then(function(vt){return new L(function(Ct,zt){vt.db.transaction(function(Ht){function Wt(Ce){return new L(function(Ie,Ke){Ht.executeSql("DROP TABLE IF EXISTS "+Ce,[],function(){Ie()},function(Tn,Si){Ke(Si)})})}for(var ne=[],oe=0,ye=vt.storeNames.length;oe<ye;oe++)ne.push(Wt(vt.storeNames[oe]));L.all(ne).then(function(){Ct()}).catch(function(Ce){zt(Ce)})},function(Ht){zt(Ht)})})}):L.reject("Invalid arguments"),W),ft}};function Oe(z,W){var Z=z.name+"/";return z.storeName!==W.storeName&&(Z+=z.storeName+"/"),Z}function Me(){return!function(){try{return localStorage.setItem("_localforage_support_test",!0),localStorage.removeItem("_localforage_support_test"),!1}catch{return!0}}()||localStorage.length>0}var Ge={_driver:"localStorageWrapper",_initStorage:function(z){var W={};if(z)for(var Z in z)W[Z]=z[Z];return W.keyPrefix=Oe(z,this._defaultConfig),Me()?(this._dbInfo=W,W.serializer=re,L.resolve()):L.reject()},_support:function(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}(),iterate:function(z,W){var Z=this,ft=Z.ready().then(function(){for(var mt=Z._dbInfo,vt=mt.keyPrefix,Ct=vt.length,zt=localStorage.length,Ht=1,Wt=0;Wt<zt;Wt++){var ne=localStorage.key(Wt);if(ne.indexOf(vt)===0){var oe=localStorage.getItem(ne);if(oe&&(oe=mt.serializer.deserialize(oe)),(oe=z(oe,ne.substring(Ct),Ht++))!==void 0)return oe}}});return k(ft,W),ft},getItem:function(z,W){var Z=this;z=ut(z);var ft=Z.ready().then(function(){var mt=Z._dbInfo,vt=localStorage.getItem(mt.keyPrefix+z);return vt&&(vt=mt.serializer.deserialize(vt)),vt});return k(ft,W),ft},setItem:function(z,W,Z){var ft=this;z=ut(z);var mt=ft.ready().then(function(){W===void 0&&(W=null);var vt=W;return new L(function(Ct,zt){var Ht=ft._dbInfo;Ht.serializer.serialize(W,function(Wt,ne){if(ne)zt(ne);else try{localStorage.setItem(Ht.keyPrefix+z,Wt),Ct(vt)}catch(oe){oe.name!=="QuotaExceededError"&&oe.name!=="NS_ERROR_DOM_QUOTA_REACHED"||zt(oe),zt(oe)}})})});return k(mt,Z),mt},removeItem:function(z,W){var Z=this;z=ut(z);var ft=Z.ready().then(function(){var mt=Z._dbInfo;localStorage.removeItem(mt.keyPrefix+z)});return k(ft,W),ft},clear:function(z){var W=this,Z=W.ready().then(function(){for(var ft=W._dbInfo.keyPrefix,mt=localStorage.length-1;mt>=0;mt--){var vt=localStorage.key(mt);vt.indexOf(ft)===0&&localStorage.removeItem(vt)}});return k(Z,z),Z},length:function(z){var W=this.keys().then(function(Z){return Z.length});return k(W,z),W},key:function(z,W){var Z=this,ft=Z.ready().then(function(){var mt,vt=Z._dbInfo;try{mt=localStorage.key(z)}catch{mt=null}return mt&&(mt=mt.substring(vt.keyPrefix.length)),mt});return k(ft,W),ft},keys:function(z){var W=this,Z=W.ready().then(function(){for(var ft=W._dbInfo,mt=localStorage.length,vt=[],Ct=0;Ct<mt;Ct++){var zt=localStorage.key(Ct);zt.indexOf(ft.keyPrefix)===0&&vt.push(zt.substring(ft.keyPrefix.length))}return vt});return k(Z,z),Z},dropInstance:function(z,W){if(W=_t.apply(this,arguments),!(z=typeof z!="function"&&z||{}).name){var Z=this.config();z.name=z.name||Z.name,z.storeName=z.storeName||Z.storeName}var ft,mt=this;return k(ft=z.name?new L(function(vt){z.storeName?vt(Oe(z,mt._defaultConfig)):vt(z.name+"/")}).then(function(vt){for(var Ct=localStorage.length-1;Ct>=0;Ct--){var zt=localStorage.key(Ct);zt.indexOf(vt)===0&&localStorage.removeItem(zt)}}):L.reject("Invalid arguments"),W),ft}},nn=function(z,W){for(var Z,ft,mt=z.length,vt=0;vt<mt;){if((Z=z[vt])===(ft=W)||typeof Z=="number"&&typeof ft=="number"&&isNaN(Z)&&isNaN(ft))return!0;vt++}return!1},fe=Array.isArray||function(z){return Object.prototype.toString.call(z)==="[object Array]"},ge={},En={},je={INDEXEDDB:ot,WEBSQL:ue,LOCALSTORAGE:Ge},rn=[je.INDEXEDDB._driver,je.WEBSQL._driver,je.LOCALSTORAGE._driver],wn=["dropInstance"],er=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(wn),Ti={description:"",driver:rn.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Ds(z,W){z[W]=function(){var Z=arguments;return z.ready().then(function(){return z[W].apply(z,Z)})}}function nr(){for(var z=1;z<arguments.length;z++){var W=arguments[z];if(W)for(var Z in W)W.hasOwnProperty(Z)&&(fe(W[Z])?arguments[0][Z]=W[Z].slice():arguments[0][Z]=W[Z])}return arguments[0]}var Fs=new(function(){function z(W){for(var Z in function(vt,Ct){if(!(vt instanceof Ct))throw new TypeError("Cannot call a class as a function")}(this,z),je)if(je.hasOwnProperty(Z)){var ft=je[Z],mt=ft._driver;this[Z]=mt,ge[mt]||this.defineDriver(ft)}this._defaultConfig=nr({},Ti),this._config=nr({},this._defaultConfig,W),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return z.prototype.config=function(W){if((W===void 0?"undefined":S(W))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var Z in W){if(Z==="storeName"&&(W[Z]=W[Z].replace(/\W/g,"_")),Z==="version"&&typeof W[Z]!="number")return new Error("Database version must be a number.");this._config[Z]=W[Z]}return!("driver"in W)||!W.driver||this.setDriver(this._config.driver)}return typeof W=="string"?this._config[W]:this._config},z.prototype.defineDriver=function(W,Z,ft){var mt=new L(function(vt,Ct){try{var zt=W._driver,Ht=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!W._driver)return void Ct(Ht);for(var Wt=er.concat("_initStorage"),ne=0,oe=Wt.length;ne<oe;ne++){var ye=Wt[ne];if((!nn(wn,ye)||W[ye])&&typeof W[ye]!="function")return void Ct(Ht)}(function(){for(var Ie=function(Mr){return function(){var zl=new Error("Method "+Mr+" is not implemented by the current driver"),Qo=L.reject(zl);return k(Qo,arguments[arguments.length-1]),Qo}},Ke=0,Tn=wn.length;Ke<Tn;Ke++){var Si=wn[Ke];W[Si]||(W[Si]=Ie(Si))}})();var Ce=function(Ie){ge[zt]&&console.info("Redefining LocalForage driver: "+zt),ge[zt]=W,En[zt]=Ie,vt()};"_support"in W?W._support&&typeof W._support=="function"?W._support().then(Ce,Ct):Ce(!!W._support):Ce(!0)}catch(Ie){Ct(Ie)}});return K(mt,Z,ft),mt},z.prototype.driver=function(){return this._driver||null},z.prototype.getDriver=function(W,Z,ft){var mt=ge[W]?L.resolve(ge[W]):L.reject(new Error("Driver not found."));return K(mt,Z,ft),mt},z.prototype.getSerializer=function(W){var Z=L.resolve(re);return K(Z,W),Z},z.prototype.ready=function(W){var Z=this,ft=Z._driverSet.then(function(){return Z._ready===null&&(Z._ready=Z._initDriver()),Z._ready});return K(ft,W,W),ft},z.prototype.setDriver=function(W,Z,ft){var mt=this;fe(W)||(W=[W]);var vt=this._getSupportedDrivers(W);function Ct(){mt._config.driver=mt.driver()}function zt(Wt){return mt._extend(Wt),Ct(),mt._ready=mt._initStorage(mt._config),mt._ready}var Ht=this._driverSet!==null?this._driverSet.catch(function(){return L.resolve()}):L.resolve();return this._driverSet=Ht.then(function(){var Wt=vt[0];return mt._dbInfo=null,mt._ready=null,mt.getDriver(Wt).then(function(ne){mt._driver=ne._driver,Ct(),mt._wrapLibraryMethodsWithReady(),mt._initDriver=function(oe){return function(){var ye=0;return function Ce(){for(;ye<oe.length;){var Ie=oe[ye];return ye++,mt._dbInfo=null,mt._ready=null,mt.getDriver(Ie).then(zt).catch(Ce)}Ct();var Ke=new Error("No available storage method found.");return mt._driverSet=L.reject(Ke),mt._driverSet}()}}(vt)})}).catch(function(){Ct();var Wt=new Error("No available storage method found.");return mt._driverSet=L.reject(Wt),mt._driverSet}),K(this._driverSet,Z,ft),this._driverSet},z.prototype.supports=function(W){return!!En[W]},z.prototype._extend=function(W){nr(this,W)},z.prototype._getSupportedDrivers=function(W){for(var Z=[],ft=0,mt=W.length;ft<mt;ft++){var vt=W[ft];this.supports(vt)&&Z.push(vt)}return Z},z.prototype._wrapLibraryMethodsWithReady=function(){for(var W=0,Z=er.length;W<Z;W++)Ds(this,er[W])},z.prototype.createInstance=function(W){return new z(W)},z}());R.exports=Fs},{3:3}]},{},[4])(4)}).call(this,d(11))},function(m,y,d){var x=d(7),b=d(105),R=d(106),T=Math.max,S=Math.min;m.exports=function(N,C,L){var k,K,ut,_t,E,I,D=0,F=!1,P=!1,B=!0;if(typeof N!="function")throw new TypeError("Expected a function");function G(tt){var lt=k,w=K;return k=K=void 0,D=tt,_t=N.apply(w,lt)}function q(tt){return D=tt,E=setTimeout(Xt,C),F?G(tt):_t}function Rt(tt){var lt=tt-I;return I===void 0||lt>=C||lt<0||P&&tt-D>=ut}function Xt(){var tt=b();if(Rt(tt))return at(tt);E=setTimeout(Xt,function(lt){var w=C-(lt-I);return P?S(w,ut-(lt-D)):w}(tt))}function at(tt){return E=void 0,B&&k?G(tt):(k=K=void 0,_t)}function $(){var tt=b(),lt=Rt(tt);if(k=arguments,K=this,I=tt,lt){if(E===void 0)return q(I);if(P)return clearTimeout(E),E=setTimeout(Xt,C),G(I)}return E===void 0&&(E=setTimeout(Xt,C)),_t}return C=R(C)||0,x(L)&&(F=!!L.leading,ut=(P="maxWait"in L)?T(R(L.maxWait)||0,C):ut,B="trailing"in L?!!L.trailing:B),$.cancel=function(){E!==void 0&&clearTimeout(E),D=0,k=I=K=E=void 0},$.flush=function(){return E===void 0?_t:at(b())},$}},function(m,y){var d;d=function(){return this}();try{d=d||new Function("return this")()}catch{typeof window=="object"&&(d=window)}m.exports=d},function(m,y,d){var x=d(3).Symbol;m.exports=x},function(m,y){m.exports=function(d){return d.webpackPolyfill||(d.deprecate=function(){},d.paths=[],d.children||(d.children=[]),Object.defineProperty(d,"loaded",{enumerable:!0,get:function(){return d.l}}),Object.defineProperty(d,"id",{enumerable:!0,get:function(){return d.i}}),d.webpackPolyfill=1),d}},function(m,y,d){var x=d(113),b=d(114),R=d(115),T=d(116),S=d(117);function N(C){var L=-1,k=C==null?0:C.length;for(this.clear();++L<k;){var K=C[L];this.set(K[0],K[1])}}N.prototype.clear=x,N.prototype.delete=b,N.prototype.get=R,N.prototype.has=T,N.prototype.set=S,m.exports=N},function(m,y,d){var x=d(23);m.exports=function(b,R){for(var T=b.length;T--;)if(x(b[T][0],R))return T;return-1}},function(m,y,d){var x=d(8)(Object,"create");m.exports=x},function(m,y,d){var x=d(135);m.exports=function(b,R){var T=b.__data__;return x(R)?T[typeof R=="string"?"string":"hash"]:T.map}},function(m,y){var d=Array.isArray;m.exports=d},function(m,y,d){var x=d(157),b=d(24),R=d(158),T=d(159),S=d(160),N=d(6),C=d(39),L=C(x),k=C(b),K=C(R),ut=C(T),_t=C(S),E=N;(x&&E(new x(new ArrayBuffer(1)))!="[object DataView]"||b&&E(new b)!="[object Map]"||R&&E(R.resolve())!="[object Promise]"||T&&E(new T)!="[object Set]"||S&&E(new S)!="[object WeakMap]")&&(E=function(I){var D=N(I),F=D=="[object Object]"?I.constructor:void 0,P=F?C(F):"";if(P)switch(P){case L:return"[object DataView]";case k:return"[object Map]";case K:return"[object Promise]";case ut:return"[object Set]";case _t:return"[object WeakMap]"}return D}),m.exports=E},function(m,y,d){var x=d(52),b=d(53);m.exports=function(R,T,S,N){var C=!S;S||(S={});for(var L=-1,k=T.length;++L<k;){var K=T[L],ut=N?N(S[K],R[K],K,S,R):void 0;ut===void 0&&(ut=R[K]),C?b(S,K,ut):x(S,K,ut)}return S}},function(m,y,d){var x=d(6),b=d(7);m.exports=function(R){if(!b(R))return!1;var T=x(R);return T=="[object Function]"||T=="[object GeneratorFunction]"||T=="[object AsyncFunction]"||T=="[object Proxy]"}},function(m,y,d){var x=d(99),b=d(100);function R(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}y.parse=P,y.resolve=function(B,G){return P(B,!1,!0).resolve(G)},y.resolveObject=function(B,G){return B?P(B,!1,!0).resolveObject(G):G},y.format=function(B){return b.isString(B)&&(B=P(B)),B instanceof R?B.format():R.prototype.format.call(B)},y.Url=R;var T=/^([a-z0-9.+-]+:)/i,S=/:[0-9]*$/,N=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,C=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
2
|
-
`," "]),L=["'"].concat(C),k=["%","/","?",";","#"].concat(L),K=["/","?","#"],ut=/^[+a-z0-9A-Z_-]{0,63}$/,_t=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,E={javascript:!0,"javascript:":!0},I={javascript:!0,"javascript:":!0},D={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},F=d(101);function P(B,G,q){if(B&&b.isObject(B)&&B instanceof R)return B;var Rt=new R;return Rt.parse(B,G,q),Rt}R.prototype.parse=function(B,G,q){if(!b.isString(B))throw new TypeError("Parameter 'url' must be a string, not "+typeof B);var Rt=B.indexOf("?"),Xt=Rt!==-1&&Rt<B.indexOf("#")?"?":"#",at=B.split(Xt);at[0]=at[0].replace(/\\/g,"/");var $=B=at.join(Xt);if($=$.trim(),!q&&B.split("#").length===1){var tt=N.exec($);if(tt)return this.path=$,this.href=$,this.pathname=tt[1],tt[2]?(this.search=tt[2],this.query=G?F.parse(this.search.substr(1)):this.search.substr(1)):G&&(this.search="",this.query={}),this}var lt=T.exec($);if(lt){var w=(lt=lt[0]).toLowerCase();this.protocol=w,$=$.substr(lt.length)}if(q||lt||$.match(/^\/\/[^@\/]+@[^@\/]+/)){var ot=$.substr(0,2)==="//";!ot||lt&&I[lt]||($=$.substr(2),this.slashes=!0)}if(!I[lt]&&(ot||lt&&!D[lt])){for(var bt,dt,yt=-1,Ot=0;Ot<K.length;Ot++)(kt=$.indexOf(K[Ot]))!==-1&&(yt===-1||kt<yt)&&(yt=kt);for((dt=yt===-1?$.lastIndexOf("@"):$.lastIndexOf("@",yt))!==-1&&(bt=$.slice(0,dt),$=$.slice(dt+1),this.auth=decodeURIComponent(bt)),yt=-1,Ot=0;Ot<k.length;Ot++){var kt;(kt=$.indexOf(k[Ot]))!==-1&&(yt===-1||kt<yt)&&(yt=kt)}yt===-1&&(yt=$.length),this.host=$.slice(0,yt),$=$.slice(yt),this.parseHost(),this.hostname=this.hostname||"";var Dt=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!Dt)for(var te=this.hostname.split(/\./),re=(Ot=0,te.length);Ot<re;Ot++){var $t=te[Ot];if($t&&!$t.match(ut)){for(var pe="",le=0,Se=$t.length;le<Se;le++)$t.charCodeAt(le)>127?pe+="x":pe+=$t[le];if(!pe.match(ut)){var ue=te.slice(0,Ot),Oe=te.slice(Ot+1),Me=$t.match(_t);Me&&(ue.push(Me[1]),Oe.unshift(Me[2])),Oe.length&&($="/"+Oe.join(".")+$),this.hostname=ue.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),Dt||(this.hostname=x.toASCII(this.hostname));var Ge=this.port?":"+this.port:"",nn=this.hostname||"";this.host=nn+Ge,this.href+=this.host,Dt&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),$[0]!=="/"&&($="/"+$))}if(!E[w])for(Ot=0,re=L.length;Ot<re;Ot++){var fe=L[Ot];if($.indexOf(fe)!==-1){var ge=encodeURIComponent(fe);ge===fe&&(ge=escape(fe)),$=$.split(fe).join(ge)}}var En=$.indexOf("#");En!==-1&&(this.hash=$.substr(En),$=$.slice(0,En));var je=$.indexOf("?");if(je!==-1?(this.search=$.substr(je),this.query=$.substr(je+1),G&&(this.query=F.parse(this.query)),$=$.slice(0,je)):G&&(this.search="",this.query={}),$&&(this.pathname=$),D[w]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){Ge=this.pathname||"";var rn=this.search||"";this.path=Ge+rn}return this.href=this.format(),this},R.prototype.format=function(){var B=this.auth||"";B&&(B=(B=encodeURIComponent(B)).replace(/%3A/i,":"),B+="@");var G=this.protocol||"",q=this.pathname||"",Rt=this.hash||"",Xt=!1,at="";this.host?Xt=B+this.host:this.hostname&&(Xt=B+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(Xt+=":"+this.port)),this.query&&b.isObject(this.query)&&Object.keys(this.query).length&&(at=F.stringify(this.query));var $=this.search||at&&"?"+at||"";return G&&G.substr(-1)!==":"&&(G+=":"),this.slashes||(!G||D[G])&&Xt!==!1?(Xt="//"+(Xt||""),q&&q.charAt(0)!=="/"&&(q="/"+q)):Xt||(Xt=""),Rt&&Rt.charAt(0)!=="#"&&(Rt="#"+Rt),$&&$.charAt(0)!=="?"&&($="?"+$),G+Xt+(q=q.replace(/[?#]/g,function(tt){return encodeURIComponent(tt)}))+($=$.replace("#","%23"))+Rt},R.prototype.resolve=function(B){return this.resolveObject(P(B,!1,!0)).format()},R.prototype.resolveObject=function(B){if(b.isString(B)){var G=new R;G.parse(B,!1,!0),B=G}for(var q=new R,Rt=Object.keys(this),Xt=0;Xt<Rt.length;Xt++){var at=Rt[Xt];q[at]=this[at]}if(q.hash=B.hash,B.href==="")return q.href=q.format(),q;if(B.slashes&&!B.protocol){for(var $=Object.keys(B),tt=0;tt<$.length;tt++){var lt=$[tt];lt!=="protocol"&&(q[lt]=B[lt])}return D[q.protocol]&&q.hostname&&!q.pathname&&(q.path=q.pathname="/"),q.href=q.format(),q}if(B.protocol&&B.protocol!==q.protocol){if(!D[B.protocol]){for(var w=Object.keys(B),ot=0;ot<w.length;ot++){var bt=w[ot];q[bt]=B[bt]}return q.href=q.format(),q}if(q.protocol=B.protocol,B.host||I[B.protocol])q.pathname=B.pathname;else{for(var dt=(B.pathname||"").split("/");dt.length&&!(B.host=dt.shift()););B.host||(B.host=""),B.hostname||(B.hostname=""),dt[0]!==""&&dt.unshift(""),dt.length<2&&dt.unshift(""),q.pathname=dt.join("/")}if(q.search=B.search,q.query=B.query,q.host=B.host||"",q.auth=B.auth,q.hostname=B.hostname||B.host,q.port=B.port,q.pathname||q.search){var yt=q.pathname||"",Ot=q.search||"";q.path=yt+Ot}return q.slashes=q.slashes||B.slashes,q.href=q.format(),q}var kt=q.pathname&&q.pathname.charAt(0)==="/",Dt=B.host||B.pathname&&B.pathname.charAt(0)==="/",te=Dt||kt||q.host&&B.pathname,re=te,$t=q.pathname&&q.pathname.split("/")||[],pe=(dt=B.pathname&&B.pathname.split("/")||[],q.protocol&&!D[q.protocol]);if(pe&&(q.hostname="",q.port=null,q.host&&($t[0]===""?$t[0]=q.host:$t.unshift(q.host)),q.host="",B.protocol&&(B.hostname=null,B.port=null,B.host&&(dt[0]===""?dt[0]=B.host:dt.unshift(B.host)),B.host=null),te=te&&(dt[0]===""||$t[0]==="")),Dt)q.host=B.host||B.host===""?B.host:q.host,q.hostname=B.hostname||B.hostname===""?B.hostname:q.hostname,q.search=B.search,q.query=B.query,$t=dt;else if(dt.length)$t||($t=[]),$t.pop(),$t=$t.concat(dt),q.search=B.search,q.query=B.query;else if(!b.isNullOrUndefined(B.search))return pe&&(q.hostname=q.host=$t.shift(),(Me=!!(q.host&&q.host.indexOf("@")>0)&&q.host.split("@"))&&(q.auth=Me.shift(),q.host=q.hostname=Me.shift())),q.search=B.search,q.query=B.query,b.isNull(q.pathname)&&b.isNull(q.search)||(q.path=(q.pathname?q.pathname:"")+(q.search?q.search:"")),q.href=q.format(),q;if(!$t.length)return q.pathname=null,q.search?q.path="/"+q.search:q.path=null,q.href=q.format(),q;for(var le=$t.slice(-1)[0],Se=(q.host||B.host||$t.length>1)&&(le==="."||le==="..")||le==="",ue=0,Oe=$t.length;Oe>=0;Oe--)(le=$t[Oe])==="."?$t.splice(Oe,1):le===".."?($t.splice(Oe,1),ue++):ue&&($t.splice(Oe,1),ue--);if(!te&&!re)for(;ue--;ue)$t.unshift("..");!te||$t[0]===""||$t[0]&&$t[0].charAt(0)==="/"||$t.unshift(""),Se&&$t.join("/").substr(-1)!=="/"&&$t.push("");var Me,Ge=$t[0]===""||$t[0]&&$t[0].charAt(0)==="/";return pe&&(q.hostname=q.host=Ge?"":$t.length?$t.shift():"",(Me=!!(q.host&&q.host.indexOf("@")>0)&&q.host.split("@"))&&(q.auth=Me.shift(),q.host=q.hostname=Me.shift())),(te=te||q.host&&$t.length)&&!Ge&&$t.unshift(""),$t.length?q.pathname=$t.join("/"):(q.pathname=null,q.path=null),b.isNull(q.pathname)&&b.isNull(q.search)||(q.path=(q.pathname?q.pathname:"")+(q.search?q.search:"")),q.auth=B.auth||q.auth,q.slashes=q.slashes||B.slashes,q.href=q.format(),q},R.prototype.parseHost=function(){var B=this.host,G=S.exec(B);G&&((G=G[0])!==":"&&(this.port=G.substr(1)),B=B.substr(0,B.length-G.length)),B&&(this.hostname=B)}},function(m,y){m.exports=function(d,x){return d===x||d!=d&&x!=x}},function(m,y,d){var x=d(8)(d(3),"Map");m.exports=x},function(m,y,d){var x=d(148),b=d(46),R=Object.prototype.propertyIsEnumerable,T=Object.getOwnPropertySymbols,S=T?function(N){return N==null?[]:(N=Object(N),x(T(N),function(C){return R.call(N,C)}))}:b;m.exports=S},function(m,y,d){var x=d(47),b=d(155),R=d(51);m.exports=function(T){return R(T)?x(T):b(T)}},function(m,y,d){(function(x){var b=d(3),R=d(152),T=y&&!y.nodeType&&y,S=T&&typeof x=="object"&&x&&!x.nodeType&&x,N=S&&S.exports===T?b.Buffer:void 0,C=(N?N.isBuffer:void 0)||R;x.exports=C}).call(this,d(13)(m))},function(m,y){m.exports=function(d){return function(x){return d(x)}}},function(m,y,d){(function(x){var b=d(35),R=y&&!y.nodeType&&y,T=R&&typeof x=="object"&&x&&!x.nodeType&&x,S=T&&T.exports===R&&b.process,N=function(){try{var C=T&&T.require&&T.require("util").types;return C||S&&S.binding&&S.binding("util")}catch{}}();x.exports=N}).call(this,d(13)(m))},function(m,y){var d=Object.prototype;m.exports=function(x){var b=x&&x.constructor;return x===(typeof b=="function"&&b.prototype||d)}},function(m,y,d){var x=d(47),b=d(166),R=d(51);m.exports=function(T){return R(T)?x(T,!0):b(T)}},function(m,y,d){var x=d(42);m.exports=function(b){var R=new b.constructor(b.byteLength);return new x(R).set(new x(b)),R}},function(m,y,d){var x=d(104);m.exports=function(b,R){R=R||{};var T=new x,S=R.inPlace||!1,N=b.map(function(L){return S?L:{width:L.width,height:L.height,item:L}});N=N.sort(function(L,k){return k.width*k.height-L.width*L.height}),T.fit(N);var C={width:N.reduce(function(L,k){return Math.max(L,k.x+k.width)},0),height:N.reduce(function(L,k){return Math.max(L,k.y+k.height)},0)};return S||(C.items=N),C}},function(m,y,d){var x=d(161);m.exports=function(b){return x(b,5)}},function(m,y,d){(function(x){var b=typeof x=="object"&&x&&x.Object===Object&&x;m.exports=b}).call(this,d(11))},function(m,y,d){var x=Object.prototype.hasOwnProperty,b="~";function R(){}function T(L,k,K){this.fn=L,this.context=k,this.once=K||!1}function S(L,k,K,ut,_t){if(typeof K!="function")throw new TypeError("The listener must be a function");var E=new T(K,ut||L,_t),I=b?b+k:k;return L._events[I]?L._events[I].fn?L._events[I]=[L._events[I],E]:L._events[I].push(E):(L._events[I]=E,L._eventsCount++),L}function N(L,k){--L._eventsCount==0?L._events=new R:delete L._events[k]}function C(){this._events=new R,this._eventsCount=0}Object.create&&(R.prototype=Object.create(null),new R().__proto__||(b=!1)),C.prototype.eventNames=function(){var L,k,K=[];if(this._eventsCount===0)return K;for(k in L=this._events)x.call(L,k)&&K.push(b?k.slice(1):k);return Object.getOwnPropertySymbols?K.concat(Object.getOwnPropertySymbols(L)):K},C.prototype.listeners=function(L){var k=b?b+L:L,K=this._events[k];if(!K)return[];if(K.fn)return[K.fn];for(var ut=0,_t=K.length,E=new Array(_t);ut<_t;ut++)E[ut]=K[ut].fn;return E},C.prototype.listenerCount=function(L){var k=b?b+L:L,K=this._events[k];return K?K.fn?1:K.length:0},C.prototype.emit=function(L,k,K,ut,_t,E){var I=b?b+L:L;if(!this._events[I])return!1;var D,F,P=this._events[I],B=arguments.length;if(P.fn){switch(P.once&&this.removeListener(L,P.fn,void 0,!0),B){case 1:return P.fn.call(P.context),!0;case 2:return P.fn.call(P.context,k),!0;case 3:return P.fn.call(P.context,k,K),!0;case 4:return P.fn.call(P.context,k,K,ut),!0;case 5:return P.fn.call(P.context,k,K,ut,_t),!0;case 6:return P.fn.call(P.context,k,K,ut,_t,E),!0}for(F=1,D=new Array(B-1);F<B;F++)D[F-1]=arguments[F];P.fn.apply(P.context,D)}else{var G,q=P.length;for(F=0;F<q;F++)switch(P[F].once&&this.removeListener(L,P[F].fn,void 0,!0),B){case 1:P[F].fn.call(P[F].context);break;case 2:P[F].fn.call(P[F].context,k);break;case 3:P[F].fn.call(P[F].context,k,K);break;case 4:P[F].fn.call(P[F].context,k,K,ut);break;default:if(!D)for(G=1,D=new Array(B-1);G<B;G++)D[G-1]=arguments[G];P[F].fn.apply(P[F].context,D)}}return!0},C.prototype.on=function(L,k,K){return S(this,L,k,K,!1)},C.prototype.once=function(L,k,K){return S(this,L,k,K,!0)},C.prototype.removeListener=function(L,k,K,ut){var _t=b?b+L:L;if(!this._events[_t])return this;if(!k)return N(this,_t),this;var E=this._events[_t];if(E.fn)E.fn!==k||ut&&!E.once||K&&E.context!==K||N(this,_t);else{for(var I=0,D=[],F=E.length;I<F;I++)(E[I].fn!==k||ut&&!E[I].once||K&&E[I].context!==K)&&D.push(E[I]);D.length?this._events[_t]=D.length===1?D[0]:D:N(this,_t)}return this},C.prototype.removeAllListeners=function(L){var k;return L?(k=b?b+L:L,this._events[k]&&N(this,k)):(this._events=new R,this._eventsCount=0),this},C.prototype.off=C.prototype.removeListener,C.prototype.addListener=C.prototype.on,C.prefixed=b,C.EventEmitter=C,m.exports=C},function(m,y,d){function x(w,ot,bt){bt=bt||2;var dt,yt,Ot,kt,Dt,te,re,$t=ot&&ot.length,pe=$t?ot[0]*bt:w.length,le=b(w,0,pe,bt,!0),Se=[];if(!le||le.next===le.prev)return Se;if($t&&(le=function(Oe,Me,Ge,nn){var fe,ge,En,je,rn,wn=[];for(fe=0,ge=Me.length;fe<ge;fe++)En=Me[fe]*nn,je=fe<ge-1?Me[fe+1]*nn:Oe.length,(rn=b(Oe,En,je,nn,!1))===rn.next&&(rn.steiner=!0),wn.push(E(rn));for(wn.sort(k),fe=0;fe<wn.length;fe++)Ge=K(wn[fe],Ge);return Ge}(w,ot,le,bt)),w.length>80*bt){dt=Ot=w[0],yt=kt=w[1];for(var ue=bt;ue<pe;ue+=bt)(Dt=w[ue])<dt&&(dt=Dt),(te=w[ue+1])<yt&&(yt=te),Dt>Ot&&(Ot=Dt),te>kt&&(kt=te);re=(re=Math.max(Ot-dt,kt-yt))!==0?32767/re:0}return T(le,Se,bt,dt,yt,re,0),Se}function b(w,ot,bt,dt,yt){var Ot,kt;if(yt===lt(w,ot,bt,dt)>0)for(Ot=ot;Ot<bt;Ot+=dt)kt=at(Ot,w[Ot],w[Ot+1],kt);else for(Ot=bt-dt;Ot>=ot;Ot-=dt)kt=at(Ot,w[Ot],w[Ot+1],kt);return kt&&P(kt,kt.next)&&($(kt),kt=kt.next),kt}function R(w,ot){if(!w)return w;ot||(ot=w);var bt,dt=w;do if(bt=!1,dt.steiner||!P(dt,dt.next)&&F(dt.prev,dt,dt.next)!==0)dt=dt.next;else{if($(dt),(dt=ot=dt.prev)===dt.next)break;bt=!0}while(bt||dt!==ot);return ot}function T(w,ot,bt,dt,yt,Ot,kt){if(w){!kt&&Ot&&function($t,pe,le,Se){var ue=$t;do ue.z===0&&(ue.z=_t(ue.x,ue.y,pe,le,Se)),ue.prevZ=ue.prev,ue.nextZ=ue.next,ue=ue.next;while(ue!==$t);ue.prevZ.nextZ=null,ue.prevZ=null,function(Oe){var Me,Ge,nn,fe,ge,En,je,rn,wn=1;do{for(Ge=Oe,Oe=null,ge=null,En=0;Ge;){for(En++,nn=Ge,je=0,Me=0;Me<wn&&(je++,nn=nn.nextZ);Me++);for(rn=wn;je>0||rn>0&&nn;)je!==0&&(rn===0||!nn||Ge.z<=nn.z)?(fe=Ge,Ge=Ge.nextZ,je--):(fe=nn,nn=nn.nextZ,rn--),ge?ge.nextZ=fe:Oe=fe,fe.prevZ=ge,ge=fe;Ge=nn}ge.nextZ=null,wn*=2}while(En>1)}(ue)}(w,dt,yt,Ot);for(var Dt,te,re=w;w.prev!==w.next;)if(Dt=w.prev,te=w.next,Ot?N(w,dt,yt,Ot):S(w))ot.push(Dt.i/bt|0),ot.push(w.i/bt|0),ot.push(te.i/bt|0),$(w),w=te.next,re=te.next;else if((w=te)===re){kt?kt===1?T(w=C(R(w),ot,bt),ot,bt,dt,yt,Ot,2):kt===2&&L(w,ot,bt,dt,yt,Ot):T(R(w),ot,bt,dt,yt,Ot,1);break}}}function S(w){var ot=w.prev,bt=w,dt=w.next;if(F(ot,bt,dt)>=0)return!1;for(var yt=ot.x,Ot=bt.x,kt=dt.x,Dt=ot.y,te=bt.y,re=dt.y,$t=yt<Ot?yt<kt?yt:kt:Ot<kt?Ot:kt,pe=Dt<te?Dt<re?Dt:re:te<re?te:re,le=yt>Ot?yt>kt?yt:kt:Ot>kt?Ot:kt,Se=Dt>te?Dt>re?Dt:re:te>re?te:re,ue=dt.next;ue!==ot;){if(ue.x>=$t&&ue.x<=le&&ue.y>=pe&&ue.y<=Se&&I(yt,Dt,Ot,te,kt,re,ue.x,ue.y)&&F(ue.prev,ue,ue.next)>=0)return!1;ue=ue.next}return!0}function N(w,ot,bt,dt){var yt=w.prev,Ot=w,kt=w.next;if(F(yt,Ot,kt)>=0)return!1;for(var Dt=yt.x,te=Ot.x,re=kt.x,$t=yt.y,pe=Ot.y,le=kt.y,Se=Dt<te?Dt<re?Dt:re:te<re?te:re,ue=$t<pe?$t<le?$t:le:pe<le?pe:le,Oe=Dt>te?Dt>re?Dt:re:te>re?te:re,Me=$t>pe?$t>le?$t:le:pe>le?pe:le,Ge=_t(Se,ue,ot,bt,dt),nn=_t(Oe,Me,ot,bt,dt),fe=w.prevZ,ge=w.nextZ;fe&&fe.z>=Ge&&ge&&ge.z<=nn;){if(fe.x>=Se&&fe.x<=Oe&&fe.y>=ue&&fe.y<=Me&&fe!==yt&&fe!==kt&&I(Dt,$t,te,pe,re,le,fe.x,fe.y)&&F(fe.prev,fe,fe.next)>=0||(fe=fe.prevZ,ge.x>=Se&&ge.x<=Oe&&ge.y>=ue&&ge.y<=Me&&ge!==yt&&ge!==kt&&I(Dt,$t,te,pe,re,le,ge.x,ge.y)&&F(ge.prev,ge,ge.next)>=0))return!1;ge=ge.nextZ}for(;fe&&fe.z>=Ge;){if(fe.x>=Se&&fe.x<=Oe&&fe.y>=ue&&fe.y<=Me&&fe!==yt&&fe!==kt&&I(Dt,$t,te,pe,re,le,fe.x,fe.y)&&F(fe.prev,fe,fe.next)>=0)return!1;fe=fe.prevZ}for(;ge&&ge.z<=nn;){if(ge.x>=Se&&ge.x<=Oe&&ge.y>=ue&&ge.y<=Me&&ge!==yt&&ge!==kt&&I(Dt,$t,te,pe,re,le,ge.x,ge.y)&&F(ge.prev,ge,ge.next)>=0)return!1;ge=ge.nextZ}return!0}function C(w,ot,bt){var dt=w;do{var yt=dt.prev,Ot=dt.next.next;!P(yt,Ot)&&B(yt,dt,dt.next,Ot)&&Rt(yt,Ot)&&Rt(Ot,yt)&&(ot.push(yt.i/bt|0),ot.push(dt.i/bt|0),ot.push(Ot.i/bt|0),$(dt),$(dt.next),dt=w=Ot),dt=dt.next}while(dt!==w);return R(dt)}function L(w,ot,bt,dt,yt,Ot){var kt=w;do{for(var Dt=kt.next.next;Dt!==kt.prev;){if(kt.i!==Dt.i&&D(kt,Dt)){var te=Xt(kt,Dt);return kt=R(kt,kt.next),te=R(te,te.next),T(kt,ot,bt,dt,yt,Ot,0),void T(te,ot,bt,dt,yt,Ot,0)}Dt=Dt.next}kt=kt.next}while(kt!==w)}function k(w,ot){return w.x-ot.x}function K(w,ot){var bt=function(yt,Ot){var kt,Dt=Ot,te=yt.x,re=yt.y,$t=-1/0;do{if(re<=Dt.y&&re>=Dt.next.y&&Dt.next.y!==Dt.y){var pe=Dt.x+(re-Dt.y)*(Dt.next.x-Dt.x)/(Dt.next.y-Dt.y);if(pe<=te&&pe>$t&&($t=pe,kt=Dt.x<Dt.next.x?Dt:Dt.next,pe===te))return kt}Dt=Dt.next}while(Dt!==Ot);if(!kt)return null;var le,Se=kt,ue=kt.x,Oe=kt.y,Me=1/0;Dt=kt;do te>=Dt.x&&Dt.x>=ue&&te!==Dt.x&&I(re<Oe?te:$t,re,ue,Oe,re<Oe?$t:te,re,Dt.x,Dt.y)&&(le=Math.abs(re-Dt.y)/(te-Dt.x),Rt(Dt,yt)&&(le<Me||le===Me&&(Dt.x>kt.x||Dt.x===kt.x&&ut(kt,Dt)))&&(kt=Dt,Me=le)),Dt=Dt.next;while(Dt!==Se);return kt}(w,ot);if(!bt)return ot;var dt=Xt(bt,w);return R(dt,dt.next),R(bt,bt.next)}function ut(w,ot){return F(w.prev,w,ot.prev)<0&&F(ot.next,w,w.next)<0}function _t(w,ot,bt,dt,yt){return(w=1431655765&((w=858993459&((w=252645135&((w=16711935&((w=(w-bt)*yt|0)|w<<8))|w<<4))|w<<2))|w<<1))|(ot=1431655765&((ot=858993459&((ot=252645135&((ot=16711935&((ot=(ot-dt)*yt|0)|ot<<8))|ot<<4))|ot<<2))|ot<<1))<<1}function E(w){var ot=w,bt=w;do(ot.x<bt.x||ot.x===bt.x&&ot.y<bt.y)&&(bt=ot),ot=ot.next;while(ot!==w);return bt}function I(w,ot,bt,dt,yt,Ot,kt,Dt){return(yt-kt)*(ot-Dt)>=(w-kt)*(Ot-Dt)&&(w-kt)*(dt-Dt)>=(bt-kt)*(ot-Dt)&&(bt-kt)*(Ot-Dt)>=(yt-kt)*(dt-Dt)}function D(w,ot){return w.next.i!==ot.i&&w.prev.i!==ot.i&&!function(bt,dt){var yt=bt;do{if(yt.i!==bt.i&&yt.next.i!==bt.i&&yt.i!==dt.i&&yt.next.i!==dt.i&&B(yt,yt.next,bt,dt))return!0;yt=yt.next}while(yt!==bt);return!1}(w,ot)&&(Rt(w,ot)&&Rt(ot,w)&&function(bt,dt){var yt=bt,Ot=!1,kt=(bt.x+dt.x)/2,Dt=(bt.y+dt.y)/2;do yt.y>Dt!=yt.next.y>Dt&&yt.next.y!==yt.y&&kt<(yt.next.x-yt.x)*(Dt-yt.y)/(yt.next.y-yt.y)+yt.x&&(Ot=!Ot),yt=yt.next;while(yt!==bt);return Ot}(w,ot)&&(F(w.prev,w,ot.prev)||F(w,ot.prev,ot))||P(w,ot)&&F(w.prev,w,w.next)>0&&F(ot.prev,ot,ot.next)>0)}function F(w,ot,bt){return(ot.y-w.y)*(bt.x-ot.x)-(ot.x-w.x)*(bt.y-ot.y)}function P(w,ot){return w.x===ot.x&&w.y===ot.y}function B(w,ot,bt,dt){var yt=q(F(w,ot,bt)),Ot=q(F(w,ot,dt)),kt=q(F(bt,dt,w)),Dt=q(F(bt,dt,ot));return yt!==Ot&&kt!==Dt||!(yt!==0||!G(w,bt,ot))||!(Ot!==0||!G(w,dt,ot))||!(kt!==0||!G(bt,w,dt))||!(Dt!==0||!G(bt,ot,dt))}function G(w,ot,bt){return ot.x<=Math.max(w.x,bt.x)&&ot.x>=Math.min(w.x,bt.x)&&ot.y<=Math.max(w.y,bt.y)&&ot.y>=Math.min(w.y,bt.y)}function q(w){return w>0?1:w<0?-1:0}function Rt(w,ot){return F(w.prev,w,w.next)<0?F(w,ot,w.next)>=0&&F(w,w.prev,ot)>=0:F(w,ot,w.prev)<0||F(w,w.next,ot)<0}function Xt(w,ot){var bt=new tt(w.i,w.x,w.y),dt=new tt(ot.i,ot.x,ot.y),yt=w.next,Ot=ot.prev;return w.next=ot,ot.prev=w,bt.next=yt,yt.prev=bt,dt.next=bt,bt.prev=dt,Ot.next=dt,dt.prev=Ot,dt}function at(w,ot,bt,dt){var yt=new tt(w,ot,bt);return dt?(yt.next=dt.next,yt.prev=dt,dt.next.prev=yt,dt.next=yt):(yt.prev=yt,yt.next=yt),yt}function $(w){w.next.prev=w.prev,w.prev.next=w.next,w.prevZ&&(w.prevZ.nextZ=w.nextZ),w.nextZ&&(w.nextZ.prevZ=w.prevZ)}function tt(w,ot,bt){this.i=w,this.x=ot,this.y=bt,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function lt(w,ot,bt,dt){for(var yt=0,Ot=ot,kt=bt-dt;Ot<bt;Ot+=dt)yt+=(w[kt]-w[Ot])*(w[Ot+1]+w[kt+1]),kt=Ot;return yt}m.exports=x,m.exports.default=x,x.deviation=function(w,ot,bt,dt){var yt=ot&&ot.length,Ot=yt?ot[0]*bt:w.length,kt=Math.abs(lt(w,0,Ot,bt));if(yt)for(var Dt=0,te=ot.length;Dt<te;Dt++){var re=ot[Dt]*bt,$t=Dt<te-1?ot[Dt+1]*bt:w.length;kt-=Math.abs(lt(w,re,$t,bt))}var pe=0;for(Dt=0;Dt<dt.length;Dt+=3){var le=dt[Dt]*bt,Se=dt[Dt+1]*bt,ue=dt[Dt+2]*bt;pe+=Math.abs((w[le]-w[ue])*(w[Se+1]-w[le+1])-(w[le]-w[Se])*(w[ue+1]-w[le+1]))}return kt===0&&pe===0?0:Math.abs((pe-kt)/kt)},x.flatten=function(w){for(var ot=w[0][0].length,bt={vertices:[],holes:[],dimensions:ot},dt=0,yt=0;yt<w.length;yt++){for(var Ot=0;Ot<w[yt].length;Ot++)for(var kt=0;kt<ot;kt++)bt.vertices.push(w[yt][Ot][kt]);yt>0&&(dt+=w[yt-1].length,bt.holes.push(dt))}return bt}},function(m,y,d){var x=d(14),b=d(118),R=d(119),T=d(120),S=d(121),N=d(122);function C(L){var k=this.__data__=new x(L);this.size=k.size}C.prototype.clear=b,C.prototype.delete=R,C.prototype.get=T,C.prototype.has=S,C.prototype.set=N,m.exports=C},function(m,y){var d=Function.prototype.toString;m.exports=function(x){if(x!=null){try{return d.call(x)}catch{}try{return x+""}catch{}}return""}},function(m,y,d){var x=d(127),b=d(134),R=d(136),T=d(137),S=d(138);function N(C){var L=-1,k=C==null?0:C.length;for(this.clear();++L<k;){var K=C[L];this.set(K[0],K[1])}}N.prototype.clear=x,N.prototype.delete=b,N.prototype.get=R,N.prototype.has=T,N.prototype.set=S,m.exports=N},function(m,y,d){var x=d(139),b=d(142),R=d(143);m.exports=function(T,S,N,C,L,k){var K=1&N,ut=T.length,_t=S.length;if(ut!=_t&&!(K&&_t>ut))return!1;var E=k.get(T),I=k.get(S);if(E&&I)return E==S&&I==T;var D=-1,F=!0,P=2&N?new x:void 0;for(k.set(T,S),k.set(S,T);++D<ut;){var B=T[D],G=S[D];if(C)var q=K?C(G,B,D,S,T,k):C(B,G,D,T,S,k);if(q!==void 0){if(q)continue;F=!1;break}if(P){if(!b(S,function(Rt,Xt){if(!R(P,Xt)&&(B===Rt||L(B,Rt,N,C,k)))return P.push(Xt)})){F=!1;break}}else if(B!==G&&!L(B,G,N,C,k)){F=!1;break}}return k.delete(T),k.delete(S),F}},function(m,y,d){var x=d(3).Uint8Array;m.exports=x},function(m,y,d){var x=d(44),b=d(25),R=d(26);m.exports=function(T){return x(T,R,b)}},function(m,y,d){var x=d(45),b=d(18);m.exports=function(R,T,S){var N=T(R);return b(R)?N:x(N,S(R))}},function(m,y){m.exports=function(d,x){for(var b=-1,R=x.length,T=d.length;++b<R;)d[T+b]=x[b];return d}},function(m,y){m.exports=function(){return[]}},function(m,y,d){var x=d(149),b=d(150),R=d(18),T=d(27),S=d(153),N=d(48),C=Object.prototype.hasOwnProperty;m.exports=function(L,k){var K=R(L),ut=!K&&b(L),_t=!K&&!ut&&T(L),E=!K&&!ut&&!_t&&N(L),I=K||ut||_t||E,D=I?x(L.length,String):[],F=D.length;for(var P in L)!k&&!C.call(L,P)||I&&(P=="length"||_t&&(P=="offset"||P=="parent")||E&&(P=="buffer"||P=="byteLength"||P=="byteOffset")||S(P,F))||D.push(P);return D}},function(m,y,d){var x=d(154),b=d(28),R=d(29),T=R&&R.isTypedArray,S=T?b(T):x;m.exports=S},function(m,y){m.exports=function(d){return typeof d=="number"&&d>-1&&d%1==0&&d<=9007199254740991}},function(m,y){m.exports=function(d,x){return function(b){return d(x(b))}}},function(m,y,d){var x=d(21),b=d(49);m.exports=function(R){return R!=null&&b(R.length)&&!x(R)}},function(m,y,d){var x=d(53),b=d(23),R=Object.prototype.hasOwnProperty;m.exports=function(T,S,N){var C=T[S];R.call(T,S)&&b(C,N)&&(N!==void 0||S in T)||x(T,S,N)}},function(m,y,d){var x=d(163);m.exports=function(b,R,T){R=="__proto__"&&x?x(b,R,{configurable:!0,enumerable:!0,value:T,writable:!0}):b[R]=T}},function(m,y,d){var x=d(45),b=d(55),R=d(25),T=d(46),S=Object.getOwnPropertySymbols?function(N){for(var C=[];N;)x(C,R(N)),N=b(N);return C}:T;m.exports=S},function(m,y,d){var x=d(50)(Object.getPrototypeOf,Object);m.exports=x},function(m,y){m.exports=`varying vec2 vUv;
|
|
1
|
+
"use strict";var OS=Object.defineProperty,DS=Object.defineProperties;var FS=Object.getOwnPropertyDescriptors;var t_=Object.getOwnPropertySymbols;var kS=Object.prototype.hasOwnProperty,US=Object.prototype.propertyIsEnumerable;var e_=(m,y,d)=>y in m?OS(m,y,{enumerable:!0,configurable:!0,writable:!0,value:d}):m[y]=d,Vu=(m,y)=>{for(var d in y||(y={}))kS.call(y,d)&&e_(m,d,y[d]);if(t_)for(var d of t_(y))US.call(y,d)&&e_(m,d,y[d]);return m},n_=(m,y)=>DS(m,FS(y));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var Ze=function(m){var y={};function d(x){if(y[x])return y[x].exports;var b=y[x]={i:x,l:!1,exports:{}};return m[x].call(b.exports,b,b.exports,d),b.l=!0,b.exports}return d.m=m,d.c=y,d.d=function(x,b,C){d.o(x,b)||Object.defineProperty(x,b,{enumerable:!0,get:C})},d.r=function(x){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(x,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(x,"__esModule",{value:!0})},d.t=function(x,b){if(1&b&&(x=d(x)),8&b||4&b&&typeof x=="object"&&x&&x.__esModule)return x;var C=Object.create(null);if(d.r(C),Object.defineProperty(C,"default",{enumerable:!0,value:x}),2&b&&typeof x!="string")for(var T in x)d.d(C,T,function(S){return x[S]}.bind(null,T));return C},d.n=function(x){var b=x&&x.__esModule?function(){return x.default}:function(){return x};return d.d(b,"a",b),b},d.o=function(x,b){return Object.prototype.hasOwnProperty.call(x,b)},d.p="",d(d.s=185)}([function(m,y,d){var x=Object.prototype.hasOwnProperty,b="~";function C(){}function T(L,k,K){this.fn=L,this.context=k,this.once=K||!1}function S(L,k,K,ut,_t){if(typeof K!="function")throw new TypeError("The listener must be a function");var E=new T(K,ut||L,_t),R=b?b+k:k;return L._events[R]?L._events[R].fn?L._events[R]=[L._events[R],E]:L._events[R].push(E):(L._events[R]=E,L._eventsCount++),L}function N(L,k){--L._eventsCount==0?L._events=new C:delete L._events[k]}function I(){this._events=new C,this._eventsCount=0}Object.create&&(C.prototype=Object.create(null),new C().__proto__||(b=!1)),I.prototype.eventNames=function(){var L,k,K=[];if(this._eventsCount===0)return K;for(k in L=this._events)x.call(L,k)&&K.push(b?k.slice(1):k);return Object.getOwnPropertySymbols?K.concat(Object.getOwnPropertySymbols(L)):K},I.prototype.listeners=function(L){var k=b?b+L:L,K=this._events[k];if(!K)return[];if(K.fn)return[K.fn];for(var ut=0,_t=K.length,E=new Array(_t);ut<_t;ut++)E[ut]=K[ut].fn;return E},I.prototype.listenerCount=function(L){var k=b?b+L:L,K=this._events[k];return K?K.fn?1:K.length:0},I.prototype.emit=function(L,k,K,ut,_t,E){var R=b?b+L:L;if(!this._events[R])return!1;var D,F,P=this._events[R],B=arguments.length;if(P.fn){switch(P.once&&this.removeListener(L,P.fn,void 0,!0),B){case 1:return P.fn.call(P.context),!0;case 2:return P.fn.call(P.context,k),!0;case 3:return P.fn.call(P.context,k,K),!0;case 4:return P.fn.call(P.context,k,K,ut),!0;case 5:return P.fn.call(P.context,k,K,ut,_t),!0;case 6:return P.fn.call(P.context,k,K,ut,_t,E),!0}for(F=1,D=new Array(B-1);F<B;F++)D[F-1]=arguments[F];P.fn.apply(P.context,D)}else{var G,q=P.length;for(F=0;F<q;F++)switch(P[F].once&&this.removeListener(L,P[F].fn,void 0,!0),B){case 1:P[F].fn.call(P[F].context);break;case 2:P[F].fn.call(P[F].context,k);break;case 3:P[F].fn.call(P[F].context,k,K);break;case 4:P[F].fn.call(P[F].context,k,K,ut);break;default:if(!D)for(G=1,D=new Array(B-1);G<B;G++)D[G-1]=arguments[G];P[F].fn.apply(P[F].context,D)}}return!0},I.prototype.on=function(L,k,K){return S(this,L,k,K,!1)},I.prototype.once=function(L,k,K){return S(this,L,k,K,!0)},I.prototype.removeListener=function(L,k,K,ut){var _t=b?b+L:L;if(!this._events[_t])return this;if(!k)return N(this,_t),this;var E=this._events[_t];if(E.fn)E.fn!==k||ut&&!E.once||K&&E.context!==K||N(this,_t);else{for(var R=0,D=[],F=E.length;R<F;R++)(E[R].fn!==k||ut&&!E[R].once||K&&E[R].context!==K)&&D.push(E[R]);D.length?this._events[_t]=D.length===1?D[0]:D:N(this,_t)}return this},I.prototype.removeAllListeners=function(L){var k;return L?(k=b?b+L:L,this._events[k]&&N(this,k)):(this._events=new C,this._eventsCount=0),this},I.prototype.off=I.prototype.removeListener,I.prototype.addListener=I.prototype.on,I.prefixed=b,I.EventEmitter=I,m.exports=I},function(m,y){m.exports=function(d){return d===void 0}},function(m,y,d){var x=d(6),b=d(4);m.exports=function(C){return typeof C=="number"||b(C)&&x(C)=="[object Number]"}},function(m,y,d){var x=d(35),b=typeof self=="object"&&self&&self.Object===Object&&self,C=x||b||Function("return this")();m.exports=C},function(m,y){m.exports=function(d){return d!=null&&typeof d=="object"}},function(m,y,d){var x;(function(b){function C(P,B){var G=(65535&P)+(65535&B);return(P>>16)+(B>>16)+(G>>16)<<16|65535&G}function T(P,B,G,q,Rt,Xt){return C((at=C(C(B,P),C(q,Xt)))<<($=Rt)|at>>>32-$,G);var at,$}function S(P,B,G,q,Rt,Xt,at){return T(B&G|~B&q,P,B,Rt,Xt,at)}function N(P,B,G,q,Rt,Xt,at){return T(B&q|G&~q,P,B,Rt,Xt,at)}function I(P,B,G,q,Rt,Xt,at){return T(B^G^q,P,B,Rt,Xt,at)}function L(P,B,G,q,Rt,Xt,at){return T(G^(B|~q),P,B,Rt,Xt,at)}function k(P,B){var G,q,Rt,Xt,at;P[B>>5]|=128<<B%32,P[14+(B+64>>>9<<4)]=B;var $=1732584193,tt=-271733879,lt=-1732584194,w=271733878;for(G=0;G<P.length;G+=16)q=$,Rt=tt,Xt=lt,at=w,$=S($,tt,lt,w,P[G],7,-680876936),w=S(w,$,tt,lt,P[G+1],12,-389564586),lt=S(lt,w,$,tt,P[G+2],17,606105819),tt=S(tt,lt,w,$,P[G+3],22,-1044525330),$=S($,tt,lt,w,P[G+4],7,-176418897),w=S(w,$,tt,lt,P[G+5],12,1200080426),lt=S(lt,w,$,tt,P[G+6],17,-1473231341),tt=S(tt,lt,w,$,P[G+7],22,-45705983),$=S($,tt,lt,w,P[G+8],7,1770035416),w=S(w,$,tt,lt,P[G+9],12,-1958414417),lt=S(lt,w,$,tt,P[G+10],17,-42063),tt=S(tt,lt,w,$,P[G+11],22,-1990404162),$=S($,tt,lt,w,P[G+12],7,1804603682),w=S(w,$,tt,lt,P[G+13],12,-40341101),lt=S(lt,w,$,tt,P[G+14],17,-1502002290),$=N($,tt=S(tt,lt,w,$,P[G+15],22,1236535329),lt,w,P[G+1],5,-165796510),w=N(w,$,tt,lt,P[G+6],9,-1069501632),lt=N(lt,w,$,tt,P[G+11],14,643717713),tt=N(tt,lt,w,$,P[G],20,-373897302),$=N($,tt,lt,w,P[G+5],5,-701558691),w=N(w,$,tt,lt,P[G+10],9,38016083),lt=N(lt,w,$,tt,P[G+15],14,-660478335),tt=N(tt,lt,w,$,P[G+4],20,-405537848),$=N($,tt,lt,w,P[G+9],5,568446438),w=N(w,$,tt,lt,P[G+14],9,-1019803690),lt=N(lt,w,$,tt,P[G+3],14,-187363961),tt=N(tt,lt,w,$,P[G+8],20,1163531501),$=N($,tt,lt,w,P[G+13],5,-1444681467),w=N(w,$,tt,lt,P[G+2],9,-51403784),lt=N(lt,w,$,tt,P[G+7],14,1735328473),$=I($,tt=N(tt,lt,w,$,P[G+12],20,-1926607734),lt,w,P[G+5],4,-378558),w=I(w,$,tt,lt,P[G+8],11,-2022574463),lt=I(lt,w,$,tt,P[G+11],16,1839030562),tt=I(tt,lt,w,$,P[G+14],23,-35309556),$=I($,tt,lt,w,P[G+1],4,-1530992060),w=I(w,$,tt,lt,P[G+4],11,1272893353),lt=I(lt,w,$,tt,P[G+7],16,-155497632),tt=I(tt,lt,w,$,P[G+10],23,-1094730640),$=I($,tt,lt,w,P[G+13],4,681279174),w=I(w,$,tt,lt,P[G],11,-358537222),lt=I(lt,w,$,tt,P[G+3],16,-722521979),tt=I(tt,lt,w,$,P[G+6],23,76029189),$=I($,tt,lt,w,P[G+9],4,-640364487),w=I(w,$,tt,lt,P[G+12],11,-421815835),lt=I(lt,w,$,tt,P[G+15],16,530742520),$=L($,tt=I(tt,lt,w,$,P[G+2],23,-995338651),lt,w,P[G],6,-198630844),w=L(w,$,tt,lt,P[G+7],10,1126891415),lt=L(lt,w,$,tt,P[G+14],15,-1416354905),tt=L(tt,lt,w,$,P[G+5],21,-57434055),$=L($,tt,lt,w,P[G+12],6,1700485571),w=L(w,$,tt,lt,P[G+3],10,-1894986606),lt=L(lt,w,$,tt,P[G+10],15,-1051523),tt=L(tt,lt,w,$,P[G+1],21,-2054922799),$=L($,tt,lt,w,P[G+8],6,1873313359),w=L(w,$,tt,lt,P[G+15],10,-30611744),lt=L(lt,w,$,tt,P[G+6],15,-1560198380),tt=L(tt,lt,w,$,P[G+13],21,1309151649),$=L($,tt,lt,w,P[G+4],6,-145523070),w=L(w,$,tt,lt,P[G+11],10,-1120210379),lt=L(lt,w,$,tt,P[G+2],15,718787259),tt=L(tt,lt,w,$,P[G+9],21,-343485551),$=C($,q),tt=C(tt,Rt),lt=C(lt,Xt),w=C(w,at);return[$,tt,lt,w]}function K(P){var B,G="",q=32*P.length;for(B=0;B<q;B+=8)G+=String.fromCharCode(P[B>>5]>>>B%32&255);return G}function ut(P){var B,G=[];for(G[(P.length>>2)-1]=void 0,B=0;B<G.length;B+=1)G[B]=0;var q=8*P.length;for(B=0;B<q;B+=8)G[B>>5]|=(255&P.charCodeAt(B/8))<<B%32;return G}function _t(P){var B,G,q="";for(G=0;G<P.length;G+=1)B=P.charCodeAt(G),q+="0123456789abcdef".charAt(B>>>4&15)+"0123456789abcdef".charAt(15&B);return q}function E(P){return unescape(encodeURIComponent(P))}function R(P){return function(B){return K(k(ut(B),8*B.length))}(E(P))}function D(P,B){return function(G,q){var Rt,Xt,at=ut(G),$=[],tt=[];for($[15]=tt[15]=void 0,at.length>16&&(at=k(at,8*G.length)),Rt=0;Rt<16;Rt+=1)$[Rt]=909522486^at[Rt],tt[Rt]=1549556828^at[Rt];return Xt=k($.concat(ut(q)),512+8*q.length),K(k(tt.concat(Xt),640))}(E(P),E(B))}function F(P,B,G){return B?G?D(B,P):_t(D(B,P)):G?R(P):_t(R(P))}(x=function(){return F}.call(y,d,y,m))===void 0||(m.exports=x)})()},function(m,y,d){var x=d(12),b=d(97),C=d(98),T=x?x.toStringTag:void 0;m.exports=function(S){return S==null?S===void 0?"[object Undefined]":"[object Null]":T&&T in Object(S)?b(S):C(S)}},function(m,y){m.exports=function(d){var x=typeof d;return d!=null&&(x=="object"||x=="function")}},function(m,y,d){var x=d(123),b=d(126);m.exports=function(C,T){var S=b(C,T);return x(S)?S:void 0}},function(m,y,d){(function(x){m.exports=function b(C,T,S){function N(k,K){if(!T[k]){if(!C[k]){if(I)return I(k,!0);var ut=new Error("Cannot find module '"+k+"'");throw ut.code="MODULE_NOT_FOUND",ut}var _t=T[k]={exports:{}};C[k][0].call(_t.exports,function(E){var R=C[k][1][E];return N(R||E)},_t,_t.exports,b,C,T,S)}return T[k].exports}for(var I=!1,L=0;L<S.length;L++)N(S[L]);return N}({1:[function(b,C,T){(function(S){var N,I,L=S.MutationObserver||S.WebKitMutationObserver;if(L){var k=0,K=new L(R),ut=S.document.createTextNode("");K.observe(ut,{characterData:!0}),N=function(){ut.data=k=++k%2}}else if(S.setImmediate||S.MessageChannel===void 0)N="document"in S&&"onreadystatechange"in S.document.createElement("script")?function(){var D=S.document.createElement("script");D.onreadystatechange=function(){R(),D.onreadystatechange=null,D.parentNode.removeChild(D),D=null},S.document.documentElement.appendChild(D)}:function(){setTimeout(R,0)};else{var _t=new S.MessageChannel;_t.port1.onmessage=R,N=function(){_t.port2.postMessage(0)}}var E=[];function R(){var D,F;I=!0;for(var P=E.length;P;){for(F=E,E=[],D=-1;++D<P;)F[D]();P=E.length}I=!1}C.exports=function(D){E.push(D)!==1||I||N()}}).call(this,x!==void 0?x:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(b,C,T){var S=b(1);function N(){}var I={},L=["REJECTED"],k=["FULFILLED"],K=["PENDING"];function ut(P){if(typeof P!="function")throw new TypeError("resolver must be a function");this.state=K,this.queue=[],this.outcome=void 0,P!==N&&D(this,P)}function _t(P,B,G){this.promise=P,typeof B=="function"&&(this.onFulfilled=B,this.callFulfilled=this.otherCallFulfilled),typeof G=="function"&&(this.onRejected=G,this.callRejected=this.otherCallRejected)}function E(P,B,G){S(function(){var q;try{q=B(G)}catch(Rt){return I.reject(P,Rt)}q===P?I.reject(P,new TypeError("Cannot resolve promise with itself")):I.resolve(P,q)})}function R(P){var B=P&&P.then;if(P&&(typeof P=="object"||typeof P=="function")&&typeof B=="function")return function(){B.apply(P,arguments)}}function D(P,B){var G=!1;function q(at){G||(G=!0,I.reject(P,at))}function Rt(at){G||(G=!0,I.resolve(P,at))}var Xt=F(function(){B(Rt,q)});Xt.status==="error"&&q(Xt.value)}function F(P,B){var G={};try{G.value=P(B),G.status="success"}catch(q){G.status="error",G.value=q}return G}C.exports=ut,ut.prototype.catch=function(P){return this.then(null,P)},ut.prototype.then=function(P,B){if(typeof P!="function"&&this.state===k||typeof B!="function"&&this.state===L)return this;var G=new this.constructor(N);return this.state!==K?E(G,this.state===k?P:B,this.outcome):this.queue.push(new _t(G,P,B)),G},_t.prototype.callFulfilled=function(P){I.resolve(this.promise,P)},_t.prototype.otherCallFulfilled=function(P){E(this.promise,this.onFulfilled,P)},_t.prototype.callRejected=function(P){I.reject(this.promise,P)},_t.prototype.otherCallRejected=function(P){E(this.promise,this.onRejected,P)},I.resolve=function(P,B){var G=F(R,B);if(G.status==="error")return I.reject(P,G.value);var q=G.value;if(q)D(P,q);else{P.state=k,P.outcome=B;for(var Rt=-1,Xt=P.queue.length;++Rt<Xt;)P.queue[Rt].callFulfilled(B)}return P},I.reject=function(P,B){P.state=L,P.outcome=B;for(var G=-1,q=P.queue.length;++G<q;)P.queue[G].callRejected(B);return P},ut.resolve=function(P){return P instanceof this?P:I.resolve(new this(N),P)},ut.reject=function(P){var B=new this(N);return I.reject(B,P)},ut.all=function(P){var B=this;if(Object.prototype.toString.call(P)!=="[object Array]")return this.reject(new TypeError("must be an array"));var G=P.length,q=!1;if(!G)return this.resolve([]);for(var Rt=new Array(G),Xt=0,at=-1,$=new this(N);++at<G;)tt(P[at],at);return $;function tt(lt,w){B.resolve(lt).then(function(ot){Rt[w]=ot,++Xt!==G||q||(q=!0,I.resolve($,Rt))},function(ot){q||(q=!0,I.reject($,ot))})}},ut.race=function(P){var B=this;if(Object.prototype.toString.call(P)!=="[object Array]")return this.reject(new TypeError("must be an array"));var G=P.length,q=!1;if(!G)return this.resolve([]);for(var Rt,Xt=-1,at=new this(N);++Xt<G;)Rt=P[Xt],B.resolve(Rt).then(function($){q||(q=!0,I.resolve(at,$))},function($){q||(q=!0,I.reject(at,$))});return at}},{1:1}],3:[function(b,C,T){(function(S){typeof S.Promise!="function"&&(S.Promise=b(2))}).call(this,x!==void 0?x:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{2:2}],4:[function(b,C,T){var S=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(z){return typeof z}:function(z){return z&&typeof Symbol=="function"&&z.constructor===Symbol&&z!==Symbol.prototype?"symbol":typeof z},N=function(){try{if(typeof indexedDB!="undefined")return indexedDB;if(typeof webkitIndexedDB!="undefined")return webkitIndexedDB;if(typeof mozIndexedDB!="undefined")return mozIndexedDB;if(typeof OIndexedDB!="undefined")return OIndexedDB;if(typeof msIndexedDB!="undefined")return msIndexedDB}catch{return}}();function I(z,W){z=z||[],W=W||{};try{return new Blob(z,W)}catch(mt){if(mt.name!=="TypeError")throw mt;for(var Z=new(typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder),ft=0;ft<z.length;ft+=1)Z.append(z[ft]);return Z.getBlob(W.type)}}typeof Promise=="undefined"&&b(3);var L=Promise;function k(z,W){W&&z.then(function(Z){W(null,Z)},function(Z){W(Z)})}function K(z,W,Z){typeof W=="function"&&z.then(W),typeof Z=="function"&&z.catch(Z)}function ut(z){return typeof z!="string"&&(console.warn(z+" used as a key, but it is not a string."),z=String(z)),z}function _t(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var E=void 0,R={},D=Object.prototype.toString;function F(z){return typeof E=="boolean"?L.resolve(E):function(W){return new L(function(Z){var ft=W.transaction("local-forage-detect-blob-support","readwrite"),mt=I([""]);ft.objectStore("local-forage-detect-blob-support").put(mt,"key"),ft.onabort=function(vt){vt.preventDefault(),vt.stopPropagation(),Z(!1)},ft.oncomplete=function(){var vt=navigator.userAgent.match(/Chrome\/(\d+)/),Ct=navigator.userAgent.match(/Edge\//);Z(Ct||!vt||parseInt(vt[1],10)>=43)}}).catch(function(){return!1})}(z).then(function(W){return E=W})}function P(z){var W=R[z.name],Z={};Z.promise=new L(function(ft,mt){Z.resolve=ft,Z.reject=mt}),W.deferredOperations.push(Z),W.dbReady?W.dbReady=W.dbReady.then(function(){return Z.promise}):W.dbReady=Z.promise}function B(z){var W=R[z.name].deferredOperations.pop();if(W)return W.resolve(),W.promise}function G(z,W){var Z=R[z.name].deferredOperations.pop();if(Z)return Z.reject(W),Z.promise}function q(z,W){return new L(function(Z,ft){if(R[z.name]=R[z.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},z.db){if(!W)return Z(z.db);P(z),z.db.close()}var mt=[z.name];W&&mt.push(z.version);var vt=N.open.apply(N,mt);W&&(vt.onupgradeneeded=function(Ct){var zt=vt.result;try{zt.createObjectStore(z.storeName),Ct.oldVersion<=1&&zt.createObjectStore("local-forage-detect-blob-support")}catch(Ht){if(Ht.name!=="ConstraintError")throw Ht;console.warn('The database "'+z.name+'" has been upgraded from version '+Ct.oldVersion+" to version "+Ct.newVersion+', but the storage "'+z.storeName+'" already exists.')}}),vt.onerror=function(Ct){Ct.preventDefault(),ft(vt.error)},vt.onsuccess=function(){var Ct=vt.result;Ct.onversionchange=function(zt){zt.target.close()},Z(Ct),B(z)}})}function Rt(z){return q(z,!1)}function Xt(z){return q(z,!0)}function at(z,W){if(!z.db)return!0;var Z=!z.db.objectStoreNames.contains(z.storeName),ft=z.version<z.db.version,mt=z.version>z.db.version;if(ft&&(z.version!==W&&console.warn('The database "'+z.name+`" can't be downgraded from version `+z.db.version+" to version "+z.version+"."),z.version=z.db.version),mt||Z){if(Z){var vt=z.db.version+1;vt>z.version&&(z.version=vt)}return!0}return!1}function $(z){return I([function(W){for(var Z=W.length,ft=new ArrayBuffer(Z),mt=new Uint8Array(ft),vt=0;vt<Z;vt++)mt[vt]=W.charCodeAt(vt);return ft}(atob(z.data))],{type:z.type})}function tt(z){return z&&z.__local_forage_encoded_blob}function lt(z){var W=this,Z=W._initReady().then(function(){var ft=R[W._dbInfo.name];if(ft&&ft.dbReady)return ft.dbReady});return K(Z,z,z),Z}function w(z,W,Z,ft){ft===void 0&&(ft=1);try{var mt=z.db.transaction(z.storeName,W);Z(null,mt)}catch(vt){if(ft>0&&(!z.db||vt.name==="InvalidStateError"||vt.name==="NotFoundError"))return L.resolve().then(function(){if(!z.db||vt.name==="NotFoundError"&&!z.db.objectStoreNames.contains(z.storeName)&&z.version<=z.db.version)return z.db&&(z.version=z.db.version+1),Xt(z)}).then(function(){return function(Ct){P(Ct);for(var zt=R[Ct.name],Ht=zt.forages,Wt=0;Wt<Ht.length;Wt++){var ne=Ht[Wt];ne._dbInfo.db&&(ne._dbInfo.db.close(),ne._dbInfo.db=null)}return Ct.db=null,Rt(Ct).then(function(oe){return Ct.db=oe,at(Ct)?Xt(Ct):oe}).then(function(oe){Ct.db=zt.db=oe;for(var ye=0;ye<Ht.length;ye++)Ht[ye]._dbInfo.db=oe}).catch(function(oe){throw G(Ct,oe),oe})}(z).then(function(){w(z,W,Z,ft-1)})}).catch(Z);Z(vt)}}var ot={_driver:"asyncStorage",_initStorage:function(z){var W=this,Z={db:null};if(z)for(var ft in z)Z[ft]=z[ft];var mt=R[Z.name];mt||(mt={forages:[],db:null,dbReady:null,deferredOperations:[]},R[Z.name]=mt),mt.forages.push(W),W._initReady||(W._initReady=W.ready,W.ready=lt);var vt=[];function Ct(){return L.resolve()}for(var zt=0;zt<mt.forages.length;zt++){var Ht=mt.forages[zt];Ht!==W&&vt.push(Ht._initReady().catch(Ct))}var Wt=mt.forages.slice(0);return L.all(vt).then(function(){return Z.db=mt.db,Rt(Z)}).then(function(ne){return Z.db=ne,at(Z,W._defaultConfig.version)?Xt(Z):ne}).then(function(ne){Z.db=mt.db=ne,W._dbInfo=Z;for(var oe=0;oe<Wt.length;oe++){var ye=Wt[oe];ye!==W&&(ye._dbInfo.db=Z.db,ye._dbInfo.version=Z.version)}})},_support:function(){try{if(!N||!N.open)return!1;var z=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),W=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!z||W)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch{return!1}}(),iterate:function(z,W){var Z=this,ft=new L(function(mt,vt){Z.ready().then(function(){w(Z._dbInfo,"readonly",function(Ct,zt){if(Ct)return vt(Ct);try{var Ht=zt.objectStore(Z._dbInfo.storeName).openCursor(),Wt=1;Ht.onsuccess=function(){var ne=Ht.result;if(ne){var oe=ne.value;tt(oe)&&(oe=$(oe));var ye=z(oe,ne.key,Wt++);ye!==void 0?mt(ye):ne.continue()}else mt()},Ht.onerror=function(){vt(Ht.error)}}catch(ne){vt(ne)}})}).catch(vt)});return k(ft,W),ft},getItem:function(z,W){var Z=this;z=ut(z);var ft=new L(function(mt,vt){Z.ready().then(function(){w(Z._dbInfo,"readonly",function(Ct,zt){if(Ct)return vt(Ct);try{var Ht=zt.objectStore(Z._dbInfo.storeName).get(z);Ht.onsuccess=function(){var Wt=Ht.result;Wt===void 0&&(Wt=null),tt(Wt)&&(Wt=$(Wt)),mt(Wt)},Ht.onerror=function(){vt(Ht.error)}}catch(Wt){vt(Wt)}})}).catch(vt)});return k(ft,W),ft},setItem:function(z,W,Z){var ft=this;z=ut(z);var mt=new L(function(vt,Ct){var zt;ft.ready().then(function(){return zt=ft._dbInfo,D.call(W)==="[object Blob]"?F(zt.db).then(function(Ht){return Ht?W:(Wt=W,new L(function(ne,oe){var ye=new FileReader;ye.onerror=oe,ye.onloadend=function(Ce){var Ie=btoa(Ce.target.result||"");ne({__local_forage_encoded_blob:!0,data:Ie,type:Wt.type})},ye.readAsBinaryString(Wt)}));var Wt}):W}).then(function(Ht){w(ft._dbInfo,"readwrite",function(Wt,ne){if(Wt)return Ct(Wt);try{var oe=ne.objectStore(ft._dbInfo.storeName);Ht===null&&(Ht=void 0);var ye=oe.put(Ht,z);ne.oncomplete=function(){Ht===void 0&&(Ht=null),vt(Ht)},ne.onabort=ne.onerror=function(){var Ce=ye.error?ye.error:ye.transaction.error;Ct(Ce)}}catch(Ce){Ct(Ce)}})}).catch(Ct)});return k(mt,Z),mt},removeItem:function(z,W){var Z=this;z=ut(z);var ft=new L(function(mt,vt){Z.ready().then(function(){w(Z._dbInfo,"readwrite",function(Ct,zt){if(Ct)return vt(Ct);try{var Ht=zt.objectStore(Z._dbInfo.storeName).delete(z);zt.oncomplete=function(){mt()},zt.onerror=function(){vt(Ht.error)},zt.onabort=function(){var Wt=Ht.error?Ht.error:Ht.transaction.error;vt(Wt)}}catch(Wt){vt(Wt)}})}).catch(vt)});return k(ft,W),ft},clear:function(z){var W=this,Z=new L(function(ft,mt){W.ready().then(function(){w(W._dbInfo,"readwrite",function(vt,Ct){if(vt)return mt(vt);try{var zt=Ct.objectStore(W._dbInfo.storeName).clear();Ct.oncomplete=function(){ft()},Ct.onabort=Ct.onerror=function(){var Ht=zt.error?zt.error:zt.transaction.error;mt(Ht)}}catch(Ht){mt(Ht)}})}).catch(mt)});return k(Z,z),Z},length:function(z){var W=this,Z=new L(function(ft,mt){W.ready().then(function(){w(W._dbInfo,"readonly",function(vt,Ct){if(vt)return mt(vt);try{var zt=Ct.objectStore(W._dbInfo.storeName).count();zt.onsuccess=function(){ft(zt.result)},zt.onerror=function(){mt(zt.error)}}catch(Ht){mt(Ht)}})}).catch(mt)});return k(Z,z),Z},key:function(z,W){var Z=this,ft=new L(function(mt,vt){z<0?mt(null):Z.ready().then(function(){w(Z._dbInfo,"readonly",function(Ct,zt){if(Ct)return vt(Ct);try{var Ht=zt.objectStore(Z._dbInfo.storeName),Wt=!1,ne=Ht.openKeyCursor();ne.onsuccess=function(){var oe=ne.result;oe?z===0||Wt?mt(oe.key):(Wt=!0,oe.advance(z)):mt(null)},ne.onerror=function(){vt(ne.error)}}catch(oe){vt(oe)}})}).catch(vt)});return k(ft,W),ft},keys:function(z){var W=this,Z=new L(function(ft,mt){W.ready().then(function(){w(W._dbInfo,"readonly",function(vt,Ct){if(vt)return mt(vt);try{var zt=Ct.objectStore(W._dbInfo.storeName).openKeyCursor(),Ht=[];zt.onsuccess=function(){var Wt=zt.result;Wt?(Ht.push(Wt.key),Wt.continue()):ft(Ht)},zt.onerror=function(){mt(zt.error)}}catch(Wt){mt(Wt)}})}).catch(mt)});return k(Z,z),Z},dropInstance:function(z,W){W=_t.apply(this,arguments);var Z=this.config();(z=typeof z!="function"&&z||{}).name||(z.name=z.name||Z.name,z.storeName=z.storeName||Z.storeName);var ft,mt=this;if(z.name){var vt=z.name===Z.name&&mt._dbInfo.db,Ct=vt?L.resolve(mt._dbInfo.db):Rt(z).then(function(zt){var Ht=R[z.name],Wt=Ht.forages;Ht.db=zt;for(var ne=0;ne<Wt.length;ne++)Wt[ne]._dbInfo.db=zt;return zt});ft=z.storeName?Ct.then(function(zt){if(zt.objectStoreNames.contains(z.storeName)){var Ht=zt.version+1;P(z);var Wt=R[z.name],ne=Wt.forages;zt.close();for(var oe=0;oe<ne.length;oe++){var ye=ne[oe];ye._dbInfo.db=null,ye._dbInfo.version=Ht}return new L(function(Ce,Ie){var Ke=N.open(z.name,Ht);Ke.onerror=function(Tn){Ke.result.close(),Ie(Tn)},Ke.onupgradeneeded=function(){Ke.result.deleteObjectStore(z.storeName)},Ke.onsuccess=function(){var Tn=Ke.result;Tn.close(),Ce(Tn)}}).then(function(Ce){Wt.db=Ce;for(var Ie=0;Ie<ne.length;Ie++){var Ke=ne[Ie];Ke._dbInfo.db=Ce,B(Ke._dbInfo)}}).catch(function(Ce){throw(G(z,Ce)||L.resolve()).catch(function(){}),Ce})}}):Ct.then(function(zt){P(z);var Ht=R[z.name],Wt=Ht.forages;zt.close();for(var ne=0;ne<Wt.length;ne++)Wt[ne]._dbInfo.db=null;return new L(function(oe,ye){var Ce=N.deleteDatabase(z.name);Ce.onerror=function(){var Ie=Ce.result;Ie&&Ie.close(),ye(Ce.error)},Ce.onblocked=function(){console.warn('dropInstance blocked for database "'+z.name+'" until all open connections are closed')},Ce.onsuccess=function(){var Ie=Ce.result;Ie&&Ie.close(),oe(Ie)}}).then(function(oe){Ht.db=oe;for(var ye=0;ye<Wt.length;ye++)B(Wt[ye]._dbInfo)}).catch(function(oe){throw(G(z,oe)||L.resolve()).catch(function(){}),oe})})}else ft=L.reject("Invalid arguments");return k(ft,W),ft}},bt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",dt=/^~~local_forage_type~([^~]+)~/,yt=9,Ot=yt+4,kt=Object.prototype.toString;function Dt(z){var W,Z,ft,mt,vt,Ct=.75*z.length,zt=z.length,Ht=0;z[z.length-1]==="="&&(Ct--,z[z.length-2]==="="&&Ct--);var Wt=new ArrayBuffer(Ct),ne=new Uint8Array(Wt);for(W=0;W<zt;W+=4)Z=bt.indexOf(z[W]),ft=bt.indexOf(z[W+1]),mt=bt.indexOf(z[W+2]),vt=bt.indexOf(z[W+3]),ne[Ht++]=Z<<2|ft>>4,ne[Ht++]=(15&ft)<<4|mt>>2,ne[Ht++]=(3&mt)<<6|63&vt;return Wt}function te(z){var W,Z=new Uint8Array(z),ft="";for(W=0;W<Z.length;W+=3)ft+=bt[Z[W]>>2],ft+=bt[(3&Z[W])<<4|Z[W+1]>>4],ft+=bt[(15&Z[W+1])<<2|Z[W+2]>>6],ft+=bt[63&Z[W+2]];return Z.length%3==2?ft=ft.substring(0,ft.length-1)+"=":Z.length%3==1&&(ft=ft.substring(0,ft.length-2)+"=="),ft}var re={serialize:function(z,W){var Z="";if(z&&(Z=kt.call(z)),z&&(Z==="[object ArrayBuffer]"||z.buffer&&kt.call(z.buffer)==="[object ArrayBuffer]")){var ft,mt="__lfsc__:";z instanceof ArrayBuffer?(ft=z,mt+="arbf"):(ft=z.buffer,Z==="[object Int8Array]"?mt+="si08":Z==="[object Uint8Array]"?mt+="ui08":Z==="[object Uint8ClampedArray]"?mt+="uic8":Z==="[object Int16Array]"?mt+="si16":Z==="[object Uint16Array]"?mt+="ur16":Z==="[object Int32Array]"?mt+="si32":Z==="[object Uint32Array]"?mt+="ui32":Z==="[object Float32Array]"?mt+="fl32":Z==="[object Float64Array]"?mt+="fl64":W(new Error("Failed to get type for BinaryArray"))),W(mt+te(ft))}else if(Z==="[object Blob]"){var vt=new FileReader;vt.onload=function(){var Ct="~~local_forage_type~"+z.type+"~"+te(this.result);W("__lfsc__:blob"+Ct)},vt.readAsArrayBuffer(z)}else try{W(JSON.stringify(z))}catch(Ct){console.error("Couldn't convert value into a JSON string: ",z),W(null,Ct)}},deserialize:function(z){if(z.substring(0,yt)!=="__lfsc__:")return JSON.parse(z);var W,Z=z.substring(Ot),ft=z.substring(yt,Ot);if(ft==="blob"&&dt.test(Z)){var mt=Z.match(dt);W=mt[1],Z=Z.substring(mt[0].length)}var vt=Dt(Z);switch(ft){case"arbf":return vt;case"blob":return I([vt],{type:W});case"si08":return new Int8Array(vt);case"ui08":return new Uint8Array(vt);case"uic8":return new Uint8ClampedArray(vt);case"si16":return new Int16Array(vt);case"ur16":return new Uint16Array(vt);case"si32":return new Int32Array(vt);case"ui32":return new Uint32Array(vt);case"fl32":return new Float32Array(vt);case"fl64":return new Float64Array(vt);default:throw new Error("Unkown type: "+ft)}},stringToBuffer:Dt,bufferToString:te};function $t(z,W,Z,ft){z.executeSql("CREATE TABLE IF NOT EXISTS "+W.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],Z,ft)}function pe(z,W,Z,ft,mt,vt){z.executeSql(Z,ft,mt,function(Ct,zt){zt.code===zt.SYNTAX_ERR?Ct.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[W.storeName],function(Ht,Wt){Wt.rows.length?vt(Ht,zt):$t(Ht,W,function(){Ht.executeSql(Z,ft,mt,vt)},vt)},vt):vt(Ct,zt)},vt)}function le(z,W,Z,ft){var mt=this;z=ut(z);var vt=new L(function(Ct,zt){mt.ready().then(function(){W===void 0&&(W=null);var Ht=W,Wt=mt._dbInfo;Wt.serializer.serialize(W,function(ne,oe){oe?zt(oe):Wt.db.transaction(function(ye){pe(ye,Wt,"INSERT OR REPLACE INTO "+Wt.storeName+" (key, value) VALUES (?, ?)",[z,ne],function(){Ct(Ht)},function(Ce,Ie){zt(Ie)})},function(ye){if(ye.code===ye.QUOTA_ERR){if(ft>0)return void Ct(le.apply(mt,[z,Ht,Z,ft-1]));zt(ye)}})})}).catch(zt)});return k(vt,Z),vt}function Se(z){return new L(function(W,Z){z.transaction(function(ft){ft.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(mt,vt){for(var Ct=[],zt=0;zt<vt.rows.length;zt++)Ct.push(vt.rows.item(zt).name);W({db:z,storeNames:Ct})},function(mt,vt){Z(vt)})},function(ft){Z(ft)})})}var ue={_driver:"webSQLStorage",_initStorage:function(z){var W=this,Z={db:null};if(z)for(var ft in z)Z[ft]=typeof z[ft]!="string"?z[ft].toString():z[ft];var mt=new L(function(vt,Ct){try{Z.db=openDatabase(Z.name,String(Z.version),Z.description,Z.size)}catch(zt){return Ct(zt)}Z.db.transaction(function(zt){$t(zt,Z,function(){W._dbInfo=Z,vt()},function(Ht,Wt){Ct(Wt)})},Ct)});return Z.serializer=re,mt},_support:typeof openDatabase=="function",iterate:function(z,W){var Z=this,ft=new L(function(mt,vt){Z.ready().then(function(){var Ct=Z._dbInfo;Ct.db.transaction(function(zt){pe(zt,Ct,"SELECT * FROM "+Ct.storeName,[],function(Ht,Wt){for(var ne=Wt.rows,oe=ne.length,ye=0;ye<oe;ye++){var Ce=ne.item(ye),Ie=Ce.value;if(Ie&&(Ie=Ct.serializer.deserialize(Ie)),(Ie=z(Ie,Ce.key,ye+1))!==void 0)return void mt(Ie)}mt()},function(Ht,Wt){vt(Wt)})})}).catch(vt)});return k(ft,W),ft},getItem:function(z,W){var Z=this;z=ut(z);var ft=new L(function(mt,vt){Z.ready().then(function(){var Ct=Z._dbInfo;Ct.db.transaction(function(zt){pe(zt,Ct,"SELECT * FROM "+Ct.storeName+" WHERE key = ? LIMIT 1",[z],function(Ht,Wt){var ne=Wt.rows.length?Wt.rows.item(0).value:null;ne&&(ne=Ct.serializer.deserialize(ne)),mt(ne)},function(Ht,Wt){vt(Wt)})})}).catch(vt)});return k(ft,W),ft},setItem:function(z,W,Z){return le.apply(this,[z,W,Z,1])},removeItem:function(z,W){var Z=this;z=ut(z);var ft=new L(function(mt,vt){Z.ready().then(function(){var Ct=Z._dbInfo;Ct.db.transaction(function(zt){pe(zt,Ct,"DELETE FROM "+Ct.storeName+" WHERE key = ?",[z],function(){mt()},function(Ht,Wt){vt(Wt)})})}).catch(vt)});return k(ft,W),ft},clear:function(z){var W=this,Z=new L(function(ft,mt){W.ready().then(function(){var vt=W._dbInfo;vt.db.transaction(function(Ct){pe(Ct,vt,"DELETE FROM "+vt.storeName,[],function(){ft()},function(zt,Ht){mt(Ht)})})}).catch(mt)});return k(Z,z),Z},length:function(z){var W=this,Z=new L(function(ft,mt){W.ready().then(function(){var vt=W._dbInfo;vt.db.transaction(function(Ct){pe(Ct,vt,"SELECT COUNT(key) as c FROM "+vt.storeName,[],function(zt,Ht){var Wt=Ht.rows.item(0).c;ft(Wt)},function(zt,Ht){mt(Ht)})})}).catch(mt)});return k(Z,z),Z},key:function(z,W){var Z=this,ft=new L(function(mt,vt){Z.ready().then(function(){var Ct=Z._dbInfo;Ct.db.transaction(function(zt){pe(zt,Ct,"SELECT key FROM "+Ct.storeName+" WHERE id = ? LIMIT 1",[z+1],function(Ht,Wt){var ne=Wt.rows.length?Wt.rows.item(0).key:null;mt(ne)},function(Ht,Wt){vt(Wt)})})}).catch(vt)});return k(ft,W),ft},keys:function(z){var W=this,Z=new L(function(ft,mt){W.ready().then(function(){var vt=W._dbInfo;vt.db.transaction(function(Ct){pe(Ct,vt,"SELECT key FROM "+vt.storeName,[],function(zt,Ht){for(var Wt=[],ne=0;ne<Ht.rows.length;ne++)Wt.push(Ht.rows.item(ne).key);ft(Wt)},function(zt,Ht){mt(Ht)})})}).catch(mt)});return k(Z,z),Z},dropInstance:function(z,W){W=_t.apply(this,arguments);var Z=this.config();(z=typeof z!="function"&&z||{}).name||(z.name=z.name||Z.name,z.storeName=z.storeName||Z.storeName);var ft,mt=this;return k(ft=z.name?new L(function(vt){var Ct;Ct=z.name===Z.name?mt._dbInfo.db:openDatabase(z.name,"","",0),z.storeName?vt({db:Ct,storeNames:[z.storeName]}):vt(Se(Ct))}).then(function(vt){return new L(function(Ct,zt){vt.db.transaction(function(Ht){function Wt(Ce){return new L(function(Ie,Ke){Ht.executeSql("DROP TABLE IF EXISTS "+Ce,[],function(){Ie()},function(Tn,Si){Ke(Si)})})}for(var ne=[],oe=0,ye=vt.storeNames.length;oe<ye;oe++)ne.push(Wt(vt.storeNames[oe]));L.all(ne).then(function(){Ct()}).catch(function(Ce){zt(Ce)})},function(Ht){zt(Ht)})})}):L.reject("Invalid arguments"),W),ft}};function Oe(z,W){var Z=z.name+"/";return z.storeName!==W.storeName&&(Z+=z.storeName+"/"),Z}function Me(){return!function(){try{return localStorage.setItem("_localforage_support_test",!0),localStorage.removeItem("_localforage_support_test"),!1}catch{return!0}}()||localStorage.length>0}var Ge={_driver:"localStorageWrapper",_initStorage:function(z){var W={};if(z)for(var Z in z)W[Z]=z[Z];return W.keyPrefix=Oe(z,this._defaultConfig),Me()?(this._dbInfo=W,W.serializer=re,L.resolve()):L.reject()},_support:function(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}(),iterate:function(z,W){var Z=this,ft=Z.ready().then(function(){for(var mt=Z._dbInfo,vt=mt.keyPrefix,Ct=vt.length,zt=localStorage.length,Ht=1,Wt=0;Wt<zt;Wt++){var ne=localStorage.key(Wt);if(ne.indexOf(vt)===0){var oe=localStorage.getItem(ne);if(oe&&(oe=mt.serializer.deserialize(oe)),(oe=z(oe,ne.substring(Ct),Ht++))!==void 0)return oe}}});return k(ft,W),ft},getItem:function(z,W){var Z=this;z=ut(z);var ft=Z.ready().then(function(){var mt=Z._dbInfo,vt=localStorage.getItem(mt.keyPrefix+z);return vt&&(vt=mt.serializer.deserialize(vt)),vt});return k(ft,W),ft},setItem:function(z,W,Z){var ft=this;z=ut(z);var mt=ft.ready().then(function(){W===void 0&&(W=null);var vt=W;return new L(function(Ct,zt){var Ht=ft._dbInfo;Ht.serializer.serialize(W,function(Wt,ne){if(ne)zt(ne);else try{localStorage.setItem(Ht.keyPrefix+z,Wt),Ct(vt)}catch(oe){oe.name!=="QuotaExceededError"&&oe.name!=="NS_ERROR_DOM_QUOTA_REACHED"||zt(oe),zt(oe)}})})});return k(mt,Z),mt},removeItem:function(z,W){var Z=this;z=ut(z);var ft=Z.ready().then(function(){var mt=Z._dbInfo;localStorage.removeItem(mt.keyPrefix+z)});return k(ft,W),ft},clear:function(z){var W=this,Z=W.ready().then(function(){for(var ft=W._dbInfo.keyPrefix,mt=localStorage.length-1;mt>=0;mt--){var vt=localStorage.key(mt);vt.indexOf(ft)===0&&localStorage.removeItem(vt)}});return k(Z,z),Z},length:function(z){var W=this.keys().then(function(Z){return Z.length});return k(W,z),W},key:function(z,W){var Z=this,ft=Z.ready().then(function(){var mt,vt=Z._dbInfo;try{mt=localStorage.key(z)}catch{mt=null}return mt&&(mt=mt.substring(vt.keyPrefix.length)),mt});return k(ft,W),ft},keys:function(z){var W=this,Z=W.ready().then(function(){for(var ft=W._dbInfo,mt=localStorage.length,vt=[],Ct=0;Ct<mt;Ct++){var zt=localStorage.key(Ct);zt.indexOf(ft.keyPrefix)===0&&vt.push(zt.substring(ft.keyPrefix.length))}return vt});return k(Z,z),Z},dropInstance:function(z,W){if(W=_t.apply(this,arguments),!(z=typeof z!="function"&&z||{}).name){var Z=this.config();z.name=z.name||Z.name,z.storeName=z.storeName||Z.storeName}var ft,mt=this;return k(ft=z.name?new L(function(vt){z.storeName?vt(Oe(z,mt._defaultConfig)):vt(z.name+"/")}).then(function(vt){for(var Ct=localStorage.length-1;Ct>=0;Ct--){var zt=localStorage.key(Ct);zt.indexOf(vt)===0&&localStorage.removeItem(zt)}}):L.reject("Invalid arguments"),W),ft}},nn=function(z,W){for(var Z,ft,mt=z.length,vt=0;vt<mt;){if((Z=z[vt])===(ft=W)||typeof Z=="number"&&typeof ft=="number"&&isNaN(Z)&&isNaN(ft))return!0;vt++}return!1},fe=Array.isArray||function(z){return Object.prototype.toString.call(z)==="[object Array]"},ge={},En={},je={INDEXEDDB:ot,WEBSQL:ue,LOCALSTORAGE:Ge},rn=[je.INDEXEDDB._driver,je.WEBSQL._driver,je.LOCALSTORAGE._driver],wn=["dropInstance"],er=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(wn),Ti={description:"",driver:rn.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Ds(z,W){z[W]=function(){var Z=arguments;return z.ready().then(function(){return z[W].apply(z,Z)})}}function nr(){for(var z=1;z<arguments.length;z++){var W=arguments[z];if(W)for(var Z in W)W.hasOwnProperty(Z)&&(fe(W[Z])?arguments[0][Z]=W[Z].slice():arguments[0][Z]=W[Z])}return arguments[0]}var Fs=new(function(){function z(W){for(var Z in function(vt,Ct){if(!(vt instanceof Ct))throw new TypeError("Cannot call a class as a function")}(this,z),je)if(je.hasOwnProperty(Z)){var ft=je[Z],mt=ft._driver;this[Z]=mt,ge[mt]||this.defineDriver(ft)}this._defaultConfig=nr({},Ti),this._config=nr({},this._defaultConfig,W),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return z.prototype.config=function(W){if((W===void 0?"undefined":S(W))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var Z in W){if(Z==="storeName"&&(W[Z]=W[Z].replace(/\W/g,"_")),Z==="version"&&typeof W[Z]!="number")return new Error("Database version must be a number.");this._config[Z]=W[Z]}return!("driver"in W)||!W.driver||this.setDriver(this._config.driver)}return typeof W=="string"?this._config[W]:this._config},z.prototype.defineDriver=function(W,Z,ft){var mt=new L(function(vt,Ct){try{var zt=W._driver,Ht=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!W._driver)return void Ct(Ht);for(var Wt=er.concat("_initStorage"),ne=0,oe=Wt.length;ne<oe;ne++){var ye=Wt[ne];if((!nn(wn,ye)||W[ye])&&typeof W[ye]!="function")return void Ct(Ht)}(function(){for(var Ie=function(Mr){return function(){var zl=new Error("Method "+Mr+" is not implemented by the current driver"),Qo=L.reject(zl);return k(Qo,arguments[arguments.length-1]),Qo}},Ke=0,Tn=wn.length;Ke<Tn;Ke++){var Si=wn[Ke];W[Si]||(W[Si]=Ie(Si))}})();var Ce=function(Ie){ge[zt]&&console.info("Redefining LocalForage driver: "+zt),ge[zt]=W,En[zt]=Ie,vt()};"_support"in W?W._support&&typeof W._support=="function"?W._support().then(Ce,Ct):Ce(!!W._support):Ce(!0)}catch(Ie){Ct(Ie)}});return K(mt,Z,ft),mt},z.prototype.driver=function(){return this._driver||null},z.prototype.getDriver=function(W,Z,ft){var mt=ge[W]?L.resolve(ge[W]):L.reject(new Error("Driver not found."));return K(mt,Z,ft),mt},z.prototype.getSerializer=function(W){var Z=L.resolve(re);return K(Z,W),Z},z.prototype.ready=function(W){var Z=this,ft=Z._driverSet.then(function(){return Z._ready===null&&(Z._ready=Z._initDriver()),Z._ready});return K(ft,W,W),ft},z.prototype.setDriver=function(W,Z,ft){var mt=this;fe(W)||(W=[W]);var vt=this._getSupportedDrivers(W);function Ct(){mt._config.driver=mt.driver()}function zt(Wt){return mt._extend(Wt),Ct(),mt._ready=mt._initStorage(mt._config),mt._ready}var Ht=this._driverSet!==null?this._driverSet.catch(function(){return L.resolve()}):L.resolve();return this._driverSet=Ht.then(function(){var Wt=vt[0];return mt._dbInfo=null,mt._ready=null,mt.getDriver(Wt).then(function(ne){mt._driver=ne._driver,Ct(),mt._wrapLibraryMethodsWithReady(),mt._initDriver=function(oe){return function(){var ye=0;return function Ce(){for(;ye<oe.length;){var Ie=oe[ye];return ye++,mt._dbInfo=null,mt._ready=null,mt.getDriver(Ie).then(zt).catch(Ce)}Ct();var Ke=new Error("No available storage method found.");return mt._driverSet=L.reject(Ke),mt._driverSet}()}}(vt)})}).catch(function(){Ct();var Wt=new Error("No available storage method found.");return mt._driverSet=L.reject(Wt),mt._driverSet}),K(this._driverSet,Z,ft),this._driverSet},z.prototype.supports=function(W){return!!En[W]},z.prototype._extend=function(W){nr(this,W)},z.prototype._getSupportedDrivers=function(W){for(var Z=[],ft=0,mt=W.length;ft<mt;ft++){var vt=W[ft];this.supports(vt)&&Z.push(vt)}return Z},z.prototype._wrapLibraryMethodsWithReady=function(){for(var W=0,Z=er.length;W<Z;W++)Ds(this,er[W])},z.prototype.createInstance=function(W){return new z(W)},z}());C.exports=Fs},{3:3}]},{},[4])(4)}).call(this,d(11))},function(m,y,d){var x=d(7),b=d(105),C=d(106),T=Math.max,S=Math.min;m.exports=function(N,I,L){var k,K,ut,_t,E,R,D=0,F=!1,P=!1,B=!0;if(typeof N!="function")throw new TypeError("Expected a function");function G(tt){var lt=k,w=K;return k=K=void 0,D=tt,_t=N.apply(w,lt)}function q(tt){return D=tt,E=setTimeout(Xt,I),F?G(tt):_t}function Rt(tt){var lt=tt-R;return R===void 0||lt>=I||lt<0||P&&tt-D>=ut}function Xt(){var tt=b();if(Rt(tt))return at(tt);E=setTimeout(Xt,function(lt){var w=I-(lt-R);return P?S(w,ut-(lt-D)):w}(tt))}function at(tt){return E=void 0,B&&k?G(tt):(k=K=void 0,_t)}function $(){var tt=b(),lt=Rt(tt);if(k=arguments,K=this,R=tt,lt){if(E===void 0)return q(R);if(P)return clearTimeout(E),E=setTimeout(Xt,I),G(R)}return E===void 0&&(E=setTimeout(Xt,I)),_t}return I=C(I)||0,x(L)&&(F=!!L.leading,ut=(P="maxWait"in L)?T(C(L.maxWait)||0,I):ut,B="trailing"in L?!!L.trailing:B),$.cancel=function(){E!==void 0&&clearTimeout(E),D=0,k=R=K=E=void 0},$.flush=function(){return E===void 0?_t:at(b())},$}},function(m,y){var d;d=function(){return this}();try{d=d||new Function("return this")()}catch{typeof window=="object"&&(d=window)}m.exports=d},function(m,y,d){var x=d(3).Symbol;m.exports=x},function(m,y){m.exports=function(d){return d.webpackPolyfill||(d.deprecate=function(){},d.paths=[],d.children||(d.children=[]),Object.defineProperty(d,"loaded",{enumerable:!0,get:function(){return d.l}}),Object.defineProperty(d,"id",{enumerable:!0,get:function(){return d.i}}),d.webpackPolyfill=1),d}},function(m,y,d){var x=d(113),b=d(114),C=d(115),T=d(116),S=d(117);function N(I){var L=-1,k=I==null?0:I.length;for(this.clear();++L<k;){var K=I[L];this.set(K[0],K[1])}}N.prototype.clear=x,N.prototype.delete=b,N.prototype.get=C,N.prototype.has=T,N.prototype.set=S,m.exports=N},function(m,y,d){var x=d(23);m.exports=function(b,C){for(var T=b.length;T--;)if(x(b[T][0],C))return T;return-1}},function(m,y,d){var x=d(8)(Object,"create");m.exports=x},function(m,y,d){var x=d(135);m.exports=function(b,C){var T=b.__data__;return x(C)?T[typeof C=="string"?"string":"hash"]:T.map}},function(m,y){var d=Array.isArray;m.exports=d},function(m,y,d){var x=d(157),b=d(24),C=d(158),T=d(159),S=d(160),N=d(6),I=d(39),L=I(x),k=I(b),K=I(C),ut=I(T),_t=I(S),E=N;(x&&E(new x(new ArrayBuffer(1)))!="[object DataView]"||b&&E(new b)!="[object Map]"||C&&E(C.resolve())!="[object Promise]"||T&&E(new T)!="[object Set]"||S&&E(new S)!="[object WeakMap]")&&(E=function(R){var D=N(R),F=D=="[object Object]"?R.constructor:void 0,P=F?I(F):"";if(P)switch(P){case L:return"[object DataView]";case k:return"[object Map]";case K:return"[object Promise]";case ut:return"[object Set]";case _t:return"[object WeakMap]"}return D}),m.exports=E},function(m,y,d){var x=d(52),b=d(53);m.exports=function(C,T,S,N){var I=!S;S||(S={});for(var L=-1,k=T.length;++L<k;){var K=T[L],ut=N?N(S[K],C[K],K,S,C):void 0;ut===void 0&&(ut=C[K]),I?b(S,K,ut):x(S,K,ut)}return S}},function(m,y,d){var x=d(6),b=d(7);m.exports=function(C){if(!b(C))return!1;var T=x(C);return T=="[object Function]"||T=="[object GeneratorFunction]"||T=="[object AsyncFunction]"||T=="[object Proxy]"}},function(m,y,d){var x=d(99),b=d(100);function C(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}y.parse=P,y.resolve=function(B,G){return P(B,!1,!0).resolve(G)},y.resolveObject=function(B,G){return B?P(B,!1,!0).resolveObject(G):G},y.format=function(B){return b.isString(B)&&(B=P(B)),B instanceof C?B.format():C.prototype.format.call(B)},y.Url=C;var T=/^([a-z0-9.+-]+:)/i,S=/:[0-9]*$/,N=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,I=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
2
|
+
`," "]),L=["'"].concat(I),k=["%","/","?",";","#"].concat(L),K=["/","?","#"],ut=/^[+a-z0-9A-Z_-]{0,63}$/,_t=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,E={javascript:!0,"javascript:":!0},R={javascript:!0,"javascript:":!0},D={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},F=d(101);function P(B,G,q){if(B&&b.isObject(B)&&B instanceof C)return B;var Rt=new C;return Rt.parse(B,G,q),Rt}C.prototype.parse=function(B,G,q){if(!b.isString(B))throw new TypeError("Parameter 'url' must be a string, not "+typeof B);var Rt=B.indexOf("?"),Xt=Rt!==-1&&Rt<B.indexOf("#")?"?":"#",at=B.split(Xt);at[0]=at[0].replace(/\\/g,"/");var $=B=at.join(Xt);if($=$.trim(),!q&&B.split("#").length===1){var tt=N.exec($);if(tt)return this.path=$,this.href=$,this.pathname=tt[1],tt[2]?(this.search=tt[2],this.query=G?F.parse(this.search.substr(1)):this.search.substr(1)):G&&(this.search="",this.query={}),this}var lt=T.exec($);if(lt){var w=(lt=lt[0]).toLowerCase();this.protocol=w,$=$.substr(lt.length)}if(q||lt||$.match(/^\/\/[^@\/]+@[^@\/]+/)){var ot=$.substr(0,2)==="//";!ot||lt&&R[lt]||($=$.substr(2),this.slashes=!0)}if(!R[lt]&&(ot||lt&&!D[lt])){for(var bt,dt,yt=-1,Ot=0;Ot<K.length;Ot++)(kt=$.indexOf(K[Ot]))!==-1&&(yt===-1||kt<yt)&&(yt=kt);for((dt=yt===-1?$.lastIndexOf("@"):$.lastIndexOf("@",yt))!==-1&&(bt=$.slice(0,dt),$=$.slice(dt+1),this.auth=decodeURIComponent(bt)),yt=-1,Ot=0;Ot<k.length;Ot++){var kt;(kt=$.indexOf(k[Ot]))!==-1&&(yt===-1||kt<yt)&&(yt=kt)}yt===-1&&(yt=$.length),this.host=$.slice(0,yt),$=$.slice(yt),this.parseHost(),this.hostname=this.hostname||"";var Dt=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!Dt)for(var te=this.hostname.split(/\./),re=(Ot=0,te.length);Ot<re;Ot++){var $t=te[Ot];if($t&&!$t.match(ut)){for(var pe="",le=0,Se=$t.length;le<Se;le++)$t.charCodeAt(le)>127?pe+="x":pe+=$t[le];if(!pe.match(ut)){var ue=te.slice(0,Ot),Oe=te.slice(Ot+1),Me=$t.match(_t);Me&&(ue.push(Me[1]),Oe.unshift(Me[2])),Oe.length&&($="/"+Oe.join(".")+$),this.hostname=ue.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),Dt||(this.hostname=x.toASCII(this.hostname));var Ge=this.port?":"+this.port:"",nn=this.hostname||"";this.host=nn+Ge,this.href+=this.host,Dt&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),$[0]!=="/"&&($="/"+$))}if(!E[w])for(Ot=0,re=L.length;Ot<re;Ot++){var fe=L[Ot];if($.indexOf(fe)!==-1){var ge=encodeURIComponent(fe);ge===fe&&(ge=escape(fe)),$=$.split(fe).join(ge)}}var En=$.indexOf("#");En!==-1&&(this.hash=$.substr(En),$=$.slice(0,En));var je=$.indexOf("?");if(je!==-1?(this.search=$.substr(je),this.query=$.substr(je+1),G&&(this.query=F.parse(this.query)),$=$.slice(0,je)):G&&(this.search="",this.query={}),$&&(this.pathname=$),D[w]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){Ge=this.pathname||"";var rn=this.search||"";this.path=Ge+rn}return this.href=this.format(),this},C.prototype.format=function(){var B=this.auth||"";B&&(B=(B=encodeURIComponent(B)).replace(/%3A/i,":"),B+="@");var G=this.protocol||"",q=this.pathname||"",Rt=this.hash||"",Xt=!1,at="";this.host?Xt=B+this.host:this.hostname&&(Xt=B+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(Xt+=":"+this.port)),this.query&&b.isObject(this.query)&&Object.keys(this.query).length&&(at=F.stringify(this.query));var $=this.search||at&&"?"+at||"";return G&&G.substr(-1)!==":"&&(G+=":"),this.slashes||(!G||D[G])&&Xt!==!1?(Xt="//"+(Xt||""),q&&q.charAt(0)!=="/"&&(q="/"+q)):Xt||(Xt=""),Rt&&Rt.charAt(0)!=="#"&&(Rt="#"+Rt),$&&$.charAt(0)!=="?"&&($="?"+$),G+Xt+(q=q.replace(/[?#]/g,function(tt){return encodeURIComponent(tt)}))+($=$.replace("#","%23"))+Rt},C.prototype.resolve=function(B){return this.resolveObject(P(B,!1,!0)).format()},C.prototype.resolveObject=function(B){if(b.isString(B)){var G=new C;G.parse(B,!1,!0),B=G}for(var q=new C,Rt=Object.keys(this),Xt=0;Xt<Rt.length;Xt++){var at=Rt[Xt];q[at]=this[at]}if(q.hash=B.hash,B.href==="")return q.href=q.format(),q;if(B.slashes&&!B.protocol){for(var $=Object.keys(B),tt=0;tt<$.length;tt++){var lt=$[tt];lt!=="protocol"&&(q[lt]=B[lt])}return D[q.protocol]&&q.hostname&&!q.pathname&&(q.path=q.pathname="/"),q.href=q.format(),q}if(B.protocol&&B.protocol!==q.protocol){if(!D[B.protocol]){for(var w=Object.keys(B),ot=0;ot<w.length;ot++){var bt=w[ot];q[bt]=B[bt]}return q.href=q.format(),q}if(q.protocol=B.protocol,B.host||R[B.protocol])q.pathname=B.pathname;else{for(var dt=(B.pathname||"").split("/");dt.length&&!(B.host=dt.shift()););B.host||(B.host=""),B.hostname||(B.hostname=""),dt[0]!==""&&dt.unshift(""),dt.length<2&&dt.unshift(""),q.pathname=dt.join("/")}if(q.search=B.search,q.query=B.query,q.host=B.host||"",q.auth=B.auth,q.hostname=B.hostname||B.host,q.port=B.port,q.pathname||q.search){var yt=q.pathname||"",Ot=q.search||"";q.path=yt+Ot}return q.slashes=q.slashes||B.slashes,q.href=q.format(),q}var kt=q.pathname&&q.pathname.charAt(0)==="/",Dt=B.host||B.pathname&&B.pathname.charAt(0)==="/",te=Dt||kt||q.host&&B.pathname,re=te,$t=q.pathname&&q.pathname.split("/")||[],pe=(dt=B.pathname&&B.pathname.split("/")||[],q.protocol&&!D[q.protocol]);if(pe&&(q.hostname="",q.port=null,q.host&&($t[0]===""?$t[0]=q.host:$t.unshift(q.host)),q.host="",B.protocol&&(B.hostname=null,B.port=null,B.host&&(dt[0]===""?dt[0]=B.host:dt.unshift(B.host)),B.host=null),te=te&&(dt[0]===""||$t[0]==="")),Dt)q.host=B.host||B.host===""?B.host:q.host,q.hostname=B.hostname||B.hostname===""?B.hostname:q.hostname,q.search=B.search,q.query=B.query,$t=dt;else if(dt.length)$t||($t=[]),$t.pop(),$t=$t.concat(dt),q.search=B.search,q.query=B.query;else if(!b.isNullOrUndefined(B.search))return pe&&(q.hostname=q.host=$t.shift(),(Me=!!(q.host&&q.host.indexOf("@")>0)&&q.host.split("@"))&&(q.auth=Me.shift(),q.host=q.hostname=Me.shift())),q.search=B.search,q.query=B.query,b.isNull(q.pathname)&&b.isNull(q.search)||(q.path=(q.pathname?q.pathname:"")+(q.search?q.search:"")),q.href=q.format(),q;if(!$t.length)return q.pathname=null,q.search?q.path="/"+q.search:q.path=null,q.href=q.format(),q;for(var le=$t.slice(-1)[0],Se=(q.host||B.host||$t.length>1)&&(le==="."||le==="..")||le==="",ue=0,Oe=$t.length;Oe>=0;Oe--)(le=$t[Oe])==="."?$t.splice(Oe,1):le===".."?($t.splice(Oe,1),ue++):ue&&($t.splice(Oe,1),ue--);if(!te&&!re)for(;ue--;ue)$t.unshift("..");!te||$t[0]===""||$t[0]&&$t[0].charAt(0)==="/"||$t.unshift(""),Se&&$t.join("/").substr(-1)!=="/"&&$t.push("");var Me,Ge=$t[0]===""||$t[0]&&$t[0].charAt(0)==="/";return pe&&(q.hostname=q.host=Ge?"":$t.length?$t.shift():"",(Me=!!(q.host&&q.host.indexOf("@")>0)&&q.host.split("@"))&&(q.auth=Me.shift(),q.host=q.hostname=Me.shift())),(te=te||q.host&&$t.length)&&!Ge&&$t.unshift(""),$t.length?q.pathname=$t.join("/"):(q.pathname=null,q.path=null),b.isNull(q.pathname)&&b.isNull(q.search)||(q.path=(q.pathname?q.pathname:"")+(q.search?q.search:"")),q.auth=B.auth||q.auth,q.slashes=q.slashes||B.slashes,q.href=q.format(),q},C.prototype.parseHost=function(){var B=this.host,G=S.exec(B);G&&((G=G[0])!==":"&&(this.port=G.substr(1)),B=B.substr(0,B.length-G.length)),B&&(this.hostname=B)}},function(m,y){m.exports=function(d,x){return d===x||d!=d&&x!=x}},function(m,y,d){var x=d(8)(d(3),"Map");m.exports=x},function(m,y,d){var x=d(148),b=d(46),C=Object.prototype.propertyIsEnumerable,T=Object.getOwnPropertySymbols,S=T?function(N){return N==null?[]:(N=Object(N),x(T(N),function(I){return C.call(N,I)}))}:b;m.exports=S},function(m,y,d){var x=d(47),b=d(155),C=d(51);m.exports=function(T){return C(T)?x(T):b(T)}},function(m,y,d){(function(x){var b=d(3),C=d(152),T=y&&!y.nodeType&&y,S=T&&typeof x=="object"&&x&&!x.nodeType&&x,N=S&&S.exports===T?b.Buffer:void 0,I=(N?N.isBuffer:void 0)||C;x.exports=I}).call(this,d(13)(m))},function(m,y){m.exports=function(d){return function(x){return d(x)}}},function(m,y,d){(function(x){var b=d(35),C=y&&!y.nodeType&&y,T=C&&typeof x=="object"&&x&&!x.nodeType&&x,S=T&&T.exports===C&&b.process,N=function(){try{var I=T&&T.require&&T.require("util").types;return I||S&&S.binding&&S.binding("util")}catch{}}();x.exports=N}).call(this,d(13)(m))},function(m,y){var d=Object.prototype;m.exports=function(x){var b=x&&x.constructor;return x===(typeof b=="function"&&b.prototype||d)}},function(m,y,d){var x=d(47),b=d(166),C=d(51);m.exports=function(T){return C(T)?x(T,!0):b(T)}},function(m,y,d){var x=d(42);m.exports=function(b){var C=new b.constructor(b.byteLength);return new x(C).set(new x(b)),C}},function(m,y,d){var x=d(104);m.exports=function(b,C){C=C||{};var T=new x,S=C.inPlace||!1,N=b.map(function(L){return S?L:{width:L.width,height:L.height,item:L}});N=N.sort(function(L,k){return k.width*k.height-L.width*L.height}),T.fit(N);var I={width:N.reduce(function(L,k){return Math.max(L,k.x+k.width)},0),height:N.reduce(function(L,k){return Math.max(L,k.y+k.height)},0)};return S||(I.items=N),I}},function(m,y,d){var x=d(161);m.exports=function(b){return x(b,5)}},function(m,y,d){(function(x){var b=typeof x=="object"&&x&&x.Object===Object&&x;m.exports=b}).call(this,d(11))},function(m,y,d){var x=Object.prototype.hasOwnProperty,b="~";function C(){}function T(L,k,K){this.fn=L,this.context=k,this.once=K||!1}function S(L,k,K,ut,_t){if(typeof K!="function")throw new TypeError("The listener must be a function");var E=new T(K,ut||L,_t),R=b?b+k:k;return L._events[R]?L._events[R].fn?L._events[R]=[L._events[R],E]:L._events[R].push(E):(L._events[R]=E,L._eventsCount++),L}function N(L,k){--L._eventsCount==0?L._events=new C:delete L._events[k]}function I(){this._events=new C,this._eventsCount=0}Object.create&&(C.prototype=Object.create(null),new C().__proto__||(b=!1)),I.prototype.eventNames=function(){var L,k,K=[];if(this._eventsCount===0)return K;for(k in L=this._events)x.call(L,k)&&K.push(b?k.slice(1):k);return Object.getOwnPropertySymbols?K.concat(Object.getOwnPropertySymbols(L)):K},I.prototype.listeners=function(L){var k=b?b+L:L,K=this._events[k];if(!K)return[];if(K.fn)return[K.fn];for(var ut=0,_t=K.length,E=new Array(_t);ut<_t;ut++)E[ut]=K[ut].fn;return E},I.prototype.listenerCount=function(L){var k=b?b+L:L,K=this._events[k];return K?K.fn?1:K.length:0},I.prototype.emit=function(L,k,K,ut,_t,E){var R=b?b+L:L;if(!this._events[R])return!1;var D,F,P=this._events[R],B=arguments.length;if(P.fn){switch(P.once&&this.removeListener(L,P.fn,void 0,!0),B){case 1:return P.fn.call(P.context),!0;case 2:return P.fn.call(P.context,k),!0;case 3:return P.fn.call(P.context,k,K),!0;case 4:return P.fn.call(P.context,k,K,ut),!0;case 5:return P.fn.call(P.context,k,K,ut,_t),!0;case 6:return P.fn.call(P.context,k,K,ut,_t,E),!0}for(F=1,D=new Array(B-1);F<B;F++)D[F-1]=arguments[F];P.fn.apply(P.context,D)}else{var G,q=P.length;for(F=0;F<q;F++)switch(P[F].once&&this.removeListener(L,P[F].fn,void 0,!0),B){case 1:P[F].fn.call(P[F].context);break;case 2:P[F].fn.call(P[F].context,k);break;case 3:P[F].fn.call(P[F].context,k,K);break;case 4:P[F].fn.call(P[F].context,k,K,ut);break;default:if(!D)for(G=1,D=new Array(B-1);G<B;G++)D[G-1]=arguments[G];P[F].fn.apply(P[F].context,D)}}return!0},I.prototype.on=function(L,k,K){return S(this,L,k,K,!1)},I.prototype.once=function(L,k,K){return S(this,L,k,K,!0)},I.prototype.removeListener=function(L,k,K,ut){var _t=b?b+L:L;if(!this._events[_t])return this;if(!k)return N(this,_t),this;var E=this._events[_t];if(E.fn)E.fn!==k||ut&&!E.once||K&&E.context!==K||N(this,_t);else{for(var R=0,D=[],F=E.length;R<F;R++)(E[R].fn!==k||ut&&!E[R].once||K&&E[R].context!==K)&&D.push(E[R]);D.length?this._events[_t]=D.length===1?D[0]:D:N(this,_t)}return this},I.prototype.removeAllListeners=function(L){var k;return L?(k=b?b+L:L,this._events[k]&&N(this,k)):(this._events=new C,this._eventsCount=0),this},I.prototype.off=I.prototype.removeListener,I.prototype.addListener=I.prototype.on,I.prefixed=b,I.EventEmitter=I,m.exports=I},function(m,y,d){function x(w,ot,bt){bt=bt||2;var dt,yt,Ot,kt,Dt,te,re,$t=ot&&ot.length,pe=$t?ot[0]*bt:w.length,le=b(w,0,pe,bt,!0),Se=[];if(!le||le.next===le.prev)return Se;if($t&&(le=function(Oe,Me,Ge,nn){var fe,ge,En,je,rn,wn=[];for(fe=0,ge=Me.length;fe<ge;fe++)En=Me[fe]*nn,je=fe<ge-1?Me[fe+1]*nn:Oe.length,(rn=b(Oe,En,je,nn,!1))===rn.next&&(rn.steiner=!0),wn.push(E(rn));for(wn.sort(k),fe=0;fe<wn.length;fe++)Ge=K(wn[fe],Ge);return Ge}(w,ot,le,bt)),w.length>80*bt){dt=Ot=w[0],yt=kt=w[1];for(var ue=bt;ue<pe;ue+=bt)(Dt=w[ue])<dt&&(dt=Dt),(te=w[ue+1])<yt&&(yt=te),Dt>Ot&&(Ot=Dt),te>kt&&(kt=te);re=(re=Math.max(Ot-dt,kt-yt))!==0?32767/re:0}return T(le,Se,bt,dt,yt,re,0),Se}function b(w,ot,bt,dt,yt){var Ot,kt;if(yt===lt(w,ot,bt,dt)>0)for(Ot=ot;Ot<bt;Ot+=dt)kt=at(Ot,w[Ot],w[Ot+1],kt);else for(Ot=bt-dt;Ot>=ot;Ot-=dt)kt=at(Ot,w[Ot],w[Ot+1],kt);return kt&&P(kt,kt.next)&&($(kt),kt=kt.next),kt}function C(w,ot){if(!w)return w;ot||(ot=w);var bt,dt=w;do if(bt=!1,dt.steiner||!P(dt,dt.next)&&F(dt.prev,dt,dt.next)!==0)dt=dt.next;else{if($(dt),(dt=ot=dt.prev)===dt.next)break;bt=!0}while(bt||dt!==ot);return ot}function T(w,ot,bt,dt,yt,Ot,kt){if(w){!kt&&Ot&&function($t,pe,le,Se){var ue=$t;do ue.z===0&&(ue.z=_t(ue.x,ue.y,pe,le,Se)),ue.prevZ=ue.prev,ue.nextZ=ue.next,ue=ue.next;while(ue!==$t);ue.prevZ.nextZ=null,ue.prevZ=null,function(Oe){var Me,Ge,nn,fe,ge,En,je,rn,wn=1;do{for(Ge=Oe,Oe=null,ge=null,En=0;Ge;){for(En++,nn=Ge,je=0,Me=0;Me<wn&&(je++,nn=nn.nextZ);Me++);for(rn=wn;je>0||rn>0&&nn;)je!==0&&(rn===0||!nn||Ge.z<=nn.z)?(fe=Ge,Ge=Ge.nextZ,je--):(fe=nn,nn=nn.nextZ,rn--),ge?ge.nextZ=fe:Oe=fe,fe.prevZ=ge,ge=fe;Ge=nn}ge.nextZ=null,wn*=2}while(En>1)}(ue)}(w,dt,yt,Ot);for(var Dt,te,re=w;w.prev!==w.next;)if(Dt=w.prev,te=w.next,Ot?N(w,dt,yt,Ot):S(w))ot.push(Dt.i/bt|0),ot.push(w.i/bt|0),ot.push(te.i/bt|0),$(w),w=te.next,re=te.next;else if((w=te)===re){kt?kt===1?T(w=I(C(w),ot,bt),ot,bt,dt,yt,Ot,2):kt===2&&L(w,ot,bt,dt,yt,Ot):T(C(w),ot,bt,dt,yt,Ot,1);break}}}function S(w){var ot=w.prev,bt=w,dt=w.next;if(F(ot,bt,dt)>=0)return!1;for(var yt=ot.x,Ot=bt.x,kt=dt.x,Dt=ot.y,te=bt.y,re=dt.y,$t=yt<Ot?yt<kt?yt:kt:Ot<kt?Ot:kt,pe=Dt<te?Dt<re?Dt:re:te<re?te:re,le=yt>Ot?yt>kt?yt:kt:Ot>kt?Ot:kt,Se=Dt>te?Dt>re?Dt:re:te>re?te:re,ue=dt.next;ue!==ot;){if(ue.x>=$t&&ue.x<=le&&ue.y>=pe&&ue.y<=Se&&R(yt,Dt,Ot,te,kt,re,ue.x,ue.y)&&F(ue.prev,ue,ue.next)>=0)return!1;ue=ue.next}return!0}function N(w,ot,bt,dt){var yt=w.prev,Ot=w,kt=w.next;if(F(yt,Ot,kt)>=0)return!1;for(var Dt=yt.x,te=Ot.x,re=kt.x,$t=yt.y,pe=Ot.y,le=kt.y,Se=Dt<te?Dt<re?Dt:re:te<re?te:re,ue=$t<pe?$t<le?$t:le:pe<le?pe:le,Oe=Dt>te?Dt>re?Dt:re:te>re?te:re,Me=$t>pe?$t>le?$t:le:pe>le?pe:le,Ge=_t(Se,ue,ot,bt,dt),nn=_t(Oe,Me,ot,bt,dt),fe=w.prevZ,ge=w.nextZ;fe&&fe.z>=Ge&&ge&&ge.z<=nn;){if(fe.x>=Se&&fe.x<=Oe&&fe.y>=ue&&fe.y<=Me&&fe!==yt&&fe!==kt&&R(Dt,$t,te,pe,re,le,fe.x,fe.y)&&F(fe.prev,fe,fe.next)>=0||(fe=fe.prevZ,ge.x>=Se&&ge.x<=Oe&&ge.y>=ue&&ge.y<=Me&&ge!==yt&&ge!==kt&&R(Dt,$t,te,pe,re,le,ge.x,ge.y)&&F(ge.prev,ge,ge.next)>=0))return!1;ge=ge.nextZ}for(;fe&&fe.z>=Ge;){if(fe.x>=Se&&fe.x<=Oe&&fe.y>=ue&&fe.y<=Me&&fe!==yt&&fe!==kt&&R(Dt,$t,te,pe,re,le,fe.x,fe.y)&&F(fe.prev,fe,fe.next)>=0)return!1;fe=fe.prevZ}for(;ge&&ge.z<=nn;){if(ge.x>=Se&&ge.x<=Oe&&ge.y>=ue&&ge.y<=Me&&ge!==yt&&ge!==kt&&R(Dt,$t,te,pe,re,le,ge.x,ge.y)&&F(ge.prev,ge,ge.next)>=0)return!1;ge=ge.nextZ}return!0}function I(w,ot,bt){var dt=w;do{var yt=dt.prev,Ot=dt.next.next;!P(yt,Ot)&&B(yt,dt,dt.next,Ot)&&Rt(yt,Ot)&&Rt(Ot,yt)&&(ot.push(yt.i/bt|0),ot.push(dt.i/bt|0),ot.push(Ot.i/bt|0),$(dt),$(dt.next),dt=w=Ot),dt=dt.next}while(dt!==w);return C(dt)}function L(w,ot,bt,dt,yt,Ot){var kt=w;do{for(var Dt=kt.next.next;Dt!==kt.prev;){if(kt.i!==Dt.i&&D(kt,Dt)){var te=Xt(kt,Dt);return kt=C(kt,kt.next),te=C(te,te.next),T(kt,ot,bt,dt,yt,Ot,0),void T(te,ot,bt,dt,yt,Ot,0)}Dt=Dt.next}kt=kt.next}while(kt!==w)}function k(w,ot){return w.x-ot.x}function K(w,ot){var bt=function(yt,Ot){var kt,Dt=Ot,te=yt.x,re=yt.y,$t=-1/0;do{if(re<=Dt.y&&re>=Dt.next.y&&Dt.next.y!==Dt.y){var pe=Dt.x+(re-Dt.y)*(Dt.next.x-Dt.x)/(Dt.next.y-Dt.y);if(pe<=te&&pe>$t&&($t=pe,kt=Dt.x<Dt.next.x?Dt:Dt.next,pe===te))return kt}Dt=Dt.next}while(Dt!==Ot);if(!kt)return null;var le,Se=kt,ue=kt.x,Oe=kt.y,Me=1/0;Dt=kt;do te>=Dt.x&&Dt.x>=ue&&te!==Dt.x&&R(re<Oe?te:$t,re,ue,Oe,re<Oe?$t:te,re,Dt.x,Dt.y)&&(le=Math.abs(re-Dt.y)/(te-Dt.x),Rt(Dt,yt)&&(le<Me||le===Me&&(Dt.x>kt.x||Dt.x===kt.x&&ut(kt,Dt)))&&(kt=Dt,Me=le)),Dt=Dt.next;while(Dt!==Se);return kt}(w,ot);if(!bt)return ot;var dt=Xt(bt,w);return C(dt,dt.next),C(bt,bt.next)}function ut(w,ot){return F(w.prev,w,ot.prev)<0&&F(ot.next,w,w.next)<0}function _t(w,ot,bt,dt,yt){return(w=1431655765&((w=858993459&((w=252645135&((w=16711935&((w=(w-bt)*yt|0)|w<<8))|w<<4))|w<<2))|w<<1))|(ot=1431655765&((ot=858993459&((ot=252645135&((ot=16711935&((ot=(ot-dt)*yt|0)|ot<<8))|ot<<4))|ot<<2))|ot<<1))<<1}function E(w){var ot=w,bt=w;do(ot.x<bt.x||ot.x===bt.x&&ot.y<bt.y)&&(bt=ot),ot=ot.next;while(ot!==w);return bt}function R(w,ot,bt,dt,yt,Ot,kt,Dt){return(yt-kt)*(ot-Dt)>=(w-kt)*(Ot-Dt)&&(w-kt)*(dt-Dt)>=(bt-kt)*(ot-Dt)&&(bt-kt)*(Ot-Dt)>=(yt-kt)*(dt-Dt)}function D(w,ot){return w.next.i!==ot.i&&w.prev.i!==ot.i&&!function(bt,dt){var yt=bt;do{if(yt.i!==bt.i&&yt.next.i!==bt.i&&yt.i!==dt.i&&yt.next.i!==dt.i&&B(yt,yt.next,bt,dt))return!0;yt=yt.next}while(yt!==bt);return!1}(w,ot)&&(Rt(w,ot)&&Rt(ot,w)&&function(bt,dt){var yt=bt,Ot=!1,kt=(bt.x+dt.x)/2,Dt=(bt.y+dt.y)/2;do yt.y>Dt!=yt.next.y>Dt&&yt.next.y!==yt.y&&kt<(yt.next.x-yt.x)*(Dt-yt.y)/(yt.next.y-yt.y)+yt.x&&(Ot=!Ot),yt=yt.next;while(yt!==bt);return Ot}(w,ot)&&(F(w.prev,w,ot.prev)||F(w,ot.prev,ot))||P(w,ot)&&F(w.prev,w,w.next)>0&&F(ot.prev,ot,ot.next)>0)}function F(w,ot,bt){return(ot.y-w.y)*(bt.x-ot.x)-(ot.x-w.x)*(bt.y-ot.y)}function P(w,ot){return w.x===ot.x&&w.y===ot.y}function B(w,ot,bt,dt){var yt=q(F(w,ot,bt)),Ot=q(F(w,ot,dt)),kt=q(F(bt,dt,w)),Dt=q(F(bt,dt,ot));return yt!==Ot&&kt!==Dt||!(yt!==0||!G(w,bt,ot))||!(Ot!==0||!G(w,dt,ot))||!(kt!==0||!G(bt,w,dt))||!(Dt!==0||!G(bt,ot,dt))}function G(w,ot,bt){return ot.x<=Math.max(w.x,bt.x)&&ot.x>=Math.min(w.x,bt.x)&&ot.y<=Math.max(w.y,bt.y)&&ot.y>=Math.min(w.y,bt.y)}function q(w){return w>0?1:w<0?-1:0}function Rt(w,ot){return F(w.prev,w,w.next)<0?F(w,ot,w.next)>=0&&F(w,w.prev,ot)>=0:F(w,ot,w.prev)<0||F(w,w.next,ot)<0}function Xt(w,ot){var bt=new tt(w.i,w.x,w.y),dt=new tt(ot.i,ot.x,ot.y),yt=w.next,Ot=ot.prev;return w.next=ot,ot.prev=w,bt.next=yt,yt.prev=bt,dt.next=bt,bt.prev=dt,Ot.next=dt,dt.prev=Ot,dt}function at(w,ot,bt,dt){var yt=new tt(w,ot,bt);return dt?(yt.next=dt.next,yt.prev=dt,dt.next.prev=yt,dt.next=yt):(yt.prev=yt,yt.next=yt),yt}function $(w){w.next.prev=w.prev,w.prev.next=w.next,w.prevZ&&(w.prevZ.nextZ=w.nextZ),w.nextZ&&(w.nextZ.prevZ=w.prevZ)}function tt(w,ot,bt){this.i=w,this.x=ot,this.y=bt,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function lt(w,ot,bt,dt){for(var yt=0,Ot=ot,kt=bt-dt;Ot<bt;Ot+=dt)yt+=(w[kt]-w[Ot])*(w[Ot+1]+w[kt+1]),kt=Ot;return yt}m.exports=x,m.exports.default=x,x.deviation=function(w,ot,bt,dt){var yt=ot&&ot.length,Ot=yt?ot[0]*bt:w.length,kt=Math.abs(lt(w,0,Ot,bt));if(yt)for(var Dt=0,te=ot.length;Dt<te;Dt++){var re=ot[Dt]*bt,$t=Dt<te-1?ot[Dt+1]*bt:w.length;kt-=Math.abs(lt(w,re,$t,bt))}var pe=0;for(Dt=0;Dt<dt.length;Dt+=3){var le=dt[Dt]*bt,Se=dt[Dt+1]*bt,ue=dt[Dt+2]*bt;pe+=Math.abs((w[le]-w[ue])*(w[Se+1]-w[le+1])-(w[le]-w[Se])*(w[ue+1]-w[le+1]))}return kt===0&&pe===0?0:Math.abs((pe-kt)/kt)},x.flatten=function(w){for(var ot=w[0][0].length,bt={vertices:[],holes:[],dimensions:ot},dt=0,yt=0;yt<w.length;yt++){for(var Ot=0;Ot<w[yt].length;Ot++)for(var kt=0;kt<ot;kt++)bt.vertices.push(w[yt][Ot][kt]);yt>0&&(dt+=w[yt-1].length,bt.holes.push(dt))}return bt}},function(m,y,d){var x=d(14),b=d(118),C=d(119),T=d(120),S=d(121),N=d(122);function I(L){var k=this.__data__=new x(L);this.size=k.size}I.prototype.clear=b,I.prototype.delete=C,I.prototype.get=T,I.prototype.has=S,I.prototype.set=N,m.exports=I},function(m,y){var d=Function.prototype.toString;m.exports=function(x){if(x!=null){try{return d.call(x)}catch{}try{return x+""}catch{}}return""}},function(m,y,d){var x=d(127),b=d(134),C=d(136),T=d(137),S=d(138);function N(I){var L=-1,k=I==null?0:I.length;for(this.clear();++L<k;){var K=I[L];this.set(K[0],K[1])}}N.prototype.clear=x,N.prototype.delete=b,N.prototype.get=C,N.prototype.has=T,N.prototype.set=S,m.exports=N},function(m,y,d){var x=d(139),b=d(142),C=d(143);m.exports=function(T,S,N,I,L,k){var K=1&N,ut=T.length,_t=S.length;if(ut!=_t&&!(K&&_t>ut))return!1;var E=k.get(T),R=k.get(S);if(E&&R)return E==S&&R==T;var D=-1,F=!0,P=2&N?new x:void 0;for(k.set(T,S),k.set(S,T);++D<ut;){var B=T[D],G=S[D];if(I)var q=K?I(G,B,D,S,T,k):I(B,G,D,T,S,k);if(q!==void 0){if(q)continue;F=!1;break}if(P){if(!b(S,function(Rt,Xt){if(!C(P,Xt)&&(B===Rt||L(B,Rt,N,I,k)))return P.push(Xt)})){F=!1;break}}else if(B!==G&&!L(B,G,N,I,k)){F=!1;break}}return k.delete(T),k.delete(S),F}},function(m,y,d){var x=d(3).Uint8Array;m.exports=x},function(m,y,d){var x=d(44),b=d(25),C=d(26);m.exports=function(T){return x(T,C,b)}},function(m,y,d){var x=d(45),b=d(18);m.exports=function(C,T,S){var N=T(C);return b(C)?N:x(N,S(C))}},function(m,y){m.exports=function(d,x){for(var b=-1,C=x.length,T=d.length;++b<C;)d[T+b]=x[b];return d}},function(m,y){m.exports=function(){return[]}},function(m,y,d){var x=d(149),b=d(150),C=d(18),T=d(27),S=d(153),N=d(48),I=Object.prototype.hasOwnProperty;m.exports=function(L,k){var K=C(L),ut=!K&&b(L),_t=!K&&!ut&&T(L),E=!K&&!ut&&!_t&&N(L),R=K||ut||_t||E,D=R?x(L.length,String):[],F=D.length;for(var P in L)!k&&!I.call(L,P)||R&&(P=="length"||_t&&(P=="offset"||P=="parent")||E&&(P=="buffer"||P=="byteLength"||P=="byteOffset")||S(P,F))||D.push(P);return D}},function(m,y,d){var x=d(154),b=d(28),C=d(29),T=C&&C.isTypedArray,S=T?b(T):x;m.exports=S},function(m,y){m.exports=function(d){return typeof d=="number"&&d>-1&&d%1==0&&d<=9007199254740991}},function(m,y){m.exports=function(d,x){return function(b){return d(x(b))}}},function(m,y,d){var x=d(21),b=d(49);m.exports=function(C){return C!=null&&b(C.length)&&!x(C)}},function(m,y,d){var x=d(53),b=d(23),C=Object.prototype.hasOwnProperty;m.exports=function(T,S,N){var I=T[S];C.call(T,S)&&b(I,N)&&(N!==void 0||S in T)||x(T,S,N)}},function(m,y,d){var x=d(163);m.exports=function(b,C,T){C=="__proto__"&&x?x(b,C,{configurable:!0,enumerable:!0,value:T,writable:!0}):b[C]=T}},function(m,y,d){var x=d(45),b=d(55),C=d(25),T=d(46),S=Object.getOwnPropertySymbols?function(N){for(var I=[];N;)x(I,C(N)),N=b(N);return I}:T;m.exports=S},function(m,y,d){var x=d(50)(Object.getPrototypeOf,Object);m.exports=x},function(m,y){m.exports=`varying vec2 vUv;
|
|
3
3
|
void main() {
|
|
4
4
|
vUv = uv;
|
|
5
5
|
gl_Position = (projectionMatrix * modelViewMatrix) * vec4(position, 1.0);
|
|
@@ -1903,7 +1903,7 @@ void main() {
|
|
|
1903
1903
|
}
|
|
1904
1904
|
gl_FragColor = blendSrcOver(srcColor, distColor);
|
|
1905
1905
|
}
|
|
1906
|
-
`},function(m,y,d){var x=d(6),b=d(4);m.exports=function(
|
|
1906
|
+
`},function(m,y,d){var x=d(6),b=d(4);m.exports=function(C){return C===!0||C===!1||b(C)&&x(C)=="[object Boolean]"}},function(m,y,d){(function(x){var b;/*!
|
|
1907
1907
|
* howler.js v2.2.3
|
|
1908
1908
|
* howlerjs.com
|
|
1909
1909
|
*
|
|
@@ -1911,7 +1911,7 @@ void main() {
|
|
|
1911
1911
|
* goldfirestudios.com
|
|
1912
1912
|
*
|
|
1913
1913
|
* MIT License
|
|
1914
|
-
*/(function(){var R=function(){this.init()};R.prototype={init:function(){var E=this||T;return E._counter=1e3,E._html5AudioPool=[],E.html5PoolSize=10,E._codecs={},E._howls=[],E._muted=!1,E._volume=1,E._canPlayEvent="canplaythrough",E._navigator=typeof window!="undefined"&&window.navigator?window.navigator:null,E.masterGain=null,E.noAudio=!1,E.usingWebAudio=!0,E.autoSuspend=!0,E.ctx=null,E.autoUnlock=!0,E._setup(),E},volume:function(E){var I=this||T;if(E=parseFloat(E),I.ctx||_t(),E!==void 0&&E>=0&&E<=1){if(I._volume=E,I._muted)return I;I.usingWebAudio&&I.masterGain.gain.setValueAtTime(E,T.ctx.currentTime);for(var D=0;D<I._howls.length;D++)if(!I._howls[D]._webAudio)for(var F=I._howls[D]._getSoundIds(),P=0;P<F.length;P++){var B=I._howls[D]._soundById(F[P]);B&&B._node&&(B._node.volume=B._volume*E)}return I}return I._volume},mute:function(E){var I=this||T;I.ctx||_t(),I._muted=E,I.usingWebAudio&&I.masterGain.gain.setValueAtTime(E?0:I._volume,T.ctx.currentTime);for(var D=0;D<I._howls.length;D++)if(!I._howls[D]._webAudio)for(var F=I._howls[D]._getSoundIds(),P=0;P<F.length;P++){var B=I._howls[D]._soundById(F[P]);B&&B._node&&(B._node.muted=!!E||B._muted)}return I},stop:function(){for(var E=this||T,I=0;I<E._howls.length;I++)E._howls[I].stop();return E},unload:function(){for(var E=this||T,I=E._howls.length-1;I>=0;I--)E._howls[I].unload();return E.usingWebAudio&&E.ctx&&E.ctx.close!==void 0&&(E.ctx.close(),E.ctx=null,_t()),E},codecs:function(E){return(this||T)._codecs[E.replace(/^x-/,"")]},_setup:function(){var E=this||T;if(E.state=E.ctx&&E.ctx.state||"suspended",E._autoSuspend(),!E.usingWebAudio)if(typeof Audio!="undefined")try{new Audio().oncanplaythrough===void 0&&(E._canPlayEvent="canplay")}catch{E.noAudio=!0}else E.noAudio=!0;try{new Audio().muted&&(E.noAudio=!0)}catch{}return E.noAudio||E._setupCodecs(),E},_setupCodecs:function(){var E=this||T,I=null;try{I=typeof Audio!="undefined"?new Audio:null}catch{return E}if(!I||typeof I.canPlayType!="function")return E;var D=I.canPlayType("audio/mpeg;").replace(/^no$/,""),F=E._navigator?E._navigator.userAgent:"",P=F.match(/OPR\/([0-6].)/g),B=P&&parseInt(P[0].split("/")[1],10)<33,G=F.indexOf("Safari")!==-1&&F.indexOf("Chrome")===-1,q=F.match(/Version\/(.*?) /),Rt=G&&q&&parseInt(q[1],10)<15;return E._codecs={mp3:!(B||!D&&!I.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!D,opus:!!I.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!I.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!I.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(I.canPlayType('audio/wav; codecs="1"')||I.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!I.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!I.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(I.canPlayType("audio/x-m4a;")||I.canPlayType("audio/m4a;")||I.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(I.canPlayType("audio/x-m4b;")||I.canPlayType("audio/m4b;")||I.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(I.canPlayType("audio/x-mp4;")||I.canPlayType("audio/mp4;")||I.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(Rt||!I.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(Rt||!I.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!I.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(I.canPlayType("audio/x-flac;")||I.canPlayType("audio/flac;")).replace(/^no$/,"")},E},_unlockAudio:function(){var E=this||T;if(!E._audioUnlocked&&E.ctx){E._audioUnlocked=!1,E.autoUnlock=!1,E._mobileUnloaded||E.ctx.sampleRate===44100||(E._mobileUnloaded=!0,E.unload()),E._scratchBuffer=E.ctx.createBuffer(1,1,22050);var I=function(D){for(;E._html5AudioPool.length<E.html5PoolSize;)try{var F=new Audio;F._unlocked=!0,E._releaseHtml5Audio(F)}catch{E.noAudio=!0;break}for(var P=0;P<E._howls.length;P++)if(!E._howls[P]._webAudio)for(var B=E._howls[P]._getSoundIds(),G=0;G<B.length;G++){var q=E._howls[P]._soundById(B[G]);q&&q._node&&!q._node._unlocked&&(q._node._unlocked=!0,q._node.load())}E._autoResume();var Rt=E.ctx.createBufferSource();Rt.buffer=E._scratchBuffer,Rt.connect(E.ctx.destination),Rt.start===void 0?Rt.noteOn(0):Rt.start(0),typeof E.ctx.resume=="function"&&E.ctx.resume(),Rt.onended=function(){Rt.disconnect(0),E._audioUnlocked=!0,document.removeEventListener("touchstart",I,!0),document.removeEventListener("touchend",I,!0),document.removeEventListener("click",I,!0),document.removeEventListener("keydown",I,!0);for(var Xt=0;Xt<E._howls.length;Xt++)E._howls[Xt]._emit("unlock")}};return document.addEventListener("touchstart",I,!0),document.addEventListener("touchend",I,!0),document.addEventListener("click",I,!0),document.addEventListener("keydown",I,!0),E}},_obtainHtml5Audio:function(){var E=this||T;if(E._html5AudioPool.length)return E._html5AudioPool.pop();var I=new Audio().play();return I&&typeof Promise!="undefined"&&(I instanceof Promise||typeof I.then=="function")&&I.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(E){var I=this||T;return E._unlocked&&I._html5AudioPool.push(E),I},_autoSuspend:function(){var E=this;if(E.autoSuspend&&E.ctx&&E.ctx.suspend!==void 0&&T.usingWebAudio){for(var I=0;I<E._howls.length;I++)if(E._howls[I]._webAudio){for(var D=0;D<E._howls[I]._sounds.length;D++)if(!E._howls[I]._sounds[D]._paused)return E}return E._suspendTimer&&clearTimeout(E._suspendTimer),E._suspendTimer=setTimeout(function(){if(E.autoSuspend){E._suspendTimer=null,E.state="suspending";var F=function(){E.state="suspended",E._resumeAfterSuspend&&(delete E._resumeAfterSuspend,E._autoResume())};E.ctx.suspend().then(F,F)}},3e4),E}},_autoResume:function(){var E=this;if(E.ctx&&E.ctx.resume!==void 0&&T.usingWebAudio)return E.state==="running"&&E.ctx.state!=="interrupted"&&E._suspendTimer?(clearTimeout(E._suspendTimer),E._suspendTimer=null):E.state==="suspended"||E.state==="running"&&E.ctx.state==="interrupted"?(E.ctx.resume().then(function(){E.state="running";for(var I=0;I<E._howls.length;I++)E._howls[I]._emit("resume")}),E._suspendTimer&&(clearTimeout(E._suspendTimer),E._suspendTimer=null)):E.state==="suspending"&&(E._resumeAfterSuspend=!0),E}};var T=new R,S=function(E){E.src&&E.src.length!==0?this.init(E):console.error("An array of source files must be passed with any new Howl.")};S.prototype={init:function(E){var I=this;return T.ctx||_t(),I._autoplay=E.autoplay||!1,I._format=typeof E.format!="string"?E.format:[E.format],I._html5=E.html5||!1,I._muted=E.mute||!1,I._loop=E.loop||!1,I._pool=E.pool||5,I._preload=typeof E.preload!="boolean"&&E.preload!=="metadata"||E.preload,I._rate=E.rate||1,I._sprite=E.sprite||{},I._src=typeof E.src!="string"?E.src:[E.src],I._volume=E.volume!==void 0?E.volume:1,I._xhr={method:E.xhr&&E.xhr.method?E.xhr.method:"GET",headers:E.xhr&&E.xhr.headers?E.xhr.headers:null,withCredentials:!(!E.xhr||!E.xhr.withCredentials)&&E.xhr.withCredentials},I._duration=0,I._state="unloaded",I._sounds=[],I._endTimers={},I._queue=[],I._playLock=!1,I._onend=E.onend?[{fn:E.onend}]:[],I._onfade=E.onfade?[{fn:E.onfade}]:[],I._onload=E.onload?[{fn:E.onload}]:[],I._onloaderror=E.onloaderror?[{fn:E.onloaderror}]:[],I._onplayerror=E.onplayerror?[{fn:E.onplayerror}]:[],I._onpause=E.onpause?[{fn:E.onpause}]:[],I._onplay=E.onplay?[{fn:E.onplay}]:[],I._onstop=E.onstop?[{fn:E.onstop}]:[],I._onmute=E.onmute?[{fn:E.onmute}]:[],I._onvolume=E.onvolume?[{fn:E.onvolume}]:[],I._onrate=E.onrate?[{fn:E.onrate}]:[],I._onseek=E.onseek?[{fn:E.onseek}]:[],I._onunlock=E.onunlock?[{fn:E.onunlock}]:[],I._onresume=[],I._webAudio=T.usingWebAudio&&!I._html5,T.ctx!==void 0&&T.ctx&&T.autoUnlock&&T._unlockAudio(),T._howls.push(I),I._autoplay&&I._queue.push({event:"play",action:function(){I.play()}}),I._preload&&I._preload!=="none"&&I.load(),I},load:function(){var E=null;if(T.noAudio)this._emit("loaderror",null,"No audio support.");else{typeof this._src=="string"&&(this._src=[this._src]);for(var I=0;I<this._src.length;I++){var D,F;if(this._format&&this._format[I])D=this._format[I];else{if(typeof(F=this._src[I])!="string"){this._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}(D=/^data:audio\/([^;,]+);/i.exec(F))||(D=/\.([^.]+)$/.exec(F.split("?",1)[0])),D&&(D=D[1].toLowerCase())}if(D||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),D&&T.codecs(D)){E=this._src[I];break}}if(E)return this._src=E,this._state="loading",window.location.protocol==="https:"&&E.slice(0,5)==="http:"&&(this._html5=!0,this._webAudio=!1),new N(this),this._webAudio&&L(this),this;this._emit("loaderror",null,"No codec support for selected audio sources.")}},play:function(E,I){var D=this,F=null;if(typeof E=="number")F=E,E=null;else{if(typeof E=="string"&&D._state==="loaded"&&!D._sprite[E])return null;if(E===void 0&&(E="__default",!D._playLock)){for(var P=0,B=0;B<D._sounds.length;B++)D._sounds[B]._paused&&!D._sounds[B]._ended&&(P++,F=D._sounds[B]._id);P===1?E=null:F=null}}var G=F?D._soundById(F):D._inactiveSound();if(!G)return null;if(F&&!E&&(E=G._sprite||"__default"),D._state!=="loaded"){G._sprite=E,G._ended=!1;var q=G._id;return D._queue.push({event:"play",action:function(){D.play(q)}}),q}if(F&&!G._paused)return I||D._loadQueue("play"),G._id;D._webAudio&&T._autoResume();var Rt=Math.max(0,G._seek>0?G._seek:D._sprite[E][0]/1e3),Xt=Math.max(0,(D._sprite[E][0]+D._sprite[E][1])/1e3-Rt),at=1e3*Xt/Math.abs(G._rate),$=D._sprite[E][0]/1e3,tt=(D._sprite[E][0]+D._sprite[E][1])/1e3;G._sprite=E,G._ended=!1;var lt=function(){G._paused=!1,G._seek=Rt,G._start=$,G._stop=tt,G._loop=!(!G._loop&&!D._sprite[E][2])};if(!(Rt>=tt)){var w=G._node;if(D._webAudio){var ot=function(){D._playLock=!1,lt(),D._refreshBuffer(G);var Ot=G._muted||D._muted?0:G._volume;w.gain.setValueAtTime(Ot,T.ctx.currentTime),G._playStart=T.ctx.currentTime,w.bufferSource.start===void 0?G._loop?w.bufferSource.noteGrainOn(0,Rt,86400):w.bufferSource.noteGrainOn(0,Rt,Xt):G._loop?w.bufferSource.start(0,Rt,86400):w.bufferSource.start(0,Rt,Xt),at!==1/0&&(D._endTimers[G._id]=setTimeout(D._ended.bind(D,G),at)),I||setTimeout(function(){D._emit("play",G._id),D._loadQueue()},0)};T.state==="running"&&T.ctx.state!=="interrupted"?ot():(D._playLock=!0,D.once("resume",ot),D._clearTimer(G._id))}else{var bt=function(){w.currentTime=Rt,w.muted=G._muted||D._muted||T._muted||w.muted,w.volume=G._volume*T.volume(),w.playbackRate=G._rate;try{var Ot=w.play();if(Ot&&typeof Promise!="undefined"&&(Ot instanceof Promise||typeof Ot.then=="function")?(D._playLock=!0,lt(),Ot.then(function(){D._playLock=!1,w._unlocked=!0,I?D._loadQueue():D._emit("play",G._id)}).catch(function(){D._playLock=!1,D._emit("playerror",G._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),G._ended=!0,G._paused=!0})):I||(D._playLock=!1,lt(),D._emit("play",G._id)),w.playbackRate=G._rate,w.paused)return void D._emit("playerror",G._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");E!=="__default"||G._loop?D._endTimers[G._id]=setTimeout(D._ended.bind(D,G),at):(D._endTimers[G._id]=function(){D._ended(G),w.removeEventListener("ended",D._endTimers[G._id],!1)},w.addEventListener("ended",D._endTimers[G._id],!1))}catch(kt){D._emit("playerror",G._id,kt)}};w.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&(w.src=D._src,w.load());var dt=window&&window.ejecta||!w.readyState&&T._navigator.isCocoonJS;if(w.readyState>=3||dt)bt();else{D._playLock=!0,D._state="loading";var yt=function(){D._state="loaded",bt(),w.removeEventListener(T._canPlayEvent,yt,!1)};w.addEventListener(T._canPlayEvent,yt,!1),D._clearTimer(G._id)}}return G._id}D._ended(G)},pause:function(E){var I=this;if(I._state!=="loaded"||I._playLock)return I._queue.push({event:"pause",action:function(){I.pause(E)}}),I;for(var D=I._getSoundIds(E),F=0;F<D.length;F++){I._clearTimer(D[F]);var P=I._soundById(D[F]);if(P&&!P._paused&&(P._seek=I.seek(D[F]),P._rateSeek=0,P._paused=!0,I._stopFade(D[F]),P._node))if(I._webAudio){if(!P._node.bufferSource)continue;P._node.bufferSource.stop===void 0?P._node.bufferSource.noteOff(0):P._node.bufferSource.stop(0),I._cleanBuffer(P._node)}else isNaN(P._node.duration)&&P._node.duration!==1/0||P._node.pause();arguments[1]||I._emit("pause",P?P._id:null)}return I},stop:function(E,I){var D=this;if(D._state!=="loaded"||D._playLock)return D._queue.push({event:"stop",action:function(){D.stop(E)}}),D;for(var F=D._getSoundIds(E),P=0;P<F.length;P++){D._clearTimer(F[P]);var B=D._soundById(F[P]);B&&(B._seek=B._start||0,B._rateSeek=0,B._paused=!0,B._ended=!0,D._stopFade(F[P]),B._node&&(D._webAudio?B._node.bufferSource&&(B._node.bufferSource.stop===void 0?B._node.bufferSource.noteOff(0):B._node.bufferSource.stop(0),D._cleanBuffer(B._node)):isNaN(B._node.duration)&&B._node.duration!==1/0||(B._node.currentTime=B._start||0,B._node.pause(),B._node.duration===1/0&&D._clearSound(B._node))),I||D._emit("stop",B._id))}return D},mute:function(E,I){var D=this;if(D._state!=="loaded"||D._playLock)return D._queue.push({event:"mute",action:function(){D.mute(E,I)}}),D;if(I===void 0){if(typeof E!="boolean")return D._muted;D._muted=E}for(var F=D._getSoundIds(I),P=0;P<F.length;P++){var B=D._soundById(F[P]);B&&(B._muted=E,B._interval&&D._stopFade(B._id),D._webAudio&&B._node?B._node.gain.setValueAtTime(E?0:B._volume,T.ctx.currentTime):B._node&&(B._node.muted=!!T._muted||E),D._emit("mute",B._id))}return D},volume:function(){var E,I,D,F=this,P=arguments;if(P.length===0)return F._volume;if(P.length===1||P.length===2&&P[1]===void 0){var B=F._getSoundIds(),G=B.indexOf(P[0]);G>=0?I=parseInt(P[0],10):E=parseFloat(P[0])}else P.length>=2&&(E=parseFloat(P[0]),I=parseInt(P[1],10));if(!(E!==void 0&&E>=0&&E<=1))return(D=I?F._soundById(I):F._sounds[0])?D._volume:0;if(F._state!=="loaded"||F._playLock)return F._queue.push({event:"volume",action:function(){F.volume.apply(F,P)}}),F;I===void 0&&(F._volume=E),I=F._getSoundIds(I);for(var q=0;q<I.length;q++)(D=F._soundById(I[q]))&&(D._volume=E,P[2]||F._stopFade(I[q]),F._webAudio&&D._node&&!D._muted?D._node.gain.setValueAtTime(E,T.ctx.currentTime):D._node&&!D._muted&&(D._node.volume=E*T.volume()),F._emit("volume",D._id));return F},fade:function(E,I,D,F){var P=this;if(P._state!=="loaded"||P._playLock)return P._queue.push({event:"fade",action:function(){P.fade(E,I,D,F)}}),P;E=Math.min(Math.max(0,parseFloat(E)),1),I=Math.min(Math.max(0,parseFloat(I)),1),D=parseFloat(D),P.volume(E,F);for(var B=P._getSoundIds(F),G=0;G<B.length;G++){var q=P._soundById(B[G]);if(q){if(F||P._stopFade(B[G]),P._webAudio&&!q._muted){var Rt=T.ctx.currentTime,Xt=Rt+D/1e3;q._volume=E,q._node.gain.setValueAtTime(E,Rt),q._node.gain.linearRampToValueAtTime(I,Xt)}P._startFadeInterval(q,E,I,D,B[G],F===void 0)}}return P},_startFadeInterval:function(E,I,D,F,P,B){var G=this,q=I,Rt=D-I,Xt=Math.abs(Rt/.01),at=Math.max(4,Xt>0?F/Xt:F),$=Date.now();E._fadeTo=D,E._interval=setInterval(function(){var tt=(Date.now()-$)/F;$=Date.now(),q+=Rt*tt,q=Math.round(100*q)/100,q=Rt<0?Math.max(D,q):Math.min(D,q),G._webAudio?E._volume=q:G.volume(q,E._id,!0),B&&(G._volume=q),(D<I&&q<=D||D>I&&q>=D)&&(clearInterval(E._interval),E._interval=null,E._fadeTo=null,G.volume(D,E._id),G._emit("fade",E._id))},at)},_stopFade:function(E){var I=this._soundById(E);return I&&I._interval&&(this._webAudio&&I._node.gain.cancelScheduledValues(T.ctx.currentTime),clearInterval(I._interval),I._interval=null,this.volume(I._fadeTo,E),I._fadeTo=null,this._emit("fade",E)),this},loop:function(){var E,I,D,F=this,P=arguments;if(P.length===0)return F._loop;if(P.length===1){if(typeof P[0]!="boolean")return!!(D=F._soundById(parseInt(P[0],10)))&&D._loop;E=P[0],F._loop=E}else P.length===2&&(E=P[0],I=parseInt(P[1],10));for(var B=F._getSoundIds(I),G=0;G<B.length;G++)(D=F._soundById(B[G]))&&(D._loop=E,F._webAudio&&D._node&&D._node.bufferSource&&(D._node.bufferSource.loop=E,E&&(D._node.bufferSource.loopStart=D._start||0,D._node.bufferSource.loopEnd=D._stop,F.playing(B[G])&&(F.pause(B[G],!0),F.play(B[G],!0)))));return F},rate:function(){var E,I,D,F=this,P=arguments;if(P.length===0)I=F._sounds[0]._id;else if(P.length===1){var B=F._getSoundIds(),G=B.indexOf(P[0]);G>=0?I=parseInt(P[0],10):E=parseFloat(P[0])}else P.length===2&&(E=parseFloat(P[0]),I=parseInt(P[1],10));if(typeof E!="number")return(D=F._soundById(I))?D._rate:F._rate;if(F._state!=="loaded"||F._playLock)return F._queue.push({event:"rate",action:function(){F.rate.apply(F,P)}}),F;I===void 0&&(F._rate=E),I=F._getSoundIds(I);for(var q=0;q<I.length;q++)if(D=F._soundById(I[q])){F.playing(I[q])&&(D._rateSeek=F.seek(I[q]),D._playStart=F._webAudio?T.ctx.currentTime:D._playStart),D._rate=E,F._webAudio&&D._node&&D._node.bufferSource?D._node.bufferSource.playbackRate.setValueAtTime(E,T.ctx.currentTime):D._node&&(D._node.playbackRate=E);var Rt=F.seek(I[q]),Xt=(F._sprite[D._sprite][0]+F._sprite[D._sprite][1])/1e3-Rt,at=1e3*Xt/Math.abs(D._rate);!F._endTimers[I[q]]&&D._paused||(F._clearTimer(I[q]),F._endTimers[I[q]]=setTimeout(F._ended.bind(F,D),at)),F._emit("rate",D._id)}return F},seek:function(){var E,I,D=this,F=arguments;if(F.length===0)D._sounds.length&&(I=D._sounds[0]._id);else if(F.length===1){var P=D._getSoundIds(),B=P.indexOf(F[0]);B>=0?I=parseInt(F[0],10):D._sounds.length&&(I=D._sounds[0]._id,E=parseFloat(F[0]))}else F.length===2&&(E=parseFloat(F[0]),I=parseInt(F[1],10));if(I===void 0)return 0;if(typeof E=="number"&&(D._state!=="loaded"||D._playLock))return D._queue.push({event:"seek",action:function(){D.seek.apply(D,F)}}),D;var G=D._soundById(I);if(G){if(!(typeof E=="number"&&E>=0)){if(D._webAudio){var q=D.playing(I)?T.ctx.currentTime-G._playStart:0,Rt=G._rateSeek?G._rateSeek-G._seek:0;return G._seek+(Rt+q*Math.abs(G._rate))}return G._node.currentTime}var Xt=D.playing(I);Xt&&D.pause(I,!0),G._seek=E,G._ended=!1,D._clearTimer(I),D._webAudio||!G._node||isNaN(G._node.duration)||(G._node.currentTime=E);var at=function(){Xt&&D.play(I,!0),D._emit("seek",I)};if(Xt&&!D._webAudio){var $=function(){D._playLock?setTimeout($,0):at()};setTimeout($,0)}else at()}return D},playing:function(E){if(typeof E=="number"){var I=this._soundById(E);return!!I&&!I._paused}for(var D=0;D<this._sounds.length;D++)if(!this._sounds[D]._paused)return!0;return!1},duration:function(E){var I=this._duration,D=this._soundById(E);return D&&(I=this._sprite[D._sprite][1]/1e3),I},state:function(){return this._state},unload:function(){for(var E=this,I=E._sounds,D=0;D<I.length;D++)I[D]._paused||E.stop(I[D]._id),E._webAudio||(E._clearSound(I[D]._node),I[D]._node.removeEventListener("error",I[D]._errorFn,!1),I[D]._node.removeEventListener(T._canPlayEvent,I[D]._loadFn,!1),I[D]._node.removeEventListener("ended",I[D]._endFn,!1),T._releaseHtml5Audio(I[D]._node)),delete I[D]._node,E._clearTimer(I[D]._id);var F=T._howls.indexOf(E);F>=0&&T._howls.splice(F,1);var P=!0;for(D=0;D<T._howls.length;D++)if(T._howls[D]._src===E._src||E._src.indexOf(T._howls[D]._src)>=0){P=!1;break}return C&&P&&delete C[E._src],T.noAudio=!1,E._state="unloaded",E._sounds=[],E=null,null},on:function(E,I,D,F){var P=this["_on"+E];return typeof I=="function"&&P.push(F?{id:D,fn:I,once:F}:{id:D,fn:I}),this},off:function(E,I,D){var F=this["_on"+E],P=0;if(typeof I=="number"&&(D=I,I=null),I||D)for(P=0;P<F.length;P++){var B=D===F[P].id;if(I===F[P].fn&&B||!I&&B){F.splice(P,1);break}}else if(E)this["_on"+E]=[];else{var G=Object.keys(this);for(P=0;P<G.length;P++)G[P].indexOf("_on")===0&&Array.isArray(this[G[P]])&&(this[G[P]]=[])}return this},once:function(E,I,D){return this.on(E,I,D,1),this},_emit:function(E,I,D){for(var F=this["_on"+E],P=F.length-1;P>=0;P--)F[P].id&&F[P].id!==I&&E!=="load"||(setTimeout(function(B){B.call(this,I,D)}.bind(this,F[P].fn),0),F[P].once&&this.off(E,F[P].fn,F[P].id));return this._loadQueue(E),this},_loadQueue:function(E){if(this._queue.length>0){var I=this._queue[0];I.event===E&&(this._queue.shift(),this._loadQueue()),E||I.action()}return this},_ended:function(E){var I=E._sprite;if(!this._webAudio&&E._node&&!E._node.paused&&!E._node.ended&&E._node.currentTime<E._stop)return setTimeout(this._ended.bind(this,E),100),this;var D=!(!E._loop&&!this._sprite[I][2]);if(this._emit("end",E._id),!this._webAudio&&D&&this.stop(E._id,!0).play(E._id),this._webAudio&&D){this._emit("play",E._id),E._seek=E._start||0,E._rateSeek=0,E._playStart=T.ctx.currentTime;var F=1e3*(E._stop-E._start)/Math.abs(E._rate);this._endTimers[E._id]=setTimeout(this._ended.bind(this,E),F)}return this._webAudio&&!D&&(E._paused=!0,E._ended=!0,E._seek=E._start||0,E._rateSeek=0,this._clearTimer(E._id),this._cleanBuffer(E._node),T._autoSuspend()),this._webAudio||D||this.stop(E._id,!0),this},_clearTimer:function(E){if(this._endTimers[E]){if(typeof this._endTimers[E]!="function")clearTimeout(this._endTimers[E]);else{var I=this._soundById(E);I&&I._node&&I._node.removeEventListener("ended",this._endTimers[E],!1)}delete this._endTimers[E]}return this},_soundById:function(E){for(var I=0;I<this._sounds.length;I++)if(E===this._sounds[I]._id)return this._sounds[I];return null},_inactiveSound:function(){this._drain();for(var E=0;E<this._sounds.length;E++)if(this._sounds[E]._ended)return this._sounds[E].reset();return new N(this)},_drain:function(){var E=this._pool,I=0,D=0;if(!(this._sounds.length<E)){for(D=0;D<this._sounds.length;D++)this._sounds[D]._ended&&I++;for(D=this._sounds.length-1;D>=0;D--){if(I<=E)return;this._sounds[D]._ended&&(this._webAudio&&this._sounds[D]._node&&this._sounds[D]._node.disconnect(0),this._sounds.splice(D,1),I--)}}},_getSoundIds:function(E){if(E===void 0){for(var I=[],D=0;D<this._sounds.length;D++)I.push(this._sounds[D]._id);return I}return[E]},_refreshBuffer:function(E){return E._node.bufferSource=T.ctx.createBufferSource(),E._node.bufferSource.buffer=C[this._src],E._panner?E._node.bufferSource.connect(E._panner):E._node.bufferSource.connect(E._node),E._node.bufferSource.loop=E._loop,E._loop&&(E._node.bufferSource.loopStart=E._start||0,E._node.bufferSource.loopEnd=E._stop||0),E._node.bufferSource.playbackRate.setValueAtTime(E._rate,T.ctx.currentTime),this},_cleanBuffer:function(E){var I=T._navigator&&T._navigator.vendor.indexOf("Apple")>=0;if(T._scratchBuffer&&E.bufferSource&&(E.bufferSource.onended=null,E.bufferSource.disconnect(0),I))try{E.bufferSource.buffer=T._scratchBuffer}catch{}return E.bufferSource=null,this},_clearSound:function(E){/MSIE |Trident\//.test(T._navigator&&T._navigator.userAgent)||(E.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var N=function(E){this._parent=E,this.init()};N.prototype={init:function(){var E=this._parent;return this._muted=E._muted,this._loop=E._loop,this._volume=E._volume,this._rate=E._rate,this._seek=0,this._paused=!0,this._ended=!0,this._sprite="__default",this._id=++T._counter,E._sounds.push(this),this.create(),this},create:function(){var E=this._parent,I=T._muted||this._muted||this._parent._muted?0:this._volume;return E._webAudio?(this._node=T.ctx.createGain===void 0?T.ctx.createGainNode():T.ctx.createGain(),this._node.gain.setValueAtTime(I,T.ctx.currentTime),this._node.paused=!0,this._node.connect(T.masterGain)):T.noAudio||(this._node=T._obtainHtml5Audio(),this._errorFn=this._errorListener.bind(this),this._node.addEventListener("error",this._errorFn,!1),this._loadFn=this._loadListener.bind(this),this._node.addEventListener(T._canPlayEvent,this._loadFn,!1),this._endFn=this._endListener.bind(this),this._node.addEventListener("ended",this._endFn,!1),this._node.src=E._src,this._node.preload=E._preload===!0?"auto":E._preload,this._node.volume=I*T.volume(),this._node.load()),this},reset:function(){var E=this._parent;return this._muted=E._muted,this._loop=E._loop,this._volume=E._volume,this._rate=E._rate,this._seek=0,this._rateSeek=0,this._paused=!0,this._ended=!0,this._sprite="__default",this._id=++T._counter,this},_errorListener:function(){this._parent._emit("loaderror",this._id,this._node.error?this._node.error.code:0),this._node.removeEventListener("error",this._errorFn,!1)},_loadListener:function(){var E=this._parent;E._duration=Math.ceil(10*this._node.duration)/10,Object.keys(E._sprite).length===0&&(E._sprite={__default:[0,1e3*E._duration]}),E._state!=="loaded"&&(E._state="loaded",E._emit("load"),E._loadQueue()),this._node.removeEventListener(T._canPlayEvent,this._loadFn,!1)},_endListener:function(){var E=this._parent;E._duration===1/0&&(E._duration=Math.ceil(10*this._node.duration)/10,E._sprite.__default[1]===1/0&&(E._sprite.__default[1]=1e3*E._duration),E._ended(this)),this._node.removeEventListener("ended",this._endFn,!1)}};var C={},L=function(E){var I=E._src;if(C[I])return E._duration=C[I].duration,void ut(E);if(/^data:[^;]+;base64,/.test(I)){for(var D=atob(I.split(",")[1]),F=new Uint8Array(D.length),P=0;P<D.length;++P)F[P]=D.charCodeAt(P);K(F.buffer,E)}else{var B=new XMLHttpRequest;B.open(E._xhr.method,I,!0),B.withCredentials=E._xhr.withCredentials,B.responseType="arraybuffer",E._xhr.headers&&Object.keys(E._xhr.headers).forEach(function(G){B.setRequestHeader(G,E._xhr.headers[G])}),B.onload=function(){var G=(B.status+"")[0];G==="0"||G==="2"||G==="3"?K(B.response,E):E._emit("loaderror",null,"Failed loading audio file with status: "+B.status+".")},B.onerror=function(){E._webAudio&&(E._html5=!0,E._webAudio=!1,E._sounds=[],delete C[I],E.load())},k(B)}},k=function(E){try{E.send()}catch{E.onerror()}},K=function(E,I){var D=function(){I._emit("loaderror",null,"Decoding audio data failed.")},F=function(P){P&&I._sounds.length>0?(C[I._src]=P,ut(I,P)):D()};typeof Promise!="undefined"&&T.ctx.decodeAudioData.length===1?T.ctx.decodeAudioData(E).then(F).catch(D):T.ctx.decodeAudioData(E,F,D)},ut=function(E,I){I&&!E._duration&&(E._duration=I.duration),Object.keys(E._sprite).length===0&&(E._sprite={__default:[0,1e3*E._duration]}),E._state!=="loaded"&&(E._state="loaded",E._emit("load"),E._loadQueue())},_t=function(){if(T.usingWebAudio){try{typeof AudioContext!="undefined"?T.ctx=new AudioContext:typeof webkitAudioContext!="undefined"?T.ctx=new webkitAudioContext:T.usingWebAudio=!1}catch{T.usingWebAudio=!1}T.ctx||(T.usingWebAudio=!1);var E=/iP(hone|od|ad)/.test(T._navigator&&T._navigator.platform),I=T._navigator&&T._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),D=I?parseInt(I[1],10):null;if(E&&D&&D<9){var F=/safari/.test(T._navigator&&T._navigator.userAgent.toLowerCase());T._navigator&&!F&&(T.usingWebAudio=!1)}T.usingWebAudio&&(T.masterGain=T.ctx.createGain===void 0?T.ctx.createGainNode():T.ctx.createGain(),T.masterGain.gain.setValueAtTime(T._muted?0:T._volume,T.ctx.currentTime),T.masterGain.connect(T.ctx.destination)),T._setup()}};(b=function(){return{Howler:T,Howl:S}}.apply(y,[]))===void 0||(m.exports=b),y.Howler=T,y.Howl=S,x!==void 0?(x.HowlerGlobal=R,x.Howler=T,x.Howl=S,x.Sound=N):typeof window!="undefined"&&(window.HowlerGlobal=R,window.Howler=T,window.Howl=S,window.Sound=N)})(),function(){var R;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(S){if(!this.ctx||!this.ctx.listener)return this;for(var N=this._howls.length-1;N>=0;N--)this._howls[N].stereo(S);return this},HowlerGlobal.prototype.pos=function(S,N,C){return this.ctx&&this.ctx.listener?(N=typeof N!="number"?this._pos[1]:N,C=typeof C!="number"?this._pos[2]:C,typeof S!="number"?this._pos:(this._pos=[S,N,C],this.ctx.listener.positionX!==void 0?(this.ctx.listener.positionX.setTargetAtTime(this._pos[0],Howler.ctx.currentTime,.1),this.ctx.listener.positionY.setTargetAtTime(this._pos[1],Howler.ctx.currentTime,.1),this.ctx.listener.positionZ.setTargetAtTime(this._pos[2],Howler.ctx.currentTime,.1)):this.ctx.listener.setPosition(this._pos[0],this._pos[1],this._pos[2]),this)):this},HowlerGlobal.prototype.orientation=function(S,N,C,L,k,K){if(!this.ctx||!this.ctx.listener)return this;var ut=this._orientation;return N=typeof N!="number"?ut[1]:N,C=typeof C!="number"?ut[2]:C,L=typeof L!="number"?ut[3]:L,k=typeof k!="number"?ut[4]:k,K=typeof K!="number"?ut[5]:K,typeof S!="number"?ut:(this._orientation=[S,N,C,L,k,K],this.ctx.listener.forwardX!==void 0?(this.ctx.listener.forwardX.setTargetAtTime(S,Howler.ctx.currentTime,.1),this.ctx.listener.forwardY.setTargetAtTime(N,Howler.ctx.currentTime,.1),this.ctx.listener.forwardZ.setTargetAtTime(C,Howler.ctx.currentTime,.1),this.ctx.listener.upX.setTargetAtTime(L,Howler.ctx.currentTime,.1),this.ctx.listener.upY.setTargetAtTime(k,Howler.ctx.currentTime,.1),this.ctx.listener.upZ.setTargetAtTime(K,Howler.ctx.currentTime,.1)):this.ctx.listener.setOrientation(S,N,C,L,k,K),this)},Howl.prototype.init=(R=Howl.prototype.init,function(S){return this._orientation=S.orientation||[1,0,0],this._stereo=S.stereo||null,this._pos=S.pos||null,this._pannerAttr={coneInnerAngle:S.coneInnerAngle!==void 0?S.coneInnerAngle:360,coneOuterAngle:S.coneOuterAngle!==void 0?S.coneOuterAngle:360,coneOuterGain:S.coneOuterGain!==void 0?S.coneOuterGain:0,distanceModel:S.distanceModel!==void 0?S.distanceModel:"inverse",maxDistance:S.maxDistance!==void 0?S.maxDistance:1e4,panningModel:S.panningModel!==void 0?S.panningModel:"HRTF",refDistance:S.refDistance!==void 0?S.refDistance:1,rolloffFactor:S.rolloffFactor!==void 0?S.rolloffFactor:1},this._onstereo=S.onstereo?[{fn:S.onstereo}]:[],this._onpos=S.onpos?[{fn:S.onpos}]:[],this._onorientation=S.onorientation?[{fn:S.onorientation}]:[],R.call(this,S)}),Howl.prototype.stereo=function(S,N){var C=this;if(!C._webAudio)return C;if(C._state!=="loaded")return C._queue.push({event:"stereo",action:function(){C.stereo(S,N)}}),C;var L=Howler.ctx.createStereoPanner===void 0?"spatial":"stereo";if(N===void 0){if(typeof S!="number")return C._stereo;C._stereo=S,C._pos=[S,0,0]}for(var k=C._getSoundIds(N),K=0;K<k.length;K++){var ut=C._soundById(k[K]);if(ut){if(typeof S!="number")return ut._stereo;ut._stereo=S,ut._pos=[S,0,0],ut._node&&(ut._pannerAttr.panningModel="equalpower",ut._panner&&ut._panner.pan||T(ut,L),L==="spatial"?ut._panner.positionX!==void 0?(ut._panner.positionX.setValueAtTime(S,Howler.ctx.currentTime),ut._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),ut._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):ut._panner.setPosition(S,0,0):ut._panner.pan.setValueAtTime(S,Howler.ctx.currentTime)),C._emit("stereo",ut._id)}}return C},Howl.prototype.pos=function(S,N,C,L){var k=this;if(!k._webAudio)return k;if(k._state!=="loaded")return k._queue.push({event:"pos",action:function(){k.pos(S,N,C,L)}}),k;if(N=typeof N!="number"?0:N,C=typeof C!="number"?-.5:C,L===void 0){if(typeof S!="number")return k._pos;k._pos=[S,N,C]}for(var K=k._getSoundIds(L),ut=0;ut<K.length;ut++){var _t=k._soundById(K[ut]);if(_t){if(typeof S!="number")return _t._pos;_t._pos=[S,N,C],_t._node&&(_t._panner&&!_t._panner.pan||T(_t,"spatial"),_t._panner.positionX!==void 0?(_t._panner.positionX.setValueAtTime(S,Howler.ctx.currentTime),_t._panner.positionY.setValueAtTime(N,Howler.ctx.currentTime),_t._panner.positionZ.setValueAtTime(C,Howler.ctx.currentTime)):_t._panner.setPosition(S,N,C)),k._emit("pos",_t._id)}}return k},Howl.prototype.orientation=function(S,N,C,L){var k=this;if(!k._webAudio)return k;if(k._state!=="loaded")return k._queue.push({event:"orientation",action:function(){k.orientation(S,N,C,L)}}),k;if(N=typeof N!="number"?k._orientation[1]:N,C=typeof C!="number"?k._orientation[2]:C,L===void 0){if(typeof S!="number")return k._orientation;k._orientation=[S,N,C]}for(var K=k._getSoundIds(L),ut=0;ut<K.length;ut++){var _t=k._soundById(K[ut]);if(_t){if(typeof S!="number")return _t._orientation;_t._orientation=[S,N,C],_t._node&&(_t._panner||(_t._pos||(_t._pos=k._pos||[0,0,-.5]),T(_t,"spatial")),_t._panner.orientationX!==void 0?(_t._panner.orientationX.setValueAtTime(S,Howler.ctx.currentTime),_t._panner.orientationY.setValueAtTime(N,Howler.ctx.currentTime),_t._panner.orientationZ.setValueAtTime(C,Howler.ctx.currentTime)):_t._panner.setOrientation(S,N,C)),k._emit("orientation",_t._id)}}return k},Howl.prototype.pannerAttr=function(){var S,N,C,L=this,k=arguments;if(!L._webAudio)return L;if(k.length===0)return L._pannerAttr;if(k.length===1){if(typeof k[0]!="object")return(C=L._soundById(parseInt(k[0],10)))?C._pannerAttr:L._pannerAttr;S=k[0],N===void 0&&(S.pannerAttr||(S.pannerAttr={coneInnerAngle:S.coneInnerAngle,coneOuterAngle:S.coneOuterAngle,coneOuterGain:S.coneOuterGain,distanceModel:S.distanceModel,maxDistance:S.maxDistance,refDistance:S.refDistance,rolloffFactor:S.rolloffFactor,panningModel:S.panningModel}),L._pannerAttr={coneInnerAngle:S.pannerAttr.coneInnerAngle!==void 0?S.pannerAttr.coneInnerAngle:L._coneInnerAngle,coneOuterAngle:S.pannerAttr.coneOuterAngle!==void 0?S.pannerAttr.coneOuterAngle:L._coneOuterAngle,coneOuterGain:S.pannerAttr.coneOuterGain!==void 0?S.pannerAttr.coneOuterGain:L._coneOuterGain,distanceModel:S.pannerAttr.distanceModel!==void 0?S.pannerAttr.distanceModel:L._distanceModel,maxDistance:S.pannerAttr.maxDistance!==void 0?S.pannerAttr.maxDistance:L._maxDistance,refDistance:S.pannerAttr.refDistance!==void 0?S.pannerAttr.refDistance:L._refDistance,rolloffFactor:S.pannerAttr.rolloffFactor!==void 0?S.pannerAttr.rolloffFactor:L._rolloffFactor,panningModel:S.pannerAttr.panningModel!==void 0?S.pannerAttr.panningModel:L._panningModel})}else k.length===2&&(S=k[0],N=parseInt(k[1],10));for(var K=L._getSoundIds(N),ut=0;ut<K.length;ut++)if(C=L._soundById(K[ut])){var _t=C._pannerAttr;_t={coneInnerAngle:S.coneInnerAngle!==void 0?S.coneInnerAngle:_t.coneInnerAngle,coneOuterAngle:S.coneOuterAngle!==void 0?S.coneOuterAngle:_t.coneOuterAngle,coneOuterGain:S.coneOuterGain!==void 0?S.coneOuterGain:_t.coneOuterGain,distanceModel:S.distanceModel!==void 0?S.distanceModel:_t.distanceModel,maxDistance:S.maxDistance!==void 0?S.maxDistance:_t.maxDistance,refDistance:S.refDistance!==void 0?S.refDistance:_t.refDistance,rolloffFactor:S.rolloffFactor!==void 0?S.rolloffFactor:_t.rolloffFactor,panningModel:S.panningModel!==void 0?S.panningModel:_t.panningModel};var E=C._panner;E?(E.coneInnerAngle=_t.coneInnerAngle,E.coneOuterAngle=_t.coneOuterAngle,E.coneOuterGain=_t.coneOuterGain,E.distanceModel=_t.distanceModel,E.maxDistance=_t.maxDistance,E.refDistance=_t.refDistance,E.rolloffFactor=_t.rolloffFactor,E.panningModel=_t.panningModel):(C._pos||(C._pos=L._pos||[0,0,-.5]),T(C,"spatial"))}return L},Sound.prototype.init=function(S){return function(){var N=this._parent;this._orientation=N._orientation,this._stereo=N._stereo,this._pos=N._pos,this._pannerAttr=N._pannerAttr,S.call(this),this._stereo?N.stereo(this._stereo):this._pos&&N.pos(this._pos[0],this._pos[1],this._pos[2],this._id)}}(Sound.prototype.init),Sound.prototype.reset=function(S){return function(){var N=this._parent;return this._orientation=N._orientation,this._stereo=N._stereo,this._pos=N._pos,this._pannerAttr=N._pannerAttr,this._stereo?N.stereo(this._stereo):this._pos?N.pos(this._pos[0],this._pos[1],this._pos[2],this._id):this._panner&&(this._panner.disconnect(0),this._panner=void 0,N._refreshBuffer(this)),S.call(this)}}(Sound.prototype.reset);var T=function(S,N){(N=N||"spatial")==="spatial"?(S._panner=Howler.ctx.createPanner(),S._panner.coneInnerAngle=S._pannerAttr.coneInnerAngle,S._panner.coneOuterAngle=S._pannerAttr.coneOuterAngle,S._panner.coneOuterGain=S._pannerAttr.coneOuterGain,S._panner.distanceModel=S._pannerAttr.distanceModel,S._panner.maxDistance=S._pannerAttr.maxDistance,S._panner.refDistance=S._pannerAttr.refDistance,S._panner.rolloffFactor=S._pannerAttr.rolloffFactor,S._panner.panningModel=S._pannerAttr.panningModel,S._panner.positionX!==void 0?(S._panner.positionX.setValueAtTime(S._pos[0],Howler.ctx.currentTime),S._panner.positionY.setValueAtTime(S._pos[1],Howler.ctx.currentTime),S._panner.positionZ.setValueAtTime(S._pos[2],Howler.ctx.currentTime)):S._panner.setPosition(S._pos[0],S._pos[1],S._pos[2]),S._panner.orientationX!==void 0?(S._panner.orientationX.setValueAtTime(S._orientation[0],Howler.ctx.currentTime),S._panner.orientationY.setValueAtTime(S._orientation[1],Howler.ctx.currentTime),S._panner.orientationZ.setValueAtTime(S._orientation[2],Howler.ctx.currentTime)):S._panner.setOrientation(S._orientation[0],S._orientation[1],S._orientation[2])):(S._panner=Howler.ctx.createStereoPanner(),S._panner.pan.setValueAtTime(S._stereo,Howler.ctx.currentTime)),S._panner.connect(S._node),S._paused||S._parent.pause(S._id,!0).play(S._id,!0)}}()}).call(this,d(11))},function(m,y){m.exports=`varying vec2 vTextureCoord;
|
|
1914
|
+
*/(function(){var C=function(){this.init()};C.prototype={init:function(){var E=this||T;return E._counter=1e3,E._html5AudioPool=[],E.html5PoolSize=10,E._codecs={},E._howls=[],E._muted=!1,E._volume=1,E._canPlayEvent="canplaythrough",E._navigator=typeof window!="undefined"&&window.navigator?window.navigator:null,E.masterGain=null,E.noAudio=!1,E.usingWebAudio=!0,E.autoSuspend=!0,E.ctx=null,E.autoUnlock=!0,E._setup(),E},volume:function(E){var R=this||T;if(E=parseFloat(E),R.ctx||_t(),E!==void 0&&E>=0&&E<=1){if(R._volume=E,R._muted)return R;R.usingWebAudio&&R.masterGain.gain.setValueAtTime(E,T.ctx.currentTime);for(var D=0;D<R._howls.length;D++)if(!R._howls[D]._webAudio)for(var F=R._howls[D]._getSoundIds(),P=0;P<F.length;P++){var B=R._howls[D]._soundById(F[P]);B&&B._node&&(B._node.volume=B._volume*E)}return R}return R._volume},mute:function(E){var R=this||T;R.ctx||_t(),R._muted=E,R.usingWebAudio&&R.masterGain.gain.setValueAtTime(E?0:R._volume,T.ctx.currentTime);for(var D=0;D<R._howls.length;D++)if(!R._howls[D]._webAudio)for(var F=R._howls[D]._getSoundIds(),P=0;P<F.length;P++){var B=R._howls[D]._soundById(F[P]);B&&B._node&&(B._node.muted=!!E||B._muted)}return R},stop:function(){for(var E=this||T,R=0;R<E._howls.length;R++)E._howls[R].stop();return E},unload:function(){for(var E=this||T,R=E._howls.length-1;R>=0;R--)E._howls[R].unload();return E.usingWebAudio&&E.ctx&&E.ctx.close!==void 0&&(E.ctx.close(),E.ctx=null,_t()),E},codecs:function(E){return(this||T)._codecs[E.replace(/^x-/,"")]},_setup:function(){var E=this||T;if(E.state=E.ctx&&E.ctx.state||"suspended",E._autoSuspend(),!E.usingWebAudio)if(typeof Audio!="undefined")try{new Audio().oncanplaythrough===void 0&&(E._canPlayEvent="canplay")}catch{E.noAudio=!0}else E.noAudio=!0;try{new Audio().muted&&(E.noAudio=!0)}catch{}return E.noAudio||E._setupCodecs(),E},_setupCodecs:function(){var E=this||T,R=null;try{R=typeof Audio!="undefined"?new Audio:null}catch{return E}if(!R||typeof R.canPlayType!="function")return E;var D=R.canPlayType("audio/mpeg;").replace(/^no$/,""),F=E._navigator?E._navigator.userAgent:"",P=F.match(/OPR\/([0-6].)/g),B=P&&parseInt(P[0].split("/")[1],10)<33,G=F.indexOf("Safari")!==-1&&F.indexOf("Chrome")===-1,q=F.match(/Version\/(.*?) /),Rt=G&&q&&parseInt(q[1],10)<15;return E._codecs={mp3:!(B||!D&&!R.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!D,opus:!!R.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!R.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!R.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(R.canPlayType('audio/wav; codecs="1"')||R.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!R.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!R.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(R.canPlayType("audio/x-m4a;")||R.canPlayType("audio/m4a;")||R.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(R.canPlayType("audio/x-m4b;")||R.canPlayType("audio/m4b;")||R.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(R.canPlayType("audio/x-mp4;")||R.canPlayType("audio/mp4;")||R.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(Rt||!R.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(Rt||!R.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!R.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(R.canPlayType("audio/x-flac;")||R.canPlayType("audio/flac;")).replace(/^no$/,"")},E},_unlockAudio:function(){var E=this||T;if(!E._audioUnlocked&&E.ctx){E._audioUnlocked=!1,E.autoUnlock=!1,E._mobileUnloaded||E.ctx.sampleRate===44100||(E._mobileUnloaded=!0,E.unload()),E._scratchBuffer=E.ctx.createBuffer(1,1,22050);var R=function(D){for(;E._html5AudioPool.length<E.html5PoolSize;)try{var F=new Audio;F._unlocked=!0,E._releaseHtml5Audio(F)}catch{E.noAudio=!0;break}for(var P=0;P<E._howls.length;P++)if(!E._howls[P]._webAudio)for(var B=E._howls[P]._getSoundIds(),G=0;G<B.length;G++){var q=E._howls[P]._soundById(B[G]);q&&q._node&&!q._node._unlocked&&(q._node._unlocked=!0,q._node.load())}E._autoResume();var Rt=E.ctx.createBufferSource();Rt.buffer=E._scratchBuffer,Rt.connect(E.ctx.destination),Rt.start===void 0?Rt.noteOn(0):Rt.start(0),typeof E.ctx.resume=="function"&&E.ctx.resume(),Rt.onended=function(){Rt.disconnect(0),E._audioUnlocked=!0,document.removeEventListener("touchstart",R,!0),document.removeEventListener("touchend",R,!0),document.removeEventListener("click",R,!0),document.removeEventListener("keydown",R,!0);for(var Xt=0;Xt<E._howls.length;Xt++)E._howls[Xt]._emit("unlock")}};return document.addEventListener("touchstart",R,!0),document.addEventListener("touchend",R,!0),document.addEventListener("click",R,!0),document.addEventListener("keydown",R,!0),E}},_obtainHtml5Audio:function(){var E=this||T;if(E._html5AudioPool.length)return E._html5AudioPool.pop();var R=new Audio().play();return R&&typeof Promise!="undefined"&&(R instanceof Promise||typeof R.then=="function")&&R.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(E){var R=this||T;return E._unlocked&&R._html5AudioPool.push(E),R},_autoSuspend:function(){var E=this;if(E.autoSuspend&&E.ctx&&E.ctx.suspend!==void 0&&T.usingWebAudio){for(var R=0;R<E._howls.length;R++)if(E._howls[R]._webAudio){for(var D=0;D<E._howls[R]._sounds.length;D++)if(!E._howls[R]._sounds[D]._paused)return E}return E._suspendTimer&&clearTimeout(E._suspendTimer),E._suspendTimer=setTimeout(function(){if(E.autoSuspend){E._suspendTimer=null,E.state="suspending";var F=function(){E.state="suspended",E._resumeAfterSuspend&&(delete E._resumeAfterSuspend,E._autoResume())};E.ctx.suspend().then(F,F)}},3e4),E}},_autoResume:function(){var E=this;if(E.ctx&&E.ctx.resume!==void 0&&T.usingWebAudio)return E.state==="running"&&E.ctx.state!=="interrupted"&&E._suspendTimer?(clearTimeout(E._suspendTimer),E._suspendTimer=null):E.state==="suspended"||E.state==="running"&&E.ctx.state==="interrupted"?(E.ctx.resume().then(function(){E.state="running";for(var R=0;R<E._howls.length;R++)E._howls[R]._emit("resume")}),E._suspendTimer&&(clearTimeout(E._suspendTimer),E._suspendTimer=null)):E.state==="suspending"&&(E._resumeAfterSuspend=!0),E}};var T=new C,S=function(E){E.src&&E.src.length!==0?this.init(E):console.error("An array of source files must be passed with any new Howl.")};S.prototype={init:function(E){var R=this;return T.ctx||_t(),R._autoplay=E.autoplay||!1,R._format=typeof E.format!="string"?E.format:[E.format],R._html5=E.html5||!1,R._muted=E.mute||!1,R._loop=E.loop||!1,R._pool=E.pool||5,R._preload=typeof E.preload!="boolean"&&E.preload!=="metadata"||E.preload,R._rate=E.rate||1,R._sprite=E.sprite||{},R._src=typeof E.src!="string"?E.src:[E.src],R._volume=E.volume!==void 0?E.volume:1,R._xhr={method:E.xhr&&E.xhr.method?E.xhr.method:"GET",headers:E.xhr&&E.xhr.headers?E.xhr.headers:null,withCredentials:!(!E.xhr||!E.xhr.withCredentials)&&E.xhr.withCredentials},R._duration=0,R._state="unloaded",R._sounds=[],R._endTimers={},R._queue=[],R._playLock=!1,R._onend=E.onend?[{fn:E.onend}]:[],R._onfade=E.onfade?[{fn:E.onfade}]:[],R._onload=E.onload?[{fn:E.onload}]:[],R._onloaderror=E.onloaderror?[{fn:E.onloaderror}]:[],R._onplayerror=E.onplayerror?[{fn:E.onplayerror}]:[],R._onpause=E.onpause?[{fn:E.onpause}]:[],R._onplay=E.onplay?[{fn:E.onplay}]:[],R._onstop=E.onstop?[{fn:E.onstop}]:[],R._onmute=E.onmute?[{fn:E.onmute}]:[],R._onvolume=E.onvolume?[{fn:E.onvolume}]:[],R._onrate=E.onrate?[{fn:E.onrate}]:[],R._onseek=E.onseek?[{fn:E.onseek}]:[],R._onunlock=E.onunlock?[{fn:E.onunlock}]:[],R._onresume=[],R._webAudio=T.usingWebAudio&&!R._html5,T.ctx!==void 0&&T.ctx&&T.autoUnlock&&T._unlockAudio(),T._howls.push(R),R._autoplay&&R._queue.push({event:"play",action:function(){R.play()}}),R._preload&&R._preload!=="none"&&R.load(),R},load:function(){var E=null;if(T.noAudio)this._emit("loaderror",null,"No audio support.");else{typeof this._src=="string"&&(this._src=[this._src]);for(var R=0;R<this._src.length;R++){var D,F;if(this._format&&this._format[R])D=this._format[R];else{if(typeof(F=this._src[R])!="string"){this._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}(D=/^data:audio\/([^;,]+);/i.exec(F))||(D=/\.([^.]+)$/.exec(F.split("?",1)[0])),D&&(D=D[1].toLowerCase())}if(D||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),D&&T.codecs(D)){E=this._src[R];break}}if(E)return this._src=E,this._state="loading",window.location.protocol==="https:"&&E.slice(0,5)==="http:"&&(this._html5=!0,this._webAudio=!1),new N(this),this._webAudio&&L(this),this;this._emit("loaderror",null,"No codec support for selected audio sources.")}},play:function(E,R){var D=this,F=null;if(typeof E=="number")F=E,E=null;else{if(typeof E=="string"&&D._state==="loaded"&&!D._sprite[E])return null;if(E===void 0&&(E="__default",!D._playLock)){for(var P=0,B=0;B<D._sounds.length;B++)D._sounds[B]._paused&&!D._sounds[B]._ended&&(P++,F=D._sounds[B]._id);P===1?E=null:F=null}}var G=F?D._soundById(F):D._inactiveSound();if(!G)return null;if(F&&!E&&(E=G._sprite||"__default"),D._state!=="loaded"){G._sprite=E,G._ended=!1;var q=G._id;return D._queue.push({event:"play",action:function(){D.play(q)}}),q}if(F&&!G._paused)return R||D._loadQueue("play"),G._id;D._webAudio&&T._autoResume();var Rt=Math.max(0,G._seek>0?G._seek:D._sprite[E][0]/1e3),Xt=Math.max(0,(D._sprite[E][0]+D._sprite[E][1])/1e3-Rt),at=1e3*Xt/Math.abs(G._rate),$=D._sprite[E][0]/1e3,tt=(D._sprite[E][0]+D._sprite[E][1])/1e3;G._sprite=E,G._ended=!1;var lt=function(){G._paused=!1,G._seek=Rt,G._start=$,G._stop=tt,G._loop=!(!G._loop&&!D._sprite[E][2])};if(!(Rt>=tt)){var w=G._node;if(D._webAudio){var ot=function(){D._playLock=!1,lt(),D._refreshBuffer(G);var Ot=G._muted||D._muted?0:G._volume;w.gain.setValueAtTime(Ot,T.ctx.currentTime),G._playStart=T.ctx.currentTime,w.bufferSource.start===void 0?G._loop?w.bufferSource.noteGrainOn(0,Rt,86400):w.bufferSource.noteGrainOn(0,Rt,Xt):G._loop?w.bufferSource.start(0,Rt,86400):w.bufferSource.start(0,Rt,Xt),at!==1/0&&(D._endTimers[G._id]=setTimeout(D._ended.bind(D,G),at)),R||setTimeout(function(){D._emit("play",G._id),D._loadQueue()},0)};T.state==="running"&&T.ctx.state!=="interrupted"?ot():(D._playLock=!0,D.once("resume",ot),D._clearTimer(G._id))}else{var bt=function(){w.currentTime=Rt,w.muted=G._muted||D._muted||T._muted||w.muted,w.volume=G._volume*T.volume(),w.playbackRate=G._rate;try{var Ot=w.play();if(Ot&&typeof Promise!="undefined"&&(Ot instanceof Promise||typeof Ot.then=="function")?(D._playLock=!0,lt(),Ot.then(function(){D._playLock=!1,w._unlocked=!0,R?D._loadQueue():D._emit("play",G._id)}).catch(function(){D._playLock=!1,D._emit("playerror",G._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),G._ended=!0,G._paused=!0})):R||(D._playLock=!1,lt(),D._emit("play",G._id)),w.playbackRate=G._rate,w.paused)return void D._emit("playerror",G._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");E!=="__default"||G._loop?D._endTimers[G._id]=setTimeout(D._ended.bind(D,G),at):(D._endTimers[G._id]=function(){D._ended(G),w.removeEventListener("ended",D._endTimers[G._id],!1)},w.addEventListener("ended",D._endTimers[G._id],!1))}catch(kt){D._emit("playerror",G._id,kt)}};w.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&(w.src=D._src,w.load());var dt=window&&window.ejecta||!w.readyState&&T._navigator.isCocoonJS;if(w.readyState>=3||dt)bt();else{D._playLock=!0,D._state="loading";var yt=function(){D._state="loaded",bt(),w.removeEventListener(T._canPlayEvent,yt,!1)};w.addEventListener(T._canPlayEvent,yt,!1),D._clearTimer(G._id)}}return G._id}D._ended(G)},pause:function(E){var R=this;if(R._state!=="loaded"||R._playLock)return R._queue.push({event:"pause",action:function(){R.pause(E)}}),R;for(var D=R._getSoundIds(E),F=0;F<D.length;F++){R._clearTimer(D[F]);var P=R._soundById(D[F]);if(P&&!P._paused&&(P._seek=R.seek(D[F]),P._rateSeek=0,P._paused=!0,R._stopFade(D[F]),P._node))if(R._webAudio){if(!P._node.bufferSource)continue;P._node.bufferSource.stop===void 0?P._node.bufferSource.noteOff(0):P._node.bufferSource.stop(0),R._cleanBuffer(P._node)}else isNaN(P._node.duration)&&P._node.duration!==1/0||P._node.pause();arguments[1]||R._emit("pause",P?P._id:null)}return R},stop:function(E,R){var D=this;if(D._state!=="loaded"||D._playLock)return D._queue.push({event:"stop",action:function(){D.stop(E)}}),D;for(var F=D._getSoundIds(E),P=0;P<F.length;P++){D._clearTimer(F[P]);var B=D._soundById(F[P]);B&&(B._seek=B._start||0,B._rateSeek=0,B._paused=!0,B._ended=!0,D._stopFade(F[P]),B._node&&(D._webAudio?B._node.bufferSource&&(B._node.bufferSource.stop===void 0?B._node.bufferSource.noteOff(0):B._node.bufferSource.stop(0),D._cleanBuffer(B._node)):isNaN(B._node.duration)&&B._node.duration!==1/0||(B._node.currentTime=B._start||0,B._node.pause(),B._node.duration===1/0&&D._clearSound(B._node))),R||D._emit("stop",B._id))}return D},mute:function(E,R){var D=this;if(D._state!=="loaded"||D._playLock)return D._queue.push({event:"mute",action:function(){D.mute(E,R)}}),D;if(R===void 0){if(typeof E!="boolean")return D._muted;D._muted=E}for(var F=D._getSoundIds(R),P=0;P<F.length;P++){var B=D._soundById(F[P]);B&&(B._muted=E,B._interval&&D._stopFade(B._id),D._webAudio&&B._node?B._node.gain.setValueAtTime(E?0:B._volume,T.ctx.currentTime):B._node&&(B._node.muted=!!T._muted||E),D._emit("mute",B._id))}return D},volume:function(){var E,R,D,F=this,P=arguments;if(P.length===0)return F._volume;if(P.length===1||P.length===2&&P[1]===void 0){var B=F._getSoundIds(),G=B.indexOf(P[0]);G>=0?R=parseInt(P[0],10):E=parseFloat(P[0])}else P.length>=2&&(E=parseFloat(P[0]),R=parseInt(P[1],10));if(!(E!==void 0&&E>=0&&E<=1))return(D=R?F._soundById(R):F._sounds[0])?D._volume:0;if(F._state!=="loaded"||F._playLock)return F._queue.push({event:"volume",action:function(){F.volume.apply(F,P)}}),F;R===void 0&&(F._volume=E),R=F._getSoundIds(R);for(var q=0;q<R.length;q++)(D=F._soundById(R[q]))&&(D._volume=E,P[2]||F._stopFade(R[q]),F._webAudio&&D._node&&!D._muted?D._node.gain.setValueAtTime(E,T.ctx.currentTime):D._node&&!D._muted&&(D._node.volume=E*T.volume()),F._emit("volume",D._id));return F},fade:function(E,R,D,F){var P=this;if(P._state!=="loaded"||P._playLock)return P._queue.push({event:"fade",action:function(){P.fade(E,R,D,F)}}),P;E=Math.min(Math.max(0,parseFloat(E)),1),R=Math.min(Math.max(0,parseFloat(R)),1),D=parseFloat(D),P.volume(E,F);for(var B=P._getSoundIds(F),G=0;G<B.length;G++){var q=P._soundById(B[G]);if(q){if(F||P._stopFade(B[G]),P._webAudio&&!q._muted){var Rt=T.ctx.currentTime,Xt=Rt+D/1e3;q._volume=E,q._node.gain.setValueAtTime(E,Rt),q._node.gain.linearRampToValueAtTime(R,Xt)}P._startFadeInterval(q,E,R,D,B[G],F===void 0)}}return P},_startFadeInterval:function(E,R,D,F,P,B){var G=this,q=R,Rt=D-R,Xt=Math.abs(Rt/.01),at=Math.max(4,Xt>0?F/Xt:F),$=Date.now();E._fadeTo=D,E._interval=setInterval(function(){var tt=(Date.now()-$)/F;$=Date.now(),q+=Rt*tt,q=Math.round(100*q)/100,q=Rt<0?Math.max(D,q):Math.min(D,q),G._webAudio?E._volume=q:G.volume(q,E._id,!0),B&&(G._volume=q),(D<R&&q<=D||D>R&&q>=D)&&(clearInterval(E._interval),E._interval=null,E._fadeTo=null,G.volume(D,E._id),G._emit("fade",E._id))},at)},_stopFade:function(E){var R=this._soundById(E);return R&&R._interval&&(this._webAudio&&R._node.gain.cancelScheduledValues(T.ctx.currentTime),clearInterval(R._interval),R._interval=null,this.volume(R._fadeTo,E),R._fadeTo=null,this._emit("fade",E)),this},loop:function(){var E,R,D,F=this,P=arguments;if(P.length===0)return F._loop;if(P.length===1){if(typeof P[0]!="boolean")return!!(D=F._soundById(parseInt(P[0],10)))&&D._loop;E=P[0],F._loop=E}else P.length===2&&(E=P[0],R=parseInt(P[1],10));for(var B=F._getSoundIds(R),G=0;G<B.length;G++)(D=F._soundById(B[G]))&&(D._loop=E,F._webAudio&&D._node&&D._node.bufferSource&&(D._node.bufferSource.loop=E,E&&(D._node.bufferSource.loopStart=D._start||0,D._node.bufferSource.loopEnd=D._stop,F.playing(B[G])&&(F.pause(B[G],!0),F.play(B[G],!0)))));return F},rate:function(){var E,R,D,F=this,P=arguments;if(P.length===0)R=F._sounds[0]._id;else if(P.length===1){var B=F._getSoundIds(),G=B.indexOf(P[0]);G>=0?R=parseInt(P[0],10):E=parseFloat(P[0])}else P.length===2&&(E=parseFloat(P[0]),R=parseInt(P[1],10));if(typeof E!="number")return(D=F._soundById(R))?D._rate:F._rate;if(F._state!=="loaded"||F._playLock)return F._queue.push({event:"rate",action:function(){F.rate.apply(F,P)}}),F;R===void 0&&(F._rate=E),R=F._getSoundIds(R);for(var q=0;q<R.length;q++)if(D=F._soundById(R[q])){F.playing(R[q])&&(D._rateSeek=F.seek(R[q]),D._playStart=F._webAudio?T.ctx.currentTime:D._playStart),D._rate=E,F._webAudio&&D._node&&D._node.bufferSource?D._node.bufferSource.playbackRate.setValueAtTime(E,T.ctx.currentTime):D._node&&(D._node.playbackRate=E);var Rt=F.seek(R[q]),Xt=(F._sprite[D._sprite][0]+F._sprite[D._sprite][1])/1e3-Rt,at=1e3*Xt/Math.abs(D._rate);!F._endTimers[R[q]]&&D._paused||(F._clearTimer(R[q]),F._endTimers[R[q]]=setTimeout(F._ended.bind(F,D),at)),F._emit("rate",D._id)}return F},seek:function(){var E,R,D=this,F=arguments;if(F.length===0)D._sounds.length&&(R=D._sounds[0]._id);else if(F.length===1){var P=D._getSoundIds(),B=P.indexOf(F[0]);B>=0?R=parseInt(F[0],10):D._sounds.length&&(R=D._sounds[0]._id,E=parseFloat(F[0]))}else F.length===2&&(E=parseFloat(F[0]),R=parseInt(F[1],10));if(R===void 0)return 0;if(typeof E=="number"&&(D._state!=="loaded"||D._playLock))return D._queue.push({event:"seek",action:function(){D.seek.apply(D,F)}}),D;var G=D._soundById(R);if(G){if(!(typeof E=="number"&&E>=0)){if(D._webAudio){var q=D.playing(R)?T.ctx.currentTime-G._playStart:0,Rt=G._rateSeek?G._rateSeek-G._seek:0;return G._seek+(Rt+q*Math.abs(G._rate))}return G._node.currentTime}var Xt=D.playing(R);Xt&&D.pause(R,!0),G._seek=E,G._ended=!1,D._clearTimer(R),D._webAudio||!G._node||isNaN(G._node.duration)||(G._node.currentTime=E);var at=function(){Xt&&D.play(R,!0),D._emit("seek",R)};if(Xt&&!D._webAudio){var $=function(){D._playLock?setTimeout($,0):at()};setTimeout($,0)}else at()}return D},playing:function(E){if(typeof E=="number"){var R=this._soundById(E);return!!R&&!R._paused}for(var D=0;D<this._sounds.length;D++)if(!this._sounds[D]._paused)return!0;return!1},duration:function(E){var R=this._duration,D=this._soundById(E);return D&&(R=this._sprite[D._sprite][1]/1e3),R},state:function(){return this._state},unload:function(){for(var E=this,R=E._sounds,D=0;D<R.length;D++)R[D]._paused||E.stop(R[D]._id),E._webAudio||(E._clearSound(R[D]._node),R[D]._node.removeEventListener("error",R[D]._errorFn,!1),R[D]._node.removeEventListener(T._canPlayEvent,R[D]._loadFn,!1),R[D]._node.removeEventListener("ended",R[D]._endFn,!1),T._releaseHtml5Audio(R[D]._node)),delete R[D]._node,E._clearTimer(R[D]._id);var F=T._howls.indexOf(E);F>=0&&T._howls.splice(F,1);var P=!0;for(D=0;D<T._howls.length;D++)if(T._howls[D]._src===E._src||E._src.indexOf(T._howls[D]._src)>=0){P=!1;break}return I&&P&&delete I[E._src],T.noAudio=!1,E._state="unloaded",E._sounds=[],E=null,null},on:function(E,R,D,F){var P=this["_on"+E];return typeof R=="function"&&P.push(F?{id:D,fn:R,once:F}:{id:D,fn:R}),this},off:function(E,R,D){var F=this["_on"+E],P=0;if(typeof R=="number"&&(D=R,R=null),R||D)for(P=0;P<F.length;P++){var B=D===F[P].id;if(R===F[P].fn&&B||!R&&B){F.splice(P,1);break}}else if(E)this["_on"+E]=[];else{var G=Object.keys(this);for(P=0;P<G.length;P++)G[P].indexOf("_on")===0&&Array.isArray(this[G[P]])&&(this[G[P]]=[])}return this},once:function(E,R,D){return this.on(E,R,D,1),this},_emit:function(E,R,D){for(var F=this["_on"+E],P=F.length-1;P>=0;P--)F[P].id&&F[P].id!==R&&E!=="load"||(setTimeout(function(B){B.call(this,R,D)}.bind(this,F[P].fn),0),F[P].once&&this.off(E,F[P].fn,F[P].id));return this._loadQueue(E),this},_loadQueue:function(E){if(this._queue.length>0){var R=this._queue[0];R.event===E&&(this._queue.shift(),this._loadQueue()),E||R.action()}return this},_ended:function(E){var R=E._sprite;if(!this._webAudio&&E._node&&!E._node.paused&&!E._node.ended&&E._node.currentTime<E._stop)return setTimeout(this._ended.bind(this,E),100),this;var D=!(!E._loop&&!this._sprite[R][2]);if(this._emit("end",E._id),!this._webAudio&&D&&this.stop(E._id,!0).play(E._id),this._webAudio&&D){this._emit("play",E._id),E._seek=E._start||0,E._rateSeek=0,E._playStart=T.ctx.currentTime;var F=1e3*(E._stop-E._start)/Math.abs(E._rate);this._endTimers[E._id]=setTimeout(this._ended.bind(this,E),F)}return this._webAudio&&!D&&(E._paused=!0,E._ended=!0,E._seek=E._start||0,E._rateSeek=0,this._clearTimer(E._id),this._cleanBuffer(E._node),T._autoSuspend()),this._webAudio||D||this.stop(E._id,!0),this},_clearTimer:function(E){if(this._endTimers[E]){if(typeof this._endTimers[E]!="function")clearTimeout(this._endTimers[E]);else{var R=this._soundById(E);R&&R._node&&R._node.removeEventListener("ended",this._endTimers[E],!1)}delete this._endTimers[E]}return this},_soundById:function(E){for(var R=0;R<this._sounds.length;R++)if(E===this._sounds[R]._id)return this._sounds[R];return null},_inactiveSound:function(){this._drain();for(var E=0;E<this._sounds.length;E++)if(this._sounds[E]._ended)return this._sounds[E].reset();return new N(this)},_drain:function(){var E=this._pool,R=0,D=0;if(!(this._sounds.length<E)){for(D=0;D<this._sounds.length;D++)this._sounds[D]._ended&&R++;for(D=this._sounds.length-1;D>=0;D--){if(R<=E)return;this._sounds[D]._ended&&(this._webAudio&&this._sounds[D]._node&&this._sounds[D]._node.disconnect(0),this._sounds.splice(D,1),R--)}}},_getSoundIds:function(E){if(E===void 0){for(var R=[],D=0;D<this._sounds.length;D++)R.push(this._sounds[D]._id);return R}return[E]},_refreshBuffer:function(E){return E._node.bufferSource=T.ctx.createBufferSource(),E._node.bufferSource.buffer=I[this._src],E._panner?E._node.bufferSource.connect(E._panner):E._node.bufferSource.connect(E._node),E._node.bufferSource.loop=E._loop,E._loop&&(E._node.bufferSource.loopStart=E._start||0,E._node.bufferSource.loopEnd=E._stop||0),E._node.bufferSource.playbackRate.setValueAtTime(E._rate,T.ctx.currentTime),this},_cleanBuffer:function(E){var R=T._navigator&&T._navigator.vendor.indexOf("Apple")>=0;if(T._scratchBuffer&&E.bufferSource&&(E.bufferSource.onended=null,E.bufferSource.disconnect(0),R))try{E.bufferSource.buffer=T._scratchBuffer}catch{}return E.bufferSource=null,this},_clearSound:function(E){/MSIE |Trident\//.test(T._navigator&&T._navigator.userAgent)||(E.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var N=function(E){this._parent=E,this.init()};N.prototype={init:function(){var E=this._parent;return this._muted=E._muted,this._loop=E._loop,this._volume=E._volume,this._rate=E._rate,this._seek=0,this._paused=!0,this._ended=!0,this._sprite="__default",this._id=++T._counter,E._sounds.push(this),this.create(),this},create:function(){var E=this._parent,R=T._muted||this._muted||this._parent._muted?0:this._volume;return E._webAudio?(this._node=T.ctx.createGain===void 0?T.ctx.createGainNode():T.ctx.createGain(),this._node.gain.setValueAtTime(R,T.ctx.currentTime),this._node.paused=!0,this._node.connect(T.masterGain)):T.noAudio||(this._node=T._obtainHtml5Audio(),this._errorFn=this._errorListener.bind(this),this._node.addEventListener("error",this._errorFn,!1),this._loadFn=this._loadListener.bind(this),this._node.addEventListener(T._canPlayEvent,this._loadFn,!1),this._endFn=this._endListener.bind(this),this._node.addEventListener("ended",this._endFn,!1),this._node.src=E._src,this._node.preload=E._preload===!0?"auto":E._preload,this._node.volume=R*T.volume(),this._node.load()),this},reset:function(){var E=this._parent;return this._muted=E._muted,this._loop=E._loop,this._volume=E._volume,this._rate=E._rate,this._seek=0,this._rateSeek=0,this._paused=!0,this._ended=!0,this._sprite="__default",this._id=++T._counter,this},_errorListener:function(){this._parent._emit("loaderror",this._id,this._node.error?this._node.error.code:0),this._node.removeEventListener("error",this._errorFn,!1)},_loadListener:function(){var E=this._parent;E._duration=Math.ceil(10*this._node.duration)/10,Object.keys(E._sprite).length===0&&(E._sprite={__default:[0,1e3*E._duration]}),E._state!=="loaded"&&(E._state="loaded",E._emit("load"),E._loadQueue()),this._node.removeEventListener(T._canPlayEvent,this._loadFn,!1)},_endListener:function(){var E=this._parent;E._duration===1/0&&(E._duration=Math.ceil(10*this._node.duration)/10,E._sprite.__default[1]===1/0&&(E._sprite.__default[1]=1e3*E._duration),E._ended(this)),this._node.removeEventListener("ended",this._endFn,!1)}};var I={},L=function(E){var R=E._src;if(I[R])return E._duration=I[R].duration,void ut(E);if(/^data:[^;]+;base64,/.test(R)){for(var D=atob(R.split(",")[1]),F=new Uint8Array(D.length),P=0;P<D.length;++P)F[P]=D.charCodeAt(P);K(F.buffer,E)}else{var B=new XMLHttpRequest;B.open(E._xhr.method,R,!0),B.withCredentials=E._xhr.withCredentials,B.responseType="arraybuffer",E._xhr.headers&&Object.keys(E._xhr.headers).forEach(function(G){B.setRequestHeader(G,E._xhr.headers[G])}),B.onload=function(){var G=(B.status+"")[0];G==="0"||G==="2"||G==="3"?K(B.response,E):E._emit("loaderror",null,"Failed loading audio file with status: "+B.status+".")},B.onerror=function(){E._webAudio&&(E._html5=!0,E._webAudio=!1,E._sounds=[],delete I[R],E.load())},k(B)}},k=function(E){try{E.send()}catch{E.onerror()}},K=function(E,R){var D=function(){R._emit("loaderror",null,"Decoding audio data failed.")},F=function(P){P&&R._sounds.length>0?(I[R._src]=P,ut(R,P)):D()};typeof Promise!="undefined"&&T.ctx.decodeAudioData.length===1?T.ctx.decodeAudioData(E).then(F).catch(D):T.ctx.decodeAudioData(E,F,D)},ut=function(E,R){R&&!E._duration&&(E._duration=R.duration),Object.keys(E._sprite).length===0&&(E._sprite={__default:[0,1e3*E._duration]}),E._state!=="loaded"&&(E._state="loaded",E._emit("load"),E._loadQueue())},_t=function(){if(T.usingWebAudio){try{typeof AudioContext!="undefined"?T.ctx=new AudioContext:typeof webkitAudioContext!="undefined"?T.ctx=new webkitAudioContext:T.usingWebAudio=!1}catch{T.usingWebAudio=!1}T.ctx||(T.usingWebAudio=!1);var E=/iP(hone|od|ad)/.test(T._navigator&&T._navigator.platform),R=T._navigator&&T._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),D=R?parseInt(R[1],10):null;if(E&&D&&D<9){var F=/safari/.test(T._navigator&&T._navigator.userAgent.toLowerCase());T._navigator&&!F&&(T.usingWebAudio=!1)}T.usingWebAudio&&(T.masterGain=T.ctx.createGain===void 0?T.ctx.createGainNode():T.ctx.createGain(),T.masterGain.gain.setValueAtTime(T._muted?0:T._volume,T.ctx.currentTime),T.masterGain.connect(T.ctx.destination)),T._setup()}};(b=function(){return{Howler:T,Howl:S}}.apply(y,[]))===void 0||(m.exports=b),y.Howler=T,y.Howl=S,x!==void 0?(x.HowlerGlobal=C,x.Howler=T,x.Howl=S,x.Sound=N):typeof window!="undefined"&&(window.HowlerGlobal=C,window.Howler=T,window.Howl=S,window.Sound=N)})(),function(){var C;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(S){if(!this.ctx||!this.ctx.listener)return this;for(var N=this._howls.length-1;N>=0;N--)this._howls[N].stereo(S);return this},HowlerGlobal.prototype.pos=function(S,N,I){return this.ctx&&this.ctx.listener?(N=typeof N!="number"?this._pos[1]:N,I=typeof I!="number"?this._pos[2]:I,typeof S!="number"?this._pos:(this._pos=[S,N,I],this.ctx.listener.positionX!==void 0?(this.ctx.listener.positionX.setTargetAtTime(this._pos[0],Howler.ctx.currentTime,.1),this.ctx.listener.positionY.setTargetAtTime(this._pos[1],Howler.ctx.currentTime,.1),this.ctx.listener.positionZ.setTargetAtTime(this._pos[2],Howler.ctx.currentTime,.1)):this.ctx.listener.setPosition(this._pos[0],this._pos[1],this._pos[2]),this)):this},HowlerGlobal.prototype.orientation=function(S,N,I,L,k,K){if(!this.ctx||!this.ctx.listener)return this;var ut=this._orientation;return N=typeof N!="number"?ut[1]:N,I=typeof I!="number"?ut[2]:I,L=typeof L!="number"?ut[3]:L,k=typeof k!="number"?ut[4]:k,K=typeof K!="number"?ut[5]:K,typeof S!="number"?ut:(this._orientation=[S,N,I,L,k,K],this.ctx.listener.forwardX!==void 0?(this.ctx.listener.forwardX.setTargetAtTime(S,Howler.ctx.currentTime,.1),this.ctx.listener.forwardY.setTargetAtTime(N,Howler.ctx.currentTime,.1),this.ctx.listener.forwardZ.setTargetAtTime(I,Howler.ctx.currentTime,.1),this.ctx.listener.upX.setTargetAtTime(L,Howler.ctx.currentTime,.1),this.ctx.listener.upY.setTargetAtTime(k,Howler.ctx.currentTime,.1),this.ctx.listener.upZ.setTargetAtTime(K,Howler.ctx.currentTime,.1)):this.ctx.listener.setOrientation(S,N,I,L,k,K),this)},Howl.prototype.init=(C=Howl.prototype.init,function(S){return this._orientation=S.orientation||[1,0,0],this._stereo=S.stereo||null,this._pos=S.pos||null,this._pannerAttr={coneInnerAngle:S.coneInnerAngle!==void 0?S.coneInnerAngle:360,coneOuterAngle:S.coneOuterAngle!==void 0?S.coneOuterAngle:360,coneOuterGain:S.coneOuterGain!==void 0?S.coneOuterGain:0,distanceModel:S.distanceModel!==void 0?S.distanceModel:"inverse",maxDistance:S.maxDistance!==void 0?S.maxDistance:1e4,panningModel:S.panningModel!==void 0?S.panningModel:"HRTF",refDistance:S.refDistance!==void 0?S.refDistance:1,rolloffFactor:S.rolloffFactor!==void 0?S.rolloffFactor:1},this._onstereo=S.onstereo?[{fn:S.onstereo}]:[],this._onpos=S.onpos?[{fn:S.onpos}]:[],this._onorientation=S.onorientation?[{fn:S.onorientation}]:[],C.call(this,S)}),Howl.prototype.stereo=function(S,N){var I=this;if(!I._webAudio)return I;if(I._state!=="loaded")return I._queue.push({event:"stereo",action:function(){I.stereo(S,N)}}),I;var L=Howler.ctx.createStereoPanner===void 0?"spatial":"stereo";if(N===void 0){if(typeof S!="number")return I._stereo;I._stereo=S,I._pos=[S,0,0]}for(var k=I._getSoundIds(N),K=0;K<k.length;K++){var ut=I._soundById(k[K]);if(ut){if(typeof S!="number")return ut._stereo;ut._stereo=S,ut._pos=[S,0,0],ut._node&&(ut._pannerAttr.panningModel="equalpower",ut._panner&&ut._panner.pan||T(ut,L),L==="spatial"?ut._panner.positionX!==void 0?(ut._panner.positionX.setValueAtTime(S,Howler.ctx.currentTime),ut._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),ut._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):ut._panner.setPosition(S,0,0):ut._panner.pan.setValueAtTime(S,Howler.ctx.currentTime)),I._emit("stereo",ut._id)}}return I},Howl.prototype.pos=function(S,N,I,L){var k=this;if(!k._webAudio)return k;if(k._state!=="loaded")return k._queue.push({event:"pos",action:function(){k.pos(S,N,I,L)}}),k;if(N=typeof N!="number"?0:N,I=typeof I!="number"?-.5:I,L===void 0){if(typeof S!="number")return k._pos;k._pos=[S,N,I]}for(var K=k._getSoundIds(L),ut=0;ut<K.length;ut++){var _t=k._soundById(K[ut]);if(_t){if(typeof S!="number")return _t._pos;_t._pos=[S,N,I],_t._node&&(_t._panner&&!_t._panner.pan||T(_t,"spatial"),_t._panner.positionX!==void 0?(_t._panner.positionX.setValueAtTime(S,Howler.ctx.currentTime),_t._panner.positionY.setValueAtTime(N,Howler.ctx.currentTime),_t._panner.positionZ.setValueAtTime(I,Howler.ctx.currentTime)):_t._panner.setPosition(S,N,I)),k._emit("pos",_t._id)}}return k},Howl.prototype.orientation=function(S,N,I,L){var k=this;if(!k._webAudio)return k;if(k._state!=="loaded")return k._queue.push({event:"orientation",action:function(){k.orientation(S,N,I,L)}}),k;if(N=typeof N!="number"?k._orientation[1]:N,I=typeof I!="number"?k._orientation[2]:I,L===void 0){if(typeof S!="number")return k._orientation;k._orientation=[S,N,I]}for(var K=k._getSoundIds(L),ut=0;ut<K.length;ut++){var _t=k._soundById(K[ut]);if(_t){if(typeof S!="number")return _t._orientation;_t._orientation=[S,N,I],_t._node&&(_t._panner||(_t._pos||(_t._pos=k._pos||[0,0,-.5]),T(_t,"spatial")),_t._panner.orientationX!==void 0?(_t._panner.orientationX.setValueAtTime(S,Howler.ctx.currentTime),_t._panner.orientationY.setValueAtTime(N,Howler.ctx.currentTime),_t._panner.orientationZ.setValueAtTime(I,Howler.ctx.currentTime)):_t._panner.setOrientation(S,N,I)),k._emit("orientation",_t._id)}}return k},Howl.prototype.pannerAttr=function(){var S,N,I,L=this,k=arguments;if(!L._webAudio)return L;if(k.length===0)return L._pannerAttr;if(k.length===1){if(typeof k[0]!="object")return(I=L._soundById(parseInt(k[0],10)))?I._pannerAttr:L._pannerAttr;S=k[0],N===void 0&&(S.pannerAttr||(S.pannerAttr={coneInnerAngle:S.coneInnerAngle,coneOuterAngle:S.coneOuterAngle,coneOuterGain:S.coneOuterGain,distanceModel:S.distanceModel,maxDistance:S.maxDistance,refDistance:S.refDistance,rolloffFactor:S.rolloffFactor,panningModel:S.panningModel}),L._pannerAttr={coneInnerAngle:S.pannerAttr.coneInnerAngle!==void 0?S.pannerAttr.coneInnerAngle:L._coneInnerAngle,coneOuterAngle:S.pannerAttr.coneOuterAngle!==void 0?S.pannerAttr.coneOuterAngle:L._coneOuterAngle,coneOuterGain:S.pannerAttr.coneOuterGain!==void 0?S.pannerAttr.coneOuterGain:L._coneOuterGain,distanceModel:S.pannerAttr.distanceModel!==void 0?S.pannerAttr.distanceModel:L._distanceModel,maxDistance:S.pannerAttr.maxDistance!==void 0?S.pannerAttr.maxDistance:L._maxDistance,refDistance:S.pannerAttr.refDistance!==void 0?S.pannerAttr.refDistance:L._refDistance,rolloffFactor:S.pannerAttr.rolloffFactor!==void 0?S.pannerAttr.rolloffFactor:L._rolloffFactor,panningModel:S.pannerAttr.panningModel!==void 0?S.pannerAttr.panningModel:L._panningModel})}else k.length===2&&(S=k[0],N=parseInt(k[1],10));for(var K=L._getSoundIds(N),ut=0;ut<K.length;ut++)if(I=L._soundById(K[ut])){var _t=I._pannerAttr;_t={coneInnerAngle:S.coneInnerAngle!==void 0?S.coneInnerAngle:_t.coneInnerAngle,coneOuterAngle:S.coneOuterAngle!==void 0?S.coneOuterAngle:_t.coneOuterAngle,coneOuterGain:S.coneOuterGain!==void 0?S.coneOuterGain:_t.coneOuterGain,distanceModel:S.distanceModel!==void 0?S.distanceModel:_t.distanceModel,maxDistance:S.maxDistance!==void 0?S.maxDistance:_t.maxDistance,refDistance:S.refDistance!==void 0?S.refDistance:_t.refDistance,rolloffFactor:S.rolloffFactor!==void 0?S.rolloffFactor:_t.rolloffFactor,panningModel:S.panningModel!==void 0?S.panningModel:_t.panningModel};var E=I._panner;E?(E.coneInnerAngle=_t.coneInnerAngle,E.coneOuterAngle=_t.coneOuterAngle,E.coneOuterGain=_t.coneOuterGain,E.distanceModel=_t.distanceModel,E.maxDistance=_t.maxDistance,E.refDistance=_t.refDistance,E.rolloffFactor=_t.rolloffFactor,E.panningModel=_t.panningModel):(I._pos||(I._pos=L._pos||[0,0,-.5]),T(I,"spatial"))}return L},Sound.prototype.init=function(S){return function(){var N=this._parent;this._orientation=N._orientation,this._stereo=N._stereo,this._pos=N._pos,this._pannerAttr=N._pannerAttr,S.call(this),this._stereo?N.stereo(this._stereo):this._pos&&N.pos(this._pos[0],this._pos[1],this._pos[2],this._id)}}(Sound.prototype.init),Sound.prototype.reset=function(S){return function(){var N=this._parent;return this._orientation=N._orientation,this._stereo=N._stereo,this._pos=N._pos,this._pannerAttr=N._pannerAttr,this._stereo?N.stereo(this._stereo):this._pos?N.pos(this._pos[0],this._pos[1],this._pos[2],this._id):this._panner&&(this._panner.disconnect(0),this._panner=void 0,N._refreshBuffer(this)),S.call(this)}}(Sound.prototype.reset);var T=function(S,N){(N=N||"spatial")==="spatial"?(S._panner=Howler.ctx.createPanner(),S._panner.coneInnerAngle=S._pannerAttr.coneInnerAngle,S._panner.coneOuterAngle=S._pannerAttr.coneOuterAngle,S._panner.coneOuterGain=S._pannerAttr.coneOuterGain,S._panner.distanceModel=S._pannerAttr.distanceModel,S._panner.maxDistance=S._pannerAttr.maxDistance,S._panner.refDistance=S._pannerAttr.refDistance,S._panner.rolloffFactor=S._pannerAttr.rolloffFactor,S._panner.panningModel=S._pannerAttr.panningModel,S._panner.positionX!==void 0?(S._panner.positionX.setValueAtTime(S._pos[0],Howler.ctx.currentTime),S._panner.positionY.setValueAtTime(S._pos[1],Howler.ctx.currentTime),S._panner.positionZ.setValueAtTime(S._pos[2],Howler.ctx.currentTime)):S._panner.setPosition(S._pos[0],S._pos[1],S._pos[2]),S._panner.orientationX!==void 0?(S._panner.orientationX.setValueAtTime(S._orientation[0],Howler.ctx.currentTime),S._panner.orientationY.setValueAtTime(S._orientation[1],Howler.ctx.currentTime),S._panner.orientationZ.setValueAtTime(S._orientation[2],Howler.ctx.currentTime)):S._panner.setOrientation(S._orientation[0],S._orientation[1],S._orientation[2])):(S._panner=Howler.ctx.createStereoPanner(),S._panner.pan.setValueAtTime(S._stereo,Howler.ctx.currentTime)),S._panner.connect(S._node),S._paused||S._parent.pause(S._id,!0).play(S._id,!0)}}()}).call(this,d(11))},function(m,y){m.exports=`varying vec2 vTextureCoord;
|
|
1915
1915
|
varying vec2 vVertexPosition;
|
|
1916
1916
|
varying float vPercent;
|
|
1917
1917
|
varying float vDirection;
|
|
@@ -2019,11 +2019,11 @@ void main() {
|
|
|
2019
2019
|
vec4 color1 = texture2D(uSampler, vTextureCoord);
|
|
2020
2020
|
gl_FragColor = color1 * alpha;
|
|
2021
2021
|
}
|
|
2022
|
-
`},function(m,y,d){var x;(function(b,R){var T="model",S="name",N="type",C="vendor",L="version",k="mobile",K="tablet",ut="smarttv",_t=function(at){for(var $={},tt=0;tt<at.length;tt++)$[at[tt].toUpperCase()]=at[tt];return $},E=function(at,$){return typeof at=="string"&&I($).indexOf(I(at))!==-1},I=function(at){return at.toLowerCase()},D=function(at,$){if(typeof at=="string")return at=at.replace(/^\s\s*/,"").replace(/\s\s*$/,""),$===void 0?at:at.substring(0,255)},F=function(at,$){for(var tt,lt,w,ot,bt,dt,yt=0;yt<$.length&&!bt;){var Ot=$[yt],kt=$[yt+1];for(tt=lt=0;tt<Ot.length&&!bt;)if(bt=Ot[tt++].exec(at))for(w=0;w<kt.length;w++)dt=bt[++lt],typeof(ot=kt[w])=="object"&&ot.length>0?ot.length===2?typeof ot[1]=="function"?this[ot[0]]=ot[1].call(this,dt):this[ot[0]]=ot[1]:ot.length===3?typeof ot[1]!="function"||ot[1].exec&&ot[1].test?this[ot[0]]=dt?dt.replace(ot[1],ot[2]):void 0:this[ot[0]]=dt?ot[1].call(this,dt,ot[2]):void 0:ot.length===4&&(this[ot[0]]=dt?ot[3].call(this,dt.replace(ot[1],ot[2])):void 0):this[ot]=dt||void 0;yt+=2}},P=function(at,$){for(var tt in $)if(typeof $[tt]=="object"&&$[tt].length>0){for(var lt=0;lt<$[tt].length;lt++)if(E($[tt][lt],at))return tt==="?"?void 0:tt}else if(E($[tt],at))return tt==="?"?void 0:tt;return at},B={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},G={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[L,[S,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[L,[S,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[S,L],[/opios[\/ ]+([\w\.]+)/i],[L,[S,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[L,[S,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[S,L],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[L,[S,"UCBrowser"]],[/\bqbcore\/([\w\.]+)/i],[L,[S,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[L,[S,"WeChat"]],[/konqueror\/([\w\.]+)/i],[L,[S,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[L,[S,"IE"]],[/yabrowser\/([\w\.]+)/i],[L,[S,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[S,/(.+)/,"$1 Secure Browser"],L],[/\bfocus\/([\w\.]+)/i],[L,[S,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[L,[S,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[L,[S,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[L,[S,"Dolphin"]],[/coast\/([\w\.]+)/i],[L,[S,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[L,[S,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[L,[S,"Firefox"]],[/\bqihu|(qi?ho?o?|360)browser/i],[[S,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[S,/(.+)/,"$1 Browser"],L],[/(comodo_dragon)\/([\w\.]+)/i],[[S,/_/g," "],L],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[S,L],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[S],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[S,"Facebook"],L],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[S,L],[/\bgsa\/([\w\.]+) .*safari\//i],[L,[S,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[L,[S,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[S,"Chrome WebView"],L],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[L,[S,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[S,L],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[L,[S,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[L,S],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[S,[L,P,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[S,L],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[S,"Netscape"],L],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[L,[S,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[S,L]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[["architecture","amd64"]],[/(ia32(?=;))/i],[["architecture",I]],[/((?:i[346]|x)86)[;\)]/i],[["architecture","ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[["architecture","arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[["architecture","armhf"]],[/windows (ce|mobile); ppc;/i],[["architecture","arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[["architecture",/ower/,"",I]],[/(sun4\w)[;\)]/i],[["architecture","sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[["architecture",I]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[T,[C,"Samsung"],[N,K]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[T,[C,"Samsung"],[N,k]],[/\((ip(?:hone|od)[\w ]*);/i],[T,[C,"Apple"],[N,k]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[T,[C,"Apple"],[N,K]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[T,[C,"Huawei"],[N,K]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[T,[C,"Huawei"],[N,k]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[T,/_/g," "],[C,"Xiaomi"],[N,k]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[T,/_/g," "],[C,"Xiaomi"],[N,K]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[T,[C,"OPPO"],[N,k]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[T,[C,"Vivo"],[N,k]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[T,[C,"Realme"],[N,k]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[T,[C,"Motorola"],[N,k]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[T,[C,"Motorola"],[N,K]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[T,[C,"LG"],[N,K]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[T,[C,"LG"],[N,k]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[T,[C,"Lenovo"],[N,K]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[T,/_/g," "],[C,"Nokia"],[N,k]],[/(pixel c)\b/i],[T,[C,"Google"],[N,K]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[T,[C,"Google"],[N,k]],[/droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[T,[C,"Sony"],[N,k]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[T,"Xperia Tablet"],[C,"Sony"],[N,K]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[T,[C,"OnePlus"],[N,k]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[T,[C,"Amazon"],[N,K]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[T,/(.+)/g,"Fire Phone $1"],[C,"Amazon"],[N,k]],[/(playbook);[-\w\),; ]+(rim)/i],[T,C,[N,K]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[T,[C,"BlackBerry"],[N,k]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[T,[C,"ASUS"],[N,K]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[T,[C,"ASUS"],[N,k]],[/(nexus 9)/i],[T,[C,"HTC"],[N,K]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[C,[T,/_/g," "],[N,k]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[T,[C,"Acer"],[N,K]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[T,[C,"Meizu"],[N,k]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[T,[C,"Sharp"],[N,k]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[C,T,[N,k]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[C,T,[N,K]],[/(surface duo)/i],[T,[C,"Microsoft"],[N,K]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[T,[C,"Fairphone"],[N,k]],[/(u304aa)/i],[T,[C,"AT&T"],[N,k]],[/\bsie-(\w*)/i],[T,[C,"Siemens"],[N,k]],[/\b(rct\w+) b/i],[T,[C,"RCA"],[N,K]],[/\b(venue[\d ]{2,7}) b/i],[T,[C,"Dell"],[N,K]],[/\b(q(?:mv|ta)\w+) b/i],[T,[C,"Verizon"],[N,K]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[T,[C,"Barnes & Noble"],[N,K]],[/\b(tm\d{3}\w+) b/i],[T,[C,"NuVision"],[N,K]],[/\b(k88) b/i],[T,[C,"ZTE"],[N,K]],[/\b(nx\d{3}j) b/i],[T,[C,"ZTE"],[N,k]],[/\b(gen\d{3}) b.+49h/i],[T,[C,"Swiss"],[N,k]],[/\b(zur\d{3}) b/i],[T,[C,"Swiss"],[N,K]],[/\b((zeki)?tb.*\b) b/i],[T,[C,"Zeki"],[N,K]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[C,"Dragon Touch"],T,[N,K]],[/\b(ns-?\w{0,9}) b/i],[T,[C,"Insignia"],[N,K]],[/\b((nxa|next)-?\w{0,9}) b/i],[T,[C,"NextBook"],[N,K]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[C,"Voice"],T,[N,k]],[/\b(lvtel\-)?(v1[12]) b/i],[[C,"LvTel"],T,[N,k]],[/\b(ph-1) /i],[T,[C,"Essential"],[N,k]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[T,[C,"Envizen"],[N,K]],[/\b(trio[-\w\. ]+) b/i],[T,[C,"MachSpeed"],[N,K]],[/\btu_(1491) b/i],[T,[C,"Rotor"],[N,K]],[/(shield[\w ]+) b/i],[T,[C,"Nvidia"],[N,K]],[/(sprint) (\w+)/i],[C,T,[N,k]],[/(kin\.[onetw]{3})/i],[[T,/\./g," "],[C,"Microsoft"],[N,k]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[T,[C,"Zebra"],[N,K]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[T,[C,"Zebra"],[N,k]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[C,T,[N,"console"]],[/droid.+; (shield) bui/i],[T,[C,"Nvidia"],[N,"console"]],[/(playstation [345portablevi]+)/i],[T,[C,"Sony"],[N,"console"]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[T,[C,"Microsoft"],[N,"console"]],[/smart-tv.+(samsung)/i],[C,[N,ut]],[/hbbtv.+maple;(\d+)/i],[[T,/^/,"SmartTV"],[C,"Samsung"],[N,ut]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[C,"LG"],[N,ut]],[/(apple) ?tv/i],[C,[T,"Apple TV"],[N,ut]],[/crkey/i],[[T,"Chromecast"],[C,"Google"],[N,ut]],[/droid.+aft(\w)( bui|\))/i],[T,[C,"Amazon"],[N,ut]],[/\(dtv[\);].+(aquos)/i],[T,[C,"Sharp"],[N,ut]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[C,D],[T,D],[N,ut]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[N,ut]],[/((pebble))app/i],[C,T,[N,"wearable"]],[/droid.+; (glass) \d/i],[T,[C,"Google"],[N,"wearable"]],[/droid.+; (wt63?0{2,3})\)/i],[T,[C,"Zebra"],[N,"wearable"]],[/(quest( 2)?)/i],[T,[C,"Facebook"],[N,"wearable"]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[C,[N,"embedded"]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[T,[N,k]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[T,[N,K]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[N,K]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[N,k]],[/(android[-\w\. ]{0,9});.+buil/i],[T,[C,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[L,[S,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[L,[S,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[S,L],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[L,S]],os:[[/microsoft (windows) (vista|xp)/i],[S,L],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[S,[L,P,B]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[S,"Windows"],[L,P,B]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[L,/_/g,"."],[S,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[S,"Mac OS"],[L,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[L,S],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[S,L],[/\(bb(10);/i],[L,[S,"BlackBerry"]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[L,[S,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[L,[S,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[L,[S,"webOS"]],[/crkey\/([\d\.]+)/i],[L,[S,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[S,"Chromium OS"],L],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[S,L],[/(sunos) ?([\w\.\d]*)/i],[[S,"Solaris"],L],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[S,L]]},q=function(at,$){if(typeof at=="object"&&($=at,at=void 0),!(this instanceof q))return new q(at,$).getResult();var tt=at||(b!==void 0&&b.navigator&&b.navigator.userAgent?b.navigator.userAgent:""),lt=$?function(w,ot){var bt={};for(var dt in w)ot[dt]&&ot[dt].length%2==0?bt[dt]=ot[dt].concat(w[dt]):bt[dt]=w[dt];return bt}(G,$):G;return this.getBrowser=function(){var w,ot={};return ot[S]=void 0,ot[L]=void 0,F.call(ot,tt,lt.browser),ot.major=typeof(w=ot.version)=="string"?w.replace(/[^\d\.]/g,"").split(".")[0]:void 0,ot},this.getCPU=function(){var w={architecture:void 0};return F.call(w,tt,lt.cpu),w},this.getDevice=function(){var w={vendor:void 0,model:void 0,type:void 0};return F.call(w,tt,lt.device),w},this.getEngine=function(){var w={name:void 0,version:void 0};return F.call(w,tt,lt.engine),w},this.getOS=function(){var w={name:void 0,version:void 0};return F.call(w,tt,lt.os),w},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return tt},this.setUA=function(w){return tt=typeof w=="string"&&w.length>255?D(w,255):w,this},this.setUA(tt),this};q.VERSION="1.0.2",q.BROWSER=_t([S,L,"major"]),q.CPU=_t(["architecture"]),q.DEVICE=_t([T,C,N,"console",k,ut,K,"wearable","embedded"]),q.ENGINE=q.OS=_t([S,L]),y!==void 0?(m!==void 0&&m.exports&&(y=m.exports=q),y.UAParser=q):d(110)?(x=function(){return q}.call(y,d,y,m))===void 0||(m.exports=x):b!==void 0&&(b.UAParser=q);var Rt=b!==void 0&&(b.jQuery||b.Zepto);if(Rt&&!Rt.ua){var Xt=new q;Rt.ua=Xt.getResult(),Rt.ua.get=function(){return Xt.getUA()},Rt.ua.set=function(at){Xt.setUA(at);var $=Xt.getResult();for(var tt in $)Rt.ua[tt]=$[tt]}}})(typeof window=="object"?window:this)},function(m,y,d){var x=d(111);m.exports=function(b,R){return x(b,R)}},function(m,y,d){var x=d(12),b=Object.prototype,R=b.hasOwnProperty,T=b.toString,S=x?x.toStringTag:void 0;m.exports=function(N){var C=R.call(N,S),L=N[S];try{N[S]=void 0;var k=!0}catch{}var K=T.call(N);return k&&(C?N[S]=L:delete N[S]),K}},function(m,y){var d=Object.prototype.toString;m.exports=function(x){return d.call(x)}},function(m,y,d){(function(x,b){var R;/*! https://mths.be/punycode v1.4.1 by @mathias */(function(T){y&&y.nodeType,x&&x.nodeType;var S=typeof b=="object"&&b;S.global!==S&&S.window!==S&&S.self;var N,C=2147483647,L=/^xn--/,k=/[^\x20-\x7E]/,K=/[\x2E\u3002\uFF0E\uFF61]/g,ut={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},_t=Math.floor,E=String.fromCharCode;function I(at){throw new RangeError(ut[at])}function D(at,$){for(var tt=at.length,lt=[];tt--;)lt[tt]=$(at[tt]);return lt}function F(at,$){var tt=at.split("@"),lt="";return tt.length>1&&(lt=tt[0]+"@",at=tt[1]),lt+D((at=at.replace(K,".")).split("."),$).join(".")}function P(at){for(var $,tt,lt=[],w=0,ot=at.length;w<ot;)($=at.charCodeAt(w++))>=55296&&$<=56319&&w<ot?(64512&(tt=at.charCodeAt(w++)))==56320?lt.push(((1023&$)<<10)+(1023&tt)+65536):(lt.push($),w--):lt.push($);return lt}function B(at){return D(at,function($){var tt="";return $>65535&&(tt+=E(($-=65536)>>>10&1023|55296),$=56320|1023&$),tt+=E($)}).join("")}function G(at,$){return at+22+75*(at<26)-(($!=0)<<5)}function q(at,$,tt){var lt=0;for(at=tt?_t(at/700):at>>1,at+=_t(at/$);at>455;lt+=36)at=_t(at/35);return _t(lt+36*at/(at+38))}function Rt(at){var $,tt,lt,w,ot,bt,dt,yt,Ot,kt,Dt,te=[],re=at.length,$t=0,pe=128,le=72;for((tt=at.lastIndexOf("-"))<0&&(tt=0),lt=0;lt<tt;++lt)at.charCodeAt(lt)>=128&&I("not-basic"),te.push(at.charCodeAt(lt));for(w=tt>0?tt+1:0;w<re;){for(ot=$t,bt=1,dt=36;w>=re&&I("invalid-input"),((yt=(Dt=at.charCodeAt(w++))-48<10?Dt-22:Dt-65<26?Dt-65:Dt-97<26?Dt-97:36)>=36||yt>_t((C-$t)/bt))&&I("overflow"),$t+=yt*bt,!(yt<(Ot=dt<=le?1:dt>=le+26?26:dt-le));dt+=36)bt>_t(C/(kt=36-Ot))&&I("overflow"),bt*=kt;le=q($t-ot,$=te.length+1,ot==0),_t($t/$)>C-pe&&I("overflow"),pe+=_t($t/$),$t%=$,te.splice($t++,0,pe)}return B(te)}function Xt(at){var $,tt,lt,w,ot,bt,dt,yt,Ot,kt,Dt,te,re,$t,pe,le=[];for(te=(at=P(at)).length,$=128,tt=0,ot=72,bt=0;bt<te;++bt)(Dt=at[bt])<128&&le.push(E(Dt));for(lt=w=le.length,w&&le.push("-");lt<te;){for(dt=C,bt=0;bt<te;++bt)(Dt=at[bt])>=$&&Dt<dt&&(dt=Dt);for(dt-$>_t((C-tt)/(re=lt+1))&&I("overflow"),tt+=(dt-$)*re,$=dt,bt=0;bt<te;++bt)if((Dt=at[bt])<$&&++tt>C&&I("overflow"),Dt==$){for(yt=tt,Ot=36;!(yt<(kt=Ot<=ot?1:Ot>=ot+26?26:Ot-ot));Ot+=36)pe=yt-kt,$t=36-kt,le.push(E(G(kt+pe%$t,0))),yt=_t(pe/$t);le.push(E(G(yt,0))),ot=q(tt,re,lt==w),tt=0,++lt}++tt,++$}return le.join("")}N={version:"1.4.1",ucs2:{decode:P,encode:B},decode:Rt,encode:Xt,toASCII:function(at){return F(at,function($){return k.test($)?"xn--"+Xt($):$})},toUnicode:function(at){return F(at,function($){return L.test($)?Rt($.slice(4).toLowerCase()):$})}},(R=function(){return N}.call(y,d,y,x))===void 0||(x.exports=R)})()}).call(this,d(13)(m),d(11))},function(m,y,d){m.exports={isString:function(x){return typeof x=="string"},isObject:function(x){return typeof x=="object"&&x!==null},isNull:function(x){return x===null},isNullOrUndefined:function(x){return x==null}}},function(m,y,d){y.decode=y.parse=d(102),y.encode=y.stringify=d(103)},function(m,y,d){function x(R,T){return Object.prototype.hasOwnProperty.call(R,T)}m.exports=function(R,T,S,N){T=T||"&",S=S||"=";var C={};if(typeof R!="string"||R.length===0)return C;var L=/\+/g;R=R.split(T);var k=1e3;N&&typeof N.maxKeys=="number"&&(k=N.maxKeys);var K=R.length;k>0&&K>k&&(K=k);for(var ut=0;ut<K;++ut){var _t,E,I,D,F=R[ut].replace(L,"%20"),P=F.indexOf(S);P>=0?(_t=F.substr(0,P),E=F.substr(P+1)):(_t=F,E=""),I=decodeURIComponent(_t),D=decodeURIComponent(E),x(C,I)?b(C[I])?C[I].push(D):C[I]=[C[I],D]:C[I]=D}return C};var b=Array.isArray||function(R){return Object.prototype.toString.call(R)==="[object Array]"}},function(m,y,d){var x=function(S){switch(typeof S){case"string":return S;case"boolean":return S?"true":"false";case"number":return isFinite(S)?S:"";default:return""}};m.exports=function(S,N,C,L){return N=N||"&",C=C||"=",S===null&&(S=void 0),typeof S=="object"?R(T(S),function(k){var K=encodeURIComponent(x(k))+C;return b(S[k])?R(S[k],function(ut){return K+encodeURIComponent(x(ut))}).join(N):K+encodeURIComponent(x(S[k]))}).join(N):L?encodeURIComponent(x(L))+C+encodeURIComponent(x(S)):""};var b=Array.isArray||function(S){return Object.prototype.toString.call(S)==="[object Array]"};function R(S,N){if(S.map)return S.map(N);for(var C=[],L=0;L<S.length;L++)C.push(N(S[L],L));return C}var T=Object.keys||function(S){var N=[];for(var C in S)Object.prototype.hasOwnProperty.call(S,C)&&N.push(C);return N}},function(m,y){var d=function(){};d.prototype={fit:function(x){var b,R,T,S,N=x.length,C=N>0?x[0].width:0,L=N>0?x[0].height:0;for(this.root={x:0,y:0,width:C,height:L},b=0;b<N;b++)T=x[b],(R=this.findNode(this.root,T.width,T.height))?(S=this.splitNode(R,T.width,T.height),T.x=S.x,T.y=S.y):(S=this.growNode(T.width,T.height),T.x=S.x,T.y=S.y)},findNode:function(x,b,R){return x.used?this.findNode(x.right,b,R)||this.findNode(x.down,b,R):b<=x.width&&R<=x.height?x:null},splitNode:function(x,b,R){return x.used=!0,x.down={x:x.x,y:x.y+R,width:x.width,height:x.height-R},x.right={x:x.x+b,y:x.y,width:x.width-b,height:R},x},growNode:function(x,b){var R=x<=this.root.width,T=b<=this.root.height,S=T&&this.root.height>=this.root.width+x,N=R&&this.root.width>=this.root.height+b;return S?this.growRight(x,b):N?this.growDown(x,b):T?this.growRight(x,b):R?this.growDown(x,b):null},growRight:function(x,b){var R;return this.root={used:!0,x:0,y:0,width:this.root.width+x,height:this.root.height,down:this.root,right:{x:this.root.width,y:0,width:x,height:this.root.height}},(R=this.findNode(this.root,x,b))?this.splitNode(R,x,b):null},growDown:function(x,b){var R;return this.root={used:!0,x:0,y:0,width:this.root.width,height:this.root.height+b,down:{x:0,y:this.root.height,width:this.root.width,height:b},right:this.root},(R=this.findNode(this.root,x,b))?this.splitNode(R,x,b):null}},m.exports=d},function(m,y,d){var x=d(3);m.exports=function(){return x.Date.now()}},function(m,y,d){var x=d(107),b=d(7),R=d(109),T=/^[-+]0x[0-9a-f]+$/i,S=/^0b[01]+$/i,N=/^0o[0-7]+$/i,C=parseInt;m.exports=function(L){if(typeof L=="number")return L;if(R(L))return NaN;if(b(L)){var k=typeof L.valueOf=="function"?L.valueOf():L;L=b(k)?k+"":k}if(typeof L!="string")return L===0?L:+L;L=x(L);var K=S.test(L);return K||N.test(L)?C(L.slice(2),K?2:8):T.test(L)?NaN:+L}},function(m,y,d){var x=d(108),b=/^\s+/;m.exports=function(R){return R&&R.slice(0,x(R)+1).replace(b,"")}},function(m,y){var d=/\s/;m.exports=function(x){for(var b=x.length;b--&&d.test(x.charAt(b)););return b}},function(m,y,d){var x=d(6),b=d(4);m.exports=function(R){return typeof R=="symbol"||b(R)&&x(R)=="[object Symbol]"}},function(m,y){(function(d){m.exports=d}).call(this,{})},function(m,y,d){var x=d(112),b=d(4);m.exports=function R(T,S,N,C,L){return T===S||(T==null||S==null||!b(T)&&!b(S)?T!=T&&S!=S:x(T,S,N,C,R,L))}},function(m,y,d){var x=d(38),b=d(41),R=d(144),T=d(147),S=d(19),N=d(18),C=d(27),L=d(48),k="[object Object]",K=Object.prototype.hasOwnProperty;m.exports=function(ut,_t,E,I,D,F){var P=N(ut),B=N(_t),G=P?"[object Array]":S(ut),q=B?"[object Array]":S(_t),Rt=(G=G=="[object Arguments]"?k:G)==k,Xt=(q=q=="[object Arguments]"?k:q)==k,at=G==q;if(at&&C(ut)){if(!C(_t))return!1;P=!0,Rt=!1}if(at&&!Rt)return F||(F=new x),P||L(ut)?b(ut,_t,E,I,D,F):R(ut,_t,G,E,I,D,F);if(!(1&E)){var $=Rt&&K.call(ut,"__wrapped__"),tt=Xt&&K.call(_t,"__wrapped__");if($||tt){var lt=$?ut.value():ut,w=tt?_t.value():_t;return F||(F=new x),D(lt,w,E,I,F)}}return!!at&&(F||(F=new x),T(ut,_t,E,I,D,F))}},function(m,y){m.exports=function(){this.__data__=[],this.size=0}},function(m,y,d){var x=d(15),b=Array.prototype.splice;m.exports=function(R){var T=this.__data__,S=x(T,R);return!(S<0)&&(S==T.length-1?T.pop():b.call(T,S,1),--this.size,!0)}},function(m,y,d){var x=d(15);m.exports=function(b){var R=this.__data__,T=x(R,b);return T<0?void 0:R[T][1]}},function(m,y,d){var x=d(15);m.exports=function(b){return x(this.__data__,b)>-1}},function(m,y,d){var x=d(15);m.exports=function(b,R){var T=this.__data__,S=x(T,b);return S<0?(++this.size,T.push([b,R])):T[S][1]=R,this}},function(m,y,d){var x=d(14);m.exports=function(){this.__data__=new x,this.size=0}},function(m,y){m.exports=function(d){var x=this.__data__,b=x.delete(d);return this.size=x.size,b}},function(m,y){m.exports=function(d){return this.__data__.get(d)}},function(m,y){m.exports=function(d){return this.__data__.has(d)}},function(m,y,d){var x=d(14),b=d(24),R=d(40);m.exports=function(T,S){var N=this.__data__;if(N instanceof x){var C=N.__data__;if(!b||C.length<199)return C.push([T,S]),this.size=++N.size,this;N=this.__data__=new R(C)}return N.set(T,S),this.size=N.size,this}},function(m,y,d){var x=d(21),b=d(124),R=d(7),T=d(39),S=/^\[object .+?Constructor\]$/,N=Function.prototype,C=Object.prototype,L=N.toString,k=C.hasOwnProperty,K=RegExp("^"+L.call(k).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");m.exports=function(ut){return!(!R(ut)||b(ut))&&(x(ut)?K:S).test(T(ut))}},function(m,y,d){var x,b=d(125),R=(x=/[^.]+$/.exec(b&&b.keys&&b.keys.IE_PROTO||""))?"Symbol(src)_1."+x:"";m.exports=function(T){return!!R&&R in T}},function(m,y,d){var x=d(3)["__core-js_shared__"];m.exports=x},function(m,y){m.exports=function(d,x){return d==null?void 0:d[x]}},function(m,y,d){var x=d(128),b=d(14),R=d(24);m.exports=function(){this.size=0,this.__data__={hash:new x,map:new(R||b),string:new x}}},function(m,y,d){var x=d(129),b=d(130),R=d(131),T=d(132),S=d(133);function N(C){var L=-1,k=C==null?0:C.length;for(this.clear();++L<k;){var K=C[L];this.set(K[0],K[1])}}N.prototype.clear=x,N.prototype.delete=b,N.prototype.get=R,N.prototype.has=T,N.prototype.set=S,m.exports=N},function(m,y,d){var x=d(16);m.exports=function(){this.__data__=x?x(null):{},this.size=0}},function(m,y){m.exports=function(d){var x=this.has(d)&&delete this.__data__[d];return this.size-=x?1:0,x}},function(m,y,d){var x=d(16),b=Object.prototype.hasOwnProperty;m.exports=function(R){var T=this.__data__;if(x){var S=T[R];return S==="__lodash_hash_undefined__"?void 0:S}return b.call(T,R)?T[R]:void 0}},function(m,y,d){var x=d(16),b=Object.prototype.hasOwnProperty;m.exports=function(R){var T=this.__data__;return x?T[R]!==void 0:b.call(T,R)}},function(m,y,d){var x=d(16);m.exports=function(b,R){var T=this.__data__;return this.size+=this.has(b)?0:1,T[b]=x&&R===void 0?"__lodash_hash_undefined__":R,this}},function(m,y,d){var x=d(17);m.exports=function(b){var R=x(this,b).delete(b);return this.size-=R?1:0,R}},function(m,y){m.exports=function(d){var x=typeof d;return x=="string"||x=="number"||x=="symbol"||x=="boolean"?d!=="__proto__":d===null}},function(m,y,d){var x=d(17);m.exports=function(b){return x(this,b).get(b)}},function(m,y,d){var x=d(17);m.exports=function(b){return x(this,b).has(b)}},function(m,y,d){var x=d(17);m.exports=function(b,R){var T=x(this,b),S=T.size;return T.set(b,R),this.size+=T.size==S?0:1,this}},function(m,y,d){var x=d(40),b=d(140),R=d(141);function T(S){var N=-1,C=S==null?0:S.length;for(this.__data__=new x;++N<C;)this.add(S[N])}T.prototype.add=T.prototype.push=b,T.prototype.has=R,m.exports=T},function(m,y){m.exports=function(d){return this.__data__.set(d,"__lodash_hash_undefined__"),this}},function(m,y){m.exports=function(d){return this.__data__.has(d)}},function(m,y){m.exports=function(d,x){for(var b=-1,R=d==null?0:d.length;++b<R;)if(x(d[b],b,d))return!0;return!1}},function(m,y){m.exports=function(d,x){return d.has(x)}},function(m,y,d){var x=d(12),b=d(42),R=d(23),T=d(41),S=d(145),N=d(146),C=x?x.prototype:void 0,L=C?C.valueOf:void 0;m.exports=function(k,K,ut,_t,E,I,D){switch(ut){case"[object DataView]":if(k.byteLength!=K.byteLength||k.byteOffset!=K.byteOffset)return!1;k=k.buffer,K=K.buffer;case"[object ArrayBuffer]":return!(k.byteLength!=K.byteLength||!I(new b(k),new b(K)));case"[object Boolean]":case"[object Date]":case"[object Number]":return R(+k,+K);case"[object Error]":return k.name==K.name&&k.message==K.message;case"[object RegExp]":case"[object String]":return k==K+"";case"[object Map]":var F=S;case"[object Set]":var P=1&_t;if(F||(F=N),k.size!=K.size&&!P)return!1;var B=D.get(k);if(B)return B==K;_t|=2,D.set(k,K);var G=T(F(k),F(K),_t,E,I,D);return D.delete(k),G;case"[object Symbol]":if(L)return L.call(k)==L.call(K)}return!1}},function(m,y){m.exports=function(d){var x=-1,b=Array(d.size);return d.forEach(function(R,T){b[++x]=[T,R]}),b}},function(m,y){m.exports=function(d){var x=-1,b=Array(d.size);return d.forEach(function(R){b[++x]=R}),b}},function(m,y,d){var x=d(43),b=Object.prototype.hasOwnProperty;m.exports=function(R,T,S,N,C,L){var k=1&S,K=x(R),ut=K.length;if(ut!=x(T).length&&!k)return!1;for(var _t=ut;_t--;){var E=K[_t];if(!(k?E in T:b.call(T,E)))return!1}var I=L.get(R),D=L.get(T);if(I&&D)return I==T&&D==R;var F=!0;L.set(R,T),L.set(T,R);for(var P=k;++_t<ut;){var B=R[E=K[_t]],G=T[E];if(N)var q=k?N(G,B,E,T,R,L):N(B,G,E,R,T,L);if(!(q===void 0?B===G||C(B,G,S,N,L):q)){F=!1;break}P||(P=E=="constructor")}if(F&&!P){var Rt=R.constructor,Xt=T.constructor;Rt==Xt||!("constructor"in R)||!("constructor"in T)||typeof Rt=="function"&&Rt instanceof Rt&&typeof Xt=="function"&&Xt instanceof Xt||(F=!1)}return L.delete(R),L.delete(T),F}},function(m,y){m.exports=function(d,x){for(var b=-1,R=d==null?0:d.length,T=0,S=[];++b<R;){var N=d[b];x(N,b,d)&&(S[T++]=N)}return S}},function(m,y){m.exports=function(d,x){for(var b=-1,R=Array(d);++b<d;)R[b]=x(b);return R}},function(m,y,d){var x=d(151),b=d(4),R=Object.prototype,T=R.hasOwnProperty,S=R.propertyIsEnumerable,N=x(function(){return arguments}())?x:function(C){return b(C)&&T.call(C,"callee")&&!S.call(C,"callee")};m.exports=N},function(m,y,d){var x=d(6),b=d(4);m.exports=function(R){return b(R)&&x(R)=="[object Arguments]"}},function(m,y){m.exports=function(){return!1}},function(m,y){var d=/^(?:0|[1-9]\d*)$/;m.exports=function(x,b){var R=typeof x;return!!(b=b==null?9007199254740991:b)&&(R=="number"||R!="symbol"&&d.test(x))&&x>-1&&x%1==0&&x<b}},function(m,y,d){var x=d(6),b=d(49),R=d(4),T={};T["[object Float32Array]"]=T["[object Float64Array]"]=T["[object Int8Array]"]=T["[object Int16Array]"]=T["[object Int32Array]"]=T["[object Uint8Array]"]=T["[object Uint8ClampedArray]"]=T["[object Uint16Array]"]=T["[object Uint32Array]"]=!0,T["[object Arguments]"]=T["[object Array]"]=T["[object ArrayBuffer]"]=T["[object Boolean]"]=T["[object DataView]"]=T["[object Date]"]=T["[object Error]"]=T["[object Function]"]=T["[object Map]"]=T["[object Number]"]=T["[object Object]"]=T["[object RegExp]"]=T["[object Set]"]=T["[object String]"]=T["[object WeakMap]"]=!1,m.exports=function(S){return R(S)&&b(S.length)&&!!T[x(S)]}},function(m,y,d){var x=d(30),b=d(156),R=Object.prototype.hasOwnProperty;m.exports=function(T){if(!x(T))return b(T);var S=[];for(var N in Object(T))R.call(T,N)&&N!="constructor"&&S.push(N);return S}},function(m,y,d){var x=d(50)(Object.keys,Object);m.exports=x},function(m,y,d){var x=d(8)(d(3),"DataView");m.exports=x},function(m,y,d){var x=d(8)(d(3),"Promise");m.exports=x},function(m,y,d){var x=d(8)(d(3),"Set");m.exports=x},function(m,y,d){var x=d(8)(d(3),"WeakMap");m.exports=x},function(m,y,d){var x=d(38),b=d(162),R=d(52),T=d(164),S=d(165),N=d(168),C=d(169),L=d(170),k=d(171),K=d(43),ut=d(172),_t=d(19),E=d(173),I=d(174),D=d(179),F=d(18),P=d(27),B=d(181),G=d(7),q=d(183),Rt=d(26),Xt=d(31),at={};at["[object Arguments]"]=at["[object Array]"]=at["[object ArrayBuffer]"]=at["[object DataView]"]=at["[object Boolean]"]=at["[object Date]"]=at["[object Float32Array]"]=at["[object Float64Array]"]=at["[object Int8Array]"]=at["[object Int16Array]"]=at["[object Int32Array]"]=at["[object Map]"]=at["[object Number]"]=at["[object Object]"]=at["[object RegExp]"]=at["[object Set]"]=at["[object String]"]=at["[object Symbol]"]=at["[object Uint8Array]"]=at["[object Uint8ClampedArray]"]=at["[object Uint16Array]"]=at["[object Uint32Array]"]=!0,at["[object Error]"]=at["[object Function]"]=at["[object WeakMap]"]=!1,m.exports=function $(tt,lt,w,ot,bt,dt){var yt,Ot=1<,kt=2<,Dt=4<if(w&&(yt=bt?w(tt,ot,bt,dt):w(tt)),yt!==void 0)return yt;if(!G(tt))return tt;var te=F(tt);if(te){if(yt=E(tt),!Ot)return C(tt,yt)}else{var re=_t(tt),$t=re=="[object Function]"||re=="[object GeneratorFunction]";if(P(tt))return N(tt,Ot);if(re=="[object Object]"||re=="[object Arguments]"||$t&&!bt){if(yt=kt||$t?{}:D(tt),!Ot)return kt?k(tt,S(yt,tt)):L(tt,T(yt,tt))}else{if(!at[re])return bt?tt:{};yt=I(tt,re,Ot)}}dt||(dt=new x);var pe=dt.get(tt);if(pe)return pe;dt.set(tt,yt),q(tt)?tt.forEach(function(Se){yt.add($(Se,lt,w,Se,tt,dt))}):B(tt)&&tt.forEach(function(Se,ue){yt.set(ue,$(Se,lt,w,ue,tt,dt))});var le=te?void 0:(Dt?kt?ut:K:kt?Xt:Rt)(tt);return b(le||tt,function(Se,ue){le&&(Se=tt[ue=Se]),R(yt,ue,$(Se,lt,w,ue,tt,dt))}),yt}},function(m,y){m.exports=function(d,x){for(var b=-1,R=d==null?0:d.length;++b<R&&x(d[b],b,d)!==!1;);return d}},function(m,y,d){var x=d(8),b=function(){try{var R=x(Object,"defineProperty");return R({},"",{}),R}catch{}}();m.exports=b},function(m,y,d){var x=d(20),b=d(26);m.exports=function(R,T){return R&&x(T,b(T),R)}},function(m,y,d){var x=d(20),b=d(31);m.exports=function(R,T){return R&&x(T,b(T),R)}},function(m,y,d){var x=d(7),b=d(30),R=d(167),T=Object.prototype.hasOwnProperty;m.exports=function(S){if(!x(S))return R(S);var N=b(S),C=[];for(var L in S)(L!="constructor"||!N&&T.call(S,L))&&C.push(L);return C}},function(m,y){m.exports=function(d){var x=[];if(d!=null)for(var b in Object(d))x.push(b);return x}},function(m,y,d){(function(x){var b=d(3),R=y&&!y.nodeType&&y,T=R&&typeof x=="object"&&x&&!x.nodeType&&x,S=T&&T.exports===R?b.Buffer:void 0,N=S?S.allocUnsafe:void 0;x.exports=function(C,L){if(L)return C.slice();var k=C.length,K=N?N(k):new C.constructor(k);return C.copy(K),K}}).call(this,d(13)(m))},function(m,y){m.exports=function(d,x){var b=-1,R=d.length;for(x||(x=Array(R));++b<R;)x[b]=d[b];return x}},function(m,y,d){var x=d(20),b=d(25);m.exports=function(R,T){return x(R,b(R),T)}},function(m,y,d){var x=d(20),b=d(54);m.exports=function(R,T){return x(R,b(R),T)}},function(m,y,d){var x=d(44),b=d(54),R=d(31);m.exports=function(T){return x(T,R,b)}},function(m,y){var d=Object.prototype.hasOwnProperty;m.exports=function(x){var b=x.length,R=new x.constructor(b);return b&&typeof x[0]=="string"&&d.call(x,"index")&&(R.index=x.index,R.input=x.input),R}},function(m,y,d){var x=d(32),b=d(175),R=d(176),T=d(177),S=d(178);m.exports=function(N,C,L){var k=N.constructor;switch(C){case"[object ArrayBuffer]":return x(N);case"[object Boolean]":case"[object Date]":return new k(+N);case"[object DataView]":return b(N,L);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return S(N,L);case"[object Map]":return new k;case"[object Number]":case"[object String]":return new k(N);case"[object RegExp]":return R(N);case"[object Set]":return new k;case"[object Symbol]":return T(N)}}},function(m,y,d){var x=d(32);m.exports=function(b,R){var T=R?x(b.buffer):b.buffer;return new b.constructor(T,b.byteOffset,b.byteLength)}},function(m,y){var d=/\w*$/;m.exports=function(x){var b=new x.constructor(x.source,d.exec(x));return b.lastIndex=x.lastIndex,b}},function(m,y,d){var x=d(12),b=x?x.prototype:void 0,R=b?b.valueOf:void 0;m.exports=function(T){return R?Object(R.call(T)):{}}},function(m,y,d){var x=d(32);m.exports=function(b,R){var T=R?x(b.buffer):b.buffer;return new b.constructor(T,b.byteOffset,b.length)}},function(m,y,d){var x=d(180),b=d(55),R=d(30);m.exports=function(T){return typeof T.constructor!="function"||R(T)?{}:x(b(T))}},function(m,y,d){var x=d(7),b=Object.create,R=function(){function T(){}return function(S){if(!x(S))return{};if(b)return b(S);T.prototype=S;var N=new T;return T.prototype=void 0,N}}();m.exports=R},function(m,y,d){var x=d(182),b=d(28),R=d(29),T=R&&R.isMap,S=T?b(T):x;m.exports=S},function(m,y,d){var x=d(19),b=d(4);m.exports=function(R){return b(R)&&x(R)=="[object Map]"}},function(m,y,d){var x=d(184),b=d(28),R=d(29),T=R&&R.isSet,S=T?b(T):x;m.exports=S},function(m,y,d){var x=d(19),b=d(4);m.exports=function(R){return b(R)&&x(R)=="[object Set]"}},function(m,y,d){d.r(y),d.d(y,"ErrorType",function(){return In}),d.d(y,"preloadResource",function(){return CS}),d.d(y,"delay",function(){return Gu}),d.d(y,"waitUntil",function(){return NS}),d.d(y,"SLIDE_EVENTS",function(){return ti}),d.d(y,"Slide",function(){return Go});var x={};d.r(x),d.d(x,"isMobile",function(){return Vi}),d.d(x,"EventEmitter",function(){return Ar.a}),d.d(x,"earcut",function(){return Hh.a}),d.d(x,"BaseTextureCache",function(){return ai}),d.d(x,"CanvasRenderTarget",function(){return Zh}),d.d(x,"DATA_URI",function(){return xf}),d.d(x,"ProgramCache",function(){return $h}),d.d(x,"TextureCache",function(){return Vn}),d.d(x,"clearTextureCache",function(){return _E}),d.d(x,"correctBlendMode",function(){return uE}),d.d(x,"createIndicesForQuads",function(){return pE}),d.d(x,"decomposeDataUri",function(){return xE}),d.d(x,"deprecation",function(){return Yi}),d.d(x,"destroyTextureCache",function(){return vE}),d.d(x,"determineCrossOrigin",function(){return bf}),d.d(x,"getBufferType",function(){return Na}),d.d(x,"getResolutionOfUrl",function(){return Da}),d.d(x,"hex2rgb",function(){return La}),d.d(x,"hex2string",function(){return vf}),d.d(x,"interleaveTypedArrays",function(){return mE}),d.d(x,"isPow2",function(){return Yh}),d.d(x,"isWebGLSupported",function(){return gf}),d.d(x,"log2",function(){return qh}),d.d(x,"nextPow2",function(){return ao}),d.d(x,"premultiplyBlendMode",function(){return Wh}),d.d(x,"premultiplyRgba",function(){return dE}),d.d(x,"premultiplyTint",function(){return Xh}),d.d(x,"premultiplyTintToRgba",function(){return _f}),d.d(x,"removeItems",function(){return fr}),d.d(x,"rgb2hex",function(){return cE}),d.d(x,"sayHello",function(){return mf}),d.d(x,"sign",function(){return lo}),d.d(x,"skipHello",function(){return aE}),d.d(x,"string2hex",function(){return hE}),d.d(x,"trimCanvas",function(){return yE}),d.d(x,"uid",function(){return mr}),d.d(x,"url",function(){return cs});var b={};d.r(b),d.d(b,"ALPHA_MODES",function(){return Wi}),d.d(b,"BLEND_MODES",function(){return xe}),d.d(b,"BUFFER_BITS",function(){return so}),d.d(b,"BUFFER_TYPE",function(){return gi}),d.d(b,"CLEAR_MODES",function(){return Xi}),d.d(b,"DRAW_MODES",function(){return oi}),d.d(b,"ENV",function(){return Ii}),d.d(b,"FORMATS",function(){return he}),d.d(b,"GC_MODES",function(){return Ra}),d.d(b,"MASK_TYPES",function(){return An}),d.d(b,"MIPMAP_MODES",function(){return pr}),d.d(b,"MSAA_QUALITY",function(){return un}),d.d(b,"PRECISION",function(){return mi}),d.d(b,"RENDERER_TYPE",function(){return ls}),d.d(b,"SAMPLER_TYPES",function(){return oo}),d.d(b,"SCALE_MODES",function(){return Ri}),d.d(b,"TARGETS",function(){return dr}),d.d(b,"TYPES",function(){return Re}),d.d(b,"WRAP_MODES",function(){return hs}),d.d(b,"Circle",function(){return Ef}),d.d(b,"DEG_TO_RAD",function(){return Kh}),d.d(b,"Ellipse",function(){return wf}),d.d(b,"Matrix",function(){return mn}),d.d(b,"ObservablePoint",function(){return us}),d.d(b,"PI_2",function(){return ho}),d.d(b,"Point",function(){return on}),d.d(b,"Polygon",function(){return co}),d.d(b,"RAD_TO_DEG",function(){return Jh}),d.d(b,"Rectangle",function(){return Le}),d.d(b,"RoundedRectangle",function(){return ka}),d.d(b,"SHAPES",function(){return tn}),d.d(b,"Transform",function(){return tc}),d.d(b,"groupD8",function(){return en}),d.d(b,"Runner",function(){return Pn}),d.d(b,"isMobile",function(){return Vi}),d.d(b,"settings",function(){return ve}),d.d(b,"Ticker",function(){return Bn}),d.d(b,"TickerPlugin",function(){return Vf}),d.d(b,"UPDATE_PRIORITY",function(){return Li}),d.d(b,"utils",function(){return x}),d.d(b,"AbstractBatchRenderer",function(){return Pm}),d.d(b,"AbstractMultiResource",function(){return Ga}),d.d(b,"AbstractRenderer",function(){return Tm}),d.d(b,"ArrayResource",function(){return sc}),d.d(b,"Attribute",function(){return uc}),d.d(b,"BaseImageResource",function(){return Ni}),d.d(b,"BaseRenderTexture",function(){return hc}),d.d(b,"BaseTexture",function(){return Be}),d.d(b,"BatchDrawCall",function(){return Ka}),d.d(b,"BatchGeometry",function(){return Lc}),d.d(b,"BatchPluginFactory",function(){return Lm}),d.d(b,"BatchRenderer",function(){return Nm}),d.d(b,"BatchShaderGenerator",function(){return Cm}),d.d(b,"BatchSystem",function(){return mc}),d.d(b,"BatchTextureArray",function(){return Qa}),d.d(b,"Buffer",function(){return Cn}),d.d(b,"BufferResource",function(){return po}),d.d(b,"CanvasResource",function(){return Ha}),d.d(b,"ContextSystem",function(){return gc}),d.d(b,"CubeResource",function(){return oc}),d.d(b,"Filter",function(){return li}),d.d(b,"FilterState",function(){return Qf}),d.d(b,"FilterSystem",function(){return pc}),d.d(b,"Framebuffer",function(){return Va}),d.d(b,"FramebufferSystem",function(){return vc}),d.d(b,"GLFramebuffer",function(){return em}),d.d(b,"GLProgram",function(){return bm}),d.d(b,"GLTexture",function(){return Ja}),d.d(b,"Geometry",function(){return ps}),d.d(b,"GeometrySystem",function(){return yc}),d.d(b,"IGLUniformData",function(){return UE}),d.d(b,"INSTALLED",function(){return uo}),d.d(b,"ImageBitmapResource",function(){return lc}),d.d(b,"ImageResource",function(){return za}),d.d(b,"MaskData",function(){return nm}),d.d(b,"MaskSystem",function(){return Ec}),d.d(b,"ObjectRenderer",function(){return fc}),d.d(b,"Program",function(){return go}),d.d(b,"ProjectionSystem",function(){return Sc}),d.d(b,"Quad",function(){return Jf}),d.d(b,"QuadUv",function(){return Kf}),d.d(b,"RenderTexture",function(){return Wn}),d.d(b,"RenderTexturePool",function(){return $f}),d.d(b,"RenderTextureSystem",function(){return Mc}),d.d(b,"Renderer",function(){return _o}),d.d(b,"Resource",function(){return Lr}),d.d(b,"SVGResource",function(){return ac}),d.d(b,"ScissorSystem",function(){return wc}),d.d(b,"Shader",function(){return fs}),d.d(b,"ShaderSystem",function(){return Ac}),d.d(b,"SpriteMaskFilter",function(){return fm}),d.d(b,"State",function(){return ms}),d.d(b,"StateSystem",function(){return Pc}),d.d(b,"StencilSystem",function(){return Tc}),d.d(b,"System",function(){return jE}),d.d(b,"Texture",function(){return Je}),d.d(b,"TextureGCSystem",function(){return Cc}),d.d(b,"TextureMatrix",function(){return bc}),d.d(b,"TextureSystem",function(){return Ic}),d.d(b,"TextureUvs",function(){return cc}),d.d(b,"UniformGroup",function(){return gr}),d.d(b,"VideoResource",function(){return ja}),d.d(b,"ViewableBuffer",function(){return Am}),d.d(b,"autoDetectRenderer",function(){return Sm}),d.d(b,"autoDetectResource",function(){return Ba}),d.d(b,"checkMaxIfStatementsInShader",function(){return dm}),d.d(b,"createUBOElements",function(){return _m}),d.d(b,"defaultFilterVertex",function(){return Mm}),d.d(b,"defaultVertex",function(){return zE}),d.d(b,"generateProgram",function(){return Em}),d.d(b,"generateUniformBufferSync",function(){return xm}),d.d(b,"getTestContext",function(){return am}),d.d(b,"getUBOData",function(){return ym}),d.d(b,"resources",function(){return Om}),d.d(b,"systems",function(){return Dm}),d.d(b,"uniformParsers",function(){return Nr}),d.d(b,"Sprite",function(){return Gn}),d.d(b,"Application",function(){return tl}),d.d(b,"Bounds",function(){return ds}),d.d(b,"Container",function(){return On}),d.d(b,"DisplayObject",function(){return dn}),d.d(b,"TemporaryDisplayObject",function(){return ic}),d.d(b,"Mesh",function(){return Ev}),d.d(b,"MeshBatchUvs",function(){return xv}),d.d(b,"MeshGeometry",function(){return iw}),d.d(b,"MeshMaterial",function(){return nw}),d.d(b,"FillStyle",function(){return Zc}),d.d(b,"GRAPHICS_CURVES",function(){return _s}),d.d(b,"Graphics",function(){return vi}),d.d(b,"GraphicsData",function(){return nu}),d.d(b,"GraphicsGeometry",function(){return Rv}),d.d(b,"LINE_CAP",function(){return Zi}),d.d(b,"LINE_JOIN",function(){return $i}),d.d(b,"LineStyle",function(){return Lv}),d.d(b,"graphicsUtils",function(){return ow}),d.d(b,"AnimatedSprite",function(){return ol}),d.d(b,"InteractionData",function(){return Fc}),d.d(b,"InteractionEvent",function(){return rg}),d.d(b,"InteractionManager",function(){return og}),d.d(b,"InteractionTrackingData",function(){return el}),d.d(b,"interactiveTarget",function(){return sg}),d.d(b,"Spritesheet",function(){return lu}),d.d(b,"SpritesheetLoader",function(){return uw}),d.d(b,"Extract",function(){return Kg}),d.d(b,"filters",function(){return So});const R=[];for(let i=0;i<256;i++)R[i]=(i<16?"0":"")+i.toString(16);function T(){const i=4294967295*Math.random()|0,t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(R[255&i]+R[i>>8&255]+R[i>>16&255]+R[i>>24&255]+"-"+R[255&t]+R[t>>8&255]+"-"+R[t>>16&15|64]+R[t>>24&255]+"-"+R[63&e|128]+R[e>>8&255]+"-"+R[e>>16&255]+R[e>>24&255]+R[255&n]+R[n>>8&255]+R[n>>16&255]+R[n>>24&255]).toUpperCase()}var S=d(9);/**
|
|
2022
|
+
`},function(m,y,d){var x;(function(b,C){var T="model",S="name",N="type",I="vendor",L="version",k="mobile",K="tablet",ut="smarttv",_t=function(at){for(var $={},tt=0;tt<at.length;tt++)$[at[tt].toUpperCase()]=at[tt];return $},E=function(at,$){return typeof at=="string"&&R($).indexOf(R(at))!==-1},R=function(at){return at.toLowerCase()},D=function(at,$){if(typeof at=="string")return at=at.replace(/^\s\s*/,"").replace(/\s\s*$/,""),$===void 0?at:at.substring(0,255)},F=function(at,$){for(var tt,lt,w,ot,bt,dt,yt=0;yt<$.length&&!bt;){var Ot=$[yt],kt=$[yt+1];for(tt=lt=0;tt<Ot.length&&!bt;)if(bt=Ot[tt++].exec(at))for(w=0;w<kt.length;w++)dt=bt[++lt],typeof(ot=kt[w])=="object"&&ot.length>0?ot.length===2?typeof ot[1]=="function"?this[ot[0]]=ot[1].call(this,dt):this[ot[0]]=ot[1]:ot.length===3?typeof ot[1]!="function"||ot[1].exec&&ot[1].test?this[ot[0]]=dt?dt.replace(ot[1],ot[2]):void 0:this[ot[0]]=dt?ot[1].call(this,dt,ot[2]):void 0:ot.length===4&&(this[ot[0]]=dt?ot[3].call(this,dt.replace(ot[1],ot[2])):void 0):this[ot]=dt||void 0;yt+=2}},P=function(at,$){for(var tt in $)if(typeof $[tt]=="object"&&$[tt].length>0){for(var lt=0;lt<$[tt].length;lt++)if(E($[tt][lt],at))return tt==="?"?void 0:tt}else if(E($[tt],at))return tt==="?"?void 0:tt;return at},B={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},G={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[L,[S,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[L,[S,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[S,L],[/opios[\/ ]+([\w\.]+)/i],[L,[S,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[L,[S,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[S,L],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[L,[S,"UCBrowser"]],[/\bqbcore\/([\w\.]+)/i],[L,[S,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[L,[S,"WeChat"]],[/konqueror\/([\w\.]+)/i],[L,[S,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[L,[S,"IE"]],[/yabrowser\/([\w\.]+)/i],[L,[S,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[S,/(.+)/,"$1 Secure Browser"],L],[/\bfocus\/([\w\.]+)/i],[L,[S,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[L,[S,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[L,[S,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[L,[S,"Dolphin"]],[/coast\/([\w\.]+)/i],[L,[S,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[L,[S,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[L,[S,"Firefox"]],[/\bqihu|(qi?ho?o?|360)browser/i],[[S,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[S,/(.+)/,"$1 Browser"],L],[/(comodo_dragon)\/([\w\.]+)/i],[[S,/_/g," "],L],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[S,L],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[S],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[S,"Facebook"],L],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[S,L],[/\bgsa\/([\w\.]+) .*safari\//i],[L,[S,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[L,[S,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[S,"Chrome WebView"],L],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[L,[S,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[S,L],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[L,[S,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[L,S],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[S,[L,P,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[S,L],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[S,"Netscape"],L],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[L,[S,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[S,L]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[["architecture","amd64"]],[/(ia32(?=;))/i],[["architecture",R]],[/((?:i[346]|x)86)[;\)]/i],[["architecture","ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[["architecture","arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[["architecture","armhf"]],[/windows (ce|mobile); ppc;/i],[["architecture","arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[["architecture",/ower/,"",R]],[/(sun4\w)[;\)]/i],[["architecture","sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[["architecture",R]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[T,[I,"Samsung"],[N,K]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[T,[I,"Samsung"],[N,k]],[/\((ip(?:hone|od)[\w ]*);/i],[T,[I,"Apple"],[N,k]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[T,[I,"Apple"],[N,K]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[T,[I,"Huawei"],[N,K]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[T,[I,"Huawei"],[N,k]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[T,/_/g," "],[I,"Xiaomi"],[N,k]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[T,/_/g," "],[I,"Xiaomi"],[N,K]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[T,[I,"OPPO"],[N,k]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[T,[I,"Vivo"],[N,k]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[T,[I,"Realme"],[N,k]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[T,[I,"Motorola"],[N,k]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[T,[I,"Motorola"],[N,K]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[T,[I,"LG"],[N,K]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[T,[I,"LG"],[N,k]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[T,[I,"Lenovo"],[N,K]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[T,/_/g," "],[I,"Nokia"],[N,k]],[/(pixel c)\b/i],[T,[I,"Google"],[N,K]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[T,[I,"Google"],[N,k]],[/droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[T,[I,"Sony"],[N,k]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[T,"Xperia Tablet"],[I,"Sony"],[N,K]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[T,[I,"OnePlus"],[N,k]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[T,[I,"Amazon"],[N,K]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[T,/(.+)/g,"Fire Phone $1"],[I,"Amazon"],[N,k]],[/(playbook);[-\w\),; ]+(rim)/i],[T,I,[N,K]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[T,[I,"BlackBerry"],[N,k]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[T,[I,"ASUS"],[N,K]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[T,[I,"ASUS"],[N,k]],[/(nexus 9)/i],[T,[I,"HTC"],[N,K]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[I,[T,/_/g," "],[N,k]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[T,[I,"Acer"],[N,K]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[T,[I,"Meizu"],[N,k]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[T,[I,"Sharp"],[N,k]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[I,T,[N,k]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[I,T,[N,K]],[/(surface duo)/i],[T,[I,"Microsoft"],[N,K]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[T,[I,"Fairphone"],[N,k]],[/(u304aa)/i],[T,[I,"AT&T"],[N,k]],[/\bsie-(\w*)/i],[T,[I,"Siemens"],[N,k]],[/\b(rct\w+) b/i],[T,[I,"RCA"],[N,K]],[/\b(venue[\d ]{2,7}) b/i],[T,[I,"Dell"],[N,K]],[/\b(q(?:mv|ta)\w+) b/i],[T,[I,"Verizon"],[N,K]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[T,[I,"Barnes & Noble"],[N,K]],[/\b(tm\d{3}\w+) b/i],[T,[I,"NuVision"],[N,K]],[/\b(k88) b/i],[T,[I,"ZTE"],[N,K]],[/\b(nx\d{3}j) b/i],[T,[I,"ZTE"],[N,k]],[/\b(gen\d{3}) b.+49h/i],[T,[I,"Swiss"],[N,k]],[/\b(zur\d{3}) b/i],[T,[I,"Swiss"],[N,K]],[/\b((zeki)?tb.*\b) b/i],[T,[I,"Zeki"],[N,K]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[I,"Dragon Touch"],T,[N,K]],[/\b(ns-?\w{0,9}) b/i],[T,[I,"Insignia"],[N,K]],[/\b((nxa|next)-?\w{0,9}) b/i],[T,[I,"NextBook"],[N,K]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[I,"Voice"],T,[N,k]],[/\b(lvtel\-)?(v1[12]) b/i],[[I,"LvTel"],T,[N,k]],[/\b(ph-1) /i],[T,[I,"Essential"],[N,k]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[T,[I,"Envizen"],[N,K]],[/\b(trio[-\w\. ]+) b/i],[T,[I,"MachSpeed"],[N,K]],[/\btu_(1491) b/i],[T,[I,"Rotor"],[N,K]],[/(shield[\w ]+) b/i],[T,[I,"Nvidia"],[N,K]],[/(sprint) (\w+)/i],[I,T,[N,k]],[/(kin\.[onetw]{3})/i],[[T,/\./g," "],[I,"Microsoft"],[N,k]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[T,[I,"Zebra"],[N,K]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[T,[I,"Zebra"],[N,k]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[I,T,[N,"console"]],[/droid.+; (shield) bui/i],[T,[I,"Nvidia"],[N,"console"]],[/(playstation [345portablevi]+)/i],[T,[I,"Sony"],[N,"console"]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[T,[I,"Microsoft"],[N,"console"]],[/smart-tv.+(samsung)/i],[I,[N,ut]],[/hbbtv.+maple;(\d+)/i],[[T,/^/,"SmartTV"],[I,"Samsung"],[N,ut]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[I,"LG"],[N,ut]],[/(apple) ?tv/i],[I,[T,"Apple TV"],[N,ut]],[/crkey/i],[[T,"Chromecast"],[I,"Google"],[N,ut]],[/droid.+aft(\w)( bui|\))/i],[T,[I,"Amazon"],[N,ut]],[/\(dtv[\);].+(aquos)/i],[T,[I,"Sharp"],[N,ut]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[I,D],[T,D],[N,ut]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[N,ut]],[/((pebble))app/i],[I,T,[N,"wearable"]],[/droid.+; (glass) \d/i],[T,[I,"Google"],[N,"wearable"]],[/droid.+; (wt63?0{2,3})\)/i],[T,[I,"Zebra"],[N,"wearable"]],[/(quest( 2)?)/i],[T,[I,"Facebook"],[N,"wearable"]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[I,[N,"embedded"]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[T,[N,k]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[T,[N,K]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[N,K]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[N,k]],[/(android[-\w\. ]{0,9});.+buil/i],[T,[I,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[L,[S,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[L,[S,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[S,L],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[L,S]],os:[[/microsoft (windows) (vista|xp)/i],[S,L],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[S,[L,P,B]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[S,"Windows"],[L,P,B]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[L,/_/g,"."],[S,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[S,"Mac OS"],[L,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[L,S],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[S,L],[/\(bb(10);/i],[L,[S,"BlackBerry"]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[L,[S,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[L,[S,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[L,[S,"webOS"]],[/crkey\/([\d\.]+)/i],[L,[S,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[S,"Chromium OS"],L],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[S,L],[/(sunos) ?([\w\.\d]*)/i],[[S,"Solaris"],L],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[S,L]]},q=function(at,$){if(typeof at=="object"&&($=at,at=void 0),!(this instanceof q))return new q(at,$).getResult();var tt=at||(b!==void 0&&b.navigator&&b.navigator.userAgent?b.navigator.userAgent:""),lt=$?function(w,ot){var bt={};for(var dt in w)ot[dt]&&ot[dt].length%2==0?bt[dt]=ot[dt].concat(w[dt]):bt[dt]=w[dt];return bt}(G,$):G;return this.getBrowser=function(){var w,ot={};return ot[S]=void 0,ot[L]=void 0,F.call(ot,tt,lt.browser),ot.major=typeof(w=ot.version)=="string"?w.replace(/[^\d\.]/g,"").split(".")[0]:void 0,ot},this.getCPU=function(){var w={architecture:void 0};return F.call(w,tt,lt.cpu),w},this.getDevice=function(){var w={vendor:void 0,model:void 0,type:void 0};return F.call(w,tt,lt.device),w},this.getEngine=function(){var w={name:void 0,version:void 0};return F.call(w,tt,lt.engine),w},this.getOS=function(){var w={name:void 0,version:void 0};return F.call(w,tt,lt.os),w},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return tt},this.setUA=function(w){return tt=typeof w=="string"&&w.length>255?D(w,255):w,this},this.setUA(tt),this};q.VERSION="1.0.2",q.BROWSER=_t([S,L,"major"]),q.CPU=_t(["architecture"]),q.DEVICE=_t([T,I,N,"console",k,ut,K,"wearable","embedded"]),q.ENGINE=q.OS=_t([S,L]),y!==void 0?(m!==void 0&&m.exports&&(y=m.exports=q),y.UAParser=q):d(110)?(x=function(){return q}.call(y,d,y,m))===void 0||(m.exports=x):b!==void 0&&(b.UAParser=q);var Rt=b!==void 0&&(b.jQuery||b.Zepto);if(Rt&&!Rt.ua){var Xt=new q;Rt.ua=Xt.getResult(),Rt.ua.get=function(){return Xt.getUA()},Rt.ua.set=function(at){Xt.setUA(at);var $=Xt.getResult();for(var tt in $)Rt.ua[tt]=$[tt]}}})(typeof window=="object"?window:this)},function(m,y,d){var x=d(111);m.exports=function(b,C){return x(b,C)}},function(m,y,d){var x=d(12),b=Object.prototype,C=b.hasOwnProperty,T=b.toString,S=x?x.toStringTag:void 0;m.exports=function(N){var I=C.call(N,S),L=N[S];try{N[S]=void 0;var k=!0}catch{}var K=T.call(N);return k&&(I?N[S]=L:delete N[S]),K}},function(m,y){var d=Object.prototype.toString;m.exports=function(x){return d.call(x)}},function(m,y,d){(function(x,b){var C;/*! https://mths.be/punycode v1.4.1 by @mathias */(function(T){y&&y.nodeType,x&&x.nodeType;var S=typeof b=="object"&&b;S.global!==S&&S.window!==S&&S.self;var N,I=2147483647,L=/^xn--/,k=/[^\x20-\x7E]/,K=/[\x2E\u3002\uFF0E\uFF61]/g,ut={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},_t=Math.floor,E=String.fromCharCode;function R(at){throw new RangeError(ut[at])}function D(at,$){for(var tt=at.length,lt=[];tt--;)lt[tt]=$(at[tt]);return lt}function F(at,$){var tt=at.split("@"),lt="";return tt.length>1&&(lt=tt[0]+"@",at=tt[1]),lt+D((at=at.replace(K,".")).split("."),$).join(".")}function P(at){for(var $,tt,lt=[],w=0,ot=at.length;w<ot;)($=at.charCodeAt(w++))>=55296&&$<=56319&&w<ot?(64512&(tt=at.charCodeAt(w++)))==56320?lt.push(((1023&$)<<10)+(1023&tt)+65536):(lt.push($),w--):lt.push($);return lt}function B(at){return D(at,function($){var tt="";return $>65535&&(tt+=E(($-=65536)>>>10&1023|55296),$=56320|1023&$),tt+=E($)}).join("")}function G(at,$){return at+22+75*(at<26)-(($!=0)<<5)}function q(at,$,tt){var lt=0;for(at=tt?_t(at/700):at>>1,at+=_t(at/$);at>455;lt+=36)at=_t(at/35);return _t(lt+36*at/(at+38))}function Rt(at){var $,tt,lt,w,ot,bt,dt,yt,Ot,kt,Dt,te=[],re=at.length,$t=0,pe=128,le=72;for((tt=at.lastIndexOf("-"))<0&&(tt=0),lt=0;lt<tt;++lt)at.charCodeAt(lt)>=128&&R("not-basic"),te.push(at.charCodeAt(lt));for(w=tt>0?tt+1:0;w<re;){for(ot=$t,bt=1,dt=36;w>=re&&R("invalid-input"),((yt=(Dt=at.charCodeAt(w++))-48<10?Dt-22:Dt-65<26?Dt-65:Dt-97<26?Dt-97:36)>=36||yt>_t((I-$t)/bt))&&R("overflow"),$t+=yt*bt,!(yt<(Ot=dt<=le?1:dt>=le+26?26:dt-le));dt+=36)bt>_t(I/(kt=36-Ot))&&R("overflow"),bt*=kt;le=q($t-ot,$=te.length+1,ot==0),_t($t/$)>I-pe&&R("overflow"),pe+=_t($t/$),$t%=$,te.splice($t++,0,pe)}return B(te)}function Xt(at){var $,tt,lt,w,ot,bt,dt,yt,Ot,kt,Dt,te,re,$t,pe,le=[];for(te=(at=P(at)).length,$=128,tt=0,ot=72,bt=0;bt<te;++bt)(Dt=at[bt])<128&&le.push(E(Dt));for(lt=w=le.length,w&&le.push("-");lt<te;){for(dt=I,bt=0;bt<te;++bt)(Dt=at[bt])>=$&&Dt<dt&&(dt=Dt);for(dt-$>_t((I-tt)/(re=lt+1))&&R("overflow"),tt+=(dt-$)*re,$=dt,bt=0;bt<te;++bt)if((Dt=at[bt])<$&&++tt>I&&R("overflow"),Dt==$){for(yt=tt,Ot=36;!(yt<(kt=Ot<=ot?1:Ot>=ot+26?26:Ot-ot));Ot+=36)pe=yt-kt,$t=36-kt,le.push(E(G(kt+pe%$t,0))),yt=_t(pe/$t);le.push(E(G(yt,0))),ot=q(tt,re,lt==w),tt=0,++lt}++tt,++$}return le.join("")}N={version:"1.4.1",ucs2:{decode:P,encode:B},decode:Rt,encode:Xt,toASCII:function(at){return F(at,function($){return k.test($)?"xn--"+Xt($):$})},toUnicode:function(at){return F(at,function($){return L.test($)?Rt($.slice(4).toLowerCase()):$})}},(C=function(){return N}.call(y,d,y,x))===void 0||(x.exports=C)})()}).call(this,d(13)(m),d(11))},function(m,y,d){m.exports={isString:function(x){return typeof x=="string"},isObject:function(x){return typeof x=="object"&&x!==null},isNull:function(x){return x===null},isNullOrUndefined:function(x){return x==null}}},function(m,y,d){y.decode=y.parse=d(102),y.encode=y.stringify=d(103)},function(m,y,d){function x(C,T){return Object.prototype.hasOwnProperty.call(C,T)}m.exports=function(C,T,S,N){T=T||"&",S=S||"=";var I={};if(typeof C!="string"||C.length===0)return I;var L=/\+/g;C=C.split(T);var k=1e3;N&&typeof N.maxKeys=="number"&&(k=N.maxKeys);var K=C.length;k>0&&K>k&&(K=k);for(var ut=0;ut<K;++ut){var _t,E,R,D,F=C[ut].replace(L,"%20"),P=F.indexOf(S);P>=0?(_t=F.substr(0,P),E=F.substr(P+1)):(_t=F,E=""),R=decodeURIComponent(_t),D=decodeURIComponent(E),x(I,R)?b(I[R])?I[R].push(D):I[R]=[I[R],D]:I[R]=D}return I};var b=Array.isArray||function(C){return Object.prototype.toString.call(C)==="[object Array]"}},function(m,y,d){var x=function(S){switch(typeof S){case"string":return S;case"boolean":return S?"true":"false";case"number":return isFinite(S)?S:"";default:return""}};m.exports=function(S,N,I,L){return N=N||"&",I=I||"=",S===null&&(S=void 0),typeof S=="object"?C(T(S),function(k){var K=encodeURIComponent(x(k))+I;return b(S[k])?C(S[k],function(ut){return K+encodeURIComponent(x(ut))}).join(N):K+encodeURIComponent(x(S[k]))}).join(N):L?encodeURIComponent(x(L))+I+encodeURIComponent(x(S)):""};var b=Array.isArray||function(S){return Object.prototype.toString.call(S)==="[object Array]"};function C(S,N){if(S.map)return S.map(N);for(var I=[],L=0;L<S.length;L++)I.push(N(S[L],L));return I}var T=Object.keys||function(S){var N=[];for(var I in S)Object.prototype.hasOwnProperty.call(S,I)&&N.push(I);return N}},function(m,y){var d=function(){};d.prototype={fit:function(x){var b,C,T,S,N=x.length,I=N>0?x[0].width:0,L=N>0?x[0].height:0;for(this.root={x:0,y:0,width:I,height:L},b=0;b<N;b++)T=x[b],(C=this.findNode(this.root,T.width,T.height))?(S=this.splitNode(C,T.width,T.height),T.x=S.x,T.y=S.y):(S=this.growNode(T.width,T.height),T.x=S.x,T.y=S.y)},findNode:function(x,b,C){return x.used?this.findNode(x.right,b,C)||this.findNode(x.down,b,C):b<=x.width&&C<=x.height?x:null},splitNode:function(x,b,C){return x.used=!0,x.down={x:x.x,y:x.y+C,width:x.width,height:x.height-C},x.right={x:x.x+b,y:x.y,width:x.width-b,height:C},x},growNode:function(x,b){var C=x<=this.root.width,T=b<=this.root.height,S=T&&this.root.height>=this.root.width+x,N=C&&this.root.width>=this.root.height+b;return S?this.growRight(x,b):N?this.growDown(x,b):T?this.growRight(x,b):C?this.growDown(x,b):null},growRight:function(x,b){var C;return this.root={used:!0,x:0,y:0,width:this.root.width+x,height:this.root.height,down:this.root,right:{x:this.root.width,y:0,width:x,height:this.root.height}},(C=this.findNode(this.root,x,b))?this.splitNode(C,x,b):null},growDown:function(x,b){var C;return this.root={used:!0,x:0,y:0,width:this.root.width,height:this.root.height+b,down:{x:0,y:this.root.height,width:this.root.width,height:b},right:this.root},(C=this.findNode(this.root,x,b))?this.splitNode(C,x,b):null}},m.exports=d},function(m,y,d){var x=d(3);m.exports=function(){return x.Date.now()}},function(m,y,d){var x=d(107),b=d(7),C=d(109),T=/^[-+]0x[0-9a-f]+$/i,S=/^0b[01]+$/i,N=/^0o[0-7]+$/i,I=parseInt;m.exports=function(L){if(typeof L=="number")return L;if(C(L))return NaN;if(b(L)){var k=typeof L.valueOf=="function"?L.valueOf():L;L=b(k)?k+"":k}if(typeof L!="string")return L===0?L:+L;L=x(L);var K=S.test(L);return K||N.test(L)?I(L.slice(2),K?2:8):T.test(L)?NaN:+L}},function(m,y,d){var x=d(108),b=/^\s+/;m.exports=function(C){return C&&C.slice(0,x(C)+1).replace(b,"")}},function(m,y){var d=/\s/;m.exports=function(x){for(var b=x.length;b--&&d.test(x.charAt(b)););return b}},function(m,y,d){var x=d(6),b=d(4);m.exports=function(C){return typeof C=="symbol"||b(C)&&x(C)=="[object Symbol]"}},function(m,y){(function(d){m.exports=d}).call(this,{})},function(m,y,d){var x=d(112),b=d(4);m.exports=function C(T,S,N,I,L){return T===S||(T==null||S==null||!b(T)&&!b(S)?T!=T&&S!=S:x(T,S,N,I,C,L))}},function(m,y,d){var x=d(38),b=d(41),C=d(144),T=d(147),S=d(19),N=d(18),I=d(27),L=d(48),k="[object Object]",K=Object.prototype.hasOwnProperty;m.exports=function(ut,_t,E,R,D,F){var P=N(ut),B=N(_t),G=P?"[object Array]":S(ut),q=B?"[object Array]":S(_t),Rt=(G=G=="[object Arguments]"?k:G)==k,Xt=(q=q=="[object Arguments]"?k:q)==k,at=G==q;if(at&&I(ut)){if(!I(_t))return!1;P=!0,Rt=!1}if(at&&!Rt)return F||(F=new x),P||L(ut)?b(ut,_t,E,R,D,F):C(ut,_t,G,E,R,D,F);if(!(1&E)){var $=Rt&&K.call(ut,"__wrapped__"),tt=Xt&&K.call(_t,"__wrapped__");if($||tt){var lt=$?ut.value():ut,w=tt?_t.value():_t;return F||(F=new x),D(lt,w,E,R,F)}}return!!at&&(F||(F=new x),T(ut,_t,E,R,D,F))}},function(m,y){m.exports=function(){this.__data__=[],this.size=0}},function(m,y,d){var x=d(15),b=Array.prototype.splice;m.exports=function(C){var T=this.__data__,S=x(T,C);return!(S<0)&&(S==T.length-1?T.pop():b.call(T,S,1),--this.size,!0)}},function(m,y,d){var x=d(15);m.exports=function(b){var C=this.__data__,T=x(C,b);return T<0?void 0:C[T][1]}},function(m,y,d){var x=d(15);m.exports=function(b){return x(this.__data__,b)>-1}},function(m,y,d){var x=d(15);m.exports=function(b,C){var T=this.__data__,S=x(T,b);return S<0?(++this.size,T.push([b,C])):T[S][1]=C,this}},function(m,y,d){var x=d(14);m.exports=function(){this.__data__=new x,this.size=0}},function(m,y){m.exports=function(d){var x=this.__data__,b=x.delete(d);return this.size=x.size,b}},function(m,y){m.exports=function(d){return this.__data__.get(d)}},function(m,y){m.exports=function(d){return this.__data__.has(d)}},function(m,y,d){var x=d(14),b=d(24),C=d(40);m.exports=function(T,S){var N=this.__data__;if(N instanceof x){var I=N.__data__;if(!b||I.length<199)return I.push([T,S]),this.size=++N.size,this;N=this.__data__=new C(I)}return N.set(T,S),this.size=N.size,this}},function(m,y,d){var x=d(21),b=d(124),C=d(7),T=d(39),S=/^\[object .+?Constructor\]$/,N=Function.prototype,I=Object.prototype,L=N.toString,k=I.hasOwnProperty,K=RegExp("^"+L.call(k).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");m.exports=function(ut){return!(!C(ut)||b(ut))&&(x(ut)?K:S).test(T(ut))}},function(m,y,d){var x,b=d(125),C=(x=/[^.]+$/.exec(b&&b.keys&&b.keys.IE_PROTO||""))?"Symbol(src)_1."+x:"";m.exports=function(T){return!!C&&C in T}},function(m,y,d){var x=d(3)["__core-js_shared__"];m.exports=x},function(m,y){m.exports=function(d,x){return d==null?void 0:d[x]}},function(m,y,d){var x=d(128),b=d(14),C=d(24);m.exports=function(){this.size=0,this.__data__={hash:new x,map:new(C||b),string:new x}}},function(m,y,d){var x=d(129),b=d(130),C=d(131),T=d(132),S=d(133);function N(I){var L=-1,k=I==null?0:I.length;for(this.clear();++L<k;){var K=I[L];this.set(K[0],K[1])}}N.prototype.clear=x,N.prototype.delete=b,N.prototype.get=C,N.prototype.has=T,N.prototype.set=S,m.exports=N},function(m,y,d){var x=d(16);m.exports=function(){this.__data__=x?x(null):{},this.size=0}},function(m,y){m.exports=function(d){var x=this.has(d)&&delete this.__data__[d];return this.size-=x?1:0,x}},function(m,y,d){var x=d(16),b=Object.prototype.hasOwnProperty;m.exports=function(C){var T=this.__data__;if(x){var S=T[C];return S==="__lodash_hash_undefined__"?void 0:S}return b.call(T,C)?T[C]:void 0}},function(m,y,d){var x=d(16),b=Object.prototype.hasOwnProperty;m.exports=function(C){var T=this.__data__;return x?T[C]!==void 0:b.call(T,C)}},function(m,y,d){var x=d(16);m.exports=function(b,C){var T=this.__data__;return this.size+=this.has(b)?0:1,T[b]=x&&C===void 0?"__lodash_hash_undefined__":C,this}},function(m,y,d){var x=d(17);m.exports=function(b){var C=x(this,b).delete(b);return this.size-=C?1:0,C}},function(m,y){m.exports=function(d){var x=typeof d;return x=="string"||x=="number"||x=="symbol"||x=="boolean"?d!=="__proto__":d===null}},function(m,y,d){var x=d(17);m.exports=function(b){return x(this,b).get(b)}},function(m,y,d){var x=d(17);m.exports=function(b){return x(this,b).has(b)}},function(m,y,d){var x=d(17);m.exports=function(b,C){var T=x(this,b),S=T.size;return T.set(b,C),this.size+=T.size==S?0:1,this}},function(m,y,d){var x=d(40),b=d(140),C=d(141);function T(S){var N=-1,I=S==null?0:S.length;for(this.__data__=new x;++N<I;)this.add(S[N])}T.prototype.add=T.prototype.push=b,T.prototype.has=C,m.exports=T},function(m,y){m.exports=function(d){return this.__data__.set(d,"__lodash_hash_undefined__"),this}},function(m,y){m.exports=function(d){return this.__data__.has(d)}},function(m,y){m.exports=function(d,x){for(var b=-1,C=d==null?0:d.length;++b<C;)if(x(d[b],b,d))return!0;return!1}},function(m,y){m.exports=function(d,x){return d.has(x)}},function(m,y,d){var x=d(12),b=d(42),C=d(23),T=d(41),S=d(145),N=d(146),I=x?x.prototype:void 0,L=I?I.valueOf:void 0;m.exports=function(k,K,ut,_t,E,R,D){switch(ut){case"[object DataView]":if(k.byteLength!=K.byteLength||k.byteOffset!=K.byteOffset)return!1;k=k.buffer,K=K.buffer;case"[object ArrayBuffer]":return!(k.byteLength!=K.byteLength||!R(new b(k),new b(K)));case"[object Boolean]":case"[object Date]":case"[object Number]":return C(+k,+K);case"[object Error]":return k.name==K.name&&k.message==K.message;case"[object RegExp]":case"[object String]":return k==K+"";case"[object Map]":var F=S;case"[object Set]":var P=1&_t;if(F||(F=N),k.size!=K.size&&!P)return!1;var B=D.get(k);if(B)return B==K;_t|=2,D.set(k,K);var G=T(F(k),F(K),_t,E,R,D);return D.delete(k),G;case"[object Symbol]":if(L)return L.call(k)==L.call(K)}return!1}},function(m,y){m.exports=function(d){var x=-1,b=Array(d.size);return d.forEach(function(C,T){b[++x]=[T,C]}),b}},function(m,y){m.exports=function(d){var x=-1,b=Array(d.size);return d.forEach(function(C){b[++x]=C}),b}},function(m,y,d){var x=d(43),b=Object.prototype.hasOwnProperty;m.exports=function(C,T,S,N,I,L){var k=1&S,K=x(C),ut=K.length;if(ut!=x(T).length&&!k)return!1;for(var _t=ut;_t--;){var E=K[_t];if(!(k?E in T:b.call(T,E)))return!1}var R=L.get(C),D=L.get(T);if(R&&D)return R==T&&D==C;var F=!0;L.set(C,T),L.set(T,C);for(var P=k;++_t<ut;){var B=C[E=K[_t]],G=T[E];if(N)var q=k?N(G,B,E,T,C,L):N(B,G,E,C,T,L);if(!(q===void 0?B===G||I(B,G,S,N,L):q)){F=!1;break}P||(P=E=="constructor")}if(F&&!P){var Rt=C.constructor,Xt=T.constructor;Rt==Xt||!("constructor"in C)||!("constructor"in T)||typeof Rt=="function"&&Rt instanceof Rt&&typeof Xt=="function"&&Xt instanceof Xt||(F=!1)}return L.delete(C),L.delete(T),F}},function(m,y){m.exports=function(d,x){for(var b=-1,C=d==null?0:d.length,T=0,S=[];++b<C;){var N=d[b];x(N,b,d)&&(S[T++]=N)}return S}},function(m,y){m.exports=function(d,x){for(var b=-1,C=Array(d);++b<d;)C[b]=x(b);return C}},function(m,y,d){var x=d(151),b=d(4),C=Object.prototype,T=C.hasOwnProperty,S=C.propertyIsEnumerable,N=x(function(){return arguments}())?x:function(I){return b(I)&&T.call(I,"callee")&&!S.call(I,"callee")};m.exports=N},function(m,y,d){var x=d(6),b=d(4);m.exports=function(C){return b(C)&&x(C)=="[object Arguments]"}},function(m,y){m.exports=function(){return!1}},function(m,y){var d=/^(?:0|[1-9]\d*)$/;m.exports=function(x,b){var C=typeof x;return!!(b=b==null?9007199254740991:b)&&(C=="number"||C!="symbol"&&d.test(x))&&x>-1&&x%1==0&&x<b}},function(m,y,d){var x=d(6),b=d(49),C=d(4),T={};T["[object Float32Array]"]=T["[object Float64Array]"]=T["[object Int8Array]"]=T["[object Int16Array]"]=T["[object Int32Array]"]=T["[object Uint8Array]"]=T["[object Uint8ClampedArray]"]=T["[object Uint16Array]"]=T["[object Uint32Array]"]=!0,T["[object Arguments]"]=T["[object Array]"]=T["[object ArrayBuffer]"]=T["[object Boolean]"]=T["[object DataView]"]=T["[object Date]"]=T["[object Error]"]=T["[object Function]"]=T["[object Map]"]=T["[object Number]"]=T["[object Object]"]=T["[object RegExp]"]=T["[object Set]"]=T["[object String]"]=T["[object WeakMap]"]=!1,m.exports=function(S){return C(S)&&b(S.length)&&!!T[x(S)]}},function(m,y,d){var x=d(30),b=d(156),C=Object.prototype.hasOwnProperty;m.exports=function(T){if(!x(T))return b(T);var S=[];for(var N in Object(T))C.call(T,N)&&N!="constructor"&&S.push(N);return S}},function(m,y,d){var x=d(50)(Object.keys,Object);m.exports=x},function(m,y,d){var x=d(8)(d(3),"DataView");m.exports=x},function(m,y,d){var x=d(8)(d(3),"Promise");m.exports=x},function(m,y,d){var x=d(8)(d(3),"Set");m.exports=x},function(m,y,d){var x=d(8)(d(3),"WeakMap");m.exports=x},function(m,y,d){var x=d(38),b=d(162),C=d(52),T=d(164),S=d(165),N=d(168),I=d(169),L=d(170),k=d(171),K=d(43),ut=d(172),_t=d(19),E=d(173),R=d(174),D=d(179),F=d(18),P=d(27),B=d(181),G=d(7),q=d(183),Rt=d(26),Xt=d(31),at={};at["[object Arguments]"]=at["[object Array]"]=at["[object ArrayBuffer]"]=at["[object DataView]"]=at["[object Boolean]"]=at["[object Date]"]=at["[object Float32Array]"]=at["[object Float64Array]"]=at["[object Int8Array]"]=at["[object Int16Array]"]=at["[object Int32Array]"]=at["[object Map]"]=at["[object Number]"]=at["[object Object]"]=at["[object RegExp]"]=at["[object Set]"]=at["[object String]"]=at["[object Symbol]"]=at["[object Uint8Array]"]=at["[object Uint8ClampedArray]"]=at["[object Uint16Array]"]=at["[object Uint32Array]"]=!0,at["[object Error]"]=at["[object Function]"]=at["[object WeakMap]"]=!1,m.exports=function $(tt,lt,w,ot,bt,dt){var yt,Ot=1<,kt=2<,Dt=4<if(w&&(yt=bt?w(tt,ot,bt,dt):w(tt)),yt!==void 0)return yt;if(!G(tt))return tt;var te=F(tt);if(te){if(yt=E(tt),!Ot)return I(tt,yt)}else{var re=_t(tt),$t=re=="[object Function]"||re=="[object GeneratorFunction]";if(P(tt))return N(tt,Ot);if(re=="[object Object]"||re=="[object Arguments]"||$t&&!bt){if(yt=kt||$t?{}:D(tt),!Ot)return kt?k(tt,S(yt,tt)):L(tt,T(yt,tt))}else{if(!at[re])return bt?tt:{};yt=R(tt,re,Ot)}}dt||(dt=new x);var pe=dt.get(tt);if(pe)return pe;dt.set(tt,yt),q(tt)?tt.forEach(function(Se){yt.add($(Se,lt,w,Se,tt,dt))}):B(tt)&&tt.forEach(function(Se,ue){yt.set(ue,$(Se,lt,w,ue,tt,dt))});var le=te?void 0:(Dt?kt?ut:K:kt?Xt:Rt)(tt);return b(le||tt,function(Se,ue){le&&(Se=tt[ue=Se]),C(yt,ue,$(Se,lt,w,ue,tt,dt))}),yt}},function(m,y){m.exports=function(d,x){for(var b=-1,C=d==null?0:d.length;++b<C&&x(d[b],b,d)!==!1;);return d}},function(m,y,d){var x=d(8),b=function(){try{var C=x(Object,"defineProperty");return C({},"",{}),C}catch{}}();m.exports=b},function(m,y,d){var x=d(20),b=d(26);m.exports=function(C,T){return C&&x(T,b(T),C)}},function(m,y,d){var x=d(20),b=d(31);m.exports=function(C,T){return C&&x(T,b(T),C)}},function(m,y,d){var x=d(7),b=d(30),C=d(167),T=Object.prototype.hasOwnProperty;m.exports=function(S){if(!x(S))return C(S);var N=b(S),I=[];for(var L in S)(L!="constructor"||!N&&T.call(S,L))&&I.push(L);return I}},function(m,y){m.exports=function(d){var x=[];if(d!=null)for(var b in Object(d))x.push(b);return x}},function(m,y,d){(function(x){var b=d(3),C=y&&!y.nodeType&&y,T=C&&typeof x=="object"&&x&&!x.nodeType&&x,S=T&&T.exports===C?b.Buffer:void 0,N=S?S.allocUnsafe:void 0;x.exports=function(I,L){if(L)return I.slice();var k=I.length,K=N?N(k):new I.constructor(k);return I.copy(K),K}}).call(this,d(13)(m))},function(m,y){m.exports=function(d,x){var b=-1,C=d.length;for(x||(x=Array(C));++b<C;)x[b]=d[b];return x}},function(m,y,d){var x=d(20),b=d(25);m.exports=function(C,T){return x(C,b(C),T)}},function(m,y,d){var x=d(20),b=d(54);m.exports=function(C,T){return x(C,b(C),T)}},function(m,y,d){var x=d(44),b=d(54),C=d(31);m.exports=function(T){return x(T,C,b)}},function(m,y){var d=Object.prototype.hasOwnProperty;m.exports=function(x){var b=x.length,C=new x.constructor(b);return b&&typeof x[0]=="string"&&d.call(x,"index")&&(C.index=x.index,C.input=x.input),C}},function(m,y,d){var x=d(32),b=d(175),C=d(176),T=d(177),S=d(178);m.exports=function(N,I,L){var k=N.constructor;switch(I){case"[object ArrayBuffer]":return x(N);case"[object Boolean]":case"[object Date]":return new k(+N);case"[object DataView]":return b(N,L);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return S(N,L);case"[object Map]":return new k;case"[object Number]":case"[object String]":return new k(N);case"[object RegExp]":return C(N);case"[object Set]":return new k;case"[object Symbol]":return T(N)}}},function(m,y,d){var x=d(32);m.exports=function(b,C){var T=C?x(b.buffer):b.buffer;return new b.constructor(T,b.byteOffset,b.byteLength)}},function(m,y){var d=/\w*$/;m.exports=function(x){var b=new x.constructor(x.source,d.exec(x));return b.lastIndex=x.lastIndex,b}},function(m,y,d){var x=d(12),b=x?x.prototype:void 0,C=b?b.valueOf:void 0;m.exports=function(T){return C?Object(C.call(T)):{}}},function(m,y,d){var x=d(32);m.exports=function(b,C){var T=C?x(b.buffer):b.buffer;return new b.constructor(T,b.byteOffset,b.length)}},function(m,y,d){var x=d(180),b=d(55),C=d(30);m.exports=function(T){return typeof T.constructor!="function"||C(T)?{}:x(b(T))}},function(m,y,d){var x=d(7),b=Object.create,C=function(){function T(){}return function(S){if(!x(S))return{};if(b)return b(S);T.prototype=S;var N=new T;return T.prototype=void 0,N}}();m.exports=C},function(m,y,d){var x=d(182),b=d(28),C=d(29),T=C&&C.isMap,S=T?b(T):x;m.exports=S},function(m,y,d){var x=d(19),b=d(4);m.exports=function(C){return b(C)&&x(C)=="[object Map]"}},function(m,y,d){var x=d(184),b=d(28),C=d(29),T=C&&C.isSet,S=T?b(T):x;m.exports=S},function(m,y,d){var x=d(19),b=d(4);m.exports=function(C){return b(C)&&x(C)=="[object Set]"}},function(m,y,d){d.r(y),d.d(y,"ErrorType",function(){return In}),d.d(y,"preloadResource",function(){return CS}),d.d(y,"delay",function(){return Gu}),d.d(y,"waitUntil",function(){return NS}),d.d(y,"SLIDE_EVENTS",function(){return ti}),d.d(y,"Slide",function(){return Go});var x={};d.r(x),d.d(x,"isMobile",function(){return Vi}),d.d(x,"EventEmitter",function(){return Ar.a}),d.d(x,"earcut",function(){return Hh.a}),d.d(x,"BaseTextureCache",function(){return ai}),d.d(x,"CanvasRenderTarget",function(){return Zh}),d.d(x,"DATA_URI",function(){return xf}),d.d(x,"ProgramCache",function(){return $h}),d.d(x,"TextureCache",function(){return Vn}),d.d(x,"clearTextureCache",function(){return _E}),d.d(x,"correctBlendMode",function(){return uE}),d.d(x,"createIndicesForQuads",function(){return pE}),d.d(x,"decomposeDataUri",function(){return xE}),d.d(x,"deprecation",function(){return Yi}),d.d(x,"destroyTextureCache",function(){return vE}),d.d(x,"determineCrossOrigin",function(){return bf}),d.d(x,"getBufferType",function(){return Na}),d.d(x,"getResolutionOfUrl",function(){return Da}),d.d(x,"hex2rgb",function(){return La}),d.d(x,"hex2string",function(){return vf}),d.d(x,"interleaveTypedArrays",function(){return mE}),d.d(x,"isPow2",function(){return Yh}),d.d(x,"isWebGLSupported",function(){return gf}),d.d(x,"log2",function(){return qh}),d.d(x,"nextPow2",function(){return ao}),d.d(x,"premultiplyBlendMode",function(){return Wh}),d.d(x,"premultiplyRgba",function(){return dE}),d.d(x,"premultiplyTint",function(){return Xh}),d.d(x,"premultiplyTintToRgba",function(){return _f}),d.d(x,"removeItems",function(){return fr}),d.d(x,"rgb2hex",function(){return cE}),d.d(x,"sayHello",function(){return mf}),d.d(x,"sign",function(){return lo}),d.d(x,"skipHello",function(){return aE}),d.d(x,"string2hex",function(){return hE}),d.d(x,"trimCanvas",function(){return yE}),d.d(x,"uid",function(){return mr}),d.d(x,"url",function(){return cs});var b={};d.r(b),d.d(b,"ALPHA_MODES",function(){return Wi}),d.d(b,"BLEND_MODES",function(){return xe}),d.d(b,"BUFFER_BITS",function(){return so}),d.d(b,"BUFFER_TYPE",function(){return gi}),d.d(b,"CLEAR_MODES",function(){return Xi}),d.d(b,"DRAW_MODES",function(){return oi}),d.d(b,"ENV",function(){return Ii}),d.d(b,"FORMATS",function(){return he}),d.d(b,"GC_MODES",function(){return Ra}),d.d(b,"MASK_TYPES",function(){return An}),d.d(b,"MIPMAP_MODES",function(){return pr}),d.d(b,"MSAA_QUALITY",function(){return un}),d.d(b,"PRECISION",function(){return mi}),d.d(b,"RENDERER_TYPE",function(){return ls}),d.d(b,"SAMPLER_TYPES",function(){return oo}),d.d(b,"SCALE_MODES",function(){return Ri}),d.d(b,"TARGETS",function(){return dr}),d.d(b,"TYPES",function(){return Re}),d.d(b,"WRAP_MODES",function(){return hs}),d.d(b,"Circle",function(){return Ef}),d.d(b,"DEG_TO_RAD",function(){return Kh}),d.d(b,"Ellipse",function(){return wf}),d.d(b,"Matrix",function(){return mn}),d.d(b,"ObservablePoint",function(){return us}),d.d(b,"PI_2",function(){return ho}),d.d(b,"Point",function(){return on}),d.d(b,"Polygon",function(){return co}),d.d(b,"RAD_TO_DEG",function(){return Jh}),d.d(b,"Rectangle",function(){return Le}),d.d(b,"RoundedRectangle",function(){return ka}),d.d(b,"SHAPES",function(){return tn}),d.d(b,"Transform",function(){return tc}),d.d(b,"groupD8",function(){return en}),d.d(b,"Runner",function(){return Pn}),d.d(b,"isMobile",function(){return Vi}),d.d(b,"settings",function(){return ve}),d.d(b,"Ticker",function(){return Bn}),d.d(b,"TickerPlugin",function(){return Vf}),d.d(b,"UPDATE_PRIORITY",function(){return Li}),d.d(b,"utils",function(){return x}),d.d(b,"AbstractBatchRenderer",function(){return Pm}),d.d(b,"AbstractMultiResource",function(){return Ga}),d.d(b,"AbstractRenderer",function(){return Tm}),d.d(b,"ArrayResource",function(){return sc}),d.d(b,"Attribute",function(){return uc}),d.d(b,"BaseImageResource",function(){return Ni}),d.d(b,"BaseRenderTexture",function(){return hc}),d.d(b,"BaseTexture",function(){return Be}),d.d(b,"BatchDrawCall",function(){return Ka}),d.d(b,"BatchGeometry",function(){return Lc}),d.d(b,"BatchPluginFactory",function(){return Lm}),d.d(b,"BatchRenderer",function(){return Nm}),d.d(b,"BatchShaderGenerator",function(){return Cm}),d.d(b,"BatchSystem",function(){return mc}),d.d(b,"BatchTextureArray",function(){return Qa}),d.d(b,"Buffer",function(){return Cn}),d.d(b,"BufferResource",function(){return po}),d.d(b,"CanvasResource",function(){return Ha}),d.d(b,"ContextSystem",function(){return gc}),d.d(b,"CubeResource",function(){return oc}),d.d(b,"Filter",function(){return li}),d.d(b,"FilterState",function(){return Qf}),d.d(b,"FilterSystem",function(){return pc}),d.d(b,"Framebuffer",function(){return Va}),d.d(b,"FramebufferSystem",function(){return vc}),d.d(b,"GLFramebuffer",function(){return em}),d.d(b,"GLProgram",function(){return bm}),d.d(b,"GLTexture",function(){return Ja}),d.d(b,"Geometry",function(){return ps}),d.d(b,"GeometrySystem",function(){return yc}),d.d(b,"IGLUniformData",function(){return UE}),d.d(b,"INSTALLED",function(){return uo}),d.d(b,"ImageBitmapResource",function(){return lc}),d.d(b,"ImageResource",function(){return za}),d.d(b,"MaskData",function(){return nm}),d.d(b,"MaskSystem",function(){return Ec}),d.d(b,"ObjectRenderer",function(){return fc}),d.d(b,"Program",function(){return go}),d.d(b,"ProjectionSystem",function(){return Sc}),d.d(b,"Quad",function(){return Jf}),d.d(b,"QuadUv",function(){return Kf}),d.d(b,"RenderTexture",function(){return Wn}),d.d(b,"RenderTexturePool",function(){return $f}),d.d(b,"RenderTextureSystem",function(){return Mc}),d.d(b,"Renderer",function(){return _o}),d.d(b,"Resource",function(){return Lr}),d.d(b,"SVGResource",function(){return ac}),d.d(b,"ScissorSystem",function(){return wc}),d.d(b,"Shader",function(){return fs}),d.d(b,"ShaderSystem",function(){return Ac}),d.d(b,"SpriteMaskFilter",function(){return fm}),d.d(b,"State",function(){return ms}),d.d(b,"StateSystem",function(){return Pc}),d.d(b,"StencilSystem",function(){return Tc}),d.d(b,"System",function(){return jE}),d.d(b,"Texture",function(){return Je}),d.d(b,"TextureGCSystem",function(){return Cc}),d.d(b,"TextureMatrix",function(){return bc}),d.d(b,"TextureSystem",function(){return Ic}),d.d(b,"TextureUvs",function(){return cc}),d.d(b,"UniformGroup",function(){return gr}),d.d(b,"VideoResource",function(){return ja}),d.d(b,"ViewableBuffer",function(){return Am}),d.d(b,"autoDetectRenderer",function(){return Sm}),d.d(b,"autoDetectResource",function(){return Ba}),d.d(b,"checkMaxIfStatementsInShader",function(){return dm}),d.d(b,"createUBOElements",function(){return _m}),d.d(b,"defaultFilterVertex",function(){return Mm}),d.d(b,"defaultVertex",function(){return zE}),d.d(b,"generateProgram",function(){return Em}),d.d(b,"generateUniformBufferSync",function(){return xm}),d.d(b,"getTestContext",function(){return am}),d.d(b,"getUBOData",function(){return ym}),d.d(b,"resources",function(){return Om}),d.d(b,"systems",function(){return Dm}),d.d(b,"uniformParsers",function(){return Nr}),d.d(b,"Sprite",function(){return Gn}),d.d(b,"Application",function(){return tl}),d.d(b,"Bounds",function(){return ds}),d.d(b,"Container",function(){return On}),d.d(b,"DisplayObject",function(){return dn}),d.d(b,"TemporaryDisplayObject",function(){return ic}),d.d(b,"Mesh",function(){return Ev}),d.d(b,"MeshBatchUvs",function(){return xv}),d.d(b,"MeshGeometry",function(){return iw}),d.d(b,"MeshMaterial",function(){return nw}),d.d(b,"FillStyle",function(){return Zc}),d.d(b,"GRAPHICS_CURVES",function(){return _s}),d.d(b,"Graphics",function(){return vi}),d.d(b,"GraphicsData",function(){return nu}),d.d(b,"GraphicsGeometry",function(){return Rv}),d.d(b,"LINE_CAP",function(){return Zi}),d.d(b,"LINE_JOIN",function(){return $i}),d.d(b,"LineStyle",function(){return Lv}),d.d(b,"graphicsUtils",function(){return ow}),d.d(b,"AnimatedSprite",function(){return ol}),d.d(b,"InteractionData",function(){return Fc}),d.d(b,"InteractionEvent",function(){return rg}),d.d(b,"InteractionManager",function(){return og}),d.d(b,"InteractionTrackingData",function(){return el}),d.d(b,"interactiveTarget",function(){return sg}),d.d(b,"Spritesheet",function(){return lu}),d.d(b,"SpritesheetLoader",function(){return uw}),d.d(b,"Extract",function(){return Kg}),d.d(b,"filters",function(){return So});const C=[];for(let i=0;i<256;i++)C[i]=(i<16?"0":"")+i.toString(16);function T(){const i=4294967295*Math.random()|0,t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(C[255&i]+C[i>>8&255]+C[i>>16&255]+C[i>>24&255]+"-"+C[255&t]+C[t>>8&255]+"-"+C[t>>16&15|64]+C[t>>24&255]+"-"+C[63&e|128]+C[e>>8&255]+"-"+C[e>>16&255]+C[e>>24&255]+C[255&n]+C[n>>8&255]+C[n>>16&255]+C[n>>24&255]).toUpperCase()}var S=d(9);/**
|
|
2023
2023
|
* @license
|
|
2024
2024
|
* Copyright 2010-2021 Three.js Authors
|
|
2025
2025
|
* SPDX-License-Identifier: MIT
|
|
2026
|
-
*/class N{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[t]===void 0&&(n[t]=[]),n[t].indexOf(e)===-1&&n[t].push(e)}hasEventListener(t,e){if(this._listeners===void 0)return!1;const n=this._listeners;return n[t]!==void 0&&n[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;const n=this._listeners[t];if(n!==void 0){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}}dispatchEvent(t){if(this._listeners===void 0)return;const e=this._listeners[t.type];if(e!==void 0){t.target=this;const n=e.slice(0);for(let r=0,s=n.length;r<s;r++)n[r].call(this,t);t.target=null}}}const C=[];for(let i=0;i<256;i++)C[i]=(i<16?"0":"")+i.toString(16);const L=Math.PI/180,k=180/Math.PI;function K(){const i=4294967295*Math.random()|0,t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(C[255&i]+C[i>>8&255]+C[i>>16&255]+C[i>>24&255]+"-"+C[255&t]+C[t>>8&255]+"-"+C[t>>16&15|64]+C[t>>24&255]+"-"+C[63&e|128]+C[e>>8&255]+"-"+C[e>>16&255]+C[e>>24&255]+C[255&n]+C[n>>8&255]+C[n>>16&255]+C[n>>24&255]).toUpperCase()}function ut(i,t,e){return Math.max(t,Math.min(e,i))}function _t(i,t){return(i%t+t)%t}function E(i,t,e){return(1-e)*i+e*t}function I(i){return(i&i-1)==0&&i!==0}function D(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}class F{constructor(t=0,e=0){this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t,e){return e!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t,e){return e!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6],this.y=r[1]*e+r[4]*n+r[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e,n){return n!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),r=Math.sin(e),s=this.x-t.x,o=this.y-t.y;return this.x=s*n-o*r+t.x,this.y=s*r+o*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}}F.prototype.isVector2=!0;class P{constructor(){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.")}set(t,e,n,r,s,o,a,l,h){const c=this.elements;return c[0]=t,c[1]=r,c[2]=a,c[3]=e,c[4]=s,c[5]=l,c[6]=n,c[7]=o,c[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,r=e.elements,s=this.elements,o=n[0],a=n[3],l=n[6],h=n[1],c=n[4],u=n[7],p=n[2],f=n[5],g=n[8],_=r[0],v=r[3],M=r[6],A=r[1],O=r[4],H=r[7],j=r[2],X=r[5],U=r[8];return s[0]=o*_+a*A+l*j,s[3]=o*v+a*O+l*X,s[6]=o*M+a*H+l*U,s[1]=h*_+c*A+u*j,s[4]=h*v+c*O+u*X,s[7]=h*M+c*H+u*U,s[2]=p*_+f*A+g*j,s[5]=p*v+f*O+g*X,s[8]=p*M+f*H+g*U,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=t[6],h=t[7],c=t[8];return e*o*c-e*a*h-n*s*c+n*a*l+r*s*h-r*o*l}invert(){const t=this.elements,e=t[0],n=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=t[6],h=t[7],c=t[8],u=c*o-a*h,p=a*l-c*s,f=h*s-o*l,g=e*u+n*p+r*f;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/g;return t[0]=u*_,t[1]=(r*h-c*n)*_,t[2]=(a*n-r*o)*_,t[3]=p*_,t[4]=(c*e-r*l)*_,t[5]=(r*s-a*e)*_,t[6]=f*_,t[7]=(n*l-h*e)*_,t[8]=(o*e-n*s)*_,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,r,s,o,a){const l=Math.cos(s),h=Math.sin(s);return this.set(n*l,n*h,-n*(l*o+h*a)+o+t,-r*h,r*l,-r*(-h*o+l*a)+a+e,0,0,1),this}scale(t,e){const n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=e,n[4]*=e,n[7]*=e,this}rotate(t){const e=Math.cos(t),n=Math.sin(t),r=this.elements,s=r[0],o=r[3],a=r[6],l=r[1],h=r[4],c=r[7];return r[0]=e*s+n*l,r[3]=e*o+n*h,r[6]=e*a+n*c,r[1]=-n*s+e*l,r[4]=-n*o+e*h,r[7]=-n*a+e*c,this}translate(t,e){const n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=e*n[2],n[4]+=e*n[5],n[7]+=e*n[8],this}equals(t){const e=this.elements,n=t.elements;for(let r=0;r<9;r++)if(e[r]!==n[r])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return new this.constructor().fromArray(this.elements)}}let B;P.prototype.isMatrix3=!0;class G{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement=="undefined")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{B===void 0&&(B=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),B.width=t.width,B.height=t.height;const n=B.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=B}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}}let q=0;class Rt extends N{constructor(t=Rt.DEFAULT_IMAGE,e=Rt.DEFAULT_MAPPING,n=1001,r=1001,s=1006,o=1008,a=1023,l=1009,h=1,c=3e3){super(),Object.defineProperty(this,"id",{value:q++}),this.uuid=K(),this.name="",this.image=t,this.mipmaps=[],this.mapping=e,this.wrapS=n,this.wrapT=r,this.magFilter=s,this.minFilter=o,this.anisotropy=h,this.format=a,this.internalFormat=null,this.type=l,this.offset=new F(0,0),this.repeat=new F(1,1),this.center=new F(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new P,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=c,this.version=0,this.onUpdate=null}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this}toJSON(t){const e=t===void 0||typeof t=="string";if(!e&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];const 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(this.image!==void 0){const r=this.image;if(r.uuid===void 0&&(r.uuid=K()),!e&&t.images[r.uuid]===void 0){let s;if(Array.isArray(r)){s=[];for(let o=0,a=r.length;o<a;o++)r[o].isDataTexture?s.push(Xt(r[o].image)):s.push(Xt(r[o]))}else s=Xt(r);t.images[r.uuid]={uuid:r.uuid,url:s}}n.image=r.uuid}return e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==300)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case 1e3:t.x=t.x-Math.floor(t.x);break;case 1001:t.x=t.x<0?0:1;break;case 1002:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case 1e3:t.y=t.y-Math.floor(t.y);break;case 1001:t.y=t.y<0?0:1;break;case 1002:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&this.version++}}function Xt(i){return typeof HTMLImageElement!="undefined"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&i instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&i instanceof ImageBitmap?G.getDataURL(i):i.data?{data:Array.prototype.slice.call(i.data),width:i.width,height:i.height,type:i.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}Rt.DEFAULT_IMAGE=void 0,Rt.DEFAULT_MAPPING=300,Rt.prototype.isTexture=!0;class at{constructor(t=0,e=0,n=0,r=1){this.x=t,this.y=e,this.z=n,this.w=r}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,r){return this.x=t,this.y=e,this.z=n,this.w=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t,e){return e!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t,e){return e!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,r=this.z,s=this.w,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*r+o[12]*s,this.y=o[1]*e+o[5]*n+o[9]*r+o[13]*s,this.z=o[2]*e+o[6]*n+o[10]*r+o[14]*s,this.w=o[3]*e+o[7]*n+o[11]*r+o[15]*s,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,r,s;const o=t.elements,a=o[0],l=o[4],h=o[8],c=o[1],u=o[5],p=o[9],f=o[2],g=o[6],_=o[10];if(Math.abs(l-c)<.01&&Math.abs(h-f)<.01&&Math.abs(p-g)<.01){if(Math.abs(l+c)<.1&&Math.abs(h+f)<.1&&Math.abs(p+g)<.1&&Math.abs(a+u+_-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const M=(a+1)/2,A=(u+1)/2,O=(_+1)/2,H=(l+c)/4,j=(h+f)/4,X=(p+g)/4;return M>A&&M>O?M<.01?(n=0,r=.707106781,s=.707106781):(n=Math.sqrt(M),r=H/n,s=j/n):A>O?A<.01?(n=.707106781,r=0,s=.707106781):(r=Math.sqrt(A),n=H/r,s=X/r):O<.01?(n=.707106781,r=.707106781,s=0):(s=Math.sqrt(O),n=j/s,r=X/s),this.set(n,r,s,e),this}let v=Math.sqrt((g-p)*(g-p)+(h-f)*(h-f)+(c-l)*(c-l));return Math.abs(v)<.001&&(v=1),this.x=(g-p)/v,this.y=(h-f)/v,this.z=(c-l)/v,this.w=Math.acos((a+u+_-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e,n){return n!==void 0&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}at.prototype.isVector4=!0;class $ extends N{constructor(t,e,n={}){super(),this.width=t,this.height=e,this.depth=1,this.scissor=new at(0,0,t,e),this.scissorTest=!1,this.viewport=new at(0,0,t,e),this.texture=new Rt(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={width:t,height:e,depth:1},this.texture.generateMipmaps=n.generateMipmaps!==void 0&&n.generateMipmaps,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:1006,this.depthBuffer=n.depthBuffer===void 0||n.depthBuffer,this.stencilBuffer=n.stencilBuffer!==void 0&&n.stencilBuffer,this.depthTexture=n.depthTexture!==void 0?n.depthTexture:null}setTexture(t){t.image={width:this.width,height:this.height,depth:this.depth},this.texture=t}setSize(t,e,n=1){this.width===t&&this.height===e&&this.depth===n||(this.width=t,this.height=e,this.depth=n,this.texture.image.width=t,this.texture.image.height=e,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){return this.width=t.width,this.height=t.height,this.depth=t.depth,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.texture.image=Vu({},this.texture.image),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}$.prototype.isWebGLRenderTarget=!0,class extends ${constructor(i,t,e){super(i,t);const n=this.texture;this.texture=[];for(let r=0;r<e;r++)this.texture[r]=n.clone()}setSize(i,t,e=1){if(this.width!==i||this.height!==t||this.depth!==e){this.width=i,this.height=t,this.depth=e;for(let n=0,r=this.texture.length;n<r;n++)this.texture[n].image.width=i,this.texture[n].image.height=t,this.texture[n].image.depth=e;this.dispose()}return this.viewport.set(0,0,i,t),this.scissor.set(0,0,i,t),this}copy(i){this.dispose(),this.width=i.width,this.height=i.height,this.depth=i.depth,this.viewport.set(0,0,this.width,this.height),this.scissor.set(0,0,this.width,this.height),this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.depthTexture=i.depthTexture,this.texture.length=0;for(let t=0,e=i.texture.length;t<e;t++)this.texture[t]=i.texture[t].clone();return this}}.prototype.isWebGLMultipleRenderTargets=!0;class tt extends ${constructor(t,e,n){super(t,e,n),this.samples=4}copy(t){return super.copy.call(this,t),this.samples=t.samples,this}}tt.prototype.isWebGLMultisampleRenderTarget=!0;class lt{constructor(t=0,e=0,n=0,r=1){this._x=t,this._y=e,this._z=n,this._w=r}static slerp(t,e,n,r){return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."),n.slerpQuaternions(t,e,r)}static slerpFlat(t,e,n,r,s,o,a){let l=n[r+0],h=n[r+1],c=n[r+2],u=n[r+3];const p=s[o+0],f=s[o+1],g=s[o+2],_=s[o+3];if(a===0)return t[e+0]=l,t[e+1]=h,t[e+2]=c,void(t[e+3]=u);if(a===1)return t[e+0]=p,t[e+1]=f,t[e+2]=g,void(t[e+3]=_);if(u!==_||l!==p||h!==f||c!==g){let v=1-a;const M=l*p+h*f+c*g+u*_,A=M>=0?1:-1,O=1-M*M;if(O>Number.EPSILON){const j=Math.sqrt(O),X=Math.atan2(j,M*A);v=Math.sin(v*X)/j,a=Math.sin(a*X)/j}const H=a*A;if(l=l*v+p*H,h=h*v+f*H,c=c*v+g*H,u=u*v+_*H,v===1-a){const j=1/Math.sqrt(l*l+h*h+c*c+u*u);l*=j,h*=j,c*=j,u*=j}}t[e]=l,t[e+1]=h,t[e+2]=c,t[e+3]=u}static multiplyQuaternionsFlat(t,e,n,r,s,o){const a=n[r],l=n[r+1],h=n[r+2],c=n[r+3],u=s[o],p=s[o+1],f=s[o+2],g=s[o+3];return t[e]=a*g+c*u+l*f-h*p,t[e+1]=l*g+c*p+h*u-a*f,t[e+2]=h*g+c*f+a*p-l*u,t[e+3]=c*g-a*u-l*p-h*f,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const n=t._x,r=t._y,s=t._z,o=t._order,a=Math.cos,l=Math.sin,h=a(n/2),c=a(r/2),u=a(s/2),p=l(n/2),f=l(r/2),g=l(s/2);switch(o){case"XYZ":this._x=p*c*u+h*f*g,this._y=h*f*u-p*c*g,this._z=h*c*g+p*f*u,this._w=h*c*u-p*f*g;break;case"YXZ":this._x=p*c*u+h*f*g,this._y=h*f*u-p*c*g,this._z=h*c*g-p*f*u,this._w=h*c*u+p*f*g;break;case"ZXY":this._x=p*c*u-h*f*g,this._y=h*f*u+p*c*g,this._z=h*c*g+p*f*u,this._w=h*c*u-p*f*g;break;case"ZYX":this._x=p*c*u-h*f*g,this._y=h*f*u+p*c*g,this._z=h*c*g-p*f*u,this._w=h*c*u+p*f*g;break;case"YZX":this._x=p*c*u+h*f*g,this._y=h*f*u+p*c*g,this._z=h*c*g-p*f*u,this._w=h*c*u-p*f*g;break;case"XZY":this._x=p*c*u-h*f*g,this._y=h*f*u-p*c*g,this._z=h*c*g+p*f*u,this._w=h*c*u+p*f*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return e!==!1&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,r=Math.sin(n);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],r=e[4],s=e[8],o=e[1],a=e[5],l=e[9],h=e[2],c=e[6],u=e[10],p=n+a+u;if(p>0){const f=.5/Math.sqrt(p+1);this._w=.25/f,this._x=(c-l)*f,this._y=(s-h)*f,this._z=(o-r)*f}else if(n>a&&n>u){const f=2*Math.sqrt(1+n-a-u);this._w=(c-l)/f,this._x=.25*f,this._y=(r+o)/f,this._z=(s+h)/f}else if(a>u){const f=2*Math.sqrt(1+a-n-u);this._w=(s-h)/f,this._x=(r+o)/f,this._y=.25*f,this._z=(l+c)/f}else{const f=2*Math.sqrt(1+u-n-a);this._w=(o-r)/f,this._x=(s+h)/f,this._y=(l+c)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(ut(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(n===0)return this;const r=Math.min(1,e/n);return this.slerp(t,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t,e){return e!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,r=t._y,s=t._z,o=t._w,a=e._x,l=e._y,h=e._z,c=e._w;return this._x=n*c+o*a+r*h-s*l,this._y=r*c+o*l+s*a-n*h,this._z=s*c+o*h+n*l-r*a,this._w=o*c-n*a-r*l-s*h,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const n=this._x,r=this._y,s=this._z,o=this._w;let a=o*t._w+n*t._x+r*t._y+s*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=n,this._y=r,this._z=s,this;const l=1-a*a;if(l<=Number.EPSILON){const f=1-e;return this._w=f*o+e*this._w,this._x=f*n+e*this._x,this._y=f*r+e*this._y,this._z=f*s+e*this._z,this.normalize(),this._onChangeCallback(),this}const h=Math.sqrt(l),c=Math.atan2(h,a),u=Math.sin((1-e)*c)/h,p=Math.sin(e*c)/h;return this._w=o*u+this._w*p,this._x=n*u+this._x*p,this._y=r*u+this._y*p,this._z=s*u+this._z*p,this._onChangeCallback(),this}slerpQuaternions(t,e,n){this.copy(t).slerp(e,n)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}lt.prototype.isQuaternion=!0;class w{constructor(t=0,e=0,n=0){this.x=t,this.y=e,this.z=n}set(t,e,n){return n===void 0&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t,e){return e!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t,e){return e!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t,e){return e!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(bt.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(bt.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,r=this.z,s=t.elements;return this.x=s[0]*e+s[3]*n+s[6]*r,this.y=s[1]*e+s[4]*n+s[7]*r,this.z=s[2]*e+s[5]*n+s[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,r=this.z,s=t.elements,o=1/(s[3]*e+s[7]*n+s[11]*r+s[15]);return this.x=(s[0]*e+s[4]*n+s[8]*r+s[12])*o,this.y=(s[1]*e+s[5]*n+s[9]*r+s[13])*o,this.z=(s[2]*e+s[6]*n+s[10]*r+s[14])*o,this}applyQuaternion(t){const e=this.x,n=this.y,r=this.z,s=t.x,o=t.y,a=t.z,l=t.w,h=l*e+o*r-a*n,c=l*n+a*e-s*r,u=l*r+s*n-o*e,p=-s*e-o*n-a*r;return this.x=h*l+p*-s+c*-a-u*-o,this.y=c*l+p*-o+u*-s-h*-a,this.z=u*l+p*-a+h*-o-c*-s,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,r=this.z,s=t.elements;return this.x=s[0]*e+s[4]*n+s[8]*r,this.y=s[1]*e+s[5]*n+s[9]*r,this.z=s[2]*e+s[6]*n+s[10]*r,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t,e){return e!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,r=t.y,s=t.z,o=e.x,a=e.y,l=e.z;return this.x=r*l-s*a,this.y=s*o-n*l,this.z=n*a-r*o,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return ot.copy(this).projectOnVector(t),this.sub(ot)}reflect(t){return this.sub(ot.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(ut(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return e*e+n*n+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const r=Math.sin(e)*t;return this.x=r*Math.sin(n),this.y=Math.cos(e)*t,this.z=r*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=r,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e,n){return n!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}}w.prototype.isVector3=!0;const ot=new w,bt=new lt;class dt{constructor(t=new w(1/0,1/0,1/0),e=new w(-1/0,-1/0,-1/0)){this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){let e=1/0,n=1/0,r=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,h=t.length;l<h;l+=3){const c=t[l],u=t[l+1],p=t[l+2];c<e&&(e=c),u<n&&(n=u),p<r&&(r=p),c>s&&(s=c),u>o&&(o=u),p>a&&(a=p)}return this.min.set(e,n,r),this.max.set(s,o,a),this}setFromBufferAttribute(t){let e=1/0,n=1/0,r=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,h=t.count;l<h;l++){const c=t.getX(l),u=t.getY(l),p=t.getZ(l);c<e&&(e=c),u<n&&(n=u),p<r&&(r=p),c>s&&(s=c),u>o&&(o=u),p>a&&(a=p)}return this.min.set(e,n,r),this.max.set(s,o,a),this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const n=Ot.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}setFromObject(t){return this.makeEmpty(),this.expandByObject(t)}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t){t.updateWorldMatrix(!1,!1);const e=t.geometry;e!==void 0&&(e.boundingBox===null&&e.computeBoundingBox(),kt.copy(e.boundingBox),kt.applyMatrix4(t.matrixWorld),this.union(kt));const n=t.children;for(let r=0,s=n.length;r<s;r++)this.expandByObject(n[r]);return this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}intersectsSphere(t){return this.clampPoint(t.center,Ot),Ot.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Se),ue.subVectors(this.max,Se),Dt.subVectors(t.a,Se),te.subVectors(t.b,Se),re.subVectors(t.c,Se),$t.subVectors(te,Dt),pe.subVectors(re,te),le.subVectors(Dt,re);let e=[0,-$t.z,$t.y,0,-pe.z,pe.y,0,-le.z,le.y,$t.z,0,-$t.x,pe.z,0,-pe.x,le.z,0,-le.x,-$t.y,$t.x,0,-pe.y,pe.x,0,-le.y,le.x,0];return!!Ge(e,Dt,te,re,ue)&&(e=[1,0,0,0,1,0,0,0,1],!!Ge(e,Dt,te,re,ue)&&(Oe.crossVectors($t,pe),e=[Oe.x,Oe.y,Oe.z],Ge(e,Dt,te,re,ue)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return Ot.copy(t).clamp(this.min,this.max).sub(t).length()}getBoundingSphere(t){return this.getCenter(t.center),t.radius=.5*this.getSize(Ot).length(),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(yt[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),yt[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),yt[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),yt[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),yt[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),yt[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),yt[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),yt[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(yt)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}dt.prototype.isBox3=!0;const yt=[new w,new w,new w,new w,new w,new w,new w,new w],Ot=new w,kt=new dt,Dt=new w,te=new w,re=new w,$t=new w,pe=new w,le=new w,Se=new w,ue=new w,Oe=new w,Me=new w;function Ge(i,t,e,n,r){for(let s=0,o=i.length-3;s<=o;s+=3){Me.fromArray(i,s);const a=r.x*Math.abs(Me.x)+r.y*Math.abs(Me.y)+r.z*Math.abs(Me.z),l=t.dot(Me),h=e.dot(Me),c=n.dot(Me);if(Math.max(-Math.max(l,h,c),Math.min(l,h,c))>a)return!1}return!0}const nn=new dt,fe=new w,ge=new w,En=new w;class je{constructor(t=new w,e=-1){this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;e!==void 0?n.copy(e):nn.setFromPoints(t).getCenter(n);let r=0;for(let s=0,o=t.length;s<o;s++)r=Math.max(r,n.distanceToSquared(t[s]));return this.radius=Math.sqrt(r),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const n=this.center.distanceToSquared(t);return e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){En.subVectors(t,this.center);const e=En.lengthSq();if(e>this.radius*this.radius){const n=Math.sqrt(e),r=.5*(n-this.radius);this.center.add(En.multiplyScalar(r/n)),this.radius+=r}return this}union(t){return ge.subVectors(t.center,this.center).normalize().multiplyScalar(t.radius),this.expandByPoint(fe.copy(t.center).add(ge)),this.expandByPoint(fe.copy(t.center).sub(ge)),this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}}const rn=new w,wn=new w,er=new w,Ti=new w,Ds=new w,nr=new w,Fs=new w;class z{constructor(t=new w,e=new w(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.direction).multiplyScalar(t).add(this.origin)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,rn)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=rn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(rn.copy(this.direction).multiplyScalar(e).add(this.origin),rn.distanceToSquared(t))}distanceSqToSegment(t,e,n,r){wn.copy(t).add(e).multiplyScalar(.5),er.copy(e).sub(t).normalize(),Ti.copy(this.origin).sub(wn);const s=.5*t.distanceTo(e),o=-this.direction.dot(er),a=Ti.dot(this.direction),l=-Ti.dot(er),h=Ti.lengthSq(),c=Math.abs(1-o*o);let u,p,f,g;if(c>0)if(u=o*l-a,p=o*a-l,g=s*c,u>=0)if(p>=-g)if(p<=g){const _=1/c;u*=_,p*=_,f=u*(u+o*p+2*a)+p*(o*u+p+2*l)+h}else p=s,u=Math.max(0,-(o*p+a)),f=-u*u+p*(p+2*l)+h;else p=-s,u=Math.max(0,-(o*p+a)),f=-u*u+p*(p+2*l)+h;else p<=-g?(u=Math.max(0,-(-o*s+a)),p=u>0?-s:Math.min(Math.max(-s,-l),s),f=-u*u+p*(p+2*l)+h):p<=g?(u=0,p=Math.min(Math.max(-s,-l),s),f=p*(p+2*l)+h):(u=Math.max(0,-(o*s+a)),p=u>0?s:Math.min(Math.max(-s,-l),s),f=-u*u+p*(p+2*l)+h);else p=o>0?-s:s,u=Math.max(0,-(o*p+a)),f=-u*u+p*(p+2*l)+h;return n&&n.copy(this.direction).multiplyScalar(u).add(this.origin),r&&r.copy(er).multiplyScalar(p).add(wn),f}intersectSphere(t,e){rn.subVectors(t.center,this.origin);const n=rn.dot(this.direction),r=rn.dot(rn)-n*n,s=t.radius*t.radius;if(r>s)return null;const o=Math.sqrt(s-r),a=n-o,l=n+o;return a<0&&l<0?null:a<0?this.at(l,e):this.at(a,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return n===null?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return e===0?!0:t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,r,s,o,a,l;const h=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,p=this.origin;return h>=0?(n=(t.min.x-p.x)*h,r=(t.max.x-p.x)*h):(n=(t.max.x-p.x)*h,r=(t.min.x-p.x)*h),c>=0?(s=(t.min.y-p.y)*c,o=(t.max.y-p.y)*c):(s=(t.max.y-p.y)*c,o=(t.min.y-p.y)*c),n>o||s>r?null:((s>n||n!=n)&&(n=s),(o<r||r!=r)&&(r=o),u>=0?(a=(t.min.z-p.z)*u,l=(t.max.z-p.z)*u):(a=(t.max.z-p.z)*u,l=(t.min.z-p.z)*u),n>l||a>r?null:((a>n||n!=n)&&(n=a),(l<r||r!=r)&&(r=l),r<0?null:this.at(n>=0?n:r,e)))}intersectsBox(t){return this.intersectBox(t,rn)!==null}intersectTriangle(t,e,n,r,s){Ds.subVectors(e,t),nr.subVectors(n,t),Fs.crossVectors(Ds,nr);let o,a=this.direction.dot(Fs);if(a>0){if(r)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}Ti.subVectors(this.origin,t);const l=o*this.direction.dot(nr.crossVectors(Ti,nr));if(l<0)return null;const h=o*this.direction.dot(Ds.cross(Ti));if(h<0||l+h>a)return null;const c=-o*Ti.dot(Fs);return c<0?null:this.at(c/a,s)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class W{constructor(){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.")}set(t,e,n,r,s,o,a,l,h,c,u,p,f,g,_,v){const M=this.elements;return M[0]=t,M[4]=e,M[8]=n,M[12]=r,M[1]=s,M[5]=o,M[9]=a,M[13]=l,M[2]=h,M[6]=c,M[10]=u,M[14]=p,M[3]=f,M[7]=g,M[11]=_,M[15]=v,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new W().fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,r=1/Z.setFromMatrixColumn(t,0).length(),s=1/Z.setFromMatrixColumn(t,1).length(),o=1/Z.setFromMatrixColumn(t,2).length();return e[0]=n[0]*r,e[1]=n[1]*r,e[2]=n[2]*r,e[3]=0,e[4]=n[4]*s,e[5]=n[5]*s,e[6]=n[6]*s,e[7]=0,e[8]=n[8]*o,e[9]=n[9]*o,e[10]=n[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const e=this.elements,n=t.x,r=t.y,s=t.z,o=Math.cos(n),a=Math.sin(n),l=Math.cos(r),h=Math.sin(r),c=Math.cos(s),u=Math.sin(s);if(t.order==="XYZ"){const p=o*c,f=o*u,g=a*c,_=a*u;e[0]=l*c,e[4]=-l*u,e[8]=h,e[1]=f+g*h,e[5]=p-_*h,e[9]=-a*l,e[2]=_-p*h,e[6]=g+f*h,e[10]=o*l}else if(t.order==="YXZ"){const p=l*c,f=l*u,g=h*c,_=h*u;e[0]=p+_*a,e[4]=g*a-f,e[8]=o*h,e[1]=o*u,e[5]=o*c,e[9]=-a,e[2]=f*a-g,e[6]=_+p*a,e[10]=o*l}else if(t.order==="ZXY"){const p=l*c,f=l*u,g=h*c,_=h*u;e[0]=p-_*a,e[4]=-o*u,e[8]=g+f*a,e[1]=f+g*a,e[5]=o*c,e[9]=_-p*a,e[2]=-o*h,e[6]=a,e[10]=o*l}else if(t.order==="ZYX"){const p=o*c,f=o*u,g=a*c,_=a*u;e[0]=l*c,e[4]=g*h-f,e[8]=p*h+_,e[1]=l*u,e[5]=_*h+p,e[9]=f*h-g,e[2]=-h,e[6]=a*l,e[10]=o*l}else if(t.order==="YZX"){const p=o*l,f=o*h,g=a*l,_=a*h;e[0]=l*c,e[4]=_-p*u,e[8]=g*u+f,e[1]=u,e[5]=o*c,e[9]=-a*c,e[2]=-h*c,e[6]=f*u+g,e[10]=p-_*u}else if(t.order==="XZY"){const p=o*l,f=o*h,g=a*l,_=a*h;e[0]=l*c,e[4]=-u,e[8]=h*c,e[1]=p*u+_,e[5]=o*c,e[9]=f*u-g,e[2]=g*u-f,e[6]=a*c,e[10]=_*u+p}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(mt,t,vt)}lookAt(t,e,n){const r=this.elements;return Ht.subVectors(t,e),Ht.lengthSq()===0&&(Ht.z=1),Ht.normalize(),Ct.crossVectors(n,Ht),Ct.lengthSq()===0&&(Math.abs(n.z)===1?Ht.x+=1e-4:Ht.z+=1e-4,Ht.normalize(),Ct.crossVectors(n,Ht)),Ct.normalize(),zt.crossVectors(Ht,Ct),r[0]=Ct.x,r[4]=zt.x,r[8]=Ht.x,r[1]=Ct.y,r[5]=zt.y,r[9]=Ht.y,r[2]=Ct.z,r[6]=zt.z,r[10]=Ht.z,this}multiply(t,e){return e!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,r=e.elements,s=this.elements,o=n[0],a=n[4],l=n[8],h=n[12],c=n[1],u=n[5],p=n[9],f=n[13],g=n[2],_=n[6],v=n[10],M=n[14],A=n[3],O=n[7],H=n[11],j=n[15],X=r[0],U=r[4],V=r[8],xt=r[12],it=r[1],Q=r[5],st=r[9],nt=r[13],ct=r[2],Lt=r[6],At=r[10],ht=r[14],gt=r[3],Ut=r[7],Vt=r[11],Zt=r[15];return s[0]=o*X+a*it+l*ct+h*gt,s[4]=o*U+a*Q+l*Lt+h*Ut,s[8]=o*V+a*st+l*At+h*Vt,s[12]=o*xt+a*nt+l*ht+h*Zt,s[1]=c*X+u*it+p*ct+f*gt,s[5]=c*U+u*Q+p*Lt+f*Ut,s[9]=c*V+u*st+p*At+f*Vt,s[13]=c*xt+u*nt+p*ht+f*Zt,s[2]=g*X+_*it+v*ct+M*gt,s[6]=g*U+_*Q+v*Lt+M*Ut,s[10]=g*V+_*st+v*At+M*Vt,s[14]=g*xt+_*nt+v*ht+M*Zt,s[3]=A*X+O*it+H*ct+j*gt,s[7]=A*U+O*Q+H*Lt+j*Ut,s[11]=A*V+O*st+H*At+j*Vt,s[15]=A*xt+O*nt+H*ht+j*Zt,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[4],r=t[8],s=t[12],o=t[1],a=t[5],l=t[9],h=t[13],c=t[2],u=t[6],p=t[10],f=t[14];return t[3]*(+s*l*u-r*h*u-s*a*p+n*h*p+r*a*f-n*l*f)+t[7]*(+e*l*f-e*h*p+s*o*p-r*o*f+r*h*c-s*l*c)+t[11]*(+e*h*u-e*a*f-s*o*u+n*o*f+s*a*c-n*h*c)+t[15]*(-r*a*c-e*l*u+e*a*p+r*o*u-n*o*p+n*l*c)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=t[6],h=t[7],c=t[8],u=t[9],p=t[10],f=t[11],g=t[12],_=t[13],v=t[14],M=t[15],A=u*v*h-_*p*h+_*l*f-a*v*f-u*l*M+a*p*M,O=g*p*h-c*v*h-g*l*f+o*v*f+c*l*M-o*p*M,H=c*_*h-g*u*h+g*a*f-o*_*f-c*a*M+o*u*M,j=g*u*l-c*_*l-g*a*p+o*_*p+c*a*v-o*u*v,X=e*A+n*O+r*H+s*j;if(X===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const U=1/X;return t[0]=A*U,t[1]=(_*p*s-u*v*s-_*r*f+n*v*f+u*r*M-n*p*M)*U,t[2]=(a*v*s-_*l*s+_*r*h-n*v*h-a*r*M+n*l*M)*U,t[3]=(u*l*s-a*p*s-u*r*h+n*p*h+a*r*f-n*l*f)*U,t[4]=O*U,t[5]=(c*v*s-g*p*s+g*r*f-e*v*f-c*r*M+e*p*M)*U,t[6]=(g*l*s-o*v*s-g*r*h+e*v*h+o*r*M-e*l*M)*U,t[7]=(o*p*s-c*l*s+c*r*h-e*p*h-o*r*f+e*l*f)*U,t[8]=H*U,t[9]=(g*u*s-c*_*s-g*n*f+e*_*f+c*n*M-e*u*M)*U,t[10]=(o*_*s-g*a*s+g*n*h-e*_*h-o*n*M+e*a*M)*U,t[11]=(c*a*s-o*u*s-c*n*h+e*u*h+o*n*f-e*a*f)*U,t[12]=j*U,t[13]=(c*_*r-g*u*r+g*n*p-e*_*p-c*n*v+e*u*v)*U,t[14]=(g*a*r-o*_*r-g*n*l+e*_*l+o*n*v-e*a*v)*U,t[15]=(o*u*r-c*a*r+c*n*l-e*u*l-o*n*p+e*a*p)*U,this}scale(t){const e=this.elements,n=t.x,r=t.y,s=t.z;return e[0]*=n,e[4]*=r,e[8]*=s,e[1]*=n,e[5]*=r,e[9]*=s,e[2]*=n,e[6]*=r,e[10]*=s,e[3]*=n,e[7]*=r,e[11]*=s,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,r))}makeTranslation(t,e,n){return this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),r=Math.sin(e),s=1-n,o=t.x,a=t.y,l=t.z,h=s*o,c=s*a;return this.set(h*o+n,h*a-r*l,h*l+r*a,0,h*a+r*l,c*a+n,c*l-r*o,0,h*l-r*a,c*l+r*o,s*l*l+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,r,s,o){return this.set(1,n,s,0,t,1,o,0,e,r,1,0,0,0,0,1),this}compose(t,e,n){const r=this.elements,s=e._x,o=e._y,a=e._z,l=e._w,h=s+s,c=o+o,u=a+a,p=s*h,f=s*c,g=s*u,_=o*c,v=o*u,M=a*u,A=l*h,O=l*c,H=l*u,j=n.x,X=n.y,U=n.z;return r[0]=(1-(_+M))*j,r[1]=(f+H)*j,r[2]=(g-O)*j,r[3]=0,r[4]=(f-H)*X,r[5]=(1-(p+M))*X,r[6]=(v+A)*X,r[7]=0,r[8]=(g+O)*U,r[9]=(v-A)*U,r[10]=(1-(p+_))*U,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,e,n){const r=this.elements;let s=Z.set(r[0],r[1],r[2]).length();const o=Z.set(r[4],r[5],r[6]).length(),a=Z.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),t.x=r[12],t.y=r[13],t.z=r[14],ft.copy(this);const l=1/s,h=1/o,c=1/a;return ft.elements[0]*=l,ft.elements[1]*=l,ft.elements[2]*=l,ft.elements[4]*=h,ft.elements[5]*=h,ft.elements[6]*=h,ft.elements[8]*=c,ft.elements[9]*=c,ft.elements[10]*=c,e.setFromRotationMatrix(ft),n.x=s,n.y=o,n.z=a,this}makePerspective(t,e,n,r,s,o){o===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const a=this.elements,l=2*s/(e-t),h=2*s/(n-r),c=(e+t)/(e-t),u=(n+r)/(n-r),p=-(o+s)/(o-s),f=-2*o*s/(o-s);return a[0]=l,a[4]=0,a[8]=c,a[12]=0,a[1]=0,a[5]=h,a[9]=u,a[13]=0,a[2]=0,a[6]=0,a[10]=p,a[14]=f,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(t,e,n,r,s,o){const a=this.elements,l=1/(e-t),h=1/(n-r),c=1/(o-s),u=(e+t)*l,p=(n+r)*h,f=(o+s)*c;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-u,a[1]=0,a[5]=2*h,a[9]=0,a[13]=-p,a[2]=0,a[6]=0,a[10]=-2*c,a[14]=-f,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let r=0;r<16;r++)if(e[r]!==n[r])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}W.prototype.isMatrix4=!0;const Z=new w,ft=new W,mt=new w(0,0,0),vt=new w(1,1,1),Ct=new w,zt=new w,Ht=new w,Wt=new W,ne=new lt;class oe{constructor(t=0,e=0,n=0,r=oe.DefaultOrder){this._x=t,this._y=e,this._z=n,this._order=r}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,r=this._order){return this._x=t,this._y=e,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){const r=t.elements,s=r[0],o=r[4],a=r[8],l=r[1],h=r[5],c=r[9],u=r[2],p=r[6],f=r[10];switch(e){case"XYZ":this._y=Math.asin(ut(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,f),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(p,h),this._z=0);break;case"YXZ":this._x=Math.asin(-ut(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(a,f),this._z=Math.atan2(l,h)):(this._y=Math.atan2(-u,s),this._z=0);break;case"ZXY":this._x=Math.asin(ut(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-o,h)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-ut(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(p,f),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,h));break;case"YZX":this._z=Math.asin(ut(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-c,h),this._y=Math.atan2(-u,s)):(this._x=0,this._y=Math.atan2(a,f));break;case"XZY":this._z=Math.asin(-ut(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,h),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-c,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,n===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return Wt.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Wt,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return ne.setFromEuler(this),this.setFromQuaternion(ne,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}toVector3(t){return t?t.set(this._x,this._y,this._z):new w(this._x,this._y,this._z)}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}oe.prototype.isEuler=!0,oe.DefaultOrder="XYZ",oe.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class ye{constructor(){this.mask=1}set(t){this.mask=1<<t|0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!=0}}let Ce=0;const Ie=new w,Ke=new lt,Tn=new W,Si=new w,Mr=new w,zl=new w,Qo=new lt,hd=new w(1,0,0),cd=new w(0,1,0),ud=new w(0,0,1),K_={type:"added"},dd={type:"removed"};class ke extends N{constructor(){super(),Object.defineProperty(this,"id",{value:Ce++}),this.uuid=K(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=ke.DefaultUp.clone();const t=new w,e=new oe,n=new lt,r=new w(1,1,1);e._onChange(function(){n.setFromEuler(e,!1)}),n._onChange(function(){e.setFromQuaternion(n,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new W},normalMatrix:{value:new P}}),this.matrix=new W,this.matrixWorld=new W,this.matrixAutoUpdate=ke.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new ye,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return Ke.setFromAxisAngle(t,e),this.quaternion.multiply(Ke),this}rotateOnWorldAxis(t,e){return Ke.setFromAxisAngle(t,e),this.quaternion.premultiply(Ke),this}rotateX(t){return this.rotateOnAxis(hd,t)}rotateY(t){return this.rotateOnAxis(cd,t)}rotateZ(t){return this.rotateOnAxis(ud,t)}translateOnAxis(t,e){return Ie.copy(t).applyQuaternion(this.quaternion),this.position.add(Ie.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(hd,t)}translateY(t){return this.translateOnAxis(cd,t)}translateZ(t){return this.translateOnAxis(ud,t)}localToWorld(t){return t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return t.applyMatrix4(Tn.copy(this.matrixWorld).invert())}lookAt(t,e,n){t.isVector3?Si.copy(t):Si.set(t,e,n);const r=this.parent;this.updateWorldMatrix(!0,!1),Mr.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Tn.lookAt(Mr,Si,this.up):Tn.lookAt(Si,Mr,this.up),this.quaternion.setFromRotationMatrix(Tn),r&&(Tn.extractRotation(r.matrixWorld),Ke.setFromRotationMatrix(Tn),this.quaternion.premultiply(Ke.invert()))}add(t){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.parent!==null&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(K_)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const e=this.children.indexOf(t);return e!==-1&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(dd)),this}removeFromParent(){const t=this.parent;return t!==null&&t.remove(this),this}clear(){for(let t=0;t<this.children.length;t++){const e=this.children[t];e.parent=null,e.dispatchEvent(dd)}return this.children.length=0,this}attach(t){return this.updateWorldMatrix(!0,!1),Tn.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),Tn.multiply(t.parent.matrixWorld)),t.applyMatrix4(Tn),this.add(t),t.updateWorldMatrix(!1,!0),this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let n=0,r=this.children.length;n<r;n++){const s=this.children[n].getObjectByProperty(t,e);if(s!==void 0)return s}}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Mr,t,zl),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Mr,Qo,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let n=0,r=e.length;n<r;n++)e[n].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);const e=this.children;for(let n=0,r=e.length;n<r;n++)e[n].traverseVisible(t)}traverseAncestors(t){const e=this.parent;e!==null&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let n=0,r=e.length;n<r;n++)e[n].updateMatrixWorld(t)}updateWorldMatrix(t,e){const n=this.parent;if(t===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),e===!0){const r=this.children;for(let s=0,o=r.length;s<o;s++)r[s].updateWorldMatrix(!1,!0)}}toJSON(t){const e=t===void 0||typeof t=="string",n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const r={};function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(t)),l.uuid}if(r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),JSON.stringify(this.userData)!=="{}"&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&(r.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(t.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let h=0,c=l.length;h<c;h++){const u=l[h];s(t.shapes,u)}else s(t.shapes,l)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(t.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const a=[];for(let l=0,h=this.material.length;l<h;l++)a.push(s(t.materials,this.material[l]));r.material=a}else r.material=s(t.materials,this.material);if(this.children.length>0){r.children=[];for(let a=0;a<this.children.length;a++)r.children.push(this.children[a].toJSON(t).object)}if(this.animations.length>0){r.animations=[];for(let a=0;a<this.animations.length;a++){const l=this.animations[a];r.animations.push(s(t.animations,l))}}if(e){const a=o(t.geometries),l=o(t.materials),h=o(t.textures),c=o(t.images),u=o(t.shapes),p=o(t.skeletons),f=o(t.animations);a.length>0&&(n.geometries=a),l.length>0&&(n.materials=l),h.length>0&&(n.textures=h),c.length>0&&(n.images=c),u.length>0&&(n.shapes=u),p.length>0&&(n.skeletons=p),f.length>0&&(n.animations=f)}return n.object=r,n;function o(a){const l=[];for(const h in a){const c=a[h];delete c.metadata,l.push(c)}return l}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let n=0;n<t.children.length;n++){const r=t.children[n];this.add(r.clone())}return this}}ke.DefaultUp=new w(0,1,0),ke.DefaultMatrixAutoUpdate=!0,ke.prototype.isObject3D=!0;const ui=new w,Gi=new w,jl=new w,Hi=new w,Wr=new w,Xr=new w,pd=new w,Vl=new w,Wl=new w,Xl=new w;class pn{constructor(t=new w,e=new w,n=new w){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,r){r.subVectors(n,e),ui.subVectors(t,e),r.cross(ui);const s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(t,e,n,r,s){ui.subVectors(r,e),Gi.subVectors(n,e),jl.subVectors(t,e);const o=ui.dot(ui),a=ui.dot(Gi),l=ui.dot(jl),h=Gi.dot(Gi),c=Gi.dot(jl),u=o*h-a*a;if(u===0)return s.set(-2,-1,-1);const p=1/u,f=(h*l-a*c)*p,g=(o*c-a*l)*p;return s.set(1-f-g,g,f)}static containsPoint(t,e,n,r){return this.getBarycoord(t,e,n,r,Hi),Hi.x>=0&&Hi.y>=0&&Hi.x+Hi.y<=1}static getUV(t,e,n,r,s,o,a,l){return this.getBarycoord(t,e,n,r,Hi),l.set(0,0),l.addScaledVector(s,Hi.x),l.addScaledVector(o,Hi.y),l.addScaledVector(a,Hi.z),l}static isFrontFacing(t,e,n,r){return ui.subVectors(n,e),Gi.subVectors(t,e),ui.cross(Gi).dot(r)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,r){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[r]),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return ui.subVectors(this.c,this.b),Gi.subVectors(this.a,this.b),.5*ui.cross(Gi).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return pn.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return pn.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,n,r,s){return pn.getUV(t,this.a,this.b,this.c,e,n,r,s)}containsPoint(t){return pn.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return pn.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,r=this.b,s=this.c;let o,a;Wr.subVectors(r,n),Xr.subVectors(s,n),Vl.subVectors(t,n);const l=Wr.dot(Vl),h=Xr.dot(Vl);if(l<=0&&h<=0)return e.copy(n);Wl.subVectors(t,r);const c=Wr.dot(Wl),u=Xr.dot(Wl);if(c>=0&&u<=c)return e.copy(r);const p=l*u-c*h;if(p<=0&&l>=0&&c<=0)return o=l/(l-c),e.copy(n).addScaledVector(Wr,o);Xl.subVectors(t,s);const f=Wr.dot(Xl),g=Xr.dot(Xl);if(g>=0&&f<=g)return e.copy(s);const _=f*h-l*g;if(_<=0&&h>=0&&g<=0)return a=h/(h-g),e.copy(n).addScaledVector(Xr,a);const v=c*g-f*u;if(v<=0&&u-c>=0&&f-g>=0)return pd.subVectors(s,r),a=(u-c)/(u-c+(f-g)),e.copy(r).addScaledVector(pd,a);const M=1/(v+_+p);return o=_*M,a=p*M,e.copy(n).addScaledVector(Wr,o).addScaledVector(Xr,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}let Q_=0;class Rn extends N{constructor(){super(),Object.defineProperty(this,"id",{value:Q_++}),this.uuid=K(),this.name="",this.type="Material",this.fog=!0,this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=7680,this.stencilZFail=7680,this.stencilZPass=7680,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.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}onBuild(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const e in t){const n=t[e];if(n===void 0){console.warn("THREE.Material: '"+e+"' parameter is undefined.");continue}if(e==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===1;continue}const r=this[e];r!==void 0?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[e]=n:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}}toJSON(t){const e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});const n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}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()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(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&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==1&&(n.blending=this.blending),this.side!==0&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,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&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(n.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.morphTargets===!0&&(n.morphTargets=!0),this.morphNormals===!0&&(n.morphNormals=!0),this.flatShading===!0&&(n.flatShading=this.flatShading),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData),e){const s=r(t.textures),o=r(t.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(e!==null){const r=e.length;n=new Array(r);for(let s=0;s!==r;++s)n[s]=e[s].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}}Rn.prototype.isMaterial=!0;const fd={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},di={h:0,s:0,l:0},ta={h:0,s:0,l:0};function Yl(i,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?i+6*(t-i)*e:e<.5?t:e<2/3?i+6*(t-i)*(2/3-e):i}function ql(i){return i<.04045?.0773993808*i:Math.pow(.9478672986*i+.0521327014,2.4)}function $l(i){return i<.0031308?12.92*i:1.055*Math.pow(i,.41666)-.055}class _e{constructor(t,e,n){return e===void 0&&n===void 0?this.set(t):this.setRGB(t,e,n)}set(t){return t&&t.isColor?this.copy(t):typeof t=="number"?this.setHex(t):typeof t=="string"&&this.setStyle(t),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this}setRGB(t,e,n){return this.r=t,this.g=e,this.b=n,this}setHSL(t,e,n){if(t=_t(t,1),e=ut(e,0,1),n=ut(n,0,1),e===0)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+e):n+e-n*e,s=2*n-r;this.r=Yl(s,r,t+1/3),this.g=Yl(s,r,t),this.b=Yl(s,r,t-1/3)}return this}setStyle(t){function e(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let r;const s=n[1],o=n[2];switch(s){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,e(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,e(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)){const a=parseFloat(r[1])/360,l=parseInt(r[2],10)/100,h=parseInt(r[3],10)/100;return e(r[4]),this.setHSL(a,l,h)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(t)){const r=n[1],s=r.length;if(s===3)return this.r=parseInt(r.charAt(0)+r.charAt(0),16)/255,this.g=parseInt(r.charAt(1)+r.charAt(1),16)/255,this.b=parseInt(r.charAt(2)+r.charAt(2),16)/255,this;if(s===6)return this.r=parseInt(r.charAt(0)+r.charAt(1),16)/255,this.g=parseInt(r.charAt(2)+r.charAt(3),16)/255,this.b=parseInt(r.charAt(4)+r.charAt(5),16)/255,this}return t&&t.length>0?this.setColorName(t):this}setColorName(t){const e=fd[t.toLowerCase()];return e!==void 0?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copyGammaToLinear(t,e=2){return this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this}copyLinearToGamma(t,e=2){const n=e>0?1/e:1;return this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.r=ql(t.r),this.g=ql(t.g),this.b=ql(t.b),this}copyLinearToSRGB(t){return this.r=$l(t.r),this.g=$l(t.g),this.b=$l(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(t){const e=this.r,n=this.g,r=this.b,s=Math.max(e,n,r),o=Math.min(e,n,r);let a,l;const h=(o+s)/2;if(o===s)a=0,l=0;else{const c=s-o;switch(l=h<=.5?c/(s+o):c/(2-s-o),s){case e:a=(n-r)/c+(n<r?6:0);break;case n:a=(r-e)/c+2;break;case r:a=(e-n)/c+4}a/=6}return t.h=a,t.s=l,t.l=h,t}getStyle(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"}offsetHSL(t,e,n){return this.getHSL(di),di.h+=t,di.s+=e,di.l+=n,this.setHSL(di.h,di.s,di.l),this}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}lerpHSL(t,e){this.getHSL(di),t.getHSL(ta);const n=E(di.h,ta.h,e),r=E(di.s,ta.s,e),s=E(di.l,ta.l,e);return this.setHSL(n,r,s),this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),t.normalized===!0&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}}_e.NAMES=fd,_e.prototype.isColor=!0,_e.prototype.r=1,_e.prototype.g=1,_e.prototype.b=1;class Zl extends Rn{constructor(t){super(),this.type="MeshBasicMaterial",this.color=new _e(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=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.morphTargets=t.morphTargets,this}}Zl.prototype.isMeshBasicMaterial=!0;const Xe=new w,ea=new F;class an{constructor(t,e,n){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=n===!0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[t+r]=e.array[n+r];return this}copyArray(t){return this.array.set(t),this}copyColorsArray(t){const e=this.array;let n=0;for(let r=0,s=t.length;r<s;r++){let o=t[r];o===void 0&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),o=new _e),e[n++]=o.r,e[n++]=o.g,e[n++]=o.b}return this}copyVector2sArray(t){const e=this.array;let n=0;for(let r=0,s=t.length;r<s;r++){let o=t[r];o===void 0&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),o=new F),e[n++]=o.x,e[n++]=o.y}return this}copyVector3sArray(t){const e=this.array;let n=0;for(let r=0,s=t.length;r<s;r++){let o=t[r];o===void 0&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),o=new w),e[n++]=o.x,e[n++]=o.y,e[n++]=o.z}return this}copyVector4sArray(t){const e=this.array;let n=0;for(let r=0,s=t.length;r<s;r++){let o=t[r];o===void 0&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),o=new at),e[n++]=o.x,e[n++]=o.y,e[n++]=o.z,e[n++]=o.w}return this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,n=this.count;e<n;e++)ea.fromBufferAttribute(this,e),ea.applyMatrix3(t),this.setXY(e,ea.x,ea.y);else if(this.itemSize===3)for(let e=0,n=this.count;e<n;e++)Xe.fromBufferAttribute(this,e),Xe.applyMatrix3(t),this.setXYZ(e,Xe.x,Xe.y,Xe.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)Xe.x=this.getX(e),Xe.y=this.getY(e),Xe.z=this.getZ(e),Xe.applyMatrix4(t),this.setXYZ(e,Xe.x,Xe.y,Xe.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)Xe.x=this.getX(e),Xe.y=this.getY(e),Xe.z=this.getZ(e),Xe.applyNormalMatrix(t),this.setXYZ(e,Xe.x,Xe.y,Xe.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)Xe.x=this.getX(e),Xe.y=this.getY(e),Xe.z=this.getZ(e),Xe.transformDirection(t),this.setXYZ(e,Xe.x,Xe.y,Xe.z);return this}set(t,e=0){return this.array.set(t,e),this}getX(t){return this.array[t*this.itemSize]}setX(t,e){return this.array[t*this.itemSize]=e,this}getY(t){return this.array[t*this.itemSize+1]}setY(t,e){return this.array[t*this.itemSize+1]=e,this}getZ(t){return this.array[t*this.itemSize+2]}setZ(t,e){return this.array[t*this.itemSize+2]=e,this}getW(t){return this.array[t*this.itemSize+3]}setW(t,e){return this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this}setXYZW(t,e,n,r,s){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this.array[t+3]=s,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized};return this.name!==""&&(t.name=this.name),this.usage!==35044&&(t.usage=this.usage),this.updateRange.offset===0&&this.updateRange.count===-1||(t.updateRange=this.updateRange),t}}an.prototype.isBufferAttribute=!0;class md extends an{constructor(t,e,n){super(new Uint16Array(t),e,n)}}class ty extends an{constructor(t,e,n){super(new Int32Array(t),e,n)}}class gd extends an{constructor(t,e,n){super(new Uint32Array(t),e,n)}}(class extends an{constructor(i,t,e){super(new Uint16Array(i),t,e)}}).prototype.isFloat16BufferAttribute=!0;class Fe extends an{constructor(t,e,n){super(new Float32Array(t),e,n)}}function vd(i){if(i.length===0)return-1/0;let t=i[0];for(let e=1,n=i.length;e<n;++e)i[e]>t&&(t=i[e]);return t}let ey=0;const ri=new W,Jl=new ke,Yr=new w,Jn=new dt,ks=new dt,xn=new w;class He extends N{constructor(){super(),Object.defineProperty(this,"id",{value:ey++}),this.uuid=K(),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={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(vd(t)>65535?gd:md)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return this.attributes[t]!==void 0}addGroup(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){const e=this.attributes.position;e!==void 0&&(e.applyMatrix4(t),e.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const s=new P().getNormalMatrix(t);n.applyNormalMatrix(s),n.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(t),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return ri.makeRotationFromQuaternion(t),this.applyMatrix4(ri),this}rotateX(t){return ri.makeRotationX(t),this.applyMatrix4(ri),this}rotateY(t){return ri.makeRotationY(t),this.applyMatrix4(ri),this}rotateZ(t){return ri.makeRotationZ(t),this.applyMatrix4(ri),this}translate(t,e,n){return ri.makeTranslation(t,e,n),this.applyMatrix4(ri),this}scale(t,e,n){return ri.makeScale(t,e,n),this.applyMatrix4(ri),this}lookAt(t){return Jl.lookAt(t),Jl.updateMatrix(),this.applyMatrix4(Jl.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Yr).negate(),this.translate(Yr.x,Yr.y,Yr.z),this}setFromPoints(t){const e=[];for(let n=0,r=t.length;n<r;n++){const s=t[n];e.push(s.x,s.y,s.z||0)}return this.setAttribute("position",new Fe(e,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new dt);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.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 w(-1/0,-1/0,-1/0),new w(1/0,1/0,1/0));if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let n=0,r=e.length;n<r;n++){const s=e[n];Jn.setFromBufferAttribute(s),this.morphTargetsRelative?(xn.addVectors(this.boundingBox.min,Jn.min),this.boundingBox.expandByPoint(xn),xn.addVectors(this.boundingBox.max,Jn.max),this.boundingBox.expandByPoint(xn)):(this.boundingBox.expandByPoint(Jn.min),this.boundingBox.expandByPoint(Jn.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(){this.boundingSphere===null&&(this.boundingSphere=new je);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.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 w,1/0);if(t){const n=this.boundingSphere.center;if(Jn.setFromBufferAttribute(t),e)for(let s=0,o=e.length;s<o;s++){const a=e[s];ks.setFromBufferAttribute(a),this.morphTargetsRelative?(xn.addVectors(Jn.min,ks.min),Jn.expandByPoint(xn),xn.addVectors(Jn.max,ks.max),Jn.expandByPoint(xn)):(Jn.expandByPoint(ks.min),Jn.expandByPoint(ks.max))}Jn.getCenter(n);let r=0;for(let s=0,o=t.count;s<o;s++)xn.fromBufferAttribute(t,s),r=Math.max(r,n.distanceToSquared(xn));if(e)for(let s=0,o=e.length;s<o;s++){const a=e[s],l=this.morphTargetsRelative;for(let h=0,c=a.count;h<c;h++)xn.fromBufferAttribute(a,h),l&&(Yr.fromBufferAttribute(t,h),xn.add(Yr)),r=Math.max(r,n.distanceToSquared(xn))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeFaceNormals(){}computeTangents(){const t=this.index,e=this.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=t.array,r=e.position.array,s=e.normal.array,o=e.uv.array,a=r.length/3;e.tangent===void 0&&this.setAttribute("tangent",new an(new Float32Array(4*a),4));const l=e.tangent.array,h=[],c=[];for(let it=0;it<a;it++)h[it]=new w,c[it]=new w;const u=new w,p=new w,f=new w,g=new F,_=new F,v=new F,M=new w,A=new w;function O(it,Q,st){u.fromArray(r,3*it),p.fromArray(r,3*Q),f.fromArray(r,3*st),g.fromArray(o,2*it),_.fromArray(o,2*Q),v.fromArray(o,2*st),p.sub(u),f.sub(u),_.sub(g),v.sub(g);const nt=1/(_.x*v.y-v.x*_.y);isFinite(nt)&&(M.copy(p).multiplyScalar(v.y).addScaledVector(f,-_.y).multiplyScalar(nt),A.copy(f).multiplyScalar(_.x).addScaledVector(p,-v.x).multiplyScalar(nt),h[it].add(M),h[Q].add(M),h[st].add(M),c[it].add(A),c[Q].add(A),c[st].add(A))}let H=this.groups;H.length===0&&(H=[{start:0,count:n.length}]);for(let it=0,Q=H.length;it<Q;++it){const st=H[it],nt=st.start;for(let ct=nt,Lt=nt+st.count;ct<Lt;ct+=3)O(n[ct+0],n[ct+1],n[ct+2])}const j=new w,X=new w,U=new w,V=new w;function xt(it){U.fromArray(s,3*it),V.copy(U);const Q=h[it];j.copy(Q),j.sub(U.multiplyScalar(U.dot(Q))).normalize(),X.crossVectors(V,Q);const st=X.dot(c[it])<0?-1:1;l[4*it]=j.x,l[4*it+1]=j.y,l[4*it+2]=j.z,l[4*it+3]=st}for(let it=0,Q=H.length;it<Q;++it){const st=H[it],nt=st.start;for(let ct=nt,Lt=nt+st.count;ct<Lt;ct+=3)xt(n[ct+0]),xt(n[ct+1]),xt(n[ct+2])}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(e!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new an(new Float32Array(3*e.count),3),this.setAttribute("normal",n);else for(let p=0,f=n.count;p<f;p++)n.setXYZ(p,0,0,0);const r=new w,s=new w,o=new w,a=new w,l=new w,h=new w,c=new w,u=new w;if(t)for(let p=0,f=t.count;p<f;p+=3){const g=t.getX(p+0),_=t.getX(p+1),v=t.getX(p+2);r.fromBufferAttribute(e,g),s.fromBufferAttribute(e,_),o.fromBufferAttribute(e,v),c.subVectors(o,s),u.subVectors(r,s),c.cross(u),a.fromBufferAttribute(n,g),l.fromBufferAttribute(n,_),h.fromBufferAttribute(n,v),a.add(c),l.add(c),h.add(c),n.setXYZ(g,a.x,a.y,a.z),n.setXYZ(_,l.x,l.y,l.z),n.setXYZ(v,h.x,h.y,h.z)}else for(let p=0,f=e.count;p<f;p+=3)r.fromBufferAttribute(e,p+0),s.fromBufferAttribute(e,p+1),o.fromBufferAttribute(e,p+2),c.subVectors(o,s),u.subVectors(r,s),c.cross(u),n.setXYZ(p+0,c.x,c.y,c.z),n.setXYZ(p+1,c.x,c.y,c.z),n.setXYZ(p+2,c.x,c.y,c.z);this.normalizeNormals(),n.needsUpdate=!0}}merge(t,e){if(!t||!t.isBufferGeometry)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t);e===void 0&&(e=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));const n=this.attributes;for(const r in n){if(t.attributes[r]===void 0)continue;const s=n[r].array,o=t.attributes[r],a=o.array,l=o.itemSize*e,h=Math.min(a.length,s.length-l);for(let c=0,u=l;c<h;c++,u++)s[u]=a[c]}return this}normalizeNormals(){const t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)xn.fromBufferAttribute(t,e),xn.normalize(),t.setXYZ(e,xn.x,xn.y,xn.z)}toNonIndexed(){function t(a,l){const h=a.array,c=a.itemSize,u=a.normalized,p=new h.constructor(l.length*c);let f=0,g=0;for(let _=0,v=l.length;_<v;_++){f=a.isInterleavedBufferAttribute?l[_]*a.data.stride+a.offset:l[_]*c;for(let M=0;M<c;M++)p[g++]=h[f++]}return new an(p,c,u)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new He,n=this.index.array,r=this.attributes;for(const a in r){const l=t(r[a],n);e.setAttribute(a,l)}const s=this.morphAttributes;for(const a in s){const l=[],h=s[a];for(let c=0,u=h.length;c<u;c++){const p=t(h[c],n);l.push(p)}e.morphAttributes[a]=l}e.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let a=0,l=o.length;a<l;a++){const h=o[a];e.addGroup(h.start,h.count,h.materialIndex)}return e}toJSON(){const t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const h in l)l[h]!==void 0&&(t[h]=l[h]);return t}t.data={attributes:{}};const e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const l in n){const h=n[l];t.data.attributes[l]=h.toJSON(t.data)}const r={};let s=!1;for(const l in this.morphAttributes){const h=this.morphAttributes[l],c=[];for(let u=0,p=h.length;u<p;u++){const f=h[u];c.push(f.toJSON(t.data))}c.length>0&&(r[l]=c,s=!0)}s&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(t.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t}clone(){return new He().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;n!==null&&this.setIndex(n.clone(e));const r=t.attributes;for(const h in r){const c=r[h];this.setAttribute(h,c.clone(e))}const s=t.morphAttributes;for(const h in s){const c=[],u=s[h];for(let p=0,f=u.length;p<f;p++)c.push(u[p].clone(e));this.morphAttributes[h]=c}this.morphTargetsRelative=t.morphTargetsRelative;const o=t.groups;for(let h=0,c=o.length;h<c;h++){const u=o[h];this.addGroup(u.start,u.count,u.materialIndex)}const a=t.boundingBox;a!==null&&(this.boundingBox=a.clone());const l=t.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}He.prototype.isBufferGeometry=!0;const _d=new W,qr=new z,Kl=new je,ir=new w,rr=new w,sr=new w,Ql=new w,th=new w,eh=new w,na=new w,ia=new w,ra=new w,sa=new F,oa=new F,aa=new F,nh=new w,la=new w;class kn extends ke{constructor(t=new He,e=new Zl){super(),this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t){return super.copy(t),t.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),t.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=t.material,this.geometry=t.geometry,this}updateMorphTargets(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,n=Object.keys(e);if(n.length>0){const r=e[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const a=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}else{const e=t.morphTargets;e!==void 0&&e.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(t,e){const n=this.geometry,r=this.material,s=this.matrixWorld;if(r===void 0||(n.boundingSphere===null&&n.computeBoundingSphere(),Kl.copy(n.boundingSphere),Kl.applyMatrix4(s),t.ray.intersectsSphere(Kl)===!1)||(_d.copy(s).invert(),qr.copy(t.ray).applyMatrix4(_d),n.boundingBox!==null&&qr.intersectsBox(n.boundingBox)===!1))return;let o;if(n.isBufferGeometry){const a=n.index,l=n.attributes.position,h=n.morphAttributes.position,c=n.morphTargetsRelative,u=n.attributes.uv,p=n.attributes.uv2,f=n.groups,g=n.drawRange;if(a!==null)if(Array.isArray(r))for(let _=0,v=f.length;_<v;_++){const M=f[_],A=r[M.materialIndex];for(let O=Math.max(M.start,g.start),H=Math.min(M.start+M.count,g.start+g.count);O<H;O+=3){const j=a.getX(O),X=a.getX(O+1),U=a.getX(O+2);o=ha(this,A,t,qr,l,h,c,u,p,j,X,U),o&&(o.faceIndex=Math.floor(O/3),o.face.materialIndex=M.materialIndex,e.push(o))}}else for(let _=Math.max(0,g.start),v=Math.min(a.count,g.start+g.count);_<v;_+=3){const M=a.getX(_),A=a.getX(_+1),O=a.getX(_+2);o=ha(this,r,t,qr,l,h,c,u,p,M,A,O),o&&(o.faceIndex=Math.floor(_/3),e.push(o))}else if(l!==void 0)if(Array.isArray(r))for(let _=0,v=f.length;_<v;_++){const M=f[_],A=r[M.materialIndex];for(let O=Math.max(M.start,g.start),H=Math.min(M.start+M.count,g.start+g.count);O<H;O+=3)o=ha(this,A,t,qr,l,h,c,u,p,O,O+1,O+2),o&&(o.faceIndex=Math.floor(O/3),o.face.materialIndex=M.materialIndex,e.push(o))}else for(let _=Math.max(0,g.start),v=Math.min(l.count,g.start+g.count);_<v;_+=3)o=ha(this,r,t,qr,l,h,c,u,p,_,_+1,_+2),o&&(o.faceIndex=Math.floor(_/3),e.push(o))}else n.isGeometry&&console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}function ha(i,t,e,n,r,s,o,a,l,h,c,u){ir.fromBufferAttribute(r,h),rr.fromBufferAttribute(r,c),sr.fromBufferAttribute(r,u);const p=i.morphTargetInfluences;if(t.morphTargets&&s&&p){na.set(0,0,0),ia.set(0,0,0),ra.set(0,0,0);for(let g=0,_=s.length;g<_;g++){const v=p[g],M=s[g];v!==0&&(Ql.fromBufferAttribute(M,h),th.fromBufferAttribute(M,c),eh.fromBufferAttribute(M,u),o?(na.addScaledVector(Ql,v),ia.addScaledVector(th,v),ra.addScaledVector(eh,v)):(na.addScaledVector(Ql.sub(ir),v),ia.addScaledVector(th.sub(rr),v),ra.addScaledVector(eh.sub(sr),v)))}ir.add(na),rr.add(ia),sr.add(ra)}i.isSkinnedMesh&&(i.boneTransform(h,ir),i.boneTransform(c,rr),i.boneTransform(u,sr));const f=function(g,_,v,M,A,O,H,j){let X;if(X=_.side===1?M.intersectTriangle(H,O,A,!0,j):M.intersectTriangle(A,O,H,_.side!==2,j),X===null)return null;la.copy(j),la.applyMatrix4(g.matrixWorld);const U=v.ray.origin.distanceTo(la);return U<v.near||U>v.far?null:{distance:U,point:la.clone(),object:g}}(i,t,e,n,ir,rr,sr,nh);if(f){a&&(sa.fromBufferAttribute(a,h),oa.fromBufferAttribute(a,c),aa.fromBufferAttribute(a,u),f.uv=pn.getUV(nh,ir,rr,sr,sa,oa,aa,new F)),l&&(sa.fromBufferAttribute(l,h),oa.fromBufferAttribute(l,c),aa.fromBufferAttribute(l,u),f.uv2=pn.getUV(nh,ir,rr,sr,sa,oa,aa,new F));const g={a:h,b:c,c:u,normal:new w,materialIndex:0};pn.getNormal(ir,rr,sr,g.normal),f.face=g}return f}kn.prototype.isMesh=!0;class Us extends He{constructor(t=1,e=1,n=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:r,heightSegments:s,depthSegments:o};const a=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const l=[],h=[],c=[],u=[];let p=0,f=0;function g(_,v,M,A,O,H,j,X,U,V,xt){const it=H/U,Q=j/V,st=H/2,nt=j/2,ct=X/2,Lt=U+1,At=V+1;let ht=0,gt=0;const Ut=new w;for(let Vt=0;Vt<At;Vt++){const Zt=Vt*Q-nt;for(let J=0;J<Lt;J++){const et=J*it-st;Ut[_]=et*A,Ut[v]=Zt*O,Ut[M]=ct,h.push(Ut.x,Ut.y,Ut.z),Ut[_]=0,Ut[v]=0,Ut[M]=X>0?1:-1,c.push(Ut.x,Ut.y,Ut.z),u.push(J/U),u.push(1-Vt/V),ht+=1}}for(let Vt=0;Vt<V;Vt++)for(let Zt=0;Zt<U;Zt++){const J=p+Zt+Lt*Vt,et=p+Zt+Lt*(Vt+1),Ft=p+(Zt+1)+Lt*(Vt+1),Pt=p+(Zt+1)+Lt*Vt;l.push(J,et,Pt),l.push(et,Ft,Pt),gt+=6}a.addGroup(f,gt,xt),f+=gt,p+=ht}g("z","y","x",-1,-1,n,e,t,o,s,0),g("z","y","x",1,-1,n,e,-t,o,s,1),g("x","z","y",1,1,t,n,e,r,o,2),g("x","z","y",1,-1,t,n,-e,r,o,3),g("x","y","z",1,-1,t,e,n,r,s,4),g("x","y","z",-1,-1,t,e,-n,r,s,5),this.setIndex(l),this.setAttribute("position",new Fe(h,3)),this.setAttribute("normal",new Fe(c,3)),this.setAttribute("uv",new Fe(u,2))}static fromJSON(t){return new Us(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function $r(i){const t={};for(const e in i){t[e]={};for(const n in i[e]){const r=i[e][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?t[e][n]=r.clone():Array.isArray(r)?t[e][n]=r.slice():t[e][n]=r}}return t}function Ln(i){const t={};for(let e=0;e<i.length;e++){const n=$r(i[e]);for(const r in n)t[r]=n[r]}return t}const ny={clone:$r,merge:Ln};class pi extends Rn{constructor(t){super(),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=`void main() {
|
|
2026
|
+
*/class N{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[t]===void 0&&(n[t]=[]),n[t].indexOf(e)===-1&&n[t].push(e)}hasEventListener(t,e){if(this._listeners===void 0)return!1;const n=this._listeners;return n[t]!==void 0&&n[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;const n=this._listeners[t];if(n!==void 0){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}}dispatchEvent(t){if(this._listeners===void 0)return;const e=this._listeners[t.type];if(e!==void 0){t.target=this;const n=e.slice(0);for(let r=0,s=n.length;r<s;r++)n[r].call(this,t);t.target=null}}}const I=[];for(let i=0;i<256;i++)I[i]=(i<16?"0":"")+i.toString(16);const L=Math.PI/180,k=180/Math.PI;function K(){const i=4294967295*Math.random()|0,t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(I[255&i]+I[i>>8&255]+I[i>>16&255]+I[i>>24&255]+"-"+I[255&t]+I[t>>8&255]+"-"+I[t>>16&15|64]+I[t>>24&255]+"-"+I[63&e|128]+I[e>>8&255]+"-"+I[e>>16&255]+I[e>>24&255]+I[255&n]+I[n>>8&255]+I[n>>16&255]+I[n>>24&255]).toUpperCase()}function ut(i,t,e){return Math.max(t,Math.min(e,i))}function _t(i,t){return(i%t+t)%t}function E(i,t,e){return(1-e)*i+e*t}function R(i){return(i&i-1)==0&&i!==0}function D(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}class F{constructor(t=0,e=0){this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t,e){return e!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t,e){return e!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6],this.y=r[1]*e+r[4]*n+r[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e,n){return n!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),r=Math.sin(e),s=this.x-t.x,o=this.y-t.y;return this.x=s*n-o*r+t.x,this.y=s*r+o*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}}F.prototype.isVector2=!0;class P{constructor(){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.")}set(t,e,n,r,s,o,a,l,h){const c=this.elements;return c[0]=t,c[1]=r,c[2]=a,c[3]=e,c[4]=s,c[5]=l,c[6]=n,c[7]=o,c[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,r=e.elements,s=this.elements,o=n[0],a=n[3],l=n[6],h=n[1],c=n[4],u=n[7],p=n[2],f=n[5],g=n[8],_=r[0],v=r[3],M=r[6],A=r[1],O=r[4],H=r[7],j=r[2],X=r[5],U=r[8];return s[0]=o*_+a*A+l*j,s[3]=o*v+a*O+l*X,s[6]=o*M+a*H+l*U,s[1]=h*_+c*A+u*j,s[4]=h*v+c*O+u*X,s[7]=h*M+c*H+u*U,s[2]=p*_+f*A+g*j,s[5]=p*v+f*O+g*X,s[8]=p*M+f*H+g*U,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=t[6],h=t[7],c=t[8];return e*o*c-e*a*h-n*s*c+n*a*l+r*s*h-r*o*l}invert(){const t=this.elements,e=t[0],n=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=t[6],h=t[7],c=t[8],u=c*o-a*h,p=a*l-c*s,f=h*s-o*l,g=e*u+n*p+r*f;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/g;return t[0]=u*_,t[1]=(r*h-c*n)*_,t[2]=(a*n-r*o)*_,t[3]=p*_,t[4]=(c*e-r*l)*_,t[5]=(r*s-a*e)*_,t[6]=f*_,t[7]=(n*l-h*e)*_,t[8]=(o*e-n*s)*_,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,r,s,o,a){const l=Math.cos(s),h=Math.sin(s);return this.set(n*l,n*h,-n*(l*o+h*a)+o+t,-r*h,r*l,-r*(-h*o+l*a)+a+e,0,0,1),this}scale(t,e){const n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=e,n[4]*=e,n[7]*=e,this}rotate(t){const e=Math.cos(t),n=Math.sin(t),r=this.elements,s=r[0],o=r[3],a=r[6],l=r[1],h=r[4],c=r[7];return r[0]=e*s+n*l,r[3]=e*o+n*h,r[6]=e*a+n*c,r[1]=-n*s+e*l,r[4]=-n*o+e*h,r[7]=-n*a+e*c,this}translate(t,e){const n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=e*n[2],n[4]+=e*n[5],n[7]+=e*n[8],this}equals(t){const e=this.elements,n=t.elements;for(let r=0;r<9;r++)if(e[r]!==n[r])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return new this.constructor().fromArray(this.elements)}}let B;P.prototype.isMatrix3=!0;class G{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement=="undefined")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{B===void 0&&(B=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),B.width=t.width,B.height=t.height;const n=B.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=B}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}}let q=0;class Rt extends N{constructor(t=Rt.DEFAULT_IMAGE,e=Rt.DEFAULT_MAPPING,n=1001,r=1001,s=1006,o=1008,a=1023,l=1009,h=1,c=3e3){super(),Object.defineProperty(this,"id",{value:q++}),this.uuid=K(),this.name="",this.image=t,this.mipmaps=[],this.mapping=e,this.wrapS=n,this.wrapT=r,this.magFilter=s,this.minFilter=o,this.anisotropy=h,this.format=a,this.internalFormat=null,this.type=l,this.offset=new F(0,0),this.repeat=new F(1,1),this.center=new F(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new P,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=c,this.version=0,this.onUpdate=null}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this}toJSON(t){const e=t===void 0||typeof t=="string";if(!e&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];const 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(this.image!==void 0){const r=this.image;if(r.uuid===void 0&&(r.uuid=K()),!e&&t.images[r.uuid]===void 0){let s;if(Array.isArray(r)){s=[];for(let o=0,a=r.length;o<a;o++)r[o].isDataTexture?s.push(Xt(r[o].image)):s.push(Xt(r[o]))}else s=Xt(r);t.images[r.uuid]={uuid:r.uuid,url:s}}n.image=r.uuid}return e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==300)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case 1e3:t.x=t.x-Math.floor(t.x);break;case 1001:t.x=t.x<0?0:1;break;case 1002:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case 1e3:t.y=t.y-Math.floor(t.y);break;case 1001:t.y=t.y<0?0:1;break;case 1002:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&this.version++}}function Xt(i){return typeof HTMLImageElement!="undefined"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&i instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&i instanceof ImageBitmap?G.getDataURL(i):i.data?{data:Array.prototype.slice.call(i.data),width:i.width,height:i.height,type:i.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}Rt.DEFAULT_IMAGE=void 0,Rt.DEFAULT_MAPPING=300,Rt.prototype.isTexture=!0;class at{constructor(t=0,e=0,n=0,r=1){this.x=t,this.y=e,this.z=n,this.w=r}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,r){return this.x=t,this.y=e,this.z=n,this.w=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t,e){return e!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t,e){return e!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,r=this.z,s=this.w,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*r+o[12]*s,this.y=o[1]*e+o[5]*n+o[9]*r+o[13]*s,this.z=o[2]*e+o[6]*n+o[10]*r+o[14]*s,this.w=o[3]*e+o[7]*n+o[11]*r+o[15]*s,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,r,s;const o=t.elements,a=o[0],l=o[4],h=o[8],c=o[1],u=o[5],p=o[9],f=o[2],g=o[6],_=o[10];if(Math.abs(l-c)<.01&&Math.abs(h-f)<.01&&Math.abs(p-g)<.01){if(Math.abs(l+c)<.1&&Math.abs(h+f)<.1&&Math.abs(p+g)<.1&&Math.abs(a+u+_-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const M=(a+1)/2,A=(u+1)/2,O=(_+1)/2,H=(l+c)/4,j=(h+f)/4,X=(p+g)/4;return M>A&&M>O?M<.01?(n=0,r=.707106781,s=.707106781):(n=Math.sqrt(M),r=H/n,s=j/n):A>O?A<.01?(n=.707106781,r=0,s=.707106781):(r=Math.sqrt(A),n=H/r,s=X/r):O<.01?(n=.707106781,r=.707106781,s=0):(s=Math.sqrt(O),n=j/s,r=X/s),this.set(n,r,s,e),this}let v=Math.sqrt((g-p)*(g-p)+(h-f)*(h-f)+(c-l)*(c-l));return Math.abs(v)<.001&&(v=1),this.x=(g-p)/v,this.y=(h-f)/v,this.z=(c-l)/v,this.w=Math.acos((a+u+_-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e,n){return n!==void 0&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}at.prototype.isVector4=!0;class $ extends N{constructor(t,e,n={}){super(),this.width=t,this.height=e,this.depth=1,this.scissor=new at(0,0,t,e),this.scissorTest=!1,this.viewport=new at(0,0,t,e),this.texture=new Rt(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={width:t,height:e,depth:1},this.texture.generateMipmaps=n.generateMipmaps!==void 0&&n.generateMipmaps,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:1006,this.depthBuffer=n.depthBuffer===void 0||n.depthBuffer,this.stencilBuffer=n.stencilBuffer!==void 0&&n.stencilBuffer,this.depthTexture=n.depthTexture!==void 0?n.depthTexture:null}setTexture(t){t.image={width:this.width,height:this.height,depth:this.depth},this.texture=t}setSize(t,e,n=1){this.width===t&&this.height===e&&this.depth===n||(this.width=t,this.height=e,this.depth=n,this.texture.image.width=t,this.texture.image.height=e,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){return this.width=t.width,this.height=t.height,this.depth=t.depth,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.texture.image=Vu({},this.texture.image),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}$.prototype.isWebGLRenderTarget=!0,class extends ${constructor(i,t,e){super(i,t);const n=this.texture;this.texture=[];for(let r=0;r<e;r++)this.texture[r]=n.clone()}setSize(i,t,e=1){if(this.width!==i||this.height!==t||this.depth!==e){this.width=i,this.height=t,this.depth=e;for(let n=0,r=this.texture.length;n<r;n++)this.texture[n].image.width=i,this.texture[n].image.height=t,this.texture[n].image.depth=e;this.dispose()}return this.viewport.set(0,0,i,t),this.scissor.set(0,0,i,t),this}copy(i){this.dispose(),this.width=i.width,this.height=i.height,this.depth=i.depth,this.viewport.set(0,0,this.width,this.height),this.scissor.set(0,0,this.width,this.height),this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.depthTexture=i.depthTexture,this.texture.length=0;for(let t=0,e=i.texture.length;t<e;t++)this.texture[t]=i.texture[t].clone();return this}}.prototype.isWebGLMultipleRenderTargets=!0;class tt extends ${constructor(t,e,n){super(t,e,n),this.samples=4}copy(t){return super.copy.call(this,t),this.samples=t.samples,this}}tt.prototype.isWebGLMultisampleRenderTarget=!0;class lt{constructor(t=0,e=0,n=0,r=1){this._x=t,this._y=e,this._z=n,this._w=r}static slerp(t,e,n,r){return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."),n.slerpQuaternions(t,e,r)}static slerpFlat(t,e,n,r,s,o,a){let l=n[r+0],h=n[r+1],c=n[r+2],u=n[r+3];const p=s[o+0],f=s[o+1],g=s[o+2],_=s[o+3];if(a===0)return t[e+0]=l,t[e+1]=h,t[e+2]=c,void(t[e+3]=u);if(a===1)return t[e+0]=p,t[e+1]=f,t[e+2]=g,void(t[e+3]=_);if(u!==_||l!==p||h!==f||c!==g){let v=1-a;const M=l*p+h*f+c*g+u*_,A=M>=0?1:-1,O=1-M*M;if(O>Number.EPSILON){const j=Math.sqrt(O),X=Math.atan2(j,M*A);v=Math.sin(v*X)/j,a=Math.sin(a*X)/j}const H=a*A;if(l=l*v+p*H,h=h*v+f*H,c=c*v+g*H,u=u*v+_*H,v===1-a){const j=1/Math.sqrt(l*l+h*h+c*c+u*u);l*=j,h*=j,c*=j,u*=j}}t[e]=l,t[e+1]=h,t[e+2]=c,t[e+3]=u}static multiplyQuaternionsFlat(t,e,n,r,s,o){const a=n[r],l=n[r+1],h=n[r+2],c=n[r+3],u=s[o],p=s[o+1],f=s[o+2],g=s[o+3];return t[e]=a*g+c*u+l*f-h*p,t[e+1]=l*g+c*p+h*u-a*f,t[e+2]=h*g+c*f+a*p-l*u,t[e+3]=c*g-a*u-l*p-h*f,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const n=t._x,r=t._y,s=t._z,o=t._order,a=Math.cos,l=Math.sin,h=a(n/2),c=a(r/2),u=a(s/2),p=l(n/2),f=l(r/2),g=l(s/2);switch(o){case"XYZ":this._x=p*c*u+h*f*g,this._y=h*f*u-p*c*g,this._z=h*c*g+p*f*u,this._w=h*c*u-p*f*g;break;case"YXZ":this._x=p*c*u+h*f*g,this._y=h*f*u-p*c*g,this._z=h*c*g-p*f*u,this._w=h*c*u+p*f*g;break;case"ZXY":this._x=p*c*u-h*f*g,this._y=h*f*u+p*c*g,this._z=h*c*g+p*f*u,this._w=h*c*u-p*f*g;break;case"ZYX":this._x=p*c*u-h*f*g,this._y=h*f*u+p*c*g,this._z=h*c*g-p*f*u,this._w=h*c*u+p*f*g;break;case"YZX":this._x=p*c*u+h*f*g,this._y=h*f*u+p*c*g,this._z=h*c*g-p*f*u,this._w=h*c*u-p*f*g;break;case"XZY":this._x=p*c*u-h*f*g,this._y=h*f*u-p*c*g,this._z=h*c*g+p*f*u,this._w=h*c*u+p*f*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return e!==!1&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,r=Math.sin(n);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],r=e[4],s=e[8],o=e[1],a=e[5],l=e[9],h=e[2],c=e[6],u=e[10],p=n+a+u;if(p>0){const f=.5/Math.sqrt(p+1);this._w=.25/f,this._x=(c-l)*f,this._y=(s-h)*f,this._z=(o-r)*f}else if(n>a&&n>u){const f=2*Math.sqrt(1+n-a-u);this._w=(c-l)/f,this._x=.25*f,this._y=(r+o)/f,this._z=(s+h)/f}else if(a>u){const f=2*Math.sqrt(1+a-n-u);this._w=(s-h)/f,this._x=(r+o)/f,this._y=.25*f,this._z=(l+c)/f}else{const f=2*Math.sqrt(1+u-n-a);this._w=(o-r)/f,this._x=(s+h)/f,this._y=(l+c)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(ut(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(n===0)return this;const r=Math.min(1,e/n);return this.slerp(t,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t,e){return e!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,r=t._y,s=t._z,o=t._w,a=e._x,l=e._y,h=e._z,c=e._w;return this._x=n*c+o*a+r*h-s*l,this._y=r*c+o*l+s*a-n*h,this._z=s*c+o*h+n*l-r*a,this._w=o*c-n*a-r*l-s*h,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const n=this._x,r=this._y,s=this._z,o=this._w;let a=o*t._w+n*t._x+r*t._y+s*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=n,this._y=r,this._z=s,this;const l=1-a*a;if(l<=Number.EPSILON){const f=1-e;return this._w=f*o+e*this._w,this._x=f*n+e*this._x,this._y=f*r+e*this._y,this._z=f*s+e*this._z,this.normalize(),this._onChangeCallback(),this}const h=Math.sqrt(l),c=Math.atan2(h,a),u=Math.sin((1-e)*c)/h,p=Math.sin(e*c)/h;return this._w=o*u+this._w*p,this._x=n*u+this._x*p,this._y=r*u+this._y*p,this._z=s*u+this._z*p,this._onChangeCallback(),this}slerpQuaternions(t,e,n){this.copy(t).slerp(e,n)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}lt.prototype.isQuaternion=!0;class w{constructor(t=0,e=0,n=0){this.x=t,this.y=e,this.z=n}set(t,e,n){return n===void 0&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t,e){return e!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t,e){return e!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t,e){return e!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(bt.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(bt.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,r=this.z,s=t.elements;return this.x=s[0]*e+s[3]*n+s[6]*r,this.y=s[1]*e+s[4]*n+s[7]*r,this.z=s[2]*e+s[5]*n+s[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,r=this.z,s=t.elements,o=1/(s[3]*e+s[7]*n+s[11]*r+s[15]);return this.x=(s[0]*e+s[4]*n+s[8]*r+s[12])*o,this.y=(s[1]*e+s[5]*n+s[9]*r+s[13])*o,this.z=(s[2]*e+s[6]*n+s[10]*r+s[14])*o,this}applyQuaternion(t){const e=this.x,n=this.y,r=this.z,s=t.x,o=t.y,a=t.z,l=t.w,h=l*e+o*r-a*n,c=l*n+a*e-s*r,u=l*r+s*n-o*e,p=-s*e-o*n-a*r;return this.x=h*l+p*-s+c*-a-u*-o,this.y=c*l+p*-o+u*-s-h*-a,this.z=u*l+p*-a+h*-o-c*-s,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,r=this.z,s=t.elements;return this.x=s[0]*e+s[4]*n+s[8]*r,this.y=s[1]*e+s[5]*n+s[9]*r,this.z=s[2]*e+s[6]*n+s[10]*r,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t,e){return e!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,r=t.y,s=t.z,o=e.x,a=e.y,l=e.z;return this.x=r*l-s*a,this.y=s*o-n*l,this.z=n*a-r*o,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return ot.copy(this).projectOnVector(t),this.sub(ot)}reflect(t){return this.sub(ot.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(ut(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return e*e+n*n+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const r=Math.sin(e)*t;return this.x=r*Math.sin(n),this.y=Math.cos(e)*t,this.z=r*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=r,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e,n){return n!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}}w.prototype.isVector3=!0;const ot=new w,bt=new lt;class dt{constructor(t=new w(1/0,1/0,1/0),e=new w(-1/0,-1/0,-1/0)){this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){let e=1/0,n=1/0,r=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,h=t.length;l<h;l+=3){const c=t[l],u=t[l+1],p=t[l+2];c<e&&(e=c),u<n&&(n=u),p<r&&(r=p),c>s&&(s=c),u>o&&(o=u),p>a&&(a=p)}return this.min.set(e,n,r),this.max.set(s,o,a),this}setFromBufferAttribute(t){let e=1/0,n=1/0,r=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,h=t.count;l<h;l++){const c=t.getX(l),u=t.getY(l),p=t.getZ(l);c<e&&(e=c),u<n&&(n=u),p<r&&(r=p),c>s&&(s=c),u>o&&(o=u),p>a&&(a=p)}return this.min.set(e,n,r),this.max.set(s,o,a),this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const n=Ot.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}setFromObject(t){return this.makeEmpty(),this.expandByObject(t)}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t){t.updateWorldMatrix(!1,!1);const e=t.geometry;e!==void 0&&(e.boundingBox===null&&e.computeBoundingBox(),kt.copy(e.boundingBox),kt.applyMatrix4(t.matrixWorld),this.union(kt));const n=t.children;for(let r=0,s=n.length;r<s;r++)this.expandByObject(n[r]);return this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}intersectsSphere(t){return this.clampPoint(t.center,Ot),Ot.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Se),ue.subVectors(this.max,Se),Dt.subVectors(t.a,Se),te.subVectors(t.b,Se),re.subVectors(t.c,Se),$t.subVectors(te,Dt),pe.subVectors(re,te),le.subVectors(Dt,re);let e=[0,-$t.z,$t.y,0,-pe.z,pe.y,0,-le.z,le.y,$t.z,0,-$t.x,pe.z,0,-pe.x,le.z,0,-le.x,-$t.y,$t.x,0,-pe.y,pe.x,0,-le.y,le.x,0];return!!Ge(e,Dt,te,re,ue)&&(e=[1,0,0,0,1,0,0,0,1],!!Ge(e,Dt,te,re,ue)&&(Oe.crossVectors($t,pe),e=[Oe.x,Oe.y,Oe.z],Ge(e,Dt,te,re,ue)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return Ot.copy(t).clamp(this.min,this.max).sub(t).length()}getBoundingSphere(t){return this.getCenter(t.center),t.radius=.5*this.getSize(Ot).length(),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(yt[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),yt[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),yt[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),yt[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),yt[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),yt[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),yt[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),yt[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(yt)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}dt.prototype.isBox3=!0;const yt=[new w,new w,new w,new w,new w,new w,new w,new w],Ot=new w,kt=new dt,Dt=new w,te=new w,re=new w,$t=new w,pe=new w,le=new w,Se=new w,ue=new w,Oe=new w,Me=new w;function Ge(i,t,e,n,r){for(let s=0,o=i.length-3;s<=o;s+=3){Me.fromArray(i,s);const a=r.x*Math.abs(Me.x)+r.y*Math.abs(Me.y)+r.z*Math.abs(Me.z),l=t.dot(Me),h=e.dot(Me),c=n.dot(Me);if(Math.max(-Math.max(l,h,c),Math.min(l,h,c))>a)return!1}return!0}const nn=new dt,fe=new w,ge=new w,En=new w;class je{constructor(t=new w,e=-1){this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;e!==void 0?n.copy(e):nn.setFromPoints(t).getCenter(n);let r=0;for(let s=0,o=t.length;s<o;s++)r=Math.max(r,n.distanceToSquared(t[s]));return this.radius=Math.sqrt(r),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const n=this.center.distanceToSquared(t);return e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){En.subVectors(t,this.center);const e=En.lengthSq();if(e>this.radius*this.radius){const n=Math.sqrt(e),r=.5*(n-this.radius);this.center.add(En.multiplyScalar(r/n)),this.radius+=r}return this}union(t){return ge.subVectors(t.center,this.center).normalize().multiplyScalar(t.radius),this.expandByPoint(fe.copy(t.center).add(ge)),this.expandByPoint(fe.copy(t.center).sub(ge)),this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}}const rn=new w,wn=new w,er=new w,Ti=new w,Ds=new w,nr=new w,Fs=new w;class z{constructor(t=new w,e=new w(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.direction).multiplyScalar(t).add(this.origin)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,rn)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=rn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(rn.copy(this.direction).multiplyScalar(e).add(this.origin),rn.distanceToSquared(t))}distanceSqToSegment(t,e,n,r){wn.copy(t).add(e).multiplyScalar(.5),er.copy(e).sub(t).normalize(),Ti.copy(this.origin).sub(wn);const s=.5*t.distanceTo(e),o=-this.direction.dot(er),a=Ti.dot(this.direction),l=-Ti.dot(er),h=Ti.lengthSq(),c=Math.abs(1-o*o);let u,p,f,g;if(c>0)if(u=o*l-a,p=o*a-l,g=s*c,u>=0)if(p>=-g)if(p<=g){const _=1/c;u*=_,p*=_,f=u*(u+o*p+2*a)+p*(o*u+p+2*l)+h}else p=s,u=Math.max(0,-(o*p+a)),f=-u*u+p*(p+2*l)+h;else p=-s,u=Math.max(0,-(o*p+a)),f=-u*u+p*(p+2*l)+h;else p<=-g?(u=Math.max(0,-(-o*s+a)),p=u>0?-s:Math.min(Math.max(-s,-l),s),f=-u*u+p*(p+2*l)+h):p<=g?(u=0,p=Math.min(Math.max(-s,-l),s),f=p*(p+2*l)+h):(u=Math.max(0,-(o*s+a)),p=u>0?s:Math.min(Math.max(-s,-l),s),f=-u*u+p*(p+2*l)+h);else p=o>0?-s:s,u=Math.max(0,-(o*p+a)),f=-u*u+p*(p+2*l)+h;return n&&n.copy(this.direction).multiplyScalar(u).add(this.origin),r&&r.copy(er).multiplyScalar(p).add(wn),f}intersectSphere(t,e){rn.subVectors(t.center,this.origin);const n=rn.dot(this.direction),r=rn.dot(rn)-n*n,s=t.radius*t.radius;if(r>s)return null;const o=Math.sqrt(s-r),a=n-o,l=n+o;return a<0&&l<0?null:a<0?this.at(l,e):this.at(a,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return n===null?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return e===0?!0:t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,r,s,o,a,l;const h=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,p=this.origin;return h>=0?(n=(t.min.x-p.x)*h,r=(t.max.x-p.x)*h):(n=(t.max.x-p.x)*h,r=(t.min.x-p.x)*h),c>=0?(s=(t.min.y-p.y)*c,o=(t.max.y-p.y)*c):(s=(t.max.y-p.y)*c,o=(t.min.y-p.y)*c),n>o||s>r?null:((s>n||n!=n)&&(n=s),(o<r||r!=r)&&(r=o),u>=0?(a=(t.min.z-p.z)*u,l=(t.max.z-p.z)*u):(a=(t.max.z-p.z)*u,l=(t.min.z-p.z)*u),n>l||a>r?null:((a>n||n!=n)&&(n=a),(l<r||r!=r)&&(r=l),r<0?null:this.at(n>=0?n:r,e)))}intersectsBox(t){return this.intersectBox(t,rn)!==null}intersectTriangle(t,e,n,r,s){Ds.subVectors(e,t),nr.subVectors(n,t),Fs.crossVectors(Ds,nr);let o,a=this.direction.dot(Fs);if(a>0){if(r)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}Ti.subVectors(this.origin,t);const l=o*this.direction.dot(nr.crossVectors(Ti,nr));if(l<0)return null;const h=o*this.direction.dot(Ds.cross(Ti));if(h<0||l+h>a)return null;const c=-o*Ti.dot(Fs);return c<0?null:this.at(c/a,s)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class W{constructor(){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.")}set(t,e,n,r,s,o,a,l,h,c,u,p,f,g,_,v){const M=this.elements;return M[0]=t,M[4]=e,M[8]=n,M[12]=r,M[1]=s,M[5]=o,M[9]=a,M[13]=l,M[2]=h,M[6]=c,M[10]=u,M[14]=p,M[3]=f,M[7]=g,M[11]=_,M[15]=v,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new W().fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,r=1/Z.setFromMatrixColumn(t,0).length(),s=1/Z.setFromMatrixColumn(t,1).length(),o=1/Z.setFromMatrixColumn(t,2).length();return e[0]=n[0]*r,e[1]=n[1]*r,e[2]=n[2]*r,e[3]=0,e[4]=n[4]*s,e[5]=n[5]*s,e[6]=n[6]*s,e[7]=0,e[8]=n[8]*o,e[9]=n[9]*o,e[10]=n[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const e=this.elements,n=t.x,r=t.y,s=t.z,o=Math.cos(n),a=Math.sin(n),l=Math.cos(r),h=Math.sin(r),c=Math.cos(s),u=Math.sin(s);if(t.order==="XYZ"){const p=o*c,f=o*u,g=a*c,_=a*u;e[0]=l*c,e[4]=-l*u,e[8]=h,e[1]=f+g*h,e[5]=p-_*h,e[9]=-a*l,e[2]=_-p*h,e[6]=g+f*h,e[10]=o*l}else if(t.order==="YXZ"){const p=l*c,f=l*u,g=h*c,_=h*u;e[0]=p+_*a,e[4]=g*a-f,e[8]=o*h,e[1]=o*u,e[5]=o*c,e[9]=-a,e[2]=f*a-g,e[6]=_+p*a,e[10]=o*l}else if(t.order==="ZXY"){const p=l*c,f=l*u,g=h*c,_=h*u;e[0]=p-_*a,e[4]=-o*u,e[8]=g+f*a,e[1]=f+g*a,e[5]=o*c,e[9]=_-p*a,e[2]=-o*h,e[6]=a,e[10]=o*l}else if(t.order==="ZYX"){const p=o*c,f=o*u,g=a*c,_=a*u;e[0]=l*c,e[4]=g*h-f,e[8]=p*h+_,e[1]=l*u,e[5]=_*h+p,e[9]=f*h-g,e[2]=-h,e[6]=a*l,e[10]=o*l}else if(t.order==="YZX"){const p=o*l,f=o*h,g=a*l,_=a*h;e[0]=l*c,e[4]=_-p*u,e[8]=g*u+f,e[1]=u,e[5]=o*c,e[9]=-a*c,e[2]=-h*c,e[6]=f*u+g,e[10]=p-_*u}else if(t.order==="XZY"){const p=o*l,f=o*h,g=a*l,_=a*h;e[0]=l*c,e[4]=-u,e[8]=h*c,e[1]=p*u+_,e[5]=o*c,e[9]=f*u-g,e[2]=g*u-f,e[6]=a*c,e[10]=_*u+p}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(mt,t,vt)}lookAt(t,e,n){const r=this.elements;return Ht.subVectors(t,e),Ht.lengthSq()===0&&(Ht.z=1),Ht.normalize(),Ct.crossVectors(n,Ht),Ct.lengthSq()===0&&(Math.abs(n.z)===1?Ht.x+=1e-4:Ht.z+=1e-4,Ht.normalize(),Ct.crossVectors(n,Ht)),Ct.normalize(),zt.crossVectors(Ht,Ct),r[0]=Ct.x,r[4]=zt.x,r[8]=Ht.x,r[1]=Ct.y,r[5]=zt.y,r[9]=Ht.y,r[2]=Ct.z,r[6]=zt.z,r[10]=Ht.z,this}multiply(t,e){return e!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,r=e.elements,s=this.elements,o=n[0],a=n[4],l=n[8],h=n[12],c=n[1],u=n[5],p=n[9],f=n[13],g=n[2],_=n[6],v=n[10],M=n[14],A=n[3],O=n[7],H=n[11],j=n[15],X=r[0],U=r[4],V=r[8],xt=r[12],it=r[1],Q=r[5],st=r[9],nt=r[13],ct=r[2],Lt=r[6],At=r[10],ht=r[14],gt=r[3],Ut=r[7],Vt=r[11],Zt=r[15];return s[0]=o*X+a*it+l*ct+h*gt,s[4]=o*U+a*Q+l*Lt+h*Ut,s[8]=o*V+a*st+l*At+h*Vt,s[12]=o*xt+a*nt+l*ht+h*Zt,s[1]=c*X+u*it+p*ct+f*gt,s[5]=c*U+u*Q+p*Lt+f*Ut,s[9]=c*V+u*st+p*At+f*Vt,s[13]=c*xt+u*nt+p*ht+f*Zt,s[2]=g*X+_*it+v*ct+M*gt,s[6]=g*U+_*Q+v*Lt+M*Ut,s[10]=g*V+_*st+v*At+M*Vt,s[14]=g*xt+_*nt+v*ht+M*Zt,s[3]=A*X+O*it+H*ct+j*gt,s[7]=A*U+O*Q+H*Lt+j*Ut,s[11]=A*V+O*st+H*At+j*Vt,s[15]=A*xt+O*nt+H*ht+j*Zt,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[4],r=t[8],s=t[12],o=t[1],a=t[5],l=t[9],h=t[13],c=t[2],u=t[6],p=t[10],f=t[14];return t[3]*(+s*l*u-r*h*u-s*a*p+n*h*p+r*a*f-n*l*f)+t[7]*(+e*l*f-e*h*p+s*o*p-r*o*f+r*h*c-s*l*c)+t[11]*(+e*h*u-e*a*f-s*o*u+n*o*f+s*a*c-n*h*c)+t[15]*(-r*a*c-e*l*u+e*a*p+r*o*u-n*o*p+n*l*c)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=t[6],h=t[7],c=t[8],u=t[9],p=t[10],f=t[11],g=t[12],_=t[13],v=t[14],M=t[15],A=u*v*h-_*p*h+_*l*f-a*v*f-u*l*M+a*p*M,O=g*p*h-c*v*h-g*l*f+o*v*f+c*l*M-o*p*M,H=c*_*h-g*u*h+g*a*f-o*_*f-c*a*M+o*u*M,j=g*u*l-c*_*l-g*a*p+o*_*p+c*a*v-o*u*v,X=e*A+n*O+r*H+s*j;if(X===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const U=1/X;return t[0]=A*U,t[1]=(_*p*s-u*v*s-_*r*f+n*v*f+u*r*M-n*p*M)*U,t[2]=(a*v*s-_*l*s+_*r*h-n*v*h-a*r*M+n*l*M)*U,t[3]=(u*l*s-a*p*s-u*r*h+n*p*h+a*r*f-n*l*f)*U,t[4]=O*U,t[5]=(c*v*s-g*p*s+g*r*f-e*v*f-c*r*M+e*p*M)*U,t[6]=(g*l*s-o*v*s-g*r*h+e*v*h+o*r*M-e*l*M)*U,t[7]=(o*p*s-c*l*s+c*r*h-e*p*h-o*r*f+e*l*f)*U,t[8]=H*U,t[9]=(g*u*s-c*_*s-g*n*f+e*_*f+c*n*M-e*u*M)*U,t[10]=(o*_*s-g*a*s+g*n*h-e*_*h-o*n*M+e*a*M)*U,t[11]=(c*a*s-o*u*s-c*n*h+e*u*h+o*n*f-e*a*f)*U,t[12]=j*U,t[13]=(c*_*r-g*u*r+g*n*p-e*_*p-c*n*v+e*u*v)*U,t[14]=(g*a*r-o*_*r-g*n*l+e*_*l+o*n*v-e*a*v)*U,t[15]=(o*u*r-c*a*r+c*n*l-e*u*l-o*n*p+e*a*p)*U,this}scale(t){const e=this.elements,n=t.x,r=t.y,s=t.z;return e[0]*=n,e[4]*=r,e[8]*=s,e[1]*=n,e[5]*=r,e[9]*=s,e[2]*=n,e[6]*=r,e[10]*=s,e[3]*=n,e[7]*=r,e[11]*=s,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,r))}makeTranslation(t,e,n){return this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),r=Math.sin(e),s=1-n,o=t.x,a=t.y,l=t.z,h=s*o,c=s*a;return this.set(h*o+n,h*a-r*l,h*l+r*a,0,h*a+r*l,c*a+n,c*l-r*o,0,h*l-r*a,c*l+r*o,s*l*l+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,r,s,o){return this.set(1,n,s,0,t,1,o,0,e,r,1,0,0,0,0,1),this}compose(t,e,n){const r=this.elements,s=e._x,o=e._y,a=e._z,l=e._w,h=s+s,c=o+o,u=a+a,p=s*h,f=s*c,g=s*u,_=o*c,v=o*u,M=a*u,A=l*h,O=l*c,H=l*u,j=n.x,X=n.y,U=n.z;return r[0]=(1-(_+M))*j,r[1]=(f+H)*j,r[2]=(g-O)*j,r[3]=0,r[4]=(f-H)*X,r[5]=(1-(p+M))*X,r[6]=(v+A)*X,r[7]=0,r[8]=(g+O)*U,r[9]=(v-A)*U,r[10]=(1-(p+_))*U,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,e,n){const r=this.elements;let s=Z.set(r[0],r[1],r[2]).length();const o=Z.set(r[4],r[5],r[6]).length(),a=Z.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),t.x=r[12],t.y=r[13],t.z=r[14],ft.copy(this);const l=1/s,h=1/o,c=1/a;return ft.elements[0]*=l,ft.elements[1]*=l,ft.elements[2]*=l,ft.elements[4]*=h,ft.elements[5]*=h,ft.elements[6]*=h,ft.elements[8]*=c,ft.elements[9]*=c,ft.elements[10]*=c,e.setFromRotationMatrix(ft),n.x=s,n.y=o,n.z=a,this}makePerspective(t,e,n,r,s,o){o===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const a=this.elements,l=2*s/(e-t),h=2*s/(n-r),c=(e+t)/(e-t),u=(n+r)/(n-r),p=-(o+s)/(o-s),f=-2*o*s/(o-s);return a[0]=l,a[4]=0,a[8]=c,a[12]=0,a[1]=0,a[5]=h,a[9]=u,a[13]=0,a[2]=0,a[6]=0,a[10]=p,a[14]=f,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(t,e,n,r,s,o){const a=this.elements,l=1/(e-t),h=1/(n-r),c=1/(o-s),u=(e+t)*l,p=(n+r)*h,f=(o+s)*c;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-u,a[1]=0,a[5]=2*h,a[9]=0,a[13]=-p,a[2]=0,a[6]=0,a[10]=-2*c,a[14]=-f,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let r=0;r<16;r++)if(e[r]!==n[r])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}W.prototype.isMatrix4=!0;const Z=new w,ft=new W,mt=new w(0,0,0),vt=new w(1,1,1),Ct=new w,zt=new w,Ht=new w,Wt=new W,ne=new lt;class oe{constructor(t=0,e=0,n=0,r=oe.DefaultOrder){this._x=t,this._y=e,this._z=n,this._order=r}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,r=this._order){return this._x=t,this._y=e,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){const r=t.elements,s=r[0],o=r[4],a=r[8],l=r[1],h=r[5],c=r[9],u=r[2],p=r[6],f=r[10];switch(e){case"XYZ":this._y=Math.asin(ut(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,f),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(p,h),this._z=0);break;case"YXZ":this._x=Math.asin(-ut(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(a,f),this._z=Math.atan2(l,h)):(this._y=Math.atan2(-u,s),this._z=0);break;case"ZXY":this._x=Math.asin(ut(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-o,h)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-ut(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(p,f),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,h));break;case"YZX":this._z=Math.asin(ut(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-c,h),this._y=Math.atan2(-u,s)):(this._x=0,this._y=Math.atan2(a,f));break;case"XZY":this._z=Math.asin(-ut(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,h),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-c,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,n===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return Wt.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Wt,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return ne.setFromEuler(this),this.setFromQuaternion(ne,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}toVector3(t){return t?t.set(this._x,this._y,this._z):new w(this._x,this._y,this._z)}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}oe.prototype.isEuler=!0,oe.DefaultOrder="XYZ",oe.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class ye{constructor(){this.mask=1}set(t){this.mask=1<<t|0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!=0}}let Ce=0;const Ie=new w,Ke=new lt,Tn=new W,Si=new w,Mr=new w,zl=new w,Qo=new lt,hd=new w(1,0,0),cd=new w(0,1,0),ud=new w(0,0,1),K_={type:"added"},dd={type:"removed"};class ke extends N{constructor(){super(),Object.defineProperty(this,"id",{value:Ce++}),this.uuid=K(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=ke.DefaultUp.clone();const t=new w,e=new oe,n=new lt,r=new w(1,1,1);e._onChange(function(){n.setFromEuler(e,!1)}),n._onChange(function(){e.setFromQuaternion(n,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new W},normalMatrix:{value:new P}}),this.matrix=new W,this.matrixWorld=new W,this.matrixAutoUpdate=ke.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new ye,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return Ke.setFromAxisAngle(t,e),this.quaternion.multiply(Ke),this}rotateOnWorldAxis(t,e){return Ke.setFromAxisAngle(t,e),this.quaternion.premultiply(Ke),this}rotateX(t){return this.rotateOnAxis(hd,t)}rotateY(t){return this.rotateOnAxis(cd,t)}rotateZ(t){return this.rotateOnAxis(ud,t)}translateOnAxis(t,e){return Ie.copy(t).applyQuaternion(this.quaternion),this.position.add(Ie.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(hd,t)}translateY(t){return this.translateOnAxis(cd,t)}translateZ(t){return this.translateOnAxis(ud,t)}localToWorld(t){return t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return t.applyMatrix4(Tn.copy(this.matrixWorld).invert())}lookAt(t,e,n){t.isVector3?Si.copy(t):Si.set(t,e,n);const r=this.parent;this.updateWorldMatrix(!0,!1),Mr.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Tn.lookAt(Mr,Si,this.up):Tn.lookAt(Si,Mr,this.up),this.quaternion.setFromRotationMatrix(Tn),r&&(Tn.extractRotation(r.matrixWorld),Ke.setFromRotationMatrix(Tn),this.quaternion.premultiply(Ke.invert()))}add(t){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.parent!==null&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(K_)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const e=this.children.indexOf(t);return e!==-1&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(dd)),this}removeFromParent(){const t=this.parent;return t!==null&&t.remove(this),this}clear(){for(let t=0;t<this.children.length;t++){const e=this.children[t];e.parent=null,e.dispatchEvent(dd)}return this.children.length=0,this}attach(t){return this.updateWorldMatrix(!0,!1),Tn.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),Tn.multiply(t.parent.matrixWorld)),t.applyMatrix4(Tn),this.add(t),t.updateWorldMatrix(!1,!0),this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let n=0,r=this.children.length;n<r;n++){const s=this.children[n].getObjectByProperty(t,e);if(s!==void 0)return s}}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Mr,t,zl),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Mr,Qo,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let n=0,r=e.length;n<r;n++)e[n].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);const e=this.children;for(let n=0,r=e.length;n<r;n++)e[n].traverseVisible(t)}traverseAncestors(t){const e=this.parent;e!==null&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let n=0,r=e.length;n<r;n++)e[n].updateMatrixWorld(t)}updateWorldMatrix(t,e){const n=this.parent;if(t===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),e===!0){const r=this.children;for(let s=0,o=r.length;s<o;s++)r[s].updateWorldMatrix(!1,!0)}}toJSON(t){const e=t===void 0||typeof t=="string",n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const r={};function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(t)),l.uuid}if(r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),JSON.stringify(this.userData)!=="{}"&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&(r.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(t.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let h=0,c=l.length;h<c;h++){const u=l[h];s(t.shapes,u)}else s(t.shapes,l)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(t.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const a=[];for(let l=0,h=this.material.length;l<h;l++)a.push(s(t.materials,this.material[l]));r.material=a}else r.material=s(t.materials,this.material);if(this.children.length>0){r.children=[];for(let a=0;a<this.children.length;a++)r.children.push(this.children[a].toJSON(t).object)}if(this.animations.length>0){r.animations=[];for(let a=0;a<this.animations.length;a++){const l=this.animations[a];r.animations.push(s(t.animations,l))}}if(e){const a=o(t.geometries),l=o(t.materials),h=o(t.textures),c=o(t.images),u=o(t.shapes),p=o(t.skeletons),f=o(t.animations);a.length>0&&(n.geometries=a),l.length>0&&(n.materials=l),h.length>0&&(n.textures=h),c.length>0&&(n.images=c),u.length>0&&(n.shapes=u),p.length>0&&(n.skeletons=p),f.length>0&&(n.animations=f)}return n.object=r,n;function o(a){const l=[];for(const h in a){const c=a[h];delete c.metadata,l.push(c)}return l}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let n=0;n<t.children.length;n++){const r=t.children[n];this.add(r.clone())}return this}}ke.DefaultUp=new w(0,1,0),ke.DefaultMatrixAutoUpdate=!0,ke.prototype.isObject3D=!0;const ui=new w,Gi=new w,jl=new w,Hi=new w,Wr=new w,Xr=new w,pd=new w,Vl=new w,Wl=new w,Xl=new w;class pn{constructor(t=new w,e=new w,n=new w){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,r){r.subVectors(n,e),ui.subVectors(t,e),r.cross(ui);const s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(t,e,n,r,s){ui.subVectors(r,e),Gi.subVectors(n,e),jl.subVectors(t,e);const o=ui.dot(ui),a=ui.dot(Gi),l=ui.dot(jl),h=Gi.dot(Gi),c=Gi.dot(jl),u=o*h-a*a;if(u===0)return s.set(-2,-1,-1);const p=1/u,f=(h*l-a*c)*p,g=(o*c-a*l)*p;return s.set(1-f-g,g,f)}static containsPoint(t,e,n,r){return this.getBarycoord(t,e,n,r,Hi),Hi.x>=0&&Hi.y>=0&&Hi.x+Hi.y<=1}static getUV(t,e,n,r,s,o,a,l){return this.getBarycoord(t,e,n,r,Hi),l.set(0,0),l.addScaledVector(s,Hi.x),l.addScaledVector(o,Hi.y),l.addScaledVector(a,Hi.z),l}static isFrontFacing(t,e,n,r){return ui.subVectors(n,e),Gi.subVectors(t,e),ui.cross(Gi).dot(r)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,r){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[r]),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return ui.subVectors(this.c,this.b),Gi.subVectors(this.a,this.b),.5*ui.cross(Gi).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return pn.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return pn.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,n,r,s){return pn.getUV(t,this.a,this.b,this.c,e,n,r,s)}containsPoint(t){return pn.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return pn.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,r=this.b,s=this.c;let o,a;Wr.subVectors(r,n),Xr.subVectors(s,n),Vl.subVectors(t,n);const l=Wr.dot(Vl),h=Xr.dot(Vl);if(l<=0&&h<=0)return e.copy(n);Wl.subVectors(t,r);const c=Wr.dot(Wl),u=Xr.dot(Wl);if(c>=0&&u<=c)return e.copy(r);const p=l*u-c*h;if(p<=0&&l>=0&&c<=0)return o=l/(l-c),e.copy(n).addScaledVector(Wr,o);Xl.subVectors(t,s);const f=Wr.dot(Xl),g=Xr.dot(Xl);if(g>=0&&f<=g)return e.copy(s);const _=f*h-l*g;if(_<=0&&h>=0&&g<=0)return a=h/(h-g),e.copy(n).addScaledVector(Xr,a);const v=c*g-f*u;if(v<=0&&u-c>=0&&f-g>=0)return pd.subVectors(s,r),a=(u-c)/(u-c+(f-g)),e.copy(r).addScaledVector(pd,a);const M=1/(v+_+p);return o=_*M,a=p*M,e.copy(n).addScaledVector(Wr,o).addScaledVector(Xr,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}let Q_=0;class Rn extends N{constructor(){super(),Object.defineProperty(this,"id",{value:Q_++}),this.uuid=K(),this.name="",this.type="Material",this.fog=!0,this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=7680,this.stencilZFail=7680,this.stencilZPass=7680,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.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}onBuild(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const e in t){const n=t[e];if(n===void 0){console.warn("THREE.Material: '"+e+"' parameter is undefined.");continue}if(e==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===1;continue}const r=this[e];r!==void 0?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[e]=n:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}}toJSON(t){const e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});const n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}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()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(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&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==1&&(n.blending=this.blending),this.side!==0&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,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&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(n.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.morphTargets===!0&&(n.morphTargets=!0),this.morphNormals===!0&&(n.morphNormals=!0),this.flatShading===!0&&(n.flatShading=this.flatShading),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData),e){const s=r(t.textures),o=r(t.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(e!==null){const r=e.length;n=new Array(r);for(let s=0;s!==r;++s)n[s]=e[s].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}}Rn.prototype.isMaterial=!0;const fd={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},di={h:0,s:0,l:0},ta={h:0,s:0,l:0};function Yl(i,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?i+6*(t-i)*e:e<.5?t:e<2/3?i+6*(t-i)*(2/3-e):i}function ql(i){return i<.04045?.0773993808*i:Math.pow(.9478672986*i+.0521327014,2.4)}function $l(i){return i<.0031308?12.92*i:1.055*Math.pow(i,.41666)-.055}class _e{constructor(t,e,n){return e===void 0&&n===void 0?this.set(t):this.setRGB(t,e,n)}set(t){return t&&t.isColor?this.copy(t):typeof t=="number"?this.setHex(t):typeof t=="string"&&this.setStyle(t),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this}setRGB(t,e,n){return this.r=t,this.g=e,this.b=n,this}setHSL(t,e,n){if(t=_t(t,1),e=ut(e,0,1),n=ut(n,0,1),e===0)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+e):n+e-n*e,s=2*n-r;this.r=Yl(s,r,t+1/3),this.g=Yl(s,r,t),this.b=Yl(s,r,t-1/3)}return this}setStyle(t){function e(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let r;const s=n[1],o=n[2];switch(s){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,e(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,e(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)){const a=parseFloat(r[1])/360,l=parseInt(r[2],10)/100,h=parseInt(r[3],10)/100;return e(r[4]),this.setHSL(a,l,h)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(t)){const r=n[1],s=r.length;if(s===3)return this.r=parseInt(r.charAt(0)+r.charAt(0),16)/255,this.g=parseInt(r.charAt(1)+r.charAt(1),16)/255,this.b=parseInt(r.charAt(2)+r.charAt(2),16)/255,this;if(s===6)return this.r=parseInt(r.charAt(0)+r.charAt(1),16)/255,this.g=parseInt(r.charAt(2)+r.charAt(3),16)/255,this.b=parseInt(r.charAt(4)+r.charAt(5),16)/255,this}return t&&t.length>0?this.setColorName(t):this}setColorName(t){const e=fd[t.toLowerCase()];return e!==void 0?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copyGammaToLinear(t,e=2){return this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this}copyLinearToGamma(t,e=2){const n=e>0?1/e:1;return this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.r=ql(t.r),this.g=ql(t.g),this.b=ql(t.b),this}copyLinearToSRGB(t){return this.r=$l(t.r),this.g=$l(t.g),this.b=$l(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(t){const e=this.r,n=this.g,r=this.b,s=Math.max(e,n,r),o=Math.min(e,n,r);let a,l;const h=(o+s)/2;if(o===s)a=0,l=0;else{const c=s-o;switch(l=h<=.5?c/(s+o):c/(2-s-o),s){case e:a=(n-r)/c+(n<r?6:0);break;case n:a=(r-e)/c+2;break;case r:a=(e-n)/c+4}a/=6}return t.h=a,t.s=l,t.l=h,t}getStyle(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"}offsetHSL(t,e,n){return this.getHSL(di),di.h+=t,di.s+=e,di.l+=n,this.setHSL(di.h,di.s,di.l),this}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}lerpHSL(t,e){this.getHSL(di),t.getHSL(ta);const n=E(di.h,ta.h,e),r=E(di.s,ta.s,e),s=E(di.l,ta.l,e);return this.setHSL(n,r,s),this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),t.normalized===!0&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}}_e.NAMES=fd,_e.prototype.isColor=!0,_e.prototype.r=1,_e.prototype.g=1,_e.prototype.b=1;class Zl extends Rn{constructor(t){super(),this.type="MeshBasicMaterial",this.color=new _e(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=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.morphTargets=t.morphTargets,this}}Zl.prototype.isMeshBasicMaterial=!0;const Xe=new w,ea=new F;class an{constructor(t,e,n){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=n===!0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[t+r]=e.array[n+r];return this}copyArray(t){return this.array.set(t),this}copyColorsArray(t){const e=this.array;let n=0;for(let r=0,s=t.length;r<s;r++){let o=t[r];o===void 0&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),o=new _e),e[n++]=o.r,e[n++]=o.g,e[n++]=o.b}return this}copyVector2sArray(t){const e=this.array;let n=0;for(let r=0,s=t.length;r<s;r++){let o=t[r];o===void 0&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),o=new F),e[n++]=o.x,e[n++]=o.y}return this}copyVector3sArray(t){const e=this.array;let n=0;for(let r=0,s=t.length;r<s;r++){let o=t[r];o===void 0&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),o=new w),e[n++]=o.x,e[n++]=o.y,e[n++]=o.z}return this}copyVector4sArray(t){const e=this.array;let n=0;for(let r=0,s=t.length;r<s;r++){let o=t[r];o===void 0&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),o=new at),e[n++]=o.x,e[n++]=o.y,e[n++]=o.z,e[n++]=o.w}return this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,n=this.count;e<n;e++)ea.fromBufferAttribute(this,e),ea.applyMatrix3(t),this.setXY(e,ea.x,ea.y);else if(this.itemSize===3)for(let e=0,n=this.count;e<n;e++)Xe.fromBufferAttribute(this,e),Xe.applyMatrix3(t),this.setXYZ(e,Xe.x,Xe.y,Xe.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)Xe.x=this.getX(e),Xe.y=this.getY(e),Xe.z=this.getZ(e),Xe.applyMatrix4(t),this.setXYZ(e,Xe.x,Xe.y,Xe.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)Xe.x=this.getX(e),Xe.y=this.getY(e),Xe.z=this.getZ(e),Xe.applyNormalMatrix(t),this.setXYZ(e,Xe.x,Xe.y,Xe.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)Xe.x=this.getX(e),Xe.y=this.getY(e),Xe.z=this.getZ(e),Xe.transformDirection(t),this.setXYZ(e,Xe.x,Xe.y,Xe.z);return this}set(t,e=0){return this.array.set(t,e),this}getX(t){return this.array[t*this.itemSize]}setX(t,e){return this.array[t*this.itemSize]=e,this}getY(t){return this.array[t*this.itemSize+1]}setY(t,e){return this.array[t*this.itemSize+1]=e,this}getZ(t){return this.array[t*this.itemSize+2]}setZ(t,e){return this.array[t*this.itemSize+2]=e,this}getW(t){return this.array[t*this.itemSize+3]}setW(t,e){return this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this}setXYZW(t,e,n,r,s){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this.array[t+3]=s,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized};return this.name!==""&&(t.name=this.name),this.usage!==35044&&(t.usage=this.usage),this.updateRange.offset===0&&this.updateRange.count===-1||(t.updateRange=this.updateRange),t}}an.prototype.isBufferAttribute=!0;class md extends an{constructor(t,e,n){super(new Uint16Array(t),e,n)}}class ty extends an{constructor(t,e,n){super(new Int32Array(t),e,n)}}class gd extends an{constructor(t,e,n){super(new Uint32Array(t),e,n)}}(class extends an{constructor(i,t,e){super(new Uint16Array(i),t,e)}}).prototype.isFloat16BufferAttribute=!0;class Fe extends an{constructor(t,e,n){super(new Float32Array(t),e,n)}}function vd(i){if(i.length===0)return-1/0;let t=i[0];for(let e=1,n=i.length;e<n;++e)i[e]>t&&(t=i[e]);return t}let ey=0;const ri=new W,Jl=new ke,Yr=new w,Jn=new dt,ks=new dt,xn=new w;class He extends N{constructor(){super(),Object.defineProperty(this,"id",{value:ey++}),this.uuid=K(),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={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(vd(t)>65535?gd:md)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return this.attributes[t]!==void 0}addGroup(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){const e=this.attributes.position;e!==void 0&&(e.applyMatrix4(t),e.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const s=new P().getNormalMatrix(t);n.applyNormalMatrix(s),n.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(t),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return ri.makeRotationFromQuaternion(t),this.applyMatrix4(ri),this}rotateX(t){return ri.makeRotationX(t),this.applyMatrix4(ri),this}rotateY(t){return ri.makeRotationY(t),this.applyMatrix4(ri),this}rotateZ(t){return ri.makeRotationZ(t),this.applyMatrix4(ri),this}translate(t,e,n){return ri.makeTranslation(t,e,n),this.applyMatrix4(ri),this}scale(t,e,n){return ri.makeScale(t,e,n),this.applyMatrix4(ri),this}lookAt(t){return Jl.lookAt(t),Jl.updateMatrix(),this.applyMatrix4(Jl.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Yr).negate(),this.translate(Yr.x,Yr.y,Yr.z),this}setFromPoints(t){const e=[];for(let n=0,r=t.length;n<r;n++){const s=t[n];e.push(s.x,s.y,s.z||0)}return this.setAttribute("position",new Fe(e,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new dt);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.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 w(-1/0,-1/0,-1/0),new w(1/0,1/0,1/0));if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let n=0,r=e.length;n<r;n++){const s=e[n];Jn.setFromBufferAttribute(s),this.morphTargetsRelative?(xn.addVectors(this.boundingBox.min,Jn.min),this.boundingBox.expandByPoint(xn),xn.addVectors(this.boundingBox.max,Jn.max),this.boundingBox.expandByPoint(xn)):(this.boundingBox.expandByPoint(Jn.min),this.boundingBox.expandByPoint(Jn.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(){this.boundingSphere===null&&(this.boundingSphere=new je);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.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 w,1/0);if(t){const n=this.boundingSphere.center;if(Jn.setFromBufferAttribute(t),e)for(let s=0,o=e.length;s<o;s++){const a=e[s];ks.setFromBufferAttribute(a),this.morphTargetsRelative?(xn.addVectors(Jn.min,ks.min),Jn.expandByPoint(xn),xn.addVectors(Jn.max,ks.max),Jn.expandByPoint(xn)):(Jn.expandByPoint(ks.min),Jn.expandByPoint(ks.max))}Jn.getCenter(n);let r=0;for(let s=0,o=t.count;s<o;s++)xn.fromBufferAttribute(t,s),r=Math.max(r,n.distanceToSquared(xn));if(e)for(let s=0,o=e.length;s<o;s++){const a=e[s],l=this.morphTargetsRelative;for(let h=0,c=a.count;h<c;h++)xn.fromBufferAttribute(a,h),l&&(Yr.fromBufferAttribute(t,h),xn.add(Yr)),r=Math.max(r,n.distanceToSquared(xn))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeFaceNormals(){}computeTangents(){const t=this.index,e=this.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=t.array,r=e.position.array,s=e.normal.array,o=e.uv.array,a=r.length/3;e.tangent===void 0&&this.setAttribute("tangent",new an(new Float32Array(4*a),4));const l=e.tangent.array,h=[],c=[];for(let it=0;it<a;it++)h[it]=new w,c[it]=new w;const u=new w,p=new w,f=new w,g=new F,_=new F,v=new F,M=new w,A=new w;function O(it,Q,st){u.fromArray(r,3*it),p.fromArray(r,3*Q),f.fromArray(r,3*st),g.fromArray(o,2*it),_.fromArray(o,2*Q),v.fromArray(o,2*st),p.sub(u),f.sub(u),_.sub(g),v.sub(g);const nt=1/(_.x*v.y-v.x*_.y);isFinite(nt)&&(M.copy(p).multiplyScalar(v.y).addScaledVector(f,-_.y).multiplyScalar(nt),A.copy(f).multiplyScalar(_.x).addScaledVector(p,-v.x).multiplyScalar(nt),h[it].add(M),h[Q].add(M),h[st].add(M),c[it].add(A),c[Q].add(A),c[st].add(A))}let H=this.groups;H.length===0&&(H=[{start:0,count:n.length}]);for(let it=0,Q=H.length;it<Q;++it){const st=H[it],nt=st.start;for(let ct=nt,Lt=nt+st.count;ct<Lt;ct+=3)O(n[ct+0],n[ct+1],n[ct+2])}const j=new w,X=new w,U=new w,V=new w;function xt(it){U.fromArray(s,3*it),V.copy(U);const Q=h[it];j.copy(Q),j.sub(U.multiplyScalar(U.dot(Q))).normalize(),X.crossVectors(V,Q);const st=X.dot(c[it])<0?-1:1;l[4*it]=j.x,l[4*it+1]=j.y,l[4*it+2]=j.z,l[4*it+3]=st}for(let it=0,Q=H.length;it<Q;++it){const st=H[it],nt=st.start;for(let ct=nt,Lt=nt+st.count;ct<Lt;ct+=3)xt(n[ct+0]),xt(n[ct+1]),xt(n[ct+2])}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(e!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new an(new Float32Array(3*e.count),3),this.setAttribute("normal",n);else for(let p=0,f=n.count;p<f;p++)n.setXYZ(p,0,0,0);const r=new w,s=new w,o=new w,a=new w,l=new w,h=new w,c=new w,u=new w;if(t)for(let p=0,f=t.count;p<f;p+=3){const g=t.getX(p+0),_=t.getX(p+1),v=t.getX(p+2);r.fromBufferAttribute(e,g),s.fromBufferAttribute(e,_),o.fromBufferAttribute(e,v),c.subVectors(o,s),u.subVectors(r,s),c.cross(u),a.fromBufferAttribute(n,g),l.fromBufferAttribute(n,_),h.fromBufferAttribute(n,v),a.add(c),l.add(c),h.add(c),n.setXYZ(g,a.x,a.y,a.z),n.setXYZ(_,l.x,l.y,l.z),n.setXYZ(v,h.x,h.y,h.z)}else for(let p=0,f=e.count;p<f;p+=3)r.fromBufferAttribute(e,p+0),s.fromBufferAttribute(e,p+1),o.fromBufferAttribute(e,p+2),c.subVectors(o,s),u.subVectors(r,s),c.cross(u),n.setXYZ(p+0,c.x,c.y,c.z),n.setXYZ(p+1,c.x,c.y,c.z),n.setXYZ(p+2,c.x,c.y,c.z);this.normalizeNormals(),n.needsUpdate=!0}}merge(t,e){if(!t||!t.isBufferGeometry)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t);e===void 0&&(e=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));const n=this.attributes;for(const r in n){if(t.attributes[r]===void 0)continue;const s=n[r].array,o=t.attributes[r],a=o.array,l=o.itemSize*e,h=Math.min(a.length,s.length-l);for(let c=0,u=l;c<h;c++,u++)s[u]=a[c]}return this}normalizeNormals(){const t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)xn.fromBufferAttribute(t,e),xn.normalize(),t.setXYZ(e,xn.x,xn.y,xn.z)}toNonIndexed(){function t(a,l){const h=a.array,c=a.itemSize,u=a.normalized,p=new h.constructor(l.length*c);let f=0,g=0;for(let _=0,v=l.length;_<v;_++){f=a.isInterleavedBufferAttribute?l[_]*a.data.stride+a.offset:l[_]*c;for(let M=0;M<c;M++)p[g++]=h[f++]}return new an(p,c,u)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new He,n=this.index.array,r=this.attributes;for(const a in r){const l=t(r[a],n);e.setAttribute(a,l)}const s=this.morphAttributes;for(const a in s){const l=[],h=s[a];for(let c=0,u=h.length;c<u;c++){const p=t(h[c],n);l.push(p)}e.morphAttributes[a]=l}e.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let a=0,l=o.length;a<l;a++){const h=o[a];e.addGroup(h.start,h.count,h.materialIndex)}return e}toJSON(){const t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const h in l)l[h]!==void 0&&(t[h]=l[h]);return t}t.data={attributes:{}};const e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const l in n){const h=n[l];t.data.attributes[l]=h.toJSON(t.data)}const r={};let s=!1;for(const l in this.morphAttributes){const h=this.morphAttributes[l],c=[];for(let u=0,p=h.length;u<p;u++){const f=h[u];c.push(f.toJSON(t.data))}c.length>0&&(r[l]=c,s=!0)}s&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(t.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t}clone(){return new He().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;n!==null&&this.setIndex(n.clone(e));const r=t.attributes;for(const h in r){const c=r[h];this.setAttribute(h,c.clone(e))}const s=t.morphAttributes;for(const h in s){const c=[],u=s[h];for(let p=0,f=u.length;p<f;p++)c.push(u[p].clone(e));this.morphAttributes[h]=c}this.morphTargetsRelative=t.morphTargetsRelative;const o=t.groups;for(let h=0,c=o.length;h<c;h++){const u=o[h];this.addGroup(u.start,u.count,u.materialIndex)}const a=t.boundingBox;a!==null&&(this.boundingBox=a.clone());const l=t.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}He.prototype.isBufferGeometry=!0;const _d=new W,qr=new z,Kl=new je,ir=new w,rr=new w,sr=new w,Ql=new w,th=new w,eh=new w,na=new w,ia=new w,ra=new w,sa=new F,oa=new F,aa=new F,nh=new w,la=new w;class kn extends ke{constructor(t=new He,e=new Zl){super(),this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t){return super.copy(t),t.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),t.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=t.material,this.geometry=t.geometry,this}updateMorphTargets(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,n=Object.keys(e);if(n.length>0){const r=e[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const a=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}else{const e=t.morphTargets;e!==void 0&&e.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(t,e){const n=this.geometry,r=this.material,s=this.matrixWorld;if(r===void 0||(n.boundingSphere===null&&n.computeBoundingSphere(),Kl.copy(n.boundingSphere),Kl.applyMatrix4(s),t.ray.intersectsSphere(Kl)===!1)||(_d.copy(s).invert(),qr.copy(t.ray).applyMatrix4(_d),n.boundingBox!==null&&qr.intersectsBox(n.boundingBox)===!1))return;let o;if(n.isBufferGeometry){const a=n.index,l=n.attributes.position,h=n.morphAttributes.position,c=n.morphTargetsRelative,u=n.attributes.uv,p=n.attributes.uv2,f=n.groups,g=n.drawRange;if(a!==null)if(Array.isArray(r))for(let _=0,v=f.length;_<v;_++){const M=f[_],A=r[M.materialIndex];for(let O=Math.max(M.start,g.start),H=Math.min(M.start+M.count,g.start+g.count);O<H;O+=3){const j=a.getX(O),X=a.getX(O+1),U=a.getX(O+2);o=ha(this,A,t,qr,l,h,c,u,p,j,X,U),o&&(o.faceIndex=Math.floor(O/3),o.face.materialIndex=M.materialIndex,e.push(o))}}else for(let _=Math.max(0,g.start),v=Math.min(a.count,g.start+g.count);_<v;_+=3){const M=a.getX(_),A=a.getX(_+1),O=a.getX(_+2);o=ha(this,r,t,qr,l,h,c,u,p,M,A,O),o&&(o.faceIndex=Math.floor(_/3),e.push(o))}else if(l!==void 0)if(Array.isArray(r))for(let _=0,v=f.length;_<v;_++){const M=f[_],A=r[M.materialIndex];for(let O=Math.max(M.start,g.start),H=Math.min(M.start+M.count,g.start+g.count);O<H;O+=3)o=ha(this,A,t,qr,l,h,c,u,p,O,O+1,O+2),o&&(o.faceIndex=Math.floor(O/3),o.face.materialIndex=M.materialIndex,e.push(o))}else for(let _=Math.max(0,g.start),v=Math.min(l.count,g.start+g.count);_<v;_+=3)o=ha(this,r,t,qr,l,h,c,u,p,_,_+1,_+2),o&&(o.faceIndex=Math.floor(_/3),e.push(o))}else n.isGeometry&&console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}function ha(i,t,e,n,r,s,o,a,l,h,c,u){ir.fromBufferAttribute(r,h),rr.fromBufferAttribute(r,c),sr.fromBufferAttribute(r,u);const p=i.morphTargetInfluences;if(t.morphTargets&&s&&p){na.set(0,0,0),ia.set(0,0,0),ra.set(0,0,0);for(let g=0,_=s.length;g<_;g++){const v=p[g],M=s[g];v!==0&&(Ql.fromBufferAttribute(M,h),th.fromBufferAttribute(M,c),eh.fromBufferAttribute(M,u),o?(na.addScaledVector(Ql,v),ia.addScaledVector(th,v),ra.addScaledVector(eh,v)):(na.addScaledVector(Ql.sub(ir),v),ia.addScaledVector(th.sub(rr),v),ra.addScaledVector(eh.sub(sr),v)))}ir.add(na),rr.add(ia),sr.add(ra)}i.isSkinnedMesh&&(i.boneTransform(h,ir),i.boneTransform(c,rr),i.boneTransform(u,sr));const f=function(g,_,v,M,A,O,H,j){let X;if(X=_.side===1?M.intersectTriangle(H,O,A,!0,j):M.intersectTriangle(A,O,H,_.side!==2,j),X===null)return null;la.copy(j),la.applyMatrix4(g.matrixWorld);const U=v.ray.origin.distanceTo(la);return U<v.near||U>v.far?null:{distance:U,point:la.clone(),object:g}}(i,t,e,n,ir,rr,sr,nh);if(f){a&&(sa.fromBufferAttribute(a,h),oa.fromBufferAttribute(a,c),aa.fromBufferAttribute(a,u),f.uv=pn.getUV(nh,ir,rr,sr,sa,oa,aa,new F)),l&&(sa.fromBufferAttribute(l,h),oa.fromBufferAttribute(l,c),aa.fromBufferAttribute(l,u),f.uv2=pn.getUV(nh,ir,rr,sr,sa,oa,aa,new F));const g={a:h,b:c,c:u,normal:new w,materialIndex:0};pn.getNormal(ir,rr,sr,g.normal),f.face=g}return f}kn.prototype.isMesh=!0;class Us extends He{constructor(t=1,e=1,n=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:r,heightSegments:s,depthSegments:o};const a=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const l=[],h=[],c=[],u=[];let p=0,f=0;function g(_,v,M,A,O,H,j,X,U,V,xt){const it=H/U,Q=j/V,st=H/2,nt=j/2,ct=X/2,Lt=U+1,At=V+1;let ht=0,gt=0;const Ut=new w;for(let Vt=0;Vt<At;Vt++){const Zt=Vt*Q-nt;for(let J=0;J<Lt;J++){const et=J*it-st;Ut[_]=et*A,Ut[v]=Zt*O,Ut[M]=ct,h.push(Ut.x,Ut.y,Ut.z),Ut[_]=0,Ut[v]=0,Ut[M]=X>0?1:-1,c.push(Ut.x,Ut.y,Ut.z),u.push(J/U),u.push(1-Vt/V),ht+=1}}for(let Vt=0;Vt<V;Vt++)for(let Zt=0;Zt<U;Zt++){const J=p+Zt+Lt*Vt,et=p+Zt+Lt*(Vt+1),Ft=p+(Zt+1)+Lt*(Vt+1),Pt=p+(Zt+1)+Lt*Vt;l.push(J,et,Pt),l.push(et,Ft,Pt),gt+=6}a.addGroup(f,gt,xt),f+=gt,p+=ht}g("z","y","x",-1,-1,n,e,t,o,s,0),g("z","y","x",1,-1,n,e,-t,o,s,1),g("x","z","y",1,1,t,n,e,r,o,2),g("x","z","y",1,-1,t,n,-e,r,o,3),g("x","y","z",1,-1,t,e,n,r,s,4),g("x","y","z",-1,-1,t,e,-n,r,s,5),this.setIndex(l),this.setAttribute("position",new Fe(h,3)),this.setAttribute("normal",new Fe(c,3)),this.setAttribute("uv",new Fe(u,2))}static fromJSON(t){return new Us(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function $r(i){const t={};for(const e in i){t[e]={};for(const n in i[e]){const r=i[e][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?t[e][n]=r.clone():Array.isArray(r)?t[e][n]=r.slice():t[e][n]=r}}return t}function Ln(i){const t={};for(let e=0;e<i.length;e++){const n=$r(i[e]);for(const r in n)t[r]=n[r]}return t}const ny={clone:$r,merge:Ln};class pi extends Rn{constructor(t){super(),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=`void main() {
|
|
2027
2027
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
2028
2028
|
}`,this.fragmentShader=`void main() {
|
|
2029
2029
|
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
|
|
@@ -4914,7 +4914,7 @@ void main() {
|
|
|
4914
4914
|
squared_mean = squared_mean * HALF_SAMPLE_RATE;
|
|
4915
4915
|
float std_dev = sqrt( squared_mean - mean * mean );
|
|
4916
4916
|
gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
|
|
4917
|
-
}`}),f=p.clone();f.defines.HORIZONTAL_PASS=1;const g=new He;g.setAttribute("position",new an(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new kn(g,p),v=this;function M(X,U){const V=t.update(_);p.uniforms.shadow_pass.value=X.map.texture,p.uniforms.resolution.value=X.mapSize,p.uniforms.radius.value=X.radius,i.setRenderTarget(X.mapPass),i.clear(),i.renderBufferDirect(U,null,V,p,_,null),f.uniforms.shadow_pass.value=X.mapPass.texture,f.uniforms.resolution.value=X.mapSize,f.uniforms.radius.value=X.radius,i.setRenderTarget(X.map),i.clear(),i.renderBufferDirect(U,null,V,f,_,null)}function A(X){const U=X<<0;let V=a[U];return V===void 0&&(V=new Wd({depthPacking:3201,morphTargets:X}),a[U]=V),V}function O(X){const U=X<<0;let V=l[U];return V===void 0&&(V=new Xd({morphTargets:X}),l[U]=V),V}function H(X,U,V,xt,it,Q,st){let nt=null,ct=A,Lt=X.customDepthMaterial;if(xt.isPointLight===!0&&(ct=O,Lt=X.customDistanceMaterial),Lt===void 0){let At=!1;V.morphTargets===!0&&(At=U.morphAttributes&&U.morphAttributes.position&&U.morphAttributes.position.length>0),nt=ct(At)}else nt=Lt;if(i.localClippingEnabled&&V.clipShadows===!0&&V.clippingPlanes.length!==0){const At=nt.uuid,ht=V.uuid;let gt=h[At];gt===void 0&&(gt={},h[At]=gt);let Ut=gt[ht];Ut===void 0&&(Ut=nt.clone(),gt[ht]=Ut),nt=Ut}return nt.visible=V.visible,nt.wireframe=V.wireframe,nt.side=st===3?V.shadowSide!==null?V.shadowSide:V.side:V.shadowSide!==null?V.shadowSide:u[V.side],nt.clipShadows=V.clipShadows,nt.clippingPlanes=V.clippingPlanes,nt.clipIntersection=V.clipIntersection,nt.wireframeLinewidth=V.wireframeLinewidth,nt.linewidth=V.linewidth,xt.isPointLight===!0&&nt.isMeshDistanceMaterial===!0&&(nt.referencePosition.setFromMatrixPosition(xt.matrixWorld),nt.nearDistance=it,nt.farDistance=Q),nt}function j(X,U,V,xt,it){if(X.visible===!1)return;if(X.layers.test(U.layers)&&(X.isMesh||X.isLine||X.isPoints)&&(X.castShadow||X.receiveShadow&&it===3)&&(!X.frustumCulled||n.intersectsObject(X))){X.modelViewMatrix.multiplyMatrices(V.matrixWorldInverse,X.matrixWorld);const st=t.update(X),nt=X.material;if(Array.isArray(nt)){const ct=st.groups;for(let Lt=0,At=ct.length;Lt<At;Lt++){const ht=ct[Lt],gt=nt[ht.materialIndex];if(gt&>.visible){const Ut=H(X,st,gt,xt,V.near,V.far,it);i.renderBufferDirect(V,null,st,Ut,X,ht)}}}else if(nt.visible){const ct=H(X,st,nt,xt,V.near,V.far,it);i.renderBufferDirect(V,null,st,ct,X,null)}}const Q=X.children;for(let st=0,nt=Q.length;st<nt;st++)j(Q[st],U,V,xt,it)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(X,U,V){if(v.enabled===!1||v.autoUpdate===!1&&v.needsUpdate===!1||X.length===0)return;const xt=i.getRenderTarget(),it=i.getActiveCubeFace(),Q=i.getActiveMipmapLevel(),st=i.state;st.setBlending(0),st.buffers.color.setClear(1,1,1,1),st.buffers.depth.setTest(!0),st.setScissorTest(!1);for(let nt=0,ct=X.length;nt<ct;nt++){const Lt=X[nt],At=Lt.shadow;if(At===void 0){console.warn("THREE.WebGLShadowMap:",Lt,"has no shadow.");continue}if(At.autoUpdate===!1&&At.needsUpdate===!1)continue;r.copy(At.mapSize);const ht=At.getFrameExtents();if(r.multiply(ht),s.copy(At.mapSize),(r.x>c||r.y>c)&&(r.x>c&&(s.x=Math.floor(c/ht.x),r.x=s.x*ht.x,At.mapSize.x=s.x),r.y>c&&(s.y=Math.floor(c/ht.y),r.y=s.y*ht.y,At.mapSize.y=s.y)),At.map===null&&!At.isPointLightShadow&&this.type===3){const Ut={minFilter:1006,magFilter:1006,format:1023};At.map=new $(r.x,r.y,Ut),At.map.texture.name=Lt.name+".shadowMap",At.mapPass=new $(r.x,r.y,Ut),At.camera.updateProjectionMatrix()}if(At.map===null){const Ut={minFilter:1003,magFilter:1003,format:1023};At.map=new $(r.x,r.y,Ut),At.map.texture.name=Lt.name+".shadowMap",At.camera.updateProjectionMatrix()}i.setRenderTarget(At.map),i.clear();const gt=At.getViewportCount();for(let Ut=0;Ut<gt;Ut++){const Vt=At.getViewport(Ut);o.set(s.x*Vt.x,s.y*Vt.y,s.x*Vt.z,s.y*Vt.w),st.viewport(o),At.updateMatrices(Lt,Ut),n=At.getFrustum(),j(U,V,At.camera,Lt,this.type)}At.isPointLightShadow||this.type!==3||M(At,V),At.needsUpdate=!1}v.needsUpdate=!1,i.setRenderTarget(xt,it,Q)}}function Tx(i,t,e){const n=e.isWebGL2,r=new function(){let Y=!1;const pt=new at;let Et=null;const Tt=new at(0,0,0,0);return{setMask:function(St){Et===St||Y||(i.colorMask(St,St,St,St),Et=St)},setLocked:function(St){Y=St},setClear:function(St,Qt,ce,ae,se){se===!0&&(St*=ae,Qt*=ae,ce*=ae),pt.set(St,Qt,ce,ae),Tt.equals(pt)===!1&&(i.clearColor(St,Qt,ce,ae),Tt.copy(pt))},reset:function(){Y=!1,Et=null,Tt.set(-1,0,0,0)}}},s=new function(){let Y=!1,pt=null,Et=null,Tt=null;return{setTest:function(St){St?Zt(2929):J(2929)},setMask:function(St){pt===St||Y||(i.depthMask(St),pt=St)},setFunc:function(St){if(Et!==St){if(St)switch(St){case 0:i.depthFunc(512);break;case 1:i.depthFunc(519);break;case 2:i.depthFunc(513);break;case 3:i.depthFunc(515);break;case 4:i.depthFunc(514);break;case 5:i.depthFunc(518);break;case 6:i.depthFunc(516);break;case 7:i.depthFunc(517);break;default:i.depthFunc(515)}else i.depthFunc(515);Et=St}},setLocked:function(St){Y=St},setClear:function(St){Tt!==St&&(i.clearDepth(St),Tt=St)},reset:function(){Y=!1,pt=null,Et=null,Tt=null}}},o=new function(){let Y=!1,pt=null,Et=null,Tt=null,St=null,Qt=null,ce=null,ae=null,se=null;return{setTest:function(we){Y||(we?Zt(2960):J(2960))},setMask:function(we){pt===we||Y||(i.stencilMask(we),pt=we)},setFunc:function(we,vn,Ve){Et===we&&Tt===vn&&St===Ve||(i.stencilFunc(we,vn,Ve),Et=we,Tt=vn,St=Ve)},setOp:function(we,vn,Ve){Qt===we&&ce===vn&&ae===Ve||(i.stencilOp(we,vn,Ve),Qt=we,ce=vn,ae=Ve)},setLocked:function(we){Y=we},setClear:function(we){se!==we&&(i.clearStencil(we),se=we)},reset:function(){Y=!1,pt=null,Et=null,Tt=null,St=null,Qt=null,ce=null,ae=null,se=null}}};let a={},l=null,h={},c=null,u=!1,p=null,f=null,g=null,_=null,v=null,M=null,A=null,O=!1,H=null,j=null,X=null,U=null,V=null;const xt=i.getParameter(35661);let it=!1,Q=0;const st=i.getParameter(7938);st.indexOf("WebGL")!==-1?(Q=parseFloat(/^WebGL (\d)/.exec(st)[1]),it=Q>=1):st.indexOf("OpenGL ES")!==-1&&(Q=parseFloat(/^OpenGL ES (\d)/.exec(st)[1]),it=Q>=2);let nt=null,ct={};const Lt=i.getParameter(3088),At=i.getParameter(2978),ht=new at().fromArray(Lt),gt=new at().fromArray(At);function Ut(Y,pt,Et){const Tt=new Uint8Array(4),St=i.createTexture();i.bindTexture(Y,St),i.texParameteri(Y,10241,9728),i.texParameteri(Y,10240,9728);for(let Qt=0;Qt<Et;Qt++)i.texImage2D(pt+Qt,0,6408,1,1,0,6408,5121,Tt);return St}const Vt={};function Zt(Y){a[Y]!==!0&&(i.enable(Y),a[Y]=!0)}function J(Y){a[Y]!==!1&&(i.disable(Y),a[Y]=!1)}Vt[3553]=Ut(3553,3553,1),Vt[34067]=Ut(34067,34069,6),r.setClear(0,0,0,1),s.setClear(1),o.setClear(0),Zt(2929),s.setFunc(3),It(!1),Yt(1),Zt(2884),Pt(0);const et={100:32774,101:32778,102:32779};if(n)et[103]=32775,et[104]=32776;else{const Y=t.get("EXT_blend_minmax");Y!==null&&(et[103]=Y.MIN_EXT,et[104]=Y.MAX_EXT)}const Ft={200:0,201:1,202:768,204:770,210:776,208:774,206:772,203:769,205:771,209:775,207:773};function Pt(Y,pt,Et,Tt,St,Qt,ce,ae){if(Y!==0){if(u===!1&&(Zt(3042),u=!0),Y===5)St=St||pt,Qt=Qt||Et,ce=ce||Tt,pt===f&&St===v||(i.blendEquationSeparate(et[pt],et[St]),f=pt,v=St),Et===g&&Tt===_&&Qt===M&&ce===A||(i.blendFuncSeparate(Ft[Et],Ft[Tt],Ft[Qt],Ft[ce]),g=Et,_=Tt,M=Qt,A=ce),p=Y,O=null;else if(Y!==p||ae!==O){if(f===100&&v===100||(i.blendEquation(32774),f=100,v=100),ae)switch(Y){case 1:i.blendFuncSeparate(1,771,1,771);break;case 2:i.blendFunc(1,1);break;case 3:i.blendFuncSeparate(0,0,769,771);break;case 4:i.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",Y)}else switch(Y){case 1:i.blendFuncSeparate(770,771,1,771);break;case 2:i.blendFunc(770,1);break;case 3:i.blendFunc(0,769);break;case 4:i.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",Y)}g=null,_=null,M=null,A=null,p=Y,O=ae}}else u===!0&&(J(3042),u=!1)}function It(Y){H!==Y&&(Y?i.frontFace(2304):i.frontFace(2305),H=Y)}function Yt(Y){Y!==0?(Zt(2884),Y!==j&&(Y===1?i.cullFace(1029):Y===2?i.cullFace(1028):i.cullFace(1032))):J(2884),j=Y}function qt(Y,pt,Et){Y?(Zt(32823),U===pt&&V===Et||(i.polygonOffset(pt,Et),U=pt,V=Et)):J(32823)}function Nt(Y){Y===void 0&&(Y=33984+xt-1),nt!==Y&&(i.activeTexture(Y),nt=Y)}return{buffers:{color:r,depth:s,stencil:o},enable:Zt,disable:J,bindFramebuffer:function(Y,pt){return pt===null&&l!==null&&(pt=l),h[Y]!==pt&&(i.bindFramebuffer(Y,pt),h[Y]=pt,n&&(Y===36009&&(h[36160]=pt),Y===36160&&(h[36009]=pt)),!0)},bindXRFramebuffer:function(Y){Y!==l&&(i.bindFramebuffer(36160,Y),l=Y)},useProgram:function(Y){return c!==Y&&(i.useProgram(Y),c=Y,!0)},setBlending:Pt,setMaterial:function(Y,pt){Y.side===2?J(2884):Zt(2884);let Et=Y.side===1;pt&&(Et=!Et),It(Et),Y.blending===1&&Y.transparent===!1?Pt(0):Pt(Y.blending,Y.blendEquation,Y.blendSrc,Y.blendDst,Y.blendEquationAlpha,Y.blendSrcAlpha,Y.blendDstAlpha,Y.premultipliedAlpha),s.setFunc(Y.depthFunc),s.setTest(Y.depthTest),s.setMask(Y.depthWrite),r.setMask(Y.colorWrite);const Tt=Y.stencilWrite;o.setTest(Tt),Tt&&(o.setMask(Y.stencilWriteMask),o.setFunc(Y.stencilFunc,Y.stencilRef,Y.stencilFuncMask),o.setOp(Y.stencilFail,Y.stencilZFail,Y.stencilZPass)),qt(Y.polygonOffset,Y.polygonOffsetFactor,Y.polygonOffsetUnits),Y.alphaToCoverage===!0?Zt(32926):J(32926)},setFlipSided:It,setCullFace:Yt,setLineWidth:function(Y){Y!==X&&(it&&i.lineWidth(Y),X=Y)},setPolygonOffset:qt,setScissorTest:function(Y){Y?Zt(3089):J(3089)},activeTexture:Nt,bindTexture:function(Y,pt){nt===null&&Nt();let Et=ct[nt];Et===void 0&&(Et={type:void 0,texture:void 0},ct[nt]=Et),Et.type===Y&&Et.texture===pt||(i.bindTexture(Y,pt||Vt[Y]),Et.type=Y,Et.texture=pt)},unbindTexture:function(){const Y=ct[nt];Y!==void 0&&Y.type!==void 0&&(i.bindTexture(Y.type,null),Y.type=void 0,Y.texture=void 0)},compressedTexImage2D:function(){try{i.compressedTexImage2D.apply(i,arguments)}catch(Y){console.error("THREE.WebGLState:",Y)}},texImage2D:function(){try{i.texImage2D.apply(i,arguments)}catch(Y){console.error("THREE.WebGLState:",Y)}},texImage3D:function(){try{i.texImage3D.apply(i,arguments)}catch(Y){console.error("THREE.WebGLState:",Y)}},scissor:function(Y){ht.equals(Y)===!1&&(i.scissor(Y.x,Y.y,Y.z,Y.w),ht.copy(Y))},viewport:function(Y){gt.equals(Y)===!1&&(i.viewport(Y.x,Y.y,Y.z,Y.w),gt.copy(Y))},reset:function(){i.disable(3042),i.disable(2884),i.disable(2929),i.disable(32823),i.disable(3089),i.disable(2960),i.disable(32926),i.blendEquation(32774),i.blendFunc(1,0),i.blendFuncSeparate(1,0,1,0),i.colorMask(!0,!0,!0,!0),i.clearColor(0,0,0,0),i.depthMask(!0),i.depthFunc(513),i.clearDepth(1),i.stencilMask(4294967295),i.stencilFunc(519,0,4294967295),i.stencilOp(7680,7680,7680),i.clearStencil(0),i.cullFace(1029),i.frontFace(2305),i.polygonOffset(0,0),i.activeTexture(33984),i.bindFramebuffer(36160,null),n===!0&&(i.bindFramebuffer(36009,null),i.bindFramebuffer(36008,null)),i.useProgram(null),i.lineWidth(1),i.scissor(0,0,i.canvas.width,i.canvas.height),i.viewport(0,0,i.canvas.width,i.canvas.height),a={},nt=null,ct={},l=null,h={},c=null,u=!1,p=null,f=null,g=null,_=null,v=null,M=null,A=null,O=!1,H=null,j=null,X=null,U=null,V=null,ht.set(0,0,i.canvas.width,i.canvas.height),gt.set(0,0,i.canvas.width,i.canvas.height),r.reset(),s.reset(),o.reset()}}}function Sx(i,t,e,n,r,s,o){const a=r.isWebGL2,l=r.maxTextures,h=r.maxCubemapSize,c=r.maxTextureSize,u=r.maxSamples,p=new WeakMap;let f,g=!1;try{g=typeof OffscreenCanvas!="undefined"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(J,et){return g?new OffscreenCanvas(J,et):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function v(J,et,Ft,Pt){let It=1;if((J.width>Pt||J.height>Pt)&&(It=Pt/Math.max(J.width,J.height)),It<1||et===!0){if(typeof HTMLImageElement!="undefined"&&J instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&J instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&J instanceof ImageBitmap){const Yt=et?D:Math.floor,qt=Yt(It*J.width),Nt=Yt(It*J.height);f===void 0&&(f=_(qt,Nt));const Y=Ft?_(qt,Nt):f;return Y.width=qt,Y.height=Nt,Y.getContext("2d").drawImage(J,0,0,qt,Nt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+J.width+"x"+J.height+") to ("+qt+"x"+Nt+")."),Y}return"data"in J&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+J.width+"x"+J.height+")."),J}return J}function M(J){return I(J.width)&&I(J.height)}function A(J,et){return J.generateMipmaps&&et&&J.minFilter!==1003&&J.minFilter!==1006}function O(J,et,Ft,Pt,It=1){i.generateMipmap(J),n.get(et).__maxMipLevel=Math.log2(Math.max(Ft,Pt,It))}function H(J,et,Ft){if(a===!1)return et;if(J!==null){if(i[J]!==void 0)return i[J];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+J+"'")}let Pt=et;return et===6403&&(Ft===5126&&(Pt=33326),Ft===5131&&(Pt=33325),Ft===5121&&(Pt=33321)),et===6407&&(Ft===5126&&(Pt=34837),Ft===5131&&(Pt=34843),Ft===5121&&(Pt=32849)),et===6408&&(Ft===5126&&(Pt=34836),Ft===5131&&(Pt=34842),Ft===5121&&(Pt=32856)),Pt!==33325&&Pt!==33326&&Pt!==34842&&Pt!==34836||t.get("EXT_color_buffer_float"),Pt}function j(J){return J===1003||J===1004||J===1005?9728:9729}function X(J){const et=J.target;et.removeEventListener("dispose",X),function(Ft){const Pt=n.get(Ft);Pt.__webglInit!==void 0&&(i.deleteTexture(Pt.__webglTexture),n.remove(Ft))}(et),et.isVideoTexture&&p.delete(et),o.memory.textures--}function U(J){const et=J.target;et.removeEventListener("dispose",U),function(Ft){const Pt=Ft.texture,It=n.get(Ft),Yt=n.get(Pt);if(!!Ft){if(Yt.__webglTexture!==void 0&&(i.deleteTexture(Yt.__webglTexture),o.memory.textures--),Ft.depthTexture&&Ft.depthTexture.dispose(),Ft.isWebGLCubeRenderTarget)for(let qt=0;qt<6;qt++)i.deleteFramebuffer(It.__webglFramebuffer[qt]),It.__webglDepthbuffer&&i.deleteRenderbuffer(It.__webglDepthbuffer[qt]);else i.deleteFramebuffer(It.__webglFramebuffer),It.__webglDepthbuffer&&i.deleteRenderbuffer(It.__webglDepthbuffer),It.__webglMultisampledFramebuffer&&i.deleteFramebuffer(It.__webglMultisampledFramebuffer),It.__webglColorRenderbuffer&&i.deleteRenderbuffer(It.__webglColorRenderbuffer),It.__webglDepthRenderbuffer&&i.deleteRenderbuffer(It.__webglDepthRenderbuffer);if(Ft.isWebGLMultipleRenderTargets)for(let qt=0,Nt=Pt.length;qt<Nt;qt++){const Y=n.get(Pt[qt]);Y.__webglTexture&&(i.deleteTexture(Y.__webglTexture),o.memory.textures--),n.remove(Pt[qt])}n.remove(Pt),n.remove(Ft)}}(et)}let V=0;function xt(J,et){const Ft=n.get(J);if(J.isVideoTexture&&function(Pt){const It=o.render.frame;p.get(Pt)!==It&&(p.set(Pt,It),Pt.update())}(J),J.version>0&&Ft.__version!==J.version){const Pt=J.image;if(Pt===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(Pt.complete!==!1)return void Lt(Ft,J,et);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}e.activeTexture(33984+et),e.bindTexture(3553,Ft.__webglTexture)}function it(J,et){const Ft=n.get(J);J.version>0&&Ft.__version!==J.version?function(Pt,It,Yt){if(It.image.length!==6)return;ct(Pt,It),e.activeTexture(33984+Yt),e.bindTexture(34067,Pt.__webglTexture),i.pixelStorei(37440,It.flipY),i.pixelStorei(37441,It.premultiplyAlpha),i.pixelStorei(3317,It.unpackAlignment),i.pixelStorei(37443,0);const qt=It&&(It.isCompressedTexture||It.image[0].isCompressedTexture),Nt=It.image[0]&&It.image[0].isDataTexture,Y=[];for(let ae=0;ae<6;ae++)Y[ae]=qt||Nt?Nt?It.image[ae].image:It.image[ae]:v(It.image[ae],!1,!0,h);const pt=Y[0],Et=M(pt)||a,Tt=s.convert(It.format),St=s.convert(It.type),Qt=H(It.internalFormat,Tt,St);let ce;if(nt(34067,It,Et),qt){for(let ae=0;ae<6;ae++){ce=Y[ae].mipmaps;for(let se=0;se<ce.length;se++){const we=ce[se];It.format!==1023&&It.format!==1022?Tt!==null?e.compressedTexImage2D(34069+ae,se,Qt,we.width,we.height,0,we.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):e.texImage2D(34069+ae,se,Qt,we.width,we.height,0,Tt,St,we.data)}}Pt.__maxMipLevel=ce.length-1}else{ce=It.mipmaps;for(let ae=0;ae<6;ae++)if(Nt){e.texImage2D(34069+ae,0,Qt,Y[ae].width,Y[ae].height,0,Tt,St,Y[ae].data);for(let se=0;se<ce.length;se++){const we=ce[se].image[ae].image;e.texImage2D(34069+ae,se+1,Qt,we.width,we.height,0,Tt,St,we.data)}}else{e.texImage2D(34069+ae,0,Qt,Tt,St,Y[ae]);for(let se=0;se<ce.length;se++){const we=ce[se];e.texImage2D(34069+ae,se+1,Qt,Tt,St,we.image[ae])}}Pt.__maxMipLevel=ce.length}A(It,Et)&&O(34067,It,pt.width,pt.height),Pt.__version=It.version,It.onUpdate&&It.onUpdate(It)}(Ft,J,et):(e.activeTexture(33984+et),e.bindTexture(34067,Ft.__webglTexture))}const Q={1e3:10497,1001:33071,1002:33648},st={1003:9728,1004:9984,1005:9986,1006:9729,1007:9985,1008:9987};function nt(J,et,Ft){if(Ft?(i.texParameteri(J,10242,Q[et.wrapS]),i.texParameteri(J,10243,Q[et.wrapT]),J!==32879&&J!==35866||i.texParameteri(J,32882,Q[et.wrapR]),i.texParameteri(J,10240,st[et.magFilter]),i.texParameteri(J,10241,st[et.minFilter])):(i.texParameteri(J,10242,33071),i.texParameteri(J,10243,33071),J!==32879&&J!==35866||i.texParameteri(J,32882,33071),et.wrapS===1001&&et.wrapT===1001||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),i.texParameteri(J,10240,j(et.magFilter)),i.texParameteri(J,10241,j(et.minFilter)),et.minFilter!==1003&&et.minFilter!==1006&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),t.has("EXT_texture_filter_anisotropic")===!0){const Pt=t.get("EXT_texture_filter_anisotropic");if(et.type===1015&&t.has("OES_texture_float_linear")===!1||a===!1&&et.type===1016&&t.has("OES_texture_half_float_linear")===!1)return;(et.anisotropy>1||n.get(et).__currentAnisotropy)&&(i.texParameterf(J,Pt.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(et.anisotropy,r.getMaxAnisotropy())),n.get(et).__currentAnisotropy=et.anisotropy)}}function ct(J,et){J.__webglInit===void 0&&(J.__webglInit=!0,et.addEventListener("dispose",X),J.__webglTexture=i.createTexture(),o.memory.textures++)}function Lt(J,et,Ft){let Pt=3553;et.isDataTexture2DArray&&(Pt=35866),et.isDataTexture3D&&(Pt=32879),ct(J,et),e.activeTexture(33984+Ft),e.bindTexture(Pt,J.__webglTexture),i.pixelStorei(37440,et.flipY),i.pixelStorei(37441,et.premultiplyAlpha),i.pixelStorei(3317,et.unpackAlignment),i.pixelStorei(37443,0);const It=function(St){return!a&&(St.wrapS!==1001||St.wrapT!==1001||St.minFilter!==1003&&St.minFilter!==1006)}(et)&&M(et.image)===!1,Yt=v(et.image,It,!1,c),qt=M(Yt)||a,Nt=s.convert(et.format);let Y,pt=s.convert(et.type),Et=H(et.internalFormat,Nt,pt);nt(Pt,et,qt);const Tt=et.mipmaps;if(et.isDepthTexture)Et=6402,a?Et=et.type===1015?36012:et.type===1014?33190:et.type===1020?35056:33189:et.type===1015&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),et.format===1026&&Et===6402&&et.type!==1012&&et.type!==1014&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),et.type=1012,pt=s.convert(et.type)),et.format===1027&&Et===6402&&(Et=34041,et.type!==1020&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),et.type=1020,pt=s.convert(et.type))),e.texImage2D(3553,0,Et,Yt.width,Yt.height,0,Nt,pt,null);else if(et.isDataTexture)if(Tt.length>0&&qt){for(let St=0,Qt=Tt.length;St<Qt;St++)Y=Tt[St],e.texImage2D(3553,St,Et,Y.width,Y.height,0,Nt,pt,Y.data);et.generateMipmaps=!1,J.__maxMipLevel=Tt.length-1}else e.texImage2D(3553,0,Et,Yt.width,Yt.height,0,Nt,pt,Yt.data),J.__maxMipLevel=0;else if(et.isCompressedTexture){for(let St=0,Qt=Tt.length;St<Qt;St++)Y=Tt[St],et.format!==1023&&et.format!==1022?Nt!==null?e.compressedTexImage2D(3553,St,Et,Y.width,Y.height,0,Y.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):e.texImage2D(3553,St,Et,Y.width,Y.height,0,Nt,pt,Y.data);J.__maxMipLevel=Tt.length-1}else if(et.isDataTexture2DArray)e.texImage3D(35866,0,Et,Yt.width,Yt.height,Yt.depth,0,Nt,pt,Yt.data),J.__maxMipLevel=0;else if(et.isDataTexture3D)e.texImage3D(32879,0,Et,Yt.width,Yt.height,Yt.depth,0,Nt,pt,Yt.data),J.__maxMipLevel=0;else if(Tt.length>0&&qt){for(let St=0,Qt=Tt.length;St<Qt;St++)Y=Tt[St],e.texImage2D(3553,St,Et,Nt,pt,Y);et.generateMipmaps=!1,J.__maxMipLevel=Tt.length-1}else e.texImage2D(3553,0,Et,Nt,pt,Yt),J.__maxMipLevel=0;A(et,qt)&&O(Pt,et,Yt.width,Yt.height),J.__version=et.version,et.onUpdate&&et.onUpdate(et)}function At(J,et,Ft,Pt,It){const Yt=s.convert(Ft.format),qt=s.convert(Ft.type),Nt=H(Ft.internalFormat,Yt,qt);It===32879||It===35866?e.texImage3D(It,0,Nt,et.width,et.height,et.depth,0,Yt,qt,null):e.texImage2D(It,0,Nt,et.width,et.height,0,Yt,qt,null),e.bindFramebuffer(36160,J),i.framebufferTexture2D(36160,Pt,It,n.get(Ft).__webglTexture,0),e.bindFramebuffer(36160,null)}function ht(J,et,Ft){if(i.bindRenderbuffer(36161,J),et.depthBuffer&&!et.stencilBuffer){let Pt=33189;if(Ft){const It=et.depthTexture;It&&It.isDepthTexture&&(It.type===1015?Pt=36012:It.type===1014&&(Pt=33190));const Yt=Ut(et);i.renderbufferStorageMultisample(36161,Yt,Pt,et.width,et.height)}else i.renderbufferStorage(36161,Pt,et.width,et.height);i.framebufferRenderbuffer(36160,36096,36161,J)}else if(et.depthBuffer&&et.stencilBuffer){if(Ft){const Pt=Ut(et);i.renderbufferStorageMultisample(36161,Pt,35056,et.width,et.height)}else i.renderbufferStorage(36161,34041,et.width,et.height);i.framebufferRenderbuffer(36160,33306,36161,J)}else{const Pt=et.isWebGLMultipleRenderTargets===!0?et.texture[0]:et.texture,It=s.convert(Pt.format),Yt=s.convert(Pt.type),qt=H(Pt.internalFormat,It,Yt);if(Ft){const Nt=Ut(et);i.renderbufferStorageMultisample(36161,Nt,qt,et.width,et.height)}else i.renderbufferStorage(36161,qt,et.width,et.height)}i.bindRenderbuffer(36161,null)}function gt(J){const et=n.get(J),Ft=J.isWebGLCubeRenderTarget===!0;if(J.depthTexture){if(Ft)throw new Error("target.depthTexture not supported in Cube render targets");(function(Pt,It){if(It&&It.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(36160,Pt),!It.depthTexture||!It.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");n.get(It.depthTexture).__webglTexture&&It.depthTexture.image.width===It.width&&It.depthTexture.image.height===It.height||(It.depthTexture.image.width=It.width,It.depthTexture.image.height=It.height,It.depthTexture.needsUpdate=!0),xt(It.depthTexture,0);const Yt=n.get(It.depthTexture).__webglTexture;if(It.depthTexture.format===1026)i.framebufferTexture2D(36160,36096,3553,Yt,0);else{if(It.depthTexture.format!==1027)throw new Error("Unknown depthTexture format");i.framebufferTexture2D(36160,33306,3553,Yt,0)}})(et.__webglFramebuffer,J)}else if(Ft){et.__webglDepthbuffer=[];for(let Pt=0;Pt<6;Pt++)e.bindFramebuffer(36160,et.__webglFramebuffer[Pt]),et.__webglDepthbuffer[Pt]=i.createRenderbuffer(),ht(et.__webglDepthbuffer[Pt],J,!1)}else e.bindFramebuffer(36160,et.__webglFramebuffer),et.__webglDepthbuffer=i.createRenderbuffer(),ht(et.__webglDepthbuffer,J,!1);e.bindFramebuffer(36160,null)}function Ut(J){return a&&J.isWebGLMultisampleRenderTarget?Math.min(u,J.samples):0}let Vt=!1,Zt=!1;this.allocateTextureUnit=function(){const J=V;return J>=l&&console.warn("THREE.WebGLTextures: Trying to use "+J+" texture units while this GPU supports only "+l),V+=1,J},this.resetTextureUnits=function(){V=0},this.setTexture2D=xt,this.setTexture2DArray=function(J,et){const Ft=n.get(J);J.version>0&&Ft.__version!==J.version?Lt(Ft,J,et):(e.activeTexture(33984+et),e.bindTexture(35866,Ft.__webglTexture))},this.setTexture3D=function(J,et){const Ft=n.get(J);J.version>0&&Ft.__version!==J.version?Lt(Ft,J,et):(e.activeTexture(33984+et),e.bindTexture(32879,Ft.__webglTexture))},this.setTextureCube=it,this.setupRenderTarget=function(J){const et=J.texture,Ft=n.get(J),Pt=n.get(et);J.addEventListener("dispose",U),J.isWebGLMultipleRenderTargets!==!0&&(Pt.__webglTexture=i.createTexture(),Pt.__version=et.version,o.memory.textures++);const It=J.isWebGLCubeRenderTarget===!0,Yt=J.isWebGLMultipleRenderTargets===!0,qt=J.isWebGLMultisampleRenderTarget===!0,Nt=et.isDataTexture3D||et.isDataTexture2DArray,Y=M(J)||a;if(!a||et.format!==1022||et.type!==1015&&et.type!==1016||(et.format=1023,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),It){Ft.__webglFramebuffer=[];for(let pt=0;pt<6;pt++)Ft.__webglFramebuffer[pt]=i.createFramebuffer()}else if(Ft.__webglFramebuffer=i.createFramebuffer(),Yt)if(r.drawBuffers){const pt=J.texture;for(let Et=0,Tt=pt.length;Et<Tt;Et++){const St=n.get(pt[Et]);St.__webglTexture===void 0&&(St.__webglTexture=i.createTexture(),o.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(qt)if(a){Ft.__webglMultisampledFramebuffer=i.createFramebuffer(),Ft.__webglColorRenderbuffer=i.createRenderbuffer(),i.bindRenderbuffer(36161,Ft.__webglColorRenderbuffer);const pt=s.convert(et.format),Et=s.convert(et.type),Tt=H(et.internalFormat,pt,Et),St=Ut(J);i.renderbufferStorageMultisample(36161,St,Tt,J.width,J.height),e.bindFramebuffer(36160,Ft.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(36160,36064,36161,Ft.__webglColorRenderbuffer),i.bindRenderbuffer(36161,null),J.depthBuffer&&(Ft.__webglDepthRenderbuffer=i.createRenderbuffer(),ht(Ft.__webglDepthRenderbuffer,J,!0)),e.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(It){e.bindTexture(34067,Pt.__webglTexture),nt(34067,et,Y);for(let pt=0;pt<6;pt++)At(Ft.__webglFramebuffer[pt],J,et,36064,34069+pt);A(et,Y)&&O(34067,et,J.width,J.height),e.bindTexture(34067,null)}else if(Yt){const pt=J.texture;for(let Et=0,Tt=pt.length;Et<Tt;Et++){const St=pt[Et],Qt=n.get(St);e.bindTexture(3553,Qt.__webglTexture),nt(3553,St,Y),At(Ft.__webglFramebuffer,J,St,36064+Et,3553),A(St,Y)&&O(3553,St,J.width,J.height)}e.bindTexture(3553,null)}else{let pt=3553;Nt&&(a?pt=et.isDataTexture3D?32879:35866:console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")),e.bindTexture(pt,Pt.__webglTexture),nt(pt,et,Y),At(Ft.__webglFramebuffer,J,et,36064,pt),A(et,Y)&&O(pt,et,J.width,J.height,J.depth),e.bindTexture(pt,null)}J.depthBuffer&>(J)},this.updateRenderTargetMipmap=function(J){const et=M(J)||a,Ft=J.isWebGLMultipleRenderTargets===!0?J.texture:[J.texture];for(let Pt=0,It=Ft.length;Pt<It;Pt++){const Yt=Ft[Pt];if(A(Yt,et)){const qt=J.isWebGLCubeRenderTarget?34067:3553,Nt=n.get(Yt).__webglTexture;e.bindTexture(qt,Nt),O(qt,Yt,J.width,J.height),e.bindTexture(qt,null)}}},this.updateMultisampleRenderTarget=function(J){if(J.isWebGLMultisampleRenderTarget)if(a){const et=J.width,Ft=J.height;let Pt=16384;J.depthBuffer&&(Pt|=256),J.stencilBuffer&&(Pt|=1024);const It=n.get(J);e.bindFramebuffer(36008,It.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,It.__webglFramebuffer),i.blitFramebuffer(0,0,et,Ft,0,0,et,Ft,Pt,9728),e.bindFramebuffer(36008,null),e.bindFramebuffer(36009,It.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(J,et){J&&J.isWebGLRenderTarget&&(Vt===!1&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),Vt=!0),J=J.texture),xt(J,et)},this.safeSetTextureCube=function(J,et){J&&J.isWebGLCubeRenderTarget&&(Zt===!1&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),Zt=!0),J=J.texture),it(J,et)}}function Mx(i,t,e){const n=e.isWebGL2;return{convert:function(r){let s;if(r===1009)return 5121;if(r===1017)return 32819;if(r===1018)return 32820;if(r===1019)return 33635;if(r===1010)return 5120;if(r===1011)return 5122;if(r===1012)return 5123;if(r===1013)return 5124;if(r===1014)return 5125;if(r===1015)return 5126;if(r===1016)return n?5131:(s=t.get("OES_texture_half_float"),s!==null?s.HALF_FLOAT_OES:null);if(r===1021)return 6406;if(r===1022)return 6407;if(r===1023)return 6408;if(r===1024)return 6409;if(r===1025)return 6410;if(r===1026)return 6402;if(r===1027)return 34041;if(r===1028)return 6403;if(r===1029)return 36244;if(r===1030)return 33319;if(r===1031)return 33320;if(r===1032)return 36248;if(r===1033)return 36249;if(r===33776||r===33777||r===33778||r===33779){if(s=t.get("WEBGL_compressed_texture_s3tc"),s===null)return null;if(r===33776)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===33777)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===33778)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===33779)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(r===35840||r===35841||r===35842||r===35843){if(s=t.get("WEBGL_compressed_texture_pvrtc"),s===null)return null;if(r===35840)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===35841)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===35842)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===35843)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(r===36196)return s=t.get("WEBGL_compressed_texture_etc1"),s!==null?s.COMPRESSED_RGB_ETC1_WEBGL:null;if((r===37492||r===37496)&&(s=t.get("WEBGL_compressed_texture_etc"),s!==null)){if(r===37492)return s.COMPRESSED_RGB8_ETC2;if(r===37496)return s.COMPRESSED_RGBA8_ETC2_EAC}return r===37808||r===37809||r===37810||r===37811||r===37812||r===37813||r===37814||r===37815||r===37816||r===37817||r===37818||r===37819||r===37820||r===37821||r===37840||r===37841||r===37842||r===37843||r===37844||r===37845||r===37846||r===37847||r===37848||r===37849||r===37850||r===37851||r===37852||r===37853?(s=t.get("WEBGL_compressed_texture_astc"),s!==null?r:null):r===36492?(s=t.get("EXT_texture_compression_bptc"),s!==null?r:null):r===1020?n?34042:(s=t.get("WEBGL_depth_texture"),s!==null?s.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}class qd extends jn{constructor(t=[]){super(),this.cameras=t}}qd.prototype.isArrayCamera=!0;class Hs extends ke{constructor(){super(),this.type="Group"}}Hs.prototype.isGroup=!0;const Ax={type:"move"};class lh{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Hs,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Hs,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new w,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new w),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Hs,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new w,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new w),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,e,n){let r=null,s=null,o=null;const a=this._targetRay,l=this._grip,h=this._hand;if(t&&e.session.visibilityState!=="visible-blurred")if(a!==null&&(r=e.getPose(t.targetRaySpace,n),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(Ax))),h&&t.hand){o=!0;for(const _ of t.hand.values()){const v=e.getJointPose(_,n);if(h.joints[_.jointName]===void 0){const A=new Hs;A.matrixAutoUpdate=!1,A.visible=!1,h.joints[_.jointName]=A,h.add(A)}const M=h.joints[_.jointName];v!==null&&(M.matrix.fromArray(v.transform.matrix),M.matrix.decompose(M.position,M.rotation,M.scale),M.jointRadius=v.radius),M.visible=v!==null}const c=h.joints["index-finger-tip"],u=h.joints["thumb-tip"],p=c.position.distanceTo(u.position),f=.02,g=.005;h.inputState.pinching&&p>f+g?(h.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!h.inputState.pinching&&p<=f-g&&(h.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(s=e.getPose(t.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),h!==null&&(h.visible=o!==null),this}}class Px extends N{constructor(t,e){super();const n=this,r=t.state;let s=null,o=1,a=null,l="local-floor",h=null,c=null,u=null,p=null;const f=[],g=new Map,_=new jn;_.layers.enable(1),_.viewport=new at;const v=new jn;v.layers.enable(2),v.viewport=new at;const M=[_,v],A=new qd;A.layers.enable(1),A.layers.enable(2);let O=null,H=null;function j(nt){const ct=g.get(nt.inputSource);ct&&ct.dispatchEvent({type:nt.type,data:nt.inputSource})}function X(){g.forEach(function(nt,ct){nt.disconnect(ct)}),g.clear(),O=null,H=null,r.bindXRFramebuffer(null),t.setRenderTarget(t.getRenderTarget()),st.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function U(nt){const ct=s.inputSources;for(let Lt=0;Lt<f.length;Lt++)g.set(ct[Lt],f[Lt]);for(let Lt=0;Lt<nt.removed.length;Lt++){const At=nt.removed[Lt],ht=g.get(At);ht&&(ht.dispatchEvent({type:"disconnected",data:At}),g.delete(At))}for(let Lt=0;Lt<nt.added.length;Lt++){const At=nt.added[Lt],ht=g.get(At);ht&&ht.dispatchEvent({type:"connected",data:At})}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(nt){let ct=f[nt];return ct===void 0&&(ct=new lh,f[nt]=ct),ct.getTargetRaySpace()},this.getControllerGrip=function(nt){let ct=f[nt];return ct===void 0&&(ct=new lh,f[nt]=ct),ct.getGripSpace()},this.getHand=function(nt){let ct=f[nt];return ct===void 0&&(ct=new lh,f[nt]=ct),ct.getHandSpace()},this.setFramebufferScaleFactor=function(nt){o=nt,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(nt){l=nt,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return a},this.getSession=function(){return s},this.setSession=async function(nt){if(s=nt,s!==null){s.addEventListener("select",j),s.addEventListener("selectstart",j),s.addEventListener("selectend",j),s.addEventListener("squeeze",j),s.addEventListener("squeezestart",j),s.addEventListener("squeezeend",j),s.addEventListener("end",X),s.addEventListener("inputsourceschange",U);const ct=e.getContextAttributes();if(ct.xrCompatible!==!0&&await e.makeXRCompatible(),s.renderState.layers===void 0){const Lt={antialias:ct.antialias,alpha:ct.alpha,depth:ct.depth,stencil:ct.stencil,framebufferScaleFactor:o},At=new XRWebGLLayer(s,e,Lt);s.updateRenderState({baseLayer:At})}else{let Lt=0;ct.depth&&(Lt=ct.stencil?34041:6402);const At={colorFormat:ct.alpha?6408:6407,depthFormat:Lt,scaleFactor:o};c=new XRWebGLBinding(s,e),p=c.createProjectionLayer(At),u=e.createFramebuffer(),s.updateRenderState({layers:[p]})}a=await s.requestReferenceSpace(l),st.setContext(s),st.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};const V=new w,xt=new w;function it(nt,ct){ct===null?nt.matrixWorld.copy(nt.matrix):nt.matrixWorld.multiplyMatrices(ct.matrixWorld,nt.matrix),nt.matrixWorldInverse.copy(nt.matrixWorld).invert()}this.updateCamera=function(nt){if(s===null)return;A.near=v.near=_.near=nt.near,A.far=v.far=_.far=nt.far,O===A.near&&H===A.far||(s.updateRenderState({depthNear:A.near,depthFar:A.far}),O=A.near,H=A.far);const ct=nt.parent,Lt=A.cameras;it(A,ct);for(let ht=0;ht<Lt.length;ht++)it(Lt[ht],ct);A.matrixWorld.decompose(A.position,A.quaternion,A.scale),nt.position.copy(A.position),nt.quaternion.copy(A.quaternion),nt.scale.copy(A.scale),nt.matrix.copy(A.matrix),nt.matrixWorld.copy(A.matrixWorld);const At=nt.children;for(let ht=0,gt=At.length;ht<gt;ht++)At[ht].updateMatrixWorld(!0);Lt.length===2?function(ht,gt,Ut){V.setFromMatrixPosition(gt.matrixWorld),xt.setFromMatrixPosition(Ut.matrixWorld);const Vt=V.distanceTo(xt),Zt=gt.projectionMatrix.elements,J=Ut.projectionMatrix.elements,et=Zt[14]/(Zt[10]-1),Ft=Zt[14]/(Zt[10]+1),Pt=(Zt[9]+1)/Zt[5],It=(Zt[9]-1)/Zt[5],Yt=(Zt[8]-1)/Zt[0],qt=(J[8]+1)/J[0],Nt=et*Yt,Y=et*qt,pt=Vt/(-Yt+qt),Et=pt*-Yt;gt.matrixWorld.decompose(ht.position,ht.quaternion,ht.scale),ht.translateX(Et),ht.translateZ(pt),ht.matrixWorld.compose(ht.position,ht.quaternion,ht.scale),ht.matrixWorldInverse.copy(ht.matrixWorld).invert();const Tt=et+pt,St=Ft+pt,Qt=Nt-Et,ce=Y+(Vt-Et),ae=Pt*Ft/St*Tt,se=It*Ft/St*Tt;ht.projectionMatrix.makePerspective(Qt,ce,ae,se,Tt,St)}(A,_,v):A.projectionMatrix.copy(_.projectionMatrix)},this.getCamera=function(){return A};let Q=null;const st=new xd;st.setAnimationLoop(function(nt,ct){if(h=ct.getViewerPose(a),h!==null){const At=h.views,ht=s.renderState.baseLayer;s.renderState.layers===void 0&&r.bindXRFramebuffer(ht.framebuffer);let gt=!1;At.length!==A.cameras.length&&(A.cameras.length=0,gt=!0);for(let Ut=0;Ut<At.length;Ut++){const Vt=At[Ut];let Zt=null;if(s.renderState.layers===void 0)Zt=ht.getViewport(Vt);else{const et=c.getViewSubImage(p,Vt);r.bindXRFramebuffer(u),e.framebufferTexture2D(36160,36064,3553,et.colorTexture,0),et.depthStencilTexture!==void 0&&e.framebufferTexture2D(36160,36096,3553,et.depthStencilTexture,0),Zt=et.viewport}const J=M[Ut];J.matrix.fromArray(Vt.transform.matrix),J.projectionMatrix.fromArray(Vt.projectionMatrix),J.viewport.set(Zt.x,Zt.y,Zt.width,Zt.height),Ut===0&&A.matrix.copy(J.matrix),gt===!0&&A.cameras.push(J)}}const Lt=s.inputSources;for(let At=0;At<f.length;At++){const ht=f[At],gt=Lt[At];ht.update(gt,ct,a)}Q&&Q(nt,ct)}),this.setAnimationLoop=function(nt){Q=nt},this.dispose=function(){}}}function Cx(i){function t(n,r){n.opacity.value=r.opacity,r.color&&n.diffuse.value.copy(r.color),r.emissive&&n.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),r.map&&(n.map.value=r.map),r.alphaMap&&(n.alphaMap.value=r.alphaMap),r.specularMap&&(n.specularMap.value=r.specularMap);const s=i.get(r).envMap;if(s){n.envMap.value=s,n.flipEnvMap.value=s.isCubeTexture&&s._needsFlipEnvMap?-1:1,n.reflectivity.value=r.reflectivity,n.refractionRatio.value=r.refractionRatio;const l=i.get(s).__maxMipLevel;l!==void 0&&(n.maxMipLevel.value=l)}let o,a;r.lightMap&&(n.lightMap.value=r.lightMap,n.lightMapIntensity.value=r.lightMapIntensity),r.aoMap&&(n.aoMap.value=r.aoMap,n.aoMapIntensity.value=r.aoMapIntensity),r.map?o=r.map:r.specularMap?o=r.specularMap:r.displacementMap?o=r.displacementMap:r.normalMap?o=r.normalMap:r.bumpMap?o=r.bumpMap:r.roughnessMap?o=r.roughnessMap:r.metalnessMap?o=r.metalnessMap:r.alphaMap?o=r.alphaMap:r.emissiveMap?o=r.emissiveMap:r.clearcoatMap?o=r.clearcoatMap:r.clearcoatNormalMap?o=r.clearcoatNormalMap:r.clearcoatRoughnessMap&&(o=r.clearcoatRoughnessMap),o!==void 0&&(o.isWebGLRenderTarget&&(o=o.texture),o.matrixAutoUpdate===!0&&o.updateMatrix(),n.uvTransform.value.copy(o.matrix)),r.aoMap?a=r.aoMap:r.lightMap&&(a=r.lightMap),a!==void 0&&(a.isWebGLRenderTarget&&(a=a.texture),a.matrixAutoUpdate===!0&&a.updateMatrix(),n.uv2Transform.value.copy(a.matrix))}function e(n,r){n.roughness.value=r.roughness,n.metalness.value=r.metalness,r.roughnessMap&&(n.roughnessMap.value=r.roughnessMap),r.metalnessMap&&(n.metalnessMap.value=r.metalnessMap),r.emissiveMap&&(n.emissiveMap.value=r.emissiveMap),r.bumpMap&&(n.bumpMap.value=r.bumpMap,n.bumpScale.value=r.bumpScale,r.side===1&&(n.bumpScale.value*=-1)),r.normalMap&&(n.normalMap.value=r.normalMap,n.normalScale.value.copy(r.normalScale),r.side===1&&n.normalScale.value.negate()),r.displacementMap&&(n.displacementMap.value=r.displacementMap,n.displacementScale.value=r.displacementScale,n.displacementBias.value=r.displacementBias),i.get(r).envMap&&(n.envMapIntensity.value=r.envMapIntensity)}return{refreshFogUniforms:function(n,r){n.fogColor.value.copy(r.color),r.isFog?(n.fogNear.value=r.near,n.fogFar.value=r.far):r.isFogExp2&&(n.fogDensity.value=r.density)},refreshMaterialUniforms:function(n,r,s,o,a){r.isMeshBasicMaterial?t(n,r):r.isMeshLambertMaterial?(t(n,r),function(l,h){h.emissiveMap&&(l.emissiveMap.value=h.emissiveMap)}(n,r)):r.isMeshToonMaterial?(t(n,r),function(l,h){h.gradientMap&&(l.gradientMap.value=h.gradientMap),h.emissiveMap&&(l.emissiveMap.value=h.emissiveMap),h.bumpMap&&(l.bumpMap.value=h.bumpMap,l.bumpScale.value=h.bumpScale,h.side===1&&(l.bumpScale.value*=-1)),h.normalMap&&(l.normalMap.value=h.normalMap,l.normalScale.value.copy(h.normalScale),h.side===1&&l.normalScale.value.negate()),h.displacementMap&&(l.displacementMap.value=h.displacementMap,l.displacementScale.value=h.displacementScale,l.displacementBias.value=h.displacementBias)}(n,r)):r.isMeshPhongMaterial?(t(n,r),function(l,h){l.specular.value.copy(h.specular),l.shininess.value=Math.max(h.shininess,1e-4),h.emissiveMap&&(l.emissiveMap.value=h.emissiveMap),h.bumpMap&&(l.bumpMap.value=h.bumpMap,l.bumpScale.value=h.bumpScale,h.side===1&&(l.bumpScale.value*=-1)),h.normalMap&&(l.normalMap.value=h.normalMap,l.normalScale.value.copy(h.normalScale),h.side===1&&l.normalScale.value.negate()),h.displacementMap&&(l.displacementMap.value=h.displacementMap,l.displacementScale.value=h.displacementScale,l.displacementBias.value=h.displacementBias)}(n,r)):r.isMeshStandardMaterial?(t(n,r),r.isMeshPhysicalMaterial?function(l,h,c){e(l,h),l.reflectivity.value=h.reflectivity,l.clearcoat.value=h.clearcoat,l.clearcoatRoughness.value=h.clearcoatRoughness,h.sheen&&l.sheen.value.copy(h.sheen),h.clearcoatMap&&(l.clearcoatMap.value=h.clearcoatMap),h.clearcoatRoughnessMap&&(l.clearcoatRoughnessMap.value=h.clearcoatRoughnessMap),h.clearcoatNormalMap&&(l.clearcoatNormalScale.value.copy(h.clearcoatNormalScale),l.clearcoatNormalMap.value=h.clearcoatNormalMap,h.side===1&&l.clearcoatNormalScale.value.negate()),l.transmission.value=h.transmission,h.transmissionMap&&(l.transmissionMap.value=h.transmissionMap),h.transmission>0&&(l.transmissionSamplerMap.value=c.texture,l.transmissionSamplerSize.value.set(c.width,c.height)),l.thickness.value=h.thickness,h.thicknessMap&&(l.thicknessMap.value=h.thicknessMap),l.attenuationDistance.value=h.attenuationDistance,l.attenuationColor.value.copy(h.attenuationColor)}(n,r,a):e(n,r)):r.isMeshMatcapMaterial?(t(n,r),function(l,h){h.matcap&&(l.matcap.value=h.matcap),h.bumpMap&&(l.bumpMap.value=h.bumpMap,l.bumpScale.value=h.bumpScale,h.side===1&&(l.bumpScale.value*=-1)),h.normalMap&&(l.normalMap.value=h.normalMap,l.normalScale.value.copy(h.normalScale),h.side===1&&l.normalScale.value.negate()),h.displacementMap&&(l.displacementMap.value=h.displacementMap,l.displacementScale.value=h.displacementScale,l.displacementBias.value=h.displacementBias)}(n,r)):r.isMeshDepthMaterial?(t(n,r),function(l,h){h.displacementMap&&(l.displacementMap.value=h.displacementMap,l.displacementScale.value=h.displacementScale,l.displacementBias.value=h.displacementBias)}(n,r)):r.isMeshDistanceMaterial?(t(n,r),function(l,h){h.displacementMap&&(l.displacementMap.value=h.displacementMap,l.displacementScale.value=h.displacementScale,l.displacementBias.value=h.displacementBias),l.referencePosition.value.copy(h.referencePosition),l.nearDistance.value=h.nearDistance,l.farDistance.value=h.farDistance}(n,r)):r.isMeshNormalMaterial?(t(n,r),function(l,h){h.bumpMap&&(l.bumpMap.value=h.bumpMap,l.bumpScale.value=h.bumpScale,h.side===1&&(l.bumpScale.value*=-1)),h.normalMap&&(l.normalMap.value=h.normalMap,l.normalScale.value.copy(h.normalScale),h.side===1&&l.normalScale.value.negate()),h.displacementMap&&(l.displacementMap.value=h.displacementMap,l.displacementScale.value=h.displacementScale,l.displacementBias.value=h.displacementBias)}(n,r)):r.isLineBasicMaterial?(function(l,h){l.diffuse.value.copy(h.color),l.opacity.value=h.opacity}(n,r),r.isLineDashedMaterial&&function(l,h){l.dashSize.value=h.dashSize,l.totalSize.value=h.dashSize+h.gapSize,l.scale.value=h.scale}(n,r)):r.isPointsMaterial?function(l,h,c,u){l.diffuse.value.copy(h.color),l.opacity.value=h.opacity,l.size.value=h.size*c,l.scale.value=.5*u,h.map&&(l.map.value=h.map),h.alphaMap&&(l.alphaMap.value=h.alphaMap);let p;h.map?p=h.map:h.alphaMap&&(p=h.alphaMap),p!==void 0&&(p.matrixAutoUpdate===!0&&p.updateMatrix(),l.uvTransform.value.copy(p.matrix))}(n,r,s,o):r.isSpriteMaterial?function(l,h){l.diffuse.value.copy(h.color),l.opacity.value=h.opacity,l.rotation.value=h.rotation,h.map&&(l.map.value=h.map),h.alphaMap&&(l.alphaMap.value=h.alphaMap);let c;h.map?c=h.map:h.alphaMap&&(c=h.alphaMap),c!==void 0&&(c.matrixAutoUpdate===!0&&c.updateMatrix(),l.uvTransform.value.copy(c.matrix))}(n,r):r.isShadowMaterial?(n.color.value.copy(r.color),n.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function ze(i={}){const t=i.canvas!==void 0?i.canvas:function(){const rt=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return rt.style.display="block",rt}(),e=i.context!==void 0?i.context:null,n=i.alpha!==void 0&&i.alpha,r=i.depth===void 0||i.depth,s=i.stencil===void 0||i.stencil,o=i.antialias!==void 0&&i.antialias,a=i.premultipliedAlpha===void 0||i.premultipliedAlpha,l=i.preserveDrawingBuffer!==void 0&&i.preserveDrawingBuffer,h=i.powerPreference!==void 0?i.powerPreference:"default",c=i.failIfMajorPerformanceCaveat!==void 0&&i.failIfMajorPerformanceCaveat;let u=null,p=null;const f=[],g=[];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=3e3,this.physicallyCorrectLights=!1,this.toneMapping=0,this.toneMappingExposure=1;const _=this;let v=!1,M=0,A=0,O=null,H=-1,j=null;const X=new at,U=new at;let V=null,xt=t.width,it=t.height,Q=1,st=null,nt=null;const ct=new at(0,0,xt,it),Lt=new at(0,0,xt,it);let At=!1;const ht=[],gt=new da;let Ut=!1,Vt=!1,Zt=null;const J=new W,et=new w,Ft={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Pt(){return O===null?Q:1}let It,Yt,qt,Nt,Y,pt,Et,Tt,St,Qt,ce,ae,se,we,vn,Ve,Ei,Ho,zo,jo,zn,$n,Jt=e;function V0(rt,Bt){for(let Mt=0;Mt<rt.length;Mt++){const Gt=rt[Mt],Kt=t.getContext(Gt,Bt);if(Kt!==null)return Kt}return null}try{const rt={alpha:n,depth:r,stencil:s,antialias:o,premultipliedAlpha:a,preserveDrawingBuffer:l,powerPreference:h,failIfMajorPerformanceCaveat:c};if(t.addEventListener("webglcontextlost",X0,!1),t.addEventListener("webglcontextrestored",Y0,!1),Jt===null){const Bt=["webgl2","webgl","experimental-webgl"];if(_.isWebGL1Renderer===!0&&Bt.shift(),Jt=V0(Bt,rt),Jt===null)throw V0(Bt)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}Jt.getShaderPrecisionFormat===void 0&&(Jt.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(rt){throw console.error("THREE.WebGLRenderer: "+rt.message),rt}function W0(){It=new dy(Jt),Yt=new hy(Jt,It,i),It.init(Yt),zn=new Mx(Jt,It,Yt),qt=new Tx(Jt,It,Yt),ht[0]=1029,Nt=new my,Y=new gx,pt=new Sx(Jt,It,qt,Y,Yt,zn,Nt),Et=new uy(_),Tt=new sy(Jt,Yt),$n=new ay(Jt,It,Tt,Yt),St=new py(Jt,Tt,Nt,$n),Qt=new yy(Jt,St,Tt,Nt),Ho=new _y(Jt),vn=new cy(Y),ce=new mx(_,Et,It,Yt,$n,vn),ae=new Cx(Y),se=new _x(Y),we=new wx(It,Yt),Ei=new oy(_,Et,qt,Qt,a),Ve=new Yd(_,Qt,Yt),zo=new ly(Jt,It,Nt,Yt),jo=new fy(Jt,It,Nt,Yt),Nt.programs=ce.programs,_.capabilities=Yt,_.extensions=It,_.properties=Y,_.renderLists=se,_.shadowMap=Ve,_.state=qt,_.info=Nt}W0();const ei=new Px(_,Jt);function X0(rt){rt.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),v=!0}function Y0(){console.log("THREE.WebGLRenderer: Context Restored."),v=!1;const rt=Nt.autoReset,Bt=Ve.enabled,Mt=Ve.autoUpdate,Gt=Ve.needsUpdate,Kt=Ve.type;W0(),Nt.autoReset=rt,Ve.enabled=Bt,Ve.autoUpdate=Mt,Ve.needsUpdate=Gt,Ve.type=Kt}function q0(rt){const Bt=rt.target;Bt.removeEventListener("dispose",q0),function(Mt){(function(Gt){const Kt=Y.get(Gt).programs;Kt!==void 0&&Kt.forEach(function(De){ce.releaseProgram(De)})})(Mt),Y.remove(Mt)}(Bt)}this.xr=ei,this.getContext=function(){return Jt},this.getContextAttributes=function(){return Jt.getContextAttributes()},this.forceContextLoss=function(){const rt=It.get("WEBGL_lose_context");rt&&rt.loseContext()},this.forceContextRestore=function(){const rt=It.get("WEBGL_lose_context");rt&&rt.restoreContext()},this.getPixelRatio=function(){return Q},this.setPixelRatio=function(rt){rt!==void 0&&(Q=rt,this.setSize(xt,it,!1))},this.getSize=function(rt){return rt.set(xt,it)},this.setSize=function(rt,Bt,Mt){ei.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(xt=rt,it=Bt,t.width=Math.floor(rt*Q),t.height=Math.floor(Bt*Q),Mt!==!1&&(t.style.width=rt+"px",t.style.height=Bt+"px"),this.setViewport(0,0,rt,Bt))},this.getDrawingBufferSize=function(rt){return rt.set(xt*Q,it*Q).floor()},this.setDrawingBufferSize=function(rt,Bt,Mt){xt=rt,it=Bt,Q=Mt,t.width=Math.floor(rt*Mt),t.height=Math.floor(Bt*Mt),this.setViewport(0,0,rt,Bt)},this.getCurrentViewport=function(rt){return rt.copy(X)},this.getViewport=function(rt){return rt.copy(ct)},this.setViewport=function(rt,Bt,Mt,Gt){rt.isVector4?ct.set(rt.x,rt.y,rt.z,rt.w):ct.set(rt,Bt,Mt,Gt),qt.viewport(X.copy(ct).multiplyScalar(Q).floor())},this.getScissor=function(rt){return rt.copy(Lt)},this.setScissor=function(rt,Bt,Mt,Gt){rt.isVector4?Lt.set(rt.x,rt.y,rt.z,rt.w):Lt.set(rt,Bt,Mt,Gt),qt.scissor(U.copy(Lt).multiplyScalar(Q).floor())},this.getScissorTest=function(){return At},this.setScissorTest=function(rt){qt.setScissorTest(At=rt)},this.setOpaqueSort=function(rt){st=rt},this.setTransparentSort=function(rt){nt=rt},this.getClearColor=function(rt){return rt.copy(Ei.getClearColor())},this.setClearColor=function(){Ei.setClearColor.apply(Ei,arguments)},this.getClearAlpha=function(){return Ei.getClearAlpha()},this.setClearAlpha=function(){Ei.setClearAlpha.apply(Ei,arguments)},this.clear=function(rt,Bt,Mt){let Gt=0;(rt===void 0||rt)&&(Gt|=16384),(Bt===void 0||Bt)&&(Gt|=256),(Mt===void 0||Mt)&&(Gt|=1024),Jt.clear(Gt)},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",X0,!1),t.removeEventListener("webglcontextrestored",Y0,!1),se.dispose(),we.dispose(),Y.dispose(),Et.dispose(),Qt.dispose(),$n.dispose(),ei.dispose(),ei.removeEventListener("sessionstart",$0),ei.removeEventListener("sessionend",Z0),Zt&&(Zt.dispose(),Zt=null),zr.stop()},this.renderBufferImmediate=function(rt,Bt){$n.initAttributes();const Mt=Y.get(rt);rt.hasPositions&&!Mt.position&&(Mt.position=Jt.createBuffer()),rt.hasNormals&&!Mt.normal&&(Mt.normal=Jt.createBuffer()),rt.hasUvs&&!Mt.uv&&(Mt.uv=Jt.createBuffer()),rt.hasColors&&!Mt.color&&(Mt.color=Jt.createBuffer());const Gt=Bt.getAttributes();rt.hasPositions&&(Jt.bindBuffer(34962,Mt.position),Jt.bufferData(34962,rt.positionArray,35048),$n.enableAttribute(Gt.position),Jt.vertexAttribPointer(Gt.position,3,5126,!1,0,0)),rt.hasNormals&&(Jt.bindBuffer(34962,Mt.normal),Jt.bufferData(34962,rt.normalArray,35048),$n.enableAttribute(Gt.normal),Jt.vertexAttribPointer(Gt.normal,3,5126,!1,0,0)),rt.hasUvs&&(Jt.bindBuffer(34962,Mt.uv),Jt.bufferData(34962,rt.uvArray,35048),$n.enableAttribute(Gt.uv),Jt.vertexAttribPointer(Gt.uv,2,5126,!1,0,0)),rt.hasColors&&(Jt.bindBuffer(34962,Mt.color),Jt.bufferData(34962,rt.colorArray,35048),$n.enableAttribute(Gt.color),Jt.vertexAttribPointer(Gt.color,3,5126,!1,0,0)),$n.disableUnusedAttributes(),Jt.drawArrays(4,0,rt.count),rt.count=0},this.renderBufferDirect=function(rt,Bt,Mt,Gt,Kt,De){Bt===null&&(Bt=Ft);const Ee=Kt.isMesh&&Kt.matrixWorld.determinant()<0,ee=Q0(rt,Bt,Gt,Kt);qt.setMaterial(Gt,Ee);let Te=Mt.index;const me=Mt.attributes.position;if(Te===null){if(me===void 0||me.count===0)return}else if(Te.count===0)return;let Ne,be=1;Gt.wireframe===!0&&(Te=St.getWireframeAttribute(Mt),be=2),(Gt.morphTargets||Gt.morphNormals)&&Ho.update(Kt,Mt,Gt,ee),$n.setup(Kt,Gt,ee,Mt,Te);let Pe=zo;Te!==null&&(Ne=Tt.get(Te),Pe=jo,Pe.setIndex(Ne));const fn=Te!==null?Te.count:me.count,$e=Mt.drawRange.start*be,wi=Mt.drawRange.count*be,We=De!==null?De.start*be:0,Ui=De!==null?De.count*be:1/0,_n=Math.max($e,We),ni=Math.min(fn,$e+wi,We+Ui)-1,Fn=Math.max(0,ni-_n+1);if(Fn!==0){if(Kt.isMesh)Gt.wireframe===!0?(qt.setLineWidth(Gt.wireframeLinewidth*Pt()),Pe.setMode(1)):Pe.setMode(4);else if(Kt.isLine){let Vo=Gt.linewidth;Vo===void 0&&(Vo=1),qt.setLineWidth(Vo*Pt()),Kt.isLineSegments?Pe.setMode(1):Kt.isLineLoop?Pe.setMode(2):Pe.setMode(3)}else Kt.isPoints?Pe.setMode(0):Kt.isSprite&&Pe.setMode(4);if(Kt.isInstancedMesh)Pe.renderInstances(_n,Fn,Kt.count);else if(Mt.isInstancedBufferGeometry){const Vo=Math.min(Mt.instanceCount,Mt._maxInstanceCount);Pe.renderInstances(_n,Fn,Vo)}else Pe.render(_n,Fn)}},this.compile=function(rt,Bt){p=we.get(rt),p.init(),rt.traverseVisible(function(Mt){Mt.isLight&&Mt.layers.test(Bt.layers)&&(p.pushLight(Mt),Mt.castShadow&&p.pushShadow(Mt))}),p.setupLights(),rt.traverse(function(Mt){const Gt=Mt.material;if(Gt)if(Array.isArray(Gt))for(let Kt=0;Kt<Gt.length;Kt++)ju(Gt[Kt],rt,Mt);else ju(Gt,rt,Mt)})};let zu=null;function $0(){zr.stop()}function Z0(){zr.start()}const zr=new xd;function Nl(rt,Bt,Mt){const Gt=Bt.isScene===!0?Bt.overrideMaterial:null;for(let Kt=0,De=rt.length;Kt<De;Kt++){const Ee=rt[Kt],ee=Ee.object,Te=Ee.geometry,me=Gt===null?Ee.material:Gt,Ne=Ee.group;if(Mt.isArrayCamera){const be=Mt.cameras;for(let Pe=0,fn=be.length;Pe<fn;Pe++){const $e=be[Pe];ee.layers.test($e.layers)&&(qt.viewport(X.copy($e.viewport)),p.setupLightsView($e),J0(ee,Bt,$e,Te,me,Ne))}}else J0(ee,Bt,Mt,Te,me,Ne)}}function J0(rt,Bt,Mt,Gt,Kt,De){if(rt.onBeforeRender(_,Bt,Mt,Gt,Kt,De),rt.modelViewMatrix.multiplyMatrices(Mt.matrixWorldInverse,rt.matrixWorld),rt.normalMatrix.getNormalMatrix(rt.modelViewMatrix),rt.isImmediateRenderObject){const Ee=Q0(Mt,Bt,Kt,rt);qt.setMaterial(Kt),$n.reset(),function(ee,Te){ee.render(function(me){_.renderBufferImmediate(me,Te)})}(rt,Ee)}else Kt.transparent===!0&&Kt.side===2?(Kt.side=1,Kt.needsUpdate=!0,_.renderBufferDirect(Mt,Bt,Gt,Kt,rt,De),Kt.side=0,Kt.needsUpdate=!0,_.renderBufferDirect(Mt,Bt,Gt,Kt,rt,De),Kt.side=2):_.renderBufferDirect(Mt,Bt,Gt,Kt,rt,De);rt.onAfterRender(_,Bt,Mt,Gt,Kt,De)}function ju(rt,Bt,Mt){Bt.isScene!==!0&&(Bt=Ft);const Gt=Y.get(rt),Kt=p.state.lights,De=p.state.shadowsArray,Ee=Kt.state.version,ee=ce.getParameters(rt,Kt.state,De,Bt,Mt),Te=ce.getProgramCacheKey(ee);let me=Gt.programs;Gt.environment=rt.isMeshStandardMaterial?Bt.environment:null,Gt.fog=Bt.fog,Gt.envMap=Et.get(rt.envMap||Gt.environment),me===void 0&&(rt.addEventListener("dispose",q0),me=new Map,Gt.programs=me);let Ne=me.get(Te);if(Ne!==void 0){if(Gt.currentProgram===Ne&&Gt.lightsStateVersion===Ee)return K0(rt,ee),Ne}else ee.uniforms=ce.getUniforms(rt),rt.onBuild(ee,_),rt.onBeforeCompile(ee,_),Ne=ce.acquireProgram(ee,Te),me.set(Te,Ne),Gt.uniforms=ee.uniforms;const be=Gt.uniforms;(rt.isShaderMaterial||rt.isRawShaderMaterial)&&rt.clipping!==!0||(be.clippingPlanes=vn.uniform),K0(rt,ee),Gt.needsLights=function($e){return $e.isMeshLambertMaterial||$e.isMeshToonMaterial||$e.isMeshPhongMaterial||$e.isMeshStandardMaterial||$e.isShadowMaterial||$e.isShaderMaterial&&$e.lights===!0}(rt),Gt.lightsStateVersion=Ee,Gt.needsLights&&(be.ambientLightColor.value=Kt.state.ambient,be.lightProbe.value=Kt.state.probe,be.directionalLights.value=Kt.state.directional,be.directionalLightShadows.value=Kt.state.directionalShadow,be.spotLights.value=Kt.state.spot,be.spotLightShadows.value=Kt.state.spotShadow,be.rectAreaLights.value=Kt.state.rectArea,be.ltc_1.value=Kt.state.rectAreaLTC1,be.ltc_2.value=Kt.state.rectAreaLTC2,be.pointLights.value=Kt.state.point,be.pointLightShadows.value=Kt.state.pointShadow,be.hemisphereLights.value=Kt.state.hemi,be.directionalShadowMap.value=Kt.state.directionalShadowMap,be.directionalShadowMatrix.value=Kt.state.directionalShadowMatrix,be.spotShadowMap.value=Kt.state.spotShadowMap,be.spotShadowMatrix.value=Kt.state.spotShadowMatrix,be.pointShadowMap.value=Kt.state.pointShadowMap,be.pointShadowMatrix.value=Kt.state.pointShadowMatrix);const Pe=Ne.getUniforms(),fn=or.seqWithValue(Pe.seq,be);return Gt.currentProgram=Ne,Gt.uniformsList=fn,Ne}function K0(rt,Bt){const Mt=Y.get(rt);Mt.outputEncoding=Bt.outputEncoding,Mt.instancing=Bt.instancing,Mt.skinning=Bt.skinning,Mt.numClippingPlanes=Bt.numClippingPlanes,Mt.numIntersection=Bt.numClipIntersection,Mt.vertexAlphas=Bt.vertexAlphas}function Q0(rt,Bt,Mt,Gt){Bt.isScene!==!0&&(Bt=Ft),pt.resetTextureUnits();const Kt=Bt.fog,De=Mt.isMeshStandardMaterial?Bt.environment:null,Ee=O===null?_.outputEncoding:O.texture.encoding,ee=Et.get(Mt.envMap||De),Te=Mt.vertexColors===!0&&Gt.geometry&&Gt.geometry.attributes.color&&Gt.geometry.attributes.color.itemSize===4,me=Y.get(Mt),Ne=p.state.lights;if(Ut===!0&&(Vt===!0||rt!==j)){const Fn=rt===j&&Mt.id===H;vn.setState(Mt,rt,Fn)}let be=!1;Mt.version===me.__version?me.needsLights&&me.lightsStateVersion!==Ne.state.version||me.outputEncoding!==Ee||Gt.isInstancedMesh&&me.instancing===!1?be=!0:Gt.isInstancedMesh||me.instancing!==!0?Gt.isSkinnedMesh&&me.skinning===!1?be=!0:Gt.isSkinnedMesh||me.skinning!==!0?me.envMap!==ee||Mt.fog&&me.fog!==Kt?be=!0:me.numClippingPlanes===void 0||me.numClippingPlanes===vn.numPlanes&&me.numIntersection===vn.numIntersection?me.vertexAlphas!==Te&&(be=!0):be=!0:be=!0:be=!0:(be=!0,me.__version=Mt.version);let Pe=me.currentProgram;be===!0&&(Pe=ju(Mt,Bt,Gt));let fn=!1,$e=!1,wi=!1;const We=Pe.getUniforms(),Ui=me.uniforms;if(qt.useProgram(Pe.program)&&(fn=!0,$e=!0,wi=!0),Mt.id!==H&&(H=Mt.id,$e=!0),fn||j!==rt){if(We.setValue(Jt,"projectionMatrix",rt.projectionMatrix),Yt.logarithmicDepthBuffer&&We.setValue(Jt,"logDepthBufFC",2/(Math.log(rt.far+1)/Math.LN2)),j!==rt&&(j=rt,$e=!0,wi=!0),Mt.isShaderMaterial||Mt.isMeshPhongMaterial||Mt.isMeshToonMaterial||Mt.isMeshStandardMaterial||Mt.envMap){const Fn=We.map.cameraPosition;Fn!==void 0&&Fn.setValue(Jt,et.setFromMatrixPosition(rt.matrixWorld))}(Mt.isMeshPhongMaterial||Mt.isMeshToonMaterial||Mt.isMeshLambertMaterial||Mt.isMeshBasicMaterial||Mt.isMeshStandardMaterial||Mt.isShaderMaterial)&&We.setValue(Jt,"isOrthographic",rt.isOrthographicCamera===!0),(Mt.isMeshPhongMaterial||Mt.isMeshToonMaterial||Mt.isMeshLambertMaterial||Mt.isMeshBasicMaterial||Mt.isMeshStandardMaterial||Mt.isShaderMaterial||Mt.isShadowMaterial||Gt.isSkinnedMesh)&&We.setValue(Jt,"viewMatrix",rt.matrixWorldInverse)}if(Gt.isSkinnedMesh){We.setOptional(Jt,Gt,"bindMatrix"),We.setOptional(Jt,Gt,"bindMatrixInverse");const Fn=Gt.skeleton;Fn&&(Yt.floatVertexTextures?(Fn.boneTexture===null&&Fn.computeBoneTexture(),We.setValue(Jt,"boneTexture",Fn.boneTexture,pt),We.setValue(Jt,"boneTextureSize",Fn.boneTextureSize)):We.setOptional(Jt,Fn,"boneMatrices"))}var _n,ni;return($e||me.receiveShadow!==Gt.receiveShadow)&&(me.receiveShadow=Gt.receiveShadow,We.setValue(Jt,"receiveShadow",Gt.receiveShadow)),$e&&(We.setValue(Jt,"toneMappingExposure",_.toneMappingExposure),me.needsLights&&(ni=wi,(_n=Ui).ambientLightColor.needsUpdate=ni,_n.lightProbe.needsUpdate=ni,_n.directionalLights.needsUpdate=ni,_n.directionalLightShadows.needsUpdate=ni,_n.pointLights.needsUpdate=ni,_n.pointLightShadows.needsUpdate=ni,_n.spotLights.needsUpdate=ni,_n.spotLightShadows.needsUpdate=ni,_n.rectAreaLights.needsUpdate=ni,_n.hemisphereLights.needsUpdate=ni),Kt&&Mt.fog&&ae.refreshFogUniforms(Ui,Kt),ae.refreshMaterialUniforms(Ui,Mt,Q,it,Zt),or.upload(Jt,me.uniformsList,Ui,pt)),Mt.isShaderMaterial&&Mt.uniformsNeedUpdate===!0&&(or.upload(Jt,me.uniformsList,Ui,pt),Mt.uniformsNeedUpdate=!1),Mt.isSpriteMaterial&&We.setValue(Jt,"center",Gt.center),We.setValue(Jt,"modelViewMatrix",Gt.modelViewMatrix),We.setValue(Jt,"normalMatrix",Gt.normalMatrix),We.setValue(Jt,"modelMatrix",Gt.matrixWorld),Pe}zr.setAnimationLoop(function(rt){zu&&zu(rt)}),typeof window!="undefined"&&zr.setContext(window),this.setAnimationLoop=function(rt){zu=rt,ei.setAnimationLoop(rt),rt===null?zr.stop():zr.start()},ei.addEventListener("sessionstart",$0),ei.addEventListener("sessionend",Z0),this.render=function(rt,Bt){if(Bt!==void 0&&Bt.isCamera!==!0)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(v===!0)return;rt.autoUpdate===!0&&rt.updateMatrixWorld(),Bt.parent===null&&Bt.updateMatrixWorld(),ei.enabled===!0&&ei.isPresenting===!0&&(ei.cameraAutoUpdate===!0&&ei.updateCamera(Bt),Bt=ei.getCamera()),rt.isScene===!0&&rt.onBeforeRender(_,rt,Bt,O),p=we.get(rt,g.length),p.init(),g.push(p),J.multiplyMatrices(Bt.projectionMatrix,Bt.matrixWorldInverse),gt.setFromProjectionMatrix(J),Vt=this.localClippingEnabled,Ut=vn.init(this.clippingPlanes,Vt,Bt),u=se.get(rt,f.length),u.init(),f.push(u),function Ee(ee,Te,me,Ne){if(ee.visible===!1)return;if(ee.layers.test(Te.layers)){if(ee.isGroup)me=ee.renderOrder;else if(ee.isLOD)ee.autoUpdate===!0&&ee.update(Te);else if(ee.isLight)p.pushLight(ee),ee.castShadow&&p.pushShadow(ee);else if(ee.isSprite){if(!ee.frustumCulled||gt.intersectsSprite(ee)){Ne&&et.setFromMatrixPosition(ee.matrixWorld).applyMatrix4(J);const Pe=Qt.update(ee),fn=ee.material;fn.visible&&u.push(ee,Pe,fn,me,et.z,null)}}else if(ee.isImmediateRenderObject)Ne&&et.setFromMatrixPosition(ee.matrixWorld).applyMatrix4(J),u.push(ee,null,ee.material,me,et.z,null);else if((ee.isMesh||ee.isLine||ee.isPoints)&&(ee.isSkinnedMesh&&ee.skeleton.frame!==Nt.render.frame&&(ee.skeleton.update(),ee.skeleton.frame=Nt.render.frame),!ee.frustumCulled||gt.intersectsObject(ee))){Ne&&et.setFromMatrixPosition(ee.matrixWorld).applyMatrix4(J);const Pe=Qt.update(ee),fn=ee.material;if(Array.isArray(fn)){const $e=Pe.groups;for(let wi=0,We=$e.length;wi<We;wi++){const Ui=$e[wi],_n=fn[Ui.materialIndex];_n&&_n.visible&&u.push(ee,Pe,_n,me,et.z,Ui)}}else fn.visible&&u.push(ee,Pe,fn,me,et.z,null)}}const be=ee.children;for(let Pe=0,fn=be.length;Pe<fn;Pe++)Ee(be[Pe],Te,me,Ne)}(rt,Bt,0,_.sortObjects),u.finish(),_.sortObjects===!0&&u.sort(st,nt),Ut===!0&&vn.beginShadows();const Mt=p.state.shadowsArray;Ve.render(Mt,rt,Bt),p.setupLights(),p.setupLightsView(Bt),Ut===!0&&vn.endShadows(),this.info.autoReset===!0&&this.info.reset(),Ei.render(u,rt);const Gt=u.opaque,Kt=u.transmissive,De=u.transparent;Gt.length>0&&Nl(Gt,rt,Bt),Kt.length>0&&function(Ee,ee,Te,me){if(Zt===null){const Pe=o===!0&&Yt.isWebGL2===!0;Zt=new(Pe?tt:$)(1024,1024,{generateMipmaps:!0,type:zn.convert(1016)!==null?1016:1009,minFilter:1008,magFilter:1003,wrapS:1001,wrapT:1001})}const Ne=_.getRenderTarget();_.setRenderTarget(Zt),_.clear();const be=_.toneMapping;_.toneMapping=0,Nl(Ee,Te,me),_.toneMapping=be,pt.updateMultisampleRenderTarget(Zt),pt.updateRenderTargetMipmap(Zt),_.setRenderTarget(Ne),Nl(ee,Te,me)}(Gt,Kt,rt,Bt),De.length>0&&Nl(De,rt,Bt),O!==null&&(pt.updateMultisampleRenderTarget(O),pt.updateRenderTargetMipmap(O)),rt.isScene===!0&&rt.onAfterRender(_,rt,Bt),qt.buffers.depth.setTest(!0),qt.buffers.depth.setMask(!0),qt.buffers.color.setMask(!0),qt.setPolygonOffset(!1),$n.resetDefaultState(),H=-1,j=null,g.pop(),p=g.length>0?g[g.length-1]:null,f.pop(),u=f.length>0?f[f.length-1]:null},this.getActiveCubeFace=function(){return M},this.getActiveMipmapLevel=function(){return A},this.getRenderTarget=function(){return O},this.setRenderTarget=function(rt,Bt=0,Mt=0){O=rt,M=Bt,A=Mt,rt&&Y.get(rt).__webglFramebuffer===void 0&&pt.setupRenderTarget(rt);let Gt=null,Kt=!1,De=!1;if(rt){const Ee=rt.texture;(Ee.isDataTexture3D||Ee.isDataTexture2DArray)&&(De=!0);const ee=Y.get(rt).__webglFramebuffer;rt.isWebGLCubeRenderTarget?(Gt=ee[Bt],Kt=!0):Gt=rt.isWebGLMultisampleRenderTarget?Y.get(rt).__webglMultisampledFramebuffer:ee,X.copy(rt.viewport),U.copy(rt.scissor),V=rt.scissorTest}else X.copy(ct).multiplyScalar(Q).floor(),U.copy(Lt).multiplyScalar(Q).floor(),V=At;if(qt.bindFramebuffer(36160,Gt)&&Yt.drawBuffers){let Ee=!1;if(rt)if(rt.isWebGLMultipleRenderTargets){const ee=rt.texture;if(ht.length!==ee.length||ht[0]!==36064){for(let Te=0,me=ee.length;Te<me;Te++)ht[Te]=36064+Te;ht.length=ee.length,Ee=!0}}else ht.length===1&&ht[0]===36064||(ht[0]=36064,ht.length=1,Ee=!0);else ht.length===1&&ht[0]===1029||(ht[0]=1029,ht.length=1,Ee=!0);Ee&&(Yt.isWebGL2?Jt.drawBuffers(ht):It.get("WEBGL_draw_buffers").drawBuffersWEBGL(ht))}if(qt.viewport(X),qt.scissor(U),qt.setScissorTest(V),Kt){const Ee=Y.get(rt.texture);Jt.framebufferTexture2D(36160,36064,34069+Bt,Ee.__webglTexture,Mt)}else if(De){const Ee=Y.get(rt.texture),ee=Bt||0;Jt.framebufferTextureLayer(36160,36064,Ee.__webglTexture,Mt||0,ee)}},this.readRenderTargetPixels=function(rt,Bt,Mt,Gt,Kt,De,Ee){if(!rt||!rt.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let ee=Y.get(rt).__webglFramebuffer;if(rt.isWebGLCubeRenderTarget&&Ee!==void 0&&(ee=ee[Ee]),ee){qt.bindFramebuffer(36160,ee);try{const Te=rt.texture,me=Te.format,Ne=Te.type;if(me!==1023&&zn.convert(me)!==Jt.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const be=Ne===1016&&(It.has("EXT_color_buffer_half_float")||Yt.isWebGL2&&It.has("EXT_color_buffer_float"));if(!(Ne===1009||zn.convert(Ne)===Jt.getParameter(35738)||Ne===1015&&(Yt.isWebGL2||It.has("OES_texture_float")||It.has("WEBGL_color_buffer_float"))||be))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");Jt.checkFramebufferStatus(36160)===36053?Bt>=0&&Bt<=rt.width-Gt&&Mt>=0&&Mt<=rt.height-Kt&&Jt.readPixels(Bt,Mt,Gt,Kt,zn.convert(me),zn.convert(Ne),De):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const Te=O!==null?Y.get(O).__webglFramebuffer:null;qt.bindFramebuffer(36160,Te)}}},this.copyFramebufferToTexture=function(rt,Bt,Mt=0){const Gt=Math.pow(2,-Mt),Kt=Math.floor(Bt.image.width*Gt),De=Math.floor(Bt.image.height*Gt);let Ee=zn.convert(Bt.format);Yt.isWebGL2&&(Ee===6407&&(Ee=32849),Ee===6408&&(Ee=32856)),pt.setTexture2D(Bt,0),Jt.copyTexImage2D(3553,Mt,Ee,rt.x,rt.y,Kt,De,0),qt.unbindTexture()},this.copyTextureToTexture=function(rt,Bt,Mt,Gt=0){const Kt=Bt.image.width,De=Bt.image.height,Ee=zn.convert(Mt.format),ee=zn.convert(Mt.type);pt.setTexture2D(Mt,0),Jt.pixelStorei(37440,Mt.flipY),Jt.pixelStorei(37441,Mt.premultiplyAlpha),Jt.pixelStorei(3317,Mt.unpackAlignment),Bt.isDataTexture?Jt.texSubImage2D(3553,Gt,rt.x,rt.y,Kt,De,Ee,ee,Bt.image.data):Bt.isCompressedTexture?Jt.compressedTexSubImage2D(3553,Gt,rt.x,rt.y,Bt.mipmaps[0].width,Bt.mipmaps[0].height,Ee,Bt.mipmaps[0].data):Jt.texSubImage2D(3553,Gt,rt.x,rt.y,Ee,ee,Bt.image),Gt===0&&Mt.generateMipmaps&&Jt.generateMipmap(3553),qt.unbindTexture()},this.copyTextureToTexture3D=function(rt,Bt,Mt,Gt,Kt=0){if(_.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const De=rt.max.x-rt.min.x+1,Ee=rt.max.y-rt.min.y+1,ee=rt.max.z-rt.min.z+1,Te=zn.convert(Gt.format),me=zn.convert(Gt.type);let Ne;if(Gt.isDataTexture3D)pt.setTexture3D(Gt,0),Ne=32879;else{if(!Gt.isDataTexture2DArray)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");pt.setTexture2DArray(Gt,0),Ne=35866}Jt.pixelStorei(37440,Gt.flipY),Jt.pixelStorei(37441,Gt.premultiplyAlpha),Jt.pixelStorei(3317,Gt.unpackAlignment);const be=Jt.getParameter(3314),Pe=Jt.getParameter(32878),fn=Jt.getParameter(3316),$e=Jt.getParameter(3315),wi=Jt.getParameter(32877),We=Mt.isCompressedTexture?Mt.mipmaps[0]:Mt.image;Jt.pixelStorei(3314,We.width),Jt.pixelStorei(32878,We.height),Jt.pixelStorei(3316,rt.min.x),Jt.pixelStorei(3315,rt.min.y),Jt.pixelStorei(32877,rt.min.z),Mt.isDataTexture||Mt.isDataTexture3D?Jt.texSubImage3D(Ne,Kt,Bt.x,Bt.y,Bt.z,De,Ee,ee,Te,me,We.data):Mt.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),Jt.compressedTexSubImage3D(Ne,Kt,Bt.x,Bt.y,Bt.z,De,Ee,ee,Te,We.data)):Jt.texSubImage3D(Ne,Kt,Bt.x,Bt.y,Bt.z,De,Ee,ee,Te,me,We),Jt.pixelStorei(3314,be),Jt.pixelStorei(32878,Pe),Jt.pixelStorei(3316,fn),Jt.pixelStorei(3315,$e),Jt.pixelStorei(32877,wi),Kt===0&&Gt.generateMipmaps&&Jt.generateMipmap(Ne),qt.unbindTexture()},this.initTexture=function(rt){pt.setTexture2D(rt,0),qt.unbindTexture()},this.resetState=function(){M=0,A=0,O=null,qt.reset(),$n.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}(class extends ze{}).prototype.isWebGL1Renderer=!0;class hh extends ke{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return this.fog!==null&&(e.object.fog=this.fog.toJSON()),e}}hh.prototype.isScene=!0;class zs{constructor(t,e){this.array=t,this.stride=e,this.count=t!==void 0?t.length/e:0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=K()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,n){t*=this.stride,n*=e.stride;for(let r=0,s=this.stride;r<s;r++)this.array[t+r]=e.array[n+r];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=K()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(e,this.stride);return n.setUsage(this.usage),n}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=K()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.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}}}zs.prototype.isInterleavedBuffer=!0;const hn=new w;class js{constructor(t,e,n,r=!1){this.name="",this.data=t,this.itemSize=e,this.offset=n,this.normalized=r===!0}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,n=this.data.count;e<n;e++)hn.x=this.getX(e),hn.y=this.getY(e),hn.z=this.getZ(e),hn.applyMatrix4(t),this.setXYZ(e,hn.x,hn.y,hn.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)hn.x=this.getX(e),hn.y=this.getY(e),hn.z=this.getZ(e),hn.applyNormalMatrix(t),this.setXYZ(e,hn.x,hn.y,hn.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)hn.x=this.getX(e),hn.y=this.getY(e),hn.z=this.getZ(e),hn.transformDirection(t),this.setXYZ(e,hn.x,hn.y,hn.z);return this}setX(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){return this.data.array[t*this.data.stride+this.offset]}getY(t){return this.data.array[t*this.data.stride+this.offset+1]}getZ(t){return this.data.array[t*this.data.stride+this.offset+2]}getW(t){return this.data.array[t*this.data.stride+this.offset+3]}setXY(t,e,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this}setXYZ(t,e,n,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this}setXYZW(t,e,n,r,s){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this.data.array[t+3]=s,this}clone(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");const e=[];for(let n=0;n<this.count;n++){const r=n*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)e.push(this.data.array[r+s])}return new an(new this.array.constructor(e),this.itemSize,this.normalized)}return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new js(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");const e=[];for(let n=0;n<this.count;n++){const r=n*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)e.push(this.data.array[r+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}js.prototype.isInterleavedBufferAttribute=!0;class $d extends Rn{constructor(t){super(),this.type="SpriteMaterial",this.color=new _e(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this}}let Kr;$d.prototype.isSpriteMaterial=!0;const Vs=new w,Qr=new w,ts=new w,es=new F,Ws=new F,Zd=new W,fa=new w,Xs=new w,ma=new w,Jd=new F,ch=new F,Kd=new F;class Ix extends ke{constructor(t){if(super(),this.type="Sprite",Kr===void 0){Kr=new He;const e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new zs(e,5);Kr.setIndex([0,1,2,0,2,3]),Kr.setAttribute("position",new js(n,3,0,!1)),Kr.setAttribute("uv",new js(n,2,3,!1))}this.geometry=Kr,this.material=t!==void 0?t:new $d,this.center=new F(.5,.5)}raycast(t,e){t.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Qr.setFromMatrixScale(this.matrixWorld),Zd.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),ts.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Qr.multiplyScalar(-ts.z);const n=this.material.rotation;let r,s;n!==0&&(s=Math.cos(n),r=Math.sin(n));const o=this.center;ga(fa.set(-.5,-.5,0),ts,o,Qr,r,s),ga(Xs.set(.5,-.5,0),ts,o,Qr,r,s),ga(ma.set(.5,.5,0),ts,o,Qr,r,s),Jd.set(0,0),ch.set(1,0),Kd.set(1,1);let a=t.ray.intersectTriangle(fa,Xs,ma,!1,Vs);if(a===null&&(ga(Xs.set(-.5,.5,0),ts,o,Qr,r,s),ch.set(0,1),a=t.ray.intersectTriangle(fa,ma,Xs,!1,Vs),a===null))return;const l=t.ray.origin.distanceTo(Vs);l<t.near||l>t.far||e.push({distance:l,point:Vs.clone(),uv:pn.getUV(Vs,fa,Xs,ma,Jd,ch,Kd,new F),face:null,object:this})}copy(t){return super.copy(t),t.center!==void 0&&this.center.copy(t.center),this.material=t.material,this}}function ga(i,t,e,n,r,s){es.subVectors(i,e).addScalar(.5).multiply(n),r!==void 0?(Ws.x=s*es.x-r*es.y,Ws.y=r*es.x+s*es.y):Ws.copy(es),i.copy(t),i.x+=Ws.x,i.y+=Ws.y,i.applyMatrix4(Zd)}Ix.prototype.isSprite=!0;const Qd=new w,tp=new at,ep=new at,Rx=new w,np=new W;class ip extends kn{constructor(t,e){super(t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new W,this.bindMatrixInverse=new W}copy(t){return super.copy(t),this.bindMode=t.bindMode,this.bindMatrix.copy(t.bindMatrix),this.bindMatrixInverse.copy(t.bindMatrixInverse),this.skeleton=t.skeleton,this}bind(t,e){this.skeleton=t,e===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.copy(e).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const t=new at,e=this.geometry.attributes.skinWeight;for(let n=0,r=e.count;n<r;n++){t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.w=e.getW(n);const s=1/t.manhattanLength();s!==1/0?t.multiplyScalar(s):t.set(1,0,0,0),e.setXYZW(n,t.x,t.y,t.z,t.w)}}updateMatrixWorld(t){super.updateMatrixWorld(t),this.bindMode==="attached"?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode==="detached"?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(t,e){const n=this.skeleton,r=this.geometry;tp.fromBufferAttribute(r.attributes.skinIndex,t),ep.fromBufferAttribute(r.attributes.skinWeight,t),Qd.fromBufferAttribute(r.attributes.position,t).applyMatrix4(this.bindMatrix),e.set(0,0,0);for(let s=0;s<4;s++){const o=ep.getComponent(s);if(o!==0){const a=tp.getComponent(s);np.multiplyMatrices(n.bones[a].matrixWorld,n.boneInverses[a]),e.addScaledVector(Rx.copy(Qd).applyMatrix4(np),o)}}return e.applyMatrix4(this.bindMatrixInverse)}}ip.prototype.isSkinnedMesh=!0;class Lx extends ke{constructor(){super(),this.type="Bone"}}Lx.prototype.isBone=!0;class rp extends Rt{constructor(t=null,e=1,n=1,r,s,o,a,l,h=1003,c=1003,u,p){super(null,o,a,l,h,c,r,s,u,p),this.image={data:t,width:e,height:n},this.magFilter=h,this.minFilter=c,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}rp.prototype.isDataTexture=!0;const sp=new W,op=new W,va=[],Ys=new kn;class Nx extends kn{constructor(t,e,n){super(t,e),this.instanceMatrix=new an(new Float32Array(16*n),16),this.instanceColor=null,this.count=n,this.frustumCulled=!1}copy(t){return super.copy(t),this.instanceMatrix.copy(t.instanceMatrix),t.instanceColor!==null&&(this.instanceColor=t.instanceColor.clone()),this.count=t.count,this}getColorAt(t,e){e.fromArray(this.instanceColor.array,3*t)}getMatrixAt(t,e){e.fromArray(this.instanceMatrix.array,16*t)}raycast(t,e){const n=this.matrixWorld,r=this.count;if(Ys.geometry=this.geometry,Ys.material=this.material,Ys.material!==void 0)for(let s=0;s<r;s++){this.getMatrixAt(s,sp),op.multiplyMatrices(n,sp),Ys.matrixWorld=op,Ys.raycast(t,va);for(let o=0,a=va.length;o<a;o++){const l=va[o];l.instanceId=s,l.object=this,e.push(l)}va.length=0}}setColorAt(t,e){this.instanceColor===null&&(this.instanceColor=new an(new Float32Array(3*this.count),3)),e.toArray(this.instanceColor.array,3*t)}setMatrixAt(t,e){e.toArray(this.instanceMatrix.array,16*t)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}Nx.prototype.isInstancedMesh=!0;class qs extends Rn{constructor(t){super(),this.type="LineBasicMaterial",this.color=new _e(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.morphTargets=!1,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.morphTargets=t.morphTargets,this}}qs.prototype.isLineBasicMaterial=!0;const ap=new w,lp=new w,hp=new W,uh=new z,_a=new je;class dh extends ke{constructor(t=new He,e=new qs){super(),this.type="Line",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t){return super.copy(t),this.material=t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(t.isBufferGeometry)if(t.index===null){const e=t.attributes.position,n=[0];for(let r=1,s=e.count;r<s;r++)ap.fromBufferAttribute(e,r-1),lp.fromBufferAttribute(e,r),n[r]=n[r-1],n[r]+=ap.distanceTo(lp);t.setAttribute("lineDistance",new Fe(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else t.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}raycast(t,e){const n=this.geometry,r=this.matrixWorld,s=t.params.Line.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),_a.copy(n.boundingSphere),_a.applyMatrix4(r),_a.radius+=s,t.ray.intersectsSphere(_a)===!1)return;hp.copy(r).invert(),uh.copy(t.ray).applyMatrix4(hp);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,h=new w,c=new w,u=new w,p=new w,f=this.isLineSegments?2:1;if(n.isBufferGeometry){const g=n.index,_=n.attributes.position;if(g!==null)for(let v=Math.max(0,o.start),M=Math.min(g.count,o.start+o.count)-1;v<M;v+=f){const A=g.getX(v),O=g.getX(v+1);if(h.fromBufferAttribute(_,A),c.fromBufferAttribute(_,O),uh.distanceSqToSegment(h,c,p,u)>l)continue;p.applyMatrix4(this.matrixWorld);const H=t.ray.origin.distanceTo(p);H<t.near||H>t.far||e.push({distance:H,point:u.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}else for(let v=Math.max(0,o.start),M=Math.min(_.count,o.start+o.count)-1;v<M;v+=f){if(h.fromBufferAttribute(_,v),c.fromBufferAttribute(_,v+1),uh.distanceSqToSegment(h,c,p,u)>l)continue;p.applyMatrix4(this.matrixWorld);const A=t.ray.origin.distanceTo(p);A<t.near||A>t.far||e.push({distance:A,point:u.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,n=Object.keys(e);if(n.length>0){const r=e[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const a=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}else{const e=t.morphTargets;e!==void 0&&e.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}dh.prototype.isLine=!0;const cp=new w,up=new w;class ph extends dh{constructor(t,e){super(t,e),this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(t.isBufferGeometry)if(t.index===null){const e=t.attributes.position,n=[];for(let r=0,s=e.count;r<s;r+=2)cp.fromBufferAttribute(e,r),up.fromBufferAttribute(e,r+1),n[r]=r===0?0:n[r-1],n[r+1]=n[r]+cp.distanceTo(up);t.setAttribute("lineDistance",new Fe(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else t.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}}ph.prototype.isLineSegments=!0;class Ox extends dh{constructor(t,e){super(t,e),this.type="LineLoop"}}Ox.prototype.isLineLoop=!0;class dp extends Rn{constructor(t){super(),this.type="PointsMaterial",this.color=new _e(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.morphTargets=t.morphTargets,this}}dp.prototype.isPointsMaterial=!0;const pp=new W,fh=new z,ya=new je,xa=new w;class Dx extends ke{constructor(t=new He,e=new dp){super(),this.type="Points",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t){return super.copy(t),this.material=t.material,this.geometry=t.geometry,this}raycast(t,e){const n=this.geometry,r=this.matrixWorld,s=t.params.Points.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),ya.copy(n.boundingSphere),ya.applyMatrix4(r),ya.radius+=s,t.ray.intersectsSphere(ya)===!1)return;pp.copy(r).invert(),fh.copy(t.ray).applyMatrix4(pp);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a;if(n.isBufferGeometry){const h=n.index,c=n.attributes.position;if(h!==null)for(let u=Math.max(0,o.start),p=Math.min(h.count,o.start+o.count);u<p;u++){const f=h.getX(u);xa.fromBufferAttribute(c,f),fp(xa,f,l,r,t,e,this)}else for(let u=Math.max(0,o.start),p=Math.min(c.count,o.start+o.count);u<p;u++)xa.fromBufferAttribute(c,u),fp(xa,u,l,r,t,e,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,n=Object.keys(e);if(n.length>0){const r=e[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const a=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}else{const e=t.morphTargets;e!==void 0&&e.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function fp(i,t,e,n,r,s,o){const a=fh.distanceSqToPoint(i);if(a<e){const l=new w;fh.closestPointToPoint(i,l),l.applyMatrix4(n);const h=r.ray.origin.distanceTo(l);if(h<r.near||h>r.far)return;s.push({distance:h,distanceToRay:Math.sqrt(a),point:l,index:t,face:null,object:o})}}Dx.prototype.isPoints=!0,class extends Rt{constructor(i,t,e,n,r,s,o,a,l){super(i,t,e,n,r,s,o,a,l),this.format=o!==void 0?o:1022,this.minFilter=s!==void 0?s:1006,this.magFilter=r!==void 0?r:1006,this.generateMipmaps=!1;const h=this;"requestVideoFrameCallback"in i&&i.requestVideoFrameCallback(function c(){h.needsUpdate=!0,i.requestVideoFrameCallback(c)})}clone(){return new this.constructor(this.image).copy(this)}update(){const i=this.image;!("requestVideoFrameCallback"in i)&&i.readyState>=i.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}.prototype.isVideoTexture=!0;class Fx extends Rt{constructor(t,e,n,r,s,o,a,l,h,c,u,p){super(null,o,a,l,h,c,r,s,u,p),this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}Fx.prototype.isCompressedTexture=!0;class mh extends Rt{constructor(t,e,n,r,s,o,a,l,h){super(t,e,n,r,s,o,a,l,h),this.needsUpdate=!0}}mh.prototype.isCanvasTexture=!0,class extends Rt{constructor(i,t,e,n,r,s,o,a,l,h){if((h=h!==void 0?h:1026)!==1026&&h!==1027)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");e===void 0&&h===1026&&(e=1012),e===void 0&&h===1027&&(e=1020),super(null,n,r,s,o,a,h,e,l),this.image={width:i,height:t},this.magFilter=o!==void 0?o:1003,this.minFilter=a!==void 0?a:1003,this.flipY=!1,this.generateMipmaps=!1}}.prototype.isDepthTexture=!0,new w,new w,new w,new pn;class si{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const n=this.getUtoTmapping(t);return this.getPoint(n,e)}getPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return e}getSpacedPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let n,r=this.getPoint(0),s=0;e.push(0);for(let o=1;o<=t;o++)n=this.getPoint(o/t),s+=n.distanceTo(r),e.push(s),r=n;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const n=this.getLengths();let r=0;const s=n.length;let o;o=e||t*n[s-1];let a,l=0,h=s-1;for(;l<=h;)if(r=Math.floor(l+(h-l)/2),a=n[r]-o,a<0)l=r+1;else{if(!(a>0)){h=r;break}h=r-1}if(r=h,n[r]===o)return r/(s-1);const c=n[r];return(r+(o-c)/(n[r+1]-c))/(s-1)}getTangent(t,e){let n=t-1e-4,r=t+1e-4;n<0&&(n=0),r>1&&(r=1);const s=this.getPoint(n),o=this.getPoint(r),a=e||(s.isVector2?new F:new w);return a.copy(o).sub(s).normalize(),a}getTangentAt(t,e){const n=this.getUtoTmapping(t);return this.getTangent(n,e)}computeFrenetFrames(t,e){const n=new w,r=[],s=[],o=[],a=new w,l=new W;for(let f=0;f<=t;f++){const g=f/t;r[f]=this.getTangentAt(g,new w),r[f].normalize()}s[0]=new w,o[0]=new w;let h=Number.MAX_VALUE;const c=Math.abs(r[0].x),u=Math.abs(r[0].y),p=Math.abs(r[0].z);c<=h&&(h=c,n.set(1,0,0)),u<=h&&(h=u,n.set(0,1,0)),p<=h&&n.set(0,0,1),a.crossVectors(r[0],n).normalize(),s[0].crossVectors(r[0],a),o[0].crossVectors(r[0],s[0]);for(let f=1;f<=t;f++){if(s[f]=s[f-1].clone(),o[f]=o[f-1].clone(),a.crossVectors(r[f-1],r[f]),a.length()>Number.EPSILON){a.normalize();const g=Math.acos(ut(r[f-1].dot(r[f]),-1,1));s[f].applyMatrix4(l.makeRotationAxis(a,g))}o[f].crossVectors(r[f],s[f])}if(e===!0){let f=Math.acos(ut(s[0].dot(s[t]),-1,1));f/=t,r[0].dot(a.crossVectors(s[0],s[t]))>0&&(f=-f);for(let g=1;g<=t;g++)s[g].applyMatrix4(l.makeRotationAxis(r[g],f*g)),o[g].crossVectors(r[g],s[g])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class ba extends si{constructor(t=0,e=0,n=1,r=1,s=0,o=2*Math.PI,a=!1,l=0){super(),this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=n,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(t,e){const n=e||new F,r=2*Math.PI;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=r;for(;s>r;)s-=r;s<Number.EPSILON&&(s=o?0:r),this.aClockwise!==!0||o||(s===r?s=-r:s-=r);const a=this.aStartAngle+t*s;let l=this.aX+this.xRadius*Math.cos(a),h=this.aY+this.yRadius*Math.sin(a);if(this.aRotation!==0){const c=Math.cos(this.aRotation),u=Math.sin(this.aRotation),p=l-this.aX,f=h-this.aY;l=p*c-f*u+this.aX,h=p*u+f*c+this.aY}return n.set(l,h)}copy(t){return super.copy(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}toJSON(){const t=super.toJSON();return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}fromJSON(t){return super.fromJSON(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}}ba.prototype.isEllipseCurve=!0;class mp extends ba{constructor(t,e,n,r,s,o){super(t,e,n,n,r,s,o),this.type="ArcCurve"}}function gh(){let i=0,t=0,e=0,n=0;function r(s,o,a,l){i=s,t=a,e=-3*s+3*o-2*a-l,n=2*s-2*o+a+l}return{initCatmullRom:function(s,o,a,l,h){r(o,a,h*(a-s),h*(l-o))},initNonuniformCatmullRom:function(s,o,a,l,h,c,u){let p=(o-s)/h-(a-s)/(h+c)+(a-o)/c,f=(a-o)/c-(l-o)/(c+u)+(l-a)/u;p*=c,f*=c,r(o,a,p,f)},calc:function(s){const o=s*s;return i+t*s+e*o+n*(o*s)}}}mp.prototype.isArcCurve=!0;const Ea=new w,vh=new gh,_h=new gh,yh=new gh;class gp extends si{constructor(t=[],e=!1,n="centripetal",r=.5){super(),this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=n,this.tension=r}getPoint(t,e=new w){const n=e,r=this.points,s=r.length,o=(s-(this.closed?0:1))*t;let a,l,h=Math.floor(o),c=o-h;this.closed?h+=h>0?0:(Math.floor(Math.abs(h)/s)+1)*s:c===0&&h===s-1&&(h=s-2,c=1),this.closed||h>0?a=r[(h-1)%s]:(Ea.subVectors(r[0],r[1]).add(r[0]),a=Ea);const u=r[h%s],p=r[(h+1)%s];if(this.closed||h+2<s?l=r[(h+2)%s]:(Ea.subVectors(r[s-1],r[s-2]).add(r[s-1]),l=Ea),this.curveType==="centripetal"||this.curveType==="chordal"){const f=this.curveType==="chordal"?.5:.25;let g=Math.pow(a.distanceToSquared(u),f),_=Math.pow(u.distanceToSquared(p),f),v=Math.pow(p.distanceToSquared(l),f);_<1e-4&&(_=1),g<1e-4&&(g=_),v<1e-4&&(v=_),vh.initNonuniformCatmullRom(a.x,u.x,p.x,l.x,g,_,v),_h.initNonuniformCatmullRom(a.y,u.y,p.y,l.y,g,_,v),yh.initNonuniformCatmullRom(a.z,u.z,p.z,l.z,g,_,v)}else this.curveType==="catmullrom"&&(vh.initCatmullRom(a.x,u.x,p.x,l.x,this.tension),_h.initCatmullRom(a.y,u.y,p.y,l.y,this.tension),yh.initCatmullRom(a.z,u.z,p.z,l.z,this.tension));return n.set(vh.calc(c),_h.calc(c),yh.calc(c)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const r=t.points[e];this.points.push(r.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const r=this.points[e];t.points.push(r.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const r=t.points[e];this.points.push(new w().fromArray(r))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}}function vp(i,t,e,n,r){const s=.5*(n-t),o=.5*(r-e),a=i*i;return(2*e-2*n+s+o)*(i*a)+(-3*e+3*n-2*s-o)*a+s*i+e}function $s(i,t,e,n){return function(r,s){const o=1-r;return o*o*s}(i,t)+function(r,s){return 2*(1-r)*r*s}(i,e)+function(r,s){return r*r*s}(i,n)}function Zs(i,t,e,n,r){return function(s,o){const a=1-s;return a*a*a*o}(i,t)+function(s,o){const a=1-s;return 3*a*a*s*o}(i,e)+function(s,o){return 3*(1-s)*s*s*o}(i,n)+function(s,o){return s*s*s*o}(i,r)}gp.prototype.isCatmullRomCurve3=!0;class xh extends si{constructor(t=new F,e=new F,n=new F,r=new F){super(),this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=n,this.v3=r}getPoint(t,e=new F){const n=e,r=this.v0,s=this.v1,o=this.v2,a=this.v3;return n.set(Zs(t,r.x,s.x,o.x,a.x),Zs(t,r.y,s.y,o.y,a.y)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}xh.prototype.isCubicBezierCurve=!0;class _p extends si{constructor(t=new w,e=new w,n=new w,r=new w){super(),this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=n,this.v3=r}getPoint(t,e=new w){const n=e,r=this.v0,s=this.v1,o=this.v2,a=this.v3;return n.set(Zs(t,r.x,s.x,o.x,a.x),Zs(t,r.y,s.y,o.y,a.y),Zs(t,r.z,s.z,o.z,a.z)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}_p.prototype.isCubicBezierCurve3=!0;class wa extends si{constructor(t=new F,e=new F){super(),this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new F){const n=e;return t===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e){const n=e||new F;return n.copy(this.v2).sub(this.v1).normalize(),n}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}wa.prototype.isLineCurve=!0;class bh extends si{constructor(t=new F,e=new F,n=new F){super(),this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=n}getPoint(t,e=new F){const n=e,r=this.v0,s=this.v1,o=this.v2;return n.set($s(t,r.x,s.x,o.x),$s(t,r.y,s.y,o.y)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}bh.prototype.isQuadraticBezierCurve=!0;class yp extends si{constructor(t=new w,e=new w,n=new w){super(),this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=n}getPoint(t,e=new w){const n=e,r=this.v0,s=this.v1,o=this.v2;return n.set($s(t,r.x,s.x,o.x),$s(t,r.y,s.y,o.y),$s(t,r.z,s.z,o.z)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}yp.prototype.isQuadraticBezierCurve3=!0;class Eh extends si{constructor(t=[]){super(),this.type="SplineCurve",this.points=t}getPoint(t,e=new F){const n=e,r=this.points,s=(r.length-1)*t,o=Math.floor(s),a=s-o,l=r[o===0?o:o-1],h=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(vp(a,l.x,h.x,c.x,u.x),vp(a,l.y,h.y,c.y,u.y)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const r=t.points[e];this.points.push(r.clone())}return this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const r=this.points[e];t.points.push(r.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const r=t.points[e];this.points.push(new F().fromArray(r))}return this}}Eh.prototype.isSplineCurve=!0;var xp=Object.freeze({__proto__:null,ArcCurve:mp,CatmullRomCurve3:gp,CubicBezierCurve:xh,CubicBezierCurve3:_p,EllipseCurve:ba,LineCurve:wa,LineCurve3:class extends si{constructor(i=new w,t=new w){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=i,this.v2=t}getPoint(i,t=new w){const e=t;return i===1?e.copy(this.v2):(e.copy(this.v2).sub(this.v1),e.multiplyScalar(i).add(this.v1)),e}getPointAt(i,t){return this.getPoint(i,t)}copy(i){return super.copy(i),this.v1.copy(i.v1),this.v2.copy(i.v2),this}toJSON(){const i=super.toJSON();return i.v1=this.v1.toArray(),i.v2=this.v2.toArray(),i}fromJSON(i){return super.fromJSON(i),this.v1.fromArray(i.v1),this.v2.fromArray(i.v2),this}},QuadraticBezierCurve:bh,QuadraticBezierCurve3:yp,SplineCurve:Eh});const kx=function(i,t,e=2){const n=t&&t.length,r=n?t[0]*e:i.length;let s=bp(i,0,r,e,!0);const o=[];if(!s||s.next===s.prev)return o;let a,l,h,c,u,p,f;if(n&&(s=function(g,_,v,M){const A=[];let O,H,j,X,U;for(O=0,H=_.length;O<H;O++)j=_[O]*M,X=O<H-1?_[O+1]*M:g.length,U=bp(g,j,X,M,!1),U===U.next&&(U.steiner=!0),A.push(Wx(U));for(A.sort(zx),O=0;O<A.length;O++)jx(A[O],v),v=ar(v,v.next);return v}(i,t,s,e)),i.length>80*e){a=h=i[0],l=c=i[1];for(let g=e;g<r;g+=e)u=i[g],p=i[g+1],u<a&&(a=u),p<l&&(l=p),u>h&&(h=u),p>c&&(c=p);f=Math.max(h-a,c-l),f=f!==0?1/f:0}return Js(s,o,e,a,l,f),o};function bp(i,t,e,n,r){let s,o;if(r===function(a,l,h,c){let u=0;for(let p=l,f=h-c;p<h;p+=c)u+=(a[f]-a[p])*(a[p+1]+a[f+1]),f=p;return u}(i,t,e,n)>0)for(s=t;s<e;s+=n)o=Tp(s,i[s],i[s+1],o);else for(s=e-n;s>=t;s-=n)o=Tp(s,i[s],i[s+1],o);return o&&Ta(o,o.next)&&(Qs(o),o=o.next),o}function ar(i,t){if(!i)return i;t||(t=i);let e,n=i;do if(e=!1,n.steiner||!Ta(n,n.next)&&sn(n.prev,n,n.next)!==0)n=n.next;else{if(Qs(n),n=t=n.prev,n===n.next)break;e=!0}while(e||n!==t);return t}function Js(i,t,e,n,r,s,o){if(!i)return;!o&&s&&function(c,u,p,f){let g=c;do g.z===null&&(g.z=wh(g.x,g.y,u,p,f)),g.prevZ=g.prev,g.nextZ=g.next,g=g.next;while(g!==c);g.prevZ.nextZ=null,g.prevZ=null,function(_){let v,M,A,O,H,j,X,U,V=1;do{for(M=_,_=null,H=null,j=0;M;){for(j++,A=M,X=0,v=0;v<V&&(X++,A=A.nextZ,A);v++);for(U=V;X>0||U>0&&A;)X!==0&&(U===0||!A||M.z<=A.z)?(O=M,M=M.nextZ,X--):(O=A,A=A.nextZ,U--),H?H.nextZ=O:_=O,O.prevZ=H,H=O;M=A}H.nextZ=null,V*=2}while(j>1)}(g)}(i,n,r,s);let a,l,h=i;for(;i.prev!==i.next;)if(a=i.prev,l=i.next,s?Bx(i,n,r,s):Ux(i))t.push(a.i/e),t.push(i.i/e),t.push(l.i/e),Qs(i),i=l.next,h=l.next;else if((i=l)===h){o?o===1?Js(i=Gx(ar(i),t,e),t,e,n,r,s,2):o===2&&Hx(i,t,e,n,r,s):Js(ar(i),t,e,n,r,s,1);break}}function Ux(i){const t=i.prev,e=i,n=i.next;if(sn(t,e,n)>=0)return!1;let r=i.next.next;for(;r!==i.prev;){if(ns(t.x,t.y,e.x,e.y,n.x,n.y,r.x,r.y)&&sn(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function Bx(i,t,e,n){const r=i.prev,s=i,o=i.next;if(sn(r,s,o)>=0)return!1;const a=r.x<s.x?r.x<o.x?r.x:o.x:s.x<o.x?s.x:o.x,l=r.y<s.y?r.y<o.y?r.y:o.y:s.y<o.y?s.y:o.y,h=r.x>s.x?r.x>o.x?r.x:o.x:s.x>o.x?s.x:o.x,c=r.y>s.y?r.y>o.y?r.y:o.y:s.y>o.y?s.y:o.y,u=wh(a,l,t,e,n),p=wh(h,c,t,e,n);let f=i.prevZ,g=i.nextZ;for(;f&&f.z>=u&&g&&g.z<=p;){if(f!==i.prev&&f!==i.next&&ns(r.x,r.y,s.x,s.y,o.x,o.y,f.x,f.y)&&sn(f.prev,f,f.next)>=0||(f=f.prevZ,g!==i.prev&&g!==i.next&&ns(r.x,r.y,s.x,s.y,o.x,o.y,g.x,g.y)&&sn(g.prev,g,g.next)>=0))return!1;g=g.nextZ}for(;f&&f.z>=u;){if(f!==i.prev&&f!==i.next&&ns(r.x,r.y,s.x,s.y,o.x,o.y,f.x,f.y)&&sn(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;g&&g.z<=p;){if(g!==i.prev&&g!==i.next&&ns(r.x,r.y,s.x,s.y,o.x,o.y,g.x,g.y)&&sn(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function Gx(i,t,e){let n=i;do{const r=n.prev,s=n.next.next;!Ta(r,s)&&Ep(r,n,n.next,s)&&Ks(r,s)&&Ks(s,r)&&(t.push(r.i/e),t.push(n.i/e),t.push(s.i/e),Qs(n),Qs(n.next),n=i=s),n=n.next}while(n!==i);return ar(n)}function Hx(i,t,e,n,r,s){let o=i;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&Xx(o,a)){let l=wp(o,a);return o=ar(o,o.next),l=ar(l,l.next),Js(o,t,e,n,r,s),void Js(l,t,e,n,r,s)}a=a.next}o=o.next}while(o!==i)}function zx(i,t){return i.x-t.x}function jx(i,t){if(t=function(e,n){let r=n;const s=e.x,o=e.y;let a,l=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){const g=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(g<=s&&g>l){if(l=g,g===s){if(o===r.y)return r;if(o===r.next.y)return r.next}a=r.x<r.next.x?r:r.next}}r=r.next}while(r!==n);if(!a)return null;if(s===l)return a;const h=a,c=a.x,u=a.y;let p,f=1/0;r=a;do s>=r.x&&r.x>=c&&s!==r.x&&ns(o<u?s:l,o,c,u,o<u?l:s,o,r.x,r.y)&&(p=Math.abs(o-r.y)/(s-r.x),Ks(r,e)&&(p<f||p===f&&(r.x>a.x||r.x===a.x&&Vx(a,r)))&&(a=r,f=p)),r=r.next;while(r!==h);return a}(i,t)){const e=wp(t,i);ar(t,t.next),ar(e,e.next)}}function Vx(i,t){return sn(i.prev,i,t.prev)<0&&sn(t.next,i,i.next)<0}function wh(i,t,e,n,r){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=32767*(i-e)*r)|i<<8))|i<<4))|i<<2))|i<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Wx(i){let t=i,e=i;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==i);return e}function ns(i,t,e,n,r,s,o,a){return(r-o)*(t-a)-(i-o)*(s-a)>=0&&(i-o)*(n-a)-(e-o)*(t-a)>=0&&(e-o)*(s-a)-(r-o)*(n-a)>=0}function Xx(i,t){return i.next.i!==t.i&&i.prev.i!==t.i&&!function(e,n){let r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==n.i&&r.next.i!==n.i&&Ep(r,r.next,e,n))return!0;r=r.next}while(r!==e);return!1}(i,t)&&(Ks(i,t)&&Ks(t,i)&&function(e,n){let r=e,s=!1;const o=(e.x+n.x)/2,a=(e.y+n.y)/2;do r.y>a!=r.next.y>a&&r.next.y!==r.y&&o<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(s=!s),r=r.next;while(r!==e);return s}(i,t)&&(sn(i.prev,i,t.prev)||sn(i,t.prev,t))||Ta(i,t)&&sn(i.prev,i,i.next)>0&&sn(t.prev,t,t.next)>0)}function sn(i,t,e){return(t.y-i.y)*(e.x-t.x)-(t.x-i.x)*(e.y-t.y)}function Ta(i,t){return i.x===t.x&&i.y===t.y}function Ep(i,t,e,n){const r=Ma(sn(i,t,e)),s=Ma(sn(i,t,n)),o=Ma(sn(e,n,i)),a=Ma(sn(e,n,t));return r!==s&&o!==a||!(r!==0||!Sa(i,e,t))||!(s!==0||!Sa(i,n,t))||!(o!==0||!Sa(e,i,n))||!(a!==0||!Sa(e,t,n))}function Sa(i,t,e){return t.x<=Math.max(i.x,e.x)&&t.x>=Math.min(i.x,e.x)&&t.y<=Math.max(i.y,e.y)&&t.y>=Math.min(i.y,e.y)}function Ma(i){return i>0?1:i<0?-1:0}function Ks(i,t){return sn(i.prev,i,i.next)<0?sn(i,t,i.next)>=0&&sn(i,i.prev,t)>=0:sn(i,t,i.prev)<0||sn(i,i.next,t)<0}function wp(i,t){const e=new Th(i.i,i.x,i.y),n=new Th(t.i,t.x,t.y),r=i.next,s=t.prev;return i.next=t,t.prev=i,e.next=r,r.prev=e,n.next=e,e.prev=n,s.next=n,n.prev=s,n}function Tp(i,t,e,n){const r=new Th(i,t,e);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function Qs(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function Th(i,t,e){this.i=i,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}class lr{static area(t){const e=t.length;let n=0;for(let r=e-1,s=0;s<e;r=s++)n+=t[r].x*t[s].y-t[s].x*t[r].y;return .5*n}static isClockWise(t){return lr.area(t)<0}static triangulateShape(t,e){const n=[],r=[],s=[];Sp(t),Mp(n,t);let o=t.length;e.forEach(Sp);for(let l=0;l<e.length;l++)r.push(o),o+=e[l].length,Mp(n,e[l]);const a=kx(n,r);for(let l=0;l<a.length;l+=3)s.push(a.slice(l,l+3));return s}}function Sp(i){const t=i.length;t>2&&i[t-1].equals(i[0])&&i.pop()}function Mp(i,t){for(let e=0;e<t.length;e++)i.push(t[e].x),i.push(t[e].y)}class is extends He{constructor(t,e){super(),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];const n=this,r=[],s=[];for(let a=0,l=t.length;a<l;a++)o(t[a]);function o(a){const l=[],h=e.curveSegments!==void 0?e.curveSegments:12,c=e.steps!==void 0?e.steps:1;let u=e.depth!==void 0?e.depth:100,p=e.bevelEnabled===void 0||e.bevelEnabled,f=e.bevelThickness!==void 0?e.bevelThickness:6,g=e.bevelSize!==void 0?e.bevelSize:f-2,_=e.bevelOffset!==void 0?e.bevelOffset:0,v=e.bevelSegments!==void 0?e.bevelSegments:3;const M=e.extrudePath,A=e.UVGenerator!==void 0?e.UVGenerator:Yx;e.amount!==void 0&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),u=e.amount);let O,H,j,X,U,V=!1;M&&(O=M.getSpacedPoints(c),V=!0,p=!1,H=M.computeFrenetFrames(c,!1),j=new w,X=new w,U=new w),p||(v=0,f=0,g=0,_=0);const xt=a.extractPoints(h);let it=xt.shape;const Q=xt.holes;if(!lr.isClockWise(it)){it=it.reverse();for(let Nt=0,Y=Q.length;Nt<Y;Nt++){const pt=Q[Nt];lr.isClockWise(pt)&&(Q[Nt]=pt.reverse())}}const st=lr.triangulateShape(it,Q),nt=it;for(let Nt=0,Y=Q.length;Nt<Y;Nt++){const pt=Q[Nt];it=it.concat(pt)}function ct(Nt,Y,pt){return Y||console.error("THREE.ExtrudeGeometry: vec does not exist"),Y.clone().multiplyScalar(pt).add(Nt)}const Lt=it.length,At=st.length;function ht(Nt,Y,pt){let Et,Tt,St;const Qt=Nt.x-Y.x,ce=Nt.y-Y.y,ae=pt.x-Nt.x,se=pt.y-Nt.y,we=Qt*Qt+ce*ce,vn=Qt*se-ce*ae;if(Math.abs(vn)>Number.EPSILON){const Ve=Math.sqrt(we),Ei=Math.sqrt(ae*ae+se*se),Ho=Y.x-ce/Ve,zo=Y.y+Qt/Ve,jo=((pt.x-se/Ei-Ho)*se-(pt.y+ae/Ei-zo)*ae)/(Qt*se-ce*ae);Et=Ho+Qt*jo-Nt.x,Tt=zo+ce*jo-Nt.y;const zn=Et*Et+Tt*Tt;if(zn<=2)return new F(Et,Tt);St=Math.sqrt(zn/2)}else{let Ve=!1;Qt>Number.EPSILON?ae>Number.EPSILON&&(Ve=!0):Qt<-Number.EPSILON?ae<-Number.EPSILON&&(Ve=!0):Math.sign(ce)===Math.sign(se)&&(Ve=!0),Ve?(Et=-ce,Tt=Qt,St=Math.sqrt(we)):(Et=Qt,Tt=ce,St=Math.sqrt(we/2))}return new F(Et/St,Tt/St)}const gt=[];for(let Nt=0,Y=nt.length,pt=Y-1,Et=Nt+1;Nt<Y;Nt++,pt++,Et++)pt===Y&&(pt=0),Et===Y&&(Et=0),gt[Nt]=ht(nt[Nt],nt[pt],nt[Et]);const Ut=[];let Vt,Zt=gt.concat();for(let Nt=0,Y=Q.length;Nt<Y;Nt++){const pt=Q[Nt];Vt=[];for(let Et=0,Tt=pt.length,St=Tt-1,Qt=Et+1;Et<Tt;Et++,St++,Qt++)St===Tt&&(St=0),Qt===Tt&&(Qt=0),Vt[Et]=ht(pt[Et],pt[St],pt[Qt]);Ut.push(Vt),Zt=Zt.concat(Vt)}for(let Nt=0;Nt<v;Nt++){const Y=Nt/v,pt=f*Math.cos(Y*Math.PI/2),Et=g*Math.sin(Y*Math.PI/2)+_;for(let Tt=0,St=nt.length;Tt<St;Tt++){const Qt=ct(nt[Tt],gt[Tt],Et);Ft(Qt.x,Qt.y,-pt)}for(let Tt=0,St=Q.length;Tt<St;Tt++){const Qt=Q[Tt];Vt=Ut[Tt];for(let ce=0,ae=Qt.length;ce<ae;ce++){const se=ct(Qt[ce],Vt[ce],Et);Ft(se.x,se.y,-pt)}}}const J=g+_;for(let Nt=0;Nt<Lt;Nt++){const Y=p?ct(it[Nt],Zt[Nt],J):it[Nt];V?(X.copy(H.normals[0]).multiplyScalar(Y.x),j.copy(H.binormals[0]).multiplyScalar(Y.y),U.copy(O[0]).add(X).add(j),Ft(U.x,U.y,U.z)):Ft(Y.x,Y.y,0)}for(let Nt=1;Nt<=c;Nt++)for(let Y=0;Y<Lt;Y++){const pt=p?ct(it[Y],Zt[Y],J):it[Y];V?(X.copy(H.normals[Nt]).multiplyScalar(pt.x),j.copy(H.binormals[Nt]).multiplyScalar(pt.y),U.copy(O[Nt]).add(X).add(j),Ft(U.x,U.y,U.z)):Ft(pt.x,pt.y,u/c*Nt)}for(let Nt=v-1;Nt>=0;Nt--){const Y=Nt/v,pt=f*Math.cos(Y*Math.PI/2),Et=g*Math.sin(Y*Math.PI/2)+_;for(let Tt=0,St=nt.length;Tt<St;Tt++){const Qt=ct(nt[Tt],gt[Tt],Et);Ft(Qt.x,Qt.y,u+pt)}for(let Tt=0,St=Q.length;Tt<St;Tt++){const Qt=Q[Tt];Vt=Ut[Tt];for(let ce=0,ae=Qt.length;ce<ae;ce++){const se=ct(Qt[ce],Vt[ce],Et);V?Ft(se.x,se.y+O[c-1].y,O[c-1].x+pt):Ft(se.x,se.y,u+pt)}}}function et(Nt,Y){let pt=Nt.length;for(;--pt>=0;){const Et=pt;let Tt=pt-1;Tt<0&&(Tt=Nt.length-1);for(let St=0,Qt=c+2*v;St<Qt;St++){const ce=Lt*St,ae=Lt*(St+1);It(Y+Et+ce,Y+Tt+ce,Y+Tt+ae,Y+Et+ae)}}}function Ft(Nt,Y,pt){l.push(Nt),l.push(Y),l.push(pt)}function Pt(Nt,Y,pt){Yt(Nt),Yt(Y),Yt(pt);const Et=r.length/3,Tt=A.generateTopUV(n,r,Et-3,Et-2,Et-1);qt(Tt[0]),qt(Tt[1]),qt(Tt[2])}function It(Nt,Y,pt,Et){Yt(Nt),Yt(Y),Yt(Et),Yt(Y),Yt(pt),Yt(Et);const Tt=r.length/3,St=A.generateSideWallUV(n,r,Tt-6,Tt-3,Tt-2,Tt-1);qt(St[0]),qt(St[1]),qt(St[3]),qt(St[1]),qt(St[2]),qt(St[3])}function Yt(Nt){r.push(l[3*Nt+0]),r.push(l[3*Nt+1]),r.push(l[3*Nt+2])}function qt(Nt){s.push(Nt.x),s.push(Nt.y)}(function(){const Nt=r.length/3;if(p){let Y=0,pt=Lt*Y;for(let Et=0;Et<At;Et++){const Tt=st[Et];Pt(Tt[2]+pt,Tt[1]+pt,Tt[0]+pt)}Y=c+2*v,pt=Lt*Y;for(let Et=0;Et<At;Et++){const Tt=st[Et];Pt(Tt[0]+pt,Tt[1]+pt,Tt[2]+pt)}}else{for(let Y=0;Y<At;Y++){const pt=st[Y];Pt(pt[2],pt[1],pt[0])}for(let Y=0;Y<At;Y++){const pt=st[Y];Pt(pt[0]+Lt*c,pt[1]+Lt*c,pt[2]+Lt*c)}}n.addGroup(Nt,r.length/3-Nt,0)})(),function(){const Nt=r.length/3;let Y=0;et(nt,Y),Y+=nt.length;for(let pt=0,Et=Q.length;pt<Et;pt++){const Tt=Q[pt];et(Tt,Y),Y+=Tt.length}n.addGroup(Nt,r.length/3-Nt,1)}()}this.setAttribute("position",new Fe(r,3)),this.setAttribute("uv",new Fe(s,2)),this.computeVertexNormals()}toJSON(){const t=super.toJSON();return function(e,n,r){if(r.shapes=[],Array.isArray(e))for(let s=0,o=e.length;s<o;s++){const a=e[s];r.shapes.push(a.uuid)}else r.shapes.push(e.uuid);return n.extrudePath!==void 0&&(r.options.extrudePath=n.extrudePath.toJSON()),r}(this.parameters.shapes,this.parameters.options,t)}static fromJSON(t,e){const n=[];for(let s=0,o=t.shapes.length;s<o;s++){const a=e[t.shapes[s]];n.push(a)}const r=t.options.extrudePath;return r!==void 0&&(t.options.extrudePath=new xp[r.type]().fromJSON(r)),new is(n,t.options)}}const Yx={generateTopUV:function(i,t,e,n,r){const s=t[3*e],o=t[3*e+1],a=t[3*n],l=t[3*n+1],h=t[3*r],c=t[3*r+1];return[new F(s,o),new F(a,l),new F(h,c)]},generateSideWallUV:function(i,t,e,n,r,s){const o=t[3*e],a=t[3*e+1],l=t[3*e+2],h=t[3*n],c=t[3*n+1],u=t[3*n+2],p=t[3*r],f=t[3*r+1],g=t[3*r+2],_=t[3*s],v=t[3*s+1],M=t[3*s+2];return Math.abs(a-c)<Math.abs(o-h)?[new F(o,1-l),new F(h,1-u),new F(p,1-g),new F(_,1-M)]:[new F(a,1-l),new F(c,1-u),new F(f,1-g),new F(v,1-M)]}};class Sh extends He{constructor(t,e=12){super(),this.type="ShapeGeometry",this.parameters={shapes:t,curveSegments:e};const n=[],r=[],s=[],o=[];let a=0,l=0;if(Array.isArray(t)===!1)h(t);else for(let c=0;c<t.length;c++)h(t[c]),this.addGroup(a,l,c),a+=l,l=0;function h(c){const u=r.length/3,p=c.extractPoints(e);let f=p.shape;const g=p.holes;lr.isClockWise(f)===!1&&(f=f.reverse());for(let v=0,M=g.length;v<M;v++){const A=g[v];lr.isClockWise(A)===!0&&(g[v]=A.reverse())}const _=lr.triangulateShape(f,g);for(let v=0,M=g.length;v<M;v++){const A=g[v];f=f.concat(A)}for(let v=0,M=f.length;v<M;v++){const A=f[v];r.push(A.x,A.y,0),s.push(0,0,1),o.push(A.x,A.y)}for(let v=0,M=_.length;v<M;v++){const A=_[v],O=A[0]+u,H=A[1]+u,j=A[2]+u;n.push(O,H,j),l+=3}}this.setIndex(n),this.setAttribute("position",new Fe(r,3)),this.setAttribute("normal",new Fe(s,3)),this.setAttribute("uv",new Fe(o,2))}toJSON(){const t=super.toJSON();return function(e,n){if(n.shapes=[],Array.isArray(e))for(let r=0,s=e.length;r<s;r++){const o=e[r];n.shapes.push(o.uuid)}else n.shapes.push(e.uuid);return n}(this.parameters.shapes,t)}static fromJSON(t,e){const n=[];for(let r=0,s=t.shapes.length;r<s;r++){const o=e[t.shapes[r]];n.push(o)}return new Sh(n,t.curveSegments)}}class qx extends Rn{constructor(t){super(),this.type="ShadowMaterial",this.color=new _e(0),this.transparent=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this}}qx.prototype.isShadowMaterial=!0;class $x extends pi{constructor(t){super(t),this.type="RawShaderMaterial"}}$x.prototype.isRawShaderMaterial=!0;class Ap extends Rn{constructor(t){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new _e(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 _e(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new F(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.vertexTangents=!1,this.setValues(t)}copy(t){return super.copy(t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.flatShading=t.flatShading,this.vertexTangents=t.vertexTangents,this}}Ap.prototype.isMeshStandardMaterial=!0;class Zx extends Ap{constructor(t){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new F(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,Object.defineProperty(this,"ior",{get:function(){return(1+.4*this.reflectivity)/(1-.4*this.reflectivity)},set:function(e){this.reflectivity=ut(2.5*(e-1)/(e+1),0,1)}}),this.sheen=null,this.transmission=0,this.transmissionMap=null,this.thickness=.01,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationColor=new _e(1,1,1),this.setValues(t)}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.reflectivity=t.reflectivity,t.sheen?this.sheen=(this.sheen||new _e).copy(t.sheen):this.sheen=null,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this}}Zx.prototype.isMeshPhysicalMaterial=!0;class Pp extends Rn{constructor(t){super(),this.type="MeshPhongMaterial",this.color=new _e(16777215),this.specular=new _e(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _e(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new F(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.flatShading=t.flatShading,this}}Pp.prototype.isMeshPhongMaterial=!0;class Jx extends Rn{constructor(t){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new _e(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _e(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new F(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.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this}}Jx.prototype.isMeshToonMaterial=!0;class Kx extends Rn{constructor(t){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new F(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.flatShading=t.flatShading,this}}Kx.prototype.isMeshNormalMaterial=!0;class Qx extends Rn{constructor(t){super(),this.type="MeshLambertMaterial",this.color=new _e(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _e(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this}}Qx.prototype.isMeshLambertMaterial=!0;class tb extends Rn{constructor(t){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new _e(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new F(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.flatShading=t.flatShading,this}}tb.prototype.isMeshMatcapMaterial=!0;class eb extends qs{constructor(t){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}eb.prototype.isLineDashedMaterial=!0;const Qe={arraySlice:function(i,t,e){return Qe.isTypedArray(i)?new i.constructor(i.subarray(t,e!==void 0?e:i.length)):i.slice(t,e)},convertArray:function(i,t,e){return!i||!e&&i.constructor===t?i:typeof t.BYTES_PER_ELEMENT=="number"?new t(i):Array.prototype.slice.call(i)},isTypedArray:function(i){return ArrayBuffer.isView(i)&&!(i instanceof DataView)},getKeyframeOrder:function(i){const t=i.length,e=new Array(t);for(let n=0;n!==t;++n)e[n]=n;return e.sort(function(n,r){return i[n]-i[r]}),e},sortedArray:function(i,t,e){const n=i.length,r=new i.constructor(n);for(let s=0,o=0;o!==n;++s){const a=e[s]*t;for(let l=0;l!==t;++l)r[o++]=i[a+l]}return r},flattenJSON:function(i,t,e,n){let r=1,s=i[0];for(;s!==void 0&&s[n]===void 0;)s=i[r++];if(s===void 0)return;let o=s[n];if(o!==void 0)if(Array.isArray(o))do o=s[n],o!==void 0&&(t.push(s.time),e.push.apply(e,o)),s=i[r++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[n],o!==void 0&&(t.push(s.time),o.toArray(e,e.length)),s=i[r++];while(s!==void 0);else do o=s[n],o!==void 0&&(t.push(s.time),e.push(o)),s=i[r++];while(s!==void 0)},subclip:function(i,t,e,n,r=30){const s=i.clone();s.name=t;const o=[];for(let l=0;l<s.tracks.length;++l){const h=s.tracks[l],c=h.getValueSize(),u=[],p=[];for(let f=0;f<h.times.length;++f){const g=h.times[f]*r;if(!(g<e||g>=n)){u.push(h.times[f]);for(let _=0;_<c;++_)p.push(h.values[f*c+_])}}u.length!==0&&(h.times=Qe.convertArray(u,h.times.constructor),h.values=Qe.convertArray(p,h.values.constructor),o.push(h))}s.tracks=o;let a=1/0;for(let l=0;l<s.tracks.length;++l)a>s.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l<s.tracks.length;++l)s.tracks[l].shift(-1*a);return s.resetDuration(),s},makeClipAdditive:function(i,t=0,e=i,n=30){n<=0&&(n=30);const r=e.tracks.length,s=t/n;for(let o=0;o<r;++o){const a=e.tracks[o],l=a.ValueTypeName;if(l==="bool"||l==="string")continue;const h=i.tracks.find(function(M){return M.name===a.name&&M.ValueTypeName===l});if(h===void 0)continue;let c=0;const u=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(c=u/3);let p=0;const f=h.getValueSize();h.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(p=f/3);const g=a.times.length-1;let _;if(s<=a.times[0]){const M=c,A=u-c;_=Qe.arraySlice(a.values,M,A)}else if(s>=a.times[g]){const M=g*u+c,A=M+u-c;_=Qe.arraySlice(a.values,M,A)}else{const M=a.createInterpolant(),A=c,O=u-c;M.evaluate(s),_=Qe.arraySlice(M.resultBuffer,A,O)}l==="quaternion"&&new lt().fromArray(_).normalize().conjugate().toArray(_);const v=h.times.length;for(let M=0;M<v;++M){const A=M*f+p;if(l==="quaternion")lt.multiplyQuaternionsFlat(h.values,A,_,0,h.values,A);else{const O=f-2*p;for(let H=0;H<O;++H)h.values[A+H]-=_[H]}}}return i.blendMode=2501,i}};class hr{constructor(t,e,n,r){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new e.constructor(n),this.sampleValues=e,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(t){const e=this.parameterPositions;let n=this._cachedIndex,r=e[n],s=e[n-1];t:{e:{let o;n:{i:if(!(t<r)){for(let a=n+2;;){if(r===void 0){if(t<s)break i;return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,t,s)}if(n===a)break;if(s=r,r=e[++n],t<r)break e}o=e.length;break n}if(t>=s)break t;{const a=e[1];t<a&&(n=2,s=a);for(let l=n-2;;){if(s===void 0)return this._cachedIndex=0,this.beforeStart_(0,t,r);if(n===l)break;if(r=s,s=e[--n-1],t>=s)break e}o=n,n=0}}for(;n<o;){const a=n+o>>>1;t<e[a]?o=a:n=a+1}if(r=e[n],s=e[n-1],s===void 0)return this._cachedIndex=0,this.beforeStart_(0,t,r);if(r===void 0)return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,s,t)}this._cachedIndex=n,this.intervalChanged_(n,s,r)}return this.interpolate_(n,s,t,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){const e=this.resultBuffer,n=this.sampleValues,r=this.valueSize,s=t*r;for(let o=0;o!==r;++o)e[o]=n[s+o];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}hr.prototype.beforeStart_=hr.prototype.copySampleValue_,hr.prototype.afterEnd_=hr.prototype.copySampleValue_;class nb extends hr{constructor(t,e,n,r){super(t,e,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:2400,endingEnd:2400}}intervalChanged_(t,e,n){const r=this.parameterPositions;let s=t-2,o=t+1,a=r[s],l=r[o];if(a===void 0)switch(this.getSettings_().endingStart){case 2401:s=t,a=2*e-n;break;case 2402:s=r.length-2,a=e+r[s]-r[s+1];break;default:s=t,a=n}if(l===void 0)switch(this.getSettings_().endingEnd){case 2401:o=t,l=2*n-e;break;case 2402:o=1,l=n+r[1]-r[0];break;default:o=t-1,l=e}const h=.5*(n-e),c=this.valueSize;this._weightPrev=h/(e-a),this._weightNext=h/(l-n),this._offsetPrev=s*c,this._offsetNext=o*c}interpolate_(t,e,n,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=t*a,h=l-a,c=this._offsetPrev,u=this._offsetNext,p=this._weightPrev,f=this._weightNext,g=(n-e)/(r-e),_=g*g,v=_*g,M=-p*v+2*p*_-p*g,A=(1+p)*v+(-1.5-2*p)*_+(-.5+p)*g+1,O=(-1-f)*v+(1.5+f)*_+.5*g,H=f*v-f*_;for(let j=0;j!==a;++j)s[j]=M*o[c+j]+A*o[h+j]+O*o[l+j]+H*o[u+j];return s}}class Cp extends hr{constructor(t,e,n,r){super(t,e,n,r)}interpolate_(t,e,n,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=t*a,h=l-a,c=(n-e)/(r-e),u=1-c;for(let p=0;p!==a;++p)s[p]=o[h+p]*u+o[l+p]*c;return s}}class ib extends hr{constructor(t,e,n,r){super(t,e,n,r)}interpolate_(t){return this.copySampleValue_(t-1)}}class Ai{constructor(t,e,n,r){if(t===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(e===void 0||e.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=Qe.convertArray(e,this.TimeBufferType),this.values=Qe.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(t){const e=t.constructor;let n;if(e.toJSON!==this.toJSON)n=e.toJSON(t);else{n={name:t.name,times:Qe.convertArray(t.times,Array),values:Qe.convertArray(t.values,Array)};const r=t.getInterpolation();r!==t.DefaultInterpolation&&(n.interpolation=r)}return n.type=t.ValueTypeName,n}InterpolantFactoryMethodDiscrete(t){return new ib(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new Cp(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new nb(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case 2300:e=this.InterpolantFactoryMethodDiscrete;break;case 2301:e=this.InterpolantFactoryMethodLinear;break;case 2302:e=this.InterpolantFactoryMethodSmooth}if(e===void 0){const n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0){if(t===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}}getValueSize(){return this.values.length/this.times.length}shift(t){if(t!==0){const e=this.times;for(let n=0,r=e.length;n!==r;++n)e[n]+=t}return this}scale(t){if(t!==1){const e=this.times;for(let n=0,r=e.length;n!==r;++n)e[n]*=t}return this}trim(t,e){const n=this.times,r=n.length;let s=0,o=r-1;for(;s!==r&&n[s]<t;)++s;for(;o!==-1&&n[o]>e;)--o;if(++o,s!==0||o!==r){s>=o&&(o=Math.max(o,1),s=o-1);const a=this.getValueSize();this.times=Qe.arraySlice(n,s,o),this.values=Qe.arraySlice(this.values,s*a,o*a)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const n=this.times,r=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let o=null;for(let a=0;a!==s;a++){const l=n[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),t=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),t=!1;break}o=l}if(r!==void 0&&Qe.isTypedArray(r))for(let a=0,l=r.length;a!==l;++a){const h=r[a];if(isNaN(h)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,h),t=!1;break}}return t}optimize(){const t=Qe.arraySlice(this.times),e=Qe.arraySlice(this.values),n=this.getValueSize(),r=this.getInterpolation()===2302,s=t.length-1;let o=1;for(let a=1;a<s;++a){let l=!1;const h=t[a];if(h!==t[a+1]&&(a!==1||h!==t[0]))if(r)l=!0;else{const c=a*n,u=c-n,p=c+n;for(let f=0;f!==n;++f){const g=e[c+f];if(g!==e[u+f]||g!==e[p+f]){l=!0;break}}}if(l){if(a!==o){t[o]=t[a];const c=a*n,u=o*n;for(let p=0;p!==n;++p)e[u+p]=e[c+p]}++o}}if(s>0){t[o]=t[s];for(let a=s*n,l=o*n,h=0;h!==n;++h)e[l+h]=e[a+h];++o}return o!==t.length?(this.times=Qe.arraySlice(t,0,o),this.values=Qe.arraySlice(e,0,o*n)):(this.times=t,this.values=e),this}clone(){const t=Qe.arraySlice(this.times,0),e=Qe.arraySlice(this.values,0),n=new this.constructor(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}}Ai.prototype.TimeBufferType=Float32Array,Ai.prototype.ValueBufferType=Float32Array,Ai.prototype.DefaultInterpolation=2301;class rs extends Ai{}rs.prototype.ValueTypeName="bool",rs.prototype.ValueBufferType=Array,rs.prototype.DefaultInterpolation=2300,rs.prototype.InterpolantFactoryMethodLinear=void 0,rs.prototype.InterpolantFactoryMethodSmooth=void 0;class Ip extends Ai{}Ip.prototype.ValueTypeName="color";class Aa extends Ai{}Aa.prototype.ValueTypeName="number";class rb extends hr{constructor(t,e,n,r){super(t,e,n,r)}interpolate_(t,e,n,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(n-e)/(r-e);let h=t*a;for(let c=h+a;h!==c;h+=4)lt.slerpFlat(s,0,o,h-a,o,h,l);return s}}class to extends Ai{InterpolantFactoryMethodLinear(t){return new rb(this.times,this.values,this.getValueSize(),t)}}to.prototype.ValueTypeName="quaternion",to.prototype.DefaultInterpolation=2301,to.prototype.InterpolantFactoryMethodSmooth=void 0;class ss extends Ai{}ss.prototype.ValueTypeName="string",ss.prototype.ValueBufferType=Array,ss.prototype.DefaultInterpolation=2300,ss.prototype.InterpolantFactoryMethodLinear=void 0,ss.prototype.InterpolantFactoryMethodSmooth=void 0;class Pa extends Ai{}Pa.prototype.ValueTypeName="vector";class Rp{constructor(t,e=-1,n,r=2500){this.name=t,this.tracks=n,this.duration=e,this.blendMode=r,this.uuid=K(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],n=t.tracks,r=1/(t.fps||1);for(let o=0,a=n.length;o!==a;++o)e.push(sb(n[o]).scale(r));const s=new this(t.name,t.duration,e,t.blendMode);return s.uuid=t.uuid,s}static toJSON(t){const e=[],n=t.tracks,r={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let s=0,o=n.length;s!==o;++s)e.push(Ai.toJSON(n[s]));return r}static CreateFromMorphTargetSequence(t,e,n,r){const s=e.length,o=[];for(let a=0;a<s;a++){let l=[],h=[];l.push((a+s-1)%s,a,(a+1)%s),h.push(0,1,0);const c=Qe.getKeyframeOrder(l);l=Qe.sortedArray(l,1,c),h=Qe.sortedArray(h,1,c),r||l[0]!==0||(l.push(s),h.push(h[0])),o.push(new Aa(".morphTargetInfluences["+e[a].name+"]",l,h).scale(1/n))}return new this(t,-1,o)}static findByName(t,e){let n=t;if(!Array.isArray(t)){const r=t;n=r.geometry&&r.geometry.animations||r.animations}for(let r=0;r<n.length;r++)if(n[r].name===e)return n[r];return null}static CreateClipsFromMorphTargetSequences(t,e,n){const r={},s=/^([\w-]*?)([\d]+)$/;for(let a=0,l=t.length;a<l;a++){const h=t[a],c=h.name.match(s);if(c&&c.length>1){const u=c[1];let p=r[u];p||(r[u]=p=[]),p.push(h)}}const o=[];for(const a in r)o.push(this.CreateFromMorphTargetSequence(a,r[a],e,n));return o}static parseAnimation(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(c,u,p,f,g){if(p.length!==0){const _=[],v=[];Qe.flattenJSON(p,_,v,f),_.length!==0&&g.push(new c(u,_,v))}},r=[],s=t.name||"default",o=t.fps||30,a=t.blendMode;let l=t.length||-1;const h=t.hierarchy||[];for(let c=0;c<h.length;c++){const u=h[c].keys;if(u&&u.length!==0)if(u[0].morphTargets){const p={};let f;for(f=0;f<u.length;f++)if(u[f].morphTargets)for(let g=0;g<u[f].morphTargets.length;g++)p[u[f].morphTargets[g]]=-1;for(const g in p){const _=[],v=[];for(let M=0;M!==u[f].morphTargets.length;++M){const A=u[f];_.push(A.time),v.push(A.morphTarget===g?1:0)}r.push(new Aa(".morphTargetInfluence["+g+"]",_,v))}l=p.length*(o||1)}else{const p=".bones["+e[c].name+"]";n(Pa,p+".position",u,"pos",r),n(to,p+".quaternion",u,"rot",r),n(Pa,p+".scale",u,"scl",r)}}return r.length===0?null:new this(s,l,r,a)}resetDuration(){let t=0;for(let e=0,n=this.tracks.length;e!==n;++e){const r=this.tracks[e];t=Math.max(t,r.times[r.times.length-1])}return this.duration=t,this}trim(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this}validate(){let t=!0;for(let e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t}optimize(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}clone(){const t=[];for(let e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new this.constructor(this.name,this.duration,t,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function sb(i){if(i.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Aa;case"vector":case"vector2":case"vector3":case"vector4":return Pa;case"color":return Ip;case"quaternion":return to;case"bool":case"boolean":return rs;case"string":return ss}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(i.type);if(i.times===void 0){const e=[],n=[];Qe.flattenJSON(i.keys,e,n,"value"),i.times=e,i.values=n}return t.parse!==void 0?t.parse(i):new t(i.name,i.times,i.values,i.interpolation)}const os={enabled:!1,files:{},add:function(i,t){this.enabled!==!1&&(this.files[i]=t)},get:function(i){if(this.enabled!==!1)return this.files[i]},remove:function(i){delete this.files[i]},clear:function(){this.files={}}};class ob{constructor(t,e,n){const r=this;let s=!1,o=0,a=0,l;const h=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(c){a++,s===!1&&r.onStart!==void 0&&r.onStart(c,o,a),s=!0},this.itemEnd=function(c){o++,r.onProgress!==void 0&&r.onProgress(c,o,a),o===a&&(s=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(c){r.onError!==void 0&&r.onError(c)},this.resolveURL=function(c){return l?l(c):c},this.setURLModifier=function(c){return l=c,this},this.addHandler=function(c,u){return h.push(c,u),this},this.removeHandler=function(c){const u=h.indexOf(c);return u!==-1&&h.splice(u,2),this},this.getHandler=function(c){for(let u=0,p=h.length;u<p;u+=2){const f=h[u],g=h[u+1];if(f.global&&(f.lastIndex=0),f.test(c))return g}return null}}}const ab=new ob;class cr{constructor(t){this.manager=t!==void 0?t:ab,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){const n=this;return new Promise(function(r,s){n.load(t,r,e,s)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}const fi={};class lb extends cr{constructor(t){super(t)}load(t,e,n,r){t===void 0&&(t=""),this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=this,o=os.get(t);if(o!==void 0)return s.manager.itemStart(t),setTimeout(function(){e&&e(o),s.manager.itemEnd(t)},0),o;if(fi[t]!==void 0)return void fi[t].push({onLoad:e,onProgress:n,onError:r});const a=t.match(/^data:(.*?)(;base64)?,(.*)$/);let l;if(a){const h=a[1],c=!!a[2];let u=a[3];u=decodeURIComponent(u),c&&(u=atob(u));try{let p;const f=(this.responseType||"").toLowerCase();switch(f){case"arraybuffer":case"blob":const g=new Uint8Array(u.length);for(let v=0;v<u.length;v++)g[v]=u.charCodeAt(v);p=f==="blob"?new Blob([g.buffer],{type:h}):g.buffer;break;case"document":p=new DOMParser().parseFromString(u,h);break;case"json":p=JSON.parse(u);break;default:p=u}setTimeout(function(){e&&e(p),s.manager.itemEnd(t)},0)}catch(p){setTimeout(function(){r&&r(p),s.manager.itemError(t),s.manager.itemEnd(t)},0)}}else{fi[t]=[],fi[t].push({onLoad:e,onProgress:n,onError:r}),l=new XMLHttpRequest,l.open("GET",t,!0),l.addEventListener("load",function(h){const c=this.response,u=fi[t];if(delete fi[t],this.status===200||this.status===0){this.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),os.add(t,c);for(let p=0,f=u.length;p<f;p++){const g=u[p];g.onLoad&&g.onLoad(c)}s.manager.itemEnd(t)}else{for(let p=0,f=u.length;p<f;p++){const g=u[p];g.onError&&g.onError(h)}s.manager.itemError(t),s.manager.itemEnd(t)}},!1),l.addEventListener("progress",function(h){const c=fi[t];for(let u=0,p=c.length;u<p;u++){const f=c[u];f.onProgress&&f.onProgress(h)}},!1),l.addEventListener("error",function(h){const c=fi[t];delete fi[t];for(let u=0,p=c.length;u<p;u++){const f=c[u];f.onError&&f.onError(h)}s.manager.itemError(t),s.manager.itemEnd(t)},!1),l.addEventListener("abort",function(h){const c=fi[t];delete fi[t];for(let u=0,p=c.length;u<p;u++){const f=c[u];f.onError&&f.onError(h)}s.manager.itemError(t),s.manager.itemEnd(t)},!1),this.responseType!==void 0&&(l.responseType=this.responseType),this.withCredentials!==void 0&&(l.withCredentials=this.withCredentials),l.overrideMimeType&&l.overrideMimeType(this.mimeType!==void 0?this.mimeType:"text/plain");for(const h in this.requestHeader)l.setRequestHeader(h,this.requestHeader[h]);l.send(null)}return s.manager.itemStart(t),l}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class Lp extends cr{constructor(t){super(t)}load(t,e,n,r){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=this,o=os.get(t);if(o!==void 0)return s.manager.itemStart(t),setTimeout(function(){e&&e(o),s.manager.itemEnd(t)},0),o;const a=document.createElementNS("http://www.w3.org/1999/xhtml","img");function l(){a.removeEventListener("load",l,!1),a.removeEventListener("error",h,!1),os.add(t,this),e&&e(this),s.manager.itemEnd(t)}function h(c){a.removeEventListener("load",l,!1),a.removeEventListener("error",h,!1),r&&r(c),s.manager.itemError(t),s.manager.itemEnd(t)}return a.addEventListener("load",l,!1),a.addEventListener("error",h,!1),t.substr(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),s.manager.itemStart(t),a.src=t,a}}class hb extends cr{constructor(t){super(t)}load(t,e,n,r){const s=new ca,o=new Lp(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let a=0;function l(h){o.load(t[h],function(c){s.images[h]=c,a++,a===6&&(s.needsUpdate=!0,e&&e(s))},void 0,r)}for(let h=0;h<t.length;++h)l(h);return s}}class cb extends cr{constructor(t){super(t)}load(t,e,n,r){const s=new Rt,o=new Lp(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(t,function(a){s.image=a;const l=t.search(/\.jpe?g($|\?)/i)>0||t.search(/^data\:image\/jpeg/)===0;s.format=l?1022:1023,s.needsUpdate=!0,e!==void 0&&e(s)},n,r),s}}class ub extends si{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(t){this.curves.push(t)}closePath(){const t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new wa(e,t))}getPoint(t){const e=t*this.getLength(),n=this.getCurveLengths();let r=0;for(;r<n.length;){if(n[r]>=e){const s=n[r]-e,o=this.curves[r],a=o.getLength(),l=a===0?0:1-s/a;return o.getPointAt(l)}r++}return null}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let n=0,r=this.curves.length;n<r;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t,t}getSpacedPoints(t=40){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){const e=[];let n;for(let r=0,s=this.curves;r<s.length;r++){const o=s[r],a=o&&o.isEllipseCurve?2*t:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?t*o.points.length:t,l=o.getPoints(a);for(let h=0;h<l.length;h++){const c=l[h];n&&n.equals(c)||(e.push(c),n=c)}}return this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const r=t.curves[e];this.curves.push(r.clone())}return this.autoClose=t.autoClose,this}toJSON(){const t=super.toJSON();t.autoClose=this.autoClose,t.curves=[];for(let e=0,n=this.curves.length;e<n;e++){const r=this.curves[e];t.curves.push(r.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const r=t.curves[e];this.curves.push(new xp[r.type]().fromJSON(r))}return this}}class eo extends ub{constructor(t){super(),this.type="Path",this.currentPoint=new F,t&&this.setFromPoints(t)}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,n=t.length;e<n;e++)this.lineTo(t[e].x,t[e].y);return this}moveTo(t,e){return this.currentPoint.set(t,e),this}lineTo(t,e){const n=new wa(this.currentPoint.clone(),new F(t,e));return this.curves.push(n),this.currentPoint.set(t,e),this}quadraticCurveTo(t,e,n,r){const s=new bh(this.currentPoint.clone(),new F(t,e),new F(n,r));return this.curves.push(s),this.currentPoint.set(n,r),this}bezierCurveTo(t,e,n,r,s,o){const a=new xh(this.currentPoint.clone(),new F(t,e),new F(n,r),new F(s,o));return this.curves.push(a),this.currentPoint.set(s,o),this}splineThru(t){const e=[this.currentPoint.clone()].concat(t),n=new Eh(e);return this.curves.push(n),this.currentPoint.copy(t[t.length-1]),this}arc(t,e,n,r,s,o){const a=this.currentPoint.x,l=this.currentPoint.y;return this.absarc(t+a,e+l,n,r,s,o),this}absarc(t,e,n,r,s,o){return this.absellipse(t,e,n,n,r,s,o),this}ellipse(t,e,n,r,s,o,a,l){const h=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(t+h,e+c,n,r,s,o,a,l),this}absellipse(t,e,n,r,s,o,a,l){const h=new ba(t,e,n,r,s,o,a,l);if(this.curves.length>0){const u=h.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(h);const c=h.getPoint(1);return this.currentPoint.copy(c),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class Mh extends eo{constructor(t){super(t),this.uuid=K(),this.type="Shape",this.holes=[]}getPointsHoles(t){const e=[];for(let n=0,r=this.holes.length;n<r;n++)e[n]=this.holes[n].getPoints(t);return e}extractPoints(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}copy(t){super.copy(t),this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const r=t.holes[e];this.holes.push(r.clone())}return this}toJSON(){const t=super.toJSON();t.uuid=this.uuid,t.holes=[];for(let e=0,n=this.holes.length;e<n;e++){const r=this.holes[e];t.holes.push(r.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.uuid=t.uuid,this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const r=t.holes[e];this.holes.push(new eo().fromJSON(r))}return this}}class Pi extends ke{constructor(t,e=1){super(),this.type="Light",this.color=new _e(t),this.intensity=e}dispose(){}copy(t){return super.copy(t),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,this.groundColor!==void 0&&(e.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(e.object.distance=this.distance),this.angle!==void 0&&(e.object.angle=this.angle),this.decay!==void 0&&(e.object.decay=this.decay),this.penumbra!==void 0&&(e.object.penumbra=this.penumbra),this.shadow!==void 0&&(e.object.shadow=this.shadow.toJSON()),e}}Pi.prototype.isLight=!0;class db extends Pi{constructor(t,e,n){super(t,n),this.type="HemisphereLight",this.position.copy(ke.DefaultUp),this.updateMatrix(),this.groundColor=new _e(e)}copy(t){return Pi.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}db.prototype.isHemisphereLight=!0;const Np=new W,Op=new w,Dp=new w;class Ah{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new F(512,512),this.map=null,this.mapPass=null,this.matrix=new W,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new da,this._frameExtents=new F(1,1),this._viewportCount=1,this._viewports=[new at(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera,n=this.matrix;Op.setFromMatrixPosition(t.matrixWorld),e.position.copy(Op),Dp.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(Dp),e.updateMatrixWorld(),Np.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Np),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(e.projectionMatrix),n.multiply(e.matrixWorldInverse)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const t={};return this.bias!==0&&(t.bias=this.bias),this.normalBias!==0&&(t.normalBias=this.normalBias),this.radius!==1&&(t.radius=this.radius),this.mapSize.x===512&&this.mapSize.y===512||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}class Fp extends Ah{constructor(){super(new jn(50,1,.5,500)),this.focus=1}updateMatrices(t){const e=this.camera,n=2*k*t.angle*this.focus,r=this.mapSize.width/this.mapSize.height,s=t.distance||e.far;n===e.fov&&r===e.aspect&&s===e.far||(e.fov=n,e.aspect=r,e.far=s,e.updateProjectionMatrix()),super.updateMatrices(t)}copy(t){return super.copy(t),this.focus=t.focus,this}}Fp.prototype.isSpotLightShadow=!0;class pb extends Pi{constructor(t,e,n=0,r=Math.PI/3,s=0,o=1){super(t,e),this.type="SpotLight",this.position.copy(ke.DefaultUp),this.updateMatrix(),this.target=new ke,this.distance=n,this.angle=r,this.penumbra=s,this.decay=o,this.shadow=new Fp}get power(){return this.intensity*Math.PI}set power(t){this.intensity=t/Math.PI}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}pb.prototype.isSpotLight=!0;const kp=new W,no=new w,Ph=new w;class Up extends Ah{constructor(){super(new jn(90,1,.5,500)),this._frameExtents=new F(4,2),this._viewportCount=6,this._viewports=[new at(2,1,1,1),new at(0,1,1,1),new at(3,1,1,1),new at(1,1,1,1),new at(3,0,1,1),new at(1,0,1,1)],this._cubeDirections=[new w(1,0,0),new w(-1,0,0),new w(0,0,1),new w(0,0,-1),new w(0,1,0),new w(0,-1,0)],this._cubeUps=[new w(0,1,0),new w(0,1,0),new w(0,1,0),new w(0,1,0),new w(0,0,1),new w(0,0,-1)]}updateMatrices(t,e=0){const n=this.camera,r=this.matrix,s=t.distance||n.far;s!==n.far&&(n.far=s,n.updateProjectionMatrix()),no.setFromMatrixPosition(t.matrixWorld),n.position.copy(no),Ph.copy(n.position),Ph.add(this._cubeDirections[e]),n.up.copy(this._cubeUps[e]),n.lookAt(Ph),n.updateMatrixWorld(),r.makeTranslation(-no.x,-no.y,-no.z),kp.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(kp)}}Up.prototype.isPointLightShadow=!0;class fb extends Pi{constructor(t,e,n=0,r=1){super(t,e),this.type="PointLight",this.distance=n,this.decay=r,this.shadow=new Up}get power(){return 4*this.intensity*Math.PI}set power(t){this.intensity=t/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}fb.prototype.isPointLight=!0;class Ch extends ih{constructor(t=-1,e=1,n=1,r=-1,s=.1,o=2e3){super(),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,e,n,r,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=n-t,o=n+t,a=r+e,l=r-e;if(this.view!==null&&this.view.enabled){const h=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=h*this.view.offsetX,o=s+h*this.view.width,a-=c*this.view.offsetY,l=a-c*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,this.view!==null&&(e.object.view=Object.assign({},this.view)),e}}Ch.prototype.isOrthographicCamera=!0;class Bp extends Ah{constructor(){super(new Ch(-5,5,5,-5,.5,500))}}Bp.prototype.isDirectionalLightShadow=!0;class mb extends Pi{constructor(t,e){super(t,e),this.type="DirectionalLight",this.position.copy(ke.DefaultUp),this.updateMatrix(),this.target=new ke,this.shadow=new Bp}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}mb.prototype.isDirectionalLight=!0;class gb extends Pi{constructor(t,e){super(t,e),this.type="AmbientLight"}}gb.prototype.isAmbientLight=!0;class vb extends Pi{constructor(t,e,n=10,r=10){super(t,e),this.type="RectAreaLight",this.width=n,this.height=r}copy(t){return super.copy(t),this.width=t.width,this.height=t.height,this}toJSON(t){const e=super.toJSON(t);return e.object.width=this.width,e.object.height=this.height,e}}vb.prototype.isRectAreaLight=!0;class Gp{constructor(){this.coefficients=[];for(let t=0;t<9;t++)this.coefficients.push(new w)}set(t){for(let e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this}zero(){for(let t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this}getAt(t,e){const n=t.x,r=t.y,s=t.z,o=this.coefficients;return e.copy(o[0]).multiplyScalar(.282095),e.addScaledVector(o[1],.488603*r),e.addScaledVector(o[2],.488603*s),e.addScaledVector(o[3],.488603*n),e.addScaledVector(o[4],n*r*1.092548),e.addScaledVector(o[5],r*s*1.092548),e.addScaledVector(o[6],.315392*(3*s*s-1)),e.addScaledVector(o[7],n*s*1.092548),e.addScaledVector(o[8],.546274*(n*n-r*r)),e}getIrradianceAt(t,e){const n=t.x,r=t.y,s=t.z,o=this.coefficients;return e.copy(o[0]).multiplyScalar(.886227),e.addScaledVector(o[1],1.023328*r),e.addScaledVector(o[2],1.023328*s),e.addScaledVector(o[3],1.023328*n),e.addScaledVector(o[4],.858086*n*r),e.addScaledVector(o[5],.858086*r*s),e.addScaledVector(o[6],.743125*s*s-.247708),e.addScaledVector(o[7],.858086*n*s),e.addScaledVector(o[8],.429043*(n*n-r*r)),e}add(t){for(let e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this}addScaledSH(t,e){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(t.coefficients[n],e);return this}scale(t){for(let e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this}lerp(t,e){for(let n=0;n<9;n++)this.coefficients[n].lerp(t.coefficients[n],e);return this}equals(t){for(let e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0}copy(t){return this.set(t.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(t,e=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].fromArray(t,e+3*r);return this}toArray(t=[],e=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].toArray(t,e+3*r);return t}static getBasisAt(t,e){const n=t.x,r=t.y,s=t.z;e[0]=.282095,e[1]=.488603*r,e[2]=.488603*s,e[3]=.488603*n,e[4]=1.092548*n*r,e[5]=1.092548*r*s,e[6]=.315392*(3*s*s-1),e[7]=1.092548*n*s,e[8]=.546274*(n*n-r*r)}}Gp.prototype.isSphericalHarmonics3=!0;class Ih extends Pi{constructor(t=new Gp,e=1){super(void 0,e),this.sh=t}copy(t){return super.copy(t),this.sh.copy(t.sh),this}fromJSON(t){return this.intensity=t.intensity,this.sh.fromArray(t.sh),this}toJSON(t){const e=super.toJSON(t);return e.object.sh=this.sh.toArray(),e}}Ih.prototype.isLightProbe=!0;class _b{static decodeText(t){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(t);let e="";for(let n=0,r=t.length;n<r;n++)e+=String.fromCharCode(t[n]);try{return decodeURIComponent(escape(e))}catch{return e}}static extractUrlBase(t){const e=t.lastIndexOf("/");return e===-1?"./":t.substr(0,e+1)}}class yb extends He{constructor(){super(),this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}clone(){return new this.constructor().copy(this)}toJSON(){const t=super.toJSON(this);return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}yb.prototype.isInstancedBufferGeometry=!0;class xb extends an{constructor(t,e,n,r=1){typeof n=="number"&&(r=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(t,e,n),this.meshPerAttribute=r}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){const t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}xb.prototype.isInstancedBufferAttribute=!0,class extends cr{constructor(i){super(i),typeof createImageBitmap=="undefined"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch=="undefined"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(i){return this.options=i,this}load(i,t,e,n){i===void 0&&(i=""),this.path!==void 0&&(i=this.path+i),i=this.manager.resolveURL(i);const r=this,s=os.get(i);if(s!==void 0)return r.manager.itemStart(i),setTimeout(function(){t&&t(s),r.manager.itemEnd(i)},0),s;const o={};o.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",o.headers=this.requestHeader,fetch(i,o).then(function(a){return a.blob()}).then(function(a){return createImageBitmap(a,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(a){os.add(i,a),t&&t(a),r.manager.itemEnd(i)}).catch(function(a){n&&n(a),r.manager.itemError(i),r.manager.itemEnd(i)}),r.manager.itemStart(i)}}.prototype.isImageBitmapLoader=!0;let Rh;const bb=function(){return Rh===void 0&&(Rh=new(window.AudioContext||window.webkitAudioContext)),Rh};class Eb extends cr{constructor(t){super(t)}load(t,e,n,r){const s=this,o=new lb(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,function(a){try{const l=a.slice(0);bb().decodeAudioData(l,function(h){e(h)})}catch(l){r?r(l):console.error(l),s.manager.itemError(t)}},n,r)}}(class extends Ih{constructor(i,t,e=1){super(void 0,e);const n=new _e().set(i),r=new _e().set(t),s=new w(n.r,n.g,n.b),o=new w(r.r,r.g,r.b),a=Math.sqrt(Math.PI),l=a*Math.sqrt(.75);this.sh.coefficients[0].copy(s).add(o).multiplyScalar(a),this.sh.coefficients[1].copy(s).sub(o).multiplyScalar(l)}}).prototype.isHemisphereLightProbe=!0,class extends Ih{constructor(i,t=1){super(void 0,t);const e=new _e().set(i);this.sh.coefficients[0].set(e.r,e.g,e.b).multiplyScalar(2*Math.sqrt(Math.PI))}}.prototype.isAmbientLightProbe=!0;class wb extends ke{constructor(t){super(),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this}setMediaElementSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this}setMediaStreamSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this}setBuffer(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this}play(t=0){if(this.isPlaying===!0)return void console.warn("THREE.Audio: Audio is already playing.");if(this.hasPlaybackControl===!1)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+t;const e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl!==!1)return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(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.")}stop(){if(this.hasPlaybackControl!==!1)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.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(t){return t||(t=[]),this._connected===!0?(this.disconnect(),this.filters=t.slice(),this.connect()):this.filters=t.slice(),this}setDetune(t){if(this.detune=t,this.source.detune!==void 0)return this.isPlaying===!0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(t){return this.setFilters(t?[t]:[])}setPlaybackRate(t){if(this.hasPlaybackControl!==!1)return this.playbackRate=t,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(t){if(this.hasPlaybackControl!==!1)return this.loop=t,this.isPlaying===!0&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}setLoopStart(t){return this.loopStart=t,this}setLoopEnd(t){return this.loopEnd=t,this}getVolume(){return this.gain.gain.value}setVolume(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}}class Tb{constructor(t,e,n){let r,s,o;switch(this.binding=t,this.valueSize=n,e){case"quaternion":r=this._slerp,s=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*n),this._workIndex=5;break;case"string":case"bool":r=this._select,s=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(5*n);break;default:r=this._lerp,s=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*n)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=s,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(t,e){const n=this.buffer,r=this.valueSize,s=t*r+r;let o=this.cumulativeWeight;if(o===0){for(let a=0;a!==r;++a)n[s+a]=n[a];o=e}else{o+=e;const a=e/o;this._mixBufferRegion(n,s,0,a,r)}this.cumulativeWeight=o}accumulateAdditive(t){const e=this.buffer,n=this.valueSize,r=n*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(e,r,0,t,n),this.cumulativeWeightAdditive+=t}apply(t){const e=this.valueSize,n=this.buffer,r=t*e+e,s=this.cumulativeWeight,o=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,s<1){const l=e*this._origIndex;this._mixBufferRegion(n,r,l,1-s,e)}o>0&&this._mixBufferRegionAdditive(n,r,this._addIndex*e,1,e);for(let l=e,h=e+e;l!==h;++l)if(n[l]!==n[l+e]){a.setValue(n,r);break}}saveOriginalState(){const t=this.binding,e=this.buffer,n=this.valueSize,r=n*this._origIndex;t.getValue(e,r);for(let s=n,o=r;s!==o;++s)e[s]=e[r+s%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let n=t;n<e;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const t=this._origIndex*this.valueSize,e=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[e+n]=this.buffer[t+n]}_select(t,e,n,r,s){if(r>=.5)for(let o=0;o!==s;++o)t[e+o]=t[n+o]}_slerp(t,e,n,r){lt.slerpFlat(t,e,t,e,t,n,r)}_slerpAdditive(t,e,n,r,s){const o=this._workIndex*s;lt.multiplyQuaternionsFlat(t,o,t,e,t,n),lt.slerpFlat(t,e,t,e,t,o,r)}_lerp(t,e,n,r,s){const o=1-r;for(let a=0;a!==s;++a){const l=e+a;t[l]=t[l]*o+t[n+a]*r}}_lerpAdditive(t,e,n,r,s){for(let o=0;o!==s;++o){const a=e+o;t[a]=t[a]+t[n+o]*r}}}const Sb=new RegExp("[\\[\\]\\.:\\/]","g"),Mb="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Ab=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),Pb=/(WCOD+)?/.source.replace("WCOD",Mb),Cb=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Ib=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Rb=new RegExp("^"+Ab+Pb+Cb+Ib+"$"),Lb=["material","materials","bones"];class Ue{constructor(t,e,n){this.path=e,this.parsedPath=n||Ue.parseTrackName(e),this.node=Ue.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,n){return t&&t.isAnimationObjectGroup?new Ue.Composite(t,e,n):new Ue(t,e,n)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(Sb,"")}static parseTrackName(t){const e=Rb.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const s=n.nodeName.substring(r+1);Lb.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}static findNode(t,e){if(!e||e===""||e==="."||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){const n=t.skeleton.getBoneByName(e);if(n!==void 0)return n}if(t.children){const n=function(s){for(let o=0;o<s.length;o++){const a=s[o];if(a.name===e||a.uuid===e)return a;const l=n(a.children);if(l)return l}return null},r=n(t.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.node[this.propertyName]}_getValue_array(t,e){const n=this.resolvedProperty;for(let r=0,s=n.length;r!==s;++r)t[e++]=n[r]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){const n=this.resolvedProperty;for(let r=0,s=n.length;r!==s;++r)n[r]=t[e++]}_setValue_array_setNeedsUpdate(t,e){const n=this.resolvedProperty;for(let r=0,s=n.length;r!==s;++r)n[r]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){const n=this.resolvedProperty;for(let r=0,s=n.length;r!==s;++r)n[r]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node;const e=this.parsedPath,n=e.objectName,r=e.propertyName;let s=e.propertyIndex;if(t||(t=Ue.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(n){let h=e.objectIndex;switch(n){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(let c=0;c<t.length;c++)if(t[c].name===h){h=c;break}break;default:if(t[n]===void 0)return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[n]}if(h!==void 0){if(t[h]===void 0)return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[h]}}const o=t[r];if(o===void 0){const h=e.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+h+"."+r+" but it wasn't found.",t)}let a=this.Versioning.None;this.targetObject=t,t.needsUpdate!==void 0?a=this.Versioning.NeedsUpdate:t.matrixWorldNeedsUpdate!==void 0&&(a=this.Versioning.MatrixWorldNeedsUpdate);let l=this.BindingType.Direct;if(s!==void 0){if(r==="morphTargetInfluences"){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!t.geometry.isBufferGeometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);t.morphTargetDictionary[s]!==void 0&&(s=t.morphTargetDictionary[s])}l=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else o.fromArray!==void 0&&o.toArray!==void 0?(l=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(l=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=r;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Ue.Composite=class{constructor(i,t,e){const n=e||Ue.parseTrackName(t);this._targetGroup=i,this._bindings=i.subscribe_(t,n)}getValue(i,t){this.bind();const e=this._targetGroup.nCachedObjects_,n=this._bindings[e];n!==void 0&&n.getValue(i,t)}setValue(i,t){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].setValue(i,t)}bind(){const i=this._bindings;for(let t=this._targetGroup.nCachedObjects_,e=i.length;t!==e;++t)i[t].bind()}unbind(){const i=this._bindings;for(let t=this._targetGroup.nCachedObjects_,e=i.length;t!==e;++t)i[t].unbind()}},Ue.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Ue.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},Ue.prototype.GetterByBindingType=[Ue.prototype._getValue_direct,Ue.prototype._getValue_array,Ue.prototype._getValue_arrayElement,Ue.prototype._getValue_toArray],Ue.prototype.SetterByBindingTypeAndVersioning=[[Ue.prototype._setValue_direct,Ue.prototype._setValue_direct_setNeedsUpdate,Ue.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Ue.prototype._setValue_array,Ue.prototype._setValue_array_setNeedsUpdate,Ue.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Ue.prototype._setValue_arrayElement,Ue.prototype._setValue_arrayElement_setNeedsUpdate,Ue.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Ue.prototype._setValue_fromArray,Ue.prototype._setValue_fromArray_setNeedsUpdate,Ue.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class Nb{constructor(t,e,n=null,r=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=n,this.blendMode=r;const s=e.tracks,o=s.length,a=new Array(o),l={endingStart:2400,endingEnd:2400};for(let h=0;h!==o;++h){const c=s[h].createInterpolant(null);a[h]=c,c.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,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}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,e,n){if(t.fadeOut(e),this.fadeIn(e),n){const r=this._clip.duration,s=t._clip.duration,o=s/r,a=r/s;t.warp(1,o,e),this.warp(a,1,e)}return this}crossFadeTo(t,e,n){return t.crossFadeFrom(this,e,n)}stopFading(){const t=this._weightInterpolant;return t!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,e,n){const r=this._mixer,s=r.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,h=a.sampleValues;return l[0]=s,l[1]=s+n,h[0]=t/o,h[1]=e/o,this}stopWarping(){const t=this._timeScaleInterpolant;return t!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,n,r){if(!this.enabled)return void this._updateWeight(t);const s=this._startTime;if(s!==null){const l=(t-s)*n;if(l<0||n===0)return;this._startTime=null,e=n*l}e*=this._updateTimeScale(t);const o=this._updateTime(e),a=this._updateWeight(t);if(a>0){const l=this._interpolants,h=this._propertyBindings;switch(this.blendMode){case 2501:for(let c=0,u=l.length;c!==u;++c)l[c].evaluate(o),h[c].accumulateAdditive(a);break;case 2500:default:for(let c=0,u=l.length;c!==u;++c)l[c].evaluate(o),h[c].accumulate(r,a)}}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const n=this._weightInterpolant;if(n!==null){const r=n.evaluate(t)[0];e*=r,t>n.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const n=this._timeScaleInterpolant;n!==null&&(e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),e===0?this.paused=!0:this.timeScale=e))}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,n=this.loop;let r=this.time+t,s=this._loopCount;const o=n===2202;if(t===0)return s===-1?r:o&&(1&s)==1?e-r:r;if(n===2200){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(r>=e)r=e;else{if(!(r<0)){this.time=r;break t}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(s===-1&&(t>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),r>=e||r<0){const a=Math.floor(r/e);r-=e*a,s+=Math.abs(a);const l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=t>0?e:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(l===1){const h=t<0;this._setEndings(h,!h,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(o&&(1&s)==1)return e-r}return r}_setEndings(t,e,n){const r=this._interpolantSettings;n?(r.endingStart=2401,r.endingEnd=2401):(r.endingStart=t?this.zeroSlopeAtStart?2401:2400:2402,r.endingEnd=e?this.zeroSlopeAtEnd?2401:2400:2402)}_scheduleFading(t,e,n){const r=this._mixer,s=r.time;let o=this._weightInterpolant;o===null&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=e,a[1]=s+t,l[1]=n,this}}(class extends N{constructor(i){super(),this._root=i,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(i,t){const e=i._localRoot||this._root,n=i._clip.tracks,r=n.length,s=i._propertyBindings,o=i._interpolants,a=e.uuid,l=this._bindingsByRootAndName;let h=l[a];h===void 0&&(h={},l[a]=h);for(let c=0;c!==r;++c){const u=n[c],p=u.name;let f=h[p];if(f!==void 0)s[c]=f;else{if(f=s[c],f!==void 0){f._cacheIndex===null&&(++f.referenceCount,this._addInactiveBinding(f,a,p));continue}const g=t&&t._propertyBindings[c].binding.parsedPath;f=new Tb(Ue.create(e,p,g),u.ValueTypeName,u.getValueSize()),++f.referenceCount,this._addInactiveBinding(f,a,p),s[c]=f}o[c].resultBuffer=f.buffer}}_activateAction(i){if(!this._isActiveAction(i)){if(i._cacheIndex===null){const e=(i._localRoot||this._root).uuid,n=i._clip.uuid,r=this._actionsByClip[n];this._bindAction(i,r&&r.knownActions[0]),this._addInactiveAction(i,n,e)}const t=i._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const r=t[e];r.useCount++==0&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(i)}}_deactivateAction(i){if(this._isActiveAction(i)){const t=i._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const r=t[e];--r.useCount==0&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(i)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const i=this;this.stats={actions:{get total(){return i._actions.length},get inUse(){return i._nActiveActions}},bindings:{get total(){return i._bindings.length},get inUse(){return i._nActiveBindings}},controlInterpolants:{get total(){return i._controlInterpolants.length},get inUse(){return i._nActiveControlInterpolants}}}}_isActiveAction(i){const t=i._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(i,t,e){const n=this._actions,r=this._actionsByClip;let s=r[t];if(s===void 0)s={knownActions:[i],actionByRoot:{}},i._byClipCacheIndex=0,r[t]=s;else{const o=s.knownActions;i._byClipCacheIndex=o.length,o.push(i)}i._cacheIndex=n.length,n.push(i),s.actionByRoot[e]=i}_removeInactiveAction(i){const t=this._actions,e=t[t.length-1],n=i._cacheIndex;e._cacheIndex=n,t[n]=e,t.pop(),i._cacheIndex=null;const r=i._clip.uuid,s=this._actionsByClip,o=s[r],a=o.knownActions,l=a[a.length-1],h=i._byClipCacheIndex;l._byClipCacheIndex=h,a[h]=l,a.pop(),i._byClipCacheIndex=null,delete o.actionByRoot[(i._localRoot||this._root).uuid],a.length===0&&delete s[r],this._removeInactiveBindingsForAction(i)}_removeInactiveBindingsForAction(i){const t=i._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const r=t[e];--r.referenceCount==0&&this._removeInactiveBinding(r)}}_lendAction(i){const t=this._actions,e=i._cacheIndex,n=this._nActiveActions++,r=t[n];i._cacheIndex=n,t[n]=i,r._cacheIndex=e,t[e]=r}_takeBackAction(i){const t=this._actions,e=i._cacheIndex,n=--this._nActiveActions,r=t[n];i._cacheIndex=n,t[n]=i,r._cacheIndex=e,t[e]=r}_addInactiveBinding(i,t,e){const n=this._bindingsByRootAndName,r=this._bindings;let s=n[t];s===void 0&&(s={},n[t]=s),s[e]=i,i._cacheIndex=r.length,r.push(i)}_removeInactiveBinding(i){const t=this._bindings,e=i.binding,n=e.rootNode.uuid,r=e.path,s=this._bindingsByRootAndName,o=s[n],a=t[t.length-1],l=i._cacheIndex;a._cacheIndex=l,t[l]=a,t.pop(),delete o[r],Object.keys(o).length===0&&delete s[n]}_lendBinding(i){const t=this._bindings,e=i._cacheIndex,n=this._nActiveBindings++,r=t[n];i._cacheIndex=n,t[n]=i,r._cacheIndex=e,t[e]=r}_takeBackBinding(i){const t=this._bindings,e=i._cacheIndex,n=--this._nActiveBindings,r=t[n];i._cacheIndex=n,t[n]=i,r._cacheIndex=e,t[e]=r}_lendControlInterpolant(){const i=this._controlInterpolants,t=this._nActiveControlInterpolants++;let e=i[t];return e===void 0&&(e=new Cp(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),e.__cacheIndex=t,i[t]=e),e}_takeBackControlInterpolant(i){const t=this._controlInterpolants,e=i.__cacheIndex,n=--this._nActiveControlInterpolants,r=t[n];i.__cacheIndex=n,t[n]=i,r.__cacheIndex=e,t[e]=r}clipAction(i,t,e){const n=t||this._root,r=n.uuid;let s=typeof i=="string"?Rp.findByName(n,i):i;const o=s!==null?s.uuid:i,a=this._actionsByClip[o];let l=null;if(e===void 0&&(e=s!==null?s.blendMode:2500),a!==void 0){const c=a.actionByRoot[r];if(c!==void 0&&c.blendMode===e)return c;l=a.knownActions[0],s===null&&(s=l._clip)}if(s===null)return null;const h=new Nb(this,s,t,e);return this._bindAction(h,l),this._addInactiveAction(h,o,r),h}existingAction(i,t){const e=t||this._root,n=e.uuid,r=typeof i=="string"?Rp.findByName(e,i):i,s=r?r.uuid:i,o=this._actionsByClip[s];return o!==void 0&&o.actionByRoot[n]||null}stopAllAction(){const i=this._actions;for(let t=this._nActiveActions-1;t>=0;--t)i[t].stop();return this}update(i){i*=this.timeScale;const t=this._actions,e=this._nActiveActions,n=this.time+=i,r=Math.sign(i),s=this._accuIndex^=1;for(let l=0;l!==e;++l)t[l]._update(n,i,r,s);const o=this._bindings,a=this._nActiveBindings;for(let l=0;l!==a;++l)o[l].apply(s);return this}setTime(i){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(i)}getRoot(){return this._root}uncacheClip(i){const t=this._actions,e=i.uuid,n=this._actionsByClip,r=n[e];if(r!==void 0){const s=r.knownActions;for(let o=0,a=s.length;o!==a;++o){const l=s[o];this._deactivateAction(l);const h=l._cacheIndex,c=t[t.length-1];l._cacheIndex=null,l._byClipCacheIndex=null,c._cacheIndex=h,t[h]=c,t.pop(),this._removeInactiveBindingsForAction(l)}delete n[e]}}uncacheRoot(i){const t=i.uuid,e=this._actionsByClip;for(const r in e){const s=e[r].actionByRoot[t];s!==void 0&&(this._deactivateAction(s),this._removeInactiveAction(s))}const n=this._bindingsByRootAndName[t];if(n!==void 0)for(const r in n){const s=n[r];s.restoreOriginalState(),this._removeInactiveBinding(s)}}uncacheAction(i,t){const e=this.existingAction(i,t);e!==null&&(this._deactivateAction(e),this._removeInactiveAction(e))}}).prototype._controlInterpolantsResultBuffer=new Float32Array(1),class extends zs{constructor(i,t,e=1){super(i,t),this.meshPerAttribute=e}copy(i){return super.copy(i),this.meshPerAttribute=i.meshPerAttribute,this}clone(i){const t=super.clone(i);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(i){const t=super.toJSON(i);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}.prototype.isInstancedInterleavedBuffer=!0,new F,new w,new w,class extends ke{constructor(i){super(),this.material=i,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}}.prototype.isImmediateRenderObject=!0;const ur=new w,Ca=new W,Lh=new W,Ob=new Float32Array(1);new Int32Array(Ob.buffer);const Hp=[.125,.215,.35,.446,.526,.582],Db=5+Hp.length,Fb=new Zl({side:1,depthWrite:!1,depthTest:!1});new kn(new Us,Fb),kb();function kb(){const i=[],t=[],e=[];let n=8;for(let r=0;r<Db;r++){const s=Math.pow(2,n);t.push(s);let o=1/s;r>4?o=Hp[r-8+4-1]:r==0&&(o=0),e.push(o);const a=1/(s-1),l=-a/2,h=1+a/2,c=[l,l,h,l,h,h,l,l,h,h,l,h],u=6,p=6,f=3,g=2,_=1,v=new Float32Array(f*p*u),M=new Float32Array(g*p*u),A=new Float32Array(_*p*u);for(let H=0;H<u;H++){const j=H%3*2/3-1,X=H>2?0:-1,U=[j,X,0,j+2/3,X,0,j+2/3,X+1,0,j,X,0,j+2/3,X+1,0,j,X+1,0];v.set(U,f*p*H),M.set(c,g*p*H);const V=[H,H,H,H,H,H];A.set(V,_*p*H)}const O=new He;O.setAttribute("position",new an(v,f)),O.setAttribute("uv",new an(M,g)),O.setAttribute("faceIndex",new an(A,_)),i.push(O),n>4&&n--}return{_lodPlanes:i,_sizeLods:t,_sigmas:e}}si.create=function(i,t){return console.log("THREE.Curve.create() has been deprecated"),i.prototype=Object.create(si.prototype),i.prototype.constructor=i,i.prototype.getPoint=t,i},eo.prototype.fromPoints=function(i){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(i)},class extends ph{constructor(i=10,t=10,e=4473924,n=8947848){e=new _e(e),n=new _e(n);const r=t/2,s=i/t,o=i/2,a=[],l=[];for(let c=0,u=0,p=-o;c<=t;c++,p+=s){a.push(-o,0,p,o,0,p),a.push(p,0,-o,p,0,o);const f=c===r?e:n;f.toArray(l,u),u+=3,f.toArray(l,u),u+=3,f.toArray(l,u),u+=3,f.toArray(l,u),u+=3}const h=new He;h.setAttribute("position",new Fe(a,3)),h.setAttribute("color",new Fe(l,3)),super(h,new qs({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},class extends ph{constructor(i){const t=function a(l){const h=[];l&&l.isBone&&h.push(l);for(let c=0;c<l.children.length;c++)h.push.apply(h,a(l.children[c]));return h}(i),e=new He,n=[],r=[],s=new _e(0,0,1),o=new _e(0,1,0);for(let a=0;a<t.length;a++){const l=t[a];l.parent&&l.parent.isBone&&(n.push(0,0,0),n.push(0,0,0),r.push(s.r,s.g,s.b),r.push(o.r,o.g,o.b))}e.setAttribute("position",new Fe(n,3)),e.setAttribute("color",new Fe(r,3)),super(e,new qs({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.type="SkeletonHelper",this.isSkeletonHelper=!0,this.root=i,this.bones=t,this.matrix=i.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(i){const t=this.bones,e=this.geometry,n=e.getAttribute("position");Lh.copy(this.root.matrixWorld).invert();for(let r=0,s=0;r<t.length;r++){const o=t[r];o.parent&&o.parent.isBone&&(Ca.multiplyMatrices(Lh,o.matrixWorld),ur.setFromMatrixPosition(Ca),n.setXYZ(s,ur.x,ur.y,ur.z),Ca.multiplyMatrices(Lh,o.parent.matrixWorld),ur.setFromMatrixPosition(Ca),n.setXYZ(s+1,ur.x,ur.y,ur.z),s+=2)}e.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(i)}}.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},cr.prototype.extractUrlBase=function(i){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),_b.extractUrlBase(i)},cr.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.")}},dt.prototype.center=function(i){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(i)},dt.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},dt.prototype.isIntersectionBox=function(i){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(i)},dt.prototype.isIntersectionSphere=function(i){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(i)},dt.prototype.size=function(i){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(i)},je.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()},da.prototype.setFromMatrix=function(i){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(i)},P.prototype.flattenToArrayOffset=function(i,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(i,t)},P.prototype.multiplyVector3=function(i){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),i.applyMatrix3(this)},P.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},P.prototype.applyToBufferAttribute=function(i){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),i.applyMatrix3(this)},P.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},P.prototype.getInverse=function(i){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(i).invert()},W.prototype.extractPosition=function(i){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(i)},W.prototype.flattenToArrayOffset=function(i,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(i,t)},W.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),new w().setFromMatrixColumn(this,3)},W.prototype.setRotationFromQuaternion=function(i){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(i)},W.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},W.prototype.multiplyVector3=function(i){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)},W.prototype.multiplyVector4=function(i){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)},W.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},W.prototype.rotateAxis=function(i){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),i.transformDirection(this)},W.prototype.crossVector=function(i){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)},W.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")},W.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},W.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},W.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},W.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},W.prototype.applyToBufferAttribute=function(i){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)},W.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},W.prototype.makeFrustum=function(i,t,e,n,r,s){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(i,t,n,e,r,s)},W.prototype.getInverse=function(i){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(i).invert()},zi.prototype.isIntersectionLine=function(i){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(i)},lt.prototype.multiplyVector3=function(i){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),i.applyQuaternion(this)},lt.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()},z.prototype.isIntersectionBox=function(i){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(i)},z.prototype.isIntersectionPlane=function(i){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(i)},z.prototype.isIntersectionSphere=function(i){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(i)},pn.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},pn.prototype.barycoordFromPoint=function(i,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(i,t)},pn.prototype.midpoint=function(i){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(i)},pn.prototypenormal=function(i){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(i)},pn.prototype.plane=function(i){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(i)},pn.barycoordFromPoint=function(i,t,e,n,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),pn.getBarycoord(i,t,e,n,r)},pn.normal=function(i,t,e,n){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),pn.getNormal(i,t,e,n)},Mh.prototype.extractAllPoints=function(i){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(i)},Mh.prototype.extrude=function(i){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new is(this,i)},Mh.prototype.makeGeometry=function(i){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Sh(this,i)},F.prototype.fromAttribute=function(i,t,e){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(i,t,e)},F.prototype.distanceToManhattan=function(i){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(i)},F.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},w.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},w.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},w.prototype.getPositionFromMatrix=function(i){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(i)},w.prototype.getScaleFromMatrix=function(i){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(i)},w.prototype.getColumnFromMatrix=function(i,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,i)},w.prototype.applyProjection=function(i){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(i)},w.prototype.fromAttribute=function(i,t,e){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(i,t,e)},w.prototype.distanceToManhattan=function(i){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(i)},w.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},at.prototype.fromAttribute=function(i,t,e){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(i,t,e)},at.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},ke.prototype.getChildByName=function(i){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(i)},ke.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},ke.prototype.translate=function(i,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,i)},ke.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},ke.prototype.applyMatrix=function(i){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(i)},Object.defineProperties(ke.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(i){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=i}},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.")}}}),kn.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(kn.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),ip.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},jn.prototype.setLens=function(i,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),t!==void 0&&(this.filmGauge=t),this.setFocalLength(i)},Object.defineProperties(Pi.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(i){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=i}},shadowCameraLeft:{set:function(i){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=i}},shadowCameraRight:{set:function(i){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=i}},shadowCameraTop:{set:function(i){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=i}},shadowCameraBottom:{set:function(i){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=i}},shadowCameraNear:{set:function(i){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=i}},shadowCameraFar:{set:function(i){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=i}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(i){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=i}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(i){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=i}},shadowMapHeight:{set:function(i){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=i}}}),Object.defineProperties(an.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===35048},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(35048)}}}),an.prototype.setDynamic=function(i){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(i===!0?35048:35044),this},an.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},an.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},He.prototype.addIndex=function(i){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(i)},He.prototype.addAttribute=function(i,t){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?i==="index"?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(i,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(i,new an(arguments[1],arguments[2])))},He.prototype.addDrawCall=function(i,t,e){e!==void 0&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(i,t)},He.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},He.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},He.prototype.removeAttribute=function(i){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(i)},He.prototype.applyMatrix=function(i){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(i)},Object.defineProperties(He.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}}}),zs.prototype.setDynamic=function(i){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(i===!0?35048:35044),this},zs.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},is.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},is.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},is.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")},hh.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")},Object.defineProperties(Rn.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 _e}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(i){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=i===1}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(i){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=i}}}),Object.defineProperties(pi.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(i){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=i}}}),ze.prototype.clearTarget=function(i,t,e,n){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(i),this.clear(t,e,n)},ze.prototype.animate=function(i){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(i)},ze.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},ze.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},ze.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},ze.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},ze.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},ze.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},ze.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},ze.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},ze.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},ze.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},ze.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},ze.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},ze.prototype.enableScissorTest=function(i){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(i)},ze.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},ze.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},ze.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},ze.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},ze.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},ze.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},ze.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},ze.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},ze.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},ze.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()},Object.defineProperties(ze.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(i){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=i}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(i){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=i}},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(i){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=i===!0?3001:3e3}},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(Yd.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($.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(i){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=i}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(i){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=i}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(i){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=i}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(i){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=i}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(i){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=i}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(i){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=i}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(i){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=i}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(i){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=i}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(i){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=i}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(i){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=i}}}),wb.prototype.load=function(i){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const t=this;return new Eb().load(i,function(e){t.setBuffer(e)}),this},rh.prototype.updateCubeMap=function(i,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(i,t)},rh.prototype.clear=function(i,t,e,n){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(i,t,e,n)},G.crossOrigin=void 0,G.loadTexture=function(i,t,e,n){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");const r=new cb;r.setCrossOrigin(this.crossOrigin);const s=r.load(i,e,void 0,n);return t&&(s.mapping=t),s},G.loadTextureCube=function(i,t,e,n){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");const r=new hb;r.setCrossOrigin(this.crossOrigin);const s=r.load(i,e,void 0,n);return t&&(s.mapping=t),s},G.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},G.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"130"}})),typeof window!="undefined"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="130");var Ub=d(0),cn=d.n(Ub),Bb=d(21),Gb=d.n(Bb),Hb=d(1),Sn=d.n(Hb);class zb{constructor(){this.camera=new Ch(10,10,10,10),this.camera.position.z=100,this.camera.position.x=0,this.camera.position.y=0}focus(t,e){t.position.z=50}updateAspect(t,e){this.camera.left=-1*t/2,this.camera.right=t/2,this.camera.top=e/2,this.camera.bottom=-1*e/2,this.camera.updateProjectionMatrix()}}const zp={linear:(i,t,e,n)=>e*i/n+t,easeIn:(i,t,e,n)=>e*(i/=n)*i+t,strongEaseIn:(i,t,e,n)=>e*(i/=n)*i*i*i*i+t,strongEaseOut:(i,t,e,n)=>e*((i=i/n-1)*i*i*i*i+1)+t,sineaseIn:(i,t,e,n)=>e*(i/=n)*i*i+t,sineaseOut:(i,t,e,n)=>e*((i=i/n-1)*i*i+1)+t},Ci=new Rt;class Mn{constructor(){this.camera=new zb,this.mesh=new kn,this.material=null,this.geometry=null}applyOptions(t){}addObjects(t){this.mesh.position.z=50,t.add(this.mesh)}setSize(t,e){this.camera.updateAspect(t,e),this.geometry=new pa(t,e,1,1),this.material=new pi({fragmentShader:this.fragmentShader,vertexShader:`
|
|
4917
|
+
}`}),f=p.clone();f.defines.HORIZONTAL_PASS=1;const g=new He;g.setAttribute("position",new an(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new kn(g,p),v=this;function M(X,U){const V=t.update(_);p.uniforms.shadow_pass.value=X.map.texture,p.uniforms.resolution.value=X.mapSize,p.uniforms.radius.value=X.radius,i.setRenderTarget(X.mapPass),i.clear(),i.renderBufferDirect(U,null,V,p,_,null),f.uniforms.shadow_pass.value=X.mapPass.texture,f.uniforms.resolution.value=X.mapSize,f.uniforms.radius.value=X.radius,i.setRenderTarget(X.map),i.clear(),i.renderBufferDirect(U,null,V,f,_,null)}function A(X){const U=X<<0;let V=a[U];return V===void 0&&(V=new Wd({depthPacking:3201,morphTargets:X}),a[U]=V),V}function O(X){const U=X<<0;let V=l[U];return V===void 0&&(V=new Xd({morphTargets:X}),l[U]=V),V}function H(X,U,V,xt,it,Q,st){let nt=null,ct=A,Lt=X.customDepthMaterial;if(xt.isPointLight===!0&&(ct=O,Lt=X.customDistanceMaterial),Lt===void 0){let At=!1;V.morphTargets===!0&&(At=U.morphAttributes&&U.morphAttributes.position&&U.morphAttributes.position.length>0),nt=ct(At)}else nt=Lt;if(i.localClippingEnabled&&V.clipShadows===!0&&V.clippingPlanes.length!==0){const At=nt.uuid,ht=V.uuid;let gt=h[At];gt===void 0&&(gt={},h[At]=gt);let Ut=gt[ht];Ut===void 0&&(Ut=nt.clone(),gt[ht]=Ut),nt=Ut}return nt.visible=V.visible,nt.wireframe=V.wireframe,nt.side=st===3?V.shadowSide!==null?V.shadowSide:V.side:V.shadowSide!==null?V.shadowSide:u[V.side],nt.clipShadows=V.clipShadows,nt.clippingPlanes=V.clippingPlanes,nt.clipIntersection=V.clipIntersection,nt.wireframeLinewidth=V.wireframeLinewidth,nt.linewidth=V.linewidth,xt.isPointLight===!0&&nt.isMeshDistanceMaterial===!0&&(nt.referencePosition.setFromMatrixPosition(xt.matrixWorld),nt.nearDistance=it,nt.farDistance=Q),nt}function j(X,U,V,xt,it){if(X.visible===!1)return;if(X.layers.test(U.layers)&&(X.isMesh||X.isLine||X.isPoints)&&(X.castShadow||X.receiveShadow&&it===3)&&(!X.frustumCulled||n.intersectsObject(X))){X.modelViewMatrix.multiplyMatrices(V.matrixWorldInverse,X.matrixWorld);const st=t.update(X),nt=X.material;if(Array.isArray(nt)){const ct=st.groups;for(let Lt=0,At=ct.length;Lt<At;Lt++){const ht=ct[Lt],gt=nt[ht.materialIndex];if(gt&>.visible){const Ut=H(X,st,gt,xt,V.near,V.far,it);i.renderBufferDirect(V,null,st,Ut,X,ht)}}}else if(nt.visible){const ct=H(X,st,nt,xt,V.near,V.far,it);i.renderBufferDirect(V,null,st,ct,X,null)}}const Q=X.children;for(let st=0,nt=Q.length;st<nt;st++)j(Q[st],U,V,xt,it)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(X,U,V){if(v.enabled===!1||v.autoUpdate===!1&&v.needsUpdate===!1||X.length===0)return;const xt=i.getRenderTarget(),it=i.getActiveCubeFace(),Q=i.getActiveMipmapLevel(),st=i.state;st.setBlending(0),st.buffers.color.setClear(1,1,1,1),st.buffers.depth.setTest(!0),st.setScissorTest(!1);for(let nt=0,ct=X.length;nt<ct;nt++){const Lt=X[nt],At=Lt.shadow;if(At===void 0){console.warn("THREE.WebGLShadowMap:",Lt,"has no shadow.");continue}if(At.autoUpdate===!1&&At.needsUpdate===!1)continue;r.copy(At.mapSize);const ht=At.getFrameExtents();if(r.multiply(ht),s.copy(At.mapSize),(r.x>c||r.y>c)&&(r.x>c&&(s.x=Math.floor(c/ht.x),r.x=s.x*ht.x,At.mapSize.x=s.x),r.y>c&&(s.y=Math.floor(c/ht.y),r.y=s.y*ht.y,At.mapSize.y=s.y)),At.map===null&&!At.isPointLightShadow&&this.type===3){const Ut={minFilter:1006,magFilter:1006,format:1023};At.map=new $(r.x,r.y,Ut),At.map.texture.name=Lt.name+".shadowMap",At.mapPass=new $(r.x,r.y,Ut),At.camera.updateProjectionMatrix()}if(At.map===null){const Ut={minFilter:1003,magFilter:1003,format:1023};At.map=new $(r.x,r.y,Ut),At.map.texture.name=Lt.name+".shadowMap",At.camera.updateProjectionMatrix()}i.setRenderTarget(At.map),i.clear();const gt=At.getViewportCount();for(let Ut=0;Ut<gt;Ut++){const Vt=At.getViewport(Ut);o.set(s.x*Vt.x,s.y*Vt.y,s.x*Vt.z,s.y*Vt.w),st.viewport(o),At.updateMatrices(Lt,Ut),n=At.getFrustum(),j(U,V,At.camera,Lt,this.type)}At.isPointLightShadow||this.type!==3||M(At,V),At.needsUpdate=!1}v.needsUpdate=!1,i.setRenderTarget(xt,it,Q)}}function Tx(i,t,e){const n=e.isWebGL2,r=new function(){let Y=!1;const pt=new at;let Et=null;const Tt=new at(0,0,0,0);return{setMask:function(St){Et===St||Y||(i.colorMask(St,St,St,St),Et=St)},setLocked:function(St){Y=St},setClear:function(St,Qt,ce,ae,se){se===!0&&(St*=ae,Qt*=ae,ce*=ae),pt.set(St,Qt,ce,ae),Tt.equals(pt)===!1&&(i.clearColor(St,Qt,ce,ae),Tt.copy(pt))},reset:function(){Y=!1,Et=null,Tt.set(-1,0,0,0)}}},s=new function(){let Y=!1,pt=null,Et=null,Tt=null;return{setTest:function(St){St?Zt(2929):J(2929)},setMask:function(St){pt===St||Y||(i.depthMask(St),pt=St)},setFunc:function(St){if(Et!==St){if(St)switch(St){case 0:i.depthFunc(512);break;case 1:i.depthFunc(519);break;case 2:i.depthFunc(513);break;case 3:i.depthFunc(515);break;case 4:i.depthFunc(514);break;case 5:i.depthFunc(518);break;case 6:i.depthFunc(516);break;case 7:i.depthFunc(517);break;default:i.depthFunc(515)}else i.depthFunc(515);Et=St}},setLocked:function(St){Y=St},setClear:function(St){Tt!==St&&(i.clearDepth(St),Tt=St)},reset:function(){Y=!1,pt=null,Et=null,Tt=null}}},o=new function(){let Y=!1,pt=null,Et=null,Tt=null,St=null,Qt=null,ce=null,ae=null,se=null;return{setTest:function(we){Y||(we?Zt(2960):J(2960))},setMask:function(we){pt===we||Y||(i.stencilMask(we),pt=we)},setFunc:function(we,vn,Ve){Et===we&&Tt===vn&&St===Ve||(i.stencilFunc(we,vn,Ve),Et=we,Tt=vn,St=Ve)},setOp:function(we,vn,Ve){Qt===we&&ce===vn&&ae===Ve||(i.stencilOp(we,vn,Ve),Qt=we,ce=vn,ae=Ve)},setLocked:function(we){Y=we},setClear:function(we){se!==we&&(i.clearStencil(we),se=we)},reset:function(){Y=!1,pt=null,Et=null,Tt=null,St=null,Qt=null,ce=null,ae=null,se=null}}};let a={},l=null,h={},c=null,u=!1,p=null,f=null,g=null,_=null,v=null,M=null,A=null,O=!1,H=null,j=null,X=null,U=null,V=null;const xt=i.getParameter(35661);let it=!1,Q=0;const st=i.getParameter(7938);st.indexOf("WebGL")!==-1?(Q=parseFloat(/^WebGL (\d)/.exec(st)[1]),it=Q>=1):st.indexOf("OpenGL ES")!==-1&&(Q=parseFloat(/^OpenGL ES (\d)/.exec(st)[1]),it=Q>=2);let nt=null,ct={};const Lt=i.getParameter(3088),At=i.getParameter(2978),ht=new at().fromArray(Lt),gt=new at().fromArray(At);function Ut(Y,pt,Et){const Tt=new Uint8Array(4),St=i.createTexture();i.bindTexture(Y,St),i.texParameteri(Y,10241,9728),i.texParameteri(Y,10240,9728);for(let Qt=0;Qt<Et;Qt++)i.texImage2D(pt+Qt,0,6408,1,1,0,6408,5121,Tt);return St}const Vt={};function Zt(Y){a[Y]!==!0&&(i.enable(Y),a[Y]=!0)}function J(Y){a[Y]!==!1&&(i.disable(Y),a[Y]=!1)}Vt[3553]=Ut(3553,3553,1),Vt[34067]=Ut(34067,34069,6),r.setClear(0,0,0,1),s.setClear(1),o.setClear(0),Zt(2929),s.setFunc(3),It(!1),Yt(1),Zt(2884),Pt(0);const et={100:32774,101:32778,102:32779};if(n)et[103]=32775,et[104]=32776;else{const Y=t.get("EXT_blend_minmax");Y!==null&&(et[103]=Y.MIN_EXT,et[104]=Y.MAX_EXT)}const Ft={200:0,201:1,202:768,204:770,210:776,208:774,206:772,203:769,205:771,209:775,207:773};function Pt(Y,pt,Et,Tt,St,Qt,ce,ae){if(Y!==0){if(u===!1&&(Zt(3042),u=!0),Y===5)St=St||pt,Qt=Qt||Et,ce=ce||Tt,pt===f&&St===v||(i.blendEquationSeparate(et[pt],et[St]),f=pt,v=St),Et===g&&Tt===_&&Qt===M&&ce===A||(i.blendFuncSeparate(Ft[Et],Ft[Tt],Ft[Qt],Ft[ce]),g=Et,_=Tt,M=Qt,A=ce),p=Y,O=null;else if(Y!==p||ae!==O){if(f===100&&v===100||(i.blendEquation(32774),f=100,v=100),ae)switch(Y){case 1:i.blendFuncSeparate(1,771,1,771);break;case 2:i.blendFunc(1,1);break;case 3:i.blendFuncSeparate(0,0,769,771);break;case 4:i.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",Y)}else switch(Y){case 1:i.blendFuncSeparate(770,771,1,771);break;case 2:i.blendFunc(770,1);break;case 3:i.blendFunc(0,769);break;case 4:i.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",Y)}g=null,_=null,M=null,A=null,p=Y,O=ae}}else u===!0&&(J(3042),u=!1)}function It(Y){H!==Y&&(Y?i.frontFace(2304):i.frontFace(2305),H=Y)}function Yt(Y){Y!==0?(Zt(2884),Y!==j&&(Y===1?i.cullFace(1029):Y===2?i.cullFace(1028):i.cullFace(1032))):J(2884),j=Y}function qt(Y,pt,Et){Y?(Zt(32823),U===pt&&V===Et||(i.polygonOffset(pt,Et),U=pt,V=Et)):J(32823)}function Nt(Y){Y===void 0&&(Y=33984+xt-1),nt!==Y&&(i.activeTexture(Y),nt=Y)}return{buffers:{color:r,depth:s,stencil:o},enable:Zt,disable:J,bindFramebuffer:function(Y,pt){return pt===null&&l!==null&&(pt=l),h[Y]!==pt&&(i.bindFramebuffer(Y,pt),h[Y]=pt,n&&(Y===36009&&(h[36160]=pt),Y===36160&&(h[36009]=pt)),!0)},bindXRFramebuffer:function(Y){Y!==l&&(i.bindFramebuffer(36160,Y),l=Y)},useProgram:function(Y){return c!==Y&&(i.useProgram(Y),c=Y,!0)},setBlending:Pt,setMaterial:function(Y,pt){Y.side===2?J(2884):Zt(2884);let Et=Y.side===1;pt&&(Et=!Et),It(Et),Y.blending===1&&Y.transparent===!1?Pt(0):Pt(Y.blending,Y.blendEquation,Y.blendSrc,Y.blendDst,Y.blendEquationAlpha,Y.blendSrcAlpha,Y.blendDstAlpha,Y.premultipliedAlpha),s.setFunc(Y.depthFunc),s.setTest(Y.depthTest),s.setMask(Y.depthWrite),r.setMask(Y.colorWrite);const Tt=Y.stencilWrite;o.setTest(Tt),Tt&&(o.setMask(Y.stencilWriteMask),o.setFunc(Y.stencilFunc,Y.stencilRef,Y.stencilFuncMask),o.setOp(Y.stencilFail,Y.stencilZFail,Y.stencilZPass)),qt(Y.polygonOffset,Y.polygonOffsetFactor,Y.polygonOffsetUnits),Y.alphaToCoverage===!0?Zt(32926):J(32926)},setFlipSided:It,setCullFace:Yt,setLineWidth:function(Y){Y!==X&&(it&&i.lineWidth(Y),X=Y)},setPolygonOffset:qt,setScissorTest:function(Y){Y?Zt(3089):J(3089)},activeTexture:Nt,bindTexture:function(Y,pt){nt===null&&Nt();let Et=ct[nt];Et===void 0&&(Et={type:void 0,texture:void 0},ct[nt]=Et),Et.type===Y&&Et.texture===pt||(i.bindTexture(Y,pt||Vt[Y]),Et.type=Y,Et.texture=pt)},unbindTexture:function(){const Y=ct[nt];Y!==void 0&&Y.type!==void 0&&(i.bindTexture(Y.type,null),Y.type=void 0,Y.texture=void 0)},compressedTexImage2D:function(){try{i.compressedTexImage2D.apply(i,arguments)}catch(Y){console.error("THREE.WebGLState:",Y)}},texImage2D:function(){try{i.texImage2D.apply(i,arguments)}catch(Y){console.error("THREE.WebGLState:",Y)}},texImage3D:function(){try{i.texImage3D.apply(i,arguments)}catch(Y){console.error("THREE.WebGLState:",Y)}},scissor:function(Y){ht.equals(Y)===!1&&(i.scissor(Y.x,Y.y,Y.z,Y.w),ht.copy(Y))},viewport:function(Y){gt.equals(Y)===!1&&(i.viewport(Y.x,Y.y,Y.z,Y.w),gt.copy(Y))},reset:function(){i.disable(3042),i.disable(2884),i.disable(2929),i.disable(32823),i.disable(3089),i.disable(2960),i.disable(32926),i.blendEquation(32774),i.blendFunc(1,0),i.blendFuncSeparate(1,0,1,0),i.colorMask(!0,!0,!0,!0),i.clearColor(0,0,0,0),i.depthMask(!0),i.depthFunc(513),i.clearDepth(1),i.stencilMask(4294967295),i.stencilFunc(519,0,4294967295),i.stencilOp(7680,7680,7680),i.clearStencil(0),i.cullFace(1029),i.frontFace(2305),i.polygonOffset(0,0),i.activeTexture(33984),i.bindFramebuffer(36160,null),n===!0&&(i.bindFramebuffer(36009,null),i.bindFramebuffer(36008,null)),i.useProgram(null),i.lineWidth(1),i.scissor(0,0,i.canvas.width,i.canvas.height),i.viewport(0,0,i.canvas.width,i.canvas.height),a={},nt=null,ct={},l=null,h={},c=null,u=!1,p=null,f=null,g=null,_=null,v=null,M=null,A=null,O=!1,H=null,j=null,X=null,U=null,V=null,ht.set(0,0,i.canvas.width,i.canvas.height),gt.set(0,0,i.canvas.width,i.canvas.height),r.reset(),s.reset(),o.reset()}}}function Sx(i,t,e,n,r,s,o){const a=r.isWebGL2,l=r.maxTextures,h=r.maxCubemapSize,c=r.maxTextureSize,u=r.maxSamples,p=new WeakMap;let f,g=!1;try{g=typeof OffscreenCanvas!="undefined"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(J,et){return g?new OffscreenCanvas(J,et):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function v(J,et,Ft,Pt){let It=1;if((J.width>Pt||J.height>Pt)&&(It=Pt/Math.max(J.width,J.height)),It<1||et===!0){if(typeof HTMLImageElement!="undefined"&&J instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&J instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&J instanceof ImageBitmap){const Yt=et?D:Math.floor,qt=Yt(It*J.width),Nt=Yt(It*J.height);f===void 0&&(f=_(qt,Nt));const Y=Ft?_(qt,Nt):f;return Y.width=qt,Y.height=Nt,Y.getContext("2d").drawImage(J,0,0,qt,Nt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+J.width+"x"+J.height+") to ("+qt+"x"+Nt+")."),Y}return"data"in J&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+J.width+"x"+J.height+")."),J}return J}function M(J){return R(J.width)&&R(J.height)}function A(J,et){return J.generateMipmaps&&et&&J.minFilter!==1003&&J.minFilter!==1006}function O(J,et,Ft,Pt,It=1){i.generateMipmap(J),n.get(et).__maxMipLevel=Math.log2(Math.max(Ft,Pt,It))}function H(J,et,Ft){if(a===!1)return et;if(J!==null){if(i[J]!==void 0)return i[J];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+J+"'")}let Pt=et;return et===6403&&(Ft===5126&&(Pt=33326),Ft===5131&&(Pt=33325),Ft===5121&&(Pt=33321)),et===6407&&(Ft===5126&&(Pt=34837),Ft===5131&&(Pt=34843),Ft===5121&&(Pt=32849)),et===6408&&(Ft===5126&&(Pt=34836),Ft===5131&&(Pt=34842),Ft===5121&&(Pt=32856)),Pt!==33325&&Pt!==33326&&Pt!==34842&&Pt!==34836||t.get("EXT_color_buffer_float"),Pt}function j(J){return J===1003||J===1004||J===1005?9728:9729}function X(J){const et=J.target;et.removeEventListener("dispose",X),function(Ft){const Pt=n.get(Ft);Pt.__webglInit!==void 0&&(i.deleteTexture(Pt.__webglTexture),n.remove(Ft))}(et),et.isVideoTexture&&p.delete(et),o.memory.textures--}function U(J){const et=J.target;et.removeEventListener("dispose",U),function(Ft){const Pt=Ft.texture,It=n.get(Ft),Yt=n.get(Pt);if(!!Ft){if(Yt.__webglTexture!==void 0&&(i.deleteTexture(Yt.__webglTexture),o.memory.textures--),Ft.depthTexture&&Ft.depthTexture.dispose(),Ft.isWebGLCubeRenderTarget)for(let qt=0;qt<6;qt++)i.deleteFramebuffer(It.__webglFramebuffer[qt]),It.__webglDepthbuffer&&i.deleteRenderbuffer(It.__webglDepthbuffer[qt]);else i.deleteFramebuffer(It.__webglFramebuffer),It.__webglDepthbuffer&&i.deleteRenderbuffer(It.__webglDepthbuffer),It.__webglMultisampledFramebuffer&&i.deleteFramebuffer(It.__webglMultisampledFramebuffer),It.__webglColorRenderbuffer&&i.deleteRenderbuffer(It.__webglColorRenderbuffer),It.__webglDepthRenderbuffer&&i.deleteRenderbuffer(It.__webglDepthRenderbuffer);if(Ft.isWebGLMultipleRenderTargets)for(let qt=0,Nt=Pt.length;qt<Nt;qt++){const Y=n.get(Pt[qt]);Y.__webglTexture&&(i.deleteTexture(Y.__webglTexture),o.memory.textures--),n.remove(Pt[qt])}n.remove(Pt),n.remove(Ft)}}(et)}let V=0;function xt(J,et){const Ft=n.get(J);if(J.isVideoTexture&&function(Pt){const It=o.render.frame;p.get(Pt)!==It&&(p.set(Pt,It),Pt.update())}(J),J.version>0&&Ft.__version!==J.version){const Pt=J.image;if(Pt===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(Pt.complete!==!1)return void Lt(Ft,J,et);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}e.activeTexture(33984+et),e.bindTexture(3553,Ft.__webglTexture)}function it(J,et){const Ft=n.get(J);J.version>0&&Ft.__version!==J.version?function(Pt,It,Yt){if(It.image.length!==6)return;ct(Pt,It),e.activeTexture(33984+Yt),e.bindTexture(34067,Pt.__webglTexture),i.pixelStorei(37440,It.flipY),i.pixelStorei(37441,It.premultiplyAlpha),i.pixelStorei(3317,It.unpackAlignment),i.pixelStorei(37443,0);const qt=It&&(It.isCompressedTexture||It.image[0].isCompressedTexture),Nt=It.image[0]&&It.image[0].isDataTexture,Y=[];for(let ae=0;ae<6;ae++)Y[ae]=qt||Nt?Nt?It.image[ae].image:It.image[ae]:v(It.image[ae],!1,!0,h);const pt=Y[0],Et=M(pt)||a,Tt=s.convert(It.format),St=s.convert(It.type),Qt=H(It.internalFormat,Tt,St);let ce;if(nt(34067,It,Et),qt){for(let ae=0;ae<6;ae++){ce=Y[ae].mipmaps;for(let se=0;se<ce.length;se++){const we=ce[se];It.format!==1023&&It.format!==1022?Tt!==null?e.compressedTexImage2D(34069+ae,se,Qt,we.width,we.height,0,we.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):e.texImage2D(34069+ae,se,Qt,we.width,we.height,0,Tt,St,we.data)}}Pt.__maxMipLevel=ce.length-1}else{ce=It.mipmaps;for(let ae=0;ae<6;ae++)if(Nt){e.texImage2D(34069+ae,0,Qt,Y[ae].width,Y[ae].height,0,Tt,St,Y[ae].data);for(let se=0;se<ce.length;se++){const we=ce[se].image[ae].image;e.texImage2D(34069+ae,se+1,Qt,we.width,we.height,0,Tt,St,we.data)}}else{e.texImage2D(34069+ae,0,Qt,Tt,St,Y[ae]);for(let se=0;se<ce.length;se++){const we=ce[se];e.texImage2D(34069+ae,se+1,Qt,Tt,St,we.image[ae])}}Pt.__maxMipLevel=ce.length}A(It,Et)&&O(34067,It,pt.width,pt.height),Pt.__version=It.version,It.onUpdate&&It.onUpdate(It)}(Ft,J,et):(e.activeTexture(33984+et),e.bindTexture(34067,Ft.__webglTexture))}const Q={1e3:10497,1001:33071,1002:33648},st={1003:9728,1004:9984,1005:9986,1006:9729,1007:9985,1008:9987};function nt(J,et,Ft){if(Ft?(i.texParameteri(J,10242,Q[et.wrapS]),i.texParameteri(J,10243,Q[et.wrapT]),J!==32879&&J!==35866||i.texParameteri(J,32882,Q[et.wrapR]),i.texParameteri(J,10240,st[et.magFilter]),i.texParameteri(J,10241,st[et.minFilter])):(i.texParameteri(J,10242,33071),i.texParameteri(J,10243,33071),J!==32879&&J!==35866||i.texParameteri(J,32882,33071),et.wrapS===1001&&et.wrapT===1001||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),i.texParameteri(J,10240,j(et.magFilter)),i.texParameteri(J,10241,j(et.minFilter)),et.minFilter!==1003&&et.minFilter!==1006&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),t.has("EXT_texture_filter_anisotropic")===!0){const Pt=t.get("EXT_texture_filter_anisotropic");if(et.type===1015&&t.has("OES_texture_float_linear")===!1||a===!1&&et.type===1016&&t.has("OES_texture_half_float_linear")===!1)return;(et.anisotropy>1||n.get(et).__currentAnisotropy)&&(i.texParameterf(J,Pt.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(et.anisotropy,r.getMaxAnisotropy())),n.get(et).__currentAnisotropy=et.anisotropy)}}function ct(J,et){J.__webglInit===void 0&&(J.__webglInit=!0,et.addEventListener("dispose",X),J.__webglTexture=i.createTexture(),o.memory.textures++)}function Lt(J,et,Ft){let Pt=3553;et.isDataTexture2DArray&&(Pt=35866),et.isDataTexture3D&&(Pt=32879),ct(J,et),e.activeTexture(33984+Ft),e.bindTexture(Pt,J.__webglTexture),i.pixelStorei(37440,et.flipY),i.pixelStorei(37441,et.premultiplyAlpha),i.pixelStorei(3317,et.unpackAlignment),i.pixelStorei(37443,0);const It=function(St){return!a&&(St.wrapS!==1001||St.wrapT!==1001||St.minFilter!==1003&&St.minFilter!==1006)}(et)&&M(et.image)===!1,Yt=v(et.image,It,!1,c),qt=M(Yt)||a,Nt=s.convert(et.format);let Y,pt=s.convert(et.type),Et=H(et.internalFormat,Nt,pt);nt(Pt,et,qt);const Tt=et.mipmaps;if(et.isDepthTexture)Et=6402,a?Et=et.type===1015?36012:et.type===1014?33190:et.type===1020?35056:33189:et.type===1015&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),et.format===1026&&Et===6402&&et.type!==1012&&et.type!==1014&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),et.type=1012,pt=s.convert(et.type)),et.format===1027&&Et===6402&&(Et=34041,et.type!==1020&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),et.type=1020,pt=s.convert(et.type))),e.texImage2D(3553,0,Et,Yt.width,Yt.height,0,Nt,pt,null);else if(et.isDataTexture)if(Tt.length>0&&qt){for(let St=0,Qt=Tt.length;St<Qt;St++)Y=Tt[St],e.texImage2D(3553,St,Et,Y.width,Y.height,0,Nt,pt,Y.data);et.generateMipmaps=!1,J.__maxMipLevel=Tt.length-1}else e.texImage2D(3553,0,Et,Yt.width,Yt.height,0,Nt,pt,Yt.data),J.__maxMipLevel=0;else if(et.isCompressedTexture){for(let St=0,Qt=Tt.length;St<Qt;St++)Y=Tt[St],et.format!==1023&&et.format!==1022?Nt!==null?e.compressedTexImage2D(3553,St,Et,Y.width,Y.height,0,Y.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):e.texImage2D(3553,St,Et,Y.width,Y.height,0,Nt,pt,Y.data);J.__maxMipLevel=Tt.length-1}else if(et.isDataTexture2DArray)e.texImage3D(35866,0,Et,Yt.width,Yt.height,Yt.depth,0,Nt,pt,Yt.data),J.__maxMipLevel=0;else if(et.isDataTexture3D)e.texImage3D(32879,0,Et,Yt.width,Yt.height,Yt.depth,0,Nt,pt,Yt.data),J.__maxMipLevel=0;else if(Tt.length>0&&qt){for(let St=0,Qt=Tt.length;St<Qt;St++)Y=Tt[St],e.texImage2D(3553,St,Et,Nt,pt,Y);et.generateMipmaps=!1,J.__maxMipLevel=Tt.length-1}else e.texImage2D(3553,0,Et,Nt,pt,Yt),J.__maxMipLevel=0;A(et,qt)&&O(Pt,et,Yt.width,Yt.height),J.__version=et.version,et.onUpdate&&et.onUpdate(et)}function At(J,et,Ft,Pt,It){const Yt=s.convert(Ft.format),qt=s.convert(Ft.type),Nt=H(Ft.internalFormat,Yt,qt);It===32879||It===35866?e.texImage3D(It,0,Nt,et.width,et.height,et.depth,0,Yt,qt,null):e.texImage2D(It,0,Nt,et.width,et.height,0,Yt,qt,null),e.bindFramebuffer(36160,J),i.framebufferTexture2D(36160,Pt,It,n.get(Ft).__webglTexture,0),e.bindFramebuffer(36160,null)}function ht(J,et,Ft){if(i.bindRenderbuffer(36161,J),et.depthBuffer&&!et.stencilBuffer){let Pt=33189;if(Ft){const It=et.depthTexture;It&&It.isDepthTexture&&(It.type===1015?Pt=36012:It.type===1014&&(Pt=33190));const Yt=Ut(et);i.renderbufferStorageMultisample(36161,Yt,Pt,et.width,et.height)}else i.renderbufferStorage(36161,Pt,et.width,et.height);i.framebufferRenderbuffer(36160,36096,36161,J)}else if(et.depthBuffer&&et.stencilBuffer){if(Ft){const Pt=Ut(et);i.renderbufferStorageMultisample(36161,Pt,35056,et.width,et.height)}else i.renderbufferStorage(36161,34041,et.width,et.height);i.framebufferRenderbuffer(36160,33306,36161,J)}else{const Pt=et.isWebGLMultipleRenderTargets===!0?et.texture[0]:et.texture,It=s.convert(Pt.format),Yt=s.convert(Pt.type),qt=H(Pt.internalFormat,It,Yt);if(Ft){const Nt=Ut(et);i.renderbufferStorageMultisample(36161,Nt,qt,et.width,et.height)}else i.renderbufferStorage(36161,qt,et.width,et.height)}i.bindRenderbuffer(36161,null)}function gt(J){const et=n.get(J),Ft=J.isWebGLCubeRenderTarget===!0;if(J.depthTexture){if(Ft)throw new Error("target.depthTexture not supported in Cube render targets");(function(Pt,It){if(It&&It.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(36160,Pt),!It.depthTexture||!It.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");n.get(It.depthTexture).__webglTexture&&It.depthTexture.image.width===It.width&&It.depthTexture.image.height===It.height||(It.depthTexture.image.width=It.width,It.depthTexture.image.height=It.height,It.depthTexture.needsUpdate=!0),xt(It.depthTexture,0);const Yt=n.get(It.depthTexture).__webglTexture;if(It.depthTexture.format===1026)i.framebufferTexture2D(36160,36096,3553,Yt,0);else{if(It.depthTexture.format!==1027)throw new Error("Unknown depthTexture format");i.framebufferTexture2D(36160,33306,3553,Yt,0)}})(et.__webglFramebuffer,J)}else if(Ft){et.__webglDepthbuffer=[];for(let Pt=0;Pt<6;Pt++)e.bindFramebuffer(36160,et.__webglFramebuffer[Pt]),et.__webglDepthbuffer[Pt]=i.createRenderbuffer(),ht(et.__webglDepthbuffer[Pt],J,!1)}else e.bindFramebuffer(36160,et.__webglFramebuffer),et.__webglDepthbuffer=i.createRenderbuffer(),ht(et.__webglDepthbuffer,J,!1);e.bindFramebuffer(36160,null)}function Ut(J){return a&&J.isWebGLMultisampleRenderTarget?Math.min(u,J.samples):0}let Vt=!1,Zt=!1;this.allocateTextureUnit=function(){const J=V;return J>=l&&console.warn("THREE.WebGLTextures: Trying to use "+J+" texture units while this GPU supports only "+l),V+=1,J},this.resetTextureUnits=function(){V=0},this.setTexture2D=xt,this.setTexture2DArray=function(J,et){const Ft=n.get(J);J.version>0&&Ft.__version!==J.version?Lt(Ft,J,et):(e.activeTexture(33984+et),e.bindTexture(35866,Ft.__webglTexture))},this.setTexture3D=function(J,et){const Ft=n.get(J);J.version>0&&Ft.__version!==J.version?Lt(Ft,J,et):(e.activeTexture(33984+et),e.bindTexture(32879,Ft.__webglTexture))},this.setTextureCube=it,this.setupRenderTarget=function(J){const et=J.texture,Ft=n.get(J),Pt=n.get(et);J.addEventListener("dispose",U),J.isWebGLMultipleRenderTargets!==!0&&(Pt.__webglTexture=i.createTexture(),Pt.__version=et.version,o.memory.textures++);const It=J.isWebGLCubeRenderTarget===!0,Yt=J.isWebGLMultipleRenderTargets===!0,qt=J.isWebGLMultisampleRenderTarget===!0,Nt=et.isDataTexture3D||et.isDataTexture2DArray,Y=M(J)||a;if(!a||et.format!==1022||et.type!==1015&&et.type!==1016||(et.format=1023,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),It){Ft.__webglFramebuffer=[];for(let pt=0;pt<6;pt++)Ft.__webglFramebuffer[pt]=i.createFramebuffer()}else if(Ft.__webglFramebuffer=i.createFramebuffer(),Yt)if(r.drawBuffers){const pt=J.texture;for(let Et=0,Tt=pt.length;Et<Tt;Et++){const St=n.get(pt[Et]);St.__webglTexture===void 0&&(St.__webglTexture=i.createTexture(),o.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(qt)if(a){Ft.__webglMultisampledFramebuffer=i.createFramebuffer(),Ft.__webglColorRenderbuffer=i.createRenderbuffer(),i.bindRenderbuffer(36161,Ft.__webglColorRenderbuffer);const pt=s.convert(et.format),Et=s.convert(et.type),Tt=H(et.internalFormat,pt,Et),St=Ut(J);i.renderbufferStorageMultisample(36161,St,Tt,J.width,J.height),e.bindFramebuffer(36160,Ft.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(36160,36064,36161,Ft.__webglColorRenderbuffer),i.bindRenderbuffer(36161,null),J.depthBuffer&&(Ft.__webglDepthRenderbuffer=i.createRenderbuffer(),ht(Ft.__webglDepthRenderbuffer,J,!0)),e.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(It){e.bindTexture(34067,Pt.__webglTexture),nt(34067,et,Y);for(let pt=0;pt<6;pt++)At(Ft.__webglFramebuffer[pt],J,et,36064,34069+pt);A(et,Y)&&O(34067,et,J.width,J.height),e.bindTexture(34067,null)}else if(Yt){const pt=J.texture;for(let Et=0,Tt=pt.length;Et<Tt;Et++){const St=pt[Et],Qt=n.get(St);e.bindTexture(3553,Qt.__webglTexture),nt(3553,St,Y),At(Ft.__webglFramebuffer,J,St,36064+Et,3553),A(St,Y)&&O(3553,St,J.width,J.height)}e.bindTexture(3553,null)}else{let pt=3553;Nt&&(a?pt=et.isDataTexture3D?32879:35866:console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")),e.bindTexture(pt,Pt.__webglTexture),nt(pt,et,Y),At(Ft.__webglFramebuffer,J,et,36064,pt),A(et,Y)&&O(pt,et,J.width,J.height,J.depth),e.bindTexture(pt,null)}J.depthBuffer&>(J)},this.updateRenderTargetMipmap=function(J){const et=M(J)||a,Ft=J.isWebGLMultipleRenderTargets===!0?J.texture:[J.texture];for(let Pt=0,It=Ft.length;Pt<It;Pt++){const Yt=Ft[Pt];if(A(Yt,et)){const qt=J.isWebGLCubeRenderTarget?34067:3553,Nt=n.get(Yt).__webglTexture;e.bindTexture(qt,Nt),O(qt,Yt,J.width,J.height),e.bindTexture(qt,null)}}},this.updateMultisampleRenderTarget=function(J){if(J.isWebGLMultisampleRenderTarget)if(a){const et=J.width,Ft=J.height;let Pt=16384;J.depthBuffer&&(Pt|=256),J.stencilBuffer&&(Pt|=1024);const It=n.get(J);e.bindFramebuffer(36008,It.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,It.__webglFramebuffer),i.blitFramebuffer(0,0,et,Ft,0,0,et,Ft,Pt,9728),e.bindFramebuffer(36008,null),e.bindFramebuffer(36009,It.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(J,et){J&&J.isWebGLRenderTarget&&(Vt===!1&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),Vt=!0),J=J.texture),xt(J,et)},this.safeSetTextureCube=function(J,et){J&&J.isWebGLCubeRenderTarget&&(Zt===!1&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),Zt=!0),J=J.texture),it(J,et)}}function Mx(i,t,e){const n=e.isWebGL2;return{convert:function(r){let s;if(r===1009)return 5121;if(r===1017)return 32819;if(r===1018)return 32820;if(r===1019)return 33635;if(r===1010)return 5120;if(r===1011)return 5122;if(r===1012)return 5123;if(r===1013)return 5124;if(r===1014)return 5125;if(r===1015)return 5126;if(r===1016)return n?5131:(s=t.get("OES_texture_half_float"),s!==null?s.HALF_FLOAT_OES:null);if(r===1021)return 6406;if(r===1022)return 6407;if(r===1023)return 6408;if(r===1024)return 6409;if(r===1025)return 6410;if(r===1026)return 6402;if(r===1027)return 34041;if(r===1028)return 6403;if(r===1029)return 36244;if(r===1030)return 33319;if(r===1031)return 33320;if(r===1032)return 36248;if(r===1033)return 36249;if(r===33776||r===33777||r===33778||r===33779){if(s=t.get("WEBGL_compressed_texture_s3tc"),s===null)return null;if(r===33776)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===33777)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===33778)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===33779)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(r===35840||r===35841||r===35842||r===35843){if(s=t.get("WEBGL_compressed_texture_pvrtc"),s===null)return null;if(r===35840)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===35841)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===35842)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===35843)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(r===36196)return s=t.get("WEBGL_compressed_texture_etc1"),s!==null?s.COMPRESSED_RGB_ETC1_WEBGL:null;if((r===37492||r===37496)&&(s=t.get("WEBGL_compressed_texture_etc"),s!==null)){if(r===37492)return s.COMPRESSED_RGB8_ETC2;if(r===37496)return s.COMPRESSED_RGBA8_ETC2_EAC}return r===37808||r===37809||r===37810||r===37811||r===37812||r===37813||r===37814||r===37815||r===37816||r===37817||r===37818||r===37819||r===37820||r===37821||r===37840||r===37841||r===37842||r===37843||r===37844||r===37845||r===37846||r===37847||r===37848||r===37849||r===37850||r===37851||r===37852||r===37853?(s=t.get("WEBGL_compressed_texture_astc"),s!==null?r:null):r===36492?(s=t.get("EXT_texture_compression_bptc"),s!==null?r:null):r===1020?n?34042:(s=t.get("WEBGL_depth_texture"),s!==null?s.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}class qd extends jn{constructor(t=[]){super(),this.cameras=t}}qd.prototype.isArrayCamera=!0;class Hs extends ke{constructor(){super(),this.type="Group"}}Hs.prototype.isGroup=!0;const Ax={type:"move"};class lh{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Hs,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Hs,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new w,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new w),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Hs,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new w,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new w),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,e,n){let r=null,s=null,o=null;const a=this._targetRay,l=this._grip,h=this._hand;if(t&&e.session.visibilityState!=="visible-blurred")if(a!==null&&(r=e.getPose(t.targetRaySpace,n),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(Ax))),h&&t.hand){o=!0;for(const _ of t.hand.values()){const v=e.getJointPose(_,n);if(h.joints[_.jointName]===void 0){const A=new Hs;A.matrixAutoUpdate=!1,A.visible=!1,h.joints[_.jointName]=A,h.add(A)}const M=h.joints[_.jointName];v!==null&&(M.matrix.fromArray(v.transform.matrix),M.matrix.decompose(M.position,M.rotation,M.scale),M.jointRadius=v.radius),M.visible=v!==null}const c=h.joints["index-finger-tip"],u=h.joints["thumb-tip"],p=c.position.distanceTo(u.position),f=.02,g=.005;h.inputState.pinching&&p>f+g?(h.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!h.inputState.pinching&&p<=f-g&&(h.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(s=e.getPose(t.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),h!==null&&(h.visible=o!==null),this}}class Px extends N{constructor(t,e){super();const n=this,r=t.state;let s=null,o=1,a=null,l="local-floor",h=null,c=null,u=null,p=null;const f=[],g=new Map,_=new jn;_.layers.enable(1),_.viewport=new at;const v=new jn;v.layers.enable(2),v.viewport=new at;const M=[_,v],A=new qd;A.layers.enable(1),A.layers.enable(2);let O=null,H=null;function j(nt){const ct=g.get(nt.inputSource);ct&&ct.dispatchEvent({type:nt.type,data:nt.inputSource})}function X(){g.forEach(function(nt,ct){nt.disconnect(ct)}),g.clear(),O=null,H=null,r.bindXRFramebuffer(null),t.setRenderTarget(t.getRenderTarget()),st.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function U(nt){const ct=s.inputSources;for(let Lt=0;Lt<f.length;Lt++)g.set(ct[Lt],f[Lt]);for(let Lt=0;Lt<nt.removed.length;Lt++){const At=nt.removed[Lt],ht=g.get(At);ht&&(ht.dispatchEvent({type:"disconnected",data:At}),g.delete(At))}for(let Lt=0;Lt<nt.added.length;Lt++){const At=nt.added[Lt],ht=g.get(At);ht&&ht.dispatchEvent({type:"connected",data:At})}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(nt){let ct=f[nt];return ct===void 0&&(ct=new lh,f[nt]=ct),ct.getTargetRaySpace()},this.getControllerGrip=function(nt){let ct=f[nt];return ct===void 0&&(ct=new lh,f[nt]=ct),ct.getGripSpace()},this.getHand=function(nt){let ct=f[nt];return ct===void 0&&(ct=new lh,f[nt]=ct),ct.getHandSpace()},this.setFramebufferScaleFactor=function(nt){o=nt,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(nt){l=nt,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return a},this.getSession=function(){return s},this.setSession=async function(nt){if(s=nt,s!==null){s.addEventListener("select",j),s.addEventListener("selectstart",j),s.addEventListener("selectend",j),s.addEventListener("squeeze",j),s.addEventListener("squeezestart",j),s.addEventListener("squeezeend",j),s.addEventListener("end",X),s.addEventListener("inputsourceschange",U);const ct=e.getContextAttributes();if(ct.xrCompatible!==!0&&await e.makeXRCompatible(),s.renderState.layers===void 0){const Lt={antialias:ct.antialias,alpha:ct.alpha,depth:ct.depth,stencil:ct.stencil,framebufferScaleFactor:o},At=new XRWebGLLayer(s,e,Lt);s.updateRenderState({baseLayer:At})}else{let Lt=0;ct.depth&&(Lt=ct.stencil?34041:6402);const At={colorFormat:ct.alpha?6408:6407,depthFormat:Lt,scaleFactor:o};c=new XRWebGLBinding(s,e),p=c.createProjectionLayer(At),u=e.createFramebuffer(),s.updateRenderState({layers:[p]})}a=await s.requestReferenceSpace(l),st.setContext(s),st.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};const V=new w,xt=new w;function it(nt,ct){ct===null?nt.matrixWorld.copy(nt.matrix):nt.matrixWorld.multiplyMatrices(ct.matrixWorld,nt.matrix),nt.matrixWorldInverse.copy(nt.matrixWorld).invert()}this.updateCamera=function(nt){if(s===null)return;A.near=v.near=_.near=nt.near,A.far=v.far=_.far=nt.far,O===A.near&&H===A.far||(s.updateRenderState({depthNear:A.near,depthFar:A.far}),O=A.near,H=A.far);const ct=nt.parent,Lt=A.cameras;it(A,ct);for(let ht=0;ht<Lt.length;ht++)it(Lt[ht],ct);A.matrixWorld.decompose(A.position,A.quaternion,A.scale),nt.position.copy(A.position),nt.quaternion.copy(A.quaternion),nt.scale.copy(A.scale),nt.matrix.copy(A.matrix),nt.matrixWorld.copy(A.matrixWorld);const At=nt.children;for(let ht=0,gt=At.length;ht<gt;ht++)At[ht].updateMatrixWorld(!0);Lt.length===2?function(ht,gt,Ut){V.setFromMatrixPosition(gt.matrixWorld),xt.setFromMatrixPosition(Ut.matrixWorld);const Vt=V.distanceTo(xt),Zt=gt.projectionMatrix.elements,J=Ut.projectionMatrix.elements,et=Zt[14]/(Zt[10]-1),Ft=Zt[14]/(Zt[10]+1),Pt=(Zt[9]+1)/Zt[5],It=(Zt[9]-1)/Zt[5],Yt=(Zt[8]-1)/Zt[0],qt=(J[8]+1)/J[0],Nt=et*Yt,Y=et*qt,pt=Vt/(-Yt+qt),Et=pt*-Yt;gt.matrixWorld.decompose(ht.position,ht.quaternion,ht.scale),ht.translateX(Et),ht.translateZ(pt),ht.matrixWorld.compose(ht.position,ht.quaternion,ht.scale),ht.matrixWorldInverse.copy(ht.matrixWorld).invert();const Tt=et+pt,St=Ft+pt,Qt=Nt-Et,ce=Y+(Vt-Et),ae=Pt*Ft/St*Tt,se=It*Ft/St*Tt;ht.projectionMatrix.makePerspective(Qt,ce,ae,se,Tt,St)}(A,_,v):A.projectionMatrix.copy(_.projectionMatrix)},this.getCamera=function(){return A};let Q=null;const st=new xd;st.setAnimationLoop(function(nt,ct){if(h=ct.getViewerPose(a),h!==null){const At=h.views,ht=s.renderState.baseLayer;s.renderState.layers===void 0&&r.bindXRFramebuffer(ht.framebuffer);let gt=!1;At.length!==A.cameras.length&&(A.cameras.length=0,gt=!0);for(let Ut=0;Ut<At.length;Ut++){const Vt=At[Ut];let Zt=null;if(s.renderState.layers===void 0)Zt=ht.getViewport(Vt);else{const et=c.getViewSubImage(p,Vt);r.bindXRFramebuffer(u),e.framebufferTexture2D(36160,36064,3553,et.colorTexture,0),et.depthStencilTexture!==void 0&&e.framebufferTexture2D(36160,36096,3553,et.depthStencilTexture,0),Zt=et.viewport}const J=M[Ut];J.matrix.fromArray(Vt.transform.matrix),J.projectionMatrix.fromArray(Vt.projectionMatrix),J.viewport.set(Zt.x,Zt.y,Zt.width,Zt.height),Ut===0&&A.matrix.copy(J.matrix),gt===!0&&A.cameras.push(J)}}const Lt=s.inputSources;for(let At=0;At<f.length;At++){const ht=f[At],gt=Lt[At];ht.update(gt,ct,a)}Q&&Q(nt,ct)}),this.setAnimationLoop=function(nt){Q=nt},this.dispose=function(){}}}function Cx(i){function t(n,r){n.opacity.value=r.opacity,r.color&&n.diffuse.value.copy(r.color),r.emissive&&n.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),r.map&&(n.map.value=r.map),r.alphaMap&&(n.alphaMap.value=r.alphaMap),r.specularMap&&(n.specularMap.value=r.specularMap);const s=i.get(r).envMap;if(s){n.envMap.value=s,n.flipEnvMap.value=s.isCubeTexture&&s._needsFlipEnvMap?-1:1,n.reflectivity.value=r.reflectivity,n.refractionRatio.value=r.refractionRatio;const l=i.get(s).__maxMipLevel;l!==void 0&&(n.maxMipLevel.value=l)}let o,a;r.lightMap&&(n.lightMap.value=r.lightMap,n.lightMapIntensity.value=r.lightMapIntensity),r.aoMap&&(n.aoMap.value=r.aoMap,n.aoMapIntensity.value=r.aoMapIntensity),r.map?o=r.map:r.specularMap?o=r.specularMap:r.displacementMap?o=r.displacementMap:r.normalMap?o=r.normalMap:r.bumpMap?o=r.bumpMap:r.roughnessMap?o=r.roughnessMap:r.metalnessMap?o=r.metalnessMap:r.alphaMap?o=r.alphaMap:r.emissiveMap?o=r.emissiveMap:r.clearcoatMap?o=r.clearcoatMap:r.clearcoatNormalMap?o=r.clearcoatNormalMap:r.clearcoatRoughnessMap&&(o=r.clearcoatRoughnessMap),o!==void 0&&(o.isWebGLRenderTarget&&(o=o.texture),o.matrixAutoUpdate===!0&&o.updateMatrix(),n.uvTransform.value.copy(o.matrix)),r.aoMap?a=r.aoMap:r.lightMap&&(a=r.lightMap),a!==void 0&&(a.isWebGLRenderTarget&&(a=a.texture),a.matrixAutoUpdate===!0&&a.updateMatrix(),n.uv2Transform.value.copy(a.matrix))}function e(n,r){n.roughness.value=r.roughness,n.metalness.value=r.metalness,r.roughnessMap&&(n.roughnessMap.value=r.roughnessMap),r.metalnessMap&&(n.metalnessMap.value=r.metalnessMap),r.emissiveMap&&(n.emissiveMap.value=r.emissiveMap),r.bumpMap&&(n.bumpMap.value=r.bumpMap,n.bumpScale.value=r.bumpScale,r.side===1&&(n.bumpScale.value*=-1)),r.normalMap&&(n.normalMap.value=r.normalMap,n.normalScale.value.copy(r.normalScale),r.side===1&&n.normalScale.value.negate()),r.displacementMap&&(n.displacementMap.value=r.displacementMap,n.displacementScale.value=r.displacementScale,n.displacementBias.value=r.displacementBias),i.get(r).envMap&&(n.envMapIntensity.value=r.envMapIntensity)}return{refreshFogUniforms:function(n,r){n.fogColor.value.copy(r.color),r.isFog?(n.fogNear.value=r.near,n.fogFar.value=r.far):r.isFogExp2&&(n.fogDensity.value=r.density)},refreshMaterialUniforms:function(n,r,s,o,a){r.isMeshBasicMaterial?t(n,r):r.isMeshLambertMaterial?(t(n,r),function(l,h){h.emissiveMap&&(l.emissiveMap.value=h.emissiveMap)}(n,r)):r.isMeshToonMaterial?(t(n,r),function(l,h){h.gradientMap&&(l.gradientMap.value=h.gradientMap),h.emissiveMap&&(l.emissiveMap.value=h.emissiveMap),h.bumpMap&&(l.bumpMap.value=h.bumpMap,l.bumpScale.value=h.bumpScale,h.side===1&&(l.bumpScale.value*=-1)),h.normalMap&&(l.normalMap.value=h.normalMap,l.normalScale.value.copy(h.normalScale),h.side===1&&l.normalScale.value.negate()),h.displacementMap&&(l.displacementMap.value=h.displacementMap,l.displacementScale.value=h.displacementScale,l.displacementBias.value=h.displacementBias)}(n,r)):r.isMeshPhongMaterial?(t(n,r),function(l,h){l.specular.value.copy(h.specular),l.shininess.value=Math.max(h.shininess,1e-4),h.emissiveMap&&(l.emissiveMap.value=h.emissiveMap),h.bumpMap&&(l.bumpMap.value=h.bumpMap,l.bumpScale.value=h.bumpScale,h.side===1&&(l.bumpScale.value*=-1)),h.normalMap&&(l.normalMap.value=h.normalMap,l.normalScale.value.copy(h.normalScale),h.side===1&&l.normalScale.value.negate()),h.displacementMap&&(l.displacementMap.value=h.displacementMap,l.displacementScale.value=h.displacementScale,l.displacementBias.value=h.displacementBias)}(n,r)):r.isMeshStandardMaterial?(t(n,r),r.isMeshPhysicalMaterial?function(l,h,c){e(l,h),l.reflectivity.value=h.reflectivity,l.clearcoat.value=h.clearcoat,l.clearcoatRoughness.value=h.clearcoatRoughness,h.sheen&&l.sheen.value.copy(h.sheen),h.clearcoatMap&&(l.clearcoatMap.value=h.clearcoatMap),h.clearcoatRoughnessMap&&(l.clearcoatRoughnessMap.value=h.clearcoatRoughnessMap),h.clearcoatNormalMap&&(l.clearcoatNormalScale.value.copy(h.clearcoatNormalScale),l.clearcoatNormalMap.value=h.clearcoatNormalMap,h.side===1&&l.clearcoatNormalScale.value.negate()),l.transmission.value=h.transmission,h.transmissionMap&&(l.transmissionMap.value=h.transmissionMap),h.transmission>0&&(l.transmissionSamplerMap.value=c.texture,l.transmissionSamplerSize.value.set(c.width,c.height)),l.thickness.value=h.thickness,h.thicknessMap&&(l.thicknessMap.value=h.thicknessMap),l.attenuationDistance.value=h.attenuationDistance,l.attenuationColor.value.copy(h.attenuationColor)}(n,r,a):e(n,r)):r.isMeshMatcapMaterial?(t(n,r),function(l,h){h.matcap&&(l.matcap.value=h.matcap),h.bumpMap&&(l.bumpMap.value=h.bumpMap,l.bumpScale.value=h.bumpScale,h.side===1&&(l.bumpScale.value*=-1)),h.normalMap&&(l.normalMap.value=h.normalMap,l.normalScale.value.copy(h.normalScale),h.side===1&&l.normalScale.value.negate()),h.displacementMap&&(l.displacementMap.value=h.displacementMap,l.displacementScale.value=h.displacementScale,l.displacementBias.value=h.displacementBias)}(n,r)):r.isMeshDepthMaterial?(t(n,r),function(l,h){h.displacementMap&&(l.displacementMap.value=h.displacementMap,l.displacementScale.value=h.displacementScale,l.displacementBias.value=h.displacementBias)}(n,r)):r.isMeshDistanceMaterial?(t(n,r),function(l,h){h.displacementMap&&(l.displacementMap.value=h.displacementMap,l.displacementScale.value=h.displacementScale,l.displacementBias.value=h.displacementBias),l.referencePosition.value.copy(h.referencePosition),l.nearDistance.value=h.nearDistance,l.farDistance.value=h.farDistance}(n,r)):r.isMeshNormalMaterial?(t(n,r),function(l,h){h.bumpMap&&(l.bumpMap.value=h.bumpMap,l.bumpScale.value=h.bumpScale,h.side===1&&(l.bumpScale.value*=-1)),h.normalMap&&(l.normalMap.value=h.normalMap,l.normalScale.value.copy(h.normalScale),h.side===1&&l.normalScale.value.negate()),h.displacementMap&&(l.displacementMap.value=h.displacementMap,l.displacementScale.value=h.displacementScale,l.displacementBias.value=h.displacementBias)}(n,r)):r.isLineBasicMaterial?(function(l,h){l.diffuse.value.copy(h.color),l.opacity.value=h.opacity}(n,r),r.isLineDashedMaterial&&function(l,h){l.dashSize.value=h.dashSize,l.totalSize.value=h.dashSize+h.gapSize,l.scale.value=h.scale}(n,r)):r.isPointsMaterial?function(l,h,c,u){l.diffuse.value.copy(h.color),l.opacity.value=h.opacity,l.size.value=h.size*c,l.scale.value=.5*u,h.map&&(l.map.value=h.map),h.alphaMap&&(l.alphaMap.value=h.alphaMap);let p;h.map?p=h.map:h.alphaMap&&(p=h.alphaMap),p!==void 0&&(p.matrixAutoUpdate===!0&&p.updateMatrix(),l.uvTransform.value.copy(p.matrix))}(n,r,s,o):r.isSpriteMaterial?function(l,h){l.diffuse.value.copy(h.color),l.opacity.value=h.opacity,l.rotation.value=h.rotation,h.map&&(l.map.value=h.map),h.alphaMap&&(l.alphaMap.value=h.alphaMap);let c;h.map?c=h.map:h.alphaMap&&(c=h.alphaMap),c!==void 0&&(c.matrixAutoUpdate===!0&&c.updateMatrix(),l.uvTransform.value.copy(c.matrix))}(n,r):r.isShadowMaterial?(n.color.value.copy(r.color),n.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function ze(i={}){const t=i.canvas!==void 0?i.canvas:function(){const rt=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return rt.style.display="block",rt}(),e=i.context!==void 0?i.context:null,n=i.alpha!==void 0&&i.alpha,r=i.depth===void 0||i.depth,s=i.stencil===void 0||i.stencil,o=i.antialias!==void 0&&i.antialias,a=i.premultipliedAlpha===void 0||i.premultipliedAlpha,l=i.preserveDrawingBuffer!==void 0&&i.preserveDrawingBuffer,h=i.powerPreference!==void 0?i.powerPreference:"default",c=i.failIfMajorPerformanceCaveat!==void 0&&i.failIfMajorPerformanceCaveat;let u=null,p=null;const f=[],g=[];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=3e3,this.physicallyCorrectLights=!1,this.toneMapping=0,this.toneMappingExposure=1;const _=this;let v=!1,M=0,A=0,O=null,H=-1,j=null;const X=new at,U=new at;let V=null,xt=t.width,it=t.height,Q=1,st=null,nt=null;const ct=new at(0,0,xt,it),Lt=new at(0,0,xt,it);let At=!1;const ht=[],gt=new da;let Ut=!1,Vt=!1,Zt=null;const J=new W,et=new w,Ft={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Pt(){return O===null?Q:1}let It,Yt,qt,Nt,Y,pt,Et,Tt,St,Qt,ce,ae,se,we,vn,Ve,Ei,Ho,zo,jo,zn,$n,Jt=e;function V0(rt,Bt){for(let Mt=0;Mt<rt.length;Mt++){const Gt=rt[Mt],Kt=t.getContext(Gt,Bt);if(Kt!==null)return Kt}return null}try{const rt={alpha:n,depth:r,stencil:s,antialias:o,premultipliedAlpha:a,preserveDrawingBuffer:l,powerPreference:h,failIfMajorPerformanceCaveat:c};if(t.addEventListener("webglcontextlost",X0,!1),t.addEventListener("webglcontextrestored",Y0,!1),Jt===null){const Bt=["webgl2","webgl","experimental-webgl"];if(_.isWebGL1Renderer===!0&&Bt.shift(),Jt=V0(Bt,rt),Jt===null)throw V0(Bt)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}Jt.getShaderPrecisionFormat===void 0&&(Jt.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(rt){throw console.error("THREE.WebGLRenderer: "+rt.message),rt}function W0(){It=new dy(Jt),Yt=new hy(Jt,It,i),It.init(Yt),zn=new Mx(Jt,It,Yt),qt=new Tx(Jt,It,Yt),ht[0]=1029,Nt=new my,Y=new gx,pt=new Sx(Jt,It,qt,Y,Yt,zn,Nt),Et=new uy(_),Tt=new sy(Jt,Yt),$n=new ay(Jt,It,Tt,Yt),St=new py(Jt,Tt,Nt,$n),Qt=new yy(Jt,St,Tt,Nt),Ho=new _y(Jt),vn=new cy(Y),ce=new mx(_,Et,It,Yt,$n,vn),ae=new Cx(Y),se=new _x(Y),we=new wx(It,Yt),Ei=new oy(_,Et,qt,Qt,a),Ve=new Yd(_,Qt,Yt),zo=new ly(Jt,It,Nt,Yt),jo=new fy(Jt,It,Nt,Yt),Nt.programs=ce.programs,_.capabilities=Yt,_.extensions=It,_.properties=Y,_.renderLists=se,_.shadowMap=Ve,_.state=qt,_.info=Nt}W0();const ei=new Px(_,Jt);function X0(rt){rt.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),v=!0}function Y0(){console.log("THREE.WebGLRenderer: Context Restored."),v=!1;const rt=Nt.autoReset,Bt=Ve.enabled,Mt=Ve.autoUpdate,Gt=Ve.needsUpdate,Kt=Ve.type;W0(),Nt.autoReset=rt,Ve.enabled=Bt,Ve.autoUpdate=Mt,Ve.needsUpdate=Gt,Ve.type=Kt}function q0(rt){const Bt=rt.target;Bt.removeEventListener("dispose",q0),function(Mt){(function(Gt){const Kt=Y.get(Gt).programs;Kt!==void 0&&Kt.forEach(function(De){ce.releaseProgram(De)})})(Mt),Y.remove(Mt)}(Bt)}this.xr=ei,this.getContext=function(){return Jt},this.getContextAttributes=function(){return Jt.getContextAttributes()},this.forceContextLoss=function(){const rt=It.get("WEBGL_lose_context");rt&&rt.loseContext()},this.forceContextRestore=function(){const rt=It.get("WEBGL_lose_context");rt&&rt.restoreContext()},this.getPixelRatio=function(){return Q},this.setPixelRatio=function(rt){rt!==void 0&&(Q=rt,this.setSize(xt,it,!1))},this.getSize=function(rt){return rt.set(xt,it)},this.setSize=function(rt,Bt,Mt){ei.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(xt=rt,it=Bt,t.width=Math.floor(rt*Q),t.height=Math.floor(Bt*Q),Mt!==!1&&(t.style.width=rt+"px",t.style.height=Bt+"px"),this.setViewport(0,0,rt,Bt))},this.getDrawingBufferSize=function(rt){return rt.set(xt*Q,it*Q).floor()},this.setDrawingBufferSize=function(rt,Bt,Mt){xt=rt,it=Bt,Q=Mt,t.width=Math.floor(rt*Mt),t.height=Math.floor(Bt*Mt),this.setViewport(0,0,rt,Bt)},this.getCurrentViewport=function(rt){return rt.copy(X)},this.getViewport=function(rt){return rt.copy(ct)},this.setViewport=function(rt,Bt,Mt,Gt){rt.isVector4?ct.set(rt.x,rt.y,rt.z,rt.w):ct.set(rt,Bt,Mt,Gt),qt.viewport(X.copy(ct).multiplyScalar(Q).floor())},this.getScissor=function(rt){return rt.copy(Lt)},this.setScissor=function(rt,Bt,Mt,Gt){rt.isVector4?Lt.set(rt.x,rt.y,rt.z,rt.w):Lt.set(rt,Bt,Mt,Gt),qt.scissor(U.copy(Lt).multiplyScalar(Q).floor())},this.getScissorTest=function(){return At},this.setScissorTest=function(rt){qt.setScissorTest(At=rt)},this.setOpaqueSort=function(rt){st=rt},this.setTransparentSort=function(rt){nt=rt},this.getClearColor=function(rt){return rt.copy(Ei.getClearColor())},this.setClearColor=function(){Ei.setClearColor.apply(Ei,arguments)},this.getClearAlpha=function(){return Ei.getClearAlpha()},this.setClearAlpha=function(){Ei.setClearAlpha.apply(Ei,arguments)},this.clear=function(rt,Bt,Mt){let Gt=0;(rt===void 0||rt)&&(Gt|=16384),(Bt===void 0||Bt)&&(Gt|=256),(Mt===void 0||Mt)&&(Gt|=1024),Jt.clear(Gt)},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",X0,!1),t.removeEventListener("webglcontextrestored",Y0,!1),se.dispose(),we.dispose(),Y.dispose(),Et.dispose(),Qt.dispose(),$n.dispose(),ei.dispose(),ei.removeEventListener("sessionstart",$0),ei.removeEventListener("sessionend",Z0),Zt&&(Zt.dispose(),Zt=null),zr.stop()},this.renderBufferImmediate=function(rt,Bt){$n.initAttributes();const Mt=Y.get(rt);rt.hasPositions&&!Mt.position&&(Mt.position=Jt.createBuffer()),rt.hasNormals&&!Mt.normal&&(Mt.normal=Jt.createBuffer()),rt.hasUvs&&!Mt.uv&&(Mt.uv=Jt.createBuffer()),rt.hasColors&&!Mt.color&&(Mt.color=Jt.createBuffer());const Gt=Bt.getAttributes();rt.hasPositions&&(Jt.bindBuffer(34962,Mt.position),Jt.bufferData(34962,rt.positionArray,35048),$n.enableAttribute(Gt.position),Jt.vertexAttribPointer(Gt.position,3,5126,!1,0,0)),rt.hasNormals&&(Jt.bindBuffer(34962,Mt.normal),Jt.bufferData(34962,rt.normalArray,35048),$n.enableAttribute(Gt.normal),Jt.vertexAttribPointer(Gt.normal,3,5126,!1,0,0)),rt.hasUvs&&(Jt.bindBuffer(34962,Mt.uv),Jt.bufferData(34962,rt.uvArray,35048),$n.enableAttribute(Gt.uv),Jt.vertexAttribPointer(Gt.uv,2,5126,!1,0,0)),rt.hasColors&&(Jt.bindBuffer(34962,Mt.color),Jt.bufferData(34962,rt.colorArray,35048),$n.enableAttribute(Gt.color),Jt.vertexAttribPointer(Gt.color,3,5126,!1,0,0)),$n.disableUnusedAttributes(),Jt.drawArrays(4,0,rt.count),rt.count=0},this.renderBufferDirect=function(rt,Bt,Mt,Gt,Kt,De){Bt===null&&(Bt=Ft);const Ee=Kt.isMesh&&Kt.matrixWorld.determinant()<0,ee=Q0(rt,Bt,Gt,Kt);qt.setMaterial(Gt,Ee);let Te=Mt.index;const me=Mt.attributes.position;if(Te===null){if(me===void 0||me.count===0)return}else if(Te.count===0)return;let Ne,be=1;Gt.wireframe===!0&&(Te=St.getWireframeAttribute(Mt),be=2),(Gt.morphTargets||Gt.morphNormals)&&Ho.update(Kt,Mt,Gt,ee),$n.setup(Kt,Gt,ee,Mt,Te);let Pe=zo;Te!==null&&(Ne=Tt.get(Te),Pe=jo,Pe.setIndex(Ne));const fn=Te!==null?Te.count:me.count,$e=Mt.drawRange.start*be,wi=Mt.drawRange.count*be,We=De!==null?De.start*be:0,Ui=De!==null?De.count*be:1/0,_n=Math.max($e,We),ni=Math.min(fn,$e+wi,We+Ui)-1,Fn=Math.max(0,ni-_n+1);if(Fn!==0){if(Kt.isMesh)Gt.wireframe===!0?(qt.setLineWidth(Gt.wireframeLinewidth*Pt()),Pe.setMode(1)):Pe.setMode(4);else if(Kt.isLine){let Vo=Gt.linewidth;Vo===void 0&&(Vo=1),qt.setLineWidth(Vo*Pt()),Kt.isLineSegments?Pe.setMode(1):Kt.isLineLoop?Pe.setMode(2):Pe.setMode(3)}else Kt.isPoints?Pe.setMode(0):Kt.isSprite&&Pe.setMode(4);if(Kt.isInstancedMesh)Pe.renderInstances(_n,Fn,Kt.count);else if(Mt.isInstancedBufferGeometry){const Vo=Math.min(Mt.instanceCount,Mt._maxInstanceCount);Pe.renderInstances(_n,Fn,Vo)}else Pe.render(_n,Fn)}},this.compile=function(rt,Bt){p=we.get(rt),p.init(),rt.traverseVisible(function(Mt){Mt.isLight&&Mt.layers.test(Bt.layers)&&(p.pushLight(Mt),Mt.castShadow&&p.pushShadow(Mt))}),p.setupLights(),rt.traverse(function(Mt){const Gt=Mt.material;if(Gt)if(Array.isArray(Gt))for(let Kt=0;Kt<Gt.length;Kt++)ju(Gt[Kt],rt,Mt);else ju(Gt,rt,Mt)})};let zu=null;function $0(){zr.stop()}function Z0(){zr.start()}const zr=new xd;function Nl(rt,Bt,Mt){const Gt=Bt.isScene===!0?Bt.overrideMaterial:null;for(let Kt=0,De=rt.length;Kt<De;Kt++){const Ee=rt[Kt],ee=Ee.object,Te=Ee.geometry,me=Gt===null?Ee.material:Gt,Ne=Ee.group;if(Mt.isArrayCamera){const be=Mt.cameras;for(let Pe=0,fn=be.length;Pe<fn;Pe++){const $e=be[Pe];ee.layers.test($e.layers)&&(qt.viewport(X.copy($e.viewport)),p.setupLightsView($e),J0(ee,Bt,$e,Te,me,Ne))}}else J0(ee,Bt,Mt,Te,me,Ne)}}function J0(rt,Bt,Mt,Gt,Kt,De){if(rt.onBeforeRender(_,Bt,Mt,Gt,Kt,De),rt.modelViewMatrix.multiplyMatrices(Mt.matrixWorldInverse,rt.matrixWorld),rt.normalMatrix.getNormalMatrix(rt.modelViewMatrix),rt.isImmediateRenderObject){const Ee=Q0(Mt,Bt,Kt,rt);qt.setMaterial(Kt),$n.reset(),function(ee,Te){ee.render(function(me){_.renderBufferImmediate(me,Te)})}(rt,Ee)}else Kt.transparent===!0&&Kt.side===2?(Kt.side=1,Kt.needsUpdate=!0,_.renderBufferDirect(Mt,Bt,Gt,Kt,rt,De),Kt.side=0,Kt.needsUpdate=!0,_.renderBufferDirect(Mt,Bt,Gt,Kt,rt,De),Kt.side=2):_.renderBufferDirect(Mt,Bt,Gt,Kt,rt,De);rt.onAfterRender(_,Bt,Mt,Gt,Kt,De)}function ju(rt,Bt,Mt){Bt.isScene!==!0&&(Bt=Ft);const Gt=Y.get(rt),Kt=p.state.lights,De=p.state.shadowsArray,Ee=Kt.state.version,ee=ce.getParameters(rt,Kt.state,De,Bt,Mt),Te=ce.getProgramCacheKey(ee);let me=Gt.programs;Gt.environment=rt.isMeshStandardMaterial?Bt.environment:null,Gt.fog=Bt.fog,Gt.envMap=Et.get(rt.envMap||Gt.environment),me===void 0&&(rt.addEventListener("dispose",q0),me=new Map,Gt.programs=me);let Ne=me.get(Te);if(Ne!==void 0){if(Gt.currentProgram===Ne&&Gt.lightsStateVersion===Ee)return K0(rt,ee),Ne}else ee.uniforms=ce.getUniforms(rt),rt.onBuild(ee,_),rt.onBeforeCompile(ee,_),Ne=ce.acquireProgram(ee,Te),me.set(Te,Ne),Gt.uniforms=ee.uniforms;const be=Gt.uniforms;(rt.isShaderMaterial||rt.isRawShaderMaterial)&&rt.clipping!==!0||(be.clippingPlanes=vn.uniform),K0(rt,ee),Gt.needsLights=function($e){return $e.isMeshLambertMaterial||$e.isMeshToonMaterial||$e.isMeshPhongMaterial||$e.isMeshStandardMaterial||$e.isShadowMaterial||$e.isShaderMaterial&&$e.lights===!0}(rt),Gt.lightsStateVersion=Ee,Gt.needsLights&&(be.ambientLightColor.value=Kt.state.ambient,be.lightProbe.value=Kt.state.probe,be.directionalLights.value=Kt.state.directional,be.directionalLightShadows.value=Kt.state.directionalShadow,be.spotLights.value=Kt.state.spot,be.spotLightShadows.value=Kt.state.spotShadow,be.rectAreaLights.value=Kt.state.rectArea,be.ltc_1.value=Kt.state.rectAreaLTC1,be.ltc_2.value=Kt.state.rectAreaLTC2,be.pointLights.value=Kt.state.point,be.pointLightShadows.value=Kt.state.pointShadow,be.hemisphereLights.value=Kt.state.hemi,be.directionalShadowMap.value=Kt.state.directionalShadowMap,be.directionalShadowMatrix.value=Kt.state.directionalShadowMatrix,be.spotShadowMap.value=Kt.state.spotShadowMap,be.spotShadowMatrix.value=Kt.state.spotShadowMatrix,be.pointShadowMap.value=Kt.state.pointShadowMap,be.pointShadowMatrix.value=Kt.state.pointShadowMatrix);const Pe=Ne.getUniforms(),fn=or.seqWithValue(Pe.seq,be);return Gt.currentProgram=Ne,Gt.uniformsList=fn,Ne}function K0(rt,Bt){const Mt=Y.get(rt);Mt.outputEncoding=Bt.outputEncoding,Mt.instancing=Bt.instancing,Mt.skinning=Bt.skinning,Mt.numClippingPlanes=Bt.numClippingPlanes,Mt.numIntersection=Bt.numClipIntersection,Mt.vertexAlphas=Bt.vertexAlphas}function Q0(rt,Bt,Mt,Gt){Bt.isScene!==!0&&(Bt=Ft),pt.resetTextureUnits();const Kt=Bt.fog,De=Mt.isMeshStandardMaterial?Bt.environment:null,Ee=O===null?_.outputEncoding:O.texture.encoding,ee=Et.get(Mt.envMap||De),Te=Mt.vertexColors===!0&&Gt.geometry&&Gt.geometry.attributes.color&&Gt.geometry.attributes.color.itemSize===4,me=Y.get(Mt),Ne=p.state.lights;if(Ut===!0&&(Vt===!0||rt!==j)){const Fn=rt===j&&Mt.id===H;vn.setState(Mt,rt,Fn)}let be=!1;Mt.version===me.__version?me.needsLights&&me.lightsStateVersion!==Ne.state.version||me.outputEncoding!==Ee||Gt.isInstancedMesh&&me.instancing===!1?be=!0:Gt.isInstancedMesh||me.instancing!==!0?Gt.isSkinnedMesh&&me.skinning===!1?be=!0:Gt.isSkinnedMesh||me.skinning!==!0?me.envMap!==ee||Mt.fog&&me.fog!==Kt?be=!0:me.numClippingPlanes===void 0||me.numClippingPlanes===vn.numPlanes&&me.numIntersection===vn.numIntersection?me.vertexAlphas!==Te&&(be=!0):be=!0:be=!0:be=!0:(be=!0,me.__version=Mt.version);let Pe=me.currentProgram;be===!0&&(Pe=ju(Mt,Bt,Gt));let fn=!1,$e=!1,wi=!1;const We=Pe.getUniforms(),Ui=me.uniforms;if(qt.useProgram(Pe.program)&&(fn=!0,$e=!0,wi=!0),Mt.id!==H&&(H=Mt.id,$e=!0),fn||j!==rt){if(We.setValue(Jt,"projectionMatrix",rt.projectionMatrix),Yt.logarithmicDepthBuffer&&We.setValue(Jt,"logDepthBufFC",2/(Math.log(rt.far+1)/Math.LN2)),j!==rt&&(j=rt,$e=!0,wi=!0),Mt.isShaderMaterial||Mt.isMeshPhongMaterial||Mt.isMeshToonMaterial||Mt.isMeshStandardMaterial||Mt.envMap){const Fn=We.map.cameraPosition;Fn!==void 0&&Fn.setValue(Jt,et.setFromMatrixPosition(rt.matrixWorld))}(Mt.isMeshPhongMaterial||Mt.isMeshToonMaterial||Mt.isMeshLambertMaterial||Mt.isMeshBasicMaterial||Mt.isMeshStandardMaterial||Mt.isShaderMaterial)&&We.setValue(Jt,"isOrthographic",rt.isOrthographicCamera===!0),(Mt.isMeshPhongMaterial||Mt.isMeshToonMaterial||Mt.isMeshLambertMaterial||Mt.isMeshBasicMaterial||Mt.isMeshStandardMaterial||Mt.isShaderMaterial||Mt.isShadowMaterial||Gt.isSkinnedMesh)&&We.setValue(Jt,"viewMatrix",rt.matrixWorldInverse)}if(Gt.isSkinnedMesh){We.setOptional(Jt,Gt,"bindMatrix"),We.setOptional(Jt,Gt,"bindMatrixInverse");const Fn=Gt.skeleton;Fn&&(Yt.floatVertexTextures?(Fn.boneTexture===null&&Fn.computeBoneTexture(),We.setValue(Jt,"boneTexture",Fn.boneTexture,pt),We.setValue(Jt,"boneTextureSize",Fn.boneTextureSize)):We.setOptional(Jt,Fn,"boneMatrices"))}var _n,ni;return($e||me.receiveShadow!==Gt.receiveShadow)&&(me.receiveShadow=Gt.receiveShadow,We.setValue(Jt,"receiveShadow",Gt.receiveShadow)),$e&&(We.setValue(Jt,"toneMappingExposure",_.toneMappingExposure),me.needsLights&&(ni=wi,(_n=Ui).ambientLightColor.needsUpdate=ni,_n.lightProbe.needsUpdate=ni,_n.directionalLights.needsUpdate=ni,_n.directionalLightShadows.needsUpdate=ni,_n.pointLights.needsUpdate=ni,_n.pointLightShadows.needsUpdate=ni,_n.spotLights.needsUpdate=ni,_n.spotLightShadows.needsUpdate=ni,_n.rectAreaLights.needsUpdate=ni,_n.hemisphereLights.needsUpdate=ni),Kt&&Mt.fog&&ae.refreshFogUniforms(Ui,Kt),ae.refreshMaterialUniforms(Ui,Mt,Q,it,Zt),or.upload(Jt,me.uniformsList,Ui,pt)),Mt.isShaderMaterial&&Mt.uniformsNeedUpdate===!0&&(or.upload(Jt,me.uniformsList,Ui,pt),Mt.uniformsNeedUpdate=!1),Mt.isSpriteMaterial&&We.setValue(Jt,"center",Gt.center),We.setValue(Jt,"modelViewMatrix",Gt.modelViewMatrix),We.setValue(Jt,"normalMatrix",Gt.normalMatrix),We.setValue(Jt,"modelMatrix",Gt.matrixWorld),Pe}zr.setAnimationLoop(function(rt){zu&&zu(rt)}),typeof window!="undefined"&&zr.setContext(window),this.setAnimationLoop=function(rt){zu=rt,ei.setAnimationLoop(rt),rt===null?zr.stop():zr.start()},ei.addEventListener("sessionstart",$0),ei.addEventListener("sessionend",Z0),this.render=function(rt,Bt){if(Bt!==void 0&&Bt.isCamera!==!0)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(v===!0)return;rt.autoUpdate===!0&&rt.updateMatrixWorld(),Bt.parent===null&&Bt.updateMatrixWorld(),ei.enabled===!0&&ei.isPresenting===!0&&(ei.cameraAutoUpdate===!0&&ei.updateCamera(Bt),Bt=ei.getCamera()),rt.isScene===!0&&rt.onBeforeRender(_,rt,Bt,O),p=we.get(rt,g.length),p.init(),g.push(p),J.multiplyMatrices(Bt.projectionMatrix,Bt.matrixWorldInverse),gt.setFromProjectionMatrix(J),Vt=this.localClippingEnabled,Ut=vn.init(this.clippingPlanes,Vt,Bt),u=se.get(rt,f.length),u.init(),f.push(u),function Ee(ee,Te,me,Ne){if(ee.visible===!1)return;if(ee.layers.test(Te.layers)){if(ee.isGroup)me=ee.renderOrder;else if(ee.isLOD)ee.autoUpdate===!0&&ee.update(Te);else if(ee.isLight)p.pushLight(ee),ee.castShadow&&p.pushShadow(ee);else if(ee.isSprite){if(!ee.frustumCulled||gt.intersectsSprite(ee)){Ne&&et.setFromMatrixPosition(ee.matrixWorld).applyMatrix4(J);const Pe=Qt.update(ee),fn=ee.material;fn.visible&&u.push(ee,Pe,fn,me,et.z,null)}}else if(ee.isImmediateRenderObject)Ne&&et.setFromMatrixPosition(ee.matrixWorld).applyMatrix4(J),u.push(ee,null,ee.material,me,et.z,null);else if((ee.isMesh||ee.isLine||ee.isPoints)&&(ee.isSkinnedMesh&&ee.skeleton.frame!==Nt.render.frame&&(ee.skeleton.update(),ee.skeleton.frame=Nt.render.frame),!ee.frustumCulled||gt.intersectsObject(ee))){Ne&&et.setFromMatrixPosition(ee.matrixWorld).applyMatrix4(J);const Pe=Qt.update(ee),fn=ee.material;if(Array.isArray(fn)){const $e=Pe.groups;for(let wi=0,We=$e.length;wi<We;wi++){const Ui=$e[wi],_n=fn[Ui.materialIndex];_n&&_n.visible&&u.push(ee,Pe,_n,me,et.z,Ui)}}else fn.visible&&u.push(ee,Pe,fn,me,et.z,null)}}const be=ee.children;for(let Pe=0,fn=be.length;Pe<fn;Pe++)Ee(be[Pe],Te,me,Ne)}(rt,Bt,0,_.sortObjects),u.finish(),_.sortObjects===!0&&u.sort(st,nt),Ut===!0&&vn.beginShadows();const Mt=p.state.shadowsArray;Ve.render(Mt,rt,Bt),p.setupLights(),p.setupLightsView(Bt),Ut===!0&&vn.endShadows(),this.info.autoReset===!0&&this.info.reset(),Ei.render(u,rt);const Gt=u.opaque,Kt=u.transmissive,De=u.transparent;Gt.length>0&&Nl(Gt,rt,Bt),Kt.length>0&&function(Ee,ee,Te,me){if(Zt===null){const Pe=o===!0&&Yt.isWebGL2===!0;Zt=new(Pe?tt:$)(1024,1024,{generateMipmaps:!0,type:zn.convert(1016)!==null?1016:1009,minFilter:1008,magFilter:1003,wrapS:1001,wrapT:1001})}const Ne=_.getRenderTarget();_.setRenderTarget(Zt),_.clear();const be=_.toneMapping;_.toneMapping=0,Nl(Ee,Te,me),_.toneMapping=be,pt.updateMultisampleRenderTarget(Zt),pt.updateRenderTargetMipmap(Zt),_.setRenderTarget(Ne),Nl(ee,Te,me)}(Gt,Kt,rt,Bt),De.length>0&&Nl(De,rt,Bt),O!==null&&(pt.updateMultisampleRenderTarget(O),pt.updateRenderTargetMipmap(O)),rt.isScene===!0&&rt.onAfterRender(_,rt,Bt),qt.buffers.depth.setTest(!0),qt.buffers.depth.setMask(!0),qt.buffers.color.setMask(!0),qt.setPolygonOffset(!1),$n.resetDefaultState(),H=-1,j=null,g.pop(),p=g.length>0?g[g.length-1]:null,f.pop(),u=f.length>0?f[f.length-1]:null},this.getActiveCubeFace=function(){return M},this.getActiveMipmapLevel=function(){return A},this.getRenderTarget=function(){return O},this.setRenderTarget=function(rt,Bt=0,Mt=0){O=rt,M=Bt,A=Mt,rt&&Y.get(rt).__webglFramebuffer===void 0&&pt.setupRenderTarget(rt);let Gt=null,Kt=!1,De=!1;if(rt){const Ee=rt.texture;(Ee.isDataTexture3D||Ee.isDataTexture2DArray)&&(De=!0);const ee=Y.get(rt).__webglFramebuffer;rt.isWebGLCubeRenderTarget?(Gt=ee[Bt],Kt=!0):Gt=rt.isWebGLMultisampleRenderTarget?Y.get(rt).__webglMultisampledFramebuffer:ee,X.copy(rt.viewport),U.copy(rt.scissor),V=rt.scissorTest}else X.copy(ct).multiplyScalar(Q).floor(),U.copy(Lt).multiplyScalar(Q).floor(),V=At;if(qt.bindFramebuffer(36160,Gt)&&Yt.drawBuffers){let Ee=!1;if(rt)if(rt.isWebGLMultipleRenderTargets){const ee=rt.texture;if(ht.length!==ee.length||ht[0]!==36064){for(let Te=0,me=ee.length;Te<me;Te++)ht[Te]=36064+Te;ht.length=ee.length,Ee=!0}}else ht.length===1&&ht[0]===36064||(ht[0]=36064,ht.length=1,Ee=!0);else ht.length===1&&ht[0]===1029||(ht[0]=1029,ht.length=1,Ee=!0);Ee&&(Yt.isWebGL2?Jt.drawBuffers(ht):It.get("WEBGL_draw_buffers").drawBuffersWEBGL(ht))}if(qt.viewport(X),qt.scissor(U),qt.setScissorTest(V),Kt){const Ee=Y.get(rt.texture);Jt.framebufferTexture2D(36160,36064,34069+Bt,Ee.__webglTexture,Mt)}else if(De){const Ee=Y.get(rt.texture),ee=Bt||0;Jt.framebufferTextureLayer(36160,36064,Ee.__webglTexture,Mt||0,ee)}},this.readRenderTargetPixels=function(rt,Bt,Mt,Gt,Kt,De,Ee){if(!rt||!rt.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let ee=Y.get(rt).__webglFramebuffer;if(rt.isWebGLCubeRenderTarget&&Ee!==void 0&&(ee=ee[Ee]),ee){qt.bindFramebuffer(36160,ee);try{const Te=rt.texture,me=Te.format,Ne=Te.type;if(me!==1023&&zn.convert(me)!==Jt.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const be=Ne===1016&&(It.has("EXT_color_buffer_half_float")||Yt.isWebGL2&&It.has("EXT_color_buffer_float"));if(!(Ne===1009||zn.convert(Ne)===Jt.getParameter(35738)||Ne===1015&&(Yt.isWebGL2||It.has("OES_texture_float")||It.has("WEBGL_color_buffer_float"))||be))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");Jt.checkFramebufferStatus(36160)===36053?Bt>=0&&Bt<=rt.width-Gt&&Mt>=0&&Mt<=rt.height-Kt&&Jt.readPixels(Bt,Mt,Gt,Kt,zn.convert(me),zn.convert(Ne),De):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const Te=O!==null?Y.get(O).__webglFramebuffer:null;qt.bindFramebuffer(36160,Te)}}},this.copyFramebufferToTexture=function(rt,Bt,Mt=0){const Gt=Math.pow(2,-Mt),Kt=Math.floor(Bt.image.width*Gt),De=Math.floor(Bt.image.height*Gt);let Ee=zn.convert(Bt.format);Yt.isWebGL2&&(Ee===6407&&(Ee=32849),Ee===6408&&(Ee=32856)),pt.setTexture2D(Bt,0),Jt.copyTexImage2D(3553,Mt,Ee,rt.x,rt.y,Kt,De,0),qt.unbindTexture()},this.copyTextureToTexture=function(rt,Bt,Mt,Gt=0){const Kt=Bt.image.width,De=Bt.image.height,Ee=zn.convert(Mt.format),ee=zn.convert(Mt.type);pt.setTexture2D(Mt,0),Jt.pixelStorei(37440,Mt.flipY),Jt.pixelStorei(37441,Mt.premultiplyAlpha),Jt.pixelStorei(3317,Mt.unpackAlignment),Bt.isDataTexture?Jt.texSubImage2D(3553,Gt,rt.x,rt.y,Kt,De,Ee,ee,Bt.image.data):Bt.isCompressedTexture?Jt.compressedTexSubImage2D(3553,Gt,rt.x,rt.y,Bt.mipmaps[0].width,Bt.mipmaps[0].height,Ee,Bt.mipmaps[0].data):Jt.texSubImage2D(3553,Gt,rt.x,rt.y,Ee,ee,Bt.image),Gt===0&&Mt.generateMipmaps&&Jt.generateMipmap(3553),qt.unbindTexture()},this.copyTextureToTexture3D=function(rt,Bt,Mt,Gt,Kt=0){if(_.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const De=rt.max.x-rt.min.x+1,Ee=rt.max.y-rt.min.y+1,ee=rt.max.z-rt.min.z+1,Te=zn.convert(Gt.format),me=zn.convert(Gt.type);let Ne;if(Gt.isDataTexture3D)pt.setTexture3D(Gt,0),Ne=32879;else{if(!Gt.isDataTexture2DArray)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");pt.setTexture2DArray(Gt,0),Ne=35866}Jt.pixelStorei(37440,Gt.flipY),Jt.pixelStorei(37441,Gt.premultiplyAlpha),Jt.pixelStorei(3317,Gt.unpackAlignment);const be=Jt.getParameter(3314),Pe=Jt.getParameter(32878),fn=Jt.getParameter(3316),$e=Jt.getParameter(3315),wi=Jt.getParameter(32877),We=Mt.isCompressedTexture?Mt.mipmaps[0]:Mt.image;Jt.pixelStorei(3314,We.width),Jt.pixelStorei(32878,We.height),Jt.pixelStorei(3316,rt.min.x),Jt.pixelStorei(3315,rt.min.y),Jt.pixelStorei(32877,rt.min.z),Mt.isDataTexture||Mt.isDataTexture3D?Jt.texSubImage3D(Ne,Kt,Bt.x,Bt.y,Bt.z,De,Ee,ee,Te,me,We.data):Mt.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),Jt.compressedTexSubImage3D(Ne,Kt,Bt.x,Bt.y,Bt.z,De,Ee,ee,Te,We.data)):Jt.texSubImage3D(Ne,Kt,Bt.x,Bt.y,Bt.z,De,Ee,ee,Te,me,We),Jt.pixelStorei(3314,be),Jt.pixelStorei(32878,Pe),Jt.pixelStorei(3316,fn),Jt.pixelStorei(3315,$e),Jt.pixelStorei(32877,wi),Kt===0&&Gt.generateMipmaps&&Jt.generateMipmap(Ne),qt.unbindTexture()},this.initTexture=function(rt){pt.setTexture2D(rt,0),qt.unbindTexture()},this.resetState=function(){M=0,A=0,O=null,qt.reset(),$n.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}(class extends ze{}).prototype.isWebGL1Renderer=!0;class hh extends ke{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return this.fog!==null&&(e.object.fog=this.fog.toJSON()),e}}hh.prototype.isScene=!0;class zs{constructor(t,e){this.array=t,this.stride=e,this.count=t!==void 0?t.length/e:0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=K()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,n){t*=this.stride,n*=e.stride;for(let r=0,s=this.stride;r<s;r++)this.array[t+r]=e.array[n+r];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=K()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(e,this.stride);return n.setUsage(this.usage),n}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=K()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.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}}}zs.prototype.isInterleavedBuffer=!0;const hn=new w;class js{constructor(t,e,n,r=!1){this.name="",this.data=t,this.itemSize=e,this.offset=n,this.normalized=r===!0}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,n=this.data.count;e<n;e++)hn.x=this.getX(e),hn.y=this.getY(e),hn.z=this.getZ(e),hn.applyMatrix4(t),this.setXYZ(e,hn.x,hn.y,hn.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)hn.x=this.getX(e),hn.y=this.getY(e),hn.z=this.getZ(e),hn.applyNormalMatrix(t),this.setXYZ(e,hn.x,hn.y,hn.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)hn.x=this.getX(e),hn.y=this.getY(e),hn.z=this.getZ(e),hn.transformDirection(t),this.setXYZ(e,hn.x,hn.y,hn.z);return this}setX(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){return this.data.array[t*this.data.stride+this.offset]}getY(t){return this.data.array[t*this.data.stride+this.offset+1]}getZ(t){return this.data.array[t*this.data.stride+this.offset+2]}getW(t){return this.data.array[t*this.data.stride+this.offset+3]}setXY(t,e,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this}setXYZ(t,e,n,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this}setXYZW(t,e,n,r,s){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this.data.array[t+3]=s,this}clone(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");const e=[];for(let n=0;n<this.count;n++){const r=n*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)e.push(this.data.array[r+s])}return new an(new this.array.constructor(e),this.itemSize,this.normalized)}return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new js(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");const e=[];for(let n=0;n<this.count;n++){const r=n*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)e.push(this.data.array[r+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}js.prototype.isInterleavedBufferAttribute=!0;class $d extends Rn{constructor(t){super(),this.type="SpriteMaterial",this.color=new _e(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this}}let Kr;$d.prototype.isSpriteMaterial=!0;const Vs=new w,Qr=new w,ts=new w,es=new F,Ws=new F,Zd=new W,fa=new w,Xs=new w,ma=new w,Jd=new F,ch=new F,Kd=new F;class Ix extends ke{constructor(t){if(super(),this.type="Sprite",Kr===void 0){Kr=new He;const e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new zs(e,5);Kr.setIndex([0,1,2,0,2,3]),Kr.setAttribute("position",new js(n,3,0,!1)),Kr.setAttribute("uv",new js(n,2,3,!1))}this.geometry=Kr,this.material=t!==void 0?t:new $d,this.center=new F(.5,.5)}raycast(t,e){t.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Qr.setFromMatrixScale(this.matrixWorld),Zd.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),ts.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Qr.multiplyScalar(-ts.z);const n=this.material.rotation;let r,s;n!==0&&(s=Math.cos(n),r=Math.sin(n));const o=this.center;ga(fa.set(-.5,-.5,0),ts,o,Qr,r,s),ga(Xs.set(.5,-.5,0),ts,o,Qr,r,s),ga(ma.set(.5,.5,0),ts,o,Qr,r,s),Jd.set(0,0),ch.set(1,0),Kd.set(1,1);let a=t.ray.intersectTriangle(fa,Xs,ma,!1,Vs);if(a===null&&(ga(Xs.set(-.5,.5,0),ts,o,Qr,r,s),ch.set(0,1),a=t.ray.intersectTriangle(fa,ma,Xs,!1,Vs),a===null))return;const l=t.ray.origin.distanceTo(Vs);l<t.near||l>t.far||e.push({distance:l,point:Vs.clone(),uv:pn.getUV(Vs,fa,Xs,ma,Jd,ch,Kd,new F),face:null,object:this})}copy(t){return super.copy(t),t.center!==void 0&&this.center.copy(t.center),this.material=t.material,this}}function ga(i,t,e,n,r,s){es.subVectors(i,e).addScalar(.5).multiply(n),r!==void 0?(Ws.x=s*es.x-r*es.y,Ws.y=r*es.x+s*es.y):Ws.copy(es),i.copy(t),i.x+=Ws.x,i.y+=Ws.y,i.applyMatrix4(Zd)}Ix.prototype.isSprite=!0;const Qd=new w,tp=new at,ep=new at,Rx=new w,np=new W;class ip extends kn{constructor(t,e){super(t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new W,this.bindMatrixInverse=new W}copy(t){return super.copy(t),this.bindMode=t.bindMode,this.bindMatrix.copy(t.bindMatrix),this.bindMatrixInverse.copy(t.bindMatrixInverse),this.skeleton=t.skeleton,this}bind(t,e){this.skeleton=t,e===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.copy(e).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const t=new at,e=this.geometry.attributes.skinWeight;for(let n=0,r=e.count;n<r;n++){t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.w=e.getW(n);const s=1/t.manhattanLength();s!==1/0?t.multiplyScalar(s):t.set(1,0,0,0),e.setXYZW(n,t.x,t.y,t.z,t.w)}}updateMatrixWorld(t){super.updateMatrixWorld(t),this.bindMode==="attached"?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode==="detached"?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(t,e){const n=this.skeleton,r=this.geometry;tp.fromBufferAttribute(r.attributes.skinIndex,t),ep.fromBufferAttribute(r.attributes.skinWeight,t),Qd.fromBufferAttribute(r.attributes.position,t).applyMatrix4(this.bindMatrix),e.set(0,0,0);for(let s=0;s<4;s++){const o=ep.getComponent(s);if(o!==0){const a=tp.getComponent(s);np.multiplyMatrices(n.bones[a].matrixWorld,n.boneInverses[a]),e.addScaledVector(Rx.copy(Qd).applyMatrix4(np),o)}}return e.applyMatrix4(this.bindMatrixInverse)}}ip.prototype.isSkinnedMesh=!0;class Lx extends ke{constructor(){super(),this.type="Bone"}}Lx.prototype.isBone=!0;class rp extends Rt{constructor(t=null,e=1,n=1,r,s,o,a,l,h=1003,c=1003,u,p){super(null,o,a,l,h,c,r,s,u,p),this.image={data:t,width:e,height:n},this.magFilter=h,this.minFilter=c,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}rp.prototype.isDataTexture=!0;const sp=new W,op=new W,va=[],Ys=new kn;class Nx extends kn{constructor(t,e,n){super(t,e),this.instanceMatrix=new an(new Float32Array(16*n),16),this.instanceColor=null,this.count=n,this.frustumCulled=!1}copy(t){return super.copy(t),this.instanceMatrix.copy(t.instanceMatrix),t.instanceColor!==null&&(this.instanceColor=t.instanceColor.clone()),this.count=t.count,this}getColorAt(t,e){e.fromArray(this.instanceColor.array,3*t)}getMatrixAt(t,e){e.fromArray(this.instanceMatrix.array,16*t)}raycast(t,e){const n=this.matrixWorld,r=this.count;if(Ys.geometry=this.geometry,Ys.material=this.material,Ys.material!==void 0)for(let s=0;s<r;s++){this.getMatrixAt(s,sp),op.multiplyMatrices(n,sp),Ys.matrixWorld=op,Ys.raycast(t,va);for(let o=0,a=va.length;o<a;o++){const l=va[o];l.instanceId=s,l.object=this,e.push(l)}va.length=0}}setColorAt(t,e){this.instanceColor===null&&(this.instanceColor=new an(new Float32Array(3*this.count),3)),e.toArray(this.instanceColor.array,3*t)}setMatrixAt(t,e){e.toArray(this.instanceMatrix.array,16*t)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}Nx.prototype.isInstancedMesh=!0;class qs extends Rn{constructor(t){super(),this.type="LineBasicMaterial",this.color=new _e(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.morphTargets=!1,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.morphTargets=t.morphTargets,this}}qs.prototype.isLineBasicMaterial=!0;const ap=new w,lp=new w,hp=new W,uh=new z,_a=new je;class dh extends ke{constructor(t=new He,e=new qs){super(),this.type="Line",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t){return super.copy(t),this.material=t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(t.isBufferGeometry)if(t.index===null){const e=t.attributes.position,n=[0];for(let r=1,s=e.count;r<s;r++)ap.fromBufferAttribute(e,r-1),lp.fromBufferAttribute(e,r),n[r]=n[r-1],n[r]+=ap.distanceTo(lp);t.setAttribute("lineDistance",new Fe(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else t.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}raycast(t,e){const n=this.geometry,r=this.matrixWorld,s=t.params.Line.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),_a.copy(n.boundingSphere),_a.applyMatrix4(r),_a.radius+=s,t.ray.intersectsSphere(_a)===!1)return;hp.copy(r).invert(),uh.copy(t.ray).applyMatrix4(hp);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,h=new w,c=new w,u=new w,p=new w,f=this.isLineSegments?2:1;if(n.isBufferGeometry){const g=n.index,_=n.attributes.position;if(g!==null)for(let v=Math.max(0,o.start),M=Math.min(g.count,o.start+o.count)-1;v<M;v+=f){const A=g.getX(v),O=g.getX(v+1);if(h.fromBufferAttribute(_,A),c.fromBufferAttribute(_,O),uh.distanceSqToSegment(h,c,p,u)>l)continue;p.applyMatrix4(this.matrixWorld);const H=t.ray.origin.distanceTo(p);H<t.near||H>t.far||e.push({distance:H,point:u.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}else for(let v=Math.max(0,o.start),M=Math.min(_.count,o.start+o.count)-1;v<M;v+=f){if(h.fromBufferAttribute(_,v),c.fromBufferAttribute(_,v+1),uh.distanceSqToSegment(h,c,p,u)>l)continue;p.applyMatrix4(this.matrixWorld);const A=t.ray.origin.distanceTo(p);A<t.near||A>t.far||e.push({distance:A,point:u.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,n=Object.keys(e);if(n.length>0){const r=e[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const a=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}else{const e=t.morphTargets;e!==void 0&&e.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}dh.prototype.isLine=!0;const cp=new w,up=new w;class ph extends dh{constructor(t,e){super(t,e),this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(t.isBufferGeometry)if(t.index===null){const e=t.attributes.position,n=[];for(let r=0,s=e.count;r<s;r+=2)cp.fromBufferAttribute(e,r),up.fromBufferAttribute(e,r+1),n[r]=r===0?0:n[r-1],n[r+1]=n[r]+cp.distanceTo(up);t.setAttribute("lineDistance",new Fe(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else t.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}}ph.prototype.isLineSegments=!0;class Ox extends dh{constructor(t,e){super(t,e),this.type="LineLoop"}}Ox.prototype.isLineLoop=!0;class dp extends Rn{constructor(t){super(),this.type="PointsMaterial",this.color=new _e(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.morphTargets=t.morphTargets,this}}dp.prototype.isPointsMaterial=!0;const pp=new W,fh=new z,ya=new je,xa=new w;class Dx extends ke{constructor(t=new He,e=new dp){super(),this.type="Points",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t){return super.copy(t),this.material=t.material,this.geometry=t.geometry,this}raycast(t,e){const n=this.geometry,r=this.matrixWorld,s=t.params.Points.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),ya.copy(n.boundingSphere),ya.applyMatrix4(r),ya.radius+=s,t.ray.intersectsSphere(ya)===!1)return;pp.copy(r).invert(),fh.copy(t.ray).applyMatrix4(pp);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a;if(n.isBufferGeometry){const h=n.index,c=n.attributes.position;if(h!==null)for(let u=Math.max(0,o.start),p=Math.min(h.count,o.start+o.count);u<p;u++){const f=h.getX(u);xa.fromBufferAttribute(c,f),fp(xa,f,l,r,t,e,this)}else for(let u=Math.max(0,o.start),p=Math.min(c.count,o.start+o.count);u<p;u++)xa.fromBufferAttribute(c,u),fp(xa,u,l,r,t,e,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,n=Object.keys(e);if(n.length>0){const r=e[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const a=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}else{const e=t.morphTargets;e!==void 0&&e.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function fp(i,t,e,n,r,s,o){const a=fh.distanceSqToPoint(i);if(a<e){const l=new w;fh.closestPointToPoint(i,l),l.applyMatrix4(n);const h=r.ray.origin.distanceTo(l);if(h<r.near||h>r.far)return;s.push({distance:h,distanceToRay:Math.sqrt(a),point:l,index:t,face:null,object:o})}}Dx.prototype.isPoints=!0,class extends Rt{constructor(i,t,e,n,r,s,o,a,l){super(i,t,e,n,r,s,o,a,l),this.format=o!==void 0?o:1022,this.minFilter=s!==void 0?s:1006,this.magFilter=r!==void 0?r:1006,this.generateMipmaps=!1;const h=this;"requestVideoFrameCallback"in i&&i.requestVideoFrameCallback(function c(){h.needsUpdate=!0,i.requestVideoFrameCallback(c)})}clone(){return new this.constructor(this.image).copy(this)}update(){const i=this.image;!("requestVideoFrameCallback"in i)&&i.readyState>=i.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}.prototype.isVideoTexture=!0;class Fx extends Rt{constructor(t,e,n,r,s,o,a,l,h,c,u,p){super(null,o,a,l,h,c,r,s,u,p),this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}Fx.prototype.isCompressedTexture=!0;class mh extends Rt{constructor(t,e,n,r,s,o,a,l,h){super(t,e,n,r,s,o,a,l,h),this.needsUpdate=!0}}mh.prototype.isCanvasTexture=!0,class extends Rt{constructor(i,t,e,n,r,s,o,a,l,h){if((h=h!==void 0?h:1026)!==1026&&h!==1027)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");e===void 0&&h===1026&&(e=1012),e===void 0&&h===1027&&(e=1020),super(null,n,r,s,o,a,h,e,l),this.image={width:i,height:t},this.magFilter=o!==void 0?o:1003,this.minFilter=a!==void 0?a:1003,this.flipY=!1,this.generateMipmaps=!1}}.prototype.isDepthTexture=!0,new w,new w,new w,new pn;class si{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const n=this.getUtoTmapping(t);return this.getPoint(n,e)}getPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return e}getSpacedPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let n,r=this.getPoint(0),s=0;e.push(0);for(let o=1;o<=t;o++)n=this.getPoint(o/t),s+=n.distanceTo(r),e.push(s),r=n;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const n=this.getLengths();let r=0;const s=n.length;let o;o=e||t*n[s-1];let a,l=0,h=s-1;for(;l<=h;)if(r=Math.floor(l+(h-l)/2),a=n[r]-o,a<0)l=r+1;else{if(!(a>0)){h=r;break}h=r-1}if(r=h,n[r]===o)return r/(s-1);const c=n[r];return(r+(o-c)/(n[r+1]-c))/(s-1)}getTangent(t,e){let n=t-1e-4,r=t+1e-4;n<0&&(n=0),r>1&&(r=1);const s=this.getPoint(n),o=this.getPoint(r),a=e||(s.isVector2?new F:new w);return a.copy(o).sub(s).normalize(),a}getTangentAt(t,e){const n=this.getUtoTmapping(t);return this.getTangent(n,e)}computeFrenetFrames(t,e){const n=new w,r=[],s=[],o=[],a=new w,l=new W;for(let f=0;f<=t;f++){const g=f/t;r[f]=this.getTangentAt(g,new w),r[f].normalize()}s[0]=new w,o[0]=new w;let h=Number.MAX_VALUE;const c=Math.abs(r[0].x),u=Math.abs(r[0].y),p=Math.abs(r[0].z);c<=h&&(h=c,n.set(1,0,0)),u<=h&&(h=u,n.set(0,1,0)),p<=h&&n.set(0,0,1),a.crossVectors(r[0],n).normalize(),s[0].crossVectors(r[0],a),o[0].crossVectors(r[0],s[0]);for(let f=1;f<=t;f++){if(s[f]=s[f-1].clone(),o[f]=o[f-1].clone(),a.crossVectors(r[f-1],r[f]),a.length()>Number.EPSILON){a.normalize();const g=Math.acos(ut(r[f-1].dot(r[f]),-1,1));s[f].applyMatrix4(l.makeRotationAxis(a,g))}o[f].crossVectors(r[f],s[f])}if(e===!0){let f=Math.acos(ut(s[0].dot(s[t]),-1,1));f/=t,r[0].dot(a.crossVectors(s[0],s[t]))>0&&(f=-f);for(let g=1;g<=t;g++)s[g].applyMatrix4(l.makeRotationAxis(r[g],f*g)),o[g].crossVectors(r[g],s[g])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class ba extends si{constructor(t=0,e=0,n=1,r=1,s=0,o=2*Math.PI,a=!1,l=0){super(),this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=n,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(t,e){const n=e||new F,r=2*Math.PI;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=r;for(;s>r;)s-=r;s<Number.EPSILON&&(s=o?0:r),this.aClockwise!==!0||o||(s===r?s=-r:s-=r);const a=this.aStartAngle+t*s;let l=this.aX+this.xRadius*Math.cos(a),h=this.aY+this.yRadius*Math.sin(a);if(this.aRotation!==0){const c=Math.cos(this.aRotation),u=Math.sin(this.aRotation),p=l-this.aX,f=h-this.aY;l=p*c-f*u+this.aX,h=p*u+f*c+this.aY}return n.set(l,h)}copy(t){return super.copy(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}toJSON(){const t=super.toJSON();return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}fromJSON(t){return super.fromJSON(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}}ba.prototype.isEllipseCurve=!0;class mp extends ba{constructor(t,e,n,r,s,o){super(t,e,n,n,r,s,o),this.type="ArcCurve"}}function gh(){let i=0,t=0,e=0,n=0;function r(s,o,a,l){i=s,t=a,e=-3*s+3*o-2*a-l,n=2*s-2*o+a+l}return{initCatmullRom:function(s,o,a,l,h){r(o,a,h*(a-s),h*(l-o))},initNonuniformCatmullRom:function(s,o,a,l,h,c,u){let p=(o-s)/h-(a-s)/(h+c)+(a-o)/c,f=(a-o)/c-(l-o)/(c+u)+(l-a)/u;p*=c,f*=c,r(o,a,p,f)},calc:function(s){const o=s*s;return i+t*s+e*o+n*(o*s)}}}mp.prototype.isArcCurve=!0;const Ea=new w,vh=new gh,_h=new gh,yh=new gh;class gp extends si{constructor(t=[],e=!1,n="centripetal",r=.5){super(),this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=n,this.tension=r}getPoint(t,e=new w){const n=e,r=this.points,s=r.length,o=(s-(this.closed?0:1))*t;let a,l,h=Math.floor(o),c=o-h;this.closed?h+=h>0?0:(Math.floor(Math.abs(h)/s)+1)*s:c===0&&h===s-1&&(h=s-2,c=1),this.closed||h>0?a=r[(h-1)%s]:(Ea.subVectors(r[0],r[1]).add(r[0]),a=Ea);const u=r[h%s],p=r[(h+1)%s];if(this.closed||h+2<s?l=r[(h+2)%s]:(Ea.subVectors(r[s-1],r[s-2]).add(r[s-1]),l=Ea),this.curveType==="centripetal"||this.curveType==="chordal"){const f=this.curveType==="chordal"?.5:.25;let g=Math.pow(a.distanceToSquared(u),f),_=Math.pow(u.distanceToSquared(p),f),v=Math.pow(p.distanceToSquared(l),f);_<1e-4&&(_=1),g<1e-4&&(g=_),v<1e-4&&(v=_),vh.initNonuniformCatmullRom(a.x,u.x,p.x,l.x,g,_,v),_h.initNonuniformCatmullRom(a.y,u.y,p.y,l.y,g,_,v),yh.initNonuniformCatmullRom(a.z,u.z,p.z,l.z,g,_,v)}else this.curveType==="catmullrom"&&(vh.initCatmullRom(a.x,u.x,p.x,l.x,this.tension),_h.initCatmullRom(a.y,u.y,p.y,l.y,this.tension),yh.initCatmullRom(a.z,u.z,p.z,l.z,this.tension));return n.set(vh.calc(c),_h.calc(c),yh.calc(c)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const r=t.points[e];this.points.push(r.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const r=this.points[e];t.points.push(r.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const r=t.points[e];this.points.push(new w().fromArray(r))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}}function vp(i,t,e,n,r){const s=.5*(n-t),o=.5*(r-e),a=i*i;return(2*e-2*n+s+o)*(i*a)+(-3*e+3*n-2*s-o)*a+s*i+e}function $s(i,t,e,n){return function(r,s){const o=1-r;return o*o*s}(i,t)+function(r,s){return 2*(1-r)*r*s}(i,e)+function(r,s){return r*r*s}(i,n)}function Zs(i,t,e,n,r){return function(s,o){const a=1-s;return a*a*a*o}(i,t)+function(s,o){const a=1-s;return 3*a*a*s*o}(i,e)+function(s,o){return 3*(1-s)*s*s*o}(i,n)+function(s,o){return s*s*s*o}(i,r)}gp.prototype.isCatmullRomCurve3=!0;class xh extends si{constructor(t=new F,e=new F,n=new F,r=new F){super(),this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=n,this.v3=r}getPoint(t,e=new F){const n=e,r=this.v0,s=this.v1,o=this.v2,a=this.v3;return n.set(Zs(t,r.x,s.x,o.x,a.x),Zs(t,r.y,s.y,o.y,a.y)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}xh.prototype.isCubicBezierCurve=!0;class _p extends si{constructor(t=new w,e=new w,n=new w,r=new w){super(),this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=n,this.v3=r}getPoint(t,e=new w){const n=e,r=this.v0,s=this.v1,o=this.v2,a=this.v3;return n.set(Zs(t,r.x,s.x,o.x,a.x),Zs(t,r.y,s.y,o.y,a.y),Zs(t,r.z,s.z,o.z,a.z)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}_p.prototype.isCubicBezierCurve3=!0;class wa extends si{constructor(t=new F,e=new F){super(),this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new F){const n=e;return t===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e){const n=e||new F;return n.copy(this.v2).sub(this.v1).normalize(),n}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}wa.prototype.isLineCurve=!0;class bh extends si{constructor(t=new F,e=new F,n=new F){super(),this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=n}getPoint(t,e=new F){const n=e,r=this.v0,s=this.v1,o=this.v2;return n.set($s(t,r.x,s.x,o.x),$s(t,r.y,s.y,o.y)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}bh.prototype.isQuadraticBezierCurve=!0;class yp extends si{constructor(t=new w,e=new w,n=new w){super(),this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=n}getPoint(t,e=new w){const n=e,r=this.v0,s=this.v1,o=this.v2;return n.set($s(t,r.x,s.x,o.x),$s(t,r.y,s.y,o.y),$s(t,r.z,s.z,o.z)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}yp.prototype.isQuadraticBezierCurve3=!0;class Eh extends si{constructor(t=[]){super(),this.type="SplineCurve",this.points=t}getPoint(t,e=new F){const n=e,r=this.points,s=(r.length-1)*t,o=Math.floor(s),a=s-o,l=r[o===0?o:o-1],h=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(vp(a,l.x,h.x,c.x,u.x),vp(a,l.y,h.y,c.y,u.y)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const r=t.points[e];this.points.push(r.clone())}return this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const r=this.points[e];t.points.push(r.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const r=t.points[e];this.points.push(new F().fromArray(r))}return this}}Eh.prototype.isSplineCurve=!0;var xp=Object.freeze({__proto__:null,ArcCurve:mp,CatmullRomCurve3:gp,CubicBezierCurve:xh,CubicBezierCurve3:_p,EllipseCurve:ba,LineCurve:wa,LineCurve3:class extends si{constructor(i=new w,t=new w){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=i,this.v2=t}getPoint(i,t=new w){const e=t;return i===1?e.copy(this.v2):(e.copy(this.v2).sub(this.v1),e.multiplyScalar(i).add(this.v1)),e}getPointAt(i,t){return this.getPoint(i,t)}copy(i){return super.copy(i),this.v1.copy(i.v1),this.v2.copy(i.v2),this}toJSON(){const i=super.toJSON();return i.v1=this.v1.toArray(),i.v2=this.v2.toArray(),i}fromJSON(i){return super.fromJSON(i),this.v1.fromArray(i.v1),this.v2.fromArray(i.v2),this}},QuadraticBezierCurve:bh,QuadraticBezierCurve3:yp,SplineCurve:Eh});const kx=function(i,t,e=2){const n=t&&t.length,r=n?t[0]*e:i.length;let s=bp(i,0,r,e,!0);const o=[];if(!s||s.next===s.prev)return o;let a,l,h,c,u,p,f;if(n&&(s=function(g,_,v,M){const A=[];let O,H,j,X,U;for(O=0,H=_.length;O<H;O++)j=_[O]*M,X=O<H-1?_[O+1]*M:g.length,U=bp(g,j,X,M,!1),U===U.next&&(U.steiner=!0),A.push(Wx(U));for(A.sort(zx),O=0;O<A.length;O++)jx(A[O],v),v=ar(v,v.next);return v}(i,t,s,e)),i.length>80*e){a=h=i[0],l=c=i[1];for(let g=e;g<r;g+=e)u=i[g],p=i[g+1],u<a&&(a=u),p<l&&(l=p),u>h&&(h=u),p>c&&(c=p);f=Math.max(h-a,c-l),f=f!==0?1/f:0}return Js(s,o,e,a,l,f),o};function bp(i,t,e,n,r){let s,o;if(r===function(a,l,h,c){let u=0;for(let p=l,f=h-c;p<h;p+=c)u+=(a[f]-a[p])*(a[p+1]+a[f+1]),f=p;return u}(i,t,e,n)>0)for(s=t;s<e;s+=n)o=Tp(s,i[s],i[s+1],o);else for(s=e-n;s>=t;s-=n)o=Tp(s,i[s],i[s+1],o);return o&&Ta(o,o.next)&&(Qs(o),o=o.next),o}function ar(i,t){if(!i)return i;t||(t=i);let e,n=i;do if(e=!1,n.steiner||!Ta(n,n.next)&&sn(n.prev,n,n.next)!==0)n=n.next;else{if(Qs(n),n=t=n.prev,n===n.next)break;e=!0}while(e||n!==t);return t}function Js(i,t,e,n,r,s,o){if(!i)return;!o&&s&&function(c,u,p,f){let g=c;do g.z===null&&(g.z=wh(g.x,g.y,u,p,f)),g.prevZ=g.prev,g.nextZ=g.next,g=g.next;while(g!==c);g.prevZ.nextZ=null,g.prevZ=null,function(_){let v,M,A,O,H,j,X,U,V=1;do{for(M=_,_=null,H=null,j=0;M;){for(j++,A=M,X=0,v=0;v<V&&(X++,A=A.nextZ,A);v++);for(U=V;X>0||U>0&&A;)X!==0&&(U===0||!A||M.z<=A.z)?(O=M,M=M.nextZ,X--):(O=A,A=A.nextZ,U--),H?H.nextZ=O:_=O,O.prevZ=H,H=O;M=A}H.nextZ=null,V*=2}while(j>1)}(g)}(i,n,r,s);let a,l,h=i;for(;i.prev!==i.next;)if(a=i.prev,l=i.next,s?Bx(i,n,r,s):Ux(i))t.push(a.i/e),t.push(i.i/e),t.push(l.i/e),Qs(i),i=l.next,h=l.next;else if((i=l)===h){o?o===1?Js(i=Gx(ar(i),t,e),t,e,n,r,s,2):o===2&&Hx(i,t,e,n,r,s):Js(ar(i),t,e,n,r,s,1);break}}function Ux(i){const t=i.prev,e=i,n=i.next;if(sn(t,e,n)>=0)return!1;let r=i.next.next;for(;r!==i.prev;){if(ns(t.x,t.y,e.x,e.y,n.x,n.y,r.x,r.y)&&sn(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function Bx(i,t,e,n){const r=i.prev,s=i,o=i.next;if(sn(r,s,o)>=0)return!1;const a=r.x<s.x?r.x<o.x?r.x:o.x:s.x<o.x?s.x:o.x,l=r.y<s.y?r.y<o.y?r.y:o.y:s.y<o.y?s.y:o.y,h=r.x>s.x?r.x>o.x?r.x:o.x:s.x>o.x?s.x:o.x,c=r.y>s.y?r.y>o.y?r.y:o.y:s.y>o.y?s.y:o.y,u=wh(a,l,t,e,n),p=wh(h,c,t,e,n);let f=i.prevZ,g=i.nextZ;for(;f&&f.z>=u&&g&&g.z<=p;){if(f!==i.prev&&f!==i.next&&ns(r.x,r.y,s.x,s.y,o.x,o.y,f.x,f.y)&&sn(f.prev,f,f.next)>=0||(f=f.prevZ,g!==i.prev&&g!==i.next&&ns(r.x,r.y,s.x,s.y,o.x,o.y,g.x,g.y)&&sn(g.prev,g,g.next)>=0))return!1;g=g.nextZ}for(;f&&f.z>=u;){if(f!==i.prev&&f!==i.next&&ns(r.x,r.y,s.x,s.y,o.x,o.y,f.x,f.y)&&sn(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;g&&g.z<=p;){if(g!==i.prev&&g!==i.next&&ns(r.x,r.y,s.x,s.y,o.x,o.y,g.x,g.y)&&sn(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function Gx(i,t,e){let n=i;do{const r=n.prev,s=n.next.next;!Ta(r,s)&&Ep(r,n,n.next,s)&&Ks(r,s)&&Ks(s,r)&&(t.push(r.i/e),t.push(n.i/e),t.push(s.i/e),Qs(n),Qs(n.next),n=i=s),n=n.next}while(n!==i);return ar(n)}function Hx(i,t,e,n,r,s){let o=i;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&Xx(o,a)){let l=wp(o,a);return o=ar(o,o.next),l=ar(l,l.next),Js(o,t,e,n,r,s),void Js(l,t,e,n,r,s)}a=a.next}o=o.next}while(o!==i)}function zx(i,t){return i.x-t.x}function jx(i,t){if(t=function(e,n){let r=n;const s=e.x,o=e.y;let a,l=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){const g=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(g<=s&&g>l){if(l=g,g===s){if(o===r.y)return r;if(o===r.next.y)return r.next}a=r.x<r.next.x?r:r.next}}r=r.next}while(r!==n);if(!a)return null;if(s===l)return a;const h=a,c=a.x,u=a.y;let p,f=1/0;r=a;do s>=r.x&&r.x>=c&&s!==r.x&&ns(o<u?s:l,o,c,u,o<u?l:s,o,r.x,r.y)&&(p=Math.abs(o-r.y)/(s-r.x),Ks(r,e)&&(p<f||p===f&&(r.x>a.x||r.x===a.x&&Vx(a,r)))&&(a=r,f=p)),r=r.next;while(r!==h);return a}(i,t)){const e=wp(t,i);ar(t,t.next),ar(e,e.next)}}function Vx(i,t){return sn(i.prev,i,t.prev)<0&&sn(t.next,i,i.next)<0}function wh(i,t,e,n,r){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=32767*(i-e)*r)|i<<8))|i<<4))|i<<2))|i<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Wx(i){let t=i,e=i;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==i);return e}function ns(i,t,e,n,r,s,o,a){return(r-o)*(t-a)-(i-o)*(s-a)>=0&&(i-o)*(n-a)-(e-o)*(t-a)>=0&&(e-o)*(s-a)-(r-o)*(n-a)>=0}function Xx(i,t){return i.next.i!==t.i&&i.prev.i!==t.i&&!function(e,n){let r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==n.i&&r.next.i!==n.i&&Ep(r,r.next,e,n))return!0;r=r.next}while(r!==e);return!1}(i,t)&&(Ks(i,t)&&Ks(t,i)&&function(e,n){let r=e,s=!1;const o=(e.x+n.x)/2,a=(e.y+n.y)/2;do r.y>a!=r.next.y>a&&r.next.y!==r.y&&o<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(s=!s),r=r.next;while(r!==e);return s}(i,t)&&(sn(i.prev,i,t.prev)||sn(i,t.prev,t))||Ta(i,t)&&sn(i.prev,i,i.next)>0&&sn(t.prev,t,t.next)>0)}function sn(i,t,e){return(t.y-i.y)*(e.x-t.x)-(t.x-i.x)*(e.y-t.y)}function Ta(i,t){return i.x===t.x&&i.y===t.y}function Ep(i,t,e,n){const r=Ma(sn(i,t,e)),s=Ma(sn(i,t,n)),o=Ma(sn(e,n,i)),a=Ma(sn(e,n,t));return r!==s&&o!==a||!(r!==0||!Sa(i,e,t))||!(s!==0||!Sa(i,n,t))||!(o!==0||!Sa(e,i,n))||!(a!==0||!Sa(e,t,n))}function Sa(i,t,e){return t.x<=Math.max(i.x,e.x)&&t.x>=Math.min(i.x,e.x)&&t.y<=Math.max(i.y,e.y)&&t.y>=Math.min(i.y,e.y)}function Ma(i){return i>0?1:i<0?-1:0}function Ks(i,t){return sn(i.prev,i,i.next)<0?sn(i,t,i.next)>=0&&sn(i,i.prev,t)>=0:sn(i,t,i.prev)<0||sn(i,i.next,t)<0}function wp(i,t){const e=new Th(i.i,i.x,i.y),n=new Th(t.i,t.x,t.y),r=i.next,s=t.prev;return i.next=t,t.prev=i,e.next=r,r.prev=e,n.next=e,e.prev=n,s.next=n,n.prev=s,n}function Tp(i,t,e,n){const r=new Th(i,t,e);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function Qs(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function Th(i,t,e){this.i=i,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}class lr{static area(t){const e=t.length;let n=0;for(let r=e-1,s=0;s<e;r=s++)n+=t[r].x*t[s].y-t[s].x*t[r].y;return .5*n}static isClockWise(t){return lr.area(t)<0}static triangulateShape(t,e){const n=[],r=[],s=[];Sp(t),Mp(n,t);let o=t.length;e.forEach(Sp);for(let l=0;l<e.length;l++)r.push(o),o+=e[l].length,Mp(n,e[l]);const a=kx(n,r);for(let l=0;l<a.length;l+=3)s.push(a.slice(l,l+3));return s}}function Sp(i){const t=i.length;t>2&&i[t-1].equals(i[0])&&i.pop()}function Mp(i,t){for(let e=0;e<t.length;e++)i.push(t[e].x),i.push(t[e].y)}class is extends He{constructor(t,e){super(),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];const n=this,r=[],s=[];for(let a=0,l=t.length;a<l;a++)o(t[a]);function o(a){const l=[],h=e.curveSegments!==void 0?e.curveSegments:12,c=e.steps!==void 0?e.steps:1;let u=e.depth!==void 0?e.depth:100,p=e.bevelEnabled===void 0||e.bevelEnabled,f=e.bevelThickness!==void 0?e.bevelThickness:6,g=e.bevelSize!==void 0?e.bevelSize:f-2,_=e.bevelOffset!==void 0?e.bevelOffset:0,v=e.bevelSegments!==void 0?e.bevelSegments:3;const M=e.extrudePath,A=e.UVGenerator!==void 0?e.UVGenerator:Yx;e.amount!==void 0&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),u=e.amount);let O,H,j,X,U,V=!1;M&&(O=M.getSpacedPoints(c),V=!0,p=!1,H=M.computeFrenetFrames(c,!1),j=new w,X=new w,U=new w),p||(v=0,f=0,g=0,_=0);const xt=a.extractPoints(h);let it=xt.shape;const Q=xt.holes;if(!lr.isClockWise(it)){it=it.reverse();for(let Nt=0,Y=Q.length;Nt<Y;Nt++){const pt=Q[Nt];lr.isClockWise(pt)&&(Q[Nt]=pt.reverse())}}const st=lr.triangulateShape(it,Q),nt=it;for(let Nt=0,Y=Q.length;Nt<Y;Nt++){const pt=Q[Nt];it=it.concat(pt)}function ct(Nt,Y,pt){return Y||console.error("THREE.ExtrudeGeometry: vec does not exist"),Y.clone().multiplyScalar(pt).add(Nt)}const Lt=it.length,At=st.length;function ht(Nt,Y,pt){let Et,Tt,St;const Qt=Nt.x-Y.x,ce=Nt.y-Y.y,ae=pt.x-Nt.x,se=pt.y-Nt.y,we=Qt*Qt+ce*ce,vn=Qt*se-ce*ae;if(Math.abs(vn)>Number.EPSILON){const Ve=Math.sqrt(we),Ei=Math.sqrt(ae*ae+se*se),Ho=Y.x-ce/Ve,zo=Y.y+Qt/Ve,jo=((pt.x-se/Ei-Ho)*se-(pt.y+ae/Ei-zo)*ae)/(Qt*se-ce*ae);Et=Ho+Qt*jo-Nt.x,Tt=zo+ce*jo-Nt.y;const zn=Et*Et+Tt*Tt;if(zn<=2)return new F(Et,Tt);St=Math.sqrt(zn/2)}else{let Ve=!1;Qt>Number.EPSILON?ae>Number.EPSILON&&(Ve=!0):Qt<-Number.EPSILON?ae<-Number.EPSILON&&(Ve=!0):Math.sign(ce)===Math.sign(se)&&(Ve=!0),Ve?(Et=-ce,Tt=Qt,St=Math.sqrt(we)):(Et=Qt,Tt=ce,St=Math.sqrt(we/2))}return new F(Et/St,Tt/St)}const gt=[];for(let Nt=0,Y=nt.length,pt=Y-1,Et=Nt+1;Nt<Y;Nt++,pt++,Et++)pt===Y&&(pt=0),Et===Y&&(Et=0),gt[Nt]=ht(nt[Nt],nt[pt],nt[Et]);const Ut=[];let Vt,Zt=gt.concat();for(let Nt=0,Y=Q.length;Nt<Y;Nt++){const pt=Q[Nt];Vt=[];for(let Et=0,Tt=pt.length,St=Tt-1,Qt=Et+1;Et<Tt;Et++,St++,Qt++)St===Tt&&(St=0),Qt===Tt&&(Qt=0),Vt[Et]=ht(pt[Et],pt[St],pt[Qt]);Ut.push(Vt),Zt=Zt.concat(Vt)}for(let Nt=0;Nt<v;Nt++){const Y=Nt/v,pt=f*Math.cos(Y*Math.PI/2),Et=g*Math.sin(Y*Math.PI/2)+_;for(let Tt=0,St=nt.length;Tt<St;Tt++){const Qt=ct(nt[Tt],gt[Tt],Et);Ft(Qt.x,Qt.y,-pt)}for(let Tt=0,St=Q.length;Tt<St;Tt++){const Qt=Q[Tt];Vt=Ut[Tt];for(let ce=0,ae=Qt.length;ce<ae;ce++){const se=ct(Qt[ce],Vt[ce],Et);Ft(se.x,se.y,-pt)}}}const J=g+_;for(let Nt=0;Nt<Lt;Nt++){const Y=p?ct(it[Nt],Zt[Nt],J):it[Nt];V?(X.copy(H.normals[0]).multiplyScalar(Y.x),j.copy(H.binormals[0]).multiplyScalar(Y.y),U.copy(O[0]).add(X).add(j),Ft(U.x,U.y,U.z)):Ft(Y.x,Y.y,0)}for(let Nt=1;Nt<=c;Nt++)for(let Y=0;Y<Lt;Y++){const pt=p?ct(it[Y],Zt[Y],J):it[Y];V?(X.copy(H.normals[Nt]).multiplyScalar(pt.x),j.copy(H.binormals[Nt]).multiplyScalar(pt.y),U.copy(O[Nt]).add(X).add(j),Ft(U.x,U.y,U.z)):Ft(pt.x,pt.y,u/c*Nt)}for(let Nt=v-1;Nt>=0;Nt--){const Y=Nt/v,pt=f*Math.cos(Y*Math.PI/2),Et=g*Math.sin(Y*Math.PI/2)+_;for(let Tt=0,St=nt.length;Tt<St;Tt++){const Qt=ct(nt[Tt],gt[Tt],Et);Ft(Qt.x,Qt.y,u+pt)}for(let Tt=0,St=Q.length;Tt<St;Tt++){const Qt=Q[Tt];Vt=Ut[Tt];for(let ce=0,ae=Qt.length;ce<ae;ce++){const se=ct(Qt[ce],Vt[ce],Et);V?Ft(se.x,se.y+O[c-1].y,O[c-1].x+pt):Ft(se.x,se.y,u+pt)}}}function et(Nt,Y){let pt=Nt.length;for(;--pt>=0;){const Et=pt;let Tt=pt-1;Tt<0&&(Tt=Nt.length-1);for(let St=0,Qt=c+2*v;St<Qt;St++){const ce=Lt*St,ae=Lt*(St+1);It(Y+Et+ce,Y+Tt+ce,Y+Tt+ae,Y+Et+ae)}}}function Ft(Nt,Y,pt){l.push(Nt),l.push(Y),l.push(pt)}function Pt(Nt,Y,pt){Yt(Nt),Yt(Y),Yt(pt);const Et=r.length/3,Tt=A.generateTopUV(n,r,Et-3,Et-2,Et-1);qt(Tt[0]),qt(Tt[1]),qt(Tt[2])}function It(Nt,Y,pt,Et){Yt(Nt),Yt(Y),Yt(Et),Yt(Y),Yt(pt),Yt(Et);const Tt=r.length/3,St=A.generateSideWallUV(n,r,Tt-6,Tt-3,Tt-2,Tt-1);qt(St[0]),qt(St[1]),qt(St[3]),qt(St[1]),qt(St[2]),qt(St[3])}function Yt(Nt){r.push(l[3*Nt+0]),r.push(l[3*Nt+1]),r.push(l[3*Nt+2])}function qt(Nt){s.push(Nt.x),s.push(Nt.y)}(function(){const Nt=r.length/3;if(p){let Y=0,pt=Lt*Y;for(let Et=0;Et<At;Et++){const Tt=st[Et];Pt(Tt[2]+pt,Tt[1]+pt,Tt[0]+pt)}Y=c+2*v,pt=Lt*Y;for(let Et=0;Et<At;Et++){const Tt=st[Et];Pt(Tt[0]+pt,Tt[1]+pt,Tt[2]+pt)}}else{for(let Y=0;Y<At;Y++){const pt=st[Y];Pt(pt[2],pt[1],pt[0])}for(let Y=0;Y<At;Y++){const pt=st[Y];Pt(pt[0]+Lt*c,pt[1]+Lt*c,pt[2]+Lt*c)}}n.addGroup(Nt,r.length/3-Nt,0)})(),function(){const Nt=r.length/3;let Y=0;et(nt,Y),Y+=nt.length;for(let pt=0,Et=Q.length;pt<Et;pt++){const Tt=Q[pt];et(Tt,Y),Y+=Tt.length}n.addGroup(Nt,r.length/3-Nt,1)}()}this.setAttribute("position",new Fe(r,3)),this.setAttribute("uv",new Fe(s,2)),this.computeVertexNormals()}toJSON(){const t=super.toJSON();return function(e,n,r){if(r.shapes=[],Array.isArray(e))for(let s=0,o=e.length;s<o;s++){const a=e[s];r.shapes.push(a.uuid)}else r.shapes.push(e.uuid);return n.extrudePath!==void 0&&(r.options.extrudePath=n.extrudePath.toJSON()),r}(this.parameters.shapes,this.parameters.options,t)}static fromJSON(t,e){const n=[];for(let s=0,o=t.shapes.length;s<o;s++){const a=e[t.shapes[s]];n.push(a)}const r=t.options.extrudePath;return r!==void 0&&(t.options.extrudePath=new xp[r.type]().fromJSON(r)),new is(n,t.options)}}const Yx={generateTopUV:function(i,t,e,n,r){const s=t[3*e],o=t[3*e+1],a=t[3*n],l=t[3*n+1],h=t[3*r],c=t[3*r+1];return[new F(s,o),new F(a,l),new F(h,c)]},generateSideWallUV:function(i,t,e,n,r,s){const o=t[3*e],a=t[3*e+1],l=t[3*e+2],h=t[3*n],c=t[3*n+1],u=t[3*n+2],p=t[3*r],f=t[3*r+1],g=t[3*r+2],_=t[3*s],v=t[3*s+1],M=t[3*s+2];return Math.abs(a-c)<Math.abs(o-h)?[new F(o,1-l),new F(h,1-u),new F(p,1-g),new F(_,1-M)]:[new F(a,1-l),new F(c,1-u),new F(f,1-g),new F(v,1-M)]}};class Sh extends He{constructor(t,e=12){super(),this.type="ShapeGeometry",this.parameters={shapes:t,curveSegments:e};const n=[],r=[],s=[],o=[];let a=0,l=0;if(Array.isArray(t)===!1)h(t);else for(let c=0;c<t.length;c++)h(t[c]),this.addGroup(a,l,c),a+=l,l=0;function h(c){const u=r.length/3,p=c.extractPoints(e);let f=p.shape;const g=p.holes;lr.isClockWise(f)===!1&&(f=f.reverse());for(let v=0,M=g.length;v<M;v++){const A=g[v];lr.isClockWise(A)===!0&&(g[v]=A.reverse())}const _=lr.triangulateShape(f,g);for(let v=0,M=g.length;v<M;v++){const A=g[v];f=f.concat(A)}for(let v=0,M=f.length;v<M;v++){const A=f[v];r.push(A.x,A.y,0),s.push(0,0,1),o.push(A.x,A.y)}for(let v=0,M=_.length;v<M;v++){const A=_[v],O=A[0]+u,H=A[1]+u,j=A[2]+u;n.push(O,H,j),l+=3}}this.setIndex(n),this.setAttribute("position",new Fe(r,3)),this.setAttribute("normal",new Fe(s,3)),this.setAttribute("uv",new Fe(o,2))}toJSON(){const t=super.toJSON();return function(e,n){if(n.shapes=[],Array.isArray(e))for(let r=0,s=e.length;r<s;r++){const o=e[r];n.shapes.push(o.uuid)}else n.shapes.push(e.uuid);return n}(this.parameters.shapes,t)}static fromJSON(t,e){const n=[];for(let r=0,s=t.shapes.length;r<s;r++){const o=e[t.shapes[r]];n.push(o)}return new Sh(n,t.curveSegments)}}class qx extends Rn{constructor(t){super(),this.type="ShadowMaterial",this.color=new _e(0),this.transparent=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this}}qx.prototype.isShadowMaterial=!0;class $x extends pi{constructor(t){super(t),this.type="RawShaderMaterial"}}$x.prototype.isRawShaderMaterial=!0;class Ap extends Rn{constructor(t){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new _e(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 _e(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new F(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.vertexTangents=!1,this.setValues(t)}copy(t){return super.copy(t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.flatShading=t.flatShading,this.vertexTangents=t.vertexTangents,this}}Ap.prototype.isMeshStandardMaterial=!0;class Zx extends Ap{constructor(t){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new F(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,Object.defineProperty(this,"ior",{get:function(){return(1+.4*this.reflectivity)/(1-.4*this.reflectivity)},set:function(e){this.reflectivity=ut(2.5*(e-1)/(e+1),0,1)}}),this.sheen=null,this.transmission=0,this.transmissionMap=null,this.thickness=.01,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationColor=new _e(1,1,1),this.setValues(t)}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.reflectivity=t.reflectivity,t.sheen?this.sheen=(this.sheen||new _e).copy(t.sheen):this.sheen=null,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this}}Zx.prototype.isMeshPhysicalMaterial=!0;class Pp extends Rn{constructor(t){super(),this.type="MeshPhongMaterial",this.color=new _e(16777215),this.specular=new _e(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _e(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new F(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.flatShading=t.flatShading,this}}Pp.prototype.isMeshPhongMaterial=!0;class Jx extends Rn{constructor(t){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new _e(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _e(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new F(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.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this}}Jx.prototype.isMeshToonMaterial=!0;class Kx extends Rn{constructor(t){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new F(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.flatShading=t.flatShading,this}}Kx.prototype.isMeshNormalMaterial=!0;class Qx extends Rn{constructor(t){super(),this.type="MeshLambertMaterial",this.color=new _e(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _e(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this}}Qx.prototype.isMeshLambertMaterial=!0;class tb extends Rn{constructor(t){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new _e(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new F(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.flatShading=t.flatShading,this}}tb.prototype.isMeshMatcapMaterial=!0;class eb extends qs{constructor(t){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}eb.prototype.isLineDashedMaterial=!0;const Qe={arraySlice:function(i,t,e){return Qe.isTypedArray(i)?new i.constructor(i.subarray(t,e!==void 0?e:i.length)):i.slice(t,e)},convertArray:function(i,t,e){return!i||!e&&i.constructor===t?i:typeof t.BYTES_PER_ELEMENT=="number"?new t(i):Array.prototype.slice.call(i)},isTypedArray:function(i){return ArrayBuffer.isView(i)&&!(i instanceof DataView)},getKeyframeOrder:function(i){const t=i.length,e=new Array(t);for(let n=0;n!==t;++n)e[n]=n;return e.sort(function(n,r){return i[n]-i[r]}),e},sortedArray:function(i,t,e){const n=i.length,r=new i.constructor(n);for(let s=0,o=0;o!==n;++s){const a=e[s]*t;for(let l=0;l!==t;++l)r[o++]=i[a+l]}return r},flattenJSON:function(i,t,e,n){let r=1,s=i[0];for(;s!==void 0&&s[n]===void 0;)s=i[r++];if(s===void 0)return;let o=s[n];if(o!==void 0)if(Array.isArray(o))do o=s[n],o!==void 0&&(t.push(s.time),e.push.apply(e,o)),s=i[r++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[n],o!==void 0&&(t.push(s.time),o.toArray(e,e.length)),s=i[r++];while(s!==void 0);else do o=s[n],o!==void 0&&(t.push(s.time),e.push(o)),s=i[r++];while(s!==void 0)},subclip:function(i,t,e,n,r=30){const s=i.clone();s.name=t;const o=[];for(let l=0;l<s.tracks.length;++l){const h=s.tracks[l],c=h.getValueSize(),u=[],p=[];for(let f=0;f<h.times.length;++f){const g=h.times[f]*r;if(!(g<e||g>=n)){u.push(h.times[f]);for(let _=0;_<c;++_)p.push(h.values[f*c+_])}}u.length!==0&&(h.times=Qe.convertArray(u,h.times.constructor),h.values=Qe.convertArray(p,h.values.constructor),o.push(h))}s.tracks=o;let a=1/0;for(let l=0;l<s.tracks.length;++l)a>s.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l<s.tracks.length;++l)s.tracks[l].shift(-1*a);return s.resetDuration(),s},makeClipAdditive:function(i,t=0,e=i,n=30){n<=0&&(n=30);const r=e.tracks.length,s=t/n;for(let o=0;o<r;++o){const a=e.tracks[o],l=a.ValueTypeName;if(l==="bool"||l==="string")continue;const h=i.tracks.find(function(M){return M.name===a.name&&M.ValueTypeName===l});if(h===void 0)continue;let c=0;const u=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(c=u/3);let p=0;const f=h.getValueSize();h.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(p=f/3);const g=a.times.length-1;let _;if(s<=a.times[0]){const M=c,A=u-c;_=Qe.arraySlice(a.values,M,A)}else if(s>=a.times[g]){const M=g*u+c,A=M+u-c;_=Qe.arraySlice(a.values,M,A)}else{const M=a.createInterpolant(),A=c,O=u-c;M.evaluate(s),_=Qe.arraySlice(M.resultBuffer,A,O)}l==="quaternion"&&new lt().fromArray(_).normalize().conjugate().toArray(_);const v=h.times.length;for(let M=0;M<v;++M){const A=M*f+p;if(l==="quaternion")lt.multiplyQuaternionsFlat(h.values,A,_,0,h.values,A);else{const O=f-2*p;for(let H=0;H<O;++H)h.values[A+H]-=_[H]}}}return i.blendMode=2501,i}};class hr{constructor(t,e,n,r){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new e.constructor(n),this.sampleValues=e,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(t){const e=this.parameterPositions;let n=this._cachedIndex,r=e[n],s=e[n-1];t:{e:{let o;n:{i:if(!(t<r)){for(let a=n+2;;){if(r===void 0){if(t<s)break i;return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,t,s)}if(n===a)break;if(s=r,r=e[++n],t<r)break e}o=e.length;break n}if(t>=s)break t;{const a=e[1];t<a&&(n=2,s=a);for(let l=n-2;;){if(s===void 0)return this._cachedIndex=0,this.beforeStart_(0,t,r);if(n===l)break;if(r=s,s=e[--n-1],t>=s)break e}o=n,n=0}}for(;n<o;){const a=n+o>>>1;t<e[a]?o=a:n=a+1}if(r=e[n],s=e[n-1],s===void 0)return this._cachedIndex=0,this.beforeStart_(0,t,r);if(r===void 0)return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,s,t)}this._cachedIndex=n,this.intervalChanged_(n,s,r)}return this.interpolate_(n,s,t,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){const e=this.resultBuffer,n=this.sampleValues,r=this.valueSize,s=t*r;for(let o=0;o!==r;++o)e[o]=n[s+o];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}hr.prototype.beforeStart_=hr.prototype.copySampleValue_,hr.prototype.afterEnd_=hr.prototype.copySampleValue_;class nb extends hr{constructor(t,e,n,r){super(t,e,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:2400,endingEnd:2400}}intervalChanged_(t,e,n){const r=this.parameterPositions;let s=t-2,o=t+1,a=r[s],l=r[o];if(a===void 0)switch(this.getSettings_().endingStart){case 2401:s=t,a=2*e-n;break;case 2402:s=r.length-2,a=e+r[s]-r[s+1];break;default:s=t,a=n}if(l===void 0)switch(this.getSettings_().endingEnd){case 2401:o=t,l=2*n-e;break;case 2402:o=1,l=n+r[1]-r[0];break;default:o=t-1,l=e}const h=.5*(n-e),c=this.valueSize;this._weightPrev=h/(e-a),this._weightNext=h/(l-n),this._offsetPrev=s*c,this._offsetNext=o*c}interpolate_(t,e,n,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=t*a,h=l-a,c=this._offsetPrev,u=this._offsetNext,p=this._weightPrev,f=this._weightNext,g=(n-e)/(r-e),_=g*g,v=_*g,M=-p*v+2*p*_-p*g,A=(1+p)*v+(-1.5-2*p)*_+(-.5+p)*g+1,O=(-1-f)*v+(1.5+f)*_+.5*g,H=f*v-f*_;for(let j=0;j!==a;++j)s[j]=M*o[c+j]+A*o[h+j]+O*o[l+j]+H*o[u+j];return s}}class Cp extends hr{constructor(t,e,n,r){super(t,e,n,r)}interpolate_(t,e,n,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=t*a,h=l-a,c=(n-e)/(r-e),u=1-c;for(let p=0;p!==a;++p)s[p]=o[h+p]*u+o[l+p]*c;return s}}class ib extends hr{constructor(t,e,n,r){super(t,e,n,r)}interpolate_(t){return this.copySampleValue_(t-1)}}class Ai{constructor(t,e,n,r){if(t===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(e===void 0||e.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=Qe.convertArray(e,this.TimeBufferType),this.values=Qe.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(t){const e=t.constructor;let n;if(e.toJSON!==this.toJSON)n=e.toJSON(t);else{n={name:t.name,times:Qe.convertArray(t.times,Array),values:Qe.convertArray(t.values,Array)};const r=t.getInterpolation();r!==t.DefaultInterpolation&&(n.interpolation=r)}return n.type=t.ValueTypeName,n}InterpolantFactoryMethodDiscrete(t){return new ib(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new Cp(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new nb(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case 2300:e=this.InterpolantFactoryMethodDiscrete;break;case 2301:e=this.InterpolantFactoryMethodLinear;break;case 2302:e=this.InterpolantFactoryMethodSmooth}if(e===void 0){const n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0){if(t===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}}getValueSize(){return this.values.length/this.times.length}shift(t){if(t!==0){const e=this.times;for(let n=0,r=e.length;n!==r;++n)e[n]+=t}return this}scale(t){if(t!==1){const e=this.times;for(let n=0,r=e.length;n!==r;++n)e[n]*=t}return this}trim(t,e){const n=this.times,r=n.length;let s=0,o=r-1;for(;s!==r&&n[s]<t;)++s;for(;o!==-1&&n[o]>e;)--o;if(++o,s!==0||o!==r){s>=o&&(o=Math.max(o,1),s=o-1);const a=this.getValueSize();this.times=Qe.arraySlice(n,s,o),this.values=Qe.arraySlice(this.values,s*a,o*a)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const n=this.times,r=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let o=null;for(let a=0;a!==s;a++){const l=n[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),t=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),t=!1;break}o=l}if(r!==void 0&&Qe.isTypedArray(r))for(let a=0,l=r.length;a!==l;++a){const h=r[a];if(isNaN(h)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,h),t=!1;break}}return t}optimize(){const t=Qe.arraySlice(this.times),e=Qe.arraySlice(this.values),n=this.getValueSize(),r=this.getInterpolation()===2302,s=t.length-1;let o=1;for(let a=1;a<s;++a){let l=!1;const h=t[a];if(h!==t[a+1]&&(a!==1||h!==t[0]))if(r)l=!0;else{const c=a*n,u=c-n,p=c+n;for(let f=0;f!==n;++f){const g=e[c+f];if(g!==e[u+f]||g!==e[p+f]){l=!0;break}}}if(l){if(a!==o){t[o]=t[a];const c=a*n,u=o*n;for(let p=0;p!==n;++p)e[u+p]=e[c+p]}++o}}if(s>0){t[o]=t[s];for(let a=s*n,l=o*n,h=0;h!==n;++h)e[l+h]=e[a+h];++o}return o!==t.length?(this.times=Qe.arraySlice(t,0,o),this.values=Qe.arraySlice(e,0,o*n)):(this.times=t,this.values=e),this}clone(){const t=Qe.arraySlice(this.times,0),e=Qe.arraySlice(this.values,0),n=new this.constructor(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}}Ai.prototype.TimeBufferType=Float32Array,Ai.prototype.ValueBufferType=Float32Array,Ai.prototype.DefaultInterpolation=2301;class rs extends Ai{}rs.prototype.ValueTypeName="bool",rs.prototype.ValueBufferType=Array,rs.prototype.DefaultInterpolation=2300,rs.prototype.InterpolantFactoryMethodLinear=void 0,rs.prototype.InterpolantFactoryMethodSmooth=void 0;class Ip extends Ai{}Ip.prototype.ValueTypeName="color";class Aa extends Ai{}Aa.prototype.ValueTypeName="number";class rb extends hr{constructor(t,e,n,r){super(t,e,n,r)}interpolate_(t,e,n,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(n-e)/(r-e);let h=t*a;for(let c=h+a;h!==c;h+=4)lt.slerpFlat(s,0,o,h-a,o,h,l);return s}}class to extends Ai{InterpolantFactoryMethodLinear(t){return new rb(this.times,this.values,this.getValueSize(),t)}}to.prototype.ValueTypeName="quaternion",to.prototype.DefaultInterpolation=2301,to.prototype.InterpolantFactoryMethodSmooth=void 0;class ss extends Ai{}ss.prototype.ValueTypeName="string",ss.prototype.ValueBufferType=Array,ss.prototype.DefaultInterpolation=2300,ss.prototype.InterpolantFactoryMethodLinear=void 0,ss.prototype.InterpolantFactoryMethodSmooth=void 0;class Pa extends Ai{}Pa.prototype.ValueTypeName="vector";class Rp{constructor(t,e=-1,n,r=2500){this.name=t,this.tracks=n,this.duration=e,this.blendMode=r,this.uuid=K(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],n=t.tracks,r=1/(t.fps||1);for(let o=0,a=n.length;o!==a;++o)e.push(sb(n[o]).scale(r));const s=new this(t.name,t.duration,e,t.blendMode);return s.uuid=t.uuid,s}static toJSON(t){const e=[],n=t.tracks,r={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let s=0,o=n.length;s!==o;++s)e.push(Ai.toJSON(n[s]));return r}static CreateFromMorphTargetSequence(t,e,n,r){const s=e.length,o=[];for(let a=0;a<s;a++){let l=[],h=[];l.push((a+s-1)%s,a,(a+1)%s),h.push(0,1,0);const c=Qe.getKeyframeOrder(l);l=Qe.sortedArray(l,1,c),h=Qe.sortedArray(h,1,c),r||l[0]!==0||(l.push(s),h.push(h[0])),o.push(new Aa(".morphTargetInfluences["+e[a].name+"]",l,h).scale(1/n))}return new this(t,-1,o)}static findByName(t,e){let n=t;if(!Array.isArray(t)){const r=t;n=r.geometry&&r.geometry.animations||r.animations}for(let r=0;r<n.length;r++)if(n[r].name===e)return n[r];return null}static CreateClipsFromMorphTargetSequences(t,e,n){const r={},s=/^([\w-]*?)([\d]+)$/;for(let a=0,l=t.length;a<l;a++){const h=t[a],c=h.name.match(s);if(c&&c.length>1){const u=c[1];let p=r[u];p||(r[u]=p=[]),p.push(h)}}const o=[];for(const a in r)o.push(this.CreateFromMorphTargetSequence(a,r[a],e,n));return o}static parseAnimation(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(c,u,p,f,g){if(p.length!==0){const _=[],v=[];Qe.flattenJSON(p,_,v,f),_.length!==0&&g.push(new c(u,_,v))}},r=[],s=t.name||"default",o=t.fps||30,a=t.blendMode;let l=t.length||-1;const h=t.hierarchy||[];for(let c=0;c<h.length;c++){const u=h[c].keys;if(u&&u.length!==0)if(u[0].morphTargets){const p={};let f;for(f=0;f<u.length;f++)if(u[f].morphTargets)for(let g=0;g<u[f].morphTargets.length;g++)p[u[f].morphTargets[g]]=-1;for(const g in p){const _=[],v=[];for(let M=0;M!==u[f].morphTargets.length;++M){const A=u[f];_.push(A.time),v.push(A.morphTarget===g?1:0)}r.push(new Aa(".morphTargetInfluence["+g+"]",_,v))}l=p.length*(o||1)}else{const p=".bones["+e[c].name+"]";n(Pa,p+".position",u,"pos",r),n(to,p+".quaternion",u,"rot",r),n(Pa,p+".scale",u,"scl",r)}}return r.length===0?null:new this(s,l,r,a)}resetDuration(){let t=0;for(let e=0,n=this.tracks.length;e!==n;++e){const r=this.tracks[e];t=Math.max(t,r.times[r.times.length-1])}return this.duration=t,this}trim(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this}validate(){let t=!0;for(let e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t}optimize(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}clone(){const t=[];for(let e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new this.constructor(this.name,this.duration,t,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function sb(i){if(i.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Aa;case"vector":case"vector2":case"vector3":case"vector4":return Pa;case"color":return Ip;case"quaternion":return to;case"bool":case"boolean":return rs;case"string":return ss}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(i.type);if(i.times===void 0){const e=[],n=[];Qe.flattenJSON(i.keys,e,n,"value"),i.times=e,i.values=n}return t.parse!==void 0?t.parse(i):new t(i.name,i.times,i.values,i.interpolation)}const os={enabled:!1,files:{},add:function(i,t){this.enabled!==!1&&(this.files[i]=t)},get:function(i){if(this.enabled!==!1)return this.files[i]},remove:function(i){delete this.files[i]},clear:function(){this.files={}}};class ob{constructor(t,e,n){const r=this;let s=!1,o=0,a=0,l;const h=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(c){a++,s===!1&&r.onStart!==void 0&&r.onStart(c,o,a),s=!0},this.itemEnd=function(c){o++,r.onProgress!==void 0&&r.onProgress(c,o,a),o===a&&(s=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(c){r.onError!==void 0&&r.onError(c)},this.resolveURL=function(c){return l?l(c):c},this.setURLModifier=function(c){return l=c,this},this.addHandler=function(c,u){return h.push(c,u),this},this.removeHandler=function(c){const u=h.indexOf(c);return u!==-1&&h.splice(u,2),this},this.getHandler=function(c){for(let u=0,p=h.length;u<p;u+=2){const f=h[u],g=h[u+1];if(f.global&&(f.lastIndex=0),f.test(c))return g}return null}}}const ab=new ob;class cr{constructor(t){this.manager=t!==void 0?t:ab,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){const n=this;return new Promise(function(r,s){n.load(t,r,e,s)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}const fi={};class lb extends cr{constructor(t){super(t)}load(t,e,n,r){t===void 0&&(t=""),this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=this,o=os.get(t);if(o!==void 0)return s.manager.itemStart(t),setTimeout(function(){e&&e(o),s.manager.itemEnd(t)},0),o;if(fi[t]!==void 0)return void fi[t].push({onLoad:e,onProgress:n,onError:r});const a=t.match(/^data:(.*?)(;base64)?,(.*)$/);let l;if(a){const h=a[1],c=!!a[2];let u=a[3];u=decodeURIComponent(u),c&&(u=atob(u));try{let p;const f=(this.responseType||"").toLowerCase();switch(f){case"arraybuffer":case"blob":const g=new Uint8Array(u.length);for(let v=0;v<u.length;v++)g[v]=u.charCodeAt(v);p=f==="blob"?new Blob([g.buffer],{type:h}):g.buffer;break;case"document":p=new DOMParser().parseFromString(u,h);break;case"json":p=JSON.parse(u);break;default:p=u}setTimeout(function(){e&&e(p),s.manager.itemEnd(t)},0)}catch(p){setTimeout(function(){r&&r(p),s.manager.itemError(t),s.manager.itemEnd(t)},0)}}else{fi[t]=[],fi[t].push({onLoad:e,onProgress:n,onError:r}),l=new XMLHttpRequest,l.open("GET",t,!0),l.addEventListener("load",function(h){const c=this.response,u=fi[t];if(delete fi[t],this.status===200||this.status===0){this.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),os.add(t,c);for(let p=0,f=u.length;p<f;p++){const g=u[p];g.onLoad&&g.onLoad(c)}s.manager.itemEnd(t)}else{for(let p=0,f=u.length;p<f;p++){const g=u[p];g.onError&&g.onError(h)}s.manager.itemError(t),s.manager.itemEnd(t)}},!1),l.addEventListener("progress",function(h){const c=fi[t];for(let u=0,p=c.length;u<p;u++){const f=c[u];f.onProgress&&f.onProgress(h)}},!1),l.addEventListener("error",function(h){const c=fi[t];delete fi[t];for(let u=0,p=c.length;u<p;u++){const f=c[u];f.onError&&f.onError(h)}s.manager.itemError(t),s.manager.itemEnd(t)},!1),l.addEventListener("abort",function(h){const c=fi[t];delete fi[t];for(let u=0,p=c.length;u<p;u++){const f=c[u];f.onError&&f.onError(h)}s.manager.itemError(t),s.manager.itemEnd(t)},!1),this.responseType!==void 0&&(l.responseType=this.responseType),this.withCredentials!==void 0&&(l.withCredentials=this.withCredentials),l.overrideMimeType&&l.overrideMimeType(this.mimeType!==void 0?this.mimeType:"text/plain");for(const h in this.requestHeader)l.setRequestHeader(h,this.requestHeader[h]);l.send(null)}return s.manager.itemStart(t),l}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class Lp extends cr{constructor(t){super(t)}load(t,e,n,r){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=this,o=os.get(t);if(o!==void 0)return s.manager.itemStart(t),setTimeout(function(){e&&e(o),s.manager.itemEnd(t)},0),o;const a=document.createElementNS("http://www.w3.org/1999/xhtml","img");function l(){a.removeEventListener("load",l,!1),a.removeEventListener("error",h,!1),os.add(t,this),e&&e(this),s.manager.itemEnd(t)}function h(c){a.removeEventListener("load",l,!1),a.removeEventListener("error",h,!1),r&&r(c),s.manager.itemError(t),s.manager.itemEnd(t)}return a.addEventListener("load",l,!1),a.addEventListener("error",h,!1),t.substr(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),s.manager.itemStart(t),a.src=t,a}}class hb extends cr{constructor(t){super(t)}load(t,e,n,r){const s=new ca,o=new Lp(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let a=0;function l(h){o.load(t[h],function(c){s.images[h]=c,a++,a===6&&(s.needsUpdate=!0,e&&e(s))},void 0,r)}for(let h=0;h<t.length;++h)l(h);return s}}class cb extends cr{constructor(t){super(t)}load(t,e,n,r){const s=new Rt,o=new Lp(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(t,function(a){s.image=a;const l=t.search(/\.jpe?g($|\?)/i)>0||t.search(/^data\:image\/jpeg/)===0;s.format=l?1022:1023,s.needsUpdate=!0,e!==void 0&&e(s)},n,r),s}}class ub extends si{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(t){this.curves.push(t)}closePath(){const t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new wa(e,t))}getPoint(t){const e=t*this.getLength(),n=this.getCurveLengths();let r=0;for(;r<n.length;){if(n[r]>=e){const s=n[r]-e,o=this.curves[r],a=o.getLength(),l=a===0?0:1-s/a;return o.getPointAt(l)}r++}return null}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let n=0,r=this.curves.length;n<r;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t,t}getSpacedPoints(t=40){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){const e=[];let n;for(let r=0,s=this.curves;r<s.length;r++){const o=s[r],a=o&&o.isEllipseCurve?2*t:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?t*o.points.length:t,l=o.getPoints(a);for(let h=0;h<l.length;h++){const c=l[h];n&&n.equals(c)||(e.push(c),n=c)}}return this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const r=t.curves[e];this.curves.push(r.clone())}return this.autoClose=t.autoClose,this}toJSON(){const t=super.toJSON();t.autoClose=this.autoClose,t.curves=[];for(let e=0,n=this.curves.length;e<n;e++){const r=this.curves[e];t.curves.push(r.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const r=t.curves[e];this.curves.push(new xp[r.type]().fromJSON(r))}return this}}class eo extends ub{constructor(t){super(),this.type="Path",this.currentPoint=new F,t&&this.setFromPoints(t)}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,n=t.length;e<n;e++)this.lineTo(t[e].x,t[e].y);return this}moveTo(t,e){return this.currentPoint.set(t,e),this}lineTo(t,e){const n=new wa(this.currentPoint.clone(),new F(t,e));return this.curves.push(n),this.currentPoint.set(t,e),this}quadraticCurveTo(t,e,n,r){const s=new bh(this.currentPoint.clone(),new F(t,e),new F(n,r));return this.curves.push(s),this.currentPoint.set(n,r),this}bezierCurveTo(t,e,n,r,s,o){const a=new xh(this.currentPoint.clone(),new F(t,e),new F(n,r),new F(s,o));return this.curves.push(a),this.currentPoint.set(s,o),this}splineThru(t){const e=[this.currentPoint.clone()].concat(t),n=new Eh(e);return this.curves.push(n),this.currentPoint.copy(t[t.length-1]),this}arc(t,e,n,r,s,o){const a=this.currentPoint.x,l=this.currentPoint.y;return this.absarc(t+a,e+l,n,r,s,o),this}absarc(t,e,n,r,s,o){return this.absellipse(t,e,n,n,r,s,o),this}ellipse(t,e,n,r,s,o,a,l){const h=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(t+h,e+c,n,r,s,o,a,l),this}absellipse(t,e,n,r,s,o,a,l){const h=new ba(t,e,n,r,s,o,a,l);if(this.curves.length>0){const u=h.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(h);const c=h.getPoint(1);return this.currentPoint.copy(c),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class Mh extends eo{constructor(t){super(t),this.uuid=K(),this.type="Shape",this.holes=[]}getPointsHoles(t){const e=[];for(let n=0,r=this.holes.length;n<r;n++)e[n]=this.holes[n].getPoints(t);return e}extractPoints(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}copy(t){super.copy(t),this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const r=t.holes[e];this.holes.push(r.clone())}return this}toJSON(){const t=super.toJSON();t.uuid=this.uuid,t.holes=[];for(let e=0,n=this.holes.length;e<n;e++){const r=this.holes[e];t.holes.push(r.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.uuid=t.uuid,this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const r=t.holes[e];this.holes.push(new eo().fromJSON(r))}return this}}class Pi extends ke{constructor(t,e=1){super(),this.type="Light",this.color=new _e(t),this.intensity=e}dispose(){}copy(t){return super.copy(t),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,this.groundColor!==void 0&&(e.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(e.object.distance=this.distance),this.angle!==void 0&&(e.object.angle=this.angle),this.decay!==void 0&&(e.object.decay=this.decay),this.penumbra!==void 0&&(e.object.penumbra=this.penumbra),this.shadow!==void 0&&(e.object.shadow=this.shadow.toJSON()),e}}Pi.prototype.isLight=!0;class db extends Pi{constructor(t,e,n){super(t,n),this.type="HemisphereLight",this.position.copy(ke.DefaultUp),this.updateMatrix(),this.groundColor=new _e(e)}copy(t){return Pi.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}db.prototype.isHemisphereLight=!0;const Np=new W,Op=new w,Dp=new w;class Ah{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new F(512,512),this.map=null,this.mapPass=null,this.matrix=new W,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new da,this._frameExtents=new F(1,1),this._viewportCount=1,this._viewports=[new at(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera,n=this.matrix;Op.setFromMatrixPosition(t.matrixWorld),e.position.copy(Op),Dp.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(Dp),e.updateMatrixWorld(),Np.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Np),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(e.projectionMatrix),n.multiply(e.matrixWorldInverse)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const t={};return this.bias!==0&&(t.bias=this.bias),this.normalBias!==0&&(t.normalBias=this.normalBias),this.radius!==1&&(t.radius=this.radius),this.mapSize.x===512&&this.mapSize.y===512||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}class Fp extends Ah{constructor(){super(new jn(50,1,.5,500)),this.focus=1}updateMatrices(t){const e=this.camera,n=2*k*t.angle*this.focus,r=this.mapSize.width/this.mapSize.height,s=t.distance||e.far;n===e.fov&&r===e.aspect&&s===e.far||(e.fov=n,e.aspect=r,e.far=s,e.updateProjectionMatrix()),super.updateMatrices(t)}copy(t){return super.copy(t),this.focus=t.focus,this}}Fp.prototype.isSpotLightShadow=!0;class pb extends Pi{constructor(t,e,n=0,r=Math.PI/3,s=0,o=1){super(t,e),this.type="SpotLight",this.position.copy(ke.DefaultUp),this.updateMatrix(),this.target=new ke,this.distance=n,this.angle=r,this.penumbra=s,this.decay=o,this.shadow=new Fp}get power(){return this.intensity*Math.PI}set power(t){this.intensity=t/Math.PI}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}pb.prototype.isSpotLight=!0;const kp=new W,no=new w,Ph=new w;class Up extends Ah{constructor(){super(new jn(90,1,.5,500)),this._frameExtents=new F(4,2),this._viewportCount=6,this._viewports=[new at(2,1,1,1),new at(0,1,1,1),new at(3,1,1,1),new at(1,1,1,1),new at(3,0,1,1),new at(1,0,1,1)],this._cubeDirections=[new w(1,0,0),new w(-1,0,0),new w(0,0,1),new w(0,0,-1),new w(0,1,0),new w(0,-1,0)],this._cubeUps=[new w(0,1,0),new w(0,1,0),new w(0,1,0),new w(0,1,0),new w(0,0,1),new w(0,0,-1)]}updateMatrices(t,e=0){const n=this.camera,r=this.matrix,s=t.distance||n.far;s!==n.far&&(n.far=s,n.updateProjectionMatrix()),no.setFromMatrixPosition(t.matrixWorld),n.position.copy(no),Ph.copy(n.position),Ph.add(this._cubeDirections[e]),n.up.copy(this._cubeUps[e]),n.lookAt(Ph),n.updateMatrixWorld(),r.makeTranslation(-no.x,-no.y,-no.z),kp.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(kp)}}Up.prototype.isPointLightShadow=!0;class fb extends Pi{constructor(t,e,n=0,r=1){super(t,e),this.type="PointLight",this.distance=n,this.decay=r,this.shadow=new Up}get power(){return 4*this.intensity*Math.PI}set power(t){this.intensity=t/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}fb.prototype.isPointLight=!0;class Ch extends ih{constructor(t=-1,e=1,n=1,r=-1,s=.1,o=2e3){super(),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,e,n,r,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=n-t,o=n+t,a=r+e,l=r-e;if(this.view!==null&&this.view.enabled){const h=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=h*this.view.offsetX,o=s+h*this.view.width,a-=c*this.view.offsetY,l=a-c*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,this.view!==null&&(e.object.view=Object.assign({},this.view)),e}}Ch.prototype.isOrthographicCamera=!0;class Bp extends Ah{constructor(){super(new Ch(-5,5,5,-5,.5,500))}}Bp.prototype.isDirectionalLightShadow=!0;class mb extends Pi{constructor(t,e){super(t,e),this.type="DirectionalLight",this.position.copy(ke.DefaultUp),this.updateMatrix(),this.target=new ke,this.shadow=new Bp}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}mb.prototype.isDirectionalLight=!0;class gb extends Pi{constructor(t,e){super(t,e),this.type="AmbientLight"}}gb.prototype.isAmbientLight=!0;class vb extends Pi{constructor(t,e,n=10,r=10){super(t,e),this.type="RectAreaLight",this.width=n,this.height=r}copy(t){return super.copy(t),this.width=t.width,this.height=t.height,this}toJSON(t){const e=super.toJSON(t);return e.object.width=this.width,e.object.height=this.height,e}}vb.prototype.isRectAreaLight=!0;class Gp{constructor(){this.coefficients=[];for(let t=0;t<9;t++)this.coefficients.push(new w)}set(t){for(let e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this}zero(){for(let t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this}getAt(t,e){const n=t.x,r=t.y,s=t.z,o=this.coefficients;return e.copy(o[0]).multiplyScalar(.282095),e.addScaledVector(o[1],.488603*r),e.addScaledVector(o[2],.488603*s),e.addScaledVector(o[3],.488603*n),e.addScaledVector(o[4],n*r*1.092548),e.addScaledVector(o[5],r*s*1.092548),e.addScaledVector(o[6],.315392*(3*s*s-1)),e.addScaledVector(o[7],n*s*1.092548),e.addScaledVector(o[8],.546274*(n*n-r*r)),e}getIrradianceAt(t,e){const n=t.x,r=t.y,s=t.z,o=this.coefficients;return e.copy(o[0]).multiplyScalar(.886227),e.addScaledVector(o[1],1.023328*r),e.addScaledVector(o[2],1.023328*s),e.addScaledVector(o[3],1.023328*n),e.addScaledVector(o[4],.858086*n*r),e.addScaledVector(o[5],.858086*r*s),e.addScaledVector(o[6],.743125*s*s-.247708),e.addScaledVector(o[7],.858086*n*s),e.addScaledVector(o[8],.429043*(n*n-r*r)),e}add(t){for(let e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this}addScaledSH(t,e){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(t.coefficients[n],e);return this}scale(t){for(let e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this}lerp(t,e){for(let n=0;n<9;n++)this.coefficients[n].lerp(t.coefficients[n],e);return this}equals(t){for(let e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0}copy(t){return this.set(t.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(t,e=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].fromArray(t,e+3*r);return this}toArray(t=[],e=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].toArray(t,e+3*r);return t}static getBasisAt(t,e){const n=t.x,r=t.y,s=t.z;e[0]=.282095,e[1]=.488603*r,e[2]=.488603*s,e[3]=.488603*n,e[4]=1.092548*n*r,e[5]=1.092548*r*s,e[6]=.315392*(3*s*s-1),e[7]=1.092548*n*s,e[8]=.546274*(n*n-r*r)}}Gp.prototype.isSphericalHarmonics3=!0;class Ih extends Pi{constructor(t=new Gp,e=1){super(void 0,e),this.sh=t}copy(t){return super.copy(t),this.sh.copy(t.sh),this}fromJSON(t){return this.intensity=t.intensity,this.sh.fromArray(t.sh),this}toJSON(t){const e=super.toJSON(t);return e.object.sh=this.sh.toArray(),e}}Ih.prototype.isLightProbe=!0;class _b{static decodeText(t){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(t);let e="";for(let n=0,r=t.length;n<r;n++)e+=String.fromCharCode(t[n]);try{return decodeURIComponent(escape(e))}catch{return e}}static extractUrlBase(t){const e=t.lastIndexOf("/");return e===-1?"./":t.substr(0,e+1)}}class yb extends He{constructor(){super(),this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}clone(){return new this.constructor().copy(this)}toJSON(){const t=super.toJSON(this);return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}yb.prototype.isInstancedBufferGeometry=!0;class xb extends an{constructor(t,e,n,r=1){typeof n=="number"&&(r=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(t,e,n),this.meshPerAttribute=r}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){const t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}xb.prototype.isInstancedBufferAttribute=!0,class extends cr{constructor(i){super(i),typeof createImageBitmap=="undefined"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch=="undefined"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(i){return this.options=i,this}load(i,t,e,n){i===void 0&&(i=""),this.path!==void 0&&(i=this.path+i),i=this.manager.resolveURL(i);const r=this,s=os.get(i);if(s!==void 0)return r.manager.itemStart(i),setTimeout(function(){t&&t(s),r.manager.itemEnd(i)},0),s;const o={};o.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",o.headers=this.requestHeader,fetch(i,o).then(function(a){return a.blob()}).then(function(a){return createImageBitmap(a,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(a){os.add(i,a),t&&t(a),r.manager.itemEnd(i)}).catch(function(a){n&&n(a),r.manager.itemError(i),r.manager.itemEnd(i)}),r.manager.itemStart(i)}}.prototype.isImageBitmapLoader=!0;let Rh;const bb=function(){return Rh===void 0&&(Rh=new(window.AudioContext||window.webkitAudioContext)),Rh};class Eb extends cr{constructor(t){super(t)}load(t,e,n,r){const s=this,o=new lb(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,function(a){try{const l=a.slice(0);bb().decodeAudioData(l,function(h){e(h)})}catch(l){r?r(l):console.error(l),s.manager.itemError(t)}},n,r)}}(class extends Ih{constructor(i,t,e=1){super(void 0,e);const n=new _e().set(i),r=new _e().set(t),s=new w(n.r,n.g,n.b),o=new w(r.r,r.g,r.b),a=Math.sqrt(Math.PI),l=a*Math.sqrt(.75);this.sh.coefficients[0].copy(s).add(o).multiplyScalar(a),this.sh.coefficients[1].copy(s).sub(o).multiplyScalar(l)}}).prototype.isHemisphereLightProbe=!0,class extends Ih{constructor(i,t=1){super(void 0,t);const e=new _e().set(i);this.sh.coefficients[0].set(e.r,e.g,e.b).multiplyScalar(2*Math.sqrt(Math.PI))}}.prototype.isAmbientLightProbe=!0;class wb extends ke{constructor(t){super(),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this}setMediaElementSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this}setMediaStreamSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this}setBuffer(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this}play(t=0){if(this.isPlaying===!0)return void console.warn("THREE.Audio: Audio is already playing.");if(this.hasPlaybackControl===!1)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+t;const e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl!==!1)return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(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.")}stop(){if(this.hasPlaybackControl!==!1)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.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(t){return t||(t=[]),this._connected===!0?(this.disconnect(),this.filters=t.slice(),this.connect()):this.filters=t.slice(),this}setDetune(t){if(this.detune=t,this.source.detune!==void 0)return this.isPlaying===!0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(t){return this.setFilters(t?[t]:[])}setPlaybackRate(t){if(this.hasPlaybackControl!==!1)return this.playbackRate=t,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(t){if(this.hasPlaybackControl!==!1)return this.loop=t,this.isPlaying===!0&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}setLoopStart(t){return this.loopStart=t,this}setLoopEnd(t){return this.loopEnd=t,this}getVolume(){return this.gain.gain.value}setVolume(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}}class Tb{constructor(t,e,n){let r,s,o;switch(this.binding=t,this.valueSize=n,e){case"quaternion":r=this._slerp,s=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*n),this._workIndex=5;break;case"string":case"bool":r=this._select,s=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(5*n);break;default:r=this._lerp,s=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*n)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=s,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(t,e){const n=this.buffer,r=this.valueSize,s=t*r+r;let o=this.cumulativeWeight;if(o===0){for(let a=0;a!==r;++a)n[s+a]=n[a];o=e}else{o+=e;const a=e/o;this._mixBufferRegion(n,s,0,a,r)}this.cumulativeWeight=o}accumulateAdditive(t){const e=this.buffer,n=this.valueSize,r=n*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(e,r,0,t,n),this.cumulativeWeightAdditive+=t}apply(t){const e=this.valueSize,n=this.buffer,r=t*e+e,s=this.cumulativeWeight,o=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,s<1){const l=e*this._origIndex;this._mixBufferRegion(n,r,l,1-s,e)}o>0&&this._mixBufferRegionAdditive(n,r,this._addIndex*e,1,e);for(let l=e,h=e+e;l!==h;++l)if(n[l]!==n[l+e]){a.setValue(n,r);break}}saveOriginalState(){const t=this.binding,e=this.buffer,n=this.valueSize,r=n*this._origIndex;t.getValue(e,r);for(let s=n,o=r;s!==o;++s)e[s]=e[r+s%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let n=t;n<e;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const t=this._origIndex*this.valueSize,e=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[e+n]=this.buffer[t+n]}_select(t,e,n,r,s){if(r>=.5)for(let o=0;o!==s;++o)t[e+o]=t[n+o]}_slerp(t,e,n,r){lt.slerpFlat(t,e,t,e,t,n,r)}_slerpAdditive(t,e,n,r,s){const o=this._workIndex*s;lt.multiplyQuaternionsFlat(t,o,t,e,t,n),lt.slerpFlat(t,e,t,e,t,o,r)}_lerp(t,e,n,r,s){const o=1-r;for(let a=0;a!==s;++a){const l=e+a;t[l]=t[l]*o+t[n+a]*r}}_lerpAdditive(t,e,n,r,s){for(let o=0;o!==s;++o){const a=e+o;t[a]=t[a]+t[n+o]*r}}}const Sb=new RegExp("[\\[\\]\\.:\\/]","g"),Mb="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Ab=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),Pb=/(WCOD+)?/.source.replace("WCOD",Mb),Cb=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Ib=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Rb=new RegExp("^"+Ab+Pb+Cb+Ib+"$"),Lb=["material","materials","bones"];class Ue{constructor(t,e,n){this.path=e,this.parsedPath=n||Ue.parseTrackName(e),this.node=Ue.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,n){return t&&t.isAnimationObjectGroup?new Ue.Composite(t,e,n):new Ue(t,e,n)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(Sb,"")}static parseTrackName(t){const e=Rb.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const s=n.nodeName.substring(r+1);Lb.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}static findNode(t,e){if(!e||e===""||e==="."||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){const n=t.skeleton.getBoneByName(e);if(n!==void 0)return n}if(t.children){const n=function(s){for(let o=0;o<s.length;o++){const a=s[o];if(a.name===e||a.uuid===e)return a;const l=n(a.children);if(l)return l}return null},r=n(t.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.node[this.propertyName]}_getValue_array(t,e){const n=this.resolvedProperty;for(let r=0,s=n.length;r!==s;++r)t[e++]=n[r]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){const n=this.resolvedProperty;for(let r=0,s=n.length;r!==s;++r)n[r]=t[e++]}_setValue_array_setNeedsUpdate(t,e){const n=this.resolvedProperty;for(let r=0,s=n.length;r!==s;++r)n[r]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){const n=this.resolvedProperty;for(let r=0,s=n.length;r!==s;++r)n[r]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node;const e=this.parsedPath,n=e.objectName,r=e.propertyName;let s=e.propertyIndex;if(t||(t=Ue.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(n){let h=e.objectIndex;switch(n){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(let c=0;c<t.length;c++)if(t[c].name===h){h=c;break}break;default:if(t[n]===void 0)return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[n]}if(h!==void 0){if(t[h]===void 0)return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[h]}}const o=t[r];if(o===void 0){const h=e.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+h+"."+r+" but it wasn't found.",t)}let a=this.Versioning.None;this.targetObject=t,t.needsUpdate!==void 0?a=this.Versioning.NeedsUpdate:t.matrixWorldNeedsUpdate!==void 0&&(a=this.Versioning.MatrixWorldNeedsUpdate);let l=this.BindingType.Direct;if(s!==void 0){if(r==="morphTargetInfluences"){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!t.geometry.isBufferGeometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);t.morphTargetDictionary[s]!==void 0&&(s=t.morphTargetDictionary[s])}l=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else o.fromArray!==void 0&&o.toArray!==void 0?(l=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(l=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=r;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Ue.Composite=class{constructor(i,t,e){const n=e||Ue.parseTrackName(t);this._targetGroup=i,this._bindings=i.subscribe_(t,n)}getValue(i,t){this.bind();const e=this._targetGroup.nCachedObjects_,n=this._bindings[e];n!==void 0&&n.getValue(i,t)}setValue(i,t){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].setValue(i,t)}bind(){const i=this._bindings;for(let t=this._targetGroup.nCachedObjects_,e=i.length;t!==e;++t)i[t].bind()}unbind(){const i=this._bindings;for(let t=this._targetGroup.nCachedObjects_,e=i.length;t!==e;++t)i[t].unbind()}},Ue.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Ue.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},Ue.prototype.GetterByBindingType=[Ue.prototype._getValue_direct,Ue.prototype._getValue_array,Ue.prototype._getValue_arrayElement,Ue.prototype._getValue_toArray],Ue.prototype.SetterByBindingTypeAndVersioning=[[Ue.prototype._setValue_direct,Ue.prototype._setValue_direct_setNeedsUpdate,Ue.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Ue.prototype._setValue_array,Ue.prototype._setValue_array_setNeedsUpdate,Ue.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Ue.prototype._setValue_arrayElement,Ue.prototype._setValue_arrayElement_setNeedsUpdate,Ue.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Ue.prototype._setValue_fromArray,Ue.prototype._setValue_fromArray_setNeedsUpdate,Ue.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class Nb{constructor(t,e,n=null,r=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=n,this.blendMode=r;const s=e.tracks,o=s.length,a=new Array(o),l={endingStart:2400,endingEnd:2400};for(let h=0;h!==o;++h){const c=s[h].createInterpolant(null);a[h]=c,c.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,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}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,e,n){if(t.fadeOut(e),this.fadeIn(e),n){const r=this._clip.duration,s=t._clip.duration,o=s/r,a=r/s;t.warp(1,o,e),this.warp(a,1,e)}return this}crossFadeTo(t,e,n){return t.crossFadeFrom(this,e,n)}stopFading(){const t=this._weightInterpolant;return t!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,e,n){const r=this._mixer,s=r.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,h=a.sampleValues;return l[0]=s,l[1]=s+n,h[0]=t/o,h[1]=e/o,this}stopWarping(){const t=this._timeScaleInterpolant;return t!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,n,r){if(!this.enabled)return void this._updateWeight(t);const s=this._startTime;if(s!==null){const l=(t-s)*n;if(l<0||n===0)return;this._startTime=null,e=n*l}e*=this._updateTimeScale(t);const o=this._updateTime(e),a=this._updateWeight(t);if(a>0){const l=this._interpolants,h=this._propertyBindings;switch(this.blendMode){case 2501:for(let c=0,u=l.length;c!==u;++c)l[c].evaluate(o),h[c].accumulateAdditive(a);break;case 2500:default:for(let c=0,u=l.length;c!==u;++c)l[c].evaluate(o),h[c].accumulate(r,a)}}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const n=this._weightInterpolant;if(n!==null){const r=n.evaluate(t)[0];e*=r,t>n.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const n=this._timeScaleInterpolant;n!==null&&(e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),e===0?this.paused=!0:this.timeScale=e))}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,n=this.loop;let r=this.time+t,s=this._loopCount;const o=n===2202;if(t===0)return s===-1?r:o&&(1&s)==1?e-r:r;if(n===2200){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(r>=e)r=e;else{if(!(r<0)){this.time=r;break t}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(s===-1&&(t>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),r>=e||r<0){const a=Math.floor(r/e);r-=e*a,s+=Math.abs(a);const l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=t>0?e:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(l===1){const h=t<0;this._setEndings(h,!h,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(o&&(1&s)==1)return e-r}return r}_setEndings(t,e,n){const r=this._interpolantSettings;n?(r.endingStart=2401,r.endingEnd=2401):(r.endingStart=t?this.zeroSlopeAtStart?2401:2400:2402,r.endingEnd=e?this.zeroSlopeAtEnd?2401:2400:2402)}_scheduleFading(t,e,n){const r=this._mixer,s=r.time;let o=this._weightInterpolant;o===null&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=e,a[1]=s+t,l[1]=n,this}}(class extends N{constructor(i){super(),this._root=i,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(i,t){const e=i._localRoot||this._root,n=i._clip.tracks,r=n.length,s=i._propertyBindings,o=i._interpolants,a=e.uuid,l=this._bindingsByRootAndName;let h=l[a];h===void 0&&(h={},l[a]=h);for(let c=0;c!==r;++c){const u=n[c],p=u.name;let f=h[p];if(f!==void 0)s[c]=f;else{if(f=s[c],f!==void 0){f._cacheIndex===null&&(++f.referenceCount,this._addInactiveBinding(f,a,p));continue}const g=t&&t._propertyBindings[c].binding.parsedPath;f=new Tb(Ue.create(e,p,g),u.ValueTypeName,u.getValueSize()),++f.referenceCount,this._addInactiveBinding(f,a,p),s[c]=f}o[c].resultBuffer=f.buffer}}_activateAction(i){if(!this._isActiveAction(i)){if(i._cacheIndex===null){const e=(i._localRoot||this._root).uuid,n=i._clip.uuid,r=this._actionsByClip[n];this._bindAction(i,r&&r.knownActions[0]),this._addInactiveAction(i,n,e)}const t=i._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const r=t[e];r.useCount++==0&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(i)}}_deactivateAction(i){if(this._isActiveAction(i)){const t=i._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const r=t[e];--r.useCount==0&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(i)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const i=this;this.stats={actions:{get total(){return i._actions.length},get inUse(){return i._nActiveActions}},bindings:{get total(){return i._bindings.length},get inUse(){return i._nActiveBindings}},controlInterpolants:{get total(){return i._controlInterpolants.length},get inUse(){return i._nActiveControlInterpolants}}}}_isActiveAction(i){const t=i._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(i,t,e){const n=this._actions,r=this._actionsByClip;let s=r[t];if(s===void 0)s={knownActions:[i],actionByRoot:{}},i._byClipCacheIndex=0,r[t]=s;else{const o=s.knownActions;i._byClipCacheIndex=o.length,o.push(i)}i._cacheIndex=n.length,n.push(i),s.actionByRoot[e]=i}_removeInactiveAction(i){const t=this._actions,e=t[t.length-1],n=i._cacheIndex;e._cacheIndex=n,t[n]=e,t.pop(),i._cacheIndex=null;const r=i._clip.uuid,s=this._actionsByClip,o=s[r],a=o.knownActions,l=a[a.length-1],h=i._byClipCacheIndex;l._byClipCacheIndex=h,a[h]=l,a.pop(),i._byClipCacheIndex=null,delete o.actionByRoot[(i._localRoot||this._root).uuid],a.length===0&&delete s[r],this._removeInactiveBindingsForAction(i)}_removeInactiveBindingsForAction(i){const t=i._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const r=t[e];--r.referenceCount==0&&this._removeInactiveBinding(r)}}_lendAction(i){const t=this._actions,e=i._cacheIndex,n=this._nActiveActions++,r=t[n];i._cacheIndex=n,t[n]=i,r._cacheIndex=e,t[e]=r}_takeBackAction(i){const t=this._actions,e=i._cacheIndex,n=--this._nActiveActions,r=t[n];i._cacheIndex=n,t[n]=i,r._cacheIndex=e,t[e]=r}_addInactiveBinding(i,t,e){const n=this._bindingsByRootAndName,r=this._bindings;let s=n[t];s===void 0&&(s={},n[t]=s),s[e]=i,i._cacheIndex=r.length,r.push(i)}_removeInactiveBinding(i){const t=this._bindings,e=i.binding,n=e.rootNode.uuid,r=e.path,s=this._bindingsByRootAndName,o=s[n],a=t[t.length-1],l=i._cacheIndex;a._cacheIndex=l,t[l]=a,t.pop(),delete o[r],Object.keys(o).length===0&&delete s[n]}_lendBinding(i){const t=this._bindings,e=i._cacheIndex,n=this._nActiveBindings++,r=t[n];i._cacheIndex=n,t[n]=i,r._cacheIndex=e,t[e]=r}_takeBackBinding(i){const t=this._bindings,e=i._cacheIndex,n=--this._nActiveBindings,r=t[n];i._cacheIndex=n,t[n]=i,r._cacheIndex=e,t[e]=r}_lendControlInterpolant(){const i=this._controlInterpolants,t=this._nActiveControlInterpolants++;let e=i[t];return e===void 0&&(e=new Cp(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),e.__cacheIndex=t,i[t]=e),e}_takeBackControlInterpolant(i){const t=this._controlInterpolants,e=i.__cacheIndex,n=--this._nActiveControlInterpolants,r=t[n];i.__cacheIndex=n,t[n]=i,r.__cacheIndex=e,t[e]=r}clipAction(i,t,e){const n=t||this._root,r=n.uuid;let s=typeof i=="string"?Rp.findByName(n,i):i;const o=s!==null?s.uuid:i,a=this._actionsByClip[o];let l=null;if(e===void 0&&(e=s!==null?s.blendMode:2500),a!==void 0){const c=a.actionByRoot[r];if(c!==void 0&&c.blendMode===e)return c;l=a.knownActions[0],s===null&&(s=l._clip)}if(s===null)return null;const h=new Nb(this,s,t,e);return this._bindAction(h,l),this._addInactiveAction(h,o,r),h}existingAction(i,t){const e=t||this._root,n=e.uuid,r=typeof i=="string"?Rp.findByName(e,i):i,s=r?r.uuid:i,o=this._actionsByClip[s];return o!==void 0&&o.actionByRoot[n]||null}stopAllAction(){const i=this._actions;for(let t=this._nActiveActions-1;t>=0;--t)i[t].stop();return this}update(i){i*=this.timeScale;const t=this._actions,e=this._nActiveActions,n=this.time+=i,r=Math.sign(i),s=this._accuIndex^=1;for(let l=0;l!==e;++l)t[l]._update(n,i,r,s);const o=this._bindings,a=this._nActiveBindings;for(let l=0;l!==a;++l)o[l].apply(s);return this}setTime(i){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(i)}getRoot(){return this._root}uncacheClip(i){const t=this._actions,e=i.uuid,n=this._actionsByClip,r=n[e];if(r!==void 0){const s=r.knownActions;for(let o=0,a=s.length;o!==a;++o){const l=s[o];this._deactivateAction(l);const h=l._cacheIndex,c=t[t.length-1];l._cacheIndex=null,l._byClipCacheIndex=null,c._cacheIndex=h,t[h]=c,t.pop(),this._removeInactiveBindingsForAction(l)}delete n[e]}}uncacheRoot(i){const t=i.uuid,e=this._actionsByClip;for(const r in e){const s=e[r].actionByRoot[t];s!==void 0&&(this._deactivateAction(s),this._removeInactiveAction(s))}const n=this._bindingsByRootAndName[t];if(n!==void 0)for(const r in n){const s=n[r];s.restoreOriginalState(),this._removeInactiveBinding(s)}}uncacheAction(i,t){const e=this.existingAction(i,t);e!==null&&(this._deactivateAction(e),this._removeInactiveAction(e))}}).prototype._controlInterpolantsResultBuffer=new Float32Array(1),class extends zs{constructor(i,t,e=1){super(i,t),this.meshPerAttribute=e}copy(i){return super.copy(i),this.meshPerAttribute=i.meshPerAttribute,this}clone(i){const t=super.clone(i);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(i){const t=super.toJSON(i);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}.prototype.isInstancedInterleavedBuffer=!0,new F,new w,new w,class extends ke{constructor(i){super(),this.material=i,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}}.prototype.isImmediateRenderObject=!0;const ur=new w,Ca=new W,Lh=new W,Ob=new Float32Array(1);new Int32Array(Ob.buffer);const Hp=[.125,.215,.35,.446,.526,.582],Db=5+Hp.length,Fb=new Zl({side:1,depthWrite:!1,depthTest:!1});new kn(new Us,Fb),kb();function kb(){const i=[],t=[],e=[];let n=8;for(let r=0;r<Db;r++){const s=Math.pow(2,n);t.push(s);let o=1/s;r>4?o=Hp[r-8+4-1]:r==0&&(o=0),e.push(o);const a=1/(s-1),l=-a/2,h=1+a/2,c=[l,l,h,l,h,h,l,l,h,h,l,h],u=6,p=6,f=3,g=2,_=1,v=new Float32Array(f*p*u),M=new Float32Array(g*p*u),A=new Float32Array(_*p*u);for(let H=0;H<u;H++){const j=H%3*2/3-1,X=H>2?0:-1,U=[j,X,0,j+2/3,X,0,j+2/3,X+1,0,j,X,0,j+2/3,X+1,0,j,X+1,0];v.set(U,f*p*H),M.set(c,g*p*H);const V=[H,H,H,H,H,H];A.set(V,_*p*H)}const O=new He;O.setAttribute("position",new an(v,f)),O.setAttribute("uv",new an(M,g)),O.setAttribute("faceIndex",new an(A,_)),i.push(O),n>4&&n--}return{_lodPlanes:i,_sizeLods:t,_sigmas:e}}si.create=function(i,t){return console.log("THREE.Curve.create() has been deprecated"),i.prototype=Object.create(si.prototype),i.prototype.constructor=i,i.prototype.getPoint=t,i},eo.prototype.fromPoints=function(i){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(i)},class extends ph{constructor(i=10,t=10,e=4473924,n=8947848){e=new _e(e),n=new _e(n);const r=t/2,s=i/t,o=i/2,a=[],l=[];for(let c=0,u=0,p=-o;c<=t;c++,p+=s){a.push(-o,0,p,o,0,p),a.push(p,0,-o,p,0,o);const f=c===r?e:n;f.toArray(l,u),u+=3,f.toArray(l,u),u+=3,f.toArray(l,u),u+=3,f.toArray(l,u),u+=3}const h=new He;h.setAttribute("position",new Fe(a,3)),h.setAttribute("color",new Fe(l,3)),super(h,new qs({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},class extends ph{constructor(i){const t=function a(l){const h=[];l&&l.isBone&&h.push(l);for(let c=0;c<l.children.length;c++)h.push.apply(h,a(l.children[c]));return h}(i),e=new He,n=[],r=[],s=new _e(0,0,1),o=new _e(0,1,0);for(let a=0;a<t.length;a++){const l=t[a];l.parent&&l.parent.isBone&&(n.push(0,0,0),n.push(0,0,0),r.push(s.r,s.g,s.b),r.push(o.r,o.g,o.b))}e.setAttribute("position",new Fe(n,3)),e.setAttribute("color",new Fe(r,3)),super(e,new qs({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.type="SkeletonHelper",this.isSkeletonHelper=!0,this.root=i,this.bones=t,this.matrix=i.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(i){const t=this.bones,e=this.geometry,n=e.getAttribute("position");Lh.copy(this.root.matrixWorld).invert();for(let r=0,s=0;r<t.length;r++){const o=t[r];o.parent&&o.parent.isBone&&(Ca.multiplyMatrices(Lh,o.matrixWorld),ur.setFromMatrixPosition(Ca),n.setXYZ(s,ur.x,ur.y,ur.z),Ca.multiplyMatrices(Lh,o.parent.matrixWorld),ur.setFromMatrixPosition(Ca),n.setXYZ(s+1,ur.x,ur.y,ur.z),s+=2)}e.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(i)}}.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},cr.prototype.extractUrlBase=function(i){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),_b.extractUrlBase(i)},cr.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.")}},dt.prototype.center=function(i){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(i)},dt.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},dt.prototype.isIntersectionBox=function(i){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(i)},dt.prototype.isIntersectionSphere=function(i){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(i)},dt.prototype.size=function(i){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(i)},je.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()},da.prototype.setFromMatrix=function(i){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(i)},P.prototype.flattenToArrayOffset=function(i,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(i,t)},P.prototype.multiplyVector3=function(i){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),i.applyMatrix3(this)},P.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},P.prototype.applyToBufferAttribute=function(i){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),i.applyMatrix3(this)},P.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},P.prototype.getInverse=function(i){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(i).invert()},W.prototype.extractPosition=function(i){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(i)},W.prototype.flattenToArrayOffset=function(i,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(i,t)},W.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),new w().setFromMatrixColumn(this,3)},W.prototype.setRotationFromQuaternion=function(i){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(i)},W.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},W.prototype.multiplyVector3=function(i){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)},W.prototype.multiplyVector4=function(i){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)},W.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},W.prototype.rotateAxis=function(i){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),i.transformDirection(this)},W.prototype.crossVector=function(i){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)},W.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")},W.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},W.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},W.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},W.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},W.prototype.applyToBufferAttribute=function(i){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)},W.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},W.prototype.makeFrustum=function(i,t,e,n,r,s){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(i,t,n,e,r,s)},W.prototype.getInverse=function(i){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(i).invert()},zi.prototype.isIntersectionLine=function(i){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(i)},lt.prototype.multiplyVector3=function(i){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),i.applyQuaternion(this)},lt.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()},z.prototype.isIntersectionBox=function(i){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(i)},z.prototype.isIntersectionPlane=function(i){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(i)},z.prototype.isIntersectionSphere=function(i){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(i)},pn.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},pn.prototype.barycoordFromPoint=function(i,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(i,t)},pn.prototype.midpoint=function(i){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(i)},pn.prototypenormal=function(i){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(i)},pn.prototype.plane=function(i){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(i)},pn.barycoordFromPoint=function(i,t,e,n,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),pn.getBarycoord(i,t,e,n,r)},pn.normal=function(i,t,e,n){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),pn.getNormal(i,t,e,n)},Mh.prototype.extractAllPoints=function(i){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(i)},Mh.prototype.extrude=function(i){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new is(this,i)},Mh.prototype.makeGeometry=function(i){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Sh(this,i)},F.prototype.fromAttribute=function(i,t,e){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(i,t,e)},F.prototype.distanceToManhattan=function(i){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(i)},F.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},w.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},w.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},w.prototype.getPositionFromMatrix=function(i){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(i)},w.prototype.getScaleFromMatrix=function(i){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(i)},w.prototype.getColumnFromMatrix=function(i,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,i)},w.prototype.applyProjection=function(i){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(i)},w.prototype.fromAttribute=function(i,t,e){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(i,t,e)},w.prototype.distanceToManhattan=function(i){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(i)},w.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},at.prototype.fromAttribute=function(i,t,e){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(i,t,e)},at.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},ke.prototype.getChildByName=function(i){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(i)},ke.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},ke.prototype.translate=function(i,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,i)},ke.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},ke.prototype.applyMatrix=function(i){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(i)},Object.defineProperties(ke.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(i){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=i}},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.")}}}),kn.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(kn.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),ip.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},jn.prototype.setLens=function(i,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),t!==void 0&&(this.filmGauge=t),this.setFocalLength(i)},Object.defineProperties(Pi.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(i){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=i}},shadowCameraLeft:{set:function(i){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=i}},shadowCameraRight:{set:function(i){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=i}},shadowCameraTop:{set:function(i){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=i}},shadowCameraBottom:{set:function(i){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=i}},shadowCameraNear:{set:function(i){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=i}},shadowCameraFar:{set:function(i){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=i}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(i){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=i}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(i){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=i}},shadowMapHeight:{set:function(i){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=i}}}),Object.defineProperties(an.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===35048},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(35048)}}}),an.prototype.setDynamic=function(i){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(i===!0?35048:35044),this},an.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},an.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},He.prototype.addIndex=function(i){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(i)},He.prototype.addAttribute=function(i,t){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?i==="index"?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(i,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(i,new an(arguments[1],arguments[2])))},He.prototype.addDrawCall=function(i,t,e){e!==void 0&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(i,t)},He.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},He.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},He.prototype.removeAttribute=function(i){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(i)},He.prototype.applyMatrix=function(i){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(i)},Object.defineProperties(He.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}}}),zs.prototype.setDynamic=function(i){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(i===!0?35048:35044),this},zs.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},is.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},is.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},is.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")},hh.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")},Object.defineProperties(Rn.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 _e}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(i){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=i===1}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(i){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=i}}}),Object.defineProperties(pi.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(i){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=i}}}),ze.prototype.clearTarget=function(i,t,e,n){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(i),this.clear(t,e,n)},ze.prototype.animate=function(i){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(i)},ze.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},ze.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},ze.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},ze.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},ze.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},ze.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},ze.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},ze.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},ze.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},ze.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},ze.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},ze.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},ze.prototype.enableScissorTest=function(i){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(i)},ze.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},ze.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},ze.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},ze.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},ze.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},ze.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},ze.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},ze.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},ze.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},ze.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()},Object.defineProperties(ze.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(i){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=i}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(i){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=i}},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(i){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=i===!0?3001:3e3}},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(Yd.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($.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(i){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=i}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(i){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=i}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(i){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=i}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(i){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=i}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(i){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=i}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(i){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=i}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(i){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=i}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(i){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=i}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(i){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=i}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(i){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=i}}}),wb.prototype.load=function(i){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const t=this;return new Eb().load(i,function(e){t.setBuffer(e)}),this},rh.prototype.updateCubeMap=function(i,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(i,t)},rh.prototype.clear=function(i,t,e,n){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(i,t,e,n)},G.crossOrigin=void 0,G.loadTexture=function(i,t,e,n){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");const r=new cb;r.setCrossOrigin(this.crossOrigin);const s=r.load(i,e,void 0,n);return t&&(s.mapping=t),s},G.loadTextureCube=function(i,t,e,n){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");const r=new hb;r.setCrossOrigin(this.crossOrigin);const s=r.load(i,e,void 0,n);return t&&(s.mapping=t),s},G.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},G.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"130"}})),typeof window!="undefined"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="130");var Ub=d(0),cn=d.n(Ub),Bb=d(21),Gb=d.n(Bb),Hb=d(1),Sn=d.n(Hb);class zb{constructor(){this.camera=new Ch(10,10,10,10),this.camera.position.z=100,this.camera.position.x=0,this.camera.position.y=0}focus(t,e){t.position.z=50}updateAspect(t,e){this.camera.left=-1*t/2,this.camera.right=t/2,this.camera.top=e/2,this.camera.bottom=-1*e/2,this.camera.updateProjectionMatrix()}}const zp={linear:(i,t,e,n)=>e*i/n+t,easeIn:(i,t,e,n)=>e*(i/=n)*i+t,strongEaseIn:(i,t,e,n)=>e*(i/=n)*i*i*i*i+t,strongEaseOut:(i,t,e,n)=>e*((i=i/n-1)*i*i*i*i+1)+t,sineaseIn:(i,t,e,n)=>e*(i/=n)*i*i+t,sineaseOut:(i,t,e,n)=>e*((i=i/n-1)*i*i+1)+t},Ci=new Rt;class Mn{constructor(){this.camera=new zb,this.mesh=new kn,this.material=null,this.geometry=null}applyOptions(t){}addObjects(t){this.mesh.position.z=50,t.add(this.mesh)}setSize(t,e){this.camera.updateAspect(t,e),this.geometry=new pa(t,e,1,1),this.material=new pi({fragmentShader:this.fragmentShader,vertexShader:`
|
|
4918
4918
|
varying vec2 vUv;
|
|
4919
4919
|
void main(){
|
|
4920
4920
|
vUv = uv;
|
|
@@ -5998,6 +5998,6 @@ self.onmessage = function(e) {
|
|
|
5998
5998
|
`));var ko=function(){try{return!!window.localStorage}catch{return!1}}(),Rl=void 0,U0=!0,Rs=void 0,Du=!1,B0=[],qe=function i(t){var e=this,n=t||{};this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),wt.addClass(this.domElement,"dg"),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],n=jt.defaults(n,{closeOnTop:!1,autoPlace:!0,width:i.DEFAULT_WIDTH}),n=jt.defaults(n,{resizable:n.autoPlace,hideable:n.autoPlace}),jt.isUndefined(n.load)?n.load={preset:"Default"}:n.preset&&(n.load.preset=n.preset),jt.isUndefined(n.parent)&&n.hideable&&B0.push(this),n.resizable=jt.isUndefined(n.parent)&&n.resizable,n.autoPlace&&jt.isUndefined(n.scrollable)&&(n.scrollable=!0);var r,s=ko&&localStorage.getItem(Ls(this,"isLocal"))==="true",o=void 0,a=void 0;if(Object.defineProperties(this,{parent:{get:function(){return n.parent}},scrollable:{get:function(){return n.scrollable}},autoPlace:{get:function(){return n.autoPlace}},closeOnTop:{get:function(){return n.closeOnTop}},preset:{get:function(){return e.parent?e.getRoot().preset:n.load.preset},set:function(c){e.parent?e.getRoot().preset=c:n.load.preset=c,function(u){for(var p=0;p<u.__preset_select.length;p++)u.__preset_select[p].value===u.preset&&(u.__preset_select.selectedIndex=p)}(this),e.revert()}},width:{get:function(){return n.width},set:function(c){n.width=c,Bu(e,c)}},name:{get:function(){return n.name},set:function(c){n.name=c,a&&(a.innerHTML=n.name)}},closed:{get:function(){return n.closed},set:function(c){n.closed=c,n.closed?wt.addClass(e.__ul,i.CLASS_CLOSED):wt.removeClass(e.__ul,i.CLASS_CLOSED),this.onResize(),e.__closeButton&&(e.__closeButton.innerHTML=c?i.TEXT_OPEN:i.TEXT_CLOSED)}},load:{get:function(){return n.load}},useLocalStorage:{get:function(){return s},set:function(c){ko&&(s=c,c?wt.bind(window,"unload",o):wt.unbind(window,"unload",o),localStorage.setItem(Ls(e,"isLocal"),c))}}}),jt.isUndefined(n.parent)){if(this.closed=n.closed||!1,wt.addClass(this.domElement,i.CLASS_MAIN),wt.makeSelectable(this.domElement,!1),ko&&s){e.useLocalStorage=!0;var l=localStorage.getItem(Ls(this,"gui"));l&&(n.load=JSON.parse(l))}this.__closeButton=document.createElement("div"),this.__closeButton.innerHTML=i.TEXT_CLOSED,wt.addClass(this.__closeButton,i.CLASS_CLOSE_BUTTON),n.closeOnTop?(wt.addClass(this.__closeButton,i.CLASS_CLOSE_TOP),this.domElement.insertBefore(this.__closeButton,this.domElement.childNodes[0])):(wt.addClass(this.__closeButton,i.CLASS_CLOSE_BOTTOM),this.domElement.appendChild(this.__closeButton)),wt.bind(this.__closeButton,"click",function(){e.closed=!e.closed})}else{n.closed===void 0&&(n.closed=!0);var h=document.createTextNode(n.name);wt.addClass(h,"controller-name"),a=Fu(e,h),wt.addClass(this.__ul,i.CLASS_CLOSED),wt.addClass(a,"title"),wt.bind(a,"click",function(c){return c.preventDefault(),e.closed=!e.closed,!1}),n.closed||(this.closed=!1)}n.autoPlace&&(jt.isUndefined(n.parent)&&(U0&&(Rs=document.createElement("div"),wt.addClass(Rs,"dg"),wt.addClass(Rs,i.CLASS_AUTO_PLACE_CONTAINER),document.body.appendChild(Rs),U0=!1),Rs.appendChild(this.domElement),wt.addClass(this.domElement,i.CLASS_AUTO_PLACE)),this.parent||Bu(e,n.width)),this.__resizeHandler=function(){e.onResizeDebounced()},wt.bind(window,"resize",this.__resizeHandler),wt.bind(this.__ul,"webkitTransitionEnd",this.__resizeHandler),wt.bind(this.__ul,"transitionend",this.__resizeHandler),wt.bind(this.__ul,"oTransitionEnd",this.__resizeHandler),this.onResize(),n.resizable&&xS(this),o=function(){ko&&localStorage.getItem(Ls(e,"isLocal"))==="true"&&localStorage.setItem(Ls(e,"gui"),JSON.stringify(e.getSaveObject()))},this.saveToLocalStorageIfPossible=o,n.parent||((r=e.getRoot()).width+=1,jt.defer(function(){r.width-=1}))};function Fu(i,t,e){var n=document.createElement("li");return t&&n.appendChild(t),e?i.__ul.insertBefore(n,e):i.__ul.appendChild(n),i.onResize(),n}function G0(i){wt.unbind(window,"resize",i.__resizeHandler),i.saveToLocalStorageIfPossible&&wt.unbind(window,"unload",i.saveToLocalStorageIfPossible)}function ku(i,t){var e=i.__preset_select[i.__preset_select.selectedIndex];e.innerHTML=t?e.value+"*":e.value}function H0(i,t){var e=i.getRoot(),n=e.__rememberedObjects.indexOf(t.object);if(n!==-1){var r=e.__rememberedObjectIndecesToControllers[n];if(r===void 0&&(r={},e.__rememberedObjectIndecesToControllers[n]=r),r[t.property]=t,e.load&&e.load.remembered){var s=e.load.remembered,o=void 0;if(s[i.preset])o=s[i.preset];else{if(!s.Default)return;o=s.Default}if(o[n]&&o[n][t.property]!==void 0){var a=o[n][t.property];t.initialValue=a,t.setValue(a)}}}}function Uo(i,t,e,n){if(t[e]===void 0)throw new Error('Object "'+t+'" has no property "'+e+'"');var r=void 0;if(n.color)r=new Ou(t,e);else{var s=[t,e].concat(n.factoryArgs);r=gS.apply(i,s)}n.before instanceof Hr&&(n.before=n.before.__li),H0(i,r),wt.addClass(r.domElement,"c");var o=document.createElement("span");wt.addClass(o,"property-name"),o.innerHTML=r.property;var a=document.createElement("div");a.appendChild(o),a.appendChild(r.domElement);var l=Fu(i,a,n.before);return wt.addClass(l,qe.CLASS_CONTROLLER_ROW),r instanceof Ou?wt.addClass(l,"color"):wt.addClass(l,hS(r.getValue())),function(h,c,u){if(u.__li=c,u.__gui=h,jt.extend(u,{options:function(g){if(arguments.length>1){var _=u.__li.nextElementSibling;return u.remove(),Uo(h,u.object,u.property,{before:_,factoryArgs:[jt.toArray(arguments)]})}if(jt.isArray(g)||jt.isObject(g)){var v=u.__li.nextElementSibling;return u.remove(),Uo(h,u.object,u.property,{before:v,factoryArgs:[g]})}},name:function(g){return u.__li.firstElementChild.firstElementChild.innerHTML=g,u},listen:function(){return u.__gui.listen(u),u},remove:function(){return u.__gui.remove(u),u}}),u instanceof Nu){var p=new Il(u.object,u.property,{min:u.__min,max:u.__max,step:u.__step});jt.each(["updateDisplay","onChange","onFinishChange","step","min","max"],function(g){var _=u[g],v=p[g];u[g]=p[g]=function(){var M=Array.prototype.slice.call(arguments);return v.apply(p,M),_.apply(u,M)}}),wt.addClass(c,"has-slider"),u.domElement.insertBefore(p.domElement,u.domElement.firstElementChild)}else if(u instanceof Il){var f=function(g){if(jt.isNumber(u.__min)&&jt.isNumber(u.__max)){var _=u.__li.firstElementChild.firstElementChild.innerHTML,v=u.__gui.__listening.indexOf(u)>-1;u.remove();var M=Uo(h,u.object,u.property,{before:u.__li.nextElementSibling,factoryArgs:[u.__min,u.__max,u.__step]});return M.name(_),v&&M.listen(),M}return g};u.min=jt.compose(f,u.min),u.max=jt.compose(f,u.max)}else u instanceof L0?(wt.bind(c,"click",function(){wt.fakeEvent(u.__checkbox,"click")}),wt.bind(u.__checkbox,"click",function(g){g.stopPropagation()})):u instanceof F0?(wt.bind(c,"click",function(){wt.fakeEvent(u.__button,"click")}),wt.bind(c,"mouseover",function(){wt.addClass(u.__button,"hover")}),wt.bind(c,"mouseout",function(){wt.removeClass(u.__button,"hover")})):u instanceof Ou&&(wt.addClass(c,"color"),u.updateDisplay=jt.compose(function(g){return c.style.borderLeftColor=u.__color.toString(),g},u.updateDisplay),u.updateDisplay());u.setValue=jt.compose(function(g){return h.getRoot().__preset_select&&u.isModified()&&ku(h.getRoot(),!0),g},u.setValue)}(i,l,r),i.__controllers.push(r),r}function Ls(i,t){return document.location.href+"."+t}function Uu(i,t,e){var n=document.createElement("option");n.innerHTML=t,n.value=t,i.__preset_select.appendChild(n),e&&(i.__preset_select.selectedIndex=i.__preset_select.length-1)}function z0(i,t){t.style.display=i.useLocalStorage?"block":"none"}function yS(i){var t=i.__save_row=document.createElement("li");wt.addClass(i.domElement,"has-save"),i.__ul.insertBefore(t,i.__ul.firstChild),wt.addClass(t,"save-row");var e=document.createElement("span");e.innerHTML=" ",wt.addClass(e,"button gears");var n=document.createElement("span");n.innerHTML="Save",wt.addClass(n,"button"),wt.addClass(n,"save");var r=document.createElement("span");r.innerHTML="New",wt.addClass(r,"button"),wt.addClass(r,"save-as");var s=document.createElement("span");s.innerHTML="Revert",wt.addClass(s,"button"),wt.addClass(s,"revert");var o=i.__preset_select=document.createElement("select");if(i.load&&i.load.remembered?jt.each(i.load.remembered,function(c,u){Uu(i,u,u===i.preset)}):Uu(i,"Default",!1),wt.bind(o,"change",function(){for(var c=0;c<i.__preset_select.length;c++)i.__preset_select[c].innerHTML=i.__preset_select[c].value;i.preset=this.value}),t.appendChild(o),t.appendChild(e),t.appendChild(n),t.appendChild(r),t.appendChild(s),ko){var a=document.getElementById("dg-local-explain"),l=document.getElementById("dg-local-storage");document.getElementById("dg-save-locally").style.display="block",localStorage.getItem(Ls(0,"isLocal"))==="true"&&l.setAttribute("checked","checked"),z0(i,a),wt.bind(l,"change",function(){i.useLocalStorage=!i.useLocalStorage,z0(i,a)})}var h=document.getElementById("dg-new-constructor");wt.bind(h,"keydown",function(c){!c.metaKey||c.which!==67&&c.keyCode!==67||Rl.hide()}),wt.bind(e,"click",function(){h.innerHTML=JSON.stringify(i.getSaveObject(),void 0,2),Rl.show(),h.focus(),h.select()}),wt.bind(n,"click",function(){i.save()}),wt.bind(r,"click",function(){var c=prompt("Enter a new preset name.");c&&i.saveAs(c)}),wt.bind(s,"click",function(){i.revert()})}function xS(i){var t=void 0;function e(s){return s.preventDefault(),i.width+=t-s.clientX,i.onResize(),t=s.clientX,!1}function n(){wt.removeClass(i.__closeButton,qe.CLASS_DRAG),wt.unbind(window,"mousemove",e),wt.unbind(window,"mouseup",n)}function r(s){return s.preventDefault(),t=s.clientX,wt.addClass(i.__closeButton,qe.CLASS_DRAG),wt.bind(window,"mousemove",e),wt.bind(window,"mouseup",n),!1}i.__resize_handle=document.createElement("div"),jt.extend(i.__resize_handle.style,{width:"6px",marginLeft:"-3px",height:"200px",cursor:"ew-resize",position:"absolute"}),wt.bind(i.__resize_handle,"mousedown",r),wt.bind(i.__closeButton,"mousedown",r),i.domElement.insertBefore(i.__resize_handle,i.domElement.firstElementChild)}function Bu(i,t){i.domElement.style.width=t+"px",i.__save_row&&i.autoPlace&&(i.__save_row.style.width=t+"px"),i.__closeButton&&(i.__closeButton.style.width=t+"px")}function Ll(i,t){var e={};return jt.each(i.__rememberedObjects,function(n,r){var s={},o=i.__rememberedObjectIndecesToControllers[r];jt.each(o,function(a,l){s[l]=t?a.initialValue:a.getValue()}),e[r]=s}),e}qe.toggleHide=function(){Du=!Du,jt.each(B0,function(i){i.domElement.style.display=Du?"none":""})},qe.CLASS_AUTO_PLACE="a",qe.CLASS_AUTO_PLACE_CONTAINER="ac",qe.CLASS_MAIN="main",qe.CLASS_CONTROLLER_ROW="cr",qe.CLASS_TOO_TALL="taller-than-window",qe.CLASS_CLOSED="closed",qe.CLASS_CLOSE_BUTTON="close-button",qe.CLASS_CLOSE_TOP="close-top",qe.CLASS_CLOSE_BOTTOM="close-bottom",qe.CLASS_DRAG="drag",qe.DEFAULT_WIDTH=245,qe.TEXT_CLOSED="Close Controls",qe.TEXT_OPEN="Open Controls",qe._keydownHandler=function(i){document.activeElement.type==="text"||i.which!==72&&i.keyCode!==72||qe.toggleHide()},wt.bind(window,"keydown",qe._keydownHandler,!1),jt.extend(qe.prototype,{add:function(i,t){return Uo(this,i,t,{factoryArgs:Array.prototype.slice.call(arguments,2)})},addColor:function(i,t){return Uo(this,i,t,{color:!0})},remove:function(i){this.__ul.removeChild(i.__li),this.__controllers.splice(this.__controllers.indexOf(i),1);var t=this;jt.defer(function(){t.onResize()})},destroy:function(){if(this.parent)throw new Error("Only the root GUI should be removed with .destroy(). For subfolders, use gui.removeFolder(folder) instead.");this.autoPlace&&Rs.removeChild(this.domElement);var i=this;jt.each(this.__folders,function(t){i.removeFolder(t)}),wt.unbind(window,"keydown",qe._keydownHandler,!1),G0(this)},addFolder:function(i){if(this.__folders[i]!==void 0)throw new Error('You already have a folder in this GUI by the name "'+i+'"');var t={name:i,parent:this};t.autoPlace=this.autoPlace,this.load&&this.load.folders&&this.load.folders[i]&&(t.closed=this.load.folders[i].closed,t.load=this.load.folders[i]);var e=new qe(t);this.__folders[i]=e;var n=Fu(this,e.domElement);return wt.addClass(n,"folder"),e},removeFolder:function(i){this.__ul.removeChild(i.domElement.parentElement),delete this.__folders[i.name],this.load&&this.load.folders&&this.load.folders[i.name]&&delete this.load.folders[i.name],G0(i);var t=this;jt.each(i.__folders,function(e){i.removeFolder(e)}),jt.defer(function(){t.onResize()})},open:function(){this.closed=!1},close:function(){this.closed=!0},hide:function(){this.domElement.style.display="none"},show:function(){this.domElement.style.display=""},onResize:function(){var i=this.getRoot();if(i.scrollable){var t=wt.getOffset(i.__ul).top,e=0;jt.each(i.__ul.childNodes,function(n){i.autoPlace&&n===i.__save_row||(e+=wt.getHeight(n))}),window.innerHeight-t-20<e?(wt.addClass(i.domElement,qe.CLASS_TOO_TALL),i.__ul.style.height=window.innerHeight-t-20+"px"):(wt.removeClass(i.domElement,qe.CLASS_TOO_TALL),i.__ul.style.height="auto")}i.__resize_handle&&jt.defer(function(){i.__resize_handle.style.height=i.__ul.offsetHeight+"px"}),i.__closeButton&&(i.__closeButton.style.width=i.width+"px")},onResizeDebounced:jt.debounce(function(){this.onResize()},50),remember:function(){if(jt.isUndefined(Rl)&&((Rl=new _S).domElement.innerHTML=mS),this.parent)throw new Error("You can only call remember on a top level GUI.");var i=this;jt.each(Array.prototype.slice.call(arguments),function(t){i.__rememberedObjects.length===0&&yS(i),i.__rememberedObjects.indexOf(t)===-1&&i.__rememberedObjects.push(t)}),this.autoPlace&&Bu(this,this.width)},getRoot:function(){for(var i=this;i.parent;)i=i.parent;return i},getSaveObject:function(){var i=this.load;return i.closed=this.closed,this.__rememberedObjects.length>0&&(i.preset=this.preset,i.remembered||(i.remembered={}),i.remembered[this.preset]=Ll(this)),i.folders={},jt.each(this.__folders,function(t,e){i.folders[e]=t.getSaveObject()}),i},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=Ll(this),ku(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(i){this.load.remembered||(this.load.remembered={},this.load.remembered.Default=Ll(this,!0)),this.load.remembered[i]=Ll(this),this.preset=i,Uu(this,i,!0),this.saveToLocalStorageIfPossible()},revert:function(i){jt.each(this.__controllers,function(t){this.getRoot().load.remembered?H0(i||this.getRoot(),t):t.setValue(t.initialValue),t.__onFinishChange&&t.__onFinishChange.call(t,t.getValue())},this),jt.each(this.__folders,function(t){t.revert(t)}),i||ku(this.getRoot(),!1)},listen:function(i){var t=this.__listening.length===0;this.__listening.push(i),t&&function e(n){n.length!==0&&vS.call(window,function(){e(n)}),jt.each(n,function(r){r.updateDisplay()})}(this.__listening)},updateDisplay:function(){jt.each(this.__controllers,function(i){i.updateDisplay()}),jt.each(this.__folders,function(i){i.updateDisplay()})}});var bS=qe,ES=function(){function i(t){this.player=t}return Object.defineProperty(i.prototype,"frameRate",{get:function(){return this.player.fps.value},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"drawFrames",{get:function(){return this.player.runtime.fps},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"drawCall",{get:function(){return this.player.runtime.drawCall},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"resolution",{get:function(){return this.player.config.resolution},set:function(t){this.player.updateConfig({resolution:t})},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"size",{get:function(){var t,e;return((t=this.player.view)===null||t===void 0?void 0:t.width)+"*"+((e=this.player.view)===null||e===void 0?void 0:e.height)},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"minFPS",{get:function(){return this.player.config.minFPS},set:function(t){this.player.updateConfig({minFPS:t})},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"maxFPS",{get:function(){return this.player.config.maxFPS},set:function(t){this.player.updateConfig({maxFPS:t})},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"autoResolution",{get:function(){return this.player.config.autoResolution},set:function(t){this.player.updateConfig({autoResolution:t})},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"autoFPS",{get:function(){return this.player.config.autoFPS},set:function(t){this.player.updateConfig({autoFPS:t})},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"backgroundColor",{get:function(){return this.player.config.transactionBgColor},set:function(t){this.player.updateConfig({transactionBgColor:t})},enumerable:!1,configurable:!0}),i}(),wS=function(){function i(t,e){var n;this.config=new ES(t),this.anchor=e,n=this.createControllerGUI(),this.gui=n[0],this.controller=n[1],this.createStats()}return i.prototype.createStats=function(){var t=this;this.stateId=setInterval(function(){t.controller.frameRate.updateDisplay(),t.controller.size.updateDisplay(),t.controller.minFPS.updateDisplay(),t.controller.drawFrames.updateDisplay(),t.controller.maxFPS.updateDisplay(),t.controller.resolution.updateDisplay(),t.controller.autoFps.updateDisplay(),t.controller.autoResolution.updateDisplay(),t.controller.drawCall.updateDisplay()},16)},i.prototype.createControllerGUI=function(){var t=new bS({autoPlace:!0,closed:!0});t.domElement.style.opacity=".6",t.domElement.style.transformOrigin="100% 0",t.domElement.style.transform="scale(1)",this.anchor.appendChild(t.domElement),t.domElement.style.position="absolute",t.domElement.style.right="0",t.domElement.style.top="0",t.domElement.style.zIndex="2";var e={frameRate:t.add(this.config,"frameRate"),drawFrames:t.add(this.config,"drawFrames"),drawCall:t.add(this.config,"drawCall"),size:t.add(this.config,"size"),minFPS:t.add(this.config,"minFPS",0,60),maxFPS:t.add(this.config,"maxFPS",0,60),resolution:t.add(this.config,"resolution",.5,8,.5),autoResolution:t.add(this.config,"autoResolution"),autoFps:t.add(this.config,"autoFPS"),transactionBgColor:t.addColor(this.config,"backgroundColor")};return[t,e]},i.prototype.destroy=function(){try{window.clearInterval(this.stateId),this.anchor.removeChild(this.gui.domElement),this.gui.destroy()}catch{}},i}(),TS=function(){function i(t){var e=this;this.tasks=[],this.isDestroy=!1,this.isScheduling=!1,this.schedule=function(){e.isScheduling=!0;var n=e.tasks.shift();n&&!e.isDestroy&&e.fn(n).then(function(){e.tasks.length>0?window.requestAnimationFrame(e.schedule):e.isScheduling=!1})},this.fn=t}return i.prototype.destroy=function(){this.isDestroy=!0},i.prototype.addTask=function(t){this.tasks.push(t),this.isScheduling||this.schedule()},i}(),SS=function(){function i(t){this.autoUnlock=Object.create(null),this.locks=Object.create(null),this.available=!1,this.available=t}return i.prototype.addLock=function(t,e){var n=this;this.available&&(this.locks[t]=e,this.autoUnlock[t]=window.setTimeout(function(){delete n.locks[t]},3e3))},i.prototype.unlock=function(t,e){this.available&&e&&this.locks[t]&&this.locks[t]===e&&(window.clearTimeout(this.autoUnlock[t]),delete this.locks[t])},i.prototype.isLocked=function(t){return!!this.available&&!!this.locks[t]},i}(),MS=function(){function i(){var t=this;this.tasks=[],this.isDestroy=!1,this.isScheduling=!1,this.schedule=function(){t.isScheduling=!0;var e=t.tasks.shift();e&&!t.isDestroy&&(e.status="running",e.fn.apply(null).then(function(){t.tasks.length>0?window.requestAnimationFrame(t.schedule):t.isScheduling=!1}).catch(function(){t.tasks.length>0?window.requestAnimationFrame(t.schedule):t.isScheduling=!1}))}}return i.prototype.getRunningTask=function(){return this.tasks[0]&&this.tasks[0].status==="running"?this.tasks[0]:null},i.prototype.addTask=function(t,e){var n={type:t,status:"wait",fn:e},r=this.getRunningTask();r&&t===r.type||(this.tasks=this.tasks.filter(function(s){return s.type!==t}),this.tasks.push(n),this.isScheduling||this.schedule())},i.prototype.destroy=function(){this.isDestroy=!0},i}(),AS=function(i,t,e,n){return new(e||(e=Promise))(function(r,s){function o(h){try{l(n.next(h))}catch(c){s(c)}}function a(h){try{l(n.throw(h))}catch(c){s(c)}}function l(h){var c;h.done?r(h.value):(c=h.value,c instanceof e?c:new e(function(u){u(c)})).then(o,a)}l((n=n.apply(i,t||[])).next())})},PS=function(i,t){var e,n,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(l){return function(h){return function(c){if(e)throw new TypeError("Generator is already executing.");for(;o;)try{if(e=1,n&&(r=2&c[0]?n.return:c[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,c[1])).done)return r;switch(n=0,r&&(c=[2&c[0],r.value]),c[0]){case 0:case 1:r=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,n=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(r=o.trys,!((r=r.length>0&&r[r.length-1])||c[0]!==6&&c[0]!==2)){o=0;continue}if(c[0]===3&&(!r||c[1]>r[0]&&c[1]<r[3])){o.label=c[1];break}if(c[0]===6&&o.label<r[1]){o.label=r[1],r=c;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(c);break}r[2]&&o.ops.pop(),o.trys.pop();continue}c=t.call(i,o)}catch(u){c=[6,u],n=0}finally{e=r=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([l,h])}}};function CS(i,t,e){return AS(this,void 0,void 0,function(){var n,r,s,o;return PS(this,function(a){switch(a.label){case 0:return n=document.createElement("div"),(r=new Go({anchor:n,renderOptions:{minFPS:1,maxFPS:1,resolution:1},mode:"local",interactive:!1})).setResource(i,t),[4,r.getSlideCountAsync()];case 1:if(s=a.sent(),e)return[3,6];o=1,a.label=2;case 2:return o<=s?[4,r.player.stagePool.preload(o,!0)]:[3,5];case 3:a.sent(),a.label=4;case 4:return o++,[3,2];case 5:return[3,6];case 6:return r.destroy(),[2]}})})}var IS=function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(n[s]=r[s])})(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Bo=function(){return(Bo=Object.assign||function(i){for(var t,e=1,n=arguments.length;e<n;e++)for(var r in t=arguments[e])Object.prototype.hasOwnProperty.call(t,r)&&(i[r]=t[r]);return i}).apply(this,arguments)},RS=function(i,t,e,n){var r,s=arguments.length,o=s<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,t,e,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(o=(s<3?r(o):s>3?r(t,e,o):r(t,e))||o);return s>3&&o&&Object.defineProperty(t,e,o),o},Yn=function(i,t,e,n){return new(e||(e=Promise))(function(r,s){function o(h){try{l(n.next(h))}catch(c){s(c)}}function a(h){try{l(n.throw(h))}catch(c){s(c)}}function l(h){var c;h.done?r(h.value):(c=h.value,c instanceof e?c:new e(function(u){u(c)})).then(o,a)}l((n=n.apply(i,t||[])).next())})},qn=function(i,t){var e,n,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(l){return function(h){return function(c){if(e)throw new TypeError("Generator is already executing.");for(;o;)try{if(e=1,n&&(r=2&c[0]?n.return:c[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,c[1])).done)return r;switch(n=0,r&&(c=[2&c[0],r.value]),c[0]){case 0:case 1:r=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,n=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(r=o.trys,!((r=r.length>0&&r[r.length-1])||c[0]!==6&&c[0]!==2)){o=0;continue}if(c[0]===3&&(!r||c[1]>r[0]&&c[1]<r[3])){o.label=c[1];break}if(c[0]===6&&o.label<r[1]){o.label=r[1],r=c;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(c);break}r[2]&&o.ops.pop(),o.trys.pop();continue}c=t.call(i,o)}catch(u){c=[6,u],n=0}finally{e=r=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([l,h])}}},LS=window.ResizeObserver||iS,Gu=function(i){return new Promise(function(t){return setTimeout(t,i)})};function NS(i,t){return Yn(this,void 0,void 0,function(){var e;return qn(this,function(n){switch(n.label){case 0:e=Date.now(),n.label=1;case 1:return!i()&&Date.now()-e<t?[4,Gu(50)]:[3,3];case 2:return n.sent(),e=Date.now(),[3,1];case 3:return[2]}})})}var ti={syncDispatch:"syncDispatch",syncReceive:"syncReceive",syncEventLag:"syncEventLag",renderStart:"renderStart",renderEnd:"renderEnd",renderError:"renderError",slideChange:"slideChange",mainSeqStepStart:"mainSeqStepStart",mainSeqStepEnd:"mainSeqStepEnd",animateStart:"animateStart",animateEnd:"animateEnd",stateChange:"stateChange"},j0={taskId:"",url:"",currentSlideIndex:-1,mainSeqStep:-1,mainSeqState:null,mediaState:Object.create(null),interactiveSeqState:Object.create(null)},Hu="";try{Hu="0.7.3"}catch{Hu="dev"}var bi=null;try{bi=S.createInstance({name:"__slide_local_log__",driver:S.INDEXEDDB,version:1})}catch{}var Go=function(i){function t(r){var s=i.call(this)||this;return s.iosResetCache=[],s.needClearCacheImage=!1,s.version=Hu,s.__slideState=p0()(j0),s.userInputTime=0,s.isSyncingSlideState=!1,s.frozenTaskManager=new MS,s.randomId=T(),s.resize=!1,s.isAnimating=!1,s.renderingTaskManager=new aS,s.isLoading=!1,s.interactive=!0,s.renderingIndex=0,s.frameWidth=1,s.frameHeight=1,s.frame=document.createElement("div"),s.canvasContainer=document.createElement("div"),s.medianController=document.createElement("div"),s.frameResizeObserver=new LS(function(){return s.frameResizeHandler()}),s.timestamp=function(){return Date.now()},s.mode="local",s.enableGlobalClick=!1,s.lastEmitedState=null,s.playerController=null,s.isInitResized=!1,s.cacheImage=document.createElement("img"),s.isTouchStart=!1,s.touchStartId=void 0,s.taskId="",s.volumeAdjuster=new zT,s.designWidth=0,s.designHeight=0,s._slideCount=0,s._dispatchIncrId=0,s._receiveIncrId=0,s.recoverHandler=function(o){if(o.data.type==="@slide/_recover_"&&o.data.slideId===s.randomId){var a=o.data,l=a.recoverBy,h=a.payload;if(!h)return;l==="renderOtherPage"&&h.slideIndex?s.renderSlide(h.slideIndex):l==="reloadCurrentPage"&&s.renderSlide(s.renderingIndex)}},s.userInputHandle=function(){s.userInputTime=Date.now()},s.handleViewClick=function(){setTimeout(function(){var o=Date.now();Math.abs(o-s.userInputTime)>500&&s.enableGlobalClick&&s.nextStep()})},s.handleViewTouchStart=function(){window.clearTimeout(s.touchStartId),s.isTouchStart=!0,s.touchStartId=setTimeout(function(){s.isTouchStart=!1},350)},s.handleViewTouchEnd=function(){s.isTouchStart&&(s.isTouchStart=!1,s.handleViewClick())},s.handleSlideRef=function(){console.log(s),window.__slide=s},s.receiveSyncHandler=function(o){return Yn(s,void 0,void 0,function(){var a,l,h,c,u=this;return qn(this,function(p){switch(p.label){case 0:return kr()(o.incrId)&&(o.incrId&&o.incrId-this._receiveIncrId!=1&&this.emit(ti.syncEventLag),this._receiveIncrId=o.incrId||0),this.logger.info("sync receive "+JSON.stringify(o),this.taskId),o.type!=="nextStep"?[3,1]:(this.mainSeqStep!==o.next-1&&this.mainSeqStep+1!==this.mainSeqLength&&this.player?(this.setMainSeqStep(o.next,"start"),this.player.nextTick(function(){u.doNextStep(!0)})):this.doNextStep(!0),[3,6]);case 1:return o.type!=="prevStep"?[3,2]:(this.mainSeqStep===0&&this.mainSeqState==="idle"||this.mainSeqStep===o.next+1||this.mainSeqStep+1===this.mainSeqLength?this.doPrevStep(!0):(this.setMainSeqStep(o.next+1,"start"),(a=this.player)===null||a===void 0||a.nextTick(function(){u.doPrevStep(!0)})),[3,6]);case 2:return o.type!=="interactiveAnim"?[3,3]:(this.player?this.player.applyInteractiveAction(o.action):this.__slideState.interactiveSeqState[o.seqId]?this.__slideState.interactiveSeqState[o.seqId].step+=1:this.__slideState.interactiveSeqState[o.seqId]={step:0,state:"end"},[3,6]);case 3:return o.type!=="renderSlide"?[3,5]:[4,this.doRenderSlide(o.index,o.isForward)];case 4:return p.sent(),[3,6];case 5:o.type==="mediaPlay"?((l=this.player)===null||l===void 0||l.setMediaState(o.id,!0),this.__slideState.mediaState[o.id]=o.state):o.type==="mediaPause"?((h=this.player)===null||h===void 0||h.setMediaState(o.id,!1),this.__slideState.mediaState[o.id]=o.state):o.type==="mediaSeek"&&((c=this.player)===null||c===void 0||c.setMediaCurrentTime(o.id,o.time),this.__slideState.mediaState[o.id]=o.state),p.label=6;case 6:return[2]}})})},s.handlePrevSlide=function(o){return o===void 0&&(o=!1),Yn(s,void 0,void 0,function(){var a;return qn(this,function(l){return this.player?((a=this.player.prevSlideIndex)>=1&&(this.config.navigatorDelegate?this.config.navigatorDelegate.gotoPage(a):o?this.doRenderSlide(a,!1):this.renderSlide(a,!1)),[2]):[2]})})},s.handleNextSlide=function(o){return o===void 0&&(o=!1),Yn(s,void 0,void 0,function(){var a;return qn(this,function(l){return this.player?((a=this.player.nextSlideIndex)<=this.slideCount&&(this.config.navigatorDelegate?this.config.navigatorDelegate.gotoPage(a):o?this.doRenderSlide(a,!0):this.renderSlide(a,!0)),[2]):[2]})})},s.handleGotoSlide=function(o){if(o<=s.slideCount&&o>=1){var a=s.slideState.currentSlideIndex<=o;s.renderSlide(o,a)}else o===-1&&s.renderSlide(s.slideCount,!0)},s.config=s.initSlideConfig(r),s.logger={info:function(o,a){var l;t._tempLog+="INFO - "+new Date().toISOString()+" - {"+s.randomId+"}["+a+"] "+o+`
|
|
5999
5999
|
`;var h=(l=s.config.logger)===null||l===void 0?void 0:l.info;h&&h("["+a+"] "+o)},warn:function(o,a){var l;t._tempLog+="WARN - "+new Date().toISOString()+" - {"+s.randomId+"}["+a+"] "+o+`
|
|
6000
6000
|
`;var h=(l=s.config.logger)===null||l===void 0?void 0:l.warn;h&&h("["+a+"] "+o)},error:function(o,a){var l;t._tempLog+="ERROR - "+new Date().toISOString()+" - {"+s.randomId+"}["+a+"] "+o+`
|
|
6001
|
-
`;var h=(l=s.config.logger)===null||l===void 0?void 0:l.error;h&&h("["+a+"] "+o)}},s.logger.info("new slide",s.taskId),s.anchor=s.config.anchor,s.syncQueue=new TS(s.receiveSyncHandler),s.lock=new SS(s.mode==="interactive"),s.cacheImage.style.position="absolute",s.cacheImage.style.zIndex="100",s.setMedianControllerAttribute(),s.canvasContainer.style.position="relative",s.canvasContainer.appendChild(s.medianController),s.frame.appendChild(s.canvasContainer),s.frameResizeObserver.observe(s.frame),s.on(ti.syncReceive,function(o){s.lock.unlock(o.type,o.uuid),s.syncQueue.addTask(o)}),s.renderingTaskManager.eventHub.on("task-error",function(o){var a=o.error,l=o.task,h=ln.transform(a);h.errorType===In.RuntimeWarn?s.logger.warn(h.message,s.taskId):s.logger.error(h.message,s.taskId),s.isLoading=!1,s.reportError(h,l.slideIndex)}),window.addEventListener("__slide_ref__",s.handleSlideRef),s.resizeView=du()(s.resizeView.bind(s),50),s.player=s.initPlayer(s.config),s.config.controller&&s.createController(),s.player.view&&s.canvasContainer.appendChild(s.player.view),s.handleViewClick=du()(s.handleViewClick,300),s.player.errorChannel.on("error",function(o,a){var l=ln.transform(o);l.errorType===In.RuntimeWarn?s.logger.warn(l.message,s.taskId):s.logger.error(l.message,s.taskId),s.isLoading=!1,a===s.renderingIndex&&s.reportError(o,a)}),window.addEventListener("message",s.recoverHandler),s}var e,n;return IS(t,i),t.flushLog=function(r){return r===void 0&&(r=!1),Yn(this,void 0,void 0,function(){return qn(this,function(s){switch(s.label){case 0:return t._tempLog.length>131072||r&&t._tempLog.length>0?[4,bi==null?void 0:bi.setItem("run_time_log_"+t._tempLogIndex,t._tempLog)]:[3,2];case 1:s.sent(),t._tempLog="",t._tempLogIndex+=1,s.label=2;case 2:return[2]}})})},Object.defineProperty(t.prototype,"dispatchIncrId",{get:function(){return this._dispatchIncrId++},enumerable:!1,configurable:!0}),t.prototype.reportError=function(r,s){this.emit(ti.renderError,{error:r,index:s}),window.postMessage({type:"@slide/_error_",errorType:r.errorType,errorMsg:r.errorMsg,slideId:this.randomId,slideIndex:s,customMessage:"@slide/_error_"},"*")},t.prototype.initSlideConfig=function(r){return r.timestamp&&(this.timestamp=r.timestamp),r.rtcAudio&&(gn.RtcAudioClazz=r.rtcAudio),this.mode=r.mode,this.anchor=r.anchor,this.anchor.appendChild(this.frame),this.enableGlobalClick=!Sn()(r.enableGlobalClick)&&r.enableGlobalClick,this.resize=r.resize||!1,this.interactive=r.interactive,this.frame.style.cssText=r.fixedFrameSize?"width:"+r.fixedFrameSize.width+"px;height:"+r.fixedFrameSize.height+"px;":"width:100%;height:100%",this.frame.style.cssText+="display:flex;justify-content:center;align-items:center;visibility:hidden;position:relative;z-index:1;",r.fixedFrameSize&&(this.frameWidth=r.fixedFrameSize.width,this.frameHeight=r.fixedFrameSize.height),r},t.prototype.initPlayer=function(r){var s,o,a,l=this,h=new gn({mode:this.mode,useLocalCache:!!Sn()(this.config.useLocalCache)||this.config.useLocalCache,logger:this.logger,resourceTimeout:Sn()(this.config.resourceTimeout)?15e3:this.config.resourceTimeout,loadDelegate:this.config.loaderDelegate,volumeAdjuster:this.volumeAdjuster});return h.setInteractive(this.interactive),h.updateConfig(r.renderOptions||{}),h.on(de.renderStart,function(c){l.isLoading=!0,l.emit(ti.renderStart,c)}),h.on(de.renderEnd,function(c){l.isLoading=!1,l.player&&(l.designHeight=l.player.designHeight,l.designWidth=l.player.designWidth,l.cacheImage.style.width=l.player.designWidth+"px",l.cacheImage.style.height=l.player.designHeight+"px",l._slideCount=l.player.slideCount),l.emit(ti.renderEnd,c)}),h.on(de.slideChange,function(c){l.__slideState.currentSlideIndex=c,l.emitStateChange(),l.emit(ti.slideChange,c)}),h.on(de.mainSeqStateChange,function(c){l.__slideState.mainSeqState=c,l.emitStateChange()}),h.on(de.mainSeqStepChange,function(c){l.__slideState.mainSeqStep=c,l.emitStateChange()}),h.on(de.interactiveSeqStateChange,function(c){var u=c.id,p=c.state;l.__slideState.interactiveSeqState[u]=p,l.emitStateChange()}),h.on(de.animateStart,function(){l.isAnimating!==!0&&(l.isAnimating=!0,l.emit(ti.animateStart))}),h.on(de.animateEnd,function(){l.isAnimating!==!1&&(l.isAnimating=!1,l.emit(ti.animateEnd))}),h.on(de.interactiveSeqAction,function(c){var u=c.action,p=c.seqId;l.emitSyncDispatch({slideIndex:l.__slideState.currentSlideIndex,type:"interactiveAnim",action:u,seqId:p}),l.emitStateChange()}),h.on(de.mainSeqStepStart,function(c){l.emit(ti.mainSeqStepStart,c)}),h.on(de.mainSeqStepEnd,function(c){l.emit(ti.mainSeqStepEnd,c)}),h.on(de.mediaPlay,function(c){var u={type:"play",time:l.timestamp()-1e3*c.time};l.__slideState.mediaState[c.id]=u,l.emitSyncDispatch({slideIndex:l.__slideState.currentSlideIndex,type:"mediaPlay",id:c.id,state:u}),l.emitStateChange()}),h.on(de.mediaPause,function(c){var u={type:"pause",time:c.time};l.__slideState.mediaState[c.id]=u,l.emitSyncDispatch({slideIndex:l.__slideState.currentSlideIndex,type:"mediaPause",id:c.id,state:u}),l.emitStateChange()}),h.on(de.mediaSeek,function(c){var u={type:"pause",time:0};c.isPlaying?(u.type="play",l.__slideState.mediaState[c.id]?u.time=l.__slideState.mediaState[c.id].time-1e3*c.time:u.time=l.timestamp()-1e3*c.time,l.__slideState.mediaState[c.id]=u):(u.type="pause",u.time=c.time,l.__slideState.mediaState[c.id]=u),l.emitSyncDispatch({slideIndex:l.__slideState.currentSlideIndex,type:"mediaSeek",id:c.id,time:c.time,state:u}),l.emitStateChange()}),h.on(de.requestPrevSlide,function(c){l.handlePrevSlide(c)}),h.on(de.requestNextSlide,function(c){l.handleNextSlide(c)}),h.on(de.requestGotoSlide,function(c){l.config.navigatorDelegate?l.config.navigatorDelegate.gotoPage(c):l.handleGotoSlide(c)}),(s=h.view)===null||s===void 0||s.addEventListener("touchend",this.handleViewTouchEnd),(o=h.view)===null||o===void 0||o.addEventListener("touchstart",this.handleViewTouchStart),(a=h.view)===null||a===void 0||a.addEventListener("click",this.handleViewClick),h.on(de.userInput,this.userInputHandle),h},t.prototype.createController=function(){this.player&&(this.playerController=new wS(this.player,this.frame))},t.prototype.setMedianControllerAttribute=function(){this.medianController.className="median-container",this.medianController.style.position="absolute",this.medianController.style.left="0",this.medianController.style.top="0",this.medianController.style.zIndex="2"},t.prototype.frameResizeHandler=function(){if(!this.config.fixedFrameSize){var r=this.frame.getBoundingClientRect(),s=r.width,o=r.height;this.frameWidth=s,this.frameHeight=o,this.resizeView()}},t.prototype.updateFixedFrameSize=function(r,s,o){this.config.fixedFrameSize&&(this.frameWidth=r,this.frameHeight=s,this.frame.style.width=r+"px",this.frame.style.height=s+"px",this.resizeView(o))},t.prototype.resizeView=function(r){var s,o,a=this,l=this.width,h=this.height;if(l>0&&h>0){var c=this.frameWidth/l,u=c*h;u>this.frameHeight&&(c*=this.frameHeight/u),(s=this.player)===null||s===void 0||s.scaleView(c,this.resize,r),this.cacheImage.style.transform="scale("+c+")",this.medianController.style.transform="scale("+c+")",this.medianController.setAttribute("data-scale",c.toString()),this.isInitResized||(this.isInitResized=!0,(o=this.player)===null||o===void 0||o.clock.setTimeout(function(){a.frame.style.visibility="visible"},32))}},t.prototype.setSlideState=function(r){var s,o,a;return Yn(this,void 0,void 0,function(){var l,h=this;return qn(this,function(c){switch(c.label){case 0:return this.isSyncingSlideState=!0,this.logger.info("stateChange receive "+JSON.stringify(r),this.taskId),r.taskId&&r.taskId!==this.__slideState.taskId&&(this.__slideState.taskId=r.taskId,(s=this.player)===null||s===void 0||s.setResourceData(r.taskId,this.__slideState.url)),r.url&&r.url!==this.__slideState.url&&(this.__slideState.url=r.url,(o=this.player)===null||o===void 0||o.setResourceData(this.__slideState.taskId,r.url)),Number.isInteger(r.currentSlideIndex)&&r.currentSlideIndex!==this.__slideState.currentSlideIndex?(this.__slideState.currentSlideIndex=r.currentSlideIndex,[4,this.doRenderSlide(r.currentSlideIndex)]):[3,2];case 1:c.sent(),c.label=2;case 2:return[4,(a=this.player)===null||a===void 0?void 0:a.clock.waitUntil(function(){var u,p;return((u=h.player)===null||u===void 0?void 0:u.currentIndex)===r.currentSlideIndex&&((p=h.player)===null||p===void 0?void 0:p.currentStage)},3e3)];case 3:return c.sent(),l=!1,Number.isInteger(r.mainSeqStep)&&r.mainSeqStep!==this.__slideState.mainSeqStep&&(l=!0,this.__slideState.mainSeqStep=r.mainSeqStep),r.mainSeqState&&r.mainSeqState!==this.__slideState.mainSeqState&&(l=!0,this.__slideState.mainSeqState=r.mainSeqState),l&&this.setMainSeqStep(this.__slideState.mainSeqStep,this.__slideState.mainSeqState==="idle"?"start":"end"),r.mediaState&&(this.initMedia(r),this.__slideState.mediaState=r.mediaState),r.interactiveSeqState&&(this.initInteractiveSeq(r),this.__slideState.interactiveSeqState=r.interactiveSeqState),this.isSyncingSlideState=!1,[2]}})})},t.prototype.initInteractiveSeq=function(r){var s;for(var o in r.interactiveSeqState){var a=r.interactiveSeqState[o];(s=this.player)===null||s===void 0||s.setInteractiveSeqState(o,a.step,a.state==="idle"?"start":"end")}},t.prototype.initMedia=function(r){var s,o,a=this,l=function(u){var p=r.mediaState[u],f=h.__slideState.mediaState[u];if(f&&p.type===f.type&&p.time===f.time)return"continue";p.type==="play"?(s=h.player)===null||s===void 0||s.setMediaState(u,!0).then(function(){var g,_=a.timestamp();(g=a.player)===null||g===void 0||g.setMediaCurrentTime(u,(_-p.time)/1e3)}):(o=h.player)===null||o===void 0||o.setMediaState(u,!1).then(function(){var g;(g=a.player)===null||g===void 0||g.setMediaCurrentTime(u,p.time)})},h=this;for(var c in r.mediaState)l(c)},Object.defineProperty(t.prototype,"slideCount",{get:function(){return this._slideCount},enumerable:!1,configurable:!0}),t.prototype.getSizeAsync=function(){return Yn(this,void 0,void 0,function(){var r;return qn(this,function(s){switch(s.label){case 0:if(this.width>0&&this.height>0)return[2,[this.width,this.height]];s.label=1;case 1:return s.trys.push([1,4,,5]),[4,fetch(this.__slideState.url+"/"+this.__slideState.taskId+"/jsonOutput/slide-1.json")];case 2:return[4,s.sent().json()];case 3:return[2,[(r=s.sent()).width,r.height]];case 4:return s.sent(),[2,[0,0]];case 5:return[2]}})})},t.prototype.getSlideCountAsync=function(){return Yn(this,void 0,void 0,function(){return qn(this,function(r){switch(r.label){case 0:if(this._slideCount>0)return[2,this._slideCount];r.label=1;case 1:return r.trys.push([1,4,,5]),[4,fetch(this.__slideState.url+"/"+this.__slideState.taskId+"/jsonOutput/slide-1.json")];case 2:return[4,r.sent().json()];case 3:return[2,r.sent().slideCount];case 4:return r.sent(),[2,0];case 5:return[2]}})})},Object.defineProperty(t.prototype,"slideState",{get:function(){return this.__slideState.mainSeqState=this.mainSeqState,this.__slideState.mainSeqStep=this.mainSeqStep,JSON.parse(JSON.stringify(this.__slideState))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mainSeqLength",{get:function(){var r;return((r=this.player)===null||r===void 0?void 0:r.mainSeqLength())||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mainSeqStep",{get:function(){var r;return((r=this.player)===null||r===void 0?void 0:r.mainSeqStep())||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mainSeqState",{get:function(){var r;return((r=this.player)===null||r===void 0?void 0:r.mainSeqState())||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderOptions",{get:function(){var r;return((r=this.player)===null||r===void 0?void 0:r.config)||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"drawCall",{get:function(){var r;return((r=this.player)===null||r===void 0?void 0:r.runtime.drawCall)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderFps",{get:function(){var r;return((r=this.player)===null||r===void 0?void 0:r.runtime.fps)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"runtimeFps",{get:function(){var r;return((r=this.player)===null||r===void 0?void 0:r.fps.value)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"view",{get:function(){var r;return((r=this.player)===null||r===void 0?void 0:r.view)||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.designWidth},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.designHeight},enumerable:!1,configurable:!0}),t.prototype.updateRenderOption=function(r){this.player&&(this.player.updateConfig(r),this.renderOptions&&(this.config.renderOptions=this.renderOptions))},t.prototype.setResource=function(r,s){var o;this.taskId=r,(o=this.player)===null||o===void 0||o.setResourceData(r,s),this.__slideState.taskId=r,this.__slideState.url=s,this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"setResource",taskId:r,url:s})},t.prototype._renderSlide=function(r){var s;return Yn(this,void 0,void 0,function(){var o=this;return qn(this,function(a){switch(a.label){case 0:return this.renderingIndex=r,this.player&&r===this.player.currentIndex?[2]:((gn.platform.isIOS()||gn.platform.isAndroid())&&this.iosResetCache.indexOf(r)<0&&this.iosResetCache.push(r),[4,(s=this.player)===null||s===void 0?void 0:s.renderSlide(r)]);case 1:return a.sent(),this.__slideState.currentSlideIndex=r,this.resizeView(),this.__slideState.interactiveSeqState={},this.emitStateChange(),setTimeout(function(){var l,h;if(((h=(l=o.player)===null||l===void 0?void 0:l.view)===null||h===void 0?void 0:h.style.visibility)==="hidden"&&(o.player.view.style.visibility="visible"),o.frame.style.visibility==="hidden"&&(o.frame.style.visibility="visible"),o.needClearCacheImage)try{o.frame.removeChild(o.cacheImage)}catch{}},100),[2]}})})},t.prototype.renderSlide=function(r,s){if(s===void 0&&(s=!0),this.player){var o=Number(r);(o!==this.player.currentIndex||this.renderingTaskManager.hasStartTask())&&(o>this.slideCount&&this.slideCount>0||this.poseRenderSlide(o,s))}},t.prototype.needCreateNewPlayer=function(){var r=gn.platform.isLowGpuMemory()?15:30;return(gn.platform.isIOS()||gn.platform.isAndroid())&&this.iosResetCache.length>r},t.prototype.poseRenderSlide=function(r,s){this.mode==="interactive"?this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"renderSlide",index:r,isForward:s}):this.mode==="sync"?(this.doRenderSlide(r,s),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"renderSlide",index:r,isForward:s})):this.doRenderSlide(r,s)},t.prototype.doRenderSlide=function(r,s){var o,a,l,h=this;if(s===void 0&&(s=!0),!this.player)return Promise.resolve();if(this.needCreateNewPlayer()&&(this.iosResetCache=[],this.iosNewPlayer=this.initPlayer(this.config),this.iosNewPlayer.setResourceData(this.__slideState.taskId,this.__slideState.url)),this.iosNewPlayer){var c=this.player.getSnapshot();this.cacheImage.src=c,this.frame.appendChild(this.cacheImage),this.player.destroy(),(o=this.playerController)===null||o===void 0||o.destroy(),this.player=this.iosNewPlayer,this.iosNewPlayer=void 0,!((a=this.config)===null||a===void 0)&&a.controller&&this.createController(),this.needClearCacheImage=!0,!((l=this==null?void 0:this.player)===null||l===void 0)&&l.view&&(this.player.view.style.visibility="hidden",this.canvasContainer.appendChild(this.player.view))}var u=Math.random().toString(32).substr(2);return this.player.isForward=s,this.renderingTaskManager.addTask(function(){return h._renderSlide(r)},r,u),new Promise(function(p){h.renderingTaskManager.eventHub.once("task-end-"+u,p)})},t.prototype.nextStep=function(){!this.isLoading&&this.player&&this.interactive?this.player.mainSeqHasNextStep()?this.mode==="interactive"?this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"nextStep",next:this.player.mainSeqStep()+1}):this.mode==="sync"?(this.doNextStep(),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"nextStep",next:this.player.mainSeqStep()})):this.doNextStep():this.handleNextSlide():this.logger.info("prevent nextStep. "+this.isLoading+" "+this.player+" "+this.interactive,this.taskId)},t.prototype.doNextStep=function(r){if(r===void 0&&(r=!1),this.player){this.player.nextStep(r);var s=this.player.mainSeqStep();this.__slideState.mainSeqStep=s,this.emitStateChange()}},t.prototype.prevStep=function(){!this.isLoading&&this.player&&this.interactive?this.player.mainSeqHasPrevStep()?this.mode==="interactive"?this.emitSyncDispatch({type:"prevStep",slideIndex:this.__slideState.currentSlideIndex,next:this.player.mainSeqStep()-1}):this.mode==="sync"?(this.doPrevStep(),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"prevStep",next:this.player.mainSeqStep()})):this.doPrevStep():this.handlePrevSlide():this.logger.info("prevent nextStep. "+this.isLoading+" "+this.player+" "+this.interactive,this.taskId)},t.prototype.doPrevStep=function(r){if(r===void 0&&(r=!1),this.player){this.player.prevStep(r);var s=this.player.mainSeqStep();this.__slideState.mainSeqStep=s,this.emitStateChange()}},t.prototype.isSlideStateReady=function(r){return r.taskId.length>0&&r.url.length>0&&r.currentSlideIndex>0},t.prototype.emitStateChange=function(){if(this.mode!=="local"&&!this.isSyncingSlideState){var r=this.slideState;!WT()(this.lastEmitedState,r)&&this.isSlideStateReady(r)&&(this.lastEmitedState=r,this.emit(ti.stateChange,r),this.logger.info("stateChange dispatch "+JSON.stringify(this.slideState),this.taskId))}},t.prototype.emitSyncDispatch=function(r){if(!this.lock.isLocked(r.type)){var s=Math.random().toString(32).substr(2);this.lock.addLock(r.type,s);var o=Bo(Bo({},r),{uuid:s});this.config.mode==="sync"&&(o.incrId=this.dispatchIncrId),this.emit(ti.syncDispatch,o),this.logger.info("sync dispatch "+JSON.stringify(o),this.taskId)}},t.prototype.setMainSeqStep=function(r,s){var o;(o=this.player)===null||o===void 0||o.setMainSeqStep(r,s)},t.prototype.setInteractive=function(r){var s;this.interactive=r,(s=this.player)===null||s===void 0||s.setInteractive(r)},t.prototype.pause=function(){var r;(r=this.player)===null||r===void 0||r.pause()},t.prototype.resume=function(){var r;(r=this.player)===null||r===void 0||r.resume()},t.prototype._doFrozen=function(){var r;return Yn(this,void 0,void 0,function(){var s,o,a,l=this;return qn(this,function(h){switch(h.label){case 0:return this.logger.info("frozen with player["+!!this.player+"]",this.taskId),this.view&&this.player?[4,this.player.clock.waitUntil(function(){return!l.isLoading},6e4)]:[3,2];case 1:for(o in h.sent(),s=this.player.getSnapshot()||"",this.cacheImage.src=s,this.frame.appendChild(this.cacheImage),this.player.destroy(),(r=this.playerController)===null||r===void 0||r.destroy(),this.player=void 0,this.__slideState.mediaState)a=this.__slideState.mediaState[o],this.__slideState.mediaState[o]=Bo(Bo({},a),{frozenTime:this.timestamp()});h.label=2;case 2:return[2]}})})},t.prototype.frozen=function(){var r=this;this.frozenTaskManager.addTask("frozen",function(){return r._doFrozen()})},t.prototype._doRelease=function(){var r,s;return Yn(this,void 0,void 0,function(){var o,a,l,h;return qn(this,function(c){switch(c.label){case 0:if(this.logger.info("do release slide",this.taskId),this.player)return[2];for(a in this.player=this.initPlayer(this.config),!((r=this.config)===null||r===void 0)&&r.controller&&this.createController(),this.player.view&&(this.canvasContainer.appendChild(this.player.view),this.player.view.style.visibility="hidden"),o=this.__slideState,this.__slideState=p0()(j0),o.mediaState)(l=o.mediaState[a]).type==="play"&&(h=Math.max((s=l.frozenTime)!==null&&s!==void 0?s:0,l.time),l.time=this.timestamp()-(h-l.time),l.frozenTime=void 0);return[4,this.setSlideState(o)];case 1:return c.sent(),[4,this.player.clock.delay(333)];case 2:c.sent(),this.player.view&&(this.player.view.style.visibility="visible");try{this.frame.removeChild(this.cacheImage)}catch{}return[2]}})})},t.prototype.release=function(){var r=this;this.frozenTaskManager.addTask("release",function(){return r._doRelease()})},t.prototype._doDestroy=function(){var r,s,o,a;this.logger.info("do destroy slide",this.taskId),this.playerController&&this.playerController.destroy(),this.frameResizeObserver.disconnect(),(r=this.player)===null||r===void 0||r.removeAllListeners(),(s=this.player)===null||s===void 0||s.destroy(),(o=this.player)===null||o===void 0||o.removeAllListeners(),this.logger={warn:function(){return{}},info:function(){return{}},error:function(){return{}}},this.syncQueue.destroy(),this.renderingTaskManager.destroy(),this.frozenTaskManager.destroy(),window.removeEventListener("__slide_ref__",this.handleSlideRef),window.removeEventListener("message",this.recoverHandler),this.removeAllListeners();try{!((a=this.player)===null||a===void 0)&&a.view&&this.anchor.removeChild(this.player.view),this.anchor.removeChild(this.frame)}catch{}},t.prototype.waitLoadEnd=function(){return Yn(this,void 0,void 0,function(){var r;return qn(this,function(s){switch(s.label){case 0:r=0,s.label=1;case 1:return this.isLoading&&r<10?[4,Gu(100)]:[3,3];case 2:return s.sent(),r+=1,[3,1];case 3:return[2]}})})},t.prototype.preload=function(r){return this.player?this.player.preload(r):Promise.resolve()},t.prototype.destroy=function(){var r=this;this.logger.info("pre destroy slide",""),this.isLoading?this.waitLoadEnd().then(function(){r._doDestroy()}):this._doDestroy()},t.prototype.clearSlideCache=function(){var r;(r=this.player)===null||r===void 0||r.clearLocalCache()},t.prototype.hasNextStep=function(){if(!this.player)return!1;var r=this.player.currentIndex===this.slideCount,s=this.mainSeqLength===0||this.mainSeqStep>=this.mainSeqLength-1,o=this.mainSeqState==="end"||this.mainSeqState==="running"||this.mainSeqState==null;return!(r&&s&&o)},t.prototype.hasPrevStep=function(){if(!this.player)return!1;var r=this.player.currentIndex===1,s=this.mainSeqLength===0||this.mainSeqStep===0,o=this.mainSeqState==="idle"||this.mainSeqState===null;return!(r&&s&&o)},t.prototype.updateGlobalVolume=function(r){this.volumeAdjuster.volume=r},t.prototype.getGlobalVolume=function(){return this.volumeAdjuster.volume},t.clearLocalCache=function(){gn.clearLocalCache()},t.disposeLocalCache=function(){},e=t,t._tempLog="",t._tempLogIndex=1,t.usePlugin=jT,t.handleLogReport=function(r){return Yn(void 0,void 0,void 0,function(){var s,o,a,l,h,c;return qn(e,function(u){switch(u.label){case 0:return[4,t.flushLog(!0)];case 1:return u.sent(),bi?[4,bi.keys()]:[3,6];case 2:s=(u.sent()||[]).sort(function(p,f){return parseInt(p.replace("run_time_log_",""))-parseInt(f.replace("run_time_log_",""))}),o=0,a=s,u.label=3;case 3:return o<a.length?(l=a[o],h=l.replace("run_time_log_",""),[4,bi.getItem(l)]):[3,6];case 4:c=u.sent(),window.postMessage({type:"@slide/_report_log_",log:c,index:parseInt(h,10),total:s.length,customMessage:"@slide/_report_log_",sessionId:r},"*"),u.label=5;case 5:return o++,[3,3];case 6:return[2]}})})},t.handleLogDownload=function(){return Yn(void 0,void 0,void 0,function(){var r,s,o,a,l,h,c;return qn(e,function(u){switch(u.label){case 0:return[4,t.flushLog(!0)];case 1:return u.sent(),r="",bi?[4,bi.keys()]:[3,6];case 2:s=(u.sent()||[]).sort(function(p,f){return parseInt(p.replace("run_time_log_",""))-parseInt(f.replace("run_time_log_",""))}),o=0,a=s,u.label=3;case 3:return o<a.length?(l=a[o],h=r,[4,bi.getItem(l)]):[3,6];case 4:r=h+(u.sent()||""),u.label=5;case 5:return o++,[3,3];case 6:return(c=document.createElement("a")).setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(r)),c.setAttribute("download","slide_log"),c.style.display="none",document.body.appendChild(c),c.click(),document.body.removeChild(c),[2]}})})},RS([(n="Slide.initConfig",function(r,s,o){var a=o.value;o.value=function(){for(var l=[],h=0;h<arguments.length;h++)l[h]=arguments[h];for(var c=Tu.get(n)||[],u=l,p=0,f=c;p<f.length;p++){var g=f[p];try{u=g.before(u)}catch{}if(!Array.isArray(u)||u.length!==l.length)throw new Error("plugin before hook return invalid args")}for(var _=a.bind(this).apply(void 0,u),v=0,M=c.reverse();v<M.length;v++){g=M[v];try{_=g.after(_)}catch{}if(!_)throw new Error("plugin after hook return undefined result")}return _}})],t.prototype,"initSlideConfig",null),t}(cn.a);bi==null||bi.clear(),window.addEventListener("__slide_log__",Go.handleLogDownload),window.addEventListener("message",function(i){i.data.type==="@slide/_request_log_"&&Go.handleLogReport(i.data.sessionId).catch(function(){})}),window.setInterval(function(){Go.flushLog().catch(function(){})},2e3)}]);const BS="!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",GS=87,HS=20,i_=[],zS=()=>{for(let m=0;m<HS;m++)i_[m]=BS.charAt(Math.random()*GS);return i_.join("")};function u_(m){try{return m()}catch(y){console.error(y)}}class qo{constructor(){this.push=this.addDisposer,this.disposers=new Map}addDisposer(y,d=this.genUID()){return this.flush(d),this.disposers.set(d,Array.isArray(y)?jS(y):y),d}add(y,d=this.genUID()){const x=y();return x?this.addDisposer(x,d):d}addEventListener(y,d,x,b,R=this.genUID()){return y.addEventListener(d,x,b),this.addDisposer(()=>y.removeEventListener(d,x,b),R),R}setTimeout(y,d,x=this.genUID()){const b=window.setTimeout(()=>{this.remove(x),y()},d);return this.addDisposer(()=>window.clearTimeout(b),x)}setInterval(y,d,x=this.genUID()){const b=window.setInterval(y,d);return this.addDisposer(()=>window.clearInterval(b),x)}remove(y){const d=this.disposers.get(y);return this.disposers.delete(y),d}flush(y){const d=this.remove(y);d&&d()}flushAll(){this.disposers.forEach(u_),this.disposers.clear()}genUID(){let y;do y=zS();while(this.disposers.has(y));return y}}function jS(m){return()=>m.forEach(u_)}function d_(m,y,d){return Math.min(Math.max(m,y),d)}function VS(m){return typeof m=="object"&&m!==null}var p_={exports:{}},WS={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},f_={exports:{}},XS=function(y){return!y||typeof y=="string"?!1:y instanceof Array||Array.isArray(y)||y.length>=0&&(y.splice instanceof Function||Object.getOwnPropertyDescriptor(y,y.length-1)&&y.constructor.name!=="String")},YS=XS,qS=Array.prototype.concat,$S=Array.prototype.slice,r_=f_.exports=function(y){for(var d=[],x=0,b=y.length;x<b;x++){var R=y[x];YS(R)?d=qS.call(d,$S.call(R)):d.push(R)}return d};r_.wrap=function(m){return function(){return m(r_(arguments))}};var Xo=WS,$o=f_.exports,m_=Object.hasOwnProperty,g_=Object.create(null);for(var Wu in Xo)m_.call(Xo,Wu)&&(g_[Xo[Wu]]=Wu);var ii=p_.exports={to:{},get:{}};ii.get=function(m){var y=m.substring(0,3).toLowerCase(),d,x;switch(y){case"hsl":d=ii.get.hsl(m),x="hsl";break;case"hwb":d=ii.get.hwb(m),x="hwb";break;default:d=ii.get.rgb(m),x="rgb";break}return d?{model:x,value:d}:null};ii.get.rgb=function(m){if(!m)return null;var y=/^#([a-f0-9]{3,4})$/i,d=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,x=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,b=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,R=/^(\w+)$/,T=[0,0,0,1],S,N,C;if(S=m.match(d)){for(C=S[2],S=S[1],N=0;N<3;N++){var L=N*2;T[N]=parseInt(S.slice(L,L+2),16)}C&&(T[3]=parseInt(C,16)/255)}else if(S=m.match(y)){for(S=S[1],C=S[3],N=0;N<3;N++)T[N]=parseInt(S[N]+S[N],16);C&&(T[3]=parseInt(C+C,16)/255)}else if(S=m.match(x)){for(N=0;N<3;N++)T[N]=parseInt(S[N+1],0);S[4]&&(S[5]?T[3]=parseFloat(S[4])*.01:T[3]=parseFloat(S[4]))}else if(S=m.match(b)){for(N=0;N<3;N++)T[N]=Math.round(parseFloat(S[N+1])*2.55);S[4]&&(S[5]?T[3]=parseFloat(S[4])*.01:T[3]=parseFloat(S[4]))}else return(S=m.match(R))?S[1]==="transparent"?[0,0,0,0]:m_.call(Xo,S[1])?(T=Xo[S[1]],T[3]=1,T):null:null;for(N=0;N<3;N++)T[N]=Er(T[N],0,255);return T[3]=Er(T[3],0,1),T};ii.get.hsl=function(m){if(!m)return null;var y=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,d=m.match(y);if(d){var x=parseFloat(d[4]),b=(parseFloat(d[1])%360+360)%360,R=Er(parseFloat(d[2]),0,100),T=Er(parseFloat(d[3]),0,100),S=Er(isNaN(x)?1:x,0,1);return[b,R,T,S]}return null};ii.get.hwb=function(m){if(!m)return null;var y=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,d=m.match(y);if(d){var x=parseFloat(d[4]),b=(parseFloat(d[1])%360+360)%360,R=Er(parseFloat(d[2]),0,100),T=Er(parseFloat(d[3]),0,100),S=Er(isNaN(x)?1:x,0,1);return[b,R,T,S]}return null};ii.to.hex=function(){var m=$o(arguments);return"#"+Ol(m[0])+Ol(m[1])+Ol(m[2])+(m[3]<1?Ol(Math.round(m[3]*255)):"")};ii.to.rgb=function(){var m=$o(arguments);return m.length<4||m[3]===1?"rgb("+Math.round(m[0])+", "+Math.round(m[1])+", "+Math.round(m[2])+")":"rgba("+Math.round(m[0])+", "+Math.round(m[1])+", "+Math.round(m[2])+", "+m[3]+")"};ii.to.rgb.percent=function(){var m=$o(arguments),y=Math.round(m[0]/255*100),d=Math.round(m[1]/255*100),x=Math.round(m[2]/255*100);return m.length<4||m[3]===1?"rgb("+y+"%, "+d+"%, "+x+"%)":"rgba("+y+"%, "+d+"%, "+x+"%, "+m[3]+")"};ii.to.hsl=function(){var m=$o(arguments);return m.length<4||m[3]===1?"hsl("+m[0]+", "+m[1]+"%, "+m[2]+"%)":"hsla("+m[0]+", "+m[1]+"%, "+m[2]+"%, "+m[3]+")"};ii.to.hwb=function(){var m=$o(arguments),y="";return m.length>=4&&m[3]!==1&&(y=", "+m[3]),"hwb("+m[0]+", "+m[1]+"%, "+m[2]+"%"+y+")"};ii.to.keyword=function(m){return g_[m.slice(0,3)]};function Er(m,y,d){return Math.min(Math.max(y,m),d)}function Ol(m){var y=Math.round(m).toString(16).toUpperCase();return y.length<2?"0"+y:y}var ZS=p_.exports;class JS{constructor(y){this.enable=y,this.apps={},this.level="debug",this.roomLogger=null,this._onMessage=d=>{let x;d instanceof CustomEvent?x=d.detail:VS(d.data)&&(x=d.data),x&&(typeof x.slide=="boolean"?this.enable=x.slide:x.slide==="__instance"?console.log(this):x.slide==="__debug"&&Object.values(this.apps).forEach(b=>{var R,T;(T=(R=b.controller)==null?void 0:R.slide)==null||T.createController()}))},this.initialize()}setAppContext(y,d){var x;((x=this.apps)[y]||(x[y]={})).context=d,this.log(`[Slide] new ${y}`)}setAppController(y,d){var x;((x=this.apps)[y]||(x[y]={})).controller=d}deleteApp(y){delete this.apps[y],this.log(`[Slide] delete ${y}`)}initialize(){window.addEventListener("message",this._onMessage)}dispose(){window.removeEventListener("message",this._onMessage)}log(...y){this.roomLogger?this.roomLogger.info(...y):this.enable&&console.log(...y)}verbose(...y){this.roomLogger?this.roomLogger.debug(...y):this.enable&&this.level==="verbose"&&console.log(...y)}warn(...y){this.roomLogger?this.roomLogger.warn(...y):console.warn(...y)}}const ci=new JS(!1),yn=ci.log.bind(ci),Xu=ci.verbose.bind(ci),KS=m=>{ci.roomLogger=m.logger};function v_(m){try{const y=window.getComputedStyle(m).backgroundColor;if(y!=="rgba(0, 0, 0, 0)"&&y!=="transparent")return y;if(m.parentElement)return v_(m.parentElement)}catch{}return"#ffffff"}function QS(m){const y=ZS.get(m);if(y&&y.model==="rgb"){const d=y.value,b=(((Math.round(d[0])&255)<<16)+((Math.round(d[1])&255)<<8)+(Math.round(d[2])&255)).toString(16);return"#"+"000000".substring(b.length)+b}else return m}let Dl="";function __(m){return Dl||(Dl=QS(v_(m)),yn("[Slide] guess bg color",Dl)),Dl}function y_(m){const{width:y,height:d,slideCount:x,slideState:b}=m,{taskId:R,url:T}=b,S=[];for(let N=1;N<=x;++N)S.push({width:y,height:d,thumbnail:`${T}/${R}/preview/${N}.png`,src:"ppt"});return S}function s_(m,y,d,x){var S;const b=d.slideState.currentSlideIndex;if(!(b>0)||!y.getIsWritable())return;const R=[x,b].join("/");if(m.scenePathType(R)!=="page"){m.removeScenes(x);const N=d.slideCount,C=[];for(let L=1;L<=N;++L)C.push({name:`${L}`});m.putScenes(x,C)}let T;y.getBox().focus?T=m.state.sceneState.scenePath:T=((S=y.getView())==null?void 0:S.focusScenePath)||"",T!==R&&y.setScenePath(R)}const Ju="https://convertcdn.netless.link/dynamicConvert",t2=40,Yu={taskId:"",url:"",state:null};class e2{constructor({context:y,anchor:d,onPageChanged:x,onTransitionStart:b,onTransitionEnd:R,onError:T}){this.sideEffect=new qo,this.ready=!1,this.readyPromise=new Promise(S=>{this.resolveReady=()=>{this.ready?yn("[Slide] render end"):setTimeout(()=>{this.ready=!0,S()},1e3)}}),this.onSyncDispatch=S=>{if(this.context.getIsWritable()&&this.room){const N={type:Ze.SLIDE_EVENTS.syncDispatch,payload:S};Xu("[Slide] dispatch",JSON.stringify(S)),this.context.dispatchMagixEvent(Ze.SLIDE_EVENTS.syncDispatch,N)}},this.magixEventListener=S=>{const{type:N,payload:C}=S.payload;N===Ze.SLIDE_EVENTS.syncDispatch&&(this.syncStateOnce(),Xu("[Slide] receive",JSON.stringify(C)),this.slide.emit(Ze.SLIDE_EVENTS.syncReceive,C))},this.onStateChange=S=>{this.context.getIsWritable()&&(Xu("[Slide] state change",JSON.stringify(S,null,2)),this.context.storage.setState({state:S}))},this.pollCount=0,this.pollReadyState=()=>{this.ready?this._toFreeze===1?this.freeze():this._toFreeze===-1&&this.unfreeze():this.pollCount<t2?(this.pollCount++,setTimeout(this.pollReadyState,500)):(this.pollCount=0,yn("[Slide] renderSlide 1 (retry after timeout)"),this.slide.renderSlide(1))},this._pageCount=0,this.destroyed=!1,this.timestamp=()=>this.room&&this.room.calibrationTimestamp?this.room.calibrationTimestamp:this.player?this.player.beginTimestamp+this.player.progressTime:Date.now(),this.isFrozen=!1,this._toFreeze=0,this.freeze=()=>{this.isFrozen=!0,this.ready?(yn("[Slide] freeze",this.context.appId),this.slide.frozen()):this._toFreeze=1},this.unfreeze=async()=>{!this.visible||(this.isFrozen=!1,this.ready?(yn("[Slide] unfreeze",this.context.appId),this.slide.release()):this._toFreeze=-1)},this.onVisibilityChange=async()=>{(this.visible=document.visibilityState==="visible")?(yn("[Slide] unfreeze because tab becomes visible",{savedIsFrozen:this.savedIsFrozen}),this.savedIsFrozen||this.unfreeze()):(this.savedIsFrozen=this.isFrozen,yn("[Slide] freeze because tab becomes invisible"),this.freeze())},this.onPageChanged=x,this.onTransitionStart=b,this.onTransitionEnd=R,this.onError=T,this.context=y,this.room=y.getRoom(),this.player=this.room?void 0:y.getDisplayer(),KS(this.room||this.player),this.slide=this.createSlide(d),this.syncStateOnceFlag=!this.context.isAddApp,this.visible=document.visibilityState==="visible",this.savedIsFrozen=!1,this.initialize()}jumpToPage(y){this.ready&&(y=d_(y,1,this.pageCount),this.slide.renderSlide(y))}initialize(){this.registerEventListeners(),this.kickStart()}kickStart(){const{context:y,slide:d}=this;y.getIsWritable()&&y.storage.ensureState(Yu);const{taskId:x,url:b,state:R}=y.storage.state;d.setResource(x,b||Ju),R?(yn("[Slide] init with state",JSON.stringify(R)),this.syncStateOnceFlag=!1,d.setSlideState(R)):y.isAddApp&&(yn("[Slide] init by renderSlide",1),d.renderSlide(1)),this.pollReadyState()}registerEventListeners(){const{context:y,slide:d}=this,x=this.sideEffect.addDisposer(y.storage.addStateChangedListener(()=>{y.storage.state.state&&(this.syncStateOnce(),this.sideEffect.flush(x))}));this.sideEffect.add(()=>y.addMagixEventListener(Ze.SLIDE_EVENTS.syncDispatch,this.magixEventListener,{fireSelfEventAfterCommit:!0})),d.on(Ze.SLIDE_EVENTS.slideChange,this.onPageChanged),d.on(Ze.SLIDE_EVENTS.renderStart,this.onTransitionStart),d.on(Ze.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),d.on(Ze.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),d.on(Ze.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),d.on(Ze.SLIDE_EVENTS.renderError,this.onError),d.on(Ze.SLIDE_EVENTS.stateChange,this.onStateChange),d.on(Ze.SLIDE_EVENTS.syncDispatch,this.onSyncDispatch),d.on(Ze.SLIDE_EVENTS.renderEnd,this.resolveReady),this.sideEffect.add(()=>(document.addEventListener("visibilitychange",this.onVisibilityChange),()=>document.removeEventListener("visibilitychange",this.onVisibilityChange)))}syncStateOnce(){if(this.syncStateOnceFlag){this.context.getIsWritable()&&this.context.storage.ensureState(Yu);const{state:y}=this.context.storage.state;y&&(yn("[Slide] sync with state (once)",JSON.stringify(y)),this.slide.setSlideState(y),this.syncStateOnceFlag=!1)}}get pageCount(){return this._pageCount>0?this._pageCount:(this._pageCount=this.slide.slideCount,this._pageCount)}get page(){return this.slide.slideState.currentSlideIndex}createSlide(y){var b,R;const d=this.context.getAppOptions()||{};return new Ze.Slide({anchor:y,interactive:!0,mode:"interactive",controller:ci.enable,enableGlobalClick:!0,renderOptions:{minFPS:d.minFPS||25,maxFPS:d.maxFPS||30,autoFPS:(b=d.autoFPS)!=null?b:!0,autoResolution:(R=d.autoResolution)!=null?R:!0,resolution:d.resolution,transactionBgColor:d.bgColor||__(y),maxResolutionLevel:d.maxResolutionLevel},fixedFrameSize:d.fixedFrameSize,loaderDelegate:d.loaderDelegate,navigatorDelegate:d.navigatorDelegate,resourceTimeout:d.resourceTimeout,rtcAudio:d.rtcAudio,useLocalCache:d.useLocalCache,logger:d.logger,timestamp:this.timestamp})}destroy(){this.sideEffect.flushAll(),this.destroyed||(yn("[Slide] destroy slide (once)"),this.slide.destroy(),this.destroyed=!0)}}function n2(m){const y="http://www.w3.org/2000/svg",d=document.createElementNS(y,"svg");d.setAttribute("class",`${m}-footer-icon-sidebar`),d.setAttribute("viewBox","0 0 64 64");const x=document.createElementNS(y,"path");return x.setAttribute("fill","currentColor"),x.setAttribute("d","M50 8H14c-3.309 0-6 2.691-6 6v36c0 3.309 2.691 6 6 6h36c3.309 0 6-2.691 6-6V14c0-3.309-2.691-6-6-6zM12 50V14c0-1.103.897-2 2-2h8v40h-8c-1.103 0-2-.897-2-2zm40 0c0 1.103-.897 2-2 2H26V12h24c1.103 0 2 .897 2 2z"),d.appendChild(x),d}function i2(m){const y="http://www.w3.org/2000/svg",d=document.createElementNS(y,"svg");d.setAttribute("class",`${m}-footer-icon-arrow-left`),d.setAttribute("viewBox","0 0 500 500");const x=document.createElementNS(y,"path");return x.setAttribute("fill","currentColor"),x.setAttribute("d","M177.81 249.959L337.473 90.295c2.722-2.865 2.651-7.378-.143-10.1-2.793-2.65-7.163-2.65-9.956 0l-164.75 164.75c-2.793 2.793-2.793 7.306 0 10.1l164.75 164.75c2.865 2.722 7.378 2.65 10.099-.143 2.651-2.794 2.651-7.163 0-9.957L177.809 249.959z"),d.appendChild(x),d}function r2(m){const y="http://www.w3.org/2000/svg",d=document.createElementNS(y,"svg");d.setAttribute("class",`${m}-footer-icon-arrow-right`),d.setAttribute("viewBox","0 0 500 500");const x=document.createElementNS(y,"path");return x.setAttribute("fill","currentColor"),x.setAttribute("d","M322.19 250.041L162.527 409.705c-2.722 2.865-2.651 7.378.143 10.1 2.793 2.65 7.163 2.65 9.956 0l164.75-164.75c2.793-2.793 2.793-7.306 0-10.1l-164.75-164.75c-2.865-2.722-7.378-2.65-10.099.143-2.651 2.794-2.651 7.163 0 9.957l159.664 159.736z"),d.appendChild(x),d}function s2(m){const y="http://www.w3.org/2000/svg",d=document.createElementNS(y,"svg");d.setAttribute("class",`${m}-footer-icon-play`),d.setAttribute("viewBox","0 0 500 500");const x=document.createElementNS(y,"path");return x.setAttribute("fill","currentColor"),x.setAttribute("d","M418.158 257.419L174.663 413.33c-6.017 3.919-15.708 3.772-21.291-.29-2.791-2.018-4.295-4.483-4.295-7.084V94.109c0-5.65 6.883-10.289 15.271-10.289 4.298 0 8.391 1.307 11.181 3.332l242.629 155.484c6.016 3.917 6.451 10.292.649 14.491-.216.154-.432.154-.649.292zM170.621 391.288l223.116-141.301L170.71 107.753l-.089 283.535z"),d.appendChild(x),d}function o2(m){const y="http://www.w3.org/2000/svg",d=document.createElementNS(y,"svg");d.setAttribute("class",`${m}-footer-icon-pause`),d.setAttribute("viewBox","0 0 500 500");const x=document.createElementNS(y,"path");return x.setAttribute("fill","currentColor"),x.setAttribute("d","M312.491 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261zM165.257 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261z"),d.appendChild(x),d}const Tr=typeof window!="undefined",x_=Tr&&!("onscroll"in window)||typeof navigator!="undefined"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),b_=Tr&&"IntersectionObserver"in window,E_=Tr&&"classList"in document.createElement("p"),w_=Tr&&window.devicePixelRatio>1,a2={elements_selector:".lazy",container:x_||Tr?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},T_=m=>Object.assign({},a2,m),o_=function(m,y){let d;const x="LazyLoad::Initialized",b=new m(y);try{d=new CustomEvent(x,{detail:{instance:b}})}catch{d=document.createEvent("CustomEvent"),d.initCustomEvent(x,!1,!1,{instance:b})}window.dispatchEvent(d)},l2=(m,y)=>{if(!!y)if(!y.length)o_(m,y);else for(let d=0,x;x=y[d];d+=1)o_(m,x)},tr="src",Ku="srcset",Qu="sizes",S_="poster",Zo="llOriginalAttrs",M_="data",td="loading",A_="loaded",P_="applied",h2="entered",ed="error",C_="native",I_="data-",R_="ll-status",Zn=(m,y)=>m.getAttribute(I_+y),c2=(m,y,d)=>{var x=I_+y;if(d===null){m.removeAttribute(x);return}m.setAttribute(x,d)},Jo=m=>Zn(m,R_),Vr=(m,y)=>c2(m,R_,y),Ul=m=>Vr(m,null),nd=m=>Jo(m)===null,u2=m=>Jo(m)===td,d2=m=>Jo(m)===ed,id=m=>Jo(m)===C_,p2=[td,A_,P_,ed],f2=m=>p2.indexOf(Jo(m))>=0,Sr=(m,y,d,x)=>{if(!!m){if(x!==void 0){m(y,d,x);return}if(d!==void 0){m(y,d);return}m(y)}},Os=(m,y)=>{if(E_){m.classList.add(y);return}m.className+=(m.className?" ":"")+y},Bi=(m,y)=>{if(E_){m.classList.remove(y);return}m.className=m.className.replace(new RegExp("(^|\\s+)"+y+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},m2=m=>{m.llTempImage=document.createElement("IMG")},g2=m=>{delete m.llTempImage},L_=m=>m.llTempImage,Bl=(m,y)=>{if(!y)return;const d=y._observer;!d||d.unobserve(m)},v2=m=>{m.disconnect()},_2=(m,y,d)=>{y.unobserve_entered&&Bl(m,d)},rd=(m,y)=>{!m||(m.loadingCount+=y)},y2=m=>{!m||(m.toLoadCount-=1)},N_=(m,y)=>{!m||(m.toLoadCount=y)},x2=m=>m.loadingCount>0,b2=m=>m.toLoadCount>0,O_=m=>{let y=[];for(let d=0,x;x=m.children[d];d+=1)x.tagName==="SOURCE"&&y.push(x);return y},sd=(m,y)=>{const d=m.parentNode;if(!d||d.tagName!=="PICTURE")return;O_(d).forEach(y)},D_=(m,y)=>{O_(m).forEach(y)},Gl=[tr],F_=[tr,S_],Yo=[tr,Ku,Qu],k_=[M_],Hl=m=>!!m[Zo],U_=m=>m[Zo],B_=m=>delete m[Zo],Ns=(m,y)=>{if(Hl(m))return;const d={};y.forEach(x=>{d[x]=m.getAttribute(x)}),m[Zo]=d},E2=m=>{Hl(m)||(m[Zo]={backgroundImage:m.style.backgroundImage})},w2=(m,y,d)=>{if(!d){m.removeAttribute(y);return}m.setAttribute(y,d)},jr=(m,y)=>{if(!Hl(m))return;const d=U_(m);y.forEach(x=>{w2(m,x,d[x])})},T2=m=>{if(!Hl(m))return;const y=U_(m);m.style.backgroundImage=y.backgroundImage},G_=(m,y,d)=>{Os(m,y.class_applied),Vr(m,P_),d&&(y.unobserve_completed&&Bl(m,y),Sr(y.callback_applied,m,d))},H_=(m,y,d)=>{Os(m,y.class_loading),Vr(m,td),d&&(rd(d,1),Sr(y.callback_loading,m,d))},wr=(m,y,d)=>{!d||m.setAttribute(y,d)},a_=(m,y)=>{wr(m,Qu,Zn(m,y.data_sizes)),wr(m,Ku,Zn(m,y.data_srcset)),wr(m,tr,Zn(m,y.data_src))},S2=(m,y)=>{sd(m,d=>{Ns(d,Yo),a_(d,y)}),Ns(m,Yo),a_(m,y)},M2=(m,y)=>{Ns(m,Gl),wr(m,tr,Zn(m,y.data_src))},A2=(m,y)=>{D_(m,d=>{Ns(d,Gl),wr(d,tr,Zn(d,y.data_src))}),Ns(m,F_),wr(m,S_,Zn(m,y.data_poster)),wr(m,tr,Zn(m,y.data_src)),m.load()},P2=(m,y)=>{Ns(m,k_),wr(m,M_,Zn(m,y.data_src))},C2=(m,y,d)=>{const x=Zn(m,y.data_bg),b=Zn(m,y.data_bg_hidpi),R=w_&&b?b:x;!R||(m.style.backgroundImage=`url("${R}")`,L_(m).setAttribute(tr,R),H_(m,y,d))},I2=(m,y,d)=>{const x=Zn(m,y.data_bg_multi),b=Zn(m,y.data_bg_multi_hidpi),R=w_&&b?b:x;!R||(m.style.backgroundImage=R,G_(m,y,d))},R2=(m,y,d)=>{const x=Zn(m,y.data_bg_set);if(!x)return;const b=x.split("|");let R=b.map(T=>`image-set(${T})`);m.style.backgroundImage=R.join(),m.style.backgroundImage===""&&(R=b.map(T=>`-webkit-image-set(${T})`),m.style.backgroundImage=R.join()),G_(m,y,d)},z_={IMG:S2,IFRAME:M2,VIDEO:A2,OBJECT:P2},L2=(m,y)=>{const d=z_[m.tagName];!d||d(m,y)},N2=(m,y,d)=>{const x=z_[m.tagName];!x||(x(m,y),H_(m,y,d))},O2=["IMG","IFRAME","VIDEO","OBJECT"],D2=m=>O2.indexOf(m.tagName)>-1,j_=(m,y)=>{y&&!x2(y)&&!b2(y)&&Sr(m.callback_finish,y)},l_=(m,y,d)=>{m.addEventListener(y,d),m.llEvLisnrs[y]=d},F2=(m,y,d)=>{m.removeEventListener(y,d)},od=m=>!!m.llEvLisnrs,k2=(m,y,d)=>{od(m)||(m.llEvLisnrs={});const x=m.tagName==="VIDEO"?"loadeddata":"load";l_(m,x,y),l_(m,"error",d)},qu=m=>{if(!od(m))return;const y=m.llEvLisnrs;for(let d in y){const x=y[d];F2(m,d,x)}delete m.llEvLisnrs},V_=(m,y,d)=>{g2(m),rd(d,-1),y2(d),Bi(m,y.class_loading),y.unobserve_completed&&Bl(m,d)},U2=(m,y,d,x)=>{const b=id(y);V_(y,d,x),Os(y,d.class_loaded),Vr(y,A_),Sr(d.callback_loaded,y,x),b||j_(d,x)},B2=(m,y,d,x)=>{const b=id(y);V_(y,d,x),Os(y,d.class_error),Vr(y,ed),Sr(d.callback_error,y,x),d.restore_on_error&&jr(y,Yo),b||j_(d,x)},ad=(m,y,d)=>{const x=L_(m)||m;if(od(x))return;k2(x,T=>{U2(T,m,y,d),qu(x)},T=>{B2(T,m,y,d),qu(x)})},G2=(m,y,d)=>{m2(m),ad(m,y,d),E2(m),C2(m,y,d),I2(m,y,d),R2(m,y,d)},H2=(m,y,d)=>{ad(m,y,d),N2(m,y,d)},ld=(m,y,d)=>{D2(m)?H2(m,y,d):G2(m,y,d)},z2=(m,y,d)=>{m.setAttribute("loading","lazy"),ad(m,y,d),L2(m,y),Vr(m,C_)},h_=m=>{m.removeAttribute(tr),m.removeAttribute(Ku),m.removeAttribute(Qu)},j2=m=>{sd(m,y=>{h_(y)}),h_(m)},W_=m=>{sd(m,y=>{jr(y,Yo)}),jr(m,Yo)},V2=m=>{D_(m,y=>{jr(y,Gl)}),jr(m,F_),m.load()},W2=m=>{jr(m,Gl)},X2=m=>{jr(m,k_)},Y2={IMG:W_,IFRAME:W2,VIDEO:V2,OBJECT:X2},q2=m=>{const y=Y2[m.tagName];if(!y){T2(m);return}y(m)},$2=(m,y)=>{nd(m)||id(m)||(Bi(m,y.class_entered),Bi(m,y.class_exited),Bi(m,y.class_applied),Bi(m,y.class_loading),Bi(m,y.class_loaded),Bi(m,y.class_error))},Z2=(m,y)=>{q2(m),$2(m,y),Ul(m),B_(m)},J2=(m,y,d,x)=>{!d.cancel_on_exit||!u2(m)||m.tagName==="IMG"&&(qu(m),j2(m),W_(m),Bi(m,d.class_loading),rd(x,-1),Ul(m),Sr(d.callback_cancel,m,y,x))},K2=(m,y,d,x)=>{const b=f2(m);Vr(m,h2),Os(m,d.class_entered),Bi(m,d.class_exited),_2(m,d,x),Sr(d.callback_enter,m,y,x),!b&&ld(m,d,x)},Q2=(m,y,d,x)=>{nd(m)||(Os(m,d.class_exited),J2(m,y,d,x),Sr(d.callback_exit,m,y,x))},tM=["IMG","IFRAME","VIDEO"],X_=m=>m.use_native&&"loading"in HTMLImageElement.prototype,eM=(m,y,d)=>{m.forEach(x=>{tM.indexOf(x.tagName)!==-1&&z2(x,y,d)}),N_(d,0)},nM=m=>m.isIntersecting||m.intersectionRatio>0,iM=m=>({root:m.container===document?null:m.container,rootMargin:m.thresholds||m.threshold+"px"}),rM=(m,y,d)=>{m.forEach(x=>nM(x)?K2(x.target,x,y,d):Q2(x.target,x,y,d))},sM=(m,y)=>{y.forEach(d=>{m.observe(d)})},oM=(m,y)=>{v2(m),sM(m,y)},aM=(m,y)=>{!b_||X_(m)||(y._observer=new IntersectionObserver(d=>{rM(d,m,y)},iM(m)))},Y_=m=>Array.prototype.slice.call(m),Fl=m=>m.container.querySelectorAll(m.elements_selector),lM=m=>Y_(m).filter(nd),hM=m=>d2(m),cM=m=>Y_(m).filter(hM),c_=(m,y)=>lM(m||Fl(y)),uM=(m,y)=>{cM(Fl(m)).forEach(x=>{Bi(x,m.class_error),Ul(x)}),y.update()},dM=(m,y)=>{!Tr||(y._onlineHandler=()=>{uM(m,y)},window.addEventListener("online",y._onlineHandler))},pM=m=>{!Tr||window.removeEventListener("online",m._onlineHandler)},Ko=function(m,y){const d=T_(m);this._settings=d,this.loadingCount=0,aM(d,this),dM(d,this),this.update(y)};Ko.prototype={update:function(m){const y=this._settings,d=c_(m,y);if(N_(this,d.length),x_||!b_){this.loadAll(d);return}if(X_(y)){eM(d,y,this);return}oM(this._observer,d)},destroy:function(){this._observer&&this._observer.disconnect(),pM(this),Fl(this._settings).forEach(m=>{B_(m)}),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(m){const y=this._settings;c_(m,y).forEach(x=>{Bl(x,this),ld(x,y,this)})},restoreAll:function(){const m=this._settings;Fl(m).forEach(y=>{Z2(y,m)})}};Ko.load=(m,y)=>{const d=T_(y);ld(m,d)};Ko.resetStatus=m=>{Ul(m)};Tr&&l2(Ko,window.lazyLoadOptions);class q_{constructor({readonly:y,onNewPageIndex:d,onPlay:x}){this._pages=[],this.pageIndex=0,this.setPaused=()=>{this.$btnPlay.classList.toggle(this.wrapClassName("footer-btn-playing"),!1)},this.setPlaying=()=>{this.$btnPlay.classList.toggle(this.wrapClassName("footer-btn-playing"),!0)},this.namespace="netless-app-slide",this.isShowPreview=!1,this.isSmallBox=!1,this.sideEffect=new qo,this.readonly=y,this.onNewPageIndex=d,this.onPlay=x,this.render()}set pages(y){this._pages=y,this.refreshPreview(),this.refreshTotalPage(),this.refreshBtnSidebar()}get pages(){return this._pages}unmount(){this.$content.remove(),this.$footer.remove()}setReadonly(y){this.readonly=y,this.$content.classList.toggle(this.wrapClassName("readonly"),y),this.$footer.classList.toggle(this.wrapClassName("readonly"),y),this.$pageNumberInput.disabled=y}destroy(){this.sideEffect.flushAll(),this.unmount()}setPageIndex(y){Number.isNaN(y)||(this.pageIndex=y,this.$pageNumberInput.value=String(y+1))}refreshTotalPage(){this.pages.length?this.$totalPage.textContent=" / "+this.pages.length:this.$totalPage.textContent=""}setSmallBox(y){this.isSmallBox!==y&&(this.isSmallBox=y,this.$footer.classList.toggle(this.wrapClassName("float-footer"),y))}render(){return this.renderContent(),this.renderFooter(),this.$content}renderContent(){if(!this.$content){const y=document.createElement("div");y.className=this.wrapClassName("content"),this.$content=y,this.readonly&&y.classList.add(this.wrapClassName("readonly")),y.appendChild(this.renderPreviewMask()),y.appendChild(this.renderPreview())}return this.$content}renderPreview(){if(!this.$preview){const y=document.createElement("div");y.className=this.wrapClassName("preview")+" tele-fancy-scrollbar",this.$preview=y,this.sideEffect.add(()=>(this.previewLazyLoad=new Ko({container:this.$preview,elements_selector:`.${this.wrapClassName("preview-page>img")}`}),()=>{var d;return(d=this.previewLazyLoad)==null?void 0:d.destroy()})),this.refreshPreview(),this.sideEffect.addEventListener(y,"click",d=>{var b;if(this.readonly)return;const x=(b=d.target.dataset)==null?void 0:b.pageIndex;x&&(d.preventDefault(),d.stopPropagation(),d.stopImmediatePropagation(),this.onNewPageIndex(Number(x)),this.togglePreview(!1))})}return this.$preview}refreshPreview(){var b;const{$preview:y}=this,d=this.wrapClassName("preview-page"),x=this.wrapClassName("preview-page-name");for(;y.firstChild;)y.firstChild.remove();this.pages.forEach((R,T)=>{var K;const S=(K=R.thumbnail)!=null?K:R.src.startsWith("ppt")?void 0:R.src;if(!S)return;const N=String(T),C=document.createElement("a");C.className=d+" "+this.wrapClassName(`preview-page-${T}`),C.setAttribute("href","#"),C.dataset.pageIndex=N;const L=document.createElement("span");L.className=x,L.textContent=String(T+1),L.dataset.pageIndex=N;const k=document.createElement("img");k.width=R.width,k.height=R.height,k.dataset.src=S,k.dataset.pageIndex=N,C.appendChild(k),C.appendChild(L),y.appendChild(C)}),(b=this.previewLazyLoad)==null||b.update()}renderPreviewMask(){return this.$previewMask||(this.$previewMask=document.createElement("div"),this.$previewMask.className=this.wrapClassName("preview-mask"),this.sideEffect.addEventListener(this.$previewMask,"click",y=>{this.readonly||y.target===this.$previewMask&&this.togglePreview(!1)})),this.$previewMask}refreshBtnSidebar(){this.$btnSidebar.style.display=this.pages.length>0?"":"none"}renderFooter(){if(!this.$footer){const y=document.createElement("div");y.className=this.wrapClassName("footer"),this.$footer=y,this.readonly&&y.classList.add(this.wrapClassName("readonly")),this.isSmallBox&&y.classList.add(this.wrapClassName("float-footer"));const d=this.renderFooterBtn("btn-sidebar",n2(this.namespace));this.sideEffect.addEventListener(d,"click",()=>{this.readonly||this.togglePreview()}),this.$btnSidebar=d,this.$btnSidebar.style.display="none",this.$footer.appendChild(d);const x=document.createElement("div");x.className=this.wrapClassName("page-jumps");const b=this.renderFooterBtn("btn-page-back",i2(this.namespace));if(this.sideEffect.addEventListener(b,"click",()=>{this.readonly||this.onNewPageIndex(this.pageIndex-1)}),x.appendChild(b),this.onPlay){const C=this.renderFooterBtn("btn-page-play",s2(this.namespace),o2(this.namespace));this.$btnPlay=C,this.sideEffect.addEventListener(C,"click",()=>{this.readonly||(this.setPlaying(),this.onPlay&&this.onPlay())}),x.appendChild(C)}const R=this.renderFooterBtn("btn-page-next",r2(this.namespace));this.sideEffect.addEventListener(R,"click",()=>{this.readonly||this.onNewPageIndex(this.pageIndex+1)}),x.appendChild(R);const T=document.createElement("div");T.className=this.wrapClassName("page-number");const S=document.createElement("input");S.className=this.wrapClassName("page-number-input"),S.value=String(this.pageIndex+1),this.readonly&&(S.disabled=!0),this.$pageNumberInput=S,this.sideEffect.addEventListener(S,"focus",()=>{S.select()}),this.sideEffect.addEventListener(S,"change",()=>{this.readonly||S.value&&this.onNewPageIndex(Number(S.value)-1)});const N=document.createElement("span");this.$totalPage=N,T.appendChild(S),T.appendChild(N),this.$footer.appendChild(x),this.$footer.appendChild(T)}return this.$footer}renderFooterBtn(y,d,x){const b=document.createElement("button");return b.className=this.wrapClassName("footer-btn")+" "+this.wrapClassName(y),b.appendChild(d),x&&b.appendChild(x),b}togglePreview(y){if(this.isShowPreview=y!=null?y:!this.isShowPreview,this.$content.classList.toggle(this.wrapClassName("preview-active"),this.isShowPreview),this.isShowPreview){const d=this.$preview.querySelector("."+this.wrapClassName(`preview-page-${this.pageIndex}`));d&&this.$preview.scrollTo({top:d.offsetTop-16})}}wrapClassName(y){return`${this.namespace}-${y}`}}const fM=new Set(["clicker"]);class mM{constructor({box:y,view:d,mountSlideController:x,mountWhiteboard:b}){this.slideController=null,this.isViewMounted=!1,this.onError=({error:R})=>{var T;this.viewer.setPaused(),this.$overlay.textContent=`Error on slide[page=${(T=this.slideController)==null?void 0:T.page}]: ${R.message}`,this.$overlay.style.opacity="1",ci.warn("[Slide] render error",R)},this.onRenderEnd=()=>{this.$overlay.style.opacity=""},this.refreshPages=()=>{this.slideController&&(this.viewer.pages=y_(this.slideController.slide),this.viewer.setPageIndex(this.getPageIndex(this.slideController.page)),this.scaleDocsToFit())},this.scaleDocsToFit=()=>{if(this.slideController){const{width:R,height:T}=this.slideController.slide;R&&T&&(this.whiteboardView.moveCameraToContain({originX:-R/2,originY:-T/2,width:R,height:T,animationMode:"immediately"}),this.whiteboardView.setCameraBound({damping:1,maxContentMode:()=>this.whiteboardView.camera.scale,minContentMode:()=>this.whiteboardView.camera.scale,centerX:0,centerY:0,width:R,height:T}),this.isViewMounted||(this.isViewMounted=!0,console.log("[Slide] mount whiteboard view"),this.mountWhiteboard(this.$whiteboardView)))}},this.onPlay=()=>{this.slideController&&this.slideController.slide.nextStep()},this.onNewPageIndex=R=>{this.slideController&&this.slideController.jumpToPage(R+1)},this.sideEffect=new qo,this.namespace="netless-app-slide",this.box=y,this.whiteboardView=d,this.mountSlideController=x,this.mountWhiteboard=b,this.viewer=new q_({readonly:y.readonly,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay}),this.sideEffect.add(()=>{const R=T=>{this.setReadonly(T)};return y.events.on("readonly",R),()=>y.events.off("readonly",R)}),this.render()}render(){this.viewer.$content.appendChild(this.renderSlideContainer()),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.viewer.$content.appendChild(this.renderOverlay()),this.sideEffect.addEventListener(window,"keydown",y=>{if(this.box.focus&&this.slideController)switch(y.key){case"ArrowUp":case"ArrowLeft":{this.slideController.slide.prevStep();break}case"ArrowRight":case"ArrowDown":{this.slideController.slide.nextStep();break}}})}renderOverlay(){if(!this.$overlay){const y=document.createElement("div");y.className=this.wrapClassName("overlay"),this.$overlay=y}return this.$overlay}renderSlideContainer(){if(!this.$slide){const y=document.createElement("div");y.className=this.wrapClassName("slide"),y.dataset.appKind="Slide",this.$slide=y}return this.$slide}renderWhiteboardView(){return this.$whiteboardView||(this.$whiteboardView=document.createElement("div"),this.$whiteboardView.className=this.wrapClassName("wb-view")),this.$whiteboardView}mount(){return this.box.mountContent(this.viewer.$content),this.box.mountFooter(this.viewer.$footer),this.slideController=this.mountSlideController({anchor:this.$slide,onRenderEnd:this.onRenderEnd,onTransitionStart:this.viewer.setPlaying,onTransitionEnd:this.viewer.setPaused,onReady:this.refreshPages,onError:this.onError}),this.scaleDocsToFit(),this.sideEffect.add(()=>(this.whiteboardView.callbacks.on("onSizeUpdated",this.scaleDocsToFit),()=>this.whiteboardView.callbacks.off("onSizeUpdated",this.scaleDocsToFit))),this}getPageIndex(y){return(y>0?y:1)-1}unmount(){return this.slideController&&(this.slideController.destroy(),this.slideController=null),this.viewer.unmount(),this}setReadonly(y){this.viewer.setReadonly(y)}destroy(){this.sideEffect.flushAll(),this.unmount(),this.viewer.destroy()}toggleClickThrough(y){this.$whiteboardView.style.pointerEvents=!y||fM.has(y)?"none":"auto"}wrapClassName(y){return`${this.namespace}-${y}`}}let $u=!1;const $_=2,Wo=m=>"["+m+"]",kl={map:new Map,queue:[],validateQueue(){for(yn("[Slide] freezer: validate",Wo(this.queue));this.queue.length>$_;){const m=this.queue.pop(),y=this.map.get(m);y&&(yn("[Slide] freezer: validate-freeze",m,Wo(this.queue)),y.freeze())}},set(m,y){yn("[Slide] freezer: add",m,Wo(this.queue)),this.map.set(m,y),this.queue.includes(m)||this.queue.unshift(m),this.validateQueue()},delete(m){this.map.delete(m),this.queue=this.queue.filter(y=>y!==m),yn("[Slide] freezer: delete",m,Wo(this.queue))},focus(m){const y=this.map.get(m),d=this.queue.indexOf(m);d>-1&&this.queue.splice(d,1),this.queue.unshift(m),this.validateQueue(),yn("[Slide] freezer: focus",m,Wo(this.queue)),y&&y.unfreeze()}},gM=m=>{$u=!0,m.on("focus",({appId:y})=>{kl.focus(y)})};var Z_=(()=>`.netless-app-slide-content{position:relative;height:100%;overflow:hidden}.netless-app-slide-preview-mask{display:none;position:absolute;z-index:200;top:0;left:0;width:100%;height:100%}.netless-app-slide-preview{display:flex;flex-direction:column;align-items:center;position:absolute;z-index:300;top:0;left:0;width:33%;max-width:200px;height:100%;padding-top:10px;transform:translate(-100%);background:rgba(237,237,240,.9);box-shadow:inset -1px 0 #0000001c;transition:transform .4s}.netless-app-slide-preview-active .netless-app-slide-preview-mask{display:block}.netless-app-slide-preview-active .netless-app-slide-preview{transform:translate(0)}.netless-app-slide-preview-page{position:relative;display:block;width:55%;margin-bottom:10px;font-size:0;color:transparent;outline:none;border:7px solid transparent;border-radius:4px;transition:border-color .3s;user-select:none}.netless-app-slide-preview-page:hover,.netless-app-slide-preview-page.netless-app-slide-preview-page-active{border-color:#444e601a}.netless-app-slide-preview-page>img{width:100%;height:auto;box-sizing:border-box;border:1px solid rgba(0,0,0,.5);border-radius:1px;background-color:#fff;box-shadow:0 2px 8px #0000004d}.netless-app-slide-preview-page-name{position:absolute;top:1px;left:-10px;transform:translate(-100%);text-align:right;font-size:12px;color:#5f5f5f;user-select:none}.netless-app-slide-footer{box-sizing:border-box;height:26px;display:flex;align-items:center;padding:0 16px;border-top:1px solid #eeeef7;color:#191919}.netless-app-slide-float-footer{width:100%;min-height:26px;position:absolute;left:0;bottom:0;z-index:2000;background:rgba(249,249,252,.9);transition:opacity .4s}.netless-app-slide-footer-btn{box-sizing:border-box;width:26px;height:26px;font-size:0;margin:0;padding:3px;border:none;border-radius:1px;outline:none;color:currentColor;background:transparent;transition:background .4s;cursor:pointer;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-slide-footer-btn:hover{background:rgba(237,237,240,.9)}@media (hover: none){.netless-app-slide-footer-btn:hover{background:transparent!important}}.netless-app-slide-footer-btn>svg{width:100%;height:100%}.netless-app-slide-footer-btn>svg:nth-of-type(2){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(1){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(2){display:initial}.netless-app-slide-footer-btn~.netless-app-slide-footer-btn{margin-left:15px}.netless-app-slide-page-jumps{flex:1;display:flex;justify-content:center;align-items:center}.netless-app-slide-page-number{margin-left:auto;font-size:13px;user-select:none;white-space:nowrap;word-break:keep-all}.netless-app-slide-page-number-input{border:none;outline:none;width:3em;margin:0;padding:0 2px;text-align:right;font-size:13px;line-height:1;font-weight:400;font-family:inherit;border-radius:2px;color:currentColor;background:transparent;transition:background .4s;user-select:text;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-slide-page-number-input:hover,.netless-app-slide-page-number-input:focus,.netless-app-slide-page-number-input:active{background:#fff;box-shadow:#63636333 0 2px 8px}.netless-app-slide-readonly.netless-app-slide-footer{display:none}.telebox-color-scheme-dark .netless-app-slide-page-number-input{color:#a6a6a8}.telebox-color-scheme-dark .netless-app-slide-page-number-input:active,.telebox-color-scheme-dark .netless-app-slide-page-number-input:focus,.telebox-color-scheme-dark .netless-app-slide-page-number-input:hover{color:#222}.telebox-color-scheme-dark .netless-app-slide-footer{color:#a6a6a8;background:#2d2d33;border-top:none}.telebox-color-scheme-dark .netless-app-slide-footer-btn:hover{background:#212126}.telebox-color-scheme-dark .netless-app-slide-preview{background:rgba(50,50,50,.9)}.netless-app-slide-wb-view{position:absolute;top:0;left:0;width:100%;height:100%;z-index:100;overflow:hidden}.netless-app-slide-overlay{display:flex;align-items:center;justify-content:center;position:absolute;z-index:200;top:0;left:0;width:100%;height:100%;background:rgba(255,0,0,.25);transition:opacity .3s;opacity:0;pointer-events:none}.netless-app-slide-slide{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.netless-app-slide-slide canvas{transform:scale(var(--netless-app-slide-scale, 1))}
|
|
6002
|
-
`)();function vM({container:m,taskId:y,url:d=Ju,debug:x=!1}){if(!y)throw new Error("[Slide] taskId is required");m.style.cssText+="display:flex;flex-direction:column";const b=new J_({target:m});return b.debug=!!x,b.mount(y,d),b}class J_{constructor(y){this.slide=null,this.debug=!1,this.sideEffect=new qo,this.ready=!1,this.readyPromise=new Promise(d=>{this.resolveReady=()=>{this.ready=!0,d()}}),this.hotkeyListener=d=>{if(this.slide)switch(d.key){case"ArrowUp":case"ArrowLeft":{this.slide.prevStep();break}case"ArrowRight":case"ArrowDown":{this.slide.nextStep();break}}},this.onPageChanged=d=>{this.viewer.setPageIndex(d-1)},this.onTransitionStart=()=>{this.viewer.setPlaying()},this.onTransitionEnd=()=>{this.viewer.setPaused()},this.onError=({error:d})=>{this.viewer.setPaused(),console.warn("[Slide] render error",d)},this.destroyed=!1,this.refreshPages=()=>{this.slide&&(this.viewer.pages=y_(this.slide),this.viewer.setPageIndex(this.getPageIndex(this.slide.slideState.currentSlideIndex)))},this.onPlay=()=>{this.slide&&this.slide.nextStep()},this.onNewPageIndex=d=>{this.slide&&this.slide.slideCount>0&&this.slide.renderSlide(d_(d+1,1,this.slide.slideCount))},this.namespace="netless-app-slide",this.target=y.target,this.bgColor=__(this.target),this.viewer=new q_({readonly:!1,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay}),this.render()}render(){this.viewer.$content.appendChild(this.renderSlideContainer()),this.registerHotKeys(window)}registerHotKeys(y){this.sideEffect.addEventListener(y,"keydown",this.hotkeyListener,void 0,"hotkey")}mount(y,d){this.target.appendChild(this.renderStyle()),this.target.appendChild(this.viewer.$content),this.target.appendChild(this.viewer.$footer),this.slide=new Ze.Slide({anchor:this.$slide,interactive:!0,mode:"local",controller:this.debug,enableGlobalClick:!0,renderOptions:{minFPS:25,maxFPS:30,autoFPS:!0,autoResolution:!0,transactionBgColor:this.bgColor}}),this.registerEventListeners(),this.slide.setResource(y,d),this.slide.renderSlide(1)}renderStyle(){const y=document.createElement("style");return y.appendChild(document.createTextNode(Z_)),y}registerEventListeners(){if(!this.slide)return;const{slide:y}=this;y.on(Ze.SLIDE_EVENTS.slideChange,this.onPageChanged),y.on(Ze.SLIDE_EVENTS.renderStart,this.onTransitionStart),y.on(Ze.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),y.on(Ze.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),y.on(Ze.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),y.on(Ze.SLIDE_EVENTS.renderError,this.onError),y.on(Ze.SLIDE_EVENTS.renderEnd,this.resolveReady),this.readyPromise.then(this.refreshPages)}destroy(){this.sideEffect.flushAll(),this.slide&&!this.destroyed&&(this.slide.destroy(),this.destroyed=!0),this.viewer.destroy()}getPageIndex(y){return(y>0?y:1)-1}renderSlideContainer(){if(!this.$slide){const y=document.createElement("div");y.className=this.wrapClassName("slide"),y.dataset.appKind="Slide",this.$slide=y}return this.$slide}wrapClassName(y){return`${this.namespace}-${y}`}}const _M=Ze.Slide.usePlugin.bind(Ze.Slide),Zu="0.2.
|
|
6001
|
+
`;var h=(l=s.config.logger)===null||l===void 0?void 0:l.error;h&&h("["+a+"] "+o)}},s.logger.info("new slide",s.taskId),s.anchor=s.config.anchor,s.syncQueue=new TS(s.receiveSyncHandler),s.lock=new SS(s.mode==="interactive"),s.cacheImage.style.position="absolute",s.cacheImage.style.zIndex="100",s.setMedianControllerAttribute(),s.canvasContainer.style.position="relative",s.canvasContainer.appendChild(s.medianController),s.frame.appendChild(s.canvasContainer),s.frameResizeObserver.observe(s.frame),s.on(ti.syncReceive,function(o){s.lock.unlock(o.type,o.uuid),s.syncQueue.addTask(o)}),s.renderingTaskManager.eventHub.on("task-error",function(o){var a=o.error,l=o.task,h=ln.transform(a);h.errorType===In.RuntimeWarn?s.logger.warn(h.message,s.taskId):s.logger.error(h.message,s.taskId),s.isLoading=!1,s.reportError(h,l.slideIndex)}),window.addEventListener("__slide_ref__",s.handleSlideRef),s.resizeView=du()(s.resizeView.bind(s),50),s.player=s.initPlayer(s.config),s.config.controller&&s.createController(),s.player.view&&s.canvasContainer.appendChild(s.player.view),s.handleViewClick=du()(s.handleViewClick,300),s.player.errorChannel.on("error",function(o,a){var l=ln.transform(o);l.errorType===In.RuntimeWarn?s.logger.warn(l.message,s.taskId):s.logger.error(l.message,s.taskId),s.isLoading=!1,a===s.renderingIndex&&s.reportError(o,a)}),window.addEventListener("message",s.recoverHandler),s}var e,n;return IS(t,i),t.flushLog=function(r){return r===void 0&&(r=!1),Yn(this,void 0,void 0,function(){return qn(this,function(s){switch(s.label){case 0:return t._tempLog.length>131072||r&&t._tempLog.length>0?[4,bi==null?void 0:bi.setItem("run_time_log_"+t._tempLogIndex,t._tempLog)]:[3,2];case 1:s.sent(),t._tempLog="",t._tempLogIndex+=1,s.label=2;case 2:return[2]}})})},Object.defineProperty(t.prototype,"dispatchIncrId",{get:function(){return this._dispatchIncrId++},enumerable:!1,configurable:!0}),t.prototype.reportError=function(r,s){this.emit(ti.renderError,{error:r,index:s}),window.postMessage({type:"@slide/_error_",errorType:r.errorType,errorMsg:r.errorMsg,slideId:this.randomId,slideIndex:s,customMessage:"@slide/_error_"},"*")},t.prototype.initSlideConfig=function(r){return r.timestamp&&(this.timestamp=r.timestamp),r.rtcAudio&&(gn.RtcAudioClazz=r.rtcAudio),this.mode=r.mode,this.anchor=r.anchor,this.anchor.appendChild(this.frame),this.enableGlobalClick=!Sn()(r.enableGlobalClick)&&r.enableGlobalClick,this.resize=r.resize||!1,this.interactive=r.interactive,this.frame.style.cssText=r.fixedFrameSize?"width:"+r.fixedFrameSize.width+"px;height:"+r.fixedFrameSize.height+"px;":"width:100%;height:100%",this.frame.style.cssText+="display:flex;justify-content:center;align-items:center;visibility:hidden;position:relative;z-index:1;",r.fixedFrameSize&&(this.frameWidth=r.fixedFrameSize.width,this.frameHeight=r.fixedFrameSize.height),r},t.prototype.initPlayer=function(r){var s,o,a,l=this,h=new gn({mode:this.mode,useLocalCache:!!Sn()(this.config.useLocalCache)||this.config.useLocalCache,logger:this.logger,resourceTimeout:Sn()(this.config.resourceTimeout)?15e3:this.config.resourceTimeout,loadDelegate:this.config.loaderDelegate,volumeAdjuster:this.volumeAdjuster});return h.setInteractive(this.interactive),h.updateConfig(r.renderOptions||{}),h.on(de.renderStart,function(c){l.isLoading=!0,l.emit(ti.renderStart,c)}),h.on(de.renderEnd,function(c){l.isLoading=!1,l.player&&(l.designHeight=l.player.designHeight,l.designWidth=l.player.designWidth,l.cacheImage.style.width=l.player.designWidth+"px",l.cacheImage.style.height=l.player.designHeight+"px",l._slideCount=l.player.slideCount),l.emit(ti.renderEnd,c)}),h.on(de.slideChange,function(c){l.__slideState.currentSlideIndex=c,l.emitStateChange(),l.emit(ti.slideChange,c)}),h.on(de.mainSeqStateChange,function(c){l.__slideState.mainSeqState=c,l.emitStateChange()}),h.on(de.mainSeqStepChange,function(c){l.__slideState.mainSeqStep=c,l.emitStateChange()}),h.on(de.interactiveSeqStateChange,function(c){var u=c.id,p=c.state;l.__slideState.interactiveSeqState[u]=p,l.emitStateChange()}),h.on(de.animateStart,function(){l.isAnimating!==!0&&(l.isAnimating=!0,l.emit(ti.animateStart))}),h.on(de.animateEnd,function(){l.isAnimating!==!1&&(l.isAnimating=!1,l.emit(ti.animateEnd))}),h.on(de.interactiveSeqAction,function(c){var u=c.action,p=c.seqId;l.emitSyncDispatch({slideIndex:l.__slideState.currentSlideIndex,type:"interactiveAnim",action:u,seqId:p}),l.emitStateChange()}),h.on(de.mainSeqStepStart,function(c){l.emit(ti.mainSeqStepStart,c)}),h.on(de.mainSeqStepEnd,function(c){l.emit(ti.mainSeqStepEnd,c)}),h.on(de.mediaPlay,function(c){var u={type:"play",time:l.timestamp()-1e3*c.time};l.__slideState.mediaState[c.id]=u,l.emitSyncDispatch({slideIndex:l.__slideState.currentSlideIndex,type:"mediaPlay",id:c.id,state:u}),l.emitStateChange()}),h.on(de.mediaPause,function(c){var u={type:"pause",time:c.time};l.__slideState.mediaState[c.id]=u,l.emitSyncDispatch({slideIndex:l.__slideState.currentSlideIndex,type:"mediaPause",id:c.id,state:u}),l.emitStateChange()}),h.on(de.mediaSeek,function(c){var u={type:"pause",time:0};c.isPlaying?(u.type="play",l.__slideState.mediaState[c.id]?u.time=l.__slideState.mediaState[c.id].time-1e3*c.time:u.time=l.timestamp()-1e3*c.time,l.__slideState.mediaState[c.id]=u):(u.type="pause",u.time=c.time,l.__slideState.mediaState[c.id]=u),l.emitSyncDispatch({slideIndex:l.__slideState.currentSlideIndex,type:"mediaSeek",id:c.id,time:c.time,state:u}),l.emitStateChange()}),h.on(de.requestPrevSlide,function(c){l.handlePrevSlide(c)}),h.on(de.requestNextSlide,function(c){l.handleNextSlide(c)}),h.on(de.requestGotoSlide,function(c){l.config.navigatorDelegate?l.config.navigatorDelegate.gotoPage(c):l.handleGotoSlide(c)}),(s=h.view)===null||s===void 0||s.addEventListener("touchend",this.handleViewTouchEnd),(o=h.view)===null||o===void 0||o.addEventListener("touchstart",this.handleViewTouchStart),(a=h.view)===null||a===void 0||a.addEventListener("click",this.handleViewClick),h.on(de.userInput,this.userInputHandle),h},t.prototype.createController=function(){this.player&&(this.playerController=new wS(this.player,this.frame))},t.prototype.setMedianControllerAttribute=function(){this.medianController.className="median-container",this.medianController.style.position="absolute",this.medianController.style.left="0",this.medianController.style.top="0",this.medianController.style.zIndex="2"},t.prototype.frameResizeHandler=function(){if(!this.config.fixedFrameSize){var r=this.frame.getBoundingClientRect(),s=r.width,o=r.height;this.frameWidth=s,this.frameHeight=o,this.resizeView()}},t.prototype.updateFixedFrameSize=function(r,s,o){this.config.fixedFrameSize&&(this.frameWidth=r,this.frameHeight=s,this.frame.style.width=r+"px",this.frame.style.height=s+"px",this.resizeView(o))},t.prototype.resizeView=function(r){var s,o,a=this,l=this.width,h=this.height;if(l>0&&h>0){var c=this.frameWidth/l,u=c*h;u>this.frameHeight&&(c*=this.frameHeight/u),(s=this.player)===null||s===void 0||s.scaleView(c,this.resize,r),this.cacheImage.style.transform="scale("+c+")",this.medianController.style.transform="scale("+c+")",this.medianController.setAttribute("data-scale",c.toString()),this.isInitResized||(this.isInitResized=!0,(o=this.player)===null||o===void 0||o.clock.setTimeout(function(){a.frame.style.visibility="visible"},32))}},t.prototype.setSlideState=function(r){var s,o,a;return Yn(this,void 0,void 0,function(){var l,h=this;return qn(this,function(c){switch(c.label){case 0:return this.isSyncingSlideState=!0,this.logger.info("stateChange receive "+JSON.stringify(r),this.taskId),r.taskId&&r.taskId!==this.__slideState.taskId&&(this.__slideState.taskId=r.taskId,(s=this.player)===null||s===void 0||s.setResourceData(r.taskId,this.__slideState.url)),r.url&&r.url!==this.__slideState.url&&(this.__slideState.url=r.url,(o=this.player)===null||o===void 0||o.setResourceData(this.__slideState.taskId,r.url)),Number.isInteger(r.currentSlideIndex)&&r.currentSlideIndex!==this.__slideState.currentSlideIndex?(this.__slideState.currentSlideIndex=r.currentSlideIndex,[4,this.doRenderSlide(r.currentSlideIndex)]):[3,2];case 1:c.sent(),c.label=2;case 2:return[4,(a=this.player)===null||a===void 0?void 0:a.clock.waitUntil(function(){var u,p;return((u=h.player)===null||u===void 0?void 0:u.currentIndex)===r.currentSlideIndex&&((p=h.player)===null||p===void 0?void 0:p.currentStage)},3e3)];case 3:return c.sent(),l=!1,Number.isInteger(r.mainSeqStep)&&r.mainSeqStep!==this.__slideState.mainSeqStep&&(l=!0,this.__slideState.mainSeqStep=r.mainSeqStep),r.mainSeqState&&r.mainSeqState!==this.__slideState.mainSeqState&&(l=!0,this.__slideState.mainSeqState=r.mainSeqState),l&&this.setMainSeqStep(this.__slideState.mainSeqStep,this.__slideState.mainSeqState==="idle"?"start":"end"),r.mediaState&&(this.initMedia(r),this.__slideState.mediaState=r.mediaState),r.interactiveSeqState&&(this.initInteractiveSeq(r),this.__slideState.interactiveSeqState=r.interactiveSeqState),this.isSyncingSlideState=!1,[2]}})})},t.prototype.initInteractiveSeq=function(r){var s;for(var o in r.interactiveSeqState){var a=r.interactiveSeqState[o];(s=this.player)===null||s===void 0||s.setInteractiveSeqState(o,a.step,a.state==="idle"?"start":"end")}},t.prototype.initMedia=function(r){var s,o,a=this,l=function(u){var p=r.mediaState[u],f=h.__slideState.mediaState[u];if(f&&p.type===f.type&&p.time===f.time)return"continue";p.type==="play"?(s=h.player)===null||s===void 0||s.setMediaState(u,!0).then(function(){var g,_=a.timestamp();(g=a.player)===null||g===void 0||g.setMediaCurrentTime(u,(_-p.time)/1e3)}):(o=h.player)===null||o===void 0||o.setMediaState(u,!1).then(function(){var g;(g=a.player)===null||g===void 0||g.setMediaCurrentTime(u,p.time)})},h=this;for(var c in r.mediaState)l(c)},Object.defineProperty(t.prototype,"slideCount",{get:function(){return this._slideCount},enumerable:!1,configurable:!0}),t.prototype.getSizeAsync=function(){return Yn(this,void 0,void 0,function(){var r;return qn(this,function(s){switch(s.label){case 0:if(this.width>0&&this.height>0)return[2,[this.width,this.height]];s.label=1;case 1:return s.trys.push([1,4,,5]),[4,fetch(this.__slideState.url+"/"+this.__slideState.taskId+"/jsonOutput/slide-1.json")];case 2:return[4,s.sent().json()];case 3:return[2,[(r=s.sent()).width,r.height]];case 4:return s.sent(),[2,[0,0]];case 5:return[2]}})})},t.prototype.getSlideCountAsync=function(){return Yn(this,void 0,void 0,function(){return qn(this,function(r){switch(r.label){case 0:if(this._slideCount>0)return[2,this._slideCount];r.label=1;case 1:return r.trys.push([1,4,,5]),[4,fetch(this.__slideState.url+"/"+this.__slideState.taskId+"/jsonOutput/slide-1.json")];case 2:return[4,r.sent().json()];case 3:return[2,r.sent().slideCount];case 4:return r.sent(),[2,0];case 5:return[2]}})})},Object.defineProperty(t.prototype,"slideState",{get:function(){return this.__slideState.mainSeqState=this.mainSeqState,this.__slideState.mainSeqStep=this.mainSeqStep,JSON.parse(JSON.stringify(this.__slideState))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mainSeqLength",{get:function(){var r;return((r=this.player)===null||r===void 0?void 0:r.mainSeqLength())||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mainSeqStep",{get:function(){var r;return((r=this.player)===null||r===void 0?void 0:r.mainSeqStep())||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mainSeqState",{get:function(){var r;return((r=this.player)===null||r===void 0?void 0:r.mainSeqState())||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderOptions",{get:function(){var r;return((r=this.player)===null||r===void 0?void 0:r.config)||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"drawCall",{get:function(){var r;return((r=this.player)===null||r===void 0?void 0:r.runtime.drawCall)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderFps",{get:function(){var r;return((r=this.player)===null||r===void 0?void 0:r.runtime.fps)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"runtimeFps",{get:function(){var r;return((r=this.player)===null||r===void 0?void 0:r.fps.value)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"view",{get:function(){var r;return((r=this.player)===null||r===void 0?void 0:r.view)||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.designWidth},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.designHeight},enumerable:!1,configurable:!0}),t.prototype.updateRenderOption=function(r){this.player&&(this.player.updateConfig(r),this.renderOptions&&(this.config.renderOptions=this.renderOptions))},t.prototype.setResource=function(r,s){var o;this.taskId=r,(o=this.player)===null||o===void 0||o.setResourceData(r,s),this.__slideState.taskId=r,this.__slideState.url=s,this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"setResource",taskId:r,url:s})},t.prototype._renderSlide=function(r){var s;return Yn(this,void 0,void 0,function(){var o=this;return qn(this,function(a){switch(a.label){case 0:return this.renderingIndex=r,this.player&&r===this.player.currentIndex?[2]:((gn.platform.isIOS()||gn.platform.isAndroid())&&this.iosResetCache.indexOf(r)<0&&this.iosResetCache.push(r),[4,(s=this.player)===null||s===void 0?void 0:s.renderSlide(r)]);case 1:return a.sent(),this.__slideState.currentSlideIndex=r,this.resizeView(),this.__slideState.interactiveSeqState={},this.emitStateChange(),setTimeout(function(){var l,h;if(((h=(l=o.player)===null||l===void 0?void 0:l.view)===null||h===void 0?void 0:h.style.visibility)==="hidden"&&(o.player.view.style.visibility="visible"),o.frame.style.visibility==="hidden"&&(o.frame.style.visibility="visible"),o.needClearCacheImage)try{o.frame.removeChild(o.cacheImage)}catch{}},100),[2]}})})},t.prototype.renderSlide=function(r,s){if(s===void 0&&(s=!0),this.player){var o=Number(r);(o!==this.player.currentIndex||this.renderingTaskManager.hasStartTask())&&(o>this.slideCount&&this.slideCount>0||this.poseRenderSlide(o,s))}},t.prototype.needCreateNewPlayer=function(){var r=gn.platform.isLowGpuMemory()?15:30;return(gn.platform.isIOS()||gn.platform.isAndroid())&&this.iosResetCache.length>r},t.prototype.poseRenderSlide=function(r,s){this.mode==="interactive"?this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"renderSlide",index:r,isForward:s}):this.mode==="sync"?(this.doRenderSlide(r,s),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"renderSlide",index:r,isForward:s})):this.doRenderSlide(r,s)},t.prototype.doRenderSlide=function(r,s){var o,a,l,h=this;if(s===void 0&&(s=!0),!this.player)return Promise.resolve();if(this.needCreateNewPlayer()&&(this.iosResetCache=[],this.iosNewPlayer=this.initPlayer(this.config),this.iosNewPlayer.setResourceData(this.__slideState.taskId,this.__slideState.url)),this.iosNewPlayer){var c=this.player.getSnapshot();this.cacheImage.src=c,this.frame.appendChild(this.cacheImage),this.player.destroy(),(o=this.playerController)===null||o===void 0||o.destroy(),this.player=this.iosNewPlayer,this.iosNewPlayer=void 0,!((a=this.config)===null||a===void 0)&&a.controller&&this.createController(),this.needClearCacheImage=!0,!((l=this==null?void 0:this.player)===null||l===void 0)&&l.view&&(this.player.view.style.visibility="hidden",this.canvasContainer.appendChild(this.player.view))}var u=Math.random().toString(32).substr(2);return this.player.isForward=s,this.renderingTaskManager.addTask(function(){return h._renderSlide(r)},r,u),new Promise(function(p){h.renderingTaskManager.eventHub.once("task-end-"+u,p)})},t.prototype.nextStep=function(){!this.isLoading&&this.player&&this.interactive?this.player.mainSeqHasNextStep()?this.mode==="interactive"?this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"nextStep",next:this.player.mainSeqStep()+1}):this.mode==="sync"?(this.doNextStep(),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"nextStep",next:this.player.mainSeqStep()})):this.doNextStep():this.handleNextSlide():this.logger.info("prevent nextStep. "+this.isLoading+" "+this.player+" "+this.interactive,this.taskId)},t.prototype.doNextStep=function(r){if(r===void 0&&(r=!1),this.player){this.player.nextStep(r);var s=this.player.mainSeqStep();this.__slideState.mainSeqStep=s,this.emitStateChange()}},t.prototype.prevStep=function(){!this.isLoading&&this.player&&this.interactive?this.player.mainSeqHasPrevStep()?this.mode==="interactive"?this.emitSyncDispatch({type:"prevStep",slideIndex:this.__slideState.currentSlideIndex,next:this.player.mainSeqStep()-1}):this.mode==="sync"?(this.doPrevStep(),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"prevStep",next:this.player.mainSeqStep()})):this.doPrevStep():this.handlePrevSlide():this.logger.info("prevent nextStep. "+this.isLoading+" "+this.player+" "+this.interactive,this.taskId)},t.prototype.doPrevStep=function(r){if(r===void 0&&(r=!1),this.player){this.player.prevStep(r);var s=this.player.mainSeqStep();this.__slideState.mainSeqStep=s,this.emitStateChange()}},t.prototype.isSlideStateReady=function(r){return r.taskId.length>0&&r.url.length>0&&r.currentSlideIndex>0},t.prototype.emitStateChange=function(){if(this.mode!=="local"&&!this.isSyncingSlideState){var r=this.slideState;!WT()(this.lastEmitedState,r)&&this.isSlideStateReady(r)&&(this.lastEmitedState=r,this.emit(ti.stateChange,r),this.logger.info("stateChange dispatch "+JSON.stringify(this.slideState),this.taskId))}},t.prototype.emitSyncDispatch=function(r){if(!this.lock.isLocked(r.type)){var s=Math.random().toString(32).substr(2);this.lock.addLock(r.type,s);var o=Bo(Bo({},r),{uuid:s});this.config.mode==="sync"&&(o.incrId=this.dispatchIncrId),this.emit(ti.syncDispatch,o),this.logger.info("sync dispatch "+JSON.stringify(o),this.taskId)}},t.prototype.setMainSeqStep=function(r,s){var o;(o=this.player)===null||o===void 0||o.setMainSeqStep(r,s)},t.prototype.setInteractive=function(r){var s;this.interactive=r,(s=this.player)===null||s===void 0||s.setInteractive(r)},t.prototype.pause=function(){var r;(r=this.player)===null||r===void 0||r.pause()},t.prototype.resume=function(){var r;(r=this.player)===null||r===void 0||r.resume()},t.prototype._doFrozen=function(){var r;return Yn(this,void 0,void 0,function(){var s,o,a,l=this;return qn(this,function(h){switch(h.label){case 0:return this.logger.info("frozen with player["+!!this.player+"]",this.taskId),this.view&&this.player?[4,this.player.clock.waitUntil(function(){return!l.isLoading},6e4)]:[3,2];case 1:for(o in h.sent(),s=this.player.getSnapshot()||"",this.cacheImage.src=s,this.frame.appendChild(this.cacheImage),this.player.destroy(),(r=this.playerController)===null||r===void 0||r.destroy(),this.player=void 0,this.__slideState.mediaState)a=this.__slideState.mediaState[o],this.__slideState.mediaState[o]=Bo(Bo({},a),{frozenTime:this.timestamp()});h.label=2;case 2:return[2]}})})},t.prototype.frozen=function(){var r=this;this.frozenTaskManager.addTask("frozen",function(){return r._doFrozen()})},t.prototype._doRelease=function(){var r,s;return Yn(this,void 0,void 0,function(){var o,a,l,h;return qn(this,function(c){switch(c.label){case 0:if(this.logger.info("do release slide",this.taskId),this.player)return[2];for(a in this.player=this.initPlayer(this.config),!((r=this.config)===null||r===void 0)&&r.controller&&this.createController(),this.player.view&&(this.canvasContainer.appendChild(this.player.view),this.player.view.style.visibility="hidden"),o=this.__slideState,this.__slideState=p0()(j0),o.mediaState)(l=o.mediaState[a]).type==="play"&&(h=Math.max((s=l.frozenTime)!==null&&s!==void 0?s:0,l.time),l.time=this.timestamp()-(h-l.time),l.frozenTime=void 0);return[4,this.setSlideState(o)];case 1:return c.sent(),[4,this.player.clock.delay(333)];case 2:c.sent(),this.player.view&&(this.player.view.style.visibility="visible");try{this.frame.removeChild(this.cacheImage)}catch{}return[2]}})})},t.prototype.release=function(){var r=this;this.frozenTaskManager.addTask("release",function(){return r._doRelease()})},t.prototype._doDestroy=function(){var r,s,o,a;this.logger.info("do destroy slide",this.taskId),this.playerController&&this.playerController.destroy(),this.frameResizeObserver.disconnect(),(r=this.player)===null||r===void 0||r.removeAllListeners(),(s=this.player)===null||s===void 0||s.destroy(),(o=this.player)===null||o===void 0||o.removeAllListeners(),this.logger={warn:function(){return{}},info:function(){return{}},error:function(){return{}}},this.syncQueue.destroy(),this.renderingTaskManager.destroy(),this.frozenTaskManager.destroy(),window.removeEventListener("__slide_ref__",this.handleSlideRef),window.removeEventListener("message",this.recoverHandler),this.removeAllListeners();try{!((a=this.player)===null||a===void 0)&&a.view&&this.anchor.removeChild(this.player.view),this.anchor.removeChild(this.frame)}catch{}},t.prototype.waitLoadEnd=function(){return Yn(this,void 0,void 0,function(){var r;return qn(this,function(s){switch(s.label){case 0:r=0,s.label=1;case 1:return this.isLoading&&r<10?[4,Gu(100)]:[3,3];case 2:return s.sent(),r+=1,[3,1];case 3:return[2]}})})},t.prototype.preload=function(r){return this.player?this.player.preload(r):Promise.resolve()},t.prototype.destroy=function(){var r=this;this.logger.info("pre destroy slide",""),this.isLoading?this.waitLoadEnd().then(function(){r._doDestroy()}):this._doDestroy()},t.prototype.clearSlideCache=function(){var r;(r=this.player)===null||r===void 0||r.clearLocalCache()},t.prototype.hasNextStep=function(){if(!this.player)return!1;var r=this.player.currentIndex===this.slideCount,s=this.mainSeqLength===0||this.mainSeqStep>=this.mainSeqLength-1,o=this.mainSeqState==="end"||this.mainSeqState==="running"||this.mainSeqState==null;return!(r&&s&&o)},t.prototype.hasPrevStep=function(){if(!this.player)return!1;var r=this.player.currentIndex===1,s=this.mainSeqLength===0||this.mainSeqStep===0,o=this.mainSeqState==="idle"||this.mainSeqState===null;return!(r&&s&&o)},t.prototype.updateGlobalVolume=function(r){this.volumeAdjuster.volume=r},t.prototype.getGlobalVolume=function(){return this.volumeAdjuster.volume},t.clearLocalCache=function(){gn.clearLocalCache()},t.disposeLocalCache=function(){},e=t,t._tempLog="",t._tempLogIndex=1,t.usePlugin=jT,t.handleLogReport=function(r){return Yn(void 0,void 0,void 0,function(){var s,o,a,l,h,c;return qn(e,function(u){switch(u.label){case 0:return[4,t.flushLog(!0)];case 1:return u.sent(),bi?[4,bi.keys()]:[3,6];case 2:s=(u.sent()||[]).sort(function(p,f){return parseInt(p.replace("run_time_log_",""))-parseInt(f.replace("run_time_log_",""))}),o=0,a=s,u.label=3;case 3:return o<a.length?(l=a[o],h=l.replace("run_time_log_",""),[4,bi.getItem(l)]):[3,6];case 4:c=u.sent(),window.postMessage({type:"@slide/_report_log_",log:c,index:parseInt(h,10),total:s.length,customMessage:"@slide/_report_log_",sessionId:r},"*"),u.label=5;case 5:return o++,[3,3];case 6:return[2]}})})},t.handleLogDownload=function(){return Yn(void 0,void 0,void 0,function(){var r,s,o,a,l,h,c;return qn(e,function(u){switch(u.label){case 0:return[4,t.flushLog(!0)];case 1:return u.sent(),r="",bi?[4,bi.keys()]:[3,6];case 2:s=(u.sent()||[]).sort(function(p,f){return parseInt(p.replace("run_time_log_",""))-parseInt(f.replace("run_time_log_",""))}),o=0,a=s,u.label=3;case 3:return o<a.length?(l=a[o],h=r,[4,bi.getItem(l)]):[3,6];case 4:r=h+(u.sent()||""),u.label=5;case 5:return o++,[3,3];case 6:return(c=document.createElement("a")).setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(r)),c.setAttribute("download","slide_log"),c.style.display="none",document.body.appendChild(c),c.click(),document.body.removeChild(c),[2]}})})},RS([(n="Slide.initConfig",function(r,s,o){var a=o.value;o.value=function(){for(var l=[],h=0;h<arguments.length;h++)l[h]=arguments[h];for(var c=Tu.get(n)||[],u=l,p=0,f=c;p<f.length;p++){var g=f[p];try{u=g.before(u)}catch{}if(!Array.isArray(u)||u.length!==l.length)throw new Error("plugin before hook return invalid args")}for(var _=a.bind(this).apply(void 0,u),v=0,M=c.reverse();v<M.length;v++){g=M[v];try{_=g.after(_)}catch{}if(!_)throw new Error("plugin after hook return undefined result")}return _}})],t.prototype,"initSlideConfig",null),t}(cn.a);bi==null||bi.clear(),window.addEventListener("__slide_log__",Go.handleLogDownload),window.addEventListener("message",function(i){i.data.type==="@slide/_request_log_"&&Go.handleLogReport(i.data.sessionId).catch(function(){})}),window.setInterval(function(){Go.flushLog().catch(function(){})},2e3)}]);const BS="!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",GS=87,HS=20,i_=[],zS=()=>{for(let m=0;m<HS;m++)i_[m]=BS.charAt(Math.random()*GS);return i_.join("")};function u_(m){try{return m()}catch(y){console.error(y)}}class qo{constructor(){this.push=this.addDisposer,this.disposers=new Map}addDisposer(y,d=this.genUID()){return this.flush(d),this.disposers.set(d,Array.isArray(y)?jS(y):y),d}add(y,d=this.genUID()){const x=y();return x?this.addDisposer(x,d):d}addEventListener(y,d,x,b,C=this.genUID()){return y.addEventListener(d,x,b),this.addDisposer(()=>y.removeEventListener(d,x,b),C),C}setTimeout(y,d,x=this.genUID()){const b=window.setTimeout(()=>{this.remove(x),y()},d);return this.addDisposer(()=>window.clearTimeout(b),x)}setInterval(y,d,x=this.genUID()){const b=window.setInterval(y,d);return this.addDisposer(()=>window.clearInterval(b),x)}remove(y){const d=this.disposers.get(y);return this.disposers.delete(y),d}flush(y){const d=this.remove(y);d&&d()}flushAll(){this.disposers.forEach(u_),this.disposers.clear()}genUID(){let y;do y=zS();while(this.disposers.has(y));return y}}function jS(m){return()=>m.forEach(u_)}function d_(m,y,d){return Math.min(Math.max(m,y),d)}function VS(m){return typeof m=="object"&&m!==null}var p_={exports:{}},WS={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},f_={exports:{}},XS=function(y){return!y||typeof y=="string"?!1:y instanceof Array||Array.isArray(y)||y.length>=0&&(y.splice instanceof Function||Object.getOwnPropertyDescriptor(y,y.length-1)&&y.constructor.name!=="String")},YS=XS,qS=Array.prototype.concat,$S=Array.prototype.slice,r_=f_.exports=function(y){for(var d=[],x=0,b=y.length;x<b;x++){var C=y[x];YS(C)?d=qS.call(d,$S.call(C)):d.push(C)}return d};r_.wrap=function(m){return function(){return m(r_(arguments))}};var Xo=WS,$o=f_.exports,m_=Object.hasOwnProperty,g_=Object.create(null);for(var Wu in Xo)m_.call(Xo,Wu)&&(g_[Xo[Wu]]=Wu);var ii=p_.exports={to:{},get:{}};ii.get=function(m){var y=m.substring(0,3).toLowerCase(),d,x;switch(y){case"hsl":d=ii.get.hsl(m),x="hsl";break;case"hwb":d=ii.get.hwb(m),x="hwb";break;default:d=ii.get.rgb(m),x="rgb";break}return d?{model:x,value:d}:null};ii.get.rgb=function(m){if(!m)return null;var y=/^#([a-f0-9]{3,4})$/i,d=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,x=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,b=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,C=/^(\w+)$/,T=[0,0,0,1],S,N,I;if(S=m.match(d)){for(I=S[2],S=S[1],N=0;N<3;N++){var L=N*2;T[N]=parseInt(S.slice(L,L+2),16)}I&&(T[3]=parseInt(I,16)/255)}else if(S=m.match(y)){for(S=S[1],I=S[3],N=0;N<3;N++)T[N]=parseInt(S[N]+S[N],16);I&&(T[3]=parseInt(I+I,16)/255)}else if(S=m.match(x)){for(N=0;N<3;N++)T[N]=parseInt(S[N+1],0);S[4]&&(S[5]?T[3]=parseFloat(S[4])*.01:T[3]=parseFloat(S[4]))}else if(S=m.match(b)){for(N=0;N<3;N++)T[N]=Math.round(parseFloat(S[N+1])*2.55);S[4]&&(S[5]?T[3]=parseFloat(S[4])*.01:T[3]=parseFloat(S[4]))}else return(S=m.match(C))?S[1]==="transparent"?[0,0,0,0]:m_.call(Xo,S[1])?(T=Xo[S[1]],T[3]=1,T):null:null;for(N=0;N<3;N++)T[N]=Er(T[N],0,255);return T[3]=Er(T[3],0,1),T};ii.get.hsl=function(m){if(!m)return null;var y=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,d=m.match(y);if(d){var x=parseFloat(d[4]),b=(parseFloat(d[1])%360+360)%360,C=Er(parseFloat(d[2]),0,100),T=Er(parseFloat(d[3]),0,100),S=Er(isNaN(x)?1:x,0,1);return[b,C,T,S]}return null};ii.get.hwb=function(m){if(!m)return null;var y=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,d=m.match(y);if(d){var x=parseFloat(d[4]),b=(parseFloat(d[1])%360+360)%360,C=Er(parseFloat(d[2]),0,100),T=Er(parseFloat(d[3]),0,100),S=Er(isNaN(x)?1:x,0,1);return[b,C,T,S]}return null};ii.to.hex=function(){var m=$o(arguments);return"#"+Ol(m[0])+Ol(m[1])+Ol(m[2])+(m[3]<1?Ol(Math.round(m[3]*255)):"")};ii.to.rgb=function(){var m=$o(arguments);return m.length<4||m[3]===1?"rgb("+Math.round(m[0])+", "+Math.round(m[1])+", "+Math.round(m[2])+")":"rgba("+Math.round(m[0])+", "+Math.round(m[1])+", "+Math.round(m[2])+", "+m[3]+")"};ii.to.rgb.percent=function(){var m=$o(arguments),y=Math.round(m[0]/255*100),d=Math.round(m[1]/255*100),x=Math.round(m[2]/255*100);return m.length<4||m[3]===1?"rgb("+y+"%, "+d+"%, "+x+"%)":"rgba("+y+"%, "+d+"%, "+x+"%, "+m[3]+")"};ii.to.hsl=function(){var m=$o(arguments);return m.length<4||m[3]===1?"hsl("+m[0]+", "+m[1]+"%, "+m[2]+"%)":"hsla("+m[0]+", "+m[1]+"%, "+m[2]+"%, "+m[3]+")"};ii.to.hwb=function(){var m=$o(arguments),y="";return m.length>=4&&m[3]!==1&&(y=", "+m[3]),"hwb("+m[0]+", "+m[1]+"%, "+m[2]+"%"+y+")"};ii.to.keyword=function(m){return g_[m.slice(0,3)]};function Er(m,y,d){return Math.min(Math.max(y,m),d)}function Ol(m){var y=Math.round(m).toString(16).toUpperCase();return y.length<2?"0"+y:y}var ZS=p_.exports;class JS{constructor(y){this.enable=y,this.apps={},this.level="debug",this.roomLogger=null,this._onMessage=d=>{let x;d instanceof CustomEvent?x=d.detail:VS(d.data)&&(x=d.data),x&&(typeof x.slide=="boolean"?this.enable=x.slide:x.slide==="__instance"?console.log(this):x.slide==="__debug"&&Object.values(this.apps).forEach(b=>{var C,T;(T=(C=b.controller)==null?void 0:C.slide)==null||T.createController()}))},this.initialize()}setAppContext(y,d){var x;((x=this.apps)[y]||(x[y]={})).context=d,this.log(`[Slide] new ${y}`)}setAppController(y,d){var x;((x=this.apps)[y]||(x[y]={})).controller=d}deleteApp(y){delete this.apps[y],this.log(`[Slide] delete ${y}`)}initialize(){window.addEventListener("message",this._onMessage)}dispose(){window.removeEventListener("message",this._onMessage)}log(...y){this.roomLogger?this.roomLogger.info(...y):this.enable&&console.log(...y)}verbose(...y){this.roomLogger?this.roomLogger.debug(...y):this.enable&&this.level==="verbose"&&console.log(...y)}warn(...y){this.roomLogger?this.roomLogger.warn(...y):console.warn(...y)}}const ci=new JS(!1),yn=ci.log.bind(ci),Xu=ci.verbose.bind(ci),KS=m=>{ci.roomLogger=m.logger};function v_(m){try{const y=window.getComputedStyle(m).backgroundColor;if(y!=="rgba(0, 0, 0, 0)"&&y!=="transparent")return y;if(m.parentElement)return v_(m.parentElement)}catch{}return"#ffffff"}function QS(m){const y=ZS.get(m);if(y&&y.model==="rgb"){const d=y.value,b=(((Math.round(d[0])&255)<<16)+((Math.round(d[1])&255)<<8)+(Math.round(d[2])&255)).toString(16);return"#"+"000000".substring(b.length)+b}else return m}let Dl="";function __(m){return Dl||(Dl=QS(v_(m)),yn("[Slide] guess bg color",Dl)),Dl}function y_(m){const{width:y,height:d,slideCount:x,slideState:b}=m,{taskId:C,url:T}=b,S=[];for(let N=1;N<=x;++N)S.push({width:y,height:d,thumbnail:`${T}/${C}/preview/${N}.png`,src:"ppt"});return S}function s_(m,y,d,x){var S;const b=d.slideState.currentSlideIndex;if(!(b>0)||!y.getIsWritable())return;const C=[x,b].join("/");if(m.scenePathType(C)!=="page"){m.removeScenes(x);const N=d.slideCount,I=[];for(let L=1;L<=N;++L)I.push({name:`${L}`});m.putScenes(x,I)}let T;y.getBox().focus?T=m.state.sceneState.scenePath:T=((S=y.getView())==null?void 0:S.focusScenePath)||"",T!==C&&y.setScenePath(C)}const Ju="https://convertcdn.netless.link/dynamicConvert",t2=40,Yu={taskId:"",url:"",state:null};class e2{constructor({context:y,anchor:d,onPageChanged:x,onTransitionStart:b,onTransitionEnd:C,onError:T}){this.sideEffect=new qo,this.ready=!1,this.readyPromise=new Promise(S=>{this.resolveReady=()=>{this.ready?yn("[Slide] render end"):setTimeout(()=>{this.ready=!0,S()},1e3)}}),this.onSyncDispatch=S=>{if(this.context.getIsWritable()&&this.room){const N={type:Ze.SLIDE_EVENTS.syncDispatch,payload:S};Xu("[Slide] dispatch",JSON.stringify(S)),this.context.dispatchMagixEvent(Ze.SLIDE_EVENTS.syncDispatch,N)}},this.magixEventListener=S=>{const{type:N,payload:I}=S.payload;N===Ze.SLIDE_EVENTS.syncDispatch&&(this.syncStateOnce(),Xu("[Slide] receive",JSON.stringify(I)),this.slide.emit(Ze.SLIDE_EVENTS.syncReceive,I))},this.onStateChange=S=>{this.context.getIsWritable()&&(Xu("[Slide] state change",JSON.stringify(S,null,2)),this.context.storage.setState({state:S}))},this.pollCount=0,this.pollReadyState=()=>{this.ready?this._toFreeze===1?this.freeze():this._toFreeze===-1&&this.unfreeze():this.pollCount<t2?(this.pollCount++,setTimeout(this.pollReadyState,500)):(this.pollCount=0,yn("[Slide] renderSlide 1 (retry after timeout)"),this.slide.renderSlide(1))},this._pageCount=0,this.destroyed=!1,this.timestamp=()=>this.room&&this.room.calibrationTimestamp?this.room.calibrationTimestamp:this.player?this.player.beginTimestamp+this.player.progressTime:Date.now(),this.isFrozen=!1,this._toFreeze=0,this.freeze=()=>{this.isFrozen=!0,this.ready?(yn("[Slide] freeze",this.context.appId),this.slide.frozen()):this._toFreeze=1},this.unfreeze=async()=>{!this.visible||(this.isFrozen=!1,this.ready?(yn("[Slide] unfreeze",this.context.appId),this.slide.release()):this._toFreeze=-1)},this.onVisibilityChange=async()=>{(this.visible=document.visibilityState==="visible")?(yn("[Slide] unfreeze because tab becomes visible",{savedIsFrozen:this.savedIsFrozen}),this.savedIsFrozen||this.unfreeze()):(this.savedIsFrozen=this.isFrozen,yn("[Slide] freeze because tab becomes invisible"),this.freeze())},this.onPageChanged=x,this.onTransitionStart=b,this.onTransitionEnd=C,this.onError=T,this.context=y,this.room=y.getRoom(),this.player=this.room?void 0:y.getDisplayer(),KS(this.room||this.player),this.slide=this.createSlide(d),this.syncStateOnceFlag=!this.context.isAddApp,this.visible=document.visibilityState==="visible",this.savedIsFrozen=!1,this.initialize()}jumpToPage(y){this.ready&&(y=d_(y,1,this.pageCount),this.slide.renderSlide(y))}initialize(){this.registerEventListeners(),this.kickStart()}kickStart(){const{context:y,slide:d}=this;y.getIsWritable()&&y.storage.ensureState(Yu);const{taskId:x,url:b,state:C}=y.storage.state;d.setResource(x,b||Ju),C?(yn("[Slide] init with state",JSON.stringify(C)),this.syncStateOnceFlag=!1,d.setSlideState(C)):y.isAddApp&&(yn("[Slide] init by renderSlide",1),d.renderSlide(1)),this.pollReadyState()}registerEventListeners(){const{context:y,slide:d}=this,x=this.sideEffect.addDisposer(y.storage.addStateChangedListener(()=>{y.storage.state.state&&(this.syncStateOnce(),this.sideEffect.flush(x))}));this.sideEffect.add(()=>y.addMagixEventListener(Ze.SLIDE_EVENTS.syncDispatch,this.magixEventListener,{fireSelfEventAfterCommit:!0})),d.on(Ze.SLIDE_EVENTS.slideChange,this.onPageChanged),d.on(Ze.SLIDE_EVENTS.renderStart,this.onTransitionStart),d.on(Ze.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),d.on(Ze.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),d.on(Ze.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),d.on(Ze.SLIDE_EVENTS.renderError,this.onError),d.on(Ze.SLIDE_EVENTS.stateChange,this.onStateChange),d.on(Ze.SLIDE_EVENTS.syncDispatch,this.onSyncDispatch),d.on(Ze.SLIDE_EVENTS.renderEnd,this.resolveReady),this.sideEffect.add(()=>(document.addEventListener("visibilitychange",this.onVisibilityChange),()=>document.removeEventListener("visibilitychange",this.onVisibilityChange)))}syncStateOnce(){if(this.syncStateOnceFlag){this.context.getIsWritable()&&this.context.storage.ensureState(Yu);const{state:y}=this.context.storage.state;y&&(yn("[Slide] sync with state (once)",JSON.stringify(y)),this.slide.setSlideState(y),this.syncStateOnceFlag=!1)}}get pageCount(){return this._pageCount>0?this._pageCount:(this._pageCount=this.slide.slideCount,this._pageCount)}get page(){return this.slide.slideState.currentSlideIndex}createSlide(y){var b,C;const d=this.context.getAppOptions()||{};return new Ze.Slide({anchor:y,interactive:!0,mode:"interactive",controller:ci.enable,enableGlobalClick:!0,renderOptions:{minFPS:d.minFPS||25,maxFPS:d.maxFPS||30,autoFPS:(b=d.autoFPS)!=null?b:!0,autoResolution:(C=d.autoResolution)!=null?C:!0,resolution:d.resolution,transactionBgColor:d.bgColor||__(y),maxResolutionLevel:d.maxResolutionLevel},fixedFrameSize:d.fixedFrameSize,loaderDelegate:d.loaderDelegate,navigatorDelegate:d.navigatorDelegate,resourceTimeout:d.resourceTimeout,rtcAudio:d.rtcAudio,useLocalCache:d.useLocalCache,logger:d.logger,timestamp:this.timestamp})}destroy(){this.sideEffect.flushAll(),this.destroyed||(yn("[Slide] destroy slide (once)"),this.slide.destroy(),this.destroyed=!0)}}function n2(m){const y="http://www.w3.org/2000/svg",d=document.createElementNS(y,"svg");d.setAttribute("class",`${m}-footer-icon-sidebar`),d.setAttribute("viewBox","0 0 64 64");const x=document.createElementNS(y,"path");return x.setAttribute("fill","currentColor"),x.setAttribute("d","M50 8H14c-3.309 0-6 2.691-6 6v36c0 3.309 2.691 6 6 6h36c3.309 0 6-2.691 6-6V14c0-3.309-2.691-6-6-6zM12 50V14c0-1.103.897-2 2-2h8v40h-8c-1.103 0-2-.897-2-2zm40 0c0 1.103-.897 2-2 2H26V12h24c1.103 0 2 .897 2 2z"),d.appendChild(x),d}function i2(m){const y="http://www.w3.org/2000/svg",d=document.createElementNS(y,"svg");d.setAttribute("class",`${m}-footer-icon-arrow-left`),d.setAttribute("viewBox","0 0 500 500");const x=document.createElementNS(y,"path");return x.setAttribute("fill","currentColor"),x.setAttribute("d","M177.81 249.959L337.473 90.295c2.722-2.865 2.651-7.378-.143-10.1-2.793-2.65-7.163-2.65-9.956 0l-164.75 164.75c-2.793 2.793-2.793 7.306 0 10.1l164.75 164.75c2.865 2.722 7.378 2.65 10.099-.143 2.651-2.794 2.651-7.163 0-9.957L177.809 249.959z"),d.appendChild(x),d}function r2(m){const y="http://www.w3.org/2000/svg",d=document.createElementNS(y,"svg");d.setAttribute("class",`${m}-footer-icon-arrow-right`),d.setAttribute("viewBox","0 0 500 500");const x=document.createElementNS(y,"path");return x.setAttribute("fill","currentColor"),x.setAttribute("d","M322.19 250.041L162.527 409.705c-2.722 2.865-2.651 7.378.143 10.1 2.793 2.65 7.163 2.65 9.956 0l164.75-164.75c2.793-2.793 2.793-7.306 0-10.1l-164.75-164.75c-2.865-2.722-7.378-2.65-10.099.143-2.651 2.794-2.651 7.163 0 9.957l159.664 159.736z"),d.appendChild(x),d}function s2(m){const y="http://www.w3.org/2000/svg",d=document.createElementNS(y,"svg");d.setAttribute("class",`${m}-footer-icon-play`),d.setAttribute("viewBox","0 0 500 500");const x=document.createElementNS(y,"path");return x.setAttribute("fill","currentColor"),x.setAttribute("d","M418.158 257.419L174.663 413.33c-6.017 3.919-15.708 3.772-21.291-.29-2.791-2.018-4.295-4.483-4.295-7.084V94.109c0-5.65 6.883-10.289 15.271-10.289 4.298 0 8.391 1.307 11.181 3.332l242.629 155.484c6.016 3.917 6.451 10.292.649 14.491-.216.154-.432.154-.649.292zM170.621 391.288l223.116-141.301L170.71 107.753l-.089 283.535z"),d.appendChild(x),d}function o2(m){const y="http://www.w3.org/2000/svg",d=document.createElementNS(y,"svg");d.setAttribute("class",`${m}-footer-icon-pause`),d.setAttribute("viewBox","0 0 500 500");const x=document.createElementNS(y,"path");return x.setAttribute("fill","currentColor"),x.setAttribute("d","M312.491 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261zM165.257 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261z"),d.appendChild(x),d}const Tr=typeof window!="undefined",x_=Tr&&!("onscroll"in window)||typeof navigator!="undefined"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),b_=Tr&&"IntersectionObserver"in window,E_=Tr&&"classList"in document.createElement("p"),w_=Tr&&window.devicePixelRatio>1,a2={elements_selector:".lazy",container:x_||Tr?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},T_=m=>Object.assign({},a2,m),o_=function(m,y){let d;const x="LazyLoad::Initialized",b=new m(y);try{d=new CustomEvent(x,{detail:{instance:b}})}catch{d=document.createEvent("CustomEvent"),d.initCustomEvent(x,!1,!1,{instance:b})}window.dispatchEvent(d)},l2=(m,y)=>{if(!!y)if(!y.length)o_(m,y);else for(let d=0,x;x=y[d];d+=1)o_(m,x)},tr="src",Ku="srcset",Qu="sizes",S_="poster",Zo="llOriginalAttrs",M_="data",td="loading",A_="loaded",P_="applied",h2="entered",ed="error",C_="native",I_="data-",R_="ll-status",Zn=(m,y)=>m.getAttribute(I_+y),c2=(m,y,d)=>{var x=I_+y;if(d===null){m.removeAttribute(x);return}m.setAttribute(x,d)},Jo=m=>Zn(m,R_),Vr=(m,y)=>c2(m,R_,y),Ul=m=>Vr(m,null),nd=m=>Jo(m)===null,u2=m=>Jo(m)===td,d2=m=>Jo(m)===ed,id=m=>Jo(m)===C_,p2=[td,A_,P_,ed],f2=m=>p2.indexOf(Jo(m))>=0,Sr=(m,y,d,x)=>{if(!!m){if(x!==void 0){m(y,d,x);return}if(d!==void 0){m(y,d);return}m(y)}},Os=(m,y)=>{if(E_){m.classList.add(y);return}m.className+=(m.className?" ":"")+y},Bi=(m,y)=>{if(E_){m.classList.remove(y);return}m.className=m.className.replace(new RegExp("(^|\\s+)"+y+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},m2=m=>{m.llTempImage=document.createElement("IMG")},g2=m=>{delete m.llTempImage},L_=m=>m.llTempImage,Bl=(m,y)=>{if(!y)return;const d=y._observer;!d||d.unobserve(m)},v2=m=>{m.disconnect()},_2=(m,y,d)=>{y.unobserve_entered&&Bl(m,d)},rd=(m,y)=>{!m||(m.loadingCount+=y)},y2=m=>{!m||(m.toLoadCount-=1)},N_=(m,y)=>{!m||(m.toLoadCount=y)},x2=m=>m.loadingCount>0,b2=m=>m.toLoadCount>0,O_=m=>{let y=[];for(let d=0,x;x=m.children[d];d+=1)x.tagName==="SOURCE"&&y.push(x);return y},sd=(m,y)=>{const d=m.parentNode;if(!d||d.tagName!=="PICTURE")return;O_(d).forEach(y)},D_=(m,y)=>{O_(m).forEach(y)},Gl=[tr],F_=[tr,S_],Yo=[tr,Ku,Qu],k_=[M_],Hl=m=>!!m[Zo],U_=m=>m[Zo],B_=m=>delete m[Zo],Ns=(m,y)=>{if(Hl(m))return;const d={};y.forEach(x=>{d[x]=m.getAttribute(x)}),m[Zo]=d},E2=m=>{Hl(m)||(m[Zo]={backgroundImage:m.style.backgroundImage})},w2=(m,y,d)=>{if(!d){m.removeAttribute(y);return}m.setAttribute(y,d)},jr=(m,y)=>{if(!Hl(m))return;const d=U_(m);y.forEach(x=>{w2(m,x,d[x])})},T2=m=>{if(!Hl(m))return;const y=U_(m);m.style.backgroundImage=y.backgroundImage},G_=(m,y,d)=>{Os(m,y.class_applied),Vr(m,P_),d&&(y.unobserve_completed&&Bl(m,y),Sr(y.callback_applied,m,d))},H_=(m,y,d)=>{Os(m,y.class_loading),Vr(m,td),d&&(rd(d,1),Sr(y.callback_loading,m,d))},wr=(m,y,d)=>{!d||m.setAttribute(y,d)},a_=(m,y)=>{wr(m,Qu,Zn(m,y.data_sizes)),wr(m,Ku,Zn(m,y.data_srcset)),wr(m,tr,Zn(m,y.data_src))},S2=(m,y)=>{sd(m,d=>{Ns(d,Yo),a_(d,y)}),Ns(m,Yo),a_(m,y)},M2=(m,y)=>{Ns(m,Gl),wr(m,tr,Zn(m,y.data_src))},A2=(m,y)=>{D_(m,d=>{Ns(d,Gl),wr(d,tr,Zn(d,y.data_src))}),Ns(m,F_),wr(m,S_,Zn(m,y.data_poster)),wr(m,tr,Zn(m,y.data_src)),m.load()},P2=(m,y)=>{Ns(m,k_),wr(m,M_,Zn(m,y.data_src))},C2=(m,y,d)=>{const x=Zn(m,y.data_bg),b=Zn(m,y.data_bg_hidpi),C=w_&&b?b:x;!C||(m.style.backgroundImage=`url("${C}")`,L_(m).setAttribute(tr,C),H_(m,y,d))},I2=(m,y,d)=>{const x=Zn(m,y.data_bg_multi),b=Zn(m,y.data_bg_multi_hidpi),C=w_&&b?b:x;!C||(m.style.backgroundImage=C,G_(m,y,d))},R2=(m,y,d)=>{const x=Zn(m,y.data_bg_set);if(!x)return;const b=x.split("|");let C=b.map(T=>`image-set(${T})`);m.style.backgroundImage=C.join(),m.style.backgroundImage===""&&(C=b.map(T=>`-webkit-image-set(${T})`),m.style.backgroundImage=C.join()),G_(m,y,d)},z_={IMG:S2,IFRAME:M2,VIDEO:A2,OBJECT:P2},L2=(m,y)=>{const d=z_[m.tagName];!d||d(m,y)},N2=(m,y,d)=>{const x=z_[m.tagName];!x||(x(m,y),H_(m,y,d))},O2=["IMG","IFRAME","VIDEO","OBJECT"],D2=m=>O2.indexOf(m.tagName)>-1,j_=(m,y)=>{y&&!x2(y)&&!b2(y)&&Sr(m.callback_finish,y)},l_=(m,y,d)=>{m.addEventListener(y,d),m.llEvLisnrs[y]=d},F2=(m,y,d)=>{m.removeEventListener(y,d)},od=m=>!!m.llEvLisnrs,k2=(m,y,d)=>{od(m)||(m.llEvLisnrs={});const x=m.tagName==="VIDEO"?"loadeddata":"load";l_(m,x,y),l_(m,"error",d)},qu=m=>{if(!od(m))return;const y=m.llEvLisnrs;for(let d in y){const x=y[d];F2(m,d,x)}delete m.llEvLisnrs},V_=(m,y,d)=>{g2(m),rd(d,-1),y2(d),Bi(m,y.class_loading),y.unobserve_completed&&Bl(m,d)},U2=(m,y,d,x)=>{const b=id(y);V_(y,d,x),Os(y,d.class_loaded),Vr(y,A_),Sr(d.callback_loaded,y,x),b||j_(d,x)},B2=(m,y,d,x)=>{const b=id(y);V_(y,d,x),Os(y,d.class_error),Vr(y,ed),Sr(d.callback_error,y,x),d.restore_on_error&&jr(y,Yo),b||j_(d,x)},ad=(m,y,d)=>{const x=L_(m)||m;if(od(x))return;k2(x,T=>{U2(T,m,y,d),qu(x)},T=>{B2(T,m,y,d),qu(x)})},G2=(m,y,d)=>{m2(m),ad(m,y,d),E2(m),C2(m,y,d),I2(m,y,d),R2(m,y,d)},H2=(m,y,d)=>{ad(m,y,d),N2(m,y,d)},ld=(m,y,d)=>{D2(m)?H2(m,y,d):G2(m,y,d)},z2=(m,y,d)=>{m.setAttribute("loading","lazy"),ad(m,y,d),L2(m,y),Vr(m,C_)},h_=m=>{m.removeAttribute(tr),m.removeAttribute(Ku),m.removeAttribute(Qu)},j2=m=>{sd(m,y=>{h_(y)}),h_(m)},W_=m=>{sd(m,y=>{jr(y,Yo)}),jr(m,Yo)},V2=m=>{D_(m,y=>{jr(y,Gl)}),jr(m,F_),m.load()},W2=m=>{jr(m,Gl)},X2=m=>{jr(m,k_)},Y2={IMG:W_,IFRAME:W2,VIDEO:V2,OBJECT:X2},q2=m=>{const y=Y2[m.tagName];if(!y){T2(m);return}y(m)},$2=(m,y)=>{nd(m)||id(m)||(Bi(m,y.class_entered),Bi(m,y.class_exited),Bi(m,y.class_applied),Bi(m,y.class_loading),Bi(m,y.class_loaded),Bi(m,y.class_error))},Z2=(m,y)=>{q2(m),$2(m,y),Ul(m),B_(m)},J2=(m,y,d,x)=>{!d.cancel_on_exit||!u2(m)||m.tagName==="IMG"&&(qu(m),j2(m),W_(m),Bi(m,d.class_loading),rd(x,-1),Ul(m),Sr(d.callback_cancel,m,y,x))},K2=(m,y,d,x)=>{const b=f2(m);Vr(m,h2),Os(m,d.class_entered),Bi(m,d.class_exited),_2(m,d,x),Sr(d.callback_enter,m,y,x),!b&&ld(m,d,x)},Q2=(m,y,d,x)=>{nd(m)||(Os(m,d.class_exited),J2(m,y,d,x),Sr(d.callback_exit,m,y,x))},tM=["IMG","IFRAME","VIDEO"],X_=m=>m.use_native&&"loading"in HTMLImageElement.prototype,eM=(m,y,d)=>{m.forEach(x=>{tM.indexOf(x.tagName)!==-1&&z2(x,y,d)}),N_(d,0)},nM=m=>m.isIntersecting||m.intersectionRatio>0,iM=m=>({root:m.container===document?null:m.container,rootMargin:m.thresholds||m.threshold+"px"}),rM=(m,y,d)=>{m.forEach(x=>nM(x)?K2(x.target,x,y,d):Q2(x.target,x,y,d))},sM=(m,y)=>{y.forEach(d=>{m.observe(d)})},oM=(m,y)=>{v2(m),sM(m,y)},aM=(m,y)=>{!b_||X_(m)||(y._observer=new IntersectionObserver(d=>{rM(d,m,y)},iM(m)))},Y_=m=>Array.prototype.slice.call(m),Fl=m=>m.container.querySelectorAll(m.elements_selector),lM=m=>Y_(m).filter(nd),hM=m=>d2(m),cM=m=>Y_(m).filter(hM),c_=(m,y)=>lM(m||Fl(y)),uM=(m,y)=>{cM(Fl(m)).forEach(x=>{Bi(x,m.class_error),Ul(x)}),y.update()},dM=(m,y)=>{!Tr||(y._onlineHandler=()=>{uM(m,y)},window.addEventListener("online",y._onlineHandler))},pM=m=>{!Tr||window.removeEventListener("online",m._onlineHandler)},Ko=function(m,y){const d=T_(m);this._settings=d,this.loadingCount=0,aM(d,this),dM(d,this),this.update(y)};Ko.prototype={update:function(m){const y=this._settings,d=c_(m,y);if(N_(this,d.length),x_||!b_){this.loadAll(d);return}if(X_(y)){eM(d,y,this);return}oM(this._observer,d)},destroy:function(){this._observer&&this._observer.disconnect(),pM(this),Fl(this._settings).forEach(m=>{B_(m)}),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(m){const y=this._settings;c_(m,y).forEach(x=>{Bl(x,this),ld(x,y,this)})},restoreAll:function(){const m=this._settings;Fl(m).forEach(y=>{Z2(y,m)})}};Ko.load=(m,y)=>{const d=T_(y);ld(m,d)};Ko.resetStatus=m=>{Ul(m)};Tr&&l2(Ko,window.lazyLoadOptions);class q_{constructor({readonly:y,onNewPageIndex:d,onPlay:x}){this._pages=[],this.pageIndex=0,this.setPaused=()=>{this.$btnPlay.classList.toggle(this.wrapClassName("footer-btn-playing"),!1)},this.setPlaying=()=>{this.$btnPlay.classList.toggle(this.wrapClassName("footer-btn-playing"),!0)},this.namespace="netless-app-slide",this.isShowPreview=!1,this.isSmallBox=!1,this.sideEffect=new qo,this.readonly=y,this.onNewPageIndex=d,this.onPlay=x,this.render()}set pages(y){this._pages=y,this.refreshPreview(),this.refreshTotalPage(),this.refreshBtnSidebar()}get pages(){return this._pages}unmount(){this.$content.remove(),this.$footer.remove()}setReadonly(y){this.readonly=y,this.$content.classList.toggle(this.wrapClassName("readonly"),y),this.$footer.classList.toggle(this.wrapClassName("readonly"),y),this.$pageNumberInput.disabled=y}destroy(){this.sideEffect.flushAll(),this.unmount()}setPageIndex(y){Number.isNaN(y)||(this.pageIndex=y,this.$pageNumberInput.value=String(y+1))}refreshTotalPage(){this.pages.length?this.$totalPage.textContent=" / "+this.pages.length:this.$totalPage.textContent=""}setSmallBox(y){this.isSmallBox!==y&&(this.isSmallBox=y,this.$footer.classList.toggle(this.wrapClassName("float-footer"),y))}render(){return this.renderContent(),this.renderFooter(),this.$content}renderContent(){if(!this.$content){const y=document.createElement("div");y.className=this.wrapClassName("content"),this.$content=y,this.readonly&&y.classList.add(this.wrapClassName("readonly")),y.appendChild(this.renderPreviewMask()),y.appendChild(this.renderPreview())}return this.$content}renderPreview(){if(!this.$preview){const y=document.createElement("div");y.className=this.wrapClassName("preview")+" tele-fancy-scrollbar",this.$preview=y,this.sideEffect.add(()=>(this.previewLazyLoad=new Ko({container:this.$preview,elements_selector:`.${this.wrapClassName("preview-page>img")}`}),()=>{var d;return(d=this.previewLazyLoad)==null?void 0:d.destroy()})),this.refreshPreview(),this.sideEffect.addEventListener(y,"click",d=>{var b;if(this.readonly)return;const x=(b=d.target.dataset)==null?void 0:b.pageIndex;x&&(d.preventDefault(),d.stopPropagation(),d.stopImmediatePropagation(),this.onNewPageIndex(Number(x)),this.togglePreview(!1))})}return this.$preview}refreshPreview(){var b;const{$preview:y}=this,d=this.wrapClassName("preview-page"),x=this.wrapClassName("preview-page-name");for(;y.firstChild;)y.firstChild.remove();this.pages.forEach((C,T)=>{var K;const S=(K=C.thumbnail)!=null?K:C.src.startsWith("ppt")?void 0:C.src;if(!S)return;const N=String(T),I=document.createElement("a");I.className=d+" "+this.wrapClassName(`preview-page-${T}`),I.setAttribute("href","#"),I.dataset.pageIndex=N;const L=document.createElement("span");L.className=x,L.textContent=String(T+1),L.dataset.pageIndex=N;const k=document.createElement("img");k.width=C.width,k.height=C.height,k.dataset.src=S,k.dataset.pageIndex=N,I.appendChild(k),I.appendChild(L),y.appendChild(I)}),(b=this.previewLazyLoad)==null||b.update()}renderPreviewMask(){return this.$previewMask||(this.$previewMask=document.createElement("div"),this.$previewMask.className=this.wrapClassName("preview-mask"),this.sideEffect.addEventListener(this.$previewMask,"click",y=>{this.readonly||y.target===this.$previewMask&&this.togglePreview(!1)})),this.$previewMask}refreshBtnSidebar(){this.$btnSidebar.style.display=this.pages.length>0?"":"none"}renderFooter(){if(!this.$footer){const y=document.createElement("div");y.className=this.wrapClassName("footer"),this.$footer=y,this.readonly&&y.classList.add(this.wrapClassName("readonly")),this.isSmallBox&&y.classList.add(this.wrapClassName("float-footer"));const d=this.renderFooterBtn("btn-sidebar",n2(this.namespace));this.sideEffect.addEventListener(d,"click",()=>{this.readonly||this.togglePreview()}),this.$btnSidebar=d,this.$btnSidebar.style.display="none",this.$footer.appendChild(d);const x=document.createElement("div");x.className=this.wrapClassName("page-jumps");const b=this.renderFooterBtn("btn-page-back",i2(this.namespace));if(this.sideEffect.addEventListener(b,"click",()=>{this.readonly||this.onNewPageIndex(this.pageIndex-1)}),x.appendChild(b),this.onPlay){const I=this.renderFooterBtn("btn-page-play",s2(this.namespace),o2(this.namespace));this.$btnPlay=I,this.sideEffect.addEventListener(I,"click",()=>{this.readonly||(this.setPlaying(),this.onPlay&&this.onPlay())}),x.appendChild(I)}const C=this.renderFooterBtn("btn-page-next",r2(this.namespace));this.sideEffect.addEventListener(C,"click",()=>{this.readonly||this.onNewPageIndex(this.pageIndex+1)}),x.appendChild(C);const T=document.createElement("div");T.className=this.wrapClassName("page-number");const S=document.createElement("input");S.className=this.wrapClassName("page-number-input"),S.value=String(this.pageIndex+1),this.readonly&&(S.disabled=!0),this.$pageNumberInput=S,this.sideEffect.addEventListener(S,"focus",()=>{S.select()}),this.sideEffect.addEventListener(S,"change",()=>{this.readonly||S.value&&this.onNewPageIndex(Number(S.value)-1)});const N=document.createElement("span");this.$totalPage=N,T.appendChild(S),T.appendChild(N),this.$footer.appendChild(x),this.$footer.appendChild(T)}return this.$footer}renderFooterBtn(y,d,x){const b=document.createElement("button");return b.className=this.wrapClassName("footer-btn")+" "+this.wrapClassName(y),b.appendChild(d),x&&b.appendChild(x),b}togglePreview(y){if(this.isShowPreview=y!=null?y:!this.isShowPreview,this.$content.classList.toggle(this.wrapClassName("preview-active"),this.isShowPreview),this.isShowPreview){const d=this.$preview.querySelector("."+this.wrapClassName(`preview-page-${this.pageIndex}`));d&&this.$preview.scrollTo({top:d.offsetTop-16})}}wrapClassName(y){return`${this.namespace}-${y}`}}const fM=new Set(["clicker"]);class mM{constructor({box:y,view:d,mountSlideController:x,mountWhiteboard:b}){this.slideController=null,this.isViewMounted=!1,this.onError=({error:C})=>{var T;this.viewer.setPaused(),this.$overlay.textContent=`Error on slide[page=${(T=this.slideController)==null?void 0:T.page}]: ${C.message}`,this.$overlay.style.opacity="1",ci.warn("[Slide] render error",C)},this.onRenderEnd=()=>{this.$overlay.style.opacity=""},this.refreshPages=()=>{this.slideController&&(this.viewer.pages=y_(this.slideController.slide),this.viewer.setPageIndex(this.getPageIndex(this.slideController.page)),this.scaleDocsToFit())},this.scaleDocsToFit=()=>{if(this.slideController){const{width:C,height:T}=this.slideController.slide;C&&T&&(this.whiteboardView.moveCameraToContain({originX:-C/2,originY:-T/2,width:C,height:T,animationMode:"immediately"}),this.whiteboardView.setCameraBound({damping:1,maxContentMode:()=>this.whiteboardView.camera.scale,minContentMode:()=>this.whiteboardView.camera.scale,centerX:0,centerY:0,width:C,height:T}),this.isViewMounted||(this.isViewMounted=!0,console.log("[Slide] mount whiteboard view"),this.mountWhiteboard(this.$whiteboardView)))}},this.onPlay=()=>{this.slideController&&this.slideController.slide.nextStep()},this.onNewPageIndex=C=>{this.slideController&&this.slideController.jumpToPage(C+1)},this.sideEffect=new qo,this.namespace="netless-app-slide",this.box=y,this.whiteboardView=d,this.mountSlideController=x,this.mountWhiteboard=b,this.viewer=new q_({readonly:y.readonly,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay}),this.sideEffect.add(()=>{const C=T=>{this.setReadonly(T)};return y.events.on("readonly",C),()=>y.events.off("readonly",C)}),this.render()}render(){this.viewer.$content.appendChild(this.renderSlideContainer()),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.viewer.$content.appendChild(this.renderOverlay()),this.sideEffect.addEventListener(window,"keydown",y=>{if(this.box.focus&&this.slideController)switch(y.key){case"ArrowUp":case"ArrowLeft":{this.slideController.slide.prevStep();break}case"ArrowRight":case"ArrowDown":{this.slideController.slide.nextStep();break}}})}renderOverlay(){if(!this.$overlay){const y=document.createElement("div");y.className=this.wrapClassName("overlay"),this.$overlay=y}return this.$overlay}renderSlideContainer(){if(!this.$slide){const y=document.createElement("div");y.className=this.wrapClassName("slide"),y.dataset.appKind="Slide",this.$slide=y}return this.$slide}renderWhiteboardView(){return this.$whiteboardView||(this.$whiteboardView=document.createElement("div"),this.$whiteboardView.className=this.wrapClassName("wb-view")),this.$whiteboardView}mount(){return this.box.mountContent(this.viewer.$content),this.box.mountFooter(this.viewer.$footer),this.slideController=this.mountSlideController({anchor:this.$slide,onRenderEnd:this.onRenderEnd,onTransitionStart:this.viewer.setPlaying,onTransitionEnd:this.viewer.setPaused,onReady:this.refreshPages,onError:this.onError}),this.scaleDocsToFit(),this.sideEffect.add(()=>(this.whiteboardView.callbacks.on("onSizeUpdated",this.scaleDocsToFit),()=>this.whiteboardView.callbacks.off("onSizeUpdated",this.scaleDocsToFit))),this}getPageIndex(y){return(y>0?y:1)-1}unmount(){return this.slideController&&(this.slideController.destroy(),this.slideController=null),this.viewer.unmount(),this}setReadonly(y){this.viewer.setReadonly(y)}destroy(){this.sideEffect.flushAll(),this.unmount(),this.viewer.destroy()}toggleClickThrough(y){this.$whiteboardView.style.pointerEvents=!y||fM.has(y)?"none":"auto"}wrapClassName(y){return`${this.namespace}-${y}`}}let $u=!1;const $_=2,Wo=m=>"["+m+"]",kl={map:new Map,boxes:new Map,queue:[],validateQueue(){for(this.queue.sort((m,y)=>{var b,C,T,S;const d=(C=(b=this.boxes.get(m))==null?void 0:b.zIndex)!=null?C:0,x=(S=(T=this.boxes.get(y))==null?void 0:T.zIndex)!=null?S:0;return-(d-x)}),yn("[Slide] freezer: validate",Wo(this.queue));this.queue.length>$_;){const m=this.queue.pop(),y=this.map.get(m);y&&(yn("[Slide] freezer: validate-freeze",m,Wo(this.queue)),y.freeze())}},set(m,y,d){yn("[Slide] freezer: add",m,Wo(this.queue)),this.map.set(m,y),this.boxes.set(m,d),this.queue.includes(m)||this.queue.unshift(m),this.validateQueue()},delete(m){this.map.delete(m),this.boxes.delete(m),this.queue=this.queue.filter(y=>y!==m),yn("[Slide] freezer: delete",m,Wo(this.queue))},focus(m){const y=this.map.get(m),d=this.queue.indexOf(m);d>-1&&this.queue.splice(d,1),this.queue.unshift(m),this.validateQueue(),yn("[Slide] freezer: focus",m,Wo(this.queue)),y&&y.unfreeze()}},gM=m=>{$u=!0,m.on("focus",({appId:y})=>{kl.focus(y)})};var Z_=(()=>`.netless-app-slide-content{position:relative;height:100%;overflow:hidden}.netless-app-slide-preview-mask{display:none;position:absolute;z-index:200;top:0;left:0;width:100%;height:100%}.netless-app-slide-preview{display:flex;flex-direction:column;align-items:center;position:absolute;z-index:300;top:0;left:0;width:33%;max-width:200px;height:100%;padding-top:10px;transform:translate(-100%);background:rgba(237,237,240,.9);box-shadow:inset -1px 0 #0000001c;transition:transform .4s}.netless-app-slide-preview-active .netless-app-slide-preview-mask{display:block}.netless-app-slide-preview-active .netless-app-slide-preview{transform:translate(0)}.netless-app-slide-preview-page{position:relative;display:block;width:55%;margin-bottom:10px;font-size:0;color:transparent;outline:none;border:7px solid transparent;border-radius:4px;transition:border-color .3s;user-select:none}.netless-app-slide-preview-page:hover,.netless-app-slide-preview-page.netless-app-slide-preview-page-active{border-color:#444e601a}.netless-app-slide-preview-page>img{width:100%;height:auto;box-sizing:border-box;border:1px solid rgba(0,0,0,.5);border-radius:1px;background-color:#fff;box-shadow:0 2px 8px #0000004d}.netless-app-slide-preview-page-name{position:absolute;top:1px;left:-10px;transform:translate(-100%);text-align:right;font-size:12px;color:#5f5f5f;user-select:none}.netless-app-slide-footer{box-sizing:border-box;height:26px;display:flex;align-items:center;padding:0 16px;border-top:1px solid #eeeef7;color:#191919}.netless-app-slide-float-footer{width:100%;min-height:26px;position:absolute;left:0;bottom:0;z-index:2000;background:rgba(249,249,252,.9);transition:opacity .4s}.netless-app-slide-footer-btn{box-sizing:border-box;width:26px;height:26px;font-size:0;margin:0;padding:3px;border:none;border-radius:1px;outline:none;color:currentColor;background:transparent;transition:background .4s;cursor:pointer;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-slide-footer-btn:hover{background:rgba(237,237,240,.9)}@media (hover: none){.netless-app-slide-footer-btn:hover{background:transparent!important}}.netless-app-slide-footer-btn>svg{width:100%;height:100%}.netless-app-slide-footer-btn>svg:nth-of-type(2){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(1){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(2){display:initial}.netless-app-slide-footer-btn~.netless-app-slide-footer-btn{margin-left:15px}.netless-app-slide-page-jumps{flex:1;display:flex;justify-content:center;align-items:center}.netless-app-slide-page-number{margin-left:auto;font-size:13px;user-select:none;white-space:nowrap;word-break:keep-all}.netless-app-slide-page-number-input{border:none;outline:none;width:3em;margin:0;padding:0 2px;text-align:right;font-size:13px;line-height:1;font-weight:400;font-family:inherit;border-radius:2px;color:currentColor;background:transparent;transition:background .4s;user-select:text;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-slide-page-number-input:hover,.netless-app-slide-page-number-input:focus,.netless-app-slide-page-number-input:active{background:#fff;box-shadow:#63636333 0 2px 8px}.netless-app-slide-readonly.netless-app-slide-footer{display:none}.telebox-color-scheme-dark .netless-app-slide-page-number-input{color:#a6a6a8}.telebox-color-scheme-dark .netless-app-slide-page-number-input:active,.telebox-color-scheme-dark .netless-app-slide-page-number-input:focus,.telebox-color-scheme-dark .netless-app-slide-page-number-input:hover{color:#222}.telebox-color-scheme-dark .netless-app-slide-footer{color:#a6a6a8;background:#2d2d33;border-top:none}.telebox-color-scheme-dark .netless-app-slide-footer-btn:hover{background:#212126}.telebox-color-scheme-dark .netless-app-slide-preview{background:rgba(50,50,50,.9)}.netless-app-slide-wb-view{position:absolute;top:0;left:0;width:100%;height:100%;z-index:100;overflow:hidden}.netless-app-slide-overlay{display:flex;align-items:center;justify-content:center;position:absolute;z-index:200;top:0;left:0;width:100%;height:100%;background:rgba(255,0,0,.25);transition:opacity .3s;opacity:0;pointer-events:none}.netless-app-slide-slide{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.netless-app-slide-slide canvas{transform:scale(var(--netless-app-slide-scale, 1))}
|
|
6002
|
+
`)();function vM({container:m,taskId:y,url:d=Ju,debug:x=!1}){if(!y)throw new Error("[Slide] taskId is required");m.style.cssText+="display:flex;flex-direction:column";const b=new J_({target:m});return b.debug=!!x,b.mount(y,d),b}class J_{constructor(y){this.slide=null,this.debug=!1,this.sideEffect=new qo,this.ready=!1,this.readyPromise=new Promise(d=>{this.resolveReady=()=>{this.ready=!0,d()}}),this.hotkeyListener=d=>{if(this.slide)switch(d.key){case"ArrowUp":case"ArrowLeft":{this.slide.prevStep();break}case"ArrowRight":case"ArrowDown":{this.slide.nextStep();break}}},this.onPageChanged=d=>{this.viewer.setPageIndex(d-1)},this.onTransitionStart=()=>{this.viewer.setPlaying()},this.onTransitionEnd=()=>{this.viewer.setPaused()},this.onError=({error:d})=>{this.viewer.setPaused(),console.warn("[Slide] render error",d)},this.destroyed=!1,this.refreshPages=()=>{this.slide&&(this.viewer.pages=y_(this.slide),this.viewer.setPageIndex(this.getPageIndex(this.slide.slideState.currentSlideIndex)))},this.onPlay=()=>{this.slide&&this.slide.nextStep()},this.onNewPageIndex=d=>{this.slide&&this.slide.slideCount>0&&this.slide.renderSlide(d_(d+1,1,this.slide.slideCount))},this.namespace="netless-app-slide",this.target=y.target,this.bgColor=__(this.target),this.viewer=new q_({readonly:!1,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay}),this.render()}render(){this.viewer.$content.appendChild(this.renderSlideContainer()),this.registerHotKeys(window)}registerHotKeys(y){this.sideEffect.addEventListener(y,"keydown",this.hotkeyListener,void 0,"hotkey")}mount(y,d){this.target.appendChild(this.renderStyle()),this.target.appendChild(this.viewer.$content),this.target.appendChild(this.viewer.$footer),this.slide=new Ze.Slide({anchor:this.$slide,interactive:!0,mode:"local",controller:this.debug,enableGlobalClick:!0,renderOptions:{minFPS:25,maxFPS:30,autoFPS:!0,autoResolution:!0,transactionBgColor:this.bgColor}}),this.registerEventListeners(),this.slide.setResource(y,d),this.slide.renderSlide(1)}renderStyle(){const y=document.createElement("style");return y.appendChild(document.createTextNode(Z_)),y}registerEventListeners(){if(!this.slide)return;const{slide:y}=this;y.on(Ze.SLIDE_EVENTS.slideChange,this.onPageChanged),y.on(Ze.SLIDE_EVENTS.renderStart,this.onTransitionStart),y.on(Ze.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),y.on(Ze.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),y.on(Ze.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),y.on(Ze.SLIDE_EVENTS.renderError,this.onError),y.on(Ze.SLIDE_EVENTS.renderEnd,this.resolveReady),this.readyPromise.then(this.refreshPages)}destroy(){this.sideEffect.flushAll(),this.slide&&!this.destroyed&&(this.slide.destroy(),this.destroyed=!0),this.viewer.destroy()}getPageIndex(y){return(y>0?y:1)-1}renderSlideContainer(){if(!this.$slide){const y=document.createElement("div");y.className=this.wrapClassName("slide"),y.dataset.appKind="Slide",this.$slide=y}return this.$slide}wrapClassName(y){return`${this.namespace}-${y}`}}const _M=Ze.Slide.usePlugin.bind(Ze.Slide),Zu="0.2.14",yM={kind:"Slide",setup(m){if(console.log("[Slide] setup @ "+Zu),m.getIsWritable()&&m.storage.ensureState(Yu),!m.storage.state.taskId)throw new Error("[Slide] no taskId");const y=m.getView();if(!y)throw new Error("[Slide] no view, please set scenePath on addApp()");y.disableCameraTransform=!0;const d=m.getBox();d.mountStyles(Z_);try{d.$content.dataset.appSlideVersion=Zu}catch{}const x=m.getInitScenePath();let b=null;const C=I=>{const L=m.getRoom();if(b&&b.slideController){let k=!1;L&&m.getIsWritable()&&(s_(L,m,b.slideController.slide,x),k=!0),yn("[Slide] page to",I,k?"(synced)":""),b.viewer.setPageIndex(I-1)}},T=I=>{const L=new e2(n_(Vu({context:m},I),{onPageChanged:C}));return $u&&kl.set(m.appId,L,d),ci.setAppController(m.appId,L),L.readyPromise.then(I.onReady).then(()=>{const k=m.getRoom();let K=!1;k&&m.getIsWritable()&&(s_(k,m,L.slide,x),K=!0);const ut=L.slide.slideState.currentSlideIndex;yn("[Slide] page to",ut,K?"(synced)":"","(on ready)"),L.slide.on("renderEnd",I.onRenderEnd)}),L};b=new mM({box:d,view:y,mountSlideController:T,mountWhiteboard:m.mountView.bind(m)});const S=m.getRoom(),N=new qo;return N.add(()=>{var I;return ci.setAppContext(m.appId,m),ci.enable=((I=m.getAppOptions())==null?void 0:I.debug)||!1,ci.level="debug",()=>ci.deleteApp(m.appId)}),S&&(b.toggleClickThrough(S.state.memberState.currentApplianceName),N.add(()=>{const I=L=>{L.memberState&&b&&b.toggleClickThrough(L.memberState.currentApplianceName)};return S.callbacks.on("onRoomStateChanged",I),()=>S.callbacks.off("onRoomStateChanged",I)})),m.emitter.on("destroy",()=>{yn("[Slide] destroy",m.appId),$u&&kl.delete(m.appId),N.flushAll(),b&&(b.destroy(),b=null)}),b.mount(),{slide:()=>{var I;return(I=b==null?void 0:b.slideController)==null?void 0:I.slide},nextStep:()=>{var I;return b&&b.slideController?((I=b==null?void 0:b.slideController)==null||I.slide.nextStep(),!0):!1},prevStep:()=>{var I;return b&&b.slideController?((I=b==null?void 0:b.slideController)==null||I.slide.prevStep(),!0):!1},position:()=>{const I=b==null?void 0:b.slideController;if(I)return[I.page,I.pageCount]},nextPage:()=>{const I=b==null?void 0:b.slideController;if(I){const{page:L,pageCount:k}=I;if(k>0&&L<k)return I.jumpToPage(L+1),!0}return!1},prevPage:()=>{const I=b==null?void 0:b.slideController;if(I){const{page:L,pageCount:k}=I;if(k>0&&L>1)return I.jumpToPage(L-1),!0}return!1},jumpToPage:I=>{const L=b==null?void 0:b.slideController;if(L){const{page:k,pageCount:K}=L;if(K>0&&k>0&&k<=K)return L.jumpToPage(I),!0}return!1}}}};exports.DefaultUrl=Ju;exports.FreezerLength=$_;exports.Slide=Ze.Slide;exports.SlidePreviewer=J_;exports.addHooks=gM;exports.apps=kl;exports.default=yM;exports.previewSlide=vM;exports.usePlugin=_M;exports.version=Zu;
|
|
6003
6003
|
//# sourceMappingURL=main.cjs.js.map
|