@netless/app-slide 0.2.3 → 0.2.4
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/index.d.ts +2 -0
- package/dist/main.cjs.js +16 -16
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +10 -8
- package/dist/main.es.js.map +1 -1
- package/dist/main.iife.js +50 -50
- package/dist/main.iife.js.map +1 -1
- package/package.json +1 -1
- package/src/SlideController/index.ts +8 -6
- package/src/index.ts +2 -0
package/dist/main.cjs.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"use strict";var qI=Object.defineProperty,YI=Object.defineProperties;var $I=Object.getOwnPropertyDescriptors;var XS=Object.getOwnPropertySymbols;var JI=Object.prototype.hasOwnProperty,ZI=Object.prototype.propertyIsEnumerable;var qS=(T,M,v)=>M in T?qI(T,M,{enumerable:!0,configurable:!0,writable:!0,value:v}):T[M]=v,H_=(T,M)=>{for(var v in M||(M={}))JI.call(M,v)&&qS(T,v,M[v]);if(XS)for(var v of XS(M))ZI.call(M,v)&&qS(T,v,M[v]);return T},YS=(T,M)=>YI(T,$I(M));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const rT="!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",KI=rT.length,$S=Array(20),QI=()=>{for(let T=0;T<20;T++)$S[T]=rT.charAt(Math.random()*KI);return $S.join("")};function JS(T){try{return T()}catch(M){console.error(M)}}class Dp{constructor(){this.disposers=new Map}addDisposer(M,v=this.genUID()){return this.flush(v),this.disposers.set(v,Array.isArray(M)?()=>M.forEach(JS):M),v}add(M,v=this.genUID()){const b=M();return b?this.addDisposer(b,v):v}addEventListener(M,v,b,q,ht=this.genUID()){return M.addEventListener(v,b,q),this.addDisposer(()=>M.removeEventListener(v,b,q),ht),ht}setTimeout(M,v,b=this.genUID()){const q=window.setTimeout(()=>{this.remove(b),M()},v);return this.addDisposer(()=>window.clearTimeout(q),b)}setInterval(M,v,b=this.genUID()){const q=window.setInterval(M,v);return this.addDisposer(()=>window.clearInterval(q),b)}remove(M){const v=this.disposers.get(M);return this.disposers.delete(M),v}flush(M){const v=this.remove(M);if(v)try{v()}catch(b){console.error(b)}}flushAll(){this.disposers.forEach(JS),this.disposers.clear()}genUID(){let M;do M=QI();while(this.disposers.has(M));return M}}var _n=function(T){var M={};function v(b){if(M[b])return M[b].exports;var q=M[b]={i:b,l:!1,exports:{}};return T[b].call(q.exports,q,q.exports,v),q.l=!0,q.exports}return v.m=T,v.c=M,v.d=function(b,q,ht){v.o(b,q)||Object.defineProperty(b,q,{enumerable:!0,get:ht})},v.r=function(b){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(b,"__esModule",{value:!0})},v.t=function(b,q){if(1&q&&(b=v(b)),8&q||4&q&&typeof b=="object"&&b&&b.__esModule)return b;var ht=Object.create(null);if(v.r(ht),Object.defineProperty(ht,"default",{enumerable:!0,value:b}),2&q&&typeof b!="string")for(var W in b)v.d(ht,W,function(
|
|
1
|
+
"use strict";var qI=Object.defineProperty,YI=Object.defineProperties;var $I=Object.getOwnPropertyDescriptors;var XS=Object.getOwnPropertySymbols;var JI=Object.prototype.hasOwnProperty,ZI=Object.prototype.propertyIsEnumerable;var qS=(T,M,v)=>M in T?qI(T,M,{enumerable:!0,configurable:!0,writable:!0,value:v}):T[M]=v,H_=(T,M)=>{for(var v in M||(M={}))JI.call(M,v)&&qS(T,v,M[v]);if(XS)for(var v of XS(M))ZI.call(M,v)&&qS(T,v,M[v]);return T},YS=(T,M)=>YI(T,$I(M));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const rT="!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",KI=rT.length,$S=Array(20),QI=()=>{for(let T=0;T<20;T++)$S[T]=rT.charAt(Math.random()*KI);return $S.join("")};function JS(T){try{return T()}catch(M){console.error(M)}}class Dp{constructor(){this.disposers=new Map}addDisposer(M,v=this.genUID()){return this.flush(v),this.disposers.set(v,Array.isArray(M)?()=>M.forEach(JS):M),v}add(M,v=this.genUID()){const b=M();return b?this.addDisposer(b,v):v}addEventListener(M,v,b,q,ht=this.genUID()){return M.addEventListener(v,b,q),this.addDisposer(()=>M.removeEventListener(v,b,q),ht),ht}setTimeout(M,v,b=this.genUID()){const q=window.setTimeout(()=>{this.remove(b),M()},v);return this.addDisposer(()=>window.clearTimeout(q),b)}setInterval(M,v,b=this.genUID()){const q=window.setInterval(M,v);return this.addDisposer(()=>window.clearInterval(q),b)}remove(M){const v=this.disposers.get(M);return this.disposers.delete(M),v}flush(M){const v=this.remove(M);if(v)try{v()}catch(b){console.error(b)}}flushAll(){this.disposers.forEach(JS),this.disposers.clear()}genUID(){let M;do M=QI();while(this.disposers.has(M));return M}}var _n=function(T){var M={};function v(b){if(M[b])return M[b].exports;var q=M[b]={i:b,l:!1,exports:{}};return T[b].call(q.exports,q,q.exports,v),q.l=!0,q.exports}return v.m=T,v.c=M,v.d=function(b,q,ht){v.o(b,q)||Object.defineProperty(b,q,{enumerable:!0,get:ht})},v.r=function(b){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(b,"__esModule",{value:!0})},v.t=function(b,q){if(1&q&&(b=v(b)),8&q||4&q&&typeof b=="object"&&b&&b.__esModule)return b;var ht=Object.create(null);if(v.r(ht),Object.defineProperty(ht,"default",{enumerable:!0,value:b}),2&q&&typeof b!="string")for(var W in b)v.d(ht,W,function(P){return b[P]}.bind(null,W));return ht},v.n=function(b){var q=b&&b.__esModule?function(){return b.default}:function(){return b};return v.d(q,"a",q),q},v.o=function(b,q){return Object.prototype.hasOwnProperty.call(b,q)},v.p="",v(v.s=64)}([function(T,M,v){(function(b,q){var ht;/**
|
|
2
2
|
* @license
|
|
3
3
|
* Lodash <https://lodash.com/>
|
|
4
4
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
5
5
|
* Released under MIT license <https://lodash.com/license>
|
|
6
6
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
7
7
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
8
|
-
*/(function(){var W="Expected a function",C="__lodash_placeholder__",V=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],z="[object Arguments]",k="[object Array]",Z="[object Boolean]",vt="[object Date]",Ot="[object Error]",Nt="[object Function]",E="[object GeneratorFunction]",L="[object Map]",O="[object Number]",Y="[object Object]",P="[object RegExp]",j="[object Set]",X="[object String]",K="[object Symbol]",qt="[object WeakMap]",ge="[object ArrayBuffer]",Ct="[object DataView]",ot="[object Float32Array]",yt="[object Float64Array]",Pt="[object Int8Array]",H="[object Int16Array]",ft="[object Int32Array]",Et="[object Uint8Array]",At="[object Uint16Array]",Rt="[object Uint32Array]",Wt=/\b__p \+= '';/g,$t=/\b(__p \+=) '' \+/g,ye=/(__e\(.*?\)|\b__t\)) \+\n'';/g,me=/&(?:amp|lt|gt|quot|#39);/g,ui=/[&<>"']/g,be=RegExp(me.source),ei=RegExp(ui.source),Ze=/<%-([\s\S]+?)%>/g,ri=/<%([\s\S]+?)%>/g,De=/<%=([\s\S]+?)%>/g,Bi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Di=/^\w*$/,Ci=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ki=/[\\^$.*+?()[\]{}|]/g,Ii=RegExp(Ki.source),Ui=/^\s+/,On=/\s/,Qi=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Yn=/\{\n\/\* \[wrapped with (.+)\] \*/,$n=/,? & /,La=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Hs=/[()=,{}\[\]\/\s]/,zu=/\\(\\)?/g,Oa=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Zr=/\w*$/,J=/^[-+]0x[0-9a-f]+$/i,st=/^0b[01]+$/i,at=/^\[object .+?Constructor\]$/,Tt=/^0o[0-7]+$/i,bt=/^(?:0|[1-9]\d*)$/,wt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,zt=/($^)/,ne=/['\n\r\u2028\u2029\\]/g,se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ae="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",xe="[\\ud800-\\udfff]",Ie="["+ae+"]",Ge="["+se+"]",qe="\\d+",pi="[\\u2700-\\u27bf]",fi="[a-z\\xdf-\\xf6\\xf8-\\xff]",Sr="[^\\ud800-\\udfff"+ae+qe+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",Lo="\\ud83c[\\udffb-\\udfff]",zs="[^\\ud800-\\udfff]",Cl="(?:\\ud83c[\\udde6-\\uddff]){2}",qi="[\\ud800-\\udbff][\\udc00-\\udfff]",as="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Gp="(?:"+fi+"|"+Sr+")",js="(?:"+as+"|"+Sr+")",Hp="(?:"+Ge+"|"+Lo+")?",ls="[\\ufe0e\\ufe0f]?"+Hp+("(?:\\u200d(?:"+[zs,Cl,qi].join("|")+")[\\ufe0e\\ufe0f]?"+Hp+")*"),zp="(?:"+[pi,Cl,qi].join("|")+")"+ls,jp="(?:"+[zs+Ge+"?",Ge,Cl,qi,xe].join("|")+")",Pl=RegExp("['\u2019]","g"),Vp=RegExp(Ge,"g"),Vs=RegExp(Lo+"(?="+Lo+")|"+jp+ls,"g"),Oo=RegExp([as+"?"+fi+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?="+[Ie,as,"$"].join("|")+")",js+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?="+[Ie,as+Gp,"$"].join("|")+")",as+"?"+Gp+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?",as+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",qe,zp].join("|"),"g"),Ws=RegExp("[\\u200d\\ud800-\\udfff"+se+"\\ufe0e\\ufe0f]"),Wp=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Xp=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],qp=-1,Pi={};Pi[ot]=Pi[yt]=Pi[Pt]=Pi[H]=Pi[ft]=Pi[Et]=Pi["[object Uint8ClampedArray]"]=Pi[At]=Pi[Rt]=!0,Pi[z]=Pi[k]=Pi[ge]=Pi[Z]=Pi[Ct]=Pi[vt]=Pi[Ot]=Pi[Nt]=Pi[L]=Pi[O]=Pi[Y]=Pi[P]=Pi[j]=Pi[X]=Pi[qt]=!1;var Fi={};Fi[z]=Fi[k]=Fi[ge]=Fi[Ct]=Fi[Z]=Fi[vt]=Fi[ot]=Fi[yt]=Fi[Pt]=Fi[H]=Fi[ft]=Fi[L]=Fi[O]=Fi[Y]=Fi[P]=Fi[j]=Fi[X]=Fi[K]=Fi[Et]=Fi["[object Uint8ClampedArray]"]=Fi[At]=Fi[Rt]=!0,Fi[Ot]=Fi[Nt]=Fi[qt]=!1;var No={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Tr=parseFloat,Yp=parseInt,Fc=typeof b=="object"&&b&&b.Object===Object&&b,$p=typeof self=="object"&&self&&self.Object===Object&&self,tn=Fc||$p||Function("return this")(),Xs=M&&!M.nodeType&&M,Na=Xs&&typeof q=="object"&&q&&!q.nodeType&&q,Bc=Na&&Na.exports===Xs,ju=Bc&&Fc.process,Er=function(){try{var It=Na&&Na.require&&Na.require("util").types;return It||ju&&ju.binding&&ju.binding("util")}catch{}}(),kc=Er&&Er.isArrayBuffer,Uc=Er&&Er.isDate,Vu=Er&&Er.isMap,Wu=Er&&Er.isRegExp,Xu=Er&&Er.isSet,qu=Er&&Er.isTypedArray;function ir(It,Qt,ie){switch(ie.length){case 0:return It.call(Qt);case 1:return It.call(Qt,ie[0]);case 2:return It.call(Qt,ie[0],ie[1]);case 3:return It.call(Qt,ie[0],ie[1],ie[2])}return It.apply(Qt,ie)}function Gc(It,Qt,ie,Se){for(var Be=-1,gi=It==null?0:It.length;++Be<gi;){var an=It[Be];Qt(Se,an,ie(an),It)}return Se}function hr(It,Qt){for(var ie=-1,Se=It==null?0:It.length;++ie<Se&&Qt(It[ie],ie,It)!==!1;);return It}function Hc(It,Qt){for(var ie=It==null?0:It.length;ie--&&Qt(It[ie],ie,It)!==!1;);return It}function zc(It,Qt){for(var ie=-1,Se=It==null?0:It.length;++ie<Se;)if(!Qt(It[ie],ie,It))return!1;return!0}function fo(It,Qt){for(var ie=-1,Se=It==null?0:It.length,Be=0,gi=[];++ie<Se;){var an=It[ie];Qt(an,ie,It)&&(gi[Be++]=an)}return gi}function Da(It,Qt){return!!(It!=null&&It.length)&&qs(It,Qt,0)>-1}function Yu(It,Qt,ie){for(var Se=-1,Be=It==null?0:It.length;++Se<Be;)if(ie(Qt,It[Se]))return!0;return!1}function Gi(It,Qt){for(var ie=-1,Se=It==null?0:It.length,Be=Array(Se);++ie<Se;)Be[ie]=Qt(It[ie],ie,It);return Be}function Do(It,Qt){for(var ie=-1,Se=Qt.length,Be=It.length;++ie<Se;)It[Be+ie]=Qt[ie];return It}function $u(It,Qt,ie,Se){var Be=-1,gi=It==null?0:It.length;for(Se&&gi&&(ie=It[++Be]);++Be<gi;)ie=Qt(ie,It[Be],Be,It);return ie}function Jp(It,Qt,ie,Se){var Be=It==null?0:It.length;for(Se&&Be&&(ie=It[--Be]);Be--;)ie=Qt(ie,It[Be],Be,It);return ie}function Ju(It,Qt){for(var ie=-1,Se=It==null?0:It.length;++ie<Se;)if(Qt(It[ie],ie,It))return!0;return!1}var Zp=Zu("length");function jc(It,Qt,ie){var Se;return ie(It,function(Be,gi,an){if(Qt(Be,gi,an))return Se=gi,!1}),Se}function Il(It,Qt,ie,Se){for(var Be=It.length,gi=ie+(Se?1:-1);Se?gi--:++gi<Be;)if(Qt(It[gi],gi,It))return gi;return-1}function qs(It,Qt,ie){return Qt==Qt?function(Se,Be,gi){for(var an=gi-1,Mr=Se.length;++an<Mr;)if(Se[an]===Be)return an;return-1}(It,Qt,ie):Il(It,Vc,ie)}function Kp(It,Qt,ie,Se){for(var Be=ie-1,gi=It.length;++Be<gi;)if(Se(It[Be],Qt))return Be;return-1}function Vc(It){return It!=It}function Wc(It,Qt){var ie=It==null?0:It.length;return ie?Qu(It,Qt)/ie:NaN}function Zu(It){return function(Qt){return Qt==null?void 0:Qt[It]}}function Ku(It){return function(Qt){return It==null?void 0:It[Qt]}}function Xc(It,Qt,ie,Se,Be){return Be(It,function(gi,an,Mr){ie=Se?(Se=!1,gi):Qt(ie,gi,an,Mr)}),ie}function Qu(It,Qt){for(var ie,Se=-1,Be=It.length;++Se<Be;){var gi=Qt(It[Se]);gi!==void 0&&(ie=ie===void 0?gi:ie+gi)}return ie}function th(It,Qt){for(var ie=-1,Se=Array(It);++ie<It;)Se[ie]=Qt(ie);return Se}function qc(It){return It&&It.slice(0,hs(It)+1).replace(Ui,"")}function cr(It){return function(Qt){return It(Qt)}}function eh(It,Qt){return Gi(Qt,function(ie){return It[ie]})}function Fa(It,Qt){return It.has(Qt)}function Yc(It,Qt){for(var ie=-1,Se=It.length;++ie<Se&&qs(Qt,It[ie],0)>-1;);return ie}function $c(It,Qt){for(var ie=It.length;ie--&&qs(Qt,It[ie],0)>-1;);return ie}function Qp(It,Qt){for(var ie=It.length,Se=0;ie--;)It[ie]===Qt&&++Se;return Se}var tf=Ku({\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"}),ef=Ku({"&":"&","<":"<",">":">",'"':""","'":"'"});function nf(It){return"\\"+No[It]}function Ys(It){return Ws.test(It)}function ih(It){var Qt=-1,ie=Array(It.size);return It.forEach(function(Se,Be){ie[++Qt]=[Be,Se]}),ie}function Jc(It,Qt){return function(ie){return It(Qt(ie))}}function Fo(It,Qt){for(var ie=-1,Se=It.length,Be=0,gi=[];++ie<Se;){var an=It[ie];an!==Qt&&an!==C||(It[ie]=C,gi[Be++]=ie)}return gi}function us(It){var Qt=-1,ie=Array(It.size);return It.forEach(function(Se){ie[++Qt]=Se}),ie}function Ll(It){var Qt=-1,ie=Array(It.size);return It.forEach(function(Se){ie[++Qt]=[Se,Se]}),ie}function Bo(It){return Ys(It)?function(Qt){for(var ie=Vs.lastIndex=0;Vs.test(Qt);)++ie;return ie}(It):Zp(It)}function Gn(It){return Ys(It)?function(Qt){return Qt.match(Vs)||[]}(It):function(Qt){return Qt.split("")}(It)}function hs(It){for(var Qt=It.length;Qt--&&On.test(It.charAt(Qt)););return Qt}var Ol=Ku({"&":"&","<":"<",">":">",""":'"',"'":"'"}),$s=function It(Qt){var ie,Se=(Qt=Qt==null?tn:$s.defaults(tn.Object(),Qt,$s.pick(tn,Xp))).Array,Be=Qt.Date,gi=Qt.Error,an=Qt.Function,Mr=Qt.Math,ki=Qt.Object,Nl=Qt.RegExp,Zc=Qt.String,dr=Qt.TypeError,Dl=Se.prototype,Kc=an.prototype,Br=ki.prototype,Fl=Qt["__core-js_shared__"],nh=Kc.toString,Ei=Br.hasOwnProperty,Dg=0,rf=(ie=/[^.]+$/.exec(Fl&&Fl.keys&&Fl.keys.IE_PROTO||""))?"Symbol(src)_1."+ie:"",rh=Br.toString,Fg=nh.call(ki),Bg=tn._,kg=Nl("^"+nh.call(Ei).replace(Ki,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),oh=Bc?Qt.Buffer:void 0,cs=Qt.Symbol,sh=Qt.Uint8Array,of=oh?oh.allocUnsafe:void 0,ah=Jc(ki.getPrototypeOf,ki),sf=ki.create,af=Br.propertyIsEnumerable,Bl=Dl.splice,Js=cs?cs.isConcatSpreadable:void 0,mo=cs?cs.iterator:void 0,Zs=cs?cs.toStringTag:void 0,lh=function(){try{var c=ha(ki,"defineProperty");return c({},"",{}),c}catch{}}(),Ug=Qt.clearTimeout!==tn.clearTimeout&&Qt.clearTimeout,Gg=Be&&Be.now!==tn.Date.now&&Be.now,Hg=Qt.setTimeout!==tn.setTimeout&&Qt.setTimeout,uh=Mr.ceil,hh=Mr.floor,Qc=ki.getOwnPropertySymbols,td=oh?oh.isBuffer:void 0,ko=Qt.isFinite,Hn=Dl.join,ch=Jc(ki.keys,ki),Hi=Mr.max,yn=Mr.min,Ar=Be.now,zn=Qt.parseInt,dh=Mr.random,kl=Dl.reverse,Ul=ha(Qt,"DataView"),Ba=ha(Qt,"Map"),ph=ha(Qt,"Promise"),Ks=ha(Qt,"Set"),ce=ha(Qt,"WeakMap"),zi=ha(ki,"create"),Uo=ce&&new ce,kr={},zg=ys(Ul),dn=ys(Ba),ed=ys(ph),Li=ys(Ks),Kr=ys(ce),Gl=cs?cs.prototype:void 0,Qs=Gl?Gl.valueOf:void 0,Nn=Gl?Gl.toString:void 0;function S(c){if(rn(c)&&!ti(c)&&!(c instanceof oi)){if(c instanceof Yi)return c;if(Ei.call(c,"__wrapped__"))return Sf(c)}return new Yi(c)}var ds=function(){function c(){}return function(f){if(!nn(f))return{};if(sf)return sf(f);c.prototype=f;var x=new c;return c.prototype=void 0,x}}();function Hl(){}function Yi(c,f){this.__wrapped__=c,this.__actions__=[],this.__chain__=!!f,this.__index__=0,this.__values__=void 0}function oi(c){this.__wrapped__=c,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Qr(c){var f=-1,x=c==null?0:c.length;for(this.clear();++f<x;){var R=c[f];this.set(R[0],R[1])}}function to(c){var f=-1,x=c==null?0:c.length;for(this.clear();++f<x;){var R=c[f];this.set(R[0],R[1])}}function pr(c){var f=-1,x=c==null?0:c.length;for(this.clear();++f<x;){var R=c[f];this.set(R[0],R[1])}}function Ur(c){var f=-1,x=c==null?0:c.length;for(this.__data__=new pr;++f<x;)this.add(c[f])}function Jn(c){var f=this.__data__=new to(c);this.size=f.size}function Go(c,f){var x=ti(c),R=!x&&bs(c),D=!x&&!R&&Xo(c),$=!x&&!R&&!D&&da(c),ut=x||R||D||$,mt=ut?th(c.length,Zc):[],Mt=mt.length;for(var Jt in c)!f&&!Ei.call(c,Jt)||ut&&(Jt=="length"||D&&(Jt=="offset"||Jt=="parent")||$&&(Jt=="buffer"||Jt=="byteLength"||Jt=="byteOffset")||Kn(Jt,Mt))||mt.push(Jt);return mt}function Ho(c){var f=c.length;return f?c[gs(0,f-1)]:void 0}function ta(c,f){return Ah(Mn(c),zo(f,0,c.length))}function zl(c){return Ah(Mn(c))}function ka(c,f,x){(x!==void 0&&!Wr(c[f],x)||x===void 0&&!(f in c))&&vo(c,f,x)}function ps(c,f,x){var R=c[f];Ei.call(c,f)&&Wr(R,x)&&(x!==void 0||f in c)||vo(c,f,x)}function go(c,f){for(var x=c.length;x--;)if(Wr(c[x][0],f))return x;return-1}function id(c,f,x,R){return nr(c,function(D,$,ut){f(R,D,x(D),ut)}),R}function lf(c,f){return c&&un(f,Rn(f),c)}function vo(c,f,x){f=="__proto__"&&lh?lh(c,f,{configurable:!0,enumerable:!0,value:x,writable:!0}):c[f]=x}function jl(c,f){for(var x=-1,R=f.length,D=Se(R),$=c==null;++x<R;)D[x]=$?void 0:Dd(c,f[x]);return D}function zo(c,f,x){return c==c&&(x!==void 0&&(c=c<=x?c:x),f!==void 0&&(c=c>=f?c:f)),c}function En(c,f,x,R,D,$){var ut,mt=1&f,Mt=2&f,Jt=4&f;if(x&&(ut=D?x(c,R,D,$):x(c)),ut!==void 0)return ut;if(!nn(c))return c;var Zt=ti(c);if(Zt){if(ut=function(re){var pe=re.length,He=new re.constructor(pe);return pe&&typeof re[0]=="string"&&Ei.call(re,"index")&&(He.index=re.index,He.input=re.input),He}(c),!mt)return Mn(c,ut)}else{var de=An(c),Oe=de==Nt||de==E;if(Xo(c))return fd(c,mt);if(de==Y||de==z||Oe&&!D){if(ut=Mt||Oe?{}:yd(c),!mt)return Mt?function(re,pe){return un(re,ca(re),pe)}(c,function(re,pe){return re&&un(pe,Fn(pe),re)}(ut,c)):function(re,pe){return un(re,jr(re),pe)}(c,lf(ut,c))}else{if(!Fi[de])return D?c:{};ut=function(re,pe,He){var Ce=re.constructor;switch(pe){case ge:return md(re);case Z:case vt:return new Ce(+re);case Ct:return function(Ye,li){var ke=li?md(Ye.buffer):Ye.buffer;return new Ye.constructor(ke,Ye.byteOffset,Ye.byteLength)}(re,He);case ot:case yt:case Pt:case H:case ft:case Et:case"[object Uint8ClampedArray]":case At:case Rt:return ra(re,He);case L:return new Ce;case O:case X:return new Ce(re);case P:return function(Ye){var li=new Ye.constructor(Ye.source,Zr.exec(Ye));return li.lastIndex=Ye.lastIndex,li}(re);case j:return new Ce;case K:return Ue=re,Qs?ki(Qs.call(Ue)):{}}var Ue}(c,de,mt)}}$||($=new Jn);var Fe=$.get(c);if(Fe)return Fe;$.set(c,ut),Gf(c)?c.forEach(function(re){ut.add(En(re,f,x,re,c,$))}):Uf(c)&&c.forEach(function(re,pe){ut.set(pe,En(re,f,x,pe,c,$))});var Ve=Zt?void 0:(Jt?Mt?la:rr:Mt?Fn:Rn)(c);return hr(Ve||c,function(re,pe){Ve&&(re=c[pe=re]),ps(ut,pe,En(re,f,x,pe,c,$))}),ut}function _o(c,f,x){var R=x.length;if(c==null)return!R;for(c=ki(c);R--;){var D=x[R],$=f[D],ut=c[D];if(ut===void 0&&!(D in c)||!$(ut))return!1}return!0}function fh(c,f,x){if(typeof c!="function")throw new dr(W);return Zl(function(){c.apply(void 0,x)},f)}function fs(c,f,x,R){var D=-1,$=Da,ut=!0,mt=c.length,Mt=[],Jt=f.length;if(!mt)return Mt;x&&(f=Gi(f,cr(x))),R?($=Yu,ut=!1):f.length>=200&&($=Fa,ut=!1,f=new Ur(f));t:for(;++D<mt;){var Zt=c[D],de=x==null?Zt:x(Zt);if(Zt=R||Zt!==0?Zt:0,ut&&de==de){for(var Oe=Jt;Oe--;)if(f[Oe]===de)continue t;Mt.push(Zt)}else $(f,de,R)||Mt.push(Zt)}return Mt}S.templateSettings={escape:Ze,evaluate:ri,interpolate:De,variable:"",imports:{_:S}},S.prototype=Hl.prototype,S.prototype.constructor=S,Yi.prototype=ds(Hl.prototype),Yi.prototype.constructor=Yi,oi.prototype=ds(Hl.prototype),oi.prototype.constructor=oi,Qr.prototype.clear=function(){this.__data__=zi?zi(null):{},this.size=0},Qr.prototype.delete=function(c){var f=this.has(c)&&delete this.__data__[c];return this.size-=f?1:0,f},Qr.prototype.get=function(c){var f=this.__data__;if(zi){var x=f[c];return x==="__lodash_hash_undefined__"?void 0:x}return Ei.call(f,c)?f[c]:void 0},Qr.prototype.has=function(c){var f=this.__data__;return zi?f[c]!==void 0:Ei.call(f,c)},Qr.prototype.set=function(c,f){var x=this.__data__;return this.size+=this.has(c)?0:1,x[c]=zi&&f===void 0?"__lodash_hash_undefined__":f,this},to.prototype.clear=function(){this.__data__=[],this.size=0},to.prototype.delete=function(c){var f=this.__data__,x=go(f,c);return!(x<0)&&(x==f.length-1?f.pop():Bl.call(f,x,1),--this.size,!0)},to.prototype.get=function(c){var f=this.__data__,x=go(f,c);return x<0?void 0:f[x][1]},to.prototype.has=function(c){return go(this.__data__,c)>-1},to.prototype.set=function(c,f){var x=this.__data__,R=go(x,c);return R<0?(++this.size,x.push([c,f])):x[R][1]=f,this},pr.prototype.clear=function(){this.size=0,this.__data__={hash:new Qr,map:new(Ba||to),string:new Qr}},pr.prototype.delete=function(c){var f=Za(this,c).delete(c);return this.size-=f?1:0,f},pr.prototype.get=function(c){return Za(this,c).get(c)},pr.prototype.has=function(c){return Za(this,c).has(c)},pr.prototype.set=function(c,f){var x=Za(this,c),R=x.size;return x.set(c,f),this.size+=x.size==R?0:1,this},Ur.prototype.add=Ur.prototype.push=function(c){return this.__data__.set(c,"__lodash_hash_undefined__"),this},Ur.prototype.has=function(c){return this.__data__.has(c)},Jn.prototype.clear=function(){this.__data__=new to,this.size=0},Jn.prototype.delete=function(c){var f=this.__data__,x=f.delete(c);return this.size=f.size,x},Jn.prototype.get=function(c){return this.__data__.get(c)},Jn.prototype.has=function(c){return this.__data__.has(c)},Jn.prototype.set=function(c,f){var x=this.__data__;if(x instanceof to){var R=x.__data__;if(!Ba||R.length<199)return R.push([c,f]),this.size=++x.size,this;x=this.__data__=new pr(R)}return x.set(c,f),this.size=x.size,this};var nr=ze(yo),mh=ze(nd,!0);function gh(c,f){var x=!0;return nr(c,function(R,D,$){return x=!!f(R,D,$)}),x}function Ua(c,f,x){for(var R=-1,D=c.length;++R<D;){var $=c[R],ut=f($);if(ut!=null&&(mt===void 0?ut==ut&&!Lr(ut):x(ut,mt)))var mt=ut,Mt=$}return Mt}function jo(c,f){var x=[];return nr(c,function(R,D,$){f(R,D,$)&&x.push(R)}),x}function Ee(c,f,x,R,D){var $=-1,ut=c.length;for(x||(x=jg),D||(D=[]);++$<ut;){var mt=c[$];f>0&&x(mt)?f>1?Ee(mt,f-1,x,R,D):Do(D,mt):R||(D[D.length]=mt)}return D}var ms=gd(),Gr=gd(!0);function yo(c,f){return c&&ms(c,f,Rn)}function nd(c,f){return c&&Gr(c,f,Rn)}function eo(c,f){return fo(f,function(x){return oo(c[x])})}function xo(c,f){for(var x=0,R=(f=no(f,c)).length;c!=null&&x<R;)c=c[Vr(f[x++])];return x&&x==R?c:void 0}function fr(c,f,x){var R=f(c);return ti(c)?R:Do(R,x(c))}function Zn(c){return c==null?c===void 0?"[object Undefined]":"[object Null]":Zs&&Zs in ki(c)?function(f){var x=Ei.call(f,Zs),R=f[Zs];try{f[Zs]=void 0;var D=!0}catch{}var $=rh.call(f);return D&&(x?f[Zs]=R:delete f[Zs]),$}(c):function(f){return rh.call(f)}(c)}function vh(c,f){return c>f}function ea(c,f){return c!=null&&Ei.call(c,f)}function rd(c,f){return c!=null&&f in ki(c)}function od(c,f,x){for(var R=x?Yu:Da,D=c[0].length,$=c.length,ut=$,mt=Se($),Mt=1/0,Jt=[];ut--;){var Zt=c[ut];ut&&f&&(Zt=Gi(Zt,cr(f))),Mt=yn(Zt.length,Mt),mt[ut]=!x&&(f||D>=120&&Zt.length>=120)?new Ur(ut&&Zt):void 0}Zt=c[0];var de=-1,Oe=mt[0];t:for(;++de<D&&Jt.length<Mt;){var Fe=Zt[de],Ve=f?f(Fe):Fe;if(Fe=x||Fe!==0?Fe:0,!(Oe?Fa(Oe,Ve):R(Jt,Ve,x))){for(ut=$;--ut;){var re=mt[ut];if(!(re?Fa(re,Ve):R(c[ut],Ve,x)))continue t}Oe&&Oe.push(Ve),Jt.push(Fe)}}return Jt}function Ga(c,f,x){var R=(c=yf(c,f=no(f,c)))==null?c:c[Vr(Ir(f))];return R==null?void 0:ir(R,c,x)}function ia(c){return rn(c)&&Zn(c)==z}function Rr(c,f,x,R,D){return c===f||(c==null||f==null||!rn(c)&&!rn(f)?c!=c&&f!=f:function($,ut,mt,Mt,Jt,Zt){var de=ti($),Oe=ti(ut),Fe=de?k:An($),Ve=Oe?k:An(ut),re=(Fe=Fe==z?Y:Fe)==Y,pe=(Ve=Ve==z?Y:Ve)==Y,He=Fe==Ve;if(He&&Xo($)){if(!Xo(ut))return!1;de=!0,re=!1}if(He&&!re)return Zt||(Zt=new Jn),de||da($)?jn($,ut,mt,Mt,Jt,Zt):function(ke,Je,hn,Vn,cn,on,so){switch(hn){case Ct:if(ke.byteLength!=Je.byteLength||ke.byteOffset!=Je.byteOffset)return!1;ke=ke.buffer,Je=Je.buffer;case ge:return!(ke.byteLength!=Je.byteLength||!on(new sh(ke),new sh(Je)));case Z:case vt:case O:return Wr(+ke,+Je);case Ot:return ke.name==Je.name&&ke.message==Je.message;case P:case X:return ke==Je+"";case L:var Eo=ih;case j:var Ss=1&Vn;if(Eo||(Eo=us),ke.size!=Je.size&&!Ss)return!1;var sl=so.get(ke);if(sl)return sl==Je;Vn|=2,so.set(ke,Je);var Ts=jn(Eo(ke),Eo(Je),Vn,cn,on,so);return so.delete(ke),Ts;case K:if(Qs)return Qs.call(ke)==Qs.call(Je)}return!1}($,ut,Fe,mt,Mt,Jt,Zt);if(!(1&mt)){var Ce=re&&Ei.call($,"__wrapped__"),Ue=pe&&Ei.call(ut,"__wrapped__");if(Ce||Ue){var Ye=Ce?$.value():$,li=Ue?ut.value():ut;return Zt||(Zt=new Jn),Jt(Ye,li,mt,Mt,Zt)}}return He?(Zt||(Zt=new Jn),function(ke,Je,hn,Vn,cn,on){var so=1&hn,Eo=rr(ke),Ss=Eo.length,sl=rr(Je).length;if(Ss!=sl&&!so)return!1;for(var Ts=Ss;Ts--;){var Mo=Eo[Ts];if(!(so?Mo in Je:Ei.call(Je,Mo)))return!1}var qh=on.get(ke),Ud=on.get(Je);if(qh&&Ud)return qh==Je&&Ud==ke;var Es=!0;on.set(ke,Je),on.set(Je,ke);for(var _a=so;++Ts<Ss;){Mo=Eo[Ts];var ya=ke[Mo],al=Je[Mo];if(Vn)var ll=so?Vn(al,ya,Mo,Je,ke,on):Vn(ya,al,Mo,ke,Je,on);if(!(ll===void 0?ya===al||cn(ya,al,hn,Vn,on):ll)){Es=!1;break}_a||(_a=Mo=="constructor")}if(Es&&!_a){var lu=ke.constructor,xa=Je.constructor;lu==xa||!("constructor"in ke)||!("constructor"in Je)||typeof lu=="function"&&lu instanceof lu&&typeof xa=="function"&&xa instanceof xa||(Es=!1)}return on.delete(ke),on.delete(Je),Es}($,ut,mt,Mt,Jt,Zt)):!1}(c,f,x,R,Rr,D))}function Ha(c,f,x,R){var D=x.length,$=D,ut=!R;if(c==null)return!$;for(c=ki(c);D--;){var mt=x[D];if(ut&&mt[2]?mt[1]!==c[mt[0]]:!(mt[0]in c))return!1}for(;++D<$;){var Mt=(mt=x[D])[0],Jt=c[Mt],Zt=mt[1];if(ut&&mt[2]){if(Jt===void 0&&!(Mt in c))return!1}else{var de=new Jn;if(R)var Oe=R(Jt,Zt,Mt,c,f,de);if(!(Oe===void 0?Rr(Zt,Jt,3,R,de):Oe))return!1}}return!0}function za(c){return!(!nn(c)||(f=c,rf&&rf in f))&&(oo(c)?kg:at).test(ys(c));var f}function uf(c){return typeof c=="function"?c:c==null?sr:typeof c=="object"?ti(c)?ld(c[0],c[1]):cf(c):Kf(c)}function sd(c){if(!Jl(c))return ch(c);var f=[];for(var x in ki(c))Ei.call(c,x)&&x!="constructor"&&f.push(x);return f}function hf(c){if(!nn(c))return function(D){var $=[];if(D!=null)for(var ut in ki(D))$.push(ut);return $}(c);var f=Jl(c),x=[];for(var R in c)(R!="constructor"||!f&&Ei.call(c,R))&&x.push(R);return x}function _h(c,f){return c<f}function ad(c,f){var x=-1,R=mr(c)?Se(c.length):[];return nr(c,function(D,$,ut){R[++x]=f(D,$,ut)}),R}function cf(c){var f=_d(c);return f.length==1&&f[0][2]?vf(f[0][0],f[0][1]):function(x){return x===c||Ha(x,c,f)}}function ld(c,f){return Te(c)&&gf(f)?vf(Vr(c),f):function(x){var R=Dd(x,c);return R===void 0&&R===f?tu(x,c):Rr(f,R,3)}}function hi(c,f,x,R,D){c!==f&&ms(f,function($,ut){if(D||(D=new Jn),nn($))(function(Mt,Jt,Zt,de,Oe,Fe,Ve){var re=xd(Mt,Zt),pe=xd(Jt,Zt),He=Ve.get(pe);if(He)return void ka(Mt,Zt,He);var Ce=Fe?Fe(re,pe,Zt+"",Mt,Jt,Ve):void 0,Ue=Ce===void 0;if(Ue){var Ye=ti(pe),li=!Ye&&Xo(pe),ke=!Ye&&!li&&da(pe);Ce=pe,Ye||li||ke?ti(re)?Ce=re:Vi(re)?Ce=Mn(re):li?(Ue=!1,Ce=fd(pe,!0)):ke?(Ue=!1,Ce=ra(pe,!0)):Ce=[]:tl(pe)||bs(pe)?(Ce=re,bs(re)?Ce=Vf(re):nn(re)&&!oo(re)||(Ce=yd(pe))):Ue=!1}Ue&&(Ve.set(pe,Ce),Oe(Ce,pe,de,Fe,Ve),Ve.delete(pe)),ka(Mt,Zt,Ce)})(c,f,ut,x,hi,R,D);else{var mt=R?R(xd(c,ut),$,ut+"",c,f,D):void 0;mt===void 0&&(mt=$),ka(c,ut,mt)}},Fn)}function Hr(c,f){var x=c.length;if(x)return Kn(f+=f<0?x:0,x)?c[f]:void 0}function bo(c,f,x){f=f.length?Gi(f,function(D){return ti(D)?function($){return xo($,D.length===1?D[0]:D)}:D}):[sr];var R=-1;return f=Gi(f,cr(je())),function(D,$){var ut=D.length;for(D.sort($);ut--;)D[ut]=D[ut].value;return D}(ad(c,function(D,$,ut){return{criteria:Gi(f,function(mt){return mt(D)}),index:++R,value:D}}),function(D,$){return function(ut,mt,Mt){for(var Jt=-1,Zt=ut.criteria,de=mt.criteria,Oe=Zt.length,Fe=Mt.length;++Jt<Oe;){var Ve=mf(Zt[Jt],de[Jt]);if(Ve){if(Jt>=Fe)return Ve;var re=Mt[Jt];return Ve*(re=="desc"?-1:1)}}return ut.index-mt.index}(D,$,x)})}function yh(c,f,x){for(var R=-1,D=f.length,$={};++R<D;){var ut=f[R],mt=xo(c,ut);x(mt,ut)&&ji($,no(ut,c),mt)}return $}function io(c,f,x,R){var D=R?Kp:qs,$=-1,ut=f.length,mt=c;for(c===f&&(f=Mn(f)),x&&(mt=Gi(c,cr(x)));++$<ut;)for(var Mt=0,Jt=f[$],Zt=x?x(Jt):Jt;(Mt=D(mt,Zt,Mt,R))>-1;)mt!==c&&Bl.call(mt,Mt,1),Bl.call(c,Mt,1);return c}function na(c,f){for(var x=c?f.length:0,R=x-1;x--;){var D=f[x];if(x==R||D!==$){var $=D;Kn(D)?Bl.call(c,D,1):Va(c,D)}}return c}function gs(c,f){return c+hh(dh()*(f-c+1))}function xh(c,f){var x="";if(!c||f<1||f>9007199254740991)return x;do f%2&&(x+=c),(f=hh(f/2))&&(c+=c);while(f);return x}function ci(c,f){return bd(_f(c,f,sr),c+"")}function ud(c){return Ho(To(c))}function hd(c,f){var x=To(c);return Ah(x,zo(f,0,x.length))}function ji(c,f,x,R){if(!nn(c))return c;for(var D=-1,$=(f=no(f,c)).length,ut=$-1,mt=c;mt!=null&&++D<$;){var Mt=Vr(f[D]),Jt=x;if(Mt==="__proto__"||Mt==="constructor"||Mt==="prototype")return c;if(D!=ut){var Zt=mt[Mt];(Jt=R?R(Zt,Mt,mt):void 0)===void 0&&(Jt=nn(Zt)?Zt:Kn(f[D+1])?[]:{})}ps(mt,Mt,Jt),mt=mt[Mt]}return c}var df=Uo?function(c,f){return Uo.set(c,f),c}:sr,Dn=lh?function(c,f){return lh(c,"toString",{configurable:!0,enumerable:!1,value:nl(f),writable:!0})}:sr;function pf(c){return Ah(To(c))}function ln(c,f,x){var R=-1,D=c.length;f<0&&(f=-f>D?0:D+f),(x=x>D?D:x)<0&&(x+=D),D=f>x?0:x-f>>>0,f>>>=0;for(var $=Se(D);++R<D;)$[R]=c[R+f];return $}function bh(c,f){var x;return nr(c,function(R,D,$){return!(x=f(R,D,$))}),!!x}function ja(c,f,x){var R=0,D=c==null?R:c.length;if(typeof f=="number"&&f==f&&D<=2147483647){for(;R<D;){var $=R+D>>>1,ut=c[$];ut!==null&&!Lr(ut)&&(x?ut<=f:ut<f)?R=$+1:D=$}return D}return Vl(c,f,sr,x)}function Vl(c,f,x,R){var D=0,$=c==null?0:c.length;if($===0)return 0;for(var ut=(f=x(f))!=f,mt=f===null,Mt=Lr(f),Jt=f===void 0;D<$;){var Zt=hh((D+$)/2),de=x(c[Zt]),Oe=de!==void 0,Fe=de===null,Ve=de==de,re=Lr(de);if(ut)var pe=R||Ve;else pe=Jt?Ve&&(R||Oe):mt?Ve&&Oe&&(R||!Fe):Mt?Ve&&Oe&&!Fe&&(R||!re):!Fe&&!re&&(R?de<=f:de<f);pe?D=Zt+1:$=Zt}return yn($,4294967294)}function wh(c,f){for(var x=-1,R=c.length,D=0,$=[];++x<R;){var ut=c[x],mt=f?f(ut):ut;if(!x||!Wr(mt,Mt)){var Mt=mt;$[D++]=ut===0?0:ut}}return $}function Le(c){return typeof c=="number"?c:Lr(c)?NaN:+c}function pn(c){if(typeof c=="string")return c;if(ti(c))return Gi(c,pn)+"";if(Lr(c))return Nn?Nn.call(c):"";var f=c+"";return f=="0"&&1/c==-1/0?"-0":f}function Si(c,f,x){var R=-1,D=Da,$=c.length,ut=!0,mt=[],Mt=mt;if(x)ut=!1,D=Yu;else if($>=200){var Jt=f?null:vd(c);if(Jt)return us(Jt);ut=!1,D=Fa,Mt=new Ur}else Mt=f?[]:mt;t:for(;++R<$;){var Zt=c[R],de=f?f(Zt):Zt;if(Zt=x||Zt!==0?Zt:0,ut&&de==de){for(var Oe=Mt.length;Oe--;)if(Mt[Oe]===de)continue t;f&&Mt.push(de),mt.push(Zt)}else D(Mt,de,x)||(Mt!==mt&&Mt.push(de),mt.push(Zt))}return mt}function Va(c,f){return(c=yf(c,f=no(f,c)))==null||delete c[Vr(Ir(f))]}function mi(c,f,x,R){return ji(c,f,x(xo(c,f)),R)}function Wl(c,f,x,R){for(var D=c.length,$=R?D:-1;(R?$--:++$<D)&&f(c[$],$,c););return x?ln(c,R?0:$,R?$+1:D):ln(c,R?$+1:0,R?D:$)}function cd(c,f){var x=c;return x instanceof oi&&(x=x.value()),$u(f,function(R,D){return D.func.apply(D.thisArg,Do([R],D.args))},x)}function Sh(c,f,x){var R=c.length;if(R<2)return R?Si(c[0]):[];for(var D=-1,$=Se(R);++D<R;)for(var ut=c[D],mt=-1;++mt<R;)mt!=D&&($[D]=fs($[D]||ut,c[mt],f,x));return Si(Ee($,1),f,x)}function dd(c,f,x){for(var R=-1,D=c.length,$=f.length,ut={};++R<D;){var mt=R<$?f[R]:void 0;x(ut,c[R],mt)}return ut}function Wa(c){return Vi(c)?c:[]}function Th(c){return typeof c=="function"?c:sr}function no(c,f){return ti(c)?c:Te(c,f)?[c]:Rh(xi(c))}var ff=ci;function _e(c,f,x){var R=c.length;return x=x===void 0?R:x,!f&&x>=R?c:ln(c,f,x)}var pd=Ug||function(c){return tn.clearTimeout(c)};function fd(c,f){if(f)return c.slice();var x=c.length,R=of?of(x):new c.constructor(x);return c.copy(R),R}function md(c){var f=new c.constructor(c.byteLength);return new sh(f).set(new sh(c)),f}function ra(c,f){var x=f?md(c.buffer):c.buffer;return new c.constructor(x,c.byteOffset,c.length)}function mf(c,f){if(c!==f){var x=c!==void 0,R=c===null,D=c==c,$=Lr(c),ut=f!==void 0,mt=f===null,Mt=f==f,Jt=Lr(f);if(!mt&&!Jt&&!$&&c>f||$&&ut&&Mt&&!mt&&!Jt||R&&ut&&Mt||!x&&Mt||!D)return 1;if(!R&&!$&&!Jt&&c<f||Jt&&x&&D&&!R&&!$||mt&&x&&D||!ut&&D||!Mt)return-1}return 0}function Cr(c,f,x,R){for(var D=-1,$=c.length,ut=x.length,mt=-1,Mt=f.length,Jt=Hi($-ut,0),Zt=Se(Mt+Jt),de=!R;++mt<Mt;)Zt[mt]=f[mt];for(;++D<ut;)(de||D<$)&&(Zt[x[D]]=c[D]);for(;Jt--;)Zt[mt++]=c[D++];return Zt}function Eh(c,f,x,R){for(var D=-1,$=c.length,ut=-1,mt=x.length,Mt=-1,Jt=f.length,Zt=Hi($-mt,0),de=Se(Zt+Jt),Oe=!R;++D<Zt;)de[D]=c[D];for(var Fe=D;++Mt<Jt;)de[Fe+Mt]=f[Mt];for(;++ut<mt;)(Oe||D<$)&&(de[Fe+x[ut]]=c[D++]);return de}function Mn(c,f){var x=-1,R=c.length;for(f||(f=Se(R));++x<R;)f[x]=c[x];return f}function un(c,f,x,R){var D=!x;x||(x={});for(var $=-1,ut=f.length;++$<ut;){var mt=f[$],Mt=R?R(x[mt],c[mt],mt,x,c):void 0;Mt===void 0&&(Mt=c[mt]),D?vo(x,mt,Mt):ps(x,mt,Mt)}return x}function vs(c,f){return function(x,R){var D=ti(x)?Gc:id,$=f?f():{};return D(x,c,je(R,2),$)}}function en(c){return ci(function(f,x){var R=-1,D=x.length,$=D>1?x[D-1]:void 0,ut=D>2?x[2]:void 0;for($=c.length>3&&typeof $=="function"?(D--,$):void 0,ut&&$e(x[0],x[1],ut)&&($=D<3?void 0:$,D=1),f=ki(f);++R<D;){var mt=x[R];mt&&c(f,mt,R,$)}return f})}function ze(c,f){return function(x,R){if(x==null)return x;if(!mr(x))return c(x,R);for(var D=x.length,$=f?D:-1,ut=ki(x);(f?$--:++$<D)&&R(ut[$],$,ut)!==!1;);return x}}function gd(c){return function(f,x,R){for(var D=-1,$=ki(f),ut=R(f),mt=ut.length;mt--;){var Mt=ut[c?mt:++D];if(x($[Mt],Mt,$)===!1)break}return f}}function oa(c){return function(f){var x=Ys(f=xi(f))?Gn(f):void 0,R=x?x[0]:f.charAt(0),D=x?_e(x,1).join(""):f.slice(1);return R[c]()+D}}function _s(c){return function(f){return $u(Fd(va(f).replace(Pl,"")),c,"")}}function zr(c){return function(){var f=arguments;switch(f.length){case 0:return new c;case 1:return new c(f[0]);case 2:return new c(f[0],f[1]);case 3:return new c(f[0],f[1],f[2]);case 4:return new c(f[0],f[1],f[2],f[3]);case 5:return new c(f[0],f[1],f[2],f[3],f[4]);case 6:return new c(f[0],f[1],f[2],f[3],f[4],f[5]);case 7:return new c(f[0],f[1],f[2],f[3],f[4],f[5],f[6])}var x=ds(c.prototype),R=c.apply(x,f);return nn(R)?R:x}}function Vo(c){return function(f,x,R){var D=ki(f);if(!mr(f)){var $=je(x,3);f=Rn(f),x=function(mt){return $(D[mt],mt,D)}}var ut=c(f,x,R);return ut>-1?D[$?f[ut]:ut]:void 0}}function Wo(c){return So(function(f){var x=f.length,R=x,D=Yi.prototype.thru;for(c&&f.reverse();R--;){var $=f[R];if(typeof $!="function")throw new dr(W);if(D&&!ut&&ua($)=="wrapper")var ut=new Yi([],!0)}for(R=ut?R:x;++R<x;){var mt=ua($=f[R]),Mt=mt=="wrapper"?fn($):void 0;ut=Mt&&Pr(Mt[0])&&Mt[1]==424&&!Mt[4].length&&Mt[9]==1?ut[ua(Mt[0])].apply(ut,Mt[3]):$.length==1&&Pr($)?ut[mt]():ut.thru($)}return function(){var Jt=arguments,Zt=Jt[0];if(ut&&Jt.length==1&&ti(Zt))return ut.plant(Zt).value();for(var de=0,Oe=x?f[de].apply(this,Jt):Zt;++de<x;)Oe=f[de].call(this,Oe);return Oe}})}function Xa(c,f,x,R,D,$,ut,mt,Mt,Jt){var Zt=128&f,de=1&f,Oe=2&f,Fe=24&f,Ve=512&f,re=Oe?void 0:zr(c);return function pe(){for(var He=arguments.length,Ce=Se(He),Ue=He;Ue--;)Ce[Ue]=arguments[Ue];if(Fe)var Ye=ro(pe),li=Qp(Ce,Ye);if(R&&(Ce=Cr(Ce,R,D,Fe)),$&&(Ce=Eh(Ce,$,ut,Fe)),He-=li,Fe&&He<Jt){var ke=Fo(Ce,Ye);return ql(c,f,Xa,pe.placeholder,x,Ce,ke,mt,Mt,Jt-He)}var Je=de?x:this,hn=Oe?Je[c]:c;return He=Ce.length,mt?Ce=Wg(Ce,mt):Ve&&He>1&&Ce.reverse(),Zt&&Mt<He&&(Ce.length=Mt),this&&this!==tn&&this instanceof pe&&(hn=re||zr(hn)),hn.apply(Je,Ce)}}function Mh(c,f){return function(x,R){return function(D,$,ut,mt){return yo(D,function(Mt,Jt,Zt){$(mt,ut(Mt),Jt,Zt)}),mt}(x,c,f(R),{})}}function qa(c,f){return function(x,R){var D;if(x===void 0&&R===void 0)return f;if(x!==void 0&&(D=x),R!==void 0){if(D===void 0)return R;typeof x=="string"||typeof R=="string"?(x=pn(x),R=pn(R)):(x=Le(x),R=Le(R)),D=c(x,R)}return D}}function Ya(c){return So(function(f){return f=Gi(f,cr(je())),ci(function(x){var R=this;return c(f,function(D){return ir(D,R,x)})})})}function sa(c,f){var x=(f=f===void 0?" ":pn(f)).length;if(x<2)return x?xh(f,c):f;var R=xh(f,uh(c/Bo(f)));return Ys(f)?_e(Gn(R),0,c).join(""):R.slice(0,c)}function Xl(c){return function(f,x,R){return R&&typeof R!="number"&&$e(f,x,R)&&(x=R=void 0),f=qo(f),x===void 0?(x=f,f=0):x=qo(x),function(D,$,ut,mt){for(var Mt=-1,Jt=Hi(uh(($-D)/(ut||1)),0),Zt=Se(Jt);Jt--;)Zt[mt?Jt:++Mt]=D,D+=ut;return Zt}(f,x,R=R===void 0?f<x?1:-1:qo(R),c)}}function aa(c){return function(f,x){return typeof f=="string"&&typeof x=="string"||(f=Or(f),x=Or(x)),c(f,x)}}function ql(c,f,x,R,D,$,ut,mt,Mt,Jt){var Zt=8&f;f|=Zt?32:64,4&(f&=~(Zt?64:32))||(f&=-4);var de=[c,f,D,Zt?$:void 0,Zt?ut:void 0,Zt?void 0:$,Zt?void 0:ut,mt,Mt,Jt],Oe=x.apply(void 0,de);return Pr(c)&&xf(Oe,de),Oe.placeholder=R,bf(Oe,c,f)}function $a(c){var f=Mr[c];return function(x,R){if(x=Or(x),(R=R==null?0:yn(di(R),292))&&ko(x)){var D=(xi(x)+"e").split("e");return+((D=(xi(f(D[0]+"e"+(+D[1]+R)))+"e").split("e"))[0]+"e"+(+D[1]-R))}return f(x)}}var vd=Ks&&1/us(new Ks([,-0]))[1]==1/0?function(c){return new Ks(c)}:rl;function Yl(c){return function(f){var x=An(f);return x==L?ih(f):x==j?Ll(f):function(R,D){return Gi(D,function($){return[$,R[$]]})}(f,c(f))}}function Ti(c,f,x,R,D,$,ut,mt){var Mt=2&f;if(!Mt&&typeof c!="function")throw new dr(W);var Jt=R?R.length:0;if(Jt||(f&=-97,R=D=void 0),ut=ut===void 0?ut:Hi(di(ut),0),mt=mt===void 0?mt:di(mt),Jt-=D?D.length:0,64&f){var Zt=R,de=D;R=D=void 0}var Oe=Mt?void 0:fn(c),Fe=[c,f,x,R,D,Zt,de,$,ut,mt];if(Oe&&function(re,pe){var He=re[1],Ce=pe[1],Ue=He|Ce,Ye=Ue<131,li=Ce==128&&He==8||Ce==128&&He==256&&re[7].length<=pe[8]||Ce==384&&pe[7].length<=pe[8]&&He==8;if(!Ye&&!li)return re;1&Ce&&(re[2]=pe[2],Ue|=1&He?0:4);var ke=pe[3];if(ke){var Je=re[3];re[3]=Je?Cr(Je,ke,pe[4]):ke,re[4]=Je?Fo(re[3],C):pe[4]}(ke=pe[5])&&(Je=re[5],re[5]=Je?Eh(Je,ke,pe[6]):ke,re[6]=Je?Fo(re[5],C):pe[6]),(ke=pe[7])&&(re[7]=ke),128&Ce&&(re[8]=re[8]==null?pe[8]:yn(re[8],pe[8])),re[9]==null&&(re[9]=pe[9]),re[0]=pe[0],re[1]=Ue}(Fe,Oe),c=Fe[0],f=Fe[1],x=Fe[2],R=Fe[3],D=Fe[4],!(mt=Fe[9]=Fe[9]===void 0?Mt?0:c.length:Hi(Fe[9]-Jt,0))&&24&f&&(f&=-25),f&&f!=1)Ve=f==8||f==16?function(re,pe,He){var Ce=zr(re);return function Ue(){for(var Ye=arguments.length,li=Se(Ye),ke=Ye,Je=ro(Ue);ke--;)li[ke]=arguments[ke];var hn=Ye<3&&li[0]!==Je&&li[Ye-1]!==Je?[]:Fo(li,Je);if((Ye-=hn.length)<He)return ql(re,pe,Xa,Ue.placeholder,void 0,li,hn,void 0,void 0,He-Ye);var Vn=this&&this!==tn&&this instanceof Ue?Ce:re;return ir(Vn,this,li)}}(c,f,mt):f!=32&&f!=33||D.length?Xa.apply(void 0,Fe):function(re,pe,He,Ce){var Ue=1&pe,Ye=zr(re);return function li(){for(var ke=-1,Je=arguments.length,hn=-1,Vn=Ce.length,cn=Se(Vn+Je),on=this&&this!==tn&&this instanceof li?Ye:re;++hn<Vn;)cn[hn]=Ce[hn];for(;Je--;)cn[hn++]=arguments[++ke];return ir(on,Ue?He:this,cn)}}(c,f,x,R);else var Ve=function(re,pe,He){var Ce=1&pe,Ue=zr(re);return function Ye(){var li=this&&this!==tn&&this instanceof Ye?Ue:re;return li.apply(Ce?He:this,arguments)}}(c,f,x);return bf((Oe?df:xf)(Ve,Fe),c,f)}function $l(c,f,x,R){return c===void 0||Wr(c,Br[x])&&!Ei.call(R,x)?f:c}function wo(c,f,x,R,D,$){return nn(c)&&nn(f)&&($.set(f,c),hi(c,f,void 0,wo,$),$.delete(f)),c}function Ja(c){return tl(c)?void 0:c}function jn(c,f,x,R,D,$){var ut=1&x,mt=c.length,Mt=f.length;if(mt!=Mt&&!(ut&&Mt>mt))return!1;var Jt=$.get(c),Zt=$.get(f);if(Jt&&Zt)return Jt==f&&Zt==c;var de=-1,Oe=!0,Fe=2&x?new Ur:void 0;for($.set(c,f),$.set(f,c);++de<mt;){var Ve=c[de],re=f[de];if(R)var pe=ut?R(re,Ve,de,f,c,$):R(Ve,re,de,c,f,$);if(pe!==void 0){if(pe)continue;Oe=!1;break}if(Fe){if(!Ju(f,function(He,Ce){if(!Fa(Fe,Ce)&&(Ve===He||D(Ve,He,x,R,$)))return Fe.push(Ce)})){Oe=!1;break}}else if(Ve!==re&&!D(Ve,re,x,R,$)){Oe=!1;break}}return $.delete(c),$.delete(f),Oe}function So(c){return bd(_f(c,void 0,Td),c+"")}function rr(c){return fr(c,Rn,jr)}function la(c){return fr(c,Fn,ca)}var fn=Uo?function(c){return Uo.get(c)}:rl;function ua(c){for(var f=c.name+"",x=kr[f],R=Ei.call(kr,f)?x.length:0;R--;){var D=x[R],$=D.func;if($==null||$==c)return D.name}return f}function ro(c){return(Ei.call(S,"placeholder")?S:c).placeholder}function je(){var c=S.iteratee||Gh;return c=c===Gh?uf:c,arguments.length?c(arguments[0],arguments[1]):c}function Za(c,f){var x,R,D=c.__data__;return((R=typeof(x=f))=="string"||R=="number"||R=="symbol"||R=="boolean"?x!=="__proto__":x===null)?D[typeof f=="string"?"string":"hash"]:D.map}function _d(c){for(var f=Rn(c),x=f.length;x--;){var R=f[x],D=c[R];f[x]=[R,D,gf(D)]}return f}function ha(c,f){var x=function(R,D){return R==null?void 0:R[D]}(c,f);return za(x)?x:void 0}var jr=Qc?function(c){return c==null?[]:(c=ki(c),fo(Qc(c),function(f){return af.call(c,f)}))}:Vh,ca=Qc?function(c){for(var f=[];c;)Do(f,jr(c)),c=ah(c);return f}:Vh,An=Zn;function Ka(c,f,x){for(var R=-1,D=(f=no(f,c)).length,$=!1;++R<D;){var ut=Vr(f[R]);if(!($=c!=null&&x(c,ut)))break;c=c[ut]}return $||++R!=D?$:!!(D=c==null?0:c.length)&&Oh(D)&&Kn(ut,D)&&(ti(c)||bs(c))}function yd(c){return typeof c.constructor!="function"||Jl(c)?{}:ds(ah(c))}function jg(c){return ti(c)||bs(c)||!!(Js&&c&&c[Js])}function Kn(c,f){var x=typeof c;return!!(f=f==null?9007199254740991:f)&&(x=="number"||x!="symbol"&&bt.test(c))&&c>-1&&c%1==0&&c<f}function $e(c,f,x){if(!nn(x))return!1;var R=typeof f;return!!(R=="number"?mr(x)&&Kn(f,x.length):R=="string"&&f in x)&&Wr(x[f],c)}function Te(c,f){if(ti(c))return!1;var x=typeof c;return!(x!="number"&&x!="symbol"&&x!="boolean"&&c!=null&&!Lr(c))||Di.test(c)||!Bi.test(c)||f!=null&&c in ki(f)}function Pr(c){var f=ua(c),x=S[f];if(typeof x!="function"||!(f in oi.prototype))return!1;if(c===x)return!0;var R=fn(x);return!!R&&c===R[0]}(Ul&&An(new Ul(new ArrayBuffer(1)))!=Ct||Ba&&An(new Ba)!=L||ph&&An(ph.resolve())!="[object Promise]"||Ks&&An(new Ks)!=j||ce&&An(new ce)!=qt)&&(An=function(c){var f=Zn(c),x=f==Y?c.constructor:void 0,R=x?ys(x):"";if(R)switch(R){case zg:return Ct;case dn:return L;case ed:return"[object Promise]";case Li:return j;case Kr:return qt}return f});var Vg=Fl?oo:ol;function Jl(c){var f=c&&c.constructor;return c===(typeof f=="function"&&f.prototype||Br)}function gf(c){return c==c&&!nn(c)}function vf(c,f){return function(x){return x!=null&&x[c]===f&&(f!==void 0||c in ki(x))}}function _f(c,f,x){return f=Hi(f===void 0?c.length-1:f,0),function(){for(var R=arguments,D=-1,$=Hi(R.length-f,0),ut=Se($);++D<$;)ut[D]=R[f+D];D=-1;for(var mt=Se(f+1);++D<f;)mt[D]=R[D];return mt[f]=x(ut),ir(c,this,mt)}}function yf(c,f){return f.length<2?c:xo(c,ln(f,0,-1))}function Wg(c,f){for(var x=c.length,R=yn(f.length,x),D=Mn(c);R--;){var $=f[R];c[R]=Kn($,x)?D[$]:void 0}return c}function xd(c,f){if((f!=="constructor"||typeof c[f]!="function")&&f!="__proto__")return c[f]}var xf=wf(df),Zl=Hg||function(c,f){return tn.setTimeout(c,f)},bd=wf(Dn);function bf(c,f,x){var R=f+"";return bd(c,function(D,$){var ut=$.length;if(!ut)return D;var mt=ut-1;return $[mt]=(ut>1?"& ":"")+$[mt],$=$.join(ut>2?", ":" "),D.replace(Qi,`{
|
|
8
|
+
*/(function(){var W="Expected a function",P="__lodash_placeholder__",V=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],z="[object Arguments]",k="[object Array]",Z="[object Boolean]",vt="[object Date]",Ot="[object Error]",Nt="[object Function]",E="[object GeneratorFunction]",L="[object Map]",O="[object Number]",Y="[object Object]",C="[object RegExp]",j="[object Set]",X="[object String]",K="[object Symbol]",qt="[object WeakMap]",ge="[object ArrayBuffer]",Ct="[object DataView]",ot="[object Float32Array]",yt="[object Float64Array]",Pt="[object Int8Array]",H="[object Int16Array]",ft="[object Int32Array]",Et="[object Uint8Array]",At="[object Uint16Array]",Rt="[object Uint32Array]",Wt=/\b__p \+= '';/g,$t=/\b(__p \+=) '' \+/g,ye=/(__e\(.*?\)|\b__t\)) \+\n'';/g,me=/&(?:amp|lt|gt|quot|#39);/g,ui=/[&<>"']/g,be=RegExp(me.source),ei=RegExp(ui.source),Ze=/<%-([\s\S]+?)%>/g,ri=/<%([\s\S]+?)%>/g,De=/<%=([\s\S]+?)%>/g,Bi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Di=/^\w*$/,Ci=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ki=/[\\^$.*+?()[\]{}|]/g,Ii=RegExp(Ki.source),Ui=/^\s+/,On=/\s/,Qi=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Yn=/\{\n\/\* \[wrapped with (.+)\] \*/,$n=/,? & /,La=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Hs=/[()=,{}\[\]\/\s]/,zu=/\\(\\)?/g,Oa=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Zr=/\w*$/,J=/^[-+]0x[0-9a-f]+$/i,st=/^0b[01]+$/i,at=/^\[object .+?Constructor\]$/,Tt=/^0o[0-7]+$/i,bt=/^(?:0|[1-9]\d*)$/,wt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,zt=/($^)/,ne=/['\n\r\u2028\u2029\\]/g,se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ae="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",xe="[\\ud800-\\udfff]",Ie="["+ae+"]",Ge="["+se+"]",qe="\\d+",pi="[\\u2700-\\u27bf]",fi="[a-z\\xdf-\\xf6\\xf8-\\xff]",Sr="[^\\ud800-\\udfff"+ae+qe+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",Lo="\\ud83c[\\udffb-\\udfff]",zs="[^\\ud800-\\udfff]",Cl="(?:\\ud83c[\\udde6-\\uddff]){2}",qi="[\\ud800-\\udbff][\\udc00-\\udfff]",as="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Gp="(?:"+fi+"|"+Sr+")",js="(?:"+as+"|"+Sr+")",Hp="(?:"+Ge+"|"+Lo+")?",ls="[\\ufe0e\\ufe0f]?"+Hp+("(?:\\u200d(?:"+[zs,Cl,qi].join("|")+")[\\ufe0e\\ufe0f]?"+Hp+")*"),zp="(?:"+[pi,Cl,qi].join("|")+")"+ls,jp="(?:"+[zs+Ge+"?",Ge,Cl,qi,xe].join("|")+")",Pl=RegExp("['\u2019]","g"),Vp=RegExp(Ge,"g"),Vs=RegExp(Lo+"(?="+Lo+")|"+jp+ls,"g"),Oo=RegExp([as+"?"+fi+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?="+[Ie,as,"$"].join("|")+")",js+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?="+[Ie,as+Gp,"$"].join("|")+")",as+"?"+Gp+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?",as+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",qe,zp].join("|"),"g"),Ws=RegExp("[\\u200d\\ud800-\\udfff"+se+"\\ufe0e\\ufe0f]"),Wp=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Xp=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],qp=-1,Pi={};Pi[ot]=Pi[yt]=Pi[Pt]=Pi[H]=Pi[ft]=Pi[Et]=Pi["[object Uint8ClampedArray]"]=Pi[At]=Pi[Rt]=!0,Pi[z]=Pi[k]=Pi[ge]=Pi[Z]=Pi[Ct]=Pi[vt]=Pi[Ot]=Pi[Nt]=Pi[L]=Pi[O]=Pi[Y]=Pi[C]=Pi[j]=Pi[X]=Pi[qt]=!1;var Fi={};Fi[z]=Fi[k]=Fi[ge]=Fi[Ct]=Fi[Z]=Fi[vt]=Fi[ot]=Fi[yt]=Fi[Pt]=Fi[H]=Fi[ft]=Fi[L]=Fi[O]=Fi[Y]=Fi[C]=Fi[j]=Fi[X]=Fi[K]=Fi[Et]=Fi["[object Uint8ClampedArray]"]=Fi[At]=Fi[Rt]=!0,Fi[Ot]=Fi[Nt]=Fi[qt]=!1;var No={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Tr=parseFloat,Yp=parseInt,Fc=typeof b=="object"&&b&&b.Object===Object&&b,$p=typeof self=="object"&&self&&self.Object===Object&&self,tn=Fc||$p||Function("return this")(),Xs=M&&!M.nodeType&&M,Na=Xs&&typeof q=="object"&&q&&!q.nodeType&&q,Bc=Na&&Na.exports===Xs,ju=Bc&&Fc.process,Er=function(){try{var It=Na&&Na.require&&Na.require("util").types;return It||ju&&ju.binding&&ju.binding("util")}catch{}}(),kc=Er&&Er.isArrayBuffer,Uc=Er&&Er.isDate,Vu=Er&&Er.isMap,Wu=Er&&Er.isRegExp,Xu=Er&&Er.isSet,qu=Er&&Er.isTypedArray;function ir(It,Qt,ie){switch(ie.length){case 0:return It.call(Qt);case 1:return It.call(Qt,ie[0]);case 2:return It.call(Qt,ie[0],ie[1]);case 3:return It.call(Qt,ie[0],ie[1],ie[2])}return It.apply(Qt,ie)}function Gc(It,Qt,ie,Se){for(var Be=-1,gi=It==null?0:It.length;++Be<gi;){var an=It[Be];Qt(Se,an,ie(an),It)}return Se}function hr(It,Qt){for(var ie=-1,Se=It==null?0:It.length;++ie<Se&&Qt(It[ie],ie,It)!==!1;);return It}function Hc(It,Qt){for(var ie=It==null?0:It.length;ie--&&Qt(It[ie],ie,It)!==!1;);return It}function zc(It,Qt){for(var ie=-1,Se=It==null?0:It.length;++ie<Se;)if(!Qt(It[ie],ie,It))return!1;return!0}function fo(It,Qt){for(var ie=-1,Se=It==null?0:It.length,Be=0,gi=[];++ie<Se;){var an=It[ie];Qt(an,ie,It)&&(gi[Be++]=an)}return gi}function Da(It,Qt){return!!(It!=null&&It.length)&&qs(It,Qt,0)>-1}function Yu(It,Qt,ie){for(var Se=-1,Be=It==null?0:It.length;++Se<Be;)if(ie(Qt,It[Se]))return!0;return!1}function Gi(It,Qt){for(var ie=-1,Se=It==null?0:It.length,Be=Array(Se);++ie<Se;)Be[ie]=Qt(It[ie],ie,It);return Be}function Do(It,Qt){for(var ie=-1,Se=Qt.length,Be=It.length;++ie<Se;)It[Be+ie]=Qt[ie];return It}function $u(It,Qt,ie,Se){var Be=-1,gi=It==null?0:It.length;for(Se&&gi&&(ie=It[++Be]);++Be<gi;)ie=Qt(ie,It[Be],Be,It);return ie}function Jp(It,Qt,ie,Se){var Be=It==null?0:It.length;for(Se&&Be&&(ie=It[--Be]);Be--;)ie=Qt(ie,It[Be],Be,It);return ie}function Ju(It,Qt){for(var ie=-1,Se=It==null?0:It.length;++ie<Se;)if(Qt(It[ie],ie,It))return!0;return!1}var Zp=Zu("length");function jc(It,Qt,ie){var Se;return ie(It,function(Be,gi,an){if(Qt(Be,gi,an))return Se=gi,!1}),Se}function Il(It,Qt,ie,Se){for(var Be=It.length,gi=ie+(Se?1:-1);Se?gi--:++gi<Be;)if(Qt(It[gi],gi,It))return gi;return-1}function qs(It,Qt,ie){return Qt==Qt?function(Se,Be,gi){for(var an=gi-1,Mr=Se.length;++an<Mr;)if(Se[an]===Be)return an;return-1}(It,Qt,ie):Il(It,Vc,ie)}function Kp(It,Qt,ie,Se){for(var Be=ie-1,gi=It.length;++Be<gi;)if(Se(It[Be],Qt))return Be;return-1}function Vc(It){return It!=It}function Wc(It,Qt){var ie=It==null?0:It.length;return ie?Qu(It,Qt)/ie:NaN}function Zu(It){return function(Qt){return Qt==null?void 0:Qt[It]}}function Ku(It){return function(Qt){return It==null?void 0:It[Qt]}}function Xc(It,Qt,ie,Se,Be){return Be(It,function(gi,an,Mr){ie=Se?(Se=!1,gi):Qt(ie,gi,an,Mr)}),ie}function Qu(It,Qt){for(var ie,Se=-1,Be=It.length;++Se<Be;){var gi=Qt(It[Se]);gi!==void 0&&(ie=ie===void 0?gi:ie+gi)}return ie}function th(It,Qt){for(var ie=-1,Se=Array(It);++ie<It;)Se[ie]=Qt(ie);return Se}function qc(It){return It&&It.slice(0,hs(It)+1).replace(Ui,"")}function cr(It){return function(Qt){return It(Qt)}}function eh(It,Qt){return Gi(Qt,function(ie){return It[ie]})}function Fa(It,Qt){return It.has(Qt)}function Yc(It,Qt){for(var ie=-1,Se=It.length;++ie<Se&&qs(Qt,It[ie],0)>-1;);return ie}function $c(It,Qt){for(var ie=It.length;ie--&&qs(Qt,It[ie],0)>-1;);return ie}function Qp(It,Qt){for(var ie=It.length,Se=0;ie--;)It[ie]===Qt&&++Se;return Se}var tf=Ku({\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"}),ef=Ku({"&":"&","<":"<",">":">",'"':""","'":"'"});function nf(It){return"\\"+No[It]}function Ys(It){return Ws.test(It)}function ih(It){var Qt=-1,ie=Array(It.size);return It.forEach(function(Se,Be){ie[++Qt]=[Be,Se]}),ie}function Jc(It,Qt){return function(ie){return It(Qt(ie))}}function Fo(It,Qt){for(var ie=-1,Se=It.length,Be=0,gi=[];++ie<Se;){var an=It[ie];an!==Qt&&an!==P||(It[ie]=P,gi[Be++]=ie)}return gi}function us(It){var Qt=-1,ie=Array(It.size);return It.forEach(function(Se){ie[++Qt]=Se}),ie}function Ll(It){var Qt=-1,ie=Array(It.size);return It.forEach(function(Se){ie[++Qt]=[Se,Se]}),ie}function Bo(It){return Ys(It)?function(Qt){for(var ie=Vs.lastIndex=0;Vs.test(Qt);)++ie;return ie}(It):Zp(It)}function Gn(It){return Ys(It)?function(Qt){return Qt.match(Vs)||[]}(It):function(Qt){return Qt.split("")}(It)}function hs(It){for(var Qt=It.length;Qt--&&On.test(It.charAt(Qt)););return Qt}var Ol=Ku({"&":"&","<":"<",">":">",""":'"',"'":"'"}),$s=function It(Qt){var ie,Se=(Qt=Qt==null?tn:$s.defaults(tn.Object(),Qt,$s.pick(tn,Xp))).Array,Be=Qt.Date,gi=Qt.Error,an=Qt.Function,Mr=Qt.Math,ki=Qt.Object,Nl=Qt.RegExp,Zc=Qt.String,dr=Qt.TypeError,Dl=Se.prototype,Kc=an.prototype,Br=ki.prototype,Fl=Qt["__core-js_shared__"],nh=Kc.toString,Ei=Br.hasOwnProperty,Dg=0,rf=(ie=/[^.]+$/.exec(Fl&&Fl.keys&&Fl.keys.IE_PROTO||""))?"Symbol(src)_1."+ie:"",rh=Br.toString,Fg=nh.call(ki),Bg=tn._,kg=Nl("^"+nh.call(Ei).replace(Ki,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),oh=Bc?Qt.Buffer:void 0,cs=Qt.Symbol,sh=Qt.Uint8Array,of=oh?oh.allocUnsafe:void 0,ah=Jc(ki.getPrototypeOf,ki),sf=ki.create,af=Br.propertyIsEnumerable,Bl=Dl.splice,Js=cs?cs.isConcatSpreadable:void 0,mo=cs?cs.iterator:void 0,Zs=cs?cs.toStringTag:void 0,lh=function(){try{var c=ha(ki,"defineProperty");return c({},"",{}),c}catch{}}(),Ug=Qt.clearTimeout!==tn.clearTimeout&&Qt.clearTimeout,Gg=Be&&Be.now!==tn.Date.now&&Be.now,Hg=Qt.setTimeout!==tn.setTimeout&&Qt.setTimeout,uh=Mr.ceil,hh=Mr.floor,Qc=ki.getOwnPropertySymbols,td=oh?oh.isBuffer:void 0,ko=Qt.isFinite,Hn=Dl.join,ch=Jc(ki.keys,ki),Hi=Mr.max,yn=Mr.min,Ar=Be.now,zn=Qt.parseInt,dh=Mr.random,kl=Dl.reverse,Ul=ha(Qt,"DataView"),Ba=ha(Qt,"Map"),ph=ha(Qt,"Promise"),Ks=ha(Qt,"Set"),ce=ha(Qt,"WeakMap"),zi=ha(ki,"create"),Uo=ce&&new ce,kr={},zg=ys(Ul),dn=ys(Ba),ed=ys(ph),Li=ys(Ks),Kr=ys(ce),Gl=cs?cs.prototype:void 0,Qs=Gl?Gl.valueOf:void 0,Nn=Gl?Gl.toString:void 0;function S(c){if(rn(c)&&!ti(c)&&!(c instanceof oi)){if(c instanceof Yi)return c;if(Ei.call(c,"__wrapped__"))return Sf(c)}return new Yi(c)}var ds=function(){function c(){}return function(f){if(!nn(f))return{};if(sf)return sf(f);c.prototype=f;var x=new c;return c.prototype=void 0,x}}();function Hl(){}function Yi(c,f){this.__wrapped__=c,this.__actions__=[],this.__chain__=!!f,this.__index__=0,this.__values__=void 0}function oi(c){this.__wrapped__=c,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Qr(c){var f=-1,x=c==null?0:c.length;for(this.clear();++f<x;){var R=c[f];this.set(R[0],R[1])}}function to(c){var f=-1,x=c==null?0:c.length;for(this.clear();++f<x;){var R=c[f];this.set(R[0],R[1])}}function pr(c){var f=-1,x=c==null?0:c.length;for(this.clear();++f<x;){var R=c[f];this.set(R[0],R[1])}}function Ur(c){var f=-1,x=c==null?0:c.length;for(this.__data__=new pr;++f<x;)this.add(c[f])}function Jn(c){var f=this.__data__=new to(c);this.size=f.size}function Go(c,f){var x=ti(c),R=!x&&bs(c),D=!x&&!R&&Xo(c),$=!x&&!R&&!D&&da(c),ut=x||R||D||$,mt=ut?th(c.length,Zc):[],Mt=mt.length;for(var Jt in c)!f&&!Ei.call(c,Jt)||ut&&(Jt=="length"||D&&(Jt=="offset"||Jt=="parent")||$&&(Jt=="buffer"||Jt=="byteLength"||Jt=="byteOffset")||Kn(Jt,Mt))||mt.push(Jt);return mt}function Ho(c){var f=c.length;return f?c[gs(0,f-1)]:void 0}function ta(c,f){return Ah(Mn(c),zo(f,0,c.length))}function zl(c){return Ah(Mn(c))}function ka(c,f,x){(x!==void 0&&!Wr(c[f],x)||x===void 0&&!(f in c))&&vo(c,f,x)}function ps(c,f,x){var R=c[f];Ei.call(c,f)&&Wr(R,x)&&(x!==void 0||f in c)||vo(c,f,x)}function go(c,f){for(var x=c.length;x--;)if(Wr(c[x][0],f))return x;return-1}function id(c,f,x,R){return nr(c,function(D,$,ut){f(R,D,x(D),ut)}),R}function lf(c,f){return c&&un(f,Rn(f),c)}function vo(c,f,x){f=="__proto__"&&lh?lh(c,f,{configurable:!0,enumerable:!0,value:x,writable:!0}):c[f]=x}function jl(c,f){for(var x=-1,R=f.length,D=Se(R),$=c==null;++x<R;)D[x]=$?void 0:Dd(c,f[x]);return D}function zo(c,f,x){return c==c&&(x!==void 0&&(c=c<=x?c:x),f!==void 0&&(c=c>=f?c:f)),c}function En(c,f,x,R,D,$){var ut,mt=1&f,Mt=2&f,Jt=4&f;if(x&&(ut=D?x(c,R,D,$):x(c)),ut!==void 0)return ut;if(!nn(c))return c;var Zt=ti(c);if(Zt){if(ut=function(re){var pe=re.length,He=new re.constructor(pe);return pe&&typeof re[0]=="string"&&Ei.call(re,"index")&&(He.index=re.index,He.input=re.input),He}(c),!mt)return Mn(c,ut)}else{var de=An(c),Oe=de==Nt||de==E;if(Xo(c))return fd(c,mt);if(de==Y||de==z||Oe&&!D){if(ut=Mt||Oe?{}:yd(c),!mt)return Mt?function(re,pe){return un(re,ca(re),pe)}(c,function(re,pe){return re&&un(pe,Fn(pe),re)}(ut,c)):function(re,pe){return un(re,jr(re),pe)}(c,lf(ut,c))}else{if(!Fi[de])return D?c:{};ut=function(re,pe,He){var Ce=re.constructor;switch(pe){case ge:return md(re);case Z:case vt:return new Ce(+re);case Ct:return function(Ye,li){var ke=li?md(Ye.buffer):Ye.buffer;return new Ye.constructor(ke,Ye.byteOffset,Ye.byteLength)}(re,He);case ot:case yt:case Pt:case H:case ft:case Et:case"[object Uint8ClampedArray]":case At:case Rt:return ra(re,He);case L:return new Ce;case O:case X:return new Ce(re);case C:return function(Ye){var li=new Ye.constructor(Ye.source,Zr.exec(Ye));return li.lastIndex=Ye.lastIndex,li}(re);case j:return new Ce;case K:return Ue=re,Qs?ki(Qs.call(Ue)):{}}var Ue}(c,de,mt)}}$||($=new Jn);var Fe=$.get(c);if(Fe)return Fe;$.set(c,ut),Gf(c)?c.forEach(function(re){ut.add(En(re,f,x,re,c,$))}):Uf(c)&&c.forEach(function(re,pe){ut.set(pe,En(re,f,x,pe,c,$))});var Ve=Zt?void 0:(Jt?Mt?la:rr:Mt?Fn:Rn)(c);return hr(Ve||c,function(re,pe){Ve&&(re=c[pe=re]),ps(ut,pe,En(re,f,x,pe,c,$))}),ut}function _o(c,f,x){var R=x.length;if(c==null)return!R;for(c=ki(c);R--;){var D=x[R],$=f[D],ut=c[D];if(ut===void 0&&!(D in c)||!$(ut))return!1}return!0}function fh(c,f,x){if(typeof c!="function")throw new dr(W);return Zl(function(){c.apply(void 0,x)},f)}function fs(c,f,x,R){var D=-1,$=Da,ut=!0,mt=c.length,Mt=[],Jt=f.length;if(!mt)return Mt;x&&(f=Gi(f,cr(x))),R?($=Yu,ut=!1):f.length>=200&&($=Fa,ut=!1,f=new Ur(f));t:for(;++D<mt;){var Zt=c[D],de=x==null?Zt:x(Zt);if(Zt=R||Zt!==0?Zt:0,ut&&de==de){for(var Oe=Jt;Oe--;)if(f[Oe]===de)continue t;Mt.push(Zt)}else $(f,de,R)||Mt.push(Zt)}return Mt}S.templateSettings={escape:Ze,evaluate:ri,interpolate:De,variable:"",imports:{_:S}},S.prototype=Hl.prototype,S.prototype.constructor=S,Yi.prototype=ds(Hl.prototype),Yi.prototype.constructor=Yi,oi.prototype=ds(Hl.prototype),oi.prototype.constructor=oi,Qr.prototype.clear=function(){this.__data__=zi?zi(null):{},this.size=0},Qr.prototype.delete=function(c){var f=this.has(c)&&delete this.__data__[c];return this.size-=f?1:0,f},Qr.prototype.get=function(c){var f=this.__data__;if(zi){var x=f[c];return x==="__lodash_hash_undefined__"?void 0:x}return Ei.call(f,c)?f[c]:void 0},Qr.prototype.has=function(c){var f=this.__data__;return zi?f[c]!==void 0:Ei.call(f,c)},Qr.prototype.set=function(c,f){var x=this.__data__;return this.size+=this.has(c)?0:1,x[c]=zi&&f===void 0?"__lodash_hash_undefined__":f,this},to.prototype.clear=function(){this.__data__=[],this.size=0},to.prototype.delete=function(c){var f=this.__data__,x=go(f,c);return!(x<0)&&(x==f.length-1?f.pop():Bl.call(f,x,1),--this.size,!0)},to.prototype.get=function(c){var f=this.__data__,x=go(f,c);return x<0?void 0:f[x][1]},to.prototype.has=function(c){return go(this.__data__,c)>-1},to.prototype.set=function(c,f){var x=this.__data__,R=go(x,c);return R<0?(++this.size,x.push([c,f])):x[R][1]=f,this},pr.prototype.clear=function(){this.size=0,this.__data__={hash:new Qr,map:new(Ba||to),string:new Qr}},pr.prototype.delete=function(c){var f=Za(this,c).delete(c);return this.size-=f?1:0,f},pr.prototype.get=function(c){return Za(this,c).get(c)},pr.prototype.has=function(c){return Za(this,c).has(c)},pr.prototype.set=function(c,f){var x=Za(this,c),R=x.size;return x.set(c,f),this.size+=x.size==R?0:1,this},Ur.prototype.add=Ur.prototype.push=function(c){return this.__data__.set(c,"__lodash_hash_undefined__"),this},Ur.prototype.has=function(c){return this.__data__.has(c)},Jn.prototype.clear=function(){this.__data__=new to,this.size=0},Jn.prototype.delete=function(c){var f=this.__data__,x=f.delete(c);return this.size=f.size,x},Jn.prototype.get=function(c){return this.__data__.get(c)},Jn.prototype.has=function(c){return this.__data__.has(c)},Jn.prototype.set=function(c,f){var x=this.__data__;if(x instanceof to){var R=x.__data__;if(!Ba||R.length<199)return R.push([c,f]),this.size=++x.size,this;x=this.__data__=new pr(R)}return x.set(c,f),this.size=x.size,this};var nr=ze(yo),mh=ze(nd,!0);function gh(c,f){var x=!0;return nr(c,function(R,D,$){return x=!!f(R,D,$)}),x}function Ua(c,f,x){for(var R=-1,D=c.length;++R<D;){var $=c[R],ut=f($);if(ut!=null&&(mt===void 0?ut==ut&&!Lr(ut):x(ut,mt)))var mt=ut,Mt=$}return Mt}function jo(c,f){var x=[];return nr(c,function(R,D,$){f(R,D,$)&&x.push(R)}),x}function Ee(c,f,x,R,D){var $=-1,ut=c.length;for(x||(x=jg),D||(D=[]);++$<ut;){var mt=c[$];f>0&&x(mt)?f>1?Ee(mt,f-1,x,R,D):Do(D,mt):R||(D[D.length]=mt)}return D}var ms=gd(),Gr=gd(!0);function yo(c,f){return c&&ms(c,f,Rn)}function nd(c,f){return c&&Gr(c,f,Rn)}function eo(c,f){return fo(f,function(x){return oo(c[x])})}function xo(c,f){for(var x=0,R=(f=no(f,c)).length;c!=null&&x<R;)c=c[Vr(f[x++])];return x&&x==R?c:void 0}function fr(c,f,x){var R=f(c);return ti(c)?R:Do(R,x(c))}function Zn(c){return c==null?c===void 0?"[object Undefined]":"[object Null]":Zs&&Zs in ki(c)?function(f){var x=Ei.call(f,Zs),R=f[Zs];try{f[Zs]=void 0;var D=!0}catch{}var $=rh.call(f);return D&&(x?f[Zs]=R:delete f[Zs]),$}(c):function(f){return rh.call(f)}(c)}function vh(c,f){return c>f}function ea(c,f){return c!=null&&Ei.call(c,f)}function rd(c,f){return c!=null&&f in ki(c)}function od(c,f,x){for(var R=x?Yu:Da,D=c[0].length,$=c.length,ut=$,mt=Se($),Mt=1/0,Jt=[];ut--;){var Zt=c[ut];ut&&f&&(Zt=Gi(Zt,cr(f))),Mt=yn(Zt.length,Mt),mt[ut]=!x&&(f||D>=120&&Zt.length>=120)?new Ur(ut&&Zt):void 0}Zt=c[0];var de=-1,Oe=mt[0];t:for(;++de<D&&Jt.length<Mt;){var Fe=Zt[de],Ve=f?f(Fe):Fe;if(Fe=x||Fe!==0?Fe:0,!(Oe?Fa(Oe,Ve):R(Jt,Ve,x))){for(ut=$;--ut;){var re=mt[ut];if(!(re?Fa(re,Ve):R(c[ut],Ve,x)))continue t}Oe&&Oe.push(Ve),Jt.push(Fe)}}return Jt}function Ga(c,f,x){var R=(c=yf(c,f=no(f,c)))==null?c:c[Vr(Ir(f))];return R==null?void 0:ir(R,c,x)}function ia(c){return rn(c)&&Zn(c)==z}function Rr(c,f,x,R,D){return c===f||(c==null||f==null||!rn(c)&&!rn(f)?c!=c&&f!=f:function($,ut,mt,Mt,Jt,Zt){var de=ti($),Oe=ti(ut),Fe=de?k:An($),Ve=Oe?k:An(ut),re=(Fe=Fe==z?Y:Fe)==Y,pe=(Ve=Ve==z?Y:Ve)==Y,He=Fe==Ve;if(He&&Xo($)){if(!Xo(ut))return!1;de=!0,re=!1}if(He&&!re)return Zt||(Zt=new Jn),de||da($)?jn($,ut,mt,Mt,Jt,Zt):function(ke,Je,hn,Vn,cn,on,so){switch(hn){case Ct:if(ke.byteLength!=Je.byteLength||ke.byteOffset!=Je.byteOffset)return!1;ke=ke.buffer,Je=Je.buffer;case ge:return!(ke.byteLength!=Je.byteLength||!on(new sh(ke),new sh(Je)));case Z:case vt:case O:return Wr(+ke,+Je);case Ot:return ke.name==Je.name&&ke.message==Je.message;case C:case X:return ke==Je+"";case L:var Eo=ih;case j:var Ss=1&Vn;if(Eo||(Eo=us),ke.size!=Je.size&&!Ss)return!1;var sl=so.get(ke);if(sl)return sl==Je;Vn|=2,so.set(ke,Je);var Ts=jn(Eo(ke),Eo(Je),Vn,cn,on,so);return so.delete(ke),Ts;case K:if(Qs)return Qs.call(ke)==Qs.call(Je)}return!1}($,ut,Fe,mt,Mt,Jt,Zt);if(!(1&mt)){var Ce=re&&Ei.call($,"__wrapped__"),Ue=pe&&Ei.call(ut,"__wrapped__");if(Ce||Ue){var Ye=Ce?$.value():$,li=Ue?ut.value():ut;return Zt||(Zt=new Jn),Jt(Ye,li,mt,Mt,Zt)}}return He?(Zt||(Zt=new Jn),function(ke,Je,hn,Vn,cn,on){var so=1&hn,Eo=rr(ke),Ss=Eo.length,sl=rr(Je).length;if(Ss!=sl&&!so)return!1;for(var Ts=Ss;Ts--;){var Mo=Eo[Ts];if(!(so?Mo in Je:Ei.call(Je,Mo)))return!1}var qh=on.get(ke),Ud=on.get(Je);if(qh&&Ud)return qh==Je&&Ud==ke;var Es=!0;on.set(ke,Je),on.set(Je,ke);for(var _a=so;++Ts<Ss;){Mo=Eo[Ts];var ya=ke[Mo],al=Je[Mo];if(Vn)var ll=so?Vn(al,ya,Mo,Je,ke,on):Vn(ya,al,Mo,ke,Je,on);if(!(ll===void 0?ya===al||cn(ya,al,hn,Vn,on):ll)){Es=!1;break}_a||(_a=Mo=="constructor")}if(Es&&!_a){var lu=ke.constructor,xa=Je.constructor;lu==xa||!("constructor"in ke)||!("constructor"in Je)||typeof lu=="function"&&lu instanceof lu&&typeof xa=="function"&&xa instanceof xa||(Es=!1)}return on.delete(ke),on.delete(Je),Es}($,ut,mt,Mt,Jt,Zt)):!1}(c,f,x,R,Rr,D))}function Ha(c,f,x,R){var D=x.length,$=D,ut=!R;if(c==null)return!$;for(c=ki(c);D--;){var mt=x[D];if(ut&&mt[2]?mt[1]!==c[mt[0]]:!(mt[0]in c))return!1}for(;++D<$;){var Mt=(mt=x[D])[0],Jt=c[Mt],Zt=mt[1];if(ut&&mt[2]){if(Jt===void 0&&!(Mt in c))return!1}else{var de=new Jn;if(R)var Oe=R(Jt,Zt,Mt,c,f,de);if(!(Oe===void 0?Rr(Zt,Jt,3,R,de):Oe))return!1}}return!0}function za(c){return!(!nn(c)||(f=c,rf&&rf in f))&&(oo(c)?kg:at).test(ys(c));var f}function uf(c){return typeof c=="function"?c:c==null?sr:typeof c=="object"?ti(c)?ld(c[0],c[1]):cf(c):Kf(c)}function sd(c){if(!Jl(c))return ch(c);var f=[];for(var x in ki(c))Ei.call(c,x)&&x!="constructor"&&f.push(x);return f}function hf(c){if(!nn(c))return function(D){var $=[];if(D!=null)for(var ut in ki(D))$.push(ut);return $}(c);var f=Jl(c),x=[];for(var R in c)(R!="constructor"||!f&&Ei.call(c,R))&&x.push(R);return x}function _h(c,f){return c<f}function ad(c,f){var x=-1,R=mr(c)?Se(c.length):[];return nr(c,function(D,$,ut){R[++x]=f(D,$,ut)}),R}function cf(c){var f=_d(c);return f.length==1&&f[0][2]?vf(f[0][0],f[0][1]):function(x){return x===c||Ha(x,c,f)}}function ld(c,f){return Te(c)&&gf(f)?vf(Vr(c),f):function(x){var R=Dd(x,c);return R===void 0&&R===f?tu(x,c):Rr(f,R,3)}}function hi(c,f,x,R,D){c!==f&&ms(f,function($,ut){if(D||(D=new Jn),nn($))(function(Mt,Jt,Zt,de,Oe,Fe,Ve){var re=xd(Mt,Zt),pe=xd(Jt,Zt),He=Ve.get(pe);if(He)return void ka(Mt,Zt,He);var Ce=Fe?Fe(re,pe,Zt+"",Mt,Jt,Ve):void 0,Ue=Ce===void 0;if(Ue){var Ye=ti(pe),li=!Ye&&Xo(pe),ke=!Ye&&!li&&da(pe);Ce=pe,Ye||li||ke?ti(re)?Ce=re:Vi(re)?Ce=Mn(re):li?(Ue=!1,Ce=fd(pe,!0)):ke?(Ue=!1,Ce=ra(pe,!0)):Ce=[]:tl(pe)||bs(pe)?(Ce=re,bs(re)?Ce=Vf(re):nn(re)&&!oo(re)||(Ce=yd(pe))):Ue=!1}Ue&&(Ve.set(pe,Ce),Oe(Ce,pe,de,Fe,Ve),Ve.delete(pe)),ka(Mt,Zt,Ce)})(c,f,ut,x,hi,R,D);else{var mt=R?R(xd(c,ut),$,ut+"",c,f,D):void 0;mt===void 0&&(mt=$),ka(c,ut,mt)}},Fn)}function Hr(c,f){var x=c.length;if(x)return Kn(f+=f<0?x:0,x)?c[f]:void 0}function bo(c,f,x){f=f.length?Gi(f,function(D){return ti(D)?function($){return xo($,D.length===1?D[0]:D)}:D}):[sr];var R=-1;return f=Gi(f,cr(je())),function(D,$){var ut=D.length;for(D.sort($);ut--;)D[ut]=D[ut].value;return D}(ad(c,function(D,$,ut){return{criteria:Gi(f,function(mt){return mt(D)}),index:++R,value:D}}),function(D,$){return function(ut,mt,Mt){for(var Jt=-1,Zt=ut.criteria,de=mt.criteria,Oe=Zt.length,Fe=Mt.length;++Jt<Oe;){var Ve=mf(Zt[Jt],de[Jt]);if(Ve){if(Jt>=Fe)return Ve;var re=Mt[Jt];return Ve*(re=="desc"?-1:1)}}return ut.index-mt.index}(D,$,x)})}function yh(c,f,x){for(var R=-1,D=f.length,$={};++R<D;){var ut=f[R],mt=xo(c,ut);x(mt,ut)&&ji($,no(ut,c),mt)}return $}function io(c,f,x,R){var D=R?Kp:qs,$=-1,ut=f.length,mt=c;for(c===f&&(f=Mn(f)),x&&(mt=Gi(c,cr(x)));++$<ut;)for(var Mt=0,Jt=f[$],Zt=x?x(Jt):Jt;(Mt=D(mt,Zt,Mt,R))>-1;)mt!==c&&Bl.call(mt,Mt,1),Bl.call(c,Mt,1);return c}function na(c,f){for(var x=c?f.length:0,R=x-1;x--;){var D=f[x];if(x==R||D!==$){var $=D;Kn(D)?Bl.call(c,D,1):Va(c,D)}}return c}function gs(c,f){return c+hh(dh()*(f-c+1))}function xh(c,f){var x="";if(!c||f<1||f>9007199254740991)return x;do f%2&&(x+=c),(f=hh(f/2))&&(c+=c);while(f);return x}function ci(c,f){return bd(_f(c,f,sr),c+"")}function ud(c){return Ho(To(c))}function hd(c,f){var x=To(c);return Ah(x,zo(f,0,x.length))}function ji(c,f,x,R){if(!nn(c))return c;for(var D=-1,$=(f=no(f,c)).length,ut=$-1,mt=c;mt!=null&&++D<$;){var Mt=Vr(f[D]),Jt=x;if(Mt==="__proto__"||Mt==="constructor"||Mt==="prototype")return c;if(D!=ut){var Zt=mt[Mt];(Jt=R?R(Zt,Mt,mt):void 0)===void 0&&(Jt=nn(Zt)?Zt:Kn(f[D+1])?[]:{})}ps(mt,Mt,Jt),mt=mt[Mt]}return c}var df=Uo?function(c,f){return Uo.set(c,f),c}:sr,Dn=lh?function(c,f){return lh(c,"toString",{configurable:!0,enumerable:!1,value:nl(f),writable:!0})}:sr;function pf(c){return Ah(To(c))}function ln(c,f,x){var R=-1,D=c.length;f<0&&(f=-f>D?0:D+f),(x=x>D?D:x)<0&&(x+=D),D=f>x?0:x-f>>>0,f>>>=0;for(var $=Se(D);++R<D;)$[R]=c[R+f];return $}function bh(c,f){var x;return nr(c,function(R,D,$){return!(x=f(R,D,$))}),!!x}function ja(c,f,x){var R=0,D=c==null?R:c.length;if(typeof f=="number"&&f==f&&D<=2147483647){for(;R<D;){var $=R+D>>>1,ut=c[$];ut!==null&&!Lr(ut)&&(x?ut<=f:ut<f)?R=$+1:D=$}return D}return Vl(c,f,sr,x)}function Vl(c,f,x,R){var D=0,$=c==null?0:c.length;if($===0)return 0;for(var ut=(f=x(f))!=f,mt=f===null,Mt=Lr(f),Jt=f===void 0;D<$;){var Zt=hh((D+$)/2),de=x(c[Zt]),Oe=de!==void 0,Fe=de===null,Ve=de==de,re=Lr(de);if(ut)var pe=R||Ve;else pe=Jt?Ve&&(R||Oe):mt?Ve&&Oe&&(R||!Fe):Mt?Ve&&Oe&&!Fe&&(R||!re):!Fe&&!re&&(R?de<=f:de<f);pe?D=Zt+1:$=Zt}return yn($,4294967294)}function wh(c,f){for(var x=-1,R=c.length,D=0,$=[];++x<R;){var ut=c[x],mt=f?f(ut):ut;if(!x||!Wr(mt,Mt)){var Mt=mt;$[D++]=ut===0?0:ut}}return $}function Le(c){return typeof c=="number"?c:Lr(c)?NaN:+c}function pn(c){if(typeof c=="string")return c;if(ti(c))return Gi(c,pn)+"";if(Lr(c))return Nn?Nn.call(c):"";var f=c+"";return f=="0"&&1/c==-1/0?"-0":f}function Si(c,f,x){var R=-1,D=Da,$=c.length,ut=!0,mt=[],Mt=mt;if(x)ut=!1,D=Yu;else if($>=200){var Jt=f?null:vd(c);if(Jt)return us(Jt);ut=!1,D=Fa,Mt=new Ur}else Mt=f?[]:mt;t:for(;++R<$;){var Zt=c[R],de=f?f(Zt):Zt;if(Zt=x||Zt!==0?Zt:0,ut&&de==de){for(var Oe=Mt.length;Oe--;)if(Mt[Oe]===de)continue t;f&&Mt.push(de),mt.push(Zt)}else D(Mt,de,x)||(Mt!==mt&&Mt.push(de),mt.push(Zt))}return mt}function Va(c,f){return(c=yf(c,f=no(f,c)))==null||delete c[Vr(Ir(f))]}function mi(c,f,x,R){return ji(c,f,x(xo(c,f)),R)}function Wl(c,f,x,R){for(var D=c.length,$=R?D:-1;(R?$--:++$<D)&&f(c[$],$,c););return x?ln(c,R?0:$,R?$+1:D):ln(c,R?$+1:0,R?D:$)}function cd(c,f){var x=c;return x instanceof oi&&(x=x.value()),$u(f,function(R,D){return D.func.apply(D.thisArg,Do([R],D.args))},x)}function Sh(c,f,x){var R=c.length;if(R<2)return R?Si(c[0]):[];for(var D=-1,$=Se(R);++D<R;)for(var ut=c[D],mt=-1;++mt<R;)mt!=D&&($[D]=fs($[D]||ut,c[mt],f,x));return Si(Ee($,1),f,x)}function dd(c,f,x){for(var R=-1,D=c.length,$=f.length,ut={};++R<D;){var mt=R<$?f[R]:void 0;x(ut,c[R],mt)}return ut}function Wa(c){return Vi(c)?c:[]}function Th(c){return typeof c=="function"?c:sr}function no(c,f){return ti(c)?c:Te(c,f)?[c]:Rh(xi(c))}var ff=ci;function _e(c,f,x){var R=c.length;return x=x===void 0?R:x,!f&&x>=R?c:ln(c,f,x)}var pd=Ug||function(c){return tn.clearTimeout(c)};function fd(c,f){if(f)return c.slice();var x=c.length,R=of?of(x):new c.constructor(x);return c.copy(R),R}function md(c){var f=new c.constructor(c.byteLength);return new sh(f).set(new sh(c)),f}function ra(c,f){var x=f?md(c.buffer):c.buffer;return new c.constructor(x,c.byteOffset,c.length)}function mf(c,f){if(c!==f){var x=c!==void 0,R=c===null,D=c==c,$=Lr(c),ut=f!==void 0,mt=f===null,Mt=f==f,Jt=Lr(f);if(!mt&&!Jt&&!$&&c>f||$&&ut&&Mt&&!mt&&!Jt||R&&ut&&Mt||!x&&Mt||!D)return 1;if(!R&&!$&&!Jt&&c<f||Jt&&x&&D&&!R&&!$||mt&&x&&D||!ut&&D||!Mt)return-1}return 0}function Cr(c,f,x,R){for(var D=-1,$=c.length,ut=x.length,mt=-1,Mt=f.length,Jt=Hi($-ut,0),Zt=Se(Mt+Jt),de=!R;++mt<Mt;)Zt[mt]=f[mt];for(;++D<ut;)(de||D<$)&&(Zt[x[D]]=c[D]);for(;Jt--;)Zt[mt++]=c[D++];return Zt}function Eh(c,f,x,R){for(var D=-1,$=c.length,ut=-1,mt=x.length,Mt=-1,Jt=f.length,Zt=Hi($-mt,0),de=Se(Zt+Jt),Oe=!R;++D<Zt;)de[D]=c[D];for(var Fe=D;++Mt<Jt;)de[Fe+Mt]=f[Mt];for(;++ut<mt;)(Oe||D<$)&&(de[Fe+x[ut]]=c[D++]);return de}function Mn(c,f){var x=-1,R=c.length;for(f||(f=Se(R));++x<R;)f[x]=c[x];return f}function un(c,f,x,R){var D=!x;x||(x={});for(var $=-1,ut=f.length;++$<ut;){var mt=f[$],Mt=R?R(x[mt],c[mt],mt,x,c):void 0;Mt===void 0&&(Mt=c[mt]),D?vo(x,mt,Mt):ps(x,mt,Mt)}return x}function vs(c,f){return function(x,R){var D=ti(x)?Gc:id,$=f?f():{};return D(x,c,je(R,2),$)}}function en(c){return ci(function(f,x){var R=-1,D=x.length,$=D>1?x[D-1]:void 0,ut=D>2?x[2]:void 0;for($=c.length>3&&typeof $=="function"?(D--,$):void 0,ut&&$e(x[0],x[1],ut)&&($=D<3?void 0:$,D=1),f=ki(f);++R<D;){var mt=x[R];mt&&c(f,mt,R,$)}return f})}function ze(c,f){return function(x,R){if(x==null)return x;if(!mr(x))return c(x,R);for(var D=x.length,$=f?D:-1,ut=ki(x);(f?$--:++$<D)&&R(ut[$],$,ut)!==!1;);return x}}function gd(c){return function(f,x,R){for(var D=-1,$=ki(f),ut=R(f),mt=ut.length;mt--;){var Mt=ut[c?mt:++D];if(x($[Mt],Mt,$)===!1)break}return f}}function oa(c){return function(f){var x=Ys(f=xi(f))?Gn(f):void 0,R=x?x[0]:f.charAt(0),D=x?_e(x,1).join(""):f.slice(1);return R[c]()+D}}function _s(c){return function(f){return $u(Fd(va(f).replace(Pl,"")),c,"")}}function zr(c){return function(){var f=arguments;switch(f.length){case 0:return new c;case 1:return new c(f[0]);case 2:return new c(f[0],f[1]);case 3:return new c(f[0],f[1],f[2]);case 4:return new c(f[0],f[1],f[2],f[3]);case 5:return new c(f[0],f[1],f[2],f[3],f[4]);case 6:return new c(f[0],f[1],f[2],f[3],f[4],f[5]);case 7:return new c(f[0],f[1],f[2],f[3],f[4],f[5],f[6])}var x=ds(c.prototype),R=c.apply(x,f);return nn(R)?R:x}}function Vo(c){return function(f,x,R){var D=ki(f);if(!mr(f)){var $=je(x,3);f=Rn(f),x=function(mt){return $(D[mt],mt,D)}}var ut=c(f,x,R);return ut>-1?D[$?f[ut]:ut]:void 0}}function Wo(c){return So(function(f){var x=f.length,R=x,D=Yi.prototype.thru;for(c&&f.reverse();R--;){var $=f[R];if(typeof $!="function")throw new dr(W);if(D&&!ut&&ua($)=="wrapper")var ut=new Yi([],!0)}for(R=ut?R:x;++R<x;){var mt=ua($=f[R]),Mt=mt=="wrapper"?fn($):void 0;ut=Mt&&Pr(Mt[0])&&Mt[1]==424&&!Mt[4].length&&Mt[9]==1?ut[ua(Mt[0])].apply(ut,Mt[3]):$.length==1&&Pr($)?ut[mt]():ut.thru($)}return function(){var Jt=arguments,Zt=Jt[0];if(ut&&Jt.length==1&&ti(Zt))return ut.plant(Zt).value();for(var de=0,Oe=x?f[de].apply(this,Jt):Zt;++de<x;)Oe=f[de].call(this,Oe);return Oe}})}function Xa(c,f,x,R,D,$,ut,mt,Mt,Jt){var Zt=128&f,de=1&f,Oe=2&f,Fe=24&f,Ve=512&f,re=Oe?void 0:zr(c);return function pe(){for(var He=arguments.length,Ce=Se(He),Ue=He;Ue--;)Ce[Ue]=arguments[Ue];if(Fe)var Ye=ro(pe),li=Qp(Ce,Ye);if(R&&(Ce=Cr(Ce,R,D,Fe)),$&&(Ce=Eh(Ce,$,ut,Fe)),He-=li,Fe&&He<Jt){var ke=Fo(Ce,Ye);return ql(c,f,Xa,pe.placeholder,x,Ce,ke,mt,Mt,Jt-He)}var Je=de?x:this,hn=Oe?Je[c]:c;return He=Ce.length,mt?Ce=Wg(Ce,mt):Ve&&He>1&&Ce.reverse(),Zt&&Mt<He&&(Ce.length=Mt),this&&this!==tn&&this instanceof pe&&(hn=re||zr(hn)),hn.apply(Je,Ce)}}function Mh(c,f){return function(x,R){return function(D,$,ut,mt){return yo(D,function(Mt,Jt,Zt){$(mt,ut(Mt),Jt,Zt)}),mt}(x,c,f(R),{})}}function qa(c,f){return function(x,R){var D;if(x===void 0&&R===void 0)return f;if(x!==void 0&&(D=x),R!==void 0){if(D===void 0)return R;typeof x=="string"||typeof R=="string"?(x=pn(x),R=pn(R)):(x=Le(x),R=Le(R)),D=c(x,R)}return D}}function Ya(c){return So(function(f){return f=Gi(f,cr(je())),ci(function(x){var R=this;return c(f,function(D){return ir(D,R,x)})})})}function sa(c,f){var x=(f=f===void 0?" ":pn(f)).length;if(x<2)return x?xh(f,c):f;var R=xh(f,uh(c/Bo(f)));return Ys(f)?_e(Gn(R),0,c).join(""):R.slice(0,c)}function Xl(c){return function(f,x,R){return R&&typeof R!="number"&&$e(f,x,R)&&(x=R=void 0),f=qo(f),x===void 0?(x=f,f=0):x=qo(x),function(D,$,ut,mt){for(var Mt=-1,Jt=Hi(uh(($-D)/(ut||1)),0),Zt=Se(Jt);Jt--;)Zt[mt?Jt:++Mt]=D,D+=ut;return Zt}(f,x,R=R===void 0?f<x?1:-1:qo(R),c)}}function aa(c){return function(f,x){return typeof f=="string"&&typeof x=="string"||(f=Or(f),x=Or(x)),c(f,x)}}function ql(c,f,x,R,D,$,ut,mt,Mt,Jt){var Zt=8&f;f|=Zt?32:64,4&(f&=~(Zt?64:32))||(f&=-4);var de=[c,f,D,Zt?$:void 0,Zt?ut:void 0,Zt?void 0:$,Zt?void 0:ut,mt,Mt,Jt],Oe=x.apply(void 0,de);return Pr(c)&&xf(Oe,de),Oe.placeholder=R,bf(Oe,c,f)}function $a(c){var f=Mr[c];return function(x,R){if(x=Or(x),(R=R==null?0:yn(di(R),292))&&ko(x)){var D=(xi(x)+"e").split("e");return+((D=(xi(f(D[0]+"e"+(+D[1]+R)))+"e").split("e"))[0]+"e"+(+D[1]-R))}return f(x)}}var vd=Ks&&1/us(new Ks([,-0]))[1]==1/0?function(c){return new Ks(c)}:rl;function Yl(c){return function(f){var x=An(f);return x==L?ih(f):x==j?Ll(f):function(R,D){return Gi(D,function($){return[$,R[$]]})}(f,c(f))}}function Ti(c,f,x,R,D,$,ut,mt){var Mt=2&f;if(!Mt&&typeof c!="function")throw new dr(W);var Jt=R?R.length:0;if(Jt||(f&=-97,R=D=void 0),ut=ut===void 0?ut:Hi(di(ut),0),mt=mt===void 0?mt:di(mt),Jt-=D?D.length:0,64&f){var Zt=R,de=D;R=D=void 0}var Oe=Mt?void 0:fn(c),Fe=[c,f,x,R,D,Zt,de,$,ut,mt];if(Oe&&function(re,pe){var He=re[1],Ce=pe[1],Ue=He|Ce,Ye=Ue<131,li=Ce==128&&He==8||Ce==128&&He==256&&re[7].length<=pe[8]||Ce==384&&pe[7].length<=pe[8]&&He==8;if(!Ye&&!li)return re;1&Ce&&(re[2]=pe[2],Ue|=1&He?0:4);var ke=pe[3];if(ke){var Je=re[3];re[3]=Je?Cr(Je,ke,pe[4]):ke,re[4]=Je?Fo(re[3],P):pe[4]}(ke=pe[5])&&(Je=re[5],re[5]=Je?Eh(Je,ke,pe[6]):ke,re[6]=Je?Fo(re[5],P):pe[6]),(ke=pe[7])&&(re[7]=ke),128&Ce&&(re[8]=re[8]==null?pe[8]:yn(re[8],pe[8])),re[9]==null&&(re[9]=pe[9]),re[0]=pe[0],re[1]=Ue}(Fe,Oe),c=Fe[0],f=Fe[1],x=Fe[2],R=Fe[3],D=Fe[4],!(mt=Fe[9]=Fe[9]===void 0?Mt?0:c.length:Hi(Fe[9]-Jt,0))&&24&f&&(f&=-25),f&&f!=1)Ve=f==8||f==16?function(re,pe,He){var Ce=zr(re);return function Ue(){for(var Ye=arguments.length,li=Se(Ye),ke=Ye,Je=ro(Ue);ke--;)li[ke]=arguments[ke];var hn=Ye<3&&li[0]!==Je&&li[Ye-1]!==Je?[]:Fo(li,Je);if((Ye-=hn.length)<He)return ql(re,pe,Xa,Ue.placeholder,void 0,li,hn,void 0,void 0,He-Ye);var Vn=this&&this!==tn&&this instanceof Ue?Ce:re;return ir(Vn,this,li)}}(c,f,mt):f!=32&&f!=33||D.length?Xa.apply(void 0,Fe):function(re,pe,He,Ce){var Ue=1&pe,Ye=zr(re);return function li(){for(var ke=-1,Je=arguments.length,hn=-1,Vn=Ce.length,cn=Se(Vn+Je),on=this&&this!==tn&&this instanceof li?Ye:re;++hn<Vn;)cn[hn]=Ce[hn];for(;Je--;)cn[hn++]=arguments[++ke];return ir(on,Ue?He:this,cn)}}(c,f,x,R);else var Ve=function(re,pe,He){var Ce=1&pe,Ue=zr(re);return function Ye(){var li=this&&this!==tn&&this instanceof Ye?Ue:re;return li.apply(Ce?He:this,arguments)}}(c,f,x);return bf((Oe?df:xf)(Ve,Fe),c,f)}function $l(c,f,x,R){return c===void 0||Wr(c,Br[x])&&!Ei.call(R,x)?f:c}function wo(c,f,x,R,D,$){return nn(c)&&nn(f)&&($.set(f,c),hi(c,f,void 0,wo,$),$.delete(f)),c}function Ja(c){return tl(c)?void 0:c}function jn(c,f,x,R,D,$){var ut=1&x,mt=c.length,Mt=f.length;if(mt!=Mt&&!(ut&&Mt>mt))return!1;var Jt=$.get(c),Zt=$.get(f);if(Jt&&Zt)return Jt==f&&Zt==c;var de=-1,Oe=!0,Fe=2&x?new Ur:void 0;for($.set(c,f),$.set(f,c);++de<mt;){var Ve=c[de],re=f[de];if(R)var pe=ut?R(re,Ve,de,f,c,$):R(Ve,re,de,c,f,$);if(pe!==void 0){if(pe)continue;Oe=!1;break}if(Fe){if(!Ju(f,function(He,Ce){if(!Fa(Fe,Ce)&&(Ve===He||D(Ve,He,x,R,$)))return Fe.push(Ce)})){Oe=!1;break}}else if(Ve!==re&&!D(Ve,re,x,R,$)){Oe=!1;break}}return $.delete(c),$.delete(f),Oe}function So(c){return bd(_f(c,void 0,Td),c+"")}function rr(c){return fr(c,Rn,jr)}function la(c){return fr(c,Fn,ca)}var fn=Uo?function(c){return Uo.get(c)}:rl;function ua(c){for(var f=c.name+"",x=kr[f],R=Ei.call(kr,f)?x.length:0;R--;){var D=x[R],$=D.func;if($==null||$==c)return D.name}return f}function ro(c){return(Ei.call(S,"placeholder")?S:c).placeholder}function je(){var c=S.iteratee||Gh;return c=c===Gh?uf:c,arguments.length?c(arguments[0],arguments[1]):c}function Za(c,f){var x,R,D=c.__data__;return((R=typeof(x=f))=="string"||R=="number"||R=="symbol"||R=="boolean"?x!=="__proto__":x===null)?D[typeof f=="string"?"string":"hash"]:D.map}function _d(c){for(var f=Rn(c),x=f.length;x--;){var R=f[x],D=c[R];f[x]=[R,D,gf(D)]}return f}function ha(c,f){var x=function(R,D){return R==null?void 0:R[D]}(c,f);return za(x)?x:void 0}var jr=Qc?function(c){return c==null?[]:(c=ki(c),fo(Qc(c),function(f){return af.call(c,f)}))}:Vh,ca=Qc?function(c){for(var f=[];c;)Do(f,jr(c)),c=ah(c);return f}:Vh,An=Zn;function Ka(c,f,x){for(var R=-1,D=(f=no(f,c)).length,$=!1;++R<D;){var ut=Vr(f[R]);if(!($=c!=null&&x(c,ut)))break;c=c[ut]}return $||++R!=D?$:!!(D=c==null?0:c.length)&&Oh(D)&&Kn(ut,D)&&(ti(c)||bs(c))}function yd(c){return typeof c.constructor!="function"||Jl(c)?{}:ds(ah(c))}function jg(c){return ti(c)||bs(c)||!!(Js&&c&&c[Js])}function Kn(c,f){var x=typeof c;return!!(f=f==null?9007199254740991:f)&&(x=="number"||x!="symbol"&&bt.test(c))&&c>-1&&c%1==0&&c<f}function $e(c,f,x){if(!nn(x))return!1;var R=typeof f;return!!(R=="number"?mr(x)&&Kn(f,x.length):R=="string"&&f in x)&&Wr(x[f],c)}function Te(c,f){if(ti(c))return!1;var x=typeof c;return!(x!="number"&&x!="symbol"&&x!="boolean"&&c!=null&&!Lr(c))||Di.test(c)||!Bi.test(c)||f!=null&&c in ki(f)}function Pr(c){var f=ua(c),x=S[f];if(typeof x!="function"||!(f in oi.prototype))return!1;if(c===x)return!0;var R=fn(x);return!!R&&c===R[0]}(Ul&&An(new Ul(new ArrayBuffer(1)))!=Ct||Ba&&An(new Ba)!=L||ph&&An(ph.resolve())!="[object Promise]"||Ks&&An(new Ks)!=j||ce&&An(new ce)!=qt)&&(An=function(c){var f=Zn(c),x=f==Y?c.constructor:void 0,R=x?ys(x):"";if(R)switch(R){case zg:return Ct;case dn:return L;case ed:return"[object Promise]";case Li:return j;case Kr:return qt}return f});var Vg=Fl?oo:ol;function Jl(c){var f=c&&c.constructor;return c===(typeof f=="function"&&f.prototype||Br)}function gf(c){return c==c&&!nn(c)}function vf(c,f){return function(x){return x!=null&&x[c]===f&&(f!==void 0||c in ki(x))}}function _f(c,f,x){return f=Hi(f===void 0?c.length-1:f,0),function(){for(var R=arguments,D=-1,$=Hi(R.length-f,0),ut=Se($);++D<$;)ut[D]=R[f+D];D=-1;for(var mt=Se(f+1);++D<f;)mt[D]=R[D];return mt[f]=x(ut),ir(c,this,mt)}}function yf(c,f){return f.length<2?c:xo(c,ln(f,0,-1))}function Wg(c,f){for(var x=c.length,R=yn(f.length,x),D=Mn(c);R--;){var $=f[R];c[R]=Kn($,x)?D[$]:void 0}return c}function xd(c,f){if((f!=="constructor"||typeof c[f]!="function")&&f!="__proto__")return c[f]}var xf=wf(df),Zl=Hg||function(c,f){return tn.setTimeout(c,f)},bd=wf(Dn);function bf(c,f,x){var R=f+"";return bd(c,function(D,$){var ut=$.length;if(!ut)return D;var mt=ut-1;return $[mt]=(ut>1?"& ":"")+$[mt],$=$.join(ut>2?", ":" "),D.replace(Qi,`{
|
|
9
9
|
/* [wrapped with `+$+`] */
|
|
10
|
-
`)}(R,function(D,$){return hr(V,function(ut){var mt="_."+ut[0];$&ut[1]&&!Da(D,mt)&&D.push(mt)}),D.sort()}(function(D){var $=D.match(Yn);return $?$[1].split($n):[]}(R),x)))}function wf(c){var f=0,x=0;return function(){var R=Ar(),D=16-(R-x);if(x=R,D>0){if(++f>=800)return arguments[0]}else f=0;return c.apply(void 0,arguments)}}function Ah(c,f){var x=-1,R=c.length,D=R-1;for(f=f===void 0?R:f;++x<f;){var $=gs(x,D),ut=c[$];c[$]=c[x],c[x]=ut}return c.length=f,c}var Rh=function(c){var f=Kl(c,function(R){return x.size===500&&x.clear(),R}),x=f.cache;return f}(function(c){var f=[];return c.charCodeAt(0)===46&&f.push(""),c.replace(Ci,function(x,R,D,$){f.push(D?$.replace(zu,"$1"):R||x)}),f});function Vr(c){if(typeof c=="string"||Lr(c))return c;var f=c+"";return f=="0"&&1/c==-1/0?"-0":f}function ys(c){if(c!=null){try{return nh.call(c)}catch{}try{return c+""}catch{}}return""}function Sf(c){if(c instanceof oi)return c.clone();var f=new Yi(c.__wrapped__,c.__chain__);return f.__actions__=Mn(c.__actions__),f.__index__=c.__index__,f.__values__=c.__values__,f}var Xg=ci(function(c,f){return Vi(c)?fs(c,Ee(f,1,Vi,!0)):[]}),Tf=ci(function(c,f){var x=Ir(f);return Vi(x)&&(x=void 0),Vi(c)?fs(c,Ee(f,1,Vi,!0),je(x,2)):[]}),Ef=ci(function(c,f){var x=Ir(f);return Vi(x)&&(x=void 0),Vi(c)?fs(c,Ee(f,1,Vi,!0),void 0,x):[]});function wd(c,f,x){var R=c==null?0:c.length;if(!R)return-1;var D=x==null?0:di(x);return D<0&&(D=Hi(R+D,0)),Il(c,je(f,3),D)}function Sd(c,f,x){var R=c==null?0:c.length;if(!R)return-1;var D=R-1;return x!==void 0&&(D=di(x),D=x<0?Hi(R+D,0):yn(D,R-1)),Il(c,je(f,3),D,!0)}function Td(c){return c!=null&&c.length?Ee(c,1):[]}function Ed(c){return c&&c.length?c[0]:void 0}var Qa=ci(function(c){var f=Gi(c,Wa);return f.length&&f[0]===c[0]?od(f):[]}),or=ci(function(c){var f=Ir(c),x=Gi(c,Wa);return f===Ir(x)?f=void 0:x.pop(),x.length&&x[0]===c[0]?od(x,je(f,2)):[]}),Qn=ci(function(c){var f=Ir(c),x=Gi(c,Wa);return(f=typeof f=="function"?f:void 0)&&x.pop(),x.length&&x[0]===c[0]?od(x,void 0,f):[]});function Ir(c){var f=c==null?0:c.length;return f?c[f-1]:void 0}var qg=ci(Mf);function Mf(c,f){return c&&c.length&&f&&f.length?io(c,f):c}var Yg=So(function(c,f){var x=c==null?0:c.length,R=jl(c,f);return na(c,Gi(f,function(D){return Kn(D,x)?+D:D}).sort(mf)),R});function Md(c){return c==null?c:kl.call(c)}var $g=ci(function(c){return Si(Ee(c,1,Vi,!0))}),Jg=ci(function(c){var f=Ir(c);return Vi(f)&&(f=void 0),Si(Ee(c,1,Vi,!0),je(f,2))}),Zg=ci(function(c){var f=Ir(c);return f=typeof f=="function"?f:void 0,Si(Ee(c,1,Vi,!0),void 0,f)});function Ad(c){if(!c||!c.length)return[];var f=0;return c=fo(c,function(x){if(Vi(x))return f=Hi(x.length,f),!0}),th(f,function(x){return Gi(c,Zu(x))})}function Af(c,f){if(!c||!c.length)return[];var x=Ad(c);return f==null?x:Gi(x,function(R){return ir(f,void 0,R)})}var Kg=ci(function(c,f){return Vi(c)?fs(c,f):[]}),Qg=ci(function(c){return Sh(fo(c,Vi))}),tv=ci(function(c){var f=Ir(c);return Vi(f)&&(f=void 0),Sh(fo(c,Vi),je(f,2))}),ev=ci(function(c){var f=Ir(c);return f=typeof f=="function"?f:void 0,Sh(fo(c,Vi),void 0,f)}),iv=ci(Ad),nv=ci(function(c){var f=c.length,x=f>1?c[f-1]:void 0;return x=typeof x=="function"?(c.pop(),x):void 0,Af(c,x)});function Rf(c){var f=S(c);return f.__chain__=!0,f}function Ch(c,f){return f(c)}var rv=So(function(c){var f=c.length,x=f?c[0]:0,R=this.__wrapped__,D=function($){return jl($,c)};return!(f>1||this.__actions__.length)&&R instanceof oi&&Kn(x)?((R=R.slice(x,+x+(f?1:0))).__actions__.push({func:Ch,args:[D],thisArg:void 0}),new Yi(R,this.__chain__).thru(function($){return f&&!$.length&&$.push(void 0),$})):this.thru(D)}),ov=vs(function(c,f,x){Ei.call(c,x)?++c[x]:vo(c,x,1)}),sv=Vo(wd),av=Vo(Sd);function Cf(c,f){return(ti(c)?hr:nr)(c,je(f,3))}function Pf(c,f){return(ti(c)?Hc:mh)(c,je(f,3))}var lv=vs(function(c,f,x){Ei.call(c,x)?c[x].push(f):vo(c,x,[f])}),uv=ci(function(c,f,x){var R=-1,D=typeof f=="function",$=mr(c)?Se(c.length):[];return nr(c,function(ut){$[++R]=D?ir(f,ut,x):Ga(ut,f,x)}),$}),hv=vs(function(c,f,x){vo(c,x,f)});function Ph(c,f){return(ti(c)?Gi:ad)(c,je(f,3))}var cv=vs(function(c,f,x){c[x?0:1].push(f)},function(){return[[],[]]}),dv=ci(function(c,f){if(c==null)return[];var x=f.length;return x>1&&$e(c,f[0],f[1])?f=[]:x>2&&$e(f[0],f[1],f[2])&&(f=[f[0]]),bo(c,Ee(f,1),[])}),Ih=Gg||function(){return tn.Date.now()};function If(c,f,x){return f=x?void 0:f,Ti(c,128,void 0,void 0,void 0,void 0,f=c&&f==null?c.length:f)}function Lf(c,f){var x;if(typeof f!="function")throw new dr(W);return c=di(c),function(){return--c>0&&(x=f.apply(this,arguments)),c<=1&&(f=void 0),x}}var Rd=ci(function(c,f,x){var R=1;if(x.length){var D=Fo(x,ro(Rd));R|=32}return Ti(c,R,f,x,D)}),Of=ci(function(c,f,x){var R=3;if(x.length){var D=Fo(x,ro(Of));R|=32}return Ti(f,R,c,x,D)});function Nf(c,f,x){var R,D,$,ut,mt,Mt,Jt=0,Zt=!1,de=!1,Oe=!0;if(typeof c!="function")throw new dr(W);function Fe(Ue){var Ye=R,li=D;return R=D=void 0,Jt=Ue,ut=c.apply(li,Ye)}function Ve(Ue){return Jt=Ue,mt=Zl(pe,f),Zt?Fe(Ue):ut}function re(Ue){var Ye=Ue-Mt;return Mt===void 0||Ye>=f||Ye<0||de&&Ue-Jt>=$}function pe(){var Ue=Ih();if(re(Ue))return He(Ue);mt=Zl(pe,function(Ye){var li=f-(Ye-Mt);return de?yn(li,$-(Ye-Jt)):li}(Ue))}function He(Ue){return mt=void 0,Oe&&R?Fe(Ue):(R=D=void 0,ut)}function Ce(){var Ue=Ih(),Ye=re(Ue);if(R=arguments,D=this,Mt=Ue,Ye){if(mt===void 0)return Ve(Mt);if(de)return pd(mt),mt=Zl(pe,f),Fe(Mt)}return mt===void 0&&(mt=Zl(pe,f)),ut}return f=Or(f)||0,nn(x)&&(Zt=!!x.leading,$=(de="maxWait"in x)?Hi(Or(x.maxWait)||0,f):$,Oe="trailing"in x?!!x.trailing:Oe),Ce.cancel=function(){mt!==void 0&&pd(mt),Jt=0,R=Mt=D=mt=void 0},Ce.flush=function(){return mt===void 0?ut:He(Ih())},Ce}var pv=ci(function(c,f){return fh(c,1,f)}),fv=ci(function(c,f,x){return fh(c,Or(f)||0,x)});function Kl(c,f){if(typeof c!="function"||f!=null&&typeof f!="function")throw new dr(W);var x=function(){var R=arguments,D=f?f.apply(this,R):R[0],$=x.cache;if($.has(D))return $.get(D);var ut=c.apply(this,R);return x.cache=$.set(D,ut)||$,ut};return x.cache=new(Kl.Cache||pr),x}function Ql(c){if(typeof c!="function")throw new dr(W);return function(){var f=arguments;switch(f.length){case 0:return!c.call(this);case 1:return!c.call(this,f[0]);case 2:return!c.call(this,f[0],f[1]);case 3:return!c.call(this,f[0],f[1],f[2])}return!c.apply(this,f)}}Kl.Cache=pr;var Cd=ff(function(c,f){var x=(f=f.length==1&&ti(f[0])?Gi(f[0],cr(je())):Gi(Ee(f,1),cr(je()))).length;return ci(function(R){for(var D=-1,$=yn(R.length,x);++D<$;)R[D]=f[D].call(this,R[D]);return ir(c,this,R)})}),Lh=ci(function(c,f){return Ti(c,32,void 0,f,Fo(f,ro(Lh)))}),Df=ci(function(c,f){return Ti(c,64,void 0,f,Fo(f,ro(Df)))}),xs=So(function(c,f){return Ti(c,256,void 0,void 0,void 0,f)});function Wr(c,f){return c===f||c!=c&&f!=f}var mv=aa(vh),Ff=aa(function(c,f){return c>=f}),bs=ia(function(){return arguments}())?ia:function(c){return rn(c)&&Ei.call(c,"callee")&&!af.call(c,"callee")},ti=Se.isArray,gv=kc?cr(kc):function(c){return rn(c)&&Zn(c)==ge};function mr(c){return c!=null&&Oh(c.length)&&!oo(c)}function Vi(c){return rn(c)&&mr(c)}var Xo=td||ol,Bf=Uc?cr(Uc):function(c){return rn(c)&&Zn(c)==vt};function Pd(c){if(!rn(c))return!1;var f=Zn(c);return f==Ot||f=="[object DOMException]"||typeof c.message=="string"&&typeof c.name=="string"&&!tl(c)}function oo(c){if(!nn(c))return!1;var f=Zn(c);return f==Nt||f==E||f=="[object AsyncFunction]"||f=="[object Proxy]"}function kf(c){return typeof c=="number"&&c==di(c)}function Oh(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=9007199254740991}function nn(c){var f=typeof c;return c!=null&&(f=="object"||f=="function")}function rn(c){return c!=null&&typeof c=="object"}var Uf=Vu?cr(Vu):function(c){return rn(c)&&An(c)==L};function Id(c){return typeof c=="number"||rn(c)&&Zn(c)==O}function tl(c){if(!rn(c)||Zn(c)!=Y)return!1;var f=ah(c);if(f===null)return!0;var x=Ei.call(f,"constructor")&&f.constructor;return typeof x=="function"&&x instanceof x&&nh.call(x)==Fg}var Ld=Wu?cr(Wu):function(c){return rn(c)&&Zn(c)==P},Gf=Xu?cr(Xu):function(c){return rn(c)&&An(c)==j};function Nh(c){return typeof c=="string"||!ti(c)&&rn(c)&&Zn(c)==X}function Lr(c){return typeof c=="symbol"||rn(c)&&Zn(c)==K}var da=qu?cr(qu):function(c){return rn(c)&&Oh(c.length)&&!!Pi[Zn(c)]},Hf=aa(_h),vv=aa(function(c,f){return c<=f});function zf(c){if(!c)return[];if(mr(c))return Nh(c)?Gn(c):Mn(c);if(mo&&c[mo])return function(x){for(var R,D=[];!(R=x.next()).done;)D.push(R.value);return D}(c[mo]());var f=An(c);return(f==L?ih:f==j?us:To)(c)}function qo(c){return c?(c=Or(c))===1/0||c===-1/0?17976931348623157e292*(c<0?-1:1):c==c?c:0:c===0?c:0}function di(c){var f=qo(c),x=f%1;return f==f?x?f-x:f:0}function jf(c){return c?zo(di(c),0,4294967295):0}function Or(c){if(typeof c=="number")return c;if(Lr(c))return NaN;if(nn(c)){var f=typeof c.valueOf=="function"?c.valueOf():c;c=nn(f)?f+"":f}if(typeof c!="string")return c===0?c:+c;c=qc(c);var x=st.test(c);return x||Tt.test(c)?Yp(c.slice(2),x?2:8):J.test(c)?NaN:+c}function Vf(c){return un(c,Fn(c))}function xi(c){return c==null?"":pn(c)}var Dh=en(function(c,f){if(Jl(f)||mr(f))un(f,Rn(f),c);else for(var x in f)Ei.call(f,x)&&ps(c,x,f[x])}),Od=en(function(c,f){un(f,Fn(f),c)}),Fh=en(function(c,f,x,R){un(f,Fn(f),c,R)}),_v=en(function(c,f,x,R){un(f,Rn(f),c,R)}),Wf=So(jl),Nd=ci(function(c,f){c=ki(c);var x=-1,R=f.length,D=R>2?f[2]:void 0;for(D&&$e(f[0],f[1],D)&&(R=1);++x<R;)for(var $=f[x],ut=Fn($),mt=-1,Mt=ut.length;++mt<Mt;){var Jt=ut[mt],Zt=c[Jt];(Zt===void 0||Wr(Zt,Br[Jt])&&!Ei.call(c,Jt))&&(c[Jt]=$[Jt])}return c}),pa=ci(function(c){return c.push(void 0,wo),ir(el,void 0,c)});function Dd(c,f,x){var R=c==null?void 0:xo(c,f);return R===void 0?x:R}function tu(c,f){return c!=null&&Ka(c,f,rd)}var yv=Mh(function(c,f,x){f!=null&&typeof f.toString!="function"&&(f=rh.call(f)),c[f]=x},nl(sr)),xv=Mh(function(c,f,x){f!=null&&typeof f.toString!="function"&&(f=rh.call(f)),Ei.call(c,f)?c[f].push(x):c[f]=[x]},je),Oi=ci(Ga);function Rn(c){return mr(c)?Go(c):sd(c)}function Fn(c){return mr(c)?Go(c,!0):hf(c)}var eu=en(function(c,f,x){hi(c,f,x)}),el=en(function(c,f,x,R){hi(c,f,x,R)}),fa=So(function(c,f){var x={};if(c==null)return x;var R=!1;f=Gi(f,function($){return $=no($,c),R||(R=$.length>1),$}),un(c,la(c),x),R&&(x=En(x,7,Ja));for(var D=f.length;D--;)Va(x,f[D]);return x}),mn=So(function(c,f){return c==null?{}:function(x,R){return yh(x,R,function(D,$){return tu(x,$)})}(c,f)});function Yo(c,f){if(c==null)return{};var x=Gi(la(c),function(R){return[R]});return f=je(f),yh(c,x,function(R,D){return f(R,D[0])})}var iu=Yl(Rn),ma=Yl(Fn);function To(c){return c==null?[]:eh(c,Rn(c))}var il=_s(function(c,f,x){return f=f.toLowerCase(),c+(x?ga(f):f)});function ga(c){return ou(xi(c).toLowerCase())}function va(c){return(c=xi(c))&&c.replace(wt,tf).replace(Vp,"")}var nu=_s(function(c,f,x){return c+(x?"-":"")+f.toLowerCase()}),Xf=_s(function(c,f,x){return c+(x?" ":"")+f.toLowerCase()}),Bh=oa("toLowerCase"),ru=_s(function(c,f,x){return c+(x?"_":"")+f.toLowerCase()}),kh=_s(function(c,f,x){return c+(x?" ":"")+ou(f)}),qf=_s(function(c,f,x){return c+(x?" ":"")+f.toUpperCase()}),ou=oa("toUpperCase");function Fd(c,f,x){return c=xi(c),(f=x?void 0:f)===void 0?function(R){return Wp.test(R)}(c)?function(R){return R.match(Oo)||[]}(c):function(R){return R.match(La)||[]}(c):c.match(f)||[]}var su=ci(function(c,f){try{return ir(c,void 0,f)}catch(x){return Pd(x)?x:new gi(x)}}),Uh=So(function(c,f){return hr(f,function(x){x=Vr(x),vo(c,x,Rd(c[x],c))}),c});function nl(c){return function(){return c}}var Yf=Wo(),$f=Wo(!0);function sr(c){return c}function Gh(c){return uf(typeof c=="function"?c:En(c,1))}var Jf=ci(function(c,f){return function(x){return Ga(x,c,f)}}),bv=ci(function(c,f){return function(x){return Ga(c,x,f)}});function Hh(c,f,x){var R=Rn(f),D=eo(f,R);x!=null||nn(f)&&(D.length||!R.length)||(x=f,f=c,c=this,D=eo(f,Rn(f)));var $=!(nn(x)&&"chain"in x&&!x.chain),ut=oo(c);return hr(D,function(mt){var Mt=f[mt];c[mt]=Mt,ut&&(c.prototype[mt]=function(){var Jt=this.__chain__;if($||Jt){var Zt=c(this.__wrapped__),de=Zt.__actions__=Mn(this.__actions__);return de.push({func:Mt,args:arguments,thisArg:c}),Zt.__chain__=Jt,Zt}return Mt.apply(c,Do([this.value()],arguments))})}),c}function rl(){}var zh=Ya(Gi),ws=Ya(zc),Zf=Ya(Ju);function Kf(c){return Te(c)?Zu(Vr(c)):function(f){return function(x){return xo(x,f)}}(c)}var jh=Xl(),Qf=Xl(!0);function Vh(){return[]}function ol(){return!1}var au=qa(function(c,f){return c+f},0),Bd=$a("ceil"),Bn=qa(function(c,f){return c/f},1),tm=$a("floor"),Wh,em=qa(function(c,f){return c*f},1),kd=$a("round"),Xh=qa(function(c,f){return c-f},0);return S.after=function(c,f){if(typeof f!="function")throw new dr(W);return c=di(c),function(){if(--c<1)return f.apply(this,arguments)}},S.ary=If,S.assign=Dh,S.assignIn=Od,S.assignInWith=Fh,S.assignWith=_v,S.at=Wf,S.before=Lf,S.bind=Rd,S.bindAll=Uh,S.bindKey=Of,S.castArray=function(){if(!arguments.length)return[];var c=arguments[0];return ti(c)?c:[c]},S.chain=Rf,S.chunk=function(c,f,x){f=(x?$e(c,f,x):f===void 0)?1:Hi(di(f),0);var R=c==null?0:c.length;if(!R||f<1)return[];for(var D=0,$=0,ut=Se(uh(R/f));D<R;)ut[$++]=ln(c,D,D+=f);return ut},S.compact=function(c){for(var f=-1,x=c==null?0:c.length,R=0,D=[];++f<x;){var $=c[f];$&&(D[R++]=$)}return D},S.concat=function(){var c=arguments.length;if(!c)return[];for(var f=Se(c-1),x=arguments[0],R=c;R--;)f[R-1]=arguments[R];return Do(ti(x)?Mn(x):[x],Ee(f,1))},S.cond=function(c){var f=c==null?0:c.length,x=je();return c=f?Gi(c,function(R){if(typeof R[1]!="function")throw new dr(W);return[x(R[0]),R[1]]}):[],ci(function(R){for(var D=-1;++D<f;){var $=c[D];if(ir($[0],this,R))return ir($[1],this,R)}})},S.conforms=function(c){return function(f){var x=Rn(f);return function(R){return _o(R,f,x)}}(En(c,1))},S.constant=nl,S.countBy=ov,S.create=function(c,f){var x=ds(c);return f==null?x:lf(x,f)},S.curry=function c(f,x,R){var D=Ti(f,8,void 0,void 0,void 0,void 0,void 0,x=R?void 0:x);return D.placeholder=c.placeholder,D},S.curryRight=function c(f,x,R){var D=Ti(f,16,void 0,void 0,void 0,void 0,void 0,x=R?void 0:x);return D.placeholder=c.placeholder,D},S.debounce=Nf,S.defaults=Nd,S.defaultsDeep=pa,S.defer=pv,S.delay=fv,S.difference=Xg,S.differenceBy=Tf,S.differenceWith=Ef,S.drop=function(c,f,x){var R=c==null?0:c.length;return R?ln(c,(f=x||f===void 0?1:di(f))<0?0:f,R):[]},S.dropRight=function(c,f,x){var R=c==null?0:c.length;return R?ln(c,0,(f=R-(f=x||f===void 0?1:di(f)))<0?0:f):[]},S.dropRightWhile=function(c,f){return c&&c.length?Wl(c,je(f,3),!0,!0):[]},S.dropWhile=function(c,f){return c&&c.length?Wl(c,je(f,3),!0):[]},S.fill=function(c,f,x,R){var D=c==null?0:c.length;return D?(x&&typeof x!="number"&&$e(c,f,x)&&(x=0,R=D),function($,ut,mt,Mt){var Jt=$.length;for((mt=di(mt))<0&&(mt=-mt>Jt?0:Jt+mt),(Mt=Mt===void 0||Mt>Jt?Jt:di(Mt))<0&&(Mt+=Jt),Mt=mt>Mt?0:jf(Mt);mt<Mt;)$[mt++]=ut;return $}(c,f,x,R)):[]},S.filter=function(c,f){return(ti(c)?fo:jo)(c,je(f,3))},S.flatMap=function(c,f){return Ee(Ph(c,f),1)},S.flatMapDeep=function(c,f){return Ee(Ph(c,f),1/0)},S.flatMapDepth=function(c,f,x){return x=x===void 0?1:di(x),Ee(Ph(c,f),x)},S.flatten=Td,S.flattenDeep=function(c){return c!=null&&c.length?Ee(c,1/0):[]},S.flattenDepth=function(c,f){return c!=null&&c.length?Ee(c,f=f===void 0?1:di(f)):[]},S.flip=function(c){return Ti(c,512)},S.flow=Yf,S.flowRight=$f,S.fromPairs=function(c){for(var f=-1,x=c==null?0:c.length,R={};++f<x;){var D=c[f];R[D[0]]=D[1]}return R},S.functions=function(c){return c==null?[]:eo(c,Rn(c))},S.functionsIn=function(c){return c==null?[]:eo(c,Fn(c))},S.groupBy=lv,S.initial=function(c){return c!=null&&c.length?ln(c,0,-1):[]},S.intersection=Qa,S.intersectionBy=or,S.intersectionWith=Qn,S.invert=yv,S.invertBy=xv,S.invokeMap=uv,S.iteratee=Gh,S.keyBy=hv,S.keys=Rn,S.keysIn=Fn,S.map=Ph,S.mapKeys=function(c,f){var x={};return f=je(f,3),yo(c,function(R,D,$){vo(x,f(R,D,$),R)}),x},S.mapValues=function(c,f){var x={};return f=je(f,3),yo(c,function(R,D,$){vo(x,D,f(R,D,$))}),x},S.matches=function(c){return cf(En(c,1))},S.matchesProperty=function(c,f){return ld(c,En(f,1))},S.memoize=Kl,S.merge=eu,S.mergeWith=el,S.method=Jf,S.methodOf=bv,S.mixin=Hh,S.negate=Ql,S.nthArg=function(c){return c=di(c),ci(function(f){return Hr(f,c)})},S.omit=fa,S.omitBy=function(c,f){return Yo(c,Ql(je(f)))},S.once=function(c){return Lf(2,c)},S.orderBy=function(c,f,x,R){return c==null?[]:(ti(f)||(f=f==null?[]:[f]),ti(x=R?void 0:x)||(x=x==null?[]:[x]),bo(c,f,x))},S.over=zh,S.overArgs=Cd,S.overEvery=ws,S.overSome=Zf,S.partial=Lh,S.partialRight=Df,S.partition=cv,S.pick=mn,S.pickBy=Yo,S.property=Kf,S.propertyOf=function(c){return function(f){return c==null?void 0:xo(c,f)}},S.pull=qg,S.pullAll=Mf,S.pullAllBy=function(c,f,x){return c&&c.length&&f&&f.length?io(c,f,je(x,2)):c},S.pullAllWith=function(c,f,x){return c&&c.length&&f&&f.length?io(c,f,void 0,x):c},S.pullAt=Yg,S.range=jh,S.rangeRight=Qf,S.rearg=xs,S.reject=function(c,f){return(ti(c)?fo:jo)(c,Ql(je(f,3)))},S.remove=function(c,f){var x=[];if(!c||!c.length)return x;var R=-1,D=[],$=c.length;for(f=je(f,3);++R<$;){var ut=c[R];f(ut,R,c)&&(x.push(ut),D.push(R))}return na(c,D),x},S.rest=function(c,f){if(typeof c!="function")throw new dr(W);return ci(c,f=f===void 0?f:di(f))},S.reverse=Md,S.sampleSize=function(c,f,x){return f=(x?$e(c,f,x):f===void 0)?1:di(f),(ti(c)?ta:hd)(c,f)},S.set=function(c,f,x){return c==null?c:ji(c,f,x)},S.setWith=function(c,f,x,R){return R=typeof R=="function"?R:void 0,c==null?c:ji(c,f,x,R)},S.shuffle=function(c){return(ti(c)?zl:pf)(c)},S.slice=function(c,f,x){var R=c==null?0:c.length;return R?(x&&typeof x!="number"&&$e(c,f,x)?(f=0,x=R):(f=f==null?0:di(f),x=x===void 0?R:di(x)),ln(c,f,x)):[]},S.sortBy=dv,S.sortedUniq=function(c){return c&&c.length?wh(c):[]},S.sortedUniqBy=function(c,f){return c&&c.length?wh(c,je(f,2)):[]},S.split=function(c,f,x){return x&&typeof x!="number"&&$e(c,f,x)&&(f=x=void 0),(x=x===void 0?4294967295:x>>>0)?(c=xi(c))&&(typeof f=="string"||f!=null&&!Ld(f))&&!(f=pn(f))&&Ys(c)?_e(Gn(c),0,x):c.split(f,x):[]},S.spread=function(c,f){if(typeof c!="function")throw new dr(W);return f=f==null?0:Hi(di(f),0),ci(function(x){var R=x[f],D=_e(x,0,f);return R&&Do(D,R),ir(c,this,D)})},S.tail=function(c){var f=c==null?0:c.length;return f?ln(c,1,f):[]},S.take=function(c,f,x){return c&&c.length?ln(c,0,(f=x||f===void 0?1:di(f))<0?0:f):[]},S.takeRight=function(c,f,x){var R=c==null?0:c.length;return R?ln(c,(f=R-(f=x||f===void 0?1:di(f)))<0?0:f,R):[]},S.takeRightWhile=function(c,f){return c&&c.length?Wl(c,je(f,3),!1,!0):[]},S.takeWhile=function(c,f){return c&&c.length?Wl(c,je(f,3)):[]},S.tap=function(c,f){return f(c),c},S.throttle=function(c,f,x){var R=!0,D=!0;if(typeof c!="function")throw new dr(W);return nn(x)&&(R="leading"in x?!!x.leading:R,D="trailing"in x?!!x.trailing:D),Nf(c,f,{leading:R,maxWait:f,trailing:D})},S.thru=Ch,S.toArray=zf,S.toPairs=iu,S.toPairsIn=ma,S.toPath=function(c){return ti(c)?Gi(c,Vr):Lr(c)?[c]:Mn(Rh(xi(c)))},S.toPlainObject=Vf,S.transform=function(c,f,x){var R=ti(c),D=R||Xo(c)||da(c);if(f=je(f,4),x==null){var $=c&&c.constructor;x=D?R?new $:[]:nn(c)&&oo($)?ds(ah(c)):{}}return(D?hr:yo)(c,function(ut,mt,Mt){return f(x,ut,mt,Mt)}),x},S.unary=function(c){return If(c,1)},S.union=$g,S.unionBy=Jg,S.unionWith=Zg,S.uniq=function(c){return c&&c.length?Si(c):[]},S.uniqBy=function(c,f){return c&&c.length?Si(c,je(f,2)):[]},S.uniqWith=function(c,f){return f=typeof f=="function"?f:void 0,c&&c.length?Si(c,void 0,f):[]},S.unset=function(c,f){return c==null||Va(c,f)},S.unzip=Ad,S.unzipWith=Af,S.update=function(c,f,x){return c==null?c:mi(c,f,Th(x))},S.updateWith=function(c,f,x,R){return R=typeof R=="function"?R:void 0,c==null?c:mi(c,f,Th(x),R)},S.values=To,S.valuesIn=function(c){return c==null?[]:eh(c,Fn(c))},S.without=Kg,S.words=Fd,S.wrap=function(c,f){return Lh(Th(f),c)},S.xor=Qg,S.xorBy=tv,S.xorWith=ev,S.zip=iv,S.zipObject=function(c,f){return dd(c||[],f||[],ps)},S.zipObjectDeep=function(c,f){return dd(c||[],f||[],ji)},S.zipWith=nv,S.entries=iu,S.entriesIn=ma,S.extend=Od,S.extendWith=Fh,Hh(S,S),S.add=au,S.attempt=su,S.camelCase=il,S.capitalize=ga,S.ceil=Bd,S.clamp=function(c,f,x){return x===void 0&&(x=f,f=void 0),x!==void 0&&(x=(x=Or(x))==x?x:0),f!==void 0&&(f=(f=Or(f))==f?f:0),zo(Or(c),f,x)},S.clone=function(c){return En(c,4)},S.cloneDeep=function(c){return En(c,5)},S.cloneDeepWith=function(c,f){return En(c,5,f=typeof f=="function"?f:void 0)},S.cloneWith=function(c,f){return En(c,4,f=typeof f=="function"?f:void 0)},S.conformsTo=function(c,f){return f==null||_o(c,f,Rn(f))},S.deburr=va,S.defaultTo=function(c,f){return c==null||c!=c?f:c},S.divide=Bn,S.endsWith=function(c,f,x){c=xi(c),f=pn(f);var R=c.length,D=x=x===void 0?R:zo(di(x),0,R);return(x-=f.length)>=0&&c.slice(x,D)==f},S.eq=Wr,S.escape=function(c){return(c=xi(c))&&ei.test(c)?c.replace(ui,ef):c},S.escapeRegExp=function(c){return(c=xi(c))&&Ii.test(c)?c.replace(Ki,"\\$&"):c},S.every=function(c,f,x){var R=ti(c)?zc:gh;return x&&$e(c,f,x)&&(f=void 0),R(c,je(f,3))},S.find=sv,S.findIndex=wd,S.findKey=function(c,f){return jc(c,je(f,3),yo)},S.findLast=av,S.findLastIndex=Sd,S.findLastKey=function(c,f){return jc(c,je(f,3),nd)},S.floor=tm,S.forEach=Cf,S.forEachRight=Pf,S.forIn=function(c,f){return c==null?c:ms(c,je(f,3),Fn)},S.forInRight=function(c,f){return c==null?c:Gr(c,je(f,3),Fn)},S.forOwn=function(c,f){return c&&yo(c,je(f,3))},S.forOwnRight=function(c,f){return c&&nd(c,je(f,3))},S.get=Dd,S.gt=mv,S.gte=Ff,S.has=function(c,f){return c!=null&&Ka(c,f,ea)},S.hasIn=tu,S.head=Ed,S.identity=sr,S.includes=function(c,f,x,R){c=mr(c)?c:To(c),x=x&&!R?di(x):0;var D=c.length;return x<0&&(x=Hi(D+x,0)),Nh(c)?x<=D&&c.indexOf(f,x)>-1:!!D&&qs(c,f,x)>-1},S.indexOf=function(c,f,x){var R=c==null?0:c.length;if(!R)return-1;var D=x==null?0:di(x);return D<0&&(D=Hi(R+D,0)),qs(c,f,D)},S.inRange=function(c,f,x){return f=qo(f),x===void 0?(x=f,f=0):x=qo(x),function(R,D,$){return R>=yn(D,$)&&R<Hi(D,$)}(c=Or(c),f,x)},S.invoke=Oi,S.isArguments=bs,S.isArray=ti,S.isArrayBuffer=gv,S.isArrayLike=mr,S.isArrayLikeObject=Vi,S.isBoolean=function(c){return c===!0||c===!1||rn(c)&&Zn(c)==Z},S.isBuffer=Xo,S.isDate=Bf,S.isElement=function(c){return rn(c)&&c.nodeType===1&&!tl(c)},S.isEmpty=function(c){if(c==null)return!0;if(mr(c)&&(ti(c)||typeof c=="string"||typeof c.splice=="function"||Xo(c)||da(c)||bs(c)))return!c.length;var f=An(c);if(f==L||f==j)return!c.size;if(Jl(c))return!sd(c).length;for(var x in c)if(Ei.call(c,x))return!1;return!0},S.isEqual=function(c,f){return Rr(c,f)},S.isEqualWith=function(c,f,x){var R=(x=typeof x=="function"?x:void 0)?x(c,f):void 0;return R===void 0?Rr(c,f,void 0,x):!!R},S.isError=Pd,S.isFinite=function(c){return typeof c=="number"&&ko(c)},S.isFunction=oo,S.isInteger=kf,S.isLength=Oh,S.isMap=Uf,S.isMatch=function(c,f){return c===f||Ha(c,f,_d(f))},S.isMatchWith=function(c,f,x){return x=typeof x=="function"?x:void 0,Ha(c,f,_d(f),x)},S.isNaN=function(c){return Id(c)&&c!=+c},S.isNative=function(c){if(Vg(c))throw new gi("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return za(c)},S.isNil=function(c){return c==null},S.isNull=function(c){return c===null},S.isNumber=Id,S.isObject=nn,S.isObjectLike=rn,S.isPlainObject=tl,S.isRegExp=Ld,S.isSafeInteger=function(c){return kf(c)&&c>=-9007199254740991&&c<=9007199254740991},S.isSet=Gf,S.isString=Nh,S.isSymbol=Lr,S.isTypedArray=da,S.isUndefined=function(c){return c===void 0},S.isWeakMap=function(c){return rn(c)&&An(c)==qt},S.isWeakSet=function(c){return rn(c)&&Zn(c)=="[object WeakSet]"},S.join=function(c,f){return c==null?"":Hn.call(c,f)},S.kebabCase=nu,S.last=Ir,S.lastIndexOf=function(c,f,x){var R=c==null?0:c.length;if(!R)return-1;var D=R;return x!==void 0&&(D=(D=di(x))<0?Hi(R+D,0):yn(D,R-1)),f==f?function($,ut,mt){for(var Mt=mt+1;Mt--;)if($[Mt]===ut)return Mt;return Mt}(c,f,D):Il(c,Vc,D,!0)},S.lowerCase=Xf,S.lowerFirst=Bh,S.lt=Hf,S.lte=vv,S.max=function(c){return c&&c.length?Ua(c,sr,vh):void 0},S.maxBy=function(c,f){return c&&c.length?Ua(c,je(f,2),vh):void 0},S.mean=function(c){return Wc(c,sr)},S.meanBy=function(c,f){return Wc(c,je(f,2))},S.min=function(c){return c&&c.length?Ua(c,sr,_h):void 0},S.minBy=function(c,f){return c&&c.length?Ua(c,je(f,2),_h):void 0},S.stubArray=Vh,S.stubFalse=ol,S.stubObject=function(){return{}},S.stubString=function(){return""},S.stubTrue=function(){return!0},S.multiply=em,S.nth=function(c,f){return c&&c.length?Hr(c,di(f)):void 0},S.noConflict=function(){return tn._===this&&(tn._=Bg),this},S.noop=rl,S.now=Ih,S.pad=function(c,f,x){c=xi(c);var R=(f=di(f))?Bo(c):0;if(!f||R>=f)return c;var D=(f-R)/2;return sa(hh(D),x)+c+sa(uh(D),x)},S.padEnd=function(c,f,x){c=xi(c);var R=(f=di(f))?Bo(c):0;return f&&R<f?c+sa(f-R,x):c},S.padStart=function(c,f,x){c=xi(c);var R=(f=di(f))?Bo(c):0;return f&&R<f?sa(f-R,x)+c:c},S.parseInt=function(c,f,x){return x||f==null?f=0:f&&(f=+f),zn(xi(c).replace(Ui,""),f||0)},S.random=function(c,f,x){if(x&&typeof x!="boolean"&&$e(c,f,x)&&(f=x=void 0),x===void 0&&(typeof f=="boolean"?(x=f,f=void 0):typeof c=="boolean"&&(x=c,c=void 0)),c===void 0&&f===void 0?(c=0,f=1):(c=qo(c),f===void 0?(f=c,c=0):f=qo(f)),c>f){var R=c;c=f,f=R}if(x||c%1||f%1){var D=dh();return yn(c+D*(f-c+Tr("1e-"+((D+"").length-1))),f)}return gs(c,f)},S.reduce=function(c,f,x){var R=ti(c)?$u:Xc,D=arguments.length<3;return R(c,je(f,4),x,D,nr)},S.reduceRight=function(c,f,x){var R=ti(c)?Jp:Xc,D=arguments.length<3;return R(c,je(f,4),x,D,mh)},S.repeat=function(c,f,x){return f=(x?$e(c,f,x):f===void 0)?1:di(f),xh(xi(c),f)},S.replace=function(){var c=arguments,f=xi(c[0]);return c.length<3?f:f.replace(c[1],c[2])},S.result=function(c,f,x){var R=-1,D=(f=no(f,c)).length;for(D||(D=1,c=void 0);++R<D;){var $=c==null?void 0:c[Vr(f[R])];$===void 0&&(R=D,$=x),c=oo($)?$.call(c):$}return c},S.round=kd,S.runInContext=It,S.sample=function(c){return(ti(c)?Ho:ud)(c)},S.size=function(c){if(c==null)return 0;if(mr(c))return Nh(c)?Bo(c):c.length;var f=An(c);return f==L||f==j?c.size:sd(c).length},S.snakeCase=ru,S.some=function(c,f,x){var R=ti(c)?Ju:bh;return x&&$e(c,f,x)&&(f=void 0),R(c,je(f,3))},S.sortedIndex=function(c,f){return ja(c,f)},S.sortedIndexBy=function(c,f,x){return Vl(c,f,je(x,2))},S.sortedIndexOf=function(c,f){var x=c==null?0:c.length;if(x){var R=ja(c,f);if(R<x&&Wr(c[R],f))return R}return-1},S.sortedLastIndex=function(c,f){return ja(c,f,!0)},S.sortedLastIndexBy=function(c,f,x){return Vl(c,f,je(x,2),!0)},S.sortedLastIndexOf=function(c,f){if(c!=null&&c.length){var x=ja(c,f,!0)-1;if(Wr(c[x],f))return x}return-1},S.startCase=kh,S.startsWith=function(c,f,x){return c=xi(c),x=x==null?0:zo(di(x),0,c.length),f=pn(f),c.slice(x,x+f.length)==f},S.subtract=Xh,S.sum=function(c){return c&&c.length?Qu(c,sr):0},S.sumBy=function(c,f){return c&&c.length?Qu(c,je(f,2)):0},S.template=function(c,f,x){var R=S.templateSettings;x&&$e(c,f,x)&&(f=void 0),c=xi(c),f=Fh({},f,R,$l);var D,$,ut=Fh({},f.imports,R.imports,$l),mt=Rn(ut),Mt=eh(ut,mt),Jt=0,Zt=f.interpolate||zt,de="__p += '",Oe=Nl((f.escape||zt).source+"|"+Zt.source+"|"+(Zt===De?Oa:zt).source+"|"+(f.evaluate||zt).source+"|$","g"),Fe="//# sourceURL="+(Ei.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++qp+"]")+`
|
|
10
|
+
`)}(R,function(D,$){return hr(V,function(ut){var mt="_."+ut[0];$&ut[1]&&!Da(D,mt)&&D.push(mt)}),D.sort()}(function(D){var $=D.match(Yn);return $?$[1].split($n):[]}(R),x)))}function wf(c){var f=0,x=0;return function(){var R=Ar(),D=16-(R-x);if(x=R,D>0){if(++f>=800)return arguments[0]}else f=0;return c.apply(void 0,arguments)}}function Ah(c,f){var x=-1,R=c.length,D=R-1;for(f=f===void 0?R:f;++x<f;){var $=gs(x,D),ut=c[$];c[$]=c[x],c[x]=ut}return c.length=f,c}var Rh=function(c){var f=Kl(c,function(R){return x.size===500&&x.clear(),R}),x=f.cache;return f}(function(c){var f=[];return c.charCodeAt(0)===46&&f.push(""),c.replace(Ci,function(x,R,D,$){f.push(D?$.replace(zu,"$1"):R||x)}),f});function Vr(c){if(typeof c=="string"||Lr(c))return c;var f=c+"";return f=="0"&&1/c==-1/0?"-0":f}function ys(c){if(c!=null){try{return nh.call(c)}catch{}try{return c+""}catch{}}return""}function Sf(c){if(c instanceof oi)return c.clone();var f=new Yi(c.__wrapped__,c.__chain__);return f.__actions__=Mn(c.__actions__),f.__index__=c.__index__,f.__values__=c.__values__,f}var Xg=ci(function(c,f){return Vi(c)?fs(c,Ee(f,1,Vi,!0)):[]}),Tf=ci(function(c,f){var x=Ir(f);return Vi(x)&&(x=void 0),Vi(c)?fs(c,Ee(f,1,Vi,!0),je(x,2)):[]}),Ef=ci(function(c,f){var x=Ir(f);return Vi(x)&&(x=void 0),Vi(c)?fs(c,Ee(f,1,Vi,!0),void 0,x):[]});function wd(c,f,x){var R=c==null?0:c.length;if(!R)return-1;var D=x==null?0:di(x);return D<0&&(D=Hi(R+D,0)),Il(c,je(f,3),D)}function Sd(c,f,x){var R=c==null?0:c.length;if(!R)return-1;var D=R-1;return x!==void 0&&(D=di(x),D=x<0?Hi(R+D,0):yn(D,R-1)),Il(c,je(f,3),D,!0)}function Td(c){return c!=null&&c.length?Ee(c,1):[]}function Ed(c){return c&&c.length?c[0]:void 0}var Qa=ci(function(c){var f=Gi(c,Wa);return f.length&&f[0]===c[0]?od(f):[]}),or=ci(function(c){var f=Ir(c),x=Gi(c,Wa);return f===Ir(x)?f=void 0:x.pop(),x.length&&x[0]===c[0]?od(x,je(f,2)):[]}),Qn=ci(function(c){var f=Ir(c),x=Gi(c,Wa);return(f=typeof f=="function"?f:void 0)&&x.pop(),x.length&&x[0]===c[0]?od(x,void 0,f):[]});function Ir(c){var f=c==null?0:c.length;return f?c[f-1]:void 0}var qg=ci(Mf);function Mf(c,f){return c&&c.length&&f&&f.length?io(c,f):c}var Yg=So(function(c,f){var x=c==null?0:c.length,R=jl(c,f);return na(c,Gi(f,function(D){return Kn(D,x)?+D:D}).sort(mf)),R});function Md(c){return c==null?c:kl.call(c)}var $g=ci(function(c){return Si(Ee(c,1,Vi,!0))}),Jg=ci(function(c){var f=Ir(c);return Vi(f)&&(f=void 0),Si(Ee(c,1,Vi,!0),je(f,2))}),Zg=ci(function(c){var f=Ir(c);return f=typeof f=="function"?f:void 0,Si(Ee(c,1,Vi,!0),void 0,f)});function Ad(c){if(!c||!c.length)return[];var f=0;return c=fo(c,function(x){if(Vi(x))return f=Hi(x.length,f),!0}),th(f,function(x){return Gi(c,Zu(x))})}function Af(c,f){if(!c||!c.length)return[];var x=Ad(c);return f==null?x:Gi(x,function(R){return ir(f,void 0,R)})}var Kg=ci(function(c,f){return Vi(c)?fs(c,f):[]}),Qg=ci(function(c){return Sh(fo(c,Vi))}),tv=ci(function(c){var f=Ir(c);return Vi(f)&&(f=void 0),Sh(fo(c,Vi),je(f,2))}),ev=ci(function(c){var f=Ir(c);return f=typeof f=="function"?f:void 0,Sh(fo(c,Vi),void 0,f)}),iv=ci(Ad),nv=ci(function(c){var f=c.length,x=f>1?c[f-1]:void 0;return x=typeof x=="function"?(c.pop(),x):void 0,Af(c,x)});function Rf(c){var f=S(c);return f.__chain__=!0,f}function Ch(c,f){return f(c)}var rv=So(function(c){var f=c.length,x=f?c[0]:0,R=this.__wrapped__,D=function($){return jl($,c)};return!(f>1||this.__actions__.length)&&R instanceof oi&&Kn(x)?((R=R.slice(x,+x+(f?1:0))).__actions__.push({func:Ch,args:[D],thisArg:void 0}),new Yi(R,this.__chain__).thru(function($){return f&&!$.length&&$.push(void 0),$})):this.thru(D)}),ov=vs(function(c,f,x){Ei.call(c,x)?++c[x]:vo(c,x,1)}),sv=Vo(wd),av=Vo(Sd);function Cf(c,f){return(ti(c)?hr:nr)(c,je(f,3))}function Pf(c,f){return(ti(c)?Hc:mh)(c,je(f,3))}var lv=vs(function(c,f,x){Ei.call(c,x)?c[x].push(f):vo(c,x,[f])}),uv=ci(function(c,f,x){var R=-1,D=typeof f=="function",$=mr(c)?Se(c.length):[];return nr(c,function(ut){$[++R]=D?ir(f,ut,x):Ga(ut,f,x)}),$}),hv=vs(function(c,f,x){vo(c,x,f)});function Ph(c,f){return(ti(c)?Gi:ad)(c,je(f,3))}var cv=vs(function(c,f,x){c[x?0:1].push(f)},function(){return[[],[]]}),dv=ci(function(c,f){if(c==null)return[];var x=f.length;return x>1&&$e(c,f[0],f[1])?f=[]:x>2&&$e(f[0],f[1],f[2])&&(f=[f[0]]),bo(c,Ee(f,1),[])}),Ih=Gg||function(){return tn.Date.now()};function If(c,f,x){return f=x?void 0:f,Ti(c,128,void 0,void 0,void 0,void 0,f=c&&f==null?c.length:f)}function Lf(c,f){var x;if(typeof f!="function")throw new dr(W);return c=di(c),function(){return--c>0&&(x=f.apply(this,arguments)),c<=1&&(f=void 0),x}}var Rd=ci(function(c,f,x){var R=1;if(x.length){var D=Fo(x,ro(Rd));R|=32}return Ti(c,R,f,x,D)}),Of=ci(function(c,f,x){var R=3;if(x.length){var D=Fo(x,ro(Of));R|=32}return Ti(f,R,c,x,D)});function Nf(c,f,x){var R,D,$,ut,mt,Mt,Jt=0,Zt=!1,de=!1,Oe=!0;if(typeof c!="function")throw new dr(W);function Fe(Ue){var Ye=R,li=D;return R=D=void 0,Jt=Ue,ut=c.apply(li,Ye)}function Ve(Ue){return Jt=Ue,mt=Zl(pe,f),Zt?Fe(Ue):ut}function re(Ue){var Ye=Ue-Mt;return Mt===void 0||Ye>=f||Ye<0||de&&Ue-Jt>=$}function pe(){var Ue=Ih();if(re(Ue))return He(Ue);mt=Zl(pe,function(Ye){var li=f-(Ye-Mt);return de?yn(li,$-(Ye-Jt)):li}(Ue))}function He(Ue){return mt=void 0,Oe&&R?Fe(Ue):(R=D=void 0,ut)}function Ce(){var Ue=Ih(),Ye=re(Ue);if(R=arguments,D=this,Mt=Ue,Ye){if(mt===void 0)return Ve(Mt);if(de)return pd(mt),mt=Zl(pe,f),Fe(Mt)}return mt===void 0&&(mt=Zl(pe,f)),ut}return f=Or(f)||0,nn(x)&&(Zt=!!x.leading,$=(de="maxWait"in x)?Hi(Or(x.maxWait)||0,f):$,Oe="trailing"in x?!!x.trailing:Oe),Ce.cancel=function(){mt!==void 0&&pd(mt),Jt=0,R=Mt=D=mt=void 0},Ce.flush=function(){return mt===void 0?ut:He(Ih())},Ce}var pv=ci(function(c,f){return fh(c,1,f)}),fv=ci(function(c,f,x){return fh(c,Or(f)||0,x)});function Kl(c,f){if(typeof c!="function"||f!=null&&typeof f!="function")throw new dr(W);var x=function(){var R=arguments,D=f?f.apply(this,R):R[0],$=x.cache;if($.has(D))return $.get(D);var ut=c.apply(this,R);return x.cache=$.set(D,ut)||$,ut};return x.cache=new(Kl.Cache||pr),x}function Ql(c){if(typeof c!="function")throw new dr(W);return function(){var f=arguments;switch(f.length){case 0:return!c.call(this);case 1:return!c.call(this,f[0]);case 2:return!c.call(this,f[0],f[1]);case 3:return!c.call(this,f[0],f[1],f[2])}return!c.apply(this,f)}}Kl.Cache=pr;var Cd=ff(function(c,f){var x=(f=f.length==1&&ti(f[0])?Gi(f[0],cr(je())):Gi(Ee(f,1),cr(je()))).length;return ci(function(R){for(var D=-1,$=yn(R.length,x);++D<$;)R[D]=f[D].call(this,R[D]);return ir(c,this,R)})}),Lh=ci(function(c,f){return Ti(c,32,void 0,f,Fo(f,ro(Lh)))}),Df=ci(function(c,f){return Ti(c,64,void 0,f,Fo(f,ro(Df)))}),xs=So(function(c,f){return Ti(c,256,void 0,void 0,void 0,f)});function Wr(c,f){return c===f||c!=c&&f!=f}var mv=aa(vh),Ff=aa(function(c,f){return c>=f}),bs=ia(function(){return arguments}())?ia:function(c){return rn(c)&&Ei.call(c,"callee")&&!af.call(c,"callee")},ti=Se.isArray,gv=kc?cr(kc):function(c){return rn(c)&&Zn(c)==ge};function mr(c){return c!=null&&Oh(c.length)&&!oo(c)}function Vi(c){return rn(c)&&mr(c)}var Xo=td||ol,Bf=Uc?cr(Uc):function(c){return rn(c)&&Zn(c)==vt};function Pd(c){if(!rn(c))return!1;var f=Zn(c);return f==Ot||f=="[object DOMException]"||typeof c.message=="string"&&typeof c.name=="string"&&!tl(c)}function oo(c){if(!nn(c))return!1;var f=Zn(c);return f==Nt||f==E||f=="[object AsyncFunction]"||f=="[object Proxy]"}function kf(c){return typeof c=="number"&&c==di(c)}function Oh(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=9007199254740991}function nn(c){var f=typeof c;return c!=null&&(f=="object"||f=="function")}function rn(c){return c!=null&&typeof c=="object"}var Uf=Vu?cr(Vu):function(c){return rn(c)&&An(c)==L};function Id(c){return typeof c=="number"||rn(c)&&Zn(c)==O}function tl(c){if(!rn(c)||Zn(c)!=Y)return!1;var f=ah(c);if(f===null)return!0;var x=Ei.call(f,"constructor")&&f.constructor;return typeof x=="function"&&x instanceof x&&nh.call(x)==Fg}var Ld=Wu?cr(Wu):function(c){return rn(c)&&Zn(c)==C},Gf=Xu?cr(Xu):function(c){return rn(c)&&An(c)==j};function Nh(c){return typeof c=="string"||!ti(c)&&rn(c)&&Zn(c)==X}function Lr(c){return typeof c=="symbol"||rn(c)&&Zn(c)==K}var da=qu?cr(qu):function(c){return rn(c)&&Oh(c.length)&&!!Pi[Zn(c)]},Hf=aa(_h),vv=aa(function(c,f){return c<=f});function zf(c){if(!c)return[];if(mr(c))return Nh(c)?Gn(c):Mn(c);if(mo&&c[mo])return function(x){for(var R,D=[];!(R=x.next()).done;)D.push(R.value);return D}(c[mo]());var f=An(c);return(f==L?ih:f==j?us:To)(c)}function qo(c){return c?(c=Or(c))===1/0||c===-1/0?17976931348623157e292*(c<0?-1:1):c==c?c:0:c===0?c:0}function di(c){var f=qo(c),x=f%1;return f==f?x?f-x:f:0}function jf(c){return c?zo(di(c),0,4294967295):0}function Or(c){if(typeof c=="number")return c;if(Lr(c))return NaN;if(nn(c)){var f=typeof c.valueOf=="function"?c.valueOf():c;c=nn(f)?f+"":f}if(typeof c!="string")return c===0?c:+c;c=qc(c);var x=st.test(c);return x||Tt.test(c)?Yp(c.slice(2),x?2:8):J.test(c)?NaN:+c}function Vf(c){return un(c,Fn(c))}function xi(c){return c==null?"":pn(c)}var Dh=en(function(c,f){if(Jl(f)||mr(f))un(f,Rn(f),c);else for(var x in f)Ei.call(f,x)&&ps(c,x,f[x])}),Od=en(function(c,f){un(f,Fn(f),c)}),Fh=en(function(c,f,x,R){un(f,Fn(f),c,R)}),_v=en(function(c,f,x,R){un(f,Rn(f),c,R)}),Wf=So(jl),Nd=ci(function(c,f){c=ki(c);var x=-1,R=f.length,D=R>2?f[2]:void 0;for(D&&$e(f[0],f[1],D)&&(R=1);++x<R;)for(var $=f[x],ut=Fn($),mt=-1,Mt=ut.length;++mt<Mt;){var Jt=ut[mt],Zt=c[Jt];(Zt===void 0||Wr(Zt,Br[Jt])&&!Ei.call(c,Jt))&&(c[Jt]=$[Jt])}return c}),pa=ci(function(c){return c.push(void 0,wo),ir(el,void 0,c)});function Dd(c,f,x){var R=c==null?void 0:xo(c,f);return R===void 0?x:R}function tu(c,f){return c!=null&&Ka(c,f,rd)}var yv=Mh(function(c,f,x){f!=null&&typeof f.toString!="function"&&(f=rh.call(f)),c[f]=x},nl(sr)),xv=Mh(function(c,f,x){f!=null&&typeof f.toString!="function"&&(f=rh.call(f)),Ei.call(c,f)?c[f].push(x):c[f]=[x]},je),Oi=ci(Ga);function Rn(c){return mr(c)?Go(c):sd(c)}function Fn(c){return mr(c)?Go(c,!0):hf(c)}var eu=en(function(c,f,x){hi(c,f,x)}),el=en(function(c,f,x,R){hi(c,f,x,R)}),fa=So(function(c,f){var x={};if(c==null)return x;var R=!1;f=Gi(f,function($){return $=no($,c),R||(R=$.length>1),$}),un(c,la(c),x),R&&(x=En(x,7,Ja));for(var D=f.length;D--;)Va(x,f[D]);return x}),mn=So(function(c,f){return c==null?{}:function(x,R){return yh(x,R,function(D,$){return tu(x,$)})}(c,f)});function Yo(c,f){if(c==null)return{};var x=Gi(la(c),function(R){return[R]});return f=je(f),yh(c,x,function(R,D){return f(R,D[0])})}var iu=Yl(Rn),ma=Yl(Fn);function To(c){return c==null?[]:eh(c,Rn(c))}var il=_s(function(c,f,x){return f=f.toLowerCase(),c+(x?ga(f):f)});function ga(c){return ou(xi(c).toLowerCase())}function va(c){return(c=xi(c))&&c.replace(wt,tf).replace(Vp,"")}var nu=_s(function(c,f,x){return c+(x?"-":"")+f.toLowerCase()}),Xf=_s(function(c,f,x){return c+(x?" ":"")+f.toLowerCase()}),Bh=oa("toLowerCase"),ru=_s(function(c,f,x){return c+(x?"_":"")+f.toLowerCase()}),kh=_s(function(c,f,x){return c+(x?" ":"")+ou(f)}),qf=_s(function(c,f,x){return c+(x?" ":"")+f.toUpperCase()}),ou=oa("toUpperCase");function Fd(c,f,x){return c=xi(c),(f=x?void 0:f)===void 0?function(R){return Wp.test(R)}(c)?function(R){return R.match(Oo)||[]}(c):function(R){return R.match(La)||[]}(c):c.match(f)||[]}var su=ci(function(c,f){try{return ir(c,void 0,f)}catch(x){return Pd(x)?x:new gi(x)}}),Uh=So(function(c,f){return hr(f,function(x){x=Vr(x),vo(c,x,Rd(c[x],c))}),c});function nl(c){return function(){return c}}var Yf=Wo(),$f=Wo(!0);function sr(c){return c}function Gh(c){return uf(typeof c=="function"?c:En(c,1))}var Jf=ci(function(c,f){return function(x){return Ga(x,c,f)}}),bv=ci(function(c,f){return function(x){return Ga(c,x,f)}});function Hh(c,f,x){var R=Rn(f),D=eo(f,R);x!=null||nn(f)&&(D.length||!R.length)||(x=f,f=c,c=this,D=eo(f,Rn(f)));var $=!(nn(x)&&"chain"in x&&!x.chain),ut=oo(c);return hr(D,function(mt){var Mt=f[mt];c[mt]=Mt,ut&&(c.prototype[mt]=function(){var Jt=this.__chain__;if($||Jt){var Zt=c(this.__wrapped__),de=Zt.__actions__=Mn(this.__actions__);return de.push({func:Mt,args:arguments,thisArg:c}),Zt.__chain__=Jt,Zt}return Mt.apply(c,Do([this.value()],arguments))})}),c}function rl(){}var zh=Ya(Gi),ws=Ya(zc),Zf=Ya(Ju);function Kf(c){return Te(c)?Zu(Vr(c)):function(f){return function(x){return xo(x,f)}}(c)}var jh=Xl(),Qf=Xl(!0);function Vh(){return[]}function ol(){return!1}var au=qa(function(c,f){return c+f},0),Bd=$a("ceil"),Bn=qa(function(c,f){return c/f},1),tm=$a("floor"),Wh,em=qa(function(c,f){return c*f},1),kd=$a("round"),Xh=qa(function(c,f){return c-f},0);return S.after=function(c,f){if(typeof f!="function")throw new dr(W);return c=di(c),function(){if(--c<1)return f.apply(this,arguments)}},S.ary=If,S.assign=Dh,S.assignIn=Od,S.assignInWith=Fh,S.assignWith=_v,S.at=Wf,S.before=Lf,S.bind=Rd,S.bindAll=Uh,S.bindKey=Of,S.castArray=function(){if(!arguments.length)return[];var c=arguments[0];return ti(c)?c:[c]},S.chain=Rf,S.chunk=function(c,f,x){f=(x?$e(c,f,x):f===void 0)?1:Hi(di(f),0);var R=c==null?0:c.length;if(!R||f<1)return[];for(var D=0,$=0,ut=Se(uh(R/f));D<R;)ut[$++]=ln(c,D,D+=f);return ut},S.compact=function(c){for(var f=-1,x=c==null?0:c.length,R=0,D=[];++f<x;){var $=c[f];$&&(D[R++]=$)}return D},S.concat=function(){var c=arguments.length;if(!c)return[];for(var f=Se(c-1),x=arguments[0],R=c;R--;)f[R-1]=arguments[R];return Do(ti(x)?Mn(x):[x],Ee(f,1))},S.cond=function(c){var f=c==null?0:c.length,x=je();return c=f?Gi(c,function(R){if(typeof R[1]!="function")throw new dr(W);return[x(R[0]),R[1]]}):[],ci(function(R){for(var D=-1;++D<f;){var $=c[D];if(ir($[0],this,R))return ir($[1],this,R)}})},S.conforms=function(c){return function(f){var x=Rn(f);return function(R){return _o(R,f,x)}}(En(c,1))},S.constant=nl,S.countBy=ov,S.create=function(c,f){var x=ds(c);return f==null?x:lf(x,f)},S.curry=function c(f,x,R){var D=Ti(f,8,void 0,void 0,void 0,void 0,void 0,x=R?void 0:x);return D.placeholder=c.placeholder,D},S.curryRight=function c(f,x,R){var D=Ti(f,16,void 0,void 0,void 0,void 0,void 0,x=R?void 0:x);return D.placeholder=c.placeholder,D},S.debounce=Nf,S.defaults=Nd,S.defaultsDeep=pa,S.defer=pv,S.delay=fv,S.difference=Xg,S.differenceBy=Tf,S.differenceWith=Ef,S.drop=function(c,f,x){var R=c==null?0:c.length;return R?ln(c,(f=x||f===void 0?1:di(f))<0?0:f,R):[]},S.dropRight=function(c,f,x){var R=c==null?0:c.length;return R?ln(c,0,(f=R-(f=x||f===void 0?1:di(f)))<0?0:f):[]},S.dropRightWhile=function(c,f){return c&&c.length?Wl(c,je(f,3),!0,!0):[]},S.dropWhile=function(c,f){return c&&c.length?Wl(c,je(f,3),!0):[]},S.fill=function(c,f,x,R){var D=c==null?0:c.length;return D?(x&&typeof x!="number"&&$e(c,f,x)&&(x=0,R=D),function($,ut,mt,Mt){var Jt=$.length;for((mt=di(mt))<0&&(mt=-mt>Jt?0:Jt+mt),(Mt=Mt===void 0||Mt>Jt?Jt:di(Mt))<0&&(Mt+=Jt),Mt=mt>Mt?0:jf(Mt);mt<Mt;)$[mt++]=ut;return $}(c,f,x,R)):[]},S.filter=function(c,f){return(ti(c)?fo:jo)(c,je(f,3))},S.flatMap=function(c,f){return Ee(Ph(c,f),1)},S.flatMapDeep=function(c,f){return Ee(Ph(c,f),1/0)},S.flatMapDepth=function(c,f,x){return x=x===void 0?1:di(x),Ee(Ph(c,f),x)},S.flatten=Td,S.flattenDeep=function(c){return c!=null&&c.length?Ee(c,1/0):[]},S.flattenDepth=function(c,f){return c!=null&&c.length?Ee(c,f=f===void 0?1:di(f)):[]},S.flip=function(c){return Ti(c,512)},S.flow=Yf,S.flowRight=$f,S.fromPairs=function(c){for(var f=-1,x=c==null?0:c.length,R={};++f<x;){var D=c[f];R[D[0]]=D[1]}return R},S.functions=function(c){return c==null?[]:eo(c,Rn(c))},S.functionsIn=function(c){return c==null?[]:eo(c,Fn(c))},S.groupBy=lv,S.initial=function(c){return c!=null&&c.length?ln(c,0,-1):[]},S.intersection=Qa,S.intersectionBy=or,S.intersectionWith=Qn,S.invert=yv,S.invertBy=xv,S.invokeMap=uv,S.iteratee=Gh,S.keyBy=hv,S.keys=Rn,S.keysIn=Fn,S.map=Ph,S.mapKeys=function(c,f){var x={};return f=je(f,3),yo(c,function(R,D,$){vo(x,f(R,D,$),R)}),x},S.mapValues=function(c,f){var x={};return f=je(f,3),yo(c,function(R,D,$){vo(x,D,f(R,D,$))}),x},S.matches=function(c){return cf(En(c,1))},S.matchesProperty=function(c,f){return ld(c,En(f,1))},S.memoize=Kl,S.merge=eu,S.mergeWith=el,S.method=Jf,S.methodOf=bv,S.mixin=Hh,S.negate=Ql,S.nthArg=function(c){return c=di(c),ci(function(f){return Hr(f,c)})},S.omit=fa,S.omitBy=function(c,f){return Yo(c,Ql(je(f)))},S.once=function(c){return Lf(2,c)},S.orderBy=function(c,f,x,R){return c==null?[]:(ti(f)||(f=f==null?[]:[f]),ti(x=R?void 0:x)||(x=x==null?[]:[x]),bo(c,f,x))},S.over=zh,S.overArgs=Cd,S.overEvery=ws,S.overSome=Zf,S.partial=Lh,S.partialRight=Df,S.partition=cv,S.pick=mn,S.pickBy=Yo,S.property=Kf,S.propertyOf=function(c){return function(f){return c==null?void 0:xo(c,f)}},S.pull=qg,S.pullAll=Mf,S.pullAllBy=function(c,f,x){return c&&c.length&&f&&f.length?io(c,f,je(x,2)):c},S.pullAllWith=function(c,f,x){return c&&c.length&&f&&f.length?io(c,f,void 0,x):c},S.pullAt=Yg,S.range=jh,S.rangeRight=Qf,S.rearg=xs,S.reject=function(c,f){return(ti(c)?fo:jo)(c,Ql(je(f,3)))},S.remove=function(c,f){var x=[];if(!c||!c.length)return x;var R=-1,D=[],$=c.length;for(f=je(f,3);++R<$;){var ut=c[R];f(ut,R,c)&&(x.push(ut),D.push(R))}return na(c,D),x},S.rest=function(c,f){if(typeof c!="function")throw new dr(W);return ci(c,f=f===void 0?f:di(f))},S.reverse=Md,S.sampleSize=function(c,f,x){return f=(x?$e(c,f,x):f===void 0)?1:di(f),(ti(c)?ta:hd)(c,f)},S.set=function(c,f,x){return c==null?c:ji(c,f,x)},S.setWith=function(c,f,x,R){return R=typeof R=="function"?R:void 0,c==null?c:ji(c,f,x,R)},S.shuffle=function(c){return(ti(c)?zl:pf)(c)},S.slice=function(c,f,x){var R=c==null?0:c.length;return R?(x&&typeof x!="number"&&$e(c,f,x)?(f=0,x=R):(f=f==null?0:di(f),x=x===void 0?R:di(x)),ln(c,f,x)):[]},S.sortBy=dv,S.sortedUniq=function(c){return c&&c.length?wh(c):[]},S.sortedUniqBy=function(c,f){return c&&c.length?wh(c,je(f,2)):[]},S.split=function(c,f,x){return x&&typeof x!="number"&&$e(c,f,x)&&(f=x=void 0),(x=x===void 0?4294967295:x>>>0)?(c=xi(c))&&(typeof f=="string"||f!=null&&!Ld(f))&&!(f=pn(f))&&Ys(c)?_e(Gn(c),0,x):c.split(f,x):[]},S.spread=function(c,f){if(typeof c!="function")throw new dr(W);return f=f==null?0:Hi(di(f),0),ci(function(x){var R=x[f],D=_e(x,0,f);return R&&Do(D,R),ir(c,this,D)})},S.tail=function(c){var f=c==null?0:c.length;return f?ln(c,1,f):[]},S.take=function(c,f,x){return c&&c.length?ln(c,0,(f=x||f===void 0?1:di(f))<0?0:f):[]},S.takeRight=function(c,f,x){var R=c==null?0:c.length;return R?ln(c,(f=R-(f=x||f===void 0?1:di(f)))<0?0:f,R):[]},S.takeRightWhile=function(c,f){return c&&c.length?Wl(c,je(f,3),!1,!0):[]},S.takeWhile=function(c,f){return c&&c.length?Wl(c,je(f,3)):[]},S.tap=function(c,f){return f(c),c},S.throttle=function(c,f,x){var R=!0,D=!0;if(typeof c!="function")throw new dr(W);return nn(x)&&(R="leading"in x?!!x.leading:R,D="trailing"in x?!!x.trailing:D),Nf(c,f,{leading:R,maxWait:f,trailing:D})},S.thru=Ch,S.toArray=zf,S.toPairs=iu,S.toPairsIn=ma,S.toPath=function(c){return ti(c)?Gi(c,Vr):Lr(c)?[c]:Mn(Rh(xi(c)))},S.toPlainObject=Vf,S.transform=function(c,f,x){var R=ti(c),D=R||Xo(c)||da(c);if(f=je(f,4),x==null){var $=c&&c.constructor;x=D?R?new $:[]:nn(c)&&oo($)?ds(ah(c)):{}}return(D?hr:yo)(c,function(ut,mt,Mt){return f(x,ut,mt,Mt)}),x},S.unary=function(c){return If(c,1)},S.union=$g,S.unionBy=Jg,S.unionWith=Zg,S.uniq=function(c){return c&&c.length?Si(c):[]},S.uniqBy=function(c,f){return c&&c.length?Si(c,je(f,2)):[]},S.uniqWith=function(c,f){return f=typeof f=="function"?f:void 0,c&&c.length?Si(c,void 0,f):[]},S.unset=function(c,f){return c==null||Va(c,f)},S.unzip=Ad,S.unzipWith=Af,S.update=function(c,f,x){return c==null?c:mi(c,f,Th(x))},S.updateWith=function(c,f,x,R){return R=typeof R=="function"?R:void 0,c==null?c:mi(c,f,Th(x),R)},S.values=To,S.valuesIn=function(c){return c==null?[]:eh(c,Fn(c))},S.without=Kg,S.words=Fd,S.wrap=function(c,f){return Lh(Th(f),c)},S.xor=Qg,S.xorBy=tv,S.xorWith=ev,S.zip=iv,S.zipObject=function(c,f){return dd(c||[],f||[],ps)},S.zipObjectDeep=function(c,f){return dd(c||[],f||[],ji)},S.zipWith=nv,S.entries=iu,S.entriesIn=ma,S.extend=Od,S.extendWith=Fh,Hh(S,S),S.add=au,S.attempt=su,S.camelCase=il,S.capitalize=ga,S.ceil=Bd,S.clamp=function(c,f,x){return x===void 0&&(x=f,f=void 0),x!==void 0&&(x=(x=Or(x))==x?x:0),f!==void 0&&(f=(f=Or(f))==f?f:0),zo(Or(c),f,x)},S.clone=function(c){return En(c,4)},S.cloneDeep=function(c){return En(c,5)},S.cloneDeepWith=function(c,f){return En(c,5,f=typeof f=="function"?f:void 0)},S.cloneWith=function(c,f){return En(c,4,f=typeof f=="function"?f:void 0)},S.conformsTo=function(c,f){return f==null||_o(c,f,Rn(f))},S.deburr=va,S.defaultTo=function(c,f){return c==null||c!=c?f:c},S.divide=Bn,S.endsWith=function(c,f,x){c=xi(c),f=pn(f);var R=c.length,D=x=x===void 0?R:zo(di(x),0,R);return(x-=f.length)>=0&&c.slice(x,D)==f},S.eq=Wr,S.escape=function(c){return(c=xi(c))&&ei.test(c)?c.replace(ui,ef):c},S.escapeRegExp=function(c){return(c=xi(c))&&Ii.test(c)?c.replace(Ki,"\\$&"):c},S.every=function(c,f,x){var R=ti(c)?zc:gh;return x&&$e(c,f,x)&&(f=void 0),R(c,je(f,3))},S.find=sv,S.findIndex=wd,S.findKey=function(c,f){return jc(c,je(f,3),yo)},S.findLast=av,S.findLastIndex=Sd,S.findLastKey=function(c,f){return jc(c,je(f,3),nd)},S.floor=tm,S.forEach=Cf,S.forEachRight=Pf,S.forIn=function(c,f){return c==null?c:ms(c,je(f,3),Fn)},S.forInRight=function(c,f){return c==null?c:Gr(c,je(f,3),Fn)},S.forOwn=function(c,f){return c&&yo(c,je(f,3))},S.forOwnRight=function(c,f){return c&&nd(c,je(f,3))},S.get=Dd,S.gt=mv,S.gte=Ff,S.has=function(c,f){return c!=null&&Ka(c,f,ea)},S.hasIn=tu,S.head=Ed,S.identity=sr,S.includes=function(c,f,x,R){c=mr(c)?c:To(c),x=x&&!R?di(x):0;var D=c.length;return x<0&&(x=Hi(D+x,0)),Nh(c)?x<=D&&c.indexOf(f,x)>-1:!!D&&qs(c,f,x)>-1},S.indexOf=function(c,f,x){var R=c==null?0:c.length;if(!R)return-1;var D=x==null?0:di(x);return D<0&&(D=Hi(R+D,0)),qs(c,f,D)},S.inRange=function(c,f,x){return f=qo(f),x===void 0?(x=f,f=0):x=qo(x),function(R,D,$){return R>=yn(D,$)&&R<Hi(D,$)}(c=Or(c),f,x)},S.invoke=Oi,S.isArguments=bs,S.isArray=ti,S.isArrayBuffer=gv,S.isArrayLike=mr,S.isArrayLikeObject=Vi,S.isBoolean=function(c){return c===!0||c===!1||rn(c)&&Zn(c)==Z},S.isBuffer=Xo,S.isDate=Bf,S.isElement=function(c){return rn(c)&&c.nodeType===1&&!tl(c)},S.isEmpty=function(c){if(c==null)return!0;if(mr(c)&&(ti(c)||typeof c=="string"||typeof c.splice=="function"||Xo(c)||da(c)||bs(c)))return!c.length;var f=An(c);if(f==L||f==j)return!c.size;if(Jl(c))return!sd(c).length;for(var x in c)if(Ei.call(c,x))return!1;return!0},S.isEqual=function(c,f){return Rr(c,f)},S.isEqualWith=function(c,f,x){var R=(x=typeof x=="function"?x:void 0)?x(c,f):void 0;return R===void 0?Rr(c,f,void 0,x):!!R},S.isError=Pd,S.isFinite=function(c){return typeof c=="number"&&ko(c)},S.isFunction=oo,S.isInteger=kf,S.isLength=Oh,S.isMap=Uf,S.isMatch=function(c,f){return c===f||Ha(c,f,_d(f))},S.isMatchWith=function(c,f,x){return x=typeof x=="function"?x:void 0,Ha(c,f,_d(f),x)},S.isNaN=function(c){return Id(c)&&c!=+c},S.isNative=function(c){if(Vg(c))throw new gi("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return za(c)},S.isNil=function(c){return c==null},S.isNull=function(c){return c===null},S.isNumber=Id,S.isObject=nn,S.isObjectLike=rn,S.isPlainObject=tl,S.isRegExp=Ld,S.isSafeInteger=function(c){return kf(c)&&c>=-9007199254740991&&c<=9007199254740991},S.isSet=Gf,S.isString=Nh,S.isSymbol=Lr,S.isTypedArray=da,S.isUndefined=function(c){return c===void 0},S.isWeakMap=function(c){return rn(c)&&An(c)==qt},S.isWeakSet=function(c){return rn(c)&&Zn(c)=="[object WeakSet]"},S.join=function(c,f){return c==null?"":Hn.call(c,f)},S.kebabCase=nu,S.last=Ir,S.lastIndexOf=function(c,f,x){var R=c==null?0:c.length;if(!R)return-1;var D=R;return x!==void 0&&(D=(D=di(x))<0?Hi(R+D,0):yn(D,R-1)),f==f?function($,ut,mt){for(var Mt=mt+1;Mt--;)if($[Mt]===ut)return Mt;return Mt}(c,f,D):Il(c,Vc,D,!0)},S.lowerCase=Xf,S.lowerFirst=Bh,S.lt=Hf,S.lte=vv,S.max=function(c){return c&&c.length?Ua(c,sr,vh):void 0},S.maxBy=function(c,f){return c&&c.length?Ua(c,je(f,2),vh):void 0},S.mean=function(c){return Wc(c,sr)},S.meanBy=function(c,f){return Wc(c,je(f,2))},S.min=function(c){return c&&c.length?Ua(c,sr,_h):void 0},S.minBy=function(c,f){return c&&c.length?Ua(c,je(f,2),_h):void 0},S.stubArray=Vh,S.stubFalse=ol,S.stubObject=function(){return{}},S.stubString=function(){return""},S.stubTrue=function(){return!0},S.multiply=em,S.nth=function(c,f){return c&&c.length?Hr(c,di(f)):void 0},S.noConflict=function(){return tn._===this&&(tn._=Bg),this},S.noop=rl,S.now=Ih,S.pad=function(c,f,x){c=xi(c);var R=(f=di(f))?Bo(c):0;if(!f||R>=f)return c;var D=(f-R)/2;return sa(hh(D),x)+c+sa(uh(D),x)},S.padEnd=function(c,f,x){c=xi(c);var R=(f=di(f))?Bo(c):0;return f&&R<f?c+sa(f-R,x):c},S.padStart=function(c,f,x){c=xi(c);var R=(f=di(f))?Bo(c):0;return f&&R<f?sa(f-R,x)+c:c},S.parseInt=function(c,f,x){return x||f==null?f=0:f&&(f=+f),zn(xi(c).replace(Ui,""),f||0)},S.random=function(c,f,x){if(x&&typeof x!="boolean"&&$e(c,f,x)&&(f=x=void 0),x===void 0&&(typeof f=="boolean"?(x=f,f=void 0):typeof c=="boolean"&&(x=c,c=void 0)),c===void 0&&f===void 0?(c=0,f=1):(c=qo(c),f===void 0?(f=c,c=0):f=qo(f)),c>f){var R=c;c=f,f=R}if(x||c%1||f%1){var D=dh();return yn(c+D*(f-c+Tr("1e-"+((D+"").length-1))),f)}return gs(c,f)},S.reduce=function(c,f,x){var R=ti(c)?$u:Xc,D=arguments.length<3;return R(c,je(f,4),x,D,nr)},S.reduceRight=function(c,f,x){var R=ti(c)?Jp:Xc,D=arguments.length<3;return R(c,je(f,4),x,D,mh)},S.repeat=function(c,f,x){return f=(x?$e(c,f,x):f===void 0)?1:di(f),xh(xi(c),f)},S.replace=function(){var c=arguments,f=xi(c[0]);return c.length<3?f:f.replace(c[1],c[2])},S.result=function(c,f,x){var R=-1,D=(f=no(f,c)).length;for(D||(D=1,c=void 0);++R<D;){var $=c==null?void 0:c[Vr(f[R])];$===void 0&&(R=D,$=x),c=oo($)?$.call(c):$}return c},S.round=kd,S.runInContext=It,S.sample=function(c){return(ti(c)?Ho:ud)(c)},S.size=function(c){if(c==null)return 0;if(mr(c))return Nh(c)?Bo(c):c.length;var f=An(c);return f==L||f==j?c.size:sd(c).length},S.snakeCase=ru,S.some=function(c,f,x){var R=ti(c)?Ju:bh;return x&&$e(c,f,x)&&(f=void 0),R(c,je(f,3))},S.sortedIndex=function(c,f){return ja(c,f)},S.sortedIndexBy=function(c,f,x){return Vl(c,f,je(x,2))},S.sortedIndexOf=function(c,f){var x=c==null?0:c.length;if(x){var R=ja(c,f);if(R<x&&Wr(c[R],f))return R}return-1},S.sortedLastIndex=function(c,f){return ja(c,f,!0)},S.sortedLastIndexBy=function(c,f,x){return Vl(c,f,je(x,2),!0)},S.sortedLastIndexOf=function(c,f){if(c!=null&&c.length){var x=ja(c,f,!0)-1;if(Wr(c[x],f))return x}return-1},S.startCase=kh,S.startsWith=function(c,f,x){return c=xi(c),x=x==null?0:zo(di(x),0,c.length),f=pn(f),c.slice(x,x+f.length)==f},S.subtract=Xh,S.sum=function(c){return c&&c.length?Qu(c,sr):0},S.sumBy=function(c,f){return c&&c.length?Qu(c,je(f,2)):0},S.template=function(c,f,x){var R=S.templateSettings;x&&$e(c,f,x)&&(f=void 0),c=xi(c),f=Fh({},f,R,$l);var D,$,ut=Fh({},f.imports,R.imports,$l),mt=Rn(ut),Mt=eh(ut,mt),Jt=0,Zt=f.interpolate||zt,de="__p += '",Oe=Nl((f.escape||zt).source+"|"+Zt.source+"|"+(Zt===De?Oa:zt).source+"|"+(f.evaluate||zt).source+"|$","g"),Fe="//# sourceURL="+(Ei.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++qp+"]")+`
|
|
11
11
|
`;c.replace(Oe,function(pe,He,Ce,Ue,Ye,li){return Ce||(Ce=Ue),de+=c.slice(Jt,li).replace(ne,nf),He&&(D=!0,de+=`' +
|
|
12
12
|
__e(`+He+`) +
|
|
13
13
|
'`),Ye&&($=!0,de+=`';
|
|
@@ -24,8 +24,8 @@ __p += '`),Ce&&(de+=`' +
|
|
|
24
24
|
function print() { __p += __j.call(arguments, '') }
|
|
25
25
|
`:`;
|
|
26
26
|
`)+de+`return __p
|
|
27
|
-
}`;var re=su(function(){return an(mt,Fe+"return "+de).apply(void 0,Mt)});if(re.source=de,Pd(re))throw re;return re},S.times=function(c,f){if((c=di(c))<1||c>9007199254740991)return[];var x=4294967295,R=yn(c,4294967295);c-=4294967295;for(var D=th(R,f=je(f));++x<c;)f(x);return D},S.toFinite=qo,S.toInteger=di,S.toLength=jf,S.toLower=function(c){return xi(c).toLowerCase()},S.toNumber=Or,S.toSafeInteger=function(c){return c?zo(di(c),-9007199254740991,9007199254740991):c===0?c:0},S.toString=xi,S.toUpper=function(c){return xi(c).toUpperCase()},S.trim=function(c,f,x){if((c=xi(c))&&(x||f===void 0))return qc(c);if(!c||!(f=pn(f)))return c;var R=Gn(c),D=Gn(f);return _e(R,Yc(R,D),$c(R,D)+1).join("")},S.trimEnd=function(c,f,x){if((c=xi(c))&&(x||f===void 0))return c.slice(0,hs(c)+1);if(!c||!(f=pn(f)))return c;var R=Gn(c);return _e(R,0,$c(R,Gn(f))+1).join("")},S.trimStart=function(c,f,x){if((c=xi(c))&&(x||f===void 0))return c.replace(Ui,"");if(!c||!(f=pn(f)))return c;var R=Gn(c);return _e(R,Yc(R,Gn(f))).join("")},S.truncate=function(c,f){var x=30,R="...";if(nn(f)){var D="separator"in f?f.separator:D;x="length"in f?di(f.length):x,R="omission"in f?pn(f.omission):R}var $=(c=xi(c)).length;if(Ys(c)){var ut=Gn(c);$=ut.length}if(x>=$)return c;var mt=x-Bo(R);if(mt<1)return R;var Mt=ut?_e(ut,0,mt).join(""):c.slice(0,mt);if(D===void 0)return Mt+R;if(ut&&(mt+=Mt.length-mt),Ld(D)){if(c.slice(mt).search(D)){var Jt,Zt=Mt;for(D.global||(D=Nl(D.source,xi(Zr.exec(D))+"g")),D.lastIndex=0;Jt=D.exec(Zt);)var de=Jt.index;Mt=Mt.slice(0,de===void 0?mt:de)}}else if(c.indexOf(pn(D),mt)!=mt){var Oe=Mt.lastIndexOf(D);Oe>-1&&(Mt=Mt.slice(0,Oe))}return Mt+R},S.unescape=function(c){return(c=xi(c))&&be.test(c)?c.replace(me,Ol):c},S.uniqueId=function(c){var f=++Dg;return xi(c)+f},S.upperCase=qf,S.upperFirst=ou,S.each=Cf,S.eachRight=Pf,S.first=Ed,Hh(S,(Wh={},yo(S,function(c,f){Ei.call(S.prototype,f)||(Wh[f]=c)}),Wh),{chain:!1}),S.VERSION="4.17.21",hr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(c){S[c].placeholder=S}),hr(["drop","take"],function(c,f){oi.prototype[c]=function(x){x=x===void 0?1:Hi(di(x),0);var R=this.__filtered__&&!f?new oi(this):this.clone();return R.__filtered__?R.__takeCount__=yn(x,R.__takeCount__):R.__views__.push({size:yn(x,4294967295),type:c+(R.__dir__<0?"Right":"")}),R},oi.prototype[c+"Right"]=function(x){return this.reverse()[c](x).reverse()}}),hr(["filter","map","takeWhile"],function(c,f){var x=f+1,R=x==1||x==3;oi.prototype[c]=function(D){var $=this.clone();return $.__iteratees__.push({iteratee:je(D,3),type:x}),$.__filtered__=$.__filtered__||R,$}}),hr(["head","last"],function(c,f){var x="take"+(f?"Right":"");oi.prototype[c]=function(){return this[x](1).value()[0]}}),hr(["initial","tail"],function(c,f){var x="drop"+(f?"":"Right");oi.prototype[c]=function(){return this.__filtered__?new oi(this):this[x](1)}}),oi.prototype.compact=function(){return this.filter(sr)},oi.prototype.find=function(c){return this.filter(c).head()},oi.prototype.findLast=function(c){return this.reverse().find(c)},oi.prototype.invokeMap=ci(function(c,f){return typeof c=="function"?new oi(this):this.map(function(x){return Ga(x,c,f)})}),oi.prototype.reject=function(c){return this.filter(Ql(je(c)))},oi.prototype.slice=function(c,f){c=di(c);var x=this;return x.__filtered__&&(c>0||f<0)?new oi(x):(c<0?x=x.takeRight(-c):c&&(x=x.drop(c)),f!==void 0&&(x=(f=di(f))<0?x.dropRight(-f):x.take(f-c)),x)},oi.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},oi.prototype.toArray=function(){return this.take(4294967295)},yo(oi.prototype,function(c,f){var x=/^(?:filter|find|map|reject)|While$/.test(f),R=/^(?:head|last)$/.test(f),D=S[R?"take"+(f=="last"?"Right":""):f],$=R||/^find/.test(f);D&&(S.prototype[f]=function(){var ut=this.__wrapped__,mt=R?[1]:arguments,Mt=ut instanceof oi,Jt=mt[0],Zt=Mt||ti(ut),de=function(He){var Ce=D.apply(S,Do([He],mt));return R&&Oe?Ce[0]:Ce};Zt&&x&&typeof Jt=="function"&&Jt.length!=1&&(Mt=Zt=!1);var Oe=this.__chain__,Fe=!!this.__actions__.length,Ve=$&&!Oe,re=Mt&&!Fe;if(!$&&Zt){ut=re?ut:new oi(this);var pe=c.apply(ut,mt);return pe.__actions__.push({func:Ch,args:[de],thisArg:void 0}),new Yi(pe,Oe)}return Ve&&re?c.apply(this,mt):(pe=this.thru(de),Ve?R?pe.value()[0]:pe.value():pe)})}),hr(["pop","push","shift","sort","splice","unshift"],function(c){var f=Dl[c],x=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",R=/^(?:pop|shift)$/.test(c);S.prototype[c]=function(){var D=arguments;if(R&&!this.__chain__){var $=this.value();return f.apply(ti($)?$:[],D)}return this[x](function(ut){return f.apply(ti(ut)?ut:[],D)})}}),yo(oi.prototype,function(c,f){var x=S[f];if(x){var R=x.name+"";Ei.call(kr,R)||(kr[R]=[]),kr[R].push({name:f,func:x})}}),kr[Xa(void 0,2).name]=[{name:"wrapper",func:void 0}],oi.prototype.clone=function(){var c=new oi(this.__wrapped__);return c.__actions__=Mn(this.__actions__),c.__dir__=this.__dir__,c.__filtered__=this.__filtered__,c.__iteratees__=Mn(this.__iteratees__),c.__takeCount__=this.__takeCount__,c.__views__=Mn(this.__views__),c},oi.prototype.reverse=function(){if(this.__filtered__){var c=new oi(this);c.__dir__=-1,c.__filtered__=!0}else(c=this.clone()).__dir__*=-1;return c},oi.prototype.value=function(){var c=this.__wrapped__.value(),f=this.__dir__,x=ti(c),R=f<0,D=x?c.length:0,$=function(li,ke,Je){for(var hn=-1,Vn=Je.length;++hn<Vn;){var cn=Je[hn],on=cn.size;switch(cn.type){case"drop":li+=on;break;case"dropRight":ke-=on;break;case"take":ke=yn(ke,li+on);break;case"takeRight":li=Hi(li,ke-on)}}return{start:li,end:ke}}(0,D,this.__views__),ut=$.start,mt=$.end,Mt=mt-ut,Jt=R?mt:ut-1,Zt=this.__iteratees__,de=Zt.length,Oe=0,Fe=yn(Mt,this.__takeCount__);if(!x||!R&&D==Mt&&Fe==Mt)return cd(c,this.__actions__);var Ve=[];t:for(;Mt--&&Oe<Fe;){for(var re=-1,pe=c[Jt+=f];++re<de;){var He=Zt[re],Ce=He.iteratee,Ue=He.type,Ye=Ce(pe);if(Ue==2)pe=Ye;else if(!Ye){if(Ue==1)continue t;break t}}Ve[Oe++]=pe}return Ve},S.prototype.at=rv,S.prototype.chain=function(){return Rf(this)},S.prototype.commit=function(){return new Yi(this.value(),this.__chain__)},S.prototype.next=function(){this.__values__===void 0&&(this.__values__=zf(this.value()));var c=this.__index__>=this.__values__.length;return{done:c,value:c?void 0:this.__values__[this.__index__++]}},S.prototype.plant=function(c){for(var f,x=this;x instanceof Hl;){var R=Sf(x);R.__index__=0,R.__values__=void 0,f?D.__wrapped__=R:f=R;var D=R;x=x.__wrapped__}return D.__wrapped__=c,f},S.prototype.reverse=function(){var c=this.__wrapped__;if(c instanceof oi){var f=c;return this.__actions__.length&&(f=new oi(this)),(f=f.reverse()).__actions__.push({func:Ch,args:[Md],thisArg:void 0}),new Yi(f,this.__chain__)}return this.thru(Md)},S.prototype.toJSON=S.prototype.valueOf=S.prototype.value=function(){return cd(this.__wrapped__,this.__actions__)},S.prototype.first=S.prototype.head,mo&&(S.prototype[mo]=function(){return this}),S}();tn._=$s,(ht=function(){return $s}.call(M,v,M,q))===void 0||(q.exports=ht)}).call(this)}).call(this,v(3),v(7)(T))},function(T,M,v){var b=Object.prototype.hasOwnProperty,q="~";function ht(){}function W(k,Z,vt){this.fn=k,this.context=Z,this.once=vt||!1}function C(k,Z,vt,Ot,Nt){if(typeof vt!="function")throw new TypeError("The listener must be a function");var E=new W(vt,Ot||k,Nt),L=q?q+Z:Z;return k._events[L]?k._events[L].fn?k._events[L]=[k._events[L],E]:k._events[L].push(E):(k._events[L]=E,k._eventsCount++),k}function V(k,Z){--k._eventsCount==0?k._events=new ht:delete k._events[Z]}function z(){this._events=new ht,this._eventsCount=0}Object.create&&(ht.prototype=Object.create(null),new ht().__proto__||(q=!1)),z.prototype.eventNames=function(){var k,Z,vt=[];if(this._eventsCount===0)return vt;for(Z in k=this._events)b.call(k,Z)&&vt.push(q?Z.slice(1):Z);return Object.getOwnPropertySymbols?vt.concat(Object.getOwnPropertySymbols(k)):vt},z.prototype.listeners=function(k){var Z=q?q+k:k,vt=this._events[Z];if(!vt)return[];if(vt.fn)return[vt.fn];for(var Ot=0,Nt=vt.length,E=new Array(Nt);Ot<Nt;Ot++)E[Ot]=vt[Ot].fn;return E},z.prototype.listenerCount=function(k){var Z=q?q+k:k,vt=this._events[Z];return vt?vt.fn?1:vt.length:0},z.prototype.emit=function(k,Z,vt,Ot,Nt,E){var L=q?q+k:k;if(!this._events[L])return!1;var O,Y,P=this._events[L],j=arguments.length;if(P.fn){switch(P.once&&this.removeListener(k,P.fn,void 0,!0),j){case 1:return P.fn.call(P.context),!0;case 2:return P.fn.call(P.context,Z),!0;case 3:return P.fn.call(P.context,Z,vt),!0;case 4:return P.fn.call(P.context,Z,vt,Ot),!0;case 5:return P.fn.call(P.context,Z,vt,Ot,Nt),!0;case 6:return P.fn.call(P.context,Z,vt,Ot,Nt,E),!0}for(Y=1,O=new Array(j-1);Y<j;Y++)O[Y-1]=arguments[Y];P.fn.apply(P.context,O)}else{var X,K=P.length;for(Y=0;Y<K;Y++)switch(P[Y].once&&this.removeListener(k,P[Y].fn,void 0,!0),j){case 1:P[Y].fn.call(P[Y].context);break;case 2:P[Y].fn.call(P[Y].context,Z);break;case 3:P[Y].fn.call(P[Y].context,Z,vt);break;case 4:P[Y].fn.call(P[Y].context,Z,vt,Ot);break;default:if(!O)for(X=1,O=new Array(j-1);X<j;X++)O[X-1]=arguments[X];P[Y].fn.apply(P[Y].context,O)}}return!0},z.prototype.on=function(k,Z,vt){return C(this,k,Z,vt,!1)},z.prototype.once=function(k,Z,vt){return C(this,k,Z,vt,!0)},z.prototype.removeListener=function(k,Z,vt,Ot){var Nt=q?q+k:k;if(!this._events[Nt])return this;if(!Z)return V(this,Nt),this;var E=this._events[Nt];if(E.fn)E.fn!==Z||Ot&&!E.once||vt&&E.context!==vt||V(this,Nt);else{for(var L=0,O=[],Y=E.length;L<Y;L++)(E[L].fn!==Z||Ot&&!E[L].once||vt&&E[L].context!==vt)&&O.push(E[L]);O.length?this._events[Nt]=O.length===1?O[0]:O:V(this,Nt)}return this},z.prototype.removeAllListeners=function(k){var Z;return k?(Z=q?q+k:k,this._events[Z]&&V(this,Z)):(this._events=new ht,this._eventsCount=0),this},z.prototype.off=z.prototype.removeListener,z.prototype.addListener=z.prototype.on,z.prefixed=q,z.EventEmitter=z,T.exports=z},function(T,M,v){var b;(function(q){function ht(P,j){var X=(65535&P)+(65535&j);return(P>>16)+(j>>16)+(X>>16)<<16|65535&X}function W(P,j,X,K,qt,ge){return ht((Ct=ht(ht(j,P),ht(K,ge)))<<(ot=qt)|Ct>>>32-ot,X);var Ct,ot}function C(P,j,X,K,qt,ge,Ct){return W(j&X|~j&K,P,j,qt,ge,Ct)}function V(P,j,X,K,qt,ge,Ct){return W(j&K|X&~K,P,j,qt,ge,Ct)}function z(P,j,X,K,qt,ge,Ct){return W(j^X^K,P,j,qt,ge,Ct)}function k(P,j,X,K,qt,ge,Ct){return W(X^(j|~K),P,j,qt,ge,Ct)}function Z(P,j){var X,K,qt,ge,Ct;P[j>>5]|=128<<j%32,P[14+(j+64>>>9<<4)]=j;var ot=1732584193,yt=-271733879,Pt=-1732584194,H=271733878;for(X=0;X<P.length;X+=16)K=ot,qt=yt,ge=Pt,Ct=H,ot=C(ot,yt,Pt,H,P[X],7,-680876936),H=C(H,ot,yt,Pt,P[X+1],12,-389564586),Pt=C(Pt,H,ot,yt,P[X+2],17,606105819),yt=C(yt,Pt,H,ot,P[X+3],22,-1044525330),ot=C(ot,yt,Pt,H,P[X+4],7,-176418897),H=C(H,ot,yt,Pt,P[X+5],12,1200080426),Pt=C(Pt,H,ot,yt,P[X+6],17,-1473231341),yt=C(yt,Pt,H,ot,P[X+7],22,-45705983),ot=C(ot,yt,Pt,H,P[X+8],7,1770035416),H=C(H,ot,yt,Pt,P[X+9],12,-1958414417),Pt=C(Pt,H,ot,yt,P[X+10],17,-42063),yt=C(yt,Pt,H,ot,P[X+11],22,-1990404162),ot=C(ot,yt,Pt,H,P[X+12],7,1804603682),H=C(H,ot,yt,Pt,P[X+13],12,-40341101),Pt=C(Pt,H,ot,yt,P[X+14],17,-1502002290),ot=V(ot,yt=C(yt,Pt,H,ot,P[X+15],22,1236535329),Pt,H,P[X+1],5,-165796510),H=V(H,ot,yt,Pt,P[X+6],9,-1069501632),Pt=V(Pt,H,ot,yt,P[X+11],14,643717713),yt=V(yt,Pt,H,ot,P[X],20,-373897302),ot=V(ot,yt,Pt,H,P[X+5],5,-701558691),H=V(H,ot,yt,Pt,P[X+10],9,38016083),Pt=V(Pt,H,ot,yt,P[X+15],14,-660478335),yt=V(yt,Pt,H,ot,P[X+4],20,-405537848),ot=V(ot,yt,Pt,H,P[X+9],5,568446438),H=V(H,ot,yt,Pt,P[X+14],9,-1019803690),Pt=V(Pt,H,ot,yt,P[X+3],14,-187363961),yt=V(yt,Pt,H,ot,P[X+8],20,1163531501),ot=V(ot,yt,Pt,H,P[X+13],5,-1444681467),H=V(H,ot,yt,Pt,P[X+2],9,-51403784),Pt=V(Pt,H,ot,yt,P[X+7],14,1735328473),ot=z(ot,yt=V(yt,Pt,H,ot,P[X+12],20,-1926607734),Pt,H,P[X+5],4,-378558),H=z(H,ot,yt,Pt,P[X+8],11,-2022574463),Pt=z(Pt,H,ot,yt,P[X+11],16,1839030562),yt=z(yt,Pt,H,ot,P[X+14],23,-35309556),ot=z(ot,yt,Pt,H,P[X+1],4,-1530992060),H=z(H,ot,yt,Pt,P[X+4],11,1272893353),Pt=z(Pt,H,ot,yt,P[X+7],16,-155497632),yt=z(yt,Pt,H,ot,P[X+10],23,-1094730640),ot=z(ot,yt,Pt,H,P[X+13],4,681279174),H=z(H,ot,yt,Pt,P[X],11,-358537222),Pt=z(Pt,H,ot,yt,P[X+3],16,-722521979),yt=z(yt,Pt,H,ot,P[X+6],23,76029189),ot=z(ot,yt,Pt,H,P[X+9],4,-640364487),H=z(H,ot,yt,Pt,P[X+12],11,-421815835),Pt=z(Pt,H,ot,yt,P[X+15],16,530742520),ot=k(ot,yt=z(yt,Pt,H,ot,P[X+2],23,-995338651),Pt,H,P[X],6,-198630844),H=k(H,ot,yt,Pt,P[X+7],10,1126891415),Pt=k(Pt,H,ot,yt,P[X+14],15,-1416354905),yt=k(yt,Pt,H,ot,P[X+5],21,-57434055),ot=k(ot,yt,Pt,H,P[X+12],6,1700485571),H=k(H,ot,yt,Pt,P[X+3],10,-1894986606),Pt=k(Pt,H,ot,yt,P[X+10],15,-1051523),yt=k(yt,Pt,H,ot,P[X+1],21,-2054922799),ot=k(ot,yt,Pt,H,P[X+8],6,1873313359),H=k(H,ot,yt,Pt,P[X+15],10,-30611744),Pt=k(Pt,H,ot,yt,P[X+6],15,-1560198380),yt=k(yt,Pt,H,ot,P[X+13],21,1309151649),ot=k(ot,yt,Pt,H,P[X+4],6,-145523070),H=k(H,ot,yt,Pt,P[X+11],10,-1120210379),Pt=k(Pt,H,ot,yt,P[X+2],15,718787259),yt=k(yt,Pt,H,ot,P[X+9],21,-343485551),ot=ht(ot,K),yt=ht(yt,qt),Pt=ht(Pt,ge),H=ht(H,Ct);return[ot,yt,Pt,H]}function vt(P){var j,X="",K=32*P.length;for(j=0;j<K;j+=8)X+=String.fromCharCode(P[j>>5]>>>j%32&255);return X}function Ot(P){var j,X=[];for(X[(P.length>>2)-1]=void 0,j=0;j<X.length;j+=1)X[j]=0;var K=8*P.length;for(j=0;j<K;j+=8)X[j>>5]|=(255&P.charCodeAt(j/8))<<j%32;return X}function Nt(P){var j,X,K="";for(X=0;X<P.length;X+=1)j=P.charCodeAt(X),K+="0123456789abcdef".charAt(j>>>4&15)+"0123456789abcdef".charAt(15&j);return K}function E(P){return unescape(encodeURIComponent(P))}function L(P){return function(j){return vt(Z(Ot(j),8*j.length))}(E(P))}function O(P,j){return function(X,K){var qt,ge,Ct=Ot(X),ot=[],yt=[];for(ot[15]=yt[15]=void 0,Ct.length>16&&(Ct=Z(Ct,8*X.length)),qt=0;qt<16;qt+=1)ot[qt]=909522486^Ct[qt],yt[qt]=1549556828^Ct[qt];return ge=Z(ot.concat(Ot(K)),512+8*K.length),vt(Z(yt.concat(ge),640))}(E(P),E(j))}function Y(P,j,X){return j?X?O(j,P):Nt(O(j,P)):X?L(P):Nt(L(P))}(b=function(){return Y}.call(M,v,M,T))===void 0||(T.exports=b)})()},function(T,M){var v;v=function(){return this}();try{v=v||new Function("return this")()}catch{typeof window=="object"&&(v=window)}T.exports=v},function(T,M,v){(function(b){T.exports=function q(ht,W,C){function V(Z,vt){if(!W[Z]){if(!ht[Z]){if(z)return z(Z,!0);var Ot=new Error("Cannot find module '"+Z+"'");throw Ot.code="MODULE_NOT_FOUND",Ot}var Nt=W[Z]={exports:{}};ht[Z][0].call(Nt.exports,function(E){var L=ht[Z][1][E];return V(L||E)},Nt,Nt.exports,q,ht,W,C)}return W[Z].exports}for(var z=!1,k=0;k<C.length;k++)V(C[k]);return V}({1:[function(q,ht,W){(function(C){var V,z,k=C.MutationObserver||C.WebKitMutationObserver;if(k){var Z=0,vt=new k(L),Ot=C.document.createTextNode("");vt.observe(Ot,{characterData:!0}),V=function(){Ot.data=Z=++Z%2}}else if(C.setImmediate||C.MessageChannel===void 0)V="document"in C&&"onreadystatechange"in C.document.createElement("script")?function(){var O=C.document.createElement("script");O.onreadystatechange=function(){L(),O.onreadystatechange=null,O.parentNode.removeChild(O),O=null},C.document.documentElement.appendChild(O)}:function(){setTimeout(L,0)};else{var Nt=new C.MessageChannel;Nt.port1.onmessage=L,V=function(){Nt.port2.postMessage(0)}}var E=[];function L(){var O,Y;z=!0;for(var P=E.length;P;){for(Y=E,E=[],O=-1;++O<P;)Y[O]();P=E.length}z=!1}ht.exports=function(O){E.push(O)!==1||z||V()}}).call(this,b!==void 0?b:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(q,ht,W){var C=q(1);function V(){}var z={},k=["REJECTED"],Z=["FULFILLED"],vt=["PENDING"];function Ot(P){if(typeof P!="function")throw new TypeError("resolver must be a function");this.state=vt,this.queue=[],this.outcome=void 0,P!==V&&O(this,P)}function Nt(P,j,X){this.promise=P,typeof j=="function"&&(this.onFulfilled=j,this.callFulfilled=this.otherCallFulfilled),typeof X=="function"&&(this.onRejected=X,this.callRejected=this.otherCallRejected)}function E(P,j,X){C(function(){var K;try{K=j(X)}catch(qt){return z.reject(P,qt)}K===P?z.reject(P,new TypeError("Cannot resolve promise with itself")):z.resolve(P,K)})}function L(P){var j=P&&P.then;if(P&&(typeof P=="object"||typeof P=="function")&&typeof j=="function")return function(){j.apply(P,arguments)}}function O(P,j){var X=!1;function K(Ct){X||(X=!0,z.reject(P,Ct))}function qt(Ct){X||(X=!0,z.resolve(P,Ct))}var ge=Y(function(){j(qt,K)});ge.status==="error"&&K(ge.value)}function Y(P,j){var X={};try{X.value=P(j),X.status="success"}catch(K){X.status="error",X.value=K}return X}ht.exports=Ot,Ot.prototype.catch=function(P){return this.then(null,P)},Ot.prototype.then=function(P,j){if(typeof P!="function"&&this.state===Z||typeof j!="function"&&this.state===k)return this;var X=new this.constructor(V);return this.state!==vt?E(X,this.state===Z?P:j,this.outcome):this.queue.push(new Nt(X,P,j)),X},Nt.prototype.callFulfilled=function(P){z.resolve(this.promise,P)},Nt.prototype.otherCallFulfilled=function(P){E(this.promise,this.onFulfilled,P)},Nt.prototype.callRejected=function(P){z.reject(this.promise,P)},Nt.prototype.otherCallRejected=function(P){E(this.promise,this.onRejected,P)},z.resolve=function(P,j){var X=Y(L,j);if(X.status==="error")return z.reject(P,X.value);var K=X.value;if(K)O(P,K);else{P.state=Z,P.outcome=j;for(var qt=-1,ge=P.queue.length;++qt<ge;)P.queue[qt].callFulfilled(j)}return P},z.reject=function(P,j){P.state=k,P.outcome=j;for(var X=-1,K=P.queue.length;++X<K;)P.queue[X].callRejected(j);return P},Ot.resolve=function(P){return P instanceof this?P:z.resolve(new this(V),P)},Ot.reject=function(P){var j=new this(V);return z.reject(j,P)},Ot.all=function(P){var j=this;if(Object.prototype.toString.call(P)!=="[object Array]")return this.reject(new TypeError("must be an array"));var X=P.length,K=!1;if(!X)return this.resolve([]);for(var qt=new Array(X),ge=0,Ct=-1,ot=new this(V);++Ct<X;)yt(P[Ct],Ct);return ot;function yt(Pt,H){j.resolve(Pt).then(function(ft){qt[H]=ft,++ge!==X||K||(K=!0,z.resolve(ot,qt))},function(ft){K||(K=!0,z.reject(ot,ft))})}},Ot.race=function(P){var j=this;if(Object.prototype.toString.call(P)!=="[object Array]")return this.reject(new TypeError("must be an array"));var X=P.length,K=!1;if(!X)return this.resolve([]);for(var qt,ge=-1,Ct=new this(V);++ge<X;)qt=P[ge],j.resolve(qt).then(function(ot){K||(K=!0,z.resolve(Ct,ot))},function(ot){K||(K=!0,z.reject(Ct,ot))});return Ct}},{1:1}],3:[function(q,ht,W){(function(C){typeof C.Promise!="function"&&(C.Promise=q(2))}).call(this,b!==void 0?b:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{2:2}],4:[function(q,ht,W){var C=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(J){return typeof J}:function(J){return J&&typeof Symbol=="function"&&J.constructor===Symbol&&J!==Symbol.prototype?"symbol":typeof J},V=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 z(J,st){J=J||[],st=st||{};try{return new Blob(J,st)}catch(bt){if(bt.name!=="TypeError")throw bt;for(var at=new(typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder),Tt=0;Tt<J.length;Tt+=1)at.append(J[Tt]);return at.getBlob(st.type)}}typeof Promise=="undefined"&&q(3);var k=Promise;function Z(J,st){st&&J.then(function(at){st(null,at)},function(at){st(at)})}function vt(J,st,at){typeof st=="function"&&J.then(st),typeof at=="function"&&J.catch(at)}function Ot(J){return typeof J!="string"&&(console.warn(J+" used as a key, but it is not a string."),J=String(J)),J}function Nt(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var E=void 0,L={},O=Object.prototype.toString;function Y(J){return typeof E=="boolean"?k.resolve(E):function(st){return new k(function(at){var Tt=st.transaction("local-forage-detect-blob-support","readwrite"),bt=z([""]);Tt.objectStore("local-forage-detect-blob-support").put(bt,"key"),Tt.onabort=function(wt){wt.preventDefault(),wt.stopPropagation(),at(!1)},Tt.oncomplete=function(){var wt=navigator.userAgent.match(/Chrome\/(\d+)/),zt=navigator.userAgent.match(/Edge\//);at(zt||!wt||parseInt(wt[1],10)>=43)}}).catch(function(){return!1})}(J).then(function(st){return E=st})}function P(J){var st=L[J.name],at={};at.promise=new k(function(Tt,bt){at.resolve=Tt,at.reject=bt}),st.deferredOperations.push(at),st.dbReady?st.dbReady=st.dbReady.then(function(){return at.promise}):st.dbReady=at.promise}function j(J){var st=L[J.name].deferredOperations.pop();if(st)return st.resolve(),st.promise}function X(J,st){var at=L[J.name].deferredOperations.pop();if(at)return at.reject(st),at.promise}function K(J,st){return new k(function(at,Tt){if(L[J.name]=L[J.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},J.db){if(!st)return at(J.db);P(J),J.db.close()}var bt=[J.name];st&&bt.push(J.version);var wt=V.open.apply(V,bt);st&&(wt.onupgradeneeded=function(zt){var ne=wt.result;try{ne.createObjectStore(J.storeName),zt.oldVersion<=1&&ne.createObjectStore("local-forage-detect-blob-support")}catch(se){if(se.name!=="ConstraintError")throw se;console.warn('The database "'+J.name+'" has been upgraded from version '+zt.oldVersion+" to version "+zt.newVersion+', but the storage "'+J.storeName+'" already exists.')}}),wt.onerror=function(zt){zt.preventDefault(),Tt(wt.error)},wt.onsuccess=function(){var zt=wt.result;zt.onversionchange=function(ne){ne.target.close()},at(zt),j(J)}})}function qt(J){return K(J,!1)}function ge(J){return K(J,!0)}function Ct(J,st){if(!J.db)return!0;var at=!J.db.objectStoreNames.contains(J.storeName),Tt=J.version<J.db.version,bt=J.version>J.db.version;if(Tt&&(J.version!==st&&console.warn('The database "'+J.name+`" can't be downgraded from version `+J.db.version+" to version "+J.version+"."),J.version=J.db.version),bt||at){if(at){var wt=J.db.version+1;wt>J.version&&(J.version=wt)}return!0}return!1}function ot(J){return z([function(st){for(var at=st.length,Tt=new ArrayBuffer(at),bt=new Uint8Array(Tt),wt=0;wt<at;wt++)bt[wt]=st.charCodeAt(wt);return Tt}(atob(J.data))],{type:J.type})}function yt(J){return J&&J.__local_forage_encoded_blob}function Pt(J){var st=this,at=st._initReady().then(function(){var Tt=L[st._dbInfo.name];if(Tt&&Tt.dbReady)return Tt.dbReady});return vt(at,J,J),at}function H(J,st,at,Tt){Tt===void 0&&(Tt=1);try{var bt=J.db.transaction(J.storeName,st);at(null,bt)}catch(wt){if(Tt>0&&(!J.db||wt.name==="InvalidStateError"||wt.name==="NotFoundError"))return k.resolve().then(function(){if(!J.db||wt.name==="NotFoundError"&&!J.db.objectStoreNames.contains(J.storeName)&&J.version<=J.db.version)return J.db&&(J.version=J.db.version+1),ge(J)}).then(function(){return function(zt){P(zt);for(var ne=L[zt.name],se=ne.forages,ae=0;ae<se.length;ae++){var xe=se[ae];xe._dbInfo.db&&(xe._dbInfo.db.close(),xe._dbInfo.db=null)}return zt.db=null,qt(zt).then(function(Ie){return zt.db=Ie,Ct(zt)?ge(zt):Ie}).then(function(Ie){zt.db=ne.db=Ie;for(var Ge=0;Ge<se.length;Ge++)se[Ge]._dbInfo.db=Ie}).catch(function(Ie){throw X(zt,Ie),Ie})}(J).then(function(){H(J,st,at,Tt-1)})}).catch(at);at(wt)}}var ft={_driver:"asyncStorage",_initStorage:function(J){var st=this,at={db:null};if(J)for(var Tt in J)at[Tt]=J[Tt];var bt=L[at.name];bt||(bt={forages:[],db:null,dbReady:null,deferredOperations:[]},L[at.name]=bt),bt.forages.push(st),st._initReady||(st._initReady=st.ready,st.ready=Pt);var wt=[];function zt(){return k.resolve()}for(var ne=0;ne<bt.forages.length;ne++){var se=bt.forages[ne];se!==st&&wt.push(se._initReady().catch(zt))}var ae=bt.forages.slice(0);return k.all(wt).then(function(){return at.db=bt.db,qt(at)}).then(function(xe){return at.db=xe,Ct(at,st._defaultConfig.version)?ge(at):xe}).then(function(xe){at.db=bt.db=xe,st._dbInfo=at;for(var Ie=0;Ie<ae.length;Ie++){var Ge=ae[Ie];Ge!==st&&(Ge._dbInfo.db=at.db,Ge._dbInfo.version=at.version)}})},_support:function(){try{if(!V||!V.open)return!1;var J=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),st=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!J||st)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch{return!1}}(),iterate:function(J,st){var at=this,Tt=new k(function(bt,wt){at.ready().then(function(){H(at._dbInfo,"readonly",function(zt,ne){if(zt)return wt(zt);try{var se=ne.objectStore(at._dbInfo.storeName).openCursor(),ae=1;se.onsuccess=function(){var xe=se.result;if(xe){var Ie=xe.value;yt(Ie)&&(Ie=ot(Ie));var Ge=J(Ie,xe.key,ae++);Ge!==void 0?bt(Ge):xe.continue()}else bt()},se.onerror=function(){wt(se.error)}}catch(xe){wt(xe)}})}).catch(wt)});return Z(Tt,st),Tt},getItem:function(J,st){var at=this;J=Ot(J);var Tt=new k(function(bt,wt){at.ready().then(function(){H(at._dbInfo,"readonly",function(zt,ne){if(zt)return wt(zt);try{var se=ne.objectStore(at._dbInfo.storeName).get(J);se.onsuccess=function(){var ae=se.result;ae===void 0&&(ae=null),yt(ae)&&(ae=ot(ae)),bt(ae)},se.onerror=function(){wt(se.error)}}catch(ae){wt(ae)}})}).catch(wt)});return Z(Tt,st),Tt},setItem:function(J,st,at){var Tt=this;J=Ot(J);var bt=new k(function(wt,zt){var ne;Tt.ready().then(function(){return ne=Tt._dbInfo,O.call(st)==="[object Blob]"?Y(ne.db).then(function(se){return se?st:(ae=st,new k(function(xe,Ie){var Ge=new FileReader;Ge.onerror=Ie,Ge.onloadend=function(qe){var pi=btoa(qe.target.result||"");xe({__local_forage_encoded_blob:!0,data:pi,type:ae.type})},Ge.readAsBinaryString(ae)}));var ae}):st}).then(function(se){H(Tt._dbInfo,"readwrite",function(ae,xe){if(ae)return zt(ae);try{var Ie=xe.objectStore(Tt._dbInfo.storeName);se===null&&(se=void 0);var Ge=Ie.put(se,J);xe.oncomplete=function(){se===void 0&&(se=null),wt(se)},xe.onabort=xe.onerror=function(){var qe=Ge.error?Ge.error:Ge.transaction.error;zt(qe)}}catch(qe){zt(qe)}})}).catch(zt)});return Z(bt,at),bt},removeItem:function(J,st){var at=this;J=Ot(J);var Tt=new k(function(bt,wt){at.ready().then(function(){H(at._dbInfo,"readwrite",function(zt,ne){if(zt)return wt(zt);try{var se=ne.objectStore(at._dbInfo.storeName).delete(J);ne.oncomplete=function(){bt()},ne.onerror=function(){wt(se.error)},ne.onabort=function(){var ae=se.error?se.error:se.transaction.error;wt(ae)}}catch(ae){wt(ae)}})}).catch(wt)});return Z(Tt,st),Tt},clear:function(J){var st=this,at=new k(function(Tt,bt){st.ready().then(function(){H(st._dbInfo,"readwrite",function(wt,zt){if(wt)return bt(wt);try{var ne=zt.objectStore(st._dbInfo.storeName).clear();zt.oncomplete=function(){Tt()},zt.onabort=zt.onerror=function(){var se=ne.error?ne.error:ne.transaction.error;bt(se)}}catch(se){bt(se)}})}).catch(bt)});return Z(at,J),at},length:function(J){var st=this,at=new k(function(Tt,bt){st.ready().then(function(){H(st._dbInfo,"readonly",function(wt,zt){if(wt)return bt(wt);try{var ne=zt.objectStore(st._dbInfo.storeName).count();ne.onsuccess=function(){Tt(ne.result)},ne.onerror=function(){bt(ne.error)}}catch(se){bt(se)}})}).catch(bt)});return Z(at,J),at},key:function(J,st){var at=this,Tt=new k(function(bt,wt){J<0?bt(null):at.ready().then(function(){H(at._dbInfo,"readonly",function(zt,ne){if(zt)return wt(zt);try{var se=ne.objectStore(at._dbInfo.storeName),ae=!1,xe=se.openKeyCursor();xe.onsuccess=function(){var Ie=xe.result;Ie?J===0||ae?bt(Ie.key):(ae=!0,Ie.advance(J)):bt(null)},xe.onerror=function(){wt(xe.error)}}catch(Ie){wt(Ie)}})}).catch(wt)});return Z(Tt,st),Tt},keys:function(J){var st=this,at=new k(function(Tt,bt){st.ready().then(function(){H(st._dbInfo,"readonly",function(wt,zt){if(wt)return bt(wt);try{var ne=zt.objectStore(st._dbInfo.storeName).openKeyCursor(),se=[];ne.onsuccess=function(){var ae=ne.result;ae?(se.push(ae.key),ae.continue()):Tt(se)},ne.onerror=function(){bt(ne.error)}}catch(ae){bt(ae)}})}).catch(bt)});return Z(at,J),at},dropInstance:function(J,st){st=Nt.apply(this,arguments);var at=this.config();(J=typeof J!="function"&&J||{}).name||(J.name=J.name||at.name,J.storeName=J.storeName||at.storeName);var Tt,bt=this;if(J.name){var wt=J.name===at.name&&bt._dbInfo.db,zt=wt?k.resolve(bt._dbInfo.db):qt(J).then(function(ne){var se=L[J.name],ae=se.forages;se.db=ne;for(var xe=0;xe<ae.length;xe++)ae[xe]._dbInfo.db=ne;return ne});Tt=J.storeName?zt.then(function(ne){if(ne.objectStoreNames.contains(J.storeName)){var se=ne.version+1;P(J);var ae=L[J.name],xe=ae.forages;ne.close();for(var Ie=0;Ie<xe.length;Ie++){var Ge=xe[Ie];Ge._dbInfo.db=null,Ge._dbInfo.version=se}return new k(function(qe,pi){var fi=V.open(J.name,se);fi.onerror=function(Sr){fi.result.close(),pi(Sr)},fi.onupgradeneeded=function(){fi.result.deleteObjectStore(J.storeName)},fi.onsuccess=function(){var Sr=fi.result;Sr.close(),qe(Sr)}}).then(function(qe){ae.db=qe;for(var pi=0;pi<xe.length;pi++){var fi=xe[pi];fi._dbInfo.db=qe,j(fi._dbInfo)}}).catch(function(qe){throw(X(J,qe)||k.resolve()).catch(function(){}),qe})}}):zt.then(function(ne){P(J);var se=L[J.name],ae=se.forages;ne.close();for(var xe=0;xe<ae.length;xe++)ae[xe]._dbInfo.db=null;return new k(function(Ie,Ge){var qe=V.deleteDatabase(J.name);qe.onerror=function(){var pi=qe.result;pi&&pi.close(),Ge(qe.error)},qe.onblocked=function(){console.warn('dropInstance blocked for database "'+J.name+'" until all open connections are closed')},qe.onsuccess=function(){var pi=qe.result;pi&&pi.close(),Ie(pi)}}).then(function(Ie){se.db=Ie;for(var Ge=0;Ge<ae.length;Ge++)j(ae[Ge]._dbInfo)}).catch(function(Ie){throw(X(J,Ie)||k.resolve()).catch(function(){}),Ie})})}else Tt=k.reject("Invalid arguments");return Z(Tt,st),Tt}},Et="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",At=/^~~local_forage_type~([^~]+)~/,Rt=9,Wt=Rt+4,$t=Object.prototype.toString;function ye(J){var st,at,Tt,bt,wt,zt=.75*J.length,ne=J.length,se=0;J[J.length-1]==="="&&(zt--,J[J.length-2]==="="&&zt--);var ae=new ArrayBuffer(zt),xe=new Uint8Array(ae);for(st=0;st<ne;st+=4)at=Et.indexOf(J[st]),Tt=Et.indexOf(J[st+1]),bt=Et.indexOf(J[st+2]),wt=Et.indexOf(J[st+3]),xe[se++]=at<<2|Tt>>4,xe[se++]=(15&Tt)<<4|bt>>2,xe[se++]=(3&bt)<<6|63&wt;return ae}function me(J){var st,at=new Uint8Array(J),Tt="";for(st=0;st<at.length;st+=3)Tt+=Et[at[st]>>2],Tt+=Et[(3&at[st])<<4|at[st+1]>>4],Tt+=Et[(15&at[st+1])<<2|at[st+2]>>6],Tt+=Et[63&at[st+2]];return at.length%3==2?Tt=Tt.substring(0,Tt.length-1)+"=":at.length%3==1&&(Tt=Tt.substring(0,Tt.length-2)+"=="),Tt}var ui={serialize:function(J,st){var at="";if(J&&(at=$t.call(J)),J&&(at==="[object ArrayBuffer]"||J.buffer&&$t.call(J.buffer)==="[object ArrayBuffer]")){var Tt,bt="__lfsc__:";J instanceof ArrayBuffer?(Tt=J,bt+="arbf"):(Tt=J.buffer,at==="[object Int8Array]"?bt+="si08":at==="[object Uint8Array]"?bt+="ui08":at==="[object Uint8ClampedArray]"?bt+="uic8":at==="[object Int16Array]"?bt+="si16":at==="[object Uint16Array]"?bt+="ur16":at==="[object Int32Array]"?bt+="si32":at==="[object Uint32Array]"?bt+="ui32":at==="[object Float32Array]"?bt+="fl32":at==="[object Float64Array]"?bt+="fl64":st(new Error("Failed to get type for BinaryArray"))),st(bt+me(Tt))}else if(at==="[object Blob]"){var wt=new FileReader;wt.onload=function(){var zt="~~local_forage_type~"+J.type+"~"+me(this.result);st("__lfsc__:blob"+zt)},wt.readAsArrayBuffer(J)}else try{st(JSON.stringify(J))}catch(zt){console.error("Couldn't convert value into a JSON string: ",J),st(null,zt)}},deserialize:function(J){if(J.substring(0,Rt)!=="__lfsc__:")return JSON.parse(J);var st,at=J.substring(Wt),Tt=J.substring(Rt,Wt);if(Tt==="blob"&&At.test(at)){var bt=at.match(At);st=bt[1],at=at.substring(bt[0].length)}var wt=ye(at);switch(Tt){case"arbf":return wt;case"blob":return z([wt],{type:st});case"si08":return new Int8Array(wt);case"ui08":return new Uint8Array(wt);case"uic8":return new Uint8ClampedArray(wt);case"si16":return new Int16Array(wt);case"ur16":return new Uint16Array(wt);case"si32":return new Int32Array(wt);case"ui32":return new Uint32Array(wt);case"fl32":return new Float32Array(wt);case"fl64":return new Float64Array(wt);default:throw new Error("Unkown type: "+Tt)}},stringToBuffer:ye,bufferToString:me};function be(J,st,at,Tt){J.executeSql("CREATE TABLE IF NOT EXISTS "+st.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],at,Tt)}function ei(J,st,at,Tt,bt,wt){J.executeSql(at,Tt,bt,function(zt,ne){ne.code===ne.SYNTAX_ERR?zt.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[st.storeName],function(se,ae){ae.rows.length?wt(se,ne):be(se,st,function(){se.executeSql(at,Tt,bt,wt)},wt)},wt):wt(zt,ne)},wt)}function Ze(J,st,at,Tt){var bt=this;J=Ot(J);var wt=new k(function(zt,ne){bt.ready().then(function(){st===void 0&&(st=null);var se=st,ae=bt._dbInfo;ae.serializer.serialize(st,function(xe,Ie){Ie?ne(Ie):ae.db.transaction(function(Ge){ei(Ge,ae,"INSERT OR REPLACE INTO "+ae.storeName+" (key, value) VALUES (?, ?)",[J,xe],function(){zt(se)},function(qe,pi){ne(pi)})},function(Ge){if(Ge.code===Ge.QUOTA_ERR){if(Tt>0)return void zt(Ze.apply(bt,[J,se,at,Tt-1]));ne(Ge)}})})}).catch(ne)});return Z(wt,at),wt}function ri(J){return new k(function(st,at){J.transaction(function(Tt){Tt.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(bt,wt){for(var zt=[],ne=0;ne<wt.rows.length;ne++)zt.push(wt.rows.item(ne).name);st({db:J,storeNames:zt})},function(bt,wt){at(wt)})},function(Tt){at(Tt)})})}var De={_driver:"webSQLStorage",_initStorage:function(J){var st=this,at={db:null};if(J)for(var Tt in J)at[Tt]=typeof J[Tt]!="string"?J[Tt].toString():J[Tt];var bt=new k(function(wt,zt){try{at.db=openDatabase(at.name,String(at.version),at.description,at.size)}catch(ne){return zt(ne)}at.db.transaction(function(ne){be(ne,at,function(){st._dbInfo=at,wt()},function(se,ae){zt(ae)})},zt)});return at.serializer=ui,bt},_support:typeof openDatabase=="function",iterate:function(J,st){var at=this,Tt=new k(function(bt,wt){at.ready().then(function(){var zt=at._dbInfo;zt.db.transaction(function(ne){ei(ne,zt,"SELECT * FROM "+zt.storeName,[],function(se,ae){for(var xe=ae.rows,Ie=xe.length,Ge=0;Ge<Ie;Ge++){var qe=xe.item(Ge),pi=qe.value;if(pi&&(pi=zt.serializer.deserialize(pi)),(pi=J(pi,qe.key,Ge+1))!==void 0)return void bt(pi)}bt()},function(se,ae){wt(ae)})})}).catch(wt)});return Z(Tt,st),Tt},getItem:function(J,st){var at=this;J=Ot(J);var Tt=new k(function(bt,wt){at.ready().then(function(){var zt=at._dbInfo;zt.db.transaction(function(ne){ei(ne,zt,"SELECT * FROM "+zt.storeName+" WHERE key = ? LIMIT 1",[J],function(se,ae){var xe=ae.rows.length?ae.rows.item(0).value:null;xe&&(xe=zt.serializer.deserialize(xe)),bt(xe)},function(se,ae){wt(ae)})})}).catch(wt)});return Z(Tt,st),Tt},setItem:function(J,st,at){return Ze.apply(this,[J,st,at,1])},removeItem:function(J,st){var at=this;J=Ot(J);var Tt=new k(function(bt,wt){at.ready().then(function(){var zt=at._dbInfo;zt.db.transaction(function(ne){ei(ne,zt,"DELETE FROM "+zt.storeName+" WHERE key = ?",[J],function(){bt()},function(se,ae){wt(ae)})})}).catch(wt)});return Z(Tt,st),Tt},clear:function(J){var st=this,at=new k(function(Tt,bt){st.ready().then(function(){var wt=st._dbInfo;wt.db.transaction(function(zt){ei(zt,wt,"DELETE FROM "+wt.storeName,[],function(){Tt()},function(ne,se){bt(se)})})}).catch(bt)});return Z(at,J),at},length:function(J){var st=this,at=new k(function(Tt,bt){st.ready().then(function(){var wt=st._dbInfo;wt.db.transaction(function(zt){ei(zt,wt,"SELECT COUNT(key) as c FROM "+wt.storeName,[],function(ne,se){var ae=se.rows.item(0).c;Tt(ae)},function(ne,se){bt(se)})})}).catch(bt)});return Z(at,J),at},key:function(J,st){var at=this,Tt=new k(function(bt,wt){at.ready().then(function(){var zt=at._dbInfo;zt.db.transaction(function(ne){ei(ne,zt,"SELECT key FROM "+zt.storeName+" WHERE id = ? LIMIT 1",[J+1],function(se,ae){var xe=ae.rows.length?ae.rows.item(0).key:null;bt(xe)},function(se,ae){wt(ae)})})}).catch(wt)});return Z(Tt,st),Tt},keys:function(J){var st=this,at=new k(function(Tt,bt){st.ready().then(function(){var wt=st._dbInfo;wt.db.transaction(function(zt){ei(zt,wt,"SELECT key FROM "+wt.storeName,[],function(ne,se){for(var ae=[],xe=0;xe<se.rows.length;xe++)ae.push(se.rows.item(xe).key);Tt(ae)},function(ne,se){bt(se)})})}).catch(bt)});return Z(at,J),at},dropInstance:function(J,st){st=Nt.apply(this,arguments);var at=this.config();(J=typeof J!="function"&&J||{}).name||(J.name=J.name||at.name,J.storeName=J.storeName||at.storeName);var Tt,bt=this;return Z(Tt=J.name?new k(function(wt){var zt;zt=J.name===at.name?bt._dbInfo.db:openDatabase(J.name,"","",0),J.storeName?wt({db:zt,storeNames:[J.storeName]}):wt(ri(zt))}).then(function(wt){return new k(function(zt,ne){wt.db.transaction(function(se){function ae(qe){return new k(function(pi,fi){se.executeSql("DROP TABLE IF EXISTS "+qe,[],function(){pi()},function(Sr,Lo){fi(Lo)})})}for(var xe=[],Ie=0,Ge=wt.storeNames.length;Ie<Ge;Ie++)xe.push(ae(wt.storeNames[Ie]));k.all(xe).then(function(){zt()}).catch(function(qe){ne(qe)})},function(se){ne(se)})})}):k.reject("Invalid arguments"),st),Tt}};function Bi(J,st){var at=J.name+"/";return J.storeName!==st.storeName&&(at+=J.storeName+"/"),at}function Di(){return!function(){try{return localStorage.setItem("_localforage_support_test",!0),localStorage.removeItem("_localforage_support_test"),!1}catch{return!0}}()||localStorage.length>0}var Ci={_driver:"localStorageWrapper",_initStorage:function(J){var st={};if(J)for(var at in J)st[at]=J[at];return st.keyPrefix=Bi(J,this._defaultConfig),Di()?(this._dbInfo=st,st.serializer=ui,k.resolve()):k.reject()},_support:function(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}(),iterate:function(J,st){var at=this,Tt=at.ready().then(function(){for(var bt=at._dbInfo,wt=bt.keyPrefix,zt=wt.length,ne=localStorage.length,se=1,ae=0;ae<ne;ae++){var xe=localStorage.key(ae);if(xe.indexOf(wt)===0){var Ie=localStorage.getItem(xe);if(Ie&&(Ie=bt.serializer.deserialize(Ie)),(Ie=J(Ie,xe.substring(zt),se++))!==void 0)return Ie}}});return Z(Tt,st),Tt},getItem:function(J,st){var at=this;J=Ot(J);var Tt=at.ready().then(function(){var bt=at._dbInfo,wt=localStorage.getItem(bt.keyPrefix+J);return wt&&(wt=bt.serializer.deserialize(wt)),wt});return Z(Tt,st),Tt},setItem:function(J,st,at){var Tt=this;J=Ot(J);var bt=Tt.ready().then(function(){st===void 0&&(st=null);var wt=st;return new k(function(zt,ne){var se=Tt._dbInfo;se.serializer.serialize(st,function(ae,xe){if(xe)ne(xe);else try{localStorage.setItem(se.keyPrefix+J,ae),zt(wt)}catch(Ie){Ie.name!=="QuotaExceededError"&&Ie.name!=="NS_ERROR_DOM_QUOTA_REACHED"||ne(Ie),ne(Ie)}})})});return Z(bt,at),bt},removeItem:function(J,st){var at=this;J=Ot(J);var Tt=at.ready().then(function(){var bt=at._dbInfo;localStorage.removeItem(bt.keyPrefix+J)});return Z(Tt,st),Tt},clear:function(J){var st=this,at=st.ready().then(function(){for(var Tt=st._dbInfo.keyPrefix,bt=localStorage.length-1;bt>=0;bt--){var wt=localStorage.key(bt);wt.indexOf(Tt)===0&&localStorage.removeItem(wt)}});return Z(at,J),at},length:function(J){var st=this.keys().then(function(at){return at.length});return Z(st,J),st},key:function(J,st){var at=this,Tt=at.ready().then(function(){var bt,wt=at._dbInfo;try{bt=localStorage.key(J)}catch{bt=null}return bt&&(bt=bt.substring(wt.keyPrefix.length)),bt});return Z(Tt,st),Tt},keys:function(J){var st=this,at=st.ready().then(function(){for(var Tt=st._dbInfo,bt=localStorage.length,wt=[],zt=0;zt<bt;zt++){var ne=localStorage.key(zt);ne.indexOf(Tt.keyPrefix)===0&&wt.push(ne.substring(Tt.keyPrefix.length))}return wt});return Z(at,J),at},dropInstance:function(J,st){if(st=Nt.apply(this,arguments),!(J=typeof J!="function"&&J||{}).name){var at=this.config();J.name=J.name||at.name,J.storeName=J.storeName||at.storeName}var Tt,bt=this;return Z(Tt=J.name?new k(function(wt){J.storeName?wt(Bi(J,bt._defaultConfig)):wt(J.name+"/")}).then(function(wt){for(var zt=localStorage.length-1;zt>=0;zt--){var ne=localStorage.key(zt);ne.indexOf(wt)===0&&localStorage.removeItem(ne)}}):k.reject("Invalid arguments"),st),Tt}},Ki=function(J,st){for(var at,Tt,bt=J.length,wt=0;wt<bt;){if((at=J[wt])===(Tt=st)||typeof at=="number"&&typeof Tt=="number"&&isNaN(at)&&isNaN(Tt))return!0;wt++}return!1},Ii=Array.isArray||function(J){return Object.prototype.toString.call(J)==="[object Array]"},Ui={},On={},Qi={INDEXEDDB:ft,WEBSQL:De,LOCALSTORAGE:Ci},Yn=[Qi.INDEXEDDB._driver,Qi.WEBSQL._driver,Qi.LOCALSTORAGE._driver],$n=["dropInstance"],La=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat($n),Hs={description:"",driver:Yn.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function zu(J,st){J[st]=function(){var at=arguments;return J.ready().then(function(){return J[st].apply(J,at)})}}function Oa(){for(var J=1;J<arguments.length;J++){var st=arguments[J];if(st)for(var at in st)st.hasOwnProperty(at)&&(Ii(st[at])?arguments[0][at]=st[at].slice():arguments[0][at]=st[at])}return arguments[0]}var Zr=new(function(){function J(st){for(var at in function(wt,zt){if(!(wt instanceof zt))throw new TypeError("Cannot call a class as a function")}(this,J),Qi)if(Qi.hasOwnProperty(at)){var Tt=Qi[at],bt=Tt._driver;this[at]=bt,Ui[bt]||this.defineDriver(Tt)}this._defaultConfig=Oa({},Hs),this._config=Oa({},this._defaultConfig,st),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return J.prototype.config=function(st){if((st===void 0?"undefined":C(st))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var at in st){if(at==="storeName"&&(st[at]=st[at].replace(/\W/g,"_")),at==="version"&&typeof st[at]!="number")return new Error("Database version must be a number.");this._config[at]=st[at]}return!("driver"in st)||!st.driver||this.setDriver(this._config.driver)}return typeof st=="string"?this._config[st]:this._config},J.prototype.defineDriver=function(st,at,Tt){var bt=new k(function(wt,zt){try{var ne=st._driver,se=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!st._driver)return void zt(se);for(var ae=La.concat("_initStorage"),xe=0,Ie=ae.length;xe<Ie;xe++){var Ge=ae[xe];if((!Ki($n,Ge)||st[Ge])&&typeof st[Ge]!="function")return void zt(se)}(function(){for(var pi=function(zs){return function(){var Cl=new Error("Method "+zs+" is not implemented by the current driver"),qi=k.reject(Cl);return Z(qi,arguments[arguments.length-1]),qi}},fi=0,Sr=$n.length;fi<Sr;fi++){var Lo=$n[fi];st[Lo]||(st[Lo]=pi(Lo))}})();var qe=function(pi){Ui[ne]&&console.info("Redefining LocalForage driver: "+ne),Ui[ne]=st,On[ne]=pi,wt()};"_support"in st?st._support&&typeof st._support=="function"?st._support().then(qe,zt):qe(!!st._support):qe(!0)}catch(pi){zt(pi)}});return vt(bt,at,Tt),bt},J.prototype.driver=function(){return this._driver||null},J.prototype.getDriver=function(st,at,Tt){var bt=Ui[st]?k.resolve(Ui[st]):k.reject(new Error("Driver not found."));return vt(bt,at,Tt),bt},J.prototype.getSerializer=function(st){var at=k.resolve(ui);return vt(at,st),at},J.prototype.ready=function(st){var at=this,Tt=at._driverSet.then(function(){return at._ready===null&&(at._ready=at._initDriver()),at._ready});return vt(Tt,st,st),Tt},J.prototype.setDriver=function(st,at,Tt){var bt=this;Ii(st)||(st=[st]);var wt=this._getSupportedDrivers(st);function zt(){bt._config.driver=bt.driver()}function ne(ae){return bt._extend(ae),zt(),bt._ready=bt._initStorage(bt._config),bt._ready}var se=this._driverSet!==null?this._driverSet.catch(function(){return k.resolve()}):k.resolve();return this._driverSet=se.then(function(){var ae=wt[0];return bt._dbInfo=null,bt._ready=null,bt.getDriver(ae).then(function(xe){bt._driver=xe._driver,zt(),bt._wrapLibraryMethodsWithReady(),bt._initDriver=function(Ie){return function(){var Ge=0;return function qe(){for(;Ge<Ie.length;){var pi=Ie[Ge];return Ge++,bt._dbInfo=null,bt._ready=null,bt.getDriver(pi).then(ne).catch(qe)}zt();var fi=new Error("No available storage method found.");return bt._driverSet=k.reject(fi),bt._driverSet}()}}(wt)})}).catch(function(){zt();var ae=new Error("No available storage method found.");return bt._driverSet=k.reject(ae),bt._driverSet}),vt(this._driverSet,at,Tt),this._driverSet},J.prototype.supports=function(st){return!!On[st]},J.prototype._extend=function(st){Oa(this,st)},J.prototype._getSupportedDrivers=function(st){for(var at=[],Tt=0,bt=st.length;Tt<bt;Tt++){var wt=st[Tt];this.supports(wt)&&at.push(wt)}return at},J.prototype._wrapLibraryMethodsWithReady=function(){for(var st=0,at=La.length;st<at;st++)zu(this,La[st])},J.prototype.createInstance=function(st){return new J(st)},J}());ht.exports=Zr},{3:3}]},{},[4])(4)}).call(this,v(3))},function(T,M,v){var b=v(57),q=v(58);function ht(){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}M.parse=P,M.resolve=function(j,X){return P(j,!1,!0).resolve(X)},M.resolveObject=function(j,X){return j?P(j,!1,!0).resolveObject(X):X},M.format=function(j){return q.isString(j)&&(j=P(j)),j instanceof ht?j.format():ht.prototype.format.call(j)},M.Url=ht;var W=/^([a-z0-9.+-]+:)/i,C=/:[0-9]*$/,V=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,z=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
28
|
-
`," "]),k=["'"].concat(z),Z=["%","/","?",";","#"].concat(k),vt=["/","?","#"],Ot=/^[+a-z0-9A-Z_-]{0,63}$/,Nt=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,E={javascript:!0,"javascript:":!0},L={javascript:!0,"javascript:":!0},O={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Y=v(59);function P(j,X,K){if(j&&q.isObject(j)&&j instanceof ht)return j;var qt=new ht;return qt.parse(j,X,K),qt}ht.prototype.parse=function(j,X,K){if(!q.isString(j))throw new TypeError("Parameter 'url' must be a string, not "+typeof j);var qt=j.indexOf("?"),ge=qt!==-1&&qt<j.indexOf("#")?"?":"#",Ct=j.split(ge);Ct[0]=Ct[0].replace(/\\/g,"/");var ot=j=Ct.join(ge);if(ot=ot.trim(),!K&&j.split("#").length===1){var yt=V.exec(ot);if(yt)return this.path=ot,this.href=ot,this.pathname=yt[1],yt[2]?(this.search=yt[2],this.query=X?Y.parse(this.search.substr(1)):this.search.substr(1)):X&&(this.search="",this.query={}),this}var Pt=W.exec(ot);if(Pt){var H=(Pt=Pt[0]).toLowerCase();this.protocol=H,ot=ot.substr(Pt.length)}if(K||Pt||ot.match(/^\/\/[^@\/]+@[^@\/]+/)){var ft=ot.substr(0,2)==="//";!ft||Pt&&L[Pt]||(ot=ot.substr(2),this.slashes=!0)}if(!L[Pt]&&(ft||Pt&&!O[Pt])){for(var Et,At,Rt=-1,Wt=0;Wt<vt.length;Wt++)($t=ot.indexOf(vt[Wt]))!==-1&&(Rt===-1||$t<Rt)&&(Rt=$t);for((At=Rt===-1?ot.lastIndexOf("@"):ot.lastIndexOf("@",Rt))!==-1&&(Et=ot.slice(0,At),ot=ot.slice(At+1),this.auth=decodeURIComponent(Et)),Rt=-1,Wt=0;Wt<Z.length;Wt++){var $t;($t=ot.indexOf(Z[Wt]))!==-1&&(Rt===-1||$t<Rt)&&(Rt=$t)}Rt===-1&&(Rt=ot.length),this.host=ot.slice(0,Rt),ot=ot.slice(Rt),this.parseHost(),this.hostname=this.hostname||"";var ye=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!ye)for(var me=this.hostname.split(/\./),ui=(Wt=0,me.length);Wt<ui;Wt++){var be=me[Wt];if(be&&!be.match(Ot)){for(var ei="",Ze=0,ri=be.length;Ze<ri;Ze++)be.charCodeAt(Ze)>127?ei+="x":ei+=be[Ze];if(!ei.match(Ot)){var De=me.slice(0,Wt),Bi=me.slice(Wt+1),Di=be.match(Nt);Di&&(De.push(Di[1]),Bi.unshift(Di[2])),Bi.length&&(ot="/"+Bi.join(".")+ot),this.hostname=De.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),ye||(this.hostname=b.toASCII(this.hostname));var Ci=this.port?":"+this.port:"",Ki=this.hostname||"";this.host=Ki+Ci,this.href+=this.host,ye&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),ot[0]!=="/"&&(ot="/"+ot))}if(!E[H])for(Wt=0,ui=k.length;Wt<ui;Wt++){var Ii=k[Wt];if(ot.indexOf(Ii)!==-1){var Ui=encodeURIComponent(Ii);Ui===Ii&&(Ui=escape(Ii)),ot=ot.split(Ii).join(Ui)}}var On=ot.indexOf("#");On!==-1&&(this.hash=ot.substr(On),ot=ot.slice(0,On));var Qi=ot.indexOf("?");if(Qi!==-1?(this.search=ot.substr(Qi),this.query=ot.substr(Qi+1),X&&(this.query=Y.parse(this.query)),ot=ot.slice(0,Qi)):X&&(this.search="",this.query={}),ot&&(this.pathname=ot),O[H]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){Ci=this.pathname||"";var Yn=this.search||"";this.path=Ci+Yn}return this.href=this.format(),this},ht.prototype.format=function(){var j=this.auth||"";j&&(j=(j=encodeURIComponent(j)).replace(/%3A/i,":"),j+="@");var X=this.protocol||"",K=this.pathname||"",qt=this.hash||"",ge=!1,Ct="";this.host?ge=j+this.host:this.hostname&&(ge=j+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(ge+=":"+this.port)),this.query&&q.isObject(this.query)&&Object.keys(this.query).length&&(Ct=Y.stringify(this.query));var ot=this.search||Ct&&"?"+Ct||"";return X&&X.substr(-1)!==":"&&(X+=":"),this.slashes||(!X||O[X])&&ge!==!1?(ge="//"+(ge||""),K&&K.charAt(0)!=="/"&&(K="/"+K)):ge||(ge=""),qt&&qt.charAt(0)!=="#"&&(qt="#"+qt),ot&&ot.charAt(0)!=="?"&&(ot="?"+ot),X+ge+(K=K.replace(/[?#]/g,function(yt){return encodeURIComponent(yt)}))+(ot=ot.replace("#","%23"))+qt},ht.prototype.resolve=function(j){return this.resolveObject(P(j,!1,!0)).format()},ht.prototype.resolveObject=function(j){if(q.isString(j)){var X=new ht;X.parse(j,!1,!0),j=X}for(var K=new ht,qt=Object.keys(this),ge=0;ge<qt.length;ge++){var Ct=qt[ge];K[Ct]=this[Ct]}if(K.hash=j.hash,j.href==="")return K.href=K.format(),K;if(j.slashes&&!j.protocol){for(var ot=Object.keys(j),yt=0;yt<ot.length;yt++){var Pt=ot[yt];Pt!=="protocol"&&(K[Pt]=j[Pt])}return O[K.protocol]&&K.hostname&&!K.pathname&&(K.path=K.pathname="/"),K.href=K.format(),K}if(j.protocol&&j.protocol!==K.protocol){if(!O[j.protocol]){for(var H=Object.keys(j),ft=0;ft<H.length;ft++){var Et=H[ft];K[Et]=j[Et]}return K.href=K.format(),K}if(K.protocol=j.protocol,j.host||L[j.protocol])K.pathname=j.pathname;else{for(var At=(j.pathname||"").split("/");At.length&&!(j.host=At.shift()););j.host||(j.host=""),j.hostname||(j.hostname=""),At[0]!==""&&At.unshift(""),At.length<2&&At.unshift(""),K.pathname=At.join("/")}if(K.search=j.search,K.query=j.query,K.host=j.host||"",K.auth=j.auth,K.hostname=j.hostname||j.host,K.port=j.port,K.pathname||K.search){var Rt=K.pathname||"",Wt=K.search||"";K.path=Rt+Wt}return K.slashes=K.slashes||j.slashes,K.href=K.format(),K}var $t=K.pathname&&K.pathname.charAt(0)==="/",ye=j.host||j.pathname&&j.pathname.charAt(0)==="/",me=ye||$t||K.host&&j.pathname,ui=me,be=K.pathname&&K.pathname.split("/")||[],ei=(At=j.pathname&&j.pathname.split("/")||[],K.protocol&&!O[K.protocol]);if(ei&&(K.hostname="",K.port=null,K.host&&(be[0]===""?be[0]=K.host:be.unshift(K.host)),K.host="",j.protocol&&(j.hostname=null,j.port=null,j.host&&(At[0]===""?At[0]=j.host:At.unshift(j.host)),j.host=null),me=me&&(At[0]===""||be[0]==="")),ye)K.host=j.host||j.host===""?j.host:K.host,K.hostname=j.hostname||j.hostname===""?j.hostname:K.hostname,K.search=j.search,K.query=j.query,be=At;else if(At.length)be||(be=[]),be.pop(),be=be.concat(At),K.search=j.search,K.query=j.query;else if(!q.isNullOrUndefined(j.search))return ei&&(K.hostname=K.host=be.shift(),(Di=!!(K.host&&K.host.indexOf("@")>0)&&K.host.split("@"))&&(K.auth=Di.shift(),K.host=K.hostname=Di.shift())),K.search=j.search,K.query=j.query,q.isNull(K.pathname)&&q.isNull(K.search)||(K.path=(K.pathname?K.pathname:"")+(K.search?K.search:"")),K.href=K.format(),K;if(!be.length)return K.pathname=null,K.search?K.path="/"+K.search:K.path=null,K.href=K.format(),K;for(var Ze=be.slice(-1)[0],ri=(K.host||j.host||be.length>1)&&(Ze==="."||Ze==="..")||Ze==="",De=0,Bi=be.length;Bi>=0;Bi--)(Ze=be[Bi])==="."?be.splice(Bi,1):Ze===".."?(be.splice(Bi,1),De++):De&&(be.splice(Bi,1),De--);if(!me&&!ui)for(;De--;De)be.unshift("..");!me||be[0]===""||be[0]&&be[0].charAt(0)==="/"||be.unshift(""),ri&&be.join("/").substr(-1)!=="/"&&be.push("");var Di,Ci=be[0]===""||be[0]&&be[0].charAt(0)==="/";return ei&&(K.hostname=K.host=Ci?"":be.length?be.shift():"",(Di=!!(K.host&&K.host.indexOf("@")>0)&&K.host.split("@"))&&(K.auth=Di.shift(),K.host=K.hostname=Di.shift())),(me=me||K.host&&be.length)&&!Ci&&be.unshift(""),be.length?K.pathname=be.join("/"):(K.pathname=null,K.path=null),q.isNull(K.pathname)&&q.isNull(K.search)||(K.path=(K.pathname?K.pathname:"")+(K.search?K.search:"")),K.auth=j.auth||K.auth,K.slashes=K.slashes||j.slashes,K.href=K.format(),K},ht.prototype.parseHost=function(){var j=this.host,X=C.exec(j);X&&((X=X[0])!==":"&&(this.port=X.substr(1)),j=j.substr(0,j.length-X.length)),j&&(this.hostname=j)}},function(T,M,v){var b=v(62);T.exports=function(q,ht){ht=ht||{};var W=new b,C=ht.inPlace||!1,V=q.map(function(k){return C?k:{width:k.width,height:k.height,item:k}});V=V.sort(function(k,Z){return Z.width*Z.height-k.width*k.height}),W.fit(V);var z={width:V.reduce(function(k,Z){return Math.max(k,Z.x+Z.width)},0),height:V.reduce(function(k,Z){return Math.max(k,Z.y+Z.height)},0)};return C||(z.items=V),z}},function(T,M){T.exports=function(v){return v.webpackPolyfill||(v.deprecate=function(){},v.paths=[],v.children||(v.children=[]),Object.defineProperty(v,"loaded",{enumerable:!0,get:function(){return v.l}}),Object.defineProperty(v,"id",{enumerable:!0,get:function(){return v.i}}),v.webpackPolyfill=1),v}},function(T,M,v){var b=Object.prototype.hasOwnProperty,q="~";function ht(){}function W(k,Z,vt){this.fn=k,this.context=Z,this.once=vt||!1}function C(k,Z,vt,Ot,Nt){if(typeof vt!="function")throw new TypeError("The listener must be a function");var E=new W(vt,Ot||k,Nt),L=q?q+Z:Z;return k._events[L]?k._events[L].fn?k._events[L]=[k._events[L],E]:k._events[L].push(E):(k._events[L]=E,k._eventsCount++),k}function V(k,Z){--k._eventsCount==0?k._events=new ht:delete k._events[Z]}function z(){this._events=new ht,this._eventsCount=0}Object.create&&(ht.prototype=Object.create(null),new ht().__proto__||(q=!1)),z.prototype.eventNames=function(){var k,Z,vt=[];if(this._eventsCount===0)return vt;for(Z in k=this._events)b.call(k,Z)&&vt.push(q?Z.slice(1):Z);return Object.getOwnPropertySymbols?vt.concat(Object.getOwnPropertySymbols(k)):vt},z.prototype.listeners=function(k){var Z=q?q+k:k,vt=this._events[Z];if(!vt)return[];if(vt.fn)return[vt.fn];for(var Ot=0,Nt=vt.length,E=new Array(Nt);Ot<Nt;Ot++)E[Ot]=vt[Ot].fn;return E},z.prototype.listenerCount=function(k){var Z=q?q+k:k,vt=this._events[Z];return vt?vt.fn?1:vt.length:0},z.prototype.emit=function(k,Z,vt,Ot,Nt,E){var L=q?q+k:k;if(!this._events[L])return!1;var O,Y,P=this._events[L],j=arguments.length;if(P.fn){switch(P.once&&this.removeListener(k,P.fn,void 0,!0),j){case 1:return P.fn.call(P.context),!0;case 2:return P.fn.call(P.context,Z),!0;case 3:return P.fn.call(P.context,Z,vt),!0;case 4:return P.fn.call(P.context,Z,vt,Ot),!0;case 5:return P.fn.call(P.context,Z,vt,Ot,Nt),!0;case 6:return P.fn.call(P.context,Z,vt,Ot,Nt,E),!0}for(Y=1,O=new Array(j-1);Y<j;Y++)O[Y-1]=arguments[Y];P.fn.apply(P.context,O)}else{var X,K=P.length;for(Y=0;Y<K;Y++)switch(P[Y].once&&this.removeListener(k,P[Y].fn,void 0,!0),j){case 1:P[Y].fn.call(P[Y].context);break;case 2:P[Y].fn.call(P[Y].context,Z);break;case 3:P[Y].fn.call(P[Y].context,Z,vt);break;case 4:P[Y].fn.call(P[Y].context,Z,vt,Ot);break;default:if(!O)for(X=1,O=new Array(j-1);X<j;X++)O[X-1]=arguments[X];P[Y].fn.apply(P[Y].context,O)}}return!0},z.prototype.on=function(k,Z,vt){return C(this,k,Z,vt,!1)},z.prototype.once=function(k,Z,vt){return C(this,k,Z,vt,!0)},z.prototype.removeListener=function(k,Z,vt,Ot){var Nt=q?q+k:k;if(!this._events[Nt])return this;if(!Z)return V(this,Nt),this;var E=this._events[Nt];if(E.fn)E.fn!==Z||Ot&&!E.once||vt&&E.context!==vt||V(this,Nt);else{for(var L=0,O=[],Y=E.length;L<Y;L++)(E[L].fn!==Z||Ot&&!E[L].once||vt&&E[L].context!==vt)&&O.push(E[L]);O.length?this._events[Nt]=O.length===1?O[0]:O:V(this,Nt)}return this},z.prototype.removeAllListeners=function(k){var Z;return k?(Z=q?q+k:k,this._events[Z]&&V(this,Z)):(this._events=new ht,this._eventsCount=0),this},z.prototype.off=z.prototype.removeListener,z.prototype.addListener=z.prototype.on,z.prefixed=q,z.EventEmitter=z,T.exports=z},function(T,M,v){function b(H,ft,Et){Et=Et||2;var At,Rt,Wt,$t,ye,me,ui,be=ft&&ft.length,ei=be?ft[0]*Et:H.length,Ze=q(H,0,ei,Et,!0),ri=[];if(!Ze||Ze.next===Ze.prev)return ri;if(be&&(Ze=function(Bi,Di,Ci,Ki){var Ii,Ui,On,Qi,Yn,$n=[];for(Ii=0,Ui=Di.length;Ii<Ui;Ii++)On=Di[Ii]*Ki,Qi=Ii<Ui-1?Di[Ii+1]*Ki:Bi.length,(Yn=q(Bi,On,Qi,Ki,!1))===Yn.next&&(Yn.steiner=!0),$n.push(E(Yn));for($n.sort(Z),Ii=0;Ii<$n.length;Ii++)Ci=ht(Ci=vt($n[Ii],Ci),Ci.next);return Ci}(H,ft,Ze,Et)),H.length>80*Et){At=Wt=H[0],Rt=$t=H[1];for(var De=Et;De<ei;De+=Et)(ye=H[De])<At&&(At=ye),(me=H[De+1])<Rt&&(Rt=me),ye>Wt&&(Wt=ye),me>$t&&($t=me);ui=(ui=Math.max(Wt-At,$t-Rt))!==0?1/ui:0}return W(Ze,ri,Et,At,Rt,ui),ri}function q(H,ft,Et,At,Rt){var Wt,$t;if(Rt===Pt(H,ft,Et,At)>0)for(Wt=ft;Wt<Et;Wt+=At)$t=Ct(Wt,H[Wt],H[Wt+1],$t);else for(Wt=Et-At;Wt>=ft;Wt-=At)$t=Ct(Wt,H[Wt],H[Wt+1],$t);return $t&&P($t,$t.next)&&(ot($t),$t=$t.next),$t}function ht(H,ft){if(!H)return H;ft||(ft=H);var Et,At=H;do if(Et=!1,At.steiner||!P(At,At.next)&&Y(At.prev,At,At.next)!==0)At=At.next;else{if(ot(At),(At=ft=At.prev)===At.next)break;Et=!0}while(Et||At!==ft);return ft}function W(H,ft,Et,At,Rt,Wt,$t){if(H){!$t&&Wt&&function(be,ei,Ze,ri){var De=be;do De.z===null&&(De.z=Nt(De.x,De.y,ei,Ze,ri)),De.prevZ=De.prev,De.nextZ=De.next,De=De.next;while(De!==be);De.prevZ.nextZ=null,De.prevZ=null,function(Bi){var Di,Ci,Ki,Ii,Ui,On,Qi,Yn,$n=1;do{for(Ci=Bi,Bi=null,Ui=null,On=0;Ci;){for(On++,Ki=Ci,Qi=0,Di=0;Di<$n&&(Qi++,Ki=Ki.nextZ);Di++);for(Yn=$n;Qi>0||Yn>0&&Ki;)Qi!==0&&(Yn===0||!Ki||Ci.z<=Ki.z)?(Ii=Ci,Ci=Ci.nextZ,Qi--):(Ii=Ki,Ki=Ki.nextZ,Yn--),Ui?Ui.nextZ=Ii:Bi=Ii,Ii.prevZ=Ui,Ui=Ii;Ci=Ki}Ui.nextZ=null,$n*=2}while(On>1)}(De)}(H,At,Rt,Wt);for(var ye,me,ui=H;H.prev!==H.next;)if(ye=H.prev,me=H.next,Wt?V(H,At,Rt,Wt):C(H))ft.push(ye.i/Et),ft.push(H.i/Et),ft.push(me.i/Et),ot(H),H=me.next,ui=me.next;else if((H=me)===ui){$t?$t===1?W(H=z(ht(H),ft,Et),ft,Et,At,Rt,Wt,2):$t===2&&k(H,ft,Et,At,Rt,Wt):W(ht(H),ft,Et,At,Rt,Wt,1);break}}}function C(H){var ft=H.prev,Et=H,At=H.next;if(Y(ft,Et,At)>=0)return!1;for(var Rt=H.next.next;Rt!==H.prev;){if(L(ft.x,ft.y,Et.x,Et.y,At.x,At.y,Rt.x,Rt.y)&&Y(Rt.prev,Rt,Rt.next)>=0)return!1;Rt=Rt.next}return!0}function V(H,ft,Et,At){var Rt=H.prev,Wt=H,$t=H.next;if(Y(Rt,Wt,$t)>=0)return!1;for(var ye=Rt.x<Wt.x?Rt.x<$t.x?Rt.x:$t.x:Wt.x<$t.x?Wt.x:$t.x,me=Rt.y<Wt.y?Rt.y<$t.y?Rt.y:$t.y:Wt.y<$t.y?Wt.y:$t.y,ui=Rt.x>Wt.x?Rt.x>$t.x?Rt.x:$t.x:Wt.x>$t.x?Wt.x:$t.x,be=Rt.y>Wt.y?Rt.y>$t.y?Rt.y:$t.y:Wt.y>$t.y?Wt.y:$t.y,ei=Nt(ye,me,ft,Et,At),Ze=Nt(ui,be,ft,Et,At),ri=H.prevZ,De=H.nextZ;ri&&ri.z>=ei&&De&&De.z<=Ze;){if(ri!==H.prev&&ri!==H.next&&L(Rt.x,Rt.y,Wt.x,Wt.y,$t.x,$t.y,ri.x,ri.y)&&Y(ri.prev,ri,ri.next)>=0||(ri=ri.prevZ,De!==H.prev&&De!==H.next&&L(Rt.x,Rt.y,Wt.x,Wt.y,$t.x,$t.y,De.x,De.y)&&Y(De.prev,De,De.next)>=0))return!1;De=De.nextZ}for(;ri&&ri.z>=ei;){if(ri!==H.prev&&ri!==H.next&&L(Rt.x,Rt.y,Wt.x,Wt.y,$t.x,$t.y,ri.x,ri.y)&&Y(ri.prev,ri,ri.next)>=0)return!1;ri=ri.prevZ}for(;De&&De.z<=Ze;){if(De!==H.prev&&De!==H.next&&L(Rt.x,Rt.y,Wt.x,Wt.y,$t.x,$t.y,De.x,De.y)&&Y(De.prev,De,De.next)>=0)return!1;De=De.nextZ}return!0}function z(H,ft,Et){var At=H;do{var Rt=At.prev,Wt=At.next.next;!P(Rt,Wt)&&j(Rt,At,At.next,Wt)&&qt(Rt,Wt)&&qt(Wt,Rt)&&(ft.push(Rt.i/Et),ft.push(At.i/Et),ft.push(Wt.i/Et),ot(At),ot(At.next),At=H=Wt),At=At.next}while(At!==H);return ht(At)}function k(H,ft,Et,At,Rt,Wt){var $t=H;do{for(var ye=$t.next.next;ye!==$t.prev;){if($t.i!==ye.i&&O($t,ye)){var me=ge($t,ye);return $t=ht($t,$t.next),me=ht(me,me.next),W($t,ft,Et,At,Rt,Wt),void W(me,ft,Et,At,Rt,Wt)}ye=ye.next}$t=$t.next}while($t!==H)}function Z(H,ft){return H.x-ft.x}function vt(H,ft){var Et=function(Wt,$t){var ye,me=$t,ui=Wt.x,be=Wt.y,ei=-1/0;do{if(be<=me.y&&be>=me.next.y&&me.next.y!==me.y){var Ze=me.x+(be-me.y)*(me.next.x-me.x)/(me.next.y-me.y);if(Ze<=ui&&Ze>ei){if(ei=Ze,Ze===ui){if(be===me.y)return me;if(be===me.next.y)return me.next}ye=me.x<me.next.x?me:me.next}}me=me.next}while(me!==$t);if(!ye)return null;if(ui===ei)return ye;var ri,De=ye,Bi=ye.x,Di=ye.y,Ci=1/0;me=ye;do ui>=me.x&&me.x>=Bi&&ui!==me.x&&L(be<Di?ui:ei,be,Bi,Di,be<Di?ei:ui,be,me.x,me.y)&&(ri=Math.abs(be-me.y)/(ui-me.x),qt(me,Wt)&&(ri<Ci||ri===Ci&&(me.x>ye.x||me.x===ye.x&&Ot(ye,me)))&&(ye=me,Ci=ri)),me=me.next;while(me!==De);return ye}(H,ft);if(!Et)return ft;var At=ge(Et,H),Rt=ht(Et,Et.next);return ht(At,At.next),ft===Et?Rt:ft}function Ot(H,ft){return Y(H.prev,H,ft.prev)<0&&Y(ft.next,H,H.next)<0}function Nt(H,ft,Et,At,Rt){return(H=1431655765&((H=858993459&((H=252645135&((H=16711935&((H=32767*(H-Et)*Rt)|H<<8))|H<<4))|H<<2))|H<<1))|(ft=1431655765&((ft=858993459&((ft=252645135&((ft=16711935&((ft=32767*(ft-At)*Rt)|ft<<8))|ft<<4))|ft<<2))|ft<<1))<<1}function E(H){var ft=H,Et=H;do(ft.x<Et.x||ft.x===Et.x&&ft.y<Et.y)&&(Et=ft),ft=ft.next;while(ft!==H);return Et}function L(H,ft,Et,At,Rt,Wt,$t,ye){return(Rt-$t)*(ft-ye)-(H-$t)*(Wt-ye)>=0&&(H-$t)*(At-ye)-(Et-$t)*(ft-ye)>=0&&(Et-$t)*(Wt-ye)-(Rt-$t)*(At-ye)>=0}function O(H,ft){return H.next.i!==ft.i&&H.prev.i!==ft.i&&!function(Et,At){var Rt=Et;do{if(Rt.i!==Et.i&&Rt.next.i!==Et.i&&Rt.i!==At.i&&Rt.next.i!==At.i&&j(Rt,Rt.next,Et,At))return!0;Rt=Rt.next}while(Rt!==Et);return!1}(H,ft)&&(qt(H,ft)&&qt(ft,H)&&function(Et,At){var Rt=Et,Wt=!1,$t=(Et.x+At.x)/2,ye=(Et.y+At.y)/2;do Rt.y>ye!=Rt.next.y>ye&&Rt.next.y!==Rt.y&&$t<(Rt.next.x-Rt.x)*(ye-Rt.y)/(Rt.next.y-Rt.y)+Rt.x&&(Wt=!Wt),Rt=Rt.next;while(Rt!==Et);return Wt}(H,ft)&&(Y(H.prev,H,ft.prev)||Y(H,ft.prev,ft))||P(H,ft)&&Y(H.prev,H,H.next)>0&&Y(ft.prev,ft,ft.next)>0)}function Y(H,ft,Et){return(ft.y-H.y)*(Et.x-ft.x)-(ft.x-H.x)*(Et.y-ft.y)}function P(H,ft){return H.x===ft.x&&H.y===ft.y}function j(H,ft,Et,At){var Rt=K(Y(H,ft,Et)),Wt=K(Y(H,ft,At)),$t=K(Y(Et,At,H)),ye=K(Y(Et,At,ft));return Rt!==Wt&&$t!==ye||!(Rt!==0||!X(H,Et,ft))||!(Wt!==0||!X(H,At,ft))||!($t!==0||!X(Et,H,At))||!(ye!==0||!X(Et,ft,At))}function X(H,ft,Et){return ft.x<=Math.max(H.x,Et.x)&&ft.x>=Math.min(H.x,Et.x)&&ft.y<=Math.max(H.y,Et.y)&&ft.y>=Math.min(H.y,Et.y)}function K(H){return H>0?1:H<0?-1:0}function qt(H,ft){return Y(H.prev,H,H.next)<0?Y(H,ft,H.next)>=0&&Y(H,H.prev,ft)>=0:Y(H,ft,H.prev)<0||Y(H,H.next,ft)<0}function ge(H,ft){var Et=new yt(H.i,H.x,H.y),At=new yt(ft.i,ft.x,ft.y),Rt=H.next,Wt=ft.prev;return H.next=ft,ft.prev=H,Et.next=Rt,Rt.prev=Et,At.next=Et,Et.prev=At,Wt.next=At,At.prev=Wt,At}function Ct(H,ft,Et,At){var Rt=new yt(H,ft,Et);return At?(Rt.next=At.next,Rt.prev=At,At.next.prev=Rt,At.next=Rt):(Rt.prev=Rt,Rt.next=Rt),Rt}function ot(H){H.next.prev=H.prev,H.prev.next=H.next,H.prevZ&&(H.prevZ.nextZ=H.nextZ),H.nextZ&&(H.nextZ.prevZ=H.prevZ)}function yt(H,ft,Et){this.i=H,this.x=ft,this.y=Et,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Pt(H,ft,Et,At){for(var Rt=0,Wt=ft,$t=Et-At;Wt<Et;Wt+=At)Rt+=(H[$t]-H[Wt])*(H[Wt+1]+H[$t+1]),$t=Wt;return Rt}T.exports=b,T.exports.default=b,b.deviation=function(H,ft,Et,At){var Rt=ft&&ft.length,Wt=Rt?ft[0]*Et:H.length,$t=Math.abs(Pt(H,0,Wt,Et));if(Rt)for(var ye=0,me=ft.length;ye<me;ye++){var ui=ft[ye]*Et,be=ye<me-1?ft[ye+1]*Et:H.length;$t-=Math.abs(Pt(H,ui,be,Et))}var ei=0;for(ye=0;ye<At.length;ye+=3){var Ze=At[ye]*Et,ri=At[ye+1]*Et,De=At[ye+2]*Et;ei+=Math.abs((H[Ze]-H[De])*(H[ri+1]-H[Ze+1])-(H[Ze]-H[ri])*(H[De+1]-H[Ze+1]))}return $t===0&&ei===0?0:Math.abs((ei-$t)/$t)},b.flatten=function(H){for(var ft=H[0][0].length,Et={vertices:[],holes:[],dimensions:ft},At=0,Rt=0;Rt<H.length;Rt++){for(var Wt=0;Wt<H[Rt].length;Wt++)for(var $t=0;$t<ft;$t++)Et.vertices.push(H[Rt][Wt][$t]);Rt>0&&(At+=H[Rt-1].length,Et.holes.push(At))}return Et}},function(T,M){T.exports=`varying vec2 vUv;
|
|
27
|
+
}`;var re=su(function(){return an(mt,Fe+"return "+de).apply(void 0,Mt)});if(re.source=de,Pd(re))throw re;return re},S.times=function(c,f){if((c=di(c))<1||c>9007199254740991)return[];var x=4294967295,R=yn(c,4294967295);c-=4294967295;for(var D=th(R,f=je(f));++x<c;)f(x);return D},S.toFinite=qo,S.toInteger=di,S.toLength=jf,S.toLower=function(c){return xi(c).toLowerCase()},S.toNumber=Or,S.toSafeInteger=function(c){return c?zo(di(c),-9007199254740991,9007199254740991):c===0?c:0},S.toString=xi,S.toUpper=function(c){return xi(c).toUpperCase()},S.trim=function(c,f,x){if((c=xi(c))&&(x||f===void 0))return qc(c);if(!c||!(f=pn(f)))return c;var R=Gn(c),D=Gn(f);return _e(R,Yc(R,D),$c(R,D)+1).join("")},S.trimEnd=function(c,f,x){if((c=xi(c))&&(x||f===void 0))return c.slice(0,hs(c)+1);if(!c||!(f=pn(f)))return c;var R=Gn(c);return _e(R,0,$c(R,Gn(f))+1).join("")},S.trimStart=function(c,f,x){if((c=xi(c))&&(x||f===void 0))return c.replace(Ui,"");if(!c||!(f=pn(f)))return c;var R=Gn(c);return _e(R,Yc(R,Gn(f))).join("")},S.truncate=function(c,f){var x=30,R="...";if(nn(f)){var D="separator"in f?f.separator:D;x="length"in f?di(f.length):x,R="omission"in f?pn(f.omission):R}var $=(c=xi(c)).length;if(Ys(c)){var ut=Gn(c);$=ut.length}if(x>=$)return c;var mt=x-Bo(R);if(mt<1)return R;var Mt=ut?_e(ut,0,mt).join(""):c.slice(0,mt);if(D===void 0)return Mt+R;if(ut&&(mt+=Mt.length-mt),Ld(D)){if(c.slice(mt).search(D)){var Jt,Zt=Mt;for(D.global||(D=Nl(D.source,xi(Zr.exec(D))+"g")),D.lastIndex=0;Jt=D.exec(Zt);)var de=Jt.index;Mt=Mt.slice(0,de===void 0?mt:de)}}else if(c.indexOf(pn(D),mt)!=mt){var Oe=Mt.lastIndexOf(D);Oe>-1&&(Mt=Mt.slice(0,Oe))}return Mt+R},S.unescape=function(c){return(c=xi(c))&&be.test(c)?c.replace(me,Ol):c},S.uniqueId=function(c){var f=++Dg;return xi(c)+f},S.upperCase=qf,S.upperFirst=ou,S.each=Cf,S.eachRight=Pf,S.first=Ed,Hh(S,(Wh={},yo(S,function(c,f){Ei.call(S.prototype,f)||(Wh[f]=c)}),Wh),{chain:!1}),S.VERSION="4.17.21",hr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(c){S[c].placeholder=S}),hr(["drop","take"],function(c,f){oi.prototype[c]=function(x){x=x===void 0?1:Hi(di(x),0);var R=this.__filtered__&&!f?new oi(this):this.clone();return R.__filtered__?R.__takeCount__=yn(x,R.__takeCount__):R.__views__.push({size:yn(x,4294967295),type:c+(R.__dir__<0?"Right":"")}),R},oi.prototype[c+"Right"]=function(x){return this.reverse()[c](x).reverse()}}),hr(["filter","map","takeWhile"],function(c,f){var x=f+1,R=x==1||x==3;oi.prototype[c]=function(D){var $=this.clone();return $.__iteratees__.push({iteratee:je(D,3),type:x}),$.__filtered__=$.__filtered__||R,$}}),hr(["head","last"],function(c,f){var x="take"+(f?"Right":"");oi.prototype[c]=function(){return this[x](1).value()[0]}}),hr(["initial","tail"],function(c,f){var x="drop"+(f?"":"Right");oi.prototype[c]=function(){return this.__filtered__?new oi(this):this[x](1)}}),oi.prototype.compact=function(){return this.filter(sr)},oi.prototype.find=function(c){return this.filter(c).head()},oi.prototype.findLast=function(c){return this.reverse().find(c)},oi.prototype.invokeMap=ci(function(c,f){return typeof c=="function"?new oi(this):this.map(function(x){return Ga(x,c,f)})}),oi.prototype.reject=function(c){return this.filter(Ql(je(c)))},oi.prototype.slice=function(c,f){c=di(c);var x=this;return x.__filtered__&&(c>0||f<0)?new oi(x):(c<0?x=x.takeRight(-c):c&&(x=x.drop(c)),f!==void 0&&(x=(f=di(f))<0?x.dropRight(-f):x.take(f-c)),x)},oi.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},oi.prototype.toArray=function(){return this.take(4294967295)},yo(oi.prototype,function(c,f){var x=/^(?:filter|find|map|reject)|While$/.test(f),R=/^(?:head|last)$/.test(f),D=S[R?"take"+(f=="last"?"Right":""):f],$=R||/^find/.test(f);D&&(S.prototype[f]=function(){var ut=this.__wrapped__,mt=R?[1]:arguments,Mt=ut instanceof oi,Jt=mt[0],Zt=Mt||ti(ut),de=function(He){var Ce=D.apply(S,Do([He],mt));return R&&Oe?Ce[0]:Ce};Zt&&x&&typeof Jt=="function"&&Jt.length!=1&&(Mt=Zt=!1);var Oe=this.__chain__,Fe=!!this.__actions__.length,Ve=$&&!Oe,re=Mt&&!Fe;if(!$&&Zt){ut=re?ut:new oi(this);var pe=c.apply(ut,mt);return pe.__actions__.push({func:Ch,args:[de],thisArg:void 0}),new Yi(pe,Oe)}return Ve&&re?c.apply(this,mt):(pe=this.thru(de),Ve?R?pe.value()[0]:pe.value():pe)})}),hr(["pop","push","shift","sort","splice","unshift"],function(c){var f=Dl[c],x=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",R=/^(?:pop|shift)$/.test(c);S.prototype[c]=function(){var D=arguments;if(R&&!this.__chain__){var $=this.value();return f.apply(ti($)?$:[],D)}return this[x](function(ut){return f.apply(ti(ut)?ut:[],D)})}}),yo(oi.prototype,function(c,f){var x=S[f];if(x){var R=x.name+"";Ei.call(kr,R)||(kr[R]=[]),kr[R].push({name:f,func:x})}}),kr[Xa(void 0,2).name]=[{name:"wrapper",func:void 0}],oi.prototype.clone=function(){var c=new oi(this.__wrapped__);return c.__actions__=Mn(this.__actions__),c.__dir__=this.__dir__,c.__filtered__=this.__filtered__,c.__iteratees__=Mn(this.__iteratees__),c.__takeCount__=this.__takeCount__,c.__views__=Mn(this.__views__),c},oi.prototype.reverse=function(){if(this.__filtered__){var c=new oi(this);c.__dir__=-1,c.__filtered__=!0}else(c=this.clone()).__dir__*=-1;return c},oi.prototype.value=function(){var c=this.__wrapped__.value(),f=this.__dir__,x=ti(c),R=f<0,D=x?c.length:0,$=function(li,ke,Je){for(var hn=-1,Vn=Je.length;++hn<Vn;){var cn=Je[hn],on=cn.size;switch(cn.type){case"drop":li+=on;break;case"dropRight":ke-=on;break;case"take":ke=yn(ke,li+on);break;case"takeRight":li=Hi(li,ke-on)}}return{start:li,end:ke}}(0,D,this.__views__),ut=$.start,mt=$.end,Mt=mt-ut,Jt=R?mt:ut-1,Zt=this.__iteratees__,de=Zt.length,Oe=0,Fe=yn(Mt,this.__takeCount__);if(!x||!R&&D==Mt&&Fe==Mt)return cd(c,this.__actions__);var Ve=[];t:for(;Mt--&&Oe<Fe;){for(var re=-1,pe=c[Jt+=f];++re<de;){var He=Zt[re],Ce=He.iteratee,Ue=He.type,Ye=Ce(pe);if(Ue==2)pe=Ye;else if(!Ye){if(Ue==1)continue t;break t}}Ve[Oe++]=pe}return Ve},S.prototype.at=rv,S.prototype.chain=function(){return Rf(this)},S.prototype.commit=function(){return new Yi(this.value(),this.__chain__)},S.prototype.next=function(){this.__values__===void 0&&(this.__values__=zf(this.value()));var c=this.__index__>=this.__values__.length;return{done:c,value:c?void 0:this.__values__[this.__index__++]}},S.prototype.plant=function(c){for(var f,x=this;x instanceof Hl;){var R=Sf(x);R.__index__=0,R.__values__=void 0,f?D.__wrapped__=R:f=R;var D=R;x=x.__wrapped__}return D.__wrapped__=c,f},S.prototype.reverse=function(){var c=this.__wrapped__;if(c instanceof oi){var f=c;return this.__actions__.length&&(f=new oi(this)),(f=f.reverse()).__actions__.push({func:Ch,args:[Md],thisArg:void 0}),new Yi(f,this.__chain__)}return this.thru(Md)},S.prototype.toJSON=S.prototype.valueOf=S.prototype.value=function(){return cd(this.__wrapped__,this.__actions__)},S.prototype.first=S.prototype.head,mo&&(S.prototype[mo]=function(){return this}),S}();tn._=$s,(ht=function(){return $s}.call(M,v,M,q))===void 0||(q.exports=ht)}).call(this)}).call(this,v(3),v(7)(T))},function(T,M,v){var b=Object.prototype.hasOwnProperty,q="~";function ht(){}function W(k,Z,vt){this.fn=k,this.context=Z,this.once=vt||!1}function P(k,Z,vt,Ot,Nt){if(typeof vt!="function")throw new TypeError("The listener must be a function");var E=new W(vt,Ot||k,Nt),L=q?q+Z:Z;return k._events[L]?k._events[L].fn?k._events[L]=[k._events[L],E]:k._events[L].push(E):(k._events[L]=E,k._eventsCount++),k}function V(k,Z){--k._eventsCount==0?k._events=new ht:delete k._events[Z]}function z(){this._events=new ht,this._eventsCount=0}Object.create&&(ht.prototype=Object.create(null),new ht().__proto__||(q=!1)),z.prototype.eventNames=function(){var k,Z,vt=[];if(this._eventsCount===0)return vt;for(Z in k=this._events)b.call(k,Z)&&vt.push(q?Z.slice(1):Z);return Object.getOwnPropertySymbols?vt.concat(Object.getOwnPropertySymbols(k)):vt},z.prototype.listeners=function(k){var Z=q?q+k:k,vt=this._events[Z];if(!vt)return[];if(vt.fn)return[vt.fn];for(var Ot=0,Nt=vt.length,E=new Array(Nt);Ot<Nt;Ot++)E[Ot]=vt[Ot].fn;return E},z.prototype.listenerCount=function(k){var Z=q?q+k:k,vt=this._events[Z];return vt?vt.fn?1:vt.length:0},z.prototype.emit=function(k,Z,vt,Ot,Nt,E){var L=q?q+k:k;if(!this._events[L])return!1;var O,Y,C=this._events[L],j=arguments.length;if(C.fn){switch(C.once&&this.removeListener(k,C.fn,void 0,!0),j){case 1:return C.fn.call(C.context),!0;case 2:return C.fn.call(C.context,Z),!0;case 3:return C.fn.call(C.context,Z,vt),!0;case 4:return C.fn.call(C.context,Z,vt,Ot),!0;case 5:return C.fn.call(C.context,Z,vt,Ot,Nt),!0;case 6:return C.fn.call(C.context,Z,vt,Ot,Nt,E),!0}for(Y=1,O=new Array(j-1);Y<j;Y++)O[Y-1]=arguments[Y];C.fn.apply(C.context,O)}else{var X,K=C.length;for(Y=0;Y<K;Y++)switch(C[Y].once&&this.removeListener(k,C[Y].fn,void 0,!0),j){case 1:C[Y].fn.call(C[Y].context);break;case 2:C[Y].fn.call(C[Y].context,Z);break;case 3:C[Y].fn.call(C[Y].context,Z,vt);break;case 4:C[Y].fn.call(C[Y].context,Z,vt,Ot);break;default:if(!O)for(X=1,O=new Array(j-1);X<j;X++)O[X-1]=arguments[X];C[Y].fn.apply(C[Y].context,O)}}return!0},z.prototype.on=function(k,Z,vt){return P(this,k,Z,vt,!1)},z.prototype.once=function(k,Z,vt){return P(this,k,Z,vt,!0)},z.prototype.removeListener=function(k,Z,vt,Ot){var Nt=q?q+k:k;if(!this._events[Nt])return this;if(!Z)return V(this,Nt),this;var E=this._events[Nt];if(E.fn)E.fn!==Z||Ot&&!E.once||vt&&E.context!==vt||V(this,Nt);else{for(var L=0,O=[],Y=E.length;L<Y;L++)(E[L].fn!==Z||Ot&&!E[L].once||vt&&E[L].context!==vt)&&O.push(E[L]);O.length?this._events[Nt]=O.length===1?O[0]:O:V(this,Nt)}return this},z.prototype.removeAllListeners=function(k){var Z;return k?(Z=q?q+k:k,this._events[Z]&&V(this,Z)):(this._events=new ht,this._eventsCount=0),this},z.prototype.off=z.prototype.removeListener,z.prototype.addListener=z.prototype.on,z.prefixed=q,z.EventEmitter=z,T.exports=z},function(T,M,v){var b;(function(q){function ht(C,j){var X=(65535&C)+(65535&j);return(C>>16)+(j>>16)+(X>>16)<<16|65535&X}function W(C,j,X,K,qt,ge){return ht((Ct=ht(ht(j,C),ht(K,ge)))<<(ot=qt)|Ct>>>32-ot,X);var Ct,ot}function P(C,j,X,K,qt,ge,Ct){return W(j&X|~j&K,C,j,qt,ge,Ct)}function V(C,j,X,K,qt,ge,Ct){return W(j&K|X&~K,C,j,qt,ge,Ct)}function z(C,j,X,K,qt,ge,Ct){return W(j^X^K,C,j,qt,ge,Ct)}function k(C,j,X,K,qt,ge,Ct){return W(X^(j|~K),C,j,qt,ge,Ct)}function Z(C,j){var X,K,qt,ge,Ct;C[j>>5]|=128<<j%32,C[14+(j+64>>>9<<4)]=j;var ot=1732584193,yt=-271733879,Pt=-1732584194,H=271733878;for(X=0;X<C.length;X+=16)K=ot,qt=yt,ge=Pt,Ct=H,ot=P(ot,yt,Pt,H,C[X],7,-680876936),H=P(H,ot,yt,Pt,C[X+1],12,-389564586),Pt=P(Pt,H,ot,yt,C[X+2],17,606105819),yt=P(yt,Pt,H,ot,C[X+3],22,-1044525330),ot=P(ot,yt,Pt,H,C[X+4],7,-176418897),H=P(H,ot,yt,Pt,C[X+5],12,1200080426),Pt=P(Pt,H,ot,yt,C[X+6],17,-1473231341),yt=P(yt,Pt,H,ot,C[X+7],22,-45705983),ot=P(ot,yt,Pt,H,C[X+8],7,1770035416),H=P(H,ot,yt,Pt,C[X+9],12,-1958414417),Pt=P(Pt,H,ot,yt,C[X+10],17,-42063),yt=P(yt,Pt,H,ot,C[X+11],22,-1990404162),ot=P(ot,yt,Pt,H,C[X+12],7,1804603682),H=P(H,ot,yt,Pt,C[X+13],12,-40341101),Pt=P(Pt,H,ot,yt,C[X+14],17,-1502002290),ot=V(ot,yt=P(yt,Pt,H,ot,C[X+15],22,1236535329),Pt,H,C[X+1],5,-165796510),H=V(H,ot,yt,Pt,C[X+6],9,-1069501632),Pt=V(Pt,H,ot,yt,C[X+11],14,643717713),yt=V(yt,Pt,H,ot,C[X],20,-373897302),ot=V(ot,yt,Pt,H,C[X+5],5,-701558691),H=V(H,ot,yt,Pt,C[X+10],9,38016083),Pt=V(Pt,H,ot,yt,C[X+15],14,-660478335),yt=V(yt,Pt,H,ot,C[X+4],20,-405537848),ot=V(ot,yt,Pt,H,C[X+9],5,568446438),H=V(H,ot,yt,Pt,C[X+14],9,-1019803690),Pt=V(Pt,H,ot,yt,C[X+3],14,-187363961),yt=V(yt,Pt,H,ot,C[X+8],20,1163531501),ot=V(ot,yt,Pt,H,C[X+13],5,-1444681467),H=V(H,ot,yt,Pt,C[X+2],9,-51403784),Pt=V(Pt,H,ot,yt,C[X+7],14,1735328473),ot=z(ot,yt=V(yt,Pt,H,ot,C[X+12],20,-1926607734),Pt,H,C[X+5],4,-378558),H=z(H,ot,yt,Pt,C[X+8],11,-2022574463),Pt=z(Pt,H,ot,yt,C[X+11],16,1839030562),yt=z(yt,Pt,H,ot,C[X+14],23,-35309556),ot=z(ot,yt,Pt,H,C[X+1],4,-1530992060),H=z(H,ot,yt,Pt,C[X+4],11,1272893353),Pt=z(Pt,H,ot,yt,C[X+7],16,-155497632),yt=z(yt,Pt,H,ot,C[X+10],23,-1094730640),ot=z(ot,yt,Pt,H,C[X+13],4,681279174),H=z(H,ot,yt,Pt,C[X],11,-358537222),Pt=z(Pt,H,ot,yt,C[X+3],16,-722521979),yt=z(yt,Pt,H,ot,C[X+6],23,76029189),ot=z(ot,yt,Pt,H,C[X+9],4,-640364487),H=z(H,ot,yt,Pt,C[X+12],11,-421815835),Pt=z(Pt,H,ot,yt,C[X+15],16,530742520),ot=k(ot,yt=z(yt,Pt,H,ot,C[X+2],23,-995338651),Pt,H,C[X],6,-198630844),H=k(H,ot,yt,Pt,C[X+7],10,1126891415),Pt=k(Pt,H,ot,yt,C[X+14],15,-1416354905),yt=k(yt,Pt,H,ot,C[X+5],21,-57434055),ot=k(ot,yt,Pt,H,C[X+12],6,1700485571),H=k(H,ot,yt,Pt,C[X+3],10,-1894986606),Pt=k(Pt,H,ot,yt,C[X+10],15,-1051523),yt=k(yt,Pt,H,ot,C[X+1],21,-2054922799),ot=k(ot,yt,Pt,H,C[X+8],6,1873313359),H=k(H,ot,yt,Pt,C[X+15],10,-30611744),Pt=k(Pt,H,ot,yt,C[X+6],15,-1560198380),yt=k(yt,Pt,H,ot,C[X+13],21,1309151649),ot=k(ot,yt,Pt,H,C[X+4],6,-145523070),H=k(H,ot,yt,Pt,C[X+11],10,-1120210379),Pt=k(Pt,H,ot,yt,C[X+2],15,718787259),yt=k(yt,Pt,H,ot,C[X+9],21,-343485551),ot=ht(ot,K),yt=ht(yt,qt),Pt=ht(Pt,ge),H=ht(H,Ct);return[ot,yt,Pt,H]}function vt(C){var j,X="",K=32*C.length;for(j=0;j<K;j+=8)X+=String.fromCharCode(C[j>>5]>>>j%32&255);return X}function Ot(C){var j,X=[];for(X[(C.length>>2)-1]=void 0,j=0;j<X.length;j+=1)X[j]=0;var K=8*C.length;for(j=0;j<K;j+=8)X[j>>5]|=(255&C.charCodeAt(j/8))<<j%32;return X}function Nt(C){var j,X,K="";for(X=0;X<C.length;X+=1)j=C.charCodeAt(X),K+="0123456789abcdef".charAt(j>>>4&15)+"0123456789abcdef".charAt(15&j);return K}function E(C){return unescape(encodeURIComponent(C))}function L(C){return function(j){return vt(Z(Ot(j),8*j.length))}(E(C))}function O(C,j){return function(X,K){var qt,ge,Ct=Ot(X),ot=[],yt=[];for(ot[15]=yt[15]=void 0,Ct.length>16&&(Ct=Z(Ct,8*X.length)),qt=0;qt<16;qt+=1)ot[qt]=909522486^Ct[qt],yt[qt]=1549556828^Ct[qt];return ge=Z(ot.concat(Ot(K)),512+8*K.length),vt(Z(yt.concat(ge),640))}(E(C),E(j))}function Y(C,j,X){return j?X?O(j,C):Nt(O(j,C)):X?L(C):Nt(L(C))}(b=function(){return Y}.call(M,v,M,T))===void 0||(T.exports=b)})()},function(T,M){var v;v=function(){return this}();try{v=v||new Function("return this")()}catch{typeof window=="object"&&(v=window)}T.exports=v},function(T,M,v){(function(b){T.exports=function q(ht,W,P){function V(Z,vt){if(!W[Z]){if(!ht[Z]){if(z)return z(Z,!0);var Ot=new Error("Cannot find module '"+Z+"'");throw Ot.code="MODULE_NOT_FOUND",Ot}var Nt=W[Z]={exports:{}};ht[Z][0].call(Nt.exports,function(E){var L=ht[Z][1][E];return V(L||E)},Nt,Nt.exports,q,ht,W,P)}return W[Z].exports}for(var z=!1,k=0;k<P.length;k++)V(P[k]);return V}({1:[function(q,ht,W){(function(P){var V,z,k=P.MutationObserver||P.WebKitMutationObserver;if(k){var Z=0,vt=new k(L),Ot=P.document.createTextNode("");vt.observe(Ot,{characterData:!0}),V=function(){Ot.data=Z=++Z%2}}else if(P.setImmediate||P.MessageChannel===void 0)V="document"in P&&"onreadystatechange"in P.document.createElement("script")?function(){var O=P.document.createElement("script");O.onreadystatechange=function(){L(),O.onreadystatechange=null,O.parentNode.removeChild(O),O=null},P.document.documentElement.appendChild(O)}:function(){setTimeout(L,0)};else{var Nt=new P.MessageChannel;Nt.port1.onmessage=L,V=function(){Nt.port2.postMessage(0)}}var E=[];function L(){var O,Y;z=!0;for(var C=E.length;C;){for(Y=E,E=[],O=-1;++O<C;)Y[O]();C=E.length}z=!1}ht.exports=function(O){E.push(O)!==1||z||V()}}).call(this,b!==void 0?b:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(q,ht,W){var P=q(1);function V(){}var z={},k=["REJECTED"],Z=["FULFILLED"],vt=["PENDING"];function Ot(C){if(typeof C!="function")throw new TypeError("resolver must be a function");this.state=vt,this.queue=[],this.outcome=void 0,C!==V&&O(this,C)}function Nt(C,j,X){this.promise=C,typeof j=="function"&&(this.onFulfilled=j,this.callFulfilled=this.otherCallFulfilled),typeof X=="function"&&(this.onRejected=X,this.callRejected=this.otherCallRejected)}function E(C,j,X){P(function(){var K;try{K=j(X)}catch(qt){return z.reject(C,qt)}K===C?z.reject(C,new TypeError("Cannot resolve promise with itself")):z.resolve(C,K)})}function L(C){var j=C&&C.then;if(C&&(typeof C=="object"||typeof C=="function")&&typeof j=="function")return function(){j.apply(C,arguments)}}function O(C,j){var X=!1;function K(Ct){X||(X=!0,z.reject(C,Ct))}function qt(Ct){X||(X=!0,z.resolve(C,Ct))}var ge=Y(function(){j(qt,K)});ge.status==="error"&&K(ge.value)}function Y(C,j){var X={};try{X.value=C(j),X.status="success"}catch(K){X.status="error",X.value=K}return X}ht.exports=Ot,Ot.prototype.catch=function(C){return this.then(null,C)},Ot.prototype.then=function(C,j){if(typeof C!="function"&&this.state===Z||typeof j!="function"&&this.state===k)return this;var X=new this.constructor(V);return this.state!==vt?E(X,this.state===Z?C:j,this.outcome):this.queue.push(new Nt(X,C,j)),X},Nt.prototype.callFulfilled=function(C){z.resolve(this.promise,C)},Nt.prototype.otherCallFulfilled=function(C){E(this.promise,this.onFulfilled,C)},Nt.prototype.callRejected=function(C){z.reject(this.promise,C)},Nt.prototype.otherCallRejected=function(C){E(this.promise,this.onRejected,C)},z.resolve=function(C,j){var X=Y(L,j);if(X.status==="error")return z.reject(C,X.value);var K=X.value;if(K)O(C,K);else{C.state=Z,C.outcome=j;for(var qt=-1,ge=C.queue.length;++qt<ge;)C.queue[qt].callFulfilled(j)}return C},z.reject=function(C,j){C.state=k,C.outcome=j;for(var X=-1,K=C.queue.length;++X<K;)C.queue[X].callRejected(j);return C},Ot.resolve=function(C){return C instanceof this?C:z.resolve(new this(V),C)},Ot.reject=function(C){var j=new this(V);return z.reject(j,C)},Ot.all=function(C){var j=this;if(Object.prototype.toString.call(C)!=="[object Array]")return this.reject(new TypeError("must be an array"));var X=C.length,K=!1;if(!X)return this.resolve([]);for(var qt=new Array(X),ge=0,Ct=-1,ot=new this(V);++Ct<X;)yt(C[Ct],Ct);return ot;function yt(Pt,H){j.resolve(Pt).then(function(ft){qt[H]=ft,++ge!==X||K||(K=!0,z.resolve(ot,qt))},function(ft){K||(K=!0,z.reject(ot,ft))})}},Ot.race=function(C){var j=this;if(Object.prototype.toString.call(C)!=="[object Array]")return this.reject(new TypeError("must be an array"));var X=C.length,K=!1;if(!X)return this.resolve([]);for(var qt,ge=-1,Ct=new this(V);++ge<X;)qt=C[ge],j.resolve(qt).then(function(ot){K||(K=!0,z.resolve(Ct,ot))},function(ot){K||(K=!0,z.reject(Ct,ot))});return Ct}},{1:1}],3:[function(q,ht,W){(function(P){typeof P.Promise!="function"&&(P.Promise=q(2))}).call(this,b!==void 0?b:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{2:2}],4:[function(q,ht,W){var P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(J){return typeof J}:function(J){return J&&typeof Symbol=="function"&&J.constructor===Symbol&&J!==Symbol.prototype?"symbol":typeof J},V=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 z(J,st){J=J||[],st=st||{};try{return new Blob(J,st)}catch(bt){if(bt.name!=="TypeError")throw bt;for(var at=new(typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder),Tt=0;Tt<J.length;Tt+=1)at.append(J[Tt]);return at.getBlob(st.type)}}typeof Promise=="undefined"&&q(3);var k=Promise;function Z(J,st){st&&J.then(function(at){st(null,at)},function(at){st(at)})}function vt(J,st,at){typeof st=="function"&&J.then(st),typeof at=="function"&&J.catch(at)}function Ot(J){return typeof J!="string"&&(console.warn(J+" used as a key, but it is not a string."),J=String(J)),J}function Nt(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var E=void 0,L={},O=Object.prototype.toString;function Y(J){return typeof E=="boolean"?k.resolve(E):function(st){return new k(function(at){var Tt=st.transaction("local-forage-detect-blob-support","readwrite"),bt=z([""]);Tt.objectStore("local-forage-detect-blob-support").put(bt,"key"),Tt.onabort=function(wt){wt.preventDefault(),wt.stopPropagation(),at(!1)},Tt.oncomplete=function(){var wt=navigator.userAgent.match(/Chrome\/(\d+)/),zt=navigator.userAgent.match(/Edge\//);at(zt||!wt||parseInt(wt[1],10)>=43)}}).catch(function(){return!1})}(J).then(function(st){return E=st})}function C(J){var st=L[J.name],at={};at.promise=new k(function(Tt,bt){at.resolve=Tt,at.reject=bt}),st.deferredOperations.push(at),st.dbReady?st.dbReady=st.dbReady.then(function(){return at.promise}):st.dbReady=at.promise}function j(J){var st=L[J.name].deferredOperations.pop();if(st)return st.resolve(),st.promise}function X(J,st){var at=L[J.name].deferredOperations.pop();if(at)return at.reject(st),at.promise}function K(J,st){return new k(function(at,Tt){if(L[J.name]=L[J.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},J.db){if(!st)return at(J.db);C(J),J.db.close()}var bt=[J.name];st&&bt.push(J.version);var wt=V.open.apply(V,bt);st&&(wt.onupgradeneeded=function(zt){var ne=wt.result;try{ne.createObjectStore(J.storeName),zt.oldVersion<=1&&ne.createObjectStore("local-forage-detect-blob-support")}catch(se){if(se.name!=="ConstraintError")throw se;console.warn('The database "'+J.name+'" has been upgraded from version '+zt.oldVersion+" to version "+zt.newVersion+', but the storage "'+J.storeName+'" already exists.')}}),wt.onerror=function(zt){zt.preventDefault(),Tt(wt.error)},wt.onsuccess=function(){var zt=wt.result;zt.onversionchange=function(ne){ne.target.close()},at(zt),j(J)}})}function qt(J){return K(J,!1)}function ge(J){return K(J,!0)}function Ct(J,st){if(!J.db)return!0;var at=!J.db.objectStoreNames.contains(J.storeName),Tt=J.version<J.db.version,bt=J.version>J.db.version;if(Tt&&(J.version!==st&&console.warn('The database "'+J.name+`" can't be downgraded from version `+J.db.version+" to version "+J.version+"."),J.version=J.db.version),bt||at){if(at){var wt=J.db.version+1;wt>J.version&&(J.version=wt)}return!0}return!1}function ot(J){return z([function(st){for(var at=st.length,Tt=new ArrayBuffer(at),bt=new Uint8Array(Tt),wt=0;wt<at;wt++)bt[wt]=st.charCodeAt(wt);return Tt}(atob(J.data))],{type:J.type})}function yt(J){return J&&J.__local_forage_encoded_blob}function Pt(J){var st=this,at=st._initReady().then(function(){var Tt=L[st._dbInfo.name];if(Tt&&Tt.dbReady)return Tt.dbReady});return vt(at,J,J),at}function H(J,st,at,Tt){Tt===void 0&&(Tt=1);try{var bt=J.db.transaction(J.storeName,st);at(null,bt)}catch(wt){if(Tt>0&&(!J.db||wt.name==="InvalidStateError"||wt.name==="NotFoundError"))return k.resolve().then(function(){if(!J.db||wt.name==="NotFoundError"&&!J.db.objectStoreNames.contains(J.storeName)&&J.version<=J.db.version)return J.db&&(J.version=J.db.version+1),ge(J)}).then(function(){return function(zt){C(zt);for(var ne=L[zt.name],se=ne.forages,ae=0;ae<se.length;ae++){var xe=se[ae];xe._dbInfo.db&&(xe._dbInfo.db.close(),xe._dbInfo.db=null)}return zt.db=null,qt(zt).then(function(Ie){return zt.db=Ie,Ct(zt)?ge(zt):Ie}).then(function(Ie){zt.db=ne.db=Ie;for(var Ge=0;Ge<se.length;Ge++)se[Ge]._dbInfo.db=Ie}).catch(function(Ie){throw X(zt,Ie),Ie})}(J).then(function(){H(J,st,at,Tt-1)})}).catch(at);at(wt)}}var ft={_driver:"asyncStorage",_initStorage:function(J){var st=this,at={db:null};if(J)for(var Tt in J)at[Tt]=J[Tt];var bt=L[at.name];bt||(bt={forages:[],db:null,dbReady:null,deferredOperations:[]},L[at.name]=bt),bt.forages.push(st),st._initReady||(st._initReady=st.ready,st.ready=Pt);var wt=[];function zt(){return k.resolve()}for(var ne=0;ne<bt.forages.length;ne++){var se=bt.forages[ne];se!==st&&wt.push(se._initReady().catch(zt))}var ae=bt.forages.slice(0);return k.all(wt).then(function(){return at.db=bt.db,qt(at)}).then(function(xe){return at.db=xe,Ct(at,st._defaultConfig.version)?ge(at):xe}).then(function(xe){at.db=bt.db=xe,st._dbInfo=at;for(var Ie=0;Ie<ae.length;Ie++){var Ge=ae[Ie];Ge!==st&&(Ge._dbInfo.db=at.db,Ge._dbInfo.version=at.version)}})},_support:function(){try{if(!V||!V.open)return!1;var J=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),st=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!J||st)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch{return!1}}(),iterate:function(J,st){var at=this,Tt=new k(function(bt,wt){at.ready().then(function(){H(at._dbInfo,"readonly",function(zt,ne){if(zt)return wt(zt);try{var se=ne.objectStore(at._dbInfo.storeName).openCursor(),ae=1;se.onsuccess=function(){var xe=se.result;if(xe){var Ie=xe.value;yt(Ie)&&(Ie=ot(Ie));var Ge=J(Ie,xe.key,ae++);Ge!==void 0?bt(Ge):xe.continue()}else bt()},se.onerror=function(){wt(se.error)}}catch(xe){wt(xe)}})}).catch(wt)});return Z(Tt,st),Tt},getItem:function(J,st){var at=this;J=Ot(J);var Tt=new k(function(bt,wt){at.ready().then(function(){H(at._dbInfo,"readonly",function(zt,ne){if(zt)return wt(zt);try{var se=ne.objectStore(at._dbInfo.storeName).get(J);se.onsuccess=function(){var ae=se.result;ae===void 0&&(ae=null),yt(ae)&&(ae=ot(ae)),bt(ae)},se.onerror=function(){wt(se.error)}}catch(ae){wt(ae)}})}).catch(wt)});return Z(Tt,st),Tt},setItem:function(J,st,at){var Tt=this;J=Ot(J);var bt=new k(function(wt,zt){var ne;Tt.ready().then(function(){return ne=Tt._dbInfo,O.call(st)==="[object Blob]"?Y(ne.db).then(function(se){return se?st:(ae=st,new k(function(xe,Ie){var Ge=new FileReader;Ge.onerror=Ie,Ge.onloadend=function(qe){var pi=btoa(qe.target.result||"");xe({__local_forage_encoded_blob:!0,data:pi,type:ae.type})},Ge.readAsBinaryString(ae)}));var ae}):st}).then(function(se){H(Tt._dbInfo,"readwrite",function(ae,xe){if(ae)return zt(ae);try{var Ie=xe.objectStore(Tt._dbInfo.storeName);se===null&&(se=void 0);var Ge=Ie.put(se,J);xe.oncomplete=function(){se===void 0&&(se=null),wt(se)},xe.onabort=xe.onerror=function(){var qe=Ge.error?Ge.error:Ge.transaction.error;zt(qe)}}catch(qe){zt(qe)}})}).catch(zt)});return Z(bt,at),bt},removeItem:function(J,st){var at=this;J=Ot(J);var Tt=new k(function(bt,wt){at.ready().then(function(){H(at._dbInfo,"readwrite",function(zt,ne){if(zt)return wt(zt);try{var se=ne.objectStore(at._dbInfo.storeName).delete(J);ne.oncomplete=function(){bt()},ne.onerror=function(){wt(se.error)},ne.onabort=function(){var ae=se.error?se.error:se.transaction.error;wt(ae)}}catch(ae){wt(ae)}})}).catch(wt)});return Z(Tt,st),Tt},clear:function(J){var st=this,at=new k(function(Tt,bt){st.ready().then(function(){H(st._dbInfo,"readwrite",function(wt,zt){if(wt)return bt(wt);try{var ne=zt.objectStore(st._dbInfo.storeName).clear();zt.oncomplete=function(){Tt()},zt.onabort=zt.onerror=function(){var se=ne.error?ne.error:ne.transaction.error;bt(se)}}catch(se){bt(se)}})}).catch(bt)});return Z(at,J),at},length:function(J){var st=this,at=new k(function(Tt,bt){st.ready().then(function(){H(st._dbInfo,"readonly",function(wt,zt){if(wt)return bt(wt);try{var ne=zt.objectStore(st._dbInfo.storeName).count();ne.onsuccess=function(){Tt(ne.result)},ne.onerror=function(){bt(ne.error)}}catch(se){bt(se)}})}).catch(bt)});return Z(at,J),at},key:function(J,st){var at=this,Tt=new k(function(bt,wt){J<0?bt(null):at.ready().then(function(){H(at._dbInfo,"readonly",function(zt,ne){if(zt)return wt(zt);try{var se=ne.objectStore(at._dbInfo.storeName),ae=!1,xe=se.openKeyCursor();xe.onsuccess=function(){var Ie=xe.result;Ie?J===0||ae?bt(Ie.key):(ae=!0,Ie.advance(J)):bt(null)},xe.onerror=function(){wt(xe.error)}}catch(Ie){wt(Ie)}})}).catch(wt)});return Z(Tt,st),Tt},keys:function(J){var st=this,at=new k(function(Tt,bt){st.ready().then(function(){H(st._dbInfo,"readonly",function(wt,zt){if(wt)return bt(wt);try{var ne=zt.objectStore(st._dbInfo.storeName).openKeyCursor(),se=[];ne.onsuccess=function(){var ae=ne.result;ae?(se.push(ae.key),ae.continue()):Tt(se)},ne.onerror=function(){bt(ne.error)}}catch(ae){bt(ae)}})}).catch(bt)});return Z(at,J),at},dropInstance:function(J,st){st=Nt.apply(this,arguments);var at=this.config();(J=typeof J!="function"&&J||{}).name||(J.name=J.name||at.name,J.storeName=J.storeName||at.storeName);var Tt,bt=this;if(J.name){var wt=J.name===at.name&&bt._dbInfo.db,zt=wt?k.resolve(bt._dbInfo.db):qt(J).then(function(ne){var se=L[J.name],ae=se.forages;se.db=ne;for(var xe=0;xe<ae.length;xe++)ae[xe]._dbInfo.db=ne;return ne});Tt=J.storeName?zt.then(function(ne){if(ne.objectStoreNames.contains(J.storeName)){var se=ne.version+1;C(J);var ae=L[J.name],xe=ae.forages;ne.close();for(var Ie=0;Ie<xe.length;Ie++){var Ge=xe[Ie];Ge._dbInfo.db=null,Ge._dbInfo.version=se}return new k(function(qe,pi){var fi=V.open(J.name,se);fi.onerror=function(Sr){fi.result.close(),pi(Sr)},fi.onupgradeneeded=function(){fi.result.deleteObjectStore(J.storeName)},fi.onsuccess=function(){var Sr=fi.result;Sr.close(),qe(Sr)}}).then(function(qe){ae.db=qe;for(var pi=0;pi<xe.length;pi++){var fi=xe[pi];fi._dbInfo.db=qe,j(fi._dbInfo)}}).catch(function(qe){throw(X(J,qe)||k.resolve()).catch(function(){}),qe})}}):zt.then(function(ne){C(J);var se=L[J.name],ae=se.forages;ne.close();for(var xe=0;xe<ae.length;xe++)ae[xe]._dbInfo.db=null;return new k(function(Ie,Ge){var qe=V.deleteDatabase(J.name);qe.onerror=function(){var pi=qe.result;pi&&pi.close(),Ge(qe.error)},qe.onblocked=function(){console.warn('dropInstance blocked for database "'+J.name+'" until all open connections are closed')},qe.onsuccess=function(){var pi=qe.result;pi&&pi.close(),Ie(pi)}}).then(function(Ie){se.db=Ie;for(var Ge=0;Ge<ae.length;Ge++)j(ae[Ge]._dbInfo)}).catch(function(Ie){throw(X(J,Ie)||k.resolve()).catch(function(){}),Ie})})}else Tt=k.reject("Invalid arguments");return Z(Tt,st),Tt}},Et="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",At=/^~~local_forage_type~([^~]+)~/,Rt=9,Wt=Rt+4,$t=Object.prototype.toString;function ye(J){var st,at,Tt,bt,wt,zt=.75*J.length,ne=J.length,se=0;J[J.length-1]==="="&&(zt--,J[J.length-2]==="="&&zt--);var ae=new ArrayBuffer(zt),xe=new Uint8Array(ae);for(st=0;st<ne;st+=4)at=Et.indexOf(J[st]),Tt=Et.indexOf(J[st+1]),bt=Et.indexOf(J[st+2]),wt=Et.indexOf(J[st+3]),xe[se++]=at<<2|Tt>>4,xe[se++]=(15&Tt)<<4|bt>>2,xe[se++]=(3&bt)<<6|63&wt;return ae}function me(J){var st,at=new Uint8Array(J),Tt="";for(st=0;st<at.length;st+=3)Tt+=Et[at[st]>>2],Tt+=Et[(3&at[st])<<4|at[st+1]>>4],Tt+=Et[(15&at[st+1])<<2|at[st+2]>>6],Tt+=Et[63&at[st+2]];return at.length%3==2?Tt=Tt.substring(0,Tt.length-1)+"=":at.length%3==1&&(Tt=Tt.substring(0,Tt.length-2)+"=="),Tt}var ui={serialize:function(J,st){var at="";if(J&&(at=$t.call(J)),J&&(at==="[object ArrayBuffer]"||J.buffer&&$t.call(J.buffer)==="[object ArrayBuffer]")){var Tt,bt="__lfsc__:";J instanceof ArrayBuffer?(Tt=J,bt+="arbf"):(Tt=J.buffer,at==="[object Int8Array]"?bt+="si08":at==="[object Uint8Array]"?bt+="ui08":at==="[object Uint8ClampedArray]"?bt+="uic8":at==="[object Int16Array]"?bt+="si16":at==="[object Uint16Array]"?bt+="ur16":at==="[object Int32Array]"?bt+="si32":at==="[object Uint32Array]"?bt+="ui32":at==="[object Float32Array]"?bt+="fl32":at==="[object Float64Array]"?bt+="fl64":st(new Error("Failed to get type for BinaryArray"))),st(bt+me(Tt))}else if(at==="[object Blob]"){var wt=new FileReader;wt.onload=function(){var zt="~~local_forage_type~"+J.type+"~"+me(this.result);st("__lfsc__:blob"+zt)},wt.readAsArrayBuffer(J)}else try{st(JSON.stringify(J))}catch(zt){console.error("Couldn't convert value into a JSON string: ",J),st(null,zt)}},deserialize:function(J){if(J.substring(0,Rt)!=="__lfsc__:")return JSON.parse(J);var st,at=J.substring(Wt),Tt=J.substring(Rt,Wt);if(Tt==="blob"&&At.test(at)){var bt=at.match(At);st=bt[1],at=at.substring(bt[0].length)}var wt=ye(at);switch(Tt){case"arbf":return wt;case"blob":return z([wt],{type:st});case"si08":return new Int8Array(wt);case"ui08":return new Uint8Array(wt);case"uic8":return new Uint8ClampedArray(wt);case"si16":return new Int16Array(wt);case"ur16":return new Uint16Array(wt);case"si32":return new Int32Array(wt);case"ui32":return new Uint32Array(wt);case"fl32":return new Float32Array(wt);case"fl64":return new Float64Array(wt);default:throw new Error("Unkown type: "+Tt)}},stringToBuffer:ye,bufferToString:me};function be(J,st,at,Tt){J.executeSql("CREATE TABLE IF NOT EXISTS "+st.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],at,Tt)}function ei(J,st,at,Tt,bt,wt){J.executeSql(at,Tt,bt,function(zt,ne){ne.code===ne.SYNTAX_ERR?zt.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[st.storeName],function(se,ae){ae.rows.length?wt(se,ne):be(se,st,function(){se.executeSql(at,Tt,bt,wt)},wt)},wt):wt(zt,ne)},wt)}function Ze(J,st,at,Tt){var bt=this;J=Ot(J);var wt=new k(function(zt,ne){bt.ready().then(function(){st===void 0&&(st=null);var se=st,ae=bt._dbInfo;ae.serializer.serialize(st,function(xe,Ie){Ie?ne(Ie):ae.db.transaction(function(Ge){ei(Ge,ae,"INSERT OR REPLACE INTO "+ae.storeName+" (key, value) VALUES (?, ?)",[J,xe],function(){zt(se)},function(qe,pi){ne(pi)})},function(Ge){if(Ge.code===Ge.QUOTA_ERR){if(Tt>0)return void zt(Ze.apply(bt,[J,se,at,Tt-1]));ne(Ge)}})})}).catch(ne)});return Z(wt,at),wt}function ri(J){return new k(function(st,at){J.transaction(function(Tt){Tt.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(bt,wt){for(var zt=[],ne=0;ne<wt.rows.length;ne++)zt.push(wt.rows.item(ne).name);st({db:J,storeNames:zt})},function(bt,wt){at(wt)})},function(Tt){at(Tt)})})}var De={_driver:"webSQLStorage",_initStorage:function(J){var st=this,at={db:null};if(J)for(var Tt in J)at[Tt]=typeof J[Tt]!="string"?J[Tt].toString():J[Tt];var bt=new k(function(wt,zt){try{at.db=openDatabase(at.name,String(at.version),at.description,at.size)}catch(ne){return zt(ne)}at.db.transaction(function(ne){be(ne,at,function(){st._dbInfo=at,wt()},function(se,ae){zt(ae)})},zt)});return at.serializer=ui,bt},_support:typeof openDatabase=="function",iterate:function(J,st){var at=this,Tt=new k(function(bt,wt){at.ready().then(function(){var zt=at._dbInfo;zt.db.transaction(function(ne){ei(ne,zt,"SELECT * FROM "+zt.storeName,[],function(se,ae){for(var xe=ae.rows,Ie=xe.length,Ge=0;Ge<Ie;Ge++){var qe=xe.item(Ge),pi=qe.value;if(pi&&(pi=zt.serializer.deserialize(pi)),(pi=J(pi,qe.key,Ge+1))!==void 0)return void bt(pi)}bt()},function(se,ae){wt(ae)})})}).catch(wt)});return Z(Tt,st),Tt},getItem:function(J,st){var at=this;J=Ot(J);var Tt=new k(function(bt,wt){at.ready().then(function(){var zt=at._dbInfo;zt.db.transaction(function(ne){ei(ne,zt,"SELECT * FROM "+zt.storeName+" WHERE key = ? LIMIT 1",[J],function(se,ae){var xe=ae.rows.length?ae.rows.item(0).value:null;xe&&(xe=zt.serializer.deserialize(xe)),bt(xe)},function(se,ae){wt(ae)})})}).catch(wt)});return Z(Tt,st),Tt},setItem:function(J,st,at){return Ze.apply(this,[J,st,at,1])},removeItem:function(J,st){var at=this;J=Ot(J);var Tt=new k(function(bt,wt){at.ready().then(function(){var zt=at._dbInfo;zt.db.transaction(function(ne){ei(ne,zt,"DELETE FROM "+zt.storeName+" WHERE key = ?",[J],function(){bt()},function(se,ae){wt(ae)})})}).catch(wt)});return Z(Tt,st),Tt},clear:function(J){var st=this,at=new k(function(Tt,bt){st.ready().then(function(){var wt=st._dbInfo;wt.db.transaction(function(zt){ei(zt,wt,"DELETE FROM "+wt.storeName,[],function(){Tt()},function(ne,se){bt(se)})})}).catch(bt)});return Z(at,J),at},length:function(J){var st=this,at=new k(function(Tt,bt){st.ready().then(function(){var wt=st._dbInfo;wt.db.transaction(function(zt){ei(zt,wt,"SELECT COUNT(key) as c FROM "+wt.storeName,[],function(ne,se){var ae=se.rows.item(0).c;Tt(ae)},function(ne,se){bt(se)})})}).catch(bt)});return Z(at,J),at},key:function(J,st){var at=this,Tt=new k(function(bt,wt){at.ready().then(function(){var zt=at._dbInfo;zt.db.transaction(function(ne){ei(ne,zt,"SELECT key FROM "+zt.storeName+" WHERE id = ? LIMIT 1",[J+1],function(se,ae){var xe=ae.rows.length?ae.rows.item(0).key:null;bt(xe)},function(se,ae){wt(ae)})})}).catch(wt)});return Z(Tt,st),Tt},keys:function(J){var st=this,at=new k(function(Tt,bt){st.ready().then(function(){var wt=st._dbInfo;wt.db.transaction(function(zt){ei(zt,wt,"SELECT key FROM "+wt.storeName,[],function(ne,se){for(var ae=[],xe=0;xe<se.rows.length;xe++)ae.push(se.rows.item(xe).key);Tt(ae)},function(ne,se){bt(se)})})}).catch(bt)});return Z(at,J),at},dropInstance:function(J,st){st=Nt.apply(this,arguments);var at=this.config();(J=typeof J!="function"&&J||{}).name||(J.name=J.name||at.name,J.storeName=J.storeName||at.storeName);var Tt,bt=this;return Z(Tt=J.name?new k(function(wt){var zt;zt=J.name===at.name?bt._dbInfo.db:openDatabase(J.name,"","",0),J.storeName?wt({db:zt,storeNames:[J.storeName]}):wt(ri(zt))}).then(function(wt){return new k(function(zt,ne){wt.db.transaction(function(se){function ae(qe){return new k(function(pi,fi){se.executeSql("DROP TABLE IF EXISTS "+qe,[],function(){pi()},function(Sr,Lo){fi(Lo)})})}for(var xe=[],Ie=0,Ge=wt.storeNames.length;Ie<Ge;Ie++)xe.push(ae(wt.storeNames[Ie]));k.all(xe).then(function(){zt()}).catch(function(qe){ne(qe)})},function(se){ne(se)})})}):k.reject("Invalid arguments"),st),Tt}};function Bi(J,st){var at=J.name+"/";return J.storeName!==st.storeName&&(at+=J.storeName+"/"),at}function Di(){return!function(){try{return localStorage.setItem("_localforage_support_test",!0),localStorage.removeItem("_localforage_support_test"),!1}catch{return!0}}()||localStorage.length>0}var Ci={_driver:"localStorageWrapper",_initStorage:function(J){var st={};if(J)for(var at in J)st[at]=J[at];return st.keyPrefix=Bi(J,this._defaultConfig),Di()?(this._dbInfo=st,st.serializer=ui,k.resolve()):k.reject()},_support:function(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}(),iterate:function(J,st){var at=this,Tt=at.ready().then(function(){for(var bt=at._dbInfo,wt=bt.keyPrefix,zt=wt.length,ne=localStorage.length,se=1,ae=0;ae<ne;ae++){var xe=localStorage.key(ae);if(xe.indexOf(wt)===0){var Ie=localStorage.getItem(xe);if(Ie&&(Ie=bt.serializer.deserialize(Ie)),(Ie=J(Ie,xe.substring(zt),se++))!==void 0)return Ie}}});return Z(Tt,st),Tt},getItem:function(J,st){var at=this;J=Ot(J);var Tt=at.ready().then(function(){var bt=at._dbInfo,wt=localStorage.getItem(bt.keyPrefix+J);return wt&&(wt=bt.serializer.deserialize(wt)),wt});return Z(Tt,st),Tt},setItem:function(J,st,at){var Tt=this;J=Ot(J);var bt=Tt.ready().then(function(){st===void 0&&(st=null);var wt=st;return new k(function(zt,ne){var se=Tt._dbInfo;se.serializer.serialize(st,function(ae,xe){if(xe)ne(xe);else try{localStorage.setItem(se.keyPrefix+J,ae),zt(wt)}catch(Ie){Ie.name!=="QuotaExceededError"&&Ie.name!=="NS_ERROR_DOM_QUOTA_REACHED"||ne(Ie),ne(Ie)}})})});return Z(bt,at),bt},removeItem:function(J,st){var at=this;J=Ot(J);var Tt=at.ready().then(function(){var bt=at._dbInfo;localStorage.removeItem(bt.keyPrefix+J)});return Z(Tt,st),Tt},clear:function(J){var st=this,at=st.ready().then(function(){for(var Tt=st._dbInfo.keyPrefix,bt=localStorage.length-1;bt>=0;bt--){var wt=localStorage.key(bt);wt.indexOf(Tt)===0&&localStorage.removeItem(wt)}});return Z(at,J),at},length:function(J){var st=this.keys().then(function(at){return at.length});return Z(st,J),st},key:function(J,st){var at=this,Tt=at.ready().then(function(){var bt,wt=at._dbInfo;try{bt=localStorage.key(J)}catch{bt=null}return bt&&(bt=bt.substring(wt.keyPrefix.length)),bt});return Z(Tt,st),Tt},keys:function(J){var st=this,at=st.ready().then(function(){for(var Tt=st._dbInfo,bt=localStorage.length,wt=[],zt=0;zt<bt;zt++){var ne=localStorage.key(zt);ne.indexOf(Tt.keyPrefix)===0&&wt.push(ne.substring(Tt.keyPrefix.length))}return wt});return Z(at,J),at},dropInstance:function(J,st){if(st=Nt.apply(this,arguments),!(J=typeof J!="function"&&J||{}).name){var at=this.config();J.name=J.name||at.name,J.storeName=J.storeName||at.storeName}var Tt,bt=this;return Z(Tt=J.name?new k(function(wt){J.storeName?wt(Bi(J,bt._defaultConfig)):wt(J.name+"/")}).then(function(wt){for(var zt=localStorage.length-1;zt>=0;zt--){var ne=localStorage.key(zt);ne.indexOf(wt)===0&&localStorage.removeItem(ne)}}):k.reject("Invalid arguments"),st),Tt}},Ki=function(J,st){for(var at,Tt,bt=J.length,wt=0;wt<bt;){if((at=J[wt])===(Tt=st)||typeof at=="number"&&typeof Tt=="number"&&isNaN(at)&&isNaN(Tt))return!0;wt++}return!1},Ii=Array.isArray||function(J){return Object.prototype.toString.call(J)==="[object Array]"},Ui={},On={},Qi={INDEXEDDB:ft,WEBSQL:De,LOCALSTORAGE:Ci},Yn=[Qi.INDEXEDDB._driver,Qi.WEBSQL._driver,Qi.LOCALSTORAGE._driver],$n=["dropInstance"],La=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat($n),Hs={description:"",driver:Yn.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function zu(J,st){J[st]=function(){var at=arguments;return J.ready().then(function(){return J[st].apply(J,at)})}}function Oa(){for(var J=1;J<arguments.length;J++){var st=arguments[J];if(st)for(var at in st)st.hasOwnProperty(at)&&(Ii(st[at])?arguments[0][at]=st[at].slice():arguments[0][at]=st[at])}return arguments[0]}var Zr=new(function(){function J(st){for(var at in function(wt,zt){if(!(wt instanceof zt))throw new TypeError("Cannot call a class as a function")}(this,J),Qi)if(Qi.hasOwnProperty(at)){var Tt=Qi[at],bt=Tt._driver;this[at]=bt,Ui[bt]||this.defineDriver(Tt)}this._defaultConfig=Oa({},Hs),this._config=Oa({},this._defaultConfig,st),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return J.prototype.config=function(st){if((st===void 0?"undefined":P(st))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var at in st){if(at==="storeName"&&(st[at]=st[at].replace(/\W/g,"_")),at==="version"&&typeof st[at]!="number")return new Error("Database version must be a number.");this._config[at]=st[at]}return!("driver"in st)||!st.driver||this.setDriver(this._config.driver)}return typeof st=="string"?this._config[st]:this._config},J.prototype.defineDriver=function(st,at,Tt){var bt=new k(function(wt,zt){try{var ne=st._driver,se=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!st._driver)return void zt(se);for(var ae=La.concat("_initStorage"),xe=0,Ie=ae.length;xe<Ie;xe++){var Ge=ae[xe];if((!Ki($n,Ge)||st[Ge])&&typeof st[Ge]!="function")return void zt(se)}(function(){for(var pi=function(zs){return function(){var Cl=new Error("Method "+zs+" is not implemented by the current driver"),qi=k.reject(Cl);return Z(qi,arguments[arguments.length-1]),qi}},fi=0,Sr=$n.length;fi<Sr;fi++){var Lo=$n[fi];st[Lo]||(st[Lo]=pi(Lo))}})();var qe=function(pi){Ui[ne]&&console.info("Redefining LocalForage driver: "+ne),Ui[ne]=st,On[ne]=pi,wt()};"_support"in st?st._support&&typeof st._support=="function"?st._support().then(qe,zt):qe(!!st._support):qe(!0)}catch(pi){zt(pi)}});return vt(bt,at,Tt),bt},J.prototype.driver=function(){return this._driver||null},J.prototype.getDriver=function(st,at,Tt){var bt=Ui[st]?k.resolve(Ui[st]):k.reject(new Error("Driver not found."));return vt(bt,at,Tt),bt},J.prototype.getSerializer=function(st){var at=k.resolve(ui);return vt(at,st),at},J.prototype.ready=function(st){var at=this,Tt=at._driverSet.then(function(){return at._ready===null&&(at._ready=at._initDriver()),at._ready});return vt(Tt,st,st),Tt},J.prototype.setDriver=function(st,at,Tt){var bt=this;Ii(st)||(st=[st]);var wt=this._getSupportedDrivers(st);function zt(){bt._config.driver=bt.driver()}function ne(ae){return bt._extend(ae),zt(),bt._ready=bt._initStorage(bt._config),bt._ready}var se=this._driverSet!==null?this._driverSet.catch(function(){return k.resolve()}):k.resolve();return this._driverSet=se.then(function(){var ae=wt[0];return bt._dbInfo=null,bt._ready=null,bt.getDriver(ae).then(function(xe){bt._driver=xe._driver,zt(),bt._wrapLibraryMethodsWithReady(),bt._initDriver=function(Ie){return function(){var Ge=0;return function qe(){for(;Ge<Ie.length;){var pi=Ie[Ge];return Ge++,bt._dbInfo=null,bt._ready=null,bt.getDriver(pi).then(ne).catch(qe)}zt();var fi=new Error("No available storage method found.");return bt._driverSet=k.reject(fi),bt._driverSet}()}}(wt)})}).catch(function(){zt();var ae=new Error("No available storage method found.");return bt._driverSet=k.reject(ae),bt._driverSet}),vt(this._driverSet,at,Tt),this._driverSet},J.prototype.supports=function(st){return!!On[st]},J.prototype._extend=function(st){Oa(this,st)},J.prototype._getSupportedDrivers=function(st){for(var at=[],Tt=0,bt=st.length;Tt<bt;Tt++){var wt=st[Tt];this.supports(wt)&&at.push(wt)}return at},J.prototype._wrapLibraryMethodsWithReady=function(){for(var st=0,at=La.length;st<at;st++)zu(this,La[st])},J.prototype.createInstance=function(st){return new J(st)},J}());ht.exports=Zr},{3:3}]},{},[4])(4)}).call(this,v(3))},function(T,M,v){var b=v(57),q=v(58);function ht(){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}M.parse=C,M.resolve=function(j,X){return C(j,!1,!0).resolve(X)},M.resolveObject=function(j,X){return j?C(j,!1,!0).resolveObject(X):X},M.format=function(j){return q.isString(j)&&(j=C(j)),j instanceof ht?j.format():ht.prototype.format.call(j)},M.Url=ht;var W=/^([a-z0-9.+-]+:)/i,P=/:[0-9]*$/,V=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,z=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
28
|
+
`," "]),k=["'"].concat(z),Z=["%","/","?",";","#"].concat(k),vt=["/","?","#"],Ot=/^[+a-z0-9A-Z_-]{0,63}$/,Nt=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,E={javascript:!0,"javascript:":!0},L={javascript:!0,"javascript:":!0},O={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Y=v(59);function C(j,X,K){if(j&&q.isObject(j)&&j instanceof ht)return j;var qt=new ht;return qt.parse(j,X,K),qt}ht.prototype.parse=function(j,X,K){if(!q.isString(j))throw new TypeError("Parameter 'url' must be a string, not "+typeof j);var qt=j.indexOf("?"),ge=qt!==-1&&qt<j.indexOf("#")?"?":"#",Ct=j.split(ge);Ct[0]=Ct[0].replace(/\\/g,"/");var ot=j=Ct.join(ge);if(ot=ot.trim(),!K&&j.split("#").length===1){var yt=V.exec(ot);if(yt)return this.path=ot,this.href=ot,this.pathname=yt[1],yt[2]?(this.search=yt[2],this.query=X?Y.parse(this.search.substr(1)):this.search.substr(1)):X&&(this.search="",this.query={}),this}var Pt=W.exec(ot);if(Pt){var H=(Pt=Pt[0]).toLowerCase();this.protocol=H,ot=ot.substr(Pt.length)}if(K||Pt||ot.match(/^\/\/[^@\/]+@[^@\/]+/)){var ft=ot.substr(0,2)==="//";!ft||Pt&&L[Pt]||(ot=ot.substr(2),this.slashes=!0)}if(!L[Pt]&&(ft||Pt&&!O[Pt])){for(var Et,At,Rt=-1,Wt=0;Wt<vt.length;Wt++)($t=ot.indexOf(vt[Wt]))!==-1&&(Rt===-1||$t<Rt)&&(Rt=$t);for((At=Rt===-1?ot.lastIndexOf("@"):ot.lastIndexOf("@",Rt))!==-1&&(Et=ot.slice(0,At),ot=ot.slice(At+1),this.auth=decodeURIComponent(Et)),Rt=-1,Wt=0;Wt<Z.length;Wt++){var $t;($t=ot.indexOf(Z[Wt]))!==-1&&(Rt===-1||$t<Rt)&&(Rt=$t)}Rt===-1&&(Rt=ot.length),this.host=ot.slice(0,Rt),ot=ot.slice(Rt),this.parseHost(),this.hostname=this.hostname||"";var ye=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!ye)for(var me=this.hostname.split(/\./),ui=(Wt=0,me.length);Wt<ui;Wt++){var be=me[Wt];if(be&&!be.match(Ot)){for(var ei="",Ze=0,ri=be.length;Ze<ri;Ze++)be.charCodeAt(Ze)>127?ei+="x":ei+=be[Ze];if(!ei.match(Ot)){var De=me.slice(0,Wt),Bi=me.slice(Wt+1),Di=be.match(Nt);Di&&(De.push(Di[1]),Bi.unshift(Di[2])),Bi.length&&(ot="/"+Bi.join(".")+ot),this.hostname=De.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),ye||(this.hostname=b.toASCII(this.hostname));var Ci=this.port?":"+this.port:"",Ki=this.hostname||"";this.host=Ki+Ci,this.href+=this.host,ye&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),ot[0]!=="/"&&(ot="/"+ot))}if(!E[H])for(Wt=0,ui=k.length;Wt<ui;Wt++){var Ii=k[Wt];if(ot.indexOf(Ii)!==-1){var Ui=encodeURIComponent(Ii);Ui===Ii&&(Ui=escape(Ii)),ot=ot.split(Ii).join(Ui)}}var On=ot.indexOf("#");On!==-1&&(this.hash=ot.substr(On),ot=ot.slice(0,On));var Qi=ot.indexOf("?");if(Qi!==-1?(this.search=ot.substr(Qi),this.query=ot.substr(Qi+1),X&&(this.query=Y.parse(this.query)),ot=ot.slice(0,Qi)):X&&(this.search="",this.query={}),ot&&(this.pathname=ot),O[H]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){Ci=this.pathname||"";var Yn=this.search||"";this.path=Ci+Yn}return this.href=this.format(),this},ht.prototype.format=function(){var j=this.auth||"";j&&(j=(j=encodeURIComponent(j)).replace(/%3A/i,":"),j+="@");var X=this.protocol||"",K=this.pathname||"",qt=this.hash||"",ge=!1,Ct="";this.host?ge=j+this.host:this.hostname&&(ge=j+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(ge+=":"+this.port)),this.query&&q.isObject(this.query)&&Object.keys(this.query).length&&(Ct=Y.stringify(this.query));var ot=this.search||Ct&&"?"+Ct||"";return X&&X.substr(-1)!==":"&&(X+=":"),this.slashes||(!X||O[X])&&ge!==!1?(ge="//"+(ge||""),K&&K.charAt(0)!=="/"&&(K="/"+K)):ge||(ge=""),qt&&qt.charAt(0)!=="#"&&(qt="#"+qt),ot&&ot.charAt(0)!=="?"&&(ot="?"+ot),X+ge+(K=K.replace(/[?#]/g,function(yt){return encodeURIComponent(yt)}))+(ot=ot.replace("#","%23"))+qt},ht.prototype.resolve=function(j){return this.resolveObject(C(j,!1,!0)).format()},ht.prototype.resolveObject=function(j){if(q.isString(j)){var X=new ht;X.parse(j,!1,!0),j=X}for(var K=new ht,qt=Object.keys(this),ge=0;ge<qt.length;ge++){var Ct=qt[ge];K[Ct]=this[Ct]}if(K.hash=j.hash,j.href==="")return K.href=K.format(),K;if(j.slashes&&!j.protocol){for(var ot=Object.keys(j),yt=0;yt<ot.length;yt++){var Pt=ot[yt];Pt!=="protocol"&&(K[Pt]=j[Pt])}return O[K.protocol]&&K.hostname&&!K.pathname&&(K.path=K.pathname="/"),K.href=K.format(),K}if(j.protocol&&j.protocol!==K.protocol){if(!O[j.protocol]){for(var H=Object.keys(j),ft=0;ft<H.length;ft++){var Et=H[ft];K[Et]=j[Et]}return K.href=K.format(),K}if(K.protocol=j.protocol,j.host||L[j.protocol])K.pathname=j.pathname;else{for(var At=(j.pathname||"").split("/");At.length&&!(j.host=At.shift()););j.host||(j.host=""),j.hostname||(j.hostname=""),At[0]!==""&&At.unshift(""),At.length<2&&At.unshift(""),K.pathname=At.join("/")}if(K.search=j.search,K.query=j.query,K.host=j.host||"",K.auth=j.auth,K.hostname=j.hostname||j.host,K.port=j.port,K.pathname||K.search){var Rt=K.pathname||"",Wt=K.search||"";K.path=Rt+Wt}return K.slashes=K.slashes||j.slashes,K.href=K.format(),K}var $t=K.pathname&&K.pathname.charAt(0)==="/",ye=j.host||j.pathname&&j.pathname.charAt(0)==="/",me=ye||$t||K.host&&j.pathname,ui=me,be=K.pathname&&K.pathname.split("/")||[],ei=(At=j.pathname&&j.pathname.split("/")||[],K.protocol&&!O[K.protocol]);if(ei&&(K.hostname="",K.port=null,K.host&&(be[0]===""?be[0]=K.host:be.unshift(K.host)),K.host="",j.protocol&&(j.hostname=null,j.port=null,j.host&&(At[0]===""?At[0]=j.host:At.unshift(j.host)),j.host=null),me=me&&(At[0]===""||be[0]==="")),ye)K.host=j.host||j.host===""?j.host:K.host,K.hostname=j.hostname||j.hostname===""?j.hostname:K.hostname,K.search=j.search,K.query=j.query,be=At;else if(At.length)be||(be=[]),be.pop(),be=be.concat(At),K.search=j.search,K.query=j.query;else if(!q.isNullOrUndefined(j.search))return ei&&(K.hostname=K.host=be.shift(),(Di=!!(K.host&&K.host.indexOf("@")>0)&&K.host.split("@"))&&(K.auth=Di.shift(),K.host=K.hostname=Di.shift())),K.search=j.search,K.query=j.query,q.isNull(K.pathname)&&q.isNull(K.search)||(K.path=(K.pathname?K.pathname:"")+(K.search?K.search:"")),K.href=K.format(),K;if(!be.length)return K.pathname=null,K.search?K.path="/"+K.search:K.path=null,K.href=K.format(),K;for(var Ze=be.slice(-1)[0],ri=(K.host||j.host||be.length>1)&&(Ze==="."||Ze==="..")||Ze==="",De=0,Bi=be.length;Bi>=0;Bi--)(Ze=be[Bi])==="."?be.splice(Bi,1):Ze===".."?(be.splice(Bi,1),De++):De&&(be.splice(Bi,1),De--);if(!me&&!ui)for(;De--;De)be.unshift("..");!me||be[0]===""||be[0]&&be[0].charAt(0)==="/"||be.unshift(""),ri&&be.join("/").substr(-1)!=="/"&&be.push("");var Di,Ci=be[0]===""||be[0]&&be[0].charAt(0)==="/";return ei&&(K.hostname=K.host=Ci?"":be.length?be.shift():"",(Di=!!(K.host&&K.host.indexOf("@")>0)&&K.host.split("@"))&&(K.auth=Di.shift(),K.host=K.hostname=Di.shift())),(me=me||K.host&&be.length)&&!Ci&&be.unshift(""),be.length?K.pathname=be.join("/"):(K.pathname=null,K.path=null),q.isNull(K.pathname)&&q.isNull(K.search)||(K.path=(K.pathname?K.pathname:"")+(K.search?K.search:"")),K.auth=j.auth||K.auth,K.slashes=K.slashes||j.slashes,K.href=K.format(),K},ht.prototype.parseHost=function(){var j=this.host,X=P.exec(j);X&&((X=X[0])!==":"&&(this.port=X.substr(1)),j=j.substr(0,j.length-X.length)),j&&(this.hostname=j)}},function(T,M,v){var b=v(62);T.exports=function(q,ht){ht=ht||{};var W=new b,P=ht.inPlace||!1,V=q.map(function(k){return P?k:{width:k.width,height:k.height,item:k}});V=V.sort(function(k,Z){return Z.width*Z.height-k.width*k.height}),W.fit(V);var z={width:V.reduce(function(k,Z){return Math.max(k,Z.x+Z.width)},0),height:V.reduce(function(k,Z){return Math.max(k,Z.y+Z.height)},0)};return P||(z.items=V),z}},function(T,M){T.exports=function(v){return v.webpackPolyfill||(v.deprecate=function(){},v.paths=[],v.children||(v.children=[]),Object.defineProperty(v,"loaded",{enumerable:!0,get:function(){return v.l}}),Object.defineProperty(v,"id",{enumerable:!0,get:function(){return v.i}}),v.webpackPolyfill=1),v}},function(T,M,v){var b=Object.prototype.hasOwnProperty,q="~";function ht(){}function W(k,Z,vt){this.fn=k,this.context=Z,this.once=vt||!1}function P(k,Z,vt,Ot,Nt){if(typeof vt!="function")throw new TypeError("The listener must be a function");var E=new W(vt,Ot||k,Nt),L=q?q+Z:Z;return k._events[L]?k._events[L].fn?k._events[L]=[k._events[L],E]:k._events[L].push(E):(k._events[L]=E,k._eventsCount++),k}function V(k,Z){--k._eventsCount==0?k._events=new ht:delete k._events[Z]}function z(){this._events=new ht,this._eventsCount=0}Object.create&&(ht.prototype=Object.create(null),new ht().__proto__||(q=!1)),z.prototype.eventNames=function(){var k,Z,vt=[];if(this._eventsCount===0)return vt;for(Z in k=this._events)b.call(k,Z)&&vt.push(q?Z.slice(1):Z);return Object.getOwnPropertySymbols?vt.concat(Object.getOwnPropertySymbols(k)):vt},z.prototype.listeners=function(k){var Z=q?q+k:k,vt=this._events[Z];if(!vt)return[];if(vt.fn)return[vt.fn];for(var Ot=0,Nt=vt.length,E=new Array(Nt);Ot<Nt;Ot++)E[Ot]=vt[Ot].fn;return E},z.prototype.listenerCount=function(k){var Z=q?q+k:k,vt=this._events[Z];return vt?vt.fn?1:vt.length:0},z.prototype.emit=function(k,Z,vt,Ot,Nt,E){var L=q?q+k:k;if(!this._events[L])return!1;var O,Y,C=this._events[L],j=arguments.length;if(C.fn){switch(C.once&&this.removeListener(k,C.fn,void 0,!0),j){case 1:return C.fn.call(C.context),!0;case 2:return C.fn.call(C.context,Z),!0;case 3:return C.fn.call(C.context,Z,vt),!0;case 4:return C.fn.call(C.context,Z,vt,Ot),!0;case 5:return C.fn.call(C.context,Z,vt,Ot,Nt),!0;case 6:return C.fn.call(C.context,Z,vt,Ot,Nt,E),!0}for(Y=1,O=new Array(j-1);Y<j;Y++)O[Y-1]=arguments[Y];C.fn.apply(C.context,O)}else{var X,K=C.length;for(Y=0;Y<K;Y++)switch(C[Y].once&&this.removeListener(k,C[Y].fn,void 0,!0),j){case 1:C[Y].fn.call(C[Y].context);break;case 2:C[Y].fn.call(C[Y].context,Z);break;case 3:C[Y].fn.call(C[Y].context,Z,vt);break;case 4:C[Y].fn.call(C[Y].context,Z,vt,Ot);break;default:if(!O)for(X=1,O=new Array(j-1);X<j;X++)O[X-1]=arguments[X];C[Y].fn.apply(C[Y].context,O)}}return!0},z.prototype.on=function(k,Z,vt){return P(this,k,Z,vt,!1)},z.prototype.once=function(k,Z,vt){return P(this,k,Z,vt,!0)},z.prototype.removeListener=function(k,Z,vt,Ot){var Nt=q?q+k:k;if(!this._events[Nt])return this;if(!Z)return V(this,Nt),this;var E=this._events[Nt];if(E.fn)E.fn!==Z||Ot&&!E.once||vt&&E.context!==vt||V(this,Nt);else{for(var L=0,O=[],Y=E.length;L<Y;L++)(E[L].fn!==Z||Ot&&!E[L].once||vt&&E[L].context!==vt)&&O.push(E[L]);O.length?this._events[Nt]=O.length===1?O[0]:O:V(this,Nt)}return this},z.prototype.removeAllListeners=function(k){var Z;return k?(Z=q?q+k:k,this._events[Z]&&V(this,Z)):(this._events=new ht,this._eventsCount=0),this},z.prototype.off=z.prototype.removeListener,z.prototype.addListener=z.prototype.on,z.prefixed=q,z.EventEmitter=z,T.exports=z},function(T,M,v){function b(H,ft,Et){Et=Et||2;var At,Rt,Wt,$t,ye,me,ui,be=ft&&ft.length,ei=be?ft[0]*Et:H.length,Ze=q(H,0,ei,Et,!0),ri=[];if(!Ze||Ze.next===Ze.prev)return ri;if(be&&(Ze=function(Bi,Di,Ci,Ki){var Ii,Ui,On,Qi,Yn,$n=[];for(Ii=0,Ui=Di.length;Ii<Ui;Ii++)On=Di[Ii]*Ki,Qi=Ii<Ui-1?Di[Ii+1]*Ki:Bi.length,(Yn=q(Bi,On,Qi,Ki,!1))===Yn.next&&(Yn.steiner=!0),$n.push(E(Yn));for($n.sort(Z),Ii=0;Ii<$n.length;Ii++)Ci=ht(Ci=vt($n[Ii],Ci),Ci.next);return Ci}(H,ft,Ze,Et)),H.length>80*Et){At=Wt=H[0],Rt=$t=H[1];for(var De=Et;De<ei;De+=Et)(ye=H[De])<At&&(At=ye),(me=H[De+1])<Rt&&(Rt=me),ye>Wt&&(Wt=ye),me>$t&&($t=me);ui=(ui=Math.max(Wt-At,$t-Rt))!==0?1/ui:0}return W(Ze,ri,Et,At,Rt,ui),ri}function q(H,ft,Et,At,Rt){var Wt,$t;if(Rt===Pt(H,ft,Et,At)>0)for(Wt=ft;Wt<Et;Wt+=At)$t=Ct(Wt,H[Wt],H[Wt+1],$t);else for(Wt=Et-At;Wt>=ft;Wt-=At)$t=Ct(Wt,H[Wt],H[Wt+1],$t);return $t&&C($t,$t.next)&&(ot($t),$t=$t.next),$t}function ht(H,ft){if(!H)return H;ft||(ft=H);var Et,At=H;do if(Et=!1,At.steiner||!C(At,At.next)&&Y(At.prev,At,At.next)!==0)At=At.next;else{if(ot(At),(At=ft=At.prev)===At.next)break;Et=!0}while(Et||At!==ft);return ft}function W(H,ft,Et,At,Rt,Wt,$t){if(H){!$t&&Wt&&function(be,ei,Ze,ri){var De=be;do De.z===null&&(De.z=Nt(De.x,De.y,ei,Ze,ri)),De.prevZ=De.prev,De.nextZ=De.next,De=De.next;while(De!==be);De.prevZ.nextZ=null,De.prevZ=null,function(Bi){var Di,Ci,Ki,Ii,Ui,On,Qi,Yn,$n=1;do{for(Ci=Bi,Bi=null,Ui=null,On=0;Ci;){for(On++,Ki=Ci,Qi=0,Di=0;Di<$n&&(Qi++,Ki=Ki.nextZ);Di++);for(Yn=$n;Qi>0||Yn>0&&Ki;)Qi!==0&&(Yn===0||!Ki||Ci.z<=Ki.z)?(Ii=Ci,Ci=Ci.nextZ,Qi--):(Ii=Ki,Ki=Ki.nextZ,Yn--),Ui?Ui.nextZ=Ii:Bi=Ii,Ii.prevZ=Ui,Ui=Ii;Ci=Ki}Ui.nextZ=null,$n*=2}while(On>1)}(De)}(H,At,Rt,Wt);for(var ye,me,ui=H;H.prev!==H.next;)if(ye=H.prev,me=H.next,Wt?V(H,At,Rt,Wt):P(H))ft.push(ye.i/Et),ft.push(H.i/Et),ft.push(me.i/Et),ot(H),H=me.next,ui=me.next;else if((H=me)===ui){$t?$t===1?W(H=z(ht(H),ft,Et),ft,Et,At,Rt,Wt,2):$t===2&&k(H,ft,Et,At,Rt,Wt):W(ht(H),ft,Et,At,Rt,Wt,1);break}}}function P(H){var ft=H.prev,Et=H,At=H.next;if(Y(ft,Et,At)>=0)return!1;for(var Rt=H.next.next;Rt!==H.prev;){if(L(ft.x,ft.y,Et.x,Et.y,At.x,At.y,Rt.x,Rt.y)&&Y(Rt.prev,Rt,Rt.next)>=0)return!1;Rt=Rt.next}return!0}function V(H,ft,Et,At){var Rt=H.prev,Wt=H,$t=H.next;if(Y(Rt,Wt,$t)>=0)return!1;for(var ye=Rt.x<Wt.x?Rt.x<$t.x?Rt.x:$t.x:Wt.x<$t.x?Wt.x:$t.x,me=Rt.y<Wt.y?Rt.y<$t.y?Rt.y:$t.y:Wt.y<$t.y?Wt.y:$t.y,ui=Rt.x>Wt.x?Rt.x>$t.x?Rt.x:$t.x:Wt.x>$t.x?Wt.x:$t.x,be=Rt.y>Wt.y?Rt.y>$t.y?Rt.y:$t.y:Wt.y>$t.y?Wt.y:$t.y,ei=Nt(ye,me,ft,Et,At),Ze=Nt(ui,be,ft,Et,At),ri=H.prevZ,De=H.nextZ;ri&&ri.z>=ei&&De&&De.z<=Ze;){if(ri!==H.prev&&ri!==H.next&&L(Rt.x,Rt.y,Wt.x,Wt.y,$t.x,$t.y,ri.x,ri.y)&&Y(ri.prev,ri,ri.next)>=0||(ri=ri.prevZ,De!==H.prev&&De!==H.next&&L(Rt.x,Rt.y,Wt.x,Wt.y,$t.x,$t.y,De.x,De.y)&&Y(De.prev,De,De.next)>=0))return!1;De=De.nextZ}for(;ri&&ri.z>=ei;){if(ri!==H.prev&&ri!==H.next&&L(Rt.x,Rt.y,Wt.x,Wt.y,$t.x,$t.y,ri.x,ri.y)&&Y(ri.prev,ri,ri.next)>=0)return!1;ri=ri.prevZ}for(;De&&De.z<=Ze;){if(De!==H.prev&&De!==H.next&&L(Rt.x,Rt.y,Wt.x,Wt.y,$t.x,$t.y,De.x,De.y)&&Y(De.prev,De,De.next)>=0)return!1;De=De.nextZ}return!0}function z(H,ft,Et){var At=H;do{var Rt=At.prev,Wt=At.next.next;!C(Rt,Wt)&&j(Rt,At,At.next,Wt)&&qt(Rt,Wt)&&qt(Wt,Rt)&&(ft.push(Rt.i/Et),ft.push(At.i/Et),ft.push(Wt.i/Et),ot(At),ot(At.next),At=H=Wt),At=At.next}while(At!==H);return ht(At)}function k(H,ft,Et,At,Rt,Wt){var $t=H;do{for(var ye=$t.next.next;ye!==$t.prev;){if($t.i!==ye.i&&O($t,ye)){var me=ge($t,ye);return $t=ht($t,$t.next),me=ht(me,me.next),W($t,ft,Et,At,Rt,Wt),void W(me,ft,Et,At,Rt,Wt)}ye=ye.next}$t=$t.next}while($t!==H)}function Z(H,ft){return H.x-ft.x}function vt(H,ft){var Et=function(Wt,$t){var ye,me=$t,ui=Wt.x,be=Wt.y,ei=-1/0;do{if(be<=me.y&&be>=me.next.y&&me.next.y!==me.y){var Ze=me.x+(be-me.y)*(me.next.x-me.x)/(me.next.y-me.y);if(Ze<=ui&&Ze>ei){if(ei=Ze,Ze===ui){if(be===me.y)return me;if(be===me.next.y)return me.next}ye=me.x<me.next.x?me:me.next}}me=me.next}while(me!==$t);if(!ye)return null;if(ui===ei)return ye;var ri,De=ye,Bi=ye.x,Di=ye.y,Ci=1/0;me=ye;do ui>=me.x&&me.x>=Bi&&ui!==me.x&&L(be<Di?ui:ei,be,Bi,Di,be<Di?ei:ui,be,me.x,me.y)&&(ri=Math.abs(be-me.y)/(ui-me.x),qt(me,Wt)&&(ri<Ci||ri===Ci&&(me.x>ye.x||me.x===ye.x&&Ot(ye,me)))&&(ye=me,Ci=ri)),me=me.next;while(me!==De);return ye}(H,ft);if(!Et)return ft;var At=ge(Et,H),Rt=ht(Et,Et.next);return ht(At,At.next),ft===Et?Rt:ft}function Ot(H,ft){return Y(H.prev,H,ft.prev)<0&&Y(ft.next,H,H.next)<0}function Nt(H,ft,Et,At,Rt){return(H=1431655765&((H=858993459&((H=252645135&((H=16711935&((H=32767*(H-Et)*Rt)|H<<8))|H<<4))|H<<2))|H<<1))|(ft=1431655765&((ft=858993459&((ft=252645135&((ft=16711935&((ft=32767*(ft-At)*Rt)|ft<<8))|ft<<4))|ft<<2))|ft<<1))<<1}function E(H){var ft=H,Et=H;do(ft.x<Et.x||ft.x===Et.x&&ft.y<Et.y)&&(Et=ft),ft=ft.next;while(ft!==H);return Et}function L(H,ft,Et,At,Rt,Wt,$t,ye){return(Rt-$t)*(ft-ye)-(H-$t)*(Wt-ye)>=0&&(H-$t)*(At-ye)-(Et-$t)*(ft-ye)>=0&&(Et-$t)*(Wt-ye)-(Rt-$t)*(At-ye)>=0}function O(H,ft){return H.next.i!==ft.i&&H.prev.i!==ft.i&&!function(Et,At){var Rt=Et;do{if(Rt.i!==Et.i&&Rt.next.i!==Et.i&&Rt.i!==At.i&&Rt.next.i!==At.i&&j(Rt,Rt.next,Et,At))return!0;Rt=Rt.next}while(Rt!==Et);return!1}(H,ft)&&(qt(H,ft)&&qt(ft,H)&&function(Et,At){var Rt=Et,Wt=!1,$t=(Et.x+At.x)/2,ye=(Et.y+At.y)/2;do Rt.y>ye!=Rt.next.y>ye&&Rt.next.y!==Rt.y&&$t<(Rt.next.x-Rt.x)*(ye-Rt.y)/(Rt.next.y-Rt.y)+Rt.x&&(Wt=!Wt),Rt=Rt.next;while(Rt!==Et);return Wt}(H,ft)&&(Y(H.prev,H,ft.prev)||Y(H,ft.prev,ft))||C(H,ft)&&Y(H.prev,H,H.next)>0&&Y(ft.prev,ft,ft.next)>0)}function Y(H,ft,Et){return(ft.y-H.y)*(Et.x-ft.x)-(ft.x-H.x)*(Et.y-ft.y)}function C(H,ft){return H.x===ft.x&&H.y===ft.y}function j(H,ft,Et,At){var Rt=K(Y(H,ft,Et)),Wt=K(Y(H,ft,At)),$t=K(Y(Et,At,H)),ye=K(Y(Et,At,ft));return Rt!==Wt&&$t!==ye||!(Rt!==0||!X(H,Et,ft))||!(Wt!==0||!X(H,At,ft))||!($t!==0||!X(Et,H,At))||!(ye!==0||!X(Et,ft,At))}function X(H,ft,Et){return ft.x<=Math.max(H.x,Et.x)&&ft.x>=Math.min(H.x,Et.x)&&ft.y<=Math.max(H.y,Et.y)&&ft.y>=Math.min(H.y,Et.y)}function K(H){return H>0?1:H<0?-1:0}function qt(H,ft){return Y(H.prev,H,H.next)<0?Y(H,ft,H.next)>=0&&Y(H,H.prev,ft)>=0:Y(H,ft,H.prev)<0||Y(H,H.next,ft)<0}function ge(H,ft){var Et=new yt(H.i,H.x,H.y),At=new yt(ft.i,ft.x,ft.y),Rt=H.next,Wt=ft.prev;return H.next=ft,ft.prev=H,Et.next=Rt,Rt.prev=Et,At.next=Et,Et.prev=At,Wt.next=At,At.prev=Wt,At}function Ct(H,ft,Et,At){var Rt=new yt(H,ft,Et);return At?(Rt.next=At.next,Rt.prev=At,At.next.prev=Rt,At.next=Rt):(Rt.prev=Rt,Rt.next=Rt),Rt}function ot(H){H.next.prev=H.prev,H.prev.next=H.next,H.prevZ&&(H.prevZ.nextZ=H.nextZ),H.nextZ&&(H.nextZ.prevZ=H.prevZ)}function yt(H,ft,Et){this.i=H,this.x=ft,this.y=Et,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Pt(H,ft,Et,At){for(var Rt=0,Wt=ft,$t=Et-At;Wt<Et;Wt+=At)Rt+=(H[$t]-H[Wt])*(H[Wt+1]+H[$t+1]),$t=Wt;return Rt}T.exports=b,T.exports.default=b,b.deviation=function(H,ft,Et,At){var Rt=ft&&ft.length,Wt=Rt?ft[0]*Et:H.length,$t=Math.abs(Pt(H,0,Wt,Et));if(Rt)for(var ye=0,me=ft.length;ye<me;ye++){var ui=ft[ye]*Et,be=ye<me-1?ft[ye+1]*Et:H.length;$t-=Math.abs(Pt(H,ui,be,Et))}var ei=0;for(ye=0;ye<At.length;ye+=3){var Ze=At[ye]*Et,ri=At[ye+1]*Et,De=At[ye+2]*Et;ei+=Math.abs((H[Ze]-H[De])*(H[ri+1]-H[Ze+1])-(H[Ze]-H[ri])*(H[De+1]-H[Ze+1]))}return $t===0&&ei===0?0:Math.abs((ei-$t)/$t)},b.flatten=function(H){for(var ft=H[0][0].length,Et={vertices:[],holes:[],dimensions:ft},At=0,Rt=0;Rt<H.length;Rt++){for(var Wt=0;Wt<H[Rt].length;Wt++)for(var $t=0;$t<ft;$t++)Et.vertices.push(H[Rt][Wt][$t]);Rt>0&&(At+=H[Rt-1].length,Et.holes.push(At))}return Et}},function(T,M){T.exports=`varying vec2 vUv;
|
|
29
29
|
void main() {
|
|
30
30
|
vUv = uv;
|
|
31
31
|
gl_Position = (projectionMatrix * modelViewMatrix) * vec4(position, 1.0);
|
|
@@ -1663,11 +1663,11 @@ void main() {
|
|
|
1663
1663
|
vec4 distColor = texture2D(textureNext, vUv);
|
|
1664
1664
|
gl_FragColor = timePercent < 0.5 ? srcColor : distColor;
|
|
1665
1665
|
}
|
|
1666
|
-
`},function(T,M,v){(function(b){var q=v(44),ht=v(45),W=setTimeout,
|
|
1666
|
+
`},function(T,M,v){(function(b){var q=v(44),ht=v(45),W=setTimeout,P=b!==void 0?b:null;function V(O){return Boolean(O&&O.length!==void 0)}function z(){}function k(O){if(!(this instanceof k))throw new TypeError("Promises must be constructed via new");if(typeof O!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],L(O,this)}function Z(O,Y){for(;O._state===3;)O=O._value;O._state!==0?(O._handled=!0,k._immediateFn(function(){var C=O._state===1?Y.onFulfilled:Y.onRejected;if(C!==null){var j;try{j=C(O._value)}catch(X){return void Ot(Y.promise,X)}vt(Y.promise,j)}else(O._state===1?vt:Ot)(Y.promise,O._value)})):O._deferreds.push(Y)}function vt(O,Y){try{if(Y===O)throw new TypeError("A promise cannot be resolved with itself.");if(Y&&(typeof Y=="object"||typeof Y=="function")){var C=Y.then;if(Y instanceof k)return O._state=3,O._value=Y,void Nt(O);if(typeof C=="function")return void L((j=C,X=Y,function(){j.apply(X,arguments)}),O)}O._state=1,O._value=Y,Nt(O)}catch(K){Ot(O,K)}var j,X}function Ot(O,Y){O._state=2,O._value=Y,Nt(O)}function Nt(O){O._state===2&&O._deferreds.length===0&&k._immediateFn(function(){O._handled||k._unhandledRejectionFn(O._value)});for(var Y=0,C=O._deferreds.length;Y<C;Y++)Z(O,O._deferreds[Y]);O._deferreds=null}function E(O,Y,C){this.onFulfilled=typeof O=="function"?O:null,this.onRejected=typeof Y=="function"?Y:null,this.promise=C}function L(O,Y){var C=!1;try{O(function(j){C||(C=!0,vt(Y,j))},function(j){C||(C=!0,Ot(Y,j))})}catch(j){if(C)return;C=!0,Ot(Y,j)}}k.prototype.catch=function(O){return this.then(null,O)},k.prototype.then=function(O,Y){var C=new this.constructor(z);return Z(this,new E(O,Y,C)),C},k.prototype.finally=q.a,k.all=function(O){return new k(function(Y,C){if(!V(O))return C(new TypeError("Promise.all accepts an array"));var j=Array.prototype.slice.call(O);if(j.length===0)return Y([]);var X=j.length;function K(ge,Ct){try{if(Ct&&(typeof Ct=="object"||typeof Ct=="function")){var ot=Ct.then;if(typeof ot=="function")return void ot.call(Ct,function(yt){K(ge,yt)},C)}j[ge]=Ct,--X==0&&Y(j)}catch(yt){C(yt)}}for(var qt=0;qt<j.length;qt++)K(qt,j[qt])})},k.allSettled=ht.a,k.resolve=function(O){return O&&typeof O=="object"&&O.constructor===k?O:new k(function(Y){Y(O)})},k.reject=function(O){return new k(function(Y,C){C(O)})},k.race=function(O){return new k(function(Y,C){if(!V(O))return C(new TypeError("Promise.race accepts an array"));for(var j=0,X=O.length;j<X;j++)k.resolve(O[j]).then(Y,C)})},k._immediateFn=typeof P=="function"&&function(O){P(O)}||function(O){W(O,0)},k._unhandledRejectionFn=function(O){typeof console!="undefined"&&console&&console.warn("Possible Unhandled Promise Rejection:",O)},M.a=k}).call(this,v(54).setImmediate)},function(T,M,v){M.a=function(b){var q=this.constructor;return this.then(function(ht){return q.resolve(b()).then(function(){return ht})},function(ht){return q.resolve(b()).then(function(){return q.reject(ht)})})}},function(T,M,v){M.a=function(b){return new this(function(q,ht){if(!b||b.length===void 0)return ht(new TypeError(typeof b+" "+b+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var W=Array.prototype.slice.call(b);if(W.length===0)return q([]);var P=W.length;function V(k,Z){if(Z&&(typeof Z=="object"||typeof Z=="function")){var vt=Z.then;if(typeof vt=="function")return void vt.call(Z,function(Ot){V(k,Ot)},function(Ot){W[k]={status:"rejected",reason:Ot},--P==0&&q(W)})}W[k]={status:"fulfilled",value:Z},--P==0&&q(W)}for(var z=0;z<W.length;z++)V(z,W[z])})}},function(T,M,v){/*
|
|
1667
1667
|
object-assign
|
|
1668
1668
|
(c) Sindre Sorhus
|
|
1669
1669
|
@license MIT
|
|
1670
|
-
*/var b=Object.getOwnPropertySymbols,q=Object.prototype.hasOwnProperty,ht=Object.prototype.propertyIsEnumerable;function W(
|
|
1670
|
+
*/var b=Object.getOwnPropertySymbols,q=Object.prototype.hasOwnProperty,ht=Object.prototype.propertyIsEnumerable;function W(P){if(P==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(P)}T.exports=function(){try{if(!Object.assign)return!1;var P=new String("abc");if(P[5]="de",Object.getOwnPropertyNames(P)[0]==="5")return!1;for(var V={},z=0;z<10;z++)V["_"+String.fromCharCode(z)]=z;if(Object.getOwnPropertyNames(V).map(function(Z){return V[Z]}).join("")!=="0123456789")return!1;var k={};return"abcdefghijklmnopqrst".split("").forEach(function(Z){k[Z]=Z}),Object.keys(Object.assign({},k)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}()?Object.assign:function(P,V){for(var z,k,Z=W(P),vt=1;vt<arguments.length;vt++){for(var Ot in z=Object(arguments[vt]))q.call(z,Ot)&&(Z[Ot]=z[Ot]);if(b){k=b(z);for(var Nt=0;Nt<k.length;Nt++)ht.call(z,k[Nt])&&(Z[k[Nt]]=z[k[Nt]])}}return Z}},function(T,M){T.exports=`precision mediump float;
|
|
1671
1671
|
attribute vec2 aVertexPosition;
|
|
1672
1672
|
uniform mat3 projectionMatrix;
|
|
1673
1673
|
varying vec2 vTextureCoord;
|
|
@@ -1716,7 +1716,7 @@ void main() {
|
|
|
1716
1716
|
* goldfirestudios.com
|
|
1717
1717
|
*
|
|
1718
1718
|
* MIT License
|
|
1719
|
-
*/(function(){var ht=function(){this.init()};ht.prototype={init:function(){var E=this||W;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 L=this||W;if(E=parseFloat(E),L.ctx||Nt(),E!==void 0&&E>=0&&E<=1){if(L._volume=E,L._muted)return L;L.usingWebAudio&&L.masterGain.gain.setValueAtTime(E,W.ctx.currentTime);for(var O=0;O<L._howls.length;O++)if(!L._howls[O]._webAudio)for(var Y=L._howls[O]._getSoundIds(),P=0;P<Y.length;P++){var j=L._howls[O]._soundById(Y[P]);j&&j._node&&(j._node.volume=j._volume*E)}return L}return L._volume},mute:function(E){var L=this||W;L.ctx||Nt(),L._muted=E,L.usingWebAudio&&L.masterGain.gain.setValueAtTime(E?0:L._volume,W.ctx.currentTime);for(var O=0;O<L._howls.length;O++)if(!L._howls[O]._webAudio)for(var Y=L._howls[O]._getSoundIds(),P=0;P<Y.length;P++){var j=L._howls[O]._soundById(Y[P]);j&&j._node&&(j._node.muted=!!E||j._muted)}return L},stop:function(){for(var E=this||W,L=0;L<E._howls.length;L++)E._howls[L].stop();return E},unload:function(){for(var E=this||W,L=E._howls.length-1;L>=0;L--)E._howls[L].unload();return E.usingWebAudio&&E.ctx&&E.ctx.close!==void 0&&(E.ctx.close(),E.ctx=null,Nt()),E},codecs:function(E){return(this||W)._codecs[E.replace(/^x-/,"")]},_setup:function(){var E=this||W;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||W,L=null;try{L=typeof Audio!="undefined"?new Audio:null}catch{return E}if(!L||typeof L.canPlayType!="function")return E;var O=L.canPlayType("audio/mpeg;").replace(/^no$/,""),Y=E._navigator?E._navigator.userAgent:"",P=Y.match(/OPR\/([0-6].)/g),j=P&&parseInt(P[0].split("/")[1],10)<33,X=Y.indexOf("Safari")!==-1&&Y.indexOf("Chrome")===-1,K=Y.match(/Version\/(.*?) /),qt=X&&K&&parseInt(K[1],10)<15;return E._codecs={mp3:!(j||!O&&!L.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!O,opus:!!L.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!L.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!L.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(L.canPlayType('audio/wav; codecs="1"')||L.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!L.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!L.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(L.canPlayType("audio/x-m4a;")||L.canPlayType("audio/m4a;")||L.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(L.canPlayType("audio/x-m4b;")||L.canPlayType("audio/m4b;")||L.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(L.canPlayType("audio/x-mp4;")||L.canPlayType("audio/mp4;")||L.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(qt||!L.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(qt||!L.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!L.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(L.canPlayType("audio/x-flac;")||L.canPlayType("audio/flac;")).replace(/^no$/,"")},E},_unlockAudio:function(){var E=this||W;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 L=function(O){for(;E._html5AudioPool.length<E.html5PoolSize;)try{var Y=new Audio;Y._unlocked=!0,E._releaseHtml5Audio(Y)}catch{E.noAudio=!0;break}for(var P=0;P<E._howls.length;P++)if(!E._howls[P]._webAudio)for(var j=E._howls[P]._getSoundIds(),X=0;X<j.length;X++){var K=E._howls[P]._soundById(j[X]);K&&K._node&&!K._node._unlocked&&(K._node._unlocked=!0,K._node.load())}E._autoResume();var qt=E.ctx.createBufferSource();qt.buffer=E._scratchBuffer,qt.connect(E.ctx.destination),qt.start===void 0?qt.noteOn(0):qt.start(0),typeof E.ctx.resume=="function"&&E.ctx.resume(),qt.onended=function(){qt.disconnect(0),E._audioUnlocked=!0,document.removeEventListener("touchstart",L,!0),document.removeEventListener("touchend",L,!0),document.removeEventListener("click",L,!0),document.removeEventListener("keydown",L,!0);for(var ge=0;ge<E._howls.length;ge++)E._howls[ge]._emit("unlock")}};return document.addEventListener("touchstart",L,!0),document.addEventListener("touchend",L,!0),document.addEventListener("click",L,!0),document.addEventListener("keydown",L,!0),E}},_obtainHtml5Audio:function(){var E=this||W;if(E._html5AudioPool.length)return E._html5AudioPool.pop();var L=new Audio().play();return L&&typeof Promise!="undefined"&&(L instanceof Promise||typeof L.then=="function")&&L.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(E){var L=this||W;return E._unlocked&&L._html5AudioPool.push(E),L},_autoSuspend:function(){var E=this;if(E.autoSuspend&&E.ctx&&E.ctx.suspend!==void 0&&W.usingWebAudio){for(var L=0;L<E._howls.length;L++)if(E._howls[L]._webAudio){for(var O=0;O<E._howls[L]._sounds.length;O++)if(!E._howls[L]._sounds[O]._paused)return E}return E._suspendTimer&&clearTimeout(E._suspendTimer),E._suspendTimer=setTimeout(function(){if(E.autoSuspend){E._suspendTimer=null,E.state="suspending";var Y=function(){E.state="suspended",E._resumeAfterSuspend&&(delete E._resumeAfterSuspend,E._autoResume())};E.ctx.suspend().then(Y,Y)}},3e4),E}},_autoResume:function(){var E=this;if(E.ctx&&E.ctx.resume!==void 0&&W.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 L=0;L<E._howls.length;L++)E._howls[L]._emit("resume")}),E._suspendTimer&&(clearTimeout(E._suspendTimer),E._suspendTimer=null)):E.state==="suspending"&&(E._resumeAfterSuspend=!0),E}};var W=new ht,C=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.")};C.prototype={init:function(E){var L=this;return W.ctx||Nt(),L._autoplay=E.autoplay||!1,L._format=typeof E.format!="string"?E.format:[E.format],L._html5=E.html5||!1,L._muted=E.mute||!1,L._loop=E.loop||!1,L._pool=E.pool||5,L._preload=typeof E.preload!="boolean"&&E.preload!=="metadata"||E.preload,L._rate=E.rate||1,L._sprite=E.sprite||{},L._src=typeof E.src!="string"?E.src:[E.src],L._volume=E.volume!==void 0?E.volume:1,L._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},L._duration=0,L._state="unloaded",L._sounds=[],L._endTimers={},L._queue=[],L._playLock=!1,L._onend=E.onend?[{fn:E.onend}]:[],L._onfade=E.onfade?[{fn:E.onfade}]:[],L._onload=E.onload?[{fn:E.onload}]:[],L._onloaderror=E.onloaderror?[{fn:E.onloaderror}]:[],L._onplayerror=E.onplayerror?[{fn:E.onplayerror}]:[],L._onpause=E.onpause?[{fn:E.onpause}]:[],L._onplay=E.onplay?[{fn:E.onplay}]:[],L._onstop=E.onstop?[{fn:E.onstop}]:[],L._onmute=E.onmute?[{fn:E.onmute}]:[],L._onvolume=E.onvolume?[{fn:E.onvolume}]:[],L._onrate=E.onrate?[{fn:E.onrate}]:[],L._onseek=E.onseek?[{fn:E.onseek}]:[],L._onunlock=E.onunlock?[{fn:E.onunlock}]:[],L._onresume=[],L._webAudio=W.usingWebAudio&&!L._html5,W.ctx!==void 0&&W.ctx&&W.autoUnlock&&W._unlockAudio(),W._howls.push(L),L._autoplay&&L._queue.push({event:"play",action:function(){L.play()}}),L._preload&&L._preload!=="none"&&L.load(),L},load:function(){var E=null;if(W.noAudio)this._emit("loaderror",null,"No audio support.");else{typeof this._src=="string"&&(this._src=[this._src]);for(var L=0;L<this._src.length;L++){var O,Y;if(this._format&&this._format[L])O=this._format[L];else{if(typeof(Y=this._src[L])!="string"){this._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}(O=/^data:audio\/([^;,]+);/i.exec(Y))||(O=/\.([^.]+)$/.exec(Y.split("?",1)[0])),O&&(O=O[1].toLowerCase())}if(O||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),O&&W.codecs(O)){E=this._src[L];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 V(this),this._webAudio&&k(this),this;this._emit("loaderror",null,"No codec support for selected audio sources.")}},play:function(E,L){var O=this,Y=null;if(typeof E=="number")Y=E,E=null;else{if(typeof E=="string"&&O._state==="loaded"&&!O._sprite[E])return null;if(E===void 0&&(E="__default",!O._playLock)){for(var P=0,j=0;j<O._sounds.length;j++)O._sounds[j]._paused&&!O._sounds[j]._ended&&(P++,Y=O._sounds[j]._id);P===1?E=null:Y=null}}var X=Y?O._soundById(Y):O._inactiveSound();if(!X)return null;if(Y&&!E&&(E=X._sprite||"__default"),O._state!=="loaded"){X._sprite=E,X._ended=!1;var K=X._id;return O._queue.push({event:"play",action:function(){O.play(K)}}),K}if(Y&&!X._paused)return L||O._loadQueue("play"),X._id;O._webAudio&&W._autoResume();var qt=Math.max(0,X._seek>0?X._seek:O._sprite[E][0]/1e3),ge=Math.max(0,(O._sprite[E][0]+O._sprite[E][1])/1e3-qt),Ct=1e3*ge/Math.abs(X._rate),ot=O._sprite[E][0]/1e3,yt=(O._sprite[E][0]+O._sprite[E][1])/1e3;X._sprite=E,X._ended=!1;var Pt=function(){X._paused=!1,X._seek=qt,X._start=ot,X._stop=yt,X._loop=!(!X._loop&&!O._sprite[E][2])};if(!(qt>=yt)){var H=X._node;if(O._webAudio){var ft=function(){O._playLock=!1,Pt(),O._refreshBuffer(X);var Wt=X._muted||O._muted?0:X._volume;H.gain.setValueAtTime(Wt,W.ctx.currentTime),X._playStart=W.ctx.currentTime,H.bufferSource.start===void 0?X._loop?H.bufferSource.noteGrainOn(0,qt,86400):H.bufferSource.noteGrainOn(0,qt,ge):X._loop?H.bufferSource.start(0,qt,86400):H.bufferSource.start(0,qt,ge),Ct!==1/0&&(O._endTimers[X._id]=setTimeout(O._ended.bind(O,X),Ct)),L||setTimeout(function(){O._emit("play",X._id),O._loadQueue()},0)};W.state==="running"&&W.ctx.state!=="interrupted"?ft():(O._playLock=!0,O.once("resume",ft),O._clearTimer(X._id))}else{var Et=function(){H.currentTime=qt,H.muted=X._muted||O._muted||W._muted||H.muted,H.volume=X._volume*W.volume(),H.playbackRate=X._rate;try{var Wt=H.play();if(Wt&&typeof Promise!="undefined"&&(Wt instanceof Promise||typeof Wt.then=="function")?(O._playLock=!0,Pt(),Wt.then(function(){O._playLock=!1,H._unlocked=!0,L?O._loadQueue():O._emit("play",X._id)}).catch(function(){O._playLock=!1,O._emit("playerror",X._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."),X._ended=!0,X._paused=!0})):L||(O._playLock=!1,Pt(),O._emit("play",X._id)),H.playbackRate=X._rate,H.paused)return void O._emit("playerror",X._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"||X._loop?O._endTimers[X._id]=setTimeout(O._ended.bind(O,X),Ct):(O._endTimers[X._id]=function(){O._ended(X),H.removeEventListener("ended",O._endTimers[X._id],!1)},H.addEventListener("ended",O._endTimers[X._id],!1))}catch($t){O._emit("playerror",X._id,$t)}};H.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&(H.src=O._src,H.load());var At=window&&window.ejecta||!H.readyState&&W._navigator.isCocoonJS;if(H.readyState>=3||At)Et();else{O._playLock=!0,O._state="loading";var Rt=function(){O._state="loaded",Et(),H.removeEventListener(W._canPlayEvent,Rt,!1)};H.addEventListener(W._canPlayEvent,Rt,!1),O._clearTimer(X._id)}}return X._id}O._ended(X)},pause:function(E){var L=this;if(L._state!=="loaded"||L._playLock)return L._queue.push({event:"pause",action:function(){L.pause(E)}}),L;for(var O=L._getSoundIds(E),Y=0;Y<O.length;Y++){L._clearTimer(O[Y]);var P=L._soundById(O[Y]);if(P&&!P._paused&&(P._seek=L.seek(O[Y]),P._rateSeek=0,P._paused=!0,L._stopFade(O[Y]),P._node))if(L._webAudio){if(!P._node.bufferSource)continue;P._node.bufferSource.stop===void 0?P._node.bufferSource.noteOff(0):P._node.bufferSource.stop(0),L._cleanBuffer(P._node)}else isNaN(P._node.duration)&&P._node.duration!==1/0||P._node.pause();arguments[1]||L._emit("pause",P?P._id:null)}return L},stop:function(E,L){var O=this;if(O._state!=="loaded"||O._playLock)return O._queue.push({event:"stop",action:function(){O.stop(E)}}),O;for(var Y=O._getSoundIds(E),P=0;P<Y.length;P++){O._clearTimer(Y[P]);var j=O._soundById(Y[P]);j&&(j._seek=j._start||0,j._rateSeek=0,j._paused=!0,j._ended=!0,O._stopFade(Y[P]),j._node&&(O._webAudio?j._node.bufferSource&&(j._node.bufferSource.stop===void 0?j._node.bufferSource.noteOff(0):j._node.bufferSource.stop(0),O._cleanBuffer(j._node)):isNaN(j._node.duration)&&j._node.duration!==1/0||(j._node.currentTime=j._start||0,j._node.pause(),j._node.duration===1/0&&O._clearSound(j._node))),L||O._emit("stop",j._id))}return O},mute:function(E,L){var O=this;if(O._state!=="loaded"||O._playLock)return O._queue.push({event:"mute",action:function(){O.mute(E,L)}}),O;if(L===void 0){if(typeof E!="boolean")return O._muted;O._muted=E}for(var Y=O._getSoundIds(L),P=0;P<Y.length;P++){var j=O._soundById(Y[P]);j&&(j._muted=E,j._interval&&O._stopFade(j._id),O._webAudio&&j._node?j._node.gain.setValueAtTime(E?0:j._volume,W.ctx.currentTime):j._node&&(j._node.muted=!!W._muted||E),O._emit("mute",j._id))}return O},volume:function(){var E,L,O,Y=this,P=arguments;if(P.length===0)return Y._volume;if(P.length===1||P.length===2&&P[1]===void 0){var j=Y._getSoundIds(),X=j.indexOf(P[0]);X>=0?L=parseInt(P[0],10):E=parseFloat(P[0])}else P.length>=2&&(E=parseFloat(P[0]),L=parseInt(P[1],10));if(!(E!==void 0&&E>=0&&E<=1))return(O=L?Y._soundById(L):Y._sounds[0])?O._volume:0;if(Y._state!=="loaded"||Y._playLock)return Y._queue.push({event:"volume",action:function(){Y.volume.apply(Y,P)}}),Y;L===void 0&&(Y._volume=E),L=Y._getSoundIds(L);for(var K=0;K<L.length;K++)(O=Y._soundById(L[K]))&&(O._volume=E,P[2]||Y._stopFade(L[K]),Y._webAudio&&O._node&&!O._muted?O._node.gain.setValueAtTime(E,W.ctx.currentTime):O._node&&!O._muted&&(O._node.volume=E*W.volume()),Y._emit("volume",O._id));return Y},fade:function(E,L,O,Y){var P=this;if(P._state!=="loaded"||P._playLock)return P._queue.push({event:"fade",action:function(){P.fade(E,L,O,Y)}}),P;E=Math.min(Math.max(0,parseFloat(E)),1),L=Math.min(Math.max(0,parseFloat(L)),1),O=parseFloat(O),P.volume(E,Y);for(var j=P._getSoundIds(Y),X=0;X<j.length;X++){var K=P._soundById(j[X]);if(K){if(Y||P._stopFade(j[X]),P._webAudio&&!K._muted){var qt=W.ctx.currentTime,ge=qt+O/1e3;K._volume=E,K._node.gain.setValueAtTime(E,qt),K._node.gain.linearRampToValueAtTime(L,ge)}P._startFadeInterval(K,E,L,O,j[X],Y===void 0)}}return P},_startFadeInterval:function(E,L,O,Y,P,j){var X=this,K=L,qt=O-L,ge=Math.abs(qt/.01),Ct=Math.max(4,ge>0?Y/ge:Y),ot=Date.now();E._fadeTo=O,E._interval=setInterval(function(){var yt=(Date.now()-ot)/Y;ot=Date.now(),K+=qt*yt,K=Math.round(100*K)/100,K=qt<0?Math.max(O,K):Math.min(O,K),X._webAudio?E._volume=K:X.volume(K,E._id,!0),j&&(X._volume=K),(O<L&&K<=O||O>L&&K>=O)&&(clearInterval(E._interval),E._interval=null,E._fadeTo=null,X.volume(O,E._id),X._emit("fade",E._id))},Ct)},_stopFade:function(E){var L=this._soundById(E);return L&&L._interval&&(this._webAudio&&L._node.gain.cancelScheduledValues(W.ctx.currentTime),clearInterval(L._interval),L._interval=null,this.volume(L._fadeTo,E),L._fadeTo=null,this._emit("fade",E)),this},loop:function(){var E,L,O,Y=this,P=arguments;if(P.length===0)return Y._loop;if(P.length===1){if(typeof P[0]!="boolean")return!!(O=Y._soundById(parseInt(P[0],10)))&&O._loop;E=P[0],Y._loop=E}else P.length===2&&(E=P[0],L=parseInt(P[1],10));for(var j=Y._getSoundIds(L),X=0;X<j.length;X++)(O=Y._soundById(j[X]))&&(O._loop=E,Y._webAudio&&O._node&&O._node.bufferSource&&(O._node.bufferSource.loop=E,E&&(O._node.bufferSource.loopStart=O._start||0,O._node.bufferSource.loopEnd=O._stop,Y.playing(j[X])&&(Y.pause(j[X],!0),Y.play(j[X],!0)))));return Y},rate:function(){var E,L,O,Y=this,P=arguments;if(P.length===0)L=Y._sounds[0]._id;else if(P.length===1){var j=Y._getSoundIds(),X=j.indexOf(P[0]);X>=0?L=parseInt(P[0],10):E=parseFloat(P[0])}else P.length===2&&(E=parseFloat(P[0]),L=parseInt(P[1],10));if(typeof E!="number")return(O=Y._soundById(L))?O._rate:Y._rate;if(Y._state!=="loaded"||Y._playLock)return Y._queue.push({event:"rate",action:function(){Y.rate.apply(Y,P)}}),Y;L===void 0&&(Y._rate=E),L=Y._getSoundIds(L);for(var K=0;K<L.length;K++)if(O=Y._soundById(L[K])){Y.playing(L[K])&&(O._rateSeek=Y.seek(L[K]),O._playStart=Y._webAudio?W.ctx.currentTime:O._playStart),O._rate=E,Y._webAudio&&O._node&&O._node.bufferSource?O._node.bufferSource.playbackRate.setValueAtTime(E,W.ctx.currentTime):O._node&&(O._node.playbackRate=E);var qt=Y.seek(L[K]),ge=(Y._sprite[O._sprite][0]+Y._sprite[O._sprite][1])/1e3-qt,Ct=1e3*ge/Math.abs(O._rate);!Y._endTimers[L[K]]&&O._paused||(Y._clearTimer(L[K]),Y._endTimers[L[K]]=setTimeout(Y._ended.bind(Y,O),Ct)),Y._emit("rate",O._id)}return Y},seek:function(){var E,L,O=this,Y=arguments;if(Y.length===0)O._sounds.length&&(L=O._sounds[0]._id);else if(Y.length===1){var P=O._getSoundIds(),j=P.indexOf(Y[0]);j>=0?L=parseInt(Y[0],10):O._sounds.length&&(L=O._sounds[0]._id,E=parseFloat(Y[0]))}else Y.length===2&&(E=parseFloat(Y[0]),L=parseInt(Y[1],10));if(L===void 0)return 0;if(typeof E=="number"&&(O._state!=="loaded"||O._playLock))return O._queue.push({event:"seek",action:function(){O.seek.apply(O,Y)}}),O;var X=O._soundById(L);if(X){if(!(typeof E=="number"&&E>=0)){if(O._webAudio){var K=O.playing(L)?W.ctx.currentTime-X._playStart:0,qt=X._rateSeek?X._rateSeek-X._seek:0;return X._seek+(qt+K*Math.abs(X._rate))}return X._node.currentTime}var ge=O.playing(L);ge&&O.pause(L,!0),X._seek=E,X._ended=!1,O._clearTimer(L),O._webAudio||!X._node||isNaN(X._node.duration)||(X._node.currentTime=E);var Ct=function(){ge&&O.play(L,!0),O._emit("seek",L)};if(ge&&!O._webAudio){var ot=function(){O._playLock?setTimeout(ot,0):Ct()};setTimeout(ot,0)}else Ct()}return O},playing:function(E){if(typeof E=="number"){var L=this._soundById(E);return!!L&&!L._paused}for(var O=0;O<this._sounds.length;O++)if(!this._sounds[O]._paused)return!0;return!1},duration:function(E){var L=this._duration,O=this._soundById(E);return O&&(L=this._sprite[O._sprite][1]/1e3),L},state:function(){return this._state},unload:function(){for(var E=this,L=E._sounds,O=0;O<L.length;O++)L[O]._paused||E.stop(L[O]._id),E._webAudio||(E._clearSound(L[O]._node),L[O]._node.removeEventListener("error",L[O]._errorFn,!1),L[O]._node.removeEventListener(W._canPlayEvent,L[O]._loadFn,!1),L[O]._node.removeEventListener("ended",L[O]._endFn,!1),W._releaseHtml5Audio(L[O]._node)),delete L[O]._node,E._clearTimer(L[O]._id);var Y=W._howls.indexOf(E);Y>=0&&W._howls.splice(Y,1);var P=!0;for(O=0;O<W._howls.length;O++)if(W._howls[O]._src===E._src||E._src.indexOf(W._howls[O]._src)>=0){P=!1;break}return z&&P&&delete z[E._src],W.noAudio=!1,E._state="unloaded",E._sounds=[],E=null,null},on:function(E,L,O,Y){var P=this["_on"+E];return typeof L=="function"&&P.push(Y?{id:O,fn:L,once:Y}:{id:O,fn:L}),this},off:function(E,L,O){var Y=this["_on"+E],P=0;if(typeof L=="number"&&(O=L,L=null),L||O)for(P=0;P<Y.length;P++){var j=O===Y[P].id;if(L===Y[P].fn&&j||!L&&j){Y.splice(P,1);break}}else if(E)this["_on"+E]=[];else{var X=Object.keys(this);for(P=0;P<X.length;P++)X[P].indexOf("_on")===0&&Array.isArray(this[X[P]])&&(this[X[P]]=[])}return this},once:function(E,L,O){return this.on(E,L,O,1),this},_emit:function(E,L,O){for(var Y=this["_on"+E],P=Y.length-1;P>=0;P--)Y[P].id&&Y[P].id!==L&&E!=="load"||(setTimeout(function(j){j.call(this,L,O)}.bind(this,Y[P].fn),0),Y[P].once&&this.off(E,Y[P].fn,Y[P].id));return this._loadQueue(E),this},_loadQueue:function(E){if(this._queue.length>0){var L=this._queue[0];L.event===E&&(this._queue.shift(),this._loadQueue()),E||L.action()}return this},_ended:function(E){var L=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 O=!(!E._loop&&!this._sprite[L][2]);if(this._emit("end",E._id),!this._webAudio&&O&&this.stop(E._id,!0).play(E._id),this._webAudio&&O){this._emit("play",E._id),E._seek=E._start||0,E._rateSeek=0,E._playStart=W.ctx.currentTime;var Y=1e3*(E._stop-E._start)/Math.abs(E._rate);this._endTimers[E._id]=setTimeout(this._ended.bind(this,E),Y)}return this._webAudio&&!O&&(E._paused=!0,E._ended=!0,E._seek=E._start||0,E._rateSeek=0,this._clearTimer(E._id),this._cleanBuffer(E._node),W._autoSuspend()),this._webAudio||O||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 L=this._soundById(E);L&&L._node&&L._node.removeEventListener("ended",this._endTimers[E],!1)}delete this._endTimers[E]}return this},_soundById:function(E){for(var L=0;L<this._sounds.length;L++)if(E===this._sounds[L]._id)return this._sounds[L];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 V(this)},_drain:function(){var E=this._pool,L=0,O=0;if(!(this._sounds.length<E)){for(O=0;O<this._sounds.length;O++)this._sounds[O]._ended&&L++;for(O=this._sounds.length-1;O>=0;O--){if(L<=E)return;this._sounds[O]._ended&&(this._webAudio&&this._sounds[O]._node&&this._sounds[O]._node.disconnect(0),this._sounds.splice(O,1),L--)}}},_getSoundIds:function(E){if(E===void 0){for(var L=[],O=0;O<this._sounds.length;O++)L.push(this._sounds[O]._id);return L}return[E]},_refreshBuffer:function(E){return E._node.bufferSource=W.ctx.createBufferSource(),E._node.bufferSource.buffer=z[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,W.ctx.currentTime),this},_cleanBuffer:function(E){var L=W._navigator&&W._navigator.vendor.indexOf("Apple")>=0;if(W._scratchBuffer&&E.bufferSource&&(E.bufferSource.onended=null,E.bufferSource.disconnect(0),L))try{E.bufferSource.buffer=W._scratchBuffer}catch{}return E.bufferSource=null,this},_clearSound:function(E){/MSIE |Trident\//.test(W._navigator&&W._navigator.userAgent)||(E.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var V=function(E){this._parent=E,this.init()};V.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=++W._counter,E._sounds.push(this),this.create(),this},create:function(){var E=this._parent,L=W._muted||this._muted||this._parent._muted?0:this._volume;return E._webAudio?(this._node=W.ctx.createGain===void 0?W.ctx.createGainNode():W.ctx.createGain(),this._node.gain.setValueAtTime(L,W.ctx.currentTime),this._node.paused=!0,this._node.connect(W.masterGain)):W.noAudio||(this._node=W._obtainHtml5Audio(),this._errorFn=this._errorListener.bind(this),this._node.addEventListener("error",this._errorFn,!1),this._loadFn=this._loadListener.bind(this),this._node.addEventListener(W._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=L*W.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=++W._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(W._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 z={},k=function(E){var L=E._src;if(z[L])return E._duration=z[L].duration,void Ot(E);if(/^data:[^;]+;base64,/.test(L)){for(var O=atob(L.split(",")[1]),Y=new Uint8Array(O.length),P=0;P<O.length;++P)Y[P]=O.charCodeAt(P);vt(Y.buffer,E)}else{var j=new XMLHttpRequest;j.open(E._xhr.method,L,!0),j.withCredentials=E._xhr.withCredentials,j.responseType="arraybuffer",E._xhr.headers&&Object.keys(E._xhr.headers).forEach(function(X){j.setRequestHeader(X,E._xhr.headers[X])}),j.onload=function(){var X=(j.status+"")[0];X==="0"||X==="2"||X==="3"?vt(j.response,E):E._emit("loaderror",null,"Failed loading audio file with status: "+j.status+".")},j.onerror=function(){E._webAudio&&(E._html5=!0,E._webAudio=!1,E._sounds=[],delete z[L],E.load())},Z(j)}},Z=function(E){try{E.send()}catch{E.onerror()}},vt=function(E,L){var O=function(){L._emit("loaderror",null,"Decoding audio data failed.")},Y=function(P){P&&L._sounds.length>0?(z[L._src]=P,Ot(L,P)):O()};typeof Promise!="undefined"&&W.ctx.decodeAudioData.length===1?W.ctx.decodeAudioData(E).then(Y).catch(O):W.ctx.decodeAudioData(E,Y,O)},Ot=function(E,L){L&&!E._duration&&(E._duration=L.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())},Nt=function(){if(W.usingWebAudio){try{typeof AudioContext!="undefined"?W.ctx=new AudioContext:typeof webkitAudioContext!="undefined"?W.ctx=new webkitAudioContext:W.usingWebAudio=!1}catch{W.usingWebAudio=!1}W.ctx||(W.usingWebAudio=!1);var E=/iP(hone|od|ad)/.test(W._navigator&&W._navigator.platform),L=W._navigator&&W._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),O=L?parseInt(L[1],10):null;if(E&&O&&O<9){var Y=/safari/.test(W._navigator&&W._navigator.userAgent.toLowerCase());W._navigator&&!Y&&(W.usingWebAudio=!1)}W.usingWebAudio&&(W.masterGain=W.ctx.createGain===void 0?W.ctx.createGainNode():W.ctx.createGain(),W.masterGain.gain.setValueAtTime(W._muted?0:W._volume,W.ctx.currentTime),W.masterGain.connect(W.ctx.destination)),W._setup()}};(q=function(){return{Howler:W,Howl:C}}.apply(M,[]))===void 0||(T.exports=q),M.Howler=W,M.Howl=C,b!==void 0?(b.HowlerGlobal=ht,b.Howler=W,b.Howl=C,b.Sound=V):typeof window!="undefined"&&(window.HowlerGlobal=ht,window.Howler=W,window.Howl=C,window.Sound=V)})(),function(){var ht;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(C){if(!this.ctx||!this.ctx.listener)return this;for(var V=this._howls.length-1;V>=0;V--)this._howls[V].stereo(C);return this},HowlerGlobal.prototype.pos=function(C,V,z){return this.ctx&&this.ctx.listener?(V=typeof V!="number"?this._pos[1]:V,z=typeof z!="number"?this._pos[2]:z,typeof C!="number"?this._pos:(this._pos=[C,V,z],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(C,V,z,k,Z,vt){if(!this.ctx||!this.ctx.listener)return this;var Ot=this._orientation;return V=typeof V!="number"?Ot[1]:V,z=typeof z!="number"?Ot[2]:z,k=typeof k!="number"?Ot[3]:k,Z=typeof Z!="number"?Ot[4]:Z,vt=typeof vt!="number"?Ot[5]:vt,typeof C!="number"?Ot:(this._orientation=[C,V,z,k,Z,vt],this.ctx.listener.forwardX!==void 0?(this.ctx.listener.forwardX.setTargetAtTime(C,Howler.ctx.currentTime,.1),this.ctx.listener.forwardY.setTargetAtTime(V,Howler.ctx.currentTime,.1),this.ctx.listener.forwardZ.setTargetAtTime(z,Howler.ctx.currentTime,.1),this.ctx.listener.upX.setTargetAtTime(k,Howler.ctx.currentTime,.1),this.ctx.listener.upY.setTargetAtTime(Z,Howler.ctx.currentTime,.1),this.ctx.listener.upZ.setTargetAtTime(vt,Howler.ctx.currentTime,.1)):this.ctx.listener.setOrientation(C,V,z,k,Z,vt),this)},Howl.prototype.init=(ht=Howl.prototype.init,function(C){return this._orientation=C.orientation||[1,0,0],this._stereo=C.stereo||null,this._pos=C.pos||null,this._pannerAttr={coneInnerAngle:C.coneInnerAngle!==void 0?C.coneInnerAngle:360,coneOuterAngle:C.coneOuterAngle!==void 0?C.coneOuterAngle:360,coneOuterGain:C.coneOuterGain!==void 0?C.coneOuterGain:0,distanceModel:C.distanceModel!==void 0?C.distanceModel:"inverse",maxDistance:C.maxDistance!==void 0?C.maxDistance:1e4,panningModel:C.panningModel!==void 0?C.panningModel:"HRTF",refDistance:C.refDistance!==void 0?C.refDistance:1,rolloffFactor:C.rolloffFactor!==void 0?C.rolloffFactor:1},this._onstereo=C.onstereo?[{fn:C.onstereo}]:[],this._onpos=C.onpos?[{fn:C.onpos}]:[],this._onorientation=C.onorientation?[{fn:C.onorientation}]:[],ht.call(this,C)}),Howl.prototype.stereo=function(C,V){var z=this;if(!z._webAudio)return z;if(z._state!=="loaded")return z._queue.push({event:"stereo",action:function(){z.stereo(C,V)}}),z;var k=Howler.ctx.createStereoPanner===void 0?"spatial":"stereo";if(V===void 0){if(typeof C!="number")return z._stereo;z._stereo=C,z._pos=[C,0,0]}for(var Z=z._getSoundIds(V),vt=0;vt<Z.length;vt++){var Ot=z._soundById(Z[vt]);if(Ot){if(typeof C!="number")return Ot._stereo;Ot._stereo=C,Ot._pos=[C,0,0],Ot._node&&(Ot._pannerAttr.panningModel="equalpower",Ot._panner&&Ot._panner.pan||W(Ot,k),k==="spatial"?Ot._panner.positionX!==void 0?(Ot._panner.positionX.setValueAtTime(C,Howler.ctx.currentTime),Ot._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),Ot._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):Ot._panner.setPosition(C,0,0):Ot._panner.pan.setValueAtTime(C,Howler.ctx.currentTime)),z._emit("stereo",Ot._id)}}return z},Howl.prototype.pos=function(C,V,z,k){var Z=this;if(!Z._webAudio)return Z;if(Z._state!=="loaded")return Z._queue.push({event:"pos",action:function(){Z.pos(C,V,z,k)}}),Z;if(V=typeof V!="number"?0:V,z=typeof z!="number"?-.5:z,k===void 0){if(typeof C!="number")return Z._pos;Z._pos=[C,V,z]}for(var vt=Z._getSoundIds(k),Ot=0;Ot<vt.length;Ot++){var Nt=Z._soundById(vt[Ot]);if(Nt){if(typeof C!="number")return Nt._pos;Nt._pos=[C,V,z],Nt._node&&(Nt._panner&&!Nt._panner.pan||W(Nt,"spatial"),Nt._panner.positionX!==void 0?(Nt._panner.positionX.setValueAtTime(C,Howler.ctx.currentTime),Nt._panner.positionY.setValueAtTime(V,Howler.ctx.currentTime),Nt._panner.positionZ.setValueAtTime(z,Howler.ctx.currentTime)):Nt._panner.setPosition(C,V,z)),Z._emit("pos",Nt._id)}}return Z},Howl.prototype.orientation=function(C,V,z,k){var Z=this;if(!Z._webAudio)return Z;if(Z._state!=="loaded")return Z._queue.push({event:"orientation",action:function(){Z.orientation(C,V,z,k)}}),Z;if(V=typeof V!="number"?Z._orientation[1]:V,z=typeof z!="number"?Z._orientation[2]:z,k===void 0){if(typeof C!="number")return Z._orientation;Z._orientation=[C,V,z]}for(var vt=Z._getSoundIds(k),Ot=0;Ot<vt.length;Ot++){var Nt=Z._soundById(vt[Ot]);if(Nt){if(typeof C!="number")return Nt._orientation;Nt._orientation=[C,V,z],Nt._node&&(Nt._panner||(Nt._pos||(Nt._pos=Z._pos||[0,0,-.5]),W(Nt,"spatial")),Nt._panner.orientationX!==void 0?(Nt._panner.orientationX.setValueAtTime(C,Howler.ctx.currentTime),Nt._panner.orientationY.setValueAtTime(V,Howler.ctx.currentTime),Nt._panner.orientationZ.setValueAtTime(z,Howler.ctx.currentTime)):Nt._panner.setOrientation(C,V,z)),Z._emit("orientation",Nt._id)}}return Z},Howl.prototype.pannerAttr=function(){var C,V,z,k=this,Z=arguments;if(!k._webAudio)return k;if(Z.length===0)return k._pannerAttr;if(Z.length===1){if(typeof Z[0]!="object")return(z=k._soundById(parseInt(Z[0],10)))?z._pannerAttr:k._pannerAttr;C=Z[0],V===void 0&&(C.pannerAttr||(C.pannerAttr={coneInnerAngle:C.coneInnerAngle,coneOuterAngle:C.coneOuterAngle,coneOuterGain:C.coneOuterGain,distanceModel:C.distanceModel,maxDistance:C.maxDistance,refDistance:C.refDistance,rolloffFactor:C.rolloffFactor,panningModel:C.panningModel}),k._pannerAttr={coneInnerAngle:C.pannerAttr.coneInnerAngle!==void 0?C.pannerAttr.coneInnerAngle:k._coneInnerAngle,coneOuterAngle:C.pannerAttr.coneOuterAngle!==void 0?C.pannerAttr.coneOuterAngle:k._coneOuterAngle,coneOuterGain:C.pannerAttr.coneOuterGain!==void 0?C.pannerAttr.coneOuterGain:k._coneOuterGain,distanceModel:C.pannerAttr.distanceModel!==void 0?C.pannerAttr.distanceModel:k._distanceModel,maxDistance:C.pannerAttr.maxDistance!==void 0?C.pannerAttr.maxDistance:k._maxDistance,refDistance:C.pannerAttr.refDistance!==void 0?C.pannerAttr.refDistance:k._refDistance,rolloffFactor:C.pannerAttr.rolloffFactor!==void 0?C.pannerAttr.rolloffFactor:k._rolloffFactor,panningModel:C.pannerAttr.panningModel!==void 0?C.pannerAttr.panningModel:k._panningModel})}else Z.length===2&&(C=Z[0],V=parseInt(Z[1],10));for(var vt=k._getSoundIds(V),Ot=0;Ot<vt.length;Ot++)if(z=k._soundById(vt[Ot])){var Nt=z._pannerAttr;Nt={coneInnerAngle:C.coneInnerAngle!==void 0?C.coneInnerAngle:Nt.coneInnerAngle,coneOuterAngle:C.coneOuterAngle!==void 0?C.coneOuterAngle:Nt.coneOuterAngle,coneOuterGain:C.coneOuterGain!==void 0?C.coneOuterGain:Nt.coneOuterGain,distanceModel:C.distanceModel!==void 0?C.distanceModel:Nt.distanceModel,maxDistance:C.maxDistance!==void 0?C.maxDistance:Nt.maxDistance,refDistance:C.refDistance!==void 0?C.refDistance:Nt.refDistance,rolloffFactor:C.rolloffFactor!==void 0?C.rolloffFactor:Nt.rolloffFactor,panningModel:C.panningModel!==void 0?C.panningModel:Nt.panningModel};var E=z._panner;E?(E.coneInnerAngle=Nt.coneInnerAngle,E.coneOuterAngle=Nt.coneOuterAngle,E.coneOuterGain=Nt.coneOuterGain,E.distanceModel=Nt.distanceModel,E.maxDistance=Nt.maxDistance,E.refDistance=Nt.refDistance,E.rolloffFactor=Nt.rolloffFactor,E.panningModel=Nt.panningModel):(z._pos||(z._pos=k._pos||[0,0,-.5]),W(z,"spatial"))}return k},Sound.prototype.init=function(C){return function(){var V=this._parent;this._orientation=V._orientation,this._stereo=V._stereo,this._pos=V._pos,this._pannerAttr=V._pannerAttr,C.call(this),this._stereo?V.stereo(this._stereo):this._pos&&V.pos(this._pos[0],this._pos[1],this._pos[2],this._id)}}(Sound.prototype.init),Sound.prototype.reset=function(C){return function(){var V=this._parent;return this._orientation=V._orientation,this._stereo=V._stereo,this._pos=V._pos,this._pannerAttr=V._pannerAttr,this._stereo?V.stereo(this._stereo):this._pos?V.pos(this._pos[0],this._pos[1],this._pos[2],this._id):this._panner&&(this._panner.disconnect(0),this._panner=void 0,V._refreshBuffer(this)),C.call(this)}}(Sound.prototype.reset);var W=function(C,V){(V=V||"spatial")==="spatial"?(C._panner=Howler.ctx.createPanner(),C._panner.coneInnerAngle=C._pannerAttr.coneInnerAngle,C._panner.coneOuterAngle=C._pannerAttr.coneOuterAngle,C._panner.coneOuterGain=C._pannerAttr.coneOuterGain,C._panner.distanceModel=C._pannerAttr.distanceModel,C._panner.maxDistance=C._pannerAttr.maxDistance,C._panner.refDistance=C._pannerAttr.refDistance,C._panner.rolloffFactor=C._pannerAttr.rolloffFactor,C._panner.panningModel=C._pannerAttr.panningModel,C._panner.positionX!==void 0?(C._panner.positionX.setValueAtTime(C._pos[0],Howler.ctx.currentTime),C._panner.positionY.setValueAtTime(C._pos[1],Howler.ctx.currentTime),C._panner.positionZ.setValueAtTime(C._pos[2],Howler.ctx.currentTime)):C._panner.setPosition(C._pos[0],C._pos[1],C._pos[2]),C._panner.orientationX!==void 0?(C._panner.orientationX.setValueAtTime(C._orientation[0],Howler.ctx.currentTime),C._panner.orientationY.setValueAtTime(C._orientation[1],Howler.ctx.currentTime),C._panner.orientationZ.setValueAtTime(C._orientation[2],Howler.ctx.currentTime)):C._panner.setOrientation(C._orientation[0],C._orientation[1],C._orientation[2])):(C._panner=Howler.ctx.createStereoPanner(),C._panner.pan.setValueAtTime(C._stereo,Howler.ctx.currentTime)),C._panner.connect(C._node),C._paused||C._parent.pause(C._id,!0).play(C._id,!0)}}()}).call(this,v(3))},function(T,M){T.exports=`varying vec2 vTextureCoord;
|
|
1719
|
+
*/(function(){var ht=function(){this.init()};ht.prototype={init:function(){var E=this||W;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 L=this||W;if(E=parseFloat(E),L.ctx||Nt(),E!==void 0&&E>=0&&E<=1){if(L._volume=E,L._muted)return L;L.usingWebAudio&&L.masterGain.gain.setValueAtTime(E,W.ctx.currentTime);for(var O=0;O<L._howls.length;O++)if(!L._howls[O]._webAudio)for(var Y=L._howls[O]._getSoundIds(),C=0;C<Y.length;C++){var j=L._howls[O]._soundById(Y[C]);j&&j._node&&(j._node.volume=j._volume*E)}return L}return L._volume},mute:function(E){var L=this||W;L.ctx||Nt(),L._muted=E,L.usingWebAudio&&L.masterGain.gain.setValueAtTime(E?0:L._volume,W.ctx.currentTime);for(var O=0;O<L._howls.length;O++)if(!L._howls[O]._webAudio)for(var Y=L._howls[O]._getSoundIds(),C=0;C<Y.length;C++){var j=L._howls[O]._soundById(Y[C]);j&&j._node&&(j._node.muted=!!E||j._muted)}return L},stop:function(){for(var E=this||W,L=0;L<E._howls.length;L++)E._howls[L].stop();return E},unload:function(){for(var E=this||W,L=E._howls.length-1;L>=0;L--)E._howls[L].unload();return E.usingWebAudio&&E.ctx&&E.ctx.close!==void 0&&(E.ctx.close(),E.ctx=null,Nt()),E},codecs:function(E){return(this||W)._codecs[E.replace(/^x-/,"")]},_setup:function(){var E=this||W;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||W,L=null;try{L=typeof Audio!="undefined"?new Audio:null}catch{return E}if(!L||typeof L.canPlayType!="function")return E;var O=L.canPlayType("audio/mpeg;").replace(/^no$/,""),Y=E._navigator?E._navigator.userAgent:"",C=Y.match(/OPR\/([0-6].)/g),j=C&&parseInt(C[0].split("/")[1],10)<33,X=Y.indexOf("Safari")!==-1&&Y.indexOf("Chrome")===-1,K=Y.match(/Version\/(.*?) /),qt=X&&K&&parseInt(K[1],10)<15;return E._codecs={mp3:!(j||!O&&!L.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!O,opus:!!L.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!L.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!L.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(L.canPlayType('audio/wav; codecs="1"')||L.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!L.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!L.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(L.canPlayType("audio/x-m4a;")||L.canPlayType("audio/m4a;")||L.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(L.canPlayType("audio/x-m4b;")||L.canPlayType("audio/m4b;")||L.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(L.canPlayType("audio/x-mp4;")||L.canPlayType("audio/mp4;")||L.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(qt||!L.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(qt||!L.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!L.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(L.canPlayType("audio/x-flac;")||L.canPlayType("audio/flac;")).replace(/^no$/,"")},E},_unlockAudio:function(){var E=this||W;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 L=function(O){for(;E._html5AudioPool.length<E.html5PoolSize;)try{var Y=new Audio;Y._unlocked=!0,E._releaseHtml5Audio(Y)}catch{E.noAudio=!0;break}for(var C=0;C<E._howls.length;C++)if(!E._howls[C]._webAudio)for(var j=E._howls[C]._getSoundIds(),X=0;X<j.length;X++){var K=E._howls[C]._soundById(j[X]);K&&K._node&&!K._node._unlocked&&(K._node._unlocked=!0,K._node.load())}E._autoResume();var qt=E.ctx.createBufferSource();qt.buffer=E._scratchBuffer,qt.connect(E.ctx.destination),qt.start===void 0?qt.noteOn(0):qt.start(0),typeof E.ctx.resume=="function"&&E.ctx.resume(),qt.onended=function(){qt.disconnect(0),E._audioUnlocked=!0,document.removeEventListener("touchstart",L,!0),document.removeEventListener("touchend",L,!0),document.removeEventListener("click",L,!0),document.removeEventListener("keydown",L,!0);for(var ge=0;ge<E._howls.length;ge++)E._howls[ge]._emit("unlock")}};return document.addEventListener("touchstart",L,!0),document.addEventListener("touchend",L,!0),document.addEventListener("click",L,!0),document.addEventListener("keydown",L,!0),E}},_obtainHtml5Audio:function(){var E=this||W;if(E._html5AudioPool.length)return E._html5AudioPool.pop();var L=new Audio().play();return L&&typeof Promise!="undefined"&&(L instanceof Promise||typeof L.then=="function")&&L.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(E){var L=this||W;return E._unlocked&&L._html5AudioPool.push(E),L},_autoSuspend:function(){var E=this;if(E.autoSuspend&&E.ctx&&E.ctx.suspend!==void 0&&W.usingWebAudio){for(var L=0;L<E._howls.length;L++)if(E._howls[L]._webAudio){for(var O=0;O<E._howls[L]._sounds.length;O++)if(!E._howls[L]._sounds[O]._paused)return E}return E._suspendTimer&&clearTimeout(E._suspendTimer),E._suspendTimer=setTimeout(function(){if(E.autoSuspend){E._suspendTimer=null,E.state="suspending";var Y=function(){E.state="suspended",E._resumeAfterSuspend&&(delete E._resumeAfterSuspend,E._autoResume())};E.ctx.suspend().then(Y,Y)}},3e4),E}},_autoResume:function(){var E=this;if(E.ctx&&E.ctx.resume!==void 0&&W.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 L=0;L<E._howls.length;L++)E._howls[L]._emit("resume")}),E._suspendTimer&&(clearTimeout(E._suspendTimer),E._suspendTimer=null)):E.state==="suspending"&&(E._resumeAfterSuspend=!0),E}};var W=new ht,P=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.")};P.prototype={init:function(E){var L=this;return W.ctx||Nt(),L._autoplay=E.autoplay||!1,L._format=typeof E.format!="string"?E.format:[E.format],L._html5=E.html5||!1,L._muted=E.mute||!1,L._loop=E.loop||!1,L._pool=E.pool||5,L._preload=typeof E.preload!="boolean"&&E.preload!=="metadata"||E.preload,L._rate=E.rate||1,L._sprite=E.sprite||{},L._src=typeof E.src!="string"?E.src:[E.src],L._volume=E.volume!==void 0?E.volume:1,L._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},L._duration=0,L._state="unloaded",L._sounds=[],L._endTimers={},L._queue=[],L._playLock=!1,L._onend=E.onend?[{fn:E.onend}]:[],L._onfade=E.onfade?[{fn:E.onfade}]:[],L._onload=E.onload?[{fn:E.onload}]:[],L._onloaderror=E.onloaderror?[{fn:E.onloaderror}]:[],L._onplayerror=E.onplayerror?[{fn:E.onplayerror}]:[],L._onpause=E.onpause?[{fn:E.onpause}]:[],L._onplay=E.onplay?[{fn:E.onplay}]:[],L._onstop=E.onstop?[{fn:E.onstop}]:[],L._onmute=E.onmute?[{fn:E.onmute}]:[],L._onvolume=E.onvolume?[{fn:E.onvolume}]:[],L._onrate=E.onrate?[{fn:E.onrate}]:[],L._onseek=E.onseek?[{fn:E.onseek}]:[],L._onunlock=E.onunlock?[{fn:E.onunlock}]:[],L._onresume=[],L._webAudio=W.usingWebAudio&&!L._html5,W.ctx!==void 0&&W.ctx&&W.autoUnlock&&W._unlockAudio(),W._howls.push(L),L._autoplay&&L._queue.push({event:"play",action:function(){L.play()}}),L._preload&&L._preload!=="none"&&L.load(),L},load:function(){var E=null;if(W.noAudio)this._emit("loaderror",null,"No audio support.");else{typeof this._src=="string"&&(this._src=[this._src]);for(var L=0;L<this._src.length;L++){var O,Y;if(this._format&&this._format[L])O=this._format[L];else{if(typeof(Y=this._src[L])!="string"){this._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}(O=/^data:audio\/([^;,]+);/i.exec(Y))||(O=/\.([^.]+)$/.exec(Y.split("?",1)[0])),O&&(O=O[1].toLowerCase())}if(O||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),O&&W.codecs(O)){E=this._src[L];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 V(this),this._webAudio&&k(this),this;this._emit("loaderror",null,"No codec support for selected audio sources.")}},play:function(E,L){var O=this,Y=null;if(typeof E=="number")Y=E,E=null;else{if(typeof E=="string"&&O._state==="loaded"&&!O._sprite[E])return null;if(E===void 0&&(E="__default",!O._playLock)){for(var C=0,j=0;j<O._sounds.length;j++)O._sounds[j]._paused&&!O._sounds[j]._ended&&(C++,Y=O._sounds[j]._id);C===1?E=null:Y=null}}var X=Y?O._soundById(Y):O._inactiveSound();if(!X)return null;if(Y&&!E&&(E=X._sprite||"__default"),O._state!=="loaded"){X._sprite=E,X._ended=!1;var K=X._id;return O._queue.push({event:"play",action:function(){O.play(K)}}),K}if(Y&&!X._paused)return L||O._loadQueue("play"),X._id;O._webAudio&&W._autoResume();var qt=Math.max(0,X._seek>0?X._seek:O._sprite[E][0]/1e3),ge=Math.max(0,(O._sprite[E][0]+O._sprite[E][1])/1e3-qt),Ct=1e3*ge/Math.abs(X._rate),ot=O._sprite[E][0]/1e3,yt=(O._sprite[E][0]+O._sprite[E][1])/1e3;X._sprite=E,X._ended=!1;var Pt=function(){X._paused=!1,X._seek=qt,X._start=ot,X._stop=yt,X._loop=!(!X._loop&&!O._sprite[E][2])};if(!(qt>=yt)){var H=X._node;if(O._webAudio){var ft=function(){O._playLock=!1,Pt(),O._refreshBuffer(X);var Wt=X._muted||O._muted?0:X._volume;H.gain.setValueAtTime(Wt,W.ctx.currentTime),X._playStart=W.ctx.currentTime,H.bufferSource.start===void 0?X._loop?H.bufferSource.noteGrainOn(0,qt,86400):H.bufferSource.noteGrainOn(0,qt,ge):X._loop?H.bufferSource.start(0,qt,86400):H.bufferSource.start(0,qt,ge),Ct!==1/0&&(O._endTimers[X._id]=setTimeout(O._ended.bind(O,X),Ct)),L||setTimeout(function(){O._emit("play",X._id),O._loadQueue()},0)};W.state==="running"&&W.ctx.state!=="interrupted"?ft():(O._playLock=!0,O.once("resume",ft),O._clearTimer(X._id))}else{var Et=function(){H.currentTime=qt,H.muted=X._muted||O._muted||W._muted||H.muted,H.volume=X._volume*W.volume(),H.playbackRate=X._rate;try{var Wt=H.play();if(Wt&&typeof Promise!="undefined"&&(Wt instanceof Promise||typeof Wt.then=="function")?(O._playLock=!0,Pt(),Wt.then(function(){O._playLock=!1,H._unlocked=!0,L?O._loadQueue():O._emit("play",X._id)}).catch(function(){O._playLock=!1,O._emit("playerror",X._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."),X._ended=!0,X._paused=!0})):L||(O._playLock=!1,Pt(),O._emit("play",X._id)),H.playbackRate=X._rate,H.paused)return void O._emit("playerror",X._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"||X._loop?O._endTimers[X._id]=setTimeout(O._ended.bind(O,X),Ct):(O._endTimers[X._id]=function(){O._ended(X),H.removeEventListener("ended",O._endTimers[X._id],!1)},H.addEventListener("ended",O._endTimers[X._id],!1))}catch($t){O._emit("playerror",X._id,$t)}};H.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&(H.src=O._src,H.load());var At=window&&window.ejecta||!H.readyState&&W._navigator.isCocoonJS;if(H.readyState>=3||At)Et();else{O._playLock=!0,O._state="loading";var Rt=function(){O._state="loaded",Et(),H.removeEventListener(W._canPlayEvent,Rt,!1)};H.addEventListener(W._canPlayEvent,Rt,!1),O._clearTimer(X._id)}}return X._id}O._ended(X)},pause:function(E){var L=this;if(L._state!=="loaded"||L._playLock)return L._queue.push({event:"pause",action:function(){L.pause(E)}}),L;for(var O=L._getSoundIds(E),Y=0;Y<O.length;Y++){L._clearTimer(O[Y]);var C=L._soundById(O[Y]);if(C&&!C._paused&&(C._seek=L.seek(O[Y]),C._rateSeek=0,C._paused=!0,L._stopFade(O[Y]),C._node))if(L._webAudio){if(!C._node.bufferSource)continue;C._node.bufferSource.stop===void 0?C._node.bufferSource.noteOff(0):C._node.bufferSource.stop(0),L._cleanBuffer(C._node)}else isNaN(C._node.duration)&&C._node.duration!==1/0||C._node.pause();arguments[1]||L._emit("pause",C?C._id:null)}return L},stop:function(E,L){var O=this;if(O._state!=="loaded"||O._playLock)return O._queue.push({event:"stop",action:function(){O.stop(E)}}),O;for(var Y=O._getSoundIds(E),C=0;C<Y.length;C++){O._clearTimer(Y[C]);var j=O._soundById(Y[C]);j&&(j._seek=j._start||0,j._rateSeek=0,j._paused=!0,j._ended=!0,O._stopFade(Y[C]),j._node&&(O._webAudio?j._node.bufferSource&&(j._node.bufferSource.stop===void 0?j._node.bufferSource.noteOff(0):j._node.bufferSource.stop(0),O._cleanBuffer(j._node)):isNaN(j._node.duration)&&j._node.duration!==1/0||(j._node.currentTime=j._start||0,j._node.pause(),j._node.duration===1/0&&O._clearSound(j._node))),L||O._emit("stop",j._id))}return O},mute:function(E,L){var O=this;if(O._state!=="loaded"||O._playLock)return O._queue.push({event:"mute",action:function(){O.mute(E,L)}}),O;if(L===void 0){if(typeof E!="boolean")return O._muted;O._muted=E}for(var Y=O._getSoundIds(L),C=0;C<Y.length;C++){var j=O._soundById(Y[C]);j&&(j._muted=E,j._interval&&O._stopFade(j._id),O._webAudio&&j._node?j._node.gain.setValueAtTime(E?0:j._volume,W.ctx.currentTime):j._node&&(j._node.muted=!!W._muted||E),O._emit("mute",j._id))}return O},volume:function(){var E,L,O,Y=this,C=arguments;if(C.length===0)return Y._volume;if(C.length===1||C.length===2&&C[1]===void 0){var j=Y._getSoundIds(),X=j.indexOf(C[0]);X>=0?L=parseInt(C[0],10):E=parseFloat(C[0])}else C.length>=2&&(E=parseFloat(C[0]),L=parseInt(C[1],10));if(!(E!==void 0&&E>=0&&E<=1))return(O=L?Y._soundById(L):Y._sounds[0])?O._volume:0;if(Y._state!=="loaded"||Y._playLock)return Y._queue.push({event:"volume",action:function(){Y.volume.apply(Y,C)}}),Y;L===void 0&&(Y._volume=E),L=Y._getSoundIds(L);for(var K=0;K<L.length;K++)(O=Y._soundById(L[K]))&&(O._volume=E,C[2]||Y._stopFade(L[K]),Y._webAudio&&O._node&&!O._muted?O._node.gain.setValueAtTime(E,W.ctx.currentTime):O._node&&!O._muted&&(O._node.volume=E*W.volume()),Y._emit("volume",O._id));return Y},fade:function(E,L,O,Y){var C=this;if(C._state!=="loaded"||C._playLock)return C._queue.push({event:"fade",action:function(){C.fade(E,L,O,Y)}}),C;E=Math.min(Math.max(0,parseFloat(E)),1),L=Math.min(Math.max(0,parseFloat(L)),1),O=parseFloat(O),C.volume(E,Y);for(var j=C._getSoundIds(Y),X=0;X<j.length;X++){var K=C._soundById(j[X]);if(K){if(Y||C._stopFade(j[X]),C._webAudio&&!K._muted){var qt=W.ctx.currentTime,ge=qt+O/1e3;K._volume=E,K._node.gain.setValueAtTime(E,qt),K._node.gain.linearRampToValueAtTime(L,ge)}C._startFadeInterval(K,E,L,O,j[X],Y===void 0)}}return C},_startFadeInterval:function(E,L,O,Y,C,j){var X=this,K=L,qt=O-L,ge=Math.abs(qt/.01),Ct=Math.max(4,ge>0?Y/ge:Y),ot=Date.now();E._fadeTo=O,E._interval=setInterval(function(){var yt=(Date.now()-ot)/Y;ot=Date.now(),K+=qt*yt,K=Math.round(100*K)/100,K=qt<0?Math.max(O,K):Math.min(O,K),X._webAudio?E._volume=K:X.volume(K,E._id,!0),j&&(X._volume=K),(O<L&&K<=O||O>L&&K>=O)&&(clearInterval(E._interval),E._interval=null,E._fadeTo=null,X.volume(O,E._id),X._emit("fade",E._id))},Ct)},_stopFade:function(E){var L=this._soundById(E);return L&&L._interval&&(this._webAudio&&L._node.gain.cancelScheduledValues(W.ctx.currentTime),clearInterval(L._interval),L._interval=null,this.volume(L._fadeTo,E),L._fadeTo=null,this._emit("fade",E)),this},loop:function(){var E,L,O,Y=this,C=arguments;if(C.length===0)return Y._loop;if(C.length===1){if(typeof C[0]!="boolean")return!!(O=Y._soundById(parseInt(C[0],10)))&&O._loop;E=C[0],Y._loop=E}else C.length===2&&(E=C[0],L=parseInt(C[1],10));for(var j=Y._getSoundIds(L),X=0;X<j.length;X++)(O=Y._soundById(j[X]))&&(O._loop=E,Y._webAudio&&O._node&&O._node.bufferSource&&(O._node.bufferSource.loop=E,E&&(O._node.bufferSource.loopStart=O._start||0,O._node.bufferSource.loopEnd=O._stop,Y.playing(j[X])&&(Y.pause(j[X],!0),Y.play(j[X],!0)))));return Y},rate:function(){var E,L,O,Y=this,C=arguments;if(C.length===0)L=Y._sounds[0]._id;else if(C.length===1){var j=Y._getSoundIds(),X=j.indexOf(C[0]);X>=0?L=parseInt(C[0],10):E=parseFloat(C[0])}else C.length===2&&(E=parseFloat(C[0]),L=parseInt(C[1],10));if(typeof E!="number")return(O=Y._soundById(L))?O._rate:Y._rate;if(Y._state!=="loaded"||Y._playLock)return Y._queue.push({event:"rate",action:function(){Y.rate.apply(Y,C)}}),Y;L===void 0&&(Y._rate=E),L=Y._getSoundIds(L);for(var K=0;K<L.length;K++)if(O=Y._soundById(L[K])){Y.playing(L[K])&&(O._rateSeek=Y.seek(L[K]),O._playStart=Y._webAudio?W.ctx.currentTime:O._playStart),O._rate=E,Y._webAudio&&O._node&&O._node.bufferSource?O._node.bufferSource.playbackRate.setValueAtTime(E,W.ctx.currentTime):O._node&&(O._node.playbackRate=E);var qt=Y.seek(L[K]),ge=(Y._sprite[O._sprite][0]+Y._sprite[O._sprite][1])/1e3-qt,Ct=1e3*ge/Math.abs(O._rate);!Y._endTimers[L[K]]&&O._paused||(Y._clearTimer(L[K]),Y._endTimers[L[K]]=setTimeout(Y._ended.bind(Y,O),Ct)),Y._emit("rate",O._id)}return Y},seek:function(){var E,L,O=this,Y=arguments;if(Y.length===0)O._sounds.length&&(L=O._sounds[0]._id);else if(Y.length===1){var C=O._getSoundIds(),j=C.indexOf(Y[0]);j>=0?L=parseInt(Y[0],10):O._sounds.length&&(L=O._sounds[0]._id,E=parseFloat(Y[0]))}else Y.length===2&&(E=parseFloat(Y[0]),L=parseInt(Y[1],10));if(L===void 0)return 0;if(typeof E=="number"&&(O._state!=="loaded"||O._playLock))return O._queue.push({event:"seek",action:function(){O.seek.apply(O,Y)}}),O;var X=O._soundById(L);if(X){if(!(typeof E=="number"&&E>=0)){if(O._webAudio){var K=O.playing(L)?W.ctx.currentTime-X._playStart:0,qt=X._rateSeek?X._rateSeek-X._seek:0;return X._seek+(qt+K*Math.abs(X._rate))}return X._node.currentTime}var ge=O.playing(L);ge&&O.pause(L,!0),X._seek=E,X._ended=!1,O._clearTimer(L),O._webAudio||!X._node||isNaN(X._node.duration)||(X._node.currentTime=E);var Ct=function(){ge&&O.play(L,!0),O._emit("seek",L)};if(ge&&!O._webAudio){var ot=function(){O._playLock?setTimeout(ot,0):Ct()};setTimeout(ot,0)}else Ct()}return O},playing:function(E){if(typeof E=="number"){var L=this._soundById(E);return!!L&&!L._paused}for(var O=0;O<this._sounds.length;O++)if(!this._sounds[O]._paused)return!0;return!1},duration:function(E){var L=this._duration,O=this._soundById(E);return O&&(L=this._sprite[O._sprite][1]/1e3),L},state:function(){return this._state},unload:function(){for(var E=this,L=E._sounds,O=0;O<L.length;O++)L[O]._paused||E.stop(L[O]._id),E._webAudio||(E._clearSound(L[O]._node),L[O]._node.removeEventListener("error",L[O]._errorFn,!1),L[O]._node.removeEventListener(W._canPlayEvent,L[O]._loadFn,!1),L[O]._node.removeEventListener("ended",L[O]._endFn,!1),W._releaseHtml5Audio(L[O]._node)),delete L[O]._node,E._clearTimer(L[O]._id);var Y=W._howls.indexOf(E);Y>=0&&W._howls.splice(Y,1);var C=!0;for(O=0;O<W._howls.length;O++)if(W._howls[O]._src===E._src||E._src.indexOf(W._howls[O]._src)>=0){C=!1;break}return z&&C&&delete z[E._src],W.noAudio=!1,E._state="unloaded",E._sounds=[],E=null,null},on:function(E,L,O,Y){var C=this["_on"+E];return typeof L=="function"&&C.push(Y?{id:O,fn:L,once:Y}:{id:O,fn:L}),this},off:function(E,L,O){var Y=this["_on"+E],C=0;if(typeof L=="number"&&(O=L,L=null),L||O)for(C=0;C<Y.length;C++){var j=O===Y[C].id;if(L===Y[C].fn&&j||!L&&j){Y.splice(C,1);break}}else if(E)this["_on"+E]=[];else{var X=Object.keys(this);for(C=0;C<X.length;C++)X[C].indexOf("_on")===0&&Array.isArray(this[X[C]])&&(this[X[C]]=[])}return this},once:function(E,L,O){return this.on(E,L,O,1),this},_emit:function(E,L,O){for(var Y=this["_on"+E],C=Y.length-1;C>=0;C--)Y[C].id&&Y[C].id!==L&&E!=="load"||(setTimeout(function(j){j.call(this,L,O)}.bind(this,Y[C].fn),0),Y[C].once&&this.off(E,Y[C].fn,Y[C].id));return this._loadQueue(E),this},_loadQueue:function(E){if(this._queue.length>0){var L=this._queue[0];L.event===E&&(this._queue.shift(),this._loadQueue()),E||L.action()}return this},_ended:function(E){var L=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 O=!(!E._loop&&!this._sprite[L][2]);if(this._emit("end",E._id),!this._webAudio&&O&&this.stop(E._id,!0).play(E._id),this._webAudio&&O){this._emit("play",E._id),E._seek=E._start||0,E._rateSeek=0,E._playStart=W.ctx.currentTime;var Y=1e3*(E._stop-E._start)/Math.abs(E._rate);this._endTimers[E._id]=setTimeout(this._ended.bind(this,E),Y)}return this._webAudio&&!O&&(E._paused=!0,E._ended=!0,E._seek=E._start||0,E._rateSeek=0,this._clearTimer(E._id),this._cleanBuffer(E._node),W._autoSuspend()),this._webAudio||O||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 L=this._soundById(E);L&&L._node&&L._node.removeEventListener("ended",this._endTimers[E],!1)}delete this._endTimers[E]}return this},_soundById:function(E){for(var L=0;L<this._sounds.length;L++)if(E===this._sounds[L]._id)return this._sounds[L];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 V(this)},_drain:function(){var E=this._pool,L=0,O=0;if(!(this._sounds.length<E)){for(O=0;O<this._sounds.length;O++)this._sounds[O]._ended&&L++;for(O=this._sounds.length-1;O>=0;O--){if(L<=E)return;this._sounds[O]._ended&&(this._webAudio&&this._sounds[O]._node&&this._sounds[O]._node.disconnect(0),this._sounds.splice(O,1),L--)}}},_getSoundIds:function(E){if(E===void 0){for(var L=[],O=0;O<this._sounds.length;O++)L.push(this._sounds[O]._id);return L}return[E]},_refreshBuffer:function(E){return E._node.bufferSource=W.ctx.createBufferSource(),E._node.bufferSource.buffer=z[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,W.ctx.currentTime),this},_cleanBuffer:function(E){var L=W._navigator&&W._navigator.vendor.indexOf("Apple")>=0;if(W._scratchBuffer&&E.bufferSource&&(E.bufferSource.onended=null,E.bufferSource.disconnect(0),L))try{E.bufferSource.buffer=W._scratchBuffer}catch{}return E.bufferSource=null,this},_clearSound:function(E){/MSIE |Trident\//.test(W._navigator&&W._navigator.userAgent)||(E.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var V=function(E){this._parent=E,this.init()};V.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=++W._counter,E._sounds.push(this),this.create(),this},create:function(){var E=this._parent,L=W._muted||this._muted||this._parent._muted?0:this._volume;return E._webAudio?(this._node=W.ctx.createGain===void 0?W.ctx.createGainNode():W.ctx.createGain(),this._node.gain.setValueAtTime(L,W.ctx.currentTime),this._node.paused=!0,this._node.connect(W.masterGain)):W.noAudio||(this._node=W._obtainHtml5Audio(),this._errorFn=this._errorListener.bind(this),this._node.addEventListener("error",this._errorFn,!1),this._loadFn=this._loadListener.bind(this),this._node.addEventListener(W._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=L*W.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=++W._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(W._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 z={},k=function(E){var L=E._src;if(z[L])return E._duration=z[L].duration,void Ot(E);if(/^data:[^;]+;base64,/.test(L)){for(var O=atob(L.split(",")[1]),Y=new Uint8Array(O.length),C=0;C<O.length;++C)Y[C]=O.charCodeAt(C);vt(Y.buffer,E)}else{var j=new XMLHttpRequest;j.open(E._xhr.method,L,!0),j.withCredentials=E._xhr.withCredentials,j.responseType="arraybuffer",E._xhr.headers&&Object.keys(E._xhr.headers).forEach(function(X){j.setRequestHeader(X,E._xhr.headers[X])}),j.onload=function(){var X=(j.status+"")[0];X==="0"||X==="2"||X==="3"?vt(j.response,E):E._emit("loaderror",null,"Failed loading audio file with status: "+j.status+".")},j.onerror=function(){E._webAudio&&(E._html5=!0,E._webAudio=!1,E._sounds=[],delete z[L],E.load())},Z(j)}},Z=function(E){try{E.send()}catch{E.onerror()}},vt=function(E,L){var O=function(){L._emit("loaderror",null,"Decoding audio data failed.")},Y=function(C){C&&L._sounds.length>0?(z[L._src]=C,Ot(L,C)):O()};typeof Promise!="undefined"&&W.ctx.decodeAudioData.length===1?W.ctx.decodeAudioData(E).then(Y).catch(O):W.ctx.decodeAudioData(E,Y,O)},Ot=function(E,L){L&&!E._duration&&(E._duration=L.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())},Nt=function(){if(W.usingWebAudio){try{typeof AudioContext!="undefined"?W.ctx=new AudioContext:typeof webkitAudioContext!="undefined"?W.ctx=new webkitAudioContext:W.usingWebAudio=!1}catch{W.usingWebAudio=!1}W.ctx||(W.usingWebAudio=!1);var E=/iP(hone|od|ad)/.test(W._navigator&&W._navigator.platform),L=W._navigator&&W._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),O=L?parseInt(L[1],10):null;if(E&&O&&O<9){var Y=/safari/.test(W._navigator&&W._navigator.userAgent.toLowerCase());W._navigator&&!Y&&(W.usingWebAudio=!1)}W.usingWebAudio&&(W.masterGain=W.ctx.createGain===void 0?W.ctx.createGainNode():W.ctx.createGain(),W.masterGain.gain.setValueAtTime(W._muted?0:W._volume,W.ctx.currentTime),W.masterGain.connect(W.ctx.destination)),W._setup()}};(q=function(){return{Howler:W,Howl:P}}.apply(M,[]))===void 0||(T.exports=q),M.Howler=W,M.Howl=P,b!==void 0?(b.HowlerGlobal=ht,b.Howler=W,b.Howl=P,b.Sound=V):typeof window!="undefined"&&(window.HowlerGlobal=ht,window.Howler=W,window.Howl=P,window.Sound=V)})(),function(){var ht;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(P){if(!this.ctx||!this.ctx.listener)return this;for(var V=this._howls.length-1;V>=0;V--)this._howls[V].stereo(P);return this},HowlerGlobal.prototype.pos=function(P,V,z){return this.ctx&&this.ctx.listener?(V=typeof V!="number"?this._pos[1]:V,z=typeof z!="number"?this._pos[2]:z,typeof P!="number"?this._pos:(this._pos=[P,V,z],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(P,V,z,k,Z,vt){if(!this.ctx||!this.ctx.listener)return this;var Ot=this._orientation;return V=typeof V!="number"?Ot[1]:V,z=typeof z!="number"?Ot[2]:z,k=typeof k!="number"?Ot[3]:k,Z=typeof Z!="number"?Ot[4]:Z,vt=typeof vt!="number"?Ot[5]:vt,typeof P!="number"?Ot:(this._orientation=[P,V,z,k,Z,vt],this.ctx.listener.forwardX!==void 0?(this.ctx.listener.forwardX.setTargetAtTime(P,Howler.ctx.currentTime,.1),this.ctx.listener.forwardY.setTargetAtTime(V,Howler.ctx.currentTime,.1),this.ctx.listener.forwardZ.setTargetAtTime(z,Howler.ctx.currentTime,.1),this.ctx.listener.upX.setTargetAtTime(k,Howler.ctx.currentTime,.1),this.ctx.listener.upY.setTargetAtTime(Z,Howler.ctx.currentTime,.1),this.ctx.listener.upZ.setTargetAtTime(vt,Howler.ctx.currentTime,.1)):this.ctx.listener.setOrientation(P,V,z,k,Z,vt),this)},Howl.prototype.init=(ht=Howl.prototype.init,function(P){return this._orientation=P.orientation||[1,0,0],this._stereo=P.stereo||null,this._pos=P.pos||null,this._pannerAttr={coneInnerAngle:P.coneInnerAngle!==void 0?P.coneInnerAngle:360,coneOuterAngle:P.coneOuterAngle!==void 0?P.coneOuterAngle:360,coneOuterGain:P.coneOuterGain!==void 0?P.coneOuterGain:0,distanceModel:P.distanceModel!==void 0?P.distanceModel:"inverse",maxDistance:P.maxDistance!==void 0?P.maxDistance:1e4,panningModel:P.panningModel!==void 0?P.panningModel:"HRTF",refDistance:P.refDistance!==void 0?P.refDistance:1,rolloffFactor:P.rolloffFactor!==void 0?P.rolloffFactor:1},this._onstereo=P.onstereo?[{fn:P.onstereo}]:[],this._onpos=P.onpos?[{fn:P.onpos}]:[],this._onorientation=P.onorientation?[{fn:P.onorientation}]:[],ht.call(this,P)}),Howl.prototype.stereo=function(P,V){var z=this;if(!z._webAudio)return z;if(z._state!=="loaded")return z._queue.push({event:"stereo",action:function(){z.stereo(P,V)}}),z;var k=Howler.ctx.createStereoPanner===void 0?"spatial":"stereo";if(V===void 0){if(typeof P!="number")return z._stereo;z._stereo=P,z._pos=[P,0,0]}for(var Z=z._getSoundIds(V),vt=0;vt<Z.length;vt++){var Ot=z._soundById(Z[vt]);if(Ot){if(typeof P!="number")return Ot._stereo;Ot._stereo=P,Ot._pos=[P,0,0],Ot._node&&(Ot._pannerAttr.panningModel="equalpower",Ot._panner&&Ot._panner.pan||W(Ot,k),k==="spatial"?Ot._panner.positionX!==void 0?(Ot._panner.positionX.setValueAtTime(P,Howler.ctx.currentTime),Ot._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),Ot._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):Ot._panner.setPosition(P,0,0):Ot._panner.pan.setValueAtTime(P,Howler.ctx.currentTime)),z._emit("stereo",Ot._id)}}return z},Howl.prototype.pos=function(P,V,z,k){var Z=this;if(!Z._webAudio)return Z;if(Z._state!=="loaded")return Z._queue.push({event:"pos",action:function(){Z.pos(P,V,z,k)}}),Z;if(V=typeof V!="number"?0:V,z=typeof z!="number"?-.5:z,k===void 0){if(typeof P!="number")return Z._pos;Z._pos=[P,V,z]}for(var vt=Z._getSoundIds(k),Ot=0;Ot<vt.length;Ot++){var Nt=Z._soundById(vt[Ot]);if(Nt){if(typeof P!="number")return Nt._pos;Nt._pos=[P,V,z],Nt._node&&(Nt._panner&&!Nt._panner.pan||W(Nt,"spatial"),Nt._panner.positionX!==void 0?(Nt._panner.positionX.setValueAtTime(P,Howler.ctx.currentTime),Nt._panner.positionY.setValueAtTime(V,Howler.ctx.currentTime),Nt._panner.positionZ.setValueAtTime(z,Howler.ctx.currentTime)):Nt._panner.setPosition(P,V,z)),Z._emit("pos",Nt._id)}}return Z},Howl.prototype.orientation=function(P,V,z,k){var Z=this;if(!Z._webAudio)return Z;if(Z._state!=="loaded")return Z._queue.push({event:"orientation",action:function(){Z.orientation(P,V,z,k)}}),Z;if(V=typeof V!="number"?Z._orientation[1]:V,z=typeof z!="number"?Z._orientation[2]:z,k===void 0){if(typeof P!="number")return Z._orientation;Z._orientation=[P,V,z]}for(var vt=Z._getSoundIds(k),Ot=0;Ot<vt.length;Ot++){var Nt=Z._soundById(vt[Ot]);if(Nt){if(typeof P!="number")return Nt._orientation;Nt._orientation=[P,V,z],Nt._node&&(Nt._panner||(Nt._pos||(Nt._pos=Z._pos||[0,0,-.5]),W(Nt,"spatial")),Nt._panner.orientationX!==void 0?(Nt._panner.orientationX.setValueAtTime(P,Howler.ctx.currentTime),Nt._panner.orientationY.setValueAtTime(V,Howler.ctx.currentTime),Nt._panner.orientationZ.setValueAtTime(z,Howler.ctx.currentTime)):Nt._panner.setOrientation(P,V,z)),Z._emit("orientation",Nt._id)}}return Z},Howl.prototype.pannerAttr=function(){var P,V,z,k=this,Z=arguments;if(!k._webAudio)return k;if(Z.length===0)return k._pannerAttr;if(Z.length===1){if(typeof Z[0]!="object")return(z=k._soundById(parseInt(Z[0],10)))?z._pannerAttr:k._pannerAttr;P=Z[0],V===void 0&&(P.pannerAttr||(P.pannerAttr={coneInnerAngle:P.coneInnerAngle,coneOuterAngle:P.coneOuterAngle,coneOuterGain:P.coneOuterGain,distanceModel:P.distanceModel,maxDistance:P.maxDistance,refDistance:P.refDistance,rolloffFactor:P.rolloffFactor,panningModel:P.panningModel}),k._pannerAttr={coneInnerAngle:P.pannerAttr.coneInnerAngle!==void 0?P.pannerAttr.coneInnerAngle:k._coneInnerAngle,coneOuterAngle:P.pannerAttr.coneOuterAngle!==void 0?P.pannerAttr.coneOuterAngle:k._coneOuterAngle,coneOuterGain:P.pannerAttr.coneOuterGain!==void 0?P.pannerAttr.coneOuterGain:k._coneOuterGain,distanceModel:P.pannerAttr.distanceModel!==void 0?P.pannerAttr.distanceModel:k._distanceModel,maxDistance:P.pannerAttr.maxDistance!==void 0?P.pannerAttr.maxDistance:k._maxDistance,refDistance:P.pannerAttr.refDistance!==void 0?P.pannerAttr.refDistance:k._refDistance,rolloffFactor:P.pannerAttr.rolloffFactor!==void 0?P.pannerAttr.rolloffFactor:k._rolloffFactor,panningModel:P.pannerAttr.panningModel!==void 0?P.pannerAttr.panningModel:k._panningModel})}else Z.length===2&&(P=Z[0],V=parseInt(Z[1],10));for(var vt=k._getSoundIds(V),Ot=0;Ot<vt.length;Ot++)if(z=k._soundById(vt[Ot])){var Nt=z._pannerAttr;Nt={coneInnerAngle:P.coneInnerAngle!==void 0?P.coneInnerAngle:Nt.coneInnerAngle,coneOuterAngle:P.coneOuterAngle!==void 0?P.coneOuterAngle:Nt.coneOuterAngle,coneOuterGain:P.coneOuterGain!==void 0?P.coneOuterGain:Nt.coneOuterGain,distanceModel:P.distanceModel!==void 0?P.distanceModel:Nt.distanceModel,maxDistance:P.maxDistance!==void 0?P.maxDistance:Nt.maxDistance,refDistance:P.refDistance!==void 0?P.refDistance:Nt.refDistance,rolloffFactor:P.rolloffFactor!==void 0?P.rolloffFactor:Nt.rolloffFactor,panningModel:P.panningModel!==void 0?P.panningModel:Nt.panningModel};var E=z._panner;E?(E.coneInnerAngle=Nt.coneInnerAngle,E.coneOuterAngle=Nt.coneOuterAngle,E.coneOuterGain=Nt.coneOuterGain,E.distanceModel=Nt.distanceModel,E.maxDistance=Nt.maxDistance,E.refDistance=Nt.refDistance,E.rolloffFactor=Nt.rolloffFactor,E.panningModel=Nt.panningModel):(z._pos||(z._pos=k._pos||[0,0,-.5]),W(z,"spatial"))}return k},Sound.prototype.init=function(P){return function(){var V=this._parent;this._orientation=V._orientation,this._stereo=V._stereo,this._pos=V._pos,this._pannerAttr=V._pannerAttr,P.call(this),this._stereo?V.stereo(this._stereo):this._pos&&V.pos(this._pos[0],this._pos[1],this._pos[2],this._id)}}(Sound.prototype.init),Sound.prototype.reset=function(P){return function(){var V=this._parent;return this._orientation=V._orientation,this._stereo=V._stereo,this._pos=V._pos,this._pannerAttr=V._pannerAttr,this._stereo?V.stereo(this._stereo):this._pos?V.pos(this._pos[0],this._pos[1],this._pos[2],this._id):this._panner&&(this._panner.disconnect(0),this._panner=void 0,V._refreshBuffer(this)),P.call(this)}}(Sound.prototype.reset);var W=function(P,V){(V=V||"spatial")==="spatial"?(P._panner=Howler.ctx.createPanner(),P._panner.coneInnerAngle=P._pannerAttr.coneInnerAngle,P._panner.coneOuterAngle=P._pannerAttr.coneOuterAngle,P._panner.coneOuterGain=P._pannerAttr.coneOuterGain,P._panner.distanceModel=P._pannerAttr.distanceModel,P._panner.maxDistance=P._pannerAttr.maxDistance,P._panner.refDistance=P._pannerAttr.refDistance,P._panner.rolloffFactor=P._pannerAttr.rolloffFactor,P._panner.panningModel=P._pannerAttr.panningModel,P._panner.positionX!==void 0?(P._panner.positionX.setValueAtTime(P._pos[0],Howler.ctx.currentTime),P._panner.positionY.setValueAtTime(P._pos[1],Howler.ctx.currentTime),P._panner.positionZ.setValueAtTime(P._pos[2],Howler.ctx.currentTime)):P._panner.setPosition(P._pos[0],P._pos[1],P._pos[2]),P._panner.orientationX!==void 0?(P._panner.orientationX.setValueAtTime(P._orientation[0],Howler.ctx.currentTime),P._panner.orientationY.setValueAtTime(P._orientation[1],Howler.ctx.currentTime),P._panner.orientationZ.setValueAtTime(P._orientation[2],Howler.ctx.currentTime)):P._panner.setOrientation(P._orientation[0],P._orientation[1],P._orientation[2])):(P._panner=Howler.ctx.createStereoPanner(),P._panner.pan.setValueAtTime(P._stereo,Howler.ctx.currentTime)),P._panner.connect(P._node),P._paused||P._parent.pause(P._id,!0).play(P._id,!0)}}()}).call(this,v(3))},function(T,M){T.exports=`varying vec2 vTextureCoord;
|
|
1720
1720
|
varying vec2 vVertexPosition;
|
|
1721
1721
|
varying float vPercent;
|
|
1722
1722
|
varying float vDirection;
|
|
@@ -1824,11 +1824,11 @@ void main() {
|
|
|
1824
1824
|
vec4 color1 = texture2D(uSampler, vTextureCoord);
|
|
1825
1825
|
gl_FragColor = color1 * alpha;
|
|
1826
1826
|
}
|
|
1827
|
-
`},function(T,M,v){var b;(function(q,ht){var W="model",C="name",V="type",z="vendor",k="version",Z="mobile",vt="tablet",Ot="smarttv",Nt=function(Ct){for(var ot={},yt=0;yt<Ct.length;yt++)ot[Ct[yt].toUpperCase()]=Ct[yt];return ot},E=function(Ct,ot){return typeof Ct=="string"&&L(ot).indexOf(L(Ct))!==-1},L=function(Ct){return Ct.toLowerCase()},O=function(Ct,ot){if(typeof Ct=="string")return Ct=Ct.replace(/^\s\s*/,"").replace(/\s\s*$/,""),ot===void 0?Ct:Ct.substring(0,255)},Y=function(Ct,ot){for(var yt,Pt,H,ft,Et,At,Rt=0;Rt<ot.length&&!Et;){var Wt=ot[Rt],$t=ot[Rt+1];for(yt=Pt=0;yt<Wt.length&&!Et;)if(Et=Wt[yt++].exec(Ct))for(H=0;H<$t.length;H++)At=Et[++Pt],typeof(ft=$t[H])=="object"&&ft.length>0?ft.length===2?typeof ft[1]=="function"?this[ft[0]]=ft[1].call(this,At):this[ft[0]]=ft[1]:ft.length===3?typeof ft[1]!="function"||ft[1].exec&&ft[1].test?this[ft[0]]=At?At.replace(ft[1],ft[2]):void 0:this[ft[0]]=At?ft[1].call(this,At,ft[2]):void 0:ft.length===4&&(this[ft[0]]=At?ft[3].call(this,At.replace(ft[1],ft[2])):void 0):this[ft]=At||void 0;Rt+=2}},P=function(Ct,ot){for(var yt in ot)if(typeof ot[yt]=="object"&&ot[yt].length>0){for(var Pt=0;Pt<ot[yt].length;Pt++)if(E(ot[yt][Pt],Ct))return yt==="?"?void 0:yt}else if(E(ot[yt],Ct))return yt==="?"?void 0:yt;return Ct},j={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"},X={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[k,[C,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[k,[C,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[C,k],[/opios[\/ ]+([\w\.]+)/i],[k,[C,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[k,[C,"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],[C,k],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[k,[C,"UCBrowser"]],[/\bqbcore\/([\w\.]+)/i],[k,[C,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[k,[C,"WeChat"]],[/konqueror\/([\w\.]+)/i],[k,[C,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[k,[C,"IE"]],[/yabrowser\/([\w\.]+)/i],[k,[C,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[C,/(.+)/,"$1 Secure Browser"],k],[/\bfocus\/([\w\.]+)/i],[k,[C,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[k,[C,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[k,[C,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[k,[C,"Dolphin"]],[/coast\/([\w\.]+)/i],[k,[C,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[k,[C,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[k,[C,"Firefox"]],[/\bqihu|(qi?ho?o?|360)browser/i],[[C,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[C,/(.+)/,"$1 Browser"],k],[/(comodo_dragon)\/([\w\.]+)/i],[[C,/_/g," "],k],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[C,k],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[C],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[C,"Facebook"],k],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[C,k],[/\bgsa\/([\w\.]+) .*safari\//i],[k,[C,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[k,[C,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[C,"Chrome WebView"],k],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[k,[C,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[C,k],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[k,[C,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[k,C],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[C,[k,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],[C,k],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[C,"Netscape"],k],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[k,[C,"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],[C,k]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[["architecture","amd64"]],[/(ia32(?=;))/i],[["architecture",L]],[/((?: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/,"",L]],[/(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",L]]],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],[W,[z,"Samsung"],[V,vt]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[W,[z,"Samsung"],[V,Z]],[/\((ip(?:hone|od)[\w ]*);/i],[W,[z,"Apple"],[V,Z]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[W,[z,"Apple"],[V,vt]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[W,[z,"Huawei"],[V,vt]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[W,[z,"Huawei"],[V,Z]],[/\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],[[W,/_/g," "],[z,"Xiaomi"],[V,Z]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[W,/_/g," "],[z,"Xiaomi"],[V,vt]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[W,[z,"OPPO"],[V,Z]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[W,[z,"Vivo"],[V,Z]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[W,[z,"Realme"],[V,Z]],[/\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],[W,[z,"Motorola"],[V,Z]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[W,[z,"Motorola"],[V,vt]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[W,[z,"LG"],[V,vt]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[W,[z,"LG"],[V,Z]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[W,[z,"Lenovo"],[V,vt]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[W,/_/g," "],[z,"Nokia"],[V,Z]],[/(pixel c)\b/i],[W,[z,"Google"],[V,vt]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[W,[z,"Google"],[V,Z]],[/droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[W,[z,"Sony"],[V,Z]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[W,"Xperia Tablet"],[z,"Sony"],[V,vt]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[W,[z,"OnePlus"],[V,Z]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[W,[z,"Amazon"],[V,vt]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[W,/(.+)/g,"Fire Phone $1"],[z,"Amazon"],[V,Z]],[/(playbook);[-\w\),; ]+(rim)/i],[W,z,[V,vt]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[W,[z,"BlackBerry"],[V,Z]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[W,[z,"ASUS"],[V,vt]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[W,[z,"ASUS"],[V,Z]],[/(nexus 9)/i],[W,[z,"HTC"],[V,vt]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[z,[W,/_/g," "],[V,Z]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[W,[z,"Acer"],[V,vt]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[W,[z,"Meizu"],[V,Z]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[W,[z,"Sharp"],[V,Z]],[/(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],[z,W,[V,Z]],[/(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],[z,W,[V,vt]],[/(surface duo)/i],[W,[z,"Microsoft"],[V,vt]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[W,[z,"Fairphone"],[V,Z]],[/(u304aa)/i],[W,[z,"AT&T"],[V,Z]],[/\bsie-(\w*)/i],[W,[z,"Siemens"],[V,Z]],[/\b(rct\w+) b/i],[W,[z,"RCA"],[V,vt]],[/\b(venue[\d ]{2,7}) b/i],[W,[z,"Dell"],[V,vt]],[/\b(q(?:mv|ta)\w+) b/i],[W,[z,"Verizon"],[V,vt]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[W,[z,"Barnes & Noble"],[V,vt]],[/\b(tm\d{3}\w+) b/i],[W,[z,"NuVision"],[V,vt]],[/\b(k88) b/i],[W,[z,"ZTE"],[V,vt]],[/\b(nx\d{3}j) b/i],[W,[z,"ZTE"],[V,Z]],[/\b(gen\d{3}) b.+49h/i],[W,[z,"Swiss"],[V,Z]],[/\b(zur\d{3}) b/i],[W,[z,"Swiss"],[V,vt]],[/\b((zeki)?tb.*\b) b/i],[W,[z,"Zeki"],[V,vt]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[z,"Dragon Touch"],W,[V,vt]],[/\b(ns-?\w{0,9}) b/i],[W,[z,"Insignia"],[V,vt]],[/\b((nxa|next)-?\w{0,9}) b/i],[W,[z,"NextBook"],[V,vt]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[z,"Voice"],W,[V,Z]],[/\b(lvtel\-)?(v1[12]) b/i],[[z,"LvTel"],W,[V,Z]],[/\b(ph-1) /i],[W,[z,"Essential"],[V,Z]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[W,[z,"Envizen"],[V,vt]],[/\b(trio[-\w\. ]+) b/i],[W,[z,"MachSpeed"],[V,vt]],[/\btu_(1491) b/i],[W,[z,"Rotor"],[V,vt]],[/(shield[\w ]+) b/i],[W,[z,"Nvidia"],[V,vt]],[/(sprint) (\w+)/i],[z,W,[V,Z]],[/(kin\.[onetw]{3})/i],[[W,/\./g," "],[z,"Microsoft"],[V,Z]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[W,[z,"Zebra"],[V,vt]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[W,[z,"Zebra"],[V,Z]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[z,W,[V,"console"]],[/droid.+; (shield) bui/i],[W,[z,"Nvidia"],[V,"console"]],[/(playstation [345portablevi]+)/i],[W,[z,"Sony"],[V,"console"]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[W,[z,"Microsoft"],[V,"console"]],[/smart-tv.+(samsung)/i],[z,[V,Ot]],[/hbbtv.+maple;(\d+)/i],[[W,/^/,"SmartTV"],[z,"Samsung"],[V,Ot]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[z,"LG"],[V,Ot]],[/(apple) ?tv/i],[z,[W,"Apple TV"],[V,Ot]],[/crkey/i],[[W,"Chromecast"],[z,"Google"],[V,Ot]],[/droid.+aft(\w)( bui|\))/i],[W,[z,"Amazon"],[V,Ot]],[/\(dtv[\);].+(aquos)/i],[W,[z,"Sharp"],[V,Ot]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[z,O],[W,O],[V,Ot]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[V,Ot]],[/((pebble))app/i],[z,W,[V,"wearable"]],[/droid.+; (glass) \d/i],[W,[z,"Google"],[V,"wearable"]],[/droid.+; (wt63?0{2,3})\)/i],[W,[z,"Zebra"],[V,"wearable"]],[/(quest( 2)?)/i],[W,[z,"Facebook"],[V,"wearable"]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[z,[V,"embedded"]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[W,[V,Z]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[W,[V,vt]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[V,vt]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[V,Z]],[/(android[-\w\. ]{0,9});.+buil/i],[W,[z,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[k,[C,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[k,[C,"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],[C,k],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[k,C]],os:[[/microsoft (windows) (vista|xp)/i],[C,k],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[C,[k,P,j]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[C,"Windows"],[k,P,j]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[k,/_/g,"."],[C,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[C,"Mac OS"],[k,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[k,C],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[C,k],[/\(bb(10);/i],[k,[C,"BlackBerry"]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[k,[C,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[k,[C,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[k,[C,"webOS"]],[/crkey\/([\d\.]+)/i],[k,[C,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[C,"Chromium OS"],k],[/(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],[C,k],[/(sunos) ?([\w\.\d]*)/i],[[C,"Solaris"],k],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[C,k]]},K=function(Ct,ot){if(typeof Ct=="object"&&(ot=Ct,Ct=void 0),!(this instanceof K))return new K(Ct,ot).getResult();var yt=Ct||(q!==void 0&&q.navigator&&q.navigator.userAgent?q.navigator.userAgent:""),Pt=ot?function(H,ft){var Et={};for(var At in H)ft[At]&&ft[At].length%2==0?Et[At]=ft[At].concat(H[At]):Et[At]=H[At];return Et}(X,ot):X;return this.getBrowser=function(){var H,ft={};return ft[C]=void 0,ft[k]=void 0,Y.call(ft,yt,Pt.browser),ft.major=typeof(H=ft.version)=="string"?H.replace(/[^\d\.]/g,"").split(".")[0]:void 0,ft},this.getCPU=function(){var H={architecture:void 0};return Y.call(H,yt,Pt.cpu),H},this.getDevice=function(){var H={vendor:void 0,model:void 0,type:void 0};return Y.call(H,yt,Pt.device),H},this.getEngine=function(){var H={name:void 0,version:void 0};return Y.call(H,yt,Pt.engine),H},this.getOS=function(){var H={name:void 0,version:void 0};return Y.call(H,yt,Pt.os),H},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 yt},this.setUA=function(H){return yt=typeof H=="string"&&H.length>255?O(H,255):H,this},this.setUA(yt),this};K.VERSION="1.0.2",K.BROWSER=Nt([C,k,"major"]),K.CPU=Nt(["architecture"]),K.DEVICE=Nt([W,z,V,"console",Z,Ot,vt,"wearable","embedded"]),K.ENGINE=K.OS=Nt([C,k]),M!==void 0?(T!==void 0&&T.exports&&(M=T.exports=K),M.UAParser=K):v(63)?(b=function(){return K}.call(M,v,M,T))===void 0||(T.exports=b):q!==void 0&&(q.UAParser=K);var qt=q!==void 0&&(q.jQuery||q.Zepto);if(qt&&!qt.ua){var ge=new K;qt.ua=ge.getResult(),qt.ua.get=function(){return ge.getUA()},qt.ua.set=function(Ct){ge.setUA(Ct);var ot=ge.getResult();for(var yt in ot)qt.ua[yt]=ot[yt]}}})(typeof window=="object"?window:this)},function(T,M,v){(function(b){var q=b!==void 0&&b||typeof self!="undefined"&&self||window,ht=Function.prototype.apply;function W(C,V){this._id=C,this._clearFn=V}M.setTimeout=function(){return new W(ht.call(setTimeout,q,arguments),clearTimeout)},M.setInterval=function(){return new W(ht.call(setInterval,q,arguments),clearInterval)},M.clearTimeout=M.clearInterval=function(C){C&&C.close()},W.prototype.unref=W.prototype.ref=function(){},W.prototype.close=function(){this._clearFn.call(q,this._id)},M.enroll=function(C,V){clearTimeout(C._idleTimeoutId),C._idleTimeout=V},M.unenroll=function(C){clearTimeout(C._idleTimeoutId),C._idleTimeout=-1},M._unrefActive=M.active=function(C){clearTimeout(C._idleTimeoutId);var V=C._idleTimeout;V>=0&&(C._idleTimeoutId=setTimeout(function(){C._onTimeout&&C._onTimeout()},V))},v(55),M.setImmediate=typeof self!="undefined"&&self.setImmediate||b!==void 0&&b.setImmediate||this&&this.setImmediate,M.clearImmediate=typeof self!="undefined"&&self.clearImmediate||b!==void 0&&b.clearImmediate||this&&this.clearImmediate}).call(this,v(3))},function(T,M,v){(function(b,q){(function(ht,W){if(!ht.setImmediate){var C,V,z,k,Z,vt=1,Ot={},Nt=!1,E=ht.document,L=Object.getPrototypeOf&&Object.getPrototypeOf(ht);L=L&&L.setTimeout?L:ht,{}.toString.call(ht.process)==="[object process]"?C=function(P){q.nextTick(function(){Y(P)})}:function(){if(ht.postMessage&&!ht.importScripts){var P=!0,j=ht.onmessage;return ht.onmessage=function(){P=!1},ht.postMessage("","*"),ht.onmessage=j,P}}()?(k="setImmediate$"+Math.random()+"$",Z=function(P){P.source===ht&&typeof P.data=="string"&&P.data.indexOf(k)===0&&Y(+P.data.slice(k.length))},ht.addEventListener?ht.addEventListener("message",Z,!1):ht.attachEvent("onmessage",Z),C=function(P){ht.postMessage(k+P,"*")}):ht.MessageChannel?((z=new MessageChannel).port1.onmessage=function(P){Y(P.data)},C=function(P){z.port2.postMessage(P)}):E&&"onreadystatechange"in E.createElement("script")?(V=E.documentElement,C=function(P){var j=E.createElement("script");j.onreadystatechange=function(){Y(P),j.onreadystatechange=null,V.removeChild(j),j=null},V.appendChild(j)}):C=function(P){setTimeout(Y,0,P)},L.setImmediate=function(P){typeof P!="function"&&(P=new Function(""+P));for(var j=new Array(arguments.length-1),X=0;X<j.length;X++)j[X]=arguments[X+1];var K={callback:P,args:j};return Ot[vt]=K,C(vt),vt++},L.clearImmediate=O}function O(P){delete Ot[P]}function Y(P){if(Nt)setTimeout(Y,0,P);else{var j=Ot[P];if(j){Nt=!0;try{(function(X){var K=X.callback,qt=X.args;switch(qt.length){case 0:K();break;case 1:K(qt[0]);break;case 2:K(qt[0],qt[1]);break;case 3:K(qt[0],qt[1],qt[2]);break;default:K.apply(void 0,qt)}})(j)}finally{O(P),Nt=!1}}}}})(typeof self=="undefined"?b===void 0?this:b:self)}).call(this,v(3),v(56))},function(T,M){var v,b,q=T.exports={};function ht(){throw new Error("setTimeout has not been defined")}function W(){throw new Error("clearTimeout has not been defined")}function C(L){if(v===setTimeout)return setTimeout(L,0);if((v===ht||!v)&&setTimeout)return v=setTimeout,setTimeout(L,0);try{return v(L,0)}catch{try{return v.call(null,L,0)}catch{return v.call(this,L,0)}}}(function(){try{v=typeof setTimeout=="function"?setTimeout:ht}catch{v=ht}try{b=typeof clearTimeout=="function"?clearTimeout:W}catch{b=W}})();var V,z=[],k=!1,Z=-1;function vt(){k&&V&&(k=!1,V.length?z=V.concat(z):Z=-1,z.length&&Ot())}function Ot(){if(!k){var L=C(vt);k=!0;for(var O=z.length;O;){for(V=z,z=[];++Z<O;)V&&V[Z].run();Z=-1,O=z.length}V=null,k=!1,function(Y){if(b===clearTimeout)return clearTimeout(Y);if((b===W||!b)&&clearTimeout)return b=clearTimeout,clearTimeout(Y);try{b(Y)}catch{try{return b.call(null,Y)}catch{return b.call(this,Y)}}}(L)}}function Nt(L,O){this.fun=L,this.array=O}function E(){}q.nextTick=function(L){var O=new Array(arguments.length-1);if(arguments.length>1)for(var Y=1;Y<arguments.length;Y++)O[Y-1]=arguments[Y];z.push(new Nt(L,O)),z.length!==1||k||C(Ot)},Nt.prototype.run=function(){this.fun.apply(null,this.array)},q.title="browser",q.browser=!0,q.env={},q.argv=[],q.version="",q.versions={},q.on=E,q.addListener=E,q.once=E,q.off=E,q.removeListener=E,q.removeAllListeners=E,q.emit=E,q.prependListener=E,q.prependOnceListener=E,q.listeners=function(L){return[]},q.binding=function(L){throw new Error("process.binding is not supported")},q.cwd=function(){return"/"},q.chdir=function(L){throw new Error("process.chdir is not supported")},q.umask=function(){return 0}},function(T,M,v){(function(b,q){var ht;/*! https://mths.be/punycode v1.4.1 by @mathias */(function(W){M&&M.nodeType,b&&b.nodeType;var C=typeof q=="object"&&q;C.global!==C&&C.window!==C&&C.self;var V,z=2147483647,k=/^xn--/,Z=/[^\x20-\x7E]/,vt=/[\x2E\u3002\uFF0E\uFF61]/g,Ot={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Nt=Math.floor,E=String.fromCharCode;function L(Ct){throw new RangeError(Ot[Ct])}function O(Ct,ot){for(var yt=Ct.length,Pt=[];yt--;)Pt[yt]=ot(Ct[yt]);return Pt}function Y(Ct,ot){var yt=Ct.split("@"),Pt="";return yt.length>1&&(Pt=yt[0]+"@",Ct=yt[1]),Pt+O((Ct=Ct.replace(vt,".")).split("."),ot).join(".")}function P(Ct){for(var ot,yt,Pt=[],H=0,ft=Ct.length;H<ft;)(ot=Ct.charCodeAt(H++))>=55296&&ot<=56319&&H<ft?(64512&(yt=Ct.charCodeAt(H++)))==56320?Pt.push(((1023&ot)<<10)+(1023&yt)+65536):(Pt.push(ot),H--):Pt.push(ot);return Pt}function j(Ct){return O(Ct,function(ot){var yt="";return ot>65535&&(yt+=E((ot-=65536)>>>10&1023|55296),ot=56320|1023&ot),yt+=E(ot)}).join("")}function X(Ct,ot){return Ct+22+75*(Ct<26)-((ot!=0)<<5)}function K(Ct,ot,yt){var Pt=0;for(Ct=yt?Nt(Ct/700):Ct>>1,Ct+=Nt(Ct/ot);Ct>455;Pt+=36)Ct=Nt(Ct/35);return Nt(Pt+36*Ct/(Ct+38))}function qt(Ct){var ot,yt,Pt,H,ft,Et,At,Rt,Wt,$t,ye,me=[],ui=Ct.length,be=0,ei=128,Ze=72;for((yt=Ct.lastIndexOf("-"))<0&&(yt=0),Pt=0;Pt<yt;++Pt)Ct.charCodeAt(Pt)>=128&&L("not-basic"),me.push(Ct.charCodeAt(Pt));for(H=yt>0?yt+1:0;H<ui;){for(ft=be,Et=1,At=36;H>=ui&&L("invalid-input"),((Rt=(ye=Ct.charCodeAt(H++))-48<10?ye-22:ye-65<26?ye-65:ye-97<26?ye-97:36)>=36||Rt>Nt((z-be)/Et))&&L("overflow"),be+=Rt*Et,!(Rt<(Wt=At<=Ze?1:At>=Ze+26?26:At-Ze));At+=36)Et>Nt(z/($t=36-Wt))&&L("overflow"),Et*=$t;Ze=K(be-ft,ot=me.length+1,ft==0),Nt(be/ot)>z-ei&&L("overflow"),ei+=Nt(be/ot),be%=ot,me.splice(be++,0,ei)}return j(me)}function ge(Ct){var ot,yt,Pt,H,ft,Et,At,Rt,Wt,$t,ye,me,ui,be,ei,Ze=[];for(me=(Ct=P(Ct)).length,ot=128,yt=0,ft=72,Et=0;Et<me;++Et)(ye=Ct[Et])<128&&Ze.push(E(ye));for(Pt=H=Ze.length,H&&Ze.push("-");Pt<me;){for(At=z,Et=0;Et<me;++Et)(ye=Ct[Et])>=ot&&ye<At&&(At=ye);for(At-ot>Nt((z-yt)/(ui=Pt+1))&&L("overflow"),yt+=(At-ot)*ui,ot=At,Et=0;Et<me;++Et)if((ye=Ct[Et])<ot&&++yt>z&&L("overflow"),ye==ot){for(Rt=yt,Wt=36;!(Rt<($t=Wt<=ft?1:Wt>=ft+26?26:Wt-ft));Wt+=36)ei=Rt-$t,be=36-$t,Ze.push(E(X($t+ei%be,0))),Rt=Nt(ei/be);Ze.push(E(X(Rt,0))),ft=K(yt,ui,Pt==H),yt=0,++Pt}++yt,++ot}return Ze.join("")}V={version:"1.4.1",ucs2:{decode:P,encode:j},decode:qt,encode:ge,toASCII:function(Ct){return Y(Ct,function(ot){return Z.test(ot)?"xn--"+ge(ot):ot})},toUnicode:function(Ct){return Y(Ct,function(ot){return k.test(ot)?qt(ot.slice(4).toLowerCase()):ot})}},(ht=function(){return V}.call(M,v,M,b))===void 0||(b.exports=ht)})()}).call(this,v(7)(T),v(3))},function(T,M,v){T.exports={isString:function(b){return typeof b=="string"},isObject:function(b){return typeof b=="object"&&b!==null},isNull:function(b){return b===null},isNullOrUndefined:function(b){return b==null}}},function(T,M,v){M.decode=M.parse=v(60),M.encode=M.stringify=v(61)},function(T,M,v){function b(ht,W){return Object.prototype.hasOwnProperty.call(ht,W)}T.exports=function(ht,W,C,V){W=W||"&",C=C||"=";var z={};if(typeof ht!="string"||ht.length===0)return z;var k=/\+/g;ht=ht.split(W);var Z=1e3;V&&typeof V.maxKeys=="number"&&(Z=V.maxKeys);var vt=ht.length;Z>0&&vt>Z&&(vt=Z);for(var Ot=0;Ot<vt;++Ot){var Nt,E,L,O,Y=ht[Ot].replace(k,"%20"),P=Y.indexOf(C);P>=0?(Nt=Y.substr(0,P),E=Y.substr(P+1)):(Nt=Y,E=""),L=decodeURIComponent(Nt),O=decodeURIComponent(E),b(z,L)?q(z[L])?z[L].push(O):z[L]=[z[L],O]:z[L]=O}return z};var q=Array.isArray||function(ht){return Object.prototype.toString.call(ht)==="[object Array]"}},function(T,M,v){var b=function(C){switch(typeof C){case"string":return C;case"boolean":return C?"true":"false";case"number":return isFinite(C)?C:"";default:return""}};T.exports=function(C,V,z,k){return V=V||"&",z=z||"=",C===null&&(C=void 0),typeof C=="object"?ht(W(C),function(Z){var vt=encodeURIComponent(b(Z))+z;return q(C[Z])?ht(C[Z],function(Ot){return vt+encodeURIComponent(b(Ot))}).join(V):vt+encodeURIComponent(b(C[Z]))}).join(V):k?encodeURIComponent(b(k))+z+encodeURIComponent(b(C)):""};var q=Array.isArray||function(C){return Object.prototype.toString.call(C)==="[object Array]"};function ht(C,V){if(C.map)return C.map(V);for(var z=[],k=0;k<C.length;k++)z.push(V(C[k],k));return z}var W=Object.keys||function(C){var V=[];for(var z in C)Object.prototype.hasOwnProperty.call(C,z)&&V.push(z);return V}},function(T,M){var v=function(){};v.prototype={fit:function(b){var q,ht,W,C,V=b.length,z=V>0?b[0].width:0,k=V>0?b[0].height:0;for(this.root={x:0,y:0,width:z,height:k},q=0;q<V;q++)W=b[q],(ht=this.findNode(this.root,W.width,W.height))?(C=this.splitNode(ht,W.width,W.height),W.x=C.x,W.y=C.y):(C=this.growNode(W.width,W.height),W.x=C.x,W.y=C.y)},findNode:function(b,q,ht){return b.used?this.findNode(b.right,q,ht)||this.findNode(b.down,q,ht):q<=b.width&&ht<=b.height?b:null},splitNode:function(b,q,ht){return b.used=!0,b.down={x:b.x,y:b.y+ht,width:b.width,height:b.height-ht},b.right={x:b.x+q,y:b.y,width:b.width-q,height:ht},b},growNode:function(b,q){var ht=b<=this.root.width,W=q<=this.root.height,C=W&&this.root.height>=this.root.width+b,V=ht&&this.root.width>=this.root.height+q;return C?this.growRight(b,q):V?this.growDown(b,q):W?this.growRight(b,q):ht?this.growDown(b,q):null},growRight:function(b,q){var ht;return this.root={used:!0,x:0,y:0,width:this.root.width+b,height:this.root.height,down:this.root,right:{x:this.root.width,y:0,width:b,height:this.root.height}},(ht=this.findNode(this.root,b,q))?this.splitNode(ht,b,q):null},growDown:function(b,q){var ht;return this.root={used:!0,x:0,y:0,width:this.root.width,height:this.root.height+q,down:{x:0,y:this.root.height,width:this.root.width,height:q},right:this.root},(ht=this.findNode(this.root,b,q))?this.splitNode(ht,b,q):null}},T.exports=v},function(T,M){(function(v){T.exports=v}).call(this,{})},function(T,M,v){v.r(M),v.d(M,"ErrorType",function(){return ur}),v.d(M,"delay",function(){return F_}),v.d(M,"waitUntil",function(){return XI}),v.d(M,"SLIDE_EVENTS",function(){return qr}),v.d(M,"Slide",function(){return k_});var b={};v.r(b),v.d(b,"ACESFilmicToneMapping",function(){return Tt}),v.d(b,"AddEquation",function(){return Et}),v.d(b,"AddOperation",function(){return Oa}),v.d(b,"AdditiveAnimationBlendMode",function(){return It}),v.d(b,"AdditiveBlending",function(){return yt}),v.d(b,"AlphaFormat",function(){return Fi}),v.d(b,"AlwaysDepth",function(){return Ii}),v.d(b,"AlwaysStencilFunc",function(){return Bl}),v.d(b,"AmbientLight",function(){return cm}),v.d(b,"AmbientLightProbe",function(){return Dy}),v.d(b,"AnimationClip",function(){return Xd}),v.d(b,"AnimationLoader",function(){return rE}),v.d(b,"AnimationMixer",function(){return Wy}),v.d(b,"AnimationObjectGroup",function(){return Vy}),v.d(b,"AnimationUtils",function(){return sn}),v.d(b,"ArcCurve",function(){return so}),v.d(b,"ArrayCamera",function(){return Nd}),v.d(b,"ArrowHelper",function(){return FE}),v.d(b,"Audio",function(){return Yv}),v.d(b,"AudioAnalyser",function(){return zy}),v.d(b,"AudioContext",function(){return qv}),v.d(b,"AudioListener",function(){return dE}),v.d(b,"AudioLoader",function(){return Oy}),v.d(b,"AxesHelper",function(){return lx}),v.d(b,"AxisHelper",function(){return pM}),v.d(b,"BackSide",function(){return X}),v.d(b,"BasicDepthPacking",function(){return Dl}),v.d(b,"BasicShadowMap",function(){return L}),v.d(b,"BinaryTextureLoader",function(){return _M}),v.d(b,"Bone",function(){return zh}),v.d(b,"BooleanKeyframeTrack",function(){return du}),v.d(b,"BoundingBoxHelper",function(){return fM}),v.d(b,"Box2",function(){return oc}),v.d(b,"Box3",function(){return Yi}),v.d(b,"Box3Helper",function(){return NE}),v.d(b,"BoxBufferGeometry",function(){return wo}),v.d(b,"BoxGeometry",function(){return wo}),v.d(b,"BoxHelper",function(){return sx}),v.d(b,"BufferAttribute",function(){return mi}),v.d(b,"BufferGeometry",function(){return ze}),v.d(b,"BufferGeometryLoader",function(){return Ry}),v.d(b,"ByteType",function(){return zp}),v.d(b,"Cache",function(){return fu}),v.d(b,"Camera",function(){return la}),v.d(b,"CameraHelper",function(){return OE}),v.d(b,"CanvasRenderer",function(){return xM}),v.d(b,"CanvasTexture",function(){return Ve}),v.d(b,"CatmullRomCurve3",function(){return qh}),v.d(b,"CineonToneMapping",function(){return at}),v.d(b,"CircleBufferGeometry",function(){return pe}),v.d(b,"CircleGeometry",function(){return pe}),v.d(b,"ClampToEdgeWrapping",function(){return qe}),v.d(b,"Clock",function(){return ky}),v.d(b,"Color",function(){return Le}),v.d(b,"ColorKeyframeTrack",function(){return Nv}),v.d(b,"CompressedTexture",function(){return Fe}),v.d(b,"CompressedTextureLoader",function(){return oE}),v.d(b,"ConeBufferGeometry",function(){return Ce}),v.d(b,"ConeGeometry",function(){return Ce}),v.d(b,"CubeCamera",function(){return ua}),v.d(b,"CubeReflectionMapping",function(){return zt}),v.d(b,"CubeRefractionMapping",function(){return ne}),v.d(b,"CubeTexture",function(){return ro}),v.d(b,"CubeTextureLoader",function(){return vy}),v.d(b,"CubeUVReflectionMapping",function(){return xe}),v.d(b,"CubeUVRefractionMapping",function(){return Ie}),v.d(b,"CubicBezierCurve",function(){return ya}),v.d(b,"CubicBezierCurve3",function(){return al}),v.d(b,"CubicInterpolant",function(){return py}),v.d(b,"CullFaceBack",function(){return Ot}),v.d(b,"CullFaceFront",function(){return Nt}),v.d(b,"CullFaceFrontBack",function(){return E}),v.d(b,"CullFaceNone",function(){return vt}),v.d(b,"Curve",function(){return cn}),v.d(b,"CurvePath",function(){return yy}),v.d(b,"CustomBlending",function(){return ft}),v.d(b,"CustomToneMapping",function(){return bt}),v.d(b,"CylinderBufferGeometry",function(){return He}),v.d(b,"CylinderGeometry",function(){return He}),v.d(b,"Cylindrical",function(){return ME}),v.d(b,"DataTexture",function(){return ws}),v.d(b,"DataTexture2DArray",function(){return Rh}),v.d(b,"DataTexture3D",function(){return Vr}),v.d(b,"DataTextureLoader",function(){return _y}),v.d(b,"DataUtils",function(){return kE}),v.d(b,"DecrementStencilOp",function(){return rh}),v.d(b,"DecrementWrapStencilOp",function(){return Bg}),v.d(b,"DefaultLoadingManager",function(){return gy}),v.d(b,"DepthFormat",function(){return tn}),v.d(b,"DepthStencilFormat",function(){return Xs}),v.d(b,"DepthTexture",function(){return re}),v.d(b,"DirectionalLight",function(){return hm}),v.d(b,"DirectionalLightHelper",function(){return LE}),v.d(b,"DiscreteInterpolant",function(){return fy}),v.d(b,"DodecahedronBufferGeometry",function(){return Ye}),v.d(b,"DodecahedronGeometry",function(){return Ye}),v.d(b,"DoubleSide",function(){return K}),v.d(b,"DstAlphaFactor",function(){return ri}),v.d(b,"DstColorFactor",function(){return Bi}),v.d(b,"DynamicBufferAttribute",function(){return nM}),v.d(b,"DynamicCopyUsage",function(){return uh}),v.d(b,"DynamicDrawUsage",function(){return mo}),v.d(b,"DynamicReadUsage",function(){return Ug}),v.d(b,"EdgesGeometry",function(){return Vn}),v.d(b,"EdgesHelper",function(){return mM}),v.d(b,"EllipseCurve",function(){return on}),v.d(b,"EqualDepth",function(){return Qi}),v.d(b,"EqualStencilFunc",function(){return sh}),v.d(b,"EquirectangularReflectionMapping",function(){return se}),v.d(b,"EquirectangularRefractionMapping",function(){return ae}),v.d(b,"Euler",function(){return ea}),v.d(b,"EventDispatcher",function(){return ko}),v.d(b,"ExtrudeBufferGeometry",function(){return $o}),v.d(b,"ExtrudeGeometry",function(){return $o}),v.d(b,"FaceColors",function(){return XE}),v.d(b,"FileLoader",function(){return Ko}),v.d(b,"FlatShading",function(){return qt}),v.d(b,"Float16BufferAttribute",function(){return ff}),v.d(b,"Float32Attribute",function(){return cM}),v.d(b,"Float32BufferAttribute",function(){return _e}),v.d(b,"Float64Attribute",function(){return dM}),v.d(b,"Float64BufferAttribute",function(){return pd}),v.d(b,"FloatType",function(){return Oo}),v.d(b,"Fog",function(){return eu}),v.d(b,"FogExp2",function(){return Fn}),v.d(b,"Font",function(){return Xv}),v.d(b,"FontLoader",function(){return uE}),v.d(b,"FrontSide",function(){return j}),v.d(b,"Frustum",function(){return Ka}),v.d(b,"GLBufferAttribute",function(){return qy}),v.d(b,"GLSL1",function(){return Qc}),v.d(b,"GLSL3",function(){return td}),v.d(b,"GammaEncoding",function(){return an}),v.d(b,"GreaterDepth",function(){return $n}),v.d(b,"GreaterEqualDepth",function(){return Yn}),v.d(b,"GreaterEqualStencilFunc",function(){return af}),v.d(b,"GreaterStencilFunc",function(){return ah}),v.d(b,"GridHelper",function(){return nx}),v.d(b,"Group",function(){return pa}),v.d(b,"HalfFloatType",function(){return Ws}),v.d(b,"HemisphereLight",function(){return Bv}),v.d(b,"HemisphereLightHelper",function(){return PE}),v.d(b,"HemisphereLightProbe",function(){return Ny}),v.d(b,"IcosahedronBufferGeometry",function(){return $h}),v.d(b,"IcosahedronGeometry",function(){return $h}),v.d(b,"ImageBitmapLoader",function(){return Iy}),v.d(b,"ImageLoader",function(){return qd}),v.d(b,"ImageUtils",function(){return kr}),v.d(b,"ImmediateRenderObject",function(){return Ky}),v.d(b,"IncrementStencilOp",function(){return rf}),v.d(b,"IncrementWrapStencilOp",function(){return Fg}),v.d(b,"InstancedBufferAttribute",function(){return Wv}),v.d(b,"InstancedBufferGeometry",function(){return Vv}),v.d(b,"InstancedInterleavedBuffer",function(){return Xy}),v.d(b,"InstancedMesh",function(){return Bd}),v.d(b,"Int16Attribute",function(){return aM}),v.d(b,"Int16BufferAttribute",function(){return dd}),v.d(b,"Int32Attribute",function(){return uM}),v.d(b,"Int32BufferAttribute",function(){return Th}),v.d(b,"Int8Attribute",function(){return rM}),v.d(b,"Int8BufferAttribute",function(){return Wl}),v.d(b,"IntType",function(){return Vp}),v.d(b,"InterleavedBuffer",function(){return fa}),v.d(b,"InterleavedBufferAttribute",function(){return Yo}),v.d(b,"Interpolant",function(){return ba}),v.d(b,"InterpolateDiscrete",function(){return us}),v.d(b,"InterpolateLinear",function(){return Ll}),v.d(b,"InterpolateSmooth",function(){return Bo}),v.d(b,"InvertStencilOp",function(){return kg}),v.d(b,"JSONLoader",function(){return bM}),v.d(b,"KeepStencilOp",function(){return Ei}),v.d(b,"KeyframeTrack",function(){return Jo}),v.d(b,"LOD",function(){return $f}),v.d(b,"LatheBufferGeometry",function(){return Jh}),v.d(b,"LatheGeometry",function(){return Jh}),v.d(b,"Layers",function(){return rd}),v.d(b,"LensFlare",function(){return SM}),v.d(b,"LessDepth",function(){return Ui}),v.d(b,"LessEqualDepth",function(){return On}),v.d(b,"LessEqualStencilFunc",function(){return of}),v.d(b,"LessStencilFunc",function(){return cs}),v.d(b,"Light",function(){return Qo}),v.d(b,"LightProbe",function(){return $d}),v.d(b,"Line",function(){return c}),v.d(b,"Line3",function(){return Zy}),v.d(b,"LineBasicMaterial",function(){return Bn}),v.d(b,"LineCurve",function(){return ll}),v.d(b,"LineCurve3",function(){return lu}),v.d(b,"LineDashedMaterial",function(){return Lv}),v.d(b,"LineLoop",function(){return D}),v.d(b,"LinePieces",function(){return VE}),v.d(b,"LineSegments",function(){return R}),v.d(b,"LineStrip",function(){return jE}),v.d(b,"LinearEncoding",function(){return Be}),v.d(b,"LinearFilter",function(){return qi}),v.d(b,"LinearInterpolant",function(){return Ov}),v.d(b,"LinearMipMapLinearFilter",function(){return Hp}),v.d(b,"LinearMipMapNearestFilter",function(){return Gp}),v.d(b,"LinearMipmapLinearFilter",function(){return js}),v.d(b,"LinearMipmapNearestFilter",function(){return as}),v.d(b,"LinearToneMapping",function(){return J}),v.d(b,"Loader",function(){return gr}),v.d(b,"LoaderUtils",function(){return dm}),v.d(b,"LoadingManager",function(){return Dv}),v.d(b,"LogLuvEncoding",function(){return ki}),v.d(b,"LoopOnce",function(){return ih}),v.d(b,"LoopPingPong",function(){return Fo}),v.d(b,"LoopRepeat",function(){return Jc}),v.d(b,"LuminanceAlphaFormat",function(){return Fc}),v.d(b,"LuminanceFormat",function(){return Yp}),v.d(b,"MOUSE",function(){return k}),v.d(b,"Material",function(){return Dn}),v.d(b,"MaterialLoader",function(){return Ay}),v.d(b,"Math",function(){return Ks}),v.d(b,"MathUtils",function(){return Ks}),v.d(b,"Matrix3",function(){return zi}),v.d(b,"Matrix4",function(){return Ee}),v.d(b,"MaxEquation",function(){return $t}),v.d(b,"Mesh",function(){return Ti}),v.d(b,"MeshBasicMaterial",function(){return pn}),v.d(b,"MeshDepthMaterial",function(){return xi}),v.d(b,"MeshDistanceMaterial",function(){return Dh}),v.d(b,"MeshFaceMaterial",function(){return YE}),v.d(b,"MeshLambertMaterial",function(){return um}),v.d(b,"MeshMatcapMaterial",function(){return Iv}),v.d(b,"MeshNormalMaterial",function(){return Pv}),v.d(b,"MeshPhongMaterial",function(){return lm}),v.d(b,"MeshPhysicalMaterial",function(){return Rv}),v.d(b,"MeshStandardMaterial",function(){return am}),v.d(b,"MeshToonMaterial",function(){return Cv}),v.d(b,"MinEquation",function(){return Wt}),v.d(b,"MirroredRepeatWrapping",function(){return pi}),v.d(b,"MixOperation",function(){return zu}),v.d(b,"MultiMaterial",function(){return $E}),v.d(b,"MultiplyBlending",function(){return H}),v.d(b,"MultiplyOperation",function(){return Hs}),v.d(b,"NearestFilter",function(){return fi}),v.d(b,"NearestMipMapLinearFilter",function(){return Cl}),v.d(b,"NearestMipMapNearestFilter",function(){return Lo}),v.d(b,"NearestMipmapLinearFilter",function(){return zs}),v.d(b,"NearestMipmapNearestFilter",function(){return Sr}),v.d(b,"NeverDepth",function(){return Ki}),v.d(b,"NeverStencilFunc",function(){return oh}),v.d(b,"NoBlending",function(){return Ct}),v.d(b,"NoColors",function(){return WE}),v.d(b,"NoToneMapping",function(){return Zr}),v.d(b,"NormalAnimationBlendMode",function(){return $s}),v.d(b,"NormalBlending",function(){return ot}),v.d(b,"NotEqualDepth",function(){return La}),v.d(b,"NotEqualStencilFunc",function(){return sf}),v.d(b,"NumberKeyframeTrack",function(){return Vd}),v.d(b,"Object3D",function(){return hi}),v.d(b,"ObjectLoader",function(){return sE}),v.d(b,"ObjectSpaceNormalMap",function(){return Fl}),v.d(b,"OctahedronBufferGeometry",function(){return uu}),v.d(b,"OctahedronGeometry",function(){return uu}),v.d(b,"OneFactor",function(){return me}),v.d(b,"OneMinusDstAlphaFactor",function(){return De}),v.d(b,"OneMinusDstColorFactor",function(){return Di}),v.d(b,"OneMinusSrcAlphaFactor",function(){return Ze}),v.d(b,"OneMinusSrcColorFactor",function(){return be}),v.d(b,"OrthographicCamera",function(){return rc}),v.d(b,"PCFShadowMap",function(){return O}),v.d(b,"PCFSoftShadowMap",function(){return Y}),v.d(b,"PMREMGenerator",function(){return GE}),v.d(b,"ParametricBufferGeometry",function(){return jd}),v.d(b,"ParametricGeometry",function(){return jd}),v.d(b,"Particle",function(){return ZE}),v.d(b,"ParticleBasicMaterial",function(){return tM}),v.d(b,"ParticleSystem",function(){return KE}),v.d(b,"ParticleSystemMaterial",function(){return eM}),v.d(b,"Path",function(){return mu}),v.d(b,"PerspectiveCamera",function(){return fn}),v.d(b,"Plane",function(){return jr}),v.d(b,"PlaneBufferGeometry",function(){return Kn}),v.d(b,"PlaneGeometry",function(){return Kn}),v.d(b,"PlaneHelper",function(){return DE}),v.d(b,"PointCloud",function(){return JE}),v.d(b,"PointCloudMaterial",function(){return QE}),v.d(b,"PointLight",function(){return Hv}),v.d(b,"PointLightHelper",function(){return RE}),v.d(b,"Points",function(){return Zt}),v.d(b,"PointsMaterial",function(){return $}),v.d(b,"PolarGridHelper",function(){return IE}),v.d(b,"PolyhedronBufferGeometry",function(){return Ue}),v.d(b,"PolyhedronGeometry",function(){return Ue}),v.d(b,"PositionalAudio",function(){return fE}),v.d(b,"PropertyBinding",function(){return Ri}),v.d(b,"PropertyMixer",function(){return jy}),v.d(b,"QuadraticBezierCurve",function(){return xa}),v.d(b,"QuadraticBezierCurve3",function(){return wv}),v.d(b,"Quaternion",function(){return Nn}),v.d(b,"QuaternionKeyframeTrack",function(){return nc}),v.d(b,"QuaternionLinearInterpolant",function(){return my}),v.d(b,"REVISION",function(){return z}),v.d(b,"RGBADepthPacking",function(){return Kc}),v.d(b,"RGBAFormat",function(){return Tr}),v.d(b,"RGBAIntegerFormat",function(){return Uc}),v.d(b,"RGBA_ASTC_10x10_Format",function(){return Vc}),v.d(b,"RGBA_ASTC_10x5_Format",function(){return Il}),v.d(b,"RGBA_ASTC_10x6_Format",function(){return qs}),v.d(b,"RGBA_ASTC_10x8_Format",function(){return Kp}),v.d(b,"RGBA_ASTC_12x10_Format",function(){return Wc}),v.d(b,"RGBA_ASTC_12x12_Format",function(){return Zu}),v.d(b,"RGBA_ASTC_4x4_Format",function(){return Yu}),v.d(b,"RGBA_ASTC_5x4_Format",function(){return Gi}),v.d(b,"RGBA_ASTC_5x5_Format",function(){return Do}),v.d(b,"RGBA_ASTC_6x5_Format",function(){return $u}),v.d(b,"RGBA_ASTC_6x6_Format",function(){return Jp}),v.d(b,"RGBA_ASTC_8x5_Format",function(){return Ju}),v.d(b,"RGBA_ASTC_8x6_Format",function(){return Zp}),v.d(b,"RGBA_ASTC_8x8_Format",function(){return jc}),v.d(b,"RGBA_BPTC_Format",function(){return Ku}),v.d(b,"RGBA_ETC2_EAC_Format",function(){return Da}),v.d(b,"RGBA_PVRTC_2BPPV1_Format",function(){return Hc}),v.d(b,"RGBA_PVRTC_4BPPV1_Format",function(){return hr}),v.d(b,"RGBA_S3TC_DXT1_Format",function(){return Wu}),v.d(b,"RGBA_S3TC_DXT3_Format",function(){return Xu}),v.d(b,"RGBA_S3TC_DXT5_Format",function(){return qu}),v.d(b,"RGBDEncoding",function(){return dr}),v.d(b,"RGBEEncoding",function(){return Mr}),v.d(b,"RGBEFormat",function(){return $p}),v.d(b,"RGBFormat",function(){return No}),v.d(b,"RGBIntegerFormat",function(){return kc}),v.d(b,"RGBM16Encoding",function(){return Zc}),v.d(b,"RGBM7Encoding",function(){return Nl}),v.d(b,"RGB_ETC1_Format",function(){return zc}),v.d(b,"RGB_ETC2_Format",function(){return fo}),v.d(b,"RGB_PVRTC_2BPPV1_Format",function(){return Gc}),v.d(b,"RGB_PVRTC_4BPPV1_Format",function(){return ir}),v.d(b,"RGB_S3TC_DXT1_Format",function(){return Vu}),v.d(b,"RGFormat",function(){return ju}),v.d(b,"RGIntegerFormat",function(){return Er}),v.d(b,"RawShaderMaterial",function(){return ic}),v.d(b,"Ray",function(){return jo}),v.d(b,"Raycaster",function(){return TE}),v.d(b,"RectAreaLight",function(){return zv}),v.d(b,"RedFormat",function(){return Na}),v.d(b,"RedIntegerFormat",function(){return Bc}),v.d(b,"ReinhardToneMapping",function(){return st}),v.d(b,"RepeatWrapping",function(){return Ge}),v.d(b,"ReplaceStencilOp",function(){return Dg}),v.d(b,"ReverseSubtractEquation",function(){return Rt}),v.d(b,"RingBufferGeometry",function(){return Zh}),v.d(b,"RingGeometry",function(){return Zh}),v.d(b,"SRGB8_ALPHA8_ASTC_10x10_Format",function(){return ef}),v.d(b,"SRGB8_ALPHA8_ASTC_10x5_Format",function(){return $c}),v.d(b,"SRGB8_ALPHA8_ASTC_10x6_Format",function(){return Qp}),v.d(b,"SRGB8_ALPHA8_ASTC_10x8_Format",function(){return tf}),v.d(b,"SRGB8_ALPHA8_ASTC_12x10_Format",function(){return nf}),v.d(b,"SRGB8_ALPHA8_ASTC_12x12_Format",function(){return Ys}),v.d(b,"SRGB8_ALPHA8_ASTC_4x4_Format",function(){return Xc}),v.d(b,"SRGB8_ALPHA8_ASTC_5x4_Format",function(){return Qu}),v.d(b,"SRGB8_ALPHA8_ASTC_5x5_Format",function(){return th}),v.d(b,"SRGB8_ALPHA8_ASTC_6x5_Format",function(){return qc}),v.d(b,"SRGB8_ALPHA8_ASTC_6x6_Format",function(){return cr}),v.d(b,"SRGB8_ALPHA8_ASTC_8x5_Format",function(){return eh}),v.d(b,"SRGB8_ALPHA8_ASTC_8x6_Format",function(){return Fa}),v.d(b,"SRGB8_ALPHA8_ASTC_8x8_Format",function(){return Yc}),v.d(b,"Scene",function(){return el}),v.d(b,"SceneUtils",function(){return wM}),v.d(b,"ShaderChunk",function(){return $e}),v.d(b,"ShaderLib",function(){return Pr}),v.d(b,"ShaderMaterial",function(){return rr}),v.d(b,"ShadowMaterial",function(){return Av}),v.d(b,"Shape",function(){return hl}),v.d(b,"ShapeBufferGeometry",function(){return hu}),v.d(b,"ShapeGeometry",function(){return hu}),v.d(b,"ShapePath",function(){return Ly}),v.d(b,"ShapeUtils",function(){return Ms}),v.d(b,"ShortType",function(){return jp}),v.d(b,"Skeleton",function(){return jh}),v.d(b,"SkeletonHelper",function(){return tx}),v.d(b,"SkinnedMesh",function(){return rl}),v.d(b,"SmoothShading",function(){return ge}),v.d(b,"Sphere",function(){return En}),v.d(b,"SphereBufferGeometry",function(){return cu}),v.d(b,"SphereGeometry",function(){return cu}),v.d(b,"Spherical",function(){return EE}),v.d(b,"SphericalHarmonics3",function(){return jv}),v.d(b,"SplineCurve",function(){return im}),v.d(b,"SpotLight",function(){return Uv}),v.d(b,"SpotLightHelper",function(){return AE}),v.d(b,"Sprite",function(){return su}),v.d(b,"SpriteMaterial",function(){return iu}),v.d(b,"SrcAlphaFactor",function(){return ei}),v.d(b,"SrcAlphaSaturateFactor",function(){return Ci}),v.d(b,"SrcColorFactor",function(){return ui}),v.d(b,"StaticCopyUsage",function(){return Hg}),v.d(b,"StaticDrawUsage",function(){return Js}),v.d(b,"StaticReadUsage",function(){return lh}),v.d(b,"StereoCamera",function(){return hE}),v.d(b,"StreamCopyUsage",function(){return hh}),v.d(b,"StreamDrawUsage",function(){return Zs}),v.d(b,"StreamReadUsage",function(){return Gg}),v.d(b,"StringKeyframeTrack",function(){return pu}),v.d(b,"SubtractEquation",function(){return At}),v.d(b,"SubtractiveBlending",function(){return Pt}),v.d(b,"TOUCH",function(){return Z}),v.d(b,"TangentSpaceNormalMap",function(){return Br}),v.d(b,"TetrahedronBufferGeometry",function(){return Kh}),v.d(b,"TetrahedronGeometry",function(){return Kh}),v.d(b,"TextBufferGeometry",function(){return sm}),v.d(b,"TextGeometry",function(){return sm}),v.d(b,"Texture",function(){return dn}),v.d(b,"TextureLoader",function(){return Fv}),v.d(b,"TorusBufferGeometry",function(){return Qh}),v.d(b,"TorusGeometry",function(){return Qh}),v.d(b,"TorusKnotBufferGeometry",function(){return tc}),v.d(b,"TorusKnotGeometry",function(){return tc}),v.d(b,"Triangle",function(){return ji}),v.d(b,"TriangleFanDrawMode",function(){return Se}),v.d(b,"TriangleStripDrawMode",function(){return ie}),v.d(b,"TrianglesDrawMode",function(){return Qt}),v.d(b,"TubeBufferGeometry",function(){return ec}),v.d(b,"TubeGeometry",function(){return ec}),v.d(b,"UVMapping",function(){return wt}),v.d(b,"Uint16Attribute",function(){return lM}),v.d(b,"Uint16BufferAttribute",function(){return Wa}),v.d(b,"Uint32Attribute",function(){return hM}),v.d(b,"Uint32BufferAttribute",function(){return no}),v.d(b,"Uint8Attribute",function(){return oM}),v.d(b,"Uint8BufferAttribute",function(){return cd}),v.d(b,"Uint8ClampedAttribute",function(){return sM}),v.d(b,"Uint8ClampedBufferAttribute",function(){return Sh}),v.d(b,"Uniform",function(){return fm}),v.d(b,"UniformsLib",function(){return Te}),v.d(b,"UniformsUtils",function(){return So}),v.d(b,"UnsignedByteType",function(){return ls}),v.d(b,"UnsignedInt248Type",function(){return Pi}),v.d(b,"UnsignedIntType",function(){return Vs}),v.d(b,"UnsignedShort4444Type",function(){return Wp}),v.d(b,"UnsignedShort5551Type",function(){return Xp}),v.d(b,"UnsignedShort565Type",function(){return qp}),v.d(b,"UnsignedShortType",function(){return Pl}),v.d(b,"VSMShadowMap",function(){return P}),v.d(b,"Vector2",function(){return ce}),v.d(b,"Vector3",function(){return S}),v.d(b,"Vector4",function(){return Li}),v.d(b,"VectorKeyframeTrack",function(){return Wd}),v.d(b,"Vertex",function(){return iM}),v.d(b,"VertexColors",function(){return qE}),v.d(b,"VideoTexture",function(){return Oe}),v.d(b,"WebGL1Renderer",function(){return Rn}),v.d(b,"WebGLCubeRenderTarget",function(){return je}),v.d(b,"WebGLMultipleRenderTargets",function(){return Gl}),v.d(b,"WebGLMultisampleRenderTarget",function(){return Qs}),v.d(b,"WebGLRenderTarget",function(){return Kr}),v.d(b,"WebGLRenderTargetCube",function(){return yM}),v.d(b,"WebGLRenderer",function(){return Oi}),v.d(b,"WebGLUtils",function(){return Wf}),v.d(b,"WireframeGeometry",function(){return Mv}),v.d(b,"WireframeHelper",function(){return gM}),v.d(b,"WrapAroundEnding",function(){return Ol}),v.d(b,"XHRLoader",function(){return vM}),v.d(b,"ZeroCurvatureEnding",function(){return Gn}),v.d(b,"ZeroFactor",function(){return ye}),v.d(b,"ZeroSlopeEnding",function(){return hs}),v.d(b,"ZeroStencilOp",function(){return nh}),v.d(b,"sRGBEncoding",function(){return gi});var q={};v.r(q),v.d(q,"isMobile",function(){return ts}),v.d(q,"EventEmitter",function(){return lc.a}),v.d(q,"earcut",function(){return p0.a}),v.d(q,"BaseTextureCache",function(){return Ao}),v.d(q,"CanvasRenderTarget",function(){return E0}),v.d(q,"DATA_URI",function(){return Kx}),v.d(q,"ProgramCache",function(){return T0}),v.d(q,"TextureCache",function(){return Xr}),v.d(q,"clearTextureCache",function(){return e2}),v.d(q,"correctBlendMode",function(){return x0}),v.d(q,"createIndicesForQuads",function(){return $x}),v.d(q,"decomposeDataUri",function(){return i2}),v.d(q,"deprecation",function(){return uc}),v.d(q,"destroyTextureCache",function(){return t2}),v.d(q,"determineCrossOrigin",function(){return Qx}),v.d(q,"getBufferType",function(){return Rm}),v.d(q,"getResolutionOfUrl",function(){return ep}),v.d(q,"hex2rgb",function(){return Tu}),v.d(q,"hex2string",function(){return v0}),v.d(q,"interleaveTypedArrays",function(){return KA}),v.d(q,"isPow2",function(){return w0}),v.d(q,"isWebGLSupported",function(){return qx}),v.d(q,"log2",function(){return S0}),v.d(q,"nextPow2",function(){return tp}),v.d(q,"premultiplyBlendMode",function(){return y0}),v.d(q,"premultiplyRgba",function(){return Yx}),v.d(q,"premultiplyTint",function(){return Am}),v.d(q,"premultiplyTintToRgba",function(){return b0}),v.d(q,"removeItems",function(){return Eu}),v.d(q,"rgb2hex",function(){return JA}),v.d(q,"sayHello",function(){return Xx}),v.d(q,"sign",function(){return Mu}),v.d(q,"skipHello",function(){return YA}),v.d(q,"string2hex",function(){return _0}),v.d(q,"trimCanvas",function(){return Zx}),v.d(q,"uid",function(){return fl}),v.d(q,"url",function(){return Su});var ht=v(4),W=v(1),C=v.n(W),V=v(0);/**
|
|
1827
|
+
`},function(T,M,v){var b;(function(q,ht){var W="model",P="name",V="type",z="vendor",k="version",Z="mobile",vt="tablet",Ot="smarttv",Nt=function(Ct){for(var ot={},yt=0;yt<Ct.length;yt++)ot[Ct[yt].toUpperCase()]=Ct[yt];return ot},E=function(Ct,ot){return typeof Ct=="string"&&L(ot).indexOf(L(Ct))!==-1},L=function(Ct){return Ct.toLowerCase()},O=function(Ct,ot){if(typeof Ct=="string")return Ct=Ct.replace(/^\s\s*/,"").replace(/\s\s*$/,""),ot===void 0?Ct:Ct.substring(0,255)},Y=function(Ct,ot){for(var yt,Pt,H,ft,Et,At,Rt=0;Rt<ot.length&&!Et;){var Wt=ot[Rt],$t=ot[Rt+1];for(yt=Pt=0;yt<Wt.length&&!Et;)if(Et=Wt[yt++].exec(Ct))for(H=0;H<$t.length;H++)At=Et[++Pt],typeof(ft=$t[H])=="object"&&ft.length>0?ft.length===2?typeof ft[1]=="function"?this[ft[0]]=ft[1].call(this,At):this[ft[0]]=ft[1]:ft.length===3?typeof ft[1]!="function"||ft[1].exec&&ft[1].test?this[ft[0]]=At?At.replace(ft[1],ft[2]):void 0:this[ft[0]]=At?ft[1].call(this,At,ft[2]):void 0:ft.length===4&&(this[ft[0]]=At?ft[3].call(this,At.replace(ft[1],ft[2])):void 0):this[ft]=At||void 0;Rt+=2}},C=function(Ct,ot){for(var yt in ot)if(typeof ot[yt]=="object"&&ot[yt].length>0){for(var Pt=0;Pt<ot[yt].length;Pt++)if(E(ot[yt][Pt],Ct))return yt==="?"?void 0:yt}else if(E(ot[yt],Ct))return yt==="?"?void 0:yt;return Ct},j={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"},X={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[k,[P,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[k,[P,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[P,k],[/opios[\/ ]+([\w\.]+)/i],[k,[P,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[k,[P,"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],[P,k],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[k,[P,"UCBrowser"]],[/\bqbcore\/([\w\.]+)/i],[k,[P,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[k,[P,"WeChat"]],[/konqueror\/([\w\.]+)/i],[k,[P,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[k,[P,"IE"]],[/yabrowser\/([\w\.]+)/i],[k,[P,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[P,/(.+)/,"$1 Secure Browser"],k],[/\bfocus\/([\w\.]+)/i],[k,[P,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[k,[P,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[k,[P,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[k,[P,"Dolphin"]],[/coast\/([\w\.]+)/i],[k,[P,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[k,[P,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[k,[P,"Firefox"]],[/\bqihu|(qi?ho?o?|360)browser/i],[[P,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[P,/(.+)/,"$1 Browser"],k],[/(comodo_dragon)\/([\w\.]+)/i],[[P,/_/g," "],k],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[P,k],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[P],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[P,"Facebook"],k],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[P,k],[/\bgsa\/([\w\.]+) .*safari\//i],[k,[P,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[k,[P,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[P,"Chrome WebView"],k],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[k,[P,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[P,k],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[k,[P,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[k,P],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[P,[k,C,{"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],[P,k],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[P,"Netscape"],k],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[k,[P,"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],[P,k]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[["architecture","amd64"]],[/(ia32(?=;))/i],[["architecture",L]],[/((?: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/,"",L]],[/(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",L]]],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],[W,[z,"Samsung"],[V,vt]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[W,[z,"Samsung"],[V,Z]],[/\((ip(?:hone|od)[\w ]*);/i],[W,[z,"Apple"],[V,Z]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[W,[z,"Apple"],[V,vt]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[W,[z,"Huawei"],[V,vt]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[W,[z,"Huawei"],[V,Z]],[/\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],[[W,/_/g," "],[z,"Xiaomi"],[V,Z]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[W,/_/g," "],[z,"Xiaomi"],[V,vt]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[W,[z,"OPPO"],[V,Z]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[W,[z,"Vivo"],[V,Z]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[W,[z,"Realme"],[V,Z]],[/\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],[W,[z,"Motorola"],[V,Z]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[W,[z,"Motorola"],[V,vt]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[W,[z,"LG"],[V,vt]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[W,[z,"LG"],[V,Z]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[W,[z,"Lenovo"],[V,vt]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[W,/_/g," "],[z,"Nokia"],[V,Z]],[/(pixel c)\b/i],[W,[z,"Google"],[V,vt]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[W,[z,"Google"],[V,Z]],[/droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[W,[z,"Sony"],[V,Z]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[W,"Xperia Tablet"],[z,"Sony"],[V,vt]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[W,[z,"OnePlus"],[V,Z]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[W,[z,"Amazon"],[V,vt]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[W,/(.+)/g,"Fire Phone $1"],[z,"Amazon"],[V,Z]],[/(playbook);[-\w\),; ]+(rim)/i],[W,z,[V,vt]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[W,[z,"BlackBerry"],[V,Z]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[W,[z,"ASUS"],[V,vt]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[W,[z,"ASUS"],[V,Z]],[/(nexus 9)/i],[W,[z,"HTC"],[V,vt]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[z,[W,/_/g," "],[V,Z]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[W,[z,"Acer"],[V,vt]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[W,[z,"Meizu"],[V,Z]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[W,[z,"Sharp"],[V,Z]],[/(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],[z,W,[V,Z]],[/(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],[z,W,[V,vt]],[/(surface duo)/i],[W,[z,"Microsoft"],[V,vt]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[W,[z,"Fairphone"],[V,Z]],[/(u304aa)/i],[W,[z,"AT&T"],[V,Z]],[/\bsie-(\w*)/i],[W,[z,"Siemens"],[V,Z]],[/\b(rct\w+) b/i],[W,[z,"RCA"],[V,vt]],[/\b(venue[\d ]{2,7}) b/i],[W,[z,"Dell"],[V,vt]],[/\b(q(?:mv|ta)\w+) b/i],[W,[z,"Verizon"],[V,vt]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[W,[z,"Barnes & Noble"],[V,vt]],[/\b(tm\d{3}\w+) b/i],[W,[z,"NuVision"],[V,vt]],[/\b(k88) b/i],[W,[z,"ZTE"],[V,vt]],[/\b(nx\d{3}j) b/i],[W,[z,"ZTE"],[V,Z]],[/\b(gen\d{3}) b.+49h/i],[W,[z,"Swiss"],[V,Z]],[/\b(zur\d{3}) b/i],[W,[z,"Swiss"],[V,vt]],[/\b((zeki)?tb.*\b) b/i],[W,[z,"Zeki"],[V,vt]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[z,"Dragon Touch"],W,[V,vt]],[/\b(ns-?\w{0,9}) b/i],[W,[z,"Insignia"],[V,vt]],[/\b((nxa|next)-?\w{0,9}) b/i],[W,[z,"NextBook"],[V,vt]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[z,"Voice"],W,[V,Z]],[/\b(lvtel\-)?(v1[12]) b/i],[[z,"LvTel"],W,[V,Z]],[/\b(ph-1) /i],[W,[z,"Essential"],[V,Z]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[W,[z,"Envizen"],[V,vt]],[/\b(trio[-\w\. ]+) b/i],[W,[z,"MachSpeed"],[V,vt]],[/\btu_(1491) b/i],[W,[z,"Rotor"],[V,vt]],[/(shield[\w ]+) b/i],[W,[z,"Nvidia"],[V,vt]],[/(sprint) (\w+)/i],[z,W,[V,Z]],[/(kin\.[onetw]{3})/i],[[W,/\./g," "],[z,"Microsoft"],[V,Z]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[W,[z,"Zebra"],[V,vt]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[W,[z,"Zebra"],[V,Z]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[z,W,[V,"console"]],[/droid.+; (shield) bui/i],[W,[z,"Nvidia"],[V,"console"]],[/(playstation [345portablevi]+)/i],[W,[z,"Sony"],[V,"console"]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[W,[z,"Microsoft"],[V,"console"]],[/smart-tv.+(samsung)/i],[z,[V,Ot]],[/hbbtv.+maple;(\d+)/i],[[W,/^/,"SmartTV"],[z,"Samsung"],[V,Ot]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[z,"LG"],[V,Ot]],[/(apple) ?tv/i],[z,[W,"Apple TV"],[V,Ot]],[/crkey/i],[[W,"Chromecast"],[z,"Google"],[V,Ot]],[/droid.+aft(\w)( bui|\))/i],[W,[z,"Amazon"],[V,Ot]],[/\(dtv[\);].+(aquos)/i],[W,[z,"Sharp"],[V,Ot]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[z,O],[W,O],[V,Ot]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[V,Ot]],[/((pebble))app/i],[z,W,[V,"wearable"]],[/droid.+; (glass) \d/i],[W,[z,"Google"],[V,"wearable"]],[/droid.+; (wt63?0{2,3})\)/i],[W,[z,"Zebra"],[V,"wearable"]],[/(quest( 2)?)/i],[W,[z,"Facebook"],[V,"wearable"]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[z,[V,"embedded"]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[W,[V,Z]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[W,[V,vt]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[V,vt]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[V,Z]],[/(android[-\w\. ]{0,9});.+buil/i],[W,[z,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[k,[P,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[k,[P,"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],[P,k],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[k,P]],os:[[/microsoft (windows) (vista|xp)/i],[P,k],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[P,[k,C,j]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[P,"Windows"],[k,C,j]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[k,/_/g,"."],[P,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[P,"Mac OS"],[k,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[k,P],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[P,k],[/\(bb(10);/i],[k,[P,"BlackBerry"]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[k,[P,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[k,[P,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[k,[P,"webOS"]],[/crkey\/([\d\.]+)/i],[k,[P,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[P,"Chromium OS"],k],[/(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],[P,k],[/(sunos) ?([\w\.\d]*)/i],[[P,"Solaris"],k],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[P,k]]},K=function(Ct,ot){if(typeof Ct=="object"&&(ot=Ct,Ct=void 0),!(this instanceof K))return new K(Ct,ot).getResult();var yt=Ct||(q!==void 0&&q.navigator&&q.navigator.userAgent?q.navigator.userAgent:""),Pt=ot?function(H,ft){var Et={};for(var At in H)ft[At]&&ft[At].length%2==0?Et[At]=ft[At].concat(H[At]):Et[At]=H[At];return Et}(X,ot):X;return this.getBrowser=function(){var H,ft={};return ft[P]=void 0,ft[k]=void 0,Y.call(ft,yt,Pt.browser),ft.major=typeof(H=ft.version)=="string"?H.replace(/[^\d\.]/g,"").split(".")[0]:void 0,ft},this.getCPU=function(){var H={architecture:void 0};return Y.call(H,yt,Pt.cpu),H},this.getDevice=function(){var H={vendor:void 0,model:void 0,type:void 0};return Y.call(H,yt,Pt.device),H},this.getEngine=function(){var H={name:void 0,version:void 0};return Y.call(H,yt,Pt.engine),H},this.getOS=function(){var H={name:void 0,version:void 0};return Y.call(H,yt,Pt.os),H},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 yt},this.setUA=function(H){return yt=typeof H=="string"&&H.length>255?O(H,255):H,this},this.setUA(yt),this};K.VERSION="1.0.2",K.BROWSER=Nt([P,k,"major"]),K.CPU=Nt(["architecture"]),K.DEVICE=Nt([W,z,V,"console",Z,Ot,vt,"wearable","embedded"]),K.ENGINE=K.OS=Nt([P,k]),M!==void 0?(T!==void 0&&T.exports&&(M=T.exports=K),M.UAParser=K):v(63)?(b=function(){return K}.call(M,v,M,T))===void 0||(T.exports=b):q!==void 0&&(q.UAParser=K);var qt=q!==void 0&&(q.jQuery||q.Zepto);if(qt&&!qt.ua){var ge=new K;qt.ua=ge.getResult(),qt.ua.get=function(){return ge.getUA()},qt.ua.set=function(Ct){ge.setUA(Ct);var ot=ge.getResult();for(var yt in ot)qt.ua[yt]=ot[yt]}}})(typeof window=="object"?window:this)},function(T,M,v){(function(b){var q=b!==void 0&&b||typeof self!="undefined"&&self||window,ht=Function.prototype.apply;function W(P,V){this._id=P,this._clearFn=V}M.setTimeout=function(){return new W(ht.call(setTimeout,q,arguments),clearTimeout)},M.setInterval=function(){return new W(ht.call(setInterval,q,arguments),clearInterval)},M.clearTimeout=M.clearInterval=function(P){P&&P.close()},W.prototype.unref=W.prototype.ref=function(){},W.prototype.close=function(){this._clearFn.call(q,this._id)},M.enroll=function(P,V){clearTimeout(P._idleTimeoutId),P._idleTimeout=V},M.unenroll=function(P){clearTimeout(P._idleTimeoutId),P._idleTimeout=-1},M._unrefActive=M.active=function(P){clearTimeout(P._idleTimeoutId);var V=P._idleTimeout;V>=0&&(P._idleTimeoutId=setTimeout(function(){P._onTimeout&&P._onTimeout()},V))},v(55),M.setImmediate=typeof self!="undefined"&&self.setImmediate||b!==void 0&&b.setImmediate||this&&this.setImmediate,M.clearImmediate=typeof self!="undefined"&&self.clearImmediate||b!==void 0&&b.clearImmediate||this&&this.clearImmediate}).call(this,v(3))},function(T,M,v){(function(b,q){(function(ht,W){if(!ht.setImmediate){var P,V,z,k,Z,vt=1,Ot={},Nt=!1,E=ht.document,L=Object.getPrototypeOf&&Object.getPrototypeOf(ht);L=L&&L.setTimeout?L:ht,{}.toString.call(ht.process)==="[object process]"?P=function(C){q.nextTick(function(){Y(C)})}:function(){if(ht.postMessage&&!ht.importScripts){var C=!0,j=ht.onmessage;return ht.onmessage=function(){C=!1},ht.postMessage("","*"),ht.onmessage=j,C}}()?(k="setImmediate$"+Math.random()+"$",Z=function(C){C.source===ht&&typeof C.data=="string"&&C.data.indexOf(k)===0&&Y(+C.data.slice(k.length))},ht.addEventListener?ht.addEventListener("message",Z,!1):ht.attachEvent("onmessage",Z),P=function(C){ht.postMessage(k+C,"*")}):ht.MessageChannel?((z=new MessageChannel).port1.onmessage=function(C){Y(C.data)},P=function(C){z.port2.postMessage(C)}):E&&"onreadystatechange"in E.createElement("script")?(V=E.documentElement,P=function(C){var j=E.createElement("script");j.onreadystatechange=function(){Y(C),j.onreadystatechange=null,V.removeChild(j),j=null},V.appendChild(j)}):P=function(C){setTimeout(Y,0,C)},L.setImmediate=function(C){typeof C!="function"&&(C=new Function(""+C));for(var j=new Array(arguments.length-1),X=0;X<j.length;X++)j[X]=arguments[X+1];var K={callback:C,args:j};return Ot[vt]=K,P(vt),vt++},L.clearImmediate=O}function O(C){delete Ot[C]}function Y(C){if(Nt)setTimeout(Y,0,C);else{var j=Ot[C];if(j){Nt=!0;try{(function(X){var K=X.callback,qt=X.args;switch(qt.length){case 0:K();break;case 1:K(qt[0]);break;case 2:K(qt[0],qt[1]);break;case 3:K(qt[0],qt[1],qt[2]);break;default:K.apply(void 0,qt)}})(j)}finally{O(C),Nt=!1}}}}})(typeof self=="undefined"?b===void 0?this:b:self)}).call(this,v(3),v(56))},function(T,M){var v,b,q=T.exports={};function ht(){throw new Error("setTimeout has not been defined")}function W(){throw new Error("clearTimeout has not been defined")}function P(L){if(v===setTimeout)return setTimeout(L,0);if((v===ht||!v)&&setTimeout)return v=setTimeout,setTimeout(L,0);try{return v(L,0)}catch{try{return v.call(null,L,0)}catch{return v.call(this,L,0)}}}(function(){try{v=typeof setTimeout=="function"?setTimeout:ht}catch{v=ht}try{b=typeof clearTimeout=="function"?clearTimeout:W}catch{b=W}})();var V,z=[],k=!1,Z=-1;function vt(){k&&V&&(k=!1,V.length?z=V.concat(z):Z=-1,z.length&&Ot())}function Ot(){if(!k){var L=P(vt);k=!0;for(var O=z.length;O;){for(V=z,z=[];++Z<O;)V&&V[Z].run();Z=-1,O=z.length}V=null,k=!1,function(Y){if(b===clearTimeout)return clearTimeout(Y);if((b===W||!b)&&clearTimeout)return b=clearTimeout,clearTimeout(Y);try{b(Y)}catch{try{return b.call(null,Y)}catch{return b.call(this,Y)}}}(L)}}function Nt(L,O){this.fun=L,this.array=O}function E(){}q.nextTick=function(L){var O=new Array(arguments.length-1);if(arguments.length>1)for(var Y=1;Y<arguments.length;Y++)O[Y-1]=arguments[Y];z.push(new Nt(L,O)),z.length!==1||k||P(Ot)},Nt.prototype.run=function(){this.fun.apply(null,this.array)},q.title="browser",q.browser=!0,q.env={},q.argv=[],q.version="",q.versions={},q.on=E,q.addListener=E,q.once=E,q.off=E,q.removeListener=E,q.removeAllListeners=E,q.emit=E,q.prependListener=E,q.prependOnceListener=E,q.listeners=function(L){return[]},q.binding=function(L){throw new Error("process.binding is not supported")},q.cwd=function(){return"/"},q.chdir=function(L){throw new Error("process.chdir is not supported")},q.umask=function(){return 0}},function(T,M,v){(function(b,q){var ht;/*! https://mths.be/punycode v1.4.1 by @mathias */(function(W){M&&M.nodeType,b&&b.nodeType;var P=typeof q=="object"&&q;P.global!==P&&P.window!==P&&P.self;var V,z=2147483647,k=/^xn--/,Z=/[^\x20-\x7E]/,vt=/[\x2E\u3002\uFF0E\uFF61]/g,Ot={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Nt=Math.floor,E=String.fromCharCode;function L(Ct){throw new RangeError(Ot[Ct])}function O(Ct,ot){for(var yt=Ct.length,Pt=[];yt--;)Pt[yt]=ot(Ct[yt]);return Pt}function Y(Ct,ot){var yt=Ct.split("@"),Pt="";return yt.length>1&&(Pt=yt[0]+"@",Ct=yt[1]),Pt+O((Ct=Ct.replace(vt,".")).split("."),ot).join(".")}function C(Ct){for(var ot,yt,Pt=[],H=0,ft=Ct.length;H<ft;)(ot=Ct.charCodeAt(H++))>=55296&&ot<=56319&&H<ft?(64512&(yt=Ct.charCodeAt(H++)))==56320?Pt.push(((1023&ot)<<10)+(1023&yt)+65536):(Pt.push(ot),H--):Pt.push(ot);return Pt}function j(Ct){return O(Ct,function(ot){var yt="";return ot>65535&&(yt+=E((ot-=65536)>>>10&1023|55296),ot=56320|1023&ot),yt+=E(ot)}).join("")}function X(Ct,ot){return Ct+22+75*(Ct<26)-((ot!=0)<<5)}function K(Ct,ot,yt){var Pt=0;for(Ct=yt?Nt(Ct/700):Ct>>1,Ct+=Nt(Ct/ot);Ct>455;Pt+=36)Ct=Nt(Ct/35);return Nt(Pt+36*Ct/(Ct+38))}function qt(Ct){var ot,yt,Pt,H,ft,Et,At,Rt,Wt,$t,ye,me=[],ui=Ct.length,be=0,ei=128,Ze=72;for((yt=Ct.lastIndexOf("-"))<0&&(yt=0),Pt=0;Pt<yt;++Pt)Ct.charCodeAt(Pt)>=128&&L("not-basic"),me.push(Ct.charCodeAt(Pt));for(H=yt>0?yt+1:0;H<ui;){for(ft=be,Et=1,At=36;H>=ui&&L("invalid-input"),((Rt=(ye=Ct.charCodeAt(H++))-48<10?ye-22:ye-65<26?ye-65:ye-97<26?ye-97:36)>=36||Rt>Nt((z-be)/Et))&&L("overflow"),be+=Rt*Et,!(Rt<(Wt=At<=Ze?1:At>=Ze+26?26:At-Ze));At+=36)Et>Nt(z/($t=36-Wt))&&L("overflow"),Et*=$t;Ze=K(be-ft,ot=me.length+1,ft==0),Nt(be/ot)>z-ei&&L("overflow"),ei+=Nt(be/ot),be%=ot,me.splice(be++,0,ei)}return j(me)}function ge(Ct){var ot,yt,Pt,H,ft,Et,At,Rt,Wt,$t,ye,me,ui,be,ei,Ze=[];for(me=(Ct=C(Ct)).length,ot=128,yt=0,ft=72,Et=0;Et<me;++Et)(ye=Ct[Et])<128&&Ze.push(E(ye));for(Pt=H=Ze.length,H&&Ze.push("-");Pt<me;){for(At=z,Et=0;Et<me;++Et)(ye=Ct[Et])>=ot&&ye<At&&(At=ye);for(At-ot>Nt((z-yt)/(ui=Pt+1))&&L("overflow"),yt+=(At-ot)*ui,ot=At,Et=0;Et<me;++Et)if((ye=Ct[Et])<ot&&++yt>z&&L("overflow"),ye==ot){for(Rt=yt,Wt=36;!(Rt<($t=Wt<=ft?1:Wt>=ft+26?26:Wt-ft));Wt+=36)ei=Rt-$t,be=36-$t,Ze.push(E(X($t+ei%be,0))),Rt=Nt(ei/be);Ze.push(E(X(Rt,0))),ft=K(yt,ui,Pt==H),yt=0,++Pt}++yt,++ot}return Ze.join("")}V={version:"1.4.1",ucs2:{decode:C,encode:j},decode:qt,encode:ge,toASCII:function(Ct){return Y(Ct,function(ot){return Z.test(ot)?"xn--"+ge(ot):ot})},toUnicode:function(Ct){return Y(Ct,function(ot){return k.test(ot)?qt(ot.slice(4).toLowerCase()):ot})}},(ht=function(){return V}.call(M,v,M,b))===void 0||(b.exports=ht)})()}).call(this,v(7)(T),v(3))},function(T,M,v){T.exports={isString:function(b){return typeof b=="string"},isObject:function(b){return typeof b=="object"&&b!==null},isNull:function(b){return b===null},isNullOrUndefined:function(b){return b==null}}},function(T,M,v){M.decode=M.parse=v(60),M.encode=M.stringify=v(61)},function(T,M,v){function b(ht,W){return Object.prototype.hasOwnProperty.call(ht,W)}T.exports=function(ht,W,P,V){W=W||"&",P=P||"=";var z={};if(typeof ht!="string"||ht.length===0)return z;var k=/\+/g;ht=ht.split(W);var Z=1e3;V&&typeof V.maxKeys=="number"&&(Z=V.maxKeys);var vt=ht.length;Z>0&&vt>Z&&(vt=Z);for(var Ot=0;Ot<vt;++Ot){var Nt,E,L,O,Y=ht[Ot].replace(k,"%20"),C=Y.indexOf(P);C>=0?(Nt=Y.substr(0,C),E=Y.substr(C+1)):(Nt=Y,E=""),L=decodeURIComponent(Nt),O=decodeURIComponent(E),b(z,L)?q(z[L])?z[L].push(O):z[L]=[z[L],O]:z[L]=O}return z};var q=Array.isArray||function(ht){return Object.prototype.toString.call(ht)==="[object Array]"}},function(T,M,v){var b=function(P){switch(typeof P){case"string":return P;case"boolean":return P?"true":"false";case"number":return isFinite(P)?P:"";default:return""}};T.exports=function(P,V,z,k){return V=V||"&",z=z||"=",P===null&&(P=void 0),typeof P=="object"?ht(W(P),function(Z){var vt=encodeURIComponent(b(Z))+z;return q(P[Z])?ht(P[Z],function(Ot){return vt+encodeURIComponent(b(Ot))}).join(V):vt+encodeURIComponent(b(P[Z]))}).join(V):k?encodeURIComponent(b(k))+z+encodeURIComponent(b(P)):""};var q=Array.isArray||function(P){return Object.prototype.toString.call(P)==="[object Array]"};function ht(P,V){if(P.map)return P.map(V);for(var z=[],k=0;k<P.length;k++)z.push(V(P[k],k));return z}var W=Object.keys||function(P){var V=[];for(var z in P)Object.prototype.hasOwnProperty.call(P,z)&&V.push(z);return V}},function(T,M){var v=function(){};v.prototype={fit:function(b){var q,ht,W,P,V=b.length,z=V>0?b[0].width:0,k=V>0?b[0].height:0;for(this.root={x:0,y:0,width:z,height:k},q=0;q<V;q++)W=b[q],(ht=this.findNode(this.root,W.width,W.height))?(P=this.splitNode(ht,W.width,W.height),W.x=P.x,W.y=P.y):(P=this.growNode(W.width,W.height),W.x=P.x,W.y=P.y)},findNode:function(b,q,ht){return b.used?this.findNode(b.right,q,ht)||this.findNode(b.down,q,ht):q<=b.width&&ht<=b.height?b:null},splitNode:function(b,q,ht){return b.used=!0,b.down={x:b.x,y:b.y+ht,width:b.width,height:b.height-ht},b.right={x:b.x+q,y:b.y,width:b.width-q,height:ht},b},growNode:function(b,q){var ht=b<=this.root.width,W=q<=this.root.height,P=W&&this.root.height>=this.root.width+b,V=ht&&this.root.width>=this.root.height+q;return P?this.growRight(b,q):V?this.growDown(b,q):W?this.growRight(b,q):ht?this.growDown(b,q):null},growRight:function(b,q){var ht;return this.root={used:!0,x:0,y:0,width:this.root.width+b,height:this.root.height,down:this.root,right:{x:this.root.width,y:0,width:b,height:this.root.height}},(ht=this.findNode(this.root,b,q))?this.splitNode(ht,b,q):null},growDown:function(b,q){var ht;return this.root={used:!0,x:0,y:0,width:this.root.width,height:this.root.height+q,down:{x:0,y:this.root.height,width:this.root.width,height:q},right:this.root},(ht=this.findNode(this.root,b,q))?this.splitNode(ht,b,q):null}},T.exports=v},function(T,M){(function(v){T.exports=v}).call(this,{})},function(T,M,v){v.r(M),v.d(M,"ErrorType",function(){return ur}),v.d(M,"delay",function(){return F_}),v.d(M,"waitUntil",function(){return XI}),v.d(M,"SLIDE_EVENTS",function(){return qr}),v.d(M,"Slide",function(){return k_});var b={};v.r(b),v.d(b,"ACESFilmicToneMapping",function(){return Tt}),v.d(b,"AddEquation",function(){return Et}),v.d(b,"AddOperation",function(){return Oa}),v.d(b,"AdditiveAnimationBlendMode",function(){return It}),v.d(b,"AdditiveBlending",function(){return yt}),v.d(b,"AlphaFormat",function(){return Fi}),v.d(b,"AlwaysDepth",function(){return Ii}),v.d(b,"AlwaysStencilFunc",function(){return Bl}),v.d(b,"AmbientLight",function(){return cm}),v.d(b,"AmbientLightProbe",function(){return Dy}),v.d(b,"AnimationClip",function(){return Xd}),v.d(b,"AnimationLoader",function(){return rE}),v.d(b,"AnimationMixer",function(){return Wy}),v.d(b,"AnimationObjectGroup",function(){return Vy}),v.d(b,"AnimationUtils",function(){return sn}),v.d(b,"ArcCurve",function(){return so}),v.d(b,"ArrayCamera",function(){return Nd}),v.d(b,"ArrowHelper",function(){return FE}),v.d(b,"Audio",function(){return Yv}),v.d(b,"AudioAnalyser",function(){return zy}),v.d(b,"AudioContext",function(){return qv}),v.d(b,"AudioListener",function(){return dE}),v.d(b,"AudioLoader",function(){return Oy}),v.d(b,"AxesHelper",function(){return lx}),v.d(b,"AxisHelper",function(){return pM}),v.d(b,"BackSide",function(){return X}),v.d(b,"BasicDepthPacking",function(){return Dl}),v.d(b,"BasicShadowMap",function(){return L}),v.d(b,"BinaryTextureLoader",function(){return _M}),v.d(b,"Bone",function(){return zh}),v.d(b,"BooleanKeyframeTrack",function(){return du}),v.d(b,"BoundingBoxHelper",function(){return fM}),v.d(b,"Box2",function(){return oc}),v.d(b,"Box3",function(){return Yi}),v.d(b,"Box3Helper",function(){return NE}),v.d(b,"BoxBufferGeometry",function(){return wo}),v.d(b,"BoxGeometry",function(){return wo}),v.d(b,"BoxHelper",function(){return sx}),v.d(b,"BufferAttribute",function(){return mi}),v.d(b,"BufferGeometry",function(){return ze}),v.d(b,"BufferGeometryLoader",function(){return Ry}),v.d(b,"ByteType",function(){return zp}),v.d(b,"Cache",function(){return fu}),v.d(b,"Camera",function(){return la}),v.d(b,"CameraHelper",function(){return OE}),v.d(b,"CanvasRenderer",function(){return xM}),v.d(b,"CanvasTexture",function(){return Ve}),v.d(b,"CatmullRomCurve3",function(){return qh}),v.d(b,"CineonToneMapping",function(){return at}),v.d(b,"CircleBufferGeometry",function(){return pe}),v.d(b,"CircleGeometry",function(){return pe}),v.d(b,"ClampToEdgeWrapping",function(){return qe}),v.d(b,"Clock",function(){return ky}),v.d(b,"Color",function(){return Le}),v.d(b,"ColorKeyframeTrack",function(){return Nv}),v.d(b,"CompressedTexture",function(){return Fe}),v.d(b,"CompressedTextureLoader",function(){return oE}),v.d(b,"ConeBufferGeometry",function(){return Ce}),v.d(b,"ConeGeometry",function(){return Ce}),v.d(b,"CubeCamera",function(){return ua}),v.d(b,"CubeReflectionMapping",function(){return zt}),v.d(b,"CubeRefractionMapping",function(){return ne}),v.d(b,"CubeTexture",function(){return ro}),v.d(b,"CubeTextureLoader",function(){return vy}),v.d(b,"CubeUVReflectionMapping",function(){return xe}),v.d(b,"CubeUVRefractionMapping",function(){return Ie}),v.d(b,"CubicBezierCurve",function(){return ya}),v.d(b,"CubicBezierCurve3",function(){return al}),v.d(b,"CubicInterpolant",function(){return py}),v.d(b,"CullFaceBack",function(){return Ot}),v.d(b,"CullFaceFront",function(){return Nt}),v.d(b,"CullFaceFrontBack",function(){return E}),v.d(b,"CullFaceNone",function(){return vt}),v.d(b,"Curve",function(){return cn}),v.d(b,"CurvePath",function(){return yy}),v.d(b,"CustomBlending",function(){return ft}),v.d(b,"CustomToneMapping",function(){return bt}),v.d(b,"CylinderBufferGeometry",function(){return He}),v.d(b,"CylinderGeometry",function(){return He}),v.d(b,"Cylindrical",function(){return ME}),v.d(b,"DataTexture",function(){return ws}),v.d(b,"DataTexture2DArray",function(){return Rh}),v.d(b,"DataTexture3D",function(){return Vr}),v.d(b,"DataTextureLoader",function(){return _y}),v.d(b,"DataUtils",function(){return kE}),v.d(b,"DecrementStencilOp",function(){return rh}),v.d(b,"DecrementWrapStencilOp",function(){return Bg}),v.d(b,"DefaultLoadingManager",function(){return gy}),v.d(b,"DepthFormat",function(){return tn}),v.d(b,"DepthStencilFormat",function(){return Xs}),v.d(b,"DepthTexture",function(){return re}),v.d(b,"DirectionalLight",function(){return hm}),v.d(b,"DirectionalLightHelper",function(){return LE}),v.d(b,"DiscreteInterpolant",function(){return fy}),v.d(b,"DodecahedronBufferGeometry",function(){return Ye}),v.d(b,"DodecahedronGeometry",function(){return Ye}),v.d(b,"DoubleSide",function(){return K}),v.d(b,"DstAlphaFactor",function(){return ri}),v.d(b,"DstColorFactor",function(){return Bi}),v.d(b,"DynamicBufferAttribute",function(){return nM}),v.d(b,"DynamicCopyUsage",function(){return uh}),v.d(b,"DynamicDrawUsage",function(){return mo}),v.d(b,"DynamicReadUsage",function(){return Ug}),v.d(b,"EdgesGeometry",function(){return Vn}),v.d(b,"EdgesHelper",function(){return mM}),v.d(b,"EllipseCurve",function(){return on}),v.d(b,"EqualDepth",function(){return Qi}),v.d(b,"EqualStencilFunc",function(){return sh}),v.d(b,"EquirectangularReflectionMapping",function(){return se}),v.d(b,"EquirectangularRefractionMapping",function(){return ae}),v.d(b,"Euler",function(){return ea}),v.d(b,"EventDispatcher",function(){return ko}),v.d(b,"ExtrudeBufferGeometry",function(){return $o}),v.d(b,"ExtrudeGeometry",function(){return $o}),v.d(b,"FaceColors",function(){return XE}),v.d(b,"FileLoader",function(){return Ko}),v.d(b,"FlatShading",function(){return qt}),v.d(b,"Float16BufferAttribute",function(){return ff}),v.d(b,"Float32Attribute",function(){return cM}),v.d(b,"Float32BufferAttribute",function(){return _e}),v.d(b,"Float64Attribute",function(){return dM}),v.d(b,"Float64BufferAttribute",function(){return pd}),v.d(b,"FloatType",function(){return Oo}),v.d(b,"Fog",function(){return eu}),v.d(b,"FogExp2",function(){return Fn}),v.d(b,"Font",function(){return Xv}),v.d(b,"FontLoader",function(){return uE}),v.d(b,"FrontSide",function(){return j}),v.d(b,"Frustum",function(){return Ka}),v.d(b,"GLBufferAttribute",function(){return qy}),v.d(b,"GLSL1",function(){return Qc}),v.d(b,"GLSL3",function(){return td}),v.d(b,"GammaEncoding",function(){return an}),v.d(b,"GreaterDepth",function(){return $n}),v.d(b,"GreaterEqualDepth",function(){return Yn}),v.d(b,"GreaterEqualStencilFunc",function(){return af}),v.d(b,"GreaterStencilFunc",function(){return ah}),v.d(b,"GridHelper",function(){return nx}),v.d(b,"Group",function(){return pa}),v.d(b,"HalfFloatType",function(){return Ws}),v.d(b,"HemisphereLight",function(){return Bv}),v.d(b,"HemisphereLightHelper",function(){return PE}),v.d(b,"HemisphereLightProbe",function(){return Ny}),v.d(b,"IcosahedronBufferGeometry",function(){return $h}),v.d(b,"IcosahedronGeometry",function(){return $h}),v.d(b,"ImageBitmapLoader",function(){return Iy}),v.d(b,"ImageLoader",function(){return qd}),v.d(b,"ImageUtils",function(){return kr}),v.d(b,"ImmediateRenderObject",function(){return Ky}),v.d(b,"IncrementStencilOp",function(){return rf}),v.d(b,"IncrementWrapStencilOp",function(){return Fg}),v.d(b,"InstancedBufferAttribute",function(){return Wv}),v.d(b,"InstancedBufferGeometry",function(){return Vv}),v.d(b,"InstancedInterleavedBuffer",function(){return Xy}),v.d(b,"InstancedMesh",function(){return Bd}),v.d(b,"Int16Attribute",function(){return aM}),v.d(b,"Int16BufferAttribute",function(){return dd}),v.d(b,"Int32Attribute",function(){return uM}),v.d(b,"Int32BufferAttribute",function(){return Th}),v.d(b,"Int8Attribute",function(){return rM}),v.d(b,"Int8BufferAttribute",function(){return Wl}),v.d(b,"IntType",function(){return Vp}),v.d(b,"InterleavedBuffer",function(){return fa}),v.d(b,"InterleavedBufferAttribute",function(){return Yo}),v.d(b,"Interpolant",function(){return ba}),v.d(b,"InterpolateDiscrete",function(){return us}),v.d(b,"InterpolateLinear",function(){return Ll}),v.d(b,"InterpolateSmooth",function(){return Bo}),v.d(b,"InvertStencilOp",function(){return kg}),v.d(b,"JSONLoader",function(){return bM}),v.d(b,"KeepStencilOp",function(){return Ei}),v.d(b,"KeyframeTrack",function(){return Jo}),v.d(b,"LOD",function(){return $f}),v.d(b,"LatheBufferGeometry",function(){return Jh}),v.d(b,"LatheGeometry",function(){return Jh}),v.d(b,"Layers",function(){return rd}),v.d(b,"LensFlare",function(){return SM}),v.d(b,"LessDepth",function(){return Ui}),v.d(b,"LessEqualDepth",function(){return On}),v.d(b,"LessEqualStencilFunc",function(){return of}),v.d(b,"LessStencilFunc",function(){return cs}),v.d(b,"Light",function(){return Qo}),v.d(b,"LightProbe",function(){return $d}),v.d(b,"Line",function(){return c}),v.d(b,"Line3",function(){return Zy}),v.d(b,"LineBasicMaterial",function(){return Bn}),v.d(b,"LineCurve",function(){return ll}),v.d(b,"LineCurve3",function(){return lu}),v.d(b,"LineDashedMaterial",function(){return Lv}),v.d(b,"LineLoop",function(){return D}),v.d(b,"LinePieces",function(){return VE}),v.d(b,"LineSegments",function(){return R}),v.d(b,"LineStrip",function(){return jE}),v.d(b,"LinearEncoding",function(){return Be}),v.d(b,"LinearFilter",function(){return qi}),v.d(b,"LinearInterpolant",function(){return Ov}),v.d(b,"LinearMipMapLinearFilter",function(){return Hp}),v.d(b,"LinearMipMapNearestFilter",function(){return Gp}),v.d(b,"LinearMipmapLinearFilter",function(){return js}),v.d(b,"LinearMipmapNearestFilter",function(){return as}),v.d(b,"LinearToneMapping",function(){return J}),v.d(b,"Loader",function(){return gr}),v.d(b,"LoaderUtils",function(){return dm}),v.d(b,"LoadingManager",function(){return Dv}),v.d(b,"LogLuvEncoding",function(){return ki}),v.d(b,"LoopOnce",function(){return ih}),v.d(b,"LoopPingPong",function(){return Fo}),v.d(b,"LoopRepeat",function(){return Jc}),v.d(b,"LuminanceAlphaFormat",function(){return Fc}),v.d(b,"LuminanceFormat",function(){return Yp}),v.d(b,"MOUSE",function(){return k}),v.d(b,"Material",function(){return Dn}),v.d(b,"MaterialLoader",function(){return Ay}),v.d(b,"Math",function(){return Ks}),v.d(b,"MathUtils",function(){return Ks}),v.d(b,"Matrix3",function(){return zi}),v.d(b,"Matrix4",function(){return Ee}),v.d(b,"MaxEquation",function(){return $t}),v.d(b,"Mesh",function(){return Ti}),v.d(b,"MeshBasicMaterial",function(){return pn}),v.d(b,"MeshDepthMaterial",function(){return xi}),v.d(b,"MeshDistanceMaterial",function(){return Dh}),v.d(b,"MeshFaceMaterial",function(){return YE}),v.d(b,"MeshLambertMaterial",function(){return um}),v.d(b,"MeshMatcapMaterial",function(){return Iv}),v.d(b,"MeshNormalMaterial",function(){return Pv}),v.d(b,"MeshPhongMaterial",function(){return lm}),v.d(b,"MeshPhysicalMaterial",function(){return Rv}),v.d(b,"MeshStandardMaterial",function(){return am}),v.d(b,"MeshToonMaterial",function(){return Cv}),v.d(b,"MinEquation",function(){return Wt}),v.d(b,"MirroredRepeatWrapping",function(){return pi}),v.d(b,"MixOperation",function(){return zu}),v.d(b,"MultiMaterial",function(){return $E}),v.d(b,"MultiplyBlending",function(){return H}),v.d(b,"MultiplyOperation",function(){return Hs}),v.d(b,"NearestFilter",function(){return fi}),v.d(b,"NearestMipMapLinearFilter",function(){return Cl}),v.d(b,"NearestMipMapNearestFilter",function(){return Lo}),v.d(b,"NearestMipmapLinearFilter",function(){return zs}),v.d(b,"NearestMipmapNearestFilter",function(){return Sr}),v.d(b,"NeverDepth",function(){return Ki}),v.d(b,"NeverStencilFunc",function(){return oh}),v.d(b,"NoBlending",function(){return Ct}),v.d(b,"NoColors",function(){return WE}),v.d(b,"NoToneMapping",function(){return Zr}),v.d(b,"NormalAnimationBlendMode",function(){return $s}),v.d(b,"NormalBlending",function(){return ot}),v.d(b,"NotEqualDepth",function(){return La}),v.d(b,"NotEqualStencilFunc",function(){return sf}),v.d(b,"NumberKeyframeTrack",function(){return Vd}),v.d(b,"Object3D",function(){return hi}),v.d(b,"ObjectLoader",function(){return sE}),v.d(b,"ObjectSpaceNormalMap",function(){return Fl}),v.d(b,"OctahedronBufferGeometry",function(){return uu}),v.d(b,"OctahedronGeometry",function(){return uu}),v.d(b,"OneFactor",function(){return me}),v.d(b,"OneMinusDstAlphaFactor",function(){return De}),v.d(b,"OneMinusDstColorFactor",function(){return Di}),v.d(b,"OneMinusSrcAlphaFactor",function(){return Ze}),v.d(b,"OneMinusSrcColorFactor",function(){return be}),v.d(b,"OrthographicCamera",function(){return rc}),v.d(b,"PCFShadowMap",function(){return O}),v.d(b,"PCFSoftShadowMap",function(){return Y}),v.d(b,"PMREMGenerator",function(){return GE}),v.d(b,"ParametricBufferGeometry",function(){return jd}),v.d(b,"ParametricGeometry",function(){return jd}),v.d(b,"Particle",function(){return ZE}),v.d(b,"ParticleBasicMaterial",function(){return tM}),v.d(b,"ParticleSystem",function(){return KE}),v.d(b,"ParticleSystemMaterial",function(){return eM}),v.d(b,"Path",function(){return mu}),v.d(b,"PerspectiveCamera",function(){return fn}),v.d(b,"Plane",function(){return jr}),v.d(b,"PlaneBufferGeometry",function(){return Kn}),v.d(b,"PlaneGeometry",function(){return Kn}),v.d(b,"PlaneHelper",function(){return DE}),v.d(b,"PointCloud",function(){return JE}),v.d(b,"PointCloudMaterial",function(){return QE}),v.d(b,"PointLight",function(){return Hv}),v.d(b,"PointLightHelper",function(){return RE}),v.d(b,"Points",function(){return Zt}),v.d(b,"PointsMaterial",function(){return $}),v.d(b,"PolarGridHelper",function(){return IE}),v.d(b,"PolyhedronBufferGeometry",function(){return Ue}),v.d(b,"PolyhedronGeometry",function(){return Ue}),v.d(b,"PositionalAudio",function(){return fE}),v.d(b,"PropertyBinding",function(){return Ri}),v.d(b,"PropertyMixer",function(){return jy}),v.d(b,"QuadraticBezierCurve",function(){return xa}),v.d(b,"QuadraticBezierCurve3",function(){return wv}),v.d(b,"Quaternion",function(){return Nn}),v.d(b,"QuaternionKeyframeTrack",function(){return nc}),v.d(b,"QuaternionLinearInterpolant",function(){return my}),v.d(b,"REVISION",function(){return z}),v.d(b,"RGBADepthPacking",function(){return Kc}),v.d(b,"RGBAFormat",function(){return Tr}),v.d(b,"RGBAIntegerFormat",function(){return Uc}),v.d(b,"RGBA_ASTC_10x10_Format",function(){return Vc}),v.d(b,"RGBA_ASTC_10x5_Format",function(){return Il}),v.d(b,"RGBA_ASTC_10x6_Format",function(){return qs}),v.d(b,"RGBA_ASTC_10x8_Format",function(){return Kp}),v.d(b,"RGBA_ASTC_12x10_Format",function(){return Wc}),v.d(b,"RGBA_ASTC_12x12_Format",function(){return Zu}),v.d(b,"RGBA_ASTC_4x4_Format",function(){return Yu}),v.d(b,"RGBA_ASTC_5x4_Format",function(){return Gi}),v.d(b,"RGBA_ASTC_5x5_Format",function(){return Do}),v.d(b,"RGBA_ASTC_6x5_Format",function(){return $u}),v.d(b,"RGBA_ASTC_6x6_Format",function(){return Jp}),v.d(b,"RGBA_ASTC_8x5_Format",function(){return Ju}),v.d(b,"RGBA_ASTC_8x6_Format",function(){return Zp}),v.d(b,"RGBA_ASTC_8x8_Format",function(){return jc}),v.d(b,"RGBA_BPTC_Format",function(){return Ku}),v.d(b,"RGBA_ETC2_EAC_Format",function(){return Da}),v.d(b,"RGBA_PVRTC_2BPPV1_Format",function(){return Hc}),v.d(b,"RGBA_PVRTC_4BPPV1_Format",function(){return hr}),v.d(b,"RGBA_S3TC_DXT1_Format",function(){return Wu}),v.d(b,"RGBA_S3TC_DXT3_Format",function(){return Xu}),v.d(b,"RGBA_S3TC_DXT5_Format",function(){return qu}),v.d(b,"RGBDEncoding",function(){return dr}),v.d(b,"RGBEEncoding",function(){return Mr}),v.d(b,"RGBEFormat",function(){return $p}),v.d(b,"RGBFormat",function(){return No}),v.d(b,"RGBIntegerFormat",function(){return kc}),v.d(b,"RGBM16Encoding",function(){return Zc}),v.d(b,"RGBM7Encoding",function(){return Nl}),v.d(b,"RGB_ETC1_Format",function(){return zc}),v.d(b,"RGB_ETC2_Format",function(){return fo}),v.d(b,"RGB_PVRTC_2BPPV1_Format",function(){return Gc}),v.d(b,"RGB_PVRTC_4BPPV1_Format",function(){return ir}),v.d(b,"RGB_S3TC_DXT1_Format",function(){return Vu}),v.d(b,"RGFormat",function(){return ju}),v.d(b,"RGIntegerFormat",function(){return Er}),v.d(b,"RawShaderMaterial",function(){return ic}),v.d(b,"Ray",function(){return jo}),v.d(b,"Raycaster",function(){return TE}),v.d(b,"RectAreaLight",function(){return zv}),v.d(b,"RedFormat",function(){return Na}),v.d(b,"RedIntegerFormat",function(){return Bc}),v.d(b,"ReinhardToneMapping",function(){return st}),v.d(b,"RepeatWrapping",function(){return Ge}),v.d(b,"ReplaceStencilOp",function(){return Dg}),v.d(b,"ReverseSubtractEquation",function(){return Rt}),v.d(b,"RingBufferGeometry",function(){return Zh}),v.d(b,"RingGeometry",function(){return Zh}),v.d(b,"SRGB8_ALPHA8_ASTC_10x10_Format",function(){return ef}),v.d(b,"SRGB8_ALPHA8_ASTC_10x5_Format",function(){return $c}),v.d(b,"SRGB8_ALPHA8_ASTC_10x6_Format",function(){return Qp}),v.d(b,"SRGB8_ALPHA8_ASTC_10x8_Format",function(){return tf}),v.d(b,"SRGB8_ALPHA8_ASTC_12x10_Format",function(){return nf}),v.d(b,"SRGB8_ALPHA8_ASTC_12x12_Format",function(){return Ys}),v.d(b,"SRGB8_ALPHA8_ASTC_4x4_Format",function(){return Xc}),v.d(b,"SRGB8_ALPHA8_ASTC_5x4_Format",function(){return Qu}),v.d(b,"SRGB8_ALPHA8_ASTC_5x5_Format",function(){return th}),v.d(b,"SRGB8_ALPHA8_ASTC_6x5_Format",function(){return qc}),v.d(b,"SRGB8_ALPHA8_ASTC_6x6_Format",function(){return cr}),v.d(b,"SRGB8_ALPHA8_ASTC_8x5_Format",function(){return eh}),v.d(b,"SRGB8_ALPHA8_ASTC_8x6_Format",function(){return Fa}),v.d(b,"SRGB8_ALPHA8_ASTC_8x8_Format",function(){return Yc}),v.d(b,"Scene",function(){return el}),v.d(b,"SceneUtils",function(){return wM}),v.d(b,"ShaderChunk",function(){return $e}),v.d(b,"ShaderLib",function(){return Pr}),v.d(b,"ShaderMaterial",function(){return rr}),v.d(b,"ShadowMaterial",function(){return Av}),v.d(b,"Shape",function(){return hl}),v.d(b,"ShapeBufferGeometry",function(){return hu}),v.d(b,"ShapeGeometry",function(){return hu}),v.d(b,"ShapePath",function(){return Ly}),v.d(b,"ShapeUtils",function(){return Ms}),v.d(b,"ShortType",function(){return jp}),v.d(b,"Skeleton",function(){return jh}),v.d(b,"SkeletonHelper",function(){return tx}),v.d(b,"SkinnedMesh",function(){return rl}),v.d(b,"SmoothShading",function(){return ge}),v.d(b,"Sphere",function(){return En}),v.d(b,"SphereBufferGeometry",function(){return cu}),v.d(b,"SphereGeometry",function(){return cu}),v.d(b,"Spherical",function(){return EE}),v.d(b,"SphericalHarmonics3",function(){return jv}),v.d(b,"SplineCurve",function(){return im}),v.d(b,"SpotLight",function(){return Uv}),v.d(b,"SpotLightHelper",function(){return AE}),v.d(b,"Sprite",function(){return su}),v.d(b,"SpriteMaterial",function(){return iu}),v.d(b,"SrcAlphaFactor",function(){return ei}),v.d(b,"SrcAlphaSaturateFactor",function(){return Ci}),v.d(b,"SrcColorFactor",function(){return ui}),v.d(b,"StaticCopyUsage",function(){return Hg}),v.d(b,"StaticDrawUsage",function(){return Js}),v.d(b,"StaticReadUsage",function(){return lh}),v.d(b,"StereoCamera",function(){return hE}),v.d(b,"StreamCopyUsage",function(){return hh}),v.d(b,"StreamDrawUsage",function(){return Zs}),v.d(b,"StreamReadUsage",function(){return Gg}),v.d(b,"StringKeyframeTrack",function(){return pu}),v.d(b,"SubtractEquation",function(){return At}),v.d(b,"SubtractiveBlending",function(){return Pt}),v.d(b,"TOUCH",function(){return Z}),v.d(b,"TangentSpaceNormalMap",function(){return Br}),v.d(b,"TetrahedronBufferGeometry",function(){return Kh}),v.d(b,"TetrahedronGeometry",function(){return Kh}),v.d(b,"TextBufferGeometry",function(){return sm}),v.d(b,"TextGeometry",function(){return sm}),v.d(b,"Texture",function(){return dn}),v.d(b,"TextureLoader",function(){return Fv}),v.d(b,"TorusBufferGeometry",function(){return Qh}),v.d(b,"TorusGeometry",function(){return Qh}),v.d(b,"TorusKnotBufferGeometry",function(){return tc}),v.d(b,"TorusKnotGeometry",function(){return tc}),v.d(b,"Triangle",function(){return ji}),v.d(b,"TriangleFanDrawMode",function(){return Se}),v.d(b,"TriangleStripDrawMode",function(){return ie}),v.d(b,"TrianglesDrawMode",function(){return Qt}),v.d(b,"TubeBufferGeometry",function(){return ec}),v.d(b,"TubeGeometry",function(){return ec}),v.d(b,"UVMapping",function(){return wt}),v.d(b,"Uint16Attribute",function(){return lM}),v.d(b,"Uint16BufferAttribute",function(){return Wa}),v.d(b,"Uint32Attribute",function(){return hM}),v.d(b,"Uint32BufferAttribute",function(){return no}),v.d(b,"Uint8Attribute",function(){return oM}),v.d(b,"Uint8BufferAttribute",function(){return cd}),v.d(b,"Uint8ClampedAttribute",function(){return sM}),v.d(b,"Uint8ClampedBufferAttribute",function(){return Sh}),v.d(b,"Uniform",function(){return fm}),v.d(b,"UniformsLib",function(){return Te}),v.d(b,"UniformsUtils",function(){return So}),v.d(b,"UnsignedByteType",function(){return ls}),v.d(b,"UnsignedInt248Type",function(){return Pi}),v.d(b,"UnsignedIntType",function(){return Vs}),v.d(b,"UnsignedShort4444Type",function(){return Wp}),v.d(b,"UnsignedShort5551Type",function(){return Xp}),v.d(b,"UnsignedShort565Type",function(){return qp}),v.d(b,"UnsignedShortType",function(){return Pl}),v.d(b,"VSMShadowMap",function(){return C}),v.d(b,"Vector2",function(){return ce}),v.d(b,"Vector3",function(){return S}),v.d(b,"Vector4",function(){return Li}),v.d(b,"VectorKeyframeTrack",function(){return Wd}),v.d(b,"Vertex",function(){return iM}),v.d(b,"VertexColors",function(){return qE}),v.d(b,"VideoTexture",function(){return Oe}),v.d(b,"WebGL1Renderer",function(){return Rn}),v.d(b,"WebGLCubeRenderTarget",function(){return je}),v.d(b,"WebGLMultipleRenderTargets",function(){return Gl}),v.d(b,"WebGLMultisampleRenderTarget",function(){return Qs}),v.d(b,"WebGLRenderTarget",function(){return Kr}),v.d(b,"WebGLRenderTargetCube",function(){return yM}),v.d(b,"WebGLRenderer",function(){return Oi}),v.d(b,"WebGLUtils",function(){return Wf}),v.d(b,"WireframeGeometry",function(){return Mv}),v.d(b,"WireframeHelper",function(){return gM}),v.d(b,"WrapAroundEnding",function(){return Ol}),v.d(b,"XHRLoader",function(){return vM}),v.d(b,"ZeroCurvatureEnding",function(){return Gn}),v.d(b,"ZeroFactor",function(){return ye}),v.d(b,"ZeroSlopeEnding",function(){return hs}),v.d(b,"ZeroStencilOp",function(){return nh}),v.d(b,"sRGBEncoding",function(){return gi});var q={};v.r(q),v.d(q,"isMobile",function(){return ts}),v.d(q,"EventEmitter",function(){return lc.a}),v.d(q,"earcut",function(){return p0.a}),v.d(q,"BaseTextureCache",function(){return Ao}),v.d(q,"CanvasRenderTarget",function(){return E0}),v.d(q,"DATA_URI",function(){return Kx}),v.d(q,"ProgramCache",function(){return T0}),v.d(q,"TextureCache",function(){return Xr}),v.d(q,"clearTextureCache",function(){return e2}),v.d(q,"correctBlendMode",function(){return x0}),v.d(q,"createIndicesForQuads",function(){return $x}),v.d(q,"decomposeDataUri",function(){return i2}),v.d(q,"deprecation",function(){return uc}),v.d(q,"destroyTextureCache",function(){return t2}),v.d(q,"determineCrossOrigin",function(){return Qx}),v.d(q,"getBufferType",function(){return Rm}),v.d(q,"getResolutionOfUrl",function(){return ep}),v.d(q,"hex2rgb",function(){return Tu}),v.d(q,"hex2string",function(){return v0}),v.d(q,"interleaveTypedArrays",function(){return KA}),v.d(q,"isPow2",function(){return w0}),v.d(q,"isWebGLSupported",function(){return qx}),v.d(q,"log2",function(){return S0}),v.d(q,"nextPow2",function(){return tp}),v.d(q,"premultiplyBlendMode",function(){return y0}),v.d(q,"premultiplyRgba",function(){return Yx}),v.d(q,"premultiplyTint",function(){return Am}),v.d(q,"premultiplyTintToRgba",function(){return b0}),v.d(q,"removeItems",function(){return Eu}),v.d(q,"rgb2hex",function(){return JA}),v.d(q,"sayHello",function(){return Xx}),v.d(q,"sign",function(){return Mu}),v.d(q,"skipHello",function(){return YA}),v.d(q,"string2hex",function(){return _0}),v.d(q,"trimCanvas",function(){return Zx}),v.d(q,"uid",function(){return fl}),v.d(q,"url",function(){return Su});var ht=v(4),W=v(1),P=v.n(W),V=v(0);/**
|
|
1828
1828
|
* @license
|
|
1829
1829
|
* Copyright 2010-2021 Three.js Authors
|
|
1830
1830
|
* SPDX-License-Identifier: MIT
|
|
1831
|
-
*/const z="130",k={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Z={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},vt=0,Ot=1,Nt=2,E=3,L=0,O=1,Y=2,P=3,j=0,X=1,K=2,qt=1,ge=2,Ct=0,ot=1,yt=2,Pt=3,H=4,ft=5,Et=100,At=101,Rt=102,Wt=103,$t=104,ye=200,me=201,ui=202,be=203,ei=204,Ze=205,ri=206,De=207,Bi=208,Di=209,Ci=210,Ki=0,Ii=1,Ui=2,On=3,Qi=4,Yn=5,$n=6,La=7,Hs=0,zu=1,Oa=2,Zr=0,J=1,st=2,at=3,Tt=4,bt=5,wt=300,zt=301,ne=302,se=303,ae=304,xe=306,Ie=307,Ge=1e3,qe=1001,pi=1002,fi=1003,Sr=1004,Lo=1004,zs=1005,Cl=1005,qi=1006,as=1007,Gp=1007,js=1008,Hp=1008,ls=1009,zp=1010,jp=1011,Pl=1012,Vp=1013,Vs=1014,Oo=1015,Ws=1016,Wp=1017,Xp=1018,qp=1019,Pi=1020,Fi=1021,No=1022,Tr=1023,Yp=1024,Fc=1025,$p=Tr,tn=1026,Xs=1027,Na=1028,Bc=1029,ju=1030,Er=1031,kc=1032,Uc=1033,Vu=33776,Wu=33777,Xu=33778,qu=33779,ir=35840,Gc=35841,hr=35842,Hc=35843,zc=36196,fo=37492,Da=37496,Yu=37808,Gi=37809,Do=37810,$u=37811,Jp=37812,Ju=37813,Zp=37814,jc=37815,Il=37816,qs=37817,Kp=37818,Vc=37819,Wc=37820,Zu=37821,Ku=36492,Xc=37840,Qu=37841,th=37842,qc=37843,cr=37844,eh=37845,Fa=37846,Yc=37847,$c=37848,Qp=37849,tf=37850,ef=37851,nf=37852,Ys=37853,ih=2200,Jc=2201,Fo=2202,us=2300,Ll=2301,Bo=2302,Gn=2400,hs=2401,Ol=2402,$s=2500,It=2501,Qt=0,ie=1,Se=2,Be=3e3,gi=3001,an=3007,Mr=3002,ki=3003,Nl=3004,Zc=3005,dr=3006,Dl=3200,Kc=3201,Br=0,Fl=1,nh=0,Ei=7680,Dg=7681,rf=7682,rh=7683,Fg=34055,Bg=34056,kg=5386,oh=512,cs=513,sh=514,of=515,ah=516,sf=517,af=518,Bl=519,Js=35044,mo=35048,Zs=35040,lh=35045,Ug=35049,Gg=35041,Hg=35046,uh=35050,hh=35042,Qc="100",td="300 es";class ko{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[t]===void 0&&(i[t]=[]),i[t].indexOf(e)===-1&&i[t].push(e)}hasEventListener(t,e){if(this._listeners===void 0)return!1;const i=this._listeners;return i[t]!==void 0&&i[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;const i=this._listeners[t];if(i!==void 0){const r=i.indexOf(e);r!==-1&&i.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 i=e.slice(0);for(let r=0,o=i.length;r<o;r++)i[r].call(this,t);t.target=null}}}const Hn=[];for(let n=0;n<256;n++)Hn[n]=(n<16?"0":"")+n.toString(16);let ch=1234567;const Hi=Math.PI/180,yn=180/Math.PI;function Ar(){const n=4294967295*Math.random()|0,t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(Hn[255&n]+Hn[n>>8&255]+Hn[n>>16&255]+Hn[n>>24&255]+"-"+Hn[255&t]+Hn[t>>8&255]+"-"+Hn[t>>16&15|64]+Hn[t>>24&255]+"-"+Hn[63&e|128]+Hn[e>>8&255]+"-"+Hn[e>>16&255]+Hn[e>>24&255]+Hn[255&i]+Hn[i>>8&255]+Hn[i>>16&255]+Hn[i>>24&255]).toUpperCase()}function zn(n,t,e){return Math.max(t,Math.min(e,n))}function dh(n,t){return(n%t+t)%t}function kl(n,t,e){return(1-e)*n+e*t}function Ul(n){return(n&n-1)==0&&n!==0}function Ba(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function ph(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}var Ks=Object.freeze({__proto__:null,DEG2RAD:Hi,RAD2DEG:yn,generateUUID:Ar,clamp:zn,euclideanModulo:dh,mapLinear:function(n,t,e,i,r){return i+(n-t)*(r-i)/(e-t)},inverseLerp:function(n,t,e){return n!==t?(e-n)/(t-n):0},lerp:kl,damp:function(n,t,e,i){return kl(n,t,1-Math.exp(-e*i))},pingpong:function(n,t=1){return t-Math.abs(dh(n,2*t)-t)},smoothstep:function(n,t,e){return n<=t?0:n>=e?1:(n=(n-t)/(e-t))*n*(3-2*n)},smootherstep:function(n,t,e){return n<=t?0:n>=e?1:(n=(n-t)/(e-t))*n*n*(n*(6*n-15)+10)},randInt:function(n,t){return n+Math.floor(Math.random()*(t-n+1))},randFloat:function(n,t){return n+Math.random()*(t-n)},randFloatSpread:function(n){return n*(.5-Math.random())},seededRandom:function(n){return n!==void 0&&(ch=n%2147483647),ch=16807*ch%2147483647,(ch-1)/2147483646},degToRad:function(n){return n*Hi},radToDeg:function(n){return n*yn},isPowerOfTwo:Ul,ceilPowerOfTwo:Ba,floorPowerOfTwo:ph,setQuaternionFromProperEuler:function(n,t,e,i,r){const o=Math.cos,s=Math.sin,a=o(e/2),l=s(e/2),u=o((t+i)/2),h=s((t+i)/2),d=o((t-i)/2),p=s((t-i)/2),m=o((i-t)/2),g=s((i-t)/2);switch(r){case"XYX":n.set(a*h,l*d,l*p,a*u);break;case"YZY":n.set(l*p,a*h,l*d,a*u);break;case"ZXZ":n.set(l*d,l*p,a*h,a*u);break;case"XZX":n.set(a*h,l*g,l*m,a*u);break;case"YXY":n.set(l*m,a*h,l*g,a*u);break;case"ZYZ":n.set(l*g,l*m,a*h,a*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}});class ce{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,i=this.y,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6],this.y=r[1]*e+r[4]*i+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 i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}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,i=this.y-t.y;return e*e+i*i}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,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,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,i){return i!==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 i=Math.cos(e),r=Math.sin(e),o=this.x-t.x,s=this.y-t.y;return this.x=o*i-s*r+t.x,this.y=o*r+s*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}}ce.prototype.isVector2=!0;class zi{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,i,r,o,s,a,l,u){const h=this.elements;return h[0]=t,h[1]=r,h[2]=a,h[3]=e,h[4]=o,h[5]=l,h[6]=i,h[7]=s,h[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}extractBasis(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.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 i=t.elements,r=e.elements,o=this.elements,s=i[0],a=i[3],l=i[6],u=i[1],h=i[4],d=i[7],p=i[2],m=i[5],g=i[8],_=r[0],y=r[3],w=r[6],A=r[1],I=r[4],F=r[7],N=r[2],U=r[5],B=r[8];return o[0]=s*_+a*A+l*N,o[3]=s*y+a*I+l*U,o[6]=s*w+a*F+l*B,o[1]=u*_+h*A+d*N,o[4]=u*y+h*I+d*U,o[7]=u*w+h*F+d*B,o[2]=p*_+m*A+g*N,o[5]=p*y+m*I+g*U,o[8]=p*w+m*F+g*B,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],i=t[1],r=t[2],o=t[3],s=t[4],a=t[5],l=t[6],u=t[7],h=t[8];return e*s*h-e*a*u-i*o*h+i*a*l+r*o*u-r*s*l}invert(){const t=this.elements,e=t[0],i=t[1],r=t[2],o=t[3],s=t[4],a=t[5],l=t[6],u=t[7],h=t[8],d=h*s-a*u,p=a*l-h*o,m=u*o-s*l,g=e*d+i*p+r*m;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/g;return t[0]=d*_,t[1]=(r*u-h*i)*_,t[2]=(a*i-r*s)*_,t[3]=p*_,t[4]=(h*e-r*l)*_,t[5]=(r*o-a*e)*_,t[6]=m*_,t[7]=(i*l-u*e)*_,t[8]=(s*e-i*o)*_,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,i,r,o,s,a){const l=Math.cos(o),u=Math.sin(o);return this.set(i*l,i*u,-i*(l*s+u*a)+s+t,-r*u,r*l,-r*(-u*s+l*a)+a+e,0,0,1),this}scale(t,e){const i=this.elements;return i[0]*=t,i[3]*=t,i[6]*=t,i[1]*=e,i[4]*=e,i[7]*=e,this}rotate(t){const e=Math.cos(t),i=Math.sin(t),r=this.elements,o=r[0],s=r[3],a=r[6],l=r[1],u=r[4],h=r[7];return r[0]=e*o+i*l,r[3]=e*s+i*u,r[6]=e*a+i*h,r[1]=-i*o+e*l,r[4]=-i*s+e*u,r[7]=-i*a+e*h,this}translate(t,e){const i=this.elements;return i[0]+=t*i[2],i[3]+=t*i[5],i[6]+=t*i[8],i[1]+=e*i[2],i[4]+=e*i[5],i[7]+=e*i[8],this}equals(t){const e=this.elements,i=t.elements;for(let r=0;r<9;r++)if(e[r]!==i[r])return!1;return!0}fromArray(t,e=0){for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}clone(){return new this.constructor().fromArray(this.elements)}}let Uo;zi.prototype.isMatrix3=!0;class kr{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement=="undefined")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{Uo===void 0&&(Uo=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Uo.width=t.width,Uo.height=t.height;const i=Uo.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=Uo}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 zg=0;class dn extends ko{constructor(t=dn.DEFAULT_IMAGE,e=dn.DEFAULT_MAPPING,i=qe,r=qe,o=qi,s=js,a=Tr,l=ls,u=1,h=Be){super(),Object.defineProperty(this,"id",{value:zg++}),this.uuid=Ar(),this.name="",this.image=t,this.mipmaps=[],this.mapping=e,this.wrapS=i,this.wrapT=r,this.magFilter=o,this.minFilter=s,this.anisotropy=u,this.format=a,this.internalFormat=null,this.type=l,this.offset=new ce(0,0),this.repeat=new ce(1,1),this.center=new ce(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new zi,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=h,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 i={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=Ar()),!e&&t.images[r.uuid]===void 0){let o;if(Array.isArray(r)){o=[];for(let s=0,a=r.length;s<a;s++)r[s].isDataTexture?o.push(ed(r[s].image)):o.push(ed(r[s]))}else o=ed(r);t.images[r.uuid]={uuid:r.uuid,url:o}}i.image=r.uuid}return e||(t.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==wt)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case Ge:t.x=t.x-Math.floor(t.x);break;case qe:t.x=t.x<0?0:1;break;case pi: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 Ge:t.y=t.y-Math.floor(t.y);break;case qe:t.y=t.y<0?0:1;break;case pi: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 ed(n){return typeof HTMLImageElement!="undefined"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&n instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&n instanceof ImageBitmap?kr.getDataURL(n):n.data?{data:Array.prototype.slice.call(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}dn.DEFAULT_IMAGE=void 0,dn.DEFAULT_MAPPING=wt,dn.prototype.isTexture=!0;class Li{constructor(t=0,e=0,i=0,r=1){this.x=t,this.y=e,this.z=i,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,i,r){return this.x=t,this.y=e,this.z=i,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,i=this.y,r=this.z,o=this.w,s=t.elements;return this.x=s[0]*e+s[4]*i+s[8]*r+s[12]*o,this.y=s[1]*e+s[5]*i+s[9]*r+s[13]*o,this.z=s[2]*e+s[6]*i+s[10]*r+s[14]*o,this.w=s[3]*e+s[7]*i+s[11]*r+s[15]*o,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,i,r,o;const s=t.elements,a=s[0],l=s[4],u=s[8],h=s[1],d=s[5],p=s[9],m=s[2],g=s[6],_=s[10];if(Math.abs(l-h)<.01&&Math.abs(u-m)<.01&&Math.abs(p-g)<.01){if(Math.abs(l+h)<.1&&Math.abs(u+m)<.1&&Math.abs(p+g)<.1&&Math.abs(a+d+_-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const w=(a+1)/2,A=(d+1)/2,I=(_+1)/2,F=(l+h)/4,N=(u+m)/4,U=(p+g)/4;return w>A&&w>I?w<.01?(i=0,r=.707106781,o=.707106781):(i=Math.sqrt(w),r=F/i,o=N/i):A>I?A<.01?(i=.707106781,r=0,o=.707106781):(r=Math.sqrt(A),i=F/r,o=U/r):I<.01?(i=.707106781,r=.707106781,o=0):(o=Math.sqrt(I),i=N/o,r=U/o),this.set(i,r,o,e),this}let y=Math.sqrt((g-p)*(g-p)+(u-m)*(u-m)+(h-l)*(h-l));return Math.abs(y)<.001&&(y=1),this.x=(g-p)/y,this.y=(u-m)/y,this.z=(h-l)/y,this.w=Math.acos((a+d+_-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 i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}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,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,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,i){return i!==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}}Li.prototype.isVector4=!0;class Kr extends ko{constructor(t,e,i={}){super(),this.width=t,this.height=e,this.depth=1,this.scissor=new Li(0,0,t,e),this.scissorTest=!1,this.viewport=new Li(0,0,t,e),this.texture=new dn(void 0,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.image={width:t,height:e,depth:1},this.texture.generateMipmaps=i.generateMipmaps!==void 0&&i.generateMipmaps,this.texture.minFilter=i.minFilter!==void 0?i.minFilter:qi,this.depthBuffer=i.depthBuffer===void 0||i.depthBuffer,this.stencilBuffer=i.stencilBuffer!==void 0&&i.stencilBuffer,this.depthTexture=i.depthTexture!==void 0?i.depthTexture:null}setTexture(t){t.image={width:this.width,height:this.height,depth:this.depth},this.texture=t}setSize(t,e,i=1){this.width===t&&this.height===e&&this.depth===i||(this.width=t,this.height=e,this.depth=i,this.texture.image.width=t,this.texture.image.height=e,this.texture.image.depth=i,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=H_({},this.texture.image),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}Kr.prototype.isWebGLRenderTarget=!0;class Gl extends Kr{constructor(t,e,i){super(t,e);const r=this.texture;this.texture=[];for(let o=0;o<i;o++)this.texture[o]=r.clone()}setSize(t,e,i=1){if(this.width!==t||this.height!==e||this.depth!==i){this.width=t,this.height=e,this.depth=i;for(let r=0,o=this.texture.length;r<o;r++)this.texture[r].image.width=t,this.texture[r].image.height=e,this.texture[r].image.depth=i;this.dispose()}return this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e),this}copy(t){this.dispose(),this.width=t.width,this.height=t.height,this.depth=t.depth,this.viewport.set(0,0,this.width,this.height),this.scissor.set(0,0,this.width,this.height),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this.texture.length=0;for(let e=0,i=t.texture.length;e<i;e++)this.texture[e]=t.texture[e].clone();return this}}Gl.prototype.isWebGLMultipleRenderTargets=!0;class Qs extends Kr{constructor(t,e,i){super(t,e,i),this.samples=4}copy(t){return super.copy.call(this,t),this.samples=t.samples,this}}Qs.prototype.isWebGLMultisampleRenderTarget=!0;class Nn{constructor(t=0,e=0,i=0,r=1){this._x=t,this._y=e,this._z=i,this._w=r}static slerp(t,e,i,r){return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."),i.slerpQuaternions(t,e,r)}static slerpFlat(t,e,i,r,o,s,a){let l=i[r+0],u=i[r+1],h=i[r+2],d=i[r+3];const p=o[s+0],m=o[s+1],g=o[s+2],_=o[s+3];if(a===0)return t[e+0]=l,t[e+1]=u,t[e+2]=h,void(t[e+3]=d);if(a===1)return t[e+0]=p,t[e+1]=m,t[e+2]=g,void(t[e+3]=_);if(d!==_||l!==p||u!==m||h!==g){let y=1-a;const w=l*p+u*m+h*g+d*_,A=w>=0?1:-1,I=1-w*w;if(I>Number.EPSILON){const N=Math.sqrt(I),U=Math.atan2(N,w*A);y=Math.sin(y*U)/N,a=Math.sin(a*U)/N}const F=a*A;if(l=l*y+p*F,u=u*y+m*F,h=h*y+g*F,d=d*y+_*F,y===1-a){const N=1/Math.sqrt(l*l+u*u+h*h+d*d);l*=N,u*=N,h*=N,d*=N}}t[e]=l,t[e+1]=u,t[e+2]=h,t[e+3]=d}static multiplyQuaternionsFlat(t,e,i,r,o,s){const a=i[r],l=i[r+1],u=i[r+2],h=i[r+3],d=o[s],p=o[s+1],m=o[s+2],g=o[s+3];return t[e]=a*g+h*d+l*m-u*p,t[e+1]=l*g+h*p+u*d-a*m,t[e+2]=u*g+h*m+a*p-l*d,t[e+3]=h*g-a*d-l*p-u*m,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,i,r){return this._x=t,this._y=e,this._z=i,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 i=t._x,r=t._y,o=t._z,s=t._order,a=Math.cos,l=Math.sin,u=a(i/2),h=a(r/2),d=a(o/2),p=l(i/2),m=l(r/2),g=l(o/2);switch(s){case"XYZ":this._x=p*h*d+u*m*g,this._y=u*m*d-p*h*g,this._z=u*h*g+p*m*d,this._w=u*h*d-p*m*g;break;case"YXZ":this._x=p*h*d+u*m*g,this._y=u*m*d-p*h*g,this._z=u*h*g-p*m*d,this._w=u*h*d+p*m*g;break;case"ZXY":this._x=p*h*d-u*m*g,this._y=u*m*d+p*h*g,this._z=u*h*g+p*m*d,this._w=u*h*d-p*m*g;break;case"ZYX":this._x=p*h*d-u*m*g,this._y=u*m*d+p*h*g,this._z=u*h*g-p*m*d,this._w=u*h*d+p*m*g;break;case"YZX":this._x=p*h*d+u*m*g,this._y=u*m*d+p*h*g,this._z=u*h*g-p*m*d,this._w=u*h*d-p*m*g;break;case"XZY":this._x=p*h*d-u*m*g,this._y=u*m*d-p*h*g,this._z=u*h*g+p*m*d,this._w=u*h*d+p*m*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return e!==!1&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const i=e/2,r=Math.sin(i);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,i=e[0],r=e[4],o=e[8],s=e[1],a=e[5],l=e[9],u=e[2],h=e[6],d=e[10],p=i+a+d;if(p>0){const m=.5/Math.sqrt(p+1);this._w=.25/m,this._x=(h-l)*m,this._y=(o-u)*m,this._z=(s-r)*m}else if(i>a&&i>d){const m=2*Math.sqrt(1+i-a-d);this._w=(h-l)/m,this._x=.25*m,this._y=(r+s)/m,this._z=(o+u)/m}else if(a>d){const m=2*Math.sqrt(1+a-i-d);this._w=(o-u)/m,this._x=(r+s)/m,this._y=.25*m,this._z=(l+h)/m}else{const m=2*Math.sqrt(1+d-i-a);this._w=(s-r)/m,this._x=(o+u)/m,this._y=(l+h)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let i=t.dot(e)+1;return i<Number.EPSILON?(i=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(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=i),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(zn(this.dot(t),-1,1)))}rotateTowards(t,e){const i=this.angleTo(t);if(i===0)return this;const r=Math.min(1,e/i);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 i=t._x,r=t._y,o=t._z,s=t._w,a=e._x,l=e._y,u=e._z,h=e._w;return this._x=i*h+s*a+r*u-o*l,this._y=r*h+s*l+o*a-i*u,this._z=o*h+s*u+i*l-r*a,this._w=s*h-i*a-r*l-o*u,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const i=this._x,r=this._y,o=this._z,s=this._w;let a=s*t._w+i*t._x+r*t._y+o*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=s,this._x=i,this._y=r,this._z=o,this;const l=1-a*a;if(l<=Number.EPSILON){const m=1-e;return this._w=m*s+e*this._w,this._x=m*i+e*this._x,this._y=m*r+e*this._y,this._z=m*o+e*this._z,this.normalize(),this._onChangeCallback(),this}const u=Math.sqrt(l),h=Math.atan2(u,a),d=Math.sin((1-e)*h)/u,p=Math.sin(e*h)/u;return this._w=s*d+this._w*p,this._x=i*d+this._x*p,this._y=r*d+this._y*p,this._z=o*d+this._z*p,this._onChangeCallback(),this}slerpQuaternions(t,e,i){this.copy(t).slerp(e,i)}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(){}}Nn.prototype.isQuaternion=!0;class S{constructor(t=0,e=0,i=0){this.x=t,this.y=e,this.z=i}set(t,e,i){return i===void 0&&(i=this.z),this.x=t,this.y=e,this.z=i,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(Hl.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(Hl.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,i=this.y,r=this.z,o=t.elements;return this.x=o[0]*e+o[3]*i+o[6]*r,this.y=o[1]*e+o[4]*i+o[7]*r,this.z=o[2]*e+o[5]*i+o[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,i=this.y,r=this.z,o=t.elements,s=1/(o[3]*e+o[7]*i+o[11]*r+o[15]);return this.x=(o[0]*e+o[4]*i+o[8]*r+o[12])*s,this.y=(o[1]*e+o[5]*i+o[9]*r+o[13])*s,this.z=(o[2]*e+o[6]*i+o[10]*r+o[14])*s,this}applyQuaternion(t){const e=this.x,i=this.y,r=this.z,o=t.x,s=t.y,a=t.z,l=t.w,u=l*e+s*r-a*i,h=l*i+a*e-o*r,d=l*r+o*i-s*e,p=-o*e-s*i-a*r;return this.x=u*l+p*-o+h*-a-d*-s,this.y=h*l+p*-s+d*-o-u*-a,this.z=d*l+p*-a+u*-s-h*-o,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,i=this.y,r=this.z,o=t.elements;return this.x=o[0]*e+o[4]*i+o[8]*r,this.y=o[1]*e+o[5]*i+o[9]*r,this.z=o[2]*e+o[6]*i+o[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 i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}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,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,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 i=t.x,r=t.y,o=t.z,s=e.x,a=e.y,l=e.z;return this.x=r*l-o*a,this.y=o*s-i*l,this.z=i*a-r*s,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return ds.copy(this).projectOnVector(t),this.sub(ds)}reflect(t){return this.sub(ds.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 i=this.dot(t)/e;return Math.acos(zn(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y,r=this.z-t.z;return e*e+i*i+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,i){const r=Math.sin(e)*t;return this.x=r*Math.sin(i),this.y=Math.cos(e)*t,this.z=r*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,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(),i=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,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,i){return i!==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}}S.prototype.isVector3=!0;const ds=new S,Hl=new Nn;class Yi{constructor(t=new S(1/0,1/0,1/0),e=new S(-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,i=1/0,r=1/0,o=-1/0,s=-1/0,a=-1/0;for(let l=0,u=t.length;l<u;l+=3){const h=t[l],d=t[l+1],p=t[l+2];h<e&&(e=h),d<i&&(i=d),p<r&&(r=p),h>o&&(o=h),d>s&&(s=d),p>a&&(a=p)}return this.min.set(e,i,r),this.max.set(o,s,a),this}setFromBufferAttribute(t){let e=1/0,i=1/0,r=1/0,o=-1/0,s=-1/0,a=-1/0;for(let l=0,u=t.count;l<u;l++){const h=t.getX(l),d=t.getY(l),p=t.getZ(l);h<e&&(e=h),d<i&&(i=d),p<r&&(r=p),h>o&&(o=h),d>s&&(s=d),p>a&&(a=p)}return this.min.set(e,i,r),this.max.set(o,s,a),this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const i=Qr.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),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(),to.copy(e.boundingBox),to.applyMatrix4(t.matrixWorld),this.union(to));const i=t.children;for(let r=0,o=i.length;r<o;r++)this.expandByObject(i[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,Qr),Qr.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(zl),ka.subVectors(this.max,zl),pr.subVectors(t.a,zl),Ur.subVectors(t.b,zl),Jn.subVectors(t.c,zl),Go.subVectors(Ur,pr),Ho.subVectors(Jn,Ur),ta.subVectors(pr,Jn);let e=[0,-Go.z,Go.y,0,-Ho.z,Ho.y,0,-ta.z,ta.y,Go.z,0,-Go.x,Ho.z,0,-Ho.x,ta.z,0,-ta.x,-Go.y,Go.x,0,-Ho.y,Ho.x,0,-ta.y,ta.x,0];return!!id(e,pr,Ur,Jn,ka)&&(e=[1,0,0,0,1,0,0,0,1],!!id(e,pr,Ur,Jn,ka)&&(ps.crossVectors(Go,Ho),e=[ps.x,ps.y,ps.z],id(e,pr,Ur,Jn,ka)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return Qr.copy(t).clamp(this.min,this.max).sub(t).length()}getBoundingSphere(t){return this.getCenter(t.center),t.radius=.5*this.getSize(Qr).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()||(oi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),oi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),oi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),oi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),oi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),oi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),oi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),oi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(oi)),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)}}Yi.prototype.isBox3=!0;const oi=[new S,new S,new S,new S,new S,new S,new S,new S],Qr=new S,to=new Yi,pr=new S,Ur=new S,Jn=new S,Go=new S,Ho=new S,ta=new S,zl=new S,ka=new S,ps=new S,go=new S;function id(n,t,e,i,r){for(let o=0,s=n.length-3;o<=s;o+=3){go.fromArray(n,o);const a=r.x*Math.abs(go.x)+r.y*Math.abs(go.y)+r.z*Math.abs(go.z),l=t.dot(go),u=e.dot(go),h=i.dot(go);if(Math.max(-Math.max(l,u,h),Math.min(l,u,h))>a)return!1}return!0}const lf=new Yi,vo=new S,jl=new S,zo=new S;class En{constructor(t=new S,e=-1){this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const i=this.center;e!==void 0?i.copy(e):lf.setFromPoints(t).getCenter(i);let r=0;for(let o=0,s=t.length;o<s;o++)r=Math.max(r,i.distanceToSquared(t[o]));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 i=this.center.distanceToSquared(t);return e.copy(t),i>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){zo.subVectors(t,this.center);const e=zo.lengthSq();if(e>this.radius*this.radius){const i=Math.sqrt(e),r=.5*(i-this.radius);this.center.add(zo.multiplyScalar(r/i)),this.radius+=r}return this}union(t){return jl.subVectors(t.center,this.center).normalize().multiplyScalar(t.radius),this.expandByPoint(vo.copy(t.center).add(jl)),this.expandByPoint(vo.copy(t.center).sub(jl)),this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}}const _o=new S,fh=new S,fs=new S,nr=new S,mh=new S,gh=new S,Ua=new S;class jo{constructor(t=new S,e=new S(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,_o)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(i).add(this.origin)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=_o.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(_o.copy(this.direction).multiplyScalar(e).add(this.origin),_o.distanceToSquared(t))}distanceSqToSegment(t,e,i,r){fh.copy(t).add(e).multiplyScalar(.5),fs.copy(e).sub(t).normalize(),nr.copy(this.origin).sub(fh);const o=.5*t.distanceTo(e),s=-this.direction.dot(fs),a=nr.dot(this.direction),l=-nr.dot(fs),u=nr.lengthSq(),h=Math.abs(1-s*s);let d,p,m,g;if(h>0)if(d=s*l-a,p=s*a-l,g=o*h,d>=0)if(p>=-g)if(p<=g){const _=1/h;d*=_,p*=_,m=d*(d+s*p+2*a)+p*(s*d+p+2*l)+u}else p=o,d=Math.max(0,-(s*p+a)),m=-d*d+p*(p+2*l)+u;else p=-o,d=Math.max(0,-(s*p+a)),m=-d*d+p*(p+2*l)+u;else p<=-g?(d=Math.max(0,-(-s*o+a)),p=d>0?-o:Math.min(Math.max(-o,-l),o),m=-d*d+p*(p+2*l)+u):p<=g?(d=0,p=Math.min(Math.max(-o,-l),o),m=p*(p+2*l)+u):(d=Math.max(0,-(s*o+a)),p=d>0?o:Math.min(Math.max(-o,-l),o),m=-d*d+p*(p+2*l)+u);else p=s>0?-o:o,d=Math.max(0,-(s*p+a)),m=-d*d+p*(p+2*l)+u;return i&&i.copy(this.direction).multiplyScalar(d).add(this.origin),r&&r.copy(fs).multiplyScalar(p).add(fh),m}intersectSphere(t,e){_o.subVectors(t.center,this.origin);const i=_o.dot(this.direction),r=_o.dot(_o)-i*i,o=t.radius*t.radius;if(r>o)return null;const s=Math.sqrt(o-r),a=i-s,l=i+s;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 i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}intersectPlane(t,e){const i=this.distanceToPlane(t);return i===null?null:this.at(i,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return e===0?!0:t.normal.dot(this.direction)*e<0}intersectBox(t,e){let i,r,o,s,a,l;const u=1/this.direction.x,h=1/this.direction.y,d=1/this.direction.z,p=this.origin;return u>=0?(i=(t.min.x-p.x)*u,r=(t.max.x-p.x)*u):(i=(t.max.x-p.x)*u,r=(t.min.x-p.x)*u),h>=0?(o=(t.min.y-p.y)*h,s=(t.max.y-p.y)*h):(o=(t.max.y-p.y)*h,s=(t.min.y-p.y)*h),i>s||o>r?null:((o>i||i!=i)&&(i=o),(s<r||r!=r)&&(r=s),d>=0?(a=(t.min.z-p.z)*d,l=(t.max.z-p.z)*d):(a=(t.max.z-p.z)*d,l=(t.min.z-p.z)*d),i>l||a>r?null:((a>i||i!=i)&&(i=a),(l<r||r!=r)&&(r=l),r<0?null:this.at(i>=0?i:r,e)))}intersectsBox(t){return this.intersectBox(t,_o)!==null}intersectTriangle(t,e,i,r,o){mh.subVectors(e,t),gh.subVectors(i,t),Ua.crossVectors(mh,gh);let s,a=this.direction.dot(Ua);if(a>0){if(r)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}nr.subVectors(this.origin,t);const l=s*this.direction.dot(gh.crossVectors(nr,gh));if(l<0)return null;const u=s*this.direction.dot(mh.cross(nr));if(u<0||l+u>a)return null;const h=-s*nr.dot(Ua);return h<0?null:this.at(h/a,o)}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 Ee{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,i,r,o,s,a,l,u,h,d,p,m,g,_,y){const w=this.elements;return w[0]=t,w[4]=e,w[8]=i,w[12]=r,w[1]=o,w[5]=s,w[9]=a,w[13]=l,w[2]=u,w[6]=h,w[10]=d,w[14]=p,w[3]=m,w[7]=g,w[11]=_,w[15]=y,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 Ee().fromArray(this.elements)}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}copyPosition(t){const e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[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,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,i=t.elements,r=1/ms.setFromMatrixColumn(t,0).length(),o=1/ms.setFromMatrixColumn(t,1).length(),s=1/ms.setFromMatrixColumn(t,2).length();return e[0]=i[0]*r,e[1]=i[1]*r,e[2]=i[2]*r,e[3]=0,e[4]=i[4]*o,e[5]=i[5]*o,e[6]=i[6]*o,e[7]=0,e[8]=i[8]*s,e[9]=i[9]*s,e[10]=i[10]*s,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,i=t.x,r=t.y,o=t.z,s=Math.cos(i),a=Math.sin(i),l=Math.cos(r),u=Math.sin(r),h=Math.cos(o),d=Math.sin(o);if(t.order==="XYZ"){const p=s*h,m=s*d,g=a*h,_=a*d;e[0]=l*h,e[4]=-l*d,e[8]=u,e[1]=m+g*u,e[5]=p-_*u,e[9]=-a*l,e[2]=_-p*u,e[6]=g+m*u,e[10]=s*l}else if(t.order==="YXZ"){const p=l*h,m=l*d,g=u*h,_=u*d;e[0]=p+_*a,e[4]=g*a-m,e[8]=s*u,e[1]=s*d,e[5]=s*h,e[9]=-a,e[2]=m*a-g,e[6]=_+p*a,e[10]=s*l}else if(t.order==="ZXY"){const p=l*h,m=l*d,g=u*h,_=u*d;e[0]=p-_*a,e[4]=-s*d,e[8]=g+m*a,e[1]=m+g*a,e[5]=s*h,e[9]=_-p*a,e[2]=-s*u,e[6]=a,e[10]=s*l}else if(t.order==="ZYX"){const p=s*h,m=s*d,g=a*h,_=a*d;e[0]=l*h,e[4]=g*u-m,e[8]=p*u+_,e[1]=l*d,e[5]=_*u+p,e[9]=m*u-g,e[2]=-u,e[6]=a*l,e[10]=s*l}else if(t.order==="YZX"){const p=s*l,m=s*u,g=a*l,_=a*u;e[0]=l*h,e[4]=_-p*d,e[8]=g*d+m,e[1]=d,e[5]=s*h,e[9]=-a*h,e[2]=-u*h,e[6]=m*d+g,e[10]=p-_*d}else if(t.order==="XZY"){const p=s*l,m=s*u,g=a*l,_=a*u;e[0]=l*h,e[4]=-d,e[8]=u*h,e[1]=p*d+_,e[5]=s*h,e[9]=m*d-g,e[2]=g*d-m,e[6]=a*h,e[10]=_*d+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(yo,t,nd)}lookAt(t,e,i){const r=this.elements;return fr.subVectors(t,e),fr.lengthSq()===0&&(fr.z=1),fr.normalize(),eo.crossVectors(i,fr),eo.lengthSq()===0&&(Math.abs(i.z)===1?fr.x+=1e-4:fr.z+=1e-4,fr.normalize(),eo.crossVectors(i,fr)),eo.normalize(),xo.crossVectors(fr,eo),r[0]=eo.x,r[4]=xo.x,r[8]=fr.x,r[1]=eo.y,r[5]=xo.y,r[9]=fr.y,r[2]=eo.z,r[6]=xo.z,r[10]=fr.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 i=t.elements,r=e.elements,o=this.elements,s=i[0],a=i[4],l=i[8],u=i[12],h=i[1],d=i[5],p=i[9],m=i[13],g=i[2],_=i[6],y=i[10],w=i[14],A=i[3],I=i[7],F=i[11],N=i[15],U=r[0],B=r[4],G=r[8],ct=r[12],it=r[1],tt=r[5],rt=r[9],et=r[13],pt=r[2],kt=r[6],Lt=r[10],_t=r[14],xt=r[3],jt=r[7],ee=r[11],le=r[15];return o[0]=s*U+a*it+l*pt+u*xt,o[4]=s*B+a*tt+l*kt+u*jt,o[8]=s*G+a*rt+l*Lt+u*ee,o[12]=s*ct+a*et+l*_t+u*le,o[1]=h*U+d*it+p*pt+m*xt,o[5]=h*B+d*tt+p*kt+m*jt,o[9]=h*G+d*rt+p*Lt+m*ee,o[13]=h*ct+d*et+p*_t+m*le,o[2]=g*U+_*it+y*pt+w*xt,o[6]=g*B+_*tt+y*kt+w*jt,o[10]=g*G+_*rt+y*Lt+w*ee,o[14]=g*ct+_*et+y*_t+w*le,o[3]=A*U+I*it+F*pt+N*xt,o[7]=A*B+I*tt+F*kt+N*jt,o[11]=A*G+I*rt+F*Lt+N*ee,o[15]=A*ct+I*et+F*_t+N*le,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],i=t[4],r=t[8],o=t[12],s=t[1],a=t[5],l=t[9],u=t[13],h=t[2],d=t[6],p=t[10],m=t[14];return t[3]*(+o*l*d-r*u*d-o*a*p+i*u*p+r*a*m-i*l*m)+t[7]*(+e*l*m-e*u*p+o*s*p-r*s*m+r*u*h-o*l*h)+t[11]*(+e*u*d-e*a*m-o*s*d+i*s*m+o*a*h-i*u*h)+t[15]*(-r*a*h-e*l*d+e*a*p+r*s*d-i*s*p+i*l*h)}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,i){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]=i),this}invert(){const t=this.elements,e=t[0],i=t[1],r=t[2],o=t[3],s=t[4],a=t[5],l=t[6],u=t[7],h=t[8],d=t[9],p=t[10],m=t[11],g=t[12],_=t[13],y=t[14],w=t[15],A=d*y*u-_*p*u+_*l*m-a*y*m-d*l*w+a*p*w,I=g*p*u-h*y*u-g*l*m+s*y*m+h*l*w-s*p*w,F=h*_*u-g*d*u+g*a*m-s*_*m-h*a*w+s*d*w,N=g*d*l-h*_*l-g*a*p+s*_*p+h*a*y-s*d*y,U=e*A+i*I+r*F+o*N;if(U===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const B=1/U;return t[0]=A*B,t[1]=(_*p*o-d*y*o-_*r*m+i*y*m+d*r*w-i*p*w)*B,t[2]=(a*y*o-_*l*o+_*r*u-i*y*u-a*r*w+i*l*w)*B,t[3]=(d*l*o-a*p*o-d*r*u+i*p*u+a*r*m-i*l*m)*B,t[4]=I*B,t[5]=(h*y*o-g*p*o+g*r*m-e*y*m-h*r*w+e*p*w)*B,t[6]=(g*l*o-s*y*o-g*r*u+e*y*u+s*r*w-e*l*w)*B,t[7]=(s*p*o-h*l*o+h*r*u-e*p*u-s*r*m+e*l*m)*B,t[8]=F*B,t[9]=(g*d*o-h*_*o-g*i*m+e*_*m+h*i*w-e*d*w)*B,t[10]=(s*_*o-g*a*o+g*i*u-e*_*u-s*i*w+e*a*w)*B,t[11]=(h*a*o-s*d*o-h*i*u+e*d*u+s*i*m-e*a*m)*B,t[12]=N*B,t[13]=(h*_*r-g*d*r+g*i*p-e*_*p-h*i*y+e*d*y)*B,t[14]=(g*a*r-s*_*r-g*i*l+e*_*l+s*i*y-e*a*y)*B,t[15]=(s*d*r-h*a*r+h*i*l-e*d*l-s*i*p+e*a*p)*B,this}scale(t){const e=this.elements,i=t.x,r=t.y,o=t.z;return e[0]*=i,e[4]*=r,e[8]*=o,e[1]*=i,e[5]*=r,e[9]*=o,e[2]*=i,e[6]*=r,e[10]*=o,e[3]*=i,e[7]*=r,e[11]*=o,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,r))}makeTranslation(t,e,i){return this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const i=Math.cos(e),r=Math.sin(e),o=1-i,s=t.x,a=t.y,l=t.z,u=o*s,h=o*a;return this.set(u*s+i,u*a-r*l,u*l+r*a,0,u*a+r*l,h*a+i,h*l-r*s,0,u*l-r*a,h*l+r*s,o*l*l+i,0,0,0,0,1),this}makeScale(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this}makeShear(t,e,i,r,o,s){return this.set(1,i,o,0,t,1,s,0,e,r,1,0,0,0,0,1),this}compose(t,e,i){const r=this.elements,o=e._x,s=e._y,a=e._z,l=e._w,u=o+o,h=s+s,d=a+a,p=o*u,m=o*h,g=o*d,_=s*h,y=s*d,w=a*d,A=l*u,I=l*h,F=l*d,N=i.x,U=i.y,B=i.z;return r[0]=(1-(_+w))*N,r[1]=(m+F)*N,r[2]=(g-I)*N,r[3]=0,r[4]=(m-F)*U,r[5]=(1-(p+w))*U,r[6]=(y+A)*U,r[7]=0,r[8]=(g+I)*B,r[9]=(y-A)*B,r[10]=(1-(p+_))*B,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,e,i){const r=this.elements;let o=ms.set(r[0],r[1],r[2]).length();const s=ms.set(r[4],r[5],r[6]).length(),a=ms.set(r[8],r[9],r[10]).length();this.determinant()<0&&(o=-o),t.x=r[12],t.y=r[13],t.z=r[14],Gr.copy(this);const l=1/o,u=1/s,h=1/a;return Gr.elements[0]*=l,Gr.elements[1]*=l,Gr.elements[2]*=l,Gr.elements[4]*=u,Gr.elements[5]*=u,Gr.elements[6]*=u,Gr.elements[8]*=h,Gr.elements[9]*=h,Gr.elements[10]*=h,e.setFromRotationMatrix(Gr),i.x=o,i.y=s,i.z=a,this}makePerspective(t,e,i,r,o,s){s===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*o/(e-t),u=2*o/(i-r),h=(e+t)/(e-t),d=(i+r)/(i-r),p=-(s+o)/(s-o),m=-2*s*o/(s-o);return a[0]=l,a[4]=0,a[8]=h,a[12]=0,a[1]=0,a[5]=u,a[9]=d,a[13]=0,a[2]=0,a[6]=0,a[10]=p,a[14]=m,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(t,e,i,r,o,s){const a=this.elements,l=1/(e-t),u=1/(i-r),h=1/(s-o),d=(e+t)*l,p=(i+r)*u,m=(s+o)*h;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-d,a[1]=0,a[5]=2*u,a[9]=0,a[13]=-p,a[2]=0,a[6]=0,a[10]=-2*h,a[14]=-m,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(t){const e=this.elements,i=t.elements;for(let r=0;r<16;r++)if(e[r]!==i[r])return!1;return!0}fromArray(t,e=0){for(let i=0;i<16;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}}Ee.prototype.isMatrix4=!0;const ms=new S,Gr=new Ee,yo=new S(0,0,0),nd=new S(1,1,1),eo=new S,xo=new S,fr=new S,Zn=new Ee,vh=new Nn;class ea{constructor(t=0,e=0,i=0,r=ea.DefaultOrder){this._x=t,this._y=e,this._z=i,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,i,r=this._order){return this._x=t,this._y=e,this._z=i,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,i=!0){const r=t.elements,o=r[0],s=r[4],a=r[8],l=r[1],u=r[5],h=r[9],d=r[2],p=r[6],m=r[10];switch(e){case"XYZ":this._y=Math.asin(zn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,m),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(p,u),this._z=0);break;case"YXZ":this._x=Math.asin(-zn(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,m),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-d,o),this._z=0);break;case"ZXY":this._x=Math.asin(zn(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-d,m),this._z=Math.atan2(-s,u)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-zn(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(p,m),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-s,u));break;case"YZX":this._z=Math.asin(zn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,u),this._y=Math.atan2(-d,o)):(this._x=0,this._y=Math.atan2(a,m));break;case"XZY":this._z=Math.asin(-zn(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(p,u),this._y=Math.atan2(a,o)):(this._x=Math.atan2(-h,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,i===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return Zn.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Zn,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return vh.setFromEuler(this),this.setFromQuaternion(vh,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 S(this._x,this._y,this._z)}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}ea.prototype.isEuler=!0,ea.DefaultOrder="XYZ",ea.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class rd{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 od=0;const Ga=new S,ia=new Nn,Rr=new Ee,Ha=new S,za=new S,uf=new S,sd=new Nn,hf=new S(1,0,0),_h=new S(0,1,0),ad=new S(0,0,1),cf={type:"added"},ld={type:"removed"};class hi extends ko{constructor(){super(),Object.defineProperty(this,"id",{value:od++}),this.uuid=Ar(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=hi.DefaultUp.clone();const t=new S,e=new ea,i=new Nn,r=new S(1,1,1);e._onChange(function(){i.setFromEuler(e,!1)}),i._onChange(function(){e.setFromQuaternion(i,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:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Ee},normalMatrix:{value:new zi}}),this.matrix=new Ee,this.matrixWorld=new Ee,this.matrixAutoUpdate=hi.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new rd,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 ia.setFromAxisAngle(t,e),this.quaternion.multiply(ia),this}rotateOnWorldAxis(t,e){return ia.setFromAxisAngle(t,e),this.quaternion.premultiply(ia),this}rotateX(t){return this.rotateOnAxis(hf,t)}rotateY(t){return this.rotateOnAxis(_h,t)}rotateZ(t){return this.rotateOnAxis(ad,t)}translateOnAxis(t,e){return Ga.copy(t).applyQuaternion(this.quaternion),this.position.add(Ga.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(hf,t)}translateY(t){return this.translateOnAxis(_h,t)}translateZ(t){return this.translateOnAxis(ad,t)}localToWorld(t){return t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return t.applyMatrix4(Rr.copy(this.matrixWorld).invert())}lookAt(t,e,i){t.isVector3?Ha.copy(t):Ha.set(t,e,i);const r=this.parent;this.updateWorldMatrix(!0,!1),za.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Rr.lookAt(za,Ha,this.up):Rr.lookAt(Ha,za,this.up),this.quaternion.setFromRotationMatrix(Rr),r&&(Rr.extractRotation(r.matrixWorld),ia.setFromRotationMatrix(Rr),this.quaternion.premultiply(ia.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(cf)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.remove(arguments[i]);return this}const e=this.children.indexOf(t);return e!==-1&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(ld)),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(ld)}return this.children.length=0,this}attach(t){return this.updateWorldMatrix(!0,!1),Rr.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),Rr.multiply(t.parent.matrixWorld)),t.applyMatrix4(Rr),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 i=0,r=this.children.length;i<r;i++){const o=this.children[i].getObjectByProperty(t,e);if(o!==void 0)return o}}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(za,t,uf),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(za,sd,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 i=0,r=e.length;i<r;i++)e[i].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);const e=this.children;for(let i=0,r=e.length;i<r;i++)e[i].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 i=0,r=e.length;i<r;i++)e[i].updateMatrixWorld(t)}updateWorldMatrix(t,e){const i=this.parent;if(t===!0&&i!==null&&i.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 o=0,s=r.length;o<s;o++)r[o].updateWorldMatrix(!1,!0)}}toJSON(t){const e=t===void 0||typeof t=="string",i={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{}},i.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const r={};function o(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=o(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 u=0,h=l.length;u<h;u++){const d=l[u];o(t.shapes,d)}else o(t.shapes,l)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(o(t.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const a=[];for(let l=0,u=this.material.length;l<u;l++)a.push(o(t.materials,this.material[l]));r.material=a}else r.material=o(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(o(t.animations,l))}}if(e){const a=s(t.geometries),l=s(t.materials),u=s(t.textures),h=s(t.images),d=s(t.shapes),p=s(t.skeletons),m=s(t.animations);a.length>0&&(i.geometries=a),l.length>0&&(i.materials=l),u.length>0&&(i.textures=u),h.length>0&&(i.images=h),d.length>0&&(i.shapes=d),p.length>0&&(i.skeletons=p),m.length>0&&(i.animations=m)}return i.object=r,i;function s(a){const l=[];for(const u in a){const h=a[u];delete h.metadata,l.push(h)}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 i=0;i<t.children.length;i++){const r=t.children[i];this.add(r.clone())}return this}}hi.DefaultUp=new S(0,1,0),hi.DefaultMatrixAutoUpdate=!0,hi.prototype.isObject3D=!0;const Hr=new S,bo=new S,yh=new S,io=new S,na=new S,gs=new S,xh=new S,ci=new S,ud=new S,hd=new S;class ji{constructor(t=new S,e=new S,i=new S){this.a=t,this.b=e,this.c=i}static getNormal(t,e,i,r){r.subVectors(i,e),Hr.subVectors(t,e),r.cross(Hr);const o=r.lengthSq();return o>0?r.multiplyScalar(1/Math.sqrt(o)):r.set(0,0,0)}static getBarycoord(t,e,i,r,o){Hr.subVectors(r,e),bo.subVectors(i,e),yh.subVectors(t,e);const s=Hr.dot(Hr),a=Hr.dot(bo),l=Hr.dot(yh),u=bo.dot(bo),h=bo.dot(yh),d=s*u-a*a;if(d===0)return o.set(-2,-1,-1);const p=1/d,m=(u*l-a*h)*p,g=(s*h-a*l)*p;return o.set(1-m-g,g,m)}static containsPoint(t,e,i,r){return this.getBarycoord(t,e,i,r,io),io.x>=0&&io.y>=0&&io.x+io.y<=1}static getUV(t,e,i,r,o,s,a,l){return this.getBarycoord(t,e,i,r,io),l.set(0,0),l.addScaledVector(o,io.x),l.addScaledVector(s,io.y),l.addScaledVector(a,io.z),l}static isFrontFacing(t,e,i,r){return Hr.subVectors(i,e),bo.subVectors(t,e),Hr.cross(bo).dot(r)<0}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,r){return this.a.copy(t[e]),this.b.copy(t[i]),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 Hr.subVectors(this.c,this.b),bo.subVectors(this.a,this.b),.5*Hr.cross(bo).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return ji.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return ji.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,i,r,o){return ji.getUV(t,this.a,this.b,this.c,e,i,r,o)}containsPoint(t){return ji.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return ji.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const i=this.a,r=this.b,o=this.c;let s,a;na.subVectors(r,i),gs.subVectors(o,i),ci.subVectors(t,i);const l=na.dot(ci),u=gs.dot(ci);if(l<=0&&u<=0)return e.copy(i);ud.subVectors(t,r);const h=na.dot(ud),d=gs.dot(ud);if(h>=0&&d<=h)return e.copy(r);const p=l*d-h*u;if(p<=0&&l>=0&&h<=0)return s=l/(l-h),e.copy(i).addScaledVector(na,s);hd.subVectors(t,o);const m=na.dot(hd),g=gs.dot(hd);if(g>=0&&m<=g)return e.copy(o);const _=m*u-l*g;if(_<=0&&u>=0&&g<=0)return a=u/(u-g),e.copy(i).addScaledVector(gs,a);const y=h*g-m*d;if(y<=0&&d-h>=0&&m-g>=0)return xh.subVectors(o,r),a=(d-h)/(d-h+(m-g)),e.copy(r).addScaledVector(xh,a);const w=1/(y+_+p);return s=_*w,a=p*w,e.copy(i).addScaledVector(na,s).addScaledVector(gs,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}let df=0;class Dn extends ko{constructor(){super(),Object.defineProperty(this,"id",{value:df++}),this.uuid=Ar(),this.name="",this.type="Material",this.fog=!0,this.blending=ot,this.side=j,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=ei,this.blendDst=Ze,this.blendEquation=Et,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=On,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Bl,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Ei,this.stencilZFail=Ei,this.stencilZPass=Ei,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 i=t[e];if(i===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=i===qt;continue}const r=this[e];r!==void 0?r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[e]=i: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 i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(o){const s=[];for(const a in o){const l=o[a];delete l.metadata,s.push(l)}return s}if(i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(i.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==ot&&(i.blending=this.blending),this.side!==j&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.colorWrite=this.colorWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,this.rotation&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(i.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.morphTargets===!0&&(i.morphTargets=!0),this.morphNormals===!0&&(i.morphNormals=!0),this.flatShading===!0&&(i.flatShading=this.flatShading),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(i.userData=this.userData),e){const o=r(t.textures),s=r(t.images);o.length>0&&(i.textures=o),s.length>0&&(i.images=s)}return i}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 i=null;if(e!==null){const r=e.length;i=new Array(r);for(let o=0;o!==r;++o)i[o]=e[o].clone()}return this.clippingPlanes=i,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++}}Dn.prototype.isMaterial=!0;const pf={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},ln={h:0,s:0,l:0},bh={h:0,s:0,l:0};function ja(n,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?n+6*(t-n)*e:e<.5?t:e<2/3?n+6*(t-n)*(2/3-e):n}function Vl(n){return n<.04045?.0773993808*n:Math.pow(.9478672986*n+.0521327014,2.4)}function wh(n){return n<.0031308?12.92*n:1.055*Math.pow(n,.41666)-.055}class Le{constructor(t,e,i){return e===void 0&&i===void 0?this.set(t):this.setRGB(t,e,i)}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,i){return this.r=t,this.g=e,this.b=i,this}setHSL(t,e,i){if(t=dh(t,1),e=zn(e,0,1),i=zn(i,0,1),e===0)this.r=this.g=this.b=i;else{const r=i<=.5?i*(1+e):i+e-i*e,o=2*i-r;this.r=ja(o,r,t+1/3),this.g=ja(o,r,t),this.b=ja(o,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 i;if(i=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let r;const o=i[1],s=i[2];switch(o){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))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(s))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(s)){const a=parseFloat(r[1])/360,l=parseInt(r[2],10)/100,u=parseInt(r[3],10)/100;return e(r[4]),this.setHSL(a,l,u)}}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){const r=i[1],o=r.length;if(o===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(o===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=pf[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 i=e>0?1/e:1;return this.r=Math.pow(t.r,i),this.g=Math.pow(t.g,i),this.b=Math.pow(t.b,i),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.r=Vl(t.r),this.g=Vl(t.g),this.b=Vl(t.b),this}copyLinearToSRGB(t){return this.r=wh(t.r),this.g=wh(t.g),this.b=wh(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,i=this.g,r=this.b,o=Math.max(e,i,r),s=Math.min(e,i,r);let a,l;const u=(s+o)/2;if(s===o)a=0,l=0;else{const h=o-s;switch(l=u<=.5?h/(o+s):h/(2-o-s),o){case e:a=(i-r)/h+(i<r?6:0);break;case i:a=(r-e)/h+2;break;case r:a=(e-i)/h+4}a/=6}return t.h=a,t.s=l,t.l=u,t}getStyle(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"}offsetHSL(t,e,i){return this.getHSL(ln),ln.h+=t,ln.s+=e,ln.l+=i,this.setHSL(ln.h,ln.s,ln.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,i){return this.r=t.r+(e.r-t.r)*i,this.g=t.g+(e.g-t.g)*i,this.b=t.b+(e.b-t.b)*i,this}lerpHSL(t,e){this.getHSL(ln),t.getHSL(bh);const i=kl(ln.h,bh.h,e),r=kl(ln.s,bh.s,e),o=kl(ln.l,bh.l,e);return this.setHSL(i,r,o),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()}}Le.NAMES=pf,Le.prototype.isColor=!0,Le.prototype.r=1,Le.prototype.g=1,Le.prototype.b=1;class pn extends Dn{constructor(t){super(),this.type="MeshBasicMaterial",this.color=new Le(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=Hs,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}}pn.prototype.isMeshBasicMaterial=!0;const Si=new S,Va=new ce;class mi{constructor(t,e,i){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=i===!0,this.usage=Js,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,i){t*=this.itemSize,i*=e.itemSize;for(let r=0,o=this.itemSize;r<o;r++)this.array[t+r]=e.array[i+r];return this}copyArray(t){return this.array.set(t),this}copyColorsArray(t){const e=this.array;let i=0;for(let r=0,o=t.length;r<o;r++){let s=t[r];s===void 0&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),s=new Le),e[i++]=s.r,e[i++]=s.g,e[i++]=s.b}return this}copyVector2sArray(t){const e=this.array;let i=0;for(let r=0,o=t.length;r<o;r++){let s=t[r];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),s=new ce),e[i++]=s.x,e[i++]=s.y}return this}copyVector3sArray(t){const e=this.array;let i=0;for(let r=0,o=t.length;r<o;r++){let s=t[r];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),s=new S),e[i++]=s.x,e[i++]=s.y,e[i++]=s.z}return this}copyVector4sArray(t){const e=this.array;let i=0;for(let r=0,o=t.length;r<o;r++){let s=t[r];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),s=new Li),e[i++]=s.x,e[i++]=s.y,e[i++]=s.z,e[i++]=s.w}return this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,i=this.count;e<i;e++)Va.fromBufferAttribute(this,e),Va.applyMatrix3(t),this.setXY(e,Va.x,Va.y);else if(this.itemSize===3)for(let e=0,i=this.count;e<i;e++)Si.fromBufferAttribute(this,e),Si.applyMatrix3(t),this.setXYZ(e,Si.x,Si.y,Si.z);return this}applyMatrix4(t){for(let e=0,i=this.count;e<i;e++)Si.x=this.getX(e),Si.y=this.getY(e),Si.z=this.getZ(e),Si.applyMatrix4(t),this.setXYZ(e,Si.x,Si.y,Si.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)Si.x=this.getX(e),Si.y=this.getY(e),Si.z=this.getZ(e),Si.applyNormalMatrix(t),this.setXYZ(e,Si.x,Si.y,Si.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)Si.x=this.getX(e),Si.y=this.getY(e),Si.z=this.getZ(e),Si.transformDirection(t),this.setXYZ(e,Si.x,Si.y,Si.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,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this}setXYZ(t,e,i,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=r,this}setXYZW(t,e,i,r,o){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=r,this.array[t+3]=o,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!==Js&&(t.usage=this.usage),this.updateRange.offset===0&&this.updateRange.count===-1||(t.updateRange=this.updateRange),t}}mi.prototype.isBufferAttribute=!0;class Wl extends mi{constructor(t,e,i){super(new Int8Array(t),e,i)}}class cd extends mi{constructor(t,e,i){super(new Uint8Array(t),e,i)}}class Sh extends mi{constructor(t,e,i){super(new Uint8ClampedArray(t),e,i)}}class dd extends mi{constructor(t,e,i){super(new Int16Array(t),e,i)}}class Wa extends mi{constructor(t,e,i){super(new Uint16Array(t),e,i)}}class Th extends mi{constructor(t,e,i){super(new Int32Array(t),e,i)}}class no extends mi{constructor(t,e,i){super(new Uint32Array(t),e,i)}}class ff extends mi{constructor(t,e,i){super(new Uint16Array(t),e,i)}}ff.prototype.isFloat16BufferAttribute=!0;class _e extends mi{constructor(t,e,i){super(new Float32Array(t),e,i)}}class pd extends mi{constructor(t,e,i){super(new Float64Array(t),e,i)}}function fd(n){if(n.length===0)return-1/0;let t=n[0];for(let e=1,i=n.length;e<i;++e)n[e]>t&&(t=n[e]);return t}const md={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function ra(n,t){return new md[n](t)}let mf=0;const Cr=new Ee,Eh=new hi,Mn=new S,un=new Yi,vs=new Yi,en=new S;class ze extends ko{constructor(){super(),Object.defineProperty(this,"id",{value:mf++}),this.uuid=Ar(),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(fd(t)>65535?no:Wa)(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,i=0){this.groups.push({start:t,count:e,materialIndex:i})}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 i=this.attributes.normal;if(i!==void 0){const o=new zi().getNormalMatrix(t);i.applyNormalMatrix(o),i.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 Cr.makeRotationFromQuaternion(t),this.applyMatrix4(Cr),this}rotateX(t){return Cr.makeRotationX(t),this.applyMatrix4(Cr),this}rotateY(t){return Cr.makeRotationY(t),this.applyMatrix4(Cr),this}rotateZ(t){return Cr.makeRotationZ(t),this.applyMatrix4(Cr),this}translate(t,e,i){return Cr.makeTranslation(t,e,i),this.applyMatrix4(Cr),this}scale(t,e,i){return Cr.makeScale(t,e,i),this.applyMatrix4(Cr),this}lookAt(t){return Eh.lookAt(t),Eh.updateMatrix(),this.applyMatrix4(Eh.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Mn).negate(),this.translate(Mn.x,Mn.y,Mn.z),this}setFromPoints(t){const e=[];for(let i=0,r=t.length;i<r;i++){const o=t[i];e.push(o.x,o.y,o.z||0)}return this.setAttribute("position",new _e(e,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Yi);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 S(-1/0,-1/0,-1/0),new S(1/0,1/0,1/0));if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let i=0,r=e.length;i<r;i++){const o=e[i];un.setFromBufferAttribute(o),this.morphTargetsRelative?(en.addVectors(this.boundingBox.min,un.min),this.boundingBox.expandByPoint(en),en.addVectors(this.boundingBox.max,un.max),this.boundingBox.expandByPoint(en)):(this.boundingBox.expandByPoint(un.min),this.boundingBox.expandByPoint(un.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 En);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 S,1/0);if(t){const i=this.boundingSphere.center;if(un.setFromBufferAttribute(t),e)for(let o=0,s=e.length;o<s;o++){const a=e[o];vs.setFromBufferAttribute(a),this.morphTargetsRelative?(en.addVectors(un.min,vs.min),un.expandByPoint(en),en.addVectors(un.max,vs.max),un.expandByPoint(en)):(un.expandByPoint(vs.min),un.expandByPoint(vs.max))}un.getCenter(i);let r=0;for(let o=0,s=t.count;o<s;o++)en.fromBufferAttribute(t,o),r=Math.max(r,i.distanceToSquared(en));if(e)for(let o=0,s=e.length;o<s;o++){const a=e[o],l=this.morphTargetsRelative;for(let u=0,h=a.count;u<h;u++)en.fromBufferAttribute(a,u),l&&(Mn.fromBufferAttribute(t,u),en.add(Mn)),r=Math.max(r,i.distanceToSquared(en))}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 i=t.array,r=e.position.array,o=e.normal.array,s=e.uv.array,a=r.length/3;e.tangent===void 0&&this.setAttribute("tangent",new mi(new Float32Array(4*a),4));const l=e.tangent.array,u=[],h=[];for(let it=0;it<a;it++)u[it]=new S,h[it]=new S;const d=new S,p=new S,m=new S,g=new ce,_=new ce,y=new ce,w=new S,A=new S;function I(it,tt,rt){d.fromArray(r,3*it),p.fromArray(r,3*tt),m.fromArray(r,3*rt),g.fromArray(s,2*it),_.fromArray(s,2*tt),y.fromArray(s,2*rt),p.sub(d),m.sub(d),_.sub(g),y.sub(g);const et=1/(_.x*y.y-y.x*_.y);isFinite(et)&&(w.copy(p).multiplyScalar(y.y).addScaledVector(m,-_.y).multiplyScalar(et),A.copy(m).multiplyScalar(_.x).addScaledVector(p,-y.x).multiplyScalar(et),u[it].add(w),u[tt].add(w),u[rt].add(w),h[it].add(A),h[tt].add(A),h[rt].add(A))}let F=this.groups;F.length===0&&(F=[{start:0,count:i.length}]);for(let it=0,tt=F.length;it<tt;++it){const rt=F[it],et=rt.start;for(let pt=et,kt=et+rt.count;pt<kt;pt+=3)I(i[pt+0],i[pt+1],i[pt+2])}const N=new S,U=new S,B=new S,G=new S;function ct(it){B.fromArray(o,3*it),G.copy(B);const tt=u[it];N.copy(tt),N.sub(B.multiplyScalar(B.dot(tt))).normalize(),U.crossVectors(G,tt);const rt=U.dot(h[it])<0?-1:1;l[4*it]=N.x,l[4*it+1]=N.y,l[4*it+2]=N.z,l[4*it+3]=rt}for(let it=0,tt=F.length;it<tt;++it){const rt=F[it],et=rt.start;for(let pt=et,kt=et+rt.count;pt<kt;pt+=3)ct(i[pt+0]),ct(i[pt+1]),ct(i[pt+2])}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(e!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new mi(new Float32Array(3*e.count),3),this.setAttribute("normal",i);else for(let p=0,m=i.count;p<m;p++)i.setXYZ(p,0,0,0);const r=new S,o=new S,s=new S,a=new S,l=new S,u=new S,h=new S,d=new S;if(t)for(let p=0,m=t.count;p<m;p+=3){const g=t.getX(p+0),_=t.getX(p+1),y=t.getX(p+2);r.fromBufferAttribute(e,g),o.fromBufferAttribute(e,_),s.fromBufferAttribute(e,y),h.subVectors(s,o),d.subVectors(r,o),h.cross(d),a.fromBufferAttribute(i,g),l.fromBufferAttribute(i,_),u.fromBufferAttribute(i,y),a.add(h),l.add(h),u.add(h),i.setXYZ(g,a.x,a.y,a.z),i.setXYZ(_,l.x,l.y,l.z),i.setXYZ(y,u.x,u.y,u.z)}else for(let p=0,m=e.count;p<m;p+=3)r.fromBufferAttribute(e,p+0),o.fromBufferAttribute(e,p+1),s.fromBufferAttribute(e,p+2),h.subVectors(s,o),d.subVectors(r,o),h.cross(d),i.setXYZ(p+0,h.x,h.y,h.z),i.setXYZ(p+1,h.x,h.y,h.z),i.setXYZ(p+2,h.x,h.y,h.z);this.normalizeNormals(),i.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 i=this.attributes;for(const r in i){if(t.attributes[r]===void 0)continue;const o=i[r].array,s=t.attributes[r],a=s.array,l=s.itemSize*e,u=Math.min(a.length,o.length-l);for(let h=0,d=l;h<u;h++,d++)o[d]=a[h]}return this}normalizeNormals(){const t=this.attributes.normal;for(let e=0,i=t.count;e<i;e++)en.fromBufferAttribute(t,e),en.normalize(),t.setXYZ(e,en.x,en.y,en.z)}toNonIndexed(){function t(a,l){const u=a.array,h=a.itemSize,d=a.normalized,p=new u.constructor(l.length*h);let m=0,g=0;for(let _=0,y=l.length;_<y;_++){m=a.isInterleavedBufferAttribute?l[_]*a.data.stride+a.offset:l[_]*h;for(let w=0;w<h;w++)p[g++]=u[m++]}return new mi(p,h,d)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new ze,i=this.index.array,r=this.attributes;for(const a in r){const l=t(r[a],i);e.setAttribute(a,l)}const o=this.morphAttributes;for(const a in o){const l=[],u=o[a];for(let h=0,d=u.length;h<d;h++){const p=t(u[h],i);l.push(p)}e.morphAttributes[a]=l}e.morphTargetsRelative=this.morphTargetsRelative;const s=this.groups;for(let a=0,l=s.length;a<l;a++){const u=s[a];e.addGroup(u.start,u.count,u.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 u in l)l[u]!==void 0&&(t[u]=l[u]);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 i=this.attributes;for(const l in i){const u=i[l];t.data.attributes[l]=u.toJSON(t.data)}const r={};let o=!1;for(const l in this.morphAttributes){const u=this.morphAttributes[l],h=[];for(let d=0,p=u.length;d<p;d++){const m=u[d];h.push(m.toJSON(t.data))}h.length>0&&(r[l]=h,o=!0)}o&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return a!==null&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t}clone(){return new ze().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 i=t.index;i!==null&&this.setIndex(i.clone(e));const r=t.attributes;for(const u in r){const h=r[u];this.setAttribute(u,h.clone(e))}const o=t.morphAttributes;for(const u in o){const h=[],d=o[u];for(let p=0,m=d.length;p<m;p++)h.push(d[p].clone(e));this.morphAttributes[u]=h}this.morphTargetsRelative=t.morphTargetsRelative;const s=t.groups;for(let u=0,h=s.length;u<h;u++){const d=s[u];this.addGroup(d.start,d.count,d.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"})}}ze.prototype.isBufferGeometry=!0;const gd=new Ee,oa=new jo,_s=new En,zr=new S,Vo=new S,Wo=new S,Xa=new S,Mh=new S,qa=new S,Ya=new S,sa=new S,Xl=new S,aa=new ce,ql=new ce,$a=new ce,vd=new S,Yl=new S;class Ti extends hi{constructor(t=new ze,e=new pn){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,i=Object.keys(e);if(i.length>0){const r=e[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=r.length;o<s;o++){const a=r[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=o}}}}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 i=this.geometry,r=this.material,o=this.matrixWorld;if(r===void 0||(i.boundingSphere===null&&i.computeBoundingSphere(),_s.copy(i.boundingSphere),_s.applyMatrix4(o),t.ray.intersectsSphere(_s)===!1)||(gd.copy(o).invert(),oa.copy(t.ray).applyMatrix4(gd),i.boundingBox!==null&&oa.intersectsBox(i.boundingBox)===!1))return;let s;if(i.isBufferGeometry){const a=i.index,l=i.attributes.position,u=i.morphAttributes.position,h=i.morphTargetsRelative,d=i.attributes.uv,p=i.attributes.uv2,m=i.groups,g=i.drawRange;if(a!==null)if(Array.isArray(r))for(let _=0,y=m.length;_<y;_++){const w=m[_],A=r[w.materialIndex];for(let I=Math.max(w.start,g.start),F=Math.min(w.start+w.count,g.start+g.count);I<F;I+=3){const N=a.getX(I),U=a.getX(I+1),B=a.getX(I+2);s=$l(this,A,t,oa,l,u,h,d,p,N,U,B),s&&(s.faceIndex=Math.floor(I/3),s.face.materialIndex=w.materialIndex,e.push(s))}}else for(let _=Math.max(0,g.start),y=Math.min(a.count,g.start+g.count);_<y;_+=3){const w=a.getX(_),A=a.getX(_+1),I=a.getX(_+2);s=$l(this,r,t,oa,l,u,h,d,p,w,A,I),s&&(s.faceIndex=Math.floor(_/3),e.push(s))}else if(l!==void 0)if(Array.isArray(r))for(let _=0,y=m.length;_<y;_++){const w=m[_],A=r[w.materialIndex];for(let I=Math.max(w.start,g.start),F=Math.min(w.start+w.count,g.start+g.count);I<F;I+=3)s=$l(this,A,t,oa,l,u,h,d,p,I,I+1,I+2),s&&(s.faceIndex=Math.floor(I/3),s.face.materialIndex=w.materialIndex,e.push(s))}else for(let _=Math.max(0,g.start),y=Math.min(l.count,g.start+g.count);_<y;_+=3)s=$l(this,r,t,oa,l,u,h,d,p,_,_+1,_+2),s&&(s.faceIndex=Math.floor(_/3),e.push(s))}else i.isGeometry&&console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}function $l(n,t,e,i,r,o,s,a,l,u,h,d){zr.fromBufferAttribute(r,u),Vo.fromBufferAttribute(r,h),Wo.fromBufferAttribute(r,d);const p=n.morphTargetInfluences;if(t.morphTargets&&o&&p){Ya.set(0,0,0),sa.set(0,0,0),Xl.set(0,0,0);for(let g=0,_=o.length;g<_;g++){const y=p[g],w=o[g];y!==0&&(Xa.fromBufferAttribute(w,u),Mh.fromBufferAttribute(w,h),qa.fromBufferAttribute(w,d),s?(Ya.addScaledVector(Xa,y),sa.addScaledVector(Mh,y),Xl.addScaledVector(qa,y)):(Ya.addScaledVector(Xa.sub(zr),y),sa.addScaledVector(Mh.sub(Vo),y),Xl.addScaledVector(qa.sub(Wo),y)))}zr.add(Ya),Vo.add(sa),Wo.add(Xl)}n.isSkinnedMesh&&(n.boneTransform(u,zr),n.boneTransform(h,Vo),n.boneTransform(d,Wo));const m=function(g,_,y,w,A,I,F,N){let U;if(U=_.side===X?w.intersectTriangle(F,I,A,!0,N):w.intersectTriangle(A,I,F,_.side!==K,N),U===null)return null;Yl.copy(N),Yl.applyMatrix4(g.matrixWorld);const B=y.ray.origin.distanceTo(Yl);return B<y.near||B>y.far?null:{distance:B,point:Yl.clone(),object:g}}(n,t,e,i,zr,Vo,Wo,vd);if(m){a&&(aa.fromBufferAttribute(a,u),ql.fromBufferAttribute(a,h),$a.fromBufferAttribute(a,d),m.uv=ji.getUV(vd,zr,Vo,Wo,aa,ql,$a,new ce)),l&&(aa.fromBufferAttribute(l,u),ql.fromBufferAttribute(l,h),$a.fromBufferAttribute(l,d),m.uv2=ji.getUV(vd,zr,Vo,Wo,aa,ql,$a,new ce));const g={a:u,b:h,c:d,normal:new S,materialIndex:0};ji.getNormal(zr,Vo,Wo,g.normal),m.face=g}return m}Ti.prototype.isMesh=!0;class wo extends ze{constructor(t=1,e=1,i=1,r=1,o=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:r,heightSegments:o,depthSegments:s};const a=this;r=Math.floor(r),o=Math.floor(o),s=Math.floor(s);const l=[],u=[],h=[],d=[];let p=0,m=0;function g(_,y,w,A,I,F,N,U,B,G,ct){const it=F/B,tt=N/G,rt=F/2,et=N/2,pt=U/2,kt=B+1,Lt=G+1;let _t=0,xt=0;const jt=new S;for(let ee=0;ee<Lt;ee++){const le=ee*tt-et;for(let nt=0;nt<kt;nt++){const lt=nt*it-rt;jt[_]=lt*A,jt[y]=le*I,jt[w]=pt,u.push(jt.x,jt.y,jt.z),jt[_]=0,jt[y]=0,jt[w]=U>0?1:-1,h.push(jt.x,jt.y,jt.z),d.push(nt/B),d.push(1-ee/G),_t+=1}}for(let ee=0;ee<G;ee++)for(let le=0;le<B;le++){const nt=p+le+kt*ee,lt=p+le+kt*(ee+1),Xt=p+(le+1)+kt*(ee+1),Ut=p+(le+1)+kt*ee;l.push(nt,lt,Ut),l.push(lt,Xt,Ut),xt+=6}a.addGroup(m,xt,ct),m+=xt,p+=_t}g("z","y","x",-1,-1,i,e,t,s,o,0),g("z","y","x",1,-1,i,e,-t,s,o,1),g("x","z","y",1,1,t,i,e,r,s,2),g("x","z","y",1,-1,t,i,-e,r,s,3),g("x","y","z",1,-1,t,e,i,r,o,4),g("x","y","z",-1,-1,t,e,-i,r,o,5),this.setIndex(l),this.setAttribute("position",new _e(u,3)),this.setAttribute("normal",new _e(h,3)),this.setAttribute("uv",new _e(d,2))}static fromJSON(t){return new wo(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function Ja(n){const t={};for(const e in n){t[e]={};for(const i in n[e]){const r=n[e][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?t[e][i]=r.clone():Array.isArray(r)?t[e][i]=r.slice():t[e][i]=r}}return t}function jn(n){const t={};for(let e=0;e<n.length;e++){const i=Ja(n[e]);for(const r in i)t[r]=i[r]}return t}const So={clone:Ja,merge:jn};class rr extends Dn{constructor(t){super(),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=`void main() {
|
|
1831
|
+
*/const z="130",k={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Z={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},vt=0,Ot=1,Nt=2,E=3,L=0,O=1,Y=2,C=3,j=0,X=1,K=2,qt=1,ge=2,Ct=0,ot=1,yt=2,Pt=3,H=4,ft=5,Et=100,At=101,Rt=102,Wt=103,$t=104,ye=200,me=201,ui=202,be=203,ei=204,Ze=205,ri=206,De=207,Bi=208,Di=209,Ci=210,Ki=0,Ii=1,Ui=2,On=3,Qi=4,Yn=5,$n=6,La=7,Hs=0,zu=1,Oa=2,Zr=0,J=1,st=2,at=3,Tt=4,bt=5,wt=300,zt=301,ne=302,se=303,ae=304,xe=306,Ie=307,Ge=1e3,qe=1001,pi=1002,fi=1003,Sr=1004,Lo=1004,zs=1005,Cl=1005,qi=1006,as=1007,Gp=1007,js=1008,Hp=1008,ls=1009,zp=1010,jp=1011,Pl=1012,Vp=1013,Vs=1014,Oo=1015,Ws=1016,Wp=1017,Xp=1018,qp=1019,Pi=1020,Fi=1021,No=1022,Tr=1023,Yp=1024,Fc=1025,$p=Tr,tn=1026,Xs=1027,Na=1028,Bc=1029,ju=1030,Er=1031,kc=1032,Uc=1033,Vu=33776,Wu=33777,Xu=33778,qu=33779,ir=35840,Gc=35841,hr=35842,Hc=35843,zc=36196,fo=37492,Da=37496,Yu=37808,Gi=37809,Do=37810,$u=37811,Jp=37812,Ju=37813,Zp=37814,jc=37815,Il=37816,qs=37817,Kp=37818,Vc=37819,Wc=37820,Zu=37821,Ku=36492,Xc=37840,Qu=37841,th=37842,qc=37843,cr=37844,eh=37845,Fa=37846,Yc=37847,$c=37848,Qp=37849,tf=37850,ef=37851,nf=37852,Ys=37853,ih=2200,Jc=2201,Fo=2202,us=2300,Ll=2301,Bo=2302,Gn=2400,hs=2401,Ol=2402,$s=2500,It=2501,Qt=0,ie=1,Se=2,Be=3e3,gi=3001,an=3007,Mr=3002,ki=3003,Nl=3004,Zc=3005,dr=3006,Dl=3200,Kc=3201,Br=0,Fl=1,nh=0,Ei=7680,Dg=7681,rf=7682,rh=7683,Fg=34055,Bg=34056,kg=5386,oh=512,cs=513,sh=514,of=515,ah=516,sf=517,af=518,Bl=519,Js=35044,mo=35048,Zs=35040,lh=35045,Ug=35049,Gg=35041,Hg=35046,uh=35050,hh=35042,Qc="100",td="300 es";class ko{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[t]===void 0&&(i[t]=[]),i[t].indexOf(e)===-1&&i[t].push(e)}hasEventListener(t,e){if(this._listeners===void 0)return!1;const i=this._listeners;return i[t]!==void 0&&i[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;const i=this._listeners[t];if(i!==void 0){const r=i.indexOf(e);r!==-1&&i.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 i=e.slice(0);for(let r=0,o=i.length;r<o;r++)i[r].call(this,t);t.target=null}}}const Hn=[];for(let n=0;n<256;n++)Hn[n]=(n<16?"0":"")+n.toString(16);let ch=1234567;const Hi=Math.PI/180,yn=180/Math.PI;function Ar(){const n=4294967295*Math.random()|0,t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(Hn[255&n]+Hn[n>>8&255]+Hn[n>>16&255]+Hn[n>>24&255]+"-"+Hn[255&t]+Hn[t>>8&255]+"-"+Hn[t>>16&15|64]+Hn[t>>24&255]+"-"+Hn[63&e|128]+Hn[e>>8&255]+"-"+Hn[e>>16&255]+Hn[e>>24&255]+Hn[255&i]+Hn[i>>8&255]+Hn[i>>16&255]+Hn[i>>24&255]).toUpperCase()}function zn(n,t,e){return Math.max(t,Math.min(e,n))}function dh(n,t){return(n%t+t)%t}function kl(n,t,e){return(1-e)*n+e*t}function Ul(n){return(n&n-1)==0&&n!==0}function Ba(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function ph(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}var Ks=Object.freeze({__proto__:null,DEG2RAD:Hi,RAD2DEG:yn,generateUUID:Ar,clamp:zn,euclideanModulo:dh,mapLinear:function(n,t,e,i,r){return i+(n-t)*(r-i)/(e-t)},inverseLerp:function(n,t,e){return n!==t?(e-n)/(t-n):0},lerp:kl,damp:function(n,t,e,i){return kl(n,t,1-Math.exp(-e*i))},pingpong:function(n,t=1){return t-Math.abs(dh(n,2*t)-t)},smoothstep:function(n,t,e){return n<=t?0:n>=e?1:(n=(n-t)/(e-t))*n*(3-2*n)},smootherstep:function(n,t,e){return n<=t?0:n>=e?1:(n=(n-t)/(e-t))*n*n*(n*(6*n-15)+10)},randInt:function(n,t){return n+Math.floor(Math.random()*(t-n+1))},randFloat:function(n,t){return n+Math.random()*(t-n)},randFloatSpread:function(n){return n*(.5-Math.random())},seededRandom:function(n){return n!==void 0&&(ch=n%2147483647),ch=16807*ch%2147483647,(ch-1)/2147483646},degToRad:function(n){return n*Hi},radToDeg:function(n){return n*yn},isPowerOfTwo:Ul,ceilPowerOfTwo:Ba,floorPowerOfTwo:ph,setQuaternionFromProperEuler:function(n,t,e,i,r){const o=Math.cos,s=Math.sin,a=o(e/2),l=s(e/2),u=o((t+i)/2),h=s((t+i)/2),d=o((t-i)/2),p=s((t-i)/2),m=o((i-t)/2),g=s((i-t)/2);switch(r){case"XYX":n.set(a*h,l*d,l*p,a*u);break;case"YZY":n.set(l*p,a*h,l*d,a*u);break;case"ZXZ":n.set(l*d,l*p,a*h,a*u);break;case"XZX":n.set(a*h,l*g,l*m,a*u);break;case"YXY":n.set(l*m,a*h,l*g,a*u);break;case"ZYZ":n.set(l*g,l*m,a*h,a*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}});class ce{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,i=this.y,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6],this.y=r[1]*e+r[4]*i+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 i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}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,i=this.y-t.y;return e*e+i*i}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,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,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,i){return i!==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 i=Math.cos(e),r=Math.sin(e),o=this.x-t.x,s=this.y-t.y;return this.x=o*i-s*r+t.x,this.y=o*r+s*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}}ce.prototype.isVector2=!0;class zi{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,i,r,o,s,a,l,u){const h=this.elements;return h[0]=t,h[1]=r,h[2]=a,h[3]=e,h[4]=o,h[5]=l,h[6]=i,h[7]=s,h[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}extractBasis(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.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 i=t.elements,r=e.elements,o=this.elements,s=i[0],a=i[3],l=i[6],u=i[1],h=i[4],d=i[7],p=i[2],m=i[5],g=i[8],_=r[0],y=r[3],w=r[6],A=r[1],I=r[4],F=r[7],N=r[2],U=r[5],B=r[8];return o[0]=s*_+a*A+l*N,o[3]=s*y+a*I+l*U,o[6]=s*w+a*F+l*B,o[1]=u*_+h*A+d*N,o[4]=u*y+h*I+d*U,o[7]=u*w+h*F+d*B,o[2]=p*_+m*A+g*N,o[5]=p*y+m*I+g*U,o[8]=p*w+m*F+g*B,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],i=t[1],r=t[2],o=t[3],s=t[4],a=t[5],l=t[6],u=t[7],h=t[8];return e*s*h-e*a*u-i*o*h+i*a*l+r*o*u-r*s*l}invert(){const t=this.elements,e=t[0],i=t[1],r=t[2],o=t[3],s=t[4],a=t[5],l=t[6],u=t[7],h=t[8],d=h*s-a*u,p=a*l-h*o,m=u*o-s*l,g=e*d+i*p+r*m;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/g;return t[0]=d*_,t[1]=(r*u-h*i)*_,t[2]=(a*i-r*s)*_,t[3]=p*_,t[4]=(h*e-r*l)*_,t[5]=(r*o-a*e)*_,t[6]=m*_,t[7]=(i*l-u*e)*_,t[8]=(s*e-i*o)*_,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,i,r,o,s,a){const l=Math.cos(o),u=Math.sin(o);return this.set(i*l,i*u,-i*(l*s+u*a)+s+t,-r*u,r*l,-r*(-u*s+l*a)+a+e,0,0,1),this}scale(t,e){const i=this.elements;return i[0]*=t,i[3]*=t,i[6]*=t,i[1]*=e,i[4]*=e,i[7]*=e,this}rotate(t){const e=Math.cos(t),i=Math.sin(t),r=this.elements,o=r[0],s=r[3],a=r[6],l=r[1],u=r[4],h=r[7];return r[0]=e*o+i*l,r[3]=e*s+i*u,r[6]=e*a+i*h,r[1]=-i*o+e*l,r[4]=-i*s+e*u,r[7]=-i*a+e*h,this}translate(t,e){const i=this.elements;return i[0]+=t*i[2],i[3]+=t*i[5],i[6]+=t*i[8],i[1]+=e*i[2],i[4]+=e*i[5],i[7]+=e*i[8],this}equals(t){const e=this.elements,i=t.elements;for(let r=0;r<9;r++)if(e[r]!==i[r])return!1;return!0}fromArray(t,e=0){for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}clone(){return new this.constructor().fromArray(this.elements)}}let Uo;zi.prototype.isMatrix3=!0;class kr{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement=="undefined")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{Uo===void 0&&(Uo=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Uo.width=t.width,Uo.height=t.height;const i=Uo.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=Uo}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 zg=0;class dn extends ko{constructor(t=dn.DEFAULT_IMAGE,e=dn.DEFAULT_MAPPING,i=qe,r=qe,o=qi,s=js,a=Tr,l=ls,u=1,h=Be){super(),Object.defineProperty(this,"id",{value:zg++}),this.uuid=Ar(),this.name="",this.image=t,this.mipmaps=[],this.mapping=e,this.wrapS=i,this.wrapT=r,this.magFilter=o,this.minFilter=s,this.anisotropy=u,this.format=a,this.internalFormat=null,this.type=l,this.offset=new ce(0,0),this.repeat=new ce(1,1),this.center=new ce(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new zi,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=h,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 i={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=Ar()),!e&&t.images[r.uuid]===void 0){let o;if(Array.isArray(r)){o=[];for(let s=0,a=r.length;s<a;s++)r[s].isDataTexture?o.push(ed(r[s].image)):o.push(ed(r[s]))}else o=ed(r);t.images[r.uuid]={uuid:r.uuid,url:o}}i.image=r.uuid}return e||(t.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==wt)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case Ge:t.x=t.x-Math.floor(t.x);break;case qe:t.x=t.x<0?0:1;break;case pi: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 Ge:t.y=t.y-Math.floor(t.y);break;case qe:t.y=t.y<0?0:1;break;case pi: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 ed(n){return typeof HTMLImageElement!="undefined"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&n instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&n instanceof ImageBitmap?kr.getDataURL(n):n.data?{data:Array.prototype.slice.call(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}dn.DEFAULT_IMAGE=void 0,dn.DEFAULT_MAPPING=wt,dn.prototype.isTexture=!0;class Li{constructor(t=0,e=0,i=0,r=1){this.x=t,this.y=e,this.z=i,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,i,r){return this.x=t,this.y=e,this.z=i,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,i=this.y,r=this.z,o=this.w,s=t.elements;return this.x=s[0]*e+s[4]*i+s[8]*r+s[12]*o,this.y=s[1]*e+s[5]*i+s[9]*r+s[13]*o,this.z=s[2]*e+s[6]*i+s[10]*r+s[14]*o,this.w=s[3]*e+s[7]*i+s[11]*r+s[15]*o,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,i,r,o;const s=t.elements,a=s[0],l=s[4],u=s[8],h=s[1],d=s[5],p=s[9],m=s[2],g=s[6],_=s[10];if(Math.abs(l-h)<.01&&Math.abs(u-m)<.01&&Math.abs(p-g)<.01){if(Math.abs(l+h)<.1&&Math.abs(u+m)<.1&&Math.abs(p+g)<.1&&Math.abs(a+d+_-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const w=(a+1)/2,A=(d+1)/2,I=(_+1)/2,F=(l+h)/4,N=(u+m)/4,U=(p+g)/4;return w>A&&w>I?w<.01?(i=0,r=.707106781,o=.707106781):(i=Math.sqrt(w),r=F/i,o=N/i):A>I?A<.01?(i=.707106781,r=0,o=.707106781):(r=Math.sqrt(A),i=F/r,o=U/r):I<.01?(i=.707106781,r=.707106781,o=0):(o=Math.sqrt(I),i=N/o,r=U/o),this.set(i,r,o,e),this}let y=Math.sqrt((g-p)*(g-p)+(u-m)*(u-m)+(h-l)*(h-l));return Math.abs(y)<.001&&(y=1),this.x=(g-p)/y,this.y=(u-m)/y,this.z=(h-l)/y,this.w=Math.acos((a+d+_-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 i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}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,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,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,i){return i!==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}}Li.prototype.isVector4=!0;class Kr extends ko{constructor(t,e,i={}){super(),this.width=t,this.height=e,this.depth=1,this.scissor=new Li(0,0,t,e),this.scissorTest=!1,this.viewport=new Li(0,0,t,e),this.texture=new dn(void 0,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.image={width:t,height:e,depth:1},this.texture.generateMipmaps=i.generateMipmaps!==void 0&&i.generateMipmaps,this.texture.minFilter=i.minFilter!==void 0?i.minFilter:qi,this.depthBuffer=i.depthBuffer===void 0||i.depthBuffer,this.stencilBuffer=i.stencilBuffer!==void 0&&i.stencilBuffer,this.depthTexture=i.depthTexture!==void 0?i.depthTexture:null}setTexture(t){t.image={width:this.width,height:this.height,depth:this.depth},this.texture=t}setSize(t,e,i=1){this.width===t&&this.height===e&&this.depth===i||(this.width=t,this.height=e,this.depth=i,this.texture.image.width=t,this.texture.image.height=e,this.texture.image.depth=i,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=H_({},this.texture.image),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}Kr.prototype.isWebGLRenderTarget=!0;class Gl extends Kr{constructor(t,e,i){super(t,e);const r=this.texture;this.texture=[];for(let o=0;o<i;o++)this.texture[o]=r.clone()}setSize(t,e,i=1){if(this.width!==t||this.height!==e||this.depth!==i){this.width=t,this.height=e,this.depth=i;for(let r=0,o=this.texture.length;r<o;r++)this.texture[r].image.width=t,this.texture[r].image.height=e,this.texture[r].image.depth=i;this.dispose()}return this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e),this}copy(t){this.dispose(),this.width=t.width,this.height=t.height,this.depth=t.depth,this.viewport.set(0,0,this.width,this.height),this.scissor.set(0,0,this.width,this.height),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this.texture.length=0;for(let e=0,i=t.texture.length;e<i;e++)this.texture[e]=t.texture[e].clone();return this}}Gl.prototype.isWebGLMultipleRenderTargets=!0;class Qs extends Kr{constructor(t,e,i){super(t,e,i),this.samples=4}copy(t){return super.copy.call(this,t),this.samples=t.samples,this}}Qs.prototype.isWebGLMultisampleRenderTarget=!0;class Nn{constructor(t=0,e=0,i=0,r=1){this._x=t,this._y=e,this._z=i,this._w=r}static slerp(t,e,i,r){return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."),i.slerpQuaternions(t,e,r)}static slerpFlat(t,e,i,r,o,s,a){let l=i[r+0],u=i[r+1],h=i[r+2],d=i[r+3];const p=o[s+0],m=o[s+1],g=o[s+2],_=o[s+3];if(a===0)return t[e+0]=l,t[e+1]=u,t[e+2]=h,void(t[e+3]=d);if(a===1)return t[e+0]=p,t[e+1]=m,t[e+2]=g,void(t[e+3]=_);if(d!==_||l!==p||u!==m||h!==g){let y=1-a;const w=l*p+u*m+h*g+d*_,A=w>=0?1:-1,I=1-w*w;if(I>Number.EPSILON){const N=Math.sqrt(I),U=Math.atan2(N,w*A);y=Math.sin(y*U)/N,a=Math.sin(a*U)/N}const F=a*A;if(l=l*y+p*F,u=u*y+m*F,h=h*y+g*F,d=d*y+_*F,y===1-a){const N=1/Math.sqrt(l*l+u*u+h*h+d*d);l*=N,u*=N,h*=N,d*=N}}t[e]=l,t[e+1]=u,t[e+2]=h,t[e+3]=d}static multiplyQuaternionsFlat(t,e,i,r,o,s){const a=i[r],l=i[r+1],u=i[r+2],h=i[r+3],d=o[s],p=o[s+1],m=o[s+2],g=o[s+3];return t[e]=a*g+h*d+l*m-u*p,t[e+1]=l*g+h*p+u*d-a*m,t[e+2]=u*g+h*m+a*p-l*d,t[e+3]=h*g-a*d-l*p-u*m,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,i,r){return this._x=t,this._y=e,this._z=i,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 i=t._x,r=t._y,o=t._z,s=t._order,a=Math.cos,l=Math.sin,u=a(i/2),h=a(r/2),d=a(o/2),p=l(i/2),m=l(r/2),g=l(o/2);switch(s){case"XYZ":this._x=p*h*d+u*m*g,this._y=u*m*d-p*h*g,this._z=u*h*g+p*m*d,this._w=u*h*d-p*m*g;break;case"YXZ":this._x=p*h*d+u*m*g,this._y=u*m*d-p*h*g,this._z=u*h*g-p*m*d,this._w=u*h*d+p*m*g;break;case"ZXY":this._x=p*h*d-u*m*g,this._y=u*m*d+p*h*g,this._z=u*h*g+p*m*d,this._w=u*h*d-p*m*g;break;case"ZYX":this._x=p*h*d-u*m*g,this._y=u*m*d+p*h*g,this._z=u*h*g-p*m*d,this._w=u*h*d+p*m*g;break;case"YZX":this._x=p*h*d+u*m*g,this._y=u*m*d+p*h*g,this._z=u*h*g-p*m*d,this._w=u*h*d-p*m*g;break;case"XZY":this._x=p*h*d-u*m*g,this._y=u*m*d-p*h*g,this._z=u*h*g+p*m*d,this._w=u*h*d+p*m*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return e!==!1&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const i=e/2,r=Math.sin(i);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,i=e[0],r=e[4],o=e[8],s=e[1],a=e[5],l=e[9],u=e[2],h=e[6],d=e[10],p=i+a+d;if(p>0){const m=.5/Math.sqrt(p+1);this._w=.25/m,this._x=(h-l)*m,this._y=(o-u)*m,this._z=(s-r)*m}else if(i>a&&i>d){const m=2*Math.sqrt(1+i-a-d);this._w=(h-l)/m,this._x=.25*m,this._y=(r+s)/m,this._z=(o+u)/m}else if(a>d){const m=2*Math.sqrt(1+a-i-d);this._w=(o-u)/m,this._x=(r+s)/m,this._y=.25*m,this._z=(l+h)/m}else{const m=2*Math.sqrt(1+d-i-a);this._w=(s-r)/m,this._x=(o+u)/m,this._y=(l+h)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let i=t.dot(e)+1;return i<Number.EPSILON?(i=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(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=i),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(zn(this.dot(t),-1,1)))}rotateTowards(t,e){const i=this.angleTo(t);if(i===0)return this;const r=Math.min(1,e/i);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 i=t._x,r=t._y,o=t._z,s=t._w,a=e._x,l=e._y,u=e._z,h=e._w;return this._x=i*h+s*a+r*u-o*l,this._y=r*h+s*l+o*a-i*u,this._z=o*h+s*u+i*l-r*a,this._w=s*h-i*a-r*l-o*u,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const i=this._x,r=this._y,o=this._z,s=this._w;let a=s*t._w+i*t._x+r*t._y+o*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=s,this._x=i,this._y=r,this._z=o,this;const l=1-a*a;if(l<=Number.EPSILON){const m=1-e;return this._w=m*s+e*this._w,this._x=m*i+e*this._x,this._y=m*r+e*this._y,this._z=m*o+e*this._z,this.normalize(),this._onChangeCallback(),this}const u=Math.sqrt(l),h=Math.atan2(u,a),d=Math.sin((1-e)*h)/u,p=Math.sin(e*h)/u;return this._w=s*d+this._w*p,this._x=i*d+this._x*p,this._y=r*d+this._y*p,this._z=o*d+this._z*p,this._onChangeCallback(),this}slerpQuaternions(t,e,i){this.copy(t).slerp(e,i)}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(){}}Nn.prototype.isQuaternion=!0;class S{constructor(t=0,e=0,i=0){this.x=t,this.y=e,this.z=i}set(t,e,i){return i===void 0&&(i=this.z),this.x=t,this.y=e,this.z=i,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(Hl.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(Hl.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,i=this.y,r=this.z,o=t.elements;return this.x=o[0]*e+o[3]*i+o[6]*r,this.y=o[1]*e+o[4]*i+o[7]*r,this.z=o[2]*e+o[5]*i+o[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,i=this.y,r=this.z,o=t.elements,s=1/(o[3]*e+o[7]*i+o[11]*r+o[15]);return this.x=(o[0]*e+o[4]*i+o[8]*r+o[12])*s,this.y=(o[1]*e+o[5]*i+o[9]*r+o[13])*s,this.z=(o[2]*e+o[6]*i+o[10]*r+o[14])*s,this}applyQuaternion(t){const e=this.x,i=this.y,r=this.z,o=t.x,s=t.y,a=t.z,l=t.w,u=l*e+s*r-a*i,h=l*i+a*e-o*r,d=l*r+o*i-s*e,p=-o*e-s*i-a*r;return this.x=u*l+p*-o+h*-a-d*-s,this.y=h*l+p*-s+d*-o-u*-a,this.z=d*l+p*-a+u*-s-h*-o,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,i=this.y,r=this.z,o=t.elements;return this.x=o[0]*e+o[4]*i+o[8]*r,this.y=o[1]*e+o[5]*i+o[9]*r,this.z=o[2]*e+o[6]*i+o[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 i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}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,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,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 i=t.x,r=t.y,o=t.z,s=e.x,a=e.y,l=e.z;return this.x=r*l-o*a,this.y=o*s-i*l,this.z=i*a-r*s,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return ds.copy(this).projectOnVector(t),this.sub(ds)}reflect(t){return this.sub(ds.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 i=this.dot(t)/e;return Math.acos(zn(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y,r=this.z-t.z;return e*e+i*i+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,i){const r=Math.sin(e)*t;return this.x=r*Math.sin(i),this.y=Math.cos(e)*t,this.z=r*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,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(),i=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,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,i){return i!==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}}S.prototype.isVector3=!0;const ds=new S,Hl=new Nn;class Yi{constructor(t=new S(1/0,1/0,1/0),e=new S(-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,i=1/0,r=1/0,o=-1/0,s=-1/0,a=-1/0;for(let l=0,u=t.length;l<u;l+=3){const h=t[l],d=t[l+1],p=t[l+2];h<e&&(e=h),d<i&&(i=d),p<r&&(r=p),h>o&&(o=h),d>s&&(s=d),p>a&&(a=p)}return this.min.set(e,i,r),this.max.set(o,s,a),this}setFromBufferAttribute(t){let e=1/0,i=1/0,r=1/0,o=-1/0,s=-1/0,a=-1/0;for(let l=0,u=t.count;l<u;l++){const h=t.getX(l),d=t.getY(l),p=t.getZ(l);h<e&&(e=h),d<i&&(i=d),p<r&&(r=p),h>o&&(o=h),d>s&&(s=d),p>a&&(a=p)}return this.min.set(e,i,r),this.max.set(o,s,a),this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const i=Qr.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),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(),to.copy(e.boundingBox),to.applyMatrix4(t.matrixWorld),this.union(to));const i=t.children;for(let r=0,o=i.length;r<o;r++)this.expandByObject(i[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,Qr),Qr.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(zl),ka.subVectors(this.max,zl),pr.subVectors(t.a,zl),Ur.subVectors(t.b,zl),Jn.subVectors(t.c,zl),Go.subVectors(Ur,pr),Ho.subVectors(Jn,Ur),ta.subVectors(pr,Jn);let e=[0,-Go.z,Go.y,0,-Ho.z,Ho.y,0,-ta.z,ta.y,Go.z,0,-Go.x,Ho.z,0,-Ho.x,ta.z,0,-ta.x,-Go.y,Go.x,0,-Ho.y,Ho.x,0,-ta.y,ta.x,0];return!!id(e,pr,Ur,Jn,ka)&&(e=[1,0,0,0,1,0,0,0,1],!!id(e,pr,Ur,Jn,ka)&&(ps.crossVectors(Go,Ho),e=[ps.x,ps.y,ps.z],id(e,pr,Ur,Jn,ka)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return Qr.copy(t).clamp(this.min,this.max).sub(t).length()}getBoundingSphere(t){return this.getCenter(t.center),t.radius=.5*this.getSize(Qr).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()||(oi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),oi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),oi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),oi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),oi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),oi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),oi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),oi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(oi)),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)}}Yi.prototype.isBox3=!0;const oi=[new S,new S,new S,new S,new S,new S,new S,new S],Qr=new S,to=new Yi,pr=new S,Ur=new S,Jn=new S,Go=new S,Ho=new S,ta=new S,zl=new S,ka=new S,ps=new S,go=new S;function id(n,t,e,i,r){for(let o=0,s=n.length-3;o<=s;o+=3){go.fromArray(n,o);const a=r.x*Math.abs(go.x)+r.y*Math.abs(go.y)+r.z*Math.abs(go.z),l=t.dot(go),u=e.dot(go),h=i.dot(go);if(Math.max(-Math.max(l,u,h),Math.min(l,u,h))>a)return!1}return!0}const lf=new Yi,vo=new S,jl=new S,zo=new S;class En{constructor(t=new S,e=-1){this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const i=this.center;e!==void 0?i.copy(e):lf.setFromPoints(t).getCenter(i);let r=0;for(let o=0,s=t.length;o<s;o++)r=Math.max(r,i.distanceToSquared(t[o]));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 i=this.center.distanceToSquared(t);return e.copy(t),i>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){zo.subVectors(t,this.center);const e=zo.lengthSq();if(e>this.radius*this.radius){const i=Math.sqrt(e),r=.5*(i-this.radius);this.center.add(zo.multiplyScalar(r/i)),this.radius+=r}return this}union(t){return jl.subVectors(t.center,this.center).normalize().multiplyScalar(t.radius),this.expandByPoint(vo.copy(t.center).add(jl)),this.expandByPoint(vo.copy(t.center).sub(jl)),this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}}const _o=new S,fh=new S,fs=new S,nr=new S,mh=new S,gh=new S,Ua=new S;class jo{constructor(t=new S,e=new S(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,_o)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(i).add(this.origin)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=_o.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(_o.copy(this.direction).multiplyScalar(e).add(this.origin),_o.distanceToSquared(t))}distanceSqToSegment(t,e,i,r){fh.copy(t).add(e).multiplyScalar(.5),fs.copy(e).sub(t).normalize(),nr.copy(this.origin).sub(fh);const o=.5*t.distanceTo(e),s=-this.direction.dot(fs),a=nr.dot(this.direction),l=-nr.dot(fs),u=nr.lengthSq(),h=Math.abs(1-s*s);let d,p,m,g;if(h>0)if(d=s*l-a,p=s*a-l,g=o*h,d>=0)if(p>=-g)if(p<=g){const _=1/h;d*=_,p*=_,m=d*(d+s*p+2*a)+p*(s*d+p+2*l)+u}else p=o,d=Math.max(0,-(s*p+a)),m=-d*d+p*(p+2*l)+u;else p=-o,d=Math.max(0,-(s*p+a)),m=-d*d+p*(p+2*l)+u;else p<=-g?(d=Math.max(0,-(-s*o+a)),p=d>0?-o:Math.min(Math.max(-o,-l),o),m=-d*d+p*(p+2*l)+u):p<=g?(d=0,p=Math.min(Math.max(-o,-l),o),m=p*(p+2*l)+u):(d=Math.max(0,-(s*o+a)),p=d>0?o:Math.min(Math.max(-o,-l),o),m=-d*d+p*(p+2*l)+u);else p=s>0?-o:o,d=Math.max(0,-(s*p+a)),m=-d*d+p*(p+2*l)+u;return i&&i.copy(this.direction).multiplyScalar(d).add(this.origin),r&&r.copy(fs).multiplyScalar(p).add(fh),m}intersectSphere(t,e){_o.subVectors(t.center,this.origin);const i=_o.dot(this.direction),r=_o.dot(_o)-i*i,o=t.radius*t.radius;if(r>o)return null;const s=Math.sqrt(o-r),a=i-s,l=i+s;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 i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}intersectPlane(t,e){const i=this.distanceToPlane(t);return i===null?null:this.at(i,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return e===0?!0:t.normal.dot(this.direction)*e<0}intersectBox(t,e){let i,r,o,s,a,l;const u=1/this.direction.x,h=1/this.direction.y,d=1/this.direction.z,p=this.origin;return u>=0?(i=(t.min.x-p.x)*u,r=(t.max.x-p.x)*u):(i=(t.max.x-p.x)*u,r=(t.min.x-p.x)*u),h>=0?(o=(t.min.y-p.y)*h,s=(t.max.y-p.y)*h):(o=(t.max.y-p.y)*h,s=(t.min.y-p.y)*h),i>s||o>r?null:((o>i||i!=i)&&(i=o),(s<r||r!=r)&&(r=s),d>=0?(a=(t.min.z-p.z)*d,l=(t.max.z-p.z)*d):(a=(t.max.z-p.z)*d,l=(t.min.z-p.z)*d),i>l||a>r?null:((a>i||i!=i)&&(i=a),(l<r||r!=r)&&(r=l),r<0?null:this.at(i>=0?i:r,e)))}intersectsBox(t){return this.intersectBox(t,_o)!==null}intersectTriangle(t,e,i,r,o){mh.subVectors(e,t),gh.subVectors(i,t),Ua.crossVectors(mh,gh);let s,a=this.direction.dot(Ua);if(a>0){if(r)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}nr.subVectors(this.origin,t);const l=s*this.direction.dot(gh.crossVectors(nr,gh));if(l<0)return null;const u=s*this.direction.dot(mh.cross(nr));if(u<0||l+u>a)return null;const h=-s*nr.dot(Ua);return h<0?null:this.at(h/a,o)}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 Ee{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,i,r,o,s,a,l,u,h,d,p,m,g,_,y){const w=this.elements;return w[0]=t,w[4]=e,w[8]=i,w[12]=r,w[1]=o,w[5]=s,w[9]=a,w[13]=l,w[2]=u,w[6]=h,w[10]=d,w[14]=p,w[3]=m,w[7]=g,w[11]=_,w[15]=y,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 Ee().fromArray(this.elements)}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}copyPosition(t){const e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[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,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,i=t.elements,r=1/ms.setFromMatrixColumn(t,0).length(),o=1/ms.setFromMatrixColumn(t,1).length(),s=1/ms.setFromMatrixColumn(t,2).length();return e[0]=i[0]*r,e[1]=i[1]*r,e[2]=i[2]*r,e[3]=0,e[4]=i[4]*o,e[5]=i[5]*o,e[6]=i[6]*o,e[7]=0,e[8]=i[8]*s,e[9]=i[9]*s,e[10]=i[10]*s,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,i=t.x,r=t.y,o=t.z,s=Math.cos(i),a=Math.sin(i),l=Math.cos(r),u=Math.sin(r),h=Math.cos(o),d=Math.sin(o);if(t.order==="XYZ"){const p=s*h,m=s*d,g=a*h,_=a*d;e[0]=l*h,e[4]=-l*d,e[8]=u,e[1]=m+g*u,e[5]=p-_*u,e[9]=-a*l,e[2]=_-p*u,e[6]=g+m*u,e[10]=s*l}else if(t.order==="YXZ"){const p=l*h,m=l*d,g=u*h,_=u*d;e[0]=p+_*a,e[4]=g*a-m,e[8]=s*u,e[1]=s*d,e[5]=s*h,e[9]=-a,e[2]=m*a-g,e[6]=_+p*a,e[10]=s*l}else if(t.order==="ZXY"){const p=l*h,m=l*d,g=u*h,_=u*d;e[0]=p-_*a,e[4]=-s*d,e[8]=g+m*a,e[1]=m+g*a,e[5]=s*h,e[9]=_-p*a,e[2]=-s*u,e[6]=a,e[10]=s*l}else if(t.order==="ZYX"){const p=s*h,m=s*d,g=a*h,_=a*d;e[0]=l*h,e[4]=g*u-m,e[8]=p*u+_,e[1]=l*d,e[5]=_*u+p,e[9]=m*u-g,e[2]=-u,e[6]=a*l,e[10]=s*l}else if(t.order==="YZX"){const p=s*l,m=s*u,g=a*l,_=a*u;e[0]=l*h,e[4]=_-p*d,e[8]=g*d+m,e[1]=d,e[5]=s*h,e[9]=-a*h,e[2]=-u*h,e[6]=m*d+g,e[10]=p-_*d}else if(t.order==="XZY"){const p=s*l,m=s*u,g=a*l,_=a*u;e[0]=l*h,e[4]=-d,e[8]=u*h,e[1]=p*d+_,e[5]=s*h,e[9]=m*d-g,e[2]=g*d-m,e[6]=a*h,e[10]=_*d+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(yo,t,nd)}lookAt(t,e,i){const r=this.elements;return fr.subVectors(t,e),fr.lengthSq()===0&&(fr.z=1),fr.normalize(),eo.crossVectors(i,fr),eo.lengthSq()===0&&(Math.abs(i.z)===1?fr.x+=1e-4:fr.z+=1e-4,fr.normalize(),eo.crossVectors(i,fr)),eo.normalize(),xo.crossVectors(fr,eo),r[0]=eo.x,r[4]=xo.x,r[8]=fr.x,r[1]=eo.y,r[5]=xo.y,r[9]=fr.y,r[2]=eo.z,r[6]=xo.z,r[10]=fr.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 i=t.elements,r=e.elements,o=this.elements,s=i[0],a=i[4],l=i[8],u=i[12],h=i[1],d=i[5],p=i[9],m=i[13],g=i[2],_=i[6],y=i[10],w=i[14],A=i[3],I=i[7],F=i[11],N=i[15],U=r[0],B=r[4],G=r[8],ct=r[12],it=r[1],tt=r[5],rt=r[9],et=r[13],pt=r[2],kt=r[6],Lt=r[10],_t=r[14],xt=r[3],jt=r[7],ee=r[11],le=r[15];return o[0]=s*U+a*it+l*pt+u*xt,o[4]=s*B+a*tt+l*kt+u*jt,o[8]=s*G+a*rt+l*Lt+u*ee,o[12]=s*ct+a*et+l*_t+u*le,o[1]=h*U+d*it+p*pt+m*xt,o[5]=h*B+d*tt+p*kt+m*jt,o[9]=h*G+d*rt+p*Lt+m*ee,o[13]=h*ct+d*et+p*_t+m*le,o[2]=g*U+_*it+y*pt+w*xt,o[6]=g*B+_*tt+y*kt+w*jt,o[10]=g*G+_*rt+y*Lt+w*ee,o[14]=g*ct+_*et+y*_t+w*le,o[3]=A*U+I*it+F*pt+N*xt,o[7]=A*B+I*tt+F*kt+N*jt,o[11]=A*G+I*rt+F*Lt+N*ee,o[15]=A*ct+I*et+F*_t+N*le,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],i=t[4],r=t[8],o=t[12],s=t[1],a=t[5],l=t[9],u=t[13],h=t[2],d=t[6],p=t[10],m=t[14];return t[3]*(+o*l*d-r*u*d-o*a*p+i*u*p+r*a*m-i*l*m)+t[7]*(+e*l*m-e*u*p+o*s*p-r*s*m+r*u*h-o*l*h)+t[11]*(+e*u*d-e*a*m-o*s*d+i*s*m+o*a*h-i*u*h)+t[15]*(-r*a*h-e*l*d+e*a*p+r*s*d-i*s*p+i*l*h)}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,i){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]=i),this}invert(){const t=this.elements,e=t[0],i=t[1],r=t[2],o=t[3],s=t[4],a=t[5],l=t[6],u=t[7],h=t[8],d=t[9],p=t[10],m=t[11],g=t[12],_=t[13],y=t[14],w=t[15],A=d*y*u-_*p*u+_*l*m-a*y*m-d*l*w+a*p*w,I=g*p*u-h*y*u-g*l*m+s*y*m+h*l*w-s*p*w,F=h*_*u-g*d*u+g*a*m-s*_*m-h*a*w+s*d*w,N=g*d*l-h*_*l-g*a*p+s*_*p+h*a*y-s*d*y,U=e*A+i*I+r*F+o*N;if(U===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const B=1/U;return t[0]=A*B,t[1]=(_*p*o-d*y*o-_*r*m+i*y*m+d*r*w-i*p*w)*B,t[2]=(a*y*o-_*l*o+_*r*u-i*y*u-a*r*w+i*l*w)*B,t[3]=(d*l*o-a*p*o-d*r*u+i*p*u+a*r*m-i*l*m)*B,t[4]=I*B,t[5]=(h*y*o-g*p*o+g*r*m-e*y*m-h*r*w+e*p*w)*B,t[6]=(g*l*o-s*y*o-g*r*u+e*y*u+s*r*w-e*l*w)*B,t[7]=(s*p*o-h*l*o+h*r*u-e*p*u-s*r*m+e*l*m)*B,t[8]=F*B,t[9]=(g*d*o-h*_*o-g*i*m+e*_*m+h*i*w-e*d*w)*B,t[10]=(s*_*o-g*a*o+g*i*u-e*_*u-s*i*w+e*a*w)*B,t[11]=(h*a*o-s*d*o-h*i*u+e*d*u+s*i*m-e*a*m)*B,t[12]=N*B,t[13]=(h*_*r-g*d*r+g*i*p-e*_*p-h*i*y+e*d*y)*B,t[14]=(g*a*r-s*_*r-g*i*l+e*_*l+s*i*y-e*a*y)*B,t[15]=(s*d*r-h*a*r+h*i*l-e*d*l-s*i*p+e*a*p)*B,this}scale(t){const e=this.elements,i=t.x,r=t.y,o=t.z;return e[0]*=i,e[4]*=r,e[8]*=o,e[1]*=i,e[5]*=r,e[9]*=o,e[2]*=i,e[6]*=r,e[10]*=o,e[3]*=i,e[7]*=r,e[11]*=o,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,r))}makeTranslation(t,e,i){return this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const i=Math.cos(e),r=Math.sin(e),o=1-i,s=t.x,a=t.y,l=t.z,u=o*s,h=o*a;return this.set(u*s+i,u*a-r*l,u*l+r*a,0,u*a+r*l,h*a+i,h*l-r*s,0,u*l-r*a,h*l+r*s,o*l*l+i,0,0,0,0,1),this}makeScale(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this}makeShear(t,e,i,r,o,s){return this.set(1,i,o,0,t,1,s,0,e,r,1,0,0,0,0,1),this}compose(t,e,i){const r=this.elements,o=e._x,s=e._y,a=e._z,l=e._w,u=o+o,h=s+s,d=a+a,p=o*u,m=o*h,g=o*d,_=s*h,y=s*d,w=a*d,A=l*u,I=l*h,F=l*d,N=i.x,U=i.y,B=i.z;return r[0]=(1-(_+w))*N,r[1]=(m+F)*N,r[2]=(g-I)*N,r[3]=0,r[4]=(m-F)*U,r[5]=(1-(p+w))*U,r[6]=(y+A)*U,r[7]=0,r[8]=(g+I)*B,r[9]=(y-A)*B,r[10]=(1-(p+_))*B,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,e,i){const r=this.elements;let o=ms.set(r[0],r[1],r[2]).length();const s=ms.set(r[4],r[5],r[6]).length(),a=ms.set(r[8],r[9],r[10]).length();this.determinant()<0&&(o=-o),t.x=r[12],t.y=r[13],t.z=r[14],Gr.copy(this);const l=1/o,u=1/s,h=1/a;return Gr.elements[0]*=l,Gr.elements[1]*=l,Gr.elements[2]*=l,Gr.elements[4]*=u,Gr.elements[5]*=u,Gr.elements[6]*=u,Gr.elements[8]*=h,Gr.elements[9]*=h,Gr.elements[10]*=h,e.setFromRotationMatrix(Gr),i.x=o,i.y=s,i.z=a,this}makePerspective(t,e,i,r,o,s){s===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*o/(e-t),u=2*o/(i-r),h=(e+t)/(e-t),d=(i+r)/(i-r),p=-(s+o)/(s-o),m=-2*s*o/(s-o);return a[0]=l,a[4]=0,a[8]=h,a[12]=0,a[1]=0,a[5]=u,a[9]=d,a[13]=0,a[2]=0,a[6]=0,a[10]=p,a[14]=m,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(t,e,i,r,o,s){const a=this.elements,l=1/(e-t),u=1/(i-r),h=1/(s-o),d=(e+t)*l,p=(i+r)*u,m=(s+o)*h;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-d,a[1]=0,a[5]=2*u,a[9]=0,a[13]=-p,a[2]=0,a[6]=0,a[10]=-2*h,a[14]=-m,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(t){const e=this.elements,i=t.elements;for(let r=0;r<16;r++)if(e[r]!==i[r])return!1;return!0}fromArray(t,e=0){for(let i=0;i<16;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}}Ee.prototype.isMatrix4=!0;const ms=new S,Gr=new Ee,yo=new S(0,0,0),nd=new S(1,1,1),eo=new S,xo=new S,fr=new S,Zn=new Ee,vh=new Nn;class ea{constructor(t=0,e=0,i=0,r=ea.DefaultOrder){this._x=t,this._y=e,this._z=i,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,i,r=this._order){return this._x=t,this._y=e,this._z=i,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,i=!0){const r=t.elements,o=r[0],s=r[4],a=r[8],l=r[1],u=r[5],h=r[9],d=r[2],p=r[6],m=r[10];switch(e){case"XYZ":this._y=Math.asin(zn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,m),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(p,u),this._z=0);break;case"YXZ":this._x=Math.asin(-zn(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,m),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-d,o),this._z=0);break;case"ZXY":this._x=Math.asin(zn(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-d,m),this._z=Math.atan2(-s,u)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-zn(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(p,m),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-s,u));break;case"YZX":this._z=Math.asin(zn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,u),this._y=Math.atan2(-d,o)):(this._x=0,this._y=Math.atan2(a,m));break;case"XZY":this._z=Math.asin(-zn(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(p,u),this._y=Math.atan2(a,o)):(this._x=Math.atan2(-h,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,i===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return Zn.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Zn,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return vh.setFromEuler(this),this.setFromQuaternion(vh,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 S(this._x,this._y,this._z)}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}ea.prototype.isEuler=!0,ea.DefaultOrder="XYZ",ea.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class rd{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 od=0;const Ga=new S,ia=new Nn,Rr=new Ee,Ha=new S,za=new S,uf=new S,sd=new Nn,hf=new S(1,0,0),_h=new S(0,1,0),ad=new S(0,0,1),cf={type:"added"},ld={type:"removed"};class hi extends ko{constructor(){super(),Object.defineProperty(this,"id",{value:od++}),this.uuid=Ar(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=hi.DefaultUp.clone();const t=new S,e=new ea,i=new Nn,r=new S(1,1,1);e._onChange(function(){i.setFromEuler(e,!1)}),i._onChange(function(){e.setFromQuaternion(i,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:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Ee},normalMatrix:{value:new zi}}),this.matrix=new Ee,this.matrixWorld=new Ee,this.matrixAutoUpdate=hi.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new rd,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 ia.setFromAxisAngle(t,e),this.quaternion.multiply(ia),this}rotateOnWorldAxis(t,e){return ia.setFromAxisAngle(t,e),this.quaternion.premultiply(ia),this}rotateX(t){return this.rotateOnAxis(hf,t)}rotateY(t){return this.rotateOnAxis(_h,t)}rotateZ(t){return this.rotateOnAxis(ad,t)}translateOnAxis(t,e){return Ga.copy(t).applyQuaternion(this.quaternion),this.position.add(Ga.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(hf,t)}translateY(t){return this.translateOnAxis(_h,t)}translateZ(t){return this.translateOnAxis(ad,t)}localToWorld(t){return t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return t.applyMatrix4(Rr.copy(this.matrixWorld).invert())}lookAt(t,e,i){t.isVector3?Ha.copy(t):Ha.set(t,e,i);const r=this.parent;this.updateWorldMatrix(!0,!1),za.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Rr.lookAt(za,Ha,this.up):Rr.lookAt(Ha,za,this.up),this.quaternion.setFromRotationMatrix(Rr),r&&(Rr.extractRotation(r.matrixWorld),ia.setFromRotationMatrix(Rr),this.quaternion.premultiply(ia.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(cf)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.remove(arguments[i]);return this}const e=this.children.indexOf(t);return e!==-1&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(ld)),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(ld)}return this.children.length=0,this}attach(t){return this.updateWorldMatrix(!0,!1),Rr.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),Rr.multiply(t.parent.matrixWorld)),t.applyMatrix4(Rr),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 i=0,r=this.children.length;i<r;i++){const o=this.children[i].getObjectByProperty(t,e);if(o!==void 0)return o}}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(za,t,uf),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(za,sd,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 i=0,r=e.length;i<r;i++)e[i].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);const e=this.children;for(let i=0,r=e.length;i<r;i++)e[i].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 i=0,r=e.length;i<r;i++)e[i].updateMatrixWorld(t)}updateWorldMatrix(t,e){const i=this.parent;if(t===!0&&i!==null&&i.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 o=0,s=r.length;o<s;o++)r[o].updateWorldMatrix(!1,!0)}}toJSON(t){const e=t===void 0||typeof t=="string",i={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{}},i.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const r={};function o(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=o(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 u=0,h=l.length;u<h;u++){const d=l[u];o(t.shapes,d)}else o(t.shapes,l)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(o(t.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const a=[];for(let l=0,u=this.material.length;l<u;l++)a.push(o(t.materials,this.material[l]));r.material=a}else r.material=o(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(o(t.animations,l))}}if(e){const a=s(t.geometries),l=s(t.materials),u=s(t.textures),h=s(t.images),d=s(t.shapes),p=s(t.skeletons),m=s(t.animations);a.length>0&&(i.geometries=a),l.length>0&&(i.materials=l),u.length>0&&(i.textures=u),h.length>0&&(i.images=h),d.length>0&&(i.shapes=d),p.length>0&&(i.skeletons=p),m.length>0&&(i.animations=m)}return i.object=r,i;function s(a){const l=[];for(const u in a){const h=a[u];delete h.metadata,l.push(h)}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 i=0;i<t.children.length;i++){const r=t.children[i];this.add(r.clone())}return this}}hi.DefaultUp=new S(0,1,0),hi.DefaultMatrixAutoUpdate=!0,hi.prototype.isObject3D=!0;const Hr=new S,bo=new S,yh=new S,io=new S,na=new S,gs=new S,xh=new S,ci=new S,ud=new S,hd=new S;class ji{constructor(t=new S,e=new S,i=new S){this.a=t,this.b=e,this.c=i}static getNormal(t,e,i,r){r.subVectors(i,e),Hr.subVectors(t,e),r.cross(Hr);const o=r.lengthSq();return o>0?r.multiplyScalar(1/Math.sqrt(o)):r.set(0,0,0)}static getBarycoord(t,e,i,r,o){Hr.subVectors(r,e),bo.subVectors(i,e),yh.subVectors(t,e);const s=Hr.dot(Hr),a=Hr.dot(bo),l=Hr.dot(yh),u=bo.dot(bo),h=bo.dot(yh),d=s*u-a*a;if(d===0)return o.set(-2,-1,-1);const p=1/d,m=(u*l-a*h)*p,g=(s*h-a*l)*p;return o.set(1-m-g,g,m)}static containsPoint(t,e,i,r){return this.getBarycoord(t,e,i,r,io),io.x>=0&&io.y>=0&&io.x+io.y<=1}static getUV(t,e,i,r,o,s,a,l){return this.getBarycoord(t,e,i,r,io),l.set(0,0),l.addScaledVector(o,io.x),l.addScaledVector(s,io.y),l.addScaledVector(a,io.z),l}static isFrontFacing(t,e,i,r){return Hr.subVectors(i,e),bo.subVectors(t,e),Hr.cross(bo).dot(r)<0}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,r){return this.a.copy(t[e]),this.b.copy(t[i]),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 Hr.subVectors(this.c,this.b),bo.subVectors(this.a,this.b),.5*Hr.cross(bo).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return ji.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return ji.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,i,r,o){return ji.getUV(t,this.a,this.b,this.c,e,i,r,o)}containsPoint(t){return ji.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return ji.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const i=this.a,r=this.b,o=this.c;let s,a;na.subVectors(r,i),gs.subVectors(o,i),ci.subVectors(t,i);const l=na.dot(ci),u=gs.dot(ci);if(l<=0&&u<=0)return e.copy(i);ud.subVectors(t,r);const h=na.dot(ud),d=gs.dot(ud);if(h>=0&&d<=h)return e.copy(r);const p=l*d-h*u;if(p<=0&&l>=0&&h<=0)return s=l/(l-h),e.copy(i).addScaledVector(na,s);hd.subVectors(t,o);const m=na.dot(hd),g=gs.dot(hd);if(g>=0&&m<=g)return e.copy(o);const _=m*u-l*g;if(_<=0&&u>=0&&g<=0)return a=u/(u-g),e.copy(i).addScaledVector(gs,a);const y=h*g-m*d;if(y<=0&&d-h>=0&&m-g>=0)return xh.subVectors(o,r),a=(d-h)/(d-h+(m-g)),e.copy(r).addScaledVector(xh,a);const w=1/(y+_+p);return s=_*w,a=p*w,e.copy(i).addScaledVector(na,s).addScaledVector(gs,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}let df=0;class Dn extends ko{constructor(){super(),Object.defineProperty(this,"id",{value:df++}),this.uuid=Ar(),this.name="",this.type="Material",this.fog=!0,this.blending=ot,this.side=j,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=ei,this.blendDst=Ze,this.blendEquation=Et,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=On,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Bl,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Ei,this.stencilZFail=Ei,this.stencilZPass=Ei,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 i=t[e];if(i===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=i===qt;continue}const r=this[e];r!==void 0?r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[e]=i: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 i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(o){const s=[];for(const a in o){const l=o[a];delete l.metadata,s.push(l)}return s}if(i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(i.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==ot&&(i.blending=this.blending),this.side!==j&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.colorWrite=this.colorWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,this.rotation&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(i.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.morphTargets===!0&&(i.morphTargets=!0),this.morphNormals===!0&&(i.morphNormals=!0),this.flatShading===!0&&(i.flatShading=this.flatShading),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(i.userData=this.userData),e){const o=r(t.textures),s=r(t.images);o.length>0&&(i.textures=o),s.length>0&&(i.images=s)}return i}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 i=null;if(e!==null){const r=e.length;i=new Array(r);for(let o=0;o!==r;++o)i[o]=e[o].clone()}return this.clippingPlanes=i,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++}}Dn.prototype.isMaterial=!0;const pf={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},ln={h:0,s:0,l:0},bh={h:0,s:0,l:0};function ja(n,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?n+6*(t-n)*e:e<.5?t:e<2/3?n+6*(t-n)*(2/3-e):n}function Vl(n){return n<.04045?.0773993808*n:Math.pow(.9478672986*n+.0521327014,2.4)}function wh(n){return n<.0031308?12.92*n:1.055*Math.pow(n,.41666)-.055}class Le{constructor(t,e,i){return e===void 0&&i===void 0?this.set(t):this.setRGB(t,e,i)}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,i){return this.r=t,this.g=e,this.b=i,this}setHSL(t,e,i){if(t=dh(t,1),e=zn(e,0,1),i=zn(i,0,1),e===0)this.r=this.g=this.b=i;else{const r=i<=.5?i*(1+e):i+e-i*e,o=2*i-r;this.r=ja(o,r,t+1/3),this.g=ja(o,r,t),this.b=ja(o,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 i;if(i=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let r;const o=i[1],s=i[2];switch(o){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))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(s))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(s)){const a=parseFloat(r[1])/360,l=parseInt(r[2],10)/100,u=parseInt(r[3],10)/100;return e(r[4]),this.setHSL(a,l,u)}}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){const r=i[1],o=r.length;if(o===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(o===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=pf[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 i=e>0?1/e:1;return this.r=Math.pow(t.r,i),this.g=Math.pow(t.g,i),this.b=Math.pow(t.b,i),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.r=Vl(t.r),this.g=Vl(t.g),this.b=Vl(t.b),this}copyLinearToSRGB(t){return this.r=wh(t.r),this.g=wh(t.g),this.b=wh(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,i=this.g,r=this.b,o=Math.max(e,i,r),s=Math.min(e,i,r);let a,l;const u=(s+o)/2;if(s===o)a=0,l=0;else{const h=o-s;switch(l=u<=.5?h/(o+s):h/(2-o-s),o){case e:a=(i-r)/h+(i<r?6:0);break;case i:a=(r-e)/h+2;break;case r:a=(e-i)/h+4}a/=6}return t.h=a,t.s=l,t.l=u,t}getStyle(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"}offsetHSL(t,e,i){return this.getHSL(ln),ln.h+=t,ln.s+=e,ln.l+=i,this.setHSL(ln.h,ln.s,ln.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,i){return this.r=t.r+(e.r-t.r)*i,this.g=t.g+(e.g-t.g)*i,this.b=t.b+(e.b-t.b)*i,this}lerpHSL(t,e){this.getHSL(ln),t.getHSL(bh);const i=kl(ln.h,bh.h,e),r=kl(ln.s,bh.s,e),o=kl(ln.l,bh.l,e);return this.setHSL(i,r,o),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()}}Le.NAMES=pf,Le.prototype.isColor=!0,Le.prototype.r=1,Le.prototype.g=1,Le.prototype.b=1;class pn extends Dn{constructor(t){super(),this.type="MeshBasicMaterial",this.color=new Le(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=Hs,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}}pn.prototype.isMeshBasicMaterial=!0;const Si=new S,Va=new ce;class mi{constructor(t,e,i){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=i===!0,this.usage=Js,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,i){t*=this.itemSize,i*=e.itemSize;for(let r=0,o=this.itemSize;r<o;r++)this.array[t+r]=e.array[i+r];return this}copyArray(t){return this.array.set(t),this}copyColorsArray(t){const e=this.array;let i=0;for(let r=0,o=t.length;r<o;r++){let s=t[r];s===void 0&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),s=new Le),e[i++]=s.r,e[i++]=s.g,e[i++]=s.b}return this}copyVector2sArray(t){const e=this.array;let i=0;for(let r=0,o=t.length;r<o;r++){let s=t[r];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),s=new ce),e[i++]=s.x,e[i++]=s.y}return this}copyVector3sArray(t){const e=this.array;let i=0;for(let r=0,o=t.length;r<o;r++){let s=t[r];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),s=new S),e[i++]=s.x,e[i++]=s.y,e[i++]=s.z}return this}copyVector4sArray(t){const e=this.array;let i=0;for(let r=0,o=t.length;r<o;r++){let s=t[r];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),s=new Li),e[i++]=s.x,e[i++]=s.y,e[i++]=s.z,e[i++]=s.w}return this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,i=this.count;e<i;e++)Va.fromBufferAttribute(this,e),Va.applyMatrix3(t),this.setXY(e,Va.x,Va.y);else if(this.itemSize===3)for(let e=0,i=this.count;e<i;e++)Si.fromBufferAttribute(this,e),Si.applyMatrix3(t),this.setXYZ(e,Si.x,Si.y,Si.z);return this}applyMatrix4(t){for(let e=0,i=this.count;e<i;e++)Si.x=this.getX(e),Si.y=this.getY(e),Si.z=this.getZ(e),Si.applyMatrix4(t),this.setXYZ(e,Si.x,Si.y,Si.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)Si.x=this.getX(e),Si.y=this.getY(e),Si.z=this.getZ(e),Si.applyNormalMatrix(t),this.setXYZ(e,Si.x,Si.y,Si.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)Si.x=this.getX(e),Si.y=this.getY(e),Si.z=this.getZ(e),Si.transformDirection(t),this.setXYZ(e,Si.x,Si.y,Si.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,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this}setXYZ(t,e,i,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=r,this}setXYZW(t,e,i,r,o){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=r,this.array[t+3]=o,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!==Js&&(t.usage=this.usage),this.updateRange.offset===0&&this.updateRange.count===-1||(t.updateRange=this.updateRange),t}}mi.prototype.isBufferAttribute=!0;class Wl extends mi{constructor(t,e,i){super(new Int8Array(t),e,i)}}class cd extends mi{constructor(t,e,i){super(new Uint8Array(t),e,i)}}class Sh extends mi{constructor(t,e,i){super(new Uint8ClampedArray(t),e,i)}}class dd extends mi{constructor(t,e,i){super(new Int16Array(t),e,i)}}class Wa extends mi{constructor(t,e,i){super(new Uint16Array(t),e,i)}}class Th extends mi{constructor(t,e,i){super(new Int32Array(t),e,i)}}class no extends mi{constructor(t,e,i){super(new Uint32Array(t),e,i)}}class ff extends mi{constructor(t,e,i){super(new Uint16Array(t),e,i)}}ff.prototype.isFloat16BufferAttribute=!0;class _e extends mi{constructor(t,e,i){super(new Float32Array(t),e,i)}}class pd extends mi{constructor(t,e,i){super(new Float64Array(t),e,i)}}function fd(n){if(n.length===0)return-1/0;let t=n[0];for(let e=1,i=n.length;e<i;++e)n[e]>t&&(t=n[e]);return t}const md={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function ra(n,t){return new md[n](t)}let mf=0;const Cr=new Ee,Eh=new hi,Mn=new S,un=new Yi,vs=new Yi,en=new S;class ze extends ko{constructor(){super(),Object.defineProperty(this,"id",{value:mf++}),this.uuid=Ar(),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(fd(t)>65535?no:Wa)(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,i=0){this.groups.push({start:t,count:e,materialIndex:i})}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 i=this.attributes.normal;if(i!==void 0){const o=new zi().getNormalMatrix(t);i.applyNormalMatrix(o),i.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 Cr.makeRotationFromQuaternion(t),this.applyMatrix4(Cr),this}rotateX(t){return Cr.makeRotationX(t),this.applyMatrix4(Cr),this}rotateY(t){return Cr.makeRotationY(t),this.applyMatrix4(Cr),this}rotateZ(t){return Cr.makeRotationZ(t),this.applyMatrix4(Cr),this}translate(t,e,i){return Cr.makeTranslation(t,e,i),this.applyMatrix4(Cr),this}scale(t,e,i){return Cr.makeScale(t,e,i),this.applyMatrix4(Cr),this}lookAt(t){return Eh.lookAt(t),Eh.updateMatrix(),this.applyMatrix4(Eh.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Mn).negate(),this.translate(Mn.x,Mn.y,Mn.z),this}setFromPoints(t){const e=[];for(let i=0,r=t.length;i<r;i++){const o=t[i];e.push(o.x,o.y,o.z||0)}return this.setAttribute("position",new _e(e,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Yi);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 S(-1/0,-1/0,-1/0),new S(1/0,1/0,1/0));if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let i=0,r=e.length;i<r;i++){const o=e[i];un.setFromBufferAttribute(o),this.morphTargetsRelative?(en.addVectors(this.boundingBox.min,un.min),this.boundingBox.expandByPoint(en),en.addVectors(this.boundingBox.max,un.max),this.boundingBox.expandByPoint(en)):(this.boundingBox.expandByPoint(un.min),this.boundingBox.expandByPoint(un.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 En);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 S,1/0);if(t){const i=this.boundingSphere.center;if(un.setFromBufferAttribute(t),e)for(let o=0,s=e.length;o<s;o++){const a=e[o];vs.setFromBufferAttribute(a),this.morphTargetsRelative?(en.addVectors(un.min,vs.min),un.expandByPoint(en),en.addVectors(un.max,vs.max),un.expandByPoint(en)):(un.expandByPoint(vs.min),un.expandByPoint(vs.max))}un.getCenter(i);let r=0;for(let o=0,s=t.count;o<s;o++)en.fromBufferAttribute(t,o),r=Math.max(r,i.distanceToSquared(en));if(e)for(let o=0,s=e.length;o<s;o++){const a=e[o],l=this.morphTargetsRelative;for(let u=0,h=a.count;u<h;u++)en.fromBufferAttribute(a,u),l&&(Mn.fromBufferAttribute(t,u),en.add(Mn)),r=Math.max(r,i.distanceToSquared(en))}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 i=t.array,r=e.position.array,o=e.normal.array,s=e.uv.array,a=r.length/3;e.tangent===void 0&&this.setAttribute("tangent",new mi(new Float32Array(4*a),4));const l=e.tangent.array,u=[],h=[];for(let it=0;it<a;it++)u[it]=new S,h[it]=new S;const d=new S,p=new S,m=new S,g=new ce,_=new ce,y=new ce,w=new S,A=new S;function I(it,tt,rt){d.fromArray(r,3*it),p.fromArray(r,3*tt),m.fromArray(r,3*rt),g.fromArray(s,2*it),_.fromArray(s,2*tt),y.fromArray(s,2*rt),p.sub(d),m.sub(d),_.sub(g),y.sub(g);const et=1/(_.x*y.y-y.x*_.y);isFinite(et)&&(w.copy(p).multiplyScalar(y.y).addScaledVector(m,-_.y).multiplyScalar(et),A.copy(m).multiplyScalar(_.x).addScaledVector(p,-y.x).multiplyScalar(et),u[it].add(w),u[tt].add(w),u[rt].add(w),h[it].add(A),h[tt].add(A),h[rt].add(A))}let F=this.groups;F.length===0&&(F=[{start:0,count:i.length}]);for(let it=0,tt=F.length;it<tt;++it){const rt=F[it],et=rt.start;for(let pt=et,kt=et+rt.count;pt<kt;pt+=3)I(i[pt+0],i[pt+1],i[pt+2])}const N=new S,U=new S,B=new S,G=new S;function ct(it){B.fromArray(o,3*it),G.copy(B);const tt=u[it];N.copy(tt),N.sub(B.multiplyScalar(B.dot(tt))).normalize(),U.crossVectors(G,tt);const rt=U.dot(h[it])<0?-1:1;l[4*it]=N.x,l[4*it+1]=N.y,l[4*it+2]=N.z,l[4*it+3]=rt}for(let it=0,tt=F.length;it<tt;++it){const rt=F[it],et=rt.start;for(let pt=et,kt=et+rt.count;pt<kt;pt+=3)ct(i[pt+0]),ct(i[pt+1]),ct(i[pt+2])}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(e!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new mi(new Float32Array(3*e.count),3),this.setAttribute("normal",i);else for(let p=0,m=i.count;p<m;p++)i.setXYZ(p,0,0,0);const r=new S,o=new S,s=new S,a=new S,l=new S,u=new S,h=new S,d=new S;if(t)for(let p=0,m=t.count;p<m;p+=3){const g=t.getX(p+0),_=t.getX(p+1),y=t.getX(p+2);r.fromBufferAttribute(e,g),o.fromBufferAttribute(e,_),s.fromBufferAttribute(e,y),h.subVectors(s,o),d.subVectors(r,o),h.cross(d),a.fromBufferAttribute(i,g),l.fromBufferAttribute(i,_),u.fromBufferAttribute(i,y),a.add(h),l.add(h),u.add(h),i.setXYZ(g,a.x,a.y,a.z),i.setXYZ(_,l.x,l.y,l.z),i.setXYZ(y,u.x,u.y,u.z)}else for(let p=0,m=e.count;p<m;p+=3)r.fromBufferAttribute(e,p+0),o.fromBufferAttribute(e,p+1),s.fromBufferAttribute(e,p+2),h.subVectors(s,o),d.subVectors(r,o),h.cross(d),i.setXYZ(p+0,h.x,h.y,h.z),i.setXYZ(p+1,h.x,h.y,h.z),i.setXYZ(p+2,h.x,h.y,h.z);this.normalizeNormals(),i.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 i=this.attributes;for(const r in i){if(t.attributes[r]===void 0)continue;const o=i[r].array,s=t.attributes[r],a=s.array,l=s.itemSize*e,u=Math.min(a.length,o.length-l);for(let h=0,d=l;h<u;h++,d++)o[d]=a[h]}return this}normalizeNormals(){const t=this.attributes.normal;for(let e=0,i=t.count;e<i;e++)en.fromBufferAttribute(t,e),en.normalize(),t.setXYZ(e,en.x,en.y,en.z)}toNonIndexed(){function t(a,l){const u=a.array,h=a.itemSize,d=a.normalized,p=new u.constructor(l.length*h);let m=0,g=0;for(let _=0,y=l.length;_<y;_++){m=a.isInterleavedBufferAttribute?l[_]*a.data.stride+a.offset:l[_]*h;for(let w=0;w<h;w++)p[g++]=u[m++]}return new mi(p,h,d)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new ze,i=this.index.array,r=this.attributes;for(const a in r){const l=t(r[a],i);e.setAttribute(a,l)}const o=this.morphAttributes;for(const a in o){const l=[],u=o[a];for(let h=0,d=u.length;h<d;h++){const p=t(u[h],i);l.push(p)}e.morphAttributes[a]=l}e.morphTargetsRelative=this.morphTargetsRelative;const s=this.groups;for(let a=0,l=s.length;a<l;a++){const u=s[a];e.addGroup(u.start,u.count,u.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 u in l)l[u]!==void 0&&(t[u]=l[u]);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 i=this.attributes;for(const l in i){const u=i[l];t.data.attributes[l]=u.toJSON(t.data)}const r={};let o=!1;for(const l in this.morphAttributes){const u=this.morphAttributes[l],h=[];for(let d=0,p=u.length;d<p;d++){const m=u[d];h.push(m.toJSON(t.data))}h.length>0&&(r[l]=h,o=!0)}o&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return a!==null&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t}clone(){return new ze().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 i=t.index;i!==null&&this.setIndex(i.clone(e));const r=t.attributes;for(const u in r){const h=r[u];this.setAttribute(u,h.clone(e))}const o=t.morphAttributes;for(const u in o){const h=[],d=o[u];for(let p=0,m=d.length;p<m;p++)h.push(d[p].clone(e));this.morphAttributes[u]=h}this.morphTargetsRelative=t.morphTargetsRelative;const s=t.groups;for(let u=0,h=s.length;u<h;u++){const d=s[u];this.addGroup(d.start,d.count,d.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"})}}ze.prototype.isBufferGeometry=!0;const gd=new Ee,oa=new jo,_s=new En,zr=new S,Vo=new S,Wo=new S,Xa=new S,Mh=new S,qa=new S,Ya=new S,sa=new S,Xl=new S,aa=new ce,ql=new ce,$a=new ce,vd=new S,Yl=new S;class Ti extends hi{constructor(t=new ze,e=new pn){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,i=Object.keys(e);if(i.length>0){const r=e[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=r.length;o<s;o++){const a=r[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=o}}}}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 i=this.geometry,r=this.material,o=this.matrixWorld;if(r===void 0||(i.boundingSphere===null&&i.computeBoundingSphere(),_s.copy(i.boundingSphere),_s.applyMatrix4(o),t.ray.intersectsSphere(_s)===!1)||(gd.copy(o).invert(),oa.copy(t.ray).applyMatrix4(gd),i.boundingBox!==null&&oa.intersectsBox(i.boundingBox)===!1))return;let s;if(i.isBufferGeometry){const a=i.index,l=i.attributes.position,u=i.morphAttributes.position,h=i.morphTargetsRelative,d=i.attributes.uv,p=i.attributes.uv2,m=i.groups,g=i.drawRange;if(a!==null)if(Array.isArray(r))for(let _=0,y=m.length;_<y;_++){const w=m[_],A=r[w.materialIndex];for(let I=Math.max(w.start,g.start),F=Math.min(w.start+w.count,g.start+g.count);I<F;I+=3){const N=a.getX(I),U=a.getX(I+1),B=a.getX(I+2);s=$l(this,A,t,oa,l,u,h,d,p,N,U,B),s&&(s.faceIndex=Math.floor(I/3),s.face.materialIndex=w.materialIndex,e.push(s))}}else for(let _=Math.max(0,g.start),y=Math.min(a.count,g.start+g.count);_<y;_+=3){const w=a.getX(_),A=a.getX(_+1),I=a.getX(_+2);s=$l(this,r,t,oa,l,u,h,d,p,w,A,I),s&&(s.faceIndex=Math.floor(_/3),e.push(s))}else if(l!==void 0)if(Array.isArray(r))for(let _=0,y=m.length;_<y;_++){const w=m[_],A=r[w.materialIndex];for(let I=Math.max(w.start,g.start),F=Math.min(w.start+w.count,g.start+g.count);I<F;I+=3)s=$l(this,A,t,oa,l,u,h,d,p,I,I+1,I+2),s&&(s.faceIndex=Math.floor(I/3),s.face.materialIndex=w.materialIndex,e.push(s))}else for(let _=Math.max(0,g.start),y=Math.min(l.count,g.start+g.count);_<y;_+=3)s=$l(this,r,t,oa,l,u,h,d,p,_,_+1,_+2),s&&(s.faceIndex=Math.floor(_/3),e.push(s))}else i.isGeometry&&console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}function $l(n,t,e,i,r,o,s,a,l,u,h,d){zr.fromBufferAttribute(r,u),Vo.fromBufferAttribute(r,h),Wo.fromBufferAttribute(r,d);const p=n.morphTargetInfluences;if(t.morphTargets&&o&&p){Ya.set(0,0,0),sa.set(0,0,0),Xl.set(0,0,0);for(let g=0,_=o.length;g<_;g++){const y=p[g],w=o[g];y!==0&&(Xa.fromBufferAttribute(w,u),Mh.fromBufferAttribute(w,h),qa.fromBufferAttribute(w,d),s?(Ya.addScaledVector(Xa,y),sa.addScaledVector(Mh,y),Xl.addScaledVector(qa,y)):(Ya.addScaledVector(Xa.sub(zr),y),sa.addScaledVector(Mh.sub(Vo),y),Xl.addScaledVector(qa.sub(Wo),y)))}zr.add(Ya),Vo.add(sa),Wo.add(Xl)}n.isSkinnedMesh&&(n.boneTransform(u,zr),n.boneTransform(h,Vo),n.boneTransform(d,Wo));const m=function(g,_,y,w,A,I,F,N){let U;if(U=_.side===X?w.intersectTriangle(F,I,A,!0,N):w.intersectTriangle(A,I,F,_.side!==K,N),U===null)return null;Yl.copy(N),Yl.applyMatrix4(g.matrixWorld);const B=y.ray.origin.distanceTo(Yl);return B<y.near||B>y.far?null:{distance:B,point:Yl.clone(),object:g}}(n,t,e,i,zr,Vo,Wo,vd);if(m){a&&(aa.fromBufferAttribute(a,u),ql.fromBufferAttribute(a,h),$a.fromBufferAttribute(a,d),m.uv=ji.getUV(vd,zr,Vo,Wo,aa,ql,$a,new ce)),l&&(aa.fromBufferAttribute(l,u),ql.fromBufferAttribute(l,h),$a.fromBufferAttribute(l,d),m.uv2=ji.getUV(vd,zr,Vo,Wo,aa,ql,$a,new ce));const g={a:u,b:h,c:d,normal:new S,materialIndex:0};ji.getNormal(zr,Vo,Wo,g.normal),m.face=g}return m}Ti.prototype.isMesh=!0;class wo extends ze{constructor(t=1,e=1,i=1,r=1,o=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:r,heightSegments:o,depthSegments:s};const a=this;r=Math.floor(r),o=Math.floor(o),s=Math.floor(s);const l=[],u=[],h=[],d=[];let p=0,m=0;function g(_,y,w,A,I,F,N,U,B,G,ct){const it=F/B,tt=N/G,rt=F/2,et=N/2,pt=U/2,kt=B+1,Lt=G+1;let _t=0,xt=0;const jt=new S;for(let ee=0;ee<Lt;ee++){const le=ee*tt-et;for(let nt=0;nt<kt;nt++){const lt=nt*it-rt;jt[_]=lt*A,jt[y]=le*I,jt[w]=pt,u.push(jt.x,jt.y,jt.z),jt[_]=0,jt[y]=0,jt[w]=U>0?1:-1,h.push(jt.x,jt.y,jt.z),d.push(nt/B),d.push(1-ee/G),_t+=1}}for(let ee=0;ee<G;ee++)for(let le=0;le<B;le++){const nt=p+le+kt*ee,lt=p+le+kt*(ee+1),Xt=p+(le+1)+kt*(ee+1),Ut=p+(le+1)+kt*ee;l.push(nt,lt,Ut),l.push(lt,Xt,Ut),xt+=6}a.addGroup(m,xt,ct),m+=xt,p+=_t}g("z","y","x",-1,-1,i,e,t,s,o,0),g("z","y","x",1,-1,i,e,-t,s,o,1),g("x","z","y",1,1,t,i,e,r,s,2),g("x","z","y",1,-1,t,i,-e,r,s,3),g("x","y","z",1,-1,t,e,i,r,o,4),g("x","y","z",-1,-1,t,e,-i,r,o,5),this.setIndex(l),this.setAttribute("position",new _e(u,3)),this.setAttribute("normal",new _e(h,3)),this.setAttribute("uv",new _e(d,2))}static fromJSON(t){return new wo(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function Ja(n){const t={};for(const e in n){t[e]={};for(const i in n[e]){const r=n[e][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?t[e][i]=r.clone():Array.isArray(r)?t[e][i]=r.slice():t[e][i]=r}}return t}function jn(n){const t={};for(let e=0;e<n.length;e++){const i=Ja(n[e]);for(const r in i)t[r]=i[r]}return t}const So={clone:Ja,merge:jn};class rr extends Dn{constructor(t){super(),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=`void main() {
|
|
1832
1832
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
1833
1833
|
}`,this.fragmentShader=`void main() {
|
|
1834
1834
|
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
|
|
@@ -4678,7 +4678,7 @@ void main() {
|
|
|
4678
4678
|
precision `+n.precision+" int;";return n.precision==="highp"?t+=`
|
|
4679
4679
|
#define HIGH_PRECISION`:n.precision==="mediump"?t+=`
|
|
4680
4680
|
#define MEDIUM_PRECISION`:n.precision==="lowp"&&(t+=`
|
|
4681
|
-
#define LOW_PRECISION`),t}function Ld(n,t,e,i){const r=n.getContext(),o=e.defines;let s=e.vertexShader,a=e.fragmentShader;const l=function(G){let ct="SHADOWMAP_TYPE_BASIC";return G.shadowMapType===O?ct="SHADOWMAP_TYPE_PCF":G.shadowMapType===Y?ct="SHADOWMAP_TYPE_PCF_SOFT":G.shadowMapType===
|
|
4681
|
+
#define LOW_PRECISION`),t}function Ld(n,t,e,i){const r=n.getContext(),o=e.defines;let s=e.vertexShader,a=e.fragmentShader;const l=function(G){let ct="SHADOWMAP_TYPE_BASIC";return G.shadowMapType===O?ct="SHADOWMAP_TYPE_PCF":G.shadowMapType===Y?ct="SHADOWMAP_TYPE_PCF_SOFT":G.shadowMapType===C&&(ct="SHADOWMAP_TYPE_VSM"),ct}(e),u=function(G){let ct="ENVMAP_TYPE_CUBE";if(G.envMap)switch(G.envMapMode){case zt:case ne:ct="ENVMAP_TYPE_CUBE";break;case xe:case Ie:ct="ENVMAP_TYPE_CUBE_UV"}return ct}(e),h=function(G){let ct="ENVMAP_MODE_REFLECTION";if(G.envMap)switch(G.envMapMode){case ne:case Ie:ct="ENVMAP_MODE_REFRACTION"}return ct}(e),d=function(G){let ct="ENVMAP_BLENDING_NONE";if(G.envMap)switch(G.combine){case Hs:ct="ENVMAP_BLENDING_MULTIPLY";break;case zu:ct="ENVMAP_BLENDING_MIX";break;case Oa:ct="ENVMAP_BLENDING_ADD"}return ct}(e),p=n.gammaFactor>0?n.gammaFactor:1,m=e.isWebGL2?"":function(G){return[G.extensionDerivatives||G.envMapCubeUV||G.bumpMap||G.tangentSpaceNormalMap||G.clearcoatNormalMap||G.flatShading||G.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(G.extensionFragDepth||G.logarithmicDepthBuffer)&&G.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",G.extensionDrawBuffers&&G.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(G.extensionShaderTextureLOD||G.envMap||G.transmission>0)&&G.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Vi).join(`
|
|
4682
4682
|
`)}(e),g=function(G){const ct=[];for(const it in G){const tt=G[it];tt!==!1&&ct.push("#define "+it+" "+tt)}return ct.join(`
|
|
4683
4683
|
`)}(o),_=r.createProgram();let y,w,A=e.glslVersion?"#version "+e.glslVersion+`
|
|
4684
4684
|
`:"";e.isRawShaderMaterial?(y=[g].filter(Vi).join(`
|
|
@@ -4719,7 +4719,7 @@ void main() {
|
|
|
4719
4719
|
squared_mean = squared_mean * HALF_SAMPLE_RATE;
|
|
4720
4720
|
float std_dev = sqrt( squared_mean - mean * mean );
|
|
4721
4721
|
gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
|
|
4722
|
-
}`}),m=p.clone();m.defines.HORIZONTAL_PASS=1;const g=new ze;g.setAttribute("position",new mi(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new Ti(g,p),y=this;function w(U,B){const G=t.update(_);p.uniforms.shadow_pass.value=U.map.texture,p.uniforms.resolution.value=U.mapSize,p.uniforms.radius.value=U.radius,n.setRenderTarget(U.mapPass),n.clear(),n.renderBufferDirect(B,null,G,p,_,null),m.uniforms.shadow_pass.value=U.mapPass.texture,m.uniforms.resolution.value=U.mapSize,m.uniforms.radius.value=U.radius,n.setRenderTarget(U.map),n.clear(),n.renderBufferDirect(B,null,G,m,_,null)}function A(U){const B=U<<0;let G=a[B];return G===void 0&&(G=new xi({depthPacking:Kc,morphTargets:U}),a[B]=G),G}function I(U){const B=U<<0;let G=l[B];return G===void 0&&(G=new Dh({morphTargets:U}),l[B]=G),G}function F(U,B,G,ct,it,tt,rt){let et=null,pt=A,kt=U.customDepthMaterial;if(ct.isPointLight===!0&&(pt=I,kt=U.customDistanceMaterial),kt===void 0){let Lt=!1;G.morphTargets===!0&&(Lt=B.morphAttributes&&B.morphAttributes.position&&B.morphAttributes.position.length>0),et=pt(Lt)}else et=kt;if(n.localClippingEnabled&&G.clipShadows===!0&&G.clippingPlanes.length!==0){const Lt=et.uuid,_t=G.uuid;let xt=u[Lt];xt===void 0&&(xt={},u[Lt]=xt);let jt=xt[_t];jt===void 0&&(jt=et.clone(),xt[_t]=jt),et=jt}return et.visible=G.visible,et.wireframe=G.wireframe,et.side=rt===P?G.shadowSide!==null?G.shadowSide:G.side:G.shadowSide!==null?G.shadowSide:d[G.side],et.clipShadows=G.clipShadows,et.clippingPlanes=G.clippingPlanes,et.clipIntersection=G.clipIntersection,et.wireframeLinewidth=G.wireframeLinewidth,et.linewidth=G.linewidth,ct.isPointLight===!0&&et.isMeshDistanceMaterial===!0&&(et.referencePosition.setFromMatrixPosition(ct.matrixWorld),et.nearDistance=it,et.farDistance=tt),et}function N(U,B,G,ct,it){if(U.visible===!1)return;if(U.layers.test(B.layers)&&(U.isMesh||U.isLine||U.isPoints)&&(U.castShadow||U.receiveShadow&&it===P)&&(!U.frustumCulled||i.intersectsObject(U))){U.modelViewMatrix.multiplyMatrices(G.matrixWorldInverse,U.matrixWorld);const rt=t.update(U),et=U.material;if(Array.isArray(et)){const pt=rt.groups;for(let kt=0,Lt=pt.length;kt<Lt;kt++){const _t=pt[kt],xt=et[_t.materialIndex];if(xt&&xt.visible){const jt=F(U,rt,xt,ct,G.near,G.far,it);n.renderBufferDirect(G,null,rt,jt,U,_t)}}}else if(et.visible){const pt=F(U,rt,et,ct,G.near,G.far,it);n.renderBufferDirect(G,null,rt,pt,U,null)}}const tt=U.children;for(let rt=0,et=tt.length;rt<et;rt++)N(tt[rt],B,G,ct,it)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=O,this.render=function(U,B,G){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||U.length===0)return;const ct=n.getRenderTarget(),it=n.getActiveCubeFace(),tt=n.getActiveMipmapLevel(),rt=n.state;rt.setBlending(Ct),rt.buffers.color.setClear(1,1,1,1),rt.buffers.depth.setTest(!0),rt.setScissorTest(!1);for(let et=0,pt=U.length;et<pt;et++){const kt=U[et],Lt=kt.shadow;if(Lt===void 0){console.warn("THREE.WebGLShadowMap:",kt,"has no shadow.");continue}if(Lt.autoUpdate===!1&&Lt.needsUpdate===!1)continue;r.copy(Lt.mapSize);const _t=Lt.getFrameExtents();if(r.multiply(_t),o.copy(Lt.mapSize),(r.x>h||r.y>h)&&(r.x>h&&(o.x=Math.floor(h/_t.x),r.x=o.x*_t.x,Lt.mapSize.x=o.x),r.y>h&&(o.y=Math.floor(h/_t.y),r.y=o.y*_t.y,Lt.mapSize.y=o.y)),Lt.map===null&&!Lt.isPointLightShadow&&this.type===P){const jt={minFilter:qi,magFilter:qi,format:Tr};Lt.map=new Kr(r.x,r.y,jt),Lt.map.texture.name=kt.name+".shadowMap",Lt.mapPass=new Kr(r.x,r.y,jt),Lt.camera.updateProjectionMatrix()}if(Lt.map===null){const jt={minFilter:fi,magFilter:fi,format:Tr};Lt.map=new Kr(r.x,r.y,jt),Lt.map.texture.name=kt.name+".shadowMap",Lt.camera.updateProjectionMatrix()}n.setRenderTarget(Lt.map),n.clear();const xt=Lt.getViewportCount();for(let jt=0;jt<xt;jt++){const ee=Lt.getViewport(jt);s.set(o.x*ee.x,o.y*ee.y,o.x*ee.z,o.y*ee.w),rt.viewport(s),Lt.updateMatrices(kt,jt),i=Lt.getFrustum(),N(B,G,Lt.camera,kt,this.type)}Lt.isPointLightShadow||this.type!==P||w(Lt,G),Lt.needsUpdate=!1}y.needsUpdate=!1,n.setRenderTarget(ct,it,tt)}}function Fh(n,t,e){const i=e.isWebGL2,r=new function(){let Q=!1;const gt=new Li;let Dt=null;const Ft=new Li(0,0,0,0);return{setMask:function(St){Dt===St||Q||(n.colorMask(St,St,St,St),Dt=St)},setLocked:function(St){Q=St},setClear:function(St,Yt,Me,Re,Ae){Ae===!0&&(St*=Re,Yt*=Re,Me*=Re),gt.set(St,Yt,Me,Re),Ft.equals(gt)===!1&&(n.clearColor(St,Yt,Me,Re),Ft.copy(gt))},reset:function(){Q=!1,Dt=null,Ft.set(-1,0,0,0)}}},o=new function(){let Q=!1,gt=null,Dt=null,Ft=null;return{setTest:function(St){St?le(2929):nt(2929)},setMask:function(St){gt===St||Q||(n.depthMask(St),gt=St)},setFunc:function(St){if(Dt!==St){if(St)switch(St){case Ki:n.depthFunc(512);break;case Ii:n.depthFunc(519);break;case Ui:n.depthFunc(513);break;case On:n.depthFunc(515);break;case Qi:n.depthFunc(514);break;case Yn:n.depthFunc(518);break;case $n:n.depthFunc(516);break;case La:n.depthFunc(517);break;default:n.depthFunc(515)}else n.depthFunc(515);Dt=St}},setLocked:function(St){Q=St},setClear:function(St){Ft!==St&&(n.clearDepth(St),Ft=St)},reset:function(){Q=!1,gt=null,Dt=null,Ft=null}}},s=new function(){let Q=!1,gt=null,Dt=null,Ft=null,St=null,Yt=null,Me=null,Re=null,Ae=null;return{setTest:function(si){Q||(si?le(2960):nt(2960))},setMask:function(si){gt===si||Q||(n.stencilMask(si),gt=si)},setFunc:function(si,Tn,Ni){Dt===si&&Ft===Tn&&St===Ni||(n.stencilFunc(si,Tn,Ni),Dt=si,Ft=Tn,St=Ni)},setOp:function(si,Tn,Ni){Yt===si&&Me===Tn&&Re===Ni||(n.stencilOp(si,Tn,Ni),Yt=si,Me=Tn,Re=Ni)},setLocked:function(si){Q=si},setClear:function(si){Ae!==si&&(n.clearStencil(si),Ae=si)},reset:function(){Q=!1,gt=null,Dt=null,Ft=null,St=null,Yt=null,Me=null,Re=null,Ae=null}}};let a={},l=null,u={},h=null,d=!1,p=null,m=null,g=null,_=null,y=null,w=null,A=null,I=!1,F=null,N=null,U=null,B=null,G=null;const ct=n.getParameter(35661);let it=!1,tt=0;const rt=n.getParameter(7938);rt.indexOf("WebGL")!==-1?(tt=parseFloat(/^WebGL (\d)/.exec(rt)[1]),it=tt>=1):rt.indexOf("OpenGL ES")!==-1&&(tt=parseFloat(/^OpenGL ES (\d)/.exec(rt)[1]),it=tt>=2);let et=null,pt={};const kt=n.getParameter(3088),Lt=n.getParameter(2978),_t=new Li().fromArray(kt),xt=new Li().fromArray(Lt);function jt(Q,gt,Dt){const Ft=new Uint8Array(4),St=n.createTexture();n.bindTexture(Q,St),n.texParameteri(Q,10241,9728),n.texParameteri(Q,10240,9728);for(let Yt=0;Yt<Dt;Yt++)n.texImage2D(gt+Yt,0,6408,1,1,0,6408,5121,Ft);return St}const ee={};function le(Q){a[Q]!==!0&&(n.enable(Q),a[Q]=!0)}function nt(Q){a[Q]!==!1&&(n.disable(Q),a[Q]=!1)}ee[3553]=jt(3553,3553,1),ee[34067]=jt(34067,34069,6),r.setClear(0,0,0,1),o.setClear(1),s.setClear(0),le(2929),o.setFunc(On),Bt(!1),ue(Ot),le(2884),Ut(Ct);const lt={[Et]:32774,[At]:32778,[Rt]:32779};if(i)lt[Wt]=32775,lt[$t]=32776;else{const Q=t.get("EXT_blend_minmax");Q!==null&&(lt[Wt]=Q.MIN_EXT,lt[$t]=Q.MAX_EXT)}const Xt={[ye]:0,[me]:1,[ui]:768,[ei]:770,[Ci]:776,[Bi]:774,[ri]:772,[be]:769,[Ze]:771,[Di]:775,[De]:773};function Ut(Q,gt,Dt,Ft,St,Yt,Me,Re){if(Q!==Ct){if(d===!1&&(le(3042),d=!0),Q===ft)St=St||gt,Yt=Yt||Dt,Me=Me||Ft,gt===m&&St===y||(n.blendEquationSeparate(lt[gt],lt[St]),m=gt,y=St),Dt===g&&Ft===_&&Yt===w&&Me===A||(n.blendFuncSeparate(Xt[Dt],Xt[Ft],Xt[Yt],Xt[Me]),g=Dt,_=Ft,w=Yt,A=Me),p=Q,I=null;else if(Q!==p||Re!==I){if(m===Et&&y===Et||(n.blendEquation(32774),m=Et,y=Et),Re)switch(Q){case ot:n.blendFuncSeparate(1,771,1,771);break;case yt:n.blendFunc(1,1);break;case Pt:n.blendFuncSeparate(0,0,769,771);break;case H:n.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",Q)}else switch(Q){case ot:n.blendFuncSeparate(770,771,1,771);break;case yt:n.blendFunc(770,1);break;case Pt:n.blendFunc(0,769);break;case H:n.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",Q)}g=null,_=null,w=null,A=null,p=Q,I=Re}}else d===!0&&(nt(3042),d=!1)}function Bt(Q){F!==Q&&(Q?n.frontFace(2304):n.frontFace(2305),F=Q)}function ue(Q){Q!==vt?(le(2884),Q!==N&&(Q===Ot?n.cullFace(1029):Q===Nt?n.cullFace(1028):n.cullFace(1032))):nt(2884),N=Q}function he(Q,gt,Dt){Q?(le(32823),B===gt&&G===Dt||(n.polygonOffset(gt,Dt),B=gt,G=Dt)):nt(32823)}function Vt(Q){Q===void 0&&(Q=33984+ct-1),et!==Q&&(n.activeTexture(Q),et=Q)}return{buffers:{color:r,depth:o,stencil:s},enable:le,disable:nt,bindFramebuffer:function(Q,gt){return gt===null&&l!==null&&(gt=l),u[Q]!==gt&&(n.bindFramebuffer(Q,gt),u[Q]=gt,i&&(Q===36009&&(u[36160]=gt),Q===36160&&(u[36009]=gt)),!0)},bindXRFramebuffer:function(Q){Q!==l&&(n.bindFramebuffer(36160,Q),l=Q)},useProgram:function(Q){return h!==Q&&(n.useProgram(Q),h=Q,!0)},setBlending:Ut,setMaterial:function(Q,gt){Q.side===K?nt(2884):le(2884);let Dt=Q.side===X;gt&&(Dt=!Dt),Bt(Dt),Q.blending===ot&&Q.transparent===!1?Ut(Ct):Ut(Q.blending,Q.blendEquation,Q.blendSrc,Q.blendDst,Q.blendEquationAlpha,Q.blendSrcAlpha,Q.blendDstAlpha,Q.premultipliedAlpha),o.setFunc(Q.depthFunc),o.setTest(Q.depthTest),o.setMask(Q.depthWrite),r.setMask(Q.colorWrite);const Ft=Q.stencilWrite;s.setTest(Ft),Ft&&(s.setMask(Q.stencilWriteMask),s.setFunc(Q.stencilFunc,Q.stencilRef,Q.stencilFuncMask),s.setOp(Q.stencilFail,Q.stencilZFail,Q.stencilZPass)),he(Q.polygonOffset,Q.polygonOffsetFactor,Q.polygonOffsetUnits),Q.alphaToCoverage===!0?le(32926):nt(32926)},setFlipSided:Bt,setCullFace:ue,setLineWidth:function(Q){Q!==U&&(it&&n.lineWidth(Q),U=Q)},setPolygonOffset:he,setScissorTest:function(Q){Q?le(3089):nt(3089)},activeTexture:Vt,bindTexture:function(Q,gt){et===null&&Vt();let Dt=pt[et];Dt===void 0&&(Dt={type:void 0,texture:void 0},pt[et]=Dt),Dt.type===Q&&Dt.texture===gt||(n.bindTexture(Q,gt||ee[Q]),Dt.type=Q,Dt.texture=gt)},unbindTexture:function(){const Q=pt[et];Q!==void 0&&Q.type!==void 0&&(n.bindTexture(Q.type,null),Q.type=void 0,Q.texture=void 0)},compressedTexImage2D:function(){try{n.compressedTexImage2D.apply(n,arguments)}catch(Q){console.error("THREE.WebGLState:",Q)}},texImage2D:function(){try{n.texImage2D.apply(n,arguments)}catch(Q){console.error("THREE.WebGLState:",Q)}},texImage3D:function(){try{n.texImage3D.apply(n,arguments)}catch(Q){console.error("THREE.WebGLState:",Q)}},scissor:function(Q){_t.equals(Q)===!1&&(n.scissor(Q.x,Q.y,Q.z,Q.w),_t.copy(Q))},viewport:function(Q){xt.equals(Q)===!1&&(n.viewport(Q.x,Q.y,Q.z,Q.w),xt.copy(Q))},reset:function(){n.disable(3042),n.disable(2884),n.disable(2929),n.disable(32823),n.disable(3089),n.disable(2960),n.disable(32926),n.blendEquation(32774),n.blendFunc(1,0),n.blendFuncSeparate(1,0,1,0),n.colorMask(!0,!0,!0,!0),n.clearColor(0,0,0,0),n.depthMask(!0),n.depthFunc(513),n.clearDepth(1),n.stencilMask(4294967295),n.stencilFunc(519,0,4294967295),n.stencilOp(7680,7680,7680),n.clearStencil(0),n.cullFace(1029),n.frontFace(2305),n.polygonOffset(0,0),n.activeTexture(33984),n.bindFramebuffer(36160,null),i===!0&&(n.bindFramebuffer(36009,null),n.bindFramebuffer(36008,null)),n.useProgram(null),n.lineWidth(1),n.scissor(0,0,n.canvas.width,n.canvas.height),n.viewport(0,0,n.canvas.width,n.canvas.height),a={},et=null,pt={},l=null,u={},h=null,d=!1,p=null,m=null,g=null,_=null,y=null,w=null,A=null,I=!1,F=null,N=null,U=null,B=null,G=null,_t.set(0,0,n.canvas.width,n.canvas.height),xt.set(0,0,n.canvas.width,n.canvas.height),r.reset(),o.reset(),s.reset()}}}function _v(n,t,e,i,r,o,s){const a=r.isWebGL2,l=r.maxTextures,u=r.maxCubemapSize,h=r.maxTextureSize,d=r.maxSamples,p=new WeakMap;let m,g=!1;try{g=typeof OffscreenCanvas!="undefined"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(nt,lt){return g?new OffscreenCanvas(nt,lt):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function y(nt,lt,Xt,Ut){let Bt=1;if((nt.width>Ut||nt.height>Ut)&&(Bt=Ut/Math.max(nt.width,nt.height)),Bt<1||lt===!0){if(typeof HTMLImageElement!="undefined"&&nt instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&nt instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&nt instanceof ImageBitmap){const ue=lt?ph:Math.floor,he=ue(Bt*nt.width),Vt=ue(Bt*nt.height);m===void 0&&(m=_(he,Vt));const Q=Xt?_(he,Vt):m;return Q.width=he,Q.height=Vt,Q.getContext("2d").drawImage(nt,0,0,he,Vt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+nt.width+"x"+nt.height+") to ("+he+"x"+Vt+")."),Q}return"data"in nt&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+nt.width+"x"+nt.height+")."),nt}return nt}function w(nt){return Ul(nt.width)&&Ul(nt.height)}function A(nt,lt){return nt.generateMipmaps&<&&nt.minFilter!==fi&&nt.minFilter!==qi}function I(nt,lt,Xt,Ut,Bt=1){n.generateMipmap(nt),i.get(lt).__maxMipLevel=Math.log2(Math.max(Xt,Ut,Bt))}function F(nt,lt,Xt){if(a===!1)return lt;if(nt!==null){if(n[nt]!==void 0)return n[nt];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+nt+"'")}let Ut=lt;return lt===6403&&(Xt===5126&&(Ut=33326),Xt===5131&&(Ut=33325),Xt===5121&&(Ut=33321)),lt===6407&&(Xt===5126&&(Ut=34837),Xt===5131&&(Ut=34843),Xt===5121&&(Ut=32849)),lt===6408&&(Xt===5126&&(Ut=34836),Xt===5131&&(Ut=34842),Xt===5121&&(Ut=32856)),Ut!==33325&&Ut!==33326&&Ut!==34842&&Ut!==34836||t.get("EXT_color_buffer_float"),Ut}function N(nt){return nt===fi||nt===Sr||nt===zs?9728:9729}function U(nt){const lt=nt.target;lt.removeEventListener("dispose",U),function(Xt){const Ut=i.get(Xt);Ut.__webglInit!==void 0&&(n.deleteTexture(Ut.__webglTexture),i.remove(Xt))}(lt),lt.isVideoTexture&&p.delete(lt),s.memory.textures--}function B(nt){const lt=nt.target;lt.removeEventListener("dispose",B),function(Xt){const Ut=Xt.texture,Bt=i.get(Xt),ue=i.get(Ut);if(!!Xt){if(ue.__webglTexture!==void 0&&(n.deleteTexture(ue.__webglTexture),s.memory.textures--),Xt.depthTexture&&Xt.depthTexture.dispose(),Xt.isWebGLCubeRenderTarget)for(let he=0;he<6;he++)n.deleteFramebuffer(Bt.__webglFramebuffer[he]),Bt.__webglDepthbuffer&&n.deleteRenderbuffer(Bt.__webglDepthbuffer[he]);else n.deleteFramebuffer(Bt.__webglFramebuffer),Bt.__webglDepthbuffer&&n.deleteRenderbuffer(Bt.__webglDepthbuffer),Bt.__webglMultisampledFramebuffer&&n.deleteFramebuffer(Bt.__webglMultisampledFramebuffer),Bt.__webglColorRenderbuffer&&n.deleteRenderbuffer(Bt.__webglColorRenderbuffer),Bt.__webglDepthRenderbuffer&&n.deleteRenderbuffer(Bt.__webglDepthRenderbuffer);if(Xt.isWebGLMultipleRenderTargets)for(let he=0,Vt=Ut.length;he<Vt;he++){const Q=i.get(Ut[he]);Q.__webglTexture&&(n.deleteTexture(Q.__webglTexture),s.memory.textures--),i.remove(Ut[he])}i.remove(Ut),i.remove(Xt)}}(lt)}let G=0;function ct(nt,lt){const Xt=i.get(nt);if(nt.isVideoTexture&&function(Ut){const Bt=s.render.frame;p.get(Ut)!==Bt&&(p.set(Ut,Bt),Ut.update())}(nt),nt.version>0&&Xt.__version!==nt.version){const Ut=nt.image;if(Ut===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(Ut.complete!==!1)return void kt(Xt,nt,lt);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}e.activeTexture(33984+lt),e.bindTexture(3553,Xt.__webglTexture)}function it(nt,lt){const Xt=i.get(nt);nt.version>0&&Xt.__version!==nt.version?function(Ut,Bt,ue){if(Bt.image.length!==6)return;pt(Ut,Bt),e.activeTexture(33984+ue),e.bindTexture(34067,Ut.__webglTexture),n.pixelStorei(37440,Bt.flipY),n.pixelStorei(37441,Bt.premultiplyAlpha),n.pixelStorei(3317,Bt.unpackAlignment),n.pixelStorei(37443,0);const he=Bt&&(Bt.isCompressedTexture||Bt.image[0].isCompressedTexture),Vt=Bt.image[0]&&Bt.image[0].isDataTexture,Q=[];for(let Re=0;Re<6;Re++)Q[Re]=he||Vt?Vt?Bt.image[Re].image:Bt.image[Re]:y(Bt.image[Re],!1,!0,u);const gt=Q[0],Dt=w(gt)||a,Ft=o.convert(Bt.format),St=o.convert(Bt.type),Yt=F(Bt.internalFormat,Ft,St);let Me;if(et(34067,Bt,Dt),he){for(let Re=0;Re<6;Re++){Me=Q[Re].mipmaps;for(let Ae=0;Ae<Me.length;Ae++){const si=Me[Ae];Bt.format!==Tr&&Bt.format!==No?Ft!==null?e.compressedTexImage2D(34069+Re,Ae,Yt,si.width,si.height,0,si.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):e.texImage2D(34069+Re,Ae,Yt,si.width,si.height,0,Ft,St,si.data)}}Ut.__maxMipLevel=Me.length-1}else{Me=Bt.mipmaps;for(let Re=0;Re<6;Re++)if(Vt){e.texImage2D(34069+Re,0,Yt,Q[Re].width,Q[Re].height,0,Ft,St,Q[Re].data);for(let Ae=0;Ae<Me.length;Ae++){const si=Me[Ae].image[Re].image;e.texImage2D(34069+Re,Ae+1,Yt,si.width,si.height,0,Ft,St,si.data)}}else{e.texImage2D(34069+Re,0,Yt,Ft,St,Q[Re]);for(let Ae=0;Ae<Me.length;Ae++){const si=Me[Ae];e.texImage2D(34069+Re,Ae+1,Yt,Ft,St,si.image[Re])}}Ut.__maxMipLevel=Me.length}A(Bt,Dt)&&I(34067,Bt,gt.width,gt.height),Ut.__version=Bt.version,Bt.onUpdate&&Bt.onUpdate(Bt)}(Xt,nt,lt):(e.activeTexture(33984+lt),e.bindTexture(34067,Xt.__webglTexture))}const tt={[Ge]:10497,[qe]:33071,[pi]:33648},rt={[fi]:9728,[Sr]:9984,[zs]:9986,[qi]:9729,[as]:9985,[js]:9987};function et(nt,lt,Xt){if(Xt?(n.texParameteri(nt,10242,tt[lt.wrapS]),n.texParameteri(nt,10243,tt[lt.wrapT]),nt!==32879&&nt!==35866||n.texParameteri(nt,32882,tt[lt.wrapR]),n.texParameteri(nt,10240,rt[lt.magFilter]),n.texParameteri(nt,10241,rt[lt.minFilter])):(n.texParameteri(nt,10242,33071),n.texParameteri(nt,10243,33071),nt!==32879&&nt!==35866||n.texParameteri(nt,32882,33071),lt.wrapS===qe&<.wrapT===qe||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(nt,10240,N(lt.magFilter)),n.texParameteri(nt,10241,N(lt.minFilter)),lt.minFilter!==fi&<.minFilter!==qi&&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 Ut=t.get("EXT_texture_filter_anisotropic");if(lt.type===Oo&&t.has("OES_texture_float_linear")===!1||a===!1&<.type===Ws&&t.has("OES_texture_half_float_linear")===!1)return;(lt.anisotropy>1||i.get(lt).__currentAnisotropy)&&(n.texParameterf(nt,Ut.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(lt.anisotropy,r.getMaxAnisotropy())),i.get(lt).__currentAnisotropy=lt.anisotropy)}}function pt(nt,lt){nt.__webglInit===void 0&&(nt.__webglInit=!0,lt.addEventListener("dispose",U),nt.__webglTexture=n.createTexture(),s.memory.textures++)}function kt(nt,lt,Xt){let Ut=3553;lt.isDataTexture2DArray&&(Ut=35866),lt.isDataTexture3D&&(Ut=32879),pt(nt,lt),e.activeTexture(33984+Xt),e.bindTexture(Ut,nt.__webglTexture),n.pixelStorei(37440,lt.flipY),n.pixelStorei(37441,lt.premultiplyAlpha),n.pixelStorei(3317,lt.unpackAlignment),n.pixelStorei(37443,0);const Bt=function(St){return!a&&(St.wrapS!==qe||St.wrapT!==qe||St.minFilter!==fi&&St.minFilter!==qi)}(lt)&&w(lt.image)===!1,ue=y(lt.image,Bt,!1,h),he=w(ue)||a,Vt=o.convert(lt.format);let Q,gt=o.convert(lt.type),Dt=F(lt.internalFormat,Vt,gt);et(Ut,lt,he);const Ft=lt.mipmaps;if(lt.isDepthTexture)Dt=6402,a?Dt=lt.type===Oo?36012:lt.type===Vs?33190:lt.type===Pi?35056:33189:lt.type===Oo&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),lt.format===tn&&Dt===6402&<.type!==Pl&<.type!==Vs&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),lt.type=Pl,gt=o.convert(lt.type)),lt.format===Xs&&Dt===6402&&(Dt=34041,lt.type!==Pi&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),lt.type=Pi,gt=o.convert(lt.type))),e.texImage2D(3553,0,Dt,ue.width,ue.height,0,Vt,gt,null);else if(lt.isDataTexture)if(Ft.length>0&&he){for(let St=0,Yt=Ft.length;St<Yt;St++)Q=Ft[St],e.texImage2D(3553,St,Dt,Q.width,Q.height,0,Vt,gt,Q.data);lt.generateMipmaps=!1,nt.__maxMipLevel=Ft.length-1}else e.texImage2D(3553,0,Dt,ue.width,ue.height,0,Vt,gt,ue.data),nt.__maxMipLevel=0;else if(lt.isCompressedTexture){for(let St=0,Yt=Ft.length;St<Yt;St++)Q=Ft[St],lt.format!==Tr&<.format!==No?Vt!==null?e.compressedTexImage2D(3553,St,Dt,Q.width,Q.height,0,Q.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):e.texImage2D(3553,St,Dt,Q.width,Q.height,0,Vt,gt,Q.data);nt.__maxMipLevel=Ft.length-1}else if(lt.isDataTexture2DArray)e.texImage3D(35866,0,Dt,ue.width,ue.height,ue.depth,0,Vt,gt,ue.data),nt.__maxMipLevel=0;else if(lt.isDataTexture3D)e.texImage3D(32879,0,Dt,ue.width,ue.height,ue.depth,0,Vt,gt,ue.data),nt.__maxMipLevel=0;else if(Ft.length>0&&he){for(let St=0,Yt=Ft.length;St<Yt;St++)Q=Ft[St],e.texImage2D(3553,St,Dt,Vt,gt,Q);lt.generateMipmaps=!1,nt.__maxMipLevel=Ft.length-1}else e.texImage2D(3553,0,Dt,Vt,gt,ue),nt.__maxMipLevel=0;A(lt,he)&&I(Ut,lt,ue.width,ue.height),nt.__version=lt.version,lt.onUpdate&<.onUpdate(lt)}function Lt(nt,lt,Xt,Ut,Bt){const ue=o.convert(Xt.format),he=o.convert(Xt.type),Vt=F(Xt.internalFormat,ue,he);Bt===32879||Bt===35866?e.texImage3D(Bt,0,Vt,lt.width,lt.height,lt.depth,0,ue,he,null):e.texImage2D(Bt,0,Vt,lt.width,lt.height,0,ue,he,null),e.bindFramebuffer(36160,nt),n.framebufferTexture2D(36160,Ut,Bt,i.get(Xt).__webglTexture,0),e.bindFramebuffer(36160,null)}function _t(nt,lt,Xt){if(n.bindRenderbuffer(36161,nt),lt.depthBuffer&&!lt.stencilBuffer){let Ut=33189;if(Xt){const Bt=lt.depthTexture;Bt&&Bt.isDepthTexture&&(Bt.type===Oo?Ut=36012:Bt.type===Vs&&(Ut=33190));const ue=jt(lt);n.renderbufferStorageMultisample(36161,ue,Ut,lt.width,lt.height)}else n.renderbufferStorage(36161,Ut,lt.width,lt.height);n.framebufferRenderbuffer(36160,36096,36161,nt)}else if(lt.depthBuffer&<.stencilBuffer){if(Xt){const Ut=jt(lt);n.renderbufferStorageMultisample(36161,Ut,35056,lt.width,lt.height)}else n.renderbufferStorage(36161,34041,lt.width,lt.height);n.framebufferRenderbuffer(36160,33306,36161,nt)}else{const Ut=lt.isWebGLMultipleRenderTargets===!0?lt.texture[0]:lt.texture,Bt=o.convert(Ut.format),ue=o.convert(Ut.type),he=F(Ut.internalFormat,Bt,ue);if(Xt){const Vt=jt(lt);n.renderbufferStorageMultisample(36161,Vt,he,lt.width,lt.height)}else n.renderbufferStorage(36161,he,lt.width,lt.height)}n.bindRenderbuffer(36161,null)}function xt(nt){const lt=i.get(nt),Xt=nt.isWebGLCubeRenderTarget===!0;if(nt.depthTexture){if(Xt)throw new Error("target.depthTexture not supported in Cube render targets");(function(Ut,Bt){if(Bt&&Bt.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(36160,Ut),!Bt.depthTexture||!Bt.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");i.get(Bt.depthTexture).__webglTexture&&Bt.depthTexture.image.width===Bt.width&&Bt.depthTexture.image.height===Bt.height||(Bt.depthTexture.image.width=Bt.width,Bt.depthTexture.image.height=Bt.height,Bt.depthTexture.needsUpdate=!0),ct(Bt.depthTexture,0);const ue=i.get(Bt.depthTexture).__webglTexture;if(Bt.depthTexture.format===tn)n.framebufferTexture2D(36160,36096,3553,ue,0);else{if(Bt.depthTexture.format!==Xs)throw new Error("Unknown depthTexture format");n.framebufferTexture2D(36160,33306,3553,ue,0)}})(lt.__webglFramebuffer,nt)}else if(Xt){lt.__webglDepthbuffer=[];for(let Ut=0;Ut<6;Ut++)e.bindFramebuffer(36160,lt.__webglFramebuffer[Ut]),lt.__webglDepthbuffer[Ut]=n.createRenderbuffer(),_t(lt.__webglDepthbuffer[Ut],nt,!1)}else e.bindFramebuffer(36160,lt.__webglFramebuffer),lt.__webglDepthbuffer=n.createRenderbuffer(),_t(lt.__webglDepthbuffer,nt,!1);e.bindFramebuffer(36160,null)}function jt(nt){return a&&nt.isWebGLMultisampleRenderTarget?Math.min(d,nt.samples):0}let ee=!1,le=!1;this.allocateTextureUnit=function(){const nt=G;return nt>=l&&console.warn("THREE.WebGLTextures: Trying to use "+nt+" texture units while this GPU supports only "+l),G+=1,nt},this.resetTextureUnits=function(){G=0},this.setTexture2D=ct,this.setTexture2DArray=function(nt,lt){const Xt=i.get(nt);nt.version>0&&Xt.__version!==nt.version?kt(Xt,nt,lt):(e.activeTexture(33984+lt),e.bindTexture(35866,Xt.__webglTexture))},this.setTexture3D=function(nt,lt){const Xt=i.get(nt);nt.version>0&&Xt.__version!==nt.version?kt(Xt,nt,lt):(e.activeTexture(33984+lt),e.bindTexture(32879,Xt.__webglTexture))},this.setTextureCube=it,this.setupRenderTarget=function(nt){const lt=nt.texture,Xt=i.get(nt),Ut=i.get(lt);nt.addEventListener("dispose",B),nt.isWebGLMultipleRenderTargets!==!0&&(Ut.__webglTexture=n.createTexture(),Ut.__version=lt.version,s.memory.textures++);const Bt=nt.isWebGLCubeRenderTarget===!0,ue=nt.isWebGLMultipleRenderTargets===!0,he=nt.isWebGLMultisampleRenderTarget===!0,Vt=lt.isDataTexture3D||lt.isDataTexture2DArray,Q=w(nt)||a;if(!a||lt.format!==No||lt.type!==Oo&<.type!==Ws||(lt.format=Tr,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),Bt){Xt.__webglFramebuffer=[];for(let gt=0;gt<6;gt++)Xt.__webglFramebuffer[gt]=n.createFramebuffer()}else if(Xt.__webglFramebuffer=n.createFramebuffer(),ue)if(r.drawBuffers){const gt=nt.texture;for(let Dt=0,Ft=gt.length;Dt<Ft;Dt++){const St=i.get(gt[Dt]);St.__webglTexture===void 0&&(St.__webglTexture=n.createTexture(),s.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(he)if(a){Xt.__webglMultisampledFramebuffer=n.createFramebuffer(),Xt.__webglColorRenderbuffer=n.createRenderbuffer(),n.bindRenderbuffer(36161,Xt.__webglColorRenderbuffer);const gt=o.convert(lt.format),Dt=o.convert(lt.type),Ft=F(lt.internalFormat,gt,Dt),St=jt(nt);n.renderbufferStorageMultisample(36161,St,Ft,nt.width,nt.height),e.bindFramebuffer(36160,Xt.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(36160,36064,36161,Xt.__webglColorRenderbuffer),n.bindRenderbuffer(36161,null),nt.depthBuffer&&(Xt.__webglDepthRenderbuffer=n.createRenderbuffer(),_t(Xt.__webglDepthRenderbuffer,nt,!0)),e.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(Bt){e.bindTexture(34067,Ut.__webglTexture),et(34067,lt,Q);for(let gt=0;gt<6;gt++)Lt(Xt.__webglFramebuffer[gt],nt,lt,36064,34069+gt);A(lt,Q)&&I(34067,lt,nt.width,nt.height),e.bindTexture(34067,null)}else if(ue){const gt=nt.texture;for(let Dt=0,Ft=gt.length;Dt<Ft;Dt++){const St=gt[Dt],Yt=i.get(St);e.bindTexture(3553,Yt.__webglTexture),et(3553,St,Q),Lt(Xt.__webglFramebuffer,nt,St,36064+Dt,3553),A(St,Q)&&I(3553,St,nt.width,nt.height)}e.bindTexture(3553,null)}else{let gt=3553;Vt&&(a?gt=lt.isDataTexture3D?32879:35866:console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")),e.bindTexture(gt,Ut.__webglTexture),et(gt,lt,Q),Lt(Xt.__webglFramebuffer,nt,lt,36064,gt),A(lt,Q)&&I(gt,lt,nt.width,nt.height,nt.depth),e.bindTexture(gt,null)}nt.depthBuffer&&xt(nt)},this.updateRenderTargetMipmap=function(nt){const lt=w(nt)||a,Xt=nt.isWebGLMultipleRenderTargets===!0?nt.texture:[nt.texture];for(let Ut=0,Bt=Xt.length;Ut<Bt;Ut++){const ue=Xt[Ut];if(A(ue,lt)){const he=nt.isWebGLCubeRenderTarget?34067:3553,Vt=i.get(ue).__webglTexture;e.bindTexture(he,Vt),I(he,ue,nt.width,nt.height),e.bindTexture(he,null)}}},this.updateMultisampleRenderTarget=function(nt){if(nt.isWebGLMultisampleRenderTarget)if(a){const lt=nt.width,Xt=nt.height;let Ut=16384;nt.depthBuffer&&(Ut|=256),nt.stencilBuffer&&(Ut|=1024);const Bt=i.get(nt);e.bindFramebuffer(36008,Bt.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,Bt.__webglFramebuffer),n.blitFramebuffer(0,0,lt,Xt,0,0,lt,Xt,Ut,9728),e.bindFramebuffer(36008,null),e.bindFramebuffer(36009,Bt.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(nt,lt){nt&&nt.isWebGLRenderTarget&&(ee===!1&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),ee=!0),nt=nt.texture),ct(nt,lt)},this.safeSetTextureCube=function(nt,lt){nt&&nt.isWebGLCubeRenderTarget&&(le===!1&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),le=!0),nt=nt.texture),it(nt,lt)}}function Wf(n,t,e){const i=e.isWebGL2;return{convert:function(r){let o;if(r===ls)return 5121;if(r===Wp)return 32819;if(r===Xp)return 32820;if(r===qp)return 33635;if(r===zp)return 5120;if(r===jp)return 5122;if(r===Pl)return 5123;if(r===Vp)return 5124;if(r===Vs)return 5125;if(r===Oo)return 5126;if(r===Ws)return i?5131:(o=t.get("OES_texture_half_float"),o!==null?o.HALF_FLOAT_OES:null);if(r===Fi)return 6406;if(r===No)return 6407;if(r===Tr)return 6408;if(r===Yp)return 6409;if(r===Fc)return 6410;if(r===tn)return 6402;if(r===Xs)return 34041;if(r===Na)return 6403;if(r===Bc)return 36244;if(r===ju)return 33319;if(r===Er)return 33320;if(r===kc)return 36248;if(r===Uc)return 36249;if(r===Vu||r===Wu||r===Xu||r===qu){if(o=t.get("WEBGL_compressed_texture_s3tc"),o===null)return null;if(r===Vu)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===Wu)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===Xu)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===qu)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(r===ir||r===Gc||r===hr||r===Hc){if(o=t.get("WEBGL_compressed_texture_pvrtc"),o===null)return null;if(r===ir)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===Gc)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===hr)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===Hc)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(r===zc)return o=t.get("WEBGL_compressed_texture_etc1"),o!==null?o.COMPRESSED_RGB_ETC1_WEBGL:null;if((r===fo||r===Da)&&(o=t.get("WEBGL_compressed_texture_etc"),o!==null)){if(r===fo)return o.COMPRESSED_RGB8_ETC2;if(r===Da)return o.COMPRESSED_RGBA8_ETC2_EAC}return r===Yu||r===Gi||r===Do||r===$u||r===Jp||r===Ju||r===Zp||r===jc||r===Il||r===qs||r===Kp||r===Vc||r===Wc||r===Zu||r===Xc||r===Qu||r===th||r===qc||r===cr||r===eh||r===Fa||r===Yc||r===$c||r===Qp||r===tf||r===ef||r===nf||r===Ys?(o=t.get("WEBGL_compressed_texture_astc"),o!==null?r:null):r===Ku?(o=t.get("EXT_texture_compression_bptc"),o!==null?r:null):r===Pi?i?34042:(o=t.get("WEBGL_depth_texture"),o!==null?o.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}class Nd extends fn{constructor(t=[]){super(),this.cameras=t}}Nd.prototype.isArrayCamera=!0;class pa extends hi{constructor(){super(),this.type="Group"}}pa.prototype.isGroup=!0;const Dd={type:"move"};class tu{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new pa,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 pa,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new S,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new S),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new pa,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new S,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new S),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,i){let r=null,o=null,s=null;const a=this._targetRay,l=this._grip,u=this._hand;if(t&&e.session.visibilityState!=="visible-blurred")if(a!==null&&(r=e.getPose(t.targetRaySpace,i),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(Dd))),u&&t.hand){s=!0;for(const _ of t.hand.values()){const y=e.getJointPose(_,i);if(u.joints[_.jointName]===void 0){const A=new pa;A.matrixAutoUpdate=!1,A.visible=!1,u.joints[_.jointName]=A,u.add(A)}const w=u.joints[_.jointName];y!==null&&(w.matrix.fromArray(y.transform.matrix),w.matrix.decompose(w.position,w.rotation,w.scale),w.jointRadius=y.radius),w.visible=y!==null}const h=u.joints["index-finger-tip"],d=u.joints["thumb-tip"],p=h.position.distanceTo(d.position),m=.02,g=.005;u.inputState.pinching&&p>m+g?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!u.inputState.pinching&&p<=m-g&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(o=e.getPose(t.gripSpace,i),o!==null&&(l.matrix.fromArray(o.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),o.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(o.linearVelocity)):l.hasLinearVelocity=!1,o.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(o.angularVelocity)):l.hasAngularVelocity=!1));return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=o!==null),u!==null&&(u.visible=s!==null),this}}class yv extends ko{constructor(t,e){super();const i=this,r=t.state;let o=null,s=1,a=null,l="local-floor",u=null,h=null,d=null,p=null;const m=[],g=new Map,_=new fn;_.layers.enable(1),_.viewport=new Li;const y=new fn;y.layers.enable(2),y.viewport=new Li;const w=[_,y],A=new Nd;A.layers.enable(1),A.layers.enable(2);let I=null,F=null;function N(et){const pt=g.get(et.inputSource);pt&&pt.dispatchEvent({type:et.type,data:et.inputSource})}function U(){g.forEach(function(et,pt){et.disconnect(pt)}),g.clear(),I=null,F=null,r.bindXRFramebuffer(null),t.setRenderTarget(t.getRenderTarget()),rt.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}function B(et){const pt=o.inputSources;for(let kt=0;kt<m.length;kt++)g.set(pt[kt],m[kt]);for(let kt=0;kt<et.removed.length;kt++){const Lt=et.removed[kt],_t=g.get(Lt);_t&&(_t.dispatchEvent({type:"disconnected",data:Lt}),g.delete(Lt))}for(let kt=0;kt<et.added.length;kt++){const Lt=et.added[kt],_t=g.get(Lt);_t&&_t.dispatchEvent({type:"connected",data:Lt})}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(et){let pt=m[et];return pt===void 0&&(pt=new tu,m[et]=pt),pt.getTargetRaySpace()},this.getControllerGrip=function(et){let pt=m[et];return pt===void 0&&(pt=new tu,m[et]=pt),pt.getGripSpace()},this.getHand=function(et){let pt=m[et];return pt===void 0&&(pt=new tu,m[et]=pt),pt.getHandSpace()},this.setFramebufferScaleFactor=function(et){s=et,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(et){l=et,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return a},this.getSession=function(){return o},this.setSession=async function(et){if(o=et,o!==null){o.addEventListener("select",N),o.addEventListener("selectstart",N),o.addEventListener("selectend",N),o.addEventListener("squeeze",N),o.addEventListener("squeezestart",N),o.addEventListener("squeezeend",N),o.addEventListener("end",U),o.addEventListener("inputsourceschange",B);const pt=e.getContextAttributes();if(pt.xrCompatible!==!0&&await e.makeXRCompatible(),o.renderState.layers===void 0){const kt={antialias:pt.antialias,alpha:pt.alpha,depth:pt.depth,stencil:pt.stencil,framebufferScaleFactor:s},Lt=new XRWebGLLayer(o,e,kt);o.updateRenderState({baseLayer:Lt})}else{let kt=0;pt.depth&&(kt=pt.stencil?34041:6402);const Lt={colorFormat:pt.alpha?6408:6407,depthFormat:kt,scaleFactor:s};h=new XRWebGLBinding(o,e),p=h.createProjectionLayer(Lt),d=e.createFramebuffer(),o.updateRenderState({layers:[p]})}a=await o.requestReferenceSpace(l),rt.setContext(o),rt.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}};const G=new S,ct=new S;function it(et,pt){pt===null?et.matrixWorld.copy(et.matrix):et.matrixWorld.multiplyMatrices(pt.matrixWorld,et.matrix),et.matrixWorldInverse.copy(et.matrixWorld).invert()}this.updateCamera=function(et){if(o===null)return;A.near=y.near=_.near=et.near,A.far=y.far=_.far=et.far,I===A.near&&F===A.far||(o.updateRenderState({depthNear:A.near,depthFar:A.far}),I=A.near,F=A.far);const pt=et.parent,kt=A.cameras;it(A,pt);for(let _t=0;_t<kt.length;_t++)it(kt[_t],pt);A.matrixWorld.decompose(A.position,A.quaternion,A.scale),et.position.copy(A.position),et.quaternion.copy(A.quaternion),et.scale.copy(A.scale),et.matrix.copy(A.matrix),et.matrixWorld.copy(A.matrixWorld);const Lt=et.children;for(let _t=0,xt=Lt.length;_t<xt;_t++)Lt[_t].updateMatrixWorld(!0);kt.length===2?function(_t,xt,jt){G.setFromMatrixPosition(xt.matrixWorld),ct.setFromMatrixPosition(jt.matrixWorld);const ee=G.distanceTo(ct),le=xt.projectionMatrix.elements,nt=jt.projectionMatrix.elements,lt=le[14]/(le[10]-1),Xt=le[14]/(le[10]+1),Ut=(le[9]+1)/le[5],Bt=(le[9]-1)/le[5],ue=(le[8]-1)/le[0],he=(nt[8]+1)/nt[0],Vt=lt*ue,Q=lt*he,gt=ee/(-ue+he),Dt=gt*-ue;xt.matrixWorld.decompose(_t.position,_t.quaternion,_t.scale),_t.translateX(Dt),_t.translateZ(gt),_t.matrixWorld.compose(_t.position,_t.quaternion,_t.scale),_t.matrixWorldInverse.copy(_t.matrixWorld).invert();const Ft=lt+gt,St=Xt+gt,Yt=Vt-Dt,Me=Q+(ee-Dt),Re=Ut*Xt/St*Ft,Ae=Bt*Xt/St*Ft;_t.projectionMatrix.makePerspective(Yt,Me,Re,Ae,Ft,St)}(A,_,y):A.projectionMatrix.copy(_.projectionMatrix)},this.getCamera=function(){return A};let tt=null;const rt=new yd;rt.setAnimationLoop(function(et,pt){if(u=pt.getViewerPose(a),u!==null){const Lt=u.views,_t=o.renderState.baseLayer;o.renderState.layers===void 0&&r.bindXRFramebuffer(_t.framebuffer);let xt=!1;Lt.length!==A.cameras.length&&(A.cameras.length=0,xt=!0);for(let jt=0;jt<Lt.length;jt++){const ee=Lt[jt];let le=null;if(o.renderState.layers===void 0)le=_t.getViewport(ee);else{const lt=h.getViewSubImage(p,ee);r.bindXRFramebuffer(d),e.framebufferTexture2D(36160,36064,3553,lt.colorTexture,0),lt.depthStencilTexture!==void 0&&e.framebufferTexture2D(36160,36096,3553,lt.depthStencilTexture,0),le=lt.viewport}const nt=w[jt];nt.matrix.fromArray(ee.transform.matrix),nt.projectionMatrix.fromArray(ee.projectionMatrix),nt.viewport.set(le.x,le.y,le.width,le.height),jt===0&&A.matrix.copy(nt.matrix),xt===!0&&A.cameras.push(nt)}}const kt=o.inputSources;for(let Lt=0;Lt<m.length;Lt++){const _t=m[Lt],xt=kt[Lt];_t.update(xt,pt,a)}tt&&tt(et,pt)}),this.setAnimationLoop=function(et){tt=et},this.dispose=function(){}}}function xv(n){function t(i,r){i.opacity.value=r.opacity,r.color&&i.diffuse.value.copy(r.color),r.emissive&&i.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),r.map&&(i.map.value=r.map),r.alphaMap&&(i.alphaMap.value=r.alphaMap),r.specularMap&&(i.specularMap.value=r.specularMap);const o=n.get(r).envMap;if(o){i.envMap.value=o,i.flipEnvMap.value=o.isCubeTexture&&o._needsFlipEnvMap?-1:1,i.reflectivity.value=r.reflectivity,i.refractionRatio.value=r.refractionRatio;const l=n.get(o).__maxMipLevel;l!==void 0&&(i.maxMipLevel.value=l)}let s,a;r.lightMap&&(i.lightMap.value=r.lightMap,i.lightMapIntensity.value=r.lightMapIntensity),r.aoMap&&(i.aoMap.value=r.aoMap,i.aoMapIntensity.value=r.aoMapIntensity),r.map?s=r.map:r.specularMap?s=r.specularMap:r.displacementMap?s=r.displacementMap:r.normalMap?s=r.normalMap:r.bumpMap?s=r.bumpMap:r.roughnessMap?s=r.roughnessMap:r.metalnessMap?s=r.metalnessMap:r.alphaMap?s=r.alphaMap:r.emissiveMap?s=r.emissiveMap:r.clearcoatMap?s=r.clearcoatMap:r.clearcoatNormalMap?s=r.clearcoatNormalMap:r.clearcoatRoughnessMap&&(s=r.clearcoatRoughnessMap),s!==void 0&&(s.isWebGLRenderTarget&&(s=s.texture),s.matrixAutoUpdate===!0&&s.updateMatrix(),i.uvTransform.value.copy(s.matrix)),r.aoMap?a=r.aoMap:r.lightMap&&(a=r.lightMap),a!==void 0&&(a.isWebGLRenderTarget&&(a=a.texture),a.matrixAutoUpdate===!0&&a.updateMatrix(),i.uv2Transform.value.copy(a.matrix))}function e(i,r){i.roughness.value=r.roughness,i.metalness.value=r.metalness,r.roughnessMap&&(i.roughnessMap.value=r.roughnessMap),r.metalnessMap&&(i.metalnessMap.value=r.metalnessMap),r.emissiveMap&&(i.emissiveMap.value=r.emissiveMap),r.bumpMap&&(i.bumpMap.value=r.bumpMap,i.bumpScale.value=r.bumpScale,r.side===X&&(i.bumpScale.value*=-1)),r.normalMap&&(i.normalMap.value=r.normalMap,i.normalScale.value.copy(r.normalScale),r.side===X&&i.normalScale.value.negate()),r.displacementMap&&(i.displacementMap.value=r.displacementMap,i.displacementScale.value=r.displacementScale,i.displacementBias.value=r.displacementBias),n.get(r).envMap&&(i.envMapIntensity.value=r.envMapIntensity)}return{refreshFogUniforms:function(i,r){i.fogColor.value.copy(r.color),r.isFog?(i.fogNear.value=r.near,i.fogFar.value=r.far):r.isFogExp2&&(i.fogDensity.value=r.density)},refreshMaterialUniforms:function(i,r,o,s,a){r.isMeshBasicMaterial?t(i,r):r.isMeshLambertMaterial?(t(i,r),function(l,u){u.emissiveMap&&(l.emissiveMap.value=u.emissiveMap)}(i,r)):r.isMeshToonMaterial?(t(i,r),function(l,u){u.gradientMap&&(l.gradientMap.value=u.gradientMap),u.emissiveMap&&(l.emissiveMap.value=u.emissiveMap),u.bumpMap&&(l.bumpMap.value=u.bumpMap,l.bumpScale.value=u.bumpScale,u.side===X&&(l.bumpScale.value*=-1)),u.normalMap&&(l.normalMap.value=u.normalMap,l.normalScale.value.copy(u.normalScale),u.side===X&&l.normalScale.value.negate()),u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias)}(i,r)):r.isMeshPhongMaterial?(t(i,r),function(l,u){l.specular.value.copy(u.specular),l.shininess.value=Math.max(u.shininess,1e-4),u.emissiveMap&&(l.emissiveMap.value=u.emissiveMap),u.bumpMap&&(l.bumpMap.value=u.bumpMap,l.bumpScale.value=u.bumpScale,u.side===X&&(l.bumpScale.value*=-1)),u.normalMap&&(l.normalMap.value=u.normalMap,l.normalScale.value.copy(u.normalScale),u.side===X&&l.normalScale.value.negate()),u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias)}(i,r)):r.isMeshStandardMaterial?(t(i,r),r.isMeshPhysicalMaterial?function(l,u,h){e(l,u),l.reflectivity.value=u.reflectivity,l.clearcoat.value=u.clearcoat,l.clearcoatRoughness.value=u.clearcoatRoughness,u.sheen&&l.sheen.value.copy(u.sheen),u.clearcoatMap&&(l.clearcoatMap.value=u.clearcoatMap),u.clearcoatRoughnessMap&&(l.clearcoatRoughnessMap.value=u.clearcoatRoughnessMap),u.clearcoatNormalMap&&(l.clearcoatNormalScale.value.copy(u.clearcoatNormalScale),l.clearcoatNormalMap.value=u.clearcoatNormalMap,u.side===X&&l.clearcoatNormalScale.value.negate()),l.transmission.value=u.transmission,u.transmissionMap&&(l.transmissionMap.value=u.transmissionMap),u.transmission>0&&(l.transmissionSamplerMap.value=h.texture,l.transmissionSamplerSize.value.set(h.width,h.height)),l.thickness.value=u.thickness,u.thicknessMap&&(l.thicknessMap.value=u.thicknessMap),l.attenuationDistance.value=u.attenuationDistance,l.attenuationColor.value.copy(u.attenuationColor)}(i,r,a):e(i,r)):r.isMeshMatcapMaterial?(t(i,r),function(l,u){u.matcap&&(l.matcap.value=u.matcap),u.bumpMap&&(l.bumpMap.value=u.bumpMap,l.bumpScale.value=u.bumpScale,u.side===X&&(l.bumpScale.value*=-1)),u.normalMap&&(l.normalMap.value=u.normalMap,l.normalScale.value.copy(u.normalScale),u.side===X&&l.normalScale.value.negate()),u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias)}(i,r)):r.isMeshDepthMaterial?(t(i,r),function(l,u){u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias)}(i,r)):r.isMeshDistanceMaterial?(t(i,r),function(l,u){u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias),l.referencePosition.value.copy(u.referencePosition),l.nearDistance.value=u.nearDistance,l.farDistance.value=u.farDistance}(i,r)):r.isMeshNormalMaterial?(t(i,r),function(l,u){u.bumpMap&&(l.bumpMap.value=u.bumpMap,l.bumpScale.value=u.bumpScale,u.side===X&&(l.bumpScale.value*=-1)),u.normalMap&&(l.normalMap.value=u.normalMap,l.normalScale.value.copy(u.normalScale),u.side===X&&l.normalScale.value.negate()),u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias)}(i,r)):r.isLineBasicMaterial?(function(l,u){l.diffuse.value.copy(u.color),l.opacity.value=u.opacity}(i,r),r.isLineDashedMaterial&&function(l,u){l.dashSize.value=u.dashSize,l.totalSize.value=u.dashSize+u.gapSize,l.scale.value=u.scale}(i,r)):r.isPointsMaterial?function(l,u,h,d){l.diffuse.value.copy(u.color),l.opacity.value=u.opacity,l.size.value=u.size*h,l.scale.value=.5*d,u.map&&(l.map.value=u.map),u.alphaMap&&(l.alphaMap.value=u.alphaMap);let p;u.map?p=u.map:u.alphaMap&&(p=u.alphaMap),p!==void 0&&(p.matrixAutoUpdate===!0&&p.updateMatrix(),l.uvTransform.value.copy(p.matrix))}(i,r,o,s):r.isSpriteMaterial?function(l,u){l.diffuse.value.copy(u.color),l.opacity.value=u.opacity,l.rotation.value=u.rotation,u.map&&(l.map.value=u.map),u.alphaMap&&(l.alphaMap.value=u.alphaMap);let h;u.map?h=u.map:u.alphaMap&&(h=u.alphaMap),h!==void 0&&(h.matrixAutoUpdate===!0&&h.updateMatrix(),l.uvTransform.value.copy(h.matrix))}(i,r):r.isShadowMaterial?(i.color.value.copy(r.color),i.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function Oi(n={}){const t=n.canvas!==void 0?n.canvas:function(){const dt=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return dt.style.display="block",dt}(),e=n.context!==void 0?n.context:null,i=n.alpha!==void 0&&n.alpha,r=n.depth===void 0||n.depth,o=n.stencil===void 0||n.stencil,s=n.antialias!==void 0&&n.antialias,a=n.premultipliedAlpha===void 0||n.premultipliedAlpha,l=n.preserveDrawingBuffer!==void 0&&n.preserveDrawingBuffer,u=n.powerPreference!==void 0?n.powerPreference:"default",h=n.failIfMajorPerformanceCaveat!==void 0&&n.failIfMajorPerformanceCaveat;let d=null,p=null;const m=[],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=Be,this.physicallyCorrectLights=!1,this.toneMapping=Zr,this.toneMappingExposure=1;const _=this;let y=!1,w=0,A=0,I=null,F=-1,N=null;const U=new Li,B=new Li;let G=null,ct=t.width,it=t.height,tt=1,rt=null,et=null;const pt=new Li(0,0,ct,it),kt=new Li(0,0,ct,it);let Lt=!1;const _t=[],xt=new Ka;let jt=!1,ee=!1,le=null;const nt=new Ee,lt=new S,Xt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Ut(){return I===null?tt:1}let Bt,ue,he,Vt,Q,gt,Dt,Ft,St,Yt,Me,Re,Ae,si,Tn,Ni,Yr,Rp,Cp,Pp,Fr,$r,fe=e;function FS(dt,Kt){for(let Ht=0;Ht<dt.length;Ht++){const te=dt[Ht],ve=t.getContext(te,Kt);if(ve!==null)return ve}return null}try{const dt={alpha:i,depth:r,stencil:o,antialias:s,premultipliedAlpha:a,preserveDrawingBuffer:l,powerPreference:u,failIfMajorPerformanceCaveat:h};if(t.addEventListener("webglcontextlost",kS,!1),t.addEventListener("webglcontextrestored",US,!1),fe===null){const Kt=["webgl2","webgl","experimental-webgl"];if(_.isWebGL1Renderer===!0&&Kt.shift(),fe=FS(Kt,dt),fe===null)throw FS(Kt)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}fe.getShaderPrecisionFormat===void 0&&(fe.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(dt){throw console.error("THREE.WebGLRenderer: "+dt.message),dt}function BS(){Bt=new Wg(fe),ue=new vf(fe,Bt,n),Bt.init(ue),Fr=new Wf(fe,Bt,ue),he=new Fh(fe,Bt,ue),_t[0]=1029,Vt=new Zl,Q=new Nh,gt=new _v(fe,Bt,he,Q,ue,Fr,Vt),Dt=new yf(_),Ft=new jg(fe,ue),$r=new Jl(fe,Bt,Ft,ue),St=new xd(fe,Ft,Vt,$r),Yt=new Ah(fe,St,Ft,Vt),Rp=new wf(fe),Tn=new _f(Q),Me=new Gf(_,Dt,Bt,ue,$r,Tn),Re=new xv(Q),Ae=new vv(Q),si=new Vf(Bt,ue),Yr=new Vg(_,Dt,he,Yt,a),Ni=new Od(_,Yt,ue),Cp=new gf(fe,Bt,Vt,ue),Pp=new xf(fe,Bt,Vt,ue),Vt.programs=Me.programs,_.capabilities=ue,_.extensions=Bt,_.properties=Q,_.renderLists=Ae,_.shadowMap=Ni,_.state=he,_.info=Vt}BS();const ho=new yv(_,fe);function kS(dt){dt.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),y=!0}function US(){console.log("THREE.WebGLRenderer: Context Restored."),y=!1;const dt=Vt.autoReset,Kt=Ni.enabled,Ht=Ni.autoUpdate,te=Ni.needsUpdate,ve=Ni.type;BS(),Vt.autoReset=dt,Ni.enabled=Kt,Ni.autoUpdate=Ht,Ni.needsUpdate=te,Ni.type=ve}function GS(dt){const Kt=dt.target;Kt.removeEventListener("dispose",GS),function(Ht){(function(te){const ve=Q.get(te).programs;ve!==void 0&&ve.forEach(function(Ai){Me.releaseProgram(Ai)})})(Ht),Q.remove(Ht)}(Kt)}this.xr=ho,this.getContext=function(){return fe},this.getContextAttributes=function(){return fe.getContextAttributes()},this.forceContextLoss=function(){const dt=Bt.get("WEBGL_lose_context");dt&&dt.loseContext()},this.forceContextRestore=function(){const dt=Bt.get("WEBGL_lose_context");dt&&dt.restoreContext()},this.getPixelRatio=function(){return tt},this.setPixelRatio=function(dt){dt!==void 0&&(tt=dt,this.setSize(ct,it,!1))},this.getSize=function(dt){return dt.set(ct,it)},this.setSize=function(dt,Kt,Ht){ho.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(ct=dt,it=Kt,t.width=Math.floor(dt*tt),t.height=Math.floor(Kt*tt),Ht!==!1&&(t.style.width=dt+"px",t.style.height=Kt+"px"),this.setViewport(0,0,dt,Kt))},this.getDrawingBufferSize=function(dt){return dt.set(ct*tt,it*tt).floor()},this.setDrawingBufferSize=function(dt,Kt,Ht){ct=dt,it=Kt,tt=Ht,t.width=Math.floor(dt*Ht),t.height=Math.floor(Kt*Ht),this.setViewport(0,0,dt,Kt)},this.getCurrentViewport=function(dt){return dt.copy(U)},this.getViewport=function(dt){return dt.copy(pt)},this.setViewport=function(dt,Kt,Ht,te){dt.isVector4?pt.set(dt.x,dt.y,dt.z,dt.w):pt.set(dt,Kt,Ht,te),he.viewport(U.copy(pt).multiplyScalar(tt).floor())},this.getScissor=function(dt){return dt.copy(kt)},this.setScissor=function(dt,Kt,Ht,te){dt.isVector4?kt.set(dt.x,dt.y,dt.z,dt.w):kt.set(dt,Kt,Ht,te),he.scissor(B.copy(kt).multiplyScalar(tt).floor())},this.getScissorTest=function(){return Lt},this.setScissorTest=function(dt){he.setScissorTest(Lt=dt)},this.setOpaqueSort=function(dt){rt=dt},this.setTransparentSort=function(dt){et=dt},this.getClearColor=function(dt){return dt.copy(Yr.getClearColor())},this.setClearColor=function(){Yr.setClearColor.apply(Yr,arguments)},this.getClearAlpha=function(){return Yr.getClearAlpha()},this.setClearAlpha=function(){Yr.setClearAlpha.apply(Yr,arguments)},this.clear=function(dt,Kt,Ht){let te=0;(dt===void 0||dt)&&(te|=16384),(Kt===void 0||Kt)&&(te|=256),(Ht===void 0||Ht)&&(te|=1024),fe.clear(te)},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",kS,!1),t.removeEventListener("webglcontextrestored",US,!1),Ae.dispose(),si.dispose(),Q.dispose(),Dt.dispose(),Yt.dispose(),$r.dispose(),ho.dispose(),ho.removeEventListener("sessionstart",HS),ho.removeEventListener("sessionend",zS),le&&(le.dispose(),le=null),Uu.stop()},this.renderBufferImmediate=function(dt,Kt){$r.initAttributes();const Ht=Q.get(dt);dt.hasPositions&&!Ht.position&&(Ht.position=fe.createBuffer()),dt.hasNormals&&!Ht.normal&&(Ht.normal=fe.createBuffer()),dt.hasUvs&&!Ht.uv&&(Ht.uv=fe.createBuffer()),dt.hasColors&&!Ht.color&&(Ht.color=fe.createBuffer());const te=Kt.getAttributes();dt.hasPositions&&(fe.bindBuffer(34962,Ht.position),fe.bufferData(34962,dt.positionArray,35048),$r.enableAttribute(te.position),fe.vertexAttribPointer(te.position,3,5126,!1,0,0)),dt.hasNormals&&(fe.bindBuffer(34962,Ht.normal),fe.bufferData(34962,dt.normalArray,35048),$r.enableAttribute(te.normal),fe.vertexAttribPointer(te.normal,3,5126,!1,0,0)),dt.hasUvs&&(fe.bindBuffer(34962,Ht.uv),fe.bufferData(34962,dt.uvArray,35048),$r.enableAttribute(te.uv),fe.vertexAttribPointer(te.uv,2,5126,!1,0,0)),dt.hasColors&&(fe.bindBuffer(34962,Ht.color),fe.bufferData(34962,dt.colorArray,35048),$r.enableAttribute(te.color),fe.vertexAttribPointer(te.color,3,5126,!1,0,0)),$r.disableUnusedAttributes(),fe.drawArrays(4,0,dt.count),dt.count=0},this.renderBufferDirect=function(dt,Kt,Ht,te,ve,Ai){Kt===null&&(Kt=Xt);const ai=ve.isMesh&&ve.matrixWorld.determinant()<0,we=WS(dt,Kt,te,ve);he.setMaterial(te,ai);let _i=Ht.index;const Xe=Ht.attributes.position;if(_i===null){if(Xe===void 0||Xe.count===0)return}else if(_i.count===0)return;let wi,ni=1;te.wireframe===!0&&(_i=St.getWireframeAttribute(Ht),ni=2),(te.morphTargets||te.morphNormals)&&Rp.update(ve,Ht,te,we),$r.setup(ve,te,we,Ht,_i);let yi=Cp;_i!==null&&(wi=Ft.get(_i),yi=Pp,yi.setIndex(wi));const Un=_i!==null?_i.count:Xe.count,Zi=Ht.drawRange.start*ni,ss=Ht.drawRange.count*ni,Xi=Ai!==null?Ai.start*ni:0,Us=Ai!==null?Ai.count*ni:1/0,Xn=Math.max(Zi,Xi),co=Math.min(Un,Zi+ss,Xi+Us)-1,wr=Math.max(0,co-Xn+1);if(wr!==0){if(ve.isMesh)te.wireframe===!0?(he.setLineWidth(te.wireframeLinewidth*Ut()),yi.setMode(1)):yi.setMode(4);else if(ve.isLine){let Ip=te.linewidth;Ip===void 0&&(Ip=1),he.setLineWidth(Ip*Ut()),ve.isLineSegments?yi.setMode(1):ve.isLineLoop?yi.setMode(2):yi.setMode(3)}else ve.isPoints?yi.setMode(0):ve.isSprite&&yi.setMode(4);if(ve.isInstancedMesh)yi.renderInstances(Xn,wr,ve.count);else if(Ht.isInstancedBufferGeometry){const Ip=Math.min(Ht.instanceCount,Ht._maxInstanceCount);yi.renderInstances(Xn,wr,Ip)}else yi.render(Xn,wr)}},this.compile=function(dt,Kt){p=si.get(dt),p.init(),dt.traverseVisible(function(Ht){Ht.isLight&&Ht.layers.test(Kt.layers)&&(p.pushLight(Ht),Ht.castShadow&&p.pushShadow(Ht))}),p.setupLights(),dt.traverse(function(Ht){const te=Ht.material;if(te)if(Array.isArray(te))for(let ve=0;ve<te.length;ve++)G_(te[ve],dt,Ht);else G_(te,dt,Ht)})};let U_=null;function HS(){Uu.stop()}function zS(){Uu.start()}const Uu=new yd;function Mg(dt,Kt,Ht){const te=Kt.isScene===!0?Kt.overrideMaterial:null;for(let ve=0,Ai=dt.length;ve<Ai;ve++){const ai=dt[ve],we=ai.object,_i=ai.geometry,Xe=te===null?ai.material:te,wi=ai.group;if(Ht.isArrayCamera){const ni=Ht.cameras;for(let yi=0,Un=ni.length;yi<Un;yi++){const Zi=ni[yi];we.layers.test(Zi.layers)&&(he.viewport(U.copy(Zi.viewport)),p.setupLightsView(Zi),jS(we,Kt,Zi,_i,Xe,wi))}}else jS(we,Kt,Ht,_i,Xe,wi)}}function jS(dt,Kt,Ht,te,ve,Ai){if(dt.onBeforeRender(_,Kt,Ht,te,ve,Ai),dt.modelViewMatrix.multiplyMatrices(Ht.matrixWorldInverse,dt.matrixWorld),dt.normalMatrix.getNormalMatrix(dt.modelViewMatrix),dt.isImmediateRenderObject){const ai=WS(Ht,Kt,ve,dt);he.setMaterial(ve),$r.reset(),function(we,_i){we.render(function(Xe){_.renderBufferImmediate(Xe,_i)})}(dt,ai)}else ve.transparent===!0&&ve.side===K?(ve.side=X,ve.needsUpdate=!0,_.renderBufferDirect(Ht,Kt,te,ve,dt,Ai),ve.side=j,ve.needsUpdate=!0,_.renderBufferDirect(Ht,Kt,te,ve,dt,Ai),ve.side=K):_.renderBufferDirect(Ht,Kt,te,ve,dt,Ai);dt.onAfterRender(_,Kt,Ht,te,ve,Ai)}function G_(dt,Kt,Ht){Kt.isScene!==!0&&(Kt=Xt);const te=Q.get(dt),ve=p.state.lights,Ai=p.state.shadowsArray,ai=ve.state.version,we=Me.getParameters(dt,ve.state,Ai,Kt,Ht),_i=Me.getProgramCacheKey(we);let Xe=te.programs;te.environment=dt.isMeshStandardMaterial?Kt.environment:null,te.fog=Kt.fog,te.envMap=Dt.get(dt.envMap||te.environment),Xe===void 0&&(dt.addEventListener("dispose",GS),Xe=new Map,te.programs=Xe);let wi=Xe.get(_i);if(wi!==void 0){if(te.currentProgram===wi&&te.lightsStateVersion===ai)return VS(dt,we),wi}else we.uniforms=Me.getUniforms(dt),dt.onBuild(we,_),dt.onBeforeCompile(we,_),wi=Me.acquireProgram(we,_i),Xe.set(_i,wi),te.uniforms=we.uniforms;const ni=te.uniforms;(dt.isShaderMaterial||dt.isRawShaderMaterial)&&dt.clipping!==!0||(ni.clippingPlanes=Tn.uniform),VS(dt,we),te.needsLights=function(Zi){return Zi.isMeshLambertMaterial||Zi.isMeshToonMaterial||Zi.isMeshPhongMaterial||Zi.isMeshStandardMaterial||Zi.isShadowMaterial||Zi.isShaderMaterial&&Zi.lights===!0}(dt),te.lightsStateVersion=ai,te.needsLights&&(ni.ambientLightColor.value=ve.state.ambient,ni.lightProbe.value=ve.state.probe,ni.directionalLights.value=ve.state.directional,ni.directionalLightShadows.value=ve.state.directionalShadow,ni.spotLights.value=ve.state.spot,ni.spotLightShadows.value=ve.state.spotShadow,ni.rectAreaLights.value=ve.state.rectArea,ni.ltc_1.value=ve.state.rectAreaLTC1,ni.ltc_2.value=ve.state.rectAreaLTC2,ni.pointLights.value=ve.state.point,ni.pointLightShadows.value=ve.state.pointShadow,ni.hemisphereLights.value=ve.state.hemi,ni.directionalShadowMap.value=ve.state.directionalShadowMap,ni.directionalShadowMatrix.value=ve.state.directionalShadowMatrix,ni.spotShadowMap.value=ve.state.spotShadowMap,ni.spotShadowMatrix.value=ve.state.spotShadowMatrix,ni.pointShadowMap.value=ve.state.pointShadowMap,ni.pointShadowMatrix.value=ve.state.pointShadowMatrix);const yi=wi.getUniforms(),Un=xs.seqWithValue(yi.seq,ni);return te.currentProgram=wi,te.uniformsList=Un,wi}function VS(dt,Kt){const Ht=Q.get(dt);Ht.outputEncoding=Kt.outputEncoding,Ht.instancing=Kt.instancing,Ht.skinning=Kt.skinning,Ht.numClippingPlanes=Kt.numClippingPlanes,Ht.numIntersection=Kt.numClipIntersection,Ht.vertexAlphas=Kt.vertexAlphas}function WS(dt,Kt,Ht,te){Kt.isScene!==!0&&(Kt=Xt),gt.resetTextureUnits();const ve=Kt.fog,Ai=Ht.isMeshStandardMaterial?Kt.environment:null,ai=I===null?_.outputEncoding:I.texture.encoding,we=Dt.get(Ht.envMap||Ai),_i=Ht.vertexColors===!0&&te.geometry&&te.geometry.attributes.color&&te.geometry.attributes.color.itemSize===4,Xe=Q.get(Ht),wi=p.state.lights;if(jt===!0&&(ee===!0||dt!==N)){const wr=dt===N&&Ht.id===F;Tn.setState(Ht,dt,wr)}let ni=!1;Ht.version===Xe.__version?Xe.needsLights&&Xe.lightsStateVersion!==wi.state.version||Xe.outputEncoding!==ai||te.isInstancedMesh&&Xe.instancing===!1?ni=!0:te.isInstancedMesh||Xe.instancing!==!0?te.isSkinnedMesh&&Xe.skinning===!1?ni=!0:te.isSkinnedMesh||Xe.skinning!==!0?Xe.envMap!==we||Ht.fog&&Xe.fog!==ve?ni=!0:Xe.numClippingPlanes===void 0||Xe.numClippingPlanes===Tn.numPlanes&&Xe.numIntersection===Tn.numIntersection?Xe.vertexAlphas!==_i&&(ni=!0):ni=!0:ni=!0:ni=!0:(ni=!0,Xe.__version=Ht.version);let yi=Xe.currentProgram;ni===!0&&(yi=G_(Ht,Kt,te));let Un=!1,Zi=!1,ss=!1;const Xi=yi.getUniforms(),Us=Xe.uniforms;if(he.useProgram(yi.program)&&(Un=!0,Zi=!0,ss=!0),Ht.id!==F&&(F=Ht.id,Zi=!0),Un||N!==dt){if(Xi.setValue(fe,"projectionMatrix",dt.projectionMatrix),ue.logarithmicDepthBuffer&&Xi.setValue(fe,"logDepthBufFC",2/(Math.log(dt.far+1)/Math.LN2)),N!==dt&&(N=dt,Zi=!0,ss=!0),Ht.isShaderMaterial||Ht.isMeshPhongMaterial||Ht.isMeshToonMaterial||Ht.isMeshStandardMaterial||Ht.envMap){const wr=Xi.map.cameraPosition;wr!==void 0&&wr.setValue(fe,lt.setFromMatrixPosition(dt.matrixWorld))}(Ht.isMeshPhongMaterial||Ht.isMeshToonMaterial||Ht.isMeshLambertMaterial||Ht.isMeshBasicMaterial||Ht.isMeshStandardMaterial||Ht.isShaderMaterial)&&Xi.setValue(fe,"isOrthographic",dt.isOrthographicCamera===!0),(Ht.isMeshPhongMaterial||Ht.isMeshToonMaterial||Ht.isMeshLambertMaterial||Ht.isMeshBasicMaterial||Ht.isMeshStandardMaterial||Ht.isShaderMaterial||Ht.isShadowMaterial||te.isSkinnedMesh)&&Xi.setValue(fe,"viewMatrix",dt.matrixWorldInverse)}if(te.isSkinnedMesh){Xi.setOptional(fe,te,"bindMatrix"),Xi.setOptional(fe,te,"bindMatrixInverse");const wr=te.skeleton;wr&&(ue.floatVertexTextures?(wr.boneTexture===null&&wr.computeBoneTexture(),Xi.setValue(fe,"boneTexture",wr.boneTexture,gt),Xi.setValue(fe,"boneTextureSize",wr.boneTextureSize)):Xi.setOptional(fe,wr,"boneMatrices"))}var Xn,co;return(Zi||Xe.receiveShadow!==te.receiveShadow)&&(Xe.receiveShadow=te.receiveShadow,Xi.setValue(fe,"receiveShadow",te.receiveShadow)),Zi&&(Xi.setValue(fe,"toneMappingExposure",_.toneMappingExposure),Xe.needsLights&&(co=ss,(Xn=Us).ambientLightColor.needsUpdate=co,Xn.lightProbe.needsUpdate=co,Xn.directionalLights.needsUpdate=co,Xn.directionalLightShadows.needsUpdate=co,Xn.pointLights.needsUpdate=co,Xn.pointLightShadows.needsUpdate=co,Xn.spotLights.needsUpdate=co,Xn.spotLightShadows.needsUpdate=co,Xn.rectAreaLights.needsUpdate=co,Xn.hemisphereLights.needsUpdate=co),ve&&Ht.fog&&Re.refreshFogUniforms(Us,ve),Re.refreshMaterialUniforms(Us,Ht,tt,it,le),xs.upload(fe,Xe.uniformsList,Us,gt)),Ht.isShaderMaterial&&Ht.uniformsNeedUpdate===!0&&(xs.upload(fe,Xe.uniformsList,Us,gt),Ht.uniformsNeedUpdate=!1),Ht.isSpriteMaterial&&Xi.setValue(fe,"center",te.center),Xi.setValue(fe,"modelViewMatrix",te.modelViewMatrix),Xi.setValue(fe,"normalMatrix",te.normalMatrix),Xi.setValue(fe,"modelMatrix",te.matrixWorld),yi}Uu.setAnimationLoop(function(dt){U_&&U_(dt)}),typeof window!="undefined"&&Uu.setContext(window),this.setAnimationLoop=function(dt){U_=dt,ho.setAnimationLoop(dt),dt===null?Uu.stop():Uu.start()},ho.addEventListener("sessionstart",HS),ho.addEventListener("sessionend",zS),this.render=function(dt,Kt){if(Kt!==void 0&&Kt.isCamera!==!0)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(y===!0)return;dt.autoUpdate===!0&&dt.updateMatrixWorld(),Kt.parent===null&&Kt.updateMatrixWorld(),ho.enabled===!0&&ho.isPresenting===!0&&(ho.cameraAutoUpdate===!0&&ho.updateCamera(Kt),Kt=ho.getCamera()),dt.isScene===!0&&dt.onBeforeRender(_,dt,Kt,I),p=si.get(dt,g.length),p.init(),g.push(p),nt.multiplyMatrices(Kt.projectionMatrix,Kt.matrixWorldInverse),xt.setFromProjectionMatrix(nt),ee=this.localClippingEnabled,jt=Tn.init(this.clippingPlanes,ee,Kt),d=Ae.get(dt,m.length),d.init(),m.push(d),function ai(we,_i,Xe,wi){if(we.visible===!1)return;if(we.layers.test(_i.layers)){if(we.isGroup)Xe=we.renderOrder;else if(we.isLOD)we.autoUpdate===!0&&we.update(_i);else if(we.isLight)p.pushLight(we),we.castShadow&&p.pushShadow(we);else if(we.isSprite){if(!we.frustumCulled||xt.intersectsSprite(we)){wi&<.setFromMatrixPosition(we.matrixWorld).applyMatrix4(nt);const yi=Yt.update(we),Un=we.material;Un.visible&&d.push(we,yi,Un,Xe,lt.z,null)}}else if(we.isImmediateRenderObject)wi&<.setFromMatrixPosition(we.matrixWorld).applyMatrix4(nt),d.push(we,null,we.material,Xe,lt.z,null);else if((we.isMesh||we.isLine||we.isPoints)&&(we.isSkinnedMesh&&we.skeleton.frame!==Vt.render.frame&&(we.skeleton.update(),we.skeleton.frame=Vt.render.frame),!we.frustumCulled||xt.intersectsObject(we))){wi&<.setFromMatrixPosition(we.matrixWorld).applyMatrix4(nt);const yi=Yt.update(we),Un=we.material;if(Array.isArray(Un)){const Zi=yi.groups;for(let ss=0,Xi=Zi.length;ss<Xi;ss++){const Us=Zi[ss],Xn=Un[Us.materialIndex];Xn&&Xn.visible&&d.push(we,yi,Xn,Xe,lt.z,Us)}}else Un.visible&&d.push(we,yi,Un,Xe,lt.z,null)}}const ni=we.children;for(let yi=0,Un=ni.length;yi<Un;yi++)ai(ni[yi],_i,Xe,wi)}(dt,Kt,0,_.sortObjects),d.finish(),_.sortObjects===!0&&d.sort(rt,et),jt===!0&&Tn.beginShadows();const Ht=p.state.shadowsArray;Ni.render(Ht,dt,Kt),p.setupLights(),p.setupLightsView(Kt),jt===!0&&Tn.endShadows(),this.info.autoReset===!0&&this.info.reset(),Yr.render(d,dt);const te=d.opaque,ve=d.transmissive,Ai=d.transparent;te.length>0&&Mg(te,dt,Kt),ve.length>0&&function(ai,we,_i,Xe){if(le===null){const yi=s===!0&&ue.isWebGL2===!0;le=new(yi?Qs:Kr)(1024,1024,{generateMipmaps:!0,type:Fr.convert(Ws)!==null?Ws:ls,minFilter:js,magFilter:fi,wrapS:qe,wrapT:qe})}const wi=_.getRenderTarget();_.setRenderTarget(le),_.clear();const ni=_.toneMapping;_.toneMapping=Zr,Mg(ai,_i,Xe),_.toneMapping=ni,gt.updateMultisampleRenderTarget(le),gt.updateRenderTargetMipmap(le),_.setRenderTarget(wi),Mg(we,_i,Xe)}(te,ve,dt,Kt),Ai.length>0&&Mg(Ai,dt,Kt),I!==null&&(gt.updateMultisampleRenderTarget(I),gt.updateRenderTargetMipmap(I)),dt.isScene===!0&&dt.onAfterRender(_,dt,Kt),he.buffers.depth.setTest(!0),he.buffers.depth.setMask(!0),he.buffers.color.setMask(!0),he.setPolygonOffset(!1),$r.resetDefaultState(),F=-1,N=null,g.pop(),p=g.length>0?g[g.length-1]:null,m.pop(),d=m.length>0?m[m.length-1]:null},this.getActiveCubeFace=function(){return w},this.getActiveMipmapLevel=function(){return A},this.getRenderTarget=function(){return I},this.setRenderTarget=function(dt,Kt=0,Ht=0){I=dt,w=Kt,A=Ht,dt&&Q.get(dt).__webglFramebuffer===void 0&>.setupRenderTarget(dt);let te=null,ve=!1,Ai=!1;if(dt){const ai=dt.texture;(ai.isDataTexture3D||ai.isDataTexture2DArray)&&(Ai=!0);const we=Q.get(dt).__webglFramebuffer;dt.isWebGLCubeRenderTarget?(te=we[Kt],ve=!0):te=dt.isWebGLMultisampleRenderTarget?Q.get(dt).__webglMultisampledFramebuffer:we,U.copy(dt.viewport),B.copy(dt.scissor),G=dt.scissorTest}else U.copy(pt).multiplyScalar(tt).floor(),B.copy(kt).multiplyScalar(tt).floor(),G=Lt;if(he.bindFramebuffer(36160,te)&&ue.drawBuffers){let ai=!1;if(dt)if(dt.isWebGLMultipleRenderTargets){const we=dt.texture;if(_t.length!==we.length||_t[0]!==36064){for(let _i=0,Xe=we.length;_i<Xe;_i++)_t[_i]=36064+_i;_t.length=we.length,ai=!0}}else _t.length===1&&_t[0]===36064||(_t[0]=36064,_t.length=1,ai=!0);else _t.length===1&&_t[0]===1029||(_t[0]=1029,_t.length=1,ai=!0);ai&&(ue.isWebGL2?fe.drawBuffers(_t):Bt.get("WEBGL_draw_buffers").drawBuffersWEBGL(_t))}if(he.viewport(U),he.scissor(B),he.setScissorTest(G),ve){const ai=Q.get(dt.texture);fe.framebufferTexture2D(36160,36064,34069+Kt,ai.__webglTexture,Ht)}else if(Ai){const ai=Q.get(dt.texture),we=Kt||0;fe.framebufferTextureLayer(36160,36064,ai.__webglTexture,Ht||0,we)}},this.readRenderTargetPixels=function(dt,Kt,Ht,te,ve,Ai,ai){if(!dt||!dt.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let we=Q.get(dt).__webglFramebuffer;if(dt.isWebGLCubeRenderTarget&&ai!==void 0&&(we=we[ai]),we){he.bindFramebuffer(36160,we);try{const _i=dt.texture,Xe=_i.format,wi=_i.type;if(Xe!==Tr&&Fr.convert(Xe)!==fe.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const ni=wi===Ws&&(Bt.has("EXT_color_buffer_half_float")||ue.isWebGL2&&Bt.has("EXT_color_buffer_float"));if(!(wi===ls||Fr.convert(wi)===fe.getParameter(35738)||wi===Oo&&(ue.isWebGL2||Bt.has("OES_texture_float")||Bt.has("WEBGL_color_buffer_float"))||ni))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");fe.checkFramebufferStatus(36160)===36053?Kt>=0&&Kt<=dt.width-te&&Ht>=0&&Ht<=dt.height-ve&&fe.readPixels(Kt,Ht,te,ve,Fr.convert(Xe),Fr.convert(wi),Ai):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const _i=I!==null?Q.get(I).__webglFramebuffer:null;he.bindFramebuffer(36160,_i)}}},this.copyFramebufferToTexture=function(dt,Kt,Ht=0){const te=Math.pow(2,-Ht),ve=Math.floor(Kt.image.width*te),Ai=Math.floor(Kt.image.height*te);let ai=Fr.convert(Kt.format);ue.isWebGL2&&(ai===6407&&(ai=32849),ai===6408&&(ai=32856)),gt.setTexture2D(Kt,0),fe.copyTexImage2D(3553,Ht,ai,dt.x,dt.y,ve,Ai,0),he.unbindTexture()},this.copyTextureToTexture=function(dt,Kt,Ht,te=0){const ve=Kt.image.width,Ai=Kt.image.height,ai=Fr.convert(Ht.format),we=Fr.convert(Ht.type);gt.setTexture2D(Ht,0),fe.pixelStorei(37440,Ht.flipY),fe.pixelStorei(37441,Ht.premultiplyAlpha),fe.pixelStorei(3317,Ht.unpackAlignment),Kt.isDataTexture?fe.texSubImage2D(3553,te,dt.x,dt.y,ve,Ai,ai,we,Kt.image.data):Kt.isCompressedTexture?fe.compressedTexSubImage2D(3553,te,dt.x,dt.y,Kt.mipmaps[0].width,Kt.mipmaps[0].height,ai,Kt.mipmaps[0].data):fe.texSubImage2D(3553,te,dt.x,dt.y,ai,we,Kt.image),te===0&&Ht.generateMipmaps&&fe.generateMipmap(3553),he.unbindTexture()},this.copyTextureToTexture3D=function(dt,Kt,Ht,te,ve=0){if(_.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const Ai=dt.max.x-dt.min.x+1,ai=dt.max.y-dt.min.y+1,we=dt.max.z-dt.min.z+1,_i=Fr.convert(te.format),Xe=Fr.convert(te.type);let wi;if(te.isDataTexture3D)gt.setTexture3D(te,0),wi=32879;else{if(!te.isDataTexture2DArray)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");gt.setTexture2DArray(te,0),wi=35866}fe.pixelStorei(37440,te.flipY),fe.pixelStorei(37441,te.premultiplyAlpha),fe.pixelStorei(3317,te.unpackAlignment);const ni=fe.getParameter(3314),yi=fe.getParameter(32878),Un=fe.getParameter(3316),Zi=fe.getParameter(3315),ss=fe.getParameter(32877),Xi=Ht.isCompressedTexture?Ht.mipmaps[0]:Ht.image;fe.pixelStorei(3314,Xi.width),fe.pixelStorei(32878,Xi.height),fe.pixelStorei(3316,dt.min.x),fe.pixelStorei(3315,dt.min.y),fe.pixelStorei(32877,dt.min.z),Ht.isDataTexture||Ht.isDataTexture3D?fe.texSubImage3D(wi,ve,Kt.x,Kt.y,Kt.z,Ai,ai,we,_i,Xe,Xi.data):Ht.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),fe.compressedTexSubImage3D(wi,ve,Kt.x,Kt.y,Kt.z,Ai,ai,we,_i,Xi.data)):fe.texSubImage3D(wi,ve,Kt.x,Kt.y,Kt.z,Ai,ai,we,_i,Xe,Xi),fe.pixelStorei(3314,ni),fe.pixelStorei(32878,yi),fe.pixelStorei(3316,Un),fe.pixelStorei(3315,Zi),fe.pixelStorei(32877,ss),ve===0&&te.generateMipmaps&&fe.generateMipmap(wi),he.unbindTexture()},this.initTexture=function(dt){gt.setTexture2D(dt,0),he.unbindTexture()},this.resetState=function(){w=0,A=0,I=null,he.reset(),$r.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class Rn extends Oi{}Rn.prototype.isWebGL1Renderer=!0;class Fn{constructor(t,e=25e-5){this.name="",this.color=new Le(t),this.density=e}clone(){return new Fn(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}Fn.prototype.isFogExp2=!0;class eu{constructor(t,e=1,i=1e3){this.name="",this.color=new Le(t),this.near=e,this.far=i}clone(){return new eu(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}eu.prototype.isFog=!0;class el extends hi{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}}el.prototype.isScene=!0;class fa{constructor(t,e){this.array=t,this.stride=e,this.count=t!==void 0?t.length/e:0,this.usage=Js,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Ar()}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,i){t*=this.stride,i*=e.stride;for(let r=0,o=this.stride;r<o;r++)this.array[t+r]=e.array[i+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=Ar()),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]),i=new this.constructor(e,this.stride);return i.setUsage(this.usage),i}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=Ar()),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}}}fa.prototype.isInterleavedBuffer=!0;const mn=new S;class Yo{constructor(t,e,i,r=!1){this.name="",this.data=t,this.itemSize=e,this.offset=i,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,i=this.data.count;e<i;e++)mn.x=this.getX(e),mn.y=this.getY(e),mn.z=this.getZ(e),mn.applyMatrix4(t),this.setXYZ(e,mn.x,mn.y,mn.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)mn.x=this.getX(e),mn.y=this.getY(e),mn.z=this.getZ(e),mn.applyNormalMatrix(t),this.setXYZ(e,mn.x,mn.y,mn.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)mn.x=this.getX(e),mn.y=this.getY(e),mn.z=this.getZ(e),mn.transformDirection(t),this.setXYZ(e,mn.x,mn.y,mn.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,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this}setXYZ(t,e,i,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=r,this}setXYZW(t,e,i,r,o){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=r,this.data.array[t+3]=o,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 i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let o=0;o<this.itemSize;o++)e.push(this.data.array[r+o])}return new mi(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 Yo(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 i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let o=0;o<this.itemSize;o++)e.push(this.data.array[r+o])}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}}}Yo.prototype.isInterleavedBufferAttribute=!0;class iu extends Dn{constructor(t){super(),this.type="SpriteMaterial",this.color=new Le(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 ma;iu.prototype.isSpriteMaterial=!0;const To=new S,il=new S,ga=new S,va=new ce,nu=new ce,Xf=new Ee,Bh=new S,ru=new S,kh=new S,qf=new ce,ou=new ce,Fd=new ce;class su extends hi{constructor(t){if(super(),this.type="Sprite",ma===void 0){ma=new ze;const e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),i=new fa(e,5);ma.setIndex([0,1,2,0,2,3]),ma.setAttribute("position",new Yo(i,3,0,!1)),ma.setAttribute("uv",new Yo(i,2,3,!1))}this.geometry=ma,this.material=t!==void 0?t:new iu,this.center=new ce(.5,.5)}raycast(t,e){t.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),il.setFromMatrixScale(this.matrixWorld),Xf.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),ga.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&il.multiplyScalar(-ga.z);const i=this.material.rotation;let r,o;i!==0&&(o=Math.cos(i),r=Math.sin(i));const s=this.center;Uh(Bh.set(-.5,-.5,0),ga,s,il,r,o),Uh(ru.set(.5,-.5,0),ga,s,il,r,o),Uh(kh.set(.5,.5,0),ga,s,il,r,o),qf.set(0,0),ou.set(1,0),Fd.set(1,1);let a=t.ray.intersectTriangle(Bh,ru,kh,!1,To);if(a===null&&(Uh(ru.set(-.5,.5,0),ga,s,il,r,o),ou.set(0,1),a=t.ray.intersectTriangle(Bh,kh,ru,!1,To),a===null))return;const l=t.ray.origin.distanceTo(To);l<t.near||l>t.far||e.push({distance:l,point:To.clone(),uv:ji.getUV(To,Bh,ru,kh,qf,ou,Fd,new ce),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 Uh(n,t,e,i,r,o){va.subVectors(n,e).addScalar(.5).multiply(i),r!==void 0?(nu.x=o*va.x-r*va.y,nu.y=r*va.x+o*va.y):nu.copy(va),n.copy(t),n.x+=nu.x,n.y+=nu.y,n.applyMatrix4(Xf)}su.prototype.isSprite=!0;const nl=new S,Yf=new S;class $f extends hi{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(t){super.copy(t,!1);const e=t.levels;for(let i=0,r=e.length;i<r;i++){const o=e[i];this.addLevel(o.object.clone(),o.distance)}return this.autoUpdate=t.autoUpdate,this}addLevel(t,e=0){e=Math.abs(e);const i=this.levels;let r;for(r=0;r<i.length&&!(e<i[r].distance);r++);return i.splice(r,0,{distance:e,object:t}),this.add(t),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(t){const e=this.levels;if(e.length>0){let i,r;for(i=1,r=e.length;i<r&&!(t<e[i].distance);i++);return e[i-1].object}return null}raycast(t,e){if(this.levels.length>0){nl.setFromMatrixPosition(this.matrixWorld);const i=t.ray.origin.distanceTo(nl);this.getObjectForDistance(i).raycast(t,e)}}update(t){const e=this.levels;if(e.length>1){nl.setFromMatrixPosition(t.matrixWorld),Yf.setFromMatrixPosition(this.matrixWorld);const i=nl.distanceTo(Yf)/t.zoom;let r,o;for(e[0].object.visible=!0,r=1,o=e.length;r<o&&i>=e[r].distance;r++)e[r-1].object.visible=!1,e[r].object.visible=!0;for(this._currentLevel=r-1;r<o;r++)e[r].object.visible=!1}}toJSON(t){const e=super.toJSON(t);this.autoUpdate===!1&&(e.object.autoUpdate=!1),e.object.levels=[];const i=this.levels;for(let r=0,o=i.length;r<o;r++){const s=i[r];e.object.levels.push({object:s.object.uuid,distance:s.distance})}return e}}const sr=new S,Gh=new Li,Jf=new Li,bv=new S,Hh=new Ee;class rl extends Ti{constructor(t,e){super(t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Ee,this.bindMatrixInverse=new Ee}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 Li,e=this.geometry.attributes.skinWeight;for(let i=0,r=e.count;i<r;i++){t.x=e.getX(i),t.y=e.getY(i),t.z=e.getZ(i),t.w=e.getW(i);const o=1/t.manhattanLength();o!==1/0?t.multiplyScalar(o):t.set(1,0,0,0),e.setXYZW(i,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 i=this.skeleton,r=this.geometry;Gh.fromBufferAttribute(r.attributes.skinIndex,t),Jf.fromBufferAttribute(r.attributes.skinWeight,t),sr.fromBufferAttribute(r.attributes.position,t).applyMatrix4(this.bindMatrix),e.set(0,0,0);for(let o=0;o<4;o++){const s=Jf.getComponent(o);if(s!==0){const a=Gh.getComponent(o);Hh.multiplyMatrices(i.bones[a].matrixWorld,i.boneInverses[a]),e.addScaledVector(bv.copy(sr).applyMatrix4(Hh),s)}}return e.applyMatrix4(this.bindMatrixInverse)}}rl.prototype.isSkinnedMesh=!0;class zh extends hi{constructor(){super(),this.type="Bone"}}zh.prototype.isBone=!0;class ws extends dn{constructor(t=null,e=1,i=1,r,o,s,a,l,u=fi,h=fi,d,p){super(null,s,a,l,u,h,r,o,d,p),this.image={data:t,width:e,height:i},this.magFilter=u,this.minFilter=h,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}ws.prototype.isDataTexture=!0;const Zf=new Ee,Kf=new Ee;class jh{constructor(t=[],e=[]){this.uuid=Ar(),this.bones=t.slice(0),this.boneInverses=e,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){const t=this.bones,e=this.boneInverses;if(this.boneMatrices=new Float32Array(16*t.length),e.length===0)this.calculateInverses();else if(t.length!==e.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let i=0,r=this.bones.length;i<r;i++)this.boneInverses.push(new Ee)}}calculateInverses(){this.boneInverses.length=0;for(let t=0,e=this.bones.length;t<e;t++){const i=new Ee;this.bones[t]&&i.copy(this.bones[t].matrixWorld).invert(),this.boneInverses.push(i)}}pose(){for(let t=0,e=this.bones.length;t<e;t++){const i=this.bones[t];i&&i.matrixWorld.copy(this.boneInverses[t]).invert()}for(let t=0,e=this.bones.length;t<e;t++){const i=this.bones[t];i&&(i.parent&&i.parent.isBone?(i.matrix.copy(i.parent.matrixWorld).invert(),i.matrix.multiply(i.matrixWorld)):i.matrix.copy(i.matrixWorld),i.matrix.decompose(i.position,i.quaternion,i.scale))}}update(){const t=this.bones,e=this.boneInverses,i=this.boneMatrices,r=this.boneTexture;for(let o=0,s=t.length;o<s;o++){const a=t[o]?t[o].matrixWorld:Kf;Zf.multiplyMatrices(a,e[o]),Zf.toArray(i,16*o)}r!==null&&(r.needsUpdate=!0)}clone(){return new jh(this.bones,this.boneInverses)}computeBoneTexture(){let t=Math.sqrt(4*this.bones.length);t=Ba(t),t=Math.max(t,4);const e=new Float32Array(t*t*4);e.set(this.boneMatrices);const i=new ws(e,t,t,Tr,Oo);return this.boneMatrices=e,this.boneTexture=i,this.boneTextureSize=t,this}getBoneByName(t){for(let e=0,i=this.bones.length;e<i;e++){const r=this.bones[e];if(r.name===t)return r}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(t,e){this.uuid=t.uuid;for(let i=0,r=t.bones.length;i<r;i++){const o=t.bones[i];let s=e[o];s===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",o),s=new zh),this.bones.push(s),this.boneInverses.push(new Ee().fromArray(t.boneInverses[i]))}return this.init(),this}toJSON(){const t={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};t.uuid=this.uuid;const e=this.bones,i=this.boneInverses;for(let r=0,o=e.length;r<o;r++){const s=e[r];t.bones.push(s.uuid);const a=i[r];t.boneInverses.push(a.toArray())}return t}}const Qf=new Ee,Vh=new Ee,ol=[],au=new Ti;class Bd extends Ti{constructor(t,e,i){super(t,e),this.instanceMatrix=new mi(new Float32Array(16*i),16),this.instanceColor=null,this.count=i,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 i=this.matrixWorld,r=this.count;if(au.geometry=this.geometry,au.material=this.material,au.material!==void 0)for(let o=0;o<r;o++){this.getMatrixAt(o,Qf),Vh.multiplyMatrices(i,Qf),au.matrixWorld=Vh,au.raycast(t,ol);for(let s=0,a=ol.length;s<a;s++){const l=ol[s];l.instanceId=o,l.object=this,e.push(l)}ol.length=0}}setColorAt(t,e){this.instanceColor===null&&(this.instanceColor=new mi(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"})}}Bd.prototype.isInstancedMesh=!0;class Bn extends Dn{constructor(t){super(),this.type="LineBasicMaterial",this.color=new Le(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}}Bn.prototype.isLineBasicMaterial=!0;const tm=new S,Wh=new S,em=new Ee,kd=new jo,Xh=new En;class c extends hi{constructor(t=new ze,e=new Bn){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,i=[0];for(let r=1,o=e.count;r<o;r++)tm.fromBufferAttribute(e,r-1),Wh.fromBufferAttribute(e,r),i[r]=i[r-1],i[r]+=tm.distanceTo(Wh);t.setAttribute("lineDistance",new _e(i,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 i=this.geometry,r=this.matrixWorld,o=t.params.Line.threshold,s=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),Xh.copy(i.boundingSphere),Xh.applyMatrix4(r),Xh.radius+=o,t.ray.intersectsSphere(Xh)===!1)return;em.copy(r).invert(),kd.copy(t.ray).applyMatrix4(em);const a=o/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,u=new S,h=new S,d=new S,p=new S,m=this.isLineSegments?2:1;if(i.isBufferGeometry){const g=i.index,_=i.attributes.position;if(g!==null)for(let y=Math.max(0,s.start),w=Math.min(g.count,s.start+s.count)-1;y<w;y+=m){const A=g.getX(y),I=g.getX(y+1);if(u.fromBufferAttribute(_,A),h.fromBufferAttribute(_,I),kd.distanceSqToSegment(u,h,p,d)>l)continue;p.applyMatrix4(this.matrixWorld);const F=t.ray.origin.distanceTo(p);F<t.near||F>t.far||e.push({distance:F,point:d.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}else for(let y=Math.max(0,s.start),w=Math.min(_.count,s.start+s.count)-1;y<w;y+=m){if(u.fromBufferAttribute(_,y),h.fromBufferAttribute(_,y+1),kd.distanceSqToSegment(u,h,p,d)>l)continue;p.applyMatrix4(this.matrixWorld);const A=t.ray.origin.distanceTo(p);A<t.near||A>t.far||e.push({distance:A,point:d.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}else i.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,i=Object.keys(e);if(i.length>0){const r=e[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=r.length;o<s;o++){const a=r[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=o}}}}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.")}}}c.prototype.isLine=!0;const f=new S,x=new S;class R extends c{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,i=[];for(let r=0,o=e.count;r<o;r+=2)f.fromBufferAttribute(e,r),x.fromBufferAttribute(e,r+1),i[r]=r===0?0:i[r-1],i[r+1]=i[r]+f.distanceTo(x);t.setAttribute("lineDistance",new _e(i,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}}R.prototype.isLineSegments=!0;class D extends c{constructor(t,e){super(t,e),this.type="LineLoop"}}D.prototype.isLineLoop=!0;class $ extends Dn{constructor(t){super(),this.type="PointsMaterial",this.color=new Le(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}}$.prototype.isPointsMaterial=!0;const ut=new Ee,mt=new jo,Mt=new En,Jt=new S;class Zt extends hi{constructor(t=new ze,e=new $){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 i=this.geometry,r=this.matrixWorld,o=t.params.Points.threshold,s=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),Mt.copy(i.boundingSphere),Mt.applyMatrix4(r),Mt.radius+=o,t.ray.intersectsSphere(Mt)===!1)return;ut.copy(r).invert(),mt.copy(t.ray).applyMatrix4(ut);const a=o/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a;if(i.isBufferGeometry){const u=i.index,h=i.attributes.position;if(u!==null)for(let d=Math.max(0,s.start),p=Math.min(u.count,s.start+s.count);d<p;d++){const m=u.getX(d);Jt.fromBufferAttribute(h,m),de(Jt,m,l,r,t,e,this)}else for(let d=Math.max(0,s.start),p=Math.min(h.count,s.start+s.count);d<p;d++)Jt.fromBufferAttribute(h,d),de(Jt,d,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,i=Object.keys(e);if(i.length>0){const r=e[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=r.length;o<s;o++){const a=r[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=o}}}}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 de(n,t,e,i,r,o,s){const a=mt.distanceSqToPoint(n);if(a<e){const l=new S;mt.closestPointToPoint(n,l),l.applyMatrix4(i);const u=r.ray.origin.distanceTo(l);if(u<r.near||u>r.far)return;o.push({distance:u,distanceToRay:Math.sqrt(a),point:l,index:t,face:null,object:s})}}Zt.prototype.isPoints=!0;class Oe extends dn{constructor(t,e,i,r,o,s,a,l,u){super(t,e,i,r,o,s,a,l,u),this.format=a!==void 0?a:No,this.minFilter=s!==void 0?s:qi,this.magFilter=o!==void 0?o:qi,this.generateMipmaps=!1;const h=this;"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback(function d(){h.needsUpdate=!0,t.requestVideoFrameCallback(d)})}clone(){return new this.constructor(this.image).copy(this)}update(){const t=this.image;!("requestVideoFrameCallback"in t)&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}Oe.prototype.isVideoTexture=!0;class Fe extends dn{constructor(t,e,i,r,o,s,a,l,u,h,d,p){super(null,s,a,l,u,h,r,o,d,p),this.image={width:e,height:i},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}Fe.prototype.isCompressedTexture=!0;class Ve extends dn{constructor(t,e,i,r,o,s,a,l,u){super(t,e,i,r,o,s,a,l,u),this.needsUpdate=!0}}Ve.prototype.isCanvasTexture=!0;class re extends dn{constructor(t,e,i,r,o,s,a,l,u,h){if((h=h!==void 0?h:tn)!==tn&&h!==Xs)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&h===tn&&(i=Pl),i===void 0&&h===Xs&&(i=Pi),super(null,r,o,s,a,l,h,i,u),this.image={width:t,height:e},this.magFilter=a!==void 0?a:fi,this.minFilter=l!==void 0?l:fi,this.flipY=!1,this.generateMipmaps=!1}}re.prototype.isDepthTexture=!0;class pe extends ze{constructor(t=1,e=8,i=0,r=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:i,thetaLength:r},e=Math.max(3,e);const o=[],s=[],a=[],l=[],u=new S,h=new ce;s.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let d=0,p=3;d<=e;d++,p+=3){const m=i+d/e*r;u.x=t*Math.cos(m),u.y=t*Math.sin(m),s.push(u.x,u.y,u.z),a.push(0,0,1),h.x=(s[p]/t+1)/2,h.y=(s[p+1]/t+1)/2,l.push(h.x,h.y)}for(let d=1;d<=e;d++)o.push(d,d+1,0);this.setIndex(o),this.setAttribute("position",new _e(s,3)),this.setAttribute("normal",new _e(a,3)),this.setAttribute("uv",new _e(l,2))}static fromJSON(t){return new pe(t.radius,t.segments,t.thetaStart,t.thetaLength)}}class He extends ze{constructor(t=1,e=1,i=1,r=8,o=1,s=!1,a=0,l=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:i,radialSegments:r,heightSegments:o,openEnded:s,thetaStart:a,thetaLength:l};const u=this;r=Math.floor(r),o=Math.floor(o);const h=[],d=[],p=[],m=[];let g=0;const _=[],y=i/2;let w=0;function A(I){const F=g,N=new ce,U=new S;let B=0;const G=I===!0?t:e,ct=I===!0?1:-1;for(let tt=1;tt<=r;tt++)d.push(0,y*ct,0),p.push(0,ct,0),m.push(.5,.5),g++;const it=g;for(let tt=0;tt<=r;tt++){const rt=tt/r*l+a,et=Math.cos(rt),pt=Math.sin(rt);U.x=G*pt,U.y=y*ct,U.z=G*et,d.push(U.x,U.y,U.z),p.push(0,ct,0),N.x=.5*et+.5,N.y=.5*pt*ct+.5,m.push(N.x,N.y),g++}for(let tt=0;tt<r;tt++){const rt=F+tt,et=it+tt;I===!0?h.push(et,et+1,rt):h.push(et+1,et,rt),B+=3}u.addGroup(w,B,I===!0?1:2),w+=B}(function(){const I=new S,F=new S;let N=0;const U=(e-t)/i;for(let B=0;B<=o;B++){const G=[],ct=B/o,it=ct*(e-t)+t;for(let tt=0;tt<=r;tt++){const rt=tt/r,et=rt*l+a,pt=Math.sin(et),kt=Math.cos(et);F.x=it*pt,F.y=-ct*i+y,F.z=it*kt,d.push(F.x,F.y,F.z),I.set(pt,U,kt).normalize(),p.push(I.x,I.y,I.z),m.push(rt,1-ct),G.push(g++)}_.push(G)}for(let B=0;B<r;B++)for(let G=0;G<o;G++){const ct=_[G][B],it=_[G+1][B],tt=_[G+1][B+1],rt=_[G][B+1];h.push(ct,it,rt),h.push(it,tt,rt),N+=6}u.addGroup(w,N,0),w+=N})(),s===!1&&(t>0&&A(!0),e>0&&A(!1)),this.setIndex(h),this.setAttribute("position",new _e(d,3)),this.setAttribute("normal",new _e(p,3)),this.setAttribute("uv",new _e(m,2))}static fromJSON(t){return new He(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class Ce extends He{constructor(t=1,e=1,i=8,r=1,o=!1,s=0,a=2*Math.PI){super(0,t,e,i,r,o,s,a),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:i,heightSegments:r,openEnded:o,thetaStart:s,thetaLength:a}}static fromJSON(t){return new Ce(t.radius,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class Ue extends ze{constructor(t,e,i=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:i,detail:r};const o=[],s=[];function a(p,m,g,_){const y=_+1,w=[];for(let A=0;A<=y;A++){w[A]=[];const I=p.clone().lerp(g,A/y),F=m.clone().lerp(g,A/y),N=y-A;for(let U=0;U<=N;U++)w[A][U]=U===0&&A===y?I:I.clone().lerp(F,U/N)}for(let A=0;A<y;A++)for(let I=0;I<2*(y-A)-1;I++){const F=Math.floor(I/2);I%2==0?(l(w[A][F+1]),l(w[A+1][F]),l(w[A][F])):(l(w[A][F+1]),l(w[A+1][F+1]),l(w[A+1][F]))}}function l(p){o.push(p.x,p.y,p.z)}function u(p,m){const g=3*p;m.x=t[g+0],m.y=t[g+1],m.z=t[g+2]}function h(p,m,g,_){_<0&&p.x===1&&(s[m]=p.x-1),g.x===0&&g.z===0&&(s[m]=_/2/Math.PI+.5)}function d(p){return Math.atan2(p.z,-p.x)}(function(p){const m=new S,g=new S,_=new S;for(let y=0;y<e.length;y+=3)u(e[y+0],m),u(e[y+1],g),u(e[y+2],_),a(m,g,_,p)})(r),function(p){const m=new S;for(let g=0;g<o.length;g+=3)m.x=o[g+0],m.y=o[g+1],m.z=o[g+2],m.normalize().multiplyScalar(p),o[g+0]=m.x,o[g+1]=m.y,o[g+2]=m.z}(i),function(){const p=new S;for(let g=0;g<o.length;g+=3){p.x=o[g+0],p.y=o[g+1],p.z=o[g+2];const _=d(p)/2/Math.PI+.5,y=(m=p,Math.atan2(-m.y,Math.sqrt(m.x*m.x+m.z*m.z))/Math.PI+.5);s.push(_,1-y)}var m;(function(){const g=new S,_=new S,y=new S,w=new S,A=new ce,I=new ce,F=new ce;for(let N=0,U=0;N<o.length;N+=9,U+=6){g.set(o[N+0],o[N+1],o[N+2]),_.set(o[N+3],o[N+4],o[N+5]),y.set(o[N+6],o[N+7],o[N+8]),A.set(s[U+0],s[U+1]),I.set(s[U+2],s[U+3]),F.set(s[U+4],s[U+5]),w.copy(g).add(_).add(y).divideScalar(3);const B=d(w);h(A,U+0,g,B),h(I,U+2,_,B),h(F,U+4,y,B)}})(),function(){for(let g=0;g<s.length;g+=6){const _=s[g+0],y=s[g+2],w=s[g+4],A=Math.max(_,y,w),I=Math.min(_,y,w);A>.9&&I<.1&&(_<.2&&(s[g+0]+=1),y<.2&&(s[g+2]+=1),w<.2&&(s[g+4]+=1))}}()}(),this.setAttribute("position",new _e(o,3)),this.setAttribute("normal",new _e(o.slice(),3)),this.setAttribute("uv",new _e(s,2)),r===0?this.computeVertexNormals():this.normalizeNormals()}static fromJSON(t){return new Ue(t.vertices,t.indices,t.radius,t.details)}}class Ye extends Ue{constructor(t=1,e=0){const i=(1+Math.sqrt(5))/2,r=1/i;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-i,0,-r,i,0,r,-i,0,r,i,-r,-i,0,-r,i,0,r,-i,0,r,i,0,-i,0,-r,i,0,-r,-i,0,r,i,0,r],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new Ye(t.radius,t.detail)}}const li=new S,ke=new S,Je=new S,hn=new ji;class Vn extends ze{constructor(t,e){if(super(),this.type="EdgesGeometry",this.parameters={thresholdAngle:e},e=e!==void 0?e:1,t.isGeometry===!0)return void console.error("THREE.EdgesGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");const i=Math.pow(10,4),r=Math.cos(Hi*e),o=t.getIndex(),s=t.getAttribute("position"),a=o?o.count:s.count,l=[0,0,0],u=["a","b","c"],h=new Array(3),d={},p=[];for(let m=0;m<a;m+=3){o?(l[0]=o.getX(m),l[1]=o.getX(m+1),l[2]=o.getX(m+2)):(l[0]=m,l[1]=m+1,l[2]=m+2);const{a:g,b:_,c:y}=hn;if(g.fromBufferAttribute(s,l[0]),_.fromBufferAttribute(s,l[1]),y.fromBufferAttribute(s,l[2]),hn.getNormal(Je),h[0]=`${Math.round(g.x*i)},${Math.round(g.y*i)},${Math.round(g.z*i)}`,h[1]=`${Math.round(_.x*i)},${Math.round(_.y*i)},${Math.round(_.z*i)}`,h[2]=`${Math.round(y.x*i)},${Math.round(y.y*i)},${Math.round(y.z*i)}`,h[0]!==h[1]&&h[1]!==h[2]&&h[2]!==h[0])for(let w=0;w<3;w++){const A=(w+1)%3,I=h[w],F=h[A],N=hn[u[w]],U=hn[u[A]],B=`${I}_${F}`,G=`${F}_${I}`;G in d&&d[G]?(Je.dot(d[G].normal)<=r&&(p.push(N.x,N.y,N.z),p.push(U.x,U.y,U.z)),d[G]=null):B in d||(d[B]={index0:l[w],index1:l[A],normal:Je.clone()})}}for(const m in d)if(d[m]){const{index0:g,index1:_}=d[m];li.fromBufferAttribute(s,g),ke.fromBufferAttribute(s,_),p.push(li.x,li.y,li.z),p.push(ke.x,ke.y,ke.z)}this.setAttribute("position",new _e(p,3))}}class cn{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const i=this.getUtoTmapping(t);return this.getPoint(i,e)}getPoints(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return e}getSpacedPoints(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPointAt(i/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 i,r=this.getPoint(0),o=0;e.push(0);for(let s=1;s<=t;s++)i=this.getPoint(s/t),o+=i.distanceTo(r),e.push(o),r=i;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const i=this.getLengths();let r=0;const o=i.length;let s;s=e||t*i[o-1];let a,l=0,u=o-1;for(;l<=u;)if(r=Math.floor(l+(u-l)/2),a=i[r]-s,a<0)l=r+1;else{if(!(a>0)){u=r;break}u=r-1}if(r=u,i[r]===s)return r/(o-1);const h=i[r];return(r+(s-h)/(i[r+1]-h))/(o-1)}getTangent(t,e){let i=t-1e-4,r=t+1e-4;i<0&&(i=0),r>1&&(r=1);const o=this.getPoint(i),s=this.getPoint(r),a=e||(o.isVector2?new ce:new S);return a.copy(s).sub(o).normalize(),a}getTangentAt(t,e){const i=this.getUtoTmapping(t);return this.getTangent(i,e)}computeFrenetFrames(t,e){const i=new S,r=[],o=[],s=[],a=new S,l=new Ee;for(let m=0;m<=t;m++){const g=m/t;r[m]=this.getTangentAt(g,new S),r[m].normalize()}o[0]=new S,s[0]=new S;let u=Number.MAX_VALUE;const h=Math.abs(r[0].x),d=Math.abs(r[0].y),p=Math.abs(r[0].z);h<=u&&(u=h,i.set(1,0,0)),d<=u&&(u=d,i.set(0,1,0)),p<=u&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),o[0].crossVectors(r[0],a),s[0].crossVectors(r[0],o[0]);for(let m=1;m<=t;m++){if(o[m]=o[m-1].clone(),s[m]=s[m-1].clone(),a.crossVectors(r[m-1],r[m]),a.length()>Number.EPSILON){a.normalize();const g=Math.acos(zn(r[m-1].dot(r[m]),-1,1));o[m].applyMatrix4(l.makeRotationAxis(a,g))}s[m].crossVectors(r[m],o[m])}if(e===!0){let m=Math.acos(zn(o[0].dot(o[t]),-1,1));m/=t,r[0].dot(a.crossVectors(o[0],o[t]))>0&&(m=-m);for(let g=1;g<=t;g++)o[g].applyMatrix4(l.makeRotationAxis(r[g],m*g)),s[g].crossVectors(r[g],o[g])}return{tangents:r,normals:o,binormals:s}}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 on extends cn{constructor(t=0,e=0,i=1,r=1,o=0,s=2*Math.PI,a=!1,l=0){super(),this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=r,this.aStartAngle=o,this.aEndAngle=s,this.aClockwise=a,this.aRotation=l}getPoint(t,e){const i=e||new ce,r=2*Math.PI;let o=this.aEndAngle-this.aStartAngle;const s=Math.abs(o)<Number.EPSILON;for(;o<0;)o+=r;for(;o>r;)o-=r;o<Number.EPSILON&&(o=s?0:r),this.aClockwise!==!0||s||(o===r?o=-r:o-=r);const a=this.aStartAngle+t*o;let l=this.aX+this.xRadius*Math.cos(a),u=this.aY+this.yRadius*Math.sin(a);if(this.aRotation!==0){const h=Math.cos(this.aRotation),d=Math.sin(this.aRotation),p=l-this.aX,m=u-this.aY;l=p*h-m*d+this.aX,u=p*d+m*h+this.aY}return i.set(l,u)}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}}on.prototype.isEllipseCurve=!0;class so extends on{constructor(t,e,i,r,o,s){super(t,e,i,i,r,o,s),this.type="ArcCurve"}}function Eo(){let n=0,t=0,e=0,i=0;function r(o,s,a,l){n=o,t=a,e=-3*o+3*s-2*a-l,i=2*o-2*s+a+l}return{initCatmullRom:function(o,s,a,l,u){r(s,a,u*(a-o),u*(l-s))},initNonuniformCatmullRom:function(o,s,a,l,u,h,d){let p=(s-o)/u-(a-o)/(u+h)+(a-s)/h,m=(a-s)/h-(l-s)/(h+d)+(l-a)/d;p*=h,m*=h,r(s,a,p,m)},calc:function(o){const s=o*o;return n+t*o+e*s+i*(s*o)}}}so.prototype.isArcCurve=!0;const Ss=new S,sl=new Eo,Ts=new Eo,Mo=new Eo;class qh extends cn{constructor(t=[],e=!1,i="centripetal",r=.5){super(),this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=i,this.tension=r}getPoint(t,e=new S){const i=e,r=this.points,o=r.length,s=(o-(this.closed?0:1))*t;let a,l,u=Math.floor(s),h=s-u;this.closed?u+=u>0?0:(Math.floor(Math.abs(u)/o)+1)*o:h===0&&u===o-1&&(u=o-2,h=1),this.closed||u>0?a=r[(u-1)%o]:(Ss.subVectors(r[0],r[1]).add(r[0]),a=Ss);const d=r[u%o],p=r[(u+1)%o];if(this.closed||u+2<o?l=r[(u+2)%o]:(Ss.subVectors(r[o-1],r[o-2]).add(r[o-1]),l=Ss),this.curveType==="centripetal"||this.curveType==="chordal"){const m=this.curveType==="chordal"?.5:.25;let g=Math.pow(a.distanceToSquared(d),m),_=Math.pow(d.distanceToSquared(p),m),y=Math.pow(p.distanceToSquared(l),m);_<1e-4&&(_=1),g<1e-4&&(g=_),y<1e-4&&(y=_),sl.initNonuniformCatmullRom(a.x,d.x,p.x,l.x,g,_,y),Ts.initNonuniformCatmullRom(a.y,d.y,p.y,l.y,g,_,y),Mo.initNonuniformCatmullRom(a.z,d.z,p.z,l.z,g,_,y)}else this.curveType==="catmullrom"&&(sl.initCatmullRom(a.x,d.x,p.x,l.x,this.tension),Ts.initCatmullRom(a.y,d.y,p.y,l.y,this.tension),Mo.initCatmullRom(a.z,d.z,p.z,l.z,this.tension));return i.set(sl.calc(h),Ts.calc(h),Mo.calc(h)),i}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e<i;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,i=this.points.length;e<i;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,i=t.points.length;e<i;e++){const r=t.points[e];this.points.push(new S().fromArray(r))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}}function Ud(n,t,e,i,r){const o=.5*(i-t),s=.5*(r-e),a=n*n;return(2*e-2*i+o+s)*(n*a)+(-3*e+3*i-2*o-s)*a+o*n+e}function Es(n,t,e,i){return function(r,o){const s=1-r;return s*s*o}(n,t)+function(r,o){return 2*(1-r)*r*o}(n,e)+function(r,o){return r*r*o}(n,i)}function _a(n,t,e,i,r){return function(o,s){const a=1-o;return a*a*a*s}(n,t)+function(o,s){const a=1-o;return 3*a*a*o*s}(n,e)+function(o,s){return 3*(1-o)*o*o*s}(n,i)+function(o,s){return o*o*o*s}(n,r)}qh.prototype.isCatmullRomCurve3=!0;class ya extends cn{constructor(t=new ce,e=new ce,i=new ce,r=new ce){super(),this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=i,this.v3=r}getPoint(t,e=new ce){const i=e,r=this.v0,o=this.v1,s=this.v2,a=this.v3;return i.set(_a(t,r.x,o.x,s.x,a.x),_a(t,r.y,o.y,s.y,a.y)),i}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}}ya.prototype.isCubicBezierCurve=!0;class al extends cn{constructor(t=new S,e=new S,i=new S,r=new S){super(),this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=i,this.v3=r}getPoint(t,e=new S){const i=e,r=this.v0,o=this.v1,s=this.v2,a=this.v3;return i.set(_a(t,r.x,o.x,s.x,a.x),_a(t,r.y,o.y,s.y,a.y),_a(t,r.z,o.z,s.z,a.z)),i}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}}al.prototype.isCubicBezierCurve3=!0;class ll extends cn{constructor(t=new ce,e=new ce){super(),this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new ce){const i=e;return t===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e){const i=e||new ce;return i.copy(this.v2).sub(this.v1).normalize(),i}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}}ll.prototype.isLineCurve=!0;class lu extends cn{constructor(t=new S,e=new S){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=t,this.v2=e}getPoint(t,e=new S){const i=e;return t===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i}getPointAt(t,e){return this.getPoint(t,e)}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}}class xa extends cn{constructor(t=new ce,e=new ce,i=new ce){super(),this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=i}getPoint(t,e=new ce){const i=e,r=this.v0,o=this.v1,s=this.v2;return i.set(Es(t,r.x,o.x,s.x),Es(t,r.y,o.y,s.y)),i}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}}xa.prototype.isQuadraticBezierCurve=!0;class wv extends cn{constructor(t=new S,e=new S,i=new S){super(),this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=i}getPoint(t,e=new S){const i=e,r=this.v0,o=this.v1,s=this.v2;return i.set(Es(t,r.x,o.x,s.x),Es(t,r.y,o.y,s.y),Es(t,r.z,o.z,s.z)),i}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}}wv.prototype.isQuadraticBezierCurve3=!0;class im extends cn{constructor(t=[]){super(),this.type="SplineCurve",this.points=t}getPoint(t,e=new ce){const i=e,r=this.points,o=(r.length-1)*t,s=Math.floor(o),a=o-s,l=r[s===0?s:s-1],u=r[s],h=r[s>r.length-2?r.length-1:s+1],d=r[s>r.length-3?r.length-1:s+2];return i.set(Ud(a,l.x,u.x,h.x,d.x),Ud(a,l.y,u.y,h.y,d.y)),i}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const r=t.points[e];this.points.push(r.clone())}return this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,i=this.points.length;e<i;e++){const r=this.points[e];t.points.push(r.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const r=t.points[e];this.points.push(new ce().fromArray(r))}return this}}im.prototype.isSplineCurve=!0;var Sv=Object.freeze({__proto__:null,ArcCurve:so,CatmullRomCurve3:qh,CubicBezierCurve:ya,CubicBezierCurve3:al,EllipseCurve:on,LineCurve:ll,LineCurve3:lu,QuadraticBezierCurve:xa,QuadraticBezierCurve3:wv,SplineCurve:im});const WT=function(n,t,e=2){const i=t&&t.length,r=i?t[0]*e:n.length;let o=sy(n,0,r,e,!0);const s=[];if(!o||o.next===o.prev)return s;let a,l,u,h,d,p,m;if(i&&(o=function(g,_,y,w){const A=[];let I,F,N,U,B;for(I=0,F=_.length;I<F;I++)N=_[I]*w,U=I<F-1?_[I+1]*w:g.length,B=sy(g,N,U,w,!1),B===B.next&&(B.steiner=!0),A.push(QT(B));for(A.sort(JT),I=0;I<A.length;I++)ZT(A[I],y),y=ul(y,y.next);return y}(n,t,o,e)),n.length>80*e){a=u=n[0],l=h=n[1];for(let g=e;g<r;g+=e)d=n[g],p=n[g+1],d<a&&(a=d),p<l&&(l=p),d>u&&(u=d),p>h&&(h=p);m=Math.max(u-a,h-l),m=m!==0?1/m:0}return Gd(o,s,e,a,l,m),s};function sy(n,t,e,i,r){let o,s;if(r===function(a,l,u,h){let d=0;for(let p=l,m=u-h;p<u;p+=h)d+=(a[m]-a[p])*(a[p+1]+a[m+1]),m=p;return d}(n,t,e,i)>0)for(o=t;o<e;o+=i)s=uy(o,n[o],n[o+1],s);else for(o=e-i;o>=t;o-=i)s=uy(o,n[o],n[o+1],s);return s&&nm(s,s.next)&&(zd(s),s=s.next),s}function ul(n,t){if(!n)return n;t||(t=n);let e,i=n;do if(e=!1,i.steiner||!nm(i,i.next)&&gn(i.prev,i,i.next)!==0)i=i.next;else{if(zd(i),i=t=i.prev,i===i.next)break;e=!0}while(e||i!==t);return t}function Gd(n,t,e,i,r,o,s){if(!n)return;!s&&o&&function(h,d,p,m){let g=h;do g.z===null&&(g.z=Tv(g.x,g.y,d,p,m)),g.prevZ=g.prev,g.nextZ=g.next,g=g.next;while(g!==h);g.prevZ.nextZ=null,g.prevZ=null,function(_){let y,w,A,I,F,N,U,B,G=1;do{for(w=_,_=null,F=null,N=0;w;){for(N++,A=w,U=0,y=0;y<G&&(U++,A=A.nextZ,A);y++);for(B=G;U>0||B>0&&A;)U!==0&&(B===0||!A||w.z<=A.z)?(I=w,w=w.nextZ,U--):(I=A,A=A.nextZ,B--),F?F.nextZ=I:_=I,I.prevZ=F,F=I;w=A}F.nextZ=null,G*=2}while(N>1)}(g)}(n,i,r,o);let a,l,u=n;for(;n.prev!==n.next;)if(a=n.prev,l=n.next,o?qT(n,i,r,o):XT(n))t.push(a.i/e),t.push(n.i/e),t.push(l.i/e),zd(n),n=l.next,u=l.next;else if((n=l)===u){s?s===1?Gd(n=YT(ul(n),t,e),t,e,i,r,o,2):s===2&&$T(n,t,e,i,r,o):Gd(ul(n),t,e,i,r,o,1);break}}function XT(n){const t=n.prev,e=n,i=n.next;if(gn(t,e,i)>=0)return!1;let r=n.next.next;for(;r!==n.prev;){if(Yh(t.x,t.y,e.x,e.y,i.x,i.y,r.x,r.y)&&gn(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function qT(n,t,e,i){const r=n.prev,o=n,s=n.next;if(gn(r,o,s)>=0)return!1;const a=r.x<o.x?r.x<s.x?r.x:s.x:o.x<s.x?o.x:s.x,l=r.y<o.y?r.y<s.y?r.y:s.y:o.y<s.y?o.y:s.y,u=r.x>o.x?r.x>s.x?r.x:s.x:o.x>s.x?o.x:s.x,h=r.y>o.y?r.y>s.y?r.y:s.y:o.y>s.y?o.y:s.y,d=Tv(a,l,t,e,i),p=Tv(u,h,t,e,i);let m=n.prevZ,g=n.nextZ;for(;m&&m.z>=d&&g&&g.z<=p;){if(m!==n.prev&&m!==n.next&&Yh(r.x,r.y,o.x,o.y,s.x,s.y,m.x,m.y)&&gn(m.prev,m,m.next)>=0||(m=m.prevZ,g!==n.prev&&g!==n.next&&Yh(r.x,r.y,o.x,o.y,s.x,s.y,g.x,g.y)&&gn(g.prev,g,g.next)>=0))return!1;g=g.nextZ}for(;m&&m.z>=d;){if(m!==n.prev&&m!==n.next&&Yh(r.x,r.y,o.x,o.y,s.x,s.y,m.x,m.y)&&gn(m.prev,m,m.next)>=0)return!1;m=m.prevZ}for(;g&&g.z<=p;){if(g!==n.prev&&g!==n.next&&Yh(r.x,r.y,o.x,o.y,s.x,s.y,g.x,g.y)&&gn(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function YT(n,t,e){let i=n;do{const r=i.prev,o=i.next.next;!nm(r,o)&&ay(r,i,i.next,o)&&Hd(r,o)&&Hd(o,r)&&(t.push(r.i/e),t.push(i.i/e),t.push(o.i/e),zd(i),zd(i.next),i=n=o),i=i.next}while(i!==n);return ul(i)}function $T(n,t,e,i,r,o){let s=n;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&tE(s,a)){let l=ly(s,a);return s=ul(s,s.next),l=ul(l,l.next),Gd(s,t,e,i,r,o),void Gd(l,t,e,i,r,o)}a=a.next}s=s.next}while(s!==n)}function JT(n,t){return n.x-t.x}function ZT(n,t){if(t=function(e,i){let r=i;const o=e.x,s=e.y;let a,l=-1/0;do{if(s<=r.y&&s>=r.next.y&&r.next.y!==r.y){const g=r.x+(s-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(g<=o&&g>l){if(l=g,g===o){if(s===r.y)return r;if(s===r.next.y)return r.next}a=r.x<r.next.x?r:r.next}}r=r.next}while(r!==i);if(!a)return null;if(o===l)return a;const u=a,h=a.x,d=a.y;let p,m=1/0;r=a;do o>=r.x&&r.x>=h&&o!==r.x&&Yh(s<d?o:l,s,h,d,s<d?l:o,s,r.x,r.y)&&(p=Math.abs(s-r.y)/(o-r.x),Hd(r,e)&&(p<m||p===m&&(r.x>a.x||r.x===a.x&&KT(a,r)))&&(a=r,m=p)),r=r.next;while(r!==u);return a}(n,t)){const e=ly(t,n);ul(t,t.next),ul(e,e.next)}}function KT(n,t){return gn(n.prev,n,t.prev)<0&&gn(t.next,n,n.next)<0}function Tv(n,t,e,i,r){return(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=32767*(n-e)*r)|n<<8))|n<<4))|n<<2))|n<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function QT(n){let t=n,e=n;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==n);return e}function Yh(n,t,e,i,r,o,s,a){return(r-s)*(t-a)-(n-s)*(o-a)>=0&&(n-s)*(i-a)-(e-s)*(t-a)>=0&&(e-s)*(o-a)-(r-s)*(i-a)>=0}function tE(n,t){return n.next.i!==t.i&&n.prev.i!==t.i&&!function(e,i){let r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==i.i&&r.next.i!==i.i&&ay(r,r.next,e,i))return!0;r=r.next}while(r!==e);return!1}(n,t)&&(Hd(n,t)&&Hd(t,n)&&function(e,i){let r=e,o=!1;const s=(e.x+i.x)/2,a=(e.y+i.y)/2;do r.y>a!=r.next.y>a&&r.next.y!==r.y&&s<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(o=!o),r=r.next;while(r!==e);return o}(n,t)&&(gn(n.prev,n,t.prev)||gn(n,t.prev,t))||nm(n,t)&&gn(n.prev,n,n.next)>0&&gn(t.prev,t,t.next)>0)}function gn(n,t,e){return(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y)}function nm(n,t){return n.x===t.x&&n.y===t.y}function ay(n,t,e,i){const r=om(gn(n,t,e)),o=om(gn(n,t,i)),s=om(gn(e,i,n)),a=om(gn(e,i,t));return r!==o&&s!==a||!(r!==0||!rm(n,e,t))||!(o!==0||!rm(n,i,t))||!(s!==0||!rm(e,n,i))||!(a!==0||!rm(e,t,i))}function rm(n,t,e){return t.x<=Math.max(n.x,e.x)&&t.x>=Math.min(n.x,e.x)&&t.y<=Math.max(n.y,e.y)&&t.y>=Math.min(n.y,e.y)}function om(n){return n>0?1:n<0?-1:0}function Hd(n,t){return gn(n.prev,n,n.next)<0?gn(n,t,n.next)>=0&&gn(n,n.prev,t)>=0:gn(n,t,n.prev)<0||gn(n,n.next,t)<0}function ly(n,t){const e=new Ev(n.i,n.x,n.y),i=new Ev(t.i,t.x,t.y),r=n.next,o=t.prev;return n.next=t,t.prev=n,e.next=r,r.prev=e,i.next=e,e.prev=i,o.next=i,i.prev=o,i}function uy(n,t,e,i){const r=new Ev(n,t,e);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function zd(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function Ev(n,t,e){this.i=n,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 Ms{static area(t){const e=t.length;let i=0;for(let r=e-1,o=0;o<e;r=o++)i+=t[r].x*t[o].y-t[o].x*t[r].y;return .5*i}static isClockWise(t){return Ms.area(t)<0}static triangulateShape(t,e){const i=[],r=[],o=[];hy(t),cy(i,t);let s=t.length;e.forEach(hy);for(let l=0;l<e.length;l++)r.push(s),s+=e[l].length,cy(i,e[l]);const a=WT(i,r);for(let l=0;l<a.length;l+=3)o.push(a.slice(l,l+3));return o}}function hy(n){const t=n.length;t>2&&n[t-1].equals(n[0])&&n.pop()}function cy(n,t){for(let e=0;e<t.length;e++)n.push(t[e].x),n.push(t[e].y)}class $o extends ze{constructor(t,e){super(),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];const i=this,r=[],o=[];for(let a=0,l=t.length;a<l;a++)s(t[a]);function s(a){const l=[],u=e.curveSegments!==void 0?e.curveSegments:12,h=e.steps!==void 0?e.steps:1;let d=e.depth!==void 0?e.depth:100,p=e.bevelEnabled===void 0||e.bevelEnabled,m=e.bevelThickness!==void 0?e.bevelThickness:6,g=e.bevelSize!==void 0?e.bevelSize:m-2,_=e.bevelOffset!==void 0?e.bevelOffset:0,y=e.bevelSegments!==void 0?e.bevelSegments:3;const w=e.extrudePath,A=e.UVGenerator!==void 0?e.UVGenerator:eE;e.amount!==void 0&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),d=e.amount);let I,F,N,U,B,G=!1;w&&(I=w.getSpacedPoints(h),G=!0,p=!1,F=w.computeFrenetFrames(h,!1),N=new S,U=new S,B=new S),p||(y=0,m=0,g=0,_=0);const ct=a.extractPoints(u);let it=ct.shape;const tt=ct.holes;if(!Ms.isClockWise(it)){it=it.reverse();for(let Vt=0,Q=tt.length;Vt<Q;Vt++){const gt=tt[Vt];Ms.isClockWise(gt)&&(tt[Vt]=gt.reverse())}}const rt=Ms.triangulateShape(it,tt),et=it;for(let Vt=0,Q=tt.length;Vt<Q;Vt++){const gt=tt[Vt];it=it.concat(gt)}function pt(Vt,Q,gt){return Q||console.error("THREE.ExtrudeGeometry: vec does not exist"),Q.clone().multiplyScalar(gt).add(Vt)}const kt=it.length,Lt=rt.length;function _t(Vt,Q,gt){let Dt,Ft,St;const Yt=Vt.x-Q.x,Me=Vt.y-Q.y,Re=gt.x-Vt.x,Ae=gt.y-Vt.y,si=Yt*Yt+Me*Me,Tn=Yt*Ae-Me*Re;if(Math.abs(Tn)>Number.EPSILON){const Ni=Math.sqrt(si),Yr=Math.sqrt(Re*Re+Ae*Ae),Rp=Q.x-Me/Ni,Cp=Q.y+Yt/Ni,Pp=((gt.x-Ae/Yr-Rp)*Ae-(gt.y+Re/Yr-Cp)*Re)/(Yt*Ae-Me*Re);Dt=Rp+Yt*Pp-Vt.x,Ft=Cp+Me*Pp-Vt.y;const Fr=Dt*Dt+Ft*Ft;if(Fr<=2)return new ce(Dt,Ft);St=Math.sqrt(Fr/2)}else{let Ni=!1;Yt>Number.EPSILON?Re>Number.EPSILON&&(Ni=!0):Yt<-Number.EPSILON?Re<-Number.EPSILON&&(Ni=!0):Math.sign(Me)===Math.sign(Ae)&&(Ni=!0),Ni?(Dt=-Me,Ft=Yt,St=Math.sqrt(si)):(Dt=Yt,Ft=Me,St=Math.sqrt(si/2))}return new ce(Dt/St,Ft/St)}const xt=[];for(let Vt=0,Q=et.length,gt=Q-1,Dt=Vt+1;Vt<Q;Vt++,gt++,Dt++)gt===Q&&(gt=0),Dt===Q&&(Dt=0),xt[Vt]=_t(et[Vt],et[gt],et[Dt]);const jt=[];let ee,le=xt.concat();for(let Vt=0,Q=tt.length;Vt<Q;Vt++){const gt=tt[Vt];ee=[];for(let Dt=0,Ft=gt.length,St=Ft-1,Yt=Dt+1;Dt<Ft;Dt++,St++,Yt++)St===Ft&&(St=0),Yt===Ft&&(Yt=0),ee[Dt]=_t(gt[Dt],gt[St],gt[Yt]);jt.push(ee),le=le.concat(ee)}for(let Vt=0;Vt<y;Vt++){const Q=Vt/y,gt=m*Math.cos(Q*Math.PI/2),Dt=g*Math.sin(Q*Math.PI/2)+_;for(let Ft=0,St=et.length;Ft<St;Ft++){const Yt=pt(et[Ft],xt[Ft],Dt);Xt(Yt.x,Yt.y,-gt)}for(let Ft=0,St=tt.length;Ft<St;Ft++){const Yt=tt[Ft];ee=jt[Ft];for(let Me=0,Re=Yt.length;Me<Re;Me++){const Ae=pt(Yt[Me],ee[Me],Dt);Xt(Ae.x,Ae.y,-gt)}}}const nt=g+_;for(let Vt=0;Vt<kt;Vt++){const Q=p?pt(it[Vt],le[Vt],nt):it[Vt];G?(U.copy(F.normals[0]).multiplyScalar(Q.x),N.copy(F.binormals[0]).multiplyScalar(Q.y),B.copy(I[0]).add(U).add(N),Xt(B.x,B.y,B.z)):Xt(Q.x,Q.y,0)}for(let Vt=1;Vt<=h;Vt++)for(let Q=0;Q<kt;Q++){const gt=p?pt(it[Q],le[Q],nt):it[Q];G?(U.copy(F.normals[Vt]).multiplyScalar(gt.x),N.copy(F.binormals[Vt]).multiplyScalar(gt.y),B.copy(I[Vt]).add(U).add(N),Xt(B.x,B.y,B.z)):Xt(gt.x,gt.y,d/h*Vt)}for(let Vt=y-1;Vt>=0;Vt--){const Q=Vt/y,gt=m*Math.cos(Q*Math.PI/2),Dt=g*Math.sin(Q*Math.PI/2)+_;for(let Ft=0,St=et.length;Ft<St;Ft++){const Yt=pt(et[Ft],xt[Ft],Dt);Xt(Yt.x,Yt.y,d+gt)}for(let Ft=0,St=tt.length;Ft<St;Ft++){const Yt=tt[Ft];ee=jt[Ft];for(let Me=0,Re=Yt.length;Me<Re;Me++){const Ae=pt(Yt[Me],ee[Me],Dt);G?Xt(Ae.x,Ae.y+I[h-1].y,I[h-1].x+gt):Xt(Ae.x,Ae.y,d+gt)}}}function lt(Vt,Q){let gt=Vt.length;for(;--gt>=0;){const Dt=gt;let Ft=gt-1;Ft<0&&(Ft=Vt.length-1);for(let St=0,Yt=h+2*y;St<Yt;St++){const Me=kt*St,Re=kt*(St+1);Bt(Q+Dt+Me,Q+Ft+Me,Q+Ft+Re,Q+Dt+Re)}}}function Xt(Vt,Q,gt){l.push(Vt),l.push(Q),l.push(gt)}function Ut(Vt,Q,gt){ue(Vt),ue(Q),ue(gt);const Dt=r.length/3,Ft=A.generateTopUV(i,r,Dt-3,Dt-2,Dt-1);he(Ft[0]),he(Ft[1]),he(Ft[2])}function Bt(Vt,Q,gt,Dt){ue(Vt),ue(Q),ue(Dt),ue(Q),ue(gt),ue(Dt);const Ft=r.length/3,St=A.generateSideWallUV(i,r,Ft-6,Ft-3,Ft-2,Ft-1);he(St[0]),he(St[1]),he(St[3]),he(St[1]),he(St[2]),he(St[3])}function ue(Vt){r.push(l[3*Vt+0]),r.push(l[3*Vt+1]),r.push(l[3*Vt+2])}function he(Vt){o.push(Vt.x),o.push(Vt.y)}(function(){const Vt=r.length/3;if(p){let Q=0,gt=kt*Q;for(let Dt=0;Dt<Lt;Dt++){const Ft=rt[Dt];Ut(Ft[2]+gt,Ft[1]+gt,Ft[0]+gt)}Q=h+2*y,gt=kt*Q;for(let Dt=0;Dt<Lt;Dt++){const Ft=rt[Dt];Ut(Ft[0]+gt,Ft[1]+gt,Ft[2]+gt)}}else{for(let Q=0;Q<Lt;Q++){const gt=rt[Q];Ut(gt[2],gt[1],gt[0])}for(let Q=0;Q<Lt;Q++){const gt=rt[Q];Ut(gt[0]+kt*h,gt[1]+kt*h,gt[2]+kt*h)}}i.addGroup(Vt,r.length/3-Vt,0)})(),function(){const Vt=r.length/3;let Q=0;lt(et,Q),Q+=et.length;for(let gt=0,Dt=tt.length;gt<Dt;gt++){const Ft=tt[gt];lt(Ft,Q),Q+=Ft.length}i.addGroup(Vt,r.length/3-Vt,1)}()}this.setAttribute("position",new _e(r,3)),this.setAttribute("uv",new _e(o,2)),this.computeVertexNormals()}toJSON(){const t=super.toJSON();return function(e,i,r){if(r.shapes=[],Array.isArray(e))for(let o=0,s=e.length;o<s;o++){const a=e[o];r.shapes.push(a.uuid)}else r.shapes.push(e.uuid);return i.extrudePath!==void 0&&(r.options.extrudePath=i.extrudePath.toJSON()),r}(this.parameters.shapes,this.parameters.options,t)}static fromJSON(t,e){const i=[];for(let o=0,s=t.shapes.length;o<s;o++){const a=e[t.shapes[o]];i.push(a)}const r=t.options.extrudePath;return r!==void 0&&(t.options.extrudePath=new Sv[r.type]().fromJSON(r)),new $o(i,t.options)}}const eE={generateTopUV:function(n,t,e,i,r){const o=t[3*e],s=t[3*e+1],a=t[3*i],l=t[3*i+1],u=t[3*r],h=t[3*r+1];return[new ce(o,s),new ce(a,l),new ce(u,h)]},generateSideWallUV:function(n,t,e,i,r,o){const s=t[3*e],a=t[3*e+1],l=t[3*e+2],u=t[3*i],h=t[3*i+1],d=t[3*i+2],p=t[3*r],m=t[3*r+1],g=t[3*r+2],_=t[3*o],y=t[3*o+1],w=t[3*o+2];return Math.abs(a-h)<Math.abs(s-u)?[new ce(s,1-l),new ce(u,1-d),new ce(p,1-g),new ce(_,1-w)]:[new ce(a,1-l),new ce(h,1-d),new ce(m,1-g),new ce(y,1-w)]}};class $h extends Ue{constructor(t=1,e=0){const i=(1+Math.sqrt(5))/2;super([-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],t,e),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new $h(t.radius,t.detail)}}class Jh extends ze{constructor(t,e=12,i=0,r=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:i,phiLength:r},e=Math.floor(e),r=zn(r,0,2*Math.PI);const o=[],s=[],a=[],l=1/e,u=new S,h=new ce;for(let d=0;d<=e;d++){const p=i+d*l*r,m=Math.sin(p),g=Math.cos(p);for(let _=0;_<=t.length-1;_++)u.x=t[_].x*m,u.y=t[_].y,u.z=t[_].x*g,s.push(u.x,u.y,u.z),h.x=d/e,h.y=_/(t.length-1),a.push(h.x,h.y)}for(let d=0;d<e;d++)for(let p=0;p<t.length-1;p++){const m=p+d*t.length,g=m,_=m+t.length,y=m+t.length+1,w=m+1;o.push(g,_,w),o.push(_,y,w)}if(this.setIndex(o),this.setAttribute("position",new _e(s,3)),this.setAttribute("uv",new _e(a,2)),this.computeVertexNormals(),r===2*Math.PI){const d=this.attributes.normal.array,p=new S,m=new S,g=new S,_=e*t.length*3;for(let y=0,w=0;y<t.length;y++,w+=3)p.x=d[w+0],p.y=d[w+1],p.z=d[w+2],m.x=d[_+w+0],m.y=d[_+w+1],m.z=d[_+w+2],g.addVectors(p,m).normalize(),d[w+0]=d[_+w+0]=g.x,d[w+1]=d[_+w+1]=g.y,d[w+2]=d[_+w+2]=g.z}}static fromJSON(t){return new Jh(t.points,t.segments,t.phiStart,t.phiLength)}}class uu extends Ue{constructor(t=1,e=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new uu(t.radius,t.detail)}}class jd extends ze{constructor(t,e,i){super(),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:i};const r=[],o=[],s=[],a=[],l=1e-5,u=new S,h=new S,d=new S,p=new S,m=new S;t.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");const g=e+1;for(let _=0;_<=i;_++){const y=_/i;for(let w=0;w<=e;w++){const A=w/e;t(A,y,h),o.push(h.x,h.y,h.z),A-l>=0?(t(A-l,y,d),p.subVectors(h,d)):(t(A+l,y,d),p.subVectors(d,h)),y-l>=0?(t(A,y-l,d),m.subVectors(h,d)):(t(A,y+l,d),m.subVectors(d,h)),u.crossVectors(p,m).normalize(),s.push(u.x,u.y,u.z),a.push(A,y)}}for(let _=0;_<i;_++)for(let y=0;y<e;y++){const w=_*g+y,A=_*g+y+1,I=(_+1)*g+y+1,F=(_+1)*g+y;r.push(w,A,F),r.push(A,I,F)}this.setIndex(r),this.setAttribute("position",new _e(o,3)),this.setAttribute("normal",new _e(s,3)),this.setAttribute("uv",new _e(a,2))}}class Zh extends ze{constructor(t=.5,e=1,i=8,r=1,o=0,s=2*Math.PI){super(),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:i,phiSegments:r,thetaStart:o,thetaLength:s},i=Math.max(3,i);const a=[],l=[],u=[],h=[];let d=t;const p=(e-t)/(r=Math.max(1,r)),m=new S,g=new ce;for(let _=0;_<=r;_++){for(let y=0;y<=i;y++){const w=o+y/i*s;m.x=d*Math.cos(w),m.y=d*Math.sin(w),l.push(m.x,m.y,m.z),u.push(0,0,1),g.x=(m.x/e+1)/2,g.y=(m.y/e+1)/2,h.push(g.x,g.y)}d+=p}for(let _=0;_<r;_++){const y=_*(i+1);for(let w=0;w<i;w++){const A=w+y,I=A,F=A+i+1,N=A+i+2,U=A+1;a.push(I,F,U),a.push(F,N,U)}}this.setIndex(a),this.setAttribute("position",new _e(l,3)),this.setAttribute("normal",new _e(u,3)),this.setAttribute("uv",new _e(h,2))}static fromJSON(t){return new Zh(t.innerRadius,t.outerRadius,t.thetaSegments,t.phiSegments,t.thetaStart,t.thetaLength)}}class hu extends ze{constructor(t,e=12){super(),this.type="ShapeGeometry",this.parameters={shapes:t,curveSegments:e};const i=[],r=[],o=[],s=[];let a=0,l=0;if(Array.isArray(t)===!1)u(t);else for(let h=0;h<t.length;h++)u(t[h]),this.addGroup(a,l,h),a+=l,l=0;function u(h){const d=r.length/3,p=h.extractPoints(e);let m=p.shape;const g=p.holes;Ms.isClockWise(m)===!1&&(m=m.reverse());for(let y=0,w=g.length;y<w;y++){const A=g[y];Ms.isClockWise(A)===!0&&(g[y]=A.reverse())}const _=Ms.triangulateShape(m,g);for(let y=0,w=g.length;y<w;y++){const A=g[y];m=m.concat(A)}for(let y=0,w=m.length;y<w;y++){const A=m[y];r.push(A.x,A.y,0),o.push(0,0,1),s.push(A.x,A.y)}for(let y=0,w=_.length;y<w;y++){const A=_[y],I=A[0]+d,F=A[1]+d,N=A[2]+d;i.push(I,F,N),l+=3}}this.setIndex(i),this.setAttribute("position",new _e(r,3)),this.setAttribute("normal",new _e(o,3)),this.setAttribute("uv",new _e(s,2))}toJSON(){const t=super.toJSON();return function(e,i){if(i.shapes=[],Array.isArray(e))for(let r=0,o=e.length;r<o;r++){const s=e[r];i.shapes.push(s.uuid)}else i.shapes.push(e.uuid);return i}(this.parameters.shapes,t)}static fromJSON(t,e){const i=[];for(let r=0,o=t.shapes.length;r<o;r++){const s=e[t.shapes[r]];i.push(s)}return new hu(i,t.curveSegments)}}class cu extends ze{constructor(t=1,e=8,i=6,r=0,o=2*Math.PI,s=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:i,phiStart:r,phiLength:o,thetaStart:s,thetaLength:a},e=Math.max(3,Math.floor(e)),i=Math.max(2,Math.floor(i));const l=Math.min(s+a,Math.PI);let u=0;const h=[],d=new S,p=new S,m=[],g=[],_=[],y=[];for(let w=0;w<=i;w++){const A=[],I=w/i;let F=0;w==0&&s==0?F=.5/e:w==i&&l==Math.PI&&(F=-.5/e);for(let N=0;N<=e;N++){const U=N/e;d.x=-t*Math.cos(r+U*o)*Math.sin(s+I*a),d.y=t*Math.cos(s+I*a),d.z=t*Math.sin(r+U*o)*Math.sin(s+I*a),g.push(d.x,d.y,d.z),p.copy(d).normalize(),_.push(p.x,p.y,p.z),y.push(U+F,1-I),A.push(u++)}h.push(A)}for(let w=0;w<i;w++)for(let A=0;A<e;A++){const I=h[w][A+1],F=h[w][A],N=h[w+1][A],U=h[w+1][A+1];(w!==0||s>0)&&m.push(I,F,U),(w!==i-1||l<Math.PI)&&m.push(F,N,U)}this.setIndex(m),this.setAttribute("position",new _e(g,3)),this.setAttribute("normal",new _e(_,3)),this.setAttribute("uv",new _e(y,2))}static fromJSON(t){return new cu(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}class Kh extends Ue{constructor(t=1,e=0){super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new Kh(t.radius,t.detail)}}class sm extends $o{constructor(t,e={}){const i=e.font;if(!i||!i.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new ze;const r=i.generateShapes(t,e.size);e.depth=e.height!==void 0?e.height:50,e.bevelThickness===void 0&&(e.bevelThickness=10),e.bevelSize===void 0&&(e.bevelSize=8),e.bevelEnabled===void 0&&(e.bevelEnabled=!1),super(r,e),this.type="TextGeometry"}}class Qh extends ze{constructor(t=1,e=.4,i=8,r=6,o=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:i,tubularSegments:r,arc:o},i=Math.floor(i),r=Math.floor(r);const s=[],a=[],l=[],u=[],h=new S,d=new S,p=new S;for(let m=0;m<=i;m++)for(let g=0;g<=r;g++){const _=g/r*o,y=m/i*Math.PI*2;d.x=(t+e*Math.cos(y))*Math.cos(_),d.y=(t+e*Math.cos(y))*Math.sin(_),d.z=e*Math.sin(y),a.push(d.x,d.y,d.z),h.x=t*Math.cos(_),h.y=t*Math.sin(_),p.subVectors(d,h).normalize(),l.push(p.x,p.y,p.z),u.push(g/r),u.push(m/i)}for(let m=1;m<=i;m++)for(let g=1;g<=r;g++){const _=(r+1)*m+g-1,y=(r+1)*(m-1)+g-1,w=(r+1)*(m-1)+g,A=(r+1)*m+g;s.push(_,y,A),s.push(y,w,A)}this.setIndex(s),this.setAttribute("position",new _e(a,3)),this.setAttribute("normal",new _e(l,3)),this.setAttribute("uv",new _e(u,2))}static fromJSON(t){return new Qh(t.radius,t.tube,t.radialSegments,t.tubularSegments,t.arc)}}class tc extends ze{constructor(t=1,e=.4,i=64,r=8,o=2,s=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:i,radialSegments:r,p:o,q:s},i=Math.floor(i),r=Math.floor(r);const a=[],l=[],u=[],h=[],d=new S,p=new S,m=new S,g=new S,_=new S,y=new S,w=new S;for(let I=0;I<=i;++I){const F=I/i*o*Math.PI*2;A(F,o,s,t,m),A(F+.01,o,s,t,g),y.subVectors(g,m),w.addVectors(g,m),_.crossVectors(y,w),w.crossVectors(_,y),_.normalize(),w.normalize();for(let N=0;N<=r;++N){const U=N/r*Math.PI*2,B=-e*Math.cos(U),G=e*Math.sin(U);d.x=m.x+(B*w.x+G*_.x),d.y=m.y+(B*w.y+G*_.y),d.z=m.z+(B*w.z+G*_.z),l.push(d.x,d.y,d.z),p.subVectors(d,m).normalize(),u.push(p.x,p.y,p.z),h.push(I/i),h.push(N/r)}}for(let I=1;I<=i;I++)for(let F=1;F<=r;F++){const N=(r+1)*(I-1)+(F-1),U=(r+1)*I+(F-1),B=(r+1)*I+F,G=(r+1)*(I-1)+F;a.push(N,U,G),a.push(U,B,G)}function A(I,F,N,U,B){const G=Math.cos(I),ct=Math.sin(I),it=N/F*I,tt=Math.cos(it);B.x=U*(2+tt)*.5*G,B.y=U*(2+tt)*ct*.5,B.z=U*Math.sin(it)*.5}this.setIndex(a),this.setAttribute("position",new _e(l,3)),this.setAttribute("normal",new _e(u,3)),this.setAttribute("uv",new _e(h,2))}static fromJSON(t){return new tc(t.radius,t.tube,t.tubularSegments,t.radialSegments,t.p,t.q)}}class ec extends ze{constructor(t,e=64,i=1,r=8,o=!1){super(),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:i,radialSegments:r,closed:o};const s=t.computeFrenetFrames(e,o);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals;const a=new S,l=new S,u=new ce;let h=new S;const d=[],p=[],m=[],g=[];function _(y){h=t.getPointAt(y/e,h);const w=s.normals[y],A=s.binormals[y];for(let I=0;I<=r;I++){const F=I/r*Math.PI*2,N=Math.sin(F),U=-Math.cos(F);l.x=U*w.x+N*A.x,l.y=U*w.y+N*A.y,l.z=U*w.z+N*A.z,l.normalize(),p.push(l.x,l.y,l.z),a.x=h.x+i*l.x,a.y=h.y+i*l.y,a.z=h.z+i*l.z,d.push(a.x,a.y,a.z)}}(function(){for(let y=0;y<e;y++)_(y);_(o===!1?e:0),function(){for(let y=0;y<=e;y++)for(let w=0;w<=r;w++)u.x=y/e,u.y=w/r,m.push(u.x,u.y)}(),function(){for(let y=1;y<=e;y++)for(let w=1;w<=r;w++){const A=(r+1)*(y-1)+(w-1),I=(r+1)*y+(w-1),F=(r+1)*y+w,N=(r+1)*(y-1)+w;g.push(A,I,N),g.push(I,F,N)}}()})(),this.setIndex(g),this.setAttribute("position",new _e(d,3)),this.setAttribute("normal",new _e(p,3)),this.setAttribute("uv",new _e(m,2))}toJSON(){const t=super.toJSON();return t.path=this.parameters.path.toJSON(),t}static fromJSON(t){return new ec(new Sv[t.path.type]().fromJSON(t.path),t.tubularSegments,t.radius,t.radialSegments,t.closed)}}class Mv extends ze{constructor(t){if(super(),this.type="WireframeGeometry",t.isGeometry===!0)return void console.error("THREE.WireframeGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");const e=[],i=[0,0],r={},o=new S;if(t.index!==null){const s=t.attributes.position,a=t.index;let l=t.groups;l.length===0&&(l=[{start:0,count:a.count,materialIndex:0}]);for(let u=0,h=l.length;u<h;++u){const d=l[u],p=d.start;for(let m=p,g=p+d.count;m<g;m+=3)for(let _=0;_<3;_++){const y=a.getX(m+_),w=a.getX(m+(_+1)%3);i[0]=Math.min(y,w),i[1]=Math.max(y,w);const A=i[0]+","+i[1];r[A]===void 0&&(r[A]={index1:i[0],index2:i[1]})}}for(const u in r){const h=r[u];o.fromBufferAttribute(s,h.index1),e.push(o.x,o.y,o.z),o.fromBufferAttribute(s,h.index2),e.push(o.x,o.y,o.z)}}else{const s=t.attributes.position;for(let a=0,l=s.count/3;a<l;a++)for(let u=0;u<3;u++){const h=3*a+u;o.fromBufferAttribute(s,h),e.push(o.x,o.y,o.z);const d=3*a+(u+1)%3;o.fromBufferAttribute(s,d),e.push(o.x,o.y,o.z)}}this.setAttribute("position",new _e(e,3))}}var dy=Object.freeze({__proto__:null,BoxGeometry:wo,BoxBufferGeometry:wo,CircleGeometry:pe,CircleBufferGeometry:pe,ConeGeometry:Ce,ConeBufferGeometry:Ce,CylinderGeometry:He,CylinderBufferGeometry:He,DodecahedronGeometry:Ye,DodecahedronBufferGeometry:Ye,EdgesGeometry:Vn,ExtrudeGeometry:$o,ExtrudeBufferGeometry:$o,IcosahedronGeometry:$h,IcosahedronBufferGeometry:$h,LatheGeometry:Jh,LatheBufferGeometry:Jh,OctahedronGeometry:uu,OctahedronBufferGeometry:uu,ParametricGeometry:jd,ParametricBufferGeometry:jd,PlaneGeometry:Kn,PlaneBufferGeometry:Kn,PolyhedronGeometry:Ue,PolyhedronBufferGeometry:Ue,RingGeometry:Zh,RingBufferGeometry:Zh,ShapeGeometry:hu,ShapeBufferGeometry:hu,SphereGeometry:cu,SphereBufferGeometry:cu,TetrahedronGeometry:Kh,TetrahedronBufferGeometry:Kh,TextGeometry:sm,TextBufferGeometry:sm,TorusGeometry:Qh,TorusBufferGeometry:Qh,TorusKnotGeometry:tc,TorusKnotBufferGeometry:tc,TubeGeometry:ec,TubeBufferGeometry:ec,WireframeGeometry:Mv});class Av extends Dn{constructor(t){super(),this.type="ShadowMaterial",this.color=new Le(0),this.transparent=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this}}Av.prototype.isShadowMaterial=!0;class ic extends rr{constructor(t){super(t),this.type="RawShaderMaterial"}}ic.prototype.isRawShaderMaterial=!0;class am extends Dn{constructor(t){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Le(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 Le(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Br,this.normalScale=new ce(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}}am.prototype.isMeshStandardMaterial=!0;class Rv extends am{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 ce(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=zn(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 Le(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 Le).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}}Rv.prototype.isMeshPhysicalMaterial=!0;class lm extends Dn{constructor(t){super(),this.type="MeshPhongMaterial",this.color=new Le(16777215),this.specular=new Le(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Le(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Br,this.normalScale=new ce(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Hs,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}}lm.prototype.isMeshPhongMaterial=!0;class Cv extends Dn{constructor(t){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Le(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Le(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Br,this.normalScale=new ce(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}}Cv.prototype.isMeshToonMaterial=!0;class Pv extends Dn{constructor(t){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Br,this.normalScale=new ce(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}}Pv.prototype.isMeshNormalMaterial=!0;class um extends Dn{constructor(t){super(),this.type="MeshLambertMaterial",this.color=new Le(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Le(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Hs,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}}um.prototype.isMeshLambertMaterial=!0;class Iv extends Dn{constructor(t){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Le(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Br,this.normalScale=new ce(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}}Iv.prototype.isMeshMatcapMaterial=!0;class Lv extends Bn{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}}Lv.prototype.isLineDashedMaterial=!0;var iE=Object.freeze({__proto__:null,ShadowMaterial:Av,SpriteMaterial:iu,RawShaderMaterial:ic,ShaderMaterial:rr,PointsMaterial:$,MeshPhysicalMaterial:Rv,MeshStandardMaterial:am,MeshPhongMaterial:lm,MeshToonMaterial:Cv,MeshNormalMaterial:Pv,MeshLambertMaterial:um,MeshDepthMaterial:xi,MeshDistanceMaterial:Dh,MeshBasicMaterial:pn,MeshMatcapMaterial:Iv,LineDashedMaterial:Lv,LineBasicMaterial:Bn,Material:Dn});const sn={arraySlice:function(n,t,e){return sn.isTypedArray(n)?new n.constructor(n.subarray(t,e!==void 0?e:n.length)):n.slice(t,e)},convertArray:function(n,t,e){return!n||!e&&n.constructor===t?n:typeof t.BYTES_PER_ELEMENT=="number"?new t(n):Array.prototype.slice.call(n)},isTypedArray:function(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)},getKeyframeOrder:function(n){const t=n.length,e=new Array(t);for(let i=0;i!==t;++i)e[i]=i;return e.sort(function(i,r){return n[i]-n[r]}),e},sortedArray:function(n,t,e){const i=n.length,r=new n.constructor(i);for(let o=0,s=0;s!==i;++o){const a=e[o]*t;for(let l=0;l!==t;++l)r[s++]=n[a+l]}return r},flattenJSON:function(n,t,e,i){let r=1,o=n[0];for(;o!==void 0&&o[i]===void 0;)o=n[r++];if(o===void 0)return;let s=o[i];if(s!==void 0)if(Array.isArray(s))do s=o[i],s!==void 0&&(t.push(o.time),e.push.apply(e,s)),o=n[r++];while(o!==void 0);else if(s.toArray!==void 0)do s=o[i],s!==void 0&&(t.push(o.time),s.toArray(e,e.length)),o=n[r++];while(o!==void 0);else do s=o[i],s!==void 0&&(t.push(o.time),e.push(s)),o=n[r++];while(o!==void 0)},subclip:function(n,t,e,i,r=30){const o=n.clone();o.name=t;const s=[];for(let l=0;l<o.tracks.length;++l){const u=o.tracks[l],h=u.getValueSize(),d=[],p=[];for(let m=0;m<u.times.length;++m){const g=u.times[m]*r;if(!(g<e||g>=i)){d.push(u.times[m]);for(let _=0;_<h;++_)p.push(u.values[m*h+_])}}d.length!==0&&(u.times=sn.convertArray(d,u.times.constructor),u.values=sn.convertArray(p,u.values.constructor),s.push(u))}o.tracks=s;let a=1/0;for(let l=0;l<o.tracks.length;++l)a>o.tracks[l].times[0]&&(a=o.tracks[l].times[0]);for(let l=0;l<o.tracks.length;++l)o.tracks[l].shift(-1*a);return o.resetDuration(),o},makeClipAdditive:function(n,t=0,e=n,i=30){i<=0&&(i=30);const r=e.tracks.length,o=t/i;for(let s=0;s<r;++s){const a=e.tracks[s],l=a.ValueTypeName;if(l==="bool"||l==="string")continue;const u=n.tracks.find(function(w){return w.name===a.name&&w.ValueTypeName===l});if(u===void 0)continue;let h=0;const d=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(h=d/3);let p=0;const m=u.getValueSize();u.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(p=m/3);const g=a.times.length-1;let _;if(o<=a.times[0]){const w=h,A=d-h;_=sn.arraySlice(a.values,w,A)}else if(o>=a.times[g]){const w=g*d+h,A=w+d-h;_=sn.arraySlice(a.values,w,A)}else{const w=a.createInterpolant(),A=h,I=d-h;w.evaluate(o),_=sn.arraySlice(w.resultBuffer,A,I)}l==="quaternion"&&new Nn().fromArray(_).normalize().conjugate().toArray(_);const y=u.times.length;for(let w=0;w<y;++w){const A=w*m+p;if(l==="quaternion")Nn.multiplyQuaternionsFlat(u.values,A,_,0,u.values,A);else{const I=m-2*p;for(let F=0;F<I;++F)u.values[A+F]-=_[F]}}}return n.blendMode=It,n}};class ba{constructor(t,e,i,r){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new e.constructor(i),this.sampleValues=e,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(t){const e=this.parameterPositions;let i=this._cachedIndex,r=e[i],o=e[i-1];t:{e:{let s;i:{n:if(!(t<r)){for(let a=i+2;;){if(r===void 0){if(t<o)break n;return i=e.length,this._cachedIndex=i,this.afterEnd_(i-1,t,o)}if(i===a)break;if(o=r,r=e[++i],t<r)break e}s=e.length;break i}if(t>=o)break t;{const a=e[1];t<a&&(i=2,o=a);for(let l=i-2;;){if(o===void 0)return this._cachedIndex=0,this.beforeStart_(0,t,r);if(i===l)break;if(r=o,o=e[--i-1],t>=o)break e}s=i,i=0}}for(;i<s;){const a=i+s>>>1;t<e[a]?s=a:i=a+1}if(r=e[i],o=e[i-1],o===void 0)return this._cachedIndex=0,this.beforeStart_(0,t,r);if(r===void 0)return i=e.length,this._cachedIndex=i,this.afterEnd_(i-1,o,t)}this._cachedIndex=i,this.intervalChanged_(i,o,r)}return this.interpolate_(i,o,t,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){const e=this.resultBuffer,i=this.sampleValues,r=this.valueSize,o=t*r;for(let s=0;s!==r;++s)e[s]=i[o+s];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}ba.prototype.beforeStart_=ba.prototype.copySampleValue_,ba.prototype.afterEnd_=ba.prototype.copySampleValue_;class py extends ba{constructor(t,e,i,r){super(t,e,i,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Gn,endingEnd:Gn}}intervalChanged_(t,e,i){const r=this.parameterPositions;let o=t-2,s=t+1,a=r[o],l=r[s];if(a===void 0)switch(this.getSettings_().endingStart){case hs:o=t,a=2*e-i;break;case Ol:o=r.length-2,a=e+r[o]-r[o+1];break;default:o=t,a=i}if(l===void 0)switch(this.getSettings_().endingEnd){case hs:s=t,l=2*i-e;break;case Ol:s=1,l=i+r[1]-r[0];break;default:s=t-1,l=e}const u=.5*(i-e),h=this.valueSize;this._weightPrev=u/(e-a),this._weightNext=u/(l-i),this._offsetPrev=o*h,this._offsetNext=s*h}interpolate_(t,e,i,r){const o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,l=t*a,u=l-a,h=this._offsetPrev,d=this._offsetNext,p=this._weightPrev,m=this._weightNext,g=(i-e)/(r-e),_=g*g,y=_*g,w=-p*y+2*p*_-p*g,A=(1+p)*y+(-1.5-2*p)*_+(-.5+p)*g+1,I=(-1-m)*y+(1.5+m)*_+.5*g,F=m*y-m*_;for(let N=0;N!==a;++N)o[N]=w*s[h+N]+A*s[u+N]+I*s[l+N]+F*s[d+N];return o}}class Ov extends ba{constructor(t,e,i,r){super(t,e,i,r)}interpolate_(t,e,i,r){const o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,l=t*a,u=l-a,h=(i-e)/(r-e),d=1-h;for(let p=0;p!==a;++p)o[p]=s[u+p]*d+s[l+p]*h;return o}}class fy extends ba{constructor(t,e,i,r){super(t,e,i,r)}interpolate_(t){return this.copySampleValue_(t-1)}}class Jo{constructor(t,e,i,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=sn.convertArray(e,this.TimeBufferType),this.values=sn.convertArray(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(t){const e=t.constructor;let i;if(e.toJSON!==this.toJSON)i=e.toJSON(t);else{i={name:t.name,times:sn.convertArray(t.times,Array),values:sn.convertArray(t.values,Array)};const r=t.getInterpolation();r!==t.DefaultInterpolation&&(i.interpolation=r)}return i.type=t.ValueTypeName,i}InterpolantFactoryMethodDiscrete(t){return new fy(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new Ov(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new py(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case us:e=this.InterpolantFactoryMethodDiscrete;break;case Ll:e=this.InterpolantFactoryMethodLinear;break;case Bo:e=this.InterpolantFactoryMethodSmooth}if(e===void 0){const i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0){if(t===this.DefaultInterpolation)throw new Error(i);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",i),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return us;case this.InterpolantFactoryMethodLinear:return Ll;case this.InterpolantFactoryMethodSmooth:return Bo}}getValueSize(){return this.values.length/this.times.length}shift(t){if(t!==0){const e=this.times;for(let i=0,r=e.length;i!==r;++i)e[i]+=t}return this}scale(t){if(t!==1){const e=this.times;for(let i=0,r=e.length;i!==r;++i)e[i]*=t}return this}trim(t,e){const i=this.times,r=i.length;let o=0,s=r-1;for(;o!==r&&i[o]<t;)++o;for(;s!==-1&&i[s]>e;)--s;if(++s,o!==0||s!==r){o>=s&&(s=Math.max(s,1),o=s-1);const a=this.getValueSize();this.times=sn.arraySlice(i,o,s),this.values=sn.arraySlice(this.values,o*a,s*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 i=this.times,r=this.values,o=i.length;o===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let s=null;for(let a=0;a!==o;a++){const l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),t=!1;break}if(s!==null&&s>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,s),t=!1;break}s=l}if(r!==void 0&&sn.isTypedArray(r))for(let a=0,l=r.length;a!==l;++a){const u=r[a];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,u),t=!1;break}}return t}optimize(){const t=sn.arraySlice(this.times),e=sn.arraySlice(this.values),i=this.getValueSize(),r=this.getInterpolation()===Bo,o=t.length-1;let s=1;for(let a=1;a<o;++a){let l=!1;const u=t[a];if(u!==t[a+1]&&(a!==1||u!==t[0]))if(r)l=!0;else{const h=a*i,d=h-i,p=h+i;for(let m=0;m!==i;++m){const g=e[h+m];if(g!==e[d+m]||g!==e[p+m]){l=!0;break}}}if(l){if(a!==s){t[s]=t[a];const h=a*i,d=s*i;for(let p=0;p!==i;++p)e[d+p]=e[h+p]}++s}}if(o>0){t[s]=t[o];for(let a=o*i,l=s*i,u=0;u!==i;++u)e[l+u]=e[a+u];++s}return s!==t.length?(this.times=sn.arraySlice(t,0,s),this.values=sn.arraySlice(e,0,s*i)):(this.times=t,this.values=e),this}clone(){const t=sn.arraySlice(this.times,0),e=sn.arraySlice(this.values,0),i=new this.constructor(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}}Jo.prototype.TimeBufferType=Float32Array,Jo.prototype.ValueBufferType=Float32Array,Jo.prototype.DefaultInterpolation=Ll;class du extends Jo{}du.prototype.ValueTypeName="bool",du.prototype.ValueBufferType=Array,du.prototype.DefaultInterpolation=us,du.prototype.InterpolantFactoryMethodLinear=void 0,du.prototype.InterpolantFactoryMethodSmooth=void 0;class Nv extends Jo{}Nv.prototype.ValueTypeName="color";class Vd extends Jo{}Vd.prototype.ValueTypeName="number";class my extends ba{constructor(t,e,i,r){super(t,e,i,r)}interpolate_(t,e,i,r){const o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,l=(i-e)/(r-e);let u=t*a;for(let h=u+a;u!==h;u+=4)Nn.slerpFlat(o,0,s,u-a,s,u,l);return o}}class nc extends Jo{InterpolantFactoryMethodLinear(t){return new my(this.times,this.values,this.getValueSize(),t)}}nc.prototype.ValueTypeName="quaternion",nc.prototype.DefaultInterpolation=Ll,nc.prototype.InterpolantFactoryMethodSmooth=void 0;class pu extends Jo{}pu.prototype.ValueTypeName="string",pu.prototype.ValueBufferType=Array,pu.prototype.DefaultInterpolation=us,pu.prototype.InterpolantFactoryMethodLinear=void 0,pu.prototype.InterpolantFactoryMethodSmooth=void 0;class Wd extends Jo{}Wd.prototype.ValueTypeName="vector";class Xd{constructor(t,e=-1,i,r=$s){this.name=t,this.tracks=i,this.duration=e,this.blendMode=r,this.uuid=Ar(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],i=t.tracks,r=1/(t.fps||1);for(let s=0,a=i.length;s!==a;++s)e.push(nE(i[s]).scale(r));const o=new this(t.name,t.duration,e,t.blendMode);return o.uuid=t.uuid,o}static toJSON(t){const e=[],i=t.tracks,r={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let o=0,s=i.length;o!==s;++o)e.push(Jo.toJSON(i[o]));return r}static CreateFromMorphTargetSequence(t,e,i,r){const o=e.length,s=[];for(let a=0;a<o;a++){let l=[],u=[];l.push((a+o-1)%o,a,(a+1)%o),u.push(0,1,0);const h=sn.getKeyframeOrder(l);l=sn.sortedArray(l,1,h),u=sn.sortedArray(u,1,h),r||l[0]!==0||(l.push(o),u.push(u[0])),s.push(new Vd(".morphTargetInfluences["+e[a].name+"]",l,u).scale(1/i))}return new this(t,-1,s)}static findByName(t,e){let i=t;if(!Array.isArray(t)){const r=t;i=r.geometry&&r.geometry.animations||r.animations}for(let r=0;r<i.length;r++)if(i[r].name===e)return i[r];return null}static CreateClipsFromMorphTargetSequences(t,e,i){const r={},o=/^([\w-]*?)([\d]+)$/;for(let a=0,l=t.length;a<l;a++){const u=t[a],h=u.name.match(o);if(h&&h.length>1){const d=h[1];let p=r[d];p||(r[d]=p=[]),p.push(u)}}const s=[];for(const a in r)s.push(this.CreateFromMorphTargetSequence(a,r[a],e,i));return s}static parseAnimation(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(h,d,p,m,g){if(p.length!==0){const _=[],y=[];sn.flattenJSON(p,_,y,m),_.length!==0&&g.push(new h(d,_,y))}},r=[],o=t.name||"default",s=t.fps||30,a=t.blendMode;let l=t.length||-1;const u=t.hierarchy||[];for(let h=0;h<u.length;h++){const d=u[h].keys;if(d&&d.length!==0)if(d[0].morphTargets){const p={};let m;for(m=0;m<d.length;m++)if(d[m].morphTargets)for(let g=0;g<d[m].morphTargets.length;g++)p[d[m].morphTargets[g]]=-1;for(const g in p){const _=[],y=[];for(let w=0;w!==d[m].morphTargets.length;++w){const A=d[m];_.push(A.time),y.push(A.morphTarget===g?1:0)}r.push(new Vd(".morphTargetInfluence["+g+"]",_,y))}l=p.length*(s||1)}else{const p=".bones["+e[h].name+"]";i(Wd,p+".position",d,"pos",r),i(nc,p+".quaternion",d,"rot",r),i(Wd,p+".scale",d,"scl",r)}}return r.length===0?null:new this(o,l,r,a)}resetDuration(){let t=0;for(let e=0,i=this.tracks.length;e!==i;++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 nE(n){if(n.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 Vd;case"vector":case"vector2":case"vector3":case"vector4":return Wd;case"color":return Nv;case"quaternion":return nc;case"bool":case"boolean":return du;case"string":return pu}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(n.type);if(n.times===void 0){const e=[],i=[];sn.flattenJSON(n.keys,e,i,"value"),n.times=e,n.values=i}return t.parse!==void 0?t.parse(n):new t(n.name,n.times,n.values,n.interpolation)}const fu={enabled:!1,files:{},add:function(n,t){this.enabled!==!1&&(this.files[n]=t)},get:function(n){if(this.enabled!==!1)return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}};class Dv{constructor(t,e,i){const r=this;let o=!1,s=0,a=0,l;const u=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=i,this.itemStart=function(h){a++,o===!1&&r.onStart!==void 0&&r.onStart(h,s,a),o=!0},this.itemEnd=function(h){s++,r.onProgress!==void 0&&r.onProgress(h,s,a),s===a&&(o=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(h){r.onError!==void 0&&r.onError(h)},this.resolveURL=function(h){return l?l(h):h},this.setURLModifier=function(h){return l=h,this},this.addHandler=function(h,d){return u.push(h,d),this},this.removeHandler=function(h){const d=u.indexOf(h);return d!==-1&&u.splice(d,2),this},this.getHandler=function(h){for(let d=0,p=u.length;d<p;d+=2){const m=u[d],g=u[d+1];if(m.global&&(m.lastIndex=0),m.test(h))return g}return null}}}const gy=new Dv;class gr{constructor(t){this.manager=t!==void 0?t:gy,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){const i=this;return new Promise(function(r,o){i.load(t,r,e,o)})}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 Zo={};class Ko extends gr{constructor(t){super(t)}load(t,e,i,r){t===void 0&&(t=""),this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const o=this,s=fu.get(t);if(s!==void 0)return o.manager.itemStart(t),setTimeout(function(){e&&e(s),o.manager.itemEnd(t)},0),s;if(Zo[t]!==void 0)return void Zo[t].push({onLoad:e,onProgress:i,onError:r});const a=t.match(/^data:(.*?)(;base64)?,(.*)$/);let l;if(a){const u=a[1],h=!!a[2];let d=a[3];d=decodeURIComponent(d),h&&(d=atob(d));try{let p;const m=(this.responseType||"").toLowerCase();switch(m){case"arraybuffer":case"blob":const g=new Uint8Array(d.length);for(let y=0;y<d.length;y++)g[y]=d.charCodeAt(y);p=m==="blob"?new Blob([g.buffer],{type:u}):g.buffer;break;case"document":p=new DOMParser().parseFromString(d,u);break;case"json":p=JSON.parse(d);break;default:p=d}setTimeout(function(){e&&e(p),o.manager.itemEnd(t)},0)}catch(p){setTimeout(function(){r&&r(p),o.manager.itemError(t),o.manager.itemEnd(t)},0)}}else{Zo[t]=[],Zo[t].push({onLoad:e,onProgress:i,onError:r}),l=new XMLHttpRequest,l.open("GET",t,!0),l.addEventListener("load",function(u){const h=this.response,d=Zo[t];if(delete Zo[t],this.status===200||this.status===0){this.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),fu.add(t,h);for(let p=0,m=d.length;p<m;p++){const g=d[p];g.onLoad&&g.onLoad(h)}o.manager.itemEnd(t)}else{for(let p=0,m=d.length;p<m;p++){const g=d[p];g.onError&&g.onError(u)}o.manager.itemError(t),o.manager.itemEnd(t)}},!1),l.addEventListener("progress",function(u){const h=Zo[t];for(let d=0,p=h.length;d<p;d++){const m=h[d];m.onProgress&&m.onProgress(u)}},!1),l.addEventListener("error",function(u){const h=Zo[t];delete Zo[t];for(let d=0,p=h.length;d<p;d++){const m=h[d];m.onError&&m.onError(u)}o.manager.itemError(t),o.manager.itemEnd(t)},!1),l.addEventListener("abort",function(u){const h=Zo[t];delete Zo[t];for(let d=0,p=h.length;d<p;d++){const m=h[d];m.onError&&m.onError(u)}o.manager.itemError(t),o.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 u in this.requestHeader)l.setRequestHeader(u,this.requestHeader[u]);l.send(null)}return o.manager.itemStart(t),l}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class rE extends gr{constructor(t){super(t)}load(t,e,i,r){const o=this,s=new Ko(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,function(a){try{e(o.parse(JSON.parse(a)))}catch(l){r?r(l):console.error(l),o.manager.itemError(t)}},i,r)}parse(t){const e=[];for(let i=0;i<t.length;i++){const r=Xd.parse(t[i]);e.push(r)}return e}}class oE extends gr{constructor(t){super(t)}load(t,e,i,r){const o=this,s=[],a=new Fe,l=new Ko(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(o.withCredentials);let u=0;function h(d){l.load(t[d],function(p){const m=o.parse(p,!0);s[d]={width:m.width,height:m.height,format:m.format,mipmaps:m.mipmaps},u+=1,u===6&&(m.mipmapCount===1&&(a.minFilter=qi),a.image=s,a.format=m.format,a.needsUpdate=!0,e&&e(a))},i,r)}if(Array.isArray(t))for(let d=0,p=t.length;d<p;++d)h(d);else l.load(t,function(d){const p=o.parse(d,!0);if(p.isCubemap){const m=p.mipmaps.length/p.mipmapCount;for(let g=0;g<m;g++){s[g]={mipmaps:[]};for(let _=0;_<p.mipmapCount;_++)s[g].mipmaps.push(p.mipmaps[g*p.mipmapCount+_]),s[g].format=p.format,s[g].width=p.width,s[g].height=p.height}a.image=s}else a.image.width=p.width,a.image.height=p.height,a.mipmaps=p.mipmaps;p.mipmapCount===1&&(a.minFilter=qi),a.format=p.format,a.needsUpdate=!0,e&&e(a)},i,r);return a}}class qd extends gr{constructor(t){super(t)}load(t,e,i,r){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const o=this,s=fu.get(t);if(s!==void 0)return o.manager.itemStart(t),setTimeout(function(){e&&e(s),o.manager.itemEnd(t)},0),s;const a=document.createElementNS("http://www.w3.org/1999/xhtml","img");function l(){a.removeEventListener("load",l,!1),a.removeEventListener("error",u,!1),fu.add(t,this),e&&e(this),o.manager.itemEnd(t)}function u(h){a.removeEventListener("load",l,!1),a.removeEventListener("error",u,!1),r&&r(h),o.manager.itemError(t),o.manager.itemEnd(t)}return a.addEventListener("load",l,!1),a.addEventListener("error",u,!1),t.substr(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),o.manager.itemStart(t),a.src=t,a}}class vy extends gr{constructor(t){super(t)}load(t,e,i,r){const o=new ro,s=new qd(this.manager);s.setCrossOrigin(this.crossOrigin),s.setPath(this.path);let a=0;function l(u){s.load(t[u],function(h){o.images[u]=h,a++,a===6&&(o.needsUpdate=!0,e&&e(o))},void 0,r)}for(let u=0;u<t.length;++u)l(u);return o}}class _y extends gr{constructor(t){super(t)}load(t,e,i,r){const o=this,s=new ws,a=new Ko(this.manager);return a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(o.withCredentials),a.load(t,function(l){const u=o.parse(l);u&&(u.image!==void 0?s.image=u.image:u.data!==void 0&&(s.image.width=u.width,s.image.height=u.height,s.image.data=u.data),s.wrapS=u.wrapS!==void 0?u.wrapS:qe,s.wrapT=u.wrapT!==void 0?u.wrapT:qe,s.magFilter=u.magFilter!==void 0?u.magFilter:qi,s.minFilter=u.minFilter!==void 0?u.minFilter:qi,s.anisotropy=u.anisotropy!==void 0?u.anisotropy:1,u.encoding!==void 0&&(s.encoding=u.encoding),u.flipY!==void 0&&(s.flipY=u.flipY),u.format!==void 0&&(s.format=u.format),u.type!==void 0&&(s.type=u.type),u.mipmaps!==void 0&&(s.mipmaps=u.mipmaps,s.minFilter=js),u.mipmapCount===1&&(s.minFilter=qi),u.generateMipmaps!==void 0&&(s.generateMipmaps=u.generateMipmaps),s.needsUpdate=!0,e&&e(s,u))},i,r),s}}class Fv extends gr{constructor(t){super(t)}load(t,e,i,r){const o=new dn,s=new qd(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(t,function(a){o.image=a;const l=t.search(/\.jpe?g($|\?)/i)>0||t.search(/^data\:image\/jpeg/)===0;o.format=l?No:Tr,o.needsUpdate=!0,e!==void 0&&e(o)},i,r),o}}class yy extends cn{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 ll(e,t))}getPoint(t){const e=t*this.getLength(),i=this.getCurveLengths();let r=0;for(;r<i.length;){if(i[r]>=e){const o=i[r]-e,s=this.curves[r],a=s.getLength(),l=a===0?0:1-o/a;return s.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 i=0,r=this.curves.length;i<r;i++)e+=this.curves[i].getLength(),t.push(e);return this.cacheLengths=t,t}getSpacedPoints(t=40){const e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){const e=[];let i;for(let r=0,o=this.curves;r<o.length;r++){const s=o[r],a=s&&s.isEllipseCurve?2*t:s&&(s.isLineCurve||s.isLineCurve3)?1:s&&s.isSplineCurve?t*s.points.length:t,l=s.getPoints(a);for(let u=0;u<l.length;u++){const h=l[u];i&&i.equals(h)||(e.push(h),i=h)}}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,i=t.curves.length;e<i;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,i=this.curves.length;e<i;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,i=t.curves.length;e<i;e++){const r=t.curves[e];this.curves.push(new Sv[r.type]().fromJSON(r))}return this}}class mu extends yy{constructor(t){super(),this.type="Path",this.currentPoint=new ce,t&&this.setFromPoints(t)}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,i=t.length;e<i;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 i=new ll(this.currentPoint.clone(),new ce(t,e));return this.curves.push(i),this.currentPoint.set(t,e),this}quadraticCurveTo(t,e,i,r){const o=new xa(this.currentPoint.clone(),new ce(t,e),new ce(i,r));return this.curves.push(o),this.currentPoint.set(i,r),this}bezierCurveTo(t,e,i,r,o,s){const a=new ya(this.currentPoint.clone(),new ce(t,e),new ce(i,r),new ce(o,s));return this.curves.push(a),this.currentPoint.set(o,s),this}splineThru(t){const e=[this.currentPoint.clone()].concat(t),i=new im(e);return this.curves.push(i),this.currentPoint.copy(t[t.length-1]),this}arc(t,e,i,r,o,s){const a=this.currentPoint.x,l=this.currentPoint.y;return this.absarc(t+a,e+l,i,r,o,s),this}absarc(t,e,i,r,o,s){return this.absellipse(t,e,i,i,r,o,s),this}ellipse(t,e,i,r,o,s,a,l){const u=this.currentPoint.x,h=this.currentPoint.y;return this.absellipse(t+u,e+h,i,r,o,s,a,l),this}absellipse(t,e,i,r,o,s,a,l){const u=new on(t,e,i,r,o,s,a,l);if(this.curves.length>0){const d=u.getPoint(0);d.equals(this.currentPoint)||this.lineTo(d.x,d.y)}this.curves.push(u);const h=u.getPoint(1);return this.currentPoint.copy(h),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 hl extends mu{constructor(t){super(t),this.uuid=Ar(),this.type="Shape",this.holes=[]}getPointsHoles(t){const e=[];for(let i=0,r=this.holes.length;i<r;i++)e[i]=this.holes[i].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,i=t.holes.length;e<i;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,i=this.holes.length;e<i;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,i=t.holes.length;e<i;e++){const r=t.holes[e];this.holes.push(new mu().fromJSON(r))}return this}}class Qo extends hi{constructor(t,e=1){super(),this.type="Light",this.color=new Le(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}}Qo.prototype.isLight=!0;class Bv extends Qo{constructor(t,e,i){super(t,i),this.type="HemisphereLight",this.position.copy(hi.DefaultUp),this.updateMatrix(),this.groundColor=new Le(e)}copy(t){return Qo.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}Bv.prototype.isHemisphereLight=!0;const xy=new Ee,by=new S,wy=new S;class kv{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new ce(512,512),this.map=null,this.mapPass=null,this.matrix=new Ee,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Ka,this._frameExtents=new ce(1,1),this._viewportCount=1,this._viewports=[new Li(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera,i=this.matrix;by.setFromMatrixPosition(t.matrixWorld),e.position.copy(by),wy.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(wy),e.updateMatrixWorld(),xy.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(xy),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(e.projectionMatrix),i.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 Sy extends kv{constructor(){super(new fn(50,1,.5,500)),this.focus=1}updateMatrices(t){const e=this.camera,i=2*yn*t.angle*this.focus,r=this.mapSize.width/this.mapSize.height,o=t.distance||e.far;i===e.fov&&r===e.aspect&&o===e.far||(e.fov=i,e.aspect=r,e.far=o,e.updateProjectionMatrix()),super.updateMatrices(t)}copy(t){return super.copy(t),this.focus=t.focus,this}}Sy.prototype.isSpotLightShadow=!0;class Uv extends Qo{constructor(t,e,i=0,r=Math.PI/3,o=0,s=1){super(t,e),this.type="SpotLight",this.position.copy(hi.DefaultUp),this.updateMatrix(),this.target=new hi,this.distance=i,this.angle=r,this.penumbra=o,this.decay=s,this.shadow=new Sy}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}}Uv.prototype.isSpotLight=!0;const Ty=new Ee,Yd=new S,Gv=new S;class Ey extends kv{constructor(){super(new fn(90,1,.5,500)),this._frameExtents=new ce(4,2),this._viewportCount=6,this._viewports=[new Li(2,1,1,1),new Li(0,1,1,1),new Li(3,1,1,1),new Li(1,1,1,1),new Li(3,0,1,1),new Li(1,0,1,1)],this._cubeDirections=[new S(1,0,0),new S(-1,0,0),new S(0,0,1),new S(0,0,-1),new S(0,1,0),new S(0,-1,0)],this._cubeUps=[new S(0,1,0),new S(0,1,0),new S(0,1,0),new S(0,1,0),new S(0,0,1),new S(0,0,-1)]}updateMatrices(t,e=0){const i=this.camera,r=this.matrix,o=t.distance||i.far;o!==i.far&&(i.far=o,i.updateProjectionMatrix()),Yd.setFromMatrixPosition(t.matrixWorld),i.position.copy(Yd),Gv.copy(i.position),Gv.add(this._cubeDirections[e]),i.up.copy(this._cubeUps[e]),i.lookAt(Gv),i.updateMatrixWorld(),r.makeTranslation(-Yd.x,-Yd.y,-Yd.z),Ty.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Ty)}}Ey.prototype.isPointLightShadow=!0;class Hv extends Qo{constructor(t,e,i=0,r=1){super(t,e),this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new Ey}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}}Hv.prototype.isPointLight=!0;class rc extends la{constructor(t=-1,e=1,i=1,r=-1,o=.1,s=2e3){super(),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=i,this.bottom=r,this.near=o,this.far=s,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,i,r,o,s){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=i,this.view.offsetY=r,this.view.width=o,this.view.height=s,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),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let o=i-t,s=i+t,a=r+e,l=r-e;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=u*this.view.offsetX,s=o+u*this.view.width,a-=h*this.view.offsetY,l=a-h*this.view.height}this.projectionMatrix.makeOrthographic(o,s,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}}rc.prototype.isOrthographicCamera=!0;class My extends kv{constructor(){super(new rc(-5,5,5,-5,.5,500))}}My.prototype.isDirectionalLightShadow=!0;class hm extends Qo{constructor(t,e){super(t,e),this.type="DirectionalLight",this.position.copy(hi.DefaultUp),this.updateMatrix(),this.target=new hi,this.shadow=new My}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}hm.prototype.isDirectionalLight=!0;class cm extends Qo{constructor(t,e){super(t,e),this.type="AmbientLight"}}cm.prototype.isAmbientLight=!0;class zv extends Qo{constructor(t,e,i=10,r=10){super(t,e),this.type="RectAreaLight",this.width=i,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}}zv.prototype.isRectAreaLight=!0;class jv{constructor(){this.coefficients=[];for(let t=0;t<9;t++)this.coefficients.push(new S)}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 i=t.x,r=t.y,o=t.z,s=this.coefficients;return e.copy(s[0]).multiplyScalar(.282095),e.addScaledVector(s[1],.488603*r),e.addScaledVector(s[2],.488603*o),e.addScaledVector(s[3],.488603*i),e.addScaledVector(s[4],i*r*1.092548),e.addScaledVector(s[5],r*o*1.092548),e.addScaledVector(s[6],.315392*(3*o*o-1)),e.addScaledVector(s[7],i*o*1.092548),e.addScaledVector(s[8],.546274*(i*i-r*r)),e}getIrradianceAt(t,e){const i=t.x,r=t.y,o=t.z,s=this.coefficients;return e.copy(s[0]).multiplyScalar(.886227),e.addScaledVector(s[1],1.023328*r),e.addScaledVector(s[2],1.023328*o),e.addScaledVector(s[3],1.023328*i),e.addScaledVector(s[4],.858086*i*r),e.addScaledVector(s[5],.858086*r*o),e.addScaledVector(s[6],.743125*o*o-.247708),e.addScaledVector(s[7],.858086*i*o),e.addScaledVector(s[8],.429043*(i*i-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 i=0;i<9;i++)this.coefficients[i].addScaledVector(t.coefficients[i],e);return this}scale(t){for(let e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this}lerp(t,e){for(let i=0;i<9;i++)this.coefficients[i].lerp(t.coefficients[i],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 i=this.coefficients;for(let r=0;r<9;r++)i[r].fromArray(t,e+3*r);return this}toArray(t=[],e=0){const i=this.coefficients;for(let r=0;r<9;r++)i[r].toArray(t,e+3*r);return t}static getBasisAt(t,e){const i=t.x,r=t.y,o=t.z;e[0]=.282095,e[1]=.488603*r,e[2]=.488603*o,e[3]=.488603*i,e[4]=1.092548*i*r,e[5]=1.092548*r*o,e[6]=.315392*(3*o*o-1),e[7]=1.092548*i*o,e[8]=.546274*(i*i-r*r)}}jv.prototype.isSphericalHarmonics3=!0;class $d extends Qo{constructor(t=new jv,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}}$d.prototype.isLightProbe=!0;class Ay extends gr{constructor(t){super(t),this.textures={}}load(t,e,i,r){const o=this,s=new Ko(o.manager);s.setPath(o.path),s.setRequestHeader(o.requestHeader),s.setWithCredentials(o.withCredentials),s.load(t,function(a){try{e(o.parse(JSON.parse(a)))}catch(l){r?r(l):console.error(l),o.manager.itemError(t)}},i,r)}parse(t){const e=this.textures;function i(o){return e[o]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",o),e[o]}const r=new iE[t.type];if(t.uuid!==void 0&&(r.uuid=t.uuid),t.name!==void 0&&(r.name=t.name),t.color!==void 0&&r.color!==void 0&&r.color.setHex(t.color),t.roughness!==void 0&&(r.roughness=t.roughness),t.metalness!==void 0&&(r.metalness=t.metalness),t.sheen!==void 0&&(r.sheen=new Le().setHex(t.sheen)),t.emissive!==void 0&&r.emissive!==void 0&&r.emissive.setHex(t.emissive),t.specular!==void 0&&r.specular!==void 0&&r.specular.setHex(t.specular),t.shininess!==void 0&&(r.shininess=t.shininess),t.clearcoat!==void 0&&(r.clearcoat=t.clearcoat),t.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=t.clearcoatRoughness),t.transmission!==void 0&&(r.transmission=t.transmission),t.thickness!==void 0&&(r.thickness=t.thickness),t.attenuationDistance!==void 0&&(r.attenuationDistance=t.attenuationDistance),t.attenuationColor!==void 0&&r.attenuationColor!==void 0&&r.attenuationColor.setHex(t.attenuationColor),t.fog!==void 0&&(r.fog=t.fog),t.flatShading!==void 0&&(r.flatShading=t.flatShading),t.blending!==void 0&&(r.blending=t.blending),t.combine!==void 0&&(r.combine=t.combine),t.side!==void 0&&(r.side=t.side),t.shadowSide!==void 0&&(r.shadowSide=t.shadowSide),t.opacity!==void 0&&(r.opacity=t.opacity),t.transparent!==void 0&&(r.transparent=t.transparent),t.alphaTest!==void 0&&(r.alphaTest=t.alphaTest),t.depthTest!==void 0&&(r.depthTest=t.depthTest),t.depthWrite!==void 0&&(r.depthWrite=t.depthWrite),t.colorWrite!==void 0&&(r.colorWrite=t.colorWrite),t.stencilWrite!==void 0&&(r.stencilWrite=t.stencilWrite),t.stencilWriteMask!==void 0&&(r.stencilWriteMask=t.stencilWriteMask),t.stencilFunc!==void 0&&(r.stencilFunc=t.stencilFunc),t.stencilRef!==void 0&&(r.stencilRef=t.stencilRef),t.stencilFuncMask!==void 0&&(r.stencilFuncMask=t.stencilFuncMask),t.stencilFail!==void 0&&(r.stencilFail=t.stencilFail),t.stencilZFail!==void 0&&(r.stencilZFail=t.stencilZFail),t.stencilZPass!==void 0&&(r.stencilZPass=t.stencilZPass),t.wireframe!==void 0&&(r.wireframe=t.wireframe),t.wireframeLinewidth!==void 0&&(r.wireframeLinewidth=t.wireframeLinewidth),t.wireframeLinecap!==void 0&&(r.wireframeLinecap=t.wireframeLinecap),t.wireframeLinejoin!==void 0&&(r.wireframeLinejoin=t.wireframeLinejoin),t.rotation!==void 0&&(r.rotation=t.rotation),t.linewidth!==1&&(r.linewidth=t.linewidth),t.dashSize!==void 0&&(r.dashSize=t.dashSize),t.gapSize!==void 0&&(r.gapSize=t.gapSize),t.scale!==void 0&&(r.scale=t.scale),t.polygonOffset!==void 0&&(r.polygonOffset=t.polygonOffset),t.polygonOffsetFactor!==void 0&&(r.polygonOffsetFactor=t.polygonOffsetFactor),t.polygonOffsetUnits!==void 0&&(r.polygonOffsetUnits=t.polygonOffsetUnits),t.morphTargets!==void 0&&(r.morphTargets=t.morphTargets),t.morphNormals!==void 0&&(r.morphNormals=t.morphNormals),t.dithering!==void 0&&(r.dithering=t.dithering),t.alphaToCoverage!==void 0&&(r.alphaToCoverage=t.alphaToCoverage),t.premultipliedAlpha!==void 0&&(r.premultipliedAlpha=t.premultipliedAlpha),t.vertexTangents!==void 0&&(r.vertexTangents=t.vertexTangents),t.visible!==void 0&&(r.visible=t.visible),t.toneMapped!==void 0&&(r.toneMapped=t.toneMapped),t.userData!==void 0&&(r.userData=t.userData),t.vertexColors!==void 0&&(typeof t.vertexColors=="number"?r.vertexColors=t.vertexColors>0:r.vertexColors=t.vertexColors),t.uniforms!==void 0)for(const o in t.uniforms){const s=t.uniforms[o];switch(r.uniforms[o]={},s.type){case"t":r.uniforms[o].value=i(s.value);break;case"c":r.uniforms[o].value=new Le().setHex(s.value);break;case"v2":r.uniforms[o].value=new ce().fromArray(s.value);break;case"v3":r.uniforms[o].value=new S().fromArray(s.value);break;case"v4":r.uniforms[o].value=new Li().fromArray(s.value);break;case"m3":r.uniforms[o].value=new zi().fromArray(s.value);break;case"m4":r.uniforms[o].value=new Ee().fromArray(s.value);break;default:r.uniforms[o].value=s.value}}if(t.defines!==void 0&&(r.defines=t.defines),t.vertexShader!==void 0&&(r.vertexShader=t.vertexShader),t.fragmentShader!==void 0&&(r.fragmentShader=t.fragmentShader),t.extensions!==void 0)for(const o in t.extensions)r.extensions[o]=t.extensions[o];if(t.shading!==void 0&&(r.flatShading=t.shading===1),t.size!==void 0&&(r.size=t.size),t.sizeAttenuation!==void 0&&(r.sizeAttenuation=t.sizeAttenuation),t.map!==void 0&&(r.map=i(t.map)),t.matcap!==void 0&&(r.matcap=i(t.matcap)),t.alphaMap!==void 0&&(r.alphaMap=i(t.alphaMap)),t.bumpMap!==void 0&&(r.bumpMap=i(t.bumpMap)),t.bumpScale!==void 0&&(r.bumpScale=t.bumpScale),t.normalMap!==void 0&&(r.normalMap=i(t.normalMap)),t.normalMapType!==void 0&&(r.normalMapType=t.normalMapType),t.normalScale!==void 0){let o=t.normalScale;Array.isArray(o)===!1&&(o=[o,o]),r.normalScale=new ce().fromArray(o)}return t.displacementMap!==void 0&&(r.displacementMap=i(t.displacementMap)),t.displacementScale!==void 0&&(r.displacementScale=t.displacementScale),t.displacementBias!==void 0&&(r.displacementBias=t.displacementBias),t.roughnessMap!==void 0&&(r.roughnessMap=i(t.roughnessMap)),t.metalnessMap!==void 0&&(r.metalnessMap=i(t.metalnessMap)),t.emissiveMap!==void 0&&(r.emissiveMap=i(t.emissiveMap)),t.emissiveIntensity!==void 0&&(r.emissiveIntensity=t.emissiveIntensity),t.specularMap!==void 0&&(r.specularMap=i(t.specularMap)),t.envMap!==void 0&&(r.envMap=i(t.envMap)),t.envMapIntensity!==void 0&&(r.envMapIntensity=t.envMapIntensity),t.reflectivity!==void 0&&(r.reflectivity=t.reflectivity),t.refractionRatio!==void 0&&(r.refractionRatio=t.refractionRatio),t.lightMap!==void 0&&(r.lightMap=i(t.lightMap)),t.lightMapIntensity!==void 0&&(r.lightMapIntensity=t.lightMapIntensity),t.aoMap!==void 0&&(r.aoMap=i(t.aoMap)),t.aoMapIntensity!==void 0&&(r.aoMapIntensity=t.aoMapIntensity),t.gradientMap!==void 0&&(r.gradientMap=i(t.gradientMap)),t.clearcoatMap!==void 0&&(r.clearcoatMap=i(t.clearcoatMap)),t.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=i(t.clearcoatRoughnessMap)),t.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=i(t.clearcoatNormalMap)),t.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new ce().fromArray(t.clearcoatNormalScale)),t.transmissionMap!==void 0&&(r.transmissionMap=i(t.transmissionMap)),t.thicknessMap!==void 0&&(r.thicknessMap=i(t.thicknessMap)),r}setTextures(t){return this.textures=t,this}}class dm{static decodeText(t){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(t);let e="";for(let i=0,r=t.length;i<r;i++)e+=String.fromCharCode(t[i]);try{return decodeURIComponent(escape(e))}catch{return e}}static extractUrlBase(t){const e=t.lastIndexOf("/");return e===-1?"./":t.substr(0,e+1)}}class Vv extends ze{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}}Vv.prototype.isInstancedBufferGeometry=!0;class Wv extends mi{constructor(t,e,i,r=1){typeof i=="number"&&(r=i,i=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(t,e,i),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}}Wv.prototype.isInstancedBufferAttribute=!0;class Ry extends gr{constructor(t){super(t)}load(t,e,i,r){const o=this,s=new Ko(o.manager);s.setPath(o.path),s.setRequestHeader(o.requestHeader),s.setWithCredentials(o.withCredentials),s.load(t,function(a){try{e(o.parse(JSON.parse(a)))}catch(l){r?r(l):console.error(l),o.manager.itemError(t)}},i,r)}parse(t){const e={},i={};function r(d,p){if(e[p]!==void 0)return e[p];const m=d.interleavedBuffers[p],g=function(w,A){if(i[A]!==void 0)return i[A];const I=w.arrayBuffers[A],F=new Uint32Array(I).buffer;return i[A]=F,F}(d,m.buffer),_=ra(m.type,g),y=new fa(_,m.stride);return y.uuid=m.uuid,e[p]=y,y}const o=t.isInstancedBufferGeometry?new Vv:new ze,s=t.data.index;if(s!==void 0){const d=ra(s.type,s.array);o.setIndex(new mi(d,1))}const a=t.data.attributes;for(const d in a){const p=a[d];let m;if(p.isInterleavedBufferAttribute){const g=r(t.data,p.data);m=new Yo(g,p.itemSize,p.offset,p.normalized)}else{const g=ra(p.type,p.array);m=new(p.isInstancedBufferAttribute?Wv:mi)(g,p.itemSize,p.normalized)}p.name!==void 0&&(m.name=p.name),p.usage!==void 0&&m.setUsage(p.usage),p.updateRange!==void 0&&(m.updateRange.offset=p.updateRange.offset,m.updateRange.count=p.updateRange.count),o.setAttribute(d,m)}const l=t.data.morphAttributes;if(l)for(const d in l){const p=l[d],m=[];for(let g=0,_=p.length;g<_;g++){const y=p[g];let w;if(y.isInterleavedBufferAttribute){const A=r(t.data,y.data);w=new Yo(A,y.itemSize,y.offset,y.normalized)}else{const A=ra(y.type,y.array);w=new mi(A,y.itemSize,y.normalized)}y.name!==void 0&&(w.name=y.name),m.push(w)}o.morphAttributes[d]=m}t.data.morphTargetsRelative&&(o.morphTargetsRelative=!0);const u=t.data.groups||t.data.drawcalls||t.data.offsets;if(u!==void 0)for(let d=0,p=u.length;d!==p;++d){const m=u[d];o.addGroup(m.start,m.count,m.materialIndex)}const h=t.data.boundingSphere;if(h!==void 0){const d=new S;h.center!==void 0&&d.fromArray(h.center),o.boundingSphere=new En(d,h.radius)}return t.name&&(o.name=t.name),t.userData&&(o.userData=t.userData),o}}class sE extends gr{constructor(t){super(t)}load(t,e,i,r){const o=this,s=this.path===""?dm.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||s;const a=new Ko(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(t,function(l){let u=null;try{u=JSON.parse(l)}catch(d){return r!==void 0&&r(d),void console.error("THREE:ObjectLoader: Can't parse "+t+".",d.message)}const h=u.metadata;h!==void 0&&h.type!==void 0&&h.type.toLowerCase()!=="geometry"?o.parse(u,e):console.error("THREE.ObjectLoader: Can't load "+t)},i,r)}async loadAsync(t,e){const i=this.path===""?dm.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||i;const r=new Ko(this.manager);r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials);const o=await r.loadAsync(t,e),s=JSON.parse(o),a=s.metadata;if(a===void 0||a.type===void 0||a.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+t);return await this.parseAsync(s)}parse(t,e){const i=this.parseAnimations(t.animations),r=this.parseShapes(t.shapes),o=this.parseGeometries(t.geometries,r),s=this.parseImages(t.images,function(){e!==void 0&&e(u)}),a=this.parseTextures(t.textures,s),l=this.parseMaterials(t.materials,a),u=this.parseObject(t.object,o,l,a,i),h=this.parseSkeletons(t.skeletons,u);if(this.bindSkeletons(u,h),e!==void 0){let d=!1;for(const p in s)if(s[p]instanceof HTMLImageElement){d=!0;break}d===!1&&e(u)}return u}async parseAsync(t){const e=this.parseAnimations(t.animations),i=this.parseShapes(t.shapes),r=this.parseGeometries(t.geometries,i),o=await this.parseImagesAsync(t.images),s=this.parseTextures(t.textures,o),a=this.parseMaterials(t.materials,s),l=this.parseObject(t.object,r,a,s,e),u=this.parseSkeletons(t.skeletons,l);return this.bindSkeletons(l,u),l}parseShapes(t){const e={};if(t!==void 0)for(let i=0,r=t.length;i<r;i++){const o=new hl().fromJSON(t[i]);e[o.uuid]=o}return e}parseSkeletons(t,e){const i={},r={};if(e.traverse(function(o){o.isBone&&(r[o.uuid]=o)}),t!==void 0)for(let o=0,s=t.length;o<s;o++){const a=new jh().fromJSON(t[o],r);i[a.uuid]=a}return i}parseGeometries(t,e){const i={};if(t!==void 0){const r=new Ry;for(let o=0,s=t.length;o<s;o++){let a;const l=t[o];switch(l.type){case"BufferGeometry":case"InstancedBufferGeometry":a=r.parse(l);break;case"Geometry":console.error("THREE.ObjectLoader: The legacy Geometry type is no longer supported.");break;default:l.type in dy?a=dy[l.type].fromJSON(l,e):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${l.type}"`)}a.uuid=l.uuid,l.name!==void 0&&(a.name=l.name),a.isBufferGeometry===!0&&l.userData!==void 0&&(a.userData=l.userData),i[l.uuid]=a}}return i}parseMaterials(t,e){const i={},r={};if(t!==void 0){const o=new Ay;o.setTextures(e);for(let s=0,a=t.length;s<a;s++){const l=t[s];if(l.type==="MultiMaterial"){const u=[];for(let h=0;h<l.materials.length;h++){const d=l.materials[h];i[d.uuid]===void 0&&(i[d.uuid]=o.parse(d)),u.push(i[d.uuid])}r[l.uuid]=u}else i[l.uuid]===void 0&&(i[l.uuid]=o.parse(l)),r[l.uuid]=i[l.uuid]}}return r}parseAnimations(t){const e={};if(t!==void 0)for(let i=0;i<t.length;i++){const r=t[i],o=Xd.parse(r);e[o.uuid]=o}return e}parseImages(t,e){const i=this,r={};let o;function s(a){if(typeof a=="string"){const l=a;return function(u){return i.manager.itemStart(u),o.load(u,function(){i.manager.itemEnd(u)},void 0,function(){i.manager.itemError(u),i.manager.itemEnd(u)})}(/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l)?l:i.resourcePath+l)}return a.data?{data:ra(a.type,a.data),width:a.width,height:a.height}:null}if(t!==void 0&&t.length>0){const a=new Dv(e);o=new qd(a),o.setCrossOrigin(this.crossOrigin);for(let l=0,u=t.length;l<u;l++){const h=t[l],d=h.url;if(Array.isArray(d)){r[h.uuid]=[];for(let p=0,m=d.length;p<m;p++){const g=s(d[p]);g!==null&&(g instanceof HTMLImageElement?r[h.uuid].push(g):r[h.uuid].push(new ws(g.data,g.width,g.height)))}}else{const p=s(h.url);p!==null&&(r[h.uuid]=p)}}}return r}async parseImagesAsync(t){const e=this,i={};let r;async function o(s){if(typeof s=="string"){const a=s,l=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(a)?a:e.resourcePath+a;return await r.loadAsync(l)}return s.data?{data:ra(s.type,s.data),width:s.width,height:s.height}:null}if(t!==void 0&&t.length>0){r=new qd(this.manager),r.setCrossOrigin(this.crossOrigin);for(let s=0,a=t.length;s<a;s++){const l=t[s],u=l.url;if(Array.isArray(u)){i[l.uuid]=[];for(let h=0,d=u.length;h<d;h++){const p=u[h],m=await o(p);m!==null&&(m instanceof HTMLImageElement?i[l.uuid].push(m):i[l.uuid].push(new ws(m.data,m.width,m.height)))}}else{const h=await o(l.url);h!==null&&(i[l.uuid]=h)}}}return i}parseTextures(t,e){function i(o,s){return typeof o=="number"?o:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",o),s[o])}const r={};if(t!==void 0)for(let o=0,s=t.length;o<s;o++){const a=t[o];let l;a.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',a.uuid),e[a.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",a.image);const u=e[a.image];Array.isArray(u)?(l=new ro(u),u.length===6&&(l.needsUpdate=!0)):(l=u&&u.data?new ws(u.data,u.width,u.height):new dn(u),u&&(l.needsUpdate=!0)),l.uuid=a.uuid,a.name!==void 0&&(l.name=a.name),a.mapping!==void 0&&(l.mapping=i(a.mapping,aE)),a.offset!==void 0&&l.offset.fromArray(a.offset),a.repeat!==void 0&&l.repeat.fromArray(a.repeat),a.center!==void 0&&l.center.fromArray(a.center),a.rotation!==void 0&&(l.rotation=a.rotation),a.wrap!==void 0&&(l.wrapS=i(a.wrap[0],Cy),l.wrapT=i(a.wrap[1],Cy)),a.format!==void 0&&(l.format=a.format),a.type!==void 0&&(l.type=a.type),a.encoding!==void 0&&(l.encoding=a.encoding),a.minFilter!==void 0&&(l.minFilter=i(a.minFilter,Py)),a.magFilter!==void 0&&(l.magFilter=i(a.magFilter,Py)),a.anisotropy!==void 0&&(l.anisotropy=a.anisotropy),a.flipY!==void 0&&(l.flipY=a.flipY),a.premultiplyAlpha!==void 0&&(l.premultiplyAlpha=a.premultiplyAlpha),a.unpackAlignment!==void 0&&(l.unpackAlignment=a.unpackAlignment),r[a.uuid]=l}return r}parseObject(t,e,i,r,o){let s,a,l;function u(p){return e[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",p),e[p]}function h(p){if(p!==void 0){if(Array.isArray(p)){const m=[];for(let g=0,_=p.length;g<_;g++){const y=p[g];i[y]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",y),m.push(i[y])}return m}return i[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",p),i[p]}}function d(p){return r[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",p),r[p]}switch(t.type){case"Scene":s=new el,t.background!==void 0&&(Number.isInteger(t.background)?s.background=new Le(t.background):s.background=d(t.background)),t.environment!==void 0&&(s.environment=d(t.environment)),t.fog!==void 0&&(t.fog.type==="Fog"?s.fog=new eu(t.fog.color,t.fog.near,t.fog.far):t.fog.type==="FogExp2"&&(s.fog=new Fn(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":s=new fn(t.fov,t.aspect,t.near,t.far),t.focus!==void 0&&(s.focus=t.focus),t.zoom!==void 0&&(s.zoom=t.zoom),t.filmGauge!==void 0&&(s.filmGauge=t.filmGauge),t.filmOffset!==void 0&&(s.filmOffset=t.filmOffset),t.view!==void 0&&(s.view=Object.assign({},t.view));break;case"OrthographicCamera":s=new rc(t.left,t.right,t.top,t.bottom,t.near,t.far),t.zoom!==void 0&&(s.zoom=t.zoom),t.view!==void 0&&(s.view=Object.assign({},t.view));break;case"AmbientLight":s=new cm(t.color,t.intensity);break;case"DirectionalLight":s=new hm(t.color,t.intensity);break;case"PointLight":s=new Hv(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":s=new zv(t.color,t.intensity,t.width,t.height);break;case"SpotLight":s=new Uv(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":s=new Bv(t.color,t.groundColor,t.intensity);break;case"LightProbe":s=new $d().fromJSON(t);break;case"SkinnedMesh":a=u(t.geometry),l=h(t.material),s=new rl(a,l),t.bindMode!==void 0&&(s.bindMode=t.bindMode),t.bindMatrix!==void 0&&s.bindMatrix.fromArray(t.bindMatrix),t.skeleton!==void 0&&(s.skeleton=t.skeleton);break;case"Mesh":a=u(t.geometry),l=h(t.material),s=new Ti(a,l);break;case"InstancedMesh":a=u(t.geometry),l=h(t.material);const p=t.count,m=t.instanceMatrix,g=t.instanceColor;s=new Bd(a,l,p),s.instanceMatrix=new mi(new Float32Array(m.array),16),g!==void 0&&(s.instanceColor=new mi(new Float32Array(g.array),g.itemSize));break;case"LOD":s=new $f;break;case"Line":s=new c(u(t.geometry),h(t.material));break;case"LineLoop":s=new D(u(t.geometry),h(t.material));break;case"LineSegments":s=new R(u(t.geometry),h(t.material));break;case"PointCloud":case"Points":s=new Zt(u(t.geometry),h(t.material));break;case"Sprite":s=new su(h(t.material));break;case"Group":s=new pa;break;case"Bone":s=new zh;break;default:s=new hi}if(s.uuid=t.uuid,t.name!==void 0&&(s.name=t.name),t.matrix!==void 0?(s.matrix.fromArray(t.matrix),t.matrixAutoUpdate!==void 0&&(s.matrixAutoUpdate=t.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(t.position!==void 0&&s.position.fromArray(t.position),t.rotation!==void 0&&s.rotation.fromArray(t.rotation),t.quaternion!==void 0&&s.quaternion.fromArray(t.quaternion),t.scale!==void 0&&s.scale.fromArray(t.scale)),t.castShadow!==void 0&&(s.castShadow=t.castShadow),t.receiveShadow!==void 0&&(s.receiveShadow=t.receiveShadow),t.shadow&&(t.shadow.bias!==void 0&&(s.shadow.bias=t.shadow.bias),t.shadow.normalBias!==void 0&&(s.shadow.normalBias=t.shadow.normalBias),t.shadow.radius!==void 0&&(s.shadow.radius=t.shadow.radius),t.shadow.mapSize!==void 0&&s.shadow.mapSize.fromArray(t.shadow.mapSize),t.shadow.camera!==void 0&&(s.shadow.camera=this.parseObject(t.shadow.camera))),t.visible!==void 0&&(s.visible=t.visible),t.frustumCulled!==void 0&&(s.frustumCulled=t.frustumCulled),t.renderOrder!==void 0&&(s.renderOrder=t.renderOrder),t.userData!==void 0&&(s.userData=t.userData),t.layers!==void 0&&(s.layers.mask=t.layers),t.children!==void 0){const p=t.children;for(let m=0;m<p.length;m++)s.add(this.parseObject(p[m],e,i,r,o))}if(t.animations!==void 0){const p=t.animations;for(let m=0;m<p.length;m++){const g=p[m];s.animations.push(o[g])}}if(t.type==="LOD"){t.autoUpdate!==void 0&&(s.autoUpdate=t.autoUpdate);const p=t.levels;for(let m=0;m<p.length;m++){const g=p[m],_=s.getObjectByProperty("uuid",g.object);_!==void 0&&s.addLevel(_,g.distance)}}return s}bindSkeletons(t,e){Object.keys(e).length!==0&&t.traverse(function(i){if(i.isSkinnedMesh===!0&&i.skeleton!==void 0){const r=e[i.skeleton];r===void 0?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",i.skeleton):i.bind(r,i.bindMatrix)}})}setTexturePath(t){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(t)}}const aE={UVMapping:wt,CubeReflectionMapping:zt,CubeRefractionMapping:ne,EquirectangularReflectionMapping:se,EquirectangularRefractionMapping:ae,CubeUVReflectionMapping:xe,CubeUVRefractionMapping:Ie},Cy={RepeatWrapping:Ge,ClampToEdgeWrapping:qe,MirroredRepeatWrapping:pi},Py={NearestFilter:fi,NearestMipmapNearestFilter:Sr,NearestMipmapLinearFilter:zs,LinearFilter:qi,LinearMipmapNearestFilter:as,LinearMipmapLinearFilter:js};class Iy extends gr{constructor(t){super(t),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(t){return this.options=t,this}load(t,e,i,r){t===void 0&&(t=""),this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const o=this,s=fu.get(t);if(s!==void 0)return o.manager.itemStart(t),setTimeout(function(){e&&e(s),o.manager.itemEnd(t)},0),s;const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(t,a).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(o.options,{colorSpaceConversion:"none"}))}).then(function(l){fu.add(t,l),e&&e(l),o.manager.itemEnd(t)}).catch(function(l){r&&r(l),o.manager.itemError(t),o.manager.itemEnd(t)}),o.manager.itemStart(t)}}Iy.prototype.isImageBitmapLoader=!0;class Ly{constructor(){this.type="ShapePath",this.color=new Le,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new mu,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}quadraticCurveTo(t,e,i,r){return this.currentPath.quadraticCurveTo(t,e,i,r),this}bezierCurveTo(t,e,i,r,o,s){return this.currentPath.bezierCurveTo(t,e,i,r,o,s),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t,e){function i(A){const I=[];for(let F=0,N=A.length;F<N;F++){const U=A[F],B=new hl;B.curves=U.curves,I.push(B)}return I}function r(A,I){const F=I.length;let N=!1;for(let U=F-1,B=0;B<F;U=B++){let G=I[U],ct=I[B],it=ct.x-G.x,tt=ct.y-G.y;if(Math.abs(tt)>Number.EPSILON){if(tt<0&&(G=I[B],it=-it,ct=I[U],tt=-tt),A.y<G.y||A.y>ct.y)continue;if(A.y===G.y){if(A.x===G.x)return!0}else{const rt=tt*(A.x-G.x)-it*(A.y-G.y);if(rt===0)return!0;if(rt<0)continue;N=!N}}else{if(A.y!==G.y)continue;if(ct.x<=A.x&&A.x<=G.x||G.x<=A.x&&A.x<=ct.x)return!0}}return N}const o=Ms.isClockWise,s=this.subPaths;if(s.length===0)return[];if(e===!0)return i(s);let a,l,u;const h=[];if(s.length===1)return l=s[0],u=new hl,u.curves=l.curves,h.push(u),h;let d=!o(s[0].getPoints());d=t?!d:d;const p=[],m=[];let g,_,y=[],w=0;m[w]=void 0,y[w]=[];for(let A=0,I=s.length;A<I;A++)l=s[A],g=l.getPoints(),a=o(g),a=t?!a:a,a?(!d&&m[w]&&w++,m[w]={s:new hl,p:g},m[w].s.curves=l.curves,d&&w++,y[w]=[]):y[w].push({h:l,p:g[0]});if(!m[0])return i(s);if(m.length>1){let A=!1;const I=[];for(let F=0,N=m.length;F<N;F++)p[F]=[];for(let F=0,N=m.length;F<N;F++){const U=y[F];for(let B=0;B<U.length;B++){const G=U[B];let ct=!0;for(let it=0;it<m.length;it++)r(G.p,m[it].p)&&(F!==it&&I.push({froms:F,tos:it,hole:B}),ct?(ct=!1,p[it].push(G)):A=!0);ct&&p[F].push(G)}}I.length>0&&(A||(y=p))}for(let A=0,I=m.length;A<I;A++){u=m[A].s,h.push(u),_=y[A];for(let F=0,N=_.length;F<N;F++)u.holes.push(_[F].h)}return h}}class Xv{constructor(t){this.type="Font",this.data=t}generateShapes(t,e=100){const i=[],r=function(o,s,a){const l=Array.from(o),u=s/a.resolution,h=(a.boundingBox.yMax-a.boundingBox.yMin+a.underlineThickness)*u,d=[];let p=0,m=0;for(let g=0;g<l.length;g++){const _=l[g];if(_===`
|
|
4722
|
+
}`}),m=p.clone();m.defines.HORIZONTAL_PASS=1;const g=new ze;g.setAttribute("position",new mi(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new Ti(g,p),y=this;function w(U,B){const G=t.update(_);p.uniforms.shadow_pass.value=U.map.texture,p.uniforms.resolution.value=U.mapSize,p.uniforms.radius.value=U.radius,n.setRenderTarget(U.mapPass),n.clear(),n.renderBufferDirect(B,null,G,p,_,null),m.uniforms.shadow_pass.value=U.mapPass.texture,m.uniforms.resolution.value=U.mapSize,m.uniforms.radius.value=U.radius,n.setRenderTarget(U.map),n.clear(),n.renderBufferDirect(B,null,G,m,_,null)}function A(U){const B=U<<0;let G=a[B];return G===void 0&&(G=new xi({depthPacking:Kc,morphTargets:U}),a[B]=G),G}function I(U){const B=U<<0;let G=l[B];return G===void 0&&(G=new Dh({morphTargets:U}),l[B]=G),G}function F(U,B,G,ct,it,tt,rt){let et=null,pt=A,kt=U.customDepthMaterial;if(ct.isPointLight===!0&&(pt=I,kt=U.customDistanceMaterial),kt===void 0){let Lt=!1;G.morphTargets===!0&&(Lt=B.morphAttributes&&B.morphAttributes.position&&B.morphAttributes.position.length>0),et=pt(Lt)}else et=kt;if(n.localClippingEnabled&&G.clipShadows===!0&&G.clippingPlanes.length!==0){const Lt=et.uuid,_t=G.uuid;let xt=u[Lt];xt===void 0&&(xt={},u[Lt]=xt);let jt=xt[_t];jt===void 0&&(jt=et.clone(),xt[_t]=jt),et=jt}return et.visible=G.visible,et.wireframe=G.wireframe,et.side=rt===C?G.shadowSide!==null?G.shadowSide:G.side:G.shadowSide!==null?G.shadowSide:d[G.side],et.clipShadows=G.clipShadows,et.clippingPlanes=G.clippingPlanes,et.clipIntersection=G.clipIntersection,et.wireframeLinewidth=G.wireframeLinewidth,et.linewidth=G.linewidth,ct.isPointLight===!0&&et.isMeshDistanceMaterial===!0&&(et.referencePosition.setFromMatrixPosition(ct.matrixWorld),et.nearDistance=it,et.farDistance=tt),et}function N(U,B,G,ct,it){if(U.visible===!1)return;if(U.layers.test(B.layers)&&(U.isMesh||U.isLine||U.isPoints)&&(U.castShadow||U.receiveShadow&&it===C)&&(!U.frustumCulled||i.intersectsObject(U))){U.modelViewMatrix.multiplyMatrices(G.matrixWorldInverse,U.matrixWorld);const rt=t.update(U),et=U.material;if(Array.isArray(et)){const pt=rt.groups;for(let kt=0,Lt=pt.length;kt<Lt;kt++){const _t=pt[kt],xt=et[_t.materialIndex];if(xt&&xt.visible){const jt=F(U,rt,xt,ct,G.near,G.far,it);n.renderBufferDirect(G,null,rt,jt,U,_t)}}}else if(et.visible){const pt=F(U,rt,et,ct,G.near,G.far,it);n.renderBufferDirect(G,null,rt,pt,U,null)}}const tt=U.children;for(let rt=0,et=tt.length;rt<et;rt++)N(tt[rt],B,G,ct,it)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=O,this.render=function(U,B,G){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||U.length===0)return;const ct=n.getRenderTarget(),it=n.getActiveCubeFace(),tt=n.getActiveMipmapLevel(),rt=n.state;rt.setBlending(Ct),rt.buffers.color.setClear(1,1,1,1),rt.buffers.depth.setTest(!0),rt.setScissorTest(!1);for(let et=0,pt=U.length;et<pt;et++){const kt=U[et],Lt=kt.shadow;if(Lt===void 0){console.warn("THREE.WebGLShadowMap:",kt,"has no shadow.");continue}if(Lt.autoUpdate===!1&&Lt.needsUpdate===!1)continue;r.copy(Lt.mapSize);const _t=Lt.getFrameExtents();if(r.multiply(_t),o.copy(Lt.mapSize),(r.x>h||r.y>h)&&(r.x>h&&(o.x=Math.floor(h/_t.x),r.x=o.x*_t.x,Lt.mapSize.x=o.x),r.y>h&&(o.y=Math.floor(h/_t.y),r.y=o.y*_t.y,Lt.mapSize.y=o.y)),Lt.map===null&&!Lt.isPointLightShadow&&this.type===C){const jt={minFilter:qi,magFilter:qi,format:Tr};Lt.map=new Kr(r.x,r.y,jt),Lt.map.texture.name=kt.name+".shadowMap",Lt.mapPass=new Kr(r.x,r.y,jt),Lt.camera.updateProjectionMatrix()}if(Lt.map===null){const jt={minFilter:fi,magFilter:fi,format:Tr};Lt.map=new Kr(r.x,r.y,jt),Lt.map.texture.name=kt.name+".shadowMap",Lt.camera.updateProjectionMatrix()}n.setRenderTarget(Lt.map),n.clear();const xt=Lt.getViewportCount();for(let jt=0;jt<xt;jt++){const ee=Lt.getViewport(jt);s.set(o.x*ee.x,o.y*ee.y,o.x*ee.z,o.y*ee.w),rt.viewport(s),Lt.updateMatrices(kt,jt),i=Lt.getFrustum(),N(B,G,Lt.camera,kt,this.type)}Lt.isPointLightShadow||this.type!==C||w(Lt,G),Lt.needsUpdate=!1}y.needsUpdate=!1,n.setRenderTarget(ct,it,tt)}}function Fh(n,t,e){const i=e.isWebGL2,r=new function(){let Q=!1;const gt=new Li;let Dt=null;const Ft=new Li(0,0,0,0);return{setMask:function(St){Dt===St||Q||(n.colorMask(St,St,St,St),Dt=St)},setLocked:function(St){Q=St},setClear:function(St,Yt,Me,Re,Ae){Ae===!0&&(St*=Re,Yt*=Re,Me*=Re),gt.set(St,Yt,Me,Re),Ft.equals(gt)===!1&&(n.clearColor(St,Yt,Me,Re),Ft.copy(gt))},reset:function(){Q=!1,Dt=null,Ft.set(-1,0,0,0)}}},o=new function(){let Q=!1,gt=null,Dt=null,Ft=null;return{setTest:function(St){St?le(2929):nt(2929)},setMask:function(St){gt===St||Q||(n.depthMask(St),gt=St)},setFunc:function(St){if(Dt!==St){if(St)switch(St){case Ki:n.depthFunc(512);break;case Ii:n.depthFunc(519);break;case Ui:n.depthFunc(513);break;case On:n.depthFunc(515);break;case Qi:n.depthFunc(514);break;case Yn:n.depthFunc(518);break;case $n:n.depthFunc(516);break;case La:n.depthFunc(517);break;default:n.depthFunc(515)}else n.depthFunc(515);Dt=St}},setLocked:function(St){Q=St},setClear:function(St){Ft!==St&&(n.clearDepth(St),Ft=St)},reset:function(){Q=!1,gt=null,Dt=null,Ft=null}}},s=new function(){let Q=!1,gt=null,Dt=null,Ft=null,St=null,Yt=null,Me=null,Re=null,Ae=null;return{setTest:function(si){Q||(si?le(2960):nt(2960))},setMask:function(si){gt===si||Q||(n.stencilMask(si),gt=si)},setFunc:function(si,Tn,Ni){Dt===si&&Ft===Tn&&St===Ni||(n.stencilFunc(si,Tn,Ni),Dt=si,Ft=Tn,St=Ni)},setOp:function(si,Tn,Ni){Yt===si&&Me===Tn&&Re===Ni||(n.stencilOp(si,Tn,Ni),Yt=si,Me=Tn,Re=Ni)},setLocked:function(si){Q=si},setClear:function(si){Ae!==si&&(n.clearStencil(si),Ae=si)},reset:function(){Q=!1,gt=null,Dt=null,Ft=null,St=null,Yt=null,Me=null,Re=null,Ae=null}}};let a={},l=null,u={},h=null,d=!1,p=null,m=null,g=null,_=null,y=null,w=null,A=null,I=!1,F=null,N=null,U=null,B=null,G=null;const ct=n.getParameter(35661);let it=!1,tt=0;const rt=n.getParameter(7938);rt.indexOf("WebGL")!==-1?(tt=parseFloat(/^WebGL (\d)/.exec(rt)[1]),it=tt>=1):rt.indexOf("OpenGL ES")!==-1&&(tt=parseFloat(/^OpenGL ES (\d)/.exec(rt)[1]),it=tt>=2);let et=null,pt={};const kt=n.getParameter(3088),Lt=n.getParameter(2978),_t=new Li().fromArray(kt),xt=new Li().fromArray(Lt);function jt(Q,gt,Dt){const Ft=new Uint8Array(4),St=n.createTexture();n.bindTexture(Q,St),n.texParameteri(Q,10241,9728),n.texParameteri(Q,10240,9728);for(let Yt=0;Yt<Dt;Yt++)n.texImage2D(gt+Yt,0,6408,1,1,0,6408,5121,Ft);return St}const ee={};function le(Q){a[Q]!==!0&&(n.enable(Q),a[Q]=!0)}function nt(Q){a[Q]!==!1&&(n.disable(Q),a[Q]=!1)}ee[3553]=jt(3553,3553,1),ee[34067]=jt(34067,34069,6),r.setClear(0,0,0,1),o.setClear(1),s.setClear(0),le(2929),o.setFunc(On),Bt(!1),ue(Ot),le(2884),Ut(Ct);const lt={[Et]:32774,[At]:32778,[Rt]:32779};if(i)lt[Wt]=32775,lt[$t]=32776;else{const Q=t.get("EXT_blend_minmax");Q!==null&&(lt[Wt]=Q.MIN_EXT,lt[$t]=Q.MAX_EXT)}const Xt={[ye]:0,[me]:1,[ui]:768,[ei]:770,[Ci]:776,[Bi]:774,[ri]:772,[be]:769,[Ze]:771,[Di]:775,[De]:773};function Ut(Q,gt,Dt,Ft,St,Yt,Me,Re){if(Q!==Ct){if(d===!1&&(le(3042),d=!0),Q===ft)St=St||gt,Yt=Yt||Dt,Me=Me||Ft,gt===m&&St===y||(n.blendEquationSeparate(lt[gt],lt[St]),m=gt,y=St),Dt===g&&Ft===_&&Yt===w&&Me===A||(n.blendFuncSeparate(Xt[Dt],Xt[Ft],Xt[Yt],Xt[Me]),g=Dt,_=Ft,w=Yt,A=Me),p=Q,I=null;else if(Q!==p||Re!==I){if(m===Et&&y===Et||(n.blendEquation(32774),m=Et,y=Et),Re)switch(Q){case ot:n.blendFuncSeparate(1,771,1,771);break;case yt:n.blendFunc(1,1);break;case Pt:n.blendFuncSeparate(0,0,769,771);break;case H:n.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",Q)}else switch(Q){case ot:n.blendFuncSeparate(770,771,1,771);break;case yt:n.blendFunc(770,1);break;case Pt:n.blendFunc(0,769);break;case H:n.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",Q)}g=null,_=null,w=null,A=null,p=Q,I=Re}}else d===!0&&(nt(3042),d=!1)}function Bt(Q){F!==Q&&(Q?n.frontFace(2304):n.frontFace(2305),F=Q)}function ue(Q){Q!==vt?(le(2884),Q!==N&&(Q===Ot?n.cullFace(1029):Q===Nt?n.cullFace(1028):n.cullFace(1032))):nt(2884),N=Q}function he(Q,gt,Dt){Q?(le(32823),B===gt&&G===Dt||(n.polygonOffset(gt,Dt),B=gt,G=Dt)):nt(32823)}function Vt(Q){Q===void 0&&(Q=33984+ct-1),et!==Q&&(n.activeTexture(Q),et=Q)}return{buffers:{color:r,depth:o,stencil:s},enable:le,disable:nt,bindFramebuffer:function(Q,gt){return gt===null&&l!==null&&(gt=l),u[Q]!==gt&&(n.bindFramebuffer(Q,gt),u[Q]=gt,i&&(Q===36009&&(u[36160]=gt),Q===36160&&(u[36009]=gt)),!0)},bindXRFramebuffer:function(Q){Q!==l&&(n.bindFramebuffer(36160,Q),l=Q)},useProgram:function(Q){return h!==Q&&(n.useProgram(Q),h=Q,!0)},setBlending:Ut,setMaterial:function(Q,gt){Q.side===K?nt(2884):le(2884);let Dt=Q.side===X;gt&&(Dt=!Dt),Bt(Dt),Q.blending===ot&&Q.transparent===!1?Ut(Ct):Ut(Q.blending,Q.blendEquation,Q.blendSrc,Q.blendDst,Q.blendEquationAlpha,Q.blendSrcAlpha,Q.blendDstAlpha,Q.premultipliedAlpha),o.setFunc(Q.depthFunc),o.setTest(Q.depthTest),o.setMask(Q.depthWrite),r.setMask(Q.colorWrite);const Ft=Q.stencilWrite;s.setTest(Ft),Ft&&(s.setMask(Q.stencilWriteMask),s.setFunc(Q.stencilFunc,Q.stencilRef,Q.stencilFuncMask),s.setOp(Q.stencilFail,Q.stencilZFail,Q.stencilZPass)),he(Q.polygonOffset,Q.polygonOffsetFactor,Q.polygonOffsetUnits),Q.alphaToCoverage===!0?le(32926):nt(32926)},setFlipSided:Bt,setCullFace:ue,setLineWidth:function(Q){Q!==U&&(it&&n.lineWidth(Q),U=Q)},setPolygonOffset:he,setScissorTest:function(Q){Q?le(3089):nt(3089)},activeTexture:Vt,bindTexture:function(Q,gt){et===null&&Vt();let Dt=pt[et];Dt===void 0&&(Dt={type:void 0,texture:void 0},pt[et]=Dt),Dt.type===Q&&Dt.texture===gt||(n.bindTexture(Q,gt||ee[Q]),Dt.type=Q,Dt.texture=gt)},unbindTexture:function(){const Q=pt[et];Q!==void 0&&Q.type!==void 0&&(n.bindTexture(Q.type,null),Q.type=void 0,Q.texture=void 0)},compressedTexImage2D:function(){try{n.compressedTexImage2D.apply(n,arguments)}catch(Q){console.error("THREE.WebGLState:",Q)}},texImage2D:function(){try{n.texImage2D.apply(n,arguments)}catch(Q){console.error("THREE.WebGLState:",Q)}},texImage3D:function(){try{n.texImage3D.apply(n,arguments)}catch(Q){console.error("THREE.WebGLState:",Q)}},scissor:function(Q){_t.equals(Q)===!1&&(n.scissor(Q.x,Q.y,Q.z,Q.w),_t.copy(Q))},viewport:function(Q){xt.equals(Q)===!1&&(n.viewport(Q.x,Q.y,Q.z,Q.w),xt.copy(Q))},reset:function(){n.disable(3042),n.disable(2884),n.disable(2929),n.disable(32823),n.disable(3089),n.disable(2960),n.disable(32926),n.blendEquation(32774),n.blendFunc(1,0),n.blendFuncSeparate(1,0,1,0),n.colorMask(!0,!0,!0,!0),n.clearColor(0,0,0,0),n.depthMask(!0),n.depthFunc(513),n.clearDepth(1),n.stencilMask(4294967295),n.stencilFunc(519,0,4294967295),n.stencilOp(7680,7680,7680),n.clearStencil(0),n.cullFace(1029),n.frontFace(2305),n.polygonOffset(0,0),n.activeTexture(33984),n.bindFramebuffer(36160,null),i===!0&&(n.bindFramebuffer(36009,null),n.bindFramebuffer(36008,null)),n.useProgram(null),n.lineWidth(1),n.scissor(0,0,n.canvas.width,n.canvas.height),n.viewport(0,0,n.canvas.width,n.canvas.height),a={},et=null,pt={},l=null,u={},h=null,d=!1,p=null,m=null,g=null,_=null,y=null,w=null,A=null,I=!1,F=null,N=null,U=null,B=null,G=null,_t.set(0,0,n.canvas.width,n.canvas.height),xt.set(0,0,n.canvas.width,n.canvas.height),r.reset(),o.reset(),s.reset()}}}function _v(n,t,e,i,r,o,s){const a=r.isWebGL2,l=r.maxTextures,u=r.maxCubemapSize,h=r.maxTextureSize,d=r.maxSamples,p=new WeakMap;let m,g=!1;try{g=typeof OffscreenCanvas!="undefined"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(nt,lt){return g?new OffscreenCanvas(nt,lt):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function y(nt,lt,Xt,Ut){let Bt=1;if((nt.width>Ut||nt.height>Ut)&&(Bt=Ut/Math.max(nt.width,nt.height)),Bt<1||lt===!0){if(typeof HTMLImageElement!="undefined"&&nt instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&nt instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&nt instanceof ImageBitmap){const ue=lt?ph:Math.floor,he=ue(Bt*nt.width),Vt=ue(Bt*nt.height);m===void 0&&(m=_(he,Vt));const Q=Xt?_(he,Vt):m;return Q.width=he,Q.height=Vt,Q.getContext("2d").drawImage(nt,0,0,he,Vt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+nt.width+"x"+nt.height+") to ("+he+"x"+Vt+")."),Q}return"data"in nt&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+nt.width+"x"+nt.height+")."),nt}return nt}function w(nt){return Ul(nt.width)&&Ul(nt.height)}function A(nt,lt){return nt.generateMipmaps&<&&nt.minFilter!==fi&&nt.minFilter!==qi}function I(nt,lt,Xt,Ut,Bt=1){n.generateMipmap(nt),i.get(lt).__maxMipLevel=Math.log2(Math.max(Xt,Ut,Bt))}function F(nt,lt,Xt){if(a===!1)return lt;if(nt!==null){if(n[nt]!==void 0)return n[nt];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+nt+"'")}let Ut=lt;return lt===6403&&(Xt===5126&&(Ut=33326),Xt===5131&&(Ut=33325),Xt===5121&&(Ut=33321)),lt===6407&&(Xt===5126&&(Ut=34837),Xt===5131&&(Ut=34843),Xt===5121&&(Ut=32849)),lt===6408&&(Xt===5126&&(Ut=34836),Xt===5131&&(Ut=34842),Xt===5121&&(Ut=32856)),Ut!==33325&&Ut!==33326&&Ut!==34842&&Ut!==34836||t.get("EXT_color_buffer_float"),Ut}function N(nt){return nt===fi||nt===Sr||nt===zs?9728:9729}function U(nt){const lt=nt.target;lt.removeEventListener("dispose",U),function(Xt){const Ut=i.get(Xt);Ut.__webglInit!==void 0&&(n.deleteTexture(Ut.__webglTexture),i.remove(Xt))}(lt),lt.isVideoTexture&&p.delete(lt),s.memory.textures--}function B(nt){const lt=nt.target;lt.removeEventListener("dispose",B),function(Xt){const Ut=Xt.texture,Bt=i.get(Xt),ue=i.get(Ut);if(!!Xt){if(ue.__webglTexture!==void 0&&(n.deleteTexture(ue.__webglTexture),s.memory.textures--),Xt.depthTexture&&Xt.depthTexture.dispose(),Xt.isWebGLCubeRenderTarget)for(let he=0;he<6;he++)n.deleteFramebuffer(Bt.__webglFramebuffer[he]),Bt.__webglDepthbuffer&&n.deleteRenderbuffer(Bt.__webglDepthbuffer[he]);else n.deleteFramebuffer(Bt.__webglFramebuffer),Bt.__webglDepthbuffer&&n.deleteRenderbuffer(Bt.__webglDepthbuffer),Bt.__webglMultisampledFramebuffer&&n.deleteFramebuffer(Bt.__webglMultisampledFramebuffer),Bt.__webglColorRenderbuffer&&n.deleteRenderbuffer(Bt.__webglColorRenderbuffer),Bt.__webglDepthRenderbuffer&&n.deleteRenderbuffer(Bt.__webglDepthRenderbuffer);if(Xt.isWebGLMultipleRenderTargets)for(let he=0,Vt=Ut.length;he<Vt;he++){const Q=i.get(Ut[he]);Q.__webglTexture&&(n.deleteTexture(Q.__webglTexture),s.memory.textures--),i.remove(Ut[he])}i.remove(Ut),i.remove(Xt)}}(lt)}let G=0;function ct(nt,lt){const Xt=i.get(nt);if(nt.isVideoTexture&&function(Ut){const Bt=s.render.frame;p.get(Ut)!==Bt&&(p.set(Ut,Bt),Ut.update())}(nt),nt.version>0&&Xt.__version!==nt.version){const Ut=nt.image;if(Ut===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(Ut.complete!==!1)return void kt(Xt,nt,lt);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}e.activeTexture(33984+lt),e.bindTexture(3553,Xt.__webglTexture)}function it(nt,lt){const Xt=i.get(nt);nt.version>0&&Xt.__version!==nt.version?function(Ut,Bt,ue){if(Bt.image.length!==6)return;pt(Ut,Bt),e.activeTexture(33984+ue),e.bindTexture(34067,Ut.__webglTexture),n.pixelStorei(37440,Bt.flipY),n.pixelStorei(37441,Bt.premultiplyAlpha),n.pixelStorei(3317,Bt.unpackAlignment),n.pixelStorei(37443,0);const he=Bt&&(Bt.isCompressedTexture||Bt.image[0].isCompressedTexture),Vt=Bt.image[0]&&Bt.image[0].isDataTexture,Q=[];for(let Re=0;Re<6;Re++)Q[Re]=he||Vt?Vt?Bt.image[Re].image:Bt.image[Re]:y(Bt.image[Re],!1,!0,u);const gt=Q[0],Dt=w(gt)||a,Ft=o.convert(Bt.format),St=o.convert(Bt.type),Yt=F(Bt.internalFormat,Ft,St);let Me;if(et(34067,Bt,Dt),he){for(let Re=0;Re<6;Re++){Me=Q[Re].mipmaps;for(let Ae=0;Ae<Me.length;Ae++){const si=Me[Ae];Bt.format!==Tr&&Bt.format!==No?Ft!==null?e.compressedTexImage2D(34069+Re,Ae,Yt,si.width,si.height,0,si.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):e.texImage2D(34069+Re,Ae,Yt,si.width,si.height,0,Ft,St,si.data)}}Ut.__maxMipLevel=Me.length-1}else{Me=Bt.mipmaps;for(let Re=0;Re<6;Re++)if(Vt){e.texImage2D(34069+Re,0,Yt,Q[Re].width,Q[Re].height,0,Ft,St,Q[Re].data);for(let Ae=0;Ae<Me.length;Ae++){const si=Me[Ae].image[Re].image;e.texImage2D(34069+Re,Ae+1,Yt,si.width,si.height,0,Ft,St,si.data)}}else{e.texImage2D(34069+Re,0,Yt,Ft,St,Q[Re]);for(let Ae=0;Ae<Me.length;Ae++){const si=Me[Ae];e.texImage2D(34069+Re,Ae+1,Yt,Ft,St,si.image[Re])}}Ut.__maxMipLevel=Me.length}A(Bt,Dt)&&I(34067,Bt,gt.width,gt.height),Ut.__version=Bt.version,Bt.onUpdate&&Bt.onUpdate(Bt)}(Xt,nt,lt):(e.activeTexture(33984+lt),e.bindTexture(34067,Xt.__webglTexture))}const tt={[Ge]:10497,[qe]:33071,[pi]:33648},rt={[fi]:9728,[Sr]:9984,[zs]:9986,[qi]:9729,[as]:9985,[js]:9987};function et(nt,lt,Xt){if(Xt?(n.texParameteri(nt,10242,tt[lt.wrapS]),n.texParameteri(nt,10243,tt[lt.wrapT]),nt!==32879&&nt!==35866||n.texParameteri(nt,32882,tt[lt.wrapR]),n.texParameteri(nt,10240,rt[lt.magFilter]),n.texParameteri(nt,10241,rt[lt.minFilter])):(n.texParameteri(nt,10242,33071),n.texParameteri(nt,10243,33071),nt!==32879&&nt!==35866||n.texParameteri(nt,32882,33071),lt.wrapS===qe&<.wrapT===qe||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(nt,10240,N(lt.magFilter)),n.texParameteri(nt,10241,N(lt.minFilter)),lt.minFilter!==fi&<.minFilter!==qi&&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 Ut=t.get("EXT_texture_filter_anisotropic");if(lt.type===Oo&&t.has("OES_texture_float_linear")===!1||a===!1&<.type===Ws&&t.has("OES_texture_half_float_linear")===!1)return;(lt.anisotropy>1||i.get(lt).__currentAnisotropy)&&(n.texParameterf(nt,Ut.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(lt.anisotropy,r.getMaxAnisotropy())),i.get(lt).__currentAnisotropy=lt.anisotropy)}}function pt(nt,lt){nt.__webglInit===void 0&&(nt.__webglInit=!0,lt.addEventListener("dispose",U),nt.__webglTexture=n.createTexture(),s.memory.textures++)}function kt(nt,lt,Xt){let Ut=3553;lt.isDataTexture2DArray&&(Ut=35866),lt.isDataTexture3D&&(Ut=32879),pt(nt,lt),e.activeTexture(33984+Xt),e.bindTexture(Ut,nt.__webglTexture),n.pixelStorei(37440,lt.flipY),n.pixelStorei(37441,lt.premultiplyAlpha),n.pixelStorei(3317,lt.unpackAlignment),n.pixelStorei(37443,0);const Bt=function(St){return!a&&(St.wrapS!==qe||St.wrapT!==qe||St.minFilter!==fi&&St.minFilter!==qi)}(lt)&&w(lt.image)===!1,ue=y(lt.image,Bt,!1,h),he=w(ue)||a,Vt=o.convert(lt.format);let Q,gt=o.convert(lt.type),Dt=F(lt.internalFormat,Vt,gt);et(Ut,lt,he);const Ft=lt.mipmaps;if(lt.isDepthTexture)Dt=6402,a?Dt=lt.type===Oo?36012:lt.type===Vs?33190:lt.type===Pi?35056:33189:lt.type===Oo&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),lt.format===tn&&Dt===6402&<.type!==Pl&<.type!==Vs&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),lt.type=Pl,gt=o.convert(lt.type)),lt.format===Xs&&Dt===6402&&(Dt=34041,lt.type!==Pi&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),lt.type=Pi,gt=o.convert(lt.type))),e.texImage2D(3553,0,Dt,ue.width,ue.height,0,Vt,gt,null);else if(lt.isDataTexture)if(Ft.length>0&&he){for(let St=0,Yt=Ft.length;St<Yt;St++)Q=Ft[St],e.texImage2D(3553,St,Dt,Q.width,Q.height,0,Vt,gt,Q.data);lt.generateMipmaps=!1,nt.__maxMipLevel=Ft.length-1}else e.texImage2D(3553,0,Dt,ue.width,ue.height,0,Vt,gt,ue.data),nt.__maxMipLevel=0;else if(lt.isCompressedTexture){for(let St=0,Yt=Ft.length;St<Yt;St++)Q=Ft[St],lt.format!==Tr&<.format!==No?Vt!==null?e.compressedTexImage2D(3553,St,Dt,Q.width,Q.height,0,Q.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):e.texImage2D(3553,St,Dt,Q.width,Q.height,0,Vt,gt,Q.data);nt.__maxMipLevel=Ft.length-1}else if(lt.isDataTexture2DArray)e.texImage3D(35866,0,Dt,ue.width,ue.height,ue.depth,0,Vt,gt,ue.data),nt.__maxMipLevel=0;else if(lt.isDataTexture3D)e.texImage3D(32879,0,Dt,ue.width,ue.height,ue.depth,0,Vt,gt,ue.data),nt.__maxMipLevel=0;else if(Ft.length>0&&he){for(let St=0,Yt=Ft.length;St<Yt;St++)Q=Ft[St],e.texImage2D(3553,St,Dt,Vt,gt,Q);lt.generateMipmaps=!1,nt.__maxMipLevel=Ft.length-1}else e.texImage2D(3553,0,Dt,Vt,gt,ue),nt.__maxMipLevel=0;A(lt,he)&&I(Ut,lt,ue.width,ue.height),nt.__version=lt.version,lt.onUpdate&<.onUpdate(lt)}function Lt(nt,lt,Xt,Ut,Bt){const ue=o.convert(Xt.format),he=o.convert(Xt.type),Vt=F(Xt.internalFormat,ue,he);Bt===32879||Bt===35866?e.texImage3D(Bt,0,Vt,lt.width,lt.height,lt.depth,0,ue,he,null):e.texImage2D(Bt,0,Vt,lt.width,lt.height,0,ue,he,null),e.bindFramebuffer(36160,nt),n.framebufferTexture2D(36160,Ut,Bt,i.get(Xt).__webglTexture,0),e.bindFramebuffer(36160,null)}function _t(nt,lt,Xt){if(n.bindRenderbuffer(36161,nt),lt.depthBuffer&&!lt.stencilBuffer){let Ut=33189;if(Xt){const Bt=lt.depthTexture;Bt&&Bt.isDepthTexture&&(Bt.type===Oo?Ut=36012:Bt.type===Vs&&(Ut=33190));const ue=jt(lt);n.renderbufferStorageMultisample(36161,ue,Ut,lt.width,lt.height)}else n.renderbufferStorage(36161,Ut,lt.width,lt.height);n.framebufferRenderbuffer(36160,36096,36161,nt)}else if(lt.depthBuffer&<.stencilBuffer){if(Xt){const Ut=jt(lt);n.renderbufferStorageMultisample(36161,Ut,35056,lt.width,lt.height)}else n.renderbufferStorage(36161,34041,lt.width,lt.height);n.framebufferRenderbuffer(36160,33306,36161,nt)}else{const Ut=lt.isWebGLMultipleRenderTargets===!0?lt.texture[0]:lt.texture,Bt=o.convert(Ut.format),ue=o.convert(Ut.type),he=F(Ut.internalFormat,Bt,ue);if(Xt){const Vt=jt(lt);n.renderbufferStorageMultisample(36161,Vt,he,lt.width,lt.height)}else n.renderbufferStorage(36161,he,lt.width,lt.height)}n.bindRenderbuffer(36161,null)}function xt(nt){const lt=i.get(nt),Xt=nt.isWebGLCubeRenderTarget===!0;if(nt.depthTexture){if(Xt)throw new Error("target.depthTexture not supported in Cube render targets");(function(Ut,Bt){if(Bt&&Bt.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(36160,Ut),!Bt.depthTexture||!Bt.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");i.get(Bt.depthTexture).__webglTexture&&Bt.depthTexture.image.width===Bt.width&&Bt.depthTexture.image.height===Bt.height||(Bt.depthTexture.image.width=Bt.width,Bt.depthTexture.image.height=Bt.height,Bt.depthTexture.needsUpdate=!0),ct(Bt.depthTexture,0);const ue=i.get(Bt.depthTexture).__webglTexture;if(Bt.depthTexture.format===tn)n.framebufferTexture2D(36160,36096,3553,ue,0);else{if(Bt.depthTexture.format!==Xs)throw new Error("Unknown depthTexture format");n.framebufferTexture2D(36160,33306,3553,ue,0)}})(lt.__webglFramebuffer,nt)}else if(Xt){lt.__webglDepthbuffer=[];for(let Ut=0;Ut<6;Ut++)e.bindFramebuffer(36160,lt.__webglFramebuffer[Ut]),lt.__webglDepthbuffer[Ut]=n.createRenderbuffer(),_t(lt.__webglDepthbuffer[Ut],nt,!1)}else e.bindFramebuffer(36160,lt.__webglFramebuffer),lt.__webglDepthbuffer=n.createRenderbuffer(),_t(lt.__webglDepthbuffer,nt,!1);e.bindFramebuffer(36160,null)}function jt(nt){return a&&nt.isWebGLMultisampleRenderTarget?Math.min(d,nt.samples):0}let ee=!1,le=!1;this.allocateTextureUnit=function(){const nt=G;return nt>=l&&console.warn("THREE.WebGLTextures: Trying to use "+nt+" texture units while this GPU supports only "+l),G+=1,nt},this.resetTextureUnits=function(){G=0},this.setTexture2D=ct,this.setTexture2DArray=function(nt,lt){const Xt=i.get(nt);nt.version>0&&Xt.__version!==nt.version?kt(Xt,nt,lt):(e.activeTexture(33984+lt),e.bindTexture(35866,Xt.__webglTexture))},this.setTexture3D=function(nt,lt){const Xt=i.get(nt);nt.version>0&&Xt.__version!==nt.version?kt(Xt,nt,lt):(e.activeTexture(33984+lt),e.bindTexture(32879,Xt.__webglTexture))},this.setTextureCube=it,this.setupRenderTarget=function(nt){const lt=nt.texture,Xt=i.get(nt),Ut=i.get(lt);nt.addEventListener("dispose",B),nt.isWebGLMultipleRenderTargets!==!0&&(Ut.__webglTexture=n.createTexture(),Ut.__version=lt.version,s.memory.textures++);const Bt=nt.isWebGLCubeRenderTarget===!0,ue=nt.isWebGLMultipleRenderTargets===!0,he=nt.isWebGLMultisampleRenderTarget===!0,Vt=lt.isDataTexture3D||lt.isDataTexture2DArray,Q=w(nt)||a;if(!a||lt.format!==No||lt.type!==Oo&<.type!==Ws||(lt.format=Tr,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),Bt){Xt.__webglFramebuffer=[];for(let gt=0;gt<6;gt++)Xt.__webglFramebuffer[gt]=n.createFramebuffer()}else if(Xt.__webglFramebuffer=n.createFramebuffer(),ue)if(r.drawBuffers){const gt=nt.texture;for(let Dt=0,Ft=gt.length;Dt<Ft;Dt++){const St=i.get(gt[Dt]);St.__webglTexture===void 0&&(St.__webglTexture=n.createTexture(),s.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(he)if(a){Xt.__webglMultisampledFramebuffer=n.createFramebuffer(),Xt.__webglColorRenderbuffer=n.createRenderbuffer(),n.bindRenderbuffer(36161,Xt.__webglColorRenderbuffer);const gt=o.convert(lt.format),Dt=o.convert(lt.type),Ft=F(lt.internalFormat,gt,Dt),St=jt(nt);n.renderbufferStorageMultisample(36161,St,Ft,nt.width,nt.height),e.bindFramebuffer(36160,Xt.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(36160,36064,36161,Xt.__webglColorRenderbuffer),n.bindRenderbuffer(36161,null),nt.depthBuffer&&(Xt.__webglDepthRenderbuffer=n.createRenderbuffer(),_t(Xt.__webglDepthRenderbuffer,nt,!0)),e.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(Bt){e.bindTexture(34067,Ut.__webglTexture),et(34067,lt,Q);for(let gt=0;gt<6;gt++)Lt(Xt.__webglFramebuffer[gt],nt,lt,36064,34069+gt);A(lt,Q)&&I(34067,lt,nt.width,nt.height),e.bindTexture(34067,null)}else if(ue){const gt=nt.texture;for(let Dt=0,Ft=gt.length;Dt<Ft;Dt++){const St=gt[Dt],Yt=i.get(St);e.bindTexture(3553,Yt.__webglTexture),et(3553,St,Q),Lt(Xt.__webglFramebuffer,nt,St,36064+Dt,3553),A(St,Q)&&I(3553,St,nt.width,nt.height)}e.bindTexture(3553,null)}else{let gt=3553;Vt&&(a?gt=lt.isDataTexture3D?32879:35866:console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")),e.bindTexture(gt,Ut.__webglTexture),et(gt,lt,Q),Lt(Xt.__webglFramebuffer,nt,lt,36064,gt),A(lt,Q)&&I(gt,lt,nt.width,nt.height,nt.depth),e.bindTexture(gt,null)}nt.depthBuffer&&xt(nt)},this.updateRenderTargetMipmap=function(nt){const lt=w(nt)||a,Xt=nt.isWebGLMultipleRenderTargets===!0?nt.texture:[nt.texture];for(let Ut=0,Bt=Xt.length;Ut<Bt;Ut++){const ue=Xt[Ut];if(A(ue,lt)){const he=nt.isWebGLCubeRenderTarget?34067:3553,Vt=i.get(ue).__webglTexture;e.bindTexture(he,Vt),I(he,ue,nt.width,nt.height),e.bindTexture(he,null)}}},this.updateMultisampleRenderTarget=function(nt){if(nt.isWebGLMultisampleRenderTarget)if(a){const lt=nt.width,Xt=nt.height;let Ut=16384;nt.depthBuffer&&(Ut|=256),nt.stencilBuffer&&(Ut|=1024);const Bt=i.get(nt);e.bindFramebuffer(36008,Bt.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,Bt.__webglFramebuffer),n.blitFramebuffer(0,0,lt,Xt,0,0,lt,Xt,Ut,9728),e.bindFramebuffer(36008,null),e.bindFramebuffer(36009,Bt.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(nt,lt){nt&&nt.isWebGLRenderTarget&&(ee===!1&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),ee=!0),nt=nt.texture),ct(nt,lt)},this.safeSetTextureCube=function(nt,lt){nt&&nt.isWebGLCubeRenderTarget&&(le===!1&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),le=!0),nt=nt.texture),it(nt,lt)}}function Wf(n,t,e){const i=e.isWebGL2;return{convert:function(r){let o;if(r===ls)return 5121;if(r===Wp)return 32819;if(r===Xp)return 32820;if(r===qp)return 33635;if(r===zp)return 5120;if(r===jp)return 5122;if(r===Pl)return 5123;if(r===Vp)return 5124;if(r===Vs)return 5125;if(r===Oo)return 5126;if(r===Ws)return i?5131:(o=t.get("OES_texture_half_float"),o!==null?o.HALF_FLOAT_OES:null);if(r===Fi)return 6406;if(r===No)return 6407;if(r===Tr)return 6408;if(r===Yp)return 6409;if(r===Fc)return 6410;if(r===tn)return 6402;if(r===Xs)return 34041;if(r===Na)return 6403;if(r===Bc)return 36244;if(r===ju)return 33319;if(r===Er)return 33320;if(r===kc)return 36248;if(r===Uc)return 36249;if(r===Vu||r===Wu||r===Xu||r===qu){if(o=t.get("WEBGL_compressed_texture_s3tc"),o===null)return null;if(r===Vu)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===Wu)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===Xu)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===qu)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(r===ir||r===Gc||r===hr||r===Hc){if(o=t.get("WEBGL_compressed_texture_pvrtc"),o===null)return null;if(r===ir)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===Gc)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===hr)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===Hc)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(r===zc)return o=t.get("WEBGL_compressed_texture_etc1"),o!==null?o.COMPRESSED_RGB_ETC1_WEBGL:null;if((r===fo||r===Da)&&(o=t.get("WEBGL_compressed_texture_etc"),o!==null)){if(r===fo)return o.COMPRESSED_RGB8_ETC2;if(r===Da)return o.COMPRESSED_RGBA8_ETC2_EAC}return r===Yu||r===Gi||r===Do||r===$u||r===Jp||r===Ju||r===Zp||r===jc||r===Il||r===qs||r===Kp||r===Vc||r===Wc||r===Zu||r===Xc||r===Qu||r===th||r===qc||r===cr||r===eh||r===Fa||r===Yc||r===$c||r===Qp||r===tf||r===ef||r===nf||r===Ys?(o=t.get("WEBGL_compressed_texture_astc"),o!==null?r:null):r===Ku?(o=t.get("EXT_texture_compression_bptc"),o!==null?r:null):r===Pi?i?34042:(o=t.get("WEBGL_depth_texture"),o!==null?o.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}class Nd extends fn{constructor(t=[]){super(),this.cameras=t}}Nd.prototype.isArrayCamera=!0;class pa extends hi{constructor(){super(),this.type="Group"}}pa.prototype.isGroup=!0;const Dd={type:"move"};class tu{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new pa,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 pa,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new S,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new S),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new pa,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new S,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new S),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,i){let r=null,o=null,s=null;const a=this._targetRay,l=this._grip,u=this._hand;if(t&&e.session.visibilityState!=="visible-blurred")if(a!==null&&(r=e.getPose(t.targetRaySpace,i),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(Dd))),u&&t.hand){s=!0;for(const _ of t.hand.values()){const y=e.getJointPose(_,i);if(u.joints[_.jointName]===void 0){const A=new pa;A.matrixAutoUpdate=!1,A.visible=!1,u.joints[_.jointName]=A,u.add(A)}const w=u.joints[_.jointName];y!==null&&(w.matrix.fromArray(y.transform.matrix),w.matrix.decompose(w.position,w.rotation,w.scale),w.jointRadius=y.radius),w.visible=y!==null}const h=u.joints["index-finger-tip"],d=u.joints["thumb-tip"],p=h.position.distanceTo(d.position),m=.02,g=.005;u.inputState.pinching&&p>m+g?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!u.inputState.pinching&&p<=m-g&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(o=e.getPose(t.gripSpace,i),o!==null&&(l.matrix.fromArray(o.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),o.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(o.linearVelocity)):l.hasLinearVelocity=!1,o.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(o.angularVelocity)):l.hasAngularVelocity=!1));return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=o!==null),u!==null&&(u.visible=s!==null),this}}class yv extends ko{constructor(t,e){super();const i=this,r=t.state;let o=null,s=1,a=null,l="local-floor",u=null,h=null,d=null,p=null;const m=[],g=new Map,_=new fn;_.layers.enable(1),_.viewport=new Li;const y=new fn;y.layers.enable(2),y.viewport=new Li;const w=[_,y],A=new Nd;A.layers.enable(1),A.layers.enable(2);let I=null,F=null;function N(et){const pt=g.get(et.inputSource);pt&&pt.dispatchEvent({type:et.type,data:et.inputSource})}function U(){g.forEach(function(et,pt){et.disconnect(pt)}),g.clear(),I=null,F=null,r.bindXRFramebuffer(null),t.setRenderTarget(t.getRenderTarget()),rt.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}function B(et){const pt=o.inputSources;for(let kt=0;kt<m.length;kt++)g.set(pt[kt],m[kt]);for(let kt=0;kt<et.removed.length;kt++){const Lt=et.removed[kt],_t=g.get(Lt);_t&&(_t.dispatchEvent({type:"disconnected",data:Lt}),g.delete(Lt))}for(let kt=0;kt<et.added.length;kt++){const Lt=et.added[kt],_t=g.get(Lt);_t&&_t.dispatchEvent({type:"connected",data:Lt})}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(et){let pt=m[et];return pt===void 0&&(pt=new tu,m[et]=pt),pt.getTargetRaySpace()},this.getControllerGrip=function(et){let pt=m[et];return pt===void 0&&(pt=new tu,m[et]=pt),pt.getGripSpace()},this.getHand=function(et){let pt=m[et];return pt===void 0&&(pt=new tu,m[et]=pt),pt.getHandSpace()},this.setFramebufferScaleFactor=function(et){s=et,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(et){l=et,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return a},this.getSession=function(){return o},this.setSession=async function(et){if(o=et,o!==null){o.addEventListener("select",N),o.addEventListener("selectstart",N),o.addEventListener("selectend",N),o.addEventListener("squeeze",N),o.addEventListener("squeezestart",N),o.addEventListener("squeezeend",N),o.addEventListener("end",U),o.addEventListener("inputsourceschange",B);const pt=e.getContextAttributes();if(pt.xrCompatible!==!0&&await e.makeXRCompatible(),o.renderState.layers===void 0){const kt={antialias:pt.antialias,alpha:pt.alpha,depth:pt.depth,stencil:pt.stencil,framebufferScaleFactor:s},Lt=new XRWebGLLayer(o,e,kt);o.updateRenderState({baseLayer:Lt})}else{let kt=0;pt.depth&&(kt=pt.stencil?34041:6402);const Lt={colorFormat:pt.alpha?6408:6407,depthFormat:kt,scaleFactor:s};h=new XRWebGLBinding(o,e),p=h.createProjectionLayer(Lt),d=e.createFramebuffer(),o.updateRenderState({layers:[p]})}a=await o.requestReferenceSpace(l),rt.setContext(o),rt.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}};const G=new S,ct=new S;function it(et,pt){pt===null?et.matrixWorld.copy(et.matrix):et.matrixWorld.multiplyMatrices(pt.matrixWorld,et.matrix),et.matrixWorldInverse.copy(et.matrixWorld).invert()}this.updateCamera=function(et){if(o===null)return;A.near=y.near=_.near=et.near,A.far=y.far=_.far=et.far,I===A.near&&F===A.far||(o.updateRenderState({depthNear:A.near,depthFar:A.far}),I=A.near,F=A.far);const pt=et.parent,kt=A.cameras;it(A,pt);for(let _t=0;_t<kt.length;_t++)it(kt[_t],pt);A.matrixWorld.decompose(A.position,A.quaternion,A.scale),et.position.copy(A.position),et.quaternion.copy(A.quaternion),et.scale.copy(A.scale),et.matrix.copy(A.matrix),et.matrixWorld.copy(A.matrixWorld);const Lt=et.children;for(let _t=0,xt=Lt.length;_t<xt;_t++)Lt[_t].updateMatrixWorld(!0);kt.length===2?function(_t,xt,jt){G.setFromMatrixPosition(xt.matrixWorld),ct.setFromMatrixPosition(jt.matrixWorld);const ee=G.distanceTo(ct),le=xt.projectionMatrix.elements,nt=jt.projectionMatrix.elements,lt=le[14]/(le[10]-1),Xt=le[14]/(le[10]+1),Ut=(le[9]+1)/le[5],Bt=(le[9]-1)/le[5],ue=(le[8]-1)/le[0],he=(nt[8]+1)/nt[0],Vt=lt*ue,Q=lt*he,gt=ee/(-ue+he),Dt=gt*-ue;xt.matrixWorld.decompose(_t.position,_t.quaternion,_t.scale),_t.translateX(Dt),_t.translateZ(gt),_t.matrixWorld.compose(_t.position,_t.quaternion,_t.scale),_t.matrixWorldInverse.copy(_t.matrixWorld).invert();const Ft=lt+gt,St=Xt+gt,Yt=Vt-Dt,Me=Q+(ee-Dt),Re=Ut*Xt/St*Ft,Ae=Bt*Xt/St*Ft;_t.projectionMatrix.makePerspective(Yt,Me,Re,Ae,Ft,St)}(A,_,y):A.projectionMatrix.copy(_.projectionMatrix)},this.getCamera=function(){return A};let tt=null;const rt=new yd;rt.setAnimationLoop(function(et,pt){if(u=pt.getViewerPose(a),u!==null){const Lt=u.views,_t=o.renderState.baseLayer;o.renderState.layers===void 0&&r.bindXRFramebuffer(_t.framebuffer);let xt=!1;Lt.length!==A.cameras.length&&(A.cameras.length=0,xt=!0);for(let jt=0;jt<Lt.length;jt++){const ee=Lt[jt];let le=null;if(o.renderState.layers===void 0)le=_t.getViewport(ee);else{const lt=h.getViewSubImage(p,ee);r.bindXRFramebuffer(d),e.framebufferTexture2D(36160,36064,3553,lt.colorTexture,0),lt.depthStencilTexture!==void 0&&e.framebufferTexture2D(36160,36096,3553,lt.depthStencilTexture,0),le=lt.viewport}const nt=w[jt];nt.matrix.fromArray(ee.transform.matrix),nt.projectionMatrix.fromArray(ee.projectionMatrix),nt.viewport.set(le.x,le.y,le.width,le.height),jt===0&&A.matrix.copy(nt.matrix),xt===!0&&A.cameras.push(nt)}}const kt=o.inputSources;for(let Lt=0;Lt<m.length;Lt++){const _t=m[Lt],xt=kt[Lt];_t.update(xt,pt,a)}tt&&tt(et,pt)}),this.setAnimationLoop=function(et){tt=et},this.dispose=function(){}}}function xv(n){function t(i,r){i.opacity.value=r.opacity,r.color&&i.diffuse.value.copy(r.color),r.emissive&&i.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),r.map&&(i.map.value=r.map),r.alphaMap&&(i.alphaMap.value=r.alphaMap),r.specularMap&&(i.specularMap.value=r.specularMap);const o=n.get(r).envMap;if(o){i.envMap.value=o,i.flipEnvMap.value=o.isCubeTexture&&o._needsFlipEnvMap?-1:1,i.reflectivity.value=r.reflectivity,i.refractionRatio.value=r.refractionRatio;const l=n.get(o).__maxMipLevel;l!==void 0&&(i.maxMipLevel.value=l)}let s,a;r.lightMap&&(i.lightMap.value=r.lightMap,i.lightMapIntensity.value=r.lightMapIntensity),r.aoMap&&(i.aoMap.value=r.aoMap,i.aoMapIntensity.value=r.aoMapIntensity),r.map?s=r.map:r.specularMap?s=r.specularMap:r.displacementMap?s=r.displacementMap:r.normalMap?s=r.normalMap:r.bumpMap?s=r.bumpMap:r.roughnessMap?s=r.roughnessMap:r.metalnessMap?s=r.metalnessMap:r.alphaMap?s=r.alphaMap:r.emissiveMap?s=r.emissiveMap:r.clearcoatMap?s=r.clearcoatMap:r.clearcoatNormalMap?s=r.clearcoatNormalMap:r.clearcoatRoughnessMap&&(s=r.clearcoatRoughnessMap),s!==void 0&&(s.isWebGLRenderTarget&&(s=s.texture),s.matrixAutoUpdate===!0&&s.updateMatrix(),i.uvTransform.value.copy(s.matrix)),r.aoMap?a=r.aoMap:r.lightMap&&(a=r.lightMap),a!==void 0&&(a.isWebGLRenderTarget&&(a=a.texture),a.matrixAutoUpdate===!0&&a.updateMatrix(),i.uv2Transform.value.copy(a.matrix))}function e(i,r){i.roughness.value=r.roughness,i.metalness.value=r.metalness,r.roughnessMap&&(i.roughnessMap.value=r.roughnessMap),r.metalnessMap&&(i.metalnessMap.value=r.metalnessMap),r.emissiveMap&&(i.emissiveMap.value=r.emissiveMap),r.bumpMap&&(i.bumpMap.value=r.bumpMap,i.bumpScale.value=r.bumpScale,r.side===X&&(i.bumpScale.value*=-1)),r.normalMap&&(i.normalMap.value=r.normalMap,i.normalScale.value.copy(r.normalScale),r.side===X&&i.normalScale.value.negate()),r.displacementMap&&(i.displacementMap.value=r.displacementMap,i.displacementScale.value=r.displacementScale,i.displacementBias.value=r.displacementBias),n.get(r).envMap&&(i.envMapIntensity.value=r.envMapIntensity)}return{refreshFogUniforms:function(i,r){i.fogColor.value.copy(r.color),r.isFog?(i.fogNear.value=r.near,i.fogFar.value=r.far):r.isFogExp2&&(i.fogDensity.value=r.density)},refreshMaterialUniforms:function(i,r,o,s,a){r.isMeshBasicMaterial?t(i,r):r.isMeshLambertMaterial?(t(i,r),function(l,u){u.emissiveMap&&(l.emissiveMap.value=u.emissiveMap)}(i,r)):r.isMeshToonMaterial?(t(i,r),function(l,u){u.gradientMap&&(l.gradientMap.value=u.gradientMap),u.emissiveMap&&(l.emissiveMap.value=u.emissiveMap),u.bumpMap&&(l.bumpMap.value=u.bumpMap,l.bumpScale.value=u.bumpScale,u.side===X&&(l.bumpScale.value*=-1)),u.normalMap&&(l.normalMap.value=u.normalMap,l.normalScale.value.copy(u.normalScale),u.side===X&&l.normalScale.value.negate()),u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias)}(i,r)):r.isMeshPhongMaterial?(t(i,r),function(l,u){l.specular.value.copy(u.specular),l.shininess.value=Math.max(u.shininess,1e-4),u.emissiveMap&&(l.emissiveMap.value=u.emissiveMap),u.bumpMap&&(l.bumpMap.value=u.bumpMap,l.bumpScale.value=u.bumpScale,u.side===X&&(l.bumpScale.value*=-1)),u.normalMap&&(l.normalMap.value=u.normalMap,l.normalScale.value.copy(u.normalScale),u.side===X&&l.normalScale.value.negate()),u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias)}(i,r)):r.isMeshStandardMaterial?(t(i,r),r.isMeshPhysicalMaterial?function(l,u,h){e(l,u),l.reflectivity.value=u.reflectivity,l.clearcoat.value=u.clearcoat,l.clearcoatRoughness.value=u.clearcoatRoughness,u.sheen&&l.sheen.value.copy(u.sheen),u.clearcoatMap&&(l.clearcoatMap.value=u.clearcoatMap),u.clearcoatRoughnessMap&&(l.clearcoatRoughnessMap.value=u.clearcoatRoughnessMap),u.clearcoatNormalMap&&(l.clearcoatNormalScale.value.copy(u.clearcoatNormalScale),l.clearcoatNormalMap.value=u.clearcoatNormalMap,u.side===X&&l.clearcoatNormalScale.value.negate()),l.transmission.value=u.transmission,u.transmissionMap&&(l.transmissionMap.value=u.transmissionMap),u.transmission>0&&(l.transmissionSamplerMap.value=h.texture,l.transmissionSamplerSize.value.set(h.width,h.height)),l.thickness.value=u.thickness,u.thicknessMap&&(l.thicknessMap.value=u.thicknessMap),l.attenuationDistance.value=u.attenuationDistance,l.attenuationColor.value.copy(u.attenuationColor)}(i,r,a):e(i,r)):r.isMeshMatcapMaterial?(t(i,r),function(l,u){u.matcap&&(l.matcap.value=u.matcap),u.bumpMap&&(l.bumpMap.value=u.bumpMap,l.bumpScale.value=u.bumpScale,u.side===X&&(l.bumpScale.value*=-1)),u.normalMap&&(l.normalMap.value=u.normalMap,l.normalScale.value.copy(u.normalScale),u.side===X&&l.normalScale.value.negate()),u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias)}(i,r)):r.isMeshDepthMaterial?(t(i,r),function(l,u){u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias)}(i,r)):r.isMeshDistanceMaterial?(t(i,r),function(l,u){u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias),l.referencePosition.value.copy(u.referencePosition),l.nearDistance.value=u.nearDistance,l.farDistance.value=u.farDistance}(i,r)):r.isMeshNormalMaterial?(t(i,r),function(l,u){u.bumpMap&&(l.bumpMap.value=u.bumpMap,l.bumpScale.value=u.bumpScale,u.side===X&&(l.bumpScale.value*=-1)),u.normalMap&&(l.normalMap.value=u.normalMap,l.normalScale.value.copy(u.normalScale),u.side===X&&l.normalScale.value.negate()),u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias)}(i,r)):r.isLineBasicMaterial?(function(l,u){l.diffuse.value.copy(u.color),l.opacity.value=u.opacity}(i,r),r.isLineDashedMaterial&&function(l,u){l.dashSize.value=u.dashSize,l.totalSize.value=u.dashSize+u.gapSize,l.scale.value=u.scale}(i,r)):r.isPointsMaterial?function(l,u,h,d){l.diffuse.value.copy(u.color),l.opacity.value=u.opacity,l.size.value=u.size*h,l.scale.value=.5*d,u.map&&(l.map.value=u.map),u.alphaMap&&(l.alphaMap.value=u.alphaMap);let p;u.map?p=u.map:u.alphaMap&&(p=u.alphaMap),p!==void 0&&(p.matrixAutoUpdate===!0&&p.updateMatrix(),l.uvTransform.value.copy(p.matrix))}(i,r,o,s):r.isSpriteMaterial?function(l,u){l.diffuse.value.copy(u.color),l.opacity.value=u.opacity,l.rotation.value=u.rotation,u.map&&(l.map.value=u.map),u.alphaMap&&(l.alphaMap.value=u.alphaMap);let h;u.map?h=u.map:u.alphaMap&&(h=u.alphaMap),h!==void 0&&(h.matrixAutoUpdate===!0&&h.updateMatrix(),l.uvTransform.value.copy(h.matrix))}(i,r):r.isShadowMaterial?(i.color.value.copy(r.color),i.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function Oi(n={}){const t=n.canvas!==void 0?n.canvas:function(){const dt=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return dt.style.display="block",dt}(),e=n.context!==void 0?n.context:null,i=n.alpha!==void 0&&n.alpha,r=n.depth===void 0||n.depth,o=n.stencil===void 0||n.stencil,s=n.antialias!==void 0&&n.antialias,a=n.premultipliedAlpha===void 0||n.premultipliedAlpha,l=n.preserveDrawingBuffer!==void 0&&n.preserveDrawingBuffer,u=n.powerPreference!==void 0?n.powerPreference:"default",h=n.failIfMajorPerformanceCaveat!==void 0&&n.failIfMajorPerformanceCaveat;let d=null,p=null;const m=[],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=Be,this.physicallyCorrectLights=!1,this.toneMapping=Zr,this.toneMappingExposure=1;const _=this;let y=!1,w=0,A=0,I=null,F=-1,N=null;const U=new Li,B=new Li;let G=null,ct=t.width,it=t.height,tt=1,rt=null,et=null;const pt=new Li(0,0,ct,it),kt=new Li(0,0,ct,it);let Lt=!1;const _t=[],xt=new Ka;let jt=!1,ee=!1,le=null;const nt=new Ee,lt=new S,Xt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Ut(){return I===null?tt:1}let Bt,ue,he,Vt,Q,gt,Dt,Ft,St,Yt,Me,Re,Ae,si,Tn,Ni,Yr,Rp,Cp,Pp,Fr,$r,fe=e;function FS(dt,Kt){for(let Ht=0;Ht<dt.length;Ht++){const te=dt[Ht],ve=t.getContext(te,Kt);if(ve!==null)return ve}return null}try{const dt={alpha:i,depth:r,stencil:o,antialias:s,premultipliedAlpha:a,preserveDrawingBuffer:l,powerPreference:u,failIfMajorPerformanceCaveat:h};if(t.addEventListener("webglcontextlost",kS,!1),t.addEventListener("webglcontextrestored",US,!1),fe===null){const Kt=["webgl2","webgl","experimental-webgl"];if(_.isWebGL1Renderer===!0&&Kt.shift(),fe=FS(Kt,dt),fe===null)throw FS(Kt)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}fe.getShaderPrecisionFormat===void 0&&(fe.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(dt){throw console.error("THREE.WebGLRenderer: "+dt.message),dt}function BS(){Bt=new Wg(fe),ue=new vf(fe,Bt,n),Bt.init(ue),Fr=new Wf(fe,Bt,ue),he=new Fh(fe,Bt,ue),_t[0]=1029,Vt=new Zl,Q=new Nh,gt=new _v(fe,Bt,he,Q,ue,Fr,Vt),Dt=new yf(_),Ft=new jg(fe,ue),$r=new Jl(fe,Bt,Ft,ue),St=new xd(fe,Ft,Vt,$r),Yt=new Ah(fe,St,Ft,Vt),Rp=new wf(fe),Tn=new _f(Q),Me=new Gf(_,Dt,Bt,ue,$r,Tn),Re=new xv(Q),Ae=new vv(Q),si=new Vf(Bt,ue),Yr=new Vg(_,Dt,he,Yt,a),Ni=new Od(_,Yt,ue),Cp=new gf(fe,Bt,Vt,ue),Pp=new xf(fe,Bt,Vt,ue),Vt.programs=Me.programs,_.capabilities=ue,_.extensions=Bt,_.properties=Q,_.renderLists=Ae,_.shadowMap=Ni,_.state=he,_.info=Vt}BS();const ho=new yv(_,fe);function kS(dt){dt.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),y=!0}function US(){console.log("THREE.WebGLRenderer: Context Restored."),y=!1;const dt=Vt.autoReset,Kt=Ni.enabled,Ht=Ni.autoUpdate,te=Ni.needsUpdate,ve=Ni.type;BS(),Vt.autoReset=dt,Ni.enabled=Kt,Ni.autoUpdate=Ht,Ni.needsUpdate=te,Ni.type=ve}function GS(dt){const Kt=dt.target;Kt.removeEventListener("dispose",GS),function(Ht){(function(te){const ve=Q.get(te).programs;ve!==void 0&&ve.forEach(function(Ai){Me.releaseProgram(Ai)})})(Ht),Q.remove(Ht)}(Kt)}this.xr=ho,this.getContext=function(){return fe},this.getContextAttributes=function(){return fe.getContextAttributes()},this.forceContextLoss=function(){const dt=Bt.get("WEBGL_lose_context");dt&&dt.loseContext()},this.forceContextRestore=function(){const dt=Bt.get("WEBGL_lose_context");dt&&dt.restoreContext()},this.getPixelRatio=function(){return tt},this.setPixelRatio=function(dt){dt!==void 0&&(tt=dt,this.setSize(ct,it,!1))},this.getSize=function(dt){return dt.set(ct,it)},this.setSize=function(dt,Kt,Ht){ho.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(ct=dt,it=Kt,t.width=Math.floor(dt*tt),t.height=Math.floor(Kt*tt),Ht!==!1&&(t.style.width=dt+"px",t.style.height=Kt+"px"),this.setViewport(0,0,dt,Kt))},this.getDrawingBufferSize=function(dt){return dt.set(ct*tt,it*tt).floor()},this.setDrawingBufferSize=function(dt,Kt,Ht){ct=dt,it=Kt,tt=Ht,t.width=Math.floor(dt*Ht),t.height=Math.floor(Kt*Ht),this.setViewport(0,0,dt,Kt)},this.getCurrentViewport=function(dt){return dt.copy(U)},this.getViewport=function(dt){return dt.copy(pt)},this.setViewport=function(dt,Kt,Ht,te){dt.isVector4?pt.set(dt.x,dt.y,dt.z,dt.w):pt.set(dt,Kt,Ht,te),he.viewport(U.copy(pt).multiplyScalar(tt).floor())},this.getScissor=function(dt){return dt.copy(kt)},this.setScissor=function(dt,Kt,Ht,te){dt.isVector4?kt.set(dt.x,dt.y,dt.z,dt.w):kt.set(dt,Kt,Ht,te),he.scissor(B.copy(kt).multiplyScalar(tt).floor())},this.getScissorTest=function(){return Lt},this.setScissorTest=function(dt){he.setScissorTest(Lt=dt)},this.setOpaqueSort=function(dt){rt=dt},this.setTransparentSort=function(dt){et=dt},this.getClearColor=function(dt){return dt.copy(Yr.getClearColor())},this.setClearColor=function(){Yr.setClearColor.apply(Yr,arguments)},this.getClearAlpha=function(){return Yr.getClearAlpha()},this.setClearAlpha=function(){Yr.setClearAlpha.apply(Yr,arguments)},this.clear=function(dt,Kt,Ht){let te=0;(dt===void 0||dt)&&(te|=16384),(Kt===void 0||Kt)&&(te|=256),(Ht===void 0||Ht)&&(te|=1024),fe.clear(te)},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",kS,!1),t.removeEventListener("webglcontextrestored",US,!1),Ae.dispose(),si.dispose(),Q.dispose(),Dt.dispose(),Yt.dispose(),$r.dispose(),ho.dispose(),ho.removeEventListener("sessionstart",HS),ho.removeEventListener("sessionend",zS),le&&(le.dispose(),le=null),Uu.stop()},this.renderBufferImmediate=function(dt,Kt){$r.initAttributes();const Ht=Q.get(dt);dt.hasPositions&&!Ht.position&&(Ht.position=fe.createBuffer()),dt.hasNormals&&!Ht.normal&&(Ht.normal=fe.createBuffer()),dt.hasUvs&&!Ht.uv&&(Ht.uv=fe.createBuffer()),dt.hasColors&&!Ht.color&&(Ht.color=fe.createBuffer());const te=Kt.getAttributes();dt.hasPositions&&(fe.bindBuffer(34962,Ht.position),fe.bufferData(34962,dt.positionArray,35048),$r.enableAttribute(te.position),fe.vertexAttribPointer(te.position,3,5126,!1,0,0)),dt.hasNormals&&(fe.bindBuffer(34962,Ht.normal),fe.bufferData(34962,dt.normalArray,35048),$r.enableAttribute(te.normal),fe.vertexAttribPointer(te.normal,3,5126,!1,0,0)),dt.hasUvs&&(fe.bindBuffer(34962,Ht.uv),fe.bufferData(34962,dt.uvArray,35048),$r.enableAttribute(te.uv),fe.vertexAttribPointer(te.uv,2,5126,!1,0,0)),dt.hasColors&&(fe.bindBuffer(34962,Ht.color),fe.bufferData(34962,dt.colorArray,35048),$r.enableAttribute(te.color),fe.vertexAttribPointer(te.color,3,5126,!1,0,0)),$r.disableUnusedAttributes(),fe.drawArrays(4,0,dt.count),dt.count=0},this.renderBufferDirect=function(dt,Kt,Ht,te,ve,Ai){Kt===null&&(Kt=Xt);const ai=ve.isMesh&&ve.matrixWorld.determinant()<0,we=WS(dt,Kt,te,ve);he.setMaterial(te,ai);let _i=Ht.index;const Xe=Ht.attributes.position;if(_i===null){if(Xe===void 0||Xe.count===0)return}else if(_i.count===0)return;let wi,ni=1;te.wireframe===!0&&(_i=St.getWireframeAttribute(Ht),ni=2),(te.morphTargets||te.morphNormals)&&Rp.update(ve,Ht,te,we),$r.setup(ve,te,we,Ht,_i);let yi=Cp;_i!==null&&(wi=Ft.get(_i),yi=Pp,yi.setIndex(wi));const Un=_i!==null?_i.count:Xe.count,Zi=Ht.drawRange.start*ni,ss=Ht.drawRange.count*ni,Xi=Ai!==null?Ai.start*ni:0,Us=Ai!==null?Ai.count*ni:1/0,Xn=Math.max(Zi,Xi),co=Math.min(Un,Zi+ss,Xi+Us)-1,wr=Math.max(0,co-Xn+1);if(wr!==0){if(ve.isMesh)te.wireframe===!0?(he.setLineWidth(te.wireframeLinewidth*Ut()),yi.setMode(1)):yi.setMode(4);else if(ve.isLine){let Ip=te.linewidth;Ip===void 0&&(Ip=1),he.setLineWidth(Ip*Ut()),ve.isLineSegments?yi.setMode(1):ve.isLineLoop?yi.setMode(2):yi.setMode(3)}else ve.isPoints?yi.setMode(0):ve.isSprite&&yi.setMode(4);if(ve.isInstancedMesh)yi.renderInstances(Xn,wr,ve.count);else if(Ht.isInstancedBufferGeometry){const Ip=Math.min(Ht.instanceCount,Ht._maxInstanceCount);yi.renderInstances(Xn,wr,Ip)}else yi.render(Xn,wr)}},this.compile=function(dt,Kt){p=si.get(dt),p.init(),dt.traverseVisible(function(Ht){Ht.isLight&&Ht.layers.test(Kt.layers)&&(p.pushLight(Ht),Ht.castShadow&&p.pushShadow(Ht))}),p.setupLights(),dt.traverse(function(Ht){const te=Ht.material;if(te)if(Array.isArray(te))for(let ve=0;ve<te.length;ve++)G_(te[ve],dt,Ht);else G_(te,dt,Ht)})};let U_=null;function HS(){Uu.stop()}function zS(){Uu.start()}const Uu=new yd;function Mg(dt,Kt,Ht){const te=Kt.isScene===!0?Kt.overrideMaterial:null;for(let ve=0,Ai=dt.length;ve<Ai;ve++){const ai=dt[ve],we=ai.object,_i=ai.geometry,Xe=te===null?ai.material:te,wi=ai.group;if(Ht.isArrayCamera){const ni=Ht.cameras;for(let yi=0,Un=ni.length;yi<Un;yi++){const Zi=ni[yi];we.layers.test(Zi.layers)&&(he.viewport(U.copy(Zi.viewport)),p.setupLightsView(Zi),jS(we,Kt,Zi,_i,Xe,wi))}}else jS(we,Kt,Ht,_i,Xe,wi)}}function jS(dt,Kt,Ht,te,ve,Ai){if(dt.onBeforeRender(_,Kt,Ht,te,ve,Ai),dt.modelViewMatrix.multiplyMatrices(Ht.matrixWorldInverse,dt.matrixWorld),dt.normalMatrix.getNormalMatrix(dt.modelViewMatrix),dt.isImmediateRenderObject){const ai=WS(Ht,Kt,ve,dt);he.setMaterial(ve),$r.reset(),function(we,_i){we.render(function(Xe){_.renderBufferImmediate(Xe,_i)})}(dt,ai)}else ve.transparent===!0&&ve.side===K?(ve.side=X,ve.needsUpdate=!0,_.renderBufferDirect(Ht,Kt,te,ve,dt,Ai),ve.side=j,ve.needsUpdate=!0,_.renderBufferDirect(Ht,Kt,te,ve,dt,Ai),ve.side=K):_.renderBufferDirect(Ht,Kt,te,ve,dt,Ai);dt.onAfterRender(_,Kt,Ht,te,ve,Ai)}function G_(dt,Kt,Ht){Kt.isScene!==!0&&(Kt=Xt);const te=Q.get(dt),ve=p.state.lights,Ai=p.state.shadowsArray,ai=ve.state.version,we=Me.getParameters(dt,ve.state,Ai,Kt,Ht),_i=Me.getProgramCacheKey(we);let Xe=te.programs;te.environment=dt.isMeshStandardMaterial?Kt.environment:null,te.fog=Kt.fog,te.envMap=Dt.get(dt.envMap||te.environment),Xe===void 0&&(dt.addEventListener("dispose",GS),Xe=new Map,te.programs=Xe);let wi=Xe.get(_i);if(wi!==void 0){if(te.currentProgram===wi&&te.lightsStateVersion===ai)return VS(dt,we),wi}else we.uniforms=Me.getUniforms(dt),dt.onBuild(we,_),dt.onBeforeCompile(we,_),wi=Me.acquireProgram(we,_i),Xe.set(_i,wi),te.uniforms=we.uniforms;const ni=te.uniforms;(dt.isShaderMaterial||dt.isRawShaderMaterial)&&dt.clipping!==!0||(ni.clippingPlanes=Tn.uniform),VS(dt,we),te.needsLights=function(Zi){return Zi.isMeshLambertMaterial||Zi.isMeshToonMaterial||Zi.isMeshPhongMaterial||Zi.isMeshStandardMaterial||Zi.isShadowMaterial||Zi.isShaderMaterial&&Zi.lights===!0}(dt),te.lightsStateVersion=ai,te.needsLights&&(ni.ambientLightColor.value=ve.state.ambient,ni.lightProbe.value=ve.state.probe,ni.directionalLights.value=ve.state.directional,ni.directionalLightShadows.value=ve.state.directionalShadow,ni.spotLights.value=ve.state.spot,ni.spotLightShadows.value=ve.state.spotShadow,ni.rectAreaLights.value=ve.state.rectArea,ni.ltc_1.value=ve.state.rectAreaLTC1,ni.ltc_2.value=ve.state.rectAreaLTC2,ni.pointLights.value=ve.state.point,ni.pointLightShadows.value=ve.state.pointShadow,ni.hemisphereLights.value=ve.state.hemi,ni.directionalShadowMap.value=ve.state.directionalShadowMap,ni.directionalShadowMatrix.value=ve.state.directionalShadowMatrix,ni.spotShadowMap.value=ve.state.spotShadowMap,ni.spotShadowMatrix.value=ve.state.spotShadowMatrix,ni.pointShadowMap.value=ve.state.pointShadowMap,ni.pointShadowMatrix.value=ve.state.pointShadowMatrix);const yi=wi.getUniforms(),Un=xs.seqWithValue(yi.seq,ni);return te.currentProgram=wi,te.uniformsList=Un,wi}function VS(dt,Kt){const Ht=Q.get(dt);Ht.outputEncoding=Kt.outputEncoding,Ht.instancing=Kt.instancing,Ht.skinning=Kt.skinning,Ht.numClippingPlanes=Kt.numClippingPlanes,Ht.numIntersection=Kt.numClipIntersection,Ht.vertexAlphas=Kt.vertexAlphas}function WS(dt,Kt,Ht,te){Kt.isScene!==!0&&(Kt=Xt),gt.resetTextureUnits();const ve=Kt.fog,Ai=Ht.isMeshStandardMaterial?Kt.environment:null,ai=I===null?_.outputEncoding:I.texture.encoding,we=Dt.get(Ht.envMap||Ai),_i=Ht.vertexColors===!0&&te.geometry&&te.geometry.attributes.color&&te.geometry.attributes.color.itemSize===4,Xe=Q.get(Ht),wi=p.state.lights;if(jt===!0&&(ee===!0||dt!==N)){const wr=dt===N&&Ht.id===F;Tn.setState(Ht,dt,wr)}let ni=!1;Ht.version===Xe.__version?Xe.needsLights&&Xe.lightsStateVersion!==wi.state.version||Xe.outputEncoding!==ai||te.isInstancedMesh&&Xe.instancing===!1?ni=!0:te.isInstancedMesh||Xe.instancing!==!0?te.isSkinnedMesh&&Xe.skinning===!1?ni=!0:te.isSkinnedMesh||Xe.skinning!==!0?Xe.envMap!==we||Ht.fog&&Xe.fog!==ve?ni=!0:Xe.numClippingPlanes===void 0||Xe.numClippingPlanes===Tn.numPlanes&&Xe.numIntersection===Tn.numIntersection?Xe.vertexAlphas!==_i&&(ni=!0):ni=!0:ni=!0:ni=!0:(ni=!0,Xe.__version=Ht.version);let yi=Xe.currentProgram;ni===!0&&(yi=G_(Ht,Kt,te));let Un=!1,Zi=!1,ss=!1;const Xi=yi.getUniforms(),Us=Xe.uniforms;if(he.useProgram(yi.program)&&(Un=!0,Zi=!0,ss=!0),Ht.id!==F&&(F=Ht.id,Zi=!0),Un||N!==dt){if(Xi.setValue(fe,"projectionMatrix",dt.projectionMatrix),ue.logarithmicDepthBuffer&&Xi.setValue(fe,"logDepthBufFC",2/(Math.log(dt.far+1)/Math.LN2)),N!==dt&&(N=dt,Zi=!0,ss=!0),Ht.isShaderMaterial||Ht.isMeshPhongMaterial||Ht.isMeshToonMaterial||Ht.isMeshStandardMaterial||Ht.envMap){const wr=Xi.map.cameraPosition;wr!==void 0&&wr.setValue(fe,lt.setFromMatrixPosition(dt.matrixWorld))}(Ht.isMeshPhongMaterial||Ht.isMeshToonMaterial||Ht.isMeshLambertMaterial||Ht.isMeshBasicMaterial||Ht.isMeshStandardMaterial||Ht.isShaderMaterial)&&Xi.setValue(fe,"isOrthographic",dt.isOrthographicCamera===!0),(Ht.isMeshPhongMaterial||Ht.isMeshToonMaterial||Ht.isMeshLambertMaterial||Ht.isMeshBasicMaterial||Ht.isMeshStandardMaterial||Ht.isShaderMaterial||Ht.isShadowMaterial||te.isSkinnedMesh)&&Xi.setValue(fe,"viewMatrix",dt.matrixWorldInverse)}if(te.isSkinnedMesh){Xi.setOptional(fe,te,"bindMatrix"),Xi.setOptional(fe,te,"bindMatrixInverse");const wr=te.skeleton;wr&&(ue.floatVertexTextures?(wr.boneTexture===null&&wr.computeBoneTexture(),Xi.setValue(fe,"boneTexture",wr.boneTexture,gt),Xi.setValue(fe,"boneTextureSize",wr.boneTextureSize)):Xi.setOptional(fe,wr,"boneMatrices"))}var Xn,co;return(Zi||Xe.receiveShadow!==te.receiveShadow)&&(Xe.receiveShadow=te.receiveShadow,Xi.setValue(fe,"receiveShadow",te.receiveShadow)),Zi&&(Xi.setValue(fe,"toneMappingExposure",_.toneMappingExposure),Xe.needsLights&&(co=ss,(Xn=Us).ambientLightColor.needsUpdate=co,Xn.lightProbe.needsUpdate=co,Xn.directionalLights.needsUpdate=co,Xn.directionalLightShadows.needsUpdate=co,Xn.pointLights.needsUpdate=co,Xn.pointLightShadows.needsUpdate=co,Xn.spotLights.needsUpdate=co,Xn.spotLightShadows.needsUpdate=co,Xn.rectAreaLights.needsUpdate=co,Xn.hemisphereLights.needsUpdate=co),ve&&Ht.fog&&Re.refreshFogUniforms(Us,ve),Re.refreshMaterialUniforms(Us,Ht,tt,it,le),xs.upload(fe,Xe.uniformsList,Us,gt)),Ht.isShaderMaterial&&Ht.uniformsNeedUpdate===!0&&(xs.upload(fe,Xe.uniformsList,Us,gt),Ht.uniformsNeedUpdate=!1),Ht.isSpriteMaterial&&Xi.setValue(fe,"center",te.center),Xi.setValue(fe,"modelViewMatrix",te.modelViewMatrix),Xi.setValue(fe,"normalMatrix",te.normalMatrix),Xi.setValue(fe,"modelMatrix",te.matrixWorld),yi}Uu.setAnimationLoop(function(dt){U_&&U_(dt)}),typeof window!="undefined"&&Uu.setContext(window),this.setAnimationLoop=function(dt){U_=dt,ho.setAnimationLoop(dt),dt===null?Uu.stop():Uu.start()},ho.addEventListener("sessionstart",HS),ho.addEventListener("sessionend",zS),this.render=function(dt,Kt){if(Kt!==void 0&&Kt.isCamera!==!0)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(y===!0)return;dt.autoUpdate===!0&&dt.updateMatrixWorld(),Kt.parent===null&&Kt.updateMatrixWorld(),ho.enabled===!0&&ho.isPresenting===!0&&(ho.cameraAutoUpdate===!0&&ho.updateCamera(Kt),Kt=ho.getCamera()),dt.isScene===!0&&dt.onBeforeRender(_,dt,Kt,I),p=si.get(dt,g.length),p.init(),g.push(p),nt.multiplyMatrices(Kt.projectionMatrix,Kt.matrixWorldInverse),xt.setFromProjectionMatrix(nt),ee=this.localClippingEnabled,jt=Tn.init(this.clippingPlanes,ee,Kt),d=Ae.get(dt,m.length),d.init(),m.push(d),function ai(we,_i,Xe,wi){if(we.visible===!1)return;if(we.layers.test(_i.layers)){if(we.isGroup)Xe=we.renderOrder;else if(we.isLOD)we.autoUpdate===!0&&we.update(_i);else if(we.isLight)p.pushLight(we),we.castShadow&&p.pushShadow(we);else if(we.isSprite){if(!we.frustumCulled||xt.intersectsSprite(we)){wi&<.setFromMatrixPosition(we.matrixWorld).applyMatrix4(nt);const yi=Yt.update(we),Un=we.material;Un.visible&&d.push(we,yi,Un,Xe,lt.z,null)}}else if(we.isImmediateRenderObject)wi&<.setFromMatrixPosition(we.matrixWorld).applyMatrix4(nt),d.push(we,null,we.material,Xe,lt.z,null);else if((we.isMesh||we.isLine||we.isPoints)&&(we.isSkinnedMesh&&we.skeleton.frame!==Vt.render.frame&&(we.skeleton.update(),we.skeleton.frame=Vt.render.frame),!we.frustumCulled||xt.intersectsObject(we))){wi&<.setFromMatrixPosition(we.matrixWorld).applyMatrix4(nt);const yi=Yt.update(we),Un=we.material;if(Array.isArray(Un)){const Zi=yi.groups;for(let ss=0,Xi=Zi.length;ss<Xi;ss++){const Us=Zi[ss],Xn=Un[Us.materialIndex];Xn&&Xn.visible&&d.push(we,yi,Xn,Xe,lt.z,Us)}}else Un.visible&&d.push(we,yi,Un,Xe,lt.z,null)}}const ni=we.children;for(let yi=0,Un=ni.length;yi<Un;yi++)ai(ni[yi],_i,Xe,wi)}(dt,Kt,0,_.sortObjects),d.finish(),_.sortObjects===!0&&d.sort(rt,et),jt===!0&&Tn.beginShadows();const Ht=p.state.shadowsArray;Ni.render(Ht,dt,Kt),p.setupLights(),p.setupLightsView(Kt),jt===!0&&Tn.endShadows(),this.info.autoReset===!0&&this.info.reset(),Yr.render(d,dt);const te=d.opaque,ve=d.transmissive,Ai=d.transparent;te.length>0&&Mg(te,dt,Kt),ve.length>0&&function(ai,we,_i,Xe){if(le===null){const yi=s===!0&&ue.isWebGL2===!0;le=new(yi?Qs:Kr)(1024,1024,{generateMipmaps:!0,type:Fr.convert(Ws)!==null?Ws:ls,minFilter:js,magFilter:fi,wrapS:qe,wrapT:qe})}const wi=_.getRenderTarget();_.setRenderTarget(le),_.clear();const ni=_.toneMapping;_.toneMapping=Zr,Mg(ai,_i,Xe),_.toneMapping=ni,gt.updateMultisampleRenderTarget(le),gt.updateRenderTargetMipmap(le),_.setRenderTarget(wi),Mg(we,_i,Xe)}(te,ve,dt,Kt),Ai.length>0&&Mg(Ai,dt,Kt),I!==null&&(gt.updateMultisampleRenderTarget(I),gt.updateRenderTargetMipmap(I)),dt.isScene===!0&&dt.onAfterRender(_,dt,Kt),he.buffers.depth.setTest(!0),he.buffers.depth.setMask(!0),he.buffers.color.setMask(!0),he.setPolygonOffset(!1),$r.resetDefaultState(),F=-1,N=null,g.pop(),p=g.length>0?g[g.length-1]:null,m.pop(),d=m.length>0?m[m.length-1]:null},this.getActiveCubeFace=function(){return w},this.getActiveMipmapLevel=function(){return A},this.getRenderTarget=function(){return I},this.setRenderTarget=function(dt,Kt=0,Ht=0){I=dt,w=Kt,A=Ht,dt&&Q.get(dt).__webglFramebuffer===void 0&>.setupRenderTarget(dt);let te=null,ve=!1,Ai=!1;if(dt){const ai=dt.texture;(ai.isDataTexture3D||ai.isDataTexture2DArray)&&(Ai=!0);const we=Q.get(dt).__webglFramebuffer;dt.isWebGLCubeRenderTarget?(te=we[Kt],ve=!0):te=dt.isWebGLMultisampleRenderTarget?Q.get(dt).__webglMultisampledFramebuffer:we,U.copy(dt.viewport),B.copy(dt.scissor),G=dt.scissorTest}else U.copy(pt).multiplyScalar(tt).floor(),B.copy(kt).multiplyScalar(tt).floor(),G=Lt;if(he.bindFramebuffer(36160,te)&&ue.drawBuffers){let ai=!1;if(dt)if(dt.isWebGLMultipleRenderTargets){const we=dt.texture;if(_t.length!==we.length||_t[0]!==36064){for(let _i=0,Xe=we.length;_i<Xe;_i++)_t[_i]=36064+_i;_t.length=we.length,ai=!0}}else _t.length===1&&_t[0]===36064||(_t[0]=36064,_t.length=1,ai=!0);else _t.length===1&&_t[0]===1029||(_t[0]=1029,_t.length=1,ai=!0);ai&&(ue.isWebGL2?fe.drawBuffers(_t):Bt.get("WEBGL_draw_buffers").drawBuffersWEBGL(_t))}if(he.viewport(U),he.scissor(B),he.setScissorTest(G),ve){const ai=Q.get(dt.texture);fe.framebufferTexture2D(36160,36064,34069+Kt,ai.__webglTexture,Ht)}else if(Ai){const ai=Q.get(dt.texture),we=Kt||0;fe.framebufferTextureLayer(36160,36064,ai.__webglTexture,Ht||0,we)}},this.readRenderTargetPixels=function(dt,Kt,Ht,te,ve,Ai,ai){if(!dt||!dt.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let we=Q.get(dt).__webglFramebuffer;if(dt.isWebGLCubeRenderTarget&&ai!==void 0&&(we=we[ai]),we){he.bindFramebuffer(36160,we);try{const _i=dt.texture,Xe=_i.format,wi=_i.type;if(Xe!==Tr&&Fr.convert(Xe)!==fe.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const ni=wi===Ws&&(Bt.has("EXT_color_buffer_half_float")||ue.isWebGL2&&Bt.has("EXT_color_buffer_float"));if(!(wi===ls||Fr.convert(wi)===fe.getParameter(35738)||wi===Oo&&(ue.isWebGL2||Bt.has("OES_texture_float")||Bt.has("WEBGL_color_buffer_float"))||ni))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");fe.checkFramebufferStatus(36160)===36053?Kt>=0&&Kt<=dt.width-te&&Ht>=0&&Ht<=dt.height-ve&&fe.readPixels(Kt,Ht,te,ve,Fr.convert(Xe),Fr.convert(wi),Ai):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const _i=I!==null?Q.get(I).__webglFramebuffer:null;he.bindFramebuffer(36160,_i)}}},this.copyFramebufferToTexture=function(dt,Kt,Ht=0){const te=Math.pow(2,-Ht),ve=Math.floor(Kt.image.width*te),Ai=Math.floor(Kt.image.height*te);let ai=Fr.convert(Kt.format);ue.isWebGL2&&(ai===6407&&(ai=32849),ai===6408&&(ai=32856)),gt.setTexture2D(Kt,0),fe.copyTexImage2D(3553,Ht,ai,dt.x,dt.y,ve,Ai,0),he.unbindTexture()},this.copyTextureToTexture=function(dt,Kt,Ht,te=0){const ve=Kt.image.width,Ai=Kt.image.height,ai=Fr.convert(Ht.format),we=Fr.convert(Ht.type);gt.setTexture2D(Ht,0),fe.pixelStorei(37440,Ht.flipY),fe.pixelStorei(37441,Ht.premultiplyAlpha),fe.pixelStorei(3317,Ht.unpackAlignment),Kt.isDataTexture?fe.texSubImage2D(3553,te,dt.x,dt.y,ve,Ai,ai,we,Kt.image.data):Kt.isCompressedTexture?fe.compressedTexSubImage2D(3553,te,dt.x,dt.y,Kt.mipmaps[0].width,Kt.mipmaps[0].height,ai,Kt.mipmaps[0].data):fe.texSubImage2D(3553,te,dt.x,dt.y,ai,we,Kt.image),te===0&&Ht.generateMipmaps&&fe.generateMipmap(3553),he.unbindTexture()},this.copyTextureToTexture3D=function(dt,Kt,Ht,te,ve=0){if(_.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const Ai=dt.max.x-dt.min.x+1,ai=dt.max.y-dt.min.y+1,we=dt.max.z-dt.min.z+1,_i=Fr.convert(te.format),Xe=Fr.convert(te.type);let wi;if(te.isDataTexture3D)gt.setTexture3D(te,0),wi=32879;else{if(!te.isDataTexture2DArray)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");gt.setTexture2DArray(te,0),wi=35866}fe.pixelStorei(37440,te.flipY),fe.pixelStorei(37441,te.premultiplyAlpha),fe.pixelStorei(3317,te.unpackAlignment);const ni=fe.getParameter(3314),yi=fe.getParameter(32878),Un=fe.getParameter(3316),Zi=fe.getParameter(3315),ss=fe.getParameter(32877),Xi=Ht.isCompressedTexture?Ht.mipmaps[0]:Ht.image;fe.pixelStorei(3314,Xi.width),fe.pixelStorei(32878,Xi.height),fe.pixelStorei(3316,dt.min.x),fe.pixelStorei(3315,dt.min.y),fe.pixelStorei(32877,dt.min.z),Ht.isDataTexture||Ht.isDataTexture3D?fe.texSubImage3D(wi,ve,Kt.x,Kt.y,Kt.z,Ai,ai,we,_i,Xe,Xi.data):Ht.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),fe.compressedTexSubImage3D(wi,ve,Kt.x,Kt.y,Kt.z,Ai,ai,we,_i,Xi.data)):fe.texSubImage3D(wi,ve,Kt.x,Kt.y,Kt.z,Ai,ai,we,_i,Xe,Xi),fe.pixelStorei(3314,ni),fe.pixelStorei(32878,yi),fe.pixelStorei(3316,Un),fe.pixelStorei(3315,Zi),fe.pixelStorei(32877,ss),ve===0&&te.generateMipmaps&&fe.generateMipmap(wi),he.unbindTexture()},this.initTexture=function(dt){gt.setTexture2D(dt,0),he.unbindTexture()},this.resetState=function(){w=0,A=0,I=null,he.reset(),$r.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class Rn extends Oi{}Rn.prototype.isWebGL1Renderer=!0;class Fn{constructor(t,e=25e-5){this.name="",this.color=new Le(t),this.density=e}clone(){return new Fn(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}Fn.prototype.isFogExp2=!0;class eu{constructor(t,e=1,i=1e3){this.name="",this.color=new Le(t),this.near=e,this.far=i}clone(){return new eu(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}eu.prototype.isFog=!0;class el extends hi{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}}el.prototype.isScene=!0;class fa{constructor(t,e){this.array=t,this.stride=e,this.count=t!==void 0?t.length/e:0,this.usage=Js,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Ar()}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,i){t*=this.stride,i*=e.stride;for(let r=0,o=this.stride;r<o;r++)this.array[t+r]=e.array[i+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=Ar()),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]),i=new this.constructor(e,this.stride);return i.setUsage(this.usage),i}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=Ar()),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}}}fa.prototype.isInterleavedBuffer=!0;const mn=new S;class Yo{constructor(t,e,i,r=!1){this.name="",this.data=t,this.itemSize=e,this.offset=i,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,i=this.data.count;e<i;e++)mn.x=this.getX(e),mn.y=this.getY(e),mn.z=this.getZ(e),mn.applyMatrix4(t),this.setXYZ(e,mn.x,mn.y,mn.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)mn.x=this.getX(e),mn.y=this.getY(e),mn.z=this.getZ(e),mn.applyNormalMatrix(t),this.setXYZ(e,mn.x,mn.y,mn.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)mn.x=this.getX(e),mn.y=this.getY(e),mn.z=this.getZ(e),mn.transformDirection(t),this.setXYZ(e,mn.x,mn.y,mn.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,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this}setXYZ(t,e,i,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=r,this}setXYZW(t,e,i,r,o){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=r,this.data.array[t+3]=o,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 i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let o=0;o<this.itemSize;o++)e.push(this.data.array[r+o])}return new mi(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 Yo(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 i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let o=0;o<this.itemSize;o++)e.push(this.data.array[r+o])}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}}}Yo.prototype.isInterleavedBufferAttribute=!0;class iu extends Dn{constructor(t){super(),this.type="SpriteMaterial",this.color=new Le(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 ma;iu.prototype.isSpriteMaterial=!0;const To=new S,il=new S,ga=new S,va=new ce,nu=new ce,Xf=new Ee,Bh=new S,ru=new S,kh=new S,qf=new ce,ou=new ce,Fd=new ce;class su extends hi{constructor(t){if(super(),this.type="Sprite",ma===void 0){ma=new ze;const e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),i=new fa(e,5);ma.setIndex([0,1,2,0,2,3]),ma.setAttribute("position",new Yo(i,3,0,!1)),ma.setAttribute("uv",new Yo(i,2,3,!1))}this.geometry=ma,this.material=t!==void 0?t:new iu,this.center=new ce(.5,.5)}raycast(t,e){t.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),il.setFromMatrixScale(this.matrixWorld),Xf.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),ga.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&il.multiplyScalar(-ga.z);const i=this.material.rotation;let r,o;i!==0&&(o=Math.cos(i),r=Math.sin(i));const s=this.center;Uh(Bh.set(-.5,-.5,0),ga,s,il,r,o),Uh(ru.set(.5,-.5,0),ga,s,il,r,o),Uh(kh.set(.5,.5,0),ga,s,il,r,o),qf.set(0,0),ou.set(1,0),Fd.set(1,1);let a=t.ray.intersectTriangle(Bh,ru,kh,!1,To);if(a===null&&(Uh(ru.set(-.5,.5,0),ga,s,il,r,o),ou.set(0,1),a=t.ray.intersectTriangle(Bh,kh,ru,!1,To),a===null))return;const l=t.ray.origin.distanceTo(To);l<t.near||l>t.far||e.push({distance:l,point:To.clone(),uv:ji.getUV(To,Bh,ru,kh,qf,ou,Fd,new ce),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 Uh(n,t,e,i,r,o){va.subVectors(n,e).addScalar(.5).multiply(i),r!==void 0?(nu.x=o*va.x-r*va.y,nu.y=r*va.x+o*va.y):nu.copy(va),n.copy(t),n.x+=nu.x,n.y+=nu.y,n.applyMatrix4(Xf)}su.prototype.isSprite=!0;const nl=new S,Yf=new S;class $f extends hi{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(t){super.copy(t,!1);const e=t.levels;for(let i=0,r=e.length;i<r;i++){const o=e[i];this.addLevel(o.object.clone(),o.distance)}return this.autoUpdate=t.autoUpdate,this}addLevel(t,e=0){e=Math.abs(e);const i=this.levels;let r;for(r=0;r<i.length&&!(e<i[r].distance);r++);return i.splice(r,0,{distance:e,object:t}),this.add(t),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(t){const e=this.levels;if(e.length>0){let i,r;for(i=1,r=e.length;i<r&&!(t<e[i].distance);i++);return e[i-1].object}return null}raycast(t,e){if(this.levels.length>0){nl.setFromMatrixPosition(this.matrixWorld);const i=t.ray.origin.distanceTo(nl);this.getObjectForDistance(i).raycast(t,e)}}update(t){const e=this.levels;if(e.length>1){nl.setFromMatrixPosition(t.matrixWorld),Yf.setFromMatrixPosition(this.matrixWorld);const i=nl.distanceTo(Yf)/t.zoom;let r,o;for(e[0].object.visible=!0,r=1,o=e.length;r<o&&i>=e[r].distance;r++)e[r-1].object.visible=!1,e[r].object.visible=!0;for(this._currentLevel=r-1;r<o;r++)e[r].object.visible=!1}}toJSON(t){const e=super.toJSON(t);this.autoUpdate===!1&&(e.object.autoUpdate=!1),e.object.levels=[];const i=this.levels;for(let r=0,o=i.length;r<o;r++){const s=i[r];e.object.levels.push({object:s.object.uuid,distance:s.distance})}return e}}const sr=new S,Gh=new Li,Jf=new Li,bv=new S,Hh=new Ee;class rl extends Ti{constructor(t,e){super(t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Ee,this.bindMatrixInverse=new Ee}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 Li,e=this.geometry.attributes.skinWeight;for(let i=0,r=e.count;i<r;i++){t.x=e.getX(i),t.y=e.getY(i),t.z=e.getZ(i),t.w=e.getW(i);const o=1/t.manhattanLength();o!==1/0?t.multiplyScalar(o):t.set(1,0,0,0),e.setXYZW(i,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 i=this.skeleton,r=this.geometry;Gh.fromBufferAttribute(r.attributes.skinIndex,t),Jf.fromBufferAttribute(r.attributes.skinWeight,t),sr.fromBufferAttribute(r.attributes.position,t).applyMatrix4(this.bindMatrix),e.set(0,0,0);for(let o=0;o<4;o++){const s=Jf.getComponent(o);if(s!==0){const a=Gh.getComponent(o);Hh.multiplyMatrices(i.bones[a].matrixWorld,i.boneInverses[a]),e.addScaledVector(bv.copy(sr).applyMatrix4(Hh),s)}}return e.applyMatrix4(this.bindMatrixInverse)}}rl.prototype.isSkinnedMesh=!0;class zh extends hi{constructor(){super(),this.type="Bone"}}zh.prototype.isBone=!0;class ws extends dn{constructor(t=null,e=1,i=1,r,o,s,a,l,u=fi,h=fi,d,p){super(null,s,a,l,u,h,r,o,d,p),this.image={data:t,width:e,height:i},this.magFilter=u,this.minFilter=h,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}ws.prototype.isDataTexture=!0;const Zf=new Ee,Kf=new Ee;class jh{constructor(t=[],e=[]){this.uuid=Ar(),this.bones=t.slice(0),this.boneInverses=e,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){const t=this.bones,e=this.boneInverses;if(this.boneMatrices=new Float32Array(16*t.length),e.length===0)this.calculateInverses();else if(t.length!==e.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let i=0,r=this.bones.length;i<r;i++)this.boneInverses.push(new Ee)}}calculateInverses(){this.boneInverses.length=0;for(let t=0,e=this.bones.length;t<e;t++){const i=new Ee;this.bones[t]&&i.copy(this.bones[t].matrixWorld).invert(),this.boneInverses.push(i)}}pose(){for(let t=0,e=this.bones.length;t<e;t++){const i=this.bones[t];i&&i.matrixWorld.copy(this.boneInverses[t]).invert()}for(let t=0,e=this.bones.length;t<e;t++){const i=this.bones[t];i&&(i.parent&&i.parent.isBone?(i.matrix.copy(i.parent.matrixWorld).invert(),i.matrix.multiply(i.matrixWorld)):i.matrix.copy(i.matrixWorld),i.matrix.decompose(i.position,i.quaternion,i.scale))}}update(){const t=this.bones,e=this.boneInverses,i=this.boneMatrices,r=this.boneTexture;for(let o=0,s=t.length;o<s;o++){const a=t[o]?t[o].matrixWorld:Kf;Zf.multiplyMatrices(a,e[o]),Zf.toArray(i,16*o)}r!==null&&(r.needsUpdate=!0)}clone(){return new jh(this.bones,this.boneInverses)}computeBoneTexture(){let t=Math.sqrt(4*this.bones.length);t=Ba(t),t=Math.max(t,4);const e=new Float32Array(t*t*4);e.set(this.boneMatrices);const i=new ws(e,t,t,Tr,Oo);return this.boneMatrices=e,this.boneTexture=i,this.boneTextureSize=t,this}getBoneByName(t){for(let e=0,i=this.bones.length;e<i;e++){const r=this.bones[e];if(r.name===t)return r}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(t,e){this.uuid=t.uuid;for(let i=0,r=t.bones.length;i<r;i++){const o=t.bones[i];let s=e[o];s===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",o),s=new zh),this.bones.push(s),this.boneInverses.push(new Ee().fromArray(t.boneInverses[i]))}return this.init(),this}toJSON(){const t={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};t.uuid=this.uuid;const e=this.bones,i=this.boneInverses;for(let r=0,o=e.length;r<o;r++){const s=e[r];t.bones.push(s.uuid);const a=i[r];t.boneInverses.push(a.toArray())}return t}}const Qf=new Ee,Vh=new Ee,ol=[],au=new Ti;class Bd extends Ti{constructor(t,e,i){super(t,e),this.instanceMatrix=new mi(new Float32Array(16*i),16),this.instanceColor=null,this.count=i,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 i=this.matrixWorld,r=this.count;if(au.geometry=this.geometry,au.material=this.material,au.material!==void 0)for(let o=0;o<r;o++){this.getMatrixAt(o,Qf),Vh.multiplyMatrices(i,Qf),au.matrixWorld=Vh,au.raycast(t,ol);for(let s=0,a=ol.length;s<a;s++){const l=ol[s];l.instanceId=o,l.object=this,e.push(l)}ol.length=0}}setColorAt(t,e){this.instanceColor===null&&(this.instanceColor=new mi(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"})}}Bd.prototype.isInstancedMesh=!0;class Bn extends Dn{constructor(t){super(),this.type="LineBasicMaterial",this.color=new Le(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}}Bn.prototype.isLineBasicMaterial=!0;const tm=new S,Wh=new S,em=new Ee,kd=new jo,Xh=new En;class c extends hi{constructor(t=new ze,e=new Bn){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,i=[0];for(let r=1,o=e.count;r<o;r++)tm.fromBufferAttribute(e,r-1),Wh.fromBufferAttribute(e,r),i[r]=i[r-1],i[r]+=tm.distanceTo(Wh);t.setAttribute("lineDistance",new _e(i,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 i=this.geometry,r=this.matrixWorld,o=t.params.Line.threshold,s=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),Xh.copy(i.boundingSphere),Xh.applyMatrix4(r),Xh.radius+=o,t.ray.intersectsSphere(Xh)===!1)return;em.copy(r).invert(),kd.copy(t.ray).applyMatrix4(em);const a=o/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,u=new S,h=new S,d=new S,p=new S,m=this.isLineSegments?2:1;if(i.isBufferGeometry){const g=i.index,_=i.attributes.position;if(g!==null)for(let y=Math.max(0,s.start),w=Math.min(g.count,s.start+s.count)-1;y<w;y+=m){const A=g.getX(y),I=g.getX(y+1);if(u.fromBufferAttribute(_,A),h.fromBufferAttribute(_,I),kd.distanceSqToSegment(u,h,p,d)>l)continue;p.applyMatrix4(this.matrixWorld);const F=t.ray.origin.distanceTo(p);F<t.near||F>t.far||e.push({distance:F,point:d.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}else for(let y=Math.max(0,s.start),w=Math.min(_.count,s.start+s.count)-1;y<w;y+=m){if(u.fromBufferAttribute(_,y),h.fromBufferAttribute(_,y+1),kd.distanceSqToSegment(u,h,p,d)>l)continue;p.applyMatrix4(this.matrixWorld);const A=t.ray.origin.distanceTo(p);A<t.near||A>t.far||e.push({distance:A,point:d.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}else i.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,i=Object.keys(e);if(i.length>0){const r=e[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=r.length;o<s;o++){const a=r[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=o}}}}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.")}}}c.prototype.isLine=!0;const f=new S,x=new S;class R extends c{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,i=[];for(let r=0,o=e.count;r<o;r+=2)f.fromBufferAttribute(e,r),x.fromBufferAttribute(e,r+1),i[r]=r===0?0:i[r-1],i[r+1]=i[r]+f.distanceTo(x);t.setAttribute("lineDistance",new _e(i,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}}R.prototype.isLineSegments=!0;class D extends c{constructor(t,e){super(t,e),this.type="LineLoop"}}D.prototype.isLineLoop=!0;class $ extends Dn{constructor(t){super(),this.type="PointsMaterial",this.color=new Le(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}}$.prototype.isPointsMaterial=!0;const ut=new Ee,mt=new jo,Mt=new En,Jt=new S;class Zt extends hi{constructor(t=new ze,e=new $){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 i=this.geometry,r=this.matrixWorld,o=t.params.Points.threshold,s=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),Mt.copy(i.boundingSphere),Mt.applyMatrix4(r),Mt.radius+=o,t.ray.intersectsSphere(Mt)===!1)return;ut.copy(r).invert(),mt.copy(t.ray).applyMatrix4(ut);const a=o/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a;if(i.isBufferGeometry){const u=i.index,h=i.attributes.position;if(u!==null)for(let d=Math.max(0,s.start),p=Math.min(u.count,s.start+s.count);d<p;d++){const m=u.getX(d);Jt.fromBufferAttribute(h,m),de(Jt,m,l,r,t,e,this)}else for(let d=Math.max(0,s.start),p=Math.min(h.count,s.start+s.count);d<p;d++)Jt.fromBufferAttribute(h,d),de(Jt,d,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,i=Object.keys(e);if(i.length>0){const r=e[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=r.length;o<s;o++){const a=r[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=o}}}}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 de(n,t,e,i,r,o,s){const a=mt.distanceSqToPoint(n);if(a<e){const l=new S;mt.closestPointToPoint(n,l),l.applyMatrix4(i);const u=r.ray.origin.distanceTo(l);if(u<r.near||u>r.far)return;o.push({distance:u,distanceToRay:Math.sqrt(a),point:l,index:t,face:null,object:s})}}Zt.prototype.isPoints=!0;class Oe extends dn{constructor(t,e,i,r,o,s,a,l,u){super(t,e,i,r,o,s,a,l,u),this.format=a!==void 0?a:No,this.minFilter=s!==void 0?s:qi,this.magFilter=o!==void 0?o:qi,this.generateMipmaps=!1;const h=this;"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback(function d(){h.needsUpdate=!0,t.requestVideoFrameCallback(d)})}clone(){return new this.constructor(this.image).copy(this)}update(){const t=this.image;!("requestVideoFrameCallback"in t)&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}Oe.prototype.isVideoTexture=!0;class Fe extends dn{constructor(t,e,i,r,o,s,a,l,u,h,d,p){super(null,s,a,l,u,h,r,o,d,p),this.image={width:e,height:i},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}Fe.prototype.isCompressedTexture=!0;class Ve extends dn{constructor(t,e,i,r,o,s,a,l,u){super(t,e,i,r,o,s,a,l,u),this.needsUpdate=!0}}Ve.prototype.isCanvasTexture=!0;class re extends dn{constructor(t,e,i,r,o,s,a,l,u,h){if((h=h!==void 0?h:tn)!==tn&&h!==Xs)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&h===tn&&(i=Pl),i===void 0&&h===Xs&&(i=Pi),super(null,r,o,s,a,l,h,i,u),this.image={width:t,height:e},this.magFilter=a!==void 0?a:fi,this.minFilter=l!==void 0?l:fi,this.flipY=!1,this.generateMipmaps=!1}}re.prototype.isDepthTexture=!0;class pe extends ze{constructor(t=1,e=8,i=0,r=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:i,thetaLength:r},e=Math.max(3,e);const o=[],s=[],a=[],l=[],u=new S,h=new ce;s.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let d=0,p=3;d<=e;d++,p+=3){const m=i+d/e*r;u.x=t*Math.cos(m),u.y=t*Math.sin(m),s.push(u.x,u.y,u.z),a.push(0,0,1),h.x=(s[p]/t+1)/2,h.y=(s[p+1]/t+1)/2,l.push(h.x,h.y)}for(let d=1;d<=e;d++)o.push(d,d+1,0);this.setIndex(o),this.setAttribute("position",new _e(s,3)),this.setAttribute("normal",new _e(a,3)),this.setAttribute("uv",new _e(l,2))}static fromJSON(t){return new pe(t.radius,t.segments,t.thetaStart,t.thetaLength)}}class He extends ze{constructor(t=1,e=1,i=1,r=8,o=1,s=!1,a=0,l=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:i,radialSegments:r,heightSegments:o,openEnded:s,thetaStart:a,thetaLength:l};const u=this;r=Math.floor(r),o=Math.floor(o);const h=[],d=[],p=[],m=[];let g=0;const _=[],y=i/2;let w=0;function A(I){const F=g,N=new ce,U=new S;let B=0;const G=I===!0?t:e,ct=I===!0?1:-1;for(let tt=1;tt<=r;tt++)d.push(0,y*ct,0),p.push(0,ct,0),m.push(.5,.5),g++;const it=g;for(let tt=0;tt<=r;tt++){const rt=tt/r*l+a,et=Math.cos(rt),pt=Math.sin(rt);U.x=G*pt,U.y=y*ct,U.z=G*et,d.push(U.x,U.y,U.z),p.push(0,ct,0),N.x=.5*et+.5,N.y=.5*pt*ct+.5,m.push(N.x,N.y),g++}for(let tt=0;tt<r;tt++){const rt=F+tt,et=it+tt;I===!0?h.push(et,et+1,rt):h.push(et+1,et,rt),B+=3}u.addGroup(w,B,I===!0?1:2),w+=B}(function(){const I=new S,F=new S;let N=0;const U=(e-t)/i;for(let B=0;B<=o;B++){const G=[],ct=B/o,it=ct*(e-t)+t;for(let tt=0;tt<=r;tt++){const rt=tt/r,et=rt*l+a,pt=Math.sin(et),kt=Math.cos(et);F.x=it*pt,F.y=-ct*i+y,F.z=it*kt,d.push(F.x,F.y,F.z),I.set(pt,U,kt).normalize(),p.push(I.x,I.y,I.z),m.push(rt,1-ct),G.push(g++)}_.push(G)}for(let B=0;B<r;B++)for(let G=0;G<o;G++){const ct=_[G][B],it=_[G+1][B],tt=_[G+1][B+1],rt=_[G][B+1];h.push(ct,it,rt),h.push(it,tt,rt),N+=6}u.addGroup(w,N,0),w+=N})(),s===!1&&(t>0&&A(!0),e>0&&A(!1)),this.setIndex(h),this.setAttribute("position",new _e(d,3)),this.setAttribute("normal",new _e(p,3)),this.setAttribute("uv",new _e(m,2))}static fromJSON(t){return new He(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class Ce extends He{constructor(t=1,e=1,i=8,r=1,o=!1,s=0,a=2*Math.PI){super(0,t,e,i,r,o,s,a),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:i,heightSegments:r,openEnded:o,thetaStart:s,thetaLength:a}}static fromJSON(t){return new Ce(t.radius,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class Ue extends ze{constructor(t,e,i=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:i,detail:r};const o=[],s=[];function a(p,m,g,_){const y=_+1,w=[];for(let A=0;A<=y;A++){w[A]=[];const I=p.clone().lerp(g,A/y),F=m.clone().lerp(g,A/y),N=y-A;for(let U=0;U<=N;U++)w[A][U]=U===0&&A===y?I:I.clone().lerp(F,U/N)}for(let A=0;A<y;A++)for(let I=0;I<2*(y-A)-1;I++){const F=Math.floor(I/2);I%2==0?(l(w[A][F+1]),l(w[A+1][F]),l(w[A][F])):(l(w[A][F+1]),l(w[A+1][F+1]),l(w[A+1][F]))}}function l(p){o.push(p.x,p.y,p.z)}function u(p,m){const g=3*p;m.x=t[g+0],m.y=t[g+1],m.z=t[g+2]}function h(p,m,g,_){_<0&&p.x===1&&(s[m]=p.x-1),g.x===0&&g.z===0&&(s[m]=_/2/Math.PI+.5)}function d(p){return Math.atan2(p.z,-p.x)}(function(p){const m=new S,g=new S,_=new S;for(let y=0;y<e.length;y+=3)u(e[y+0],m),u(e[y+1],g),u(e[y+2],_),a(m,g,_,p)})(r),function(p){const m=new S;for(let g=0;g<o.length;g+=3)m.x=o[g+0],m.y=o[g+1],m.z=o[g+2],m.normalize().multiplyScalar(p),o[g+0]=m.x,o[g+1]=m.y,o[g+2]=m.z}(i),function(){const p=new S;for(let g=0;g<o.length;g+=3){p.x=o[g+0],p.y=o[g+1],p.z=o[g+2];const _=d(p)/2/Math.PI+.5,y=(m=p,Math.atan2(-m.y,Math.sqrt(m.x*m.x+m.z*m.z))/Math.PI+.5);s.push(_,1-y)}var m;(function(){const g=new S,_=new S,y=new S,w=new S,A=new ce,I=new ce,F=new ce;for(let N=0,U=0;N<o.length;N+=9,U+=6){g.set(o[N+0],o[N+1],o[N+2]),_.set(o[N+3],o[N+4],o[N+5]),y.set(o[N+6],o[N+7],o[N+8]),A.set(s[U+0],s[U+1]),I.set(s[U+2],s[U+3]),F.set(s[U+4],s[U+5]),w.copy(g).add(_).add(y).divideScalar(3);const B=d(w);h(A,U+0,g,B),h(I,U+2,_,B),h(F,U+4,y,B)}})(),function(){for(let g=0;g<s.length;g+=6){const _=s[g+0],y=s[g+2],w=s[g+4],A=Math.max(_,y,w),I=Math.min(_,y,w);A>.9&&I<.1&&(_<.2&&(s[g+0]+=1),y<.2&&(s[g+2]+=1),w<.2&&(s[g+4]+=1))}}()}(),this.setAttribute("position",new _e(o,3)),this.setAttribute("normal",new _e(o.slice(),3)),this.setAttribute("uv",new _e(s,2)),r===0?this.computeVertexNormals():this.normalizeNormals()}static fromJSON(t){return new Ue(t.vertices,t.indices,t.radius,t.details)}}class Ye extends Ue{constructor(t=1,e=0){const i=(1+Math.sqrt(5))/2,r=1/i;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-i,0,-r,i,0,r,-i,0,r,i,-r,-i,0,-r,i,0,r,-i,0,r,i,0,-i,0,-r,i,0,-r,-i,0,r,i,0,r],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new Ye(t.radius,t.detail)}}const li=new S,ke=new S,Je=new S,hn=new ji;class Vn extends ze{constructor(t,e){if(super(),this.type="EdgesGeometry",this.parameters={thresholdAngle:e},e=e!==void 0?e:1,t.isGeometry===!0)return void console.error("THREE.EdgesGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");const i=Math.pow(10,4),r=Math.cos(Hi*e),o=t.getIndex(),s=t.getAttribute("position"),a=o?o.count:s.count,l=[0,0,0],u=["a","b","c"],h=new Array(3),d={},p=[];for(let m=0;m<a;m+=3){o?(l[0]=o.getX(m),l[1]=o.getX(m+1),l[2]=o.getX(m+2)):(l[0]=m,l[1]=m+1,l[2]=m+2);const{a:g,b:_,c:y}=hn;if(g.fromBufferAttribute(s,l[0]),_.fromBufferAttribute(s,l[1]),y.fromBufferAttribute(s,l[2]),hn.getNormal(Je),h[0]=`${Math.round(g.x*i)},${Math.round(g.y*i)},${Math.round(g.z*i)}`,h[1]=`${Math.round(_.x*i)},${Math.round(_.y*i)},${Math.round(_.z*i)}`,h[2]=`${Math.round(y.x*i)},${Math.round(y.y*i)},${Math.round(y.z*i)}`,h[0]!==h[1]&&h[1]!==h[2]&&h[2]!==h[0])for(let w=0;w<3;w++){const A=(w+1)%3,I=h[w],F=h[A],N=hn[u[w]],U=hn[u[A]],B=`${I}_${F}`,G=`${F}_${I}`;G in d&&d[G]?(Je.dot(d[G].normal)<=r&&(p.push(N.x,N.y,N.z),p.push(U.x,U.y,U.z)),d[G]=null):B in d||(d[B]={index0:l[w],index1:l[A],normal:Je.clone()})}}for(const m in d)if(d[m]){const{index0:g,index1:_}=d[m];li.fromBufferAttribute(s,g),ke.fromBufferAttribute(s,_),p.push(li.x,li.y,li.z),p.push(ke.x,ke.y,ke.z)}this.setAttribute("position",new _e(p,3))}}class cn{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const i=this.getUtoTmapping(t);return this.getPoint(i,e)}getPoints(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return e}getSpacedPoints(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPointAt(i/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 i,r=this.getPoint(0),o=0;e.push(0);for(let s=1;s<=t;s++)i=this.getPoint(s/t),o+=i.distanceTo(r),e.push(o),r=i;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const i=this.getLengths();let r=0;const o=i.length;let s;s=e||t*i[o-1];let a,l=0,u=o-1;for(;l<=u;)if(r=Math.floor(l+(u-l)/2),a=i[r]-s,a<0)l=r+1;else{if(!(a>0)){u=r;break}u=r-1}if(r=u,i[r]===s)return r/(o-1);const h=i[r];return(r+(s-h)/(i[r+1]-h))/(o-1)}getTangent(t,e){let i=t-1e-4,r=t+1e-4;i<0&&(i=0),r>1&&(r=1);const o=this.getPoint(i),s=this.getPoint(r),a=e||(o.isVector2?new ce:new S);return a.copy(s).sub(o).normalize(),a}getTangentAt(t,e){const i=this.getUtoTmapping(t);return this.getTangent(i,e)}computeFrenetFrames(t,e){const i=new S,r=[],o=[],s=[],a=new S,l=new Ee;for(let m=0;m<=t;m++){const g=m/t;r[m]=this.getTangentAt(g,new S),r[m].normalize()}o[0]=new S,s[0]=new S;let u=Number.MAX_VALUE;const h=Math.abs(r[0].x),d=Math.abs(r[0].y),p=Math.abs(r[0].z);h<=u&&(u=h,i.set(1,0,0)),d<=u&&(u=d,i.set(0,1,0)),p<=u&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),o[0].crossVectors(r[0],a),s[0].crossVectors(r[0],o[0]);for(let m=1;m<=t;m++){if(o[m]=o[m-1].clone(),s[m]=s[m-1].clone(),a.crossVectors(r[m-1],r[m]),a.length()>Number.EPSILON){a.normalize();const g=Math.acos(zn(r[m-1].dot(r[m]),-1,1));o[m].applyMatrix4(l.makeRotationAxis(a,g))}s[m].crossVectors(r[m],o[m])}if(e===!0){let m=Math.acos(zn(o[0].dot(o[t]),-1,1));m/=t,r[0].dot(a.crossVectors(o[0],o[t]))>0&&(m=-m);for(let g=1;g<=t;g++)o[g].applyMatrix4(l.makeRotationAxis(r[g],m*g)),s[g].crossVectors(r[g],o[g])}return{tangents:r,normals:o,binormals:s}}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 on extends cn{constructor(t=0,e=0,i=1,r=1,o=0,s=2*Math.PI,a=!1,l=0){super(),this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=r,this.aStartAngle=o,this.aEndAngle=s,this.aClockwise=a,this.aRotation=l}getPoint(t,e){const i=e||new ce,r=2*Math.PI;let o=this.aEndAngle-this.aStartAngle;const s=Math.abs(o)<Number.EPSILON;for(;o<0;)o+=r;for(;o>r;)o-=r;o<Number.EPSILON&&(o=s?0:r),this.aClockwise!==!0||s||(o===r?o=-r:o-=r);const a=this.aStartAngle+t*o;let l=this.aX+this.xRadius*Math.cos(a),u=this.aY+this.yRadius*Math.sin(a);if(this.aRotation!==0){const h=Math.cos(this.aRotation),d=Math.sin(this.aRotation),p=l-this.aX,m=u-this.aY;l=p*h-m*d+this.aX,u=p*d+m*h+this.aY}return i.set(l,u)}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}}on.prototype.isEllipseCurve=!0;class so extends on{constructor(t,e,i,r,o,s){super(t,e,i,i,r,o,s),this.type="ArcCurve"}}function Eo(){let n=0,t=0,e=0,i=0;function r(o,s,a,l){n=o,t=a,e=-3*o+3*s-2*a-l,i=2*o-2*s+a+l}return{initCatmullRom:function(o,s,a,l,u){r(s,a,u*(a-o),u*(l-s))},initNonuniformCatmullRom:function(o,s,a,l,u,h,d){let p=(s-o)/u-(a-o)/(u+h)+(a-s)/h,m=(a-s)/h-(l-s)/(h+d)+(l-a)/d;p*=h,m*=h,r(s,a,p,m)},calc:function(o){const s=o*o;return n+t*o+e*s+i*(s*o)}}}so.prototype.isArcCurve=!0;const Ss=new S,sl=new Eo,Ts=new Eo,Mo=new Eo;class qh extends cn{constructor(t=[],e=!1,i="centripetal",r=.5){super(),this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=i,this.tension=r}getPoint(t,e=new S){const i=e,r=this.points,o=r.length,s=(o-(this.closed?0:1))*t;let a,l,u=Math.floor(s),h=s-u;this.closed?u+=u>0?0:(Math.floor(Math.abs(u)/o)+1)*o:h===0&&u===o-1&&(u=o-2,h=1),this.closed||u>0?a=r[(u-1)%o]:(Ss.subVectors(r[0],r[1]).add(r[0]),a=Ss);const d=r[u%o],p=r[(u+1)%o];if(this.closed||u+2<o?l=r[(u+2)%o]:(Ss.subVectors(r[o-1],r[o-2]).add(r[o-1]),l=Ss),this.curveType==="centripetal"||this.curveType==="chordal"){const m=this.curveType==="chordal"?.5:.25;let g=Math.pow(a.distanceToSquared(d),m),_=Math.pow(d.distanceToSquared(p),m),y=Math.pow(p.distanceToSquared(l),m);_<1e-4&&(_=1),g<1e-4&&(g=_),y<1e-4&&(y=_),sl.initNonuniformCatmullRom(a.x,d.x,p.x,l.x,g,_,y),Ts.initNonuniformCatmullRom(a.y,d.y,p.y,l.y,g,_,y),Mo.initNonuniformCatmullRom(a.z,d.z,p.z,l.z,g,_,y)}else this.curveType==="catmullrom"&&(sl.initCatmullRom(a.x,d.x,p.x,l.x,this.tension),Ts.initCatmullRom(a.y,d.y,p.y,l.y,this.tension),Mo.initCatmullRom(a.z,d.z,p.z,l.z,this.tension));return i.set(sl.calc(h),Ts.calc(h),Mo.calc(h)),i}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e<i;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,i=this.points.length;e<i;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,i=t.points.length;e<i;e++){const r=t.points[e];this.points.push(new S().fromArray(r))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}}function Ud(n,t,e,i,r){const o=.5*(i-t),s=.5*(r-e),a=n*n;return(2*e-2*i+o+s)*(n*a)+(-3*e+3*i-2*o-s)*a+o*n+e}function Es(n,t,e,i){return function(r,o){const s=1-r;return s*s*o}(n,t)+function(r,o){return 2*(1-r)*r*o}(n,e)+function(r,o){return r*r*o}(n,i)}function _a(n,t,e,i,r){return function(o,s){const a=1-o;return a*a*a*s}(n,t)+function(o,s){const a=1-o;return 3*a*a*o*s}(n,e)+function(o,s){return 3*(1-o)*o*o*s}(n,i)+function(o,s){return o*o*o*s}(n,r)}qh.prototype.isCatmullRomCurve3=!0;class ya extends cn{constructor(t=new ce,e=new ce,i=new ce,r=new ce){super(),this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=i,this.v3=r}getPoint(t,e=new ce){const i=e,r=this.v0,o=this.v1,s=this.v2,a=this.v3;return i.set(_a(t,r.x,o.x,s.x,a.x),_a(t,r.y,o.y,s.y,a.y)),i}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}}ya.prototype.isCubicBezierCurve=!0;class al extends cn{constructor(t=new S,e=new S,i=new S,r=new S){super(),this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=i,this.v3=r}getPoint(t,e=new S){const i=e,r=this.v0,o=this.v1,s=this.v2,a=this.v3;return i.set(_a(t,r.x,o.x,s.x,a.x),_a(t,r.y,o.y,s.y,a.y),_a(t,r.z,o.z,s.z,a.z)),i}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}}al.prototype.isCubicBezierCurve3=!0;class ll extends cn{constructor(t=new ce,e=new ce){super(),this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new ce){const i=e;return t===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e){const i=e||new ce;return i.copy(this.v2).sub(this.v1).normalize(),i}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}}ll.prototype.isLineCurve=!0;class lu extends cn{constructor(t=new S,e=new S){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=t,this.v2=e}getPoint(t,e=new S){const i=e;return t===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i}getPointAt(t,e){return this.getPoint(t,e)}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}}class xa extends cn{constructor(t=new ce,e=new ce,i=new ce){super(),this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=i}getPoint(t,e=new ce){const i=e,r=this.v0,o=this.v1,s=this.v2;return i.set(Es(t,r.x,o.x,s.x),Es(t,r.y,o.y,s.y)),i}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}}xa.prototype.isQuadraticBezierCurve=!0;class wv extends cn{constructor(t=new S,e=new S,i=new S){super(),this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=i}getPoint(t,e=new S){const i=e,r=this.v0,o=this.v1,s=this.v2;return i.set(Es(t,r.x,o.x,s.x),Es(t,r.y,o.y,s.y),Es(t,r.z,o.z,s.z)),i}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}}wv.prototype.isQuadraticBezierCurve3=!0;class im extends cn{constructor(t=[]){super(),this.type="SplineCurve",this.points=t}getPoint(t,e=new ce){const i=e,r=this.points,o=(r.length-1)*t,s=Math.floor(o),a=o-s,l=r[s===0?s:s-1],u=r[s],h=r[s>r.length-2?r.length-1:s+1],d=r[s>r.length-3?r.length-1:s+2];return i.set(Ud(a,l.x,u.x,h.x,d.x),Ud(a,l.y,u.y,h.y,d.y)),i}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const r=t.points[e];this.points.push(r.clone())}return this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,i=this.points.length;e<i;e++){const r=this.points[e];t.points.push(r.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const r=t.points[e];this.points.push(new ce().fromArray(r))}return this}}im.prototype.isSplineCurve=!0;var Sv=Object.freeze({__proto__:null,ArcCurve:so,CatmullRomCurve3:qh,CubicBezierCurve:ya,CubicBezierCurve3:al,EllipseCurve:on,LineCurve:ll,LineCurve3:lu,QuadraticBezierCurve:xa,QuadraticBezierCurve3:wv,SplineCurve:im});const WT=function(n,t,e=2){const i=t&&t.length,r=i?t[0]*e:n.length;let o=sy(n,0,r,e,!0);const s=[];if(!o||o.next===o.prev)return s;let a,l,u,h,d,p,m;if(i&&(o=function(g,_,y,w){const A=[];let I,F,N,U,B;for(I=0,F=_.length;I<F;I++)N=_[I]*w,U=I<F-1?_[I+1]*w:g.length,B=sy(g,N,U,w,!1),B===B.next&&(B.steiner=!0),A.push(QT(B));for(A.sort(JT),I=0;I<A.length;I++)ZT(A[I],y),y=ul(y,y.next);return y}(n,t,o,e)),n.length>80*e){a=u=n[0],l=h=n[1];for(let g=e;g<r;g+=e)d=n[g],p=n[g+1],d<a&&(a=d),p<l&&(l=p),d>u&&(u=d),p>h&&(h=p);m=Math.max(u-a,h-l),m=m!==0?1/m:0}return Gd(o,s,e,a,l,m),s};function sy(n,t,e,i,r){let o,s;if(r===function(a,l,u,h){let d=0;for(let p=l,m=u-h;p<u;p+=h)d+=(a[m]-a[p])*(a[p+1]+a[m+1]),m=p;return d}(n,t,e,i)>0)for(o=t;o<e;o+=i)s=uy(o,n[o],n[o+1],s);else for(o=e-i;o>=t;o-=i)s=uy(o,n[o],n[o+1],s);return s&&nm(s,s.next)&&(zd(s),s=s.next),s}function ul(n,t){if(!n)return n;t||(t=n);let e,i=n;do if(e=!1,i.steiner||!nm(i,i.next)&&gn(i.prev,i,i.next)!==0)i=i.next;else{if(zd(i),i=t=i.prev,i===i.next)break;e=!0}while(e||i!==t);return t}function Gd(n,t,e,i,r,o,s){if(!n)return;!s&&o&&function(h,d,p,m){let g=h;do g.z===null&&(g.z=Tv(g.x,g.y,d,p,m)),g.prevZ=g.prev,g.nextZ=g.next,g=g.next;while(g!==h);g.prevZ.nextZ=null,g.prevZ=null,function(_){let y,w,A,I,F,N,U,B,G=1;do{for(w=_,_=null,F=null,N=0;w;){for(N++,A=w,U=0,y=0;y<G&&(U++,A=A.nextZ,A);y++);for(B=G;U>0||B>0&&A;)U!==0&&(B===0||!A||w.z<=A.z)?(I=w,w=w.nextZ,U--):(I=A,A=A.nextZ,B--),F?F.nextZ=I:_=I,I.prevZ=F,F=I;w=A}F.nextZ=null,G*=2}while(N>1)}(g)}(n,i,r,o);let a,l,u=n;for(;n.prev!==n.next;)if(a=n.prev,l=n.next,o?qT(n,i,r,o):XT(n))t.push(a.i/e),t.push(n.i/e),t.push(l.i/e),zd(n),n=l.next,u=l.next;else if((n=l)===u){s?s===1?Gd(n=YT(ul(n),t,e),t,e,i,r,o,2):s===2&&$T(n,t,e,i,r,o):Gd(ul(n),t,e,i,r,o,1);break}}function XT(n){const t=n.prev,e=n,i=n.next;if(gn(t,e,i)>=0)return!1;let r=n.next.next;for(;r!==n.prev;){if(Yh(t.x,t.y,e.x,e.y,i.x,i.y,r.x,r.y)&&gn(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function qT(n,t,e,i){const r=n.prev,o=n,s=n.next;if(gn(r,o,s)>=0)return!1;const a=r.x<o.x?r.x<s.x?r.x:s.x:o.x<s.x?o.x:s.x,l=r.y<o.y?r.y<s.y?r.y:s.y:o.y<s.y?o.y:s.y,u=r.x>o.x?r.x>s.x?r.x:s.x:o.x>s.x?o.x:s.x,h=r.y>o.y?r.y>s.y?r.y:s.y:o.y>s.y?o.y:s.y,d=Tv(a,l,t,e,i),p=Tv(u,h,t,e,i);let m=n.prevZ,g=n.nextZ;for(;m&&m.z>=d&&g&&g.z<=p;){if(m!==n.prev&&m!==n.next&&Yh(r.x,r.y,o.x,o.y,s.x,s.y,m.x,m.y)&&gn(m.prev,m,m.next)>=0||(m=m.prevZ,g!==n.prev&&g!==n.next&&Yh(r.x,r.y,o.x,o.y,s.x,s.y,g.x,g.y)&&gn(g.prev,g,g.next)>=0))return!1;g=g.nextZ}for(;m&&m.z>=d;){if(m!==n.prev&&m!==n.next&&Yh(r.x,r.y,o.x,o.y,s.x,s.y,m.x,m.y)&&gn(m.prev,m,m.next)>=0)return!1;m=m.prevZ}for(;g&&g.z<=p;){if(g!==n.prev&&g!==n.next&&Yh(r.x,r.y,o.x,o.y,s.x,s.y,g.x,g.y)&&gn(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function YT(n,t,e){let i=n;do{const r=i.prev,o=i.next.next;!nm(r,o)&&ay(r,i,i.next,o)&&Hd(r,o)&&Hd(o,r)&&(t.push(r.i/e),t.push(i.i/e),t.push(o.i/e),zd(i),zd(i.next),i=n=o),i=i.next}while(i!==n);return ul(i)}function $T(n,t,e,i,r,o){let s=n;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&tE(s,a)){let l=ly(s,a);return s=ul(s,s.next),l=ul(l,l.next),Gd(s,t,e,i,r,o),void Gd(l,t,e,i,r,o)}a=a.next}s=s.next}while(s!==n)}function JT(n,t){return n.x-t.x}function ZT(n,t){if(t=function(e,i){let r=i;const o=e.x,s=e.y;let a,l=-1/0;do{if(s<=r.y&&s>=r.next.y&&r.next.y!==r.y){const g=r.x+(s-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(g<=o&&g>l){if(l=g,g===o){if(s===r.y)return r;if(s===r.next.y)return r.next}a=r.x<r.next.x?r:r.next}}r=r.next}while(r!==i);if(!a)return null;if(o===l)return a;const u=a,h=a.x,d=a.y;let p,m=1/0;r=a;do o>=r.x&&r.x>=h&&o!==r.x&&Yh(s<d?o:l,s,h,d,s<d?l:o,s,r.x,r.y)&&(p=Math.abs(s-r.y)/(o-r.x),Hd(r,e)&&(p<m||p===m&&(r.x>a.x||r.x===a.x&&KT(a,r)))&&(a=r,m=p)),r=r.next;while(r!==u);return a}(n,t)){const e=ly(t,n);ul(t,t.next),ul(e,e.next)}}function KT(n,t){return gn(n.prev,n,t.prev)<0&&gn(t.next,n,n.next)<0}function Tv(n,t,e,i,r){return(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=32767*(n-e)*r)|n<<8))|n<<4))|n<<2))|n<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function QT(n){let t=n,e=n;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==n);return e}function Yh(n,t,e,i,r,o,s,a){return(r-s)*(t-a)-(n-s)*(o-a)>=0&&(n-s)*(i-a)-(e-s)*(t-a)>=0&&(e-s)*(o-a)-(r-s)*(i-a)>=0}function tE(n,t){return n.next.i!==t.i&&n.prev.i!==t.i&&!function(e,i){let r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==i.i&&r.next.i!==i.i&&ay(r,r.next,e,i))return!0;r=r.next}while(r!==e);return!1}(n,t)&&(Hd(n,t)&&Hd(t,n)&&function(e,i){let r=e,o=!1;const s=(e.x+i.x)/2,a=(e.y+i.y)/2;do r.y>a!=r.next.y>a&&r.next.y!==r.y&&s<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(o=!o),r=r.next;while(r!==e);return o}(n,t)&&(gn(n.prev,n,t.prev)||gn(n,t.prev,t))||nm(n,t)&&gn(n.prev,n,n.next)>0&&gn(t.prev,t,t.next)>0)}function gn(n,t,e){return(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y)}function nm(n,t){return n.x===t.x&&n.y===t.y}function ay(n,t,e,i){const r=om(gn(n,t,e)),o=om(gn(n,t,i)),s=om(gn(e,i,n)),a=om(gn(e,i,t));return r!==o&&s!==a||!(r!==0||!rm(n,e,t))||!(o!==0||!rm(n,i,t))||!(s!==0||!rm(e,n,i))||!(a!==0||!rm(e,t,i))}function rm(n,t,e){return t.x<=Math.max(n.x,e.x)&&t.x>=Math.min(n.x,e.x)&&t.y<=Math.max(n.y,e.y)&&t.y>=Math.min(n.y,e.y)}function om(n){return n>0?1:n<0?-1:0}function Hd(n,t){return gn(n.prev,n,n.next)<0?gn(n,t,n.next)>=0&&gn(n,n.prev,t)>=0:gn(n,t,n.prev)<0||gn(n,n.next,t)<0}function ly(n,t){const e=new Ev(n.i,n.x,n.y),i=new Ev(t.i,t.x,t.y),r=n.next,o=t.prev;return n.next=t,t.prev=n,e.next=r,r.prev=e,i.next=e,e.prev=i,o.next=i,i.prev=o,i}function uy(n,t,e,i){const r=new Ev(n,t,e);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function zd(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function Ev(n,t,e){this.i=n,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 Ms{static area(t){const e=t.length;let i=0;for(let r=e-1,o=0;o<e;r=o++)i+=t[r].x*t[o].y-t[o].x*t[r].y;return .5*i}static isClockWise(t){return Ms.area(t)<0}static triangulateShape(t,e){const i=[],r=[],o=[];hy(t),cy(i,t);let s=t.length;e.forEach(hy);for(let l=0;l<e.length;l++)r.push(s),s+=e[l].length,cy(i,e[l]);const a=WT(i,r);for(let l=0;l<a.length;l+=3)o.push(a.slice(l,l+3));return o}}function hy(n){const t=n.length;t>2&&n[t-1].equals(n[0])&&n.pop()}function cy(n,t){for(let e=0;e<t.length;e++)n.push(t[e].x),n.push(t[e].y)}class $o extends ze{constructor(t,e){super(),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];const i=this,r=[],o=[];for(let a=0,l=t.length;a<l;a++)s(t[a]);function s(a){const l=[],u=e.curveSegments!==void 0?e.curveSegments:12,h=e.steps!==void 0?e.steps:1;let d=e.depth!==void 0?e.depth:100,p=e.bevelEnabled===void 0||e.bevelEnabled,m=e.bevelThickness!==void 0?e.bevelThickness:6,g=e.bevelSize!==void 0?e.bevelSize:m-2,_=e.bevelOffset!==void 0?e.bevelOffset:0,y=e.bevelSegments!==void 0?e.bevelSegments:3;const w=e.extrudePath,A=e.UVGenerator!==void 0?e.UVGenerator:eE;e.amount!==void 0&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),d=e.amount);let I,F,N,U,B,G=!1;w&&(I=w.getSpacedPoints(h),G=!0,p=!1,F=w.computeFrenetFrames(h,!1),N=new S,U=new S,B=new S),p||(y=0,m=0,g=0,_=0);const ct=a.extractPoints(u);let it=ct.shape;const tt=ct.holes;if(!Ms.isClockWise(it)){it=it.reverse();for(let Vt=0,Q=tt.length;Vt<Q;Vt++){const gt=tt[Vt];Ms.isClockWise(gt)&&(tt[Vt]=gt.reverse())}}const rt=Ms.triangulateShape(it,tt),et=it;for(let Vt=0,Q=tt.length;Vt<Q;Vt++){const gt=tt[Vt];it=it.concat(gt)}function pt(Vt,Q,gt){return Q||console.error("THREE.ExtrudeGeometry: vec does not exist"),Q.clone().multiplyScalar(gt).add(Vt)}const kt=it.length,Lt=rt.length;function _t(Vt,Q,gt){let Dt,Ft,St;const Yt=Vt.x-Q.x,Me=Vt.y-Q.y,Re=gt.x-Vt.x,Ae=gt.y-Vt.y,si=Yt*Yt+Me*Me,Tn=Yt*Ae-Me*Re;if(Math.abs(Tn)>Number.EPSILON){const Ni=Math.sqrt(si),Yr=Math.sqrt(Re*Re+Ae*Ae),Rp=Q.x-Me/Ni,Cp=Q.y+Yt/Ni,Pp=((gt.x-Ae/Yr-Rp)*Ae-(gt.y+Re/Yr-Cp)*Re)/(Yt*Ae-Me*Re);Dt=Rp+Yt*Pp-Vt.x,Ft=Cp+Me*Pp-Vt.y;const Fr=Dt*Dt+Ft*Ft;if(Fr<=2)return new ce(Dt,Ft);St=Math.sqrt(Fr/2)}else{let Ni=!1;Yt>Number.EPSILON?Re>Number.EPSILON&&(Ni=!0):Yt<-Number.EPSILON?Re<-Number.EPSILON&&(Ni=!0):Math.sign(Me)===Math.sign(Ae)&&(Ni=!0),Ni?(Dt=-Me,Ft=Yt,St=Math.sqrt(si)):(Dt=Yt,Ft=Me,St=Math.sqrt(si/2))}return new ce(Dt/St,Ft/St)}const xt=[];for(let Vt=0,Q=et.length,gt=Q-1,Dt=Vt+1;Vt<Q;Vt++,gt++,Dt++)gt===Q&&(gt=0),Dt===Q&&(Dt=0),xt[Vt]=_t(et[Vt],et[gt],et[Dt]);const jt=[];let ee,le=xt.concat();for(let Vt=0,Q=tt.length;Vt<Q;Vt++){const gt=tt[Vt];ee=[];for(let Dt=0,Ft=gt.length,St=Ft-1,Yt=Dt+1;Dt<Ft;Dt++,St++,Yt++)St===Ft&&(St=0),Yt===Ft&&(Yt=0),ee[Dt]=_t(gt[Dt],gt[St],gt[Yt]);jt.push(ee),le=le.concat(ee)}for(let Vt=0;Vt<y;Vt++){const Q=Vt/y,gt=m*Math.cos(Q*Math.PI/2),Dt=g*Math.sin(Q*Math.PI/2)+_;for(let Ft=0,St=et.length;Ft<St;Ft++){const Yt=pt(et[Ft],xt[Ft],Dt);Xt(Yt.x,Yt.y,-gt)}for(let Ft=0,St=tt.length;Ft<St;Ft++){const Yt=tt[Ft];ee=jt[Ft];for(let Me=0,Re=Yt.length;Me<Re;Me++){const Ae=pt(Yt[Me],ee[Me],Dt);Xt(Ae.x,Ae.y,-gt)}}}const nt=g+_;for(let Vt=0;Vt<kt;Vt++){const Q=p?pt(it[Vt],le[Vt],nt):it[Vt];G?(U.copy(F.normals[0]).multiplyScalar(Q.x),N.copy(F.binormals[0]).multiplyScalar(Q.y),B.copy(I[0]).add(U).add(N),Xt(B.x,B.y,B.z)):Xt(Q.x,Q.y,0)}for(let Vt=1;Vt<=h;Vt++)for(let Q=0;Q<kt;Q++){const gt=p?pt(it[Q],le[Q],nt):it[Q];G?(U.copy(F.normals[Vt]).multiplyScalar(gt.x),N.copy(F.binormals[Vt]).multiplyScalar(gt.y),B.copy(I[Vt]).add(U).add(N),Xt(B.x,B.y,B.z)):Xt(gt.x,gt.y,d/h*Vt)}for(let Vt=y-1;Vt>=0;Vt--){const Q=Vt/y,gt=m*Math.cos(Q*Math.PI/2),Dt=g*Math.sin(Q*Math.PI/2)+_;for(let Ft=0,St=et.length;Ft<St;Ft++){const Yt=pt(et[Ft],xt[Ft],Dt);Xt(Yt.x,Yt.y,d+gt)}for(let Ft=0,St=tt.length;Ft<St;Ft++){const Yt=tt[Ft];ee=jt[Ft];for(let Me=0,Re=Yt.length;Me<Re;Me++){const Ae=pt(Yt[Me],ee[Me],Dt);G?Xt(Ae.x,Ae.y+I[h-1].y,I[h-1].x+gt):Xt(Ae.x,Ae.y,d+gt)}}}function lt(Vt,Q){let gt=Vt.length;for(;--gt>=0;){const Dt=gt;let Ft=gt-1;Ft<0&&(Ft=Vt.length-1);for(let St=0,Yt=h+2*y;St<Yt;St++){const Me=kt*St,Re=kt*(St+1);Bt(Q+Dt+Me,Q+Ft+Me,Q+Ft+Re,Q+Dt+Re)}}}function Xt(Vt,Q,gt){l.push(Vt),l.push(Q),l.push(gt)}function Ut(Vt,Q,gt){ue(Vt),ue(Q),ue(gt);const Dt=r.length/3,Ft=A.generateTopUV(i,r,Dt-3,Dt-2,Dt-1);he(Ft[0]),he(Ft[1]),he(Ft[2])}function Bt(Vt,Q,gt,Dt){ue(Vt),ue(Q),ue(Dt),ue(Q),ue(gt),ue(Dt);const Ft=r.length/3,St=A.generateSideWallUV(i,r,Ft-6,Ft-3,Ft-2,Ft-1);he(St[0]),he(St[1]),he(St[3]),he(St[1]),he(St[2]),he(St[3])}function ue(Vt){r.push(l[3*Vt+0]),r.push(l[3*Vt+1]),r.push(l[3*Vt+2])}function he(Vt){o.push(Vt.x),o.push(Vt.y)}(function(){const Vt=r.length/3;if(p){let Q=0,gt=kt*Q;for(let Dt=0;Dt<Lt;Dt++){const Ft=rt[Dt];Ut(Ft[2]+gt,Ft[1]+gt,Ft[0]+gt)}Q=h+2*y,gt=kt*Q;for(let Dt=0;Dt<Lt;Dt++){const Ft=rt[Dt];Ut(Ft[0]+gt,Ft[1]+gt,Ft[2]+gt)}}else{for(let Q=0;Q<Lt;Q++){const gt=rt[Q];Ut(gt[2],gt[1],gt[0])}for(let Q=0;Q<Lt;Q++){const gt=rt[Q];Ut(gt[0]+kt*h,gt[1]+kt*h,gt[2]+kt*h)}}i.addGroup(Vt,r.length/3-Vt,0)})(),function(){const Vt=r.length/3;let Q=0;lt(et,Q),Q+=et.length;for(let gt=0,Dt=tt.length;gt<Dt;gt++){const Ft=tt[gt];lt(Ft,Q),Q+=Ft.length}i.addGroup(Vt,r.length/3-Vt,1)}()}this.setAttribute("position",new _e(r,3)),this.setAttribute("uv",new _e(o,2)),this.computeVertexNormals()}toJSON(){const t=super.toJSON();return function(e,i,r){if(r.shapes=[],Array.isArray(e))for(let o=0,s=e.length;o<s;o++){const a=e[o];r.shapes.push(a.uuid)}else r.shapes.push(e.uuid);return i.extrudePath!==void 0&&(r.options.extrudePath=i.extrudePath.toJSON()),r}(this.parameters.shapes,this.parameters.options,t)}static fromJSON(t,e){const i=[];for(let o=0,s=t.shapes.length;o<s;o++){const a=e[t.shapes[o]];i.push(a)}const r=t.options.extrudePath;return r!==void 0&&(t.options.extrudePath=new Sv[r.type]().fromJSON(r)),new $o(i,t.options)}}const eE={generateTopUV:function(n,t,e,i,r){const o=t[3*e],s=t[3*e+1],a=t[3*i],l=t[3*i+1],u=t[3*r],h=t[3*r+1];return[new ce(o,s),new ce(a,l),new ce(u,h)]},generateSideWallUV:function(n,t,e,i,r,o){const s=t[3*e],a=t[3*e+1],l=t[3*e+2],u=t[3*i],h=t[3*i+1],d=t[3*i+2],p=t[3*r],m=t[3*r+1],g=t[3*r+2],_=t[3*o],y=t[3*o+1],w=t[3*o+2];return Math.abs(a-h)<Math.abs(s-u)?[new ce(s,1-l),new ce(u,1-d),new ce(p,1-g),new ce(_,1-w)]:[new ce(a,1-l),new ce(h,1-d),new ce(m,1-g),new ce(y,1-w)]}};class $h extends Ue{constructor(t=1,e=0){const i=(1+Math.sqrt(5))/2;super([-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],t,e),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new $h(t.radius,t.detail)}}class Jh extends ze{constructor(t,e=12,i=0,r=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:i,phiLength:r},e=Math.floor(e),r=zn(r,0,2*Math.PI);const o=[],s=[],a=[],l=1/e,u=new S,h=new ce;for(let d=0;d<=e;d++){const p=i+d*l*r,m=Math.sin(p),g=Math.cos(p);for(let _=0;_<=t.length-1;_++)u.x=t[_].x*m,u.y=t[_].y,u.z=t[_].x*g,s.push(u.x,u.y,u.z),h.x=d/e,h.y=_/(t.length-1),a.push(h.x,h.y)}for(let d=0;d<e;d++)for(let p=0;p<t.length-1;p++){const m=p+d*t.length,g=m,_=m+t.length,y=m+t.length+1,w=m+1;o.push(g,_,w),o.push(_,y,w)}if(this.setIndex(o),this.setAttribute("position",new _e(s,3)),this.setAttribute("uv",new _e(a,2)),this.computeVertexNormals(),r===2*Math.PI){const d=this.attributes.normal.array,p=new S,m=new S,g=new S,_=e*t.length*3;for(let y=0,w=0;y<t.length;y++,w+=3)p.x=d[w+0],p.y=d[w+1],p.z=d[w+2],m.x=d[_+w+0],m.y=d[_+w+1],m.z=d[_+w+2],g.addVectors(p,m).normalize(),d[w+0]=d[_+w+0]=g.x,d[w+1]=d[_+w+1]=g.y,d[w+2]=d[_+w+2]=g.z}}static fromJSON(t){return new Jh(t.points,t.segments,t.phiStart,t.phiLength)}}class uu extends Ue{constructor(t=1,e=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new uu(t.radius,t.detail)}}class jd extends ze{constructor(t,e,i){super(),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:i};const r=[],o=[],s=[],a=[],l=1e-5,u=new S,h=new S,d=new S,p=new S,m=new S;t.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");const g=e+1;for(let _=0;_<=i;_++){const y=_/i;for(let w=0;w<=e;w++){const A=w/e;t(A,y,h),o.push(h.x,h.y,h.z),A-l>=0?(t(A-l,y,d),p.subVectors(h,d)):(t(A+l,y,d),p.subVectors(d,h)),y-l>=0?(t(A,y-l,d),m.subVectors(h,d)):(t(A,y+l,d),m.subVectors(d,h)),u.crossVectors(p,m).normalize(),s.push(u.x,u.y,u.z),a.push(A,y)}}for(let _=0;_<i;_++)for(let y=0;y<e;y++){const w=_*g+y,A=_*g+y+1,I=(_+1)*g+y+1,F=(_+1)*g+y;r.push(w,A,F),r.push(A,I,F)}this.setIndex(r),this.setAttribute("position",new _e(o,3)),this.setAttribute("normal",new _e(s,3)),this.setAttribute("uv",new _e(a,2))}}class Zh extends ze{constructor(t=.5,e=1,i=8,r=1,o=0,s=2*Math.PI){super(),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:i,phiSegments:r,thetaStart:o,thetaLength:s},i=Math.max(3,i);const a=[],l=[],u=[],h=[];let d=t;const p=(e-t)/(r=Math.max(1,r)),m=new S,g=new ce;for(let _=0;_<=r;_++){for(let y=0;y<=i;y++){const w=o+y/i*s;m.x=d*Math.cos(w),m.y=d*Math.sin(w),l.push(m.x,m.y,m.z),u.push(0,0,1),g.x=(m.x/e+1)/2,g.y=(m.y/e+1)/2,h.push(g.x,g.y)}d+=p}for(let _=0;_<r;_++){const y=_*(i+1);for(let w=0;w<i;w++){const A=w+y,I=A,F=A+i+1,N=A+i+2,U=A+1;a.push(I,F,U),a.push(F,N,U)}}this.setIndex(a),this.setAttribute("position",new _e(l,3)),this.setAttribute("normal",new _e(u,3)),this.setAttribute("uv",new _e(h,2))}static fromJSON(t){return new Zh(t.innerRadius,t.outerRadius,t.thetaSegments,t.phiSegments,t.thetaStart,t.thetaLength)}}class hu extends ze{constructor(t,e=12){super(),this.type="ShapeGeometry",this.parameters={shapes:t,curveSegments:e};const i=[],r=[],o=[],s=[];let a=0,l=0;if(Array.isArray(t)===!1)u(t);else for(let h=0;h<t.length;h++)u(t[h]),this.addGroup(a,l,h),a+=l,l=0;function u(h){const d=r.length/3,p=h.extractPoints(e);let m=p.shape;const g=p.holes;Ms.isClockWise(m)===!1&&(m=m.reverse());for(let y=0,w=g.length;y<w;y++){const A=g[y];Ms.isClockWise(A)===!0&&(g[y]=A.reverse())}const _=Ms.triangulateShape(m,g);for(let y=0,w=g.length;y<w;y++){const A=g[y];m=m.concat(A)}for(let y=0,w=m.length;y<w;y++){const A=m[y];r.push(A.x,A.y,0),o.push(0,0,1),s.push(A.x,A.y)}for(let y=0,w=_.length;y<w;y++){const A=_[y],I=A[0]+d,F=A[1]+d,N=A[2]+d;i.push(I,F,N),l+=3}}this.setIndex(i),this.setAttribute("position",new _e(r,3)),this.setAttribute("normal",new _e(o,3)),this.setAttribute("uv",new _e(s,2))}toJSON(){const t=super.toJSON();return function(e,i){if(i.shapes=[],Array.isArray(e))for(let r=0,o=e.length;r<o;r++){const s=e[r];i.shapes.push(s.uuid)}else i.shapes.push(e.uuid);return i}(this.parameters.shapes,t)}static fromJSON(t,e){const i=[];for(let r=0,o=t.shapes.length;r<o;r++){const s=e[t.shapes[r]];i.push(s)}return new hu(i,t.curveSegments)}}class cu extends ze{constructor(t=1,e=8,i=6,r=0,o=2*Math.PI,s=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:i,phiStart:r,phiLength:o,thetaStart:s,thetaLength:a},e=Math.max(3,Math.floor(e)),i=Math.max(2,Math.floor(i));const l=Math.min(s+a,Math.PI);let u=0;const h=[],d=new S,p=new S,m=[],g=[],_=[],y=[];for(let w=0;w<=i;w++){const A=[],I=w/i;let F=0;w==0&&s==0?F=.5/e:w==i&&l==Math.PI&&(F=-.5/e);for(let N=0;N<=e;N++){const U=N/e;d.x=-t*Math.cos(r+U*o)*Math.sin(s+I*a),d.y=t*Math.cos(s+I*a),d.z=t*Math.sin(r+U*o)*Math.sin(s+I*a),g.push(d.x,d.y,d.z),p.copy(d).normalize(),_.push(p.x,p.y,p.z),y.push(U+F,1-I),A.push(u++)}h.push(A)}for(let w=0;w<i;w++)for(let A=0;A<e;A++){const I=h[w][A+1],F=h[w][A],N=h[w+1][A],U=h[w+1][A+1];(w!==0||s>0)&&m.push(I,F,U),(w!==i-1||l<Math.PI)&&m.push(F,N,U)}this.setIndex(m),this.setAttribute("position",new _e(g,3)),this.setAttribute("normal",new _e(_,3)),this.setAttribute("uv",new _e(y,2))}static fromJSON(t){return new cu(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}class Kh extends Ue{constructor(t=1,e=0){super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new Kh(t.radius,t.detail)}}class sm extends $o{constructor(t,e={}){const i=e.font;if(!i||!i.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new ze;const r=i.generateShapes(t,e.size);e.depth=e.height!==void 0?e.height:50,e.bevelThickness===void 0&&(e.bevelThickness=10),e.bevelSize===void 0&&(e.bevelSize=8),e.bevelEnabled===void 0&&(e.bevelEnabled=!1),super(r,e),this.type="TextGeometry"}}class Qh extends ze{constructor(t=1,e=.4,i=8,r=6,o=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:i,tubularSegments:r,arc:o},i=Math.floor(i),r=Math.floor(r);const s=[],a=[],l=[],u=[],h=new S,d=new S,p=new S;for(let m=0;m<=i;m++)for(let g=0;g<=r;g++){const _=g/r*o,y=m/i*Math.PI*2;d.x=(t+e*Math.cos(y))*Math.cos(_),d.y=(t+e*Math.cos(y))*Math.sin(_),d.z=e*Math.sin(y),a.push(d.x,d.y,d.z),h.x=t*Math.cos(_),h.y=t*Math.sin(_),p.subVectors(d,h).normalize(),l.push(p.x,p.y,p.z),u.push(g/r),u.push(m/i)}for(let m=1;m<=i;m++)for(let g=1;g<=r;g++){const _=(r+1)*m+g-1,y=(r+1)*(m-1)+g-1,w=(r+1)*(m-1)+g,A=(r+1)*m+g;s.push(_,y,A),s.push(y,w,A)}this.setIndex(s),this.setAttribute("position",new _e(a,3)),this.setAttribute("normal",new _e(l,3)),this.setAttribute("uv",new _e(u,2))}static fromJSON(t){return new Qh(t.radius,t.tube,t.radialSegments,t.tubularSegments,t.arc)}}class tc extends ze{constructor(t=1,e=.4,i=64,r=8,o=2,s=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:i,radialSegments:r,p:o,q:s},i=Math.floor(i),r=Math.floor(r);const a=[],l=[],u=[],h=[],d=new S,p=new S,m=new S,g=new S,_=new S,y=new S,w=new S;for(let I=0;I<=i;++I){const F=I/i*o*Math.PI*2;A(F,o,s,t,m),A(F+.01,o,s,t,g),y.subVectors(g,m),w.addVectors(g,m),_.crossVectors(y,w),w.crossVectors(_,y),_.normalize(),w.normalize();for(let N=0;N<=r;++N){const U=N/r*Math.PI*2,B=-e*Math.cos(U),G=e*Math.sin(U);d.x=m.x+(B*w.x+G*_.x),d.y=m.y+(B*w.y+G*_.y),d.z=m.z+(B*w.z+G*_.z),l.push(d.x,d.y,d.z),p.subVectors(d,m).normalize(),u.push(p.x,p.y,p.z),h.push(I/i),h.push(N/r)}}for(let I=1;I<=i;I++)for(let F=1;F<=r;F++){const N=(r+1)*(I-1)+(F-1),U=(r+1)*I+(F-1),B=(r+1)*I+F,G=(r+1)*(I-1)+F;a.push(N,U,G),a.push(U,B,G)}function A(I,F,N,U,B){const G=Math.cos(I),ct=Math.sin(I),it=N/F*I,tt=Math.cos(it);B.x=U*(2+tt)*.5*G,B.y=U*(2+tt)*ct*.5,B.z=U*Math.sin(it)*.5}this.setIndex(a),this.setAttribute("position",new _e(l,3)),this.setAttribute("normal",new _e(u,3)),this.setAttribute("uv",new _e(h,2))}static fromJSON(t){return new tc(t.radius,t.tube,t.tubularSegments,t.radialSegments,t.p,t.q)}}class ec extends ze{constructor(t,e=64,i=1,r=8,o=!1){super(),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:i,radialSegments:r,closed:o};const s=t.computeFrenetFrames(e,o);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals;const a=new S,l=new S,u=new ce;let h=new S;const d=[],p=[],m=[],g=[];function _(y){h=t.getPointAt(y/e,h);const w=s.normals[y],A=s.binormals[y];for(let I=0;I<=r;I++){const F=I/r*Math.PI*2,N=Math.sin(F),U=-Math.cos(F);l.x=U*w.x+N*A.x,l.y=U*w.y+N*A.y,l.z=U*w.z+N*A.z,l.normalize(),p.push(l.x,l.y,l.z),a.x=h.x+i*l.x,a.y=h.y+i*l.y,a.z=h.z+i*l.z,d.push(a.x,a.y,a.z)}}(function(){for(let y=0;y<e;y++)_(y);_(o===!1?e:0),function(){for(let y=0;y<=e;y++)for(let w=0;w<=r;w++)u.x=y/e,u.y=w/r,m.push(u.x,u.y)}(),function(){for(let y=1;y<=e;y++)for(let w=1;w<=r;w++){const A=(r+1)*(y-1)+(w-1),I=(r+1)*y+(w-1),F=(r+1)*y+w,N=(r+1)*(y-1)+w;g.push(A,I,N),g.push(I,F,N)}}()})(),this.setIndex(g),this.setAttribute("position",new _e(d,3)),this.setAttribute("normal",new _e(p,3)),this.setAttribute("uv",new _e(m,2))}toJSON(){const t=super.toJSON();return t.path=this.parameters.path.toJSON(),t}static fromJSON(t){return new ec(new Sv[t.path.type]().fromJSON(t.path),t.tubularSegments,t.radius,t.radialSegments,t.closed)}}class Mv extends ze{constructor(t){if(super(),this.type="WireframeGeometry",t.isGeometry===!0)return void console.error("THREE.WireframeGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");const e=[],i=[0,0],r={},o=new S;if(t.index!==null){const s=t.attributes.position,a=t.index;let l=t.groups;l.length===0&&(l=[{start:0,count:a.count,materialIndex:0}]);for(let u=0,h=l.length;u<h;++u){const d=l[u],p=d.start;for(let m=p,g=p+d.count;m<g;m+=3)for(let _=0;_<3;_++){const y=a.getX(m+_),w=a.getX(m+(_+1)%3);i[0]=Math.min(y,w),i[1]=Math.max(y,w);const A=i[0]+","+i[1];r[A]===void 0&&(r[A]={index1:i[0],index2:i[1]})}}for(const u in r){const h=r[u];o.fromBufferAttribute(s,h.index1),e.push(o.x,o.y,o.z),o.fromBufferAttribute(s,h.index2),e.push(o.x,o.y,o.z)}}else{const s=t.attributes.position;for(let a=0,l=s.count/3;a<l;a++)for(let u=0;u<3;u++){const h=3*a+u;o.fromBufferAttribute(s,h),e.push(o.x,o.y,o.z);const d=3*a+(u+1)%3;o.fromBufferAttribute(s,d),e.push(o.x,o.y,o.z)}}this.setAttribute("position",new _e(e,3))}}var dy=Object.freeze({__proto__:null,BoxGeometry:wo,BoxBufferGeometry:wo,CircleGeometry:pe,CircleBufferGeometry:pe,ConeGeometry:Ce,ConeBufferGeometry:Ce,CylinderGeometry:He,CylinderBufferGeometry:He,DodecahedronGeometry:Ye,DodecahedronBufferGeometry:Ye,EdgesGeometry:Vn,ExtrudeGeometry:$o,ExtrudeBufferGeometry:$o,IcosahedronGeometry:$h,IcosahedronBufferGeometry:$h,LatheGeometry:Jh,LatheBufferGeometry:Jh,OctahedronGeometry:uu,OctahedronBufferGeometry:uu,ParametricGeometry:jd,ParametricBufferGeometry:jd,PlaneGeometry:Kn,PlaneBufferGeometry:Kn,PolyhedronGeometry:Ue,PolyhedronBufferGeometry:Ue,RingGeometry:Zh,RingBufferGeometry:Zh,ShapeGeometry:hu,ShapeBufferGeometry:hu,SphereGeometry:cu,SphereBufferGeometry:cu,TetrahedronGeometry:Kh,TetrahedronBufferGeometry:Kh,TextGeometry:sm,TextBufferGeometry:sm,TorusGeometry:Qh,TorusBufferGeometry:Qh,TorusKnotGeometry:tc,TorusKnotBufferGeometry:tc,TubeGeometry:ec,TubeBufferGeometry:ec,WireframeGeometry:Mv});class Av extends Dn{constructor(t){super(),this.type="ShadowMaterial",this.color=new Le(0),this.transparent=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this}}Av.prototype.isShadowMaterial=!0;class ic extends rr{constructor(t){super(t),this.type="RawShaderMaterial"}}ic.prototype.isRawShaderMaterial=!0;class am extends Dn{constructor(t){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Le(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 Le(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Br,this.normalScale=new ce(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}}am.prototype.isMeshStandardMaterial=!0;class Rv extends am{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 ce(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=zn(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 Le(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 Le).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}}Rv.prototype.isMeshPhysicalMaterial=!0;class lm extends Dn{constructor(t){super(),this.type="MeshPhongMaterial",this.color=new Le(16777215),this.specular=new Le(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Le(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Br,this.normalScale=new ce(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Hs,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}}lm.prototype.isMeshPhongMaterial=!0;class Cv extends Dn{constructor(t){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Le(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Le(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Br,this.normalScale=new ce(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}}Cv.prototype.isMeshToonMaterial=!0;class Pv extends Dn{constructor(t){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Br,this.normalScale=new ce(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}}Pv.prototype.isMeshNormalMaterial=!0;class um extends Dn{constructor(t){super(),this.type="MeshLambertMaterial",this.color=new Le(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Le(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Hs,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}}um.prototype.isMeshLambertMaterial=!0;class Iv extends Dn{constructor(t){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Le(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Br,this.normalScale=new ce(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}}Iv.prototype.isMeshMatcapMaterial=!0;class Lv extends Bn{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}}Lv.prototype.isLineDashedMaterial=!0;var iE=Object.freeze({__proto__:null,ShadowMaterial:Av,SpriteMaterial:iu,RawShaderMaterial:ic,ShaderMaterial:rr,PointsMaterial:$,MeshPhysicalMaterial:Rv,MeshStandardMaterial:am,MeshPhongMaterial:lm,MeshToonMaterial:Cv,MeshNormalMaterial:Pv,MeshLambertMaterial:um,MeshDepthMaterial:xi,MeshDistanceMaterial:Dh,MeshBasicMaterial:pn,MeshMatcapMaterial:Iv,LineDashedMaterial:Lv,LineBasicMaterial:Bn,Material:Dn});const sn={arraySlice:function(n,t,e){return sn.isTypedArray(n)?new n.constructor(n.subarray(t,e!==void 0?e:n.length)):n.slice(t,e)},convertArray:function(n,t,e){return!n||!e&&n.constructor===t?n:typeof t.BYTES_PER_ELEMENT=="number"?new t(n):Array.prototype.slice.call(n)},isTypedArray:function(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)},getKeyframeOrder:function(n){const t=n.length,e=new Array(t);for(let i=0;i!==t;++i)e[i]=i;return e.sort(function(i,r){return n[i]-n[r]}),e},sortedArray:function(n,t,e){const i=n.length,r=new n.constructor(i);for(let o=0,s=0;s!==i;++o){const a=e[o]*t;for(let l=0;l!==t;++l)r[s++]=n[a+l]}return r},flattenJSON:function(n,t,e,i){let r=1,o=n[0];for(;o!==void 0&&o[i]===void 0;)o=n[r++];if(o===void 0)return;let s=o[i];if(s!==void 0)if(Array.isArray(s))do s=o[i],s!==void 0&&(t.push(o.time),e.push.apply(e,s)),o=n[r++];while(o!==void 0);else if(s.toArray!==void 0)do s=o[i],s!==void 0&&(t.push(o.time),s.toArray(e,e.length)),o=n[r++];while(o!==void 0);else do s=o[i],s!==void 0&&(t.push(o.time),e.push(s)),o=n[r++];while(o!==void 0)},subclip:function(n,t,e,i,r=30){const o=n.clone();o.name=t;const s=[];for(let l=0;l<o.tracks.length;++l){const u=o.tracks[l],h=u.getValueSize(),d=[],p=[];for(let m=0;m<u.times.length;++m){const g=u.times[m]*r;if(!(g<e||g>=i)){d.push(u.times[m]);for(let _=0;_<h;++_)p.push(u.values[m*h+_])}}d.length!==0&&(u.times=sn.convertArray(d,u.times.constructor),u.values=sn.convertArray(p,u.values.constructor),s.push(u))}o.tracks=s;let a=1/0;for(let l=0;l<o.tracks.length;++l)a>o.tracks[l].times[0]&&(a=o.tracks[l].times[0]);for(let l=0;l<o.tracks.length;++l)o.tracks[l].shift(-1*a);return o.resetDuration(),o},makeClipAdditive:function(n,t=0,e=n,i=30){i<=0&&(i=30);const r=e.tracks.length,o=t/i;for(let s=0;s<r;++s){const a=e.tracks[s],l=a.ValueTypeName;if(l==="bool"||l==="string")continue;const u=n.tracks.find(function(w){return w.name===a.name&&w.ValueTypeName===l});if(u===void 0)continue;let h=0;const d=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(h=d/3);let p=0;const m=u.getValueSize();u.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(p=m/3);const g=a.times.length-1;let _;if(o<=a.times[0]){const w=h,A=d-h;_=sn.arraySlice(a.values,w,A)}else if(o>=a.times[g]){const w=g*d+h,A=w+d-h;_=sn.arraySlice(a.values,w,A)}else{const w=a.createInterpolant(),A=h,I=d-h;w.evaluate(o),_=sn.arraySlice(w.resultBuffer,A,I)}l==="quaternion"&&new Nn().fromArray(_).normalize().conjugate().toArray(_);const y=u.times.length;for(let w=0;w<y;++w){const A=w*m+p;if(l==="quaternion")Nn.multiplyQuaternionsFlat(u.values,A,_,0,u.values,A);else{const I=m-2*p;for(let F=0;F<I;++F)u.values[A+F]-=_[F]}}}return n.blendMode=It,n}};class ba{constructor(t,e,i,r){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new e.constructor(i),this.sampleValues=e,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(t){const e=this.parameterPositions;let i=this._cachedIndex,r=e[i],o=e[i-1];t:{e:{let s;i:{n:if(!(t<r)){for(let a=i+2;;){if(r===void 0){if(t<o)break n;return i=e.length,this._cachedIndex=i,this.afterEnd_(i-1,t,o)}if(i===a)break;if(o=r,r=e[++i],t<r)break e}s=e.length;break i}if(t>=o)break t;{const a=e[1];t<a&&(i=2,o=a);for(let l=i-2;;){if(o===void 0)return this._cachedIndex=0,this.beforeStart_(0,t,r);if(i===l)break;if(r=o,o=e[--i-1],t>=o)break e}s=i,i=0}}for(;i<s;){const a=i+s>>>1;t<e[a]?s=a:i=a+1}if(r=e[i],o=e[i-1],o===void 0)return this._cachedIndex=0,this.beforeStart_(0,t,r);if(r===void 0)return i=e.length,this._cachedIndex=i,this.afterEnd_(i-1,o,t)}this._cachedIndex=i,this.intervalChanged_(i,o,r)}return this.interpolate_(i,o,t,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){const e=this.resultBuffer,i=this.sampleValues,r=this.valueSize,o=t*r;for(let s=0;s!==r;++s)e[s]=i[o+s];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}ba.prototype.beforeStart_=ba.prototype.copySampleValue_,ba.prototype.afterEnd_=ba.prototype.copySampleValue_;class py extends ba{constructor(t,e,i,r){super(t,e,i,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Gn,endingEnd:Gn}}intervalChanged_(t,e,i){const r=this.parameterPositions;let o=t-2,s=t+1,a=r[o],l=r[s];if(a===void 0)switch(this.getSettings_().endingStart){case hs:o=t,a=2*e-i;break;case Ol:o=r.length-2,a=e+r[o]-r[o+1];break;default:o=t,a=i}if(l===void 0)switch(this.getSettings_().endingEnd){case hs:s=t,l=2*i-e;break;case Ol:s=1,l=i+r[1]-r[0];break;default:s=t-1,l=e}const u=.5*(i-e),h=this.valueSize;this._weightPrev=u/(e-a),this._weightNext=u/(l-i),this._offsetPrev=o*h,this._offsetNext=s*h}interpolate_(t,e,i,r){const o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,l=t*a,u=l-a,h=this._offsetPrev,d=this._offsetNext,p=this._weightPrev,m=this._weightNext,g=(i-e)/(r-e),_=g*g,y=_*g,w=-p*y+2*p*_-p*g,A=(1+p)*y+(-1.5-2*p)*_+(-.5+p)*g+1,I=(-1-m)*y+(1.5+m)*_+.5*g,F=m*y-m*_;for(let N=0;N!==a;++N)o[N]=w*s[h+N]+A*s[u+N]+I*s[l+N]+F*s[d+N];return o}}class Ov extends ba{constructor(t,e,i,r){super(t,e,i,r)}interpolate_(t,e,i,r){const o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,l=t*a,u=l-a,h=(i-e)/(r-e),d=1-h;for(let p=0;p!==a;++p)o[p]=s[u+p]*d+s[l+p]*h;return o}}class fy extends ba{constructor(t,e,i,r){super(t,e,i,r)}interpolate_(t){return this.copySampleValue_(t-1)}}class Jo{constructor(t,e,i,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=sn.convertArray(e,this.TimeBufferType),this.values=sn.convertArray(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(t){const e=t.constructor;let i;if(e.toJSON!==this.toJSON)i=e.toJSON(t);else{i={name:t.name,times:sn.convertArray(t.times,Array),values:sn.convertArray(t.values,Array)};const r=t.getInterpolation();r!==t.DefaultInterpolation&&(i.interpolation=r)}return i.type=t.ValueTypeName,i}InterpolantFactoryMethodDiscrete(t){return new fy(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new Ov(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new py(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case us:e=this.InterpolantFactoryMethodDiscrete;break;case Ll:e=this.InterpolantFactoryMethodLinear;break;case Bo:e=this.InterpolantFactoryMethodSmooth}if(e===void 0){const i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0){if(t===this.DefaultInterpolation)throw new Error(i);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",i),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return us;case this.InterpolantFactoryMethodLinear:return Ll;case this.InterpolantFactoryMethodSmooth:return Bo}}getValueSize(){return this.values.length/this.times.length}shift(t){if(t!==0){const e=this.times;for(let i=0,r=e.length;i!==r;++i)e[i]+=t}return this}scale(t){if(t!==1){const e=this.times;for(let i=0,r=e.length;i!==r;++i)e[i]*=t}return this}trim(t,e){const i=this.times,r=i.length;let o=0,s=r-1;for(;o!==r&&i[o]<t;)++o;for(;s!==-1&&i[s]>e;)--s;if(++s,o!==0||s!==r){o>=s&&(s=Math.max(s,1),o=s-1);const a=this.getValueSize();this.times=sn.arraySlice(i,o,s),this.values=sn.arraySlice(this.values,o*a,s*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 i=this.times,r=this.values,o=i.length;o===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let s=null;for(let a=0;a!==o;a++){const l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),t=!1;break}if(s!==null&&s>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,s),t=!1;break}s=l}if(r!==void 0&&sn.isTypedArray(r))for(let a=0,l=r.length;a!==l;++a){const u=r[a];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,u),t=!1;break}}return t}optimize(){const t=sn.arraySlice(this.times),e=sn.arraySlice(this.values),i=this.getValueSize(),r=this.getInterpolation()===Bo,o=t.length-1;let s=1;for(let a=1;a<o;++a){let l=!1;const u=t[a];if(u!==t[a+1]&&(a!==1||u!==t[0]))if(r)l=!0;else{const h=a*i,d=h-i,p=h+i;for(let m=0;m!==i;++m){const g=e[h+m];if(g!==e[d+m]||g!==e[p+m]){l=!0;break}}}if(l){if(a!==s){t[s]=t[a];const h=a*i,d=s*i;for(let p=0;p!==i;++p)e[d+p]=e[h+p]}++s}}if(o>0){t[s]=t[o];for(let a=o*i,l=s*i,u=0;u!==i;++u)e[l+u]=e[a+u];++s}return s!==t.length?(this.times=sn.arraySlice(t,0,s),this.values=sn.arraySlice(e,0,s*i)):(this.times=t,this.values=e),this}clone(){const t=sn.arraySlice(this.times,0),e=sn.arraySlice(this.values,0),i=new this.constructor(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}}Jo.prototype.TimeBufferType=Float32Array,Jo.prototype.ValueBufferType=Float32Array,Jo.prototype.DefaultInterpolation=Ll;class du extends Jo{}du.prototype.ValueTypeName="bool",du.prototype.ValueBufferType=Array,du.prototype.DefaultInterpolation=us,du.prototype.InterpolantFactoryMethodLinear=void 0,du.prototype.InterpolantFactoryMethodSmooth=void 0;class Nv extends Jo{}Nv.prototype.ValueTypeName="color";class Vd extends Jo{}Vd.prototype.ValueTypeName="number";class my extends ba{constructor(t,e,i,r){super(t,e,i,r)}interpolate_(t,e,i,r){const o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,l=(i-e)/(r-e);let u=t*a;for(let h=u+a;u!==h;u+=4)Nn.slerpFlat(o,0,s,u-a,s,u,l);return o}}class nc extends Jo{InterpolantFactoryMethodLinear(t){return new my(this.times,this.values,this.getValueSize(),t)}}nc.prototype.ValueTypeName="quaternion",nc.prototype.DefaultInterpolation=Ll,nc.prototype.InterpolantFactoryMethodSmooth=void 0;class pu extends Jo{}pu.prototype.ValueTypeName="string",pu.prototype.ValueBufferType=Array,pu.prototype.DefaultInterpolation=us,pu.prototype.InterpolantFactoryMethodLinear=void 0,pu.prototype.InterpolantFactoryMethodSmooth=void 0;class Wd extends Jo{}Wd.prototype.ValueTypeName="vector";class Xd{constructor(t,e=-1,i,r=$s){this.name=t,this.tracks=i,this.duration=e,this.blendMode=r,this.uuid=Ar(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],i=t.tracks,r=1/(t.fps||1);for(let s=0,a=i.length;s!==a;++s)e.push(nE(i[s]).scale(r));const o=new this(t.name,t.duration,e,t.blendMode);return o.uuid=t.uuid,o}static toJSON(t){const e=[],i=t.tracks,r={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let o=0,s=i.length;o!==s;++o)e.push(Jo.toJSON(i[o]));return r}static CreateFromMorphTargetSequence(t,e,i,r){const o=e.length,s=[];for(let a=0;a<o;a++){let l=[],u=[];l.push((a+o-1)%o,a,(a+1)%o),u.push(0,1,0);const h=sn.getKeyframeOrder(l);l=sn.sortedArray(l,1,h),u=sn.sortedArray(u,1,h),r||l[0]!==0||(l.push(o),u.push(u[0])),s.push(new Vd(".morphTargetInfluences["+e[a].name+"]",l,u).scale(1/i))}return new this(t,-1,s)}static findByName(t,e){let i=t;if(!Array.isArray(t)){const r=t;i=r.geometry&&r.geometry.animations||r.animations}for(let r=0;r<i.length;r++)if(i[r].name===e)return i[r];return null}static CreateClipsFromMorphTargetSequences(t,e,i){const r={},o=/^([\w-]*?)([\d]+)$/;for(let a=0,l=t.length;a<l;a++){const u=t[a],h=u.name.match(o);if(h&&h.length>1){const d=h[1];let p=r[d];p||(r[d]=p=[]),p.push(u)}}const s=[];for(const a in r)s.push(this.CreateFromMorphTargetSequence(a,r[a],e,i));return s}static parseAnimation(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(h,d,p,m,g){if(p.length!==0){const _=[],y=[];sn.flattenJSON(p,_,y,m),_.length!==0&&g.push(new h(d,_,y))}},r=[],o=t.name||"default",s=t.fps||30,a=t.blendMode;let l=t.length||-1;const u=t.hierarchy||[];for(let h=0;h<u.length;h++){const d=u[h].keys;if(d&&d.length!==0)if(d[0].morphTargets){const p={};let m;for(m=0;m<d.length;m++)if(d[m].morphTargets)for(let g=0;g<d[m].morphTargets.length;g++)p[d[m].morphTargets[g]]=-1;for(const g in p){const _=[],y=[];for(let w=0;w!==d[m].morphTargets.length;++w){const A=d[m];_.push(A.time),y.push(A.morphTarget===g?1:0)}r.push(new Vd(".morphTargetInfluence["+g+"]",_,y))}l=p.length*(s||1)}else{const p=".bones["+e[h].name+"]";i(Wd,p+".position",d,"pos",r),i(nc,p+".quaternion",d,"rot",r),i(Wd,p+".scale",d,"scl",r)}}return r.length===0?null:new this(o,l,r,a)}resetDuration(){let t=0;for(let e=0,i=this.tracks.length;e!==i;++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 nE(n){if(n.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 Vd;case"vector":case"vector2":case"vector3":case"vector4":return Wd;case"color":return Nv;case"quaternion":return nc;case"bool":case"boolean":return du;case"string":return pu}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(n.type);if(n.times===void 0){const e=[],i=[];sn.flattenJSON(n.keys,e,i,"value"),n.times=e,n.values=i}return t.parse!==void 0?t.parse(n):new t(n.name,n.times,n.values,n.interpolation)}const fu={enabled:!1,files:{},add:function(n,t){this.enabled!==!1&&(this.files[n]=t)},get:function(n){if(this.enabled!==!1)return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}};class Dv{constructor(t,e,i){const r=this;let o=!1,s=0,a=0,l;const u=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=i,this.itemStart=function(h){a++,o===!1&&r.onStart!==void 0&&r.onStart(h,s,a),o=!0},this.itemEnd=function(h){s++,r.onProgress!==void 0&&r.onProgress(h,s,a),s===a&&(o=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(h){r.onError!==void 0&&r.onError(h)},this.resolveURL=function(h){return l?l(h):h},this.setURLModifier=function(h){return l=h,this},this.addHandler=function(h,d){return u.push(h,d),this},this.removeHandler=function(h){const d=u.indexOf(h);return d!==-1&&u.splice(d,2),this},this.getHandler=function(h){for(let d=0,p=u.length;d<p;d+=2){const m=u[d],g=u[d+1];if(m.global&&(m.lastIndex=0),m.test(h))return g}return null}}}const gy=new Dv;class gr{constructor(t){this.manager=t!==void 0?t:gy,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){const i=this;return new Promise(function(r,o){i.load(t,r,e,o)})}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 Zo={};class Ko extends gr{constructor(t){super(t)}load(t,e,i,r){t===void 0&&(t=""),this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const o=this,s=fu.get(t);if(s!==void 0)return o.manager.itemStart(t),setTimeout(function(){e&&e(s),o.manager.itemEnd(t)},0),s;if(Zo[t]!==void 0)return void Zo[t].push({onLoad:e,onProgress:i,onError:r});const a=t.match(/^data:(.*?)(;base64)?,(.*)$/);let l;if(a){const u=a[1],h=!!a[2];let d=a[3];d=decodeURIComponent(d),h&&(d=atob(d));try{let p;const m=(this.responseType||"").toLowerCase();switch(m){case"arraybuffer":case"blob":const g=new Uint8Array(d.length);for(let y=0;y<d.length;y++)g[y]=d.charCodeAt(y);p=m==="blob"?new Blob([g.buffer],{type:u}):g.buffer;break;case"document":p=new DOMParser().parseFromString(d,u);break;case"json":p=JSON.parse(d);break;default:p=d}setTimeout(function(){e&&e(p),o.manager.itemEnd(t)},0)}catch(p){setTimeout(function(){r&&r(p),o.manager.itemError(t),o.manager.itemEnd(t)},0)}}else{Zo[t]=[],Zo[t].push({onLoad:e,onProgress:i,onError:r}),l=new XMLHttpRequest,l.open("GET",t,!0),l.addEventListener("load",function(u){const h=this.response,d=Zo[t];if(delete Zo[t],this.status===200||this.status===0){this.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),fu.add(t,h);for(let p=0,m=d.length;p<m;p++){const g=d[p];g.onLoad&&g.onLoad(h)}o.manager.itemEnd(t)}else{for(let p=0,m=d.length;p<m;p++){const g=d[p];g.onError&&g.onError(u)}o.manager.itemError(t),o.manager.itemEnd(t)}},!1),l.addEventListener("progress",function(u){const h=Zo[t];for(let d=0,p=h.length;d<p;d++){const m=h[d];m.onProgress&&m.onProgress(u)}},!1),l.addEventListener("error",function(u){const h=Zo[t];delete Zo[t];for(let d=0,p=h.length;d<p;d++){const m=h[d];m.onError&&m.onError(u)}o.manager.itemError(t),o.manager.itemEnd(t)},!1),l.addEventListener("abort",function(u){const h=Zo[t];delete Zo[t];for(let d=0,p=h.length;d<p;d++){const m=h[d];m.onError&&m.onError(u)}o.manager.itemError(t),o.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 u in this.requestHeader)l.setRequestHeader(u,this.requestHeader[u]);l.send(null)}return o.manager.itemStart(t),l}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class rE extends gr{constructor(t){super(t)}load(t,e,i,r){const o=this,s=new Ko(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,function(a){try{e(o.parse(JSON.parse(a)))}catch(l){r?r(l):console.error(l),o.manager.itemError(t)}},i,r)}parse(t){const e=[];for(let i=0;i<t.length;i++){const r=Xd.parse(t[i]);e.push(r)}return e}}class oE extends gr{constructor(t){super(t)}load(t,e,i,r){const o=this,s=[],a=new Fe,l=new Ko(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(o.withCredentials);let u=0;function h(d){l.load(t[d],function(p){const m=o.parse(p,!0);s[d]={width:m.width,height:m.height,format:m.format,mipmaps:m.mipmaps},u+=1,u===6&&(m.mipmapCount===1&&(a.minFilter=qi),a.image=s,a.format=m.format,a.needsUpdate=!0,e&&e(a))},i,r)}if(Array.isArray(t))for(let d=0,p=t.length;d<p;++d)h(d);else l.load(t,function(d){const p=o.parse(d,!0);if(p.isCubemap){const m=p.mipmaps.length/p.mipmapCount;for(let g=0;g<m;g++){s[g]={mipmaps:[]};for(let _=0;_<p.mipmapCount;_++)s[g].mipmaps.push(p.mipmaps[g*p.mipmapCount+_]),s[g].format=p.format,s[g].width=p.width,s[g].height=p.height}a.image=s}else a.image.width=p.width,a.image.height=p.height,a.mipmaps=p.mipmaps;p.mipmapCount===1&&(a.minFilter=qi),a.format=p.format,a.needsUpdate=!0,e&&e(a)},i,r);return a}}class qd extends gr{constructor(t){super(t)}load(t,e,i,r){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const o=this,s=fu.get(t);if(s!==void 0)return o.manager.itemStart(t),setTimeout(function(){e&&e(s),o.manager.itemEnd(t)},0),s;const a=document.createElementNS("http://www.w3.org/1999/xhtml","img");function l(){a.removeEventListener("load",l,!1),a.removeEventListener("error",u,!1),fu.add(t,this),e&&e(this),o.manager.itemEnd(t)}function u(h){a.removeEventListener("load",l,!1),a.removeEventListener("error",u,!1),r&&r(h),o.manager.itemError(t),o.manager.itemEnd(t)}return a.addEventListener("load",l,!1),a.addEventListener("error",u,!1),t.substr(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),o.manager.itemStart(t),a.src=t,a}}class vy extends gr{constructor(t){super(t)}load(t,e,i,r){const o=new ro,s=new qd(this.manager);s.setCrossOrigin(this.crossOrigin),s.setPath(this.path);let a=0;function l(u){s.load(t[u],function(h){o.images[u]=h,a++,a===6&&(o.needsUpdate=!0,e&&e(o))},void 0,r)}for(let u=0;u<t.length;++u)l(u);return o}}class _y extends gr{constructor(t){super(t)}load(t,e,i,r){const o=this,s=new ws,a=new Ko(this.manager);return a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(o.withCredentials),a.load(t,function(l){const u=o.parse(l);u&&(u.image!==void 0?s.image=u.image:u.data!==void 0&&(s.image.width=u.width,s.image.height=u.height,s.image.data=u.data),s.wrapS=u.wrapS!==void 0?u.wrapS:qe,s.wrapT=u.wrapT!==void 0?u.wrapT:qe,s.magFilter=u.magFilter!==void 0?u.magFilter:qi,s.minFilter=u.minFilter!==void 0?u.minFilter:qi,s.anisotropy=u.anisotropy!==void 0?u.anisotropy:1,u.encoding!==void 0&&(s.encoding=u.encoding),u.flipY!==void 0&&(s.flipY=u.flipY),u.format!==void 0&&(s.format=u.format),u.type!==void 0&&(s.type=u.type),u.mipmaps!==void 0&&(s.mipmaps=u.mipmaps,s.minFilter=js),u.mipmapCount===1&&(s.minFilter=qi),u.generateMipmaps!==void 0&&(s.generateMipmaps=u.generateMipmaps),s.needsUpdate=!0,e&&e(s,u))},i,r),s}}class Fv extends gr{constructor(t){super(t)}load(t,e,i,r){const o=new dn,s=new qd(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(t,function(a){o.image=a;const l=t.search(/\.jpe?g($|\?)/i)>0||t.search(/^data\:image\/jpeg/)===0;o.format=l?No:Tr,o.needsUpdate=!0,e!==void 0&&e(o)},i,r),o}}class yy extends cn{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 ll(e,t))}getPoint(t){const e=t*this.getLength(),i=this.getCurveLengths();let r=0;for(;r<i.length;){if(i[r]>=e){const o=i[r]-e,s=this.curves[r],a=s.getLength(),l=a===0?0:1-o/a;return s.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 i=0,r=this.curves.length;i<r;i++)e+=this.curves[i].getLength(),t.push(e);return this.cacheLengths=t,t}getSpacedPoints(t=40){const e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){const e=[];let i;for(let r=0,o=this.curves;r<o.length;r++){const s=o[r],a=s&&s.isEllipseCurve?2*t:s&&(s.isLineCurve||s.isLineCurve3)?1:s&&s.isSplineCurve?t*s.points.length:t,l=s.getPoints(a);for(let u=0;u<l.length;u++){const h=l[u];i&&i.equals(h)||(e.push(h),i=h)}}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,i=t.curves.length;e<i;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,i=this.curves.length;e<i;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,i=t.curves.length;e<i;e++){const r=t.curves[e];this.curves.push(new Sv[r.type]().fromJSON(r))}return this}}class mu extends yy{constructor(t){super(),this.type="Path",this.currentPoint=new ce,t&&this.setFromPoints(t)}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,i=t.length;e<i;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 i=new ll(this.currentPoint.clone(),new ce(t,e));return this.curves.push(i),this.currentPoint.set(t,e),this}quadraticCurveTo(t,e,i,r){const o=new xa(this.currentPoint.clone(),new ce(t,e),new ce(i,r));return this.curves.push(o),this.currentPoint.set(i,r),this}bezierCurveTo(t,e,i,r,o,s){const a=new ya(this.currentPoint.clone(),new ce(t,e),new ce(i,r),new ce(o,s));return this.curves.push(a),this.currentPoint.set(o,s),this}splineThru(t){const e=[this.currentPoint.clone()].concat(t),i=new im(e);return this.curves.push(i),this.currentPoint.copy(t[t.length-1]),this}arc(t,e,i,r,o,s){const a=this.currentPoint.x,l=this.currentPoint.y;return this.absarc(t+a,e+l,i,r,o,s),this}absarc(t,e,i,r,o,s){return this.absellipse(t,e,i,i,r,o,s),this}ellipse(t,e,i,r,o,s,a,l){const u=this.currentPoint.x,h=this.currentPoint.y;return this.absellipse(t+u,e+h,i,r,o,s,a,l),this}absellipse(t,e,i,r,o,s,a,l){const u=new on(t,e,i,r,o,s,a,l);if(this.curves.length>0){const d=u.getPoint(0);d.equals(this.currentPoint)||this.lineTo(d.x,d.y)}this.curves.push(u);const h=u.getPoint(1);return this.currentPoint.copy(h),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 hl extends mu{constructor(t){super(t),this.uuid=Ar(),this.type="Shape",this.holes=[]}getPointsHoles(t){const e=[];for(let i=0,r=this.holes.length;i<r;i++)e[i]=this.holes[i].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,i=t.holes.length;e<i;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,i=this.holes.length;e<i;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,i=t.holes.length;e<i;e++){const r=t.holes[e];this.holes.push(new mu().fromJSON(r))}return this}}class Qo extends hi{constructor(t,e=1){super(),this.type="Light",this.color=new Le(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}}Qo.prototype.isLight=!0;class Bv extends Qo{constructor(t,e,i){super(t,i),this.type="HemisphereLight",this.position.copy(hi.DefaultUp),this.updateMatrix(),this.groundColor=new Le(e)}copy(t){return Qo.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}Bv.prototype.isHemisphereLight=!0;const xy=new Ee,by=new S,wy=new S;class kv{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new ce(512,512),this.map=null,this.mapPass=null,this.matrix=new Ee,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Ka,this._frameExtents=new ce(1,1),this._viewportCount=1,this._viewports=[new Li(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera,i=this.matrix;by.setFromMatrixPosition(t.matrixWorld),e.position.copy(by),wy.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(wy),e.updateMatrixWorld(),xy.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(xy),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(e.projectionMatrix),i.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 Sy extends kv{constructor(){super(new fn(50,1,.5,500)),this.focus=1}updateMatrices(t){const e=this.camera,i=2*yn*t.angle*this.focus,r=this.mapSize.width/this.mapSize.height,o=t.distance||e.far;i===e.fov&&r===e.aspect&&o===e.far||(e.fov=i,e.aspect=r,e.far=o,e.updateProjectionMatrix()),super.updateMatrices(t)}copy(t){return super.copy(t),this.focus=t.focus,this}}Sy.prototype.isSpotLightShadow=!0;class Uv extends Qo{constructor(t,e,i=0,r=Math.PI/3,o=0,s=1){super(t,e),this.type="SpotLight",this.position.copy(hi.DefaultUp),this.updateMatrix(),this.target=new hi,this.distance=i,this.angle=r,this.penumbra=o,this.decay=s,this.shadow=new Sy}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}}Uv.prototype.isSpotLight=!0;const Ty=new Ee,Yd=new S,Gv=new S;class Ey extends kv{constructor(){super(new fn(90,1,.5,500)),this._frameExtents=new ce(4,2),this._viewportCount=6,this._viewports=[new Li(2,1,1,1),new Li(0,1,1,1),new Li(3,1,1,1),new Li(1,1,1,1),new Li(3,0,1,1),new Li(1,0,1,1)],this._cubeDirections=[new S(1,0,0),new S(-1,0,0),new S(0,0,1),new S(0,0,-1),new S(0,1,0),new S(0,-1,0)],this._cubeUps=[new S(0,1,0),new S(0,1,0),new S(0,1,0),new S(0,1,0),new S(0,0,1),new S(0,0,-1)]}updateMatrices(t,e=0){const i=this.camera,r=this.matrix,o=t.distance||i.far;o!==i.far&&(i.far=o,i.updateProjectionMatrix()),Yd.setFromMatrixPosition(t.matrixWorld),i.position.copy(Yd),Gv.copy(i.position),Gv.add(this._cubeDirections[e]),i.up.copy(this._cubeUps[e]),i.lookAt(Gv),i.updateMatrixWorld(),r.makeTranslation(-Yd.x,-Yd.y,-Yd.z),Ty.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Ty)}}Ey.prototype.isPointLightShadow=!0;class Hv extends Qo{constructor(t,e,i=0,r=1){super(t,e),this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new Ey}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}}Hv.prototype.isPointLight=!0;class rc extends la{constructor(t=-1,e=1,i=1,r=-1,o=.1,s=2e3){super(),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=i,this.bottom=r,this.near=o,this.far=s,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,i,r,o,s){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=i,this.view.offsetY=r,this.view.width=o,this.view.height=s,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),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let o=i-t,s=i+t,a=r+e,l=r-e;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=u*this.view.offsetX,s=o+u*this.view.width,a-=h*this.view.offsetY,l=a-h*this.view.height}this.projectionMatrix.makeOrthographic(o,s,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}}rc.prototype.isOrthographicCamera=!0;class My extends kv{constructor(){super(new rc(-5,5,5,-5,.5,500))}}My.prototype.isDirectionalLightShadow=!0;class hm extends Qo{constructor(t,e){super(t,e),this.type="DirectionalLight",this.position.copy(hi.DefaultUp),this.updateMatrix(),this.target=new hi,this.shadow=new My}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}hm.prototype.isDirectionalLight=!0;class cm extends Qo{constructor(t,e){super(t,e),this.type="AmbientLight"}}cm.prototype.isAmbientLight=!0;class zv extends Qo{constructor(t,e,i=10,r=10){super(t,e),this.type="RectAreaLight",this.width=i,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}}zv.prototype.isRectAreaLight=!0;class jv{constructor(){this.coefficients=[];for(let t=0;t<9;t++)this.coefficients.push(new S)}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 i=t.x,r=t.y,o=t.z,s=this.coefficients;return e.copy(s[0]).multiplyScalar(.282095),e.addScaledVector(s[1],.488603*r),e.addScaledVector(s[2],.488603*o),e.addScaledVector(s[3],.488603*i),e.addScaledVector(s[4],i*r*1.092548),e.addScaledVector(s[5],r*o*1.092548),e.addScaledVector(s[6],.315392*(3*o*o-1)),e.addScaledVector(s[7],i*o*1.092548),e.addScaledVector(s[8],.546274*(i*i-r*r)),e}getIrradianceAt(t,e){const i=t.x,r=t.y,o=t.z,s=this.coefficients;return e.copy(s[0]).multiplyScalar(.886227),e.addScaledVector(s[1],1.023328*r),e.addScaledVector(s[2],1.023328*o),e.addScaledVector(s[3],1.023328*i),e.addScaledVector(s[4],.858086*i*r),e.addScaledVector(s[5],.858086*r*o),e.addScaledVector(s[6],.743125*o*o-.247708),e.addScaledVector(s[7],.858086*i*o),e.addScaledVector(s[8],.429043*(i*i-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 i=0;i<9;i++)this.coefficients[i].addScaledVector(t.coefficients[i],e);return this}scale(t){for(let e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this}lerp(t,e){for(let i=0;i<9;i++)this.coefficients[i].lerp(t.coefficients[i],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 i=this.coefficients;for(let r=0;r<9;r++)i[r].fromArray(t,e+3*r);return this}toArray(t=[],e=0){const i=this.coefficients;for(let r=0;r<9;r++)i[r].toArray(t,e+3*r);return t}static getBasisAt(t,e){const i=t.x,r=t.y,o=t.z;e[0]=.282095,e[1]=.488603*r,e[2]=.488603*o,e[3]=.488603*i,e[4]=1.092548*i*r,e[5]=1.092548*r*o,e[6]=.315392*(3*o*o-1),e[7]=1.092548*i*o,e[8]=.546274*(i*i-r*r)}}jv.prototype.isSphericalHarmonics3=!0;class $d extends Qo{constructor(t=new jv,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}}$d.prototype.isLightProbe=!0;class Ay extends gr{constructor(t){super(t),this.textures={}}load(t,e,i,r){const o=this,s=new Ko(o.manager);s.setPath(o.path),s.setRequestHeader(o.requestHeader),s.setWithCredentials(o.withCredentials),s.load(t,function(a){try{e(o.parse(JSON.parse(a)))}catch(l){r?r(l):console.error(l),o.manager.itemError(t)}},i,r)}parse(t){const e=this.textures;function i(o){return e[o]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",o),e[o]}const r=new iE[t.type];if(t.uuid!==void 0&&(r.uuid=t.uuid),t.name!==void 0&&(r.name=t.name),t.color!==void 0&&r.color!==void 0&&r.color.setHex(t.color),t.roughness!==void 0&&(r.roughness=t.roughness),t.metalness!==void 0&&(r.metalness=t.metalness),t.sheen!==void 0&&(r.sheen=new Le().setHex(t.sheen)),t.emissive!==void 0&&r.emissive!==void 0&&r.emissive.setHex(t.emissive),t.specular!==void 0&&r.specular!==void 0&&r.specular.setHex(t.specular),t.shininess!==void 0&&(r.shininess=t.shininess),t.clearcoat!==void 0&&(r.clearcoat=t.clearcoat),t.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=t.clearcoatRoughness),t.transmission!==void 0&&(r.transmission=t.transmission),t.thickness!==void 0&&(r.thickness=t.thickness),t.attenuationDistance!==void 0&&(r.attenuationDistance=t.attenuationDistance),t.attenuationColor!==void 0&&r.attenuationColor!==void 0&&r.attenuationColor.setHex(t.attenuationColor),t.fog!==void 0&&(r.fog=t.fog),t.flatShading!==void 0&&(r.flatShading=t.flatShading),t.blending!==void 0&&(r.blending=t.blending),t.combine!==void 0&&(r.combine=t.combine),t.side!==void 0&&(r.side=t.side),t.shadowSide!==void 0&&(r.shadowSide=t.shadowSide),t.opacity!==void 0&&(r.opacity=t.opacity),t.transparent!==void 0&&(r.transparent=t.transparent),t.alphaTest!==void 0&&(r.alphaTest=t.alphaTest),t.depthTest!==void 0&&(r.depthTest=t.depthTest),t.depthWrite!==void 0&&(r.depthWrite=t.depthWrite),t.colorWrite!==void 0&&(r.colorWrite=t.colorWrite),t.stencilWrite!==void 0&&(r.stencilWrite=t.stencilWrite),t.stencilWriteMask!==void 0&&(r.stencilWriteMask=t.stencilWriteMask),t.stencilFunc!==void 0&&(r.stencilFunc=t.stencilFunc),t.stencilRef!==void 0&&(r.stencilRef=t.stencilRef),t.stencilFuncMask!==void 0&&(r.stencilFuncMask=t.stencilFuncMask),t.stencilFail!==void 0&&(r.stencilFail=t.stencilFail),t.stencilZFail!==void 0&&(r.stencilZFail=t.stencilZFail),t.stencilZPass!==void 0&&(r.stencilZPass=t.stencilZPass),t.wireframe!==void 0&&(r.wireframe=t.wireframe),t.wireframeLinewidth!==void 0&&(r.wireframeLinewidth=t.wireframeLinewidth),t.wireframeLinecap!==void 0&&(r.wireframeLinecap=t.wireframeLinecap),t.wireframeLinejoin!==void 0&&(r.wireframeLinejoin=t.wireframeLinejoin),t.rotation!==void 0&&(r.rotation=t.rotation),t.linewidth!==1&&(r.linewidth=t.linewidth),t.dashSize!==void 0&&(r.dashSize=t.dashSize),t.gapSize!==void 0&&(r.gapSize=t.gapSize),t.scale!==void 0&&(r.scale=t.scale),t.polygonOffset!==void 0&&(r.polygonOffset=t.polygonOffset),t.polygonOffsetFactor!==void 0&&(r.polygonOffsetFactor=t.polygonOffsetFactor),t.polygonOffsetUnits!==void 0&&(r.polygonOffsetUnits=t.polygonOffsetUnits),t.morphTargets!==void 0&&(r.morphTargets=t.morphTargets),t.morphNormals!==void 0&&(r.morphNormals=t.morphNormals),t.dithering!==void 0&&(r.dithering=t.dithering),t.alphaToCoverage!==void 0&&(r.alphaToCoverage=t.alphaToCoverage),t.premultipliedAlpha!==void 0&&(r.premultipliedAlpha=t.premultipliedAlpha),t.vertexTangents!==void 0&&(r.vertexTangents=t.vertexTangents),t.visible!==void 0&&(r.visible=t.visible),t.toneMapped!==void 0&&(r.toneMapped=t.toneMapped),t.userData!==void 0&&(r.userData=t.userData),t.vertexColors!==void 0&&(typeof t.vertexColors=="number"?r.vertexColors=t.vertexColors>0:r.vertexColors=t.vertexColors),t.uniforms!==void 0)for(const o in t.uniforms){const s=t.uniforms[o];switch(r.uniforms[o]={},s.type){case"t":r.uniforms[o].value=i(s.value);break;case"c":r.uniforms[o].value=new Le().setHex(s.value);break;case"v2":r.uniforms[o].value=new ce().fromArray(s.value);break;case"v3":r.uniforms[o].value=new S().fromArray(s.value);break;case"v4":r.uniforms[o].value=new Li().fromArray(s.value);break;case"m3":r.uniforms[o].value=new zi().fromArray(s.value);break;case"m4":r.uniforms[o].value=new Ee().fromArray(s.value);break;default:r.uniforms[o].value=s.value}}if(t.defines!==void 0&&(r.defines=t.defines),t.vertexShader!==void 0&&(r.vertexShader=t.vertexShader),t.fragmentShader!==void 0&&(r.fragmentShader=t.fragmentShader),t.extensions!==void 0)for(const o in t.extensions)r.extensions[o]=t.extensions[o];if(t.shading!==void 0&&(r.flatShading=t.shading===1),t.size!==void 0&&(r.size=t.size),t.sizeAttenuation!==void 0&&(r.sizeAttenuation=t.sizeAttenuation),t.map!==void 0&&(r.map=i(t.map)),t.matcap!==void 0&&(r.matcap=i(t.matcap)),t.alphaMap!==void 0&&(r.alphaMap=i(t.alphaMap)),t.bumpMap!==void 0&&(r.bumpMap=i(t.bumpMap)),t.bumpScale!==void 0&&(r.bumpScale=t.bumpScale),t.normalMap!==void 0&&(r.normalMap=i(t.normalMap)),t.normalMapType!==void 0&&(r.normalMapType=t.normalMapType),t.normalScale!==void 0){let o=t.normalScale;Array.isArray(o)===!1&&(o=[o,o]),r.normalScale=new ce().fromArray(o)}return t.displacementMap!==void 0&&(r.displacementMap=i(t.displacementMap)),t.displacementScale!==void 0&&(r.displacementScale=t.displacementScale),t.displacementBias!==void 0&&(r.displacementBias=t.displacementBias),t.roughnessMap!==void 0&&(r.roughnessMap=i(t.roughnessMap)),t.metalnessMap!==void 0&&(r.metalnessMap=i(t.metalnessMap)),t.emissiveMap!==void 0&&(r.emissiveMap=i(t.emissiveMap)),t.emissiveIntensity!==void 0&&(r.emissiveIntensity=t.emissiveIntensity),t.specularMap!==void 0&&(r.specularMap=i(t.specularMap)),t.envMap!==void 0&&(r.envMap=i(t.envMap)),t.envMapIntensity!==void 0&&(r.envMapIntensity=t.envMapIntensity),t.reflectivity!==void 0&&(r.reflectivity=t.reflectivity),t.refractionRatio!==void 0&&(r.refractionRatio=t.refractionRatio),t.lightMap!==void 0&&(r.lightMap=i(t.lightMap)),t.lightMapIntensity!==void 0&&(r.lightMapIntensity=t.lightMapIntensity),t.aoMap!==void 0&&(r.aoMap=i(t.aoMap)),t.aoMapIntensity!==void 0&&(r.aoMapIntensity=t.aoMapIntensity),t.gradientMap!==void 0&&(r.gradientMap=i(t.gradientMap)),t.clearcoatMap!==void 0&&(r.clearcoatMap=i(t.clearcoatMap)),t.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=i(t.clearcoatRoughnessMap)),t.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=i(t.clearcoatNormalMap)),t.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new ce().fromArray(t.clearcoatNormalScale)),t.transmissionMap!==void 0&&(r.transmissionMap=i(t.transmissionMap)),t.thicknessMap!==void 0&&(r.thicknessMap=i(t.thicknessMap)),r}setTextures(t){return this.textures=t,this}}class dm{static decodeText(t){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(t);let e="";for(let i=0,r=t.length;i<r;i++)e+=String.fromCharCode(t[i]);try{return decodeURIComponent(escape(e))}catch{return e}}static extractUrlBase(t){const e=t.lastIndexOf("/");return e===-1?"./":t.substr(0,e+1)}}class Vv extends ze{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}}Vv.prototype.isInstancedBufferGeometry=!0;class Wv extends mi{constructor(t,e,i,r=1){typeof i=="number"&&(r=i,i=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(t,e,i),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}}Wv.prototype.isInstancedBufferAttribute=!0;class Ry extends gr{constructor(t){super(t)}load(t,e,i,r){const o=this,s=new Ko(o.manager);s.setPath(o.path),s.setRequestHeader(o.requestHeader),s.setWithCredentials(o.withCredentials),s.load(t,function(a){try{e(o.parse(JSON.parse(a)))}catch(l){r?r(l):console.error(l),o.manager.itemError(t)}},i,r)}parse(t){const e={},i={};function r(d,p){if(e[p]!==void 0)return e[p];const m=d.interleavedBuffers[p],g=function(w,A){if(i[A]!==void 0)return i[A];const I=w.arrayBuffers[A],F=new Uint32Array(I).buffer;return i[A]=F,F}(d,m.buffer),_=ra(m.type,g),y=new fa(_,m.stride);return y.uuid=m.uuid,e[p]=y,y}const o=t.isInstancedBufferGeometry?new Vv:new ze,s=t.data.index;if(s!==void 0){const d=ra(s.type,s.array);o.setIndex(new mi(d,1))}const a=t.data.attributes;for(const d in a){const p=a[d];let m;if(p.isInterleavedBufferAttribute){const g=r(t.data,p.data);m=new Yo(g,p.itemSize,p.offset,p.normalized)}else{const g=ra(p.type,p.array);m=new(p.isInstancedBufferAttribute?Wv:mi)(g,p.itemSize,p.normalized)}p.name!==void 0&&(m.name=p.name),p.usage!==void 0&&m.setUsage(p.usage),p.updateRange!==void 0&&(m.updateRange.offset=p.updateRange.offset,m.updateRange.count=p.updateRange.count),o.setAttribute(d,m)}const l=t.data.morphAttributes;if(l)for(const d in l){const p=l[d],m=[];for(let g=0,_=p.length;g<_;g++){const y=p[g];let w;if(y.isInterleavedBufferAttribute){const A=r(t.data,y.data);w=new Yo(A,y.itemSize,y.offset,y.normalized)}else{const A=ra(y.type,y.array);w=new mi(A,y.itemSize,y.normalized)}y.name!==void 0&&(w.name=y.name),m.push(w)}o.morphAttributes[d]=m}t.data.morphTargetsRelative&&(o.morphTargetsRelative=!0);const u=t.data.groups||t.data.drawcalls||t.data.offsets;if(u!==void 0)for(let d=0,p=u.length;d!==p;++d){const m=u[d];o.addGroup(m.start,m.count,m.materialIndex)}const h=t.data.boundingSphere;if(h!==void 0){const d=new S;h.center!==void 0&&d.fromArray(h.center),o.boundingSphere=new En(d,h.radius)}return t.name&&(o.name=t.name),t.userData&&(o.userData=t.userData),o}}class sE extends gr{constructor(t){super(t)}load(t,e,i,r){const o=this,s=this.path===""?dm.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||s;const a=new Ko(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(t,function(l){let u=null;try{u=JSON.parse(l)}catch(d){return r!==void 0&&r(d),void console.error("THREE:ObjectLoader: Can't parse "+t+".",d.message)}const h=u.metadata;h!==void 0&&h.type!==void 0&&h.type.toLowerCase()!=="geometry"?o.parse(u,e):console.error("THREE.ObjectLoader: Can't load "+t)},i,r)}async loadAsync(t,e){const i=this.path===""?dm.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||i;const r=new Ko(this.manager);r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials);const o=await r.loadAsync(t,e),s=JSON.parse(o),a=s.metadata;if(a===void 0||a.type===void 0||a.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+t);return await this.parseAsync(s)}parse(t,e){const i=this.parseAnimations(t.animations),r=this.parseShapes(t.shapes),o=this.parseGeometries(t.geometries,r),s=this.parseImages(t.images,function(){e!==void 0&&e(u)}),a=this.parseTextures(t.textures,s),l=this.parseMaterials(t.materials,a),u=this.parseObject(t.object,o,l,a,i),h=this.parseSkeletons(t.skeletons,u);if(this.bindSkeletons(u,h),e!==void 0){let d=!1;for(const p in s)if(s[p]instanceof HTMLImageElement){d=!0;break}d===!1&&e(u)}return u}async parseAsync(t){const e=this.parseAnimations(t.animations),i=this.parseShapes(t.shapes),r=this.parseGeometries(t.geometries,i),o=await this.parseImagesAsync(t.images),s=this.parseTextures(t.textures,o),a=this.parseMaterials(t.materials,s),l=this.parseObject(t.object,r,a,s,e),u=this.parseSkeletons(t.skeletons,l);return this.bindSkeletons(l,u),l}parseShapes(t){const e={};if(t!==void 0)for(let i=0,r=t.length;i<r;i++){const o=new hl().fromJSON(t[i]);e[o.uuid]=o}return e}parseSkeletons(t,e){const i={},r={};if(e.traverse(function(o){o.isBone&&(r[o.uuid]=o)}),t!==void 0)for(let o=0,s=t.length;o<s;o++){const a=new jh().fromJSON(t[o],r);i[a.uuid]=a}return i}parseGeometries(t,e){const i={};if(t!==void 0){const r=new Ry;for(let o=0,s=t.length;o<s;o++){let a;const l=t[o];switch(l.type){case"BufferGeometry":case"InstancedBufferGeometry":a=r.parse(l);break;case"Geometry":console.error("THREE.ObjectLoader: The legacy Geometry type is no longer supported.");break;default:l.type in dy?a=dy[l.type].fromJSON(l,e):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${l.type}"`)}a.uuid=l.uuid,l.name!==void 0&&(a.name=l.name),a.isBufferGeometry===!0&&l.userData!==void 0&&(a.userData=l.userData),i[l.uuid]=a}}return i}parseMaterials(t,e){const i={},r={};if(t!==void 0){const o=new Ay;o.setTextures(e);for(let s=0,a=t.length;s<a;s++){const l=t[s];if(l.type==="MultiMaterial"){const u=[];for(let h=0;h<l.materials.length;h++){const d=l.materials[h];i[d.uuid]===void 0&&(i[d.uuid]=o.parse(d)),u.push(i[d.uuid])}r[l.uuid]=u}else i[l.uuid]===void 0&&(i[l.uuid]=o.parse(l)),r[l.uuid]=i[l.uuid]}}return r}parseAnimations(t){const e={};if(t!==void 0)for(let i=0;i<t.length;i++){const r=t[i],o=Xd.parse(r);e[o.uuid]=o}return e}parseImages(t,e){const i=this,r={};let o;function s(a){if(typeof a=="string"){const l=a;return function(u){return i.manager.itemStart(u),o.load(u,function(){i.manager.itemEnd(u)},void 0,function(){i.manager.itemError(u),i.manager.itemEnd(u)})}(/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l)?l:i.resourcePath+l)}return a.data?{data:ra(a.type,a.data),width:a.width,height:a.height}:null}if(t!==void 0&&t.length>0){const a=new Dv(e);o=new qd(a),o.setCrossOrigin(this.crossOrigin);for(let l=0,u=t.length;l<u;l++){const h=t[l],d=h.url;if(Array.isArray(d)){r[h.uuid]=[];for(let p=0,m=d.length;p<m;p++){const g=s(d[p]);g!==null&&(g instanceof HTMLImageElement?r[h.uuid].push(g):r[h.uuid].push(new ws(g.data,g.width,g.height)))}}else{const p=s(h.url);p!==null&&(r[h.uuid]=p)}}}return r}async parseImagesAsync(t){const e=this,i={};let r;async function o(s){if(typeof s=="string"){const a=s,l=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(a)?a:e.resourcePath+a;return await r.loadAsync(l)}return s.data?{data:ra(s.type,s.data),width:s.width,height:s.height}:null}if(t!==void 0&&t.length>0){r=new qd(this.manager),r.setCrossOrigin(this.crossOrigin);for(let s=0,a=t.length;s<a;s++){const l=t[s],u=l.url;if(Array.isArray(u)){i[l.uuid]=[];for(let h=0,d=u.length;h<d;h++){const p=u[h],m=await o(p);m!==null&&(m instanceof HTMLImageElement?i[l.uuid].push(m):i[l.uuid].push(new ws(m.data,m.width,m.height)))}}else{const h=await o(l.url);h!==null&&(i[l.uuid]=h)}}}return i}parseTextures(t,e){function i(o,s){return typeof o=="number"?o:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",o),s[o])}const r={};if(t!==void 0)for(let o=0,s=t.length;o<s;o++){const a=t[o];let l;a.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',a.uuid),e[a.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",a.image);const u=e[a.image];Array.isArray(u)?(l=new ro(u),u.length===6&&(l.needsUpdate=!0)):(l=u&&u.data?new ws(u.data,u.width,u.height):new dn(u),u&&(l.needsUpdate=!0)),l.uuid=a.uuid,a.name!==void 0&&(l.name=a.name),a.mapping!==void 0&&(l.mapping=i(a.mapping,aE)),a.offset!==void 0&&l.offset.fromArray(a.offset),a.repeat!==void 0&&l.repeat.fromArray(a.repeat),a.center!==void 0&&l.center.fromArray(a.center),a.rotation!==void 0&&(l.rotation=a.rotation),a.wrap!==void 0&&(l.wrapS=i(a.wrap[0],Cy),l.wrapT=i(a.wrap[1],Cy)),a.format!==void 0&&(l.format=a.format),a.type!==void 0&&(l.type=a.type),a.encoding!==void 0&&(l.encoding=a.encoding),a.minFilter!==void 0&&(l.minFilter=i(a.minFilter,Py)),a.magFilter!==void 0&&(l.magFilter=i(a.magFilter,Py)),a.anisotropy!==void 0&&(l.anisotropy=a.anisotropy),a.flipY!==void 0&&(l.flipY=a.flipY),a.premultiplyAlpha!==void 0&&(l.premultiplyAlpha=a.premultiplyAlpha),a.unpackAlignment!==void 0&&(l.unpackAlignment=a.unpackAlignment),r[a.uuid]=l}return r}parseObject(t,e,i,r,o){let s,a,l;function u(p){return e[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",p),e[p]}function h(p){if(p!==void 0){if(Array.isArray(p)){const m=[];for(let g=0,_=p.length;g<_;g++){const y=p[g];i[y]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",y),m.push(i[y])}return m}return i[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",p),i[p]}}function d(p){return r[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",p),r[p]}switch(t.type){case"Scene":s=new el,t.background!==void 0&&(Number.isInteger(t.background)?s.background=new Le(t.background):s.background=d(t.background)),t.environment!==void 0&&(s.environment=d(t.environment)),t.fog!==void 0&&(t.fog.type==="Fog"?s.fog=new eu(t.fog.color,t.fog.near,t.fog.far):t.fog.type==="FogExp2"&&(s.fog=new Fn(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":s=new fn(t.fov,t.aspect,t.near,t.far),t.focus!==void 0&&(s.focus=t.focus),t.zoom!==void 0&&(s.zoom=t.zoom),t.filmGauge!==void 0&&(s.filmGauge=t.filmGauge),t.filmOffset!==void 0&&(s.filmOffset=t.filmOffset),t.view!==void 0&&(s.view=Object.assign({},t.view));break;case"OrthographicCamera":s=new rc(t.left,t.right,t.top,t.bottom,t.near,t.far),t.zoom!==void 0&&(s.zoom=t.zoom),t.view!==void 0&&(s.view=Object.assign({},t.view));break;case"AmbientLight":s=new cm(t.color,t.intensity);break;case"DirectionalLight":s=new hm(t.color,t.intensity);break;case"PointLight":s=new Hv(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":s=new zv(t.color,t.intensity,t.width,t.height);break;case"SpotLight":s=new Uv(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":s=new Bv(t.color,t.groundColor,t.intensity);break;case"LightProbe":s=new $d().fromJSON(t);break;case"SkinnedMesh":a=u(t.geometry),l=h(t.material),s=new rl(a,l),t.bindMode!==void 0&&(s.bindMode=t.bindMode),t.bindMatrix!==void 0&&s.bindMatrix.fromArray(t.bindMatrix),t.skeleton!==void 0&&(s.skeleton=t.skeleton);break;case"Mesh":a=u(t.geometry),l=h(t.material),s=new Ti(a,l);break;case"InstancedMesh":a=u(t.geometry),l=h(t.material);const p=t.count,m=t.instanceMatrix,g=t.instanceColor;s=new Bd(a,l,p),s.instanceMatrix=new mi(new Float32Array(m.array),16),g!==void 0&&(s.instanceColor=new mi(new Float32Array(g.array),g.itemSize));break;case"LOD":s=new $f;break;case"Line":s=new c(u(t.geometry),h(t.material));break;case"LineLoop":s=new D(u(t.geometry),h(t.material));break;case"LineSegments":s=new R(u(t.geometry),h(t.material));break;case"PointCloud":case"Points":s=new Zt(u(t.geometry),h(t.material));break;case"Sprite":s=new su(h(t.material));break;case"Group":s=new pa;break;case"Bone":s=new zh;break;default:s=new hi}if(s.uuid=t.uuid,t.name!==void 0&&(s.name=t.name),t.matrix!==void 0?(s.matrix.fromArray(t.matrix),t.matrixAutoUpdate!==void 0&&(s.matrixAutoUpdate=t.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(t.position!==void 0&&s.position.fromArray(t.position),t.rotation!==void 0&&s.rotation.fromArray(t.rotation),t.quaternion!==void 0&&s.quaternion.fromArray(t.quaternion),t.scale!==void 0&&s.scale.fromArray(t.scale)),t.castShadow!==void 0&&(s.castShadow=t.castShadow),t.receiveShadow!==void 0&&(s.receiveShadow=t.receiveShadow),t.shadow&&(t.shadow.bias!==void 0&&(s.shadow.bias=t.shadow.bias),t.shadow.normalBias!==void 0&&(s.shadow.normalBias=t.shadow.normalBias),t.shadow.radius!==void 0&&(s.shadow.radius=t.shadow.radius),t.shadow.mapSize!==void 0&&s.shadow.mapSize.fromArray(t.shadow.mapSize),t.shadow.camera!==void 0&&(s.shadow.camera=this.parseObject(t.shadow.camera))),t.visible!==void 0&&(s.visible=t.visible),t.frustumCulled!==void 0&&(s.frustumCulled=t.frustumCulled),t.renderOrder!==void 0&&(s.renderOrder=t.renderOrder),t.userData!==void 0&&(s.userData=t.userData),t.layers!==void 0&&(s.layers.mask=t.layers),t.children!==void 0){const p=t.children;for(let m=0;m<p.length;m++)s.add(this.parseObject(p[m],e,i,r,o))}if(t.animations!==void 0){const p=t.animations;for(let m=0;m<p.length;m++){const g=p[m];s.animations.push(o[g])}}if(t.type==="LOD"){t.autoUpdate!==void 0&&(s.autoUpdate=t.autoUpdate);const p=t.levels;for(let m=0;m<p.length;m++){const g=p[m],_=s.getObjectByProperty("uuid",g.object);_!==void 0&&s.addLevel(_,g.distance)}}return s}bindSkeletons(t,e){Object.keys(e).length!==0&&t.traverse(function(i){if(i.isSkinnedMesh===!0&&i.skeleton!==void 0){const r=e[i.skeleton];r===void 0?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",i.skeleton):i.bind(r,i.bindMatrix)}})}setTexturePath(t){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(t)}}const aE={UVMapping:wt,CubeReflectionMapping:zt,CubeRefractionMapping:ne,EquirectangularReflectionMapping:se,EquirectangularRefractionMapping:ae,CubeUVReflectionMapping:xe,CubeUVRefractionMapping:Ie},Cy={RepeatWrapping:Ge,ClampToEdgeWrapping:qe,MirroredRepeatWrapping:pi},Py={NearestFilter:fi,NearestMipmapNearestFilter:Sr,NearestMipmapLinearFilter:zs,LinearFilter:qi,LinearMipmapNearestFilter:as,LinearMipmapLinearFilter:js};class Iy extends gr{constructor(t){super(t),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(t){return this.options=t,this}load(t,e,i,r){t===void 0&&(t=""),this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const o=this,s=fu.get(t);if(s!==void 0)return o.manager.itemStart(t),setTimeout(function(){e&&e(s),o.manager.itemEnd(t)},0),s;const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(t,a).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(o.options,{colorSpaceConversion:"none"}))}).then(function(l){fu.add(t,l),e&&e(l),o.manager.itemEnd(t)}).catch(function(l){r&&r(l),o.manager.itemError(t),o.manager.itemEnd(t)}),o.manager.itemStart(t)}}Iy.prototype.isImageBitmapLoader=!0;class Ly{constructor(){this.type="ShapePath",this.color=new Le,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new mu,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}quadraticCurveTo(t,e,i,r){return this.currentPath.quadraticCurveTo(t,e,i,r),this}bezierCurveTo(t,e,i,r,o,s){return this.currentPath.bezierCurveTo(t,e,i,r,o,s),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t,e){function i(A){const I=[];for(let F=0,N=A.length;F<N;F++){const U=A[F],B=new hl;B.curves=U.curves,I.push(B)}return I}function r(A,I){const F=I.length;let N=!1;for(let U=F-1,B=0;B<F;U=B++){let G=I[U],ct=I[B],it=ct.x-G.x,tt=ct.y-G.y;if(Math.abs(tt)>Number.EPSILON){if(tt<0&&(G=I[B],it=-it,ct=I[U],tt=-tt),A.y<G.y||A.y>ct.y)continue;if(A.y===G.y){if(A.x===G.x)return!0}else{const rt=tt*(A.x-G.x)-it*(A.y-G.y);if(rt===0)return!0;if(rt<0)continue;N=!N}}else{if(A.y!==G.y)continue;if(ct.x<=A.x&&A.x<=G.x||G.x<=A.x&&A.x<=ct.x)return!0}}return N}const o=Ms.isClockWise,s=this.subPaths;if(s.length===0)return[];if(e===!0)return i(s);let a,l,u;const h=[];if(s.length===1)return l=s[0],u=new hl,u.curves=l.curves,h.push(u),h;let d=!o(s[0].getPoints());d=t?!d:d;const p=[],m=[];let g,_,y=[],w=0;m[w]=void 0,y[w]=[];for(let A=0,I=s.length;A<I;A++)l=s[A],g=l.getPoints(),a=o(g),a=t?!a:a,a?(!d&&m[w]&&w++,m[w]={s:new hl,p:g},m[w].s.curves=l.curves,d&&w++,y[w]=[]):y[w].push({h:l,p:g[0]});if(!m[0])return i(s);if(m.length>1){let A=!1;const I=[];for(let F=0,N=m.length;F<N;F++)p[F]=[];for(let F=0,N=m.length;F<N;F++){const U=y[F];for(let B=0;B<U.length;B++){const G=U[B];let ct=!0;for(let it=0;it<m.length;it++)r(G.p,m[it].p)&&(F!==it&&I.push({froms:F,tos:it,hole:B}),ct?(ct=!1,p[it].push(G)):A=!0);ct&&p[F].push(G)}}I.length>0&&(A||(y=p))}for(let A=0,I=m.length;A<I;A++){u=m[A].s,h.push(u),_=y[A];for(let F=0,N=_.length;F<N;F++)u.holes.push(_[F].h)}return h}}class Xv{constructor(t){this.type="Font",this.data=t}generateShapes(t,e=100){const i=[],r=function(o,s,a){const l=Array.from(o),u=s/a.resolution,h=(a.boundingBox.yMax-a.boundingBox.yMin+a.underlineThickness)*u,d=[];let p=0,m=0;for(let g=0;g<l.length;g++){const _=l[g];if(_===`
|
|
4723
4723
|
`)p=0,m-=h;else{const y=lE(_,u,p,m,a);p+=y.offsetX,d.push(y.path)}}return d}(t,e,this.data);for(let o=0,s=r.length;o<s;o++)Array.prototype.push.apply(i,r[o].toShapes());return i}}function lE(n,t,e,i,r){const o=r.glyphs[n]||r.glyphs["?"];if(!o)return void console.error('THREE.Font: character "'+n+'" does not exists in font family '+r.familyName+".");const s=new Ly;let a,l,u,h,d,p,m,g;if(o.o){const _=o._cachedOutline||(o._cachedOutline=o.o.split(" "));for(let y=0,w=_.length;y<w;)switch(_[y++]){case"m":a=_[y++]*t+e,l=_[y++]*t+i,s.moveTo(a,l);break;case"l":a=_[y++]*t+e,l=_[y++]*t+i,s.lineTo(a,l);break;case"q":u=_[y++]*t+e,h=_[y++]*t+i,d=_[y++]*t+e,p=_[y++]*t+i,s.quadraticCurveTo(d,p,u,h);break;case"b":u=_[y++]*t+e,h=_[y++]*t+i,d=_[y++]*t+e,p=_[y++]*t+i,m=_[y++]*t+e,g=_[y++]*t+i,s.bezierCurveTo(d,p,m,g,u,h)}}return{offsetX:o.ha*t,path:s}}Xv.prototype.isFont=!0;class uE extends gr{constructor(t){super(t)}load(t,e,i,r){const o=this,s=new Ko(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(o.withCredentials),s.load(t,function(a){let l;try{l=JSON.parse(a)}catch{console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),l=JSON.parse(a.substring(65,a.length-2))}const u=o.parse(l);e&&e(u)},i,r)}parse(t){return new Xv(t)}}let pm;const qv={getContext:function(){return pm===void 0&&(pm=new(window.AudioContext||window.webkitAudioContext)),pm},setContext:function(n){pm=n}};class Oy extends gr{constructor(t){super(t)}load(t,e,i,r){const o=this,s=new Ko(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,function(a){try{const l=a.slice(0);qv.getContext().decodeAudioData(l,function(u){e(u)})}catch(l){r?r(l):console.error(l),o.manager.itemError(t)}},i,r)}}class Ny extends $d{constructor(t,e,i=1){super(void 0,i);const r=new Le().set(t),o=new Le().set(e),s=new S(r.r,r.g,r.b),a=new S(o.r,o.g,o.b),l=Math.sqrt(Math.PI),u=l*Math.sqrt(.75);this.sh.coefficients[0].copy(s).add(a).multiplyScalar(l),this.sh.coefficients[1].copy(s).sub(a).multiplyScalar(u)}}Ny.prototype.isHemisphereLightProbe=!0;class Dy extends $d{constructor(t,e=1){super(void 0,e);const i=new Le().set(t);this.sh.coefficients[0].set(i.r,i.g,i.b).multiplyScalar(2*Math.sqrt(Math.PI))}}Dy.prototype.isAmbientLightProbe=!0;const Fy=new Ee,By=new Ee;class hE{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new fn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new fn,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(t){const e=this._cache;if(e.focus!==t.focus||e.fov!==t.fov||e.aspect!==t.aspect*this.aspect||e.near!==t.near||e.far!==t.far||e.zoom!==t.zoom||e.eyeSep!==this.eyeSep){e.focus=t.focus,e.fov=t.fov,e.aspect=t.aspect*this.aspect,e.near=t.near,e.far=t.far,e.zoom=t.zoom,e.eyeSep=this.eyeSep;const i=t.projectionMatrix.clone(),r=e.eyeSep/2,o=r*e.near/e.focus,s=e.near*Math.tan(Hi*e.fov*.5)/e.zoom;let a,l;By.elements[12]=-r,Fy.elements[12]=r,a=-s*e.aspect+o,l=s*e.aspect+o,i.elements[0]=2*e.near/(l-a),i.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(i),a=-s*e.aspect-o,l=s*e.aspect-o,i.elements[0]=2*e.near/(l-a),i.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(i)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(By),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(Fy)}}class ky{constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Uy(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=Uy();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}function Uy(){return(typeof performance=="undefined"?Date:performance).now()}const gu=new S,Gy=new Nn,cE=new S,vu=new S;class dE extends hi{constructor(){super(),this.type="AudioListener",this.context=qv.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new ky}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(t){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}updateMatrixWorld(t){super.updateMatrixWorld(t);const e=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(gu,Gy,cE),vu.set(0,0,-1).applyQuaternion(Gy),e.positionX){const r=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(gu.x,r),e.positionY.linearRampToValueAtTime(gu.y,r),e.positionZ.linearRampToValueAtTime(gu.z,r),e.forwardX.linearRampToValueAtTime(vu.x,r),e.forwardY.linearRampToValueAtTime(vu.y,r),e.forwardZ.linearRampToValueAtTime(vu.z,r),e.upX.linearRampToValueAtTime(i.x,r),e.upY.linearRampToValueAtTime(i.y,r),e.upZ.linearRampToValueAtTime(i.z,r)}else e.setPosition(gu.x,gu.y,gu.z),e.setOrientation(vu.x,vu.y,vu.z,i.x,i.y,i.z)}}class Yv extends hi{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}}const _u=new S,Hy=new Nn,pE=new S,yu=new S;class fE extends Yv{constructor(t){super(t),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(t){return this.panner.refDistance=t,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(t){return this.panner.rolloffFactor=t,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(t){return this.panner.distanceModel=t,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(t){return this.panner.maxDistance=t,this}setDirectionalCone(t,e,i){return this.panner.coneInnerAngle=t,this.panner.coneOuterAngle=e,this.panner.coneOuterGain=i,this}updateMatrixWorld(t){if(super.updateMatrixWorld(t),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(_u,Hy,pE),yu.set(0,0,1).applyQuaternion(Hy);const e=this.panner;if(e.positionX){const i=this.context.currentTime+this.listener.timeDelta;e.positionX.linearRampToValueAtTime(_u.x,i),e.positionY.linearRampToValueAtTime(_u.y,i),e.positionZ.linearRampToValueAtTime(_u.z,i),e.orientationX.linearRampToValueAtTime(yu.x,i),e.orientationY.linearRampToValueAtTime(yu.y,i),e.orientationZ.linearRampToValueAtTime(yu.z,i)}else e.setPosition(_u.x,_u.y,_u.z),e.setOrientation(yu.x,yu.y,yu.z)}}class zy{constructor(t,e=2048){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=e,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let t=0;const e=this.getFrequencyData();for(let i=0;i<e.length;i++)t+=e[i];return t/e.length}}class jy{constructor(t,e,i){let r,o,s;switch(this.binding=t,this.valueSize=i,e){case"quaternion":r=this._slerp,o=this._slerpAdditive,s=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*i),this._workIndex=5;break;case"string":case"bool":r=this._select,o=this._select,s=this._setAdditiveIdentityOther,this.buffer=new Array(5*i);break;default:r=this._lerp,o=this._lerpAdditive,s=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*i)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=o,this._setIdentity=s,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(t,e){const i=this.buffer,r=this.valueSize,o=t*r+r;let s=this.cumulativeWeight;if(s===0){for(let a=0;a!==r;++a)i[o+a]=i[a];s=e}else{s+=e;const a=e/s;this._mixBufferRegion(i,o,0,a,r)}this.cumulativeWeight=s}accumulateAdditive(t){const e=this.buffer,i=this.valueSize,r=i*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(e,r,0,t,i),this.cumulativeWeightAdditive+=t}apply(t){const e=this.valueSize,i=this.buffer,r=t*e+e,o=this.cumulativeWeight,s=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,o<1){const l=e*this._origIndex;this._mixBufferRegion(i,r,l,1-o,e)}s>0&&this._mixBufferRegionAdditive(i,r,this._addIndex*e,1,e);for(let l=e,u=e+e;l!==u;++l)if(i[l]!==i[l+e]){a.setValue(i,r);break}}saveOriginalState(){const t=this.binding,e=this.buffer,i=this.valueSize,r=i*this._origIndex;t.getValue(e,r);for(let o=i,s=r;o!==s;++o)e[o]=e[r+o%i];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 i=t;i<e;i++)this.buffer[i]=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 i=0;i<this.valueSize;i++)this.buffer[e+i]=this.buffer[t+i]}_select(t,e,i,r,o){if(r>=.5)for(let s=0;s!==o;++s)t[e+s]=t[i+s]}_slerp(t,e,i,r){Nn.slerpFlat(t,e,t,e,t,i,r)}_slerpAdditive(t,e,i,r,o){const s=this._workIndex*o;Nn.multiplyQuaternionsFlat(t,s,t,e,t,i),Nn.slerpFlat(t,e,t,e,t,s,r)}_lerp(t,e,i,r,o){const s=1-r;for(let a=0;a!==o;++a){const l=e+a;t[l]=t[l]*s+t[i+a]*r}}_lerpAdditive(t,e,i,r,o){for(let s=0;s!==o;++s){const a=e+s;t[a]=t[a]+t[i+s]*r}}}const mE=new RegExp("[\\[\\]\\.:\\/]","g"),gE="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",vE=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),_E=/(WCOD+)?/.source.replace("WCOD",gE),yE=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),xE=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),bE=new RegExp("^"+vE+_E+yE+xE+"$"),wE=["material","materials","bones"];class Ri{constructor(t,e,i){this.path=e,this.parsedPath=i||Ri.parseTrackName(e),this.node=Ri.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,i){return t&&t.isAnimationObjectGroup?new Ri.Composite(t,e,i):new Ri(t,e,i)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(mE,"")}static parseTrackName(t){const e=bE.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const i={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const o=i.nodeName.substring(r+1);wE.indexOf(o)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=o)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i}static findNode(t,e){if(!e||e===""||e==="."||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){const i=t.skeleton.getBoneByName(e);if(i!==void 0)return i}if(t.children){const i=function(o){for(let s=0;s<o.length;s++){const a=o[s];if(a.name===e||a.uuid===e)return a;const l=i(a.children);if(l)return l}return null},r=i(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 i=this.resolvedProperty;for(let r=0,o=i.length;r!==o;++r)t[e++]=i[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 i=this.resolvedProperty;for(let r=0,o=i.length;r!==o;++r)i[r]=t[e++]}_setValue_array_setNeedsUpdate(t,e){const i=this.resolvedProperty;for(let r=0,o=i.length;r!==o;++r)i[r]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){const i=this.resolvedProperty;for(let r=0,o=i.length;r!==o;++r)i[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,i=e.objectName,r=e.propertyName;let o=e.propertyIndex;if(t||(t=Ri.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(i){let u=e.objectIndex;switch(i){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 h=0;h<t.length;h++)if(t[h].name===u){u=h;break}break;default:if(t[i]===void 0)return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[i]}if(u!==void 0){if(t[u]===void 0)return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[u]}}const s=t[r];if(s===void 0){const u=e.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+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(o!==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[o]!==void 0&&(o=t.morphTargetDictionary[o])}l=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=o}else s.fromArray!==void 0&&s.toArray!==void 0?(l=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(l=this.BindingType.EntireArray,this.resolvedProperty=s):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}}Ri.Composite=class{constructor(n,t,e){const i=e||Ri.parseTrackName(t);this._targetGroup=n,this._bindings=n.subscribe_(t,i)}getValue(n,t){this.bind();const e=this._targetGroup.nCachedObjects_,i=this._bindings[e];i!==void 0&&i.getValue(n,t)}setValue(n,t){const e=this._bindings;for(let i=this._targetGroup.nCachedObjects_,r=e.length;i!==r;++i)e[i].setValue(n,t)}bind(){const n=this._bindings;for(let t=this._targetGroup.nCachedObjects_,e=n.length;t!==e;++t)n[t].bind()}unbind(){const n=this._bindings;for(let t=this._targetGroup.nCachedObjects_,e=n.length;t!==e;++t)n[t].unbind()}},Ri.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Ri.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},Ri.prototype.GetterByBindingType=[Ri.prototype._getValue_direct,Ri.prototype._getValue_array,Ri.prototype._getValue_arrayElement,Ri.prototype._getValue_toArray],Ri.prototype.SetterByBindingTypeAndVersioning=[[Ri.prototype._setValue_direct,Ri.prototype._setValue_direct_setNeedsUpdate,Ri.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Ri.prototype._setValue_array,Ri.prototype._setValue_array_setNeedsUpdate,Ri.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Ri.prototype._setValue_arrayElement,Ri.prototype._setValue_arrayElement_setNeedsUpdate,Ri.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Ri.prototype._setValue_fromArray,Ri.prototype._setValue_fromArray_setNeedsUpdate,Ri.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class Vy{constructor(){this.uuid=Ar(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const t={};this._indicesByUUID=t;for(let i=0,r=arguments.length;i!==r;++i)t[arguments[i].uuid]=i;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const e=this;this.stats={objects:{get total(){return e._objects.length},get inUse(){return this.total-e.nCachedObjects_}},get bindingsPerObject(){return e._bindings.length}}}add(){const t=this._objects,e=this._indicesByUUID,i=this._paths,r=this._parsedPaths,o=this._bindings,s=o.length;let a,l=t.length,u=this.nCachedObjects_;for(let h=0,d=arguments.length;h!==d;++h){const p=arguments[h],m=p.uuid;let g=e[m];if(g===void 0){g=l++,e[m]=g,t.push(p);for(let _=0,y=s;_!==y;++_)o[_].push(new Ri(p,i[_],r[_]))}else if(g<u){a=t[g];const _=--u,y=t[_];e[y.uuid]=g,t[g]=y,e[m]=_,t[_]=p;for(let w=0,A=s;w!==A;++w){const I=o[w],F=I[_];let N=I[g];I[g]=F,N===void 0&&(N=new Ri(p,i[w],r[w])),I[_]=N}}else t[g]!==a&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=u}remove(){const t=this._objects,e=this._indicesByUUID,i=this._bindings,r=i.length;let o=this.nCachedObjects_;for(let s=0,a=arguments.length;s!==a;++s){const l=arguments[s],u=l.uuid,h=e[u];if(h!==void 0&&h>=o){const d=o++,p=t[d];e[p.uuid]=h,t[h]=p,e[u]=d,t[d]=l;for(let m=0,g=r;m!==g;++m){const _=i[m],y=_[d],w=_[h];_[h]=y,_[d]=w}}}this.nCachedObjects_=o}uncache(){const t=this._objects,e=this._indicesByUUID,i=this._bindings,r=i.length;let o=this.nCachedObjects_,s=t.length;for(let a=0,l=arguments.length;a!==l;++a){const u=arguments[a].uuid,h=e[u];if(h!==void 0)if(delete e[u],h<o){const d=--o,p=t[d],m=--s,g=t[m];e[p.uuid]=h,t[h]=p,e[g.uuid]=d,t[d]=g,t.pop();for(let _=0,y=r;_!==y;++_){const w=i[_],A=w[d],I=w[m];w[h]=A,w[d]=I,w.pop()}}else{const d=--s,p=t[d];d>0&&(e[p.uuid]=h),t[h]=p,t.pop();for(let m=0,g=r;m!==g;++m){const _=i[m];_[h]=_[d],_.pop()}}}this.nCachedObjects_=o}subscribe_(t,e){const i=this._bindingsIndicesByPath;let r=i[t];const o=this._bindings;if(r!==void 0)return o[r];const s=this._paths,a=this._parsedPaths,l=this._objects,u=l.length,h=this.nCachedObjects_,d=new Array(u);r=o.length,i[t]=r,s.push(t),a.push(e),o.push(d);for(let p=h,m=l.length;p!==m;++p){const g=l[p];d[p]=new Ri(g,t,e)}return d}unsubscribe_(t){const e=this._bindingsIndicesByPath,i=e[t];if(i!==void 0){const r=this._paths,o=this._parsedPaths,s=this._bindings,a=s.length-1,l=s[a];e[t[a]]=i,s[i]=l,s.pop(),o[i]=o[a],o.pop(),r[i]=r[a],r.pop()}}}Vy.prototype.isAnimationObjectGroup=!0;class SE{constructor(t,e,i=null,r=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=i,this.blendMode=r;const o=e.tracks,s=o.length,a=new Array(s),l={endingStart:Gn,endingEnd:Gn};for(let u=0;u!==s;++u){const h=o[u].createInterpolant(null);a[u]=h,h.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Jc,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,i){if(t.fadeOut(e),this.fadeIn(e),i){const r=this._clip.duration,o=t._clip.duration,s=o/r,a=r/o;t.warp(1,s,e),this.warp(a,1,e)}return this}crossFadeTo(t,e,i){return t.crossFadeFrom(this,e,i)}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,i){const r=this._mixer,o=r.time,s=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,u=a.sampleValues;return l[0]=o,l[1]=o+i,u[0]=t/s,u[1]=e/s,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,i,r){if(!this.enabled)return void this._updateWeight(t);const o=this._startTime;if(o!==null){const l=(t-o)*i;if(l<0||i===0)return;this._startTime=null,e=i*l}e*=this._updateTimeScale(t);const s=this._updateTime(e),a=this._updateWeight(t);if(a>0){const l=this._interpolants,u=this._propertyBindings;switch(this.blendMode){case It:for(let h=0,d=l.length;h!==d;++h)l[h].evaluate(s),u[h].accumulateAdditive(a);break;case $s:default:for(let h=0,d=l.length;h!==d;++h)l[h].evaluate(s),u[h].accumulate(r,a)}}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const i=this._weightInterpolant;if(i!==null){const r=i.evaluate(t)[0];e*=r,t>i.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 i=this._timeScaleInterpolant;i!==null&&(e*=i.evaluate(t)[0],t>i.parameterPositions[1]&&(this.stopWarping(),e===0?this.paused=!0:this.timeScale=e))}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,i=this.loop;let r=this.time+t,o=this._loopCount;const s=i===Fo;if(t===0)return o===-1?r:s&&(1&o)==1?e-r:r;if(i===ih){o===-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(o===-1&&(t>=0?(o=0,this._setEndings(!0,this.repetitions===0,s)):this._setEndings(this.repetitions===0,!0,s)),r>=e||r<0){const a=Math.floor(r/e);r-=e*a,o+=Math.abs(a);const l=this.repetitions-o;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 u=t<0;this._setEndings(u,!u,s)}else this._setEndings(!1,!1,s);this._loopCount=o,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(s&&(1&o)==1)return e-r}return r}_setEndings(t,e,i){const r=this._interpolantSettings;i?(r.endingStart=hs,r.endingEnd=hs):(r.endingStart=t?this.zeroSlopeAtStart?hs:Gn:Ol,r.endingEnd=e?this.zeroSlopeAtEnd?hs:Gn:Ol)}_scheduleFading(t,e,i){const r=this._mixer,o=r.time;let s=this._weightInterpolant;s===null&&(s=r._lendControlInterpolant(),this._weightInterpolant=s);const a=s.parameterPositions,l=s.sampleValues;return a[0]=o,l[0]=e,a[1]=o+t,l[1]=i,this}}class Wy extends ko{constructor(t){super(),this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(t,e){const i=t._localRoot||this._root,r=t._clip.tracks,o=r.length,s=t._propertyBindings,a=t._interpolants,l=i.uuid,u=this._bindingsByRootAndName;let h=u[l];h===void 0&&(h={},u[l]=h);for(let d=0;d!==o;++d){const p=r[d],m=p.name;let g=h[m];if(g!==void 0)s[d]=g;else{if(g=s[d],g!==void 0){g._cacheIndex===null&&(++g.referenceCount,this._addInactiveBinding(g,l,m));continue}const _=e&&e._propertyBindings[d].binding.parsedPath;g=new jy(Ri.create(i,m,_),p.ValueTypeName,p.getValueSize()),++g.referenceCount,this._addInactiveBinding(g,l,m),s[d]=g}a[d].resultBuffer=g.buffer}}_activateAction(t){if(!this._isActiveAction(t)){if(t._cacheIndex===null){const i=(t._localRoot||this._root).uuid,r=t._clip.uuid,o=this._actionsByClip[r];this._bindAction(t,o&&o.knownActions[0]),this._addInactiveAction(t,r,i)}const e=t._propertyBindings;for(let i=0,r=e.length;i!==r;++i){const o=e[i];o.useCount++==0&&(this._lendBinding(o),o.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let i=0,r=e.length;i!==r;++i){const o=e[i];--o.useCount==0&&(o.restoreOriginalState(),this._takeBackBinding(o))}this._takeBackAction(t)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}}_isActiveAction(t){const e=t._cacheIndex;return e!==null&&e<this._nActiveActions}_addInactiveAction(t,e,i){const r=this._actions,o=this._actionsByClip;let s=o[e];if(s===void 0)s={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,o[e]=s;else{const a=s.knownActions;t._byClipCacheIndex=a.length,a.push(t)}t._cacheIndex=r.length,r.push(t),s.actionByRoot[i]=t}_removeInactiveAction(t){const e=this._actions,i=e[e.length-1],r=t._cacheIndex;i._cacheIndex=r,e[r]=i,e.pop(),t._cacheIndex=null;const o=t._clip.uuid,s=this._actionsByClip,a=s[o],l=a.knownActions,u=l[l.length-1],h=t._byClipCacheIndex;u._byClipCacheIndex=h,l[h]=u,l.pop(),t._byClipCacheIndex=null,delete a.actionByRoot[(t._localRoot||this._root).uuid],l.length===0&&delete s[o],this._removeInactiveBindingsForAction(t)}_removeInactiveBindingsForAction(t){const e=t._propertyBindings;for(let i=0,r=e.length;i!==r;++i){const o=e[i];--o.referenceCount==0&&this._removeInactiveBinding(o)}}_lendAction(t){const e=this._actions,i=t._cacheIndex,r=this._nActiveActions++,o=e[r];t._cacheIndex=r,e[r]=t,o._cacheIndex=i,e[i]=o}_takeBackAction(t){const e=this._actions,i=t._cacheIndex,r=--this._nActiveActions,o=e[r];t._cacheIndex=r,e[r]=t,o._cacheIndex=i,e[i]=o}_addInactiveBinding(t,e,i){const r=this._bindingsByRootAndName,o=this._bindings;let s=r[e];s===void 0&&(s={},r[e]=s),s[i]=t,t._cacheIndex=o.length,o.push(t)}_removeInactiveBinding(t){const e=this._bindings,i=t.binding,r=i.rootNode.uuid,o=i.path,s=this._bindingsByRootAndName,a=s[r],l=e[e.length-1],u=t._cacheIndex;l._cacheIndex=u,e[u]=l,e.pop(),delete a[o],Object.keys(a).length===0&&delete s[r]}_lendBinding(t){const e=this._bindings,i=t._cacheIndex,r=this._nActiveBindings++,o=e[r];t._cacheIndex=r,e[r]=t,o._cacheIndex=i,e[i]=o}_takeBackBinding(t){const e=this._bindings,i=t._cacheIndex,r=--this._nActiveBindings,o=e[r];t._cacheIndex=r,e[r]=t,o._cacheIndex=i,e[i]=o}_lendControlInterpolant(){const t=this._controlInterpolants,e=this._nActiveControlInterpolants++;let i=t[e];return i===void 0&&(i=new Ov(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),i.__cacheIndex=e,t[e]=i),i}_takeBackControlInterpolant(t){const e=this._controlInterpolants,i=t.__cacheIndex,r=--this._nActiveControlInterpolants,o=e[r];t.__cacheIndex=r,e[r]=t,o.__cacheIndex=i,e[i]=o}clipAction(t,e,i){const r=e||this._root,o=r.uuid;let s=typeof t=="string"?Xd.findByName(r,t):t;const a=s!==null?s.uuid:t,l=this._actionsByClip[a];let u=null;if(i===void 0&&(i=s!==null?s.blendMode:$s),l!==void 0){const d=l.actionByRoot[o];if(d!==void 0&&d.blendMode===i)return d;u=l.knownActions[0],s===null&&(s=u._clip)}if(s===null)return null;const h=new SE(this,s,e,i);return this._bindAction(h,u),this._addInactiveAction(h,a,o),h}existingAction(t,e){const i=e||this._root,r=i.uuid,o=typeof t=="string"?Xd.findByName(i,t):t,s=o?o.uuid:t,a=this._actionsByClip[s];return a!==void 0&&a.actionByRoot[r]||null}stopAllAction(){const t=this._actions;for(let e=this._nActiveActions-1;e>=0;--e)t[e].stop();return this}update(t){t*=this.timeScale;const e=this._actions,i=this._nActiveActions,r=this.time+=t,o=Math.sign(t),s=this._accuIndex^=1;for(let u=0;u!==i;++u)e[u]._update(r,t,o,s);const a=this._bindings,l=this._nActiveBindings;for(let u=0;u!==l;++u)a[u].apply(s);return this}setTime(t){this.time=0;for(let e=0;e<this._actions.length;e++)this._actions[e].time=0;return this.update(t)}getRoot(){return this._root}uncacheClip(t){const e=this._actions,i=t.uuid,r=this._actionsByClip,o=r[i];if(o!==void 0){const s=o.knownActions;for(let a=0,l=s.length;a!==l;++a){const u=s[a];this._deactivateAction(u);const h=u._cacheIndex,d=e[e.length-1];u._cacheIndex=null,u._byClipCacheIndex=null,d._cacheIndex=h,e[h]=d,e.pop(),this._removeInactiveBindingsForAction(u)}delete r[i]}}uncacheRoot(t){const e=t.uuid,i=this._actionsByClip;for(const o in i){const s=i[o].actionByRoot[e];s!==void 0&&(this._deactivateAction(s),this._removeInactiveAction(s))}const r=this._bindingsByRootAndName[e];if(r!==void 0)for(const o in r){const s=r[o];s.restoreOriginalState(),this._removeInactiveBinding(s)}}uncacheAction(t,e){const i=this.existingAction(t,e);i!==null&&(this._deactivateAction(i),this._removeInactiveAction(i))}}Wy.prototype._controlInterpolantsResultBuffer=new Float32Array(1);class fm{constructor(t){typeof t=="string"&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}clone(){return new fm(this.value.clone===void 0?this.value:this.value.clone())}}class Xy extends fa{constructor(t,e,i=1){super(t,e),this.meshPerAttribute=i}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}clone(t){const e=super.clone(t);return e.meshPerAttribute=this.meshPerAttribute,e}toJSON(t){const e=super.toJSON(t);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}}Xy.prototype.isInstancedInterleavedBuffer=!0;class qy{constructor(t,e,i,r,o){this.buffer=t,this.type=e,this.itemSize=i,this.elementSize=r,this.count=o,this.version=0}set needsUpdate(t){t===!0&&this.version++}setBuffer(t){return this.buffer=t,this}setType(t,e){return this.type=t,this.elementSize=e,this}setItemSize(t){return this.itemSize=t,this}setCount(t){return this.count=t,this}}qy.prototype.isGLBufferAttribute=!0;class TE{constructor(t,e,i=0,r=1/0){this.ray=new jo(t,e),this.near=i,this.far=r,this.camera=null,this.layers=new rd,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){e&&e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e&&e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type: "+e.type)}intersectObject(t,e=!1,i=[]){return $v(t,this,i,e),i.sort(Yy),i}intersectObjects(t,e=!1,i=[]){for(let r=0,o=t.length;r<o;r++)$v(t[r],this,i,e);return i.sort(Yy),i}}function Yy(n,t){return n.distance-t.distance}function $v(n,t,e,i){if(n.layers.test(t.layers)&&n.raycast(t,e),i===!0){const r=n.children;for(let o=0,s=r.length;o<s;o++)$v(r[o],t,e,!0)}}class EE{constructor(t=1,e=0,i=0){return this.radius=t,this.phi=e,this.theta=i,this}set(t,e,i){return this.radius=t,this.phi=e,this.theta=i,this}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,i){return this.radius=Math.sqrt(t*t+e*e+i*i),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,i),this.phi=Math.acos(zn(e/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class ME{constructor(t=1,e=0,i=0){return this.radius=t,this.theta=e,this.y=i,this}set(t,e,i){return this.radius=t,this.theta=e,this.y=i,this}copy(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,i){return this.radius=Math.sqrt(t*t+i*i),this.theta=Math.atan2(t,i),this.y=e,this}clone(){return new this.constructor().copy(this)}}const $y=new ce;class oc{constructor(t=new ce(1/0,1/0),e=new ce(-1/0,-1/0)){this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const i=$y.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}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=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(t){return this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(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}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)}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}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))}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)}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return $y.copy(t).clamp(this.min,this.max).sub(t).length()}intersect(t){return this.min.max(t.min),this.max.min(t.max),this}union(t){return this.min.min(t.min),this.max.max(t.max),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)}}oc.prototype.isBox2=!0;const Jy=new S,mm=new S;class Zy{constructor(t=new S,e=new S){this.start=t,this.end=e}set(t,e){return this.start.copy(t),this.end.copy(e),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,e){return this.delta(e).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,e){Jy.subVectors(t,this.start),mm.subVectors(this.end,this.start);const i=mm.dot(mm);let r=mm.dot(Jy)/i;return e&&(r=zn(r,0,1)),r}closestPointToPoint(t,e,i){const r=this.closestPointToPointParameter(t,e);return this.delta(i).multiplyScalar(r).add(this.start)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}class Ky extends hi{constructor(t){super(),this.material=t,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}}Ky.prototype.isImmediateRenderObject=!0;const Qy=new S;class AE extends hi{constructor(t,e){super(),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;const i=new ze,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let s=0,a=1,l=32;s<l;s++,a++){const u=s/l*Math.PI*2,h=a/l*Math.PI*2;r.push(Math.cos(u),Math.sin(u),1,Math.cos(h),Math.sin(h),1)}i.setAttribute("position",new _e(r,3));const o=new Bn({fog:!1,toneMapped:!1});this.cone=new R(i,o),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateMatrixWorld();const t=this.light.distance?this.light.distance:1e3,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),Qy.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Qy),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const cl=new S,gm=new Ee,Jv=new Ee;class tx extends R{constructor(t){const e=function l(u){const h=[];u&&u.isBone&&h.push(u);for(let d=0;d<u.children.length;d++)h.push.apply(h,l(u.children[d]));return h}(t),i=new ze,r=[],o=[],s=new Le(0,0,1),a=new Le(0,1,0);for(let l=0;l<e.length;l++){const u=e[l];u.parent&&u.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),o.push(s.r,s.g,s.b),o.push(a.r,a.g,a.b))}i.setAttribute("position",new _e(r,3)),i.setAttribute("color",new _e(o,3)),super(i,new Bn({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.type="SkeletonHelper",this.isSkeletonHelper=!0,this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(t){const e=this.bones,i=this.geometry,r=i.getAttribute("position");Jv.copy(this.root.matrixWorld).invert();for(let o=0,s=0;o<e.length;o++){const a=e[o];a.parent&&a.parent.isBone&&(gm.multiplyMatrices(Jv,a.matrixWorld),cl.setFromMatrixPosition(gm),r.setXYZ(s,cl.x,cl.y,cl.z),gm.multiplyMatrices(Jv,a.parent.matrixWorld),cl.setFromMatrixPosition(gm),r.setXYZ(s+1,cl.x,cl.y,cl.z),s+=2)}i.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(t)}}class RE extends Ti{constructor(t,e,i){super(new cu(e,4,2),new pn({wireframe:!0,fog:!1,toneMapped:!1})),this.light=t,this.light.updateMatrixWorld(),this.color=i,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const CE=new S,ex=new Le,ix=new Le;class PE extends hi{constructor(t,e,i){super(),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=i;const r=new uu(e);r.rotateY(.5*Math.PI),this.material=new pn({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const o=r.getAttribute("position"),s=new Float32Array(3*o.count);r.setAttribute("color",new mi(s,3)),this.add(new Ti(r,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const t=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{const e=t.geometry.getAttribute("color");ex.copy(this.light.color),ix.copy(this.light.groundColor);for(let i=0,r=e.count;i<r;i++){const o=i<r/2?ex:ix;e.setXYZ(i,o.r,o.g,o.b)}e.needsUpdate=!0}t.lookAt(CE.setFromMatrixPosition(this.light.matrixWorld).negate())}}class nx extends R{constructor(t=10,e=10,i=4473924,r=8947848){i=new Le(i),r=new Le(r);const o=e/2,s=t/e,a=t/2,l=[],u=[];for(let d=0,p=0,m=-a;d<=e;d++,m+=s){l.push(-a,0,m,a,0,m),l.push(m,0,-a,m,0,a);const g=d===o?i:r;g.toArray(u,p),p+=3,g.toArray(u,p),p+=3,g.toArray(u,p),p+=3,g.toArray(u,p),p+=3}const h=new ze;h.setAttribute("position",new _e(l,3)),h.setAttribute("color",new _e(u,3)),super(h,new Bn({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}class IE extends R{constructor(t=10,e=16,i=8,r=64,o=4473924,s=8947848){o=new Le(o),s=new Le(s);const a=[],l=[];for(let h=0;h<=e;h++){const d=h/e*(2*Math.PI),p=Math.sin(d)*t,m=Math.cos(d)*t;a.push(0,0,0),a.push(p,0,m);const g=1&h?o:s;l.push(g.r,g.g,g.b),l.push(g.r,g.g,g.b)}for(let h=0;h<=i;h++){const d=1&h?o:s,p=t-t/i*h;for(let m=0;m<r;m++){let g=m/r*(2*Math.PI),_=Math.sin(g)*p,y=Math.cos(g)*p;a.push(_,0,y),l.push(d.r,d.g,d.b),g=(m+1)/r*(2*Math.PI),_=Math.sin(g)*p,y=Math.cos(g)*p,a.push(_,0,y),l.push(d.r,d.g,d.b)}}const u=new ze;u.setAttribute("position",new _e(a,3)),u.setAttribute("color",new _e(l,3)),super(u,new Bn({vertexColors:!0,toneMapped:!1})),this.type="PolarGridHelper"}}const rx=new S,vm=new S,ox=new S;class LE extends hi{constructor(t,e,i){super(),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,e===void 0&&(e=1);let r=new ze;r.setAttribute("position",new _e([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));const o=new Bn({fog:!1,toneMapped:!1});this.lightPlane=new c(r,o),this.add(this.lightPlane),r=new ze,r.setAttribute("position",new _e([0,0,0,0,0,1],3)),this.targetLine=new c(r,o),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){rx.setFromMatrixPosition(this.light.matrixWorld),vm.setFromMatrixPosition(this.light.target.matrixWorld),ox.subVectors(vm,rx),this.lightPlane.lookAt(vm),this.color!==void 0?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(vm),this.targetLine.scale.z=ox.length()}}const _m=new S,xn=new la;class OE extends R{constructor(t){const e=new ze,i=new Bn({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],o=[],s={},a=new Le(16755200),l=new Le(16711680),u=new Le(43775),h=new Le(16777215),d=new Le(3355443);function p(g,_,y){m(g,y),m(_,y)}function m(g,_){r.push(0,0,0),o.push(_.r,_.g,_.b),s[g]===void 0&&(s[g]=[]),s[g].push(r.length/3-1)}p("n1","n2",a),p("n2","n4",a),p("n4","n3",a),p("n3","n1",a),p("f1","f2",a),p("f2","f4",a),p("f4","f3",a),p("f3","f1",a),p("n1","f1",a),p("n2","f2",a),p("n3","f3",a),p("n4","f4",a),p("p","n1",l),p("p","n2",l),p("p","n3",l),p("p","n4",l),p("u1","u2",u),p("u2","u3",u),p("u3","u1",u),p("c","t",h),p("p","c",d),p("cn1","cn2",d),p("cn3","cn4",d),p("cf1","cf2",d),p("cf3","cf4",d),e.setAttribute("position",new _e(r,3)),e.setAttribute("color",new _e(o,3)),super(e,i),this.type="CameraHelper",this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update()}update(){const t=this.geometry,e=this.pointMap;xn.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Cn("c",e,t,xn,0,0,-1),Cn("t",e,t,xn,0,0,1),Cn("n1",e,t,xn,-1,-1,-1),Cn("n2",e,t,xn,1,-1,-1),Cn("n3",e,t,xn,-1,1,-1),Cn("n4",e,t,xn,1,1,-1),Cn("f1",e,t,xn,-1,-1,1),Cn("f2",e,t,xn,1,-1,1),Cn("f3",e,t,xn,-1,1,1),Cn("f4",e,t,xn,1,1,1),Cn("u1",e,t,xn,.7,1.1,-1),Cn("u2",e,t,xn,-.7,1.1,-1),Cn("u3",e,t,xn,0,2,-1),Cn("cf1",e,t,xn,-1,0,1),Cn("cf2",e,t,xn,1,0,1),Cn("cf3",e,t,xn,0,-1,1),Cn("cf4",e,t,xn,0,1,1),Cn("cn1",e,t,xn,-1,0,-1),Cn("cn2",e,t,xn,1,0,-1),Cn("cn3",e,t,xn,0,-1,-1),Cn("cn4",e,t,xn,0,1,-1),t.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function Cn(n,t,e,i,r,o,s){_m.set(r,o,s).unproject(i);const a=t[n];if(a!==void 0){const l=e.getAttribute("position");for(let u=0,h=a.length;u<h;u++)l.setXYZ(a[u],_m.x,_m.y,_m.z)}}const ym=new Yi;class sx extends R{constructor(t,e=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),o=new ze;o.setIndex(new mi(i,1)),o.setAttribute("position",new mi(r,3)),super(o,new Bn({color:e,toneMapped:!1})),this.object=t,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(t){if(t!==void 0&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),this.object!==void 0&&ym.setFromObject(this.object),ym.isEmpty())return;const e=ym.min,i=ym.max,r=this.geometry.attributes.position,o=r.array;o[0]=i.x,o[1]=i.y,o[2]=i.z,o[3]=e.x,o[4]=i.y,o[5]=i.z,o[6]=e.x,o[7]=e.y,o[8]=i.z,o[9]=i.x,o[10]=e.y,o[11]=i.z,o[12]=i.x,o[13]=i.y,o[14]=e.z,o[15]=e.x,o[16]=i.y,o[17]=e.z,o[18]=e.x,o[19]=e.y,o[20]=e.z,o[21]=i.x,o[22]=e.y,o[23]=e.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(t){return this.object=t,this.update(),this}copy(t){return R.prototype.copy.call(this,t),this.object=t.object,this}}class NE extends R{constructor(t,e=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new ze;r.setIndex(new mi(i,1)),r.setAttribute("position",new _e([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(r,new Bn({color:e,toneMapped:!1})),this.box=t,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(t){const e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(t))}}class DE extends c{constructor(t,e=1,i=16776960){const r=i,o=new ze;o.setAttribute("position",new _e([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),o.computeBoundingSphere(),super(o,new Bn({color:r,toneMapped:!1})),this.type="PlaneHelper",this.plane=t,this.size=e;const s=new ze;s.setAttribute("position",new _e([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),s.computeBoundingSphere(),this.add(new Ti(s,new pn({color:r,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(t){let e=-this.plane.constant;Math.abs(e)<1e-8&&(e=1e-8),this.scale.set(.5*this.size,.5*this.size,e),this.children[0].material.side=e<0?X:j,this.lookAt(this.plane.normal),super.updateMatrixWorld(t)}}const ax=new S;let xm,Zv;class FE extends hi{constructor(t=new S(0,0,1),e=new S(0,0,0),i=1,r=16776960,o=.2*i,s=.2*o){super(),this.type="ArrowHelper",xm===void 0&&(xm=new ze,xm.setAttribute("position",new _e([0,0,0,0,1,0],3)),Zv=new He(0,.5,1,5,1),Zv.translate(0,-.5,0)),this.position.copy(e),this.line=new c(xm,new Bn({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Ti(Zv,new pn({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(i,o,s)}setDirection(t){if(t.y>.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{ax.set(t.z,0,-t.x).normalize();const e=Math.acos(t.y);this.quaternion.setFromAxisAngle(ax,e)}}setLength(t,e=.2*t,i=.2*e){this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(i,e,i),this.cone.position.y=t,this.cone.updateMatrix()}setColor(t){this.line.material.color.set(t),this.cone.material.color.set(t)}copy(t){return super.copy(t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this}}class lx extends R{constructor(t=1){const e=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],i=new ze;i.setAttribute("position",new _e(e,3)),i.setAttribute("color",new _e([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(i,new Bn({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(t,e,i){const r=new Le,o=this.geometry.attributes.color.array;return r.set(t),r.toArray(o,0),r.toArray(o,3),r.set(e),r.toArray(o,6),r.toArray(o,9),r.set(i),r.toArray(o,12),r.toArray(o,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}const ux=new Float32Array(1),BE=new Int32Array(ux.buffer);class kE{static toHalfFloat(t){ux[0]=t;const e=BE[0];let i=e>>16&32768,r=e>>12&2047;const o=e>>23&255;return o<103?i:o>142?(i|=31744,i|=(o==255?0:1)&&8388607&e,i):o<113?(r|=2048,i|=(r>>114-o)+(r>>113-o&1),i):(i|=o-112<<10|r>>1,i+=1&r,i)}}const As=Math.pow(2,8),hx=[.125,.215,.35,.446,.526,.582],cx=5+hx.length,Rs={[Be]:0,[gi]:1,[Mr]:2,[Nl]:3,[Zc]:4,[dr]:5,[an]:6},xu=new pn({side:X,depthWrite:!1,depthTest:!1}),UE=new Ti(new wo,xu),Kv=new rc,{_lodPlanes:Jd,_sizeLods:dx,_sigmas:bm}=zE(),px=new Le;let Qv=null;const bu=(1+Math.sqrt(5))/2,sc=1/bu,fx=[new S(1,1,1),new S(-1,1,1),new S(1,1,-1),new S(-1,1,-1),new S(0,bu,sc),new S(0,bu,-sc),new S(sc,0,bu),new S(-sc,0,bu),new S(bu,sc,0),new S(-bu,sc,0)];function mx(n){const t=Math.max(n.r,n.g,n.b),e=Math.min(Math.max(Math.ceil(Math.log2(t)),-128),127);return n.multiplyScalar(Math.pow(2,-e)),(e+128)/255}class GE{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._blurMaterial=function(e){const i=new Float32Array(e),r=new S(0,1,0);return new ic({name:"SphericalGaussianBlur",defines:{n:e},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r},inputEncoding:{value:Rs[Be]},outputEncoding:{value:Rs[Be]}},vertexShader:t0(),fragmentShader:`
|
|
4724
4724
|
|
|
4725
4725
|
precision mediump float;
|
|
@@ -6164,7 +6164,7 @@ and limitations under the License.
|
|
|
6164
6164
|
*
|
|
6165
6165
|
* pixi.js is licensed under the MIT License.
|
|
6166
6166
|
* http://www.opensource.org/licenses/mit-license
|
|
6167
|
-
*/gl.registerPlugin("accessibility",l2),gl.registerPlugin("extract",dR),gl.registerPlugin("interaction",p2),gl.registerPlugin("particle",qR),gl.registerPlugin("prepare",vC),gl.registerPlugin("batch",hR),gl.registerPlugin("tilingSprite",yC),Ls.registerPlugin(MC),Ls.registerPlugin(xR),Ls.registerPlugin(LR),Ls.registerPlugin(XR),Ls.registerPlugin(_C),jm.registerPlugin(u2),jm.registerPlugin(vR);var ur,ig={AlphaFilter:AC,BlurFilter:PC,BlurFilterPass:n_,ColorMatrixFilter:r_,DisplacementFilter:IC,FXAAFilter:LC,NoiseFilter:OC};class kC extends C.a{constructor(){super(),this.prevTime=-1,this.times=0,this.valueTotal=0,this.destroyed=!1,this.value=0,this.calcFps()}calcFps(){requestAnimationFrame(t=>{const e=t-this.prevTime;this.valueTotal+=e,this.times+=1,this.times>20&&(this.value=Math.floor(1e3*this.times/this.valueTotal),this.valueTotal=0,this.times=0,this.destroyed||this.emit("update",this.value)),this.prevTime=t,this.destroyed||this.calcFps()})}destroy(){this.destroyed=!0}}(function(n){n.ResourceError="RESOURCE_ERROR",n.RuntimeError="RUNTIME_ERROR",n.RuntimeWarn="RUNTIME_WARN",n.CanvasCrash="CANVAS_CRASH"})(ur||(ur={}));class Sn extends Error{constructor(t,e){var i,r;super(e),i=this,r=new.target.prototype,Object.setPrototypeOf?Object.setPrototypeOf(i,r):i.__proto__&&(i.__proto__=r),this.errorType=t,this.errorMsg=e}static transform(t){return t instanceof Sn?t:new Sn(ur.RuntimeError,t.message)}}function ng(){return function(n,t,e){const i=e.value;e.value=function(...r){try{return i.apply(this,r)}catch(o){throw new Sn(ur.RuntimeWarn,o.message)}}}}var UC=v(6),Lw=v.n(UC);function ao(n,t,e=5){return Math.abs(n-t)<=Math.pow(10,-e)}function wc(n){return Math.floor(1e6*n)/1e6}class yl{constructor(){this.point={x:0,y:0},this.slope=Math.PI/4}static fromPointSlope(t,e){const i=new yl;return i.point=t,i.slope=e,i}resolveY(t){return Math.tan(this.slope)*(t-this.point.x)+this.point.y}distanceToLinearEquation(t){return ao(this.slope,t.slope)?this.distanceToPoint(t.point):-1}distanceToPoint(t){let e=0;if(Math.tan(this.slope)*(t.x-this.point.x)+this.point.y===t.y)return 0;e=this.slope>=Math.PI/2?this.slope-Math.PI/2:Math.PI/2+this.slope;const i=yl.fromPointSlope(t,e),r=this.crossPoint(i);return r?Math.ceil(Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2))):0}crossPoint(t){if(ao(t.slope,this.slope))return null;let e=0,i=0;const r=Math.tan(t.slope),o=Math.tan(this.slope),{x:s,y:a}=this.point,{x:l,y:u}=t.point;return ao(this.slope,Math.PI/2)?(e=this.point.x,i=r*(e-l)+u):ao(t.slope,Math.PI/2)?(e=t.point.x,i=o*(e-s)+a):ao(this.slope,Math.PI)||ao(this.slope,0)?(i=this.point.y,e=(i-u)/r+l):ao(t.slope,Math.PI)||ao(t.slope,0)?(i=t.point.y,e=(i-a)/o+s):(e=(r*l-u+a-o*s)/(r-o),i=o*(e-s)+a),{x:e,y:i}}}var GC=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};function fp(){return Date.now().toString(32)+Math.random().toString(32).substring(2)}const Ra="__delay_resolve_result__";function Sc(n,t){return GC(this,void 0,void 0,function*(){const e=yield Promise.race([n(),(i=t,new Promise(r=>{setTimeout(()=>{r(Ra)},i)}))]);var i;return e===Ra?Ra:e})}var a_=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};function Ow(n,t){return a_(this,void 0,void 0,function*(){const e=yield Sc(()=>fetch(n),t);if(e===Ra)throw new Sn(ur.ResourceError,`"${n}" loaded timeout"`);if(!e.ok)throw new Sn(ur.ResourceError,`"${n}" loaded failed with status "${e.status}"`);return e})}class HC{constructor(t,e,i,r,o){this.timeout=15e3,this.useCache=!1,this.taskId="",this.delegate=null,this.useCache=e,this.localStorage=t,this.logger=i,this.timeout=r,this.delegate=o||null}attachTaskId(t){this.taskId=t}fetchJson(t){return a_(this,void 0,void 0,function*(){let e;if(this.useCache&&(this.logger.info("load resource from cache. "+t,this.taskId||""),e=yield this.localStorage.getItem(t)),e)return this.logger.info("cache hit. "+t,this.taskId||""),e;{let i;if(this.delegate){this.logger.info("load resource by delegate. "+t,this.taskId||"");const r=yield Sc(()=>this.delegate.loadJson(t),this.timeout);if(r===Ra)throw new Sn(ur.ResourceError,`"${t}" loaded timeout"`);i=JSON.parse(r)}else this.logger.info("load resource from server. "+t,this.taskId||""),i=yield(yield Ow(""+t,this.timeout)).json();return this.logger.info("load end. "+t,this.taskId||""),this.useCache&&this.localStorage.setItem(t,i).catch(()=>{}),i}})}fetchPng(t){return a_(this,void 0,void 0,function*(){let e;if(this.useCache&&(this.logger.info("load resource from cache. "+t,this.taskId||""),e=yield this.localStorage.getItem(t)),e)return this.logger.info("cache hit. "+t,this.taskId||""),e;{let i;if(this.delegate){if(this.logger.info("load resource by delegate. "+t,this.taskId||""),i=yield Sc(()=>this.delegate.loadImage(t),this.timeout),i===Ra)throw new Sn(ur.ResourceError,`"${t}" loaded timeout"`)}else this.logger.info("load resource from server. "+t,this.taskId||""),i=yield(yield Ow(t,this.timeout)).blob();return e=yield function(r){return new Promise((o,s)=>{const a=new FileReader;a.onload=()=>{o(a.result)},a.onerror=()=>{s(new Sn(ur.ResourceError,"Failed parse blob data."))},a.readAsDataURL(r)})}(i),this.logger.info("load end. "+t,this.taskId||""),this.useCache&&this.localStorage.setItem(t,e).catch(()=>{}),e}})}destroy(){}}var zC=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};class jC{constructor(t){this.isPaused=!1,this.timestamp=0,this.callbackList=[],this.onTimeUpdate=e=>{const i=e/(We.TARGET_FPMS||.06);if(!this.isPaused){this.timestamp+=i,this.callbackList=this.callbackList.filter(o=>o&&!o.applied);let{length:r}=this.callbackList;for(let o=0;o<r;o++){const s=this.callbackList[o];if(s&&!s.applied){if(!(s.triggerTime<=this.timestamp))break;s.running=!0,s.fn(),s.applied=!0,r=this.callbackList.length}}}},this.ticker=t,this.ticker.add(this.onTimeUpdate)}setTimeout(t,e){const i=fp(),r=this.timestamp+Math.max(e||16,16);return this.callbackList.push({fn:t,triggerTime:r,id:i,applied:!1,running:!1}),this.callbackList.sort((o,s)=>o.triggerTime-s.triggerTime),i}clearTimeout(t){const e=this.callbackList.findIndex(i=>i.id===t);e>=0&&!this.callbackList[e].running&&this.callbackList.splice(e,1)}delay(t){return new Promise(e=>{this.setTimeout(e,t)})}waitUntil(t,e){return zC(this,void 0,void 0,function*(){const i=this.timestamp;for(;!t()&&this.timestamp-i<e;)yield this.delay(50)})}pause(){this.isPaused=!0}resume(){this.isPaused=!1}}var VC=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};function rg(n,t,e){return e?Math.floor(parseFloat(n)*t):Math.ceil(parseFloat(n)*t)}const og={w:!0,h:!0,x:!1,y:!1};class WC{constructor(t){this.gifs=Object.create(null),this.textures=Object.create(null),this.frames=Object.create(null),this.spriteSheets=[],this.loader=t}getTexture(t){return this.textures[t]||null}getFrameData(t){return this.frames[t]}getGifFrames(t){return this.gifs[t]?this.gifs[t].filter(e=>!!e):[]}loadSpriteSheetItem(t,e,i,r){return VC(this,void 0,void 0,function*(){const o=yield this.loader.fetchJson(`${t}/${e}/jsonOutput/${i}.json`),s=yield this.loader.fetchPng(`${t}/${e}/jsonOutput/${i}.png`),a=document.createElement("img");a.src=s,yield new Promise((y,w)=>{a.onload=()=>y(""),a.onerror=()=>w()});let l=r;const u=a.width||1,h=a.height||1;if(u>2048||h>2048){l*=2048/u;const y=l*h;y>2048&&(l*=h/y)}(function(y,w){y.meta&&y.meta.size&&["w","h"].forEach(A=>{y.meta.size[A]=rg(y.meta.size[A],w,og[A])}),y.frames&&Object.keys(y.frames).forEach(A=>{y.frames[A].frame&&["x","y","w","h"].forEach(I=>{y.frames[A].frame[I]=rg(y.frames[A].frame[I],w,og[I])}),y.frames[A].spriteSourceSize&&["x","y","w","h"].forEach(I=>{y.frames[A].spriteSourceSize[I]=rg(y.frames[A].spriteSourceSize[I],w,og[I])}),y.frames[A].sourceSize&&["w","h"].forEach(I=>{y.frames[A].sourceSize[I]=rg(y.frames[A].sourceSize[I],w,og[I])})})})(o,l);const d=document.createElement("canvas"),p=Math.ceil(a.width*l),m=Math.ceil(a.height*l);d.width=p,d.height=m,d.getContext("2d").drawImage(a,0,0,p,m);const g=new Mi(d,{resolution:1}),_=new P1(g,o);yield new Promise(y=>{_.parse(()=>y(""))}),this.spriteSheets.push(_),Object.keys(_.textures).forEach(y=>{const w=y.match(/^(.+)_gif_(\d+)$/);if(w&&w[1]&&w[2]){const A=w[1];this.gifs[A]||(this.gifs[A]=[]);const I=parseInt(w[2],10);this.gifs[A][I]=_.textures[y]}else this.frames[y]=o.frames[y],this.textures[y]=_.textures[y]})})}destroy(){this.spriteSheets.forEach(t=>t.destroy(!0)),this.spriteSheets=[],this.gifs=Object.create(null),this.textures=Object.create(null),this.frames=Object.create(null)}}var XC=v(2),sg=v.n(XC);function Nw(n,t,e){let i,r;const o=Math.round(n)%360;if(o%180==0)i=Math.cos(o*(Math.PI/180))*t,r=0;else if(o%90==0)i=0,r=Math.sin(o*(Math.PI/180))*e;else{const s=function(a){const l=a*Math.PI/180;return Math.tan(l)}(o);i=t*e/Math.sqrt(Math.pow(e,2)+Math.pow(t*s,2)),(o>90&&o<270||o<-90&&o>-270)&&(i=-i),r=s*i}return{x:i,y:r}}function qC(n,t,e,i,r,o){const s=n,a=t;let l,u,h,d,p;if(Math.round(i)===0)l=r,u=o,p=0;else if(Math.round(i)>=360)l=r,u=o,h=r+2*n*Math.abs(Math.cos(-e/180*Math.PI)),d=o+2*t*Math.sin(-e/180*Math.PI),p=1;else{const m=-e,g=-(e+i),{x:_,y}=Nw(m,s,a),w=r-_,A=o+y,{x:I,y:F}=Nw(g,s,a);l=I+w,u=A-F,p=i>=-360&&i<-180?1:i>=-180&&i<0||i>0&&i<180?0:1}return{radiusX:s,radiusY:a,xAxisRotation:0,largeArcFlag:p,sweepFlag:i>0?1:0,endX:l,endY:u,middleX:h,middleY:d}}class Dw{constructor(){this.pool=[]}getObject(t){const e=this.pool.find(i=>!i.isUsed);if(e)return e.isUsed=!0,e.obj;{const i={obj:this.createObject(),isUsed:!0,group:t};return this.pool.push(i),i.obj}}collectObject(t){const e=this.pool.find(i=>i.obj===t);e&&(e.isUsed=!1,this.resetObject(e.obj))}collectObjectByGroup(t){this.pool.filter(e=>e.group===t).forEach(e=>this.collectObject(e.obj))}}const l_=new class extends Dw{createObject(){const n=document.createElementNS("http://www.w3.org/2000/svg","svg");return n.setAttribute("xmlns","http://www.w3.org/2000/svg"),n.setAttribute("version","1.1"),n}resetObject(n){n.removeAttribute("viewBox"),n.removeAttribute("width"),n.removeAttribute("height"),n.innerHTML=""}},u_=new class extends Dw{createObject(){return document.createElement("img")}resetObject(n){n.removeAttribute("src")}};var YC=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};class $C{constructor(){this.imgElements=[],this.svgElements=[],this.idToHashMap=Object.create(null),this.textures=Object.create(null),this.graphics=[],this.hashToIdMap=Object.create(null)}render(t,e,i){return YC(this,void 0,void 0,function*(){const{items:r,width:o,height:s}=t,a=u_.getObject(i),l=new Mi(a,{width:o,height:s,resolution:1}),u=l_.getObject(i);this.imgElements.push(a),this.svgElements.push(u),u.setAttribute("viewBox",`0 0 ${o} ${s}`),u.setAttribute("width",""+o),u.setAttribute("height",""+s);const h={},d={};r.forEach(g=>{const{item:_,x:y,y:w}=g,A=y+2,I=w+2;_.pathsData.forEach(U=>{let B="";U.cmds.forEach(([G,ct])=>{B+=G+" ",B+=ct.map(it=>(Object(V.isNumber)(it)||(it.x=it.x+U.offset.x+A,it.y=it.y+U.offset.y+I),it)).reduce((it,tt)=>(Object(V.isNumber)(tt)?it+=tt+" ":it+=`${tt.x} ${tt.y} `,it),""),B+=" "}),U.pathElement.setAttribute("d",B),u.appendChild(U.pathElement)});const F=_.width-4-2*_.padding,N=_.height-4-2*_.padding;this.textures[_.hash]={texture:new Qe(l,new bi(A+2,I+2,F,N)),pivot:_.pivot},h[_.hash]={x:A+2,y:I+2,w:F,h:N,pivot:_.pivot},d[_.hash]=this.hashToIdMap[_.hash]});const p=(m='<?xml version="1.0" encoding="utf-8"?>'+u.outerHTML,"data:image/svg+xml,"+encodeURIComponent(m).replace(/'/g,"%27").replace(/"/g,"%22"));var m;a.src=p,yield new Promise((g,_)=>{a.onload=()=>g(""),a.onerror=()=>_()})})}getGraphicsData(t){const e=this.idToHashMap[t]||"";return this.textures[e]||null}addGraphics(t,e,i,r,o,s,a,l,u,h,d){var p,m;if(!a&&!u)return t;const g=sg()(i+((m=(p=a==null?void 0:a.width)===null||p===void 0?void 0:p.toString())!==null&&m!==void 0?m:0)+u+h+d);if(this.hashToIdMap[g]||(this.hashToIdMap[g]=[]),this.hashToIdMap[g].push(t),this.idToHashMap[t]=g,this.graphics.findIndex(_=>_.hash===g)<0){const{graphicsWidth:_,graphicsHeight:y,pathsData:w,pivot:A,padding:I}=function(F,N,U,B,G,ct,it,tt,rt){var et;const pt=[],kt={x:Math.abs(G.x),y:Math.abs(G.y)};let Lt=0,_t=0,xt=0,jt=0,ee=0,le="none";const nt=(et=B==null?void 0:B.width)!==null&&et!==void 0?et:0;return it?(Lt=N,_t=U,ee=0):(le=rt||"#ff0000",ee=nt,xt=.5*nt,jt=.5*nt,Lt=N+nt,_t=U+nt,kt.x+=.5*nt,kt.y+=.5*nt),Lt+=Math.abs(G.x),_t+=Math.abs(G.y),xt+=Math.abs(G.x),jt+=Math.abs(G.y),Lt+=4,_t+=4,xt+=2,jt+=2,Lt=Math.ceil(Lt),_t=Math.ceil(_t),F.forEach(lt=>{const Xt=document.createElementNS("http://www.w3.org/2000/svg","path");lt.fill!=="none"&&it?Xt.setAttribute("fill",tt||"#ff0000"):Xt.setAttribute("fill","none"),lt.hasStroke&&!it&&(Xt.setAttribute("stroke-linecap",(B==null?void 0:B.cap)||"butt"),Xt.setAttribute("stroke-linejoin",(B==null?void 0:B.join)||"miter"),Xt.setAttribute("stroke-width",ee.toString()),Xt.setAttribute("stroke",le),B!=null&&B.dash&&Xt.setAttribute("stroke-dasharray",B.dash));const{scale:Ut}=lt,Bt=lt.path.trim().split(" ");let ue={x:0,y:0};const he={offset:{x:xt,y:jt},cmds:[],pathElement:Xt};for(let Vt=0;Vt<Bt.length;Vt+=2){const Q=Bt[Vt],gt=Bt[Vt+1];if(Q==="M"){let[Dt,Ft]=gt.split(",").map(St=>Number(St));ue={x:Dt,y:Ft},Dt=Dt/9525*Ut.x,Ft=Ft/9525*Ut.y,he.cmds.push(["M",[{x:Dt,y:Ft}]])}else if(Q==="A"){const[Dt,Ft,St,Yt]=gt.split(",").map(si=>Number(si)),Me=St/Math.PI*180,Re=Yt/Math.PI*180,Ae=qC(Dt,Ft,Me,Re,ue.x,ue.y);Math.round(Re)>=360?(ue={x:Ae.endX,y:Ae.endY},he.cmds.push(["A",[Ae.radiusX/9525*Ut.x,Ae.radiusY/9525*Ut.y,Ae.xAxisRotation,Ae.largeArcFlag,Ae.sweepFlag,{x:Ae.middleX/9525*Ut.x,y:Ae.middleY/9525*Ut.y}]]),he.cmds.push(["A",[Ae.radiusX/9525*Ut.x,Ae.radiusY/9525*Ut.y,Ae.xAxisRotation,Ae.largeArcFlag,Ae.sweepFlag,{x:Ae.endX/9525*Ut.x,y:Ae.endY/9525*Ut.y}]])):(ue={x:Ae.endX,y:Ae.endY},he.cmds.push(["A",[Ae.radiusX/9525*Ut.x,Ae.radiusY/9525*Ut.y,Ae.xAxisRotation,Ae.largeArcFlag,Ae.sweepFlag,{x:Ae.endX/9525*Ut.x,y:Ae.endY/9525*Ut.y}]]))}else if(Q==="L"){let[Dt,Ft]=gt.split(",").map(St=>Number(St));ue={x:Dt,y:Ft},Dt=Dt/9525*Ut.x,Ft=Ft/9525*Ut.y,he.cmds.push(["L",[{x:Dt,y:Ft}]])}else if(Q==="QB"){let[Dt,Ft,St,Yt]=gt.split(",").map(Me=>Number(Me));ue={x:St,y:Yt},Dt=Dt/9525*Ut.x,Ft=Ft/9525*Ut.y,St=St/9525*Ut.x,Yt=Yt/9525*Ut.y,he.cmds.push(["Q",[{x:Dt,y:Ft},{x:St,y:Yt}]])}else if(Q==="CB"){let[Dt,Ft,St,Yt,Me,Re]=gt.split(",").map(Ae=>Number(Ae));ue={x:Me,y:Re},Dt=Dt/9525*Ut.x,Ft=Ft/9525*Ut.y,St=St/9525*Ut.x,Yt=Yt/9525*Ut.y,Me=Me/9525*Ut.x,Re=Re/9525*Ut.y,he.cmds.push(["C",[{x:Dt,y:Ft},{x:St,y:Yt},{x:Me,y:Re}]])}else Q==="C"&&he.cmds.push(["Z",[]])}pt.push(he)}),{graphicsWidth:Lt,graphicsHeight:_t,pivot:kt,padding:2,pathsData:pt}}(e,o,s,a,r,0,u,h,d);this.graphics.push({hash:g,pathsData:w,pivot:A,width:_,height:y,padding:I})}return t}pack(){return this.graphics.forEach(t=>{t.width+=4,t.height+=4}),function t(e){const i=[],r=e.filter(h=>{const d=h.width<2048&&h.height<2048;return d||i.push(h),d}).sort((h,d)=>h.width*h.height-d.width*d.height);let o=r.length+1,s=2050,a=2050;const l=[];let u=null;for(;(s>2048||a>2048)&&r.length>0;)o-=1,u=Lw()(r.slice(0,o)),s=u.width,a=u.height;return u&&l.push(u),i.forEach(h=>{const d=Lw()([h]);l.push(d)}),o<r.length?l.concat(t(r.slice(o))):l}(this.graphics)}destroy(){Object.keys(this.textures).forEach(t=>{var e;(e=this.textures[t])===null||e===void 0||e.texture.destroy(!0)}),this.textures=Object.create(null),this.imgElements.forEach(t=>u_.collectObject(t)),this.svgElements.forEach(t=>l_.collectObject(t)),this.graphics=[]}}class JC{constructor(){this.runningTimeNodes={}}addRunningTimeNode(t,e,i){const r=`${e}_${t}`;if(this.runningTimeNodes[r])try{this.runningTimeNodes[r].dispose(!0)}catch{}this.runningTimeNodes[r]=i}removeRunningTimeNode(t,e){const i=`${e}_${t}`;delete this.runningTimeNodes[i]}}class ZC{constructor(t){this.eventHub=t,this.targets=Object.create(null)}getTargets(){return Object.keys(this.targets).map(t=>this.targets[t])}addTarget(t,e){this.targets[t]=e}getTargetById(t){return this.targets[t]}getTarget(t,e,i={type:"el",index:0,id:""}){var r,o;let s=this.targets[t.id];return t.type!=="shape"?s:(t.type==="shape"&&t.txEl&&(s=(r=s==null?void 0:s.getTextElement(t.txEl.type,t.txEl.range))!==null&&r!==void 0?r:null),t.type==="shape"&&t.bg&&i.index===0&&(e=!1,s=(o=s==null?void 0:s.getBgElement())!==null&&o!==void 0?o:null,this.eventHub.emit("IterateTimeNodeEnd",i.id)),e&&s?s.getIterateEntry(i.type,i.index,i.id):(s||this.eventHub.emit("IterateTimeNodeEnd",i.id),s))}clearTargets(){this.targets=Object.create(null)}}class KC{constructor(t){this.target=t}get color(){return this.target.strokeColorFilter.currentColor}set color(t){this.target.strokeColorFilter.color=t}get on(){return this.target.strokeActive?"true":"false"}set on(t){this.target.strokeActive=t==="true"}}class QC{constructor(t){this.target=t}applyCommand(t,e){this.target.applyCommand(t,e)}}class Fw{constructor(t){this.target=t}get color(){return this.target.fillColorFilter.currentColor}set color(t){this.target.fillActive&&(this.target.fillColorFilter.color=t)}get on(){return this.target.fillActive?"true":"false"}set on(t){this.target.fillActive=t==="true"}get designColor(){return this.target.fillColorFilter.designColor}}class tP{constructor(t,e){this.hardHidden=!1,this.target=t,e===!0&&(this.hardHidden=!0)}get opacity(){return this.target.alpha}set opacity(t){this.target.alpha=t}get rotation(){return this.target.rotation/Math.PI*180}set rotation(t){this.target.rotation=t/180*Math.PI}get visibility(){return this.target.visible?"visible":"hidden"}set visibility(t){this.visibility===t||this.hardHidden||(this.target.visible=t==="visible")}}class eP{constructor(t,e){this.actions=[],this.ctx=e,this.object=t,this.object.interactive=!0}reset(t){this.object.interactive=!1,this.object.removeAllListeners(),this.object=t,this.object.interactive=!0}addAction(t,e){this.actions.push([t,e]),e==="click"?(this.object.addListener("click",()=>this.handleAction(t)),this.object.cursor="pointer"):e==="hover"&&this.object.addListener("mouseover",()=>this.handleAction(t))}addProxy(t){this.proxy=t,this.hitArea=this.getOriginHitArea(),this.proxy.interactive=!0,this.actions.forEach(([e,i])=>{var r,o;i==="click"?(r=this.proxy)===null||r===void 0||r.addListener("click",s=>this.handleProxyAction(s,e)):i==="hover"&&((o=this.proxy)===null||o===void 0||o.addListener("mouseover",s=>this.handleProxyAction(s,e)))})}handleProxyAction(t,e){var i;const r=t.data.global,o=this.object.getGlobalPosition(),s=r.x-o.x+this.object.pivot.x,a=r.y-o.y+this.object.pivot.y;((i=this.hitArea)===null||i===void 0?void 0:i.contains(s,a))&&this.object.visible&&this.handleAction(e,!0)}getOriginHitArea(){return this.object.hitArea?this.object.hitArea:new M0(0,0,this.object.width,this.object.height)}handleAction(t,e=!1){this.proxy&&!e||(this.ctx.eventHub.emit(Ne.hyperlinkTrigger,t),this.execAction(t))}execAction(t){var e;if(this.ctx.eventHub.emit(Ne.userInput),t.action==="ppaction://hlinksldjump"){const i=((e=t==null?void 0:t.target)!==null&&e!==void 0?e:"").match(/slide(\d+)\.xml/);i&&i[1]&&this.ctx.eventHub.emit(Ne.requestGotoSlide,Number(i[1]))}else if(t.action==="ppaction://hlinkshowjump?jump=nextslide")this.ctx.eventHub.emit(Ne.requestNextSlide);else if(t.action==="ppaction://hlinkshowjump?jump=previousslide")this.ctx.eventHub.emit(Ne.requestPrevSlide);else if(t.action==="ppaction://hlinkshowjump?jump=firstslide")this.ctx.eventHub.emit(Ne.requestGotoSlide,1);else if(t.action==="ppaction://hlinkshowjump?jump=lastslide")this.ctx.eventHub.emit(Ne.requestGotoSlide,-1);else if(t.action==="ppaction://hlinkshowjump?jump=lastslideviewed"){const i=this.ctx.lastViewedIndex;this.ctx.eventHub.emit(Ne.requestGotoSlide,i)}else t.action==="ppaction://hlinkshowjump?jump=endshow"&&this.ctx.eventHub.emit(Ne.requestGotoSlide,-1)}}class h_{constructor(t,e,i){var r,o,s,a,l,u;this.scaleExt={x:1,y:1},this.scaleOrigin={x:1,y:1},this.designScale={x:1,y:1},this.bound=new bi(0,0,1,1),this.pptX=0,this.pptY=0,this.presetSubType=0,this.designWidth=0,this.designHeight=0,this.designX=0,this.designY=0,this.hasPreset=!1,this.container=new ar,this.ctx=e,this.style=new tP(this.container,t.hardHidden),this.designGlobalPosition={x:i.x+((o=(r=t.position)===null||r===void 0?void 0:r.x)!==null&&o!==void 0?o:0),y:i.y+((a=(s=t.position)===null||s===void 0?void 0:s.y)!==null&&a!==void 0?a:0)},this.container.interactive=!0,(t.hlinkClick||t.hlinkHover)&&(this.hyperlink=new eP(this.container,this.ctx),t.hlinkHover&&((l=this.hyperlink)===null||l===void 0||l.addAction(t.hlinkHover,"hover")),t.hlinkClick&&((u=this.hyperlink)===null||u===void 0||u.addAction(t.hlinkClick,"click"))),this.ctx.clock.waitUntil(()=>{try{return!!this.container.width}catch{return!1}},3e3).then(()=>{try{this.designWidth=this.designWidth||this.container.width}catch{}}),this.ctx.clock.waitUntil(()=>{try{return!!this.container.height}catch{return!1}},3e3).then(()=>{try{this.designHeight=this.designHeight||this.container.height}catch{}})}updateScale(){this.container&&(this.container.scale.x=this.designScale.x*this.scaleExt.x*this.scaleOrigin.x,this.container.scale.y=this.designScale.y*this.scaleExt.y*this.scaleOrigin.y)}updateTransform(t){var e,i,r,o,s,a,l,u;this.designWidth=t.width,this.designHeight=t.height,this.designX=(i=(e=t.position)===null||e===void 0?void 0:e.x)!==null&&i!==void 0?i:0,this.designY=(o=(r=t.position)===null||r===void 0?void 0:r.y)!==null&&o!==void 0?o:0;const h=this.designWidth/2,d=this.designHeight/2;this.container.width=this.designWidth,this.container.height=this.designHeight,this.container.pivot.x=h,this.container.pivot.y=d;const p=(a=(s=t.position)===null||s===void 0?void 0:s.x)!==null&&a!==void 0?a:0,m=(u=(l=t.position)===null||l===void 0?void 0:l.y)!==null&&u!==void 0?u:0;this.container.x=p+h,this.container.y=m+d,t.scale&&(this.designScale={x:t.scale.x,y:t.scale.y},this.container.scale.x=t.scale.x,this.container.scale.y=t.scale.y),t.rotation&&(this.container.rotation=t.rotation);const g=new Ns;g.drawRect(0,0,this.designWidth,this.designHeight),this.container.addChild(g),this.json.hardHidden&&(this.container.visible=!1),this.bound.x=p,this.bound.y=m,this.bound.width=this.designWidth,this.bound.height=this.designHeight}get scale(){return this.scaleOrigin}set scale(t){this.scaleOrigin.x=t.x,this.scaleOrigin.y=t.y,this.updateScale()}get design_ppt_w(){return wc(this.designWidth/this.ctx.stageWidth)}get design_ppt_h(){return wc((this.designHeight||this.container.height)/this.ctx.stageHeight)}get design_ppt_x(){return wc(this.designX/this.ctx.stageWidth)}get design_ppt_y(){return wc(this.designY/this.ctx.stageHeight)}get ppt_w(){return this.scaleExt.x*this.scaleOrigin.x*this.designWidth/this.ctx.stageWidth}set ppt_w(t){this.designWidth&&(this.scaleExt.x=t*this.ctx.stageWidth/this.designWidth,this.updateScale())}get ppt_h(){const t=this.designHeight||this.container.height;return this.scaleExt.y*this.scaleOrigin.y*t/this.ctx.stageHeight}set ppt_h(t){this.designHeight&&(this.scaleExt.y=t*this.ctx.stageHeight/this.designHeight,this.updateScale())}get ppt_x(){return(this.container.position.x-this.container.pivot.x)/this.ctx.stageWidth}set ppt_x(t){this.pptX=t;const e=this.presetSubType===544?this.scaleExt.x:1;this.container.position.x=t*this.ctx.stageWidth+this.container.pivot.x*e}get ppt_y(){return(this.container.position.y-this.container.pivot.y)/this.ctx.stageHeight}set ppt_y(t){this.pptY=t;const e=this.presetSubType===544?this.scaleExt.y:1;this.container.position.y=t*this.ctx.stageHeight+this.container.pivot.y*e}get r(){return this.container.rotation}set r(t){this.container.rotation=t}set xshear(t){this.container.skew.x=t}get xshear(){return this.container.skew.x}set yshear(t){this.container.skew.y=t}get yshear(){return this.container.skew.y}}class ag{constructor(t){if(this._isInit=!1,this.h=0,this.s=0,this.l=0,this.a=1,t){this._isInit=!0;const e=t.match(/-?[0-9]+/g);e&&(this.h=parseInt(e[0],10),this.s=parseInt(e[1],10)/100,this.l=parseInt(e[2],10)/100)}}isInit(){return this._isInit}by(t,e){e.h=Math.max(Math.min(this.h+t.h,359),0),e.s=Math.max(Math.min(this.s+t.s,1),0),e.l=Math.max(Math.min(this.l+t.l,1),0),e.a=Math.max(Math.min(this.a+t.a,1),0)}fromHexString(t){const[e,i,r,o]=Ds(t);let s=0,a=0,l=0;const u=Math.max(e,i,r),h=Math.min(e,i,r),d=u-h;l=(u+h)/2,d===0?s=0:u===e?s=(i-r)/d%6*60:u===i?s=60*((r-e)/d+2):u===r&&(s=60*((e-i)/d+4)),a=d===0?0:d/(1-Math.abs(2*l-1)),this.h=s,this.s=a,this.l=l,this.a=o}interpolationFrom(t,e,i){const r=t.h+(this.h-t.h)*e,o=t.s+(this.s-t.s)*e,s=t.l+(this.l-t.l)*e,a=t.a+(this.a-t.a)*e;i.h=Math.max(Math.min(r,359),0),i.s=Math.max(Math.min(o,1),0),i.l=Math.max(Math.min(s,1),0),i.a=Math.max(Math.min(a,1),0)}toHexString(){let t=[0,0,0,0];const{h:e,s:i,l:r}=this;if(e<360&&e>=0&&i<=1&&i>=0&&r<=1&&r>=0){let o,s,a;const l=(1-Math.abs(2*r-1))*i,u=l*(1-Math.abs(e/60%2-1)),h=r-l/2;[o,s,a]=e>=0&&e<60?[l,u,0]:e>=60&&e<120?[u,l,0]:e>=120&&e<180?[0,l,u]:e>=180&&e<240?[0,u,l]:e>=240&&e<300?[u,0,l]:[l,0,u],t=[o+h,s+h,a+h,this.a]}return kw(t)}}class lg{constructor(t){this._isInit=!1,this.r=0,this.g=0,this.b=0,this.a=0,t&&(this._isInit=!0,this.fromHexString(t))}fromHexString(t){const[e,i,r,o]=Ds(t);this.r=e,this.g=i,this.b=r,this.a=o}isInit(){return this._isInit}interpolationFrom(t,e,i){i.r=t.r+(this.r-t.r)*e,i.g=t.g+(this.g-t.g)*e,i.b=t.b+(this.b-t.b)*e,i.a=t.a+(this.a-t.a)*e}by(t,e){e.r=Math.min(Math.max(this.r+t.r,0),255),e.g=Math.min(Math.max(this.g+t.g,0),255),e.b=Math.min(Math.max(this.b+t.b,0),255),e.a=Math.min(Math.max(this.a+t.a,0),1)}toHexString(){return kw([this.r,this.g,this.b,this.a])}}function Bw(n){const t=n.substring(1);return[parseInt(t.substring(0,6),16),parseInt(t.substring(6,8),16)/255]}function Ds(n){return(n=n.replace(/^#/,"")).substring(6,8).length===0&&(n+="FF"),[parseInt(n.substring(0,2).padStart(8,"0"),16)/255,parseInt(n.substring(2,4).padStart(8,"0"),16)/255,parseInt(n.substring(4,6).padStart(8,"0"),16)/255,parseInt(n.substring(6,8).padStart(8,"0"),16)/255]}function kw(n){return"#"+Math.round(255*n[0]).toString(16).padStart(2,"0")+Math.round(255*n[1]).toString(16).padStart(2,"0")+Math.round(255*n[2]).toString(16).padStart(2,"0")+Math.round(255*n[3]).toString(16).padStart(2,"0")}function mp(n,t,e){const i=Ds(n),r=Ds(t),o=Math.round(255*(i[0]+(r[0]-i[0])*e)),s=Math.round(255*(i[1]+(r[1]-i[1])*e)),a=Math.round(255*(i[2]+(r[2]-i[2])*e)),l=Math.round(255*(i[3]+(r[3]-i[3])*e));return"#"+o.toString(16).padStart(2,"0")+s.toString(16).padStart(2,"0")+a.toString(16).padStart(2,"0")+l.toString(16).padStart(2,"0")}class gp extends Nr{constructor(){super(void 0,`
|
|
6167
|
+
*/gl.registerPlugin("accessibility",l2),gl.registerPlugin("extract",dR),gl.registerPlugin("interaction",p2),gl.registerPlugin("particle",qR),gl.registerPlugin("prepare",vC),gl.registerPlugin("batch",hR),gl.registerPlugin("tilingSprite",yC),Ls.registerPlugin(MC),Ls.registerPlugin(xR),Ls.registerPlugin(LR),Ls.registerPlugin(XR),Ls.registerPlugin(_C),jm.registerPlugin(u2),jm.registerPlugin(vR);var ur,ig={AlphaFilter:AC,BlurFilter:PC,BlurFilterPass:n_,ColorMatrixFilter:r_,DisplacementFilter:IC,FXAAFilter:LC,NoiseFilter:OC};class kC extends P.a{constructor(){super(),this.prevTime=-1,this.times=0,this.valueTotal=0,this.destroyed=!1,this.value=0,this.calcFps()}calcFps(){requestAnimationFrame(t=>{const e=t-this.prevTime;this.valueTotal+=e,this.times+=1,this.times>20&&(this.value=Math.floor(1e3*this.times/this.valueTotal),this.valueTotal=0,this.times=0,this.destroyed||this.emit("update",this.value)),this.prevTime=t,this.destroyed||this.calcFps()})}destroy(){this.destroyed=!0}}(function(n){n.ResourceError="RESOURCE_ERROR",n.RuntimeError="RUNTIME_ERROR",n.RuntimeWarn="RUNTIME_WARN",n.CanvasCrash="CANVAS_CRASH"})(ur||(ur={}));class Sn extends Error{constructor(t,e){var i,r;super(e),i=this,r=new.target.prototype,Object.setPrototypeOf?Object.setPrototypeOf(i,r):i.__proto__&&(i.__proto__=r),this.errorType=t,this.errorMsg=e}static transform(t){return t instanceof Sn?t:new Sn(ur.RuntimeError,t.message)}}function ng(){return function(n,t,e){const i=e.value;e.value=function(...r){try{return i.apply(this,r)}catch(o){throw new Sn(ur.RuntimeWarn,o.message)}}}}var UC=v(6),Lw=v.n(UC);function ao(n,t,e=5){return Math.abs(n-t)<=Math.pow(10,-e)}function wc(n){return Math.floor(1e6*n)/1e6}class yl{constructor(){this.point={x:0,y:0},this.slope=Math.PI/4}static fromPointSlope(t,e){const i=new yl;return i.point=t,i.slope=e,i}resolveY(t){return Math.tan(this.slope)*(t-this.point.x)+this.point.y}distanceToLinearEquation(t){return ao(this.slope,t.slope)?this.distanceToPoint(t.point):-1}distanceToPoint(t){let e=0;if(Math.tan(this.slope)*(t.x-this.point.x)+this.point.y===t.y)return 0;e=this.slope>=Math.PI/2?this.slope-Math.PI/2:Math.PI/2+this.slope;const i=yl.fromPointSlope(t,e),r=this.crossPoint(i);return r?Math.ceil(Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2))):0}crossPoint(t){if(ao(t.slope,this.slope))return null;let e=0,i=0;const r=Math.tan(t.slope),o=Math.tan(this.slope),{x:s,y:a}=this.point,{x:l,y:u}=t.point;return ao(this.slope,Math.PI/2)?(e=this.point.x,i=r*(e-l)+u):ao(t.slope,Math.PI/2)?(e=t.point.x,i=o*(e-s)+a):ao(this.slope,Math.PI)||ao(this.slope,0)?(i=this.point.y,e=(i-u)/r+l):ao(t.slope,Math.PI)||ao(t.slope,0)?(i=t.point.y,e=(i-a)/o+s):(e=(r*l-u+a-o*s)/(r-o),i=o*(e-s)+a),{x:e,y:i}}}var GC=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};function fp(){return Date.now().toString(32)+Math.random().toString(32).substring(2)}const Ra="__delay_resolve_result__";function Sc(n,t){return GC(this,void 0,void 0,function*(){const e=yield Promise.race([n(),(i=t,new Promise(r=>{setTimeout(()=>{r(Ra)},i)}))]);var i;return e===Ra?Ra:e})}var a_=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};function Ow(n,t){return a_(this,void 0,void 0,function*(){const e=yield Sc(()=>fetch(n),t);if(e===Ra)throw new Sn(ur.ResourceError,`"${n}" loaded timeout"`);if(!e.ok)throw new Sn(ur.ResourceError,`"${n}" loaded failed with status "${e.status}"`);return e})}class HC{constructor(t,e,i,r,o){this.timeout=15e3,this.useCache=!1,this.taskId="",this.delegate=null,this.useCache=e,this.localStorage=t,this.logger=i,this.timeout=r,this.delegate=o||null}attachTaskId(t){this.taskId=t}fetchJson(t){return a_(this,void 0,void 0,function*(){let e;if(this.useCache&&(this.logger.info("load resource from cache. "+t,this.taskId||""),e=yield this.localStorage.getItem(t)),e)return this.logger.info("cache hit. "+t,this.taskId||""),e;{let i;if(this.delegate){this.logger.info("load resource by delegate. "+t,this.taskId||"");const r=yield Sc(()=>this.delegate.loadJson(t),this.timeout);if(r===Ra)throw new Sn(ur.ResourceError,`"${t}" loaded timeout"`);i=JSON.parse(r)}else this.logger.info("load resource from server. "+t,this.taskId||""),i=yield(yield Ow(""+t,this.timeout)).json();return this.logger.info("load end. "+t,this.taskId||""),this.useCache&&this.localStorage.setItem(t,i).catch(()=>{}),i}})}fetchPng(t){return a_(this,void 0,void 0,function*(){let e;if(this.useCache&&(this.logger.info("load resource from cache. "+t,this.taskId||""),e=yield this.localStorage.getItem(t)),e)return this.logger.info("cache hit. "+t,this.taskId||""),e;{let i;if(this.delegate){if(this.logger.info("load resource by delegate. "+t,this.taskId||""),i=yield Sc(()=>this.delegate.loadImage(t),this.timeout),i===Ra)throw new Sn(ur.ResourceError,`"${t}" loaded timeout"`)}else this.logger.info("load resource from server. "+t,this.taskId||""),i=yield(yield Ow(t,this.timeout)).blob();return e=yield function(r){return new Promise((o,s)=>{const a=new FileReader;a.onload=()=>{o(a.result)},a.onerror=()=>{s(new Sn(ur.ResourceError,"Failed parse blob data."))},a.readAsDataURL(r)})}(i),this.logger.info("load end. "+t,this.taskId||""),this.useCache&&this.localStorage.setItem(t,e).catch(()=>{}),e}})}destroy(){}}var zC=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};class jC{constructor(t){this.isPaused=!1,this.timestamp=0,this.callbackList=[],this.onTimeUpdate=e=>{const i=e/(We.TARGET_FPMS||.06);if(!this.isPaused){this.timestamp+=i,this.callbackList=this.callbackList.filter(o=>o&&!o.applied);let{length:r}=this.callbackList;for(let o=0;o<r;o++){const s=this.callbackList[o];if(s&&!s.applied){if(!(s.triggerTime<=this.timestamp))break;s.running=!0,s.fn(),s.applied=!0,r=this.callbackList.length}}}},this.ticker=t,this.ticker.add(this.onTimeUpdate)}setTimeout(t,e){const i=fp(),r=this.timestamp+Math.max(e||16,16);return this.callbackList.push({fn:t,triggerTime:r,id:i,applied:!1,running:!1}),this.callbackList.sort((o,s)=>o.triggerTime-s.triggerTime),i}clearTimeout(t){const e=this.callbackList.findIndex(i=>i.id===t);e>=0&&!this.callbackList[e].running&&this.callbackList.splice(e,1)}delay(t){return new Promise(e=>{this.setTimeout(e,t)})}waitUntil(t,e){return zC(this,void 0,void 0,function*(){const i=this.timestamp;for(;!t()&&this.timestamp-i<e;)yield this.delay(50)})}pause(){this.isPaused=!0}resume(){this.isPaused=!1}}var VC=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};function rg(n,t,e){return e?Math.floor(parseFloat(n)*t):Math.ceil(parseFloat(n)*t)}const og={w:!0,h:!0,x:!1,y:!1};class WC{constructor(t){this.gifs=Object.create(null),this.textures=Object.create(null),this.frames=Object.create(null),this.spriteSheets=[],this.loader=t}getTexture(t){return this.textures[t]||null}getFrameData(t){return this.frames[t]}getGifFrames(t){return this.gifs[t]?this.gifs[t].filter(e=>!!e):[]}loadSpriteSheetItem(t,e,i,r){return VC(this,void 0,void 0,function*(){const o=yield this.loader.fetchJson(`${t}/${e}/jsonOutput/${i}.json`),s=yield this.loader.fetchPng(`${t}/${e}/jsonOutput/${i}.png`),a=document.createElement("img");a.src=s,yield new Promise((y,w)=>{a.onload=()=>y(""),a.onerror=()=>w()});let l=r;const u=a.width||1,h=a.height||1;if(u>2048||h>2048){l*=2048/u;const y=l*h;y>2048&&(l*=h/y)}(function(y,w){y.meta&&y.meta.size&&["w","h"].forEach(A=>{y.meta.size[A]=rg(y.meta.size[A],w,og[A])}),y.frames&&Object.keys(y.frames).forEach(A=>{y.frames[A].frame&&["x","y","w","h"].forEach(I=>{y.frames[A].frame[I]=rg(y.frames[A].frame[I],w,og[I])}),y.frames[A].spriteSourceSize&&["x","y","w","h"].forEach(I=>{y.frames[A].spriteSourceSize[I]=rg(y.frames[A].spriteSourceSize[I],w,og[I])}),y.frames[A].sourceSize&&["w","h"].forEach(I=>{y.frames[A].sourceSize[I]=rg(y.frames[A].sourceSize[I],w,og[I])})})})(o,l);const d=document.createElement("canvas"),p=Math.ceil(a.width*l),m=Math.ceil(a.height*l);d.width=p,d.height=m,d.getContext("2d").drawImage(a,0,0,p,m);const g=new Mi(d,{resolution:1}),_=new P1(g,o);yield new Promise(y=>{_.parse(()=>y(""))}),this.spriteSheets.push(_),Object.keys(_.textures).forEach(y=>{const w=y.match(/^(.+)_gif_(\d+)$/);if(w&&w[1]&&w[2]){const A=w[1];this.gifs[A]||(this.gifs[A]=[]);const I=parseInt(w[2],10);this.gifs[A][I]=_.textures[y]}else this.frames[y]=o.frames[y],this.textures[y]=_.textures[y]})})}destroy(){this.spriteSheets.forEach(t=>t.destroy(!0)),this.spriteSheets=[],this.gifs=Object.create(null),this.textures=Object.create(null),this.frames=Object.create(null)}}var XC=v(2),sg=v.n(XC);function Nw(n,t,e){let i,r;const o=Math.round(n)%360;if(o%180==0)i=Math.cos(o*(Math.PI/180))*t,r=0;else if(o%90==0)i=0,r=Math.sin(o*(Math.PI/180))*e;else{const s=function(a){const l=a*Math.PI/180;return Math.tan(l)}(o);i=t*e/Math.sqrt(Math.pow(e,2)+Math.pow(t*s,2)),(o>90&&o<270||o<-90&&o>-270)&&(i=-i),r=s*i}return{x:i,y:r}}function qC(n,t,e,i,r,o){const s=n,a=t;let l,u,h,d,p;if(Math.round(i)===0)l=r,u=o,p=0;else if(Math.round(i)>=360)l=r,u=o,h=r+2*n*Math.abs(Math.cos(-e/180*Math.PI)),d=o+2*t*Math.sin(-e/180*Math.PI),p=1;else{const m=-e,g=-(e+i),{x:_,y}=Nw(m,s,a),w=r-_,A=o+y,{x:I,y:F}=Nw(g,s,a);l=I+w,u=A-F,p=i>=-360&&i<-180?1:i>=-180&&i<0||i>0&&i<180?0:1}return{radiusX:s,radiusY:a,xAxisRotation:0,largeArcFlag:p,sweepFlag:i>0?1:0,endX:l,endY:u,middleX:h,middleY:d}}class Dw{constructor(){this.pool=[]}getObject(t){const e=this.pool.find(i=>!i.isUsed);if(e)return e.isUsed=!0,e.obj;{const i={obj:this.createObject(),isUsed:!0,group:t};return this.pool.push(i),i.obj}}collectObject(t){const e=this.pool.find(i=>i.obj===t);e&&(e.isUsed=!1,this.resetObject(e.obj))}collectObjectByGroup(t){this.pool.filter(e=>e.group===t).forEach(e=>this.collectObject(e.obj))}}const l_=new class extends Dw{createObject(){const n=document.createElementNS("http://www.w3.org/2000/svg","svg");return n.setAttribute("xmlns","http://www.w3.org/2000/svg"),n.setAttribute("version","1.1"),n}resetObject(n){n.removeAttribute("viewBox"),n.removeAttribute("width"),n.removeAttribute("height"),n.innerHTML=""}},u_=new class extends Dw{createObject(){return document.createElement("img")}resetObject(n){n.removeAttribute("src")}};var YC=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};class $C{constructor(){this.imgElements=[],this.svgElements=[],this.idToHashMap=Object.create(null),this.textures=Object.create(null),this.graphics=[],this.hashToIdMap=Object.create(null)}render(t,e,i){return YC(this,void 0,void 0,function*(){const{items:r,width:o,height:s}=t,a=u_.getObject(i),l=new Mi(a,{width:o,height:s,resolution:1}),u=l_.getObject(i);this.imgElements.push(a),this.svgElements.push(u),u.setAttribute("viewBox",`0 0 ${o} ${s}`),u.setAttribute("width",""+o),u.setAttribute("height",""+s);const h={},d={};r.forEach(g=>{const{item:_,x:y,y:w}=g,A=y+2,I=w+2;_.pathsData.forEach(U=>{let B="";U.cmds.forEach(([G,ct])=>{B+=G+" ",B+=ct.map(it=>(Object(V.isNumber)(it)||(it.x=it.x+U.offset.x+A,it.y=it.y+U.offset.y+I),it)).reduce((it,tt)=>(Object(V.isNumber)(tt)?it+=tt+" ":it+=`${tt.x} ${tt.y} `,it),""),B+=" "}),U.pathElement.setAttribute("d",B),u.appendChild(U.pathElement)});const F=_.width-4-2*_.padding,N=_.height-4-2*_.padding;this.textures[_.hash]={texture:new Qe(l,new bi(A+2,I+2,F,N)),pivot:_.pivot},h[_.hash]={x:A+2,y:I+2,w:F,h:N,pivot:_.pivot},d[_.hash]=this.hashToIdMap[_.hash]});const p=(m='<?xml version="1.0" encoding="utf-8"?>'+u.outerHTML,"data:image/svg+xml,"+encodeURIComponent(m).replace(/'/g,"%27").replace(/"/g,"%22"));var m;a.src=p,yield new Promise((g,_)=>{a.onload=()=>g(""),a.onerror=()=>_()})})}getGraphicsData(t){const e=this.idToHashMap[t]||"";return this.textures[e]||null}addGraphics(t,e,i,r,o,s,a,l,u,h,d){var p,m;if(!a&&!u)return t;const g=sg()(i+((m=(p=a==null?void 0:a.width)===null||p===void 0?void 0:p.toString())!==null&&m!==void 0?m:0)+u+h+d);if(this.hashToIdMap[g]||(this.hashToIdMap[g]=[]),this.hashToIdMap[g].push(t),this.idToHashMap[t]=g,this.graphics.findIndex(_=>_.hash===g)<0){const{graphicsWidth:_,graphicsHeight:y,pathsData:w,pivot:A,padding:I}=function(F,N,U,B,G,ct,it,tt,rt){var et;const pt=[],kt={x:Math.abs(G.x),y:Math.abs(G.y)};let Lt=0,_t=0,xt=0,jt=0,ee=0,le="none";const nt=(et=B==null?void 0:B.width)!==null&&et!==void 0?et:0;return it?(Lt=N,_t=U,ee=0):(le=rt||"#ff0000",ee=nt,xt=.5*nt,jt=.5*nt,Lt=N+nt,_t=U+nt,kt.x+=.5*nt,kt.y+=.5*nt),Lt+=Math.abs(G.x),_t+=Math.abs(G.y),xt+=Math.abs(G.x),jt+=Math.abs(G.y),Lt+=4,_t+=4,xt+=2,jt+=2,Lt=Math.ceil(Lt),_t=Math.ceil(_t),F.forEach(lt=>{const Xt=document.createElementNS("http://www.w3.org/2000/svg","path");lt.fill!=="none"&&it?Xt.setAttribute("fill",tt||"#ff0000"):Xt.setAttribute("fill","none"),lt.hasStroke&&!it&&(Xt.setAttribute("stroke-linecap",(B==null?void 0:B.cap)||"butt"),Xt.setAttribute("stroke-linejoin",(B==null?void 0:B.join)||"miter"),Xt.setAttribute("stroke-width",ee.toString()),Xt.setAttribute("stroke",le),B!=null&&B.dash&&Xt.setAttribute("stroke-dasharray",B.dash));const{scale:Ut}=lt,Bt=lt.path.trim().split(" ");let ue={x:0,y:0};const he={offset:{x:xt,y:jt},cmds:[],pathElement:Xt};for(let Vt=0;Vt<Bt.length;Vt+=2){const Q=Bt[Vt],gt=Bt[Vt+1];if(Q==="M"){let[Dt,Ft]=gt.split(",").map(St=>Number(St));ue={x:Dt,y:Ft},Dt=Dt/9525*Ut.x,Ft=Ft/9525*Ut.y,he.cmds.push(["M",[{x:Dt,y:Ft}]])}else if(Q==="A"){const[Dt,Ft,St,Yt]=gt.split(",").map(si=>Number(si)),Me=St/Math.PI*180,Re=Yt/Math.PI*180,Ae=qC(Dt,Ft,Me,Re,ue.x,ue.y);Math.round(Re)>=360?(ue={x:Ae.endX,y:Ae.endY},he.cmds.push(["A",[Ae.radiusX/9525*Ut.x,Ae.radiusY/9525*Ut.y,Ae.xAxisRotation,Ae.largeArcFlag,Ae.sweepFlag,{x:Ae.middleX/9525*Ut.x,y:Ae.middleY/9525*Ut.y}]]),he.cmds.push(["A",[Ae.radiusX/9525*Ut.x,Ae.radiusY/9525*Ut.y,Ae.xAxisRotation,Ae.largeArcFlag,Ae.sweepFlag,{x:Ae.endX/9525*Ut.x,y:Ae.endY/9525*Ut.y}]])):(ue={x:Ae.endX,y:Ae.endY},he.cmds.push(["A",[Ae.radiusX/9525*Ut.x,Ae.radiusY/9525*Ut.y,Ae.xAxisRotation,Ae.largeArcFlag,Ae.sweepFlag,{x:Ae.endX/9525*Ut.x,y:Ae.endY/9525*Ut.y}]]))}else if(Q==="L"){let[Dt,Ft]=gt.split(",").map(St=>Number(St));ue={x:Dt,y:Ft},Dt=Dt/9525*Ut.x,Ft=Ft/9525*Ut.y,he.cmds.push(["L",[{x:Dt,y:Ft}]])}else if(Q==="QB"){let[Dt,Ft,St,Yt]=gt.split(",").map(Me=>Number(Me));ue={x:St,y:Yt},Dt=Dt/9525*Ut.x,Ft=Ft/9525*Ut.y,St=St/9525*Ut.x,Yt=Yt/9525*Ut.y,he.cmds.push(["Q",[{x:Dt,y:Ft},{x:St,y:Yt}]])}else if(Q==="CB"){let[Dt,Ft,St,Yt,Me,Re]=gt.split(",").map(Ae=>Number(Ae));ue={x:Me,y:Re},Dt=Dt/9525*Ut.x,Ft=Ft/9525*Ut.y,St=St/9525*Ut.x,Yt=Yt/9525*Ut.y,Me=Me/9525*Ut.x,Re=Re/9525*Ut.y,he.cmds.push(["C",[{x:Dt,y:Ft},{x:St,y:Yt},{x:Me,y:Re}]])}else Q==="C"&&he.cmds.push(["Z",[]])}pt.push(he)}),{graphicsWidth:Lt,graphicsHeight:_t,pivot:kt,padding:2,pathsData:pt}}(e,o,s,a,r,0,u,h,d);this.graphics.push({hash:g,pathsData:w,pivot:A,width:_,height:y,padding:I})}return t}pack(){return this.graphics.forEach(t=>{t.width+=4,t.height+=4}),function t(e){const i=[],r=e.filter(h=>{const d=h.width<2048&&h.height<2048;return d||i.push(h),d}).sort((h,d)=>h.width*h.height-d.width*d.height);let o=r.length+1,s=2050,a=2050;const l=[];let u=null;for(;(s>2048||a>2048)&&r.length>0;)o-=1,u=Lw()(r.slice(0,o)),s=u.width,a=u.height;return u&&l.push(u),i.forEach(h=>{const d=Lw()([h]);l.push(d)}),o<r.length?l.concat(t(r.slice(o))):l}(this.graphics)}destroy(){Object.keys(this.textures).forEach(t=>{var e;(e=this.textures[t])===null||e===void 0||e.texture.destroy(!0)}),this.textures=Object.create(null),this.imgElements.forEach(t=>u_.collectObject(t)),this.svgElements.forEach(t=>l_.collectObject(t)),this.graphics=[]}}class JC{constructor(){this.runningTimeNodes={}}addRunningTimeNode(t,e,i){const r=`${e}_${t}`;if(this.runningTimeNodes[r])try{this.runningTimeNodes[r].dispose(!0)}catch{}this.runningTimeNodes[r]=i}removeRunningTimeNode(t,e){const i=`${e}_${t}`;delete this.runningTimeNodes[i]}}class ZC{constructor(t){this.eventHub=t,this.targets=Object.create(null)}getTargets(){return Object.keys(this.targets).map(t=>this.targets[t])}addTarget(t,e){this.targets[t]=e}getTargetById(t){return this.targets[t]}getTarget(t,e,i={type:"el",index:0,id:""}){var r,o;let s=this.targets[t.id];return t.type!=="shape"?s:(t.type==="shape"&&t.txEl&&(s=(r=s==null?void 0:s.getTextElement(t.txEl.type,t.txEl.range))!==null&&r!==void 0?r:null),t.type==="shape"&&t.bg&&i.index===0&&(e=!1,s=(o=s==null?void 0:s.getBgElement())!==null&&o!==void 0?o:null,this.eventHub.emit("IterateTimeNodeEnd",i.id)),e&&s?s.getIterateEntry(i.type,i.index,i.id):(s||this.eventHub.emit("IterateTimeNodeEnd",i.id),s))}clearTargets(){this.targets=Object.create(null)}}class KC{constructor(t){this.target=t}get color(){return this.target.strokeColorFilter.currentColor}set color(t){this.target.strokeColorFilter.color=t}get on(){return this.target.strokeActive?"true":"false"}set on(t){this.target.strokeActive=t==="true"}}class QC{constructor(t){this.target=t}applyCommand(t,e){this.target.applyCommand(t,e)}}class Fw{constructor(t){this.target=t}get color(){return this.target.fillColorFilter.currentColor}set color(t){this.target.fillActive&&(this.target.fillColorFilter.color=t)}get on(){return this.target.fillActive?"true":"false"}set on(t){this.target.fillActive=t==="true"}get designColor(){return this.target.fillColorFilter.designColor}}class tP{constructor(t,e){this.hardHidden=!1,this.target=t,e===!0&&(this.hardHidden=!0)}get opacity(){return this.target.alpha}set opacity(t){this.target.alpha=t}get rotation(){return this.target.rotation/Math.PI*180}set rotation(t){this.target.rotation=t/180*Math.PI}get visibility(){return this.target.visible?"visible":"hidden"}set visibility(t){this.visibility===t||this.hardHidden||(this.target.visible=t==="visible")}}class eP{constructor(t,e){this.actions=[],this.ctx=e,this.object=t,this.object.interactive=!0}reset(t){this.object.interactive=!1,this.object.removeAllListeners(),this.object=t,this.object.interactive=!0}addAction(t,e){this.actions.push([t,e]),e==="click"?(this.object.addListener("click",()=>this.handleAction(t)),this.object.cursor="pointer"):e==="hover"&&this.object.addListener("mouseover",()=>this.handleAction(t))}addProxy(t){this.proxy=t,this.hitArea=this.getOriginHitArea(),this.proxy.interactive=!0,this.actions.forEach(([e,i])=>{var r,o;i==="click"?(r=this.proxy)===null||r===void 0||r.addListener("click",s=>this.handleProxyAction(s,e)):i==="hover"&&((o=this.proxy)===null||o===void 0||o.addListener("mouseover",s=>this.handleProxyAction(s,e)))})}handleProxyAction(t,e){var i;const r=t.data.global,o=this.object.getGlobalPosition(),s=r.x-o.x+this.object.pivot.x,a=r.y-o.y+this.object.pivot.y;((i=this.hitArea)===null||i===void 0?void 0:i.contains(s,a))&&this.object.visible&&this.handleAction(e,!0)}getOriginHitArea(){return this.object.hitArea?this.object.hitArea:new M0(0,0,this.object.width,this.object.height)}handleAction(t,e=!1){this.proxy&&!e||(this.ctx.eventHub.emit(Ne.hyperlinkTrigger,t),this.execAction(t))}execAction(t){var e;if(this.ctx.eventHub.emit(Ne.userInput),t.action==="ppaction://hlinksldjump"){const i=((e=t==null?void 0:t.target)!==null&&e!==void 0?e:"").match(/slide(\d+)\.xml/);i&&i[1]&&this.ctx.eventHub.emit(Ne.requestGotoSlide,Number(i[1]))}else if(t.action==="ppaction://hlinkshowjump?jump=nextslide")this.ctx.eventHub.emit(Ne.requestNextSlide);else if(t.action==="ppaction://hlinkshowjump?jump=previousslide")this.ctx.eventHub.emit(Ne.requestPrevSlide);else if(t.action==="ppaction://hlinkshowjump?jump=firstslide")this.ctx.eventHub.emit(Ne.requestGotoSlide,1);else if(t.action==="ppaction://hlinkshowjump?jump=lastslide")this.ctx.eventHub.emit(Ne.requestGotoSlide,-1);else if(t.action==="ppaction://hlinkshowjump?jump=lastslideviewed"){const i=this.ctx.lastViewedIndex;this.ctx.eventHub.emit(Ne.requestGotoSlide,i)}else t.action==="ppaction://hlinkshowjump?jump=endshow"&&this.ctx.eventHub.emit(Ne.requestGotoSlide,-1)}}class h_{constructor(t,e,i){var r,o,s,a,l,u;this.scaleExt={x:1,y:1},this.scaleOrigin={x:1,y:1},this.designScale={x:1,y:1},this.bound=new bi(0,0,1,1),this.pptX=0,this.pptY=0,this.presetSubType=0,this.designWidth=0,this.designHeight=0,this.designX=0,this.designY=0,this.hasPreset=!1,this.container=new ar,this.ctx=e,this.style=new tP(this.container,t.hardHidden),this.designGlobalPosition={x:i.x+((o=(r=t.position)===null||r===void 0?void 0:r.x)!==null&&o!==void 0?o:0),y:i.y+((a=(s=t.position)===null||s===void 0?void 0:s.y)!==null&&a!==void 0?a:0)},this.container.interactive=!0,(t.hlinkClick||t.hlinkHover)&&(this.hyperlink=new eP(this.container,this.ctx),t.hlinkHover&&((l=this.hyperlink)===null||l===void 0||l.addAction(t.hlinkHover,"hover")),t.hlinkClick&&((u=this.hyperlink)===null||u===void 0||u.addAction(t.hlinkClick,"click"))),this.ctx.clock.waitUntil(()=>{try{return!!this.container.width}catch{return!1}},3e3).then(()=>{try{this.designWidth=this.designWidth||this.container.width}catch{}}),this.ctx.clock.waitUntil(()=>{try{return!!this.container.height}catch{return!1}},3e3).then(()=>{try{this.designHeight=this.designHeight||this.container.height}catch{}})}updateScale(){this.container&&(this.container.scale.x=this.designScale.x*this.scaleExt.x*this.scaleOrigin.x,this.container.scale.y=this.designScale.y*this.scaleExt.y*this.scaleOrigin.y)}updateTransform(t){var e,i,r,o,s,a,l,u;this.designWidth=t.width,this.designHeight=t.height,this.designX=(i=(e=t.position)===null||e===void 0?void 0:e.x)!==null&&i!==void 0?i:0,this.designY=(o=(r=t.position)===null||r===void 0?void 0:r.y)!==null&&o!==void 0?o:0;const h=this.designWidth/2,d=this.designHeight/2;this.container.width=this.designWidth,this.container.height=this.designHeight,this.container.pivot.x=h,this.container.pivot.y=d;const p=(a=(s=t.position)===null||s===void 0?void 0:s.x)!==null&&a!==void 0?a:0,m=(u=(l=t.position)===null||l===void 0?void 0:l.y)!==null&&u!==void 0?u:0;this.container.x=p+h,this.container.y=m+d,t.scale&&(this.designScale={x:t.scale.x,y:t.scale.y},this.container.scale.x=t.scale.x,this.container.scale.y=t.scale.y),t.rotation&&(this.container.rotation=t.rotation);const g=new Ns;g.drawRect(0,0,this.designWidth,this.designHeight),this.container.addChild(g),this.json.hardHidden&&(this.container.visible=!1),this.bound.x=p,this.bound.y=m,this.bound.width=this.designWidth,this.bound.height=this.designHeight}get scale(){return this.scaleOrigin}set scale(t){this.scaleOrigin.x=t.x,this.scaleOrigin.y=t.y,this.updateScale()}get design_ppt_w(){return wc(this.designWidth/this.ctx.stageWidth)}get design_ppt_h(){return wc((this.designHeight||this.container.height)/this.ctx.stageHeight)}get design_ppt_x(){return wc(this.designX/this.ctx.stageWidth)}get design_ppt_y(){return wc(this.designY/this.ctx.stageHeight)}get ppt_w(){return this.scaleExt.x*this.scaleOrigin.x*this.designWidth/this.ctx.stageWidth}set ppt_w(t){this.designWidth&&(this.scaleExt.x=t*this.ctx.stageWidth/this.designWidth,this.updateScale())}get ppt_h(){const t=this.designHeight||this.container.height;return this.scaleExt.y*this.scaleOrigin.y*t/this.ctx.stageHeight}set ppt_h(t){this.designHeight&&(this.scaleExt.y=t*this.ctx.stageHeight/this.designHeight,this.updateScale())}get ppt_x(){return(this.container.position.x-this.container.pivot.x)/this.ctx.stageWidth}set ppt_x(t){this.pptX=t;const e=this.presetSubType===544?this.scaleExt.x:1;this.container.position.x=t*this.ctx.stageWidth+this.container.pivot.x*e}get ppt_y(){return(this.container.position.y-this.container.pivot.y)/this.ctx.stageHeight}set ppt_y(t){this.pptY=t;const e=this.presetSubType===544?this.scaleExt.y:1;this.container.position.y=t*this.ctx.stageHeight+this.container.pivot.y*e}get r(){return this.container.rotation}set r(t){this.container.rotation=t}set xshear(t){this.container.skew.x=t}get xshear(){return this.container.skew.x}set yshear(t){this.container.skew.y=t}get yshear(){return this.container.skew.y}}class ag{constructor(t){if(this._isInit=!1,this.h=0,this.s=0,this.l=0,this.a=1,t){this._isInit=!0;const e=t.match(/-?[0-9]+/g);e&&(this.h=parseInt(e[0],10),this.s=parseInt(e[1],10)/100,this.l=parseInt(e[2],10)/100)}}isInit(){return this._isInit}by(t,e){e.h=Math.max(Math.min(this.h+t.h,359),0),e.s=Math.max(Math.min(this.s+t.s,1),0),e.l=Math.max(Math.min(this.l+t.l,1),0),e.a=Math.max(Math.min(this.a+t.a,1),0)}fromHexString(t){const[e,i,r,o]=Ds(t);let s=0,a=0,l=0;const u=Math.max(e,i,r),h=Math.min(e,i,r),d=u-h;l=(u+h)/2,d===0?s=0:u===e?s=(i-r)/d%6*60:u===i?s=60*((r-e)/d+2):u===r&&(s=60*((e-i)/d+4)),a=d===0?0:d/(1-Math.abs(2*l-1)),this.h=s,this.s=a,this.l=l,this.a=o}interpolationFrom(t,e,i){const r=t.h+(this.h-t.h)*e,o=t.s+(this.s-t.s)*e,s=t.l+(this.l-t.l)*e,a=t.a+(this.a-t.a)*e;i.h=Math.max(Math.min(r,359),0),i.s=Math.max(Math.min(o,1),0),i.l=Math.max(Math.min(s,1),0),i.a=Math.max(Math.min(a,1),0)}toHexString(){let t=[0,0,0,0];const{h:e,s:i,l:r}=this;if(e<360&&e>=0&&i<=1&&i>=0&&r<=1&&r>=0){let o,s,a;const l=(1-Math.abs(2*r-1))*i,u=l*(1-Math.abs(e/60%2-1)),h=r-l/2;[o,s,a]=e>=0&&e<60?[l,u,0]:e>=60&&e<120?[u,l,0]:e>=120&&e<180?[0,l,u]:e>=180&&e<240?[0,u,l]:e>=240&&e<300?[u,0,l]:[l,0,u],t=[o+h,s+h,a+h,this.a]}return kw(t)}}class lg{constructor(t){this._isInit=!1,this.r=0,this.g=0,this.b=0,this.a=0,t&&(this._isInit=!0,this.fromHexString(t))}fromHexString(t){const[e,i,r,o]=Ds(t);this.r=e,this.g=i,this.b=r,this.a=o}isInit(){return this._isInit}interpolationFrom(t,e,i){i.r=t.r+(this.r-t.r)*e,i.g=t.g+(this.g-t.g)*e,i.b=t.b+(this.b-t.b)*e,i.a=t.a+(this.a-t.a)*e}by(t,e){e.r=Math.min(Math.max(this.r+t.r,0),255),e.g=Math.min(Math.max(this.g+t.g,0),255),e.b=Math.min(Math.max(this.b+t.b,0),255),e.a=Math.min(Math.max(this.a+t.a,0),1)}toHexString(){return kw([this.r,this.g,this.b,this.a])}}function Bw(n){const t=n.substring(1);return[parseInt(t.substring(0,6),16),parseInt(t.substring(6,8),16)/255]}function Ds(n){return(n=n.replace(/^#/,"")).substring(6,8).length===0&&(n+="FF"),[parseInt(n.substring(0,2).padStart(8,"0"),16)/255,parseInt(n.substring(2,4).padStart(8,"0"),16)/255,parseInt(n.substring(4,6).padStart(8,"0"),16)/255,parseInt(n.substring(6,8).padStart(8,"0"),16)/255]}function kw(n){return"#"+Math.round(255*n[0]).toString(16).padStart(2,"0")+Math.round(255*n[1]).toString(16).padStart(2,"0")+Math.round(255*n[2]).toString(16).padStart(2,"0")+Math.round(255*n[3]).toString(16).padStart(2,"0")}function mp(n,t,e){const i=Ds(n),r=Ds(t),o=Math.round(255*(i[0]+(r[0]-i[0])*e)),s=Math.round(255*(i[1]+(r[1]-i[1])*e)),a=Math.round(255*(i[2]+(r[2]-i[2])*e)),l=Math.round(255*(i[3]+(r[3]-i[3])*e));return"#"+o.toString(16).padStart(2,"0")+s.toString(16).padStart(2,"0")+a.toString(16).padStart(2,"0")+l.toString(16).padStart(2,"0")}class gp extends Nr{constructor(){super(void 0,`
|
|
6168
6168
|
varying vec2 vTextureCoord;
|
|
6169
6169
|
|
|
6170
6170
|
uniform vec4 color;
|
|
@@ -6331,7 +6331,7 @@ void main(void){
|
|
|
6331
6331
|
vec4 texColor = texture2D(uSampler, vTextureCoord);
|
|
6332
6332
|
gl_FragColor = transform(texColor, arg1, arg2);
|
|
6333
6333
|
}
|
|
6334
|
-
`),{arg1:e,arg2:i})}}class Ca{constructor(t,e,i,r,o){this.ctx=t,this.fillStyle=e,this.width=i,this.height=r,this.config=o,this.clonedObjects=[],this._displayObject=null}get displayObject(){return this._displayObject||(this._displayObject=this.createDisplayObject()),this._displayObject}set displayObject(t){this._displayObject&&this._displayObject.destroy({children:!0,texture:!0}),this._displayObject=t}get hasFill(){return!!this.fillStyle&&this.fillStyle.fillType!=="noFill"}createDisplayObject(){var t;if(!this.fillStyle)return null;if(this.config.useSlideBackgroundFill&&this.ctx.bgTexture){const e=new xr;return e.texture=this.ctx.bgTexture,e}if(this.fillStyle.fillType==="solidFill"||this.fillStyle.fillType==="noFill")return null;if(this.fillStyle.fillType==="gradientFill")return uP(this.fillStyle,this.width,this.height);if(this.fillStyle.fillType==="blipFill"){const{src:e,filters:i}=this.fillStyle,r=this.ctx.spriteTexture.getTexture(e),o=this.ctx.spriteTexture.getFrameData(e);if(r){const s=new xr;if(s.texture=r,i.length>0&&this.config.useFilter&&(s.filters=function(a){const l=[];return a.forEach(u=>{if(u.type==="biLevel")l.push(new Yw("biLevel",u.args[0]));else if(u.type==="clrChange"||u.type==="changeBulletColor"){const h=Ds(u.args[0]),d=Ds(u.args[1]);l.push(new fP(u.type,h,d))}else u.type==="alphaModFix"?l.push(new Yw(u.type,u.args[0])):u.type==="lum"&&l.push(new vP(u.type,u.args[0],u.args[1]))}),l}(i)),this.config.fillFloat){const{l:a,t:l,r:u,b:h}=this.config.fillFloat.fillRect,d=this.width*(1-a-u),p=this.height*(1-l-h),m=(t=this.config.shapeRotation)!==null&&t!==void 0?t:0,g=new Ns;g.drawRect(0,0,d,p),g.pivot.x=d/2,g.pivot.y=p/2,g.rotation=m;const _=g.getBounds(),y=_.width,w=_.height;s.width=y,s.height=w,s.anchor.x=.5,s.anchor.y=.5,s.rotation=-1*m,s.name="math-texture",m===0?(s.position.x=y/2+a*this.width,s.position.y=w/2+l*this.width):(s.position.x=this.width/2,s.position.y=this.height/2)}else s.width=this.width,s.height=this.height,o.rotate&&(s.position.x=this.width/2,s.position.y=this.height/2,s.anchor.x=.5,s.anchor.y=.5,s.rotation=o.rotate/180*Math.PI);return s}}else if(this.fillStyle.fillType==="gifFill"){const{src:e,delays:i}=this.fillStyle,r=this.ctx.spriteTexture.getGifFrames(e).map((l,u)=>({texture:l,time:i[u]||20})),o=new s_(r,!0);o.width=this.width,o.height=this.height;const s=this.fillStyle.loop;let a=1;return o.onLoop=()=>{a+=1,s>0&&a>s&&o.gotoAndStop(o.totalFrames)},o}return null}isSolidFill(){var t;return((t=this.fillStyle)===null||t===void 0?void 0:t.fillType)==="solidFill"}getSolidFillColor(){var t;return((t=this.fillStyle)===null||t===void 0?void 0:t.fillType)==="solidFill"?this.fillStyle.color:"#000000"}getClonedDisplayObject(){const t=this.createDisplayObject();return this.clonedObjects.push(t),t}destroy(){var t;(t=this._displayObject)===null||t===void 0||t.destroy(),this._displayObject=null,this.clonedObjects.forEach(e=>{e==null||e.destroy()}),this.clonedObjects=[]}}var _P=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};class yP extends c_{constructor(t,e,i){var r;super(t,e,i),this.textureContainer=new ar,this.underline=null,this.cacheSprite=new xr;const{shapeId:o,paragraphIndex:s,lineIndex:a,unitIndex:l,lineHeight:u,width:h,underLine:d,fill:p,height:m,isHorz:g,lineWidth:_}=t,y=((r=p==null?void 0:p.fill)===null||r===void 0?void 0:r.fillType)==="solidFill"?p.fill.color:null;if(d){const w=g?u/16:_/16;this.underline=new nP(e,d.type,w,h,m,y,g,o,s,a,l)}this.textGraphics=this.createTextGraphics(),this.textFill=this.createTextFill(),this.strokeGraphics=this.createStrokeGraphics(),this.strokeFill=this.createStrokeFill()}createStrokeFill(){const{stroke:t,lineWidth:e,lineHeight:i}=this.json;return new Ca(this.ctx,t==null?void 0:t.fill,e,i,{useFilter:!1,useSlideBackgroundFill:!1})}createStrokeGraphics(){const{stroke:t}=this.json,e=t!=null&&t.key?{fillType:"blipFill",src:t.key,filters:[]}:void 0;return new Ca(this.ctx,e,(t==null?void 0:t.width)||0,(t==null?void 0:t.height)||0,{useFilter:!1,useSlideBackgroundFill:!1})}createTextFill(){const{isHorz:t,fill:e,lineWidth:i,lineHeight:r,fillLineHeight:o}=this.json;return t?new Ca(this.ctx,e==null?void 0:e.fill,i,Math.max(o,r),{useFilter:!1,useSlideBackgroundFill:!1}):new Ca(this.ctx,e==null?void 0:e.fill,o,r,{useFilter:!1,useSlideBackgroundFill:!1})}createTextGraphics(){var t;const{fill:e,content:i}=this.json;let r="#000000";((t=e==null?void 0:e.fill)===null||t===void 0?void 0:t.fillType)==="solidFill"&&(r=e.fill.color);const o=e!=null&&e.key?{fillType:"blipFill",src:e.key,filters:[{type:"changeBulletColor",args:["#000000",r]}]}:void 0;return new Ca(this.ctx,o,(e==null?void 0:e.width)||0,(e==null?void 0:e.height)||0,{useFilter:i==="\u25FE",useSlideBackgroundFill:!1})}getIterateEntry(){return null}getBgElement(){return null}updateTransform(t){var e,i,r,o;const{isHorz:s}=this.json;t.position={x:s&&(i=(e=t.position)===null||e===void 0?void 0:e.x)!==null&&i!==void 0?i:0,y:s?0:(o=(r=t.position)===null||r===void 0?void 0:r.y)!==null&&o!==void 0?o:0},t.width=s?this.json.width:this.json.lineWidth,t.height=s?this.json.lineHeight:this.json.height,super.updateTransform(t)}preRender(){var t;(t=this.underline)===null||t===void 0||t.preRender()}render(t){t.addSubMTask(()=>_P(this,void 0,void 0,function*(){this.doRender()}),"@TextUnitImpl[doRender]")}doRender(){let t=!1;const{lineWidth:e,lineHeight:i,baseLine:r,isHorz:o,underline:s,height:a,width:l,highlightColor:u,x:h,y:d,content:p,fillLineHeight:m,fill:g}=this.json;let _=this.json.needFill!==!1;if(g&&g.fill&&g.fill.fillType!=="solidFill"&&(_=!0),u){const y=new Ns,[w,A]=Bw(u);y.beginFill(w,A),y.drawRect(0,0,o?l:e,o?i:a),y.endFill(),this.textureContainer.addChild(y)}if(this.textGraphics.displayObject){const y=this.textGraphics.displayObject;if(o&&(y.position.y=d>0?d:0),_){const w=this.textFill.displayObject;if(w)w.mask=y,w.addChild(y),w.position.x=-h,y.position.x+=h,t=!0,this.textureContainer.addChild(w);else if(this.textFill.isSolidFill()){const A=new gp;A.color=this.textFill.getSolidFillColor(),y.filters=[A],t=!0,this.textureContainer.addChild(y)}}else this.textureContainer.addChild(y)}if(this.strokeGraphics.displayObject){const y=this.strokeGraphics.displayObject;if(_){const w=this.strokeFill.displayObject;if(w)w.mask=y,w.addChild(y),o?w.position.y=d>0?d:0:w.position.x=h,this.textureContainer.addChild(w);else if(this.strokeFill.isSolidFill()){o?y.position.y=d>0?d:0:y.position.x=h;const A=new gp;A.color=this.strokeFill.getSolidFillColor(),y.filters=[A],t=!0,this.textureContainer.addChild(y)}}else o?y.position.y=d>0?d:0:y.position.x=h,this.textureContainer.addChild(y)}if(this.underline&&(this.underline.render(),this.underline.sprite)){o?(this.underline.sprite.position.y=s?s-i/16:r,this.underline.sprite.position.x=0):(this.underline.sprite.position.x=0,this.underline.sprite.position.y=0);const y=this.textFill.getClonedDisplayObject();y?(y.mask=this.underline.sprite,y.addChild(this.underline.sprite),this.textureContainer.addChild(y)):this.textureContainer.addChild(this.underline.sprite)}if(t){const y=Ro.create({width:o?l:e,height:o?Math.max(m,i):a,resolution:this.ctx.renderer.resolution});this.ctx.renderer.render(this.textureContainer,{renderTexture:y}),this.cacheSprite.texture=y,o&&d<0&&(this.cacheSprite.position.y=d),this.container.addChild(this.cacheSprite)}else this.container.addChild(this.textureContainer);this.container.name=p}destroy(){this.textFill.destroy(),this.textGraphics.destroy(),this.strokeFill.destroy(),this.strokeGraphics.destroy(),this.cacheSprite.texture.destroy(!0),this.cacheSprite.destroy(),this.textureContainer.destroy(),this.container.destroy()}}var $w=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};class xP extends c_{constructor(){super(...arguments),this.units=[],this.isHorz=!0}getIterateElements(){return this.units}getIterateEntry(t,e,i){return this.units[e]?this.units[e]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",i),null)}preRender(){}createUnits(t,e,i,r){for(let o=0,s=this.json.textUnits.length;o<s;o++)r.addSubMTask(()=>$w(this,void 0,void 0,function*(){const a=this.json.textUnits[o],{height:l,width:u,fillHeight:h,baseline:d,y:p,underline:m}=this.json,g=new yP(Object.assign(Object.assign({},a),{lineHeight:l,lineWidth:u,baseLine:d-p,underline:m,fillLineHeight:h||l,isHorz:this.isHorz,shapeId:t,paragraphIndex:e,lineIndex:i,unitIndex:o}),this.ctx,this.global);g.preRender(),this.units.push(g)}),"@TextLineImpl[createUnits]")}render(t){for(const e of this.units.reverse())e.render(t),t.addSubMTask(()=>$w(this,void 0,void 0,function*(){this.container.addChild(e.container)}),"@TextLineImpl[container.addChild]")}destroy(){this.units.forEach(t=>{t.destroy()}),this.container.destroy({children:!1})}}var Jw=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};class bP extends c_{constructor(){super(...arguments),this.iterateElements=[],this.lines=[],this.isHorz=!0}getIterateElements(){if(this.iterateElements.length>0)return this.iterateElements;const t=this.lines.reduce((e,i)=>e=e.concat(i.getIterateElements()),[]);return this.iterateElements=t,t}getIterateEntry(t,e,i){const r=this.getIterateElements();return r[e]?r[e]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",i),null)}preRender(){}createLines(t,e,i){for(let r=0,o=this.json.lines.length;r<o;r++)i.addSubMTask(()=>Jw(this,void 0,void 0,function*(){const s=this.json.lines[r],a=new xP(s,this.ctx,this.global);a.isHorz=this.isHorz,a.container.name="line-"+r,a.createUnits(t,e,r,i),this.lines.push(a)}),"@TextParagraphImpl[createLines]")}render(t){for(const e of this.lines)e.render(t),t.addSubMTask(()=>Jw(this,void 0,void 0,function*(){this.container.addChild(e.container)}),"@TextParagraphImpl[container.addChild]")}destroy(){this.lines.forEach(t=>{t.destroy()}),this.container.destroy({children:!1})}}var cg=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};class wP{constructor(t,e,i,r){this.iterateElements=[],this.paragraphs=[],this.container=new ar,this.json=t,this.ctx=e,this.parentGlobalPos=r,this.iterateType=i,this.container.name="textBody",this.global={x:this.parentGlobalPos.x+t.position.x,y:this.parentGlobalPos.y+t.position.y},this.container.position.x=t.position.x,this.container.position.y=t.position.y,this.container.scale.x=t.scale.x,this.container.scale.y=t.scale.y;const o=new Ns;o.drawRect(0,0,t.width,t.height),this.container.addChild(o)}get width(){return this.json.width}get height(){return this.json.height}get x(){return this.json.position.x}get y(){return this.json.position.y}getTextElement(t,e){return t==="paragraph"?this.paragraphs[e[0]]:null}getIterateEntry(t,e){return this.iterateElements[t]?this.iterateElements[t]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",e),null)}destroy(){this.paragraphs.forEach(t=>{t.destroy()})}createParagraphs(t,e){for(let i=0,r=this.json.paragraphs.length;i<r;i++)e.addSubMTask(()=>cg(this,void 0,void 0,function*(){var o;const s=this.json.paragraphs[i],a=new bP(s,this.ctx,this.global);a.isHorz=(o=this.json.isHorz)===null||o===void 0||o,a.createLines(t,i,e),e.addSubMTask(()=>cg(this,void 0,void 0,function*(){this.iterateElements=this.iterateElements.concat(a.getIterateElements()),a.container.name="\u6BB5\u843D-"+i,this.paragraphs.push(a)}),"@TextBodyImpl[paragraphs.push]")}),"@TextBodyImpl[createParagraphs]")}render(t){for(const e of this.paragraphs)e.render(t),t.addSubMTask(()=>cg(this,void 0,void 0,function*(){this.container.addChild(e.container)}),"@TextBodyImpl[container.addChild]");t.addSubMTask(()=>cg(this,void 0,void 0,function*(){const{width:e}=this.container;this.container.scale.x<0&&(this.container.x+=-1*e)}),"@TextBodyImpl[reset width]")}}var SP=v(47),TP=v.n(SP),EP=v(48),MP=v.n(EP);const AP={Reflection:class extends Nr{constructor(n){super(TP.a,MP.a,{uShapeFilterArea:new Float32Array([0,0,0,0]),uStartAlpha:n.startAlpha,uEndAlpha:n.endAlpha,uBlur:0}),this.json=n}}};class RP{constructor(t){this.scaleX=1,this.scaleY=1,this.pivot={x:0,y:0},this.paths=[],this.hash="",this.width=0,this.height=0,this.graphicsId="",this.textureId="",this.id=t.id,this.type=t.type,this.heightSize=t.heightSize,this.widthSize=t.widthSize,this.fillStyle=t.fillStyle||{fillType:"solidFill",color:"#ffffffff"},this.lineWidth=t.lineWidth||1,this.position=t.position||{x:0,y:0},this.rotate=t.rotation||1,this.path=this.getUnitPath(),this.setScaleFromLineWidth(),this.setScaleFromSize(),this.generatePaths(),this.setPivot()}setPivot(){switch(this.type){case"oval":case"diamond":this.pivot={x:this.width/2,y:this.height/2};break;case"triangle":this.pivot={x:.7*this.width,y:this.height/2};break;case"arrow":case"stealth":default:this.pivot={x:this.width,y:this.height/2}}}generatePaths(){this.hash="arrow-"+sg()(this.path+this.scaleX+this.scaleY),this.paths=[{id:this.id,path:this.path,fill:"norm",hasStroke:!1,hash:this.hash,scale:{x:this.scaleX,y:this.scaleY}}]}getUnitPath(){switch(this.type){case"stealth":return"M 0,0 L 95250,47625 L 0,95250 L 28575,47625 C C";case"oval":return"M 0,47625 A 47625,47625,-3.14159265,6.2831853 C C";case"diamond":return"M 47625,0 L 95250,47625 L 47625,95250 L 0,47625 C C";case"arrow":return"M 9525,0 L 95250,47625 L 9525,95250 L 0,85725 L 68389.5,47625 L 0,9525 C C";case"triangle":return"M 0,0 L 95250,47625 L 0,95250 C C";default:return""}}setScaleFromLineWidth(){switch(this.type){case"stealth":case"oval":case"diamond":case"arrow":case"triangle":this.scaleX*=.29*this.lineWidth+.7,this.scaleY*=.29*this.lineWidth+.7;break;default:throw new Error("can't match any arrow type!")}}setScaleFromSize(){switch(this.type){case"stealth":case"oval":case"diamond":case"arrow":case"triangle":this.scaleX*=1,this.scaleY*=1;break;default:throw new Error("can't match any arrow type!")}switch(this.widthSize){case"sm":this.scaleX*=3/4;break;case"lg":this.scaleX*=1.25;break;case"med":this.scaleX*=1}switch(this.heightSize){case"sm":this.scaleY*=3/4;break;case"lg":this.scaleY*=1.25;break;case"med":this.scaleY*=1}this.width=10*this.scaleX,this.height=10*this.scaleY}}class Zw{constructor(t,e,i,r,o,s,a,l,u,h,d){this.id=t,this.ctx=e,this.paths=i,this.hash=r,this.nept=o,this.width=s,this.height=a,this.lineStyle=l,this.shouldFill=u,this.bgColor=h,this.lnColor=d,this.clonedObjects=[],this._displayObject=null,this.isRectangle=!1,this.isPureRect=!1,this.isColoredPureRect=!1,this.isRectangle=this.rectangleDetect(i),this.isRectangle&&u?this.bgColor?this.isColoredPureRect=!0:this.isPureRect=!0:this.ctx.graphicsTexture.addGraphics(this.id,this.paths,this.hash,this.nept,this.width,this.height,this.lineStyle,this.ctx.objectPoolGroup,this.shouldFill,this.bgColor,this.lnColor)}get displayObject(){return this._displayObject}pointDis(t,e){return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)}rectangleDetect(t){if(t.length!==1)return!1;const e=t[0].path.trim().split(" ");if(e.length!==10)return!1;const i=[],r=[];for(let l=0;l<e.length;l+=2){const u=e[l],h=e[l+1],[d,p]=h.split(",").map(m=>Number(m)/100);i.push(u),r.push({x:d,y:p})}if(i.join("")!=="MLLLC")return!1;for(let l=0;l<3;l++){const u=r[l],h=r[l+1];if(u.x!==h.x&&u.y!==h.y)return!1}const o=r.slice(0,4).reduce((l,u)=>l+u.x,0)/4,s=r.slice(0,4).reduce((l,u)=>l+u.y,0)/4;if(Number.isNaN(o)||Number.isNaN(s))return!1;const a={x:o,y:s};return ao(this.pointDis(a,r[0]),this.pointDis(a,r[1]))&&ao(this.pointDis(a,r[0]),this.pointDis(a,r[2]))&&ao(this.pointDis(a,r[0]),this.pointDis(a,r[3]))&&this.pointDis(a,r[0])===this.pointDis(a,r[1])}createDisplayObject(){if(this.isPureRect){const t=new Ns;return t.beginFill(0,1),t.drawRect(0,0,this.width,this.height),t}if(this.isColoredPureRect&&this.bgColor){const t=new Ns,[e,i]=Bw(this.bgColor);return t.beginFill(e,i),t.drawRect(0,0,this.width,this.height),t}{const t=new xr,e=this.ctx.graphicsTexture.getGraphicsData(this.id);return e?(t.texture=e.texture,t.pivot.x=e.pivot.x,t.pivot.y=e.pivot.y,t):null}}getClonedDisplayObject(){const t=this.createDisplayObject();return this.clonedObjects.push(t),t}render(){this._displayObject=this.createDisplayObject()}isNeedMask(t,e){let i=!1;return this._displayObject&&(i=!(this.isRectangle&&Math.abs(t-this._displayObject.width)<2&&Math.abs(e-this._displayObject.height)<2&&this.shouldFill)),i}addArrows(t){var e;(e=this._displayObject)===null||e===void 0||e.addChild(t)}destroy(){var t;(t=this._displayObject)===null||t===void 0||t.destroy(),this._displayObject=null,this.clonedObjects.forEach(e=>{e==null||e.destroy()}),this.clonedObjects=[]}}var g_=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};const Du={pivot:{x:0,y:0},width:0,height:0};class Kw extends h_{constructor(t,e,i,r){var o;super(t,e,i),this.renderContainer=new ar,this.needCacheAsBitMap=!1,this.backgroundGraphics=null,this.filterAreaJustifies=[],this.strokeGraphics=null,this.arrowList=[],this.fillColorFilter=new gp,this.strokeColorFilter=new gp,this.id="",this.fill=new Fw(this),this.stroke=new KC(this),this.updateFilterArea=()=>{const l=this.renderContainer.getBounds(!1),u=this.filterAreaJustifies.map(m=>m(l)),h=u.map(m=>m.width),d=u.map(m=>m.height),p=new bi(l.x,l.y,Math.max(...h),Math.max(...d));this.renderContainer.filterArea=p,(this.renderContainer.filters||[]).forEach(m=>{m.uniforms.uShapeFilterArea=new Float32Array(4),m.uniforms.uShapeFilterArea[0]=p.x,m.uniforms.uShapeFilterArea[1]=p.y,m.uniforms.uShapeFilterArea[2]=p.width,m.uniforms.uShapeFilterArea[3]=p.height})},this.json=t,this.json.fillStyle&&this.json.fillStyle.fillType==="groupFill"&&r&&(this.json.fillStyle=r),this.id=t.id;const{fillStyle:s,lineStyle:a}=this.json;this.container.name=t.id,this.renderContainer.name=t.id+"-render-container",this.generateArrowList(),this.backgroundFill=this.createBackgroundFill(),this.backgroundGraphics=this.createBackgroundGraphics(),this.strokeFill=this.createStrokeFill(),this.strokeGraphics=this.createStrokeGraphics(),this.ctx.timingTargets.addTarget(this.id,this),(s==null?void 0:s.fillType)==="solidFill"&&(this.fillColorFilter.currentColor=s.color,this.fillColorFilter.designColor=s.color),((o=a==null?void 0:a.fill)===null||o===void 0?void 0:o.fillType)==="solidFill"&&(this.strokeColorFilter.currentColor=a.fill.color,this.strokeColorFilter.designColor=a.fill.color),this.updateTransform(this.json),t.textBody&&(this.text=new wP(t.textBody,this.ctx,t.textBody.iterateType,{x:this.designGlobalPosition.x,y:this.designGlobalPosition.y})),this.container.hitArea=new M0(1,1,this.json.width,this.json.height)}get interactiveContainer(){return this.renderContainer}get strokeActive(){var t,e,i,r,o,s,a;return this.strokeFill.displayObject?((i=(e=(t=this.strokeFill.displayObject)===null||t===void 0?void 0:t.filters)===null||e===void 0?void 0:e.length)!==null&&i!==void 0?i:-1)>0:((a=(s=(o=(r=this.strokeGraphics)===null||r===void 0?void 0:r.displayObject)===null||o===void 0?void 0:o.filters)===null||s===void 0?void 0:s.length)!==null&&a!==void 0?a:-1)>0}set strokeActive(t){var e,i,r,o,s,a;const{displayObject:l}=this.strokeFill;t?l&&((i=(e=l.filters)===null||e===void 0?void 0:e.indexOf(this.strokeColorFilter))!==null&&i!==void 0?i:-1)<0?l.filters=[this.strokeColorFilter]:((r=this.strokeGraphics)===null||r===void 0?void 0:r.displayObject)&&((s=(o=this.strokeGraphics.displayObject.filters)===null||o===void 0?void 0:o.indexOf(this.strokeColorFilter))!==null&&s!==void 0?s:-1)<0&&(this.strokeGraphics.displayObject.filters=[this.strokeColorFilter]):l?l.filters=[]:!((a=this.strokeGraphics)===null||a===void 0)&&a.displayObject&&(this.strokeGraphics.displayObject.filters=[])}get fillActive(){var t,e,i,r,o,s,a;return this.backgroundFill.displayObject?((i=(e=(t=this.backgroundFill.displayObject)===null||t===void 0?void 0:t.filters)===null||e===void 0?void 0:e.length)!==null&&i!==void 0?i:-1)>0:((a=(s=(o=(r=this.backgroundGraphics)===null||r===void 0?void 0:r.displayObject)===null||o===void 0?void 0:o.filters)===null||s===void 0?void 0:s.length)!==null&&a!==void 0?a:-1)>0}set fillActive(t){var e,i,r,o,s,a;t?this.backgroundFill.displayObject&&((i=(e=this.backgroundFill.displayObject.filters)===null||e===void 0?void 0:e.indexOf(this.fillColorFilter))!==null&&i!==void 0?i:-1)<0?this.backgroundFill.displayObject.filters=[this.fillColorFilter]:((r=this.backgroundGraphics)===null||r===void 0?void 0:r.displayObject)&&((s=(o=this.backgroundGraphics.displayObject.filters)===null||o===void 0?void 0:o.indexOf(this.fillColorFilter))!==null&&s!==void 0?s:-1)<0&&(this.backgroundGraphics.displayObject.filters=[this.fillColorFilter]):this.backgroundFill.displayObject?this.backgroundFill.displayObject.filters=[]:!((a=this.backgroundGraphics)===null||a===void 0)&&a.displayObject&&(this.backgroundGraphics.displayObject.filters=[])}getTextElement(t,e){var i,r;return(r=(i=this.text)===null||i===void 0?void 0:i.getTextElement(t,e))!==null&&r!==void 0?r:null}getBgElement(){return this}getIterateEntry(t,e,i){return e===0?this:t==="el"?(this.ctx.eventHub.emit("IterateTimeNodeEnd",i),null):this.text?this.text.getIterateEntry(e-1,i)||null:(this.ctx.eventHub.emit("IterateTimeNodeEnd",i),null)}createStrokeGraphics(){var t,e,i,r;const{id:o,geometry:s,lineStyle:a}=this.json,{width:l,height:u,pivot:h}=(s==null?void 0:s.lineTransform)||Du,d=l||this.json.width,p=u||this.json.height,m=((t=a==null?void 0:a.fill)===null||t===void 0?void 0:t.fillType)==="solidFill"?a.fill.color:null;return a&&((e=a.fill)===null||e===void 0?void 0:e.fillType)!=="noFill"?new Zw(o+"-path-graphics",this.ctx,(i=s==null?void 0:s.paths)!==null&&i!==void 0?i:[],(r=s==null?void 0:s.hash)!==null&&r!==void 0?r:"",h||{x:0,y:0},d,p,a,!1,null,m):null}createStrokeFill(){const[t,e]=this.calculateFillObjectOffset(),{geometry:i,lineStyle:r,width:o,height:s}=this.json,a=(i==null?void 0:i.lineTransform)||Du,l=Object(V.isNumber)(r==null?void 0:r.width)?r.width:1;return new Ca(this.ctx,r==null?void 0:r.fill,(a.width||o)+l+t,Math.max((a.height||s)+l,e),{useFilter:!1,useSlideBackgroundFill:!1})}createBackgroundGraphics(){var t;const{geometry:e,lineStyle:i,fillStyle:r,id:o}=this.json,{width:s,height:a,pivot:l}=(e==null?void 0:e.lineTransform)||Du,u=s||this.json.width,h=a||this.json.height,d=(r==null?void 0:r.fillType)==="solidFill"?r.color:null;return r&&r.fillType!=="noFill"||this.json.isPicture?new Zw(o+"-bg-graphics",this.ctx,(t=e==null?void 0:e.paths)!==null&&t!==void 0?t:[],(e==null?void 0:e.hash)||"",l||{x:0,y:0},u,h,i,!0,d,null):null}createBackgroundFill(){var t,e;const{fillStyle:i,width:r,height:o,lineStyle:s,geometry:a}=this.json,l=(a==null?void 0:a.fillTransform)||Du;return new Ca(this.ctx,i,(l.width||r)+((t=s==null?void 0:s.width)!==null&&t!==void 0?t:0),(l.height||o)+((e=s==null?void 0:s.width)!==null&&e!==void 0?e:0),{useFilter:!1,useSlideBackgroundFill:this.json.useBgFill,fillFloat:this.json.fillFloat,shapeRotation:this.json.rotation})}createBackground(){var t,e,i,r,o,s,a,l;const{pivot:u,width:h,height:d}=((t=this.json.geometry)===null||t===void 0?void 0:t.fillTransform)||Du,{displayObject:p}=this.backgroundFill;p?(this.json.useBgFill&&((i=this.backgroundGraphics)===null||i===void 0?void 0:i.displayObject)?(this.needCacheAsBitMap=!0,p.mask=this.backgroundGraphics.displayObject,p.pivot.x=((r=this.json.position)===null||r===void 0?void 0:r.x)||0,p.pivot.y=((o=this.json.position)===null||o===void 0?void 0:o.y)||0,this.container.addChild(this.backgroundGraphics.displayObject)):((s=this.json.fillStyle)===null||s===void 0?void 0:s.fillType)==="gifFill"?(p.height=d||this.designHeight,p.width=h||this.designWidth,p instanceof s_&&p.play(),!((a=this.backgroundGraphics)===null||a===void 0)&&a.isNeedMask(p.width,p.height)&&(p.mask=this.backgroundGraphics.displayObject,this.backgroundGraphics.displayObject&&this.container.addChild(this.backgroundGraphics.displayObject))):!((l=this.backgroundGraphics)===null||l===void 0)&&l.isNeedMask(p.width,p.height)&&(this.json.fillFloat||(this.needCacheAsBitMap=!0,p.mask=this.backgroundGraphics.displayObject,this.backgroundGraphics.displayObject&&this.container.addChild(this.backgroundGraphics.displayObject))),this.json.fillFloat||(p.x=u.x,p.y=u.y),this.container.addChild(p)):this.backgroundFill.hasFill&&((e=this.backgroundGraphics)===null||e===void 0?void 0:e.displayObject)&&this.container.addChild(this.backgroundGraphics.displayObject)}createPathFill(){var t,e,i;const{displayObject:r}=this.strokeFill,o=(t=this.strokeGraphics)===null||t===void 0?void 0:t.displayObject,[s,a]=this.calculateFillObjectOffset();r?(((e=this.strokeGraphics)===null||e===void 0?void 0:e.isNeedMask(r.width,r.height))&&o&&(this.needCacheAsBitMap=!0,r.pivot.x=o.pivot.x,r.pivot.y=o.pivot.y,o.pivot.x=0,o.pivot.y=0,r.mask=o,r.addChild(o),r.position.x=-s/2,r.position.y=-a/2,o.position.x=s/2,o.position.y=a/2),this.container.addChild(r)):this.strokeFill.hasFill&&((i=this.strokeGraphics)===null||i===void 0?void 0:i.displayObject)&&this.container.addChild(this.strokeGraphics.displayObject)}createFilledPathMask(){var t,e,i;const r=((e=(t=this.json.geometry)===null||t===void 0?void 0:t.paths)===null||e===void 0?void 0:e.filter(o=>o.fill!=="none"&&o.fill!=="norm"))||[];for(const o of r){const s=this.ctx.graphicsTexture.getGraphicsData(o.id);if(s){const a=new xr(s.texture);a.pivot.x=s.pivot.x,a.pivot.y=s.pivot.y;const l=this.backgroundFill.getClonedDisplayObject(),u=(i=this.backgroundGraphics)===null||i===void 0?void 0:i.getClonedDisplayObject(),h=l||u;h&&(this.backgroundFill.displayObject&&(h.pivot.x=this.backgroundFill.displayObject.pivot.x,h.pivot.y=this.backgroundFill.displayObject.pivot.y),h.mask=a,h.filters=[iP[o.fill]],this.needCacheAsBitMap=!0,this.container.addChild(h),this.container.addChild(a))}}}createArrow(){this.arrowList.length&&this.arrowList.forEach(t=>{var e;const i=this.ctx.graphicsTexture.getGraphicsData(t.graphicsId);if(i){const{texture:r}=i,o=new xr(r);o.pivot.x=t.pivot.x,o.pivot.y=t.pivot.y,o.position.x=t.position.x,o.position.y=t.position.y,o.rotation=t.rotate/180*Math.PI,(e=this.backgroundGraphics)===null||e===void 0||e.addArrows(o)}})}generateArrowList(){var t,e;const{lineArrowList:i,lineStyle:r,id:o}=this.json,s=((t=r==null?void 0:r.fill)===null||t===void 0?void 0:t.fillType)==="solidFill"?r.fill.color:null;(e=i||[])===null||e===void 0||e.forEach((a,l)=>{var u,h;const d=new RP(Object.assign(Object.assign({},a),{fillStyle:r==null?void 0:r.fill,lineWidth:(u=r==null?void 0:r.width)!==null&&u!==void 0?u:0}));d.graphicsId=`${o}-arrow-${l}-graphics`,d.textureId=`${o}-arrow-${l}-fill`,this.ctx.graphicsTexture.addGraphics(d.graphicsId,(h=d.paths)!==null&&h!==void 0?h:[],d.hash,{x:0,y:0},d.width,d.height,void 0,this.ctx.objectPoolGroup,!0,s,null),this.arrowList.push(d)})}calculateFillObjectOffset(){let[t,e]=[0,0];return this.arrowList.length&&(t=this.arrowList.reduce((i,r)=>Math.max(i,r.width),0),e=this.arrowList.reduce((i,r)=>Math.max(i,r.height),0)),[t,e]}preRender(t){var e,i,r;const{lineStyle:o,geometry:s}=this.json,{width:a,height:l}=(s==null?void 0:s.lineTransform)||Du,u=a||this.json.width,h=l||this.json.height,d=((e=s==null?void 0:s.paths)===null||e===void 0?void 0:e.filter(m=>m.fill!=="none"&&m.fill!=="norm"))||[],p=((i=o==null?void 0:o.fill)===null||i===void 0?void 0:i.fillType)==="solidFill"?o.fill.color:null;t.addSubMTask(()=>g_(this,void 0,void 0,function*(){for(const m of d)this.ctx.graphicsTexture.addGraphics(m.id,[m],m.hash,((s==null?void 0:s.lineTransform)||Du).pivot,u,h,o,this.ctx.objectPoolGroup,!0,null,p)}),"@ShapeImpl[addGraphics]"),(r=this.text)===null||r===void 0||r.createParagraphs(this.json.id,t)}subClassRender(){}setupEffect(){const{effectList:t}=this.json;if(t&&t.length>0){const e=[];return t.forEach(i=>{i.type==="reflection"&&(this.filterAreaJustifies.push(r=>(r.height*=2,r)),e.push(new AP.Reflection(i)))}),this.ctx.ticker.add(this.updateFilterArea,void 0,-20),this.renderContainer.filters=e,!0}return!1}render(t){t.addSubMTask(()=>g_(this,void 0,void 0,function*(){var e,i;(e=this.strokeGraphics)===null||e===void 0||e.render(),(i=this.backgroundGraphics)===null||i===void 0||i.render(),this.createBackground(),this.subClassRender(),this.createFilledPathMask(),this.createPathFill(),this.createArrow()}),"@ShapeImpl[render]"),this.text&&this.text.render(t),t.addSubMTask(()=>g_(this,void 0,void 0,function*(){var e,i,r,o,s,a,l,u;if(((e=this.json.textBody)===null||e===void 0?void 0:e.iterateType)==="wd"||((i=this.json.textBody)===null||i===void 0?void 0:i.iterateType)==="lt")this.renderContainer.addChild(this.container),this.text&&(this.text.container.scale.y=(o=(r=this.json.scale)===null||r===void 0?void 0:r.y)!==null&&o!==void 0?o:1,this.text.container.position.x+=((a=(s=this.json.position)===null||s===void 0?void 0:s.x)!==null&&a!==void 0?a:0)+this.text.x,this.text.container.position.y+=((u=(l=this.json.position)===null||l===void 0?void 0:l.y)!==null&&u!==void 0?u:0)+this.text.y,this.text.container.scale.y===-1&&(this.text.container.position.y+=this.text.height),this.renderContainer.addChild(this.text.container));else{if(this.text){if(Object(V.isBoolean)(this.json.textRotateWithShape)&&!this.json.textRotateWithShape){const h=this.json.rotation||0;this.text.container.rotation=-h;const{width:d}=this.text;this.text.container.position.x=d}this.container.addChild(this.text.container)}this.renderContainer.addChild(this.container)}if(this.needCacheAsBitMap,this.json.id==="background"&&this.ctx.hasBackgroundFillShape){const h=Ro.create({width:this.json.width,height:this.json.height,resolution:Math.ceil(this.ctx.renderer.resolution)});this.ctx.renderer.render(this.renderContainer,{renderTexture:h}),this.ctx.bgTexture=h}}),"@ShapeImpl[post.render]")}clearOnSlideChange(){}initOnReuse(){}destroy(){var t,e,i,r;(t=this.text)===null||t===void 0||t.destroy(),this.fillColorFilter.destroy(),this.strokeColorFilter.destroy(),this.backgroundFill.destroy(),(e=this.backgroundGraphics)===null||e===void 0||e.destroy(),this.strokeFill.destroy(),(i=this.strokeGraphics)===null||i===void 0||i.destroy(),this.renderContainer.destroy(),(r=this.arrowRenderTexture)===null||r===void 0||r.destroy(!0),this.arrowList=[]}}var v_=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};function Pa(n,t){for(const e in t)n.style[e]=t[e]}class yp{constructor(t){var e,i;this.progress=document.createElement("div"),this.totalTime=document.createElement("span"),this.playButton=document.createElement("div"),this.pauseButton=document.createElement("div"),this.currentTime=document.createElement("span"),this.mediaController=document.createElement("div"),this.currentProgress=document.createElement("div"),this.medianIsEnd=!1,this.pickBookmarkIndex=0,this.playCallBackList=[],this.duration=0,this.start=0,this.end=0,this.changeMediaProgress=r=>{if(this.ctx.isPlayerPaused())return void this.ctx.logger.info("Media controller prevent seek event with paused state",this.ctx.taskId);r.stopPropagation();const o=r.offsetX/this.progress.clientWidth*this.duration;this.medianIsEnd=!1,this.ctx.mode!=="interactive"&&this.jumpToTime(o),this.ctx.mode!=="local"&&this.ctx.eventHub.emit(Ne.mediaSeek,{id:this.targetId,time:o,isPlaying:this.media.isPlaying})},this.jumpToTime=(r=0)=>{const o=Math.floor(r)+this.start;this.media.currentTime!==o&&(this.media.currentTime=o,this.changeBookmarkIndex(o,o>this.media.currentTime))},this.showController=r=>{r.stopPropagation(),this.show()},this.getMediaDuration=()=>{this.duration&&!Number.isNaN(this.duration)||(this.duration=this.media.duration,this.start&&(this.duration-=this.start,this.jumpToTime()),this.end&&(this.duration-=this.end)),this.totalTime.innerText=yp.formatTime(this.duration)},this.playMedia=()=>v_(this,void 0,void 0,function*(){this.playButton.style.display="none",this.pauseButton.style.display="block",yield this.media.play(),this.medianIsEnd&&(this.medianIsEnd=!1,this.jumpToTime()),this.playCallBackList.forEach(r=>{r()})}),this.pauseMedia=()=>v_(this,void 0,void 0,function*(){this.playButton.style.display="block",this.pauseButton.style.display="none",yield this.media.pause()}),this.onMouseOut=r=>{r.stopPropagation(),this.mediaController.style.display="none"},this.mediaTimeUpdate=()=>v_(this,void 0,void 0,function*(){const r=this.media.currentTime-this.start;if(this.duration>0&&(r>this.duration||this.media.ended)&&(yield this.pauseMedia(),this.medianIsEnd=!0),this.currentTime.innerText=yp.formatTime(r),this.currentProgress.style.flex=(r/this.duration).toString(),!this.bookmarkList||this.bookmarkList.length===0)return;const o=this.bookmarkList[this.pickBookmarkIndex];o&&o.time.toFixed(0)===this.media.currentTime.toFixed(0)&&(this.ctx.timingEventHub.emit(`shape ${this.shapeId} onMediaBookmark ${o.name}`),this.pickBookmarkIndex+=1)}),this.onPauseMedia=()=>{this.playButton.style.display="block",this.pauseButton.style.display="none"},this.onPlayMedia=()=>{this.playButton.style.display="none",this.pauseButton.style.display="block",this.playCallBackList.forEach(r=>{r()})},this.playMediaFromCtrl=()=>{this.ctx.isPlayerPaused()?this.ctx.logger.info("Media controller prevent play event with paused state",this.ctx.taskId):(this.ctx.mode!=="interactive"&&this.playMedia(),this.ctx.mode!=="local"&&this.ctx.eventHub.emit(Ne.mediaPlay,{id:this.targetId,time:this.media.currentTime-this.start}))},this.pauseMediaFromCtrl=()=>{this.ctx.isPlayerPaused()?this.ctx.logger.info("Media controller prevent pause event with paused state",this.ctx.taskId):(this.ctx.mode!=="interactive"&&this.pauseMedia(),this.ctx.mode!=="local"&&this.ctx.eventHub.emit(Ne.mediaPause,{id:this.targetId,time:this.media.currentTime-this.start}))},this.targetId=t.targetId,this.ctx=t.ctx,this.height=t.height,this.width=t.width,this.target=t.target,this.media=t.media,this.info=t.info,this.shapeId=t.shapeId,this.canvasElement=t.canvasElement,this.getMedianContainer(),this.createMediaController(),this.info.cut&&(this.start=(e=this.info.cut.start)!==null&&e!==void 0?e:0,this.end=(i=this.info.cut.end)!==null&&i!==void 0?i:0),this.info.bookmarkList&&(this.bookmarkList=this.info.bookmarkList.sort((r,o)=>r.time-o.time))}getMedianContainer(){var t;let e=(t=this.canvasElement.parentElement)===null||t===void 0?void 0:t.querySelector(".median-container");e||(e=document.createElement("div"),e.className="median-container",this.canvasElement.parentElement.appendChild(e)),this.container=e}static formatTime(t){let e="00:00";if(t){const i=Math.floor(t/60),r=String(i<0?0:i).padStart(2,"0"),o=Math.floor(t%60);e=`${r}:${String(o<0?0:o).padStart(2,"0")}`}return e}createButton(){const t={marginLeft:"15px",marginRight:"10px",fontSize:"0",height:"20px"};Pa(this.playButton,Object.assign(Object.assign({},t),{display:"block"}));const e=document.createElement("img");Pa(e,{height:"20px"}),e.src="https://convertcdn.netless.link/publicFiles/icon/play.png",this.playButton.appendChild(e),Pa(this.pauseButton,Object.assign(Object.assign({},t),{display:"none"}));const i=document.createElement("img");Pa(i,{height:"20px"}),i.src="https://convertcdn.netless.link/publicFiles/icon/pause.png",this.pauseButton.appendChild(i)}createTimer(){const t=document.createElement("div");Pa(t,{width:"100px"}),this.currentTime.innerText="00:00";const e=document.createElement("span");return e.innerText="/",t.append(this.currentTime,e,this.totalTime),t}createProgress(){Pa(this.progress,{flex:"1",position:"relative",marginRight:"10px"});const t=document.createElement("div");Pa(t,{background:"#D9D9D9",position:"relative",height:"10px",display:"flex"}),this.progress.appendChild(t),Pa(this.currentProgress,{background:"#4F4F4F",top:"0px",left:"0",height:"10px",flex:"0"}),t.appendChild(this.currentProgress)}changeBookmarkIndex(t,e){if(this.bookmarkList&&this.bookmarkList.length!==0){if(this.pickBookmarkIndex>0){for(let i=0;i<this.pickBookmarkIndex;i++)if(this.bookmarkList[i].time>t){this.pickBookmarkIndex=i;break}}if(e){let i=this.pickBookmarkIndex-1;for(let r=0;r<this.bookmarkList.length;r++)this.bookmarkList[r].time<t&&(i=r);for(let r=this.pickBookmarkIndex;r<=i;r++){const o=this.bookmarkList[r];o&&this.ctx.timingEventHub.emit(`shape ${this.shapeId} onMediaBookmark ${o.name}`)}this.pickBookmarkIndex=i+1}}}bindEvent(){this.mediaController.addEventListener("mouseover",this.showController,!1),this.mediaController.addEventListener("mouseout",this.onMouseOut,!1),this.progress.addEventListener("mousedown",this.changeMediaProgress,!1),this.playButton.addEventListener("click",this.playMediaFromCtrl,!1),this.pauseButton.addEventListener("click",this.pauseMediaFromCtrl,!1),this.media.on("durationchange",this.getMediaDuration,!1),this.media.on("timeupdate",this.mediaTimeUpdate,!1),this.media.on("pause",this.onPauseMedia,!1),this.media.on("play",this.onPlayMedia,!1)}setControllerPosition(){var t;const{target:e}=this,{stageWidth:i,stageHeight:r}=this.ctx,o=e.getGlobalPosition(),s=Number((t=this.container)===null||t===void 0?void 0:t.getAttribute("data-scale")),a=i*s,l=1/s*(300>a?a/300:1);o.y=o.y+this.height-50,o.x=Math.max(o.x,0),o.x=Math.min(o.x,i-300*l),o.y=Math.max(o.y,0),o.y=Math.min(o.y,r-50),Pa(this.mediaController,{height:"50px",borderRadius:"25px",width:"300px",flexDirection:"row",alignItems:"center",position:"absolute",left:o.x+"px",top:o.y+"px",display:"none",background:"#fff",zIndex:"2",border:"1px solid #ccc",transform:`scale(${l})`,transformOrigin:"0 100%"})}createMediaController(){this.setControllerPosition(),this.createButton();const t=this.createTimer();this.createProgress(),this.mediaController.append(this.playButton,this.pauseButton,t,this.progress),this.container.appendChild(this.mediaController),this.bindEvent()}addPlayCallBack(t){this.playCallBackList.push(t)}unbindEvent(){this.mediaController.removeEventListener("mouseover",this.showController,!1),this.mediaController.removeEventListener("mouseout",this.onMouseOut,!1),this.progress.removeEventListener("mousedown",this.changeMediaProgress,!1),this.playButton.removeEventListener("click",this.playMediaFromCtrl,!1),this.pauseButton.removeEventListener("click",this.pauseMediaFromCtrl,!1),this.media.removeAllListeners()}show(){this.setControllerPosition(),this.mediaController.style.display="flex"}hide(){this.mediaController.style.display="none"}destroy(){var t;this.unbindEvent(),this.playCallBackList=[],(t=this.container)===null||t===void 0||t.removeChild(this.mediaController)}}var CP=v(49);class __ extends C.a{constructor(t,e){super(),this.isGlobalPause=!1,this.lastTime=-1,this.howl=null,this.rctClient=null,this.url=t,this.runningAudio=e,tr.RtcAudioClazz?(this.rctClient=new tr.RtcAudioClazz(t),this.rctClient.on("load",()=>this.emit("load")),this.rctClient.on("pause",()=>this.emit("pause")),this.rctClient.on("play",()=>this.emit("play"))):(this.howl=new CP.Howl({src:[t]}),this.howl.on("load",()=>this.emit("load")),this.howl.on("pause",()=>this.emit("pause")),this.howl.on("play",()=>this.emit("play")))}startTimeChangeEmit(){this.currentTime!==this.lastTime&&(this.lastTime=this.currentTime,this.emit("timeupdate")),this.isEnded||requestAnimationFrame(()=>this.startTimeChangeEmit())}play(){var t,e,i;this.runningAudio.has(this.url)&&((t=this.runningAudio.get(this.url))===null||t===void 0||t.stop(),this.runningAudio.delete(this.url)),this.lastTime=-1,(e=this.howl)===null||e===void 0||e.play(),(i=this.rctClient)===null||i===void 0||i.play(),this.startTimeChangeEmit(),this.runningAudio.set(this.url,this)}pause(){var t,e;(t=this.howl)===null||t===void 0||t.pause(),(e=this.rctClient)===null||e===void 0||e.pause(),this.runningAudio.has(this.url)&&this.runningAudio.delete(this.url)}globalPause(){this.isPaused||(this.isGlobalPause=!0,this.pause())}globalResume(){this.isGlobalPause&&(this.isGlobalPause=!1,this.play())}stop(){var t;(t=this.howl)===null||t===void 0||t.stop(),this.rctClient&&(this.rctClient.pause(),this.rctClient.currentTime=0),this.runningAudio.has(this.url)&&this.runningAudio.delete(this.url)}destroy(){var t,e,i,r,o,s,a;(t=this.howl)===null||t===void 0||t.pause(),(e=this.howl)===null||e===void 0||e.unload(),(i=this.rctClient)===null||i===void 0||i.pause(),(r=this.rctClient)===null||r===void 0||r.destroy(),(o=this.rctClient)===null||o===void 0||o.removeAllListeners("load"),(s=this.rctClient)===null||s===void 0||s.removeAllListeners("play"),(a=this.rctClient)===null||a===void 0||a.removeAllListeners("pause"),this.runningAudio.has(this.url)&&this.runningAudio.delete(this.url)}get currentTime(){return this.rctClient?this.rctClient.currentTime:this.howl?this.howl.seek():-1}set currentTime(t){this.rctClient?this.rctClient.currentTime=t:this.howl&&this.howl.seek(t)}get duration(){return this.rctClient?this.rctClient.duration:this.howl?this.howl.duration():0}get isEnded(){return Math.abs(this.currentTime-this.duration)<.001}get isPaused(){return this.rctClient?this.rctClient.isPaused:!!this.howl&&this.howl.playing()}}var PP=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};class IP extends C.a{constructor(t){var e,i;super(),this.type="video",this.sprite=new xr,this.isPlaying=!1,this.isGlobalPause=!1,this.id=t.id,this.start=(e=t.video.cut)===null||e===void 0?void 0:e.start,this.end=(i=t.video.cut)===null||i===void 0?void 0:i.end,this.container=t.container,this.ctx=t.ctx,this.ctx.medias[this.id]=this;let r=t.video.src;this.ctx.loaderDelegate&&(r=this.ctx.loaderDelegate.redirectMedia(r),this.ctx.logger.info(`redirect media url from ${t.video.src} to ${r} by delegate.`,t.ctx.taskId)),this.videoResource=new Pb(r,{autoLoad:!0,autoPlay:!1,updateFPS:30,crossorigin:!0});let o=t.video.src.replace(/4$/,"3");this.ctx.loaderDelegate&&(o=this.ctx.loaderDelegate.redirectMedia(o),this.ctx.logger.info(`redirect media url from ${t.video.src.replace(/4$/,"3")} to ${o} by delegate.`,t.ctx.taskId)),this.rtcAudio=new __(o,t.ctx.runningAudio);const{video:s,width:a,height:l,target:u}=t;this.controller=new yp({targetId:t.id,shapeId:t.shapeId,ctx:t.ctx,width:a,height:l,target:u,media:this,info:s,canvasElement:t.canvasElement}),this.controller.addPlayCallBack(()=>{this.sprite.width=a,this.sprite.height=l,this.ctx.clock.setTimeout(()=>{this.sprite.visible=!0},50)});const h=new Mi(null,{height:l,width:a});h.resource=this.videoResource,this.videoResource.bind(h),this.sprite=new xr,this.sprite.visible=!1,this.sprite.texture=new Qe(h),this.sprite.interactive=!0,this.container.addChild(this.sprite),this.sprite.on("mouseover",d=>{d.stopPropagation(),this.controller.show()}),this.sprite.on("mouseout",d=>{d.stopPropagation(),this.controller.hide()}),["durationchange","timeupdate","pause","play"].forEach(d=>{this.videoResource.source.addEventListener(d,()=>{d!=="timeupdate"||this.isPlaying||this.pause(),this.emit(d)})}),this.ctx.activeMedia.add(this)}get currentTime(){var t,e;return(e=(t=this.videoResource.source)===null||t===void 0?void 0:t.currentTime)!==null&&e!==void 0?e:0}set currentTime(t){this.videoResource.source&&(this.videoResource.source.currentTime=t)}get paused(){var t,e;return(e=(t=this.videoResource.source)===null||t===void 0?void 0:t.paused)===null||e===void 0||e}get ended(){var t,e;return(e=(t=this.videoResource.source)===null||t===void 0?void 0:t.ended)===null||e===void 0||e}get duration(){var t,e;return(e=(t=this.videoResource.source)===null||t===void 0?void 0:t.duration)!==null&&e!==void 0?e:0}showController(){this.controller.show()}hideController(){this.controller.hide()}play(){var t;return PP(this,void 0,void 0,function*(){this.isPlaying=!0,yield this.load(),yield this.ctx.clock.waitUntil(()=>{const i=this.videoResource.source;return!!(i&&i.videoWidth>0)},3e3);const e=this.videoResource.source;e&&e.videoWidth<=0||(tr.RtcAudioClazz&&(this.rtcAudio.play(),this.videoResource.source.volume=0),yield(t=this.videoResource.source)===null||t===void 0?void 0:t.play())})}load(){return this.videoResource.load()}pause(){var t;this.isPlaying=!1,tr.RtcAudioClazz&&this.rtcAudio.pause(),(t=this.videoResource.source)===null||t===void 0||t.pause()}globalPause(){this.isPlaying&&(this.isGlobalPause=!0,this.pause())}globalResume(){this.isGlobalPause&&(this.isGlobalPause=!1,this.play())}togglePause(){this.isPlaying?this.pause():this.play()}seek(t){this.controller.jumpToTime(t)}stop(){this.seek(0),this.pause()}destroy(){var t;this.sprite.interactive=!1,this.sprite.destroy({texture:!0,baseTexture:!0}),(t=this.videoResource)===null||t===void 0||t.destroy(),this.rtcAudio.destroy(),this.controller.destroy(),this.ctx.activeMedia.delete(this)}}var LP=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};class OP extends C.a{constructor(t){super(),this.type="audio",this.isPlaying=!1,this.isGlobalPause=!1,this.id=t.id;let e=t.audio.src;t.ctx.loaderDelegate&&(e=t.ctx.loaderDelegate.redirectMedia(e),t.ctx.logger.info(`redirect media url from ${t.audio.src} to ${e} by delegate.`,t.ctx.taskId)),this.audioPlayer=new __(e,t.ctx.runningAudio),t.audio.cut&&(this.start=t.audio.cut.start,this.end=t.audio.cut.end),this.ctx=t.ctx,this.ctx.medias[this.id]=this;const{width:i,height:r,target:o}=t;this.controller=new yp({targetId:t.id,shapeId:t.shapeId,ctx:t.ctx,height:r,width:i,target:o,media:this,info:t.audio,canvasElement:t.canvasElement}),this.audioPlayer.on("load",()=>this.emit("durationchange")),this.audioPlayer.on("timeupdate",()=>this.emit("timeupdate")),this.audioPlayer.on("pause",()=>this.emit("pause")),this.audioPlayer.on("play",()=>this.emit("play")),this.ctx.activeMedia.add(this)}get currentTime(){return this.audioPlayer.currentTime}set currentTime(t){this.audioPlayer.currentTime=t}get paused(){return this.audioPlayer.isPaused}get isPaused(){return this.audioPlayer.isPaused}get ended(){return this.audioPlayer.isEnded}get duration(){return this.audioPlayer.duration}load(){return Promise.resolve()}showController(){this.controller.show()}hideController(){this.controller.hide()}play(){return LP(this,void 0,void 0,function*(){this.ctx.isPlayerPaused()?this.ctx.logger.info("Audio player prevent play event with paused state",this.ctx.taskId):(this.isPlaying=!0,this.audioPlayer.play())})}pause(){this.ctx.isPlayerPaused()?this.ctx.logger.info("Audio player prevent pause event with paused state",this.ctx.taskId):(this.isPlaying=!1,this.audioPlayer.pause())}globalPause(){this.isPlaying&&(this.isGlobalPause=!0,this.pause())}globalResume(){this.isGlobalPause&&(this.isGlobalPause=!1,this.play())}togglePause(){this.isPlaying?this.pause():this.play()}seek(t){this.ctx.isPlayerPaused()?this.ctx.logger.info("Audio player prevent seek event with paused state",this.ctx.taskId):this.controller.jumpToTime(t)}stop(){this.seek(0),this.pause()}destroy(){this.audioPlayer.pause(),this.controller.destroy(),this.ctx.activeMedia.delete(this)}}class NP extends Kw{constructor(t,e,i,r){super(Object.assign(Object.assign({},t),{type:"Shape",useBgFill:!1,textRotateWithShape:!0,isPicture:!0}),e,i,r),this.isInteractiveOutside=!1,this.cmd=new QC(this),this.media=t==null?void 0:t.media,this.picFill=new Ca(this.ctx,t.picFill,t.width,t.height,{useFilter:!1,useSlideBackgroundFill:!1})}applyCommand(t,e){var i,r,o,s,a;if(e==="call")if(/playFrom\(([0-9.]+)\)/.test(t)){const l=t.match(/playFrom\(([0-9.]+)\)/),u=Number(l[1]||"0");(i=this.mediaPlayer)===null||i===void 0||i.play().then(()=>{var h;(h=this.mediaPlayer)===null||h===void 0||h.seek(u)})}else t==="custom-pause"?(r=this.mediaPlayer)===null||r===void 0||r.pause():t==="togglePause"?(o=this.mediaPlayer)===null||o===void 0||o.togglePause():t==="stop"&&((s=this.mediaPlayer)===null||s===void 0||s.pause(),(a=this.mediaPlayer)===null||a===void 0||a.seek(0))}renderPic(){var t,e,i,r,o;const{displayObject:s}=this.picFill;if(s){const a=(t=this.backgroundGraphics)===null||t===void 0?void 0:t.getClonedDisplayObject();((e=this.backgroundGraphics)===null||e===void 0?void 0:e.isNeedMask(s.width,s.height))&&a&&(s.mask=a,this.container.addChild(a)),s.width=this.designWidth,s.height=this.designHeight,s instanceof s_&&this.ctx.slideScopeEventHub.once("slide-render",l=>{this.ctx.slideIndex===l&&s.play()}),this.container.addChild(s),((i=this.media)===null||i===void 0?void 0:i.type)==="video"&&this.media.src?(this.mediaPlayer=new IP({id:this.json.id+"-video",shapeId:this.json.id,ctx:this.ctx,video:this.media,height:this.designHeight,width:this.designWidth,target:s,container:this.container,canvasElement:this.ctx.view}),(r=this.mediaPlayer)===null||r===void 0||r.sprite):((o=this.media)===null||o===void 0?void 0:o.type)==="audio"&&this.media.src&&(this.mediaPlayer=new OP({id:this.json.id+"-audio",shapeId:this.json.id,ctx:this.ctx,audio:this.media,height:this.designHeight,width:this.designWidth,target:s,canvasElement:this.ctx.view})),this.mediaPlayer&&(this.isInteractiveOutside=this.container.interactive,this.container.interactive=!0,this.container.on("mouseover",()=>{this.mediaPlayer.showController()}),this.container.on("mouseout",()=>{this.mediaPlayer.hideController()},!1))}}preRender(t){super.preRender(t)}subClassRender(){this.renderPic()}clearOnSlideChange(){super.clearOnSlideChange(),this.mediaPlayer&&(this.container.interactive=!1,this.mediaPlayer.stop(),this.mediaPlayer.hideController())}initOnReuse(){super.initOnReuse(),this.mediaPlayer&&(this.container.interactive=!0)}destroy(){this.mediaPlayer&&(this.picFill.displayObject&&!this.isInteractiveOutside&&(this.container.interactive=!1),this.mediaPlayer.destroy(),this.mediaPlayer=void 0),this.picFill.destroy()}}var dg=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};class y_ extends h_{constructor(t,e,i,r,o){super(t,e,i),this.children=[],this.cacheSprite=new xr,this.cacheContainer=new ar,this.json=t,this.json.fillStyle&&this.json.fillStyle.fillType==="groupFill"&&r&&(this.json.fillStyle=r),this.container.name=t.id,this.cacheContainer.name=t.id+"-cache-container",this.ctx.timingTargets.addTarget(t.id,this),this.updateTransform(this.json),this.fillObject=new Ca(this.ctx,t.fillStyle,t.width,t.height,{useFilter:!1,useSlideBackgroundFill:!1}),this.createChildren(o)}createChildren(t){var e,i,r,o;const s={x:(i=(e=this.json.position)===null||e===void 0?void 0:e.x)!==null&&i!==void 0?i:0,y:(o=(r=this.json.position)===null||r===void 0?void 0:r.y)!==null&&o!==void 0?o:0};for(let a=0,l=this.json.children.length;a<l;a++)t.addSubMTask(()=>dg(this,void 0,void 0,function*(){const u=this.json.children[a];let h=null;(u==null?void 0:u.type)==="Shape"?h=new Kw(u,this.ctx,s,this.json.fillStyle):(u==null?void 0:u.type)==="Picture"?h=new NP(u,this.ctx,s,this.json.fillStyle):(u==null?void 0:u.type)==="Container"&&(h=new y_(u,this.ctx,s,this.json.fillStyle,t)),h&&this.children.push(h)}),"@ContainerImpl[child.init]")}get interactiveContainer(){return this.container}get renderContainer(){return this.container}preRender(t){for(const e of this.children)t.addSubMTask(()=>dg(this,void 0,void 0,function*(){e.preRender(t)}),"@ContainerImpl[child.preRender]")}getBgElement(){return null}getIterateEntry(t,e,i){return e===0?this:(this.ctx.eventHub.emit("IterateTimeNodeEnd",i),null)}getTextElement(){return null}render(t){for(const e of this.children)e.render(t),t.addSubMTask(()=>dg(this,void 0,void 0,function*(){var i;e.renderContainer&&this.cacheContainer.addChild(e.renderContainer),(e.json.hlinkHover||e.json.hlinkClick)&&((i=e.hyperlink)===null||i===void 0||i.addProxy(this.container))}),"@ContainerImpl[child.render]");t.addSubMTask(()=>dg(this,void 0,void 0,function*(){this.container.addChild(this.cacheContainer)}),"@ContainerImpl[child.append]")}clearOnSlideChange(){this.children.forEach(t=>t.clearOnSlideChange())}initOnReuse(){this.children.forEach(t=>t.initOnReuse())}destroy(){this.cacheSprite&&this.cacheSprite.destroy({texture:!0}),this.children.forEach(t=>t.destroy()),this.container.destroy({children:!0,texture:!0,baseTexture:!0}),this.cacheContainer.destroy({children:!0,texture:!0,baseTexture:!0})}}class xp extends C.a{constructor(t,e,i,r){super(),this.cond={},this.timeoutIds=[],this.condHandle=(o,s={})=>{if(o)if(o.delay&&o.delay>0){const a=this.ctx.clock.setTimeout(()=>{o.event&&(this.cond[o.event]=!0,this.detectTrigger(s))},o.delay);this.timeoutIds.push(a)}else this.cond[o.event]=!0,this.detectTrigger(s);else this.detectTrigger(s)},this.id=t,this.ctx=r,this.eventHubs=i,e.forEach(o=>{this.addCond(o)})}setTriggerParams(t){this.triggerParams=t}addCond(t){const e=i=>{this.condHandle(t,i)};t.event&&(/^shape/.test(t.event)||/^time/.test(t.event)?(this.cond[t.event]=!1,this.eventHubs.global.addListener(t.event,e)):/^runtime/.test(t.event)?(this.cond[t.event]=!1,this.eventHubs.runtime.addListener(t.event,e)):/^self/.test(t.event)?t.delay&&t.delay>0&&(this.cond[t.event]=!1,this.eventHubs.runtime.addListener(t.event,e)):this.cond[t.event]=!1)}isTrigger(){return Object.keys(this.cond).every(t=>!!this.cond[t])}isTriggerWithoutParent(){return Object.keys(this.cond).filter(t=>t!=="self").every(t=>!!this.cond[t])}detectTrigger(t){if(Object.keys(this.cond).every(e=>!!this.cond[e])){Object.keys(this.cond).forEach(i=>{this.cond[i]=!1});const e=this.triggerParams;this.triggerParams=void 0,this.emit("active",e,t)}}reset(){Object.keys(this.cond).forEach(t=>{this.cond[t]=!1}),this.timeoutIds.forEach(t=>this.ctx.clock.clearTimeout(t))}}class DP extends C.a{constructor(t){super(),this.isTimeNodeEndSync=!1,this.interactiveListeners=[],this.runtimeNodeEventHub=new C.a,this._currentSeqIndex=0,this._currentSeqState="idle",this.isForward=!0,this.autoPlay=!1,this.handlePrev=(p=!1)=>{var m,g,_,y,w,A;this.hasPrev()||!this.isMainSeq?this.currentSeqState==="idle"?(this.decrSeqIndex(),(m=this.commonTimeNode.children[this.currentSeqIndex])===null||m===void 0||m.commonTimeNode.seekToStart(),(g=this.commonTimeNode.children[this.currentSeqIndex])===null||g===void 0||g.commonTimeNode.clearSubList(),this.currentSeqState="idle"):this.currentSeqState==="running"?((_=this.commonTimeNode.children[this.currentSeqIndex])===null||_===void 0||_.commonTimeNode.seekToStart(),(y=this.commonTimeNode.children[this.currentSeqIndex])===null||y===void 0||y.commonTimeNode.clearSubList(),this.currentSeqState="idle"):this.currentSeqState==="end"&&(this.currentSeqIndex>=this.commonTimeNode.children.length&&(this.currentSeqIndex=this.commonTimeNode.children.length-1),(w=this.commonTimeNode.children[this.currentSeqIndex])===null||w===void 0||w.commonTimeNode.seekToStart(),(A=this.commonTimeNode.children[this.currentSeqIndex])===null||A===void 0||A.commonTimeNode.clearSubList(),this.currentSeqState="idle"):this.globalEventHub.emit("c:prev slide",p)},this.handleNext=(p=!1)=>{var m,g,_,y;this.isTimeNodeEndSync&&(this.isTimeNodeEndSync=!1,this.currentSeqState="idle",this.currentSeqIndex=0),this.hasNext()||!this.isMainSeq?this.currentSeqState==="idle"?(m=this.commonTimeNode.children[this.currentSeqIndex])===null||m===void 0||m.commonTimeNode.startTimeNodeForce():this.currentSeqState==="running"?((g=this.commonTimeNode.children[this.currentSeqIndex])===null||g===void 0||g.commonTimeNode.seekToEnd(!1,!0),this.currentSeqState="end",this.incrSeqIndex(),(_=this.commonTimeNode.children[this.currentSeqIndex])===null||_===void 0||_.commonTimeNode.startTimeNodeForce()):this.currentSeqState==="end"&&(this.incrSeqIndex(),(y=this.commonTimeNode.children[this.currentSeqIndex])===null||y===void 0||y.commonTimeNode.startTimeNodeForce()):this.globalEventHub.emit("c:next slide",p)};const{json:e,iterateType:i,isIterate:r,isSub:o,parent:s,ctx:a,eventHub:l,iterateIndex:u,iterateId:h,isInInteractiveSeq:d}=t;this.isMainSeq=e.ctn.nodeType==="mainSeq",this.isInteractiveSeq=e.ctn.nodeType==="interactiveSeq",this.id=e.ctn.id,this.isIterate=r,this.json=e,this.ctx=a,this.globalEventHub=l,this.commonTimeNode=new Ac({json:e.ctn,isSub:o,eventHubs:{global:l,runtime:this.runtimeNodeEventHub},ctx:a,parent:s,isIterate:!1,iterateType:i,iterateIndex:u,iterateId:h,isInInteractiveSeq:d||this.isInteractiveSeq}),this.bindShapeEvent(),this.nextConds=new xp("mainSeq",e.nextCondLst,{global:l,runtime:this.runtimeNodeEventHub},this.ctx),this.prevConds=new xp("mainSeq",e.preCondLst,{global:l,runtime:this.runtimeNodeEventHub},this.ctx),this.commonTimeNode.on("timeNodeRestart",()=>{this.currentSeqIndex=0,this.currentSeqState="idle"}),this.commonTimeNode.on("childTimeNodeStart",p=>{const m=this.commonTimeNode.children.findIndex(g=>g.commonTimeNode.uuid===p.id);m>=0&&(this.currentSeqIndex=m),this.currentSeqState="running",this.isMainSeq&&this.ctx.eventHub.emit(Ne.mainSeqStepStart,m)}),this.commonTimeNode.on("childTimeNodeEnd",p=>{const m=this.commonTimeNode.children.findIndex(g=>g.commonTimeNode.uuid===p.id);m>=0&&(this.currentSeqIndex=m),this.currentSeqState="end",this.autoPlay&&this.ctx.clock.setTimeout(()=>{this.handleNext()}),this.isMainSeq&&this.ctx.eventHub.emit(Ne.mainSeqStepEnd,m)}),this.commonTimeNode.on("timeNodeEndSync",()=>{this.isTimeNodeEndSync=!0,this.commonTimeNode.resetForRepeat()}),this.commonTimeNode.on("timeNodeDestroy",()=>{this.interactiveListeners.forEach(([p,m])=>{p&&m&&p.interactiveContainer.removeListener("pointerdown",m)}),this.interactiveListeners=[]}),this.nextConds.on("active",(p,m)=>{this.handleNext(m)}),this.prevConds.on("active",(p,m)=>{this.handlePrev(m)})}get currentSeqIndex(){return this._currentSeqIndex}set currentSeqIndex(t){this._currentSeqIndex=t,this.isMainSeq?this.ctx.eventHub.emit(Ne.mainSeqStepChange,t):this.isInteractiveSeq&&this.ctx.eventHub.emit(Ne.interactiveSeqStateChange,{id:this.json.ctn.id,state:{step:t,state:this._currentSeqState}})}get currentSeqState(){return this._currentSeqState}set currentSeqState(t){this._currentSeqState=t,this.isMainSeq?this.ctx.eventHub.emit(Ne.mainSeqStateChange,t):this.isInteractiveSeq&&this.ctx.eventHub.emit(Ne.interactiveSeqStateChange,{id:this.json.ctn.id,state:{step:this._currentSeqIndex,state:t}})}get stepLength(){return this.commonTimeNode.children.length}get currentStep(){return this.currentSeqIndex}get currentState(){return this.currentSeqState}startAutoPlay(){this.autoPlay=!0,this.commonTimeNode.children[0].commonTimeNode.startTimeNodeForce()}incrSeqIndex(){this.currentSeqIndex+1<=this.commonTimeNode.children.length&&(this.currentSeqIndex+=1)}decrSeqIndex(){this.currentSeqIndex-1>=-1&&(this.currentSeqIndex-=1)}hasPrev(){return!(this.currentSeqIndex<=0&&this.currentSeqState==="idle")}hasNext(){return!(this.currentSeqIndex>=this.commonTimeNode.children.length||this.currentSeqIndex===this.commonTimeNode.children.length-1&&this.currentSeqState==="end")}bindShapeEvent(){this.json.ctn.nodeType==="interactiveSeq"&&this.json.nextCondLst.forEach(t=>{if(/^shape/.test(t.event)){const e=t.event.split(" ")[1];if(e){const i=this.ctx.timingTargets.getTargetById(e);if(i){i.interactiveContainer.interactive=!0,i.interactiveContainer.cursor="pointer";const r=()=>{this.ctx.eventHub.emit(Ne.userInput);const o=`shape ${e} onClick`,{mode:s}=this.ctx;s!=="interactive"&&s!=="sync"||this.ctx.eventHub.emit(Ne.interactiveSeqAction,{action:o,seqId:this.json.ctn.id}),s!=="sync"&&s!=="local"||this.globalEventHub.emit(o)};i.interactiveContainer.on("pointerdown",r),this.interactiveListeners.push([i,r])}}}})}setCurrentStep(t,e){this.isInteractiveSeq&&this.commonTimeNode.applyCount===0&&(this.commonTimeNode.applyCount=1);let i=t;this.commonTimeNode.seekToStart();const{length:r}=this.commonTimeNode.children;if(i===-1&&(i=r-1),i>=0&&i<r)for(let o=0;o<=i;o++){const s=this.commonTimeNode.children[o];o!==i?s.commonTimeNode.seekToEnd(!1,!0):e==="start"?s.commonTimeNode.seekToStart():e==="end"&&s.commonTimeNode.seekToEnd(!1,!0)}this.currentSeqIndex=i,this.currentSeqState=e==="start"?"idle":"end"}}function Fs(n,t,e){const i=t.split(".");i.reduce((r,o,s)=>{if(r)return s!==i.length-1?r[o]:void(r[o]=e);console.warn(`${n} not support ${t}`)},n)}function pg(n,t){return t?t.split(".").reduce((e,i)=>{if(e)return e[i];console.warn(`${n} not support ${t}`)},n):null}class xl{constructor(t){this.timingTarget=null,this.runtimeNodeEventHub=new C.a,this.basicOnTimeNodeEnd=()=>{if(this.isConflict){const{target:p}=this.json.cBhvr,m=this.getTargetId(p);this.ctx.conflictTimeNodeManager.removeRunningTimeNode(m,this.modifyAttrKey)}},this.basicOnTimeLineStart=()=>{if(this.isConflict){const{target:p}=this.json.cBhvr;if(this.activeWhenConflict==="next"){const m=this.getTargetId(p);this.ctx.conflictTimeNodeManager.addRunningTimeNode(m,this.modifyAttrKey,this.commonTimeNode)}else this.activeWhenConflict==="prev"&&this.commonTimeNode.dispose()}};const{isIterate:e,isSub:i,json:r,ctx:o,parent:s,eventHub:a,iterateType:l,iterateIndex:u,iterateId:h,isInInteractiveSeq:d}=t;this.json=r,this.id=r.cBhvr.ctn.id,this.ctx=o,this.globalEventHub=a,this.commonTimeNode=new Ac({json:r.cBhvr.ctn,isSub:i,eventHubs:{global:a,runtime:this.runtimeNodeEventHub},ctx:o,parent:s,isIterate:e,iterateType:l,iterateIndex:u,iterateId:h,isInInteractiveSeq:d}),this.timingTarget=this.ctx.timingTargets.getTarget(r.cBhvr.target,e,{type:l,index:u,id:h}),this.commonTimeNode.on("seekToStart",()=>this.onSeekToStart()),this.commonTimeNode.on("seekToEnd",()=>this.onSeekToEnd()),this.commonTimeNode.on("timelineStart",this.basicOnTimeLineStart),this.commonTimeNode.on("timeNodeEnd",this.basicOnTimeNodeEnd)}getTargetId(t){let e=t.id;return t.type==="shape"&&t.txEl&&(e=`${e}-txEl-${t.txEl.range[0]}`),this.commonTimeNode.isIterate&&(e=`${e}-iterate-${this.commonTimeNode.iterateIndex}`),e}}class FP extends xl{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.startVal=null,this.updateStartValue=()=>{this.timingTarget&&(this.startVal=pg(this.timingTarget,this.json.cBhvr.attrList[0]))},this.onSeekToStart=()=>{const e=this.json.cBhvr.attrList[0];this.startVal!==null&&this.timingTarget&&Fs(this.timingTarget,e,this.startVal)},this.onSeekToEnd=()=>{const e=this.json.cBhvr.attrList[0],i=this.json.cBhvr.to||this.json.to;i&&this.timingTarget&&Fs(this.timingTarget,e,i)},this.commonTimeNode.on("timeNodeStart",this.updateStartValue),this.commonTimeNode.on("timeNodeCreate",this.updateStartValue),this.commonTimeNode.on("timeUpdate",({duration:e,delta:i})=>{if(i/e>=1){const r=this.json.cBhvr.attrList[0];this.json.cBhvr.attrList.length>1&&console.warn("this.json.cBhvr.attrList.length > 0");const o=this.json.cBhvr.to||this.json.to;o&&this.timingTarget&&Fs(this.timingTarget,r,o)}})}get modifyAttrKey(){return this.json.cBhvr.attrList[0]}}var fg=function(n,t,e,i){var r,o=arguments.length,s=o<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(t,e,s):r(t,e))||s);return o>3&&s&&Object.defineProperty(t,e,s),s};class mg{constructor(t,e){this.math={pi:Math.PI,e:Math.E,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,ceil:Math.ceil,cos:Math.cos,cosh:Math.cosh,deg:i=>i/Math.PI*180,exp:Math.exp,floor:Math.floor,ln:Math.log,max:Math.max,min:Math.min,rad:i=>i/180*Math.PI,rand:Math.random,sin:Math.sin,sinh:Math.sinh,sqrt:Math.sqrt,tan:Math.tan,tanh:Math.tanh},this.timingTarget=e,this.val=t.val.value,this.time=t.time,t.fmla&&(this.fmla=this.parseFmla(t.fmla))}parseFmla(t){let e=t.replace(/#ppt_h/g,`(${this.timingTarget.design_ppt_h})`);return e=e.replace(/#ppt_w/g,`(${this.timingTarget.design_ppt_w})`),e=e.replace(/#ppt_x/g,`(${this.timingTarget.design_ppt_x})`),e=e.replace(/#ppt_y/g,`(${this.timingTarget.design_ppt_y})`),e=e.replace(/ppt_w/g,"vars.ppt_w"),e=e.replace(/ppt_h/g,"vars.ppt_h"),e=e.replace(/ppt_x/g,"vars.ppt_x"),e=e.replace(/ppt_y/g,"vars.ppt_y"),e=e.replace(/#/g,"vars."),["abs","acos","asin","atan","ceil","cos","cosh","deg","exp","floor","ln","max","min","rad","rand","sin","sinh","sqrt","tan","tanh","pi","e"].forEach(i=>{const r=new RegExp(`([^a-z])${i}([^a-z])`,"g");e=e.replace(r,(o,s,a)=>`${s}math.${i}${a}`)}),new Function("vars","math","$","return "+e)}}class Qw extends mg{constructor(t,e,i){super(t,e),this.value=t.val.value,i&&(this.fmla=this.parseFmla(i))}resolveValue(){return this.value}interpolationFrom(t,e,i){const r=t.resolveValue(i),o=r+(this.resolveValue()-r)*e;return t.fmla?t.fmla(i,this.math,o):o}}fg([ng()],Qw.prototype,"interpolationFrom",null);class tS extends mg{constructor(t,e){var i;super(t,e),this.value=(i=t.val)===null||i===void 0?void 0:i.value}interpolationFrom(t,e,i){let r=t.resolveValue(i);return e>this.time&&(r=this.resolveValue()),r}resolveValue(){return this.value||""}}fg([ng()],tS.prototype,"interpolationFrom",null);class Mc extends mg{constructor(t,e){super(t,e),this.fn=this.parseFmla(this.val)}resolveValue(t){return this.fn(t,this.math,1)}interpolationFrom(t,e,i){const r=t.resolveValue(i),o=r+(this.resolveValue(i)-r)*e;return t.fmla?t.fmla(i,this.math,o):o}}fg([ng()],Mc.prototype,"interpolationFrom",null);class eS extends mg{constructor(t,e){super(t,e),this.value=t.val.value}interpolationFrom(t,e){return mp(t.resolveValue(),this.value,e)}resolveValue(){return this.value}}fg([ng()],eS.prototype,"interpolationFrom",null);class BP extends xl{constructor(t){super(t),this.isConflict=!0,this.activeWhenConflict="next",this.startVal=null,this.vars={ppt_x:0,ppt_y:0,ppt_w:0,ppt_h:0},this.keyFrames=[],this.isColorAnim=!1,this.onTimeNodeStart=()=>{this.timingTarget&&(this.startVal=pg(this.timingTarget,this.json.cBhvr.attrList[0]))},this.updateVars=()=>{var e,i,r,o;!((e=this.timingTarget)===null||e===void 0)&&e.ppt_h&&(this.vars.ppt_h=this.timingTarget.ppt_h),!((i=this.timingTarget)===null||i===void 0)&&i.ppt_w&&(this.vars.ppt_w=this.timingTarget.ppt_w),!((r=this.timingTarget)===null||r===void 0)&&r.ppt_x&&(this.vars.ppt_x=this.timingTarget.ppt_x),!((o=this.timingTarget)===null||o===void 0)&&o.ppt_y&&(this.vars.ppt_y=this.timingTarget.ppt_y),this.isColorAnim},this.onTimeUpdate=({duration:e,delta:i})=>{const r=i/e,o=this.keyFrames.findIndex(p=>r<=p[0]),{attrList:s}=this.json.cBhvr;if(o<0){const p=this.keyFrames[this.keyFrames.length-1];return void(this.timingTarget&&s&&s[0]&&Fs(this.timingTarget,s[0],p[1].resolveValue(this.vars)))}const a=o-1,l=this.keyFrames[o],u=this.keyFrames[a]||l,h=l[0]-u[0]==0?1:(r-u[0])/(l[0]-u[0]),d=l[1].interpolationFrom(u[1],h,this.vars);this.timingTarget&&s&&s[0]&&Fs(this.timingTarget,s[0],d)},this.onSeekToStart=()=>{this.startVal!==null&&this.timingTarget&&Fs(this.timingTarget,this.json.cBhvr.attrList[0],this.startVal)},this.onSeekToEnd=()=>{this.onTimeUpdate({duration:1,delta:1,isReverse:!1})},this.initKeyFrames(),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.commonTimeNode.on("timelineStart",this.updateVars),this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart)}get modifyAttrKey(){return this.json.cBhvr.attrList[0]}initKeyFrames(){var t;const{valueType:e}=this.json;if(this.json.tavLst.length<=0){if(this.json.to){if(this.json.from||this.startVal){const r={time:0,val:{type:"string",value:this.json.from||this.startVal.toString()},fmla:""};if(e==="num"&&this.timingTarget){const o=new Mc(r,this.timingTarget);this.keyFrames.push([r.time,o])}}const i={time:1,val:{type:"string",value:this.json.to},fmla:""};if(e==="num"&&this.timingTarget){const r=new Mc(i,this.timingTarget);this.keyFrames.push([i.time,r])}}else if(this.json.by){const i={time:0,val:{type:"string",value:this.json.cBhvr.attrList[0]},fmla:""};if(e==="num"&&this.timingTarget){const o=new Mc(i,this.timingTarget);this.keyFrames.push([i.time,o])}const r={time:1,val:{type:"string",value:(((t=i.val)===null||t===void 0?void 0:t.value)||"")+"+"+this.json.by},fmla:""};if(e==="num"&&this.timingTarget){const o=new Mc(r,this.timingTarget);this.keyFrames.push([r.time,o])}}}if(this.json.tavLst.length>0){for(const i of this.json.tavLst)if(i.val&&this.timingTarget){let r=null;i.val.type==="string"?e==="num"?r=new Mc(i,this.timingTarget):e==="str"&&(r=new tS(i,this.timingTarget)):i.val.type==="number"?r=new Qw(i,this.timingTarget):i.val.type==="color"?(this.isColorAnim=!0,r=new eS(i,this.timingTarget)):i.val.type==="boolean"&&console.warn("not implements"),r&&this.keyFrames.push([i.time,r])}}}}var kP=v(50),UP=v.n(kP),GP=v(51),HP=v.n(GP);class zP extends Nr{constructor(){super(HP.a,UP.a,{percent:0,direction:1,transition:0})}set transition(t){this.uniforms.transition=t}set percent(t){this.uniforms.percent=t}set direction(t){this.uniforms.direction=t}}var jP=v(52),VP=v.n(jP);class WP extends Nr{constructor(){super(void 0,VP.a,{percent:0,transition:1})}set transition(t){this.uniforms.transition=Math.pow(t,t)}set percent(t){this.uniforms.percent=t}}class XP extends xl{constructor(t){var e;super(t),this.filterType="",this.isConflict=!0,this.activeWhenConflict="prev",this.onTimeUpdate=({duration:o,delta:s})=>{const a=s/o;this.filter&&(this.filter.percent=this.commonTimeNode.applyTimeFilter(a)),a>=1&&this.timingTarget&&this.ctx.clock.setTimeout(()=>{this.timingTarget&&(this.timingTarget.container.filters=[])})},this.onSeekToStart=()=>{this.timingTarget&&(this.timingTarget.container.filters=[])},this.onSeekToEnd=()=>{this.timingTarget&&(this.timingTarget.container.filters=[])},this.commonTimeNode.on("timelineStart",()=>{this.filter&&this.timingTarget&&(this.timingTarget.container.filters=[this.filter])}),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate);let i=0;t.json.transition==="out"?i=-1:t.json.transition==="in"&&(i=1);const r=(e=t.json.filter)===null||e===void 0?void 0:e.match(/^([a-zA-Z]+)(\((.+)\))?/);if(r){const o=r[1],s=r[3];if(o==="wipe"){const a=new zP;s==="up"?a.direction=1:s==="down"?a.direction=2:s==="left"?a.direction=3:s==="right"&&(a.direction=4),this.filter=a,this.filterType=`${o}-${s}`}else if(o==="fade"){const a=new WP;this.filter=a,this.filterType=""+o}this.filter&&(this.filter.transition=i)}}get modifyAttrKey(){return this.filterType}}class qP extends xl{constructor(t){super(t),this.isConflict=!0,this.activeWhenConflict="next",this.startPos=null,this.onTimeNodeStart=()=>{var e,i;this.startPos={x:((e=this.timingTarget)===null||e===void 0?void 0:e.ppt_x)||0,y:((i=this.timingTarget)===null||i===void 0?void 0:i.ppt_y)||0}},this.onTimeUpdate=({duration:e,delta:i})=>{var r;const o=i/e,s=(r=this.path)===null||r===void 0?void 0:r.getPoint(o);this.timingTarget&&s&&(this.timingTarget.ppt_x=s.x+this.timingTarget.design_ppt_x,this.timingTarget.ppt_y=s.y+ +this.timingTarget.design_ppt_y)},this.onSeekToStart=()=>{this.timingTarget&&this.startPos&&(this.timingTarget.ppt_x=this.startPos.x,this.timingTarget.ppt_y=this.startPos.y)},this.onSeekToEnd=()=>{var e,i,r;const o=(i=(e=this.commonTimeNode.json)===null||e===void 0?void 0:e.spd)!==null&&i!==void 0?i:1,s=(r=this.path)===null||r===void 0?void 0:r.getPoint(o>0?1:0);this.timingTarget&&s&&(this.timingTarget.ppt_x=s.x+this.timingTarget.design_ppt_x,this.timingTarget.ppt_y=s.y+this.timingTarget.design_ppt_y)},this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.createPath()}get modifyAttrKey(){return"motion"}createPath(){var t;const e=new mu,i=(t=this.json.path)===null||t===void 0?void 0:t.match(/[MLCmlc][^MLCmlc]+/g);if(i)for(const r of i){const[o,...s]=r.trim().replace(/\s+/g," ").split(" ");if(o==="M"){const[a,l]=s.map(u=>Number(u));e.moveTo(a,l)}else if(o==="L"){const[a,l]=s.map(u=>Number(u));e.lineTo(a,l)}else if(o==="C"){const[a,l,u,h,d,p]=s.map(m=>Number(m));e.bezierCurveTo(a,l,u,h,d,p)}else if(o==="Z")e.closePath();else if(o==="E")console.warn("not implements");else if(o==="c"){const[a,l,u,h,d,p]=s.map(g=>Number(g)),m=e.currentPoint;e.bezierCurveTo(a+m.x,l+m.y,u+m.x,h+m.y,d+m.x,p+m.y)}else if(o==="l"){const a=e.currentPoint,[l,u]=s.map(h=>Number(h));e.lineTo(l+a.x,u+a.y)}else if(o==="m"){const a=e.currentPoint,[l,u]=s.map(h=>Number(h));e.moveTo(l+a.x,u+a.y)}}this.path=e}}class YP extends xl{constructor(t){super(t),this.isConflict=!0,this.activeWhenConflict="next",this.startVal=null,this.onTimelineStart=e=>{e.isReverse||this.updateCurrentValue()},this.onTimeUpdate=({duration:e,delta:i})=>{var r,o,s,a,l;const u=i/e,h={x:1,y:1};if(this.to){const d=(r=this.from)!==null&&r!==void 0?r:{x:(s=(o=this.startVal)===null||o===void 0?void 0:o.x)!==null&&s!==void 0?s:1,y:(l=(a=this.startVal)===null||a===void 0?void 0:a.y)!==null&&l!==void 0?l:1};h.x=d.x+(this.to.x-d.x)*u,h.y=d.y+(this.to.y-d.y)*u}else if(this.by){const d={x:this.by.x,y:this.by.y};h.x=1+(d.x-1)*u,h.y=1+(d.y-1)*u}this.timingTarget&&(this.timingTarget.scale=h)},this.onTimeNodeStart=()=>{this.timingTarget&&(this.startVal={x:this.timingTarget.scale.x,y:this.timingTarget.scale.y})},this.onSeekToStart=()=>{this.timingTarget&&this.startVal&&(this.timingTarget.scale=this.startVal)},this.onSeekToEnd=()=>{this.onTimeUpdate({duration:1,delta:1,isReverse:!1})},this.from=t.json.from,this.to=t.json.to,this.by=t.json.by,this.commonTimeNode.on("timelineStart",this.onTimelineStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart)}get modifyAttrKey(){return"scale"}updateCurrentValue(){this.timingTarget&&(this.current={x:this.timingTarget.scale.x,y:this.timingTarget.scale.y})}}class $P extends xl{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.isTimelineStart=!1,this.startColorString=null,this.currentColorString="#FFFFFFFF",this.onTimelineStart=e=>{if(this.isTimelineStart)return;this.isTimelineStart=!0,e.isReverse||this.updateCurrentValue(),this.from.isInit()||this.from.fromHexString(this.currentColorString),this.to.isInit()||this.from.by(this.by,this.to);const[i]=this.json.cBhvr.attrList[0].split(".");Fs(this.timingTarget,i+".on","true")},this.onTimeNodeEnd=()=>{if(this.json.cBhvr.ctn.fill==="remove"){const[e]=this.json.cBhvr.attrList[0].split(".");Fs(this.timingTarget,e+".on","false")}this.isTimelineStart=!1},this.onSeekToStart=()=>{var e;if(this.timingTarget&&(this.onTimeUpdate({duration:1,delta:0}),((e=this.timingTarget.fill)===null||e===void 0?void 0:e.designColor.toUpperCase())===this.from.toHexString().toUpperCase())){const[i]=this.json.cBhvr.attrList[0].split(".");Fs(this.timingTarget,i+".on","false")}},this.onTimeNodeStart=()=>{if(this.timingTarget){const e=pg(this.timingTarget,this.json.cBhvr.attrList[0]);e&&(this.startColorString=e)}},this.onTimeUpdate=({delta:e,duration:i})=>{const r=e/i;this.to.interpolationFrom(this.from,r,this.target),this.timingTarget&&Fs(this.timingTarget,this.json.cBhvr.attrList[0],this.target.toHexString())},this.onSeekToEnd=()=>{this.isTimelineStart||this.onTimelineStart({isReverse:!1,activeCount:0,id:""}),this.onTimeUpdate({duration:1,delta:1})},this.json.clrSpc==="rgb"?(this.from=new lg(this.json.from),this.to=new lg(this.json.to),this.by=new lg(this.json.by),this.target=new lg):(this.from=new ag(this.json.from),this.to=new ag(this.json.to),this.by=new ag(this.json.by),this.target=new ag),this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.commonTimeNode.on("timelineStart",this.onTimelineStart),this.commonTimeNode.on("timeNodeEnd",this.onTimeNodeEnd),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate)}get modifyAttrKey(){return this.json.cBhvr.attrList[0]}updateCurrentValue(){if(this.timingTarget){const t=pg(this.timingTarget,this.json.cBhvr.attrList[0]);t&&(this.currentColorString=t)}}}class JP extends xl{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.startVal=null,this.lastVal=null,this.onTimelineStart=e=>{this.lastVal=null,e.isReverse||this.updateCurrentValue()},this.onTimeUpdate=({duration:e,delta:i})=>{const r=i/e;let o=0,s=0;if(this.from!==void 0&&this.to!==void 0){o=this.from,s=this.to;const a=o+(s-o)*r;this.timingTarget&&(this.timingTarget.r=a)}else if(this.by!==void 0){this.lastVal||(this.lastVal=0);const a=this.by*r-this.lastVal;this.lastVal=this.by*r,this.timingTarget&&(this.timingTarget.r+=a)}},this.onTimeNodeStart=()=>{var e;Object(V.isNumber)((e=this.timingTarget)===null||e===void 0?void 0:e.r)&&(this.startVal=this.timingTarget.r)},this.onSeekToStart=()=>{this.timingTarget&&this.startVal!==null&&(this.timingTarget.r=this.startVal)},this.onSeekToEnd=()=>{this.onTimeUpdate({duration:1,delta:1,isReverse:!1})},this.from=this.json.from,this.to=this.json.to,this.by=this.json.by,this.by?this.isConflict=!1:this.isConflict=!0,this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.commonTimeNode.on("timelineStart",this.onTimelineStart),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate)}get modifyAttrKey(){return"rotate"}updateCurrentValue(){var t;this.currentVal=(t=this.timingTarget)===null||t===void 0?void 0:t.r}}class ZP extends xl{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.isApplied=!1,this.onTimeUpdate=()=>{var e,i;const{cmd:r,cmdType:o}=this.json;!this.isApplied&&r&&o&&(this.isApplied=!0,(i=(e=this.timingTarget)===null||e===void 0?void 0:e.cmd)===null||i===void 0||i.applyCommand(r,o))},this.onSeekToStart=()=>{var e,i;(i=(e=this.timingTarget)===null||e===void 0?void 0:e.cmd)===null||i===void 0||i.applyCommand("custom-pause","call")},this.onSeekToEnd=()=>{},this.commonTimeNode.on("timeNodeStart",()=>{this.isApplied=!1}),this.commonTimeNode.on("timeNodeEnd",()=>{this.isApplied=!1}),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.commonTimeNode.on("seekToStart",this.onSeekToStart),this.commonTimeNode.on("seekToEnd",this.onSeekToEnd)}get modifyAttrKey(){var t,e,i,r;return((e=(t=this.json)===null||t===void 0?void 0:t.cmd)!==null&&e!==void 0?e:"")+((r=(i=this.json)===null||i===void 0?void 0:i.cmdType)!==null&&r!==void 0?r:"")}}class KP{constructor(t){this.runtimeNodeEventHub=new C.a,this.stopAudio=()=>{this.audio.stop()},this.destroy=()=>{this.stopAudio(),this.audio.destroy(),this.ctx.activeMedia.delete(this.audio)};const{json:e,isIterate:i,isSub:r,eventHub:o,ctx:s,parent:a,iterateType:l,iterateIndex:u,iterateId:h,isInInteractiveSeq:d}=t;this.json=e,this.id=e.cMediaNode.ctn.id,this.commonTimeNode=new Ac({json:e.cMediaNode.ctn,isSub:r,eventHubs:{global:o,runtime:this.runtimeNodeEventHub},ctx:s,parent:a,isIterate:i,iterateType:l,iterateIndex:u,iterateId:h,isInInteractiveSeq:d});let p=e.cMediaNode.tgtEl;s.loaderDelegate&&(p=s.loaderDelegate.redirectMedia(p),s.logger.info(`redirect media url from ${e.cMediaNode.tgtEl} to ${p} by delegate.`,s.taskId)),this.audio=new __(p,s.runningAudio),s.activeMedia.add(this.audio),this.commonTimeNode.on("timelineStart",()=>{this.audio.play()}),this.commonTimeNode.on("seekToStart",this.stopAudio),this.commonTimeNode.on("seekToEnd",this.stopAudio),this.commonTimeNode.on("timeNodeDestroy",this.destroy),this.ctx=s}}var QP=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};class Ac extends C.a{constructor(t){var e,i;super(),this.uuid=Date.now().toString(32)+Math.random().toString(32).substring(2),this.isSub=!1,this.isShadow=!1,this.startCount=0,this.applyCount=0,this.isReverse=!1,this.isConflictDispose=!1,this.isIterateEnd=!1,this.parentTimeNode=null,this.isActive=!1,this.isDestroy=!1,this.shouldSeekOnStart=!1,this.repeatTimeoutId="",this.iterateShadows=[],this.isEndEventsEmitted=!1,this.tmFilter=[],this.timeDelta=0,this.isIterate=!1,this.iterateType="el",this.iterateIndex=0,this.children=[],this.subList=[],this.duration=0,this.isNegativeSpeed=!1,this.handleEndCond=()=>{this.isActive&&(this.isActive=!1,this.isInfiniteRepeat()?this.repeatTimeNodeEnd():this.seekToEnd(!1,!0))},this.handleActive=(y=!0)=>{if(this.isActive=!0,this.isConflictDispose=!1,this.applyCount+=1,this.json.iterate||this.emit("timeNodeStart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.startCount>0&&this.json.restart){if(this.json.restart==="never")return;this.json.restart!=="whenNotActive"&&this.json.restart!=="always"||(this.seekToStart(),this.emit("timeNodeRestart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.startTimeLine(y))}else this.startTimeLine(y)},this.updateTimeLine=y=>{const w=y/(We.TARGET_FPMS||.06);this.timeDelta+=w,this.duration-this.timeDelta<=w&&(this.timeDelta=this.duration),this.timeDelta<this.duration?this.emit("timeUpdate",{delta:this.isReverse||this.isNegativeSpeed?this.duration-this.timeDelta:this.timeDelta,duration:this.duration,isReverse:this.isReverse}):(this.emit("timeUpdate",{delta:this.isReverse||this.isNegativeSpeed?0:this.duration,duration:this.duration,isReverse:this.isReverse}),this.onTimeLineEnd())},this.handleEnd=(y=!1)=>{(this.isTimeNodeEnd()||y)&&(this.isActive=!1,this.isSub&&this.destroy(),this.emitEndEvents())};const{isSub:r,isIterate:o,ctx:s,eventHubs:a,parent:l,json:u,iterateType:h,iterateId:d,iterateIndex:p,isInInteractiveSeq:m}=t;this.isSub=r,this.isInInteractiveSeq=m,this.isIterate=o,this.parentTimeNode=l,this.json=u,this.ctx=s,this.iterateIndex=p,this.eventHubs=a,this.iterateType=h,this.iterateId=d,this.tmFilter=(i=(e=u.tmFilter)===null||e===void 0?void 0:e.split(";").map(y=>y.split(",").map(w=>parseFloat(w.trim()))))!==null&&i!==void 0?i:[];const g=Number(this.json.dur),_=this.json.spd||1;this.isNegativeSpeed=_<0,Number.isNaN(g)||(this.duration=g/Math.abs(_)),this.uuid+="--"+this.json.id,this.setPreStyle(),u.childTnLst&&this.createChildren(u.childTnLst),this.startConds=new xp(this.json.id||"",u.stCondLst,a,this.ctx),this.endConds=new xp(this.json.id||"",u.endCondLst,a,this.ctx),u.endSync&&(this.endSync=new xp(this.json.id||"",[u.endSync],a,this.ctx),this.endSync.on("active",()=>{var y;this.json.nodeType==="interactiveSeq"&&(this.isActive=!1,this.shouldSeekOnStart=!0,this.emit("timeNodeEndSync"),(y=this.endSync)===null||y===void 0||y.reset())})),this.startConds.on("active",y=>{this.isActive||(this.shouldSeekOnStart&&(this.shouldSeekOnStart=!1,this.seekToStart()),this.handleActive(y))}),this.endConds.on("active",()=>{this.handleEndCond(),this.children.forEach(y=>y.commonTimeNode.handleEndCond())}),this.parentTimeNode&&this.parentTimeNode.on("timeNodeStart",()=>{this.applyCount=0}),this.isSub&&this.json.masterRel==="nextClick"&&this.startConds.addCond({event:"shape slide onNext"}),this.json.iterate&&this.isIterate===!1&&this.createIterateShadow()}createIterateShadow(){const t=fp();let e=!0,i=0;const r=o=>{o===t&&(e=!1,this.ctx.eventHub.removeListener("IterateTimeNodeEnd",r))};for(this.ctx.eventHub.on("IterateTimeNodeEnd",r);e;){const o=JSON.parse(JSON.stringify(this.json)),s=new Ac({json:o,isSub:!1,eventHubs:this.eventHubs,ctx:this.ctx,parent:null,isIterate:!0,iterateType:o.iterate.type,iterateIndex:i,iterateId:t,isInInteractiveSeq:this.isInInteractiveSeq});this.iterateShadows[i]=s,i+=1}}isInfiniteRepeat(){return this.json.repeatCount>999999998}getReverse(){return this.isReverse}setReverse(t){this.isReverse=t}createTimeNode(t,e){let i=null;const r={json:t,isSub:e,isIterate:this.isIterate,eventHub:this.eventHubs.global,ctx:this.ctx,parent:this,iterateType:this.iterateType,iterateIndex:this.iterateIndex,iterateId:this.iterateId,isInInteractiveSeq:this.isInInteractiveSeq};return t.type==="seq"?i=new DP(r):t.type==="par"?i=new iS(r):t.type==="set"?i=new FP(r):t.type==="anim"?i=new BP(r):t.type==="animEffect"?i=new XP(r):t.type==="animMotion"?i=new qP(r):t.type==="animScale"?i=new YP(r):t.type==="animClr"?i=new $P(r):t.type==="animRot"?i=new JP(r):t.type==="cmd"?i=new ZP(r):t.type==="audio"&&(i=new KP(r)),i}createSubList(t){this.subList=[],t.forEach(e=>{const i=this.createTimeNode(e,!0);i&&this.subList.push(i)})}bindCommonTimeNodeEvent(t){t.commonTimeNode.on("timeNodeStart",e=>{this.emit("childTimeNodeStart",e)}),t.commonTimeNode.on("timeNodeEnd",e=>{this.emit("childTimeNodeEnd",e),this.children.every(i=>i.commonTimeNode.isTimeNodeEndWhenDetectEndSync())&&(this.json.iterate||this.allChildrenEndHandle())})}createChildren(t){function e(i){return(r=i,function(o){var s;return!!(!((s=o)===null||s===void 0)&&s.cBhvr)}(r)?r.cBhvr.ctn:function(o){var s,a;return!!(!((a=(s=o)===null||s===void 0?void 0:s.cMediaNode)===null||a===void 0)&&a.ctn)}(r)?r.cMediaNode.ctn:r.ctn).presetOrder;var r}t&&t[0]&&e(t[0])?[...t].sort((i,r)=>{var o,s;return((o=e(i))!==null&&o!==void 0?o:0)-((s=e(r))!==null&&s!==void 0?s:0)}).forEach(i=>{const r=t.findIndex(s=>s===i),o=this.createTimeNode(i,!1);o&&(this.bindCommonTimeNodeEvent(o),this.children[r]=o)}):t.forEach(i=>{const r=this.createTimeNode(i,!1);r&&(this.bindCommonTimeNodeEvent(r),this.children.push(r))})}playReverse(){this.isReverse=!0,this.startReverseTimeLine(),this.children.forEach(t=>t.commonTimeNode.playReverse())}allChildrenEndHandle(){if(!this.isDestroy){if(this.json.autoRev&&!this.isReverse)return this.isReverse=!0,void this.playReverse();this.isReverse&&(this.isReverse=!1),this.json.repeatCount&&this.json.repeatCount>this.applyCount?this.repeatTimeoutId=this.ctx.clock.setTimeout(()=>{this.seekToStart(!1),this.resetForRepeat(),this.startTimeNodeRepeat()}):(this.json.iterate&&!this.isIterate&&(this.isIterateEnd=!0),this.eventHubs.runtime.emit("runtime all end"),this.startSubList(),this.handleEnd())}}resetForRepeat(){this.isInInteractiveSeq&&this.isInfiniteRepeat()&&this.repeatTimeNodeEnd(),this.timeDelta=0,this.children.forEach(t=>t.commonTimeNode.resetForRepeat())}startSubList(){this.subList.forEach(t=>t.commonTimeNode.startTimeNode())}startReverseTimeLine(){this.isEndEventsEmitted=!1,this.timeDelta=0;const t=1e3/this.ctx.ticker.maxFPS;this.duration<=t&&this.duration>0?(this.emit("timeUpdate",{delta:this.duration,duration:this.duration,isReverse:this.isReverse}),this.ctx.eventHub.emit(Ne.animateEnd),this.ctx.ticker.remove(this.updateTimeLine)):this.duration>t&&(this.ctx.eventHub.emit(Ne.animateStart),this.ctx.ticker.add(this.updateTimeLine))}startTimeLine(t=!0){if(t&&(this.isEndEventsEmitted=!1,this.eventHubs.global.emit(`time ${this.json.id} begin`),this.eventHubs.global.emit(`time ${this.json.id} onBegin`),this.eventHubs.runtime.emit(`runtime ${this.json.id} begin`)),this.json.iterate)return void this.startIterate();this.timeDelta=0,this.emit("timelineStart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse});const e=1e3/this.ctx.ticker.maxFPS;this.duration<=e&&this.duration>0?(this.timeDelta=this.isReverse?0:this.duration,this.emit("timeUpdate",{delta:this.timeDelta,duration:this.duration,isReverse:this.isReverse}),this.emit("timelineEnd",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.ctx.ticker.addOnce(()=>{this.onTimeLineEnd()})):this.duration>e&&(this.ctx.eventHub.emit(Ne.animateStart),this.updateTimeLine(0),this.ctx.ticker.add(this.updateTimeLine))}startIterate(){return QP(this,void 0,void 0,function*(){if(this.json.iterate){this.isIterateEnd=!1;for(const t of this.iterateShadows){if(this.isIterateEnd)break;t.children.forEach(e=>{e.commonTimeNode.startTimeNode()}),t.applyCount+=1,yield this.ctx.clock.delay(this.json.iterate.interval)}this.onTimeLineEnd()}})}applyTimeFilter(t){if(!this.tmFilter.every(e=>Object(V.isNumber)(e[0])&&Object(V.isNumber)(e[1])))return t;for(let e=0;e<this.tmFilter.length;e++){const i=this.tmFilter[e];if(t<i[0]){const r=this.tmFilter[e-1];return(t-r[0])/(i[0]-r[0])*(i[1]-r[1])+r[1]}}return this.tmFilter.length>0?this.tmFilter[this.tmFilter.length-1][1]:t}isNatureTimeEnd(){return this.duration>=0&&this.timeDelta>=this.duration}findTargets(){const t=[],e=i=>{i.forEach(r=>{var o,s,a;r.cBhvr&&r.cBhvr.target&&t.findIndex(l=>l.id===r.cBhvr.target.id)<0&&t.push(r.cBhvr.target),((s=(o=r==null?void 0:r.cBhvr)===null||o===void 0?void 0:o.ctn)===null||s===void 0?void 0:s.childTnLst)&&r.cBhvr.ctn.childTnLst.length>0&&e(r.cBhvr.ctn.childTnLst),((a=r==null?void 0:r.ctn)===null||a===void 0?void 0:a.childTnLst)&&r.ctn.childTnLst.length>0&&e(r.ctn.childTnLst)})};return e(this.json.childTnLst||[]),t}setPreStyle(){this.json.presetClass&&this.findTargets().forEach(t=>{if(this.json.iterate){let e=0,i=!0;for(;i;){const r=this.ctx.timingTargets.getTarget(t,!0,{type:this.json.iterate.type,index:e,id:""});r&&(this.setPreStyleForTarget(r),e+=1),i=!!r}}else{const e=this.ctx.timingTargets.getTarget(t,!1);e&&this.setPreStyleForTarget(e)}})}setPreStyleForTarget(t){var e,i;if(t&&this.json.presetSubtype&&(t.presetSubType=this.json.presetSubtype),t&&!t.hasPreset)if(this.json.presetClass==="entr"){const r=(i=(e=this.json)===null||e===void 0?void 0:e.childTnLst)===null||i===void 0?void 0:i.filter(o=>o.type==="set"&&o.to==="visible");r!=null&&r.length&&(t.hasPreset=!0,t.style.visibility="hidden")}else(this.json.presetClass==="exit"||this.json.presetClass==="path")&&(t.hasPreset=!0,t.style.visibility="visible")}startTimeNodeRepeat(){this.timeDelta=0,this.isActive=!0,this.applyCount+=1,this.startTimeLine(!1),this.json.iterate||this.emit("timeNodeRepeat",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse})}startTimeNodeForce(){this.json.subTnLst&&this.createSubList(this.json.subTnLst),this.timeDelta=0,this.isActive=!0,this.handleActive(!1)}startTimeNode(t=!0){if(this.isDestroy)return;this.collectStartValue(),this.timeDelta=0,this.isReverse=!1,this.json.subTnLst&&this.createSubList(this.json.subTnLst),this.startConds.setTriggerParams(t);const e=this.json.stCondLst.filter(r=>/^self/.test(r.event||""))[0];e&&this.startConds.condHandle(e);const i=this.json.endCondLst.filter(r=>/^self/.test(r.event||""))[0];i&&this.endConds.condHandle(i),this.startConds.condHandle()}onTimeLineEnd(){this.dispose(),(this.children.length===0||this.json.iterate)&&this.allChildrenEndHandle()}clearSubList(){this.subList.forEach(t=>t.commonTimeNode.destroy())}seekToStart(t=!0){if(this.isEndEventsEmitted=!1,this.isActive=!1,this.dispose(),this.timeDelta=0,this.emit("seekToStart"),this.json.iterate&&!this.isIterate)return this.isIterateEnd=!0,void this.iterateShadows.forEach(e=>e.seekToStart(t));if(t)for(let e=this.subList.length-1;e>=0;e--){const i=this.subList[e];i==null||i.commonTimeNode.seekToStart()}for(let e=this.children.length-1;e>=0;e--){const i=this.children[e];i==null||i.commonTimeNode.seekToStart()}for(let e=this.children.length-1;e>=0;e--){const i=this.children[e];i==null||i.commonTimeNode.seekToStart()}}repeatTimeNodeEnd(){this.dispose(),this.children.forEach(t=>{t.commonTimeNode.isActive=!1,t.commonTimeNode.dispose()})}dispose(t=!1){this.isConflictDispose=t,this.ctx.clock.clearTimeout(this.repeatTimeoutId),this.ctx.eventHub.emit(Ne.animateEnd);try{this.ctx.ticker.remove(this.updateTimeLine)}catch{}this.startConds.reset(),this.endConds.reset()}seekToEnd(t,e=!1){if(this.isInfiniteRepeat())return;!this.isActive&&this.applyCount<=0&&this.collectStartValue(),this.applyCount=this.json.repeatCount,this.json.autoRev&&(this.isReverse=!0),this.timeDelta=this.duration,this.isActive=!1,this.dispose();const i=this.json.autoRev||t;if(i?this.emit("seekToStart"):this.emit("seekToEnd"),this.json.iterate&&!this.isIterate)return this.isIterateEnd=!0,void this.iterateShadows.forEach(r=>r.seekToEnd(i,e));this.children.length===0&&(this.eventHubs.runtime.emit("runtime all end"),this.handleEnd()),this.children.forEach(r=>r.commonTimeNode.seekToEnd(i,e)),e&&this.json.subTnLst&&(this.subList.length<=0&&this.createSubList(this.json.subTnLst),this.subList.forEach(r=>r.commonTimeNode.seekToEnd(!1)),this.clearSubList())}isTimeNodeEndWhenDetectEndSync(){if(this.isInInteractiveSeq&&this.isInfiniteRepeat())return!0;let t=!0;return this.children.length>0&&(t=t&&this.children.every(e=>e.commonTimeNode.isTimeNodeEndWhenDetectEndSync())),this.json.repeatCount&&(t=t&&this.applyCount>=this.json.repeatCount),this.json.autoRev&&(t=t&&!this.isReverse),t=t&&this.isNatureTimeEnd(),!!this.isConflictDispose||!(!this.isIterateEnd||!this.json.iterate)||t}isTimeNodeEnd(){let t=!0;return this.children.length>0&&(t=t&&this.children.every(e=>e.commonTimeNode.isTimeNodeEnd())),this.json.repeatCount&&(t=t&&this.applyCount>=this.json.repeatCount),this.json.autoRev&&(t=t&&!this.isReverse),t=t&&this.isNatureTimeEnd(),!!this.isConflictDispose||!(!this.isIterateEnd||!this.json.iterate)||t}emitEndEvents(){this.isEndEventsEmitted||(this.isEndEventsEmitted=!0,this.eventHubs.global.emit(`time ${this.json.id} end`),this.eventHubs.global.emit(`time ${this.json.id} onEnd`),this.eventHubs.runtime.emit(`runtime ${this.json.id} end`),this.emit("timeNodeEnd",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}))}collectStartValue(){this.emit("timeNodeCreate"),this.children.forEach(t=>t.commonTimeNode.collectStartValue())}destroy(){this.emit("timeNodeDestroy"),this.isDestroy=!0,this.dispose(),this.startConds.removeAllListeners(),this.endConds.removeAllListeners(),this.children.forEach(t=>t.commonTimeNode.destroy()),this.clearSubList()}}class iS extends C.a{constructor(t){super(),this.isRunning=!1,this.runtimeNodeEventHub=new C.a;const{json:e,iterateType:i,isIterate:r,isSub:o,parent:s,ctx:a,eventHub:l,iterateIndex:u,iterateId:h,isInInteractiveSeq:d}=t;this.id=e.ctn.id,this.json=e,this.ctx=a,this.isIterate=r,this.globalEventHub=l,this.commonTimeNode=new Ac({json:e.ctn,isSub:o,eventHubs:{global:l,runtime:this.runtimeNodeEventHub},ctx:a,parent:s,isIterate:!1,iterateType:i,iterateIndex:u,iterateId:h,isInInteractiveSeq:d}),this.commonTimeNode.on("timeNodeStart",()=>{this.commonTimeNode.children.forEach(p=>{p.commonTimeNode.setReverse(this.commonTimeNode.getReverse()),p.commonTimeNode.startTimeNode()}),this.isRunning||(this.isRunning=!0,this.globalEventHub.emit(`runtime ${this.id} begin`),this.emit("begin"))}),this.commonTimeNode.on("timeNodeRepeat",()=>{this.commonTimeNode.children.forEach(p=>{p.commonTimeNode.startTimeNode(!1)})}),this.commonTimeNode.on("timeNodeEnd",()=>{this.commonTimeNode.isTimeNodeEnd()&&this.isRunning&&(this.isRunning=!1,this.globalEventHub.emit(`runtime ${this.id} end`),this.emit("end"))})}}var tI=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};class eI{constructor(t,e,i){this.json=t,this.ctx=i,this.globalEventHub=e;const r=t.timeNodeList.find(o=>o.type==="par"&&o.ctn.nodeType==="tmRoot");r&&(this.tmRoot=new iS({json:r,isSub:!1,isIterate:!1,eventHub:e,ctx:i,parent:null,iterateType:"el",iterateIndex:0,iterateId:"",isInInteractiveSeq:!1}),this.mainSeq=this.tmRoot.commonTimeNode.children.find(o=>{var s,a,l;return((s=o.json)===null||s===void 0?void 0:s.type)==="seq"&&((l=(a=o.json)===null||a===void 0?void 0:a.ctn)===null||l===void 0?void 0:l.nodeType)==="mainSeq"}))}findSeq(t){var e;return(e=this.tmRoot)===null||e===void 0?void 0:e.commonTimeNode.children.find(i=>{var r,o,s;return((r=i.json)===null||r===void 0?void 0:r.type)==="seq"&&((s=(o=i.json)===null||o===void 0?void 0:o.ctn)===null||s===void 0?void 0:s.id)===t})}start(){var t,e;return tI(this,void 0,void 0,function*(){this.json.autoPlayMainSeq?(yield this.ctx.clock.delay(16),(t=this.mainSeq)===null||t===void 0||t.commonTimeNode.startTimeNode()):(e=this.mainSeq)===null||e===void 0||e.commonTimeNode.startTimeNode()})}setMainSeqApplied(){this.mainSeq&&(this.mainSeq.commonTimeNode.applyCount=1)}collectMainSeqStartValue(){var t;(t=this.mainSeq)===null||t===void 0||t.commonTimeNode.collectStartValue()}setMainSeqStep(t,e){var i;t===-1&&this.mainSeq&&(this.mainSeq.commonTimeNode.applyCount=1),(i=this.mainSeq)===null||i===void 0||i.setCurrentStep(t,e)}destroy(){var t;this.globalEventHub.removeAllListeners(),(t=this.tmRoot)===null||t===void 0||t.commonTimeNode.destroy()}hasMainSeq(){return!!this.mainSeq&&this.mainSeq.commonTimeNode.children.length>0}currentMainSeqState(){return this.mainSeq?this.mainSeq.currentState:null}currentMainSeqStep(){return this.mainSeq?this.mainSeq.currentStep:0}currentMainSeqLength(){return this.mainSeq?this.mainSeq.stepLength:0}mainSeqHasNextStep(){return!!this.mainSeq&&this.mainSeq.hasNext()}mainSeqHasPrevStep(){return!!this.mainSeq&&this.mainSeq.hasPrev()}seekInteractiveSeqToEnd(t){const e=this.findSeq(t);e&&e.commonTimeNode.seekToEnd(!1,!0)}setInteractiveSeqState(t,e,i){const r=this.findSeq(t);r&&r.setCurrentStep(e,i)}resetAllInteractiveSeq(){var t;(((t=this.tmRoot)===null||t===void 0?void 0:t.commonTimeNode.children.filter(e=>{var i,r,o;return((i=e.json)===null||i===void 0?void 0:i.type)==="seq"&&((o=(r=e.json)===null||r===void 0?void 0:r.ctn)===null||o===void 0?void 0:o.nodeType)==="interactiveSeq"}))||[]).forEach(e=>{e.setCurrentStep(0,"start")})}applyInteractiveAction(t){this.globalEventHub.emit(t)}}var nS=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};class iI extends y_{constructor(t,e,i,r){super({id:"stage",width:t.width,height:t.height,type:"Container",children:t.children},e,i,void 0,r),this.isRendered=!1,this.isTimingStartValueCollected=!1,this.json=t,e.hasBackgroundFillShape=this.detectUseBackgroundFill(this.json),this.container.visible=!1,this.ctx=e;const o=new Ns;o.beginFill(16777215),o.drawRect(0,0,t.width,t.height),o.endFill(),this.container.addChild(o)}detectUseBackgroundFill(t){return!!t&&(t.type==="Picture"||t.type==="Shape"?t.useBgFill:!(!t.children||!Object(V.isArray)(t.children))&&t.children.some(e=>this.detectUseBackgroundFill(e)))}initOnReuse(){super.initOnReuse(),this.ctx.timingEventHub.on("c:prev slide",t=>{this.ctx.eventHub.emit(Ne.requestPrevSlide,t)}),this.ctx.timingEventHub.on("c:next slide",t=>{this.ctx.eventHub.emit(Ne.requestNextSlide,t)})}get interactiveContainer(){return this.container}render(t){this.isRendered||(this.isRendered=!0,super.render(t),t.addSubMTask(()=>nS(this,void 0,void 0,function*(){this.ctx.eventHub.emit("StageRenderEnd")}),"@StageImpl[emit.StageRenderEnd]"))}createTiming(){this.json.timing&&!this.timing&&(this.timing=new eI(this.json.timing,this.ctx.timingEventHub,this.ctx))}startTiming(){var t;return((t=this.timing)===null||t===void 0?void 0:t.start())||Promise.resolve()}setMainSeqApplied(){var t;(t=this.timing)===null||t===void 0||t.setMainSeqApplied()}setMainSeqStep(t,e){var i;(i=this.timing)===null||i===void 0||i.setMainSeqStep(t,e)}collectMainSeqStartValue(){var t;this.isTimingStartValueCollected||(this.isTimingStartValueCollected=!0,(t=this.timing)===null||t===void 0||t.collectMainSeqStartValue())}hasTiming(){return!!this.timing}clearOnSlideChange(){this.ctx.eventHub.removeAllListeners(),this.ctx.timingEventHub.removeAllListeners(),super.clearOnSlideChange()}clearOnTransactionEnd(){var t,e;this.ctx.timingTargets.getTargets().forEach(i=>{i.hasPreset=!1}),(t=this.timing)===null||t===void 0||t.resetAllInteractiveSeq(),(e=this.timing)===null||e===void 0||e.destroy(),this.timing=void 0}destroy(){var t,e;this.isTimingStartValueCollected=!1,this.isRendered=!1,this.ctx.eventHub.removeAllListeners(),this.ctx.graphicsTexture.destroy(),(t=this.ctx.bgTexture)===null||t===void 0||t.destroy(!0),this.ctx.spriteTexture.destroy(),this.ctx.timingEventHub.removeAllListeners(),(e=this.timing)===null||e===void 0||e.destroy(),this.timing=void 0,super.destroy()}mainSeqStep(){var t,e;return(e=(t=this.timing)===null||t===void 0?void 0:t.currentMainSeqStep())!==null&&e!==void 0?e:0}mainSeqLength(){var t,e;return(e=(t=this.timing)===null||t===void 0?void 0:t.currentMainSeqLength())!==null&&e!==void 0?e:0}mainSeqHasNextStep(){var t,e;return(e=(t=this.timing)===null||t===void 0?void 0:t.mainSeqHasNextStep())!==null&&e!==void 0&&e}mainSeqHasPrevStep(){var t,e;return(e=(t=this.timing)===null||t===void 0?void 0:t.mainSeqHasPrevStep())!==null&&e!==void 0&&e}mainSeqState(){return this.timing?this.timing.currentMainSeqState():null}nextStep(t=!1){var e;this.hasTiming()&&((e=this.timing)===null||e===void 0?void 0:e.hasMainSeq())?(this.ctx.timingEventHub.emit("shape slide onStopAudio"),this.ctx.timingEventHub.emit("shape slide onNext",t)):this.ctx.eventHub.emit(Ne.requestNextSlide,t)}prevStep(t=!1){var e;this.hasTiming()&&((e=this.timing)===null||e===void 0?void 0:e.hasMainSeq())?(this.ctx.timingEventHub.emit("shape slide onStopAudio"),this.ctx.timingEventHub.emit("shape slide onPrev",t)):this.ctx.eventHub.emit(Ne.requestPrevSlide,t)}applyInteractiveAction(t){var e;(e=this.timing)===null||e===void 0||e.applyInteractiveAction(t)}seekInteractiveSeqToEnd(t){var e;(e=this.timing)===null||e===void 0||e.seekInteractiveSeqToEnd(t)}setInteractiveSeqState(t,e,i){var r;(r=this.timing)===null||r===void 0||r.setInteractiveSeqState(t,e,i)}setMediaState(t,e){return nS(this,void 0,void 0,function*(){const i=this.ctx.medias[t];i&&(e?yield i.play():yield i.pause())})}setMediaCurrentTime(t,e){const i=this.ctx.medias[t];i&&i.seek(e)}}class nI{constructor(t){this.ticker=t,this.tasks=[],this.couldRunning=!1,this.applyNext=()=>{const e=this.tasks[0];e&&e.applyNext()},t.add(this.applyNext)}addTask(t){this.tasks.push(t),t.once("task-finish",()=>{const e=this.tasks.indexOf(t);e>=0&&this.tasks.splice(e,1)}),t.once("task-error",()=>{const e=this.tasks.indexOf(t);e>=0&&this.tasks.splice(e,1)})}start(){this.couldRunning=!0}stop(){this.couldRunning=!1}}var rI=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};const oI=n=>new Promise(t=>setTimeout(t,n));class sI extends C.a{constructor(t,e,i){super(),this.slideIndex=t,this.taskId=e,this.logger=i,this.uuid=fp(),this.isCancel=!1,this.tasks=[]}addMTask(t,e){this.tasks.push({fn:t,state:"wait",sub:[],name:e})}addSubMTask(t,e){let i=this.tasks.findIndex(r=>r.state==="running");i<0&&(i=0),this.tasks[i].sub.push({fn:t,state:"wait",sub:[],name:e})}cancel(){this.tasks=[],this.isCancel=!0}applyNext(){if(this.tasks.some(e=>e.state==="running")||this.tasks.some(e=>e.state==="error"))return;if(this.tasks.every(e=>e.state==="finish"))return void(this.isCancel||this.emit("task-finish"));const t=this.tasks.find(e=>e.state==="wait");t&&(t.state="running",t.fn.apply(null).then(()=>{if(t.state="finish",t.sub.length>0){const e=this.tasks.findIndex(i=>i===t);this.tasks.splice(e+1,0,...t.sub)}}).catch(e=>{t.state="error",this.logger.error(`${e} ${e.stack}`,this.taskId),this.emit("task-error",Sn.transform(e),this.slideIndex)}))}applyAll(){return rI(this,void 0,void 0,function*(){for(;!this.tasks.every(t=>t.state==="finish");)if(this.tasks.some(t=>t.state==="running"))yield oI(16);else{if(this.tasks.some(t=>t.state==="error"))return;{const t=this.tasks.find(e=>e.state==="wait");if(t){t.state="running";try{if((yield Sc(()=>t.fn.apply(null),6e4))===Ra)throw new Sn(ur.RuntimeError,`subtask ${t.name} apply timeout`);if(t.state="finish",t.sub.length>0){const e=this.tasks.findIndex(i=>i===t);this.tasks.splice(e+1,0,...t.sub)}}catch(e){let i;i=e!=null&&e.errorType?e:new Sn(ur.RuntimeError,`subtask ${t.name} error. ${e}`),t.state="error",this.logger.error(`${e} ${e.stack}`,this.taskId),this.emit("task-error",Sn.transform(i),this.slideIndex);break}}}}!this.isCancel&&this.tasks.every(t=>t.state==="finish")&&this.emit("task-finish")})}}var aI=v(53);const x_=new(v.n(aI)).a,lI=x_.getDevice(),uI=x_.getBrowser(),gg=x_.getOS(),vg={isDesktop(){let n=!0;return lI.type==="mobile"&&(n=!1),/Samsung/.test(uI.name||"")&&(n=!1),window.__nativeTags&&window.__nativeTags.platform&&(n=!1),n},isIOS(){let n=!1;return window.__nativeTags&&window.__nativeTags.platform&&/^ios/i.test(window.__nativeTags.platform)&&(n=!0),gg.name&&/iOS/.test(gg.name)&&(n=!0),n},isAndroid(){let n=!1;return window.__nativeTags&&window.__nativeTags.platform&&/^android/i.test(window.__nativeTags.platform)&&(n=!0),gg.name&&/android/i.test(gg.name)&&(n=!0),n},isLowGpuMemory(){var n,t;const e=(t=(n=window.__nativeTags)===null||n===void 0?void 0:n.platform)!==null&&t!==void 0?t:"";if(e){const i=e.split(" ");if(i[1]){if(/^iPad/.test(i[1])){const r=i[1].match(/^iPad(\d+)/);return!(r&&r[1]&&parseInt(r[1],10)>=6)}if(/^iPhone/.test(i[1])){const r=i[1].match(/^iPhone(\d+)/);return!(r&&r[1]&&parseInt(r[1],10)>=9)}return!1}return!1}return!0}};var Rc=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};class hI{constructor(t,e,i,r,o,s,a,l,u,h,d,p,m){this.loader=t,this.mode=e,this.renderer=i,this.ticker=r,this.view=o,this.clock=s,this.objPoolGroup=a,this.errorChannel=l,this.localstorage=u,this.logger=h,this.loaderDelegate=d,this.isPlayerPaused=p,this.maxResolution=m,this.currentStageIndex=0,this.cacheCount=vg.isDesktop()?2:1,this.stageStates=Object.create(null),this.stageJsons=Object.create(null),this.stageCtxs=Object.create(null),this.stageImpls=Object.create(null),this.taskId="",this.url="",this.runningAudio=new Map,this.activeMedia=new Set,this.microTaskManager=new nI(r)}setResourceData(t,e){this.taskId=t,this.url=e}createCtx(t){const{task:e}=this.stageStates[t];e.addMTask(()=>Rc(this,void 0,void 0,function*(){const i=new WC(this.loader),r=new C.a,o={taskId:this.taskId,mode:this.mode,renderer:this.renderer,graphicsTexture:new $C,stageWidth:0,stageHeight:0,ticker:this.ticker,timingTargets:new ZC(r),eventHub:r,view:this.view,medias:Object.create(null),lastViewedIndex:0,conflictTimeNodeManager:new JC,clock:this.clock,spriteTexture:i,slideIndex:t,objectPoolGroup:this.objPoolGroup,hasBackgroundFillShape:!1,slideScopeEventHub:new C.a,logger:this.logger,loaderDelegate:this.loaderDelegate,runningAudio:this.runningAudio,activeMedia:this.activeMedia,isPlayerPaused:this.isPlayerPaused,timingEventHub:new C.a,maxResolution:this.maxResolution};this.stageCtxs[t]=o}),"@StagePool[createCtx]")}loadStageJson(t){const{task:e}=this.stageStates[t];e.addMTask(()=>Rc(this,void 0,void 0,function*(){const i=yield this.loader.fetchJson(`${this.url}/${this.taskId}/jsonOutput/slide-${t}.json`);this.stageJsons[t]=i,this.stageCtxs[t].stageWidth=i.width,this.stageCtxs[t].stageHeight=i.height}),"@StagePool[loadStageJson]")}loadSpriteSheets(t){const{task:e}=this.stageStates[t];e.addMTask(()=>{const i=this.stageJsons[t],{spriteTexture:r,stageWidth:o,stageHeight:s}=this.stageCtxs[t],{coloredSheets:a,sheets:l}=i,u=a||l;return u&&u.forEach(h=>{e.addSubMTask(()=>{let d=1;if(o>this.maxResolution.x||s>this.maxResolution.y){d=this.maxResolution.x/o;const p=d*s;p>this.maxResolution.y&&(d*=this.maxResolution.y/p)}return r.loadSpriteSheetItem(this.url,this.taskId,h,d)},"@StagePool[spriteTexture.loadSpriteSheetItem]")}),Promise.resolve()},"@StagePool[loadSpriteSheets]")}createStage(t){const{task:e}=this.stageStates[t];e.addMTask(()=>{const i=this.stageJsons[t],r=this.stageCtxs[t],o=new iI(i,r,{x:0,y:0},e);return this.stageImpls[t]=o,Promise.resolve()},"@StagePool[createStage]")}preRenderStage(t){const{task:e}=this.stageStates[t];e.addMTask(()=>(this.stageImpls[t].preRender(e),Promise.resolve()),"@StagePool[preRenderStage]")}createGraphicsTexture(t){const{task:e}=this.stageStates[t];e.addMTask(()=>Rc(this,void 0,void 0,function*(){const i=this.stageCtxs[t];i.graphicsTexture.pack().forEach((r,o)=>{e.addSubMTask(()=>i.graphicsTexture.render(r,o,this.objPoolGroup),"@StagePool[graphicsTexture.render]")})}),"@StagePool[createGraphicsTexture]")}renderStage(t){const{task:e}=this.stageStates[t];e.addMTask(()=>Rc(this,void 0,void 0,function*(){const i=this.stageImpls[t],r=this.stageCtxs[t];yield i.render(e),e.addSubMTask(()=>Rc(this,void 0,void 0,function*(){var o;const s=`snapshot-${t.toString()}-start`;if(!(yield(o=this.localstorage)===null||o===void 0?void 0:o.getItem(s))&&tr.platform.isLowGpuMemory()){i.createTiming(),i.container.visible=!0,i.collectMainSeqStartValue(),i.setMainSeqStep(0,"start");const a=Ro.create({width:i.json.width,height:i.json.height,resolution:1});r.renderer.render(i.container,{renderTexture:a});const l=r.renderer.plugins.extract.base64(a,"image/jpeg");this.localstorage.setItem(s,l,!0).catch(()=>{}),i.container.visible=!1,a.destroy(),i.timing&&(i.timing.destroy(),i.timing=void 0)}}),"@StagePool[snapshot]")}),"@StagePool[renderStage]")}destroyStageByIndex(t){this.stageStates[t].state==="load"&&this.stageStates[t].task.cancel(),delete this.stageStates[t],this.stageImpls[t].destroy(),delete this.stageImpls[t],delete this.stageCtxs[t]}destroyStage(){Object.keys(this.stageImpls).forEach(t=>{const e=parseInt(t,10);Math.abs(this.currentStageIndex-e)>this.cacheCount&&this.destroyStageByIndex(e)})}destroyAllStage(){Object.keys(this.stageImpls).forEach(t=>{const e=parseInt(t,10);this.destroyStageByIndex(e)})}preload(t,e=!1){if(this.stageImpls[t]||this.stageStates[t])return Promise.resolve();const i=new sI(t,this.taskId,this.logger);return i.on("task-error",(r,o)=>{delete this.stageStates[o],delete this.stageImpls[o],delete this.stageCtxs[o],this.errorChannel.emit("error",r,o)}),this.stageStates[t]={state:"load",task:i},this.createCtx(t),this.loadStageJson(t),this.loadSpriteSheets(t),this.createStage(t),this.preRenderStage(t),this.createGraphicsTexture(t),this.renderStage(t),this.microTaskManager.addTask(i),e?i.applyAll():new Promise(r=>{i.once("task-finish",()=>{this.stageStates[t].state="finish",Object.keys(this.stageStates).length>2*this.cacheCount+1&&this.destroyStage(),r()})})}getStageJson(t){return this.stageJsons[t]||null}getStage(t){return Rc(this,void 0,void 0,function*(){this.currentStageIndex=t;const e=this.stageStates[t];return(e==null?void 0:e.state)==="finish"&&this.stageImpls[t]?this.stageImpls[t]:(e==null?void 0:e.state)==="load"?(yield e.task.applyAll(),this.stageImpls[t]):(yield this.preload(t,!0),this.stageImpls[t])})}destroy(){this.runningAudio.clear()}}var rS=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};class Po{constructor(t){var e;this.logger=t,this.taskId="",this.isIndexDBReady=!1,this.memoryCache=new Map,(e=Po.localCache)===null||e===void 0||e.ready(()=>{this.isIndexDBReady=!0}).catch(()=>{t.warn("local storage not ready",this.taskId)})}get couldUseIndexDBCache(){return this.isIndexDBReady&&this.taskId.length>0}attachTaskId(t){this.taskId=t}getItem(t){return rS(this,void 0,void 0,function*(){let e=null;return this.couldUseIndexDBCache&&Po.localCache&&(e=yield Sc(()=>Po.localCache.getItem(`${this.taskId}/${t}`),500)),e=e===Ra?null:e,e||this.memoryCache.get(t)||null})}setItem(t,e,i=!1){return rS(this,void 0,void 0,function*(){if(!this.couldUseIndexDBCache)return i&&this.memoryCache.set(t,e),Promise.resolve();Po.localCache&&(yield Sc(()=>Po.localCache.setItem(`${this.taskId}/${t}`,e).catch(()=>{i&&this.memoryCache.set(t,e)}),500))===Ra&&i&&this.memoryCache.set(t,e)})}dispose(){var t;this.memoryCache=new Map,this.couldUseIndexDBCache&&((t=Po.localCache)===null||t===void 0||t.keys().then(e=>{e.filter(i=>i.indexOf(this.taskId)>=0).forEach(i=>{var r;(r=Po.localCache)===null||r===void 0||r.removeItem(i).catch(()=>{})})}))}}Po.localCache=null;try{Po.localCache=ht.createInstance({name:"slide_local_cache",driver:ht.INDEXEDDB,version:1})}catch{}var Cc=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};q.skipHello();const oS={randomBar:"RandomLines",circle:"Shape",ripple:"Ripples",wipe:"Erase",dissolve:"Dissolve",morph:"Smooth",fade:"FadeInOut",push:"Push",split:"Separation",reveal:"Display",pull:"Uncover",cover:"Cover",flash:"Flash",checker:"Checkerboard",blinds:"WindowShades",curtains:"Curtain",fallOver:"Fall",drape:"Suspension",wheel:"Clock",comb:"Combing",warp:"Scale",peelOff:"PeelOff",flip:"Flip"},Ne={mainSeqStepChange:"mainSeqStepChange",mainSeqStateChange:"mainSeqStateChange",interactiveSeqStateChange:"interactiveSeqStateChange",interactiveSeqAction:"interactiveSeqAction",mainSeqStepStart:"mainSeqStepStart",mainSeqStepEnd:"mainSeqStepEnd",slideChange:"slideChange",renderStart:"renderStart",renderEnd:"renderEnd",hyperlinkTrigger:"hyperlinkTrigger",animateStart:"animateStart",animateEnd:"animateEnd",mediaSeek:"mediaSeek",mediaPlay:"mediaPlay",mediaPause:"mediaPause",requestNextSlide:"requestNextSlide",requestPrevSlide:"requestPrevSlide",requestGotoSlide:"requestGotoSlide",userInput:"userInput"};class tr extends C.a{constructor(t,e={}){super(),this.errorChannel=new C.a,this.transactionPlayer=null,this.transactionSprite=new xr,this.isForward=!0,this.drawCall=0,this.scale=1,this.prevSlideBase64=null,this._isPaused=!1,this.maxResolution=new bn(0,0),this.fps=new kC,this.designWidth=0,this.designHeight=0,this.currentIndex=0,this.slideCount=0,this.runtime={drawCall:0,fps:0},this.isPlayerPaused=()=>this._isPaused,this.onWebGLLost=()=>{this.errorChannel.emit("error",new Sn(ur.CanvasCrash,"webgl context lost."))},this.logger=t.logger,this.mode=t.mode,this.localStorage=new Po(this.logger);let i=Math.max(window.devicePixelRatio,2);vg.isDesktop()||(i=1),this.config={minFPS:Object(V.isUndefined)(e.minFPS)?30:e.minFPS,maxFPS:Object(V.isUndefined)(e.maxFPS)?40:e.maxFPS,resolution:Object(V.isUndefined)(e.resolution)?i:e.resolution,autoFPS:!Object(V.isUndefined)(e.autoFPS)&&e.autoFPS,autoResolution:!Object(V.isUndefined)(e.autoResolution)&&e.autoResolution,transactionBgColor:Object(V.isUndefined)(e.transactionBgColor)?0:e.transactionBgColor,maxResolutionLevel:this.getMaxResolution(e.maxResolutionLevel)},this.updateMaxResolutionLevel(this.config.maxResolutionLevel),this.loader=new HC(this.localStorage,t.useLocalCache,this.logger,t.resourceTimeout,t.loadDelegate),this.app=new jm({antialias:!0,autoDensity:!1,backgroundColor:16777215}),this.updateConfig(this.config),this.app.view.style.zIndex="1",this.app.stage.sortableChildren=!0;const r=this.app.renderer,{drawElements:o}=r.gl;r.gl.drawElements=(...s)=>{o.call(r.gl,...s),this.drawCall+=1},this.fps.on("update",s=>{if(s<this.config.minFPS){if(this.config.autoResolution){const a=.7*this.scale,l=this.app.renderer.resolution,u=Math.max(a,l-.1);u>=a&&this.updateResolution(u)}if(this.config.autoFPS){const{minFPS:l,maxFPS:u}=this.app.ticker,h=Math.max(14,l-2),d=Math.max(14,u-2);h>=14&&d>=14&&(this.app.ticker.minFPS=h,this.app.ticker.maxFPS=d)}}else if(s>this.config.maxFPS){if(this.config.autoResolution){const a=this.scale*this.config.resolution,l=this.app.renderer.resolution,u=Math.min(a,l+.1);u<=this.config.resolution&&this.updateResolution(u)}if(this.config.autoFPS){const a=this.config.minFPS,l=this.config.maxFPS,{minFPS:u,maxFPS:h}=this.app.ticker,d=Math.min(a,u+2),p=Math.min(l,h+2);d<=a&&p<=l&&(this.app.ticker.minFPS=d,this.app.ticker.maxFPS=p)}}}),this.app.ticker.add(()=>{this.runtime.drawCall=this.drawCall,this.runtime.fps=Math.floor(this.app.ticker.minFPS),this.drawCall=0},null,is.LOW),this.clock=new jC(this.app.ticker),this.objPoolGroup=fp(),this.stagePool=new hI(this.loader,this.mode,this.app.renderer,this.app.ticker,this.app.view,this.clock,this.objPoolGroup,this.errorChannel,this.localStorage,this.logger,t.loadDelegate,this.isPlayerPaused,this.maxResolution),this.app.view.addEventListener("webglcontextlost",this.onWebGLLost);try{this.transactionPlayer=new HA}catch(s){/Error creating WebGL context/.test(s.message)?this.errorChannel.emit("error",new Sn(ur.CanvasCrash,"webgl context lost.")):this.errorChannel.emit("error",new Sn(ur.RuntimeWarn,s.message))}}get view(){return this.app.renderer?this.app.view:null}get nextSlideIndex(){var t;return!((t=this.currentStage)===null||t===void 0)&&t.json.nextIndex?this.currentStage.json.nextIndex:this.currentIndex+1}get prevSlideIndex(){var t;return!((t=this.currentStage)===null||t===void 0)&&t.json.prevIndex?this.currentStage.json.prevIndex:this.currentIndex-1}getMaxResolution(t){return!Object(V.isUndefined)(t)&&Number.isInteger(t)?(t<1&&(t=1),t>4&&(t=4),t):tr.platform.isAndroid()||tr.platform.isIOS()?2:4}updateMaxResolutionLevel(t){t<1&&(t=1),t>4&&(t=4);const e=[999999,960,1280,1920,3200][t],i=[999999,540,720,1080,1800][t];this.maxResolution.set(e,i)}updateConfig(t){Object(V.isUndefined)(t.minFPS)||(this.config.minFPS=t.minFPS,this.app.ticker.minFPS=t.minFPS),Object(V.isUndefined)(t.maxFPS)||(this.config.maxFPS=t.maxFPS,this.app.ticker.maxFPS=t.maxFPS),Object(V.isUndefined)(t.resolution)||(this.config.resolution=t.resolution,this.updateResolution(this.scale*this.config.resolution)),Object(V.isUndefined)(t.autoFPS)||(this.config.autoFPS=t.autoFPS),Object(V.isUndefined)(t.autoResolution)||(this.config.autoResolution=t.autoResolution),Object(V.isUndefined)(t.transactionBgColor)||(this.config.transactionBgColor=t.transactionBgColor),this.taskId&&this.logger.info("ppt player update config: "+JSON.stringify(this.config),this.taskId),Object(V.isUndefined)(t.maxResolutionLevel)||(this.config.maxResolutionLevel=t.maxResolutionLevel,this.updateMaxResolutionLevel(this.config.maxResolutionLevel))}preload(t){return Cc(this,void 0,void 0,function*(){t<1||t>this.slideCount||(this.logger.info(`preload slide ${t} begin`,this.taskId),yield this.stagePool.preload(t),this.logger.info(`preload slide ${t} end`,this.taskId))})}setResourceData(t,e){this.logger.info("ppt player init config: "+JSON.stringify(this.config),t),this.logger.info("set resource to "+e,t),this.taskId=t,this.url=e,this.stagePool.setResourceData(t,e),this.localStorage.attachTaskId(t),this.loader.attachTaskId(t)}setInteractive(t){this.app.stage.interactive=t,this.app.stage.interactiveChildren=t}translateEvent(t,e){e.forEach(i=>{t.on(i,(...r)=>{this.emit(i,...r)})})}renderSlide(t,e=!1){var i;return Cc(this,void 0,void 0,function*(){if(this._isPaused)return void this.logger.info("ppt play prevent render slide with paused state",this.taskId);this.logger.info("render slide "+t,this.taskId),this.emit(Ne.renderStart,t);const r=yield this.stagePool.getStage(t);if(!r)return;this.translateEvent(r.ctx.eventHub,[Ne.mainSeqStepChange,Ne.mainSeqStateChange,Ne.hyperlinkTrigger,Ne.interactiveSeqAction,Ne.mainSeqStepStart,Ne.mainSeqStepEnd,Ne.animateStart,Ne.animateEnd,Ne.mediaPlay,Ne.mediaPause,Ne.mediaSeek,Ne.requestGotoSlide,Ne.requestNextSlide,Ne.requestPrevSlide,Ne.interactiveSeqStateChange,Ne.userInput]),this.currentIndex=Number(t);const{width:o,height:s,slideCount:a}=r.json;this.slideCount=a,this.designWidth=o,this.designHeight=s,r.json.transition&&r.json.transition.type&&!this.prevSlideBase64&&this.currentStage&&(this.prevSlideBase64=this.getBase64(this.currentStage)),(i=this.currentStage)===null||i===void 0||i.clearOnSlideChange();const l=this.currentStage;this.currentStage=r,r.initOnReuse(),r.createTiming(),r.container.visible=!0,r.collectMainSeqStartValue(),this.isForward?r.setMainSeqStep(0,"start"):r.setMainSeqStep(-1,"end");let u=null;if(r.json.transition&&r.json.transition.type){const d=t.toString()+(this.isForward||e?"-start":"-end");u=(yield this.localStorage.getItem("snapshot-"+d))||this.getBase64(this.currentStage)}r.container.visible=!1,this.app.stage.addChild(r.container);let{transition:h}=r.json;!this.isForward&&(l==null?void 0:l.json.transition)&&(h=l.json.transition),this.prevSlideBase64&&u&&h&&h.type&&l&&r&&(yield this.playTransaction(this.prevSlideBase64,u,h,l,r),this.prevSlideBase64=null),this.isForward?yield r.startTiming():r.setMainSeqApplied(),this.updateResolution(this.config.resolution*this.scale),r.container.visible=!0,l&&(l.setMainSeqStep(0,"start"),l.clearOnTransactionEnd(),this.app.stage.removeChild(l.container)),r.ctx.slideScopeEventHub.emit("slide-render",r.ctx.slideIndex),this.emit(Ne.renderEnd,t),this.emit(Ne.slideChange,t),this.preload(t+1).catch(d=>{this.errorChannel.emit("error",Sn.transform(d),t+1)}),this.preload(t-1).catch(d=>{this.errorChannel.emit("error",Sn.transform(d),t-1)})})}renderToBase64(t,e){return Cc(this,void 0,void 0,function*(){const i=yield this.stagePool.getStage(t);if(i){const{width:r,height:o}=i.json;this.designWidth=r,this.designHeight=o;const s=Ro.create({width:this.designWidth,height:this.designHeight,resolution:e});i.container.visible=!0,this.app.renderer.render(i.container,{renderTexture:s});const a=this.app.renderer.plugins.extract.base64(s,"image/jpeg");return this.stagePool.destroyStageByIndex(t),a}return"__null__"})}getBase64(t){if(!t.container.transform)return null;const e=Ro.create({width:this.designWidth,height:this.designHeight,resolution:1});this.app.renderer.render(t.container,{renderTexture:e});const i=this.app.renderer.plugins.extract.base64(e,"image/jpeg");return e.destroy(!0),i}playTransaction(t,e,i,r,o){return Cc(this,void 0,void 0,function*(){const s=this.app.view.parentElement;if(t&&e&&s&&oS[i.type]&&this.transactionPlayer){this.transactionSprite.zIndex=999,this.transactionSprite.visible=!1,this.app.stage.addChild(this.transactionSprite);const a=this.transactionPlayer.renderer.domElement,l=Qe.from(a),u=()=>l.update();return this.app.ticker.add(u),this.transactionSprite.texture=l,setTimeout(()=>{this.transactionSprite.visible=!0},100),new Promise(h=>{var d,p,m,g;(d=this.transactionPlayer)===null||d===void 0||d.play({reverse:!this.isForward,prevTextureUrl:t,nextTextureUrl:e,textureWidth:this.designWidth,textureHeight:this.designHeight,presetType:oS[i.type],stageWidth:this.designWidth,stageHeight:this.designHeight,duration:(m=(p=this.currentStage)===null||p===void 0?void 0:p.json.transition)===null||m===void 0?void 0:m.dur,delay:0,clearColor:this.config.transactionBgColor,maxFPS:Math.ceil((g=this.config.maxFPS)!==null&&g!==void 0?g:60),onTransactionEnd:()=>{var _,y;h(),r.container.visible=!1,o.container.visible=!0,(_=this.app.stage)===null||_===void 0||_.removeChild(this.transactionSprite),(y=this.app.ticker)===null||y===void 0||y.remove(u)}})})}return Promise.resolve()})}scaleView(t,e,i){if(this.view&&(this.view.style.width=Math.floor(this.designWidth*t)+"px",this.view.style.height=Math.floor(this.designHeight*t)+"px"),e){this.scale=t;const r=this.scale*this.config.resolution;this.updateResolution(r,i)}}updateResolution(t,e){this.app.ticker.addOnce(()=>{let i=vg.isDesktop()?t:1;for(;i*this.designWidth>this.maxResolution.x||i*this.designHeight>this.maxResolution.y;)i-=.1;this.app.renderer.resolution=i,this.app.renderer.plugins.interaction.resolution=this.app.renderer.resolution,this.app.renderer.resize(this.designWidth,this.designHeight),Object(V.isFunction)(e)&&e()})}nextStep(t=!1){var e;if(this._isPaused)this.logger.info("ppt play prevent next step with paused state",this.taskId);else{this.logger.info("ppt play trigger next step",this.taskId);try{(e=this.currentStage)===null||e===void 0||e.nextStep(t)}catch(i){this.errorChannel.emit("error",Sn.transform(i),this.currentIndex)}}}prevStep(t=!1){var e;if(this._isPaused)this.logger.info("ppt play prevent prev step with paused state",this.taskId);else{this.logger.info("ppt play trigger prev step",this.taskId);try{(e=this.currentStage)===null||e===void 0||e.prevStep(t)}catch(i){this.errorChannel.emit("error",Sn.transform(i),this.currentIndex)}}}mainSeqLength(){var t,e;return(e=(t=this.currentStage)===null||t===void 0?void 0:t.mainSeqLength())!==null&&e!==void 0?e:0}mainSeqStep(){var t,e;return(e=(t=this.currentStage)===null||t===void 0?void 0:t.mainSeqStep())!==null&&e!==void 0?e:0}setMainSeqStep(t,e){var i;(i=this.currentStage)===null||i===void 0||i.setMainSeqStep(t,e)}mainSeqState(){var t,e;return(e=(t=this.currentStage)===null||t===void 0?void 0:t.mainSeqState())!==null&&e!==void 0?e:null}mainSeqHasNextStep(){var t,e;return(e=(t=this.currentStage)===null||t===void 0?void 0:t.mainSeqHasNextStep())!==null&&e!==void 0&&e}mainSeqHasPrevStep(){var t,e;return(e=(t=this.currentStage)===null||t===void 0?void 0:t.mainSeqHasPrevStep())!==null&&e!==void 0&&e}nextTick(t){this.app.ticker.addOnce(()=>{t()},is.LOW)}applyInteractiveAction(t){var e;(e=this.currentStage)===null||e===void 0||e.applyInteractiveAction(t)}seekInteractiveSeqToEnd(t){var e;(e=this.currentStage)===null||e===void 0||e.seekInteractiveSeqToEnd(t)}setInteractiveSeqState(t,e,i){var r;(r=this.currentStage)===null||r===void 0||r.setInteractiveSeqState(t,e,i)}setMediaState(t,e){var i;return Cc(this,void 0,void 0,function*(){yield(i=this.currentStage)===null||i===void 0?void 0:i.setMediaState(t,e)})}setMediaCurrentTime(t,e){var i;(i=this.currentStage)===null||i===void 0||i.setMediaCurrentTime(t,e)}pause(){var t;this.app.ticker.stop(),(t=this.currentStage)===null||t===void 0||t.ctx.activeMedia.forEach(e=>{e.globalPause()}),this._isPaused=!0}resume(){var t;this._isPaused=!1,this.app.ticker.start(),(t=this.currentStage)===null||t===void 0||t.ctx.activeMedia.forEach(e=>{e.globalResume()})}getSnapshot(){return this.currentStage&&this.getBase64(this.currentStage)||""}createSnapshotForNextSlide(t){return Cc(this,void 0,void 0,function*(){const e=this.nextSlideIndex,i=this.stagePool.getStageJson(e);if(i&&i.transition&&i.transition.type&&this.currentStage&&this.transactionPlayer){const r=t?`snapshot-${this.currentStage.json.index}-start`:`snapshot-${this.currentStage.json.index}-end`;if(this.currentStage.timing&&(t?this.currentStage.timing.mainSeqHasPrevStep():this.currentStage.timing.mainSeqHasNextStep()))this.prevSlideBase64=this.getBase64(this.currentStage);else{const o=yield this.localStorage.getItem(r);o?this.prevSlideBase64=o:(this.prevSlideBase64=this.getBase64(this.currentStage),this.localStorage.setItem(r,this.prevSlideBase64,!0).catch(()=>{}))}}})}clearLocalCache(){this.localStorage.dispose()}static clearLocalCache(){var t;(t=Po.localCache)===null||t===void 0||t.clear().catch(()=>{})}destroy(){var t;try{this.app.view.removeEventListener("webglcontextlost",this.onWebGLLost);try{this.app.renderer.filter.texturePool.clear(!0)}catch{}l_.collectObjectByGroup(this.objPoolGroup),u_.collectObjectByGroup(this.objPoolGroup),(t=this.transactionPlayer)===null||t===void 0||t.destroy(),this.loader.destroy(),this.fps.destroy(),this.stagePool.destroyAllStage(),this.stagePool.destroy();try{this.app.renderer.gl.getExtension("WEBGL_lose_context").loseContext()}catch{}this.app.destroy(!0,{children:!0,texture:!0,baseTexture:!0})}catch{}}}tr.platform=vg,tr.RtcAudioClazz=null;var bp,Fu=[],sS="ResizeObserver loop completed with undelivered notifications.";(function(n){n.BORDER_BOX="border-box",n.CONTENT_BOX="content-box",n.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(bp||(bp={}));var b_,Bu=function(n){return Object.freeze(n)},cI=function(n,t){this.inlineSize=n,this.blockSize=t,Bu(this)},aS=function(){function n(t,e,i,r){return this.x=t,this.y=e,this.width=i,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Bu(this)}return n.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},n.fromRect=function(t){return new n(t.x,t.y,t.width,t.height)},n}(),w_=function(n){return n instanceof SVGElement&&"getBBox"in n},lS=function(n){if(w_(n)){var t=n.getBBox(),e=t.width,i=t.height;return!e&&!i}var r=n,o=r.offsetWidth,s=r.offsetHeight;return!(o||s||n.getClientRects().length)},uS=function(n){var t,e;if(n instanceof Element)return!0;var i=(e=(t=n)===null||t===void 0?void 0:t.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(i&&n instanceof i.Element)},wp=typeof window!="undefined"?window:{},_g=new WeakMap,hS=/auto|scroll/,dI=/^tb|vertical/,pI=/msie|trident/i.test(wp.navigator&&wp.navigator.userAgent),Bs=function(n){return parseFloat(n||"0")},Pc=function(n,t,e){return n===void 0&&(n=0),t===void 0&&(t=0),e===void 0&&(e=!1),new cI((e?t:n)||0,(e?n:t)||0)},cS=Bu({devicePixelContentBoxSize:Pc(),borderBoxSize:Pc(),contentBoxSize:Pc(),contentRect:new aS(0,0,0,0)}),dS=function(n,t){if(t===void 0&&(t=!1),_g.has(n)&&!t)return _g.get(n);if(lS(n))return _g.set(n,cS),cS;var e=getComputedStyle(n),i=w_(n)&&n.ownerSVGElement&&n.getBBox(),r=!pI&&e.boxSizing==="border-box",o=dI.test(e.writingMode||""),s=!i&&hS.test(e.overflowY||""),a=!i&&hS.test(e.overflowX||""),l=i?0:Bs(e.paddingTop),u=i?0:Bs(e.paddingRight),h=i?0:Bs(e.paddingBottom),d=i?0:Bs(e.paddingLeft),p=i?0:Bs(e.borderTopWidth),m=i?0:Bs(e.borderRightWidth),g=i?0:Bs(e.borderBottomWidth),_=d+u,y=l+h,w=(i?0:Bs(e.borderLeftWidth))+m,A=p+g,I=a?n.offsetHeight-A-n.clientHeight:0,F=s?n.offsetWidth-w-n.clientWidth:0,N=r?_+w:0,U=r?y+A:0,B=i?i.width:Bs(e.width)-N-F,G=i?i.height:Bs(e.height)-U-I,ct=B+_+F+w,it=G+y+I+A,tt=Bu({devicePixelContentBoxSize:Pc(Math.round(B*devicePixelRatio),Math.round(G*devicePixelRatio),o),borderBoxSize:Pc(ct,it,o),contentBoxSize:Pc(B,G,o),contentRect:new aS(d,l,B,G)});return _g.set(n,tt),tt},pS=function(n,t,e){var i=dS(n,e),r=i.borderBoxSize,o=i.contentBoxSize,s=i.devicePixelContentBoxSize;switch(t){case bp.DEVICE_PIXEL_CONTENT_BOX:return s;case bp.BORDER_BOX:return r;default:return o}},fI=function(n){var t=dS(n);this.target=n,this.contentRect=t.contentRect,this.borderBoxSize=Bu([t.borderBoxSize]),this.contentBoxSize=Bu([t.contentBoxSize]),this.devicePixelContentBoxSize=Bu([t.devicePixelContentBoxSize])},fS=function(n){if(lS(n))return 1/0;for(var t=0,e=n.parentNode;e;)t+=1,e=e.parentNode;return t},mI=function(){var n=1/0,t=[];Fu.forEach(function(r){if(r.activeTargets.length!==0){var o=[];r.activeTargets.forEach(function(s){var a=new fI(s.target),l=fS(s.target);o.push(a),s.lastReportedSize=pS(s.target,s.observedBox),l<n&&(n=l)}),t.push(function(){r.callback.call(r.observer,o,r.observer)}),r.activeTargets.splice(0,r.activeTargets.length)}});for(var e=0,i=t;e<i.length;e++)(0,i[e])();return n},mS=function(n){Fu.forEach(function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach(function(e){e.isActive()&&(fS(e.target)>n?t.activeTargets.push(e):t.skippedTargets.push(e))})})},gI=function(){var n,t=0;for(mS(t);Fu.some(function(e){return e.activeTargets.length>0});)t=mI(),mS(t);return Fu.some(function(e){return e.skippedTargets.length>0})&&(typeof ErrorEvent=="function"?n=new ErrorEvent("error",{message:sS}):((n=document.createEvent("Event")).initEvent("error",!1,!1),n.message=sS),window.dispatchEvent(n)),t>0},gS=[],vI=function(n){if(!b_){var t=0,e=document.createTextNode("");new MutationObserver(function(){return gS.splice(0).forEach(function(i){return i()})}).observe(e,{characterData:!0}),b_=function(){e.textContent=""+(t?t--:t++)}}gS.push(n),b_()},S_=0,_I={attributes:!0,characterData:!0,childList:!0,subtree:!0},vS=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],_S=function(n){return n===void 0&&(n=0),Date.now()+n},T_=!1,E_=new(function(){function n(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return n.prototype.run=function(t){var e=this;if(t===void 0&&(t=250),!T_){T_=!0;var i,r=_S(t);i=function(){var o=!1;try{o=gI()}finally{if(T_=!1,t=r-_S(),!S_)return;o?e.run(1e3):t>0?e.run(t):e.start()}},vI(function(){requestAnimationFrame(i)})}},n.prototype.schedule=function(){this.stop(),this.run()},n.prototype.observe=function(){var t=this,e=function(){return t.observer&&t.observer.observe(document.body,_I)};document.body?e():wp.addEventListener("DOMContentLoaded",e)},n.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),vS.forEach(function(e){return wp.addEventListener(e,t.listener,!0)}))},n.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),vS.forEach(function(e){return wp.removeEventListener(e,t.listener,!0)}),this.stopped=!0)},n}()),yS=function(n){!S_&&n>0&&E_.start(),!(S_+=n)&&E_.stop()},yI=function(){function n(t,e){this.target=t,this.observedBox=e||bp.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return n.prototype.isActive=function(){var t,e=pS(this.target,this.observedBox,!0);return t=this.target,w_(t)||function(i){switch(i.tagName){case"INPUT":if(i.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||getComputedStyle(t).display!=="inline"||(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},n}(),xI=function(n,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=n,this.callback=t},yg=new WeakMap,xS=function(n,t){for(var e=0;e<n.length;e+=1)if(n[e].target===t)return e;return-1},xg=function(){function n(){}return n.connect=function(t,e){var i=new xI(t,e);yg.set(t,i)},n.observe=function(t,e,i){var r=yg.get(t),o=r.observationTargets.length===0;xS(r.observationTargets,e)<0&&(o&&Fu.push(r),r.observationTargets.push(new yI(e,i&&i.box)),yS(1),E_.schedule())},n.unobserve=function(t,e){var i=yg.get(t),r=xS(i.observationTargets,e),o=i.observationTargets.length===1;r>=0&&(o&&Fu.splice(Fu.indexOf(i),1),i.observationTargets.splice(r,1),yS(-1))},n.disconnect=function(t){var e=this,i=yg.get(t);i.observationTargets.slice().forEach(function(r){return e.unobserve(t,r.target)}),i.activeTargets.splice(0,i.activeTargets.length)},n}(),bI=function(){function n(t){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof t!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");xg.connect(this,t)}return n.prototype.observe=function(t,e){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!uS(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");xg.observe(this,t,e)},n.prototype.unobserve=function(t){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!uS(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");xg.unobserve(this,t)},n.prototype.disconnect=function(){xg.disconnect(this)},n.toString=function(){return"function ResizeObserver () { [polyfill code] }"},n}(),wI=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})},SI=function(n,t){var e,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return function(h){if(e)throw new TypeError("Generator is already executing.");for(;s;)try{if(e=1,i&&(r=2&h[0]?i.return:h[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,h[1])).done)return r;switch(i=0,r&&(h=[2&h[0],r.value]),h[0]){case 0:case 1:r=h;break;case 4:return s.label++,{value:h[1],done:!1};case 5:s.label++,i=h[1],h=[0];continue;case 7:h=s.ops.pop(),s.trys.pop();continue;default:if(r=s.trys,!((r=r.length>0&&r[r.length-1])||h[0]!==6&&h[0]!==2)){s=0;continue}if(h[0]===3&&(!r||h[1]>r[0]&&h[1]<r[3])){s.label=h[1];break}if(h[0]===6&&s.label<r[1]){s.label=r[1],r=h;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(h);break}r[2]&&s.ops.pop(),s.trys.pop();continue}h=t.call(n,s)}catch(d){h=[6,d],i=0}finally{e=r=0}if(5&h[0])throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}([l,u])}}},TI=function(){function n(t,e,i,r,o){this.state="idle",this.index=-1,this.slideIndex=-1,this.fn=i,this.index=t,this.slideIndex=e,this.eventHub=r,this.id=o}return n.prototype.apply=function(){return wI(this,void 0,void 0,function(){var t;return SI(this,function(e){switch(e.label){case 0:this.eventHub.emit("task-start",this),e.label=1;case 1:return e.trys.push([1,3,,4]),this.state="start",[4,this.fn()];case 2:return e.sent(),this.state="end",this.eventHub.emit("task-end",this),[3,4];case 3:return t=e.sent(),this.eventHub.emit("task-error",{task:this,error:t}),[3,4];case 4:return[2]}})})},n}(),EI=function(){function n(){var t=this;this.eventHub=new C.a,this.tasks=[],this.index=0,this.eventHub.on("task-end",function(e){var i,r=t.tasks.findIndex(function(s){return s.index===e.index}),o=r+1;o>=0&&((i=t.tasks[o])===null||i===void 0||i.apply()),r>=0&&(t.tasks.splice(r,1),t.replaceIdleTask()),t.eventHub.emit("task-end-"+e.id)}),this.eventHub.on("task-error",function(e){var i=e.task,r=t.tasks.findIndex(function(o){return o.index===i.index});r>=0&&(t.tasks.splice(r,1),t.replaceIdleTask())})}return n.prototype.replaceIdleTask=function(){for(var t,e=this,i=new Set,r=0,o=this.tasks.length;r<o;r++)this.tasks[r].state==="idle"&&((t=this.tasks[r+1])===null||t===void 0?void 0:t.state)==="idle"&&i.add(r);Array.from(i).forEach(function(s){e.tasks.splice(s,1)})},n.prototype.addTask=function(t,e,i){var r=new TI(this.index++,e,t,this.eventHub,i);this.tasks.push(r),this.tasks.sort(function(o,s){return o.index-s.index}),this.replaceIdleTask(),this.tasks.length===1&&r.apply()},n.prototype.hasStartTask=function(){return this.tasks.some(function(t){return t.state==="start"})},n.prototype.destroy=function(){this.eventHub.removeAllListeners()},n}();function Ic(n,t){var e=n.__state.conversionName.toString(),i=Math.round(n.r),r=Math.round(n.g),o=Math.round(n.b),s=n.a,a=Math.round(n.h),l=n.s.toFixed(1),u=n.v.toFixed(1);if(t||e==="THREE_CHAR_HEX"||e==="SIX_CHAR_HEX"){for(var h=n.hex.toString(16);h.length<6;)h="0"+h;return"#"+h}return e==="CSS_RGB"?"rgb("+i+","+r+","+o+")":e==="CSS_RGBA"?"rgba("+i+","+r+","+o+","+s+")":e==="HEX"?"0x"+n.hex.toString(16):e==="RGB_ARRAY"?"["+i+","+r+","+o+"]":e==="RGBA_ARRAY"?"["+i+","+r+","+o+","+s+"]":e==="RGB_OBJ"?"{r:"+i+",g:"+r+",b:"+o+"}":e==="RGBA_OBJ"?"{r:"+i+",g:"+r+",b:"+o+",a:"+s+"}":e==="HSV_OBJ"?"{h:"+a+",s:"+l+",v:"+u+"}":e==="HSVA_OBJ"?"{h:"+a+",s:"+l+",v:"+u+",a:"+s+"}":"unknown format"}var bS=Array.prototype.forEach,Sp=Array.prototype.slice,oe={BREAK:{},extend:function(n){return this.each(Sp.call(arguments,1),function(t){(this.isObject(t)?Object.keys(t):[]).forEach(function(e){this.isUndefined(t[e])||(n[e]=t[e])}.bind(this))},this),n},defaults:function(n){return this.each(Sp.call(arguments,1),function(t){(this.isObject(t)?Object.keys(t):[]).forEach(function(e){this.isUndefined(n[e])&&(n[e]=t[e])}.bind(this))},this),n},compose:function(){var n=Sp.call(arguments);return function(){for(var t=Sp.call(arguments),e=n.length-1;e>=0;e--)t=[n[e].apply(this,t)];return t[0]}},each:function(n,t,e){if(n){if(bS&&n.forEach&&n.forEach===bS)n.forEach(t,e);else if(n.length===n.length+0){var i,r=void 0;for(r=0,i=n.length;r<i;r++)if(r in n&&t.call(e,n[r],r)===this.BREAK)return}else for(var o in n)if(t.call(e,n[o],o)===this.BREAK)return}},defer:function(n){setTimeout(n,0)},debounce:function(n,t,e){var i=void 0;return function(){var r=this,o=arguments;function s(){i=null,e||n.apply(r,o)}var a=e||!i;clearTimeout(i),i=setTimeout(s,t),a&&n.apply(r,o)}},toArray:function(n){return n.toArray?n.toArray():Sp.call(n)},isUndefined:function(n){return n===void 0},isNull:function(n){return n===null},isNaN:function(n){function t(e){return n.apply(this,arguments)}return t.toString=function(){return n.toString()},t}(function(n){return isNaN(n)}),isArray:Array.isArray||function(n){return n.constructor===Array},isObject:function(n){return n===Object(n)},isNumber:function(n){return n===n+0},isString:function(n){return n===n+""},isBoolean:function(n){return n===!1||n===!0},isFunction:function(n){return n instanceof Function}},MI=[{litmus:oe.isString,conversions:{THREE_CHAR_HEX:{read:function(n){var t=n.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return t!==null&&{space:"HEX",hex:parseInt("0x"+t[1].toString()+t[1].toString()+t[2].toString()+t[2].toString()+t[3].toString()+t[3].toString(),0)}},write:Ic},SIX_CHAR_HEX:{read:function(n){var t=n.match(/^#([A-F0-9]{6})$/i);return t!==null&&{space:"HEX",hex:parseInt("0x"+t[1].toString(),0)}},write:Ic},CSS_RGB:{read:function(n){var t=n.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return t!==null&&{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3])}},write:Ic},CSS_RGBA:{read:function(n){var t=n.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return t!==null&&{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3]),a:parseFloat(t[4])}},write:Ic}}},{litmus:oe.isNumber,conversions:{HEX:{read:function(n){return{space:"HEX",hex:n,conversionName:"HEX"}},write:function(n){return n.hex}}}},{litmus:oe.isArray,conversions:{RGB_ARRAY:{read:function(n){return n.length===3&&{space:"RGB",r:n[0],g:n[1],b:n[2]}},write:function(n){return[n.r,n.g,n.b]}},RGBA_ARRAY:{read:function(n){return n.length===4&&{space:"RGB",r:n[0],g:n[1],b:n[2],a:n[3]}},write:function(n){return[n.r,n.g,n.b,n.a]}}}},{litmus:oe.isObject,conversions:{RGBA_OBJ:{read:function(n){return!!(oe.isNumber(n.r)&&oe.isNumber(n.g)&&oe.isNumber(n.b)&&oe.isNumber(n.a))&&{space:"RGB",r:n.r,g:n.g,b:n.b,a:n.a}},write:function(n){return{r:n.r,g:n.g,b:n.b,a:n.a}}},RGB_OBJ:{read:function(n){return!!(oe.isNumber(n.r)&&oe.isNumber(n.g)&&oe.isNumber(n.b))&&{space:"RGB",r:n.r,g:n.g,b:n.b}},write:function(n){return{r:n.r,g:n.g,b:n.b}}},HSVA_OBJ:{read:function(n){return!!(oe.isNumber(n.h)&&oe.isNumber(n.s)&&oe.isNumber(n.v)&&oe.isNumber(n.a))&&{space:"HSV",h:n.h,s:n.s,v:n.v,a:n.a}},write:function(n){return{h:n.h,s:n.s,v:n.v,a:n.a}}},HSV_OBJ:{read:function(n){return!!(oe.isNumber(n.h)&&oe.isNumber(n.s)&&oe.isNumber(n.v))&&{space:"HSV",h:n.h,s:n.s,v:n.v}},write:function(n){return{h:n.h,s:n.s,v:n.v}}}}}],Tp=void 0,bg=void 0,M_=function(){bg=!1;var n=arguments.length>1?oe.toArray(arguments):arguments[0];return oe.each(MI,function(t){if(t.litmus(n))return oe.each(t.conversions,function(e,i){if(Tp=e.read(n),bg===!1&&Tp!==!1)return bg=Tp,Tp.conversionName=i,Tp.conversion=e,oe.BREAK}),oe.BREAK}),bg},wS=void 0,wg={hsv_to_rgb:function(n,t,e){var i=Math.floor(n/60)%6,r=n/60-Math.floor(n/60),o=e*(1-t),s=e*(1-r*t),a=e*(1-(1-r)*t),l=[[e,a,o],[s,e,o],[o,e,a],[o,s,e],[a,o,e],[e,o,s]][i];return{r:255*l[0],g:255*l[1],b:255*l[2]}},rgb_to_hsv:function(n,t,e){var i=Math.min(n,t,e),r=Math.max(n,t,e),o=r-i,s=void 0;return r===0?{h:NaN,s:0,v:0}:(s=n===r?(t-e)/o:t===r?2+(e-n)/o:4+(n-t)/o,(s/=6)<0&&(s+=1),{h:360*s,s:o/r,v:r/255})},rgb_to_hex:function(n,t,e){var i=this.hex_with_component(0,2,n);return i=this.hex_with_component(i,1,t),i=this.hex_with_component(i,0,e)},component_from_hex:function(n,t){return n>>8*t&255},hex_with_component:function(n,t,e){return e<<(wS=8*t)|n&~(255<<wS)}},AI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},rs=function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")},os=function(){function n(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,i){return e&&n(t.prototype,e),i&&n(t,i),t}}(),bl=function n(t,e,i){t===null&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,e);if(r===void 0){var o=Object.getPrototypeOf(t);return o===null?void 0:n(o,e,i)}if("value"in r)return r.value;var s=r.get;return s!==void 0?s.call(i):void 0},wl=function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(n,t):n.__proto__=t)},Sl=function(n,t){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||typeof t!="object"&&typeof t!="function"?n:t},er=function(){function n(){if(rs(this,n),this.__state=M_.apply(this,arguments),this.__state===!1)throw new Error("Failed to interpret color arguments");this.__state.a=this.__state.a||1}return os(n,[{key:"toString",value:function(){return Ic(this)}},{key:"toHexString",value:function(){return Ic(this,!0)}},{key:"toOriginal",value:function(){return this.__state.conversion.write(this)}}]),n}();function A_(n,t,e){Object.defineProperty(n,t,{get:function(){return this.__state.space==="RGB"||er.recalculateRGB(this,t,e),this.__state[t]},set:function(i){this.__state.space!=="RGB"&&(er.recalculateRGB(this,t,e),this.__state.space="RGB"),this.__state[t]=i}})}function R_(n,t){Object.defineProperty(n,t,{get:function(){return this.__state.space==="HSV"||er.recalculateHSV(this),this.__state[t]},set:function(e){this.__state.space!=="HSV"&&(er.recalculateHSV(this),this.__state.space="HSV"),this.__state[t]=e}})}er.recalculateRGB=function(n,t,e){if(n.__state.space==="HEX")n.__state[t]=wg.component_from_hex(n.__state.hex,e);else{if(n.__state.space!=="HSV")throw new Error("Corrupted color state");oe.extend(n.__state,wg.hsv_to_rgb(n.__state.h,n.__state.s,n.__state.v))}},er.recalculateHSV=function(n){var t=wg.rgb_to_hsv(n.r,n.g,n.b);oe.extend(n.__state,{s:t.s,v:t.v}),oe.isNaN(t.h)?oe.isUndefined(n.__state.h)&&(n.__state.h=0):n.__state.h=t.h},er.COMPONENTS=["r","g","b","h","s","v","hex","a"],A_(er.prototype,"r",2),A_(er.prototype,"g",1),A_(er.prototype,"b",0),R_(er.prototype,"h"),R_(er.prototype,"s"),R_(er.prototype,"v"),Object.defineProperty(er.prototype,"a",{get:function(){return this.__state.a},set:function(n){this.__state.a=n}}),Object.defineProperty(er.prototype,"hex",{get:function(){return this.__state.space!=="HEX"&&(this.__state.hex=wg.rgb_to_hex(this.r,this.g,this.b),this.__state.space="HEX"),this.__state.hex},set:function(n){this.__state.space="HEX",this.__state.hex=n}});var ku=function(){function n(t,e){rs(this,n),this.initialValue=t[e],this.domElement=document.createElement("div"),this.object=t,this.property=e,this.__onChange=void 0,this.__onFinishChange=void 0}return os(n,[{key:"onChange",value:function(t){return this.__onChange=t,this}},{key:"onFinishChange",value:function(t){return this.__onFinishChange=t,this}},{key:"setValue",value:function(t){return this.object[this.property]=t,this.__onChange&&this.__onChange.call(this,t),this.updateDisplay(),this}},{key:"getValue",value:function(){return this.object[this.property]}},{key:"updateDisplay",value:function(){return this}},{key:"isModified",value:function(){return this.initialValue!==this.getValue()}}]),n}(),SS={};oe.each({HTMLEvents:["change"],MouseEvents:["click","mousemove","mousedown","mouseup","mouseover"],KeyboardEvents:["keydown"]},function(n,t){oe.each(n,function(e){SS[e]=t})});var RI=/(\d+(\.\d+)?)px/;function ks(n){if(n==="0"||oe.isUndefined(n))return 0;var t=n.match(RI);return oe.isNull(t)?0:parseFloat(t[1])}var Gt={makeSelectable:function(n,t){n!==void 0&&n.style!==void 0&&(n.onselectstart=t?function(){return!1}:function(){},n.style.MozUserSelect=t?"auto":"none",n.style.KhtmlUserSelect=t?"auto":"none",n.unselectable=t?"on":"off")},makeFullscreen:function(n,t,e){var i=e,r=t;oe.isUndefined(r)&&(r=!0),oe.isUndefined(i)&&(i=!0),n.style.position="absolute",r&&(n.style.left=0,n.style.right=0),i&&(n.style.top=0,n.style.bottom=0)},fakeEvent:function(n,t,e,i){var r=e||{},o=SS[t];if(!o)throw new Error("Event type "+t+" not supported.");var s=document.createEvent(o);switch(o){case"MouseEvents":var a=r.x||r.clientX||0,l=r.y||r.clientY||0;s.initMouseEvent(t,r.bubbles||!1,r.cancelable||!0,window,r.clickCount||1,0,0,a,l,!1,!1,!1,!1,0,null);break;case"KeyboardEvents":var u=s.initKeyboardEvent||s.initKeyEvent;oe.defaults(r,{cancelable:!0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,keyCode:void 0,charCode:void 0}),u(t,r.bubbles||!1,r.cancelable,window,r.ctrlKey,r.altKey,r.shiftKey,r.metaKey,r.keyCode,r.charCode);break;default:s.initEvent(t,r.bubbles||!1,r.cancelable||!0)}oe.defaults(s,i),n.dispatchEvent(s)},bind:function(n,t,e,i){var r=i||!1;return n.addEventListener?n.addEventListener(t,e,r):n.attachEvent&&n.attachEvent("on"+t,e),Gt},unbind:function(n,t,e,i){var r=i||!1;return n.removeEventListener?n.removeEventListener(t,e,r):n.detachEvent&&n.detachEvent("on"+t,e),Gt},addClass:function(n,t){if(n.className===void 0)n.className=t;else if(n.className!==t){var e=n.className.split(/ +/);e.indexOf(t)===-1&&(e.push(t),n.className=e.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}return Gt},removeClass:function(n,t){if(t)if(n.className===t)n.removeAttribute("class");else{var e=n.className.split(/ +/),i=e.indexOf(t);i!==-1&&(e.splice(i,1),n.className=e.join(" "))}else n.className=void 0;return Gt},hasClass:function(n,t){return new RegExp("(?:^|\\s+)"+t+"(?:\\s+|$)").test(n.className)||!1},getWidth:function(n){var t=getComputedStyle(n);return ks(t["border-left-width"])+ks(t["border-right-width"])+ks(t["padding-left"])+ks(t["padding-right"])+ks(t.width)},getHeight:function(n){var t=getComputedStyle(n);return ks(t["border-top-width"])+ks(t["border-bottom-width"])+ks(t["padding-top"])+ks(t["padding-bottom"])+ks(t.height)},getOffset:function(n){var t=n,e={left:0,top:0};if(t.offsetParent)do e.left+=t.offsetLeft,e.top+=t.offsetTop,t=t.offsetParent;while(t);return e},isActive:function(n){return n===document.activeElement&&(n.type||n.href)}},TS=function(n){function t(e,i){rs(this,t);var r=Sl(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i)),o=r;return r.__prev=r.getValue(),r.__checkbox=document.createElement("input"),r.__checkbox.setAttribute("type","checkbox"),Gt.bind(r.__checkbox,"change",function(){o.setValue(!o.__prev)},!1),r.domElement.appendChild(r.__checkbox),r.updateDisplay(),r}return wl(t,n),os(t,[{key:"setValue",value:function(e){var i=bl(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setValue",this).call(this,e);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),this.__prev=this.getValue(),i}},{key:"updateDisplay",value:function(){return this.getValue()===!0?(this.__checkbox.setAttribute("checked","checked"),this.__checkbox.checked=!0,this.__prev=!0):(this.__checkbox.checked=!1,this.__prev=!1),bl(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(ku),CI=function(n){function t(e,i,r){rs(this,t);var o=Sl(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i)),s=r,a=o;if(o.__select=document.createElement("select"),oe.isArray(s)){var l={};oe.each(s,function(u){l[u]=u}),s=l}return oe.each(s,function(u,h){var d=document.createElement("option");d.innerHTML=h,d.setAttribute("value",u),a.__select.appendChild(d)}),o.updateDisplay(),Gt.bind(o.__select,"change",function(){var u=this.options[this.selectedIndex].value;a.setValue(u)}),o.domElement.appendChild(o.__select),o}return wl(t,n),os(t,[{key:"setValue",value:function(e){var i=bl(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setValue",this).call(this,e);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),i}},{key:"updateDisplay",value:function(){return Gt.isActive(this.__select)?this:(this.__select.value=this.getValue(),bl(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this))}}]),t}(ku),PI=function(n){function t(e,i){rs(this,t);var r=Sl(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i)),o=r;function s(){o.setValue(o.__input.value)}return r.__input=document.createElement("input"),r.__input.setAttribute("type","text"),Gt.bind(r.__input,"keyup",s),Gt.bind(r.__input,"change",s),Gt.bind(r.__input,"blur",function(){o.__onFinishChange&&o.__onFinishChange.call(o,o.getValue())}),Gt.bind(r.__input,"keydown",function(a){a.keyCode===13&&this.blur()}),r.updateDisplay(),r.domElement.appendChild(r.__input),r}return wl(t,n),os(t,[{key:"updateDisplay",value:function(){return Gt.isActive(this.__input)||(this.__input.value=this.getValue()),bl(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(ku);function ES(n){var t=n.toString();return t.indexOf(".")>-1?t.length-t.indexOf(".")-1:0}var MS=function(n){function t(e,i,r){rs(this,t);var o=Sl(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i)),s=r||{};return o.__min=s.min,o.__max=s.max,o.__step=s.step,oe.isUndefined(o.__step)?o.initialValue===0?o.__impliedStep=1:o.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(o.initialValue))/Math.LN10))/10:o.__impliedStep=o.__step,o.__precision=ES(o.__impliedStep),o}return wl(t,n),os(t,[{key:"setValue",value:function(e){var i=e;return this.__min!==void 0&&i<this.__min?i=this.__min:this.__max!==void 0&&i>this.__max&&(i=this.__max),this.__step!==void 0&&i%this.__step!=0&&(i=Math.round(i/this.__step)*this.__step),bl(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setValue",this).call(this,i)}},{key:"min",value:function(e){return this.__min=e,this}},{key:"max",value:function(e){return this.__max=e,this}},{key:"step",value:function(e){return this.__step=e,this.__impliedStep=e,this.__precision=ES(e),this}}]),t}(ku),Sg=function(n){function t(e,i,r){rs(this,t);var o=Sl(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i,r));o.__truncationSuspended=!1;var s=o,a=void 0;function l(){s.__onFinishChange&&s.__onFinishChange.call(s,s.getValue())}function u(d){var p=a-d.clientY;s.setValue(s.getValue()+p*s.__impliedStep),a=d.clientY}function h(){Gt.unbind(window,"mousemove",u),Gt.unbind(window,"mouseup",h),l()}return o.__input=document.createElement("input"),o.__input.setAttribute("type","text"),Gt.bind(o.__input,"change",function(){var d=parseFloat(s.__input.value);oe.isNaN(d)||s.setValue(d)}),Gt.bind(o.__input,"blur",function(){l()}),Gt.bind(o.__input,"mousedown",function(d){Gt.bind(window,"mousemove",u),Gt.bind(window,"mouseup",h),a=d.clientY}),Gt.bind(o.__input,"keydown",function(d){d.keyCode===13&&(s.__truncationSuspended=!0,this.blur(),s.__truncationSuspended=!1,l())}),o.updateDisplay(),o.domElement.appendChild(o.__input),o}return wl(t,n),os(t,[{key:"updateDisplay",value:function(){var e,i,r;return this.__input.value=this.__truncationSuspended?this.getValue():(e=this.getValue(),i=this.__precision,r=Math.pow(10,i),Math.round(e*r)/r),bl(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(MS);function AS(n,t,e,i,r){return i+(n-t)/(e-t)*(r-i)}var C_=function(n){function t(e,i,r,o,s){rs(this,t);var a=Sl(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i,{min:r,max:o,step:s})),l=a;function u(m){m.preventDefault();var g=l.__background.getBoundingClientRect();return l.setValue(AS(m.clientX,g.left,g.right,l.__min,l.__max)),!1}function h(){Gt.unbind(window,"mousemove",u),Gt.unbind(window,"mouseup",h),l.__onFinishChange&&l.__onFinishChange.call(l,l.getValue())}function d(m){var g=m.touches[0].clientX,_=l.__background.getBoundingClientRect();l.setValue(AS(g,_.left,_.right,l.__min,l.__max))}function p(){Gt.unbind(window,"touchmove",d),Gt.unbind(window,"touchend",p),l.__onFinishChange&&l.__onFinishChange.call(l,l.getValue())}return a.__background=document.createElement("div"),a.__foreground=document.createElement("div"),Gt.bind(a.__background,"mousedown",function(m){document.activeElement.blur(),Gt.bind(window,"mousemove",u),Gt.bind(window,"mouseup",h),u(m)}),Gt.bind(a.__background,"touchstart",function(m){m.touches.length===1&&(Gt.bind(window,"touchmove",d),Gt.bind(window,"touchend",p),d(m))}),Gt.addClass(a.__background,"slider"),Gt.addClass(a.__foreground,"slider-fg"),a.updateDisplay(),a.__background.appendChild(a.__foreground),a.domElement.appendChild(a.__background),a}return wl(t,n),os(t,[{key:"updateDisplay",value:function(){var e=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*e+"%",bl(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(MS),RS=function(n){function t(e,i,r){rs(this,t);var o=Sl(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i)),s=o;return o.__button=document.createElement("div"),o.__button.innerHTML=r===void 0?"Fire":r,Gt.bind(o.__button,"click",function(a){return a.preventDefault(),s.fire(),!1}),Gt.addClass(o.__button,"button"),o.domElement.appendChild(o.__button),o}return wl(t,n),os(t,[{key:"fire",value:function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}}]),t}(ku),P_=function(n){function t(e,i){rs(this,t);var r=Sl(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i));r.__color=new er(r.getValue()),r.__temp=new er(0);var o=r;r.domElement=document.createElement("div"),Gt.makeSelectable(r.domElement,!1),r.__selector=document.createElement("div"),r.__selector.className="selector",r.__saturation_field=document.createElement("div"),r.__saturation_field.className="saturation-field",r.__field_knob=document.createElement("div"),r.__field_knob.className="field-knob",r.__field_knob_border="2px solid ",r.__hue_knob=document.createElement("div"),r.__hue_knob.className="hue-knob",r.__hue_field=document.createElement("div"),r.__hue_field.className="hue-field",r.__input=document.createElement("input"),r.__input.type="text",r.__input_textShadow="0 1px 1px ",Gt.bind(r.__input,"keydown",function(y){y.keyCode===13&&p.call(this)}),Gt.bind(r.__input,"blur",p),Gt.bind(r.__selector,"mousedown",function(){Gt.addClass(this,"drag").bind(window,"mouseup",function(){Gt.removeClass(o.__selector,"drag")})}),Gt.bind(r.__selector,"touchstart",function(){Gt.addClass(this,"drag").bind(window,"touchend",function(){Gt.removeClass(o.__selector,"drag")})});var s,a=document.createElement("div");function l(y){g(y),Gt.bind(window,"mousemove",g),Gt.bind(window,"touchmove",g),Gt.bind(window,"mouseup",h),Gt.bind(window,"touchend",h)}function u(y){_(y),Gt.bind(window,"mousemove",_),Gt.bind(window,"touchmove",_),Gt.bind(window,"mouseup",d),Gt.bind(window,"touchend",d)}function h(){Gt.unbind(window,"mousemove",g),Gt.unbind(window,"touchmove",g),Gt.unbind(window,"mouseup",h),Gt.unbind(window,"touchend",h),m()}function d(){Gt.unbind(window,"mousemove",_),Gt.unbind(window,"touchmove",_),Gt.unbind(window,"mouseup",d),Gt.unbind(window,"touchend",d),m()}function p(){var y=M_(this.value);y!==!1?(o.__color.__state=y,o.setValue(o.__color.toOriginal())):this.value=o.__color.toString()}function m(){o.__onFinishChange&&o.__onFinishChange.call(o,o.__color.toOriginal())}function g(y){y.type.indexOf("touch")===-1&&y.preventDefault();var w=o.__saturation_field.getBoundingClientRect(),A=y.touches&&y.touches[0]||y,I=A.clientX,F=A.clientY,N=(I-w.left)/(w.right-w.left),U=1-(F-w.top)/(w.bottom-w.top);return U>1?U=1:U<0&&(U=0),N>1?N=1:N<0&&(N=0),o.__color.v=U,o.__color.s=N,o.setValue(o.__color.toOriginal()),!1}function _(y){y.type.indexOf("touch")===-1&&y.preventDefault();var w=o.__hue_field.getBoundingClientRect(),A=1-((y.touches&&y.touches[0]||y).clientY-w.top)/(w.bottom-w.top);return A>1?A=1:A<0&&(A=0),o.__color.h=360*A,o.setValue(o.__color.toOriginal()),!1}return oe.extend(r.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),oe.extend(r.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:r.__field_knob_border+(r.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),oe.extend(r.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),oe.extend(r.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),oe.extend(a.style,{width:"100%",height:"100%",background:"none"}),CS(a,"top","rgba(0,0,0,0)","#000"),oe.extend(r.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),(s=r.__hue_field).style.background="",s.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",s.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",s.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",s.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",s.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",oe.extend(r.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:r.__input_textShadow+"rgba(0,0,0,0.7)"}),Gt.bind(r.__saturation_field,"mousedown",l),Gt.bind(r.__saturation_field,"touchstart",l),Gt.bind(r.__field_knob,"mousedown",l),Gt.bind(r.__field_knob,"touchstart",l),Gt.bind(r.__hue_field,"mousedown",u),Gt.bind(r.__hue_field,"touchstart",u),r.__saturation_field.appendChild(a),r.__selector.appendChild(r.__field_knob),r.__selector.appendChild(r.__saturation_field),r.__selector.appendChild(r.__hue_field),r.__hue_field.appendChild(r.__hue_knob),r.domElement.appendChild(r.__input),r.domElement.appendChild(r.__selector),r.updateDisplay(),r}return wl(t,n),os(t,[{key:"updateDisplay",value:function(){var e=M_(this.getValue());if(e!==!1){var i=!1;oe.each(er.COMPONENTS,function(s){if(!oe.isUndefined(e[s])&&!oe.isUndefined(this.__color.__state[s])&&e[s]!==this.__color.__state[s])return i=!0,{}},this),i&&oe.extend(this.__color.__state,e)}oe.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var r=this.__color.v<.5||this.__color.s>.5?255:0,o=255-r;oe.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toHexString(),border:this.__field_knob_border+"rgb("+r+","+r+","+r+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,CS(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),oe.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+r+","+r+","+r+")",textShadow:this.__input_textShadow+"rgba("+o+","+o+","+o+",.7)"})}}]),t}(ku),II=["-moz-","-o-","-webkit-","-ms-",""];function CS(n,t,e,i){n.style.background="",oe.each(II,function(r){n.style.cssText+="background: "+r+"linear-gradient("+t+", "+e+" 0%, "+i+" 100%); "})}var LI=function(n,t){var e=t||document,i=document.createElement("style");i.type="text/css",i.innerHTML=n;var r=e.getElementsByTagName("head")[0];try{r.appendChild(i)}catch{}},OI=`<div id="dg-save" class="dg dialogue">
|
|
6334
|
+
`),{arg1:e,arg2:i})}}class Ca{constructor(t,e,i,r,o){this.ctx=t,this.fillStyle=e,this.width=i,this.height=r,this.config=o,this.clonedObjects=[],this._displayObject=null}get displayObject(){return this._displayObject||(this._displayObject=this.createDisplayObject()),this._displayObject}set displayObject(t){this._displayObject&&this._displayObject.destroy({children:!0,texture:!0}),this._displayObject=t}get hasFill(){return!!this.fillStyle&&this.fillStyle.fillType!=="noFill"}createDisplayObject(){var t;if(!this.fillStyle)return null;if(this.config.useSlideBackgroundFill&&this.ctx.bgTexture){const e=new xr;return e.texture=this.ctx.bgTexture,e}if(this.fillStyle.fillType==="solidFill"||this.fillStyle.fillType==="noFill")return null;if(this.fillStyle.fillType==="gradientFill")return uP(this.fillStyle,this.width,this.height);if(this.fillStyle.fillType==="blipFill"){const{src:e,filters:i}=this.fillStyle,r=this.ctx.spriteTexture.getTexture(e),o=this.ctx.spriteTexture.getFrameData(e);if(r){const s=new xr;if(s.texture=r,i.length>0&&this.config.useFilter&&(s.filters=function(a){const l=[];return a.forEach(u=>{if(u.type==="biLevel")l.push(new Yw("biLevel",u.args[0]));else if(u.type==="clrChange"||u.type==="changeBulletColor"){const h=Ds(u.args[0]),d=Ds(u.args[1]);l.push(new fP(u.type,h,d))}else u.type==="alphaModFix"?l.push(new Yw(u.type,u.args[0])):u.type==="lum"&&l.push(new vP(u.type,u.args[0],u.args[1]))}),l}(i)),this.config.fillFloat){const{l:a,t:l,r:u,b:h}=this.config.fillFloat.fillRect,d=this.width*(1-a-u),p=this.height*(1-l-h),m=(t=this.config.shapeRotation)!==null&&t!==void 0?t:0,g=new Ns;g.drawRect(0,0,d,p),g.pivot.x=d/2,g.pivot.y=p/2,g.rotation=m;const _=g.getBounds(),y=_.width,w=_.height;s.width=y,s.height=w,s.anchor.x=.5,s.anchor.y=.5,s.rotation=-1*m,s.name="math-texture",m===0?(s.position.x=y/2+a*this.width,s.position.y=w/2+l*this.width):(s.position.x=this.width/2,s.position.y=this.height/2)}else s.width=this.width,s.height=this.height,o.rotate&&(s.position.x=this.width/2,s.position.y=this.height/2,s.anchor.x=.5,s.anchor.y=.5,s.rotation=o.rotate/180*Math.PI);return s}}else if(this.fillStyle.fillType==="gifFill"){const{src:e,delays:i}=this.fillStyle,r=this.ctx.spriteTexture.getGifFrames(e).map((l,u)=>({texture:l,time:i[u]||20})),o=new s_(r,!0);o.width=this.width,o.height=this.height;const s=this.fillStyle.loop;let a=1;return o.onLoop=()=>{a+=1,s>0&&a>s&&o.gotoAndStop(o.totalFrames)},o}return null}isSolidFill(){var t;return((t=this.fillStyle)===null||t===void 0?void 0:t.fillType)==="solidFill"}getSolidFillColor(){var t;return((t=this.fillStyle)===null||t===void 0?void 0:t.fillType)==="solidFill"?this.fillStyle.color:"#000000"}getClonedDisplayObject(){const t=this.createDisplayObject();return this.clonedObjects.push(t),t}destroy(){var t;(t=this._displayObject)===null||t===void 0||t.destroy(),this._displayObject=null,this.clonedObjects.forEach(e=>{e==null||e.destroy()}),this.clonedObjects=[]}}var _P=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};class yP extends c_{constructor(t,e,i){var r;super(t,e,i),this.textureContainer=new ar,this.underline=null,this.cacheSprite=new xr;const{shapeId:o,paragraphIndex:s,lineIndex:a,unitIndex:l,lineHeight:u,width:h,underLine:d,fill:p,height:m,isHorz:g,lineWidth:_}=t,y=((r=p==null?void 0:p.fill)===null||r===void 0?void 0:r.fillType)==="solidFill"?p.fill.color:null;if(d){const w=g?u/16:_/16;this.underline=new nP(e,d.type,w,h,m,y,g,o,s,a,l)}this.textGraphics=this.createTextGraphics(),this.textFill=this.createTextFill(),this.strokeGraphics=this.createStrokeGraphics(),this.strokeFill=this.createStrokeFill()}createStrokeFill(){const{stroke:t,lineWidth:e,lineHeight:i}=this.json;return new Ca(this.ctx,t==null?void 0:t.fill,e,i,{useFilter:!1,useSlideBackgroundFill:!1})}createStrokeGraphics(){const{stroke:t}=this.json,e=t!=null&&t.key?{fillType:"blipFill",src:t.key,filters:[]}:void 0;return new Ca(this.ctx,e,(t==null?void 0:t.width)||0,(t==null?void 0:t.height)||0,{useFilter:!1,useSlideBackgroundFill:!1})}createTextFill(){const{isHorz:t,fill:e,lineWidth:i,lineHeight:r,fillLineHeight:o}=this.json;return t?new Ca(this.ctx,e==null?void 0:e.fill,i,Math.max(o,r),{useFilter:!1,useSlideBackgroundFill:!1}):new Ca(this.ctx,e==null?void 0:e.fill,o,r,{useFilter:!1,useSlideBackgroundFill:!1})}createTextGraphics(){var t;const{fill:e,content:i}=this.json;let r="#000000";((t=e==null?void 0:e.fill)===null||t===void 0?void 0:t.fillType)==="solidFill"&&(r=e.fill.color);const o=e!=null&&e.key?{fillType:"blipFill",src:e.key,filters:[{type:"changeBulletColor",args:["#000000",r]}]}:void 0;return new Ca(this.ctx,o,(e==null?void 0:e.width)||0,(e==null?void 0:e.height)||0,{useFilter:i==="\u25FE",useSlideBackgroundFill:!1})}getIterateEntry(){return null}getBgElement(){return null}updateTransform(t){var e,i,r,o;const{isHorz:s}=this.json;t.position={x:s&&(i=(e=t.position)===null||e===void 0?void 0:e.x)!==null&&i!==void 0?i:0,y:s?0:(o=(r=t.position)===null||r===void 0?void 0:r.y)!==null&&o!==void 0?o:0},t.width=s?this.json.width:this.json.lineWidth,t.height=s?this.json.lineHeight:this.json.height,super.updateTransform(t)}preRender(){var t;(t=this.underline)===null||t===void 0||t.preRender()}render(t){t.addSubMTask(()=>_P(this,void 0,void 0,function*(){this.doRender()}),"@TextUnitImpl[doRender]")}doRender(){let t=!1;const{lineWidth:e,lineHeight:i,baseLine:r,isHorz:o,underline:s,height:a,width:l,highlightColor:u,x:h,y:d,content:p,fillLineHeight:m,fill:g}=this.json;let _=this.json.needFill!==!1;if(g&&g.fill&&g.fill.fillType!=="solidFill"&&(_=!0),u){const y=new Ns,[w,A]=Bw(u);y.beginFill(w,A),y.drawRect(0,0,o?l:e,o?i:a),y.endFill(),this.textureContainer.addChild(y)}if(this.textGraphics.displayObject){const y=this.textGraphics.displayObject;if(o&&(y.position.y=d>0?d:0),_){const w=this.textFill.displayObject;if(w)w.mask=y,w.addChild(y),w.position.x=-h,y.position.x+=h,t=!0,this.textureContainer.addChild(w);else if(this.textFill.isSolidFill()){const A=new gp;A.color=this.textFill.getSolidFillColor(),y.filters=[A],t=!0,this.textureContainer.addChild(y)}}else this.textureContainer.addChild(y)}if(this.strokeGraphics.displayObject){const y=this.strokeGraphics.displayObject;if(_){const w=this.strokeFill.displayObject;if(w)w.mask=y,w.addChild(y),o?w.position.y=d>0?d:0:w.position.x=h,this.textureContainer.addChild(w);else if(this.strokeFill.isSolidFill()){o?y.position.y=d>0?d:0:y.position.x=h;const A=new gp;A.color=this.strokeFill.getSolidFillColor(),y.filters=[A],t=!0,this.textureContainer.addChild(y)}}else o?y.position.y=d>0?d:0:y.position.x=h,this.textureContainer.addChild(y)}if(this.underline&&(this.underline.render(),this.underline.sprite)){o?(this.underline.sprite.position.y=s?s-i/16:r,this.underline.sprite.position.x=0):(this.underline.sprite.position.x=0,this.underline.sprite.position.y=0);const y=this.textFill.getClonedDisplayObject();y?(y.mask=this.underline.sprite,y.addChild(this.underline.sprite),this.textureContainer.addChild(y)):this.textureContainer.addChild(this.underline.sprite)}if(t){const y=Ro.create({width:o?l:e,height:o?Math.max(m,i):a,resolution:this.ctx.renderer.resolution});this.ctx.renderer.render(this.textureContainer,{renderTexture:y}),this.cacheSprite.texture=y,o&&d<0&&(this.cacheSprite.position.y=d),this.container.addChild(this.cacheSprite)}else this.container.addChild(this.textureContainer);this.container.name=p}destroy(){this.textFill.destroy(),this.textGraphics.destroy(),this.strokeFill.destroy(),this.strokeGraphics.destroy(),this.cacheSprite.texture.destroy(!0),this.cacheSprite.destroy(),this.textureContainer.destroy(),this.container.destroy()}}var $w=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};class xP extends c_{constructor(){super(...arguments),this.units=[],this.isHorz=!0}getIterateElements(){return this.units}getIterateEntry(t,e,i){return this.units[e]?this.units[e]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",i),null)}preRender(){}createUnits(t,e,i,r){for(let o=0,s=this.json.textUnits.length;o<s;o++)r.addSubMTask(()=>$w(this,void 0,void 0,function*(){const a=this.json.textUnits[o],{height:l,width:u,fillHeight:h,baseline:d,y:p,underline:m}=this.json,g=new yP(Object.assign(Object.assign({},a),{lineHeight:l,lineWidth:u,baseLine:d-p,underline:m,fillLineHeight:h||l,isHorz:this.isHorz,shapeId:t,paragraphIndex:e,lineIndex:i,unitIndex:o}),this.ctx,this.global);g.preRender(),this.units.push(g)}),"@TextLineImpl[createUnits]")}render(t){for(const e of this.units.reverse())e.render(t),t.addSubMTask(()=>$w(this,void 0,void 0,function*(){this.container.addChild(e.container)}),"@TextLineImpl[container.addChild]")}destroy(){this.units.forEach(t=>{t.destroy()}),this.container.destroy({children:!1})}}var Jw=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};class bP extends c_{constructor(){super(...arguments),this.iterateElements=[],this.lines=[],this.isHorz=!0}getIterateElements(){if(this.iterateElements.length>0)return this.iterateElements;const t=this.lines.reduce((e,i)=>e=e.concat(i.getIterateElements()),[]);return this.iterateElements=t,t}getIterateEntry(t,e,i){const r=this.getIterateElements();return r[e]?r[e]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",i),null)}preRender(){}createLines(t,e,i){for(let r=0,o=this.json.lines.length;r<o;r++)i.addSubMTask(()=>Jw(this,void 0,void 0,function*(){const s=this.json.lines[r],a=new xP(s,this.ctx,this.global);a.isHorz=this.isHorz,a.container.name="line-"+r,a.createUnits(t,e,r,i),this.lines.push(a)}),"@TextParagraphImpl[createLines]")}render(t){for(const e of this.lines)e.render(t),t.addSubMTask(()=>Jw(this,void 0,void 0,function*(){this.container.addChild(e.container)}),"@TextParagraphImpl[container.addChild]")}destroy(){this.lines.forEach(t=>{t.destroy()}),this.container.destroy({children:!1})}}var cg=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};class wP{constructor(t,e,i,r){this.iterateElements=[],this.paragraphs=[],this.container=new ar,this.json=t,this.ctx=e,this.parentGlobalPos=r,this.iterateType=i,this.container.name="textBody",this.global={x:this.parentGlobalPos.x+t.position.x,y:this.parentGlobalPos.y+t.position.y},this.container.position.x=t.position.x,this.container.position.y=t.position.y,this.container.scale.x=t.scale.x,this.container.scale.y=t.scale.y;const o=new Ns;o.drawRect(0,0,t.width,t.height),this.container.addChild(o)}get width(){return this.json.width}get height(){return this.json.height}get x(){return this.json.position.x}get y(){return this.json.position.y}getTextElement(t,e){return t==="paragraph"?this.paragraphs[e[0]]:null}getIterateEntry(t,e){return this.iterateElements[t]?this.iterateElements[t]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",e),null)}destroy(){this.paragraphs.forEach(t=>{t.destroy()})}createParagraphs(t,e){for(let i=0,r=this.json.paragraphs.length;i<r;i++)e.addSubMTask(()=>cg(this,void 0,void 0,function*(){var o;const s=this.json.paragraphs[i],a=new bP(s,this.ctx,this.global);a.isHorz=(o=this.json.isHorz)===null||o===void 0||o,a.createLines(t,i,e),e.addSubMTask(()=>cg(this,void 0,void 0,function*(){this.iterateElements=this.iterateElements.concat(a.getIterateElements()),a.container.name="\u6BB5\u843D-"+i,this.paragraphs.push(a)}),"@TextBodyImpl[paragraphs.push]")}),"@TextBodyImpl[createParagraphs]")}render(t){for(const e of this.paragraphs)e.render(t),t.addSubMTask(()=>cg(this,void 0,void 0,function*(){this.container.addChild(e.container)}),"@TextBodyImpl[container.addChild]");t.addSubMTask(()=>cg(this,void 0,void 0,function*(){const{width:e}=this.container;this.container.scale.x<0&&(this.container.x+=-1*e)}),"@TextBodyImpl[reset width]")}}var SP=v(47),TP=v.n(SP),EP=v(48),MP=v.n(EP);const AP={Reflection:class extends Nr{constructor(n){super(TP.a,MP.a,{uShapeFilterArea:new Float32Array([0,0,0,0]),uStartAlpha:n.startAlpha,uEndAlpha:n.endAlpha,uBlur:0}),this.json=n}}};class RP{constructor(t){this.scaleX=1,this.scaleY=1,this.pivot={x:0,y:0},this.paths=[],this.hash="",this.width=0,this.height=0,this.graphicsId="",this.textureId="",this.id=t.id,this.type=t.type,this.heightSize=t.heightSize,this.widthSize=t.widthSize,this.fillStyle=t.fillStyle||{fillType:"solidFill",color:"#ffffffff"},this.lineWidth=t.lineWidth||1,this.position=t.position||{x:0,y:0},this.rotate=t.rotation||1,this.path=this.getUnitPath(),this.setScaleFromLineWidth(),this.setScaleFromSize(),this.generatePaths(),this.setPivot()}setPivot(){switch(this.type){case"oval":case"diamond":this.pivot={x:this.width/2,y:this.height/2};break;case"triangle":this.pivot={x:.7*this.width,y:this.height/2};break;case"arrow":case"stealth":default:this.pivot={x:this.width,y:this.height/2}}}generatePaths(){this.hash="arrow-"+sg()(this.path+this.scaleX+this.scaleY),this.paths=[{id:this.id,path:this.path,fill:"norm",hasStroke:!1,hash:this.hash,scale:{x:this.scaleX,y:this.scaleY}}]}getUnitPath(){switch(this.type){case"stealth":return"M 0,0 L 95250,47625 L 0,95250 L 28575,47625 C C";case"oval":return"M 0,47625 A 47625,47625,-3.14159265,6.2831853 C C";case"diamond":return"M 47625,0 L 95250,47625 L 47625,95250 L 0,47625 C C";case"arrow":return"M 9525,0 L 95250,47625 L 9525,95250 L 0,85725 L 68389.5,47625 L 0,9525 C C";case"triangle":return"M 0,0 L 95250,47625 L 0,95250 C C";default:return""}}setScaleFromLineWidth(){switch(this.type){case"stealth":case"oval":case"diamond":case"arrow":case"triangle":this.scaleX*=.29*this.lineWidth+.7,this.scaleY*=.29*this.lineWidth+.7;break;default:throw new Error("can't match any arrow type!")}}setScaleFromSize(){switch(this.type){case"stealth":case"oval":case"diamond":case"arrow":case"triangle":this.scaleX*=1,this.scaleY*=1;break;default:throw new Error("can't match any arrow type!")}switch(this.widthSize){case"sm":this.scaleX*=3/4;break;case"lg":this.scaleX*=1.25;break;case"med":this.scaleX*=1}switch(this.heightSize){case"sm":this.scaleY*=3/4;break;case"lg":this.scaleY*=1.25;break;case"med":this.scaleY*=1}this.width=10*this.scaleX,this.height=10*this.scaleY}}class Zw{constructor(t,e,i,r,o,s,a,l,u,h,d){this.id=t,this.ctx=e,this.paths=i,this.hash=r,this.nept=o,this.width=s,this.height=a,this.lineStyle=l,this.shouldFill=u,this.bgColor=h,this.lnColor=d,this.clonedObjects=[],this._displayObject=null,this.isRectangle=!1,this.isPureRect=!1,this.isColoredPureRect=!1,this.isRectangle=this.rectangleDetect(i),this.isRectangle&&u?this.bgColor?this.isColoredPureRect=!0:this.isPureRect=!0:this.ctx.graphicsTexture.addGraphics(this.id,this.paths,this.hash,this.nept,this.width,this.height,this.lineStyle,this.ctx.objectPoolGroup,this.shouldFill,this.bgColor,this.lnColor)}get displayObject(){return this._displayObject}pointDis(t,e){return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)}rectangleDetect(t){if(t.length!==1)return!1;const e=t[0].path.trim().split(" ");if(e.length!==10)return!1;const i=[],r=[];for(let l=0;l<e.length;l+=2){const u=e[l],h=e[l+1],[d,p]=h.split(",").map(m=>Number(m)/100);i.push(u),r.push({x:d,y:p})}if(i.join("")!=="MLLLC")return!1;for(let l=0;l<3;l++){const u=r[l],h=r[l+1];if(u.x!==h.x&&u.y!==h.y)return!1}const o=r.slice(0,4).reduce((l,u)=>l+u.x,0)/4,s=r.slice(0,4).reduce((l,u)=>l+u.y,0)/4;if(Number.isNaN(o)||Number.isNaN(s))return!1;const a={x:o,y:s};return ao(this.pointDis(a,r[0]),this.pointDis(a,r[1]))&&ao(this.pointDis(a,r[0]),this.pointDis(a,r[2]))&&ao(this.pointDis(a,r[0]),this.pointDis(a,r[3]))&&this.pointDis(a,r[0])===this.pointDis(a,r[1])}createDisplayObject(){if(this.isPureRect){const t=new Ns;return t.beginFill(0,1),t.drawRect(0,0,this.width,this.height),t}if(this.isColoredPureRect&&this.bgColor){const t=new Ns,[e,i]=Bw(this.bgColor);return t.beginFill(e,i),t.drawRect(0,0,this.width,this.height),t}{const t=new xr,e=this.ctx.graphicsTexture.getGraphicsData(this.id);return e?(t.texture=e.texture,t.pivot.x=e.pivot.x,t.pivot.y=e.pivot.y,t):null}}getClonedDisplayObject(){const t=this.createDisplayObject();return this.clonedObjects.push(t),t}render(){this._displayObject=this.createDisplayObject()}isNeedMask(t,e){let i=!1;return this._displayObject&&(i=!(this.isRectangle&&Math.abs(t-this._displayObject.width)<2&&Math.abs(e-this._displayObject.height)<2&&this.shouldFill)),i}addArrows(t){var e;(e=this._displayObject)===null||e===void 0||e.addChild(t)}destroy(){var t;(t=this._displayObject)===null||t===void 0||t.destroy(),this._displayObject=null,this.clonedObjects.forEach(e=>{e==null||e.destroy()}),this.clonedObjects=[]}}var g_=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};const Du={pivot:{x:0,y:0},width:0,height:0};class Kw extends h_{constructor(t,e,i,r){var o;super(t,e,i),this.renderContainer=new ar,this.needCacheAsBitMap=!1,this.backgroundGraphics=null,this.filterAreaJustifies=[],this.strokeGraphics=null,this.arrowList=[],this.fillColorFilter=new gp,this.strokeColorFilter=new gp,this.id="",this.fill=new Fw(this),this.stroke=new KC(this),this.updateFilterArea=()=>{const l=this.renderContainer.getBounds(!1),u=this.filterAreaJustifies.map(m=>m(l)),h=u.map(m=>m.width),d=u.map(m=>m.height),p=new bi(l.x,l.y,Math.max(...h),Math.max(...d));this.renderContainer.filterArea=p,(this.renderContainer.filters||[]).forEach(m=>{m.uniforms.uShapeFilterArea=new Float32Array(4),m.uniforms.uShapeFilterArea[0]=p.x,m.uniforms.uShapeFilterArea[1]=p.y,m.uniforms.uShapeFilterArea[2]=p.width,m.uniforms.uShapeFilterArea[3]=p.height})},this.json=t,this.json.fillStyle&&this.json.fillStyle.fillType==="groupFill"&&r&&(this.json.fillStyle=r),this.id=t.id;const{fillStyle:s,lineStyle:a}=this.json;this.container.name=t.id,this.renderContainer.name=t.id+"-render-container",this.generateArrowList(),this.backgroundFill=this.createBackgroundFill(),this.backgroundGraphics=this.createBackgroundGraphics(),this.strokeFill=this.createStrokeFill(),this.strokeGraphics=this.createStrokeGraphics(),this.ctx.timingTargets.addTarget(this.id,this),(s==null?void 0:s.fillType)==="solidFill"&&(this.fillColorFilter.currentColor=s.color,this.fillColorFilter.designColor=s.color),((o=a==null?void 0:a.fill)===null||o===void 0?void 0:o.fillType)==="solidFill"&&(this.strokeColorFilter.currentColor=a.fill.color,this.strokeColorFilter.designColor=a.fill.color),this.updateTransform(this.json),t.textBody&&(this.text=new wP(t.textBody,this.ctx,t.textBody.iterateType,{x:this.designGlobalPosition.x,y:this.designGlobalPosition.y})),this.container.hitArea=new M0(1,1,this.json.width,this.json.height)}get interactiveContainer(){return this.renderContainer}get strokeActive(){var t,e,i,r,o,s,a;return this.strokeFill.displayObject?((i=(e=(t=this.strokeFill.displayObject)===null||t===void 0?void 0:t.filters)===null||e===void 0?void 0:e.length)!==null&&i!==void 0?i:-1)>0:((a=(s=(o=(r=this.strokeGraphics)===null||r===void 0?void 0:r.displayObject)===null||o===void 0?void 0:o.filters)===null||s===void 0?void 0:s.length)!==null&&a!==void 0?a:-1)>0}set strokeActive(t){var e,i,r,o,s,a;const{displayObject:l}=this.strokeFill;t?l&&((i=(e=l.filters)===null||e===void 0?void 0:e.indexOf(this.strokeColorFilter))!==null&&i!==void 0?i:-1)<0?l.filters=[this.strokeColorFilter]:((r=this.strokeGraphics)===null||r===void 0?void 0:r.displayObject)&&((s=(o=this.strokeGraphics.displayObject.filters)===null||o===void 0?void 0:o.indexOf(this.strokeColorFilter))!==null&&s!==void 0?s:-1)<0&&(this.strokeGraphics.displayObject.filters=[this.strokeColorFilter]):l?l.filters=[]:!((a=this.strokeGraphics)===null||a===void 0)&&a.displayObject&&(this.strokeGraphics.displayObject.filters=[])}get fillActive(){var t,e,i,r,o,s,a;return this.backgroundFill.displayObject?((i=(e=(t=this.backgroundFill.displayObject)===null||t===void 0?void 0:t.filters)===null||e===void 0?void 0:e.length)!==null&&i!==void 0?i:-1)>0:((a=(s=(o=(r=this.backgroundGraphics)===null||r===void 0?void 0:r.displayObject)===null||o===void 0?void 0:o.filters)===null||s===void 0?void 0:s.length)!==null&&a!==void 0?a:-1)>0}set fillActive(t){var e,i,r,o,s,a;t?this.backgroundFill.displayObject&&((i=(e=this.backgroundFill.displayObject.filters)===null||e===void 0?void 0:e.indexOf(this.fillColorFilter))!==null&&i!==void 0?i:-1)<0?this.backgroundFill.displayObject.filters=[this.fillColorFilter]:((r=this.backgroundGraphics)===null||r===void 0?void 0:r.displayObject)&&((s=(o=this.backgroundGraphics.displayObject.filters)===null||o===void 0?void 0:o.indexOf(this.fillColorFilter))!==null&&s!==void 0?s:-1)<0&&(this.backgroundGraphics.displayObject.filters=[this.fillColorFilter]):this.backgroundFill.displayObject?this.backgroundFill.displayObject.filters=[]:!((a=this.backgroundGraphics)===null||a===void 0)&&a.displayObject&&(this.backgroundGraphics.displayObject.filters=[])}getTextElement(t,e){var i,r;return(r=(i=this.text)===null||i===void 0?void 0:i.getTextElement(t,e))!==null&&r!==void 0?r:null}getBgElement(){return this}getIterateEntry(t,e,i){return e===0?this:t==="el"?(this.ctx.eventHub.emit("IterateTimeNodeEnd",i),null):this.text?this.text.getIterateEntry(e-1,i)||null:(this.ctx.eventHub.emit("IterateTimeNodeEnd",i),null)}createStrokeGraphics(){var t,e,i,r;const{id:o,geometry:s,lineStyle:a}=this.json,{width:l,height:u,pivot:h}=(s==null?void 0:s.lineTransform)||Du,d=l||this.json.width,p=u||this.json.height,m=((t=a==null?void 0:a.fill)===null||t===void 0?void 0:t.fillType)==="solidFill"?a.fill.color:null;return a&&((e=a.fill)===null||e===void 0?void 0:e.fillType)!=="noFill"?new Zw(o+"-path-graphics",this.ctx,(i=s==null?void 0:s.paths)!==null&&i!==void 0?i:[],(r=s==null?void 0:s.hash)!==null&&r!==void 0?r:"",h||{x:0,y:0},d,p,a,!1,null,m):null}createStrokeFill(){const[t,e]=this.calculateFillObjectOffset(),{geometry:i,lineStyle:r,width:o,height:s}=this.json,a=(i==null?void 0:i.lineTransform)||Du,l=Object(V.isNumber)(r==null?void 0:r.width)?r.width:1;return new Ca(this.ctx,r==null?void 0:r.fill,(a.width||o)+l+t,Math.max((a.height||s)+l,e),{useFilter:!1,useSlideBackgroundFill:!1})}createBackgroundGraphics(){var t;const{geometry:e,lineStyle:i,fillStyle:r,id:o}=this.json,{width:s,height:a,pivot:l}=(e==null?void 0:e.lineTransform)||Du,u=s||this.json.width,h=a||this.json.height,d=(r==null?void 0:r.fillType)==="solidFill"?r.color:null;return r&&r.fillType!=="noFill"||this.json.isPicture?new Zw(o+"-bg-graphics",this.ctx,(t=e==null?void 0:e.paths)!==null&&t!==void 0?t:[],(e==null?void 0:e.hash)||"",l||{x:0,y:0},u,h,i,!0,d,null):null}createBackgroundFill(){var t,e;const{fillStyle:i,width:r,height:o,lineStyle:s,geometry:a}=this.json,l=(a==null?void 0:a.fillTransform)||Du;return new Ca(this.ctx,i,(l.width||r)+((t=s==null?void 0:s.width)!==null&&t!==void 0?t:0),(l.height||o)+((e=s==null?void 0:s.width)!==null&&e!==void 0?e:0),{useFilter:!1,useSlideBackgroundFill:this.json.useBgFill,fillFloat:this.json.fillFloat,shapeRotation:this.json.rotation})}createBackground(){var t,e,i,r,o,s,a,l;const{pivot:u,width:h,height:d}=((t=this.json.geometry)===null||t===void 0?void 0:t.fillTransform)||Du,{displayObject:p}=this.backgroundFill;p?(this.json.useBgFill&&((i=this.backgroundGraphics)===null||i===void 0?void 0:i.displayObject)?(this.needCacheAsBitMap=!0,p.mask=this.backgroundGraphics.displayObject,p.pivot.x=((r=this.json.position)===null||r===void 0?void 0:r.x)||0,p.pivot.y=((o=this.json.position)===null||o===void 0?void 0:o.y)||0,this.container.addChild(this.backgroundGraphics.displayObject)):((s=this.json.fillStyle)===null||s===void 0?void 0:s.fillType)==="gifFill"?(p.height=d||this.designHeight,p.width=h||this.designWidth,p instanceof s_&&p.play(),!((a=this.backgroundGraphics)===null||a===void 0)&&a.isNeedMask(p.width,p.height)&&(p.mask=this.backgroundGraphics.displayObject,this.backgroundGraphics.displayObject&&this.container.addChild(this.backgroundGraphics.displayObject))):!((l=this.backgroundGraphics)===null||l===void 0)&&l.isNeedMask(p.width,p.height)&&(this.json.fillFloat||(this.needCacheAsBitMap=!0,p.mask=this.backgroundGraphics.displayObject,this.backgroundGraphics.displayObject&&this.container.addChild(this.backgroundGraphics.displayObject))),this.json.fillFloat||(p.x=u.x,p.y=u.y),this.container.addChild(p)):this.backgroundFill.hasFill&&((e=this.backgroundGraphics)===null||e===void 0?void 0:e.displayObject)&&this.container.addChild(this.backgroundGraphics.displayObject)}createPathFill(){var t,e,i;const{displayObject:r}=this.strokeFill,o=(t=this.strokeGraphics)===null||t===void 0?void 0:t.displayObject,[s,a]=this.calculateFillObjectOffset();r?(((e=this.strokeGraphics)===null||e===void 0?void 0:e.isNeedMask(r.width,r.height))&&o&&(this.needCacheAsBitMap=!0,r.pivot.x=o.pivot.x,r.pivot.y=o.pivot.y,o.pivot.x=0,o.pivot.y=0,r.mask=o,r.addChild(o),r.position.x=-s/2,r.position.y=-a/2,o.position.x=s/2,o.position.y=a/2),this.container.addChild(r)):this.strokeFill.hasFill&&((i=this.strokeGraphics)===null||i===void 0?void 0:i.displayObject)&&this.container.addChild(this.strokeGraphics.displayObject)}createFilledPathMask(){var t,e,i;const r=((e=(t=this.json.geometry)===null||t===void 0?void 0:t.paths)===null||e===void 0?void 0:e.filter(o=>o.fill!=="none"&&o.fill!=="norm"))||[];for(const o of r){const s=this.ctx.graphicsTexture.getGraphicsData(o.id);if(s){const a=new xr(s.texture);a.pivot.x=s.pivot.x,a.pivot.y=s.pivot.y;const l=this.backgroundFill.getClonedDisplayObject(),u=(i=this.backgroundGraphics)===null||i===void 0?void 0:i.getClonedDisplayObject(),h=l||u;h&&(this.backgroundFill.displayObject&&(h.pivot.x=this.backgroundFill.displayObject.pivot.x,h.pivot.y=this.backgroundFill.displayObject.pivot.y),h.mask=a,h.filters=[iP[o.fill]],this.needCacheAsBitMap=!0,this.container.addChild(h),this.container.addChild(a))}}}createArrow(){this.arrowList.length&&this.arrowList.forEach(t=>{var e;const i=this.ctx.graphicsTexture.getGraphicsData(t.graphicsId);if(i){const{texture:r}=i,o=new xr(r);o.pivot.x=t.pivot.x,o.pivot.y=t.pivot.y,o.position.x=t.position.x,o.position.y=t.position.y,o.rotation=t.rotate/180*Math.PI,(e=this.backgroundGraphics)===null||e===void 0||e.addArrows(o)}})}generateArrowList(){var t,e;const{lineArrowList:i,lineStyle:r,id:o}=this.json,s=((t=r==null?void 0:r.fill)===null||t===void 0?void 0:t.fillType)==="solidFill"?r.fill.color:null;(e=i||[])===null||e===void 0||e.forEach((a,l)=>{var u,h;const d=new RP(Object.assign(Object.assign({},a),{fillStyle:r==null?void 0:r.fill,lineWidth:(u=r==null?void 0:r.width)!==null&&u!==void 0?u:0}));d.graphicsId=`${o}-arrow-${l}-graphics`,d.textureId=`${o}-arrow-${l}-fill`,this.ctx.graphicsTexture.addGraphics(d.graphicsId,(h=d.paths)!==null&&h!==void 0?h:[],d.hash,{x:0,y:0},d.width,d.height,void 0,this.ctx.objectPoolGroup,!0,s,null),this.arrowList.push(d)})}calculateFillObjectOffset(){let[t,e]=[0,0];return this.arrowList.length&&(t=this.arrowList.reduce((i,r)=>Math.max(i,r.width),0),e=this.arrowList.reduce((i,r)=>Math.max(i,r.height),0)),[t,e]}preRender(t){var e,i,r;const{lineStyle:o,geometry:s}=this.json,{width:a,height:l}=(s==null?void 0:s.lineTransform)||Du,u=a||this.json.width,h=l||this.json.height,d=((e=s==null?void 0:s.paths)===null||e===void 0?void 0:e.filter(m=>m.fill!=="none"&&m.fill!=="norm"))||[],p=((i=o==null?void 0:o.fill)===null||i===void 0?void 0:i.fillType)==="solidFill"?o.fill.color:null;t.addSubMTask(()=>g_(this,void 0,void 0,function*(){for(const m of d)this.ctx.graphicsTexture.addGraphics(m.id,[m],m.hash,((s==null?void 0:s.lineTransform)||Du).pivot,u,h,o,this.ctx.objectPoolGroup,!0,null,p)}),"@ShapeImpl[addGraphics]"),(r=this.text)===null||r===void 0||r.createParagraphs(this.json.id,t)}subClassRender(){}setupEffect(){const{effectList:t}=this.json;if(t&&t.length>0){const e=[];return t.forEach(i=>{i.type==="reflection"&&(this.filterAreaJustifies.push(r=>(r.height*=2,r)),e.push(new AP.Reflection(i)))}),this.ctx.ticker.add(this.updateFilterArea,void 0,-20),this.renderContainer.filters=e,!0}return!1}render(t){t.addSubMTask(()=>g_(this,void 0,void 0,function*(){var e,i;(e=this.strokeGraphics)===null||e===void 0||e.render(),(i=this.backgroundGraphics)===null||i===void 0||i.render(),this.createBackground(),this.subClassRender(),this.createFilledPathMask(),this.createPathFill(),this.createArrow()}),"@ShapeImpl[render]"),this.text&&this.text.render(t),t.addSubMTask(()=>g_(this,void 0,void 0,function*(){var e,i,r,o,s,a,l,u;if(((e=this.json.textBody)===null||e===void 0?void 0:e.iterateType)==="wd"||((i=this.json.textBody)===null||i===void 0?void 0:i.iterateType)==="lt")this.renderContainer.addChild(this.container),this.text&&(this.text.container.scale.y=(o=(r=this.json.scale)===null||r===void 0?void 0:r.y)!==null&&o!==void 0?o:1,this.text.container.position.x+=((a=(s=this.json.position)===null||s===void 0?void 0:s.x)!==null&&a!==void 0?a:0)+this.text.x,this.text.container.position.y+=((u=(l=this.json.position)===null||l===void 0?void 0:l.y)!==null&&u!==void 0?u:0)+this.text.y,this.text.container.scale.y===-1&&(this.text.container.position.y+=this.text.height),this.renderContainer.addChild(this.text.container));else{if(this.text){if(Object(V.isBoolean)(this.json.textRotateWithShape)&&!this.json.textRotateWithShape){const h=this.json.rotation||0;this.text.container.rotation=-h;const{width:d}=this.text;this.text.container.position.x=d}this.container.addChild(this.text.container)}this.renderContainer.addChild(this.container)}if(this.needCacheAsBitMap,this.json.id==="background"&&this.ctx.hasBackgroundFillShape){const h=Ro.create({width:this.json.width,height:this.json.height,resolution:Math.ceil(this.ctx.renderer.resolution)});this.ctx.renderer.render(this.renderContainer,{renderTexture:h}),this.ctx.bgTexture=h}}),"@ShapeImpl[post.render]")}clearOnSlideChange(){}initOnReuse(){}destroy(){var t,e,i,r;(t=this.text)===null||t===void 0||t.destroy(),this.fillColorFilter.destroy(),this.strokeColorFilter.destroy(),this.backgroundFill.destroy(),(e=this.backgroundGraphics)===null||e===void 0||e.destroy(),this.strokeFill.destroy(),(i=this.strokeGraphics)===null||i===void 0||i.destroy(),this.renderContainer.destroy(),(r=this.arrowRenderTexture)===null||r===void 0||r.destroy(!0),this.arrowList=[]}}var v_=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};function Pa(n,t){for(const e in t)n.style[e]=t[e]}class yp{constructor(t){var e,i;this.progress=document.createElement("div"),this.totalTime=document.createElement("span"),this.playButton=document.createElement("div"),this.pauseButton=document.createElement("div"),this.currentTime=document.createElement("span"),this.mediaController=document.createElement("div"),this.currentProgress=document.createElement("div"),this.medianIsEnd=!1,this.pickBookmarkIndex=0,this.playCallBackList=[],this.duration=0,this.start=0,this.end=0,this.changeMediaProgress=r=>{if(this.ctx.isPlayerPaused())return void this.ctx.logger.info("Media controller prevent seek event with paused state",this.ctx.taskId);r.stopPropagation();const o=r.offsetX/this.progress.clientWidth*this.duration;this.medianIsEnd=!1,this.ctx.mode!=="interactive"&&this.jumpToTime(o),this.ctx.mode!=="local"&&this.ctx.eventHub.emit(Ne.mediaSeek,{id:this.targetId,time:o,isPlaying:this.media.isPlaying})},this.jumpToTime=(r=0)=>{const o=Math.floor(r)+this.start;this.media.currentTime!==o&&(this.media.currentTime=o,this.changeBookmarkIndex(o,o>this.media.currentTime))},this.showController=r=>{r.stopPropagation(),this.show()},this.getMediaDuration=()=>{this.duration&&!Number.isNaN(this.duration)||(this.duration=this.media.duration,this.start&&(this.duration-=this.start,this.jumpToTime()),this.end&&(this.duration-=this.end)),this.totalTime.innerText=yp.formatTime(this.duration)},this.playMedia=()=>v_(this,void 0,void 0,function*(){this.playButton.style.display="none",this.pauseButton.style.display="block",yield this.media.play(),this.medianIsEnd&&(this.medianIsEnd=!1,this.jumpToTime()),this.playCallBackList.forEach(r=>{r()})}),this.pauseMedia=()=>v_(this,void 0,void 0,function*(){this.playButton.style.display="block",this.pauseButton.style.display="none",yield this.media.pause()}),this.onMouseOut=r=>{r.stopPropagation(),this.mediaController.style.display="none"},this.mediaTimeUpdate=()=>v_(this,void 0,void 0,function*(){const r=this.media.currentTime-this.start;if(this.duration>0&&(r>this.duration||this.media.ended)&&(yield this.pauseMedia(),this.medianIsEnd=!0),this.currentTime.innerText=yp.formatTime(r),this.currentProgress.style.flex=(r/this.duration).toString(),!this.bookmarkList||this.bookmarkList.length===0)return;const o=this.bookmarkList[this.pickBookmarkIndex];o&&o.time.toFixed(0)===this.media.currentTime.toFixed(0)&&(this.ctx.timingEventHub.emit(`shape ${this.shapeId} onMediaBookmark ${o.name}`),this.pickBookmarkIndex+=1)}),this.onPauseMedia=()=>{this.playButton.style.display="block",this.pauseButton.style.display="none"},this.onPlayMedia=()=>{this.playButton.style.display="none",this.pauseButton.style.display="block",this.playCallBackList.forEach(r=>{r()})},this.playMediaFromCtrl=()=>{this.ctx.isPlayerPaused()?this.ctx.logger.info("Media controller prevent play event with paused state",this.ctx.taskId):(this.ctx.mode!=="interactive"&&this.playMedia(),this.ctx.mode!=="local"&&this.ctx.eventHub.emit(Ne.mediaPlay,{id:this.targetId,time:this.media.currentTime-this.start}))},this.pauseMediaFromCtrl=()=>{this.ctx.isPlayerPaused()?this.ctx.logger.info("Media controller prevent pause event with paused state",this.ctx.taskId):(this.ctx.mode!=="interactive"&&this.pauseMedia(),this.ctx.mode!=="local"&&this.ctx.eventHub.emit(Ne.mediaPause,{id:this.targetId,time:this.media.currentTime-this.start}))},this.targetId=t.targetId,this.ctx=t.ctx,this.height=t.height,this.width=t.width,this.target=t.target,this.media=t.media,this.info=t.info,this.shapeId=t.shapeId,this.canvasElement=t.canvasElement,this.getMedianContainer(),this.createMediaController(),this.info.cut&&(this.start=(e=this.info.cut.start)!==null&&e!==void 0?e:0,this.end=(i=this.info.cut.end)!==null&&i!==void 0?i:0),this.info.bookmarkList&&(this.bookmarkList=this.info.bookmarkList.sort((r,o)=>r.time-o.time))}getMedianContainer(){var t;let e=(t=this.canvasElement.parentElement)===null||t===void 0?void 0:t.querySelector(".median-container");e||(e=document.createElement("div"),e.className="median-container",this.canvasElement.parentElement.appendChild(e)),this.container=e}static formatTime(t){let e="00:00";if(t){const i=Math.floor(t/60),r=String(i<0?0:i).padStart(2,"0"),o=Math.floor(t%60);e=`${r}:${String(o<0?0:o).padStart(2,"0")}`}return e}createButton(){const t={marginLeft:"15px",marginRight:"10px",fontSize:"0",height:"20px"};Pa(this.playButton,Object.assign(Object.assign({},t),{display:"block"}));const e=document.createElement("img");Pa(e,{height:"20px"}),e.src="https://convertcdn.netless.link/publicFiles/icon/play.png",this.playButton.appendChild(e),Pa(this.pauseButton,Object.assign(Object.assign({},t),{display:"none"}));const i=document.createElement("img");Pa(i,{height:"20px"}),i.src="https://convertcdn.netless.link/publicFiles/icon/pause.png",this.pauseButton.appendChild(i)}createTimer(){const t=document.createElement("div");Pa(t,{width:"100px"}),this.currentTime.innerText="00:00";const e=document.createElement("span");return e.innerText="/",t.append(this.currentTime,e,this.totalTime),t}createProgress(){Pa(this.progress,{flex:"1",position:"relative",marginRight:"10px"});const t=document.createElement("div");Pa(t,{background:"#D9D9D9",position:"relative",height:"10px",display:"flex"}),this.progress.appendChild(t),Pa(this.currentProgress,{background:"#4F4F4F",top:"0px",left:"0",height:"10px",flex:"0"}),t.appendChild(this.currentProgress)}changeBookmarkIndex(t,e){if(this.bookmarkList&&this.bookmarkList.length!==0){if(this.pickBookmarkIndex>0){for(let i=0;i<this.pickBookmarkIndex;i++)if(this.bookmarkList[i].time>t){this.pickBookmarkIndex=i;break}}if(e){let i=this.pickBookmarkIndex-1;for(let r=0;r<this.bookmarkList.length;r++)this.bookmarkList[r].time<t&&(i=r);for(let r=this.pickBookmarkIndex;r<=i;r++){const o=this.bookmarkList[r];o&&this.ctx.timingEventHub.emit(`shape ${this.shapeId} onMediaBookmark ${o.name}`)}this.pickBookmarkIndex=i+1}}}bindEvent(){this.mediaController.addEventListener("mouseover",this.showController,!1),this.mediaController.addEventListener("mouseout",this.onMouseOut,!1),this.progress.addEventListener("mousedown",this.changeMediaProgress,!1),this.playButton.addEventListener("click",this.playMediaFromCtrl,!1),this.pauseButton.addEventListener("click",this.pauseMediaFromCtrl,!1),this.media.on("durationchange",this.getMediaDuration,!1),this.media.on("timeupdate",this.mediaTimeUpdate,!1),this.media.on("pause",this.onPauseMedia,!1),this.media.on("play",this.onPlayMedia,!1)}setControllerPosition(){var t;const{target:e}=this,{stageWidth:i,stageHeight:r}=this.ctx,o=e.getGlobalPosition(),s=Number((t=this.container)===null||t===void 0?void 0:t.getAttribute("data-scale")),a=i*s,l=1/s*(300>a?a/300:1);o.y=o.y+this.height-50,o.x=Math.max(o.x,0),o.x=Math.min(o.x,i-300*l),o.y=Math.max(o.y,0),o.y=Math.min(o.y,r-50),Pa(this.mediaController,{height:"50px",borderRadius:"25px",width:"300px",flexDirection:"row",alignItems:"center",position:"absolute",left:o.x+"px",top:o.y+"px",display:"none",background:"#fff",zIndex:"2",border:"1px solid #ccc",transform:`scale(${l})`,transformOrigin:"0 100%"})}createMediaController(){this.setControllerPosition(),this.createButton();const t=this.createTimer();this.createProgress(),this.mediaController.append(this.playButton,this.pauseButton,t,this.progress),this.container.appendChild(this.mediaController),this.bindEvent()}addPlayCallBack(t){this.playCallBackList.push(t)}unbindEvent(){this.mediaController.removeEventListener("mouseover",this.showController,!1),this.mediaController.removeEventListener("mouseout",this.onMouseOut,!1),this.progress.removeEventListener("mousedown",this.changeMediaProgress,!1),this.playButton.removeEventListener("click",this.playMediaFromCtrl,!1),this.pauseButton.removeEventListener("click",this.pauseMediaFromCtrl,!1),this.media.removeAllListeners()}show(){this.setControllerPosition(),this.mediaController.style.display="flex"}hide(){this.mediaController.style.display="none"}destroy(){var t;this.unbindEvent(),this.playCallBackList=[],(t=this.container)===null||t===void 0||t.removeChild(this.mediaController)}}var CP=v(49);class __ extends P.a{constructor(t,e){super(),this.isGlobalPause=!1,this.lastTime=-1,this.howl=null,this.rctClient=null,this.url=t,this.runningAudio=e,tr.RtcAudioClazz?(this.rctClient=new tr.RtcAudioClazz(t),this.rctClient.on("load",()=>this.emit("load")),this.rctClient.on("pause",()=>this.emit("pause")),this.rctClient.on("play",()=>this.emit("play"))):(this.howl=new CP.Howl({src:[t]}),this.howl.on("load",()=>this.emit("load")),this.howl.on("pause",()=>this.emit("pause")),this.howl.on("play",()=>this.emit("play")))}startTimeChangeEmit(){this.currentTime!==this.lastTime&&(this.lastTime=this.currentTime,this.emit("timeupdate")),this.isEnded||requestAnimationFrame(()=>this.startTimeChangeEmit())}play(){var t,e,i;this.runningAudio.has(this.url)&&((t=this.runningAudio.get(this.url))===null||t===void 0||t.stop(),this.runningAudio.delete(this.url)),this.lastTime=-1,(e=this.howl)===null||e===void 0||e.play(),(i=this.rctClient)===null||i===void 0||i.play(),this.startTimeChangeEmit(),this.runningAudio.set(this.url,this)}pause(){var t,e;(t=this.howl)===null||t===void 0||t.pause(),(e=this.rctClient)===null||e===void 0||e.pause(),this.runningAudio.has(this.url)&&this.runningAudio.delete(this.url)}globalPause(){this.isPaused||(this.isGlobalPause=!0,this.pause())}globalResume(){this.isGlobalPause&&(this.isGlobalPause=!1,this.play())}stop(){var t;(t=this.howl)===null||t===void 0||t.stop(),this.rctClient&&(this.rctClient.pause(),this.rctClient.currentTime=0),this.runningAudio.has(this.url)&&this.runningAudio.delete(this.url)}destroy(){var t,e,i,r,o,s,a;(t=this.howl)===null||t===void 0||t.pause(),(e=this.howl)===null||e===void 0||e.unload(),(i=this.rctClient)===null||i===void 0||i.pause(),(r=this.rctClient)===null||r===void 0||r.destroy(),(o=this.rctClient)===null||o===void 0||o.removeAllListeners("load"),(s=this.rctClient)===null||s===void 0||s.removeAllListeners("play"),(a=this.rctClient)===null||a===void 0||a.removeAllListeners("pause"),this.runningAudio.has(this.url)&&this.runningAudio.delete(this.url)}get currentTime(){return this.rctClient?this.rctClient.currentTime:this.howl?this.howl.seek():-1}set currentTime(t){this.rctClient?this.rctClient.currentTime=t:this.howl&&this.howl.seek(t)}get duration(){return this.rctClient?this.rctClient.duration:this.howl?this.howl.duration():0}get isEnded(){return Math.abs(this.currentTime-this.duration)<.001}get isPaused(){return this.rctClient?this.rctClient.isPaused:!!this.howl&&this.howl.playing()}}var PP=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};class IP extends P.a{constructor(t){var e,i;super(),this.type="video",this.sprite=new xr,this.isPlaying=!1,this.isGlobalPause=!1,this.id=t.id,this.start=(e=t.video.cut)===null||e===void 0?void 0:e.start,this.end=(i=t.video.cut)===null||i===void 0?void 0:i.end,this.container=t.container,this.ctx=t.ctx,this.ctx.medias[this.id]=this;let r=t.video.src;this.ctx.loaderDelegate&&(r=this.ctx.loaderDelegate.redirectMedia(r),this.ctx.logger.info(`redirect media url from ${t.video.src} to ${r} by delegate.`,t.ctx.taskId)),this.videoResource=new Pb(r,{autoLoad:!0,autoPlay:!1,updateFPS:30,crossorigin:!0});let o=t.video.src.replace(/4$/,"3");this.ctx.loaderDelegate&&(o=this.ctx.loaderDelegate.redirectMedia(o),this.ctx.logger.info(`redirect media url from ${t.video.src.replace(/4$/,"3")} to ${o} by delegate.`,t.ctx.taskId)),this.rtcAudio=new __(o,t.ctx.runningAudio);const{video:s,width:a,height:l,target:u}=t;this.controller=new yp({targetId:t.id,shapeId:t.shapeId,ctx:t.ctx,width:a,height:l,target:u,media:this,info:s,canvasElement:t.canvasElement}),this.controller.addPlayCallBack(()=>{this.sprite.width=a,this.sprite.height=l,this.ctx.clock.setTimeout(()=>{this.sprite.visible=!0},50)});const h=new Mi(null,{height:l,width:a});h.resource=this.videoResource,this.videoResource.bind(h),this.sprite=new xr,this.sprite.visible=!1,this.sprite.texture=new Qe(h),this.sprite.interactive=!0,this.container.addChild(this.sprite),this.sprite.on("mouseover",d=>{d.stopPropagation(),this.controller.show()}),this.sprite.on("mouseout",d=>{d.stopPropagation(),this.controller.hide()}),["durationchange","timeupdate","pause","play"].forEach(d=>{this.videoResource.source.addEventListener(d,()=>{d!=="timeupdate"||this.isPlaying||this.pause(),this.emit(d)})}),this.ctx.activeMedia.add(this)}get currentTime(){var t,e;return(e=(t=this.videoResource.source)===null||t===void 0?void 0:t.currentTime)!==null&&e!==void 0?e:0}set currentTime(t){this.videoResource.source&&(this.videoResource.source.currentTime=t)}get paused(){var t,e;return(e=(t=this.videoResource.source)===null||t===void 0?void 0:t.paused)===null||e===void 0||e}get ended(){var t,e;return(e=(t=this.videoResource.source)===null||t===void 0?void 0:t.ended)===null||e===void 0||e}get duration(){var t,e;return(e=(t=this.videoResource.source)===null||t===void 0?void 0:t.duration)!==null&&e!==void 0?e:0}showController(){this.controller.show()}hideController(){this.controller.hide()}play(){var t;return PP(this,void 0,void 0,function*(){this.isPlaying=!0,yield this.load(),yield this.ctx.clock.waitUntil(()=>{const i=this.videoResource.source;return!!(i&&i.videoWidth>0)},3e3);const e=this.videoResource.source;e&&e.videoWidth<=0||(tr.RtcAudioClazz&&(this.rtcAudio.play(),this.videoResource.source.volume=0),yield(t=this.videoResource.source)===null||t===void 0?void 0:t.play())})}load(){return this.videoResource.load()}pause(){var t;this.isPlaying=!1,tr.RtcAudioClazz&&this.rtcAudio.pause(),(t=this.videoResource.source)===null||t===void 0||t.pause()}globalPause(){this.isPlaying&&(this.isGlobalPause=!0,this.pause())}globalResume(){this.isGlobalPause&&(this.isGlobalPause=!1,this.play())}togglePause(){this.isPlaying?this.pause():this.play()}seek(t){this.controller.jumpToTime(t)}stop(){this.seek(0),this.pause()}destroy(){var t;this.sprite.interactive=!1,this.sprite.destroy({texture:!0,baseTexture:!0}),(t=this.videoResource)===null||t===void 0||t.destroy(),this.rtcAudio.destroy(),this.controller.destroy(),this.ctx.activeMedia.delete(this)}}var LP=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};class OP extends P.a{constructor(t){super(),this.type="audio",this.isPlaying=!1,this.isGlobalPause=!1,this.id=t.id;let e=t.audio.src;t.ctx.loaderDelegate&&(e=t.ctx.loaderDelegate.redirectMedia(e),t.ctx.logger.info(`redirect media url from ${t.audio.src} to ${e} by delegate.`,t.ctx.taskId)),this.audioPlayer=new __(e,t.ctx.runningAudio),t.audio.cut&&(this.start=t.audio.cut.start,this.end=t.audio.cut.end),this.ctx=t.ctx,this.ctx.medias[this.id]=this;const{width:i,height:r,target:o}=t;this.controller=new yp({targetId:t.id,shapeId:t.shapeId,ctx:t.ctx,height:r,width:i,target:o,media:this,info:t.audio,canvasElement:t.canvasElement}),this.audioPlayer.on("load",()=>this.emit("durationchange")),this.audioPlayer.on("timeupdate",()=>this.emit("timeupdate")),this.audioPlayer.on("pause",()=>this.emit("pause")),this.audioPlayer.on("play",()=>this.emit("play")),this.ctx.activeMedia.add(this)}get currentTime(){return this.audioPlayer.currentTime}set currentTime(t){this.audioPlayer.currentTime=t}get paused(){return this.audioPlayer.isPaused}get isPaused(){return this.audioPlayer.isPaused}get ended(){return this.audioPlayer.isEnded}get duration(){return this.audioPlayer.duration}load(){return Promise.resolve()}showController(){this.controller.show()}hideController(){this.controller.hide()}play(){return LP(this,void 0,void 0,function*(){this.ctx.isPlayerPaused()?this.ctx.logger.info("Audio player prevent play event with paused state",this.ctx.taskId):(this.isPlaying=!0,this.audioPlayer.play())})}pause(){this.ctx.isPlayerPaused()?this.ctx.logger.info("Audio player prevent pause event with paused state",this.ctx.taskId):(this.isPlaying=!1,this.audioPlayer.pause())}globalPause(){this.isPlaying&&(this.isGlobalPause=!0,this.pause())}globalResume(){this.isGlobalPause&&(this.isGlobalPause=!1,this.play())}togglePause(){this.isPlaying?this.pause():this.play()}seek(t){this.ctx.isPlayerPaused()?this.ctx.logger.info("Audio player prevent seek event with paused state",this.ctx.taskId):this.controller.jumpToTime(t)}stop(){this.seek(0),this.pause()}destroy(){this.audioPlayer.pause(),this.controller.destroy(),this.ctx.activeMedia.delete(this)}}class NP extends Kw{constructor(t,e,i,r){super(Object.assign(Object.assign({},t),{type:"Shape",useBgFill:!1,textRotateWithShape:!0,isPicture:!0}),e,i,r),this.isInteractiveOutside=!1,this.cmd=new QC(this),this.media=t==null?void 0:t.media,this.picFill=new Ca(this.ctx,t.picFill,t.width,t.height,{useFilter:!1,useSlideBackgroundFill:!1})}applyCommand(t,e){var i,r,o,s,a;if(e==="call")if(/playFrom\(([0-9.]+)\)/.test(t)){const l=t.match(/playFrom\(([0-9.]+)\)/),u=Number(l[1]||"0");(i=this.mediaPlayer)===null||i===void 0||i.play().then(()=>{var h;(h=this.mediaPlayer)===null||h===void 0||h.seek(u)})}else t==="custom-pause"?(r=this.mediaPlayer)===null||r===void 0||r.pause():t==="togglePause"?(o=this.mediaPlayer)===null||o===void 0||o.togglePause():t==="stop"&&((s=this.mediaPlayer)===null||s===void 0||s.pause(),(a=this.mediaPlayer)===null||a===void 0||a.seek(0))}renderPic(){var t,e,i,r,o;const{displayObject:s}=this.picFill;if(s){const a=(t=this.backgroundGraphics)===null||t===void 0?void 0:t.getClonedDisplayObject();((e=this.backgroundGraphics)===null||e===void 0?void 0:e.isNeedMask(s.width,s.height))&&a&&(s.mask=a,this.container.addChild(a)),s.width=this.designWidth,s.height=this.designHeight,s instanceof s_&&this.ctx.slideScopeEventHub.once("slide-render",l=>{this.ctx.slideIndex===l&&s.play()}),this.container.addChild(s),((i=this.media)===null||i===void 0?void 0:i.type)==="video"&&this.media.src?(this.mediaPlayer=new IP({id:this.json.id+"-video",shapeId:this.json.id,ctx:this.ctx,video:this.media,height:this.designHeight,width:this.designWidth,target:s,container:this.container,canvasElement:this.ctx.view}),(r=this.mediaPlayer)===null||r===void 0||r.sprite):((o=this.media)===null||o===void 0?void 0:o.type)==="audio"&&this.media.src&&(this.mediaPlayer=new OP({id:this.json.id+"-audio",shapeId:this.json.id,ctx:this.ctx,audio:this.media,height:this.designHeight,width:this.designWidth,target:s,canvasElement:this.ctx.view})),this.mediaPlayer&&(this.isInteractiveOutside=this.container.interactive,this.container.interactive=!0,this.container.on("mouseover",()=>{this.mediaPlayer.showController()}),this.container.on("mouseout",()=>{this.mediaPlayer.hideController()},!1))}}preRender(t){super.preRender(t)}subClassRender(){this.renderPic()}clearOnSlideChange(){super.clearOnSlideChange(),this.mediaPlayer&&(this.container.interactive=!1,this.mediaPlayer.stop(),this.mediaPlayer.hideController())}initOnReuse(){super.initOnReuse(),this.mediaPlayer&&(this.container.interactive=!0)}destroy(){this.mediaPlayer&&(this.picFill.displayObject&&!this.isInteractiveOutside&&(this.container.interactive=!1),this.mediaPlayer.destroy(),this.mediaPlayer=void 0),this.picFill.destroy()}}var dg=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};class y_ extends h_{constructor(t,e,i,r,o){super(t,e,i),this.children=[],this.cacheSprite=new xr,this.cacheContainer=new ar,this.json=t,this.json.fillStyle&&this.json.fillStyle.fillType==="groupFill"&&r&&(this.json.fillStyle=r),this.container.name=t.id,this.cacheContainer.name=t.id+"-cache-container",this.ctx.timingTargets.addTarget(t.id,this),this.updateTransform(this.json),this.fillObject=new Ca(this.ctx,t.fillStyle,t.width,t.height,{useFilter:!1,useSlideBackgroundFill:!1}),this.createChildren(o)}createChildren(t){var e,i,r,o;const s={x:(i=(e=this.json.position)===null||e===void 0?void 0:e.x)!==null&&i!==void 0?i:0,y:(o=(r=this.json.position)===null||r===void 0?void 0:r.y)!==null&&o!==void 0?o:0};for(let a=0,l=this.json.children.length;a<l;a++)t.addSubMTask(()=>dg(this,void 0,void 0,function*(){const u=this.json.children[a];let h=null;(u==null?void 0:u.type)==="Shape"?h=new Kw(u,this.ctx,s,this.json.fillStyle):(u==null?void 0:u.type)==="Picture"?h=new NP(u,this.ctx,s,this.json.fillStyle):(u==null?void 0:u.type)==="Container"&&(h=new y_(u,this.ctx,s,this.json.fillStyle,t)),h&&this.children.push(h)}),"@ContainerImpl[child.init]")}get interactiveContainer(){return this.container}get renderContainer(){return this.container}preRender(t){for(const e of this.children)t.addSubMTask(()=>dg(this,void 0,void 0,function*(){e.preRender(t)}),"@ContainerImpl[child.preRender]")}getBgElement(){return null}getIterateEntry(t,e,i){return e===0?this:(this.ctx.eventHub.emit("IterateTimeNodeEnd",i),null)}getTextElement(){return null}render(t){for(const e of this.children)e.render(t),t.addSubMTask(()=>dg(this,void 0,void 0,function*(){var i;e.renderContainer&&this.cacheContainer.addChild(e.renderContainer),(e.json.hlinkHover||e.json.hlinkClick)&&((i=e.hyperlink)===null||i===void 0||i.addProxy(this.container))}),"@ContainerImpl[child.render]");t.addSubMTask(()=>dg(this,void 0,void 0,function*(){this.container.addChild(this.cacheContainer)}),"@ContainerImpl[child.append]")}clearOnSlideChange(){this.children.forEach(t=>t.clearOnSlideChange())}initOnReuse(){this.children.forEach(t=>t.initOnReuse())}destroy(){this.cacheSprite&&this.cacheSprite.destroy({texture:!0}),this.children.forEach(t=>t.destroy()),this.container.destroy({children:!0,texture:!0,baseTexture:!0}),this.cacheContainer.destroy({children:!0,texture:!0,baseTexture:!0})}}class xp extends P.a{constructor(t,e,i,r){super(),this.cond={},this.timeoutIds=[],this.condHandle=(o,s={})=>{if(o)if(o.delay&&o.delay>0){const a=this.ctx.clock.setTimeout(()=>{o.event&&(this.cond[o.event]=!0,this.detectTrigger(s))},o.delay);this.timeoutIds.push(a)}else this.cond[o.event]=!0,this.detectTrigger(s);else this.detectTrigger(s)},this.id=t,this.ctx=r,this.eventHubs=i,e.forEach(o=>{this.addCond(o)})}setTriggerParams(t){this.triggerParams=t}addCond(t){const e=i=>{this.condHandle(t,i)};t.event&&(/^shape/.test(t.event)||/^time/.test(t.event)?(this.cond[t.event]=!1,this.eventHubs.global.addListener(t.event,e)):/^runtime/.test(t.event)?(this.cond[t.event]=!1,this.eventHubs.runtime.addListener(t.event,e)):/^self/.test(t.event)?t.delay&&t.delay>0&&(this.cond[t.event]=!1,this.eventHubs.runtime.addListener(t.event,e)):this.cond[t.event]=!1)}isTrigger(){return Object.keys(this.cond).every(t=>!!this.cond[t])}isTriggerWithoutParent(){return Object.keys(this.cond).filter(t=>t!=="self").every(t=>!!this.cond[t])}detectTrigger(t){if(Object.keys(this.cond).every(e=>!!this.cond[e])){Object.keys(this.cond).forEach(i=>{this.cond[i]=!1});const e=this.triggerParams;this.triggerParams=void 0,this.emit("active",e,t)}}reset(){Object.keys(this.cond).forEach(t=>{this.cond[t]=!1}),this.timeoutIds.forEach(t=>this.ctx.clock.clearTimeout(t))}}class DP extends P.a{constructor(t){super(),this.isTimeNodeEndSync=!1,this.interactiveListeners=[],this.runtimeNodeEventHub=new P.a,this._currentSeqIndex=0,this._currentSeqState="idle",this.isForward=!0,this.autoPlay=!1,this.handlePrev=(p=!1)=>{var m,g,_,y,w,A;this.hasPrev()||!this.isMainSeq?this.currentSeqState==="idle"?(this.decrSeqIndex(),(m=this.commonTimeNode.children[this.currentSeqIndex])===null||m===void 0||m.commonTimeNode.seekToStart(),(g=this.commonTimeNode.children[this.currentSeqIndex])===null||g===void 0||g.commonTimeNode.clearSubList(),this.currentSeqState="idle"):this.currentSeqState==="running"?((_=this.commonTimeNode.children[this.currentSeqIndex])===null||_===void 0||_.commonTimeNode.seekToStart(),(y=this.commonTimeNode.children[this.currentSeqIndex])===null||y===void 0||y.commonTimeNode.clearSubList(),this.currentSeqState="idle"):this.currentSeqState==="end"&&(this.currentSeqIndex>=this.commonTimeNode.children.length&&(this.currentSeqIndex=this.commonTimeNode.children.length-1),(w=this.commonTimeNode.children[this.currentSeqIndex])===null||w===void 0||w.commonTimeNode.seekToStart(),(A=this.commonTimeNode.children[this.currentSeqIndex])===null||A===void 0||A.commonTimeNode.clearSubList(),this.currentSeqState="idle"):this.globalEventHub.emit("c:prev slide",p)},this.handleNext=(p=!1)=>{var m,g,_,y;this.isTimeNodeEndSync&&(this.isTimeNodeEndSync=!1,this.currentSeqState="idle",this.currentSeqIndex=0),this.hasNext()||!this.isMainSeq?this.currentSeqState==="idle"?(m=this.commonTimeNode.children[this.currentSeqIndex])===null||m===void 0||m.commonTimeNode.startTimeNodeForce():this.currentSeqState==="running"?((g=this.commonTimeNode.children[this.currentSeqIndex])===null||g===void 0||g.commonTimeNode.seekToEnd(!1,!0),this.currentSeqState="end",this.incrSeqIndex(),(_=this.commonTimeNode.children[this.currentSeqIndex])===null||_===void 0||_.commonTimeNode.startTimeNodeForce()):this.currentSeqState==="end"&&(this.incrSeqIndex(),(y=this.commonTimeNode.children[this.currentSeqIndex])===null||y===void 0||y.commonTimeNode.startTimeNodeForce()):this.globalEventHub.emit("c:next slide",p)};const{json:e,iterateType:i,isIterate:r,isSub:o,parent:s,ctx:a,eventHub:l,iterateIndex:u,iterateId:h,isInInteractiveSeq:d}=t;this.isMainSeq=e.ctn.nodeType==="mainSeq",this.isInteractiveSeq=e.ctn.nodeType==="interactiveSeq",this.id=e.ctn.id,this.isIterate=r,this.json=e,this.ctx=a,this.globalEventHub=l,this.commonTimeNode=new Ac({json:e.ctn,isSub:o,eventHubs:{global:l,runtime:this.runtimeNodeEventHub},ctx:a,parent:s,isIterate:!1,iterateType:i,iterateIndex:u,iterateId:h,isInInteractiveSeq:d||this.isInteractiveSeq}),this.bindShapeEvent(),this.nextConds=new xp("mainSeq",e.nextCondLst,{global:l,runtime:this.runtimeNodeEventHub},this.ctx),this.prevConds=new xp("mainSeq",e.preCondLst,{global:l,runtime:this.runtimeNodeEventHub},this.ctx),this.commonTimeNode.on("timeNodeRestart",()=>{this.currentSeqIndex=0,this.currentSeqState="idle"}),this.commonTimeNode.on("childTimeNodeStart",p=>{const m=this.commonTimeNode.children.findIndex(g=>g.commonTimeNode.uuid===p.id);m>=0&&(this.currentSeqIndex=m),this.currentSeqState="running",this.isMainSeq&&this.ctx.eventHub.emit(Ne.mainSeqStepStart,m)}),this.commonTimeNode.on("childTimeNodeEnd",p=>{const m=this.commonTimeNode.children.findIndex(g=>g.commonTimeNode.uuid===p.id);m>=0&&(this.currentSeqIndex=m),this.currentSeqState="end",this.autoPlay&&this.ctx.clock.setTimeout(()=>{this.handleNext()}),this.isMainSeq&&this.ctx.eventHub.emit(Ne.mainSeqStepEnd,m)}),this.commonTimeNode.on("timeNodeEndSync",()=>{this.isTimeNodeEndSync=!0,this.commonTimeNode.resetForRepeat()}),this.commonTimeNode.on("timeNodeDestroy",()=>{this.interactiveListeners.forEach(([p,m])=>{p&&m&&p.interactiveContainer.removeListener("pointerdown",m)}),this.interactiveListeners=[]}),this.nextConds.on("active",(p,m)=>{this.handleNext(m)}),this.prevConds.on("active",(p,m)=>{this.handlePrev(m)})}get currentSeqIndex(){return this._currentSeqIndex}set currentSeqIndex(t){this._currentSeqIndex=t,this.isMainSeq?this.ctx.eventHub.emit(Ne.mainSeqStepChange,t):this.isInteractiveSeq&&this.ctx.eventHub.emit(Ne.interactiveSeqStateChange,{id:this.json.ctn.id,state:{step:t,state:this._currentSeqState}})}get currentSeqState(){return this._currentSeqState}set currentSeqState(t){this._currentSeqState=t,this.isMainSeq?this.ctx.eventHub.emit(Ne.mainSeqStateChange,t):this.isInteractiveSeq&&this.ctx.eventHub.emit(Ne.interactiveSeqStateChange,{id:this.json.ctn.id,state:{step:this._currentSeqIndex,state:t}})}get stepLength(){return this.commonTimeNode.children.length}get currentStep(){return this.currentSeqIndex}get currentState(){return this.currentSeqState}startAutoPlay(){this.autoPlay=!0,this.commonTimeNode.children[0].commonTimeNode.startTimeNodeForce()}incrSeqIndex(){this.currentSeqIndex+1<=this.commonTimeNode.children.length&&(this.currentSeqIndex+=1)}decrSeqIndex(){this.currentSeqIndex-1>=-1&&(this.currentSeqIndex-=1)}hasPrev(){return!(this.currentSeqIndex<=0&&this.currentSeqState==="idle")}hasNext(){return!(this.currentSeqIndex>=this.commonTimeNode.children.length||this.currentSeqIndex===this.commonTimeNode.children.length-1&&this.currentSeqState==="end")}bindShapeEvent(){this.json.ctn.nodeType==="interactiveSeq"&&this.json.nextCondLst.forEach(t=>{if(/^shape/.test(t.event)){const e=t.event.split(" ")[1];if(e){const i=this.ctx.timingTargets.getTargetById(e);if(i){i.interactiveContainer.interactive=!0,i.interactiveContainer.cursor="pointer";const r=()=>{this.ctx.eventHub.emit(Ne.userInput);const o=`shape ${e} onClick`,{mode:s}=this.ctx;s!=="interactive"&&s!=="sync"||this.ctx.eventHub.emit(Ne.interactiveSeqAction,{action:o,seqId:this.json.ctn.id}),s!=="sync"&&s!=="local"||this.globalEventHub.emit(o)};i.interactiveContainer.on("pointerdown",r),this.interactiveListeners.push([i,r])}}}})}setCurrentStep(t,e){this.isInteractiveSeq&&this.commonTimeNode.applyCount===0&&(this.commonTimeNode.applyCount=1);let i=t;this.commonTimeNode.seekToStart();const{length:r}=this.commonTimeNode.children;if(i===-1&&(i=r-1),i>=0&&i<r)for(let o=0;o<=i;o++){const s=this.commonTimeNode.children[o];o!==i?s.commonTimeNode.seekToEnd(!1,!0):e==="start"?s.commonTimeNode.seekToStart():e==="end"&&s.commonTimeNode.seekToEnd(!1,!0)}this.currentSeqIndex=i,this.currentSeqState=e==="start"?"idle":"end"}}function Fs(n,t,e){const i=t.split(".");i.reduce((r,o,s)=>{if(r)return s!==i.length-1?r[o]:void(r[o]=e);console.warn(`${n} not support ${t}`)},n)}function pg(n,t){return t?t.split(".").reduce((e,i)=>{if(e)return e[i];console.warn(`${n} not support ${t}`)},n):null}class xl{constructor(t){this.timingTarget=null,this.runtimeNodeEventHub=new P.a,this.basicOnTimeNodeEnd=()=>{if(this.isConflict){const{target:p}=this.json.cBhvr,m=this.getTargetId(p);this.ctx.conflictTimeNodeManager.removeRunningTimeNode(m,this.modifyAttrKey)}},this.basicOnTimeLineStart=()=>{if(this.isConflict){const{target:p}=this.json.cBhvr;if(this.activeWhenConflict==="next"){const m=this.getTargetId(p);this.ctx.conflictTimeNodeManager.addRunningTimeNode(m,this.modifyAttrKey,this.commonTimeNode)}else this.activeWhenConflict==="prev"&&this.commonTimeNode.dispose()}};const{isIterate:e,isSub:i,json:r,ctx:o,parent:s,eventHub:a,iterateType:l,iterateIndex:u,iterateId:h,isInInteractiveSeq:d}=t;this.json=r,this.id=r.cBhvr.ctn.id,this.ctx=o,this.globalEventHub=a,this.commonTimeNode=new Ac({json:r.cBhvr.ctn,isSub:i,eventHubs:{global:a,runtime:this.runtimeNodeEventHub},ctx:o,parent:s,isIterate:e,iterateType:l,iterateIndex:u,iterateId:h,isInInteractiveSeq:d}),this.timingTarget=this.ctx.timingTargets.getTarget(r.cBhvr.target,e,{type:l,index:u,id:h}),this.commonTimeNode.on("seekToStart",()=>this.onSeekToStart()),this.commonTimeNode.on("seekToEnd",()=>this.onSeekToEnd()),this.commonTimeNode.on("timelineStart",this.basicOnTimeLineStart),this.commonTimeNode.on("timeNodeEnd",this.basicOnTimeNodeEnd)}getTargetId(t){let e=t.id;return t.type==="shape"&&t.txEl&&(e=`${e}-txEl-${t.txEl.range[0]}`),this.commonTimeNode.isIterate&&(e=`${e}-iterate-${this.commonTimeNode.iterateIndex}`),e}}class FP extends xl{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.startVal=null,this.updateStartValue=()=>{this.timingTarget&&(this.startVal=pg(this.timingTarget,this.json.cBhvr.attrList[0]))},this.onSeekToStart=()=>{const e=this.json.cBhvr.attrList[0];this.startVal!==null&&this.timingTarget&&Fs(this.timingTarget,e,this.startVal)},this.onSeekToEnd=()=>{const e=this.json.cBhvr.attrList[0],i=this.json.cBhvr.to||this.json.to;i&&this.timingTarget&&Fs(this.timingTarget,e,i)},this.commonTimeNode.on("timeNodeStart",this.updateStartValue),this.commonTimeNode.on("timeNodeCreate",this.updateStartValue),this.commonTimeNode.on("timeUpdate",({duration:e,delta:i})=>{if(i/e>=1){const r=this.json.cBhvr.attrList[0];this.json.cBhvr.attrList.length>1&&console.warn("this.json.cBhvr.attrList.length > 0");const o=this.json.cBhvr.to||this.json.to;o&&this.timingTarget&&Fs(this.timingTarget,r,o)}})}get modifyAttrKey(){return this.json.cBhvr.attrList[0]}}var fg=function(n,t,e,i){var r,o=arguments.length,s=o<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(t,e,s):r(t,e))||s);return o>3&&s&&Object.defineProperty(t,e,s),s};class mg{constructor(t,e){this.math={pi:Math.PI,e:Math.E,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,ceil:Math.ceil,cos:Math.cos,cosh:Math.cosh,deg:i=>i/Math.PI*180,exp:Math.exp,floor:Math.floor,ln:Math.log,max:Math.max,min:Math.min,rad:i=>i/180*Math.PI,rand:Math.random,sin:Math.sin,sinh:Math.sinh,sqrt:Math.sqrt,tan:Math.tan,tanh:Math.tanh},this.timingTarget=e,this.val=t.val.value,this.time=t.time,t.fmla&&(this.fmla=this.parseFmla(t.fmla))}parseFmla(t){let e=t.replace(/#ppt_h/g,`(${this.timingTarget.design_ppt_h})`);return e=e.replace(/#ppt_w/g,`(${this.timingTarget.design_ppt_w})`),e=e.replace(/#ppt_x/g,`(${this.timingTarget.design_ppt_x})`),e=e.replace(/#ppt_y/g,`(${this.timingTarget.design_ppt_y})`),e=e.replace(/ppt_w/g,"vars.ppt_w"),e=e.replace(/ppt_h/g,"vars.ppt_h"),e=e.replace(/ppt_x/g,"vars.ppt_x"),e=e.replace(/ppt_y/g,"vars.ppt_y"),e=e.replace(/#/g,"vars."),["abs","acos","asin","atan","ceil","cos","cosh","deg","exp","floor","ln","max","min","rad","rand","sin","sinh","sqrt","tan","tanh","pi","e"].forEach(i=>{const r=new RegExp(`([^a-z])${i}([^a-z])`,"g");e=e.replace(r,(o,s,a)=>`${s}math.${i}${a}`)}),new Function("vars","math","$","return "+e)}}class Qw extends mg{constructor(t,e,i){super(t,e),this.value=t.val.value,i&&(this.fmla=this.parseFmla(i))}resolveValue(){return this.value}interpolationFrom(t,e,i){const r=t.resolveValue(i),o=r+(this.resolveValue()-r)*e;return t.fmla?t.fmla(i,this.math,o):o}}fg([ng()],Qw.prototype,"interpolationFrom",null);class tS extends mg{constructor(t,e){var i;super(t,e),this.value=(i=t.val)===null||i===void 0?void 0:i.value}interpolationFrom(t,e,i){let r=t.resolveValue(i);return e>this.time&&(r=this.resolveValue()),r}resolveValue(){return this.value||""}}fg([ng()],tS.prototype,"interpolationFrom",null);class Mc extends mg{constructor(t,e){super(t,e),this.fn=this.parseFmla(this.val)}resolveValue(t){return this.fn(t,this.math,1)}interpolationFrom(t,e,i){const r=t.resolveValue(i),o=r+(this.resolveValue(i)-r)*e;return t.fmla?t.fmla(i,this.math,o):o}}fg([ng()],Mc.prototype,"interpolationFrom",null);class eS extends mg{constructor(t,e){super(t,e),this.value=t.val.value}interpolationFrom(t,e){return mp(t.resolveValue(),this.value,e)}resolveValue(){return this.value}}fg([ng()],eS.prototype,"interpolationFrom",null);class BP extends xl{constructor(t){super(t),this.isConflict=!0,this.activeWhenConflict="next",this.startVal=null,this.vars={ppt_x:0,ppt_y:0,ppt_w:0,ppt_h:0},this.keyFrames=[],this.isColorAnim=!1,this.onTimeNodeStart=()=>{this.timingTarget&&(this.startVal=pg(this.timingTarget,this.json.cBhvr.attrList[0]))},this.updateVars=()=>{var e,i,r,o;!((e=this.timingTarget)===null||e===void 0)&&e.ppt_h&&(this.vars.ppt_h=this.timingTarget.ppt_h),!((i=this.timingTarget)===null||i===void 0)&&i.ppt_w&&(this.vars.ppt_w=this.timingTarget.ppt_w),!((r=this.timingTarget)===null||r===void 0)&&r.ppt_x&&(this.vars.ppt_x=this.timingTarget.ppt_x),!((o=this.timingTarget)===null||o===void 0)&&o.ppt_y&&(this.vars.ppt_y=this.timingTarget.ppt_y),this.isColorAnim},this.onTimeUpdate=({duration:e,delta:i})=>{const r=i/e,o=this.keyFrames.findIndex(p=>r<=p[0]),{attrList:s}=this.json.cBhvr;if(o<0){const p=this.keyFrames[this.keyFrames.length-1];return void(this.timingTarget&&s&&s[0]&&Fs(this.timingTarget,s[0],p[1].resolveValue(this.vars)))}const a=o-1,l=this.keyFrames[o],u=this.keyFrames[a]||l,h=l[0]-u[0]==0?1:(r-u[0])/(l[0]-u[0]),d=l[1].interpolationFrom(u[1],h,this.vars);this.timingTarget&&s&&s[0]&&Fs(this.timingTarget,s[0],d)},this.onSeekToStart=()=>{this.startVal!==null&&this.timingTarget&&Fs(this.timingTarget,this.json.cBhvr.attrList[0],this.startVal)},this.onSeekToEnd=()=>{this.onTimeUpdate({duration:1,delta:1,isReverse:!1})},this.initKeyFrames(),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.commonTimeNode.on("timelineStart",this.updateVars),this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart)}get modifyAttrKey(){return this.json.cBhvr.attrList[0]}initKeyFrames(){var t;const{valueType:e}=this.json;if(this.json.tavLst.length<=0){if(this.json.to){if(this.json.from||this.startVal){const r={time:0,val:{type:"string",value:this.json.from||this.startVal.toString()},fmla:""};if(e==="num"&&this.timingTarget){const o=new Mc(r,this.timingTarget);this.keyFrames.push([r.time,o])}}const i={time:1,val:{type:"string",value:this.json.to},fmla:""};if(e==="num"&&this.timingTarget){const r=new Mc(i,this.timingTarget);this.keyFrames.push([i.time,r])}}else if(this.json.by){const i={time:0,val:{type:"string",value:this.json.cBhvr.attrList[0]},fmla:""};if(e==="num"&&this.timingTarget){const o=new Mc(i,this.timingTarget);this.keyFrames.push([i.time,o])}const r={time:1,val:{type:"string",value:(((t=i.val)===null||t===void 0?void 0:t.value)||"")+"+"+this.json.by},fmla:""};if(e==="num"&&this.timingTarget){const o=new Mc(r,this.timingTarget);this.keyFrames.push([r.time,o])}}}if(this.json.tavLst.length>0){for(const i of this.json.tavLst)if(i.val&&this.timingTarget){let r=null;i.val.type==="string"?e==="num"?r=new Mc(i,this.timingTarget):e==="str"&&(r=new tS(i,this.timingTarget)):i.val.type==="number"?r=new Qw(i,this.timingTarget):i.val.type==="color"?(this.isColorAnim=!0,r=new eS(i,this.timingTarget)):i.val.type==="boolean"&&console.warn("not implements"),r&&this.keyFrames.push([i.time,r])}}}}var kP=v(50),UP=v.n(kP),GP=v(51),HP=v.n(GP);class zP extends Nr{constructor(){super(HP.a,UP.a,{percent:0,direction:1,transition:0})}set transition(t){this.uniforms.transition=t}set percent(t){this.uniforms.percent=t}set direction(t){this.uniforms.direction=t}}var jP=v(52),VP=v.n(jP);class WP extends Nr{constructor(){super(void 0,VP.a,{percent:0,transition:1})}set transition(t){this.uniforms.transition=Math.pow(t,t)}set percent(t){this.uniforms.percent=t}}class XP extends xl{constructor(t){var e;super(t),this.filterType="",this.isConflict=!0,this.activeWhenConflict="prev",this.onTimeUpdate=({duration:o,delta:s})=>{const a=s/o;this.filter&&(this.filter.percent=this.commonTimeNode.applyTimeFilter(a)),a>=1&&this.timingTarget&&this.ctx.clock.setTimeout(()=>{this.timingTarget&&(this.timingTarget.container.filters=[])})},this.onSeekToStart=()=>{this.timingTarget&&(this.timingTarget.container.filters=[])},this.onSeekToEnd=()=>{this.timingTarget&&(this.timingTarget.container.filters=[])},this.commonTimeNode.on("timelineStart",()=>{this.filter&&this.timingTarget&&(this.timingTarget.container.filters=[this.filter])}),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate);let i=0;t.json.transition==="out"?i=-1:t.json.transition==="in"&&(i=1);const r=(e=t.json.filter)===null||e===void 0?void 0:e.match(/^([a-zA-Z]+)(\((.+)\))?/);if(r){const o=r[1],s=r[3];if(o==="wipe"){const a=new zP;s==="up"?a.direction=1:s==="down"?a.direction=2:s==="left"?a.direction=3:s==="right"&&(a.direction=4),this.filter=a,this.filterType=`${o}-${s}`}else if(o==="fade"){const a=new WP;this.filter=a,this.filterType=""+o}this.filter&&(this.filter.transition=i)}}get modifyAttrKey(){return this.filterType}}class qP extends xl{constructor(t){super(t),this.isConflict=!0,this.activeWhenConflict="next",this.startPos=null,this.onTimeNodeStart=()=>{var e,i;this.startPos={x:((e=this.timingTarget)===null||e===void 0?void 0:e.ppt_x)||0,y:((i=this.timingTarget)===null||i===void 0?void 0:i.ppt_y)||0}},this.onTimeUpdate=({duration:e,delta:i})=>{var r;const o=i/e,s=(r=this.path)===null||r===void 0?void 0:r.getPoint(o);this.timingTarget&&s&&(this.timingTarget.ppt_x=s.x+this.timingTarget.design_ppt_x,this.timingTarget.ppt_y=s.y+ +this.timingTarget.design_ppt_y)},this.onSeekToStart=()=>{this.timingTarget&&this.startPos&&(this.timingTarget.ppt_x=this.startPos.x,this.timingTarget.ppt_y=this.startPos.y)},this.onSeekToEnd=()=>{var e,i,r;const o=(i=(e=this.commonTimeNode.json)===null||e===void 0?void 0:e.spd)!==null&&i!==void 0?i:1,s=(r=this.path)===null||r===void 0?void 0:r.getPoint(o>0?1:0);this.timingTarget&&s&&(this.timingTarget.ppt_x=s.x+this.timingTarget.design_ppt_x,this.timingTarget.ppt_y=s.y+this.timingTarget.design_ppt_y)},this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.createPath()}get modifyAttrKey(){return"motion"}createPath(){var t;const e=new mu,i=(t=this.json.path)===null||t===void 0?void 0:t.match(/[MLCmlc][^MLCmlc]+/g);if(i)for(const r of i){const[o,...s]=r.trim().replace(/\s+/g," ").split(" ");if(o==="M"){const[a,l]=s.map(u=>Number(u));e.moveTo(a,l)}else if(o==="L"){const[a,l]=s.map(u=>Number(u));e.lineTo(a,l)}else if(o==="C"){const[a,l,u,h,d,p]=s.map(m=>Number(m));e.bezierCurveTo(a,l,u,h,d,p)}else if(o==="Z")e.closePath();else if(o==="E")console.warn("not implements");else if(o==="c"){const[a,l,u,h,d,p]=s.map(g=>Number(g)),m=e.currentPoint;e.bezierCurveTo(a+m.x,l+m.y,u+m.x,h+m.y,d+m.x,p+m.y)}else if(o==="l"){const a=e.currentPoint,[l,u]=s.map(h=>Number(h));e.lineTo(l+a.x,u+a.y)}else if(o==="m"){const a=e.currentPoint,[l,u]=s.map(h=>Number(h));e.moveTo(l+a.x,u+a.y)}}this.path=e}}class YP extends xl{constructor(t){super(t),this.isConflict=!0,this.activeWhenConflict="next",this.startVal=null,this.onTimelineStart=e=>{e.isReverse||this.updateCurrentValue()},this.onTimeUpdate=({duration:e,delta:i})=>{var r,o,s,a,l;const u=i/e,h={x:1,y:1};if(this.to){const d=(r=this.from)!==null&&r!==void 0?r:{x:(s=(o=this.startVal)===null||o===void 0?void 0:o.x)!==null&&s!==void 0?s:1,y:(l=(a=this.startVal)===null||a===void 0?void 0:a.y)!==null&&l!==void 0?l:1};h.x=d.x+(this.to.x-d.x)*u,h.y=d.y+(this.to.y-d.y)*u}else if(this.by){const d={x:this.by.x,y:this.by.y};h.x=1+(d.x-1)*u,h.y=1+(d.y-1)*u}this.timingTarget&&(this.timingTarget.scale=h)},this.onTimeNodeStart=()=>{this.timingTarget&&(this.startVal={x:this.timingTarget.scale.x,y:this.timingTarget.scale.y})},this.onSeekToStart=()=>{this.timingTarget&&this.startVal&&(this.timingTarget.scale=this.startVal)},this.onSeekToEnd=()=>{this.onTimeUpdate({duration:1,delta:1,isReverse:!1})},this.from=t.json.from,this.to=t.json.to,this.by=t.json.by,this.commonTimeNode.on("timelineStart",this.onTimelineStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart)}get modifyAttrKey(){return"scale"}updateCurrentValue(){this.timingTarget&&(this.current={x:this.timingTarget.scale.x,y:this.timingTarget.scale.y})}}class $P extends xl{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.isTimelineStart=!1,this.startColorString=null,this.currentColorString="#FFFFFFFF",this.onTimelineStart=e=>{if(this.isTimelineStart)return;this.isTimelineStart=!0,e.isReverse||this.updateCurrentValue(),this.from.isInit()||this.from.fromHexString(this.currentColorString),this.to.isInit()||this.from.by(this.by,this.to);const[i]=this.json.cBhvr.attrList[0].split(".");Fs(this.timingTarget,i+".on","true")},this.onTimeNodeEnd=()=>{if(this.json.cBhvr.ctn.fill==="remove"){const[e]=this.json.cBhvr.attrList[0].split(".");Fs(this.timingTarget,e+".on","false")}this.isTimelineStart=!1},this.onSeekToStart=()=>{var e;if(this.timingTarget&&(this.onTimeUpdate({duration:1,delta:0}),((e=this.timingTarget.fill)===null||e===void 0?void 0:e.designColor.toUpperCase())===this.from.toHexString().toUpperCase())){const[i]=this.json.cBhvr.attrList[0].split(".");Fs(this.timingTarget,i+".on","false")}},this.onTimeNodeStart=()=>{if(this.timingTarget){const e=pg(this.timingTarget,this.json.cBhvr.attrList[0]);e&&(this.startColorString=e)}},this.onTimeUpdate=({delta:e,duration:i})=>{const r=e/i;this.to.interpolationFrom(this.from,r,this.target),this.timingTarget&&Fs(this.timingTarget,this.json.cBhvr.attrList[0],this.target.toHexString())},this.onSeekToEnd=()=>{this.isTimelineStart||this.onTimelineStart({isReverse:!1,activeCount:0,id:""}),this.onTimeUpdate({duration:1,delta:1})},this.json.clrSpc==="rgb"?(this.from=new lg(this.json.from),this.to=new lg(this.json.to),this.by=new lg(this.json.by),this.target=new lg):(this.from=new ag(this.json.from),this.to=new ag(this.json.to),this.by=new ag(this.json.by),this.target=new ag),this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.commonTimeNode.on("timelineStart",this.onTimelineStart),this.commonTimeNode.on("timeNodeEnd",this.onTimeNodeEnd),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate)}get modifyAttrKey(){return this.json.cBhvr.attrList[0]}updateCurrentValue(){if(this.timingTarget){const t=pg(this.timingTarget,this.json.cBhvr.attrList[0]);t&&(this.currentColorString=t)}}}class JP extends xl{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.startVal=null,this.lastVal=null,this.onTimelineStart=e=>{this.lastVal=null,e.isReverse||this.updateCurrentValue()},this.onTimeUpdate=({duration:e,delta:i})=>{const r=i/e;let o=0,s=0;if(this.from!==void 0&&this.to!==void 0){o=this.from,s=this.to;const a=o+(s-o)*r;this.timingTarget&&(this.timingTarget.r=a)}else if(this.by!==void 0){this.lastVal||(this.lastVal=0);const a=this.by*r-this.lastVal;this.lastVal=this.by*r,this.timingTarget&&(this.timingTarget.r+=a)}},this.onTimeNodeStart=()=>{var e;Object(V.isNumber)((e=this.timingTarget)===null||e===void 0?void 0:e.r)&&(this.startVal=this.timingTarget.r)},this.onSeekToStart=()=>{this.timingTarget&&this.startVal!==null&&(this.timingTarget.r=this.startVal)},this.onSeekToEnd=()=>{this.onTimeUpdate({duration:1,delta:1,isReverse:!1})},this.from=this.json.from,this.to=this.json.to,this.by=this.json.by,this.by?this.isConflict=!1:this.isConflict=!0,this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.commonTimeNode.on("timelineStart",this.onTimelineStart),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate)}get modifyAttrKey(){return"rotate"}updateCurrentValue(){var t;this.currentVal=(t=this.timingTarget)===null||t===void 0?void 0:t.r}}class ZP extends xl{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.isApplied=!1,this.onTimeUpdate=()=>{var e,i;const{cmd:r,cmdType:o}=this.json;!this.isApplied&&r&&o&&(this.isApplied=!0,(i=(e=this.timingTarget)===null||e===void 0?void 0:e.cmd)===null||i===void 0||i.applyCommand(r,o))},this.onSeekToStart=()=>{var e,i;(i=(e=this.timingTarget)===null||e===void 0?void 0:e.cmd)===null||i===void 0||i.applyCommand("custom-pause","call")},this.onSeekToEnd=()=>{},this.commonTimeNode.on("timeNodeStart",()=>{this.isApplied=!1}),this.commonTimeNode.on("timeNodeEnd",()=>{this.isApplied=!1}),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.commonTimeNode.on("seekToStart",this.onSeekToStart),this.commonTimeNode.on("seekToEnd",this.onSeekToEnd)}get modifyAttrKey(){var t,e,i,r;return((e=(t=this.json)===null||t===void 0?void 0:t.cmd)!==null&&e!==void 0?e:"")+((r=(i=this.json)===null||i===void 0?void 0:i.cmdType)!==null&&r!==void 0?r:"")}}class KP{constructor(t){this.runtimeNodeEventHub=new P.a,this.stopAudio=()=>{this.audio.stop()},this.destroy=()=>{this.stopAudio(),this.audio.destroy(),this.ctx.activeMedia.delete(this.audio)};const{json:e,isIterate:i,isSub:r,eventHub:o,ctx:s,parent:a,iterateType:l,iterateIndex:u,iterateId:h,isInInteractiveSeq:d}=t;this.json=e,this.id=e.cMediaNode.ctn.id,this.commonTimeNode=new Ac({json:e.cMediaNode.ctn,isSub:r,eventHubs:{global:o,runtime:this.runtimeNodeEventHub},ctx:s,parent:a,isIterate:i,iterateType:l,iterateIndex:u,iterateId:h,isInInteractiveSeq:d});let p=e.cMediaNode.tgtEl;s.loaderDelegate&&(p=s.loaderDelegate.redirectMedia(p),s.logger.info(`redirect media url from ${e.cMediaNode.tgtEl} to ${p} by delegate.`,s.taskId)),this.audio=new __(p,s.runningAudio),s.activeMedia.add(this.audio),this.commonTimeNode.on("timelineStart",()=>{this.audio.play()}),this.commonTimeNode.on("seekToStart",this.stopAudio),this.commonTimeNode.on("seekToEnd",this.stopAudio),this.commonTimeNode.on("timeNodeDestroy",this.destroy),this.ctx=s}}var QP=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};class Ac extends P.a{constructor(t){var e,i;super(),this.uuid=Date.now().toString(32)+Math.random().toString(32).substring(2),this.isSub=!1,this.isShadow=!1,this.startCount=0,this.applyCount=0,this.isReverse=!1,this.isConflictDispose=!1,this.isIterateEnd=!1,this.parentTimeNode=null,this.isActive=!1,this.isDestroy=!1,this.shouldSeekOnStart=!1,this.repeatTimeoutId="",this.iterateShadows=[],this.isEndEventsEmitted=!1,this.tmFilter=[],this.timeDelta=0,this.isIterate=!1,this.iterateType="el",this.iterateIndex=0,this.children=[],this.subList=[],this.duration=0,this.isNegativeSpeed=!1,this.handleEndCond=()=>{this.isActive&&(this.isActive=!1,this.isInfiniteRepeat()?this.repeatTimeNodeEnd():this.seekToEnd(!1,!0))},this.handleActive=(y=!0)=>{if(this.isActive=!0,this.isConflictDispose=!1,this.applyCount+=1,this.json.iterate||this.emit("timeNodeStart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.startCount>0&&this.json.restart){if(this.json.restart==="never")return;this.json.restart!=="whenNotActive"&&this.json.restart!=="always"||(this.seekToStart(),this.emit("timeNodeRestart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.startTimeLine(y))}else this.startTimeLine(y)},this.updateTimeLine=y=>{const w=y/(We.TARGET_FPMS||.06);this.timeDelta+=w,this.duration-this.timeDelta<=w&&(this.timeDelta=this.duration),this.timeDelta<this.duration?this.emit("timeUpdate",{delta:this.isReverse||this.isNegativeSpeed?this.duration-this.timeDelta:this.timeDelta,duration:this.duration,isReverse:this.isReverse}):(this.emit("timeUpdate",{delta:this.isReverse||this.isNegativeSpeed?0:this.duration,duration:this.duration,isReverse:this.isReverse}),this.onTimeLineEnd())},this.handleEnd=(y=!1)=>{(this.isTimeNodeEnd()||y)&&(this.isActive=!1,this.isSub&&this.destroy(),this.emitEndEvents())};const{isSub:r,isIterate:o,ctx:s,eventHubs:a,parent:l,json:u,iterateType:h,iterateId:d,iterateIndex:p,isInInteractiveSeq:m}=t;this.isSub=r,this.isInInteractiveSeq=m,this.isIterate=o,this.parentTimeNode=l,this.json=u,this.ctx=s,this.iterateIndex=p,this.eventHubs=a,this.iterateType=h,this.iterateId=d,this.tmFilter=(i=(e=u.tmFilter)===null||e===void 0?void 0:e.split(";").map(y=>y.split(",").map(w=>parseFloat(w.trim()))))!==null&&i!==void 0?i:[];const g=Number(this.json.dur),_=this.json.spd||1;this.isNegativeSpeed=_<0,Number.isNaN(g)||(this.duration=g/Math.abs(_)),this.uuid+="--"+this.json.id,this.setPreStyle(),u.childTnLst&&this.createChildren(u.childTnLst),this.startConds=new xp(this.json.id||"",u.stCondLst,a,this.ctx),this.endConds=new xp(this.json.id||"",u.endCondLst,a,this.ctx),u.endSync&&(this.endSync=new xp(this.json.id||"",[u.endSync],a,this.ctx),this.endSync.on("active",()=>{var y;this.json.nodeType==="interactiveSeq"&&(this.isActive=!1,this.shouldSeekOnStart=!0,this.emit("timeNodeEndSync"),(y=this.endSync)===null||y===void 0||y.reset())})),this.startConds.on("active",y=>{this.isActive||(this.shouldSeekOnStart&&(this.shouldSeekOnStart=!1,this.seekToStart()),this.handleActive(y))}),this.endConds.on("active",()=>{this.handleEndCond(),this.children.forEach(y=>y.commonTimeNode.handleEndCond())}),this.parentTimeNode&&this.parentTimeNode.on("timeNodeStart",()=>{this.applyCount=0}),this.isSub&&this.json.masterRel==="nextClick"&&this.startConds.addCond({event:"shape slide onNext"}),this.json.iterate&&this.isIterate===!1&&this.createIterateShadow()}createIterateShadow(){const t=fp();let e=!0,i=0;const r=o=>{o===t&&(e=!1,this.ctx.eventHub.removeListener("IterateTimeNodeEnd",r))};for(this.ctx.eventHub.on("IterateTimeNodeEnd",r);e;){const o=JSON.parse(JSON.stringify(this.json)),s=new Ac({json:o,isSub:!1,eventHubs:this.eventHubs,ctx:this.ctx,parent:null,isIterate:!0,iterateType:o.iterate.type,iterateIndex:i,iterateId:t,isInInteractiveSeq:this.isInInteractiveSeq});this.iterateShadows[i]=s,i+=1}}isInfiniteRepeat(){return this.json.repeatCount>999999998}getReverse(){return this.isReverse}setReverse(t){this.isReverse=t}createTimeNode(t,e){let i=null;const r={json:t,isSub:e,isIterate:this.isIterate,eventHub:this.eventHubs.global,ctx:this.ctx,parent:this,iterateType:this.iterateType,iterateIndex:this.iterateIndex,iterateId:this.iterateId,isInInteractiveSeq:this.isInInteractiveSeq};return t.type==="seq"?i=new DP(r):t.type==="par"?i=new iS(r):t.type==="set"?i=new FP(r):t.type==="anim"?i=new BP(r):t.type==="animEffect"?i=new XP(r):t.type==="animMotion"?i=new qP(r):t.type==="animScale"?i=new YP(r):t.type==="animClr"?i=new $P(r):t.type==="animRot"?i=new JP(r):t.type==="cmd"?i=new ZP(r):t.type==="audio"&&(i=new KP(r)),i}createSubList(t){this.subList=[],t.forEach(e=>{const i=this.createTimeNode(e,!0);i&&this.subList.push(i)})}bindCommonTimeNodeEvent(t){t.commonTimeNode.on("timeNodeStart",e=>{this.emit("childTimeNodeStart",e)}),t.commonTimeNode.on("timeNodeEnd",e=>{this.emit("childTimeNodeEnd",e),this.children.every(i=>i.commonTimeNode.isTimeNodeEndWhenDetectEndSync())&&(this.json.iterate||this.allChildrenEndHandle())})}createChildren(t){function e(i){return(r=i,function(o){var s;return!!(!((s=o)===null||s===void 0)&&s.cBhvr)}(r)?r.cBhvr.ctn:function(o){var s,a;return!!(!((a=(s=o)===null||s===void 0?void 0:s.cMediaNode)===null||a===void 0)&&a.ctn)}(r)?r.cMediaNode.ctn:r.ctn).presetOrder;var r}t&&t[0]&&e(t[0])?[...t].sort((i,r)=>{var o,s;return((o=e(i))!==null&&o!==void 0?o:0)-((s=e(r))!==null&&s!==void 0?s:0)}).forEach(i=>{const r=t.findIndex(s=>s===i),o=this.createTimeNode(i,!1);o&&(this.bindCommonTimeNodeEvent(o),this.children[r]=o)}):t.forEach(i=>{const r=this.createTimeNode(i,!1);r&&(this.bindCommonTimeNodeEvent(r),this.children.push(r))})}playReverse(){this.isReverse=!0,this.startReverseTimeLine(),this.children.forEach(t=>t.commonTimeNode.playReverse())}allChildrenEndHandle(){if(!this.isDestroy){if(this.json.autoRev&&!this.isReverse)return this.isReverse=!0,void this.playReverse();this.isReverse&&(this.isReverse=!1),this.json.repeatCount&&this.json.repeatCount>this.applyCount?this.repeatTimeoutId=this.ctx.clock.setTimeout(()=>{this.seekToStart(!1),this.resetForRepeat(),this.startTimeNodeRepeat()}):(this.json.iterate&&!this.isIterate&&(this.isIterateEnd=!0),this.eventHubs.runtime.emit("runtime all end"),this.startSubList(),this.handleEnd())}}resetForRepeat(){this.isInInteractiveSeq&&this.isInfiniteRepeat()&&this.repeatTimeNodeEnd(),this.timeDelta=0,this.children.forEach(t=>t.commonTimeNode.resetForRepeat())}startSubList(){this.subList.forEach(t=>t.commonTimeNode.startTimeNode())}startReverseTimeLine(){this.isEndEventsEmitted=!1,this.timeDelta=0;const t=1e3/this.ctx.ticker.maxFPS;this.duration<=t&&this.duration>0?(this.emit("timeUpdate",{delta:this.duration,duration:this.duration,isReverse:this.isReverse}),this.ctx.eventHub.emit(Ne.animateEnd),this.ctx.ticker.remove(this.updateTimeLine)):this.duration>t&&(this.ctx.eventHub.emit(Ne.animateStart),this.ctx.ticker.add(this.updateTimeLine))}startTimeLine(t=!0){if(t&&(this.isEndEventsEmitted=!1,this.eventHubs.global.emit(`time ${this.json.id} begin`),this.eventHubs.global.emit(`time ${this.json.id} onBegin`),this.eventHubs.runtime.emit(`runtime ${this.json.id} begin`)),this.json.iterate)return void this.startIterate();this.timeDelta=0,this.emit("timelineStart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse});const e=1e3/this.ctx.ticker.maxFPS;this.duration<=e&&this.duration>0?(this.timeDelta=this.isReverse?0:this.duration,this.emit("timeUpdate",{delta:this.timeDelta,duration:this.duration,isReverse:this.isReverse}),this.emit("timelineEnd",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.ctx.ticker.addOnce(()=>{this.onTimeLineEnd()})):this.duration>e&&(this.ctx.eventHub.emit(Ne.animateStart),this.updateTimeLine(0),this.ctx.ticker.add(this.updateTimeLine))}startIterate(){return QP(this,void 0,void 0,function*(){if(this.json.iterate){this.isIterateEnd=!1;for(const t of this.iterateShadows){if(this.isIterateEnd)break;t.children.forEach(e=>{e.commonTimeNode.startTimeNode()}),t.applyCount+=1,yield this.ctx.clock.delay(this.json.iterate.interval)}this.onTimeLineEnd()}})}applyTimeFilter(t){if(!this.tmFilter.every(e=>Object(V.isNumber)(e[0])&&Object(V.isNumber)(e[1])))return t;for(let e=0;e<this.tmFilter.length;e++){const i=this.tmFilter[e];if(t<i[0]){const r=this.tmFilter[e-1];return(t-r[0])/(i[0]-r[0])*(i[1]-r[1])+r[1]}}return this.tmFilter.length>0?this.tmFilter[this.tmFilter.length-1][1]:t}isNatureTimeEnd(){return this.duration>=0&&this.timeDelta>=this.duration}findTargets(){const t=[],e=i=>{i.forEach(r=>{var o,s,a;r.cBhvr&&r.cBhvr.target&&t.findIndex(l=>l.id===r.cBhvr.target.id)<0&&t.push(r.cBhvr.target),((s=(o=r==null?void 0:r.cBhvr)===null||o===void 0?void 0:o.ctn)===null||s===void 0?void 0:s.childTnLst)&&r.cBhvr.ctn.childTnLst.length>0&&e(r.cBhvr.ctn.childTnLst),((a=r==null?void 0:r.ctn)===null||a===void 0?void 0:a.childTnLst)&&r.ctn.childTnLst.length>0&&e(r.ctn.childTnLst)})};return e(this.json.childTnLst||[]),t}setPreStyle(){this.json.presetClass&&this.findTargets().forEach(t=>{if(this.json.iterate){let e=0,i=!0;for(;i;){const r=this.ctx.timingTargets.getTarget(t,!0,{type:this.json.iterate.type,index:e,id:""});r&&(this.setPreStyleForTarget(r),e+=1),i=!!r}}else{const e=this.ctx.timingTargets.getTarget(t,!1);e&&this.setPreStyleForTarget(e)}})}setPreStyleForTarget(t){var e,i;if(t&&this.json.presetSubtype&&(t.presetSubType=this.json.presetSubtype),t&&!t.hasPreset)if(this.json.presetClass==="entr"){const r=(i=(e=this.json)===null||e===void 0?void 0:e.childTnLst)===null||i===void 0?void 0:i.filter(o=>o.type==="set"&&o.to==="visible");r!=null&&r.length&&(t.hasPreset=!0,t.style.visibility="hidden")}else(this.json.presetClass==="exit"||this.json.presetClass==="path")&&(t.hasPreset=!0,t.style.visibility="visible")}startTimeNodeRepeat(){this.timeDelta=0,this.isActive=!0,this.applyCount+=1,this.startTimeLine(!1),this.json.iterate||this.emit("timeNodeRepeat",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse})}startTimeNodeForce(){this.json.subTnLst&&this.createSubList(this.json.subTnLst),this.timeDelta=0,this.isActive=!0,this.handleActive(!1)}startTimeNode(t=!0){if(this.isDestroy)return;this.collectStartValue(),this.timeDelta=0,this.isReverse=!1,this.json.subTnLst&&this.createSubList(this.json.subTnLst),this.startConds.setTriggerParams(t);const e=this.json.stCondLst.filter(r=>/^self/.test(r.event||""))[0];e&&this.startConds.condHandle(e);const i=this.json.endCondLst.filter(r=>/^self/.test(r.event||""))[0];i&&this.endConds.condHandle(i),this.startConds.condHandle()}onTimeLineEnd(){this.dispose(),(this.children.length===0||this.json.iterate)&&this.allChildrenEndHandle()}clearSubList(){this.subList.forEach(t=>t.commonTimeNode.destroy())}seekToStart(t=!0){if(this.isEndEventsEmitted=!1,this.isActive=!1,this.dispose(),this.timeDelta=0,this.emit("seekToStart"),this.json.iterate&&!this.isIterate)return this.isIterateEnd=!0,void this.iterateShadows.forEach(e=>e.seekToStart(t));if(t)for(let e=this.subList.length-1;e>=0;e--){const i=this.subList[e];i==null||i.commonTimeNode.seekToStart()}for(let e=this.children.length-1;e>=0;e--){const i=this.children[e];i==null||i.commonTimeNode.seekToStart()}for(let e=this.children.length-1;e>=0;e--){const i=this.children[e];i==null||i.commonTimeNode.seekToStart()}}repeatTimeNodeEnd(){this.dispose(),this.children.forEach(t=>{t.commonTimeNode.isActive=!1,t.commonTimeNode.dispose()})}dispose(t=!1){this.isConflictDispose=t,this.ctx.clock.clearTimeout(this.repeatTimeoutId),this.ctx.eventHub.emit(Ne.animateEnd);try{this.ctx.ticker.remove(this.updateTimeLine)}catch{}this.startConds.reset(),this.endConds.reset()}seekToEnd(t,e=!1){if(this.isInfiniteRepeat())return;!this.isActive&&this.applyCount<=0&&this.collectStartValue(),this.applyCount=this.json.repeatCount,this.json.autoRev&&(this.isReverse=!0),this.timeDelta=this.duration,this.isActive=!1,this.dispose();const i=this.json.autoRev||t;if(i?this.emit("seekToStart"):this.emit("seekToEnd"),this.json.iterate&&!this.isIterate)return this.isIterateEnd=!0,void this.iterateShadows.forEach(r=>r.seekToEnd(i,e));this.children.length===0&&(this.eventHubs.runtime.emit("runtime all end"),this.handleEnd()),this.children.forEach(r=>r.commonTimeNode.seekToEnd(i,e)),e&&this.json.subTnLst&&(this.subList.length<=0&&this.createSubList(this.json.subTnLst),this.subList.forEach(r=>r.commonTimeNode.seekToEnd(!1)),this.clearSubList())}isTimeNodeEndWhenDetectEndSync(){if(this.isInInteractiveSeq&&this.isInfiniteRepeat())return!0;let t=!0;return this.children.length>0&&(t=t&&this.children.every(e=>e.commonTimeNode.isTimeNodeEndWhenDetectEndSync())),this.json.repeatCount&&(t=t&&this.applyCount>=this.json.repeatCount),this.json.autoRev&&(t=t&&!this.isReverse),t=t&&this.isNatureTimeEnd(),!!this.isConflictDispose||!(!this.isIterateEnd||!this.json.iterate)||t}isTimeNodeEnd(){let t=!0;return this.children.length>0&&(t=t&&this.children.every(e=>e.commonTimeNode.isTimeNodeEnd())),this.json.repeatCount&&(t=t&&this.applyCount>=this.json.repeatCount),this.json.autoRev&&(t=t&&!this.isReverse),t=t&&this.isNatureTimeEnd(),!!this.isConflictDispose||!(!this.isIterateEnd||!this.json.iterate)||t}emitEndEvents(){this.isEndEventsEmitted||(this.isEndEventsEmitted=!0,this.eventHubs.global.emit(`time ${this.json.id} end`),this.eventHubs.global.emit(`time ${this.json.id} onEnd`),this.eventHubs.runtime.emit(`runtime ${this.json.id} end`),this.emit("timeNodeEnd",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}))}collectStartValue(){this.emit("timeNodeCreate"),this.children.forEach(t=>t.commonTimeNode.collectStartValue())}destroy(){this.emit("timeNodeDestroy"),this.isDestroy=!0,this.dispose(),this.startConds.removeAllListeners(),this.endConds.removeAllListeners(),this.children.forEach(t=>t.commonTimeNode.destroy()),this.clearSubList()}}class iS extends P.a{constructor(t){super(),this.isRunning=!1,this.runtimeNodeEventHub=new P.a;const{json:e,iterateType:i,isIterate:r,isSub:o,parent:s,ctx:a,eventHub:l,iterateIndex:u,iterateId:h,isInInteractiveSeq:d}=t;this.id=e.ctn.id,this.json=e,this.ctx=a,this.isIterate=r,this.globalEventHub=l,this.commonTimeNode=new Ac({json:e.ctn,isSub:o,eventHubs:{global:l,runtime:this.runtimeNodeEventHub},ctx:a,parent:s,isIterate:!1,iterateType:i,iterateIndex:u,iterateId:h,isInInteractiveSeq:d}),this.commonTimeNode.on("timeNodeStart",()=>{this.commonTimeNode.children.forEach(p=>{p.commonTimeNode.setReverse(this.commonTimeNode.getReverse()),p.commonTimeNode.startTimeNode()}),this.isRunning||(this.isRunning=!0,this.globalEventHub.emit(`runtime ${this.id} begin`),this.emit("begin"))}),this.commonTimeNode.on("timeNodeRepeat",()=>{this.commonTimeNode.children.forEach(p=>{p.commonTimeNode.startTimeNode(!1)})}),this.commonTimeNode.on("timeNodeEnd",()=>{this.commonTimeNode.isTimeNodeEnd()&&this.isRunning&&(this.isRunning=!1,this.globalEventHub.emit(`runtime ${this.id} end`),this.emit("end"))})}}var tI=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};class eI{constructor(t,e,i){this.json=t,this.ctx=i,this.globalEventHub=e;const r=t.timeNodeList.find(o=>o.type==="par"&&o.ctn.nodeType==="tmRoot");r&&(this.tmRoot=new iS({json:r,isSub:!1,isIterate:!1,eventHub:e,ctx:i,parent:null,iterateType:"el",iterateIndex:0,iterateId:"",isInInteractiveSeq:!1}),this.mainSeq=this.tmRoot.commonTimeNode.children.find(o=>{var s,a,l;return((s=o.json)===null||s===void 0?void 0:s.type)==="seq"&&((l=(a=o.json)===null||a===void 0?void 0:a.ctn)===null||l===void 0?void 0:l.nodeType)==="mainSeq"}))}findSeq(t){var e;return(e=this.tmRoot)===null||e===void 0?void 0:e.commonTimeNode.children.find(i=>{var r,o,s;return((r=i.json)===null||r===void 0?void 0:r.type)==="seq"&&((s=(o=i.json)===null||o===void 0?void 0:o.ctn)===null||s===void 0?void 0:s.id)===t})}start(){var t,e;return tI(this,void 0,void 0,function*(){this.json.autoPlayMainSeq?(yield this.ctx.clock.delay(16),(t=this.mainSeq)===null||t===void 0||t.commonTimeNode.startTimeNode()):(e=this.mainSeq)===null||e===void 0||e.commonTimeNode.startTimeNode()})}setMainSeqApplied(){this.mainSeq&&(this.mainSeq.commonTimeNode.applyCount=1)}collectMainSeqStartValue(){var t;(t=this.mainSeq)===null||t===void 0||t.commonTimeNode.collectStartValue()}setMainSeqStep(t,e){var i;t===-1&&this.mainSeq&&(this.mainSeq.commonTimeNode.applyCount=1),(i=this.mainSeq)===null||i===void 0||i.setCurrentStep(t,e)}destroy(){var t;this.globalEventHub.removeAllListeners(),(t=this.tmRoot)===null||t===void 0||t.commonTimeNode.destroy()}hasMainSeq(){return!!this.mainSeq&&this.mainSeq.commonTimeNode.children.length>0}currentMainSeqState(){return this.mainSeq?this.mainSeq.currentState:null}currentMainSeqStep(){return this.mainSeq?this.mainSeq.currentStep:0}currentMainSeqLength(){return this.mainSeq?this.mainSeq.stepLength:0}mainSeqHasNextStep(){return!!this.mainSeq&&this.mainSeq.hasNext()}mainSeqHasPrevStep(){return!!this.mainSeq&&this.mainSeq.hasPrev()}seekInteractiveSeqToEnd(t){const e=this.findSeq(t);e&&e.commonTimeNode.seekToEnd(!1,!0)}setInteractiveSeqState(t,e,i){const r=this.findSeq(t);r&&r.setCurrentStep(e,i)}resetAllInteractiveSeq(){var t;(((t=this.tmRoot)===null||t===void 0?void 0:t.commonTimeNode.children.filter(e=>{var i,r,o;return((i=e.json)===null||i===void 0?void 0:i.type)==="seq"&&((o=(r=e.json)===null||r===void 0?void 0:r.ctn)===null||o===void 0?void 0:o.nodeType)==="interactiveSeq"}))||[]).forEach(e=>{e.setCurrentStep(0,"start")})}applyInteractiveAction(t){this.globalEventHub.emit(t)}}var nS=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};class iI extends y_{constructor(t,e,i,r){super({id:"stage",width:t.width,height:t.height,type:"Container",children:t.children},e,i,void 0,r),this.isRendered=!1,this.isTimingStartValueCollected=!1,this.json=t,e.hasBackgroundFillShape=this.detectUseBackgroundFill(this.json),this.container.visible=!1,this.ctx=e;const o=new Ns;o.beginFill(16777215),o.drawRect(0,0,t.width,t.height),o.endFill(),this.container.addChild(o)}detectUseBackgroundFill(t){return!!t&&(t.type==="Picture"||t.type==="Shape"?t.useBgFill:!(!t.children||!Object(V.isArray)(t.children))&&t.children.some(e=>this.detectUseBackgroundFill(e)))}initOnReuse(){super.initOnReuse(),this.ctx.timingEventHub.on("c:prev slide",t=>{this.ctx.eventHub.emit(Ne.requestPrevSlide,t)}),this.ctx.timingEventHub.on("c:next slide",t=>{this.ctx.eventHub.emit(Ne.requestNextSlide,t)})}get interactiveContainer(){return this.container}render(t){this.isRendered||(this.isRendered=!0,super.render(t),t.addSubMTask(()=>nS(this,void 0,void 0,function*(){this.ctx.eventHub.emit("StageRenderEnd")}),"@StageImpl[emit.StageRenderEnd]"))}createTiming(){this.json.timing&&!this.timing&&(this.timing=new eI(this.json.timing,this.ctx.timingEventHub,this.ctx))}startTiming(){var t;return((t=this.timing)===null||t===void 0?void 0:t.start())||Promise.resolve()}setMainSeqApplied(){var t;(t=this.timing)===null||t===void 0||t.setMainSeqApplied()}setMainSeqStep(t,e){var i;(i=this.timing)===null||i===void 0||i.setMainSeqStep(t,e)}collectMainSeqStartValue(){var t;this.isTimingStartValueCollected||(this.isTimingStartValueCollected=!0,(t=this.timing)===null||t===void 0||t.collectMainSeqStartValue())}hasTiming(){return!!this.timing}clearOnSlideChange(){this.ctx.eventHub.removeAllListeners(),this.ctx.timingEventHub.removeAllListeners(),super.clearOnSlideChange()}clearOnTransactionEnd(){var t,e;this.ctx.timingTargets.getTargets().forEach(i=>{i.hasPreset=!1}),(t=this.timing)===null||t===void 0||t.resetAllInteractiveSeq(),(e=this.timing)===null||e===void 0||e.destroy(),this.timing=void 0}destroy(){var t,e;this.isTimingStartValueCollected=!1,this.isRendered=!1,this.ctx.eventHub.removeAllListeners(),this.ctx.graphicsTexture.destroy(),(t=this.ctx.bgTexture)===null||t===void 0||t.destroy(!0),this.ctx.spriteTexture.destroy(),this.ctx.timingEventHub.removeAllListeners(),(e=this.timing)===null||e===void 0||e.destroy(),this.timing=void 0,super.destroy()}mainSeqStep(){var t,e;return(e=(t=this.timing)===null||t===void 0?void 0:t.currentMainSeqStep())!==null&&e!==void 0?e:0}mainSeqLength(){var t,e;return(e=(t=this.timing)===null||t===void 0?void 0:t.currentMainSeqLength())!==null&&e!==void 0?e:0}mainSeqHasNextStep(){var t,e;return(e=(t=this.timing)===null||t===void 0?void 0:t.mainSeqHasNextStep())!==null&&e!==void 0&&e}mainSeqHasPrevStep(){var t,e;return(e=(t=this.timing)===null||t===void 0?void 0:t.mainSeqHasPrevStep())!==null&&e!==void 0&&e}mainSeqState(){return this.timing?this.timing.currentMainSeqState():null}nextStep(t=!1){var e;this.hasTiming()&&((e=this.timing)===null||e===void 0?void 0:e.hasMainSeq())?(this.ctx.timingEventHub.emit("shape slide onStopAudio"),this.ctx.timingEventHub.emit("shape slide onNext",t)):this.ctx.eventHub.emit(Ne.requestNextSlide,t)}prevStep(t=!1){var e;this.hasTiming()&&((e=this.timing)===null||e===void 0?void 0:e.hasMainSeq())?(this.ctx.timingEventHub.emit("shape slide onStopAudio"),this.ctx.timingEventHub.emit("shape slide onPrev",t)):this.ctx.eventHub.emit(Ne.requestPrevSlide,t)}applyInteractiveAction(t){var e;(e=this.timing)===null||e===void 0||e.applyInteractiveAction(t)}seekInteractiveSeqToEnd(t){var e;(e=this.timing)===null||e===void 0||e.seekInteractiveSeqToEnd(t)}setInteractiveSeqState(t,e,i){var r;(r=this.timing)===null||r===void 0||r.setInteractiveSeqState(t,e,i)}setMediaState(t,e){return nS(this,void 0,void 0,function*(){const i=this.ctx.medias[t];i&&(e?yield i.play():yield i.pause())})}setMediaCurrentTime(t,e){const i=this.ctx.medias[t];i&&i.seek(e)}}class nI{constructor(t){this.ticker=t,this.tasks=[],this.couldRunning=!1,this.applyNext=()=>{const e=this.tasks[0];e&&e.applyNext()},t.add(this.applyNext)}addTask(t){this.tasks.push(t),t.once("task-finish",()=>{const e=this.tasks.indexOf(t);e>=0&&this.tasks.splice(e,1)}),t.once("task-error",()=>{const e=this.tasks.indexOf(t);e>=0&&this.tasks.splice(e,1)})}start(){this.couldRunning=!0}stop(){this.couldRunning=!1}}var rI=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};const oI=n=>new Promise(t=>setTimeout(t,n));class sI extends P.a{constructor(t,e,i){super(),this.slideIndex=t,this.taskId=e,this.logger=i,this.uuid=fp(),this.isCancel=!1,this.tasks=[]}addMTask(t,e){this.tasks.push({fn:t,state:"wait",sub:[],name:e})}addSubMTask(t,e){let i=this.tasks.findIndex(r=>r.state==="running");i<0&&(i=0),this.tasks[i].sub.push({fn:t,state:"wait",sub:[],name:e})}cancel(){this.tasks=[],this.isCancel=!0}applyNext(){if(this.tasks.some(e=>e.state==="running")||this.tasks.some(e=>e.state==="error"))return;if(this.tasks.every(e=>e.state==="finish"))return void(this.isCancel||this.emit("task-finish"));const t=this.tasks.find(e=>e.state==="wait");t&&(t.state="running",t.fn.apply(null).then(()=>{if(t.state="finish",t.sub.length>0){const e=this.tasks.findIndex(i=>i===t);this.tasks.splice(e+1,0,...t.sub)}}).catch(e=>{t.state="error",this.logger.error(`${e} ${e.stack}`,this.taskId),this.emit("task-error",Sn.transform(e),this.slideIndex)}))}applyAll(){return rI(this,void 0,void 0,function*(){for(;!this.tasks.every(t=>t.state==="finish");)if(this.tasks.some(t=>t.state==="running"))yield oI(16);else{if(this.tasks.some(t=>t.state==="error"))return;{const t=this.tasks.find(e=>e.state==="wait");if(t){t.state="running";try{if((yield Sc(()=>t.fn.apply(null),6e4))===Ra)throw new Sn(ur.RuntimeError,`subtask ${t.name} apply timeout`);if(t.state="finish",t.sub.length>0){const e=this.tasks.findIndex(i=>i===t);this.tasks.splice(e+1,0,...t.sub)}}catch(e){let i;i=e!=null&&e.errorType?e:new Sn(ur.RuntimeError,`subtask ${t.name} error. ${e}`),t.state="error",this.logger.error(`${e} ${e.stack}`,this.taskId),this.emit("task-error",Sn.transform(i),this.slideIndex);break}}}}!this.isCancel&&this.tasks.every(t=>t.state==="finish")&&this.emit("task-finish")})}}var aI=v(53);const x_=new(v.n(aI)).a,lI=x_.getDevice(),uI=x_.getBrowser(),gg=x_.getOS(),vg={isDesktop(){let n=!0;return lI.type==="mobile"&&(n=!1),/Samsung/.test(uI.name||"")&&(n=!1),window.__nativeTags&&window.__nativeTags.platform&&(n=!1),n},isIOS(){let n=!1;return window.__nativeTags&&window.__nativeTags.platform&&/^ios/i.test(window.__nativeTags.platform)&&(n=!0),gg.name&&/iOS/.test(gg.name)&&(n=!0),n},isAndroid(){let n=!1;return window.__nativeTags&&window.__nativeTags.platform&&/^android/i.test(window.__nativeTags.platform)&&(n=!0),gg.name&&/android/i.test(gg.name)&&(n=!0),n},isLowGpuMemory(){var n,t;const e=(t=(n=window.__nativeTags)===null||n===void 0?void 0:n.platform)!==null&&t!==void 0?t:"";if(e){const i=e.split(" ");if(i[1]){if(/^iPad/.test(i[1])){const r=i[1].match(/^iPad(\d+)/);return!(r&&r[1]&&parseInt(r[1],10)>=6)}if(/^iPhone/.test(i[1])){const r=i[1].match(/^iPhone(\d+)/);return!(r&&r[1]&&parseInt(r[1],10)>=9)}return!1}return!1}return!0}};var Rc=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};class hI{constructor(t,e,i,r,o,s,a,l,u,h,d,p,m){this.loader=t,this.mode=e,this.renderer=i,this.ticker=r,this.view=o,this.clock=s,this.objPoolGroup=a,this.errorChannel=l,this.localstorage=u,this.logger=h,this.loaderDelegate=d,this.isPlayerPaused=p,this.maxResolution=m,this.currentStageIndex=0,this.cacheCount=vg.isDesktop()?2:1,this.stageStates=Object.create(null),this.stageJsons=Object.create(null),this.stageCtxs=Object.create(null),this.stageImpls=Object.create(null),this.taskId="",this.url="",this.runningAudio=new Map,this.activeMedia=new Set,this.microTaskManager=new nI(r)}setResourceData(t,e){this.taskId=t,this.url=e}createCtx(t){const{task:e}=this.stageStates[t];e.addMTask(()=>Rc(this,void 0,void 0,function*(){const i=new WC(this.loader),r=new P.a,o={taskId:this.taskId,mode:this.mode,renderer:this.renderer,graphicsTexture:new $C,stageWidth:0,stageHeight:0,ticker:this.ticker,timingTargets:new ZC(r),eventHub:r,view:this.view,medias:Object.create(null),lastViewedIndex:0,conflictTimeNodeManager:new JC,clock:this.clock,spriteTexture:i,slideIndex:t,objectPoolGroup:this.objPoolGroup,hasBackgroundFillShape:!1,slideScopeEventHub:new P.a,logger:this.logger,loaderDelegate:this.loaderDelegate,runningAudio:this.runningAudio,activeMedia:this.activeMedia,isPlayerPaused:this.isPlayerPaused,timingEventHub:new P.a,maxResolution:this.maxResolution};this.stageCtxs[t]=o}),"@StagePool[createCtx]")}loadStageJson(t){const{task:e}=this.stageStates[t];e.addMTask(()=>Rc(this,void 0,void 0,function*(){const i=yield this.loader.fetchJson(`${this.url}/${this.taskId}/jsonOutput/slide-${t}.json`);this.stageJsons[t]=i,this.stageCtxs[t].stageWidth=i.width,this.stageCtxs[t].stageHeight=i.height}),"@StagePool[loadStageJson]")}loadSpriteSheets(t){const{task:e}=this.stageStates[t];e.addMTask(()=>{const i=this.stageJsons[t],{spriteTexture:r,stageWidth:o,stageHeight:s}=this.stageCtxs[t],{coloredSheets:a,sheets:l}=i,u=a||l;return u&&u.forEach(h=>{e.addSubMTask(()=>{let d=1;if(o>this.maxResolution.x||s>this.maxResolution.y){d=this.maxResolution.x/o;const p=d*s;p>this.maxResolution.y&&(d*=this.maxResolution.y/p)}return r.loadSpriteSheetItem(this.url,this.taskId,h,d)},"@StagePool[spriteTexture.loadSpriteSheetItem]")}),Promise.resolve()},"@StagePool[loadSpriteSheets]")}createStage(t){const{task:e}=this.stageStates[t];e.addMTask(()=>{const i=this.stageJsons[t],r=this.stageCtxs[t],o=new iI(i,r,{x:0,y:0},e);return this.stageImpls[t]=o,Promise.resolve()},"@StagePool[createStage]")}preRenderStage(t){const{task:e}=this.stageStates[t];e.addMTask(()=>(this.stageImpls[t].preRender(e),Promise.resolve()),"@StagePool[preRenderStage]")}createGraphicsTexture(t){const{task:e}=this.stageStates[t];e.addMTask(()=>Rc(this,void 0,void 0,function*(){const i=this.stageCtxs[t];i.graphicsTexture.pack().forEach((r,o)=>{e.addSubMTask(()=>i.graphicsTexture.render(r,o,this.objPoolGroup),"@StagePool[graphicsTexture.render]")})}),"@StagePool[createGraphicsTexture]")}renderStage(t){const{task:e}=this.stageStates[t];e.addMTask(()=>Rc(this,void 0,void 0,function*(){const i=this.stageImpls[t],r=this.stageCtxs[t];yield i.render(e),e.addSubMTask(()=>Rc(this,void 0,void 0,function*(){var o;const s=`snapshot-${t.toString()}-start`;if(!(yield(o=this.localstorage)===null||o===void 0?void 0:o.getItem(s))&&tr.platform.isLowGpuMemory()){i.createTiming(),i.container.visible=!0,i.collectMainSeqStartValue(),i.setMainSeqStep(0,"start");const a=Ro.create({width:i.json.width,height:i.json.height,resolution:1});r.renderer.render(i.container,{renderTexture:a});const l=r.renderer.plugins.extract.base64(a,"image/jpeg");this.localstorage.setItem(s,l,!0).catch(()=>{}),i.container.visible=!1,a.destroy(),i.timing&&(i.timing.destroy(),i.timing=void 0)}}),"@StagePool[snapshot]")}),"@StagePool[renderStage]")}destroyStageByIndex(t){this.stageStates[t].state==="load"&&this.stageStates[t].task.cancel(),delete this.stageStates[t],this.stageImpls[t].destroy(),delete this.stageImpls[t],delete this.stageCtxs[t]}destroyStage(){Object.keys(this.stageImpls).forEach(t=>{const e=parseInt(t,10);Math.abs(this.currentStageIndex-e)>this.cacheCount&&this.destroyStageByIndex(e)})}destroyAllStage(){Object.keys(this.stageImpls).forEach(t=>{const e=parseInt(t,10);this.destroyStageByIndex(e)})}preload(t,e=!1){if(this.stageImpls[t]||this.stageStates[t])return Promise.resolve();const i=new sI(t,this.taskId,this.logger);return i.on("task-error",(r,o)=>{delete this.stageStates[o],delete this.stageImpls[o],delete this.stageCtxs[o],this.errorChannel.emit("error",r,o)}),this.stageStates[t]={state:"load",task:i},this.createCtx(t),this.loadStageJson(t),this.loadSpriteSheets(t),this.createStage(t),this.preRenderStage(t),this.createGraphicsTexture(t),this.renderStage(t),this.microTaskManager.addTask(i),e?i.applyAll():new Promise(r=>{i.once("task-finish",()=>{this.stageStates[t].state="finish",Object.keys(this.stageStates).length>2*this.cacheCount+1&&this.destroyStage(),r()})})}getStageJson(t){return this.stageJsons[t]||null}getStage(t){return Rc(this,void 0,void 0,function*(){this.currentStageIndex=t;const e=this.stageStates[t];return(e==null?void 0:e.state)==="finish"&&this.stageImpls[t]?this.stageImpls[t]:(e==null?void 0:e.state)==="load"?(yield e.task.applyAll(),this.stageImpls[t]):(yield this.preload(t,!0),this.stageImpls[t])})}destroy(){this.runningAudio.clear()}}var rS=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};class Po{constructor(t){var e;this.logger=t,this.taskId="",this.isIndexDBReady=!1,this.memoryCache=new Map,(e=Po.localCache)===null||e===void 0||e.ready(()=>{this.isIndexDBReady=!0}).catch(()=>{t.warn("local storage not ready",this.taskId)})}get couldUseIndexDBCache(){return this.isIndexDBReady&&this.taskId.length>0}attachTaskId(t){this.taskId=t}getItem(t){return rS(this,void 0,void 0,function*(){let e=null;return this.couldUseIndexDBCache&&Po.localCache&&(e=yield Sc(()=>Po.localCache.getItem(`${this.taskId}/${t}`),500)),e=e===Ra?null:e,e||this.memoryCache.get(t)||null})}setItem(t,e,i=!1){return rS(this,void 0,void 0,function*(){if(!this.couldUseIndexDBCache)return i&&this.memoryCache.set(t,e),Promise.resolve();Po.localCache&&(yield Sc(()=>Po.localCache.setItem(`${this.taskId}/${t}`,e).catch(()=>{i&&this.memoryCache.set(t,e)}),500))===Ra&&i&&this.memoryCache.set(t,e)})}dispose(){var t;this.memoryCache=new Map,this.couldUseIndexDBCache&&((t=Po.localCache)===null||t===void 0||t.keys().then(e=>{e.filter(i=>i.indexOf(this.taskId)>=0).forEach(i=>{var r;(r=Po.localCache)===null||r===void 0||r.removeItem(i).catch(()=>{})})}))}}Po.localCache=null;try{Po.localCache=ht.createInstance({name:"slide_local_cache",driver:ht.INDEXEDDB,version:1})}catch{}var Cc=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})};q.skipHello();const oS={randomBar:"RandomLines",circle:"Shape",ripple:"Ripples",wipe:"Erase",dissolve:"Dissolve",morph:"Smooth",fade:"FadeInOut",push:"Push",split:"Separation",reveal:"Display",pull:"Uncover",cover:"Cover",flash:"Flash",checker:"Checkerboard",blinds:"WindowShades",curtains:"Curtain",fallOver:"Fall",drape:"Suspension",wheel:"Clock",comb:"Combing",warp:"Scale",peelOff:"PeelOff",flip:"Flip"},Ne={mainSeqStepChange:"mainSeqStepChange",mainSeqStateChange:"mainSeqStateChange",interactiveSeqStateChange:"interactiveSeqStateChange",interactiveSeqAction:"interactiveSeqAction",mainSeqStepStart:"mainSeqStepStart",mainSeqStepEnd:"mainSeqStepEnd",slideChange:"slideChange",renderStart:"renderStart",renderEnd:"renderEnd",hyperlinkTrigger:"hyperlinkTrigger",animateStart:"animateStart",animateEnd:"animateEnd",mediaSeek:"mediaSeek",mediaPlay:"mediaPlay",mediaPause:"mediaPause",requestNextSlide:"requestNextSlide",requestPrevSlide:"requestPrevSlide",requestGotoSlide:"requestGotoSlide",userInput:"userInput"};class tr extends P.a{constructor(t,e={}){super(),this.errorChannel=new P.a,this.transactionPlayer=null,this.transactionSprite=new xr,this.isForward=!0,this.drawCall=0,this.scale=1,this.prevSlideBase64=null,this._isPaused=!1,this.maxResolution=new bn(0,0),this.fps=new kC,this.designWidth=0,this.designHeight=0,this.currentIndex=0,this.slideCount=0,this.runtime={drawCall:0,fps:0},this.isPlayerPaused=()=>this._isPaused,this.onWebGLLost=()=>{this.errorChannel.emit("error",new Sn(ur.CanvasCrash,"webgl context lost."))},this.logger=t.logger,this.mode=t.mode,this.localStorage=new Po(this.logger);let i=Math.max(window.devicePixelRatio,2);vg.isDesktop()||(i=1),this.config={minFPS:Object(V.isUndefined)(e.minFPS)?30:e.minFPS,maxFPS:Object(V.isUndefined)(e.maxFPS)?40:e.maxFPS,resolution:Object(V.isUndefined)(e.resolution)?i:e.resolution,autoFPS:!Object(V.isUndefined)(e.autoFPS)&&e.autoFPS,autoResolution:!Object(V.isUndefined)(e.autoResolution)&&e.autoResolution,transactionBgColor:Object(V.isUndefined)(e.transactionBgColor)?0:e.transactionBgColor,maxResolutionLevel:this.getMaxResolution(e.maxResolutionLevel)},this.updateMaxResolutionLevel(this.config.maxResolutionLevel),this.loader=new HC(this.localStorage,t.useLocalCache,this.logger,t.resourceTimeout,t.loadDelegate),this.app=new jm({antialias:!0,autoDensity:!1,backgroundColor:16777215}),this.updateConfig(this.config),this.app.view.style.zIndex="1",this.app.stage.sortableChildren=!0;const r=this.app.renderer,{drawElements:o}=r.gl;r.gl.drawElements=(...s)=>{o.call(r.gl,...s),this.drawCall+=1},this.fps.on("update",s=>{if(s<this.config.minFPS){if(this.config.autoResolution){const a=.7*this.scale,l=this.app.renderer.resolution,u=Math.max(a,l-.1);u>=a&&this.updateResolution(u)}if(this.config.autoFPS){const{minFPS:l,maxFPS:u}=this.app.ticker,h=Math.max(14,l-2),d=Math.max(14,u-2);h>=14&&d>=14&&(this.app.ticker.minFPS=h,this.app.ticker.maxFPS=d)}}else if(s>this.config.maxFPS){if(this.config.autoResolution){const a=this.scale*this.config.resolution,l=this.app.renderer.resolution,u=Math.min(a,l+.1);u<=this.config.resolution&&this.updateResolution(u)}if(this.config.autoFPS){const a=this.config.minFPS,l=this.config.maxFPS,{minFPS:u,maxFPS:h}=this.app.ticker,d=Math.min(a,u+2),p=Math.min(l,h+2);d<=a&&p<=l&&(this.app.ticker.minFPS=d,this.app.ticker.maxFPS=p)}}}),this.app.ticker.add(()=>{this.runtime.drawCall=this.drawCall,this.runtime.fps=Math.floor(this.app.ticker.minFPS),this.drawCall=0},null,is.LOW),this.clock=new jC(this.app.ticker),this.objPoolGroup=fp(),this.stagePool=new hI(this.loader,this.mode,this.app.renderer,this.app.ticker,this.app.view,this.clock,this.objPoolGroup,this.errorChannel,this.localStorage,this.logger,t.loadDelegate,this.isPlayerPaused,this.maxResolution),this.app.view.addEventListener("webglcontextlost",this.onWebGLLost);try{this.transactionPlayer=new HA}catch(s){/Error creating WebGL context/.test(s.message)?this.errorChannel.emit("error",new Sn(ur.CanvasCrash,"webgl context lost.")):this.errorChannel.emit("error",new Sn(ur.RuntimeWarn,s.message))}}get view(){return this.app.renderer?this.app.view:null}get nextSlideIndex(){var t;return!((t=this.currentStage)===null||t===void 0)&&t.json.nextIndex?this.currentStage.json.nextIndex:this.currentIndex+1}get prevSlideIndex(){var t;return!((t=this.currentStage)===null||t===void 0)&&t.json.prevIndex?this.currentStage.json.prevIndex:this.currentIndex-1}getMaxResolution(t){return!Object(V.isUndefined)(t)&&Number.isInteger(t)?(t<1&&(t=1),t>4&&(t=4),t):tr.platform.isAndroid()||tr.platform.isIOS()?2:4}updateMaxResolutionLevel(t){t<1&&(t=1),t>4&&(t=4);const e=[999999,960,1280,1920,3200][t],i=[999999,540,720,1080,1800][t];this.maxResolution.set(e,i)}updateConfig(t){Object(V.isUndefined)(t.minFPS)||(this.config.minFPS=t.minFPS,this.app.ticker.minFPS=t.minFPS),Object(V.isUndefined)(t.maxFPS)||(this.config.maxFPS=t.maxFPS,this.app.ticker.maxFPS=t.maxFPS),Object(V.isUndefined)(t.resolution)||(this.config.resolution=t.resolution,this.updateResolution(this.scale*this.config.resolution)),Object(V.isUndefined)(t.autoFPS)||(this.config.autoFPS=t.autoFPS),Object(V.isUndefined)(t.autoResolution)||(this.config.autoResolution=t.autoResolution),Object(V.isUndefined)(t.transactionBgColor)||(this.config.transactionBgColor=t.transactionBgColor),this.taskId&&this.logger.info("ppt player update config: "+JSON.stringify(this.config),this.taskId),Object(V.isUndefined)(t.maxResolutionLevel)||(this.config.maxResolutionLevel=t.maxResolutionLevel,this.updateMaxResolutionLevel(this.config.maxResolutionLevel))}preload(t){return Cc(this,void 0,void 0,function*(){t<1||t>this.slideCount||(this.logger.info(`preload slide ${t} begin`,this.taskId),yield this.stagePool.preload(t),this.logger.info(`preload slide ${t} end`,this.taskId))})}setResourceData(t,e){this.logger.info("ppt player init config: "+JSON.stringify(this.config),t),this.logger.info("set resource to "+e,t),this.taskId=t,this.url=e,this.stagePool.setResourceData(t,e),this.localStorage.attachTaskId(t),this.loader.attachTaskId(t)}setInteractive(t){this.app.stage.interactive=t,this.app.stage.interactiveChildren=t}translateEvent(t,e){e.forEach(i=>{t.on(i,(...r)=>{this.emit(i,...r)})})}renderSlide(t,e=!1){var i;return Cc(this,void 0,void 0,function*(){if(this._isPaused)return void this.logger.info("ppt play prevent render slide with paused state",this.taskId);this.logger.info("render slide "+t,this.taskId),this.emit(Ne.renderStart,t);const r=yield this.stagePool.getStage(t);if(!r)return;this.translateEvent(r.ctx.eventHub,[Ne.mainSeqStepChange,Ne.mainSeqStateChange,Ne.hyperlinkTrigger,Ne.interactiveSeqAction,Ne.mainSeqStepStart,Ne.mainSeqStepEnd,Ne.animateStart,Ne.animateEnd,Ne.mediaPlay,Ne.mediaPause,Ne.mediaSeek,Ne.requestGotoSlide,Ne.requestNextSlide,Ne.requestPrevSlide,Ne.interactiveSeqStateChange,Ne.userInput]),this.currentIndex=Number(t);const{width:o,height:s,slideCount:a}=r.json;this.slideCount=a,this.designWidth=o,this.designHeight=s,r.json.transition&&r.json.transition.type&&!this.prevSlideBase64&&this.currentStage&&(this.prevSlideBase64=this.getBase64(this.currentStage)),(i=this.currentStage)===null||i===void 0||i.clearOnSlideChange();const l=this.currentStage;this.currentStage=r,r.initOnReuse(),r.createTiming(),r.container.visible=!0,r.collectMainSeqStartValue(),this.isForward?r.setMainSeqStep(0,"start"):r.setMainSeqStep(-1,"end");let u=null;if(r.json.transition&&r.json.transition.type){const d=t.toString()+(this.isForward||e?"-start":"-end");u=(yield this.localStorage.getItem("snapshot-"+d))||this.getBase64(this.currentStage)}r.container.visible=!1,this.app.stage.addChild(r.container);let{transition:h}=r.json;!this.isForward&&(l==null?void 0:l.json.transition)&&(h=l.json.transition),this.prevSlideBase64&&u&&h&&h.type&&l&&r&&(yield this.playTransaction(this.prevSlideBase64,u,h,l,r),this.prevSlideBase64=null),this.isForward?yield r.startTiming():r.setMainSeqApplied(),this.updateResolution(this.config.resolution*this.scale),r.container.visible=!0,l&&(l.setMainSeqStep(0,"start"),l.clearOnTransactionEnd(),this.app.stage.removeChild(l.container)),r.ctx.slideScopeEventHub.emit("slide-render",r.ctx.slideIndex),this.emit(Ne.renderEnd,t),this.emit(Ne.slideChange,t),this.preload(t+1).catch(d=>{this.errorChannel.emit("error",Sn.transform(d),t+1)}),this.preload(t-1).catch(d=>{this.errorChannel.emit("error",Sn.transform(d),t-1)})})}renderToBase64(t,e){return Cc(this,void 0,void 0,function*(){const i=yield this.stagePool.getStage(t);if(i){const{width:r,height:o}=i.json;this.designWidth=r,this.designHeight=o;const s=Ro.create({width:this.designWidth,height:this.designHeight,resolution:e});i.container.visible=!0,this.app.renderer.render(i.container,{renderTexture:s});const a=this.app.renderer.plugins.extract.base64(s,"image/jpeg");return this.stagePool.destroyStageByIndex(t),a}return"__null__"})}getBase64(t){if(!t.container.transform)return null;const e=Ro.create({width:this.designWidth,height:this.designHeight,resolution:1});this.app.renderer.render(t.container,{renderTexture:e});const i=this.app.renderer.plugins.extract.base64(e,"image/jpeg");return e.destroy(!0),i}playTransaction(t,e,i,r,o){return Cc(this,void 0,void 0,function*(){const s=this.app.view.parentElement;if(t&&e&&s&&oS[i.type]&&this.transactionPlayer){this.transactionSprite.zIndex=999,this.transactionSprite.visible=!1,this.app.stage.addChild(this.transactionSprite);const a=this.transactionPlayer.renderer.domElement,l=Qe.from(a),u=()=>l.update();return this.app.ticker.add(u),this.transactionSprite.texture=l,setTimeout(()=>{this.transactionSprite.visible=!0},100),new Promise(h=>{var d,p,m,g;(d=this.transactionPlayer)===null||d===void 0||d.play({reverse:!this.isForward,prevTextureUrl:t,nextTextureUrl:e,textureWidth:this.designWidth,textureHeight:this.designHeight,presetType:oS[i.type],stageWidth:this.designWidth,stageHeight:this.designHeight,duration:(m=(p=this.currentStage)===null||p===void 0?void 0:p.json.transition)===null||m===void 0?void 0:m.dur,delay:0,clearColor:this.config.transactionBgColor,maxFPS:Math.ceil((g=this.config.maxFPS)!==null&&g!==void 0?g:60),onTransactionEnd:()=>{var _,y;h(),r.container.visible=!1,o.container.visible=!0,(_=this.app.stage)===null||_===void 0||_.removeChild(this.transactionSprite),(y=this.app.ticker)===null||y===void 0||y.remove(u)}})})}return Promise.resolve()})}scaleView(t,e,i){if(this.view&&(this.view.style.width=Math.floor(this.designWidth*t)+"px",this.view.style.height=Math.floor(this.designHeight*t)+"px"),e){this.scale=t;const r=this.scale*this.config.resolution;this.updateResolution(r,i)}}updateResolution(t,e){this.app.ticker.addOnce(()=>{let i=vg.isDesktop()?t:1;for(;i*this.designWidth>this.maxResolution.x||i*this.designHeight>this.maxResolution.y;)i-=.1;this.app.renderer.resolution=i,this.app.renderer.plugins.interaction.resolution=this.app.renderer.resolution,this.app.renderer.resize(this.designWidth,this.designHeight),Object(V.isFunction)(e)&&e()})}nextStep(t=!1){var e;if(this._isPaused)this.logger.info("ppt play prevent next step with paused state",this.taskId);else{this.logger.info("ppt play trigger next step",this.taskId);try{(e=this.currentStage)===null||e===void 0||e.nextStep(t)}catch(i){this.errorChannel.emit("error",Sn.transform(i),this.currentIndex)}}}prevStep(t=!1){var e;if(this._isPaused)this.logger.info("ppt play prevent prev step with paused state",this.taskId);else{this.logger.info("ppt play trigger prev step",this.taskId);try{(e=this.currentStage)===null||e===void 0||e.prevStep(t)}catch(i){this.errorChannel.emit("error",Sn.transform(i),this.currentIndex)}}}mainSeqLength(){var t,e;return(e=(t=this.currentStage)===null||t===void 0?void 0:t.mainSeqLength())!==null&&e!==void 0?e:0}mainSeqStep(){var t,e;return(e=(t=this.currentStage)===null||t===void 0?void 0:t.mainSeqStep())!==null&&e!==void 0?e:0}setMainSeqStep(t,e){var i;(i=this.currentStage)===null||i===void 0||i.setMainSeqStep(t,e)}mainSeqState(){var t,e;return(e=(t=this.currentStage)===null||t===void 0?void 0:t.mainSeqState())!==null&&e!==void 0?e:null}mainSeqHasNextStep(){var t,e;return(e=(t=this.currentStage)===null||t===void 0?void 0:t.mainSeqHasNextStep())!==null&&e!==void 0&&e}mainSeqHasPrevStep(){var t,e;return(e=(t=this.currentStage)===null||t===void 0?void 0:t.mainSeqHasPrevStep())!==null&&e!==void 0&&e}nextTick(t){this.app.ticker.addOnce(()=>{t()},is.LOW)}applyInteractiveAction(t){var e;(e=this.currentStage)===null||e===void 0||e.applyInteractiveAction(t)}seekInteractiveSeqToEnd(t){var e;(e=this.currentStage)===null||e===void 0||e.seekInteractiveSeqToEnd(t)}setInteractiveSeqState(t,e,i){var r;(r=this.currentStage)===null||r===void 0||r.setInteractiveSeqState(t,e,i)}setMediaState(t,e){var i;return Cc(this,void 0,void 0,function*(){yield(i=this.currentStage)===null||i===void 0?void 0:i.setMediaState(t,e)})}setMediaCurrentTime(t,e){var i;(i=this.currentStage)===null||i===void 0||i.setMediaCurrentTime(t,e)}pause(){var t;this.app.ticker.stop(),(t=this.currentStage)===null||t===void 0||t.ctx.activeMedia.forEach(e=>{e.globalPause()}),this._isPaused=!0}resume(){var t;this._isPaused=!1,this.app.ticker.start(),(t=this.currentStage)===null||t===void 0||t.ctx.activeMedia.forEach(e=>{e.globalResume()})}getSnapshot(){return this.currentStage&&this.getBase64(this.currentStage)||""}createSnapshotForNextSlide(t){return Cc(this,void 0,void 0,function*(){const e=this.nextSlideIndex,i=this.stagePool.getStageJson(e);if(i&&i.transition&&i.transition.type&&this.currentStage&&this.transactionPlayer){const r=t?`snapshot-${this.currentStage.json.index}-start`:`snapshot-${this.currentStage.json.index}-end`;if(this.currentStage.timing&&(t?this.currentStage.timing.mainSeqHasPrevStep():this.currentStage.timing.mainSeqHasNextStep()))this.prevSlideBase64=this.getBase64(this.currentStage);else{const o=yield this.localStorage.getItem(r);o?this.prevSlideBase64=o:(this.prevSlideBase64=this.getBase64(this.currentStage),this.localStorage.setItem(r,this.prevSlideBase64,!0).catch(()=>{}))}}})}clearLocalCache(){this.localStorage.dispose()}static clearLocalCache(){var t;(t=Po.localCache)===null||t===void 0||t.clear().catch(()=>{})}destroy(){var t;try{this.app.view.removeEventListener("webglcontextlost",this.onWebGLLost);try{this.app.renderer.filter.texturePool.clear(!0)}catch{}l_.collectObjectByGroup(this.objPoolGroup),u_.collectObjectByGroup(this.objPoolGroup),(t=this.transactionPlayer)===null||t===void 0||t.destroy(),this.loader.destroy(),this.fps.destroy(),this.stagePool.destroyAllStage(),this.stagePool.destroy();try{this.app.renderer.gl.getExtension("WEBGL_lose_context").loseContext()}catch{}this.app.destroy(!0,{children:!0,texture:!0,baseTexture:!0})}catch{}}}tr.platform=vg,tr.RtcAudioClazz=null;var bp,Fu=[],sS="ResizeObserver loop completed with undelivered notifications.";(function(n){n.BORDER_BOX="border-box",n.CONTENT_BOX="content-box",n.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(bp||(bp={}));var b_,Bu=function(n){return Object.freeze(n)},cI=function(n,t){this.inlineSize=n,this.blockSize=t,Bu(this)},aS=function(){function n(t,e,i,r){return this.x=t,this.y=e,this.width=i,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Bu(this)}return n.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},n.fromRect=function(t){return new n(t.x,t.y,t.width,t.height)},n}(),w_=function(n){return n instanceof SVGElement&&"getBBox"in n},lS=function(n){if(w_(n)){var t=n.getBBox(),e=t.width,i=t.height;return!e&&!i}var r=n,o=r.offsetWidth,s=r.offsetHeight;return!(o||s||n.getClientRects().length)},uS=function(n){var t,e;if(n instanceof Element)return!0;var i=(e=(t=n)===null||t===void 0?void 0:t.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(i&&n instanceof i.Element)},wp=typeof window!="undefined"?window:{},_g=new WeakMap,hS=/auto|scroll/,dI=/^tb|vertical/,pI=/msie|trident/i.test(wp.navigator&&wp.navigator.userAgent),Bs=function(n){return parseFloat(n||"0")},Pc=function(n,t,e){return n===void 0&&(n=0),t===void 0&&(t=0),e===void 0&&(e=!1),new cI((e?t:n)||0,(e?n:t)||0)},cS=Bu({devicePixelContentBoxSize:Pc(),borderBoxSize:Pc(),contentBoxSize:Pc(),contentRect:new aS(0,0,0,0)}),dS=function(n,t){if(t===void 0&&(t=!1),_g.has(n)&&!t)return _g.get(n);if(lS(n))return _g.set(n,cS),cS;var e=getComputedStyle(n),i=w_(n)&&n.ownerSVGElement&&n.getBBox(),r=!pI&&e.boxSizing==="border-box",o=dI.test(e.writingMode||""),s=!i&&hS.test(e.overflowY||""),a=!i&&hS.test(e.overflowX||""),l=i?0:Bs(e.paddingTop),u=i?0:Bs(e.paddingRight),h=i?0:Bs(e.paddingBottom),d=i?0:Bs(e.paddingLeft),p=i?0:Bs(e.borderTopWidth),m=i?0:Bs(e.borderRightWidth),g=i?0:Bs(e.borderBottomWidth),_=d+u,y=l+h,w=(i?0:Bs(e.borderLeftWidth))+m,A=p+g,I=a?n.offsetHeight-A-n.clientHeight:0,F=s?n.offsetWidth-w-n.clientWidth:0,N=r?_+w:0,U=r?y+A:0,B=i?i.width:Bs(e.width)-N-F,G=i?i.height:Bs(e.height)-U-I,ct=B+_+F+w,it=G+y+I+A,tt=Bu({devicePixelContentBoxSize:Pc(Math.round(B*devicePixelRatio),Math.round(G*devicePixelRatio),o),borderBoxSize:Pc(ct,it,o),contentBoxSize:Pc(B,G,o),contentRect:new aS(d,l,B,G)});return _g.set(n,tt),tt},pS=function(n,t,e){var i=dS(n,e),r=i.borderBoxSize,o=i.contentBoxSize,s=i.devicePixelContentBoxSize;switch(t){case bp.DEVICE_PIXEL_CONTENT_BOX:return s;case bp.BORDER_BOX:return r;default:return o}},fI=function(n){var t=dS(n);this.target=n,this.contentRect=t.contentRect,this.borderBoxSize=Bu([t.borderBoxSize]),this.contentBoxSize=Bu([t.contentBoxSize]),this.devicePixelContentBoxSize=Bu([t.devicePixelContentBoxSize])},fS=function(n){if(lS(n))return 1/0;for(var t=0,e=n.parentNode;e;)t+=1,e=e.parentNode;return t},mI=function(){var n=1/0,t=[];Fu.forEach(function(r){if(r.activeTargets.length!==0){var o=[];r.activeTargets.forEach(function(s){var a=new fI(s.target),l=fS(s.target);o.push(a),s.lastReportedSize=pS(s.target,s.observedBox),l<n&&(n=l)}),t.push(function(){r.callback.call(r.observer,o,r.observer)}),r.activeTargets.splice(0,r.activeTargets.length)}});for(var e=0,i=t;e<i.length;e++)(0,i[e])();return n},mS=function(n){Fu.forEach(function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach(function(e){e.isActive()&&(fS(e.target)>n?t.activeTargets.push(e):t.skippedTargets.push(e))})})},gI=function(){var n,t=0;for(mS(t);Fu.some(function(e){return e.activeTargets.length>0});)t=mI(),mS(t);return Fu.some(function(e){return e.skippedTargets.length>0})&&(typeof ErrorEvent=="function"?n=new ErrorEvent("error",{message:sS}):((n=document.createEvent("Event")).initEvent("error",!1,!1),n.message=sS),window.dispatchEvent(n)),t>0},gS=[],vI=function(n){if(!b_){var t=0,e=document.createTextNode("");new MutationObserver(function(){return gS.splice(0).forEach(function(i){return i()})}).observe(e,{characterData:!0}),b_=function(){e.textContent=""+(t?t--:t++)}}gS.push(n),b_()},S_=0,_I={attributes:!0,characterData:!0,childList:!0,subtree:!0},vS=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],_S=function(n){return n===void 0&&(n=0),Date.now()+n},T_=!1,E_=new(function(){function n(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return n.prototype.run=function(t){var e=this;if(t===void 0&&(t=250),!T_){T_=!0;var i,r=_S(t);i=function(){var o=!1;try{o=gI()}finally{if(T_=!1,t=r-_S(),!S_)return;o?e.run(1e3):t>0?e.run(t):e.start()}},vI(function(){requestAnimationFrame(i)})}},n.prototype.schedule=function(){this.stop(),this.run()},n.prototype.observe=function(){var t=this,e=function(){return t.observer&&t.observer.observe(document.body,_I)};document.body?e():wp.addEventListener("DOMContentLoaded",e)},n.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),vS.forEach(function(e){return wp.addEventListener(e,t.listener,!0)}))},n.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),vS.forEach(function(e){return wp.removeEventListener(e,t.listener,!0)}),this.stopped=!0)},n}()),yS=function(n){!S_&&n>0&&E_.start(),!(S_+=n)&&E_.stop()},yI=function(){function n(t,e){this.target=t,this.observedBox=e||bp.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return n.prototype.isActive=function(){var t,e=pS(this.target,this.observedBox,!0);return t=this.target,w_(t)||function(i){switch(i.tagName){case"INPUT":if(i.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||getComputedStyle(t).display!=="inline"||(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},n}(),xI=function(n,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=n,this.callback=t},yg=new WeakMap,xS=function(n,t){for(var e=0;e<n.length;e+=1)if(n[e].target===t)return e;return-1},xg=function(){function n(){}return n.connect=function(t,e){var i=new xI(t,e);yg.set(t,i)},n.observe=function(t,e,i){var r=yg.get(t),o=r.observationTargets.length===0;xS(r.observationTargets,e)<0&&(o&&Fu.push(r),r.observationTargets.push(new yI(e,i&&i.box)),yS(1),E_.schedule())},n.unobserve=function(t,e){var i=yg.get(t),r=xS(i.observationTargets,e),o=i.observationTargets.length===1;r>=0&&(o&&Fu.splice(Fu.indexOf(i),1),i.observationTargets.splice(r,1),yS(-1))},n.disconnect=function(t){var e=this,i=yg.get(t);i.observationTargets.slice().forEach(function(r){return e.unobserve(t,r.target)}),i.activeTargets.splice(0,i.activeTargets.length)},n}(),bI=function(){function n(t){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof t!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");xg.connect(this,t)}return n.prototype.observe=function(t,e){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!uS(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");xg.observe(this,t,e)},n.prototype.unobserve=function(t){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!uS(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");xg.unobserve(this,t)},n.prototype.disconnect=function(){xg.disconnect(this)},n.toString=function(){return"function ResizeObserver () { [polyfill code] }"},n}(),wI=function(n,t,e,i){return new(e||(e=Promise))(function(r,o){function s(u){try{l(i.next(u))}catch(h){o(h)}}function a(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){var h;u.done?r(u.value):(h=u.value,h instanceof e?h:new e(function(d){d(h)})).then(s,a)}l((i=i.apply(n,t||[])).next())})},SI=function(n,t){var e,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return function(h){if(e)throw new TypeError("Generator is already executing.");for(;s;)try{if(e=1,i&&(r=2&h[0]?i.return:h[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,h[1])).done)return r;switch(i=0,r&&(h=[2&h[0],r.value]),h[0]){case 0:case 1:r=h;break;case 4:return s.label++,{value:h[1],done:!1};case 5:s.label++,i=h[1],h=[0];continue;case 7:h=s.ops.pop(),s.trys.pop();continue;default:if(r=s.trys,!((r=r.length>0&&r[r.length-1])||h[0]!==6&&h[0]!==2)){s=0;continue}if(h[0]===3&&(!r||h[1]>r[0]&&h[1]<r[3])){s.label=h[1];break}if(h[0]===6&&s.label<r[1]){s.label=r[1],r=h;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(h);break}r[2]&&s.ops.pop(),s.trys.pop();continue}h=t.call(n,s)}catch(d){h=[6,d],i=0}finally{e=r=0}if(5&h[0])throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}([l,u])}}},TI=function(){function n(t,e,i,r,o){this.state="idle",this.index=-1,this.slideIndex=-1,this.fn=i,this.index=t,this.slideIndex=e,this.eventHub=r,this.id=o}return n.prototype.apply=function(){return wI(this,void 0,void 0,function(){var t;return SI(this,function(e){switch(e.label){case 0:this.eventHub.emit("task-start",this),e.label=1;case 1:return e.trys.push([1,3,,4]),this.state="start",[4,this.fn()];case 2:return e.sent(),this.state="end",this.eventHub.emit("task-end",this),[3,4];case 3:return t=e.sent(),this.eventHub.emit("task-error",{task:this,error:t}),[3,4];case 4:return[2]}})})},n}(),EI=function(){function n(){var t=this;this.eventHub=new P.a,this.tasks=[],this.index=0,this.eventHub.on("task-end",function(e){var i,r=t.tasks.findIndex(function(s){return s.index===e.index}),o=r+1;o>=0&&((i=t.tasks[o])===null||i===void 0||i.apply()),r>=0&&(t.tasks.splice(r,1),t.replaceIdleTask()),t.eventHub.emit("task-end-"+e.id)}),this.eventHub.on("task-error",function(e){var i=e.task,r=t.tasks.findIndex(function(o){return o.index===i.index});r>=0&&(t.tasks.splice(r,1),t.replaceIdleTask())})}return n.prototype.replaceIdleTask=function(){for(var t,e=this,i=new Set,r=0,o=this.tasks.length;r<o;r++)this.tasks[r].state==="idle"&&((t=this.tasks[r+1])===null||t===void 0?void 0:t.state)==="idle"&&i.add(r);Array.from(i).forEach(function(s){e.tasks.splice(s,1)})},n.prototype.addTask=function(t,e,i){var r=new TI(this.index++,e,t,this.eventHub,i);this.tasks.push(r),this.tasks.sort(function(o,s){return o.index-s.index}),this.replaceIdleTask(),this.tasks.length===1&&r.apply()},n.prototype.hasStartTask=function(){return this.tasks.some(function(t){return t.state==="start"})},n.prototype.destroy=function(){this.eventHub.removeAllListeners()},n}();function Ic(n,t){var e=n.__state.conversionName.toString(),i=Math.round(n.r),r=Math.round(n.g),o=Math.round(n.b),s=n.a,a=Math.round(n.h),l=n.s.toFixed(1),u=n.v.toFixed(1);if(t||e==="THREE_CHAR_HEX"||e==="SIX_CHAR_HEX"){for(var h=n.hex.toString(16);h.length<6;)h="0"+h;return"#"+h}return e==="CSS_RGB"?"rgb("+i+","+r+","+o+")":e==="CSS_RGBA"?"rgba("+i+","+r+","+o+","+s+")":e==="HEX"?"0x"+n.hex.toString(16):e==="RGB_ARRAY"?"["+i+","+r+","+o+"]":e==="RGBA_ARRAY"?"["+i+","+r+","+o+","+s+"]":e==="RGB_OBJ"?"{r:"+i+",g:"+r+",b:"+o+"}":e==="RGBA_OBJ"?"{r:"+i+",g:"+r+",b:"+o+",a:"+s+"}":e==="HSV_OBJ"?"{h:"+a+",s:"+l+",v:"+u+"}":e==="HSVA_OBJ"?"{h:"+a+",s:"+l+",v:"+u+",a:"+s+"}":"unknown format"}var bS=Array.prototype.forEach,Sp=Array.prototype.slice,oe={BREAK:{},extend:function(n){return this.each(Sp.call(arguments,1),function(t){(this.isObject(t)?Object.keys(t):[]).forEach(function(e){this.isUndefined(t[e])||(n[e]=t[e])}.bind(this))},this),n},defaults:function(n){return this.each(Sp.call(arguments,1),function(t){(this.isObject(t)?Object.keys(t):[]).forEach(function(e){this.isUndefined(n[e])&&(n[e]=t[e])}.bind(this))},this),n},compose:function(){var n=Sp.call(arguments);return function(){for(var t=Sp.call(arguments),e=n.length-1;e>=0;e--)t=[n[e].apply(this,t)];return t[0]}},each:function(n,t,e){if(n){if(bS&&n.forEach&&n.forEach===bS)n.forEach(t,e);else if(n.length===n.length+0){var i,r=void 0;for(r=0,i=n.length;r<i;r++)if(r in n&&t.call(e,n[r],r)===this.BREAK)return}else for(var o in n)if(t.call(e,n[o],o)===this.BREAK)return}},defer:function(n){setTimeout(n,0)},debounce:function(n,t,e){var i=void 0;return function(){var r=this,o=arguments;function s(){i=null,e||n.apply(r,o)}var a=e||!i;clearTimeout(i),i=setTimeout(s,t),a&&n.apply(r,o)}},toArray:function(n){return n.toArray?n.toArray():Sp.call(n)},isUndefined:function(n){return n===void 0},isNull:function(n){return n===null},isNaN:function(n){function t(e){return n.apply(this,arguments)}return t.toString=function(){return n.toString()},t}(function(n){return isNaN(n)}),isArray:Array.isArray||function(n){return n.constructor===Array},isObject:function(n){return n===Object(n)},isNumber:function(n){return n===n+0},isString:function(n){return n===n+""},isBoolean:function(n){return n===!1||n===!0},isFunction:function(n){return n instanceof Function}},MI=[{litmus:oe.isString,conversions:{THREE_CHAR_HEX:{read:function(n){var t=n.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return t!==null&&{space:"HEX",hex:parseInt("0x"+t[1].toString()+t[1].toString()+t[2].toString()+t[2].toString()+t[3].toString()+t[3].toString(),0)}},write:Ic},SIX_CHAR_HEX:{read:function(n){var t=n.match(/^#([A-F0-9]{6})$/i);return t!==null&&{space:"HEX",hex:parseInt("0x"+t[1].toString(),0)}},write:Ic},CSS_RGB:{read:function(n){var t=n.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return t!==null&&{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3])}},write:Ic},CSS_RGBA:{read:function(n){var t=n.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return t!==null&&{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3]),a:parseFloat(t[4])}},write:Ic}}},{litmus:oe.isNumber,conversions:{HEX:{read:function(n){return{space:"HEX",hex:n,conversionName:"HEX"}},write:function(n){return n.hex}}}},{litmus:oe.isArray,conversions:{RGB_ARRAY:{read:function(n){return n.length===3&&{space:"RGB",r:n[0],g:n[1],b:n[2]}},write:function(n){return[n.r,n.g,n.b]}},RGBA_ARRAY:{read:function(n){return n.length===4&&{space:"RGB",r:n[0],g:n[1],b:n[2],a:n[3]}},write:function(n){return[n.r,n.g,n.b,n.a]}}}},{litmus:oe.isObject,conversions:{RGBA_OBJ:{read:function(n){return!!(oe.isNumber(n.r)&&oe.isNumber(n.g)&&oe.isNumber(n.b)&&oe.isNumber(n.a))&&{space:"RGB",r:n.r,g:n.g,b:n.b,a:n.a}},write:function(n){return{r:n.r,g:n.g,b:n.b,a:n.a}}},RGB_OBJ:{read:function(n){return!!(oe.isNumber(n.r)&&oe.isNumber(n.g)&&oe.isNumber(n.b))&&{space:"RGB",r:n.r,g:n.g,b:n.b}},write:function(n){return{r:n.r,g:n.g,b:n.b}}},HSVA_OBJ:{read:function(n){return!!(oe.isNumber(n.h)&&oe.isNumber(n.s)&&oe.isNumber(n.v)&&oe.isNumber(n.a))&&{space:"HSV",h:n.h,s:n.s,v:n.v,a:n.a}},write:function(n){return{h:n.h,s:n.s,v:n.v,a:n.a}}},HSV_OBJ:{read:function(n){return!!(oe.isNumber(n.h)&&oe.isNumber(n.s)&&oe.isNumber(n.v))&&{space:"HSV",h:n.h,s:n.s,v:n.v}},write:function(n){return{h:n.h,s:n.s,v:n.v}}}}}],Tp=void 0,bg=void 0,M_=function(){bg=!1;var n=arguments.length>1?oe.toArray(arguments):arguments[0];return oe.each(MI,function(t){if(t.litmus(n))return oe.each(t.conversions,function(e,i){if(Tp=e.read(n),bg===!1&&Tp!==!1)return bg=Tp,Tp.conversionName=i,Tp.conversion=e,oe.BREAK}),oe.BREAK}),bg},wS=void 0,wg={hsv_to_rgb:function(n,t,e){var i=Math.floor(n/60)%6,r=n/60-Math.floor(n/60),o=e*(1-t),s=e*(1-r*t),a=e*(1-(1-r)*t),l=[[e,a,o],[s,e,o],[o,e,a],[o,s,e],[a,o,e],[e,o,s]][i];return{r:255*l[0],g:255*l[1],b:255*l[2]}},rgb_to_hsv:function(n,t,e){var i=Math.min(n,t,e),r=Math.max(n,t,e),o=r-i,s=void 0;return r===0?{h:NaN,s:0,v:0}:(s=n===r?(t-e)/o:t===r?2+(e-n)/o:4+(n-t)/o,(s/=6)<0&&(s+=1),{h:360*s,s:o/r,v:r/255})},rgb_to_hex:function(n,t,e){var i=this.hex_with_component(0,2,n);return i=this.hex_with_component(i,1,t),i=this.hex_with_component(i,0,e)},component_from_hex:function(n,t){return n>>8*t&255},hex_with_component:function(n,t,e){return e<<(wS=8*t)|n&~(255<<wS)}},AI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},rs=function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")},os=function(){function n(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,i){return e&&n(t.prototype,e),i&&n(t,i),t}}(),bl=function n(t,e,i){t===null&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,e);if(r===void 0){var o=Object.getPrototypeOf(t);return o===null?void 0:n(o,e,i)}if("value"in r)return r.value;var s=r.get;return s!==void 0?s.call(i):void 0},wl=function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(n,t):n.__proto__=t)},Sl=function(n,t){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||typeof t!="object"&&typeof t!="function"?n:t},er=function(){function n(){if(rs(this,n),this.__state=M_.apply(this,arguments),this.__state===!1)throw new Error("Failed to interpret color arguments");this.__state.a=this.__state.a||1}return os(n,[{key:"toString",value:function(){return Ic(this)}},{key:"toHexString",value:function(){return Ic(this,!0)}},{key:"toOriginal",value:function(){return this.__state.conversion.write(this)}}]),n}();function A_(n,t,e){Object.defineProperty(n,t,{get:function(){return this.__state.space==="RGB"||er.recalculateRGB(this,t,e),this.__state[t]},set:function(i){this.__state.space!=="RGB"&&(er.recalculateRGB(this,t,e),this.__state.space="RGB"),this.__state[t]=i}})}function R_(n,t){Object.defineProperty(n,t,{get:function(){return this.__state.space==="HSV"||er.recalculateHSV(this),this.__state[t]},set:function(e){this.__state.space!=="HSV"&&(er.recalculateHSV(this),this.__state.space="HSV"),this.__state[t]=e}})}er.recalculateRGB=function(n,t,e){if(n.__state.space==="HEX")n.__state[t]=wg.component_from_hex(n.__state.hex,e);else{if(n.__state.space!=="HSV")throw new Error("Corrupted color state");oe.extend(n.__state,wg.hsv_to_rgb(n.__state.h,n.__state.s,n.__state.v))}},er.recalculateHSV=function(n){var t=wg.rgb_to_hsv(n.r,n.g,n.b);oe.extend(n.__state,{s:t.s,v:t.v}),oe.isNaN(t.h)?oe.isUndefined(n.__state.h)&&(n.__state.h=0):n.__state.h=t.h},er.COMPONENTS=["r","g","b","h","s","v","hex","a"],A_(er.prototype,"r",2),A_(er.prototype,"g",1),A_(er.prototype,"b",0),R_(er.prototype,"h"),R_(er.prototype,"s"),R_(er.prototype,"v"),Object.defineProperty(er.prototype,"a",{get:function(){return this.__state.a},set:function(n){this.__state.a=n}}),Object.defineProperty(er.prototype,"hex",{get:function(){return this.__state.space!=="HEX"&&(this.__state.hex=wg.rgb_to_hex(this.r,this.g,this.b),this.__state.space="HEX"),this.__state.hex},set:function(n){this.__state.space="HEX",this.__state.hex=n}});var ku=function(){function n(t,e){rs(this,n),this.initialValue=t[e],this.domElement=document.createElement("div"),this.object=t,this.property=e,this.__onChange=void 0,this.__onFinishChange=void 0}return os(n,[{key:"onChange",value:function(t){return this.__onChange=t,this}},{key:"onFinishChange",value:function(t){return this.__onFinishChange=t,this}},{key:"setValue",value:function(t){return this.object[this.property]=t,this.__onChange&&this.__onChange.call(this,t),this.updateDisplay(),this}},{key:"getValue",value:function(){return this.object[this.property]}},{key:"updateDisplay",value:function(){return this}},{key:"isModified",value:function(){return this.initialValue!==this.getValue()}}]),n}(),SS={};oe.each({HTMLEvents:["change"],MouseEvents:["click","mousemove","mousedown","mouseup","mouseover"],KeyboardEvents:["keydown"]},function(n,t){oe.each(n,function(e){SS[e]=t})});var RI=/(\d+(\.\d+)?)px/;function ks(n){if(n==="0"||oe.isUndefined(n))return 0;var t=n.match(RI);return oe.isNull(t)?0:parseFloat(t[1])}var Gt={makeSelectable:function(n,t){n!==void 0&&n.style!==void 0&&(n.onselectstart=t?function(){return!1}:function(){},n.style.MozUserSelect=t?"auto":"none",n.style.KhtmlUserSelect=t?"auto":"none",n.unselectable=t?"on":"off")},makeFullscreen:function(n,t,e){var i=e,r=t;oe.isUndefined(r)&&(r=!0),oe.isUndefined(i)&&(i=!0),n.style.position="absolute",r&&(n.style.left=0,n.style.right=0),i&&(n.style.top=0,n.style.bottom=0)},fakeEvent:function(n,t,e,i){var r=e||{},o=SS[t];if(!o)throw new Error("Event type "+t+" not supported.");var s=document.createEvent(o);switch(o){case"MouseEvents":var a=r.x||r.clientX||0,l=r.y||r.clientY||0;s.initMouseEvent(t,r.bubbles||!1,r.cancelable||!0,window,r.clickCount||1,0,0,a,l,!1,!1,!1,!1,0,null);break;case"KeyboardEvents":var u=s.initKeyboardEvent||s.initKeyEvent;oe.defaults(r,{cancelable:!0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,keyCode:void 0,charCode:void 0}),u(t,r.bubbles||!1,r.cancelable,window,r.ctrlKey,r.altKey,r.shiftKey,r.metaKey,r.keyCode,r.charCode);break;default:s.initEvent(t,r.bubbles||!1,r.cancelable||!0)}oe.defaults(s,i),n.dispatchEvent(s)},bind:function(n,t,e,i){var r=i||!1;return n.addEventListener?n.addEventListener(t,e,r):n.attachEvent&&n.attachEvent("on"+t,e),Gt},unbind:function(n,t,e,i){var r=i||!1;return n.removeEventListener?n.removeEventListener(t,e,r):n.detachEvent&&n.detachEvent("on"+t,e),Gt},addClass:function(n,t){if(n.className===void 0)n.className=t;else if(n.className!==t){var e=n.className.split(/ +/);e.indexOf(t)===-1&&(e.push(t),n.className=e.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}return Gt},removeClass:function(n,t){if(t)if(n.className===t)n.removeAttribute("class");else{var e=n.className.split(/ +/),i=e.indexOf(t);i!==-1&&(e.splice(i,1),n.className=e.join(" "))}else n.className=void 0;return Gt},hasClass:function(n,t){return new RegExp("(?:^|\\s+)"+t+"(?:\\s+|$)").test(n.className)||!1},getWidth:function(n){var t=getComputedStyle(n);return ks(t["border-left-width"])+ks(t["border-right-width"])+ks(t["padding-left"])+ks(t["padding-right"])+ks(t.width)},getHeight:function(n){var t=getComputedStyle(n);return ks(t["border-top-width"])+ks(t["border-bottom-width"])+ks(t["padding-top"])+ks(t["padding-bottom"])+ks(t.height)},getOffset:function(n){var t=n,e={left:0,top:0};if(t.offsetParent)do e.left+=t.offsetLeft,e.top+=t.offsetTop,t=t.offsetParent;while(t);return e},isActive:function(n){return n===document.activeElement&&(n.type||n.href)}},TS=function(n){function t(e,i){rs(this,t);var r=Sl(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i)),o=r;return r.__prev=r.getValue(),r.__checkbox=document.createElement("input"),r.__checkbox.setAttribute("type","checkbox"),Gt.bind(r.__checkbox,"change",function(){o.setValue(!o.__prev)},!1),r.domElement.appendChild(r.__checkbox),r.updateDisplay(),r}return wl(t,n),os(t,[{key:"setValue",value:function(e){var i=bl(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setValue",this).call(this,e);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),this.__prev=this.getValue(),i}},{key:"updateDisplay",value:function(){return this.getValue()===!0?(this.__checkbox.setAttribute("checked","checked"),this.__checkbox.checked=!0,this.__prev=!0):(this.__checkbox.checked=!1,this.__prev=!1),bl(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(ku),CI=function(n){function t(e,i,r){rs(this,t);var o=Sl(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i)),s=r,a=o;if(o.__select=document.createElement("select"),oe.isArray(s)){var l={};oe.each(s,function(u){l[u]=u}),s=l}return oe.each(s,function(u,h){var d=document.createElement("option");d.innerHTML=h,d.setAttribute("value",u),a.__select.appendChild(d)}),o.updateDisplay(),Gt.bind(o.__select,"change",function(){var u=this.options[this.selectedIndex].value;a.setValue(u)}),o.domElement.appendChild(o.__select),o}return wl(t,n),os(t,[{key:"setValue",value:function(e){var i=bl(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setValue",this).call(this,e);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),i}},{key:"updateDisplay",value:function(){return Gt.isActive(this.__select)?this:(this.__select.value=this.getValue(),bl(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this))}}]),t}(ku),PI=function(n){function t(e,i){rs(this,t);var r=Sl(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i)),o=r;function s(){o.setValue(o.__input.value)}return r.__input=document.createElement("input"),r.__input.setAttribute("type","text"),Gt.bind(r.__input,"keyup",s),Gt.bind(r.__input,"change",s),Gt.bind(r.__input,"blur",function(){o.__onFinishChange&&o.__onFinishChange.call(o,o.getValue())}),Gt.bind(r.__input,"keydown",function(a){a.keyCode===13&&this.blur()}),r.updateDisplay(),r.domElement.appendChild(r.__input),r}return wl(t,n),os(t,[{key:"updateDisplay",value:function(){return Gt.isActive(this.__input)||(this.__input.value=this.getValue()),bl(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(ku);function ES(n){var t=n.toString();return t.indexOf(".")>-1?t.length-t.indexOf(".")-1:0}var MS=function(n){function t(e,i,r){rs(this,t);var o=Sl(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i)),s=r||{};return o.__min=s.min,o.__max=s.max,o.__step=s.step,oe.isUndefined(o.__step)?o.initialValue===0?o.__impliedStep=1:o.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(o.initialValue))/Math.LN10))/10:o.__impliedStep=o.__step,o.__precision=ES(o.__impliedStep),o}return wl(t,n),os(t,[{key:"setValue",value:function(e){var i=e;return this.__min!==void 0&&i<this.__min?i=this.__min:this.__max!==void 0&&i>this.__max&&(i=this.__max),this.__step!==void 0&&i%this.__step!=0&&(i=Math.round(i/this.__step)*this.__step),bl(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setValue",this).call(this,i)}},{key:"min",value:function(e){return this.__min=e,this}},{key:"max",value:function(e){return this.__max=e,this}},{key:"step",value:function(e){return this.__step=e,this.__impliedStep=e,this.__precision=ES(e),this}}]),t}(ku),Sg=function(n){function t(e,i,r){rs(this,t);var o=Sl(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i,r));o.__truncationSuspended=!1;var s=o,a=void 0;function l(){s.__onFinishChange&&s.__onFinishChange.call(s,s.getValue())}function u(d){var p=a-d.clientY;s.setValue(s.getValue()+p*s.__impliedStep),a=d.clientY}function h(){Gt.unbind(window,"mousemove",u),Gt.unbind(window,"mouseup",h),l()}return o.__input=document.createElement("input"),o.__input.setAttribute("type","text"),Gt.bind(o.__input,"change",function(){var d=parseFloat(s.__input.value);oe.isNaN(d)||s.setValue(d)}),Gt.bind(o.__input,"blur",function(){l()}),Gt.bind(o.__input,"mousedown",function(d){Gt.bind(window,"mousemove",u),Gt.bind(window,"mouseup",h),a=d.clientY}),Gt.bind(o.__input,"keydown",function(d){d.keyCode===13&&(s.__truncationSuspended=!0,this.blur(),s.__truncationSuspended=!1,l())}),o.updateDisplay(),o.domElement.appendChild(o.__input),o}return wl(t,n),os(t,[{key:"updateDisplay",value:function(){var e,i,r;return this.__input.value=this.__truncationSuspended?this.getValue():(e=this.getValue(),i=this.__precision,r=Math.pow(10,i),Math.round(e*r)/r),bl(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(MS);function AS(n,t,e,i,r){return i+(n-t)/(e-t)*(r-i)}var C_=function(n){function t(e,i,r,o,s){rs(this,t);var a=Sl(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i,{min:r,max:o,step:s})),l=a;function u(m){m.preventDefault();var g=l.__background.getBoundingClientRect();return l.setValue(AS(m.clientX,g.left,g.right,l.__min,l.__max)),!1}function h(){Gt.unbind(window,"mousemove",u),Gt.unbind(window,"mouseup",h),l.__onFinishChange&&l.__onFinishChange.call(l,l.getValue())}function d(m){var g=m.touches[0].clientX,_=l.__background.getBoundingClientRect();l.setValue(AS(g,_.left,_.right,l.__min,l.__max))}function p(){Gt.unbind(window,"touchmove",d),Gt.unbind(window,"touchend",p),l.__onFinishChange&&l.__onFinishChange.call(l,l.getValue())}return a.__background=document.createElement("div"),a.__foreground=document.createElement("div"),Gt.bind(a.__background,"mousedown",function(m){document.activeElement.blur(),Gt.bind(window,"mousemove",u),Gt.bind(window,"mouseup",h),u(m)}),Gt.bind(a.__background,"touchstart",function(m){m.touches.length===1&&(Gt.bind(window,"touchmove",d),Gt.bind(window,"touchend",p),d(m))}),Gt.addClass(a.__background,"slider"),Gt.addClass(a.__foreground,"slider-fg"),a.updateDisplay(),a.__background.appendChild(a.__foreground),a.domElement.appendChild(a.__background),a}return wl(t,n),os(t,[{key:"updateDisplay",value:function(){var e=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*e+"%",bl(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(MS),RS=function(n){function t(e,i,r){rs(this,t);var o=Sl(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i)),s=o;return o.__button=document.createElement("div"),o.__button.innerHTML=r===void 0?"Fire":r,Gt.bind(o.__button,"click",function(a){return a.preventDefault(),s.fire(),!1}),Gt.addClass(o.__button,"button"),o.domElement.appendChild(o.__button),o}return wl(t,n),os(t,[{key:"fire",value:function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}}]),t}(ku),P_=function(n){function t(e,i){rs(this,t);var r=Sl(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i));r.__color=new er(r.getValue()),r.__temp=new er(0);var o=r;r.domElement=document.createElement("div"),Gt.makeSelectable(r.domElement,!1),r.__selector=document.createElement("div"),r.__selector.className="selector",r.__saturation_field=document.createElement("div"),r.__saturation_field.className="saturation-field",r.__field_knob=document.createElement("div"),r.__field_knob.className="field-knob",r.__field_knob_border="2px solid ",r.__hue_knob=document.createElement("div"),r.__hue_knob.className="hue-knob",r.__hue_field=document.createElement("div"),r.__hue_field.className="hue-field",r.__input=document.createElement("input"),r.__input.type="text",r.__input_textShadow="0 1px 1px ",Gt.bind(r.__input,"keydown",function(y){y.keyCode===13&&p.call(this)}),Gt.bind(r.__input,"blur",p),Gt.bind(r.__selector,"mousedown",function(){Gt.addClass(this,"drag").bind(window,"mouseup",function(){Gt.removeClass(o.__selector,"drag")})}),Gt.bind(r.__selector,"touchstart",function(){Gt.addClass(this,"drag").bind(window,"touchend",function(){Gt.removeClass(o.__selector,"drag")})});var s,a=document.createElement("div");function l(y){g(y),Gt.bind(window,"mousemove",g),Gt.bind(window,"touchmove",g),Gt.bind(window,"mouseup",h),Gt.bind(window,"touchend",h)}function u(y){_(y),Gt.bind(window,"mousemove",_),Gt.bind(window,"touchmove",_),Gt.bind(window,"mouseup",d),Gt.bind(window,"touchend",d)}function h(){Gt.unbind(window,"mousemove",g),Gt.unbind(window,"touchmove",g),Gt.unbind(window,"mouseup",h),Gt.unbind(window,"touchend",h),m()}function d(){Gt.unbind(window,"mousemove",_),Gt.unbind(window,"touchmove",_),Gt.unbind(window,"mouseup",d),Gt.unbind(window,"touchend",d),m()}function p(){var y=M_(this.value);y!==!1?(o.__color.__state=y,o.setValue(o.__color.toOriginal())):this.value=o.__color.toString()}function m(){o.__onFinishChange&&o.__onFinishChange.call(o,o.__color.toOriginal())}function g(y){y.type.indexOf("touch")===-1&&y.preventDefault();var w=o.__saturation_field.getBoundingClientRect(),A=y.touches&&y.touches[0]||y,I=A.clientX,F=A.clientY,N=(I-w.left)/(w.right-w.left),U=1-(F-w.top)/(w.bottom-w.top);return U>1?U=1:U<0&&(U=0),N>1?N=1:N<0&&(N=0),o.__color.v=U,o.__color.s=N,o.setValue(o.__color.toOriginal()),!1}function _(y){y.type.indexOf("touch")===-1&&y.preventDefault();var w=o.__hue_field.getBoundingClientRect(),A=1-((y.touches&&y.touches[0]||y).clientY-w.top)/(w.bottom-w.top);return A>1?A=1:A<0&&(A=0),o.__color.h=360*A,o.setValue(o.__color.toOriginal()),!1}return oe.extend(r.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),oe.extend(r.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:r.__field_knob_border+(r.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),oe.extend(r.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),oe.extend(r.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),oe.extend(a.style,{width:"100%",height:"100%",background:"none"}),CS(a,"top","rgba(0,0,0,0)","#000"),oe.extend(r.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),(s=r.__hue_field).style.background="",s.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",s.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",s.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",s.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",s.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",oe.extend(r.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:r.__input_textShadow+"rgba(0,0,0,0.7)"}),Gt.bind(r.__saturation_field,"mousedown",l),Gt.bind(r.__saturation_field,"touchstart",l),Gt.bind(r.__field_knob,"mousedown",l),Gt.bind(r.__field_knob,"touchstart",l),Gt.bind(r.__hue_field,"mousedown",u),Gt.bind(r.__hue_field,"touchstart",u),r.__saturation_field.appendChild(a),r.__selector.appendChild(r.__field_knob),r.__selector.appendChild(r.__saturation_field),r.__selector.appendChild(r.__hue_field),r.__hue_field.appendChild(r.__hue_knob),r.domElement.appendChild(r.__input),r.domElement.appendChild(r.__selector),r.updateDisplay(),r}return wl(t,n),os(t,[{key:"updateDisplay",value:function(){var e=M_(this.getValue());if(e!==!1){var i=!1;oe.each(er.COMPONENTS,function(s){if(!oe.isUndefined(e[s])&&!oe.isUndefined(this.__color.__state[s])&&e[s]!==this.__color.__state[s])return i=!0,{}},this),i&&oe.extend(this.__color.__state,e)}oe.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var r=this.__color.v<.5||this.__color.s>.5?255:0,o=255-r;oe.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toHexString(),border:this.__field_knob_border+"rgb("+r+","+r+","+r+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,CS(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),oe.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+r+","+r+","+r+")",textShadow:this.__input_textShadow+"rgba("+o+","+o+","+o+",.7)"})}}]),t}(ku),II=["-moz-","-o-","-webkit-","-ms-",""];function CS(n,t,e,i){n.style.background="",oe.each(II,function(r){n.style.cssText+="background: "+r+"linear-gradient("+t+", "+e+" 0%, "+i+" 100%); "})}var LI=function(n,t){var e=t||document,i=document.createElement("style");i.type="text/css",i.innerHTML=n;var r=e.getElementsByTagName("head")[0];try{r.appendChild(i)}catch{}},OI=`<div id="dg-save" class="dg dialogue">
|
|
6335
6335
|
|
|
6336
6336
|
Here's the new load parameter for your <code>GUI</code>'s constructor:
|
|
6337
6337
|
|
|
@@ -6358,6 +6358,6 @@ void main(void){
|
|
|
6358
6358
|
|
|
6359
6359
|
`,(a=e.logger)===null||a===void 0||a.warn("["+o+"] "+r))},error:function(r,o){var s,a;!((s=e.logger)===null||s===void 0)&&s.error&&(t._tempLog+="ERROR - "+new Date().toISOString()+" - {"+i.randomId+"}["+o+"] "+r+`
|
|
6360
6360
|
|
|
6361
|
-
`,(a=e.logger)===null||a===void 0||a.error("["+o+"] "+r))}},i.config=e,i.syncQueue=new HI(i.receiveSyncHandler),i.mode=e.mode,i.lock=new zI(i.mode==="interactive"),i.anchor=e.anchor,i.enableGlobalClick=!Object(V.isUndefined)(e.enableGlobalClick)&&e.enableGlobalClick,i.resize=e.resize||!1,i.interactive=e.interactive,i.cacheImage.style.position="absolute",i.cacheImage.style.zIndex="100",i.frame.style.cssText=e.fixedFrameSize?"width:"+e.fixedFrameSize.width+"px;height:"+e.fixedFrameSize.height+"px;":"width:100%;height:100%",i.frame.style.cssText+="display:flex;justify-content:center;align-items:center;visibility:hidden;position:relative;z-index:1;",e.fixedFrameSize&&(i.frameWidth=e.fixedFrameSize.width,i.frameHeight=e.fixedFrameSize.height),i.setMedianControllerAttribute(),i.frame.appendChild(i.medianController),i.anchor.appendChild(i.frame),i.frameResizeObserver.observe(i.frame),i.on(qr.syncReceive,function(r){i.lock.unlock(r.type,r.uuid),i.syncQueue.addTask(r)}),i.renderingTaskManager.eventHub.on("task-error",function(r){var o=r.error,s=r.task,a=Sn.transform(o);a.errorType===ur.RuntimeWarn?i.logger.warn(a.message,i.taskId):i.logger.error(a.message,i.taskId),i.isLoading=!1,i.emit(qr.renderError,{error:a,index:s.slideIndex})}),window.addEventListener("__slide_ref__",i.handleSlideRef),i.resizeView=Object(V.debounce)(i.resizeView.bind(i),50),i.player=i.initPlayer(e),e!=null&&e.controller&&i.createController(),i.player.view&&i.frame.appendChild(i.player.view),i.handleViewClick=Object(V.debounce)(i.handleViewClick,300),i.player.errorChannel.on("error",function(r,o){var s=Sn.transform(r);s.errorType===ur.RuntimeWarn?i.logger.warn(s.message,i.taskId):i.logger.error(s.message,i.taskId),i.isLoading=!1,o===i.renderingIndex&&i.emit(qr.renderError,{error:r,index:o})}),i.logger.info("new slide",""),i}return VI(t,n),t.flushLog=function(){return lo(this,void 0,void 0,function(){return uo(this,function(e){switch(e.label){case 0:return t._tempLog.length>0?[4,Tl==null?void 0:Tl.setItem("run_time_log_"+t._tempLogIndex,t._tempLog)]:[3,2];case 1:e.sent(),t._tempLog="",t._tempLogIndex+=1,e.label=2;case 2:return[2]}})})},Object.defineProperty(t.prototype,"dispatchIncrId",{get:function(){return this._dispatchIncrId++},enumerable:!1,configurable:!0}),t.prototype.initPlayer=function(e){var i,r,o,s=this,a=new tr({mode:this.mode,useLocalCache:!!Object(V.isUndefined)(this.config.useLocalCache)||this.config.useLocalCache,logger:this.logger,resourceTimeout:Object(V.isUndefined)(this.config.resourceTimeout)?15e3:this.config.resourceTimeout,loadDelegate:this.config.loaderDelegate});return a.setInteractive(this.interactive),a.updateConfig(e.renderOptions||{}),a.on(Ne.renderStart,function(l){s.isLoading=!0,s.emit(qr.renderStart,l)}),a.on(Ne.renderEnd,function(l){s.isLoading=!1,s.player&&(s.designHeight=s.player.designHeight,s.designWidth=s.player.designWidth,s.cacheImage.style.width=s.player.designWidth+"px",s.cacheImage.style.height=s.player.designHeight+"px",s._slideCount=s.player.slideCount),s.emit(qr.renderEnd,l)}),a.on(Ne.slideChange,function(l){s.__slideState.currentSlideIndex=l,s.emitStateChange(),s.emit(qr.slideChange,l)}),a.on(Ne.mainSeqStateChange,function(l){s.__slideState.mainSeqState=l,s.emitStateChange()}),a.on(Ne.mainSeqStepChange,function(l){s.__slideState.mainSeqStep=l,s.emitStateChange()}),a.on(Ne.interactiveSeqStateChange,function(l){var u=l.id,h=l.state;s.__slideState.interactiveSeqState[u]=h,s.emitStateChange()}),a.on(Ne.animateStart,function(){s.isAnimating!==!0&&(s.isAnimating=!0,s.emit(qr.animateStart))}),a.on(Ne.animateEnd,function(){s.isAnimating!==!1&&(s.isAnimating=!1,s.emit(qr.animateEnd))}),a.on(Ne.interactiveSeqAction,function(l){var u=l.action,h=l.seqId;s.emitSyncDispatch({slideIndex:s.__slideState.currentSlideIndex,type:"interactiveAnim",action:u,seqId:h}),s.emitStateChange()}),a.on(Ne.mainSeqStepStart,function(l){s.emit(qr.mainSeqStepStart,l)}),a.on(Ne.mainSeqStepEnd,function(l){s.emit(qr.mainSeqStepEnd,l)}),a.on(Ne.mediaPlay,function(l){var u={type:"play",time:s.timestamp()-1e3*l.time};s.__slideState.mediaState[l.id]=u,s.emitSyncDispatch({slideIndex:s.__slideState.currentSlideIndex,type:"mediaPlay",id:l.id,state:u}),s.emitStateChange()}),a.on(Ne.mediaPause,function(l){var u={type:"pause",time:l.time};s.__slideState.mediaState[l.id]=u,s.emitSyncDispatch({slideIndex:s.__slideState.currentSlideIndex,type:"mediaPause",id:l.id,state:u}),s.emitStateChange()}),a.on(Ne.mediaSeek,function(l){var u={type:"pause",time:0};l.isPlaying?(u.type="play",s.__slideState.mediaState[l.id]?u.time=s.__slideState.mediaState[l.id].time-1e3*l.time:u.time=s.timestamp()-1e3*l.time,s.__slideState.mediaState[l.id]=u):(u.type="pause",u.time=l.time,s.__slideState.mediaState[l.id]=u),s.emitSyncDispatch({slideIndex:s.__slideState.currentSlideIndex,type:"mediaSeek",id:l.id,time:l.time,state:u}),s.emitStateChange()}),a.on(Ne.requestPrevSlide,function(l){s.handlePrevSlide(l)}),a.on(Ne.requestNextSlide,function(l){s.handleNextSlide(l)}),a.on(Ne.requestGotoSlide,function(l){s.config.navigatorDelegate?s.config.navigatorDelegate.gotoPage(l):s.handleGotoSlide(l)}),(i=a.view)===null||i===void 0||i.addEventListener("touchend",this.handleViewTouchEnd),(r=a.view)===null||r===void 0||r.addEventListener("touchstart",this.handleViewTouchStart),(o=a.view)===null||o===void 0||o.addEventListener("click",this.handleViewClick),a.on(Ne.userInput,this.userInputHandle),a},t.prototype.createController=function(){this.player&&(this.playerController=new GI({player:this.player,params:this.player.config||{},target: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 e=this.frame.getBoundingClientRect(),i=e.width,r=e.height;this.frameWidth=i,this.frameHeight=r,this.resizeView()}},t.prototype.updateFixedFrameSize=function(e,i,r){this.config.fixedFrameSize&&(this.frameWidth=e,this.frameHeight=i,this.frame.style.width=e+"px",this.frame.style.height=i+"px",this.resizeView(r))},t.prototype.resizeView=function(e){var i,r,o=this,s=this.width,a=this.height;if(s>0&&a>0){var l=this.frameWidth/s,u=l*a;u>this.frameHeight&&(l*=this.frameHeight/u),(i=this.player)===null||i===void 0||i.scaleView(l,this.resize,e),this.cacheImage.style.transform="scale("+l+")",this.medianController.style.transform="scale("+l+")",this.medianController.style.top=(this.frameHeight-a*l)/2+"px",this.medianController.setAttribute("data-scale",l.toString()),this.isInitResized||(this.isInitResized=!0,(r=this.player)===null||r===void 0||r.clock.setTimeout(function(){o.frame.style.visibility="visible"},32))}},t.prototype.setSlideState=function(e){var i,r,o;return lo(this,void 0,void 0,function(){var s,a=this;return uo(this,function(l){switch(l.label){case 0:return this.isSyncingSlideState=!0,this.logger.info("stateChange receive "+JSON.stringify(e),this.taskId),e.taskId&&e.taskId!==this.__slideState.taskId&&(this.__slideState.taskId=e.taskId,(i=this.player)===null||i===void 0||i.setResourceData(e.taskId,this.__slideState.url)),e.url&&e.url!==this.__slideState.url&&(this.__slideState.url=e.url,(r=this.player)===null||r===void 0||r.setResourceData(this.__slideState.taskId,e.url)),Number.isInteger(e.currentSlideIndex)&&e.currentSlideIndex!==this.__slideState.currentSlideIndex?(this.__slideState.currentSlideIndex=e.currentSlideIndex,[4,this.doRenderSlide(e.currentSlideIndex)]):[3,2];case 1:l.sent(),l.label=2;case 2:return[4,(o=this.player)===null||o===void 0?void 0:o.clock.waitUntil(function(){var u,h;return((u=a.player)===null||u===void 0?void 0:u.currentIndex)===e.currentSlideIndex&&((h=a.player)===null||h===void 0?void 0:h.currentStage)},3e3)];case 3:return l.sent(),s=!1,Number.isInteger(e.mainSeqStep)&&e.mainSeqStep!==this.__slideState.mainSeqStep&&(s=!0,this.__slideState.mainSeqStep=e.mainSeqStep),e.mainSeqState&&e.mainSeqState!==this.__slideState.mainSeqState&&(s=!0,this.__slideState.mainSeqState=e.mainSeqState),s&&this.setMainSeqStep(this.__slideState.mainSeqStep,this.__slideState.mainSeqState==="idle"?"start":"end"),e.mediaState&&(this.initMedia(e),this.__slideState.mediaState=e.mediaState),e.interactiveSeqState&&(this.initInteractiveSeq(e),this.__slideState.interactiveSeqState=e.interactiveSeqState),this.isSyncingSlideState=!1,[2]}})})},t.prototype.initInteractiveSeq=function(e){var i;for(var r in e.interactiveSeqState){var o=e.interactiveSeqState[r];(i=this.player)===null||i===void 0||i.setInteractiveSeqState(r,o.step,o.state==="end"?"end":"start")}},t.prototype.initMedia=function(e){var i,r,o=this,s=function(u){var h=e.mediaState[u],d=a.__slideState.mediaState[u];if(d&&h.type===d.type&&h.time===d.time)return"continue";h.type==="play"?(i=a.player)===null||i===void 0||i.setMediaState(u,!0).then(function(){var p,m=o.timestamp();(p=o.player)===null||p===void 0||p.setMediaCurrentTime(u,(m-h.time)/1e3)}):(r=a.player)===null||r===void 0||r.setMediaState(u,!1).then(function(){var p;(p=o.player)===null||p===void 0||p.setMediaCurrentTime(u,h.time)})},a=this;for(var l in e.mediaState)s(l)},Object.defineProperty(t.prototype,"slideCount",{get:function(){return this._slideCount},enumerable:!1,configurable:!0}),t.prototype.getSizeAsync=function(){return lo(this,void 0,void 0,function(){var e;return uo(this,function(i){switch(i.label){case 0:if(this.width>0&&this.height>0)return[2,[this.width,this.height]];i.label=1;case 1:return i.trys.push([1,4,,5]),[4,fetch(this.__slideState.url+"/"+this.__slideState.taskId+"/jsonOutput/slide-1.json")];case 2:return[4,i.sent().json()];case 3:return[2,[(e=i.sent()).width,e.height]];case 4:return i.sent(),[2,[0,0]];case 5:return[2]}})})},t.prototype.getSlideCountAsync=function(){return lo(this,void 0,void 0,function(){return uo(this,function(e){switch(e.label){case 0:if(this._slideCount>0)return[2,this._slideCount];e.label=1;case 1:return e.trys.push([1,4,,5]),[4,fetch(this.__slideState.url+"/"+this.__slideState.taskId+"/jsonOutput/slide-1.json")];case 2:return[4,e.sent().json()];case 3:return[2,e.sent().slideCount];case 4:return e.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 e;return((e=this.player)===null||e===void 0?void 0:e.mainSeqLength())||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mainSeqStep",{get:function(){var e;return((e=this.player)===null||e===void 0?void 0:e.mainSeqStep())||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mainSeqState",{get:function(){var e;return((e=this.player)===null||e===void 0?void 0:e.mainSeqState())||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderOptions",{get:function(){var e;return((e=this.player)===null||e===void 0?void 0:e.config)||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"drawCall",{get:function(){var e;return((e=this.player)===null||e===void 0?void 0:e.runtime.drawCall)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderFps",{get:function(){var e;return((e=this.player)===null||e===void 0?void 0:e.runtime.fps)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"runtimeFps",{get:function(){var e;return((e=this.player)===null||e===void 0?void 0:e.fps.value)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"view",{get:function(){var e;return((e=this.player)===null||e===void 0?void 0:e.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(e){this.player&&(this.player.updateConfig(e),this.renderOptions&&(this.config.renderOptions=this.renderOptions))},t.prototype.setResource=function(e,i){var r;this.taskId=e,(r=this.player)===null||r===void 0||r.setResourceData(e,i),this.__slideState.taskId=e,this.__slideState.url=i,this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"setResource",taskId:e,url:i})},t.prototype._renderSlide=function(e){var i;return lo(this,void 0,void 0,function(){var r=this;return uo(this,function(o){switch(o.label){case 0:return this.renderingIndex=e,this.player&&e===this.player.currentIndex?[2]:((tr.platform.isIOS()||tr.platform.isAndroid())&&this.iosResetCache.indexOf(e)<0&&this.iosResetCache.push(e),[4,(i=this.player)===null||i===void 0?void 0:i.renderSlide(e)]);case 1:return o.sent(),this.__slideState.currentSlideIndex=e,this.resizeView(),this.__slideState.interactiveSeqState={},this.emitStateChange(),setTimeout(function(){var s,a;if(((a=(s=r.player)===null||s===void 0?void 0:s.view)===null||a===void 0?void 0:a.style.visibility)==="hidden"&&(r.player.view.style.visibility="visible"),r.frame.style.visibility==="hidden"&&(r.frame.style.visibility="visible"),r.needClearCacheImage)try{r.frame.removeChild(r.cacheImage)}catch{}},100),[2]}})})},t.prototype.renderSlide=function(e,i){if(i===void 0&&(i=!0),this.player){var r=Number(e);(r!==this.player.currentIndex||this.renderingTaskManager.hasStartTask())&&(r>this.slideCount&&this.slideCount>0||this.poseRenderSlide(r,i))}},t.prototype.needCreateNewPlayer=function(){var e=tr.platform.isLowGpuMemory()?15:30;return(tr.platform.isIOS()||tr.platform.isAndroid())&&this.iosResetCache.length>e},t.prototype.poseRenderSlide=function(e,i){this.mode==="interactive"?this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"renderSlide",index:e,isForward:i}):this.mode==="sync"?(this.doRenderSlide(e,i),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"renderSlide",index:e,isForward:i})):this.doRenderSlide(e,i)},t.prototype.doRenderSlide=function(e,i){var r,o,s,a=this;if(i===void 0&&(i=!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 l=this.player.getSnapshot();this.cacheImage.src=l,this.frame.appendChild(this.cacheImage),this.player.destroy(),(r=this.playerController)===null||r===void 0||r.destroy(),this.player=this.iosNewPlayer,this.iosNewPlayer=void 0,!((o=this.config)===null||o===void 0)&&o.controller&&this.createController(),this.needClearCacheImage=!0,!((s=this==null?void 0:this.player)===null||s===void 0)&&s.view&&(this.player.view.style.visibility="hidden",this.frame.appendChild(this.player.view))}var u=Math.random().toString(32).substr(2);return this.player.isForward=i,this.renderingTaskManager.addTask(function(){return a._renderSlide(e)},e,u),new Promise(function(h){a.renderingTaskManager.eventHub.once("task-end-"+u,h)})},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(e){if(e===void 0&&(e=!1),this.player){this.player.nextStep(e);var i=this.player.mainSeqStep();this.__slideState.mainSeqStep=i,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(e){if(e===void 0&&(e=!1),this.player){this.player.prevStep(e);var i=this.player.mainSeqStep();this.__slideState.mainSeqStep=i,this.emitStateChange()}},t.prototype.isSlideStateReady=function(e){return e.taskId.length>0&&e.url.length>0&&e.currentSlideIndex>0},t.prototype.emitStateChange=function(){if(this.mode!=="local"&&!this.isSyncingSlideState){var e=this.slideState;!Object(V.isEqual)(this.lastEmitedState,e)&&this.isSlideStateReady(e)&&(this.lastEmitedState=e,this.emit(qr.stateChange,e),this.logger.info("stateChange dispatch "+JSON.stringify(this.slideState),this.taskId))}},t.prototype.emitSyncDispatch=function(e){if(!this.lock.isLocked(e.type)){var i=Math.random().toString(32).substr(2);this.lock.addLock(e.type,i);var r=Ap(Ap({},e),{uuid:i});this.config.mode==="sync"&&(r.incrId=this.dispatchIncrId),this.emit(qr.syncDispatch,r),this.logger.info("sync dispatch "+JSON.stringify(r),this.taskId)}},t.prototype.setMainSeqStep=function(e,i){var r;(r=this.player)===null||r===void 0||r.setMainSeqStep(e,i)},t.prototype.setInteractive=function(e){var i;this.interactive=e,(i=this.player)===null||i===void 0||i.setInteractive(e)},t.prototype.pause=function(){var e;(e=this.player)===null||e===void 0||e.pause()},t.prototype.resume=function(){var e;(e=this.player)===null||e===void 0||e.resume()},t.prototype._doFrozen=function(){var e;return lo(this,void 0,void 0,function(){var i,r,o,s=this;return uo(this,function(a){switch(a.label){case 0:return this.view&&this.player?[4,this.player.clock.waitUntil(function(){return!s.isLoading},6e4)]:[3,2];case 1:for(r in a.sent(),i=this.player.getSnapshot()||"",this.cacheImage.src=i,this.frame.appendChild(this.cacheImage),this.player.destroy(),(e=this.playerController)===null||e===void 0||e.destroy(),this.player=void 0,this.__slideState.mediaState)o=this.__slideState.mediaState[r],this.__slideState.mediaState[r]=Ap(Ap({},o),{frozenTime:this.timestamp()});a.label=2;case 2:return[2]}})})},t.prototype.frozen=function(){var e=this;this.frozenTaskManager.addTask("frozen",function(){return e._doFrozen()})},t.prototype._doRelease=function(){var e,i;return lo(this,void 0,void 0,function(){var r,o,s,a;return uo(this,function(l){switch(l.label){case 0:if(this.player)return[2];for(o in this.player=this.initPlayer(this.config),!((e=this.config)===null||e===void 0)&&e.controller&&this.createController(),this.player.view&&(this.frame.appendChild(this.player.view),this.player.view.style.visibility="hidden"),r=this.__slideState,this.__slideState=Object(V.cloneDeep)(DS),r.mediaState)(s=r.mediaState[o]).type==="play"&&(a=Math.max((i=s.frozenTime)!==null&&i!==void 0?i:0,s.time),s.time=this.timestamp()-(a-s.time),s.frozenTime=void 0);return[4,this.setSlideState(r)];case 1:return l.sent(),[4,this.player.clock.delay(333)];case 2:l.sent(),this.player.view&&(this.player.view.style.visibility="visible");try{this.frame.removeChild(this.cacheImage)}catch{}return[2]}})})},t.prototype.release=function(){var e=this;this.frozenTaskManager.addTask("release",function(){return e._doRelease()})},t.prototype._doDestroy=function(){var e,i,r,o;this.logger.info("do destroy slide",""),this.playerController&&this.playerController.destroy(),this.frameResizeObserver.disconnect(),(e=this.player)===null||e===void 0||e.removeAllListeners(),(i=this.player)===null||i===void 0||i.destroy(),(r=this.player)===null||r===void 0||r.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),this.removeAllListeners();try{!((o=this.player)===null||o===void 0)&&o.view&&this.anchor.removeChild(this.player.view),this.anchor.removeChild(this.frame)}catch{}},t.prototype.waitLoadEnd=function(){return lo(this,void 0,void 0,function(){var e;return uo(this,function(i){switch(i.label){case 0:e=0,i.label=1;case 1:return this.isLoading&&e<10?[4,F_(100)]:[3,3];case 2:return i.sent(),e+=1,[3,1];case 3:return[2]}})})},t.prototype.destroy=function(){var e=this;this.logger.info("pre destroy slide",""),this.isLoading?this.waitLoadEnd().then(function(){e._doDestroy()}):this._doDestroy()},t.prototype.clearSlideCache=function(){var e;(e=this.player)===null||e===void 0||e.clearLocalCache()},t.prototype.hasNextStep=function(){if(!this.player)return!1;var e=this.player.currentIndex===this.slideCount,i=this.mainSeqLength===0||this.mainSeqStep>=this.mainSeqLength-1,r=this.mainSeqState==="end"||this.mainSeqState==="running"||this.mainSeqState==null;return!(e&&i&&r)},t.prototype.hasPrevStep=function(){if(!this.player)return!1;var e=this.player.currentIndex===1,i=this.mainSeqLength===0||this.mainSeqStep===0,r=this.mainSeqState==="idle"||this.mainSeqState===null;return!(e&&i&&r)},t.clearLocalCache=function(){tr.clearLocalCache()},t.disposeLocalCache=function(){},t._tempLog="",t._tempLogIndex=1,t.handleLogDownload=function(){return lo(void 0,void 0,void 0,function(){var e,i,r,o,s,a,l;return uo(this,function(u){switch(u.label){case 0:return e="",Tl?[4,Tl.keys()]:[3,5];case 1:i=(u.sent()||[]).sort(function(h,d){return parseInt(h.replace("run_time_log_",""))-parseInt(d.replace("run_time_log_",""))}),r=0,o=i,u.label=2;case 2:return r<o.length?(s=o[r],a=e,[4,Tl.getItem(s)]):[3,5];case 3:e=a+(u.sent()||""),u.label=4;case 4:return r++,[3,2];case 5:return(l=document.createElement("a")).setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(e)),l.setAttribute("download","slide_log"),l.style.display="none",document.body.appendChild(l),l.click(),document.body.removeChild(l),window.__slideLogText=e,[2]}})})},t}(C.a);Tl==null||Tl.clear(),window.addEventListener("__slide_log__",k_.handleLogDownload),window.setInterval(function(){k_.flushLog().catch(function(){})},9e3)}]);function oT(T,M,v){return Math.min(Math.max(T,M),v)}function tL(T){return typeof T=="object"&&T!==null}var sT={exports:{}},eL={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]},aT={exports:{}},iL=function(M){return!M||typeof M=="string"?!1:M instanceof Array||Array.isArray(M)||M.length>=0&&(M.splice instanceof Function||Object.getOwnPropertyDescriptor(M,M.length-1)&&M.constructor.name!=="String")},nL=iL,rL=Array.prototype.concat,oL=Array.prototype.slice,ZS=aT.exports=function(M){for(var v=[],b=0,q=M.length;b<q;b++){var ht=M[b];nL(ht)?v=rL.call(v,oL.call(ht)):v.push(ht)}return v};ZS.wrap=function(T){return function(){return T(ZS(arguments))}};var Op=eL,Fp=aT.exports,lT=Object.hasOwnProperty,uT=Object.create(null);for(var z_ in Op)lT.call(Op,z_)&&(uT[Op[z_]]=z_);var po=sT.exports={to:{},get:{}};po.get=function(T){var M=T.substring(0,3).toLowerCase(),v,b;switch(M){case"hsl":v=po.get.hsl(T),b="hsl";break;case"hwb":v=po.get.hwb(T),b="hwb";break;default:v=po.get.rgb(T),b="rgb";break}return v?{model:b,value:v}:null};po.get.rgb=function(T){if(!T)return null;var M=/^#([a-f0-9]{3,4})$/i,v=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,b=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,q=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,ht=/^(\w+)$/,W=[0,0,0,1],C,V,z;if(C=T.match(v)){for(z=C[2],C=C[1],V=0;V<3;V++){var k=V*2;W[V]=parseInt(C.slice(k,k+2),16)}z&&(W[3]=parseInt(z,16)/255)}else if(C=T.match(M)){for(C=C[1],z=C[3],V=0;V<3;V++)W[V]=parseInt(C[V]+C[V],16);z&&(W[3]=parseInt(z+z,16)/255)}else if(C=T.match(b)){for(V=0;V<3;V++)W[V]=parseInt(C[V+1],0);C[4]&&(C[5]?W[3]=parseFloat(C[4])*.01:W[3]=parseFloat(C[4]))}else if(C=T.match(q)){for(V=0;V<3;V++)W[V]=Math.round(parseFloat(C[V+1])*2.55);C[4]&&(C[5]?W[3]=parseFloat(C[4])*.01:W[3]=parseFloat(C[4]))}else return(C=T.match(ht))?C[1]==="transparent"?[0,0,0,0]:lT.call(Op,C[1])?(W=Op[C[1]],W[3]=1,W):null:null;for(V=0;V<3;V++)W[V]=El(W[V],0,255);return W[3]=El(W[3],0,1),W};po.get.hsl=function(T){if(!T)return null;var M=/^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*)?\)$/,v=T.match(M);if(v){var b=parseFloat(v[4]),q=(parseFloat(v[1])%360+360)%360,ht=El(parseFloat(v[2]),0,100),W=El(parseFloat(v[3]),0,100),C=El(isNaN(b)?1:b,0,1);return[q,ht,W,C]}return null};po.get.hwb=function(T){if(!T)return null;var M=/^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*)?\)$/,v=T.match(M);if(v){var b=parseFloat(v[4]),q=(parseFloat(v[1])%360+360)%360,ht=El(parseFloat(v[2]),0,100),W=El(parseFloat(v[3]),0,100),C=El(isNaN(b)?1:b,0,1);return[q,ht,W,C]}return null};po.to.hex=function(){var T=Fp(arguments);return"#"+Ag(T[0])+Ag(T[1])+Ag(T[2])+(T[3]<1?Ag(Math.round(T[3]*255)):"")};po.to.rgb=function(){var T=Fp(arguments);return T.length<4||T[3]===1?"rgb("+Math.round(T[0])+", "+Math.round(T[1])+", "+Math.round(T[2])+")":"rgba("+Math.round(T[0])+", "+Math.round(T[1])+", "+Math.round(T[2])+", "+T[3]+")"};po.to.rgb.percent=function(){var T=Fp(arguments),M=Math.round(T[0]/255*100),v=Math.round(T[1]/255*100),b=Math.round(T[2]/255*100);return T.length<4||T[3]===1?"rgb("+M+"%, "+v+"%, "+b+"%)":"rgba("+M+"%, "+v+"%, "+b+"%, "+T[3]+")"};po.to.hsl=function(){var T=Fp(arguments);return T.length<4||T[3]===1?"hsl("+T[0]+", "+T[1]+"%, "+T[2]+"%)":"hsla("+T[0]+", "+T[1]+"%, "+T[2]+"%, "+T[3]+")"};po.to.hwb=function(){var T=Fp(arguments),M="";return T.length>=4&&T[3]!==1&&(M=", "+T[3]),"hwb("+T[0]+", "+T[1]+"%, "+T[2]+"%"+M+")"};po.to.keyword=function(T){return uT[T.slice(0,3)]};function El(T,M,v){return Math.min(Math.max(M,T),v)}function Ag(T){var M=Math.round(T).toString(16).toUpperCase();return M.length<2?"0"+M:M}var sL=sT.exports;class aL{constructor(M){this.enable=M,this.apps={},this.level="debug",this.roomLogger=null,this._onMessage=v=>{let b;v instanceof CustomEvent?b=v.detail:tL(v.data)&&(b=v.data),b&&(typeof b.slide=="boolean"?this.enable=b.slide:b.slide==="__instance"?console.log(this):b.slide==="__debug"&&Object.values(this.apps).forEach(q=>{var ht,W;(W=(ht=q.controller)==null?void 0:ht.slide)==null||W.createController()}))},this.initialize()}setAppContext(M,v){var b;((b=this.apps)[M]||(b[M]={})).context=v,this.log(`[Slide] new ${M}`)}setAppController(M,v){var b;((b=this.apps)[M]||(b[M]={})).controller=v}deleteApp(M){delete this.apps[M],this.log(`[Slide] delete ${M}`)}initialize(){window.addEventListener("message",this._onMessage)}dispose(){window.removeEventListener("message",this._onMessage)}log(...M){this.roomLogger?this.roomLogger.info(...M):this.enable&&console.log(...M)}verbose(...M){this.roomLogger?this.roomLogger.debug(...M):this.enable&&this.level==="verbose"&&console.log(...M)}warn(...M){this.roomLogger?this.roomLogger.warn(...M):console.warn(...M)}}const Io=new aL(!1),qn=Io.log.bind(Io),j_=Io.verbose.bind(Io),lL=T=>{Io.roomLogger=T.logger};function hT(T){try{const M=window.getComputedStyle(T).backgroundColor;if(M!=="rgba(0, 0, 0, 0)"&&M!=="transparent")return M;if(T.parentElement)return hT(T.parentElement)}catch{}return"#ffffff"}function uL(T){const M=sL.get(T);if(M&&M.model==="rgb"){const v=M.value,q=(((Math.round(v[0])&255)<<16)+((Math.round(v[1])&255)<<8)+(Math.round(v[2])&255)).toString(16);return"#"+"000000".substring(q.length)+q}else return T}let Rg="";function cT(T){return Rg||(Rg=uL(hT(T)),qn("[Slide] guess bg color",Rg)),Rg}function dT(T){const{width:M,height:v,slideCount:b,slideState:q}=T,{taskId:ht,url:W}=q,C=[];for(let V=1;V<=b;++V)C.push({width:M,height:v,thumbnail:`${W}/${ht}/preview/${V}.png`,src:"ppt"});return C}function KS(T,M,v,b){var C;const q=v.slideState.currentSlideIndex;if(!(q>0)||!M.getIsWritable())return;const ht=[b,q].join("/");if(T.scenePathType(ht)!=="page"){T.removeScenes(b);const V=v.slideCount,z=[];for(let k=1;k<=V;++k)z.push({name:`${k}`});T.putScenes(b,z)}let W;M.getBox().focus?W=T.state.sceneState.scenePath:W=((C=M.getView())==null?void 0:C.focusScenePath)||"",W!==ht&&M.setScenePath(ht)}const Y_="https://convertcdn.netless.link/dynamicConvert",hL=40,V_={taskId:"",url:"",state:null};class cL{constructor({context:M,anchor:v,onPageChanged:b,onTransitionStart:q,onTransitionEnd:ht,onError:W}){this.sideEffect=new Dp,this.ready=!1,this.readyPromise=new Promise(C=>{this.resolveReady=()=>{this.ready?qn("[Slide] render end"):setTimeout(()=>{this.ready=!0,C()},1e3)}}),this.onSyncDispatch=C=>{if(this.context.getIsWritable()&&this.room){const V={type:_n.SLIDE_EVENTS.syncDispatch,payload:C};j_("[Slide] dispatch",JSON.stringify(C)),this.context.dispatchMagixEvent(_n.SLIDE_EVENTS.syncDispatch,V)}},this.magixEventListener=C=>{const{type:V,payload:z}=C.payload;V===_n.SLIDE_EVENTS.syncDispatch&&(this.syncStateOnce(),j_("[Slide] receive",JSON.stringify(z)),this.slide.emit(_n.SLIDE_EVENTS.syncReceive,z))},this.onStateChange=C=>{this.context.getIsWritable()&&(j_("[Slide] state change",JSON.stringify(C,null,2)),this.context.storage.setState({state:C}))},this.pollCount=0,this.pollReadyState=()=>{this.ready?this._toFreeze===1?this.freeze():this._toFreeze===-1&&this.unfreeze():this.pollCount<hL?(this.pollCount++,setTimeout(this.pollReadyState,500)):(this.pollCount=0,qn("[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?(qn("[Slide] freeze",this.context.appId),this.slide.frozen()):this._toFreeze=1},this.unfreeze=async()=>{!this.visible||(this.isFrozen=!1,this.ready?(qn("[Slide] unfreeze",this.context.appId),this.slide.release()):this._toFreeze=-1)},this.onVisibilityChange=async()=>{(this.visible=document.visibilityState==="visible")?(qn("[Slide] unfreeze because tab becomes visible",{savedIsFrozen:this.savedIsFrozen}),this.savedIsFrozen||this.unfreeze()):(this.savedIsFrozen=this.isFrozen,qn("[Slide] freeze because tab becomes invisible"),this.freeze())},this.onPageChanged=b,this.onTransitionStart=q,this.onTransitionEnd=ht,this.onError=W,this.context=M,this.room=M.getRoom(),this.player=this.room?void 0:M.getDisplayer(),lL(this.room||this.player),this.slide=this.createSlide(v),this.syncStateOnceFlag=!this.context.isAddApp,this.visible=document.visibilityState==="visible",this.savedIsFrozen=!1,this.initialize()}jumpToPage(M){this.ready&&(M=oT(M,1,this.pageCount),this.slide.renderSlide(M))}initialize(){this.registerEventListeners(),this.kickStart()}kickStart(){const{context:M,slide:v}=this;M.getIsWritable()&&M.storage.ensureState(V_);const{taskId:b,url:q,state:ht}=M.storage.state;v.setResource(b,q||Y_),ht?(qn("[Slide] init with state",JSON.stringify(ht)),this.syncStateOnceFlag=!1,v.setSlideState(ht)):M.isAddApp&&(qn("[Slide] init by renderSlide",1),v.renderSlide(1)),this.pollReadyState()}registerEventListeners(){const{context:M,slide:v}=this,b=this.sideEffect.addDisposer(M.storage.addStateChangedListener(()=>{M.storage.state.state&&(this.syncStateOnce(),this.sideEffect.flush(b))}));this.sideEffect.add(()=>M.addMagixEventListener(_n.SLIDE_EVENTS.syncDispatch,this.magixEventListener,{fireSelfEventAfterCommit:!0})),v.on(_n.SLIDE_EVENTS.slideChange,this.onPageChanged),v.on(_n.SLIDE_EVENTS.renderStart,this.onTransitionStart),v.on(_n.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),v.on(_n.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),v.on(_n.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),v.on(_n.SLIDE_EVENTS.renderError,this.onError),v.on(_n.SLIDE_EVENTS.stateChange,this.onStateChange),v.on(_n.SLIDE_EVENTS.syncDispatch,this.onSyncDispatch),v.on(_n.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(V_);const{state:M}=this.context.storage.state;M&&(qn("[Slide] sync with state (once)",JSON.stringify(M)),this.slide.setSlideState(M),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(M){var b,q,ht,W,C,V,z,k;return new _n.Slide({anchor:M,interactive:!0,mode:"interactive",resize:!0,controller:Io.enable,enableGlobalClick:!0,renderOptions:{minFPS:((b=this.context.getAppOptions())==null?void 0:b.minFPS)||25,maxFPS:((q=this.context.getAppOptions())==null?void 0:q.maxFPS)||30,autoFPS:(W=(ht=this.context.getAppOptions())==null?void 0:ht.autoFPS)!=null?W:!0,autoResolution:(V=(C=this.context.getAppOptions())==null?void 0:C.autoResolution)!=null?V:!0,resolution:(z=this.context.getAppOptions())==null?void 0:z.resolution,transactionBgColor:((k=this.context.getAppOptions())==null?void 0:k.bgColor)||cT(M)},timestamp:this.timestamp})}destroy(){this.sideEffect.flushAll(),this.destroyed||(qn("[Slide] destroy slide (once)"),this.slide.destroy(),this.destroyed=!0)}}function dL(T){const M="http://www.w3.org/2000/svg",v=document.createElementNS(M,"svg");v.setAttribute("class",`${T}-footer-icon-sidebar`),v.setAttribute("viewBox","0 0 64 64");const b=document.createElementNS(M,"path");return b.setAttribute("fill","currentColor"),b.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"),v.appendChild(b),v}function pL(T){const M="http://www.w3.org/2000/svg",v=document.createElementNS(M,"svg");v.setAttribute("class",`${T}-footer-icon-arrow-left`),v.setAttribute("viewBox","0 0 500 500");const b=document.createElementNS(M,"path");return b.setAttribute("fill","currentColor"),b.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"),v.appendChild(b),v}function fL(T){const M="http://www.w3.org/2000/svg",v=document.createElementNS(M,"svg");v.setAttribute("class",`${T}-footer-icon-arrow-right`),v.setAttribute("viewBox","0 0 500 500");const b=document.createElementNS(M,"path");return b.setAttribute("fill","currentColor"),b.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"),v.appendChild(b),v}function mL(T){const M="http://www.w3.org/2000/svg",v=document.createElementNS(M,"svg");v.setAttribute("class",`${T}-footer-icon-play`),v.setAttribute("viewBox","0 0 500 500");const b=document.createElementNS(M,"path");return b.setAttribute("fill","currentColor"),b.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"),v.appendChild(b),v}function gL(T){const M="http://www.w3.org/2000/svg",v=document.createElementNS(M,"svg");v.setAttribute("class",`${T}-footer-icon-pause`),v.setAttribute("viewBox","0 0 500 500");const b=document.createElementNS(M,"path");return b.setAttribute("fill","currentColor"),b.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"),v.appendChild(b),v}const Al=typeof window!="undefined",pT=Al&&!("onscroll"in window)||typeof navigator!="undefined"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),fT=Al&&"IntersectionObserver"in window,mT=Al&&"classList"in document.createElement("p"),gT=Al&&window.devicePixelRatio>1,vL={elements_selector:".lazy",container:pT||Al?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},vT=T=>Object.assign({},vL,T),QS=function(T,M){let v;const b="LazyLoad::Initialized",q=new T(M);try{v=new CustomEvent(b,{detail:{instance:q}})}catch{v=document.createEvent("CustomEvent"),v.initCustomEvent(b,!1,!1,{instance:q})}window.dispatchEvent(v)},_L=(T,M)=>{if(!!M)if(!M.length)QS(T,M);else for(let v=0,b;b=M[v];v+=1)QS(T,b)},Ia="src",$_="srcset",J_="sizes",_T="poster",Bp="llOriginalAttrs",yT="data",Z_="loading",xT="loaded",bT="applied",yL="entered",K_="error",wT="native",ST="data-",TT="ll-status",Jr=(T,M)=>T.getAttribute(ST+M),xL=(T,M,v)=>{var b=ST+M;if(v===null){T.removeAttribute(b);return}T.setAttribute(b,v)},kp=T=>Jr(T,TT),Hu=(T,M)=>xL(T,TT,M),Ig=T=>Hu(T,null),Q_=T=>kp(T)===null,bL=T=>kp(T)===Z_,wL=T=>kp(T)===K_,ty=T=>kp(T)===wT,SL=[Z_,xT,bT,K_],TL=T=>SL.indexOf(kp(T))>=0,Rl=(T,M,v,b)=>{if(!!T){if(b!==void 0){T(M,v,b);return}if(v!==void 0){T(M,v);return}T(M)}},Dc=(T,M)=>{if(mT){T.classList.add(M);return}T.className+=(T.className?" ":"")+M},Gs=(T,M)=>{if(mT){T.classList.remove(M);return}T.className=T.className.replace(new RegExp("(^|\\s+)"+M+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},EL=T=>{T.llTempImage=document.createElement("IMG")},ML=T=>{delete T.llTempImage},ET=T=>T.llTempImage,Lg=(T,M)=>{if(!M)return;const v=M._observer;!v||v.unobserve(T)},AL=T=>{T.disconnect()},RL=(T,M,v)=>{M.unobserve_entered&&Lg(T,v)},ey=(T,M)=>{!T||(T.loadingCount+=M)},CL=T=>{!T||(T.toLoadCount-=1)},MT=(T,M)=>{!T||(T.toLoadCount=M)},PL=T=>T.loadingCount>0,IL=T=>T.toLoadCount>0,AT=T=>{let M=[];for(let v=0,b;b=T.children[v];v+=1)b.tagName==="SOURCE"&&M.push(b);return M},iy=(T,M)=>{const v=T.parentNode;if(!v||v.tagName!=="PICTURE")return;AT(v).forEach(M)},RT=(T,M)=>{AT(T).forEach(M)},Og=[Ia],CT=[Ia,_T],Np=[Ia,$_,J_],PT=[yT],Ng=T=>!!T[Bp],IT=T=>T[Bp],LT=T=>delete T[Bp],Nc=(T,M)=>{if(Ng(T))return;const v={};M.forEach(b=>{v[b]=T.getAttribute(b)}),T[Bp]=v},LL=T=>{Ng(T)||(T[Bp]={backgroundImage:T.style.backgroundImage})},OL=(T,M,v)=>{if(!v){T.removeAttribute(M);return}T.setAttribute(M,v)},Gu=(T,M)=>{if(!Ng(T))return;const v=IT(T);M.forEach(b=>{OL(T,b,v[b])})},NL=T=>{if(!Ng(T))return;const M=IT(T);T.style.backgroundImage=M.backgroundImage},OT=(T,M,v)=>{Dc(T,M.class_applied),Hu(T,bT),v&&(M.unobserve_completed&&Lg(T,M),Rl(M.callback_applied,T,v))},NT=(T,M,v)=>{Dc(T,M.class_loading),Hu(T,Z_),v&&(ey(v,1),Rl(M.callback_loading,T,v))},Ml=(T,M,v)=>{!v||T.setAttribute(M,v)},tT=(T,M)=>{Ml(T,J_,Jr(T,M.data_sizes)),Ml(T,$_,Jr(T,M.data_srcset)),Ml(T,Ia,Jr(T,M.data_src))},DL=(T,M)=>{iy(T,v=>{Nc(v,Np),tT(v,M)}),Nc(T,Np),tT(T,M)},FL=(T,M)=>{Nc(T,Og),Ml(T,Ia,Jr(T,M.data_src))},BL=(T,M)=>{RT(T,v=>{Nc(v,Og),Ml(v,Ia,Jr(v,M.data_src))}),Nc(T,CT),Ml(T,_T,Jr(T,M.data_poster)),Ml(T,Ia,Jr(T,M.data_src)),T.load()},kL=(T,M)=>{Nc(T,PT),Ml(T,yT,Jr(T,M.data_src))},UL=(T,M,v)=>{const b=Jr(T,M.data_bg),q=Jr(T,M.data_bg_hidpi),ht=gT&&q?q:b;!ht||(T.style.backgroundImage=`url("${ht}")`,ET(T).setAttribute(Ia,ht),NT(T,M,v))},GL=(T,M,v)=>{const b=Jr(T,M.data_bg_multi),q=Jr(T,M.data_bg_multi_hidpi),ht=gT&&q?q:b;!ht||(T.style.backgroundImage=ht,OT(T,M,v))},HL=(T,M,v)=>{const b=Jr(T,M.data_bg_set);if(!b)return;const q=b.split("|");let ht=q.map(W=>`image-set(${W})`);T.style.backgroundImage=ht.join(),T.style.backgroundImage===""&&(ht=q.map(W=>`-webkit-image-set(${W})`),T.style.backgroundImage=ht.join()),OT(T,M,v)},DT={IMG:DL,IFRAME:FL,VIDEO:BL,OBJECT:kL},zL=(T,M)=>{const v=DT[T.tagName];!v||v(T,M)},jL=(T,M,v)=>{const b=DT[T.tagName];!b||(b(T,M),NT(T,M,v))},VL=["IMG","IFRAME","VIDEO","OBJECT"],WL=T=>VL.indexOf(T.tagName)>-1,FT=(T,M)=>{M&&!PL(M)&&!IL(M)&&Rl(T.callback_finish,M)},eT=(T,M,v)=>{T.addEventListener(M,v),T.llEvLisnrs[M]=v},XL=(T,M,v)=>{T.removeEventListener(M,v)},ny=T=>!!T.llEvLisnrs,qL=(T,M,v)=>{ny(T)||(T.llEvLisnrs={});const b=T.tagName==="VIDEO"?"loadeddata":"load";eT(T,b,M),eT(T,"error",v)},W_=T=>{if(!ny(T))return;const M=T.llEvLisnrs;for(let v in M){const b=M[v];XL(T,v,b)}delete T.llEvLisnrs},BT=(T,M,v)=>{ML(T),ey(v,-1),CL(v),Gs(T,M.class_loading),M.unobserve_completed&&Lg(T,v)},YL=(T,M,v,b)=>{const q=ty(M);BT(M,v,b),Dc(M,v.class_loaded),Hu(M,xT),Rl(v.callback_loaded,M,b),q||FT(v,b)},$L=(T,M,v,b)=>{const q=ty(M);BT(M,v,b),Dc(M,v.class_error),Hu(M,K_),Rl(v.callback_error,M,b),v.restore_on_error&&Gu(M,Np),q||FT(v,b)},ry=(T,M,v)=>{const b=ET(T)||T;if(ny(b))return;qL(b,W=>{YL(W,T,M,v),W_(b)},W=>{$L(W,T,M,v),W_(b)})},JL=(T,M,v)=>{EL(T),ry(T,M,v),LL(T),UL(T,M,v),GL(T,M,v),HL(T,M,v)},ZL=(T,M,v)=>{ry(T,M,v),jL(T,M,v)},oy=(T,M,v)=>{WL(T)?ZL(T,M,v):JL(T,M,v)},KL=(T,M,v)=>{T.setAttribute("loading","lazy"),ry(T,M,v),zL(T,M),Hu(T,wT)},iT=T=>{T.removeAttribute(Ia),T.removeAttribute($_),T.removeAttribute(J_)},QL=T=>{iy(T,M=>{iT(M)}),iT(T)},kT=T=>{iy(T,M=>{Gu(M,Np)}),Gu(T,Np)},tO=T=>{RT(T,M=>{Gu(M,Og)}),Gu(T,CT),T.load()},eO=T=>{Gu(T,Og)},iO=T=>{Gu(T,PT)},nO={IMG:kT,IFRAME:eO,VIDEO:tO,OBJECT:iO},rO=T=>{const M=nO[T.tagName];if(!M){NL(T);return}M(T)},oO=(T,M)=>{Q_(T)||ty(T)||(Gs(T,M.class_entered),Gs(T,M.class_exited),Gs(T,M.class_applied),Gs(T,M.class_loading),Gs(T,M.class_loaded),Gs(T,M.class_error))},sO=(T,M)=>{rO(T),oO(T,M),Ig(T),LT(T)},aO=(T,M,v,b)=>{!v.cancel_on_exit||!bL(T)||T.tagName==="IMG"&&(W_(T),QL(T),kT(T),Gs(T,v.class_loading),ey(b,-1),Ig(T),Rl(v.callback_cancel,T,M,b))},lO=(T,M,v,b)=>{const q=TL(T);Hu(T,yL),Dc(T,v.class_entered),Gs(T,v.class_exited),RL(T,v,b),Rl(v.callback_enter,T,M,b),!q&&oy(T,v,b)},uO=(T,M,v,b)=>{Q_(T)||(Dc(T,v.class_exited),aO(T,M,v,b),Rl(v.callback_exit,T,M,b))},hO=["IMG","IFRAME","VIDEO"],UT=T=>T.use_native&&"loading"in HTMLImageElement.prototype,cO=(T,M,v)=>{T.forEach(b=>{hO.indexOf(b.tagName)!==-1&&KL(b,M,v)}),MT(v,0)},dO=T=>T.isIntersecting||T.intersectionRatio>0,pO=T=>({root:T.container===document?null:T.container,rootMargin:T.thresholds||T.threshold+"px"}),fO=(T,M,v)=>{T.forEach(b=>dO(b)?lO(b.target,b,M,v):uO(b.target,b,M,v))},mO=(T,M)=>{M.forEach(v=>{T.observe(v)})},gO=(T,M)=>{AL(T),mO(T,M)},vO=(T,M)=>{!fT||UT(T)||(M._observer=new IntersectionObserver(v=>{fO(v,T,M)},pO(T)))},GT=T=>Array.prototype.slice.call(T),Cg=T=>T.container.querySelectorAll(T.elements_selector),_O=T=>GT(T).filter(Q_),yO=T=>wL(T),xO=T=>GT(T).filter(yO),nT=(T,M)=>_O(T||Cg(M)),bO=(T,M)=>{xO(Cg(T)).forEach(b=>{Gs(b,T.class_error),Ig(b)}),M.update()},wO=(T,M)=>{!Al||(M._onlineHandler=()=>{bO(T,M)},window.addEventListener("online",M._onlineHandler))},SO=T=>{!Al||window.removeEventListener("online",T._onlineHandler)},Up=function(T,M){const v=vT(T);this._settings=v,this.loadingCount=0,vO(v,this),wO(v,this),this.update(M)};Up.prototype={update:function(T){const M=this._settings,v=nT(T,M);if(MT(this,v.length),pT||!fT){this.loadAll(v);return}if(UT(M)){cO(v,M,this);return}gO(this._observer,v)},destroy:function(){this._observer&&this._observer.disconnect(),SO(this),Cg(this._settings).forEach(T=>{LT(T)}),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(T){const M=this._settings;nT(T,M).forEach(b=>{Lg(b,this),oy(b,M,this)})},restoreAll:function(){const T=this._settings;Cg(T).forEach(M=>{sO(M,T)})}};Up.load=(T,M)=>{const v=vT(M);oy(T,v)};Up.resetStatus=T=>{Ig(T)};Al&&_L(Up,window.lazyLoadOptions);class HT{constructor({readonly:M,onNewPageIndex:v,onPlay:b}){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 Dp,this.readonly=M,this.onNewPageIndex=v,this.onPlay=b,this.render()}set pages(M){this._pages=M,this.refreshPreview(),this.refreshTotalPage(),this.refreshBtnSidebar()}get pages(){return this._pages}unmount(){this.$content.remove(),this.$footer.remove()}setReadonly(M){this.readonly=M,this.$content.classList.toggle(this.wrapClassName("readonly"),M),this.$footer.classList.toggle(this.wrapClassName("readonly"),M),this.$pageNumberInput.disabled=M}destroy(){this.sideEffect.flushAll(),this.unmount()}setPageIndex(M){Number.isNaN(M)||(this.pageIndex=M,this.$pageNumberInput.value=String(M+1))}refreshTotalPage(){this.pages.length?this.$totalPage.textContent=" / "+this.pages.length:this.$totalPage.textContent=""}setSmallBox(M){this.isSmallBox!==M&&(this.isSmallBox=M,this.$footer.classList.toggle(this.wrapClassName("float-footer"),M))}render(){return this.renderContent(),this.renderFooter(),this.$content}renderContent(){if(!this.$content){const M=document.createElement("div");M.className=this.wrapClassName("content"),this.$content=M,this.readonly&&M.classList.add(this.wrapClassName("readonly")),M.appendChild(this.renderPreviewMask()),M.appendChild(this.renderPreview())}return this.$content}renderPreview(){if(!this.$preview){const M=document.createElement("div");M.className=this.wrapClassName("preview")+" tele-fancy-scrollbar",this.$preview=M,this.sideEffect.add(()=>(this.previewLazyLoad=new Up({container:this.$preview,elements_selector:`.${this.wrapClassName("preview-page>img")}`}),()=>{var v;return(v=this.previewLazyLoad)==null?void 0:v.destroy()})),this.refreshPreview(),this.sideEffect.addEventListener(M,"click",v=>{var q;if(this.readonly)return;const b=(q=v.target.dataset)==null?void 0:q.pageIndex;b&&(v.preventDefault(),v.stopPropagation(),v.stopImmediatePropagation(),this.onNewPageIndex(Number(b)),this.togglePreview(!1))})}return this.$preview}refreshPreview(){var q;const{$preview:M}=this,v=this.wrapClassName("preview-page"),b=this.wrapClassName("preview-page-name");for(;M.firstChild;)M.firstChild.remove();this.pages.forEach((ht,W)=>{var vt;const C=(vt=ht.thumbnail)!=null?vt:ht.src.startsWith("ppt")?void 0:ht.src;if(!C)return;const V=String(W),z=document.createElement("a");z.className=v+" "+this.wrapClassName(`preview-page-${W}`),z.setAttribute("href","#"),z.dataset.pageIndex=V;const k=document.createElement("span");k.className=b,k.textContent=String(W+1),k.dataset.pageIndex=V;const Z=document.createElement("img");Z.width=ht.width,Z.height=ht.height,Z.dataset.src=C,Z.dataset.pageIndex=V,z.appendChild(Z),z.appendChild(k),M.appendChild(z)}),(q=this.previewLazyLoad)==null||q.update()}renderPreviewMask(){return this.$previewMask||(this.$previewMask=document.createElement("div"),this.$previewMask.className=this.wrapClassName("preview-mask"),this.sideEffect.addEventListener(this.$previewMask,"click",M=>{this.readonly||M.target===this.$previewMask&&this.togglePreview(!1)})),this.$previewMask}refreshBtnSidebar(){this.$btnSidebar.style.display=this.pages.length>0?"":"none"}renderFooter(){if(!this.$footer){const M=document.createElement("div");M.className=this.wrapClassName("footer"),this.$footer=M,this.readonly&&M.classList.add(this.wrapClassName("readonly")),this.isSmallBox&&M.classList.add(this.wrapClassName("float-footer"));const v=this.renderFooterBtn("btn-sidebar",dL(this.namespace));this.sideEffect.addEventListener(v,"click",()=>{this.readonly||this.togglePreview()}),this.$btnSidebar=v,this.$btnSidebar.style.display="none",this.$footer.appendChild(v);const b=document.createElement("div");b.className=this.wrapClassName("page-jumps");const q=this.renderFooterBtn("btn-page-back",pL(this.namespace));if(this.sideEffect.addEventListener(q,"click",()=>{this.readonly||this.onNewPageIndex(this.pageIndex-1)}),b.appendChild(q),this.onPlay){const z=this.renderFooterBtn("btn-page-play",mL(this.namespace),gL(this.namespace));this.$btnPlay=z,this.sideEffect.addEventListener(z,"click",()=>{this.readonly||(this.setPlaying(),this.onPlay&&this.onPlay())}),b.appendChild(z)}const ht=this.renderFooterBtn("btn-page-next",fL(this.namespace));this.sideEffect.addEventListener(ht,"click",()=>{this.readonly||this.onNewPageIndex(this.pageIndex+1)}),b.appendChild(ht);const W=document.createElement("div");W.className=this.wrapClassName("page-number");const C=document.createElement("input");C.className=this.wrapClassName("page-number-input"),C.value=String(this.pageIndex+1),this.readonly&&(C.disabled=!0),this.$pageNumberInput=C,this.sideEffect.addEventListener(C,"focus",()=>{C.select()}),this.sideEffect.addEventListener(C,"change",()=>{this.readonly||C.value&&this.onNewPageIndex(Number(C.value)-1)});const V=document.createElement("span");this.$totalPage=V,W.appendChild(C),W.appendChild(V),this.$footer.appendChild(b),this.$footer.appendChild(W)}return this.$footer}renderFooterBtn(M,v,b){const q=document.createElement("button");return q.className=this.wrapClassName("footer-btn")+" "+this.wrapClassName(M),q.appendChild(v),b&&q.appendChild(b),q}togglePreview(M){if(this.isShowPreview=M!=null?M:!this.isShowPreview,this.$content.classList.toggle(this.wrapClassName("preview-active"),this.isShowPreview),this.isShowPreview){const v=this.$preview.querySelector("."+this.wrapClassName(`preview-page-${this.pageIndex}`));v&&this.$preview.scrollTo({top:v.offsetTop-16})}}wrapClassName(M){return`${this.namespace}-${M}`}}const TO=new Set(["clicker"]);class EO{constructor({box:M,view:v,mountSlideController:b,mountWhiteboard:q}){this.slideController=null,this.isViewMounted=!1,this.onError=({error:ht})=>{this.viewer.setPaused(),Io.warn("[Slide] render error",ht)},this.refreshPages=()=>{this.slideController&&(this.viewer.pages=dT(this.slideController.slide),this.viewer.setPageIndex(this.getPageIndex(this.slideController.page)),this.scaleDocsToFit())},this.scaleDocsToFit=()=>{if(this.slideController){const{width:ht,height:W}=this.slideController.slide;ht&&W&&(this.whiteboardView.moveCameraToContain({originX:-ht/2,originY:-W/2,width:ht,height:W,animationMode:"immediately"}),this.whiteboardView.setCameraBound({damping:1,maxContentMode:()=>this.whiteboardView.camera.scale,minContentMode:()=>this.whiteboardView.camera.scale,centerX:0,centerY:0,width:ht,height:W}),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=ht=>{this.slideController&&this.slideController.jumpToPage(ht+1)},this.sideEffect=new Dp,this.namespace="netless-app-slide",this.box=M,this.whiteboardView=v,this.mountSlideController=b,this.mountWhiteboard=q,this.viewer=new HT({readonly:M.readonly,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay}),this.sideEffect.add(()=>{const ht=W=>{this.setReadonly(W)};return M.events.on("readonly",ht),()=>M.events.off("readonly",ht)}),this.render()}render(){this.viewer.$content.appendChild(this.renderSlideContainer()),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.sideEffect.addEventListener(window,"keydown",M=>{if(this.box.focus&&this.slideController)switch(M.key){case"ArrowUp":case"ArrowLeft":{this.slideController.slide.prevStep();break}case"ArrowRight":case"ArrowDown":{this.slideController.slide.nextStep();break}}})}renderSlideContainer(){if(!this.$slide){const M=document.createElement("div");M.className=this.wrapClassName("slide"),M.dataset.appKind="Slide",this.$slide=M}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,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(M){return(M>0?M:1)-1}unmount(){return this.slideController&&(this.slideController.destroy(),this.slideController=null),this.viewer.unmount(),this}setReadonly(M){this.viewer.setReadonly(M)}destroy(){this.sideEffect.flushAll(),this.unmount(),this.viewer.destroy()}toggleClickThrough(M){this.$whiteboardView.style.pointerEvents=!M||TO.has(M)?"none":"auto"}wrapClassName(M){return`${this.namespace}-${M}`}}let X_=!1;const zT=2,Lp=T=>"["+T+"]",Pg={map:new Map,queue:[],validateQueue(){for(qn("[Slide] freezer: validate",Lp(this.queue));this.queue.length>zT;){const T=this.queue.pop(),M=this.map.get(T);M&&(qn("[Slide] freezer: validate-freeze",T,Lp(this.queue)),M.freeze())}},set(T,M){qn("[Slide] freezer: add",T,Lp(this.queue)),this.map.set(T,M),this.queue.includes(T)||this.queue.unshift(T),this.validateQueue()},delete(T){this.map.delete(T),this.queue=this.queue.filter(M=>M!==T),qn("[Slide] freezer: delete",T,Lp(this.queue))},focus(T){const M=this.map.get(T),v=this.queue.indexOf(T);v>-1&&this.queue.splice(v,1),this.queue.unshift(T),this.validateQueue(),qn("[Slide] freezer: focus",T,Lp(this.queue)),M&&M.unfreeze()}},MO=T=>{X_=!0,T.on("focus",({appId:M})=>{Pg.focus(M)})};var jT=(()=>`.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-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))}
|
|
6362
|
-
`)();function AO({container:T,taskId:M,url:v=Y_,debug:b=!1}){if(!M)throw new Error("[Slide] taskId is required");T.style.cssText+="display:flex;flex-direction:column";const q=new VT({target:T});return q.debug=!!b,q.mount(M,v),q}class VT{constructor(M){this.slide=null,this.debug=!1,this.sideEffect=new Dp,this.ready=!1,this.readyPromise=new Promise(v=>{this.resolveReady=()=>{this.ready=!0,v()}}),this.hotkeyListener=v=>{if(this.slide)switch(v.key){case"ArrowUp":case"ArrowLeft":{this.slide.prevStep();break}case"ArrowRight":case"ArrowDown":{this.slide.nextStep();break}}},this.onPageChanged=v=>{this.viewer.setPageIndex(v-1)},this.onTransitionStart=()=>{this.viewer.setPlaying()},this.onTransitionEnd=()=>{this.viewer.setPaused()},this.onError=({error:v})=>{this.viewer.setPaused(),console.warn("[Slide] render error",v)},this.destroyed=!1,this.refreshPages=()=>{this.slide&&(this.viewer.pages=dT(this.slide),this.viewer.setPageIndex(this.getPageIndex(this.slide.slideState.currentSlideIndex)))},this.onPlay=()=>{this.slide&&this.slide.nextStep()},this.onNewPageIndex=v=>{this.slide&&this.slide.slideCount>0&&this.slide.renderSlide(oT(v+1,1,this.slide.slideCount))},this.namespace="netless-app-slide",this.target=M.target,this.bgColor=cT(this.target),this.viewer=new HT({readonly:!1,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay}),this.render()}render(){this.viewer.$content.appendChild(this.renderSlideContainer()),this.registerHotKeys(window)}registerHotKeys(M){this.sideEffect.addEventListener(M,"keydown",this.hotkeyListener,void 0,"hotkey")}mount(M,v){this.target.appendChild(this.renderStyle()),this.target.appendChild(this.viewer.$content),this.target.appendChild(this.viewer.$footer),this.slide=new _n.Slide({anchor:this.$slide,interactive:!0,mode:"local",resize:!0,controller:this.debug,enableGlobalClick:!0,renderOptions:{minFPS:25,maxFPS:30,autoFPS:!0,autoResolution:!0,transactionBgColor:this.bgColor}}),this.registerEventListeners(),this.slide.setResource(M,v),this.slide.renderSlide(1)}renderStyle(){const M=document.createElement("style");return M.appendChild(document.createTextNode(jT)),M}registerEventListeners(){if(!this.slide)return;const{slide:M}=this;M.on(_n.SLIDE_EVENTS.slideChange,this.onPageChanged),M.on(_n.SLIDE_EVENTS.renderStart,this.onTransitionStart),M.on(_n.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),M.on(_n.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),M.on(_n.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),M.on(_n.SLIDE_EVENTS.renderError,this.onError),M.on(_n.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(M){return(M>0?M:1)-1}renderSlideContainer(){if(!this.$slide){const M=document.createElement("div");M.className=this.wrapClassName("slide"),M.dataset.appKind="Slide",this.$slide=M}return this.$slide}wrapClassName(M){return`${this.namespace}-${M}`}}const q_="0.2.
|
|
6361
|
+
`,(a=e.logger)===null||a===void 0||a.error("["+o+"] "+r))}},i.config=e,i.syncQueue=new HI(i.receiveSyncHandler),i.mode=e.mode,i.lock=new zI(i.mode==="interactive"),i.anchor=e.anchor,i.enableGlobalClick=!Object(V.isUndefined)(e.enableGlobalClick)&&e.enableGlobalClick,i.resize=e.resize||!1,i.interactive=e.interactive,i.cacheImage.style.position="absolute",i.cacheImage.style.zIndex="100",i.frame.style.cssText=e.fixedFrameSize?"width:"+e.fixedFrameSize.width+"px;height:"+e.fixedFrameSize.height+"px;":"width:100%;height:100%",i.frame.style.cssText+="display:flex;justify-content:center;align-items:center;visibility:hidden;position:relative;z-index:1;",e.fixedFrameSize&&(i.frameWidth=e.fixedFrameSize.width,i.frameHeight=e.fixedFrameSize.height),i.setMedianControllerAttribute(),i.frame.appendChild(i.medianController),i.anchor.appendChild(i.frame),i.frameResizeObserver.observe(i.frame),i.on(qr.syncReceive,function(r){i.lock.unlock(r.type,r.uuid),i.syncQueue.addTask(r)}),i.renderingTaskManager.eventHub.on("task-error",function(r){var o=r.error,s=r.task,a=Sn.transform(o);a.errorType===ur.RuntimeWarn?i.logger.warn(a.message,i.taskId):i.logger.error(a.message,i.taskId),i.isLoading=!1,i.emit(qr.renderError,{error:a,index:s.slideIndex})}),window.addEventListener("__slide_ref__",i.handleSlideRef),i.resizeView=Object(V.debounce)(i.resizeView.bind(i),50),i.player=i.initPlayer(e),e!=null&&e.controller&&i.createController(),i.player.view&&i.frame.appendChild(i.player.view),i.handleViewClick=Object(V.debounce)(i.handleViewClick,300),i.player.errorChannel.on("error",function(r,o){var s=Sn.transform(r);s.errorType===ur.RuntimeWarn?i.logger.warn(s.message,i.taskId):i.logger.error(s.message,i.taskId),i.isLoading=!1,o===i.renderingIndex&&i.emit(qr.renderError,{error:r,index:o})}),i.logger.info("new slide",""),i}return VI(t,n),t.flushLog=function(){return lo(this,void 0,void 0,function(){return uo(this,function(e){switch(e.label){case 0:return t._tempLog.length>0?[4,Tl==null?void 0:Tl.setItem("run_time_log_"+t._tempLogIndex,t._tempLog)]:[3,2];case 1:e.sent(),t._tempLog="",t._tempLogIndex+=1,e.label=2;case 2:return[2]}})})},Object.defineProperty(t.prototype,"dispatchIncrId",{get:function(){return this._dispatchIncrId++},enumerable:!1,configurable:!0}),t.prototype.initPlayer=function(e){var i,r,o,s=this,a=new tr({mode:this.mode,useLocalCache:!!Object(V.isUndefined)(this.config.useLocalCache)||this.config.useLocalCache,logger:this.logger,resourceTimeout:Object(V.isUndefined)(this.config.resourceTimeout)?15e3:this.config.resourceTimeout,loadDelegate:this.config.loaderDelegate});return a.setInteractive(this.interactive),a.updateConfig(e.renderOptions||{}),a.on(Ne.renderStart,function(l){s.isLoading=!0,s.emit(qr.renderStart,l)}),a.on(Ne.renderEnd,function(l){s.isLoading=!1,s.player&&(s.designHeight=s.player.designHeight,s.designWidth=s.player.designWidth,s.cacheImage.style.width=s.player.designWidth+"px",s.cacheImage.style.height=s.player.designHeight+"px",s._slideCount=s.player.slideCount),s.emit(qr.renderEnd,l)}),a.on(Ne.slideChange,function(l){s.__slideState.currentSlideIndex=l,s.emitStateChange(),s.emit(qr.slideChange,l)}),a.on(Ne.mainSeqStateChange,function(l){s.__slideState.mainSeqState=l,s.emitStateChange()}),a.on(Ne.mainSeqStepChange,function(l){s.__slideState.mainSeqStep=l,s.emitStateChange()}),a.on(Ne.interactiveSeqStateChange,function(l){var u=l.id,h=l.state;s.__slideState.interactiveSeqState[u]=h,s.emitStateChange()}),a.on(Ne.animateStart,function(){s.isAnimating!==!0&&(s.isAnimating=!0,s.emit(qr.animateStart))}),a.on(Ne.animateEnd,function(){s.isAnimating!==!1&&(s.isAnimating=!1,s.emit(qr.animateEnd))}),a.on(Ne.interactiveSeqAction,function(l){var u=l.action,h=l.seqId;s.emitSyncDispatch({slideIndex:s.__slideState.currentSlideIndex,type:"interactiveAnim",action:u,seqId:h}),s.emitStateChange()}),a.on(Ne.mainSeqStepStart,function(l){s.emit(qr.mainSeqStepStart,l)}),a.on(Ne.mainSeqStepEnd,function(l){s.emit(qr.mainSeqStepEnd,l)}),a.on(Ne.mediaPlay,function(l){var u={type:"play",time:s.timestamp()-1e3*l.time};s.__slideState.mediaState[l.id]=u,s.emitSyncDispatch({slideIndex:s.__slideState.currentSlideIndex,type:"mediaPlay",id:l.id,state:u}),s.emitStateChange()}),a.on(Ne.mediaPause,function(l){var u={type:"pause",time:l.time};s.__slideState.mediaState[l.id]=u,s.emitSyncDispatch({slideIndex:s.__slideState.currentSlideIndex,type:"mediaPause",id:l.id,state:u}),s.emitStateChange()}),a.on(Ne.mediaSeek,function(l){var u={type:"pause",time:0};l.isPlaying?(u.type="play",s.__slideState.mediaState[l.id]?u.time=s.__slideState.mediaState[l.id].time-1e3*l.time:u.time=s.timestamp()-1e3*l.time,s.__slideState.mediaState[l.id]=u):(u.type="pause",u.time=l.time,s.__slideState.mediaState[l.id]=u),s.emitSyncDispatch({slideIndex:s.__slideState.currentSlideIndex,type:"mediaSeek",id:l.id,time:l.time,state:u}),s.emitStateChange()}),a.on(Ne.requestPrevSlide,function(l){s.handlePrevSlide(l)}),a.on(Ne.requestNextSlide,function(l){s.handleNextSlide(l)}),a.on(Ne.requestGotoSlide,function(l){s.config.navigatorDelegate?s.config.navigatorDelegate.gotoPage(l):s.handleGotoSlide(l)}),(i=a.view)===null||i===void 0||i.addEventListener("touchend",this.handleViewTouchEnd),(r=a.view)===null||r===void 0||r.addEventListener("touchstart",this.handleViewTouchStart),(o=a.view)===null||o===void 0||o.addEventListener("click",this.handleViewClick),a.on(Ne.userInput,this.userInputHandle),a},t.prototype.createController=function(){this.player&&(this.playerController=new GI({player:this.player,params:this.player.config||{},target: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 e=this.frame.getBoundingClientRect(),i=e.width,r=e.height;this.frameWidth=i,this.frameHeight=r,this.resizeView()}},t.prototype.updateFixedFrameSize=function(e,i,r){this.config.fixedFrameSize&&(this.frameWidth=e,this.frameHeight=i,this.frame.style.width=e+"px",this.frame.style.height=i+"px",this.resizeView(r))},t.prototype.resizeView=function(e){var i,r,o=this,s=this.width,a=this.height;if(s>0&&a>0){var l=this.frameWidth/s,u=l*a;u>this.frameHeight&&(l*=this.frameHeight/u),(i=this.player)===null||i===void 0||i.scaleView(l,this.resize,e),this.cacheImage.style.transform="scale("+l+")",this.medianController.style.transform="scale("+l+")",this.medianController.style.top=(this.frameHeight-a*l)/2+"px",this.medianController.setAttribute("data-scale",l.toString()),this.isInitResized||(this.isInitResized=!0,(r=this.player)===null||r===void 0||r.clock.setTimeout(function(){o.frame.style.visibility="visible"},32))}},t.prototype.setSlideState=function(e){var i,r,o;return lo(this,void 0,void 0,function(){var s,a=this;return uo(this,function(l){switch(l.label){case 0:return this.isSyncingSlideState=!0,this.logger.info("stateChange receive "+JSON.stringify(e),this.taskId),e.taskId&&e.taskId!==this.__slideState.taskId&&(this.__slideState.taskId=e.taskId,(i=this.player)===null||i===void 0||i.setResourceData(e.taskId,this.__slideState.url)),e.url&&e.url!==this.__slideState.url&&(this.__slideState.url=e.url,(r=this.player)===null||r===void 0||r.setResourceData(this.__slideState.taskId,e.url)),Number.isInteger(e.currentSlideIndex)&&e.currentSlideIndex!==this.__slideState.currentSlideIndex?(this.__slideState.currentSlideIndex=e.currentSlideIndex,[4,this.doRenderSlide(e.currentSlideIndex)]):[3,2];case 1:l.sent(),l.label=2;case 2:return[4,(o=this.player)===null||o===void 0?void 0:o.clock.waitUntil(function(){var u,h;return((u=a.player)===null||u===void 0?void 0:u.currentIndex)===e.currentSlideIndex&&((h=a.player)===null||h===void 0?void 0:h.currentStage)},3e3)];case 3:return l.sent(),s=!1,Number.isInteger(e.mainSeqStep)&&e.mainSeqStep!==this.__slideState.mainSeqStep&&(s=!0,this.__slideState.mainSeqStep=e.mainSeqStep),e.mainSeqState&&e.mainSeqState!==this.__slideState.mainSeqState&&(s=!0,this.__slideState.mainSeqState=e.mainSeqState),s&&this.setMainSeqStep(this.__slideState.mainSeqStep,this.__slideState.mainSeqState==="idle"?"start":"end"),e.mediaState&&(this.initMedia(e),this.__slideState.mediaState=e.mediaState),e.interactiveSeqState&&(this.initInteractiveSeq(e),this.__slideState.interactiveSeqState=e.interactiveSeqState),this.isSyncingSlideState=!1,[2]}})})},t.prototype.initInteractiveSeq=function(e){var i;for(var r in e.interactiveSeqState){var o=e.interactiveSeqState[r];(i=this.player)===null||i===void 0||i.setInteractiveSeqState(r,o.step,o.state==="end"?"end":"start")}},t.prototype.initMedia=function(e){var i,r,o=this,s=function(u){var h=e.mediaState[u],d=a.__slideState.mediaState[u];if(d&&h.type===d.type&&h.time===d.time)return"continue";h.type==="play"?(i=a.player)===null||i===void 0||i.setMediaState(u,!0).then(function(){var p,m=o.timestamp();(p=o.player)===null||p===void 0||p.setMediaCurrentTime(u,(m-h.time)/1e3)}):(r=a.player)===null||r===void 0||r.setMediaState(u,!1).then(function(){var p;(p=o.player)===null||p===void 0||p.setMediaCurrentTime(u,h.time)})},a=this;for(var l in e.mediaState)s(l)},Object.defineProperty(t.prototype,"slideCount",{get:function(){return this._slideCount},enumerable:!1,configurable:!0}),t.prototype.getSizeAsync=function(){return lo(this,void 0,void 0,function(){var e;return uo(this,function(i){switch(i.label){case 0:if(this.width>0&&this.height>0)return[2,[this.width,this.height]];i.label=1;case 1:return i.trys.push([1,4,,5]),[4,fetch(this.__slideState.url+"/"+this.__slideState.taskId+"/jsonOutput/slide-1.json")];case 2:return[4,i.sent().json()];case 3:return[2,[(e=i.sent()).width,e.height]];case 4:return i.sent(),[2,[0,0]];case 5:return[2]}})})},t.prototype.getSlideCountAsync=function(){return lo(this,void 0,void 0,function(){return uo(this,function(e){switch(e.label){case 0:if(this._slideCount>0)return[2,this._slideCount];e.label=1;case 1:return e.trys.push([1,4,,5]),[4,fetch(this.__slideState.url+"/"+this.__slideState.taskId+"/jsonOutput/slide-1.json")];case 2:return[4,e.sent().json()];case 3:return[2,e.sent().slideCount];case 4:return e.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 e;return((e=this.player)===null||e===void 0?void 0:e.mainSeqLength())||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mainSeqStep",{get:function(){var e;return((e=this.player)===null||e===void 0?void 0:e.mainSeqStep())||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mainSeqState",{get:function(){var e;return((e=this.player)===null||e===void 0?void 0:e.mainSeqState())||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderOptions",{get:function(){var e;return((e=this.player)===null||e===void 0?void 0:e.config)||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"drawCall",{get:function(){var e;return((e=this.player)===null||e===void 0?void 0:e.runtime.drawCall)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderFps",{get:function(){var e;return((e=this.player)===null||e===void 0?void 0:e.runtime.fps)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"runtimeFps",{get:function(){var e;return((e=this.player)===null||e===void 0?void 0:e.fps.value)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"view",{get:function(){var e;return((e=this.player)===null||e===void 0?void 0:e.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(e){this.player&&(this.player.updateConfig(e),this.renderOptions&&(this.config.renderOptions=this.renderOptions))},t.prototype.setResource=function(e,i){var r;this.taskId=e,(r=this.player)===null||r===void 0||r.setResourceData(e,i),this.__slideState.taskId=e,this.__slideState.url=i,this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"setResource",taskId:e,url:i})},t.prototype._renderSlide=function(e){var i;return lo(this,void 0,void 0,function(){var r=this;return uo(this,function(o){switch(o.label){case 0:return this.renderingIndex=e,this.player&&e===this.player.currentIndex?[2]:((tr.platform.isIOS()||tr.platform.isAndroid())&&this.iosResetCache.indexOf(e)<0&&this.iosResetCache.push(e),[4,(i=this.player)===null||i===void 0?void 0:i.renderSlide(e)]);case 1:return o.sent(),this.__slideState.currentSlideIndex=e,this.resizeView(),this.__slideState.interactiveSeqState={},this.emitStateChange(),setTimeout(function(){var s,a;if(((a=(s=r.player)===null||s===void 0?void 0:s.view)===null||a===void 0?void 0:a.style.visibility)==="hidden"&&(r.player.view.style.visibility="visible"),r.frame.style.visibility==="hidden"&&(r.frame.style.visibility="visible"),r.needClearCacheImage)try{r.frame.removeChild(r.cacheImage)}catch{}},100),[2]}})})},t.prototype.renderSlide=function(e,i){if(i===void 0&&(i=!0),this.player){var r=Number(e);(r!==this.player.currentIndex||this.renderingTaskManager.hasStartTask())&&(r>this.slideCount&&this.slideCount>0||this.poseRenderSlide(r,i))}},t.prototype.needCreateNewPlayer=function(){var e=tr.platform.isLowGpuMemory()?15:30;return(tr.platform.isIOS()||tr.platform.isAndroid())&&this.iosResetCache.length>e},t.prototype.poseRenderSlide=function(e,i){this.mode==="interactive"?this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"renderSlide",index:e,isForward:i}):this.mode==="sync"?(this.doRenderSlide(e,i),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"renderSlide",index:e,isForward:i})):this.doRenderSlide(e,i)},t.prototype.doRenderSlide=function(e,i){var r,o,s,a=this;if(i===void 0&&(i=!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 l=this.player.getSnapshot();this.cacheImage.src=l,this.frame.appendChild(this.cacheImage),this.player.destroy(),(r=this.playerController)===null||r===void 0||r.destroy(),this.player=this.iosNewPlayer,this.iosNewPlayer=void 0,!((o=this.config)===null||o===void 0)&&o.controller&&this.createController(),this.needClearCacheImage=!0,!((s=this==null?void 0:this.player)===null||s===void 0)&&s.view&&(this.player.view.style.visibility="hidden",this.frame.appendChild(this.player.view))}var u=Math.random().toString(32).substr(2);return this.player.isForward=i,this.renderingTaskManager.addTask(function(){return a._renderSlide(e)},e,u),new Promise(function(h){a.renderingTaskManager.eventHub.once("task-end-"+u,h)})},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(e){if(e===void 0&&(e=!1),this.player){this.player.nextStep(e);var i=this.player.mainSeqStep();this.__slideState.mainSeqStep=i,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(e){if(e===void 0&&(e=!1),this.player){this.player.prevStep(e);var i=this.player.mainSeqStep();this.__slideState.mainSeqStep=i,this.emitStateChange()}},t.prototype.isSlideStateReady=function(e){return e.taskId.length>0&&e.url.length>0&&e.currentSlideIndex>0},t.prototype.emitStateChange=function(){if(this.mode!=="local"&&!this.isSyncingSlideState){var e=this.slideState;!Object(V.isEqual)(this.lastEmitedState,e)&&this.isSlideStateReady(e)&&(this.lastEmitedState=e,this.emit(qr.stateChange,e),this.logger.info("stateChange dispatch "+JSON.stringify(this.slideState),this.taskId))}},t.prototype.emitSyncDispatch=function(e){if(!this.lock.isLocked(e.type)){var i=Math.random().toString(32).substr(2);this.lock.addLock(e.type,i);var r=Ap(Ap({},e),{uuid:i});this.config.mode==="sync"&&(r.incrId=this.dispatchIncrId),this.emit(qr.syncDispatch,r),this.logger.info("sync dispatch "+JSON.stringify(r),this.taskId)}},t.prototype.setMainSeqStep=function(e,i){var r;(r=this.player)===null||r===void 0||r.setMainSeqStep(e,i)},t.prototype.setInteractive=function(e){var i;this.interactive=e,(i=this.player)===null||i===void 0||i.setInteractive(e)},t.prototype.pause=function(){var e;(e=this.player)===null||e===void 0||e.pause()},t.prototype.resume=function(){var e;(e=this.player)===null||e===void 0||e.resume()},t.prototype._doFrozen=function(){var e;return lo(this,void 0,void 0,function(){var i,r,o,s=this;return uo(this,function(a){switch(a.label){case 0:return this.view&&this.player?[4,this.player.clock.waitUntil(function(){return!s.isLoading},6e4)]:[3,2];case 1:for(r in a.sent(),i=this.player.getSnapshot()||"",this.cacheImage.src=i,this.frame.appendChild(this.cacheImage),this.player.destroy(),(e=this.playerController)===null||e===void 0||e.destroy(),this.player=void 0,this.__slideState.mediaState)o=this.__slideState.mediaState[r],this.__slideState.mediaState[r]=Ap(Ap({},o),{frozenTime:this.timestamp()});a.label=2;case 2:return[2]}})})},t.prototype.frozen=function(){var e=this;this.frozenTaskManager.addTask("frozen",function(){return e._doFrozen()})},t.prototype._doRelease=function(){var e,i;return lo(this,void 0,void 0,function(){var r,o,s,a;return uo(this,function(l){switch(l.label){case 0:if(this.player)return[2];for(o in this.player=this.initPlayer(this.config),!((e=this.config)===null||e===void 0)&&e.controller&&this.createController(),this.player.view&&(this.frame.appendChild(this.player.view),this.player.view.style.visibility="hidden"),r=this.__slideState,this.__slideState=Object(V.cloneDeep)(DS),r.mediaState)(s=r.mediaState[o]).type==="play"&&(a=Math.max((i=s.frozenTime)!==null&&i!==void 0?i:0,s.time),s.time=this.timestamp()-(a-s.time),s.frozenTime=void 0);return[4,this.setSlideState(r)];case 1:return l.sent(),[4,this.player.clock.delay(333)];case 2:l.sent(),this.player.view&&(this.player.view.style.visibility="visible");try{this.frame.removeChild(this.cacheImage)}catch{}return[2]}})})},t.prototype.release=function(){var e=this;this.frozenTaskManager.addTask("release",function(){return e._doRelease()})},t.prototype._doDestroy=function(){var e,i,r,o;this.logger.info("do destroy slide",""),this.playerController&&this.playerController.destroy(),this.frameResizeObserver.disconnect(),(e=this.player)===null||e===void 0||e.removeAllListeners(),(i=this.player)===null||i===void 0||i.destroy(),(r=this.player)===null||r===void 0||r.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),this.removeAllListeners();try{!((o=this.player)===null||o===void 0)&&o.view&&this.anchor.removeChild(this.player.view),this.anchor.removeChild(this.frame)}catch{}},t.prototype.waitLoadEnd=function(){return lo(this,void 0,void 0,function(){var e;return uo(this,function(i){switch(i.label){case 0:e=0,i.label=1;case 1:return this.isLoading&&e<10?[4,F_(100)]:[3,3];case 2:return i.sent(),e+=1,[3,1];case 3:return[2]}})})},t.prototype.destroy=function(){var e=this;this.logger.info("pre destroy slide",""),this.isLoading?this.waitLoadEnd().then(function(){e._doDestroy()}):this._doDestroy()},t.prototype.clearSlideCache=function(){var e;(e=this.player)===null||e===void 0||e.clearLocalCache()},t.prototype.hasNextStep=function(){if(!this.player)return!1;var e=this.player.currentIndex===this.slideCount,i=this.mainSeqLength===0||this.mainSeqStep>=this.mainSeqLength-1,r=this.mainSeqState==="end"||this.mainSeqState==="running"||this.mainSeqState==null;return!(e&&i&&r)},t.prototype.hasPrevStep=function(){if(!this.player)return!1;var e=this.player.currentIndex===1,i=this.mainSeqLength===0||this.mainSeqStep===0,r=this.mainSeqState==="idle"||this.mainSeqState===null;return!(e&&i&&r)},t.clearLocalCache=function(){tr.clearLocalCache()},t.disposeLocalCache=function(){},t._tempLog="",t._tempLogIndex=1,t.handleLogDownload=function(){return lo(void 0,void 0,void 0,function(){var e,i,r,o,s,a,l;return uo(this,function(u){switch(u.label){case 0:return e="",Tl?[4,Tl.keys()]:[3,5];case 1:i=(u.sent()||[]).sort(function(h,d){return parseInt(h.replace("run_time_log_",""))-parseInt(d.replace("run_time_log_",""))}),r=0,o=i,u.label=2;case 2:return r<o.length?(s=o[r],a=e,[4,Tl.getItem(s)]):[3,5];case 3:e=a+(u.sent()||""),u.label=4;case 4:return r++,[3,2];case 5:return(l=document.createElement("a")).setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(e)),l.setAttribute("download","slide_log"),l.style.display="none",document.body.appendChild(l),l.click(),document.body.removeChild(l),window.__slideLogText=e,[2]}})})},t}(P.a);Tl==null||Tl.clear(),window.addEventListener("__slide_log__",k_.handleLogDownload),window.setInterval(function(){k_.flushLog().catch(function(){})},9e3)}]);function oT(T,M,v){return Math.min(Math.max(T,M),v)}function tL(T){return typeof T=="object"&&T!==null}var sT={exports:{}},eL={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]},aT={exports:{}},iL=function(M){return!M||typeof M=="string"?!1:M instanceof Array||Array.isArray(M)||M.length>=0&&(M.splice instanceof Function||Object.getOwnPropertyDescriptor(M,M.length-1)&&M.constructor.name!=="String")},nL=iL,rL=Array.prototype.concat,oL=Array.prototype.slice,ZS=aT.exports=function(M){for(var v=[],b=0,q=M.length;b<q;b++){var ht=M[b];nL(ht)?v=rL.call(v,oL.call(ht)):v.push(ht)}return v};ZS.wrap=function(T){return function(){return T(ZS(arguments))}};var Op=eL,Fp=aT.exports,lT=Object.hasOwnProperty,uT=Object.create(null);for(var z_ in Op)lT.call(Op,z_)&&(uT[Op[z_]]=z_);var po=sT.exports={to:{},get:{}};po.get=function(T){var M=T.substring(0,3).toLowerCase(),v,b;switch(M){case"hsl":v=po.get.hsl(T),b="hsl";break;case"hwb":v=po.get.hwb(T),b="hwb";break;default:v=po.get.rgb(T),b="rgb";break}return v?{model:b,value:v}:null};po.get.rgb=function(T){if(!T)return null;var M=/^#([a-f0-9]{3,4})$/i,v=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,b=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,q=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,ht=/^(\w+)$/,W=[0,0,0,1],P,V,z;if(P=T.match(v)){for(z=P[2],P=P[1],V=0;V<3;V++){var k=V*2;W[V]=parseInt(P.slice(k,k+2),16)}z&&(W[3]=parseInt(z,16)/255)}else if(P=T.match(M)){for(P=P[1],z=P[3],V=0;V<3;V++)W[V]=parseInt(P[V]+P[V],16);z&&(W[3]=parseInt(z+z,16)/255)}else if(P=T.match(b)){for(V=0;V<3;V++)W[V]=parseInt(P[V+1],0);P[4]&&(P[5]?W[3]=parseFloat(P[4])*.01:W[3]=parseFloat(P[4]))}else if(P=T.match(q)){for(V=0;V<3;V++)W[V]=Math.round(parseFloat(P[V+1])*2.55);P[4]&&(P[5]?W[3]=parseFloat(P[4])*.01:W[3]=parseFloat(P[4]))}else return(P=T.match(ht))?P[1]==="transparent"?[0,0,0,0]:lT.call(Op,P[1])?(W=Op[P[1]],W[3]=1,W):null:null;for(V=0;V<3;V++)W[V]=El(W[V],0,255);return W[3]=El(W[3],0,1),W};po.get.hsl=function(T){if(!T)return null;var M=/^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*)?\)$/,v=T.match(M);if(v){var b=parseFloat(v[4]),q=(parseFloat(v[1])%360+360)%360,ht=El(parseFloat(v[2]),0,100),W=El(parseFloat(v[3]),0,100),P=El(isNaN(b)?1:b,0,1);return[q,ht,W,P]}return null};po.get.hwb=function(T){if(!T)return null;var M=/^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*)?\)$/,v=T.match(M);if(v){var b=parseFloat(v[4]),q=(parseFloat(v[1])%360+360)%360,ht=El(parseFloat(v[2]),0,100),W=El(parseFloat(v[3]),0,100),P=El(isNaN(b)?1:b,0,1);return[q,ht,W,P]}return null};po.to.hex=function(){var T=Fp(arguments);return"#"+Ag(T[0])+Ag(T[1])+Ag(T[2])+(T[3]<1?Ag(Math.round(T[3]*255)):"")};po.to.rgb=function(){var T=Fp(arguments);return T.length<4||T[3]===1?"rgb("+Math.round(T[0])+", "+Math.round(T[1])+", "+Math.round(T[2])+")":"rgba("+Math.round(T[0])+", "+Math.round(T[1])+", "+Math.round(T[2])+", "+T[3]+")"};po.to.rgb.percent=function(){var T=Fp(arguments),M=Math.round(T[0]/255*100),v=Math.round(T[1]/255*100),b=Math.round(T[2]/255*100);return T.length<4||T[3]===1?"rgb("+M+"%, "+v+"%, "+b+"%)":"rgba("+M+"%, "+v+"%, "+b+"%, "+T[3]+")"};po.to.hsl=function(){var T=Fp(arguments);return T.length<4||T[3]===1?"hsl("+T[0]+", "+T[1]+"%, "+T[2]+"%)":"hsla("+T[0]+", "+T[1]+"%, "+T[2]+"%, "+T[3]+")"};po.to.hwb=function(){var T=Fp(arguments),M="";return T.length>=4&&T[3]!==1&&(M=", "+T[3]),"hwb("+T[0]+", "+T[1]+"%, "+T[2]+"%"+M+")"};po.to.keyword=function(T){return uT[T.slice(0,3)]};function El(T,M,v){return Math.min(Math.max(M,T),v)}function Ag(T){var M=Math.round(T).toString(16).toUpperCase();return M.length<2?"0"+M:M}var sL=sT.exports;class aL{constructor(M){this.enable=M,this.apps={},this.level="debug",this.roomLogger=null,this._onMessage=v=>{let b;v instanceof CustomEvent?b=v.detail:tL(v.data)&&(b=v.data),b&&(typeof b.slide=="boolean"?this.enable=b.slide:b.slide==="__instance"?console.log(this):b.slide==="__debug"&&Object.values(this.apps).forEach(q=>{var ht,W;(W=(ht=q.controller)==null?void 0:ht.slide)==null||W.createController()}))},this.initialize()}setAppContext(M,v){var b;((b=this.apps)[M]||(b[M]={})).context=v,this.log(`[Slide] new ${M}`)}setAppController(M,v){var b;((b=this.apps)[M]||(b[M]={})).controller=v}deleteApp(M){delete this.apps[M],this.log(`[Slide] delete ${M}`)}initialize(){window.addEventListener("message",this._onMessage)}dispose(){window.removeEventListener("message",this._onMessage)}log(...M){this.roomLogger?this.roomLogger.info(...M):this.enable&&console.log(...M)}verbose(...M){this.roomLogger?this.roomLogger.debug(...M):this.enable&&this.level==="verbose"&&console.log(...M)}warn(...M){this.roomLogger?this.roomLogger.warn(...M):console.warn(...M)}}const Io=new aL(!1),qn=Io.log.bind(Io),j_=Io.verbose.bind(Io),lL=T=>{Io.roomLogger=T.logger};function hT(T){try{const M=window.getComputedStyle(T).backgroundColor;if(M!=="rgba(0, 0, 0, 0)"&&M!=="transparent")return M;if(T.parentElement)return hT(T.parentElement)}catch{}return"#ffffff"}function uL(T){const M=sL.get(T);if(M&&M.model==="rgb"){const v=M.value,q=(((Math.round(v[0])&255)<<16)+((Math.round(v[1])&255)<<8)+(Math.round(v[2])&255)).toString(16);return"#"+"000000".substring(q.length)+q}else return T}let Rg="";function cT(T){return Rg||(Rg=uL(hT(T)),qn("[Slide] guess bg color",Rg)),Rg}function dT(T){const{width:M,height:v,slideCount:b,slideState:q}=T,{taskId:ht,url:W}=q,P=[];for(let V=1;V<=b;++V)P.push({width:M,height:v,thumbnail:`${W}/${ht}/preview/${V}.png`,src:"ppt"});return P}function KS(T,M,v,b){var P;const q=v.slideState.currentSlideIndex;if(!(q>0)||!M.getIsWritable())return;const ht=[b,q].join("/");if(T.scenePathType(ht)!=="page"){T.removeScenes(b);const V=v.slideCount,z=[];for(let k=1;k<=V;++k)z.push({name:`${k}`});T.putScenes(b,z)}let W;M.getBox().focus?W=T.state.sceneState.scenePath:W=((P=M.getView())==null?void 0:P.focusScenePath)||"",W!==ht&&M.setScenePath(ht)}const Y_="https://convertcdn.netless.link/dynamicConvert",hL=40,V_={taskId:"",url:"",state:null};class cL{constructor({context:M,anchor:v,onPageChanged:b,onTransitionStart:q,onTransitionEnd:ht,onError:W}){this.sideEffect=new Dp,this.ready=!1,this.readyPromise=new Promise(P=>{this.resolveReady=()=>{this.ready?qn("[Slide] render end"):setTimeout(()=>{this.ready=!0,P()},1e3)}}),this.onSyncDispatch=P=>{if(this.context.getIsWritable()&&this.room){const V={type:_n.SLIDE_EVENTS.syncDispatch,payload:P};j_("[Slide] dispatch",JSON.stringify(P)),this.context.dispatchMagixEvent(_n.SLIDE_EVENTS.syncDispatch,V)}},this.magixEventListener=P=>{const{type:V,payload:z}=P.payload;V===_n.SLIDE_EVENTS.syncDispatch&&(this.syncStateOnce(),j_("[Slide] receive",JSON.stringify(z)),this.slide.emit(_n.SLIDE_EVENTS.syncReceive,z))},this.onStateChange=P=>{this.context.getIsWritable()&&(j_("[Slide] state change",JSON.stringify(P,null,2)),this.context.storage.setState({state:P}))},this.pollCount=0,this.pollReadyState=()=>{this.ready?this._toFreeze===1?this.freeze():this._toFreeze===-1&&this.unfreeze():this.pollCount<hL?(this.pollCount++,setTimeout(this.pollReadyState,500)):(this.pollCount=0,qn("[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?(qn("[Slide] freeze",this.context.appId),this.slide.frozen()):this._toFreeze=1},this.unfreeze=async()=>{!this.visible||(this.isFrozen=!1,this.ready?(qn("[Slide] unfreeze",this.context.appId),this.slide.release()):this._toFreeze=-1)},this.onVisibilityChange=async()=>{(this.visible=document.visibilityState==="visible")?(qn("[Slide] unfreeze because tab becomes visible",{savedIsFrozen:this.savedIsFrozen}),this.savedIsFrozen||this.unfreeze()):(this.savedIsFrozen=this.isFrozen,qn("[Slide] freeze because tab becomes invisible"),this.freeze())},this.onPageChanged=b,this.onTransitionStart=q,this.onTransitionEnd=ht,this.onError=W,this.context=M,this.room=M.getRoom(),this.player=this.room?void 0:M.getDisplayer(),lL(this.room||this.player),this.slide=this.createSlide(v),this.syncStateOnceFlag=!this.context.isAddApp,this.visible=document.visibilityState==="visible",this.savedIsFrozen=!1,this.initialize()}jumpToPage(M){this.ready&&(M=oT(M,1,this.pageCount),this.slide.renderSlide(M))}initialize(){this.registerEventListeners(),this.kickStart()}kickStart(){const{context:M,slide:v}=this;M.getIsWritable()&&M.storage.ensureState(V_);const{taskId:b,url:q,state:ht}=M.storage.state;v.setResource(b,q||Y_),ht?(qn("[Slide] init with state",JSON.stringify(ht)),this.syncStateOnceFlag=!1,v.setSlideState(ht)):M.isAddApp&&(qn("[Slide] init by renderSlide",1),v.renderSlide(1)),this.pollReadyState()}registerEventListeners(){const{context:M,slide:v}=this,b=this.sideEffect.addDisposer(M.storage.addStateChangedListener(()=>{M.storage.state.state&&(this.syncStateOnce(),this.sideEffect.flush(b))}));this.sideEffect.add(()=>M.addMagixEventListener(_n.SLIDE_EVENTS.syncDispatch,this.magixEventListener,{fireSelfEventAfterCommit:!0})),v.on(_n.SLIDE_EVENTS.slideChange,this.onPageChanged),v.on(_n.SLIDE_EVENTS.renderStart,this.onTransitionStart),v.on(_n.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),v.on(_n.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),v.on(_n.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),v.on(_n.SLIDE_EVENTS.renderError,this.onError),v.on(_n.SLIDE_EVENTS.stateChange,this.onStateChange),v.on(_n.SLIDE_EVENTS.syncDispatch,this.onSyncDispatch),v.on(_n.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(V_);const{state:M}=this.context.storage.state;M&&(qn("[Slide] sync with state (once)",JSON.stringify(M)),this.slide.setSlideState(M),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(M){var q,ht;const v=this.context.getAppOptions()||{};return new _n.Slide({anchor:M,interactive:!0,mode:"interactive",resize:!0,controller:Io.enable,enableGlobalClick:!0,renderOptions:{minFPS:v.minFPS||25,maxFPS:v.maxFPS||30,autoFPS:(q=v.autoFPS)!=null?q:!0,autoResolution:(ht=v.autoResolution)!=null?ht:!0,resolution:v.resolution,transactionBgColor:v.bgColor||cT(M),maxResolutionLevel:v.maxResolutionLevel},timestamp:this.timestamp})}destroy(){this.sideEffect.flushAll(),this.destroyed||(qn("[Slide] destroy slide (once)"),this.slide.destroy(),this.destroyed=!0)}}function dL(T){const M="http://www.w3.org/2000/svg",v=document.createElementNS(M,"svg");v.setAttribute("class",`${T}-footer-icon-sidebar`),v.setAttribute("viewBox","0 0 64 64");const b=document.createElementNS(M,"path");return b.setAttribute("fill","currentColor"),b.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"),v.appendChild(b),v}function pL(T){const M="http://www.w3.org/2000/svg",v=document.createElementNS(M,"svg");v.setAttribute("class",`${T}-footer-icon-arrow-left`),v.setAttribute("viewBox","0 0 500 500");const b=document.createElementNS(M,"path");return b.setAttribute("fill","currentColor"),b.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"),v.appendChild(b),v}function fL(T){const M="http://www.w3.org/2000/svg",v=document.createElementNS(M,"svg");v.setAttribute("class",`${T}-footer-icon-arrow-right`),v.setAttribute("viewBox","0 0 500 500");const b=document.createElementNS(M,"path");return b.setAttribute("fill","currentColor"),b.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"),v.appendChild(b),v}function mL(T){const M="http://www.w3.org/2000/svg",v=document.createElementNS(M,"svg");v.setAttribute("class",`${T}-footer-icon-play`),v.setAttribute("viewBox","0 0 500 500");const b=document.createElementNS(M,"path");return b.setAttribute("fill","currentColor"),b.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"),v.appendChild(b),v}function gL(T){const M="http://www.w3.org/2000/svg",v=document.createElementNS(M,"svg");v.setAttribute("class",`${T}-footer-icon-pause`),v.setAttribute("viewBox","0 0 500 500");const b=document.createElementNS(M,"path");return b.setAttribute("fill","currentColor"),b.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"),v.appendChild(b),v}const Al=typeof window!="undefined",pT=Al&&!("onscroll"in window)||typeof navigator!="undefined"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),fT=Al&&"IntersectionObserver"in window,mT=Al&&"classList"in document.createElement("p"),gT=Al&&window.devicePixelRatio>1,vL={elements_selector:".lazy",container:pT||Al?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},vT=T=>Object.assign({},vL,T),QS=function(T,M){let v;const b="LazyLoad::Initialized",q=new T(M);try{v=new CustomEvent(b,{detail:{instance:q}})}catch{v=document.createEvent("CustomEvent"),v.initCustomEvent(b,!1,!1,{instance:q})}window.dispatchEvent(v)},_L=(T,M)=>{if(!!M)if(!M.length)QS(T,M);else for(let v=0,b;b=M[v];v+=1)QS(T,b)},Ia="src",$_="srcset",J_="sizes",_T="poster",Bp="llOriginalAttrs",yT="data",Z_="loading",xT="loaded",bT="applied",yL="entered",K_="error",wT="native",ST="data-",TT="ll-status",Jr=(T,M)=>T.getAttribute(ST+M),xL=(T,M,v)=>{var b=ST+M;if(v===null){T.removeAttribute(b);return}T.setAttribute(b,v)},kp=T=>Jr(T,TT),Hu=(T,M)=>xL(T,TT,M),Ig=T=>Hu(T,null),Q_=T=>kp(T)===null,bL=T=>kp(T)===Z_,wL=T=>kp(T)===K_,ty=T=>kp(T)===wT,SL=[Z_,xT,bT,K_],TL=T=>SL.indexOf(kp(T))>=0,Rl=(T,M,v,b)=>{if(!!T){if(b!==void 0){T(M,v,b);return}if(v!==void 0){T(M,v);return}T(M)}},Dc=(T,M)=>{if(mT){T.classList.add(M);return}T.className+=(T.className?" ":"")+M},Gs=(T,M)=>{if(mT){T.classList.remove(M);return}T.className=T.className.replace(new RegExp("(^|\\s+)"+M+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},EL=T=>{T.llTempImage=document.createElement("IMG")},ML=T=>{delete T.llTempImage},ET=T=>T.llTempImage,Lg=(T,M)=>{if(!M)return;const v=M._observer;!v||v.unobserve(T)},AL=T=>{T.disconnect()},RL=(T,M,v)=>{M.unobserve_entered&&Lg(T,v)},ey=(T,M)=>{!T||(T.loadingCount+=M)},CL=T=>{!T||(T.toLoadCount-=1)},MT=(T,M)=>{!T||(T.toLoadCount=M)},PL=T=>T.loadingCount>0,IL=T=>T.toLoadCount>0,AT=T=>{let M=[];for(let v=0,b;b=T.children[v];v+=1)b.tagName==="SOURCE"&&M.push(b);return M},iy=(T,M)=>{const v=T.parentNode;if(!v||v.tagName!=="PICTURE")return;AT(v).forEach(M)},RT=(T,M)=>{AT(T).forEach(M)},Og=[Ia],CT=[Ia,_T],Np=[Ia,$_,J_],PT=[yT],Ng=T=>!!T[Bp],IT=T=>T[Bp],LT=T=>delete T[Bp],Nc=(T,M)=>{if(Ng(T))return;const v={};M.forEach(b=>{v[b]=T.getAttribute(b)}),T[Bp]=v},LL=T=>{Ng(T)||(T[Bp]={backgroundImage:T.style.backgroundImage})},OL=(T,M,v)=>{if(!v){T.removeAttribute(M);return}T.setAttribute(M,v)},Gu=(T,M)=>{if(!Ng(T))return;const v=IT(T);M.forEach(b=>{OL(T,b,v[b])})},NL=T=>{if(!Ng(T))return;const M=IT(T);T.style.backgroundImage=M.backgroundImage},OT=(T,M,v)=>{Dc(T,M.class_applied),Hu(T,bT),v&&(M.unobserve_completed&&Lg(T,M),Rl(M.callback_applied,T,v))},NT=(T,M,v)=>{Dc(T,M.class_loading),Hu(T,Z_),v&&(ey(v,1),Rl(M.callback_loading,T,v))},Ml=(T,M,v)=>{!v||T.setAttribute(M,v)},tT=(T,M)=>{Ml(T,J_,Jr(T,M.data_sizes)),Ml(T,$_,Jr(T,M.data_srcset)),Ml(T,Ia,Jr(T,M.data_src))},DL=(T,M)=>{iy(T,v=>{Nc(v,Np),tT(v,M)}),Nc(T,Np),tT(T,M)},FL=(T,M)=>{Nc(T,Og),Ml(T,Ia,Jr(T,M.data_src))},BL=(T,M)=>{RT(T,v=>{Nc(v,Og),Ml(v,Ia,Jr(v,M.data_src))}),Nc(T,CT),Ml(T,_T,Jr(T,M.data_poster)),Ml(T,Ia,Jr(T,M.data_src)),T.load()},kL=(T,M)=>{Nc(T,PT),Ml(T,yT,Jr(T,M.data_src))},UL=(T,M,v)=>{const b=Jr(T,M.data_bg),q=Jr(T,M.data_bg_hidpi),ht=gT&&q?q:b;!ht||(T.style.backgroundImage=`url("${ht}")`,ET(T).setAttribute(Ia,ht),NT(T,M,v))},GL=(T,M,v)=>{const b=Jr(T,M.data_bg_multi),q=Jr(T,M.data_bg_multi_hidpi),ht=gT&&q?q:b;!ht||(T.style.backgroundImage=ht,OT(T,M,v))},HL=(T,M,v)=>{const b=Jr(T,M.data_bg_set);if(!b)return;const q=b.split("|");let ht=q.map(W=>`image-set(${W})`);T.style.backgroundImage=ht.join(),T.style.backgroundImage===""&&(ht=q.map(W=>`-webkit-image-set(${W})`),T.style.backgroundImage=ht.join()),OT(T,M,v)},DT={IMG:DL,IFRAME:FL,VIDEO:BL,OBJECT:kL},zL=(T,M)=>{const v=DT[T.tagName];!v||v(T,M)},jL=(T,M,v)=>{const b=DT[T.tagName];!b||(b(T,M),NT(T,M,v))},VL=["IMG","IFRAME","VIDEO","OBJECT"],WL=T=>VL.indexOf(T.tagName)>-1,FT=(T,M)=>{M&&!PL(M)&&!IL(M)&&Rl(T.callback_finish,M)},eT=(T,M,v)=>{T.addEventListener(M,v),T.llEvLisnrs[M]=v},XL=(T,M,v)=>{T.removeEventListener(M,v)},ny=T=>!!T.llEvLisnrs,qL=(T,M,v)=>{ny(T)||(T.llEvLisnrs={});const b=T.tagName==="VIDEO"?"loadeddata":"load";eT(T,b,M),eT(T,"error",v)},W_=T=>{if(!ny(T))return;const M=T.llEvLisnrs;for(let v in M){const b=M[v];XL(T,v,b)}delete T.llEvLisnrs},BT=(T,M,v)=>{ML(T),ey(v,-1),CL(v),Gs(T,M.class_loading),M.unobserve_completed&&Lg(T,v)},YL=(T,M,v,b)=>{const q=ty(M);BT(M,v,b),Dc(M,v.class_loaded),Hu(M,xT),Rl(v.callback_loaded,M,b),q||FT(v,b)},$L=(T,M,v,b)=>{const q=ty(M);BT(M,v,b),Dc(M,v.class_error),Hu(M,K_),Rl(v.callback_error,M,b),v.restore_on_error&&Gu(M,Np),q||FT(v,b)},ry=(T,M,v)=>{const b=ET(T)||T;if(ny(b))return;qL(b,W=>{YL(W,T,M,v),W_(b)},W=>{$L(W,T,M,v),W_(b)})},JL=(T,M,v)=>{EL(T),ry(T,M,v),LL(T),UL(T,M,v),GL(T,M,v),HL(T,M,v)},ZL=(T,M,v)=>{ry(T,M,v),jL(T,M,v)},oy=(T,M,v)=>{WL(T)?ZL(T,M,v):JL(T,M,v)},KL=(T,M,v)=>{T.setAttribute("loading","lazy"),ry(T,M,v),zL(T,M),Hu(T,wT)},iT=T=>{T.removeAttribute(Ia),T.removeAttribute($_),T.removeAttribute(J_)},QL=T=>{iy(T,M=>{iT(M)}),iT(T)},kT=T=>{iy(T,M=>{Gu(M,Np)}),Gu(T,Np)},tO=T=>{RT(T,M=>{Gu(M,Og)}),Gu(T,CT),T.load()},eO=T=>{Gu(T,Og)},iO=T=>{Gu(T,PT)},nO={IMG:kT,IFRAME:eO,VIDEO:tO,OBJECT:iO},rO=T=>{const M=nO[T.tagName];if(!M){NL(T);return}M(T)},oO=(T,M)=>{Q_(T)||ty(T)||(Gs(T,M.class_entered),Gs(T,M.class_exited),Gs(T,M.class_applied),Gs(T,M.class_loading),Gs(T,M.class_loaded),Gs(T,M.class_error))},sO=(T,M)=>{rO(T),oO(T,M),Ig(T),LT(T)},aO=(T,M,v,b)=>{!v.cancel_on_exit||!bL(T)||T.tagName==="IMG"&&(W_(T),QL(T),kT(T),Gs(T,v.class_loading),ey(b,-1),Ig(T),Rl(v.callback_cancel,T,M,b))},lO=(T,M,v,b)=>{const q=TL(T);Hu(T,yL),Dc(T,v.class_entered),Gs(T,v.class_exited),RL(T,v,b),Rl(v.callback_enter,T,M,b),!q&&oy(T,v,b)},uO=(T,M,v,b)=>{Q_(T)||(Dc(T,v.class_exited),aO(T,M,v,b),Rl(v.callback_exit,T,M,b))},hO=["IMG","IFRAME","VIDEO"],UT=T=>T.use_native&&"loading"in HTMLImageElement.prototype,cO=(T,M,v)=>{T.forEach(b=>{hO.indexOf(b.tagName)!==-1&&KL(b,M,v)}),MT(v,0)},dO=T=>T.isIntersecting||T.intersectionRatio>0,pO=T=>({root:T.container===document?null:T.container,rootMargin:T.thresholds||T.threshold+"px"}),fO=(T,M,v)=>{T.forEach(b=>dO(b)?lO(b.target,b,M,v):uO(b.target,b,M,v))},mO=(T,M)=>{M.forEach(v=>{T.observe(v)})},gO=(T,M)=>{AL(T),mO(T,M)},vO=(T,M)=>{!fT||UT(T)||(M._observer=new IntersectionObserver(v=>{fO(v,T,M)},pO(T)))},GT=T=>Array.prototype.slice.call(T),Cg=T=>T.container.querySelectorAll(T.elements_selector),_O=T=>GT(T).filter(Q_),yO=T=>wL(T),xO=T=>GT(T).filter(yO),nT=(T,M)=>_O(T||Cg(M)),bO=(T,M)=>{xO(Cg(T)).forEach(b=>{Gs(b,T.class_error),Ig(b)}),M.update()},wO=(T,M)=>{!Al||(M._onlineHandler=()=>{bO(T,M)},window.addEventListener("online",M._onlineHandler))},SO=T=>{!Al||window.removeEventListener("online",T._onlineHandler)},Up=function(T,M){const v=vT(T);this._settings=v,this.loadingCount=0,vO(v,this),wO(v,this),this.update(M)};Up.prototype={update:function(T){const M=this._settings,v=nT(T,M);if(MT(this,v.length),pT||!fT){this.loadAll(v);return}if(UT(M)){cO(v,M,this);return}gO(this._observer,v)},destroy:function(){this._observer&&this._observer.disconnect(),SO(this),Cg(this._settings).forEach(T=>{LT(T)}),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(T){const M=this._settings;nT(T,M).forEach(b=>{Lg(b,this),oy(b,M,this)})},restoreAll:function(){const T=this._settings;Cg(T).forEach(M=>{sO(M,T)})}};Up.load=(T,M)=>{const v=vT(M);oy(T,v)};Up.resetStatus=T=>{Ig(T)};Al&&_L(Up,window.lazyLoadOptions);class HT{constructor({readonly:M,onNewPageIndex:v,onPlay:b}){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 Dp,this.readonly=M,this.onNewPageIndex=v,this.onPlay=b,this.render()}set pages(M){this._pages=M,this.refreshPreview(),this.refreshTotalPage(),this.refreshBtnSidebar()}get pages(){return this._pages}unmount(){this.$content.remove(),this.$footer.remove()}setReadonly(M){this.readonly=M,this.$content.classList.toggle(this.wrapClassName("readonly"),M),this.$footer.classList.toggle(this.wrapClassName("readonly"),M),this.$pageNumberInput.disabled=M}destroy(){this.sideEffect.flushAll(),this.unmount()}setPageIndex(M){Number.isNaN(M)||(this.pageIndex=M,this.$pageNumberInput.value=String(M+1))}refreshTotalPage(){this.pages.length?this.$totalPage.textContent=" / "+this.pages.length:this.$totalPage.textContent=""}setSmallBox(M){this.isSmallBox!==M&&(this.isSmallBox=M,this.$footer.classList.toggle(this.wrapClassName("float-footer"),M))}render(){return this.renderContent(),this.renderFooter(),this.$content}renderContent(){if(!this.$content){const M=document.createElement("div");M.className=this.wrapClassName("content"),this.$content=M,this.readonly&&M.classList.add(this.wrapClassName("readonly")),M.appendChild(this.renderPreviewMask()),M.appendChild(this.renderPreview())}return this.$content}renderPreview(){if(!this.$preview){const M=document.createElement("div");M.className=this.wrapClassName("preview")+" tele-fancy-scrollbar",this.$preview=M,this.sideEffect.add(()=>(this.previewLazyLoad=new Up({container:this.$preview,elements_selector:`.${this.wrapClassName("preview-page>img")}`}),()=>{var v;return(v=this.previewLazyLoad)==null?void 0:v.destroy()})),this.refreshPreview(),this.sideEffect.addEventListener(M,"click",v=>{var q;if(this.readonly)return;const b=(q=v.target.dataset)==null?void 0:q.pageIndex;b&&(v.preventDefault(),v.stopPropagation(),v.stopImmediatePropagation(),this.onNewPageIndex(Number(b)),this.togglePreview(!1))})}return this.$preview}refreshPreview(){var q;const{$preview:M}=this,v=this.wrapClassName("preview-page"),b=this.wrapClassName("preview-page-name");for(;M.firstChild;)M.firstChild.remove();this.pages.forEach((ht,W)=>{var vt;const P=(vt=ht.thumbnail)!=null?vt:ht.src.startsWith("ppt")?void 0:ht.src;if(!P)return;const V=String(W),z=document.createElement("a");z.className=v+" "+this.wrapClassName(`preview-page-${W}`),z.setAttribute("href","#"),z.dataset.pageIndex=V;const k=document.createElement("span");k.className=b,k.textContent=String(W+1),k.dataset.pageIndex=V;const Z=document.createElement("img");Z.width=ht.width,Z.height=ht.height,Z.dataset.src=P,Z.dataset.pageIndex=V,z.appendChild(Z),z.appendChild(k),M.appendChild(z)}),(q=this.previewLazyLoad)==null||q.update()}renderPreviewMask(){return this.$previewMask||(this.$previewMask=document.createElement("div"),this.$previewMask.className=this.wrapClassName("preview-mask"),this.sideEffect.addEventListener(this.$previewMask,"click",M=>{this.readonly||M.target===this.$previewMask&&this.togglePreview(!1)})),this.$previewMask}refreshBtnSidebar(){this.$btnSidebar.style.display=this.pages.length>0?"":"none"}renderFooter(){if(!this.$footer){const M=document.createElement("div");M.className=this.wrapClassName("footer"),this.$footer=M,this.readonly&&M.classList.add(this.wrapClassName("readonly")),this.isSmallBox&&M.classList.add(this.wrapClassName("float-footer"));const v=this.renderFooterBtn("btn-sidebar",dL(this.namespace));this.sideEffect.addEventListener(v,"click",()=>{this.readonly||this.togglePreview()}),this.$btnSidebar=v,this.$btnSidebar.style.display="none",this.$footer.appendChild(v);const b=document.createElement("div");b.className=this.wrapClassName("page-jumps");const q=this.renderFooterBtn("btn-page-back",pL(this.namespace));if(this.sideEffect.addEventListener(q,"click",()=>{this.readonly||this.onNewPageIndex(this.pageIndex-1)}),b.appendChild(q),this.onPlay){const z=this.renderFooterBtn("btn-page-play",mL(this.namespace),gL(this.namespace));this.$btnPlay=z,this.sideEffect.addEventListener(z,"click",()=>{this.readonly||(this.setPlaying(),this.onPlay&&this.onPlay())}),b.appendChild(z)}const ht=this.renderFooterBtn("btn-page-next",fL(this.namespace));this.sideEffect.addEventListener(ht,"click",()=>{this.readonly||this.onNewPageIndex(this.pageIndex+1)}),b.appendChild(ht);const W=document.createElement("div");W.className=this.wrapClassName("page-number");const P=document.createElement("input");P.className=this.wrapClassName("page-number-input"),P.value=String(this.pageIndex+1),this.readonly&&(P.disabled=!0),this.$pageNumberInput=P,this.sideEffect.addEventListener(P,"focus",()=>{P.select()}),this.sideEffect.addEventListener(P,"change",()=>{this.readonly||P.value&&this.onNewPageIndex(Number(P.value)-1)});const V=document.createElement("span");this.$totalPage=V,W.appendChild(P),W.appendChild(V),this.$footer.appendChild(b),this.$footer.appendChild(W)}return this.$footer}renderFooterBtn(M,v,b){const q=document.createElement("button");return q.className=this.wrapClassName("footer-btn")+" "+this.wrapClassName(M),q.appendChild(v),b&&q.appendChild(b),q}togglePreview(M){if(this.isShowPreview=M!=null?M:!this.isShowPreview,this.$content.classList.toggle(this.wrapClassName("preview-active"),this.isShowPreview),this.isShowPreview){const v=this.$preview.querySelector("."+this.wrapClassName(`preview-page-${this.pageIndex}`));v&&this.$preview.scrollTo({top:v.offsetTop-16})}}wrapClassName(M){return`${this.namespace}-${M}`}}const TO=new Set(["clicker"]);class EO{constructor({box:M,view:v,mountSlideController:b,mountWhiteboard:q}){this.slideController=null,this.isViewMounted=!1,this.onError=({error:ht})=>{this.viewer.setPaused(),Io.warn("[Slide] render error",ht)},this.refreshPages=()=>{this.slideController&&(this.viewer.pages=dT(this.slideController.slide),this.viewer.setPageIndex(this.getPageIndex(this.slideController.page)),this.scaleDocsToFit())},this.scaleDocsToFit=()=>{if(this.slideController){const{width:ht,height:W}=this.slideController.slide;ht&&W&&(this.whiteboardView.moveCameraToContain({originX:-ht/2,originY:-W/2,width:ht,height:W,animationMode:"immediately"}),this.whiteboardView.setCameraBound({damping:1,maxContentMode:()=>this.whiteboardView.camera.scale,minContentMode:()=>this.whiteboardView.camera.scale,centerX:0,centerY:0,width:ht,height:W}),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=ht=>{this.slideController&&this.slideController.jumpToPage(ht+1)},this.sideEffect=new Dp,this.namespace="netless-app-slide",this.box=M,this.whiteboardView=v,this.mountSlideController=b,this.mountWhiteboard=q,this.viewer=new HT({readonly:M.readonly,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay}),this.sideEffect.add(()=>{const ht=W=>{this.setReadonly(W)};return M.events.on("readonly",ht),()=>M.events.off("readonly",ht)}),this.render()}render(){this.viewer.$content.appendChild(this.renderSlideContainer()),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.sideEffect.addEventListener(window,"keydown",M=>{if(this.box.focus&&this.slideController)switch(M.key){case"ArrowUp":case"ArrowLeft":{this.slideController.slide.prevStep();break}case"ArrowRight":case"ArrowDown":{this.slideController.slide.nextStep();break}}})}renderSlideContainer(){if(!this.$slide){const M=document.createElement("div");M.className=this.wrapClassName("slide"),M.dataset.appKind="Slide",this.$slide=M}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,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(M){return(M>0?M:1)-1}unmount(){return this.slideController&&(this.slideController.destroy(),this.slideController=null),this.viewer.unmount(),this}setReadonly(M){this.viewer.setReadonly(M)}destroy(){this.sideEffect.flushAll(),this.unmount(),this.viewer.destroy()}toggleClickThrough(M){this.$whiteboardView.style.pointerEvents=!M||TO.has(M)?"none":"auto"}wrapClassName(M){return`${this.namespace}-${M}`}}let X_=!1;const zT=2,Lp=T=>"["+T+"]",Pg={map:new Map,queue:[],validateQueue(){for(qn("[Slide] freezer: validate",Lp(this.queue));this.queue.length>zT;){const T=this.queue.pop(),M=this.map.get(T);M&&(qn("[Slide] freezer: validate-freeze",T,Lp(this.queue)),M.freeze())}},set(T,M){qn("[Slide] freezer: add",T,Lp(this.queue)),this.map.set(T,M),this.queue.includes(T)||this.queue.unshift(T),this.validateQueue()},delete(T){this.map.delete(T),this.queue=this.queue.filter(M=>M!==T),qn("[Slide] freezer: delete",T,Lp(this.queue))},focus(T){const M=this.map.get(T),v=this.queue.indexOf(T);v>-1&&this.queue.splice(v,1),this.queue.unshift(T),this.validateQueue(),qn("[Slide] freezer: focus",T,Lp(this.queue)),M&&M.unfreeze()}},MO=T=>{X_=!0,T.on("focus",({appId:M})=>{Pg.focus(M)})};var jT=(()=>`.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-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))}
|
|
6362
|
+
`)();function AO({container:T,taskId:M,url:v=Y_,debug:b=!1}){if(!M)throw new Error("[Slide] taskId is required");T.style.cssText+="display:flex;flex-direction:column";const q=new VT({target:T});return q.debug=!!b,q.mount(M,v),q}class VT{constructor(M){this.slide=null,this.debug=!1,this.sideEffect=new Dp,this.ready=!1,this.readyPromise=new Promise(v=>{this.resolveReady=()=>{this.ready=!0,v()}}),this.hotkeyListener=v=>{if(this.slide)switch(v.key){case"ArrowUp":case"ArrowLeft":{this.slide.prevStep();break}case"ArrowRight":case"ArrowDown":{this.slide.nextStep();break}}},this.onPageChanged=v=>{this.viewer.setPageIndex(v-1)},this.onTransitionStart=()=>{this.viewer.setPlaying()},this.onTransitionEnd=()=>{this.viewer.setPaused()},this.onError=({error:v})=>{this.viewer.setPaused(),console.warn("[Slide] render error",v)},this.destroyed=!1,this.refreshPages=()=>{this.slide&&(this.viewer.pages=dT(this.slide),this.viewer.setPageIndex(this.getPageIndex(this.slide.slideState.currentSlideIndex)))},this.onPlay=()=>{this.slide&&this.slide.nextStep()},this.onNewPageIndex=v=>{this.slide&&this.slide.slideCount>0&&this.slide.renderSlide(oT(v+1,1,this.slide.slideCount))},this.namespace="netless-app-slide",this.target=M.target,this.bgColor=cT(this.target),this.viewer=new HT({readonly:!1,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay}),this.render()}render(){this.viewer.$content.appendChild(this.renderSlideContainer()),this.registerHotKeys(window)}registerHotKeys(M){this.sideEffect.addEventListener(M,"keydown",this.hotkeyListener,void 0,"hotkey")}mount(M,v){this.target.appendChild(this.renderStyle()),this.target.appendChild(this.viewer.$content),this.target.appendChild(this.viewer.$footer),this.slide=new _n.Slide({anchor:this.$slide,interactive:!0,mode:"local",resize:!0,controller:this.debug,enableGlobalClick:!0,renderOptions:{minFPS:25,maxFPS:30,autoFPS:!0,autoResolution:!0,transactionBgColor:this.bgColor}}),this.registerEventListeners(),this.slide.setResource(M,v),this.slide.renderSlide(1)}renderStyle(){const M=document.createElement("style");return M.appendChild(document.createTextNode(jT)),M}registerEventListeners(){if(!this.slide)return;const{slide:M}=this;M.on(_n.SLIDE_EVENTS.slideChange,this.onPageChanged),M.on(_n.SLIDE_EVENTS.renderStart,this.onTransitionStart),M.on(_n.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),M.on(_n.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),M.on(_n.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),M.on(_n.SLIDE_EVENTS.renderError,this.onError),M.on(_n.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(M){return(M>0?M:1)-1}renderSlideContainer(){if(!this.$slide){const M=document.createElement("div");M.className=this.wrapClassName("slide"),M.dataset.appKind="Slide",this.$slide=M}return this.$slide}wrapClassName(M){return`${this.namespace}-${M}`}}const q_="0.2.4",RO={kind:"Slide",setup(T){if(console.log("[Slide] setup @ "+q_),T.getIsWritable()&&T.storage.ensureState(V_),!T.storage.state.taskId)throw new Error("[Slide] no taskId");const M=T.getView();if(!M)throw new Error("[Slide] no view, please set scenePath on addApp()");M.disableCameraTransform=!0;const v=T.getBox();v.mountStyles(jT);try{v.$content.dataset.appSlideVersion=q_}catch{}const b=T.getInitScenePath();let q=null;const ht=z=>{const k=T.getRoom();if(q&&q.slideController){let Z=!1;k&&T.getIsWritable()&&(KS(k,T,q.slideController.slide,b),Z=!0),qn("[Slide] page to",z,Z?"(synced)":""),q.viewer.setPageIndex(z-1)}},W=z=>{const k=new cL(YS(H_({context:T},z),{onPageChanged:ht}));return X_&&Pg.set(T.appId,k),Io.setAppController(T.appId,k),k.readyPromise.then(z.onReady).then(()=>{const Z=T.getRoom();let vt=!1;Z&&T.getIsWritable()&&(KS(Z,T,k.slide,b),vt=!0);const Ot=k.slide.slideState.currentSlideIndex;qn("[Slide] page to",Ot,vt?"(synced)":"","(on ready)")}),k};q=new EO({box:v,view:M,mountSlideController:W,mountWhiteboard:T.mountView.bind(T)});const P=T.getRoom(),V=new Dp;return V.add(()=>{var z;return Io.setAppContext(T.appId,T),Io.enable=((z=T.getAppOptions())==null?void 0:z.debug)||!1,Io.level="debug",()=>Io.deleteApp(T.appId)}),P&&(q.toggleClickThrough(P.state.memberState.currentApplianceName),V.add(()=>{const z=k=>{k.memberState&&q&&q.toggleClickThrough(k.memberState.currentApplianceName)};return P.callbacks.on("onRoomStateChanged",z),()=>P.callbacks.off("onRoomStateChanged",z)})),T.emitter.on("destroy",()=>{qn("[Slide] destroy",T.appId),X_&&Pg.delete(T.appId),V.flushAll(),q&&(q.destroy(),q=null)}),q.mount(),{slide:()=>{var z;return(z=q==null?void 0:q.slideController)==null?void 0:z.slide},nextStep:()=>{var z;return q&&q.slideController?((z=q==null?void 0:q.slideController)==null||z.slide.nextStep(),!0):!1},prevStep:()=>{var z;return q&&q.slideController?((z=q==null?void 0:q.slideController)==null||z.slide.prevStep(),!0):!1},position:()=>{const z=q==null?void 0:q.slideController;if(z)return[z.page,z.pageCount]},nextPage:()=>{const z=q==null?void 0:q.slideController;if(z){const{page:k,pageCount:Z}=z;if(Z>0&&k<Z)return z.jumpToPage(k+1),!0}return!1},prevPage:()=>{const z=q==null?void 0:q.slideController;if(z){const{page:k,pageCount:Z}=z;if(Z>0&&k>1)return z.jumpToPage(k-1),!0}return!1},jumpToPage:z=>{const k=q==null?void 0:q.slideController;if(k){const{page:Z,pageCount:vt}=k;if(vt>0&&Z>0&&Z<=vt)return k.jumpToPage(z),!0}return!1}}}};exports.DefaultUrl=Y_;exports.FreezerLength=zT;exports.SlidePreviewer=VT;exports.addHooks=MO;exports.apps=Pg;exports.default=RO;exports.previewSlide=AO;exports.version=q_;
|
|
6363
6363
|
//# sourceMappingURL=main.cjs.js.map
|