@realsee/five 6.4.0-alpha.26 → 6.4.0-alpha.28
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/docs/assets/search.js +1 -1
- package/docs/classes/five.Work.html +1 -1
- package/docs/functions/five.parseWork.html +1 -1
- package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +3 -7
- package/docs/interfaces/five.MapviewControllerCustomInitArgs.html +6 -8
- package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +3 -7
- package/docs/types/five.Works.html +1 -1
- package/five/index.d.ts +2 -10
- package/five/index.js +47 -47
- package/five/index.mjs +1414 -1409
- package/gltf-loader/index.js +3 -3
- package/gltf-loader/index.mjs +3 -3
- package/line/index.js +3 -3
- package/line/index.mjs +3 -3
- package/package.json +1 -1
- package/plugins/index.js +2 -2
- package/plugins/index.mjs +2 -2
- package/react/index.js +2 -2
- package/react/index.mjs +2 -2
- package/shader-lib/index.js +2 -2
- package/shader-lib/index.mjs +2 -2
- package/sticker/index.js +3 -3
- package/sticker/index.mjs +3 -3
- package/umd/five-gltf-loader.js +3 -3
- package/umd/five-line.js +3 -3
- package/umd/five-plugins.js +2 -2
- package/umd/five-react.js +2 -2
- package/umd/five-shader-lib.js +2 -2
- package/umd/five-sticker.js +3 -3
- package/umd/five-vfx.js +2 -2
- package/umd/five-vue.js +2 -2
- package/umd/five.js +39 -39
- package/vfx/index.js +2 -2
- package/vfx/index.mjs +2 -2
- package/vue/index.js +2 -2
- package/vue/index.mjs +2 -2
package/five/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five
|
|
4
|
-
* Generated: 2025/
|
|
5
|
-
* Version: 6.4.0-alpha.
|
|
4
|
+
* Generated: 2025/4/2
|
|
5
|
+
* Version: 6.4.0-alpha.28
|
|
6
6
|
* Terms:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
* Update: July 28, 2021
|
|
@@ -339,8 +339,8 @@
|
|
|
339
339
|
*
|
|
340
340
|
* https://code.google.com/p/crypto-js/wiki/License
|
|
341
341
|
* PART: ext/cryptojs
|
|
342
|
-
*/var ae={},Me=Me||function(n,t){var e={},r=e.lib={},i=r.Base=function(){function p(){}return{extend:function(A){p.prototype=this;var h=new p;return A&&h.mixIn(A),h.hasOwnProperty("init")||(h.init=function(){h.$super.init.apply(this,arguments)}),h.init.prototype=h,h.$super=this,h},create:function(){var A=this.extend();return A.init.apply(A,arguments),A},init:function(){},mixIn:function(A){for(var h in A)A.hasOwnProperty(h)&&(this[h]=A[h]);A.hasOwnProperty("toString")&&(this.toString=A.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),a=r.WordArray=i.extend({init:function(p,A){p=this.words=p||[],A!=t?this.sigBytes=A:this.sigBytes=p.length*4},toString:function(p){return(p||s).stringify(this)},concat:function(p){var A=this.words,h=p.words,v=this.sigBytes,g=p.sigBytes;if(this.clamp(),v%4)for(var m=0;m<g;m++){var y=h[m>>>2]>>>24-m%4*8&255;A[v+m>>>2]|=y<<24-(v+m)%4*8}else for(var m=0;m<g;m+=4)A[v+m>>>2]=h[m>>>2];return this.sigBytes+=g,this},clamp:function(){var p=this.words,A=this.sigBytes;p[A>>>2]&=4294967295<<32-A%4*8,p.length=n.ceil(A/4)},clone:function(){var p=i.clone.call(this);return p.words=this.words.slice(0),p},random:function(p){for(var A=[],h=0;h<p;h+=4)A.push(n.random()*4294967296|0);return new a.init(A,p)}}),o=e.enc={},s=o.Hex={stringify:function(p){for(var A=p.words,h=p.sigBytes,v=[],g=0;g<h;g++){var m=A[g>>>2]>>>24-g%4*8&255;v.push((m>>>4).toString(16)),v.push((m&15).toString(16))}return v.join("")},parse:function(p){for(var A=p.length,h=[],v=0;v<A;v+=2)h[v>>>3]|=parseInt(p.substr(v,2),16)<<24-v%8*4;return new a.init(h,A/2)}},u=o.Latin1={stringify:function(p){for(var A=p.words,h=p.sigBytes,v=[],g=0;g<h;g++){var m=A[g>>>2]>>>24-g%4*8&255;v.push(String.fromCharCode(m))}return v.join("")},parse:function(p){for(var A=p.length,h=[],v=0;v<A;v++)h[v>>>2]|=(p.charCodeAt(v)&255)<<24-v%4*8;return new a.init(h,A)}},l=o.Utf8={stringify:function(p){try{return decodeURIComponent(escape(u.stringify(p)))}catch(A){throw new Error("Malformed UTF-8 data")}},parse:function(p){return u.parse(unescape(encodeURIComponent(p)))}},c=r.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(p){typeof p=="string"&&(p=l.parse(p)),this._data.concat(p),this._nDataBytes+=p.sigBytes},_process:function(p){var A=this._data,h=A.words,v=A.sigBytes,g=this.blockSize,m=g*4,y=v/m;p?y=n.ceil(y):y=n.max((y|0)-this._minBufferSize,0);var b=y*g,x=n.min(b*4,v);if(b){for(var w=0;w<b;w+=g)this._doProcessBlock(h,w);var M=h.splice(0,b);A.sigBytes-=x}return new a.init(M,x)},clone:function(){var p=i.clone.call(this);return p._data=this._data.clone(),p},_minBufferSize:0});r.Hasher=c.extend({cfg:i.extend(),init:function(p){this.cfg=this.cfg.extend(p),this.reset()},reset:function(){c.reset.call(this),this._doReset()},update:function(p){return this._append(p),this._process(),this},finalize:function(p){p&&this._append(p);var A=this._doFinalize();return A},blockSize:512/32,_createHelper:function(p){return function(A,h){return new p.init(h).finalize(A)}},_createHmacHelper:function(p){return function(A,h){return new d.HMAC.init(p,h).finalize(A)}}});var d=e.algo={};return e}(Math);(function(n){for(var t=Me,A=t.lib,e=A.WordArray,r=A.Hasher,A=t.algo,i=[],a=[],o=function(v){return 4294967296*(v-(v|0))|0},s=2,u=0;64>u;){var l;e:{l=s;for(var c=n.sqrt(l),d=2;d<=c;d++)if(!(l%d)){l=!1;break e}l=!0}l&&(8>u&&(i[u]=o(n.pow(s,.5))),a[u]=o(n.pow(s,1/3)),u++),s++}var p=[],A=A.SHA256=r.extend({_doReset:function(){this._hash=new e.init(i.slice(0))},_doProcessBlock:function(h,v){for(var g=this._hash.words,m=g[0],y=g[1],b=g[2],x=g[3],w=g[4],M=g[5],S=g[6],E=g[7],P=0;64>P;P++){if(16>P)p[P]=h[v+P]|0;else{var B=p[P-15],C=p[P-2];p[P]=((B<<25|B>>>7)^(B<<14|B>>>18)^B>>>3)+p[P-7]+((C<<15|C>>>17)^(C<<13|C>>>19)^C>>>10)+p[P-16]}B=E+((w<<26|w>>>6)^(w<<21|w>>>11)^(w<<7|w>>>25))+(w&M^~w&S)+a[P]+p[P],C=((m<<30|m>>>2)^(m<<19|m>>>13)^(m<<10|m>>>22))+(m&y^m&b^y&b),E=S,S=M,M=w,w=x+B|0,x=b,b=y,y=m,m=B+C|0}g[0]=g[0]+m|0,g[1]=g[1]+y|0,g[2]=g[2]+b|0,g[3]=g[3]+x|0,g[4]=g[4]+w|0,g[5]=g[5]+M|0,g[6]=g[6]+S|0,g[7]=g[7]+E|0},_doFinalize:function(){var h=this._data,v=h.words,g=8*this._nDataBytes,m=8*h.sigBytes;return v[m>>>5]|=128<<24-m%32,v[(m+64>>>9<<4)+14]=n.floor(g/4294967296),v[(m+64>>>9<<4)+15]=g,h.sigBytes=4*v.length,this._process(),this._hash},clone:function(){var h=r.clone.call(this);return h._hash=this._hash.clone(),h}});t.SHA256=r._createHelper(A),t.HmacSHA256=r._createHmacHelper(A)})(Math);Me.lib.Cipher||function(n){var A=Me,t=A.lib,e=t.Base,r=t.WordArray,i=t.BufferedBlockAlgorithm,a=A.enc.Base64,o=A.algo.EvpKDF,s=t.Cipher=i.extend({cfg:e.extend(),createEncryptor:function(v,g){return this.create(this._ENC_XFORM_MODE,v,g)},createDecryptor:function(v,g){return this.create(this._DEC_XFORM_MODE,v,g)},init:function(v,g,m){this.cfg=this.cfg.extend(m),this._xformMode=v,this._key=g,this.reset()},reset:function(){i.reset.call(this),this._doReset()},process:function(v){return this._append(v),this._process()},finalize:function(v){return v&&this._append(v),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(v){return{encrypt:function(g,m,y){return(typeof m=="string"?h:p).encrypt(v,g,m,y)},decrypt:function(g,m,y){return(typeof m=="string"?h:p).decrypt(v,g,m,y)}}}});t.StreamCipher=s.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var d=A.mode={},u=function(v,g,m){var y=this._iv;y?this._iv=n:y=this._prevBlock;for(var b=0;b<m;b++)v[g+b]^=y[b]},l=(t.BlockCipherMode=e.extend({createEncryptor:function(v,g){return this.Encryptor.create(v,g)},createDecryptor:function(v,g){return this.Decryptor.create(v,g)},init:function(v,g){this._cipher=v,this._iv=g}})).extend();l.Encryptor=l.extend({processBlock:function(v,g){var m=this._cipher,y=m.blockSize;u.call(this,v,g,y),m.encryptBlock(v,g),this._prevBlock=v.slice(g,g+y)}}),l.Decryptor=l.extend({processBlock:function(v,g){var m=this._cipher,y=m.blockSize,b=v.slice(g,g+y);m.decryptBlock(v,g),u.call(this,v,g,y),this._prevBlock=b}}),d=d.CBC=l,l=(A.pad={}).Pkcs7={pad:function(v,g){for(var m=4*g,m=m-v.sigBytes%m,y=m<<24|m<<16|m<<8|m,b=[],x=0;x<m;x+=4)b.push(y);m=r.create(b,m),v.concat(m)},unpad:function(v){v.sigBytes-=v.words[v.sigBytes-1>>>2]&255}},t.BlockCipher=s.extend({cfg:s.cfg.extend({mode:d,padding:l}),reset:function(){s.reset.call(this);var g=this.cfg,v=g.iv,g=g.mode;if(this._xformMode==this._ENC_XFORM_MODE)var m=g.createEncryptor;else m=g.createDecryptor,this._minBufferSize=1;this._mode=m.call(g,this,v&&v.words)},_doProcessBlock:function(v,g){this._mode.processBlock(v,g)},_doFinalize:function(){var v=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){v.pad(this._data,this.blockSize);var g=this._process(!0)}else g=this._process(!0),v.unpad(g);return g},blockSize:4});var c=t.CipherParams=e.extend({init:function(v){this.mixIn(v)},toString:function(v){return(v||this.formatter).stringify(this)}}),d=(A.format={}).OpenSSL={stringify:function(v){var g=v.ciphertext;return v=v.salt,(v?r.create([1398893684,1701076831]).concat(v).concat(g):g).toString(a)},parse:function(v){v=a.parse(v);var g=v.words;if(g[0]==1398893684&&g[1]==1701076831){var m=r.create(g.slice(2,4));g.splice(0,4),v.sigBytes-=16}return c.create({ciphertext:v,salt:m})}},p=t.SerializableCipher=e.extend({cfg:e.extend({format:d}),encrypt:function(v,g,m,y){y=this.cfg.extend(y);var b=v.createEncryptor(m,y);return g=b.finalize(g),b=b.cfg,c.create({ciphertext:g,key:m,iv:b.iv,algorithm:v,mode:b.mode,padding:b.padding,blockSize:v.blockSize,formatter:y.format})},decrypt:function(v,g,m,y){return y=this.cfg.extend(y),g=this._parse(g,y.format),v.createDecryptor(m,y).finalize(g.ciphertext)},_parse:function(v,g){return typeof v=="string"?g.parse(v,this):v}}),A=(A.kdf={}).OpenSSL={execute:function(v,g,m,y){return y||(y=r.random(8)),v=o.create({keySize:g+m}).compute(v,y),m=r.create(v.words.slice(g),4*m),v.sigBytes=4*g,c.create({key:v,iv:m,salt:y})}},h=t.PasswordBasedCipher=p.extend({cfg:p.cfg.extend({kdf:A}),encrypt:function(v,g,m,y){return y=this.cfg.extend(y),m=y.kdf.execute(m,v.keySize,v.ivSize),y.iv=m.iv,v=p.encrypt.call(this,v,g,m.key,y),v.mixIn(m),v},decrypt:function(v,g,m,y){return y=this.cfg.extend(y),g=this._parse(g,y.format),m=y.kdf.execute(m,v.keySize,v.ivSize,g.salt),y.iv=m.iv,p.decrypt.call(this,v,g,m.key,y)}})}();(function(){for(var n=Me,t=n.lib.BlockCipher,M=n.algo,e=[],r=[],i=[],a=[],o=[],s=[],u=[],l=[],c=[],d=[],p=[],A=0;256>A;A++)p[A]=128>A?A<<1:A<<1^283;for(var h=0,v=0,A=0;256>A;A++){var g=v^v<<1^v<<2^v<<3^v<<4,g=g>>>8^g&255^99;e[h]=g,r[g]=h;var m=p[h],y=p[m],b=p[y],x=257*p[g]^16843008*g;i[h]=x<<24|x>>>8,a[h]=x<<16|x>>>16,o[h]=x<<8|x>>>24,s[h]=x,x=16843009*b^65537*y^257*m^16843008*h,u[g]=x<<24|x>>>8,l[g]=x<<16|x>>>16,c[g]=x<<8|x>>>24,d[g]=x,h?(h=m^p[p[p[b^m]]],v^=p[p[v]]):h=v=1}var w=[0,1,2,4,8,16,32,64,128,27,54],M=M.AES=t.extend({_doReset:function(){for(var P=this._key,S=P.words,E=P.sigBytes/4,P=4*((this._nRounds=E+6)+1),B=this._keySchedule=[],C=0;C<P;C++)if(C<E)B[C]=S[C];else{var I=B[C-1];C%E?6<E&&C%E==4&&(I=e[I>>>24]<<24|e[I>>>16&255]<<16|e[I>>>8&255]<<8|e[I&255]):(I=I<<8|I>>>24,I=e[I>>>24]<<24|e[I>>>16&255]<<16|e[I>>>8&255]<<8|e[I&255],I^=w[C/E|0]<<24),B[C]=B[C-E]^I}for(S=this._invKeySchedule=[],E=0;E<P;E++)C=P-E,I=E%4?B[C]:B[C-4],S[E]=4>E||4>=C?I:u[e[I>>>24]]^l[e[I>>>16&255]]^c[e[I>>>8&255]]^d[e[I&255]]},encryptBlock:function(S,E){this._doCryptBlock(S,E,this._keySchedule,i,a,o,s,e)},decryptBlock:function(S,E){var P=S[E+1];S[E+1]=S[E+3],S[E+3]=P,this._doCryptBlock(S,E,this._invKeySchedule,u,l,c,d,r),P=S[E+1],S[E+1]=S[E+3],S[E+3]=P},_doCryptBlock:function(S,E,P,B,C,I,F,T){for(var L=this._nRounds,K=S[E]^P[0],_=S[E+1]^P[1],J=S[E+2]^P[2],G=S[E+3]^P[3],D=4,V=1;V<L;V++)var z=B[K>>>24]^C[_>>>16&255]^I[J>>>8&255]^F[G&255]^P[D++],U=B[_>>>24]^C[J>>>16&255]^I[G>>>8&255]^F[K&255]^P[D++],q=B[J>>>24]^C[G>>>16&255]^I[K>>>8&255]^F[_&255]^P[D++],G=B[G>>>24]^C[K>>>16&255]^I[_>>>8&255]^F[J&255]^P[D++],K=z,_=U,J=q;z=(T[K>>>24]<<24|T[_>>>16&255]<<16|T[J>>>8&255]<<8|T[G&255])^P[D++],U=(T[_>>>24]<<24|T[J>>>16&255]<<16|T[G>>>8&255]<<8|T[K&255])^P[D++],q=(T[J>>>24]<<24|T[G>>>16&255]<<16|T[K>>>8&255]<<8|T[_&255])^P[D++],G=(T[G>>>24]<<24|T[K>>>16&255]<<16|T[_>>>8&255]<<8|T[J&255])^P[D++],S[E]=z,S[E+1]=U,S[E+2]=q,S[E+3]=G},keySize:8});n.AES=t._createHelper(M)})();/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
|
|
343
|
-
*/var fn;function he(n,t,e){n!=null&&(typeof n=="number"?this.fromNumber(n,t,e):t==null&&typeof n!="string"?this.fromString(n,256):this.fromString(n,t))}function ar(){return new he(null)}function uc(n,t,e,r,i,a){for(;--a>=0;){var o=t*this[n++]+e[r]+i;i=Math.floor(o/67108864),e[r++]=o&67108863}return i}function lc(n,t,e,r,i,a){for(var o=t&32767,s=t>>15;--a>=0;){var u=this[n]&32767,l=this[n++]>>15,c=s*u+l*o;u=o*u+((c&32767)<<15)+e[r]+(i&1073741823),i=(u>>>30)+(c>>>15)+s*l+(i>>>30),e[r++]=u&1073741823}return i}function cc(n,t,e,r,i,a){for(var o=t&16383,s=t>>14;--a>=0;){var u=this[n]&16383,l=this[n++]>>14,c=s*u+l*o;u=o*u+((c&16383)<<14)+e[r]+i,i=(u>>28)+(c>>14)+s*l,e[r++]=u&268435455}return i}typeof navigator!="undefined"&&navigator.appName=="Microsoft Internet Explorer"?(he.prototype.am=lc,fn=30):typeof navigator!="undefined"&&navigator.appName!="Netscape"?(he.prototype.am=uc,fn=26):(he.prototype.am=cc,fn=28);he.prototype.DB=fn;he.prototype.DM=(1<<fn)-1;he.prototype.DV=1<<fn;var Uo=52;he.prototype.FV=Math.pow(2,Uo);he.prototype.F1=Uo-fn;he.prototype.F2=2*fn-Uo;var fc="0123456789abcdefghijklmnopqrstuvwxyz",fa=new Array,jn,rr;jn=48;for(rr=0;rr<=9;++rr)fa[jn++]=rr;jn=97;for(rr=10;rr<36;++rr)fa[jn++]=rr;jn=65;for(rr=10;rr<36;++rr)fa[jn++]=rr;function Ur(n){return fc.charAt(n)}function dc(n,t){var e=fa[n.charCodeAt(t)];return e==null?-1:e}function hc(n){for(var t=this.t-1;t>=0;--t)n[t]=this[t];n.t=this.t,n.s=this.s}function pc(n){this.t=1,this.s=n<0?-1:0,n>0?this[0]=n:n<-1?this[0]=n+this.DV:this.t=0}function qo(n){var t=ar();return t.fromInt(n),t}function vc(n,t){var e;if(t==16)e=4;else if(t==8)e=3;else if(t==256)e=8;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else{this.fromRadix(n,t);return}this.t=0,this.s=0;for(var r=n.length,i=!1,a=0;--r>=0;){var o=e==8?n[r]&255:dc(n,r);if(o<0){n.charAt(r)=="-"&&(i=!0);continue}i=!1,a==0?this[this.t++]=o:a+e>this.DB?(this[this.t-1]|=(o&(1<<this.DB-a)-1)<<a,this[this.t++]=o>>this.DB-a):this[this.t-1]|=o<<a,a+=e,a>=this.DB&&(a-=this.DB)}e==8&&n[0]&128&&(this.s=-1,a>0&&(this[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&he.ZERO.subTo(this,this)}function mc(){for(var n=this.s&this.DM;this.t>0&&this[this.t-1]==n;)--this.t}function Ac(n){if(this.s<0)return"-"+this.negate().toString(n);var t;if(n==16)t=4;else if(n==8)t=3;else if(n==2)t=1;else if(n==32)t=5;else if(n==4)t=2;else return this.toRadix(n);var e=(1<<t)-1,r,i=!1,a="",o=this.t,s=this.DB-o*this.DB%t;if(o-- >0)for(s<this.DB&&(r=this[o]>>s)>0&&(i=!0,a=Ur(r));o>=0;)s<t?(r=(this[o]&(1<<s)-1)<<t-s,r|=this[--o]>>(s+=this.DB-t)):(r=this[o]>>(s-=t)&e,s<=0&&(s+=this.DB,--o)),r>0&&(i=!0),i&&(a+=Ur(r));return i?a:"0"}function gc(){var n=ar();return he.ZERO.subTo(this,n),n}function yc(){return this.s<0?this.negate():this}function bc(n){var t=this.s-n.s;if(t!=0)return t;var e=this.t;if(t=e-n.t,t!=0)return this.s<0?-t:t;for(;--e>=0;)if((t=this[e]-n[e])!=0)return t;return 0}function Ho(n){var t=1,e;return(e=n>>>16)!=0&&(n=e,t+=16),(e=n>>8)!=0&&(n=e,t+=8),(e=n>>4)!=0&&(n=e,t+=4),(e=n>>2)!=0&&(n=e,t+=2),(e=n>>1)!=0&&(n=e,t+=1),t}function xc(){return this.t<=0?0:this.DB*(this.t-1)+Ho(this[this.t-1]^this.s&this.DM)}function wc(n,t){var e;for(e=this.t-1;e>=0;--e)t[e+n]=this[e];for(e=n-1;e>=0;--e)t[e]=0;t.t=this.t+n,t.s=this.s}function Mc(n,t){for(var e=n;e<this.t;++e)t[e-n]=this[e];t.t=Math.max(this.t-n,0),t.s=this.s}function Sc(n,t){var e=n%this.DB,r=this.DB-e,i=(1<<r)-1,a=Math.floor(n/this.DB),o=this.s<<e&this.DM,s;for(s=this.t-1;s>=0;--s)t[s+a+1]=this[s]>>r|o,o=(this[s]&i)<<e;for(s=a-1;s>=0;--s)t[s]=0;t[a]=o,t.t=this.t+a+1,t.s=this.s,t.clamp()}function Cc(n,t){t.s=this.s;var e=Math.floor(n/this.DB);if(e>=this.t){t.t=0;return}var r=n%this.DB,i=this.DB-r,a=(1<<r)-1;t[0]=this[e]>>r;for(var o=e+1;o<this.t;++o)t[o-e-1]|=(this[o]&a)<<i,t[o-e]=this[o]>>r;r>0&&(t[this.t-e-1]|=(this.s&a)<<i),t.t=this.t-e,t.clamp()}function Ec(n,t){for(var e=0,r=0,i=Math.min(n.t,this.t);e<i;)r+=this[e]-n[e],t[e++]=r&this.DM,r>>=this.DB;if(n.t<this.t){for(r-=n.s;e<this.t;)r+=this[e],t[e++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;e<n.t;)r-=n[e],t[e++]=r&this.DM,r>>=this.DB;r-=n.s}t.s=r<0?-1:0,r<-1?t[e++]=this.DV+r:r>0&&(t[e++]=r),t.t=e,t.clamp()}function Ic(n,t){var e=this.abs(),r=n.abs(),i=e.t;for(t.t=i+r.t;--i>=0;)t[i]=0;for(i=0;i<r.t;++i)t[i+e.t]=e.am(0,r[i],t,i,0,e.t);t.s=0,t.clamp(),this.s!=n.s&&he.ZERO.subTo(t,t)}function Tc(n){for(var t=this.abs(),e=n.t=2*t.t;--e>=0;)n[e]=0;for(e=0;e<t.t-1;++e){var r=t.am(e,t[e],n,2*e,0,1);(n[e+t.t]+=t.am(e+1,2*t[e],n,2*e+1,r,t.t-e-1))>=t.DV&&(n[e+t.t]-=t.DV,n[e+t.t+1]=1)}n.t>0&&(n[n.t-1]+=t.am(e,t[e],n,2*e,0,1)),n.s=0,n.clamp()}function Pc(n,t,e){var r=n.abs();if(!(r.t<=0)){var i=this.abs();if(i.t<r.t){t!=null&&t.fromInt(0),e!=null&&this.copyTo(e);return}e==null&&(e=ar());var a=ar(),o=this.s,s=n.s,u=this.DB-Ho(r[r.t-1]);u>0?(r.lShiftTo(u,a),i.lShiftTo(u,e)):(r.copyTo(a),i.copyTo(e));var l=a.t,c=a[l-1];if(c!=0){var d=c*(1<<this.F1)+(l>1?a[l-2]>>this.F2:0),p=this.FV/d,A=(1<<this.F1)/d,h=1<<this.F2,v=e.t,g=v-l,m=t==null?ar():t;for(a.dlShiftTo(g,m),e.compareTo(m)>=0&&(e[e.t++]=1,e.subTo(m,e)),he.ONE.dlShiftTo(l,m),m.subTo(a,a);a.t<l;)a[a.t++]=0;for(;--g>=0;){var y=e[--v]==c?this.DM:Math.floor(e[v]*p+(e[v-1]+h)*A);if((e[v]+=a.am(0,y,e,g,0,l))<y)for(a.dlShiftTo(g,m),e.subTo(m,e);e[v]<--y;)e.subTo(m,e)}t!=null&&(e.drShiftTo(l,t),o!=s&&he.ZERO.subTo(t,t)),e.t=l,e.clamp(),u>0&&e.rShiftTo(u,e),o<0&&he.ZERO.subTo(e,e)}}}function Rc(n){var t=ar();return this.abs().divRemTo(n,null,t),this.s<0&&t.compareTo(he.ZERO)>0&&n.subTo(t,t),t}function _n(n){this.m=n}function Bc(n){return n.s<0||n.compareTo(this.m)>=0?n.mod(this.m):n}function Fc(n){return n}function Lc(n){n.divRemTo(this.m,null,n)}function kc(n,t,e){n.multiplyTo(t,e),this.reduce(e)}function Oc(n,t){n.squareTo(t),this.reduce(t)}_n.prototype.convert=Bc;_n.prototype.revert=Fc;_n.prototype.reduce=Lc;_n.prototype.mulTo=kc;_n.prototype.sqrTo=Oc;function Dc(){if(this.t<1)return 0;var n=this[0];if(!(n&1))return 0;var t=n&3;return t=t*(2-(n&15)*t)&15,t=t*(2-(n&255)*t)&255,t=t*(2-((n&65535)*t&65535))&65535,t=t*(2-n*t%this.DV)%this.DV,t>0?this.DV-t:-t}function Jn(n){this.m=n,this.mp=n.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<n.DB-15)-1,this.mt2=2*n.t}function Vc(n){var t=ar();return n.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),n.s<0&&t.compareTo(he.ZERO)>0&&this.m.subTo(t,t),t}function Nc(n){var t=ar();return n.copyTo(t),this.reduce(t),t}function zc(n){for(;n.t<=this.mt2;)n[n.t++]=0;for(var t=0;t<this.m.t;++t){var e=n[t]&32767,r=e*this.mpl+((e*this.mph+(n[t]>>15)*this.mpl&this.um)<<15)&n.DM;for(e=t+this.m.t,n[e]+=this.m.am(0,r,n,t,0,this.m.t);n[e]>=n.DV;)n[e]-=n.DV,n[++e]++}n.clamp(),n.drShiftTo(this.m.t,n),n.compareTo(this.m)>=0&&n.subTo(this.m,n)}function Qc(n,t){n.squareTo(t),this.reduce(t)}function Uc(n,t,e){n.multiplyTo(t,e),this.reduce(e)}Jn.prototype.convert=Vc;Jn.prototype.revert=Nc;Jn.prototype.reduce=zc;Jn.prototype.mulTo=Uc;Jn.prototype.sqrTo=Qc;function qc(){return(this.t>0?this[0]&1:this.s)==0}function Hc(n,t){if(n>4294967295||n<1)return he.ONE;var e=ar(),r=ar(),i=t.convert(this),a=Ho(n)-1;for(i.copyTo(e);--a>=0;)if(t.sqrTo(e,r),(n&1<<a)>0)t.mulTo(r,i,e);else{var o=e;e=r,r=o}return t.revert(e)}function Gc(n,t){var e;return n<256||t.isEven()?e=new _n(t):e=new Jn(t),this.exp(n,e)}he.prototype.copyTo=hc;he.prototype.fromInt=pc;he.prototype.fromString=vc;he.prototype.clamp=mc;he.prototype.dlShiftTo=wc;he.prototype.drShiftTo=Mc;he.prototype.lShiftTo=Sc;he.prototype.rShiftTo=Cc;he.prototype.subTo=Ec;he.prototype.multiplyTo=Ic;he.prototype.squareTo=Tc;he.prototype.divRemTo=Pc;he.prototype.invDigit=Dc;he.prototype.isEven=qc;he.prototype.exp=Hc;he.prototype.toString=Ac;he.prototype.negate=gc;he.prototype.abs=yc;he.prototype.compareTo=bc;he.prototype.bitLength=xc;he.prototype.mod=Rc;he.prototype.modPowInt=Gc;he.ZERO=qo(0);he.ONE=qo(1);/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function Kc(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function jc(n){return Math.floor(Math.LN2*this.DB/Math.log(n))}function _c(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function Jc(n){if(n==null&&(n=10),this.signum()==0||n<2||n>36)return"0";var t=this.chunkSize(n),e=Math.pow(n,t),r=qo(e),i=ar(),a=ar(),o="";for(this.divRemTo(r,i,a);i.signum()>0;)o=(e+a.intValue()).toString(n).substr(1)+o,i.divRemTo(r,i,a);return a.intValue().toString(n)+o}he.prototype.chunkSize=jc;he.prototype.toRadix=Jc;he.prototype.intValue=Kc;he.prototype.signum=_c;/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */var zn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ou="=";function Xc(n){var t,e,r="";for(t=0;t+3<=n.length;t+=3)e=parseInt(n.substring(t,t+3),16),r+=zn.charAt(e>>6)+zn.charAt(e&63);for(t+1==n.length?(e=parseInt(n.substring(t,t+1),16),r+=zn.charAt(e<<2)):t+2==n.length&&(e=parseInt(n.substring(t,t+2),16),r+=zn.charAt(e>>2)+zn.charAt((e&3)<<4));(r.length&3)>0;)r+=ou;return r}function Go(n){var t="",e,r=0,i,a;for(e=0;e<n.length&&n.charAt(e)!=ou;++e)a=zn.indexOf(n.charAt(e)),!(a<0)&&(r==0?(t+=Ur(a>>2),i=a&3,r=1):r==1?(t+=Ur(i<<2|a>>4),i=a&15,r=2):r==2?(t+=Ur(i),t+=Ur(a>>2),i=a&3,r=3):(t+=Ur(i<<2|a>>4),t+=Ur(a&15),r=0));return r==1&&(t+=Ur(i<<2)),t}/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function Qt(n,t){return new he(n,t)}function Wc(n,t){if(t<n.length+11)throw"Message too long for RSA";for(var e=new Array,r=n.length-1;r>=0&&t>0;){var i=n.charCodeAt(r--);i<128?e[--t]=i:i>127&&i<2048?(e[--t]=i&63|128,e[--t]=i>>6|192):(e[--t]=i&63|128,e[--t]=i>>6&63|128,e[--t]=i>>12|224)}e[--t]=0;for(var a=new SecureRandom,o=new Array;t>2;){for(o[0]=0;o[0]==0;)a.nextBytes(o);e[--t]=o[0]}return e[--t]=2,e[--t]=0,new he(e)}function Cs(n,t,e){for(var r="",i=0;r.length<t;)r+=e(String.fromCharCode.apply(String,n.concat([(i&4278190080)>>24,(i&16711680)>>16,(i&65280)>>8,i&255]))),i+=1;return r}function Zc(n,t,e,r){var i=ae.crypto.MessageDigest,a=ae.crypto.Util,o=null;if(e||(e="sha1"),typeof e=="string"&&(o=i.getCanonicalAlgName(e),r=i.getHashLength(o),e=function(v){return Hr(a.hashHex(da(v),o))}),n.length+2*r+2>t)throw"Message too long for RSA";var s="",u;for(u=0;u<t-n.length-2*r-2;u+=1)s+="\0";var l=e("")+s+""+n,c=new Array(r);new SecureRandom().nextBytes(c);var d=Cs(c,l.length,e),p=[];for(u=0;u<l.length;u+=1)p[u]=l.charCodeAt(u)^d.charCodeAt(u);var A=Cs(p,c.length,e),h=[0];for(u=0;u<c.length;u+=1)h[u+1]=c[u]^A.charCodeAt(u);return new he(h.concat(p))}function Ve(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}function Yc(n,t){if(this.isPublic=!0,this.isPrivate=!1,typeof n!="string")this.n=n,this.e=t;else if(n!=null&&t!=null&&n.length>0&&t.length>0)this.n=Qt(n,16),this.e=parseInt(t,16);else throw"Invalid RSA public key"}function $c(n){return n.modPowInt(this.e,this.n)}function ef(n){var t=Wc(n,this.n.bitLength()+7>>3);if(t==null)return null;var e=this.doPublic(t);if(e==null)return null;var r=e.toString(16);return r.length&1?"0"+r:r}function tf(n,t,e){var r=Zc(n,this.n.bitLength()+7>>3,t,e);if(r==null)return null;var i=this.doPublic(r);if(i==null)return null;var a=i.toString(16);return a.length&1?"0"+a:a}Ve.prototype.doPublic=$c;Ve.prototype.setPublic=Yc;Ve.prototype.encrypt=ef;Ve.prototype.encryptOAEP=tf;Ve.prototype.type="RSA";/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function rf(n,t){for(var e=n.toByteArray(),r=0;r<e.length&&e[r]==0;)++r;if(e.length-r!=t-1||e[r]!=2)return null;for(++r;e[r]!=0;)if(++r>=e.length)return null;for(var i="";++r<e.length;){var a=e[r]&255;a<128?i+=String.fromCharCode(a):a>191&&a<224?(i+=String.fromCharCode((a&31)<<6|e[r+1]&63),++r):(i+=String.fromCharCode((a&15)<<12|(e[r+1]&63)<<6|e[r+2]&63),r+=2)}return i}function Es(n,t,e){for(var r="",i=0;r.length<t;)r+=e(n+String.fromCharCode.apply(String,[(i&4278190080)>>24,(i&16711680)>>16,(i&65280)>>8,i&255])),i+=1;return r}function nf(n,t,e,r){var i=ae.crypto.MessageDigest,a=ae.crypto.Util,o=null;e||(e="sha1"),typeof e=="string"&&(o=i.getCanonicalAlgName(e),r=i.getHashLength(o),e=function(g){return Hr(a.hashHex(da(g),o))}),n=n.toByteArray();var d;for(d=0;d<n.length;d+=1)n[d]&=255;for(;n.length<t;)n.unshift(0);if(n=String.fromCharCode.apply(String,n),n.length<2*r+2)throw"Cipher too short";var s=n.substr(1,r),u=n.substr(r+1),l=Es(u,r,e),c=[],d;for(d=0;d<s.length;d+=1)c[d]=s.charCodeAt(d)^l.charCodeAt(d);var p=Es(String.fromCharCode.apply(String,c),n.length-r,e),A=[];for(d=0;d<u.length;d+=1)A[d]=u.charCodeAt(d)^p.charCodeAt(d);if(A=String.fromCharCode.apply(String,A),A.substr(0,r)!==e(""))throw"Hash mismatch";A=A.substr(r);var h=A.indexOf(""),v=h!=-1?A.substr(0,h).lastIndexOf("\0"):-1;if(v+1!=h)throw"Malformed data";return A.substr(h+1)}function af(n,t,e){if(this.isPrivate=!0,typeof n!="string")this.n=n,this.e=t,this.d=e;else if(n!=null&&t!=null&&n.length>0&&t.length>0)this.n=Qt(n,16),this.e=parseInt(t,16),this.d=Qt(e,16);else throw"Invalid RSA private key"}function of(n,t,e,r,i,a,o,s){if(this.isPrivate=!0,this.isPublic=!1,n==null)throw"RSASetPrivateEx N == null";if(t==null)throw"RSASetPrivateEx E == null";if(n.length==0)throw"RSASetPrivateEx N.length == 0";if(t.length==0)throw"RSASetPrivateEx E.length == 0";if(n!=null&&t!=null&&n.length>0&&t.length>0)this.n=Qt(n,16),this.e=parseInt(t,16),this.d=Qt(e,16),this.p=Qt(r,16),this.q=Qt(i,16),this.dmp1=Qt(a,16),this.dmq1=Qt(o,16),this.coeff=Qt(s,16);else throw"Invalid RSA private key in RSASetPrivateEx"}function sf(n){if(this.p==null||this.q==null)return n.modPow(this.d,this.n);for(var t=n.mod(this.p).modPow(this.dmp1,this.p),e=n.mod(this.q).modPow(this.dmq1,this.q);t.compareTo(e)<0;)t=t.add(this.p);return t.subtract(e).multiply(this.coeff).mod(this.p).multiply(this.q).add(e)}function uf(n){if(n.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var t=Qt(n,16),e=this.doPrivate(t);return e==null?null:rf(e,this.n.bitLength()+7>>3)}function lf(n,t,e){if(n.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var r=Qt(n,16),i=this.doPrivate(r);return i==null?null:nf(i,this.n.bitLength()+7>>3,t,e)}Ve.prototype.doPrivate=sf;Ve.prototype.setPrivate=af;Ve.prototype.setPrivateEx=of;Ve.prototype.decrypt=uf;Ve.prototype.decryptOAEP=lf;(typeof ae.lang=="undefined"||!ae.lang)&&(ae.lang={});ae.lang.String=function(){};function cf(n){return n.length%4==2?n=n+"==":n.length%4==3&&(n=n+"="),n=n.replace(/-/g,"+"),n=n.replace(/_/g,"/"),n}function lt(n){return Go(cf(n))}function Tr(n){return decodeURIComponent(vf(n))}function Hr(n){for(var t="",e=0;e<n.length-1;e+=2)t+=String.fromCharCode(parseInt(n.substr(e,2),16));return t}function da(n){for(var t="",e=0;e<n.length;e++)t+=("0"+n.charCodeAt(e).toString(16)).slice(-2);return t}function ff(n){return Xc(n)}function df(n){var t=ff(n),e=t.replace(/(.{64})/g,`$1\r
|
|
342
|
+
*/var ae={},Me=Me||function(n,t){var e={},r=e.lib={},i=r.Base=function(){function p(){}return{extend:function(A){p.prototype=this;var h=new p;return A&&h.mixIn(A),h.hasOwnProperty("init")||(h.init=function(){h.$super.init.apply(this,arguments)}),h.init.prototype=h,h.$super=this,h},create:function(){var A=this.extend();return A.init.apply(A,arguments),A},init:function(){},mixIn:function(A){for(var h in A)A.hasOwnProperty(h)&&(this[h]=A[h]);A.hasOwnProperty("toString")&&(this.toString=A.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),a=r.WordArray=i.extend({init:function(p,A){p=this.words=p||[],A!=t?this.sigBytes=A:this.sigBytes=p.length*4},toString:function(p){return(p||s).stringify(this)},concat:function(p){var A=this.words,h=p.words,v=this.sigBytes,g=p.sigBytes;if(this.clamp(),v%4)for(var m=0;m<g;m++){var y=h[m>>>2]>>>24-m%4*8&255;A[v+m>>>2]|=y<<24-(v+m)%4*8}else for(var m=0;m<g;m+=4)A[v+m>>>2]=h[m>>>2];return this.sigBytes+=g,this},clamp:function(){var p=this.words,A=this.sigBytes;p[A>>>2]&=4294967295<<32-A%4*8,p.length=n.ceil(A/4)},clone:function(){var p=i.clone.call(this);return p.words=this.words.slice(0),p},random:function(p){for(var A=[],h=0;h<p;h+=4)A.push(n.random()*4294967296|0);return new a.init(A,p)}}),o=e.enc={},s=o.Hex={stringify:function(p){for(var A=p.words,h=p.sigBytes,v=[],g=0;g<h;g++){var m=A[g>>>2]>>>24-g%4*8&255;v.push((m>>>4).toString(16)),v.push((m&15).toString(16))}return v.join("")},parse:function(p){for(var A=p.length,h=[],v=0;v<A;v+=2)h[v>>>3]|=parseInt(p.substr(v,2),16)<<24-v%8*4;return new a.init(h,A/2)}},u=o.Latin1={stringify:function(p){for(var A=p.words,h=p.sigBytes,v=[],g=0;g<h;g++){var m=A[g>>>2]>>>24-g%4*8&255;v.push(String.fromCharCode(m))}return v.join("")},parse:function(p){for(var A=p.length,h=[],v=0;v<A;v++)h[v>>>2]|=(p.charCodeAt(v)&255)<<24-v%4*8;return new a.init(h,A)}},l=o.Utf8={stringify:function(p){try{return decodeURIComponent(escape(u.stringify(p)))}catch(A){throw new Error("Malformed UTF-8 data")}},parse:function(p){return u.parse(unescape(encodeURIComponent(p)))}},c=r.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(p){typeof p=="string"&&(p=l.parse(p)),this._data.concat(p),this._nDataBytes+=p.sigBytes},_process:function(p){var A=this._data,h=A.words,v=A.sigBytes,g=this.blockSize,m=g*4,y=v/m;p?y=n.ceil(y):y=n.max((y|0)-this._minBufferSize,0);var b=y*g,x=n.min(b*4,v);if(b){for(var w=0;w<b;w+=g)this._doProcessBlock(h,w);var M=h.splice(0,b);A.sigBytes-=x}return new a.init(M,x)},clone:function(){var p=i.clone.call(this);return p._data=this._data.clone(),p},_minBufferSize:0});r.Hasher=c.extend({cfg:i.extend(),init:function(p){this.cfg=this.cfg.extend(p),this.reset()},reset:function(){c.reset.call(this),this._doReset()},update:function(p){return this._append(p),this._process(),this},finalize:function(p){p&&this._append(p);var A=this._doFinalize();return A},blockSize:512/32,_createHelper:function(p){return function(A,h){return new p.init(h).finalize(A)}},_createHmacHelper:function(p){return function(A,h){return new d.HMAC.init(p,h).finalize(A)}}});var d=e.algo={};return e}(Math);(function(n){for(var t=Me,A=t.lib,e=A.WordArray,r=A.Hasher,A=t.algo,i=[],a=[],o=function(v){return 4294967296*(v-(v|0))|0},s=2,u=0;64>u;){var l;e:{l=s;for(var c=n.sqrt(l),d=2;d<=c;d++)if(!(l%d)){l=!1;break e}l=!0}l&&(8>u&&(i[u]=o(n.pow(s,.5))),a[u]=o(n.pow(s,1/3)),u++),s++}var p=[],A=A.SHA256=r.extend({_doReset:function(){this._hash=new e.init(i.slice(0))},_doProcessBlock:function(h,v){for(var g=this._hash.words,m=g[0],y=g[1],b=g[2],x=g[3],w=g[4],M=g[5],S=g[6],E=g[7],B=0;64>B;B++){if(16>B)p[B]=h[v+B]|0;else{var R=p[B-15],C=p[B-2];p[B]=((R<<25|R>>>7)^(R<<14|R>>>18)^R>>>3)+p[B-7]+((C<<15|C>>>17)^(C<<13|C>>>19)^C>>>10)+p[B-16]}R=E+((w<<26|w>>>6)^(w<<21|w>>>11)^(w<<7|w>>>25))+(w&M^~w&S)+a[B]+p[B],C=((m<<30|m>>>2)^(m<<19|m>>>13)^(m<<10|m>>>22))+(m&y^m&b^y&b),E=S,S=M,M=w,w=x+R|0,x=b,b=y,y=m,m=R+C|0}g[0]=g[0]+m|0,g[1]=g[1]+y|0,g[2]=g[2]+b|0,g[3]=g[3]+x|0,g[4]=g[4]+w|0,g[5]=g[5]+M|0,g[6]=g[6]+S|0,g[7]=g[7]+E|0},_doFinalize:function(){var h=this._data,v=h.words,g=8*this._nDataBytes,m=8*h.sigBytes;return v[m>>>5]|=128<<24-m%32,v[(m+64>>>9<<4)+14]=n.floor(g/4294967296),v[(m+64>>>9<<4)+15]=g,h.sigBytes=4*v.length,this._process(),this._hash},clone:function(){var h=r.clone.call(this);return h._hash=this._hash.clone(),h}});t.SHA256=r._createHelper(A),t.HmacSHA256=r._createHmacHelper(A)})(Math);Me.lib.Cipher||function(n){var A=Me,t=A.lib,e=t.Base,r=t.WordArray,i=t.BufferedBlockAlgorithm,a=A.enc.Base64,o=A.algo.EvpKDF,s=t.Cipher=i.extend({cfg:e.extend(),createEncryptor:function(v,g){return this.create(this._ENC_XFORM_MODE,v,g)},createDecryptor:function(v,g){return this.create(this._DEC_XFORM_MODE,v,g)},init:function(v,g,m){this.cfg=this.cfg.extend(m),this._xformMode=v,this._key=g,this.reset()},reset:function(){i.reset.call(this),this._doReset()},process:function(v){return this._append(v),this._process()},finalize:function(v){return v&&this._append(v),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(v){return{encrypt:function(g,m,y){return(typeof m=="string"?h:p).encrypt(v,g,m,y)},decrypt:function(g,m,y){return(typeof m=="string"?h:p).decrypt(v,g,m,y)}}}});t.StreamCipher=s.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var d=A.mode={},u=function(v,g,m){var y=this._iv;y?this._iv=n:y=this._prevBlock;for(var b=0;b<m;b++)v[g+b]^=y[b]},l=(t.BlockCipherMode=e.extend({createEncryptor:function(v,g){return this.Encryptor.create(v,g)},createDecryptor:function(v,g){return this.Decryptor.create(v,g)},init:function(v,g){this._cipher=v,this._iv=g}})).extend();l.Encryptor=l.extend({processBlock:function(v,g){var m=this._cipher,y=m.blockSize;u.call(this,v,g,y),m.encryptBlock(v,g),this._prevBlock=v.slice(g,g+y)}}),l.Decryptor=l.extend({processBlock:function(v,g){var m=this._cipher,y=m.blockSize,b=v.slice(g,g+y);m.decryptBlock(v,g),u.call(this,v,g,y),this._prevBlock=b}}),d=d.CBC=l,l=(A.pad={}).Pkcs7={pad:function(v,g){for(var m=4*g,m=m-v.sigBytes%m,y=m<<24|m<<16|m<<8|m,b=[],x=0;x<m;x+=4)b.push(y);m=r.create(b,m),v.concat(m)},unpad:function(v){v.sigBytes-=v.words[v.sigBytes-1>>>2]&255}},t.BlockCipher=s.extend({cfg:s.cfg.extend({mode:d,padding:l}),reset:function(){s.reset.call(this);var g=this.cfg,v=g.iv,g=g.mode;if(this._xformMode==this._ENC_XFORM_MODE)var m=g.createEncryptor;else m=g.createDecryptor,this._minBufferSize=1;this._mode=m.call(g,this,v&&v.words)},_doProcessBlock:function(v,g){this._mode.processBlock(v,g)},_doFinalize:function(){var v=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){v.pad(this._data,this.blockSize);var g=this._process(!0)}else g=this._process(!0),v.unpad(g);return g},blockSize:4});var c=t.CipherParams=e.extend({init:function(v){this.mixIn(v)},toString:function(v){return(v||this.formatter).stringify(this)}}),d=(A.format={}).OpenSSL={stringify:function(v){var g=v.ciphertext;return v=v.salt,(v?r.create([1398893684,1701076831]).concat(v).concat(g):g).toString(a)},parse:function(v){v=a.parse(v);var g=v.words;if(g[0]==1398893684&&g[1]==1701076831){var m=r.create(g.slice(2,4));g.splice(0,4),v.sigBytes-=16}return c.create({ciphertext:v,salt:m})}},p=t.SerializableCipher=e.extend({cfg:e.extend({format:d}),encrypt:function(v,g,m,y){y=this.cfg.extend(y);var b=v.createEncryptor(m,y);return g=b.finalize(g),b=b.cfg,c.create({ciphertext:g,key:m,iv:b.iv,algorithm:v,mode:b.mode,padding:b.padding,blockSize:v.blockSize,formatter:y.format})},decrypt:function(v,g,m,y){return y=this.cfg.extend(y),g=this._parse(g,y.format),v.createDecryptor(m,y).finalize(g.ciphertext)},_parse:function(v,g){return typeof v=="string"?g.parse(v,this):v}}),A=(A.kdf={}).OpenSSL={execute:function(v,g,m,y){return y||(y=r.random(8)),v=o.create({keySize:g+m}).compute(v,y),m=r.create(v.words.slice(g),4*m),v.sigBytes=4*g,c.create({key:v,iv:m,salt:y})}},h=t.PasswordBasedCipher=p.extend({cfg:p.cfg.extend({kdf:A}),encrypt:function(v,g,m,y){return y=this.cfg.extend(y),m=y.kdf.execute(m,v.keySize,v.ivSize),y.iv=m.iv,v=p.encrypt.call(this,v,g,m.key,y),v.mixIn(m),v},decrypt:function(v,g,m,y){return y=this.cfg.extend(y),g=this._parse(g,y.format),m=y.kdf.execute(m,v.keySize,v.ivSize,g.salt),y.iv=m.iv,p.decrypt.call(this,v,g,m.key,y)}})}();(function(){for(var n=Me,t=n.lib.BlockCipher,M=n.algo,e=[],r=[],i=[],a=[],o=[],s=[],u=[],l=[],c=[],d=[],p=[],A=0;256>A;A++)p[A]=128>A?A<<1:A<<1^283;for(var h=0,v=0,A=0;256>A;A++){var g=v^v<<1^v<<2^v<<3^v<<4,g=g>>>8^g&255^99;e[h]=g,r[g]=h;var m=p[h],y=p[m],b=p[y],x=257*p[g]^16843008*g;i[h]=x<<24|x>>>8,a[h]=x<<16|x>>>16,o[h]=x<<8|x>>>24,s[h]=x,x=16843009*b^65537*y^257*m^16843008*h,u[g]=x<<24|x>>>8,l[g]=x<<16|x>>>16,c[g]=x<<8|x>>>24,d[g]=x,h?(h=m^p[p[p[b^m]]],v^=p[p[v]]):h=v=1}var w=[0,1,2,4,8,16,32,64,128,27,54],M=M.AES=t.extend({_doReset:function(){for(var B=this._key,S=B.words,E=B.sigBytes/4,B=4*((this._nRounds=E+6)+1),R=this._keySchedule=[],C=0;C<B;C++)if(C<E)R[C]=S[C];else{var I=R[C-1];C%E?6<E&&C%E==4&&(I=e[I>>>24]<<24|e[I>>>16&255]<<16|e[I>>>8&255]<<8|e[I&255]):(I=I<<8|I>>>24,I=e[I>>>24]<<24|e[I>>>16&255]<<16|e[I>>>8&255]<<8|e[I&255],I^=w[C/E|0]<<24),R[C]=R[C-E]^I}for(S=this._invKeySchedule=[],E=0;E<B;E++)C=B-E,I=E%4?R[C]:R[C-4],S[E]=4>E||4>=C?I:u[e[I>>>24]]^l[e[I>>>16&255]]^c[e[I>>>8&255]]^d[e[I&255]]},encryptBlock:function(S,E){this._doCryptBlock(S,E,this._keySchedule,i,a,o,s,e)},decryptBlock:function(S,E){var B=S[E+1];S[E+1]=S[E+3],S[E+3]=B,this._doCryptBlock(S,E,this._invKeySchedule,u,l,c,d,r),B=S[E+1],S[E+1]=S[E+3],S[E+3]=B},_doCryptBlock:function(S,E,B,R,C,I,L,T){for(var F=this._nRounds,K=S[E]^B[0],j=S[E+1]^B[1],J=S[E+2]^B[2],G=S[E+3]^B[3],D=4,V=1;V<F;V++)var z=R[K>>>24]^C[j>>>16&255]^I[J>>>8&255]^L[G&255]^B[D++],U=R[j>>>24]^C[J>>>16&255]^I[G>>>8&255]^L[K&255]^B[D++],q=R[J>>>24]^C[G>>>16&255]^I[K>>>8&255]^L[j&255]^B[D++],G=R[G>>>24]^C[K>>>16&255]^I[j>>>8&255]^L[J&255]^B[D++],K=z,j=U,J=q;z=(T[K>>>24]<<24|T[j>>>16&255]<<16|T[J>>>8&255]<<8|T[G&255])^B[D++],U=(T[j>>>24]<<24|T[J>>>16&255]<<16|T[G>>>8&255]<<8|T[K&255])^B[D++],q=(T[J>>>24]<<24|T[G>>>16&255]<<16|T[K>>>8&255]<<8|T[j&255])^B[D++],G=(T[G>>>24]<<24|T[K>>>16&255]<<16|T[j>>>8&255]<<8|T[J&255])^B[D++],S[E]=z,S[E+1]=U,S[E+2]=q,S[E+3]=G},keySize:8});n.AES=t._createHelper(M)})();/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
|
|
343
|
+
*/var fn;function he(n,t,e){n!=null&&(typeof n=="number"?this.fromNumber(n,t,e):t==null&&typeof n!="string"?this.fromString(n,256):this.fromString(n,t))}function ir(){return new he(null)}function uc(n,t,e,r,i,a){for(;--a>=0;){var o=t*this[n++]+e[r]+i;i=Math.floor(o/67108864),e[r++]=o&67108863}return i}function lc(n,t,e,r,i,a){for(var o=t&32767,s=t>>15;--a>=0;){var u=this[n]&32767,l=this[n++]>>15,c=s*u+l*o;u=o*u+((c&32767)<<15)+e[r]+(i&1073741823),i=(u>>>30)+(c>>>15)+s*l+(i>>>30),e[r++]=u&1073741823}return i}function cc(n,t,e,r,i,a){for(var o=t&16383,s=t>>14;--a>=0;){var u=this[n]&16383,l=this[n++]>>14,c=s*u+l*o;u=o*u+((c&16383)<<14)+e[r]+i,i=(u>>28)+(c>>14)+s*l,e[r++]=u&268435455}return i}typeof navigator!="undefined"&&navigator.appName=="Microsoft Internet Explorer"?(he.prototype.am=lc,fn=30):typeof navigator!="undefined"&&navigator.appName!="Netscape"?(he.prototype.am=uc,fn=26):(he.prototype.am=cc,fn=28);he.prototype.DB=fn;he.prototype.DM=(1<<fn)-1;he.prototype.DV=1<<fn;var Uo=52;he.prototype.FV=Math.pow(2,Uo);he.prototype.F1=Uo-fn;he.prototype.F2=2*fn-Uo;var fc="0123456789abcdefghijklmnopqrstuvwxyz",fa=new Array,_n,rr;_n=48;for(rr=0;rr<=9;++rr)fa[_n++]=rr;_n=97;for(rr=10;rr<36;++rr)fa[_n++]=rr;_n=65;for(rr=10;rr<36;++rr)fa[_n++]=rr;function Ur(n){return fc.charAt(n)}function dc(n,t){var e=fa[n.charCodeAt(t)];return e==null?-1:e}function hc(n){for(var t=this.t-1;t>=0;--t)n[t]=this[t];n.t=this.t,n.s=this.s}function pc(n){this.t=1,this.s=n<0?-1:0,n>0?this[0]=n:n<-1?this[0]=n+this.DV:this.t=0}function qo(n){var t=ir();return t.fromInt(n),t}function vc(n,t){var e;if(t==16)e=4;else if(t==8)e=3;else if(t==256)e=8;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else{this.fromRadix(n,t);return}this.t=0,this.s=0;for(var r=n.length,i=!1,a=0;--r>=0;){var o=e==8?n[r]&255:dc(n,r);if(o<0){n.charAt(r)=="-"&&(i=!0);continue}i=!1,a==0?this[this.t++]=o:a+e>this.DB?(this[this.t-1]|=(o&(1<<this.DB-a)-1)<<a,this[this.t++]=o>>this.DB-a):this[this.t-1]|=o<<a,a+=e,a>=this.DB&&(a-=this.DB)}e==8&&n[0]&128&&(this.s=-1,a>0&&(this[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&he.ZERO.subTo(this,this)}function mc(){for(var n=this.s&this.DM;this.t>0&&this[this.t-1]==n;)--this.t}function Ac(n){if(this.s<0)return"-"+this.negate().toString(n);var t;if(n==16)t=4;else if(n==8)t=3;else if(n==2)t=1;else if(n==32)t=5;else if(n==4)t=2;else return this.toRadix(n);var e=(1<<t)-1,r,i=!1,a="",o=this.t,s=this.DB-o*this.DB%t;if(o-- >0)for(s<this.DB&&(r=this[o]>>s)>0&&(i=!0,a=Ur(r));o>=0;)s<t?(r=(this[o]&(1<<s)-1)<<t-s,r|=this[--o]>>(s+=this.DB-t)):(r=this[o]>>(s-=t)&e,s<=0&&(s+=this.DB,--o)),r>0&&(i=!0),i&&(a+=Ur(r));return i?a:"0"}function gc(){var n=ir();return he.ZERO.subTo(this,n),n}function yc(){return this.s<0?this.negate():this}function bc(n){var t=this.s-n.s;if(t!=0)return t;var e=this.t;if(t=e-n.t,t!=0)return this.s<0?-t:t;for(;--e>=0;)if((t=this[e]-n[e])!=0)return t;return 0}function Ho(n){var t=1,e;return(e=n>>>16)!=0&&(n=e,t+=16),(e=n>>8)!=0&&(n=e,t+=8),(e=n>>4)!=0&&(n=e,t+=4),(e=n>>2)!=0&&(n=e,t+=2),(e=n>>1)!=0&&(n=e,t+=1),t}function xc(){return this.t<=0?0:this.DB*(this.t-1)+Ho(this[this.t-1]^this.s&this.DM)}function wc(n,t){var e;for(e=this.t-1;e>=0;--e)t[e+n]=this[e];for(e=n-1;e>=0;--e)t[e]=0;t.t=this.t+n,t.s=this.s}function Mc(n,t){for(var e=n;e<this.t;++e)t[e-n]=this[e];t.t=Math.max(this.t-n,0),t.s=this.s}function Sc(n,t){var e=n%this.DB,r=this.DB-e,i=(1<<r)-1,a=Math.floor(n/this.DB),o=this.s<<e&this.DM,s;for(s=this.t-1;s>=0;--s)t[s+a+1]=this[s]>>r|o,o=(this[s]&i)<<e;for(s=a-1;s>=0;--s)t[s]=0;t[a]=o,t.t=this.t+a+1,t.s=this.s,t.clamp()}function Cc(n,t){t.s=this.s;var e=Math.floor(n/this.DB);if(e>=this.t){t.t=0;return}var r=n%this.DB,i=this.DB-r,a=(1<<r)-1;t[0]=this[e]>>r;for(var o=e+1;o<this.t;++o)t[o-e-1]|=(this[o]&a)<<i,t[o-e]=this[o]>>r;r>0&&(t[this.t-e-1]|=(this.s&a)<<i),t.t=this.t-e,t.clamp()}function Ec(n,t){for(var e=0,r=0,i=Math.min(n.t,this.t);e<i;)r+=this[e]-n[e],t[e++]=r&this.DM,r>>=this.DB;if(n.t<this.t){for(r-=n.s;e<this.t;)r+=this[e],t[e++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;e<n.t;)r-=n[e],t[e++]=r&this.DM,r>>=this.DB;r-=n.s}t.s=r<0?-1:0,r<-1?t[e++]=this.DV+r:r>0&&(t[e++]=r),t.t=e,t.clamp()}function Ic(n,t){var e=this.abs(),r=n.abs(),i=e.t;for(t.t=i+r.t;--i>=0;)t[i]=0;for(i=0;i<r.t;++i)t[i+e.t]=e.am(0,r[i],t,i,0,e.t);t.s=0,t.clamp(),this.s!=n.s&&he.ZERO.subTo(t,t)}function Tc(n){for(var t=this.abs(),e=n.t=2*t.t;--e>=0;)n[e]=0;for(e=0;e<t.t-1;++e){var r=t.am(e,t[e],n,2*e,0,1);(n[e+t.t]+=t.am(e+1,2*t[e],n,2*e+1,r,t.t-e-1))>=t.DV&&(n[e+t.t]-=t.DV,n[e+t.t+1]=1)}n.t>0&&(n[n.t-1]+=t.am(e,t[e],n,2*e,0,1)),n.s=0,n.clamp()}function Pc(n,t,e){var r=n.abs();if(!(r.t<=0)){var i=this.abs();if(i.t<r.t){t!=null&&t.fromInt(0),e!=null&&this.copyTo(e);return}e==null&&(e=ir());var a=ir(),o=this.s,s=n.s,u=this.DB-Ho(r[r.t-1]);u>0?(r.lShiftTo(u,a),i.lShiftTo(u,e)):(r.copyTo(a),i.copyTo(e));var l=a.t,c=a[l-1];if(c!=0){var d=c*(1<<this.F1)+(l>1?a[l-2]>>this.F2:0),p=this.FV/d,A=(1<<this.F1)/d,h=1<<this.F2,v=e.t,g=v-l,m=t==null?ir():t;for(a.dlShiftTo(g,m),e.compareTo(m)>=0&&(e[e.t++]=1,e.subTo(m,e)),he.ONE.dlShiftTo(l,m),m.subTo(a,a);a.t<l;)a[a.t++]=0;for(;--g>=0;){var y=e[--v]==c?this.DM:Math.floor(e[v]*p+(e[v-1]+h)*A);if((e[v]+=a.am(0,y,e,g,0,l))<y)for(a.dlShiftTo(g,m),e.subTo(m,e);e[v]<--y;)e.subTo(m,e)}t!=null&&(e.drShiftTo(l,t),o!=s&&he.ZERO.subTo(t,t)),e.t=l,e.clamp(),u>0&&e.rShiftTo(u,e),o<0&&he.ZERO.subTo(e,e)}}}function Rc(n){var t=ir();return this.abs().divRemTo(n,null,t),this.s<0&&t.compareTo(he.ZERO)>0&&n.subTo(t,t),t}function jn(n){this.m=n}function Bc(n){return n.s<0||n.compareTo(this.m)>=0?n.mod(this.m):n}function Fc(n){return n}function Lc(n){n.divRemTo(this.m,null,n)}function kc(n,t,e){n.multiplyTo(t,e),this.reduce(e)}function Oc(n,t){n.squareTo(t),this.reduce(t)}jn.prototype.convert=Bc;jn.prototype.revert=Fc;jn.prototype.reduce=Lc;jn.prototype.mulTo=kc;jn.prototype.sqrTo=Oc;function Dc(){if(this.t<1)return 0;var n=this[0];if(!(n&1))return 0;var t=n&3;return t=t*(2-(n&15)*t)&15,t=t*(2-(n&255)*t)&255,t=t*(2-((n&65535)*t&65535))&65535,t=t*(2-n*t%this.DV)%this.DV,t>0?this.DV-t:-t}function Jn(n){this.m=n,this.mp=n.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<n.DB-15)-1,this.mt2=2*n.t}function Vc(n){var t=ir();return n.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),n.s<0&&t.compareTo(he.ZERO)>0&&this.m.subTo(t,t),t}function Nc(n){var t=ir();return n.copyTo(t),this.reduce(t),t}function zc(n){for(;n.t<=this.mt2;)n[n.t++]=0;for(var t=0;t<this.m.t;++t){var e=n[t]&32767,r=e*this.mpl+((e*this.mph+(n[t]>>15)*this.mpl&this.um)<<15)&n.DM;for(e=t+this.m.t,n[e]+=this.m.am(0,r,n,t,0,this.m.t);n[e]>=n.DV;)n[e]-=n.DV,n[++e]++}n.clamp(),n.drShiftTo(this.m.t,n),n.compareTo(this.m)>=0&&n.subTo(this.m,n)}function Qc(n,t){n.squareTo(t),this.reduce(t)}function Uc(n,t,e){n.multiplyTo(t,e),this.reduce(e)}Jn.prototype.convert=Vc;Jn.prototype.revert=Nc;Jn.prototype.reduce=zc;Jn.prototype.mulTo=Uc;Jn.prototype.sqrTo=Qc;function qc(){return(this.t>0?this[0]&1:this.s)==0}function Hc(n,t){if(n>4294967295||n<1)return he.ONE;var e=ir(),r=ir(),i=t.convert(this),a=Ho(n)-1;for(i.copyTo(e);--a>=0;)if(t.sqrTo(e,r),(n&1<<a)>0)t.mulTo(r,i,e);else{var o=e;e=r,r=o}return t.revert(e)}function Gc(n,t){var e;return n<256||t.isEven()?e=new jn(t):e=new Jn(t),this.exp(n,e)}he.prototype.copyTo=hc;he.prototype.fromInt=pc;he.prototype.fromString=vc;he.prototype.clamp=mc;he.prototype.dlShiftTo=wc;he.prototype.drShiftTo=Mc;he.prototype.lShiftTo=Sc;he.prototype.rShiftTo=Cc;he.prototype.subTo=Ec;he.prototype.multiplyTo=Ic;he.prototype.squareTo=Tc;he.prototype.divRemTo=Pc;he.prototype.invDigit=Dc;he.prototype.isEven=qc;he.prototype.exp=Hc;he.prototype.toString=Ac;he.prototype.negate=gc;he.prototype.abs=yc;he.prototype.compareTo=bc;he.prototype.bitLength=xc;he.prototype.mod=Rc;he.prototype.modPowInt=Gc;he.ZERO=qo(0);he.ONE=qo(1);/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function Kc(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function _c(n){return Math.floor(Math.LN2*this.DB/Math.log(n))}function jc(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function Jc(n){if(n==null&&(n=10),this.signum()==0||n<2||n>36)return"0";var t=this.chunkSize(n),e=Math.pow(n,t),r=qo(e),i=ir(),a=ir(),o="";for(this.divRemTo(r,i,a);i.signum()>0;)o=(e+a.intValue()).toString(n).substr(1)+o,i.divRemTo(r,i,a);return a.intValue().toString(n)+o}he.prototype.chunkSize=_c;he.prototype.toRadix=Jc;he.prototype.intValue=Kc;he.prototype.signum=jc;/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */var zn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ou="=";function Xc(n){var t,e,r="";for(t=0;t+3<=n.length;t+=3)e=parseInt(n.substring(t,t+3),16),r+=zn.charAt(e>>6)+zn.charAt(e&63);for(t+1==n.length?(e=parseInt(n.substring(t,t+1),16),r+=zn.charAt(e<<2)):t+2==n.length&&(e=parseInt(n.substring(t,t+2),16),r+=zn.charAt(e>>2)+zn.charAt((e&3)<<4));(r.length&3)>0;)r+=ou;return r}function Go(n){var t="",e,r=0,i,a;for(e=0;e<n.length&&n.charAt(e)!=ou;++e)a=zn.indexOf(n.charAt(e)),!(a<0)&&(r==0?(t+=Ur(a>>2),i=a&3,r=1):r==1?(t+=Ur(i<<2|a>>4),i=a&15,r=2):r==2?(t+=Ur(i),t+=Ur(a>>2),i=a&3,r=3):(t+=Ur(i<<2|a>>4),t+=Ur(a&15),r=0));return r==1&&(t+=Ur(i<<2)),t}/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function Qt(n,t){return new he(n,t)}function Wc(n,t){if(t<n.length+11)throw"Message too long for RSA";for(var e=new Array,r=n.length-1;r>=0&&t>0;){var i=n.charCodeAt(r--);i<128?e[--t]=i:i>127&&i<2048?(e[--t]=i&63|128,e[--t]=i>>6|192):(e[--t]=i&63|128,e[--t]=i>>6&63|128,e[--t]=i>>12|224)}e[--t]=0;for(var a=new SecureRandom,o=new Array;t>2;){for(o[0]=0;o[0]==0;)a.nextBytes(o);e[--t]=o[0]}return e[--t]=2,e[--t]=0,new he(e)}function Cs(n,t,e){for(var r="",i=0;r.length<t;)r+=e(String.fromCharCode.apply(String,n.concat([(i&4278190080)>>24,(i&16711680)>>16,(i&65280)>>8,i&255]))),i+=1;return r}function Zc(n,t,e,r){var i=ae.crypto.MessageDigest,a=ae.crypto.Util,o=null;if(e||(e="sha1"),typeof e=="string"&&(o=i.getCanonicalAlgName(e),r=i.getHashLength(o),e=function(v){return Hr(a.hashHex(da(v),o))}),n.length+2*r+2>t)throw"Message too long for RSA";var s="",u;for(u=0;u<t-n.length-2*r-2;u+=1)s+="\0";var l=e("")+s+""+n,c=new Array(r);new SecureRandom().nextBytes(c);var d=Cs(c,l.length,e),p=[];for(u=0;u<l.length;u+=1)p[u]=l.charCodeAt(u)^d.charCodeAt(u);var A=Cs(p,c.length,e),h=[0];for(u=0;u<c.length;u+=1)h[u+1]=c[u]^A.charCodeAt(u);return new he(h.concat(p))}function Ve(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}function Yc(n,t){if(this.isPublic=!0,this.isPrivate=!1,typeof n!="string")this.n=n,this.e=t;else if(n!=null&&t!=null&&n.length>0&&t.length>0)this.n=Qt(n,16),this.e=parseInt(t,16);else throw"Invalid RSA public key"}function $c(n){return n.modPowInt(this.e,this.n)}function ef(n){var t=Wc(n,this.n.bitLength()+7>>3);if(t==null)return null;var e=this.doPublic(t);if(e==null)return null;var r=e.toString(16);return r.length&1?"0"+r:r}function tf(n,t,e){var r=Zc(n,this.n.bitLength()+7>>3,t,e);if(r==null)return null;var i=this.doPublic(r);if(i==null)return null;var a=i.toString(16);return a.length&1?"0"+a:a}Ve.prototype.doPublic=$c;Ve.prototype.setPublic=Yc;Ve.prototype.encrypt=ef;Ve.prototype.encryptOAEP=tf;Ve.prototype.type="RSA";/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function rf(n,t){for(var e=n.toByteArray(),r=0;r<e.length&&e[r]==0;)++r;if(e.length-r!=t-1||e[r]!=2)return null;for(++r;e[r]!=0;)if(++r>=e.length)return null;for(var i="";++r<e.length;){var a=e[r]&255;a<128?i+=String.fromCharCode(a):a>191&&a<224?(i+=String.fromCharCode((a&31)<<6|e[r+1]&63),++r):(i+=String.fromCharCode((a&15)<<12|(e[r+1]&63)<<6|e[r+2]&63),r+=2)}return i}function Es(n,t,e){for(var r="",i=0;r.length<t;)r+=e(n+String.fromCharCode.apply(String,[(i&4278190080)>>24,(i&16711680)>>16,(i&65280)>>8,i&255])),i+=1;return r}function nf(n,t,e,r){var i=ae.crypto.MessageDigest,a=ae.crypto.Util,o=null;e||(e="sha1"),typeof e=="string"&&(o=i.getCanonicalAlgName(e),r=i.getHashLength(o),e=function(g){return Hr(a.hashHex(da(g),o))}),n=n.toByteArray();var d;for(d=0;d<n.length;d+=1)n[d]&=255;for(;n.length<t;)n.unshift(0);if(n=String.fromCharCode.apply(String,n),n.length<2*r+2)throw"Cipher too short";var s=n.substr(1,r),u=n.substr(r+1),l=Es(u,r,e),c=[],d;for(d=0;d<s.length;d+=1)c[d]=s.charCodeAt(d)^l.charCodeAt(d);var p=Es(String.fromCharCode.apply(String,c),n.length-r,e),A=[];for(d=0;d<u.length;d+=1)A[d]=u.charCodeAt(d)^p.charCodeAt(d);if(A=String.fromCharCode.apply(String,A),A.substr(0,r)!==e(""))throw"Hash mismatch";A=A.substr(r);var h=A.indexOf(""),v=h!=-1?A.substr(0,h).lastIndexOf("\0"):-1;if(v+1!=h)throw"Malformed data";return A.substr(h+1)}function af(n,t,e){if(this.isPrivate=!0,typeof n!="string")this.n=n,this.e=t,this.d=e;else if(n!=null&&t!=null&&n.length>0&&t.length>0)this.n=Qt(n,16),this.e=parseInt(t,16),this.d=Qt(e,16);else throw"Invalid RSA private key"}function of(n,t,e,r,i,a,o,s){if(this.isPrivate=!0,this.isPublic=!1,n==null)throw"RSASetPrivateEx N == null";if(t==null)throw"RSASetPrivateEx E == null";if(n.length==0)throw"RSASetPrivateEx N.length == 0";if(t.length==0)throw"RSASetPrivateEx E.length == 0";if(n!=null&&t!=null&&n.length>0&&t.length>0)this.n=Qt(n,16),this.e=parseInt(t,16),this.d=Qt(e,16),this.p=Qt(r,16),this.q=Qt(i,16),this.dmp1=Qt(a,16),this.dmq1=Qt(o,16),this.coeff=Qt(s,16);else throw"Invalid RSA private key in RSASetPrivateEx"}function sf(n){if(this.p==null||this.q==null)return n.modPow(this.d,this.n);for(var t=n.mod(this.p).modPow(this.dmp1,this.p),e=n.mod(this.q).modPow(this.dmq1,this.q);t.compareTo(e)<0;)t=t.add(this.p);return t.subtract(e).multiply(this.coeff).mod(this.p).multiply(this.q).add(e)}function uf(n){if(n.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var t=Qt(n,16),e=this.doPrivate(t);return e==null?null:rf(e,this.n.bitLength()+7>>3)}function lf(n,t,e){if(n.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var r=Qt(n,16),i=this.doPrivate(r);return i==null?null:nf(i,this.n.bitLength()+7>>3,t,e)}Ve.prototype.doPrivate=sf;Ve.prototype.setPrivate=af;Ve.prototype.setPrivateEx=of;Ve.prototype.decrypt=uf;Ve.prototype.decryptOAEP=lf;(typeof ae.lang=="undefined"||!ae.lang)&&(ae.lang={});ae.lang.String=function(){};function cf(n){return n.length%4==2?n=n+"==":n.length%4==3&&(n=n+"="),n=n.replace(/-/g,"+"),n=n.replace(/_/g,"/"),n}function lt(n){return Go(cf(n))}function Tr(n){return decodeURIComponent(vf(n))}function Hr(n){for(var t="",e=0;e<n.length-1;e+=2)t+=String.fromCharCode(parseInt(n.substr(e,2),16));return t}function da(n){for(var t="",e=0;e<n.length;e++)t+=("0"+n.charCodeAt(e).toString(16)).slice(-2);return t}function ff(n){return Xc(n)}function df(n){var t=ff(n),e=t.replace(/(.{64})/g,`$1\r
|
|
344
344
|
`);return e=e.replace(/\r\n$/,""),e}function hf(n){var t=n.replace(/[^0-9A-Za-z\/+=]*/g,""),e=Go(t);return e}function pf(n,t){var e=df(n);return"-----BEGIN "+t+`-----\r
|
|
345
345
|
`+e+`\r
|
|
346
346
|
-----END `+t+`-----\r
|
|
@@ -352,18 +352,18 @@
|
|
|
352
352
|
|
|
353
353
|
`)!=-1&&(y=h.indexOf(`
|
|
354
354
|
|
|
355
|
-
`),b=1);var x=h.indexOf("-----END");if(y!=-1&&x!=-1){var w=h.substring(y+b*2,x-b);w=w.replace(/\s+/g,""),v.data=w}return v},d=function(h,v,g){for(var m=g.substring(0,16),y=Me.enc.Hex.parse(m),b=Me.enc.Utf8.parse(v),x=u[h].keylen+u[h].ivlen,w="",M=null;;){var S=Me.algo.MD5.create();if(M!=null&&S.update(M),S.update(b),S.update(y),M=S.finalize(),w=w+Me.enc.Hex.stringify(M),w.length>=x*2)break}var E={};return E.keyhex=w.substr(0,u[h].keylen*2),E.ivhex=w.substr(u[h].keylen*2,u[h].ivlen*2),E},p=function(h,v,g,m){var y=Me.enc.Base64.parse(h),b=Me.enc.Hex.stringify(y),x=u[v].proc,w=x(b,g,m);return w},A=function(h,v,g,m){var y=u[v].eproc,b=y(h,g,m);return b};return{version:"1.0.0",parsePKCS5PEM:function(h){return c(h)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(h,v,g){return d(h,v,g)},decryptKeyB64:function(h,v,g,m){return p(h,v,g,m)},getDecryptedKeyHex:function(h,v){var g=c(h),m=g.cipher,y=g.ivsalt,b=g.data,x=d(m,v,y),w=x.keyhex,M=p(b,m,w,y);return M},getEncryptedPKCS5PEMFromPrvKeyHex:function(h,v,g,m,y){var
|
|
356
|
-
`),
|
|
357
|
-
`;return
|
|
358
|
-
`,
|
|
359
|
-
`,
|
|
360
|
-
`,
|
|
355
|
+
`),b=1);var x=h.indexOf("-----END");if(y!=-1&&x!=-1){var w=h.substring(y+b*2,x-b);w=w.replace(/\s+/g,""),v.data=w}return v},d=function(h,v,g){for(var m=g.substring(0,16),y=Me.enc.Hex.parse(m),b=Me.enc.Utf8.parse(v),x=u[h].keylen+u[h].ivlen,w="",M=null;;){var S=Me.algo.MD5.create();if(M!=null&&S.update(M),S.update(b),S.update(y),M=S.finalize(),w=w+Me.enc.Hex.stringify(M),w.length>=x*2)break}var E={};return E.keyhex=w.substr(0,u[h].keylen*2),E.ivhex=w.substr(u[h].keylen*2,u[h].ivlen*2),E},p=function(h,v,g,m){var y=Me.enc.Base64.parse(h),b=Me.enc.Hex.stringify(y),x=u[v].proc,w=x(b,g,m);return w},A=function(h,v,g,m){var y=u[v].eproc,b=y(h,g,m);return b};return{version:"1.0.0",parsePKCS5PEM:function(h){return c(h)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(h,v,g){return d(h,v,g)},decryptKeyB64:function(h,v,g,m){return p(h,v,g,m)},getDecryptedKeyHex:function(h,v){var g=c(h),m=g.cipher,y=g.ivsalt,b=g.data,x=d(m,v,y),w=x.keyhex,M=p(b,m,w,y);return M},getEncryptedPKCS5PEMFromPrvKeyHex:function(h,v,g,m,y){var B="";if((typeof m=="undefined"||m==null)&&(m="AES-256-CBC"),typeof u[m]=="undefined")throw"KEYUTIL unsupported algorithm: "+m;if(typeof y=="undefined"||y==null){var b=u[m].ivlen,x=l(b);y=x.toUpperCase()}var w=d(m,g,y),M=w.keyhex,S=A(v,m,M,y),E=S.replace(/(.{64})/g,`$1\r
|
|
356
|
+
`),B="-----BEGIN "+h+` PRIVATE KEY-----\r
|
|
357
|
+
`;return B+=`Proc-Type: 4,ENCRYPTED\r
|
|
358
|
+
`,B+="DEK-Info: "+m+","+y+`\r
|
|
359
|
+
`,B+=`\r
|
|
360
|
+
`,B+=E,B+=`\r
|
|
361
361
|
-----END `+h+` PRIVATE KEY-----\r
|
|
362
|
-
`,P},parseHexOfEncryptedPKCS8:function(h){var v=le,g=v.getChildIdx,m=v.getV,y={},b=g(h,0);if(b.length!=2)throw"malformed format: SEQUENCE(0).items != 2: "+b.length;y.ciphertext=m(h,b[1]);var x=g(h,b[0]);if(x.length!=2)throw"malformed format: SEQUENCE(0.0).items != 2: "+x.length;if(m(h,x[0])!="2a864886f70d01050d")throw"this only supports pkcs5PBES2";var w=g(h,x[1]);if(x.length!=2)throw"malformed format: SEQUENCE(0.0.1).items != 2: "+w.length;var M=g(h,w[1]);if(M.length!=2)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+M.length;if(m(h,M[0])!="2a864886f70d0307")throw"this only supports TripleDES";y.encryptionSchemeAlg="TripleDES",y.encryptionSchemeIV=m(h,M[1]);var S=g(h,w[0]);if(S.length!=2)throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+S.length;if(m(h,S[0])!="2a864886f70d01050c")throw"this only supports pkcs5PBKDF2";var E=g(h,S[1]);if(E.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+E.length;y.pbkdf2Salt=m(h,E[0]);var P=m(h,E[1]);try{y.pbkdf2Iter=parseInt(P,16)}catch(B){throw"malformed format pbkdf2Iter: "+P}return y},getPBKDF2KeyHexFromParam:function(h,v){var g=Me.enc.Hex.parse(h.pbkdf2Salt),m=h.pbkdf2Iter,y=Me.PBKDF2(v,g,{keySize:192/32,iterations:m}),b=Me.enc.Hex.stringify(y);return b},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(h,v){var g=In(h,"ENCRYPTED PRIVATE KEY"),m=this.parseHexOfEncryptedPKCS8(g),y=Sn.getPBKDF2KeyHexFromParam(m,v),b={};b.ciphertext=Me.enc.Hex.parse(m.ciphertext);var x=Me.enc.Hex.parse(y),w=Me.enc.Hex.parse(m.encryptionSchemeIV),M=Me.TripleDES.decrypt(b,x,{iv:w}),S=Me.enc.Hex.stringify(M);return S},getKeyFromEncryptedPKCS8PEM:function(h,v){var g=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(h,v),m=this.getKeyFromPlainPrivatePKCS8Hex(g);return m},parsePlainPrivatePKCS8Hex:function(h){var v=le,g=v.getChildIdx,m=v.getV,y={};if(y.algparam=null,h.substr(0,2)!="30")throw new Error("malformed plain PKCS8 private key(code:001)");var b=g(h,0);if(b.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if(h.substr(b[1],2)!="30")throw new Error("malformed PKCS8 private key(code:003)");var x=g(h,b[1]);if(x.length!=2)throw new Error("malformed PKCS8 private key(code:004)");if(h.substr(x[0],2)!="06")throw new Error("malformed PKCS8 private key(code:005)");if(y.algoid=m(h,x[0]),h.substr(x[1],2)=="06"&&(y.algparam=m(h,x[1])),h.substr(b[2],2)!="04")throw new Error("malformed PKCS8 private key(code:006)");return y.keyidx=v.getVidx(h,b[2]),y},getKeyFromPlainPrivatePKCS8PEM:function(h){var v=In(h,"PRIVATE KEY"),g=this.getKeyFromPlainPrivatePKCS8Hex(v);return g},getKeyFromPlainPrivatePKCS8Hex:function(h){var v=this.parsePlainPrivatePKCS8Hex(h),g;if(v.algoid=="2a864886f70d010101")g=new Ve;else if(ae.crypto.DSA&&v.algoid=="2a8648ce380401")g=new ae.crypto.DSA;else if(ae.crypto.ECDSA&&v.algoid=="2a8648ce3d0201")g=new ae.crypto.ECDSA;else throw"unsupported private key algorithm";return g.readPKCS8PrvKeyHex(h),g},_getKeyFromPublicPKCS8Hex:function(h){var v,g=le.getVbyList(h,0,[0,0],"06");if(g==="2a864886f70d010101")v=new Ve;else if(ae.crypto.DSA&&g==="2a8648ce380401")v=new ae.crypto.DSA;else if(ae.crypto.ECDSA&&g==="2a8648ce3d0201")v=new ae.crypto.ECDSA;else throw"unsupported PKCS#8 public key hex";return v.readPKCS8PubKeyHex(h),v},parsePublicRawRSAKeyHex:function(h){var v=le,g=v.getChildIdx,m=v.getV,y={};if(h.substr(0,2)!="30")throw"malformed RSA key(code:001)";var b=g(h,0);if(b.length!=2)throw"malformed RSA key(code:002)";if(h.substr(b[0],2)!="02")throw"malformed RSA key(code:003)";if(y.n=m(h,b[0]),h.substr(b[1],2)!="02")throw"malformed RSA key(code:004)";return y.e=m(h,b[1]),y},parsePublicPKCS8Hex:function(h){var v=le,g=v.getChildIdx,m=v.getV,y={};y.algparam=null;var b=g(h,0);if(b.length!=2)throw"outer DERSequence shall have 2 elements: "+b.length;var x=b[0];if(h.substr(x,2)!="30")throw"malformed PKCS8 public key(code:001)";var w=g(h,x);if(w.length!=2)throw"malformed PKCS8 public key(code:002)";if(h.substr(w[0],2)!="06")throw"malformed PKCS8 public key(code:003)";if(y.algoid=m(h,w[0]),h.substr(w[1],2)=="06"?y.algparam=m(h,w[1]):h.substr(w[1],2)=="30"&&(y.algparam={},y.algparam.p=v.getVbyList(h,w[1],[0],"02"),y.algparam.q=v.getVbyList(h,w[1],[1],"02"),y.algparam.g=v.getVbyList(h,w[1],[2],"02")),h.substr(b[1],2)!="03")throw"malformed PKCS8 public key(code:004)";return y.key=m(h,b[1]).substr(2),y}}}();Sn.getKey=function(n,t,e){var r=le,i=r.getChildIdx;r.getV;var a=r.getVbyList,o=ae.crypto,s=o.ECDSA,u=o.DSA,l=Ve,c=In,d=Sn;if(typeof l!="undefined"&&n instanceof l||typeof s!="undefined"&&n instanceof s||typeof u!="undefined"&&n instanceof u)return n;if(n.curve!==void 0&&n.xy!==void 0&&n.d===void 0)return new s({pub:n.xy,curve:n.curve});if(n.curve!==void 0&&n.d!==void 0)return new s({prv:n.d,curve:n.curve});if(n.kty===void 0&&n.n!==void 0&&n.e!==void 0&&n.d===void 0){var p=new l;return p.setPublic(n.n,n.e),p}if(n.kty===void 0&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0&&n.p!==void 0&&n.q!==void 0&&n.dp!==void 0&&n.dq!==void 0&&n.co!==void 0&&n.qi===void 0){var p=new l;return p.setPrivateEx(n.n,n.e,n.d,n.p,n.q,n.dp,n.dq,n.co),p}if(n.kty===void 0&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0&&n.p===void 0){var p=new l;return p.setPrivate(n.n,n.e,n.d),p}if(n.p!==void 0&&n.q!==void 0&&n.g!==void 0&&n.y!==void 0&&n.x===void 0){var p=new u;return p.setPublic(n.p,n.q,n.g,n.y),p}if(n.p!==void 0&&n.q!==void 0&&n.g!==void 0&&n.y!==void 0&&n.x!==void 0){var p=new u;return p.setPrivate(n.p,n.q,n.g,n.y,n.x),p}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d===void 0){var p=new l;return p.setPublic(lt(n.n),lt(n.e)),p}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0&&n.p!==void 0&&n.q!==void 0&&n.dp!==void 0&&n.dq!==void 0&&n.qi!==void 0){var p=new l;return p.setPrivateEx(lt(n.n),lt(n.e),lt(n.d),lt(n.p),lt(n.q),lt(n.dp),lt(n.dq),lt(n.qi)),p}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0){var p=new l;return p.setPrivate(lt(n.n),lt(n.e),lt(n.d)),p}if(n.kty==="EC"&&n.crv!==void 0&&n.x!==void 0&&n.y!==void 0&&n.d===void 0){var A=new s({curve:n.crv}),h=A.ecparams.keylen/4,v=("0000000000"+lt(n.x)).slice(-h),g=("0000000000"+lt(n.y)).slice(-h),m="04"+v+g;return A.setPublicKeyHex(m),A}if(n.kty==="EC"&&n.crv!==void 0&&n.x!==void 0&&n.y!==void 0&&n.d!==void 0){var A=new s({curve:n.crv}),h=A.ecparams.keylen/4,v=("0000000000"+lt(n.x)).slice(-h),g=("0000000000"+lt(n.y)).slice(-h),m="04"+v+g,y=("0000000000"+lt(n.d)).slice(-h);return A.setPublicKeyHex(m),A.setPrivateKeyHex(y),A}if(e==="pkcs5prv"){var b=n,r=le,x,p;if(x=i(b,0),x.length===9)p=new l,p.readPKCS5PrvKeyHex(b);else if(x.length===6)p=new u,p.readPKCS5PrvKeyHex(b);else if(x.length>2&&b.substr(x[1],2)==="04")p=new s,p.readPKCS5PrvKeyHex(b);else throw"unsupported PKCS#1/5 hexadecimal key";return p}if(e==="pkcs8prv"){var p=d.getKeyFromPlainPrivatePKCS8Hex(n);return p}if(e==="pkcs8pub")return d._getKeyFromPublicPKCS8Hex(n);if(e==="x509pub")return $e.getPublicKeyFromCertHex(n);if(n.indexOf("-END CERTIFICATE-",0)!=-1||n.indexOf("-END X509 CERTIFICATE-",0)!=-1||n.indexOf("-END TRUSTED CERTIFICATE-",0)!=-1)return $e.getPublicKeyFromCertPEM(n);if(n.indexOf("-END PUBLIC KEY-")!=-1){var w=In(n,"PUBLIC KEY");return d._getKeyFromPublicPKCS8Hex(w)}if(n.indexOf("-END RSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var M=c(n,"RSA PRIVATE KEY");return d.getKey(M,null,"pkcs5prv")}if(n.indexOf("-END DSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var S=c(n,"DSA PRIVATE KEY"),E=a(S,0,[1],"02"),P=a(S,0,[2],"02"),B=a(S,0,[3],"02"),C=a(S,0,[4],"02"),I=a(S,0,[5],"02"),p=new u;return p.setPrivate(new he(E,16),new he(P,16),new he(B,16),new he(C,16),new he(I,16)),p}if(n.indexOf("-END EC PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var M=c(n,"EC PRIVATE KEY");return d.getKey(M,null,"pkcs5prv")}if(n.indexOf("-END PRIVATE KEY-")!=-1)return d.getKeyFromPlainPrivatePKCS8PEM(n);if(n.indexOf("-END RSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var F=d.getDecryptedKeyHex(n,t),T=new Ve;return T.readPKCS5PrvKeyHex(F),T}if(n.indexOf("-END EC PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var S=d.getDecryptedKeyHex(n,t),p=a(S,0,[1],"04"),L=a(S,0,[2,0],"06"),D=a(S,0,[3,0],"03").substr(2),V="";if(ae.crypto.OID.oidhex2name[L]!==void 0)V=ae.crypto.OID.oidhex2name[L];else throw"undefined OID(hex) in KJUR.crypto.OID: "+L;var A=new s({curve:V});return A.setPublicKeyHex(D),A.setPrivateKeyHex(p),A.isPublic=!1,A}if(n.indexOf("-END DSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var S=d.getDecryptedKeyHex(n,t),E=a(S,0,[1],"02"),P=a(S,0,[2],"02"),B=a(S,0,[3],"02"),C=a(S,0,[4],"02"),I=a(S,0,[5],"02"),p=new u;return p.setPrivate(new he(E,16),new he(P,16),new he(B,16),new he(C,16),new he(I,16)),p}if(n.indexOf("-END ENCRYPTED PRIVATE KEY-")!=-1)return d.getKeyFromEncryptedPKCS8PEM(n,t);throw new Error("not supported argument")};(typeof ae.asn1=="undefined"||!ae.asn1)&&(ae.asn1={});ae.asn1.ASN1Util={};ae.asn1.ASN1Util.oidHexToInt=function(n){for(var i="",t=parseInt(n.substr(0,2),16),e=Math.floor(t/40),r=t%40,i=e+"."+r,a="",o=2;o<n.length;o+=2){var s=parseInt(n.substr(o,2),16),u=("00000000"+s.toString(2)).slice(-8);if(a=a+u.substr(1,7),u.substr(0,1)=="0"){var l=new he(a,2);i=i+"."+l.toString(10),a=""}}return i};var le=new function(){};le.getLblen=function(n,t){if(n.substr(t+2,1)!="8")return 1;var e=parseInt(n.substr(t+3,1));return e==0?-1:0<e&&e<10?e+1:-2};le.getL=function(n,t){var e=le.getLblen(n,t);return e<1?"":n.substr(t+2,e*2)};le.getVblen=function(n,t){var e,r;return e=le.getL(n,t),e==""?-1:(e.substr(0,1)==="8"?r=new he(e.substr(2),16):r=new he(e,16),r.intValue())};le.getVidx=function(n,t){var e=le.getLblen(n,t);return e<0?e:t+(e+1)*2};le.getV=function(n,t){var e=le.getVidx(n,t),r=le.getVblen(n,t);return n.substr(e,r*2)};le.getTLV=function(n,t){return n.substr(t,2)+le.getL(n,t)+le.getV(n,t)};le.getTLVblen=function(n,t){return 2+le.getLblen(n,t)*2+le.getVblen(n,t)*2};le.getNextSiblingIdx=function(n,t){var e=le.getVidx(n,t),r=le.getVblen(n,t);return e+r*2};le.getChildIdx=function(n,t){var e=le,r=[],i,a,o;i=e.getVidx(n,t),a=e.getVblen(n,t)*2,n.substr(t,2)=="03"&&(i+=2,a-=2),o=0;for(var s=i;o<=a;){var u=e.getTLVblen(n,s);if(o+=u,o<=a&&r.push(s),s+=u,o>=a)break}return r};le.getNthChildIdx=function(n,t,e){var r=le.getChildIdx(n,t);return r[e]};le.getIdxbyList=function(n,t,e,r){var i=le,a,o;return e.length==0?r!==void 0&&n.substr(t,2)!==r?-1:t:(a=e.shift(),o=i.getChildIdx(n,t),a>=o.length?-1:i.getIdxbyList(n,o[a],e,r))};le.getIdxbyListEx=function(n,t,e,r){var i=le,a,o;if(e.length==0)return r!==void 0&&n.substr(t,2)!==r?-1:t;a=e.shift(),o=i.getChildIdx(n,t);for(var s=0,u=0;u<o.length;u++){var l=n.substr(o[u],2);if(typeof a=="number"&&!i.isContextTag(l)&&s==a||typeof a=="string"&&i.isContextTag(l,a))return i.getIdxbyListEx(n,o[u],e,r);i.isContextTag(l)||s++}return-1};le.getTLVbyList=function(n,t,e,r){var i=le,a=i.getIdxbyList(n,t,e,r);return a==-1||a>=n.length?null:i.getTLV(n,a)};le.getTLVbyListEx=function(n,t,e,r){var i=le,a=i.getIdxbyListEx(n,t,e,r);return a==-1?null:i.getTLV(n,a)};le.getVbyList=function(n,t,e,r,i){var a=le,o,s;return o=a.getIdxbyList(n,t,e,r),o==-1||o>=n.length?null:(s=a.getV(n,o),i===!0&&(s=s.substr(2)),s)};le.getVbyListEx=function(n,t,e,r,i){var a=le,o,s;return o=a.getIdxbyListEx(n,t,e,r),o==-1?null:(s=a.getV(n,o),n.substr(o,2)=="03"&&i!==!1&&(s=s.substr(2)),s)};le.getInt=function(n,t,e){e==null&&(e=-1);try{var r=n.substr(t,2);if(r!="02"&&r!="03")return e;var i=le.getV(n,t);return r=="02"?parseInt(i,16):yf(i)}catch(a){return e}};le.getOID=function(n,t,e){e==null&&(e=null);try{if(n.substr(t,2)!="06")return e;var r=le.getV(n,t);return gf(r)}catch(i){return e}};le.getOIDName=function(n,t,e){e==null&&(e=null);try{var r=le.getOID(n,t,e);if(r==e)return e;var i=ae.asn1.x509.OID.oid2name(r);return i==""?r:i}catch(a){return e}};le.getString=function(n,t,e){e==null&&(e=null);try{var r=le.getV(n,t);return Hr(r)}catch(i){return e}};le.hextooidstr=function(n){var t=function(d,p){return d.length>=p?d:new Array(p-d.length+1).join("0")+d},e=[],r=n.substr(0,2),i=parseInt(r,16);e[0]=new String(Math.floor(i/40)),e[1]=new String(i%40);for(var a=n.substr(2),o=[],s=0;s<a.length/2;s++)o.push(parseInt(a.substr(s*2,2),16));for(var u=[],l="",s=0;s<o.length;s++)o[s]&128?l=l+t((o[s]&127).toString(2),7):(l=l+t((o[s]&127).toString(2),7),u.push(new String(parseInt(l,2))),l="");var c=e.join(".");return u.length>0&&(c=c+"."+u.join(".")),c};le.isContextTag=function(n,t){n=n.toLowerCase();var e,r;try{e=parseInt(n,16)}catch(a){return-1}if(t===void 0)return(e&192)==128;try{var i=t.match(/^\[[0-9]+\]$/);return i==null||(r=parseInt(t.substr(1,t.length-1),10),r>31)?!1:(e&192)==128&&(e&31)==r}catch(a){return!1}};le.isASN1HEX=function(n){var t=le;if(n.length%2==1)return!1;var e=t.getVblen(n,0),r=n.substr(0,2),i=t.getL(n,0),a=n.length-r.length-i.length;return a==e*2};le.checkStrictDER=function(n,t,e,r,i){var a=le;if(e===void 0){if(typeof n!="string")throw new Error("not hex string");if(n=n.toLowerCase(),!ae.lang.String.isHex(n))throw new Error("not hex string");e=n.length,r=n.length/2,r<128?i=1:i=Math.ceil(r.toString(16))+1}var o=a.getL(n,t);if(o.length>i*2)throw new Error("L of TLV too long: idx="+t);var s=a.getVblen(n,t);if(s>r)throw new Error("value of L too long than hex: idx="+t);var u=a.getTLV(n,t),l=u.length-2-a.getL(n,t).length;if(l!==s*2)throw new Error("V string length and L's value not the same:"+l+"/"+s*2);if(t===0&&n.length!=u.length)throw new Error("total length and TLV length unmatch:"+n.length+"!="+u.length);var c=n.substr(t,2);if(c==="02"){var d=a.getVidx(n,t);if(n.substr(d,2)=="00"&&n.charCodeAt(d+2)<56)throw new Error("not least zeros for DER INTEGER")}if(parseInt(c,16)&32){for(var p=a.getVblen(n,t),A=0,h=a.getChildIdx(n,t),v=0;v<h.length;v++){var g=a.getTLV(n,h[v]);A+=g.length,a.checkStrictDER(n,h[v],e,r,i)}if(p*2!=A)throw new Error("sum of children's TLV length and L unmatch: "+p*2+"!="+A)}};le.oidname=function(n){var t=ae.asn1;ae.lang.String.isHex(n)&&(n=t.ASN1Util.oidHexToInt(n));var e=t.x509.OID.oid2name(n);return e===""&&(e=n),e};(typeof ae.asn1=="undefined"||!ae.asn1)&&(ae.asn1={});(typeof ae.asn1.x509=="undefined"||!ae.asn1.x509)&&(ae.asn1.x509={});ae.asn1.x509.AlgorithmIdentifier={};ae.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"};ae.asn1.x509.OID=new function(n){this.atype2oidList={CN:"2.5.4.3",L:"2.5.4.7",ST:"2.5.4.8",O:"2.5.4.10",OU:"2.5.4.11",C:"2.5.4.6",STREET:"2.5.4.9",DC:"0.9.2342.19200300.100.1.25",UID:"0.9.2342.19200300.100.1.1",SN:"2.5.4.4",T:"2.5.4.12",DN:"2.5.4.49",E:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",serialNumber:"2.5.4.5",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3"},this.name2oidList={sha1:"1.3.14.3.2.26",sha256:"2.16.840.1.101.3.4.2.1",sha384:"2.16.840.1.101.3.4.2.2",sha512:"2.16.840.1.101.3.4.2.3",sha224:"2.16.840.1.101.3.4.2.4",md5:"1.2.840.113549.2.5",md2:"1.3.14.7.2.2.1",ripemd160:"1.3.36.3.2.1",MD2withRSA:"1.2.840.113549.1.1.2",MD4withRSA:"1.2.840.113549.1.1.3",MD5withRSA:"1.2.840.113549.1.1.4",SHA1withRSA:"1.2.840.113549.1.1.5","pkcs1-MGF":"1.2.840.113549.1.1.8",rsaPSS:"1.2.840.113549.1.1.10",SHA224withRSA:"1.2.840.113549.1.1.14",SHA256withRSA:"1.2.840.113549.1.1.11",SHA384withRSA:"1.2.840.113549.1.1.12",SHA512withRSA:"1.2.840.113549.1.1.13",SHA1withECDSA:"1.2.840.10045.4.1",SHA224withECDSA:"1.2.840.10045.4.3.1",SHA256withECDSA:"1.2.840.10045.4.3.2",SHA384withECDSA:"1.2.840.10045.4.3.3",SHA512withECDSA:"1.2.840.10045.4.3.4",dsa:"1.2.840.10040.4.1",SHA1withDSA:"1.2.840.10040.4.3",SHA224withDSA:"2.16.840.1.101.3.4.3.1",SHA256withDSA:"2.16.840.1.101.3.4.3.2",rsaEncryption:"1.2.840.113549.1.1.1",commonName:"2.5.4.3",countryName:"2.5.4.6",localityName:"2.5.4.7",stateOrProvinceName:"2.5.4.8",streetAddress:"2.5.4.9",organizationName:"2.5.4.10",organizationalUnitName:"2.5.4.11",domainComponent:"0.9.2342.19200300.100.1.25",userId:"0.9.2342.19200300.100.1.1",surname:"2.5.4.4",givenName:"2.5.4.42",title:"2.5.4.12",distinguishedName:"2.5.4.49",emailAddress:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3",subjectDirectoryAttributes:"2.5.29.9",subjectKeyIdentifier:"2.5.29.14",keyUsage:"2.5.29.15",subjectAltName:"2.5.29.17",issuerAltName:"2.5.29.18",basicConstraints:"2.5.29.19",cRLNumber:"2.5.29.20",cRLReason:"2.5.29.21",nameConstraints:"2.5.29.30",cRLDistributionPoints:"2.5.29.31",certificatePolicies:"2.5.29.32",anyPolicy:"2.5.29.32.0",authorityKeyIdentifier:"2.5.29.35",policyConstraints:"2.5.29.36",extKeyUsage:"2.5.29.37",authorityInfoAccess:"1.3.6.1.5.5.7.1.1",ocsp:"1.3.6.1.5.5.7.48.1",ocspBasic:"1.3.6.1.5.5.7.48.1.1",ocspNonce:"1.3.6.1.5.5.7.48.1.2",ocspNoCheck:"1.3.6.1.5.5.7.48.1.5",caIssuers:"1.3.6.1.5.5.7.48.2",anyExtendedKeyUsage:"2.5.29.37.0",serverAuth:"1.3.6.1.5.5.7.3.1",clientAuth:"1.3.6.1.5.5.7.3.2",codeSigning:"1.3.6.1.5.5.7.3.3",emailProtection:"1.3.6.1.5.5.7.3.4",timeStamping:"1.3.6.1.5.5.7.3.8",ocspSigning:"1.3.6.1.5.5.7.3.9",dateOfBirth:"1.3.6.1.5.5.7.9.1",placeOfBirth:"1.3.6.1.5.5.7.9.2",gender:"1.3.6.1.5.5.7.9.3",countryOfCitizenship:"1.3.6.1.5.5.7.9.4",countryOfResidence:"1.3.6.1.5.5.7.9.5",ecPublicKey:"1.2.840.10045.2.1","P-256":"1.2.840.10045.3.1.7",secp256r1:"1.2.840.10045.3.1.7",secp256k1:"1.3.132.0.10",secp384r1:"1.3.132.0.34",pkcs5PBES2:"1.2.840.113549.1.5.13",pkcs5PBKDF2:"1.2.840.113549.1.5.12","des-EDE3-CBC":"1.2.840.113549.3.7",data:"1.2.840.113549.1.7.1","signed-data":"1.2.840.113549.1.7.2","enveloped-data":"1.2.840.113549.1.7.3","digested-data":"1.2.840.113549.1.7.5","encrypted-data":"1.2.840.113549.1.7.6","authenticated-data":"1.2.840.113549.1.9.16.1.2",tstinfo:"1.2.840.113549.1.9.16.1.4",signingCertificate:"1.2.840.113549.1.9.16.2.12",timeStampToken:"1.2.840.113549.1.9.16.2.14",signaturePolicyIdentifier:"1.2.840.113549.1.9.16.2.15",etsArchiveTimeStamp:"1.2.840.113549.1.9.16.2.27",signingCertificateV2:"1.2.840.113549.1.9.16.2.47",etsArchiveTimeStampV2:"1.2.840.113549.1.9.16.2.48",extensionRequest:"1.2.840.113549.1.9.14",contentType:"1.2.840.113549.1.9.3",messageDigest:"1.2.840.113549.1.9.4",signingTime:"1.2.840.113549.1.9.5",counterSignature:"1.2.840.113549.1.9.6",archiveTimeStampV3:"0.4.0.1733.2.4",pdfRevocationInfoArchival:"1.2.840.113583.1.1.8",adobeTimeStamp:"1.2.840.113583.1.1.9.1"},this.objCache={},this.name2obj=function(t){if(typeof this.objCache[t]!="undefined")return this.objCache[t];if(typeof this.name2oidList[t]=="undefined")throw"Name of ObjectIdentifier not defined: "+t;var e=this.name2oidList[t],r=new ae.asn1.DERObjectIdentifier({oid:e});return this.objCache[t]=r,r},this.atype2obj=function(t){if(this.objCache[t]!==void 0)return this.objCache[t];var e;if(t.match(/^\d+\.\d+\.[0-9.]+$/))e=t;else if(this.atype2oidList[t]!==void 0)e=this.atype2oidList[t];else if(this.name2oidList[t]!==void 0)e=this.name2oidList[t];else throw"AttributeType name undefined: "+t;var r=new ae.asn1.DERObjectIdentifier({oid:e});return this.objCache[t]=r,r}};ae.asn1.x509.OID.oid2name=function(n){var t=ae.asn1.x509.OID.name2oidList;for(var e in t)if(t[e]==n)return e;return""};ae.asn1.x509.OID.oid2atype=function(n){var t=ae.asn1.x509.OID.atype2oidList;for(var e in t)if(t[e]==n)return e;return n};ae.asn1.x509.OID.name2oid=function(n){if(n.match(/^[0-9.]+$/))return n;var t=ae.asn1.x509.OID.name2oidList;return t[n]===void 0?"":t[n]};Ve.getPosArrayOfChildrenFromHex=function(n){return le.getChildIdx(n,0)};Ve.getHexValueArrayOfChildrenFromHex=function(n){var t=le,e=t.getV,p=Ve.getPosArrayOfChildrenFromHex(n),r=e(n,p[0]),i=e(n,p[1]),a=e(n,p[2]),o=e(n,p[3]),s=e(n,p[4]),u=e(n,p[5]),l=e(n,p[6]),c=e(n,p[7]),d=e(n,p[8]),p=new Array;return p.push(r,i,a,o,s,u,l,c,d),p};Ve.prototype.readPrivateKeyFromPEMString=function(n){var t=In(n),e=Ve.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};Ve.prototype.readPKCS5PrvKeyHex=function(n){var t=Ve.getHexValueArrayOfChildrenFromHex(n);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])};Ve.prototype.readPKCS8PrvKeyHex=function(n){var t,e,r,i,a,o,s,u,l=le,c=l.getVbyListEx;if(l.isASN1HEX(n)===!1)throw new Error("not ASN.1 hex string");try{t=c(n,0,[2,0,1],"02"),e=c(n,0,[2,0,2],"02"),r=c(n,0,[2,0,3],"02"),i=c(n,0,[2,0,4],"02"),a=c(n,0,[2,0,5],"02"),o=c(n,0,[2,0,6],"02"),s=c(n,0,[2,0,7],"02"),u=c(n,0,[2,0,8],"02")}catch(d){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(t,e,r,i,a,o,s,u)};Ve.prototype.readPKCS5PubKeyHex=function(n){var t=le,e=t.getV;if(t.isASN1HEX(n)===!1)throw new Error("keyHex is not ASN.1 hex string");var r=t.getChildIdx(n,0);if(r.length!==2||n.substr(r[0],2)!=="02"||n.substr(r[1],2)!=="02")throw new Error("wrong hex for PKCS#5 public key");var i=e(n,r[0]),a=e(n,r[1]);this.setPublic(i,a)};Ve.prototype.readPKCS8PubKeyHex=function(n){var t=le;if(t.isASN1HEX(n)===!1)throw new Error("not ASN.1 hex string");if(t.getTLVbyListEx(n,0,[0,0])!=="06092a864886f70d010101")throw new Error("not PKCS8 RSA public key");var e=t.getTLVbyListEx(n,0,[1,0]);this.readPKCS5PubKeyHex(e)};Ve.prototype.readCertPubKeyHex=function(n,t){var e,r;e=new $e,e.readCertHex(n),r=e.getPublicKeyHex(),this.readPKCS8PubKeyHex(r)};function uu(n){for(var t in ae.crypto.Util.DIGESTINFOHEAD){var e=ae.crypto.Util.DIGESTINFOHEAD[t],r=e.length;if(n.substring(0,r)==e){var i=[t,n.substring(r)];return i}}return[]}Ve.prototype.verify=function(n,t){if(t=t.toLowerCase(),t.match(/^[0-9a-f]+$/)==null)return!1;var e=Qt(t,16),r=this.n.bitLength();if(e.bitLength()>r)return!1;var i=this.doPublic(e),a=i.toString(16);if(a.length+3!=r/4)return!1;var o=a.replace(/^1f+00/,""),s=uu(o);if(s.length==0)return!1;var u=s[0],l=s[1],c=function(p){return ae.crypto.Util.hashString(p,u)},d=c(n);return l==d};Ve.prototype.verifyWithMessageHash=function(n,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var e=Qt(t,16);if(e.bitLength()>this.n.bitLength())return 0;var r=this.doPublic(e),i=r.toString(16).replace(/^1f+00/,""),a=uu(i);if(a.length==0)return!1;a[0];var o=a[1];return o==n};Ve.prototype.verifyPSS=function(n,t,e,r){var i=function(o){return ae.crypto.Util.hashHex(o,e)},a=i(da(n));return r===void 0&&(r=-1),this.verifyWithMessageHashPSS(a,t,e,r)};Ve.prototype.verifyWithMessageHashPSS=function(n,t,e,r){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var i=new he(t,16),a=function(y){return ae.crypto.Util.hashHex(y,e)},o=Hr(n),s=o.length,u=this.n.bitLength()-1,l=Math.ceil(u/8),c;if(r===-1||r===void 0)r=s;else if(r===-2)r=l-s-2;else if(r<-2)throw new Error("invalid salt length");if(l<s+r+2)throw new Error("data too long");var d=this.doPublic(i).toByteArray();for(c=0;c<d.length;c+=1)d[c]&=255;for(;d.length<l;)d.unshift(0);if(d[l-1]!==188)throw new Error("encoded message does not end in 0xbc");d=String.fromCharCode.apply(String,d);var p=d.substr(0,l-s-1),A=d.substr(p.length,s),h=65280>>8*l-u&255;if(p.charCodeAt(0)&h)throw new Error("bits beyond keysize not zero");var v=pss_mgf1_str(A,p.length,a),g=[];for(c=0;c<p.length;c+=1)g[c]=p.charCodeAt(c)^v.charCodeAt(c);g[0]&=~h;var m=l-s-r-2;for(c=0;c<m;c+=1)if(g[c]!==0)throw new Error("leftmost octets not zero");if(g[m]!==1)throw new Error("0x01 marker not found");return A===Hr(a(da("\0\0\0\0\0\0\0\0"+o+String.fromCharCode.apply(String,g.slice(-r)))))};Ve.SALT_LEN_HLEN=-1;Ve.SALT_LEN_MAX=-2;Ve.SALT_LEN_RECOVER=-2;function $e(n){var t=le,e=t.getChildIdx,r=t.getV,i=t.getTLV,a=t.getVbyList,o=t.getVbyListEx,s=t.getTLVbyList,u=t.getTLVbyListEx,l=t.getIdxbyList,c=t.getIdxbyListEx,d=t.getVidx,p=t.getInt,A=t.oidname,h=t.hextooidstr,v=In,g;try{g=ae.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(m){}this.HEX2STAG={"0c":"utf8",13:"prn",16:"ia5","1a":"vis","1e":"bmp"},this.hex=null,this.version=0,this.foffset=0,this.aExtInfo=null,this.getVersion=function(){if(this.hex===null||this.version!==0)return this.version;var m=s(this.hex,0,[0,0]);if(m.substr(0,2)=="a0"){var y=s(m,0,[0]),b=p(y,0);if(b<0||2<b)throw new Error("malformed version field");return this.version=b+1,this.version}else return this.version=1,this.foffset=-1,1},this.getSerialNumberHex=function(){return o(this.hex,0,[0,0],"02")},this.getSignatureAlgorithmField=function(){var m=u(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(m)},this.getAlgorithmIdentifierName=function(m){for(var y in g)if(m===g[y])return y;return A(o(m,0,[0],"06"))},this.getIssuer=function(){return this.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return s(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){var m=this.getIssuer();return m.str},this.getSubject=function(){return this.getX500Name(this.getSubjectHex())},this.getSubjectHex=function(){return s(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){var m=this.getSubject();return m.str},this.getNotBefore=function(){var m=a(this.hex,0,[0,4+this.foffset,0]);return m=m.replace(/(..)/g,"%$1"),m=decodeURIComponent(m),m},this.getNotAfter=function(){var m=a(this.hex,0,[0,4+this.foffset,1]);return m=m.replace(/(..)/g,"%$1"),m=decodeURIComponent(m),m},this.getPublicKeyHex=function(){return t.getTLVbyList(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyIdx=function(){return l(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var m=this.getPublicKeyIdx();return l(this.hex,m,[1,0],"30")},this.getPublicKey=function(){return Sn.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var m=s(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(m)},this.getSignatureValueHex=function(){return a(this.hex,0,[2],"03",!0)},this.verifySignature=function(m){var y=this.getSignatureAlgorithmField(),b=this.getSignatureValueHex(),x=s(this.hex,0,[0],"30"),w=new ae.crypto.Signature({alg:y});return w.init(m),w.updateHex(x),w.verify(b)},this.parseExt=function(m){var y,b,x;if(m===void 0){if(x=this.hex,this.version!==3)return-1;y=l(x,0,[0,7,0],"30"),b=e(x,y)}else{x=In(m);var w=l(x,0,[0,3,0,0],"06");if(r(x,w)!="2a864886f70d01090e"){this.aExtInfo=new Array;return}y=l(x,0,[0,3,0,1,0],"30"),b=e(x,y),this.hex=x}this.aExtInfo=new Array;for(var M=0;M<b.length;M++){var S={};S.critical=!1;var E=e(x,b[M]),P=0;E.length===3&&(S.critical=!0,P=1),S.oid=t.hextooidstr(a(x,b[M],[0],"06"));var B=l(x,b[M],[1+P]);S.vidx=d(x,B),this.aExtInfo.push(S)}},this.getExtInfo=function(m){var y=this.aExtInfo,b=m;if(m.match(/^[0-9.]+$/)||(b=ae.asn1.x509.OID.name2oid(m)),b!==""){for(var x=0;x<y.length;x++)if(y[x].oid===b)return y[x]}},this.getExtBasicConstraints=function(m,y){if(m===void 0&&y===void 0){var b=this.getExtInfo("basicConstraints");if(b===void 0)return;m=i(this.hex,b.vidx),y=b.critical}var x={extname:"basicConstraints"};if(y&&(x.critical=!0),m==="3000")return x;if(m==="30030101ff")return x.cA=!0,x;if(m.substr(0,12)==="30060101ff02"){var w=r(m,10),M=parseInt(w,16);return x.cA=!0,x.pathLen=M,x}throw new Error("hExtV parse error: "+m)},this.getExtKeyUsage=function(m,y){if(m===void 0&&y===void 0){var b=this.getExtInfo("keyUsage");if(b===void 0)return;m=i(this.hex,b.vidx),y=b.critical}var x={extname:"keyUsage"};return y&&(x.critical=!0),x.names=this.getExtKeyUsageString(m).split(","),x},this.getExtKeyUsageBin=function(m){if(m===void 0){var y=this.getExtInfo("keyUsage");if(y===void 0)return"";m=i(this.hex,y.vidx)}if(m.length!=8&&m.length!=10)throw new Error("malformed key usage value: "+m);var b="000000000000000"+parseInt(m.substr(6),16).toString(2);return m.length==8&&(b=b.slice(-8)),m.length==10&&(b=b.slice(-16)),b=b.replace(/0+$/,""),b==""&&(b="0"),b},this.getExtKeyUsageString=function(m){for(var y=this.getExtKeyUsageBin(m),b=new Array,x=0;x<y.length;x++)y.substr(x,1)=="1"&&b.push($e.KEYUSAGE_NAME[x]);return b.join(",")},this.getExtSubjectKeyIdentifier=function(m,y){if(m===void 0&&y===void 0){var b=this.getExtInfo("subjectKeyIdentifier");if(b===void 0)return;m=i(this.hex,b.vidx),y=b.critical}var x={extname:"subjectKeyIdentifier"};y&&(x.critical=!0);var w=r(m,0);return x.kid={hex:w},x},this.getExtAuthorityKeyIdentifier=function(m,y){if(m===void 0&&y===void 0){var b=this.getExtInfo("authorityKeyIdentifier");if(b===void 0)return;m=i(this.hex,b.vidx),y=b.critical}var x={extname:"authorityKeyIdentifier"};y&&(x.critical=!0);for(var w=e(m,0),M=0;M<w.length;M++){var S=m.substr(w[M],2);if(S==="80"&&(x.kid={hex:r(m,w[M])}),S==="a1"){var E=i(m,w[M]),P=this.getGeneralNames(E);x.issuer=P[0].dn}S==="82"&&(x.sn={hex:r(m,w[M])})}return x},this.getExtExtKeyUsage=function(m,y){if(m===void 0&&y===void 0){var b=this.getExtInfo("extKeyUsage");if(b===void 0)return;m=i(this.hex,b.vidx),y=b.critical}var x={extname:"extKeyUsage",array:[]};y&&(x.critical=!0);for(var w=e(m,0),M=0;M<w.length;M++)x.array.push(A(r(m,w[M])));return x},this.getExtExtKeyUsageName=function(){var m=this.getExtInfo("extKeyUsage");if(m===void 0)return m;var y=new Array,b=i(this.hex,m.vidx);if(b==="")return y;for(var x=e(b,0),w=0;w<x.length;w++)y.push(A(r(b,x[w])));return y},this.getExtSubjectAltName=function(m,y){if(m===void 0&&y===void 0){var b=this.getExtInfo("subjectAltName");if(b===void 0)return;m=i(this.hex,b.vidx),y=b.critical}var x={extname:"subjectAltName",array:[]};return y&&(x.critical=!0),x.array=this.getGeneralNames(m),x},this.getExtIssuerAltName=function(m,y){if(m===void 0&&y===void 0){var b=this.getExtInfo("issuerAltName");if(b===void 0)return;m=i(this.hex,b.vidx),y=b.critical}var x={extname:"issuerAltName",array:[]};return y&&(x.critical=!0),x.array=this.getGeneralNames(m),x},this.getGeneralNames=function(m){for(var y=e(m,0),b=[],x=0;x<y.length;x++){var w=this.getGeneralName(i(m,y[x]));w!==void 0&&b.push(w)}return b},this.getGeneralName=function(m){var y=m.substr(0,2),b=r(m,0),x=Hr(b);if(y=="81")return{rfc822:x};if(y=="82")return{dns:x};if(y=="86")return{uri:x};if(y=="87")return{ip:Is(b)};if(y=="a4")return{dn:this.getX500Name(b)}},this.getExtSubjectAltName2=function(){var m,y,b,x=this.getExtInfo("subjectAltName");if(x===void 0)return x;for(var w=new Array,M=i(this.hex,x.vidx),S=e(M,0),E=0;E<S.length;E++)b=M.substr(S[E],2),m=r(M,S[E]),b==="81"&&(y=Tr(m),w.push(["MAIL",y])),b==="82"&&(y=Tr(m),w.push(["DNS",y])),b==="84"&&(y=$e.hex2dn(m,0),w.push(["DN",y])),b==="86"&&(y=Tr(m),w.push(["URI",y])),b==="87"&&(y=Is(m),w.push(["IP",y]));return w},this.getExtCRLDistributionPoints=function(m,y){if(m===void 0&&y===void 0){var b=this.getExtInfo("cRLDistributionPoints");if(b===void 0)return;m=i(this.hex,b.vidx),y=b.critical}var x={extname:"cRLDistributionPoints",array:[]};y&&(x.critical=!0);for(var w=e(m,0),M=0;M<w.length;M++){var S=i(m,w[M]);x.array.push(this.getDistributionPoint(S))}return x},this.getDistributionPoint=function(m){for(var y={},b=e(m,0),x=0;x<b.length;x++){var w=m.substr(b[x],2),M=i(m,b[x]);w=="a0"&&(y.dpname=this.getDistributionPointName(M))}return y},this.getDistributionPointName=function(m){for(var y={},b=e(m,0),x=0;x<b.length;x++){var w=m.substr(b[x],2),M=i(m,b[x]);w=="a0"&&(y.full=this.getGeneralNames(M))}return y},this.getExtCRLDistributionPointsURI=function(){var m=this.getExtInfo("cRLDistributionPoints");if(m===void 0)return m;for(var y=new Array,b=e(this.hex,m.vidx),x=0;x<b.length;x++)try{var w=a(this.hex,b[x],[0,0,0],"86"),M=Tr(w);y.push(M)}catch(S){}return y},this.getExtAIAInfo=function(){var m=this.getExtInfo("authorityInfoAccess");if(m===void 0)return m;for(var y={ocsp:[],caissuer:[]},b=e(this.hex,m.vidx),x=0;x<b.length;x++){var w=a(this.hex,b[x],[0],"06"),M=a(this.hex,b[x],[1],"86");w==="2b06010505073001"&&y.ocsp.push(Tr(M)),w==="2b06010505073002"&&y.caissuer.push(Tr(M))}return y},this.getExtAuthorityInfoAccess=function(m,y){if(m===void 0&&y===void 0){var b=this.getExtInfo("authorityInfoAccess");if(b===void 0)return;m=i(this.hex,b.vidx),y=b.critical}var x={extname:"authorityInfoAccess",array:[]};y&&(x.critical=!0);for(var w=e(m,0),M=0;M<w.length;M++){var S=o(m,w[M],[0],"06"),E=a(m,w[M],[1],"86"),P=Tr(E);if(S=="2b06010505073001")x.array.push({ocsp:P});else if(S=="2b06010505073002")x.array.push({caissuer:P});else throw new Error("unknown method: "+S)}return x},this.getExtCertificatePolicies=function(m,y){if(m===void 0&&y===void 0){var b=this.getExtInfo("certificatePolicies");if(b===void 0)return;m=i(this.hex,b.vidx),y=b.critical}var x={extname:"certificatePolicies",array:[]};y&&(x.critical=!0);for(var w=e(m,0),M=0;M<w.length;M++){var S=i(m,w[M]),E=this.getPolicyInformation(S);x.array.push(E)}return x},this.getPolicyInformation=function(m){var y={},b=a(m,0,[0],"06");y.policyoid=A(b);var x=c(m,0,[1],"30");if(x!=-1){y.array=[];for(var w=e(m,x),M=0;M<w.length;M++){var S=i(m,w[M]),E=this.getPolicyQualifierInfo(S);y.array.push(E)}}return y},this.getPolicyQualifierInfo=function(m){var y={},b=a(m,0,[0],"06");if(b==="2b06010505070201"){var x=o(m,0,[1],"16");y.cps=Hr(x)}else if(b==="2b06010505070202"){var w=s(m,0,[1],"30");y.unotice=this.getUserNotice(w)}return y},this.getUserNotice=function(m){for(var y={},b=e(m,0),x=0;x<b.length;x++){var w=i(m,b[x]);w.substr(0,2)!="30"&&(y.exptext=this.getDisplayText(w))}return y},this.getDisplayText=function(m){var y={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"},b={};return b.type=y[m.substr(0,2)],b.str=Hr(r(m,0)),b},this.getExtCRLNumber=function(m,y){var b={extname:"cRLNumber"};if(y&&(b.critical=!0),m.substr(0,2)=="02")return b.num={hex:r(m,0)},b;throw new Error("hExtV parse error: "+m)},this.getExtCRLReason=function(m,y){var b={extname:"cRLReason"};if(y&&(b.critical=!0),m.substr(0,2)=="0a")return b.code=parseInt(r(m,0),16),b;throw new Error("hExtV parse error: "+m)},this.getExtOcspNonce=function(m,y){var b={extname:"ocspNonce"};y&&(b.critical=!0);var x=r(m,0);return b.hex=x,b},this.getExtOcspNoCheck=function(m,y){var b={extname:"ocspNoCheck"};return y&&(b.critical=!0),b},this.getExtAdobeTimeStamp=function(m,y){if(m===void 0&&y===void 0){var b=this.getExtInfo("adobeTimeStamp");if(b===void 0)return;m=i(this.hex,b.vidx),y=b.critical}var x={extname:"adobeTimeStamp"};y&&(x.critical=!0);var w=e(m,0);if(w.length>1){var M=i(m,w[1]),S=this.getGeneralName(M);S.uri!=null&&(x.uri=S.uri)}if(w.length>2){var E=i(m,w[2]);E=="0101ff"&&(x.reqauth=!0),E=="010100"&&(x.reqauth=!1)}return x},this.getX500NameRule=function(m){for(var y=null,b=[],x=0;x<m.length;x++)for(var w=m[x],M=0;M<w.length;M++)b.push(w[M]);for(var x=0;x<b.length;x++){var S=b[x],E=S.ds,P=S.value,B=S.type;if(E!="prn"&&E!="utf8"&&E!="ia5")return"mixed";if(E=="ia5"){if(B!="CN")return"mixed";if(ae.lang.String.isMail(P))continue;return"mixed"}if(B=="C"){if(E=="prn")continue;return"mixed"}if(y==null)y=E;else if(y!==E)return"mixed"}return y==null?"prn":y},this.getX500Name=function(m){var y=this.getX500NameArray(m),b=this.dnarraytostr(y);return{array:y,str:b}},this.getX500NameArray=function(m){for(var y=[],b=e(m,0),x=0;x<b.length;x++)y.push(this.getRDN(i(m,b[x])));return y},this.getRDN=function(m){for(var y=[],b=e(m,0),x=0;x<b.length;x++)y.push(this.getAttrTypeAndValue(i(m,b[x])));return y},this.getAttrTypeAndValue=function(m){var y={type:null,value:null,ds:null},b=e(m,0),x=a(m,b[0],[],"06"),w=a(m,b[1],[]),M=ae.asn1.ASN1Util.oidHexToInt(x);return y.type=ae.asn1.x509.OID.oid2atype(M),y.ds=this.HEX2STAG[m.substr(b[1],2)],y.ds!="bmp"?y.value=Tr(w):y.value=Af(w),y},this.readCertPEM=function(m){this.readCertHex(v(m))},this.readCertHex=function(m){this.hex=m,this.getVersion();try{l(this.hex,0,[0,7],"a3"),this.parseExt()}catch(y){}},this.getParam=function(){var m={};return m.version=this.getVersion(),m.serial={hex:this.getSerialNumberHex()},m.sigalg=this.getSignatureAlgorithmField(),m.issuer=this.getIssuer(),m.notbefore=this.getNotBefore(),m.notafter=this.getNotAfter(),m.subject=this.getSubject(),m.sbjpubkey=pf(this.getPublicKeyHex(),"PUBLIC KEY"),this.aExtInfo.length>0&&(m.ext=this.getExtParamArray()),m.sighex=this.getSignatureValueHex(),m},this.getExtParamArray=function(m){if(m==null){var y=c(this.hex,0,[0,"[3]"]);y!=-1&&(m=u(this.hex,0,[0,"[3]",0],"30"))}for(var b=[],x=e(m,0),w=0;w<x.length;w++){var M=i(m,x[w]),S=this.getExtParam(M);S!=null&&b.push(S)}return b},this.getExtParam=function(m){var y=e(m,0),b=y.length;if(b!=2&&b!=3)throw new Error("wrong number elements in Extension: "+b+" "+m);var x=h(a(m,0,[0],"06")),w=!1;b==3&&s(m,0,[1])=="0101ff"&&(w=!0);var M=s(m,0,[b-1,0]),S=void 0;if(x=="2.5.29.14"?S=this.getExtSubjectKeyIdentifier(M,w):x=="2.5.29.15"?S=this.getExtKeyUsage(M,w):x=="2.5.29.17"?S=this.getExtSubjectAltName(M,w):x=="2.5.29.18"?S=this.getExtIssuerAltName(M,w):x=="2.5.29.19"?S=this.getExtBasicConstraints(M,w):x=="2.5.29.31"?S=this.getExtCRLDistributionPoints(M,w):x=="2.5.29.32"?S=this.getExtCertificatePolicies(M,w):x=="2.5.29.35"?S=this.getExtAuthorityKeyIdentifier(M,w):x=="2.5.29.37"?S=this.getExtExtKeyUsage(M,w):x=="1.3.6.1.5.5.7.1.1"?S=this.getExtAuthorityInfoAccess(M,w):x=="2.5.29.20"?S=this.getExtCRLNumber(M,w):x=="2.5.29.21"?S=this.getExtCRLReason(M,w):x=="1.3.6.1.5.5.7.48.1.2"?S=this.getExtOcspNonce(M,w):x=="1.3.6.1.5.5.7.48.1.5"?S=this.getExtOcspNoCheck(M,w):x=="1.2.840.113583.1.1.9.1"&&(S=this.getExtAdobeTimeStamp(M,w)),S!=null)return S;var E={extname:x,extn:M};return w&&(E.critical=!0),E},this.findExt=function(m,y){for(var b=0;b<m.length;b++)if(m[b].extname==y)return m[b];return null},this.dnarraytostr=function(m){function y(x){return x.map(function(w){return b(w).replace(/\+/,"\\+")}).join("+")}function b(x){return x.type+"="+x.value}return"/"+m.map(function(x){return y(x).replace(/\//,"\\/")}).join("/")},this.getInfo=function(){var m=function(z){var U=JSON.stringify(z.array).replace(/[\[\]\{\}\"]/g,"");return U},y=function(z){for(var U="",q=z.array,G=0;G<q.length;G++){var K=q[G];if(U+=" policy oid: "+K.policyoid+`
|
|
363
|
-
`,K.array!==void 0)for(var
|
|
362
|
+
`,B},parseHexOfEncryptedPKCS8:function(h){var v=le,g=v.getChildIdx,m=v.getV,y={},b=g(h,0);if(b.length!=2)throw"malformed format: SEQUENCE(0).items != 2: "+b.length;y.ciphertext=m(h,b[1]);var x=g(h,b[0]);if(x.length!=2)throw"malformed format: SEQUENCE(0.0).items != 2: "+x.length;if(m(h,x[0])!="2a864886f70d01050d")throw"this only supports pkcs5PBES2";var w=g(h,x[1]);if(x.length!=2)throw"malformed format: SEQUENCE(0.0.1).items != 2: "+w.length;var M=g(h,w[1]);if(M.length!=2)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+M.length;if(m(h,M[0])!="2a864886f70d0307")throw"this only supports TripleDES";y.encryptionSchemeAlg="TripleDES",y.encryptionSchemeIV=m(h,M[1]);var S=g(h,w[0]);if(S.length!=2)throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+S.length;if(m(h,S[0])!="2a864886f70d01050c")throw"this only supports pkcs5PBKDF2";var E=g(h,S[1]);if(E.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+E.length;y.pbkdf2Salt=m(h,E[0]);var B=m(h,E[1]);try{y.pbkdf2Iter=parseInt(B,16)}catch(R){throw"malformed format pbkdf2Iter: "+B}return y},getPBKDF2KeyHexFromParam:function(h,v){var g=Me.enc.Hex.parse(h.pbkdf2Salt),m=h.pbkdf2Iter,y=Me.PBKDF2(v,g,{keySize:192/32,iterations:m}),b=Me.enc.Hex.stringify(y);return b},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(h,v){var g=In(h,"ENCRYPTED PRIVATE KEY"),m=this.parseHexOfEncryptedPKCS8(g),y=Sn.getPBKDF2KeyHexFromParam(m,v),b={};b.ciphertext=Me.enc.Hex.parse(m.ciphertext);var x=Me.enc.Hex.parse(y),w=Me.enc.Hex.parse(m.encryptionSchemeIV),M=Me.TripleDES.decrypt(b,x,{iv:w}),S=Me.enc.Hex.stringify(M);return S},getKeyFromEncryptedPKCS8PEM:function(h,v){var g=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(h,v),m=this.getKeyFromPlainPrivatePKCS8Hex(g);return m},parsePlainPrivatePKCS8Hex:function(h){var v=le,g=v.getChildIdx,m=v.getV,y={};if(y.algparam=null,h.substr(0,2)!="30")throw new Error("malformed plain PKCS8 private key(code:001)");var b=g(h,0);if(b.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if(h.substr(b[1],2)!="30")throw new Error("malformed PKCS8 private key(code:003)");var x=g(h,b[1]);if(x.length!=2)throw new Error("malformed PKCS8 private key(code:004)");if(h.substr(x[0],2)!="06")throw new Error("malformed PKCS8 private key(code:005)");if(y.algoid=m(h,x[0]),h.substr(x[1],2)=="06"&&(y.algparam=m(h,x[1])),h.substr(b[2],2)!="04")throw new Error("malformed PKCS8 private key(code:006)");return y.keyidx=v.getVidx(h,b[2]),y},getKeyFromPlainPrivatePKCS8PEM:function(h){var v=In(h,"PRIVATE KEY"),g=this.getKeyFromPlainPrivatePKCS8Hex(v);return g},getKeyFromPlainPrivatePKCS8Hex:function(h){var v=this.parsePlainPrivatePKCS8Hex(h),g;if(v.algoid=="2a864886f70d010101")g=new Ve;else if(ae.crypto.DSA&&v.algoid=="2a8648ce380401")g=new ae.crypto.DSA;else if(ae.crypto.ECDSA&&v.algoid=="2a8648ce3d0201")g=new ae.crypto.ECDSA;else throw"unsupported private key algorithm";return g.readPKCS8PrvKeyHex(h),g},_getKeyFromPublicPKCS8Hex:function(h){var v,g=le.getVbyList(h,0,[0,0],"06");if(g==="2a864886f70d010101")v=new Ve;else if(ae.crypto.DSA&&g==="2a8648ce380401")v=new ae.crypto.DSA;else if(ae.crypto.ECDSA&&g==="2a8648ce3d0201")v=new ae.crypto.ECDSA;else throw"unsupported PKCS#8 public key hex";return v.readPKCS8PubKeyHex(h),v},parsePublicRawRSAKeyHex:function(h){var v=le,g=v.getChildIdx,m=v.getV,y={};if(h.substr(0,2)!="30")throw"malformed RSA key(code:001)";var b=g(h,0);if(b.length!=2)throw"malformed RSA key(code:002)";if(h.substr(b[0],2)!="02")throw"malformed RSA key(code:003)";if(y.n=m(h,b[0]),h.substr(b[1],2)!="02")throw"malformed RSA key(code:004)";return y.e=m(h,b[1]),y},parsePublicPKCS8Hex:function(h){var v=le,g=v.getChildIdx,m=v.getV,y={};y.algparam=null;var b=g(h,0);if(b.length!=2)throw"outer DERSequence shall have 2 elements: "+b.length;var x=b[0];if(h.substr(x,2)!="30")throw"malformed PKCS8 public key(code:001)";var w=g(h,x);if(w.length!=2)throw"malformed PKCS8 public key(code:002)";if(h.substr(w[0],2)!="06")throw"malformed PKCS8 public key(code:003)";if(y.algoid=m(h,w[0]),h.substr(w[1],2)=="06"?y.algparam=m(h,w[1]):h.substr(w[1],2)=="30"&&(y.algparam={},y.algparam.p=v.getVbyList(h,w[1],[0],"02"),y.algparam.q=v.getVbyList(h,w[1],[1],"02"),y.algparam.g=v.getVbyList(h,w[1],[2],"02")),h.substr(b[1],2)!="03")throw"malformed PKCS8 public key(code:004)";return y.key=m(h,b[1]).substr(2),y}}}();Sn.getKey=function(n,t,e){var r=le,i=r.getChildIdx;r.getV;var a=r.getVbyList,o=ae.crypto,s=o.ECDSA,u=o.DSA,l=Ve,c=In,d=Sn;if(typeof l!="undefined"&&n instanceof l||typeof s!="undefined"&&n instanceof s||typeof u!="undefined"&&n instanceof u)return n;if(n.curve!==void 0&&n.xy!==void 0&&n.d===void 0)return new s({pub:n.xy,curve:n.curve});if(n.curve!==void 0&&n.d!==void 0)return new s({prv:n.d,curve:n.curve});if(n.kty===void 0&&n.n!==void 0&&n.e!==void 0&&n.d===void 0){var p=new l;return p.setPublic(n.n,n.e),p}if(n.kty===void 0&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0&&n.p!==void 0&&n.q!==void 0&&n.dp!==void 0&&n.dq!==void 0&&n.co!==void 0&&n.qi===void 0){var p=new l;return p.setPrivateEx(n.n,n.e,n.d,n.p,n.q,n.dp,n.dq,n.co),p}if(n.kty===void 0&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0&&n.p===void 0){var p=new l;return p.setPrivate(n.n,n.e,n.d),p}if(n.p!==void 0&&n.q!==void 0&&n.g!==void 0&&n.y!==void 0&&n.x===void 0){var p=new u;return p.setPublic(n.p,n.q,n.g,n.y),p}if(n.p!==void 0&&n.q!==void 0&&n.g!==void 0&&n.y!==void 0&&n.x!==void 0){var p=new u;return p.setPrivate(n.p,n.q,n.g,n.y,n.x),p}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d===void 0){var p=new l;return p.setPublic(lt(n.n),lt(n.e)),p}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0&&n.p!==void 0&&n.q!==void 0&&n.dp!==void 0&&n.dq!==void 0&&n.qi!==void 0){var p=new l;return p.setPrivateEx(lt(n.n),lt(n.e),lt(n.d),lt(n.p),lt(n.q),lt(n.dp),lt(n.dq),lt(n.qi)),p}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0){var p=new l;return p.setPrivate(lt(n.n),lt(n.e),lt(n.d)),p}if(n.kty==="EC"&&n.crv!==void 0&&n.x!==void 0&&n.y!==void 0&&n.d===void 0){var A=new s({curve:n.crv}),h=A.ecparams.keylen/4,v=("0000000000"+lt(n.x)).slice(-h),g=("0000000000"+lt(n.y)).slice(-h),m="04"+v+g;return A.setPublicKeyHex(m),A}if(n.kty==="EC"&&n.crv!==void 0&&n.x!==void 0&&n.y!==void 0&&n.d!==void 0){var A=new s({curve:n.crv}),h=A.ecparams.keylen/4,v=("0000000000"+lt(n.x)).slice(-h),g=("0000000000"+lt(n.y)).slice(-h),m="04"+v+g,y=("0000000000"+lt(n.d)).slice(-h);return A.setPublicKeyHex(m),A.setPrivateKeyHex(y),A}if(e==="pkcs5prv"){var b=n,r=le,x,p;if(x=i(b,0),x.length===9)p=new l,p.readPKCS5PrvKeyHex(b);else if(x.length===6)p=new u,p.readPKCS5PrvKeyHex(b);else if(x.length>2&&b.substr(x[1],2)==="04")p=new s,p.readPKCS5PrvKeyHex(b);else throw"unsupported PKCS#1/5 hexadecimal key";return p}if(e==="pkcs8prv"){var p=d.getKeyFromPlainPrivatePKCS8Hex(n);return p}if(e==="pkcs8pub")return d._getKeyFromPublicPKCS8Hex(n);if(e==="x509pub")return $e.getPublicKeyFromCertHex(n);if(n.indexOf("-END CERTIFICATE-",0)!=-1||n.indexOf("-END X509 CERTIFICATE-",0)!=-1||n.indexOf("-END TRUSTED CERTIFICATE-",0)!=-1)return $e.getPublicKeyFromCertPEM(n);if(n.indexOf("-END PUBLIC KEY-")!=-1){var w=In(n,"PUBLIC KEY");return d._getKeyFromPublicPKCS8Hex(w)}if(n.indexOf("-END RSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var M=c(n,"RSA PRIVATE KEY");return d.getKey(M,null,"pkcs5prv")}if(n.indexOf("-END DSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var S=c(n,"DSA PRIVATE KEY"),E=a(S,0,[1],"02"),B=a(S,0,[2],"02"),R=a(S,0,[3],"02"),C=a(S,0,[4],"02"),I=a(S,0,[5],"02"),p=new u;return p.setPrivate(new he(E,16),new he(B,16),new he(R,16),new he(C,16),new he(I,16)),p}if(n.indexOf("-END EC PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var M=c(n,"EC PRIVATE KEY");return d.getKey(M,null,"pkcs5prv")}if(n.indexOf("-END PRIVATE KEY-")!=-1)return d.getKeyFromPlainPrivatePKCS8PEM(n);if(n.indexOf("-END RSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var L=d.getDecryptedKeyHex(n,t),T=new Ve;return T.readPKCS5PrvKeyHex(L),T}if(n.indexOf("-END EC PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var S=d.getDecryptedKeyHex(n,t),p=a(S,0,[1],"04"),F=a(S,0,[2,0],"06"),D=a(S,0,[3,0],"03").substr(2),V="";if(ae.crypto.OID.oidhex2name[F]!==void 0)V=ae.crypto.OID.oidhex2name[F];else throw"undefined OID(hex) in KJUR.crypto.OID: "+F;var A=new s({curve:V});return A.setPublicKeyHex(D),A.setPrivateKeyHex(p),A.isPublic=!1,A}if(n.indexOf("-END DSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var S=d.getDecryptedKeyHex(n,t),E=a(S,0,[1],"02"),B=a(S,0,[2],"02"),R=a(S,0,[3],"02"),C=a(S,0,[4],"02"),I=a(S,0,[5],"02"),p=new u;return p.setPrivate(new he(E,16),new he(B,16),new he(R,16),new he(C,16),new he(I,16)),p}if(n.indexOf("-END ENCRYPTED PRIVATE KEY-")!=-1)return d.getKeyFromEncryptedPKCS8PEM(n,t);throw new Error("not supported argument")};(typeof ae.asn1=="undefined"||!ae.asn1)&&(ae.asn1={});ae.asn1.ASN1Util={};ae.asn1.ASN1Util.oidHexToInt=function(n){for(var i="",t=parseInt(n.substr(0,2),16),e=Math.floor(t/40),r=t%40,i=e+"."+r,a="",o=2;o<n.length;o+=2){var s=parseInt(n.substr(o,2),16),u=("00000000"+s.toString(2)).slice(-8);if(a=a+u.substr(1,7),u.substr(0,1)=="0"){var l=new he(a,2);i=i+"."+l.toString(10),a=""}}return i};var le=new function(){};le.getLblen=function(n,t){if(n.substr(t+2,1)!="8")return 1;var e=parseInt(n.substr(t+3,1));return e==0?-1:0<e&&e<10?e+1:-2};le.getL=function(n,t){var e=le.getLblen(n,t);return e<1?"":n.substr(t+2,e*2)};le.getVblen=function(n,t){var e,r;return e=le.getL(n,t),e==""?-1:(e.substr(0,1)==="8"?r=new he(e.substr(2),16):r=new he(e,16),r.intValue())};le.getVidx=function(n,t){var e=le.getLblen(n,t);return e<0?e:t+(e+1)*2};le.getV=function(n,t){var e=le.getVidx(n,t),r=le.getVblen(n,t);return n.substr(e,r*2)};le.getTLV=function(n,t){return n.substr(t,2)+le.getL(n,t)+le.getV(n,t)};le.getTLVblen=function(n,t){return 2+le.getLblen(n,t)*2+le.getVblen(n,t)*2};le.getNextSiblingIdx=function(n,t){var e=le.getVidx(n,t),r=le.getVblen(n,t);return e+r*2};le.getChildIdx=function(n,t){var e=le,r=[],i,a,o;i=e.getVidx(n,t),a=e.getVblen(n,t)*2,n.substr(t,2)=="03"&&(i+=2,a-=2),o=0;for(var s=i;o<=a;){var u=e.getTLVblen(n,s);if(o+=u,o<=a&&r.push(s),s+=u,o>=a)break}return r};le.getNthChildIdx=function(n,t,e){var r=le.getChildIdx(n,t);return r[e]};le.getIdxbyList=function(n,t,e,r){var i=le,a,o;return e.length==0?r!==void 0&&n.substr(t,2)!==r?-1:t:(a=e.shift(),o=i.getChildIdx(n,t),a>=o.length?-1:i.getIdxbyList(n,o[a],e,r))};le.getIdxbyListEx=function(n,t,e,r){var i=le,a,o;if(e.length==0)return r!==void 0&&n.substr(t,2)!==r?-1:t;a=e.shift(),o=i.getChildIdx(n,t);for(var s=0,u=0;u<o.length;u++){var l=n.substr(o[u],2);if(typeof a=="number"&&!i.isContextTag(l)&&s==a||typeof a=="string"&&i.isContextTag(l,a))return i.getIdxbyListEx(n,o[u],e,r);i.isContextTag(l)||s++}return-1};le.getTLVbyList=function(n,t,e,r){var i=le,a=i.getIdxbyList(n,t,e,r);return a==-1||a>=n.length?null:i.getTLV(n,a)};le.getTLVbyListEx=function(n,t,e,r){var i=le,a=i.getIdxbyListEx(n,t,e,r);return a==-1?null:i.getTLV(n,a)};le.getVbyList=function(n,t,e,r,i){var a=le,o,s;return o=a.getIdxbyList(n,t,e,r),o==-1||o>=n.length?null:(s=a.getV(n,o),i===!0&&(s=s.substr(2)),s)};le.getVbyListEx=function(n,t,e,r,i){var a=le,o,s;return o=a.getIdxbyListEx(n,t,e,r),o==-1?null:(s=a.getV(n,o),n.substr(o,2)=="03"&&i!==!1&&(s=s.substr(2)),s)};le.getInt=function(n,t,e){e==null&&(e=-1);try{var r=n.substr(t,2);if(r!="02"&&r!="03")return e;var i=le.getV(n,t);return r=="02"?parseInt(i,16):yf(i)}catch(a){return e}};le.getOID=function(n,t,e){e==null&&(e=null);try{if(n.substr(t,2)!="06")return e;var r=le.getV(n,t);return gf(r)}catch(i){return e}};le.getOIDName=function(n,t,e){e==null&&(e=null);try{var r=le.getOID(n,t,e);if(r==e)return e;var i=ae.asn1.x509.OID.oid2name(r);return i==""?r:i}catch(a){return e}};le.getString=function(n,t,e){e==null&&(e=null);try{var r=le.getV(n,t);return Hr(r)}catch(i){return e}};le.hextooidstr=function(n){var t=function(d,p){return d.length>=p?d:new Array(p-d.length+1).join("0")+d},e=[],r=n.substr(0,2),i=parseInt(r,16);e[0]=new String(Math.floor(i/40)),e[1]=new String(i%40);for(var a=n.substr(2),o=[],s=0;s<a.length/2;s++)o.push(parseInt(a.substr(s*2,2),16));for(var u=[],l="",s=0;s<o.length;s++)o[s]&128?l=l+t((o[s]&127).toString(2),7):(l=l+t((o[s]&127).toString(2),7),u.push(new String(parseInt(l,2))),l="");var c=e.join(".");return u.length>0&&(c=c+"."+u.join(".")),c};le.isContextTag=function(n,t){n=n.toLowerCase();var e,r;try{e=parseInt(n,16)}catch(a){return-1}if(t===void 0)return(e&192)==128;try{var i=t.match(/^\[[0-9]+\]$/);return i==null||(r=parseInt(t.substr(1,t.length-1),10),r>31)?!1:(e&192)==128&&(e&31)==r}catch(a){return!1}};le.isASN1HEX=function(n){var t=le;if(n.length%2==1)return!1;var e=t.getVblen(n,0),r=n.substr(0,2),i=t.getL(n,0),a=n.length-r.length-i.length;return a==e*2};le.checkStrictDER=function(n,t,e,r,i){var a=le;if(e===void 0){if(typeof n!="string")throw new Error("not hex string");if(n=n.toLowerCase(),!ae.lang.String.isHex(n))throw new Error("not hex string");e=n.length,r=n.length/2,r<128?i=1:i=Math.ceil(r.toString(16))+1}var o=a.getL(n,t);if(o.length>i*2)throw new Error("L of TLV too long: idx="+t);var s=a.getVblen(n,t);if(s>r)throw new Error("value of L too long than hex: idx="+t);var u=a.getTLV(n,t),l=u.length-2-a.getL(n,t).length;if(l!==s*2)throw new Error("V string length and L's value not the same:"+l+"/"+s*2);if(t===0&&n.length!=u.length)throw new Error("total length and TLV length unmatch:"+n.length+"!="+u.length);var c=n.substr(t,2);if(c==="02"){var d=a.getVidx(n,t);if(n.substr(d,2)=="00"&&n.charCodeAt(d+2)<56)throw new Error("not least zeros for DER INTEGER")}if(parseInt(c,16)&32){for(var p=a.getVblen(n,t),A=0,h=a.getChildIdx(n,t),v=0;v<h.length;v++){var g=a.getTLV(n,h[v]);A+=g.length,a.checkStrictDER(n,h[v],e,r,i)}if(p*2!=A)throw new Error("sum of children's TLV length and L unmatch: "+p*2+"!="+A)}};le.oidname=function(n){var t=ae.asn1;ae.lang.String.isHex(n)&&(n=t.ASN1Util.oidHexToInt(n));var e=t.x509.OID.oid2name(n);return e===""&&(e=n),e};(typeof ae.asn1=="undefined"||!ae.asn1)&&(ae.asn1={});(typeof ae.asn1.x509=="undefined"||!ae.asn1.x509)&&(ae.asn1.x509={});ae.asn1.x509.AlgorithmIdentifier={};ae.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"};ae.asn1.x509.OID=new function(n){this.atype2oidList={CN:"2.5.4.3",L:"2.5.4.7",ST:"2.5.4.8",O:"2.5.4.10",OU:"2.5.4.11",C:"2.5.4.6",STREET:"2.5.4.9",DC:"0.9.2342.19200300.100.1.25",UID:"0.9.2342.19200300.100.1.1",SN:"2.5.4.4",T:"2.5.4.12",DN:"2.5.4.49",E:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",serialNumber:"2.5.4.5",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3"},this.name2oidList={sha1:"1.3.14.3.2.26",sha256:"2.16.840.1.101.3.4.2.1",sha384:"2.16.840.1.101.3.4.2.2",sha512:"2.16.840.1.101.3.4.2.3",sha224:"2.16.840.1.101.3.4.2.4",md5:"1.2.840.113549.2.5",md2:"1.3.14.7.2.2.1",ripemd160:"1.3.36.3.2.1",MD2withRSA:"1.2.840.113549.1.1.2",MD4withRSA:"1.2.840.113549.1.1.3",MD5withRSA:"1.2.840.113549.1.1.4",SHA1withRSA:"1.2.840.113549.1.1.5","pkcs1-MGF":"1.2.840.113549.1.1.8",rsaPSS:"1.2.840.113549.1.1.10",SHA224withRSA:"1.2.840.113549.1.1.14",SHA256withRSA:"1.2.840.113549.1.1.11",SHA384withRSA:"1.2.840.113549.1.1.12",SHA512withRSA:"1.2.840.113549.1.1.13",SHA1withECDSA:"1.2.840.10045.4.1",SHA224withECDSA:"1.2.840.10045.4.3.1",SHA256withECDSA:"1.2.840.10045.4.3.2",SHA384withECDSA:"1.2.840.10045.4.3.3",SHA512withECDSA:"1.2.840.10045.4.3.4",dsa:"1.2.840.10040.4.1",SHA1withDSA:"1.2.840.10040.4.3",SHA224withDSA:"2.16.840.1.101.3.4.3.1",SHA256withDSA:"2.16.840.1.101.3.4.3.2",rsaEncryption:"1.2.840.113549.1.1.1",commonName:"2.5.4.3",countryName:"2.5.4.6",localityName:"2.5.4.7",stateOrProvinceName:"2.5.4.8",streetAddress:"2.5.4.9",organizationName:"2.5.4.10",organizationalUnitName:"2.5.4.11",domainComponent:"0.9.2342.19200300.100.1.25",userId:"0.9.2342.19200300.100.1.1",surname:"2.5.4.4",givenName:"2.5.4.42",title:"2.5.4.12",distinguishedName:"2.5.4.49",emailAddress:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3",subjectDirectoryAttributes:"2.5.29.9",subjectKeyIdentifier:"2.5.29.14",keyUsage:"2.5.29.15",subjectAltName:"2.5.29.17",issuerAltName:"2.5.29.18",basicConstraints:"2.5.29.19",cRLNumber:"2.5.29.20",cRLReason:"2.5.29.21",nameConstraints:"2.5.29.30",cRLDistributionPoints:"2.5.29.31",certificatePolicies:"2.5.29.32",anyPolicy:"2.5.29.32.0",authorityKeyIdentifier:"2.5.29.35",policyConstraints:"2.5.29.36",extKeyUsage:"2.5.29.37",authorityInfoAccess:"1.3.6.1.5.5.7.1.1",ocsp:"1.3.6.1.5.5.7.48.1",ocspBasic:"1.3.6.1.5.5.7.48.1.1",ocspNonce:"1.3.6.1.5.5.7.48.1.2",ocspNoCheck:"1.3.6.1.5.5.7.48.1.5",caIssuers:"1.3.6.1.5.5.7.48.2",anyExtendedKeyUsage:"2.5.29.37.0",serverAuth:"1.3.6.1.5.5.7.3.1",clientAuth:"1.3.6.1.5.5.7.3.2",codeSigning:"1.3.6.1.5.5.7.3.3",emailProtection:"1.3.6.1.5.5.7.3.4",timeStamping:"1.3.6.1.5.5.7.3.8",ocspSigning:"1.3.6.1.5.5.7.3.9",dateOfBirth:"1.3.6.1.5.5.7.9.1",placeOfBirth:"1.3.6.1.5.5.7.9.2",gender:"1.3.6.1.5.5.7.9.3",countryOfCitizenship:"1.3.6.1.5.5.7.9.4",countryOfResidence:"1.3.6.1.5.5.7.9.5",ecPublicKey:"1.2.840.10045.2.1","P-256":"1.2.840.10045.3.1.7",secp256r1:"1.2.840.10045.3.1.7",secp256k1:"1.3.132.0.10",secp384r1:"1.3.132.0.34",pkcs5PBES2:"1.2.840.113549.1.5.13",pkcs5PBKDF2:"1.2.840.113549.1.5.12","des-EDE3-CBC":"1.2.840.113549.3.7",data:"1.2.840.113549.1.7.1","signed-data":"1.2.840.113549.1.7.2","enveloped-data":"1.2.840.113549.1.7.3","digested-data":"1.2.840.113549.1.7.5","encrypted-data":"1.2.840.113549.1.7.6","authenticated-data":"1.2.840.113549.1.9.16.1.2",tstinfo:"1.2.840.113549.1.9.16.1.4",signingCertificate:"1.2.840.113549.1.9.16.2.12",timeStampToken:"1.2.840.113549.1.9.16.2.14",signaturePolicyIdentifier:"1.2.840.113549.1.9.16.2.15",etsArchiveTimeStamp:"1.2.840.113549.1.9.16.2.27",signingCertificateV2:"1.2.840.113549.1.9.16.2.47",etsArchiveTimeStampV2:"1.2.840.113549.1.9.16.2.48",extensionRequest:"1.2.840.113549.1.9.14",contentType:"1.2.840.113549.1.9.3",messageDigest:"1.2.840.113549.1.9.4",signingTime:"1.2.840.113549.1.9.5",counterSignature:"1.2.840.113549.1.9.6",archiveTimeStampV3:"0.4.0.1733.2.4",pdfRevocationInfoArchival:"1.2.840.113583.1.1.8",adobeTimeStamp:"1.2.840.113583.1.1.9.1"},this.objCache={},this.name2obj=function(t){if(typeof this.objCache[t]!="undefined")return this.objCache[t];if(typeof this.name2oidList[t]=="undefined")throw"Name of ObjectIdentifier not defined: "+t;var e=this.name2oidList[t],r=new ae.asn1.DERObjectIdentifier({oid:e});return this.objCache[t]=r,r},this.atype2obj=function(t){if(this.objCache[t]!==void 0)return this.objCache[t];var e;if(t.match(/^\d+\.\d+\.[0-9.]+$/))e=t;else if(this.atype2oidList[t]!==void 0)e=this.atype2oidList[t];else if(this.name2oidList[t]!==void 0)e=this.name2oidList[t];else throw"AttributeType name undefined: "+t;var r=new ae.asn1.DERObjectIdentifier({oid:e});return this.objCache[t]=r,r}};ae.asn1.x509.OID.oid2name=function(n){var t=ae.asn1.x509.OID.name2oidList;for(var e in t)if(t[e]==n)return e;return""};ae.asn1.x509.OID.oid2atype=function(n){var t=ae.asn1.x509.OID.atype2oidList;for(var e in t)if(t[e]==n)return e;return n};ae.asn1.x509.OID.name2oid=function(n){if(n.match(/^[0-9.]+$/))return n;var t=ae.asn1.x509.OID.name2oidList;return t[n]===void 0?"":t[n]};Ve.getPosArrayOfChildrenFromHex=function(n){return le.getChildIdx(n,0)};Ve.getHexValueArrayOfChildrenFromHex=function(n){var t=le,e=t.getV,p=Ve.getPosArrayOfChildrenFromHex(n),r=e(n,p[0]),i=e(n,p[1]),a=e(n,p[2]),o=e(n,p[3]),s=e(n,p[4]),u=e(n,p[5]),l=e(n,p[6]),c=e(n,p[7]),d=e(n,p[8]),p=new Array;return p.push(r,i,a,o,s,u,l,c,d),p};Ve.prototype.readPrivateKeyFromPEMString=function(n){var t=In(n),e=Ve.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};Ve.prototype.readPKCS5PrvKeyHex=function(n){var t=Ve.getHexValueArrayOfChildrenFromHex(n);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])};Ve.prototype.readPKCS8PrvKeyHex=function(n){var t,e,r,i,a,o,s,u,l=le,c=l.getVbyListEx;if(l.isASN1HEX(n)===!1)throw new Error("not ASN.1 hex string");try{t=c(n,0,[2,0,1],"02"),e=c(n,0,[2,0,2],"02"),r=c(n,0,[2,0,3],"02"),i=c(n,0,[2,0,4],"02"),a=c(n,0,[2,0,5],"02"),o=c(n,0,[2,0,6],"02"),s=c(n,0,[2,0,7],"02"),u=c(n,0,[2,0,8],"02")}catch(d){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(t,e,r,i,a,o,s,u)};Ve.prototype.readPKCS5PubKeyHex=function(n){var t=le,e=t.getV;if(t.isASN1HEX(n)===!1)throw new Error("keyHex is not ASN.1 hex string");var r=t.getChildIdx(n,0);if(r.length!==2||n.substr(r[0],2)!=="02"||n.substr(r[1],2)!=="02")throw new Error("wrong hex for PKCS#5 public key");var i=e(n,r[0]),a=e(n,r[1]);this.setPublic(i,a)};Ve.prototype.readPKCS8PubKeyHex=function(n){var t=le;if(t.isASN1HEX(n)===!1)throw new Error("not ASN.1 hex string");if(t.getTLVbyListEx(n,0,[0,0])!=="06092a864886f70d010101")throw new Error("not PKCS8 RSA public key");var e=t.getTLVbyListEx(n,0,[1,0]);this.readPKCS5PubKeyHex(e)};Ve.prototype.readCertPubKeyHex=function(n,t){var e,r;e=new $e,e.readCertHex(n),r=e.getPublicKeyHex(),this.readPKCS8PubKeyHex(r)};function uu(n){for(var t in ae.crypto.Util.DIGESTINFOHEAD){var e=ae.crypto.Util.DIGESTINFOHEAD[t],r=e.length;if(n.substring(0,r)==e){var i=[t,n.substring(r)];return i}}return[]}Ve.prototype.verify=function(n,t){if(t=t.toLowerCase(),t.match(/^[0-9a-f]+$/)==null)return!1;var e=Qt(t,16),r=this.n.bitLength();if(e.bitLength()>r)return!1;var i=this.doPublic(e),a=i.toString(16);if(a.length+3!=r/4)return!1;var o=a.replace(/^1f+00/,""),s=uu(o);if(s.length==0)return!1;var u=s[0],l=s[1],c=function(p){return ae.crypto.Util.hashString(p,u)},d=c(n);return l==d};Ve.prototype.verifyWithMessageHash=function(n,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var e=Qt(t,16);if(e.bitLength()>this.n.bitLength())return 0;var r=this.doPublic(e),i=r.toString(16).replace(/^1f+00/,""),a=uu(i);if(a.length==0)return!1;a[0];var o=a[1];return o==n};Ve.prototype.verifyPSS=function(n,t,e,r){var i=function(o){return ae.crypto.Util.hashHex(o,e)},a=i(da(n));return r===void 0&&(r=-1),this.verifyWithMessageHashPSS(a,t,e,r)};Ve.prototype.verifyWithMessageHashPSS=function(n,t,e,r){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var i=new he(t,16),a=function(y){return ae.crypto.Util.hashHex(y,e)},o=Hr(n),s=o.length,u=this.n.bitLength()-1,l=Math.ceil(u/8),c;if(r===-1||r===void 0)r=s;else if(r===-2)r=l-s-2;else if(r<-2)throw new Error("invalid salt length");if(l<s+r+2)throw new Error("data too long");var d=this.doPublic(i).toByteArray();for(c=0;c<d.length;c+=1)d[c]&=255;for(;d.length<l;)d.unshift(0);if(d[l-1]!==188)throw new Error("encoded message does not end in 0xbc");d=String.fromCharCode.apply(String,d);var p=d.substr(0,l-s-1),A=d.substr(p.length,s),h=65280>>8*l-u&255;if(p.charCodeAt(0)&h)throw new Error("bits beyond keysize not zero");var v=pss_mgf1_str(A,p.length,a),g=[];for(c=0;c<p.length;c+=1)g[c]=p.charCodeAt(c)^v.charCodeAt(c);g[0]&=~h;var m=l-s-r-2;for(c=0;c<m;c+=1)if(g[c]!==0)throw new Error("leftmost octets not zero");if(g[m]!==1)throw new Error("0x01 marker not found");return A===Hr(a(da("\0\0\0\0\0\0\0\0"+o+String.fromCharCode.apply(String,g.slice(-r)))))};Ve.SALT_LEN_HLEN=-1;Ve.SALT_LEN_MAX=-2;Ve.SALT_LEN_RECOVER=-2;function $e(n){var t=le,e=t.getChildIdx,r=t.getV,i=t.getTLV,a=t.getVbyList,o=t.getVbyListEx,s=t.getTLVbyList,u=t.getTLVbyListEx,l=t.getIdxbyList,c=t.getIdxbyListEx,d=t.getVidx,p=t.getInt,A=t.oidname,h=t.hextooidstr,v=In,g;try{g=ae.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(m){}this.HEX2STAG={"0c":"utf8",13:"prn",16:"ia5","1a":"vis","1e":"bmp"},this.hex=null,this.version=0,this.foffset=0,this.aExtInfo=null,this.getVersion=function(){if(this.hex===null||this.version!==0)return this.version;var m=s(this.hex,0,[0,0]);if(m.substr(0,2)=="a0"){var y=s(m,0,[0]),b=p(y,0);if(b<0||2<b)throw new Error("malformed version field");return this.version=b+1,this.version}else return this.version=1,this.foffset=-1,1},this.getSerialNumberHex=function(){return o(this.hex,0,[0,0],"02")},this.getSignatureAlgorithmField=function(){var m=u(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(m)},this.getAlgorithmIdentifierName=function(m){for(var y in g)if(m===g[y])return y;return A(o(m,0,[0],"06"))},this.getIssuer=function(){return this.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return s(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){var m=this.getIssuer();return m.str},this.getSubject=function(){return this.getX500Name(this.getSubjectHex())},this.getSubjectHex=function(){return s(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){var m=this.getSubject();return m.str},this.getNotBefore=function(){var m=a(this.hex,0,[0,4+this.foffset,0]);return m=m.replace(/(..)/g,"%$1"),m=decodeURIComponent(m),m},this.getNotAfter=function(){var m=a(this.hex,0,[0,4+this.foffset,1]);return m=m.replace(/(..)/g,"%$1"),m=decodeURIComponent(m),m},this.getPublicKeyHex=function(){return t.getTLVbyList(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyIdx=function(){return l(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var m=this.getPublicKeyIdx();return l(this.hex,m,[1,0],"30")},this.getPublicKey=function(){return Sn.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var m=s(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(m)},this.getSignatureValueHex=function(){return a(this.hex,0,[2],"03",!0)},this.verifySignature=function(m){var y=this.getSignatureAlgorithmField(),b=this.getSignatureValueHex(),x=s(this.hex,0,[0],"30"),w=new ae.crypto.Signature({alg:y});return w.init(m),w.updateHex(x),w.verify(b)},this.parseExt=function(m){var y,b,x;if(m===void 0){if(x=this.hex,this.version!==3)return-1;y=l(x,0,[0,7,0],"30"),b=e(x,y)}else{x=In(m);var w=l(x,0,[0,3,0,0],"06");if(r(x,w)!="2a864886f70d01090e"){this.aExtInfo=new Array;return}y=l(x,0,[0,3,0,1,0],"30"),b=e(x,y),this.hex=x}this.aExtInfo=new Array;for(var M=0;M<b.length;M++){var S={};S.critical=!1;var E=e(x,b[M]),B=0;E.length===3&&(S.critical=!0,B=1),S.oid=t.hextooidstr(a(x,b[M],[0],"06"));var R=l(x,b[M],[1+B]);S.vidx=d(x,R),this.aExtInfo.push(S)}},this.getExtInfo=function(m){var y=this.aExtInfo,b=m;if(m.match(/^[0-9.]+$/)||(b=ae.asn1.x509.OID.name2oid(m)),b!==""){for(var x=0;x<y.length;x++)if(y[x].oid===b)return y[x]}},this.getExtBasicConstraints=function(m,y){if(m===void 0&&y===void 0){var b=this.getExtInfo("basicConstraints");if(b===void 0)return;m=i(this.hex,b.vidx),y=b.critical}var x={extname:"basicConstraints"};if(y&&(x.critical=!0),m==="3000")return x;if(m==="30030101ff")return x.cA=!0,x;if(m.substr(0,12)==="30060101ff02"){var w=r(m,10),M=parseInt(w,16);return x.cA=!0,x.pathLen=M,x}throw new Error("hExtV parse error: "+m)},this.getExtKeyUsage=function(m,y){if(m===void 0&&y===void 0){var b=this.getExtInfo("keyUsage");if(b===void 0)return;m=i(this.hex,b.vidx),y=b.critical}var x={extname:"keyUsage"};return y&&(x.critical=!0),x.names=this.getExtKeyUsageString(m).split(","),x},this.getExtKeyUsageBin=function(m){if(m===void 0){var y=this.getExtInfo("keyUsage");if(y===void 0)return"";m=i(this.hex,y.vidx)}if(m.length!=8&&m.length!=10)throw new Error("malformed key usage value: "+m);var b="000000000000000"+parseInt(m.substr(6),16).toString(2);return m.length==8&&(b=b.slice(-8)),m.length==10&&(b=b.slice(-16)),b=b.replace(/0+$/,""),b==""&&(b="0"),b},this.getExtKeyUsageString=function(m){for(var y=this.getExtKeyUsageBin(m),b=new Array,x=0;x<y.length;x++)y.substr(x,1)=="1"&&b.push($e.KEYUSAGE_NAME[x]);return b.join(",")},this.getExtSubjectKeyIdentifier=function(m,y){if(m===void 0&&y===void 0){var b=this.getExtInfo("subjectKeyIdentifier");if(b===void 0)return;m=i(this.hex,b.vidx),y=b.critical}var x={extname:"subjectKeyIdentifier"};y&&(x.critical=!0);var w=r(m,0);return x.kid={hex:w},x},this.getExtAuthorityKeyIdentifier=function(m,y){if(m===void 0&&y===void 0){var b=this.getExtInfo("authorityKeyIdentifier");if(b===void 0)return;m=i(this.hex,b.vidx),y=b.critical}var x={extname:"authorityKeyIdentifier"};y&&(x.critical=!0);for(var w=e(m,0),M=0;M<w.length;M++){var S=m.substr(w[M],2);if(S==="80"&&(x.kid={hex:r(m,w[M])}),S==="a1"){var E=i(m,w[M]),B=this.getGeneralNames(E);x.issuer=B[0].dn}S==="82"&&(x.sn={hex:r(m,w[M])})}return x},this.getExtExtKeyUsage=function(m,y){if(m===void 0&&y===void 0){var b=this.getExtInfo("extKeyUsage");if(b===void 0)return;m=i(this.hex,b.vidx),y=b.critical}var x={extname:"extKeyUsage",array:[]};y&&(x.critical=!0);for(var w=e(m,0),M=0;M<w.length;M++)x.array.push(A(r(m,w[M])));return x},this.getExtExtKeyUsageName=function(){var m=this.getExtInfo("extKeyUsage");if(m===void 0)return m;var y=new Array,b=i(this.hex,m.vidx);if(b==="")return y;for(var x=e(b,0),w=0;w<x.length;w++)y.push(A(r(b,x[w])));return y},this.getExtSubjectAltName=function(m,y){if(m===void 0&&y===void 0){var b=this.getExtInfo("subjectAltName");if(b===void 0)return;m=i(this.hex,b.vidx),y=b.critical}var x={extname:"subjectAltName",array:[]};return y&&(x.critical=!0),x.array=this.getGeneralNames(m),x},this.getExtIssuerAltName=function(m,y){if(m===void 0&&y===void 0){var b=this.getExtInfo("issuerAltName");if(b===void 0)return;m=i(this.hex,b.vidx),y=b.critical}var x={extname:"issuerAltName",array:[]};return y&&(x.critical=!0),x.array=this.getGeneralNames(m),x},this.getGeneralNames=function(m){for(var y=e(m,0),b=[],x=0;x<y.length;x++){var w=this.getGeneralName(i(m,y[x]));w!==void 0&&b.push(w)}return b},this.getGeneralName=function(m){var y=m.substr(0,2),b=r(m,0),x=Hr(b);if(y=="81")return{rfc822:x};if(y=="82")return{dns:x};if(y=="86")return{uri:x};if(y=="87")return{ip:Is(b)};if(y=="a4")return{dn:this.getX500Name(b)}},this.getExtSubjectAltName2=function(){var m,y,b,x=this.getExtInfo("subjectAltName");if(x===void 0)return x;for(var w=new Array,M=i(this.hex,x.vidx),S=e(M,0),E=0;E<S.length;E++)b=M.substr(S[E],2),m=r(M,S[E]),b==="81"&&(y=Tr(m),w.push(["MAIL",y])),b==="82"&&(y=Tr(m),w.push(["DNS",y])),b==="84"&&(y=$e.hex2dn(m,0),w.push(["DN",y])),b==="86"&&(y=Tr(m),w.push(["URI",y])),b==="87"&&(y=Is(m),w.push(["IP",y]));return w},this.getExtCRLDistributionPoints=function(m,y){if(m===void 0&&y===void 0){var b=this.getExtInfo("cRLDistributionPoints");if(b===void 0)return;m=i(this.hex,b.vidx),y=b.critical}var x={extname:"cRLDistributionPoints",array:[]};y&&(x.critical=!0);for(var w=e(m,0),M=0;M<w.length;M++){var S=i(m,w[M]);x.array.push(this.getDistributionPoint(S))}return x},this.getDistributionPoint=function(m){for(var y={},b=e(m,0),x=0;x<b.length;x++){var w=m.substr(b[x],2),M=i(m,b[x]);w=="a0"&&(y.dpname=this.getDistributionPointName(M))}return y},this.getDistributionPointName=function(m){for(var y={},b=e(m,0),x=0;x<b.length;x++){var w=m.substr(b[x],2),M=i(m,b[x]);w=="a0"&&(y.full=this.getGeneralNames(M))}return y},this.getExtCRLDistributionPointsURI=function(){var m=this.getExtInfo("cRLDistributionPoints");if(m===void 0)return m;for(var y=new Array,b=e(this.hex,m.vidx),x=0;x<b.length;x++)try{var w=a(this.hex,b[x],[0,0,0],"86"),M=Tr(w);y.push(M)}catch(S){}return y},this.getExtAIAInfo=function(){var m=this.getExtInfo("authorityInfoAccess");if(m===void 0)return m;for(var y={ocsp:[],caissuer:[]},b=e(this.hex,m.vidx),x=0;x<b.length;x++){var w=a(this.hex,b[x],[0],"06"),M=a(this.hex,b[x],[1],"86");w==="2b06010505073001"&&y.ocsp.push(Tr(M)),w==="2b06010505073002"&&y.caissuer.push(Tr(M))}return y},this.getExtAuthorityInfoAccess=function(m,y){if(m===void 0&&y===void 0){var b=this.getExtInfo("authorityInfoAccess");if(b===void 0)return;m=i(this.hex,b.vidx),y=b.critical}var x={extname:"authorityInfoAccess",array:[]};y&&(x.critical=!0);for(var w=e(m,0),M=0;M<w.length;M++){var S=o(m,w[M],[0],"06"),E=a(m,w[M],[1],"86"),B=Tr(E);if(S=="2b06010505073001")x.array.push({ocsp:B});else if(S=="2b06010505073002")x.array.push({caissuer:B});else throw new Error("unknown method: "+S)}return x},this.getExtCertificatePolicies=function(m,y){if(m===void 0&&y===void 0){var b=this.getExtInfo("certificatePolicies");if(b===void 0)return;m=i(this.hex,b.vidx),y=b.critical}var x={extname:"certificatePolicies",array:[]};y&&(x.critical=!0);for(var w=e(m,0),M=0;M<w.length;M++){var S=i(m,w[M]),E=this.getPolicyInformation(S);x.array.push(E)}return x},this.getPolicyInformation=function(m){var y={},b=a(m,0,[0],"06");y.policyoid=A(b);var x=c(m,0,[1],"30");if(x!=-1){y.array=[];for(var w=e(m,x),M=0;M<w.length;M++){var S=i(m,w[M]),E=this.getPolicyQualifierInfo(S);y.array.push(E)}}return y},this.getPolicyQualifierInfo=function(m){var y={},b=a(m,0,[0],"06");if(b==="2b06010505070201"){var x=o(m,0,[1],"16");y.cps=Hr(x)}else if(b==="2b06010505070202"){var w=s(m,0,[1],"30");y.unotice=this.getUserNotice(w)}return y},this.getUserNotice=function(m){for(var y={},b=e(m,0),x=0;x<b.length;x++){var w=i(m,b[x]);w.substr(0,2)!="30"&&(y.exptext=this.getDisplayText(w))}return y},this.getDisplayText=function(m){var y={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"},b={};return b.type=y[m.substr(0,2)],b.str=Hr(r(m,0)),b},this.getExtCRLNumber=function(m,y){var b={extname:"cRLNumber"};if(y&&(b.critical=!0),m.substr(0,2)=="02")return b.num={hex:r(m,0)},b;throw new Error("hExtV parse error: "+m)},this.getExtCRLReason=function(m,y){var b={extname:"cRLReason"};if(y&&(b.critical=!0),m.substr(0,2)=="0a")return b.code=parseInt(r(m,0),16),b;throw new Error("hExtV parse error: "+m)},this.getExtOcspNonce=function(m,y){var b={extname:"ocspNonce"};y&&(b.critical=!0);var x=r(m,0);return b.hex=x,b},this.getExtOcspNoCheck=function(m,y){var b={extname:"ocspNoCheck"};return y&&(b.critical=!0),b},this.getExtAdobeTimeStamp=function(m,y){if(m===void 0&&y===void 0){var b=this.getExtInfo("adobeTimeStamp");if(b===void 0)return;m=i(this.hex,b.vidx),y=b.critical}var x={extname:"adobeTimeStamp"};y&&(x.critical=!0);var w=e(m,0);if(w.length>1){var M=i(m,w[1]),S=this.getGeneralName(M);S.uri!=null&&(x.uri=S.uri)}if(w.length>2){var E=i(m,w[2]);E=="0101ff"&&(x.reqauth=!0),E=="010100"&&(x.reqauth=!1)}return x},this.getX500NameRule=function(m){for(var y=null,b=[],x=0;x<m.length;x++)for(var w=m[x],M=0;M<w.length;M++)b.push(w[M]);for(var x=0;x<b.length;x++){var S=b[x],E=S.ds,B=S.value,R=S.type;if(E!="prn"&&E!="utf8"&&E!="ia5")return"mixed";if(E=="ia5"){if(R!="CN")return"mixed";if(ae.lang.String.isMail(B))continue;return"mixed"}if(R=="C"){if(E=="prn")continue;return"mixed"}if(y==null)y=E;else if(y!==E)return"mixed"}return y==null?"prn":y},this.getX500Name=function(m){var y=this.getX500NameArray(m),b=this.dnarraytostr(y);return{array:y,str:b}},this.getX500NameArray=function(m){for(var y=[],b=e(m,0),x=0;x<b.length;x++)y.push(this.getRDN(i(m,b[x])));return y},this.getRDN=function(m){for(var y=[],b=e(m,0),x=0;x<b.length;x++)y.push(this.getAttrTypeAndValue(i(m,b[x])));return y},this.getAttrTypeAndValue=function(m){var y={type:null,value:null,ds:null},b=e(m,0),x=a(m,b[0],[],"06"),w=a(m,b[1],[]),M=ae.asn1.ASN1Util.oidHexToInt(x);return y.type=ae.asn1.x509.OID.oid2atype(M),y.ds=this.HEX2STAG[m.substr(b[1],2)],y.ds!="bmp"?y.value=Tr(w):y.value=Af(w),y},this.readCertPEM=function(m){this.readCertHex(v(m))},this.readCertHex=function(m){this.hex=m,this.getVersion();try{l(this.hex,0,[0,7],"a3"),this.parseExt()}catch(y){}},this.getParam=function(){var m={};return m.version=this.getVersion(),m.serial={hex:this.getSerialNumberHex()},m.sigalg=this.getSignatureAlgorithmField(),m.issuer=this.getIssuer(),m.notbefore=this.getNotBefore(),m.notafter=this.getNotAfter(),m.subject=this.getSubject(),m.sbjpubkey=pf(this.getPublicKeyHex(),"PUBLIC KEY"),this.aExtInfo.length>0&&(m.ext=this.getExtParamArray()),m.sighex=this.getSignatureValueHex(),m},this.getExtParamArray=function(m){if(m==null){var y=c(this.hex,0,[0,"[3]"]);y!=-1&&(m=u(this.hex,0,[0,"[3]",0],"30"))}for(var b=[],x=e(m,0),w=0;w<x.length;w++){var M=i(m,x[w]),S=this.getExtParam(M);S!=null&&b.push(S)}return b},this.getExtParam=function(m){var y=e(m,0),b=y.length;if(b!=2&&b!=3)throw new Error("wrong number elements in Extension: "+b+" "+m);var x=h(a(m,0,[0],"06")),w=!1;b==3&&s(m,0,[1])=="0101ff"&&(w=!0);var M=s(m,0,[b-1,0]),S=void 0;if(x=="2.5.29.14"?S=this.getExtSubjectKeyIdentifier(M,w):x=="2.5.29.15"?S=this.getExtKeyUsage(M,w):x=="2.5.29.17"?S=this.getExtSubjectAltName(M,w):x=="2.5.29.18"?S=this.getExtIssuerAltName(M,w):x=="2.5.29.19"?S=this.getExtBasicConstraints(M,w):x=="2.5.29.31"?S=this.getExtCRLDistributionPoints(M,w):x=="2.5.29.32"?S=this.getExtCertificatePolicies(M,w):x=="2.5.29.35"?S=this.getExtAuthorityKeyIdentifier(M,w):x=="2.5.29.37"?S=this.getExtExtKeyUsage(M,w):x=="1.3.6.1.5.5.7.1.1"?S=this.getExtAuthorityInfoAccess(M,w):x=="2.5.29.20"?S=this.getExtCRLNumber(M,w):x=="2.5.29.21"?S=this.getExtCRLReason(M,w):x=="1.3.6.1.5.5.7.48.1.2"?S=this.getExtOcspNonce(M,w):x=="1.3.6.1.5.5.7.48.1.5"?S=this.getExtOcspNoCheck(M,w):x=="1.2.840.113583.1.1.9.1"&&(S=this.getExtAdobeTimeStamp(M,w)),S!=null)return S;var E={extname:x,extn:M};return w&&(E.critical=!0),E},this.findExt=function(m,y){for(var b=0;b<m.length;b++)if(m[b].extname==y)return m[b];return null},this.dnarraytostr=function(m){function y(x){return x.map(function(w){return b(w).replace(/\+/,"\\+")}).join("+")}function b(x){return x.type+"="+x.value}return"/"+m.map(function(x){return y(x).replace(/\//,"\\/")}).join("/")},this.getInfo=function(){var m=function(z){var U=JSON.stringify(z.array).replace(/[\[\]\{\}\"]/g,"");return U},y=function(z){for(var U="",q=z.array,G=0;G<q.length;G++){var K=q[G];if(U+=" policy oid: "+K.policyoid+`
|
|
363
|
+
`,K.array!==void 0)for(var j=0;j<K.array.length;j++){var J=K.array[j];J.cps!==void 0&&(U+=" cps: "+J.cps+`
|
|
364
364
|
`)}}return U},b=function(z){for(var U="",q=z.array,G=0;G<q.length;G++){var K=q[G];try{K.dpname.full[0].uri!==void 0&&(U+=" "+K.dpname.full[0].uri+`
|
|
365
|
-
`)}catch(
|
|
366
|
-
`)}catch(
|
|
365
|
+
`)}catch(j){}try{K.dname.full[0].dn.hex!==void 0&&(U+=" "+$e.hex2dn(K.dpname.full[0].dn.hex)+`
|
|
366
|
+
`)}catch(j){}}return U},x=function(z){for(var U="",q=z.array,G=0;G<q.length;G++){var K=q[G];K.caissuer!==void 0&&(U+=" caissuer: "+K.caissuer+`
|
|
367
367
|
`),K.ocsp!==void 0&&(U+=" ocsp: "+K.ocsp+`
|
|
368
368
|
`)}return U},w,M,S;if(w=`Basic Fields
|
|
369
369
|
`,w+=" serial number: "+this.getSerialNumberHex()+`
|
|
@@ -377,18 +377,18 @@
|
|
|
377
377
|
`,M.type==="RSA"&&(w+=" n="+Ts(M.n.toString(16)).substr(0,16)+`...
|
|
378
378
|
`,w+=" e="+Ts(M.e.toString(16))+`
|
|
379
379
|
`),S=this.aExtInfo,S!=null){w+=`X509v3 Extensions:
|
|
380
|
-
`;for(var E=0;E<S.length;E++){var
|
|
381
|
-
`,
|
|
380
|
+
`;for(var E=0;E<S.length;E++){var B=S[E],R=ae.asn1.x509.OID.oid2name(B.oid);R===""&&(R=B.oid);var C="";if(B.critical===!0&&(C="CRITICAL"),w+=" "+R+" "+C+`:
|
|
381
|
+
`,R==="basicConstraints"){var I=this.getExtBasicConstraints();I.cA===void 0?w+=` {}
|
|
382
382
|
`:(w+=" cA=true",I.pathLen!==void 0&&(w+=", pathLen="+I.pathLen),w+=`
|
|
383
|
-
`)}else if(
|
|
384
|
-
`;else if(
|
|
385
|
-
`;else if(
|
|
386
|
-
`)}else if(
|
|
387
|
-
`}else if(
|
|
388
|
-
`}else if(
|
|
383
|
+
`)}else if(R==="keyUsage")w+=" "+this.getExtKeyUsageString()+`
|
|
384
|
+
`;else if(R==="subjectKeyIdentifier")w+=" "+this.getExtSubjectKeyIdentifier().kid.hex+`
|
|
385
|
+
`;else if(R==="authorityKeyIdentifier"){var L=this.getExtAuthorityKeyIdentifier();L.kid!==void 0&&(w+=" kid="+L.kid.hex+`
|
|
386
|
+
`)}else if(R==="extKeyUsage"){var T=this.getExtExtKeyUsage().array;w+=" "+T.join(", ")+`
|
|
387
|
+
`}else if(R==="subjectAltName"){var F=m(this.getExtSubjectAltName());w+=" "+F+`
|
|
388
|
+
`}else if(R==="cRLDistributionPoints"){var D=this.getExtCRLDistributionPoints();w+=b(D)}else if(R==="authorityInfoAccess"){var V=this.getExtAuthorityInfoAccess();w+=x(V)}else R==="certificatePolicies"&&(w+=y(this.getExtCertificatePolicies()))}}return w+="signature algorithm: "+this.getSignatureAlgorithmName()+`
|
|
389
389
|
`,w+="signature: "+this.getSignatureValueHex().substr(0,16)+`...
|
|
390
|
-
`,w},typeof n=="string"&&(n.indexOf("-----BEGIN")!=-1?this.readCertPEM(n):ae.lang.String.isHex(n)&&this.readCertHex(n))}$e.hex2dn=function(n,t){t===void 0&&(t=0);var e=new $e;le.getTLV(n,t);var r=e.getX500Name(n);return r.str};$e.hex2rdn=function(n,t){if(t===void 0&&(t=0),n.substr(t,2)!=="31")throw new Error("malformed RDN");for(var e=new Array,r=le.getChildIdx(n,t),i=0;i<r.length;i++)e.push($e.hex2attrTypeValue(n,r[i]));return e=e.map(function(a){return a.replace("+","\\+")}),e.join("+")};$e.hex2attrTypeValue=function(n,t){var e=le,r=e.getV;if(t===void 0&&(t=0),n.substr(t,2)!=="30")throw new Error("malformed attribute type and value");var i=e.getChildIdx(n,t);i.length!==2||n.substr(i[0],2);var a=r(n,i[0]),o=ae.asn1.ASN1Util.oidHexToInt(a),s=ae.asn1.x509.OID.oid2atype(o),u=r(n,i[1]),l=Hr(u);return s+"="+l};$e.getPublicKeyFromCertHex=function(n){var t=new $e;return t.readCertHex(n),t.getPublicKey()};$e.getPublicKeyFromCertPEM=function(n){var t=new $e;return t.readCertPEM(n),t.getPublicKey()};$e.getPublicKeyInfoPropOfCertPEM=function(n){var t=le,e=t.getVbyList,r={},i,a;return r.algparam=null,i=new $e,i.readCertPEM(n),a=i.getPublicKeyHex(),r.keyhex=e(a,0,[1],"03").substr(2),r.algoid=e(a,0,[0,0],"06"),r.algoid==="2a8648ce3d0201"&&(r.algparam=e(a,0,[0,1],"06")),r};$e.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"];function Rs(n){return Me.SHA256(n).toString()}var lu=[function(){var n=new $e;return n.readCertPEM(function(){var t=113,e=126,r=0,i="";return arguments[r].split(i).map(function(a){return a.charCodeAt(r)>e?a:String.fromCharCode((a.charCodeAt(r)+t)%e)}).join(i)}(":::::ORTV[-PR_aVSVPNaR:::::ZVVS@ PPNErtNVONtVWNZR}@]nU\0ZaZN=TP`\0T`Vo@Q^ROPbNZVTSZ^P^fQc^^TRWQawR^ZNATN>bRPNU^zc}nzyg R^ZNATN>bROU^zc}nzyg R]ZN=TN>bRPtTn?bf?FZ_NQtfQc^^YQNq`gdSp?cyZ^P^fQc^^QQNWQ^aRvZPNTP`\0T`Vo@Q^RWN_fapzFqSFwfbOndSnzyuYz[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ZROaNQN^U<ZN=TP`\0T`Vo@Q^ROPbNNAVPN^P\0{y\0Bs\\8\0R[z]w??qZP?NpgdenSuvv?>|f_?UpYPcQ\\gCb8zxtSvsOQNg>[\\\0\bx\b_o@8\0g`Z<PyUE`8yu}\\g{@`s`zUgErRtve{YdCvoO@>WFDtABNp\0feUWszpQaEYNAc]^xB[@]BDAN8\b}XA=E\x07nO}Pud8TA ?yPrVv{\\>E]o`BO^RE^X[W[rEU?x\bf>V OUwY=>X[\\E`tW[8}VwpF\x07BQcnrPF}yUtd8<Doe_\b[oOVU\x07ep@pYY\0cegY{r ?\bAbq?ff8}UaXoN_D]_X_8yozYFT`N{`\\{zvu?\bDWT}=_<\x07StX Nx\x07\0\b \0aT=c@ucnWfR[vf>RFxAFV}{N`dN^\\<eawBPxx}quT=|{T_R@Fp^Y<ZevRsWaZ]V CVrRVtAAc[ Qp|d|tqoQ=T|XX =u\\N8XNCx\\aU>wz X<e@Vc?dy\\|^FEq|=p`pBdF@bs^d<]vp\\^TZ P\bZ\b\\YNNSZ_\\w^|TsD8db _ Y\\o^Cw>Z\0x\\^aN]wWf\bA} C^d_{\x07ZC@\by]gY@E BFY?OsaqbDcVgQbZeFc ovtucxnq|<TnuyXRveYFOegCpAs{YTe|>bE<OXsSqCBWD_SVepfvCCUg]z ZvQ[\0s|U>pFz\b=OwT``fNJJ:::::R[Q-PR_aVSVPNaR:::::")),n}()];function bf(n,t){for(var e=0,r=t;e<r.length;e++){var i=r[e];if(i.getSubjectHex()===n)return i}}function cu(n,t){var e=n.getIssuerHex();if(e===n.getSubjectHex())return n.verifySignature(n.getPublicKey());var r=bf(e,t);return!r||n.verifySignature(r.getPublicKey())===!1?!1:cu(r,t)}function fu(n){var t=n.getIssuerHex();return t===n.getSubjectHex()?!1:cu(n,lu)}function xf(n){var t=new $e;typeof n=="string"?t.readCertPEM(n):t.readCertHex(n.hex);var e=fu(t);return lu.push(t),e}function wf(n,t,e){var r=new $e;if(typeof e=="string"?r.readCertPEM(e):r.readCertHex(e.hex),fu(r)===!1)return!1;var i=new Ve;return i.readCertPubKeyHex(r.hex,6),!!i.verify(n,Go(t))}xf(function(){var t=113,e=126,r=0,i="";return arguments[r].split(i).map(function(a){return a.charCodeAt(r)>e?a:String.fromCharCode((a.charCodeAt(r)+t)%e)}).join(i)}(":::::ORTV[-PR_aVSVPNaR:::::ZVVTU PPONrtNVONtVWNW=_SVw VE=ZN=TP`\0T`Vo@Q^ROPbNZVTSZ^P^fQc^^TRWQawR^ZNATN>bRPNU^zc}nzyg R^ZNATN>bROU^zc}nzyg R]ZN=TN>bRPtTn?bf?FZ_NQtfQc^^YQNq`gdSp?cyZ^P^fQc^^QQNWQ^aRvZPNTP`\0T`Vo@Q^RWN_fapzFqSFwfbOndSnzyuYz[oaNrS=\bZQNAZaN\\aZ [QSnS=\b[aNBZQZ\\aZ [QSnZVTaZ^P^fQc^^TRWQawR^ZNATN>bRPNU^zc}nzyg R^ZNATN>bROU^zc}nzyg RbZOVTN>bRPtYoTyuoz}}f`Bwo?=\x07RQN\\Ot[cONZO>Wyfd\x07 gdb\x07RaN]Ot[cONZZPRuupz_@feWyZ`bVfWX|gVup[N^xOSugnec|fdy\x07ndB{^T\x07}fdB\0ndRf?FZVVPVwN[Otx\0uxvTF=ON^RSNN\\PNtENZVVPPtXPNtRN?=?]q[VD|{\\oyo`oOu}F SA\x07e`tn[t u\b8^a]qx\bE_^\x07ZN?[QC\0yuOpybY8r\\RPAS=8rUq\0E8>xean^e\bf]Y`XO}{C[Ur^?\0x[SRXvVQ\\CFr}QnAPRQ\x07FO=Yw\0_TePCOFV@|\x07N>ROXcDrT<>bW<ssO?NOT{^s]uU\0gS\bBffsfE\0AfDyQEZR`]XBo|Qw}yYdwwTvOFcBndUz^\\{] b=^yQYSTQ`]\0?tR{WRUun\\\0bVe_E|VWWV|r Ao\0 F`fdzCnRtq\br \b8eBp=Z\\TRaadc}@Eub`\x07quuNqAdF\0aUay{}x>tgVz` _YBFwu_q?egt8v[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>]\0=X`\b@uucp|^_Qb@uZouTX^o\0\\{PCq{ug\x078^f[YQAWad8FNqxFQE?ZOo }RnO\bsQc xyccn=nxvs>bDBf\b\bW\\TuTnvAO^U\0QXC>xx8FxRFf<tJ:::::R[Q-PR_aVSVPNaR:::::"));var Ao=function(n,t){return Ao=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])},Ao(n,t)};function ue(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Ao(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var O=function(){return O=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])}return t},O.apply(this,arguments)};function Ht(n,t,e,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(n,t,e,r);else for(var s=n.length-1;s>=0;s--)(o=n[s])&&(a=(i<3?o(a):i>3?o(t,e,a):o(t,e))||a);return i>3&&a&&Object.defineProperty(t,e,a),a}function Gt(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)}function ha(n,t,e,r){function i(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function s(c){try{l(r.next(c))}catch(d){o(d)}}function u(c){try{l(r.throw(c))}catch(d){o(d)}}function l(c){c.done?a(c.value):i(c.value).then(s,u)}l((r=r.apply(n,t||[])).next())})}function pa(n,t){var e={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(e=0)),e;)try{if(r=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return e.label++,{value:l[1],done:!1};case 5:e.label++,i=l[1],l=[0];continue;case 7:l=e.ops.pop(),e.trys.pop();continue;default:if(a=e.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){e=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){e.label=l[1];break}if(l[0]===6&&e.label<a[1]){e.label=a[1],a=l;break}if(a&&e.label<a[2]){e.label=a[2],e.ops.push(l);break}a[2]&&e.ops.pop(),e.trys.pop();continue}l=t.call(n,e)}catch(c){l=[6,c],i=0}finally{r=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function vt(n,t,e){if(e||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return n.concat(a||Array.prototype.slice.call(t))}function Mf(n){return typeof Symbol=="undefined"?"$Symbol<".concat(n,">$"):Symbol(n)}var ui=Mf("$$FIVE_EVENT$$");function Ni(n){return n[ui]||(n[ui]={}),n[ui]}function Sf(n){n[ui]&&delete n[ui]}var va=function(){function n(){}return n.prototype.hasListener=function(t){var e=Ni(this);return e&&e[t]&&e[t].callbacks.length>0},n.prototype.on=function(t,e,r){var i=this,a=Ni(this);return a[t]||(a[t]={callbacks:[]}),a[t].callbacks.push([e,r||!1]),function(){return i.off(t,e)}},n.prototype.once=function(t,e){return this.on(t,e,!0)},n.prototype.off=function(t,e){if(t===void 0){Sf(this);return}var r=Ni(this);if(r[t]||(r[t]={callbacks:[]}),e===void 0){r[t].callbacks.length=0;return}for(var i=0;i<r[t].callbacks.length&&r[t].callbacks[i][0]!==e;i++);i<r[t].callbacks.length&&r[t].callbacks.splice(i,1)},n.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var i=!1,a=Ni(this);a[t]||(a[t]={callbacks:[]});for(var o=a[t].callbacks.slice(),s=0,u=o;s<u.length;s++){var l=u[s],c=l[0],d=l[1],p=d===void 0?!1:d,A=c.apply(void 0,e);p&&this.off(t,c),A===!1&&(i=!0)}return i},n.prototype.waitUntil=function(t,e){var r=this;return new Promise(function(i){var a=r.on(t,function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];(!e||e.apply(void 0,o)!==!1)&&(i(o),a())})})},n}();function Q(){}var Cf=typeof performance!="undefined"&&typeof performance.timing!="undefined"?performance.timing.navigationStart:Date.now(),ve=typeof performance!="undefined"?function(){return Cf+performance.now()}:function(){return Date.now()};function ln(n){Object.freeze(n);var t=typeof n=="function",e=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(function(r){e.call(n,r)&&(!t||r!=="caller"&&r!=="callee"&&r!=="arguments")&&n[r]!==null&&(typeof n[r]=="object"||typeof n[r]=="function")&&!Object.isFrozen(n[r])&&ln(n[r])}),n}var Bs=/^([^.]+)(\.([^.]+))*$/;function Ef(n,t){if(n==="*")return!0;var e=n.split(".").reverse(),r=t.split(".").reverse();if(e.length<=1)return n===t;for(var i=0;i<e.length;i++)if(e[i]!==r[i])return!1;return!0}function Tn(n){return/^(([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])(\.(?!$)|$)){4}$/.test(n)}function hn(n,t){return Bs.test(n)&&Bs.test(t)&&Ef(n,t)}var If=[/\.([0-9a-z]+)\.jsonp([\?\#].*)?$/i,/jsonp_([0-9a-z]+)([\?\#].*)?$/i],Rr=ln(JSON.parse(function(){var t=113,e=126,r=0,i="";return arguments[r].split(i).map(function(a){return a.charCodeAt(r)>e?a:String.fromCharCode((a.charCodeAt(r)+t)%e)}).join(i)}("h/y|pnyu|/9/xr;p|z/9/yvn{wvn;p|z/9/rnyrr;p|z/9/rnyrr;p{/9/rnyrr;w}/9/uv;p|z/9/uv;p{/9/rnyrr;p{/9/rnyrr;p|z/9/ywpq{;p|z/9/rnyrr:pq{;p|z/9/rnyrr:pq{;p{/9/rnyrr;nv/9/;p{/9/pq{;p{/9/pnyp{|qr;vr/j"))),bi=function(n){ue(t,n);function t(e,r,i){return n.call(this,"[NETWORK]: request proxy error(type: ".concat(r,", reason: ").concat(i,"): ").concat(e))||this}return t}(Error),Kn=function(n){ue(t,n);function t(e,r,i){var a=n.call(this,"[NETWORK]: response error(type: ".concat(r,", status: ").concat(i,"): ").concat(e))||this;return a.httpStatus=i,a}return t}(Error);(function(n){ue(t,n);function t(e,r){return n.call(this,"[NETWORK]: request abort(type: ".concat(r,"): ").concat(e))||this}return t})(Error);var vi=function(n){ue(t,n);function t(e,r,i){return n.call(this,"[NETWORK]: request timeout(type: ".concat(r,", timeout: ").concat(i,"ms): ").concat(e))||this}return t}(Error),Ko=function(n){ue(t,n);function t(e,r,i){return n.call(this,"[NETWORK]: request forbidden(type: ".concat(r,", reason: ").concat(i,"): ").concat(e))||this}return t}(Error);function Tf(n){if(!n)return{};for(var t={},e=n.trim().split(`
|
|
391
|
-
`),r=0;r<e.length;r++){var i=e[r],a=i.indexOf(":"),o=i.slice(0,a).trim().toLowerCase(),s=i.slice(a+1).trim();s&&(t[o]?t[o]+=", "+s:t[o]=s)}return t}function go(n){for(var t=0,e=If;t<e.length;t++){var r=e[t],i=n.match(r);if(i)return"jsonp_"+i[1]}return null}function Fs(n){return go(n)!==null}function Ls(n){var t=n.match(/^([0-9a-z]+\:)\/\/(([^:/?#]*)(?::[0-9]+)?)/);return t?t[1]:location.protocol}function jo(n){if(/^blob\:/i.test(n))return"blob:";if(/^data\:/i.test(n))return"data:";var t=n.match(/^[0-9a-z]+\:\/\/(([^:/?#]*)(?::[0-9]+)?)/i);return t?t[2]:location.hostname}var du=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(va);function qn(n,t,e,r,i){t===void 0&&(t={}),e===void 0&&(e=Q),r===void 0&&(r=Q),i===void 0&&(i=Q);var a=ve(),o=n;return Promise.resolve().then(function(){return t.requestProxy?t.requestProxy(n):n}).then(function(s){return/^https\:/.test(location.href)&&/^http\:/.test(s)?(console.warn("The page at '".concat(location.href,"' was loaded over HTTPS, but requested an insecure element '").concat(s,"'. This request was automatically upgraded to HTTPS")),s.replace(/^http\:/,"https:")):s}).catch(function(s){var u,l=go(n),c=l?"Script":"XMLHttpRequest",d=new bi(o,c,s&&s.message?String(s.message):String(s));return(u=t.networkSubscribe)===null||u===void 0||u.emit("network",n,c,"proxy-error",d.message),Promise.reject(d)}).then(function(s){return new Promise(function(u,l){var c,d=t.allowHosts?Rr.concat(t.allowHosts):Rr.slice(),p=jo(s),A=go(s);if(location.hostname.length!==0&&!Tn(location.hostname)&&Rr.filter(function(F){return hn(F,location.hostname)}).length===0&&!Tn(p)&&d.filter(function(F){return hn(F,p)}).length===0){var h=A?"Script":"XMLHttpRequest",v=new Ko(s,h,"request host(".concat(p,") is not allowed"));r(v),l(v),(c=t.networkSubscribe)===null||c===void 0||c.emit("network",s,h,"forbidden",v.message);return}if(A){var g=window,m=null,y=!1,b=document.createElement("script"),x=function(){var F;if(m=null,y!==!0){y=!0;var T=new vi(s,"Script",t.timeout||NaN);r(T),l(T),(F=t.networkSubscribe)===null||F===void 0||F.emit("network",s,"Script","timeout",T.message)}},w=function(F){var T,L,D=ve(),V=D-a;if(delete g[A],b.parentNode&&b.parentNode.removeChild(b),m!==null&&(window.clearTimeout(m),m=null),y!==!0){if(F.indexOf("data:")!==0){var z=new Kn(s,"Script",500);r(z),l(z),(T=t.networkSubscribe)===null||T===void 0||T.emit("network",s,"Script","error",z.message);return}var U=F.split(","),q=(U[0].match(/:(.*?);/)||[])[1],G=U[1];if(t.responseType==="arraybuffer"||t.responseType==="blob"){for(var K=atob(U[1]),_=K.length,J=new Uint8Array(_),W=0;W<_;W++)J[W]=K.charCodeAt(W);t.responseType==="arraybuffer"?G=J.buffer:G=new Blob([J],{type:q})}var $={},Y={body:G,meta:{origin:o,source:s,requestTime:a,responseTime:D,costs:V,headers:$}};e(Y),u(Y),(L=t.networkSubscribe)===null||L===void 0||L.emit("network",s,"Script","ok",JSON.stringify(Y.meta)),y=!0}};g[A]=w,b.src=s,document.body.appendChild(b),typeof t.timeout=="number"&&(m=window.setTimeout(x,t.timeout))}else{var M=!1,S=new XMLHttpRequest,E=function(){S&&(S.removeEventListener("timeout",P,!1),S.removeEventListener("progress",B,!1),S.removeEventListener("load",C,!1),S.removeEventListener("error",I,!1)),S=null,E=Q},P=function(){var F;if(M!==!0){M=!0,E();var T=new vi(s,"XMLHttpRequest",t.timeout||NaN);r(T),l(T),(F=t.networkSubscribe)===null||F===void 0||F.emit("network",s,"XMLHttpRequest","timeout",T.message)}},B=function(F){M!==!0&&F.lengthComputable&&(F.total<=0||i(F.loaded/F.total))},C=function(F){var T;if(M!==!0){var L=this.status;if(L===0||L>=200&&L<400){M=!0,E();var D=ve(),V=D-a,z=Tf(this.getAllResponseHeaders()),U=F.total,q={body:this.response,meta:{origin:o,source:s,requestTime:a,responseTime:D,costs:V,headers:z,size:U}};e(q),u(q),(T=t.networkSubscribe)===null||T===void 0||T.emit("network",s,"XMLHttpRequest","ok",JSON.stringify(q.meta))}else I.call(this)}},I=function(){var F;if(M!==!0){M=!0,E();var T=new Kn(s,"XMLHttpRequest",this.status);r(T),l(T),(F=t.networkSubscribe)===null||F===void 0||F.emit("network",s,"XMLHttpRequest","error",T.message)}};S.addEventListener("timeout",P,!1),S.addEventListener("progress",B,!1),S.addEventListener("load",C,!1),S.addEventListener("error",I,!1),t.responseType&&(S.responseType=t.responseType),typeof t.timeout=="number"&&(S.timeout=t.timeout),S.open("GET",s,!0),S.send(null)}})})}var Ta={};function Pf(n,t){t===void 0&&(t={});var e=ve(),r=n;return Promise.resolve().then(function(){return t.requestProxy?t.requestProxy(n):n}).then(function(i){return/^https\:/.test(location.href)&&/^http\:/.test(i)?(console.warn("The page at '".concat(location.href,"' was loaded over HTTPS, but requested an insecure element '").concat(i,"'. This request was automatically upgraded to HTTPS")),i.replace(/^http\:/,"https:")):i}).catch(function(i){var a,o=new bi(r,"Link",i&&i.message?String(i.message):String(i));return(a=t.networkSubscribe)===null||a===void 0||a.emit("network",n,"Link","proxy-error",o.message),Promise.reject(o)}).then(function(i){return i in Ta?Ta[i]:Ta[i]=new Promise(function(a,o){var s,u=t.allowHosts?Rr.concat(t.allowHosts):Rr.slice(),l=jo(i);if(location.hostname.length!==0&&!Tn(location.hostname)&&Rr.filter(function(v){return hn(v,location.hostname)}).length===0&&!Tn(l)&&u.filter(function(v){return hn(v,l)}).length===0){var c=new Ko(i,"Link","request host(".concat(l,") is not allowed"));o(c),(s=t.networkSubscribe)===null||s===void 0||s.emit("network",i,"Link","forbidden",c.message);return}var d=document.createElement("link"),p=!1,A=null;d.onload=function(v){var g;if(A!==null&&(clearTimeout(A),A=null),p!==!0){p=!0,a();var m=ve(),y=m-e,b={},x={origin:r,source:i,requestTime:e,responseTime:m,costs:y,headers:b};(g=t.networkSubscribe)===null||g===void 0||g.emit("network",i,"Link","preload",JSON.stringify(x))}},d.onerror=function(v){var g;if(A!==null&&(clearTimeout(A),A=null),p!==!0){p=!0;var m=new Kn(i,"Link",0);o(m),(g=t.networkSubscribe)===null||g===void 0||g.emit("network",i,"Link","error",m.message)}},typeof t.timeout=="number"&&(A=window.setTimeout(function(){var v;if(A=null,p!==!0){p=!0,a();var g=ve(),m=g-e,y={},b={origin:r,source:i,requestTime:e,responseTime:g,costs:m,headers:y};(v=t.networkSubscribe)===null||v===void 0||v.emit("network",i,"Link","timeout",JSON.stringify(b))}},t.timeout)),d.rel=d.relList&&d.relList.supports("prefetch")?"prefetch":"preload",d.as="fetch",d.crossOrigin="",d.fetchPriority="high",d.href=i;var h=document.head||document.getElementsByTagName("head")[0];h&&h.appendChild(d)})})}function Rf(n,t,e,r,i,a){t===void 0&&(t={}),e===void 0&&(e=Q),r===void 0&&(r=Q),i===void 0&&(i=Q);var o=ve(),s=n;return Promise.resolve().then(function(){return t.requestProxy?t.requestProxy(n):n}).then(function(u){return/^https\:/.test(location.href)&&/^http\:/.test(u)?(console.warn("The page at '".concat(location.href,"' was loaded over HTTPS, but requested an insecure element '").concat(u,"'. This request was automatically upgraded to HTTPS")),u.replace(/^http\:/,"https:")):u}).catch(function(u){var l,c=new bi(s,"Image",u&&u.message?String(u.message):String(u));return(l=t.networkSubscribe)===null||l===void 0||l.emit("network",n,"Image","proxy-error",c.message),Promise.reject(c)}).then(function(u){return new Promise(function(l,c){var d,p=t.allowHosts?Rr.concat(t.allowHosts):Rr.slice(),A=jo(u);if(location.hostname.length!==0&&!Tn(location.hostname)&&Rr.filter(function(x){return hn(x,location.hostname)}).length===0&&!Tn(A)&&p.filter(function(x){return hn(x,A)}).length===0){var h=new Ko(u,"Image","request host(".concat(A,") is not allowed"));r(h),c(h),(d=t.networkSubscribe)===null||d===void 0||d.emit("network",u,"Image","forbidden",h.message);return}var v=a!=null?a:new Image,g=!1,m=null,y=function(){var x;if(v.onload=Q,v.onerror=Q,m!==null&&(clearTimeout(m),m=null),g!==!0){var w=ve(),M={headers:{},origin:s,source:u,requestTime:o,responseTime:w,costs:w-o};g=!0;var S={body:v,meta:M};i(1),e(S),l(S),(x=t.networkSubscribe)===null||x===void 0||x.emit("network",u,"Image","ok",JSON.stringify(S.meta))}},b=function(){var x;if(v.onload=Q,v.onerror=Q,m!==null&&(clearTimeout(m),m=null),g!==!0){g=!0;var w=new Kn(u,"Image",0);r(w),c(w),(x=t.networkSubscribe)===null||x===void 0||x.emit("network",u,"Image","ok",w.message)}};typeof t.timeout=="number"&&(m=window.setTimeout(function(){var x;if(v.onload=Q,v.onerror=Q,m=null,g!==!0){g=!0;var w=new vi(u,"Image",t.timeout);r(w),c(w),(x=t.networkSubscribe)===null||x===void 0||x.emit("network",u,"Image","timeout",w.message)}},t.timeout)),v.onload=y,v.onerror=b,i(0),v.src=u})})}var Ut=function(){function n(t){t===void 0&&(t={}),this.options=Object.freeze(t),this.options.allowHosts&&Object.freeze(this.options.allowHosts)}return n.prototype.ajax=function(t,e,r,i,a){var o;e===void 0&&(e={}),r===void 0&&(r=Q),i===void 0&&(i=Q),a===void 0&&(a=Q);var s=this.options,u={responseType:e.responseType,timeout:(o=e.timeout)!==null&&o!==void 0?o:s.timeout,get allowHosts(){var l;return(l=e.allowHosts)!==null&&l!==void 0?l:s.allowHosts},get requestProxy(){var l;return(l=e.requestProxy)!==null&&l!==void 0?l:s.requestProxy},get networkSubscribe(){var l;return(l=e.networkSubscribe)!==null&&l!==void 0?l:s.networkSubscribe}};return qn(t,u,r,i,a)},n.prototype.loadImage=function(t,e,r,i,a,o){var s;e===void 0&&(e={}),r===void 0&&(r=Q),i===void 0&&(i=Q),a===void 0&&(a=Q);var u=this.options,l={timeout:(s=e.timeout)!==null&&s!==void 0?s:u.timeout,get allowHosts(){var c;return(c=e.allowHosts)!==null&&c!==void 0?c:u.allowHosts},get requestProxy(){var c;return(c=e.requestProxy)!==null&&c!==void 0?c:u.requestProxy},get networkSubscribe(){var c;return(c=e.networkSubscribe)!==null&&c!==void 0?c:u.networkSubscribe}};return Rf(t,l,r,i,a,o)},n.prototype.preload=function(t,e){var r;e===void 0&&(e={});var i=this.options,a={timeout:(r=e.timeout)!==null&&r!==void 0?r:i.timeout,get allowHosts(){var o;return(o=e.allowHosts)!==null&&o!==void 0?o:i.allowHosts},get requestProxy(){var o;return(o=e.requestProxy)!==null&&o!==void 0?o:i.requestProxy},get networkSubscribe(){var o;return(o=e.networkSubscribe)!==null&&o!==void 0?o:i.networkSubscribe}};return Pf(t,a)},n}(),ra=new Ut;function ce(n,t,e){return n<t?t:n>e?e:n}var yo=function(){var n=ve();return{requestAnimationFrame:function(t){var e=ve(),r=ce(16+(e-n),16,33),i=setTimeout(function(){t(e+r)},r);return n=e+r,i},cancelAnimationFrame:function(t){return clearTimeout(t)}}}(),ks=function(){if(typeof window!="undefined"){var n=window;if(n.requestAnimationFrame)return{requestAnimationFrame:n.requestAnimationFrame.bind(n),cancelAnimationFrame:n.cancelAnimationFrame.bind(n)};if(n.mozRequestAnimationFrame)return{requestAnimationFrame:n.mozRequestAnimationFrame.bind(n),cancelAnimationFrame:n.mozCancelAnimationFrame.bind(n)};if(n.webkitRequestAnimationFrame)return{requestAnimationFrame:n.webkitRequestAnimationFrame.bind(n),cancelAnimationFrame:n.webkitCancelAnimationFrame.bind(n)};if(n.msRequestAnimationFrame)return{requestAnimationFrame:n.msRequestAnimationFrame.bind(n),cancelAnimationFrame:n.msCancelAnimationFrame.bind(n)}}return yo}(),Bf=5,Os=16,Mt=function(){function n(){this.loopType="raf",this.frames=[],this.isAnimating=!1,this.context=null;var t=ve();this.loop=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(this.isAnimating!==!1){var i=ve(),a=i-t;t=i,Os=a;for(var o=0;o<this.frames.length;o++){var s=this.frames[o];if(s.delay>0){s.delay=s.delay-1;continue}try{s.callback.apply(s,vt([i,a],e,!1))}catch(u){console.error(u)}s.once&&(this.frames.splice(o,1),o--)}this.requestId=this.requestAnimationFrame(this.loop)}}.bind(this),this.start()}return Object.defineProperty(n,"shared",{get:function(){return this.sharedInstance||(this.sharedInstance=new n),this.sharedInstance},enumerable:!1,configurable:!0}),n.getFrameTime=function(){return Os},n.prototype.start=function(){this.isAnimating!==!0&&(this.isAnimating=!0,this.requestId=this.requestAnimationFrame(this.loop))},n.prototype.stop=function(){this.isAnimating=!1,this.cancelAnimationFrame(this.requestId)},n.prototype.setContext=function(t){t!==this.context&&(this.stop(),this.context=t,this.start())},n.prototype.getContext=function(){return this.context},n.prototype.setLoopType=function(t){t!==this.loopType&&(this.stop(),this.loopType=t,this.start())},n.prototype.getLoopType=function(){return this.loopType},n.prototype.requestAnimationFrame=function(t){if(this.context)return this.context.requestAnimationFrame(t);if(this.loopType==="raf")return ks.requestAnimationFrame(t);if(this.loopType==="sto")return yo.requestAnimationFrame(t)},n.prototype.cancelAnimationFrame=function(t){if(this.context)this.context.cancelAnimationFrame(t);else if(this.loopType==="raf")ks.cancelAnimationFrame(t);else if(this.loopType==="sto")return yo.cancelAnimationFrame(t)},n.prototype.remove=function(t){var e=this.frames.indexOf(t);e>=0&&this.frames.splice(e,1)},n.prototype.add=function(t,e,r,i){var a=this;e===void 0&&(e=!1),r===void 0&&(r=0),i===void 0&&(i=Bf);for(var o={callback:t,once:e,delay:r,order:i},s=this.frames.length;--s>=0;)if(this.frames[s].order<=i){this.frames.splice(s+1,0,o);break}return s<0&&this.frames.unshift(o),function(){return a.remove(o)}},n.prototype.clear=function(){this.frames.length=0},n}(),Ff={"vrlab-public.ljcdn.com":{type:"tencentCloud",pano:["vrlab-image1.ljcdn.com","vrlab-image2.ljcdn.com"],texture:["vrlab-image3.ljcdn.com"],tile:["vr-tile-1.realsee-cdn.cn","vr-tile-2.realsee-cdn.cn"],model:["vr-model-1.realsee-cdn.cn","vr-model-2.realsee-cdn.cn"],default:["vrlab-image4.ljcdn.com"]},"vr-public.realsee-cdn.cn":{type:"tencentCloud",pano:["vr-image-1.realsee-cdn.cn","vr-image-2.realsee-cdn.cn"],texture:["vr-image-3.realsee-cdn.cn"],tile:["vr-tile-1.realsee-cdn.cn","vr-tile-2.realsee-cdn.cn"],model:["vr-model-1.realsee-cdn.cn","vr-model-2.realsee-cdn.cn"],default:["vr-image-4.realsee-cdn.cn"]},"vr-public.rscdn.cn":{type:"tencentCloud",pano:["vr-image-1.rscdn.cn","vr-image-2.rscdn.cn"],texture:["vr-image-3.rscdn.cn"],tile:["vr-tile-1.rscdn.cn","vr-tile-2.rscdn.cn"],model:["vr-model-1.rscdn.cn","vr-model-2.rscdn.cn"],default:["vr-image-4.rscdn.cn"]},"mars-public.realsee-cdn.cn":{type:"aliyun",pano:["mars-image-1.realsee-cdn.cn","mars-image-2.realsee-cdn.cn"],texture:["mars-image-3.realsee-cdn.cn"],tile:["mars-tile-1.realsee-cdn.cn","mars-tile-2.realsee-cdn.cn"],model:["mars-model-1.realsee-cdn.cn","mars-model-2.realsee-cdn.cn"],default:["mars-image-4.realsee-cdn.cn"]},"global-public.realsee-cdn.com":{type:"tencentCloud",pano:["global-image-1.realsee-cdn.com","global-image-2.realsee-cdn.com"],texture:["global-image-3.realsee-cdn.com"],tile:["global-tile-1.realsee-cdn.com","global-tile-2.realsee-cdn.com"],model:["global-model-1.realsee-cdn.com","global-model-2.realsee-cdn.com"],default:["global-image-4.realsee-cdn.com"]},"earth-ga-public.realsee-cdn.cn":{type:"tencentCloud",pano:["earth-ga-image-1.realsee-cdn.cn","earth-ga-image-2.realsee-cdn.cn"],texture:["earth-ga-image-3.realsee-cdn.cn"],tile:["earth-ga-tile-1.realsee-cdn.cn","earth-ga-tile-2.realsee-cdn.cn"],model:["earth-ga-model-1.realsee-cdn.cn","earth-ga-model-2.realsee-cdn.cn"],default:["earth-ga-image-4.realsee-cdn.cn"]},"test-vr-public.realsee-cdn.com":{type:"tencentCloud",pano:["test-vr-image.realsee-cdn.com","test-vr-image.realsee-cdn.com"],texture:["test-vr-image.realsee-cdn.com"],tile:["test-vr-image.realsee-cdn.com","test-vr-image.realsee-cdn.com"],model:["test-vr-image.realsee-cdn.com","test-vr-image.realsee-cdn.com"],default:["test-vr-image.realsee-cdn.com"]},"test-vr-public.realsee-cdn.cn":{type:"tencentCloud",pano:["test-vr-image.realsee-cdn.cn","test-vr-image.realsee-cdn.cn"],texture:["test-vr-image.realsee-cdn.cn"],tile:["test-vr-image.realsee-cdn.cn","test-vr-image.realsee-cdn.cn"],model:["test-vr-image.realsee-cdn.cn","test-vr-image.realsee-cdn.cn"],default:["test-vr-image.realsee-cdn.cn"]}},hu=/^https?\:\/\/?([^\/]+)/;function Lf(n){var t=n.match(hu);return t===null?null:t[1]}function Fn(n,t){return n.replace(hu,function(e,r){return e.slice(0,e.length-r.length)+t})}function kf(n,t,e){var r=t.split("."),i=r[0],a=r.slice(1);if(i==="texture")return Fn(n,e.texture[0]);if(i==="pano"||i==="pano_luminance"){a[0];var o=a[1];switch(o){case"front":case"left":case"up":return Fn(n,e.pano[0]);case"down":case"right":case"back":return Fn(n,e.pano[1])}}else if(i==="pano_tile"||i==="pano_tile_luminance"){a[0],a[1];var s=a[2],u=a[3],l=a[4],c=Math.pow(2,Number(s))*Number(u)+Number(l);if(!isNaN(c))return Fn(n,e.tile[c%2])}else if(i==="model"){var d=a[0],c=Number(d);if(!isNaN(c))return Fn(n,e.model[c%2])}return Fn(n,e.default[0])}var Of=function(n,t){var e,r=n.split("?")[0],i=r.split(".").pop();if(i==="jpeg"&&(i="jpg"),i!=="png"&&i!=="jpg")return n;var a="";if(t.format!==void 0&&t.format!==i&&(a+="/format/".concat(t.format)),t.cut!==void 0&&(a+="/cut/".concat(t.cut[2],"x").concat(t.cut[3],"x").concat(t.cut[0],"x").concat(t.cut[1])),t.quality!==void 0){var o=(e=t.format)!==null&&e!==void 0?e:i;o&&["jpg","webp","tpg","heif","avif"].indexOf(o)>=0&&(a+="/quality/".concat(t.quality))}if(t.size!==void 0){var s=n.match(/\/cube_(\d+)\//),u=s?Number(s[1]):NaN;u!==Number(t.size)&&(a+="/thumbnail/".concat(t.size,"x"))}return t.sharpen!==void 0&&(a+="/sharpen/".concat(t.sharpen)),a.length&&(a="?imageMogr2"+a),r+a},Df=function(n,t){var e,r=n.split("?")[0],i=r.split(".").pop();if(i==="jpeg"&&(i="jpg"),i!=="png"&&i!=="jpg")return n;var a="",o=[],s=t.format,u=t.quality,l=t.size;if(s!==void 0&&s!==i&&o.push("format,".concat(s==="heif"?"heic":s)),t.cut!==void 0){var c=t.cut,d=c[0],p=c[1],A=c[2],h=c[3];o.push("crop,x_".concat(d,",y_").concat(p,",w_").concat(A,",h_").concat(h,",g_nw"))}if(u!==void 0&&u!==100){var v=(e=t.format)!==null&&e!==void 0?e:i;v&&["jpg","webp"].indexOf(v)>=0&&o.push("quality,Q_".concat(u))}return l&&l!==2048&&o.push("resize,w_".concat(l)),t.sharpen!==void 0&&o.push("sharpen,".concat(t.sharpen)),o.length&&(a="?x-oss-process=image/"+o.join("/")),r+a},Ln=9007199254740991;function An(n){var t=Math.round(n);return Math.abs(t-n)<.001?t:Math.floor(n)}function Vf(n){return n=Object.assign({},n),n.size!==void 0&&(n.size=An(ce(n.size,0,Ln))),n.quality!==void 0&&(n.quality=An(ce(n.quality,0,100))),n.cut!==void 0&&(n.cut=[An(ce(n.cut[0],0,Ln)),An(ce(n.cut[1],0,Ln)),An(ce(n.cut[2],0,Ln)),An(ce(n.cut[3],0,Ln))]),n.sharpen!==void 0&&(n.sharpen=An(ce(n.sharpen,0,Ln))),n}function ft(n,t){var e=O(O({},Ff),t.mappings),r=Lf(n);if(r===null)return n;t=Vf(t);var i=e[r];return i?(n=kf(n,t.key,i),/\.basis(\?|$)/.test(n)&&(n=n.replace(/\.basis(\?|$)/,".jpg$1")),i.type==="tencentCloud"?Of(n,t):i.type==="aliyun"?Df(n,t):n):n}function Cn(n,t,e){t===void 0&&(t=ft);var r=t(n,e);if(r===n&&e.cut)throw new Error("ImageURL: cut option not applied.");return r}var pu=/\/cube_(\d+)\//;function mi(n){var t=n.match(pu);return t?Number(t[1]):null}function tr(n,t){return n.replace(pu,"/cube_".concat(t,"/"))}var Nf="data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAIAAUAmJaQAA3AA/vz0AAA=",zf="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAAGhbWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAsaWxvYwAAAABEAAACAAEAAAABAAAB3gAAABkAAgAAAAEAAAHJAAAAFQAAAEJpaW5mAAAAAAACAAAAGmluZmUCAAAAAAEAAGF2MDFDb2xvcgAAAAAaaW5mZQIAAAAAAgAAYXYwMUFscGhhAAAAABppcmVmAAAAAAAAAA5hdXhsAAIAAQABAAAA12lwcnAAAACxaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIAAoAAAAAUaXNwZQAAAAAAAAACAAAAAgAAAA5waXhpAAAAAAEIAAAADGF2MUOBABwAAAAAOGF1eEMAAAAAdXJuOm1wZWc6bXBlZ0I6Y2ljcDpzeXN0ZW1zOmF1eGlsaWFyeTphbHBoYQAAAAAeaXBtYQAAAAAAAAACAAEEAQKDBAACBAUGhwgAAAA2bWRhdBIACgQYADLVMgsWQBhhIAQqrNj/+BIACgUYADLEoDIOFkADDDDCQAACDaqCCb4=",Qf="data:image/heif;base64,AAAAGGZ0eXBoZWljAAAAAG1pZjFoZWljAAABL21ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAHBpY3QAAAAAAAAAAAAAAAAAAAAADnBpdG0AAAAAAAEAAAAjaWluZgAAAAAAAQAAABVpbmZlAgAAAAABAABodmMxAAAAAK9pcHJwAAAAkmlwY28AAAB2aHZjQwEBYAAAAAAAAAAAAADwAPz9+PgAACcDoAABAB5AAQwG//8BYAAAAwAAAwAAAwAAAwAAAwAAreTLgSChAAEAI0IBBwFgAAADAAADAAADAAADAAADAAChInJJlreTLySZNdggogABAAdEAcA98DMkAAAAFGlzcGUAAAAAAAAAAgAAAAIAAAAVaXBtYQAAAAAAAAABAAECgQIAAAAiaWxvYwAAAABEQAABAAEAAAAAAU8AAQAAAAAAAAAOAAAAFm1kYXQAAAAKJgGvLvkQwuWM4A==";function Pa(n){return new Promise(function(t){var e=new Image,r=setTimeout(function(){e.onload=e.onerror=function(){},clearTimeout(r),t(!1)},100);e.onload=e.onerror=function(){e.onload=e.onerror=function(){},clearTimeout(r),t(e.height===2)},e.src=n})}var Ra=null;function vu(){return Ra||(Ra=Promise.all([Pa(Nf),Pa(zf),Pa(Qf)]).then(function(n){return{webp:n[0],avif:n[1],heif:n[2]}}))}var mu=/^(.*)\[(\d+)\]$/;function He(n){if(!isNaN(n.panoIndex)&&isFinite(n.panoIndex))return"".concat(n.workCode,"[").concat(n.panoIndex,"]");throw new Error("Invalid Pano")}function Lt(n){var t=n.match(mu);if(t){t[0];var e=t[1],r=t[2],i=Math.floor(Number(r));if(!isNaN(i)&&isFinite(i))return{workCode:e,panoIndex:i}}throw new Error("Invalid PanoId")}function Ar(n,t){return He(n)===He(t)}function Au(n){return typeof n=="string"&&mu.test(n)}var Uf=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(f.Group),Ot=function(n){ue(t,n);function t(e,r){return n.call(this,e,r)||this}return t.prototype.update=function(e,r,i,a){for(var o=0,s=this.material;o<s.length;o++){var u=s[o];u.update(e,r,i)}},t}(f.Mesh),gu=function(n){ue(t,n);function t(e,r,i){return n.call(this,e,r,i)||this}return t.prototype.update=function(e,r,i,a){for(var o=0,s=this.material;o<s.length;o++){var u=s[o];u.update(e,r,i)}},t}(f.SkinnedMesh);function ti(n,t){t===void 0&&(t=!1);var e=typeof n;if(e==="string")return JSON.stringify(n);if(n===!0)return"true";if(n===!1)return"false";if(n===null)return"null";if(n instanceof Array){for(var r="[",i=n.length-1,a=0;a<i;a++)r+=ti(n[a],!1)+",";return i>-1&&(r+=ti(n[a],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return ti(n.toJSON(),t);for(var o=Object.keys(n).sort(),s=o.length,r="",a=0;a<s;){var u=o[a],l=ti(n[u],!0);l!==void 0&&(a&&r!==""&&(r+=","),r+=JSON.stringify(u)+":"+l),a++}return"{"+r+"}"}switch(e){case"function":return JSON.stringify(n.toString());case"undefined":return t?void 0:null;case"number":return n;default:return isFinite(n)?n:null}}function ma(n){return"hash::".concat(ti(n,!1))}var qf=function(){function n(t){var e,r,i,a,o,s,u,l,c,d,p,A,h,v,g,m;this.uniforms=(e=t.uniforms)!==null&&e!==void 0?e:{},this.defines=(r=t.defines)!==null&&r!==void 0?r:{},this.type=t.type,this.vertex={mainBefore:(a=(i=t.vertex)===null||i===void 0?void 0:i.mainBefore)!==null&&a!==void 0?a:"",mainStart:(s=(o=t.vertex)===null||o===void 0?void 0:o.mainStart)!==null&&s!==void 0?s:"",mainEnd:(l=(u=t.vertex)===null||u===void 0?void 0:u.mainEnd)!==null&&l!==void 0?l:""},this.fragment={mainBefore:(d=(c=t.fragment)===null||c===void 0?void 0:c.mainBefore)!==null&&d!==void 0?d:"",mainStart:(A=(p=t.fragment)===null||p===void 0?void 0:p.mainStart)!==null&&A!==void 0?A:"",mainModelColor:(v=(h=t.fragment)===null||h===void 0?void 0:h.mainModelColor)!==null&&v!==void 0?v:"",mainEnd:(m=(g=t.fragment)===null||g===void 0?void 0:g.mainEnd)!==null&&m!==void 0?m:""}}return n.prototype.getHash=function(){return ma({vertex:this.vertex,fragment:this.fragment,defines:this.defines})},n.prototype.onBeforeCompile=function(t,e){},n}(),xi=function(){return typeof document!="undefined"?new f.TextureLoader().load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAABCAYAAACouxZ2AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAACAKADAAQAAAABAAAAAQAAAAB7UD0+AAACA0lEQVRIDXWUW3YjIQxEwdnV/GT/q8kO3FO3pAJst3PSAaR6Cbszf//9XeMxxpjXmI+pVXudp2s6PC4dqHff9e6D7/PZLy46xQvG+sZvrfK8xgXUeq85yINe9bdmtOK1+kun5vjgq58a+eZPna9jvmjiserqG/+Whathvo3L3WhV89L9sXI/m18z2uene9ap/ftsuT9WZxoHXzW56/fpj8l7+tTw7P011NdpqnY19sRsfuHMA9u8oZWfDz4+fra/dfG1V60ydZ7qba1g7UNAeK0JP7ydD7/OqH6wO2f7HTq+B/lbL9qsB3/N1/UzR81XfPzw4tp5OPvRneacteq8Xo0xR3vuv/kPz0KtX0Nhg0eHuaNXdWI3X/ld427h++vzyp99V6VPrzWFhbv4ayay4oFecm198MmUXN/mL+x7npq/uJXBGb/MTw4+t+SvbLoTZnUW5uHhz7nWcTxT73OwXV7cxT9wbBf/0LnDBgcnHmtPLYba32Hp808sMy1u88yhr58n70/v4xX92GSN19l/2UsqGmiH94Hpxjcs+DO/ccpIVNVp62PUWXu//ur1GQy1Cf+GZ13rtNYN1po3/NI79fGXibHkq4z25xvV2pW3szpneXsW8SsreTe/NIPrtXMnH7wPf+LEN6tqhUVHj3XKD/72p9eafCeYB3zuonnbv7yqP8d/o4K6gRb1wbYAAAAASUVORK5CYII="):new f.Texture}();xi.minFilter=f.NearestFilter;xi.magFilter=f.NearestFilter;xi.wrapS=f.RepeatWrapping;xi.wrapT=f.RepeatWrapping;var ge={customShaders:[],pano0:null,pano1:null,floorStyle:"OPACITY",colorStyle:"RGB",constantColor:new f.Vector3(.6,.6,.6),shownFloorIndex:-1,modelAlpha:1,opacity:1,progress:0,transition:"FADE",clippers:null,brightness:1,useEDL:!1,useHQWeight:!1,useHQDepth:!1,pointSize:"ATTENUATION",pointBack:"DARK",pointShape:"CIRCLE",pointScale:.03,pointMaxPixel:40,pointMinPixel:1,gradientTexture:xi,colorSaturation:0,colorBrightness:0};function Hf(n,t){var e=n!=null?n:[],r=t!=null?t:[];if(r.length!==e.length)return!1;for(var i=0;i<r.length;i++)if(!e[i].clippingBoxMatrix.equals(r[i].clippingBoxMatrix)||e[i].floorIndex!==r[i].floorIndex)return!1;return!0}function Gf(n,t){return n&&t?n.luminanceMap===t.luminanceMap&&n.map===t.map&&n.zoom===t.zoom&&n.matrix.equals(t.matrix):!n&&!t}function yu(n,t){var e=!1;for(var r in t)if(t[r]!==void 0)switch(r){case"clippers":Hf(n[r],t[r])||(n[r]=t[r],e=!0);break;case"pano0":case"pano1":Gf(n[r],t[r])||(n[r]=t[r],e=!0);break;default:n[r]!==t[r]&&(n[r]=t[r],e=!0);break}return e}function Ji(n,t,e){return n+(t-n)*e}function Kf(n,t,e,r){var i=(t*e+2*n)/Math.pow(e,3),a=-(2*t*e+3*n)/Math.pow(e,2),o=t,s=n;return i*Math.pow(r,3)+a*Math.pow(r,2)+o*r+s}function jf(n,t,e,r){var i=(t*e+2*n)/Math.pow(e,3),a=-(2*t*e+3*n)/Math.pow(e,2),o=t;return 3*i*Math.pow(r,2)+2*a*r+o}function _f(n,t,e,r){var i=r[1]-r[0];return n=na(n,r),t=na(t,r),t-n>i/2?Ji(n+i,t,e):n-t>i/2?Ji(n-i,t,e):Ji(n,t,e)}function na(n,t){var e=t[1]-t[0];return n<t[0]?na(n+e,t):n>=t[1]?na(n-e,t):n}function Jf(n,t,e,r){return r?_f(n,t,e,r):Ji(n,t,e)}function Ds(n){var t=Number(n);return isNaN(t)||!isFinite(t)?0:t}var Re=function(){function n(t){this.config={},this.progress=1,this.ended=!0,this.value={},this.startTime=ve(),this.startVelocity=0,this.duration=0,this.keyframes=[];for(var e in t){var r=t[e];typeof r=="object"?(this.value[e]=Ds(r.value),this.config[e]={circle:r.circle}):(this.value[e]=Ds(r),this.config[e]={circle:!1})}this.keyframes=[{progress:0,value:O({},this.value)},{progress:1,value:O({},this.value)}]}return n.prototype.getProgress=function(t){var e=t-this.startTime;return e<0?0:e>=this.duration?1:1-Kf(1,this.startVelocity,this.duration,e)},n.prototype.getValue=function(t){for(var e=1;e<this.keyframes.length;e++)if(this.keyframes[e].progress>t){var r=this.keyframes[e-1],i=this.keyframes[e],a={};for(var o in this.config){var s=(t-r.progress)/(i.progress-r.progress);a[o]=Jf(r.value[o],i.value[o],s,this.config[o].circle)}return a}return O({},this.keyframes[this.keyframes.length-1].value)},n.prototype.getProgressVelocity=function(t){var e=t-this.startTime;return e>=this.duration?0:jf(1,this.startVelocity,this.duration,e)},n.prototype.update=function(t){return this.ended?!0:(this.progress=Math.min(1,Math.max(0,this.progress,this.getProgress(t))),this.value=this.getValue(this.progress),this.ended=this.progress>=1,this.ended&&this.callbacks&&(this.callbacks[0](),this.callbacks=void 0),this.ended)},n.prototype.getKeyFrameSegment=function(t){for(var e=this.getProgress(t),r=1;r<this.keyframes.length;r++)if(this.keyframes[r].progress>e)return[this.keyframes[r-1],this.keyframes[r]];return[this.keyframes[this.keyframes.length-2],this.keyframes[this.keyframes.length-1]]},n.prototype.getTargetKeyframe=function(){return this.keyframes[this.keyframes.length-1]},n.prototype.set=function(t,e,r,i){var a;r===void 0&&(r=0),isNaN(e)&&(e=0),isNaN(r)&&(r=0),i=i!=null?i:ve();var o=this.getProgress(i),s=this.getValue(o),u={};for(var l in this.config)u[l]=(a=t[l])!==null&&a!==void 0?a:s[l];var c=[{progress:0,value:s},{progress:1,value:u}];return this.setKeyframes(c,e,r,i)},n.prototype.setKeyframes=function(t,e,r,i){var a=this;if(r===void 0&&(r=0),t.length<2)throw new Error("keyframes invalid.");return isNaN(e)&&(e=0),isNaN(r)&&(r=0),this.callbacks&&(this.callbacks[1](new Error("motion aborted.")),this.callbacks=void 0),new Promise(function(o,s){i=i!=null?i:ve(),a.progress=0,a.ended=!1,a.startTime=i,a.startVelocity=r,a.keyframes=t,a.duration=e,e===0?(a.progress=1,a.value=O({},t[t.length-1].value)):a.value=O({},t[0].value),a.callbacks=[o,s]})},n.prototype.dispose=function(){this.callbacks&&(this.callbacks[1](new Error("motion dispose.")),this.callbacks=void 0)},n}(),Xf=500;function Wf(n){return-(Math.cos(Math.PI*n)-1)/2}var yr=function(n){ue(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.appearMotion=new Re({appear:0}),i}return t.prototype.update=function(e,r,i,a){var o,s;if(this.material.update(e,r,i),a&&a.refine==="ADD"&&a.tileset.rootMeta.pntsOrder==="RANDOM"){var u=this.geometry,l=this.appearMotion,c=i.visible&&a.state.selectedFrameNumber===a.tileset.frameNumber,d=a.tileset.maxScreenSpaceError,p=a.state.screenSpaceError,A=(s=(o=a.parent)===null||o===void 0?void 0:o.state.screenSpaceError)!==null&&s!==void 0?s:p,h=1;if(a.levelOfContent>a.tileset.minLevelOfDetail&&A!==p&&(h=(A-d)/(A-p)),h=ce(h,0,1),h=Wf(h),c){var v=1;l.getTargetKeyframe().value.appear!==v&&l.set({appear:v},Xf).catch(Q)}else{var v=0;l.getTargetKeyframe().value.appear!==v&&l.set({appear:v},0).catch(Q)}l.ended!==!0&&l.update(r.time);var g=u.index?u.index.count:u.attributes.position?u.attributes.position.count:1/0,m=Math.floor(g*h*l.value.appear);u.drawRange.count!==m&&(this.geometry.setDrawRange(0,m),i.needsRender=!0)}},t}(f.Points),kn=new Set,Zf=function(n){ue(t,n);function t(){var e=n.call(this)||this;return e.needsRender=!0,e.pbmMaterialParametersVersion=0,e.materialParameters=O({},ge),e}return t.prototype.getMaterial=function(){return O({},this.materialParameters)},t.prototype.setMaterial=function(e){var r=this;Object.assign(this.materialParameters,e),kn.clear(),this.traverse(function(i){if(i instanceof Ot)for(var a=0,o=i.material;a<o.length;a++){var s=o[a];kn.has(s)||(Object.assign(s,r.materialParameters),kn.add(s))}i instanceof yr&&(kn.has(i.material)||(Object.assign(i.material,r.materialParameters),kn.add(i.material)))}),kn.clear(),this.needsRender=!0},t}(f.Group),Yf=["right","left","up","down","front","back"];function bu(n,t,e,r){var i=new f.Box3;switch(n){case"up":i.min.y=.5,i.max.y=.5,i.min.x=+t-.5,i.max.x=+t-.5+r,i.min.z=-e+.5-r,i.max.z=-e+.5;break;case"down":i.min.y=-.5,i.max.y=-.5,i.min.x=+t-.5,i.max.x=+t-.5+r,i.min.z=+e-.5,i.max.z=+e-.5+r;break;case"left":i.min.x=-.5,i.max.x=-.5,i.min.z=-t+.5-r,i.max.z=-t+.5,i.min.y=-e+.5-r,i.max.y=-e+.5;break;case"right":i.min.x=.5,i.max.x=.5,i.min.z=+t-.5,i.max.z=+t-.5+r,i.min.y=-e+.5-r,i.max.y=-e+.5;break;case"front":i.min.z=-.5,i.max.z=-.5,i.min.x=+t-.5,i.max.x=+t-.5+r,i.min.y=-e+.5-r,i.max.y=-e+.5;break;case"back":i.min.z=.5,i.max.z=.5,i.min.x=-t+.5-r,i.max.x=-t+.5,i.min.y=-e+.5-r,i.max.y=-e+.5;break}return i.applyMatrix4(new f.Matrix4().makeRotationY(Math.PI))}var xu=function(n,t){if(!(n.level>=t))for(var e=n.level+1,r=n.size/2,i=[new f.Vector2(n.position.x,n.position.y),new f.Vector2(n.position.x+r,n.position.y),new f.Vector2(n.position.x,n.position.y+r),new f.Vector2(n.position.x+r,n.position.y+r)],a=0,o=i;a<o.length;a++){var s=o[a],u={face:n.face,level:e,size:r,position:s,box:bu(n.face,s.x,s.y,r),parent:n,children:[]};n.children.push(u),xu(u,t)}};function $f(n,t){var e={level:0,face:n,position:new f.Vector2(0,0),size:1,box:bu(n,0,0,1),parent:null,children:[]};return xu(e,t),e}function bo(n){var t=Yf.map(function(e){return $f(e,n)});return{children:t}}function _o(n,t){for(var e=0,r=n.children;e<r.length;e++){var i=r[e],a=t(i);a!==!1&&_o(i,t)}}function _t(n,t){for(var e={},r=0,i=t;r<i.length;r++){var a=i[r];a in n&&(e[a]=n[a])}return e}function Aa(n,t){for(var e=O({},n),r=0,i=t;r<i.length;r++){var a=i[r];a in e&&delete e[a]}return e}var wi=new f.BoxBufferGeometry(1,1,1,1,1);wi.deleteAttribute("uv");wi.deleteAttribute("normal");wi.groups=[];wi.scale(-1,1,1);var ed=`
|
|
390
|
+
`,w},typeof n=="string"&&(n.indexOf("-----BEGIN")!=-1?this.readCertPEM(n):ae.lang.String.isHex(n)&&this.readCertHex(n))}$e.hex2dn=function(n,t){t===void 0&&(t=0);var e=new $e;le.getTLV(n,t);var r=e.getX500Name(n);return r.str};$e.hex2rdn=function(n,t){if(t===void 0&&(t=0),n.substr(t,2)!=="31")throw new Error("malformed RDN");for(var e=new Array,r=le.getChildIdx(n,t),i=0;i<r.length;i++)e.push($e.hex2attrTypeValue(n,r[i]));return e=e.map(function(a){return a.replace("+","\\+")}),e.join("+")};$e.hex2attrTypeValue=function(n,t){var e=le,r=e.getV;if(t===void 0&&(t=0),n.substr(t,2)!=="30")throw new Error("malformed attribute type and value");var i=e.getChildIdx(n,t);i.length!==2||n.substr(i[0],2);var a=r(n,i[0]),o=ae.asn1.ASN1Util.oidHexToInt(a),s=ae.asn1.x509.OID.oid2atype(o),u=r(n,i[1]),l=Hr(u);return s+"="+l};$e.getPublicKeyFromCertHex=function(n){var t=new $e;return t.readCertHex(n),t.getPublicKey()};$e.getPublicKeyFromCertPEM=function(n){var t=new $e;return t.readCertPEM(n),t.getPublicKey()};$e.getPublicKeyInfoPropOfCertPEM=function(n){var t=le,e=t.getVbyList,r={},i,a;return r.algparam=null,i=new $e,i.readCertPEM(n),a=i.getPublicKeyHex(),r.keyhex=e(a,0,[1],"03").substr(2),r.algoid=e(a,0,[0,0],"06"),r.algoid==="2a8648ce3d0201"&&(r.algparam=e(a,0,[0,1],"06")),r};$e.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"];function Rs(n){return Me.SHA256(n).toString()}var lu=[function(){var n=new $e;return n.readCertPEM(function(){var t=113,e=126,r=0,i="";return arguments[r].split(i).map(function(a){return a.charCodeAt(r)>e?a:String.fromCharCode((a.charCodeAt(r)+t)%e)}).join(i)}(":::::ORTV[-PR_aVSVPNaR:::::ZVVS@ PPNErtNVONtVWNZR}@]nU\0ZaZN=TP`\0T`Vo@Q^ROPbNZVTSZ^P^fQc^^TRWQawR^ZNATN>bRPNU^zc}nzyg R^ZNATN>bROU^zc}nzyg R]ZN=TN>bRPtTn?bf?FZ_NQtfQc^^YQNq`gdSp?cyZ^P^fQc^^QQNWQ^aRvZPNTP`\0T`Vo@Q^RWN_fapzFqSFwfbOndSnzyuYz[oaNrS=\x07\\QN>Z N\\Q^B[QqnS=\b\\QN>Zwp\\Q^B[QqnZVTSZ^P^fQc^^TRWQawR^ZNATN>bRPNU^zc}nzyg R^ZNATN>bROU^zc}nzyg R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x\b_o@8\0g`Z<PyUE`8yu}\\g{@`s`zUgErRtve{YdCvoO@>WFDtABNp\0feUWszpQaEYNAc]^xB[@]BDAN8\b}XA=E\x07nO}Pud8TA ?yPrVv{\\>E]o`BO^RE^X[W[rEU?x\bf>V OUwY=>X[\\E`tW[8}VwpF\x07BQcnrPF}yUtd8<Doe_\b[oOVU\x07ep@pYY\0cegY{r ?\bAbq?ff8}UaXoN_D]_X_8yozYFT`N{`\\{zvu?\bDWT}=_<\x07StX Nx\x07\0\b \0aT=c@ucnWfR[vf>RFxAFV}{N`dN^\\<eawBPxx}quT=|{T_R@Fp^Y<ZevRsWaZ]V CVrRVtAAc[ Qp|d|tqoQ=T|XX =u\\N8XNCx\\aU>wz X<e@Vc?dy\\|^FEq|=p`pBdF@bs^d<]vp\\^TZ P\bZ\b\\YNNSZ_\\w^|TsD8db _ Y\\o^Cw>Z\0x\\^aN]wWf\bA} C^d_{\x07ZC@\by]gY@E BFY?OsaqbDcVgQbZeFc ovtucxnq|<TnuyXRveYFOegCpAs{YTe|>bE<OXsSqCBWD_SVepfvCCUg]z ZvQ[\0s|U>pFz\b=OwT``fNJJ:::::R[Q-PR_aVSVPNaR:::::")),n}()];function bf(n,t){for(var e=0,r=t;e<r.length;e++){var i=r[e];if(i.getSubjectHex()===n)return i}}function cu(n,t){var e=n.getIssuerHex();if(e===n.getSubjectHex())return n.verifySignature(n.getPublicKey());var r=bf(e,t);return!r||n.verifySignature(r.getPublicKey())===!1?!1:cu(r,t)}function fu(n){var t=n.getIssuerHex();return t===n.getSubjectHex()?!1:cu(n,lu)}function xf(n){var t=new $e;typeof n=="string"?t.readCertPEM(n):t.readCertHex(n.hex);var e=fu(t);return lu.push(t),e}function wf(n,t,e){var r=new $e;if(typeof e=="string"?r.readCertPEM(e):r.readCertHex(e.hex),fu(r)===!1)return!1;var i=new Ve;return i.readCertPubKeyHex(r.hex,6),!!i.verify(n,Go(t))}xf(function(){var t=113,e=126,r=0,i="";return arguments[r].split(i).map(function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FxRFf<tJ:::::R[Q-PR_aVSVPNaR:::::"));var Ao=function(n,t){return Ao=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])},Ao(n,t)};function ue(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Ao(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var O=function(){return O=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])}return t},O.apply(this,arguments)};function Gt(n,t,e,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(n,t,e,r);else for(var s=n.length-1;s>=0;s--)(o=n[s])&&(a=(i<3?o(a):i>3?o(t,e,a):o(t,e))||a);return i>3&&a&&Object.defineProperty(t,e,a),a}function Kt(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)}function ha(n,t,e,r){function i(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function s(c){try{l(r.next(c))}catch(d){o(d)}}function u(c){try{l(r.throw(c))}catch(d){o(d)}}function l(c){c.done?a(c.value):i(c.value).then(s,u)}l((r=r.apply(n,t||[])).next())})}function pa(n,t){var e={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(e=0)),e;)try{if(r=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return e.label++,{value:l[1],done:!1};case 5:e.label++,i=l[1],l=[0];continue;case 7:l=e.ops.pop(),e.trys.pop();continue;default:if(a=e.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){e=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){e.label=l[1];break}if(l[0]===6&&e.label<a[1]){e.label=a[1],a=l;break}if(a&&e.label<a[2]){e.label=a[2],e.ops.push(l);break}a[2]&&e.ops.pop(),e.trys.pop();continue}l=t.call(n,e)}catch(c){l=[6,c],i=0}finally{r=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function vt(n,t,e){if(e||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return n.concat(a||Array.prototype.slice.call(t))}function Mf(n){return typeof Symbol=="undefined"?"$Symbol<".concat(n,">$"):Symbol(n)}var ui=Mf("$$FIVE_EVENT$$");function Ni(n){return n[ui]||(n[ui]={}),n[ui]}function Sf(n){n[ui]&&delete n[ui]}var va=function(){function n(){}return n.prototype.hasListener=function(t){var e=Ni(this);return e&&e[t]&&e[t].callbacks.length>0},n.prototype.on=function(t,e,r){var i=this,a=Ni(this);return a[t]||(a[t]={callbacks:[]}),a[t].callbacks.push([e,r||!1]),function(){return i.off(t,e)}},n.prototype.once=function(t,e){return this.on(t,e,!0)},n.prototype.off=function(t,e){if(t===void 0){Sf(this);return}var r=Ni(this);if(r[t]||(r[t]={callbacks:[]}),e===void 0){r[t].callbacks.length=0;return}for(var i=0;i<r[t].callbacks.length&&r[t].callbacks[i][0]!==e;i++);i<r[t].callbacks.length&&r[t].callbacks.splice(i,1)},n.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var i=!1,a=Ni(this);a[t]||(a[t]={callbacks:[]});for(var o=a[t].callbacks.slice(),s=0,u=o;s<u.length;s++){var l=u[s],c=l[0],d=l[1],p=d===void 0?!1:d,A=c.apply(void 0,e);p&&this.off(t,c),A===!1&&(i=!0)}return i},n.prototype.waitUntil=function(t,e){var r=this;return new Promise(function(i){var a=r.on(t,function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];(!e||e.apply(void 0,o)!==!1)&&(i(o),a())})})},n}();function Q(){}var Cf=typeof performance!="undefined"&&typeof performance.timing!="undefined"?performance.timing.navigationStart:Date.now(),ve=typeof performance!="undefined"?function(){return Cf+performance.now()}:function(){return Date.now()};function ln(n){Object.freeze(n);var t=typeof n=="function",e=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(function(r){e.call(n,r)&&(!t||r!=="caller"&&r!=="callee"&&r!=="arguments")&&n[r]!==null&&(typeof n[r]=="object"||typeof n[r]=="function")&&!Object.isFrozen(n[r])&&ln(n[r])}),n}var Bs=/^([^.]+)(\.([^.]+))*$/;function Ef(n,t){if(n==="*")return!0;var e=n.split(".").reverse(),r=t.split(".").reverse();if(e.length<=1)return n===t;for(var i=0;i<e.length;i++)if(e[i]!==r[i])return!1;return!0}function Tn(n){return/^(([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])(\.(?!$)|$)){4}$/.test(n)}function hn(n,t){return Bs.test(n)&&Bs.test(t)&&Ef(n,t)}var If=[/\.([0-9a-z]+)\.jsonp([\?\#].*)?$/i,/jsonp_([0-9a-z]+)([\?\#].*)?$/i],Rr=ln(JSON.parse(function(){var t=113,e=126,r=0,i="";return arguments[r].split(i).map(function(a){return a.charCodeAt(r)>e?a:String.fromCharCode((a.charCodeAt(r)+t)%e)}).join(i)}("h/y|pnyu|/9/xr;p|z/9/yvn{wvn;p|z/9/rnyrr;p|z/9/rnyrr;p{/9/rnyrr;w}/9/uv;p|z/9/uv;p{/9/rnyrr;p{/9/rnyrr;p|z/9/ywpq{;p|z/9/rnyrr:pq{;p|z/9/rnyrr:pq{;p{/9/rnyrr;nv/9/;p{/9/pq{;p{/9/pnyp{|qr;vr/j"))),bi=function(n){ue(t,n);function t(e,r,i){return n.call(this,"[NETWORK]: request proxy error(type: ".concat(r,", reason: ").concat(i,"): ").concat(e))||this}return t}(Error),Kn=function(n){ue(t,n);function t(e,r,i){var a=n.call(this,"[NETWORK]: response error(type: ".concat(r,", status: ").concat(i,"): ").concat(e))||this;return a.httpStatus=i,a}return t}(Error);(function(n){ue(t,n);function t(e,r){return n.call(this,"[NETWORK]: request abort(type: ".concat(r,"): ").concat(e))||this}return t})(Error);var vi=function(n){ue(t,n);function t(e,r,i){return n.call(this,"[NETWORK]: request timeout(type: ".concat(r,", timeout: ").concat(i,"ms): ").concat(e))||this}return t}(Error),Ko=function(n){ue(t,n);function t(e,r,i){return n.call(this,"[NETWORK]: request forbidden(type: ".concat(r,", reason: ").concat(i,"): ").concat(e))||this}return t}(Error);function Tf(n){if(!n)return{};for(var t={},e=n.trim().split(`
|
|
391
|
+
`),r=0;r<e.length;r++){var i=e[r],a=i.indexOf(":"),o=i.slice(0,a).trim().toLowerCase(),s=i.slice(a+1).trim();s&&(t[o]?t[o]+=", "+s:t[o]=s)}return t}function go(n){for(var t=0,e=If;t<e.length;t++){var r=e[t],i=n.match(r);if(i)return"jsonp_"+i[1]}return null}function Fs(n){return go(n)!==null}function Ls(n){var t=n.match(/^([0-9a-z]+\:)\/\/(([^:/?#]*)(?::[0-9]+)?)/);return t?t[1]:location.protocol}function _o(n){if(/^blob\:/i.test(n))return"blob:";if(/^data\:/i.test(n))return"data:";var t=n.match(/^[0-9a-z]+\:\/\/(([^:/?#]*)(?::[0-9]+)?)/i);return t?t[2]:location.hostname}var du=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(va);function qn(n,t,e,r,i){t===void 0&&(t={}),e===void 0&&(e=Q),r===void 0&&(r=Q),i===void 0&&(i=Q);var a=ve(),o=n;return Promise.resolve().then(function(){return t.requestProxy?t.requestProxy(n):n}).then(function(s){return/^https\:/.test(location.href)&&/^http\:/.test(s)?(console.warn("The page at '".concat(location.href,"' was loaded over HTTPS, but requested an insecure element '").concat(s,"'. This request was automatically upgraded to HTTPS")),s.replace(/^http\:/,"https:")):s}).catch(function(s){var u,l=go(n),c=l?"Script":"XMLHttpRequest",d=new bi(o,c,s&&s.message?String(s.message):String(s));return(u=t.networkSubscribe)===null||u===void 0||u.emit("network",n,c,"proxy-error",d.message),Promise.reject(d)}).then(function(s){return new Promise(function(u,l){var c,d=t.allowHosts?Rr.concat(t.allowHosts):Rr.slice(),p=_o(s),A=go(s);if(location.hostname.length!==0&&!Tn(location.hostname)&&Rr.filter(function(L){return hn(L,location.hostname)}).length===0&&!Tn(p)&&d.filter(function(L){return hn(L,p)}).length===0){var h=A?"Script":"XMLHttpRequest",v=new Ko(s,h,"request host(".concat(p,") is not allowed"));r(v),l(v),(c=t.networkSubscribe)===null||c===void 0||c.emit("network",s,h,"forbidden",v.message);return}if(A){var g=window,m=null,y=!1,b=document.createElement("script"),x=function(){var L;if(m=null,y!==!0){y=!0;var T=new vi(s,"Script",t.timeout||NaN);r(T),l(T),(L=t.networkSubscribe)===null||L===void 0||L.emit("network",s,"Script","timeout",T.message)}},w=function(L){var T,F,D=ve(),V=D-a;if(delete g[A],b.parentNode&&b.parentNode.removeChild(b),m!==null&&(window.clearTimeout(m),m=null),y!==!0){if(L.indexOf("data:")!==0){var z=new Kn(s,"Script",500);r(z),l(z),(T=t.networkSubscribe)===null||T===void 0||T.emit("network",s,"Script","error",z.message);return}var U=L.split(","),q=(U[0].match(/:(.*?);/)||[])[1],G=U[1];if(t.responseType==="arraybuffer"||t.responseType==="blob"){for(var K=atob(U[1]),j=K.length,J=new Uint8Array(j),W=0;W<j;W++)J[W]=K.charCodeAt(W);t.responseType==="arraybuffer"?G=J.buffer:G=new Blob([J],{type:q})}var $={},Y={body:G,meta:{origin:o,source:s,requestTime:a,responseTime:D,costs:V,headers:$}};e(Y),u(Y),(F=t.networkSubscribe)===null||F===void 0||F.emit("network",s,"Script","ok",JSON.stringify(Y.meta)),y=!0}};g[A]=w,b.src=s,document.body.appendChild(b),typeof t.timeout=="number"&&(m=window.setTimeout(x,t.timeout))}else{var M=!1,S=new XMLHttpRequest,E=function(){S&&(S.removeEventListener("timeout",B,!1),S.removeEventListener("progress",R,!1),S.removeEventListener("load",C,!1),S.removeEventListener("error",I,!1)),S=null,E=Q},B=function(){var L;if(M!==!0){M=!0,E();var T=new vi(s,"XMLHttpRequest",t.timeout||NaN);r(T),l(T),(L=t.networkSubscribe)===null||L===void 0||L.emit("network",s,"XMLHttpRequest","timeout",T.message)}},R=function(L){M!==!0&&L.lengthComputable&&(L.total<=0||i(L.loaded/L.total))},C=function(L){var T;if(M!==!0){var F=this.status;if(F===0||F>=200&&F<400){M=!0,E();var D=ve(),V=D-a,z=Tf(this.getAllResponseHeaders()),U=L.total,q={body:this.response,meta:{origin:o,source:s,requestTime:a,responseTime:D,costs:V,headers:z,size:U}};e(q),u(q),(T=t.networkSubscribe)===null||T===void 0||T.emit("network",s,"XMLHttpRequest","ok",JSON.stringify(q.meta))}else I.call(this)}},I=function(){var L;if(M!==!0){M=!0,E();var T=new Kn(s,"XMLHttpRequest",this.status);r(T),l(T),(L=t.networkSubscribe)===null||L===void 0||L.emit("network",s,"XMLHttpRequest","error",T.message)}};S.addEventListener("timeout",B,!1),S.addEventListener("progress",R,!1),S.addEventListener("load",C,!1),S.addEventListener("error",I,!1),t.responseType&&(S.responseType=t.responseType),typeof t.timeout=="number"&&(S.timeout=t.timeout),S.open("GET",s,!0),S.send(null)}})})}var Ta={};function Pf(n,t){t===void 0&&(t={});var e=ve(),r=n;return Promise.resolve().then(function(){return t.requestProxy?t.requestProxy(n):n}).then(function(i){return/^https\:/.test(location.href)&&/^http\:/.test(i)?(console.warn("The page at '".concat(location.href,"' was loaded over HTTPS, but requested an insecure element '").concat(i,"'. This request was automatically upgraded to HTTPS")),i.replace(/^http\:/,"https:")):i}).catch(function(i){var a,o=new bi(r,"Link",i&&i.message?String(i.message):String(i));return(a=t.networkSubscribe)===null||a===void 0||a.emit("network",n,"Link","proxy-error",o.message),Promise.reject(o)}).then(function(i){return i in Ta?Ta[i]:Ta[i]=new Promise(function(a,o){var s,u=t.allowHosts?Rr.concat(t.allowHosts):Rr.slice(),l=_o(i);if(location.hostname.length!==0&&!Tn(location.hostname)&&Rr.filter(function(v){return hn(v,location.hostname)}).length===0&&!Tn(l)&&u.filter(function(v){return hn(v,l)}).length===0){var c=new Ko(i,"Link","request host(".concat(l,") is not allowed"));o(c),(s=t.networkSubscribe)===null||s===void 0||s.emit("network",i,"Link","forbidden",c.message);return}var d=document.createElement("link"),p=!1,A=null;d.onload=function(v){var g;if(A!==null&&(clearTimeout(A),A=null),p!==!0){p=!0,a();var m=ve(),y=m-e,b={},x={origin:r,source:i,requestTime:e,responseTime:m,costs:y,headers:b};(g=t.networkSubscribe)===null||g===void 0||g.emit("network",i,"Link","preload",JSON.stringify(x))}},d.onerror=function(v){var g;if(A!==null&&(clearTimeout(A),A=null),p!==!0){p=!0;var m=new Kn(i,"Link",0);o(m),(g=t.networkSubscribe)===null||g===void 0||g.emit("network",i,"Link","error",m.message)}},typeof t.timeout=="number"&&(A=window.setTimeout(function(){var v;if(A=null,p!==!0){p=!0,a();var g=ve(),m=g-e,y={},b={origin:r,source:i,requestTime:e,responseTime:g,costs:m,headers:y};(v=t.networkSubscribe)===null||v===void 0||v.emit("network",i,"Link","timeout",JSON.stringify(b))}},t.timeout)),d.rel=d.relList&&d.relList.supports("prefetch")?"prefetch":"preload",d.as="fetch",d.crossOrigin="",d.fetchPriority="high",d.href=i;var h=document.head||document.getElementsByTagName("head")[0];h&&h.appendChild(d)})})}function Rf(n,t,e,r,i,a){t===void 0&&(t={}),e===void 0&&(e=Q),r===void 0&&(r=Q),i===void 0&&(i=Q);var o=ve(),s=n;return Promise.resolve().then(function(){return t.requestProxy?t.requestProxy(n):n}).then(function(u){return/^https\:/.test(location.href)&&/^http\:/.test(u)?(console.warn("The page at '".concat(location.href,"' was loaded over HTTPS, but requested an insecure element '").concat(u,"'. This request was automatically upgraded to HTTPS")),u.replace(/^http\:/,"https:")):u}).catch(function(u){var l,c=new bi(s,"Image",u&&u.message?String(u.message):String(u));return(l=t.networkSubscribe)===null||l===void 0||l.emit("network",n,"Image","proxy-error",c.message),Promise.reject(c)}).then(function(u){return new Promise(function(l,c){var d,p=t.allowHosts?Rr.concat(t.allowHosts):Rr.slice(),A=_o(u);if(location.hostname.length!==0&&!Tn(location.hostname)&&Rr.filter(function(x){return hn(x,location.hostname)}).length===0&&!Tn(A)&&p.filter(function(x){return hn(x,A)}).length===0){var h=new Ko(u,"Image","request host(".concat(A,") is not allowed"));r(h),c(h),(d=t.networkSubscribe)===null||d===void 0||d.emit("network",u,"Image","forbidden",h.message);return}var v=a!=null?a:new Image,g=!1,m=null,y=function(){var x;if(v.onload=Q,v.onerror=Q,m!==null&&(clearTimeout(m),m=null),g!==!0){var w=ve(),M={headers:{},origin:s,source:u,requestTime:o,responseTime:w,costs:w-o};g=!0;var S={body:v,meta:M};i(1),e(S),l(S),(x=t.networkSubscribe)===null||x===void 0||x.emit("network",u,"Image","ok",JSON.stringify(S.meta))}},b=function(){var x;if(v.onload=Q,v.onerror=Q,m!==null&&(clearTimeout(m),m=null),g!==!0){g=!0;var w=new Kn(u,"Image",0);r(w),c(w),(x=t.networkSubscribe)===null||x===void 0||x.emit("network",u,"Image","ok",w.message)}};typeof t.timeout=="number"&&(m=window.setTimeout(function(){var x;if(v.onload=Q,v.onerror=Q,m=null,g!==!0){g=!0;var w=new vi(u,"Image",t.timeout);r(w),c(w),(x=t.networkSubscribe)===null||x===void 0||x.emit("network",u,"Image","timeout",w.message)}},t.timeout)),v.onload=y,v.onerror=b,i(0),v.src=u})})}var qt=function(){function n(t){t===void 0&&(t={}),this.options=Object.freeze(t),this.options.allowHosts&&Object.freeze(this.options.allowHosts)}return n.prototype.ajax=function(t,e,r,i,a){var o;e===void 0&&(e={}),r===void 0&&(r=Q),i===void 0&&(i=Q),a===void 0&&(a=Q);var s=this.options,u={responseType:e.responseType,timeout:(o=e.timeout)!==null&&o!==void 0?o:s.timeout,get allowHosts(){var l;return(l=e.allowHosts)!==null&&l!==void 0?l:s.allowHosts},get requestProxy(){var l;return(l=e.requestProxy)!==null&&l!==void 0?l:s.requestProxy},get networkSubscribe(){var l;return(l=e.networkSubscribe)!==null&&l!==void 0?l:s.networkSubscribe}};return qn(t,u,r,i,a)},n.prototype.loadImage=function(t,e,r,i,a,o){var s;e===void 0&&(e={}),r===void 0&&(r=Q),i===void 0&&(i=Q),a===void 0&&(a=Q);var u=this.options,l={timeout:(s=e.timeout)!==null&&s!==void 0?s:u.timeout,get allowHosts(){var c;return(c=e.allowHosts)!==null&&c!==void 0?c:u.allowHosts},get requestProxy(){var c;return(c=e.requestProxy)!==null&&c!==void 0?c:u.requestProxy},get networkSubscribe(){var c;return(c=e.networkSubscribe)!==null&&c!==void 0?c:u.networkSubscribe}};return Rf(t,l,r,i,a,o)},n.prototype.preload=function(t,e){var r;e===void 0&&(e={});var i=this.options,a={timeout:(r=e.timeout)!==null&&r!==void 0?r:i.timeout,get allowHosts(){var o;return(o=e.allowHosts)!==null&&o!==void 0?o:i.allowHosts},get requestProxy(){var o;return(o=e.requestProxy)!==null&&o!==void 0?o:i.requestProxy},get networkSubscribe(){var o;return(o=e.networkSubscribe)!==null&&o!==void 0?o:i.networkSubscribe}};return Pf(t,a)},n}(),ra=new qt;function ce(n,t,e){return n<t?t:n>e?e:n}var yo=function(){var n=ve();return{requestAnimationFrame:function(t){var e=ve(),r=ce(16+(e-n),16,33),i=setTimeout(function(){t(e+r)},r);return n=e+r,i},cancelAnimationFrame:function(t){return clearTimeout(t)}}}(),ks=function(){if(typeof window!="undefined"){var n=window;if(n.requestAnimationFrame)return{requestAnimationFrame:n.requestAnimationFrame.bind(n),cancelAnimationFrame:n.cancelAnimationFrame.bind(n)};if(n.mozRequestAnimationFrame)return{requestAnimationFrame:n.mozRequestAnimationFrame.bind(n),cancelAnimationFrame:n.mozCancelAnimationFrame.bind(n)};if(n.webkitRequestAnimationFrame)return{requestAnimationFrame:n.webkitRequestAnimationFrame.bind(n),cancelAnimationFrame:n.webkitCancelAnimationFrame.bind(n)};if(n.msRequestAnimationFrame)return{requestAnimationFrame:n.msRequestAnimationFrame.bind(n),cancelAnimationFrame:n.msCancelAnimationFrame.bind(n)}}return yo}(),Bf=5,Os=16,Mt=function(){function n(){this.loopType="raf",this.frames=[],this.isAnimating=!1,this.context=null;var t=ve();this.loop=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(this.isAnimating!==!1){var i=ve(),a=i-t;t=i,Os=a;for(var o=0;o<this.frames.length;o++){var s=this.frames[o];if(s.delay>0){s.delay=s.delay-1;continue}try{s.callback.apply(s,vt([i,a],e,!1))}catch(u){console.error(u)}s.once&&(this.frames.splice(o,1),o--)}this.requestId=this.requestAnimationFrame(this.loop)}}.bind(this),this.start()}return Object.defineProperty(n,"shared",{get:function(){return this.sharedInstance||(this.sharedInstance=new n),this.sharedInstance},enumerable:!1,configurable:!0}),n.getFrameTime=function(){return Os},n.prototype.start=function(){this.isAnimating!==!0&&(this.isAnimating=!0,this.requestId=this.requestAnimationFrame(this.loop))},n.prototype.stop=function(){this.isAnimating=!1,this.cancelAnimationFrame(this.requestId)},n.prototype.setContext=function(t){t!==this.context&&(this.stop(),this.context=t,this.start())},n.prototype.getContext=function(){return this.context},n.prototype.setLoopType=function(t){t!==this.loopType&&(this.stop(),this.loopType=t,this.start())},n.prototype.getLoopType=function(){return this.loopType},n.prototype.requestAnimationFrame=function(t){if(this.context)return this.context.requestAnimationFrame(t);if(this.loopType==="raf")return ks.requestAnimationFrame(t);if(this.loopType==="sto")return yo.requestAnimationFrame(t)},n.prototype.cancelAnimationFrame=function(t){if(this.context)this.context.cancelAnimationFrame(t);else if(this.loopType==="raf")ks.cancelAnimationFrame(t);else if(this.loopType==="sto")return yo.cancelAnimationFrame(t)},n.prototype.remove=function(t){var e=this.frames.indexOf(t);e>=0&&this.frames.splice(e,1)},n.prototype.add=function(t,e,r,i){var a=this;e===void 0&&(e=!1),r===void 0&&(r=0),i===void 0&&(i=Bf);for(var o={callback:t,once:e,delay:r,order:i},s=this.frames.length;--s>=0;)if(this.frames[s].order<=i){this.frames.splice(s+1,0,o);break}return s<0&&this.frames.unshift(o),function(){return a.remove(o)}},n.prototype.clear=function(){this.frames.length=0},n}(),Ff={"vrlab-public.ljcdn.com":{type:"tencentCloud",pano:["vrlab-image1.ljcdn.com","vrlab-image2.ljcdn.com"],texture:["vrlab-image3.ljcdn.com"],tile:["vr-tile-1.realsee-cdn.cn","vr-tile-2.realsee-cdn.cn"],model:["vr-model-1.realsee-cdn.cn","vr-model-2.realsee-cdn.cn"],default:["vrlab-image4.ljcdn.com"]},"vr-public.realsee-cdn.cn":{type:"tencentCloud",pano:["vr-image-1.realsee-cdn.cn","vr-image-2.realsee-cdn.cn"],texture:["vr-image-3.realsee-cdn.cn"],tile:["vr-tile-1.realsee-cdn.cn","vr-tile-2.realsee-cdn.cn"],model:["vr-model-1.realsee-cdn.cn","vr-model-2.realsee-cdn.cn"],default:["vr-image-4.realsee-cdn.cn"]},"vr-public.rscdn.cn":{type:"tencentCloud",pano:["vr-image-1.rscdn.cn","vr-image-2.rscdn.cn"],texture:["vr-image-3.rscdn.cn"],tile:["vr-tile-1.rscdn.cn","vr-tile-2.rscdn.cn"],model:["vr-model-1.rscdn.cn","vr-model-2.rscdn.cn"],default:["vr-image-4.rscdn.cn"]},"mars-public.realsee-cdn.cn":{type:"aliyun",pano:["mars-image-1.realsee-cdn.cn","mars-image-2.realsee-cdn.cn"],texture:["mars-image-3.realsee-cdn.cn"],tile:["mars-tile-1.realsee-cdn.cn","mars-tile-2.realsee-cdn.cn"],model:["mars-model-1.realsee-cdn.cn","mars-model-2.realsee-cdn.cn"],default:["mars-image-4.realsee-cdn.cn"]},"global-public.realsee-cdn.com":{type:"tencentCloud",pano:["global-image-1.realsee-cdn.com","global-image-2.realsee-cdn.com"],texture:["global-image-3.realsee-cdn.com"],tile:["global-tile-1.realsee-cdn.com","global-tile-2.realsee-cdn.com"],model:["global-model-1.realsee-cdn.com","global-model-2.realsee-cdn.com"],default:["global-image-4.realsee-cdn.com"]},"earth-ga-public.realsee-cdn.cn":{type:"tencentCloud",pano:["earth-ga-image-1.realsee-cdn.cn","earth-ga-image-2.realsee-cdn.cn"],texture:["earth-ga-image-3.realsee-cdn.cn"],tile:["earth-ga-tile-1.realsee-cdn.cn","earth-ga-tile-2.realsee-cdn.cn"],model:["earth-ga-model-1.realsee-cdn.cn","earth-ga-model-2.realsee-cdn.cn"],default:["earth-ga-image-4.realsee-cdn.cn"]},"test-vr-public.realsee-cdn.com":{type:"tencentCloud",pano:["test-vr-image.realsee-cdn.com","test-vr-image.realsee-cdn.com"],texture:["test-vr-image.realsee-cdn.com"],tile:["test-vr-image.realsee-cdn.com","test-vr-image.realsee-cdn.com"],model:["test-vr-image.realsee-cdn.com","test-vr-image.realsee-cdn.com"],default:["test-vr-image.realsee-cdn.com"]},"test-vr-public.realsee-cdn.cn":{type:"tencentCloud",pano:["test-vr-image.realsee-cdn.cn","test-vr-image.realsee-cdn.cn"],texture:["test-vr-image.realsee-cdn.cn"],tile:["test-vr-image.realsee-cdn.cn","test-vr-image.realsee-cdn.cn"],model:["test-vr-image.realsee-cdn.cn","test-vr-image.realsee-cdn.cn"],default:["test-vr-image.realsee-cdn.cn"]}},hu=/^https?\:\/\/?([^\/]+)/;function Lf(n){var t=n.match(hu);return t===null?null:t[1]}function Fn(n,t){return n.replace(hu,function(e,r){return e.slice(0,e.length-r.length)+t})}function kf(n,t,e){var r=t.split("."),i=r[0],a=r.slice(1);if(i==="texture")return Fn(n,e.texture[0]);if(i==="pano"||i==="pano_luminance"){a[0];var o=a[1];switch(o){case"front":case"left":case"up":return Fn(n,e.pano[0]);case"down":case"right":case"back":return Fn(n,e.pano[1])}}else if(i==="pano_tile"||i==="pano_tile_luminance"){a[0],a[1];var s=a[2],u=a[3],l=a[4],c=Math.pow(2,Number(s))*Number(u)+Number(l);if(!isNaN(c))return Fn(n,e.tile[c%2])}else if(i==="model"){var d=a[0],c=Number(d);if(!isNaN(c))return Fn(n,e.model[c%2])}return Fn(n,e.default[0])}var Of=function(n,t){var e,r=n.split("?")[0],i=r.split(".").pop();if(i==="jpeg"&&(i="jpg"),i!=="png"&&i!=="jpg")return n;var a="";if(t.format!==void 0&&t.format!==i&&(a+="/format/".concat(t.format)),t.cut!==void 0&&(a+="/cut/".concat(t.cut[2],"x").concat(t.cut[3],"x").concat(t.cut[0],"x").concat(t.cut[1])),t.quality!==void 0){var o=(e=t.format)!==null&&e!==void 0?e:i;o&&["jpg","webp","tpg","heif","avif"].indexOf(o)>=0&&(a+="/quality/".concat(t.quality))}if(t.size!==void 0){var s=n.match(/\/cube_(\d+)\//),u=s?Number(s[1]):NaN;u!==Number(t.size)&&(a+="/thumbnail/".concat(t.size,"x"))}return t.sharpen!==void 0&&(a+="/sharpen/".concat(t.sharpen)),a.length&&(a="?imageMogr2"+a),r+a},Df=function(n,t){var e,r=n.split("?")[0],i=r.split(".").pop();if(i==="jpeg"&&(i="jpg"),i!=="png"&&i!=="jpg")return n;var a="",o=[],s=t.format,u=t.quality,l=t.size;if(s!==void 0&&s!==i&&o.push("format,".concat(s==="heif"?"heic":s)),t.cut!==void 0){var c=t.cut,d=c[0],p=c[1],A=c[2],h=c[3];o.push("crop,x_".concat(d,",y_").concat(p,",w_").concat(A,",h_").concat(h,",g_nw"))}if(u!==void 0&&u!==100){var v=(e=t.format)!==null&&e!==void 0?e:i;v&&["jpg","webp"].indexOf(v)>=0&&o.push("quality,Q_".concat(u))}return l&&l!==2048&&o.push("resize,w_".concat(l)),t.sharpen!==void 0&&o.push("sharpen,".concat(t.sharpen)),o.length&&(a="?x-oss-process=image/"+o.join("/")),r+a},Ln=9007199254740991;function An(n){var t=Math.round(n);return Math.abs(t-n)<.001?t:Math.floor(n)}function Vf(n){return n=Object.assign({},n),n.size!==void 0&&(n.size=An(ce(n.size,0,Ln))),n.quality!==void 0&&(n.quality=An(ce(n.quality,0,100))),n.cut!==void 0&&(n.cut=[An(ce(n.cut[0],0,Ln)),An(ce(n.cut[1],0,Ln)),An(ce(n.cut[2],0,Ln)),An(ce(n.cut[3],0,Ln))]),n.sharpen!==void 0&&(n.sharpen=An(ce(n.sharpen,0,Ln))),n}function ft(n,t){var e=O(O({},Ff),t.mappings),r=Lf(n);if(r===null)return n;t=Vf(t);var i=e[r];return i?(n=kf(n,t.key,i),/\.basis(\?|$)/.test(n)&&(n=n.replace(/\.basis(\?|$)/,".jpg$1")),i.type==="tencentCloud"?Of(n,t):i.type==="aliyun"?Df(n,t):n):n}function Cn(n,t,e){t===void 0&&(t=ft);var r=t(n,e);if(r===n&&e.cut)throw new Error("ImageURL: cut option not applied.");return r}var pu=/\/cube_(\d+)\//;function mi(n){var t=n.match(pu);return t?Number(t[1]):null}function tr(n,t){return n.replace(pu,"/cube_".concat(t,"/"))}var Nf="data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAIAAUAmJaQAA3AA/vz0AAA=",zf="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAAGhbWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAsaWxvYwAAAABEAAACAAEAAAABAAAB3gAAABkAAgAAAAEAAAHJAAAAFQAAAEJpaW5mAAAAAAACAAAAGmluZmUCAAAAAAEAAGF2MDFDb2xvcgAAAAAaaW5mZQIAAAAAAgAAYXYwMUFscGhhAAAAABppcmVmAAAAAAAAAA5hdXhsAAIAAQABAAAA12lwcnAAAACxaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIAAoAAAAAUaXNwZQAAAAAAAAACAAAAAgAAAA5waXhpAAAAAAEIAAAADGF2MUOBABwAAAAAOGF1eEMAAAAAdXJuOm1wZWc6bXBlZ0I6Y2ljcDpzeXN0ZW1zOmF1eGlsaWFyeTphbHBoYQAAAAAeaXBtYQAAAAAAAAACAAEEAQKDBAACBAUGhwgAAAA2bWRhdBIACgQYADLVMgsWQBhhIAQqrNj/+BIACgUYADLEoDIOFkADDDDCQAACDaqCCb4=",Qf="data:image/heif;base64,AAAAGGZ0eXBoZWljAAAAAG1pZjFoZWljAAABL21ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAHBpY3QAAAAAAAAAAAAAAAAAAAAADnBpdG0AAAAAAAEAAAAjaWluZgAAAAAAAQAAABVpbmZlAgAAAAABAABodmMxAAAAAK9pcHJwAAAAkmlwY28AAAB2aHZjQwEBYAAAAAAAAAAAAADwAPz9+PgAACcDoAABAB5AAQwG//8BYAAAAwAAAwAAAwAAAwAAAwAAreTLgSChAAEAI0IBBwFgAAADAAADAAADAAADAAADAAChInJJlreTLySZNdggogABAAdEAcA98DMkAAAAFGlzcGUAAAAAAAAAAgAAAAIAAAAVaXBtYQAAAAAAAAABAAECgQIAAAAiaWxvYwAAAABEQAABAAEAAAAAAU8AAQAAAAAAAAAOAAAAFm1kYXQAAAAKJgGvLvkQwuWM4A==";function Pa(n){return new Promise(function(t){var e=new Image,r=setTimeout(function(){e.onload=e.onerror=function(){},clearTimeout(r),t(!1)},100);e.onload=e.onerror=function(){e.onload=e.onerror=function(){},clearTimeout(r),t(e.height===2)},e.src=n})}var Ra=null;function vu(){return Ra||(Ra=Promise.all([Pa(Nf),Pa(zf),Pa(Qf)]).then(function(n){return{webp:n[0],avif:n[1],heif:n[2]}}))}var mu=/^(.*)\[(\d+)\]$/;function He(n){if(!isNaN(n.panoIndex)&&isFinite(n.panoIndex))return"".concat(n.workCode,"[").concat(n.panoIndex,"]");throw new Error("Invalid Pano")}function Lt(n){var t=n.match(mu);if(t){t[0];var e=t[1],r=t[2],i=Math.floor(Number(r));if(!isNaN(i)&&isFinite(i))return{workCode:e,panoIndex:i}}throw new Error("Invalid PanoId")}function Ar(n,t){return He(n)===He(t)}function Au(n){return typeof n=="string"&&mu.test(n)}var Uf=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(f.Group),Ot=function(n){ue(t,n);function t(e,r){return n.call(this,e,r)||this}return t.prototype.update=function(e,r,i,a){for(var o=0,s=this.material;o<s.length;o++){var u=s[o];u.update(e,r,i)}},t}(f.Mesh),gu=function(n){ue(t,n);function t(e,r,i){return n.call(this,e,r,i)||this}return t.prototype.update=function(e,r,i,a){for(var o=0,s=this.material;o<s.length;o++){var u=s[o];u.update(e,r,i)}},t}(f.SkinnedMesh);function ti(n,t){t===void 0&&(t=!1);var e=typeof n;if(e==="string")return JSON.stringify(n);if(n===!0)return"true";if(n===!1)return"false";if(n===null)return"null";if(n instanceof Array){for(var r="[",i=n.length-1,a=0;a<i;a++)r+=ti(n[a],!1)+",";return i>-1&&(r+=ti(n[a],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return ti(n.toJSON(),t);for(var o=Object.keys(n).sort(),s=o.length,r="",a=0;a<s;){var u=o[a],l=ti(n[u],!0);l!==void 0&&(a&&r!==""&&(r+=","),r+=JSON.stringify(u)+":"+l),a++}return"{"+r+"}"}switch(e){case"function":return JSON.stringify(n.toString());case"undefined":return t?void 0:null;case"number":return n;default:return isFinite(n)?n:null}}function ma(n){return"hash::".concat(ti(n,!1))}var qf=function(){function n(t){var e,r,i,a,o,s,u,l,c,d,p,A,h,v,g,m;this.uniforms=(e=t.uniforms)!==null&&e!==void 0?e:{},this.defines=(r=t.defines)!==null&&r!==void 0?r:{},this.type=t.type,this.vertex={mainBefore:(a=(i=t.vertex)===null||i===void 0?void 0:i.mainBefore)!==null&&a!==void 0?a:"",mainStart:(s=(o=t.vertex)===null||o===void 0?void 0:o.mainStart)!==null&&s!==void 0?s:"",mainEnd:(l=(u=t.vertex)===null||u===void 0?void 0:u.mainEnd)!==null&&l!==void 0?l:""},this.fragment={mainBefore:(d=(c=t.fragment)===null||c===void 0?void 0:c.mainBefore)!==null&&d!==void 0?d:"",mainStart:(A=(p=t.fragment)===null||p===void 0?void 0:p.mainStart)!==null&&A!==void 0?A:"",mainModelColor:(v=(h=t.fragment)===null||h===void 0?void 0:h.mainModelColor)!==null&&v!==void 0?v:"",mainEnd:(m=(g=t.fragment)===null||g===void 0?void 0:g.mainEnd)!==null&&m!==void 0?m:""}}return n.prototype.getHash=function(){return ma({vertex:this.vertex,fragment:this.fragment,defines:this.defines})},n.prototype.onBeforeCompile=function(t,e){},n}(),xi=function(){return typeof document!="undefined"?new f.TextureLoader().load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAABCAYAAACouxZ2AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAACAKADAAQAAAABAAAAAQAAAAB7UD0+AAACA0lEQVRIDXWUW3YjIQxEwdnV/GT/q8kO3FO3pAJst3PSAaR6Cbszf//9XeMxxpjXmI+pVXudp2s6PC4dqHff9e6D7/PZLy46xQvG+sZvrfK8xgXUeq85yINe9bdmtOK1+kun5vjgq58a+eZPna9jvmjiserqG/+Whathvo3L3WhV89L9sXI/m18z2uene9ap/ftsuT9WZxoHXzW56/fpj8l7+tTw7P011NdpqnY19sRsfuHMA9u8oZWfDz4+fra/dfG1V60ydZ7qba1g7UNAeK0JP7ydD7/OqH6wO2f7HTq+B/lbL9qsB3/N1/UzR81XfPzw4tp5OPvRneacteq8Xo0xR3vuv/kPz0KtX0Nhg0eHuaNXdWI3X/ld427h++vzyp99V6VPrzWFhbv4ayay4oFecm198MmUXN/mL+x7npq/uJXBGb/MTw4+t+SvbLoTZnUW5uHhz7nWcTxT73OwXV7cxT9wbBf/0LnDBgcnHmtPLYba32Hp808sMy1u88yhr58n70/v4xX92GSN19l/2UsqGmiH94Hpxjcs+DO/ccpIVNVp62PUWXu//ur1GQy1Cf+GZ13rtNYN1po3/NI79fGXibHkq4z25xvV2pW3szpneXsW8SsreTe/NIPrtXMnH7wPf+LEN6tqhUVHj3XKD/72p9eafCeYB3zuonnbv7yqP8d/o4K6gRb1wbYAAAAASUVORK5CYII="):new f.Texture}();xi.minFilter=f.NearestFilter;xi.magFilter=f.NearestFilter;xi.wrapS=f.RepeatWrapping;xi.wrapT=f.RepeatWrapping;var ge={customShaders:[],pano0:null,pano1:null,floorStyle:"OPACITY",colorStyle:"RGB",constantColor:new f.Vector3(.6,.6,.6),shownFloorIndex:-1,modelAlpha:1,opacity:1,progress:0,transition:"FADE",clippers:null,brightness:1,useEDL:!1,useHQWeight:!1,useHQDepth:!1,pointSize:"ATTENUATION",pointBack:"DARK",pointShape:"CIRCLE",pointScale:.03,pointMaxPixel:40,pointMinPixel:1,gradientTexture:xi,colorSaturation:0,colorBrightness:0};function Hf(n,t){var e=n!=null?n:[],r=t!=null?t:[];if(r.length!==e.length)return!1;for(var i=0;i<r.length;i++)if(!e[i].clippingBoxMatrix.equals(r[i].clippingBoxMatrix)||e[i].floorIndex!==r[i].floorIndex)return!1;return!0}function Gf(n,t){return n&&t?n.luminanceMap===t.luminanceMap&&n.map===t.map&&n.zoom===t.zoom&&n.matrix.equals(t.matrix):!n&&!t}function yu(n,t){var e=!1;for(var r in t)if(t[r]!==void 0)switch(r){case"clippers":Hf(n[r],t[r])||(n[r]=t[r],e=!0);break;case"pano0":case"pano1":Gf(n[r],t[r])||(n[r]=t[r],e=!0);break;default:n[r]!==t[r]&&(n[r]=t[r],e=!0);break}return e}function Ji(n,t,e){return n+(t-n)*e}function Kf(n,t,e,r){var i=(t*e+2*n)/Math.pow(e,3),a=-(2*t*e+3*n)/Math.pow(e,2),o=t,s=n;return i*Math.pow(r,3)+a*Math.pow(r,2)+o*r+s}function _f(n,t,e,r){var i=(t*e+2*n)/Math.pow(e,3),a=-(2*t*e+3*n)/Math.pow(e,2),o=t;return 3*i*Math.pow(r,2)+2*a*r+o}function jf(n,t,e,r){var i=r[1]-r[0];return n=na(n,r),t=na(t,r),t-n>i/2?Ji(n+i,t,e):n-t>i/2?Ji(n-i,t,e):Ji(n,t,e)}function na(n,t){var e=t[1]-t[0];return n<t[0]?na(n+e,t):n>=t[1]?na(n-e,t):n}function Jf(n,t,e,r){return r?jf(n,t,e,r):Ji(n,t,e)}function Ds(n){var t=Number(n);return isNaN(t)||!isFinite(t)?0:t}var Re=function(){function n(t){this.config={},this.progress=1,this.ended=!0,this.value={},this.startTime=ve(),this.startVelocity=0,this.duration=0,this.keyframes=[];for(var e in t){var r=t[e];typeof r=="object"?(this.value[e]=Ds(r.value),this.config[e]={circle:r.circle}):(this.value[e]=Ds(r),this.config[e]={circle:!1})}this.keyframes=[{progress:0,value:O({},this.value)},{progress:1,value:O({},this.value)}]}return n.prototype.getProgress=function(t){var e=t-this.startTime;return e<0?0:e>=this.duration?1:1-Kf(1,this.startVelocity,this.duration,e)},n.prototype.getValue=function(t){for(var e=1;e<this.keyframes.length;e++)if(this.keyframes[e].progress>t){var r=this.keyframes[e-1],i=this.keyframes[e],a={};for(var o in this.config){var s=(t-r.progress)/(i.progress-r.progress);a[o]=Jf(r.value[o],i.value[o],s,this.config[o].circle)}return a}return O({},this.keyframes[this.keyframes.length-1].value)},n.prototype.getProgressVelocity=function(t){var e=t-this.startTime;return e>=this.duration?0:_f(1,this.startVelocity,this.duration,e)},n.prototype.update=function(t){return this.ended?!0:(this.progress=Math.min(1,Math.max(0,this.progress,this.getProgress(t))),this.value=this.getValue(this.progress),this.ended=this.progress>=1,this.ended&&this.callbacks&&(this.callbacks[0](),this.callbacks=void 0),this.ended)},n.prototype.getKeyFrameSegment=function(t){for(var e=this.getProgress(t),r=1;r<this.keyframes.length;r++)if(this.keyframes[r].progress>e)return[this.keyframes[r-1],this.keyframes[r]];return[this.keyframes[this.keyframes.length-2],this.keyframes[this.keyframes.length-1]]},n.prototype.getTargetKeyframe=function(){return this.keyframes[this.keyframes.length-1]},n.prototype.set=function(t,e,r,i){var a;r===void 0&&(r=0),isNaN(e)&&(e=0),isNaN(r)&&(r=0),i=i!=null?i:ve();var o=this.getProgress(i),s=this.getValue(o),u={};for(var l in this.config)u[l]=(a=t[l])!==null&&a!==void 0?a:s[l];var c=[{progress:0,value:s},{progress:1,value:u}];return this.setKeyframes(c,e,r,i)},n.prototype.setKeyframes=function(t,e,r,i){var a=this;if(r===void 0&&(r=0),t.length<2)throw new Error("keyframes invalid.");return isNaN(e)&&(e=0),isNaN(r)&&(r=0),this.callbacks&&(this.callbacks[1](new Error("motion aborted.")),this.callbacks=void 0),new Promise(function(o,s){i=i!=null?i:ve(),a.progress=0,a.ended=!1,a.startTime=i,a.startVelocity=r,a.keyframes=t,a.duration=e,e===0?(a.progress=1,a.value=O({},t[t.length-1].value)):a.value=O({},t[0].value),a.callbacks=[o,s]})},n.prototype.dispose=function(){this.callbacks&&(this.callbacks[1](new Error("motion dispose.")),this.callbacks=void 0)},n}(),Xf=500;function Wf(n){return-(Math.cos(Math.PI*n)-1)/2}var yr=function(n){ue(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.appearMotion=new Re({appear:0}),i}return t.prototype.update=function(e,r,i,a){var o,s;if(this.material.update(e,r,i),a&&a.refine==="ADD"&&a.tileset.rootMeta.pntsOrder==="RANDOM"){var u=this.geometry,l=this.appearMotion,c=i.visible&&a.state.selectedFrameNumber===a.tileset.frameNumber,d=a.tileset.maxScreenSpaceError,p=a.state.screenSpaceError,A=(s=(o=a.parent)===null||o===void 0?void 0:o.state.screenSpaceError)!==null&&s!==void 0?s:p,h=1;if(a.levelOfContent>a.tileset.minLevelOfDetail&&A!==p&&(h=(A-d)/(A-p)),h=ce(h,0,1),h=Wf(h),c){var v=1;l.getTargetKeyframe().value.appear!==v&&l.set({appear:v},Xf).catch(Q)}else{var v=0;l.getTargetKeyframe().value.appear!==v&&l.set({appear:v},0).catch(Q)}l.ended!==!0&&l.update(r.time);var g=u.index?u.index.count:u.attributes.position?u.attributes.position.count:1/0,m=Math.floor(g*h*l.value.appear);u.drawRange.count!==m&&(this.geometry.setDrawRange(0,m),i.needsRender=!0)}},t}(f.Points),kn=new Set,Zf=function(n){ue(t,n);function t(){var e=n.call(this)||this;return e.needsRender=!0,e.pbmMaterialParametersVersion=0,e.materialParameters=O({},ge),e}return t.prototype.getMaterial=function(){return O({},this.materialParameters)},t.prototype.setMaterial=function(e){var r=this;Object.assign(this.materialParameters,e),kn.clear(),this.traverse(function(i){if(i instanceof Ot)for(var a=0,o=i.material;a<o.length;a++){var s=o[a];kn.has(s)||(Object.assign(s,r.materialParameters),kn.add(s))}i instanceof yr&&(kn.has(i.material)||(Object.assign(i.material,r.materialParameters),kn.add(i.material)))}),kn.clear(),this.needsRender=!0},t}(f.Group),Yf=["right","left","up","down","front","back"];function bu(n,t,e,r){var i=new f.Box3;switch(n){case"up":i.min.y=.5,i.max.y=.5,i.min.x=+t-.5,i.max.x=+t-.5+r,i.min.z=-e+.5-r,i.max.z=-e+.5;break;case"down":i.min.y=-.5,i.max.y=-.5,i.min.x=+t-.5,i.max.x=+t-.5+r,i.min.z=+e-.5,i.max.z=+e-.5+r;break;case"left":i.min.x=-.5,i.max.x=-.5,i.min.z=-t+.5-r,i.max.z=-t+.5,i.min.y=-e+.5-r,i.max.y=-e+.5;break;case"right":i.min.x=.5,i.max.x=.5,i.min.z=+t-.5,i.max.z=+t-.5+r,i.min.y=-e+.5-r,i.max.y=-e+.5;break;case"front":i.min.z=-.5,i.max.z=-.5,i.min.x=+t-.5,i.max.x=+t-.5+r,i.min.y=-e+.5-r,i.max.y=-e+.5;break;case"back":i.min.z=.5,i.max.z=.5,i.min.x=-t+.5-r,i.max.x=-t+.5,i.min.y=-e+.5-r,i.max.y=-e+.5;break}return i.applyMatrix4(new f.Matrix4().makeRotationY(Math.PI))}var xu=function(n,t){if(!(n.level>=t))for(var e=n.level+1,r=n.size/2,i=[new f.Vector2(n.position.x,n.position.y),new f.Vector2(n.position.x+r,n.position.y),new f.Vector2(n.position.x,n.position.y+r),new f.Vector2(n.position.x+r,n.position.y+r)],a=0,o=i;a<o.length;a++){var s=o[a],u={face:n.face,level:e,size:r,position:s,box:bu(n.face,s.x,s.y,r),parent:n,children:[]};n.children.push(u),xu(u,t)}};function $f(n,t){var e={level:0,face:n,position:new f.Vector2(0,0),size:1,box:bu(n,0,0,1),parent:null,children:[]};return xu(e,t),e}function bo(n){var t=Yf.map(function(e){return $f(e,n)});return{children:t}}function jo(n,t){for(var e=0,r=n.children;e<r.length;e++){var i=r[e],a=t(i);a!==!1&&jo(i,t)}}function Jt(n,t){for(var e={},r=0,i=t;r<i.length;r++){var a=i[r];a in n&&(e[a]=n[a])}return e}function Aa(n,t){for(var e=O({},n),r=0,i=t;r<i.length;r++){var a=i[r];a in e&&delete e[a]}return e}var wi=new f.BoxBufferGeometry(1,1,1,1,1);wi.deleteAttribute("uv");wi.deleteAttribute("normal");wi.groups=[];wi.scale(-1,1,1);var ed=`
|
|
392
392
|
varying vec3 worldPosition;
|
|
393
393
|
void main() {
|
|
394
394
|
vec4 transform = vec4(position, 1.0);
|
|
@@ -414,7 +414,7 @@ varying vec2 vUv;
|
|
|
414
414
|
void main() {
|
|
415
415
|
gl_FragColor = texture2D(map, vUv);
|
|
416
416
|
}
|
|
417
|
-
`,Mu=[],Mi=new f.PerspectiveCamera(90,1,.1,2);Mi.up.set(0,-1,0);Mi.lookAt(new f.Vector3(1,0,0));Mi.updateMatrix();Mi.matrixAutoUpdate=!1;var Si=new f.PerspectiveCamera(90,1,.1,2);Si.up.set(0,-1,0);Si.lookAt(new f.Vector3(-1,0,0));Si.updateMatrix();Si.matrixAutoUpdate=!1;var Ci=new f.PerspectiveCamera(90,1,.1,2);Ci.up.set(0,0,1);Ci.lookAt(new f.Vector3(0,1,0));Ci.updateMatrix();Ci.matrixAutoUpdate=!1;var Ei=new f.PerspectiveCamera(90,1,.1,2);Ei.up.set(0,0,-1);Ei.lookAt(new f.Vector3(0,-1,0));Ei.updateMatrix();Ei.matrixAutoUpdate=!1;var Ii=new f.PerspectiveCamera(90,1,.1,2);Ii.up.set(0,-1,0);Ii.lookAt(new f.Vector3(0,0,1));Ii.updateMatrix();Ii.matrixAutoUpdate=!1;var Ti=new f.PerspectiveCamera(90,1,.1,2);Ti.up.set(0,-1,0);Ti.lookAt(new f.Vector3(0,0,-1));Ti.updateMatrix();Ti.matrixAutoUpdate=!1;var Vs={front:{camera:Ii,index:4},back:{camera:Ti,index:5},up:{camera:Ci,index:2},down:{camera:Ei,index:3},left:{camera:Si,index:1},right:{camera:Mi,index:0}};function od(){var n=Mu.pop();return n||new f.ShaderMaterial({uniforms:{map:{value:null},flipY:{value:0}},vertexShader:id,fragmentShader:ad,depthTest:!1,depthWrite:!1,stencilWrite:!1,blending:f.NoBlending,lights:!1,toneMapped:!1,fog:!1})}function sd(n){n.uniforms.map.value=null,Mu.push(n)}function ud(n,t,e){var r=new f.Scene;r.matrixAutoUpdate=!1;var i=new f.Group;i.scale.set(1,1,-1),r.add(i);for(var a=[],o=new Set,s=0,u=n;s<u.length;s++){var l=u[s];o.add(l.face);var c=od();a.push(c),c.uniforms.map.value=l.texture,c.uniforms.flipY.value=l.flipY?1:0;var d=new f.Group,p=new f.Mesh(nd,c);p.position.set(l.position.x+l.size.x/2-.5,1-(l.position.y+l.size.y/2)-.5,-.5),p.scale.set(l.size.x,l.size.y,1),d.quaternion.copy(rd[l.face]),d.add(p),i.add(d)}var A=e.autoClear,h=e.sortObjects,v=e.xr.enabled,g=t.texture.generateMipmaps;e.autoClear=!1,e.sortObjects=!1,e.xr.enabled=!1,t.texture.generateMipmaps=!1;var m=e.getRenderTarget(),y=0;o.forEach(function(w){++y===o.size&&(t.texture.generateMipmaps=g),e.setRenderTarget(t,Vs[w].index),e.render(r,Vs[w].camera)}),e.setRenderTarget(m),e.autoClear=A,e.sortObjects=h,e.xr.enabled=v;for(var b=0,x=a;b<x.length;b++){var c=x[b];sd(c)}}var ld=function(){return!1}();function Ai(n){n===void 0&&(n={});var t=Object.assign(document.createElementNS("http://www.w3.org/1999/xhtml","img"),{crossOrigin:"",close:function(){n.onClose&&n.onClose.call(this),this.onerror=this.onload=this.close=Q,this.removeAttribute("src")}});return t}function Mo(n){return new Promise(function(t,e){var r=URL.createObjectURL(n),i=Ai({onClose:function(){this.src===r&&URL.revokeObjectURL(r)}});i.onload=function(){i.src===r&&URL.revokeObjectURL(r),i.onload=i.onerror=Q,setTimeout(function(){t(i)},10)},i.onerror=function(){var a=i.src;i.onload=i.onerror=Q,i.close(),e(new Error("image load error: ".concat(a)))},i.decoding="async",i.src=r})}var Ns=[];function cd(n,t){var e=Ns.shift();if(e)return e.width=n,e.height=t,e;var r=Object.assign(document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),{close:function(){r.close=Q,Ns.push(r)}});return r}function zs(n,t){if(t&&(n.width>t.width||n.height>t.height)){var e=cd(Math.min(n.width,t.width),Math.min(n.height,t.height)),r=e.getContext("2d");r.clearRect(0,0,e.width,e.height),r.drawImage(n,0,0,e.width,e.height),n.close();var i=new f.Texture(e);i.needsUpdate=!0,i.flipY=!0;var a=i.dispose;return i.dispose=function(){e.close(),a.call(i),i.dispose=a},i}else{var o=new f.Texture(n);o.needsUpdate=!0,typeof ImageBitmap!="undefined"&&n instanceof ImageBitmap?o.flipY=!1:o.flipY=!0;var s=o.dispose;return o.dispose=function(){n.close(),s.call(o),o.dispose=s},o}}function fd(n){var t=new f.CubeTexture(n);t.needsUpdate=!0,t.flipY=!1;var e=t.dispose;return t.dispose=function(){for(var r=0,i=n;r<i.length;r++){var a=i[r];a.close()}e.call(t),t.dispose=e},t}var Qs=new f.Vector3,gn=["right","left","up","down","front","back"],qe=function(){function n(t,e,r,i,a){var o,s,u;this.tileTree=e,this.tileSources=r,this.options=i,this.renderer=a,this.name="",this.needsRender=!1,this.baseLevel=0,this.maxRequest=n.DEFAULT_MAX_REQUEST,this.disposed=!1,this.loadedCubeNodes=new Set,this.loadingCubeNodes=new Set,this.drawedCubeNodes=new Set,this.baseCubeTexture=null,this._cubeRenderTarget=null,this.prepareToRender=[],this.baseCubeTexture=t;var l=(o=this.baseCubeTexture.images)!==null&&o!==void 0?o:[],c=Array.isArray(l)&&l[0]&&l[0].width||((u=(s=i.imageURL)===null||s===void 0?void 0:s.options)===null||u===void 0?void 0:u.size);typeof c!="number"&&(c=2048),this.baseLevel=Math.floor(c/512)-1}return Object.defineProperty(n.prototype,"cubeRenderTarget",{get:function(){return this._cubeRenderTarget},set:function(t){var e,r,i,a,o,s;if(t===null)throw new Error("cannot set cubeRenderTarget to null.");t.width!==this.options.textureSize&&t.setSize(this.options.textureSize,this.options.textureSize),t.texture.format=(e=this.options.format)!==null&&e!==void 0?e:f.RGBAFormat,t.texture.minFilter=(r=this.options.minFilter)!==null&&r!==void 0?r:f.LinearFilter,t.texture.magFilter=(i=this.options.magFilter)!==null&&i!==void 0?i:f.LinearFilter,t.texture.wrapS=(a=this.options.wrapS)!==null&&a!==void 0?a:f.ClampToEdgeWrapping,t.texture.wrapT=(o=this.options.wrapT)!==null&&o!==void 0?o:f.ClampToEdgeWrapping,t.texture.generateMipmaps=(s=this.options.generateMipmaps)!==null&&s!==void 0?s:!0,this.baseCubeTexture&&(wo(this.baseCubeTexture,t,this.renderer),this.baseCubeTexture.dispose(),this.baseCubeTexture=null),this._cubeRenderTarget&&wo(this._cubeRenderTarget.texture,t,this.renderer),this._cubeRenderTarget=t},enumerable:!1,configurable:!0}),n.prototype.requestTile=function(t){var e=this,r,i,a,o,s,u,l=this.tileSources.filter(function(v){return v.level===t.level})[0];if(this.baseLevel>=t.level||!l)return this.loadedCubeNodes.add(t),this.prepareToRender.push({node:t,texture:null}),!1;var c=l.size,d=Math.pow(2,t.level)*t.position.y,p=Math.pow(2,t.level)*t.position.x,A="".concat(((a=(i=(r=this.options.imageURL)===null||r===void 0?void 0:r.options)===null||i===void 0?void 0:i.key)!==null&&a!==void 0?a:"pano.0").replace(/^pano/,"pano_tile"),".").concat(t.face,".").concat(t.level,".").concat(d,".").concat(p),h=O(O({},_t((s=(o=this.options.imageURL)===null||o===void 0?void 0:o.options)!==null&&s!==void 0?s:{key:"unknown"},["format","sharpen","mappings"])),{key:A,size:l.scale>=1?void 0:c*t.size*l.scale,cut:[c*t.position.x,c*t.position.y,c*t.size,c*t.size]});return t.level===1&&l.scale>=.5&&(h.format==="jpg"||/\.jpg$/.test(l[t.face]))&&(h.size=void 0,h.quality||(h.quality=70)),this.loadingCubeNodes.add(t),this.options.textureLoader.loadTexture(l[t.face],{imageURL:{transform:(u=this.options.imageURL)===null||u===void 0?void 0:u.transform,options:O({},h)},format:f.RGBAFormat,timeout:this.options.timeout,magFilter:this.options.magFilter,minFilter:this.options.minFilter,fetcher:this.options.fetcher}).then(function(v){if(e.disposed){v.body.dispose();return}e.prepareToRender.push({node:t,texture:v.body}),e.loadedCubeNodes.add(t)}).catch(Q).then(function(){e.disposed||e.loadingCubeNodes.delete(t)}),!0},n.prototype.update=function(t,e){var r=this;if(!this.disposed){var i=t.planes[5].normal,a=Math.max(this.maxRequest-this.loadingCubeNodes.size,0),o=[];_o(this.tileTree,function(v){if(v.level>e||!t.intersectsBox(v.box))return!1;!r.loadedCubeNodes.has(v)&&!r.loadingCubeNodes.has(v)&&o.push(v)}),o.sort(function(v,g){return v.level!==g.level?v.level-g.level:v.box.getCenter(Qs).angleTo(i)-g.box.getCenter(Qs).angleTo(i)});for(var s=0,u=o;s<u.length;s++){var l=u[s];if(a<=0)break;var c=this.requestTile(l);c&&a--}if(this.cubeRenderTarget&&this.prepareToRender.length){this.prepareToRender.sort(function(v,g){return v.node.level-g.node.level});for(var d=[],p=0;p<this.prepareToRender.length;p++){var A=this.prepareToRender[p],l=A.node,h=A.texture;(l.parent===null||this.drawedCubeNodes.has(l.parent))&&(this.drawedCubeNodes.add(l),h&&d.push({face:l.face,position:l.position,size:new f.Vector2(l.size,l.size),texture:h,flipY:!h.flipY}),this.prepareToRender.splice(p,1),p--)}d.length&&(ud(d,this.cubeRenderTarget,this.renderer),this.needsRender=!0)}}},Object.defineProperty(n.prototype,"tilePending",{get:function(){return this.loadingCubeNodes.size},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"texture",{get:function(){if(!this._cubeRenderTarget)throw new Error("cubeRenderTarget never set.");return this._cubeRenderTarget.texture},enumerable:!1,configurable:!0}),n.prototype.dispose=function(){if(!this.disposed){this.disposed=!0,this.baseCubeTexture&&(this.baseCubeTexture.dispose(),this.baseCubeTexture=null),this.loadingCubeNodes.clear(),this.loadedCubeNodes.clear();for(var t=0,e=this.prepareToRender;t<e.length;t++){var r=e[t];r.texture&&r.texture.dispose()}this.prepareToRender.length=0}},n.DEFAULT_MAX_REQUEST=3,n}(),Xn=function(){function n(){}return n.prototype.loadTexture=function(t,e,r,i,a,o){var s,u,l,c,d,p,A;r===void 0&&(r=Q),i===void 0&&(i=Q),a===void 0&&(a=Q);var h={};typeof e.flipY!="undefined"&&(h.flipY=e.flipY),typeof e.format!="undefined"&&(h.format=e.format),typeof e.encoding!="undefined"&&(h.encoding=e.encoding),h.generateMipmaps=(s=e.generateMipmaps)!==null&&s!==void 0?s:!1,h.minFilter=(u=e.minFilter)!==null&&u!==void 0?u:f.LinearFilter,h.magFilter=(l=e.magFilter)!==null&&l!==void 0?l:f.LinearFilter;var v=(d=(c=e.imageURL)===null||c===void 0?void 0:c.options)!==null&&d!==void 0?d:{key:"unknown"};t=Cn(t,(p=e.imageURL)===null||p===void 0?void 0:p.transform,v);var g=Ls(t),m=(A=e.viaAjax)!==null&&A!==void 0?A:ld,y=Fs(t),b=/^https?:/.test(g);if(y?m=!0:b||(m=!1),m){var x=null,w="blob";return e.fetcher.ajax(t,{timeout:e.timeout,responseType:w},void 0,void 0,a).then(function(E){return Mo(E.body)}).then(function(E){return zs(E,e.maxSize)}).then(function(E){return Object.assign(E,h),E}).then(function(E){var P={meta:x,body:E};return r(P),P}).catch(function(E){return i(E),Promise.reject(E)})}else{var M=null,S;return Promise.resolve().then(function(){return Ai()}).then(function(E){return S=E,e.fetcher.loadImage(t,{timeout:e.timeout},void 0,void 0,a,E)}).then(function(E){return M=E.meta,zs(E.body,e.maxSize)}).then(function(E){return Object.assign(E,h),E}).then(function(E){var P={meta:M,body:E};return r(P),P}).catch(function(E){return S&&S.close(),i(E),Promise.reject(E)})}},n.prototype.loadCubeTexture=function(t,e,r,i,a,o){var s,u,l,c,d,p,A;r===void 0&&(r=Q),i===void 0&&(i=Q),a===void 0&&(a=Q);var h={};typeof e.format!="undefined"&&(h.format=e.format),h.generateMipmaps=(s=e.generateMipmaps)!==null&&s!==void 0?s:!1,h.minFilter=(u=e.minFilter)!==null&&u!==void 0?u:f.LinearFilter,h.magFilter=(l=e.magFilter)!==null&&l!==void 0?l:f.LinearFilter;for(var v=[t[gn[0]],t[gn[1]],t[gn[2]],t[gn[3]],t[gn[4]],t[gn[5]]],g=[],m=[0,0,0,0,0,0],y=[],b=function(w){var M=(d=(c=e.imageURL)===null||c===void 0?void 0:c.options)!==null&&d!==void 0?d:{key:"unknown"},S=Cn(v[w],(p=e.imageURL)===null||p===void 0?void 0:p.transform,O(O({},M),{key:M.key+"."+gn[w]})),E=Ls(S),P=function(D){m[w]=D,a(m.reduce(function(V,z){return V+z},0)/6)},B=(A=e.viaAjax)!==null&&A!==void 0?A:!1,C=/^https?:$/.test(E),I=Fs(S);if(I?B=!0:C||(B=!1),B){var F="blob",T=e.fetcher.ajax(S,{timeout:e.timeout,responseType:F},void 0,void 0,P).then(function(D){return y[w]=D.meta,Mo(D.body)});g.push(T)}else{var L,T=Promise.resolve().then(function(){return Ai()}).then(function(V){return L=V,e.fetcher.loadImage(S,{timeout:e.timeout},void 0,void 0,P,V)}).then(function(V){return y[w]=V.meta,V.body}).catch(function(V){return L&&L.close(),Promise.reject(V)});g.push(T)}},x=0;x<6;x++)b(x);return Promise.all(g).then(function(w){return fd(w)}).then(function(w){return Object.assign(w,O({encoding:f.sRGBEncoding},h)),w}).then(function(w){var M={body:w,meta:y};return r(M),M}).catch(function(w){for(var M=0,S=g;M<S.length;M++){var E=S[M];E.then(function(P){return P.close()}).catch(Q)}return i(w),Promise.reject(w)})},n.prototype.loadTiledCubeTexture=function(t,e,r,i,a,o,s){var u=this;return i===void 0&&(i=Q),a===void 0&&(a=Q),o===void 0&&(o=Q),new Promise(function(l,c){var d,p;u.loadCubeTexture(t,{imageURL:{transform:(d=r.imageURL)===null||d===void 0?void 0:d.transform,options:(p=r.imageURL)===null||p===void 0?void 0:p.options},format:f.RGBAFormat,viaAjax:r.viaAjax,timeout:r.timeout,fetcher:r.fetcher,magFilter:r.magFilter,minFilter:r.minFilter,generateMipmaps:r.generateMipmaps},function(A){var h,v=A.meta,g=A.body,m=(h=r.tileMaxLevel)!==null&&h!==void 0?h:2,y=Math.max(1024*m,512),b=bo(m),x=new qe(g,b,e,{textureSize:y,textureLoader:u,imageURL:r.imageURL,magFilter:r.magFilter,minFilter:r.minFilter,generateMipmaps:r.generateMipmaps,timeout:r.timeout,fetcher:r.fetcher},s),w={meta:v,body:x};i(w),l(w)},function(A){a(A),c(A)},o,s).catch(Q)})},n}();const dd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("n\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{H0v{pyqr-Ip|zz|{K0v{pyqr-Iz|}untrl}nlrr\x07K0v{pyqr-Ixv{{v{tl}nlrr\x07K0v{pyqr-Iy|tqr}uosl}nlrr\x07K0v{pyqr-Ipyv}}v{tl}yn{rl}nlrr\x07KZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--0v{pyqr-Ixv{onrlrr\x07K--0v{pyqr-Iortv{lrr\x07K--0v{pyqr-Iz|}untrlrr\x07K--0v{pyqr-Ixv{{v{tlrr\x07K--0v{pyqr-I}|wrplrr\x07K--0v{pyqr-Iy|tqr}uoslrr\x07K--0v{pyqr-Ipyv}}v{tl}yn{rlrr\x07K--d|yq]|vv|{-J-rpA5n{s|zrq9->;=6H--0vsqrs-b`RlV[`aN[PV[T----d|yq]|vv|{-J-v{n{prZnv\x07-7-d|yq]|vv|{H--0r{qvs--d|yq]|vv|{-J-z|qryZnv\x07-7-d|yq]|vv|{H--zn@-pnzrn_|nv|{Znv\x07-J-zn@5vrZnv\x07h=jh=j9-vrZnv\x07h>jh=j9-vrZnv\x07h?jh=j9-vrZnv\x07h=jh>j9-vrZnv\x07h>jh>j9-vrZnv\x07h?jh>j9-vrZnv\x07h=jh?j9-vrZnv\x07h>jh?j9-vrZnv\x07h?jh?j6H--PnzrnQvrpv|{-J-{|znyv r5pnzrn_|nv|{Znv\x07-7-rp@5=;=9-=;=9-:>;=66H--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Is|tlrr\x07K--ZNV[lR[Q\f"),hd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=6{vs|z-nz}yrPor-}n{|=lzn}H{vs|z-znA-}n{|=lznv\x07H{vs|z-sy|n-}n{|=l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|=lyzv{n{prZn}H0r{qvs{vs|z-nz}yrPor-}n{|>lzn}H{vs|z-znA-}n{|>lznv\x07H{vs|z-sy|n-}n{|>l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|>lyzv{n{prZn}H0r{qvs{vs|z-sy|n-z|qryNy}un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x076H--0vs-qrsv{rq5b`RlYbZV[N[PR6----}n{|=P|y|;n-J->;=-:-r\x07rPor5}n{|=lyzv{n{prZn}9-}n{|=a|crr\x076;H----}n{|>P|y|;n-J->;=-:-r\x07rPor5}n{|>lyzv{n{prZn}9-}n{|>a|crr\x076;H--0r{qvs--0vs-qrsv{rq5b`RlOYNPXla_N[`VaV\\[6----sy|n-oynpx]|tr-J-np|5:?;=-7-}|tr-8->;=6H----}n{|P|y|-J-zv\x075}n{|=P|y|9-OYNPXlP\\Y\\_9-zv{5>;=9-oynpx]|tr66H----}n{|P|y|-J-zv\x075}n{|P|y|9-}n{|>P|y|9-zn\x075=;=9-oynpx]|tr-:-]V-8->;=66H--0ryvs-qrsv{rq5b`Rl`]_RNQla_N[`VaV\\[6----rp?-prr{Pr{rP||q-J-r|yv|{-7-}v\x07ry_nv|-<-?;=H----sy|n-n{vv|{_nqv-J-qvn{pr5rp?5=;=9-=;=69-prr{Pr{rP||q6-7->;?H----sy|n-n{vv|{]|tr-J--qvn{pr5tylSntP||q;\x07\b9-prr{Pr{rP||q6-<-n{vv|{_nqvH----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-z||ur}5=;=9-=;?9-}|tr-:-n{vv|{]|tr66H--0ryr----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-}|tr6H--0r{qvs--tylSntP|y|-J-zv\x075}n{|P|y|9-rpA5}n{|P|y|;to9-=;=69-pynz}5z|qryNy}un-7-@=;=9-=;=9->;=66H--<<-JJJJJJJJJJJJJJJJ--ZNV[lZ\\QRYlP\\Y\\_--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0v{pyqr-Iqvurv{tlsntzr{K--ZNV[lR[Q\f"),pd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%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jh=j9-vrZnv\x07h>jh=j9-vrZnv\x07h?jh=j9-vrZnv\x07h=jh>j9-vrZnv\x07h>jh>j9-vrZnv\x07h?jh>j9-vrZnv\x07h=jh?j9-vrZnv\x07h>jh?j9-vrZnv\x07h?jh?j6H--PnzrnQvrpv|{-J-{|znyv r5pnzrn_|nv|{Znv\x07-7-rp@5=;=9-=;=9-:>;=66H--0vs-qrsv{rq5b`RlRQY6----Y|tQr}u-J-y|t?5:z]|vv|{; 6H--0r{qvs--V_||sZnx-J-=;=H--0vs-qrsv{rq5b`RlcR_aRelZN_X6----V_||sZnx-J-r}5no5znx-:->;=69-=;>6H--0r{qvs--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Ir{zn}lrr\x07K--0v{pyqr-Is|tlrr\x07K--ZNV[lR[Q\f"),vd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=6{vs|z-sy|n-sy||H{vs|z-nz}yrPor-}n{|=lzn}H{vs|z-znA-}n{|=lznv\x07H{vs|z-sy|n-}n{|=l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|=lyzv{n{prZn}H0r{qvs{vs|z-nz}yrPor-}n{|>lzn}H{vs|z-znA-}n{|>lznv\x07H{vs|z-sy|n-}n{|>l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|>lyzv{n{prZn}H0r{qvs{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-}|trH0vs-qrsv{rq5b`RlP\\Y\\_lP\\[`aN[a6--{vs|z-rp@-p|{n{P|y|H0r{qvs0vs-qrsv{rq5b`RlP\\Y\\_lNYaVabQR6--{vs|z-nz}yr?Q-tnqvr{ar\x07rH0r{q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v r5q-8-\x006H\frp@-to?u5rp@-p6-\n----rpA-X-J-rpA5=;=9-:>;=-<-@;=9-?;=-<-@;=9-:>;=6H----rpA-}-J-zv\x075rpA5p;ot9-X; 69-rpA5p;to9-X;\x07\b69-r}5p;o9-p;t66H----rpA-\0-J-zv\x075rpA5};\x07\b9-p;69-rpA5p;9-};\b \x0769-r}5};\x079-p;66H----sy|n-q-J-\0;\x07-:-zv{5\0;9-\0;\b6H----sy|n-r-J->;=r:>=H----r{-rp@5no5\0; -8-5\0;-:-\0;\b6-<-5C;=-7-q-8-r669-q-<-5\0;\x07-8-r69-\0;\x076H\frp@-u?to5rp@-p6-\n----rpA-X-J-rpA5>;=9-?;=-<-@;=9->;=-<-@;=9-@;=6H----rp@-}-J-no5snp5p;\x07\x07\x07-8-X;\x07\b 6-7-C;=-:-X;6H----r{-p; -7-zv\x075X;\x07\x07\x079-pynz}5}-:-X;\x07\x07\x079-=;=9->;=69-p;\b6H\frp@-trP|y|O\bUrvtu5nz}yr?Q-tnqvr{ar\x07r9-rpA-d|yq]|vv|{6-\n--sy|n--J-5d|yq]|vv|{;\b-:-z|qryO|{qv{tZv{;\b6-<-5z|qryO|{qv{tZn\x07;\b-:-z|qryO|{qv{tZv{;\b6H--r{-r\x07r?Q5tnqvr{ar\x07r9-rp?59-=;B66;toH\fZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--<<-JJJ-顶部裁切-JJJ--sy|n-||sP]|tr-J-}|5pynz}5:PnzrnQvrpv|{;\b9-=;=9->;=69-@;=6H--vs-5----V_||sZnx-K-=;B-33----d|yq]|vv|{;\b-K-z|qryO|{qv{tZn\x07;\b-:-||sP]|tr-7-5z|qryO|{qv{tZn\x07;\b-:-z|qryO|{qv{tZv{;\b6--6-\n----qvpnqH--\f--<<-JJJJJJJJJJJJJJ--<<-JJJ-前置裁切计算-JJJ--0vs-[bZlPYV]]R_`-K-=----o||y-pyv}}rqH----rpA-pyv}}r]|vv|{H----0}ntzn-{|yyly||}ln----s|-5-v{-v-J-=H-v-I-[bZlPYV]]R_`H-v-88-6-\n------pyv}}r]|vv|{-J-pyv}}rh-v-j;znv\x07V{rr-7-d|yq]|vv|{H------pyv}}rq-J-5pyv}}rh-v-j;sy||V{qr\x07-I-=;=-\v\v-no5sy||-:-pyv}}rh-v-j;sy||V{qr\x076-I->;=6H------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\x07-K-:=;B-33-pyv}}r]|vv|{;\x07-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\b-K-:=;B-33-pyv}}r]|vv|{;\b-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{; -K-:=;B-33-pyv}}r]|vv|{; -I-=;BH------vs-5pyv}}rq6-\n--------qvpnqH------\f----\f----0}ntzn-{|yyly||}lr{q--0r{qvs--<<-JJJJJJJJJJJJJJJJJJ--0v{pyqr-Ipyv}}v{tl}yn{rlsntzr{K--rpA-qvssrP|y|-J-rpA5-qvssr9-|}npv\b-6H--<<-JJJ-高度色-JJJ--0vs-qrsv{rq5b`RlP\\Y\\_lNYaVabQR6----qvssrP|y|;to-J-trP|y|O\bUrvtu5tnqvr{ar\x07r9-d|yq]|vv|{6H--0r{qvs--<<-JJJJJJJJJJJ--<<-JJJ-纯色-JJJ--0vs-qrsv{rq5b`RlP\\Y\\_lP\\[`aN[a6----qvssrP|y|;to-J-p|{n{P|y|H--0r{qvs--<<-JJJJJJJJJJJ--0v{pyqr-Iy|tqr}uoslsntzr{K--0v{pyqr-Izn}lsntzr{K--0v{pyqr-Ip|y|lsntzr{K--0v{pyqr-Iny}unzn}lsntzr{K--0v{pyqr-Iny}unrlsntzr{K--0v{pyqr-I}rpynzn}lsntzr{K--_rsyrprqYvtu-rsyrprqYvtu-J-_rsyrprqYvtu5-rp@5-=;=-69-rp@5-=;=-69-rp@5-=;=-69-rp@5-=;=-6-6H--<<-nppzynv|{-5onxrq-v{qvrp-yvtuv{t-|{y\b6--0vsqrs-b`RlYVTUaZN]----rpA-yvtuZn}ar\x07ryJ-r\x07r?Q5-yvtuZn}9-b?-6H----rsyrprqYvtu;v{qvrpQvssr-8J-yvtuZn}ar\x07rya|Yv{rn5-yvtuZn}ar\x07ry-6;to-7-yvtuZn}V{r{v\bH--0ryr----rsyrprqYvtu;v{qvrpQvssr-8J-rp@5->;=-6H--0r{qvs--<<-z|qynv|{--0v{pyqr-In|zn}lsntzr{K--rsyrprqYvtu;v{qvrpQvssr-7J-qvssrP|y|;toH--rp@-|t|v{tYvtu-J-rsyrprqYvtu;v{qvrpQvssrH--0v{pyqr-Ir{zn}lsntzr{K--tylSntP|y|-J-rpA5-|t|v{tYvtu9-qvssrP|y|;n-6H--<<-JJJ-楼层显示-JJJ--sy|n-sy||\\}npv\b-J->;=H--vs-5u|{Sy||V{qr\x07-K-:=;=>-33-no5sy||-:-u|{Sy||V{qr\x076-K-=;FF6-\n----sy||\\}npv\b-J-=;?-7-zv{55>;=-8-PnzrnQvrpv|{;\b69->;=6H--\f--tylSntP|y|;n-J-tylSntP|y|;n-7-sy||\\}npv\b-7-ovtu{rH--<<-JJJJJJJJJJJJJJ--ZNV[lZ\\QRYlP\\Y\\_--<<色调映射-色彩空间转换--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{K--<<-JJJ-颜色增益调整-JJJ--rp@-toP|y|-J-tylSntP|y|;toH--rp@-uP|y|-J-to?u5toP|y|6H--uP|y|;\b-8J-p|y|`nnv|{H--uP|y|; -8J-p|y|Ovtu{rH--tylSntP|y|;to-J-u?to5uP|y|6H--<<-JJJ-全景图-JJJ--rp@-}n{|=a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|=lznv\x07h@j;\x07\b 6H--}n{|=a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|=a|crr\x079-}n{|=l ||z6H--}n{|=a|crr\x07-J-}n{|=a|crr\x07-7-zn@5}n{|=lznv\x076H--rp@-}n{|>a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|>lznv\x07h@j;\x07\b 6H--}n{|>a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|>a|crr\x079-}n{|>l ||z6H--}n{|>a|crr\x07-J-}n{|>a|crr\x07-7-zn@5}n{|>lznv\x076H--rpA-}n{|P|y|H--rpA-}n{|=P|y|-J-r\x07rPor5}n{|=lzn}9-}n{|=a|crr\x076H--rpA-}n{|>P|y|-J-r\x07rPor5}n{|>lzn}9-}n{|>a|crr\x076H--0vs-qrsv{rq5b`RlYbZV[N[PR6----}n{|=P|y|;n-J->;=-:-r\x07rPor5}n{|=lyzv{n{prZn}9-}n{|=a|crr\x076;H----}n{|>P|y|;n-J->;=-:-r\x07rPor5}n{|>lyzv{n{prZn}9-}n{|>a|crr\x076;H--0r{qvs--0vs-qrsv{rq5b`RlOYNPXla_N[`VaV\\[6----sy|n-oynpx]|tr-J-np|5:?;=-7-}|tr-8->;=6H----}n{|P|y|-J-zv\x075}n{|=P|y|9-OYNPXlP\\Y\\_9-zv{5>;=9-oynpx]|tr66H----}n{|P|y|-J-zv\x075}n{|P|y|9-}n{|>P|y|9-zn\x075=;=9-oynpx]|tr-:-]V-8->;=66H--0ryvs-qrsv{rq5b`Rl`]_RNQla_N[`VaV\\[6----rp?-prr{Pr{rP||q-J-r|yv|{-7-}v\x07ry_nv|-<-?;=H----sy|n-n{vv|{_nqv-J-qvn{pr5rp?5=;=9-=;=69-prr{Pr{rP||q6-7->;?H----sy|n-n{vv|{]|tr-J-qvn{pr5tylSntP||q;\x07\b9-prr{Pr{rP||q6-<-n{vv|{_nqvH----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-z||ur}5=;=9-=;?9-}|tr-:-n{vv|{]|tr66H--0ryr----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-}|tr6H--0r{qvs--tylSntP|y|-J-zv\x075}n{|P|y|9-tylSntP|y|9-z|qryNy}un6H--<<-JJJJJJJJJJJJJ--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0v{pyqr-Iqvurv{tlsntzr{K--0vs-qrsv{rq5b`RlRQY6----tylSntP|y|;n-J-Y|tQr}uH--0r{qvs--ZNV[lR[Q\f"),md=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-]U\\[T0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvs0vs-qrsv{rq5b`RlcR_aRelZN_X6--nvor-sy|n-znxH0r{qvsn\bv{t-sy|n-V_||sZnxHn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{Hn\bv{t-rp@-cvr]|vv|{H0vs{qrs-SYNal`UNQRQ--n\bv{t-rp@-[|znyH0r{qvs0v{pyqr-Ip|zz|{K0v{pyqr-Il}nlrr\x07K0v{pyqr-I?l}nlrr\x07K0v{pyqr-Iqv}ynprzr{zn}l}nlrr\x07K0v{pyqr-Ir{zn}l}nlrr\x07K0v{pyqr-Ip|y|l}nlrr\x07K0v{pyqr-Is|tl}nlrr\x07K0v{pyqr-Iz|}untrl}nlrr\x07K0v{pyqr-Ixv{{v{tl}nlrr\x07K0v{pyqr-Iunq|zn}l}nlrr\x07K0v{pyqr-Iy|tqr}uosl}nlrr\x07K0v{pyqr-Ipyv}}v{tl}yn{rl}nlrr\x07KZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--0v{pyqr-Ilrr\x07K--0v{pyqr-I?lrr\x07K--0v{pyqr-Ip|y|lrr\x07K--0v{pyqr-Iortv{{|znylrr\x07K--0v{pyqr-Iz|}u{|znylrr\x07K--0v{pyqr-Ixv{onrlrr\x07K--0v{pyqr-Ixv{{|znylrr\x07K--0v{pyqr-Iqrsny{|znylrr\x07K0vs{qrs-SYNal`UNQRQ-<<-[|zny-p|z}rq-vu-qrvnvr-ur{-SYNal`UNQRQ--[|zny-J-{|znyv r5-n{s|zrq[|zny-6H0r{qvs--0v{pyqr-Iortv{lrr\x07K--0v{pyqr-Iz|}untrlrr\x07K--0v{pyqr-Ixv{{v{tlrr\x07K--0v{pyqr-Iqv}ynprzr{zn}lrr\x07K--0v{pyqr-I}|wrplrr\x07K--0v{pyqr-Iy|tqr}uoslrr\x07K--0v{pyqr-Ipyv}}v{tl}yn{rlrr\x07K--cvr]|vv|{-J-:-z]|vv|{;\x07\b H--d|yq]|vv|{-J-rpA5n{s|zrq9->;=6H--0vsqrs-b`RlV[`aN[PV[T----d|yq]|vv|{-J-v{n{prZnv\x07-7-d|yq]|vv|{H--0r{qvs--d|yq]|vv|{-J-z|qryZnv\x07-7-d|yq]|vv|{H--zn@-pnzrn_|nv|{Znv\x07-J-zn@5vrZnv\x07h=jh=j9-vrZnv\x07h>jh=j9-vrZnv\x07h?jh=j9-vrZnv\x07h=jh>j9-vrZnv\x07h>jh>j9-vrZnv\x07h?jh>j9-vrZnv\x07h=jh?j9-vrZnv\x07h>jh?j9-vrZnv\x07h?jh?j6H--PnzrnQvrpv|{-J-{|znyv r5pnzrn_|nv|{Znv\x07-7-rp@5=;=9-=;=9-:>;=66H--0vs-qrsv{rq5b`RlRQY6----Y|tQr}u-J-y|t?5:z]|vv|{; 6H--0r{qvs--V_||sZnx-J-=;=H--0vs-qrsv{rq5b`RlcR_aRelZN_X6----V_||sZnx-J-r}5no5znx-:->;=69-=;>6H--0r{qvs--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Ir{zn}lrr\x07K--0v{pyqr-Iunq|zn}lrr\x07K--0v{pyqr-Is|tlrr\x07K--ZNV[lR[Q\f"),Ad=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.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r69-\0;\x076H\frp@-u?to5rp@-p6-\n----rpA-X-J-rpA5>;=9-?;=-<-@;=9->;=-<-@;=9-@;=6H----rp@-}-J-no5snp5p;\x07\x07\x07-8-X;\x07\b 6-7-C;=-:-X;6H----r{-p; -7-zv\x075X;\x07\x07\x079-pynz}5}-:-X;\x07\x07\x079-=;=9->;=69-p;\b6H\frp@-trP|y|O\bUrvtu5nz}yr?Q-tnqvr{ar\x07r9-rpA-d|yq]|vv|{6-\n--sy|n--J-5d|yq]|vv|{;\b-:-z|qryO|{qv{tZv{;\b6-<-5z|qryO|{qv{tZn\x07;\b-:-z|qryO|{qv{tZv{;\b6H--r{-r\x07r?Q5tnqvr{ar\x07r9-rp?59-=;B66;toH\fZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--<<-JJJ-顶部裁切-JJJ--sy|n-||sP]|tr-J-}|5pynz}5:PnzrnQvrpv|{;\b9-=;=9->;=69-@;=6H--vs-5----V_||sZnx-K-=;B-33----d|yq]|vv|{;\b-K-z|qryO|{qv{tZn\x07;\b-:-||sP]|tr-7-5z|qryO|{qv{tZn\x07;\b-:-z|qryO|{qv{tZv{;\b6--6-\n----qvpnqH--\f--<<-JJJJJJJJJJJJJJ--<<-JJJ-前置裁切计算-JJJ--0vs-[bZlPYV]]R_`-K-=----o||y-pyv}}rqH----rpA-pyv}}r]|vv|{H----0}ntzn-{|yyly||}ln----s|-5-v{-v-J-=H-v-I-[bZlPYV]]R_`H-v-88-6-\n------pyv}}r]|vv|{-J-pyv}}rh-v-j;znv\x07V{rr-7-d|yq]|vv|{H------pyv}}rq-J-5pyv}}rh-v-j;sy||V{qr\x07-I-=;=-\v\v-no5sy||-:-pyv}}rh-v-j;sy||V{qr\x076-I->;=6H------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\x07-K-:=;B-33-pyv}}r]|vv|{;\x07-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\b-K-:=;B-33-pyv}}r]|vv|{;\b-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{; -K-:=;B-33-pyv}}r]|vv|{; -I-=;BH------vs-5pyv}}rq6-\n--------qvpnqH------\f----\f----0}ntzn-{|yyly||}lr{q--0r{qvs--<<-JJJJJJJJJJJJJJJJ--0v{pyqr-Ipyv}}v{tl}yn{rlsntzr{K--rpA-qvssrP|y|-J-rpA5-qvssr9-|}npv\b-6H--<<-JJJ-高度色-JJJ--0vs-qrsv{rq5b`RlP\\Y\\_lNYaVabQR6----qvssrP|y|;to-J-trP|y|O\bUrvtu5tnqvr{ar\x07r9-d|yq]|vv|{6H--0r{qvs--<<-JJJJJJJJJJJ--<<-JJJ-纯色-JJJ--0vs-qrsv{rq5b`RlP\\Y\\_lP\\[`aN[a6----qvssrP|y|;to-J-p|{n{P|y|H--0r{qvs--<<-JJJJJJJJJJJ--_rsyrprqYvtu-rsyrprqYvtu-J-_rsyrprqYvtu5-rp@5-=;=-69-rp@5-=;=-69-rp@5-=;=-69-rp@5-=;=-6-6H--rp@-|nyRzvvr_nqvn{pr-J-rzvvrH--0v{pyqr-Iy|tqr}uoslsntzr{K--0v{pyqr-Izn}lsntzr{K--0v{pyqr-Ip|y|lsntzr{K--0v{pyqr-Iny}unzn}lsntzr{K--0v{pyqr-Iny}unrlsntzr{K--0v{pyqr-I}rpynzn}lsntzr{K--0v{pyqr-I{|znylsntzr{lortv{K--0v{pyqr-I{|znylsntzr{lzn}K--0v{pyqr-Irzvvrzn}lsntzr{K--<<-nppzynv|{--0v{pyqr-Iyvtul}u|{tlsntzr{K--0v{pyqr-Iyvtulsntzr{lortv{K--0v{pyqr-Iyvtulsntzr{lzn}K--0v{pyqr-Iyvtulsntzr{lr{qK--<<-z|qynv|{--0v{pyqr-In|zn}lsntzr{K--rp@-|t|v{tYvtu-J-rsyrprqYvtu;qvrpQvssr-8-rsyrprqYvtu;v{qvrpQvssr-8-rsyrprqYvtu;qvrp`}rpyn-8-rsyrprqYvtu;v{qvrp`}rpyn-8-|nyRzvvr_nqvn{prH--0v{pyqr-Ir{zn}lsntzr{K--tylSntP|y|-J-rpA5-|t|v{tYvtu9-qvssrP|y|;n-6H--<<-JJJ-楼层显示-JJJ--sy|n-sy||\\}npv\b-J->;=H--vs-5u|{Sy||V{qr\x07-K-:=;=>-33-no5sy||-:-u|{Sy||V{qr\x076-K-=;FF6-\n----sy||\\}npv\b-J-=;?-7-zv{55>;=-8-PnzrnQvrpv|{;\b69->;=6H--\f--tylSntP|y|;n-J-tylSntP|y|;n-7-sy||\\}npv\b-7-ovtu{rH--<<-JJJJJJJJJJJJJJ--ZNV[lZ\\QRYlP\\Y\\_--<<色调映射-色彩空间转换--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{K--<<-JJJ-颜色增益调整-JJJ--rp@-toP|y|-J-tylSntP|y|;toH--rp@-uP|y|-J-to?u5toP|y|6H--uP|y|;\b-8J-p|y|`nnv|{H--uP|y|; -8J-p|y|Ovtu{rH--tylSntP|y|;to-J-u?to5uP|y|6H--<<-JJJ-全景图-JJJ--rp@-}n{|=a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|=lznv\x07h@j;\x07\b 6H--}n{|=a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|=a|crr\x079-}n{|=l ||z6H--}n{|=a|crr\x07-J-}n{|=a|crr\x07-7-zn@5}n{|=lznv\x076H--rp@-}n{|>a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|>lznv\x07h@j;\x07\b 6H--}n{|>a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|>a|crr\x079-}n{|>l ||z6H--}n{|>a|crr\x07-J-}n{|>a|crr\x07-7-zn@5}n{|>lznv\x076H--rpA-}n{|P|y|H--rpA-}n{|=P|y|-J-r\x07rPor5}n{|=lzn}9-}n{|=a|crr\x076H--rpA-}n{|>P|y|-J-r\x07rPor5}n{|>lzn}9-}n{|>a|crr\x076H--0vs-qrsv{rq5b`RlYbZV[N[PR6----}n{|=P|y|;n-J->;=-:-r\x07rPor5}n{|=lyzv{n{prZn}9-}n{|=a|crr\x076;H----}n{|>P|y|;n-J->;=-:-r\x07rPor5}n{|>lyzv{n{prZn}9-}n{|>a|crr\x076;H--0r{qvs--0vs-qrsv{rq5b`RlOYNPXla_N[`VaV\\[6----sy|n-oynpx]|tr-J-np|5:?;=-7-}|tr-8->;=6H----}n{|P|y|-J-zv\x075}n{|=P|y|9-OYNPXlP\\Y\\_9-zv{5>;=9-oynpx]|tr66H----}n{|P|y|-J-zv\x075}n{|P|y|9-}n{|>P|y|9-zn\x075=;=9-oynpx]|tr-:-]V-8->;=66H--0ryvs-qrsv{rq5b`Rl`]_RNQla_N[`VaV\\[6----rp?-prr{Pr{rP||q-J-r|yv|{-7-}v\x07ry_nv|-<-?;=H----sy|n-n{vv|{_nqv-J-qvn{pr5rp?5=;=9-=;=69-prr{Pr{rP||q6-7->;?H----sy|n-n{vv|{]|tr-J-qvn{pr5tylSntP||q;\x07\b9-prr{Pr{rP||q6-<-n{vv|{_nqvH----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-z||ur}5=;=9-=;?9-}|tr-:-n{vv|{]|tr66H--0ryr----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-}|tr6H--0r{qvs--tylSntP|y|-J-zv\x075}n{|P|y|9-tylSntP|y|9-z|qryNy}un6H--<<-JJJJJJJJJJJJJJ--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0v{pyqr-Iqvurv{tlsntzr{K--0vs-qrsv{rq5b`RlRQY6----tylSntP|y|;n-J-Y|tQr}uH--0r{qvs--ZNV[lR[Q\f");var Fa={modelAlpha:new f.Uniform(0),progress:new f.Uniform(0),pano0_map:new f.Uniform(null),pano0_luminanceMap:new f.Uniform(null),pano0_matrix:new f.Uniform(new f.Matrix4),pano0_zoom:new f.Uniform(1),pano1_map:new f.Uniform(null),pano1_luminanceMap:new f.Uniform(null),pano1_matrix:new f.Uniform(new f.Matrix4),pano1_zoom:new f.Uniform(1),gradientTexture:new f.Uniform(null),clippers:new f.Uniform([]),shownFloorIndex:new f.Uniform(-1),constantColor:new f.Uniform(new f.Vector3),geometricError:new f.Uniform(0),pixelRatio:new f.Uniform(1),resolution:new f.Uniform(new f.Vector2(512,512)),floor:new f.Uniform(0),brightness:new f.Uniform(1),modelBoundingMin:new f.Uniform(new f.Vector3),modelBoundingMax:new f.Uniform(new f.Vector3),colorSaturation:new f.Uniform(0),colorBrightness:new f.Uniform(0)},gd={none:{vertexShader:dd,fragmentShader:hd,uniforms:f.UniformsUtils.merge([Fa,{opacity:{value:1}},f.UniformsLib.fog]),lights:!1,clipping:!1},basic:{vertexShader:pd,fragmentShader:vd,uniforms:f.UniformsUtils.merge([Fa,f.ShaderLib.basic.uniforms]),lights:!1,clipping:!0},phong:{vertexShader:md,fragmentShader:Ad,uniforms:f.UniformsUtils.merge([Fa,f.ShaderLib.phong.uniforms]),lights:!0,clipping:!0}},br=function(n){ue(t,n);function t(e,r){e===void 0&&(e="basic"),r===void 0&&(r={});var i=this,a,o,s,u,l,c,d,p,A,h,v,g,m,y,b,x,w,M,S,E,P,B,C,I,F,T=gd[e];i=n.call(this,{vertexShader:T.vertexShader,fragmentShader:T.fragmentShader,uniforms:f.UniformsUtils.clone(T.uniforms),lights:T.lights,clipping:T.clipping,defines:{USE_COLOR_CONSTANT:!1,USE_COLOR_ALTITUDE:!1,USE_EDL:!1,USE_HQ_WEIGHT:!1,USE_HQ_DEPTH:!1,NUM_CLIPPING_BOX:!1,USE_CLIPFLOOR:!1,USE_VERTEX_MARK:!1,USE_LUMINANCE:!1,USE_BLACK_TRANSITION:!1,USE_SPREAD_TRANSITION:!1,USE_POINT_NORMAL:!1,USE_POINT_CIRCLE:!1,USE_POINT_ADAPTIVE_SIZE:!1,USE_POINT_COLOR_ALTITUDE:!1}})||this,i.shaderType=e,i.color=new f.Color(16777215),i.map=null,i.lightMap=null,i.lightMapIntensity=1,i.aoMap=null,i.aoMapIntensity=1,i.specularMap=null,i.specular=new f.Color(1118481),i.alphaMap=null,i.envMap=null,i.reflectivity=1,i.refractionRatio=.98,i.emissiveMap=null,i.emissive=new f.Color(0),i.emissiveIntensity=1,i.bumpMap=null,i.bumpScale=1,i.normalMap=null,i.normalMapType=f.TangentSpaceNormalMap,i.normalScale=new f.Vector2(1,1),i.displacementMap=null,i.displacementScale=1,i.displacementBias=0,i.shininess=30;var L,D=null,V=null;return Object.defineProperties(i,{pano0:{get:function(){return D},set:function(z){if(D!==z){D=z,z===null?(this.uniforms.pano0_map.value=null,this.uniforms.pano0_luminanceMap.value=null,this.uniforms.pano0_matrix.value.identity(),this.uniforms.pano0_zoom.value=1):(this.uniforms.pano0_map.value=z.map instanceof qe?z.map.texture:z.map,this.uniforms.pano0_luminanceMap.value=z.luminanceMap instanceof qe?z.luminanceMap.texture:z.luminanceMap,this.uniforms.pano0_matrix.value.copy(z.matrix),this.uniforms.pano0_zoom.value=z.zoom);var U=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,q=this.defines.USE_LUMINANCE;q!==U&&(this.defines.USE_LUMINANCE=U,this.needsUpdate=!0)}}},pano1:{get:function(){return V},set:function(z){if(V!==z){V=z,z===null?(this.uniforms.pano1_map.value=null,this.uniforms.pano1_luminanceMap.value=null,this.uniforms.pano1_matrix.value.identity(),this.uniforms.pano1_zoom.value=1):(this.uniforms.pano1_map.value=z.map instanceof qe?z.map.texture:z.map,this.uniforms.pano1_luminanceMap.value=z.luminanceMap instanceof qe?z.luminanceMap.texture:z.luminanceMap,this.uniforms.pano1_matrix.value.copy(z.matrix),this.uniforms.pano1_zoom.value=z.zoom);var U=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,q=this.defines.USE_LUMINANCE;q!==U&&(this.defines.USE_LUMINANCE=U,this.needsUpdate=!0)}}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(z){this.uniforms.modelAlpha.value=z}},progress:{get:function(){return this.uniforms.progress.value},set:function(z){this.uniforms.progress.value=z}},transition:{get:function(){return this.defines.USE_BLACK_TRANSITION?"BLACK":this.defines.USE_SPREAD_TRANSITION?"SPREAD":"FADE"},set:function(z){var U=this.defines.USE_BLACK_TRANSITION,q=this.defines.USE_SPREAD_TRANSITION;this.defines.USE_BLACK_TRANSITION=!1,this.defines.USE_SPREAD_TRANSITION=!1,this.defines["USE_".concat(z,"_TRANSITION")]=!0;var G=!1;U!==this.defines.USE_BLACK_TRANSITION&&(G=!0),q!==this.defines.USE_SPREAD_TRANSITION&&(G=!0),G&&(this.needsUpdate=!0)}},colorStyle:{get:function(){return this.defines.USE_COLOR_CONSTANT?"CONSTANT":this.defines.USE_COLOR_ALTITUDE?"ALTITUDE":"RGB"},set:function(z){var U=z==="CONSTANT",q=z==="ALTITUDE";this.defines.USE_COLOR_CONSTANT!==U&&(this.defines.USE_COLOR_CONSTANT=U,this.needsUpdate=!0),this.defines.USE_COLOR_ALTITUDE!==q&&(this.defines.USE_COLOR_ALTITUDE=q,this.needsUpdate=!0)}},constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(z){this.uniforms.constantColor.value=z}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(z){this.uniforms.opacity.value=z}},shownFloorIndex:{get:function(){return this.uniforms.shownFloorIndex.value},set:function(z){this.uniforms.shownFloorIndex.value=z}},gradientTexture:{get:function(){return this.uniforms.gradientTexture.value},set:function(z){this.uniforms.gradientTexture.value=z}},brightness:{get:function(){return this.uniforms.brightness.value},set:function(z){this.uniforms.brightness.value=z}},clippers:{get:function(){return L},set:function(z){L!==z&&(L=z,this.uniforms.clippers.value=(L||[]).map(function(U){var q=typeof U.floorIndex=="number"?U.floorIndex:-1,G=new f.Matrix4().getInverse(U.clippingBoxMatrix);return{matrixInverse:G,floorIndex:q}}),this.needsUpdate=!0)}},useEDL:{get:function(){return this.defines.USE_EDL},set:function(z){z!==this.defines.USE_EDL&&(this.defines.USE_EDL=z,this.needsUpdate=!0)}},useHQWeight:{get:function(){return this.defines.USE_HQ_WEIGHT},set:function(z){z!==this.defines.USE_HQ_WEIGHT&&(this.defines.USE_HQ_WEIGHT=z,this.needsUpdate=!0)}},useHQDepth:{get:function(){return this.defines.USE_HQ_DEPTH},set:function(z){z!==this.defines.USE_HQ_DEPTH&&(this.defines.USE_HQ_DEPTH=z,this.needsUpdate=!0)}},floor:{get:function(){return this.uniforms.floor.value},set:function(z){this.uniforms.floor.value=z}},colorSaturation:{get:function(){return this.uniforms.colorSaturation.value},set:function(z){this.uniforms.colorSaturation.value=z}},colorBrightness:{get:function(){return this.uniforms.colorBrightness.value},set:function(z){this.uniforms.colorBrightness.value=z}}}),i.pano0=(a=r.pano0)!==null&&a!==void 0?a:ge.pano0,i.pano1=(o=r.pano1)!==null&&o!==void 0?o:ge.pano1,i.modelAlpha=(s=r.modelAlpha)!==null&&s!==void 0?s:ge.modelAlpha,i.progress=(u=r.progress)!==null&&u!==void 0?u:ge.progress,i.transition=(l=r.transition)!==null&&l!==void 0?l:ge.transition,i.constantColor=(c=r.constantColor)!==null&&c!==void 0?c:ge.constantColor,i.opacity=(d=r.opacity)!==null&&d!==void 0?d:ge.opacity,i.floorStyle=(p=r.floorStyle)!==null&&p!==void 0?p:ge.floorStyle,i.shownFloorIndex=(A=r.shownFloorIndex)!==null&&A!==void 0?A:ge.shownFloorIndex,i.clippers=(h=r.clippers)!==null&&h!==void 0?h:ge.clippers,i.useEDL=(v=r.useEDL)!==null&&v!==void 0?v:ge.useEDL,i.useHQWeight=(g=r.useHQWeight)!==null&&g!==void 0?g:ge.useHQWeight,i.useHQDepth=(m=r.useHQDepth)!==null&&m!==void 0?m:ge.useHQDepth,i.pointSize=(y=r.pointSize)!==null&&y!==void 0?y:ge.pointSize,i.colorStyle=(b=r.colorStyle)!==null&&b!==void 0?b:ge.colorStyle,i.pointShape=(x=r.pointShape)!==null&&x!==void 0?x:ge.pointShape,i.pointScale=(w=r.pointScale)!==null&&w!==void 0?w:ge.pointScale,i.pointBack=(M=r.pointBack)!==null&&M!==void 0?M:ge.pointBack,i.pointMinPixel=(S=r.pointMinPixel)!==null&&S!==void 0?S:ge.pointMinPixel,i.pointMaxPixel=(E=r.pointMaxPixel)!==null&&E!==void 0?E:ge.pointMaxPixel,i.gradientTexture=(P=r.gradientTexture)!==null&&P!==void 0?P:ge.gradientTexture,i.brightness=(B=r.brightness)!==null&&B!==void 0?B:ge.brightness,i.colorSaturation=(C=r.colorSaturation)!==null&&C!==void 0?C:ge.colorSaturation,i.colorBrightness=(I=r.colorBrightness)!==null&&I!==void 0?I:ge.colorBrightness,i.customShaders=(F=r.customShaders)!==null&&F!==void 0?F:ge.customShaders,i.customShaderHash="",i.customShaderUniforms={},i.customShaderDefines={},i.floor=0,i.transparent=!1,i}return t.prototype.onBeforeCompile=function(e,r){var i=this,a,o,s=this.customShaders.filter(function(g){return g.type.includes(i.shaderType)}),u=s.reduce(function(g,m){return g+m.vertex.mainBefore},""),l=s.reduce(function(g,m){return g+m.vertex.mainStart},""),c=s.reduce(function(g,m){return g+m.vertex.mainEnd},""),d=s.reduce(function(g,m){return g+m.fragment.mainBefore},""),p=s.reduce(function(g,m){return g+m.fragment.mainStart},""),A=s.reduce(function(g,m){return g+m.fragment.mainModelColor},""),h=s.reduce(function(g,m){return g+m.fragment.mainEnd},"");e.vertexShader=e.vertexShader.replace(/MAIN_BEFORE/g,u),e.fragmentShader=e.fragmentShader.replace(/MAIN_BEFORE/g,d),e.vertexShader=e.vertexShader.replace(/MAIN_START/g,l),e.fragmentShader=e.fragmentShader.replace(/MAIN_START/g,p),e.vertexShader=e.vertexShader.replace(/MAIN_END/g,c),e.fragmentShader=e.fragmentShader.replace(/MAIN_END/g,h),e.fragmentShader=e.fragmentShader.replace(/MAIN_MODEL_COLOR/g,A);var v=String((o=(a=this.clippers)===null||a===void 0?void 0:a.length)!==null&&o!==void 0?o:0);e.vertexShader=e.vertexShader.replace(/NUM_CLIPPERS/g,v),e.fragmentShader=e.fragmentShader.replace(/NUM_CLIPPERS/g,v),s.forEach(function(g){g.onBeforeCompile(e,r)})},t.prototype.refreshUniforms=function(e){var r,i,a=this.uniforms;a.diffuse&&a.diffuse.value.copy(this.color),a.opacity&&(a.opacity.value=this.opacity),a.color&&a.diffuse.value.copy(this.color),a.emissive&&a.emissive.value.copy(this.emissive).multiplyScalar(this.emissiveIntensity),a.map&&(a.map.value=this.map),a.alphaMap&&(a.alphaMap.value=this.alphaMap),a.specularMap&&(a.specularMap.value=this.specularMap),a.envMap&&(a.envMap.value=this.envMap,a.flipEnvMap.value=!((r=this.envMap)===null||r===void 0)&&r.isCubeTexture?-1:1,a.reflectivity.value=this.reflectivity,a.refractionRatio.value=this.refractionRatio,a.maxMipLevel.value=this.envMap&&(i=e==null?void 0:e.properties.get(this.envMap).__maxMipLevel)!==null&&i!==void 0?i:0),a.lightMap&&(a.lightMap.value=this.lightMap,a.lightMapIntensity.value=this.lightMapIntensity),a.aoMap&&(a.aoMap.value=this.aoMap,a.aoMapIntensity.value=this.aoMapIntensity),a.specular&&a.specular.value.copy(this.specular),a.shininess&&(a.shininess.value=Math.max(this.shininess,1e-4)),a.emissiveMap&&(a.emissiveMap.value=this.emissiveMap),a.bumpMap&&(a.bumpMap.value=this.bumpMap,a.bumpScale.value=this.bumpScale,this.side===f.BackSide&&(a.bumpScale.value*=-1)),a.normalMap&&(a.normalMap.value=this.normalMap,a.normalScale.value.copy(this.normalScale),this.side===f.BackSide&&a.normalScale.value.negate()),a.displacementMap&&(a.displacementMap.value=this.displacementMap,a.displacementScale.value=this.displacementScale,a.displacementBias.value=this.displacementBias);var o;this.map?o=this.map:this.specularMap?o=this.specularMap:this.displacementMap?o=this.displacementMap:this.normalMap?o=this.normalMap:this.bumpMap?o=this.bumpMap:this.alphaMap?o=this.alphaMap:this.emissiveMap&&(o=this.emissiveMap),o!==void 0&&(o.matrixAutoUpdate===!0&&o.updateMatrix(),a.uvTransform.value.copy(o.matrix));var s;this.aoMap?s=this.aoMap:this.lightMap&&(s=this.lightMap),s!==void 0&&(s.matrixAutoUpdate===!0&&s.updateMatrix(),a.uv2Transform.value.copy(s.matrix))},t.prototype.update=function(e,r,i){var a="".concat(i.id,":").concat(i.materialVersion);a!==this.syncModelVersion&&(Object.assign(this,i.getMaterial()),this.syncModelVersion=a);var o=this.customShaders.map(function(m){return m.getHash()}).join("");this.customShaderHash!==o&&(this.customShaderHash=o,this.needsUpdate=!0);for(var s=this.customShaders.reduce(function(m,y){return Object.assign(m,y.defines)},{}),u=Object.keys(this.customShaderDefines),l=0,c=u;l<c.length;l++){var d=c[l];delete this.defines[d]}this.customShaderDefines=s,Object.assign(this.defines,this.customShaderDefines);for(var p=this.customShaders.reduce(function(m,y){return Object.assign(m,y.uniforms)},{}),A=Object.keys(this.customShaderUniforms),h=0,v=A;h<v.length;h++){var g=v[h];delete this.uniforms[g]}this.customShaderUniforms=p,Object.assign(this.uniforms,this.customShaderUniforms),this.visible=!0,this.refreshUniforms(e),this.shaderType==="none"?(this.depthWrite=!1,this.transparent=!0):(this.transparent=!1,this.depthWrite=!0,this.shownFloorIndex>-1&&(this.transparent=this.shownFloorIndex!==this.floor),this.opacity<1&&(this.transparent=!0),this.alphaMap&&(this.transparent=!0),this.brightness<1&&(this.transparent=!0),this.transparent&&(this.depthWrite=!1),this.floorStyle==="VISIBILITY"&&this.shownFloorIndex!==-1&&this.floor!==this.shownFloorIndex&&(this.visible=!1)),this.uniforms.pixelRatio.value=r.pixelRatio,this.uniforms.resolution.value.copy(r.resolution),this.uniforms.modelBoundingMax.value.copy(i.bounding.max),this.uniforms.modelBoundingMin.value.copy(i.bounding.min)},t.prototype.copy=function(e){return n.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.specular.copy(e.specular),this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.emissiveMap=e.emissiveMap,this.emissive.copy(e.emissive),this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.shininess=e.shininess,this.customShaders=e.customShaders,this.pano0=e.pano0,this.pano1=e.pano1,this.modelAlpha=e.modelAlpha,this.progress=e.progress,this.transition=e.transition,this.opacity=e.opacity,this.floorStyle=e.floorStyle,this.colorStyle=e.colorStyle,this.constantColor=e.constantColor,this.shownFloorIndex=e.shownFloorIndex,this.brightness=e.brightness,this.clippers=e.clippers,this.useEDL=e.useEDL,this.useHQWeight=e.useHQWeight,this.useHQDepth=e.useHQDepth,this.pointSize=e.pointSize,this.pointShape=e.pointShape,this.pointScale=e.pointScale,this.pointBack=e.pointBack,this.pointMinPixel=e.pointMinPixel,this.pointMaxPixel=e.pointMaxPixel,this.gradientTexture=e.gradientTexture,this.floor=e.floor,this.colorSaturation=e.colorSaturation,this.colorBrightness=e.colorBrightness,this.refreshUniforms(),this},t.prototype.clone=function(){return new this.constructor(this.shaderType).copy(this)},t}(f.ShaderMaterial);const yd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("{vs|z-sy|n-sy||H0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6--n\bv{t-rp@-[|znyH0r{qvs0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvsp-Pyv}}r-\n--znA-znv\x07V{rrH--sy|n-sy||V{qr\x07H\fH0vs-[bZlPYV]]R_`-K-=--{vs|z-Pyv}}r-pyv}}rh[bZlPYV]]R_`jH0r{qvsn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{Hn\bv{t-rp@-P|y|Hn\bv{t-sy|n-]|v{`v rH{vs|z-sy|n-|}npv\bH{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-u|{Sy||V{qr\x07H<<u调整{vs|z-sy|n-p|y|`nnv|{H{vs|z-sy|n-p|y|Ovtu{rH0v{pyqr-Ip|zz|{K0v{pyqr-Is|tl}nlsntzr{K0v{pyqr-Iy|tqr}uosl}nlsntzr{K0v{pyqr-Ipyv}}v{tl}yn{rl}nlsntzr{Krp@-nqwP|y|arz}rnr5rp@-p|y|9-sy|n-rz}rnr6\n----<<-将色温范围从-:>;=-到->;=-映射到实际的色温范围----sy|n-rz}-J-5rz}rnr-8->;=6-7-B===;=H-<<-范围从-=-到->====----<<-计算色温系数----sy|n-lsnp|9-tlsnp|9-olsnp|H----vs-5rz}-IJ-CC==;=6-\n--------lsnp|-J->;=H--------tlsnp|-J-=;@F==E>BDEDCF=>FC=DEA-7-y|t5rz}-<->==;=6-:-=;C@>EA>AA@DEEC?DAB=FEH--------olsnp|-J-rz}-IJ->F==;=-L-=;=-G-=;BA@?=CDEF>>=>FC=DEA@-7-y|t5rz}-<->==;=-:->=;=6-:->;>FC?BA=EF>AH----\f-ryr-\n--------lsnp|-J->;?F?F@C>EC=C?DAB=FE=A-7-}|5rz}-<->==;=-:-C=;=9-:=;>@@?=ADBF?6H--------tlsnp|-J->;>?FEF=EC=EFB?FA>>DCB-7-}|5rz}-<->==;=-:-C=;=9-:=;=DBB>AEAF?6H--------olsnp|-J->;=H----\f----<<-调整颜色----rp@-nqwrqP|y|H----nqwrqP|y|;-J-pynz}5p|y|;-7-lsnp|9-=;=9->;=6H----nqwrqP|y|;t-J-pynz}5p|y|;t-7-tlsnp|9-=;=9->;=6H----nqwrqP|y|;o-J-pynz}5p|y|;o-7-olsnp|9-=;=9->;=6H----r{-nqwrqP|y|H\frp@-to?u5rp@-p6-\n----rpA-X-J-rpA5=;=9-:>;=-<-@;=9-?;=-<-@;=9-:>;=6H----rpA-}-J-zv\x075rpA5p;ot9-X; 69-rpA5p;to9-X;\x07\b69-r}5p;o9-p;t66H----rpA-\0-J-zv\x075rpA5};\x07\b9-p;69-rpA5p;9-};\b \x0769-r}5};\x079-p;66H----sy|n-q-J-\0;\x07-:-zv{5\0;9-\0;\b6H----sy|n-r-J->;=r:>=H----r{-rp@5no5\0; -8-5\0;-:-\0;\b6-<-5C;=-7-q-8-r669-q-<-5\0;\x07-8-r69-\0;\x076H\frp@-u?to5rp@-p6-\n----rpA-X-J-rpA5>;=9-?;=-<-@;=9->;=-<-@;=9-@;=6H----rp@-}-J-no5snp5p;\x07\x07\x07-8-X;\x07\b 6-7-C;=-:-X;6H----r{-p; -7-zv\x075X;\x07\x07\x079-pynz}5}-:-X;\x07\x07\x079-=;=9->;=69-p;\b6H\fZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--<<-JJJ-点大小剔除-JJJ--vs-5]|v{`v r-I-=;==>6-\n----qvpnqH--\f--<<-JJJ-前置裁切计算-JJJ--0vs-[bZlPYV]]R_`-K-=----o||y-pyv}}rqH----rpA-pyv}}r]|vv|{H----0}ntzn-{|yyly||}ln----s|-5-v{-v-J-=H-v-I-[bZlPYV]]R_`H-v-88-6-\n------pyv}}r]|vv|{-J-pyv}}rh-v-j;znv\x07V{rr-7-d|yq]|vv|{H------pyv}}rq-J-5pyv}}rh-v-j;sy||V{qr\x07-I-=;=-\v\v-no5sy||-:-pyv}}rh-v-j;sy||V{qr\x076-I->;=6H------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\x07-K-:=;B-33-pyv}}r]|vv|{;\x07-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\b-K-:=;B-33-pyv}}r]|vv|{;\b-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{; -K-:=;B-33-pyv}}r]|vv|{; -I-=;BH------vs-5pyv}}rq6-\n--------qvpnqH------\f----\f----0}ntzn-{|yyly||}lr{q--0r{qvs--<<-JJJJJJJJJJJJJJJJ--<<-JJJ-形状裁切-JJJ--0vs-qrsv{rq5b`Rl]\\V[al`UN]RlPV_PYR6----sy|n--J-?;=-7-tyl]|v{P||q;\x07-:->;=H----sy|n--J-?;=-7-tyl]|v{P||q;\b-:->;=H----sy|n-pp-J-7-8-7H----vs-5]|v{`v r-K-@;=-33-pp-K->;=6-\n------qvpnqH----\f--0r{qvs--<<-JJJJJJJJJJJJJ--0v{pyqr-Ipyv}}v{tl}yn{rlsntzr{K--0v{pyqr-Iy|tqr}uoslsntzr{K--<<-JJJ-颜色-JJJ--rpA-sv{nyP|y|-J-_TOa|Yv{rn5rpA5P|y|9-|}npv\b66H--0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6----0vs-qrsv{rq5b`Rl]\\V[alONPXlUVQQR[6------rp@-pnzrnQvrpv|{-J-{|znyv r5pnzrn]|vv|{-:-d|yq]|vv|{;\x07\b 6H------vs-5q|5pnzrnQvrpv|{9-[|zny6-I-=;=6-\n--------qvpnqH------\f----0ryvs-qrsv{rq5b`Rl]\\V[alONPXlQN_X6------rp@-pnzrnQvrpv|{-J-{|znyv r5pnzrn]|vv|{-:-d|yq]|vv|{;\x07\b 6H------vs-5q|5pnzrnQvrpv|{9-[|zny6-I-=;=6-\n--------sv{nyP|y|;\x07\b -J-sv{nyP|y|;\x07\b -7-=;EH------\f----0r{qvs--0r{qvs--tylSntP|y|-J-sv{nyP|y|H--<<-JJJJJJJJJJJ--<<-JJJ-楼层显示-JJJ--sy|n-sy||\\}npv\b-J->;=H--vs-5u|{Sy||V{qr\x07-K-:=;=>-33-no5sy||-:-u|{Sy||V{qr\x076-K-=;FF6-\n----sy||\\}npv\b-J-=;>-7-zv{55>;=-8-PnzrnQvrpv|{;\b69->;=6H--\f--tylSntP|y|;n-J-tylSntP|y|;n-7-sy||\\}npv\bH--<<-JJJJJJJJJJJJJJ--tylSntP|y|;n-J-tylSntP|y|;n-7-z|qryNy}unH--ZNV[lZ\\QRYlP\\Y\\_--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{K--<<-JJJ-颜色增益调整-JJJ--rp@-toP|y|-J-tylSntP|y|;toH--rp@-uP|y|-J-to?u5toP|y|6H--uP|y|;\b-8J-p|y|`nnv|{H--uP|y|; -8J-p|y|Ovtu{rH--tylSntP|y|;to-J-u?to5uP|y|6H--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0vs-qrsv{rq5b`RlRQY6----tylSntP|y|;n-J-Y|tQr}uH--0r{qvs--0vs-qrsv{rq5b`RlU^ldRVTUa6----sy|n-qvn{pr-J-?;=-7-yr{tu5tyl]|v{P||q;\x07\b-:-=;B6H----sy|n-rvtu-J-zn\x075=;=9->;=-:-qvn{pr6H----rvtu-J-}|5rvtu9->;B6H----tylSntP|y|;n-J-rvtuH----tylSntP|y|;\x07\b -J-tylSntP|y|;\x07\b -7-rvtuH--0r{qvs--ZNV[lR[Q\f"),bd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("nvor-rp@-p|y|H0vs-qrsv{rq5b`RlP\\Y\\_lP\\[`aN[a6--{vs|z-rp@-p|{n{P|y|H0r{qvs0vs-qrsv{rq5b`RlP\\Y\\_lNYaVabQR6--{vs|z-nz}yr?Q-tnqvr{ar\x07rH0r{qvs0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvs{vs|z-rp?-r|yv|{H{vs|z-sy|n-}v\x07ry_nv|H{vs|z-sy|n-}|v{`pnyrH{vs|z-sy|n-}|v{Zv{]v\x07ryH{vs|z-sy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07h=jh?j9-vrZnv\x07h>jh?j9-vrZnv\x07h?jh?j6H--PnzrnQvrpv|{-J-{|znyv r5pnzrn_|nv|{Znv\x07-7-rp@5=;=9-=;=9-:>;=66H--<<传递nvor的p|y|到s里使用--<<动态调整}|v{`v r--sy|n-rny]|v{`v r-J-}|v{`pnyr-7-}v\x07ry_nv|H--0vs-qrsv{rq5b`Rl]\\V[al`VgRlTR\\ZRa_VP6----rny]|v{`v r-7J-tr|zrvpR|H----sy|n-urvtu-J->;=-<-}|wrpv|{Znv\x07h>jh>j-7-zv\x075>;=9-:z]|vv|{; 9-:}|wrpv|{Znv\x07h?jh@j6-7-?;=H----rny]|v{`v r-J-r|yv|{;\b-7-rny]|v{`v r-<-urvtuH--0ryvs-qrsv{rq5b`Rl]\\V[al`VgRlNaaR[bNaV\\[6----sy|n-urvtu-J->;=-<-}|wrpv|{Znv\x07h>jh>j-7-zv\x075>;=9-:z]|vv|{; 9-:}|wrpv|{Znv\x07h?jh@j6-7-?;=H----rny]|v{`v r-J-r|yv|{;\b-7-rny]|v{`v r-<-urvtuH--0r{qvs--tyl]|v{`v r-J-pynz}5rny]|v{`v r9-}|v{Zv{]v\x07ry-7-}v\x07ry_nv|9-}|v{Zn\x07]v\x07ry-7-}v\x07ry_nv|6H--]|v{`v r-J-tyl]|v{`v rH--P|y|-J-p|y|H--<<-JJJ-高度色-JJJ--0vs-qrsv{rq5b`RlP\\Y\\_lNYaVabQR6----P|y|-J-trP|y|O\bUrvtu5tnqvr{ar\x07r9-d|yq]|vv|{6H--0r{qvs--<<-JJJJJJJJJJJ--<<-JJJ-纯色-JJJ--0vs-qrsv{rq5b`RlP\\Y\\_lP\\[`aN[a6----P|y|-J-p|{n{P|y|H--0r{qvs--<<-JJJJJJJJJJJ--0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6----[|zny-J-{|znyv r5zn@5z|qryZnv\x076-7-{|zny6H--0r{qvs--0vs-qrsv{rq5b`RlRQY6----Y|tQr}u-J-y|t?5:z]|vv|{; 6H--0r{qvs--0vs-qrsv{rq5b`RlU^lQR]aU6----<<-sy|n-}|wSnp|-J-:=;B-7-r|yv|{;\b-<-5n{5s|-<-?;=6-7-z]|vv|{; 6H----<<-sy|n-_nqv-J-rny]|v{`v r-<-}|wSnp|H----sy|n-|vtv{nyQr}u-J-tyl]|vv|{;H----sy|n-nqwrqQr}u-J-|vtv{nyQr}u-8-=;>H----sy|n-nqw-J-nqwrqQr}u-<-|vtv{nyQr}uH----z]|vv|{;\x07\b -J-z]|vv|{;\x07\b -7-nqwH----tyl]|vv|{-J-}|wrpv|{Znv\x07-7-z]|vv|{H--0r{qvs--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Is|tlrr\x07K--ZNV[lR[Q\f");var xd=Object.assign({pointScale:new f.Uniform(1),pointMinPixel:new f.Uniform(1),pointMaxPixel:new f.Uniform(1),opacity:new f.Uniform(1),gradientTexture:new f.Uniform(null),modelAlpha:new f.Uniform(0),clippers:new f.Uniform([]),shownFloorIndex:new f.Uniform(-1),constantColor:new f.Uniform(new f.Vector3),geometricError:new f.Uniform(0),pixelRatio:new f.Uniform(1),resolution:new f.Uniform(new f.Vector2(512,512)),floor:new f.Uniform(0),brightness:new f.Uniform(1),modelBoundingMin:new f.Uniform(new f.Vector3),modelBoundingMax:new f.Uniform(new f.Vector3),colorSaturation:new f.Uniform(0),colorBrightness:new f.Uniform(0)},f.UniformsUtils.clone(f.UniformsLib.fog)),Pi=function(n){ue(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,u,l,c,d,p,A,h,v,g,m,y,b,x,w,M,S,E,P,B,C,I=n.call(this,{vertexShader:bd,fragmentShader:yd,uniforms:f.UniformsUtils.clone(xd),lights:!1,clipping:!0,defines:{USE_COLOR_CONSTANT:!1,USE_COLOR_ALTITUDE:!1,USE_EDL:!1,USE_HQ_WEIGHT:!1,USE_HQ_DEPTH:!1,NUM_CLIPPING_BOX:!1,USE_CLIPFLOOR:!1,USE_VERTEX_MARK:!1,USE_MAP:!0,USE_UV:!0,USE_LUMINANCE:!1,USE_BLACK_TRANSITION:!1,USE_POINT_NORMAL:!1,USE_POINT_SHAPE_CIRCLE:!1,USE_POINT_SIZE_ATTENUATION:!1,USE_POINT_SIZE_GEOMETRIC:!1,USE_POINT_BACK_HIDDEN:!1,USE_POINT_BACK_DARK:!1}})||this,F;return I.customShaderHash="",I.customShaderUniforms={},I.customShaderDefines={},Object.defineProperties(I,{constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(T){this.uniforms.constantColor.value=T}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(T){this.uniforms.opacity.value=T}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(T){this.uniforms.modelAlpha.value=T}},shownFloorIndex:{get:function(){return this.uniforms.shownFloorIndex.value},set:function(T){this.uniforms.shownFloorIndex.value=T}},clippers:{get:function(){return F},set:function(T){F!==T&&(F=T,this.uniforms.clippers.value=(F||[]).map(function(L){var D=typeof L.floorIndex=="number"?L.floorIndex:-1,V=new f.Matrix4().getInverse(L.clippingBoxMatrix);return{matrixInverse:V,floorIndex:D}}),this.needsUpdate=!0)}},colorStyle:{get:function(){return this.defines.USE_COLOR_CONSTANT?"CONSTANT":this.defines.USE_COLOR_ALTITUDE?"ALTITUDE":"RGB"},set:function(T){var L=T==="CONSTANT",D=T==="ALTITUDE";this.defines.USE_COLOR_CONSTANT!==L&&(this.defines.USE_COLOR_CONSTANT=L,this.needsUpdate=!0),this.defines.USE_COLOR_ALTITUDE!==D&&(this.defines.USE_COLOR_ALTITUDE=D,this.needsUpdate=!0)}},pointSize:{get:function(){return this.defines.USE_POINT_SIZE_GEOMETRIC===!0?"GEOMETRIC":this.defines.USE_POINT_SIZE_ATTENUATION===!0?"ATTENUATION":"FIXED"},set:function(T){var L=T==="ATTENUATION",D=T==="GEOMETRIC";this.defines.USE_POINT_SIZE_GEOMETRIC!==D&&(this.defines.USE_POINT_SIZE_GEOMETRIC=D,this.needsUpdate=!0),this.defines.USE_POINT_SIZE_ATTENUATION!==L&&(this.defines.USE_POINT_SIZE_ATTENUATION=L,this.needsUpdate=!0)}},pointShape:{get:function(){return this.defines.USE_POINT_SHAPE_CIRCLE===!0?"CIRCLE":"SQUARE"},set:function(T){var L=T==="CIRCLE";this.defines.USE_POINT_SHAPE_CIRCLE!==L&&(this.defines.USE_POINT_SHAPE_CIRCLE=L,this.needsUpdate=!0)}},pointScale:{get:function(){return this.uniforms.pointScale.value},set:function(T){this.uniforms.pointScale.value=T}},pointBack:{get:function(){return this.defines.USE_POINT_BACK_HIDDEN===!0?"HIDDEN":this.defines.USE_POINT_BACK_DARK===!0?"DARK":"VISIBLE"},set:function(T){var L=T==="HIDDEN",D=T==="DARK";this.defines.USE_POINT_BACK_HIDDEN!==L&&(this.defines.USE_POINT_BACK_HIDDEN=L,this.needsUpdate=!0),this.defines.USE_POINT_BACK_DARK!==D&&(this.defines.USE_POINT_BACK_DARK=D,this.needsUpdate=!0)}},pointMinPixel:{get:function(){return this.uniforms.pointMinPixel.value},set:function(T){this.uniforms.pointMinPixel.value=T}},pointMaxPixel:{get:function(){return this.uniforms.pointMaxPixel.value},set:function(T){this.uniforms.pointMaxPixel.value=T}},useEDL:{get:function(){return this.defines.USE_EDL},set:function(T){T!==this.defines.USE_EDL&&(this.defines.USE_EDL=T,this.needsUpdate=!0)}},useHQWeight:{get:function(){return this.defines.USE_HQ_WEIGHT},set:function(T){T!==this.defines.USE_HQ_WEIGHT&&(this.defines.USE_HQ_WEIGHT=T,this.needsUpdate=!0)}},useHQDepth:{get:function(){return this.defines.USE_HQ_DEPTH},set:function(T){T!==this.defines.USE_HQ_DEPTH&&(this.defines.USE_HQ_DEPTH=T,this.needsUpdate=!0)}},gradientTexture:{get:function(){return this.uniforms.gradientTexture.value},set:function(T){this.uniforms.gradientTexture.value=T}},floor:{get:function(){return this.uniforms.floor.value},set:function(T){this.uniforms.floor.value=T}},brightness:{get:function(){return this.uniforms.brightness.value},set:function(T){this.uniforms.brightness.value=T}},colorSaturation:{get:function(){return this.uniforms.colorSaturation.value},set:function(T){this.uniforms.colorSaturation.value=T}},colorBrightness:{get:function(){return this.uniforms.colorBrightness.value},set:function(T){this.uniforms.colorBrightness.value=T}}}),I.pano0=(r=e.pano0)!==null&&r!==void 0?r:ge.pano0,I.pano1=(i=e.pano1)!==null&&i!==void 0?i:ge.pano1,I.modelAlpha=(a=e.modelAlpha)!==null&&a!==void 0?a:ge.modelAlpha,I.progress=(o=e.progress)!==null&&o!==void 0?o:ge.progress,I.transition=(s=e.transition)!==null&&s!==void 0?s:ge.transition,I.colorStyle=(u=e.colorStyle)!==null&&u!==void 0?u:ge.colorStyle,I.constantColor=(l=e.constantColor)!==null&&l!==void 0?l:ge.constantColor,I.opacity=(c=e.opacity)!==null&&c!==void 0?c:ge.opacity,I.floorStyle=(d=e.floorStyle)!==null&&d!==void 0?d:ge.floorStyle,I.shownFloorIndex=(p=e.shownFloorIndex)!==null&&p!==void 0?p:ge.shownFloorIndex,I.clippers=(A=e.clippers)!==null&&A!==void 0?A:ge.clippers,I.useEDL=(h=e.useEDL)!==null&&h!==void 0?h:ge.useEDL,I.useHQWeight=(v=e.useHQWeight)!==null&&v!==void 0?v:ge.useHQWeight,I.useHQDepth=(g=e.useHQDepth)!==null&&g!==void 0?g:ge.useHQDepth,I.pointShape=(m=e.pointShape)!==null&&m!==void 0?m:ge.pointShape,I.pointSize=(y=e.pointSize)!==null&&y!==void 0?y:ge.pointSize,I.pointScale=(b=e.pointScale)!==null&&b!==void 0?b:ge.pointScale,I.pointBack=(x=e.pointBack)!==null&&x!==void 0?x:ge.pointBack,I.pointMinPixel=(w=e.pointMinPixel)!==null&&w!==void 0?w:ge.pointMinPixel,I.pointMaxPixel=(M=e.pointMaxPixel)!==null&&M!==void 0?M:ge.pointMaxPixel,I.gradientTexture=(S=e.gradientTexture)!==null&&S!==void 0?S:ge.gradientTexture,I.brightness=(E=e.brightness)!==null&&E!==void 0?E:ge.brightness,I.colorSaturation=(P=e.colorSaturation)!==null&&P!==void 0?P:ge.colorSaturation,I.colorBrightness=(B=e.colorBrightness)!==null&&B!==void 0?B:ge.colorBrightness,I.customShaders=(C=e.customShaders)!==null&&C!==void 0?C:ge.customShaders,I.customShaderHash="",I.floor=0,I.transparent=!0,I}return t.prototype.onBeforeCompile=function(e,r){var i,a,o=this.customShaders.filter(function(v){return v.type.includes("pointcloud")}),s=o.reduce(function(v,g){return v+g.vertex.mainBefore},""),u=o.reduce(function(v,g){return v+g.vertex.mainStart},""),l=o.reduce(function(v,g){return v+g.vertex.mainEnd},""),c=o.reduce(function(v,g){return v+g.fragment.mainBefore},""),d=o.reduce(function(v,g){return v+g.fragment.mainStart},""),p=o.reduce(function(v,g){return v+g.fragment.mainModelColor},""),A=o.reduce(function(v,g){return v+g.fragment.mainEnd},"");e.vertexShader=e.vertexShader.replace(/MAIN_BEFORE/g,s),e.fragmentShader=e.fragmentShader.replace(/MAIN_BEFORE/g,c),e.vertexShader=e.vertexShader.replace(/MAIN_START/g,u),e.fragmentShader=e.fragmentShader.replace(/MAIN_START/g,d),e.vertexShader=e.vertexShader.replace(/MAIN_END/g,l),e.fragmentShader=e.fragmentShader.replace(/MAIN_END/g,A),e.fragmentShader=e.fragmentShader.replace(/MAIN_MODEL_COLOR/g,p);var h=String((a=(i=this.clippers)===null||i===void 0?void 0:i.length)!==null&&a!==void 0?a:0);e.vertexShader=e.vertexShader.replace(/NUM_CLIPPERS/g,h),e.fragmentShader=e.fragmentShader.replace(/NUM_CLIPPERS/g,h),o.forEach(function(v){v.onBeforeCompile(e,r)})},t.prototype.update=function(e,r,i){var a="".concat(i.id,":").concat(i.materialVersion);a!==this.syncModelVersion&&(Object.assign(this,i.getMaterial()),this.syncModelVersion=a);var o=this.customShaders.map(function(m){return m.getHash()}).join("");this.customShaderHash!==o&&(this.customShaderHash=o,this.needsUpdate=!0);for(var s=this.customShaders.reduce(function(m,y){return Object.assign(m,y.defines)},{}),u=Object.keys(this.customShaderDefines),l=0,c=u;l<c.length;l++){var d=c[l];delete this.defines[d]}this.customShaderDefines=s,Object.assign(this.defines,this.customShaderDefines);for(var p=this.customShaders.reduce(function(m,y){return Object.assign(m,y.uniforms)},{}),A=Object.keys(this.customShaderUniforms),h=0,v=A;h<v.length;h++){var g=v[h];delete this.uniforms[g]}this.customShaderUniforms=p,Object.assign(this.uniforms,this.customShaderUniforms),this.visible=!0,this.transparent=!1,this.shownFloorIndex>-1&&(this.transparent=this.shownFloorIndex!==this.floor),this.modelAlpha<1&&(this.transparent=!0),this.opacity<1&&(this.transparent=!0),this.brightness<1&&(this.transparent=!0),this.depthWrite=!0,this.depthTest=!0,this.useEDL&&(this.transparent=!1),this.useHQWeight?(this.depthWrite=!1,this.blending=f.CustomBlending,this.blendSrc=f.SrcAlphaFactor,this.blendSrcAlpha=f.SrcAlphaFactor,this.blendDst=f.OneFactor,this.blendDstAlpha=f.OneFactor):(this.blending=f.NormalBlending,this.blendDst=f.OneMinusSrcAlphaFactor,this.blendEquation=f.AddEquation,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null),this.floorStyle==="VISIBILITY"&&this.shownFloorIndex!==-1&&this.floor!==this.shownFloorIndex&&(this.visible=!1),this.uniforms.pixelRatio.value=r.pixelRatio,this.uniforms.resolution.value.copy(r.resolution),this.uniforms.modelBoundingMax.value.copy(i.bounding.max),this.uniforms.modelBoundingMin.value.copy(i.bounding.min)},t.prototype.copy=function(e){return n.prototype.copy.call(this,this),this.customShaders=e.customShaders,this.pano0=e.pano0,this.pano1=e.pano1,this.progress=e.progress,this.transition=e.transition,this.floorStyle=e.floorStyle,this.shownFloorIndex=e.shownFloorIndex,this.brightness=e.brightness,this.clippers=e.clippers,this.constantColor=e.constantColor,this.modelAlpha=e.modelAlpha,this.useEDL=e.useEDL,this.useHQWeight=e.useHQWeight,this.useHQDepth=e.useHQDepth,this.colorStyle=e.colorStyle,this.pointSize=e.pointSize,this.pointShape=e.pointShape,this.pointScale=e.pointScale,this.pointBack=e.pointBack,this.pointMinPixel=e.pointMinPixel,this.pointMaxPixel=e.pointMaxPixel,this.gradientTexture=e.gradientTexture,this.colorSaturation=e.colorSaturation,this.colorBrightness=e.colorBrightness,this},t}(f.ShaderMaterial),xn=function(n){ue(t,n);function t(e){var r=e.preserveDrawingBuffer,i=r===void 0?!0:r,a=e.premultipliedAlpha,o=a===void 0?!0:a,s=e.stencil,u=s===void 0?!0:s,l=e.backgroundColor,c=l===void 0?1579548:l,d=e.backgroundAlpha,p=d===void 0?1:d,A=e.pixelRatio,h=A===void 0?1:A,v=e.antialias,g=v===void 0?!1:v,m=e.webgl2,y=e.logarithmicDepthBuffer,b=e.precision,x=e.powerPreference,w=this,M={antialias:g,alpha:!0,depth:!0,preserveDrawingBuffer:i,stencil:u,premultipliedAlpha:o,powerPreference:x},S={logarithmicDepthBuffer:y,precision:b};if(m){var E=document.createElement("canvas"),P=E.getContext("webgl2",M);P?w=n.call(this,O(O(O({},M),S),{antialias:!0,canvas:E,context:P}))||this:(console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."),w=n.call(this,O(O({},M),S))||this)}else w=n.call(this,O(O({},M),S))||this;return w.setPixelRatio(h),w.setClearColor(c,p),w.outputEncoding=f.sRGBEncoding,w.autoClear=!0,w}return t}(f.WebGLRenderer),Xo=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.add=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return n.prototype.add.apply(this,e)},t.prototype.remove=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return n.prototype.remove.apply(this,e)},t}(f.Scene);function nr(n,t){var e=Math.abs(Math.cos(n.latitude)),r=-Math.sin(n.longitude)*e,i=-Math.sin(n.latitude),a=-Math.cos(n.longitude)*e;return t?t.set(r,i,a):new f.Vector3(r,i,a)}var wd=1,Md=.1,Sd=2e3,zi=Math.PI*2,Us=Math.PI/2;function La(n){return n>0&&n<=zi?n:(n%zi+zi)%zi}function Cd(n,t,e,r){e=Math.pow(e,4);for(var i=0;i<16;i++)r.elements[i]=n.elements[i]+(t.elements[i]-n.elements[i])*e;return r}var Su=function(n){ue(t,n);function t(e,r,i,a,o,s,u){r===void 0&&(r=wd),i===void 0&&(i=Md),a===void 0&&(a=Sd),o===void 0&&(o=new f.Vector2),s===void 0&&(s=new f.Vector2(512,512)),u===void 0&&(u=1);var l=n.call(this)||this;l.fov=e,l.aspect=r,l.near=i,l.far=a,l.perspToOrtho=o,l.resolution=s,l.pixelRatio=u,l.time=0,l.needsRender=!0,l.refineModel=!0,l.pose={longitude:0,latitude:0,fov:e,distance:0,offset:new f.Vector3},l.computePose(),l.perspectiveCamera=new f.PerspectiveCamera(l.fov,l.aspect,.001,l.far);var c=Math.max(l.orthoDistance,.01)*Math.tan(.5*l.fov/180*Math.PI),d=-.5*l.aspect*2*c;return l.orthographicCamera=new f.OrthographicCamera(d,-d,c,-c,.001,l.far),l.computeProjectionMatrix(),l.lastValues={position:l.position.clone(),quaternion:l.quaternion.clone(),scale:l.scale.clone(),fov:l.fov,aspect:l.aspect,near:l.near,far:l.far,orthoDistance:l.orthoDistance,perspToOrtho:l.perspToOrtho.clone()},l.type=l.perspToOrtho.x<1?"PerspectiveCamera":"OrthographicCamera",l.autoNearFar=!0,l}return Object.defineProperty(t.prototype,"orthoDistance",{get:function(){return this.pose.distance>1?this.pose.distance:1+(this.pose.distance-1)*this.perspToOrtho.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"zoom",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.zoom:this.type==="PerspectiveCamera"?this.perspectiveCamera.zoom:1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.top:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.bottom:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.left:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.right:0},enumerable:!1,configurable:!0}),t.prototype.getDirection=function(e){return nr(this.pose,e)},t.prototype.computePose=function(e){e===void 0&&(e=0),this.updateMatrix();var r=this.matrix.elements;return this.pose.latitude=Math.asin(ce(r[9],-1,1)),Math.abs(r[9])<.9999999?this.pose.longitude=La(Math.atan2(r[8],r[10])):this.pose.longitude=La(Math.atan2(-r[2],r[0])),this.pose.fov=this.fov,this.pose.distance=e,this.pose.offset=new f.Vector3(-r[8],-r[9],-r[10]).setLength(this.pose.distance).add(this.position),this},t.prototype.setFromPose=function(e){var r,i,a,o,s,u=La((r=e.longitude)!==null&&r!==void 0?r:this.pose.longitude),l=Math.max(-Us+1e-4,Math.min(Us-1e-4,(i=e.latitude)!==null&&i!==void 0?i:this.pose.latitude)),c=(a=e.fov)!==null&&a!==void 0?a:this.pose.fov,d=(o=e.distance)!==null&&o!==void 0?o:this.pose.distance,p=(s=e.offset)!==null&&s!==void 0?s:this.pose.offset,A=nr({longitude:u,latitude:l}).normalize();return this.position.set(0,0,0),this.lookAt(A),this.position.add(p).sub(A.clone().setLength(d)),this.fov!==c&&(this.fov=c,this.updateProjectionMatrix()),this.updateMatrixWorld(!0),this.pose.longitude=u,this.pose.latitude=l,this.pose.fov=c,this.pose.distance=d,this.pose.offset.copy(p),this.needsRender=!0,this},t.prototype.copyPose=function(){return{longitude:this.pose.longitude,latitude:this.pose.latitude,fov:this.pose.fov,distance:this.pose.distance,offset:this.pose.offset.clone()}},t.prototype.computeProjectionMatrix=function(){Cd(this.orthographicCamera.projectionMatrix,this.perspectiveCamera.projectionMatrix,1-this.perspToOrtho.x,this.projectionMatrix),this.projectionMatrixInverse.getInverse(this.projectionMatrix),this.needsRender=!0},t.prototype.setViewOffset=function(e,r,i,a,o,s){this.perspectiveCamera.setViewOffset(e,r,i,a,o,s),this.orthographicCamera.setViewOffset(e,r,i,a,o,s),this.computeProjectionMatrix()},t.prototype.clearViewOffset=function(){this.perspectiveCamera.clearViewOffset(),this.orthographicCamera.clearViewOffset(),this.computeProjectionMatrix()},t.prototype.updateProjectionMatrix=function(){this.perspectiveCamera.updateProjectionMatrix(),this.orthographicCamera.updateProjectionMatrix(),this.computeProjectionMatrix()},Object.defineProperty(t.prototype,"perspectiveProjectionMatrix",{get:function(){return this.perspectiveCamera.projectionMatrix},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"perspectiveProjectionMatrixInverse",{get:function(){return this.perspectiveCamera.projectionMatrixInverse},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"orthographicProjectionMatrix",{get:function(){return this.orthographicCamera.projectionMatrix},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"orthographicProjectionMatrixInverse",{get:function(){return this.orthographicCamera.projectionMatrixInverse},enumerable:!1,configurable:!0}),t.prototype.updateTime=function(e){this.time=e;var r=!1;if((this.lastValues.fov!==this.fov||this.lastValues.near!==this.near||this.lastValues.far!==this.far||this.lastValues.aspect!==this.aspect)&&(this.perspectiveCamera.fov=this.fov,this.perspectiveCamera.near=this.near,this.perspectiveCamera.far=this.far,this.perspectiveCamera.aspect=this.aspect,this.perspectiveCamera.updateProjectionMatrix(),r=!0),!this.lastValues.position.equals(this.position)||!this.lastValues.quaternion.equals(this.quaternion)||!this.lastValues.scale.equals(this.scale)||!this.lastValues.perspToOrtho.equals(this.perspToOrtho)||this.lastValues.fov!==this.fov||this.lastValues.near!==this.near||this.lastValues.far!==this.far||this.lastValues.orthoDistance!==this.orthoDistance||this.lastValues.aspect!==this.aspect){var i=Math.max(this.orthoDistance,.01)*Math.tan(.5*this.fov/180*Math.PI),a=-.5*this.aspect*2*i;this.orthographicCamera.left=a,this.orthographicCamera.right=-a,this.orthographicCamera.top=i,this.orthographicCamera.bottom=-i,this.orthographicCamera.near=this.near,this.orthographicCamera.far=this.far,this.orthographicCamera.updateProjectionMatrix(),r=!0}r&&this.computeProjectionMatrix(),this.lastValues.position.copy(this.position),this.lastValues.quaternion.copy(this.quaternion),this.lastValues.scale.copy(this.scale),this.lastValues.fov=this.fov,this.lastValues.aspect=this.aspect,this.lastValues.near=this.near,this.lastValues.far=this.far,this.lastValues.orthoDistance=this.orthoDistance,this.lastValues.perspToOrtho.copy(this.perspToOrtho),this.type=this.perspToOrtho.x<1?"PerspectiveCamera":"OrthographicCamera"},Object.defineProperty(t.prototype,"isPerspectiveCamera",{get:function(){return this.perspToOrtho.x<1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isOrthographicCamera",{get:function(){return this.perspToOrtho.x>=1},enumerable:!1,configurable:!0}),t.prototype.copy=function(e,r){return n.prototype.copy.call(this,e,r),this.fov=e.fov,this.aspect=e.aspect,this.near=e.near,this.far=e.far,this.perspToOrtho.copy(e.perspToOrtho),this.updateTime(ve()),this},t}(f.Camera),Ft;(function(n){n[n.Outside=-1]="Outside",n[n.Intersecting=0]="Intersecting",n[n.Inside=1]="Inside"})(Ft||(Ft={}));var Cu=1e-6,Ke=new f.Vector3,un=new f.Matrix4,Wr=new f.Vector3,Zr=new f.Vector3,Yr=new f.Vector3,So=new f.Vector3,ka=new f.Box3,Oa=new f.Sphere,qs=new f.Matrix4,Da=new f.Ray,Rt=new f.Object3D,Hs=new f.Frustum;function Eu(n,t){var e=n.elements;return t.setFromRotationMatrix(un.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)),t}var li=function(){function n(t){t===void 0&&(t=[]),this.planes=t}return Object.defineProperty(n,"MASK_OUTSIDE",{get:function(){return 4294967295},enumerable:!1,configurable:!0}),Object.defineProperty(n,"MASK_INSIDE",{get:function(){return 0},enumerable:!1,configurable:!0}),Object.defineProperty(n,"MASK_INDETERMINATE",{get:function(){return 2147483647},enumerable:!1,configurable:!0}),n.prototype.setFromFrustum=function(t){return this.planes=t.planes.map(function(e){return e.clone()}),this},n.prototype.setFromCamera=function(t){return un.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),Hs.setFromProjectionMatrix(un),this.setFromFrustum(Hs),this},n.prototype.applyMatrix4=function(t){for(var e=0,r=this.planes;e<r.length;e++){var i=r[e];i.applyMatrix4(t)}},n.prototype.copy=function(t){return this.planes=t.planes.map(function(e){return e.clone()}),this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.computeVisibility=function(t){for(var e=Ft.Inside,r=0,i=this.planes;r<i.length;r++){var a=i[r],o=t.intersectPlane(a);switch(o){case Ft.Outside:return Ft.Outside;case Ft.Intersecting:e=Ft.Intersecting;break}}return e},n.prototype.computeVisibilityWithPlaneMask=function(t,e){if(e===n.MASK_OUTSIDE||e===n.MASK_INSIDE)return e;for(var r=n.MASK_INSIDE,i=Math.min(32,this.planes.length),a=0;a<i;++a){var o=1<<a;if(e&o){var s=this.planes[a],u=t.intersectPlane(s);if(u===Ft.Outside)return n.MASK_OUTSIDE;u===Ft.Intersecting&&(r|=o)}}return r},n}(),Wo=function(){function n(){this.type="box",this.center=new f.Vector3,this.halfSize=new f.Vector3,this.rotation=new f.Matrix3}return n.prototype.fromJson=function(t){var e=t.box;this.center.set(e[0],e[1],e[2]);var r=e[3],i=e[4],a=e[5],o=e[6],s=e[7],u=e[8],l=e[9],c=e[10],d=e[11],p=Math.max(Math.sqrt(r*r+i*i+a*a),.001),A=Math.max(Math.sqrt(o*o+s*s+u*u),.001),h=Math.max(Math.sqrt(l*l+c*c+d*d),.001);this.halfSize.set(p,A,h);var v=this.halfSize.toArray().reduce(function(g,m){return g+m},0);return(isNaN(v)||v<=0)&&this.halfSize.setScalar(Cu),this.rotation.fromArray([r/p,i/p,a/p,o/A,s/A,u/A,l/h,c/h,d/h]),isNaN(this.rotation.toArray().reduce(function(g,m){return g+m},0))&&this.rotation.identity(),this},n.prototype.toJson=function(){return this.rotation.extractBasis(Wr,Zr,Yr),{box:vt(vt(vt(vt([],this.center.toArray(),!0),Wr.multiplyScalar(this.halfSize.x).toArray(),!0),Zr.multiplyScalar(this.halfSize.y).toArray(),!0),Yr.multiplyScalar(this.halfSize.z).toArray(),!0)}},n.prototype.copy=function(t){return this.center.copy(t.center),this.halfSize.copy(t.halfSize),this.rotation.copy(t.rotation),this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.applyMatrix4=function(t){return Rt.position.copy(this.center),Eu(this.rotation,Rt.quaternion),Rt.scale.copy(this.halfSize),Rt.matrix.compose(Rt.position,Rt.quaternion,Rt.scale),Rt.matrix.premultiply(t),Rt.matrix.decompose(Rt.position,Rt.quaternion,Rt.scale),this.center.copy(Rt.position),this.rotation.setFromMatrix4(un.makeRotationFromQuaternion(Rt.quaternion)),this.halfSize.copy(Rt.scale),this},n.prototype.getCenter=function(t){return t.copy(this.center)},n.prototype.distanceSquaredToPoint=function(t){var e=this.rotation.elements,r=t.x-this.center.x,i=t.y-this.center.y,a=t.z-this.center.z,o=0,s;return s=r*e[0]+i*e[1]+a*e[2],s<0&&(s=-s),s-=this.halfSize.x,s>0&&(o+=s*s),s=r*e[3]+i*e[4]+a*e[5],s<0&&(s=-s),s-=this.halfSize.y,s>0&&(o+=s*s),s=r*e[6]+i*e[7]+a*e[8],s<0&&(s=-s),s-=this.halfSize.z,s>0&&(o+=s*s),o},n.prototype.distanceToPoint=function(t){return Math.sqrt(this.distanceSquaredToPoint(t))},n.prototype.distanceToPlane=function(t){var e=t.projectPoint(this.center,new f.Vector3);return this.distanceToPoint(e)},n.prototype.getBoundingBox=function(t){return t.makeEmpty(),this.rotation.extractBasis(Wr,Zr,Yr),Wr.setLength(this.halfSize.x),Zr.setLength(this.halfSize.y),Yr.setLength(this.halfSize.z),t.expandByPoint(Ke.copy(this.center).add(Wr)),t.expandByPoint(Ke.copy(this.center).sub(Wr)),t.expandByPoint(Ke.copy(this.center).add(Zr)),t.expandByPoint(Ke.copy(this.center).sub(Zr)),t.expandByPoint(Ke.copy(this.center).add(Yr)),t.expandByPoint(Ke.copy(this.center).sub(Yr)),t},n.prototype.toGeometry=function(){var t=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]),e=new Float32Array(8*3);Ke.set(this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,0),Ke.set(-this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,3),Ke.set(-this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,6),Ke.set(this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,9),Ke.set(this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,12),Ke.set(-this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,15),Ke.set(-this.halfSize.x,-this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,18),Ke.set(this.halfSize.x,-this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,21);var r=new f.BufferGeometry;return r.setIndex(new f.BufferAttribute(t,1)),r.setAttribute("position",new f.BufferAttribute(e,3)),r.computeBoundingBox(),r.computeBoundingSphere(),r},n.prototype.intersectPlane=function(t){var e=this.center,r=t.normal,i=this.rotation.elements,a=this.halfSize,o=r.x,s=r.y,u=r.z,l=Math.abs(o*i[0]*a.x+s*i[1]*a.x+u*i[2]*a.x)+Math.abs(o*i[3]*a.y+s*i[4]*a.y+u*i[5]*a.y)+Math.abs(o*i[6]*a.z+s*i[7]*a.z+u*i[8]*a.z),c=r.dot(e)+t.constant;return c<=-l?Ft.Outside:c>=l?Ft.Inside:Ft.Intersecting},n.prototype.intersectRay=function(t,e){if(So.copy(this.halfSize).multiplyScalar(2),ka.setFromCenterAndSize(Ke.set(0,0,0),So),this.rotation.extractBasis(Wr,Zr,Yr),un.makeBasis(Wr,Zr,Yr),un.setPosition(this.center),qs.getInverse(un),Da.copy(t).applyMatrix4(qs),ka.containsPoint(Da.origin))return!0;var r=Da.intersectBox(ka,Ke);return r?e!==void 0?r.applyMatrix4(un).distanceTo(t.origin)<e:!0:!1},n}(),Zo=function(){function n(){this.type="sphere",this.center=new f.Vector3,this.radius=-1}return n.prototype.fromJson=function(t){var e=t.sphere;return this.center.set(e[0],e[1],e[2]),this.radius=Math.max(e[3],Cu),this},n.prototype.toJson=function(){return{sphere:vt(vt([],this.center.toArray(),!0),[this.radius],!1)}},n.prototype.copy=function(t){return this.center.copy(t.center),this.radius=t.radius,this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.getBoundingBox=function(t){return t.setFromCenterAndSize(this.center,So.set(1,1,1).multiplyScalar(this.radius*2)),t},n.prototype.toGeometry=function(){for(var t=32,e=new Float32Array(t*3*2*2),r=0;r<=t;r++){var i=0;i=r/t*Math.PI*2,e[r*6+0]=this.center.x+Math.cos(i)*this.radius,e[r*6+1]=this.center.y+Math.sin(i)*this.radius,e[r*6+2]=this.center.z+0,i=(r+1)/t*Math.PI*2,e[r*6+3]=this.center.x+Math.cos(i)*this.radius,e[r*6+4]=this.center.y+Math.sin(i)*this.radius,e[r*6+5]=this.center.z+0}for(var r=t;r<=t*2;r++){var i=0;i=r/t*Math.PI*2,e[r*6+0]=this.center.x+Math.cos(i)*this.radius,e[r*6+1]=this.center.y+0,e[r*6+2]=this.center.z+Math.sin(i)*this.radius,i=(r+1)/t*Math.PI*2,e[r*6+3]=this.center.x+Math.cos(i)*this.radius,e[r*6+4]=this.center.y+0,e[r*6+5]=this.center.z+Math.sin(i)*this.radius}var a=new f.BufferGeometry;return a.setAttribute("position",new f.BufferAttribute(e,3)),a.computeBoundingBox(),a.computeBoundingSphere(),a},n.prototype.applyMatrix4=function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},n.prototype.getCenter=function(t){return t.copy(this.center)},n.prototype.distanceSquaredToPoint=function(t){var e=this.distanceToPoint(t);return e*e},n.prototype.distanceToPoint=function(t){var e=this.center.distanceTo(t)-this.radius;return e<=0?0:e},n.prototype.distanceToPlane=function(t){var e=Math.abs(t.distanceToPoint(this.center));return Math.max(0,e-this.radius)},n.prototype.intersectPlane=function(t){var e=this.center,r=this.radius,i=t.normal,a=i.dot(e)+t.constant;return a<-r?Ft.Outside:a<r?Ft.Intersecting:Ft.Inside},n.prototype.intersectRay=function(t,e){if(Oa.set(this.center,this.radius),Oa.containsPoint(t.origin))return!0;var r=t.intersectSphere(Oa,Ke);return r?e!==void 0?t.origin.distanceTo(r)<e:!0:!1},n}(),Iu=function(){function n(){throw this.type="regin",this.west=0,this.south=0,this.east=0,this.north=0,this.minHeight=0,this.maxHeight=0,new Error("Region bounding volume not supported.")}return n.prototype.fromJson=function(t){var e=t.region;return this.west=e[0],this.south=e[1],this.east=e[2],this.north=e[3],this.minHeight=e[4],this.maxHeight=e[5],this},n.prototype.toJson=function(){return{region:[this.west,this.south,this.east,this.north,this.minHeight,this.maxHeight]}},n.prototype.copy=function(t){return this.west=t.west,this.south=t.south,this.east=t.east,this.north=t.north,this.minHeight=t.minHeight,this.maxHeight=t.maxHeight,this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.getBoundingBox=function(t){throw new Error("not implemented")},n.prototype.toGeometry=function(){throw new Error("not implemented")},n.prototype.applyMatrix4=function(t){throw new Error("not implemented")},n.prototype.getCenter=function(t){throw new Error("not implemented")},n.prototype.distanceToPoint=function(t){throw new Error("not implemented")},n.prototype.distanceSquaredToPoint=function(t){throw new Error("not implemented")},n.prototype.distanceToPlane=function(t){throw new Error("not implemented")},n.prototype.intersectPlane=function(t){throw new Error("not implemented")},n.prototype.intersectRay=function(t){throw new Error("not implemented")},n}();function Va(n){return n instanceof Wo||n instanceof Zo||n instanceof Iu}function Mn(n){if("box"in n)return new Wo().fromJson(n);if("sphere"in n)return new Zo().fromJson(n);if("region"in n)return new Iu().fromJson(n);throw new Error("BoundingVolume ".concat(JSON.stringify(n)," never suppored."))}var Qi=[4821759,8191922,16637280,16739958,5822969,376977,16747077,9259235,14514687].map(function(n){return new f.LineBasicMaterial({color:n,depthWrite:!1,depthTest:!1,transparent:!0})}),Ed=function(){var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),t=new Float32Array(8*3);Ke.set(1,1,1).toArray(t,0),Ke.set(-1,1,1).toArray(t,3),Ke.set(-1,-1,1).toArray(t,6),Ke.set(1,-1,1).toArray(t,9),Ke.set(1,1,-1).toArray(t,12),Ke.set(-1,1,-1).toArray(t,15),Ke.set(-1,-1,-1).toArray(t,18),Ke.set(1,-1,-1).toArray(t,21);var e=new f.BufferGeometry;return e.setIndex(new f.BufferAttribute(n,1)),e.setAttribute("position",new f.BufferAttribute(t,3)),e.computeBoundingBox(),e.computeBoundingSphere(),e}(),Id=function(){for(var n=32,t=new Float32Array(n*3*2*2),e=0;e<=n;e++){var r=0;r=e/n*Math.PI*2,t[e*6+0]=Math.cos(r),t[e*6+1]=Math.sin(r),t[e*6+2]=0,r=(e+1)/n*Math.PI*2,t[e*6+3]=Math.cos(r),t[e*6+4]=Math.sin(r),t[e*6+5]=0}for(var e=n;e<=n*2;e++){var r=0;r=e/n*Math.PI*2,t[e*6+0]=Math.cos(r),t[e*6+1]=0,t[e*6+2]=Math.sin(r),r=(e+1)/n*Math.PI*2,t[e*6+3]=Math.cos(r),t[e*6+4]=0,t[e*6+5]=Math.sin(r)}var i=new f.BufferGeometry;return i.setAttribute("position",new f.BufferAttribute(t,3)),i.computeBoundingBox(),i.computeBoundingSphere(),i}();function Td(n,t){if(n instanceof Wo){var e=new f.LineSegments(Ed,Qi[Math.min(t,Qi.length-1)]);return e.position.copy(n.center),Eu(n.rotation,e.quaternion),e.scale.set(n.halfSize.x,n.halfSize.y,n.halfSize.z),e.matrix.compose(e.position,e.quaternion,e.scale),e}else if(n instanceof Zo){var e=new f.LineSegments(Id,Qi[Math.min(t,Qi.length-1)]);return e.position.copy(n.center),e.scale.set(n.radius,n.radius,n.radius),e.matrix.compose(e.position,e.quaternion,e.scale),e}throw new Error("never")}var Pd=new f.Vector3,Yo=function(){function n(t,e,r,i){var a=this,o,s,u,l;this.parent=null,this.contentParent=null,this.floor=0,this.id=t,this.state={visible:!1,frameNumber:0,selectedFrameNumber:0,requestedFrameNumber:0,touchedFrameNumber:0,distanceToCamera:0,centerZDepth:0,centerScreenY:0,screenSpaceError:0,visibilityPlaneMask:0,inRequestVolume:!1,shouldRefine:!1,stackLength:0,finalResolution:!0,selectionDepth:0,shouldSelect:!1,lastSelect:!1,ancestorWithContent:null,ancestorWithContentAvailable:null},this.parent=i!=null?i:null,this.contentParent=i?i.hasRenderContent?i:i.contentParent:null,this.level=this.parent?this.parent.level+1:0,this.tileset=r,this.refine=(o=e.refine)!==null&&o!==void 0?o:this.parent?this.parent.refine:"REPLACE",this.transform=new f.Matrix4,e.transform&&this.transform.fromArray(e.transform),this.parent&&this.transform.premultiply(this.parent.transform),typeof e.geometricError=="number"?this.geometricError=e.geometricError*this.transform.getMaxScaleOnAxis():this.geometricError=(u=(s=this.parent)===null||s===void 0?void 0:s.geometricError)!==null&&u!==void 0?u:0,e.content&&e.content.uri?(this.content={uri:e.content.uri,loadState:"UNLOADED",loadStateUpdateTime:ve(),loadfailRetryDelay:0,byteLength:0},e.content.group!==void 0&&(this.content.group=e.content.group),e.content.boundingVolume&&(this.content.boundingVolume=Mn(e.content.boundingVolume).applyMatrix4(this.transform)),/\.json$/.test(this.content.uri)?this.type="TILESET":this.type="SCENEGRAPH"):(this.content=null,this.type="EMPTY"),this.levelOfContent=this.parent?this.parent.levelOfContent:-1,this.type==="SCENEGRAPH"&&(this.levelOfContent=this.levelOfContent+1),e.boundingVolume&&(this.boundingVolume=Mn(e.boundingVolume).applyMatrix4(this.transform)),e.viewerRequestVolume&&(this.viewerRequestVolume=Mn(e.viewerRequestVolume).applyMatrix4(this.transform)),this.extras=(l=e.extras)!==null&&l!==void 0?l:{},typeof this.extras.floor!="number"&&i&&typeof i.extras.floor=="number"&&(this.extras.floor=i.extras.floor),typeof this.extras.floor=="number"&&(this.floor=this.extras.floor,this.tileset.floorLength=Math.max(this.tileset.floorLength,this.floor+1)),this.boundingVolume&&(this.boundingVolumeDebugObject=Td(this.boundingVolume,this.levelOfContent)),e.children?this.children=e.children.map(function(c,d){return new n("".concat(a.id,".").concat(d),c,r,a)}):this.children=[]}return n.prototype.traverse=function(t){t(this);for(var e=0,r=this.children;e<r.length;e++){var i=r[e];i.traverse(t)}},n.prototype.updateState=function(t){this.state.frameNumber=t.frameNumber;var e=this.tileset.transformIsIdentity?null:this.tileset.transform;if(this.boundingVolume){var r=e?this.boundingVolume.clone().applyMatrix4(e):this.boundingVolume;if(t.camera.type==="OrthographicCamera"){var i=new f.Plane().setFromNormalAndCoplanarPoint(t.camera.direction,t.camera.position);this.state.distanceToCamera=r.distanceToPlane(i)}else this.state.distanceToCamera=r.distanceToPoint(t.camera.position);var a=r.getCenter(Pd).sub(t.camera.position);this.state.centerZDepth=t.camera.direction.dot(a),this.state.centerScreenY=t.camera.up.dot(a);var o=this.parent?this.parent.state.visibilityPlaneMask:li.MASK_INDETERMINATE;this.state.visibilityPlaneMask=t.cullingVolume.computeVisibilityWithPlaneMask(r,o),this.state.visible=this.state.visibilityPlaneMask!==li.MASK_OUTSIDE}else this.state.distanceToCamera=0,this.state.centerZDepth=0,this.state.visibilityPlaneMask=li.MASK_INDETERMINATE,this.state.visible=!0;if(this.levelOfContent<=t.minLevelOfDetail&&(this.state.visible=!0),this.viewerRequestVolume){var s=e?this.viewerRequestVolume.clone().applyMatrix4(e):this.viewerRequestVolume;this.state.inRequestVolume=s.distanceSquaredToPoint(t.camera.position)<=0}else this.state.inRequestVolume=!0;this.state.screenSpaceError=this.getScreenSpaceError(t,this.state.distanceToCamera,!1)},Object.defineProperty(n.prototype,"selected",{get:function(){return this.state.selectedFrameNumber===this.tileset.frameNumber},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasChildren",{get:function(){return this.children.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"siblingIndex",{get:function(){var t,e;return(e=(t=this.parent)===null||t===void 0?void 0:t.children.indexOf(this))!==null&&e!==void 0?e:0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasTilesetContent",{get:function(){return this.children.length>0&&this.type==="TILESET"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasRenderContent",{get:function(){return this.type==="SCENEGRAPH"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentAvailable",{get:function(){var t;return this.hasRenderContent&&((t=this.content)===null||t===void 0?void 0:t.loadState)==="READY"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasUnloadedContent",{get:function(){var t;return((t=this.content)===null||t===void 0?void 0:t.loadState)==="UNLOADED"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasEmptyContent",{get:function(){return this.type==="EMPTY"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentReady",{get:function(){var t;return((t=this.content)===null||t===void 0?void 0:t.loadState)==="READY"||this.hasEmptyContent},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentByteLength",{get:function(){return this.content?this.content.byteLength:0},enumerable:!1,configurable:!0}),n.prototype.getScreenSpaceError=function(t,e,r){var i=this.tileset.transformIsIdentity?1:this.tileset.transform.getMaxScaleOnAxis(),a=this.parent?this.parent.geometricError:this.tileset.geometricError,o=i*(r?a:this.geometricError);if(o===0)return 0;var s=t.height,u=t.camera.type==="OrthographicCamera"?2:t.sseDenominator,l=Math.max(e,.001),c=o*s/(l*u);return c},n.prototype.getPriority=function(){var t=this.refine==="ADD"||this.tileset.skipLevelOfDetail;if(t&&!this.state.visible||this.tileset.frameNumber-this.state.touchedFrameNumber>=1)return-1;var e=this.parent,r=e&&(!t||this.state.screenSpaceError===0),i=r?e.state.screenSpaceError:this.state.screenSpaceError,a=this.tileset.root?this.tileset.root.state.screenSpaceError:0,o=Math.max(a-i,0);return o},n}(),Na=new Map;function Gs(n,t){if(t&&t.has(n))return t.get(n);var e=n.refine==="ADD"||n.tileset.skipLevelOfDetail,r=n.parent,i=r&&(!e||n.state.screenSpaceError===0),a=i?r.state.screenSpaceError:n.state.screenSpaceError,o=n.tileset.root?n.tileset.root.state.screenSpaceError:0,s=Math.max(o-a,0);return t&&t.set(n,s),s}var Tu=function(){function n(t,e){this.tileset=t,this.options=e,this.activeRequests=0,this.requestQueue=[]}return n.prototype.reset=function(){for(var t=0,e=this.requestQueue;t<e.length;t++){var r=e[t];this.options.onTileSkip&&this.options.onTileSkip(r.tile)}this.requestQueue.length=0},n.prototype.update=function(t,e,r){for(var i=this,a=r.time,o=this.requestQueue,s=new Set(t),u=0;u<o.length;u++){var l=o[u];if(s.has(l.tile)){s.delete(l.tile);continue}l.status==="WAITING"&&(o.splice(u,1),u--,this.options.onTileSkip&&this.options.onTileSkip(l.tile))}s.size>0&&(s.forEach(function(m){o.push({tile:m,status:"WAITING",time:a,error:null})}),s.clear());for(var c=this.tileset.maxRequests,u=0;u<o.length&&c>0;u++){var l=o[u];if(l.status==="DONE")l.error!==null?this.options.onTileError&&this.options.onTileError(l.tile,l.error):(c--,l.tile.content&&(l.tile.content.loadState="READY"),this.options.onTileLoad&&this.options.onTileLoad(l.tile)),o.splice(u,1),u--;else if(l.status==="PENDING"&&a-l.time<1e3)break}switch(Na.clear(),e){case"SCREEN_SPACE_ERROR":{o.sort(function(m,y){if(m.tile.state.requestedFrameNumber!==y.tile.state.requestedFrameNumber)return y.tile.state.requestedFrameNumber-m.tile.state.requestedFrameNumber;if(m.tile.state.requestedFrameNumber===r.frameNumber){var b=Gs(m.tile,Na),x=Gs(y.tile,Na);return b-x}else return m.tile.level!==y.tile.level?m.tile.level-y.tile.level:m.tile.state.distanceToCamera-y.tile.state.distanceToCamera});break}case"SCREEN_VERTICAL":{o.sort(function(m,y){return m.tile.state.requestedFrameNumber!==y.tile.state.requestedFrameNumber?y.tile.state.requestedFrameNumber-m.tile.state.requestedFrameNumber:m.tile.state.requestedFrameNumber===r.frameNumber?m.tile.state.centerScreenY!==y.tile.state.centerScreenY?m.tile.state.centerScreenY-y.tile.state.centerScreenY:m.tile.state.centerZDepth!==y.tile.state.centerZDepth?m.tile.state.centerZDepth-y.tile.state.centerZDepth:m.tile.level!==y.tile.level?m.tile.level-y.tile.level:m.tile.state.distanceToCamera-y.tile.state.distanceToCamera:m.tile.level!==y.tile.level?m.tile.level-y.tile.level:m.tile.state.distanceToCamera-y.tile.state.distanceToCamera});break}case"SCREEN_LEVEL_VERTICAL":{o.sort(function(m,y){return m.tile.state.requestedFrameNumber!==y.tile.state.requestedFrameNumber?y.tile.state.requestedFrameNumber-m.tile.state.requestedFrameNumber:m.tile.state.requestedFrameNumber===r.frameNumber?m.tile.level!==y.tile.level?m.tile.level-y.tile.level:m.tile.state.centerScreenY!==y.tile.state.centerScreenY?m.tile.state.centerScreenY-y.tile.state.centerScreenY:m.tile.state.centerZDepth!==y.tile.state.centerZDepth?m.tile.state.centerZDepth-y.tile.state.centerZDepth:m.tile.state.distanceToCamera-y.tile.state.distanceToCamera:m.tile.level!==y.tile.level?m.tile.level-y.tile.level:m.tile.state.distanceToCamera-y.tile.state.distanceToCamera});break}}if(c=Math.max(this.tileset.maxRequests-this.activeRequests,0),!this.tileset.skipLevelOfDetail)for(var d=0,p=o.length,u=0;u<p;u++){var A=o[u].tile;if(A.hasTilesetContent||A.contentParent===null||A.contentParent.state.selectedFrameNumber===this.tileset.frameNumber){var h=o.splice(u,1);o.splice.apply(o,vt([d++,0],h,!1))}}for(var v=function(m){var y=o[m];y.status==="WAITING"&&(c--,y.status="PENDING",y.time=a,g.activeRequests++,g.tileset.options.tileLoader(y.tile).catch(function(b){y.error=b}).then(function(){y.status="DONE",y.tile.content&&y.tile.content.loadState==="READY"&&(y.tile.content.loadState="LOADING"),i.activeRequests--}))},g=this,u=0;u<o.length&&c>0;u++)v(u)},n}(),Rd=function(){function n(t,e,r){this.item=t,this.previous=e,this.next=r}return n}(),Bd=function(){function n(){this.head=null,this.tail=null,this._length=0}return Object.defineProperty(n.prototype,"length",{get:function(){return this._length},enumerable:!1,configurable:!0}),n.prototype.add=function(t){var e=new Rd(t,this.tail,null);return this.tail?(this.tail.next=e,this.tail=e):(this.head=e,this.tail=e),this._length++,e},n.prototype.remove=function(t){t.previous&&t.next?(t.previous.next=t.next,t.next.previous=t.previous):t.previous?(t.previous.next=null,this.tail=t.previous):t.next?(t.next.previous=null,this.head=t.next):(this.head=null,this.tail=null),t.next=null,t.previous=null,this._length--},n.prototype.splice=function(t,e){t!==e&&(this.remove(e),this.insert(t,e))},n.prototype.insert=function(t,e){var r=t.next;t.next=e,this.tail===t?this.tail=e:r.previous=e,e.next=r,e.previous=t,this._length++},n.prototype.toArray=function(){for(var t=[],e=this.head;e;)t.push(e),e=e.next;return t},n}(),Pu=function(){function n(t){t===void 0&&(t={}),this.options=t,this.cacheNodeMap=new Map,this.list=new Bd,this.sentinel=this.list.add("sentinel")}return n.prototype.reset=function(){this.list.tail&&this.list.splice(this.list.tail,this.sentinel)},n.prototype.touchTile=function(t){var e=this.cacheNodeMap.get(t);e&&this.list.splice(this.sentinel,e)},n.prototype.loadTile=function(t){if(!this.cacheNodeMap.has(t)){var e=this.list.add(t);this.cacheNodeMap.set(t,e),this.options.onTileLoad&&this.options.onTileLoad(t)}},n.prototype.unloadTile=function(t){var e=this.cacheNodeMap.get(t);e&&(this.list.remove(e),this.cacheNodeMap.delete(t),this.options.onTileUnload&&this.options.onTileUnload(t))},n.prototype.unloadTiles=function(t){for(var e=this.list.head;e!==this.sentinel&&t();){var r=e.item;e=e.next,this.unloadTile(r)}},n.prototype.toArray=function(){for(var t=[],e=0,r=this.list.toArray();e<r.length;e++){var i=r[e];i.item!=="sentinel"&&t.push(i.item)}return t},n}(),cn=function(){function n(){this.map=new Map,this.array=[],this._length=0}return Object.defineProperty(n.prototype,"length",{get:function(){return this._length},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return this.array[t]},n.prototype.set=function(t,e){t>=this.length&&(this._length=t+1),this.map.has(this.array[t])&&this.map.delete(this.array[t]),this.array[t]=e,this.map.set(e,t)},n.prototype.delete=function(t){var e=this.map.get(t);e!==void 0&&e>=0&&(this.array.splice(e,1),this.map.delete(t),this._length--)},n.prototype.push=function(t){if(!this.map.has(t)){var e=this._length++;this.array[e]=t,this.map.set(t,e)}},n.prototype.pop=function(){var t=this.array[--this._length];return this.map.delete(t),this.array[this._length]=void 0,t},n.prototype.reset=function(){this.array=[],this.map=new Map,this._length=0},n.prototype.find=function(t){return this.map.has(t)},n.prototype.peek=function(){return this.array[this._length-1]},n}(),$o=function(){function n(t){this.tileset=t,this._canSelectTile=!0,this._loadAllTilesTraversalStack=new cn,this.root=null}return n.prototype.traverse=function(t,e,r){this.root=t,this.reset()},n.prototype.reset=function(){this._loadAllTilesTraversalStack.reset(),this.tileset.hasMixedContent=!1,this.tileset.needsRefinedTiles.clear(),this.tileset.requestedTiles.length=0,this.tileset.selectedTiles.length=0},n.prototype.updateTile=function(t,e){this.updateTileVisibility(t,e),t.state.shouldSelect=!1,t.state.finalResolution=!0},n.prototype.selectTile=function(t,e){var r=t.contentAvailable&&this._canSelectTile;r&&t.state.selectedFrameNumber<e.frameNumber&&(t.state.selectedFrameNumber=e.frameNumber,this.tileset.selectedTiles.push(t),this.tileset.needsRefinedTiles.add(t))},n.prototype.loadTile=function(t,e){t.state.requestedFrameNumber<e.frameNumber&&(t.state.requestedFrameNumber=e.frameNumber,t.content&&(t.content.loadState==="FAILED"&&e.time-t.content.loadStateUpdateTime>t.content.loadfailRetryDelay&&(t.content.loadState="UNLOADED",t.content.loadStateUpdateTime=e.time),t.content.loadState==="UNLOADED"&&this.tileset.requestedTiles.push(t))),this.tileset.needsRefinedTiles.add(t)},n.prototype.touchTile=function(t,e){this.tileset.cache.touchTile(t),t.state.touchedFrameNumber=e.frameNumber},n.prototype.canTraverse=function(t,e){return!t.state.inRequestVolume||t.levelOfContent>=e.maxLevelOfDetail||t.children.length===0?!1:t.levelOfContent<=e.minLevelOfDetail||t.hasTilesetContent?!0:t.state.screenSpaceError>this.tileset.maxScreenSpaceError},n.prototype.updateTileVisibility=function(t,e){if(t.updateState(e),!(!t.state.visible||!t.state.inRequestVolume)){var r=t.children.length>0;if(t.hasTilesetContent&&r){var i=t.children[0];this.updateTileVisibility(i,e),t.state.visible=i.state.visible;return}if(this.meetsScreenSpaceErrorEarly(t,e)){t.state.visible=!1;return}var a=t.refine==="REPLACE";if(a&&r&&!this.anyChildrenVisible(t,e)){t.state.visible=!1;return}}},n.prototype.anyChildrenVisible=function(t,e){for(var r=!1,i=t.children,a=0,o=i;a<o.length;a++){var s=o[a];s.updateState(e),r=r||s.state.visible}return r},n.prototype.meetsScreenSpaceErrorEarly=function(t,e){var r=t.parent;return!r||r.refine!=="ADD"||r.levelOfContent<e.minLevelOfDetail?!1:r.levelOfContent>e.maxLevelOfDetail?!0:t.getScreenSpaceError(e,t.state.distanceToCamera,!0)<this.tileset.maxScreenSpaceError},n.prototype.sortTilesByDistanceToCamera=function(t){t.sort(function(e,r){return r.state.distanceToCamera===0&&e.state.distanceToCamera===0?r.state.centerZDepth-e.state.centerZDepth:r.state.distanceToCamera-e.state.distanceToCamera})},n.prototype.loadAllTiles=function(t,e){var r=this._loadAllTilesTraversalStack;for(r.push(t);r.length>0;){var i=r.pop();i.content&&i.content.loadState==="UNLOADED"&&i.state.requestedFrameNumber<e.frameNumber&&this.tileset.requestedTiles.push(i),this.touchTile(i,e);for(var a=0,o=i.children;a<o.length;a++){var s=o[a];r.push(s)}}},n}(),Fd=function(n){ue(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r._traversalStack=new cn,r._emptyTraversalStack=new cn,r}return t.prototype.traverse=function(e,r,i){i===void 0&&(i=[]),n.prototype.traverse.call(this,e,r,i);for(var a=0,o=i;a<o.length;a++){var s=o[a];this._traversalStack.reset(),this._emptyTraversalStack.reset(),s.camera.refine&&(this._canSelectTile=s.camera.visible,this.updateTile(e,s),this.executeTraversal(e,s))}this._traversalStack.reset(),this._emptyTraversalStack.reset(),r.camera.refine&&(this._canSelectTile=r.camera.visible,this.updateTile(e,r),this.executeTraversal(e,r)),this.tileset.loadAll&&this.loadAllTiles(e,r)},t.prototype.reset=function(){n.prototype.reset.call(this),this._traversalStack.reset(),this._emptyTraversalStack.reset()},t.prototype.executeTraversal=function(e,r){var i=this._traversalStack;for(e.state.visible&&e.state.inRequestVolume&&i.push(e);i.length>0;){var a=i.pop(),o=a.parent,s=!o||o.state.shouldRefine,u=!1;this.canTraverse(a,r)&&(u=this.updateAndPushChildren(a,r,i)&&s);var l=!u&&s;a.hasRenderContent?a.refine==="ADD"?(this.loadTile(a,r),this.selectDesiredTile(a,r)):a.refine==="REPLACE"&&(this.loadTile(a,r),l&&this.selectDesiredTile(a,r)):(this.loadTile(a,r),l&&this.selectDesiredTile(a,r)),this.touchTile(a,r),a.state.shouldRefine=u}},t.prototype.updateAndPushChildren=function(e,r,i){for(var a=e.children,o=0,s=a;o<s.length;o++){var u=s[o];this.updateTile(u,r)}this.sortTilesByDistanceToCamera(a);for(var l=e.refine==="REPLACE"&&e.hasRenderContent,c=!1,d=!0,p=0,A=a;p<A.length;p++){var u=A[p];if(u.levelOfContent<=r.minLevelOfDetail||u.state.visible&&u.state.inRequestVolume?(i.find(u)&&i.delete(u),i.push(u),c===!1&&(c=!0)):(l||this.tileset.loadSiblings)&&(this.loadTile(u,r),this.touchTile(u,r)),l){var h=void 0;u.state.inRequestVolume?u.hasRenderContent?h=u.contentAvailable:h=this.executeEmptyTraversal(u,r):h=!1,d=d&&h}}return c||(d=!1),d},t.prototype.selectDesiredTile=function(e,r){e.contentAvailable&&n.prototype.selectTile.call(this,e,r)},t.prototype.executeEmptyTraversal=function(e,r){var i=!0,a=this._emptyTraversalStack;for(a.push(e);a.length>0&&i;){var o=a.pop(),s=!o.hasRenderContent&&this.canTraverse(o,r);if(!s&&!o.contentAvailable&&(i=!1),this.updateTile(o,r),o.state.visible||(this.loadTile(o,r),this.touchTile(o,r)),s)for(var u=o.children,l=0,c=u;l<c.length;l++){var d=c[l];a.find(d)&&a.delete(d),a.push(d)}}return i},t}($o),Ld=function(n){ue(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r.baseScreenSpaceError=1024,r.skipScreenSpaceErrorFactor=16,r.skipLevels=1,r._traversalStack=new cn,r._descendantTraversalStack=new cn,r._selectionTraversalStack=new cn,r._selectionTraversalancestorStack=new cn,r}return t.prototype.traverse=function(e,r,i){i===void 0&&(i=[]),n.prototype.traverse.call(this,e,r,i);for(var a=0,o=i;a<o.length;a++){var s=o[a];this._traversalStack.reset(),s.camera.refine&&(this._canSelectTile=s.camera.visible,this.updateTile(e,s),this.executeTraversal(e,s),this.traverseAndSelect(e,s))}this.tileset.hasMixedContent=!1,this._traversalStack.reset(),this._descendantTraversalStack.reset(),this._selectionTraversalStack.reset(),this._selectionTraversalancestorStack.reset(),r.camera.refine&&(this._canSelectTile=r.camera.visible,this.updateTile(e,r),this.executeTraversal(e,r),this.traverseAndSelect(e,r)),this.tileset.loadAll&&this.loadAllTiles(e,r)},t.prototype.reset=function(){n.prototype.reset.call(this),this._traversalStack.reset(),this._descendantTraversalStack.reset(),this._selectionTraversalStack.reset(),this._selectionTraversalancestorStack.reset()},t.prototype.executeTraversal=function(e,r){var i=this._traversalStack;for(e.state.visible&&e.state.inRequestVolume&&i.push(e);i.length>0;){var a=i.pop();this.updateTileAncestorContentLinks(a,r);var o=a.parent,s=!o||o.state.shouldRefine,u=!1;this.canTraverse(a,r)&&(u=this.updateAndPushChildren(a,r,i)&&s);var l=!u&&s;a.hasRenderContent?a.refine==="ADD"?(this.loadTile(a,r),this.selectDesiredTile(a,r)):a.refine==="REPLACE"&&(this.inBaseTraversal(a,this.baseScreenSpaceError)?(this.loadTile(a,r),l&&this.selectDesiredTile(a,r)):l?(this.loadTile(a,r),this.selectDesiredTile(a,r)):this.reachedSkippingThreshold(a)&&this.loadTile(a,r)):(this.loadTile(a,r),l&&this.selectDesiredTile(a,r)),this.touchTile(a,r),a.state.shouldRefine=u}},t.prototype.updateAndPushChildren=function(e,r,i){for(var a=e.children,o=0,s=a;o<s.length;o++){var u=s[o];this.updateTile(u,r)}this.sortTilesByDistanceToCamera(a);for(var l=!1,c=0,d=a;c<d.length;c++){var u=d[c];u.levelOfContent<=r.minLevelOfDetail||u.state.visible&&u.state.inRequestVolume?(i.push(u),l===!1&&(l=!0)):this.tileset.loadSiblings&&(this.loadTile(u,r),this.touchTile(u,r))}return l},t.prototype.selectDesiredTile=function(e,r){var i=e.contentAvailable?e:e.state.ancestorWithContentAvailable;i&&(i.state.shouldSelect=!0),e.contentAvailable||this.selectDescendants(e,r)},t.prototype.selectDescendants=function(e,r){var i=this._descendantTraversalStack;for(i.push(e);i.length>0;)for(var a=i.pop(),o=a.children,s=0,u=o;s<u.length;s++){var l=u[s];l.state.visible&&(l.contentAvailable?(this.updateTile(l,r),this.touchTile(l,r),this.selectTile(l,r)):i.push(l))}},t.prototype.reachedSkippingThreshold=function(e){var r=e.state.ancestorWithContent,i=r!==null&&e.state.screenSpaceError<r.state.screenSpaceError/this.skipScreenSpaceErrorFactor&&e.levelOfContent>r.levelOfContent+this.skipLevels;return i},t.prototype.updateTileAncestorContentLinks=function(e,r){e.state.ancestorWithContent=null,e.state.ancestorWithContentAvailable=null;var i=e.parent;if(i){var a=!(i.hasRenderContent&&i.hasUnloadedContent)||i.state.requestedFrameNumber===r.frameNumber;e.state.ancestorWithContent=a?i:i.state.ancestorWithContent,e.state.ancestorWithContentAvailable=i.contentAvailable?i:i.state.ancestorWithContentAvailable}},t.prototype.inBaseTraversal=function(e,r){return e.state.ancestorWithContent?e.parent&&e.state.screenSpaceError===0?e.parent.state.screenSpaceError>r:e.state.screenSpaceError>r:!0},t.prototype.traverseAndSelect=function(e,r){var i=this._selectionTraversalStack,a=this._selectionTraversalancestorStack,o;for(i.push(e);i.length>0||a.length>0;){if(a.length>0){var s=a.peek();if(s.state.stackLength===i.length){a.pop(),s!==o&&(s.state.finalResolution=!1),this.selectTile(s,r);continue}}var u=i.pop();if(u){var l=this.canTraverse(u,r);if(u.state.shouldSelect)if(u.refine==="ADD")this.selectTile(u,r);else{if(u.state.selectionDepth=a.length,u.state.selectionDepth>0&&(u.tileset.hasMixedContent=!0),o=u,!l){this.selectTile(u,r);continue}a.push(u),u.state.stackLength=i.length}if(l)for(var c=0,d=u.children;c<d.length;c++){var p=d[c];p.state.visible&&i.push(p)}}}},t}($o),kd=function(n){ue(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r._traversalStack=new cn,r}return t.prototype.canTraverse=function(e,r){return!(!e.state.inRequestVolume||e.levelOfContent>=r.maxLevelOfDetail||e.children.length===0)},t.prototype.traverse=function(e,r,i){n.prototype.traverse.call(this,e,r,[]),this._traversalStack.reset(),e.updateState(r);for(var a=0,o=i;a<o.length;a++){var s=o[a];this._traversalStack.reset(),s.camera.refine&&(this._canSelectTile=s.camera.visible,e.updateState(s),this.executeTraversal(e,s))}this._traversalStack.reset(),r.camera.refine&&(this._canSelectTile=r.camera.visible,e.updateState(r),this.executeTraversal(e,r)),this.tileset.loadAll&&this.loadAllTiles(e,r)},t.prototype.reset=function(){n.prototype.reset.call(this),this._traversalStack.reset()},t.prototype.executeTraversal=function(e,r){var i=this._traversalStack;for(i.push(e);i.length>0;){var a=i.pop(),o=a.refine==="ADD",s=a.refine==="REPLACE",u=this.canTraverse(a,r);u&&this.updateAndPushChildren(a,r,i),(o||s&&!u)&&(this.loadTile(a,r),this.touchTile(a,r),this.selectDesiredTile(a,r))}},t.prototype.updateAndPushChildren=function(e,r,i){for(var a=e.children,o=0;o<a.length;++o){var s=a[o];s.updateState(r),s.state.visible&&i.push(s)}},t.prototype.selectDesiredTile=function(e,r){e.contentAvailable&&n.prototype.selectTile.call(this,e,r)},t}($o),Ru=function(){function n(t,e,r){this.index=t,this.name=e.name,this.visible=!1,this.tileset=r,this.transform=new f.Matrix4,e.transform&&this.transform.fromArray(e.transform),this.transform.premultiply(this.tileset.root.transform),this.content={uri:e.file,byteLength:0,loadState:"UNLOADED",loadStateUpdateTime:ve(),loadfailRetryDelay:0,data:void 0}}return n}(),Od=new f.Matrix4,zr=function(){function n(t,e,r){var i=this,a,o,s,u,l,c,d,p,A;if(this.id=t,this.transform=new f.Matrix4,this.transformIsIdentity=!0,this.hasMixedContent=!1,this.url=(a=r.url)!==null&&a!==void 0?a:"",this.referer=(o=r.referer)!==null&&o!==void 0?o:"",this.asset={version:e.asset.version,tilesetVersion:e.asset.tilesetVersion||"",gltfUpAxis:(s=e.asset.gltfUpAxis)!==null&&s!==void 0?s:"Y",overview:e.asset.overview,trajectories:(l=(u=e.asset.trajectories)===null||u===void 0?void 0:u.list)!==null&&l!==void 0?l:[],extras:e.asset.extras},this.rootMeta=(c=e.rootMeta)!==null&&c!==void 0?c:{},this.pointLength=(d=this.rootMeta.numTotalPoints)!==null&&d!==void 0?d:1/0,this.floorLength=(p=this.rootMeta.numFloors)!==null&&p!==void 0?p:1,this.properties=(A=e.properties)!==null&&A!==void 0?A:{},this.options=r,this.maxMemoryUsage=n.DEFAULT_MAX_MEMORY_USAGE,this.maxScreenSpaceError=n.DEFAULT_MAX_SCREEN_SPACE_ERROR,this.skipLevelOfDetail=n.DEFAULT_SKIP_LEVEL_OF_DETAIL,this.mostDetail=n.DEFAULT_MOST_DETAIL,this.loadSiblings=n.DEFAULT_LOAD_SIBLINGS,this.loadAll=n.DEFAULT_LOAD_ALL,this.maxRequests=n.DEFAULT_MAX_REQUESTS,this.tileRequestOrder=n.DEFAULT_REQUEST_ORDER,this.requestedTiles=[],this.selectedTiles=[],this.unloadTiles=[],this.needsRefinedTiles=new Set,this.selectedTrajectories=[],this.normalTraverser=new Fd(this),this.skipTraverser=new Ld(this),this.mostDetailTraverser=new kd(this),this.cache=new Pu({onTileLoad:function(g){i.memoryUsageInBytes+=g.contentByteLength},onTileUnload:function(g){i.memoryUsageInBytes-=g.contentByteLength,i.unloadTiles.push(g)}}),this.requestScheduler=new Tu(this,{onTileSkip:function(g){},onTileLoad:function(g){var m;!((m=g.content)===null||m===void 0)&&m.data&&(i.loadedTiles.add(g),i.cache.loadTile(g)),i.options.onTileLoad(g)},onTileError:function(g,m){i.options.onTileError(g,m)}}),this.frameNumber=0,this.maxLevelOfDetail=0,this.minLevelOfDetail=0,this.loadedTiles=new Set,this.memoryUsageInBytes=0,this.root=new Yo("".concat(this.id,".0"),e.root,this),this.geometricError=e.geometricError,this.trajectories=[],this.asset.trajectories)for(var h=0;h<this.asset.trajectories.length;h++){var v=new Ru(h,this.asset.trajectories[h],this);this.trajectories.push(v)}}return Object.defineProperty(n.prototype,"traverser",{get:function(){return this.mostDetail?this.mostDetailTraverser:this.skipLevelOfDetail?this.skipTraverser:this.normalTraverser},enumerable:!1,configurable:!0}),n.prototype.reset=function(){for(var t=this,e=[this.root],r;r=e.pop();){for(var i=0,a=r.children.length;i<a;i++)e.push(r.children[i]);this.cache.unloadTile(r)}for(var o=function(){var c=s.unloadTiles.pop();c&&(s.loadedTiles.delete(c),s.memoryUsageInBytes-=c.contentByteLength,s.options.tileUnloader(c).catch(function(){}).then(function(){t.options.onTileUnload&&t.options.onTileUnload(c)}))},s=this;this.unloadTiles.length;)o();this.cache.reset(),this.traverser.reset(),this.requestScheduler.reset(),this.loadedTiles.clear();for(var u=function(){var c=l.trajectories.pop();c&&l.options.trajectoryUnloader(c).catch(function(){}).then(function(){t.options.onTrajectoryUnload&&t.options.onTrajectoryUnload(c)})},l=this;this.trajectories.length;)u()},n.prototype.update=function(t,e){var r=this,i;e===void 0&&(e=[]),this.frameNumber=t.frameNumber,this.minLevelOfDetail=t.minLevelOfDetail,this.maxLevelOfDetail=t.maxLevelOfDetail,this.transformIsIdentity=this.transform.equals(Od),this.traverser.traverse(this.root,t,e),this.cache.unloadTiles(function(){var p=r.memoryUsageInBytes>r.maxMemoryUsage*1024*1024;return p}),this.requestScheduler.update(this.requestedTiles,this.tileRequestOrder,t);for(var a=function(){var p=o.unloadTiles.pop();p&&(o.loadedTiles.delete(p),o.options.tileUnloader(p).catch(function(){}).then(function(){r.options.onTileUnload&&r.options.onTileUnload(p)}))},o=this;this.unloadTiles.length;)a();this.selectedTrajectories.length=0;for(var s=function(p){p.visible===!0&&p.content.loadState==="READY"&&(!((i=p.content.data)===null||i===void 0)&&i.object)?u.selectedTrajectories.push(p):p.visible===!0&&(p.content.loadState==="FAILED"&&t.time-p.content.loadStateUpdateTime>p.content.loadfailRetryDelay&&(p.content.loadState="UNLOADED",p.content.loadStateUpdateTime=t.time),p.content.loadState==="UNLOADED"&&u.options.trajectoryLoader(p).then(function(){r.options.onTrajectoryLoad(p)}).catch(function(A){r.options.onTrajectoryError(p,A)}))},u=this,l=0,c=this.trajectories;l<c.length;l++){var d=c[l];s(d)}},n.DEFAULT_MAX_MEMORY_USAGE=16,n.DEFAULT_MAX_SCREEN_SPACE_ERROR=4,n.DEFAULT_SKIP_LEVEL_OF_DETAIL=!1,n.DEFAULT_MOST_DETAIL=!1,n.DEFAULT_LOAD_SIBLINGS=!1,n.DEFAULT_LOAD_ALL=!1,n.DEFAULT_MAX_REQUESTS=6,n.DEFAULT_REQUEST_ORDER="SCREEN_SPACE_ERROR",n}(),Bu=function(){function n(t,e){this.position=t,this.indices=e}return n.prototype.getPositionCount=function(){var t,e,r=this.indices,i=this.position;return r?r.array.length/((t=r.stride)!==null&&t!==void 0?t:1):i.array.length/((e=i.stride)!==null&&e!==void 0?e:3)},n.prototype.getPositionByIndex=function(t,e){var r,i,a,o,s=this.indices,u=this.position,l=t;if(s){var c=s.array,d=(r=s.stride)!==null&&r!==void 0?r:1,p=(i=s.offset)!==null&&i!==void 0?i:0;l=c[t*d+p]}var A=u.array,h=(a=u.stride)!==null&&a!==void 0?a:3,v=(o=u.offset)!==null&&o!==void 0?o:0;return l=l*h+v,e.x=A[l],e.y=A[l+1],e.z=A[l+2],e},n.prototype.createTree=function(t,e,r){throw new Error("not implemented")},n.prototype.trianglesInSphere=function(t,e){throw new Error("not implemented")},n.prototype.intersectRay=function(t,e,r,i){throw new Error("not implemented")},n}(),Hn=function(){function n(t,e,r,i,a){this.id=t,this.extents=e,this.startIndex=r,this.endIndex=i,this.deepth=a}return n}(),qr=6*4+4+4+2+2;function Fu(n,t){for(var e=new ArrayBuffer(t*qr),r=new Float32Array(e),i=new Uint32Array(e),a=new Uint16Array(e),o=[n],s,u;s=o.pop();)u=s.id*qr/4,r[u]=s.extents[0],r[u+1]=s.extents[1],r[u+2]=s.extents[2],r[u+3]=s.extents[3],r[u+4]=s.extents[4],r[u+5]=s.extents[5],i[u+6]=s.startIndex,i[u+7]=s.endIndex,u=s.id*qr/2,s.node0&&(a[u+16]=s.node0.id,o.push(s.node0)),s.node1&&(a[u+17]=s.node1.id,o.push(s.node1));return e}function Lu(n,t,e,r,i,a,o,s,u){u===void 0&&(u=0),e=e-u,r=r-u,i=i-u,a=a+u,o=o+u,s=s+u;var l=0,c=0,d=0,p=0,A=0,h=0;return t.x>=0?(l=(e-n.x)*t.x,c=(a-n.x)*t.x):(l=(a-n.x)*t.x,c=(e-n.x)*t.x),t.y>=0?(d=(r-n.y)*t.y,p=(o-n.y)*t.y):(d=(o-n.y)*t.y,p=(r-n.y)*t.y),!(l>p||d>c||(d>l&&(l=d),p<c&&(c=p),t.z>=0?(A=(i-n.z)*t.z,h=(s-n.z)*t.z):(A=(s-n.z)*t.z,h=(i-n.z)*t.z),l>h||A>c)||(A>l&&(l=A),h<c&&(c=h),c<0))}var Pn=function(){function n(t,e,r){this.x=t,this.y=e,this.z=r}return n.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},n.prototype.set=function(t,e,r){return this.x=t,this.y=e,this.z=r,this},n.prototype.fromArray=function(t,e){return e===void 0&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},n.prototype.toArray=function(t,e){return t===void 0&&(t=[]),e===void 0&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},n.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this},n.prototype.multiplyScalar=function(t){return this.x*=t,this.y*=t,this.z*=t,this},n.prototype.subVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},n.prototype.addScaledVector=function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},n.prototype.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z},n.prototype.cross=function(t){var e=this.x,r=this.y,i=this.z;return this.x=r*t.z-i*t.y,this.y=i*t.x-e*t.z,this.z=e*t.y-r*t.x,this},n.prototype.crossVectors=function(t,e){var r=t.x,i=t.y,a=t.z,o=e.x,s=e.y,u=e.z;return this.x=i*u-a*s,this.y=a*o-r*u,this.z=r*s-i*o,this},n.prototype.distanceTo=function(t){return Math.sqrt(this.distanceToSquared(t))},n.prototype.distanceToSquared=function(t){var e=this.x-t.x,r=this.y-t.y,i=this.z-t.z;return e*e+r*r+i*i},n.prototype.clone=function(){return new n(this.x,this.y,this.z)},n}(),ku=function(){function n(t,e,r){this.triangle=t,this.intersectionPoint=e,this.index=r}return n}(),Ks=1e-6,Je=new Pn(0,0,0),$r=new Pn(0,0,0),en=new Pn(0,0,0),tn=new Pn(0,0,0),Ou=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.createTree=function(e,r,i){r=Math.min(r,16);var a=this.getPositionCount()/3,o=a>65535?new Uint32Array(a):new Uint16Array(a),s=new Float32Array(a*6),u=[],l=0,c=-1;if(i)for(var d=0,p=0,A=0,h=void 0,v=void 0,g=void 0,m=void 0,y=void 0,b=void 0,x=void 0;d<a;d+=1,p+=3,A+=6)o[d]=d,this.getPositionByIndex(p,$r),this.getPositionByIndex(p+1,en),this.getPositionByIndex(p+2,tn),h=m=$r.x,x=en.x,x<h&&(h=x),x>m&&(m=x),x=tn.x,x<h&&(h=x),x>m&&(m=x),v=y=$r.y,x=en.y,x<v&&(v=x),x>y&&(y=x),x=tn.y,x<v&&(v=x),x>y&&(y=x),g=b=$r.z,x=en.z,x<g&&(g=x),x>b&&(b=x),x=tn.z,x<g&&(g=x),x>b&&(b=x),s[A]=h,s[A+1]=v,s[A+2]=g,s[A+3]=m,s[A+4]=y,s[A+5]=b;else{for(var w=1/0,M=1/0,S=1/0,E=-1/0,P=-1/0,B=-1/0,d=0,p=0,A=0,h=void 0,v=void 0,g=void 0,m=void 0,y=void 0,b=void 0,x=void 0;d<a;d+=1,p+=3,A+=6)o[d]=d,this.getPositionByIndex(p,$r),this.getPositionByIndex(p+1,en),this.getPositionByIndex(p+2,tn),h=m=$r.x,x=en.x,x<h&&(h=x),x>m&&(m=x),x=tn.x,x<h&&(h=x),x>m&&(m=x),v=y=$r.y,x=en.y,x<v&&(v=x),x>y&&(y=x),x=tn.y,x<v&&(v=x),x>y&&(y=x),g=b=$r.z,x=en.z,x<g&&(g=x),x>b&&(b=x),x=tn.z,x<g&&(g=x),x>b&&(b=x),s[A]=h,s[A+1]=v,s[A+2]=g,s[A+3]=m,s[A+4]=y,s[A+5]=b,h<w&&(w=h),m>E&&(E=m),v<M&&(M=v),y>P&&(P=y),g<S&&(S=g),b>B&&(B=b);i=[w,M,S,E,P,B]}var C=new Hn(++c,i,0,a,0);u[l++]=C;var I=[],F=[0,1,2],T=function(D,V){return I[V]-I[D]};function L(D){var V=D.startIndex,z=D.endIndex,U=D.extents;I[0]=U[3]-U[0],I[1]=U[4]-U[1],I[2]=U[5]-U[2],F.sort(T);for(var q=0;q<3;q++){for(var G=F[q],K=U[G]+U[G+3],_=V,J=z-1,W=-1,$=void 0;_<=J;)W===-1?($=o[_],s[$*6+G]+s[$*6+G+3]<K?_++:W=$):($=o[J],s[$*6+G]+s[$*6+G+3]>=K||(o[_]=$,o[J]=W,W=-1,_++),J--);if(_>V&&_<z){var Y=new Hn(++c,js(o,s,V,_,Ks),V,_,D.deepth+1);Y.deepth<r&&Y.endIndex-Y.startIndex>e&&(u[l++]=Y);var Z=new Hn(++c,js(o,s,_,z,Ks),_,z,D.deepth+1);Z.deepth<r&&Z.endIndex-Z.startIndex>e&&(u[l++]=Z),D.node0=Y,D.node1=Z,D.startIndex=0,D.endIndex=0;break}}}for(;l;)L(u[--l]);return this.offsetArray=o,this.rootNodePacked=Fu(C,c+1),u.length=0,this},t.prototype.trianglesInSphere=function(e,r){for(var i=this.offsetArray,a=this.rootNodePacked,o=new Float32Array(a),s=new Uint32Array(a),u=new Uint16Array(a),l=[0],c=[],d,p,A,h;(d=l.pop())!==void 0;){h=d*qr/4;var v=za(e.x,o[h],o[h+3])-e.x,g=za(e.y,o[h+1],o[h+4])-e.y,m=za(e.z,o[h+2],o[h+5])-e.z;if(v*v+g*g+m*m<=r*r){for(var y=s[h+6];y<s[h+7];y++)c.push(i[y]);h=d*qr/2,p=u[h+16],A=u[h+17],p&&l.push(p),A&&l.push(A)}}for(var b=c.length,x=new Float32Array(b*9),y=0;y<b;y++){var w=c[y];this.getPositionByIndex(w,Je),x[y*9]=Je.x,x[y*9+1]=Je.y,x[y*9+2]=Je.z,this.getPositionByIndex(w+1,Je),x[y*9+3]=Je.x,x[y*9+4]=Je.y,x[y*9+5]=Je.z,this.getPositionByIndex(w+2,Je),x[y*9+6]=Je.x,x[y*9+7]=Je.y,x[y*9+8]=Je.z}return x},t.prototype.intersectRay=function(e,r,i,a){for(var o=this.offsetArray,s=this.rootNodePacked,u=new Float32Array(s),l=new Uint32Array(s),c=new Uint16Array(s),d=new Pn(1/r.x,1/r.y,1/r.z),p=[0],A,h,v,g;(A=p.pop())!==void 0;)if(g=A*qr/4,Lu(e,d,u[g],u[g+1],u[g+2],u[g+3],u[g+4],u[g+5])){for(var m=l[g+6],y=l[g+7],b=void 0,x=void 0,w=void 0,M=e.x,S=e.y,E=e.z,P=r.x,B=r.y,C=r.z,I=void 0,F=void 0,T=void 0,L=void 0,D=void 0,V=void 0,z=void 0,U=void 0,q=void 0,G=void 0,K=void 0,_=void 0,J=void 0,W=void 0,$=void 0,Y=void 0,Z=void 0,oe=void 0,ne=void 0,de=void 0,se=void 0,ye=void 0,ie=void 0,xe=void 0,Le=void 0,Ce=void 0,Oe=void 0;m<y;m++){if(b=o[m],x=b*3,this.getPositionByIndex(x,Je),I=Je.x,F=Je.y,T=Je.z,this.getPositionByIndex(x+1,Je),L=Je.x,D=Je.y,V=Je.z,this.getPositionByIndex(x+2,Je),z=Je.x,U=Je.y,q=Je.z,G=L-I,K=D-F,_=V-T,J=z-I,W=U-F,$=q-T,Y=K*$-_*W,Z=_*J-G*$,oe=G*W-K*J,ie=P*Y+B*Z+C*oe,ie>0)ye=1;else if(ie<0)ye=-1,ie=-ie;else continue;ne=M-I,de=S-F,se=E-T,xe=ye*(P*(de*$-se*W)+B*(se*J-ne*$)+C*(ne*W-de*J)),!(xe<0)&&(Le=ye*(P*(K*se-_*de)+B*(_*ne-G*se)+C*(G*de-K*ne)),!(Le<0)&&(xe+Le>ie||(Ce=-ye*(ne*Y+de*Z+se*oe),!(Ce<0)&&(Oe=Ce/ie,a.push(new ku([I,F,T,L,D,V,z,U,q],[M+P*Oe,S+B*Oe,E+C*Oe],b))))))}g=A*qr/2,h=c[g+16],v=c[g+17],h&&p.push(h),v&&p.push(v)}return a},t}(Bu);function za(n,t,e){return n<t?t:n>e?e:n}function js(n,t,e,r,i){if(e>=r)return[0,0,0,0,0,0];for(var a=1/0,o=1/0,s=1/0,u=-1/0,l=-1/0,c=-1/0,d=e,p=void 0,A=void 0;d<r;d++)p=n[d]*6,A=t[p],A<a&&(a=A),A=t[p+1],A<o&&(o=A),A=t[p+2],A<s&&(s=A),A=t[p+3],A>u&&(u=A),A=t[p+4],A>l&&(l=A),A=t[p+5],A>c&&(c=A);return[a-i,o-i,s-i,u+i,l+i,c+i]}var _s=1e-6,Dd=["x","y","z"],xt=new Pn(0,0,0),Du=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.createTree=function(e,r,i){r=Math.min(r,16);var a=this.getPositionByIndex.bind(this),o=this.getPositionCount(),s=o>65535?new Uint32Array(o):new Uint16Array(o),u=[],l=0,c=-1;if(i)for(var d=0;d<o;d+=1)s[d]=d;else{a(0,xt);for(var p=xt.x,A=xt.y,h=xt.z,v=p,g=A,m=h,d=0,y=void 0,b=void 0,x=void 0;d<o;d+=1)s[d]=d,a(d,xt),y=xt.x,b=xt.y,x=xt.z,y<p?p=y:y>v&&(v=y),b<A?A=b:b>g&&(g=b),x<h?h=x:x>m&&(m=x);i=[p,A,h,v,g,m]}var w=new Hn(++c,i,0,o,0);u[l++]=w;var M=[],S=[0,1,2],E=function(B,C){return M[C]-M[B]};function P(B){var C=B.startIndex,I=B.endIndex,F=B.extents;M[0]=F[3]-F[0],M[1]=F[4]-F[1],M[2]=F[5]-F[2];for(var T=S.sort(E)[0],L=Dd[T],D=(F[T]+F[T+3])/2,V=C,z=I-1,U=-1,q;V<=z;)U===-1?(q=s[V],a(q,xt),xt[L]<D?V++:U=q):(q=s[z],a(q,xt),xt[L]>=D||(s[V]=q,s[z]=U,U=-1,V++),z--);if(V>C){var G=F.slice();G[T+3]=D+_s;var K=new Hn(++c,G,C,V,B.deepth+1);K.deepth<r&&K.endIndex-K.startIndex>e&&(u[l++]=K),B.node0=K}if(I>V){var _=F.slice();_[T]=D-_s;var J=new Hn(++c,_,V,I,B.deepth+1);J.deepth<r&&J.endIndex-J.startIndex>e&&(u[l++]=J),B.node1=J}B.startIndex=0,B.endIndex=0}for(;l;)P(u[--l]);return this.offsetArray=s,this.rootNodePacked=Fu(w,c+1),u.length=0,this},t.prototype.intersectRay=function(e,r,i,a){for(var o=this.offsetArray,s=this.rootNodePacked,u=new Float32Array(s),l=new Uint32Array(s),c=new Uint16Array(s),d=i*i,p=new Pn(1/r.x,1/r.y,1/r.z),A=[0],h,v,g,m;(h=A.pop())!==void 0;)if(m=h*qr/4,Lu(e,p,u[m],u[m+1],u[m+2],u[m+3],u[m+4],u[m+5],i)){for(var y=l[m+6],b=l[m+7],x=void 0,w=void 0,M=void 0,S=void 0,E=void 0,P=void 0,B=void 0,C=void 0,I=void 0,F=void 0,T=void 0,L=void 0;y<b;y++)x=o[y],this.getPositionByIndex(x,xt),w=xt.x,M=xt.y,S=xt.z,E=e.x,P=e.y,B=e.z,C=r.x,I=r.y,F=r.z,T=C*(w-E)+I*(M-P)+F*(S-B),T>0&&(E+=C*T,P+=I*T,B+=F*T),C=w-E,I=M-P,F=S-B,T=C*C+I*I+F*F,T<=d&&a.push(new ku([w,M,S,w,M,S,w,M,S],[E,P,B],x));m=h*qr/2,v=c[m+16],g=c[m+17],v&&A.push(v),g&&A.push(g)}return a},t}(Bu);const Vu="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBlcj1mdW5jdGlvbihlLHIpe3JldHVybiBlcj1PYmplY3Quc2V0UHJvdG90eXBlT2Z8fHtfX3Byb3RvX186W119aW5zdGFuY2VvZiBBcnJheSYmZnVuY3Rpb24odCxvKXt0Ll9fcHJvdG9fXz1vfXx8ZnVuY3Rpb24odCxvKXtmb3IodmFyIGYgaW4gbylPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwobyxmKSYmKHRbZl09b1tmXSl9LGVyKGUscil9O2Z1bmN0aW9uIGhyKGUscil7aWYodHlwZW9mIHIhPSJmdW5jdGlvbiImJnIhPT1udWxsKXRocm93IG5ldyBUeXBlRXJyb3IoIkNsYXNzIGV4dGVuZHMgdmFsdWUgIitTdHJpbmcocikrIiBpcyBub3QgYSBjb25zdHJ1Y3RvciBvciBudWxsIik7ZXIoZSxyKTtmdW5jdGlvbiB0KCl7dGhpcy5jb25zdHJ1Y3Rvcj1lfWUucHJvdG90eXBlPXI9PT1udWxsP09iamVjdC5jcmVhdGUocik6KHQucHJvdG90eXBlPXIucHJvdG90eXBlLG5ldyB0KX10eXBlb2YgU3VwcHJlc3NlZEVycm9yPT0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nJheS5mcm9tKG8pfX0pfSl9KSgpOwo=",Vd=n=>Uint8Array.from(atob(n),t=>t.charCodeAt(0)),Js=typeof self!="undefined"&&self.Blob&&new Blob([Vd(Vu)],{type:"text/javascript;charset=utf-8"});function Nd(n){let t;try{if(t=Js&&(self.URL||self.webkitURL).createObjectURL(Js),!t)throw"";const e=new Worker(t,{name:n==null?void 0:n.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch(e){return new Worker("data:text/javascript;base64,"+Vu,{name:n==null?void 0:n.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var Nu=function(){function n(t,e){this.pool=e,this.workerCreator=t,this.queue=[],this.workers=[],this.workersResolver=[],this.workerStatus=0}return n.prototype.initWorker=function(t){if(this.workerCreator&&!this.workers[t]){var e=this.workerCreator();e.addEventListener("message",this.onMessage.bind(this,t)),this.workers[t]=e}},n.prototype.getIdleWorker=function(){for(var t=0;t<this.pool;t++)if(!(this.workerStatus&1<<t))return t;return-1},n.prototype.onMessage=function(t,e){var r=this.workersResolver[t],i=r.resolve,a=r.reject;if(e.data&&"$$error"in e.data?a(e.data.$$error):i(e.data),this.queue.length){var o=this.queue.shift(),s=o.resolve,u=o.reject,l=o.input,c=o.transfer;this.workersResolver[t]={resolve:s,reject:u},this.workers[t].postMessage(l,c)}else this.workerStatus^=1<<t},n.prototype.postMessage=function(t,e){var r=this;return e===void 0&&(e=[]),new Promise(function(i,a){var o=r.getIdleWorker();o!==-1?(r.initWorker(o),r.workerStatus|=1<<o,r.workersResolver[o]={resolve:i,reject:a},r.workers[o].postMessage(t,e)):r.queue.push({resolve:i,reject:a,input:t,transfer:e})})},n.prototype.dispose=function(){this.workers.forEach(function(t){return t.terminate()}),this.workersResolver.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0},n}(),zd=new Nu(function(){return new Nd},4),Qd=new Map,Gn=new f.Ray,Xs=new f.Matrix3,ci=new f.Matrix4,zu=new f.Vector3,Ud=new f.Vector3,qd=new f.Vector3,Hd=new f.Triangle;function Gd(n,t,e,r){var i,a=n.matrixWorld;ci.getInverse(a),Gn.copy(e.ray).applyMatrix4(ci);for(var o=t.intersectRay(Gn.origin,Gn.direction,0,[]),s=n.geometry,u=n.material,l=s.groups,c=s.index,d=0,p=o.length;d<p;d++){var A=o[d],h=A.triangle,v=A.index,g=A.intersectionPoint,m=new f.Vector3(g[0],g[1],g[2]).applyMatrix4(a),y=e.ray.origin.distanceTo(m);if(!(y<e.near||y>e.far)){var b=void 0;if(Array.isArray(u)){if(l)for(var x=v*3,w=0,M=l;w<M.length;w++){var S=M[w];if(x>=S.start&&x-S.start<S.count){b=u[(i=S.materialIndex)!==null&&i!==void 0?i:0];break}}}else b=u;if(b){var E=Hd.set(zu.set(h[0],h[1],h[2]).applyMatrix4(a),Ud.set(h[3],h[4],h[5]).applyMatrix4(a),qd.set(h[6],h[7],h[8]).applyMatrix4(a)).getNormal(new f.Vector3),P=v*3,B=new f.Face3(c?c.array[P]:P,c?c.array[P+1]:P+1,c?c.array[P+2]:P+2,E),C=e.ray.direction.dot(E);b.side===f.FrontSide&&C>=0||b.side===f.BackSide&&C<=0||r.push({distance:y,object:n,face:B,point:m,distanceToRay:0,faceIndex:v})}}}}function Kd(n,t,e,r){var i,a,o=n.matrixWorld;Xs.getNormalMatrix(o),ci.getInverse(o);var s=((a=(i=e.params.Points)===null||i===void 0?void 0:i.threshold)!==null&&a!==void 0?a:1)*ci.getMaxScaleOnAxis();Gn.copy(e.ray).applyMatrix4(ci);for(var u=t.intersectRay(Gn.origin,Gn.direction,s,[]),l=n.geometry,c=l.index,d=l.getAttribute("normal"),p=0,A=u.length;p<A;p++){var h=u[p],v=h.triangle,g=h.index,m=h.intersectionPoint,y=new f.Vector3(m[0],m[1],m[2]).applyMatrix4(o),b=e.ray.origin.distanceTo(y);if(!(b<e.near||b>e.far)){var x=zu.set(v[0],v[1],v[2]).applyMatrix4(o),w=c?c.array[g]:g,M=void 0;if(d instanceof f.BufferAttribute){var S=new f.Vector3().fromBufferAttribute(d,w).applyNormalMatrix(Xs);M=new f.Face3(w,w,w,S)}r.push({distance:b,object:n,face:M,point:y,distanceToRay:y.distanceTo(x),index:g})}}}var Qu="__bvh_mesh__",jd=f.Mesh.prototype.raycast;function _d(n,t){var e=Jd(this);e?Gd(this,e,n,t):jd.call(this,n,t)}function Jd(n){var t=n[Qu];return t instanceof Ou,t}function Xd(n,t){var e;Object.assign(n,(e={},e[Qu]=t,e.raycast=_d,e))}var Uu="__bvh_points__",Wd=f.Points.prototype.raycast;function Zd(n,t){var e=Yd(this);e?Kd(this,e,n,t):Wd.call(this,n,t)}function Yd(n){var t=n[Uu];return t instanceof Du,t}function $d(n,t){var e;Object.assign(n,(e={},e[Uu]=t,e.raycast=Zd,e))}function eh(n,t,e,r){var i=[];return n.traverse(function(a){(a instanceof f.Mesh||a instanceof f.Points)&&a.geometry instanceof f.BufferGeometry&&i.push(a)}),Promise.resolve().then(function(){for(var a=[],o=new Set,s=null,u=0;u<i.length;u++){var l=i[u],c=l.geometry;if(c instanceof f.BufferGeometry){var d=void 0;if(l instanceof f.Mesh?d="mesh":l instanceof f.Points&&(d="points"),!!d){var p=c.boundingBox,A=p?[p.min.x,p.min.y,p.min.z,p.max.x,p.max.y,p.max.z]:void 0,h={};for(var v in c.attributes){var g=c.attributes[v];g instanceof f.InterleavedBufferAttribute?(h[v]={array:g.data.array,stride:g.data.stride,offset:g.offset},s=g.data.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer)):(h[v]={array:g.array},s=g.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer))}var m=void 0,y=c.getIndex();y&&(y instanceof f.InterleavedBufferAttribute?(m={array:y.data.array,stride:y.data.stride,offset:y.offset},s=y.data.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer)):(m={array:y.array},s=y.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer)));var b={type:d,attributes:h,indices:m,maxItemPerNode:e,maxTreeDepth:r,extents:A};a.push(b)}}}return zd.postMessage(a,Array.from(o))}).then(function(a){for(var o=0;o<i.length;o++){var s=i[o],u=s.geometry,l=a[o];if(u instanceof f.BufferGeometry){for(var c in l.attributes){var d=l.attributes[c].array,p=u.attributes[c];p instanceof f.InterleavedBufferAttribute?p.data.array=d:p.array=d}var A=u.getIndex();if(A&&l.indices){var d=l.indices.array;A instanceof f.InterleavedBufferAttribute?A.data.array=d:A.array=d}if(s instanceof f.Mesh){var h=new Ou(l.attributes.position,l.indices);h.offsetArray=l.offsetArray,h.rootNodePacked=l.rootNodePacked,Xd(s,h)}else if(s instanceof f.Points){var h=new Du(l.attributes.position,l.indices);h.offsetArray=l.offsetArray,h.rootNodePacked=l.rootNodePacked,$d(s,h)}}}return n})}var qu=function(n){ue(t,n);function t(e,r,i){i===void 0&&(i=Q);var a=n.call(this)||this;return a.contentObject=r,a.name=e,a.materials=[],a.pbmObjects=[],a.disposers=[i],a.add(r),r.traverse(function(o){var s;if(o instanceof f.Mesh||o instanceof f.Points){var u=o.material;Array.isArray(u)?(s=a.materials).push.apply(s,u):a.materials.push(u)}(o instanceof Ot||o instanceof yr)&&a.pbmObjects.push(o)}),a}return t.prototype.generateBvhTree=function(){return eh(this,!0,200,10)},t.prototype.intersectRaycaster=function(e,r,i){r===void 0&&(r=!0),i===void 0&&(i=[]);for(var a=this.children.slice(),o,s=[];o=a.pop();)if(o.visible){o.raycast(e,s);for(var u=0,l=o.children.length;u<l;u++)a.push(o.children[u])}return s.forEach(function(c){var d=0;if((c.object instanceof Ot||c.object instanceof yr)&&c.face){var p=Array.isArray(c.object.material)?c.object.material[c.face.materialIndex]:c.object.material;p&&(d=p.floor)}c.floor=d}),r&&s.sort(function(c,d){return c.distance-d.distance}),i.push.apply(i,s),i},t.prototype.update=function(e,r,i,a){for(var o=0,s=this.pbmObjects;o<s.length;o++){var u=s[o];u.update(e,r,i,a)}},t.prototype.dispose=function(){for(var e=0,r=this.disposers;e<r.length;e++){var i=r[e];i()}this.disposers.length=0,this.pbmObjects.length=0},t.prototype.clone=function(){return new t(this.name,this.contentObject.clone())},t}(f.Object3D);function st(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=[];n=n.map(function(s){return(s!=null?s:"").trim()}).filter(function(s){return s.length>0&&!/^\/+$/.test(s)});for(var r=0;r<n.length;r++){var i=r===0,a=r===n.length-1,o=n[r];i||(o=o.replace(/^\.\//,"").replace(/^\/+/,"")),a||(o=o.replace(/\/+$/,"")),e.push(o)}return e.join("/")}function Xi(n){var t,e=/^(http\:|https\:|file\:)?\/\/[^/]/.exec(n);if(!e)return n;var r=e[1]||"",i=n.slice(r.length+2),a=i.indexOf("#");a>=0&&(n.slice(a),i=n.slice(0,a));var o=i.indexOf("?");o>=0&&(n.slice(o),i=n.slice(0,o));for(var s=i.split("/"),u=s.shift(),l=(t=s.pop())!==null&&t!==void 0?t:"",c=[],d=0,p=s;d<p.length;d++){var A=p[d];if(!(A===""||A===".")){if(A===".."){c.pop();continue}c.push(A)}}return r+"//"+u+"/"+c.join("/")+"/"+l}function Gr(n){return n.indexOf("//")===0||/^[0-9a-z]+\:/i.test(n)}function Hu(n,t,e){var r;if(n.content){var i=(r=n.content.uri)!==null&&r!==void 0?r:n.content.url;typeof i=="string"&&!Gr(i)&&(n.content.uri=Xi(st(t,i)))}if(n.transform){for(var a=!1,o=0;o<16;o++){var s=n.transform[o];if(typeof s!="number"||isNaN(s)||!isFinite(s)){a=!0;break}}if(n.transform[15]===0&&(a=!0),a)throw new Error("Invalid Tile Transform: "+JSON.stringify(n.transform))}if(n.children)for(var u=0,l=n.children;u<l.length;u++){var c=l[u];Hu(c,t)}return n}function Wi(n,t){if(n.asset||(n.asset={}),n.rootMeta||(n.rootMeta={}),n.rootMeta.taskParameters||(n.rootMeta.taskParameters={}),n.asset.overview){var e=n.asset.overview;Gr(e.imageFile)||(e.imageFile=Xi(st(t,e.imageFile))),Gr(e.worldFile)||(e.worldFile=Xi(st(t,e.worldFile)))}if(n.asset.trajectories)for(var r=0;r<n.asset.trajectories.list.length;r++){var i=n.asset.trajectories.list[r];i.file=Xi(st(t,i.file))}return Hu(n.root,t),n}function th(n,t,e){for(var r,i,a=Promise.resolve(),o=n.slice(),s=function(){for(var u=[],l=0,c=void 0;c=o.shift();){u.push(c);var d=((r=c.image)===null||r===void 0?void 0:r.width)*((i=c.image)===null||i===void 0?void 0:i.height);if(!isNaN(d)&&isFinite(d)&&(l+=d),l>=e)break}a=a.then(function(){return new Promise(function(p){Mt.shared.add(function(){for(var A=0,h=u;A<h.length;A++){var v=h[A];t.initTexture(v)}p()},!0)})}).catch(function(){})};o.length>0;)s();return a}function ga(n,t){if(t===void 0&&(t=""),(t[0]==="?"||t[0]==="&")&&(t=t.slice(1)),!t)return n;var e=n.indexOf("#"),r="";return e>=0&&(r=n.slice(e),n=n.slice(0,e)),(n[n.length-1]==="?"||n[n.length-1]==="&")&&(n=n.slice(0,-1)),n.indexOf("?")>=0?"".concat(n,"&").concat(t).concat(r):"".concat(n,"?").concat(t).concat(r)}var Qa=4;function Gu(n,t,e){var r=new DataView(t);if(n.magic=r.getUint32(e,!0),e+=Qa,n.version=r.getUint32(e,!0),e+=Qa,n.byteLength=r.getUint32(e,!0),e+=Qa,n.version!==1)throw new Error("3D Tile Version ".concat(n.version," not supported"));return e}var Cr,at;(function(n){n[n.BYTE=5120]="BYTE",n[n.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",n[n.SHORT=5122]="SHORT",n[n.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",n[n.INT=5124]="INT",n[n.UNSIGNED_INT=5125]="UNSIGNED_INT",n[n.FLOAT=5126]="FLOAT",n[n.DOUBLE=5130]="DOUBLE"})(at||(at={}));var rh=(Cr={},Cr[at.DOUBLE]=Float64Array,Cr[at.FLOAT]=Float32Array,Cr[at.UNSIGNED_SHORT]=Uint16Array,Cr[at.UNSIGNED_INT]=Uint32Array,Cr[at.UNSIGNED_BYTE]=Uint8Array,Cr[at.BYTE]=Int8Array,Cr[at.SHORT]=Int16Array,Cr[at.INT]=Int32Array,Cr),nh={DOUBLE:at.DOUBLE,FLOAT:at.FLOAT,UNSIGNED_SHORT:at.UNSIGNED_SHORT,UNSIGNED_INT:at.UNSIGNED_INT,UNSIGNED_BYTE:at.UNSIGNED_BYTE,BYTE:at.BYTE,SHORT:at.SHORT,INT:at.INT};function ia(n){var t=rh[n];if(!t)throw new Error("Failed to convert GL type");return t}function Ua(n){var t=ia(n);return t.BYTES_PER_ELEMENT}function Ws(n,t,e,r){e===void 0&&(e=0);var i=ia(n);if(e%Ua(n)!==0){var a=r?t.slice(e,e+r*Ua(n)):t.slice(e);return new i(a)}else return new i(t,e,r!=null?r:(t.byteLength-e)/Ua(n))}function ih(n){var t=nh[n];if(!t)throw new Error("Failed to convert GL type");return t}var Ku=function(){function n(t,e){this.featuresLength=0,this.cachedTypedArrays={},this.json=t,this.buffer=e;var r=this.getGlobalProperty("POINTS_LENGTH",at.UNSIGNED_INT,1);r&&r.length&&(this.featuresLength=r[0])}return n.prototype.getExtension=function(t){return this.json.extensions&&this.json.extensions[t]},n.prototype.hasProperty=function(t){return!!this.json[t]},n.prototype.getGlobalProperty=function(t,e,r){var i=this.json[t];if(typeof i=="number"){var a=ia(e);return new a([i])}else if(Array.isArray(i)){var a=ia(e);return new a(i)}else if(i&&Number.isFinite(i.byteOffset))return this.getTypedArrayFromBinary(t,e,r,1,i.byteOffset);return null},n.prototype.getPropertyArray=function(t,e,r){var i=this.json[t];return i&&Number.isFinite(i.byteOffset)?("componentType"in i&&(e=ih(i.componentType)),this.getTypedArrayFromBinary(t,e,r,this.featuresLength,i.byteOffset)):this.getTypedArrayFromArray(t,e,i)},n.prototype.getProperty=function(t,e,r,i,a){var o=this.json[t];if(!o)return null;var s=this.getPropertyArray(t,e,r);if(r===1)return a[0]=s[i],a;for(var u=0;u<r;++u)a[u]=s[r*i+u];return a},n.prototype.getTypedArrayFromBinary=function(t,e,r,i,a){var o=this.cachedTypedArrays,s=o[t];return s||(s=Ws(e,this.buffer.buffer,this.buffer.byteOffset+a,i*r),o[t]=s),s},n.prototype.getTypedArrayFromArray=function(t,e,r){var i=this.cachedTypedArrays,a=i[t];return a||(a=Ws(e,r),i[t]=a),a},n}(),On=4,Zs="b3dm tile in legacy format.";function ju(n,t,e){var r=new TextDecoder("utf8"),i=new Uint8Array(n,t,e),a=r.decode(i);return a}function _u(n,t,e){return e=ah(n,t,e),e=oh(n,t,e),e=sh(n,t,e),e}function ah(n,t,e){var r=new DataView(t),i=0;n.header=n.header||{};var a=r.getUint32(e,!0);e+=On;var o=r.getUint32(e,!0);e+=On;var s=r.getUint32(e,!0);e+=On;var u=r.getUint32(e,!0);return e+=On,s>=570425344?(e-=On*2,i=a,s=o,u=0,a=0,o=0,console.warn(Zs)):u>=570425344&&(e-=On,i=s,s=a,u=o,a=0,o=0,console.warn(Zs)),n.header.featureTableJsonByteLength=a,n.header.featureTableBinaryByteLength=o,n.header.batchTableJsonByteLength=s,n.header.batchTableBinaryByteLength=u,n.header.batchLength=i,e}function oh(n,t,e){var r=n.header||{},i=r.featureTableJsonByteLength,a=r.featureTableBinaryByteLength,o=r.batchLength;if(n.featureTableJson={BATCH_LENGTH:o||0},i&&i>0){var s=ju(t,e,i);n.featureTableJson=JSON.parse(s)}e+=i||0,n.featureTableBinary=new Uint8Array(t,e,a),e+=a||0,n.rtcCenter=[0,0,0];var u=new Ku(n.featureTableJson,n.featureTableBinary);if(Array.isArray(u.json.RTC_CENTER)){var l=u.json.RTC_CENTER;n.rtcCenter[0]=l[0],n.rtcCenter[1]=l[1],n.rtcCenter[2]=l[2]}else{var l=u.getGlobalProperty("RTC_CENTER",at.FLOAT,3);l&&(n.rtcCenter[0]=l[0],n.rtcCenter[1]=l[1],n.rtcCenter[2]=l[2])}return e}function sh(n,t,e){var r=n.header||{},i=r.batchTableJsonByteLength,a=r.batchTableBinaryByteLength;if(i&&i>0){var o=ju(t,e,i);n.batchTableJson=JSON.parse(o),e+=i,a&&a>0&&(n.batchTableBinary=new Uint8Array(t,e,a),n.batchTableBinary=new Uint8Array(n.batchTableBinary),e+=a)}return e}function uh(n,t,e){var r=e!==void 0?new Uint8Array(n).subarray(t,t+e):new Uint8Array(n).subarray(t),i=new Uint8Array(r);return i.buffer}function lh(n,t,e){var r=n.byteLength-e;if(r===0)throw new Error("glTF byte length must be greater than 0.");return e%4!==0&&console.warn("".concat(n.type,": embedded glb is not aligned to a 4-byte boundary.")),n.gltfArrayBuffer=uh(t,e,r),n.byteLength}function aa(n){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(n);for(var t="",e=0,r=n.length;e<r;e++)t+=String.fromCharCode(n[e]);try{return decodeURIComponent(escape(t))}catch(i){return t}}var Ue={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},ri={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},oa={9728:f.NearestFilter,9729:f.LinearFilter,9984:f.NearestMipmapNearestFilter,9985:f.LinearMipmapNearestFilter,9986:f.NearestMipmapLinearFilter,9987:f.LinearMipmapLinearFilter},sa={33071:f.ClampToEdgeWrapping,33648:f.MirroredRepeatWrapping,10497:f.RepeatWrapping},Ys={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Kt={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},rn={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},ch={CUBICSPLINE:void 0,LINEAR:f.InterpolateLinear,STEP:f.InterpolateDiscrete},Dr={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function Bt(n){var t=[];for(var e in n)t.push(n[e]);return t}function fh(n){var t=Array.from(n);return function(){for(var e=0,r=t;e<r.length;e++){var i=r[e];typeof i.dispose=="function"&&i.dispose(),typeof i.close=="function"&&i.close()}}}var dh=function(){function n(t,e,r){this.json=t,this.extensions=e,this.options=r,this.cache=new Map,this.disposeSet=new Set,this.textureSet=new Set,this.nodeNamesUsed={}}return n.prototype.dispose=function(){this.cache.clear(),this.disposeSet.forEach(function(t){typeof t.dispose=="function"&&t.dispose(),typeof t.close=="function"&&t.close()}),this.disposeSet.clear(),this.textureSet.clear(),this.extensions={},this.json={asset:{version:"unknown"}}},n.prototype.markDefs=function(){for(var t=this.json.nodes||[],e=this.json.skins||[],r=this.json.meshes||[],i=0,a=e.length;i<a;i++)for(var o=e[i].joints,s=0,u=o.length;s<u;s++)t[o[s]].isBone=!0;for(var l=0,c=t.length;l<c;l++){var d=t[l];d.mesh!==void 0&&d.skin!==void 0&&(r[d.mesh].isSkinnedMesh=!0)}},n.prototype.parse=function(){var t=this,e=this.json,r=this.extensions;this.markDefs();for(var i=0,a=Bt(r);i<a.length;i++){var o=a[i];o.markDefs(this)}return Promise.all(Bt(r).map(function(s){return s.prepare(t)})).then(function(){var s,u,l;return Promise.all([Promise.all(((s=e.scenes)!==null&&s!==void 0?s:[]).map(function(c,d){return t.loadScene(d)})),Promise.all(((u=e.animations)!==null&&u!==void 0?u:[]).map(function(c,d){return t.loadAnimation(d)})),Promise.all(((l=e.cameras)!==null&&l!==void 0?l:[]).map(function(c,d){return t.loadCamera(d)}))])}).then(function(s){var u=s[0],l=s[1],c=s[2],d={json:e,scene:u[e.scene||0],scenes:u,animations:l,cameras:c,textures:[],dispose:Q};return d}).then(function(s){return Promise.all(Bt(r).map(function(u){return u.emitResult(s,t)})).then(function(){return s})}).then(function(s){var u=Array.from(t.textureSet),l=fh(t.disposeSet);return Object.assign(s,{textures:u,dispose:l}),t.textureSet.clear(),t.disposeSet.clear(),t.dispose(),s})},n.prototype.loadCamera=function(t){var e="camera:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=Bt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadCamera(t,this),i)break}if(!i){var u=void 0,l=this.json.cameras[t],c=l[l.type];c?l.type==="perspective"?u=new f.PerspectiveCamera(f.MathUtils.radToDeg(c.yfov),c.aspectRatio||1,c.znear||1,c.zfar||2e6):l.type==="orthographic"?u=new f.OrthographicCamera(-c.xmag,c.xmag,c.ymag,-c.ymag,c.znear,c.zfar):(console.warn("glTF: Invalid camera type ".concat(l.type,".")),u=new f.Camera):(console.warn("glTF: Missing camera parameters."),u=new f.Camera),l.name&&(u.name=this.createUniqueName(l.name)),i=Promise.resolve(u)}return this.cache.set(e,i),i},n.prototype.loadSkin=function(t){var e="animation:"+t,r=this.cache.get(e);if(r)return r;var i,a=this.json.skins[t],o={joints:a.joints};return a.inverseBindMatrices===void 0?i=Promise.resolve(o):i=this.loadAccessor(a.inverseBindMatrices).then(function(s){return s&&(o.inverseBindMatrices=s),o}),this.cache.set(e,i),i},n.prototype.loadAnimation=function(t){var e="animation:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=Bt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadAnimation(t,this),i)break}if(!i){for(var u=this.json,l=u.animations[t],c=[],d=[],p=[],A=[],h=[],v=0,g=l.channels.length;v<g;v++){var m=l.channels[v],y=l.samplers[m.sampler],b=m.target,x=b.node!==void 0?b.node:b.id,w=l.parameters!==void 0?l.parameters[y.input]:y.input,M=l.parameters!==void 0?l.parameters[y.output]:y.output;c.push(this.loadNode(x)),d.push(this.loadAccessor(w)),p.push(this.loadAccessor(M)),A.push(y),h.push(b)}i=Promise.all([Promise.all(c),Promise.all(d),Promise.all(p),Promise.all(A),Promise.all(h)]).then(function(S){for(var E=S[0],P=S[1],B=S[2],C=S[3],I=S[4],F=[],T=function(z,U){var q=E[z],G=P[z],K=B[z],_=C[z],J=I[z];if(q===void 0)return"continue";q.updateMatrix(),q.matrixAutoUpdate=!0;var W=void 0;switch(rn[J.path]){case rn.weights:W=f.NumberKeyframeTrack;break;case rn.rotation:W=f.QuaternionKeyframeTrack;break;case rn.position:case rn.scale:default:W=f.VectorKeyframeTrack;break}var $=q.name?q.name:q.uuid,Y=_.interpolation!==void 0?ch[_.interpolation]:f.InterpolateLinear,Z=[];rn[J.path]===rn.weights?q.traverse(function(xe){xe.morphTargetInfluences&&Z.push(xe.name?xe.name:xe.uuid)}):Z.push($);var oe=K.array;if(K.normalized){for(var ne=qa(oe.constructor),de=new Float32Array(oe.length),se=0,ye=oe.length;se<ye;se++)de[se]=oe[se]*ne;oe=de}for(var se=0,ye=Z.length;se<ye;se++){var ie=new W(Z[se]+"."+rn[J.path],G.array,oe,Y);F.push(ie)}},L=0,D=E.length;L<D;L++)T(L);var V=l.name?l.name:"animation_"+t;return new f.AnimationClip(V,void 0,F)})}return this.cache.set(e,i),i},n.prototype.loadBuffer=function(t){var e=this.json.buffers[t];if(e.type&&e.type!=="arraybuffer")throw new Error("glTF: "+e.type+" buffer type is not supported.");var r="buffer:"+t,i=this.cache.get(r);if(i)return i;for(var a=null,o=0,s=Bt(this.extensions);o<s.length;o++){var u=s[o];if(a=u.loadBuffer(t,this),a)break}if(!a){var l=this.json.buffers[t];a=this.options.fetcher.ajax(this.resolveResouce(l.uri),{responseType:"arraybuffer"}).then(function(c){return c.body})}return this.cache.set(r,a),a},n.prototype.loadBufferView=function(t){var e="bufferView:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=Bt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadBufferView(t,this),i)break}if(!i){var u=this.json.bufferViews[t];i=this.loadBuffer(u.buffer).then(function(l){var c=u.byteLength||0,d=u.byteOffset||0;return l.slice(d,d+c)})}return this.cache.set(e,i),i},n.prototype.loadAccessor=function(t){var e=this,r="accessor:"+t,i=this.cache.get(r);if(i)return i;var a=null;if(!a){var o=this.json.accessors[t];if(o.bufferView===void 0&&o.sparse===void 0)a=Promise.resolve(null);else{var s=[];o.bufferView!==void 0?s.push(this.loadBufferView(o.bufferView)):s.push(Promise.resolve(null)),o.sparse!==void 0&&(s.push(this.loadBufferView(o.sparse.indices.bufferView)),s.push(this.loadBufferView(o.sparse.values.bufferView))),a=Promise.all(s).then(function(u){var l=u[0],c=Ys[o.type],d=ri[o.componentType],p=d.BYTES_PER_ELEMENT,A=p*c,h=o.byteOffset||0,v=o.bufferView!==void 0?e.json.bufferViews[o.bufferView].byteStride:void 0,g=o.normalized===!0,m,y;if(v&&v!==A){var b=Math.floor(h/v),x="InterleavedBuffer:"+o.bufferView+":"+o.componentType+":"+b+":"+o.count,w=e.cache.get(x);w||(m=new d(l,b*v,o.count*v/p),w=new f.InterleavedBuffer(m,v/p),e.cache.set(x,w)),y=new f.InterleavedBufferAttribute(w,c,h%v/p,g)}else l===null?m=new d(o.count*c):m=new d(l,h,o.count*c),y=new f.BufferAttribute(m,c,g);if(o.sparse!==void 0){var M=Ys.SCALAR,S=ri[o.sparse.indices.componentType],E=o.sparse.indices.byteOffset||0,P=o.sparse.values.byteOffset||0,B=new S(u[1],E,o.sparse.count*M),C=new d(u[2],P,o.sparse.count*c);l!==null&&(y=new f.BufferAttribute(y.array.slice(),y.itemSize,y.normalized));for(var I=0,F=B.length;I<F;I++){var T=B[I];if(y.setX(T,C[I*c]),c>=2&&y.setY(T,C[I*c+1]),c>=3&&y.setZ(T,C[I*c+2]),c>=4&&y.setW(T,C[I*c+3]),c>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return y})}}return this.cache.set(r,a),a},n.prototype.createPrimitiveKey=function(t){for(var e=0,r=Bt(this.extensions);e<r.length;e++){var i=r[e],a=i.createPrimitiveKey(t,this);if(a)return a}for(var o="",s=Object.keys(t.attributes).sort(),u=0,l=s.length;u<l;u++)o+=s[u]+":"+t.attributes[s[u]]+";";return t.indices+":"+o+":"+t.mode},n.prototype.loadGeometry=function(t){for(var e=this,r=null,i=0,a=Bt(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadGeometry(t,this),r)break}return r||(r=this.addGeometryPrimitiveAttributes(new f.BufferGeometry,t)),r=r.then(function(s){return e.disposeSet.add(s),s}),r},n.prototype.loadImage=function(t){for(var e=this,r=null,i=0,a=Bt(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadImage(t,this),r)break}if(!r){var s=this.json.images[t];if(s.bufferView!==void 0){var u=this.json.bufferViews[s.bufferView];r=this.loadBuffer(u.buffer).then(function(c){var d=u.byteOffset||0,p=u.byteLength||0,A=new Uint8Array(c,d,p),h=new Blob([A],{type:s.mimeType});return Mo(h)})}else if(s.uri){var l=this.resolveResouce(s.uri);r=this.options.fetcher.loadImage(l,{},void 0,void 0,void 0,Ai()).then(function(c){return c.body})}else throw new Error("glTF: Invalid image defs.")}return r=r.then(function(c){return e.disposeSet.add(c),c}),r},n.prototype.loadMaterialAsMeshStandardMaterial=function(t){var e=this,r=[],i=new f.MeshStandardMaterial;if(i.color=new f.Color(1,1,1),i.opacity=1,Object.keys(t.attributes).filter(function(c){return Kt[c]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(c){return Kt[c]==="normal"}).length===0&&(i.flatShading=!0),Object.keys(t.attributes).filter(function(c){return Kt[c]==="tangent"}).length===0&&(i.normalScale&&(i.normalScale.y*=-1),i.clearcoatNormalScale&&(i.clearcoatNormalScale.y*=-1)),t.material!==void 0){var a=this.json.materials[t.material];a.name&&(i.name=a.name);var o=a.pbrMetallicRoughness||{};if(Array.isArray(o.baseColorFactor)){var s=o.baseColorFactor;i.color.fromArray(s),i.opacity=s[3]}o.baseColorTexture!==void 0&&r.push(this.createMaterialTexture(o.baseColorTexture).then(function(c){c.encoding=f.sRGBEncoding,i.map=c,e.disposeSet.add(c)})),i.metalness=o.metallicFactor!==void 0?o.metallicFactor:1,i.roughness=o.roughnessFactor!==void 0?o.roughnessFactor:1,o.metallicRoughnessTexture!==void 0&&r.push(this.createMaterialTexture(o.metallicRoughnessTexture).then(function(c){c.encoding=f.sRGBEncoding,i.metalnessMap=c,i.roughnessMap=c,e.disposeSet.add(c)})),a.doubleSided===!0&&(i.side=f.DoubleSide);var u=a.alphaMode||Dr.OPAQUE;if(u===Dr.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,u===Dr.MASK&&(i.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5)),a.normalTexture!==void 0&&(r.push(this.createMaterialTexture(a.normalTexture).then(function(c){i.normalMap=c,e.disposeSet.add(c)})),i.normalScale=new f.Vector2(1,1),a.normalTexture.scale!==void 0)){var l=a.normalTexture.scale;i.normalScale.set(l,l)}a.occlusionTexture!==void 0&&(r.push(this.createMaterialTexture(a.occlusionTexture).then(function(c){i.aoMap=c,e.disposeSet.add(c)})),a.occlusionTexture.strength!==void 0&&(i.aoMapIntensity=a.occlusionTexture.strength)),a.emissiveFactor!==void 0&&(i.emissive=new f.Color().fromArray(a.emissiveFactor)),a.emissiveTexture!==void 0&&r.push(this.createMaterialTexture(a.emissiveTexture).then(function(c){i.emissiveMap=c,e.disposeSet.add(c)}))}return this.disposeSet.add(i),Promise.all(r).then(function(){return i})},n.prototype.loadMaterialAsLineBasicMaterial=function(t){var e=[],r=new f.LineBasicMaterial;if(r.color=new f.Color(1,1,1),r.opacity=1,Object.keys(t.attributes).filter(function(u){return Kt[u]==="color"}).length>0&&(r.vertexColors=!0),Object.keys(t.attributes).filter(function(u){return Kt[u]==="tangent"}).length===0&&(r.normalScale&&(r.normalScale.y*=-1),r.clearcoatNormalScale&&(r.clearcoatNormalScale.y*=-1)),t.material!==void 0){var i=this.json.materials[t.material];i.name&&(r.name=i.name);var a=i.pbrMetallicRoughness||{};if(Array.isArray(a.baseColorFactor)){var o=a.baseColorFactor;r.color.fromArray(o),r.opacity=o[3]}i.doubleSided===!0&&(r.side=f.DoubleSide);var s=i.alphaMode||Dr.OPAQUE;s===Dr.BLEND?(r.transparent=!0,r.depthWrite=!1):(r.transparent=!1,s===Dr.MASK&&(r.alphaTest=i.alphaCutoff!==void 0?i.alphaCutoff:.5))}return this.disposeSet.add(r),Promise.all(e).then(function(){return r})},n.prototype.loadMaterialAsPointsMaterial=function(t){var e=this,r=[],i=new f.PointsMaterial;if(i.color=new f.Color(1,1,1),i.opacity=1,i.sizeAttenuation=!1,Object.keys(t.attributes).filter(function(l){return Kt[l]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(l){return Kt[l]==="tangent"}).length===0&&(i.normalScale&&(i.normalScale.y*=-1),i.clearcoatNormalScale&&(i.clearcoatNormalScale.y*=-1)),t.material!==void 0){var a=this.json.materials[t.material];a.name&&(i.name=a.name);var o=a.pbrMetallicRoughness||{};if(Array.isArray(o.baseColorFactor)){var s=o.baseColorFactor;i.color.fromArray(s),i.opacity=s[3]}o.baseColorTexture!==void 0&&r.push(this.createMaterialTexture(o.baseColorTexture).then(function(l){l.encoding=f.sRGBEncoding,i.map=l,e.disposeSet.add(l)})),a.doubleSided===!0&&(i.side=f.DoubleSide);var u=a.alphaMode||Dr.OPAQUE;u===Dr.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,u===Dr.MASK&&(i.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5))}return this.disposeSet.add(i),Promise.all(r).then(function(){return i})},n.prototype.loadMaterial=function(t){var e,r=(e=t.mode)!==null&&e!==void 0?e:Ue.TRIANGLES,i="material:"+this.createPrimitiveKey(t),a=this.cache.get(i);if(a)return a;for(var o=null,s=0,u=Bt(this.extensions);s<u.length;s++){var l=u[s];if(o=l.loadMaterial(t,this),o)break}if(r===Ue.TRIANGLES||r===Ue.TRIANGLE_STRIP||r===Ue.TRIANGLE_FAN)o=this.loadMaterialAsMeshStandardMaterial(t);else if(r===Ue.LINES||r===Ue.LINE_STRIP||r===Ue.LINE_LOOP)o=this.loadMaterialAsLineBasicMaterial(t);else if(r===Ue.POINTS)o=this.loadMaterialAsPointsMaterial(t);else throw new Error("glTF: Primitive mode unsupported: "+r);return this.cache.set(i,o),o},n.prototype.loadTexture=function(t){var e=this,r="texture:"+t,i=this.cache.get(r);if(i)return i;for(var a=null,o=0,s=Bt(this.extensions);o<s.length;o++){var u=s[o];if(a=u.loadTexture(t,this),a)break}if(!a){var l=this.json.textures[t];a=this.loadImage(l.source).then(function(c){var d=new f.Texture(c);d.needsUpdate=!0,d.flipY=!1,l.name&&(d.name=l.name);var p=e.json.samplers||{},A=p[l.sampler]||{};return d.magFilter=oa[A.magFilter]||f.LinearFilter,d.minFilter=oa[A.minFilter]||f.LinearMipmapLinearFilter,d.wrapS=sa[A.wrapS]||f.RepeatWrapping,d.wrapT=sa[A.wrapT]||f.RepeatWrapping,d.onUpdate=function(){c.close()},d})}return a=a.then(function(c){return e.disposeSet.add(c),c}),this.cache.set(r,a),a},n.prototype.loadMesh=function(t){for(var e=this,r=null,i=0,a=Bt(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadMesh(t,this),r)break}if(!r){var s=this.json.meshes[t],u=s.primitives,l=Promise.all(u.map(function(d){return e.loadGeometry(d)})),c=Promise.all(u.map(function(d){return e.loadMaterial(d)}));r=Promise.all([l,c]).then(function(d){for(var p=d[0],A=d[1],h=[],v=0;v<u.length;v++){var g=u[v],m=p[v],y=A[v],b=g.mode||Ue.TRIANGLES,x=void 0;if(b===Ue.TRIANGLES||b===Ue.TRIANGLE_STRIP||b===Ue.TRIANGLE_FAN)if(b===Ue.TRIANGLE_STRIP?m=e.toGeometryTrianglesDrawMode(m,f.TriangleStripDrawMode):b===Ue.TRIANGLE_FAN&&(m=e.toGeometryTrianglesDrawMode(m,f.TriangleFanDrawMode)),e.disposeSet.add(m),s.isSkinnedMesh){var w=new f.SkinnedMesh(m,y);m.attributes.skinWeight.normalized||w.normalizeSkinWeights(),x=w}else x=new f.Mesh(m,y);else if(b===Ue.POINTS)x=new f.Points(m,y);else if(b===Ue.LINES)x=new f.LineSegments(m,y);else if(b===Ue.LINE_STRIP)x=new f.Line(m,y);else if(b===Ue.LINE_LOOP)x=new f.LineLoop(m,y);else throw new Error("glTF: Primitive mode unsupported: "+b);if(Object.keys(m.morphAttributes).length>0){if(s.weights!==void 0)for(var M=0,S=s.weights.length;M<S;M++)x.morphTargetInfluences[M]=s.weights[M];if(s.extras&&Array.isArray(s.extras.targetNames)){var E=s.extras.targetNames;if(x.morphTargetInfluences.length===E.length){x.morphTargetDictionary={};for(var M=0,S=E.length;M<S;M++)x.morphTargetDictionary[E[M]]=M}else console.warn("glTF: Invalid extras.targetNames length. Ignoring names.")}}x.name=e.createUniqueName(s.name||"mesh_"+t),h.push(x)}if(h.length===1)return h[0];for(var P=new f.Group,B=0,C=h;B<C.length;B++){var x=C[B];P.add(x)}return P})}return r},n.prototype.loadNodeAttachments=function(t){for(var e=[],r=0,i=Bt(this.extensions);r<i.length;r++){var a=i[r],o=a.loadNodeAttachments(t,this);o&&e.push(o)}return e},n.prototype.loadNode=function(t){var e="node:"+t,r=this.cache.get(e);if(r)return r;var i=this.json,a=i.nodes[t],o=a.name?this.createUniqueName(a.name):"",s=[];a.mesh!==void 0&&s.push(this.loadMesh(a.mesh).then(function(p){if(a.weights!==void 0){var A=a.weights;p.traverse(function(h){if(h instanceof f.Mesh||h instanceof f.Line||h instanceof f.Points)for(var v=0,g=A.length;v<g;v++)h.morphTargetInfluences[v]=A[v]})}return p})),a.camera!==void 0&&s.push(this.loadCamera(a.camera));for(var u=this.loadNodeAttachments(t),l=0,c=u;l<c.length;l++){var d=c[l];s.push(d)}return Promise.all(s).then(function(p){var A;if(a.isBone===!0?A=new f.Bone:p.length>1?A=new f.Group:p.length===1?A=p[0]:A=new f.Object3D,A!==p[0])for(var h=0,v=p.length;h<v;h++)A.add(p[h]);if(a.name&&(A.name=o),a.matrix!==void 0){var g=new f.Matrix4;g.fromArray(a.matrix),A.applyMatrix4(g)}else a.translation!==void 0&&A.position.fromArray(a.translation),a.rotation!==void 0&&A.quaternion.fromArray(a.rotation),a.scale!==void 0&&A.scale.fromArray(a.scale);return A})},n.prototype.loadScene=function(t){var e=this.json,r=e.scenes[t],i=new f.Group;r.name&&(i.name=this.createUniqueName(r.name));for(var a=r.nodes||[],o=[],s=0,u=a.length;s<u;s++)o.push(this.buildNodeHierarchy(a[s],i));return Promise.all(o).then(function(){return i})},n.prototype.createMaterialTexture=function(t){var e=this;return this.loadTexture(t.index).then(function(r){for(var i=0,a=Bt(e.extensions);i<a.length;i++){var o=a[i],s=o.extendTexture(r,t,e);s&&(r=s,e.disposeSet.add(r))}return e.textureSet.add(r),r})},n.prototype.addGeometryPrimitiveAttributes=function(t,e){var r=this,i=e.attributes,a=[],o=function(w){var M=Kt[w]||w.toLowerCase();if(M in t.attributes)return"continue";a.push(s.loadAccessor(i[w]).then(function(S){S&&t.setAttribute(M,S)}))},s=this;for(var u in i)o(u);e.indices!==void 0&&!t.index&&a.push(this.loadAccessor(e.indices).then(function(w){w&&t.setIndex(w)}));var l=new f.Box3;if(i.POSITION!==void 0){var c=this.json.accessors[i.POSITION],d=c.min,p=c.max;if(d!==void 0&&p!==void 0){if(l.set(new f.Vector3(d[0],d[1],d[2]),new f.Vector3(p[0],p[1],p[2])),c.normalized){var A=qa(ri[c.componentType]);l.min.multiplyScalar(A),l.max.multiplyScalar(A)}}else console.warn("glTF: Missing min/max properties for accessor POSITION.")}var h=e.targets;if(h!==void 0){for(var v=new f.Vector3,g=new f.Vector3,m=0,y=h.length;m<y;m++){var b=h[m];if(b.POSITION!==void 0){var c=this.json.accessors[b.POSITION],d=c.min,p=c.max;if(d!==void 0&&p!==void 0){if(g.setX(Math.max(Math.abs(d[0]),Math.abs(p[0]))),g.setY(Math.max(Math.abs(d[1]),Math.abs(p[1]))),g.setZ(Math.max(Math.abs(d[2]),Math.abs(p[2]))),c.normalized){var A=qa(ri[c.componentType]);g.multiplyScalar(A)}v.max(g)}else console.warn("glTF: Missing min/max properties for accessor POSITION.")}}l.expandByVector(v)}t.boundingBox=l;var x=new f.Sphere;return l.getCenter(x.center),x.radius=l.min.distanceTo(l.max)/2,t.boundingSphere=x,Promise.all(a).then(function(){if(t.attributes.uv&&!t.attributes.uv2&&r.options.copyUV2&&t.setAttribute("uv2",t.attributes.uv),e.targets){for(var w=!1,M=!1,S=0,E=e.targets.length;S<E;S++){var P=e.targets[S];if(P.POSITION!==void 0&&(w=!0),P.NORMAL!==void 0&&(M=!0),w&&M)break}if(!w&&!M)return t;var B=[];t.morphTargetsRelative=!0;for(var C=function(I,F){var T=e.targets[I];w?B.push(r.loadAccessor(T.POSITION).then(function(L){L&&(t.morphAttributes.position[I]=L)})):t.morphAttributes.position[I]=t.attributes.position,M?B.push(r.loadAccessor(T.NORMAL).then(function(L){L&&(t.morphAttributes.normal[I]=L)})):t.morphAttributes.normal[I]=t.attributes.normal},S=0,E=e.targets.length;S<E;S++)C(S,E);return Promise.all(B).then(function(){return t})}else return t})},n.prototype.buildNodeHierarchy=function(t,e){var r=this,i=this.json.nodes[t];return this.loadNode(t).then(function(a){if(i.skin===void 0)return a;var o;return r.loadSkin(i.skin).then(function(s){o=s;for(var u=[],l=0,c=o.joints.length;l<c;l++)u.push(r.loadNode(o.joints[l]));return Promise.all(u)}).then(function(s){return a.traverse(function(u){if(u instanceof f.SkinnedMesh){for(var l=[],c=[],d=0,p=s.length;d<p;d++){var A=s[d];if(A instanceof f.Bone){l.push(A);var h=new f.Matrix4;o.inverseBindMatrices!==void 0&&h.fromArray(o.inverseBindMatrices.array,d*16),c.push(h)}else console.warn('glTF: Joint "%s" could not be found.',o.joints[d])}u.bind(new f.Skeleton(l,c),u.matrixWorld)}}),a})}).then(function(a){e.add(a);var o=[];if(i.children)for(var s=i.children,u=0,l=s.length;u<l;u++){var c=s[u];o.push(r.buildNodeHierarchy(c,a))}return Promise.all(o).then(function(){return a})})},n.prototype.createUniqueName=function(t){for(var e=f.PropertyBinding.sanitizeNodeName(t||""),r=e,i=1;this.nodeNamesUsed[r];++i)r=e+"_"+i;return this.nodeNamesUsed[r]=!0,r},n.prototype.resolveResouce=function(t){return st(this.options.resourcePath,ga(t,this.options.search))},n.prototype.toGeometryTrianglesDrawMode=function(t,e){var r=t.getIndex();if(r===null){var i=[],a=t.getAttribute("position");if(a!==void 0){for(var o=0;o<a.count;o++)i.push(o);t.setIndex(i),r=t.getIndex()}}if(r===null)return console.error("glTF: Undefined position attribute. Processing not possible."),t;var s=r.count-2,u=[];if(e===f.TriangleFanDrawMode)for(var o=1;o<=s;o++)u.push(r.getX(0)),u.push(r.getX(o)),u.push(r.getX(o+1));else for(var o=0;o<s;o++)o%2===0?(u.push(r.getX(o)),u.push(r.getX(o+1)),u.push(r.getX(o+2))):(u.push(r.getX(o+2)),u.push(r.getX(o+1)),u.push(r.getX(o)));u.length/3!==s&&console.error("glTF: Unable to generate correct amount of triangles.");var l=t.clone();return l.setIndex(u),this.disposeSet.add(l),l},n}();function qa(n){switch(n){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("glTF: Unsupported normalized accessor component type.")}}var Fr=function(){function n(){}return n.prototype.markDefs=function(t){},n.prototype.prepare=function(t){},n.prototype.emitResult=function(t,e){},n.prototype.createPrimitiveKey=function(t,e){},n.prototype.extendTexture=function(t,e,r){return null},n.prototype.loadBuffer=function(t,e){return null},n.prototype.loadBufferView=function(t,e){return null},n.prototype.loadImage=function(t,e){return null},n.prototype.loadTexture=function(t,e){return null},n.prototype.loadGeometry=function(t,e){return null},n.prototype.loadMaterial=function(t,e){return null},n.prototype.loadMesh=function(t,e){return null},n.prototype.loadNodeAttachments=function(t,e){return null},n.prototype.loadCamera=function(t,e){return null},n.prototype.loadAnimation=function(t,e){return null},n}(),hh=function(n){ue(t,n);function t(){var e=n.call(this)||this;return e.header={magic:"",version:0,length:0},e.content="",e.body=null,e}return t.getMagic=function(e){return aa(new Uint8Array(e.slice(0,4)))},t.prototype.loadGlbBinary=function(e){var r=new DataView(e,0,t.HEADER_LENGTH);if(this.header={magic:t.getMagic(e),version:r.getUint32(4,!0),length:r.getUint32(8,!0)},this.header.magic!==t.HEADER_MAGIC)throw new Error("glTF:KHR_binary_glTF: Unsupported.");if(this.header.version<2)throw new Error("glTF:KHR_binary_glTF: Legacy binary file detected.");for(var i=new DataView(e,t.HEADER_LENGTH),a=0,o=null,s=null;a<i.byteLength;){var u=i.getUint32(a,!0);if(a+=4,u!==0){var l=i.getUint32(a,!0);if(a+=4,l===t.CHUNK_TYPES.JSON){var c=new Uint8Array(e,t.HEADER_LENGTH+a,u);o=aa(c)}else if(l===t.CHUNK_TYPES.BIN){var d=t.HEADER_LENGTH+a;s=e.slice(d,d+u)}a+=u}}if(o===null)throw new Error("glTF:KHR_binary_glTF: JSON content not found.");this.content=o,this.body=s},t.prototype.loadBuffer=function(e,r){var i=r.json.buffers[e];return i.uri===void 0&&e===0&&this.body?Promise.resolve(this.body):null},t.prototype.clear=function(){this.body=null,this.content=""},t.HEADER_MAGIC="glTF",t.HEADER_LENGTH=12,t.CHUNK_TYPES={JSON:1313821514,BIN:5130562},t}(Fr),ph="https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/draco/1.5.6/",$s={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},e0={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"},vh=function(){function n(){this.decoderPath=ph,this.decoderConfig={},this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL=""}return n.prototype.setDecoderPath=function(t){this.decoderPath=t},n.prototype.setDecoderConfig=function(t){return this.decoderConfig=t,this},n.prototype.setWorkerLimit=function(t){return this.workerLimit=t,this},n.prototype.decodeDracoFile=function(t,e,r,i){var a={attributeIDs:r||$s,attributeTypes:i||e0,useUniqueIDs:!!r};this.decodeGeometry(t,a).then(e)},n.prototype.decodeGeometry=function(t,e){var r=this;e===void 0&&(e={attributeIDs:$s,attributeTypes:e0,useUniqueIDs:!1});for(var i in e.attributeTypes){var a=e.attributeTypes[i];a.BYTES_PER_ELEMENT!==void 0&&(e.attributeTypes[i]=a.name)}var o,s=this.workerNextTaskID++,u=t.byteLength,l=this._getWorker(s,u).then(function(c){return o=c,new Promise(function(d,p){o._callbacks[s]={resolve:d,reject:p},o.postMessage({type:"decode",id:s,taskConfig:e,buffer:t},[t])})}).then(function(c){return r._createGeometry(c.geometry)});return l.catch(function(){return!0}).then(function(){o&&s&&r._releaseTask(o,s)}),l},n.prototype._createGeometry=function(t){var e=new f.BufferGeometry;t.index&&e.setIndex(new f.BufferAttribute(t.index.array,1));for(var r=0;r<t.attributes.length;r++){var i=t.attributes[r],a=i.name,o=i.array,s=i.itemSize,u=!(o instanceof Float32Array||o instanceof Float64Array);e.setAttribute(a,new f.BufferAttribute(o,s,u))}return e},n.prototype._initDecoder=function(){var t=this;if(this.decoderPending)return this.decoderPending;var e=typeof WebAssembly!="object"||this.decoderConfig.type==="js";if(e){var r=qn(this.decoderPath+"draco_decoder.js",{responseType:"text"}).then(function(a){return a.body});this.decoderPending=r.then(function(a){var o=["/* draco decoder */",a,"","/* worker */",t0].join(`
|
|
417
|
+
`,Mu=[],Mi=new f.PerspectiveCamera(90,1,.1,2);Mi.up.set(0,-1,0);Mi.lookAt(new f.Vector3(1,0,0));Mi.updateMatrix();Mi.matrixAutoUpdate=!1;var Si=new f.PerspectiveCamera(90,1,.1,2);Si.up.set(0,-1,0);Si.lookAt(new f.Vector3(-1,0,0));Si.updateMatrix();Si.matrixAutoUpdate=!1;var Ci=new f.PerspectiveCamera(90,1,.1,2);Ci.up.set(0,0,1);Ci.lookAt(new f.Vector3(0,1,0));Ci.updateMatrix();Ci.matrixAutoUpdate=!1;var Ei=new f.PerspectiveCamera(90,1,.1,2);Ei.up.set(0,0,-1);Ei.lookAt(new f.Vector3(0,-1,0));Ei.updateMatrix();Ei.matrixAutoUpdate=!1;var Ii=new f.PerspectiveCamera(90,1,.1,2);Ii.up.set(0,-1,0);Ii.lookAt(new f.Vector3(0,0,1));Ii.updateMatrix();Ii.matrixAutoUpdate=!1;var Ti=new f.PerspectiveCamera(90,1,.1,2);Ti.up.set(0,-1,0);Ti.lookAt(new f.Vector3(0,0,-1));Ti.updateMatrix();Ti.matrixAutoUpdate=!1;var Vs={front:{camera:Ii,index:4},back:{camera:Ti,index:5},up:{camera:Ci,index:2},down:{camera:Ei,index:3},left:{camera:Si,index:1},right:{camera:Mi,index:0}};function od(){var n=Mu.pop();return n||new f.ShaderMaterial({uniforms:{map:{value:null},flipY:{value:0}},vertexShader:id,fragmentShader:ad,depthTest:!1,depthWrite:!1,stencilWrite:!1,blending:f.NoBlending,lights:!1,toneMapped:!1,fog:!1})}function sd(n){n.uniforms.map.value=null,Mu.push(n)}function ud(n,t,e){var r=new f.Scene;r.matrixAutoUpdate=!1;var i=new f.Group;i.scale.set(1,1,-1),r.add(i);for(var a=[],o=new Set,s=0,u=n;s<u.length;s++){var l=u[s];o.add(l.face);var c=od();a.push(c),c.uniforms.map.value=l.texture,c.uniforms.flipY.value=l.flipY?1:0;var d=new f.Group,p=new f.Mesh(nd,c);p.position.set(l.position.x+l.size.x/2-.5,1-(l.position.y+l.size.y/2)-.5,-.5),p.scale.set(l.size.x,l.size.y,1),d.quaternion.copy(rd[l.face]),d.add(p),i.add(d)}var A=e.autoClear,h=e.sortObjects,v=e.xr.enabled,g=t.texture.generateMipmaps;e.autoClear=!1,e.sortObjects=!1,e.xr.enabled=!1,t.texture.generateMipmaps=!1;var m=e.getRenderTarget(),y=0;o.forEach(function(w){++y===o.size&&(t.texture.generateMipmaps=g),e.setRenderTarget(t,Vs[w].index),e.render(r,Vs[w].camera)}),e.setRenderTarget(m),e.autoClear=A,e.sortObjects=h,e.xr.enabled=v;for(var b=0,x=a;b<x.length;b++){var c=x[b];sd(c)}}var ld=function(){return!1}();function Ai(n){n===void 0&&(n={});var t=Object.assign(document.createElementNS("http://www.w3.org/1999/xhtml","img"),{crossOrigin:"",close:function(){n.onClose&&n.onClose.call(this),this.onerror=this.onload=this.close=Q,this.removeAttribute("src")}});return t}function Mo(n){return new Promise(function(t,e){var r=URL.createObjectURL(n),i=Ai({onClose:function(){this.src===r&&URL.revokeObjectURL(r)}});i.onload=function(){i.src===r&&URL.revokeObjectURL(r),i.onload=i.onerror=Q,setTimeout(function(){t(i)},10)},i.onerror=function(){var a=i.src;i.onload=i.onerror=Q,i.close(),e(new Error("image load error: ".concat(a)))},i.decoding="async",i.src=r})}var Ns=[];function cd(n,t){var e=Ns.shift();if(e)return e.width=n,e.height=t,e;var r=Object.assign(document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),{close:function(){r.close=Q,Ns.push(r)}});return r}function zs(n,t){if(t&&(n.width>t.width||n.height>t.height)){var e=cd(Math.min(n.width,t.width),Math.min(n.height,t.height)),r=e.getContext("2d");r.clearRect(0,0,e.width,e.height),r.drawImage(n,0,0,e.width,e.height),n.close();var i=new f.Texture(e);i.needsUpdate=!0,i.flipY=!0;var a=i.dispose;return i.dispose=function(){e.close(),a.call(i),i.dispose=a},i}else{var o=new f.Texture(n);o.needsUpdate=!0,typeof ImageBitmap!="undefined"&&n instanceof ImageBitmap?o.flipY=!1:o.flipY=!0;var s=o.dispose;return o.dispose=function(){n.close(),s.call(o),o.dispose=s},o}}function fd(n){var t=new f.CubeTexture(n);t.needsUpdate=!0,t.flipY=!1;var e=t.dispose;return t.dispose=function(){for(var r=0,i=n;r<i.length;r++){var a=i[r];a.close()}e.call(t),t.dispose=e},t}var Qs=new f.Vector3,gn=["right","left","up","down","front","back"],qe=function(){function n(t,e,r,i,a){var o,s,u;this.tileTree=e,this.tileSources=r,this.options=i,this.renderer=a,this.name="",this.needsRender=!1,this.baseLevel=0,this.maxRequest=n.DEFAULT_MAX_REQUEST,this.disposed=!1,this.loadedCubeNodes=new Set,this.loadingCubeNodes=new Set,this.drawedCubeNodes=new Set,this.baseCubeTexture=null,this._cubeRenderTarget=null,this.prepareToRender=[],this.baseCubeTexture=t;var l=(o=this.baseCubeTexture.images)!==null&&o!==void 0?o:[],c=Array.isArray(l)&&l[0]&&l[0].width||((u=(s=i.imageURL)===null||s===void 0?void 0:s.options)===null||u===void 0?void 0:u.size);typeof c!="number"&&(c=2048),this.baseLevel=Math.floor(c/512)-1}return Object.defineProperty(n.prototype,"cubeRenderTarget",{get:function(){return this._cubeRenderTarget},set:function(t){var e,r,i,a,o,s;if(t===null)throw new Error("cannot set cubeRenderTarget to null.");t.width!==this.options.textureSize&&t.setSize(this.options.textureSize,this.options.textureSize),t.texture.format=(e=this.options.format)!==null&&e!==void 0?e:f.RGBAFormat,t.texture.minFilter=(r=this.options.minFilter)!==null&&r!==void 0?r:f.LinearFilter,t.texture.magFilter=(i=this.options.magFilter)!==null&&i!==void 0?i:f.LinearFilter,t.texture.wrapS=(a=this.options.wrapS)!==null&&a!==void 0?a:f.ClampToEdgeWrapping,t.texture.wrapT=(o=this.options.wrapT)!==null&&o!==void 0?o:f.ClampToEdgeWrapping,t.texture.generateMipmaps=(s=this.options.generateMipmaps)!==null&&s!==void 0?s:!0,this.baseCubeTexture&&(wo(this.baseCubeTexture,t,this.renderer),this.baseCubeTexture.dispose(),this.baseCubeTexture=null),this._cubeRenderTarget&&wo(this._cubeRenderTarget.texture,t,this.renderer),this._cubeRenderTarget=t},enumerable:!1,configurable:!0}),n.prototype.requestTile=function(t){var e=this,r,i,a,o,s,u,l=this.tileSources.filter(function(v){return v.level===t.level})[0];if(this.baseLevel>=t.level||!l)return this.loadedCubeNodes.add(t),this.prepareToRender.push({node:t,texture:null}),!1;var c=l.size,d=Math.pow(2,t.level)*t.position.y,p=Math.pow(2,t.level)*t.position.x,A="".concat(((a=(i=(r=this.options.imageURL)===null||r===void 0?void 0:r.options)===null||i===void 0?void 0:i.key)!==null&&a!==void 0?a:"pano.0").replace(/^pano/,"pano_tile"),".").concat(t.face,".").concat(t.level,".").concat(d,".").concat(p),h=O(O({},Jt((s=(o=this.options.imageURL)===null||o===void 0?void 0:o.options)!==null&&s!==void 0?s:{key:"unknown"},["format","sharpen","mappings"])),{key:A,size:l.scale>=1?void 0:c*t.size*l.scale,cut:[c*t.position.x,c*t.position.y,c*t.size,c*t.size]});return t.level===1&&l.scale>=.5&&(h.format==="jpg"||/\.jpg$/.test(l[t.face]))&&(h.size=void 0,h.quality||(h.quality=70)),this.loadingCubeNodes.add(t),this.options.textureLoader.loadTexture(l[t.face],{imageURL:{transform:(u=this.options.imageURL)===null||u===void 0?void 0:u.transform,options:O({},h)},format:f.RGBAFormat,timeout:this.options.timeout,magFilter:this.options.magFilter,minFilter:this.options.minFilter,fetcher:this.options.fetcher}).then(function(v){if(e.disposed){v.body.dispose();return}e.prepareToRender.push({node:t,texture:v.body}),e.loadedCubeNodes.add(t)}).catch(Q).then(function(){e.disposed||e.loadingCubeNodes.delete(t)}),!0},n.prototype.update=function(t,e){var r=this;if(!this.disposed){var i=t.planes[5].normal,a=Math.max(this.maxRequest-this.loadingCubeNodes.size,0),o=[];jo(this.tileTree,function(v){if(v.level>e||!t.intersectsBox(v.box))return!1;!r.loadedCubeNodes.has(v)&&!r.loadingCubeNodes.has(v)&&o.push(v)}),o.sort(function(v,g){return v.level!==g.level?v.level-g.level:v.box.getCenter(Qs).angleTo(i)-g.box.getCenter(Qs).angleTo(i)});for(var s=0,u=o;s<u.length;s++){var l=u[s];if(a<=0)break;var c=this.requestTile(l);c&&a--}if(this.cubeRenderTarget&&this.prepareToRender.length){this.prepareToRender.sort(function(v,g){return v.node.level-g.node.level});for(var d=[],p=0;p<this.prepareToRender.length;p++){var A=this.prepareToRender[p],l=A.node,h=A.texture;(l.parent===null||this.drawedCubeNodes.has(l.parent))&&(this.drawedCubeNodes.add(l),h&&d.push({face:l.face,position:l.position,size:new f.Vector2(l.size,l.size),texture:h,flipY:!h.flipY}),this.prepareToRender.splice(p,1),p--)}d.length&&(ud(d,this.cubeRenderTarget,this.renderer),this.needsRender=!0)}}},Object.defineProperty(n.prototype,"tilePending",{get:function(){return this.loadingCubeNodes.size},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"texture",{get:function(){if(!this._cubeRenderTarget)throw new Error("cubeRenderTarget never set.");return this._cubeRenderTarget.texture},enumerable:!1,configurable:!0}),n.prototype.dispose=function(){if(!this.disposed){this.disposed=!0,this.baseCubeTexture&&(this.baseCubeTexture.dispose(),this.baseCubeTexture=null),this.loadingCubeNodes.clear(),this.loadedCubeNodes.clear();for(var t=0,e=this.prepareToRender;t<e.length;t++){var r=e[t];r.texture&&r.texture.dispose()}this.prepareToRender.length=0}},n.DEFAULT_MAX_REQUEST=3,n}(),Xn=function(){function n(){}return n.prototype.loadTexture=function(t,e,r,i,a,o){var s,u,l,c,d,p,A;r===void 0&&(r=Q),i===void 0&&(i=Q),a===void 0&&(a=Q);var h={};typeof e.flipY!="undefined"&&(h.flipY=e.flipY),typeof e.format!="undefined"&&(h.format=e.format),typeof e.encoding!="undefined"&&(h.encoding=e.encoding),h.generateMipmaps=(s=e.generateMipmaps)!==null&&s!==void 0?s:!1,h.minFilter=(u=e.minFilter)!==null&&u!==void 0?u:f.LinearFilter,h.magFilter=(l=e.magFilter)!==null&&l!==void 0?l:f.LinearFilter;var v=(d=(c=e.imageURL)===null||c===void 0?void 0:c.options)!==null&&d!==void 0?d:{key:"unknown"};t=Cn(t,(p=e.imageURL)===null||p===void 0?void 0:p.transform,v);var g=Ls(t),m=(A=e.viaAjax)!==null&&A!==void 0?A:ld,y=Fs(t),b=/^https?:/.test(g);if(y?m=!0:b||(m=!1),m){var x=null,w="blob";return e.fetcher.ajax(t,{timeout:e.timeout,responseType:w},void 0,void 0,a).then(function(E){return Mo(E.body)}).then(function(E){return zs(E,e.maxSize)}).then(function(E){return Object.assign(E,h),E}).then(function(E){var B={meta:x,body:E};return r(B),B}).catch(function(E){return i(E),Promise.reject(E)})}else{var M=null,S;return Promise.resolve().then(function(){return Ai()}).then(function(E){return S=E,e.fetcher.loadImage(t,{timeout:e.timeout},void 0,void 0,a,E)}).then(function(E){return M=E.meta,zs(E.body,e.maxSize)}).then(function(E){return Object.assign(E,h),E}).then(function(E){var B={meta:M,body:E};return r(B),B}).catch(function(E){return S&&S.close(),i(E),Promise.reject(E)})}},n.prototype.loadCubeTexture=function(t,e,r,i,a,o){var s,u,l,c,d,p,A;r===void 0&&(r=Q),i===void 0&&(i=Q),a===void 0&&(a=Q);var h={};typeof e.format!="undefined"&&(h.format=e.format),h.generateMipmaps=(s=e.generateMipmaps)!==null&&s!==void 0?s:!1,h.minFilter=(u=e.minFilter)!==null&&u!==void 0?u:f.LinearFilter,h.magFilter=(l=e.magFilter)!==null&&l!==void 0?l:f.LinearFilter;for(var v=[t[gn[0]],t[gn[1]],t[gn[2]],t[gn[3]],t[gn[4]],t[gn[5]]],g=[],m=[0,0,0,0,0,0],y=[],b=function(w){var M=(d=(c=e.imageURL)===null||c===void 0?void 0:c.options)!==null&&d!==void 0?d:{key:"unknown"},S=Cn(v[w],(p=e.imageURL)===null||p===void 0?void 0:p.transform,O(O({},M),{key:M.key+"."+gn[w]})),E=Ls(S),B=function(D){m[w]=D,a(m.reduce(function(V,z){return V+z},0)/6)},R=(A=e.viaAjax)!==null&&A!==void 0?A:!1,C=/^https?:$/.test(E),I=Fs(S);if(I?R=!0:C||(R=!1),R){var L="blob",T=e.fetcher.ajax(S,{timeout:e.timeout,responseType:L},void 0,void 0,B).then(function(D){return y[w]=D.meta,Mo(D.body)});g.push(T)}else{var F,T=Promise.resolve().then(function(){return Ai()}).then(function(V){return F=V,e.fetcher.loadImage(S,{timeout:e.timeout},void 0,void 0,B,V)}).then(function(V){return y[w]=V.meta,V.body}).catch(function(V){return F&&F.close(),Promise.reject(V)});g.push(T)}},x=0;x<6;x++)b(x);return Promise.all(g).then(function(w){return fd(w)}).then(function(w){return Object.assign(w,O({encoding:f.sRGBEncoding},h)),w}).then(function(w){var M={body:w,meta:y};return r(M),M}).catch(function(w){for(var M=0,S=g;M<S.length;M++){var E=S[M];E.then(function(B){return B.close()}).catch(Q)}return i(w),Promise.reject(w)})},n.prototype.loadTiledCubeTexture=function(t,e,r,i,a,o,s){var u=this;return i===void 0&&(i=Q),a===void 0&&(a=Q),o===void 0&&(o=Q),new Promise(function(l,c){var d,p;u.loadCubeTexture(t,{imageURL:{transform:(d=r.imageURL)===null||d===void 0?void 0:d.transform,options:(p=r.imageURL)===null||p===void 0?void 0:p.options},format:f.RGBAFormat,viaAjax:r.viaAjax,timeout:r.timeout,fetcher:r.fetcher,magFilter:r.magFilter,minFilter:r.minFilter,generateMipmaps:r.generateMipmaps},function(A){var h,v=A.meta,g=A.body,m=(h=r.tileMaxLevel)!==null&&h!==void 0?h:2,y=Math.max(1024*m,512),b=bo(m),x=new qe(g,b,e,{textureSize:y,textureLoader:u,imageURL:r.imageURL,magFilter:r.magFilter,minFilter:r.minFilter,generateMipmaps:r.generateMipmaps,timeout:r.timeout,fetcher:r.fetcher},s),w={meta:v,body:x};i(w),l(w)},function(A){a(A),c(A)},o,s).catch(Q)})},n}();const dd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("n\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{H0v{pyqr-Ip|zz|{K0v{pyqr-Iz|}untrl}nlrr\x07K0v{pyqr-Ixv{{v{tl}nlrr\x07K0v{pyqr-Iy|tqr}uosl}nlrr\x07K0v{pyqr-Ipyv}}v{tl}yn{rl}nlrr\x07KZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--0v{pyqr-Ixv{onrlrr\x07K--0v{pyqr-Iortv{lrr\x07K--0v{pyqr-Iz|}untrlrr\x07K--0v{pyqr-Ixv{{v{tlrr\x07K--0v{pyqr-I}|wrplrr\x07K--0v{pyqr-Iy|tqr}uoslrr\x07K--0v{pyqr-Ipyv}}v{tl}yn{rlrr\x07K--d|yq]|vv|{-J-rpA5n{s|zrq9->;=6H--0vsqrs-b`RlV[`aN[PV[T----d|yq]|vv|{-J-v{n{prZnv\x07-7-d|yq]|vv|{H--0r{qvs--d|yq]|vv|{-J-z|qryZnv\x07-7-d|yq]|vv|{H--zn@-pnzrn_|nv|{Znv\x07-J-zn@5vrZnv\x07h=jh=j9-vrZnv\x07h>jh=j9-vrZnv\x07h?jh=j9-vrZnv\x07h=jh>j9-vrZnv\x07h>jh>j9-vrZnv\x07h?jh>j9-vrZnv\x07h=jh?j9-vrZnv\x07h>jh?j9-vrZnv\x07h?jh?j6H--PnzrnQvrpv|{-J-{|znyv r5pnzrn_|nv|{Znv\x07-7-rp@5=;=9-=;=9-:>;=66H--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Is|tlrr\x07K--ZNV[lR[Q\f"),hd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=6{vs|z-nz}yrPor-}n{|=lzn}H{vs|z-znA-}n{|=lznv\x07H{vs|z-sy|n-}n{|=l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|=lyzv{n{prZn}H0r{qvs{vs|z-nz}yrPor-}n{|>lzn}H{vs|z-znA-}n{|>lznv\x07H{vs|z-sy|n-}n{|>l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|>lyzv{n{prZn}H0r{qvs{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-}|trHn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{H{vs|z-sy|n-u|{Sy||V{qr\x07H{vs|z-rp?-r|yv|{H{vs|z-sy|n-}v\x07ry_nv|H0vs{qrs-SYNal`UNQRQ--n\bv{t-rp@-[|znyH0r{qvs0v{pyqr-Ip|zz|{K0v{pyqr-Iqvurv{tl}nlsntzr{K0v{pyqr-Is|tl}nlsntzr{K0v{pyqr-I}rpynzn}l}nlsntzr{K0v{pyqr-Iy|tqr}uosl}nlsntzr{K0v{pyqr-Ipyv}}v{tl}yn{rl}nlsntzr{Krp@- ||zcrp|5rp@-qvrpv|{9-rp@-rp|9-sy|n- ||z6-\n--sy|n-urn-J-q|5qvrpv|{9-rp|6H--rp@-q-J-qvrpv|{-7-urnH--rp@-}-J-rp|-:-qH--rp@-\0-J-}-7- ||zH--r{-{|znyv r5q-8-\x006H\fZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--0v{pyqr-Ipyv}}v{tl}yn{rlsntzr{K--<<-JJJ-全景图-JJJ--rp@-}n{|=a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|=lznv\x07h@j;\x07\b 6H--}n{|=a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|=a|crr\x079-}n{|=l ||z6H--}n{|=a|crr\x07-J-}n{|=a|crr\x07-7-zn@5}n{|=lznv\x076H--rp@-}n{|>a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|>lznv\x07h@j;\x07\b 6H--}n{|>a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|>a|crr\x079-}n{|>l ||z6H--}n{|>a|crr\x07-J-}n{|>a|crr\x07-7-zn@5}n{|>lznv\x076H--rpA-}n{|P|y|H--rpA-}n{|=P|y|-J-r\x07rPor5}n{|=lzn}9-}n{|=a|crr\x076H--rpA-}n{|>P|y|-J-r\x07rPor5}n{|>lzn}9-}n{|>a|crr\x076H--0vs-qrsv{rq5b`RlYbZV[N[PR6----}n{|=P|y|;n-J->;=-:-r\x07rPor5}n{|=lyzv{n{prZn}9-}n{|=a|crr\x076;H----}n{|>P|y|;n-J->;=-:-r\x07rPor5}n{|>lyzv{n{prZn}9-}n{|>a|crr\x076;H--0r{qvs--0vs-qrsv{rq5b`RlOYNPXla_N[`VaV\\[6----sy|n-oynpx]|tr-J-np|5:?;=-7-}|tr-8->;=6H----}n{|P|y|-J-zv\x075}n{|=P|y|9-OYNPXlP\\Y\\_9-zv{5>;=9-oynpx]|tr66H----}n{|P|y|-J-zv\x075}n{|P|y|9-}n{|>P|y|9-zn\x075=;=9-oynpx]|tr-:-]V-8->;=66H--0ryvs-qrsv{rq5b`Rl`]_RNQla_N[`VaV\\[6----rp?-prr{Pr{rP||q-J-r|yv|{-7-}v\x07ry_nv|-<-?;=H----sy|n-n{vv|{_nqv-J-qvn{pr5rp?5=;=9-=;=69-prr{Pr{rP||q6-7->;?H----sy|n-n{vv|{]|tr-J--qvn{pr5tylSntP||q;\x07\b9-prr{Pr{rP||q6-<-n{vv|{_nqvH----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-z||ur}5=;=9-=;?9-}|tr-:-n{vv|{]|tr66H--0ryr----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-}|tr6H--0r{qvs--tylSntP|y|-J-zv\x075}n{|P|y|9-rpA5}n{|P|y|;to9-=;=69-pynz}5z|qryNy}un-7-@=;=9-=;=9->;=66H--<<-JJJJJJJJJJJJJJJJ--ZNV[lZ\\QRYlP\\Y\\_--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0v{pyqr-Iqvurv{tlsntzr{K--ZNV[lR[Q\f"),pd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvs0vs-qrsv{rq5b`RlcR_aRelZN_X6--nvor-sy|n-znxH0r{qvsn\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v\x07h>jh?j9-vrZnv\x07h?jh?j6H--PnzrnQvrpv|{-J-{|znyv r5pnzrn_|nv|{Znv\x07-7-rp@5=;=9-=;=9-:>;=66H--0vs-qrsv{rq5b`RlRQY6----Y|tQr}u-J-y|t?5:z]|vv|{; 6H--0r{qvs--V_||sZnx-J-=;=H--0vs-qrsv{rq5b`RlcR_aRelZN_X6----V_||sZnx-J-r}5no5znx-:->;=69-=;>6H--0r{qvs--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Ir{zn}lrr\x07K--0v{pyqr-Is|tlrr\x07K--ZNV[lR[Q\f"),vd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=6{vs|z-sy|n-sy||H{vs|z-nz}yrPor-}n{|=lzn}H{vs|z-znA-}n{|=lznv\x07H{vs|z-sy|n-}n{|=l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|=lyzv{n{prZn}H0r{qvs{vs|z-nz}yrPor-}n{|>lzn}H{vs|z-znA-}n{|>lznv\x07H{vs|z-sy|n-}n{|>l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|>lyzv{n{prZn}H0r{qvs{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-}|trH0vs-qrsv{rq5b`RlP\\Y\\_lP\\[`aN[a6--{vs|z-rp@-p|{n{P|y|H0r{qvs0vs-qrsv{rq5b`RlP\\Y\\_lNYaVabQR6--{vs|z-nz}yr?Q-tnqvr{ar\x07rH0r{qvsp-Pyv}}r-\n--znA-znv\x07V{rrH--sy|n-sy||V{qr\x07H\fH0vs-[bZlPYV]]R_`-K-=--{vs|z-Pyv}}r-pyv}}rh[bZlPYV]]R_`jH0r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pA5p;to9-X;\x07\b69-r}5p;o9-p;t66H----rpA-\0-J-zv\x075rpA5};\x07\b9-p;69-rpA5p;9-};\b \x0769-r}5};\x079-p;66H----sy|n-q-J-\0;\x07-:-zv{5\0;9-\0;\b6H----sy|n-r-J->;=r:>=H----r{-rp@5no5\0; -8-5\0;-:-\0;\b6-<-5C;=-7-q-8-r669-q-<-5\0;\x07-8-r69-\0;\x076H\frp@-u?to5rp@-p6-\n----rpA-X-J-rpA5>;=9-?;=-<-@;=9->;=-<-@;=9-@;=6H----rp@-}-J-no5snp5p;\x07\x07\x07-8-X;\x07\b 6-7-C;=-:-X;6H----r{-p; -7-zv\x075X;\x07\x07\x079-pynz}5}-:-X;\x07\x07\x079-=;=9->;=69-p;\b6H\frp@-trP|y|O\bUrvtu5nz}yr?Q-tnqvr{ar\x07r9-rpA-d|yq]|vv|{6-\n--sy|n--J-5d|yq]|vv|{;\b-:-z|qryO|{qv{tZv{;\b6-<-5z|qryO|{qv{tZn\x07;\b-:-z|qryO|{qv{tZv{;\b6H--r{-r\x07r?Q5tnqvr{ar\x07r9-rp?59-=;B66;toH\fZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--<<-JJJ-顶部裁切-JJJ--sy|n-||sP]|tr-J-}|5pynz}5:PnzrnQvrpv|{;\b9-=;=9->;=69-@;=6H--vs-5----V_||sZnx-K-=;B-33----d|yq]|vv|{;\b-K-z|qryO|{qv{tZn\x07;\b-:-||sP]|tr-7-5z|qryO|{qv{tZn\x07;\b-:-z|qryO|{qv{tZv{;\b6--6-\n----qvpnqH--\f--<<-JJJJJJJJJJJJJJ--<<-JJJ-前置裁切计算-JJJ--0vs-[bZlPYV]]R_`-K-=----o||y-pyv}}rqH----rpA-pyv}}r]|vv|{H----0}ntzn-{|yyly||}ln----s|-5-v{-v-J-=H-v-I-[bZlPYV]]R_`H-v-88-6-\n------pyv}}r]|vv|{-J-pyv}}rh-v-j;znv\x07V{rr-7-d|yq]|vv|{H------pyv}}rq-J-5pyv}}rh-v-j;sy||V{qr\x07-I-=;=-\v\v-no5sy||-:-pyv}}rh-v-j;sy||V{qr\x076-I->;=6H------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\x07-K-:=;B-33-pyv}}r]|vv|{;\x07-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\b-K-:=;B-33-pyv}}r]|vv|{;\b-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{; -K-:=;B-33-pyv}}r]|vv|{; -I-=;BH------vs-5pyv}}rq6-\n--------qvpnqH------\f----\f----0}ntzn-{|yyly||}lr{q--0r{qvs--<<-JJJJJJJJJJJJJJJJJJ--0v{pyqr-Ipyv}}v{tl}yn{rlsntzr{K--rpA-qvssrP|y|-J-rpA5-qvssr9-|}npv\b-6H--<<-JJJ-高度色-JJJ--0vs-qrsv{rq5b`RlP\\Y\\_lNYaVabQR6----qvssrP|y|;to-J-trP|y|O\bUrvtu5tnqvr{ar\x07r9-d|yq]|vv|{6H--0r{qvs--<<-JJJJJJJJJJJ--<<-JJJ-纯色-JJJ--0vs-qrsv{rq5b`RlP\\Y\\_lP\\[`aN[a6----qvssrP|y|;to-J-p|{n{P|y|H--0r{qvs--<<-JJJJJJJJJJJ--0v{pyqr-Iy|tqr}uoslsntzr{K--0v{pyqr-Izn}lsntzr{K--0v{pyqr-Ip|y|lsntzr{K--0v{pyqr-Iny}unzn}lsntzr{K--0v{pyqr-Iny}unrlsntzr{K--0v{pyqr-I}rpynzn}lsntzr{K--_rsyrprqYvtu-rsyrprqYvtu-J-_rsyrprqYvtu5-rp@5-=;=-69-rp@5-=;=-69-rp@5-=;=-69-rp@5-=;=-6-6H--<<-nppzynv|{-5onxrq-v{qvrp-yvtuv{t-|{y\b6--0vsqrs-b`RlYVTUaZN]----rpA-yvtuZn}ar\x07ryJ-r\x07r?Q5-yvtuZn}9-b?-6H----rsyrprqYvtu;v{qvrpQvssr-8J-yvtuZn}ar\x07rya|Yv{rn5-yvtuZn}ar\x07ry-6;to-7-yvtuZn}V{r{v\bH--0ryr----rsyrprqYvtu;v{qvrpQvssr-8J-rp@5->;=-6H--0r{qvs--<<-z|qynv|{--0v{pyqr-In|zn}lsntzr{K--rsyrprqYvtu;v{qvrpQvssr-7J-qvssrP|y|;toH--rp@-|t|v{tYvtu-J-rsyrprqYvtu;v{qvrpQvssrH--0v{pyqr-Ir{zn}lsntzr{K--tylSntP|y|-J-rpA5-|t|v{tYvtu9-qvssrP|y|;n-6H--<<-JJJ-楼层显示-JJJ--sy|n-sy||\\}npv\b-J->;=H--vs-5u|{Sy||V{qr\x07-K-:=;=>-33-no5sy||-:-u|{Sy||V{qr\x076-K-=;FF6-\n----sy||\\}npv\b-J-=;?-7-zv{55>;=-8-PnzrnQvrpv|{;\b69->;=6H--\f--tylSntP|y|;n-J-tylSntP|y|;n-7-sy||\\}npv\b-7-ovtu{rH--<<-JJJJJJJJJJJJJJ--ZNV[lZ\\QRYlP\\Y\\_--<<色调映射-色彩空间转换--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{K--<<-JJJ-颜色增益调整-JJJ--rp@-toP|y|-J-tylSntP|y|;toH--rp@-uP|y|-J-to?u5toP|y|6H--uP|y|;\b-8J-p|y|`nnv|{H--uP|y|; -8J-p|y|Ovtu{rH--tylSntP|y|;to-J-u?to5uP|y|6H--<<-JJJ-全景图-JJJ--rp@-}n{|=a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|=lznv\x07h@j;\x07\b 6H--}n{|=a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|=a|crr\x079-}n{|=l ||z6H--}n{|=a|crr\x07-J-}n{|=a|crr\x07-7-zn@5}n{|=lznv\x076H--rp@-}n{|>a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|>lznv\x07h@j;\x07\b 6H--}n{|>a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|>a|crr\x079-}n{|>l ||z6H--}n{|>a|crr\x07-J-}n{|>a|crr\x07-7-zn@5}n{|>lznv\x076H--rpA-}n{|P|y|H--rpA-}n{|=P|y|-J-r\x07rPor5}n{|=lzn}9-}n{|=a|crr\x076H--rpA-}n{|>P|y|-J-r\x07rPor5}n{|>lzn}9-}n{|>a|crr\x076H--0vs-qrsv{rq5b`RlYbZV[N[PR6----}n{|=P|y|;n-J->;=-:-r\x07rPor5}n{|=lyzv{n{prZn}9-}n{|=a|crr\x076;H----}n{|>P|y|;n-J->;=-:-r\x07rPor5}n{|>lyzv{n{prZn}9-}n{|>a|crr\x076;H--0r{qvs--0vs-qrsv{rq5b`RlOYNPXla_N[`VaV\\[6----sy|n-oynpx]|tr-J-np|5:?;=-7-}|tr-8->;=6H----}n{|P|y|-J-zv\x075}n{|=P|y|9-OYNPXlP\\Y\\_9-zv{5>;=9-oynpx]|tr66H----}n{|P|y|-J-zv\x075}n{|P|y|9-}n{|>P|y|9-zn\x075=;=9-oynpx]|tr-:-]V-8->;=66H--0ryvs-qrsv{rq5b`Rl`]_RNQla_N[`VaV\\[6----rp?-prr{Pr{rP||q-J-r|yv|{-7-}v\x07ry_nv|-<-?;=H----sy|n-n{vv|{_nqv-J-qvn{pr5rp?5=;=9-=;=69-prr{Pr{rP||q6-7->;?H----sy|n-n{vv|{]|tr-J-qvn{pr5tylSntP||q;\x07\b9-prr{Pr{rP||q6-<-n{vv|{_nqvH----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-z||ur}5=;=9-=;?9-}|tr-:-n{vv|{]|tr66H--0ryr----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-}|tr6H--0r{qvs--tylSntP|y|-J-zv\x075}n{|P|y|9-tylSntP|y|9-z|qryNy}un6H--<<-JJJJJJJJJJJJJ--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0v{pyqr-Iqvurv{tlsntzr{K--0vs-qrsv{rq5b`RlRQY6----tylSntP|y|;n-J-Y|tQr}uH--0r{qvs--ZNV[lR[Q\f"),md=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-]U\\[T0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvs0vs-qrsv{rq5b`RlcR_aRelZN_X6--nvor-sy|n-znxH0r{qvsn\bv{t-sy|n-V_||sZnxHn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{Hn\bv{t-rp@-cvr]|vv|{H0vs{qrs-SYNal`UNQRQ--n\bv{t-rp@-[|znyH0r{qvs0v{pyqr-Ip|zz|{K0v{pyqr-Il}nlrr\x07K0v{pyqr-I?l}nlrr\x07K0v{pyqr-Iqv}ynprzr{zn}l}nlrr\x07K0v{pyqr-Ir{zn}l}nlrr\x07K0v{pyqr-Ip|y|l}nlrr\x07K0v{pyqr-Is|tl}nlrr\x07K0v{pyqr-Iz|}untrl}nlrr\x07K0v{pyqr-Ixv{{v{tl}nlrr\x07K0v{pyqr-Iunq|zn}l}nlrr\x07K0v{pyqr-Iy|tqr}uosl}nlrr\x07K0v{pyqr-Ipyv}}v{tl}yn{rl}nlrr\x07KZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--0v{pyqr-Ilrr\x07K--0v{pyqr-I?lrr\x07K--0v{pyqr-Ip|y|lrr\x07K--0v{pyqr-Iortv{{|znylrr\x07K--0v{pyqr-Iz|}u{|znylrr\x07K--0v{pyqr-Ixv{onrlrr\x07K--0v{pyqr-Ixv{{|znylrr\x07K--0v{pyqr-Iqrsny{|znylrr\x07K0vs{qrs-SYNal`UNQRQ-<<-[|zny-p|z}rq-vu-qrvnvr-ur{-SYNal`UNQRQ--[|zny-J-{|znyv r5-n{s|zrq[|zny-6H0r{qvs--0v{pyqr-Iortv{lrr\x07K--0v{pyqr-Iz|}untrlrr\x07K--0v{pyqr-Ixv{{v{tlrr\x07K--0v{pyqr-Iqv}ynprzr{zn}lrr\x07K--0v{pyqr-I}|wrplrr\x07K--0v{pyqr-Iy|tqr}uoslrr\x07K--0v{pyqr-Ipyv}}v{tl}yn{rlrr\x07K--cvr]|vv|{-J-:-z]|vv|{;\x07\b H--d|yq]|vv|{-J-rpA5n{s|zrq9->;=6H--0vsqrs-b`RlV[`aN[PV[T----d|yq]|vv|{-J-v{n{prZnv\x07-7-d|yq]|vv|{H--0r{qvs--d|yq]|vv|{-J-z|qryZnv\x07-7-d|yq]|vv|{H--zn@-pnzrn_|nv|{Znv\x07-J-zn@5vrZnv\x07h=jh=j9-vrZnv\x07h>jh=j9-vrZnv\x07h?jh=j9-vrZnv\x07h=jh>j9-vrZnv\x07h>jh>j9-vrZnv\x07h?jh>j9-vrZnv\x07h=jh?j9-vrZnv\x07h>jh?j9-vrZnv\x07h?jh?j6H--PnzrnQvrpv|{-J-{|znyv r5pnzrn_|nv|{Znv\x07-7-rp@5=;=9-=;=9-:>;=66H--0vs-qrsv{rq5b`RlRQY6----Y|tQr}u-J-y|t?5:z]|vv|{; 6H--0r{qvs--V_||sZnx-J-=;=H--0vs-qrsv{rq5b`RlcR_aRelZN_X6----V_||sZnx-J-r}5no5znx-:->;=69-=;>6H--0r{qvs--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Ir{zn}lrr\x07K--0v{pyqr-Iunq|zn}lrr\x07K--0v{pyqr-Is|tlrr\x07K--ZNV[lR[Q\f"),Ad=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-]U\\[T0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=6{vs|z-sy|n-sy||H{vs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b 6-7-C;=-:-X;6H----r{-p; -7-zv\x075X;\x07\x07\x079-pynz}5}-:-X;\x07\x07\x079-=;=9->;=69-p;\b6H\frp@-trP|y|O\bUrvtu5nz}yr?Q-tnqvr{ar\x07r9-rpA-d|yq]|vv|{6-\n--sy|n--J-5d|yq]|vv|{;\b-:-z|qryO|{qv{tZv{;\b6-<-5z|qryO|{qv{tZn\x07;\b-:-z|qryO|{qv{tZv{;\b6H--r{-r\x07r?Q5tnqvr{ar\x07r9-rp?59-=;B66;toH\fZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--<<-JJJ-顶部裁切-JJJ--sy|n-||sP]|tr-J-}|5pynz}5:PnzrnQvrpv|{;\b9-=;=9->;=69-@;=6H--vs-5----V_||sZnx-K-=;B-33----d|yq]|vv|{;\b-K-z|qryO|{qv{tZn\x07;\b-:-||sP]|tr-7-5z|qryO|{qv{tZn\x07;\b-:-z|qryO|{qv{tZv{;\b6--6-\n----qvpnqH--\f--<<-JJJJJJJJJJJJJJ--<<-JJJ-前置裁切计算-JJJ--0vs-[bZlPYV]]R_`-K-=----o||y-pyv}}rqH----rpA-pyv}}r]|vv|{H----0}ntzn-{|yyly||}ln----s|-5-v{-v-J-=H-v-I-[bZlPYV]]R_`H-v-88-6-\n------pyv}}r]|vv|{-J-pyv}}rh-v-j;znv\x07V{rr-7-d|yq]|vv|{H------pyv}}rq-J-5pyv}}rh-v-j;sy||V{qr\x07-I-=;=-\v\v-no5sy||-:-pyv}}rh-v-j;sy||V{qr\x076-I->;=6H------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\x07-K-:=;B-33-pyv}}r]|vv|{;\x07-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\b-K-:=;B-33-pyv}}r]|vv|{;\b-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{; -K-:=;B-33-pyv}}r]|vv|{; -I-=;BH------vs-5pyv}}rq6-\n--------qvpnqH------\f----\f----0}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--sy|n-sy||\\}npv\b-J->;=H--vs-5u|{Sy||V{qr\x07-K-:=;=>-33-no5sy||-:-u|{Sy||V{qr\x076-K-=;FF6-\n----sy||\\}npv\b-J-=;?-7-zv{55>;=-8-PnzrnQvrpv|{;\b69->;=6H--\f--tylSntP|y|;n-J-tylSntP|y|;n-7-sy||\\}npv\b-7-ovtu{rH--<<-JJJJJJJJJJJJJJ--ZNV[lZ\\QRYlP\\Y\\_--<<色调映射-色彩空间转换--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{K--<<-JJJ-颜色增益调整-JJJ--rp@-toP|y|-J-tylSntP|y|;toH--rp@-uP|y|-J-to?u5toP|y|6H--uP|y|;\b-8J-p|y|`nnv|{H--uP|y|; -8J-p|y|Ovtu{rH--tylSntP|y|;to-J-u?to5uP|y|6H--<<-JJJ-全景图-JJJ--rp@-}n{|=a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|=lznv\x07h@j;\x07\b 6H--}n{|=a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|=a|crr\x079-}n{|=l ||z6H--}n{|=a|crr\x07-J-}n{|=a|crr\x07-7-zn@5}n{|=lznv\x076H--rp@-}n{|>a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|>lznv\x07h@j;\x07\b 6H--}n{|>a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|>a|crr\x079-}n{|>l ||z6H--}n{|>a|crr\x07-J-}n{|>a|crr\x07-7-zn@5}n{|>lznv\x076H--rpA-}n{|P|y|H--rpA-}n{|=P|y|-J-r\x07rPor5}n{|=lzn}9-}n{|=a|crr\x076H--rpA-}n{|>P|y|-J-r\x07rPor5}n{|>lzn}9-}n{|>a|crr\x076H--0vs-qrsv{rq5b`RlYbZV[N[PR6----}n{|=P|y|;n-J->;=-:-r\x07rPor5}n{|=lyzv{n{prZn}9-}n{|=a|crr\x076;H----}n{|>P|y|;n-J->;=-:-r\x07rPor5}n{|>lyzv{n{prZn}9-}n{|>a|crr\x076;H--0r{qvs--0vs-qrsv{rq5b`RlOYNPXla_N[`VaV\\[6----sy|n-oynpx]|tr-J-np|5:?;=-7-}|tr-8->;=6H----}n{|P|y|-J-zv\x075}n{|=P|y|9-OYNPXlP\\Y\\_9-zv{5>;=9-oynpx]|tr66H----}n{|P|y|-J-zv\x075}n{|P|y|9-}n{|>P|y|9-zn\x075=;=9-oynpx]|tr-:-]V-8->;=66H--0ryvs-qrsv{rq5b`Rl`]_RNQla_N[`VaV\\[6----rp?-prr{Pr{rP||q-J-r|yv|{-7-}v\x07ry_nv|-<-?;=H----sy|n-n{vv|{_nqv-J-qvn{pr5rp?5=;=9-=;=69-prr{Pr{rP||q6-7->;?H----sy|n-n{vv|{]|tr-J-qvn{pr5tylSntP||q;\x07\b9-prr{Pr{rP||q6-<-n{vv|{_nqvH----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-z||ur}5=;=9-=;?9-}|tr-:-n{vv|{]|tr66H--0ryr----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-}|tr6H--0r{qvs--tylSntP|y|-J-zv\x075}n{|P|y|9-tylSntP|y|9-z|qryNy}un6H--<<-JJJJJJJJJJJJJJ--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0v{pyqr-Iqvurv{tlsntzr{K--0vs-qrsv{rq5b`RlRQY6----tylSntP|y|;n-J-Y|tQr}uH--0r{qvs--ZNV[lR[Q\f");var Fa={modelAlpha:new f.Uniform(0),progress:new f.Uniform(0),pano0_map:new f.Uniform(null),pano0_luminanceMap:new f.Uniform(null),pano0_matrix:new f.Uniform(new f.Matrix4),pano0_zoom:new f.Uniform(1),pano1_map:new f.Uniform(null),pano1_luminanceMap:new f.Uniform(null),pano1_matrix:new f.Uniform(new f.Matrix4),pano1_zoom:new f.Uniform(1),gradientTexture:new f.Uniform(null),clippers:new f.Uniform([]),shownFloorIndex:new f.Uniform(-1),constantColor:new f.Uniform(new f.Vector3),geometricError:new f.Uniform(0),pixelRatio:new f.Uniform(1),resolution:new f.Uniform(new f.Vector2(512,512)),floor:new f.Uniform(0),brightness:new f.Uniform(1),modelBoundingMin:new f.Uniform(new f.Vector3),modelBoundingMax:new f.Uniform(new f.Vector3),colorSaturation:new f.Uniform(0),colorBrightness:new f.Uniform(0)},gd={none:{vertexShader:dd,fragmentShader:hd,uniforms:f.UniformsUtils.merge([Fa,{opacity:{value:1}},f.UniformsLib.fog]),lights:!1,clipping:!1},basic:{vertexShader:pd,fragmentShader:vd,uniforms:f.UniformsUtils.merge([Fa,f.ShaderLib.basic.uniforms]),lights:!1,clipping:!0},phong:{vertexShader:md,fragmentShader:Ad,uniforms:f.UniformsUtils.merge([Fa,f.ShaderLib.phong.uniforms]),lights:!0,clipping:!0}},br=function(n){ue(t,n);function t(e,r){e===void 0&&(e="basic"),r===void 0&&(r={});var i=this,a,o,s,u,l,c,d,p,A,h,v,g,m,y,b,x,w,M,S,E,B,R,C,I,L,T=gd[e];i=n.call(this,{vertexShader:T.vertexShader,fragmentShader:T.fragmentShader,uniforms:f.UniformsUtils.clone(T.uniforms),lights:T.lights,clipping:T.clipping,defines:{USE_COLOR_CONSTANT:!1,USE_COLOR_ALTITUDE:!1,USE_EDL:!1,USE_HQ_WEIGHT:!1,USE_HQ_DEPTH:!1,NUM_CLIPPING_BOX:!1,USE_CLIPFLOOR:!1,USE_VERTEX_MARK:!1,USE_LUMINANCE:!1,USE_BLACK_TRANSITION:!1,USE_SPREAD_TRANSITION:!1,USE_POINT_NORMAL:!1,USE_POINT_CIRCLE:!1,USE_POINT_ADAPTIVE_SIZE:!1,USE_POINT_COLOR_ALTITUDE:!1}})||this,i.shaderType=e,i.color=new f.Color(16777215),i.map=null,i.lightMap=null,i.lightMapIntensity=1,i.aoMap=null,i.aoMapIntensity=1,i.specularMap=null,i.specular=new f.Color(1118481),i.alphaMap=null,i.envMap=null,i.reflectivity=1,i.refractionRatio=.98,i.emissiveMap=null,i.emissive=new f.Color(0),i.emissiveIntensity=1,i.bumpMap=null,i.bumpScale=1,i.normalMap=null,i.normalMapType=f.TangentSpaceNormalMap,i.normalScale=new f.Vector2(1,1),i.displacementMap=null,i.displacementScale=1,i.displacementBias=0,i.shininess=30;var F,D=null,V=null;return Object.defineProperties(i,{pano0:{get:function(){return D},set:function(z){if(D!==z){D=z,z===null?(this.uniforms.pano0_map.value=null,this.uniforms.pano0_luminanceMap.value=null,this.uniforms.pano0_matrix.value.identity(),this.uniforms.pano0_zoom.value=1):(this.uniforms.pano0_map.value=z.map instanceof qe?z.map.texture:z.map,this.uniforms.pano0_luminanceMap.value=z.luminanceMap instanceof qe?z.luminanceMap.texture:z.luminanceMap,this.uniforms.pano0_matrix.value.copy(z.matrix),this.uniforms.pano0_zoom.value=z.zoom);var U=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,q=this.defines.USE_LUMINANCE;q!==U&&(this.defines.USE_LUMINANCE=U,this.needsUpdate=!0)}}},pano1:{get:function(){return V},set:function(z){if(V!==z){V=z,z===null?(this.uniforms.pano1_map.value=null,this.uniforms.pano1_luminanceMap.value=null,this.uniforms.pano1_matrix.value.identity(),this.uniforms.pano1_zoom.value=1):(this.uniforms.pano1_map.value=z.map instanceof qe?z.map.texture:z.map,this.uniforms.pano1_luminanceMap.value=z.luminanceMap instanceof qe?z.luminanceMap.texture:z.luminanceMap,this.uniforms.pano1_matrix.value.copy(z.matrix),this.uniforms.pano1_zoom.value=z.zoom);var U=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,q=this.defines.USE_LUMINANCE;q!==U&&(this.defines.USE_LUMINANCE=U,this.needsUpdate=!0)}}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(z){this.uniforms.modelAlpha.value=z}},progress:{get:function(){return this.uniforms.progress.value},set:function(z){this.uniforms.progress.value=z}},transition:{get:function(){return this.defines.USE_BLACK_TRANSITION?"BLACK":this.defines.USE_SPREAD_TRANSITION?"SPREAD":"FADE"},set:function(z){var U=this.defines.USE_BLACK_TRANSITION,q=this.defines.USE_SPREAD_TRANSITION;this.defines.USE_BLACK_TRANSITION=!1,this.defines.USE_SPREAD_TRANSITION=!1,this.defines["USE_".concat(z,"_TRANSITION")]=!0;var G=!1;U!==this.defines.USE_BLACK_TRANSITION&&(G=!0),q!==this.defines.USE_SPREAD_TRANSITION&&(G=!0),G&&(this.needsUpdate=!0)}},colorStyle:{get:function(){return this.defines.USE_COLOR_CONSTANT?"CONSTANT":this.defines.USE_COLOR_ALTITUDE?"ALTITUDE":"RGB"},set:function(z){var U=z==="CONSTANT",q=z==="ALTITUDE";this.defines.USE_COLOR_CONSTANT!==U&&(this.defines.USE_COLOR_CONSTANT=U,this.needsUpdate=!0),this.defines.USE_COLOR_ALTITUDE!==q&&(this.defines.USE_COLOR_ALTITUDE=q,this.needsUpdate=!0)}},constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(z){this.uniforms.constantColor.value=z}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(z){this.uniforms.opacity.value=z}},shownFloorIndex:{get:function(){return this.uniforms.shownFloorIndex.value},set:function(z){this.uniforms.shownFloorIndex.value=z}},gradientTexture:{get:function(){return this.uniforms.gradientTexture.value},set:function(z){this.uniforms.gradientTexture.value=z}},brightness:{get:function(){return this.uniforms.brightness.value},set:function(z){this.uniforms.brightness.value=z}},clippers:{get:function(){return F},set:function(z){F!==z&&(F=z,this.uniforms.clippers.value=(F||[]).map(function(U){var q=typeof U.floorIndex=="number"?U.floorIndex:-1,G=new f.Matrix4().getInverse(U.clippingBoxMatrix);return{matrixInverse:G,floorIndex:q}}),this.needsUpdate=!0)}},useEDL:{get:function(){return this.defines.USE_EDL},set:function(z){z!==this.defines.USE_EDL&&(this.defines.USE_EDL=z,this.needsUpdate=!0)}},useHQWeight:{get:function(){return this.defines.USE_HQ_WEIGHT},set:function(z){z!==this.defines.USE_HQ_WEIGHT&&(this.defines.USE_HQ_WEIGHT=z,this.needsUpdate=!0)}},useHQDepth:{get:function(){return this.defines.USE_HQ_DEPTH},set:function(z){z!==this.defines.USE_HQ_DEPTH&&(this.defines.USE_HQ_DEPTH=z,this.needsUpdate=!0)}},floor:{get:function(){return this.uniforms.floor.value},set:function(z){this.uniforms.floor.value=z}},colorSaturation:{get:function(){return this.uniforms.colorSaturation.value},set:function(z){this.uniforms.colorSaturation.value=z}},colorBrightness:{get:function(){return this.uniforms.colorBrightness.value},set:function(z){this.uniforms.colorBrightness.value=z}}}),i.pano0=(a=r.pano0)!==null&&a!==void 0?a:ge.pano0,i.pano1=(o=r.pano1)!==null&&o!==void 0?o:ge.pano1,i.modelAlpha=(s=r.modelAlpha)!==null&&s!==void 0?s:ge.modelAlpha,i.progress=(u=r.progress)!==null&&u!==void 0?u:ge.progress,i.transition=(l=r.transition)!==null&&l!==void 0?l:ge.transition,i.constantColor=(c=r.constantColor)!==null&&c!==void 0?c:ge.constantColor,i.opacity=(d=r.opacity)!==null&&d!==void 0?d:ge.opacity,i.floorStyle=(p=r.floorStyle)!==null&&p!==void 0?p:ge.floorStyle,i.shownFloorIndex=(A=r.shownFloorIndex)!==null&&A!==void 0?A:ge.shownFloorIndex,i.clippers=(h=r.clippers)!==null&&h!==void 0?h:ge.clippers,i.useEDL=(v=r.useEDL)!==null&&v!==void 0?v:ge.useEDL,i.useHQWeight=(g=r.useHQWeight)!==null&&g!==void 0?g:ge.useHQWeight,i.useHQDepth=(m=r.useHQDepth)!==null&&m!==void 0?m:ge.useHQDepth,i.pointSize=(y=r.pointSize)!==null&&y!==void 0?y:ge.pointSize,i.colorStyle=(b=r.colorStyle)!==null&&b!==void 0?b:ge.colorStyle,i.pointShape=(x=r.pointShape)!==null&&x!==void 0?x:ge.pointShape,i.pointScale=(w=r.pointScale)!==null&&w!==void 0?w:ge.pointScale,i.pointBack=(M=r.pointBack)!==null&&M!==void 0?M:ge.pointBack,i.pointMinPixel=(S=r.pointMinPixel)!==null&&S!==void 0?S:ge.pointMinPixel,i.pointMaxPixel=(E=r.pointMaxPixel)!==null&&E!==void 0?E:ge.pointMaxPixel,i.gradientTexture=(B=r.gradientTexture)!==null&&B!==void 0?B:ge.gradientTexture,i.brightness=(R=r.brightness)!==null&&R!==void 0?R:ge.brightness,i.colorSaturation=(C=r.colorSaturation)!==null&&C!==void 0?C:ge.colorSaturation,i.colorBrightness=(I=r.colorBrightness)!==null&&I!==void 0?I:ge.colorBrightness,i.customShaders=(L=r.customShaders)!==null&&L!==void 0?L:ge.customShaders,i.customShaderHash="",i.customShaderUniforms={},i.customShaderDefines={},i.floor=0,i.transparent=!1,i}return t.prototype.onBeforeCompile=function(e,r){var i=this,a,o,s=this.customShaders.filter(function(g){return g.type.includes(i.shaderType)}),u=s.reduce(function(g,m){return g+m.vertex.mainBefore},""),l=s.reduce(function(g,m){return g+m.vertex.mainStart},""),c=s.reduce(function(g,m){return g+m.vertex.mainEnd},""),d=s.reduce(function(g,m){return g+m.fragment.mainBefore},""),p=s.reduce(function(g,m){return g+m.fragment.mainStart},""),A=s.reduce(function(g,m){return g+m.fragment.mainModelColor},""),h=s.reduce(function(g,m){return g+m.fragment.mainEnd},"");e.vertexShader=e.vertexShader.replace(/MAIN_BEFORE/g,u),e.fragmentShader=e.fragmentShader.replace(/MAIN_BEFORE/g,d),e.vertexShader=e.vertexShader.replace(/MAIN_START/g,l),e.fragmentShader=e.fragmentShader.replace(/MAIN_START/g,p),e.vertexShader=e.vertexShader.replace(/MAIN_END/g,c),e.fragmentShader=e.fragmentShader.replace(/MAIN_END/g,h),e.fragmentShader=e.fragmentShader.replace(/MAIN_MODEL_COLOR/g,A);var v=String((o=(a=this.clippers)===null||a===void 0?void 0:a.length)!==null&&o!==void 0?o:0);e.vertexShader=e.vertexShader.replace(/NUM_CLIPPERS/g,v),e.fragmentShader=e.fragmentShader.replace(/NUM_CLIPPERS/g,v),s.forEach(function(g){g.onBeforeCompile(e,r)})},t.prototype.refreshUniforms=function(e){var r,i,a=this.uniforms;a.diffuse&&a.diffuse.value.copy(this.color),a.opacity&&(a.opacity.value=this.opacity),a.color&&a.diffuse.value.copy(this.color),a.emissive&&a.emissive.value.copy(this.emissive).multiplyScalar(this.emissiveIntensity),a.map&&(a.map.value=this.map),a.alphaMap&&(a.alphaMap.value=this.alphaMap),a.specularMap&&(a.specularMap.value=this.specularMap),a.envMap&&(a.envMap.value=this.envMap,a.flipEnvMap.value=!((r=this.envMap)===null||r===void 0)&&r.isCubeTexture?-1:1,a.reflectivity.value=this.reflectivity,a.refractionRatio.value=this.refractionRatio,a.maxMipLevel.value=this.envMap&&(i=e==null?void 0:e.properties.get(this.envMap).__maxMipLevel)!==null&&i!==void 0?i:0),a.lightMap&&(a.lightMap.value=this.lightMap,a.lightMapIntensity.value=this.lightMapIntensity),a.aoMap&&(a.aoMap.value=this.aoMap,a.aoMapIntensity.value=this.aoMapIntensity),a.specular&&a.specular.value.copy(this.specular),a.shininess&&(a.shininess.value=Math.max(this.shininess,1e-4)),a.emissiveMap&&(a.emissiveMap.value=this.emissiveMap),a.bumpMap&&(a.bumpMap.value=this.bumpMap,a.bumpScale.value=this.bumpScale,this.side===f.BackSide&&(a.bumpScale.value*=-1)),a.normalMap&&(a.normalMap.value=this.normalMap,a.normalScale.value.copy(this.normalScale),this.side===f.BackSide&&a.normalScale.value.negate()),a.displacementMap&&(a.displacementMap.value=this.displacementMap,a.displacementScale.value=this.displacementScale,a.displacementBias.value=this.displacementBias);var o;this.map?o=this.map:this.specularMap?o=this.specularMap:this.displacementMap?o=this.displacementMap:this.normalMap?o=this.normalMap:this.bumpMap?o=this.bumpMap:this.alphaMap?o=this.alphaMap:this.emissiveMap&&(o=this.emissiveMap),o!==void 0&&(o.matrixAutoUpdate===!0&&o.updateMatrix(),a.uvTransform.value.copy(o.matrix));var s;this.aoMap?s=this.aoMap:this.lightMap&&(s=this.lightMap),s!==void 0&&(s.matrixAutoUpdate===!0&&s.updateMatrix(),a.uv2Transform.value.copy(s.matrix))},t.prototype.update=function(e,r,i){var a="".concat(i.id,":").concat(i.materialVersion);a!==this.syncModelVersion&&(Object.assign(this,i.getMaterial()),this.syncModelVersion=a);var o=this.customShaders.map(function(m){return m.getHash()}).join("");this.customShaderHash!==o&&(this.customShaderHash=o,this.needsUpdate=!0);for(var s=this.customShaders.reduce(function(m,y){return Object.assign(m,y.defines)},{}),u=Object.keys(this.customShaderDefines),l=0,c=u;l<c.length;l++){var d=c[l];delete this.defines[d]}this.customShaderDefines=s,Object.assign(this.defines,this.customShaderDefines);for(var p=this.customShaders.reduce(function(m,y){return Object.assign(m,y.uniforms)},{}),A=Object.keys(this.customShaderUniforms),h=0,v=A;h<v.length;h++){var g=v[h];delete this.uniforms[g]}this.customShaderUniforms=p,Object.assign(this.uniforms,this.customShaderUniforms),this.visible=!0,this.refreshUniforms(e),this.shaderType==="none"?(this.depthWrite=!1,this.transparent=!0):(this.transparent=!1,this.depthWrite=!0,this.shownFloorIndex>-1&&(this.transparent=this.shownFloorIndex!==this.floor),this.opacity<1&&(this.transparent=!0),this.alphaMap&&(this.transparent=!0),this.brightness<1&&(this.transparent=!0),this.transparent&&(this.depthWrite=!1),this.floorStyle==="VISIBILITY"&&this.shownFloorIndex!==-1&&this.floor!==this.shownFloorIndex&&(this.visible=!1)),this.uniforms.pixelRatio.value=r.pixelRatio,this.uniforms.resolution.value.copy(r.resolution),this.uniforms.modelBoundingMax.value.copy(i.bounding.max),this.uniforms.modelBoundingMin.value.copy(i.bounding.min)},t.prototype.copy=function(e){return n.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.specular.copy(e.specular),this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.emissiveMap=e.emissiveMap,this.emissive.copy(e.emissive),this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.shininess=e.shininess,this.customShaders=e.customShaders,this.pano0=e.pano0,this.pano1=e.pano1,this.modelAlpha=e.modelAlpha,this.progress=e.progress,this.transition=e.transition,this.opacity=e.opacity,this.floorStyle=e.floorStyle,this.colorStyle=e.colorStyle,this.constantColor=e.constantColor,this.shownFloorIndex=e.shownFloorIndex,this.brightness=e.brightness,this.clippers=e.clippers,this.useEDL=e.useEDL,this.useHQWeight=e.useHQWeight,this.useHQDepth=e.useHQDepth,this.pointSize=e.pointSize,this.pointShape=e.pointShape,this.pointScale=e.pointScale,this.pointBack=e.pointBack,this.pointMinPixel=e.pointMinPixel,this.pointMaxPixel=e.pointMaxPixel,this.gradientTexture=e.gradientTexture,this.floor=e.floor,this.colorSaturation=e.colorSaturation,this.colorBrightness=e.colorBrightness,this.refreshUniforms(),this},t.prototype.clone=function(){return new this.constructor(this.shaderType).copy(this)},t}(f.ShaderMaterial);const yd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("{vs|z-sy|n-sy||H0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6--n\bv{t-rp@-[|znyH0r{qvs0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvsp-Pyv}}r-\n--znA-znv\x07V{rrH--sy|n-sy||V{qr\x07H\fH0vs-[bZlPYV]]R_`-K-=--{vs|z-Pyv}}r-pyv}}rh[bZlPYV]]R_`jH0r{qvsn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{Hn\bv{t-rp@-P|y|Hn\bv{t-sy|n-]|v{`v rH{vs|z-sy|n-|}npv\bH{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-u|{Sy||V{qr\x07H<<u调整{vs|z-sy|n-p|y|`nnv|{H{vs|z-sy|n-p|y|Ovtu{rH0v{pyqr-Ip|zz|{K0v{pyqr-Is|tl}nlsntzr{K0v{pyqr-Iy|tqr}uosl}nlsntzr{K0v{pyqr-Ipyv}}v{tl}yn{rl}nlsntzr{Krp@-nqwP|y|arz}rnr5rp@-p|y|9-sy|n-rz}rnr6\n----<<-将色温范围从-:>;=-到->;=-映射到实际的色温范围----sy|n-rz}-J-5rz}rnr-8->;=6-7-B===;=H-<<-范围从-=-到->====----<<-计算色温系数----sy|n-lsnp|9-tlsnp|9-olsnp|H----vs-5rz}-IJ-CC==;=6-\n--------lsnp|-J->;=H--------tlsnp|-J-=;@F==E>BDEDCF=>FC=DEA-7-y|t5rz}-<->==;=6-:-=;C@>EA>AA@DEEC?DAB=FEH--------olsnp|-J-rz}-IJ->F==;=-L-=;=-G-=;BA@?=CDEF>>=>FC=DEA@-7-y|t5rz}-<->==;=-:->=;=6-:->;>FC?BA=EF>AH----\f-ryr-\n--------lsnp|-J->;?F?F@C>EC=C?DAB=FE=A-7-}|5rz}-<->==;=-:-C=;=9-:=;>@@?=ADBF?6H--------tlsnp|-J->;>?FEF=EC=EFB?FA>>DCB-7-}|5rz}-<->==;=-:-C=;=9-:=;=DBB>AEAF?6H--------olsnp|-J->;=H----\f----<<-调整颜色----rp@-nqwrqP|y|H----nqwrqP|y|;-J-pynz}5p|y|;-7-lsnp|9-=;=9->;=6H----nqwrqP|y|;t-J-pynz}5p|y|;t-7-tlsnp|9-=;=9->;=6H----nqwrqP|y|;o-J-pynz}5p|y|;o-7-olsnp|9-=;=9->;=6H----r{-nqwrqP|y|H\frp@-to?u5rp@-p6-\n----rpA-X-J-rpA5=;=9-:>;=-<-@;=9-?;=-<-@;=9-:>;=6H----rpA-}-J-zv\x075rpA5p;ot9-X; 69-rpA5p;to9-X;\x07\b69-r}5p;o9-p;t66H----rpA-\0-J-zv\x075rpA5};\x07\b9-p;69-rpA5p;9-};\b \x0769-r}5};\x079-p;66H----sy|n-q-J-\0;\x07-:-zv{5\0;9-\0;\b6H----sy|n-r-J->;=r:>=H----r{-rp@5no5\0; -8-5\0;-:-\0;\b6-<-5C;=-7-q-8-r669-q-<-5\0;\x07-8-r69-\0;\x076H\frp@-u?to5rp@-p6-\n----rpA-X-J-rpA5>;=9-?;=-<-@;=9->;=-<-@;=9-@;=6H----rp@-}-J-no5snp5p;\x07\x07\x07-8-X;\x07\b 6-7-C;=-:-X;6H----r{-p; -7-zv\x075X;\x07\x07\x079-pynz}5}-:-X;\x07\x07\x079-=;=9->;=69-p;\b6H\fZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--<<-JJJ-点大小剔除-JJJ--vs-5]|v{`v r-I-=;==>6-\n----qvpnqH--\f--<<-JJJ-前置裁切计算-JJJ--0vs-[bZlPYV]]R_`-K-=----o||y-pyv}}rqH----rpA-pyv}}r]|vv|{H----0}ntzn-{|yyly||}ln----s|-5-v{-v-J-=H-v-I-[bZlPYV]]R_`H-v-88-6-\n------pyv}}r]|vv|{-J-pyv}}rh-v-j;znv\x07V{rr-7-d|yq]|vv|{H------pyv}}rq-J-5pyv}}rh-v-j;sy||V{qr\x07-I-=;=-\v\v-no5sy||-:-pyv}}rh-v-j;sy||V{qr\x076-I->;=6H------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\x07-K-:=;B-33-pyv}}r]|vv|{;\x07-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\b-K-:=;B-33-pyv}}r]|vv|{;\b-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{; -K-:=;B-33-pyv}}r]|vv|{; -I-=;BH------vs-5pyv}}rq6-\n--------qvpnqH------\f----\f----0}ntzn-{|yyly||}lr{q--0r{qvs--<<-JJJJJJJJJJJJJJJJ--<<-JJJ-形状裁切-JJJ--0vs-qrsv{rq5b`Rl]\\V[al`UN]RlPV_PYR6----sy|n--J-?;=-7-tyl]|v{P||q;\x07-:->;=H----sy|n--J-?;=-7-tyl]|v{P||q;\b-:->;=H----sy|n-pp-J-7-8-7H----vs-5]|v{`v r-K-@;=-33-pp-K->;=6-\n------qvpnqH----\f--0r{qvs--<<-JJJJJJJJJJJJJ--0v{pyqr-Ipyv}}v{tl}yn{rlsntzr{K--0v{pyqr-Iy|tqr}uoslsntzr{K--<<-JJJ-颜色-JJJ--rpA-sv{nyP|y|-J-_TOa|Yv{rn5rpA5P|y|9-|}npv\b66H--0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6----0vs-qrsv{rq5b`Rl]\\V[alONPXlUVQQR[6------rp@-pnzrnQvrpv|{-J-{|znyv r5pnzrn]|vv|{-:-d|yq]|vv|{;\x07\b 6H------vs-5q|5pnzrnQvrpv|{9-[|zny6-I-=;=6-\n--------qvpnqH------\f----0ryvs-qrsv{rq5b`Rl]\\V[alONPXlQN_X6------rp@-pnzrnQvrpv|{-J-{|znyv r5pnzrn]|vv|{-:-d|yq]|vv|{;\x07\b 6H------vs-5q|5pnzrnQvrpv|{9-[|zny6-I-=;=6-\n--------sv{nyP|y|;\x07\b -J-sv{nyP|y|;\x07\b -7-=;EH------\f----0r{qvs--0r{qvs--tylSntP|y|-J-sv{nyP|y|H--<<-JJJJJJJJJJJ--<<-JJJ-楼层显示-JJJ--sy|n-sy||\\}npv\b-J->;=H--vs-5u|{Sy||V{qr\x07-K-:=;=>-33-no5sy||-:-u|{Sy||V{qr\x076-K-=;FF6-\n----sy||\\}npv\b-J-=;>-7-zv{55>;=-8-PnzrnQvrpv|{;\b69->;=6H--\f--tylSntP|y|;n-J-tylSntP|y|;n-7-sy||\\}npv\bH--<<-JJJJJJJJJJJJJJ--tylSntP|y|;n-J-tylSntP|y|;n-7-z|qryNy}unH--ZNV[lZ\\QRYlP\\Y\\_--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{K--<<-JJJ-颜色增益调整-JJJ--rp@-toP|y|-J-tylSntP|y|;toH--rp@-uP|y|-J-to?u5toP|y|6H--uP|y|;\b-8J-p|y|`nnv|{H--uP|y|; -8J-p|y|Ovtu{rH--tylSntP|y|;to-J-u?to5uP|y|6H--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0vs-qrsv{rq5b`RlRQY6----tylSntP|y|;n-J-Y|tQr}uH--0r{qvs--0vs-qrsv{rq5b`RlU^ldRVTUa6----sy|n-qvn{pr-J-?;=-7-yr{tu5tyl]|v{P||q;\x07\b-:-=;B6H----sy|n-rvtu-J-zn\x075=;=9->;=-:-qvn{pr6H----rvtu-J-}|5rvtu9->;B6H----tylSntP|y|;n-J-rvtuH----tylSntP|y|;\x07\b -J-tylSntP|y|;\x07\b -7-rvtuH--0r{qvs--ZNV[lR[Q\f"),bd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("nvor-rp@-p|y|H0vs-qrsv{rq5b`RlP\\Y\\_lP\\[`aN[a6--{vs|z-rp@-p|{n{P|y|H0r{qvs0vs-qrsv{rq5b`RlP\\Y\\_lNYaVabQR6--{vs|z-nz}yr?Q-tnqvr{ar\x07rH0r{qvs0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvs{vs|z-rp?-r|yv|{H{vs|z-sy|n-}v\x07ry_nv|H{vs|z-sy|n-}|v{`pnyrH{vs|z-sy|n-}|v{Zv{]v\x07ryH{vs|z-sy|n-}|v{Zn\x07]v\x07ryH{vs|z-sy|n-|}npv\bH{vs|z-sy|n-tr|zrvpR|H{vs|z-rp@-z|qryO|{qv{tZn\x07H{vs|z-rp@-z|qryO|{qv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<传递nvor的p|y|到s里使用--<<动态调整}|v{`v r--sy|n-rny]|v{`v r-J-}|v{`pnyr-7-}v\x07ry_nv|H--0vs-qrsv{rq5b`Rl]\\V[al`VgRlTR\\ZRa_VP6----rny]|v{`v r-7J-tr|zrvpR|H----sy|n-urvtu-J->;=-<-}|wrpv|{Znv\x07h>jh>j-7-zv\x075>;=9-:z]|vv|{; 9-:}|wrpv|{Znv\x07h?jh@j6-7-?;=H----rny]|v{`v r-J-r|yv|{;\b-7-rny]|v{`v r-<-urvtuH--0ryvs-qrsv{rq5b`Rl]\\V[al`VgRlNaaR[bNaV\\[6----sy|n-urvtu-J->;=-<-}|wrpv|{Znv\x07h>jh>j-7-zv\x075>;=9-:z]|vv|{; 9-:}|wrpv|{Znv\x07h?jh@j6-7-?;=H----rny]|v{`v r-J-r|yv|{;\b-7-rny]|v{`v r-<-urvtuH--0r{qvs--tyl]|v{`v r-J-pynz}5rny]|v{`v r9-}|v{Zv{]v\x07ry-7-}v\x07ry_nv|9-}|v{Zn\x07]v\x07ry-7-}v\x07ry_nv|6H--]|v{`v r-J-tyl]|v{`v rH--P|y|-J-p|y|H--<<-JJJ-高度色-JJJ--0vs-qrsv{rq5b`RlP\\Y\\_lNYaVabQR6----P|y|-J-trP|y|O\bUrvtu5tnqvr{ar\x07r9-d|yq]|vv|{6H--0r{qvs--<<-JJJJJJJJJJJ--<<-JJJ-纯色-JJJ--0vs-qrsv{rq5b`RlP\\Y\\_lP\\[`aN[a6----P|y|-J-p|{n{P|y|H--0r{qvs--<<-JJJJJJJJJJJ--0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6----[|zny-J-{|znyv r5zn@5z|qryZnv\x076-7-{|zny6H--0r{qvs--0vs-qrsv{rq5b`RlRQY6----Y|tQr}u-J-y|t?5:z]|vv|{; 6H--0r{qvs--0vs-qrsv{rq5b`RlU^lQR]aU6----<<-sy|n-}|wSnp|-J-:=;B-7-r|yv|{;\b-<-5n{5s|-<-?;=6-7-z]|vv|{; 6H----<<-sy|n-_nqv-J-rny]|v{`v r-<-}|wSnp|H----sy|n-|vtv{nyQr}u-J-tyl]|vv|{;H----sy|n-nqwrqQr}u-J-|vtv{nyQr}u-8-=;>H----sy|n-nqw-J-nqwrqQr}u-<-|vtv{nyQr}uH----z]|vv|{;\x07\b -J-z]|vv|{;\x07\b -7-nqwH----tyl]|vv|{-J-}|wrpv|{Znv\x07-7-z]|vv|{H--0r{qvs--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Is|tlrr\x07K--ZNV[lR[Q\f");var xd=Object.assign({pointScale:new f.Uniform(1),pointMinPixel:new f.Uniform(1),pointMaxPixel:new f.Uniform(1),opacity:new f.Uniform(1),gradientTexture:new f.Uniform(null),modelAlpha:new f.Uniform(0),clippers:new f.Uniform([]),shownFloorIndex:new f.Uniform(-1),constantColor:new f.Uniform(new f.Vector3),geometricError:new f.Uniform(0),pixelRatio:new f.Uniform(1),resolution:new f.Uniform(new f.Vector2(512,512)),floor:new f.Uniform(0),brightness:new f.Uniform(1),modelBoundingMin:new f.Uniform(new f.Vector3),modelBoundingMax:new f.Uniform(new f.Vector3),colorSaturation:new f.Uniform(0),colorBrightness:new f.Uniform(0)},f.UniformsUtils.clone(f.UniformsLib.fog)),Pi=function(n){ue(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,u,l,c,d,p,A,h,v,g,m,y,b,x,w,M,S,E,B,R,C,I=n.call(this,{vertexShader:bd,fragmentShader:yd,uniforms:f.UniformsUtils.clone(xd),lights:!1,clipping:!0,defines:{USE_COLOR_CONSTANT:!1,USE_COLOR_ALTITUDE:!1,USE_EDL:!1,USE_HQ_WEIGHT:!1,USE_HQ_DEPTH:!1,NUM_CLIPPING_BOX:!1,USE_CLIPFLOOR:!1,USE_VERTEX_MARK:!1,USE_MAP:!0,USE_UV:!0,USE_LUMINANCE:!1,USE_BLACK_TRANSITION:!1,USE_POINT_NORMAL:!1,USE_POINT_SHAPE_CIRCLE:!1,USE_POINT_SIZE_ATTENUATION:!1,USE_POINT_SIZE_GEOMETRIC:!1,USE_POINT_BACK_HIDDEN:!1,USE_POINT_BACK_DARK:!1}})||this,L;return I.customShaderHash="",I.customShaderUniforms={},I.customShaderDefines={},Object.defineProperties(I,{constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(T){this.uniforms.constantColor.value=T}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(T){this.uniforms.opacity.value=T}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(T){this.uniforms.modelAlpha.value=T}},shownFloorIndex:{get:function(){return this.uniforms.shownFloorIndex.value},set:function(T){this.uniforms.shownFloorIndex.value=T}},clippers:{get:function(){return L},set:function(T){L!==T&&(L=T,this.uniforms.clippers.value=(L||[]).map(function(F){var D=typeof F.floorIndex=="number"?F.floorIndex:-1,V=new f.Matrix4().getInverse(F.clippingBoxMatrix);return{matrixInverse:V,floorIndex:D}}),this.needsUpdate=!0)}},colorStyle:{get:function(){return this.defines.USE_COLOR_CONSTANT?"CONSTANT":this.defines.USE_COLOR_ALTITUDE?"ALTITUDE":"RGB"},set:function(T){var F=T==="CONSTANT",D=T==="ALTITUDE";this.defines.USE_COLOR_CONSTANT!==F&&(this.defines.USE_COLOR_CONSTANT=F,this.needsUpdate=!0),this.defines.USE_COLOR_ALTITUDE!==D&&(this.defines.USE_COLOR_ALTITUDE=D,this.needsUpdate=!0)}},pointSize:{get:function(){return this.defines.USE_POINT_SIZE_GEOMETRIC===!0?"GEOMETRIC":this.defines.USE_POINT_SIZE_ATTENUATION===!0?"ATTENUATION":"FIXED"},set:function(T){var F=T==="ATTENUATION",D=T==="GEOMETRIC";this.defines.USE_POINT_SIZE_GEOMETRIC!==D&&(this.defines.USE_POINT_SIZE_GEOMETRIC=D,this.needsUpdate=!0),this.defines.USE_POINT_SIZE_ATTENUATION!==F&&(this.defines.USE_POINT_SIZE_ATTENUATION=F,this.needsUpdate=!0)}},pointShape:{get:function(){return this.defines.USE_POINT_SHAPE_CIRCLE===!0?"CIRCLE":"SQUARE"},set:function(T){var F=T==="CIRCLE";this.defines.USE_POINT_SHAPE_CIRCLE!==F&&(this.defines.USE_POINT_SHAPE_CIRCLE=F,this.needsUpdate=!0)}},pointScale:{get:function(){return this.uniforms.pointScale.value},set:function(T){this.uniforms.pointScale.value=T}},pointBack:{get:function(){return this.defines.USE_POINT_BACK_HIDDEN===!0?"HIDDEN":this.defines.USE_POINT_BACK_DARK===!0?"DARK":"VISIBLE"},set:function(T){var F=T==="HIDDEN",D=T==="DARK";this.defines.USE_POINT_BACK_HIDDEN!==F&&(this.defines.USE_POINT_BACK_HIDDEN=F,this.needsUpdate=!0),this.defines.USE_POINT_BACK_DARK!==D&&(this.defines.USE_POINT_BACK_DARK=D,this.needsUpdate=!0)}},pointMinPixel:{get:function(){return this.uniforms.pointMinPixel.value},set:function(T){this.uniforms.pointMinPixel.value=T}},pointMaxPixel:{get:function(){return this.uniforms.pointMaxPixel.value},set:function(T){this.uniforms.pointMaxPixel.value=T}},useEDL:{get:function(){return this.defines.USE_EDL},set:function(T){T!==this.defines.USE_EDL&&(this.defines.USE_EDL=T,this.needsUpdate=!0)}},useHQWeight:{get:function(){return this.defines.USE_HQ_WEIGHT},set:function(T){T!==this.defines.USE_HQ_WEIGHT&&(this.defines.USE_HQ_WEIGHT=T,this.needsUpdate=!0)}},useHQDepth:{get:function(){return this.defines.USE_HQ_DEPTH},set:function(T){T!==this.defines.USE_HQ_DEPTH&&(this.defines.USE_HQ_DEPTH=T,this.needsUpdate=!0)}},gradientTexture:{get:function(){return this.uniforms.gradientTexture.value},set:function(T){this.uniforms.gradientTexture.value=T}},floor:{get:function(){return this.uniforms.floor.value},set:function(T){this.uniforms.floor.value=T}},brightness:{get:function(){return this.uniforms.brightness.value},set:function(T){this.uniforms.brightness.value=T}},colorSaturation:{get:function(){return this.uniforms.colorSaturation.value},set:function(T){this.uniforms.colorSaturation.value=T}},colorBrightness:{get:function(){return this.uniforms.colorBrightness.value},set:function(T){this.uniforms.colorBrightness.value=T}}}),I.pano0=(r=e.pano0)!==null&&r!==void 0?r:ge.pano0,I.pano1=(i=e.pano1)!==null&&i!==void 0?i:ge.pano1,I.modelAlpha=(a=e.modelAlpha)!==null&&a!==void 0?a:ge.modelAlpha,I.progress=(o=e.progress)!==null&&o!==void 0?o:ge.progress,I.transition=(s=e.transition)!==null&&s!==void 0?s:ge.transition,I.colorStyle=(u=e.colorStyle)!==null&&u!==void 0?u:ge.colorStyle,I.constantColor=(l=e.constantColor)!==null&&l!==void 0?l:ge.constantColor,I.opacity=(c=e.opacity)!==null&&c!==void 0?c:ge.opacity,I.floorStyle=(d=e.floorStyle)!==null&&d!==void 0?d:ge.floorStyle,I.shownFloorIndex=(p=e.shownFloorIndex)!==null&&p!==void 0?p:ge.shownFloorIndex,I.clippers=(A=e.clippers)!==null&&A!==void 0?A:ge.clippers,I.useEDL=(h=e.useEDL)!==null&&h!==void 0?h:ge.useEDL,I.useHQWeight=(v=e.useHQWeight)!==null&&v!==void 0?v:ge.useHQWeight,I.useHQDepth=(g=e.useHQDepth)!==null&&g!==void 0?g:ge.useHQDepth,I.pointShape=(m=e.pointShape)!==null&&m!==void 0?m:ge.pointShape,I.pointSize=(y=e.pointSize)!==null&&y!==void 0?y:ge.pointSize,I.pointScale=(b=e.pointScale)!==null&&b!==void 0?b:ge.pointScale,I.pointBack=(x=e.pointBack)!==null&&x!==void 0?x:ge.pointBack,I.pointMinPixel=(w=e.pointMinPixel)!==null&&w!==void 0?w:ge.pointMinPixel,I.pointMaxPixel=(M=e.pointMaxPixel)!==null&&M!==void 0?M:ge.pointMaxPixel,I.gradientTexture=(S=e.gradientTexture)!==null&&S!==void 0?S:ge.gradientTexture,I.brightness=(E=e.brightness)!==null&&E!==void 0?E:ge.brightness,I.colorSaturation=(B=e.colorSaturation)!==null&&B!==void 0?B:ge.colorSaturation,I.colorBrightness=(R=e.colorBrightness)!==null&&R!==void 0?R:ge.colorBrightness,I.customShaders=(C=e.customShaders)!==null&&C!==void 0?C:ge.customShaders,I.customShaderHash="",I.floor=0,I.transparent=!0,I}return t.prototype.onBeforeCompile=function(e,r){var i,a,o=this.customShaders.filter(function(v){return v.type.includes("pointcloud")}),s=o.reduce(function(v,g){return v+g.vertex.mainBefore},""),u=o.reduce(function(v,g){return v+g.vertex.mainStart},""),l=o.reduce(function(v,g){return v+g.vertex.mainEnd},""),c=o.reduce(function(v,g){return v+g.fragment.mainBefore},""),d=o.reduce(function(v,g){return v+g.fragment.mainStart},""),p=o.reduce(function(v,g){return v+g.fragment.mainModelColor},""),A=o.reduce(function(v,g){return v+g.fragment.mainEnd},"");e.vertexShader=e.vertexShader.replace(/MAIN_BEFORE/g,s),e.fragmentShader=e.fragmentShader.replace(/MAIN_BEFORE/g,c),e.vertexShader=e.vertexShader.replace(/MAIN_START/g,u),e.fragmentShader=e.fragmentShader.replace(/MAIN_START/g,d),e.vertexShader=e.vertexShader.replace(/MAIN_END/g,l),e.fragmentShader=e.fragmentShader.replace(/MAIN_END/g,A),e.fragmentShader=e.fragmentShader.replace(/MAIN_MODEL_COLOR/g,p);var h=String((a=(i=this.clippers)===null||i===void 0?void 0:i.length)!==null&&a!==void 0?a:0);e.vertexShader=e.vertexShader.replace(/NUM_CLIPPERS/g,h),e.fragmentShader=e.fragmentShader.replace(/NUM_CLIPPERS/g,h),o.forEach(function(v){v.onBeforeCompile(e,r)})},t.prototype.update=function(e,r,i){var a="".concat(i.id,":").concat(i.materialVersion);a!==this.syncModelVersion&&(Object.assign(this,i.getMaterial()),this.syncModelVersion=a);var o=this.customShaders.map(function(m){return m.getHash()}).join("");this.customShaderHash!==o&&(this.customShaderHash=o,this.needsUpdate=!0);for(var s=this.customShaders.reduce(function(m,y){return Object.assign(m,y.defines)},{}),u=Object.keys(this.customShaderDefines),l=0,c=u;l<c.length;l++){var d=c[l];delete this.defines[d]}this.customShaderDefines=s,Object.assign(this.defines,this.customShaderDefines);for(var p=this.customShaders.reduce(function(m,y){return Object.assign(m,y.uniforms)},{}),A=Object.keys(this.customShaderUniforms),h=0,v=A;h<v.length;h++){var g=v[h];delete this.uniforms[g]}this.customShaderUniforms=p,Object.assign(this.uniforms,this.customShaderUniforms),this.visible=!0,this.transparent=!1,this.shownFloorIndex>-1&&(this.transparent=this.shownFloorIndex!==this.floor),this.modelAlpha<1&&(this.transparent=!0),this.opacity<1&&(this.transparent=!0),this.brightness<1&&(this.transparent=!0),this.depthWrite=!0,this.depthTest=!0,this.useEDL&&(this.transparent=!1),this.useHQWeight?(this.depthWrite=!1,this.blending=f.CustomBlending,this.blendSrc=f.SrcAlphaFactor,this.blendSrcAlpha=f.SrcAlphaFactor,this.blendDst=f.OneFactor,this.blendDstAlpha=f.OneFactor):(this.blending=f.NormalBlending,this.blendDst=f.OneMinusSrcAlphaFactor,this.blendEquation=f.AddEquation,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null),this.floorStyle==="VISIBILITY"&&this.shownFloorIndex!==-1&&this.floor!==this.shownFloorIndex&&(this.visible=!1),this.uniforms.pixelRatio.value=r.pixelRatio,this.uniforms.resolution.value.copy(r.resolution),this.uniforms.modelBoundingMax.value.copy(i.bounding.max),this.uniforms.modelBoundingMin.value.copy(i.bounding.min)},t.prototype.copy=function(e){return n.prototype.copy.call(this,this),this.customShaders=e.customShaders,this.pano0=e.pano0,this.pano1=e.pano1,this.progress=e.progress,this.transition=e.transition,this.floorStyle=e.floorStyle,this.shownFloorIndex=e.shownFloorIndex,this.brightness=e.brightness,this.clippers=e.clippers,this.constantColor=e.constantColor,this.modelAlpha=e.modelAlpha,this.useEDL=e.useEDL,this.useHQWeight=e.useHQWeight,this.useHQDepth=e.useHQDepth,this.colorStyle=e.colorStyle,this.pointSize=e.pointSize,this.pointShape=e.pointShape,this.pointScale=e.pointScale,this.pointBack=e.pointBack,this.pointMinPixel=e.pointMinPixel,this.pointMaxPixel=e.pointMaxPixel,this.gradientTexture=e.gradientTexture,this.colorSaturation=e.colorSaturation,this.colorBrightness=e.colorBrightness,this},t}(f.ShaderMaterial),xn=function(n){ue(t,n);function t(e){var r=e.preserveDrawingBuffer,i=r===void 0?!0:r,a=e.premultipliedAlpha,o=a===void 0?!0:a,s=e.stencil,u=s===void 0?!0:s,l=e.backgroundColor,c=l===void 0?1579548:l,d=e.backgroundAlpha,p=d===void 0?1:d,A=e.pixelRatio,h=A===void 0?1:A,v=e.antialias,g=v===void 0?!1:v,m=e.webgl2,y=e.logarithmicDepthBuffer,b=e.precision,x=e.powerPreference,w=this,M={antialias:g,alpha:!0,depth:!0,preserveDrawingBuffer:i,stencil:u,premultipliedAlpha:o,powerPreference:x},S={logarithmicDepthBuffer:y,precision:b};if(m){var E=document.createElement("canvas"),B=E.getContext("webgl2",M);B?w=n.call(this,O(O(O({},M),S),{antialias:!0,canvas:E,context:B}))||this:(console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."),w=n.call(this,O(O({},M),S))||this)}else w=n.call(this,O(O({},M),S))||this;return w.setPixelRatio(h),w.setClearColor(c,p),w.outputEncoding=f.sRGBEncoding,w.autoClear=!0,w}return t}(f.WebGLRenderer),Xo=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.add=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return n.prototype.add.apply(this,e)},t.prototype.remove=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return n.prototype.remove.apply(this,e)},t}(f.Scene);function Ut(n,t){var e=Math.abs(Math.cos(n.latitude)),r=-Math.sin(n.longitude)*e,i=-Math.sin(n.latitude),a=-Math.cos(n.longitude)*e;return t?t.set(r,i,a):new f.Vector3(r,i,a)}var wd=1,Md=.1,Sd=2e3,zi=Math.PI*2,Us=Math.PI/2;function La(n){return n>0&&n<=zi?n:(n%zi+zi)%zi}function Cd(n,t,e,r){e=Math.pow(e,4);for(var i=0;i<16;i++)r.elements[i]=n.elements[i]+(t.elements[i]-n.elements[i])*e;return r}var Su=function(n){ue(t,n);function t(e,r,i,a,o,s,u){r===void 0&&(r=wd),i===void 0&&(i=Md),a===void 0&&(a=Sd),o===void 0&&(o=new f.Vector2),s===void 0&&(s=new f.Vector2(512,512)),u===void 0&&(u=1);var l=n.call(this)||this;l.fov=e,l.aspect=r,l.near=i,l.far=a,l.perspToOrtho=o,l.resolution=s,l.pixelRatio=u,l.time=0,l.needsRender=!0,l.refineModel=!0,l.pose={longitude:0,latitude:0,fov:e,distance:0,offset:new f.Vector3},l.computePose(),l.perspectiveCamera=new f.PerspectiveCamera(l.fov,l.aspect,.001,l.far);var c=Math.max(l.orthoDistance,.01)*Math.tan(.5*l.fov/180*Math.PI),d=-.5*l.aspect*2*c;return l.orthographicCamera=new f.OrthographicCamera(d,-d,c,-c,.001,l.far),l.computeProjectionMatrix(),l.lastValues={position:l.position.clone(),quaternion:l.quaternion.clone(),scale:l.scale.clone(),fov:l.fov,aspect:l.aspect,near:l.near,far:l.far,orthoDistance:l.orthoDistance,perspToOrtho:l.perspToOrtho.clone()},l.type=l.perspToOrtho.x<1?"PerspectiveCamera":"OrthographicCamera",l.autoNearFar=!0,l}return Object.defineProperty(t.prototype,"orthoDistance",{get:function(){return this.pose.distance>1?this.pose.distance:1+(this.pose.distance-1)*this.perspToOrtho.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"zoom",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.zoom:this.type==="PerspectiveCamera"?this.perspectiveCamera.zoom:1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.top:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.bottom:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.left:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.right:0},enumerable:!1,configurable:!0}),t.prototype.getDirection=function(e){return Ut(this.pose,e)},t.prototype.computePose=function(e){e===void 0&&(e=0),this.updateMatrix();var r=this.matrix.elements;return this.pose.latitude=Math.asin(ce(r[9],-1,1)),Math.abs(r[9])<.9999999?this.pose.longitude=La(Math.atan2(r[8],r[10])):this.pose.longitude=La(Math.atan2(-r[2],r[0])),this.pose.fov=this.fov,this.pose.distance=e,this.pose.offset=new f.Vector3(-r[8],-r[9],-r[10]).setLength(this.pose.distance).add(this.position),this},t.prototype.setFromPose=function(e){var r,i,a,o,s,u=La((r=e.longitude)!==null&&r!==void 0?r:this.pose.longitude),l=Math.max(-Us+1e-4,Math.min(Us-1e-4,(i=e.latitude)!==null&&i!==void 0?i:this.pose.latitude)),c=(a=e.fov)!==null&&a!==void 0?a:this.pose.fov,d=(o=e.distance)!==null&&o!==void 0?o:this.pose.distance,p=(s=e.offset)!==null&&s!==void 0?s:this.pose.offset,A=Ut({longitude:u,latitude:l}).normalize();return this.position.set(0,0,0),this.lookAt(A),this.position.add(p).sub(A.clone().setLength(d)),this.fov!==c&&(this.fov=c,this.updateProjectionMatrix()),this.updateMatrixWorld(!0),this.pose.longitude=u,this.pose.latitude=l,this.pose.fov=c,this.pose.distance=d,this.pose.offset.copy(p),this.needsRender=!0,this},t.prototype.copyPose=function(){return{longitude:this.pose.longitude,latitude:this.pose.latitude,fov:this.pose.fov,distance:this.pose.distance,offset:this.pose.offset.clone()}},t.prototype.computeProjectionMatrix=function(){Cd(this.orthographicCamera.projectionMatrix,this.perspectiveCamera.projectionMatrix,1-this.perspToOrtho.x,this.projectionMatrix),this.projectionMatrixInverse.getInverse(this.projectionMatrix),this.needsRender=!0},t.prototype.setViewOffset=function(e,r,i,a,o,s){this.perspectiveCamera.setViewOffset(e,r,i,a,o,s),this.orthographicCamera.setViewOffset(e,r,i,a,o,s),this.computeProjectionMatrix()},t.prototype.clearViewOffset=function(){this.perspectiveCamera.clearViewOffset(),this.orthographicCamera.clearViewOffset(),this.computeProjectionMatrix()},t.prototype.updateProjectionMatrix=function(){this.perspectiveCamera.updateProjectionMatrix(),this.orthographicCamera.updateProjectionMatrix(),this.computeProjectionMatrix()},Object.defineProperty(t.prototype,"perspectiveProjectionMatrix",{get:function(){return this.perspectiveCamera.projectionMatrix},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"perspectiveProjectionMatrixInverse",{get:function(){return this.perspectiveCamera.projectionMatrixInverse},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"orthographicProjectionMatrix",{get:function(){return this.orthographicCamera.projectionMatrix},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"orthographicProjectionMatrixInverse",{get:function(){return this.orthographicCamera.projectionMatrixInverse},enumerable:!1,configurable:!0}),t.prototype.updateTime=function(e){this.time=e;var r=!1;if((this.lastValues.fov!==this.fov||this.lastValues.near!==this.near||this.lastValues.far!==this.far||this.lastValues.aspect!==this.aspect)&&(this.perspectiveCamera.fov=this.fov,this.perspectiveCamera.near=this.near,this.perspectiveCamera.far=this.far,this.perspectiveCamera.aspect=this.aspect,this.perspectiveCamera.updateProjectionMatrix(),r=!0),!this.lastValues.position.equals(this.position)||!this.lastValues.quaternion.equals(this.quaternion)||!this.lastValues.scale.equals(this.scale)||!this.lastValues.perspToOrtho.equals(this.perspToOrtho)||this.lastValues.fov!==this.fov||this.lastValues.near!==this.near||this.lastValues.far!==this.far||this.lastValues.orthoDistance!==this.orthoDistance||this.lastValues.aspect!==this.aspect){var i=Math.max(this.orthoDistance,.01)*Math.tan(.5*this.fov/180*Math.PI),a=-.5*this.aspect*2*i;this.orthographicCamera.left=a,this.orthographicCamera.right=-a,this.orthographicCamera.top=i,this.orthographicCamera.bottom=-i,this.orthographicCamera.near=this.near,this.orthographicCamera.far=this.far,this.orthographicCamera.updateProjectionMatrix(),r=!0}r&&this.computeProjectionMatrix(),this.lastValues.position.copy(this.position),this.lastValues.quaternion.copy(this.quaternion),this.lastValues.scale.copy(this.scale),this.lastValues.fov=this.fov,this.lastValues.aspect=this.aspect,this.lastValues.near=this.near,this.lastValues.far=this.far,this.lastValues.orthoDistance=this.orthoDistance,this.lastValues.perspToOrtho.copy(this.perspToOrtho),this.type=this.perspToOrtho.x<1?"PerspectiveCamera":"OrthographicCamera"},Object.defineProperty(t.prototype,"isPerspectiveCamera",{get:function(){return this.perspToOrtho.x<1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isOrthographicCamera",{get:function(){return this.perspToOrtho.x>=1},enumerable:!1,configurable:!0}),t.prototype.copy=function(e,r){return n.prototype.copy.call(this,e,r),this.fov=e.fov,this.aspect=e.aspect,this.near=e.near,this.far=e.far,this.perspToOrtho.copy(e.perspToOrtho),this.updateTime(ve()),this},t}(f.Camera),Ft;(function(n){n[n.Outside=-1]="Outside",n[n.Intersecting=0]="Intersecting",n[n.Inside=1]="Inside"})(Ft||(Ft={}));var Cu=1e-6,Ke=new f.Vector3,un=new f.Matrix4,Wr=new f.Vector3,Zr=new f.Vector3,Yr=new f.Vector3,So=new f.Vector3,ka=new f.Box3,Oa=new f.Sphere,qs=new f.Matrix4,Da=new f.Ray,Rt=new f.Object3D,Hs=new f.Frustum;function Eu(n,t){var e=n.elements;return t.setFromRotationMatrix(un.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)),t}var li=function(){function n(t){t===void 0&&(t=[]),this.planes=t}return Object.defineProperty(n,"MASK_OUTSIDE",{get:function(){return 4294967295},enumerable:!1,configurable:!0}),Object.defineProperty(n,"MASK_INSIDE",{get:function(){return 0},enumerable:!1,configurable:!0}),Object.defineProperty(n,"MASK_INDETERMINATE",{get:function(){return 2147483647},enumerable:!1,configurable:!0}),n.prototype.setFromFrustum=function(t){return this.planes=t.planes.map(function(e){return e.clone()}),this},n.prototype.setFromCamera=function(t){return un.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),Hs.setFromProjectionMatrix(un),this.setFromFrustum(Hs),this},n.prototype.applyMatrix4=function(t){for(var e=0,r=this.planes;e<r.length;e++){var i=r[e];i.applyMatrix4(t)}},n.prototype.copy=function(t){return this.planes=t.planes.map(function(e){return e.clone()}),this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.computeVisibility=function(t){for(var e=Ft.Inside,r=0,i=this.planes;r<i.length;r++){var a=i[r],o=t.intersectPlane(a);switch(o){case Ft.Outside:return Ft.Outside;case Ft.Intersecting:e=Ft.Intersecting;break}}return e},n.prototype.computeVisibilityWithPlaneMask=function(t,e){if(e===n.MASK_OUTSIDE||e===n.MASK_INSIDE)return e;for(var r=n.MASK_INSIDE,i=Math.min(32,this.planes.length),a=0;a<i;++a){var o=1<<a;if(e&o){var s=this.planes[a],u=t.intersectPlane(s);if(u===Ft.Outside)return n.MASK_OUTSIDE;u===Ft.Intersecting&&(r|=o)}}return r},n}(),Wo=function(){function n(){this.type="box",this.center=new f.Vector3,this.halfSize=new f.Vector3,this.rotation=new f.Matrix3}return n.prototype.fromJson=function(t){var e=t.box;this.center.set(e[0],e[1],e[2]);var r=e[3],i=e[4],a=e[5],o=e[6],s=e[7],u=e[8],l=e[9],c=e[10],d=e[11],p=Math.max(Math.sqrt(r*r+i*i+a*a),.001),A=Math.max(Math.sqrt(o*o+s*s+u*u),.001),h=Math.max(Math.sqrt(l*l+c*c+d*d),.001);this.halfSize.set(p,A,h);var v=this.halfSize.toArray().reduce(function(g,m){return g+m},0);return(isNaN(v)||v<=0)&&this.halfSize.setScalar(Cu),this.rotation.fromArray([r/p,i/p,a/p,o/A,s/A,u/A,l/h,c/h,d/h]),isNaN(this.rotation.toArray().reduce(function(g,m){return g+m},0))&&this.rotation.identity(),this},n.prototype.toJson=function(){return this.rotation.extractBasis(Wr,Zr,Yr),{box:vt(vt(vt(vt([],this.center.toArray(),!0),Wr.multiplyScalar(this.halfSize.x).toArray(),!0),Zr.multiplyScalar(this.halfSize.y).toArray(),!0),Yr.multiplyScalar(this.halfSize.z).toArray(),!0)}},n.prototype.copy=function(t){return this.center.copy(t.center),this.halfSize.copy(t.halfSize),this.rotation.copy(t.rotation),this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.applyMatrix4=function(t){return Rt.position.copy(this.center),Eu(this.rotation,Rt.quaternion),Rt.scale.copy(this.halfSize),Rt.matrix.compose(Rt.position,Rt.quaternion,Rt.scale),Rt.matrix.premultiply(t),Rt.matrix.decompose(Rt.position,Rt.quaternion,Rt.scale),this.center.copy(Rt.position),this.rotation.setFromMatrix4(un.makeRotationFromQuaternion(Rt.quaternion)),this.halfSize.copy(Rt.scale),this},n.prototype.getCenter=function(t){return t.copy(this.center)},n.prototype.distanceSquaredToPoint=function(t){var e=this.rotation.elements,r=t.x-this.center.x,i=t.y-this.center.y,a=t.z-this.center.z,o=0,s;return s=r*e[0]+i*e[1]+a*e[2],s<0&&(s=-s),s-=this.halfSize.x,s>0&&(o+=s*s),s=r*e[3]+i*e[4]+a*e[5],s<0&&(s=-s),s-=this.halfSize.y,s>0&&(o+=s*s),s=r*e[6]+i*e[7]+a*e[8],s<0&&(s=-s),s-=this.halfSize.z,s>0&&(o+=s*s),o},n.prototype.distanceToPoint=function(t){return Math.sqrt(this.distanceSquaredToPoint(t))},n.prototype.distanceToPlane=function(t){var e=t.projectPoint(this.center,new f.Vector3);return this.distanceToPoint(e)},n.prototype.getBoundingBox=function(t){return t.makeEmpty(),this.rotation.extractBasis(Wr,Zr,Yr),Wr.setLength(this.halfSize.x),Zr.setLength(this.halfSize.y),Yr.setLength(this.halfSize.z),t.expandByPoint(Ke.copy(this.center).add(Wr)),t.expandByPoint(Ke.copy(this.center).sub(Wr)),t.expandByPoint(Ke.copy(this.center).add(Zr)),t.expandByPoint(Ke.copy(this.center).sub(Zr)),t.expandByPoint(Ke.copy(this.center).add(Yr)),t.expandByPoint(Ke.copy(this.center).sub(Yr)),t},n.prototype.toGeometry=function(){var t=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]),e=new Float32Array(8*3);Ke.set(this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,0),Ke.set(-this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,3),Ke.set(-this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,6),Ke.set(this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,9),Ke.set(this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,12),Ke.set(-this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,15),Ke.set(-this.halfSize.x,-this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,18),Ke.set(this.halfSize.x,-this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,21);var r=new f.BufferGeometry;return r.setIndex(new f.BufferAttribute(t,1)),r.setAttribute("position",new f.BufferAttribute(e,3)),r.computeBoundingBox(),r.computeBoundingSphere(),r},n.prototype.intersectPlane=function(t){var e=this.center,r=t.normal,i=this.rotation.elements,a=this.halfSize,o=r.x,s=r.y,u=r.z,l=Math.abs(o*i[0]*a.x+s*i[1]*a.x+u*i[2]*a.x)+Math.abs(o*i[3]*a.y+s*i[4]*a.y+u*i[5]*a.y)+Math.abs(o*i[6]*a.z+s*i[7]*a.z+u*i[8]*a.z),c=r.dot(e)+t.constant;return c<=-l?Ft.Outside:c>=l?Ft.Inside:Ft.Intersecting},n.prototype.intersectRay=function(t,e){if(So.copy(this.halfSize).multiplyScalar(2),ka.setFromCenterAndSize(Ke.set(0,0,0),So),this.rotation.extractBasis(Wr,Zr,Yr),un.makeBasis(Wr,Zr,Yr),un.setPosition(this.center),qs.getInverse(un),Da.copy(t).applyMatrix4(qs),ka.containsPoint(Da.origin))return!0;var r=Da.intersectBox(ka,Ke);return r?e!==void 0?r.applyMatrix4(un).distanceTo(t.origin)<e:!0:!1},n}(),Zo=function(){function n(){this.type="sphere",this.center=new f.Vector3,this.radius=-1}return n.prototype.fromJson=function(t){var e=t.sphere;return this.center.set(e[0],e[1],e[2]),this.radius=Math.max(e[3],Cu),this},n.prototype.toJson=function(){return{sphere:vt(vt([],this.center.toArray(),!0),[this.radius],!1)}},n.prototype.copy=function(t){return this.center.copy(t.center),this.radius=t.radius,this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.getBoundingBox=function(t){return t.setFromCenterAndSize(this.center,So.set(1,1,1).multiplyScalar(this.radius*2)),t},n.prototype.toGeometry=function(){for(var t=32,e=new Float32Array(t*3*2*2),r=0;r<=t;r++){var i=0;i=r/t*Math.PI*2,e[r*6+0]=this.center.x+Math.cos(i)*this.radius,e[r*6+1]=this.center.y+Math.sin(i)*this.radius,e[r*6+2]=this.center.z+0,i=(r+1)/t*Math.PI*2,e[r*6+3]=this.center.x+Math.cos(i)*this.radius,e[r*6+4]=this.center.y+Math.sin(i)*this.radius,e[r*6+5]=this.center.z+0}for(var r=t;r<=t*2;r++){var i=0;i=r/t*Math.PI*2,e[r*6+0]=this.center.x+Math.cos(i)*this.radius,e[r*6+1]=this.center.y+0,e[r*6+2]=this.center.z+Math.sin(i)*this.radius,i=(r+1)/t*Math.PI*2,e[r*6+3]=this.center.x+Math.cos(i)*this.radius,e[r*6+4]=this.center.y+0,e[r*6+5]=this.center.z+Math.sin(i)*this.radius}var a=new f.BufferGeometry;return a.setAttribute("position",new f.BufferAttribute(e,3)),a.computeBoundingBox(),a.computeBoundingSphere(),a},n.prototype.applyMatrix4=function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},n.prototype.getCenter=function(t){return t.copy(this.center)},n.prototype.distanceSquaredToPoint=function(t){var e=this.distanceToPoint(t);return e*e},n.prototype.distanceToPoint=function(t){var e=this.center.distanceTo(t)-this.radius;return e<=0?0:e},n.prototype.distanceToPlane=function(t){var e=Math.abs(t.distanceToPoint(this.center));return Math.max(0,e-this.radius)},n.prototype.intersectPlane=function(t){var e=this.center,r=this.radius,i=t.normal,a=i.dot(e)+t.constant;return a<-r?Ft.Outside:a<r?Ft.Intersecting:Ft.Inside},n.prototype.intersectRay=function(t,e){if(Oa.set(this.center,this.radius),Oa.containsPoint(t.origin))return!0;var r=t.intersectSphere(Oa,Ke);return r?e!==void 0?t.origin.distanceTo(r)<e:!0:!1},n}(),Iu=function(){function n(){throw this.type="regin",this.west=0,this.south=0,this.east=0,this.north=0,this.minHeight=0,this.maxHeight=0,new Error("Region bounding volume not supported.")}return n.prototype.fromJson=function(t){var e=t.region;return this.west=e[0],this.south=e[1],this.east=e[2],this.north=e[3],this.minHeight=e[4],this.maxHeight=e[5],this},n.prototype.toJson=function(){return{region:[this.west,this.south,this.east,this.north,this.minHeight,this.maxHeight]}},n.prototype.copy=function(t){return this.west=t.west,this.south=t.south,this.east=t.east,this.north=t.north,this.minHeight=t.minHeight,this.maxHeight=t.maxHeight,this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.getBoundingBox=function(t){throw new Error("not implemented")},n.prototype.toGeometry=function(){throw new Error("not implemented")},n.prototype.applyMatrix4=function(t){throw new Error("not implemented")},n.prototype.getCenter=function(t){throw new Error("not implemented")},n.prototype.distanceToPoint=function(t){throw new Error("not implemented")},n.prototype.distanceSquaredToPoint=function(t){throw new Error("not implemented")},n.prototype.distanceToPlane=function(t){throw new Error("not implemented")},n.prototype.intersectPlane=function(t){throw new Error("not implemented")},n.prototype.intersectRay=function(t){throw new Error("not implemented")},n}();function Va(n){return n instanceof Wo||n instanceof Zo||n instanceof Iu}function Mn(n){if("box"in n)return new Wo().fromJson(n);if("sphere"in n)return new Zo().fromJson(n);if("region"in n)return new Iu().fromJson(n);throw new Error("BoundingVolume ".concat(JSON.stringify(n)," never suppored."))}var Qi=[4821759,8191922,16637280,16739958,5822969,376977,16747077,9259235,14514687].map(function(n){return new f.LineBasicMaterial({color:n,depthWrite:!1,depthTest:!1,transparent:!0})}),Ed=function(){var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),t=new Float32Array(8*3);Ke.set(1,1,1).toArray(t,0),Ke.set(-1,1,1).toArray(t,3),Ke.set(-1,-1,1).toArray(t,6),Ke.set(1,-1,1).toArray(t,9),Ke.set(1,1,-1).toArray(t,12),Ke.set(-1,1,-1).toArray(t,15),Ke.set(-1,-1,-1).toArray(t,18),Ke.set(1,-1,-1).toArray(t,21);var e=new f.BufferGeometry;return e.setIndex(new f.BufferAttribute(n,1)),e.setAttribute("position",new f.BufferAttribute(t,3)),e.computeBoundingBox(),e.computeBoundingSphere(),e}(),Id=function(){for(var n=32,t=new Float32Array(n*3*2*2),e=0;e<=n;e++){var r=0;r=e/n*Math.PI*2,t[e*6+0]=Math.cos(r),t[e*6+1]=Math.sin(r),t[e*6+2]=0,r=(e+1)/n*Math.PI*2,t[e*6+3]=Math.cos(r),t[e*6+4]=Math.sin(r),t[e*6+5]=0}for(var e=n;e<=n*2;e++){var r=0;r=e/n*Math.PI*2,t[e*6+0]=Math.cos(r),t[e*6+1]=0,t[e*6+2]=Math.sin(r),r=(e+1)/n*Math.PI*2,t[e*6+3]=Math.cos(r),t[e*6+4]=0,t[e*6+5]=Math.sin(r)}var i=new f.BufferGeometry;return i.setAttribute("position",new f.BufferAttribute(t,3)),i.computeBoundingBox(),i.computeBoundingSphere(),i}();function Td(n,t){if(n instanceof Wo){var e=new f.LineSegments(Ed,Qi[Math.min(t,Qi.length-1)]);return e.position.copy(n.center),Eu(n.rotation,e.quaternion),e.scale.set(n.halfSize.x,n.halfSize.y,n.halfSize.z),e.matrix.compose(e.position,e.quaternion,e.scale),e}else if(n instanceof Zo){var e=new f.LineSegments(Id,Qi[Math.min(t,Qi.length-1)]);return e.position.copy(n.center),e.scale.set(n.radius,n.radius,n.radius),e.matrix.compose(e.position,e.quaternion,e.scale),e}throw new Error("never")}var Pd=new f.Vector3,Yo=function(){function n(t,e,r,i){var a=this,o,s,u,l;this.parent=null,this.contentParent=null,this.floor=0,this.id=t,this.state={visible:!1,frameNumber:0,selectedFrameNumber:0,requestedFrameNumber:0,touchedFrameNumber:0,distanceToCamera:0,centerZDepth:0,centerScreenY:0,screenSpaceError:0,visibilityPlaneMask:0,inRequestVolume:!1,shouldRefine:!1,stackLength:0,finalResolution:!0,selectionDepth:0,shouldSelect:!1,lastSelect:!1,ancestorWithContent:null,ancestorWithContentAvailable:null},this.parent=i!=null?i:null,this.contentParent=i?i.hasRenderContent?i:i.contentParent:null,this.level=this.parent?this.parent.level+1:0,this.tileset=r,this.refine=(o=e.refine)!==null&&o!==void 0?o:this.parent?this.parent.refine:"REPLACE",this.transform=new f.Matrix4,e.transform&&this.transform.fromArray(e.transform),this.parent&&this.transform.premultiply(this.parent.transform),typeof e.geometricError=="number"?this.geometricError=e.geometricError*this.transform.getMaxScaleOnAxis():this.geometricError=(u=(s=this.parent)===null||s===void 0?void 0:s.geometricError)!==null&&u!==void 0?u:0,e.content&&e.content.uri?(this.content={uri:e.content.uri,loadState:"UNLOADED",loadStateUpdateTime:ve(),loadfailRetryDelay:0,byteLength:0},e.content.group!==void 0&&(this.content.group=e.content.group),e.content.boundingVolume&&(this.content.boundingVolume=Mn(e.content.boundingVolume).applyMatrix4(this.transform)),/\.json$/.test(this.content.uri)?this.type="TILESET":this.type="SCENEGRAPH"):(this.content=null,this.type="EMPTY"),this.levelOfContent=this.parent?this.parent.levelOfContent:-1,this.type==="SCENEGRAPH"&&(this.levelOfContent=this.levelOfContent+1),e.boundingVolume&&(this.boundingVolume=Mn(e.boundingVolume).applyMatrix4(this.transform)),e.viewerRequestVolume&&(this.viewerRequestVolume=Mn(e.viewerRequestVolume).applyMatrix4(this.transform)),this.extras=(l=e.extras)!==null&&l!==void 0?l:{},typeof this.extras.floor!="number"&&i&&typeof i.extras.floor=="number"&&(this.extras.floor=i.extras.floor),typeof this.extras.floor=="number"&&(this.floor=this.extras.floor,this.tileset.floorLength=Math.max(this.tileset.floorLength,this.floor+1)),this.boundingVolume&&(this.boundingVolumeDebugObject=Td(this.boundingVolume,this.levelOfContent)),e.children?this.children=e.children.map(function(c,d){return new n("".concat(a.id,".").concat(d),c,r,a)}):this.children=[]}return n.prototype.traverse=function(t){t(this);for(var e=0,r=this.children;e<r.length;e++){var i=r[e];i.traverse(t)}},n.prototype.updateState=function(t){this.state.frameNumber=t.frameNumber;var e=this.tileset.transformIsIdentity?null:this.tileset.transform;if(this.boundingVolume){var r=e?this.boundingVolume.clone().applyMatrix4(e):this.boundingVolume;if(t.camera.type==="OrthographicCamera"){var i=new f.Plane().setFromNormalAndCoplanarPoint(t.camera.direction,t.camera.position);this.state.distanceToCamera=r.distanceToPlane(i)}else this.state.distanceToCamera=r.distanceToPoint(t.camera.position);var a=r.getCenter(Pd).sub(t.camera.position);this.state.centerZDepth=t.camera.direction.dot(a),this.state.centerScreenY=t.camera.up.dot(a);var o=this.parent?this.parent.state.visibilityPlaneMask:li.MASK_INDETERMINATE;this.state.visibilityPlaneMask=t.cullingVolume.computeVisibilityWithPlaneMask(r,o),this.state.visible=this.state.visibilityPlaneMask!==li.MASK_OUTSIDE}else this.state.distanceToCamera=0,this.state.centerZDepth=0,this.state.visibilityPlaneMask=li.MASK_INDETERMINATE,this.state.visible=!0;if(this.levelOfContent<=t.minLevelOfDetail&&(this.state.visible=!0),this.viewerRequestVolume){var s=e?this.viewerRequestVolume.clone().applyMatrix4(e):this.viewerRequestVolume;this.state.inRequestVolume=s.distanceSquaredToPoint(t.camera.position)<=0}else this.state.inRequestVolume=!0;this.state.screenSpaceError=this.getScreenSpaceError(t,this.state.distanceToCamera,!1)},Object.defineProperty(n.prototype,"selected",{get:function(){return this.state.selectedFrameNumber===this.tileset.frameNumber},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasChildren",{get:function(){return this.children.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"siblingIndex",{get:function(){var t,e;return(e=(t=this.parent)===null||t===void 0?void 0:t.children.indexOf(this))!==null&&e!==void 0?e:0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasTilesetContent",{get:function(){return this.children.length>0&&this.type==="TILESET"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasRenderContent",{get:function(){return this.type==="SCENEGRAPH"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentAvailable",{get:function(){var t;return this.hasRenderContent&&((t=this.content)===null||t===void 0?void 0:t.loadState)==="READY"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasUnloadedContent",{get:function(){var t;return((t=this.content)===null||t===void 0?void 0:t.loadState)==="UNLOADED"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasEmptyContent",{get:function(){return this.type==="EMPTY"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentReady",{get:function(){var t;return((t=this.content)===null||t===void 0?void 0:t.loadState)==="READY"||this.hasEmptyContent},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentByteLength",{get:function(){return this.content?this.content.byteLength:0},enumerable:!1,configurable:!0}),n.prototype.getScreenSpaceError=function(t,e,r){var i=this.tileset.transformIsIdentity?1:this.tileset.transform.getMaxScaleOnAxis(),a=this.parent?this.parent.geometricError:this.tileset.geometricError,o=i*(r?a:this.geometricError);if(o===0)return 0;var s=t.height,u=t.camera.type==="OrthographicCamera"?2:t.sseDenominator,l=Math.max(e,.001),c=o*s/(l*u);return c},n.prototype.getPriority=function(){var t=this.refine==="ADD"||this.tileset.skipLevelOfDetail;if(t&&!this.state.visible||this.tileset.frameNumber-this.state.touchedFrameNumber>=1)return-1;var e=this.parent,r=e&&(!t||this.state.screenSpaceError===0),i=r?e.state.screenSpaceError:this.state.screenSpaceError,a=this.tileset.root?this.tileset.root.state.screenSpaceError:0,o=Math.max(a-i,0);return o},n}(),Na=new Map;function Gs(n,t){if(t&&t.has(n))return t.get(n);var e=n.refine==="ADD"||n.tileset.skipLevelOfDetail,r=n.parent,i=r&&(!e||n.state.screenSpaceError===0),a=i?r.state.screenSpaceError:n.state.screenSpaceError,o=n.tileset.root?n.tileset.root.state.screenSpaceError:0,s=Math.max(o-a,0);return t&&t.set(n,s),s}var Tu=function(){function n(t,e){this.tileset=t,this.options=e,this.activeRequests=0,this.requestQueue=[]}return n.prototype.reset=function(){for(var t=0,e=this.requestQueue;t<e.length;t++){var r=e[t];this.options.onTileSkip&&this.options.onTileSkip(r.tile)}this.requestQueue.length=0},n.prototype.update=function(t,e,r){for(var i=this,a=r.time,o=this.requestQueue,s=new Set(t),u=0;u<o.length;u++){var l=o[u];if(s.has(l.tile)){s.delete(l.tile);continue}l.status==="WAITING"&&(o.splice(u,1),u--,this.options.onTileSkip&&this.options.onTileSkip(l.tile))}s.size>0&&(s.forEach(function(m){o.push({tile:m,status:"WAITING",time:a,error:null})}),s.clear());for(var c=this.tileset.maxRequests,u=0;u<o.length&&c>0;u++){var l=o[u];if(l.status==="DONE")l.error!==null?this.options.onTileError&&this.options.onTileError(l.tile,l.error):(c--,l.tile.content&&(l.tile.content.loadState="READY"),this.options.onTileLoad&&this.options.onTileLoad(l.tile)),o.splice(u,1),u--;else if(l.status==="PENDING"&&a-l.time<1e3)break}switch(Na.clear(),e){case"SCREEN_SPACE_ERROR":{o.sort(function(m,y){if(m.tile.state.requestedFrameNumber!==y.tile.state.requestedFrameNumber)return y.tile.state.requestedFrameNumber-m.tile.state.requestedFrameNumber;if(m.tile.state.requestedFrameNumber===r.frameNumber){var b=Gs(m.tile,Na),x=Gs(y.tile,Na);return b-x}else return m.tile.level!==y.tile.level?m.tile.level-y.tile.level:m.tile.state.distanceToCamera-y.tile.state.distanceToCamera});break}case"SCREEN_VERTICAL":{o.sort(function(m,y){return m.tile.state.requestedFrameNumber!==y.tile.state.requestedFrameNumber?y.tile.state.requestedFrameNumber-m.tile.state.requestedFrameNumber:m.tile.state.requestedFrameNumber===r.frameNumber?m.tile.state.centerScreenY!==y.tile.state.centerScreenY?m.tile.state.centerScreenY-y.tile.state.centerScreenY:m.tile.state.centerZDepth!==y.tile.state.centerZDepth?m.tile.state.centerZDepth-y.tile.state.centerZDepth:m.tile.level!==y.tile.level?m.tile.level-y.tile.level:m.tile.state.distanceToCamera-y.tile.state.distanceToCamera:m.tile.level!==y.tile.level?m.tile.level-y.tile.level:m.tile.state.distanceToCamera-y.tile.state.distanceToCamera});break}case"SCREEN_LEVEL_VERTICAL":{o.sort(function(m,y){return m.tile.state.requestedFrameNumber!==y.tile.state.requestedFrameNumber?y.tile.state.requestedFrameNumber-m.tile.state.requestedFrameNumber:m.tile.state.requestedFrameNumber===r.frameNumber?m.tile.level!==y.tile.level?m.tile.level-y.tile.level:m.tile.state.centerScreenY!==y.tile.state.centerScreenY?m.tile.state.centerScreenY-y.tile.state.centerScreenY:m.tile.state.centerZDepth!==y.tile.state.centerZDepth?m.tile.state.centerZDepth-y.tile.state.centerZDepth:m.tile.state.distanceToCamera-y.tile.state.distanceToCamera:m.tile.level!==y.tile.level?m.tile.level-y.tile.level:m.tile.state.distanceToCamera-y.tile.state.distanceToCamera});break}}if(c=Math.max(this.tileset.maxRequests-this.activeRequests,0),!this.tileset.skipLevelOfDetail)for(var d=0,p=o.length,u=0;u<p;u++){var A=o[u].tile;if(A.hasTilesetContent||A.contentParent===null||A.contentParent.state.selectedFrameNumber===this.tileset.frameNumber){var h=o.splice(u,1);o.splice.apply(o,vt([d++,0],h,!1))}}for(var v=function(m){var y=o[m];y.status==="WAITING"&&(c--,y.status="PENDING",y.time=a,g.activeRequests++,g.tileset.options.tileLoader(y.tile).catch(function(b){y.error=b}).then(function(){y.status="DONE",y.tile.content&&y.tile.content.loadState==="READY"&&(y.tile.content.loadState="LOADING"),i.activeRequests--}))},g=this,u=0;u<o.length&&c>0;u++)v(u)},n}(),Rd=function(){function n(t,e,r){this.item=t,this.previous=e,this.next=r}return n}(),Bd=function(){function n(){this.head=null,this.tail=null,this._length=0}return Object.defineProperty(n.prototype,"length",{get:function(){return this._length},enumerable:!1,configurable:!0}),n.prototype.add=function(t){var e=new Rd(t,this.tail,null);return this.tail?(this.tail.next=e,this.tail=e):(this.head=e,this.tail=e),this._length++,e},n.prototype.remove=function(t){t.previous&&t.next?(t.previous.next=t.next,t.next.previous=t.previous):t.previous?(t.previous.next=null,this.tail=t.previous):t.next?(t.next.previous=null,this.head=t.next):(this.head=null,this.tail=null),t.next=null,t.previous=null,this._length--},n.prototype.splice=function(t,e){t!==e&&(this.remove(e),this.insert(t,e))},n.prototype.insert=function(t,e){var r=t.next;t.next=e,this.tail===t?this.tail=e:r.previous=e,e.next=r,e.previous=t,this._length++},n.prototype.toArray=function(){for(var t=[],e=this.head;e;)t.push(e),e=e.next;return t},n}(),Pu=function(){function n(t){t===void 0&&(t={}),this.options=t,this.cacheNodeMap=new Map,this.list=new Bd,this.sentinel=this.list.add("sentinel")}return n.prototype.reset=function(){this.list.tail&&this.list.splice(this.list.tail,this.sentinel)},n.prototype.touchTile=function(t){var e=this.cacheNodeMap.get(t);e&&this.list.splice(this.sentinel,e)},n.prototype.loadTile=function(t){if(!this.cacheNodeMap.has(t)){var e=this.list.add(t);this.cacheNodeMap.set(t,e),this.options.onTileLoad&&this.options.onTileLoad(t)}},n.prototype.unloadTile=function(t){var e=this.cacheNodeMap.get(t);e&&(this.list.remove(e),this.cacheNodeMap.delete(t),this.options.onTileUnload&&this.options.onTileUnload(t))},n.prototype.unloadTiles=function(t){for(var e=this.list.head;e!==this.sentinel&&t();){var r=e.item;e=e.next,this.unloadTile(r)}},n.prototype.toArray=function(){for(var t=[],e=0,r=this.list.toArray();e<r.length;e++){var i=r[e];i.item!=="sentinel"&&t.push(i.item)}return t},n}(),cn=function(){function n(){this.map=new Map,this.array=[],this._length=0}return Object.defineProperty(n.prototype,"length",{get:function(){return this._length},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return this.array[t]},n.prototype.set=function(t,e){t>=this.length&&(this._length=t+1),this.map.has(this.array[t])&&this.map.delete(this.array[t]),this.array[t]=e,this.map.set(e,t)},n.prototype.delete=function(t){var e=this.map.get(t);e!==void 0&&e>=0&&(this.array.splice(e,1),this.map.delete(t),this._length--)},n.prototype.push=function(t){if(!this.map.has(t)){var e=this._length++;this.array[e]=t,this.map.set(t,e)}},n.prototype.pop=function(){var t=this.array[--this._length];return this.map.delete(t),this.array[this._length]=void 0,t},n.prototype.reset=function(){this.array=[],this.map=new Map,this._length=0},n.prototype.find=function(t){return this.map.has(t)},n.prototype.peek=function(){return this.array[this._length-1]},n}(),$o=function(){function n(t){this.tileset=t,this._canSelectTile=!0,this._loadAllTilesTraversalStack=new cn,this.root=null}return n.prototype.traverse=function(t,e,r){this.root=t,this.reset()},n.prototype.reset=function(){this._loadAllTilesTraversalStack.reset(),this.tileset.hasMixedContent=!1,this.tileset.needsRefinedTiles.clear(),this.tileset.requestedTiles.length=0,this.tileset.selectedTiles.length=0},n.prototype.updateTile=function(t,e){this.updateTileVisibility(t,e),t.state.shouldSelect=!1,t.state.finalResolution=!0},n.prototype.selectTile=function(t,e){var r=t.contentAvailable&&this._canSelectTile;r&&t.state.selectedFrameNumber<e.frameNumber&&(t.state.selectedFrameNumber=e.frameNumber,this.tileset.selectedTiles.push(t),this.tileset.needsRefinedTiles.add(t))},n.prototype.loadTile=function(t,e){t.state.requestedFrameNumber<e.frameNumber&&(t.state.requestedFrameNumber=e.frameNumber,t.content&&(t.content.loadState==="FAILED"&&e.time-t.content.loadStateUpdateTime>t.content.loadfailRetryDelay&&(t.content.loadState="UNLOADED",t.content.loadStateUpdateTime=e.time),t.content.loadState==="UNLOADED"&&this.tileset.requestedTiles.push(t))),this.tileset.needsRefinedTiles.add(t)},n.prototype.touchTile=function(t,e){this.tileset.cache.touchTile(t),t.state.touchedFrameNumber=e.frameNumber},n.prototype.canTraverse=function(t,e){return!t.state.inRequestVolume||t.levelOfContent>=e.maxLevelOfDetail||t.children.length===0?!1:t.levelOfContent<=e.minLevelOfDetail||t.hasTilesetContent?!0:t.state.screenSpaceError>this.tileset.maxScreenSpaceError},n.prototype.updateTileVisibility=function(t,e){if(t.updateState(e),!(!t.state.visible||!t.state.inRequestVolume)){var r=t.children.length>0;if(t.hasTilesetContent&&r){var i=t.children[0];this.updateTileVisibility(i,e),t.state.visible=i.state.visible;return}if(this.meetsScreenSpaceErrorEarly(t,e)){t.state.visible=!1;return}var a=t.refine==="REPLACE";if(a&&r&&!this.anyChildrenVisible(t,e)){t.state.visible=!1;return}}},n.prototype.anyChildrenVisible=function(t,e){for(var r=!1,i=t.children,a=0,o=i;a<o.length;a++){var s=o[a];s.updateState(e),r=r||s.state.visible}return r},n.prototype.meetsScreenSpaceErrorEarly=function(t,e){var r=t.parent;return!r||r.refine!=="ADD"||r.levelOfContent<e.minLevelOfDetail?!1:r.levelOfContent>e.maxLevelOfDetail?!0:t.getScreenSpaceError(e,t.state.distanceToCamera,!0)<this.tileset.maxScreenSpaceError},n.prototype.sortTilesByDistanceToCamera=function(t){t.sort(function(e,r){return r.state.distanceToCamera===0&&e.state.distanceToCamera===0?r.state.centerZDepth-e.state.centerZDepth:r.state.distanceToCamera-e.state.distanceToCamera})},n.prototype.loadAllTiles=function(t,e){var r=this._loadAllTilesTraversalStack;for(r.push(t);r.length>0;){var i=r.pop();i.content&&i.content.loadState==="UNLOADED"&&i.state.requestedFrameNumber<e.frameNumber&&this.tileset.requestedTiles.push(i),this.touchTile(i,e);for(var a=0,o=i.children;a<o.length;a++){var s=o[a];r.push(s)}}},n}(),Fd=function(n){ue(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r._traversalStack=new cn,r._emptyTraversalStack=new cn,r}return t.prototype.traverse=function(e,r,i){i===void 0&&(i=[]),n.prototype.traverse.call(this,e,r,i);for(var a=0,o=i;a<o.length;a++){var s=o[a];this._traversalStack.reset(),this._emptyTraversalStack.reset(),s.camera.refine&&(this._canSelectTile=s.camera.visible,this.updateTile(e,s),this.executeTraversal(e,s))}this._traversalStack.reset(),this._emptyTraversalStack.reset(),r.camera.refine&&(this._canSelectTile=r.camera.visible,this.updateTile(e,r),this.executeTraversal(e,r)),this.tileset.loadAll&&this.loadAllTiles(e,r)},t.prototype.reset=function(){n.prototype.reset.call(this),this._traversalStack.reset(),this._emptyTraversalStack.reset()},t.prototype.executeTraversal=function(e,r){var i=this._traversalStack;for(e.state.visible&&e.state.inRequestVolume&&i.push(e);i.length>0;){var a=i.pop(),o=a.parent,s=!o||o.state.shouldRefine,u=!1;this.canTraverse(a,r)&&(u=this.updateAndPushChildren(a,r,i)&&s);var l=!u&&s;a.hasRenderContent?a.refine==="ADD"?(this.loadTile(a,r),this.selectDesiredTile(a,r)):a.refine==="REPLACE"&&(this.loadTile(a,r),l&&this.selectDesiredTile(a,r)):(this.loadTile(a,r),l&&this.selectDesiredTile(a,r)),this.touchTile(a,r),a.state.shouldRefine=u}},t.prototype.updateAndPushChildren=function(e,r,i){for(var a=e.children,o=0,s=a;o<s.length;o++){var u=s[o];this.updateTile(u,r)}this.sortTilesByDistanceToCamera(a);for(var l=e.refine==="REPLACE"&&e.hasRenderContent,c=!1,d=!0,p=0,A=a;p<A.length;p++){var u=A[p];if(u.levelOfContent<=r.minLevelOfDetail||u.state.visible&&u.state.inRequestVolume?(i.find(u)&&i.delete(u),i.push(u),c===!1&&(c=!0)):(l||this.tileset.loadSiblings)&&(this.loadTile(u,r),this.touchTile(u,r)),l){var h=void 0;u.state.inRequestVolume?u.hasRenderContent?h=u.contentAvailable:h=this.executeEmptyTraversal(u,r):h=!1,d=d&&h}}return c||(d=!1),d},t.prototype.selectDesiredTile=function(e,r){e.contentAvailable&&n.prototype.selectTile.call(this,e,r)},t.prototype.executeEmptyTraversal=function(e,r){var i=!0,a=this._emptyTraversalStack;for(a.push(e);a.length>0&&i;){var o=a.pop(),s=!o.hasRenderContent&&this.canTraverse(o,r);if(!s&&!o.contentAvailable&&(i=!1),this.updateTile(o,r),o.state.visible||(this.loadTile(o,r),this.touchTile(o,r)),s)for(var u=o.children,l=0,c=u;l<c.length;l++){var d=c[l];a.find(d)&&a.delete(d),a.push(d)}}return i},t}($o),Ld=function(n){ue(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r.baseScreenSpaceError=1024,r.skipScreenSpaceErrorFactor=16,r.skipLevels=1,r._traversalStack=new cn,r._descendantTraversalStack=new cn,r._selectionTraversalStack=new cn,r._selectionTraversalancestorStack=new cn,r}return t.prototype.traverse=function(e,r,i){i===void 0&&(i=[]),n.prototype.traverse.call(this,e,r,i);for(var a=0,o=i;a<o.length;a++){var s=o[a];this._traversalStack.reset(),s.camera.refine&&(this._canSelectTile=s.camera.visible,this.updateTile(e,s),this.executeTraversal(e,s),this.traverseAndSelect(e,s))}this.tileset.hasMixedContent=!1,this._traversalStack.reset(),this._descendantTraversalStack.reset(),this._selectionTraversalStack.reset(),this._selectionTraversalancestorStack.reset(),r.camera.refine&&(this._canSelectTile=r.camera.visible,this.updateTile(e,r),this.executeTraversal(e,r),this.traverseAndSelect(e,r)),this.tileset.loadAll&&this.loadAllTiles(e,r)},t.prototype.reset=function(){n.prototype.reset.call(this),this._traversalStack.reset(),this._descendantTraversalStack.reset(),this._selectionTraversalStack.reset(),this._selectionTraversalancestorStack.reset()},t.prototype.executeTraversal=function(e,r){var i=this._traversalStack;for(e.state.visible&&e.state.inRequestVolume&&i.push(e);i.length>0;){var a=i.pop();this.updateTileAncestorContentLinks(a,r);var o=a.parent,s=!o||o.state.shouldRefine,u=!1;this.canTraverse(a,r)&&(u=this.updateAndPushChildren(a,r,i)&&s);var l=!u&&s;a.hasRenderContent?a.refine==="ADD"?(this.loadTile(a,r),this.selectDesiredTile(a,r)):a.refine==="REPLACE"&&(this.inBaseTraversal(a,this.baseScreenSpaceError)?(this.loadTile(a,r),l&&this.selectDesiredTile(a,r)):l?(this.loadTile(a,r),this.selectDesiredTile(a,r)):this.reachedSkippingThreshold(a)&&this.loadTile(a,r)):(this.loadTile(a,r),l&&this.selectDesiredTile(a,r)),this.touchTile(a,r),a.state.shouldRefine=u}},t.prototype.updateAndPushChildren=function(e,r,i){for(var a=e.children,o=0,s=a;o<s.length;o++){var u=s[o];this.updateTile(u,r)}this.sortTilesByDistanceToCamera(a);for(var l=!1,c=0,d=a;c<d.length;c++){var u=d[c];u.levelOfContent<=r.minLevelOfDetail||u.state.visible&&u.state.inRequestVolume?(i.push(u),l===!1&&(l=!0)):this.tileset.loadSiblings&&(this.loadTile(u,r),this.touchTile(u,r))}return l},t.prototype.selectDesiredTile=function(e,r){var i=e.contentAvailable?e:e.state.ancestorWithContentAvailable;i&&(i.state.shouldSelect=!0),e.contentAvailable||this.selectDescendants(e,r)},t.prototype.selectDescendants=function(e,r){var i=this._descendantTraversalStack;for(i.push(e);i.length>0;)for(var a=i.pop(),o=a.children,s=0,u=o;s<u.length;s++){var l=u[s];l.state.visible&&(l.contentAvailable?(this.updateTile(l,r),this.touchTile(l,r),this.selectTile(l,r)):i.push(l))}},t.prototype.reachedSkippingThreshold=function(e){var r=e.state.ancestorWithContent,i=r!==null&&e.state.screenSpaceError<r.state.screenSpaceError/this.skipScreenSpaceErrorFactor&&e.levelOfContent>r.levelOfContent+this.skipLevels;return i},t.prototype.updateTileAncestorContentLinks=function(e,r){e.state.ancestorWithContent=null,e.state.ancestorWithContentAvailable=null;var i=e.parent;if(i){var a=!(i.hasRenderContent&&i.hasUnloadedContent)||i.state.requestedFrameNumber===r.frameNumber;e.state.ancestorWithContent=a?i:i.state.ancestorWithContent,e.state.ancestorWithContentAvailable=i.contentAvailable?i:i.state.ancestorWithContentAvailable}},t.prototype.inBaseTraversal=function(e,r){return e.state.ancestorWithContent?e.parent&&e.state.screenSpaceError===0?e.parent.state.screenSpaceError>r:e.state.screenSpaceError>r:!0},t.prototype.traverseAndSelect=function(e,r){var i=this._selectionTraversalStack,a=this._selectionTraversalancestorStack,o;for(i.push(e);i.length>0||a.length>0;){if(a.length>0){var s=a.peek();if(s.state.stackLength===i.length){a.pop(),s!==o&&(s.state.finalResolution=!1),this.selectTile(s,r);continue}}var u=i.pop();if(u){var l=this.canTraverse(u,r);if(u.state.shouldSelect)if(u.refine==="ADD")this.selectTile(u,r);else{if(u.state.selectionDepth=a.length,u.state.selectionDepth>0&&(u.tileset.hasMixedContent=!0),o=u,!l){this.selectTile(u,r);continue}a.push(u),u.state.stackLength=i.length}if(l)for(var c=0,d=u.children;c<d.length;c++){var p=d[c];p.state.visible&&i.push(p)}}}},t}($o),kd=function(n){ue(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r._traversalStack=new cn,r}return t.prototype.canTraverse=function(e,r){return!(!e.state.inRequestVolume||e.levelOfContent>=r.maxLevelOfDetail||e.children.length===0)},t.prototype.traverse=function(e,r,i){n.prototype.traverse.call(this,e,r,[]),this._traversalStack.reset(),e.updateState(r);for(var a=0,o=i;a<o.length;a++){var s=o[a];this._traversalStack.reset(),s.camera.refine&&(this._canSelectTile=s.camera.visible,e.updateState(s),this.executeTraversal(e,s))}this._traversalStack.reset(),r.camera.refine&&(this._canSelectTile=r.camera.visible,e.updateState(r),this.executeTraversal(e,r)),this.tileset.loadAll&&this.loadAllTiles(e,r)},t.prototype.reset=function(){n.prototype.reset.call(this),this._traversalStack.reset()},t.prototype.executeTraversal=function(e,r){var i=this._traversalStack;for(i.push(e);i.length>0;){var a=i.pop(),o=a.refine==="ADD",s=a.refine==="REPLACE",u=this.canTraverse(a,r);u&&this.updateAndPushChildren(a,r,i),(o||s&&!u)&&(this.loadTile(a,r),this.touchTile(a,r),this.selectDesiredTile(a,r))}},t.prototype.updateAndPushChildren=function(e,r,i){for(var a=e.children,o=0;o<a.length;++o){var s=a[o];s.updateState(r),s.state.visible&&i.push(s)}},t.prototype.selectDesiredTile=function(e,r){e.contentAvailable&&n.prototype.selectTile.call(this,e,r)},t}($o),Ru=function(){function n(t,e,r){this.index=t,this.name=e.name,this.visible=!1,this.tileset=r,this.transform=new f.Matrix4,e.transform&&this.transform.fromArray(e.transform),this.transform.premultiply(this.tileset.root.transform),this.content={uri:e.file,byteLength:0,loadState:"UNLOADED",loadStateUpdateTime:ve(),loadfailRetryDelay:0,data:void 0}}return n}(),Od=new f.Matrix4,zr=function(){function n(t,e,r){var i=this,a,o,s,u,l,c,d,p,A;if(this.id=t,this.transform=new f.Matrix4,this.transformIsIdentity=!0,this.hasMixedContent=!1,this.url=(a=r.url)!==null&&a!==void 0?a:"",this.referer=(o=r.referer)!==null&&o!==void 0?o:"",this.asset={version:e.asset.version,tilesetVersion:e.asset.tilesetVersion||"",gltfUpAxis:(s=e.asset.gltfUpAxis)!==null&&s!==void 0?s:"Y",overview:e.asset.overview,trajectories:(l=(u=e.asset.trajectories)===null||u===void 0?void 0:u.list)!==null&&l!==void 0?l:[],extras:e.asset.extras},this.rootMeta=(c=e.rootMeta)!==null&&c!==void 0?c:{},this.pointLength=(d=this.rootMeta.numTotalPoints)!==null&&d!==void 0?d:1/0,this.floorLength=(p=this.rootMeta.numFloors)!==null&&p!==void 0?p:1,this.properties=(A=e.properties)!==null&&A!==void 0?A:{},this.options=r,this.maxMemoryUsage=n.DEFAULT_MAX_MEMORY_USAGE,this.maxScreenSpaceError=n.DEFAULT_MAX_SCREEN_SPACE_ERROR,this.skipLevelOfDetail=n.DEFAULT_SKIP_LEVEL_OF_DETAIL,this.mostDetail=n.DEFAULT_MOST_DETAIL,this.loadSiblings=n.DEFAULT_LOAD_SIBLINGS,this.loadAll=n.DEFAULT_LOAD_ALL,this.maxRequests=n.DEFAULT_MAX_REQUESTS,this.tileRequestOrder=n.DEFAULT_REQUEST_ORDER,this.requestedTiles=[],this.selectedTiles=[],this.unloadTiles=[],this.needsRefinedTiles=new Set,this.selectedTrajectories=[],this.normalTraverser=new Fd(this),this.skipTraverser=new Ld(this),this.mostDetailTraverser=new kd(this),this.cache=new Pu({onTileLoad:function(g){i.memoryUsageInBytes+=g.contentByteLength},onTileUnload:function(g){i.memoryUsageInBytes-=g.contentByteLength,i.unloadTiles.push(g)}}),this.requestScheduler=new Tu(this,{onTileSkip:function(g){},onTileLoad:function(g){var m;!((m=g.content)===null||m===void 0)&&m.data&&(i.loadedTiles.add(g),i.cache.loadTile(g)),i.options.onTileLoad(g)},onTileError:function(g,m){i.options.onTileError(g,m)}}),this.frameNumber=0,this.maxLevelOfDetail=0,this.minLevelOfDetail=0,this.loadedTiles=new Set,this.memoryUsageInBytes=0,this.root=new Yo("".concat(this.id,".0"),e.root,this),this.geometricError=e.geometricError,this.trajectories=[],this.asset.trajectories)for(var h=0;h<this.asset.trajectories.length;h++){var v=new Ru(h,this.asset.trajectories[h],this);this.trajectories.push(v)}}return Object.defineProperty(n.prototype,"traverser",{get:function(){return this.mostDetail?this.mostDetailTraverser:this.skipLevelOfDetail?this.skipTraverser:this.normalTraverser},enumerable:!1,configurable:!0}),n.prototype.reset=function(){for(var t=this,e=[this.root],r;r=e.pop();){for(var i=0,a=r.children.length;i<a;i++)e.push(r.children[i]);this.cache.unloadTile(r)}for(var o=function(){var c=s.unloadTiles.pop();c&&(s.loadedTiles.delete(c),s.memoryUsageInBytes-=c.contentByteLength,s.options.tileUnloader(c).catch(function(){}).then(function(){t.options.onTileUnload&&t.options.onTileUnload(c)}))},s=this;this.unloadTiles.length;)o();this.cache.reset(),this.traverser.reset(),this.requestScheduler.reset(),this.loadedTiles.clear();for(var u=function(){var c=l.trajectories.pop();c&&l.options.trajectoryUnloader(c).catch(function(){}).then(function(){t.options.onTrajectoryUnload&&t.options.onTrajectoryUnload(c)})},l=this;this.trajectories.length;)u()},n.prototype.update=function(t,e){var r=this,i;e===void 0&&(e=[]),this.frameNumber=t.frameNumber,this.minLevelOfDetail=t.minLevelOfDetail,this.maxLevelOfDetail=t.maxLevelOfDetail,this.transformIsIdentity=this.transform.equals(Od),this.traverser.traverse(this.root,t,e),this.cache.unloadTiles(function(){var p=r.memoryUsageInBytes>r.maxMemoryUsage*1024*1024;return p}),this.requestScheduler.update(this.requestedTiles,this.tileRequestOrder,t);for(var a=function(){var p=o.unloadTiles.pop();p&&(o.loadedTiles.delete(p),o.options.tileUnloader(p).catch(function(){}).then(function(){r.options.onTileUnload&&r.options.onTileUnload(p)}))},o=this;this.unloadTiles.length;)a();this.selectedTrajectories.length=0;for(var s=function(p){p.visible===!0&&p.content.loadState==="READY"&&(!((i=p.content.data)===null||i===void 0)&&i.object)?u.selectedTrajectories.push(p):p.visible===!0&&(p.content.loadState==="FAILED"&&t.time-p.content.loadStateUpdateTime>p.content.loadfailRetryDelay&&(p.content.loadState="UNLOADED",p.content.loadStateUpdateTime=t.time),p.content.loadState==="UNLOADED"&&u.options.trajectoryLoader(p).then(function(){r.options.onTrajectoryLoad(p)}).catch(function(A){r.options.onTrajectoryError(p,A)}))},u=this,l=0,c=this.trajectories;l<c.length;l++){var d=c[l];s(d)}},n.DEFAULT_MAX_MEMORY_USAGE=16,n.DEFAULT_MAX_SCREEN_SPACE_ERROR=4,n.DEFAULT_SKIP_LEVEL_OF_DETAIL=!1,n.DEFAULT_MOST_DETAIL=!1,n.DEFAULT_LOAD_SIBLINGS=!1,n.DEFAULT_LOAD_ALL=!1,n.DEFAULT_MAX_REQUESTS=6,n.DEFAULT_REQUEST_ORDER="SCREEN_SPACE_ERROR",n}(),Bu=function(){function n(t,e){this.position=t,this.indices=e}return n.prototype.getPositionCount=function(){var t,e,r=this.indices,i=this.position;return r?r.array.length/((t=r.stride)!==null&&t!==void 0?t:1):i.array.length/((e=i.stride)!==null&&e!==void 0?e:3)},n.prototype.getPositionByIndex=function(t,e){var r,i,a,o,s=this.indices,u=this.position,l=t;if(s){var c=s.array,d=(r=s.stride)!==null&&r!==void 0?r:1,p=(i=s.offset)!==null&&i!==void 0?i:0;l=c[t*d+p]}var A=u.array,h=(a=u.stride)!==null&&a!==void 0?a:3,v=(o=u.offset)!==null&&o!==void 0?o:0;return l=l*h+v,e.x=A[l],e.y=A[l+1],e.z=A[l+2],e},n.prototype.createTree=function(t,e,r){throw new Error("not implemented")},n.prototype.trianglesInSphere=function(t,e){throw new Error("not implemented")},n.prototype.intersectRay=function(t,e,r,i){throw new Error("not implemented")},n}(),Hn=function(){function n(t,e,r,i,a){this.id=t,this.extents=e,this.startIndex=r,this.endIndex=i,this.deepth=a}return n}(),qr=6*4+4+4+2+2;function Fu(n,t){for(var e=new ArrayBuffer(t*qr),r=new Float32Array(e),i=new Uint32Array(e),a=new Uint16Array(e),o=[n],s,u;s=o.pop();)u=s.id*qr/4,r[u]=s.extents[0],r[u+1]=s.extents[1],r[u+2]=s.extents[2],r[u+3]=s.extents[3],r[u+4]=s.extents[4],r[u+5]=s.extents[5],i[u+6]=s.startIndex,i[u+7]=s.endIndex,u=s.id*qr/2,s.node0&&(a[u+16]=s.node0.id,o.push(s.node0)),s.node1&&(a[u+17]=s.node1.id,o.push(s.node1));return e}function Lu(n,t,e,r,i,a,o,s,u){u===void 0&&(u=0),e=e-u,r=r-u,i=i-u,a=a+u,o=o+u,s=s+u;var l=0,c=0,d=0,p=0,A=0,h=0;return t.x>=0?(l=(e-n.x)*t.x,c=(a-n.x)*t.x):(l=(a-n.x)*t.x,c=(e-n.x)*t.x),t.y>=0?(d=(r-n.y)*t.y,p=(o-n.y)*t.y):(d=(o-n.y)*t.y,p=(r-n.y)*t.y),!(l>p||d>c||(d>l&&(l=d),p<c&&(c=p),t.z>=0?(A=(i-n.z)*t.z,h=(s-n.z)*t.z):(A=(s-n.z)*t.z,h=(i-n.z)*t.z),l>h||A>c)||(A>l&&(l=A),h<c&&(c=h),c<0))}var Pn=function(){function n(t,e,r){this.x=t,this.y=e,this.z=r}return n.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},n.prototype.set=function(t,e,r){return this.x=t,this.y=e,this.z=r,this},n.prototype.fromArray=function(t,e){return e===void 0&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},n.prototype.toArray=function(t,e){return t===void 0&&(t=[]),e===void 0&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},n.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this},n.prototype.multiplyScalar=function(t){return this.x*=t,this.y*=t,this.z*=t,this},n.prototype.subVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},n.prototype.addScaledVector=function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},n.prototype.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z},n.prototype.cross=function(t){var e=this.x,r=this.y,i=this.z;return this.x=r*t.z-i*t.y,this.y=i*t.x-e*t.z,this.z=e*t.y-r*t.x,this},n.prototype.crossVectors=function(t,e){var r=t.x,i=t.y,a=t.z,o=e.x,s=e.y,u=e.z;return this.x=i*u-a*s,this.y=a*o-r*u,this.z=r*s-i*o,this},n.prototype.distanceTo=function(t){return Math.sqrt(this.distanceToSquared(t))},n.prototype.distanceToSquared=function(t){var e=this.x-t.x,r=this.y-t.y,i=this.z-t.z;return e*e+r*r+i*i},n.prototype.clone=function(){return new n(this.x,this.y,this.z)},n}(),ku=function(){function n(t,e,r){this.triangle=t,this.intersectionPoint=e,this.index=r}return n}(),Ks=1e-6,Je=new Pn(0,0,0),$r=new Pn(0,0,0),en=new Pn(0,0,0),tn=new Pn(0,0,0),Ou=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.createTree=function(e,r,i){r=Math.min(r,16);var a=this.getPositionCount()/3,o=a>65535?new Uint32Array(a):new Uint16Array(a),s=new Float32Array(a*6),u=[],l=0,c=-1;if(i)for(var d=0,p=0,A=0,h=void 0,v=void 0,g=void 0,m=void 0,y=void 0,b=void 0,x=void 0;d<a;d+=1,p+=3,A+=6)o[d]=d,this.getPositionByIndex(p,$r),this.getPositionByIndex(p+1,en),this.getPositionByIndex(p+2,tn),h=m=$r.x,x=en.x,x<h&&(h=x),x>m&&(m=x),x=tn.x,x<h&&(h=x),x>m&&(m=x),v=y=$r.y,x=en.y,x<v&&(v=x),x>y&&(y=x),x=tn.y,x<v&&(v=x),x>y&&(y=x),g=b=$r.z,x=en.z,x<g&&(g=x),x>b&&(b=x),x=tn.z,x<g&&(g=x),x>b&&(b=x),s[A]=h,s[A+1]=v,s[A+2]=g,s[A+3]=m,s[A+4]=y,s[A+5]=b;else{for(var w=1/0,M=1/0,S=1/0,E=-1/0,B=-1/0,R=-1/0,d=0,p=0,A=0,h=void 0,v=void 0,g=void 0,m=void 0,y=void 0,b=void 0,x=void 0;d<a;d+=1,p+=3,A+=6)o[d]=d,this.getPositionByIndex(p,$r),this.getPositionByIndex(p+1,en),this.getPositionByIndex(p+2,tn),h=m=$r.x,x=en.x,x<h&&(h=x),x>m&&(m=x),x=tn.x,x<h&&(h=x),x>m&&(m=x),v=y=$r.y,x=en.y,x<v&&(v=x),x>y&&(y=x),x=tn.y,x<v&&(v=x),x>y&&(y=x),g=b=$r.z,x=en.z,x<g&&(g=x),x>b&&(b=x),x=tn.z,x<g&&(g=x),x>b&&(b=x),s[A]=h,s[A+1]=v,s[A+2]=g,s[A+3]=m,s[A+4]=y,s[A+5]=b,h<w&&(w=h),m>E&&(E=m),v<M&&(M=v),y>B&&(B=y),g<S&&(S=g),b>R&&(R=b);i=[w,M,S,E,B,R]}var C=new Hn(++c,i,0,a,0);u[l++]=C;var I=[],L=[0,1,2],T=function(D,V){return I[V]-I[D]};function F(D){var V=D.startIndex,z=D.endIndex,U=D.extents;I[0]=U[3]-U[0],I[1]=U[4]-U[1],I[2]=U[5]-U[2],L.sort(T);for(var q=0;q<3;q++){for(var G=L[q],K=U[G]+U[G+3],j=V,J=z-1,W=-1,$=void 0;j<=J;)W===-1?($=o[j],s[$*6+G]+s[$*6+G+3]<K?j++:W=$):($=o[J],s[$*6+G]+s[$*6+G+3]>=K||(o[j]=$,o[J]=W,W=-1,j++),J--);if(j>V&&j<z){var Y=new Hn(++c,_s(o,s,V,j,Ks),V,j,D.deepth+1);Y.deepth<r&&Y.endIndex-Y.startIndex>e&&(u[l++]=Y);var Z=new Hn(++c,_s(o,s,j,z,Ks),j,z,D.deepth+1);Z.deepth<r&&Z.endIndex-Z.startIndex>e&&(u[l++]=Z),D.node0=Y,D.node1=Z,D.startIndex=0,D.endIndex=0;break}}}for(;l;)F(u[--l]);return this.offsetArray=o,this.rootNodePacked=Fu(C,c+1),u.length=0,this},t.prototype.trianglesInSphere=function(e,r){for(var i=this.offsetArray,a=this.rootNodePacked,o=new Float32Array(a),s=new Uint32Array(a),u=new Uint16Array(a),l=[0],c=[],d,p,A,h;(d=l.pop())!==void 0;){h=d*qr/4;var v=za(e.x,o[h],o[h+3])-e.x,g=za(e.y,o[h+1],o[h+4])-e.y,m=za(e.z,o[h+2],o[h+5])-e.z;if(v*v+g*g+m*m<=r*r){for(var y=s[h+6];y<s[h+7];y++)c.push(i[y]);h=d*qr/2,p=u[h+16],A=u[h+17],p&&l.push(p),A&&l.push(A)}}for(var b=c.length,x=new Float32Array(b*9),y=0;y<b;y++){var w=c[y];this.getPositionByIndex(w,Je),x[y*9]=Je.x,x[y*9+1]=Je.y,x[y*9+2]=Je.z,this.getPositionByIndex(w+1,Je),x[y*9+3]=Je.x,x[y*9+4]=Je.y,x[y*9+5]=Je.z,this.getPositionByIndex(w+2,Je),x[y*9+6]=Je.x,x[y*9+7]=Je.y,x[y*9+8]=Je.z}return x},t.prototype.intersectRay=function(e,r,i,a){for(var o=this.offsetArray,s=this.rootNodePacked,u=new Float32Array(s),l=new Uint32Array(s),c=new Uint16Array(s),d=new Pn(1/r.x,1/r.y,1/r.z),p=[0],A,h,v,g;(A=p.pop())!==void 0;)if(g=A*qr/4,Lu(e,d,u[g],u[g+1],u[g+2],u[g+3],u[g+4],u[g+5])){for(var m=l[g+6],y=l[g+7],b=void 0,x=void 0,w=void 0,M=e.x,S=e.y,E=e.z,B=r.x,R=r.y,C=r.z,I=void 0,L=void 0,T=void 0,F=void 0,D=void 0,V=void 0,z=void 0,U=void 0,q=void 0,G=void 0,K=void 0,j=void 0,J=void 0,W=void 0,$=void 0,Y=void 0,Z=void 0,oe=void 0,ne=void 0,de=void 0,se=void 0,ye=void 0,ie=void 0,xe=void 0,Le=void 0,Ce=void 0,Oe=void 0;m<y;m++){if(b=o[m],x=b*3,this.getPositionByIndex(x,Je),I=Je.x,L=Je.y,T=Je.z,this.getPositionByIndex(x+1,Je),F=Je.x,D=Je.y,V=Je.z,this.getPositionByIndex(x+2,Je),z=Je.x,U=Je.y,q=Je.z,G=F-I,K=D-L,j=V-T,J=z-I,W=U-L,$=q-T,Y=K*$-j*W,Z=j*J-G*$,oe=G*W-K*J,ie=B*Y+R*Z+C*oe,ie>0)ye=1;else if(ie<0)ye=-1,ie=-ie;else continue;ne=M-I,de=S-L,se=E-T,xe=ye*(B*(de*$-se*W)+R*(se*J-ne*$)+C*(ne*W-de*J)),!(xe<0)&&(Le=ye*(B*(K*se-j*de)+R*(j*ne-G*se)+C*(G*de-K*ne)),!(Le<0)&&(xe+Le>ie||(Ce=-ye*(ne*Y+de*Z+se*oe),!(Ce<0)&&(Oe=Ce/ie,a.push(new ku([I,L,T,F,D,V,z,U,q],[M+B*Oe,S+R*Oe,E+C*Oe],b))))))}g=A*qr/2,h=c[g+16],v=c[g+17],h&&p.push(h),v&&p.push(v)}return a},t}(Bu);function za(n,t,e){return n<t?t:n>e?e:n}function _s(n,t,e,r,i){if(e>=r)return[0,0,0,0,0,0];for(var a=1/0,o=1/0,s=1/0,u=-1/0,l=-1/0,c=-1/0,d=e,p=void 0,A=void 0;d<r;d++)p=n[d]*6,A=t[p],A<a&&(a=A),A=t[p+1],A<o&&(o=A),A=t[p+2],A<s&&(s=A),A=t[p+3],A>u&&(u=A),A=t[p+4],A>l&&(l=A),A=t[p+5],A>c&&(c=A);return[a-i,o-i,s-i,u+i,l+i,c+i]}var js=1e-6,Dd=["x","y","z"],xt=new Pn(0,0,0),Du=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.createTree=function(e,r,i){r=Math.min(r,16);var a=this.getPositionByIndex.bind(this),o=this.getPositionCount(),s=o>65535?new Uint32Array(o):new Uint16Array(o),u=[],l=0,c=-1;if(i)for(var d=0;d<o;d+=1)s[d]=d;else{a(0,xt);for(var p=xt.x,A=xt.y,h=xt.z,v=p,g=A,m=h,d=0,y=void 0,b=void 0,x=void 0;d<o;d+=1)s[d]=d,a(d,xt),y=xt.x,b=xt.y,x=xt.z,y<p?p=y:y>v&&(v=y),b<A?A=b:b>g&&(g=b),x<h?h=x:x>m&&(m=x);i=[p,A,h,v,g,m]}var w=new Hn(++c,i,0,o,0);u[l++]=w;var M=[],S=[0,1,2],E=function(R,C){return M[C]-M[R]};function B(R){var C=R.startIndex,I=R.endIndex,L=R.extents;M[0]=L[3]-L[0],M[1]=L[4]-L[1],M[2]=L[5]-L[2];for(var T=S.sort(E)[0],F=Dd[T],D=(L[T]+L[T+3])/2,V=C,z=I-1,U=-1,q;V<=z;)U===-1?(q=s[V],a(q,xt),xt[F]<D?V++:U=q):(q=s[z],a(q,xt),xt[F]>=D||(s[V]=q,s[z]=U,U=-1,V++),z--);if(V>C){var G=L.slice();G[T+3]=D+js;var K=new Hn(++c,G,C,V,R.deepth+1);K.deepth<r&&K.endIndex-K.startIndex>e&&(u[l++]=K),R.node0=K}if(I>V){var j=L.slice();j[T]=D-js;var J=new Hn(++c,j,V,I,R.deepth+1);J.deepth<r&&J.endIndex-J.startIndex>e&&(u[l++]=J),R.node1=J}R.startIndex=0,R.endIndex=0}for(;l;)B(u[--l]);return this.offsetArray=s,this.rootNodePacked=Fu(w,c+1),u.length=0,this},t.prototype.intersectRay=function(e,r,i,a){for(var o=this.offsetArray,s=this.rootNodePacked,u=new Float32Array(s),l=new Uint32Array(s),c=new Uint16Array(s),d=i*i,p=new Pn(1/r.x,1/r.y,1/r.z),A=[0],h,v,g,m;(h=A.pop())!==void 0;)if(m=h*qr/4,Lu(e,p,u[m],u[m+1],u[m+2],u[m+3],u[m+4],u[m+5],i)){for(var y=l[m+6],b=l[m+7],x=void 0,w=void 0,M=void 0,S=void 0,E=void 0,B=void 0,R=void 0,C=void 0,I=void 0,L=void 0,T=void 0,F=void 0;y<b;y++)x=o[y],this.getPositionByIndex(x,xt),w=xt.x,M=xt.y,S=xt.z,E=e.x,B=e.y,R=e.z,C=r.x,I=r.y,L=r.z,T=C*(w-E)+I*(M-B)+L*(S-R),T>0&&(E+=C*T,B+=I*T,R+=L*T),C=w-E,I=M-B,L=S-R,T=C*C+I*I+L*L,T<=d&&a.push(new ku([w,M,S,w,M,S,w,M,S],[E,B,R],x));m=h*qr/2,v=c[m+16],g=c[m+17],v&&A.push(v),g&&A.push(g)}return a},t}(Bu);const Vu="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBlcj1mdW5jdGlvbihlLHIpe3JldHVybiBlcj1PYmplY3Quc2V0UHJvdG90eXBlT2Z8fHtfX3Byb3RvX186W119aW5zdGFuY2VvZiBBcnJheSYmZnVuY3Rpb24odCxvKXt0Ll9fcHJvdG9fXz1vfXx8ZnVuY3Rpb24odCxvKXtmb3IodmFyIGYgaW4gbylPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwobyxmKSYmKHRbZl09b1tmXSl9LGVyKGUscil9O2Z1bmN0aW9uIGhyKGUscil7aWYodHlwZW9mIHIhPSJmdW5jdGlvbiImJnIhPT1udWxsKXRocm93IG5ldyBUeXBlRXJyb3IoIkNsYXNzIGV4dGVuZHMgdmFsdWUgIitTdHJpbmcocikrIiBpcyBub3QgYSBjb25zdHJ1Y3RvciBvciBudWxsIik7ZXIoZSxyKTtmdW5jdGlvbiB0KCl7dGhpcy5jb25zdHJ1Y3Rvcj1lfWUucHJvdG90eXBlPXI9PT1udWxsP09iamVjdC5jcmVhdGUocik6KHQucHJvdG90eXBlPXIucHJvdG90eXBlLG5ldyB0KX10eXBlb2YgU3VwcHJlc3NlZEVycm9yPT0iZnVuY3Rpb24iJiZTdXBwcmVzc2VkRXJyb3I7dmFyIGRyPWZ1bmN0aW9uKCl7ZnVuY3Rpb24gZShyLHQpe3RoaXMucG9zaXRpb249cix0a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{type:"text/javascript;charset=utf-8"});function Nd(n){let t;try{if(t=Js&&(self.URL||self.webkitURL).createObjectURL(Js),!t)throw"";const e=new Worker(t,{name:n==null?void 0:n.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch(e){return new Worker("data:text/javascript;base64,"+Vu,{name:n==null?void 0:n.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var Nu=function(){function n(t,e){this.pool=e,this.workerCreator=t,this.queue=[],this.workers=[],this.workersResolver=[],this.workerStatus=0}return n.prototype.initWorker=function(t){if(this.workerCreator&&!this.workers[t]){var e=this.workerCreator();e.addEventListener("message",this.onMessage.bind(this,t)),this.workers[t]=e}},n.prototype.getIdleWorker=function(){for(var t=0;t<this.pool;t++)if(!(this.workerStatus&1<<t))return t;return-1},n.prototype.onMessage=function(t,e){var r=this.workersResolver[t],i=r.resolve,a=r.reject;if(e.data&&"$$error"in e.data?a(e.data.$$error):i(e.data),this.queue.length){var o=this.queue.shift(),s=o.resolve,u=o.reject,l=o.input,c=o.transfer;this.workersResolver[t]={resolve:s,reject:u},this.workers[t].postMessage(l,c)}else this.workerStatus^=1<<t},n.prototype.postMessage=function(t,e){var r=this;return e===void 0&&(e=[]),new Promise(function(i,a){var o=r.getIdleWorker();o!==-1?(r.initWorker(o),r.workerStatus|=1<<o,r.workersResolver[o]={resolve:i,reject:a},r.workers[o].postMessage(t,e)):r.queue.push({resolve:i,reject:a,input:t,transfer:e})})},n.prototype.dispose=function(){this.workers.forEach(function(t){return t.terminate()}),this.workersResolver.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0},n}(),zd=new Nu(function(){return new Nd},4),Qd=new Map,Gn=new f.Ray,Xs=new f.Matrix3,ci=new f.Matrix4,zu=new f.Vector3,Ud=new f.Vector3,qd=new f.Vector3,Hd=new f.Triangle;function Gd(n,t,e,r){var i,a=n.matrixWorld;ci.getInverse(a),Gn.copy(e.ray).applyMatrix4(ci);for(var o=t.intersectRay(Gn.origin,Gn.direction,0,[]),s=n.geometry,u=n.material,l=s.groups,c=s.index,d=0,p=o.length;d<p;d++){var A=o[d],h=A.triangle,v=A.index,g=A.intersectionPoint,m=new f.Vector3(g[0],g[1],g[2]).applyMatrix4(a),y=e.ray.origin.distanceTo(m);if(!(y<e.near||y>e.far)){var b=void 0;if(Array.isArray(u)){if(l)for(var x=v*3,w=0,M=l;w<M.length;w++){var S=M[w];if(x>=S.start&&x-S.start<S.count){b=u[(i=S.materialIndex)!==null&&i!==void 0?i:0];break}}}else b=u;if(b){var E=Hd.set(zu.set(h[0],h[1],h[2]).applyMatrix4(a),Ud.set(h[3],h[4],h[5]).applyMatrix4(a),qd.set(h[6],h[7],h[8]).applyMatrix4(a)).getNormal(new f.Vector3),B=v*3,R=new f.Face3(c?c.array[B]:B,c?c.array[B+1]:B+1,c?c.array[B+2]:B+2,E),C=e.ray.direction.dot(E);b.side===f.FrontSide&&C>=0||b.side===f.BackSide&&C<=0||r.push({distance:y,object:n,face:R,point:m,distanceToRay:0,faceIndex:v})}}}}function Kd(n,t,e,r){var i,a,o=n.matrixWorld;Xs.getNormalMatrix(o),ci.getInverse(o);var s=((a=(i=e.params.Points)===null||i===void 0?void 0:i.threshold)!==null&&a!==void 0?a:1)*ci.getMaxScaleOnAxis();Gn.copy(e.ray).applyMatrix4(ci);for(var u=t.intersectRay(Gn.origin,Gn.direction,s,[]),l=n.geometry,c=l.index,d=l.getAttribute("normal"),p=0,A=u.length;p<A;p++){var h=u[p],v=h.triangle,g=h.index,m=h.intersectionPoint,y=new f.Vector3(m[0],m[1],m[2]).applyMatrix4(o),b=e.ray.origin.distanceTo(y);if(!(b<e.near||b>e.far)){var x=zu.set(v[0],v[1],v[2]).applyMatrix4(o),w=c?c.array[g]:g,M=void 0;if(d instanceof f.BufferAttribute){var S=new f.Vector3().fromBufferAttribute(d,w).applyNormalMatrix(Xs);M=new f.Face3(w,w,w,S)}r.push({distance:b,object:n,face:M,point:y,distanceToRay:y.distanceTo(x),index:g})}}}var Qu="__bvh_mesh__",_d=f.Mesh.prototype.raycast;function jd(n,t){var e=Jd(this);e?Gd(this,e,n,t):_d.call(this,n,t)}function Jd(n){var t=n[Qu];return t instanceof Ou,t}function Xd(n,t){var e;Object.assign(n,(e={},e[Qu]=t,e.raycast=jd,e))}var Uu="__bvh_points__",Wd=f.Points.prototype.raycast;function Zd(n,t){var e=Yd(this);e?Kd(this,e,n,t):Wd.call(this,n,t)}function Yd(n){var t=n[Uu];return t instanceof Du,t}function $d(n,t){var e;Object.assign(n,(e={},e[Uu]=t,e.raycast=Zd,e))}function eh(n,t,e,r){var i=[];return n.traverse(function(a){(a instanceof f.Mesh||a instanceof f.Points)&&a.geometry instanceof f.BufferGeometry&&i.push(a)}),Promise.resolve().then(function(){for(var a=[],o=new Set,s=null,u=0;u<i.length;u++){var l=i[u],c=l.geometry;if(c instanceof f.BufferGeometry){var d=void 0;if(l instanceof f.Mesh?d="mesh":l instanceof f.Points&&(d="points"),!!d){var p=c.boundingBox,A=p?[p.min.x,p.min.y,p.min.z,p.max.x,p.max.y,p.max.z]:void 0,h={};for(var v in c.attributes){var g=c.attributes[v];g instanceof f.InterleavedBufferAttribute?(h[v]={array:g.data.array,stride:g.data.stride,offset:g.offset},s=g.data.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer)):(h[v]={array:g.array},s=g.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer))}var m=void 0,y=c.getIndex();y&&(y instanceof f.InterleavedBufferAttribute?(m={array:y.data.array,stride:y.data.stride,offset:y.offset},s=y.data.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer)):(m={array:y.array},s=y.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer)));var b={type:d,attributes:h,indices:m,maxItemPerNode:e,maxTreeDepth:r,extents:A};a.push(b)}}}return zd.postMessage(a,Array.from(o))}).then(function(a){for(var o=0;o<i.length;o++){var s=i[o],u=s.geometry,l=a[o];if(u instanceof f.BufferGeometry){for(var c in l.attributes){var d=l.attributes[c].array,p=u.attributes[c];p instanceof f.InterleavedBufferAttribute?p.data.array=d:p.array=d}var A=u.getIndex();if(A&&l.indices){var d=l.indices.array;A instanceof f.InterleavedBufferAttribute?A.data.array=d:A.array=d}if(s instanceof f.Mesh){var h=new Ou(l.attributes.position,l.indices);h.offsetArray=l.offsetArray,h.rootNodePacked=l.rootNodePacked,Xd(s,h)}else if(s instanceof f.Points){var h=new Du(l.attributes.position,l.indices);h.offsetArray=l.offsetArray,h.rootNodePacked=l.rootNodePacked,$d(s,h)}}}return n})}var qu=function(n){ue(t,n);function t(e,r,i){i===void 0&&(i=Q);var a=n.call(this)||this;return a.contentObject=r,a.name=e,a.materials=[],a.pbmObjects=[],a.disposers=[i],a.add(r),r.traverse(function(o){var s;if(o instanceof f.Mesh||o instanceof f.Points){var u=o.material;Array.isArray(u)?(s=a.materials).push.apply(s,u):a.materials.push(u)}(o instanceof Ot||o instanceof yr)&&a.pbmObjects.push(o)}),a}return t.prototype.generateBvhTree=function(){return eh(this,!0,200,10)},t.prototype.intersectRaycaster=function(e,r,i){r===void 0&&(r=!0),i===void 0&&(i=[]);for(var a=this.children.slice(),o,s=[];o=a.pop();)if(o.visible){o.raycast(e,s);for(var u=0,l=o.children.length;u<l;u++)a.push(o.children[u])}return s.forEach(function(c){var d=0;if((c.object instanceof Ot||c.object instanceof yr)&&c.face){var p=Array.isArray(c.object.material)?c.object.material[c.face.materialIndex]:c.object.material;p&&(d=p.floor)}c.floor=d}),r&&s.sort(function(c,d){return c.distance-d.distance}),i.push.apply(i,s),i},t.prototype.update=function(e,r,i,a){for(var o=0,s=this.pbmObjects;o<s.length;o++){var u=s[o];u.update(e,r,i,a)}},t.prototype.dispose=function(){for(var e=0,r=this.disposers;e<r.length;e++){var i=r[e];i()}this.disposers.length=0,this.pbmObjects.length=0},t.prototype.clone=function(){return new t(this.name,this.contentObject.clone())},t}(f.Object3D);function st(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=[];n=n.map(function(s){return(s!=null?s:"").trim()}).filter(function(s){return s.length>0&&!/^\/+$/.test(s)});for(var r=0;r<n.length;r++){var i=r===0,a=r===n.length-1,o=n[r];i||(o=o.replace(/^\.\//,"").replace(/^\/+/,"")),a||(o=o.replace(/\/+$/,"")),e.push(o)}return e.join("/")}function Xi(n){var t,e=/^(http\:|https\:|file\:)?\/\/[^/]/.exec(n);if(!e)return n;var r=e[1]||"",i=n.slice(r.length+2),a=i.indexOf("#");a>=0&&(n.slice(a),i=n.slice(0,a));var o=i.indexOf("?");o>=0&&(n.slice(o),i=n.slice(0,o));for(var s=i.split("/"),u=s.shift(),l=(t=s.pop())!==null&&t!==void 0?t:"",c=[],d=0,p=s;d<p.length;d++){var A=p[d];if(!(A===""||A===".")){if(A===".."){c.pop();continue}c.push(A)}}return r+"//"+u+"/"+c.join("/")+"/"+l}function Gr(n){return n.indexOf("//")===0||/^[0-9a-z]+\:/i.test(n)}function Hu(n,t,e){var r;if(n.content){var i=(r=n.content.uri)!==null&&r!==void 0?r:n.content.url;typeof i=="string"&&!Gr(i)&&(n.content.uri=Xi(st(t,i)))}if(n.transform){for(var a=!1,o=0;o<16;o++){var s=n.transform[o];if(typeof s!="number"||isNaN(s)||!isFinite(s)){a=!0;break}}if(n.transform[15]===0&&(a=!0),a)throw new Error("Invalid Tile Transform: "+JSON.stringify(n.transform))}if(n.children)for(var u=0,l=n.children;u<l.length;u++){var c=l[u];Hu(c,t)}return n}function Wi(n,t){if(n.asset||(n.asset={}),n.rootMeta||(n.rootMeta={}),n.rootMeta.taskParameters||(n.rootMeta.taskParameters={}),n.asset.overview){var e=n.asset.overview;Gr(e.imageFile)||(e.imageFile=Xi(st(t,e.imageFile))),Gr(e.worldFile)||(e.worldFile=Xi(st(t,e.worldFile)))}if(n.asset.trajectories)for(var r=0;r<n.asset.trajectories.list.length;r++){var i=n.asset.trajectories.list[r];i.file=Xi(st(t,i.file))}return Hu(n.root,t),n}function th(n,t,e){for(var r,i,a=Promise.resolve(),o=n.slice(),s=function(){for(var u=[],l=0,c=void 0;c=o.shift();){u.push(c);var d=((r=c.image)===null||r===void 0?void 0:r.width)*((i=c.image)===null||i===void 0?void 0:i.height);if(!isNaN(d)&&isFinite(d)&&(l+=d),l>=e)break}a=a.then(function(){return new Promise(function(p){Mt.shared.add(function(){for(var A=0,h=u;A<h.length;A++){var v=h[A];t.initTexture(v)}p()},!0)})}).catch(function(){})};o.length>0;)s();return a}function ga(n,t){if(t===void 0&&(t=""),(t[0]==="?"||t[0]==="&")&&(t=t.slice(1)),!t)return n;var e=n.indexOf("#"),r="";return e>=0&&(r=n.slice(e),n=n.slice(0,e)),(n[n.length-1]==="?"||n[n.length-1]==="&")&&(n=n.slice(0,-1)),n.indexOf("?")>=0?"".concat(n,"&").concat(t).concat(r):"".concat(n,"?").concat(t).concat(r)}var Qa=4;function Gu(n,t,e){var r=new DataView(t);if(n.magic=r.getUint32(e,!0),e+=Qa,n.version=r.getUint32(e,!0),e+=Qa,n.byteLength=r.getUint32(e,!0),e+=Qa,n.version!==1)throw new Error("3D Tile Version ".concat(n.version," not supported"));return e}var Cr,at;(function(n){n[n.BYTE=5120]="BYTE",n[n.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",n[n.SHORT=5122]="SHORT",n[n.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",n[n.INT=5124]="INT",n[n.UNSIGNED_INT=5125]="UNSIGNED_INT",n[n.FLOAT=5126]="FLOAT",n[n.DOUBLE=5130]="DOUBLE"})(at||(at={}));var rh=(Cr={},Cr[at.DOUBLE]=Float64Array,Cr[at.FLOAT]=Float32Array,Cr[at.UNSIGNED_SHORT]=Uint16Array,Cr[at.UNSIGNED_INT]=Uint32Array,Cr[at.UNSIGNED_BYTE]=Uint8Array,Cr[at.BYTE]=Int8Array,Cr[at.SHORT]=Int16Array,Cr[at.INT]=Int32Array,Cr),nh={DOUBLE:at.DOUBLE,FLOAT:at.FLOAT,UNSIGNED_SHORT:at.UNSIGNED_SHORT,UNSIGNED_INT:at.UNSIGNED_INT,UNSIGNED_BYTE:at.UNSIGNED_BYTE,BYTE:at.BYTE,SHORT:at.SHORT,INT:at.INT};function ia(n){var t=rh[n];if(!t)throw new Error("Failed to convert GL type");return t}function Ua(n){var t=ia(n);return t.BYTES_PER_ELEMENT}function Ws(n,t,e,r){e===void 0&&(e=0);var i=ia(n);if(e%Ua(n)!==0){var a=r?t.slice(e,e+r*Ua(n)):t.slice(e);return new i(a)}else return new i(t,e,r!=null?r:(t.byteLength-e)/Ua(n))}function ih(n){var t=nh[n];if(!t)throw new Error("Failed to convert GL type");return t}var Ku=function(){function n(t,e){this.featuresLength=0,this.cachedTypedArrays={},this.json=t,this.buffer=e;var r=this.getGlobalProperty("POINTS_LENGTH",at.UNSIGNED_INT,1);r&&r.length&&(this.featuresLength=r[0])}return n.prototype.getExtension=function(t){return this.json.extensions&&this.json.extensions[t]},n.prototype.hasProperty=function(t){return!!this.json[t]},n.prototype.getGlobalProperty=function(t,e,r){var i=this.json[t];if(typeof i=="number"){var a=ia(e);return new a([i])}else if(Array.isArray(i)){var a=ia(e);return new a(i)}else if(i&&Number.isFinite(i.byteOffset))return this.getTypedArrayFromBinary(t,e,r,1,i.byteOffset);return null},n.prototype.getPropertyArray=function(t,e,r){var i=this.json[t];return i&&Number.isFinite(i.byteOffset)?("componentType"in i&&(e=ih(i.componentType)),this.getTypedArrayFromBinary(t,e,r,this.featuresLength,i.byteOffset)):this.getTypedArrayFromArray(t,e,i)},n.prototype.getProperty=function(t,e,r,i,a){var o=this.json[t];if(!o)return null;var s=this.getPropertyArray(t,e,r);if(r===1)return a[0]=s[i],a;for(var u=0;u<r;++u)a[u]=s[r*i+u];return a},n.prototype.getTypedArrayFromBinary=function(t,e,r,i,a){var o=this.cachedTypedArrays,s=o[t];return s||(s=Ws(e,this.buffer.buffer,this.buffer.byteOffset+a,i*r),o[t]=s),s},n.prototype.getTypedArrayFromArray=function(t,e,r){var i=this.cachedTypedArrays,a=i[t];return a||(a=Ws(e,r),i[t]=a),a},n}(),On=4,Zs="b3dm tile in legacy format.";function _u(n,t,e){var r=new TextDecoder("utf8"),i=new Uint8Array(n,t,e),a=r.decode(i);return a}function ju(n,t,e){return e=ah(n,t,e),e=oh(n,t,e),e=sh(n,t,e),e}function ah(n,t,e){var r=new DataView(t),i=0;n.header=n.header||{};var a=r.getUint32(e,!0);e+=On;var o=r.getUint32(e,!0);e+=On;var s=r.getUint32(e,!0);e+=On;var u=r.getUint32(e,!0);return e+=On,s>=570425344?(e-=On*2,i=a,s=o,u=0,a=0,o=0,console.warn(Zs)):u>=570425344&&(e-=On,i=s,s=a,u=o,a=0,o=0,console.warn(Zs)),n.header.featureTableJsonByteLength=a,n.header.featureTableBinaryByteLength=o,n.header.batchTableJsonByteLength=s,n.header.batchTableBinaryByteLength=u,n.header.batchLength=i,e}function oh(n,t,e){var r=n.header||{},i=r.featureTableJsonByteLength,a=r.featureTableBinaryByteLength,o=r.batchLength;if(n.featureTableJson={BATCH_LENGTH:o||0},i&&i>0){var s=_u(t,e,i);n.featureTableJson=JSON.parse(s)}e+=i||0,n.featureTableBinary=new Uint8Array(t,e,a),e+=a||0,n.rtcCenter=[0,0,0];var u=new Ku(n.featureTableJson,n.featureTableBinary);if(Array.isArray(u.json.RTC_CENTER)){var l=u.json.RTC_CENTER;n.rtcCenter[0]=l[0],n.rtcCenter[1]=l[1],n.rtcCenter[2]=l[2]}else{var l=u.getGlobalProperty("RTC_CENTER",at.FLOAT,3);l&&(n.rtcCenter[0]=l[0],n.rtcCenter[1]=l[1],n.rtcCenter[2]=l[2])}return e}function sh(n,t,e){var r=n.header||{},i=r.batchTableJsonByteLength,a=r.batchTableBinaryByteLength;if(i&&i>0){var o=_u(t,e,i);n.batchTableJson=JSON.parse(o),e+=i,a&&a>0&&(n.batchTableBinary=new Uint8Array(t,e,a),n.batchTableBinary=new Uint8Array(n.batchTableBinary),e+=a)}return e}function uh(n,t,e){var r=e!==void 0?new Uint8Array(n).subarray(t,t+e):new Uint8Array(n).subarray(t),i=new Uint8Array(r);return i.buffer}function lh(n,t,e){var r=n.byteLength-e;if(r===0)throw new Error("glTF byte length must be greater than 0.");return e%4!==0&&console.warn("".concat(n.type,": embedded glb is not aligned to a 4-byte boundary.")),n.gltfArrayBuffer=uh(t,e,r),n.byteLength}function aa(n){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(n);for(var t="",e=0,r=n.length;e<r;e++)t+=String.fromCharCode(n[e]);try{return decodeURIComponent(escape(t))}catch(i){return t}}var Ue={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},ri={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},oa={9728:f.NearestFilter,9729:f.LinearFilter,9984:f.NearestMipmapNearestFilter,9985:f.LinearMipmapNearestFilter,9986:f.NearestMipmapLinearFilter,9987:f.LinearMipmapLinearFilter},sa={33071:f.ClampToEdgeWrapping,33648:f.MirroredRepeatWrapping,10497:f.RepeatWrapping},Ys={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},_t={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},rn={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},ch={CUBICSPLINE:void 0,LINEAR:f.InterpolateLinear,STEP:f.InterpolateDiscrete},Dr={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function Bt(n){var t=[];for(var e in n)t.push(n[e]);return t}function fh(n){var t=Array.from(n);return function(){for(var e=0,r=t;e<r.length;e++){var i=r[e];typeof i.dispose=="function"&&i.dispose(),typeof i.close=="function"&&i.close()}}}var dh=function(){function n(t,e,r){this.json=t,this.extensions=e,this.options=r,this.cache=new Map,this.disposeSet=new Set,this.textureSet=new Set,this.nodeNamesUsed={}}return n.prototype.dispose=function(){this.cache.clear(),this.disposeSet.forEach(function(t){typeof t.dispose=="function"&&t.dispose(),typeof t.close=="function"&&t.close()}),this.disposeSet.clear(),this.textureSet.clear(),this.extensions={},this.json={asset:{version:"unknown"}}},n.prototype.markDefs=function(){for(var t=this.json.nodes||[],e=this.json.skins||[],r=this.json.meshes||[],i=0,a=e.length;i<a;i++)for(var o=e[i].joints,s=0,u=o.length;s<u;s++)t[o[s]].isBone=!0;for(var l=0,c=t.length;l<c;l++){var d=t[l];d.mesh!==void 0&&d.skin!==void 0&&(r[d.mesh].isSkinnedMesh=!0)}},n.prototype.parse=function(){var t=this,e=this.json,r=this.extensions;this.markDefs();for(var i=0,a=Bt(r);i<a.length;i++){var o=a[i];o.markDefs(this)}return Promise.all(Bt(r).map(function(s){return s.prepare(t)})).then(function(){var s,u,l;return Promise.all([Promise.all(((s=e.scenes)!==null&&s!==void 0?s:[]).map(function(c,d){return t.loadScene(d)})),Promise.all(((u=e.animations)!==null&&u!==void 0?u:[]).map(function(c,d){return t.loadAnimation(d)})),Promise.all(((l=e.cameras)!==null&&l!==void 0?l:[]).map(function(c,d){return t.loadCamera(d)}))])}).then(function(s){var u=s[0],l=s[1],c=s[2],d={json:e,scene:u[e.scene||0],scenes:u,animations:l,cameras:c,textures:[],dispose:Q};return d}).then(function(s){return Promise.all(Bt(r).map(function(u){return u.emitResult(s,t)})).then(function(){return s})}).then(function(s){var u=Array.from(t.textureSet),l=fh(t.disposeSet);return Object.assign(s,{textures:u,dispose:l}),t.textureSet.clear(),t.disposeSet.clear(),t.dispose(),s})},n.prototype.loadCamera=function(t){var e="camera:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=Bt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadCamera(t,this),i)break}if(!i){var u=void 0,l=this.json.cameras[t],c=l[l.type];c?l.type==="perspective"?u=new f.PerspectiveCamera(f.MathUtils.radToDeg(c.yfov),c.aspectRatio||1,c.znear||1,c.zfar||2e6):l.type==="orthographic"?u=new f.OrthographicCamera(-c.xmag,c.xmag,c.ymag,-c.ymag,c.znear,c.zfar):(console.warn("glTF: Invalid camera type ".concat(l.type,".")),u=new f.Camera):(console.warn("glTF: Missing camera parameters."),u=new f.Camera),l.name&&(u.name=this.createUniqueName(l.name)),i=Promise.resolve(u)}return this.cache.set(e,i),i},n.prototype.loadSkin=function(t){var e="animation:"+t,r=this.cache.get(e);if(r)return r;var i,a=this.json.skins[t],o={joints:a.joints};return a.inverseBindMatrices===void 0?i=Promise.resolve(o):i=this.loadAccessor(a.inverseBindMatrices).then(function(s){return s&&(o.inverseBindMatrices=s),o}),this.cache.set(e,i),i},n.prototype.loadAnimation=function(t){var e="animation:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=Bt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadAnimation(t,this),i)break}if(!i){for(var u=this.json,l=u.animations[t],c=[],d=[],p=[],A=[],h=[],v=0,g=l.channels.length;v<g;v++){var m=l.channels[v],y=l.samplers[m.sampler],b=m.target,x=b.node!==void 0?b.node:b.id,w=l.parameters!==void 0?l.parameters[y.input]:y.input,M=l.parameters!==void 0?l.parameters[y.output]:y.output;c.push(this.loadNode(x)),d.push(this.loadAccessor(w)),p.push(this.loadAccessor(M)),A.push(y),h.push(b)}i=Promise.all([Promise.all(c),Promise.all(d),Promise.all(p),Promise.all(A),Promise.all(h)]).then(function(S){for(var E=S[0],B=S[1],R=S[2],C=S[3],I=S[4],L=[],T=function(z,U){var q=E[z],G=B[z],K=R[z],j=C[z],J=I[z];if(q===void 0)return"continue";q.updateMatrix(),q.matrixAutoUpdate=!0;var W=void 0;switch(rn[J.path]){case rn.weights:W=f.NumberKeyframeTrack;break;case rn.rotation:W=f.QuaternionKeyframeTrack;break;case rn.position:case rn.scale:default:W=f.VectorKeyframeTrack;break}var $=q.name?q.name:q.uuid,Y=j.interpolation!==void 0?ch[j.interpolation]:f.InterpolateLinear,Z=[];rn[J.path]===rn.weights?q.traverse(function(xe){xe.morphTargetInfluences&&Z.push(xe.name?xe.name:xe.uuid)}):Z.push($);var oe=K.array;if(K.normalized){for(var ne=qa(oe.constructor),de=new Float32Array(oe.length),se=0,ye=oe.length;se<ye;se++)de[se]=oe[se]*ne;oe=de}for(var se=0,ye=Z.length;se<ye;se++){var ie=new W(Z[se]+"."+rn[J.path],G.array,oe,Y);L.push(ie)}},F=0,D=E.length;F<D;F++)T(F);var V=l.name?l.name:"animation_"+t;return new f.AnimationClip(V,void 0,L)})}return this.cache.set(e,i),i},n.prototype.loadBuffer=function(t){var e=this.json.buffers[t];if(e.type&&e.type!=="arraybuffer")throw new Error("glTF: "+e.type+" buffer type is not supported.");var r="buffer:"+t,i=this.cache.get(r);if(i)return i;for(var a=null,o=0,s=Bt(this.extensions);o<s.length;o++){var u=s[o];if(a=u.loadBuffer(t,this),a)break}if(!a){var l=this.json.buffers[t];a=this.options.fetcher.ajax(this.resolveResouce(l.uri),{responseType:"arraybuffer"}).then(function(c){return c.body})}return this.cache.set(r,a),a},n.prototype.loadBufferView=function(t){var e="bufferView:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=Bt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadBufferView(t,this),i)break}if(!i){var u=this.json.bufferViews[t];i=this.loadBuffer(u.buffer).then(function(l){var c=u.byteLength||0,d=u.byteOffset||0;return l.slice(d,d+c)})}return this.cache.set(e,i),i},n.prototype.loadAccessor=function(t){var e=this,r="accessor:"+t,i=this.cache.get(r);if(i)return i;var a=null;if(!a){var o=this.json.accessors[t];if(o.bufferView===void 0&&o.sparse===void 0)a=Promise.resolve(null);else{var s=[];o.bufferView!==void 0?s.push(this.loadBufferView(o.bufferView)):s.push(Promise.resolve(null)),o.sparse!==void 0&&(s.push(this.loadBufferView(o.sparse.indices.bufferView)),s.push(this.loadBufferView(o.sparse.values.bufferView))),a=Promise.all(s).then(function(u){var l=u[0],c=Ys[o.type],d=ri[o.componentType],p=d.BYTES_PER_ELEMENT,A=p*c,h=o.byteOffset||0,v=o.bufferView!==void 0?e.json.bufferViews[o.bufferView].byteStride:void 0,g=o.normalized===!0,m,y;if(v&&v!==A){var b=Math.floor(h/v),x="InterleavedBuffer:"+o.bufferView+":"+o.componentType+":"+b+":"+o.count,w=e.cache.get(x);w||(m=new d(l,b*v,o.count*v/p),w=new f.InterleavedBuffer(m,v/p),e.cache.set(x,w)),y=new f.InterleavedBufferAttribute(w,c,h%v/p,g)}else l===null?m=new d(o.count*c):m=new d(l,h,o.count*c),y=new f.BufferAttribute(m,c,g);if(o.sparse!==void 0){var M=Ys.SCALAR,S=ri[o.sparse.indices.componentType],E=o.sparse.indices.byteOffset||0,B=o.sparse.values.byteOffset||0,R=new S(u[1],E,o.sparse.count*M),C=new d(u[2],B,o.sparse.count*c);l!==null&&(y=new f.BufferAttribute(y.array.slice(),y.itemSize,y.normalized));for(var I=0,L=R.length;I<L;I++){var T=R[I];if(y.setX(T,C[I*c]),c>=2&&y.setY(T,C[I*c+1]),c>=3&&y.setZ(T,C[I*c+2]),c>=4&&y.setW(T,C[I*c+3]),c>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return y})}}return this.cache.set(r,a),a},n.prototype.createPrimitiveKey=function(t){for(var e=0,r=Bt(this.extensions);e<r.length;e++){var i=r[e],a=i.createPrimitiveKey(t,this);if(a)return a}for(var o="",s=Object.keys(t.attributes).sort(),u=0,l=s.length;u<l;u++)o+=s[u]+":"+t.attributes[s[u]]+";";return t.indices+":"+o+":"+t.mode},n.prototype.loadGeometry=function(t){for(var e=this,r=null,i=0,a=Bt(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadGeometry(t,this),r)break}return r||(r=this.addGeometryPrimitiveAttributes(new f.BufferGeometry,t)),r=r.then(function(s){return e.disposeSet.add(s),s}),r},n.prototype.loadImage=function(t){for(var e=this,r=null,i=0,a=Bt(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadImage(t,this),r)break}if(!r){var s=this.json.images[t];if(s.bufferView!==void 0){var u=this.json.bufferViews[s.bufferView];r=this.loadBuffer(u.buffer).then(function(c){var d=u.byteOffset||0,p=u.byteLength||0,A=new Uint8Array(c,d,p),h=new Blob([A],{type:s.mimeType});return Mo(h)})}else if(s.uri){var l=this.resolveResouce(s.uri);r=this.options.fetcher.loadImage(l,{},void 0,void 0,void 0,Ai()).then(function(c){return c.body})}else throw new Error("glTF: Invalid image defs.")}return r=r.then(function(c){return e.disposeSet.add(c),c}),r},n.prototype.loadMaterialAsMeshStandardMaterial=function(t){var e=this,r=[],i=new f.MeshStandardMaterial;if(i.color=new f.Color(1,1,1),i.opacity=1,Object.keys(t.attributes).filter(function(c){return _t[c]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(c){return _t[c]==="normal"}).length===0&&(i.flatShading=!0),Object.keys(t.attributes).filter(function(c){return _t[c]==="tangent"}).length===0&&(i.normalScale&&(i.normalScale.y*=-1),i.clearcoatNormalScale&&(i.clearcoatNormalScale.y*=-1)),t.material!==void 0){var a=this.json.materials[t.material];a.name&&(i.name=a.name);var o=a.pbrMetallicRoughness||{};if(Array.isArray(o.baseColorFactor)){var s=o.baseColorFactor;i.color.fromArray(s),i.opacity=s[3]}o.baseColorTexture!==void 0&&r.push(this.createMaterialTexture(o.baseColorTexture).then(function(c){c.encoding=f.sRGBEncoding,i.map=c,e.disposeSet.add(c)})),i.metalness=o.metallicFactor!==void 0?o.metallicFactor:1,i.roughness=o.roughnessFactor!==void 0?o.roughnessFactor:1,o.metallicRoughnessTexture!==void 0&&r.push(this.createMaterialTexture(o.metallicRoughnessTexture).then(function(c){c.encoding=f.sRGBEncoding,i.metalnessMap=c,i.roughnessMap=c,e.disposeSet.add(c)})),a.doubleSided===!0&&(i.side=f.DoubleSide);var u=a.alphaMode||Dr.OPAQUE;if(u===Dr.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,u===Dr.MASK&&(i.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5)),a.normalTexture!==void 0&&(r.push(this.createMaterialTexture(a.normalTexture).then(function(c){i.normalMap=c,e.disposeSet.add(c)})),i.normalScale=new f.Vector2(1,1),a.normalTexture.scale!==void 0)){var l=a.normalTexture.scale;i.normalScale.set(l,l)}a.occlusionTexture!==void 0&&(r.push(this.createMaterialTexture(a.occlusionTexture).then(function(c){i.aoMap=c,e.disposeSet.add(c)})),a.occlusionTexture.strength!==void 0&&(i.aoMapIntensity=a.occlusionTexture.strength)),a.emissiveFactor!==void 0&&(i.emissive=new f.Color().fromArray(a.emissiveFactor)),a.emissiveTexture!==void 0&&r.push(this.createMaterialTexture(a.emissiveTexture).then(function(c){i.emissiveMap=c,e.disposeSet.add(c)}))}return this.disposeSet.add(i),Promise.all(r).then(function(){return i})},n.prototype.loadMaterialAsLineBasicMaterial=function(t){var e=[],r=new f.LineBasicMaterial;if(r.color=new f.Color(1,1,1),r.opacity=1,Object.keys(t.attributes).filter(function(u){return _t[u]==="color"}).length>0&&(r.vertexColors=!0),Object.keys(t.attributes).filter(function(u){return _t[u]==="tangent"}).length===0&&(r.normalScale&&(r.normalScale.y*=-1),r.clearcoatNormalScale&&(r.clearcoatNormalScale.y*=-1)),t.material!==void 0){var i=this.json.materials[t.material];i.name&&(r.name=i.name);var a=i.pbrMetallicRoughness||{};if(Array.isArray(a.baseColorFactor)){var o=a.baseColorFactor;r.color.fromArray(o),r.opacity=o[3]}i.doubleSided===!0&&(r.side=f.DoubleSide);var s=i.alphaMode||Dr.OPAQUE;s===Dr.BLEND?(r.transparent=!0,r.depthWrite=!1):(r.transparent=!1,s===Dr.MASK&&(r.alphaTest=i.alphaCutoff!==void 0?i.alphaCutoff:.5))}return this.disposeSet.add(r),Promise.all(e).then(function(){return r})},n.prototype.loadMaterialAsPointsMaterial=function(t){var e=this,r=[],i=new f.PointsMaterial;if(i.color=new f.Color(1,1,1),i.opacity=1,i.sizeAttenuation=!1,Object.keys(t.attributes).filter(function(l){return _t[l]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(l){return _t[l]==="tangent"}).length===0&&(i.normalScale&&(i.normalScale.y*=-1),i.clearcoatNormalScale&&(i.clearcoatNormalScale.y*=-1)),t.material!==void 0){var a=this.json.materials[t.material];a.name&&(i.name=a.name);var o=a.pbrMetallicRoughness||{};if(Array.isArray(o.baseColorFactor)){var s=o.baseColorFactor;i.color.fromArray(s),i.opacity=s[3]}o.baseColorTexture!==void 0&&r.push(this.createMaterialTexture(o.baseColorTexture).then(function(l){l.encoding=f.sRGBEncoding,i.map=l,e.disposeSet.add(l)})),a.doubleSided===!0&&(i.side=f.DoubleSide);var u=a.alphaMode||Dr.OPAQUE;u===Dr.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,u===Dr.MASK&&(i.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5))}return this.disposeSet.add(i),Promise.all(r).then(function(){return i})},n.prototype.loadMaterial=function(t){var e,r=(e=t.mode)!==null&&e!==void 0?e:Ue.TRIANGLES,i="material:"+this.createPrimitiveKey(t),a=this.cache.get(i);if(a)return a;for(var o=null,s=0,u=Bt(this.extensions);s<u.length;s++){var l=u[s];if(o=l.loadMaterial(t,this),o)break}if(r===Ue.TRIANGLES||r===Ue.TRIANGLE_STRIP||r===Ue.TRIANGLE_FAN)o=this.loadMaterialAsMeshStandardMaterial(t);else if(r===Ue.LINES||r===Ue.LINE_STRIP||r===Ue.LINE_LOOP)o=this.loadMaterialAsLineBasicMaterial(t);else if(r===Ue.POINTS)o=this.loadMaterialAsPointsMaterial(t);else throw new Error("glTF: Primitive mode unsupported: "+r);return this.cache.set(i,o),o},n.prototype.loadTexture=function(t){var e=this,r="texture:"+t,i=this.cache.get(r);if(i)return i;for(var a=null,o=0,s=Bt(this.extensions);o<s.length;o++){var u=s[o];if(a=u.loadTexture(t,this),a)break}if(!a){var l=this.json.textures[t];a=this.loadImage(l.source).then(function(c){var d=new f.Texture(c);d.needsUpdate=!0,d.flipY=!1,l.name&&(d.name=l.name);var p=e.json.samplers||{},A=p[l.sampler]||{};return d.magFilter=oa[A.magFilter]||f.LinearFilter,d.minFilter=oa[A.minFilter]||f.LinearMipmapLinearFilter,d.wrapS=sa[A.wrapS]||f.RepeatWrapping,d.wrapT=sa[A.wrapT]||f.RepeatWrapping,d.onUpdate=function(){c.close()},d})}return a=a.then(function(c){return e.disposeSet.add(c),c}),this.cache.set(r,a),a},n.prototype.loadMesh=function(t){for(var e=this,r=null,i=0,a=Bt(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadMesh(t,this),r)break}if(!r){var s=this.json.meshes[t],u=s.primitives,l=Promise.all(u.map(function(d){return e.loadGeometry(d)})),c=Promise.all(u.map(function(d){return e.loadMaterial(d)}));r=Promise.all([l,c]).then(function(d){for(var p=d[0],A=d[1],h=[],v=0;v<u.length;v++){var g=u[v],m=p[v],y=A[v],b=g.mode||Ue.TRIANGLES,x=void 0;if(b===Ue.TRIANGLES||b===Ue.TRIANGLE_STRIP||b===Ue.TRIANGLE_FAN)if(b===Ue.TRIANGLE_STRIP?m=e.toGeometryTrianglesDrawMode(m,f.TriangleStripDrawMode):b===Ue.TRIANGLE_FAN&&(m=e.toGeometryTrianglesDrawMode(m,f.TriangleFanDrawMode)),e.disposeSet.add(m),s.isSkinnedMesh){var w=new f.SkinnedMesh(m,y);m.attributes.skinWeight.normalized||w.normalizeSkinWeights(),x=w}else x=new f.Mesh(m,y);else if(b===Ue.POINTS)x=new f.Points(m,y);else if(b===Ue.LINES)x=new f.LineSegments(m,y);else if(b===Ue.LINE_STRIP)x=new f.Line(m,y);else if(b===Ue.LINE_LOOP)x=new f.LineLoop(m,y);else throw new Error("glTF: Primitive mode unsupported: "+b);if(Object.keys(m.morphAttributes).length>0){if(s.weights!==void 0)for(var M=0,S=s.weights.length;M<S;M++)x.morphTargetInfluences[M]=s.weights[M];if(s.extras&&Array.isArray(s.extras.targetNames)){var E=s.extras.targetNames;if(x.morphTargetInfluences.length===E.length){x.morphTargetDictionary={};for(var M=0,S=E.length;M<S;M++)x.morphTargetDictionary[E[M]]=M}else console.warn("glTF: Invalid extras.targetNames length. Ignoring names.")}}x.name=e.createUniqueName(s.name||"mesh_"+t),h.push(x)}if(h.length===1)return h[0];for(var B=new f.Group,R=0,C=h;R<C.length;R++){var x=C[R];B.add(x)}return B})}return r},n.prototype.loadNodeAttachments=function(t){for(var e=[],r=0,i=Bt(this.extensions);r<i.length;r++){var a=i[r],o=a.loadNodeAttachments(t,this);o&&e.push(o)}return e},n.prototype.loadNode=function(t){var e="node:"+t,r=this.cache.get(e);if(r)return r;var i=this.json,a=i.nodes[t],o=a.name?this.createUniqueName(a.name):"",s=[];a.mesh!==void 0&&s.push(this.loadMesh(a.mesh).then(function(p){if(a.weights!==void 0){var A=a.weights;p.traverse(function(h){if(h instanceof f.Mesh||h instanceof f.Line||h instanceof f.Points)for(var v=0,g=A.length;v<g;v++)h.morphTargetInfluences[v]=A[v]})}return p})),a.camera!==void 0&&s.push(this.loadCamera(a.camera));for(var u=this.loadNodeAttachments(t),l=0,c=u;l<c.length;l++){var d=c[l];s.push(d)}return Promise.all(s).then(function(p){var A;if(a.isBone===!0?A=new f.Bone:p.length>1?A=new f.Group:p.length===1?A=p[0]:A=new f.Object3D,A!==p[0])for(var h=0,v=p.length;h<v;h++)A.add(p[h]);if(a.name&&(A.name=o),a.matrix!==void 0){var g=new f.Matrix4;g.fromArray(a.matrix),A.applyMatrix4(g)}else a.translation!==void 0&&A.position.fromArray(a.translation),a.rotation!==void 0&&A.quaternion.fromArray(a.rotation),a.scale!==void 0&&A.scale.fromArray(a.scale);return A})},n.prototype.loadScene=function(t){var e=this.json,r=e.scenes[t],i=new f.Group;r.name&&(i.name=this.createUniqueName(r.name));for(var a=r.nodes||[],o=[],s=0,u=a.length;s<u;s++)o.push(this.buildNodeHierarchy(a[s],i));return Promise.all(o).then(function(){return i})},n.prototype.createMaterialTexture=function(t){var e=this;return this.loadTexture(t.index).then(function(r){for(var i=0,a=Bt(e.extensions);i<a.length;i++){var o=a[i],s=o.extendTexture(r,t,e);s&&(r=s,e.disposeSet.add(r))}return e.textureSet.add(r),r})},n.prototype.addGeometryPrimitiveAttributes=function(t,e){var r=this,i=e.attributes,a=[],o=function(w){var M=_t[w]||w.toLowerCase();if(M in t.attributes)return"continue";a.push(s.loadAccessor(i[w]).then(function(S){S&&t.setAttribute(M,S)}))},s=this;for(var u in i)o(u);e.indices!==void 0&&!t.index&&a.push(this.loadAccessor(e.indices).then(function(w){w&&t.setIndex(w)}));var l=new f.Box3;if(i.POSITION!==void 0){var c=this.json.accessors[i.POSITION],d=c.min,p=c.max;if(d!==void 0&&p!==void 0){if(l.set(new f.Vector3(d[0],d[1],d[2]),new f.Vector3(p[0],p[1],p[2])),c.normalized){var A=qa(ri[c.componentType]);l.min.multiplyScalar(A),l.max.multiplyScalar(A)}}else console.warn("glTF: Missing min/max properties for accessor POSITION.")}var h=e.targets;if(h!==void 0){for(var v=new f.Vector3,g=new f.Vector3,m=0,y=h.length;m<y;m++){var b=h[m];if(b.POSITION!==void 0){var c=this.json.accessors[b.POSITION],d=c.min,p=c.max;if(d!==void 0&&p!==void 0){if(g.setX(Math.max(Math.abs(d[0]),Math.abs(p[0]))),g.setY(Math.max(Math.abs(d[1]),Math.abs(p[1]))),g.setZ(Math.max(Math.abs(d[2]),Math.abs(p[2]))),c.normalized){var A=qa(ri[c.componentType]);g.multiplyScalar(A)}v.max(g)}else console.warn("glTF: Missing min/max properties for accessor POSITION.")}}l.expandByVector(v)}t.boundingBox=l;var x=new f.Sphere;return l.getCenter(x.center),x.radius=l.min.distanceTo(l.max)/2,t.boundingSphere=x,Promise.all(a).then(function(){if(t.attributes.uv&&!t.attributes.uv2&&r.options.copyUV2&&t.setAttribute("uv2",t.attributes.uv),e.targets){for(var w=!1,M=!1,S=0,E=e.targets.length;S<E;S++){var B=e.targets[S];if(B.POSITION!==void 0&&(w=!0),B.NORMAL!==void 0&&(M=!0),w&&M)break}if(!w&&!M)return t;var R=[];t.morphTargetsRelative=!0;for(var C=function(I,L){var T=e.targets[I];w?R.push(r.loadAccessor(T.POSITION).then(function(F){F&&(t.morphAttributes.position[I]=F)})):t.morphAttributes.position[I]=t.attributes.position,M?R.push(r.loadAccessor(T.NORMAL).then(function(F){F&&(t.morphAttributes.normal[I]=F)})):t.morphAttributes.normal[I]=t.attributes.normal},S=0,E=e.targets.length;S<E;S++)C(S,E);return Promise.all(R).then(function(){return t})}else return t})},n.prototype.buildNodeHierarchy=function(t,e){var r=this,i=this.json.nodes[t];return this.loadNode(t).then(function(a){if(i.skin===void 0)return a;var o;return r.loadSkin(i.skin).then(function(s){o=s;for(var u=[],l=0,c=o.joints.length;l<c;l++)u.push(r.loadNode(o.joints[l]));return Promise.all(u)}).then(function(s){return a.traverse(function(u){if(u instanceof f.SkinnedMesh){for(var l=[],c=[],d=0,p=s.length;d<p;d++){var A=s[d];if(A instanceof f.Bone){l.push(A);var h=new f.Matrix4;o.inverseBindMatrices!==void 0&&h.fromArray(o.inverseBindMatrices.array,d*16),c.push(h)}else console.warn('glTF: Joint "%s" could not be found.',o.joints[d])}u.bind(new f.Skeleton(l,c),u.matrixWorld)}}),a})}).then(function(a){e.add(a);var o=[];if(i.children)for(var s=i.children,u=0,l=s.length;u<l;u++){var c=s[u];o.push(r.buildNodeHierarchy(c,a))}return Promise.all(o).then(function(){return a})})},n.prototype.createUniqueName=function(t){for(var e=f.PropertyBinding.sanitizeNodeName(t||""),r=e,i=1;this.nodeNamesUsed[r];++i)r=e+"_"+i;return this.nodeNamesUsed[r]=!0,r},n.prototype.resolveResouce=function(t){return st(this.options.resourcePath,ga(t,this.options.search))},n.prototype.toGeometryTrianglesDrawMode=function(t,e){var r=t.getIndex();if(r===null){var i=[],a=t.getAttribute("position");if(a!==void 0){for(var o=0;o<a.count;o++)i.push(o);t.setIndex(i),r=t.getIndex()}}if(r===null)return console.error("glTF: Undefined position attribute. Processing not possible."),t;var s=r.count-2,u=[];if(e===f.TriangleFanDrawMode)for(var o=1;o<=s;o++)u.push(r.getX(0)),u.push(r.getX(o)),u.push(r.getX(o+1));else for(var o=0;o<s;o++)o%2===0?(u.push(r.getX(o)),u.push(r.getX(o+1)),u.push(r.getX(o+2))):(u.push(r.getX(o+2)),u.push(r.getX(o+1)),u.push(r.getX(o)));u.length/3!==s&&console.error("glTF: Unable to generate correct amount of triangles.");var l=t.clone();return l.setIndex(u),this.disposeSet.add(l),l},n}();function qa(n){switch(n){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("glTF: Unsupported normalized accessor component type.")}}var Fr=function(){function n(){}return n.prototype.markDefs=function(t){},n.prototype.prepare=function(t){},n.prototype.emitResult=function(t,e){},n.prototype.createPrimitiveKey=function(t,e){},n.prototype.extendTexture=function(t,e,r){return null},n.prototype.loadBuffer=function(t,e){return null},n.prototype.loadBufferView=function(t,e){return null},n.prototype.loadImage=function(t,e){return null},n.prototype.loadTexture=function(t,e){return null},n.prototype.loadGeometry=function(t,e){return null},n.prototype.loadMaterial=function(t,e){return null},n.prototype.loadMesh=function(t,e){return null},n.prototype.loadNodeAttachments=function(t,e){return null},n.prototype.loadCamera=function(t,e){return null},n.prototype.loadAnimation=function(t,e){return null},n}(),hh=function(n){ue(t,n);function t(){var e=n.call(this)||this;return e.header={magic:"",version:0,length:0},e.content="",e.body=null,e}return t.getMagic=function(e){return aa(new Uint8Array(e.slice(0,4)))},t.prototype.loadGlbBinary=function(e){var r=new DataView(e,0,t.HEADER_LENGTH);if(this.header={magic:t.getMagic(e),version:r.getUint32(4,!0),length:r.getUint32(8,!0)},this.header.magic!==t.HEADER_MAGIC)throw new Error("glTF:KHR_binary_glTF: Unsupported.");if(this.header.version<2)throw new Error("glTF:KHR_binary_glTF: Legacy binary file detected.");for(var i=new DataView(e,t.HEADER_LENGTH),a=0,o=null,s=null;a<i.byteLength;){var u=i.getUint32(a,!0);if(a+=4,u!==0){var l=i.getUint32(a,!0);if(a+=4,l===t.CHUNK_TYPES.JSON){var c=new Uint8Array(e,t.HEADER_LENGTH+a,u);o=aa(c)}else if(l===t.CHUNK_TYPES.BIN){var d=t.HEADER_LENGTH+a;s=e.slice(d,d+u)}a+=u}}if(o===null)throw new Error("glTF:KHR_binary_glTF: JSON content not found.");this.content=o,this.body=s},t.prototype.loadBuffer=function(e,r){var i=r.json.buffers[e];return i.uri===void 0&&e===0&&this.body?Promise.resolve(this.body):null},t.prototype.clear=function(){this.body=null,this.content=""},t.HEADER_MAGIC="glTF",t.HEADER_LENGTH=12,t.CHUNK_TYPES={JSON:1313821514,BIN:5130562},t}(Fr),ph="https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/draco/1.5.6/",$s={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},e0={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"},vh=function(){function n(){this.decoderPath=ph,this.decoderConfig={},this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL=""}return n.prototype.setDecoderPath=function(t){this.decoderPath=t},n.prototype.setDecoderConfig=function(t){return this.decoderConfig=t,this},n.prototype.setWorkerLimit=function(t){return this.workerLimit=t,this},n.prototype.decodeDracoFile=function(t,e,r,i){var a={attributeIDs:r||$s,attributeTypes:i||e0,useUniqueIDs:!!r};this.decodeGeometry(t,a).then(e)},n.prototype.decodeGeometry=function(t,e){var r=this;e===void 0&&(e={attributeIDs:$s,attributeTypes:e0,useUniqueIDs:!1});for(var i in e.attributeTypes){var a=e.attributeTypes[i];a.BYTES_PER_ELEMENT!==void 0&&(e.attributeTypes[i]=a.name)}var o,s=this.workerNextTaskID++,u=t.byteLength,l=this._getWorker(s,u).then(function(c){return o=c,new Promise(function(d,p){o._callbacks[s]={resolve:d,reject:p},o.postMessage({type:"decode",id:s,taskConfig:e,buffer:t},[t])})}).then(function(c){return r._createGeometry(c.geometry)});return l.catch(function(){return!0}).then(function(){o&&s&&r._releaseTask(o,s)}),l},n.prototype._createGeometry=function(t){var e=new f.BufferGeometry;t.index&&e.setIndex(new f.BufferAttribute(t.index.array,1));for(var r=0;r<t.attributes.length;r++){var i=t.attributes[r],a=i.name,o=i.array,s=i.itemSize,u=!(o instanceof Float32Array||o instanceof Float64Array);e.setAttribute(a,new f.BufferAttribute(o,s,u))}return e},n.prototype._initDecoder=function(){var t=this;if(this.decoderPending)return this.decoderPending;var e=typeof WebAssembly!="object"||this.decoderConfig.type==="js";if(e){var r=qn(this.decoderPath+"draco_decoder.js",{responseType:"text"}).then(function(a){return a.body});this.decoderPending=r.then(function(a){var o=["/* draco decoder */",a,"","/* worker */",t0].join(`
|
|
418
418
|
`);t.workerSourceURL=URL.createObjectURL(new Blob([o]))})}else{var r=qn(this.decoderPath+"draco_wasm_wrapper.js",{responseType:"text"}).then(function(o){return o.body}),i=qn(this.decoderPath+"draco_decoder.wasm",{responseType:"arraybuffer"}).then(function(o){return o.body});this.decoderPending=Promise.all([r,i]).then(function(o){var s=o[0],u=o[1];t.decoderConfig.wasmBinary=u;var l=["/* draco decoder */",s,"","/* worker */",t0].join(`
|
|
419
419
|
`);t.workerSourceURL=URL.createObjectURL(new Blob([l]))})}return this.decoderPending},n.prototype._getWorker=function(t,e){var r=this;return this._initDecoder().then(function(){if(r.workerPool.length<r.workerLimit){var i=new Worker(r.workerSourceURL);i._callbacks={},i._taskCosts={},i._taskLoad=0,i.postMessage({type:"init",decoderConfig:r.decoderConfig}),i.onmessage=function(o){var s=o.data;switch(s.type){case"decode":i._callbacks[s.id].resolve(s);break;case"error":i._callbacks[s.id].reject(s);break;default:console.error('DRACO: Unexpected message, "'+s.type+'"')}},r.workerPool.push(i)}else r.workerPool.sort(function(o,s){return o._taskLoad>s._taskLoad?-1:1});var a=r.workerPool[r.workerPool.length-1];return a._taskCosts[t]=e,a._taskLoad+=e,a})},n.prototype._releaseTask=function(t,e){t._taskLoad-=t._taskCosts[e],delete t._callbacks[e],delete t._taskCosts[e]},n.prototype.dispose=function(){for(var t=0;t<this.workerPool.length;++t)this.workerPool[t].terminate();return this.workerPool.length=0,this},n}(),ua=new vh,t0=`
|
|
420
420
|
let decoderConfig;
|
|
@@ -611,7 +611,7 @@ void main() {
|
|
|
611
611
|
}
|
|
612
612
|
|
|
613
613
|
}
|
|
614
|
-
`,Ha="KHR_draco_mesh_compression",mh=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadGeometry=function(e,r){return e.extensions&&e.extensions[Ha]?this.decodePrimitive(e,r).then(function(i){return r.addGeometryPrimitiveAttributes(i,e)}):null},t.prototype.decodePrimitive=function(e,r){var i=r.json,a=e.extensions[Ha].bufferView,o=e.extensions[Ha].attributes,s={},u={},l={};for(var c in o){var d=
|
|
614
|
+
`,Ha="KHR_draco_mesh_compression",mh=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadGeometry=function(e,r){return e.extensions&&e.extensions[Ha]?this.decodePrimitive(e,r).then(function(i){return r.addGeometryPrimitiveAttributes(i,e)}):null},t.prototype.decodePrimitive=function(e,r){var i=r.json,a=e.extensions[Ha].bufferView,o=e.extensions[Ha].attributes,s={},u={},l={};for(var c in o){var d=_t[c]||c.toLowerCase();s[d]=o[c]}for(var c in e.attributes){var d=_t[c]||c.toLowerCase();if(o[c]!==void 0){var p=i.accessors[e.attributes[c]],A=ri[p.componentType];l[d]=A,u[d]=p.normalized===!0}}return r.loadBufferView(a).then(function(h){return new Promise(function(v){ua.decodeDracoFile(h,function(g){for(var m in g.attributes){var y=g.attributes[m],b=u[m];b!==void 0&&(y.normalized=b)}v(g)},s,l)})})},t}(Fr),Ah="https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/basis/1.16/",gh=2,yh=1,bh=function(){function n(t){this.pool=t,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0,this.workerCreator=null}return n.prototype._initWorker=function(t){if(this.workerCreator&&!this.workers[t]){var e=this.workerCreator();e.addEventListener("message",this._onMessage.bind(this,t)),this.workers[t]=e}},n.prototype._getIdleWorker=function(){for(var t=0;t<this.pool;t++)if(!(this.workerStatus&1<<t))return t;return-1},n.prototype._onMessage=function(t,e){var r=this.workersResolve[t];if(r&&r(e),this.queue.length){var i=this.queue.shift(),a=i.resolve,o=i.msg,s=i.transfer;this.workersResolve[t]=a,this.workers[t].postMessage(o,s)}else this.workerStatus^=1<<t},n.prototype.setWorkerCreator=function(t){this.workerCreator=t},n.prototype.setWorkerLimit=function(t){this.pool=t},n.prototype.postMessage=function(t,e){var r=this;return new Promise(function(i){var a=r._getIdleWorker();a!==-1?(r._initWorker(a),r.workerStatus|=1<<a,r.workersResolve[a]=i,r.workers[a].postMessage(t,e)):r.queue.push({resolve:i,msg:t,transfer:e})})},n.prototype.dispose=function(){this.workers.forEach(function(t){return t.terminate()}),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0},n}(),xh=function(){function n(){this.transcoderPath=Ah,this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new bh(4),this.workerSourceURL="",this.workerConfig=null}return n.prototype.setTranscoderPath=function(t){this.transcoderPath=t},n.prototype.detectSupport=function(t){if(!this.workerConfig){var e=console.warn;console.warn=function(){},this.workerConfig={astcSupported:!!t.extensions.get("WEBGL_compressed_texture_astc"),etc1Supported:!!t.extensions.get("WEBGL_compressed_texture_etc1"),etc2Supported:!!t.extensions.get("WEBGL_compressed_texture_etc"),dxtSupported:!!t.extensions.get("WEBGL_compressed_texture_s3tc"),bptcSupported:!!t.extensions.get("EXT_texture_compression_bptc"),pvrtcSupported:!!t.extensions.get("WEBGL_compressed_texture_pvrtc")||!!t.extensions.get("WEBKIT_WEBGL_compressed_texture_pvrtc")},console.warn=e}return this},n.prototype.init=function(){var t=this;if(!this.transcoderPending){var e=qn(this.transcoderPath+"basis_transcoder.js",{responseType:"text"}).then(function(i){return i.body}),r=qn(this.transcoderPath+"basis_transcoder.wasm",{responseType:"arraybuffer"}).then(function(i){return i.body});this.transcoderPending=Promise.all([e,r]).then(function(i){var a=i[0],o=i[1],s=["/* constants */","let _EngineFormat = "+JSON.stringify(Sh),"let _TranscoderFormat = "+JSON.stringify(Mh),"let _BasisFormat = "+JSON.stringify(wh),"/* basis_transcoder.js */",a,"/* worker */",Ch].join(`
|
|
615
615
|
`);t.workerSourceURL=URL.createObjectURL(new Blob([s])),t.transcoderBinary=o,t.workerPool.setWorkerCreator(function(){var u=new Worker(t.workerSourceURL),l=t.transcoderBinary.slice(0);return u.postMessage({type:"init",config:t.workerConfig,transcoderBinary:l},[l]),u})})}return this.transcoderPending},n.prototype.parse=function(t){return this._createTexture([t])},n.prototype._createTextureFrom=function(t){var e=t.mipmaps,r=t.width,i=t.height,a=t.format,o=t.type,s=t.error,u=t.dfdTransferFn,l=t.dfdFlags;if(o==="error")return Promise.reject(s);var c=new f.CompressedTexture(e,r,i,a,f.UnsignedByteType);return c.minFilter=e.length===1?f.LinearFilter:f.LinearMipmapLinearFilter,c.magFilter=f.LinearFilter,c.generateMipmaps=!1,c.needsUpdate=!0,c.encoding=u===gh?f.sRGBEncoding:f.LinearEncoding,c.premultiplyAlpha=!!(l&yh),Promise.resolve(c)},n.prototype._createTexture=function(t){var e=this,r=this.init().then(function(){return e.workerPool.postMessage({type:"transcode",buffers:t},t)}).then(function(i){return e._createTextureFrom(i.data)});return r},n.prototype.dispose=function(){return URL.revokeObjectURL(this.workerSourceURL),this.workerPool.dispose(),this},n}(),fi=new xh,wh={ETC1S:0,UASTC_4x4:1},Mh={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16},Sh={RGBAFormat:f.RGBAFormat,RGBA_ASTC_4x4_Format:f.RGBA_ASTC_4x4_Format,RGBA_BPTC_Format:f.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:f.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:f.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:f.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:f.RGB_ETC1_Format,RGB_ETC2_Format:f.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:f.RGB_PVRTC_4BPPV1_Format,RGB_S3TC_DXT1_Format:f.RGB_S3TC_DXT1_Format},Ch=`
|
|
616
616
|
|
|
617
617
|
let config;
|
|
@@ -880,7 +880,7 @@ void main() {
|
|
|
880
880
|
return ( value & ( value - 1 ) ) === 0 && value !== 0;
|
|
881
881
|
|
|
882
882
|
}
|
|
883
|
-
`,r0="KHR_texture_basisu",Eh=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadTexture=function(e,r){var i=r.json.textures[e];if(!i.extensions||!i.extensions[r0])return null;var a=i.extensions[r0],o=r.json.images[a.source],s=null;if(o.bufferView!==void 0)s=r.loadBufferView(o.bufferView).then(function(u){return fi.parse(u)});else if(o.uri)s=r.options.fetcher.ajax(r.resolveResouce(o.uri),{responseType:"arraybuffer"}).then(function(u){return fi.parse(u.body)});else throw new Error("glTF: Invalid image defs.");return s},t}(Fr),n0="KHR_texture_transform",Ih=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.extendTexture=function(e,r,i){var a=r.extensions!==void 0?r.extensions[n0]:void 0;return a?(a.texCoord!==void 0&&console.warn('glTF: Custom UV sets in "'+n0+'" extension not yet supported.'),a.offset===void 0&&a.rotation===void 0&&a.scale===void 0||(e=e.clone(),e.needsUpdate=!0,a.offset!==void 0&&e.offset.fromArray(a.offset),a.rotation!==void 0&&(e.rotation=a.rotation),a.scale!==void 0&&e.repeat.fromArray(a.scale)),e):null},t}(Fr),Th=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(Fr),Ph=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(Fr),Ga=function(){var n="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:78Yqdbk:qzezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhlaicefhodnadTmbalc;WFbGglcjdalcjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxdndndndnalc9WGgmTmbcbhPcehsawcjdfhzaohHinaraH9Rax6midnaraHaxfgo9RcK6mbczhlinalgic9Wfglawcj;cbffhOdndndndndnaHalco4fRbbalci4coG4ciGPlbedibkaO9cb83ibaOcwf9cb83ibxikaOaoRblaoRbbgAco4glalciSgCE86bbawcj;cbfaifglcGfaoclfaCfgORbbaAcl4ciGgCaCciSgCE86bbalcVfaOaCfgORbbaAcd4ciGgCaCciSgCE86bbalc7faOaCfgORbbaAciGgAaAciSgAE86bbalctfaOaAfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkaOaoRbwaoRbbgAcl4glalcsSgCE86bbawcj;cbfaifglcGfaocwfaCfgORbbaAcsGgAaAcsSgAE86bbalcVfaOaAfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekaOao8Pbb83bbaOcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaiczfhlarao9RcL0mekkaiam6miaoTmidnakTmbawaPfRbbhOawcj;cbfhlazhiakhHinaialRbbgAce4cbaAceG9R7aOfgO86bbaiadfhialcefhlaHcufgHmbkkazcefhzaPcefgPad6hsaohHaPad9hmexvkkcbhoasceGmdxikaoaxad2fhPdnakTmbcbhmcehsawcjdfhCinarao9Rax6miaoTmdaoaxfhoawamfRbbhOawcj;cbfhlaChiakhHinaialRbbgAce4cbaAceG9R7aOfgO86bbaiadfhialcefhlaHcufgHmbkaCcefhCamcefgmad6hsamad9hmbkaPhoxikcbhlcehsinarao9Rax6mdaoTmeaoaxfhoalcefglad6hsadal9hmbkaPhoxdkcbhoasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekcbc99arao9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;xzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabavcefciGaiVcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabavcdfciGaiVcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabavcufciGaiVcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabavciGaiVcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj;8ifcjjj98G::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;a9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;d8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincehHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaiczfgiak6mbkkalTmbaAci6hHalhOaAcefgAclSmdxekkcbhlaHceGm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fhDc9:hoalmexikkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk;tzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepkbbadczfhdaeclfgeav6mbkkdnaval9pmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb",e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),r=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var i=WebAssembly.validate(e)?t:n,a,o=WebAssembly.instantiate(s(i),{}).then(function(m){a=m.instance,a.exports.__wasm_call_ctors()});function s(m){for(var y=new Uint8Array(m.length),b=0;b<m.length;++b){var x=m.charCodeAt(b);y[b]=x>96?x-97:x>64?x-39:x+4}for(var w=0,b=0;b<m.length;++b)y[w++]=y[b]<60?r[y[b]]:(y[b]-60)*64+y[++b];return y.buffer.slice(0,w)}function u(m,y,b,x,w,M){var S=a.exports.sbrk,E=b+3&-4,P=S(E*x),B=S(w.length),C=new Uint8Array(a.exports.memory.buffer);C.set(w,B);var I=m(P,b,x,B,w.length);if(I==0&&M&&M(P,E,x),y.set(C.subarray(P,P+b*x)),S(P-S(0)),I!=0)throw new Error("Malformed buffer data: "+I)}var l={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},c={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},d=[],p=0;function A(m){var y={object:new Worker(m),pending:0,requests:{}};return y.object.onmessage=function(b){var x=b.data;y.pending-=x.count,y.requests[x.id][x.action](x.value),delete y.requests[x.id]},y}function h(m){for(var y="var instance; var ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(s(i))+"]), {}).then(function(result) { instance = result.instance; instance.exports.__wasm_call_ctors(); });self.onmessage = workerProcess;"+u.toString()+g.toString(),b=new Blob([y],{type:"text/javascript"}),x=URL.createObjectURL(b),w=0;w<m;++w)d[w]=A(x);URL.revokeObjectURL(x)}function v(m,y,b,x,w){for(var M=d[0],S=1;S<d.length;++S)d[S].pending<M.pending&&(M=d[S]);return new Promise(function(E,P){var B=new Uint8Array(b),C=p++;M.pending+=m,M.requests[C]={resolve:E,reject:P},M.object.postMessage({id:C,count:m,size:y,source:B,mode:x,filter:w},[B.buffer])})}function g(m){o.then(function(){var y=m.data;try{var b=new Uint8Array(y.count*y.size);u(a.exports[y.mode],b,y.count,y.size,y.source,a.exports[y.filter]),self.postMessage({id:y.id,count:y.count,action:"resolve",value:b},[b.buffer])}catch(x){self.postMessage({id:y.id,count:y.count,action:"reject",value:x})}})}return{ready:o,supported:!0,useWorkers:function(m){h(m)},decodeVertexBuffer:function(m,y,b,x,w){u(a.exports.meshopt_decodeVertexBuffer,m,y,b,x,a.exports[l[w]])},decodeIndexBuffer:function(m,y,b,x){u(a.exports.meshopt_decodeIndexBuffer,m,y,b,x)},decodeIndexSequence:function(m,y,b,x){u(a.exports.meshopt_decodeIndexSequence,m,y,b,x)},decodeGltfBuffer:function(m,y,b,x,w,M){u(a.exports[c[w]],m,y,b,x,a.exports[l[M]])},decodeGltfBufferAsync:function(m,y,b,x,w){return d.length>0?v(m,y,b,c[x],l[w]):o.then(function(){var M=new Uint8Array(m*y);return u(a.exports[c[x]],M,m,y,b,a.exports[l[w]]),M})}}}(),Ka="EXT_meshopt_compression",Rh=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadBufferView=function(e,r){var i=r.json,a=i.bufferViews[e];if(a.extensions&&a.extensions[Ka]){var o=a.extensions[Ka],s=r.loadBuffer(o.buffer);if(!Ga.supported){if(i.extensionsRequired&&i.extensionsRequired.indexOf(Ka)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([s,Ga.ready]).then(function(u){var l=u[0],c=o.byteOffset||0,d=o.byteLength||0,p=o.count,A=o.byteStride,h=new ArrayBuffer(p*A),v=new Uint8Array(l,c,d);return Ga.decodeGltfBuffer(new Uint8Array(h),p,A,v,o.mode,o.filter),h})}else return null},t}(Fr),i0="EXT_texture_webp",Bh=function(n){ue(t,n);function t(){var e=n!==null&&n.apply(this,arguments)||this;return e.supportsWep=!1,e}return t.prototype.prepare=function(e){var r=this;return vu().then(function(i){r.supportsWep=i.webp})},t.prototype.loadTexture=function(e,r){var i=r.json,a=i.textures[e];if(!a.extensions||!a.extensions[i0]||!this.supportsWep)return null;var o=a.extensions[i0];return r.loadImage(o.source).then(function(s){var u=new f.Texture(s);u.needsUpdate=!0,u.flipY=!1,a.name&&(u.name=a.name);var l=r.json.samplers||{},c=l[a.sampler]||{};return u.magFilter=oa[c.magFilter]||f.LinearFilter,u.minFilter=oa[c.minFilter]||f.LinearMipmapLinearFilter,u.wrapS=sa[c.wrapS]||f.RepeatWrapping,u.wrapT=sa[c.wrapT]||f.RepeatWrapping,u.onUpdate=function(){s.close()},u})},t}(Fr),ja="CESIUM_RTC",Fh=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.emitResult=function(e,r){if(r.json.extensions[ja]&&r.json.extensions[ja].center){var i=r.json.extensions[ja].center;e.CESIUM_RTC={center:new f.Vector3().fromArray(i)}}},t}(Fr),Lh=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadMesh=function(e,r){var i=this,a=r.json.meshes[e],o=a.primitives,s=Promise.all(o.map(function(c){return r.loadGeometry(c)})),u=Promise.all(o.map(function(c){return i.loadPBMMaterial(c,r)})),l=Promise.all([s,u]).then(function(c){for(var d=c[0],p=c[1],A=[],h=0;h<o.length;h++){var v=o[h],g=d[h],m=p[h];g.attributes.normal===void 0&&(m.flatShading=!0),g.attributes.tangent===void 0&&m.normalScale&&(m.normalScale.y*=-1);var y=v.mode||Ue.TRIANGLES,b=void 0;if(y===Ue.TRIANGLES||y===Ue.TRIANGLE_STRIP||y===Ue.TRIANGLE_FAN)if(y===Ue.TRIANGLE_STRIP?g=r.toGeometryTrianglesDrawMode(g,f.TriangleStripDrawMode):y===Ue.TRIANGLE_FAN&&(g=r.toGeometryTrianglesDrawMode(g,f.TriangleFanDrawMode)),g.clearGroups(),g.addGroup(0,g.index?g.index.count:g.attributes.position.count,0),r.disposeSet.add(g),a.isSkinnedMesh){var x=new gu(g,[m]);g.attributes.skinWeight.normalized||x.normalizeSkinWeights(),b=x}else b=new Ot(g,[m]);else if(y===Ue.POINTS)b=new yr(g,m);else throw new Error("glTF: Primitive mode unsupported: "+y);if(Object.keys(g.morphAttributes).length>0){if(a.weights!==void 0)for(var w=0,M=a.weights.length;w<M;w++)b.morphTargetInfluences[w]=a.weights[w];if(a.extras&&Array.isArray(a.extras.targetNames)){var S=a.extras.targetNames;if(b.morphTargetInfluences.length===S.length){b.morphTargetDictionary={};for(var w=0,M=S.length;w<M;w++)b.morphTargetDictionary[S[w]]=w}else console.warn("glTF: Invalid extras.targetNames length. Ignoring names.")}}b.name=r.createUniqueName(a.name||"mesh_"+e),A.push(b)}if(A.length===1)return A[0];for(var E=new f.Group,P=0,B=A;P<B.length;P++){var b=B[P];E.add(b)}return E});return l},t.prototype.loadPBMMaterial=function(e,r){var i,a=(i=e.mode)!==null&&i!==void 0?i:Ue.TRIANGLES,o=null;if(a===Ue.TRIANGLES||a===Ue.TRIANGLE_STRIP||a===Ue.TRIANGLE_FAN)o=this.loadPBMMeshMaterial(e,r);else if(a===Ue.POINTS)o=this.loadPBMPointCloudMaterial(e,r);else throw new Error("glTF: Primitive mode unsupported: "+a);return o},t.prototype.extendTexture=function(e,r,i){return e.minFilter=f.LinearFilter,e.magFilter=f.LinearFilter,e.generateMipmaps=!1,e},t.prototype.loadPBMPointCloudMaterial=function(e,r){var i=new Pi;return Object.keys(e.attributes).filter(function(a){return Kt[a]==="normal"}).length>0&&(i.defines.USE_POINT_NORMAL=!0),r.disposeSet.add(i),Promise.resolve(i)},t.prototype.loadPBMMeshMaterial=function(e,r){var i=[],a=new br("basic");if(a.color=new f.Color(1,1,1),Object.keys(e.attributes).filter(function(c){return Kt[c]==="color"}).length>0&&(a.vertexColors=!0),Object.keys(e.attributes).filter(function(c){return Kt[c]==="tangent"}).length===0&&(a.normalScale&&(a.normalScale.y*=-1),a.clearcoatNormalScale&&(a.clearcoatNormalScale.y*=-1)),e.material!==void 0){var o=r.json.materials[e.material];o.name&&(a.name=o.name);var s=o.pbrMetallicRoughness||{};if(Array.isArray(s.baseColorFactor)){var u=s.baseColorFactor;a.color=new f.Color().fromArray(u)}if(s.baseColorTexture!==void 0&&i.push(r.createMaterialTexture(s.baseColorTexture).then(function(c){r.disposeSet.add(c),c.encoding=f.sRGBEncoding,a.map=c})),o.doubleSided===!0&&(a.side=f.DoubleSide),o.normalTexture!==void 0&&(i.push(r.createMaterialTexture(o.normalTexture).then(function(c){r.disposeSet.add(c),a.normalMap=c})),a.normalScale=new f.Vector2(1,1),o.normalTexture.scale!==void 0)){var l=o.normalTexture.scale;a.normalScale.set(l,l)}}return r.disposeSet.add(a),Promise.all(i).then(function(){return a.refreshUniforms(),a})},t}(Fr),yn={KHR_binary_glTF:hh,KHR_draco_mesh_compression:mh,KHR_texture_basisu:Eh,KHR_texture_transform:Ih,KHR_mesh_quantization:Th,KHR_materials_unlit:Ph,EXT_meshopt_compression:Rh,EXT_texture_webp:Bh,CESIUM_RTC:Fh,PBM_mesh:Lh};function es(n,t){var e,r,i,a={};if(t.addonExtensions)for(var o=0,s=t.addonExtensions;o<s.length;o++){var u=s[o];u in yn&&(a[u]=new yn[u])}var l,c;if(typeof n=="string")c=n;else{var d=yn.KHR_binary_glTF.getMagic(n);if(d===yn.KHR_binary_glTF.HEADER_MAGIC){l=new yn.KHR_binary_glTF;try{l.loadGlbBinary(n)}catch(m){return Promise.reject(m)}a.KHR_binary_glTF=l,c=l.content}else c=aa(new Uint8Array(n))}var p=JSON.parse(c);if(p.asset===void 0||Number(p.asset.version[0])<2)return Promise.reject(new Error("glTF: Unsupported asset. glTF versions >=2.0 are supported."));if(p.extensionsUsed)for(var A=p.extensionsRequired||[],h=0;h<p.extensionsUsed.length;h++){var v=p.extensionsUsed[h];a[v]||(yn[v]?a[v]=new yn[v]:A.indexOf(v)>=0&&console.warn('glTF: Unknown extension "'+v+'".'))}var g=new dh(p,a,{copyUV2:(e=t.copyUV2)!==null&&e!==void 0?e:!0,resourcePath:(r=t.resourcePath)!==null&&r!==void 0?r:"",search:(i=t.search)!==null&&i!==void 0?i:"",fetcher:t.fetcher});return g.parse().then(function(m){return l&&l.clear(),m})}var kh=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function Ju(n,t){var e,r;t===void 0&&(t={});var i=(e=t.upAxis)!==null&&e!==void 0?e:"Y",a=(r=t.fetcher)!==null&&r!==void 0?r:new Ut({allowHosts:["*"]}),o={uri:n,gltfUpAxis:i};return Promise.resolve().then(function(){return a.ajax(n,{responseType:"arraybuffer"}).then(function(s){return s.body})}).then(function(s){return Promise.resolve(0).then(function(u){return Gu(o,s,u)}).then(function(u){return _u(o,s,u)}).then(function(u){return lh(o,s,u)})}).then(function(){var s;return es(o.gltfArrayBuffer,{copyUV2:!1,addonExtensions:["PBM_mesh"],resourcePath:n.slice(0,n.lastIndexOf("/")+1),search:(s=n.split("?")[1])!==null&&s!==void 0?s:"",fetcher:a}).then(function(u){var l=new f.Matrix4;i==="Y"&&l.premultiply(kh);var c=new f.Matrix4().setPosition(o.rtcCenter[0],o.rtcCenter[1],o.rtcCenter[2]);if(l.premultiply(c),u.CESIUM_RTC){var d=new f.Matrix4().setPosition(u.CESIUM_RTC.center);l.premultiply(d)}var p=u.scene;return p.applyMatrix4(l),delete o.featureTableBinary,delete o.batchTableBinary,delete o.gltfArrayBuffer,{type:"b3dm",upAxis:"Z",uri:o.uri,byteLength:o.byteLength,scene:p,textures:u.textures,dispose:function(){return u.dispose()}}})})}const Xu="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Z1bmN0aW9uIEIoYSl7b25tZXNzYWdlPWZ1bmN0aW9uKHIpe1Byb21pc2UucmVzb2x2ZShyLmRhdGEpLnRoZW4oZnVuY3Rpb24obil7cmV0dXJuIGEobil9KS50aGVuKGZ1bmN0aW9uKG4pe3ZhciBlPW4ub3V0cHV0LHQ9bi50cmFuc2ZlcjtyZXR1cm4gcG9zdE1lc3NhZ2UoZSx0KX0pLmNhdGNoKGZ1bmN0aW9uKG4pe3JldHVybiBwb3N0TWVzc2FnZSh7JCRlcnJvcjpufSl9KX19dmFyIHUseTsoZnVuY3Rpb24oYSl7YVthLkJZVEU9NTEyMF09IkJZVEUiLGFbYS5VTlNJR05FRF9CWVRFPTUxMjFdPSJVTlNJR05FRF9CWVRFIixhW2EuU0hPUlQ9NTEy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5GTE9BVCwzKSxuPXIubGVuZ3RoLzMsZT1uZXcgSW50OEFycmF5KG4qNCksdD0wLGk9dm9pZCAwLG89dm9pZCAwO3Q8bjt0Kyspbz10KjQsaT10KjMsZVtvXT1yW2ldKmgsZVsrK29dPXJbKytpXSpoLGVbKytvXT1yWysraV0qaDtyZXR1cm57YXJyYXk6ZSxpdGVtU2l6ZTo0LG5vcm1hbGl6ZWQ6ITB9fWVsc2UgaWYoYS5oYXNQcm9wZXJ0eSgiTk9STUFMX09DVDE2UCIpKXtmb3IodmFyIHI9YS5nZXRQcm9wZXJ0eUFycmF5KCJOT1JNQUxfT0NUMTZQIix5LlVOU0lHTkVEX0JZVEUsMiksbj1yLmxlbmd0aC8yLGU9bmV3IEludDhBcnJheShuKjQpLHQ9MCx2PXZvaWQgMCxBPXZvaWQgMCxOPXZvaWQgMCxFPXZvaWQgMCxTPXZvaWQgMCxzPXZvaWQgMCxUPXZvaWQgMDt0PG47dCsrKXY9dCoyLEE9clt2XSpELTEsTj1yWysrdl0qRC0xLFM9QTwwPy1BOkEscz1OPDA/LU46TixFPTEtKFMrcyksRTwwJiYoQT0oMS1zKSooQTwwPy0xOjEpLE49KDEtUykqKE48MD8tMToxKSksVD1NYXRoLnNxcnQoQSpBK04qTitFKkUpLHY9dCo0LGVbdl09QS9UKmgsZVsrK3ZdPU4vVCpoLGVbKyt2XT1FL1QqaDtyZXR1cm57YXJyYXk6ZSxpdGVtU2l6ZTo0LG5vcm1hbGl6ZWQ6ITB9fXJldHVybiBudWxsfX0pKCk7Cg==",Oh=n=>Uint8Array.from(atob(n),t=>t.charCodeAt(0)),a0=typeof self!="undefined"&&self.Blob&&new Blob([Oh(Xu)],{type:"text/javascript;charset=utf-8"});function Dh(n){let t;try{if(t=a0&&(self.URL||self.webkitURL).createObjectURL(a0),!t)throw"";const e=new Worker(t,{name:n==null?void 0:n.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch(e){return new Worker("data:text/javascript;base64,"+Xu,{name:n==null?void 0:n.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var Vh=new Nu(function(){return new Dh},2);function Nh(n,t,e){var r=new Ku(n.featureTableJson,n.featureTableBinary);return Promise.resolve().then(function(){var i=r.getExtension("3DTILES_draco_point_compression");return i?zh(i,r):Vh.postMessage({featureTableBinary:r.buffer,featureTableJson:r.json},[r.buffer.buffer])}).then(function(i){return n.attributes=i,e})}function zh(n,t){return ha(this,void 0,void 0,function(){var e,r,i,a,o,s;return pa(this,function(u){if(e=n.properties||{},r=n.byteOffset,i=n.byteLength,!e||!Number.isFinite(r)||!i)throw new Error("Draco properties, byteOffset, and byteLength must be defined");return a=t.buffer.slice(r,r+i),o=n.properties,s={POSITION:"Float32Array",NORMAL:"Float32Array",RGB:"Uint8Array",RGBA:"Uint8Array"},[2,ua.decodeGeometry(a.buffer,{attributeIDs:o,attributeTypes:s,useUniqueIDs:!0}).then(function(l){var c=l.getAttribute("POSITION"),d=l.getAttribute("RGB"),p=l.getAttribute("RGBA"),A=l.getAttribute("NORMAL"),h;if(p)h=p;else if(d){for(var v=d.count,g=d.array,m=new Uint8Array(v*4),y=0,b=void 0,x=void 0;y<v;y++)x=y*4,b=y*3,m[x]=g[b],m[++x]=g[++b],m[++x]=g[++b];h=new f.BufferAttribute(m,4,d.normalized)}return{position:c?{array:c.array,itemSize:c.itemSize,normalized:c.normalized}:null,color:h?{array:h.array,itemSize:h.itemSize,normalized:h.normalized}:null,normal:A?{array:A.array,itemSize:A.itemSize,normalized:A.normalized}:null}})]})})}function Wu(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new Ut({allowHosts:["*"]}),i={uri:n};return Promise.resolve().then(function(){return r.ajax(n,{responseType:"arraybuffer"}).then(function(a){return a.body})}).then(function(a){return Promise.resolve(0).then(function(o){return Gu(i,a,o)}).then(function(o){return _u(i,a,o)}).then(function(o){return Nh(i,a,o)})}).then(function(){var a;return Qh(i.attributes,{computeBoundingBox:(a=t.computeBoundingBox)!==null&&a!==void 0?a:!0})}).then(function(a){var o=new f.Matrix4,s=new f.Matrix4().setPosition(i.rtcCenter[0],i.rtcCenter[1],i.rtcCenter[2]);return o.premultiply(s),a.object.applyMatrix4(o),delete i.gltfArrayBuffer,delete i.featureTableBinary,delete i.batchTableBinary,{type:"pnts",upAxis:"Z",uri:i.uri,byteLength:i.byteLength,scene:a.object,textures:[],dispose:function(){return a.dispose()}}})}function Qh(n,t){var e=new Set,r=new f.BufferGeometry;e.add(r);var i=new Pi;e.add(i),n.position&&r.setAttribute("position",new f.BufferAttribute(n.position.array,n.position.itemSize,n.position.normalized)),n.color&&r.setAttribute("color",new f.BufferAttribute(n.color.array,n.color.itemSize,n.color.normalized)),n.normal&&(r.setAttribute("normal",new f.BufferAttribute(n.normal.array,n.normal.itemSize,n.normal.normalized)),i.defines.USE_POINT_NORMAL=!0),t.computeBoundingBox&&r.computeBoundingBox();var a=new yr(r,i);return a.matrix.compose(a.position,a.quaternion,a.scale),a.matrixAutoUpdate=!1,a.frustumCulled=!1,Promise.resolve({object:a,dispose:function(){e.forEach(function(o){o.dispose()}),e.clear()}})}function Zu(){var n={};return n.OutWindow=function(){this._windowSize=0},n.OutWindow.prototype.create=function(t){(!this._buffer||this._windowSize!==t)&&(this._buffer=[]),this._windowSize=t,this._pos=0,this._streamPos=0},n.OutWindow.prototype.flush=function(){var t=this._pos-this._streamPos;if(t!==0){for(;t--;)this._stream.writeByte(this._buffer[this._streamPos++]);this._pos>=this._windowSize&&(this._pos=0),this._streamPos=this._pos}},n.OutWindow.prototype.releaseStream=function(){this.flush(),this._stream=null},n.OutWindow.prototype.setStream=function(t){this.releaseStream(),this._stream=t},n.OutWindow.prototype.init=function(t){t||(this._streamPos=0,this._pos=0)},n.OutWindow.prototype.copyBlock=function(t,e){var r=this._pos-t-1;for(r<0&&(r+=this._windowSize);e--;)r>=this._windowSize&&(r=0),this._buffer[this._pos++]=this._buffer[r++],this._pos>=this._windowSize&&this.flush()},n.OutWindow.prototype.putByte=function(t){this._buffer[this._pos++]=t,this._pos>=this._windowSize&&this.flush()},n.OutWindow.prototype.getByte=function(t){var e=this._pos-t-1;return e<0&&(e+=this._windowSize),this._buffer[e]},n.RangeDecoder=function(){},n.RangeDecoder.prototype.setStream=function(t){this._stream=t},n.RangeDecoder.prototype.releaseStream=function(){this._stream=null},n.RangeDecoder.prototype.init=function(){var t=5;for(this._code=0,this._range=-1;t--;)this._code=this._code<<8|this._stream.readByte()},n.RangeDecoder.prototype.decodeDirectBits=function(t){for(var e=0,r=t,i;r--;)this._range>>>=1,i=this._code-this._range>>>31,this._code-=this._range&i-1,e=e<<1|1-i,this._range&4278190080||(this._code=this._code<<8|this._stream.readByte(),this._range<<=8);return e},n.RangeDecoder.prototype.decodeBit=function(t,e){var r=t[e],i=(this._range>>>11)*r;return(this._code^2147483648)<(i^2147483648)?(this._range=i,t[e]+=2048-r>>>5,this._range&4278190080||(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),0):(this._range-=i,this._code-=i,t[e]-=r>>>5,this._range&4278190080||(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),1)},n.initBitModels=function(t,e){for(;e--;)t[e]=1024},n.BitTreeDecoder=function(t){this._models=[],this._numBitLevels=t},n.BitTreeDecoder.prototype.init=function(){n.initBitModels(this._models,1<<this._numBitLevels)},n.BitTreeDecoder.prototype.decode=function(t){for(var e=1,r=this._numBitLevels;r--;)e=e<<1|t.decodeBit(this._models,e);return e-(1<<this._numBitLevels)},n.BitTreeDecoder.prototype.reverseDecode=function(t){for(var e=1,r=0,i=0,a;i<this._numBitLevels;++i)a=t.decodeBit(this._models,e),e=e<<1|a,r|=a<<i;return r},n.reverseDecode2=function(t,e,r,i){for(var a=1,o=0,s=0,u;s<i;++s)u=r.decodeBit(t,e+a),a=a<<1|u,o|=u<<s;return o},n.LenDecoder=function(){this._choice=[],this._lowCoder=[],this._midCoder=[],this._highCoder=new n.BitTreeDecoder(8),this._numPosStates=0},n.LenDecoder.prototype.create=function(t){for(;this._numPosStates<t;++this._numPosStates)this._lowCoder[this._numPosStates]=new n.BitTreeDecoder(3),this._midCoder[this._numPosStates]=new n.BitTreeDecoder(3)},n.LenDecoder.prototype.init=function(){var t=this._numPosStates;for(n.initBitModels(this._choice,2);t--;)this._lowCoder[t].init(),this._midCoder[t].init();this._highCoder.init()},n.LenDecoder.prototype.decode=function(t,e){return t.decodeBit(this._choice,0)===0?this._lowCoder[e].decode(t):t.decodeBit(this._choice,1)===0?8+this._midCoder[e].decode(t):16+this._highCoder.decode(t)},n.Decoder2=function(){this._decoders=[]},n.Decoder2.prototype.init=function(){n.initBitModels(this._decoders,768)},n.Decoder2.prototype.decodeNormal=function(t){var e=1;do e=e<<1|t.decodeBit(this._decoders,e);while(e<256);return e&255},n.Decoder2.prototype.decodeWithMatchByte=function(t,e){var r=1,i,a;do if(i=e>>7&1,e<<=1,a=t.decodeBit(this._decoders,(1+i<<8)+r),r=r<<1|a,i!==a){for(;r<256;)r=r<<1|t.decodeBit(this._decoders,r);break}while(r<256);return r&255},n.LiteralDecoder=function(){},n.LiteralDecoder.prototype.create=function(t,e){var r;if(!(this._coders&&this._numPrevBits===e&&this._numPosBits===t))for(this._numPosBits=t,this._posMask=(1<<t)-1,this._numPrevBits=e,this._coders=[],r=1<<this._numPrevBits+this._numPosBits;r--;)this._coders[r]=new n.Decoder2},n.LiteralDecoder.prototype.init=function(){for(var t=1<<this._numPrevBits+this._numPosBits;t--;)this._coders[t].init()},n.LiteralDecoder.prototype.getDecoder=function(t,e){return this._coders[((t&this._posMask)<<this._numPrevBits)+((e&255)>>>8-this._numPrevBits)]},n.Decoder=function(){this._outWindow=new n.OutWindow,this._rangeDecoder=new n.RangeDecoder,this._isMatchDecoders=[],this._isRepDecoders=[],this._isRepG0Decoders=[],this._isRepG1Decoders=[],this._isRepG2Decoders=[],this._isRep0LongDecoders=[],this._posSlotDecoder=[],this._posDecoders=[],this._posAlignDecoder=new n.BitTreeDecoder(4),this._lenDecoder=new n.LenDecoder,this._repLenDecoder=new n.LenDecoder,this._literalDecoder=new n.LiteralDecoder,this._dictionarySize=-1,this._dictionarySizeCheck=-1,this._posSlotDecoder[0]=new n.BitTreeDecoder(6),this._posSlotDecoder[1]=new n.BitTreeDecoder(6),this._posSlotDecoder[2]=new n.BitTreeDecoder(6),this._posSlotDecoder[3]=new n.BitTreeDecoder(6)},n.Decoder.prototype.setDictionarySize=function(t){return t<0?!1:(this._dictionarySize!==t&&(this._dictionarySize=t,this._dictionarySizeCheck=Math.max(this._dictionarySize,1),this._outWindow.create(Math.max(this._dictionarySizeCheck,4096))),!0)},n.Decoder.prototype.setLcLpPb=function(t,e,r){var i=1<<r;return t>8||e>4||r>4?!1:(this._literalDecoder.create(e,t),this._lenDecoder.create(i),this._repLenDecoder.create(i),this._posStateMask=i-1,!0)},n.Decoder.prototype.init=function(){var t=4;for(this._outWindow.init(!1),n.initBitModels(this._isMatchDecoders,192),n.initBitModels(this._isRep0LongDecoders,192),n.initBitModels(this._isRepDecoders,12),n.initBitModels(this._isRepG0Decoders,12),n.initBitModels(this._isRepG1Decoders,12),n.initBitModels(this._isRepG2Decoders,12),n.initBitModels(this._posDecoders,114),this._literalDecoder.init();t--;)this._posSlotDecoder[t].init();this._lenDecoder.init(),this._repLenDecoder.init(),this._posAlignDecoder.init(),this._rangeDecoder.init()},n.Decoder.prototype.decode=function(t,e,r){var i=0,a=0,o=0,s=0,u=0,l=0,c=0,d,p,A,h,v,g;for(this._rangeDecoder.setStream(t),this._outWindow.setStream(e),this.init();r<0||l<r;)if(d=l&this._posStateMask,this._rangeDecoder.decodeBit(this._isMatchDecoders,(i<<4)+d)===0)p=this._literalDecoder.getDecoder(l++,c),i>=7?c=p.decodeWithMatchByte(this._rangeDecoder,this._outWindow.getByte(a)):c=p.decodeNormal(this._rangeDecoder),this._outWindow.putByte(c),i=i<4?0:i-(i<10?3:6);else{if(this._rangeDecoder.decodeBit(this._isRepDecoders,i)===1)A=0,this._rangeDecoder.decodeBit(this._isRepG0Decoders,i)===0?this._rangeDecoder.decodeBit(this._isRep0LongDecoders,(i<<4)+d)===0&&(i=i<7?9:11,A=1):(this._rangeDecoder.decodeBit(this._isRepG1Decoders,i)===0?h=o:(this._rangeDecoder.decodeBit(this._isRepG2Decoders,i)===0?h=s:(h=u,u=s),s=o),o=a,a=h),A===0&&(A=2+this._repLenDecoder.decode(this._rangeDecoder,d),i=i<7?8:11);else if(u=s,s=o,o=a,A=2+this._lenDecoder.decode(this._rangeDecoder,d),i=i<7?7:10,v=this._posSlotDecoder[A<=5?A-2:3].decode(this._rangeDecoder),v>=4){if(g=(v>>1)-1,a=(2|v&1)<<g,v<14)a+=n.reverseDecode2(this._posDecoders,a-v-1,this._rangeDecoder,g);else if(a+=this._rangeDecoder.decodeDirectBits(g-4)<<4,a+=this._posAlignDecoder.reverseDecode(this._rangeDecoder),a<0){if(a===-1)break;return!1}}else a=v;if(a>=l||a>=this._dictionarySizeCheck)return!1;this._outWindow.copyBlock(a,A),l+=A,c=this._outWindow.getByte(0)}return this._outWindow.flush(),this._outWindow.releaseStream(),this._rangeDecoder.releaseStream(),!0},n.Decoder.prototype.setDecoderProperties=function(t){var e,r,i,a,o;return t.size<5||(e=t.readByte(),r=e%9,e=~~(e/9),i=e%5,a=~~(e/5),!this.setLcLpPb(r,i,a))?!1:(o=t.readByte(),o|=t.readByte()<<8,o|=t.readByte()<<16,o+=t.readByte()*16777216,this.setDictionarySize(o))},n.decompress=function(t,e,r,i){var a=new n.Decoder;if(!a.setDecoderProperties(t))throw"Incorrect stream properties";if(!a.decode(e,r,i))throw"Error in data stream";return!0},n.decompressFile=function(t,e){var r=new n.Decoder,i;if(!r.setDecoderProperties(t))throw"Incorrect stream properties";if(i=t.readByte(),i|=t.readByte()<<8,i|=t.readByte()<<16,i+=t.readByte()*16777216,t.readByte(),t.readByte(),t.readByte(),t.readByte(),!r.decode(t,e,i))throw"Error in data stream";return!0},n}var Uh=Zu();function qh(){function n(e){for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(256),a=0;a<r.length;a++)i[r.charCodeAt(a)]=a;var o=e.length*.75,s=e.length,u,l=0,c,d,p,A;e[e.length-1]==="="&&(o--,e[e.length-2]==="="&&o--);var h=new ArrayBuffer(o),v=new Uint8Array(h);for(u=0;u<s;u+=4)c=i[e.charCodeAt(u)],d=i[e.charCodeAt(u+1)],p=i[e.charCodeAt(u+2)],A=i[e.charCodeAt(u+3)],v[l++]=c<<2|d>>4,v[l++]=(d&15)<<4|p>>2,v[l++]=(p&3)<<6|A&63;return h}var t="AGFzbQEAAAABSg1gAABgAX8Bf2ACf38Bf2AEf39/fwBgA39/fwBgAX8AYAJ/fwBgA39/fwF/YAR/f39/AX9gAn9/AGABfwF/YAABf2AEf39/fwF/AhsCA2VudgVhYm9ydAADA2VudgZtZW1vcnkCAAEDJiUBAQkKAgoKCwsLCwsAAgoBAgQKAQYFCAoFBQQEBwgCBwwCAQAABAQBcAABBhoFfwFBAAt/AUEAC38BQQALfwFBAAt/AUEACwc9BgZtZW1vcnkCAAV0YWJsZQEABXJlc2V0AA0KbmV3VThBcnJheQAQCnVucGFja1NpemUAFAZkZWNvZGUAIwgBJAkHAQBBAAsBJQqAViVoAQN/IABBgICAgARLBEAACyMBIgEgAEEBIABBAUsbakEHakF4cSICPwAiA0EQdEsEQCADIAIgAWtB//8DakGAgHxxQRB2IgAgAyAAShtAAEEASARAIABAAEEASARAAAsLCyACJAEgAQsbAQF/QQFBICAAQQdqZ2t0EAEiASAANgIAIAELkQMBAX8gAUUEQA8LIABBADoAACAAIAFqQQFrQQA6AAAgAUECTQRADwsgAEEBakEAOgAAIABBAmpBADoAACAAIAFqIgJBAmtBADoAACACQQNrQQA6AAAgAUEGTQRADwsgAEEDakEAOgAAIAAgAWpBBGtBADoAACABQQhNBEAPC0EAIABrQQNxIgIgAGoiAEEANgIAIAEgAmtBfHEiASAAakEEa0EANgIAIAFBCE0EQA8LIABBBGpBADYCACAAQQhqQQA2AgAgACABaiICQQxrQQA2AgAgAkEIa0EANgIAIAFBGE0EQA8LIABBDGpBADYCACAAQRBqQQA2AgAgAEEUakEANgIAIABBGGpBADYCACAAIAFqIgJBHGtBADYCACACQRhrQQA2AgAgAkEUa0EANgIAIAJBEGtBADYCACAAQQRxQRhqIgIgAGohACABIAJrIQEDQCABQSBPBEAgAEIANwMAIABBCGpCADcDACAAQRBqQgA3AwAgAEEYakIANwMAIAFBIGshASAAQSBqIQAMAQsLC1EBA38gAEH+////AEsEQEEAQSBBLUEnEAAACyAAQQJ0IgMQAiECQQgQASIBQQA2AgAgAUEANgIEIAEgAjYCACABIAA2AgQgAkEIaiADEAMgAQtmAQF/IAFB/P///wFLBEBBAEHAAEEXQSIQAAALIAFBAXQiARACIgJBCGogARADIABFBEBBDBABIQALIABBADYCACAAQQA2AgQgAEEANgIIIAAgAjYCACAAQQA2AgQgACABNgIIIAALCgBBDBABIAAQBQsuAQF/QQgQASIBQQA2AgAgAUEANgIEIAEgADYCBCABQQEgASgCBHQQBjYCACABC6EBAQR/QRAQASIBQQA2AgAgAUEANgIEIAFBADYCCCABQQA2AgxBEBAEIQIDQCAAQRBIBEBBAxAHIQMgAigCACAAQQJ0aiADNgIIIABBAWohAAwBCwsgASACNgIEQRAQBCECQQAhAANAIABBEEgEQEEDEAchAyACKAIAIABBAnRqIAM2AgggAEEBaiEADAELCyABIAI2AgggAUEIEAc2AgwgAQs0AQF/QRQQASIAQQA2AgAgAEEAOgAEIABBADYCCCAAQQA2AgwgAEEANgIQIABBDTYCCCAAC0IBAX9BGRABIgBBADYCACAAQQA2AgQgAEEANgIIIABBADYCDCAAQQA2AhAgAEEANgIUIABBADoAGCAAQQA2AhAgAAu1AgEEf0HQABABIgBBADoAACAAQQA2AgQgAEEANgIIIABBADYCDCAAQQA2AhAgAEEAOgAUIABBADYCGCAAQQA2AhwgAEEANgIgIABBADYCJCAAQQA2AiggAEE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AIAEQFwvBAQECfyAAQQIQBjYCACAAKAIAIgEoAgAgASgCBGpBgAg7AQggACgCACICKAIAIQEgAigCBCABQQJqakGACDsBCCAAKAIMKAIAQQEkBBAYGkEAIQIDQCACQRBIBEAgAiAAKAIEKAIAIgEoAgBBAnZJBH8gAkECdCABaigCCAUACygCAEEBJAQQGBogAiAAKAIIKAIAIgEoAgBBAnZJBH8gAkECdCABaigCCAUACygCAEEBJAQQGBogAkEBaiECDAELCwuHAgEFfyAAIQJBgAYgACgCDCAALQAUanQhAQNAIAMgAUgEQCACKAIgIgQoAgAhBSAEKAIEIANBAXQgBWpqQYAIOwEIIANBAWohAwwBCwsgAiEBQQAhAgNAIAJBBEkEQCACIAEoAiQoAgAiAygCAEECdkkEfyACQQJ0IANqKAIIBQALKAIAQQEkBBAYGiACQQFqIQIMAQsLIAEoAigoAgBBASQEEBgaIAEoAixBASQEEBgaIAAoAjBBASQEEBgaIAAoAjRBASQEEBgaIAAoAjhBASQEEBgaIAAoAjxBASQEEBgaIAAoAkBBASQEEBgaIAAoAkRBASQEEBgaIAAoAkgQGSAAKAJMEBkLyAwBA38DQCABQQNxIAIgAhsEQCAAIgRBAWohACABIgNBAWohASAEIAMtAAA6AAAgAkEBayECDAELCyAAQQNxRQRAA0AgAkEQTwRAIAAgASgCADYCACAAQQRqIAFBBGooAgA2AgAgAEEIaiABQQhqKAIANgIAIABBDGogAUEMaigCADYCACABQRBqIQEgAEEQaiEAIAJBEGshAgwBCwsgAkEIcQRAIAAgASgCADYCACAAQQRqIAFBBGooAgA2AgAgAUEIaiEBIABBCGohAAsgAkEEcQRAIAAgASgCADYCACABQQRqIQEgAEEEaiEACyACQQJxBEAgACABLwEAOwEAIAFBAmohASAAQQJqIQALIAJBAXEEQCAAIAEtAAA6AAALDwsgAkEgTwRAAkACQAJAIABBA3EiA0EBRwRAIANBAkYNASADQQNGDQIMAwsgASgCACEFIAAgASIDLQAAOgAAIABBAWoiASABIANBAWoiAS0AADoAAEEBaiIEQQ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zkbAAAAfgBsAGkAYgAvAGkAbgB0AGUAcgBuAGEAbAAvAHQAeQBwAGUAZABhAHIAcgBhAHkALgB0AHMAQYABCzMYAAAAcwByAGMALwBsAHoAbQBhAC8AbAB6AG0AYQAtAGQAZQBjAG8AZABlAHIALgB0AHM=";return n(t)}function Hh(n,t,e){try{var r={data:t,offset:0,readByte:function(){return this.data[this.offset++]}},i=r.data.length,a={data:[],offset:0,writeByte:function(u){var l=Math.floor(this.offset/i);this.data[l]||(this.data[l]=new Uint8Array(i)),this.data[l][this.offset%i]=u,this.offset++}};n.decompressFile(r,a);for(var o=new Uint8Array(a.offset),s=0;s<a.offset;s++)o[s]=a.data[Math.floor(s/i)][s%i];e(null,o)}catch(u){e(u)}}function Gh(n,t,e){var r=24;try{var i=new WebAssembly.Memory({initial:16}),a=new WebAssembly.Module(n),o=new WebAssembly.Instance(a,{env:{memory:i,abort:function(){e(new Error("webAssembly abort"))}}}),s=o.exports,u=s.newU8Array(t.length),l=new Uint8Array(i.buffer,u+r,t.length);l.set(t);var c=s.decode(u),d=new Uint32Array(i.buffer,c,4),p=d[0],A=d[2],h=d[3];p?e(null,new Uint8Array(i.buffer,h+r,A).slice(0,A)):e(new Error("lzma deocder error"))}catch(v){e(v)}}var Kh=`
|
|
883
|
+
`,r0="KHR_texture_basisu",Eh=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadTexture=function(e,r){var i=r.json.textures[e];if(!i.extensions||!i.extensions[r0])return null;var a=i.extensions[r0],o=r.json.images[a.source],s=null;if(o.bufferView!==void 0)s=r.loadBufferView(o.bufferView).then(function(u){return fi.parse(u)});else if(o.uri)s=r.options.fetcher.ajax(r.resolveResouce(o.uri),{responseType:"arraybuffer"}).then(function(u){return fi.parse(u.body)});else throw new Error("glTF: Invalid image defs.");return s},t}(Fr),n0="KHR_texture_transform",Ih=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.extendTexture=function(e,r,i){var a=r.extensions!==void 0?r.extensions[n0]:void 0;return a?(a.texCoord!==void 0&&console.warn('glTF: Custom UV sets in "'+n0+'" extension not yet supported.'),a.offset===void 0&&a.rotation===void 0&&a.scale===void 0||(e=e.clone(),e.needsUpdate=!0,a.offset!==void 0&&e.offset.fromArray(a.offset),a.rotation!==void 0&&(e.rotation=a.rotation),a.scale!==void 0&&e.repeat.fromArray(a.scale)),e):null},t}(Fr),Th=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(Fr),Ph=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(Fr),Ga=function(){var n="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:78Yqdbk:qzezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhlaicefhodnadTmbalc;WFbGglcjdalcjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxdndndndnalc9WGgmTmbcbhPcehsawcjdfhzaohHinaraH9Rax6midnaraHaxfgo9RcK6mbczhlinalgic9Wfglawcj;cbffhOdndndndndnaHalco4fRbbalci4coG4ciGPlbedibkaO9cb83ibaOcwf9cb83ibxikaOaoRblaoRbbgAco4glalciSgCE86bbawcj;cbfaifglcGfaoclfaCfgORbbaAcl4ciGgCaCciSgCE86bbalcVfaOaCfgORbbaAcd4ciGgCaCciSgCE86bbalc7faOaCfgORbbaAciGgAaAciSgAE86bbalctfaOaAfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkaOaoRbwaoRbbgAcl4glalcsSgCE86bbawcj;cbfaifglcGfaocwfaCfgORbbaAcsGgAaAcsSgAE86bbalcVfaOaAfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekaOao8Pbb83bbaOcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaiczfhlarao9RcL0mekkaiam6miaoTmidnakTmbawaPfRbbhOawcj;cbfhlazhiakhHinaialRbbgAce4cbaAceG9R7aOfgO86bbaiadfhialcefhlaHcufgHmbkkazcefhzaPcefgPad6hsaohHaPad9hmexvkkcbhoasceGmdxikaoaxad2fhPdnakTmbcbhmcehsawcjdfhCinarao9Rax6miaoTmdaoaxfhoawamfRbbhOawcj;cbfhlaChiakhHinaialRbbgAce4cbaAceG9R7aOfgO86bbaiadfhialcefhlaHcufgHmbkaCcefhCamcefgmad6hsamad9hmbkaPhoxikcbhlcehsinarao9Rax6mdaoTmeaoaxfhoalcefglad6hsadal9hmbkaPhoxdkcbhoasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekcbc99arao9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;xzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabavcefciGaiVcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabavcdfciGaiVcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabavcufciGaiVcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabavciGaiVcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj;8ifcjjj98G::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;a9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;d8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincehHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjb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sp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfhDc9:hoalmexikkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk;tzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepkbbadczfhdaeclfgeav6mbkkdnaval9pmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb",e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),r=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var i=WebAssembly.validate(e)?t:n,a,o=WebAssembly.instantiate(s(i),{}).then(function(m){a=m.instance,a.exports.__wasm_call_ctors()});function s(m){for(var y=new Uint8Array(m.length),b=0;b<m.length;++b){var x=m.charCodeAt(b);y[b]=x>96?x-97:x>64?x-39:x+4}for(var w=0,b=0;b<m.length;++b)y[w++]=y[b]<60?r[y[b]]:(y[b]-60)*64+y[++b];return y.buffer.slice(0,w)}function u(m,y,b,x,w,M){var S=a.exports.sbrk,E=b+3&-4,B=S(E*x),R=S(w.length),C=new Uint8Array(a.exports.memory.buffer);C.set(w,R);var I=m(B,b,x,R,w.length);if(I==0&&M&&M(B,E,x),y.set(C.subarray(B,B+b*x)),S(B-S(0)),I!=0)throw new Error("Malformed buffer data: "+I)}var l={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},c={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},d=[],p=0;function A(m){var y={object:new Worker(m),pending:0,requests:{}};return y.object.onmessage=function(b){var x=b.data;y.pending-=x.count,y.requests[x.id][x.action](x.value),delete y.requests[x.id]},y}function h(m){for(var y="var instance; var ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(s(i))+"]), {}).then(function(result) { instance = result.instance; instance.exports.__wasm_call_ctors(); });self.onmessage = workerProcess;"+u.toString()+g.toString(),b=new Blob([y],{type:"text/javascript"}),x=URL.createObjectURL(b),w=0;w<m;++w)d[w]=A(x);URL.revokeObjectURL(x)}function v(m,y,b,x,w){for(var M=d[0],S=1;S<d.length;++S)d[S].pending<M.pending&&(M=d[S]);return new Promise(function(E,B){var R=new Uint8Array(b),C=p++;M.pending+=m,M.requests[C]={resolve:E,reject:B},M.object.postMessage({id:C,count:m,size:y,source:R,mode:x,filter:w},[R.buffer])})}function g(m){o.then(function(){var y=m.data;try{var b=new Uint8Array(y.count*y.size);u(a.exports[y.mode],b,y.count,y.size,y.source,a.exports[y.filter]),self.postMessage({id:y.id,count:y.count,action:"resolve",value:b},[b.buffer])}catch(x){self.postMessage({id:y.id,count:y.count,action:"reject",value:x})}})}return{ready:o,supported:!0,useWorkers:function(m){h(m)},decodeVertexBuffer:function(m,y,b,x,w){u(a.exports.meshopt_decodeVertexBuffer,m,y,b,x,a.exports[l[w]])},decodeIndexBuffer:function(m,y,b,x){u(a.exports.meshopt_decodeIndexBuffer,m,y,b,x)},decodeIndexSequence:function(m,y,b,x){u(a.exports.meshopt_decodeIndexSequence,m,y,b,x)},decodeGltfBuffer:function(m,y,b,x,w,M){u(a.exports[c[w]],m,y,b,x,a.exports[l[M]])},decodeGltfBufferAsync:function(m,y,b,x,w){return d.length>0?v(m,y,b,c[x],l[w]):o.then(function(){var M=new Uint8Array(m*y);return u(a.exports[c[x]],M,m,y,b,a.exports[l[w]]),M})}}}(),Ka="EXT_meshopt_compression",Rh=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadBufferView=function(e,r){var i=r.json,a=i.bufferViews[e];if(a.extensions&&a.extensions[Ka]){var o=a.extensions[Ka],s=r.loadBuffer(o.buffer);if(!Ga.supported){if(i.extensionsRequired&&i.extensionsRequired.indexOf(Ka)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([s,Ga.ready]).then(function(u){var l=u[0],c=o.byteOffset||0,d=o.byteLength||0,p=o.count,A=o.byteStride,h=new ArrayBuffer(p*A),v=new Uint8Array(l,c,d);return Ga.decodeGltfBuffer(new Uint8Array(h),p,A,v,o.mode,o.filter),h})}else return null},t}(Fr),i0="EXT_texture_webp",Bh=function(n){ue(t,n);function t(){var e=n!==null&&n.apply(this,arguments)||this;return e.supportsWep=!1,e}return t.prototype.prepare=function(e){var r=this;return vu().then(function(i){r.supportsWep=i.webp})},t.prototype.loadTexture=function(e,r){var i=r.json,a=i.textures[e];if(!a.extensions||!a.extensions[i0]||!this.supportsWep)return null;var o=a.extensions[i0];return r.loadImage(o.source).then(function(s){var u=new f.Texture(s);u.needsUpdate=!0,u.flipY=!1,a.name&&(u.name=a.name);var l=r.json.samplers||{},c=l[a.sampler]||{};return u.magFilter=oa[c.magFilter]||f.LinearFilter,u.minFilter=oa[c.minFilter]||f.LinearMipmapLinearFilter,u.wrapS=sa[c.wrapS]||f.RepeatWrapping,u.wrapT=sa[c.wrapT]||f.RepeatWrapping,u.onUpdate=function(){s.close()},u})},t}(Fr),_a="CESIUM_RTC",Fh=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.emitResult=function(e,r){if(r.json.extensions[_a]&&r.json.extensions[_a].center){var i=r.json.extensions[_a].center;e.CESIUM_RTC={center:new f.Vector3().fromArray(i)}}},t}(Fr),Lh=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadMesh=function(e,r){var i=this,a=r.json.meshes[e],o=a.primitives,s=Promise.all(o.map(function(c){return r.loadGeometry(c)})),u=Promise.all(o.map(function(c){return i.loadPBMMaterial(c,r)})),l=Promise.all([s,u]).then(function(c){for(var d=c[0],p=c[1],A=[],h=0;h<o.length;h++){var v=o[h],g=d[h],m=p[h];g.attributes.normal===void 0&&(m.flatShading=!0),g.attributes.tangent===void 0&&m.normalScale&&(m.normalScale.y*=-1);var y=v.mode||Ue.TRIANGLES,b=void 0;if(y===Ue.TRIANGLES||y===Ue.TRIANGLE_STRIP||y===Ue.TRIANGLE_FAN)if(y===Ue.TRIANGLE_STRIP?g=r.toGeometryTrianglesDrawMode(g,f.TriangleStripDrawMode):y===Ue.TRIANGLE_FAN&&(g=r.toGeometryTrianglesDrawMode(g,f.TriangleFanDrawMode)),g.clearGroups(),g.addGroup(0,g.index?g.index.count:g.attributes.position.count,0),r.disposeSet.add(g),a.isSkinnedMesh){var x=new gu(g,[m]);g.attributes.skinWeight.normalized||x.normalizeSkinWeights(),b=x}else b=new Ot(g,[m]);else if(y===Ue.POINTS)b=new yr(g,m);else throw new Error("glTF: Primitive mode unsupported: "+y);if(Object.keys(g.morphAttributes).length>0){if(a.weights!==void 0)for(var w=0,M=a.weights.length;w<M;w++)b.morphTargetInfluences[w]=a.weights[w];if(a.extras&&Array.isArray(a.extras.targetNames)){var S=a.extras.targetNames;if(b.morphTargetInfluences.length===S.length){b.morphTargetDictionary={};for(var w=0,M=S.length;w<M;w++)b.morphTargetDictionary[S[w]]=w}else console.warn("glTF: Invalid extras.targetNames length. Ignoring names.")}}b.name=r.createUniqueName(a.name||"mesh_"+e),A.push(b)}if(A.length===1)return A[0];for(var E=new f.Group,B=0,R=A;B<R.length;B++){var b=R[B];E.add(b)}return E});return l},t.prototype.loadPBMMaterial=function(e,r){var i,a=(i=e.mode)!==null&&i!==void 0?i:Ue.TRIANGLES,o=null;if(a===Ue.TRIANGLES||a===Ue.TRIANGLE_STRIP||a===Ue.TRIANGLE_FAN)o=this.loadPBMMeshMaterial(e,r);else if(a===Ue.POINTS)o=this.loadPBMPointCloudMaterial(e,r);else throw new Error("glTF: Primitive mode unsupported: "+a);return o},t.prototype.extendTexture=function(e,r,i){return e.minFilter=f.LinearFilter,e.magFilter=f.LinearFilter,e.generateMipmaps=!1,e},t.prototype.loadPBMPointCloudMaterial=function(e,r){var i=new Pi;return Object.keys(e.attributes).filter(function(a){return _t[a]==="normal"}).length>0&&(i.defines.USE_POINT_NORMAL=!0),r.disposeSet.add(i),Promise.resolve(i)},t.prototype.loadPBMMeshMaterial=function(e,r){var i=[],a=new br("basic");if(a.color=new f.Color(1,1,1),Object.keys(e.attributes).filter(function(c){return _t[c]==="color"}).length>0&&(a.vertexColors=!0),Object.keys(e.attributes).filter(function(c){return _t[c]==="tangent"}).length===0&&(a.normalScale&&(a.normalScale.y*=-1),a.clearcoatNormalScale&&(a.clearcoatNormalScale.y*=-1)),e.material!==void 0){var o=r.json.materials[e.material];o.name&&(a.name=o.name);var s=o.pbrMetallicRoughness||{};if(Array.isArray(s.baseColorFactor)){var u=s.baseColorFactor;a.color=new f.Color().fromArray(u)}if(s.baseColorTexture!==void 0&&i.push(r.createMaterialTexture(s.baseColorTexture).then(function(c){r.disposeSet.add(c),c.encoding=f.sRGBEncoding,a.map=c})),o.doubleSided===!0&&(a.side=f.DoubleSide),o.normalTexture!==void 0&&(i.push(r.createMaterialTexture(o.normalTexture).then(function(c){r.disposeSet.add(c),a.normalMap=c})),a.normalScale=new f.Vector2(1,1),o.normalTexture.scale!==void 0)){var l=o.normalTexture.scale;a.normalScale.set(l,l)}}return r.disposeSet.add(a),Promise.all(i).then(function(){return a.refreshUniforms(),a})},t}(Fr),yn={KHR_binary_glTF:hh,KHR_draco_mesh_compression:mh,KHR_texture_basisu:Eh,KHR_texture_transform:Ih,KHR_mesh_quantization:Th,KHR_materials_unlit:Ph,EXT_meshopt_compression:Rh,EXT_texture_webp:Bh,CESIUM_RTC:Fh,PBM_mesh:Lh};function es(n,t){var e,r,i,a={};if(t.addonExtensions)for(var o=0,s=t.addonExtensions;o<s.length;o++){var u=s[o];u in yn&&(a[u]=new yn[u])}var l,c;if(typeof n=="string")c=n;else{var d=yn.KHR_binary_glTF.getMagic(n);if(d===yn.KHR_binary_glTF.HEADER_MAGIC){l=new yn.KHR_binary_glTF;try{l.loadGlbBinary(n)}catch(m){return Promise.reject(m)}a.KHR_binary_glTF=l,c=l.content}else c=aa(new Uint8Array(n))}var p=JSON.parse(c);if(p.asset===void 0||Number(p.asset.version[0])<2)return Promise.reject(new Error("glTF: Unsupported asset. glTF versions >=2.0 are supported."));if(p.extensionsUsed)for(var A=p.extensionsRequired||[],h=0;h<p.extensionsUsed.length;h++){var v=p.extensionsUsed[h];a[v]||(yn[v]?a[v]=new yn[v]:A.indexOf(v)>=0&&console.warn('glTF: Unknown extension "'+v+'".'))}var g=new dh(p,a,{copyUV2:(e=t.copyUV2)!==null&&e!==void 0?e:!0,resourcePath:(r=t.resourcePath)!==null&&r!==void 0?r:"",search:(i=t.search)!==null&&i!==void 0?i:"",fetcher:t.fetcher});return g.parse().then(function(m){return l&&l.clear(),m})}var kh=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function Ju(n,t){var e,r;t===void 0&&(t={});var i=(e=t.upAxis)!==null&&e!==void 0?e:"Y",a=(r=t.fetcher)!==null&&r!==void 0?r:new qt({allowHosts:["*"]}),o={uri:n,gltfUpAxis:i};return Promise.resolve().then(function(){return a.ajax(n,{responseType:"arraybuffer"}).then(function(s){return s.body})}).then(function(s){return Promise.resolve(0).then(function(u){return Gu(o,s,u)}).then(function(u){return ju(o,s,u)}).then(function(u){return lh(o,s,u)})}).then(function(){var s;return es(o.gltfArrayBuffer,{copyUV2:!1,addonExtensions:["PBM_mesh"],resourcePath:n.slice(0,n.lastIndexOf("/")+1),search:(s=n.split("?")[1])!==null&&s!==void 0?s:"",fetcher:a}).then(function(u){var l=new f.Matrix4;i==="Y"&&l.premultiply(kh);var c=new f.Matrix4().setPosition(o.rtcCenter[0],o.rtcCenter[1],o.rtcCenter[2]);if(l.premultiply(c),u.CESIUM_RTC){var d=new f.Matrix4().setPosition(u.CESIUM_RTC.center);l.premultiply(d)}var p=u.scene;return p.applyMatrix4(l),delete o.featureTableBinary,delete o.batchTableBinary,delete o.gltfArrayBuffer,{type:"b3dm",upAxis:"Z",uri:o.uri,byteLength:o.byteLength,scene:p,textures:u.textures,dispose:function(){return u.dispose()}}})})}const Xu="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Z1bmN0aW9uIEIoYSl7b25tZXNzYWdlPWZ1bmN0aW9uKHIpe1Byb21pc2UucmVzb2x2ZShyLmRhdGEpLnRoZW4oZnVuY3Rpb24obil7cmV0dXJuIGEobil9KS50aGVuKGZ1bmN0aW9uKG4pe3ZhciBlPW4ub3V0cHV0LHQ9bi50cmFuc2ZlcjtyZXR1cm4gcG9zdE1lc3NhZ2UoZSx0KX0pLmNhdGNoKGZ1bmN0aW9uKG4pe3JldHVybiBwb3N0TWVzc2FnZSh7JCRlcnJvcjpufSl9KX19dmFyIHUseTsoZnVuY3Rpb24oYSl7YVthLkJZVEU9NTEyMF09IkJZ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cm9wZXJ0eSgiTk9STUFMIikpe2Zvcih2YXIgcj1hLmdldFByb3BlcnR5QXJyYXkoIk5PUk1BTCIseS5GTE9BVCwzKSxuPXIubGVuZ3RoLzMsZT1uZXcgSW50OEFycmF5KG4qNCksdD0wLGk9dm9pZCAwLG89dm9pZCAwO3Q8bjt0Kyspbz10KjQsaT10KjMsZVtvXT1yW2ldKmgsZVsrK29dPXJbKytpXSpoLGVbKytvXT1yWysraV0qaDtyZXR1cm57YXJyYXk6ZSxpdGVtU2l6ZTo0LG5vcm1hbGl6ZWQ6ITB9fWVsc2UgaWYoYS5oYXNQcm9wZXJ0eSgiTk9STUFMX09DVDE2UCIpKXtmb3IodmFyIHI9YS5nZXRQcm9wZXJ0eUFycmF5KCJOT1JNQUxfT0NUMTZQIix5LlVOU0lHTkVEX0JZVEUsMiksbj1yLmxlbmd0aC8yLGU9bmV3IEludDhBcnJheShuKjQpLHQ9MCx2PXZvaWQgMCxBPXZvaWQgMCxOPXZvaWQgMCxFPXZvaWQgMCxTPXZvaWQgMCxzPXZvaWQgMCxUPXZvaWQgMDt0PG47dCsrKXY9dCoyLEE9clt2XSpELTEsTj1yWysrdl0qRC0xLFM9QTwwPy1BOkEscz1OPDA/LU46TixFPTEtKFMrcyksRTwwJiYoQT0oMS1zKSooQTwwPy0xOjEpLE49KDEtUykqKE48MD8tMToxKSksVD1NYXRoLnNxcnQoQSpBK04qTitFKkUpLHY9dCo0LGVbdl09QS9UKmgsZVsrK3ZdPU4vVCpoLGVbKyt2XT1FL1QqaDtyZXR1cm57YXJyYXk6ZSxpdGVtU2l6ZTo0LG5vcm1hbGl6ZWQ6ITB9fXJldHVybiBudWxsfX0pKCk7Cg==",Oh=n=>Uint8Array.from(atob(n),t=>t.charCodeAt(0)),a0=typeof self!="undefined"&&self.Blob&&new Blob([Oh(Xu)],{type:"text/javascript;charset=utf-8"});function Dh(n){let t;try{if(t=a0&&(self.URL||self.webkitURL).createObjectURL(a0),!t)throw"";const e=new Worker(t,{name:n==null?void 0:n.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch(e){return new Worker("data:text/javascript;base64,"+Xu,{name:n==null?void 0:n.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var Vh=new Nu(function(){return new Dh},2);function Nh(n,t,e){var r=new Ku(n.featureTableJson,n.featureTableBinary);return Promise.resolve().then(function(){var i=r.getExtension("3DTILES_draco_point_compression");return i?zh(i,r):Vh.postMessage({featureTableBinary:r.buffer,featureTableJson:r.json},[r.buffer.buffer])}).then(function(i){return n.attributes=i,e})}function zh(n,t){return ha(this,void 0,void 0,function(){var e,r,i,a,o,s;return pa(this,function(u){if(e=n.properties||{},r=n.byteOffset,i=n.byteLength,!e||!Number.isFinite(r)||!i)throw new Error("Draco properties, byteOffset, and byteLength must be defined");return a=t.buffer.slice(r,r+i),o=n.properties,s={POSITION:"Float32Array",NORMAL:"Float32Array",RGB:"Uint8Array",RGBA:"Uint8Array"},[2,ua.decodeGeometry(a.buffer,{attributeIDs:o,attributeTypes:s,useUniqueIDs:!0}).then(function(l){var c=l.getAttribute("POSITION"),d=l.getAttribute("RGB"),p=l.getAttribute("RGBA"),A=l.getAttribute("NORMAL"),h;if(p)h=p;else if(d){for(var v=d.count,g=d.array,m=new Uint8Array(v*4),y=0,b=void 0,x=void 0;y<v;y++)x=y*4,b=y*3,m[x]=g[b],m[++x]=g[++b],m[++x]=g[++b];h=new f.BufferAttribute(m,4,d.normalized)}return{position:c?{array:c.array,itemSize:c.itemSize,normalized:c.normalized}:null,color:h?{array:h.array,itemSize:h.itemSize,normalized:h.normalized}:null,normal:A?{array:A.array,itemSize:A.itemSize,normalized:A.normalized}:null}})]})})}function Wu(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new qt({allowHosts:["*"]}),i={uri:n};return Promise.resolve().then(function(){return r.ajax(n,{responseType:"arraybuffer"}).then(function(a){return a.body})}).then(function(a){return Promise.resolve(0).then(function(o){return Gu(i,a,o)}).then(function(o){return ju(i,a,o)}).then(function(o){return Nh(i,a,o)})}).then(function(){var a;return Qh(i.attributes,{computeBoundingBox:(a=t.computeBoundingBox)!==null&&a!==void 0?a:!0})}).then(function(a){var o=new f.Matrix4,s=new f.Matrix4().setPosition(i.rtcCenter[0],i.rtcCenter[1],i.rtcCenter[2]);return o.premultiply(s),a.object.applyMatrix4(o),delete i.gltfArrayBuffer,delete i.featureTableBinary,delete i.batchTableBinary,{type:"pnts",upAxis:"Z",uri:i.uri,byteLength:i.byteLength,scene:a.object,textures:[],dispose:function(){return a.dispose()}}})}function Qh(n,t){var e=new Set,r=new f.BufferGeometry;e.add(r);var i=new Pi;e.add(i),n.position&&r.setAttribute("position",new f.BufferAttribute(n.position.array,n.position.itemSize,n.position.normalized)),n.color&&r.setAttribute("color",new f.BufferAttribute(n.color.array,n.color.itemSize,n.color.normalized)),n.normal&&(r.setAttribute("normal",new f.BufferAttribute(n.normal.array,n.normal.itemSize,n.normal.normalized)),i.defines.USE_POINT_NORMAL=!0),t.computeBoundingBox&&r.computeBoundingBox();var a=new yr(r,i);return a.matrix.compose(a.position,a.quaternion,a.scale),a.matrixAutoUpdate=!1,a.frustumCulled=!1,Promise.resolve({object:a,dispose:function(){e.forEach(function(o){o.dispose()}),e.clear()}})}function Zu(){var n={};return n.OutWindow=function(){this._windowSize=0},n.OutWindow.prototype.create=function(t){(!this._buffer||this._windowSize!==t)&&(this._buffer=[]),this._windowSize=t,this._pos=0,this._streamPos=0},n.OutWindow.prototype.flush=function(){var t=this._pos-this._streamPos;if(t!==0){for(;t--;)this._stream.writeByte(this._buffer[this._streamPos++]);this._pos>=this._windowSize&&(this._pos=0),this._streamPos=this._pos}},n.OutWindow.prototype.releaseStream=function(){this.flush(),this._stream=null},n.OutWindow.prototype.setStream=function(t){this.releaseStream(),this._stream=t},n.OutWindow.prototype.init=function(t){t||(this._streamPos=0,this._pos=0)},n.OutWindow.prototype.copyBlock=function(t,e){var r=this._pos-t-1;for(r<0&&(r+=this._windowSize);e--;)r>=this._windowSize&&(r=0),this._buffer[this._pos++]=this._buffer[r++],this._pos>=this._windowSize&&this.flush()},n.OutWindow.prototype.putByte=function(t){this._buffer[this._pos++]=t,this._pos>=this._windowSize&&this.flush()},n.OutWindow.prototype.getByte=function(t){var e=this._pos-t-1;return e<0&&(e+=this._windowSize),this._buffer[e]},n.RangeDecoder=function(){},n.RangeDecoder.prototype.setStream=function(t){this._stream=t},n.RangeDecoder.prototype.releaseStream=function(){this._stream=null},n.RangeDecoder.prototype.init=function(){var t=5;for(this._code=0,this._range=-1;t--;)this._code=this._code<<8|this._stream.readByte()},n.RangeDecoder.prototype.decodeDirectBits=function(t){for(var e=0,r=t,i;r--;)this._range>>>=1,i=this._code-this._range>>>31,this._code-=this._range&i-1,e=e<<1|1-i,this._range&4278190080||(this._code=this._code<<8|this._stream.readByte(),this._range<<=8);return e},n.RangeDecoder.prototype.decodeBit=function(t,e){var r=t[e],i=(this._range>>>11)*r;return(this._code^2147483648)<(i^2147483648)?(this._range=i,t[e]+=2048-r>>>5,this._range&4278190080||(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),0):(this._range-=i,this._code-=i,t[e]-=r>>>5,this._range&4278190080||(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),1)},n.initBitModels=function(t,e){for(;e--;)t[e]=1024},n.BitTreeDecoder=function(t){this._models=[],this._numBitLevels=t},n.BitTreeDecoder.prototype.init=function(){n.initBitModels(this._models,1<<this._numBitLevels)},n.BitTreeDecoder.prototype.decode=function(t){for(var e=1,r=this._numBitLevels;r--;)e=e<<1|t.decodeBit(this._models,e);return e-(1<<this._numBitLevels)},n.BitTreeDecoder.prototype.reverseDecode=function(t){for(var e=1,r=0,i=0,a;i<this._numBitLevels;++i)a=t.decodeBit(this._models,e),e=e<<1|a,r|=a<<i;return r},n.reverseDecode2=function(t,e,r,i){for(var a=1,o=0,s=0,u;s<i;++s)u=r.decodeBit(t,e+a),a=a<<1|u,o|=u<<s;return o},n.LenDecoder=function(){this._choice=[],this._lowCoder=[],this._midCoder=[],this._highCoder=new n.BitTreeDecoder(8),this._numPosStates=0},n.LenDecoder.prototype.create=function(t){for(;this._numPosStates<t;++this._numPosStates)this._lowCoder[this._numPosStates]=new n.BitTreeDecoder(3),this._midCoder[this._numPosStates]=new n.BitTreeDecoder(3)},n.LenDecoder.prototype.init=function(){var t=this._numPosStates;for(n.initBitModels(this._choice,2);t--;)this._lowCoder[t].init(),this._midCoder[t].init();this._highCoder.init()},n.LenDecoder.prototype.decode=function(t,e){return t.decodeBit(this._choice,0)===0?this._lowCoder[e].decode(t):t.decodeBit(this._choice,1)===0?8+this._midCoder[e].decode(t):16+this._highCoder.decode(t)},n.Decoder2=function(){this._decoders=[]},n.Decoder2.prototype.init=function(){n.initBitModels(this._decoders,768)},n.Decoder2.prototype.decodeNormal=function(t){var e=1;do e=e<<1|t.decodeBit(this._decoders,e);while(e<256);return e&255},n.Decoder2.prototype.decodeWithMatchByte=function(t,e){var r=1,i,a;do if(i=e>>7&1,e<<=1,a=t.decodeBit(this._decoders,(1+i<<8)+r),r=r<<1|a,i!==a){for(;r<256;)r=r<<1|t.decodeBit(this._decoders,r);break}while(r<256);return r&255},n.LiteralDecoder=function(){},n.LiteralDecoder.prototype.create=function(t,e){var r;if(!(this._coders&&this._numPrevBits===e&&this._numPosBits===t))for(this._numPosBits=t,this._posMask=(1<<t)-1,this._numPrevBits=e,this._coders=[],r=1<<this._numPrevBits+this._numPosBits;r--;)this._coders[r]=new n.Decoder2},n.LiteralDecoder.prototype.init=function(){for(var t=1<<this._numPrevBits+this._numPosBits;t--;)this._coders[t].init()},n.LiteralDecoder.prototype.getDecoder=function(t,e){return this._coders[((t&this._posMask)<<this._numPrevBits)+((e&255)>>>8-this._numPrevBits)]},n.Decoder=function(){this._outWindow=new n.OutWindow,this._rangeDecoder=new n.RangeDecoder,this._isMatchDecoders=[],this._isRepDecoders=[],this._isRepG0Decoders=[],this._isRepG1Decoders=[],this._isRepG2Decoders=[],this._isRep0LongDecoders=[],this._posSlotDecoder=[],this._posDecoders=[],this._posAlignDecoder=new n.BitTreeDecoder(4),this._lenDecoder=new n.LenDecoder,this._repLenDecoder=new n.LenDecoder,this._literalDecoder=new n.LiteralDecoder,this._dictionarySize=-1,this._dictionarySizeCheck=-1,this._posSlotDecoder[0]=new n.BitTreeDecoder(6),this._posSlotDecoder[1]=new n.BitTreeDecoder(6),this._posSlotDecoder[2]=new n.BitTreeDecoder(6),this._posSlotDecoder[3]=new n.BitTreeDecoder(6)},n.Decoder.prototype.setDictionarySize=function(t){return t<0?!1:(this._dictionarySize!==t&&(this._dictionarySize=t,this._dictionarySizeCheck=Math.max(this._dictionarySize,1),this._outWindow.create(Math.max(this._dictionarySizeCheck,4096))),!0)},n.Decoder.prototype.setLcLpPb=function(t,e,r){var i=1<<r;return t>8||e>4||r>4?!1:(this._literalDecoder.create(e,t),this._lenDecoder.create(i),this._repLenDecoder.create(i),this._posStateMask=i-1,!0)},n.Decoder.prototype.init=function(){var t=4;for(this._outWindow.init(!1),n.initBitModels(this._isMatchDecoders,192),n.initBitModels(this._isRep0LongDecoders,192),n.initBitModels(this._isRepDecoders,12),n.initBitModels(this._isRepG0Decoders,12),n.initBitModels(this._isRepG1Decoders,12),n.initBitModels(this._isRepG2Decoders,12),n.initBitModels(this._posDecoders,114),this._literalDecoder.init();t--;)this._posSlotDecoder[t].init();this._lenDecoder.init(),this._repLenDecoder.init(),this._posAlignDecoder.init(),this._rangeDecoder.init()},n.Decoder.prototype.decode=function(t,e,r){var i=0,a=0,o=0,s=0,u=0,l=0,c=0,d,p,A,h,v,g;for(this._rangeDecoder.setStream(t),this._outWindow.setStream(e),this.init();r<0||l<r;)if(d=l&this._posStateMask,this._rangeDecoder.decodeBit(this._isMatchDecoders,(i<<4)+d)===0)p=this._literalDecoder.getDecoder(l++,c),i>=7?c=p.decodeWithMatchByte(this._rangeDecoder,this._outWindow.getByte(a)):c=p.decodeNormal(this._rangeDecoder),this._outWindow.putByte(c),i=i<4?0:i-(i<10?3:6);else{if(this._rangeDecoder.decodeBit(this._isRepDecoders,i)===1)A=0,this._rangeDecoder.decodeBit(this._isRepG0Decoders,i)===0?this._rangeDecoder.decodeBit(this._isRep0LongDecoders,(i<<4)+d)===0&&(i=i<7?9:11,A=1):(this._rangeDecoder.decodeBit(this._isRepG1Decoders,i)===0?h=o:(this._rangeDecoder.decodeBit(this._isRepG2Decoders,i)===0?h=s:(h=u,u=s),s=o),o=a,a=h),A===0&&(A=2+this._repLenDecoder.decode(this._rangeDecoder,d),i=i<7?8:11);else if(u=s,s=o,o=a,A=2+this._lenDecoder.decode(this._rangeDecoder,d),i=i<7?7:10,v=this._posSlotDecoder[A<=5?A-2:3].decode(this._rangeDecoder),v>=4){if(g=(v>>1)-1,a=(2|v&1)<<g,v<14)a+=n.reverseDecode2(this._posDecoders,a-v-1,this._rangeDecoder,g);else if(a+=this._rangeDecoder.decodeDirectBits(g-4)<<4,a+=this._posAlignDecoder.reverseDecode(this._rangeDecoder),a<0){if(a===-1)break;return!1}}else a=v;if(a>=l||a>=this._dictionarySizeCheck)return!1;this._outWindow.copyBlock(a,A),l+=A,c=this._outWindow.getByte(0)}return this._outWindow.flush(),this._outWindow.releaseStream(),this._rangeDecoder.releaseStream(),!0},n.Decoder.prototype.setDecoderProperties=function(t){var e,r,i,a,o;return t.size<5||(e=t.readByte(),r=e%9,e=~~(e/9),i=e%5,a=~~(e/5),!this.setLcLpPb(r,i,a))?!1:(o=t.readByte(),o|=t.readByte()<<8,o|=t.readByte()<<16,o+=t.readByte()*16777216,this.setDictionarySize(o))},n.decompress=function(t,e,r,i){var a=new n.Decoder;if(!a.setDecoderProperties(t))throw"Incorrect stream properties";if(!a.decode(e,r,i))throw"Error in data stream";return!0},n.decompressFile=function(t,e){var r=new n.Decoder,i;if(!r.setDecoderProperties(t))throw"Incorrect stream properties";if(i=t.readByte(),i|=t.readByte()<<8,i|=t.readByte()<<16,i+=t.readByte()*16777216,t.readByte(),t.readByte(),t.readByte(),t.readByte(),!r.decode(t,e,i))throw"Error in data stream";return!0},n}var Uh=Zu();function qh(){function n(e){for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(256),a=0;a<r.length;a++)i[r.charCodeAt(a)]=a;var o=e.length*.75,s=e.length,u,l=0,c,d,p,A;e[e.length-1]==="="&&(o--,e[e.length-2]==="="&&o--);var h=new ArrayBuffer(o),v=new Uint8Array(h);for(u=0;u<s;u+=4)c=i[e.charCodeAt(u)],d=i[e.charCodeAt(u+1)],p=i[e.charCodeAt(u+2)],A=i[e.charCodeAt(u+3)],v[l++]=c<<2|d>>4,v[l++]=(d&15)<<4|p>>2,v[l++]=(p&3)<<6|A&63;return h}var t="AGFzbQEAAAABSg1gAABgAX8Bf2ACf38Bf2AEf39/fwBgA39/fwBgAX8AYAJ/fwBgA39/fwF/YAR/f39/AX9gAn9/AGABfwF/YAABf2AEf39/fwF/AhsCA2VudgVhYm9ydAADA2VudgZtZW1vcnkCAAEDJiUBAQkKAgoKCwsLCwsAAgoBAgQKAQYFCAoFBQQEBwgCBwwCAQAABAQBcAABBhoFfwFBAAt/AUEAC38BQQALfwFBAAt/AUEACwc9BgZtZW1vcnkCAAV0YWJsZQEABXJlc2V0AA0KbmV3VThBcnJheQAQCnVucGFja1NpemUAFAZkZWNvZGUAIwgBJAkHAQBBAAsBJQqAViVoAQN/IABBgICAgARLBEAACyMBIgEgAEEBIABBAUsbakEHakF4cSICPwAiA0EQdEsEQCADIAIgAWtB//8DakGAgHxxQRB2IgAgAyAAShtAAEEASARAIABAAEEASARAAAsLCyACJAEgAQsbAQF/QQFBICAAQQdqZ2t0EAEiASAANgIAIAELkQMBAX8gAUUEQA8LIABBADoAACAAIAFqQQFrQQA6AAAgAUECTQRADwsgAEEBakEAOgAAIABBAmpBADoAACAAIAFqIgJBAmtBADoAACACQQNrQQA6AAAgAUEGTQRADwsgAEEDakEAOgAAIAAgAWpBBGtBADoAACABQQhNBEAPC0EAIABrQQNxIgIgAGoiAEEANgIAIAEgAmtBfHEiASAAakEEa0EANgIAIAFBCE0EQA8LIABBBGpBADYCACAAQQhqQQA2AgAgACABaiICQQxrQQA2AgAgAkEIa0EANgIAIAFBGE0EQA8LIABBDGpBADYCACAAQRBqQQA2AgAgAEEUakEANgIAIABBGGpBADYCACAAIAFqIgJBHGtBADYCACACQRhrQQA2AgAgAkEUa0EANgIAIAJBEGtBADYCACAAQQRxQRhqIgIgAGohACABIAJrIQEDQCABQSBPBEAgAEIANwMAIABBCGpCADcDACAAQRBqQgA3AwAgAEEYakIANwMAIAFBIGshASAAQSBqIQAMAQsLC1EBA38gAEH+////AEsEQEEAQSBBLUEnEAAACyAAQQJ0IgMQAiECQQgQASIBQQA2AgAgAUEANgIEIAEgAjYCACABIAA2AgQgAkEIaiADEAMgAQtmAQF/IAFB/P///wFLBEBBAEHAAEEXQSIQAAALIAFBAXQiARACIgJBCGogARADIABFBEBBDBABIQALIABBADYCACAAQQA2AgQgAEEANgIIIAAgAjYCACAAQQA2AgQgACABNgIIIAALCgBBDBABIAAQBQsuAQF/QQgQASIBQQA2AgAgAUEANgIEIAEgADYCBCABQQEgASgCBHQQBjYCACABC6EBAQR/QRAQASIBQQA2AgAgAUEANgIEIAFBADYCCCABQQA2AgxBEBAEIQIDQCAAQRBIBEBBAxAHIQMgAigCACAAQQJ0aiADNgIIIABBAWohAAwBCwsgASACNgIEQRAQBCECQQAhAANAIABBEEgEQEEDEAchAyACKAIAIABBAnRqIAM2AgggAEEBaiEADAELCyABIAI2AgggAUEIEAc2AgwgAQs0AQF/QRQQASIAQQA2AgAgAEEAOgAEIABBADYCCCAAQQA2AgwgAEEANgIQIABBDTYCCCAAC0IBAX9BGRABIgBBADYCACAAQQA2AgQgAEEANgIIIABBADYCDCAAQQA2AhAgAEEANgIUIABBADoAGCAAQQA2AhAgAAu1AgEEf0HQABABIgBBADoAACAAQQA2AgQgAEEANg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AAdQBzAGUAIABzAHQAcgBpAGMAdABBIAsdDQAAAH4AbABpAGIALwBhAHIAcgBhAHkALgB0AHMAQcAACzkbAAAAfgBsAGkAYgAvAGkAbgB0AGUAcgBuAGEAbAAvAHQAeQBwAGUAZABhAHIAcgBhAHkALgB0AHMAQYABCzMYAAAAcwByAGMALwBsAHoAbQBhAC8AbAB6AG0AYQAtAGQAZQBjAG8AZABlAHIALgB0AHM=";return n(t)}function Hh(n,t,e){try{var r={data:t,offset:0,readByte:function(){return this.data[this.offset++]}},i=r.data.length,a={data:[],offset:0,writeByte:function(u){var l=Math.floor(this.offset/i);this.data[l]||(this.data[l]=new Uint8Array(i)),this.data[l][this.offset%i]=u,this.offset++}};n.decompressFile(r,a);for(var o=new Uint8Array(a.offset),s=0;s<a.offset;s++)o[s]=a.data[Math.floor(s/i)][s%i];e(null,o)}catch(u){e(u)}}function Gh(n,t,e){var r=24;try{var i=new WebAssembly.Memory({initial:16}),a=new WebAssembly.Module(n),o=new WebAssembly.Instance(a,{env:{memory:i,abort:function(){e(new Error("webAssembly abort"))}}}),s=o.exports,u=s.newU8Array(t.length),l=new Uint8Array(i.buffer,u+r,t.length);l.set(t);var c=s.decode(u),d=new Uint32Array(i.buffer,c,4),p=d[0],A=d[2],h=d[3];p?e(null,new Uint8Array(i.buffer,h+r,A).slice(0,A)):e(new Error("lzma deocder error"))}catch(v){e(v)}}var Kh=`
|
|
884
884
|
var decodeLZMA = (function() {
|
|
885
885
|
var LZMA = (`.concat(Zu.toString(),`)();
|
|
886
886
|
return function(data, callback) {
|
|
@@ -925,13 +925,13 @@ self.onmessage = function(event) {
|
|
|
925
925
|
}
|
|
926
926
|
postMessage({ id: packet.id, error: "type never matched." });
|
|
927
927
|
};
|
|
928
|
-
`),Co=typeof Worker!="undefined"&&typeof Blob!="undefined",Yu="";if(Co)try{var jh=new Blob([Kh],{type:"text/javascript"});Yu=URL.createObjectURL(jh)}catch(n){}var $u=function(){function n(){var t=this;if(!Co)throw new Error("LZMAWorker cannot work in this broswer.");this.callCounter=0,this.requests={};var e=this.worker=new Worker(Yu);e.onmessage=function(r){var i=r.data,a=i.id,o=i.result,s=i.error,u=t.getKey(a);t.requests[u]&&(s?t.requests[u](new Error(s)):t.requests[u](null,o),delete t.requests[u])},e.onerror=function(r){return console.error(r)}}return n.prototype.getKey=function(t){return"key_"+String(t)},n.prototype.decompress=function(t,e){var r=++this.callCounter;this.requests[this.getKey(r)]=e,this.worker.postMessage({type:"decompress",id:r,data:t},[t.buffer])},n.prototype.terminate=function(){this.worker.terminate()},n.support=Co,n}();function o0(n){return Array.prototype.reduce.call(n,function(t,e,r){return t|e<<r*8},0)}function _h(n){for(var t=[],e=n.length,r=function(o){var s={data:n[o],offset:0,readByte:function(){return this.data[this.offset++]}},u=s.data.length,l={data:[],offset:0,writeByte:function(d){var p=Math.floor(this.offset/u);this.data[p]||(this.data[p]=new Uint8Array(u)),this.data[p][this.offset%u]=d,this.offset++}};Uh.decompressFile(s,l),i=new Uint8Array(l.offset);for(var c=0;c<l.offset;c++)i[c]=l.data[Math.floor(c/u)][c%u];t.push(i)},i,a=0;a<e;a++)r(a);return t}function Jh(n){for(var t=[],e=n.length,r=function(a){t.push(new Promise(function(o,s){var u=new $u;u.decompress(n[a],function(l,c){if(u.terminate(),l)return s(l);o(c)})}))},i=0;i<e;i++)r(i);return Promise.all(t)}function el(n){var t=new Uint8Array(n),e=o0(t.slice(0,4));if(e>10)return Promise.reject(new Error("LZMA got too many sub chunks."));for(var r=[],i=[],a=4+e*4,o=0;o<e;o++)i[o]=o0(t.slice(4+o*4,8+o*4)),o===e-1?r[o]=t.subarray(a,a+i[o]):r[o]=t.slice(a,a+i[o]),a+=i[o];return $u.support?Jh(r):Promise.resolve(_h(r))}var _a=!1,tl=[];function rl(n){if(n===void 0&&(n=!1),!(!n&&_a)){_a=!0;var t=tl.shift();if(t){try{t()}catch(e){}Mt.shared.add(function(){return rl(!0)},!0,2,-100)}else _a=!1}}function la(n){return new Promise(function(t,e){var r=function(){try{t(n())}catch(i){e(i)}};tl.push(r),Mt.shared.add(function(){return rl()},!0,2,-100)})}const pn=dn.Reader,gr=dn.util,ir=dn.roots["@REALSEE/FIVE:five/loaders/model/parsers/protobuf/pbm.proto"]||(dn.roots["@REALSEE/FIVE:five/loaders/model/parsers/protobuf/pbm.proto"]={}),nl=ir.Model=(()=>{function n(t){if(this.chunks=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.chunks=gr.emptyArray,n.prototype.createAt=gr.Long?gr.Long.fromBits(0,0,!0):0,n.prototype.description="",n.decode=function(e,r){e instanceof pn||(e=pn.create(e));let i=r===void 0?e.len:e.pos+r,a=new ir.Model;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.chunks&&a.chunks.length||(a.chunks=[]),a.chunks.push(ir.Chunk.decode(e,e.uint32()));break}case 2:{a.createAt=e.uint64();break}case 3:{a.description=e.string();break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Model"},n})();ir.Chunk=(()=>{function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.vertices=null,n.prototype.faces=null,n.prototype.name="",n.prototype.texture="",n.decode=function(e,r){e instanceof pn||(e=pn.create(e));let i=r===void 0?e.len:e.pos+r,a=new ir.Chunk;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.vertices=ir.Vertices.decode(e,e.uint32());break}case 2:{a.faces=ir.Faces.decode(e,e.uint32());break}case 3:{a.name=e.string();break}case 4:{a.texture=e.string();break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("vertices"))throw gr.ProtocolError("missing required 'vertices'",{instance:a});if(!a.hasOwnProperty("faces"))throw gr.ProtocolError("missing required 'faces'",{instance:a});if(!a.hasOwnProperty("name"))throw gr.ProtocolError("missing required 'name'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();ir.Vertices=(()=>{function n(t){if(this.xyz=[],this.uvs=[],this.marks=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.xyz=gr.emptyArray,n.prototype.uvs=gr.emptyArray,n.prototype.marks=gr.emptyArray,n.decode=function(e,r){e instanceof pn||(e=pn.create(e));let i=r===void 0?e.len:e.pos+r,a=new ir.Vertices;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.xyz&&a.xyz.length||(a.xyz=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.xyz.push(e.float())}else a.xyz.push(e.float());break}case 2:{if(a.uvs&&a.uvs.length||(a.uvs=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.uvs.push(e.float())}else a.uvs.push(e.float());break}case 3:{if(a.marks&&a.marks.length||(a.marks=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.marks.push(e.int32())}else a.marks.push(e.int32());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Vertices"},n})();ir.Faces=(()=>{function n(t){if(this.indices=[],this.normals=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.indices=gr.emptyArray,n.prototype.normals=gr.emptyArray,n.decode=function(e,r){e instanceof pn||(e=pn.create(e));let i=r===void 0?e.len:e.pos+r,a=new ir.Faces;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.indices&&a.indices.length||(a.indices=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.indices.push(e.uint32())}else a.indices.push(e.uint32());break}case 2:{if(a.normals&&a.normals.length||(a.normals=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.normals.push(e.float())}else a.normals.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Faces"},n})();ir.VertexMark=(()=>{const n={},t=Object.create(n);return t[n[0]="VERTEX_MARK_UNSPECIFIED"]=0,t[n[1]="VERTEX_MARK_ROOF"]=1,t})();function il(n,t){var e,r,i,a;t===void 0&&(t={});var o=(e=t.fetcher)!==null&&e!==void 0?e:new Ut({allowHosts:["*"]}),s={byteLength:0},u=rs((r=t.textureOptions)!==null&&r!==void 0?r:{},(a=(i=t.textureArray)===null||i===void 0?void 0:i.length)!==null&&a!==void 0?a:0),l={};if(t.textureArray)for(var c=0,d=t.textureArray;c<d.length;c++){var p=d[c];l[p]=ts(p,u,o)}return Promise.resolve().then(function(){return o.ajax(n,{responseType:"arraybuffer"})}).then(function(A){return s.byteLength=A.body.byteLength,la(function(){var h=new Uint8Array(A.body);return nl.decode(h)})}).then(function(A){return la(function(){var h,v;return ol(A,(h=t.textureBaseUri)!==null&&h!==void 0?h:function(){var g=n.lastIndexOf("/");if(g>=0){var m=n.slice(0,g)+"/";return/\/model\/$/.test(m)&&(m=m.replace(/\/model\/$/,"/materials/")),m}return""}(),((v=t.textureArray)!==null&&v!==void 0?v:[]).slice(),u,l,o)})}).then(function(A){var h=new f.Group;h.matrixAutoUpdate=!1,h.matrix.compose(h.position,h.quaternion,h.scale),h.name=n;for(var v=0,g=A.objects;v<g.length;v++){var m=g[v];h.add(m)}return{type:"pbm",upAxis:"Z",uri:n,byteLength:s.byteLength,scene:h,textures:A.textures,dispose:function(){return A.dispose()}}})}function al(n){var t=n.match(/(group|floor)-?(\d+)/);return t?parseInt(t[2],10):0}function Eo(n){var t=n.match(/(chunk)-?(\d+)/);return t?parseInt(t[2],10):0}function Xh(n){var t=n.match(/(sub)-?(\d+)/);return t?parseInt(t[2],10):0}function s0(n){var t=al(n.name),e=Eo(n.name),r=Xh(n.name);return t*1e6+e*1e3+r}function Wh(n){for(var t,e,r,i=typeof n.createAt=="number"?n.createAt:0,a=(t=n.description)!==null&&t!==void 0?t:"",o=[],s=!0,u=!0,l=0,c=n.chunks;l<c.length;l++){var d=c[l];if(!d.vertices.marks||d.vertices.marks.length===0){u=!1;break}}for(var p=0,A=n.chunks;p<A.length;p++){var d=A[p];if(!d.faces.normals||d.faces.normals.length===0){s=!1;break}}for(var h=n.chunks.sort(function(ie,xe){return s0(ie)-s0(xe)}),v=[],g=0,m=h;g<m.length;g++){var d=m[g],y=al(d.name);v[y]||(v[y]=[]),v[y].push(d)}for(var b=0;b<v.length;b++){var x=v[b];if(x)if(s){for(var w=0,M=0;M<x.length;M++){var d=x[M];w+=d.faces.indices.length}for(var S=new Float32Array(w*3),E=new Float32Array(w*2),P=new Float32Array(w*3),B=u?new Float32Array(w):void 0,C=[],I=[1/0,1/0,1/0,-1/0,-1/0,-1/0],F=0,T=0;T<x.length;T++){for(var L=[1/0,1/0,1/0,-1/0,-1/0,-1/0],d=x[T],D=d.vertices.xyz,V=d.vertices.uvs,z=d.faces.indices,U=d.faces.normals,q=d.vertices.marks,G=z.length,M=0;M<G;M++){var K=z[M],_=S[F*3+M*3]=D[K*3],J=S[F*3+M*3+1]=D[K*3+1],W=S[F*3+M*3+2]=D[K*3+2];B&&(B[F+M]=q[K]),E[F*2+M*2]=V[K*2],E[F*2+M*2+1]=V[K*2+1];var $=Math.floor(M/3)*3;P[F*3+M*3]=U[$],P[F*3+M*3+1]=U[$+1],P[F*3+M*3+2]=U[$+2],_<L[0]&&(L[0]=_),J<L[1]&&(L[1]=J),W<L[2]&&(L[2]=W),_>L[3]&&(L[3]=_),J>L[4]&&(L[4]=J),W>L[5]&&(L[5]=W)}L[0]<I[0]&&(I[0]=L[0]),L[1]<I[1]&&(I[1]=L[1]),L[2]<I[2]&&(I[2]=L[2]),L[3]>I[3]&&(I[3]=L[3]),L[4]>I[4]&&(I[4]=L[4]),L[5]>I[5]&&(I[5]=L[5]),C.push({materialIndex:T,name:d.name,chunkName:Eo(d.name),start:F,count:d.faces.indices.length,texture:(e=d.texture)!==null&&e!==void 0?e:void 0}),F+=G}var Y={createAt:i,description:a,vertices:S,uvs:E,normals:P,masks:B,indices:null,floorIndex:b,groups:C,extents:I};o.push(Y)}else{for(var w=0,Z=0,M=0;M<x.length;M++){var d=x[M];Z+=d.vertices.xyz.length/3,w+=d.faces.indices.length}for(var S=new Float32Array(Z*3),E=new Float32Array(Z*2),P=void 0,oe=new Float32Array(Z),ne=new Uint32Array(w),B=u?new Float32Array(w):void 0,C=[],I=[1/0,1/0,1/0,-1/0,-1/0,-1/0],de=0,F=0,T=0;T<x.length;T++){for(var L=[1/0,1/0,1/0,-1/0,-1/0,-1/0],d=x[T],D=d.vertices.xyz,se=d.vertices.marks,V=d.vertices.uvs,z=d.faces.indices,ye=D.length/3,G=z.length,M=0;M<ye;M++){var _=S[F*3+M*3]=D[M*3],J=S[F*3+M*3+1]=D[M*3+1],W=S[F*3+M*3+2]=D[M*3+2];B&&(B[F+M]=se[M]),E[F*2+M*2]=V[M*2],E[F*2+M*2+1]=V[M*2+1],oe[F+M]=b,_<L[0]&&(L[0]=_),J<L[1]&&(L[1]=J),W<L[2]&&(L[2]=W),_>L[3]&&(L[3]=_),J>L[4]&&(L[4]=J),W>L[5]&&(L[5]=W)}L[0]<I[0]&&(I[0]=L[0]),L[1]<I[1]&&(I[1]=L[1]),L[2]<I[2]&&(I[2]=L[2]),L[3]>I[3]&&(I[3]=L[3]),L[4]>I[4]&&(I[4]=L[4]),L[5]>I[5]&&(I[5]=L[5]);for(var M=0;M<G;M++)ne[de+M]=F+z[M];C.push({materialIndex:T,name:d.name,chunkName:Eo(d.name),start:de,count:d.faces.indices.length,texture:(r=d.texture)!==null&&r!==void 0?r:void 0}),F+=ye,de+=G}var Y={createAt:i,description:a,vertices:S,uvs:E,normals:P,masks:B,indices:ne,floorIndex:b,groups:C,extents:I};o.push(Y)}}return o}function ts(n,t,e){var r=O({key:"texture.pbm"},_t(t,["format","quality","size","sharpen","mappings"])),i=new Xn,a=i.loadTexture(n,{imageURL:{transform:t.transform,options:r},encoding:f.sRGBEncoding,wrapS:f.ClampToEdgeWrapping,wrapT:f.ClampToEdgeWrapping,minFilter:f.LinearFilter,maxSize:typeof r.size=="number"?new f.Vector2(r.size,r.size):void 0,fetcher:e}).then(function(o){var s=o.body;return s.needsUpdate=!0,s});return Object.assign(a,{url:n,textureOptions:t})}function ol(n,t,e,r,i,a){i===void 0&&(i={});for(var o=Wh(n),s=0,u="",l=[],c={},d=new Set,p=0,A=o;p<A.length;p++){var h=A[p],v=h.createAt,g=h.description,m=h.vertices,y=h.masks,b=h.uvs,x=h.normals,w=h.indices,M=h.floorIndex,S=h.groups,E=h.extents,P=new f.Box3;P.min.x=E[0],P.min.y=E[1],P.min.z=E[2],P.max.x=E[3],P.max.y=E[4],P.max.z=E[5];var B=new f.BufferGeometry;B.setAttribute("position",new f.BufferAttribute(m,3)),B.setAttribute("uv",new f.BufferAttribute(b,2)),x&&B.setAttribute("normal",new f.BufferAttribute(x,3)),y&&B.setAttribute("mask",new f.BufferAttribute(y,1)),w&&B.setIndex(new f.BufferAttribute(w,1)),B.boundingBox=P,B.boundingSphere=P.getBoundingSphere(new f.Sphere);for(var C=0,I=S;C<I.length;C++){var F=I[C];B.addGroup(F.start,F.count,F.materialIndex)}d.add(B);for(var T=[],L=0,D=S;L<D.length;L++){var F=D[L],V=e[F.chunkName]||(F.texture?st(t||"",F.texture):void 0),z=new br("basic");z.floor=M,B.attributes.normal===void 0&&(z.flatShading=!0),B.attributes.mask&&(z.defines.USE_VERTEX_MARK=!0),T.push(z),V?c[V]?c[V].push(z):c[V]=[z]:z.color=new f.Color(16777215),d.add(z),z.refreshUniforms()}var U=new Ot(B,T);U.name="model_floor_"+M,U.userData.createAt=v,U.userData.description=g,U.matrix.compose(U.position,U.quaternion,U.scale),U.matrixAutoUpdate=!1,U.frustumCulled=!1,s=v,u=g,l.push(U)}var q=function(G){G=rs(G,e.length);for(var K=[],_=function(Y){var Z=null;Y in i&&(Z=i[Y]),Z||(Z=ts(Y,G,a)),K.push(Z.then(function(oe){for(var ne=0,de=c[Y];ne<de.length;ne++){var se=de[ne];se.map&&(d.delete(se.map),se.map.dispose()),se.map=oe,se.refreshUniforms(),d.add(oe)}return oe}).catch(function(){for(var oe=0,ne=c[Y];oe<ne.length;oe++){var de=ne[oe];de.map&&(d.delete(de.map),de.map.dispose()),de.map=null,de.color=new f.Color(16777215),de.refreshUniforms()}return null}))},J=0,W=Object.keys(c);J<W.length;J++){var $=W[J];_($)}for(var $ in i)delete i[$];return Promise.all(K).then(function(Y){return Y.filter(function(Z){return Z})})};return q(r).then(function(G){return{createAt:s,description:u,objects:l,textures:G,dispose:function(){d.forEach(function(K){K.dispose()}),d.clear()}}})}function rs(n,t){return n=Object.assign({},n),n.autoResize!==!1&&(t>96?n.size=Math.min(n.size||1/0,100):t>48?n.size=Math.min(n.size||1/0,200):t>24?n.size=Math.min(n.size||1/0,400):t>22?n.size=Math.min(n.size||1/0,800):t>5&&(n.size=Math.min(n.size||1/0,1024))),n}function sl(n,t){var e,r,i,a;t===void 0&&(t={});var o=(e=t.fetcher)!==null&&e!==void 0?e:new Ut({allowHosts:["*"]}),s={byteLength:0},u=rs((r=t.textureOptions)!==null&&r!==void 0?r:{},(a=(i=t.textureArray)===null||i===void 0?void 0:i.length)!==null&&a!==void 0?a:0),l={};if(t.textureArray)for(var c=0,d=t.textureArray;c<d.length;c++){var p=d[c];l[p]=ts(p,u,o)}return Promise.resolve().then(function(){return o.ajax(n,{responseType:"arraybuffer"})}).then(function(A){return el(A.body)}).then(function(A){return la(function(){for(var h,v={chunks:[],createAt:void 0,description:void 0},g=0,m=A;g<m.length;g++){var y=m[g],b=nl.decode(y);b.chunks.length&&((h=v.chunks).push.apply(h,b.chunks),v.createAt=b.createAt,v.description=b.description)}return v})}).then(function(A){return la(function(){var h,v,g;return ol(A,(h=t.textureBaseUri)!==null&&h!==void 0?h:function(){var m=n.lastIndexOf("/");if(m>=0){var y=n.slice(0,m)+"/";return/\/model\/$/.test(y)&&(y=y.replace(/\/model\/$/,"/materials/")),y}return""}(),((v=t.textureArray)!==null&&v!==void 0?v:[]).slice(),(g=t.textureOptions)!==null&&g!==void 0?g:{},l,o)})}).then(function(A){var h=new f.Group;h.name=n;for(var v=0,g=A.objects;v<g.length;v++){var m=g[v];h.add(m)}return{type:"at3d",upAxis:"Z",uri:n,byteLength:s.byteLength,scene:h,textures:A.textures,dispose:function(){return A.dispose()}}})}const nt=dn.Reader,mt=dn.util,De=dn.roots["@REALSEE/FIVE:five/loaders/model/parsers/protobuf/dome.proto"]||(dn.roots["@REALSEE/FIVE:five/loaders/model/parsers/protobuf/dome.proto"]={}),Zh=De.Model=(()=>{function n(t){if(this.meshes=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.meshes=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Model;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.meshes&&a.meshes.length||(a.meshes=[]),a.meshes.push(De.Mesh.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Model"},n})();De.Mesh=(()=>{function n(t){if(this.chunks=[],this.matrix=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.name="",n.prototype.chunks=mt.emptyArray,n.prototype.matrix=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Mesh;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.name=e.string();break}case 2:{a.chunks&&a.chunks.length||(a.chunks=[]),a.chunks.push(De.Chunk.decode(e,e.uint32()));break}case 3:{a.matrix&&a.matrix.length||(a.matrix=[]),a.matrix.push(De.Matrix.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("name"))throw mt.ProtocolError("missing required 'name'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Mesh"},n})();De.Matrix=(()=>{function n(t){if(this.elements=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.elements=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Matrix;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.elements&&a.elements.length||(a.elements=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.elements.push(e.float())}else a.elements.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Matrix"},n})();De.Chunk=(()=>{function n(t){if(this.material=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.geometry=null,n.prototype.material=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Chunk;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 2:{a.geometry=De.Geometry.decode(e,e.uint32());break}case 3:{a.material&&a.material.length||(a.material=[]),a.material.push(De.Material.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("geometry"))throw mt.ProtocolError("missing required 'geometry'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();De.Geometry=(()=>{function n(t){if(this.groups=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.position=null,n.prototype.uv=null,n.prototype.uv2=null,n.prototype.normal=null,n.prototype.groups=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Geometry;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.position=De.Position.decode(e,e.uint32());break}case 2:{a.uv=De.UV.decode(e,e.uint32());break}case 3:{a.uv2=De.UV.decode(e,e.uint32());break}case 4:{a.normal=De.Normal.decode(e,e.uint32());break}case 5:{a.groups&&a.groups.length||(a.groups=[]),a.groups.push(De.Group.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("position"))throw mt.ProtocolError("missing required 'position'",{instance:a});if(!a.hasOwnProperty("normal"))throw mt.ProtocolError("missing required 'normal'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Geometry"},n})();De.Position=(()=>{function n(t){if(this.array=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.array=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Position;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.array&&a.array.length||(a.array=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.array.push(e.float())}else a.array.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Position"},n})();De.UV=(()=>{function n(t){if(this.array=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.array=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.UV;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.array&&a.array.length||(a.array=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.array.push(e.float())}else a.array.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/UV"},n})();De.Normal=(()=>{function n(t){if(this.array=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.array=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Normal;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.array&&a.array.length||(a.array=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.array.push(e.float())}else a.array.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Normal"},n})();De.Group=(()=>{function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.start=0,n.prototype.count=0,n.prototype.materialIndex=0,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Group;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.start=e.uint32();break}case 2:{a.count=e.uint32();break}case 3:{a.materialIndex=e.uint32();break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("start"))throw mt.ProtocolError("missing required 'start'",{instance:a});if(!a.hasOwnProperty("count"))throw mt.ProtocolError("missing required 'count'",{instance:a});if(!a.hasOwnProperty("materialIndex"))throw mt.ProtocolError("missing required 'materialIndex'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Group"},n})();De.Material=(()=>{function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.kd=null,n.prototype.ks=null,n.prototype.ke=null,n.prototype.mapkd="",n.prototype.mapks="",n.prototype.mapke="",n.prototype.norm="",n.prototype.mapbump="",n.prototype.bump="",n.prototype.mapd="",n.prototype.ns=0,n.prototype.d=0,n.prototype.tr=0,n.prototype.mapkdrepeat="",n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Material;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.kd=De.Color.decode(e,e.uint32());break}case 2:{a.ks=De.Color.decode(e,e.uint32());break}case 3:{a.ke=De.Color.decode(e,e.uint32());break}case 4:{a.mapkd=e.string();break}case 5:{a.mapks=e.string();break}case 6:{a.mapke=e.string();break}case 7:{a.norm=e.string();break}case 8:{a.mapbump=e.string();break}case 9:{a.bump=e.string();break}case 10:{a.mapd=e.string();break}case 11:{a.ns=e.float();break}case 12:{a.d=e.float();break}case 13:{a.tr=e.float();break}case 14:{a.mapkdrepeat=e.string();break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Material"},n})();De.Color=(()=>{function n(t){if(this.rgb=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.rgb=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Color;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.rgb&&a.rgb.length||(a.rgb=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.rgb.push(e.float())}else a.rgb.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Color"},n})();var Yh=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function ul(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new Ut({allowHosts:["*"]}),i={byteLength:0};return Promise.resolve().then(function(){return r.ajax(n,{responseType:"arraybuffer"})}).then(function(a){var o;return i.byteLength=a.body.byteLength,ll(new Uint8Array(a.body),t.textureBaseUri||"",(o=t.textureOptions)!==null&&o!==void 0?o:{},r)}).then(function(a){var o=new f.Group;o.matrixAutoUpdate=!1,o.applyMatrix4(Yh),o.matrix.compose(o.position,o.quaternion,o.scale),o.name=n;for(var s=0,u=a.objects;s<u.length;s++){var l=u[s];o.add(l)}return{type:"dome",upAxis:"Z",uri:n,byteLength:i.byteLength,scene:o,textures:a.textures,dispose:function(){return a.dispose()}}})}function $h(n){for(var t=[0,0,0],e=0;e<n.attributes.normal.array.length/9;e++)t[0]=n.attributes.normal.array[e*9],t[1]=n.attributes.normal.array[e*9+1],t[2]=n.attributes.normal.array[e*9+2],n.attributes.normal.array[e*9]=n.attributes.normal.array[e*9+6],n.attributes.normal.array[e*9+1]=n.attributes.normal.array[e*9+7],n.attributes.normal.array[e*9+2]=n.attributes.normal.array[e*9+8],n.attributes.normal.array[e*9+6]=t[0],n.attributes.normal.array[e*9+7]=t[1],n.attributes.normal.array[e*9+8]=t[2];for(var e=0;e<n.attributes.position.array.length/9;e++)t[0]=n.attributes.position.array[e*9],t[1]=n.attributes.position.array[e*9+1],t[2]=n.attributes.position.array[e*9+2],n.attributes.position.array[e*9]=n.attributes.position.array[e*9+6],n.attributes.position.array[e*9+1]=n.attributes.position.array[e*9+7],n.attributes.position.array[e*9+2]=n.attributes.position.array[e*9+8],n.attributes.position.array[e*9+6]=t[0],n.attributes.position.array[e*9+7]=t[1],n.attributes.position.array[e*9+8]=t[2];for(var e=0;e<n.attributes.uv.array.length/6;e++)t[0]=n.attributes.uv.array[e*6],t[1]=n.attributes.uv.array[e*6+1],n.attributes.uv.array[e*6]=n.attributes.uv.array[e*6+4],n.attributes.uv.array[e*6+1]=n.attributes.uv.array[e*6+5],n.attributes.uv.array[e*6+4]=t[0],n.attributes.uv.array[e*6+5]=t[1];n.attributes.normal.needsUpdate=!0,n.attributes.position.needsUpdate=!0,n.attributes.uv.needsUpdate=!0}function ep(n){var t=n.position,e=n.normal,r=n.uv,i=n.uv2,a=n.groups,o=new f.BufferGeometry;o.setAttribute("position",new f.BufferAttribute(new Float32Array(t.array),3)),e&&o.setAttribute("normal",new f.BufferAttribute(new Float32Array(e.array),3)),r&&o.setAttribute("uv",new f.BufferAttribute(new Float32Array(r.array),2)),i&&o.setAttribute("uv2",new f.BufferAttribute(new Float32Array(i.array),2));for(var s=0,u=a;s<u.length;s++){var l=u[s];o.addGroup(l.start,l.count,l.materialIndex)}return o}function Dn(n,t,e,r,i,a,o){if(o.hasOwnProperty(n))return o[n];n=n.split("?")[0],Gr(n)||(n=st(t,n)),n=n.replace(/\/\/vrlab-image\d*.ljcdn.com\//,"//vrlab-public.ljcdn.com/"),n.indexOf("//")===0&&(n="https:"+n);var s=O({key:"texture.dome",size:64},_t(e,["quality","format","sharpen","mappings"])),u=o[n]=i.loadTexture(n,{imageURL:{transform:e.transform,options:s},wrapS:f.RepeatWrapping,wrapT:f.RepeatWrapping,fetcher:a}).then(function(l){var c=l.body;return r&&c.repeat.copy(r),c.needsUpdate=!0,c.updateMatrix(),c});return u}function tp(n,t,e,r,i,a,o,s){var u=[],l=new br("phong");if(o.add(l),n.kd&&(l.color=new f.Color().fromArray(n.kd.rgb).convertLinearToSRGB()),n.mapkd){var c=null;if(n.mapkdrepeat){var d=n.mapkdrepeat.split(/\s+/).map(function(v){return Number(v)}),p=d[0],A=d[1];c=new f.Vector2(p,A)}u.push(Dn(n.mapkd,t,e,c,r,i,a).then(function(v){v.encoding=f.sRGBEncoding,l.map=v,o.add(v),s.add(v),l.needsUpdate=!0}).catch(Q))}if(n.ks&&(l.specular=new f.Color().fromArray(n.ks.rgb).convertLinearToSRGB()),n.mapks&&u.push(Dn(n.mapks,t,e,null,r,i,a).then(function(v){l.specularMap=v,o.add(v),s.add(v)}).catch(Q)),n.ke&&(l.emissive=new f.Color().fromArray(n.ke.rgb).convertLinearToSRGB()),n.mapke&&u.push(Dn(n.mapke,t,e,null,r,i,a).then(function(v){v.encoding=f.sRGBEncoding,l.emissiveMap=v,o.add(v),s.add(v)}).catch(Q)),n.norm&&u.push(Dn(n.norm,t,e,null,r,i,a).then(function(v){l.normalMap=v,o.add(v),s.add(v)}).catch(Q)),n.mapbump&&u.push(Dn(n.mapbump,t,e,null,r,i,a).then(function(v){l.bumpMap=v,o.add(v),s.add(v)}).catch(Q)),n.bump&&u.push(Dn(n.bump,t,e,null,r,i,a).then(function(v){l.bumpMap=v,o.add(v),s.add(v)}).catch(Q)),typeof n.ns=="number"&&(l.shininess=n.ns),typeof n.d=="number"){var h=n.d;h>0&&h<1&&(l.opacity=h)}return l.floor=0,l.refreshUniforms(),{material:l,textureReady:Promise.all(u).then(function(){return l.refreshUniforms()}).then(Q)}}function rp(n){return Zh.decode(n).meshes}function ll(n,t,e,r){for(var i=[],a=[],o=new Set,s=rp(n),u=new Xn,l=new f.Matrix4,c=new f.Vector3,d=new f.Quaternion,p=new f.Vector3,A={},h=new Set,v=0,g=s;v<g.length;v++){var m=g[v],y=m.name,b=m.chunks,x=m.matrix;if(!(y==="Ceiling"||y==="CeilingDrop"))for(var w=0,M=x;w<M.length;w++){var S=M[w];l.elements=S.elements;for(var E=new f.Group,P=0;P<b.length;P++){var B=ep(b[P].geometry);B.applyMatrix4(l),l.decompose(c,d,p),p.x*p.y*p.z<0&&B.attributes.normal&&B.attributes.position&&B.attributes.uv&&$h(B),o.add(B);for(var C=[],I=0,F=b[P].material;I<F.length;I++){var T=F[I],L=tp(T,t||"",e,u,r,A,o,h),D=L.material,V=L.textureReady;a.push(V),C.push(D)}var z=new Ot(B,C);z.name="chunk_"+P,z.matrix.compose(z.position,z.quaternion,z.scale),z.matrixAutoUpdate=!1,z.frustumCulled=!1,E.add(z)}E.name=y,i.push(E)}}return Promise.all(a).catch(Q).then(function(){return{createAt:0,description:"",objects:i,textures:Array.from(h),dispose:function(){o.forEach(function(U){U.dispose()}),o.clear()}}})}var np=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function cl(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new Ut({allowHosts:["*"]}),i={byteLength:0};return Promise.resolve().then(function(){return r.ajax(n,{responseType:"arraybuffer"})}).then(function(a){return i.byteLength=a.body.byteLength,el(a.body)}).then(function(a){var o=a.reduce(function(l,c){return l+c.length},0),s=new Uint8Array(o),u=0;return a.forEach(function(l){s.set(l,u),u+=l.length}),s}).then(function(a){var o;return ll(a,t.textureBaseUri||"",(o=t.textureOptions)!==null&&o!==void 0?o:{},r)}).then(function(a){var o=new f.Group;o.matrixAutoUpdate=!1,o.applyMatrix4(np),o.matrix.compose(o.position,o.quaternion,o.scale),o.name=n;for(var s=0,u=a.objects;s<u.length;s++){var l=u[s];o.add(l)}return{type:"domez",upAxis:"Z",uri:n,byteLength:i.byteLength,scene:o,textures:a.textures,dispose:function(){return a.dispose()}}})}var ip=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function fl(n,t){var e,r;t===void 0&&(t={});var i=(e=t.upAxis)!==null&&e!==void 0?e:"Y",a=(r=t.fetcher)!==null&&r!==void 0?r:new Ut({allowHosts:["*"]}),o=0;return Promise.resolve().then(function(){return a.ajax(n,{responseType:"arraybuffer"}).then(function(s){return o=s.body.byteLength,s.body})}).then(function(s){var u;return es(s,{copyUV2:!1,addonExtensions:["PBM_mesh"],resourcePath:n.slice(0,n.lastIndexOf("/")+1),search:(u=n.split("?")[1])!==null&&u!==void 0?u:"",fetcher:a})}).then(function(s){var u=new f.Matrix4;if(i==="Y"&&u.premultiply(ip),s.CESIUM_RTC){var l=new f.Matrix4().setPosition(s.CESIUM_RTC.center);u.premultiply(l)}var c=s.scene;return c.applyMatrix4(u),{type:"gltf",upAxis:"Z",uri:n,byteLength:o,scene:c,textures:s.textures,dispose:function(){return s.dispose()}}})}var Zn=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]),Nt=new f.Color;function ns(n,t){var e,r;t===void 0&&(t={});var i=(e=t.upAxis)!==null&&e!==void 0?e:"Z",a=(r=t.fetcher)!==null&&r!==void 0?r:new Ut({allowHosts:["*"]}),o=0;return Promise.resolve().then(function(){return a.ajax(n,{responseType:"arraybuffer"}).then(function(s){return o=s.body.byteLength,s.body})}).then(function(s){var u,l;return ap(s,{propertyNameMapping:(u=t.propertyNameMapping)!==null&&u!==void 0?u:{},customPropertyMapping:(l=t.customPropertyMapping)!==null&&l!==void 0?l:{}})}).then(function(s){var u=s.geometry;switch(t.type){case"geometry":{var l=u;return i==="Y"&&l.applyMatrix4(Zn),{type:"ply",upAxis:"Z",uri:n,byteLength:o,scene:l,meta:{},textures:[],dispose:function(){u.dispose()}}}case"mesh":{var c="color"in u.attributes,d=new f.MeshBasicMaterial({vertexColors:c}),l=new f.Mesh(u,d);return i==="Y"&&l.applyMatrix4(Zn),{type:"ply",upAxis:"Z",uri:n,byteLength:o,scene:l,meta:{},textures:[],dispose:function(){u.dispose(),d.dispose()}}}case"line":{var c="color"in u.attributes,p=new f.LineBasicMaterial({vertexColors:c}),l=new f.Line(u,p);return l.computeLineDistances(),i==="Y"&&l.applyMatrix4(Zn),{type:"ply",upAxis:"Z",uri:n,byteLength:o,scene:l,meta:{},textures:[],dispose:function(){u.dispose(),p.dispose()}}}case"points":{var A=new f.PointsMaterial({}),l=new f.Points(u,A);return i==="Y"&&l.applyMatrix4(Zn),{type:"ply",upAxis:"Z",uri:n,byteLength:o,scene:l,meta:{},textures:[],dispose:function(){u.dispose(),A.dispose()}}}case"pbmPointCloud":{var h=new Pi,l=new yr(u,h);return i==="Y"&&l.applyMatrix4(Zn),{type:"ply",upAxis:"Z",uri:n,byteLength:o,scene:l,meta:{},textures:[],dispose:function(){u.dispose(),h.dispose()}}}}throw new Error("Invalid Type: ".concat(t.type))})}function ap(n,t){var e=new Uint8Array(n),r=hp(e),i=r.headerText,a=r.headerLength,o=sp(i,a,t);if(o.format==="ascii"){var s=new TextDecoder().decode(e);return{header:o,geometry:lp(s,o,t)}}else return{header:o,geometry:dp(n,o,t)}}function op(n,t){var e={name:"",type:n[0]};return e.type==="list"?(e.name=n[3],e.countType=n[1],e.itemType=n[2]):e.name=n[1],e.name in t.propertyNameMapping&&(e.name=t.propertyNameMapping[e.name]),e}function sp(n,t,e){t===void 0&&(t=0);var r=/^ply([\s\S]*)end_header(\r\n|\r|\n)/,i="",a=r.exec(n);a!==null&&(i=a[1]);for(var o={format:"",version:"",comments:[],elements:[],headerLength:t,objInfo:""},s=i.split(/\r\n|\r|\n/),u=null,l=0;l<s.length;l++){var c=s[l];if(c=c.trim(),c!==""){var d=c.split(/\s+/),p=d.shift();switch(c=d.join(" "),p){case"format":o.format=d[0],o.version=d[1];break;case"comment":o.comments.push(c);break;case"element":u&&o.elements.push(u),u={name:d[0],count:parseInt(d[1]),properties:[]};break;case"property":u&&u.properties.push(op(d,e));break;case"obj_info":o.objInfo=c;break;default:console.log("unhandled",p,d)}}}return u&&o.elements.push(u),o}function Ja(n,t){switch(t){case"char":case"uchar":case"short":case"ushort":case"int":case"uint":case"int8":case"uint8":case"int16":case"uint16":case"int32":case"uint32":return parseInt(n);case"float":case"double":case"float32":case"float64":return parseFloat(n);default:throw new Error("unspport type: "+t)}}function up(n,t){for(var e={},r=0;r<n.length;r++){if(t.empty())return null;if(n[r].type==="list"){for(var i=[],a=Ja(t.next(),n[r].countType),o=0;o<a;o++){if(t.empty())return null;i.push(Ja(t.next(),n[r].itemType))}e[n[r].name]=i}else e[n[r].name]=Ja(t.next(),n[r].type)}return e}function dl(n){for(var t={indices:[],vertices:[],normals:[],uvs:[],faceVertexUvs:[],colors:[],faceVertexColors:[]},e=0,r=Object.keys(n.customPropertyMapping);e<r.length;e++){var i=r[e];t[i]=[]}return t}function hl(n){var t=n.map(function(r){return r.name});function e(r){for(var i=0,a=r.length;i<a;i++){var o=r[i];if(t.includes(o))return o}return null}return{attrX:e(["x","px","posx"])||"x",attrY:e(["y","py","posy"])||"y",attrZ:e(["z","pz","posz"])||"z",attrNX:e(["nx","normalx"]),attrNY:e(["ny","normaly"]),attrNZ:e(["nz","normalz"]),attrS:e(["s","u","texture_u","tx"]),attrT:e(["t","v","texture_v","ty"]),attrR:e(["red","diffuse_red","r","diffuse_r"]),attrG:e(["green","diffuse_green","g","diffuse_g"]),attrB:e(["blue","diffuse_blue","b","diffuse_b"])}}function lp(n,t,e){var r=dl(e),i=/end_header\s+(\S[\s\S]*\S|\S)\s*$/,a,o=null;(o=i.exec(n))!==null?a=o[1].split(/\s+/):a=[];var s=new pp(a);e:for(var u=0;u<t.elements.length;u++)for(var l=t.elements[u],c=hl(l.properties),d=0;d<l.count;d++){var p=up(l.properties,s);if(!p)break e;vl(r,l.name,p,c,e)}return pl(r,e)}function pl(n,t){var e=new f.BufferGeometry;n.indices.length>0&&e.setIndex(n.indices),e.setAttribute("position",new f.Float32BufferAttribute(n.vertices,3)),n.normals.length>0&&e.setAttribute("normal",new f.Float32BufferAttribute(n.normals,3)),n.uvs.length>0&&e.setAttribute("uv",new f.Float32BufferAttribute(n.uvs,2)),n.colors.length>0&&e.setAttribute("color",new f.Float32BufferAttribute(n.colors,3)),(n.faceVertexUvs.length>0||n.faceVertexColors.length>0)&&(e=e.toNonIndexed(),n.faceVertexUvs.length>0&&e.setAttribute("uv",new f.Float32BufferAttribute(n.faceVertexUvs,2)),n.faceVertexColors.length>0&&e.setAttribute("color",new f.Float32BufferAttribute(n.faceVertexColors,3)));for(var r=0,i=Object.keys(t.customPropertyMapping);r<i.length;r++){var a=i[r];if(n[a].length>0){var o=t.customPropertyMapping[a],s=o.itemType,u=o.itemNames,l=o.normalized,c=u.length,d=void 0;switch(s){case"float32":d=new f.Float32BufferAttribute(n[a],c,l);break;case"uint32":d=new f.Uint32BufferAttribute(n[a],c,l);break;case"int32":d=new f.Int32BufferAttribute(n[a],c,l);break;case"uint16":d=new f.Uint16BufferAttribute(n[a],c,l);break;case"int16":d=new f.Int16BufferAttribute(n[a],c,l);break;case"uint8":d=new f.Uint8BufferAttribute(n[a],c,l);break;case"int8":d=new f.Int8BufferAttribute(n[a],c,l);break;default:d=new f.Float32BufferAttribute(n[a],c,l);break}e.setAttribute(a,d)}}return e.computeBoundingSphere(),e}function vl(n,t,e,r,i){if(t==="vertex"){r.attrX!==null&&r.attrY!==null&&r.attrZ!==null&&n.vertices.push(e[r.attrX],e[r.attrY],e[r.attrZ]),r.attrNX!==null&&r.attrNY!==null&&r.attrNZ!==null&&n.normals.push(e[r.attrNX],e[r.attrNY],e[r.attrNZ]),r.attrS!==null&&r.attrT!==null&&n.uvs.push(e[r.attrS],e[r.attrT]),r.attrR!==null&&r.attrG!==null&&r.attrB!==null&&(Nt.setRGB(e[r.attrR]/255,e[r.attrG]/255,e[r.attrB]/255),n.colors.push(Nt.r,Nt.g,Nt.b));for(var a=0,o=Object.keys(i.customPropertyMapping);a<o.length;a++)for(var s=o[a],u=0,l=i.customPropertyMapping[s].itemNames;u<l.length;u++){var c=l[u];n[s].push(e[c])}}else if(t==="face"){var d=e.vertex_indices||e.vertex_index,p=e.texcoord;d.length===3?(n.indices.push(d[0],d[1],d[2]),p&&p.length===6&&(n.faceVertexUvs.push(p[0],p[1]),n.faceVertexUvs.push(p[2],p[3]),n.faceVertexUvs.push(p[4],p[5]))):d.length===4&&(n.indices.push(d[0],d[1],d[3]),n.indices.push(d[1],d[2],d[3])),r.attrR!==null&&r.attrG!==null&&r.attrB!==null&&(Nt.setRGB(e[r.attrR]/255,e[r.attrG]/255,e[r.attrB]/255),n.faceVertexColors.push(Nt.r,Nt.g,Nt.b),n.faceVertexColors.push(Nt.r,Nt.g,Nt.b),n.faceVertexColors.push(Nt.r,Nt.g,Nt.b))}}function cp(n,t){for(var e={},r=0,i=0;i<t.length;i++){var a=t[i],o=a.valueReader;if(a.type==="list"){var s=[],u=a.countReader.read(n+r);r+=a.countReader.size;for(var l=0;l<u;l++)s.push(o.read(n+r)),r+=o.size;e[a.name]=s}else e[a.name]=o.read(n+r),r+=o.size}return[e,r]}function fp(n,t,e){function r(s,u,l){switch(u){case"int8":case"char":return{read:function(c){return s.getInt8(c)},size:1};case"uint8":case"uchar":return{read:function(c){return s.getUint8(c)},size:1};case"int16":case"short":return{read:function(c){return s.getInt16(c,l)},size:2};case"uint16":case"ushort":return{read:function(c){return s.getUint16(c,l)},size:2};case"int32":case"int":return{read:function(c){return s.getInt32(c,l)},size:4};case"uint32":case"uint":return{read:function(c){return s.getUint32(c,l)},size:4};case"float32":case"float":return{read:function(c){return s.getFloat32(c,l)},size:4};case"float64":case"double":return{read:function(c){return s.getFloat64(c,l)},size:8};default:throw new Error("not support type: "+u)}}for(var i=0,a=n.length;i<a;i++){var o=n[i];o.type==="list"?(o.countReader=r(t,o.countType,e),o.valueReader=r(t,o.itemType,e)):o.valueReader=r(t,o.type,e)}}function dp(n,t,e){for(var r=dl(e),i=t.format==="binary_little_endian",a=new DataView(n,t.headerLength),o,s=0,u=0;u<t.elements.length;u++){var l=t.elements[u],c=l.properties,d=hl(c);fp(c,a,i);for(var p=0;p<l.count;p++){o=cp(s,c),s+=o[1];var A=o[0];vl(r,l.name,A,d,e)}}return pl(r,e)}function hp(n){var t=0,e=!0,r="",i=[],a=new TextDecoder().decode(n.subarray(0,5)),o=/^ply\r\n/.test(a);do{var s=String.fromCharCode(n[t++]);s!==`
|
|
929
|
-
`&&s!=="\r"?r+=s:(r==="end_header"&&(e=!1),r!==""&&(i.push(r),r=""))}while(e&&t<n.length);return o===!0&&t++,{headerText:i.join("\r")+"\r",headerLength:t}}var pp=function(){function n(t){this.arr=t,this.i=0}return n.prototype.empty=function(){return this.i>=this.arr.length},n.prototype.next=function(){return this.arr[this.i++]},n}(),vp=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]),mp=/^[og]\s*(.+)?/,Ap=/^mtllib /,gp=/^usemtl /,yp=/^usemap /,u0=/\s+/,Yn=new f.Color,bp=function(){function n(){this.objects=[],this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.materials={},this.materialLibraries=[],this.startObject("",!1)}return n.prototype.startObject=function(t,e){if(this.object&&this.object.fromDeclaration===!1){this.object.name=t,this.object.fromDeclaration=e!==!1;return}var r=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:t||"",fromDeclaration:e!==!1,geometry:{vertices:[],hasNormal:!0,normals:[],hasColor:!0,colors:[],hasUV:!0,uvs:[],index:[],indexMap:{}},materials:[],smooth:!0,startMaterial:function(a,o){var s,u,l=this._finalize(!1);l&&(l.inherited||((s=l.groupCount)!==null&&s!==void 0?s:0)<=0)&&this.materials.splice((u=l.index)!==null&&u!==void 0?u:0,1);var c={index:this.materials.length,name:a||"",mtllib:Array.isArray(o)&&o.length>0?o[o.length-1]:"",smooth:l!==void 0?l.smooth:this.smooth,groupStart:l!==void 0?l.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(d){var p={index:typeof d=="number"?d:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(){return this}};return p.clone=this.clone.bind(p),p}};return this.materials.push(c),c},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(a){var o,s,u=this.currentMaterial();if(u&&u.groupEnd===-1&&(u.groupEnd=this.geometry.index.length,u.groupCount=u.groupEnd-((o=u.groupStart)!==null&&o!==void 0?o:0),u.inherited=!1),a&&this.materials.length>1)for(var l=this.materials.length-1;l>=0;l--)((s=this.materials[l].groupCount)!==null&&s!==void 0?s:0)<=0&&this.materials.splice(l,1);return a&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),u}},r&&r.name&&typeof r.clone=="function"){var i=r.clone(0);i.inherited=!0,this.object.materials.push(i)}this.objects.push(this.object)},n.prototype.finalize=function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},n.prototype.parseVertexIndex=function(t,e){var r=parseInt(t,10);return(r>=0?r-1:r+e/3)*3},n.prototype.parseNormalIndex=function(t,e){var r=parseInt(t,10);return(r>=0?r-1:r+e/3)*3},n.prototype.parseUVIndex=function(t,e){var r=parseInt(t,10);return(r>=0?r-1:r+e/2)*2},n.prototype.addFace=function(t,e,r,i,a,o,s,u,l){var c=this.object.geometry,d=this.vertices.length,p=this.normals.length,A=this.uvs.length,h=this.parseVertexIndex(t,d),v=this.parseVertexIndex(e,d),g=this.parseVertexIndex(r,d),m=s!==void 0?this.parseNormalIndex(s,p):void 0,y=u!==void 0?this.parseNormalIndex(u,p):void 0,b=l!==void 0?this.parseNormalIndex(l,p):void 0,x=i!==void 0?this.parseUVIndex(i,A):void 0,w=a!==void 0?this.parseUVIndex(a,A):void 0,M=o!==void 0?this.parseUVIndex(o,A):void 0;(c.hasNormal===!0&&m===void 0||y===void 0||b===void 0)&&(c.hasNormal=!1),(c.hasUV===!0&&x===void 0||w===void 0||M===void 0)&&(c.hasUV=!1);var S=[h,x,m].join(":"),E=c.indexMap[S];E===void 0&&(E=c.vertices.length/3,c.indexMap[S]=E,c.vertices.push(this.vertices[h+0],this.vertices[h+1],this.vertices[h+2]),c.hasColor&&(this.colors[h]===void 0?c.hasColor=!1:c.colors.push(this.colors[h+0],this.colors[h+1],this.colors[h+2])),c.hasNormal&&c.normals.push(this.normals[h+0],this.normals[h+1],this.normals[h+2]),c.hasUV&&c.uvs.push(this.uvs[x+0],this.uvs[x+1])),c.index.push(E);var
|
|
928
|
+
`),Co=typeof Worker!="undefined"&&typeof Blob!="undefined",Yu="";if(Co)try{var _h=new Blob([Kh],{type:"text/javascript"});Yu=URL.createObjectURL(_h)}catch(n){}var $u=function(){function n(){var t=this;if(!Co)throw new Error("LZMAWorker cannot work in this broswer.");this.callCounter=0,this.requests={};var e=this.worker=new Worker(Yu);e.onmessage=function(r){var i=r.data,a=i.id,o=i.result,s=i.error,u=t.getKey(a);t.requests[u]&&(s?t.requests[u](new Error(s)):t.requests[u](null,o),delete t.requests[u])},e.onerror=function(r){return console.error(r)}}return n.prototype.getKey=function(t){return"key_"+String(t)},n.prototype.decompress=function(t,e){var r=++this.callCounter;this.requests[this.getKey(r)]=e,this.worker.postMessage({type:"decompress",id:r,data:t},[t.buffer])},n.prototype.terminate=function(){this.worker.terminate()},n.support=Co,n}();function o0(n){return Array.prototype.reduce.call(n,function(t,e,r){return t|e<<r*8},0)}function jh(n){for(var t=[],e=n.length,r=function(o){var s={data:n[o],offset:0,readByte:function(){return this.data[this.offset++]}},u=s.data.length,l={data:[],offset:0,writeByte:function(d){var p=Math.floor(this.offset/u);this.data[p]||(this.data[p]=new Uint8Array(u)),this.data[p][this.offset%u]=d,this.offset++}};Uh.decompressFile(s,l),i=new Uint8Array(l.offset);for(var c=0;c<l.offset;c++)i[c]=l.data[Math.floor(c/u)][c%u];t.push(i)},i,a=0;a<e;a++)r(a);return t}function Jh(n){for(var t=[],e=n.length,r=function(a){t.push(new Promise(function(o,s){var u=new $u;u.decompress(n[a],function(l,c){if(u.terminate(),l)return s(l);o(c)})}))},i=0;i<e;i++)r(i);return Promise.all(t)}function el(n){var t=new Uint8Array(n),e=o0(t.slice(0,4));if(e>10)return Promise.reject(new Error("LZMA got too many sub chunks."));for(var r=[],i=[],a=4+e*4,o=0;o<e;o++)i[o]=o0(t.slice(4+o*4,8+o*4)),o===e-1?r[o]=t.subarray(a,a+i[o]):r[o]=t.slice(a,a+i[o]),a+=i[o];return $u.support?Jh(r):Promise.resolve(jh(r))}var ja=!1,tl=[];function rl(n){if(n===void 0&&(n=!1),!(!n&&ja)){ja=!0;var t=tl.shift();if(t){try{t()}catch(e){}Mt.shared.add(function(){return rl(!0)},!0,2,-100)}else ja=!1}}function la(n){return new Promise(function(t,e){var r=function(){try{t(n())}catch(i){e(i)}};tl.push(r),Mt.shared.add(function(){return rl()},!0,2,-100)})}const pn=dn.Reader,gr=dn.util,nr=dn.roots["@REALSEE/FIVE:five/loaders/model/parsers/protobuf/pbm.proto"]||(dn.roots["@REALSEE/FIVE:five/loaders/model/parsers/protobuf/pbm.proto"]={}),nl=nr.Model=(()=>{function n(t){if(this.chunks=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.chunks=gr.emptyArray,n.prototype.createAt=gr.Long?gr.Long.fromBits(0,0,!0):0,n.prototype.description="",n.decode=function(e,r){e instanceof pn||(e=pn.create(e));let i=r===void 0?e.len:e.pos+r,a=new nr.Model;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.chunks&&a.chunks.length||(a.chunks=[]),a.chunks.push(nr.Chunk.decode(e,e.uint32()));break}case 2:{a.createAt=e.uint64();break}case 3:{a.description=e.string();break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Model"},n})();nr.Chunk=(()=>{function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.vertices=null,n.prototype.faces=null,n.prototype.name="",n.prototype.texture="",n.decode=function(e,r){e instanceof pn||(e=pn.create(e));let i=r===void 0?e.len:e.pos+r,a=new nr.Chunk;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.vertices=nr.Vertices.decode(e,e.uint32());break}case 2:{a.faces=nr.Faces.decode(e,e.uint32());break}case 3:{a.name=e.string();break}case 4:{a.texture=e.string();break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("vertices"))throw gr.ProtocolError("missing required 'vertices'",{instance:a});if(!a.hasOwnProperty("faces"))throw gr.ProtocolError("missing required 'faces'",{instance:a});if(!a.hasOwnProperty("name"))throw gr.ProtocolError("missing required 'name'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();nr.Vertices=(()=>{function n(t){if(this.xyz=[],this.uvs=[],this.marks=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.xyz=gr.emptyArray,n.prototype.uvs=gr.emptyArray,n.prototype.marks=gr.emptyArray,n.decode=function(e,r){e instanceof pn||(e=pn.create(e));let i=r===void 0?e.len:e.pos+r,a=new nr.Vertices;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.xyz&&a.xyz.length||(a.xyz=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.xyz.push(e.float())}else a.xyz.push(e.float());break}case 2:{if(a.uvs&&a.uvs.length||(a.uvs=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.uvs.push(e.float())}else a.uvs.push(e.float());break}case 3:{if(a.marks&&a.marks.length||(a.marks=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.marks.push(e.int32())}else a.marks.push(e.int32());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Vertices"},n})();nr.Faces=(()=>{function n(t){if(this.indices=[],this.normals=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.indices=gr.emptyArray,n.prototype.normals=gr.emptyArray,n.decode=function(e,r){e instanceof pn||(e=pn.create(e));let i=r===void 0?e.len:e.pos+r,a=new nr.Faces;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.indices&&a.indices.length||(a.indices=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.indices.push(e.uint32())}else a.indices.push(e.uint32());break}case 2:{if(a.normals&&a.normals.length||(a.normals=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.normals.push(e.float())}else a.normals.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Faces"},n})();nr.VertexMark=(()=>{const n={},t=Object.create(n);return t[n[0]="VERTEX_MARK_UNSPECIFIED"]=0,t[n[1]="VERTEX_MARK_ROOF"]=1,t})();function il(n,t){var e,r,i,a;t===void 0&&(t={});var o=(e=t.fetcher)!==null&&e!==void 0?e:new qt({allowHosts:["*"]}),s={byteLength:0},u=rs((r=t.textureOptions)!==null&&r!==void 0?r:{},(a=(i=t.textureArray)===null||i===void 0?void 0:i.length)!==null&&a!==void 0?a:0),l={};if(t.textureArray)for(var c=0,d=t.textureArray;c<d.length;c++){var p=d[c];l[p]=ts(p,u,o)}return Promise.resolve().then(function(){return o.ajax(n,{responseType:"arraybuffer"})}).then(function(A){return s.byteLength=A.body.byteLength,la(function(){var h=new Uint8Array(A.body);return nl.decode(h)})}).then(function(A){return la(function(){var h,v;return ol(A,(h=t.textureBaseUri)!==null&&h!==void 0?h:function(){var g=n.lastIndexOf("/");if(g>=0){var m=n.slice(0,g)+"/";return/\/model\/$/.test(m)&&(m=m.replace(/\/model\/$/,"/materials/")),m}return""}(),((v=t.textureArray)!==null&&v!==void 0?v:[]).slice(),u,l,o)})}).then(function(A){var h=new f.Group;h.matrixAutoUpdate=!1,h.matrix.compose(h.position,h.quaternion,h.scale),h.name=n;for(var v=0,g=A.objects;v<g.length;v++){var m=g[v];h.add(m)}return{type:"pbm",upAxis:"Z",uri:n,byteLength:s.byteLength,scene:h,textures:A.textures,dispose:function(){return A.dispose()}}})}function al(n){var t=n.match(/(group|floor)-?(\d+)/);return t?parseInt(t[2],10):0}function Eo(n){var t=n.match(/(chunk)-?(\d+)/);return t?parseInt(t[2],10):0}function Xh(n){var t=n.match(/(sub)-?(\d+)/);return t?parseInt(t[2],10):0}function s0(n){var t=al(n.name),e=Eo(n.name),r=Xh(n.name);return t*1e6+e*1e3+r}function Wh(n){for(var t,e,r,i=typeof n.createAt=="number"?n.createAt:0,a=(t=n.description)!==null&&t!==void 0?t:"",o=[],s=!0,u=!0,l=0,c=n.chunks;l<c.length;l++){var d=c[l];if(!d.vertices.marks||d.vertices.marks.length===0){u=!1;break}}for(var p=0,A=n.chunks;p<A.length;p++){var d=A[p];if(!d.faces.normals||d.faces.normals.length===0){s=!1;break}}for(var h=n.chunks.sort(function(ie,xe){return s0(ie)-s0(xe)}),v=[],g=0,m=h;g<m.length;g++){var d=m[g],y=al(d.name);v[y]||(v[y]=[]),v[y].push(d)}for(var b=0;b<v.length;b++){var x=v[b];if(x)if(s){for(var w=0,M=0;M<x.length;M++){var d=x[M];w+=d.faces.indices.length}for(var S=new Float32Array(w*3),E=new Float32Array(w*2),B=new Float32Array(w*3),R=u?new Float32Array(w):void 0,C=[],I=[1/0,1/0,1/0,-1/0,-1/0,-1/0],L=0,T=0;T<x.length;T++){for(var F=[1/0,1/0,1/0,-1/0,-1/0,-1/0],d=x[T],D=d.vertices.xyz,V=d.vertices.uvs,z=d.faces.indices,U=d.faces.normals,q=d.vertices.marks,G=z.length,M=0;M<G;M++){var K=z[M],j=S[L*3+M*3]=D[K*3],J=S[L*3+M*3+1]=D[K*3+1],W=S[L*3+M*3+2]=D[K*3+2];R&&(R[L+M]=q[K]),E[L*2+M*2]=V[K*2],E[L*2+M*2+1]=V[K*2+1];var $=Math.floor(M/3)*3;B[L*3+M*3]=U[$],B[L*3+M*3+1]=U[$+1],B[L*3+M*3+2]=U[$+2],j<F[0]&&(F[0]=j),J<F[1]&&(F[1]=J),W<F[2]&&(F[2]=W),j>F[3]&&(F[3]=j),J>F[4]&&(F[4]=J),W>F[5]&&(F[5]=W)}F[0]<I[0]&&(I[0]=F[0]),F[1]<I[1]&&(I[1]=F[1]),F[2]<I[2]&&(I[2]=F[2]),F[3]>I[3]&&(I[3]=F[3]),F[4]>I[4]&&(I[4]=F[4]),F[5]>I[5]&&(I[5]=F[5]),C.push({materialIndex:T,name:d.name,chunkName:Eo(d.name),start:L,count:d.faces.indices.length,texture:(e=d.texture)!==null&&e!==void 0?e:void 0}),L+=G}var Y={createAt:i,description:a,vertices:S,uvs:E,normals:B,masks:R,indices:null,floorIndex:b,groups:C,extents:I};o.push(Y)}else{for(var w=0,Z=0,M=0;M<x.length;M++){var d=x[M];Z+=d.vertices.xyz.length/3,w+=d.faces.indices.length}for(var S=new Float32Array(Z*3),E=new Float32Array(Z*2),B=void 0,oe=new Float32Array(Z),ne=new Uint32Array(w),R=u?new Float32Array(w):void 0,C=[],I=[1/0,1/0,1/0,-1/0,-1/0,-1/0],de=0,L=0,T=0;T<x.length;T++){for(var F=[1/0,1/0,1/0,-1/0,-1/0,-1/0],d=x[T],D=d.vertices.xyz,se=d.vertices.marks,V=d.vertices.uvs,z=d.faces.indices,ye=D.length/3,G=z.length,M=0;M<ye;M++){var j=S[L*3+M*3]=D[M*3],J=S[L*3+M*3+1]=D[M*3+1],W=S[L*3+M*3+2]=D[M*3+2];R&&(R[L+M]=se[M]),E[L*2+M*2]=V[M*2],E[L*2+M*2+1]=V[M*2+1],oe[L+M]=b,j<F[0]&&(F[0]=j),J<F[1]&&(F[1]=J),W<F[2]&&(F[2]=W),j>F[3]&&(F[3]=j),J>F[4]&&(F[4]=J),W>F[5]&&(F[5]=W)}F[0]<I[0]&&(I[0]=F[0]),F[1]<I[1]&&(I[1]=F[1]),F[2]<I[2]&&(I[2]=F[2]),F[3]>I[3]&&(I[3]=F[3]),F[4]>I[4]&&(I[4]=F[4]),F[5]>I[5]&&(I[5]=F[5]);for(var M=0;M<G;M++)ne[de+M]=L+z[M];C.push({materialIndex:T,name:d.name,chunkName:Eo(d.name),start:de,count:d.faces.indices.length,texture:(r=d.texture)!==null&&r!==void 0?r:void 0}),L+=ye,de+=G}var Y={createAt:i,description:a,vertices:S,uvs:E,normals:B,masks:R,indices:ne,floorIndex:b,groups:C,extents:I};o.push(Y)}}return o}function ts(n,t,e){var r=O({key:"texture.pbm"},Jt(t,["format","quality","size","sharpen","mappings"])),i=new Xn,a=i.loadTexture(n,{imageURL:{transform:t.transform,options:r},encoding:f.sRGBEncoding,wrapS:f.ClampToEdgeWrapping,wrapT:f.ClampToEdgeWrapping,minFilter:f.LinearFilter,maxSize:typeof r.size=="number"?new f.Vector2(r.size,r.size):void 0,fetcher:e}).then(function(o){var s=o.body;return s.needsUpdate=!0,s});return Object.assign(a,{url:n,textureOptions:t})}function ol(n,t,e,r,i,a){i===void 0&&(i={});for(var o=Wh(n),s=0,u="",l=[],c={},d=new Set,p=0,A=o;p<A.length;p++){var h=A[p],v=h.createAt,g=h.description,m=h.vertices,y=h.masks,b=h.uvs,x=h.normals,w=h.indices,M=h.floorIndex,S=h.groups,E=h.extents,B=new f.Box3;B.min.x=E[0],B.min.y=E[1],B.min.z=E[2],B.max.x=E[3],B.max.y=E[4],B.max.z=E[5];var R=new f.BufferGeometry;R.setAttribute("position",new f.BufferAttribute(m,3)),R.setAttribute("uv",new f.BufferAttribute(b,2)),x&&R.setAttribute("normal",new f.BufferAttribute(x,3)),y&&R.setAttribute("mask",new f.BufferAttribute(y,1)),w&&R.setIndex(new f.BufferAttribute(w,1)),R.boundingBox=B,R.boundingSphere=B.getBoundingSphere(new f.Sphere);for(var C=0,I=S;C<I.length;C++){var L=I[C];R.addGroup(L.start,L.count,L.materialIndex)}d.add(R);for(var T=[],F=0,D=S;F<D.length;F++){var L=D[F],V=e[L.chunkName]||(L.texture?st(t||"",L.texture):void 0),z=new br("basic");z.floor=M,R.attributes.normal===void 0&&(z.flatShading=!0),R.attributes.mask&&(z.defines.USE_VERTEX_MARK=!0),T.push(z),V?c[V]?c[V].push(z):c[V]=[z]:z.color=new f.Color(16777215),d.add(z),z.refreshUniforms()}var U=new Ot(R,T);U.name="model_floor_"+M,U.userData.createAt=v,U.userData.description=g,U.matrix.compose(U.position,U.quaternion,U.scale),U.matrixAutoUpdate=!1,U.frustumCulled=!1,s=v,u=g,l.push(U)}var q=function(G){G=rs(G,e.length);for(var K=[],j=function(Y){var Z=null;Y in i&&(Z=i[Y]),Z||(Z=ts(Y,G,a)),K.push(Z.then(function(oe){for(var ne=0,de=c[Y];ne<de.length;ne++){var se=de[ne];se.map&&(d.delete(se.map),se.map.dispose()),se.map=oe,se.refreshUniforms(),d.add(oe)}return oe}).catch(function(){for(var oe=0,ne=c[Y];oe<ne.length;oe++){var de=ne[oe];de.map&&(d.delete(de.map),de.map.dispose()),de.map=null,de.color=new f.Color(16777215),de.refreshUniforms()}return null}))},J=0,W=Object.keys(c);J<W.length;J++){var $=W[J];j($)}for(var $ in i)delete i[$];return Promise.all(K).then(function(Y){return Y.filter(function(Z){return Z})})};return q(r).then(function(G){return{createAt:s,description:u,objects:l,textures:G,dispose:function(){d.forEach(function(K){K.dispose()}),d.clear()}}})}function rs(n,t){return n=Object.assign({},n),n.autoResize!==!1&&(t>96?n.size=Math.min(n.size||1/0,100):t>48?n.size=Math.min(n.size||1/0,200):t>24?n.size=Math.min(n.size||1/0,400):t>22?n.size=Math.min(n.size||1/0,800):t>5&&(n.size=Math.min(n.size||1/0,1024))),n}function sl(n,t){var e,r,i,a;t===void 0&&(t={});var o=(e=t.fetcher)!==null&&e!==void 0?e:new qt({allowHosts:["*"]}),s={byteLength:0},u=rs((r=t.textureOptions)!==null&&r!==void 0?r:{},(a=(i=t.textureArray)===null||i===void 0?void 0:i.length)!==null&&a!==void 0?a:0),l={};if(t.textureArray)for(var c=0,d=t.textureArray;c<d.length;c++){var p=d[c];l[p]=ts(p,u,o)}return Promise.resolve().then(function(){return o.ajax(n,{responseType:"arraybuffer"})}).then(function(A){return el(A.body)}).then(function(A){return la(function(){for(var h,v={chunks:[],createAt:void 0,description:void 0},g=0,m=A;g<m.length;g++){var y=m[g],b=nl.decode(y);b.chunks.length&&((h=v.chunks).push.apply(h,b.chunks),v.createAt=b.createAt,v.description=b.description)}return v})}).then(function(A){return la(function(){var h,v,g;return ol(A,(h=t.textureBaseUri)!==null&&h!==void 0?h:function(){var m=n.lastIndexOf("/");if(m>=0){var y=n.slice(0,m)+"/";return/\/model\/$/.test(y)&&(y=y.replace(/\/model\/$/,"/materials/")),y}return""}(),((v=t.textureArray)!==null&&v!==void 0?v:[]).slice(),(g=t.textureOptions)!==null&&g!==void 0?g:{},l,o)})}).then(function(A){var h=new f.Group;h.name=n;for(var v=0,g=A.objects;v<g.length;v++){var m=g[v];h.add(m)}return{type:"at3d",upAxis:"Z",uri:n,byteLength:s.byteLength,scene:h,textures:A.textures,dispose:function(){return A.dispose()}}})}const nt=dn.Reader,mt=dn.util,De=dn.roots["@REALSEE/FIVE:five/loaders/model/parsers/protobuf/dome.proto"]||(dn.roots["@REALSEE/FIVE:five/loaders/model/parsers/protobuf/dome.proto"]={}),Zh=De.Model=(()=>{function n(t){if(this.meshes=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.meshes=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Model;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.meshes&&a.meshes.length||(a.meshes=[]),a.meshes.push(De.Mesh.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Model"},n})();De.Mesh=(()=>{function n(t){if(this.chunks=[],this.matrix=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.name="",n.prototype.chunks=mt.emptyArray,n.prototype.matrix=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Mesh;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.name=e.string();break}case 2:{a.chunks&&a.chunks.length||(a.chunks=[]),a.chunks.push(De.Chunk.decode(e,e.uint32()));break}case 3:{a.matrix&&a.matrix.length||(a.matrix=[]),a.matrix.push(De.Matrix.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("name"))throw mt.ProtocolError("missing required 'name'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Mesh"},n})();De.Matrix=(()=>{function n(t){if(this.elements=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.elements=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Matrix;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.elements&&a.elements.length||(a.elements=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.elements.push(e.float())}else a.elements.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Matrix"},n})();De.Chunk=(()=>{function n(t){if(this.material=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.geometry=null,n.prototype.material=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Chunk;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 2:{a.geometry=De.Geometry.decode(e,e.uint32());break}case 3:{a.material&&a.material.length||(a.material=[]),a.material.push(De.Material.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("geometry"))throw mt.ProtocolError("missing required 'geometry'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();De.Geometry=(()=>{function n(t){if(this.groups=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.position=null,n.prototype.uv=null,n.prototype.uv2=null,n.prototype.normal=null,n.prototype.groups=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Geometry;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.position=De.Position.decode(e,e.uint32());break}case 2:{a.uv=De.UV.decode(e,e.uint32());break}case 3:{a.uv2=De.UV.decode(e,e.uint32());break}case 4:{a.normal=De.Normal.decode(e,e.uint32());break}case 5:{a.groups&&a.groups.length||(a.groups=[]),a.groups.push(De.Group.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("position"))throw mt.ProtocolError("missing required 'position'",{instance:a});if(!a.hasOwnProperty("normal"))throw mt.ProtocolError("missing required 'normal'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Geometry"},n})();De.Position=(()=>{function n(t){if(this.array=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.array=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Position;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.array&&a.array.length||(a.array=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.array.push(e.float())}else a.array.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Position"},n})();De.UV=(()=>{function n(t){if(this.array=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.array=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.UV;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.array&&a.array.length||(a.array=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.array.push(e.float())}else a.array.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/UV"},n})();De.Normal=(()=>{function n(t){if(this.array=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.array=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Normal;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.array&&a.array.length||(a.array=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.array.push(e.float())}else a.array.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Normal"},n})();De.Group=(()=>{function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.start=0,n.prototype.count=0,n.prototype.materialIndex=0,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Group;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.start=e.uint32();break}case 2:{a.count=e.uint32();break}case 3:{a.materialIndex=e.uint32();break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("start"))throw mt.ProtocolError("missing required 'start'",{instance:a});if(!a.hasOwnProperty("count"))throw mt.ProtocolError("missing required 'count'",{instance:a});if(!a.hasOwnProperty("materialIndex"))throw mt.ProtocolError("missing required 'materialIndex'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Group"},n})();De.Material=(()=>{function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.kd=null,n.prototype.ks=null,n.prototype.ke=null,n.prototype.mapkd="",n.prototype.mapks="",n.prototype.mapke="",n.prototype.norm="",n.prototype.mapbump="",n.prototype.bump="",n.prototype.mapd="",n.prototype.ns=0,n.prototype.d=0,n.prototype.tr=0,n.prototype.mapkdrepeat="",n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Material;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.kd=De.Color.decode(e,e.uint32());break}case 2:{a.ks=De.Color.decode(e,e.uint32());break}case 3:{a.ke=De.Color.decode(e,e.uint32());break}case 4:{a.mapkd=e.string();break}case 5:{a.mapks=e.string();break}case 6:{a.mapke=e.string();break}case 7:{a.norm=e.string();break}case 8:{a.mapbump=e.string();break}case 9:{a.bump=e.string();break}case 10:{a.mapd=e.string();break}case 11:{a.ns=e.float();break}case 12:{a.d=e.float();break}case 13:{a.tr=e.float();break}case 14:{a.mapkdrepeat=e.string();break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Material"},n})();De.Color=(()=>{function n(t){if(this.rgb=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.rgb=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Color;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.rgb&&a.rgb.length||(a.rgb=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.rgb.push(e.float())}else a.rgb.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Color"},n})();var Yh=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function ul(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new qt({allowHosts:["*"]}),i={byteLength:0};return Promise.resolve().then(function(){return r.ajax(n,{responseType:"arraybuffer"})}).then(function(a){var o;return i.byteLength=a.body.byteLength,ll(new Uint8Array(a.body),t.textureBaseUri||"",(o=t.textureOptions)!==null&&o!==void 0?o:{},r)}).then(function(a){var o=new f.Group;o.matrixAutoUpdate=!1,o.applyMatrix4(Yh),o.matrix.compose(o.position,o.quaternion,o.scale),o.name=n;for(var s=0,u=a.objects;s<u.length;s++){var l=u[s];o.add(l)}return{type:"dome",upAxis:"Z",uri:n,byteLength:i.byteLength,scene:o,textures:a.textures,dispose:function(){return a.dispose()}}})}function $h(n){for(var t=[0,0,0],e=0;e<n.attributes.normal.array.length/9;e++)t[0]=n.attributes.normal.array[e*9],t[1]=n.attributes.normal.array[e*9+1],t[2]=n.attributes.normal.array[e*9+2],n.attributes.normal.array[e*9]=n.attributes.normal.array[e*9+6],n.attributes.normal.array[e*9+1]=n.attributes.normal.array[e*9+7],n.attributes.normal.array[e*9+2]=n.attributes.normal.array[e*9+8],n.attributes.normal.array[e*9+6]=t[0],n.attributes.normal.array[e*9+7]=t[1],n.attributes.normal.array[e*9+8]=t[2];for(var e=0;e<n.attributes.position.array.length/9;e++)t[0]=n.attributes.position.array[e*9],t[1]=n.attributes.position.array[e*9+1],t[2]=n.attributes.position.array[e*9+2],n.attributes.position.array[e*9]=n.attributes.position.array[e*9+6],n.attributes.position.array[e*9+1]=n.attributes.position.array[e*9+7],n.attributes.position.array[e*9+2]=n.attributes.position.array[e*9+8],n.attributes.position.array[e*9+6]=t[0],n.attributes.position.array[e*9+7]=t[1],n.attributes.position.array[e*9+8]=t[2];for(var e=0;e<n.attributes.uv.array.length/6;e++)t[0]=n.attributes.uv.array[e*6],t[1]=n.attributes.uv.array[e*6+1],n.attributes.uv.array[e*6]=n.attributes.uv.array[e*6+4],n.attributes.uv.array[e*6+1]=n.attributes.uv.array[e*6+5],n.attributes.uv.array[e*6+4]=t[0],n.attributes.uv.array[e*6+5]=t[1];n.attributes.normal.needsUpdate=!0,n.attributes.position.needsUpdate=!0,n.attributes.uv.needsUpdate=!0}function ep(n){var t=n.position,e=n.normal,r=n.uv,i=n.uv2,a=n.groups,o=new f.BufferGeometry;o.setAttribute("position",new f.BufferAttribute(new Float32Array(t.array),3)),e&&o.setAttribute("normal",new f.BufferAttribute(new Float32Array(e.array),3)),r&&o.setAttribute("uv",new f.BufferAttribute(new Float32Array(r.array),2)),i&&o.setAttribute("uv2",new f.BufferAttribute(new Float32Array(i.array),2));for(var s=0,u=a;s<u.length;s++){var l=u[s];o.addGroup(l.start,l.count,l.materialIndex)}return o}function Dn(n,t,e,r,i,a,o){if(o.hasOwnProperty(n))return o[n];n=n.split("?")[0],Gr(n)||(n=st(t,n)),n=n.replace(/\/\/vrlab-image\d*.ljcdn.com\//,"//vrlab-public.ljcdn.com/"),n.indexOf("//")===0&&(n="https:"+n);var s=O({key:"texture.dome",size:64},Jt(e,["quality","format","sharpen","mappings"])),u=o[n]=i.loadTexture(n,{imageURL:{transform:e.transform,options:s},wrapS:f.RepeatWrapping,wrapT:f.RepeatWrapping,fetcher:a}).then(function(l){var c=l.body;return r&&c.repeat.copy(r),c.needsUpdate=!0,c.updateMatrix(),c});return u}function tp(n,t,e,r,i,a,o,s){var u=[],l=new br("phong");if(o.add(l),n.kd&&(l.color=new f.Color().fromArray(n.kd.rgb).convertLinearToSRGB()),n.mapkd){var c=null;if(n.mapkdrepeat){var d=n.mapkdrepeat.split(/\s+/).map(function(v){return Number(v)}),p=d[0],A=d[1];c=new f.Vector2(p,A)}u.push(Dn(n.mapkd,t,e,c,r,i,a).then(function(v){v.encoding=f.sRGBEncoding,l.map=v,o.add(v),s.add(v),l.needsUpdate=!0}).catch(Q))}if(n.ks&&(l.specular=new f.Color().fromArray(n.ks.rgb).convertLinearToSRGB()),n.mapks&&u.push(Dn(n.mapks,t,e,null,r,i,a).then(function(v){l.specularMap=v,o.add(v),s.add(v)}).catch(Q)),n.ke&&(l.emissive=new f.Color().fromArray(n.ke.rgb).convertLinearToSRGB()),n.mapke&&u.push(Dn(n.mapke,t,e,null,r,i,a).then(function(v){v.encoding=f.sRGBEncoding,l.emissiveMap=v,o.add(v),s.add(v)}).catch(Q)),n.norm&&u.push(Dn(n.norm,t,e,null,r,i,a).then(function(v){l.normalMap=v,o.add(v),s.add(v)}).catch(Q)),n.mapbump&&u.push(Dn(n.mapbump,t,e,null,r,i,a).then(function(v){l.bumpMap=v,o.add(v),s.add(v)}).catch(Q)),n.bump&&u.push(Dn(n.bump,t,e,null,r,i,a).then(function(v){l.bumpMap=v,o.add(v),s.add(v)}).catch(Q)),typeof n.ns=="number"&&(l.shininess=n.ns),typeof n.d=="number"){var h=n.d;h>0&&h<1&&(l.opacity=h)}return l.floor=0,l.refreshUniforms(),{material:l,textureReady:Promise.all(u).then(function(){return l.refreshUniforms()}).then(Q)}}function rp(n){return Zh.decode(n).meshes}function ll(n,t,e,r){for(var i=[],a=[],o=new Set,s=rp(n),u=new Xn,l=new f.Matrix4,c=new f.Vector3,d=new f.Quaternion,p=new f.Vector3,A={},h=new Set,v=0,g=s;v<g.length;v++){var m=g[v],y=m.name,b=m.chunks,x=m.matrix;if(!(y==="Ceiling"||y==="CeilingDrop"))for(var w=0,M=x;w<M.length;w++){var S=M[w];l.elements=S.elements;for(var E=new f.Group,B=0;B<b.length;B++){var R=ep(b[B].geometry);R.applyMatrix4(l),l.decompose(c,d,p),p.x*p.y*p.z<0&&R.attributes.normal&&R.attributes.position&&R.attributes.uv&&$h(R),o.add(R);for(var C=[],I=0,L=b[B].material;I<L.length;I++){var T=L[I],F=tp(T,t||"",e,u,r,A,o,h),D=F.material,V=F.textureReady;a.push(V),C.push(D)}var z=new Ot(R,C);z.name="chunk_"+B,z.matrix.compose(z.position,z.quaternion,z.scale),z.matrixAutoUpdate=!1,z.frustumCulled=!1,E.add(z)}E.name=y,i.push(E)}}return Promise.all(a).catch(Q).then(function(){return{createAt:0,description:"",objects:i,textures:Array.from(h),dispose:function(){o.forEach(function(U){U.dispose()}),o.clear()}}})}var np=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function cl(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new qt({allowHosts:["*"]}),i={byteLength:0};return Promise.resolve().then(function(){return r.ajax(n,{responseType:"arraybuffer"})}).then(function(a){return i.byteLength=a.body.byteLength,el(a.body)}).then(function(a){var o=a.reduce(function(l,c){return l+c.length},0),s=new Uint8Array(o),u=0;return a.forEach(function(l){s.set(l,u),u+=l.length}),s}).then(function(a){var o;return ll(a,t.textureBaseUri||"",(o=t.textureOptions)!==null&&o!==void 0?o:{},r)}).then(function(a){var o=new f.Group;o.matrixAutoUpdate=!1,o.applyMatrix4(np),o.matrix.compose(o.position,o.quaternion,o.scale),o.name=n;for(var s=0,u=a.objects;s<u.length;s++){var l=u[s];o.add(l)}return{type:"domez",upAxis:"Z",uri:n,byteLength:i.byteLength,scene:o,textures:a.textures,dispose:function(){return a.dispose()}}})}var ip=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function fl(n,t){var e,r;t===void 0&&(t={});var i=(e=t.upAxis)!==null&&e!==void 0?e:"Y",a=(r=t.fetcher)!==null&&r!==void 0?r:new qt({allowHosts:["*"]}),o=0;return Promise.resolve().then(function(){return a.ajax(n,{responseType:"arraybuffer"}).then(function(s){return o=s.body.byteLength,s.body})}).then(function(s){var u;return es(s,{copyUV2:!1,addonExtensions:["PBM_mesh"],resourcePath:n.slice(0,n.lastIndexOf("/")+1),search:(u=n.split("?")[1])!==null&&u!==void 0?u:"",fetcher:a})}).then(function(s){var u=new f.Matrix4;if(i==="Y"&&u.premultiply(ip),s.CESIUM_RTC){var l=new f.Matrix4().setPosition(s.CESIUM_RTC.center);u.premultiply(l)}var c=s.scene;return c.applyMatrix4(u),{type:"gltf",upAxis:"Z",uri:n,byteLength:o,scene:c,textures:s.textures,dispose:function(){return s.dispose()}}})}var Zn=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]),Nt=new f.Color;function ns(n,t){var e,r;t===void 0&&(t={});var i=(e=t.upAxis)!==null&&e!==void 0?e:"Z",a=(r=t.fetcher)!==null&&r!==void 0?r:new qt({allowHosts:["*"]}),o=0;return Promise.resolve().then(function(){return a.ajax(n,{responseType:"arraybuffer"}).then(function(s){return o=s.body.byteLength,s.body})}).then(function(s){var u,l;return ap(s,{propertyNameMapping:(u=t.propertyNameMapping)!==null&&u!==void 0?u:{},customPropertyMapping:(l=t.customPropertyMapping)!==null&&l!==void 0?l:{}})}).then(function(s){var u=s.geometry;switch(t.type){case"geometry":{var l=u;return i==="Y"&&l.applyMatrix4(Zn),{type:"ply",upAxis:"Z",uri:n,byteLength:o,scene:l,meta:{},textures:[],dispose:function(){u.dispose()}}}case"mesh":{var c="color"in u.attributes,d=new f.MeshBasicMaterial({vertexColors:c}),l=new f.Mesh(u,d);return i==="Y"&&l.applyMatrix4(Zn),{type:"ply",upAxis:"Z",uri:n,byteLength:o,scene:l,meta:{},textures:[],dispose:function(){u.dispose(),d.dispose()}}}case"line":{var c="color"in u.attributes,p=new f.LineBasicMaterial({vertexColors:c}),l=new f.Line(u,p);return l.computeLineDistances(),i==="Y"&&l.applyMatrix4(Zn),{type:"ply",upAxis:"Z",uri:n,byteLength:o,scene:l,meta:{},textures:[],dispose:function(){u.dispose(),p.dispose()}}}case"points":{var A=new f.PointsMaterial({}),l=new f.Points(u,A);return i==="Y"&&l.applyMatrix4(Zn),{type:"ply",upAxis:"Z",uri:n,byteLength:o,scene:l,meta:{},textures:[],dispose:function(){u.dispose(),A.dispose()}}}case"pbmPointCloud":{var h=new Pi,l=new yr(u,h);return i==="Y"&&l.applyMatrix4(Zn),{type:"ply",upAxis:"Z",uri:n,byteLength:o,scene:l,meta:{},textures:[],dispose:function(){u.dispose(),h.dispose()}}}}throw new Error("Invalid Type: ".concat(t.type))})}function ap(n,t){var e=new Uint8Array(n),r=hp(e),i=r.headerText,a=r.headerLength,o=sp(i,a,t);if(o.format==="ascii"){var s=new TextDecoder().decode(e);return{header:o,geometry:lp(s,o,t)}}else return{header:o,geometry:dp(n,o,t)}}function op(n,t){var e={name:"",type:n[0]};return e.type==="list"?(e.name=n[3],e.countType=n[1],e.itemType=n[2]):e.name=n[1],e.name in t.propertyNameMapping&&(e.name=t.propertyNameMapping[e.name]),e}function sp(n,t,e){t===void 0&&(t=0);var r=/^ply([\s\S]*)end_header(\r\n|\r|\n)/,i="",a=r.exec(n);a!==null&&(i=a[1]);for(var o={format:"",version:"",comments:[],elements:[],headerLength:t,objInfo:""},s=i.split(/\r\n|\r|\n/),u=null,l=0;l<s.length;l++){var c=s[l];if(c=c.trim(),c!==""){var d=c.split(/\s+/),p=d.shift();switch(c=d.join(" "),p){case"format":o.format=d[0],o.version=d[1];break;case"comment":o.comments.push(c);break;case"element":u&&o.elements.push(u),u={name:d[0],count:parseInt(d[1]),properties:[]};break;case"property":u&&u.properties.push(op(d,e));break;case"obj_info":o.objInfo=c;break;default:console.log("unhandled",p,d)}}}return u&&o.elements.push(u),o}function Ja(n,t){switch(t){case"char":case"uchar":case"short":case"ushort":case"int":case"uint":case"int8":case"uint8":case"int16":case"uint16":case"int32":case"uint32":return parseInt(n);case"float":case"double":case"float32":case"float64":return parseFloat(n);default:throw new Error("unspport type: "+t)}}function up(n,t){for(var e={},r=0;r<n.length;r++){if(t.empty())return null;if(n[r].type==="list"){for(var i=[],a=Ja(t.next(),n[r].countType),o=0;o<a;o++){if(t.empty())return null;i.push(Ja(t.next(),n[r].itemType))}e[n[r].name]=i}else e[n[r].name]=Ja(t.next(),n[r].type)}return e}function dl(n){for(var t={indices:[],vertices:[],normals:[],uvs:[],faceVertexUvs:[],colors:[],faceVertexColors:[]},e=0,r=Object.keys(n.customPropertyMapping);e<r.length;e++){var i=r[e];t[i]=[]}return t}function hl(n){var t=n.map(function(r){return r.name});function e(r){for(var i=0,a=r.length;i<a;i++){var o=r[i];if(t.includes(o))return o}return null}return{attrX:e(["x","px","posx"])||"x",attrY:e(["y","py","posy"])||"y",attrZ:e(["z","pz","posz"])||"z",attrNX:e(["nx","normalx"]),attrNY:e(["ny","normaly"]),attrNZ:e(["nz","normalz"]),attrS:e(["s","u","texture_u","tx"]),attrT:e(["t","v","texture_v","ty"]),attrR:e(["red","diffuse_red","r","diffuse_r"]),attrG:e(["green","diffuse_green","g","diffuse_g"]),attrB:e(["blue","diffuse_blue","b","diffuse_b"])}}function lp(n,t,e){var r=dl(e),i=/end_header\s+(\S[\s\S]*\S|\S)\s*$/,a,o=null;(o=i.exec(n))!==null?a=o[1].split(/\s+/):a=[];var s=new pp(a);e:for(var u=0;u<t.elements.length;u++)for(var l=t.elements[u],c=hl(l.properties),d=0;d<l.count;d++){var p=up(l.properties,s);if(!p)break e;vl(r,l.name,p,c,e)}return pl(r,e)}function pl(n,t){var e=new f.BufferGeometry;n.indices.length>0&&e.setIndex(n.indices),e.setAttribute("position",new f.Float32BufferAttribute(n.vertices,3)),n.normals.length>0&&e.setAttribute("normal",new f.Float32BufferAttribute(n.normals,3)),n.uvs.length>0&&e.setAttribute("uv",new f.Float32BufferAttribute(n.uvs,2)),n.colors.length>0&&e.setAttribute("color",new f.Float32BufferAttribute(n.colors,3)),(n.faceVertexUvs.length>0||n.faceVertexColors.length>0)&&(e=e.toNonIndexed(),n.faceVertexUvs.length>0&&e.setAttribute("uv",new f.Float32BufferAttribute(n.faceVertexUvs,2)),n.faceVertexColors.length>0&&e.setAttribute("color",new f.Float32BufferAttribute(n.faceVertexColors,3)));for(var r=0,i=Object.keys(t.customPropertyMapping);r<i.length;r++){var a=i[r];if(n[a].length>0){var o=t.customPropertyMapping[a],s=o.itemType,u=o.itemNames,l=o.normalized,c=u.length,d=void 0;switch(s){case"float32":d=new f.Float32BufferAttribute(n[a],c,l);break;case"uint32":d=new f.Uint32BufferAttribute(n[a],c,l);break;case"int32":d=new f.Int32BufferAttribute(n[a],c,l);break;case"uint16":d=new f.Uint16BufferAttribute(n[a],c,l);break;case"int16":d=new f.Int16BufferAttribute(n[a],c,l);break;case"uint8":d=new f.Uint8BufferAttribute(n[a],c,l);break;case"int8":d=new f.Int8BufferAttribute(n[a],c,l);break;default:d=new f.Float32BufferAttribute(n[a],c,l);break}e.setAttribute(a,d)}}return e.computeBoundingSphere(),e}function vl(n,t,e,r,i){if(t==="vertex"){r.attrX!==null&&r.attrY!==null&&r.attrZ!==null&&n.vertices.push(e[r.attrX],e[r.attrY],e[r.attrZ]),r.attrNX!==null&&r.attrNY!==null&&r.attrNZ!==null&&n.normals.push(e[r.attrNX],e[r.attrNY],e[r.attrNZ]),r.attrS!==null&&r.attrT!==null&&n.uvs.push(e[r.attrS],e[r.attrT]),r.attrR!==null&&r.attrG!==null&&r.attrB!==null&&(Nt.setRGB(e[r.attrR]/255,e[r.attrG]/255,e[r.attrB]/255),n.colors.push(Nt.r,Nt.g,Nt.b));for(var a=0,o=Object.keys(i.customPropertyMapping);a<o.length;a++)for(var s=o[a],u=0,l=i.customPropertyMapping[s].itemNames;u<l.length;u++){var c=l[u];n[s].push(e[c])}}else if(t==="face"){var d=e.vertex_indices||e.vertex_index,p=e.texcoord;d.length===3?(n.indices.push(d[0],d[1],d[2]),p&&p.length===6&&(n.faceVertexUvs.push(p[0],p[1]),n.faceVertexUvs.push(p[2],p[3]),n.faceVertexUvs.push(p[4],p[5]))):d.length===4&&(n.indices.push(d[0],d[1],d[3]),n.indices.push(d[1],d[2],d[3])),r.attrR!==null&&r.attrG!==null&&r.attrB!==null&&(Nt.setRGB(e[r.attrR]/255,e[r.attrG]/255,e[r.attrB]/255),n.faceVertexColors.push(Nt.r,Nt.g,Nt.b),n.faceVertexColors.push(Nt.r,Nt.g,Nt.b),n.faceVertexColors.push(Nt.r,Nt.g,Nt.b))}}function cp(n,t){for(var e={},r=0,i=0;i<t.length;i++){var a=t[i],o=a.valueReader;if(a.type==="list"){var s=[],u=a.countReader.read(n+r);r+=a.countReader.size;for(var l=0;l<u;l++)s.push(o.read(n+r)),r+=o.size;e[a.name]=s}else e[a.name]=o.read(n+r),r+=o.size}return[e,r]}function fp(n,t,e){function r(s,u,l){switch(u){case"int8":case"char":return{read:function(c){return s.getInt8(c)},size:1};case"uint8":case"uchar":return{read:function(c){return s.getUint8(c)},size:1};case"int16":case"short":return{read:function(c){return s.getInt16(c,l)},size:2};case"uint16":case"ushort":return{read:function(c){return s.getUint16(c,l)},size:2};case"int32":case"int":return{read:function(c){return s.getInt32(c,l)},size:4};case"uint32":case"uint":return{read:function(c){return s.getUint32(c,l)},size:4};case"float32":case"float":return{read:function(c){return s.getFloat32(c,l)},size:4};case"float64":case"double":return{read:function(c){return s.getFloat64(c,l)},size:8};default:throw new Error("not support type: "+u)}}for(var i=0,a=n.length;i<a;i++){var o=n[i];o.type==="list"?(o.countReader=r(t,o.countType,e),o.valueReader=r(t,o.itemType,e)):o.valueReader=r(t,o.type,e)}}function dp(n,t,e){for(var r=dl(e),i=t.format==="binary_little_endian",a=new DataView(n,t.headerLength),o,s=0,u=0;u<t.elements.length;u++){var l=t.elements[u],c=l.properties,d=hl(c);fp(c,a,i);for(var p=0;p<l.count;p++){o=cp(s,c),s+=o[1];var A=o[0];vl(r,l.name,A,d,e)}}return pl(r,e)}function hp(n){var t=0,e=!0,r="",i=[],a=new TextDecoder().decode(n.subarray(0,5)),o=/^ply\r\n/.test(a);do{var s=String.fromCharCode(n[t++]);s!==`
|
|
929
|
+
`&&s!=="\r"?r+=s:(r==="end_header"&&(e=!1),r!==""&&(i.push(r),r=""))}while(e&&t<n.length);return o===!0&&t++,{headerText:i.join("\r")+"\r",headerLength:t}}var pp=function(){function n(t){this.arr=t,this.i=0}return n.prototype.empty=function(){return this.i>=this.arr.length},n.prototype.next=function(){return this.arr[this.i++]},n}(),vp=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]),mp=/^[og]\s*(.+)?/,Ap=/^mtllib /,gp=/^usemtl /,yp=/^usemap /,u0=/\s+/,Yn=new f.Color,bp=function(){function n(){this.objects=[],this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.materials={},this.materialLibraries=[],this.startObject("",!1)}return n.prototype.startObject=function(t,e){if(this.object&&this.object.fromDeclaration===!1){this.object.name=t,this.object.fromDeclaration=e!==!1;return}var r=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:t||"",fromDeclaration:e!==!1,geometry:{vertices:[],hasNormal:!0,normals:[],hasColor:!0,colors:[],hasUV:!0,uvs:[],index:[],indexMap:{}},materials:[],smooth:!0,startMaterial:function(a,o){var s,u,l=this._finalize(!1);l&&(l.inherited||((s=l.groupCount)!==null&&s!==void 0?s:0)<=0)&&this.materials.splice((u=l.index)!==null&&u!==void 0?u:0,1);var c={index:this.materials.length,name:a||"",mtllib:Array.isArray(o)&&o.length>0?o[o.length-1]:"",smooth:l!==void 0?l.smooth:this.smooth,groupStart:l!==void 0?l.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(d){var p={index:typeof d=="number"?d:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(){return this}};return p.clone=this.clone.bind(p),p}};return this.materials.push(c),c},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(a){var o,s,u=this.currentMaterial();if(u&&u.groupEnd===-1&&(u.groupEnd=this.geometry.index.length,u.groupCount=u.groupEnd-((o=u.groupStart)!==null&&o!==void 0?o:0),u.inherited=!1),a&&this.materials.length>1)for(var l=this.materials.length-1;l>=0;l--)((s=this.materials[l].groupCount)!==null&&s!==void 0?s:0)<=0&&this.materials.splice(l,1);return a&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),u}},r&&r.name&&typeof r.clone=="function"){var i=r.clone(0);i.inherited=!0,this.object.materials.push(i)}this.objects.push(this.object)},n.prototype.finalize=function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},n.prototype.parseVertexIndex=function(t,e){var r=parseInt(t,10);return(r>=0?r-1:r+e/3)*3},n.prototype.parseNormalIndex=function(t,e){var r=parseInt(t,10);return(r>=0?r-1:r+e/3)*3},n.prototype.parseUVIndex=function(t,e){var r=parseInt(t,10);return(r>=0?r-1:r+e/2)*2},n.prototype.addFace=function(t,e,r,i,a,o,s,u,l){var c=this.object.geometry,d=this.vertices.length,p=this.normals.length,A=this.uvs.length,h=this.parseVertexIndex(t,d),v=this.parseVertexIndex(e,d),g=this.parseVertexIndex(r,d),m=s!==void 0?this.parseNormalIndex(s,p):void 0,y=u!==void 0?this.parseNormalIndex(u,p):void 0,b=l!==void 0?this.parseNormalIndex(l,p):void 0,x=i!==void 0?this.parseUVIndex(i,A):void 0,w=a!==void 0?this.parseUVIndex(a,A):void 0,M=o!==void 0?this.parseUVIndex(o,A):void 0;(c.hasNormal===!0&&m===void 0||y===void 0||b===void 0)&&(c.hasNormal=!1),(c.hasUV===!0&&x===void 0||w===void 0||M===void 0)&&(c.hasUV=!1);var S=[h,x,m].join(":"),E=c.indexMap[S];E===void 0&&(E=c.vertices.length/3,c.indexMap[S]=E,c.vertices.push(this.vertices[h+0],this.vertices[h+1],this.vertices[h+2]),c.hasColor&&(this.colors[h]===void 0?c.hasColor=!1:c.colors.push(this.colors[h+0],this.colors[h+1],this.colors[h+2])),c.hasNormal&&c.normals.push(this.normals[h+0],this.normals[h+1],this.normals[h+2]),c.hasUV&&c.uvs.push(this.uvs[x+0],this.uvs[x+1])),c.index.push(E);var B=[v,w,y].join(":"),R=c.indexMap[B];R===void 0&&(R=c.vertices.length/3,c.indexMap[B]=R,c.vertices.push(this.vertices[v+0],this.vertices[v+1],this.vertices[v+2]),c.hasColor&&(this.colors[v]===void 0?c.hasColor=!1:c.colors.push(this.colors[v+0],this.colors[v+1],this.colors[v+2])),c.hasNormal&&c.normals.push(this.normals[v+0],this.normals[v+1],this.normals[v+2]),c.hasUV&&c.uvs.push(this.uvs[w+0],this.uvs[w+1])),c.index.push(R);var C=[g,M,b].join(":"),I=c.indexMap[C];I===void 0&&(I=c.vertices.length/3,c.indexMap[C]=I,c.vertices.push(this.vertices[g+0],this.vertices[g+1],this.vertices[g+2]),c.hasColor&&(this.colors[g]===void 0?c.hasColor=!1:c.colors.push(this.colors[g+0],this.colors[g+1],this.colors[g+2])),c.hasNormal&&c.normals.push(this.normals[g+0],this.normals[g+1],this.normals[g+2]),c.hasUV&&c.uvs.push(this.uvs[M+0],this.uvs[M+1])),c.index.push(I)},n}();function xp(n){var t=new bp;n.indexOf(`\r
|
|
930
930
|
`)!==-1&&(n=n.replace(/\r\n/g,`
|
|
931
931
|
`)),n.indexOf(`\\
|
|
932
932
|
`)!==-1&&(n=n.replace(/\\\n/g,""));for(var e=n.split(`
|
|
933
933
|
`),r=[],i=0,a=e.length;i<a;i++){var o=e[i].trimStart();if(o.length!==0){var s=o.charAt(0);if(s!=="#"){if(s==="v"){var u=o.split(u0);switch(u[0]){case"v":t.vertices.push(parseFloat(u[1]),parseFloat(u[2]),parseFloat(u[3])),u.length>=7?(Yn.setRGB(parseFloat(u[4]),parseFloat(u[5]),parseFloat(u[6])),Yn.convertSRGBToLinear(),t.colors.push(Yn.r,Yn.g,Yn.b)):t.colors.push(void 0,void 0,void 0);break;case"vn":t.normals.push(parseFloat(u[1]),parseFloat(u[2]),parseFloat(u[3]));break;case"vt":t.uvs.push(parseFloat(u[1]),parseFloat(u[2]));break}}else if(s==="f"){for(var l=o.slice(1).trim(),c=l.split(u0),d=[],p=0,A=c.length;p<A;p++){var h=c[p];if(h.length>0){var v=h.split("/");d.push(v)}}for(var g=d[0],p=1,A=d.length-1;p<A;p++){var m=d[p],y=d[p+1];t.addFace(g[0],m[0],y[0],g[1],m[1],y[1],g[2],m[2],y[2])}}else if(s!=="l"){if(s!=="p")if((r=mp.exec(o))!==null){var b=(" "+r[0].slice(1).trim()).slice(1);t.startObject(b)}else if(gp.test(o))t.object.startMaterial(o.substring(7).trim(),t.materialLibraries);else if(Ap.test(o))t.materialLibraries.push(o.substring(7).trim());else if(yp.test(o))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(s==="s"){if(r=o.split(" "),r.length>1){var x=r[1].trim().toLowerCase();t.object.smooth=x!=="0"&&x!=="off"}else t.object.smooth=!0;var w=t.object.currentMaterial();w&&(w.smooth=t.object.smooth)}else{if(o==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+o+'"')}}}}}return t.finalize(),t}function wp(n,t,e){for(var r=new Xn,i=t.split(`
|
|
934
|
-
`),a={name:""},o=/\s+/,s={},u=0;u<i.length;u++){var l=i[u];if(l=l.trim(),!(l.length===0||l.charAt(0)==="#")){var c=l.indexOf(" "),d=c>=0?l.substring(0,c):l;d=d.toLowerCase();var p=c>=0?l.substring(c+1):"";if(p=p.trim(),d==="newmtl")a={name:p},s[p]=a;else if(d==="ka"||d==="kd"||d==="ks"||d==="ke"){var A=p.split(o,3);a[d]=[parseFloat(A[0]),parseFloat(A[1]),parseFloat(A[2])]}else(d==="map_kd"||d==="map_ks"||d==="map_ke"||d==="norm"||d==="map_bump"||d==="bump"||d==="map_d"||d==="ns"||d==="d"||d==="tr")&&(a[d]=p)}}function h(g){var m={url:"",scale:new f.Vector2(1,1),offset:new f.Vector2(0,0),bumpScale:1},y=g.split(/\s+/),b;return b=y.indexOf("-bm"),b>=0&&(m.bumpScale=parseFloat(y[b+1]),y.splice(b,2)),b=y.indexOf("-s"),b>=0&&(m.scale.set(parseFloat(y[b+1]),parseFloat(y[b+2])),y.splice(b,4)),b=y.indexOf("-o"),b>=0&&(m.offset.set(parseFloat(y[b+1]),parseFloat(y[b+2])),y.splice(b,4)),m.url=y.join(" ").trim(),m}function v(g,m,y){var b=h(y),x=st(e.path,b.url);return r.loadTexture(x,{fetcher:e.fetcher,encoding:m==="map"||m==="emissiveMap"?f.sRGBEncoding:f.LinearEncoding,minFilter:f.LinearFilter,magFilter:f.LinearFilter,wrapS:f.RepeatWrapping,wrapT:f.RepeatWrapping}).then(function(w){var M=w.body;return M.repeat.copy(b.scale),M.offset.copy(b.offset),g.bumpScale=b.bumpScale,g[m]=M,M})}return{name:n,create:function(g){var m=new br(e.materialType),y=[],b=s[g];if(b){if(b.kd!==void 0&&m.color.fromArray(b.kd),b.ks!==void 0&&m.specular.fromArray(b.ks),b.ke!==void 0&&m.emissive.fromArray(b.ke),b.map_kd!==void 0&&y.push(v(m,"map",b.map_kd)),b.map_ks!==void 0&&y.push(v(m,"specularMap",b.map_ks)),b.map_ke!==void 0&&y.push(v(m,"emissiveMap",b.map_ke)),b.norm!==void 0&&y.push(v(m,"normalMap",b.norm)),b.map_bump!==void 0&&y.push(v(m,"bumpMap",b.map_bump)),b.bump!==void 0&&y.push(v(m,"bumpMap",b.bump)),b.map_d!==void 0&&y.push(v(m,"alphaMap",b.map_d)),b.ns!==void 0&&(m.shininess=parseFloat(b.ns)),b.d!==void 0){var x=parseFloat(b.d);x<1&&(m.opacity=x,m.transparent=!0)}if(b.tr!==void 0){var x=parseFloat(b.tr);x>0&&(m.opacity=1-x,m.transparent=!0)}}var w=Promise.all(y).then(function(M){return m.refreshUniforms(),M});return[m,w]}}}function Mp(n,t){for(var e,r=[],i=[],a=new f.Group,o=function(l,c){var d=n.objects[l],p=d.geometry,A=d.materials,h=!1;if(p.vertices.length===0)return"continue";var v=new f.BufferGeometry;i.push(function(){return v.dispose()}),v.setAttribute("position",new f.BufferAttribute(new Float32Array(p.vertices),3)),p.normals.length>0&&v.setAttribute("normal",new f.BufferAttribute(new Float32Array(p.normals),3)),p.colors.length>0&&(h=!0,v.setAttribute("color",new f.BufferAttribute(new Float32Array(p.colors),3))),p.uvs.length>0&&v.setAttribute("uv",new f.BufferAttribute(new Float32Array(p.uvs),2)),p.index.length>0&&v.setIndex(new f.BufferAttribute(new Uint32Array(p.index),1)),v.computeBoundingBox(),v.computeBoundingSphere();for(var g=[],m=function(M,S){var E=A[M],P=E.name+"_"+E.smooth+"_"+h,B=n.materials[P];if(!B){for(var C=null,I=0,F=t;I<F.length;I++){var T=F[I],L=T.name,D=T.create;L===E.mtllib&&(C=D(E.name))}if(!C){var V=new br;V.refreshUniforms(),C=[V,Promise.resolve([])]}B=C[0],B.name=E.name,B.flatShading=!(E.smooth||v.attributes.normal),B.vertexColors=h,n.materials[P]=B;var z=C[1];r.push(z),i.push(function(){return B.dispose()})}g.push(B)},y=0,b=A.length;y<b;y++)m(y);v.clearGroups();for(var y=0,b=A.length;y<b;y++){var x=A[y];x.groupCount&&v.addGroup((e=x.groupStart)!==null&&e!==void 0?e:0,x.groupCount,y)}(!v.groups||v.groups.length===0)&&v.addGroup(0,v.index?v.index.count:v.attributes.position.count,0);var w=new Ot(v,g);w.name=d.name,a.add(w)},s=0,u=n.objects.length;s<u;s++)o(s);return Promise.all(r).then(function(l){for(var c=[],d=0,p=l;d<p.length;d++){var A=p[d];c=c.concat(A)}return{scene:a,textures:c,dispose:function(){return i.forEach(function(h){return h()})}}})}function Sp(n,t){var e,r,i;t===void 0&&(t={});var a=(e=t.upAxis)!==null&&e!==void 0?e:"Z",o=(r=t.materialType)!==null&&r!==void 0?r:"basic",s=(i=t.fetcher)!==null&&i!==void 0?i:new Ut({allowHosts:["*"]}),u=n.slice(0,n.lastIndexOf("/")+1),l=0,c;return Promise.resolve().then(function(){return s.ajax(n,{responseType:"arraybuffer"})}).then(function(d){l=d.body.byteLength;var p=new TextDecoder;return p.decode(d.body)}).then(function(d){return c=xp(d),Promise.all(c.materialLibraries.map(function(p){var A=st(u,p),h=A.slice(0,A.lastIndexOf("/")+1);return s.ajax(A,{responseType:"text"}).then(function(v){return wp(p,v.body,{path:h,materialType:o,fetcher:s})})}))}).then(function(d){return Mp(c,d)}).then(function(d){var p=new f.Matrix4;return a==="Y"&&p.premultiply(vp),d.scene.applyMatrix4(p),{type:"obj",upAxis:"Z",uri:n,byteLength:l,scene:d.scene,textures:d.textures,dispose:function(){return d.dispose()}}})}var jt=Uint8Array,Qn=Uint16Array,Cp=Int32Array,ml=new jt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Al=new jt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ep=new jt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),gl=function(n,t){for(var e=new Qn(31),r=0;r<31;++r)e[r]=t+=1<<n[r-1];for(var i=new Cp(e[30]),r=1;r<30;++r)for(var a=e[r];a<e[r+1];++a)i[a]=a-e[r]<<5|r;return{b:e,r:i}},yl=gl(ml,2),bl=yl.b,Ip=yl.r;bl[28]=258,Ip[258]=28;var Tp=gl(Al,0),Pp=Tp.b,Io=new Qn(32768);for(var je=0;je<32768;++je){var nn=(je&43690)>>1|(je&21845)<<1;nn=(nn&52428)>>2|(nn&13107)<<2,nn=(nn&61680)>>4|(nn&3855)<<4,Io[je]=((nn&65280)>>8|(nn&255)<<8)>>1}var di=function(n,t,e){for(var r=n.length,i=0,a=new Qn(t);i<r;++i)n[i]&&++a[n[i]-1];var o=new Qn(t);for(i=1;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(e){s=new Qn(1<<t);var u=15-t;for(i=0;i<r;++i)if(n[i])for(var l=i<<4|n[i],c=t-n[i],d=o[n[i]-1]++<<c,p=d|(1<<c)-1;d<=p;++d)s[Io[d]>>u]=l}else for(s=new Qn(r),i=0;i<r;++i)n[i]&&(s[i]=Io[o[n[i]-1]++]>>15-n[i]);return s},Ri=new jt(288);for(var je=0;je<144;++je)Ri[je]=8;for(var je=144;je<256;++je)Ri[je]=9;for(var je=256;je<280;++je)Ri[je]=7;for(var je=280;je<288;++je)Ri[je]=8;var xl=new jt(32);for(var je=0;je<32;++je)xl[je]=5;var Rp=di(Ri,9,1),Bp=di(xl,5,1),Xa=function(n){for(var t=n[0],e=1;e<n.length;++e)n[e]>t&&(t=n[e]);return t},lr=function(n,t,e){var r=t/8|0;return(n[r]|n[r+1]<<8)>>(t&7)&e},Wa=function(n,t){var e=t/8|0;return(n[e]|n[e+1]<<8|n[e+2]<<16)>>(t&7)},Fp=function(n){return(n+7)/8|0},is=function(n,t,e){return(t==null||t<0)&&(t=0),(e==null||e>n.length)&&(e=n.length),new jt(n.subarray(t,e))},Lp=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],zt=function(n,t,e){var r=new Error(t||Lp[n]);if(r.code=n,Error.captureStackTrace&&Error.captureStackTrace(r,zt),!e)throw r;return r},wl=function(n,t,e,r){var i=n.length,a=r?r.length:0;if(!i||t.f&&!t.l)return e||new jt(0);var o=!e,s=o||t.i!=2,u=t.i;o&&(e=new jt(i*3));var l=function(de){var se=e.length;if(de>se){var ye=new jt(Math.max(se*2,de));ye.set(e),e=ye}},c=t.f||0,d=t.p||0,p=t.b||0,A=t.l,h=t.d,v=t.m,g=t.n,m=i*8;do{if(!A){c=lr(n,d,1);var y=lr(n,d+1,3);if(d+=3,y)if(y==1)A=Rp,h=Bp,v=9,g=5;else if(y==2){var M=lr(n,d,31)+257,S=lr(n,d+10,15)+4,E=M+lr(n,d+5,31)+1;d+=14;for(var P=new jt(E),B=new jt(19),C=0;C<S;++C)B[Ep[C]]=lr(n,d+C*3,7);d+=S*3;for(var I=Xa(B),F=(1<<I)-1,T=di(B,I,1),C=0;C<E;){var L=T[lr(n,d,F)];d+=L&15;var b=L>>4;if(b<16)P[C++]=b;else{var D=0,V=0;for(b==16?(V=3+lr(n,d,3),d+=2,D=P[C-1]):b==17?(V=3+lr(n,d,7),d+=3):b==18&&(V=11+lr(n,d,127),d+=7);V--;)P[C++]=D}}var z=P.subarray(0,M),U=P.subarray(M);v=Xa(z),g=Xa(U),A=di(z,v,1),h=di(U,g,1)}else zt(1);else{var b=Fp(d)+4,x=n[b-4]|n[b-3]<<8,w=b+x;if(w>i){u&&zt(0);break}s&&l(p+x),e.set(n.subarray(b,w),p),t.b=p+=x,t.p=d=w*8,t.f=c;continue}if(d>m){u&&zt(0);break}}s&&l(p+131072);for(var q=(1<<v)-1,G=(1<<g)-1,K=d;;K=d){var D=A[Wa(n,d)&q],_=D>>4;if(d+=D&15,d>m){u&&zt(0);break}if(D||zt(2),_<256)e[p++]=_;else if(_==256){K=d,A=null;break}else{var J=_-254;if(_>264){var C=_-257,W=ml[C];J=lr(n,d,(1<<W)-1)+bl[C],d+=W}var $=h[Wa(n,d)&G],Y=$>>4;$||zt(3),d+=$&15;var U=Pp[Y];if(Y>3){var W=Al[Y];U+=Wa(n,d)&(1<<W)-1,d+=W}if(d>m){u&&zt(0);break}s&&l(p+131072);var Z=p+J;if(p<U){var oe=a-U,ne=Math.min(U,Z);for(oe+p<0&&zt(3);p<ne;++p)e[p]=r[oe+p]}for(;p<Z;++p)e[p]=e[p-U]}}t.l=A,t.p=K,t.b=p,t.f=c,A&&(c=1,t.m=v,t.d=h,t.n=g)}while(!c);return p!=e.length&&o?is(e,0,p):e.subarray(0,p)},kp=new jt(0),Pr=function(n,t){return n[t]|n[t+1]<<8},mr=function(n,t){return(n[t]|n[t+1]<<8|n[t+2]<<16|n[t+3]<<24)>>>0},Za=function(n,t){return mr(n,t)+mr(n,t+4)*4294967296},Op=function(n,t){return((n[0]&15)!=8||n[0]>>4>7||(n[0]<<8|n[1])%31)&&zt(6,"invalid zlib data"),(n[1]>>5&1)==+!t&&zt(6,"invalid zlib data: "+(n[1]&32?"need":"unexpected")+" dictionary"),(n[1]>>3&4)+2};function Dp(n,t){return wl(n,{i:2},t&&t.out,t&&t.dictionary)}function Vp(n,t){return wl(n.subarray(Op(n,t),-4),{i:2},t,t)}var To=typeof TextDecoder!="undefined"&&new TextDecoder,Np=0;try{To.decode(kp,{stream:!0}),Np=1}catch(n){}var zp=function(n){for(var t="",e=0;;){var r=n[e++],i=(r>127)+(r>223)+(r>239);if(e+i>n.length)return{s:t,r:is(n,e-1)};i?i==3?(r=((r&15)<<18|(n[e++]&63)<<12|(n[e++]&63)<<6|n[e++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?t+=String.fromCharCode((r&31)<<6|n[e++]&63):t+=String.fromCharCode((r&15)<<12|(n[e++]&63)<<6|n[e++]&63):t+=String.fromCharCode(r)}};function Qp(n,t){if(t){for(var e="",r=0;r<n.length;r+=16384)e+=String.fromCharCode.apply(null,n.subarray(r,r+16384));return e}else{if(To)return To.decode(n);var i=zp(n),a=i.s,e=i.r;return e.length&&zt(8),a}}var Up=function(n,t){return t+30+Pr(n,t+26)+Pr(n,t+28)},qp=function(n,t,e){var r=Pr(n,t+28),i=Qp(n.subarray(t+46,t+46+r),!(Pr(n,t+8)&2048)),a=t+46+r,o=mr(n,t+20),s=e&&o==4294967295?Hp(n,a):[o,mr(n,t+24),mr(n,t+42)],u=s[0],l=s[1],c=s[2];return[Pr(n,t+10),u,l,i,a+Pr(n,t+30)+Pr(n,t+32),c]},Hp=function(n,t){for(;Pr(n,t)!=1;t+=4+Pr(n,t+2));return[Za(n,t+12),Za(n,t+4),Za(n,t+20)]};function Gp(n,t){for(var e={},r=n.length-22;mr(n,r)!=101010256;--r)(!r||n.length-r>65558)&&zt(13);var i=Pr(n,r+8);if(!i)return{};var a=mr(n,r+16),o=a==4294967295||i==65535;if(o){var s=mr(n,r-12);o=mr(n,s)==101075792,o&&(i=mr(n,s+32),a=mr(n,s+48))}for(var u=0;u<i;++u){var l=qp(n,a,o),c=l[0],d=l[1],p=l[2],A=l[3],h=l[4],v=l[5],g=Up(n,v);a=h,c?c==8?e[A]=Dp(n.subarray(g,g+d),{out:new jt(p)}):zt(14,"unknown compression type "+c):e[A]=is(n,g,g+d)}return e}var Kp=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function Ml(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new Ut({allowHosts:["*"]}),i=0;return Promise.resolve().then(function(){return r.ajax(n,{responseType:"arraybuffer"}).then(function(a){return i=a.body.byteLength,a.body})}).then(function(a){var o;return jp(a,{materialType:t.materialType,resourcePath:n.slice(0,n.lastIndexOf("/")+1),search:(o=n.split("?")[1])!==null&&o!==void 0?o:"",fetcher:r})}).then(function(a){var o=a.scene,s=a.unitScale/100,u=new f.Matrix4;return u.makeScale(s,s,s),a.upAxis==="Y"&&u.premultiply(Kp),o.applyMatrix4(u),{type:"fbx",upAxis:"Z",uri:n,byteLength:i,scene:o,textures:a.textures,dispose:function(){return a.dispose()}}})}function jp(n,t){var e;if(Yp(n))e=new Zp().parse(n);else{var r=Cl(n);if(!$p(r))throw new Error("THREE.FBXLoader: Unknown format.");if(c0(r)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+c0(r));e=new Wp().parse(r)}return new _p(t).parse(e)}var _p=function(){function n(t){var e,r,i;this.materialType=(e=t.materialType)!==null&&e!==void 0?e:"phong",this.resourcePath=(r=t.resourcePath)!==null&&r!==void 0?r:"",this.search=(i=t.search)!==null&&i!==void 0?i:"",this.fetcher=t.fetcher}return n.prototype.parse=function(t){var e,r,i,a,o,s,u=this.parseConnections(t),l=new f.Group,c=[],d=this.parseImages(t),p=this.parseTextures(t,d,u,c),A=this.parseMaterials(t,p,u),h=this.parseDeformers(t,u),v=new Jp().parse(t,h,u);this.parseScene(t,h,v,A,u,l);var g=(r=(e=t.GlobalSettings.UpAxis)===null||e===void 0?void 0:e.value)!==null&&r!==void 0?r:1,m=(a=(i=t.GlobalSettings.FrontAxis)===null||i===void 0?void 0:i.value)!==null&&a!==void 0?a:2,y=(s=(o=t.GlobalSettings.UnitScaleFactor)===null||o===void 0?void 0:o.value)!==null&&s!==void 0?s:1,b;if(t.GlobalSettings.AmbientColor){var x=t.GlobalSettings.AmbientColor.value,w=x[0],M=x[1],S=x[2];if(w!==0||M!==0||S!==0){var E=new f.Color().setRGB(w,M,S);b=new f.AmbientLight(E,1)}}return Promise.all(c).then(function(P){return{scene:l,textures:P,ambientLight:b,upAxis:["X","Y","Z"][g],frontAxis:["X","Y","Z"][m],unitScale:y,dispose:function(){P.forEach(function(B){return B.dispose()}),A.forEach(function(B){return B.dispose()}),v.forEach(function(B){return B.dispose()})}}})},n.prototype.parseConnections=function(t){var e=new Map;if("Connections"in t){var r=t.Connections.connections;r.forEach(function(i){var a=i[0],o=i[1],s=i[2];e.has(a)||e.set(a,{parents:[],children:[]});var u={ID:o,relationship:s};e.get(a).parents.push(u),e.has(o)||e.set(o,{parents:[],children:[]});var l={ID:a,relationship:s};e.get(o).children.push(l)})}return e},n.prototype.parseImages=function(t){var e={},r={};if("Video"in t.Objects){var i=t.Objects.Video;for(var a in i){var o=i[a],s=parseInt(a);if(e[s]=o.RelativeFilename||o.Filename,"Content"in o){var u=o.Content instanceof ArrayBuffer&&o.Content.byteLength>0,l=typeof o.Content=="string"&&o.Content!=="";if(u||l){var c=this.parseImage(i[a]);r[o.RelativeFilename||o.Filename]=c}}}}for(var s in e){var d=e[s];r[d]!==void 0?e[s]=r[d]:e[s]=e[s].split("\\").pop()}return e},n.prototype.parseImage=function(t){var e=t.Content,r=t.RelativeFilename||t.Filename,i=r.slice(r.lastIndexOf(".")+1).toLowerCase(),a;switch(i){case"bmp":a="image/bmp";break;case"jpg":case"jpeg":a="image/jpeg";break;case"png":a="image/png";break;case"tif":a="image/tiff";break;case"tga":a="image/tga";break;default:return}if(typeof e=="string")return"data:"+a+";base64,"+e;var o=new Uint8Array(e);return window.URL.createObjectURL(new Blob([o],{type:a}))},n.prototype.parseTextures=function(t,e,r,i){var a=new Map;if("Texture"in t.Objects){var o=t.Objects.Texture;for(var s in o){var u=this.parseTexture(o[s],e,r,i);a.set(parseInt(s),u)}}return a},n.prototype.parseTexture=function(t,e,r,i){var a=this.loadTexture(t,e,r,i);a.ID=t.id,a.name=t.attrName;var o=t.WrapModeU,s=t.WrapModeV,u=o!==void 0?o.value:0,l=s!==void 0?s.value:0;if(a.wrapS=u===0?f.RepeatWrapping:f.ClampToEdgeWrapping,a.wrapT=l===0?f.RepeatWrapping:f.ClampToEdgeWrapping,t.Scaling){var c=t.Scaling.value;a.repeat.x=c[0],a.repeat.y=c[1]}if(t.Translation){var c=t.Translation.value;a.offset.x=c[0],a.offset.y=c[1]}return a},n.prototype.loadTexture=function(t,e,r,i){var a=r.get(t.id).children,o="";a!==void 0&&a.length>0&&e[a[0].ID]!==void 0&&(o=e[a[0].ID]),o=st(this.resourcePath,ga(o,this.search));var s=Object.assign(new f.Texture,{ID:0}),u;u=this.fetcher.loadImage(o,{},void 0,void 0,void 0,Ai()).then(function(c){return c.body});var l=u.then(function(c){return s.image=c,s.needsUpdate=!0,s});return i.push(l),s},n.prototype.parseMaterials=function(t,e,r){var i=new Map;if("Material"in t.Objects){var a=t.Objects.Material;for(var o in a){var s=this.parseMaterial(t,a[o],e,r);s!==null&&i.set(parseInt(o),s)}}return i},n.prototype.parseMaterial=function(t,e,r,i){var a=e.id;e.attrName;var o=e.ShadingModel;if(typeof o=="object"&&(o=o.value),o=o.toLowerCase(),!i.has(a))return null;var s=new br(this.materialType);e.BumpFactor&&(s.bumpScale=e.BumpFactor.value),e.Diffuse?s.color=new f.Color().fromArray(e.Diffuse.value):e.DiffuseColor&&(e.DiffuseColor.type==="Color"||e.DiffuseColor.type==="ColorRGB")&&(s.color=new f.Color().fromArray(e.DiffuseColor.value)),e.DisplacementFactor&&(s.displacementScale=e.DisplacementFactor.value),e.Emissive?s.emissive=new f.Color().fromArray(e.Emissive.value):e.EmissiveColor&&(e.EmissiveColor.type==="Color"||e.EmissiveColor.type==="ColorRGB")&&(s.emissive=new f.Color().fromArray(e.EmissiveColor.value)),e.EmissiveFactor&&(s.emissiveIntensity=parseFloat(e.EmissiveFactor.value));var u=1-(e.TransparencyFactor?parseFloat(e.TransparencyFactor.value):0);(u===1||u===0)&&(u=e.Opacity?parseFloat(e.Opacity.value):null,u===null&&(u=1-(e.TransparentColor?parseFloat(e.TransparentColor.value[0]):0))),s.opacity=u,s.opacity<1&&(s.transparent=!0),e.ReflectionFactor&&(s.reflectivity=e.ReflectionFactor.value),e.Shininess&&(s.shininess=e.Shininess.value),e.Specular?s.specular=new f.Color().fromArray(e.Specular.value):e.SpecularColor&&e.SpecularColor.type==="Color"&&(s.specular=new f.Color().fromArray(e.SpecularColor.value));var l=this;return i.get(a).children.forEach(function(c){var d=c.relationship;switch(d){case"Bump":s.bumpMap=l.getTexture(t,r,c.ID,i);break;case"Maya|TEX_ao_map":s.aoMap=l.getTexture(t,r,c.ID,i);break;case"DiffuseColor":case"Maya|TEX_color_map":s.map=l.getTexture(t,r,c.ID,i),s.map!==void 0&&(s.map.encoding=f.sRGBEncoding);break;case"DisplacementColor":s.displacementMap=l.getTexture(t,r,c.ID,i);break;case"EmissiveColor":s.emissiveMap=l.getTexture(t,r,c.ID,i),s.emissiveMap!==void 0&&(s.emissiveMap.encoding=f.sRGBEncoding);break;case"NormalMap":case"Maya|TEX_normal_map":s.normalMap=l.getTexture(t,r,c.ID,i);break;case"ReflectionColor":s.envMap=l.getTexture(t,r,c.ID,i),s.envMap!==void 0&&(s.envMap.mapping=f.EquirectangularReflectionMapping,s.envMap.encoding=f.sRGBEncoding);break;case"SpecularColor":s.specularMap=l.getTexture(t,r,c.ID,i),s.specularMap!==void 0&&(s.specularMap.encoding=f.sRGBEncoding);break;case"TransparentColor":case"TransparencyFactor":s.alphaMap=l.getTexture(t,r,c.ID,i),s.transparent=!0;break;case"AmbientColor":case"ShininessExponent":case"SpecularFactor":case"VectorDisplacementColor":default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",d);break}}),s.refreshUniforms(),s},n.prototype.getTexture=function(t,e,r,i){return t.Objects.LayeredTexture&&r in t.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),r=i.get(r).children[0].ID),e.get(r)},n.prototype.parseDeformers=function(t,e){var r={},i={};if("Deformer"in t.Objects){var a=t.Objects.Deformer;for(var o in a){var s=a[o],u=e.get(parseInt(o));if(s.attrType==="Skin"){var l=this.parseSkeleton(u,a);l.ID=o,u.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),l.geometryID=u.parents[0].ID,r[o]=l}else if(s.attrType==="BlendShape"){var c={id:o};c.rawTargets=this.parseMorphTargets(u,a,e),c.id=o,u.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),i[o]=c}}}return{skeletons:r,morphTargets:i}},n.prototype.parseSkeleton=function(t,e){var r=[];return t.children.forEach(function(i){var a=e[i.ID];if(a.attrType==="Cluster"){var o={ID:i.ID,indices:[],weights:[],transformLink:new f.Matrix4().fromArray(a.TransformLink.a)};a.Indexes&&(o.indices=a.Indexes.a,o.weights=a.Weights.a),r.push(o)}}),{ID:"",geometryID:0,rawBones:r,bones:[]}},n.prototype.parseMorphTargets=function(t,e,r){for(var i=[],a=0;a<t.children.length;a++){var o=t.children[a],s=e[o.ID],u={name:s.attrName,initialWeight:s.DeformPercent,id:s.id,fullWeights:s.FullWeights.a,geoID:0};if(s.attrType!=="BlendShapeChannel")return;u.geoID=r.get(parseInt(o.ID)).children.filter(function(l){return l.relationship===void 0})[0].ID,i.push(u)}return i},n.prototype.parseScene=function(t,e,r,i,a,o){var s=this.parseModels(t,e.skeletons,r,i,a),u=t.Objects.Model,l=this;s.forEach(function(d){var p=u[d.ID];l.setLookAtProperties(t,d,p,a,o);var A=a.get(d.ID).parents;A.forEach(function(h){var v=s.get(h.ID);v!==void 0&&v.add(d)}),d.parent===null&&o.add(d)}),this.bindSkeleton(t,e.skeletons,r,s,a),o.traverse(function(d){if(d.userData.transformData){d.parent&&(d.userData.transformData.parentMatrix=d.parent.matrix,d.userData.transformData.parentMatrixWorld=d.parent.matrixWorld);var p=Sl(d.userData.transformData);d.applyMatrix4(p),d.updateWorldMatrix(!0,!0)}});var c=new Xp().parse(t,a,o);o.children.length===1&&o.children[0]instanceof f.Group&&(o.children[0].animations=c,o=o.children[0]),o.animations=c},n.prototype.parseModels=function(t,e,r,i,a){var o=new Map,s=t.Objects.Model;for(var u in s){var l=parseInt(u),c=s[u],d=a.get(l),p=this.buildSkeleton(d,e,l,c.attrName);if(!p){switch(c.attrType){case"Camera":p=this.createCamera(t,d);break;case"Light":p=this.createLight(t,d);break;case"Mesh":p=this.createMesh(d,r,i);break;case"NurbsCurve":case"LimbNode":case"Root":p=new f.Bone;break;case"Null":default:p=new f.Group;break}p.name=c.attrName?f.PropertyBinding.sanitizeNodeName(c.attrName):"",p.userData.originalName=c.attrName,p.ID=l}this.getTransformData(p,c),o.set(l,p)}return o},n.prototype.buildSkeleton=function(t,e,r,i){var a=null;return t.parents.forEach(function(o){var s=function(l){var c=e[l];c.rawBones.forEach(function(d,p){if(d.ID===o.ID){var A=a;a=new f.Bone,a.matrixWorld.copy(d.transformLink),a.name=i?f.PropertyBinding.sanitizeNodeName(i):"",a.userData.originalName=i,a.ID=r,c.bones[p]=a,A!==null&&a.add(A)}})};for(var u in e)s(u)}),a},n.prototype.createCamera=function(t,e){var r,i;if(e.children.forEach(function(A){var h=t.Objects.NodeAttribute[A.ID];h!==void 0&&(i=h)}),i===void 0)r=new f.Object3D;else{var a=0;i.CameraProjectionType!==void 0&&i.CameraProjectionType.value===1&&(a=1);var o=1;i.NearPlane!==void 0&&(o=i.NearPlane.value/1e3);var s=1e3;i.FarPlane!==void 0&&(s=i.FarPlane.value/1e3);var u=window.innerWidth,l=window.innerHeight;i.AspectWidth!==void 0&&i.AspectHeight!==void 0&&(u=i.AspectWidth.value,l=i.AspectHeight.value);var c=u/l,d=45;i.FieldOfView!==void 0&&(d=i.FieldOfView.value);var p=i.FocalLength?i.FocalLength.value:null;switch(a){case 0:r=new f.PerspectiveCamera(d,c,o,s),p!==null&&r.setFocalLength(p);break;case 1:console.warn("THREE.FBXLoader: Orthographic cameras not supported yet."),r=new f.Object3D;break;default:console.warn("THREE.FBXLoader: Unknown camera type "+a+"."),r=new f.Object3D;break}}return r},n.prototype.createLight=function(t,e){var r,i;if(e.children.forEach(function(p){var A=t.Objects.NodeAttribute[p.ID];A!==void 0&&(i=A)}),i===void 0)r=new f.Object3D;else{var a=void 0;i.LightType===void 0?a=0:a=i.LightType.value;var o=new f.Color(16777215);i.Color!==void 0&&(o=new f.Color().fromArray(i.Color.value));var s=i.Intensity===void 0?1:i.Intensity.value/100;i.CastLightOnObject!==void 0&&i.CastLightOnObject.value===0&&(s=0);var u=0;i.FarAttenuationEnd!==void 0&&(i.EnableFarAttenuation!==void 0&&i.EnableFarAttenuation.value===0?u=0:u=i.FarAttenuationEnd.value);var l=1;switch(a){case 0:r=new f.PointLight(o,s,u,l);break;case 1:r=new f.DirectionalLight(o,s);break;case 2:var c=Math.PI/3;i.InnerAngle!==void 0&&(c=f.MathUtils.degToRad(i.InnerAngle.value));var d=0;i.OuterAngle!==void 0&&(d=f.MathUtils.degToRad(i.OuterAngle.value),d=Math.max(d,1)),r=new f.SpotLight(o,s,u,c,d,l);break;default:console.warn("THREE.FBXLoader: Unknown light type "+i.LightType.value+", defaulting to a PointLight."),r=new f.PointLight(o,s);break}i.CastShadows!==void 0&&i.CastShadows.value===1&&(r.castShadow=!0)}return r},n.prototype.createMesh=function(t,e,r){var i,a=null,o=[];if(t.children.forEach(function(u){e.has(u.ID)&&(a=e.get(u.ID)),r.has(u.ID)&&o.push(r.get(u.ID))}),o.length===0){var s=new br(this.materialType);s.color=new f.Color(13421772),o.push(s)}return"color"in a.attributes&&o.forEach(function(u){u.vertexColors=!0}),(!a.groups||a.groups.length===0)&&a.addGroup(0,a.index?a.index.count:a.attributes.position.count,0),a.FBX_Deformer?(i=new gu(a,o),i.normalizeSkinWeights()):i=new Ot(a,o),i},n.prototype.createCurve=function(t,e){var r=t.children.reduce(function(a,o){return e.has(o.ID)&&(a=e.get(o.ID)),a},null),i=new f.LineBasicMaterial({name:"",color:3342591,linewidth:1});return new f.Line(r,i)},n.prototype.getTransformData=function(t,e){var r={};e.InheritType&&(r.inheritType=parseInt(e.InheritType.value)),e.RotationOrder?r.eulerOrder=gi(e.RotationOrder.value):r.eulerOrder=gi(0),e.Lcl_Translation&&(r.translation=e.Lcl_Translation.value),e.PreRotation&&(r.preRotation=e.PreRotation.value),e.Lcl_Rotation&&(r.rotation=e.Lcl_Rotation.value),e.PostRotation&&(r.postRotation=e.PostRotation.value),e.Lcl_Scaling&&(r.scale=e.Lcl_Scaling.value),e.ScalingOffset&&(r.scalingOffset=e.ScalingOffset.value),e.ScalingPivot&&(r.scalingPivot=e.ScalingPivot.value),e.RotationOffset&&(r.rotationOffset=e.RotationOffset.value),e.RotationPivot&&(r.rotationPivot=e.RotationPivot.value),t.userData.transformData=r},n.prototype.setLookAtProperties=function(t,e,r,i,a){if("LookAtProperty"in r){var o=i.get(e.ID).children;o.forEach(function(s){if(s.relationship==="LookAtProperty"){var u=t.Objects.Model[s.ID];if(u.Lcl_Translation){var l=u.Lcl_Translation.value;"target"in e&&e.target instanceof f.Object3D?(e.target.position.fromArray(l),a.add(e.target)):e.lookAt(new f.Vector3().fromArray(l))}}})}},n.prototype.bindSkeleton=function(t,e,r,i,a){var o=this.parsePoseNodes(t),s=function(l){var c=e[l],d=a.get(parseInt(c.ID)).parents;d.forEach(function(p){if(r.has(p.ID)){var A=p.ID,h=a.get(A);h.parents.forEach(function(v){if(i.has(v.ID)){var g=i.get(v.ID);g instanceof f.SkinnedMesh&&g.bind(new f.Skeleton(c.bones),o[v.ID])}})}})};for(var u in e)s(u)},n.prototype.parsePoseNodes=function(t){var e={};if(t.Objects.Pose){var r=t.Objects.Pose;for(var i in r)if(r[i].attrType==="BindPose"&&r[i].NbPoseNodes>0){var a=r[i].PoseNode;Array.isArray(a)?a.forEach(function(o){e[o.Node]=new f.Matrix4().fromArray(o.Matrix.a)}):e[a.Node]=new f.Matrix4().fromArray(a.Matrix.a)}}return e},n}(),Jp=function(){function n(){this.negativeMaterialIndices=!1}return n.prototype.parse=function(t,e,r){var i=new Map;if("Geometry"in t.Objects){var a=t.Objects.Geometry;for(var o in a){var s=r.get(parseInt(o)),u=this.parseGeometry(t,s,a[o],e);i.set(parseInt(o),u)}}return this.negativeMaterialIndices===!0&&console.warn("THREE.FBXLoader: The FBX file contains invalid (negative) material indices. The asset might not render as expected."),i},n.prototype.parseGeometry=function(t,e,r,i){switch(r.attrType){case"Mesh":return this.parseMeshGeometry(t,e,r,i);case"NurbsCurve":return this.parseNurbsGeometry(r)}},n.prototype.parseMeshGeometry=function(t,e,r,i){var a=i.skeletons,o=[],s=e.parents.map(function(p){return t.Objects.Model[p.ID]});if(s.length!==0){var u=e.children.reduce(function(p,A){return a[A.ID]!==void 0&&(p=a[A.ID]),p},null);e.children.forEach(function(p){i.morphTargets[p.ID]!==void 0&&o.push(i.morphTargets[p.ID])});var l=s[0],c={};l.RotationOrder&&(c.eulerOrder=gi(l.RotationOrder.value)),l.InheritType&&(c.inheritType=parseInt(l.InheritType.value)),l.GeometricTranslation&&(c.translation=l.GeometricTranslation.value),l.GeometricRotation&&(c.rotation=l.GeometricRotation.value),l.GeometricScaling&&(c.scale=l.GeometricScaling.value);var d=Sl(c);return this.genGeometry(t,r,u,o,d)}},n.prototype.genGeometry=function(t,e,r,i,a){var o=new f.BufferGeometry;e.attrName&&(o.name=e.attrName);var s=this.parseGeoNode(e,r),u=this.genBuffers(s),l=new f.Float32BufferAttribute(u.vertex,3);if(l.applyMatrix4(a),o.setAttribute("position",l),u.colors.length>0&&o.setAttribute("color",new f.Float32BufferAttribute(u.colors,3)),r&&(o.setAttribute("skinIndex",new f.Uint16BufferAttribute(u.weightsIndices,4)),o.setAttribute("skinWeight",new f.Float32BufferAttribute(u.vertexWeights,4)),o.FBX_Deformer=r),u.normal.length>0){var c=new f.Matrix3().getNormalMatrix(a),d=new f.Float32BufferAttribute(u.normal,3);d.applyNormalMatrix(c),o.setAttribute("normal",d)}if(u.uvs.forEach(function(g,m){var y=m===0?"uv":"uv".concat(m+1);o.setAttribute(y,new f.Float32BufferAttribute(u.uvs[m],2))}),s.material&&s.material.mappingType!=="AllSame"){var p=u.materialIndex[0],A=0;if(u.materialIndex.forEach(function(g,m){g!==p&&(o.addGroup(A,m-A,p),p=g,A=m)}),o.groups.length>0){var h=o.groups[o.groups.length-1],v=h.start+h.count;v!==u.materialIndex.length&&o.addGroup(v,u.materialIndex.length-v,p)}o.groups.length===0&&o.addGroup(0,u.materialIndex.length,u.materialIndex[0])}return this.addMorphTargets(t,o,e,i,a),o},n.prototype.parseGeoNode=function(t,e){var r={};if(r.vertexPositions=t.Vertices!==void 0?t.Vertices.a:[],r.vertexIndices=t.PolygonVertexIndex!==void 0?t.PolygonVertexIndex.a:[],t.LayerElementColor&&(r.color=this.parseVertexColors(t.LayerElementColor[0])),t.LayerElementMaterial&&(r.material=this.parseMaterialIndices(t.LayerElementMaterial[0])),t.LayerElementNormal&&(r.normal=this.parseNormals(t.LayerElementNormal[0])),t.LayerElementUV){r.uv=[];for(var i=0;t.LayerElementUV[i];)t.LayerElementUV[i].UV&&r.uv.push(this.parseUVs(t.LayerElementUV[i])),i++}return r.weightTable={},e!==null&&(r.skeleton=e,e.rawBones.forEach(function(a,o){a.indices.forEach(function(s,u){r.weightTable[s]===void 0&&(r.weightTable[s]=[]),r.weightTable[s].push({id:o,weight:a.weights[u]})})})),r},n.prototype.genBuffers=function(t){var e={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]},r=0,i=0,a=!1,o=[],s=[],u=[],l=[],c=[],d=[],p=this;return t.vertexIndices.forEach(function(A,h){var v=0,g=!1;A<0&&(A=A^-1,g=!0);var m=[],y=[];if(o.push(A*3,A*3+1,A*3+2),t.color){var b=Ui(h,r,A,t.color);u.push(b[0],b[1],b[2])}if(t.skeleton){if(t.weightTable[A]!==void 0&&t.weightTable[A].forEach(function(S){y.push(S.weight),m.push(S.id)}),y.length>4){a||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),a=!0);var x=[0,0,0,0],w=[0,0,0,0];y.forEach(function(S,E){var P=S,B=m[E];w.forEach(function(C,I,F){if(P>C){F[I]=P,P=C;var T=x[I];x[I]=B,B=T}})}),m=x,y=w}for(;y.length<4;)y.push(0),m.push(0);for(var M=0;M<4;++M)c.push(y[M]),d.push(m[M])}if(t.normal){var b=Ui(h,r,A,t.normal);s.push(b[0],b[1],b[2])}t.material&&t.material.mappingType!=="AllSame"&&(v=Ui(h,r,A,t.material)[0],v<0&&(p.negativeMaterialIndices=!0,v=0)),t.uv&&t.uv.forEach(function(S,E){var P=Ui(h,r,A,S);l[E]===void 0&&(l[E]=[]),l[E].push(P[0]),l[E].push(P[1])}),i++,g&&(p.genFace(e,t,o,v,s,u,l,c,d,i),r++,i=0,o=[],s=[],u=[],l=[],c=[],d=[])}),e},n.prototype.getNormalNewell=function(t){for(var e=new f.Vector3(0,0,0),r=0;r<t.length;r++){var i=t[r],a=t[(r+1)%t.length];e.x+=(i.y-a.y)*(i.z+a.z),e.y+=(i.z-a.z)*(i.x+a.x),e.z+=(i.x-a.x)*(i.y+a.y)}return e.normalize(),e},n.prototype.getNormalTangentAndBitangent=function(t){var e=this.getNormalNewell(t),r=Math.abs(e.z)>.5?new f.Vector3(0,1,0):new f.Vector3(0,0,1),i=r.cross(e).normalize(),a=e.clone().cross(i).normalize();return{normal:e,tangent:i,bitangent:a}},n.prototype.flattenVertex=function(t,e,r){return new f.Vector2(t.dot(e),t.dot(r))},n.prototype.genFace=function(t,e,r,i,a,o,s,u,l,c){var d;if(c>3){for(var p=[],A=e.baseVertexPositions||e.vertexPositions,h=0;h<r.length;h+=3)p.push(new f.Vector3(A[r[h]],A[r[h+1]],A[r[h+2]]));for(var v=this.getNormalTangentAndBitangent(p),g=v.tangent,m=v.bitangent,y=[],b=0,x=p;b<x.length;b++){var w=x[b];y.push(this.flattenVertex(w,g,m))}d=f.ShapeUtils.triangulateShape(y,[])}else d=[[0,1,2]];for(var M=function(F,T,L){t.vertex.push(e.vertexPositions[r[F*3]]),t.vertex.push(e.vertexPositions[r[F*3+1]]),t.vertex.push(e.vertexPositions[r[F*3+2]]),t.vertex.push(e.vertexPositions[r[T*3]]),t.vertex.push(e.vertexPositions[r[T*3+1]]),t.vertex.push(e.vertexPositions[r[T*3+2]]),t.vertex.push(e.vertexPositions[r[L*3]]),t.vertex.push(e.vertexPositions[r[L*3+1]]),t.vertex.push(e.vertexPositions[r[L*3+2]]),e.skeleton&&(t.vertexWeights.push(u[F*4]),t.vertexWeights.push(u[F*4+1]),t.vertexWeights.push(u[F*4+2]),t.vertexWeights.push(u[F*4+3]),t.vertexWeights.push(u[T*4]),t.vertexWeights.push(u[T*4+1]),t.vertexWeights.push(u[T*4+2]),t.vertexWeights.push(u[T*4+3]),t.vertexWeights.push(u[L*4]),t.vertexWeights.push(u[L*4+1]),t.vertexWeights.push(u[L*4+2]),t.vertexWeights.push(u[L*4+3]),t.weightsIndices.push(l[F*4]),t.weightsIndices.push(l[F*4+1]),t.weightsIndices.push(l[F*4+2]),t.weightsIndices.push(l[F*4+3]),t.weightsIndices.push(l[T*4]),t.weightsIndices.push(l[T*4+1]),t.weightsIndices.push(l[T*4+2]),t.weightsIndices.push(l[T*4+3]),t.weightsIndices.push(l[L*4]),t.weightsIndices.push(l[L*4+1]),t.weightsIndices.push(l[L*4+2]),t.weightsIndices.push(l[L*4+3])),e.color&&(t.colors.push(o[F*3]),t.colors.push(o[F*3+1]),t.colors.push(o[F*3+2]),t.colors.push(o[T*3]),t.colors.push(o[T*3+1]),t.colors.push(o[T*3+2]),t.colors.push(o[L*3]),t.colors.push(o[L*3+1]),t.colors.push(o[L*3+2])),e.material&&e.material.mappingType!=="AllSame"&&(t.materialIndex.push(i),t.materialIndex.push(i),t.materialIndex.push(i)),e.normal&&(t.normal.push(a[F*3]),t.normal.push(a[F*3+1]),t.normal.push(a[F*3+2]),t.normal.push(a[T*3]),t.normal.push(a[T*3+1]),t.normal.push(a[T*3+2]),t.normal.push(a[L*3]),t.normal.push(a[L*3+1]),t.normal.push(a[L*3+2])),e.uv&&e.uv.forEach(function(D,V){t.uvs[V]===void 0&&(t.uvs[V]=[]),t.uvs[V].push(s[V][F*2]),t.uvs[V].push(s[V][F*2+1]),t.uvs[V].push(s[V][T*2]),t.uvs[V].push(s[V][T*2+1]),t.uvs[V].push(s[V][L*2]),t.uvs[V].push(s[V][L*2+1])})},S=0,E=d;S<E.length;S++){var P=E[S],B=P[0],C=P[1],I=P[2];M(B,C,I)}},n.prototype.addMorphTargets=function(t,e,r,i,a){if(i.length!==0){e.morphTargetsRelative=!0,e.morphAttributes.position=[];var o=this;i.forEach(function(s){s.rawTargets.forEach(function(u){var l=t.Objects.Geometry[u.geoID];l!==void 0&&o.genMorphGeometry(e,r,l,a,u.name)})})}},n.prototype.genMorphGeometry=function(t,e,r,i,a){for(var o=e.Vertices!==void 0?e.Vertices.a:[],s=e.PolygonVertexIndex!==void 0?e.PolygonVertexIndex.a:[],u=r.Vertices!==void 0?r.Vertices.a:[],l=r.Indexes?r.Indexes.a:[],c=t.attributes.position.count*3,d=new Float32Array(c),p=0;p<l.length;p++){var A=l[p]*3;d[A]=u[p*3],d[A+1]=u[p*3+1],d[A+2]=u[p*3+2]}var h={vertexIndices:s,vertexPositions:d,baseVertexPositions:o},v=this.genBuffers(h),g=new f.Float32BufferAttribute(v.vertex,3);g.name=a||r.attrName,g.applyMatrix4(i),t.morphAttributes.position.push(g)},n.prototype.parseNormals=function(t){var e=t.MappingInformationType,r=t.ReferenceInformationType,i=t.Normals.a,a=[];return r==="IndexToDirect"&&(t.NormalIndex?a=t.NormalIndex.a:t.NormalsIndex&&(a=t.NormalsIndex.a)),{dataSize:3,buffer:i,indices:a,mappingType:e,referenceType:r}},n.prototype.parseUVs=function(t){var e=t.MappingInformationType,r=t.ReferenceInformationType,i=t.UV.a,a=[];return r==="IndexToDirect"&&(a=t.UVIndex.a),{dataSize:2,buffer:i,indices:a,mappingType:e,referenceType:r}},n.prototype.parseVertexColors=function(t){var e=t.MappingInformationType,r=t.ReferenceInformationType,i=t.Colors.a,a=[];r==="IndexToDirect"&&(a=t.ColorIndex.a);for(var o=0,s=new f.Color;o<i.length;o+=4)s.fromArray(i,o),s.toArray(i,o);return{dataSize:4,buffer:i,indices:a,mappingType:e,referenceType:r}},n.prototype.parseMaterialIndices=function(t){var e=t.MappingInformationType,r=t.ReferenceInformationType;if(e==="NoMappingInformation")return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:r};for(var i=t.Materials.a,a=[],o=0;o<i.length;++o)a.push(o);return{dataSize:1,buffer:i,indices:a,mappingType:e,referenceType:r}},n.prototype.parseNurbsGeometry=function(t){var e=parseInt(t.Order);if(isNaN(e))return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s",t.Order,t.id),new f.BufferGeometry;for(var r=e-1,i=t.KnotVector.a,a=[],o=t.Points.a,s=0,u=o.length;s<u;s+=4)a.push(new f.Vector4().fromArray(o,s));var l,c;if(t.Form==="Closed")a.push(a[0]);else if(t.Form==="Periodic"){l=r,c=i.length-1-l;for(var s=0;s<r;++s)a.push(a[s])}var d=new iv(r,i,a,l,c),p=d.getPoints(a.length*12);return new f.BufferGeometry().setFromPoints(p)},n}(),Xp=function(){function n(){}return n.prototype.parse=function(t,e,r){var i=[],a=this.parseClips(t,e,r);if(a!==void 0)for(var o in a){var s=a[o],u=this.addClip(s,r);i.push(u)}return i},n.prototype.parseClips=function(t,e,r){if(t.Objects.AnimationCurve!==void 0){var i=this.parseAnimationCurveNodes(t);this.parseAnimationCurves(t,i,e);var a=this.parseAnimationLayers(t,i,e,r),o=this.parseAnimStacks(t,a,e);return o}},n.prototype.parseAnimationCurveNodes=function(t){var e=t.Objects.AnimationCurveNode,r=new Map;for(var i in e){var a=e[i];if(a.attrName.match(/S|R|T|DeformPercent/)!==null){var o={id:a.id,attr:a.attrName,curves:{}};r.set(o.id,o)}}return r},n.prototype.parseAnimationCurves=function(t,e,r){var i=t.Objects.AnimationCurve;for(var a in i){var o={id:i[a].id,times:i[a].KeyTime.a.map(ev),values:i[a].KeyValueFloat.a},s=r.get(o.id);if(s!==void 0){var u=s.parents[0].ID,l=s.parents[0].relationship,c=e.get(u);c&&(l.match(/X/)?c.curves.x=o:l.match(/Y/)?c.curves.y=o:l.match(/Z/)?c.curves.z=o:l.match(/DeformPercent/)&&e.has(u)&&(c.curves.morph=o))}}},n.prototype.parseAnimationLayers=function(t,e,r,i){var a=t.Objects.AnimationLayer,o=new Map,s=function(l){var c=[],d=r.get(parseInt(l));if(d!==void 0){var p=d.children;p.forEach(function(A,h){if(e.has(A.ID)){var v=e.get(A.ID);if(v.curves.x!==void 0||v.curves.y!==void 0||v.curves.z!==void 0){if(c[h]===void 0){var g=r.get(A.ID).parents.filter(function(E){return E.relationship!==void 0})[0].ID;if(g!==void 0){var m=t.Objects.Model[g.toString()];if(m===void 0){console.warn("THREE.FBXLoader: Encountered a unused curve.",A);return}var y={modelName:m.attrName?f.PropertyBinding.sanitizeNodeName(m.attrName):"",ID:m.id,initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1],transform:new f.Matrix4,eulerOrder:"",preRotation:[0,0,0],postRotation:[0,0,0]};i.traverse(function(E){E.ID===m.id&&(y.transform=E.matrix,E.userData.transformData&&(y.eulerOrder=E.userData.transformData.eulerOrder))}),y.transform||(y.transform=new f.Matrix4),m.PreRotation&&(y.preRotation=m.PreRotation.value),m.PostRotation&&(y.postRotation=m.PostRotation.value),c[h]=y}}c[h]&&(c[h][v.attr]=v)}else if(v.curves.morph!==void 0){if(c[h]===void 0){var b=r.get(A.ID).parents.filter(function(P){return P.relationship!==void 0})[0].ID,x=r.get(b).parents[0].ID,w=r.get(x).parents[0].ID,g=r.get(w).parents[0].ID,M=t.Objects.Model[g],S={modelName:M.attrName?f.PropertyBinding.sanitizeNodeName(M.attrName):"",morphName:t.Objects.Deformer[b].attrName};c[h]=S}c[h][v.attr]=v}}}),o.set(parseInt(l),c)}};for(var u in a)s(u);return o},n.prototype.parseAnimStacks=function(t,e,r){var i=t.Objects.AnimationStack,a={};for(var o in i){var s=r.get(parseInt(o)).children;s.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");var u=e.get(s[0].ID);a[o]={name:i[o].attrName,layer:u}}return a},n.prototype.addClip=function(t,e){var r=[],i=this;return t.layer.forEach(function(a){r=r.concat(i.generateTracks(a,e))}),new f.AnimationClip(t.name,-1,r)},n.prototype.generateTracks=function(t,e){var r=[],i=new f.Vector3,a=new f.Vector3;t.transform&&t.transform.decompose(i,new f.Quaternion,a);var o=i.toArray(),s=a.toArray();if(t.T!==void 0&&Object.keys(t.T.curves).length>0){var u=this.generateVectorTrack(t.modelName,t.T.curves,o,"position");u!==void 0&&r.push(u)}if(t.R!==void 0&&Object.keys(t.R.curves).length>0){var l=this.generateRotationTrack(t.modelName,t.R.curves,t.preRotation,t.postRotation,t.eulerOrder);l!==void 0&&r.push(l)}if(t.S!==void 0&&Object.keys(t.S.curves).length>0){var c=this.generateVectorTrack(t.modelName,t.S.curves,s,"scale");c!==void 0&&r.push(c)}if(t.DeformPercent!==void 0){var d=this.generateMorphTrack(t,e);d!==void 0&&r.push(d)}return r},n.prototype.generateVectorTrack=function(t,e,r,i){var a=this.getTimesForAllAxes(e),o=this.getKeyframeTrackValues(a,e,r);return new f.VectorKeyframeTrack(t+"."+i,a,o)},n.prototype.generateRotationTrack=function(t,e,r,i,a){var o,s;if(e.x!==void 0&&e.y!==void 0&&e.z!==void 0){var u=this.interpolateRotations(e.x,e.y,e.z,a);o=u[0],s=u[1]}var l=gi(0),c=new f.Quaternion,d=new f.Quaternion;r!==void 0&&(r=r.map(f.MathUtils.degToRad),r.push(l),c.setFromEuler(new f.Euler().fromArray(r))),i!==void 0&&(i=i.map(f.MathUtils.degToRad),i.push(l),d.setFromEuler(new f.Euler().fromArray(i)),d.inverse());var p=new f.Quaternion,A=new f.Euler,h=[];if(!s||!o)return new f.QuaternionKeyframeTrack(t+".quaternion",[0],[0]);for(var v=0;v<s.length;v+=3){if(A.set(s[v],s[v+1],s[v+2],a),p.setFromEuler(A),p.premultiply(c),p.multiply(d),v>2){var g=new f.Quaternion().fromArray(h,(v-3)/3*4);g.dot(p)<0&&p.set(-p.x,-p.y,-p.z,-p.w)}p.toArray(h,v/3*4)}return new f.QuaternionKeyframeTrack(t+".quaternion",o,h)},n.prototype.generateMorphTrack=function(t,e){var r=t.DeformPercent.curves.morph,i=r.values.map(function(o){return o/100}),a=e.getObjectByName(t.modelName).morphTargetDictionary[t.morphName];return new f.NumberKeyframeTrack(t.modelName+".morphTargetInfluences["+a+"]",r.times,i)},n.prototype.getTimesForAllAxes=function(t){var e=[];if(t.x!==void 0&&(e=e.concat(t.x.times)),t.y!==void 0&&(e=e.concat(t.y.times)),t.z!==void 0&&(e=e.concat(t.z.times)),e=e.sort(function(s,u){return s-u}),e.length>1){for(var r=1,i=e[0],a=1;a<e.length;a++){var o=e[a];o!==i&&(e[r]=o,i=o,r++)}e=e.slice(0,r)}return e},n.prototype.getKeyframeTrackValues=function(t,e,r){var i=r,a=[],o=-1,s=-1,u=-1;return t.forEach(function(l){if(e.x&&(o=e.x.times.indexOf(l)),e.y&&(s=e.y.times.indexOf(l)),e.z&&(u=e.z.times.indexOf(l)),o!==-1){var c=e.x.values[o];a.push(c),i[0]=c}else a.push(i[0]);if(s!==-1){var d=e.y.values[s];a.push(d),i[1]=d}else a.push(i[1]);if(u!==-1){var p=e.z.values[u];a.push(p),i[2]=p}else a.push(i[2])}),a},n.prototype.interpolateRotations=function(t,e,r,i){var a=[],o=[];a.push(t.times[0]),o.push(f.MathUtils.degToRad(t.values[0])),o.push(f.MathUtils.degToRad(e.values[0])),o.push(f.MathUtils.degToRad(r.values[0]));for(var s=1;s<t.values.length;s++){var u=[t.values[s-1],e.values[s-1],r.values[s-1]];if(!(isNaN(u[0])||isNaN(u[1])||isNaN(u[2]))){var l=u.map(f.MathUtils.degToRad),c=[t.values[s],e.values[s],r.values[s]];if(!(isNaN(c[0])||isNaN(c[1])||isNaN(c[2]))){c.map(f.MathUtils.degToRad);var d=[c[0]-u[0],c[1]-u[1],c[2]-u[2]],p=[Math.abs(d[0]),Math.abs(d[1]),Math.abs(d[2])];if(p[0]>=180||p[1]>=180||p[2]>=180){var A=Math.max.apply(Math,p),h=A/180,v=new f.Euler(l[0],l[1],l[2],i),g=new f.Euler(l[0],l[1],l[2],i),m=new f.Quaternion().setFromEuler(v),y=new f.Quaternion().setFromEuler(g);m.dot(y)&&y.set(-y.x,-y.y,-y.z,-y.w);for(var b=t.times[s-1],x=t.times[s]-b,w=new f.Quaternion,M=new f.Euler,S=0;S<1;S+=1/h)w.copy(m.clone().slerp(y.clone(),S)),a.push(b+S*x),M.setFromQuaternion(w,i),o.push(M.x),o.push(M.y),o.push(M.z)}else a.push(t.times[s]),o.push(f.MathUtils.degToRad(t.values[s])),o.push(f.MathUtils.degToRad(e.values[s])),o.push(f.MathUtils.degToRad(r.values[s]))}}}return[a,o]},n}(),Wp=function(){function n(){this.allNodes=new Po,this.nodeStack=[],this.currentIndent=0,this.currentPropName=""}return n.prototype.getPrevNode=function(){return this.nodeStack[this.currentIndent-2]},n.prototype.getCurrentNode=function(){return this.nodeStack[this.currentIndent-1]},n.prototype.getCurrentProp=function(){return this.currentProp},n.prototype.pushStack=function(t){this.nodeStack.push(t),this.currentIndent+=1},n.prototype.popStack=function(){this.nodeStack.pop(),this.currentIndent-=1},n.prototype.setCurrentProp=function(t,e){this.currentProp=t,this.currentPropName=e},n.prototype.parse=function(t){this.currentIndent=0,this.allNodes=new Po,this.nodeStack=[],this.currentProp=[],this.currentPropName="";var e=this,r=t.split(/[\r\n]+/);return r.forEach(function(i,a){var o=i.match(/^[\s\t]*;/),s=i.match(/^[\s\t]*$/);if(!(o||s)){var u=i.match("^\\t{"+e.currentIndent+"}(\\w+):(.*){"),l=i.match("^\\t{"+e.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),c=i.match("^\\t{"+(e.currentIndent-1)+"}}");u?e.parseNodeBegin(i,u):l?e.parseNodeProperty(i,l,r[++a]):c?e.popStack():i.match(/^[^\s\t}]/)&&e.parseNodePropertyContinued(i)}}),this.allNodes},n.prototype.parseNodeBegin=function(t,e){var r=e[1].trim().replace(/^"/,"").replace(/"$/,""),i=e[2].split(",").map(function(u){return u.trim().replace(/^"/,"").replace(/"$/,"")}),a={name:r},o=this.parseNodeAttr(i),s=this.getCurrentNode();this.currentIndent===0?this.allNodes.add(r,a):r in s?(r==="PoseNode"?s.PoseNode.push(a):s[r].id!==void 0&&(s[r]={},s[r][s[r].id]=s[r]),o.id!==""&&(s[r][o.id]=a)):typeof o.id=="number"?(s[r]={},s[r][o.id]=a):r!=="Properties70"&&(r==="PoseNode"?s[r]=[a]:s[r]=a),typeof o.id=="number"&&(a.id=o.id),o.name!==""&&(a.attrName=o.name),o.type!==""&&(a.attrType=o.type),this.pushStack(a)},n.prototype.parseNodeAttr=function(t){var e=t[0];t[0]!==""&&(e=parseInt(t[0]),isNaN(e)&&(e=t[0]));var r="",i="";return t.length>1&&(r=t[1].replace(/^(\w+)::/,""),i=t[2]),{id:e,name:r,type:i}},n.prototype.parseNodeProperty=function(t,e,r){var i=e[1].replace(/^"/,"").replace(/"$/,"").trim(),a=e[2].replace(/^"/,"").replace(/"$/,"").trim();i==="Content"&&a===","&&(a=r.replace(/"/g,"").replace(/,$/,"").trim());var o=this.getCurrentNode(),s=o.name;if(s==="Properties70"){this.parseNodeSpecialProperty(t,i,a);return}if(i==="C"){var u=a.split(",").slice(1),l=parseInt(u[0]),c=parseInt(u[1]),d=a.split(",").slice(3);d=d.map(function(p){return p.trim().replace(/^"/,"")}),i="connections",a=[l,c],rv(a,d),o[i]===void 0&&(o[i]=[])}i==="Node"&&(o.id=a),i in o&&Array.isArray(o[i])?o[i].push(a):i!=="a"?o[i]=a:o.a=a,this.setCurrentProp(o,i),i==="a"&&a.slice(-1)!==","&&(o.a=$a(a))},n.prototype.parseNodePropertyContinued=function(t){var e=this.getCurrentNode();e.a+=t,t.slice(-1)!==","&&(e.a=$a(e.a))},n.prototype.parseNodeSpecialProperty=function(t,e,r){var i=r.split('",').map(function(c){return c.trim().replace(/^\"/,"").replace(/\s/,"_")}),a=i[0],o=i[1],s=i[2],u=i[3],l=i[4];switch(o){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":l=parseFloat(l);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":l=$a(l);break}this.getPrevNode()[a]={type:o,type2:s,flag:u,value:l},this.setCurrentProp(this.getPrevNode(),a)},n}(),Zp=function(){function n(){}return n.prototype.parse=function(t){var e=new l0(t);e.skip(23);var r=e.getUint32();if(r<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+r);for(var i=new Po;!this.endOfContent(e);){var a=this.parseNode(e,r);a!==null&&i.add(a.name,a)}return i},n.prototype.endOfContent=function(t){return t.size()%16===0?(t.getOffset()+160+16&-16)>=t.size():t.getOffset()+160+16>=t.size()},n.prototype.parseNode=function(t,e){var r={},i=e>=7500?t.getUint64():t.getUint32(),a=e>=7500?t.getUint64():t.getUint32();e>=7500?t.getUint64():t.getUint32();var o=t.getUint8(),s=t.getString(o);if(i===0)return null;for(var u=[],l=0;l<a;l++)u.push(this.parseProperty(t));var c=u.length>0?u[0]:"",d=u.length>1?u[1]:"",p=u.length>2?u[2]:"";for(r.singleProperty=a===1&&t.getOffset()===i;i>t.getOffset();){var A=this.parseNode(t,e);A!==null&&this.parseSubNode(s,r,A)}return r.propertyList=u,typeof c=="number"&&(r.id=c),d!==""&&(r.attrName=d),p!==""&&(r.attrType=p),s!==""&&(r.name=s),r},n.prototype.parseSubNode=function(t,e,r){if(r.singleProperty===!0){var i=r.propertyList[0];Array.isArray(i)?(e[r.name]=r,r.a=i):e[r.name]=i}else if(t==="Connections"&&r.name==="C"){var a=[];r.propertyList.forEach(function(p,A){A!==0&&a.push(p)}),e.connections===void 0&&(e.connections=[]),e.connections.push(a)}else if(r.name==="Properties70"){var o=Object.keys(r);o.forEach(function(p){e[p]=r[p]})}else if(t==="Properties70"&&r.name==="P"){var s=r.propertyList[0],u=r.propertyList[1],l=r.propertyList[2],c=r.propertyList[3],d=void 0;s.indexOf("Lcl ")===0&&(s=s.replace("Lcl ","Lcl_")),u.indexOf("Lcl ")===0&&(u=u.replace("Lcl ","Lcl_")),u==="Color"||u==="ColorRGB"||u==="Vector"||u==="Vector3D"||u.indexOf("Lcl_")===0?d=[r.propertyList[4],r.propertyList[5],r.propertyList[6]]:d=r.propertyList[4],e[s]={type:u,type2:l,flag:c,value:d}}else e[r.name]===void 0?typeof r.id=="number"?(e[r.name]={},e[r.name][r.id]=r):e[r.name]=r:r.name==="PoseNode"?(Array.isArray(e[r.name])||(e[r.name]=[e[r.name]]),e[r.name].push(r)):e[r.name][r.id]===void 0&&(e[r.name][r.id]=r)},n.prototype.parseProperty=function(t){var e=t.getString(1),r;switch(e){case"C":return t.getBoolean();case"D":return t.getFloat64();case"F":return t.getFloat32();case"I":return t.getInt32();case"L":return t.getInt64();case"R":return r=t.getUint32(),t.getArrayBuffer(r);case"S":return r=t.getUint32(),t.getString(r);case"Y":return t.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":var i=t.getUint32(),a=t.getUint32(),o=t.getUint32();if(a===0)switch(e){case"b":case"c":return t.getBooleanArray(i);case"d":return t.getFloat64Array(i);case"f":return t.getFloat32Array(i);case"i":return t.getInt32Array(i);case"l":return t.getInt64Array(i)}var s=Vp(new Uint8Array(t.getArrayBuffer(o))),u=new l0(s.buffer);switch(e){case"b":case"c":return u.getBooleanArray(i);case"d":return u.getFloat64Array(i);case"f":return u.getFloat32Array(i);case"i":return u.getInt32Array(i);case"l":return u.getInt64Array(i)}break;default:throw new Error("THREE.FBXLoader: Unknown property type "+e)}},n}(),l0=function(){function n(t,e){this.dv=new DataView(t),this.offset=0,this.littleEndian=e!==void 0?e:!0,this._textDecoder=new TextDecoder}return n.prototype.getOffset=function(){return this.offset},n.prototype.size=function(){return this.dv.buffer.byteLength},n.prototype.skip=function(t){this.offset+=t},n.prototype.getBoolean=function(){return(this.getUint8()&1)===1},n.prototype.getBooleanArray=function(t){for(var e=[],r=0;r<t;r++)e.push(this.getBoolean());return e},n.prototype.getUint8=function(){var t=this.dv.getUint8(this.offset);return this.offset+=1,t},n.prototype.getInt16=function(){var t=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,t},n.prototype.getInt32=function(){var t=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,t},n.prototype.getInt32Array=function(t){for(var e=[],r=0;r<t;r++)e.push(this.getInt32());return e},n.prototype.getUint32=function(){var t=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,t},n.prototype.getInt64=function(){var t,e;return this.littleEndian?(t=this.getUint32(),e=this.getUint32()):(e=this.getUint32(),t=this.getUint32()),e&2147483648?(e=~e&4294967295,t=~t&4294967295,t===4294967295&&(e=e+1&4294967295),t=t+1&4294967295,-(e*4294967296+t)):e*4294967296+t},n.prototype.getInt64Array=function(t){for(var e=[],r=0;r<t;r++)e.push(this.getInt64());return e},n.prototype.getUint64=function(){var t,e;return this.littleEndian?(t=this.getUint32(),e=this.getUint32()):(e=this.getUint32(),t=this.getUint32()),e*4294967296+t},n.prototype.getFloat32=function(){var t=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t},n.prototype.getFloat32Array=function(t){for(var e=[],r=0;r<t;r++)e.push(this.getFloat32());return e},n.prototype.getFloat64=function(){var t=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t},n.prototype.getFloat64Array=function(t){for(var e=[],r=0;r<t;r++)e.push(this.getFloat64());return e},n.prototype.getArrayBuffer=function(t){var e=this.dv.buffer.slice(this.offset,this.offset+t);return this.offset+=t,e},n.prototype.getString=function(t){var e=this.offset,r=new Uint8Array(this.dv.buffer,e,t);this.skip(t);var i=r.indexOf(0);return i>=0&&(r=new Uint8Array(this.dv.buffer,e,i)),this._textDecoder.decode(r)},n}(),Po=function(){function n(){this.Connections={connections:[]},this.Objects={Model:{},NodeAttribute:{},Geometry:{}},this.GlobalSettings={}}return n.prototype.add=function(t,e){this[t]=e},n}();function Yp(n){var t="Kaydara FBX Binary \0";return n.byteLength>=t.length&&t===Cl(n,0,t.length)}function $p(n){var t=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"],e=0;function r(o){var s=n[o-1];return n=n.slice(e+o),e++,s}for(var i=0;i<t.length;++i){var a=r(1);if(a===t[i])return!1}return!0}function c0(n){var t=/FBXVersion: (\d+)/,e=n.match(t);if(e){var r=parseInt(e[1]);return r}throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function ev(n){return n/46186158e3}var tv=[];function Ui(n,t,e,r){var i;switch(r.mappingType){case"ByPolygonVertex":i=n;break;case"ByPolygon":i=t;break;case"ByVertice":i=e;break;case"AllSame":i=r.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+r.mappingType),i=0}r.referenceType==="IndexToDirect"&&(i=r.indices[i]);var a=i*r.dataSize,o=a+r.dataSize;return nv(tv,r.buffer,a,o)}var Ya=new f.Euler,Vn=new f.Vector3;function Sl(n){var t=new f.Matrix4,e=new f.Matrix4,r=new f.Matrix4,i=new f.Matrix4,a=new f.Matrix4,o=new f.Matrix4,s=new f.Matrix4,u=new f.Matrix4,l=new f.Matrix4,c=new f.Matrix4,d=new f.Matrix4,p=new f.Matrix4,A=n.inheritType?n.inheritType:0;n.translation&&t.setPosition(Vn.fromArray(n.translation));var h=gi(0);if(n.preRotation){var v=n.preRotation.map(f.MathUtils.degToRad);v.push(h),e.makeRotationFromEuler(Ya.fromArray(v))}if(n.rotation){var v=n.rotation.map(f.MathUtils.degToRad);v.push(n.eulerOrder||h),r.makeRotationFromEuler(Ya.fromArray(v))}if(n.postRotation){var v=n.postRotation.map(f.MathUtils.degToRad);v.push(h),i.makeRotationFromEuler(Ya.fromArray(v)),i.copy(new f.Matrix4().getInverse(i))}n.scale&&a.scale(Vn.fromArray(n.scale)),n.scalingOffset&&s.setPosition(Vn.fromArray(n.scalingOffset)),n.scalingPivot&&o.setPosition(Vn.fromArray(n.scalingPivot)),n.rotationOffset&&u.setPosition(Vn.fromArray(n.rotationOffset)),n.rotationPivot&&l.setPosition(Vn.fromArray(n.rotationPivot)),n.parentMatrixWorld&&(d.copy(n.parentMatrix),c.copy(n.parentMatrixWorld));var g=e.clone().multiply(r).multiply(i),m=new f.Matrix4;m.extractRotation(c);var y=new f.Matrix4;y.copyPosition(c);var b=new f.Matrix4().getInverse(y).multiply(c),x=new f.Matrix4().getInverse(m).multiply(b),w=a,M=new f.Matrix4;if(A===0)M.copy(m).multiply(g).multiply(x).multiply(w);else if(A===1)M.copy(m).multiply(x).multiply(g).multiply(w);else{var S=new f.Matrix4().scale(new f.Vector3().setFromMatrixScale(d)),E=new f.Matrix4().getInverse(S),P=x.clone().multiply(E);M.copy(m).multiply(g).multiply(P).multiply(w)}var B=new f.Matrix4().getInverse(l),C=new f.Matrix4().getInverse(o),I=t.clone().multiply(u).multiply(l).multiply(e).multiply(r).multiply(i).multiply(B).multiply(s).multiply(o).multiply(a).multiply(C),F=new f.Matrix4().copyPosition(I),T=c.clone().multiply(F);return p.copyPosition(T),I=p.clone().multiply(M),I.premultiply(new f.Matrix4().getInverse(c)),I}function gi(n){n=n||0;var t=["ZYX","YZX","XZY","ZXY","YXZ","XYZ"];return n===6?(console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."),t[0]):t[n]}function $a(n){var t=n.split(",").map(function(e){return parseFloat(e)});return t}function Cl(n,t,e){return t===void 0&&(t=0),e===void 0&&(e=n.byteLength),new TextDecoder().decode(new Uint8Array(n,t,e))}function rv(n,t){for(var e=0,r=n.length,i=t.length;e<i;e++,r++)n[r]=t[e]}function nv(n,t,e,r){for(var i=e,a=0;i<r;i++,a++)n[a]=t[i];return n}var iv=function(n){ue(t,n);function t(e,r,i,a,o){var s=n.call(this)||this,u=r?r.length-1:0,l=i?i.length:0;s.degree=e,s.knots=r,s.controlPoints=[],s.startKnot=a||0,s.endKnot=o||u;for(var c=0;c<l;++c){var d=i[c];s.controlPoints[c]=new f.Vector4(d.x,d.y,d.z,d.w)}return s}return t.prototype.getPoint=function(e,r){r===void 0&&(r=new f.Vector3);var i=r,a=this.knots[this.startKnot]+e*(this.knots[this.endKnot]-this.knots[this.startKnot]),o=ov(this.degree,this.knots,this.controlPoints,a);return o.w!==1&&o.divideScalar(o.w),i.set(o.x,o.y,o.z)},t.prototype.getTangent=function(e,r){r===void 0&&(r=new f.Vector3);var i=r,a=this.knots[0]+e*(this.knots[this.knots.length-1]-this.knots[0]),o=fv(this.degree,this.knots,this.controlPoints,a,1);return i.copy(o[1]).normalize(),i},t.prototype.toJSON=function(){var e=n.prototype.toJSON.call(this);return e.degree=this.degree,e.knots=vt([],this.knots,!0),e.controlPoints=this.controlPoints.map(function(r){return r.toArray()}),e.startKnot=this.startKnot,e.endKnot=this.endKnot,e},t.prototype.fromJSON=function(e){return n.prototype.fromJSON.call(this,e),this.degree=e.degree,this.knots=vt([],e.knots,!0),this.controlPoints=e.controlPoints.map(function(r){return new f.Vector4(r[0],r[1],r[2],r[3])}),this.startKnot=e.startKnot,this.endKnot=e.endKnot,this},t}(f.Curve);function El(n,t,e){var r=e.length-n-1;if(t>=e[r])return r-1;if(t<=e[n])return n;for(var i=n,a=r,o=Math.floor((i+a)/2);t<e[o]||t>=e[o+1];)t<e[o]?a=o:i=o,o=Math.floor((i+a)/2);return o}function av(n,t,e,r){var i=[],a=[],o=[];i[0]=1;for(var s=1;s<=e;++s){a[s]=t-r[n+1-s],o[s]=r[n+s]-t;for(var u=0,l=0;l<s;++l){var c=o[l+1],d=a[s-l],p=i[l]/(c+d);i[l]=u+c*p,u=d*p}i[s]=u}return i}function ov(n,t,e,r){for(var i=El(n,r,t),a=av(i,r,n,t),o=new f.Vector4(0,0,0,0),s=0;s<=n;++s){var u=e[i-n+s],l=a[s],c=u.w*l;o.x+=u.x*c,o.y+=u.y*c,o.z+=u.z*c,o.w+=u.w*l}return o}function sv(n,t,e,r,i){for(var a=[],o=0;o<=e;++o)a[o]=0;for(var s=[],o=0;o<=r;++o)s[o]=a.slice(0);for(var u=[],o=0;o<=e;++o)u[o]=a.slice(0);u[0][0]=1;for(var l=a.slice(0),c=a.slice(0),d=1;d<=e;++d){l[d]=t-i[n+1-d],c[d]=i[n+d]-t;for(var p=0,A=0;A<d;++A){var h=c[A+1],v=l[d-A];u[d][A]=h+v;var g=u[A][d-1]/u[d][A];u[A][d]=p+h*g,p=v*g}u[d][d]=p}for(var d=0;d<=e;++d)s[0][d]=u[d][e];for(var m=0;m<=e;++m){for(var y=0,b=1,x=[],o=0;o<=e;++o)x[o]=a.slice(0);x[0][0]=1;for(var w=1;w<=r;++w){var M=0,S=m-w,E=e-w;m>=w&&(x[b][0]=x[y][0]/u[E+1][S],M=x[b][0]*u[S][E]);for(var P=S>=-1?1:-S,B=m-1<=E?w-1:e-m,C=P;C<=B;++C)x[b][C]=(x[y][C]-x[y][C-1])/u[E+1][S+C],M+=x[b][C]*u[S+C][E];m<=E&&(x[b][w]=-x[y][w-1]/u[E+1][m],M+=x[b][w]*u[m][E]),s[w][m]=M;var d=y;y=b,b=d}}for(var I=e,w=1;w<=r;++w){for(var d=0;d<=e;++d)s[w][d]*=I;I*=e-w}return s}function uv(n,t,e,r,i){for(var a=i<n?i:n,o=[],s=El(n,r,t),u=sv(s,r,n,a,t),l=[],c=0;c<e.length;++c){var d=e[c].clone(),p=d.w;d.x*=p,d.y*=p,d.z*=p,l[c]=d}for(var A=0;A<=a;++A){for(var d=l[s-n].clone().multiplyScalar(u[A][0]),h=1;h<=n;++h)d.add(l[s-n+h].clone().multiplyScalar(u[A][h]));o[A]=d}for(var A=a+1;A<=i+1;++A)o[A]=new f.Vector4(0,0,0);return o}function lv(n,t){for(var e=1,r=2;r<=n;++r)e*=r;for(var i=1,r=2;r<=t;++r)i*=r;for(var r=2;r<=n-t;++r)i*=r;return e/i}function cv(n){for(var t=n.length,e=[],r=[],i=0;i<t;++i){var a=n[i];e[i]=new f.Vector3(a.x,a.y,a.z),r[i]=a.w}for(var o=[],s=0;s<t;++s){for(var u=e[s].clone(),i=1;i<=s;++i)u.sub(o[s-i].clone().multiplyScalar(lv(s,i)*r[i]));o[s]=u.divideScalar(r[0])}return o}function fv(n,t,e,r,i){var a=uv(n,t,e,r,i);return cv(a)}var Nn=new f.Vector3;function dv(n,t){switch(t){case"D":return new Float64Array(n);case"F":return new Float32Array(n);case"L":return new Int32Array(n);case"I":return new Int16Array(n);default:return new Uint8Array(n)}}function Il(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new Ut({allowHosts:["*"]}),i={byteLength:0};return Promise.resolve().then(function(){return r.ajax(n,{responseType:"arraybuffer"})}).then(function(a){var o;return i.byteLength=a.body.byteLength,hv(new Uint8Array(a.body),{materialType:t.materialType,color:t.color,resourcePath:n.slice(0,n.lastIndexOf("/")+1),search:(o=n.split("?")[1])!==null&&o!==void 0?o:"",fetcher:r})}).then(function(a){var o=new f.Group;return o.matrixAutoUpdate=!1,o.matrix.compose(o.position,o.quaternion,o.scale),o.name=n,o.add(a.object),{type:"x3p",upAxis:"Z",uri:n,byteLength:i.byteLength,scene:o,textures:[],dispose:function(){return a.dispose()}}})}function hv(n,t){for(var e,r,i,a,o,s,u,l,c,d,p,A,h,v,g,m,y,b,x,w,M,S,E,P,B,C,I,F,T,L,D,V,z,U,q,G,K,_,J,W,$,Y,Z,oe,ne,de,se,ye,ie,xe,Le,Ce,Oe,ee,re,H=Gp(n),Be="",Te=null,Ee=0,Qe=Object.keys(H);Ee<Qe.length;Ee++){var Ie=Qe[Ee];/(^|\/)main\.xml$/i.test(Ie)&&(Te=H[Ie],Be=Ie.slice(0,Ie.lastIndexOf("/")+1))}if(!Te)throw new Error("X3p: main.xml not found.");if(typeof DOMParser=="undefined")throw new Error("X3p: DOMParser not found.");var we=(e=t.materialType)!==null&&e!==void 0?e:"phong",be=(r=t.color)!==null&&r!==void 0?r:new f.Color(10066329),Ae=new DOMParser,me=aa(Te),ze=Ae.parseFromString(me,"text/xml"),pe=ze.querySelector("Record1 Axes"),Se={x:{type:(o=(a=(i=pe==null?void 0:pe.querySelector("CX AxisType"))===null||i===void 0?void 0:i.textContent)===null||a===void 0?void 0:a.toUpperCase())!==null&&o!==void 0?o:"I",dataType:(l=(u=(s=pe==null?void 0:pe.querySelector("CX DataType"))===null||s===void 0?void 0:s.textContent)===null||u===void 0?void 0:u.toUpperCase())!==null&&l!==void 0?l:"D",increment:Number((d=(c=pe==null?void 0:pe.querySelector("CX Increment"))===null||c===void 0?void 0:c.textContent)!==null&&d!==void 0?d:"1"),offset:Number((A=(p=pe==null?void 0:pe.querySelector("CX Offset"))===null||p===void 0?void 0:p.textContent)!==null&&A!==void 0?A:"0")},y:{type:(g=(v=(h=pe==null?void 0:pe.querySelector("CY AxisType"))===null||h===void 0?void 0:h.textContent)===null||v===void 0?void 0:v.toUpperCase())!==null&&g!==void 0?g:"I",dataType:(b=(y=(m=pe==null?void 0:pe.querySelector("CY DataType"))===null||m===void 0?void 0:m.textContent)===null||y===void 0?void 0:y.toUpperCase())!==null&&b!==void 0?b:"D",increment:Number((w=(x=pe==null?void 0:pe.querySelector("CY Increment"))===null||x===void 0?void 0:x.textContent)!==null&&w!==void 0?w:"1"),offset:Number((S=(M=pe==null?void 0:pe.querySelector("CY Offset"))===null||M===void 0?void 0:M.textContent)!==null&&S!==void 0?S:"0")},z:{type:(B=(P=(E=pe==null?void 0:pe.querySelector("CZ AxisType"))===null||E===void 0?void 0:E.textContent)===null||P===void 0?void 0:P.toUpperCase())!==null&&B!==void 0?B:"A",dataType:(F=(I=(C=pe==null?void 0:pe.querySelector("CZ DataType"))===null||C===void 0?void 0:C.textContent)===null||I===void 0?void 0:I.toUpperCase())!==null&&F!==void 0?F:"D",increment:Number((L=(T=pe==null?void 0:pe.querySelector("CZ Increment"))===null||T===void 0?void 0:T.textContent)!==null&&L!==void 0?L:"1"),offset:Number((V=(D=pe==null?void 0:pe.querySelector("CZ Offset"))===null||D===void 0?void 0:D.textContent)!==null&&V!==void 0?V:"0")}},St=null,Pe=ze.querySelector("Record1 Axes Rotation");Pe&&(St=new f.Matrix3,St.set(Number((U=(z=Pe.querySelector("r11"))===null||z===void 0?void 0:z.textContent)!==null&&U!==void 0?U:0),Number((G=(q=Pe.querySelector("r12"))===null||q===void 0?void 0:q.textContent)!==null&&G!==void 0?G:0),Number((_=(K=Pe.querySelector("r13"))===null||K===void 0?void 0:K.textContent)!==null&&_!==void 0?_:0),Number((W=(J=Pe.querySelector("r21"))===null||J===void 0?void 0:J.textContent)!==null&&W!==void 0?W:0),Number((Y=($=Pe.querySelector("r22"))===null||$===void 0?void 0:$.textContent)!==null&&Y!==void 0?Y:0),Number((oe=(Z=Pe.querySelector("r23"))===null||Z===void 0?void 0:Z.textContent)!==null&&oe!==void 0?oe:0),Number((de=(ne=Pe.querySelector("r31"))===null||ne===void 0?void 0:ne.textContent)!==null&&de!==void 0?de:0),Number((ye=(se=Pe.querySelector("r32"))===null||se===void 0?void 0:se.textContent)!==null&&ye!==void 0?ye:0),Number((xe=(ie=Pe.querySelector("r33"))===null||ie===void 0?void 0:ie.textContent)!==null&&xe!==void 0?xe:0)));var _e=(Le=ze.querySelector("Record3 DataLink PointDataLink"))===null||Le===void 0?void 0:Le.textContent;if(typeof _e!="string")throw new Error("X3p: PointDataLink not found.");_e=st(Be,_e);var it=H[_e];if(!it)throw new Error("X3p: ".concat(it," not found."));for(var Jt=dv(it.buffer,Se.z.dataType),Kr=Number((Oe=(Ce=ze.querySelector("Record3 MatrixDimension SizeX"))===null||Ce===void 0?void 0:Ce.textContent)!==null&&Oe!==void 0?Oe:"0"),Xt=Number((re=(ee=ze.querySelector("Record3 MatrixDimension SizeY"))===null||ee===void 0?void 0:ee.textContent)!==null&&re!==void 0?re:"0"),ut=Math.floor(Kr-1),Ct=Math.floor(Xt-1),dt=ut+1,Et=Ct+1,It=new Float32Array(dt*Et*3),Tt=new Float32Array(dt*Et*2),Xe=new Uint32Array(ut*Ct*6),Ne=new f.Box3,We=0;We<Et;We++)for(var At=We*Se.y.increment+Se.y.offset,Ze=0;Ze<dt;Ze++){var gt=We*dt+Ze,qt=Ze*Se.x.increment+Se.x.offset,yt=Jt[gt],Wt=!isNaN(yt),xr=Wt?yt:NaN;Nn.set(qt,-At,xr),St&&Nn.applyMatrix3(St),Wt&&Ne.expandByPoint(Nn),It[gt*3+0]=Nn.x,It[gt*3+1]=Nn.y,It[gt*3+2]=Nn.z,Tt[gt*2+0]=Ze/ut,Tt[gt*2+1]=1-We/Ct}for(var We=0;We<Ct;We++)for(var Ze=0;Ze<ut;Ze++){var jr=Ze+dt*We,wr=Ze+dt*(We+1),Lr=Ze+1+dt*(We+1),Dt=Ze+1+dt*We,Ge=(We*ut+Ze)*6;Xe[Ge+0]=jr,Xe[Ge+1]=wr,Xe[Ge+2]=Dt,Xe[Ge+3]=wr,Xe[Ge+4]=Lr,Xe[Ge+5]=Dt}var ke=new f.BufferGeometry;ke.setAttribute("position",new f.BufferAttribute(It,3)),ke.setAttribute("uv",new f.BufferAttribute(Tt,2)),ke.setIndex(new f.BufferAttribute(Xe,1)),(!ke.groups||ke.groups.length===0)&&ke.addGroup(0,ke.index?ke.index.count:ke.attributes.position.count,0),ke.boundingBox=Ne;var Ye=new br(we);Ye.flatShading=!0,Ye.color.copy(be),Ye.refreshUniforms();var bt=new Ot(ke,[Ye]);return{object:bt,dispose:function(){ke.dispose(),Ye.dispose()}}}var f0=new f.Matrix4,pv=5e3,d0=1e3;function eo(n,t){n.name=t.id;var e=t.tileset.properties.floorInfo;n.traverse(function(r){if("floor"in t.extras){if(r instanceof f.Mesh||r instanceof f.Points)for(var i=Array.isArray(r.material)?r.material:r.material?[r.material]:[],a=0,o=i;a<o.length;a++){var s=o[a];(s instanceof br||s instanceof Pi)&&(s.floor=t.extras.floor)}}else if(!(r instanceof yr)){if(r instanceof Ot&&e){for(var u=new f.Box3().expandByObject(r),l=u.getCenter(new f.Vector3),c=0,d=0;d<e.length;d++){var p=e[d],A=p.ground,h=p.height;if(l.y<A+h){c=d;break}}t.floor=c,t.tileset.floorLength=Math.max(t.tileset.floorLength,t.floor+1),r.material.forEach(function(v){return v.floor=c})}}})}function vv(n,t){if(!n.content)return Promise.resolve(n);var e=n.content,r=ga(e.uri,t.search);if(n.type==="TILESET"){var i=ft(r,{key:"model.".concat(n.siblingIndex)});return e.loadState="LOADING",e.loadStateUpdateTime=ve(),t.fetcher.ajax(i,{responseType:"text"}).then(function(a){return a.body}).then(function(a){var o=r.slice(0,r.lastIndexOf("/")+1);return Wi(JSON.parse(a),o)}).then(function(a){e.loadState="READY",e.loadStateUpdateTime=ve(),e.loadfailRetryDelay=0,n.children.length===0&&(n.children=[new Yo("".concat(n.id,".0"),a.root,n.tileset,n)])}).then(function(){return n}).catch(function(a){return e.loadState="FAILED",e.loadStateUpdateTime=ve(),e.loadfailRetryDelay=Math.min(e.loadfailRetryDelay+1e3,5e3),Promise.reject(a)})}if(n.type==="SCENEGRAPH")return e.loadState="LOADING",e.loadStateUpdateTime=ve(),Promise.resolve().then(function(){var a,o,s,u,l,c,d,p,A,h,v="",g=r.split("#"),m=g[0],y=g[1],b=(y||m).split("?")[0].match(/\.([0-9a-zA-Z]+)$/);if(b&&(v=b[1]),v==="b3dm"){var x=ft(r,{key:"model.".concat(n.siblingIndex)});return Ju(x,{upAxis:n.tileset.asset.gltfUpAxis,fetcher:t.fetcher}).then(function(w){return w.scene.applyMatrix4(n.transform),w.scene.updateWorldMatrix(!1,!0),w.scene.matrixAutoUpdate=!1,eo(w.scene,n),w})}if(v==="pnts"){var x=ft(r,{key:"model.".concat(n.siblingIndex)});return Wu(x,{computeBoundingBox:!1,fetcher:t.fetcher}).then(function(M){if(M.scene.applyMatrix4(n.transform),M.scene.updateWorldMatrix(!1,!0),M.scene.matrixAutoUpdate=!1,n.boundingVolume){var S=n.boundingVolume;M.scene.traverse(function(E){if(E instanceof yr){f0.getInverse(E.matrixWorld);var P=new f.Box3;S.getBoundingBox(P),P.applyMatrix4(f0),E.geometry.boundingBox=P}})}return eo(M.scene,n),M})}if(v==="glb"||v==="gltf"){var x=ft(r,{key:"model.".concat(n.siblingIndex)});return fl(x,{upAxis:n.tileset.asset.gltfUpAxis,fetcher:t.fetcher}).then(function(M){return M.scene.applyMatrix4(n.transform),M.scene.updateWorldMatrix(!1,!0),M.scene.matrixAutoUpdate=!1,eo(M.scene,n),M})}if(v==="at3d"){var x=n.extras.at3d?r:ft(r,{key:"model.".concat(n.siblingIndex)});return sl(x,{textureBaseUri:(a=n.extras.at3d)===null||a===void 0?void 0:a.textureBaseUri,textureArray:(o=n.extras.at3d)===null||o===void 0?void 0:o.textureArray,textureOptions:(s=n.extras.at3d)===null||s===void 0?void 0:s.textureOptions,fetcher:t.fetcher}).then(function(M){return M.scene.applyMatrix4(n.transform),M.scene.updateWorldMatrix(!1,!0),M.scene.matrixAutoUpdate=!1,M})}if(v==="pbm"){var x=n.extras.pbm?r:ft(r,{key:"model.".concat(n.siblingIndex)});return il(x,{textureBaseUri:(u=n.extras.pbm)===null||u===void 0?void 0:u.textureBaseUri,textureArray:(l=n.extras.pbm)===null||l===void 0?void 0:l.textureArray,textureOptions:(c=n.extras.pbm)===null||c===void 0?void 0:c.textureOptions,fetcher:t.fetcher}).then(function(M){return M.scene.applyMatrix4(n.transform),M.scene.updateWorldMatrix(!1,!0),M.scene.matrixAutoUpdate=!1,M})}if(v==="dome"){var x=n.extras.dome?r:ft(r,{key:"model.".concat(n.siblingIndex)});return ul(x,{textureBaseUri:(d=n.extras.dome)===null||d===void 0?void 0:d.textureBaseUri,textureOptions:(p=n.extras.dome)===null||p===void 0?void 0:p.textureOptions,fetcher:t.fetcher}).then(function(M){return M.scene.applyMatrix4(n.transform),M.scene.updateWorldMatrix(!1,!0),M.scene.matrixAutoUpdate=!1,M})}if(v==="domez"){var x=n.extras.domez?r:ft(r,{key:"model.".concat(n.siblingIndex)});return cl(x,{textureBaseUri:(A=n.extras.domez)===null||A===void 0?void 0:A.textureBaseUri,textureOptions:(h=n.extras.domez)===null||h===void 0?void 0:h.textureOptions,fetcher:t.fetcher}).then(function(M){return M.scene.applyMatrix4(n.transform),M.scene.updateWorldMatrix(!1,!0),M.scene.matrixAutoUpdate=!1,M})}if(v==="ply"){var x=n.extras.ply?r:ft(r,{key:"model.".concat(n.siblingIndex)});return ns(x,{type:"pbmPointCloud",upAxis:"Z",fetcher:t.fetcher}).then(function(M){return M.scene.applyMatrix4(n.transform),M.scene.updateWorldMatrix(!1,!0),M.scene.matrixAutoUpdate=!1,M})}if(v==="obj"){var x=n.extras.obj?r:ft(r,{key:"model.".concat(n.siblingIndex)});return Sp(x,{upAxis:"Z",fetcher:t.fetcher}).then(function(M){return M.scene.applyMatrix4(n.transform),M.scene.updateWorldMatrix(!1,!0),M.scene.matrixAutoUpdate=!1,M})}if(v==="fbx"){var x=n.extras.obj?r:ft(r,{key:"model.".concat(n.siblingIndex)});return Ml(x,{fetcher:t.fetcher}).then(function(M){return M.scene.applyMatrix4(n.transform),M.scene.updateWorldMatrix(!1,!0),M.scene.matrixAutoUpdate=!1,M})}if(v==="x3p"){var x=n.extras.x3p?r:ft(r,{key:"model.".concat(n.siblingIndex)});return Il(x,{fetcher:t.fetcher}).then(function(M){return M.scene.applyMatrix4(n.transform),M.scene.updateWorldMatrix(!1,!0),M.scene.matrixAutoUpdate=!1,M})}throw new Error("Invalid Tile content: ".concat(r))}).then(function(a){a.scene.traverse(function(s){if(s instanceof yr)s.material.uniforms.geometricError.value=n.geometricError;else if(s instanceof Ot)for(var u=0,l=s.material;u<l.length;u++){var c=l[u];c.uniforms.geometricError.value=n.geometricError}});var o={type:a.type,uri:a.uri,byteLength:a.byteLength,object:new qu(n.id,a.scene,a.dispose)};return Promise.resolve().then(function(){return Promise.all([o.object.generateBvhTree(),t.renderer&&a.textures.length<16?th(a.textures,t.renderer,1024*1024):null])}).then(function(){return e.loadState="READY",e.loadStateUpdateTime=ve(),e.loadfailRetryDelay=0,e.byteLength=o.byteLength,e.data=o,n}).catch(function(s){return Ro(n),Promise.reject(s)})}).catch(function(a){return e.loadState="FAILED",e.loadStateUpdateTime=ve(),a instanceof Kn&&a.httpStatus===0||a instanceof vi||a instanceof bi?e.loadfailRetryDelay=ce(e.loadfailRetryDelay+d0,d0,pv):e.loadfailRetryDelay=1/0,Promise.reject(a)});throw new Error("Invalid Tile type: ".concat(n.type))}function Ro(n){n.content&&(n.content.data&&n.content.data.object.dispose(),n.content.data=void 0,n.content.loadState="UNLOADED",n.content.loadStateUpdateTime=ve(),n.content.byteLength=0)}var Tl=function(n){ue(t,n);function t(e,r,i){i===void 0&&(i=Q);var a=n.call(this)||this;return a.name=e,a.contentObject=r,a.name=e,a.add(r),a.disposers=[i],a}return t.prototype.update=function(e,r,i){var a=this.contentObject.material[2];a.uniforms.dashOffset.value=(a.uniforms.dashOffset.value-.003)%(a.uniforms.dashSize.value.x+a.uniforms.dashSize.value.y),i.needsRender=!0},t.prototype.dispose=function(){for(var e=0,r=this.disposers;e<r.length;e++){var i=r[e];i()}this.disposers.length=0},t.prototype.clone=function(){return new t(this.name,this.contentObject.clone())},t}(f.Object3D),mv=5e3,h0=1e3,Vr={vertexShader:`
|
|
934
|
+
`),a={name:""},o=/\s+/,s={},u=0;u<i.length;u++){var l=i[u];if(l=l.trim(),!(l.length===0||l.charAt(0)==="#")){var c=l.indexOf(" "),d=c>=0?l.substring(0,c):l;d=d.toLowerCase();var p=c>=0?l.substring(c+1):"";if(p=p.trim(),d==="newmtl")a={name:p},s[p]=a;else if(d==="ka"||d==="kd"||d==="ks"||d==="ke"){var A=p.split(o,3);a[d]=[parseFloat(A[0]),parseFloat(A[1]),parseFloat(A[2])]}else(d==="map_kd"||d==="map_ks"||d==="map_ke"||d==="norm"||d==="map_bump"||d==="bump"||d==="map_d"||d==="ns"||d==="d"||d==="tr")&&(a[d]=p)}}function h(g){var m={url:"",scale:new f.Vector2(1,1),offset:new f.Vector2(0,0),bumpScale:1},y=g.split(/\s+/),b;return b=y.indexOf("-bm"),b>=0&&(m.bumpScale=parseFloat(y[b+1]),y.splice(b,2)),b=y.indexOf("-s"),b>=0&&(m.scale.set(parseFloat(y[b+1]),parseFloat(y[b+2])),y.splice(b,4)),b=y.indexOf("-o"),b>=0&&(m.offset.set(parseFloat(y[b+1]),parseFloat(y[b+2])),y.splice(b,4)),m.url=y.join(" ").trim(),m}function v(g,m,y){var b=h(y),x=st(e.path,b.url);return r.loadTexture(x,{fetcher:e.fetcher,encoding:m==="map"||m==="emissiveMap"?f.sRGBEncoding:f.LinearEncoding,minFilter:f.LinearFilter,magFilter:f.LinearFilter,wrapS:f.RepeatWrapping,wrapT:f.RepeatWrapping}).then(function(w){var M=w.body;return M.repeat.copy(b.scale),M.offset.copy(b.offset),g.bumpScale=b.bumpScale,g[m]=M,M})}return{name:n,create:function(g){var m=new br(e.materialType),y=[],b=s[g];if(b){if(b.kd!==void 0&&m.color.fromArray(b.kd),b.ks!==void 0&&m.specular.fromArray(b.ks),b.ke!==void 0&&m.emissive.fromArray(b.ke),b.map_kd!==void 0&&y.push(v(m,"map",b.map_kd)),b.map_ks!==void 0&&y.push(v(m,"specularMap",b.map_ks)),b.map_ke!==void 0&&y.push(v(m,"emissiveMap",b.map_ke)),b.norm!==void 0&&y.push(v(m,"normalMap",b.norm)),b.map_bump!==void 0&&y.push(v(m,"bumpMap",b.map_bump)),b.bump!==void 0&&y.push(v(m,"bumpMap",b.bump)),b.map_d!==void 0&&y.push(v(m,"alphaMap",b.map_d)),b.ns!==void 0&&(m.shininess=parseFloat(b.ns)),b.d!==void 0){var x=parseFloat(b.d);x<1&&(m.opacity=x,m.transparent=!0)}if(b.tr!==void 0){var x=parseFloat(b.tr);x>0&&(m.opacity=1-x,m.transparent=!0)}}var w=Promise.all(y).then(function(M){return m.refreshUniforms(),M});return[m,w]}}}function Mp(n,t){for(var e,r=[],i=[],a=new f.Group,o=function(l,c){var d=n.objects[l],p=d.geometry,A=d.materials,h=!1;if(p.vertices.length===0)return"continue";var v=new f.BufferGeometry;i.push(function(){return v.dispose()}),v.setAttribute("position",new f.BufferAttribute(new Float32Array(p.vertices),3)),p.normals.length>0&&v.setAttribute("normal",new f.BufferAttribute(new Float32Array(p.normals),3)),p.colors.length>0&&(h=!0,v.setAttribute("color",new f.BufferAttribute(new Float32Array(p.colors),3))),p.uvs.length>0&&v.setAttribute("uv",new f.BufferAttribute(new Float32Array(p.uvs),2)),p.index.length>0&&v.setIndex(new f.BufferAttribute(new Uint32Array(p.index),1)),v.computeBoundingBox(),v.computeBoundingSphere();for(var g=[],m=function(M,S){var E=A[M],B=E.name+"_"+E.smooth+"_"+h,R=n.materials[B];if(!R){for(var C=null,I=0,L=t;I<L.length;I++){var T=L[I],F=T.name,D=T.create;F===E.mtllib&&(C=D(E.name))}if(!C){var V=new br;V.refreshUniforms(),C=[V,Promise.resolve([])]}R=C[0],R.name=E.name,R.flatShading=!(E.smooth||v.attributes.normal),R.vertexColors=h,n.materials[B]=R;var z=C[1];r.push(z),i.push(function(){return R.dispose()})}g.push(R)},y=0,b=A.length;y<b;y++)m(y);v.clearGroups();for(var y=0,b=A.length;y<b;y++){var x=A[y];x.groupCount&&v.addGroup((e=x.groupStart)!==null&&e!==void 0?e:0,x.groupCount,y)}(!v.groups||v.groups.length===0)&&v.addGroup(0,v.index?v.index.count:v.attributes.position.count,0);var w=new Ot(v,g);w.name=d.name,a.add(w)},s=0,u=n.objects.length;s<u;s++)o(s);return Promise.all(r).then(function(l){for(var c=[],d=0,p=l;d<p.length;d++){var A=p[d];c=c.concat(A)}return{scene:a,textures:c,dispose:function(){return i.forEach(function(h){return h()})}}})}function Sp(n,t){var e,r,i;t===void 0&&(t={});var a=(e=t.upAxis)!==null&&e!==void 0?e:"Z",o=(r=t.materialType)!==null&&r!==void 0?r:"basic",s=(i=t.fetcher)!==null&&i!==void 0?i:new qt({allowHosts:["*"]}),u=n.slice(0,n.lastIndexOf("/")+1),l=0,c;return Promise.resolve().then(function(){return s.ajax(n,{responseType:"arraybuffer"})}).then(function(d){l=d.body.byteLength;var p=new TextDecoder;return p.decode(d.body)}).then(function(d){return c=xp(d),Promise.all(c.materialLibraries.map(function(p){var A=st(u,p),h=A.slice(0,A.lastIndexOf("/")+1);return s.ajax(A,{responseType:"text"}).then(function(v){return wp(p,v.body,{path:h,materialType:o,fetcher:s})})}))}).then(function(d){return Mp(c,d)}).then(function(d){var p=new f.Matrix4;return a==="Y"&&p.premultiply(vp),d.scene.applyMatrix4(p),{type:"obj",upAxis:"Z",uri:n,byteLength:l,scene:d.scene,textures:d.textures,dispose:function(){return d.dispose()}}})}var jt=Uint8Array,Qn=Uint16Array,Cp=Int32Array,ml=new jt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Al=new jt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ep=new jt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),gl=function(n,t){for(var e=new Qn(31),r=0;r<31;++r)e[r]=t+=1<<n[r-1];for(var i=new Cp(e[30]),r=1;r<30;++r)for(var a=e[r];a<e[r+1];++a)i[a]=a-e[r]<<5|r;return{b:e,r:i}},yl=gl(ml,2),bl=yl.b,Ip=yl.r;bl[28]=258,Ip[258]=28;var Tp=gl(Al,0),Pp=Tp.b,Io=new Qn(32768);for(var _e=0;_e<32768;++_e){var nn=(_e&43690)>>1|(_e&21845)<<1;nn=(nn&52428)>>2|(nn&13107)<<2,nn=(nn&61680)>>4|(nn&3855)<<4,Io[_e]=((nn&65280)>>8|(nn&255)<<8)>>1}var di=function(n,t,e){for(var r=n.length,i=0,a=new Qn(t);i<r;++i)n[i]&&++a[n[i]-1];var o=new Qn(t);for(i=1;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(e){s=new Qn(1<<t);var u=15-t;for(i=0;i<r;++i)if(n[i])for(var l=i<<4|n[i],c=t-n[i],d=o[n[i]-1]++<<c,p=d|(1<<c)-1;d<=p;++d)s[Io[d]>>u]=l}else for(s=new Qn(r),i=0;i<r;++i)n[i]&&(s[i]=Io[o[n[i]-1]++]>>15-n[i]);return s},Ri=new jt(288);for(var _e=0;_e<144;++_e)Ri[_e]=8;for(var _e=144;_e<256;++_e)Ri[_e]=9;for(var _e=256;_e<280;++_e)Ri[_e]=7;for(var _e=280;_e<288;++_e)Ri[_e]=8;var xl=new jt(32);for(var _e=0;_e<32;++_e)xl[_e]=5;var Rp=di(Ri,9,1),Bp=di(xl,5,1),Xa=function(n){for(var t=n[0],e=1;e<n.length;++e)n[e]>t&&(t=n[e]);return t},ur=function(n,t,e){var r=t/8|0;return(n[r]|n[r+1]<<8)>>(t&7)&e},Wa=function(n,t){var e=t/8|0;return(n[e]|n[e+1]<<8|n[e+2]<<16)>>(t&7)},Fp=function(n){return(n+7)/8|0},is=function(n,t,e){return(t==null||t<0)&&(t=0),(e==null||e>n.length)&&(e=n.length),new jt(n.subarray(t,e))},Lp=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],zt=function(n,t,e){var r=new Error(t||Lp[n]);if(r.code=n,Error.captureStackTrace&&Error.captureStackTrace(r,zt),!e)throw r;return r},wl=function(n,t,e,r){var i=n.length,a=r?r.length:0;if(!i||t.f&&!t.l)return e||new jt(0);var o=!e,s=o||t.i!=2,u=t.i;o&&(e=new jt(i*3));var l=function(de){var se=e.length;if(de>se){var ye=new jt(Math.max(se*2,de));ye.set(e),e=ye}},c=t.f||0,d=t.p||0,p=t.b||0,A=t.l,h=t.d,v=t.m,g=t.n,m=i*8;do{if(!A){c=ur(n,d,1);var y=ur(n,d+1,3);if(d+=3,y)if(y==1)A=Rp,h=Bp,v=9,g=5;else if(y==2){var M=ur(n,d,31)+257,S=ur(n,d+10,15)+4,E=M+ur(n,d+5,31)+1;d+=14;for(var B=new jt(E),R=new jt(19),C=0;C<S;++C)R[Ep[C]]=ur(n,d+C*3,7);d+=S*3;for(var I=Xa(R),L=(1<<I)-1,T=di(R,I,1),C=0;C<E;){var F=T[ur(n,d,L)];d+=F&15;var b=F>>4;if(b<16)B[C++]=b;else{var D=0,V=0;for(b==16?(V=3+ur(n,d,3),d+=2,D=B[C-1]):b==17?(V=3+ur(n,d,7),d+=3):b==18&&(V=11+ur(n,d,127),d+=7);V--;)B[C++]=D}}var z=B.subarray(0,M),U=B.subarray(M);v=Xa(z),g=Xa(U),A=di(z,v,1),h=di(U,g,1)}else zt(1);else{var b=Fp(d)+4,x=n[b-4]|n[b-3]<<8,w=b+x;if(w>i){u&&zt(0);break}s&&l(p+x),e.set(n.subarray(b,w),p),t.b=p+=x,t.p=d=w*8,t.f=c;continue}if(d>m){u&&zt(0);break}}s&&l(p+131072);for(var q=(1<<v)-1,G=(1<<g)-1,K=d;;K=d){var D=A[Wa(n,d)&q],j=D>>4;if(d+=D&15,d>m){u&&zt(0);break}if(D||zt(2),j<256)e[p++]=j;else if(j==256){K=d,A=null;break}else{var J=j-254;if(j>264){var C=j-257,W=ml[C];J=ur(n,d,(1<<W)-1)+bl[C],d+=W}var $=h[Wa(n,d)&G],Y=$>>4;$||zt(3),d+=$&15;var U=Pp[Y];if(Y>3){var W=Al[Y];U+=Wa(n,d)&(1<<W)-1,d+=W}if(d>m){u&&zt(0);break}s&&l(p+131072);var Z=p+J;if(p<U){var oe=a-U,ne=Math.min(U,Z);for(oe+p<0&&zt(3);p<ne;++p)e[p]=r[oe+p]}for(;p<Z;++p)e[p]=e[p-U]}}t.l=A,t.p=K,t.b=p,t.f=c,A&&(c=1,t.m=v,t.d=h,t.n=g)}while(!c);return p!=e.length&&o?is(e,0,p):e.subarray(0,p)},kp=new jt(0),Pr=function(n,t){return n[t]|n[t+1]<<8},mr=function(n,t){return(n[t]|n[t+1]<<8|n[t+2]<<16|n[t+3]<<24)>>>0},Za=function(n,t){return mr(n,t)+mr(n,t+4)*4294967296},Op=function(n,t){return((n[0]&15)!=8||n[0]>>4>7||(n[0]<<8|n[1])%31)&&zt(6,"invalid zlib data"),(n[1]>>5&1)==+!t&&zt(6,"invalid zlib data: "+(n[1]&32?"need":"unexpected")+" dictionary"),(n[1]>>3&4)+2};function Dp(n,t){return wl(n,{i:2},t&&t.out,t&&t.dictionary)}function Vp(n,t){return wl(n.subarray(Op(n,t),-4),{i:2},t,t)}var To=typeof TextDecoder!="undefined"&&new TextDecoder,Np=0;try{To.decode(kp,{stream:!0}),Np=1}catch(n){}var zp=function(n){for(var t="",e=0;;){var r=n[e++],i=(r>127)+(r>223)+(r>239);if(e+i>n.length)return{s:t,r:is(n,e-1)};i?i==3?(r=((r&15)<<18|(n[e++]&63)<<12|(n[e++]&63)<<6|n[e++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?t+=String.fromCharCode((r&31)<<6|n[e++]&63):t+=String.fromCharCode((r&15)<<12|(n[e++]&63)<<6|n[e++]&63):t+=String.fromCharCode(r)}};function Qp(n,t){if(t){for(var e="",r=0;r<n.length;r+=16384)e+=String.fromCharCode.apply(null,n.subarray(r,r+16384));return e}else{if(To)return To.decode(n);var i=zp(n),a=i.s,e=i.r;return e.length&&zt(8),a}}var Up=function(n,t){return t+30+Pr(n,t+26)+Pr(n,t+28)},qp=function(n,t,e){var r=Pr(n,t+28),i=Qp(n.subarray(t+46,t+46+r),!(Pr(n,t+8)&2048)),a=t+46+r,o=mr(n,t+20),s=e&&o==4294967295?Hp(n,a):[o,mr(n,t+24),mr(n,t+42)],u=s[0],l=s[1],c=s[2];return[Pr(n,t+10),u,l,i,a+Pr(n,t+30)+Pr(n,t+32),c]},Hp=function(n,t){for(;Pr(n,t)!=1;t+=4+Pr(n,t+2));return[Za(n,t+12),Za(n,t+4),Za(n,t+20)]};function Gp(n,t){for(var e={},r=n.length-22;mr(n,r)!=101010256;--r)(!r||n.length-r>65558)&&zt(13);var i=Pr(n,r+8);if(!i)return{};var a=mr(n,r+16),o=a==4294967295||i==65535;if(o){var s=mr(n,r-12);o=mr(n,s)==101075792,o&&(i=mr(n,s+32),a=mr(n,s+48))}for(var u=0;u<i;++u){var l=qp(n,a,o),c=l[0],d=l[1],p=l[2],A=l[3],h=l[4],v=l[5],g=Up(n,v);a=h,c?c==8?e[A]=Dp(n.subarray(g,g+d),{out:new jt(p)}):zt(14,"unknown compression type "+c):e[A]=is(n,g,g+d)}return e}var Kp=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function Ml(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new qt({allowHosts:["*"]}),i=0;return Promise.resolve().then(function(){return r.ajax(n,{responseType:"arraybuffer"}).then(function(a){return i=a.body.byteLength,a.body})}).then(function(a){var o;return _p(a,{materialType:t.materialType,resourcePath:n.slice(0,n.lastIndexOf("/")+1),search:(o=n.split("?")[1])!==null&&o!==void 0?o:"",fetcher:r})}).then(function(a){var o=a.scene,s=a.unitScale/100,u=new f.Matrix4;return u.makeScale(s,s,s),a.upAxis==="Y"&&u.premultiply(Kp),o.applyMatrix4(u),{type:"fbx",upAxis:"Z",uri:n,byteLength:i,scene:o,textures:a.textures,dispose:function(){return a.dispose()}}})}function _p(n,t){var e;if(Yp(n))e=new Zp().parse(n);else{var r=Cl(n);if(!$p(r))throw new Error("THREE.FBXLoader: Unknown format.");if(c0(r)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+c0(r));e=new Wp().parse(r)}return new jp(t).parse(e)}var jp=function(){function n(t){var e,r,i;this.materialType=(e=t.materialType)!==null&&e!==void 0?e:"phong",this.resourcePath=(r=t.resourcePath)!==null&&r!==void 0?r:"",this.search=(i=t.search)!==null&&i!==void 0?i:"",this.fetcher=t.fetcher}return n.prototype.parse=function(t){var e,r,i,a,o,s,u=this.parseConnections(t),l=new f.Group,c=[],d=this.parseImages(t),p=this.parseTextures(t,d,u,c),A=this.parseMaterials(t,p,u),h=this.parseDeformers(t,u),v=new Jp().parse(t,h,u);this.parseScene(t,h,v,A,u,l);var g=(r=(e=t.GlobalSettings.UpAxis)===null||e===void 0?void 0:e.value)!==null&&r!==void 0?r:1,m=(a=(i=t.GlobalSettings.FrontAxis)===null||i===void 0?void 0:i.value)!==null&&a!==void 0?a:2,y=(s=(o=t.GlobalSettings.UnitScaleFactor)===null||o===void 0?void 0:o.value)!==null&&s!==void 0?s:1,b;if(t.GlobalSettings.AmbientColor){var x=t.GlobalSettings.AmbientColor.value,w=x[0],M=x[1],S=x[2];if(w!==0||M!==0||S!==0){var E=new f.Color().setRGB(w,M,S);b=new f.AmbientLight(E,1)}}return Promise.all(c).then(function(B){return{scene:l,textures:B,ambientLight:b,upAxis:["X","Y","Z"][g],frontAxis:["X","Y","Z"][m],unitScale:y,dispose:function(){B.forEach(function(R){return R.dispose()}),A.forEach(function(R){return R.dispose()}),v.forEach(function(R){return R.dispose()})}}})},n.prototype.parseConnections=function(t){var e=new Map;if("Connections"in t){var r=t.Connections.connections;r.forEach(function(i){var a=i[0],o=i[1],s=i[2];e.has(a)||e.set(a,{parents:[],children:[]});var u={ID:o,relationship:s};e.get(a).parents.push(u),e.has(o)||e.set(o,{parents:[],children:[]});var l={ID:a,relationship:s};e.get(o).children.push(l)})}return e},n.prototype.parseImages=function(t){var e={},r={};if("Video"in t.Objects){var i=t.Objects.Video;for(var a in i){var o=i[a],s=parseInt(a);if(e[s]=o.RelativeFilename||o.Filename,"Content"in o){var u=o.Content instanceof ArrayBuffer&&o.Content.byteLength>0,l=typeof o.Content=="string"&&o.Content!=="";if(u||l){var c=this.parseImage(i[a]);r[o.RelativeFilename||o.Filename]=c}}}}for(var s in e){var d=e[s];r[d]!==void 0?e[s]=r[d]:e[s]=e[s].split("\\").pop()}return e},n.prototype.parseImage=function(t){var e=t.Content,r=t.RelativeFilename||t.Filename,i=r.slice(r.lastIndexOf(".")+1).toLowerCase(),a;switch(i){case"bmp":a="image/bmp";break;case"jpg":case"jpeg":a="image/jpeg";break;case"png":a="image/png";break;case"tif":a="image/tiff";break;case"tga":a="image/tga";break;default:return}if(typeof e=="string")return"data:"+a+";base64,"+e;var o=new Uint8Array(e);return window.URL.createObjectURL(new Blob([o],{type:a}))},n.prototype.parseTextures=function(t,e,r,i){var a=new Map;if("Texture"in t.Objects){var o=t.Objects.Texture;for(var s in o){var u=this.parseTexture(o[s],e,r,i);a.set(parseInt(s),u)}}return a},n.prototype.parseTexture=function(t,e,r,i){var a=this.loadTexture(t,e,r,i);a.ID=t.id,a.name=t.attrName;var o=t.WrapModeU,s=t.WrapModeV,u=o!==void 0?o.value:0,l=s!==void 0?s.value:0;if(a.wrapS=u===0?f.RepeatWrapping:f.ClampToEdgeWrapping,a.wrapT=l===0?f.RepeatWrapping:f.ClampToEdgeWrapping,t.Scaling){var c=t.Scaling.value;a.repeat.x=c[0],a.repeat.y=c[1]}if(t.Translation){var c=t.Translation.value;a.offset.x=c[0],a.offset.y=c[1]}return a},n.prototype.loadTexture=function(t,e,r,i){var a=r.get(t.id).children,o="";a!==void 0&&a.length>0&&e[a[0].ID]!==void 0&&(o=e[a[0].ID]),o=st(this.resourcePath,ga(o,this.search));var s=Object.assign(new f.Texture,{ID:0}),u;u=this.fetcher.loadImage(o,{},void 0,void 0,void 0,Ai()).then(function(c){return c.body});var l=u.then(function(c){return s.image=c,s.needsUpdate=!0,s});return i.push(l),s},n.prototype.parseMaterials=function(t,e,r){var i=new Map;if("Material"in t.Objects){var a=t.Objects.Material;for(var o in a){var s=this.parseMaterial(t,a[o],e,r);s!==null&&i.set(parseInt(o),s)}}return i},n.prototype.parseMaterial=function(t,e,r,i){var a=e.id;e.attrName;var o=e.ShadingModel;if(typeof o=="object"&&(o=o.value),o=o.toLowerCase(),!i.has(a))return null;var s=new br(this.materialType);e.BumpFactor&&(s.bumpScale=e.BumpFactor.value),e.Diffuse?s.color=new f.Color().fromArray(e.Diffuse.value):e.DiffuseColor&&(e.DiffuseColor.type==="Color"||e.DiffuseColor.type==="ColorRGB")&&(s.color=new f.Color().fromArray(e.DiffuseColor.value)),e.DisplacementFactor&&(s.displacementScale=e.DisplacementFactor.value),e.Emissive?s.emissive=new f.Color().fromArray(e.Emissive.value):e.EmissiveColor&&(e.EmissiveColor.type==="Color"||e.EmissiveColor.type==="ColorRGB")&&(s.emissive=new f.Color().fromArray(e.EmissiveColor.value)),e.EmissiveFactor&&(s.emissiveIntensity=parseFloat(e.EmissiveFactor.value));var u=1-(e.TransparencyFactor?parseFloat(e.TransparencyFactor.value):0);(u===1||u===0)&&(u=e.Opacity?parseFloat(e.Opacity.value):null,u===null&&(u=1-(e.TransparentColor?parseFloat(e.TransparentColor.value[0]):0))),s.opacity=u,s.opacity<1&&(s.transparent=!0),e.ReflectionFactor&&(s.reflectivity=e.ReflectionFactor.value),e.Shininess&&(s.shininess=e.Shininess.value),e.Specular?s.specular=new f.Color().fromArray(e.Specular.value):e.SpecularColor&&e.SpecularColor.type==="Color"&&(s.specular=new f.Color().fromArray(e.SpecularColor.value));var l=this;return i.get(a).children.forEach(function(c){var d=c.relationship;switch(d){case"Bump":s.bumpMap=l.getTexture(t,r,c.ID,i);break;case"Maya|TEX_ao_map":s.aoMap=l.getTexture(t,r,c.ID,i);break;case"DiffuseColor":case"Maya|TEX_color_map":s.map=l.getTexture(t,r,c.ID,i),s.map!==void 0&&(s.map.encoding=f.sRGBEncoding);break;case"DisplacementColor":s.displacementMap=l.getTexture(t,r,c.ID,i);break;case"EmissiveColor":s.emissiveMap=l.getTexture(t,r,c.ID,i),s.emissiveMap!==void 0&&(s.emissiveMap.encoding=f.sRGBEncoding);break;case"NormalMap":case"Maya|TEX_normal_map":s.normalMap=l.getTexture(t,r,c.ID,i);break;case"ReflectionColor":s.envMap=l.getTexture(t,r,c.ID,i),s.envMap!==void 0&&(s.envMap.mapping=f.EquirectangularReflectionMapping,s.envMap.encoding=f.sRGBEncoding);break;case"SpecularColor":s.specularMap=l.getTexture(t,r,c.ID,i),s.specularMap!==void 0&&(s.specularMap.encoding=f.sRGBEncoding);break;case"TransparentColor":case"TransparencyFactor":s.alphaMap=l.getTexture(t,r,c.ID,i),s.transparent=!0;break;case"AmbientColor":case"ShininessExponent":case"SpecularFactor":case"VectorDisplacementColor":default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",d);break}}),s.refreshUniforms(),s},n.prototype.getTexture=function(t,e,r,i){return t.Objects.LayeredTexture&&r in t.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),r=i.get(r).children[0].ID),e.get(r)},n.prototype.parseDeformers=function(t,e){var r={},i={};if("Deformer"in t.Objects){var a=t.Objects.Deformer;for(var o in a){var s=a[o],u=e.get(parseInt(o));if(s.attrType==="Skin"){var l=this.parseSkeleton(u,a);l.ID=o,u.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),l.geometryID=u.parents[0].ID,r[o]=l}else if(s.attrType==="BlendShape"){var c={id:o};c.rawTargets=this.parseMorphTargets(u,a,e),c.id=o,u.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),i[o]=c}}}return{skeletons:r,morphTargets:i}},n.prototype.parseSkeleton=function(t,e){var r=[];return t.children.forEach(function(i){var a=e[i.ID];if(a.attrType==="Cluster"){var o={ID:i.ID,indices:[],weights:[],transformLink:new f.Matrix4().fromArray(a.TransformLink.a)};a.Indexes&&(o.indices=a.Indexes.a,o.weights=a.Weights.a),r.push(o)}}),{ID:"",geometryID:0,rawBones:r,bones:[]}},n.prototype.parseMorphTargets=function(t,e,r){for(var i=[],a=0;a<t.children.length;a++){var o=t.children[a],s=e[o.ID],u={name:s.attrName,initialWeight:s.DeformPercent,id:s.id,fullWeights:s.FullWeights.a,geoID:0};if(s.attrType!=="BlendShapeChannel")return;u.geoID=r.get(parseInt(o.ID)).children.filter(function(l){return l.relationship===void 0})[0].ID,i.push(u)}return i},n.prototype.parseScene=function(t,e,r,i,a,o){var s=this.parseModels(t,e.skeletons,r,i,a),u=t.Objects.Model,l=this;s.forEach(function(d){var p=u[d.ID];l.setLookAtProperties(t,d,p,a,o);var A=a.get(d.ID).parents;A.forEach(function(h){var v=s.get(h.ID);v!==void 0&&v.add(d)}),d.parent===null&&o.add(d)}),this.bindSkeleton(t,e.skeletons,r,s,a),o.traverse(function(d){if(d.userData.transformData){d.parent&&(d.userData.transformData.parentMatrix=d.parent.matrix,d.userData.transformData.parentMatrixWorld=d.parent.matrixWorld);var p=Sl(d.userData.transformData);d.applyMatrix4(p),d.updateWorldMatrix(!0,!0)}});var c=new Xp().parse(t,a,o);o.children.length===1&&o.children[0]instanceof f.Group&&(o.children[0].animations=c,o=o.children[0]),o.animations=c},n.prototype.parseModels=function(t,e,r,i,a){var o=new Map,s=t.Objects.Model;for(var u in s){var l=parseInt(u),c=s[u],d=a.get(l),p=this.buildSkeleton(d,e,l,c.attrName);if(!p){switch(c.attrType){case"Camera":p=this.createCamera(t,d);break;case"Light":p=this.createLight(t,d);break;case"Mesh":p=this.createMesh(d,r,i);break;case"NurbsCurve":case"LimbNode":case"Root":p=new f.Bone;break;case"Null":default:p=new f.Group;break}p.name=c.attrName?f.PropertyBinding.sanitizeNodeName(c.attrName):"",p.userData.originalName=c.attrName,p.ID=l}this.getTransformData(p,c),o.set(l,p)}return o},n.prototype.buildSkeleton=function(t,e,r,i){var a=null;return t.parents.forEach(function(o){var s=function(l){var c=e[l];c.rawBones.forEach(function(d,p){if(d.ID===o.ID){var A=a;a=new f.Bone,a.matrixWorld.copy(d.transformLink),a.name=i?f.PropertyBinding.sanitizeNodeName(i):"",a.userData.originalName=i,a.ID=r,c.bones[p]=a,A!==null&&a.add(A)}})};for(var u in e)s(u)}),a},n.prototype.createCamera=function(t,e){var r,i;if(e.children.forEach(function(A){var h=t.Objects.NodeAttribute[A.ID];h!==void 0&&(i=h)}),i===void 0)r=new f.Object3D;else{var a=0;i.CameraProjectionType!==void 0&&i.CameraProjectionType.value===1&&(a=1);var o=1;i.NearPlane!==void 0&&(o=i.NearPlane.value/1e3);var s=1e3;i.FarPlane!==void 0&&(s=i.FarPlane.value/1e3);var u=window.innerWidth,l=window.innerHeight;i.AspectWidth!==void 0&&i.AspectHeight!==void 0&&(u=i.AspectWidth.value,l=i.AspectHeight.value);var c=u/l,d=45;i.FieldOfView!==void 0&&(d=i.FieldOfView.value);var p=i.FocalLength?i.FocalLength.value:null;switch(a){case 0:r=new f.PerspectiveCamera(d,c,o,s),p!==null&&r.setFocalLength(p);break;case 1:console.warn("THREE.FBXLoader: Orthographic cameras not supported yet."),r=new f.Object3D;break;default:console.warn("THREE.FBXLoader: Unknown camera type "+a+"."),r=new f.Object3D;break}}return r},n.prototype.createLight=function(t,e){var r,i;if(e.children.forEach(function(p){var A=t.Objects.NodeAttribute[p.ID];A!==void 0&&(i=A)}),i===void 0)r=new f.Object3D;else{var a=void 0;i.LightType===void 0?a=0:a=i.LightType.value;var o=new f.Color(16777215);i.Color!==void 0&&(o=new f.Color().fromArray(i.Color.value));var s=i.Intensity===void 0?1:i.Intensity.value/100;i.CastLightOnObject!==void 0&&i.CastLightOnObject.value===0&&(s=0);var u=0;i.FarAttenuationEnd!==void 0&&(i.EnableFarAttenuation!==void 0&&i.EnableFarAttenuation.value===0?u=0:u=i.FarAttenuationEnd.value);var l=1;switch(a){case 0:r=new f.PointLight(o,s,u,l);break;case 1:r=new f.DirectionalLight(o,s);break;case 2:var c=Math.PI/3;i.InnerAngle!==void 0&&(c=f.MathUtils.degToRad(i.InnerAngle.value));var d=0;i.OuterAngle!==void 0&&(d=f.MathUtils.degToRad(i.OuterAngle.value),d=Math.max(d,1)),r=new f.SpotLight(o,s,u,c,d,l);break;default:console.warn("THREE.FBXLoader: Unknown light type "+i.LightType.value+", defaulting to a PointLight."),r=new f.PointLight(o,s);break}i.CastShadows!==void 0&&i.CastShadows.value===1&&(r.castShadow=!0)}return r},n.prototype.createMesh=function(t,e,r){var i,a=null,o=[];if(t.children.forEach(function(u){e.has(u.ID)&&(a=e.get(u.ID)),r.has(u.ID)&&o.push(r.get(u.ID))}),o.length===0){var s=new br(this.materialType);s.color=new f.Color(13421772),o.push(s)}return"color"in a.attributes&&o.forEach(function(u){u.vertexColors=!0}),(!a.groups||a.groups.length===0)&&a.addGroup(0,a.index?a.index.count:a.attributes.position.count,0),a.FBX_Deformer?(i=new gu(a,o),i.normalizeSkinWeights()):i=new Ot(a,o),i},n.prototype.createCurve=function(t,e){var r=t.children.reduce(function(a,o){return e.has(o.ID)&&(a=e.get(o.ID)),a},null),i=new f.LineBasicMaterial({name:"",color:3342591,linewidth:1});return new f.Line(r,i)},n.prototype.getTransformData=function(t,e){var r={};e.InheritType&&(r.inheritType=parseInt(e.InheritType.value)),e.RotationOrder?r.eulerOrder=gi(e.RotationOrder.value):r.eulerOrder=gi(0),e.Lcl_Translation&&(r.translation=e.Lcl_Translation.value),e.PreRotation&&(r.preRotation=e.PreRotation.value),e.Lcl_Rotation&&(r.rotation=e.Lcl_Rotation.value),e.PostRotation&&(r.postRotation=e.PostRotation.value),e.Lcl_Scaling&&(r.scale=e.Lcl_Scaling.value),e.ScalingOffset&&(r.scalingOffset=e.ScalingOffset.value),e.ScalingPivot&&(r.scalingPivot=e.ScalingPivot.value),e.RotationOffset&&(r.rotationOffset=e.RotationOffset.value),e.RotationPivot&&(r.rotationPivot=e.RotationPivot.value),t.userData.transformData=r},n.prototype.setLookAtProperties=function(t,e,r,i,a){if("LookAtProperty"in r){var o=i.get(e.ID).children;o.forEach(function(s){if(s.relationship==="LookAtProperty"){var u=t.Objects.Model[s.ID];if(u.Lcl_Translation){var l=u.Lcl_Translation.value;"target"in e&&e.target instanceof f.Object3D?(e.target.position.fromArray(l),a.add(e.target)):e.lookAt(new f.Vector3().fromArray(l))}}})}},n.prototype.bindSkeleton=function(t,e,r,i,a){var o=this.parsePoseNodes(t),s=function(l){var c=e[l],d=a.get(parseInt(c.ID)).parents;d.forEach(function(p){if(r.has(p.ID)){var A=p.ID,h=a.get(A);h.parents.forEach(function(v){if(i.has(v.ID)){var g=i.get(v.ID);g instanceof f.SkinnedMesh&&g.bind(new f.Skeleton(c.bones),o[v.ID])}})}})};for(var u in e)s(u)},n.prototype.parsePoseNodes=function(t){var e={};if(t.Objects.Pose){var r=t.Objects.Pose;for(var i in r)if(r[i].attrType==="BindPose"&&r[i].NbPoseNodes>0){var a=r[i].PoseNode;Array.isArray(a)?a.forEach(function(o){e[o.Node]=new f.Matrix4().fromArray(o.Matrix.a)}):e[a.Node]=new f.Matrix4().fromArray(a.Matrix.a)}}return e},n}(),Jp=function(){function n(){this.negativeMaterialIndices=!1}return n.prototype.parse=function(t,e,r){var i=new Map;if("Geometry"in t.Objects){var a=t.Objects.Geometry;for(var o in a){var s=r.get(parseInt(o)),u=this.parseGeometry(t,s,a[o],e);i.set(parseInt(o),u)}}return this.negativeMaterialIndices===!0&&console.warn("THREE.FBXLoader: The FBX file contains invalid (negative) material indices. The asset might not render as expected."),i},n.prototype.parseGeometry=function(t,e,r,i){switch(r.attrType){case"Mesh":return this.parseMeshGeometry(t,e,r,i);case"NurbsCurve":return this.parseNurbsGeometry(r)}},n.prototype.parseMeshGeometry=function(t,e,r,i){var a=i.skeletons,o=[],s=e.parents.map(function(p){return t.Objects.Model[p.ID]});if(s.length!==0){var u=e.children.reduce(function(p,A){return a[A.ID]!==void 0&&(p=a[A.ID]),p},null);e.children.forEach(function(p){i.morphTargets[p.ID]!==void 0&&o.push(i.morphTargets[p.ID])});var l=s[0],c={};l.RotationOrder&&(c.eulerOrder=gi(l.RotationOrder.value)),l.InheritType&&(c.inheritType=parseInt(l.InheritType.value)),l.GeometricTranslation&&(c.translation=l.GeometricTranslation.value),l.GeometricRotation&&(c.rotation=l.GeometricRotation.value),l.GeometricScaling&&(c.scale=l.GeometricScaling.value);var d=Sl(c);return this.genGeometry(t,r,u,o,d)}},n.prototype.genGeometry=function(t,e,r,i,a){var o=new f.BufferGeometry;e.attrName&&(o.name=e.attrName);var s=this.parseGeoNode(e,r),u=this.genBuffers(s),l=new f.Float32BufferAttribute(u.vertex,3);if(l.applyMatrix4(a),o.setAttribute("position",l),u.colors.length>0&&o.setAttribute("color",new f.Float32BufferAttribute(u.colors,3)),r&&(o.setAttribute("skinIndex",new f.Uint16BufferAttribute(u.weightsIndices,4)),o.setAttribute("skinWeight",new f.Float32BufferAttribute(u.vertexWeights,4)),o.FBX_Deformer=r),u.normal.length>0){var c=new f.Matrix3().getNormalMatrix(a),d=new f.Float32BufferAttribute(u.normal,3);d.applyNormalMatrix(c),o.setAttribute("normal",d)}if(u.uvs.forEach(function(g,m){var y=m===0?"uv":"uv".concat(m+1);o.setAttribute(y,new f.Float32BufferAttribute(u.uvs[m],2))}),s.material&&s.material.mappingType!=="AllSame"){var p=u.materialIndex[0],A=0;if(u.materialIndex.forEach(function(g,m){g!==p&&(o.addGroup(A,m-A,p),p=g,A=m)}),o.groups.length>0){var h=o.groups[o.groups.length-1],v=h.start+h.count;v!==u.materialIndex.length&&o.addGroup(v,u.materialIndex.length-v,p)}o.groups.length===0&&o.addGroup(0,u.materialIndex.length,u.materialIndex[0])}return this.addMorphTargets(t,o,e,i,a),o},n.prototype.parseGeoNode=function(t,e){var r={};if(r.vertexPositions=t.Vertices!==void 0?t.Vertices.a:[],r.vertexIndices=t.PolygonVertexIndex!==void 0?t.PolygonVertexIndex.a:[],t.LayerElementColor&&(r.color=this.parseVertexColors(t.LayerElementColor[0])),t.LayerElementMaterial&&(r.material=this.parseMaterialIndices(t.LayerElementMaterial[0])),t.LayerElementNormal&&(r.normal=this.parseNormals(t.LayerElementNormal[0])),t.LayerElementUV){r.uv=[];for(var i=0;t.LayerElementUV[i];)t.LayerElementUV[i].UV&&r.uv.push(this.parseUVs(t.LayerElementUV[i])),i++}return r.weightTable={},e!==null&&(r.skeleton=e,e.rawBones.forEach(function(a,o){a.indices.forEach(function(s,u){r.weightTable[s]===void 0&&(r.weightTable[s]=[]),r.weightTable[s].push({id:o,weight:a.weights[u]})})})),r},n.prototype.genBuffers=function(t){var e={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]},r=0,i=0,a=!1,o=[],s=[],u=[],l=[],c=[],d=[],p=this;return t.vertexIndices.forEach(function(A,h){var v=0,g=!1;A<0&&(A=A^-1,g=!0);var m=[],y=[];if(o.push(A*3,A*3+1,A*3+2),t.color){var b=Ui(h,r,A,t.color);u.push(b[0],b[1],b[2])}if(t.skeleton){if(t.weightTable[A]!==void 0&&t.weightTable[A].forEach(function(S){y.push(S.weight),m.push(S.id)}),y.length>4){a||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),a=!0);var x=[0,0,0,0],w=[0,0,0,0];y.forEach(function(S,E){var B=S,R=m[E];w.forEach(function(C,I,L){if(B>C){L[I]=B,B=C;var T=x[I];x[I]=R,R=T}})}),m=x,y=w}for(;y.length<4;)y.push(0),m.push(0);for(var M=0;M<4;++M)c.push(y[M]),d.push(m[M])}if(t.normal){var b=Ui(h,r,A,t.normal);s.push(b[0],b[1],b[2])}t.material&&t.material.mappingType!=="AllSame"&&(v=Ui(h,r,A,t.material)[0],v<0&&(p.negativeMaterialIndices=!0,v=0)),t.uv&&t.uv.forEach(function(S,E){var B=Ui(h,r,A,S);l[E]===void 0&&(l[E]=[]),l[E].push(B[0]),l[E].push(B[1])}),i++,g&&(p.genFace(e,t,o,v,s,u,l,c,d,i),r++,i=0,o=[],s=[],u=[],l=[],c=[],d=[])}),e},n.prototype.getNormalNewell=function(t){for(var e=new f.Vector3(0,0,0),r=0;r<t.length;r++){var i=t[r],a=t[(r+1)%t.length];e.x+=(i.y-a.y)*(i.z+a.z),e.y+=(i.z-a.z)*(i.x+a.x),e.z+=(i.x-a.x)*(i.y+a.y)}return e.normalize(),e},n.prototype.getNormalTangentAndBitangent=function(t){var e=this.getNormalNewell(t),r=Math.abs(e.z)>.5?new f.Vector3(0,1,0):new f.Vector3(0,0,1),i=r.cross(e).normalize(),a=e.clone().cross(i).normalize();return{normal:e,tangent:i,bitangent:a}},n.prototype.flattenVertex=function(t,e,r){return new f.Vector2(t.dot(e),t.dot(r))},n.prototype.genFace=function(t,e,r,i,a,o,s,u,l,c){var d;if(c>3){for(var p=[],A=e.baseVertexPositions||e.vertexPositions,h=0;h<r.length;h+=3)p.push(new f.Vector3(A[r[h]],A[r[h+1]],A[r[h+2]]));for(var v=this.getNormalTangentAndBitangent(p),g=v.tangent,m=v.bitangent,y=[],b=0,x=p;b<x.length;b++){var w=x[b];y.push(this.flattenVertex(w,g,m))}d=f.ShapeUtils.triangulateShape(y,[])}else d=[[0,1,2]];for(var M=function(L,T,F){t.vertex.push(e.vertexPositions[r[L*3]]),t.vertex.push(e.vertexPositions[r[L*3+1]]),t.vertex.push(e.vertexPositions[r[L*3+2]]),t.vertex.push(e.vertexPositions[r[T*3]]),t.vertex.push(e.vertexPositions[r[T*3+1]]),t.vertex.push(e.vertexPositions[r[T*3+2]]),t.vertex.push(e.vertexPositions[r[F*3]]),t.vertex.push(e.vertexPositions[r[F*3+1]]),t.vertex.push(e.vertexPositions[r[F*3+2]]),e.skeleton&&(t.vertexWeights.push(u[L*4]),t.vertexWeights.push(u[L*4+1]),t.vertexWeights.push(u[L*4+2]),t.vertexWeights.push(u[L*4+3]),t.vertexWeights.push(u[T*4]),t.vertexWeights.push(u[T*4+1]),t.vertexWeights.push(u[T*4+2]),t.vertexWeights.push(u[T*4+3]),t.vertexWeights.push(u[F*4]),t.vertexWeights.push(u[F*4+1]),t.vertexWeights.push(u[F*4+2]),t.vertexWeights.push(u[F*4+3]),t.weightsIndices.push(l[L*4]),t.weightsIndices.push(l[L*4+1]),t.weightsIndices.push(l[L*4+2]),t.weightsIndices.push(l[L*4+3]),t.weightsIndices.push(l[T*4]),t.weightsIndices.push(l[T*4+1]),t.weightsIndices.push(l[T*4+2]),t.weightsIndices.push(l[T*4+3]),t.weightsIndices.push(l[F*4]),t.weightsIndices.push(l[F*4+1]),t.weightsIndices.push(l[F*4+2]),t.weightsIndices.push(l[F*4+3])),e.color&&(t.colors.push(o[L*3]),t.colors.push(o[L*3+1]),t.colors.push(o[L*3+2]),t.colors.push(o[T*3]),t.colors.push(o[T*3+1]),t.colors.push(o[T*3+2]),t.colors.push(o[F*3]),t.colors.push(o[F*3+1]),t.colors.push(o[F*3+2])),e.material&&e.material.mappingType!=="AllSame"&&(t.materialIndex.push(i),t.materialIndex.push(i),t.materialIndex.push(i)),e.normal&&(t.normal.push(a[L*3]),t.normal.push(a[L*3+1]),t.normal.push(a[L*3+2]),t.normal.push(a[T*3]),t.normal.push(a[T*3+1]),t.normal.push(a[T*3+2]),t.normal.push(a[F*3]),t.normal.push(a[F*3+1]),t.normal.push(a[F*3+2])),e.uv&&e.uv.forEach(function(D,V){t.uvs[V]===void 0&&(t.uvs[V]=[]),t.uvs[V].push(s[V][L*2]),t.uvs[V].push(s[V][L*2+1]),t.uvs[V].push(s[V][T*2]),t.uvs[V].push(s[V][T*2+1]),t.uvs[V].push(s[V][F*2]),t.uvs[V].push(s[V][F*2+1])})},S=0,E=d;S<E.length;S++){var B=E[S],R=B[0],C=B[1],I=B[2];M(R,C,I)}},n.prototype.addMorphTargets=function(t,e,r,i,a){if(i.length!==0){e.morphTargetsRelative=!0,e.morphAttributes.position=[];var o=this;i.forEach(function(s){s.rawTargets.forEach(function(u){var l=t.Objects.Geometry[u.geoID];l!==void 0&&o.genMorphGeometry(e,r,l,a,u.name)})})}},n.prototype.genMorphGeometry=function(t,e,r,i,a){for(var o=e.Vertices!==void 0?e.Vertices.a:[],s=e.PolygonVertexIndex!==void 0?e.PolygonVertexIndex.a:[],u=r.Vertices!==void 0?r.Vertices.a:[],l=r.Indexes?r.Indexes.a:[],c=t.attributes.position.count*3,d=new Float32Array(c),p=0;p<l.length;p++){var A=l[p]*3;d[A]=u[p*3],d[A+1]=u[p*3+1],d[A+2]=u[p*3+2]}var h={vertexIndices:s,vertexPositions:d,baseVertexPositions:o},v=this.genBuffers(h),g=new f.Float32BufferAttribute(v.vertex,3);g.name=a||r.attrName,g.applyMatrix4(i),t.morphAttributes.position.push(g)},n.prototype.parseNormals=function(t){var e=t.MappingInformationType,r=t.ReferenceInformationType,i=t.Normals.a,a=[];return r==="IndexToDirect"&&(t.NormalIndex?a=t.NormalIndex.a:t.NormalsIndex&&(a=t.NormalsIndex.a)),{dataSize:3,buffer:i,indices:a,mappingType:e,referenceType:r}},n.prototype.parseUVs=function(t){var e=t.MappingInformationType,r=t.ReferenceInformationType,i=t.UV.a,a=[];return r==="IndexToDirect"&&(a=t.UVIndex.a),{dataSize:2,buffer:i,indices:a,mappingType:e,referenceType:r}},n.prototype.parseVertexColors=function(t){var e=t.MappingInformationType,r=t.ReferenceInformationType,i=t.Colors.a,a=[];r==="IndexToDirect"&&(a=t.ColorIndex.a);for(var o=0,s=new f.Color;o<i.length;o+=4)s.fromArray(i,o),s.toArray(i,o);return{dataSize:4,buffer:i,indices:a,mappingType:e,referenceType:r}},n.prototype.parseMaterialIndices=function(t){var e=t.MappingInformationType,r=t.ReferenceInformationType;if(e==="NoMappingInformation")return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:r};for(var i=t.Materials.a,a=[],o=0;o<i.length;++o)a.push(o);return{dataSize:1,buffer:i,indices:a,mappingType:e,referenceType:r}},n.prototype.parseNurbsGeometry=function(t){var e=parseInt(t.Order);if(isNaN(e))return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s",t.Order,t.id),new f.BufferGeometry;for(var r=e-1,i=t.KnotVector.a,a=[],o=t.Points.a,s=0,u=o.length;s<u;s+=4)a.push(new f.Vector4().fromArray(o,s));var l,c;if(t.Form==="Closed")a.push(a[0]);else if(t.Form==="Periodic"){l=r,c=i.length-1-l;for(var s=0;s<r;++s)a.push(a[s])}var d=new iv(r,i,a,l,c),p=d.getPoints(a.length*12);return new f.BufferGeometry().setFromPoints(p)},n}(),Xp=function(){function n(){}return n.prototype.parse=function(t,e,r){var i=[],a=this.parseClips(t,e,r);if(a!==void 0)for(var o in a){var s=a[o],u=this.addClip(s,r);i.push(u)}return i},n.prototype.parseClips=function(t,e,r){if(t.Objects.AnimationCurve!==void 0){var i=this.parseAnimationCurveNodes(t);this.parseAnimationCurves(t,i,e);var a=this.parseAnimationLayers(t,i,e,r),o=this.parseAnimStacks(t,a,e);return o}},n.prototype.parseAnimationCurveNodes=function(t){var e=t.Objects.AnimationCurveNode,r=new Map;for(var i in e){var a=e[i];if(a.attrName.match(/S|R|T|DeformPercent/)!==null){var o={id:a.id,attr:a.attrName,curves:{}};r.set(o.id,o)}}return r},n.prototype.parseAnimationCurves=function(t,e,r){var i=t.Objects.AnimationCurve;for(var a in i){var o={id:i[a].id,times:i[a].KeyTime.a.map(ev),values:i[a].KeyValueFloat.a},s=r.get(o.id);if(s!==void 0){var u=s.parents[0].ID,l=s.parents[0].relationship,c=e.get(u);c&&(l.match(/X/)?c.curves.x=o:l.match(/Y/)?c.curves.y=o:l.match(/Z/)?c.curves.z=o:l.match(/DeformPercent/)&&e.has(u)&&(c.curves.morph=o))}}},n.prototype.parseAnimationLayers=function(t,e,r,i){var a=t.Objects.AnimationLayer,o=new Map,s=function(l){var c=[],d=r.get(parseInt(l));if(d!==void 0){var p=d.children;p.forEach(function(A,h){if(e.has(A.ID)){var v=e.get(A.ID);if(v.curves.x!==void 0||v.curves.y!==void 0||v.curves.z!==void 0){if(c[h]===void 0){var g=r.get(A.ID).parents.filter(function(E){return E.relationship!==void 0})[0].ID;if(g!==void 0){var m=t.Objects.Model[g.toString()];if(m===void 0){console.warn("THREE.FBXLoader: Encountered a unused curve.",A);return}var y={modelName:m.attrName?f.PropertyBinding.sanitizeNodeName(m.attrName):"",ID:m.id,initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1],transform:new f.Matrix4,eulerOrder:"",preRotation:[0,0,0],postRotation:[0,0,0]};i.traverse(function(E){E.ID===m.id&&(y.transform=E.matrix,E.userData.transformData&&(y.eulerOrder=E.userData.transformData.eulerOrder))}),y.transform||(y.transform=new f.Matrix4),m.PreRotation&&(y.preRotation=m.PreRotation.value),m.PostRotation&&(y.postRotation=m.PostRotation.value),c[h]=y}}c[h]&&(c[h][v.attr]=v)}else if(v.curves.morph!==void 0){if(c[h]===void 0){var b=r.get(A.ID).parents.filter(function(B){return B.relationship!==void 0})[0].ID,x=r.get(b).parents[0].ID,w=r.get(x).parents[0].ID,g=r.get(w).parents[0].ID,M=t.Objects.Model[g],S={modelName:M.attrName?f.PropertyBinding.sanitizeNodeName(M.attrName):"",morphName:t.Objects.Deformer[b].attrName};c[h]=S}c[h][v.attr]=v}}}),o.set(parseInt(l),c)}};for(var u in a)s(u);return o},n.prototype.parseAnimStacks=function(t,e,r){var i=t.Objects.AnimationStack,a={};for(var o in i){var s=r.get(parseInt(o)).children;s.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");var u=e.get(s[0].ID);a[o]={name:i[o].attrName,layer:u}}return a},n.prototype.addClip=function(t,e){var r=[],i=this;return t.layer.forEach(function(a){r=r.concat(i.generateTracks(a,e))}),new f.AnimationClip(t.name,-1,r)},n.prototype.generateTracks=function(t,e){var r=[],i=new f.Vector3,a=new f.Vector3;t.transform&&t.transform.decompose(i,new f.Quaternion,a);var o=i.toArray(),s=a.toArray();if(t.T!==void 0&&Object.keys(t.T.curves).length>0){var u=this.generateVectorTrack(t.modelName,t.T.curves,o,"position");u!==void 0&&r.push(u)}if(t.R!==void 0&&Object.keys(t.R.curves).length>0){var l=this.generateRotationTrack(t.modelName,t.R.curves,t.preRotation,t.postRotation,t.eulerOrder);l!==void 0&&r.push(l)}if(t.S!==void 0&&Object.keys(t.S.curves).length>0){var c=this.generateVectorTrack(t.modelName,t.S.curves,s,"scale");c!==void 0&&r.push(c)}if(t.DeformPercent!==void 0){var d=this.generateMorphTrack(t,e);d!==void 0&&r.push(d)}return r},n.prototype.generateVectorTrack=function(t,e,r,i){var a=this.getTimesForAllAxes(e),o=this.getKeyframeTrackValues(a,e,r);return new f.VectorKeyframeTrack(t+"."+i,a,o)},n.prototype.generateRotationTrack=function(t,e,r,i,a){var o,s;if(e.x!==void 0&&e.y!==void 0&&e.z!==void 0){var u=this.interpolateRotations(e.x,e.y,e.z,a);o=u[0],s=u[1]}var l=gi(0),c=new f.Quaternion,d=new f.Quaternion;r!==void 0&&(r=r.map(f.MathUtils.degToRad),r.push(l),c.setFromEuler(new f.Euler().fromArray(r))),i!==void 0&&(i=i.map(f.MathUtils.degToRad),i.push(l),d.setFromEuler(new f.Euler().fromArray(i)),d.inverse());var p=new f.Quaternion,A=new f.Euler,h=[];if(!s||!o)return new f.QuaternionKeyframeTrack(t+".quaternion",[0],[0]);for(var v=0;v<s.length;v+=3){if(A.set(s[v],s[v+1],s[v+2],a),p.setFromEuler(A),p.premultiply(c),p.multiply(d),v>2){var g=new f.Quaternion().fromArray(h,(v-3)/3*4);g.dot(p)<0&&p.set(-p.x,-p.y,-p.z,-p.w)}p.toArray(h,v/3*4)}return new f.QuaternionKeyframeTrack(t+".quaternion",o,h)},n.prototype.generateMorphTrack=function(t,e){var r=t.DeformPercent.curves.morph,i=r.values.map(function(o){return o/100}),a=e.getObjectByName(t.modelName).morphTargetDictionary[t.morphName];return new f.NumberKeyframeTrack(t.modelName+".morphTargetInfluences["+a+"]",r.times,i)},n.prototype.getTimesForAllAxes=function(t){var e=[];if(t.x!==void 0&&(e=e.concat(t.x.times)),t.y!==void 0&&(e=e.concat(t.y.times)),t.z!==void 0&&(e=e.concat(t.z.times)),e=e.sort(function(s,u){return s-u}),e.length>1){for(var r=1,i=e[0],a=1;a<e.length;a++){var o=e[a];o!==i&&(e[r]=o,i=o,r++)}e=e.slice(0,r)}return e},n.prototype.getKeyframeTrackValues=function(t,e,r){var i=r,a=[],o=-1,s=-1,u=-1;return t.forEach(function(l){if(e.x&&(o=e.x.times.indexOf(l)),e.y&&(s=e.y.times.indexOf(l)),e.z&&(u=e.z.times.indexOf(l)),o!==-1){var c=e.x.values[o];a.push(c),i[0]=c}else a.push(i[0]);if(s!==-1){var d=e.y.values[s];a.push(d),i[1]=d}else a.push(i[1]);if(u!==-1){var p=e.z.values[u];a.push(p),i[2]=p}else a.push(i[2])}),a},n.prototype.interpolateRotations=function(t,e,r,i){var a=[],o=[];a.push(t.times[0]),o.push(f.MathUtils.degToRad(t.values[0])),o.push(f.MathUtils.degToRad(e.values[0])),o.push(f.MathUtils.degToRad(r.values[0]));for(var s=1;s<t.values.length;s++){var u=[t.values[s-1],e.values[s-1],r.values[s-1]];if(!(isNaN(u[0])||isNaN(u[1])||isNaN(u[2]))){var l=u.map(f.MathUtils.degToRad),c=[t.values[s],e.values[s],r.values[s]];if(!(isNaN(c[0])||isNaN(c[1])||isNaN(c[2]))){c.map(f.MathUtils.degToRad);var d=[c[0]-u[0],c[1]-u[1],c[2]-u[2]],p=[Math.abs(d[0]),Math.abs(d[1]),Math.abs(d[2])];if(p[0]>=180||p[1]>=180||p[2]>=180){var A=Math.max.apply(Math,p),h=A/180,v=new f.Euler(l[0],l[1],l[2],i),g=new f.Euler(l[0],l[1],l[2],i),m=new f.Quaternion().setFromEuler(v),y=new f.Quaternion().setFromEuler(g);m.dot(y)&&y.set(-y.x,-y.y,-y.z,-y.w);for(var b=t.times[s-1],x=t.times[s]-b,w=new f.Quaternion,M=new f.Euler,S=0;S<1;S+=1/h)w.copy(m.clone().slerp(y.clone(),S)),a.push(b+S*x),M.setFromQuaternion(w,i),o.push(M.x),o.push(M.y),o.push(M.z)}else a.push(t.times[s]),o.push(f.MathUtils.degToRad(t.values[s])),o.push(f.MathUtils.degToRad(e.values[s])),o.push(f.MathUtils.degToRad(r.values[s]))}}}return[a,o]},n}(),Wp=function(){function n(){this.allNodes=new Po,this.nodeStack=[],this.currentIndent=0,this.currentPropName=""}return n.prototype.getPrevNode=function(){return this.nodeStack[this.currentIndent-2]},n.prototype.getCurrentNode=function(){return this.nodeStack[this.currentIndent-1]},n.prototype.getCurrentProp=function(){return this.currentProp},n.prototype.pushStack=function(t){this.nodeStack.push(t),this.currentIndent+=1},n.prototype.popStack=function(){this.nodeStack.pop(),this.currentIndent-=1},n.prototype.setCurrentProp=function(t,e){this.currentProp=t,this.currentPropName=e},n.prototype.parse=function(t){this.currentIndent=0,this.allNodes=new Po,this.nodeStack=[],this.currentProp=[],this.currentPropName="";var e=this,r=t.split(/[\r\n]+/);return r.forEach(function(i,a){var o=i.match(/^[\s\t]*;/),s=i.match(/^[\s\t]*$/);if(!(o||s)){var u=i.match("^\\t{"+e.currentIndent+"}(\\w+):(.*){"),l=i.match("^\\t{"+e.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),c=i.match("^\\t{"+(e.currentIndent-1)+"}}");u?e.parseNodeBegin(i,u):l?e.parseNodeProperty(i,l,r[++a]):c?e.popStack():i.match(/^[^\s\t}]/)&&e.parseNodePropertyContinued(i)}}),this.allNodes},n.prototype.parseNodeBegin=function(t,e){var r=e[1].trim().replace(/^"/,"").replace(/"$/,""),i=e[2].split(",").map(function(u){return u.trim().replace(/^"/,"").replace(/"$/,"")}),a={name:r},o=this.parseNodeAttr(i),s=this.getCurrentNode();this.currentIndent===0?this.allNodes.add(r,a):r in s?(r==="PoseNode"?s.PoseNode.push(a):s[r].id!==void 0&&(s[r]={},s[r][s[r].id]=s[r]),o.id!==""&&(s[r][o.id]=a)):typeof o.id=="number"?(s[r]={},s[r][o.id]=a):r!=="Properties70"&&(r==="PoseNode"?s[r]=[a]:s[r]=a),typeof o.id=="number"&&(a.id=o.id),o.name!==""&&(a.attrName=o.name),o.type!==""&&(a.attrType=o.type),this.pushStack(a)},n.prototype.parseNodeAttr=function(t){var e=t[0];t[0]!==""&&(e=parseInt(t[0]),isNaN(e)&&(e=t[0]));var r="",i="";return t.length>1&&(r=t[1].replace(/^(\w+)::/,""),i=t[2]),{id:e,name:r,type:i}},n.prototype.parseNodeProperty=function(t,e,r){var i=e[1].replace(/^"/,"").replace(/"$/,"").trim(),a=e[2].replace(/^"/,"").replace(/"$/,"").trim();i==="Content"&&a===","&&(a=r.replace(/"/g,"").replace(/,$/,"").trim());var o=this.getCurrentNode(),s=o.name;if(s==="Properties70"){this.parseNodeSpecialProperty(t,i,a);return}if(i==="C"){var u=a.split(",").slice(1),l=parseInt(u[0]),c=parseInt(u[1]),d=a.split(",").slice(3);d=d.map(function(p){return p.trim().replace(/^"/,"")}),i="connections",a=[l,c],rv(a,d),o[i]===void 0&&(o[i]=[])}i==="Node"&&(o.id=a),i in o&&Array.isArray(o[i])?o[i].push(a):i!=="a"?o[i]=a:o.a=a,this.setCurrentProp(o,i),i==="a"&&a.slice(-1)!==","&&(o.a=$a(a))},n.prototype.parseNodePropertyContinued=function(t){var e=this.getCurrentNode();e.a+=t,t.slice(-1)!==","&&(e.a=$a(e.a))},n.prototype.parseNodeSpecialProperty=function(t,e,r){var i=r.split('",').map(function(c){return c.trim().replace(/^\"/,"").replace(/\s/,"_")}),a=i[0],o=i[1],s=i[2],u=i[3],l=i[4];switch(o){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":l=parseFloat(l);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":l=$a(l);break}this.getPrevNode()[a]={type:o,type2:s,flag:u,value:l},this.setCurrentProp(this.getPrevNode(),a)},n}(),Zp=function(){function n(){}return n.prototype.parse=function(t){var e=new l0(t);e.skip(23);var r=e.getUint32();if(r<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+r);for(var i=new Po;!this.endOfContent(e);){var a=this.parseNode(e,r);a!==null&&i.add(a.name,a)}return i},n.prototype.endOfContent=function(t){return t.size()%16===0?(t.getOffset()+160+16&-16)>=t.size():t.getOffset()+160+16>=t.size()},n.prototype.parseNode=function(t,e){var r={},i=e>=7500?t.getUint64():t.getUint32(),a=e>=7500?t.getUint64():t.getUint32();e>=7500?t.getUint64():t.getUint32();var o=t.getUint8(),s=t.getString(o);if(i===0)return null;for(var u=[],l=0;l<a;l++)u.push(this.parseProperty(t));var c=u.length>0?u[0]:"",d=u.length>1?u[1]:"",p=u.length>2?u[2]:"";for(r.singleProperty=a===1&&t.getOffset()===i;i>t.getOffset();){var A=this.parseNode(t,e);A!==null&&this.parseSubNode(s,r,A)}return r.propertyList=u,typeof c=="number"&&(r.id=c),d!==""&&(r.attrName=d),p!==""&&(r.attrType=p),s!==""&&(r.name=s),r},n.prototype.parseSubNode=function(t,e,r){if(r.singleProperty===!0){var i=r.propertyList[0];Array.isArray(i)?(e[r.name]=r,r.a=i):e[r.name]=i}else if(t==="Connections"&&r.name==="C"){var a=[];r.propertyList.forEach(function(p,A){A!==0&&a.push(p)}),e.connections===void 0&&(e.connections=[]),e.connections.push(a)}else if(r.name==="Properties70"){var o=Object.keys(r);o.forEach(function(p){e[p]=r[p]})}else if(t==="Properties70"&&r.name==="P"){var s=r.propertyList[0],u=r.propertyList[1],l=r.propertyList[2],c=r.propertyList[3],d=void 0;s.indexOf("Lcl ")===0&&(s=s.replace("Lcl ","Lcl_")),u.indexOf("Lcl ")===0&&(u=u.replace("Lcl ","Lcl_")),u==="Color"||u==="ColorRGB"||u==="Vector"||u==="Vector3D"||u.indexOf("Lcl_")===0?d=[r.propertyList[4],r.propertyList[5],r.propertyList[6]]:d=r.propertyList[4],e[s]={type:u,type2:l,flag:c,value:d}}else e[r.name]===void 0?typeof r.id=="number"?(e[r.name]={},e[r.name][r.id]=r):e[r.name]=r:r.name==="PoseNode"?(Array.isArray(e[r.name])||(e[r.name]=[e[r.name]]),e[r.name].push(r)):e[r.name][r.id]===void 0&&(e[r.name][r.id]=r)},n.prototype.parseProperty=function(t){var e=t.getString(1),r;switch(e){case"C":return t.getBoolean();case"D":return t.getFloat64();case"F":return t.getFloat32();case"I":return t.getInt32();case"L":return t.getInt64();case"R":return r=t.getUint32(),t.getArrayBuffer(r);case"S":return r=t.getUint32(),t.getString(r);case"Y":return t.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":var i=t.getUint32(),a=t.getUint32(),o=t.getUint32();if(a===0)switch(e){case"b":case"c":return t.getBooleanArray(i);case"d":return t.getFloat64Array(i);case"f":return t.getFloat32Array(i);case"i":return t.getInt32Array(i);case"l":return t.getInt64Array(i)}var s=Vp(new Uint8Array(t.getArrayBuffer(o))),u=new l0(s.buffer);switch(e){case"b":case"c":return u.getBooleanArray(i);case"d":return u.getFloat64Array(i);case"f":return u.getFloat32Array(i);case"i":return u.getInt32Array(i);case"l":return u.getInt64Array(i)}break;default:throw new Error("THREE.FBXLoader: Unknown property type "+e)}},n}(),l0=function(){function n(t,e){this.dv=new DataView(t),this.offset=0,this.littleEndian=e!==void 0?e:!0,this._textDecoder=new TextDecoder}return n.prototype.getOffset=function(){return this.offset},n.prototype.size=function(){return this.dv.buffer.byteLength},n.prototype.skip=function(t){this.offset+=t},n.prototype.getBoolean=function(){return(this.getUint8()&1)===1},n.prototype.getBooleanArray=function(t){for(var e=[],r=0;r<t;r++)e.push(this.getBoolean());return e},n.prototype.getUint8=function(){var t=this.dv.getUint8(this.offset);return this.offset+=1,t},n.prototype.getInt16=function(){var t=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,t},n.prototype.getInt32=function(){var t=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,t},n.prototype.getInt32Array=function(t){for(var e=[],r=0;r<t;r++)e.push(this.getInt32());return e},n.prototype.getUint32=function(){var t=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,t},n.prototype.getInt64=function(){var t,e;return this.littleEndian?(t=this.getUint32(),e=this.getUint32()):(e=this.getUint32(),t=this.getUint32()),e&2147483648?(e=~e&4294967295,t=~t&4294967295,t===4294967295&&(e=e+1&4294967295),t=t+1&4294967295,-(e*4294967296+t)):e*4294967296+t},n.prototype.getInt64Array=function(t){for(var e=[],r=0;r<t;r++)e.push(this.getInt64());return e},n.prototype.getUint64=function(){var t,e;return this.littleEndian?(t=this.getUint32(),e=this.getUint32()):(e=this.getUint32(),t=this.getUint32()),e*4294967296+t},n.prototype.getFloat32=function(){var t=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t},n.prototype.getFloat32Array=function(t){for(var e=[],r=0;r<t;r++)e.push(this.getFloat32());return e},n.prototype.getFloat64=function(){var t=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t},n.prototype.getFloat64Array=function(t){for(var e=[],r=0;r<t;r++)e.push(this.getFloat64());return e},n.prototype.getArrayBuffer=function(t){var e=this.dv.buffer.slice(this.offset,this.offset+t);return this.offset+=t,e},n.prototype.getString=function(t){var e=this.offset,r=new Uint8Array(this.dv.buffer,e,t);this.skip(t);var i=r.indexOf(0);return i>=0&&(r=new Uint8Array(this.dv.buffer,e,i)),this._textDecoder.decode(r)},n}(),Po=function(){function n(){this.Connections={connections:[]},this.Objects={Model:{},NodeAttribute:{},Geometry:{}},this.GlobalSettings={}}return n.prototype.add=function(t,e){this[t]=e},n}();function Yp(n){var t="Kaydara FBX Binary \0";return n.byteLength>=t.length&&t===Cl(n,0,t.length)}function $p(n){var t=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"],e=0;function r(o){var s=n[o-1];return n=n.slice(e+o),e++,s}for(var i=0;i<t.length;++i){var a=r(1);if(a===t[i])return!1}return!0}function c0(n){var t=/FBXVersion: (\d+)/,e=n.match(t);if(e){var r=parseInt(e[1]);return r}throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function ev(n){return n/46186158e3}var tv=[];function Ui(n,t,e,r){var i;switch(r.mappingType){case"ByPolygonVertex":i=n;break;case"ByPolygon":i=t;break;case"ByVertice":i=e;break;case"AllSame":i=r.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+r.mappingType),i=0}r.referenceType==="IndexToDirect"&&(i=r.indices[i]);var a=i*r.dataSize,o=a+r.dataSize;return nv(tv,r.buffer,a,o)}var Ya=new f.Euler,Vn=new f.Vector3;function Sl(n){var t=new f.Matrix4,e=new f.Matrix4,r=new f.Matrix4,i=new f.Matrix4,a=new f.Matrix4,o=new f.Matrix4,s=new f.Matrix4,u=new f.Matrix4,l=new f.Matrix4,c=new f.Matrix4,d=new f.Matrix4,p=new f.Matrix4,A=n.inheritType?n.inheritType:0;n.translation&&t.setPosition(Vn.fromArray(n.translation));var h=gi(0);if(n.preRotation){var v=n.preRotation.map(f.MathUtils.degToRad);v.push(h),e.makeRotationFromEuler(Ya.fromArray(v))}if(n.rotation){var v=n.rotation.map(f.MathUtils.degToRad);v.push(n.eulerOrder||h),r.makeRotationFromEuler(Ya.fromArray(v))}if(n.postRotation){var v=n.postRotation.map(f.MathUtils.degToRad);v.push(h),i.makeRotationFromEuler(Ya.fromArray(v)),i.copy(new f.Matrix4().getInverse(i))}n.scale&&a.scale(Vn.fromArray(n.scale)),n.scalingOffset&&s.setPosition(Vn.fromArray(n.scalingOffset)),n.scalingPivot&&o.setPosition(Vn.fromArray(n.scalingPivot)),n.rotationOffset&&u.setPosition(Vn.fromArray(n.rotationOffset)),n.rotationPivot&&l.setPosition(Vn.fromArray(n.rotationPivot)),n.parentMatrixWorld&&(d.copy(n.parentMatrix),c.copy(n.parentMatrixWorld));var g=e.clone().multiply(r).multiply(i),m=new f.Matrix4;m.extractRotation(c);var y=new f.Matrix4;y.copyPosition(c);var b=new f.Matrix4().getInverse(y).multiply(c),x=new f.Matrix4().getInverse(m).multiply(b),w=a,M=new f.Matrix4;if(A===0)M.copy(m).multiply(g).multiply(x).multiply(w);else if(A===1)M.copy(m).multiply(x).multiply(g).multiply(w);else{var S=new f.Matrix4().scale(new f.Vector3().setFromMatrixScale(d)),E=new f.Matrix4().getInverse(S),B=x.clone().multiply(E);M.copy(m).multiply(g).multiply(B).multiply(w)}var R=new f.Matrix4().getInverse(l),C=new f.Matrix4().getInverse(o),I=t.clone().multiply(u).multiply(l).multiply(e).multiply(r).multiply(i).multiply(R).multiply(s).multiply(o).multiply(a).multiply(C),L=new f.Matrix4().copyPosition(I),T=c.clone().multiply(L);return p.copyPosition(T),I=p.clone().multiply(M),I.premultiply(new f.Matrix4().getInverse(c)),I}function gi(n){n=n||0;var t=["ZYX","YZX","XZY","ZXY","YXZ","XYZ"];return n===6?(console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."),t[0]):t[n]}function $a(n){var t=n.split(",").map(function(e){return parseFloat(e)});return t}function Cl(n,t,e){return t===void 0&&(t=0),e===void 0&&(e=n.byteLength),new TextDecoder().decode(new Uint8Array(n,t,e))}function rv(n,t){for(var e=0,r=n.length,i=t.length;e<i;e++,r++)n[r]=t[e]}function nv(n,t,e,r){for(var i=e,a=0;i<r;i++,a++)n[a]=t[i];return n}var iv=function(n){ue(t,n);function t(e,r,i,a,o){var s=n.call(this)||this,u=r?r.length-1:0,l=i?i.length:0;s.degree=e,s.knots=r,s.controlPoints=[],s.startKnot=a||0,s.endKnot=o||u;for(var c=0;c<l;++c){var d=i[c];s.controlPoints[c]=new f.Vector4(d.x,d.y,d.z,d.w)}return s}return t.prototype.getPoint=function(e,r){r===void 0&&(r=new f.Vector3);var i=r,a=this.knots[this.startKnot]+e*(this.knots[this.endKnot]-this.knots[this.startKnot]),o=ov(this.degree,this.knots,this.controlPoints,a);return o.w!==1&&o.divideScalar(o.w),i.set(o.x,o.y,o.z)},t.prototype.getTangent=function(e,r){r===void 0&&(r=new f.Vector3);var i=r,a=this.knots[0]+e*(this.knots[this.knots.length-1]-this.knots[0]),o=fv(this.degree,this.knots,this.controlPoints,a,1);return i.copy(o[1]).normalize(),i},t.prototype.toJSON=function(){var e=n.prototype.toJSON.call(this);return e.degree=this.degree,e.knots=vt([],this.knots,!0),e.controlPoints=this.controlPoints.map(function(r){return r.toArray()}),e.startKnot=this.startKnot,e.endKnot=this.endKnot,e},t.prototype.fromJSON=function(e){return n.prototype.fromJSON.call(this,e),this.degree=e.degree,this.knots=vt([],e.knots,!0),this.controlPoints=e.controlPoints.map(function(r){return new f.Vector4(r[0],r[1],r[2],r[3])}),this.startKnot=e.startKnot,this.endKnot=e.endKnot,this},t}(f.Curve);function El(n,t,e){var r=e.length-n-1;if(t>=e[r])return r-1;if(t<=e[n])return n;for(var i=n,a=r,o=Math.floor((i+a)/2);t<e[o]||t>=e[o+1];)t<e[o]?a=o:i=o,o=Math.floor((i+a)/2);return o}function av(n,t,e,r){var i=[],a=[],o=[];i[0]=1;for(var s=1;s<=e;++s){a[s]=t-r[n+1-s],o[s]=r[n+s]-t;for(var u=0,l=0;l<s;++l){var c=o[l+1],d=a[s-l],p=i[l]/(c+d);i[l]=u+c*p,u=d*p}i[s]=u}return i}function ov(n,t,e,r){for(var i=El(n,r,t),a=av(i,r,n,t),o=new f.Vector4(0,0,0,0),s=0;s<=n;++s){var u=e[i-n+s],l=a[s],c=u.w*l;o.x+=u.x*c,o.y+=u.y*c,o.z+=u.z*c,o.w+=u.w*l}return o}function sv(n,t,e,r,i){for(var a=[],o=0;o<=e;++o)a[o]=0;for(var s=[],o=0;o<=r;++o)s[o]=a.slice(0);for(var u=[],o=0;o<=e;++o)u[o]=a.slice(0);u[0][0]=1;for(var l=a.slice(0),c=a.slice(0),d=1;d<=e;++d){l[d]=t-i[n+1-d],c[d]=i[n+d]-t;for(var p=0,A=0;A<d;++A){var h=c[A+1],v=l[d-A];u[d][A]=h+v;var g=u[A][d-1]/u[d][A];u[A][d]=p+h*g,p=v*g}u[d][d]=p}for(var d=0;d<=e;++d)s[0][d]=u[d][e];for(var m=0;m<=e;++m){for(var y=0,b=1,x=[],o=0;o<=e;++o)x[o]=a.slice(0);x[0][0]=1;for(var w=1;w<=r;++w){var M=0,S=m-w,E=e-w;m>=w&&(x[b][0]=x[y][0]/u[E+1][S],M=x[b][0]*u[S][E]);for(var B=S>=-1?1:-S,R=m-1<=E?w-1:e-m,C=B;C<=R;++C)x[b][C]=(x[y][C]-x[y][C-1])/u[E+1][S+C],M+=x[b][C]*u[S+C][E];m<=E&&(x[b][w]=-x[y][w-1]/u[E+1][m],M+=x[b][w]*u[m][E]),s[w][m]=M;var d=y;y=b,b=d}}for(var I=e,w=1;w<=r;++w){for(var d=0;d<=e;++d)s[w][d]*=I;I*=e-w}return s}function uv(n,t,e,r,i){for(var a=i<n?i:n,o=[],s=El(n,r,t),u=sv(s,r,n,a,t),l=[],c=0;c<e.length;++c){var d=e[c].clone(),p=d.w;d.x*=p,d.y*=p,d.z*=p,l[c]=d}for(var A=0;A<=a;++A){for(var d=l[s-n].clone().multiplyScalar(u[A][0]),h=1;h<=n;++h)d.add(l[s-n+h].clone().multiplyScalar(u[A][h]));o[A]=d}for(var A=a+1;A<=i+1;++A)o[A]=new f.Vector4(0,0,0);return o}function lv(n,t){for(var e=1,r=2;r<=n;++r)e*=r;for(var i=1,r=2;r<=t;++r)i*=r;for(var r=2;r<=n-t;++r)i*=r;return e/i}function cv(n){for(var t=n.length,e=[],r=[],i=0;i<t;++i){var a=n[i];e[i]=new f.Vector3(a.x,a.y,a.z),r[i]=a.w}for(var o=[],s=0;s<t;++s){for(var u=e[s].clone(),i=1;i<=s;++i)u.sub(o[s-i].clone().multiplyScalar(lv(s,i)*r[i]));o[s]=u.divideScalar(r[0])}return o}function fv(n,t,e,r,i){var a=uv(n,t,e,r,i);return cv(a)}var Nn=new f.Vector3;function dv(n,t){switch(t){case"D":return new Float64Array(n);case"F":return new Float32Array(n);case"L":return new Int32Array(n);case"I":return new Int16Array(n);default:return new Uint8Array(n)}}function Il(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new qt({allowHosts:["*"]}),i={byteLength:0};return Promise.resolve().then(function(){return r.ajax(n,{responseType:"arraybuffer"})}).then(function(a){var o;return i.byteLength=a.body.byteLength,hv(new Uint8Array(a.body),{materialType:t.materialType,color:t.color,resourcePath:n.slice(0,n.lastIndexOf("/")+1),search:(o=n.split("?")[1])!==null&&o!==void 0?o:"",fetcher:r})}).then(function(a){var o=new f.Group;return o.matrixAutoUpdate=!1,o.matrix.compose(o.position,o.quaternion,o.scale),o.name=n,o.add(a.object),{type:"x3p",upAxis:"Z",uri:n,byteLength:i.byteLength,scene:o,textures:[],dispose:function(){return a.dispose()}}})}function hv(n,t){for(var e,r,i,a,o,s,u,l,c,d,p,A,h,v,g,m,y,b,x,w,M,S,E,B,R,C,I,L,T,F,D,V,z,U,q,G,K,j,J,W,$,Y,Z,oe,ne,de,se,ye,ie,xe,Le,Ce,Oe,ee,re,H=Gp(n),Be="",Te=null,Ee=0,Qe=Object.keys(H);Ee<Qe.length;Ee++){var Ie=Qe[Ee];/(^|\/)main\.xml$/i.test(Ie)&&(Te=H[Ie],Be=Ie.slice(0,Ie.lastIndexOf("/")+1))}if(!Te)throw new Error("X3p: main.xml not found.");if(typeof DOMParser=="undefined")throw new Error("X3p: DOMParser not found.");var we=(e=t.materialType)!==null&&e!==void 0?e:"phong",be=(r=t.color)!==null&&r!==void 0?r:new f.Color(10066329),Ae=new DOMParser,me=aa(Te),ze=Ae.parseFromString(me,"text/xml"),pe=ze.querySelector("Record1 Axes"),Se={x:{type:(o=(a=(i=pe==null?void 0:pe.querySelector("CX AxisType"))===null||i===void 0?void 0:i.textContent)===null||a===void 0?void 0:a.toUpperCase())!==null&&o!==void 0?o:"I",dataType:(l=(u=(s=pe==null?void 0:pe.querySelector("CX DataType"))===null||s===void 0?void 0:s.textContent)===null||u===void 0?void 0:u.toUpperCase())!==null&&l!==void 0?l:"D",increment:Number((d=(c=pe==null?void 0:pe.querySelector("CX Increment"))===null||c===void 0?void 0:c.textContent)!==null&&d!==void 0?d:"1"),offset:Number((A=(p=pe==null?void 0:pe.querySelector("CX Offset"))===null||p===void 0?void 0:p.textContent)!==null&&A!==void 0?A:"0")},y:{type:(g=(v=(h=pe==null?void 0:pe.querySelector("CY AxisType"))===null||h===void 0?void 0:h.textContent)===null||v===void 0?void 0:v.toUpperCase())!==null&&g!==void 0?g:"I",dataType:(b=(y=(m=pe==null?void 0:pe.querySelector("CY DataType"))===null||m===void 0?void 0:m.textContent)===null||y===void 0?void 0:y.toUpperCase())!==null&&b!==void 0?b:"D",increment:Number((w=(x=pe==null?void 0:pe.querySelector("CY Increment"))===null||x===void 0?void 0:x.textContent)!==null&&w!==void 0?w:"1"),offset:Number((S=(M=pe==null?void 0:pe.querySelector("CY Offset"))===null||M===void 0?void 0:M.textContent)!==null&&S!==void 0?S:"0")},z:{type:(R=(B=(E=pe==null?void 0:pe.querySelector("CZ AxisType"))===null||E===void 0?void 0:E.textContent)===null||B===void 0?void 0:B.toUpperCase())!==null&&R!==void 0?R:"A",dataType:(L=(I=(C=pe==null?void 0:pe.querySelector("CZ DataType"))===null||C===void 0?void 0:C.textContent)===null||I===void 0?void 0:I.toUpperCase())!==null&&L!==void 0?L:"D",increment:Number((F=(T=pe==null?void 0:pe.querySelector("CZ Increment"))===null||T===void 0?void 0:T.textContent)!==null&&F!==void 0?F:"1"),offset:Number((V=(D=pe==null?void 0:pe.querySelector("CZ Offset"))===null||D===void 0?void 0:D.textContent)!==null&&V!==void 0?V:"0")}},St=null,Pe=ze.querySelector("Record1 Axes Rotation");Pe&&(St=new f.Matrix3,St.set(Number((U=(z=Pe.querySelector("r11"))===null||z===void 0?void 0:z.textContent)!==null&&U!==void 0?U:0),Number((G=(q=Pe.querySelector("r12"))===null||q===void 0?void 0:q.textContent)!==null&&G!==void 0?G:0),Number((j=(K=Pe.querySelector("r13"))===null||K===void 0?void 0:K.textContent)!==null&&j!==void 0?j:0),Number((W=(J=Pe.querySelector("r21"))===null||J===void 0?void 0:J.textContent)!==null&&W!==void 0?W:0),Number((Y=($=Pe.querySelector("r22"))===null||$===void 0?void 0:$.textContent)!==null&&Y!==void 0?Y:0),Number((oe=(Z=Pe.querySelector("r23"))===null||Z===void 0?void 0:Z.textContent)!==null&&oe!==void 0?oe:0),Number((de=(ne=Pe.querySelector("r31"))===null||ne===void 0?void 0:ne.textContent)!==null&&de!==void 0?de:0),Number((ye=(se=Pe.querySelector("r32"))===null||se===void 0?void 0:se.textContent)!==null&&ye!==void 0?ye:0),Number((xe=(ie=Pe.querySelector("r33"))===null||ie===void 0?void 0:ie.textContent)!==null&&xe!==void 0?xe:0)));var je=(Le=ze.querySelector("Record3 DataLink PointDataLink"))===null||Le===void 0?void 0:Le.textContent;if(typeof je!="string")throw new Error("X3p: PointDataLink not found.");je=st(Be,je);var it=H[je];if(!it)throw new Error("X3p: ".concat(it," not found."));for(var Xt=dv(it.buffer,Se.z.dataType),Kr=Number((Oe=(Ce=ze.querySelector("Record3 MatrixDimension SizeX"))===null||Ce===void 0?void 0:Ce.textContent)!==null&&Oe!==void 0?Oe:"0"),Wt=Number((re=(ee=ze.querySelector("Record3 MatrixDimension SizeY"))===null||ee===void 0?void 0:ee.textContent)!==null&&re!==void 0?re:"0"),ut=Math.floor(Kr-1),Ct=Math.floor(Wt-1),dt=ut+1,Et=Ct+1,It=new Float32Array(dt*Et*3),Tt=new Float32Array(dt*Et*2),Xe=new Uint32Array(ut*Ct*6),Ne=new f.Box3,We=0;We<Et;We++)for(var At=We*Se.y.increment+Se.y.offset,Ze=0;Ze<dt;Ze++){var gt=We*dt+Ze,Ht=Ze*Se.x.increment+Se.x.offset,yt=Xt[gt],Zt=!isNaN(yt),xr=Zt?yt:NaN;Nn.set(Ht,-At,xr),St&&Nn.applyMatrix3(St),Zt&&Ne.expandByPoint(Nn),It[gt*3+0]=Nn.x,It[gt*3+1]=Nn.y,It[gt*3+2]=Nn.z,Tt[gt*2+0]=Ze/ut,Tt[gt*2+1]=1-We/Ct}for(var We=0;We<Ct;We++)for(var Ze=0;Ze<ut;Ze++){var _r=Ze+dt*We,wr=Ze+dt*(We+1),Lr=Ze+1+dt*(We+1),Dt=Ze+1+dt*We,Ge=(We*ut+Ze)*6;Xe[Ge+0]=_r,Xe[Ge+1]=wr,Xe[Ge+2]=Dt,Xe[Ge+3]=wr,Xe[Ge+4]=Lr,Xe[Ge+5]=Dt}var ke=new f.BufferGeometry;ke.setAttribute("position",new f.BufferAttribute(It,3)),ke.setAttribute("uv",new f.BufferAttribute(Tt,2)),ke.setIndex(new f.BufferAttribute(Xe,1)),(!ke.groups||ke.groups.length===0)&&ke.addGroup(0,ke.index?ke.index.count:ke.attributes.position.count,0),ke.boundingBox=Ne;var Ye=new br(we);Ye.flatShading=!0,Ye.color.copy(be),Ye.refreshUniforms();var bt=new Ot(ke,[Ye]);return{object:bt,dispose:function(){ke.dispose(),Ye.dispose()}}}var f0=new f.Matrix4,pv=5e3,d0=1e3;function eo(n,t){n.name=t.id;var e=t.tileset.properties.floorInfo;n.traverse(function(r){if("floor"in t.extras){if(r instanceof f.Mesh||r instanceof f.Points)for(var i=Array.isArray(r.material)?r.material:r.material?[r.material]:[],a=0,o=i;a<o.length;a++){var s=o[a];(s instanceof br||s instanceof Pi)&&(s.floor=t.extras.floor)}}else if(!(r instanceof yr)){if(r instanceof Ot&&e){for(var u=new f.Box3().expandByObject(r),l=u.getCenter(new f.Vector3),c=0,d=0;d<e.length;d++){var p=e[d],A=p.ground,h=p.height;if(l.y<A+h){c=d;break}}t.floor=c,t.tileset.floorLength=Math.max(t.tileset.floorLength,t.floor+1),r.material.forEach(function(v){return v.floor=c})}}})}function vv(n,t){if(!n.content)return Promise.resolve(n);var e=n.content,r=ga(e.uri,t.search);if(n.type==="TILESET"){var i=ft(r,{key:"model.".concat(n.siblingIndex)});return e.loadState="LOADING",e.loadStateUpdateTime=ve(),t.fetcher.ajax(i,{responseType:"text"}).then(function(a){return a.body}).then(function(a){var o=r.slice(0,r.lastIndexOf("/")+1);return Wi(JSON.parse(a),o)}).then(function(a){e.loadState="READY",e.loadStateUpdateTime=ve(),e.loadfailRetryDelay=0,n.children.length===0&&(n.children=[new Yo("".concat(n.id,".0"),a.root,n.tileset,n)])}).then(function(){return n}).catch(function(a){return e.loadState="FAILED",e.loadStateUpdateTime=ve(),e.loadfailRetryDelay=Math.min(e.loadfailRetryDelay+1e3,5e3),Promise.reject(a)})}if(n.type==="SCENEGRAPH")return e.loadState="LOADING",e.loadStateUpdateTime=ve(),Promise.resolve().then(function(){var a,o,s,u,l,c,d,p,A,h,v="",g=r.split("#"),m=g[0],y=g[1],b=(y||m).split("?")[0].match(/\.([0-9a-zA-Z]+)$/);if(b&&(v=b[1]),v==="b3dm"){var x=ft(r,{key:"model.".concat(n.siblingIndex)});return Ju(x,{upAxis:n.tileset.asset.gltfUpAxis,fetcher:t.fetcher}).then(function(w){return w.scene.applyMatrix4(n.transform),w.scene.updateWorldMatrix(!1,!0),w.scene.matrixAutoUpdate=!1,eo(w.scene,n),w})}if(v==="pnts"){var x=ft(r,{key:"model.".concat(n.siblingIndex)});return Wu(x,{computeBoundingBox:!1,fetcher:t.fetcher}).then(function(M){if(M.scene.applyMatrix4(n.transform),M.scene.updateWorldMatrix(!1,!0),M.scene.matrixAutoUpdate=!1,n.boundingVolume){var S=n.boundingVolume;M.scene.traverse(function(E){if(E instanceof yr){f0.getInverse(E.matrixWorld);var B=new f.Box3;S.getBoundingBox(B),B.applyMatrix4(f0),E.geometry.boundingBox=B}})}return eo(M.scene,n),M})}if(v==="glb"||v==="gltf"){var x=ft(r,{key:"model.".concat(n.siblingIndex)});return fl(x,{upAxis:n.tileset.asset.gltfUpAxis,fetcher:t.fetcher}).then(function(M){return M.scene.applyMatrix4(n.transform),M.scene.updateWorldMatrix(!1,!0),M.scene.matrixAutoUpdate=!1,eo(M.scene,n),M})}if(v==="at3d"){var x=n.extras.at3d?r:ft(r,{key:"model.".concat(n.siblingIndex)});return sl(x,{textureBaseUri:(a=n.extras.at3d)===null||a===void 0?void 0:a.textureBaseUri,textureArray:(o=n.extras.at3d)===null||o===void 0?void 0:o.textureArray,textureOptions:(s=n.extras.at3d)===null||s===void 0?void 0:s.textureOptions,fetcher:t.fetcher}).then(function(M){return M.scene.applyMatrix4(n.transform),M.scene.updateWorldMatrix(!1,!0),M.scene.matrixAutoUpdate=!1,M})}if(v==="pbm"){var x=n.extras.pbm?r:ft(r,{key:"model.".concat(n.siblingIndex)});return il(x,{textureBaseUri:(u=n.extras.pbm)===null||u===void 0?void 0:u.textureBaseUri,textureArray:(l=n.extras.pbm)===null||l===void 0?void 0:l.textureArray,textureOptions:(c=n.extras.pbm)===null||c===void 0?void 0:c.textureOptions,fetcher:t.fetcher}).then(function(M){return M.scene.applyMatrix4(n.transform),M.scene.updateWorldMatrix(!1,!0),M.scene.matrixAutoUpdate=!1,M})}if(v==="dome"){var x=n.extras.dome?r:ft(r,{key:"model.".concat(n.siblingIndex)});return ul(x,{textureBaseUri:(d=n.extras.dome)===null||d===void 0?void 0:d.textureBaseUri,textureOptions:(p=n.extras.dome)===null||p===void 0?void 0:p.textureOptions,fetcher:t.fetcher}).then(function(M){return M.scene.applyMatrix4(n.transform),M.scene.updateWorldMatrix(!1,!0),M.scene.matrixAutoUpdate=!1,M})}if(v==="domez"){var x=n.extras.domez?r:ft(r,{key:"model.".concat(n.siblingIndex)});return cl(x,{textureBaseUri:(A=n.extras.domez)===null||A===void 0?void 0:A.textureBaseUri,textureOptions:(h=n.extras.domez)===null||h===void 0?void 0:h.textureOptions,fetcher:t.fetcher}).then(function(M){return M.scene.applyMatrix4(n.transform),M.scene.updateWorldMatrix(!1,!0),M.scene.matrixAutoUpdate=!1,M})}if(v==="ply"){var x=n.extras.ply?r:ft(r,{key:"model.".concat(n.siblingIndex)});return ns(x,{type:"pbmPointCloud",upAxis:"Z",fetcher:t.fetcher}).then(function(M){return M.scene.applyMatrix4(n.transform),M.scene.updateWorldMatrix(!1,!0),M.scene.matrixAutoUpdate=!1,M})}if(v==="obj"){var x=n.extras.obj?r:ft(r,{key:"model.".concat(n.siblingIndex)});return Sp(x,{upAxis:"Z",fetcher:t.fetcher}).then(function(M){return M.scene.applyMatrix4(n.transform),M.scene.updateWorldMatrix(!1,!0),M.scene.matrixAutoUpdate=!1,M})}if(v==="fbx"){var x=n.extras.obj?r:ft(r,{key:"model.".concat(n.siblingIndex)});return Ml(x,{fetcher:t.fetcher}).then(function(M){return M.scene.applyMatrix4(n.transform),M.scene.updateWorldMatrix(!1,!0),M.scene.matrixAutoUpdate=!1,M})}if(v==="x3p"){var x=n.extras.x3p?r:ft(r,{key:"model.".concat(n.siblingIndex)});return Il(x,{fetcher:t.fetcher}).then(function(M){return M.scene.applyMatrix4(n.transform),M.scene.updateWorldMatrix(!1,!0),M.scene.matrixAutoUpdate=!1,M})}throw new Error("Invalid Tile content: ".concat(r))}).then(function(a){a.scene.traverse(function(s){if(s instanceof yr)s.material.uniforms.geometricError.value=n.geometricError;else if(s instanceof Ot)for(var u=0,l=s.material;u<l.length;u++){var c=l[u];c.uniforms.geometricError.value=n.geometricError}});var o={type:a.type,uri:a.uri,byteLength:a.byteLength,object:new qu(n.id,a.scene,a.dispose)};return Promise.resolve().then(function(){return Promise.all([o.object.generateBvhTree(),t.renderer&&a.textures.length<16?th(a.textures,t.renderer,1024*1024):null])}).then(function(){return e.loadState="READY",e.loadStateUpdateTime=ve(),e.loadfailRetryDelay=0,e.byteLength=o.byteLength,e.data=o,n}).catch(function(s){return Ro(n),Promise.reject(s)})}).catch(function(a){return e.loadState="FAILED",e.loadStateUpdateTime=ve(),a instanceof Kn&&a.httpStatus===0||a instanceof vi||a instanceof bi?e.loadfailRetryDelay=ce(e.loadfailRetryDelay+d0,d0,pv):e.loadfailRetryDelay=1/0,Promise.reject(a)});throw new Error("Invalid Tile type: ".concat(n.type))}function Ro(n){n.content&&(n.content.data&&n.content.data.object.dispose(),n.content.data=void 0,n.content.loadState="UNLOADED",n.content.loadStateUpdateTime=ve(),n.content.byteLength=0)}var Tl=function(n){ue(t,n);function t(e,r,i){i===void 0&&(i=Q);var a=n.call(this)||this;return a.name=e,a.contentObject=r,a.name=e,a.add(r),a.disposers=[i],a}return t.prototype.update=function(e,r,i){var a=this.contentObject.material[2];a.uniforms.dashOffset.value=(a.uniforms.dashOffset.value-.003)%(a.uniforms.dashSize.value.x+a.uniforms.dashSize.value.y),i.needsRender=!0},t.prototype.dispose=function(){for(var e=0,r=this.disposers;e<r.length;e++){var i=r[e];i()}this.disposers.length=0},t.prototype.clone=function(){return new t(this.name,this.contentObject.clone())},t}(f.Object3D),mv=5e3,h0=1e3,Vr={vertexShader:`
|
|
935
935
|
varying vec2 vUv;
|
|
936
936
|
uniform float displacementScalar;
|
|
937
937
|
#include <common>
|
|
@@ -1033,11 +1033,11 @@ void main() {
|
|
|
1033
1033
|
#include <fog_fragment>
|
|
1034
1034
|
#include <premultiplied_alpha_fragment>
|
|
1035
1035
|
}
|
|
1036
|
-
`,uniforms:{diffuse:{value:new f.Color},opacity:{value:1},displacementScalar:{value:0}}};function Av(n,t,e,r){for(var i=new Float32Array((e+1)*(r+1)*3),a=new Float32Array((e+1)*(r+1)*3),o=new Float32Array((e+1)*(r+1)*2),s=new Uint32Array(e*r*6),u=n.computeFrenetFrames(e),l=new f.Vector3,c=new f.Vector3,d=new f.Vector2,p=new f.Vector3,A=0;A<=e;A++){p=n.getPointAt(A/e,p);for(var h=u.normals[A],v=u.binormals[A],g=0;g<=r;g++){var m=A*(r+1)+g,y=g/r*Math.PI*2,b=Math.sin(y),x=-Math.cos(y);c.x=x*h.x+b*v.x,c.y=x*h.y+b*v.y,c.z=x*h.z+b*v.z,c.normalize(),c.toArray(a,m*3),l.x=p.x+t*c.x,l.y=p.y+t*c.y,l.z=p.z+t*c.z,l.toArray(i,m*3),d.x=A/e,d.y=g/r,d.toArray(o,m*2)}}for(var A=0;A<e;A++)for(var g=0;g<r;g++){var w=(A*r+g)*6,M=(r+1)*A+g,S=(r+1)*(A+1)+g,E=(r+1)*(A+1)+(g+1),P=(r+1)*A+(g+1);s[w]=M,s[w+1]=S,s[w+2]=P,s[w+3]=S,s[w+4]=E,s[w+5]=P}var B=new f.BufferGeometry;return B.setIndex(new f.BufferAttribute(s,1)),B.setAttribute("position",new f.BufferAttribute(i,3)),B.setAttribute("normal",new f.BufferAttribute(a,3)),B.setAttribute("uv",new f.BufferAttribute(o,2)),B}function gv(n,t){for(var e=new f.Color(0).convertSRGBToLinear(),r=new f.Color(52949).convertSRGBToLinear(),i=new f.Color(3370495).convertSRGBToLinear(),a=new f.Color(16777215).convertSRGBToLinear(),o=0,s=new f.CurvePath,u=n.length,l=3;l<u;l+=3){var c=new f.Vector3().fromArray(n,l-3),d=new f.Vector3().fromArray(n,l);o+=c.distanceTo(d);var p=new f.LineCurve3(c,d);s.add(p)}var A=.03,h=Math.ceil(o*100),v=6,g=Av(s,A,h,v);g.clearGroups(),g.addGroup(0,g.index?g.index.count:g.attributes.position.count,0),g.addGroup(0,g.index?g.index.count:g.attributes.position.count,1),g.addGroup(0,g.index?g.index.count:g.attributes.position.count,2);var m=new f.ShaderMaterial({vertexShader:Vr.vertexShader,fragmentShader:Vr.fragmentShader,uniforms:f.UniformsUtils.clone(Vr.uniforms),side:f.BackSide});m.uniforms.totalLength.value=o,m.uniforms.diffuse.value=e,m.uniforms.diffuse2.value=e,m.uniforms.opacity.value=.5,m.transparent=!0;var y=new f.ShaderMaterial({vertexShader:Vr.vertexShader,fragmentShader:Vr.fragmentShader,uniforms:f.UniformsUtils.clone(Vr.uniforms),side:f.BackSide});y.uniforms.totalLength.value=o,y.uniforms.displacementScalar.value=-.01,y.uniforms.diffuse.value=r,y.uniforms.diffuse2.value=i;var b=new f.ShaderMaterial({vertexShader:Vr.vertexShader,fragmentShader:Vr.fragmentShader,uniforms:f.UniformsUtils.clone(Vr.uniforms),side:f.DoubleSide});b.uniforms.totalLength.value=o,b.uniforms.displacementScalar.value=-.026,b.uniforms.dashSize.value=new f.Vector2(.06,.09),b.uniforms.diffuse.value=a,b.uniforms.diffuse2.value=a;var x=new f.Mesh(g,[m,y,b]),w=.08,M=24,S=new f.SphereBufferGeometry(w,M,M);S.clearGroups(),S.addGroup(0,g.index?g.index.count:g.attributes.position.count,0),S.addGroup(0,g.index?g.index.count:g.attributes.position.count,1);var E=new f.ShaderMaterial({vertexShader:Nr.vertexShader,fragmentShader:Nr.fragmentShader,uniforms:f.UniformsUtils.clone(Nr.uniforms),side:f.BackSide});E.uniforms.diffuse.value=e,E.uniforms.opacity.value=.5,E.transparent=!0;var P=new f.ShaderMaterial({vertexShader:Nr.vertexShader,fragmentShader:Nr.fragmentShader,uniforms:f.UniformsUtils.clone(Nr.uniforms),side:f.FrontSide});P.uniforms.displacementScalar.value=-.01,P.uniforms.diffuse.value=r;var B=new f.Mesh(S,[E,P]);B.position.fromArray(n,0),x.add(B);var C=new f.ShaderMaterial({vertexShader:Nr.vertexShader,fragmentShader:Nr.fragmentShader,uniforms:f.UniformsUtils.clone(Nr.uniforms),side:f.FrontSide});C.uniforms.displacementScalar.value=-.01,C.uniforms.diffuse.value=i;var I=new f.Mesh(S,[E,C]);return I.position.fromArray(n,n.length-3),x.add(I),{scene:x,dispose:function(){g.dispose(),m.dispose(),y.dispose(),b.dispose(),S.dispose(),E.dispose(),P.dispose(),C.dispose()}}}function yv(n,t){var e=n.name,r=ga(n.content.uri,t.search),i=ft(r,{key:"model.0"});return n.content.loadState="LOADING",n.content.loadStateUpdateTime=ve(),ns(i,{type:"geometry",customPropertyMapping:{time:{itemType:"uint32",itemNames:["time_milisec"]}},fetcher:t.fetcher}).then(function(a){var o,s,u,l,c=(s=(o=a.scene.attributes)===null||o===void 0?void 0:o.time.array)!==null&&s!==void 0?s:[],d=(l=(u=a.scene.attributes)===null||u===void 0?void 0:u.position.array)!==null&&l!==void 0?l:[],p=a.byteLength,A=gv(d);A.scene.applyMatrix4(n.transform),A.scene.updateWorldMatrix(!1,!0),A.scene.matrixAutoUpdate=!1;var h=new Tl(e,A.scene);return n.content.data={uri:i,byteLength:p,positionArray:d,timeArray:c,object:h},n.content.byteLength=p,n.content.loadState="READY",n.content.loadStateUpdateTime=ve(),n}).catch(function(a){return n.content.data=void 0,n.content.loadState="FAILED",n.content.loadStateUpdateTime=ve(),a instanceof Kn&&a.httpStatus===0||a instanceof vi||a instanceof bi?n.content.loadfailRetryDelay=ce(n.content.loadfailRetryDelay+h0,h0,mv):n.content.loadfailRetryDelay=1/0,Promise.reject(a)})}function p0(n){n.content&&(n.content.data&&n.content.data.object.dispose(),n.content.data=void 0,n.content.loadState="UNLOADED",n.content.loadStateUpdateTime=ve(),n.content.byteLength=0)}var v0=new f.Vector3,bv=new f.Matrix3,xv=new f.Matrix4,wt=6378137,Pl=298.257223563;function Rl(n){for(var t=wt-wt/Pl,e=(wt*wt-t*t)/(wt*wt),r=Math.sqrt(n.x*n.x+n.y*n.y),i=1e-12,a=1e3,o=0,s=Math.atan2(n.z,r),u=0;o++<a;){var l=Math.sin(s),c=wt/Math.sqrt(1-e*l*l);u=r/Math.cos(s)-c;var d=Math.atan2(n.z/(c*(1-e)+u),r/(c+u));if(isNaN(d))break;var p=Math.abs(d-s);if(p<i)break;s=d}return n.set(s,Math.atan2(n.y,n.x),u)}function wv(n){var t=n.x,e=n.y,r=n.z,i=wt-wt/Pl,a=(wt*wt-i*i)/(wt*wt),o=Math.sin(t),s=Math.cos(t),u=Math.sin(e),l=Math.cos(e),c=wt/Math.sqrt(1-a*o*o),d=(c+r)*s*l,p=(c+r)*s*u,A=(i*i/(wt*wt)*c+r)*o;return n.set(d,p,A)}function Mv(n,t){var e=Rl(v0.copy(n)),r=e.x,i=e.y,a=e.z,o=Math.sin(r),s=Math.sin(i),u=Math.cos(r),l=Math.cos(i);t.fromArray([-s,-o*l,u*l,0,+l,-o*s,u*s,0,0,u,o,0,0,0,0,1]);var c=bv.setFromMatrix4(t),d=v0.copy(n).applyMatrix3(c).multiplyScalar(-1);t.setPosition(d);var p=xv.fromArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,a,1]);return t.premultiply(p),t}var hr={TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15},m0=function(){var n=new f.MeshBasicMaterial;return n.side=f.BackSide,n.color.setHex(16711935),n.colorWrite=!1,n.stencilWrite=!0,n.polygonOffset=!0,n.polygonOffsetFactor=2,n.polygonOffsetUnits=2,n.stencilRef=hr.TILE_MASK,n.stencilFunc=f.AlwaysStencilFunc,n.stencilFuncMask=hr.TILE_MASK,n.stencilZPass=f.ReplaceStencilOp,n.stencilWriteMask=hr.TILE_MASK,n}(),A0=function(){var n=new f.MeshBasicMaterial;return n.visible=!1,n}(),Sv=new f.BufferGeometry,Cv=new f.MeshBasicMaterial,wn=function(n){ue(t,n);function t(e,r,i){var a,o,s,u=n.call(this)||this;return u.modelIndex=0,u.renderObjects=[],u.backfaceObjects=[],u.debugObjects=[],u.tileObjects=[],u.debug="none",u.name=i.name,u.type=i.type,u.upAxis=i.upAxis,u.model=e,u.fetcher=i.fetcher,u.search=(a=i.search)!==null&&a!==void 0?a:"",u.groundHeight=i.groundHeight,u.coordinateTransform=i.coordinateTransform,u.boundingBox=new f.Box3,u.minLevelOfDetail=t.DEFAULT_MIN_LEVEL_OF_DETAIL,u.maxLevelOfDetail=t.DEFAULT_MAX_LEVEL_OF_DETAIL,u.panoramaMaxLevelOfDetail=t.DEFAULT_MIN_LEVEL_OF_DETAIL,u.needsRefined=!0,u.refined=!1,u.refineProgress=[0,0],u.loaded=!1,u.modelsLoaded=!1,u.disposed=!1,u.needsRender=!0,u.lastRenderHash="",u.matrixAutoUpdate=!1,u.cacheCameras=[],u.clearStencilObject=new f.Mesh(Sv,Cv),u.clearStencilObject.frustumCulled=!1,u.clearStencilObject.onAfterRender=function(l){return l.clearStencil()},u.tileset=new zr((s=(o=u.model.work)===null||o===void 0?void 0:o.workCode)!==null&&s!==void 0?s:"",r,{referer:i.referer,tileLoader:function(l){return u.loadContent(l)},tileUnloader:function(l){return u.unloadContent(l)},onTileLoad:function(){},onTileUnload:function(l){},onTileError:function(l,c){i.onError&&i.onError(Object.assign(c,{error:c})),console.error("Tile error",l.id,c)},trajectoryLoader:function(l){return u.loadTrajectory(l)},trajectoryUnloader:function(l){return u.unloadTrajectory(l)},onTrajectoryLoad:function(){},onTrajectoryUnload:function(l){},onTrajectoryError:function(l,c){i.onError&&i.onError(Object.assign(c,{error:c})),console.error("Trajectory error",l,c)}}),u.tileset.root.boundingVolume&&u.tileset.root.boundingVolume.getBoundingBox(u.boundingBox),u}return t.prototype.getRecommendProps=function(e){var r,i,a;e===void 0&&(e={});var o,s,u,l=128;e.powerPreference==="high"&&(l=512);var c=typeof this.tileset.rootMeta.creationTime=="string";if(c){var d=typeof this.tileset.rootMeta.numTotalPoints=="number"&&this.tileset.rootMeta.numTotalPoints>0;if(d){u=4,e.powerPreference==="high"&&(u=2),o=u/1.6;var p=0;if(((r=this.tileset.rootMeta.taskParameters)===null||r===void 0?void 0:r.point_homogenization)==="1"&&(!((i=this.tileset.rootMeta.taskParameters)===null||i===void 0)&&i.homo_point_density)){var A=Number((a=this.tileset.rootMeta.taskParameters)===null||a===void 0?void 0:a.homo_point_density);isFinite(A)&&!isNaN(A)&&(p=A)}p<=0&&(p=.02),s=p*1.4}else u=5,e.powerPreference==="high"&&(u=4),o=1,s=.03}else u=6,o=1,s=.03,this.name==="aerophoto"?(u=12,e.powerPreference==="high"&&(u=10)):this.tileset.asset.extras&&typeof this.tileset.asset.extras.name=="string"&&/^matterport\b/i.test(this.tileset.asset.extras.name)&&(u=5,e.powerPreference==="high"&&(u=4));return{pointScale:s,pointMinPixel:o,maxScreenSpaceError:u,maxMemoryUsage:l}},t.prototype.getRenderHash=function(){return ma([this.tileset.id,this.tileset.skipLevelOfDetail,this.tileset.selectedTiles.map(function(e){return e.id}),this.tileset.selectedTrajectories.map(function(e){return e.index}),this.debug])},Object.defineProperty(t.prototype,"maxMemoryUsage",{get:function(){return this.tileset.maxMemoryUsage},set:function(e){this.tileset.maxMemoryUsage=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxRequests",{get:function(){return this.tileset.maxRequests},set:function(e){this.tileset.maxRequests=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"requestOrder",{get:function(){return this.tileset.tileRequestOrder},set:function(e){this.tileset.tileRequestOrder=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"skipLevelOfDetail",{get:function(){return this.tileset.skipLevelOfDetail},set:function(e){this.tileset.skipLevelOfDetail=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mostDetail",{get:function(){return this.tileset.mostDetail},set:function(e){this.tileset.mostDetail=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loadSiblings",{get:function(){return this.tileset.loadSiblings},set:function(e){this.tileset.loadSiblings=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loadAll",{get:function(){return this.tileset.loadAll},set:function(e){this.tileset.loadAll=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxScreenSpaceError",{get:function(){return this.tileset.maxScreenSpaceError},set:function(e){this.tileset.maxScreenSpaceError=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"trajectories",{get:function(){return this.tileset.trajectories},enumerable:!1,configurable:!0}),t.prototype.localToEnu=function(e){return e.applyMatrix4(this.coordinateTransform.localToEnuMatrix)},t.prototype.enuToLocal=function(e){return e.applyMatrix4(this.coordinateTransform.enuToLocalMatrix)},t.prototype.localToEcef=function(e){return e.applyMatrix4(this.coordinateTransform.localToEcefMatrix)},t.prototype.ecefToLocal=function(e){return e.applyMatrix4(this.coordinateTransform.ecefToLocalMatrix)},t.prototype.localToLla=function(e){return Rl(this.localToEcef(e))},t.prototype.llaToLocal=function(e){return this.ecefToLocal(wv(e))},t.prototype.worldToEnu=function(e){return this.localToEnu(this.worldToLocal(e))},t.prototype.enuToWorld=function(e){return this.localToWorld(this.enuToLocal(e))},t.prototype.worldToEcef=function(e){return this.localToEcef(this.worldToLocal(e))},t.prototype.ecefToWorld=function(e){return this.localToWorld(this.ecefToLocal(e))},t.prototype.worldToLla=function(e){return this.localToLla(this.worldToLocal(e))},t.prototype.llaToWorld=function(e){return this.localToWorld(this.llaToLocal(e))},t.prototype.loadContent=function(e){var r=this;return vv(e,{fetcher:this.fetcher,search:this.search,renderer:this.renderer}).then(function(i){e.type==="SCENEGRAPH"&&(r.disposed||!e.content?Ro(e):e.content.data&&r.boundingBox.expandByObject(e.content.data.object))})},t.prototype.unloadContent=function(e){return Ro(e),Promise.resolve()},t.prototype.loadAllTilesets=function(){var e=this,r=function(i){var a=[];return e.tileset.root.traverse(function(o){var s;o.type==="TILESET"&&((s=o.content)===null||s===void 0?void 0:s.loadState)!=="READY"&&a.push(o)}),Promise.all(a.map(function(o){return e.loadContent(o).then(function(){return r()})})).then(function(){})};return r(this.tileset.root)},t.prototype.loadTrajectory=function(e){var r=this;return yv(e,{fetcher:this.fetcher,search:this.search,renderer:this.renderer}).then(function(i){r.disposed&&p0(i)})},t.prototype.unloadTrajectory=function(e){return p0(e),Promise.resolve()},t.prototype.intersectRaycaster=function(e,r,i){var a=this;r===void 0&&(r=!0),i===void 0&&(i=[]);for(var o=[this.tileset.root],s=this.tileset.transform,u=this.tileset.transformIsIdentity,l,c=[];l=o.pop();){var d=void 0;if(l.boundingVolume){var p=u?l.boundingVolume:l.boundingVolume.clone().applyMatrix4(s);d=p.intersectRay(e.ray,e.far)}else d=!0;if(d){for(var A=0,h=l.children.length;A<h;A++)o.push(l.children[A]);l.selected&&l.content&&l.content.data&&l.content.data.object.visible&&l.content.data.object.intersectRaycaster(e,!1,c)}}return this.model.shownFloorIndex>=0&&(c=c.filter(function(v){return v.floor===a.model.shownFloorIndex})),r&&c.sort(function(v,g){return v.distance-g.distance}),c.map(function(v){v.model=a.model,v.viewLayer=a.viewLayer}),i.push.apply(i,c),i},t.prototype.cloneSkipBackfaceObject=function(e){var r;e instanceof f.Mesh?r=new f.Mesh(e.geometry,Array.isArray(e.material)?e.material.map(function(s){return s.transparent?A0:m0}):e.material&&e.material.transparent?A0:m0):e instanceof f.Group?r=new f.Group:r=new f.Object3D,r.copy(e,!1);for(var i=0,a=e.children;i<a.length;i++){var o=a[i];r.add(this.cloneSkipBackfaceObject(o))}return r},t.prototype.update=function(e,r,i){var a,o,s,u=this,l,c,d;this.renderObjects.length=0,this.backfaceObjects.length=0,this.debugObjects.length=0,this.tileObjects.length=0,this.renderer=e,this.updateMatrixWorld(!0),this.tileset.transform.equals(this.matrixWorld)||this.tileset.transform.copy(this.matrixWorld),this.tileset.cache.reset();var p=this.tileset.frameNumber+1,A=this.maxLevelOfDetail;if(i==="Panorama"||i==="VRPanorama"||i==="XRPanorama"){var h=this.model.getMaterial().modelAlpha;h<.1&&(A=this.panoramaMaxLevelOfDetail)}A=Math.max(A,0);var v=Math.min(this.minLevelOfDetail,A);(!this.visible||!this.loaded||!this.modelsLoaded)&&(A=Math.max(v,0));var g={time:ve(),camera:{type:r.type,position:new f.Vector3().copy(r.position),direction:r.getDirection(new f.Vector3),near:r.near,far:r.far,up:new f.Vector3().copy(r.up).applyQuaternion(r.quaternion),visible:r.visible,refine:r.refineModel},minLevelOfDetail:v,maxLevelOfDetail:A,height:r.resolution.height,pixelRatio:r.pixelRatio,frameNumber:p,sseDenominator:2*Math.tan(.5*r.fov/180*Math.PI),cullingVolume:new li().setFromCamera(r)},m=this.cacheCameras.map(function(Y){return O(O({},g),{camera:{type:r.type,position:new f.Vector3().copy(Y.position),direction:Y.getWorldDirection(new f.Vector3),near:r.near,far:r.far,up:new f.Vector3().copy(Y.up),visible:Y.visible,refine:!0},cullingVolume:new li().setFromCamera(Y)})});this.needsRefined&&this.tileset.update(g,m),this.refined=!0,this.refineProgress[0]=0,this.refineProgress[1]=0,this.tileset.needsRefinedTiles.forEach(function(Y){if(u.refineProgress[1]++,Y.content){var Z=Y.content.loadState;if(Z==="UNLOADED"||Z==="LOADING"){u.refined=!1;return}}u.refineProgress[0]++}),this.loaded===!1&&this.needsRefined&&(this.loaded=!0,this.tileset.needsRefinedTiles.forEach(function(Y){if(u.loaded!==!1){if(u.tileset.skipLevelOfDetail){if(Y.state.finalResolution&&Y.content){var Z=Y.state.ancestorWithContentAvailable,oe=Z&&Z.content?Z.content:Y.content,ne=oe.loadState;(ne==="UNLOADED"||ne==="LOADING")&&(u.loaded=!1)}}else if(Y.state.visible&&Y.content&&Y.levelOfContent<=0){var ne=Y.content.loadState;(ne==="UNLOADED"||ne==="LOADING")&&(u.loaded=!1)}}}),this.loaded===!0&&(this.refined=!1,this.refineProgress[1]++)),this.remove.apply(this,this.children),this.tileset.skipLevelOfDetail||this.tileset.selectedTiles.sort(function(Y,Z){return Y.floor!==Z.floor?Y.floor-Z.floor:Y.levelOfContent!==Z.levelOfContent?Z.levelOfContent-Y.levelOfContent:Y.state.distanceToCamera!==Z.state.distanceToCamera?Y.state.distanceToCamera-Z.state.distanceToCamera:Y.state.centerZDepth-Z.state.centerZDepth}),this.debug==="root-bounding-volume"&&this.tileset.root.boundingVolumeDebugObject&&this.debugObjects.push(this.tileset.root.boundingVolumeDebugObject);for(var y=0,b=this.tileset.selectedTiles;y<b.length;y++){var x=b[y];this.debug==="selected-bounding-volume"&&x.boundingVolumeDebugObject&&this.debugObjects.push(x.boundingVolumeDebugObject);var w=(c=(l=x.content)===null||l===void 0?void 0:l.data)===null||c===void 0?void 0:c.object;if(w){if(w.update(e,r,this.model,x),this.tileset.hasMixedContent&&this.tileset.skipLevelOfDetail){if(!x.state.finalResolution){var M=this.cloneSkipBackfaceObject(w);this.backfaceObjects.push(M)}for(var S=x.state.selectionDepth,E=hr.TILE_MASK|S<<hr.SKIP_LOD_BIT_SHIFT,P=f.GreaterEqualStencilFunc,B=hr.SKIP_LOD_MASK,C=f.ReplaceStencilOp,I=hr.TILE_MASK|hr.SKIP_LOD_MASK,F=0,T=w.materials;F<T.length;F++){var L=T[F];L.stencilWrite=!0,L.stencilRef=E,L.stencilFunc=P,L.stencilFuncMask=B,L.stencilZPass=C,L.stencilWriteMask=I}}else for(var D=0,V=w.materials;D<V.length;D++){var L=V[D];L.stencilWrite=!1,L.stencilRef=hr.TILE_MASK,L.stencilFunc=f.AlwaysStencilFunc,L.stencilFuncMask=hr.TILE_MASK,L.stencilZPass=f.ReplaceStencilOp,L.stencilWriteMask=hr.TILE_MASK}this.tileObjects.push(w)}}this.tileset.skipLevelOfDetail&&this.backfaceObjects.length&&(a=this.renderObjects).push.apply(a,this.backfaceObjects),this.tileObjects.length&&(o=this.renderObjects).push.apply(o,this.tileObjects),this.tileset.skipLevelOfDetail&&this.renderObjects.push(this.clearStencilObject);for(var z=0,U=this.tileset.selectedTrajectories;z<U.length;z++){var q=U[z],G=(d=q.content.data)===null||d===void 0?void 0:d.object;G&&(G.update(e,r,this.model),this.renderObjects.push(G))}this.debug&&(s=this.renderObjects).push.apply(s,this.debugObjects);for(var K=this.modelIndex*1e4,_=function(Y){var Z=J.renderObjects[Y],oe=Y+K;Z.traverse(function(ne){(ne instanceof f.Mesh||ne instanceof f.Line||ne instanceof f.Points)&&(ne.renderOrder=oe)}),J.add(Z)},J=this,W=0;W<this.renderObjects.length;W++)_(W);var $=this.getRenderHash();this.lastRenderHash!==$&&(this.needsRender=!0,this.lastRenderHash=$)},t.prototype.dispose=function(){this.disposed=!0,this.viewLayer=void 0,this.tileset.reset(),this.remove.apply(this,this.children),this.refineProgress[0]=0,this.refineProgress[1]=0,this.refined=!1,this.loaded=!1},t.DEFAULT_MIN_LEVEL_OF_DETAIL=0,t.DEFAULT_MAX_LEVEL_OF_DETAIL=20,t.DEFAULT_MAX_MEMORY_USAGE=16,t.DEFAULT_MAX_SCREEN_SPACE_ERROR=zr.DEFAULT_MAX_SCREEN_SPACE_ERROR,t.DEFAULT_SKIP_LEVEL_OF_DETAIL=zr.DEFAULT_SKIP_LEVEL_OF_DETAIL,t.DEFAULT_MOST_DETAIL=zr.DEFAULT_MOST_DETAIL,t.DEFAULT_LOAD_SIBLINGS=zr.DEFAULT_LOAD_SIBLINGS,t.DEFAULT_LOAD_ALL=zr.DEFAULT_LOAD_ALL,t.DEFAULT_MAX_REQUESTS=zr.DEFAULT_MAX_REQUESTS,t.DEFAULT_REQUEST_ORDER=zr.DEFAULT_REQUEST_ORDER,t}(f.Object3D);function Ev(n){return-((n-.25)*360+90)/180*Math.PI}function Bo(n,t){if(n===t)return!0;if(n&&t&&typeof n=="object"&&typeof t=="object"){if(n.constructor!==t.constructor)return!1;var e,r,i;if(Array.isArray(n)){if(e=n.length,e!=t.length)return!1;for(r=e;r--!==0;)if(!Bo(n[r],t[r]))return!1;return!0}if(n.constructor===RegExp)return n.source===t.source&&n.flags===t.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===t.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===t.toString();if(i=Object.keys(n),e=i.length,e!==Object.keys(t).length)return!1;for(r=e;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=e;r--!==0;){var a=i[r];if(!Bo(n[a],t[a]))return!1}return!0}return n!==n&&t!==t}function cr(n){return typeof n=="number"}function an(){return((1+Math.random())*65536|0).toString(16).substring(1)}function kt(){return(an()+an()+"-"+an()+"-4"+an().substr(0,3)+"-"+an()+"-"+an()+an()+an()).toLowerCase()}var g0=function(){return new Error("Invalid input.")},y0=function(){return new Error("Invalid certificate.")},b0=function(){return new Error("Invalid signature.")},Iv=function(n){return new Error("date(".concat(n.toString(),") expired."))},Tv=function(n){return new Error("host(".concat(JSON.stringify(n),") is not allowed."))};function Pv(n,t){for(var e={},r=0,i=Object.keys(n);r<i.length;r++){var a=i[r];t.indexOf(a)===-1&&(e[a]=n[a])}return e}function ni(n,t){t===void 0&&(t=!1);var e=typeof n;if(e==="string")return JSON.stringify(n);if(n===!0)return"true";if(n===!1)return"false";if(n===null)return"null";if(n instanceof Array){for(var r="[",i=n.length-1,a=0;a<i;a++)r+=ni(n[a],!1)+",";return i>-1&&(r+=ni(n[a],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return ni(n.toJSON(),t);for(var o=Object.keys(n).sort(),s=o.length,r="",a=0;a<s;){var u=o[a],l=ni(n[u],!0);l!==void 0&&(a&&r!==""&&(r+=","),r+=JSON.stringify(u)+":"+l),a++}return"{"+r+"}"}switch(e){case"function":case"undefined":return t?void 0:null;case"number":return 0;default:return isFinite(n)?n:null}}function Rv(n){return String(ni(n,!1))}function Bl(n){var t,e,r;if(Array.isArray(n)){var i=void 0,a,o;if(n.length<=0)return g0();for(var s=function(w){var M=Bl(n[w]);if(M instanceof Error)return{value:M};if(!i)i=M.issuer;else if(i!==M.issuer)return{value:y0()};a?M.expire.getTime()<a.getTime()&&(a=M.expire):a=M.expire,o?o=o.filter(function(S){return M.allowHosts.indexOf(S)!==-1}):o=M.allowHosts},u=0;u<n.length;u++){var l=s(u);if(typeof l=="object")return l.value}return ln({issuer:i,expire:a,allowHosts:o})}var c=JSON.parse(n),d=typeof location!="undefined"?location.hostname:"",p=Date.now();if(typeof c!="object")return g0();var A=new Date(typeof c.expire_at=="string"&&/^\d+$/.test(c.expire_at)?Number(c.expire_at):c.expire_at),h=Array.isArray(c.allow_hosts)?c.allow_hosts:[];if(d.length===0||Tn(d)||Rr.filter(function(w){return hn(w,d)}).length>0){var v=String((t=c.certificate)!==null&&t!==void 0?t:"");if(v){var g=new $e;return g.readCertPEM(v),ln({issuer:g.getSubjectString(),expire:A,allowHosts:h})}return ln({issuer:"none",expire:A,allowHosts:h})}var m=String((e=c.certificate)!==null&&e!==void 0?e:"");if(!m)return y0();var y=new $e;y.readCertPEM(m);var b=String((r=c._signature)!==null&&r!==void 0?r:"");if(!b)return b0();var x=Rv(Pv(c,["_signature"]));return wf(x,b,y)===!1?b0():p<A.getTime()?h.filter(function(w){return hn(w,d)}).length===0?Tv(d):ln({issuer:y.getSubjectString(),expire:A,allowHosts:h}):Iv(A)}var x0=new f.Matrix4,Bi=new WeakMap,$n=new Set,as=function(){function n(t,e){this.name="",this.workCode="",this.expire=new Date,this.allowHosts=[],this.initial={work:this},this.observers=[],this.issuer="none",this.raw={works:[""],options:""},this.transform=new f.Matrix4;{var r=this;this.options={get transform(){return r.transform},set transform(a){r.transform.copy(a)}}}if(t!==null)if(console.log(t),"up"in t&&typeof t.up=="string"&&"down"in t&&typeof t.down=="string"&&"right"in t&&typeof t.right=="string"&&"left"in t&&typeof t.left=="string"&&"front"in t&&typeof t.front=="string"&&"back"in t&&typeof t.back=="string"&&"size"in t&&typeof t.size=="number")kv(t,this);else{var i=Fv(t,e,this);if(i instanceof Error)throw new Error("[PARSE FAILED]: "+i.message+`
|
|
1036
|
+
`,uniforms:{diffuse:{value:new f.Color},opacity:{value:1},displacementScalar:{value:0}}};function Av(n,t,e,r){for(var i=new Float32Array((e+1)*(r+1)*3),a=new Float32Array((e+1)*(r+1)*3),o=new Float32Array((e+1)*(r+1)*2),s=new Uint32Array(e*r*6),u=n.computeFrenetFrames(e),l=new f.Vector3,c=new f.Vector3,d=new f.Vector2,p=new f.Vector3,A=0;A<=e;A++){p=n.getPointAt(A/e,p);for(var h=u.normals[A],v=u.binormals[A],g=0;g<=r;g++){var m=A*(r+1)+g,y=g/r*Math.PI*2,b=Math.sin(y),x=-Math.cos(y);c.x=x*h.x+b*v.x,c.y=x*h.y+b*v.y,c.z=x*h.z+b*v.z,c.normalize(),c.toArray(a,m*3),l.x=p.x+t*c.x,l.y=p.y+t*c.y,l.z=p.z+t*c.z,l.toArray(i,m*3),d.x=A/e,d.y=g/r,d.toArray(o,m*2)}}for(var A=0;A<e;A++)for(var g=0;g<r;g++){var w=(A*r+g)*6,M=(r+1)*A+g,S=(r+1)*(A+1)+g,E=(r+1)*(A+1)+(g+1),B=(r+1)*A+(g+1);s[w]=M,s[w+1]=S,s[w+2]=B,s[w+3]=S,s[w+4]=E,s[w+5]=B}var R=new f.BufferGeometry;return R.setIndex(new f.BufferAttribute(s,1)),R.setAttribute("position",new f.BufferAttribute(i,3)),R.setAttribute("normal",new f.BufferAttribute(a,3)),R.setAttribute("uv",new f.BufferAttribute(o,2)),R}function gv(n,t){for(var e=new f.Color(0).convertSRGBToLinear(),r=new f.Color(52949).convertSRGBToLinear(),i=new f.Color(3370495).convertSRGBToLinear(),a=new f.Color(16777215).convertSRGBToLinear(),o=0,s=new f.CurvePath,u=n.length,l=3;l<u;l+=3){var c=new f.Vector3().fromArray(n,l-3),d=new f.Vector3().fromArray(n,l);o+=c.distanceTo(d);var p=new f.LineCurve3(c,d);s.add(p)}var A=.03,h=Math.ceil(o*100),v=6,g=Av(s,A,h,v);g.clearGroups(),g.addGroup(0,g.index?g.index.count:g.attributes.position.count,0),g.addGroup(0,g.index?g.index.count:g.attributes.position.count,1),g.addGroup(0,g.index?g.index.count:g.attributes.position.count,2);var m=new f.ShaderMaterial({vertexShader:Vr.vertexShader,fragmentShader:Vr.fragmentShader,uniforms:f.UniformsUtils.clone(Vr.uniforms),side:f.BackSide});m.uniforms.totalLength.value=o,m.uniforms.diffuse.value=e,m.uniforms.diffuse2.value=e,m.uniforms.opacity.value=.5,m.transparent=!0;var y=new f.ShaderMaterial({vertexShader:Vr.vertexShader,fragmentShader:Vr.fragmentShader,uniforms:f.UniformsUtils.clone(Vr.uniforms),side:f.BackSide});y.uniforms.totalLength.value=o,y.uniforms.displacementScalar.value=-.01,y.uniforms.diffuse.value=r,y.uniforms.diffuse2.value=i;var b=new f.ShaderMaterial({vertexShader:Vr.vertexShader,fragmentShader:Vr.fragmentShader,uniforms:f.UniformsUtils.clone(Vr.uniforms),side:f.DoubleSide});b.uniforms.totalLength.value=o,b.uniforms.displacementScalar.value=-.026,b.uniforms.dashSize.value=new f.Vector2(.06,.09),b.uniforms.diffuse.value=a,b.uniforms.diffuse2.value=a;var x=new f.Mesh(g,[m,y,b]),w=.08,M=24,S=new f.SphereBufferGeometry(w,M,M);S.clearGroups(),S.addGroup(0,g.index?g.index.count:g.attributes.position.count,0),S.addGroup(0,g.index?g.index.count:g.attributes.position.count,1);var E=new f.ShaderMaterial({vertexShader:Nr.vertexShader,fragmentShader:Nr.fragmentShader,uniforms:f.UniformsUtils.clone(Nr.uniforms),side:f.BackSide});E.uniforms.diffuse.value=e,E.uniforms.opacity.value=.5,E.transparent=!0;var B=new f.ShaderMaterial({vertexShader:Nr.vertexShader,fragmentShader:Nr.fragmentShader,uniforms:f.UniformsUtils.clone(Nr.uniforms),side:f.FrontSide});B.uniforms.displacementScalar.value=-.01,B.uniforms.diffuse.value=r;var R=new f.Mesh(S,[E,B]);R.position.fromArray(n,0),x.add(R);var C=new f.ShaderMaterial({vertexShader:Nr.vertexShader,fragmentShader:Nr.fragmentShader,uniforms:f.UniformsUtils.clone(Nr.uniforms),side:f.FrontSide});C.uniforms.displacementScalar.value=-.01,C.uniforms.diffuse.value=i;var I=new f.Mesh(S,[E,C]);return I.position.fromArray(n,n.length-3),x.add(I),{scene:x,dispose:function(){g.dispose(),m.dispose(),y.dispose(),b.dispose(),S.dispose(),E.dispose(),B.dispose(),C.dispose()}}}function yv(n,t){var e=n.name,r=ga(n.content.uri,t.search),i=ft(r,{key:"model.0"});return n.content.loadState="LOADING",n.content.loadStateUpdateTime=ve(),ns(i,{type:"geometry",customPropertyMapping:{time:{itemType:"uint32",itemNames:["time_milisec"]}},fetcher:t.fetcher}).then(function(a){var o,s,u,l,c=(s=(o=a.scene.attributes)===null||o===void 0?void 0:o.time.array)!==null&&s!==void 0?s:[],d=(l=(u=a.scene.attributes)===null||u===void 0?void 0:u.position.array)!==null&&l!==void 0?l:[],p=a.byteLength,A=gv(d);A.scene.applyMatrix4(n.transform),A.scene.updateWorldMatrix(!1,!0),A.scene.matrixAutoUpdate=!1;var h=new Tl(e,A.scene);return n.content.data={uri:i,byteLength:p,positionArray:d,timeArray:c,object:h},n.content.byteLength=p,n.content.loadState="READY",n.content.loadStateUpdateTime=ve(),n}).catch(function(a){return n.content.data=void 0,n.content.loadState="FAILED",n.content.loadStateUpdateTime=ve(),a instanceof Kn&&a.httpStatus===0||a instanceof vi||a instanceof bi?n.content.loadfailRetryDelay=ce(n.content.loadfailRetryDelay+h0,h0,mv):n.content.loadfailRetryDelay=1/0,Promise.reject(a)})}function p0(n){n.content&&(n.content.data&&n.content.data.object.dispose(),n.content.data=void 0,n.content.loadState="UNLOADED",n.content.loadStateUpdateTime=ve(),n.content.byteLength=0)}var v0=new f.Vector3,bv=new f.Matrix3,xv=new f.Matrix4,wt=6378137,Pl=298.257223563;function Rl(n){for(var t=wt-wt/Pl,e=(wt*wt-t*t)/(wt*wt),r=Math.sqrt(n.x*n.x+n.y*n.y),i=1e-12,a=1e3,o=0,s=Math.atan2(n.z,r),u=0;o++<a;){var l=Math.sin(s),c=wt/Math.sqrt(1-e*l*l);u=r/Math.cos(s)-c;var d=Math.atan2(n.z/(c*(1-e)+u),r/(c+u));if(isNaN(d))break;var p=Math.abs(d-s);if(p<i)break;s=d}return n.set(s,Math.atan2(n.y,n.x),u)}function wv(n){var t=n.x,e=n.y,r=n.z,i=wt-wt/Pl,a=(wt*wt-i*i)/(wt*wt),o=Math.sin(t),s=Math.cos(t),u=Math.sin(e),l=Math.cos(e),c=wt/Math.sqrt(1-a*o*o),d=(c+r)*s*l,p=(c+r)*s*u,A=(i*i/(wt*wt)*c+r)*o;return n.set(d,p,A)}function Mv(n,t){var e=Rl(v0.copy(n)),r=e.x,i=e.y,a=e.z,o=Math.sin(r),s=Math.sin(i),u=Math.cos(r),l=Math.cos(i);t.fromArray([-s,-o*l,u*l,0,+l,-o*s,u*s,0,0,u,o,0,0,0,0,1]);var c=bv.setFromMatrix4(t),d=v0.copy(n).applyMatrix3(c).multiplyScalar(-1);t.setPosition(d);var p=xv.fromArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,a,1]);return t.premultiply(p),t}var hr={TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15},m0=function(){var n=new f.MeshBasicMaterial;return n.side=f.BackSide,n.color.setHex(16711935),n.colorWrite=!1,n.stencilWrite=!0,n.polygonOffset=!0,n.polygonOffsetFactor=2,n.polygonOffsetUnits=2,n.stencilRef=hr.TILE_MASK,n.stencilFunc=f.AlwaysStencilFunc,n.stencilFuncMask=hr.TILE_MASK,n.stencilZPass=f.ReplaceStencilOp,n.stencilWriteMask=hr.TILE_MASK,n}(),A0=function(){var n=new f.MeshBasicMaterial;return n.visible=!1,n}(),Sv=new f.BufferGeometry,Cv=new f.MeshBasicMaterial,wn=function(n){ue(t,n);function t(e,r,i){var a,o,s,u=n.call(this)||this;return u.modelIndex=0,u.renderObjects=[],u.backfaceObjects=[],u.debugObjects=[],u.tileObjects=[],u.debug="none",u.name=i.name,u.type=i.type,u.upAxis=i.upAxis,u.model=e,u.fetcher=i.fetcher,u.search=(a=i.search)!==null&&a!==void 0?a:"",u.groundHeight=i.groundHeight,u.coordinateTransform=i.coordinateTransform,u.boundingBox=new f.Box3,u.minLevelOfDetail=t.DEFAULT_MIN_LEVEL_OF_DETAIL,u.maxLevelOfDetail=t.DEFAULT_MAX_LEVEL_OF_DETAIL,u.panoramaMaxLevelOfDetail=t.DEFAULT_MIN_LEVEL_OF_DETAIL,u.needsRefined=!0,u.refined=!1,u.refineProgress=[0,0],u.loaded=!1,u.modelsLoaded=!1,u.disposed=!1,u.needsRender=!0,u.lastRenderHash="",u.matrixAutoUpdate=!1,u.cacheCameras=[],u.clearStencilObject=new f.Mesh(Sv,Cv),u.clearStencilObject.frustumCulled=!1,u.clearStencilObject.onAfterRender=function(l){return l.clearStencil()},u.tileset=new zr((s=(o=u.model.work)===null||o===void 0?void 0:o.workCode)!==null&&s!==void 0?s:"",r,{referer:i.referer,tileLoader:function(l){return u.loadContent(l)},tileUnloader:function(l){return u.unloadContent(l)},onTileLoad:function(){},onTileUnload:function(l){},onTileError:function(l,c){i.onError&&i.onError(Object.assign(c,{error:c})),console.error("Tile error",l.id,c)},trajectoryLoader:function(l){return u.loadTrajectory(l)},trajectoryUnloader:function(l){return u.unloadTrajectory(l)},onTrajectoryLoad:function(){},onTrajectoryUnload:function(l){},onTrajectoryError:function(l,c){i.onError&&i.onError(Object.assign(c,{error:c})),console.error("Trajectory error",l,c)}}),u.tileset.root.boundingVolume&&u.tileset.root.boundingVolume.getBoundingBox(u.boundingBox),u}return t.prototype.getRecommendProps=function(e){var r,i,a;e===void 0&&(e={});var o,s,u,l=128;e.powerPreference==="high"&&(l=512);var c=typeof this.tileset.rootMeta.creationTime=="string";if(c){var d=typeof this.tileset.rootMeta.numTotalPoints=="number"&&this.tileset.rootMeta.numTotalPoints>0;if(d){u=4,e.powerPreference==="high"&&(u=2),o=u/1.6;var p=0;if(((r=this.tileset.rootMeta.taskParameters)===null||r===void 0?void 0:r.point_homogenization)==="1"&&(!((i=this.tileset.rootMeta.taskParameters)===null||i===void 0)&&i.homo_point_density)){var A=Number((a=this.tileset.rootMeta.taskParameters)===null||a===void 0?void 0:a.homo_point_density);isFinite(A)&&!isNaN(A)&&(p=A)}p<=0&&(p=.02),s=p*1.4}else u=5,e.powerPreference==="high"&&(u=4),o=1,s=.03}else u=6,o=1,s=.03,this.name==="aerophoto"?(u=12,e.powerPreference==="high"&&(u=10)):this.tileset.asset.extras&&typeof this.tileset.asset.extras.name=="string"&&/^matterport\b/i.test(this.tileset.asset.extras.name)&&(u=5,e.powerPreference==="high"&&(u=4));return{pointScale:s,pointMinPixel:o,maxScreenSpaceError:u,maxMemoryUsage:l}},t.prototype.getRenderHash=function(){return ma([this.tileset.id,this.tileset.skipLevelOfDetail,this.tileset.selectedTiles.map(function(e){return e.id}),this.tileset.selectedTrajectories.map(function(e){return e.index}),this.debug])},Object.defineProperty(t.prototype,"maxMemoryUsage",{get:function(){return this.tileset.maxMemoryUsage},set:function(e){this.tileset.maxMemoryUsage=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxRequests",{get:function(){return this.tileset.maxRequests},set:function(e){this.tileset.maxRequests=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"requestOrder",{get:function(){return this.tileset.tileRequestOrder},set:function(e){this.tileset.tileRequestOrder=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"skipLevelOfDetail",{get:function(){return this.tileset.skipLevelOfDetail},set:function(e){this.tileset.skipLevelOfDetail=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mostDetail",{get:function(){return this.tileset.mostDetail},set:function(e){this.tileset.mostDetail=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loadSiblings",{get:function(){return this.tileset.loadSiblings},set:function(e){this.tileset.loadSiblings=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loadAll",{get:function(){return this.tileset.loadAll},set:function(e){this.tileset.loadAll=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxScreenSpaceError",{get:function(){return this.tileset.maxScreenSpaceError},set:function(e){this.tileset.maxScreenSpaceError=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"trajectories",{get:function(){return this.tileset.trajectories},enumerable:!1,configurable:!0}),t.prototype.localToEnu=function(e){return e.applyMatrix4(this.coordinateTransform.localToEnuMatrix)},t.prototype.enuToLocal=function(e){return e.applyMatrix4(this.coordinateTransform.enuToLocalMatrix)},t.prototype.localToEcef=function(e){return e.applyMatrix4(this.coordinateTransform.localToEcefMatrix)},t.prototype.ecefToLocal=function(e){return e.applyMatrix4(this.coordinateTransform.ecefToLocalMatrix)},t.prototype.localToLla=function(e){return Rl(this.localToEcef(e))},t.prototype.llaToLocal=function(e){return this.ecefToLocal(wv(e))},t.prototype.worldToEnu=function(e){return this.localToEnu(this.worldToLocal(e))},t.prototype.enuToWorld=function(e){return this.localToWorld(this.enuToLocal(e))},t.prototype.worldToEcef=function(e){return this.localToEcef(this.worldToLocal(e))},t.prototype.ecefToWorld=function(e){return this.localToWorld(this.ecefToLocal(e))},t.prototype.worldToLla=function(e){return this.localToLla(this.worldToLocal(e))},t.prototype.llaToWorld=function(e){return this.localToWorld(this.llaToLocal(e))},t.prototype.loadContent=function(e){var r=this;return vv(e,{fetcher:this.fetcher,search:this.search,renderer:this.renderer}).then(function(i){e.type==="SCENEGRAPH"&&(r.disposed||!e.content?Ro(e):e.content.data&&r.boundingBox.expandByObject(e.content.data.object))})},t.prototype.unloadContent=function(e){return Ro(e),Promise.resolve()},t.prototype.loadAllTilesets=function(){var e=this,r=function(i){var a=[];return e.tileset.root.traverse(function(o){var s;o.type==="TILESET"&&((s=o.content)===null||s===void 0?void 0:s.loadState)!=="READY"&&a.push(o)}),Promise.all(a.map(function(o){return e.loadContent(o).then(function(){return r()})})).then(function(){})};return r(this.tileset.root)},t.prototype.loadTrajectory=function(e){var r=this;return yv(e,{fetcher:this.fetcher,search:this.search,renderer:this.renderer}).then(function(i){r.disposed&&p0(i)})},t.prototype.unloadTrajectory=function(e){return p0(e),Promise.resolve()},t.prototype.intersectRaycaster=function(e,r,i){var a=this;r===void 0&&(r=!0),i===void 0&&(i=[]);for(var o=[this.tileset.root],s=this.tileset.transform,u=this.tileset.transformIsIdentity,l,c=[];l=o.pop();){var d=void 0;if(l.boundingVolume){var p=u?l.boundingVolume:l.boundingVolume.clone().applyMatrix4(s);d=p.intersectRay(e.ray,e.far)}else d=!0;if(d){for(var A=0,h=l.children.length;A<h;A++)o.push(l.children[A]);l.selected&&l.content&&l.content.data&&l.content.data.object.visible&&l.content.data.object.intersectRaycaster(e,!1,c)}}return this.model.shownFloorIndex>=0&&(c=c.filter(function(v){return v.floor===a.model.shownFloorIndex})),r&&c.sort(function(v,g){return v.distance-g.distance}),c.map(function(v){v.model=a.model,v.viewLayer=a.viewLayer}),i.push.apply(i,c),i},t.prototype.cloneSkipBackfaceObject=function(e){var r;e instanceof f.Mesh?r=new f.Mesh(e.geometry,Array.isArray(e.material)?e.material.map(function(s){return s.transparent?A0:m0}):e.material&&e.material.transparent?A0:m0):e instanceof f.Group?r=new f.Group:r=new f.Object3D,r.copy(e,!1);for(var i=0,a=e.children;i<a.length;i++){var o=a[i];r.add(this.cloneSkipBackfaceObject(o))}return r},t.prototype.update=function(e,r,i){var a,o,s,u=this,l,c,d;this.renderObjects.length=0,this.backfaceObjects.length=0,this.debugObjects.length=0,this.tileObjects.length=0,this.renderer=e,this.updateMatrixWorld(!0),this.tileset.transform.equals(this.matrixWorld)||this.tileset.transform.copy(this.matrixWorld),this.tileset.cache.reset();var p=this.tileset.frameNumber+1,A=this.maxLevelOfDetail;if(i==="Panorama"||i==="VRPanorama"||i==="XRPanorama"){var h=this.model.getMaterial().modelAlpha;h<.1&&(A=this.panoramaMaxLevelOfDetail)}A=Math.max(A,0);var v=Math.min(this.minLevelOfDetail,A);(!this.visible||!this.loaded||!this.modelsLoaded)&&(A=Math.max(v,0));var g={time:ve(),camera:{type:r.type,position:new f.Vector3().copy(r.position),direction:r.getDirection(new f.Vector3),near:r.near,far:r.far,up:new f.Vector3().copy(r.up).applyQuaternion(r.quaternion),visible:r.visible,refine:r.refineModel},minLevelOfDetail:v,maxLevelOfDetail:A,height:r.resolution.height,pixelRatio:r.pixelRatio,frameNumber:p,sseDenominator:2*Math.tan(.5*r.fov/180*Math.PI),cullingVolume:new li().setFromCamera(r)},m=this.cacheCameras.map(function(Y){return O(O({},g),{camera:{type:r.type,position:new f.Vector3().copy(Y.position),direction:Y.getWorldDirection(new f.Vector3),near:r.near,far:r.far,up:new f.Vector3().copy(Y.up),visible:Y.visible,refine:!0},cullingVolume:new li().setFromCamera(Y)})});this.needsRefined&&this.tileset.update(g,m),this.refined=!0,this.refineProgress[0]=0,this.refineProgress[1]=0,this.tileset.needsRefinedTiles.forEach(function(Y){if(u.refineProgress[1]++,Y.content){var Z=Y.content.loadState;if(Z==="UNLOADED"||Z==="LOADING"){u.refined=!1;return}}u.refineProgress[0]++}),this.loaded===!1&&this.needsRefined&&(this.loaded=!0,this.tileset.needsRefinedTiles.forEach(function(Y){if(u.loaded!==!1){if(u.tileset.skipLevelOfDetail){if(Y.state.finalResolution&&Y.content){var Z=Y.state.ancestorWithContentAvailable,oe=Z&&Z.content?Z.content:Y.content,ne=oe.loadState;(ne==="UNLOADED"||ne==="LOADING")&&(u.loaded=!1)}}else if(Y.state.visible&&Y.content&&Y.levelOfContent<=0){var ne=Y.content.loadState;(ne==="UNLOADED"||ne==="LOADING")&&(u.loaded=!1)}}}),this.loaded===!0&&(this.refined=!1,this.refineProgress[1]++)),this.remove.apply(this,this.children),this.tileset.skipLevelOfDetail||this.tileset.selectedTiles.sort(function(Y,Z){return Y.floor!==Z.floor?Y.floor-Z.floor:Y.levelOfContent!==Z.levelOfContent?Z.levelOfContent-Y.levelOfContent:Y.state.distanceToCamera!==Z.state.distanceToCamera?Y.state.distanceToCamera-Z.state.distanceToCamera:Y.state.centerZDepth-Z.state.centerZDepth}),this.debug==="root-bounding-volume"&&this.tileset.root.boundingVolumeDebugObject&&this.debugObjects.push(this.tileset.root.boundingVolumeDebugObject);for(var y=0,b=this.tileset.selectedTiles;y<b.length;y++){var x=b[y];this.debug==="selected-bounding-volume"&&x.boundingVolumeDebugObject&&this.debugObjects.push(x.boundingVolumeDebugObject);var w=(c=(l=x.content)===null||l===void 0?void 0:l.data)===null||c===void 0?void 0:c.object;if(w){if(w.update(e,r,this.model,x),this.tileset.hasMixedContent&&this.tileset.skipLevelOfDetail){if(!x.state.finalResolution){var M=this.cloneSkipBackfaceObject(w);this.backfaceObjects.push(M)}for(var S=x.state.selectionDepth,E=hr.TILE_MASK|S<<hr.SKIP_LOD_BIT_SHIFT,B=f.GreaterEqualStencilFunc,R=hr.SKIP_LOD_MASK,C=f.ReplaceStencilOp,I=hr.TILE_MASK|hr.SKIP_LOD_MASK,L=0,T=w.materials;L<T.length;L++){var F=T[L];F.stencilWrite=!0,F.stencilRef=E,F.stencilFunc=B,F.stencilFuncMask=R,F.stencilZPass=C,F.stencilWriteMask=I}}else for(var D=0,V=w.materials;D<V.length;D++){var F=V[D];F.stencilWrite=!1,F.stencilRef=hr.TILE_MASK,F.stencilFunc=f.AlwaysStencilFunc,F.stencilFuncMask=hr.TILE_MASK,F.stencilZPass=f.ReplaceStencilOp,F.stencilWriteMask=hr.TILE_MASK}this.tileObjects.push(w)}}this.tileset.skipLevelOfDetail&&this.backfaceObjects.length&&(a=this.renderObjects).push.apply(a,this.backfaceObjects),this.tileObjects.length&&(o=this.renderObjects).push.apply(o,this.tileObjects),this.tileset.skipLevelOfDetail&&this.renderObjects.push(this.clearStencilObject);for(var z=0,U=this.tileset.selectedTrajectories;z<U.length;z++){var q=U[z],G=(d=q.content.data)===null||d===void 0?void 0:d.object;G&&(G.update(e,r,this.model),this.renderObjects.push(G))}this.debug&&(s=this.renderObjects).push.apply(s,this.debugObjects);for(var K=this.modelIndex*1e4,j=function(Y){var Z=J.renderObjects[Y],oe=Y+K;Z.traverse(function(ne){(ne instanceof f.Mesh||ne instanceof f.Line||ne instanceof f.Points)&&(ne.renderOrder=oe)}),J.add(Z)},J=this,W=0;W<this.renderObjects.length;W++)j(W);var $=this.getRenderHash();this.lastRenderHash!==$&&(this.needsRender=!0,this.lastRenderHash=$)},t.prototype.dispose=function(){this.disposed=!0,this.viewLayer=void 0,this.tileset.reset(),this.remove.apply(this,this.children),this.refineProgress[0]=0,this.refineProgress[1]=0,this.refined=!1,this.loaded=!1},t.DEFAULT_MIN_LEVEL_OF_DETAIL=0,t.DEFAULT_MAX_LEVEL_OF_DETAIL=20,t.DEFAULT_MAX_MEMORY_USAGE=16,t.DEFAULT_MAX_SCREEN_SPACE_ERROR=zr.DEFAULT_MAX_SCREEN_SPACE_ERROR,t.DEFAULT_SKIP_LEVEL_OF_DETAIL=zr.DEFAULT_SKIP_LEVEL_OF_DETAIL,t.DEFAULT_MOST_DETAIL=zr.DEFAULT_MOST_DETAIL,t.DEFAULT_LOAD_SIBLINGS=zr.DEFAULT_LOAD_SIBLINGS,t.DEFAULT_LOAD_ALL=zr.DEFAULT_LOAD_ALL,t.DEFAULT_MAX_REQUESTS=zr.DEFAULT_MAX_REQUESTS,t.DEFAULT_REQUEST_ORDER=zr.DEFAULT_REQUEST_ORDER,t}(f.Object3D);function Ev(n){return-((n-.25)*360+90)/180*Math.PI}function Bo(n,t){if(n===t)return!0;if(n&&t&&typeof n=="object"&&typeof t=="object"){if(n.constructor!==t.constructor)return!1;var e,r,i;if(Array.isArray(n)){if(e=n.length,e!=t.length)return!1;for(r=e;r--!==0;)if(!Bo(n[r],t[r]))return!1;return!0}if(n.constructor===RegExp)return n.source===t.source&&n.flags===t.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===t.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===t.toString();if(i=Object.keys(n),e=i.length,e!==Object.keys(t).length)return!1;for(r=e;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=e;r--!==0;){var a=i[r];if(!Bo(n[a],t[a]))return!1}return!0}return n!==n&&t!==t}function lr(n){return typeof n=="number"}function an(){return((1+Math.random())*65536|0).toString(16).substring(1)}function kt(){return(an()+an()+"-"+an()+"-4"+an().substr(0,3)+"-"+an()+"-"+an()+an()+an()).toLowerCase()}var g0=function(){return new Error("Invalid input.")},y0=function(){return new Error("Invalid certificate.")},b0=function(){return new Error("Invalid signature.")},Iv=function(n){return new Error("date(".concat(n.toString(),") expired."))},Tv=function(n){return new Error("host(".concat(JSON.stringify(n),") is not allowed."))};function Pv(n,t){for(var e={},r=0,i=Object.keys(n);r<i.length;r++){var a=i[r];t.indexOf(a)===-1&&(e[a]=n[a])}return e}function ni(n,t){t===void 0&&(t=!1);var e=typeof n;if(e==="string")return JSON.stringify(n);if(n===!0)return"true";if(n===!1)return"false";if(n===null)return"null";if(n instanceof Array){for(var r="[",i=n.length-1,a=0;a<i;a++)r+=ni(n[a],!1)+",";return i>-1&&(r+=ni(n[a],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return ni(n.toJSON(),t);for(var o=Object.keys(n).sort(),s=o.length,r="",a=0;a<s;){var u=o[a],l=ni(n[u],!0);l!==void 0&&(a&&r!==""&&(r+=","),r+=JSON.stringify(u)+":"+l),a++}return"{"+r+"}"}switch(e){case"function":case"undefined":return t?void 0:null;case"number":return 0;default:return isFinite(n)?n:null}}function Rv(n){return String(ni(n,!1))}function Bl(n){var t,e,r;if(Array.isArray(n)){var i=void 0,a,o;if(n.length<=0)return g0();for(var s=function(w){var M=Bl(n[w]);if(M instanceof Error)return{value:M};if(!i)i=M.issuer;else if(i!==M.issuer)return{value:y0()};a?M.expire.getTime()<a.getTime()&&(a=M.expire):a=M.expire,o?o=o.filter(function(S){return M.allowHosts.indexOf(S)!==-1}):o=M.allowHosts},u=0;u<n.length;u++){var l=s(u);if(typeof l=="object")return l.value}return ln({issuer:i,expire:a,allowHosts:o})}var c=JSON.parse(n),d=typeof location!="undefined"?location.hostname:"",p=Date.now();if(typeof c!="object")return g0();var A=new Date(typeof c.expire_at=="string"&&/^\d+$/.test(c.expire_at)?Number(c.expire_at):c.expire_at),h=Array.isArray(c.allow_hosts)?c.allow_hosts:[];if(d.length===0||Tn(d)||Rr.filter(function(w){return hn(w,d)}).length>0){var v=String((t=c.certificate)!==null&&t!==void 0?t:"");if(v){var g=new $e;return g.readCertPEM(v),ln({issuer:g.getSubjectString(),expire:A,allowHosts:h})}return ln({issuer:"none",expire:A,allowHosts:h})}var m=String((e=c.certificate)!==null&&e!==void 0?e:"");if(!m)return y0();var y=new $e;y.readCertPEM(m);var b=String((r=c._signature)!==null&&r!==void 0?r:"");if(!b)return b0();var x=Rv(Pv(c,["_signature"]));return wf(x,b,y)===!1?b0():p<A.getTime()?h.filter(function(w){return hn(w,d)}).length===0?Tv(d):ln({issuer:y.getSubjectString(),expire:A,allowHosts:h}):Iv(A)}var x0=new f.Matrix4,Bi=new WeakMap,$n=new Set,as=function(){function n(t,e){this.name="",this.workCode="",this.expire=new Date,this.allowHosts=[],this.initial={work:this},this.observers=[],this.issuer="none",this.raw={works:[""],options:""},this.transform=new f.Matrix4;{var r=this;this.options={get transform(){return r.transform},set transform(a){r.transform.copy(a)}}}if(t!==null)if("up"in t&&typeof t.up=="string"&&"down"in t&&typeof t.down=="string"&&"right"in t&&typeof t.right=="string"&&"left"in t&&typeof t.left=="string"&&"front"in t&&typeof t.front=="string"&&"back"in t&&typeof t.back=="string"&&"size"in t&&typeof t.size=="number")kv(t,this);else{var i=Fv(t,e,this);if(i instanceof Error)throw new Error("[PARSE FAILED]: "+i.message+`
|
|
1037
1037
|
Error work input:
|
|
1038
|
-
`+JSON.stringify(t))}else Lv(t,this)}return n.prototype.toJSON=function(){return this.raw},n.parse=hi,n}();function w0(n){return n==null?"null":Array.isArray(n)?"array":typeof n=="object"?"dict":"value"}function Fo(n,t){var e=w0(n),r=w0(t);if(r==="null")return n;if(r==="value")return t;if(r!==e)return JSON.parse(JSON.stringify(t));if(r==="array")for(var i=0;i<t.length;i++)n[i]=Fo(n[i],t[i]);else if(r==="dict")for(var a in t)n[a]=Fo(n[a],t[a]);return n}function os(n,t){return n.indexOf(t)===0}function ss(n,t,e,r){var i,a=t;if(r.jsonp===!0){a=t.replace(/([\?\#].*)?$/i,"");var o=Rs("".concat(a)).slice(0,7);a="".concat(a,".").concat(o,".jsonp")}if(r.shortPath===!0){var s=a.replace(n,"").split("."),u=(i=s.shift())!==null&&i!==void 0?i:"",l=s.join(".");a=st(n,Rs(u))+(l?"."+l:"")}var c=a.replace(n,"");return r.baseURL&&(a=st(r.baseURL,c)),r.traverseResource&&r.traverseResource({origin:t,absolute:a,relative:c,type:e}),a}function ct(n,t,e,r,i){var a=e;return Gr(e)||(t&&(t=st(t,String(r))),a=st(t,a)),Gr(a)||(a=st(n,a)),os(a,n)||console.warn("".concat(a," is not start with base_url(").concat(n,").")),ss(n,a,"panorama",i)}function ei(n,t,e){var r=t;return Gr(r)||(r=st(n,t)),os(r,n)||console.warn("".concat(r," is not start with base_url(").concat(n,").")),ss(n,r,"model",e)}function qi(n,t,e,r){var i=t;return Gr(i)||(i=st(e,i)),Gr(i)||(i=st(n,i)),os(i,n)||console.warn("".concat(i," is not start with base_url(").concat(n,").")),ss(n,i,"texture",r)}var ca=function(n){for(var t=10;t>=0;t--){var e=512*Math.pow(2,t);if(e<=n)return t}return null},Bv=function(n){n=n.slice().sort(function(o,s){return o.level-s.level});for(var t=[],e=0,r=n;e<r.length;e++){var i=r[e];if(t.length===0){t.push(i);continue}var a=t[t.length-1];if(i.level>a.level){t.push(i);continue}if(i.size>a.size){t[t.length-1]=i;continue}}return t};function Fv(n,t,e){for(var r,i,a,o,s,u,l,c,d,p,A,h,v,g,m,y,b,x,w,M=JSON.stringify(t),S=[],E=0,P=[].concat(n);E<P.length;E++){var B=P[E];B instanceof as?S.push.apply(S,B.raw.works):typeof B=="string"?S.push(B):S.push(JSON.stringify(B))}var C=Bl(S);if(C instanceof Error)return C;Array.isArray(t.transform)?e.transform.fromArray(t.transform):t.transform&&e.transform.copy(t.transform),n=S.map(function(ee){return JSON.parse(ee)}).reduce(function(ee,re){return Fo(ee,re)}),Object.defineProperty(e,"raw",{configurable:!1,get:function(){return{works:S,options:M}}});{var I;if(t.workCode&&(typeof t.workCode=="string"?I=t.workCode:typeof t.workCode=="function"&&(I=t.workCode(n))),typeof I=="undefined"&&(I=String(n.resource_code||n.basic_code||n.vr_code||n.code||n.project_id||n.work_code||n.workCode)),typeof I=="undefined")return new Error("WorkCode never matched.");Object.defineProperty(e,"workCode",{configurable:!1,get:function(){return I}})}{var F=String(n.name);Object.defineProperty(e,"name",{configurable:!1,get:function(){return F}})}if(C instanceof Error)return C;Object.defineProperty(e,"issuer",{configurable:!1,get:function(){return C.issuer}}),Object.defineProperty(e,"expire",{configurable:!1,get:function(){return C.expire}}),Object.defineProperty(e,"allowHosts",{configurable:!1,get:function(){return C.allowHosts}});var T=(r=n.base_url)!==null&&r!==void 0?r:"";if(T&&T[T.length-1]!=="/"&&(T+="/"),C instanceof Error)return C;if(n.model){var L={work:e,layers:[]},D;n.model.file?D=ei(T,n.model.file,t):n.model.file_url&&(D=ei(T,n.model.file_url,t)),Object.defineProperty(L,"file",{configurable:!1,get:function(){return D}});var V;n.model.textureBase?V=qi(T,"",n.model.textureBase,t):n.model.material_base_url?V=qi(T,"",n.model.material_base_url,t):L.file&&(V=L.file.split("/").slice(0,-1).join("/").replace("/model/","/materials/")),Object.defineProperty(L,"textureBase",{configurable:!1,get:function(){return V}});var z;Array.isArray(n.model.textures)?(z=n.model.textures.map(function(ee){var re,H;return qi(T,ee,(H=(re=n.model.textureBase)!==null&&re!==void 0?re:n.model.material_base_url)!==null&&H!==void 0?H:"",t)}),Object.freeze(z)):Array.isArray(n.model.material_textures)&&(z=n.model.material_textures.map(function(ee){var re,H;return qi(T,ee,(H=(re=n.model.textureBase)!==null&&re!==void 0?re:n.model.material_base_url)!==null&&H!==void 0?H:"",t)}),Object.freeze(z)),Object.defineProperty(L,"textures",{configurable:!1,get:function(){return z}});var U=[];if(Array.isArray(n.model.tiles))for(var q=0,G=n.model.tiles;q<G.length;q++){var K=G[q];K&&(K.tileset||K.tileset_url)&&U.push(Object.freeze({type:(i=K.type)!==null&&i!==void 0?i:"mesh",name:(a=K.name)!==null&&a!==void 0?a:"",upAxis:(s=(o=K.upAxis)!==null&&o!==void 0?o:K.up_axis)!==null&&s!==void 0?s:"-Y",tileset:ei(T,K.tileset||K.tileset_url,t)}))}else n.model.tiles&&(n.model.tiles.tileset||n.model.tiles.tileset_url)&&U.push(Object.freeze({type:(u=n.model.tiles.type)!==null&&u!==void 0?u:"mesh",name:(l=n.model.tiles.name)!==null&&l!==void 0?l:"lod",upAxis:(d=(c=n.model.tiles.upAxis)!==null&&c!==void 0?c:n.model.tiles.up_axis)!==null&&d!==void 0?d:"-Y",tileset:ei(T,n.model.tiles.tileset||n.model.tiles.tileset_url,t)}));if(Array.isArray(n.model.layers))for(var _=0,J=n.model.layers;_<J.length;_++){var W=J[_];W&&(W.tileset||W.tileset_url)&&U.push(Object.freeze({type:(p=W.type)!==null&&p!==void 0?p:"mesh",name:(A=W.name)!==null&&A!==void 0?A:"",upAxis:(h=W.upAxis)!==null&&h!==void 0?h:W.up_axis,tileset:ei(T,W.tileset||W.tileset_url,t)}))}Object.freeze(U),Object.defineProperty(L,"layers",{configurable:!1,get:function(){return U}}),Object.defineProperty(e,"model",{configurable:!1,get:function(){if(L.file||L.layers.length)return L}})}if(C instanceof Error)return C;var $=new Set,Y=new Set;{var Z=[];if(n.observers&&Array.isArray(n.observers)){var oe=[];n.panorama&&(Array.isArray(n.panorama)?oe=n.panorama:Array.isArray(n.panorama.list)?oe=n.panorama.list:Array.isArray(n.panorama.info)&&(oe=n.panorama.info));for(var ne=function(ee){var re={},H=n.observers[ee];if(!H)return"break";var Be=oe[ee];if(!Be)return"break";H=Object.assign({},H,Be,{active:H.active!==!1&&Be.active!==!1}),Object.defineProperty(re,"work",{configurable:!1,get:function(){return e}}),Object.defineProperty(re,"index",{configurable:!1,get:function(){return ee}}),Y.add(ee),Object.defineProperty(re,"panoIndex",{configurable:!1,get:function(){return ee}});var Te=He({workCode:e.workCode,panoIndex:ee});$.add(Te),Object.defineProperty(re,"panoId",{configurable:!1,get:function(){return Te}});var Ee=Object.freeze({workCode:e.workCode,panoIndex:ee});Object.defineProperty(re,"pano",{configurable:!1,get:function(){return Ee}});var Qe=H.active!==!1;Object.defineProperty(re,"active",{configurable:!1,get:function(){return Qe}});var Ie=H.loadable===!0;Object.defineProperty(re,"loadable",{configurable:!1,get:function(){return Ie}});var we=H.derived_id;Object.defineProperty(re,"derivedId",{configurable:!1,get:function(){return we}});var be=H.derived_id_str;Object.defineProperty(re,"derivedIdStr",{configurable:!1,get:function(){return be}});var Ae=(x=(y=(g=(v=n.panorama)===null||v===void 0?void 0:v.pano_high_cube_base_url)!==null&&g!==void 0?g:(m=n.panorama)===null||m===void 0?void 0:m.pano_cube_base_url)!==null&&y!==void 0?y:(b=n.panorama)===null||b===void 0?void 0:b.base_url)!==null&&x!==void 0?x:"",me={up:ct(T,Ae,H.images?H.images.up:H.up,ee,t),down:ct(T,Ae,H.images?H.images.down:H.down,ee,t),right:ct(T,Ae,H.images?H.images.right:H.right,ee,t),left:ct(T,Ae,H.images?H.images.left:H.left,ee,t),front:ct(T,Ae,H.images?H.images.front:H.front,ee,t),back:ct(T,Ae,H.images?H.images.back:H.back,ee,t)};if(H.size_list)me.sizeList=H.size_list.slice();else{var ze=mi(me.up);if(ze&&(me.sizeList=[ze],H.tiles))for(var pe=H.tiles.slice().sort(function(ke,Ye){return ke-Ye}).map(function(ke){return 512*Math.pow(2,ke)}),Se=0,St=pe;Se<St.length;Se++){var Pe=St[Se];Pe>ze&&me.sizeList.push(Pe)}}var _e=H.images?H.images.luminance:H.luminance;_e&&(me.luminance=Object.freeze({up:ct(T,Ae,_e.up,ee,t),down:ct(T,Ae,_e.down,ee,t),right:ct(T,Ae,_e.right,ee,t),left:ct(T,Ae,_e.left,ee,t),front:ct(T,Ae,_e.front,ee,t),back:ct(T,Ae,_e.back,ee,t)}));var it=void 0;if(H.images)it=H.images.tiles;else if(Array.isArray(H.size_list)){var Jt=H.size_list.slice().sort(function(ke,Ye){return ke-Ye});if(Jt[0]){var Kr=ca(Jt[0]);if(Kr)for(var Xt=Kr-1;Xt>=0;Xt--)Jt.unshift(512*Math.pow(2,Xt));it=Jt}}else Array.isArray(H.tiles)&&(it=H.tiles.slice(),typeof it[0]=="number"&&(it=it.sort(function(ke,Ye){return ke-Ye}).map(function(ke){return 512*Math.pow(2,ke)})));if(it){for(var ut=[],Ct=0,dt=it;Ct<dt.length;Ct++){var Pe=dt[Ct];if(typeof Pe=="number"){var Et=ca(Pe);if(typeof Et!="number")continue;var It=mi(me.front);if(!It)continue;if(Pe>It){var Tt=tr(me.up,Pe),Xe=tr(me.down,Pe),Ne=tr(me.right,Pe),We=tr(me.left,Pe),At=tr(me.front,Pe),Ze=tr(me.back,Pe);ut.push(Object.freeze({level:Et,size:Pe,scale:1,up:Tt,down:Xe,right:Ne,left:We,front:At,back:Ze}))}else{var Tt=me.up,Xe=me.down,Ne=me.right,We=me.left,At=me.front,Ze=me.back;ut.push(Object.freeze({level:Et,size:It,scale:Pe/It,up:Tt,down:Xe,right:Ne,left:We,front:At,back:Ze}))}}else{var Et=Pe.level;if(typeof Et!="number")continue;var ze=Pe.size;if(typeof ze!="number")continue;var Tt=ct(T,Ae,Pe.up,ee,t),Xe=ct(T,Ae,Pe.down,ee,t),Ne=ct(T,Ae,Pe.right,ee,t),We=ct(T,Ae,Pe.left,ee,t),At=ct(T,Ae,Pe.front,ee,t),Ze=ct(T,Ae,Pe.back,ee,t);ut.push(Object.freeze({level:Et,size:ze,scale:(w=Pe.scale)!==null&&w!==void 0?w:1,up:Tt,down:Xe,right:Ne,left:We,front:At,back:Ze}))}}ut=Bv(ut),Object.freeze(ut),Object.defineProperty(me,"tiles",{configurable:!1,get:function(){return ut}})}Object.freeze(me),Object.defineProperty(re,"images",{configurable:!1,get:function(){return me}});var gt=new f.Vector3;if(H.position instanceof f.Vector3)gt.copy(H.position);else if(Array.isArray(H.position))gt.fromArray(H.position);else return"break";Object.freeze(gt),Object.defineProperty(re,"position",{configurable:!1,get:function(){return gt}});var qt=new f.Vector3;if(H.standingPosition instanceof f.Vector3)qt.copy(H.standingPosition);else if(Array.isArray(H.standingPosition))qt.fromArray(H.standingPosition);else if(H.standing_position instanceof f.Vector3)qt.copy(H.standing_position);else if(Array.isArray(H.standing_position))qt.fromArray(H.standing_position);else return"break";Object.freeze(qt),Object.defineProperty(re,"standingPosition",{configurable:!1,get:function(){return qt}});var yt=new f.Quaternion;if(H.quaternion instanceof f.Quaternion)yt.copy(H.quaternion);else if(Array.isArray(H.quaternion))yt.fromArray(H.quaternion);else if(H.quaternion){var Wt=H.quaternion,xr=Wt.x,jr=Wt.y,wr=Wt.z,Lr=Wt.w;yt.set(xr,jr,wr,Lr)}else return"break";Object.freeze(yt),Object.defineProperty(re,"quaternion",{configurable:!1,get:function(){return yt}});var Dt=0;cr(H.floorIndex)?Dt=H.floorIndex:cr(H.floor_index)?Dt=H.floor_index:cr(H.floor)&&(Dt=H.floor),Object.defineProperty(re,"floorIndex",{configurable:!1,get:function(){return Dt}});var Ge;H.video&&(Ge={},typeof H.video.source=="string"&&(Ge.source=H.video.source),H.video.matrix instanceof f.Matrix4?Ge.matrix=H.video.matrix.clone():Array.isArray(H.video.matrix)&&(Ge.matrix=new f.Matrix4().fromArray(H.video.matrix)),H.video.size instanceof f.Vector2?Ge.size=H.video.size.clone():Array.isArray(H.video.size)&&(Ge.size=new f.Vector2().fromArray(H.video.size)),Ge.source&&Ge.matrix&&Ge.size&&(re.video=Ge)),Object.freeze(Ge),Object.defineProperty(re,"video",{configurable:!1,get:function(){return Ge}}),Array.isArray(H.accessibleNodes)?(re.accessibleNodes=H.accessibleNodes.slice(),re.accessibleIds=H.accessibleNodes.map(function(ke){return He({workCode:e.workCode,panoIndex:ke})})):Array.isArray(H.accessible_nodes)&&(re.accessibleNodes=H.accessible_nodes.slice(),re.accessibleIds=H.accessible_nodes.map(function(ke){return He({workCode:e.workCode,panoIndex:ke})})),Array.isArray(H.visibleNodes)?(re.visibleNodes=H.visibleNodes.slice(),re.visibleIds=H.visibleNodes.map(function(ke){return He({workCode:e.workCode,panoIndex:ke})})):Array.isArray(H.visible_nodes)&&(re.visibleNodes=H.visible_nodes.slice(),re.visibleIds=H.visible_nodes.map(function(ke){return He({workCode:e.workCode,panoIndex:ke})})),Z[ee]=re},de=0;de<n.observers.length;de++){var se=ne(de);if(se==="break")break}}for(var ye=function(ee){if(ee.accessibleIds){var Be=ee.accessibleIds.filter(function(Ae){return $.has(Ae)});Object.freeze(Be),Object.defineProperty(ee,"accessibleIds",{configurable:!1,get:function(){return Be}})}else{for(var re=[],H=0;H<Z.length;H++)Z[H]!==ee&&(Math.abs(Z[H].position.y-ee.position.y)>3||Z[H].position.distanceTo(ee.position)>10||re.push(Z[H].panoId));Object.freeze(re),Object.defineProperty(ee,"accessibleIds",{configurable:!1,get:function(){return re}})}if(ee.accessibleNodes){var Ee=ee.accessibleNodes.filter(function(Ae){return Y.has(Ae)});Object.freeze(Ee),Object.defineProperty(ee,"accessibleNodes",{configurable:!1,get:function(){return Ee}})}else{for(var Te=[],H=0;H<Z.length;H++)Z[H]!==ee&&(Math.abs(Z[H].position.y-ee.position.y)>3||Z[H].position.distanceTo(ee.position)>10||Te.push(Z[H].panoIndex));Object.freeze(Te),Object.defineProperty(ee,"accessibleNodes",{configurable:!1,get:function(){return Te}})}if(ee.visibleIds){var Ie=ee.visibleIds.filter(function(Ae){return $.has(Ae)});Object.freeze(Ie),Object.defineProperty(ee,"visibleIds",{configurable:!1,get:function(){return Ie}})}else{var Qe=ee.accessibleIds.slice();Object.freeze(Qe),Object.defineProperty(ee,"visibleIds",{configurable:!1,get:function(){return Qe}})}if(ee.visibleNodes){var be=ee.visibleNodes.filter(function(Ae){return Y.has(Ae)});Object.freeze(be),Object.defineProperty(ee,"visibleNodes",{configurable:!1,get:function(){return be}})}else{var we=ee.accessibleNodes.slice();Object.freeze(we),Object.defineProperty(ee,"visibleNodes",{configurable:!1,get:function(){return we}})}},ie=0,xe=Z;ie<xe.length;ie++){var Le=xe[ie];ye(Le)}Object.freeze(Z),Object.defineProperty(e,"observers",{configurable:!1,get:function(){return Z}})}if(C instanceof Error)return C;if(n.initial){if((n.initial.mode==="Panorama"&&e.observers.length===0||n.initial.mode==="Floorplan"||n.initial.mode==="Topview"||n.initial.mode==="Model"||n.initial.mode==="Mapview"||n.initial.mode==="DepthPanorama")&&(e.initial.mode=n.initial.mode),cr(n.initial.latitude)&&(e.initial.latitude=n.initial.latitude),cr(n.initial.longitude)?e.initial.longitude=n.initial.longitude:cr(n.initial.heading)&&(e.initial.longitude=Ev(n.initial.heading)),cr(n.initial.fov)&&(e.initial.fov=n.initial.fov),e.observers.length>0){var Ce=void 0;cr(n.initial.panoIndex)?Ce=n.initial.panoIndex:cr(n.initial.pano_index)?Ce=n.initial.pano_index:cr(n.initial.pano)&&(Ce=n.initial.pano),typeof Ce=="number"&&(Ce=ce(Ce,0,e.observers.length-1),e.initial.panoIndex=Ce)}if(cr(n.initial.distance)&&(e.initial.distance=n.initial.distance),Array.isArray(n.initial.offset)){var Oe=[0,0,0].map(function(ee,re){var H=Number(n.initial.offset[re]);return isNaN(H)||!isFinite(H)?0:H});e.initial.offset=new f.Vector3().fromArray(Oe)}!e.initial.mode&&typeof e.initial.panoIndex=="number"&&(e.initial.mode="Panorama")}return C instanceof Error?C:(Bi.set(e,{works:S,options:M}),e)}function Lv(n,t){return t.issuer="null",ln(t),Bi.set(t,{works:["null"],options:"{}"}),t}function kv(n,t){var e;t.issuer="null",t.allowHosts=["*"],t.workCode=(e=n.code)!==null&&e!==void 0?e:kt();var r=[n.size],i=[],a=ca(r[0]);if(a)for(var o=a-1;o>=0;o--)r.unshift(512*Math.pow(2,o));for(var s=0,u=r;s<u.length;s++){var l=u[s],c=ca(l);c&&i.push({level:c,size:n.size,scale:l/n.size,up:n.up,down:n.down,right:n.right,left:n.left,front:n.front,back:n.back})}var d={up:n.up,down:n.down,right:n.right,left:n.left,front:n.front,back:n.back,sizeList:r};i&&(d.tiles=i);var p={accessibleIds:[],accessibleNodes:[],active:!0,floorIndex:0,images:d,index:0,loadable:!1,pano:{workCode:t.workCode,panoIndex:0},panoId:"".concat(t.workCode,"[0]"),panoIndex:0,position:new f.Vector3(0,1.5,0),quaternion:new f.Quaternion(0,1,0,0),standingPosition:new f.Vector3(0,0,0),visibleIds:[],visibleNodes:[],work:t};return t.observers=[p],ln(t),Bi.set(t,{works:[JSON.stringify(n)],options:"{}"}),t}function hi(n,t){typeof n=="string"&&n.trim()[0]==="{"&&(n=JSON.parse(n));var e=Bi.get(n);if(e){if(t&&!Bo(JSON.parse(e.options),t))throw new Error("[PARSE FAILED]: work is parsed with different options.");return n}else try{return new as(n,t!=null?t:{})}catch(r){throw new Error("[PARSE FAILED]: "+r.message+`
|
|
1038
|
+
`+JSON.stringify(t))}else Lv(t,this)}return n.prototype.toJSON=function(){return this.raw},n.parse=hi,n}();function w0(n){return n==null?"null":Array.isArray(n)?"array":typeof n=="object"?"dict":"value"}function Fo(n,t){var e=w0(n),r=w0(t);if(r==="null")return n;if(r==="value")return t;if(r!==e)return JSON.parse(JSON.stringify(t));if(r==="array")for(var i=0;i<t.length;i++)n[i]=Fo(n[i],t[i]);else if(r==="dict")for(var a in t)n[a]=Fo(n[a],t[a]);return n}function os(n,t){return n.indexOf(t)===0}function ss(n,t,e,r){var i,a=t;if(r.jsonp===!0){a=t.replace(/([\?\#].*)?$/i,"");var o=Rs("".concat(a)).slice(0,7);a="".concat(a,".").concat(o,".jsonp")}if(r.shortPath===!0){var s=a.replace(n,"").split("."),u=(i=s.shift())!==null&&i!==void 0?i:"",l=s.join(".");a=st(n,Rs(u))+(l?"."+l:"")}var c=a.replace(n,"");return r.baseURL&&(a=st(r.baseURL,c)),r.traverseResource&&r.traverseResource({origin:t,absolute:a,relative:c,type:e}),a}function ct(n,t,e,r,i){var a=e;return Gr(e)||(t&&(t=st(t,String(r))),a=st(t,a)),Gr(a)||(a=st(n,a)),os(a,n)||console.warn("".concat(a," is not start with base_url(").concat(n,").")),ss(n,a,"panorama",i)}function ei(n,t,e){var r=t;return Gr(r)||(r=st(n,t)),os(r,n)||console.warn("".concat(r," is not start with base_url(").concat(n,").")),ss(n,r,"model",e)}function qi(n,t,e,r){var i=t;return Gr(i)||(i=st(e,i)),Gr(i)||(i=st(n,i)),os(i,n)||console.warn("".concat(i," is not start with base_url(").concat(n,").")),ss(n,i,"texture",r)}var ca=function(n){for(var t=10;t>=0;t--){var e=512*Math.pow(2,t);if(e<=n)return t}return null},Bv=function(n){n=n.slice().sort(function(o,s){return o.level-s.level});for(var t=[],e=0,r=n;e<r.length;e++){var i=r[e];if(t.length===0){t.push(i);continue}var a=t[t.length-1];if(i.level>a.level){t.push(i);continue}if(i.size>a.size){t[t.length-1]=i;continue}}return t};function Fv(n,t,e){for(var r,i,a,o,s,u,l,c,d,p,A,h,v,g,m,y,b,x,w,M=JSON.stringify(t),S=[],E=0,B=[].concat(n);E<B.length;E++){var R=B[E];R instanceof as?S.push.apply(S,R.raw.works):typeof R=="string"?S.push(R):S.push(JSON.stringify(R))}var C=Bl(S);if(C instanceof Error)return C;Array.isArray(t.transform)?e.transform.fromArray(t.transform):t.transform&&e.transform.copy(t.transform),n=S.map(function(ee){return JSON.parse(ee)}).reduce(function(ee,re){return Fo(ee,re)}),Object.defineProperty(e,"raw",{configurable:!1,get:function(){return{works:S,options:M}}});{var I;if(t.workCode&&(typeof t.workCode=="string"?I=t.workCode:typeof t.workCode=="function"&&(I=t.workCode(n))),typeof I=="undefined"&&(I=String(n.resource_code||n.basic_code||n.vr_code||n.code||n.project_id||n.work_code||n.workCode)),typeof I=="undefined")return new Error("WorkCode never matched.");Object.defineProperty(e,"workCode",{configurable:!1,get:function(){return I}})}{var L=String(n.name);Object.defineProperty(e,"name",{configurable:!1,get:function(){return L}})}if(C instanceof Error)return C;Object.defineProperty(e,"issuer",{configurable:!1,get:function(){return C.issuer}}),Object.defineProperty(e,"expire",{configurable:!1,get:function(){return C.expire}}),Object.defineProperty(e,"allowHosts",{configurable:!1,get:function(){return C.allowHosts}});var T=(r=n.base_url)!==null&&r!==void 0?r:"";if(T&&T[T.length-1]!=="/"&&(T+="/"),C instanceof Error)return C;if(n.model){var F={work:e,layers:[]},D;n.model.file?D=ei(T,n.model.file,t):n.model.file_url&&(D=ei(T,n.model.file_url,t)),Object.defineProperty(F,"file",{configurable:!1,get:function(){return D}});var V;n.model.textureBase?V=qi(T,"",n.model.textureBase,t):n.model.material_base_url?V=qi(T,"",n.model.material_base_url,t):F.file&&(V=F.file.split("/").slice(0,-1).join("/").replace("/model/","/materials/")),Object.defineProperty(F,"textureBase",{configurable:!1,get:function(){return V}});var z;Array.isArray(n.model.textures)?(z=n.model.textures.map(function(ee){var re,H;return qi(T,ee,(H=(re=n.model.textureBase)!==null&&re!==void 0?re:n.model.material_base_url)!==null&&H!==void 0?H:"",t)}),Object.freeze(z)):Array.isArray(n.model.material_textures)&&(z=n.model.material_textures.map(function(ee){var re,H;return qi(T,ee,(H=(re=n.model.textureBase)!==null&&re!==void 0?re:n.model.material_base_url)!==null&&H!==void 0?H:"",t)}),Object.freeze(z)),Object.defineProperty(F,"textures",{configurable:!1,get:function(){return z}});var U=[];if(Array.isArray(n.model.tiles))for(var q=0,G=n.model.tiles;q<G.length;q++){var K=G[q];K&&(K.tileset||K.tileset_url)&&U.push(Object.freeze({type:(i=K.type)!==null&&i!==void 0?i:"mesh",name:(a=K.name)!==null&&a!==void 0?a:"",upAxis:(s=(o=K.upAxis)!==null&&o!==void 0?o:K.up_axis)!==null&&s!==void 0?s:"-Y",tileset:ei(T,K.tileset||K.tileset_url,t)}))}else n.model.tiles&&(n.model.tiles.tileset||n.model.tiles.tileset_url)&&U.push(Object.freeze({type:(u=n.model.tiles.type)!==null&&u!==void 0?u:"mesh",name:(l=n.model.tiles.name)!==null&&l!==void 0?l:"lod",upAxis:(d=(c=n.model.tiles.upAxis)!==null&&c!==void 0?c:n.model.tiles.up_axis)!==null&&d!==void 0?d:"-Y",tileset:ei(T,n.model.tiles.tileset||n.model.tiles.tileset_url,t)}));if(Array.isArray(n.model.layers))for(var j=0,J=n.model.layers;j<J.length;j++){var W=J[j];W&&(W.tileset||W.tileset_url)&&U.push(Object.freeze({type:(p=W.type)!==null&&p!==void 0?p:"mesh",name:(A=W.name)!==null&&A!==void 0?A:"",upAxis:(h=W.upAxis)!==null&&h!==void 0?h:W.up_axis,tileset:ei(T,W.tileset||W.tileset_url,t)}))}Object.freeze(U),Object.defineProperty(F,"layers",{configurable:!1,get:function(){return U}}),Object.defineProperty(e,"model",{configurable:!1,get:function(){if(F.file||F.layers.length)return F}})}if(C instanceof Error)return C;var $=new Set,Y=new Set;{var Z=[];if(n.observers&&Array.isArray(n.observers)){var oe=[];n.panorama&&(Array.isArray(n.panorama)?oe=n.panorama:Array.isArray(n.panorama.list)?oe=n.panorama.list:Array.isArray(n.panorama.info)&&(oe=n.panorama.info));for(var ne=function(ee){var re={},H=n.observers[ee];if(!H)return"break";var Be=oe[ee];if(!Be)return"break";H=Object.assign({},H,Be,{active:H.active!==!1&&Be.active!==!1}),Object.defineProperty(re,"work",{configurable:!1,get:function(){return e}}),Object.defineProperty(re,"index",{configurable:!1,get:function(){return ee}}),Y.add(ee),Object.defineProperty(re,"panoIndex",{configurable:!1,get:function(){return ee}});var Te=He({workCode:e.workCode,panoIndex:ee});$.add(Te),Object.defineProperty(re,"panoId",{configurable:!1,get:function(){return Te}});var Ee=Object.freeze({workCode:e.workCode,panoIndex:ee});Object.defineProperty(re,"pano",{configurable:!1,get:function(){return Ee}});var Qe=H.active!==!1;Object.defineProperty(re,"active",{configurable:!1,get:function(){return Qe}});var Ie=H.loadable===!0;Object.defineProperty(re,"loadable",{configurable:!1,get:function(){return Ie}});var we=H.derived_id;Object.defineProperty(re,"derivedId",{configurable:!1,get:function(){return we}});var be=H.derived_id_str;Object.defineProperty(re,"derivedIdStr",{configurable:!1,get:function(){return be}});var Ae=(x=(y=(g=(v=n.panorama)===null||v===void 0?void 0:v.pano_high_cube_base_url)!==null&&g!==void 0?g:(m=n.panorama)===null||m===void 0?void 0:m.pano_cube_base_url)!==null&&y!==void 0?y:(b=n.panorama)===null||b===void 0?void 0:b.base_url)!==null&&x!==void 0?x:"",me={up:ct(T,Ae,H.images?H.images.up:H.up,ee,t),down:ct(T,Ae,H.images?H.images.down:H.down,ee,t),right:ct(T,Ae,H.images?H.images.right:H.right,ee,t),left:ct(T,Ae,H.images?H.images.left:H.left,ee,t),front:ct(T,Ae,H.images?H.images.front:H.front,ee,t),back:ct(T,Ae,H.images?H.images.back:H.back,ee,t)};if(H.size_list)me.sizeList=H.size_list.slice();else{var ze=mi(me.up);if(ze&&(me.sizeList=[ze],H.tiles))for(var pe=H.tiles.slice().sort(function(ke,Ye){return ke-Ye}).map(function(ke){return 512*Math.pow(2,ke)}),Se=0,St=pe;Se<St.length;Se++){var Pe=St[Se];Pe>ze&&me.sizeList.push(Pe)}}var je=H.images?H.images.luminance:H.luminance;je&&(me.luminance=Object.freeze({up:ct(T,Ae,je.up,ee,t),down:ct(T,Ae,je.down,ee,t),right:ct(T,Ae,je.right,ee,t),left:ct(T,Ae,je.left,ee,t),front:ct(T,Ae,je.front,ee,t),back:ct(T,Ae,je.back,ee,t)}));var it=void 0;if(H.images)it=H.images.tiles;else if(Array.isArray(H.size_list)){var Xt=H.size_list.slice().sort(function(ke,Ye){return ke-Ye});if(Xt[0]){var Kr=ca(Xt[0]);if(Kr)for(var Wt=Kr-1;Wt>=0;Wt--)Xt.unshift(512*Math.pow(2,Wt));it=Xt}}else Array.isArray(H.tiles)&&(it=H.tiles.slice(),typeof it[0]=="number"&&(it=it.sort(function(ke,Ye){return ke-Ye}).map(function(ke){return 512*Math.pow(2,ke)})));if(it){for(var ut=[],Ct=0,dt=it;Ct<dt.length;Ct++){var Pe=dt[Ct];if(typeof Pe=="number"){var Et=ca(Pe);if(typeof Et!="number")continue;var It=mi(me.front);if(!It)continue;if(Pe>It){var Tt=tr(me.up,Pe),Xe=tr(me.down,Pe),Ne=tr(me.right,Pe),We=tr(me.left,Pe),At=tr(me.front,Pe),Ze=tr(me.back,Pe);ut.push(Object.freeze({level:Et,size:Pe,scale:1,up:Tt,down:Xe,right:Ne,left:We,front:At,back:Ze}))}else{var Tt=me.up,Xe=me.down,Ne=me.right,We=me.left,At=me.front,Ze=me.back;ut.push(Object.freeze({level:Et,size:It,scale:Pe/It,up:Tt,down:Xe,right:Ne,left:We,front:At,back:Ze}))}}else{var Et=Pe.level;if(typeof Et!="number")continue;var ze=Pe.size;if(typeof ze!="number")continue;var Tt=ct(T,Ae,Pe.up,ee,t),Xe=ct(T,Ae,Pe.down,ee,t),Ne=ct(T,Ae,Pe.right,ee,t),We=ct(T,Ae,Pe.left,ee,t),At=ct(T,Ae,Pe.front,ee,t),Ze=ct(T,Ae,Pe.back,ee,t);ut.push(Object.freeze({level:Et,size:ze,scale:(w=Pe.scale)!==null&&w!==void 0?w:1,up:Tt,down:Xe,right:Ne,left:We,front:At,back:Ze}))}}ut=Bv(ut),Object.freeze(ut),Object.defineProperty(me,"tiles",{configurable:!1,get:function(){return ut}})}Object.freeze(me),Object.defineProperty(re,"images",{configurable:!1,get:function(){return me}});var gt=new f.Vector3;if(H.position instanceof f.Vector3)gt.copy(H.position);else if(Array.isArray(H.position))gt.fromArray(H.position);else return"break";Object.freeze(gt),Object.defineProperty(re,"position",{configurable:!1,get:function(){return gt}});var Ht=new f.Vector3;if(H.standingPosition instanceof f.Vector3)Ht.copy(H.standingPosition);else if(Array.isArray(H.standingPosition))Ht.fromArray(H.standingPosition);else if(H.standing_position instanceof f.Vector3)Ht.copy(H.standing_position);else if(Array.isArray(H.standing_position))Ht.fromArray(H.standing_position);else return"break";Object.freeze(Ht),Object.defineProperty(re,"standingPosition",{configurable:!1,get:function(){return Ht}});var yt=new f.Quaternion;if(H.quaternion instanceof f.Quaternion)yt.copy(H.quaternion);else if(Array.isArray(H.quaternion))yt.fromArray(H.quaternion);else if(H.quaternion){var Zt=H.quaternion,xr=Zt.x,_r=Zt.y,wr=Zt.z,Lr=Zt.w;yt.set(xr,_r,wr,Lr)}else return"break";Object.freeze(yt),Object.defineProperty(re,"quaternion",{configurable:!1,get:function(){return yt}});var Dt=0;lr(H.floorIndex)?Dt=H.floorIndex:lr(H.floor_index)?Dt=H.floor_index:lr(H.floor)&&(Dt=H.floor),Object.defineProperty(re,"floorIndex",{configurable:!1,get:function(){return Dt}});var Ge;H.video&&(Ge={},typeof H.video.source=="string"&&(Ge.source=H.video.source),H.video.matrix instanceof f.Matrix4?Ge.matrix=H.video.matrix.clone():Array.isArray(H.video.matrix)&&(Ge.matrix=new f.Matrix4().fromArray(H.video.matrix)),H.video.size instanceof f.Vector2?Ge.size=H.video.size.clone():Array.isArray(H.video.size)&&(Ge.size=new f.Vector2().fromArray(H.video.size)),Ge.source&&Ge.matrix&&Ge.size&&(re.video=Ge)),Object.freeze(Ge),Object.defineProperty(re,"video",{configurable:!1,get:function(){return Ge}}),Array.isArray(H.accessibleNodes)?(re.accessibleNodes=H.accessibleNodes.slice(),re.accessibleIds=H.accessibleNodes.map(function(ke){return He({workCode:e.workCode,panoIndex:ke})})):Array.isArray(H.accessible_nodes)&&(re.accessibleNodes=H.accessible_nodes.slice(),re.accessibleIds=H.accessible_nodes.map(function(ke){return He({workCode:e.workCode,panoIndex:ke})})),Array.isArray(H.visibleNodes)?(re.visibleNodes=H.visibleNodes.slice(),re.visibleIds=H.visibleNodes.map(function(ke){return He({workCode:e.workCode,panoIndex:ke})})):Array.isArray(H.visible_nodes)&&(re.visibleNodes=H.visible_nodes.slice(),re.visibleIds=H.visible_nodes.map(function(ke){return He({workCode:e.workCode,panoIndex:ke})})),Z[ee]=re},de=0;de<n.observers.length;de++){var se=ne(de);if(se==="break")break}}for(var ye=function(ee){if(ee.accessibleIds){var Be=ee.accessibleIds.filter(function(Ae){return $.has(Ae)});Object.freeze(Be),Object.defineProperty(ee,"accessibleIds",{configurable:!1,get:function(){return Be}})}else{for(var re=[],H=0;H<Z.length;H++)Z[H]!==ee&&(Math.abs(Z[H].position.y-ee.position.y)>3||Z[H].position.distanceTo(ee.position)>10||re.push(Z[H].panoId));Object.freeze(re),Object.defineProperty(ee,"accessibleIds",{configurable:!1,get:function(){return re}})}if(ee.accessibleNodes){var Ee=ee.accessibleNodes.filter(function(Ae){return Y.has(Ae)});Object.freeze(Ee),Object.defineProperty(ee,"accessibleNodes",{configurable:!1,get:function(){return Ee}})}else{for(var Te=[],H=0;H<Z.length;H++)Z[H]!==ee&&(Math.abs(Z[H].position.y-ee.position.y)>3||Z[H].position.distanceTo(ee.position)>10||Te.push(Z[H].panoIndex));Object.freeze(Te),Object.defineProperty(ee,"accessibleNodes",{configurable:!1,get:function(){return Te}})}if(ee.visibleIds){var Ie=ee.visibleIds.filter(function(Ae){return $.has(Ae)});Object.freeze(Ie),Object.defineProperty(ee,"visibleIds",{configurable:!1,get:function(){return Ie}})}else{var Qe=ee.accessibleIds.slice();Object.freeze(Qe),Object.defineProperty(ee,"visibleIds",{configurable:!1,get:function(){return Qe}})}if(ee.visibleNodes){var be=ee.visibleNodes.filter(function(Ae){return Y.has(Ae)});Object.freeze(be),Object.defineProperty(ee,"visibleNodes",{configurable:!1,get:function(){return be}})}else{var we=ee.accessibleNodes.slice();Object.freeze(we),Object.defineProperty(ee,"visibleNodes",{configurable:!1,get:function(){return we}})}},ie=0,xe=Z;ie<xe.length;ie++){var Le=xe[ie];ye(Le)}Object.freeze(Z),Object.defineProperty(e,"observers",{configurable:!1,get:function(){return Z}})}if(C instanceof Error)return C;if(n.initial){if((n.initial.mode==="Panorama"&&e.observers.length===0||n.initial.mode==="Floorplan"||n.initial.mode==="Topview"||n.initial.mode==="Model"||n.initial.mode==="Mapview"||n.initial.mode==="DepthPanorama")&&(e.initial.mode=n.initial.mode),lr(n.initial.latitude)&&(e.initial.latitude=n.initial.latitude),lr(n.initial.longitude)?e.initial.longitude=n.initial.longitude:lr(n.initial.heading)&&(e.initial.longitude=Ev(n.initial.heading)),lr(n.initial.fov)&&(e.initial.fov=n.initial.fov),e.observers.length>0){var Ce=void 0;lr(n.initial.panoIndex)?Ce=n.initial.panoIndex:lr(n.initial.pano_index)?Ce=n.initial.pano_index:lr(n.initial.pano)&&(Ce=n.initial.pano),typeof Ce=="number"&&(Ce=ce(Ce,0,e.observers.length-1),e.initial.panoIndex=Ce)}if(lr(n.initial.distance)&&(e.initial.distance=n.initial.distance),Array.isArray(n.initial.offset)){var Oe=[0,0,0].map(function(ee,re){var H=Number(n.initial.offset[re]);return isNaN(H)||!isFinite(H)?0:H});e.initial.offset=new f.Vector3().fromArray(Oe)}else typeof n.initial.offset=="object"&&typeof n.initial.offset.x=="number"&&typeof n.initial.offset.y=="number"&&typeof n.initial.offset.z=="number"&&(e.initial.offset=new f.Vector3(n.initial.offset.x,n.initial.offset.y,n.initial.offset.z));!e.initial.mode&&typeof e.initial.panoIndex=="number"&&(e.initial.mode="Panorama")}return C instanceof Error?C:(Bi.set(e,{works:S,options:M}),e)}function Lv(n,t){return t.issuer="null",ln(t),Bi.set(t,{works:["null"],options:"{}"}),t}function kv(n,t){var e;t.issuer="null",t.allowHosts=["*"],t.workCode=(e=n.code)!==null&&e!==void 0?e:kt();var r=[n.size],i=[],a=ca(r[0]);if(a)for(var o=a-1;o>=0;o--)r.unshift(512*Math.pow(2,o));for(var s=0,u=r;s<u.length;s++){var l=u[s],c=ca(l);c&&i.push({level:c,size:n.size,scale:l/n.size,up:n.up,down:n.down,right:n.right,left:n.left,front:n.front,back:n.back})}var d={up:n.up,down:n.down,right:n.right,left:n.left,front:n.front,back:n.back,sizeList:r};i&&(d.tiles=i);var p={accessibleIds:[],accessibleNodes:[],active:!0,floorIndex:0,images:d,index:0,loadable:!1,pano:{workCode:t.workCode,panoIndex:0},panoId:"".concat(t.workCode,"[0]"),panoIndex:0,position:new f.Vector3(0,1.5,0),quaternion:new f.Quaternion(0,1,0,0),standingPosition:new f.Vector3(0,0,0),visibleIds:[],visibleNodes:[],work:t};return t.observers=[p],ln(t),Bi.set(t,{works:[JSON.stringify(n)],options:"{}"}),t}function hi(n,t){typeof n=="string"&&n.trim()[0]==="{"&&(n=JSON.parse(n));var e=Bi.get(n);if(e){if(t&&!Bo(JSON.parse(e.options),t))throw new Error("[PARSE FAILED]: work is parsed with different options.");return n}else try{return new as(n,t!=null?t:{})}catch(r){throw new Error("[PARSE FAILED]: "+r.message+`
|
|
1039
1039
|
Error work input:
|
|
1040
|
-
`+JSON.stringify(n))}}function Lo(n){for(var t={},e=[],r={},i=0,a=n;i<a.length;i++){var o=a[i],s=t[o.workCode];s||(s=t[o.workCode]=new f.Matrix4().copy(o.transform));for(var u=0,l=o.observers;u<l.length;u++){var c=l[u],d={isResolved:!0,active:c.active,accessibleIds:c.accessibleIds,visibleIds:c.visibleIds,accessibleNodes:c.accessibleNodes,visibleNodes:c.visibleNodes,floorIndex:c.floorIndex,images:c.images,index:c.index,panoIndex:c.panoIndex,loadable:c.loadable,panoId:c.panoId,pano:c.pano,work:c.work,derivedId:c.derivedId,video:c.video,position:new f.Vector3().copy(c.position).applyMatrix4(s),standingPosition:new f.Vector3().copy(c.standingPosition).applyMatrix4(s),quaternion:new f.Quaternion().setFromRotationMatrix(x0.makeRotationFromQuaternion(c.quaternion).premultiply(s))};Object.freeze(d),e.push(d),r[d.panoId]=d}}Object.freeze(e);for(var p=n.slice(),A={},h=0,v=p;h<v.length;h++){var o=v[h];A[o.workCode]=o}return Object.freeze(Object.assign(p,{get initial(){return p.length>0?p[0].initial:{work:{}}},get resolvedObservers(){return e},getWork:function(g){return A[g]},getResolvedObserver:function(g){var m,y;return Au(g)?r[g]:typeof g=="number"?r[He({workCode:(y=(m=n[0])===null||m===void 0?void 0:m.workCode)!==null&&y!==void 0?y:"",panoIndex:g})]:r[He(g)]},update:function(){for(var g=0,m=p;g<m.length;g++){var y=m[g],b=y.transform,x=t[y.workCode];x?x.equals(b)||(x.copy(b),$n.add(y.workCode)):(t[y.workCode]=new f.Matrix4().copy(b),$n.add(y.workCode))}if($n.size>0){for(var w=0,M=e;w<M.length;w++){var S=M[w];if($n.has(S.work.workCode)){var E=S.work.observers[S.index],P=S.work.transform;S.position.copy(E.position).applyMatrix4(P),S.standingPosition.copy(E.standingPosition).applyMatrix4(P),S.quaternion.setFromRotationMatrix(x0.makeRotationFromQuaternion(E.quaternion).premultiply(P))}}$n.clear()}}}))}var Fl=new Map;function pt(n){var t=Fl.get(n);if(t)return t;throw new Error("fetcher never registered.")}function Ov(n,t){return Fl.set(n,t)}var M0={computeTangents:function(n){var t=n.index,e=n.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0){console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");return}var r=t.array,i=e.position.array,a=e.normal.array,o=e.uv.array,s=i.length/3;e.tangent===void 0&&n.setAttribute("tangent",new f.BufferAttribute(new Float32Array(4*s),4));for(var u=e.tangent.array,l=[],c=[],d=0;d<s;d++)l[d]=new f.Vector3,c[d]=new f.Vector3;var p=new f.Vector3,A=new f.Vector3,h=new f.Vector3,v=new f.Vector2,g=new f.Vector2,m=new f.Vector2,y=new f.Vector3,b=new f.Vector3;function x(q,G,K){p.fromArray(i,q*3),A.fromArray(i,G*3),h.fromArray(i,K*3),v.fromArray(o,q*2),g.fromArray(o,G*2),m.fromArray(o,K*2);var _=A.x-p.x,J=h.x-p.x,W=A.y-p.y,$=h.y-p.y,Y=A.z-p.z,Z=h.z-p.z,oe=g.x-v.x,ne=m.x-v.x,de=g.y-v.y,se=m.y-v.y,ye=1/(oe*se-ne*de);y.set((se*_-de*J)*ye,(se*W-de*$)*ye,(se*Y-de*Z)*ye),b.set((oe*J-ne*_)*ye,(oe*$-ne*W)*ye,(oe*Z-ne*Y)*ye),l[q].add(y),l[G].add(y),l[K].add(y),c[q].add(b),c[G].add(b),c[K].add(b)}var w=n.groups;w.length===0&&(w=[{start:0,count:r.length}]);for(var d=0,M=w.length;d<M;++d)for(var S=w[d],E=S.start,P=S.count,B=E,C=E+P;B<C;B+=3)x(r[B+0],r[B+1],r[B+2]);var I=new f.Vector3,F=new f.Vector3,T=new f.Vector3,L=new f.Vector3,D,V,z;function U(q){T.fromArray(a,q*3),L.copy(T),V=l[q],I.copy(V),I.sub(T.multiplyScalar(T.dot(V))).normalize(),F.crossVectors(L,V),z=F.dot(c[q]),D=z<0?-1:1,u[q*4]=I.x,u[q*4+1]=I.y,u[q*4+2]=I.z,u[q*4+3]=D}for(var d=0,M=w.length;d<M;++d)for(var S=w[d],E=S.start,P=S.count,B=E,C=E+P;B<C;B+=3)U(r[B+0]),U(r[B+1]),U(r[B+2])},mergeBufferGeometries:function(n,t){for(var e=n[0].index!==null,r=new Set(Object.keys(n[0].attributes)),i=new Set(Object.keys(n[0].morphAttributes)),a={},o={},s=new f.BufferGeometry,u=0,l=0;l<n.length;++l){var c=n[l];if(e!==(c.index!==null))return null;for(var d in c.attributes){if(!r.has(d))return null;a[d]===void 0&&(a[d]=[]),a[d].push(c.attributes[d])}for(var d in c.morphAttributes){if(!i.has(d))return null;o[d]===void 0&&(o[d]=[]),o[d].push(c.morphAttributes[d])}if(s.userData.mergedUserData=s.userData.mergedUserData||[],s.userData.mergedUserData.push(c.userData),t){var p;if(e)p=c.index.count;else if(c.attributes.position!==void 0)p=c.attributes.position.count;else return null;s.addGroup(u,p,l),u+=p}}if(e){for(var A=0,h=[],l=0;l<n.length;++l){for(var v=n[l].index,g=0;g<v.count;++g)h.push(v.getX(g)+A);A+=n[l].attributes.position.count}s.setIndex(h)}for(var d in a){var m=this.mergeBufferAttributes(a[d]);if(!m)return null;s.setAttribute(d,m)}for(var d in o){var y=o[d][0].length;if(y===0)break;s.morphAttributes=s.morphAttributes||{},s.morphAttributes[d]=[];for(var l=0;l<y;++l){for(var b=[],g=0;g<o[d].length;++g)b.push(o[d][g][l]);var x=this.mergeBufferAttributes(b);if(!x)return null;s.morphAttributes[d].push(x)}}return s},mergeBufferAttributes:function(n){for(var t,e,r,i=0,a=0;a<n.length;++a){var o=n[a];if(o.isInterleavedBufferAttribute||(t===void 0&&(t=o.array.constructor),t!==o.array.constructor)||(e===void 0&&(e=o.itemSize),e!==o.itemSize)||(r===void 0&&(r=o.normalized),r!==o.normalized))return null;i+=o.array.length}for(var s=new t(i),u=0,a=0;a<n.length;++a)s.set(n[a].array,u),u+=n[a].array.length;return new f.BufferAttribute(s,e,r)},interleaveAttributes:function(n){for(var t,e=0,r=0,i=0,a=n.length;i<a;++i){var o=n[i];if(t===void 0&&(t=o.array.constructor),t!==o.array.constructor)return console.warn("AttributeBuffers of different types cannot be interleaved"),null;e+=o.array.length,r+=o.itemSize}for(var s=new f.InterleavedBuffer(new t(e),r),u=0,l=[],c=["getX","getY","getZ","getW"],d=["setX","setY","setZ","setW"],p=0,a=n.length;p<a;p++){var o=n[p],A=o.itemSize,h=o.count,v=new f.InterleavedBufferAttribute(s,A,u,o.normalized);l.push(v),u+=A;for(var g=0;g<h;g++)for(var m=0;m<A;m++)v[d[m]](g,o[c[m]](g))}return l},estimateBytesUsed:function(n){var t=0;for(var e in n.attributes){var r=n.getAttribute(e);t+=r.count*r.itemSize*r.array.BYTES_PER_ELEMENT}var i=n.getIndex();return t+=i?i.count*i.itemSize*i.array.BYTES_PER_ELEMENT:0,t},mergeVertices:function(n,t){t===void 0&&(t=1e-4),t=Math.max(t,Number.EPSILON);for(var e={},r=n.getIndex(),i=n.getAttribute("position"),a=r?r.count:i.count,o=0,s=Object.keys(n.attributes),u={},l={},c=[],d=["getX","getY","getZ","getW"],p=0,A=s.length;p<A;p++){var h=s[p];u[h]=[];var v=n.morphAttributes[h];v&&(l[h]=new Array(v.length).fill().map(function(){return[]}))}for(var g=Math.log10(1/t),m=Math.pow(10,g),p=0;p<a;p++){for(var y=r?r.getX(p):p,b="",x=0,A=s.length;x<A;x++)for(var h=s[x],w=n.getAttribute(h),M=w.itemSize,S=0;S<M;S++)b+="".concat(~~(w[d[S]](y)*m),",");if(b in e)c.push(e[b]);else{for(var x=0,A=s.length;x<A;x++)for(var h=s[x],w=n.getAttribute(h),v=n.morphAttributes[h],M=w.itemSize,E=u[h],P=l[h],S=0;S<M;S++){var B=d[S];if(E.push(w[B](y)),v)for(var C=0,I=v.length;C<I;C++)P[C].push(v[C][B](y))}e[b]=o,c.push(o),o++}}for(var F=n.clone(),p=0,A=s.length;p<A;p++){var h=s[p],T=n.getAttribute(h),L=new T.array.constructor(u[h]),w=new f.BufferAttribute(L,T.itemSize,T.normalized);if(F.setAttribute(h,w),h in l)for(var x=0;x<l[h].length;x++){var D=n.morphAttributes[h][x],L=new D.array.constructor(l[h][x]),V=new f.BufferAttribute(L,D.itemSize,D.normalized);F.morphAttributes[h][x]=V}}return F.setIndex(c),F}};function ko(n){switch(n){case"Floorplan":return!0;case"Mapview":return!0;default:return!1}}function yi(n){switch(n){case"Panorama":return!0;case"VRPanorama":return!0;case"XRPanorama":return!0;case"Model":return!0;default:return!1}}var vr=new f.Vector3,to=new f.Sphere,ro=new f.Matrix4,S0=new f.Matrix4,C0=new f.Box3,Zi=new f.Matrix4().fromArray([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),Yi=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]),Ll=new f.Box3(new f.Vector3(-.5,-.5,-.5),new f.Vector3(.5,.5,.5));function E0(n,t,e){switch(n){case"Z":break;case"Y":e.copy(Yi);break;case"-Y":e.copy(Zi);break;case"WGS84":case"GCJ02":case"BD09":Mv(t,e);break;default:e.identity();break}return e}function Dv(n){var t=/([0-9a-z\.\_\-]+)([\?\#].*)?$/i.exec(n);if(t){var e=String(t[1]).trim().split(".").slice(1).reverse()[0];if(e)return e}return""}var $i=function(){function n(t,e){this.scene=t,this.error=e,t.viewLayer=this}return Object.defineProperty(n.prototype,"name",{get:function(){return this.scene.name},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"type",{get:function(){return this.scene.type},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"upAxis",{get:function(){return this.scene.upAxis},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"groundHeight",{get:function(){return this.scene.groundHeight},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"model",{get:function(){return this.scene.model},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"coordinates",{get:function(){vr.setScalar(0);var t=this.scene.localToLla(vr),e=t.x,r=t.y;return[e,r].map(function(i){return(i/Math.PI*180).toFixed(6)}).join(",")},enumerable:!1,configurable:!0}),n.prototype.getTransformMatrix4=function(t){return t===void 0&&(t=new f.Matrix4),t.copy(this.scene.coordinateTransform.ecefToLocalMatrix),this.scene&&t.premultiply(this.scene.matrixWorld),t},n.prototype.coordinatesToWorldPoint=function(t){var e=new f.Vector3(t.latitude,t.longitude,t.altitude);return this.scene.llaToWorld(e)},n.prototype.worldPointToCoordinates=function(t){return vr.copy(t),this.scene.worldToLla(vr),{latitude:vr.x,longitude:vr.y,altitude:vr.z}},n}(),Oo=function(n){ue(t,n);function t(e){e===void 0&&(e={});var r,i,a,o=n.call(this)||this;return o.name="",o.onError=(r=e.onError)!==null&&r!==void 0?r:Q,o.onShownFloorChange=(i=e.onShownFloorChange)!==null&&i!==void 0?i:Q,o.onLoad=(a=e.onLoad)!==null&&a!==void 0?a:Q,o.work=null,o.viewLayers=[],o.bounding=new f.Box3(new f.Vector3,new f.Vector3),o.floorLength=0,o.textureOptions={},o.refined=!1,o.refineProgress=[0,0],o.loaded=!1,o.matrixAutoUpdate=!1,o.needsRender=!0,o.autoRefine=!0,o.materialVersion=0,o.materialParameters=O({},ge),o.cacheCameras=[],o.disposed=!1,o}return Object.defineProperty(t.prototype,"empty",{get:function(){return this.viewLayers.length===0},enumerable:!1,configurable:!0}),t.prototype.getMaterial=function(){return O({},this.materialParameters)},t.prototype.setMaterial=function(e){var r=this.materialParameters.shownFloorIndex,i=yu(this.materialParameters,e);if(i){var a=this.materialParameters.shownFloorIndex;r!==a&&this.onShownFloorChange(a),this.materialVersion++,this.needsRender=!0}},Object.defineProperty(t.prototype,"brightness",{get:function(){return this.materialParameters.brightness},set:function(e){this.setMaterial({brightness:typeof e=="number"?e:1})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shownFloorIndex",{get:function(){return this.materialParameters.shownFloorIndex},set:function(e){this.setMaterial({shownFloorIndex:e})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shownFloor",{get:function(){return this.shownFloorIndex===-1?null:this.shownFloorIndex},set:function(e){this.shownFloorIndex=e===null?-1:e},enumerable:!1,configurable:!0}),t.prototype.show=function(e){this.shownFloor=e!=null?e:null},Object.defineProperty(t.prototype,"clippers",{get:function(){return this.materialParameters.clippers},set:function(e){this.setMaterial({clippers:e})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"customShaders",{get:function(){return this.materialParameters.customShaders},set:function(e){this.setMaterial({customShaders:e})},enumerable:!1,configurable:!0}),t.prototype.getEdgesBySphere=function(e,r){r===void 0&&(r=30/180*Math.PI);for(var i=Math.cos(r),a=[],o=0,s=this.children;o<s.length;o++){var u=s[o];u instanceof wn&&u.tileset.selectedTiles.forEach(function(l){var c,d,p;if(!(l.boundingVolume&&l.boundingVolume.distanceToPoint(e.center)>e.radius)){var A=(d=(c=l.content)===null||c===void 0?void 0:c.data)===null||d===void 0?void 0:d.object;if(A&&A.visible){var h=[];if(A.traverseVisible(function(K){if(K instanceof f.Mesh){var _=Qd.get(K);if(_){ro.copy(K.matrixWorld),S0.getInverse(ro),to.copy(e).applyMatrix4(S0);var J=_.trianglesInSphere(to.center,to.radius),W=new f.BufferGeometry;W.setAttribute("position",new f.BufferAttribute(J,3)),W.applyMatrix4(K.matrixWorld),W=M0.mergeVertices(W,.01),h.push(W)}}}),h.length===0)return;for(var v=["a","b","c"],g=M0.mergeBufferGeometries(h,!1),m=g.getAttribute("position").array,y=((p=g.getIndex())===null||p===void 0?void 0:p.array)||[],b=[],x=[],w=0,M=m.length;w<M;w+=3){var S=new f.Vector3(m[w],m[w+1],m[w+2]);b.push(S)}for(var w=0,M=y.length;w<M;w+=3){var E=y[w],P=y[w+1],B=y[w+2],C=new f.Vector3().crossVectors(b[P].clone().sub(b[E]),b[B].clone().sub(b[E])).normalize();x.push({a:E,b:P,c:B,normal:C})}for(var I={},w=0,M=x.length;w<M;w++)for(var F=x[w],T=0;T<3;T++){var L=F[v[T]],D=F[v[(T+1)%3]],V=[Math.min(L,D),Math.max(L,D)],z=V[0]+"-"+V[1];I[z]===void 0?I[z]={index1:V[0],index2:V[1],face1:w}:I[z].face2=w}for(var z in I){var U=I[z];if(U.face2===void 0||x[U.face1].normal.dot(x[U.face2].normal)<=i){var q=b[U.index1],G=b[U.index2];a.push(new f.Line3(q,G))}}b.length=0,x.length=0}}})}return a},t.prototype.intersectRaycaster=function(e,r,i){r===void 0&&(r=null),i===void 0&&(i=!0);for(var a=[],o=0,s=this.children.length;o<s;o++){var u=this.children[o];u.visible&&u instanceof wn&&u.intersectRaycaster(e,!1,a)}return r!=null&&(a=a.filter(function(l){return l.floor===r})),this.getMaterial().pointBack==="HIDDEN"&&(a=a.filter(function(l){return!(l.object instanceof yr&&l.face&&l.face.normal.angleTo(e.ray.direction)<Math.PI/2)})),i&&a.sort(function(l,c){return l.distance-c.distance}),a},t.prototype.load=function(e,r){var i,a=this,o,s,u,l;if(r===void 0&&(r={}),this.work=e,this.name=this.work.workCode,!e.model)return Promise.resolve();for(var c=e.model,d=0,p=0,A=e.observers;p<A.length;p++){var h=A[p];d=Math.max(d,h.floorIndex)}this.floorLength=d+1;for(var v=!1,g=[],m=function(W){var $=W.tileset,Y=W.upAxis,Z=W.name,oe=W.type;oe==="mesh"&&(v=!0);var ne=$.split("#"),de=ne[0],se=ne[1],ye=(o=(se||de).split("?")[1])!==null&&o!==void 0?o:"",ie=typeof r["3d-tiles"]=="function"?r["3d-tiles"](W):(s=r["3d-tiles"])!==null&&s!==void 0?s:{},xe=pt(e).ajax($,{responseType:"text"}).then(function(Le){var Ce,Oe=$?$.slice(0,$.lastIndexOf("/")+1):"",ee=Wi(JSON.parse(Le.body),Oe),re=ee.root,H=ee.rootMeta,Be=H===void 0?{}:H;Be.upAxis&&Be.upAxis!==Y&&(Y=Be.upAxis),"lodVersion"in ee&&(Y="-Y","floorInfo"in ee&&(ee.properties=ee.properties||{},ee.properties.floorInfo=ee.floorInfo.map(function(St){return{ground:-St.ground,height:St.height}}),delete ee.floorInfo),ee.asset.tilesetVersion=String(ee.lodVersion),delete ee.lodVersion);var Te=re.boundingVolume?Mn(re.boundingVolume):void 0;Te&&re.transform&&Te.applyMatrix4(ro.fromArray(re.transform));var Ee=null,Qe=new f.Matrix4,Ie=new f.Matrix4;Be.coordinate?(Ee=Be.coordinate.ground_height,Qe.fromArray(Be.coordinate.pose_ecef_to_enu),Ie.fromArray(Be.coordinate.pose_enu_to_ecef)):(Te?Te.getCenter(vr):vr.setScalar(0),E0(Y,vr,Qe),Ie.getInverse(Qe));var we=new f.Matrix4().copy(Zi),be=new f.Matrix4().copy(Yi),Ae=new f.Matrix4().premultiply(Qe).premultiply(we),me=new f.Matrix4().getInverse(Ae),ze;if(ie.viewerRequestVolume){var pe=Va(ie.viewerRequestVolume)?ie.viewerRequestVolume:Mn(ie.viewerRequestVolume);pe.applyMatrix4(me),ze=pe.toJson()}ee.root={refine:(Ce=re.refine)!==null&&Ce!==void 0?Ce:"REPLACE",geometricError:re.geometricError,transform:Ae.toArray(),boundingVolume:Te?Te.toJson():void 0,viewerRequestVolume:ze,children:[re]};var Se=new wn(a,ee,{name:Z,type:oe,upAxis:Y,url:$,referer:$,search:ye,fetcher:pt(e),groundHeight:Ee,coordinateTransform:{localToEnuMatrix:be,enuToLocalMatrix:we,enuToEcefMatrix:Ie,ecefToEnuMatrix:Qe,localToEcefMatrix:me,ecefToLocalMatrix:Ae}});return Se.matrix.copy(e.transform),Se.matrix.decompose(Se.position,Se.quaternion,Se.scale),Se.matrixWorldNeedsUpdate=!0,Object.assign(Se.maxMemoryUsage,Se.getRecommendProps()),typeof ie.debug!="undefined"&&(Se.debug=ie.debug),typeof ie.minLevelOfDetail!="undefined"&&(Se.minLevelOfDetail=ie.minLevelOfDetail),typeof ie.maxLevelOfDetail!="undefined"&&(Se.maxLevelOfDetail=ie.maxLevelOfDetail),typeof ie.skipLevelOfDetail!="undefined"&&(Se.skipLevelOfDetail=ie.skipLevelOfDetail),typeof ie.mostDetail!="undefined"&&(Se.mostDetail=ie.mostDetail),typeof ie.loadSiblings!="undefined"&&(Se.loadSiblings=ie.loadSiblings),typeof ie.loadAll!="undefined"&&(Se.loadAll=ie.loadAll),typeof ie.maxMemoryUsage!="undefined"&&(Se.maxMemoryUsage=ie.maxMemoryUsage),typeof ie.maxRequests!="undefined"&&(Se.maxRequests=ie.maxRequests),typeof ie.requestOrder!="undefined"&&(Se.requestOrder=ie.requestOrder),typeof ie.maxScreenSpaceError!="undefined"&&(Se.maxScreenSpaceError=ie.maxScreenSpaceError),(ie.showLayers===!1||Array.isArray(ie.showLayers)&&ie.showLayers.indexOf(Z)===-1)&&(Se.visible=!1),new $i(Se,null)});g.push(xe.catch(function(Le){a.onError(Le);var Ce=new f.Matrix4,Oe=new f.Matrix4,ee=new f.Matrix4().copy(Zi),re=new f.Matrix4().copy(Yi),H=new f.Matrix4().premultiply(Ce).premultiply(ee),Be=new f.Matrix4().getInverse(H),Te=$?$.slice(0,$.lastIndexOf("/")+1):"",Ee;if(ie.viewerRequestVolume){var Qe=Va(ie.viewerRequestVolume)?ie.viewerRequestVolume:Mn(ie.viewerRequestVolume);Qe.applyMatrix4(Be),Ee=Qe.toJson()}var Ie=Wi({asset:{version:"0.0"},geometricError:0,viewerRequestVolume:Ee,root:{geometricError:0}},Te),we=new wn(a,Ie,{name:Z,type:oe,upAxis:Y,url:$,referer:$,search:ye,fetcher:pt(e),groundHeight:null,coordinateTransform:{localToEnuMatrix:re,enuToLocalMatrix:ee,enuToEcefMatrix:Oe,ecefToEnuMatrix:Ce,localToEcefMatrix:Be,ecefToLocalMatrix:H},onError:a.onError});return we.matrix.copy(e.transform),we.matrix.decompose(we.position,we.quaternion,we.scale),we.matrixWorldNeedsUpdate=!0,(ie.showLayers===!1||Array.isArray(ie.showLayers)&&ie.showLayers.indexOf(Z)===-1)&&(we.visible=!1),new $i(we,Le)}))},y=0,b=c.layers;y<b.length;y++){var x=b[y];m(x)}if(!v&&c.file){var w=c.file,M=c.textureBase,S=c.textures,E="fallback",P="mesh",B="Z",C="",x={name:E,type:P,upAxis:B,tileset:C},I=typeof r["3d-tiles"]=="function"?r["3d-tiles"](x):(u=r["3d-tiles"])!==null&&u!==void 0?u:{},F=Dv(w)||"at3d",T=new f.Matrix4,L=new f.Matrix4,D=new f.Matrix4().copy(Zi),V=new f.Matrix4().copy(Yi);E0(B,vr.setScalar(0),T),L.getInverse(T);var z=new f.Matrix4().premultiply(T).premultiply(D),U=new f.Matrix4().getInverse(z),q=void 0;if(I.viewerRequestVolume){var G=Va(I.viewerRequestVolume)?I.viewerRequestVolume:Mn(I.viewerRequestVolume);G.applyMatrix4(U),q=G.toJson()}var K=Wi({asset:{version:"0.0"},geometricError:0,root:{refine:"REPLACE",geometricError:0,transform:z.toArray(),viewerRequestVolume:q,content:{uri:w},extras:(i={},i[F]={textureBaseUri:M,textureArray:S,textureOptions:(l=r.textureOptions)!==null&&l!==void 0?l:{}},i)}},""),_=new wn(this,K,{name:E,type:P,upAxis:B,url:C,referer:w,fetcher:pt(e),groundHeight:null,coordinateTransform:{localToEnuMatrix:V,enuToLocalMatrix:D,enuToEcefMatrix:L,ecefToEnuMatrix:T,localToEcefMatrix:U,ecefToLocalMatrix:z},onError:this.onError});_.matrix.copy(e.transform),_.matrix.decompose(_.position,_.quaternion,_.scale),_.matrixWorldNeedsUpdate=!0,(I.showLayers===!1||Array.isArray(I.showLayers)&&I.showLayers.indexOf(E)===-1)&&(_.visible=!1);var J=new $i(_,null);g.push(Promise.resolve(J))}return Promise.all(g).then(function(W){for(var $=0,Y=W;$<Y.length;$++){var Z=Y[$];if(a.disposed){Z.scene.dispose();continue}a.viewLayers.push(Z),a.add(Z.scene)}})},t.prototype.update=function(e,r,i){if(this.children.length){var a=this.loaded;this.refined=this.work!==null,this.refineProgress[0]=0,this.refineProgress[1]=0,this.loaded=this.work!==null;for(var o=0,s=this.viewLayers;o<s.length;o++){var u=s[o],l=u.scene;l&&(this.work&&(l.cacheCameras=this.cacheCameras,this.autoRefine===!1?l.needsRefined=!1:yi(i)?l.needsRefined=this.materialParameters.modelAlpha===0||this.materialParameters.modelAlpha===1:l.needsRefined=!0,this.work.transform.equals(l.matrix)||(l.matrix.copy(this.work.transform),l.matrix.decompose(l.position,l.quaternion,l.scale),l.matrixWorldNeedsUpdate=!0)),l.update(e,r,i),l.needsRender===!0&&(l.needsRender=!1,this.needsRender=!0),l.refined===!1&&(this.refined=!1),this.refineProgress[0]+=l.refineProgress[0],this.refineProgress[1]+=l.refineProgress[1],l.loaded===!1&&(this.loaded=!1))}this.bounding.makeEmpty();for(var c=0,d=this.viewLayers;c<d.length;c++){var u=d[c],l=u.scene;l&&(l.boundingBox.isEmpty()||(C0.copy(l.boundingBox).applyMatrix4(l.matrix),this.bounding.union(C0)))}this.bounding.isEmpty()&&this.bounding.copy(Ll),a===!1&&this.loaded===!0&&this.onLoad()}else this.work&&!this.work.model?(this.refined=!0,this.refineProgress[0]=0,this.refineProgress[1]=0,this.loaded=!0):(this.refined=!1,this.refineProgress[0]=0,this.refineProgress[1]=0,this.loaded=!1),this.bounding.set(new f.Vector3,new f.Vector3)},t.prototype.dispose=function(){this.disposed=!0;for(var e;e=this.children[0];)e instanceof wn&&e.dispose(),this.remove(e)},t}(f.Object3D);function I0(){var n=new f.Box3,t=Aa(ge,["clippers","shownFloorIndex","brightness","customShaders"]),e=Object.assign([],{bounding:n,needsRender:!1,refined:!1,refineProgress:[0,0],loaded:!1,materialVersion:0,cacheCameras:[],autoUpdate:!0,intersectRaycaster:function(r,i,a){a===void 0&&(a=!0);var o;if(e.length===1)o=e[0].intersectRaycaster(r,i,a);else if(e.length===0)o=[];else{o=[];for(var s=0,u=e;s<u.length;s++){var l=u[s];if(l.visible){var c=l.intersectRaycaster(r,i,!1);c.length&&o.push.apply(o,c)}}a&&o.sort(function(d,p){return d.distance-p.distance})}return o},setMaterial:function(r){var i=yu(t,r);i&&(e.materialVersion++,e.needsRender=!0)},getMaterial:function(){return O({},t)},resetBrightness:function(){for(var r=0,i=e;r<i.length;r++){var a=i[r];a.setMaterial({brightness:1})}},update:function(r,i,a){e.refined=e.length>0,e.loaded=e.length>0,e.refineProgress[0]=0,e.refineProgress[1]=0,n.makeEmpty();for(var o=0,s=e.cacheCameras;o<s.length;o++){var u=s[o];u.updateMatrixWorld(!0),u.updateProjectionMatrix()}for(var l=0,c=0,d=e;c<d.length;c++){for(var p=d[c],A=0,h=p.viewLayers;A<h.length;A++){var v=h[A];v.scene.modelIndex=l++}p.setMaterial(t),p.cacheCameras=e.cacheCameras,p.autoRefine=this.autoUpdate,p.update(r,i,a),p.needsRender===!0&&(e.needsRender=!0,p.needsRender=!1),p.refined===!1&&(e.refined=!1),e.refineProgress[0]+=p.refineProgress[0],e.refineProgress[1]+=p.refineProgress[1],p.loaded===!1&&(e.loaded=!1),n.union(p.bounding)}for(var g=0,m=e;g<m.length;g++)for(var p=m[g],y=0,b=p.viewLayers;y<b.length;y++){var v=b[y];v.scene.modelsLoaded=e.loaded}n.isEmpty()&&n.copy(Ll)}});return e}var T0=function(n){return n*(2-n)},Vv=function(){var n=new Float32Array([-.18,0,-.18,.18,0,-.18,-.18,0,.18,.18,0,.18]),t=new Float32Array([1,0,0,0,1,1,0,1]),e=new Uint8Array([0,2,1,2,3,1]),r=new f.BufferGeometry;return r.setAttribute("position",new f.BufferAttribute(n,3)),r.setAttribute("uv",new f.BufferAttribute(t,2)),r.setIndex(new f.BufferAttribute(e,1)),r}(),Nv=`
|
|
1040
|
+
`+JSON.stringify(n))}}function Lo(n){for(var t={},e=[],r={},i=0,a=n;i<a.length;i++){var o=a[i],s=t[o.workCode];s||(s=t[o.workCode]=new f.Matrix4().copy(o.transform));for(var u=0,l=o.observers;u<l.length;u++){var c=l[u],d={isResolved:!0,active:c.active,accessibleIds:c.accessibleIds,visibleIds:c.visibleIds,accessibleNodes:c.accessibleNodes,visibleNodes:c.visibleNodes,floorIndex:c.floorIndex,images:c.images,index:c.index,panoIndex:c.panoIndex,loadable:c.loadable,panoId:c.panoId,pano:c.pano,work:c.work,derivedId:c.derivedId,video:c.video,position:new f.Vector3().copy(c.position).applyMatrix4(s),standingPosition:new f.Vector3().copy(c.standingPosition).applyMatrix4(s),quaternion:new f.Quaternion().setFromRotationMatrix(x0.makeRotationFromQuaternion(c.quaternion).premultiply(s))};Object.freeze(d),e.push(d),r[d.panoId]=d}}Object.freeze(e);for(var p=n.slice(),A={},h=0,v=p;h<v.length;h++){var o=v[h];A[o.workCode]=o}return Object.freeze(Object.assign(p,{get initial(){return p.length>0?p[0].initial:{work:{}}},get resolvedObservers(){return e},getWork:function(g){return A[g]},getResolvedObserver:function(g){var m,y;return Au(g)?r[g]:typeof g=="number"?r[He({workCode:(y=(m=n[0])===null||m===void 0?void 0:m.workCode)!==null&&y!==void 0?y:"",panoIndex:g})]:r[He(g)]},update:function(){for(var g=0,m=p;g<m.length;g++){var y=m[g],b=y.transform,x=t[y.workCode];x?x.equals(b)||(x.copy(b),$n.add(y.workCode)):(t[y.workCode]=new f.Matrix4().copy(b),$n.add(y.workCode))}if($n.size>0){for(var w=0,M=e;w<M.length;w++){var S=M[w];if($n.has(S.work.workCode)){var E=S.work.observers[S.index],B=S.work.transform;S.position.copy(E.position).applyMatrix4(B),S.standingPosition.copy(E.standingPosition).applyMatrix4(B),S.quaternion.setFromRotationMatrix(x0.makeRotationFromQuaternion(E.quaternion).premultiply(B))}}$n.clear()}}}))}var Fl=new Map;function pt(n){var t=Fl.get(n);if(t)return t;throw new Error("fetcher never registered.")}function Ov(n,t){return Fl.set(n,t)}var M0={computeTangents:function(n){var t=n.index,e=n.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0){console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");return}var r=t.array,i=e.position.array,a=e.normal.array,o=e.uv.array,s=i.length/3;e.tangent===void 0&&n.setAttribute("tangent",new f.BufferAttribute(new Float32Array(4*s),4));for(var u=e.tangent.array,l=[],c=[],d=0;d<s;d++)l[d]=new f.Vector3,c[d]=new f.Vector3;var p=new f.Vector3,A=new f.Vector3,h=new f.Vector3,v=new f.Vector2,g=new f.Vector2,m=new f.Vector2,y=new f.Vector3,b=new f.Vector3;function x(q,G,K){p.fromArray(i,q*3),A.fromArray(i,G*3),h.fromArray(i,K*3),v.fromArray(o,q*2),g.fromArray(o,G*2),m.fromArray(o,K*2);var j=A.x-p.x,J=h.x-p.x,W=A.y-p.y,$=h.y-p.y,Y=A.z-p.z,Z=h.z-p.z,oe=g.x-v.x,ne=m.x-v.x,de=g.y-v.y,se=m.y-v.y,ye=1/(oe*se-ne*de);y.set((se*j-de*J)*ye,(se*W-de*$)*ye,(se*Y-de*Z)*ye),b.set((oe*J-ne*j)*ye,(oe*$-ne*W)*ye,(oe*Z-ne*Y)*ye),l[q].add(y),l[G].add(y),l[K].add(y),c[q].add(b),c[G].add(b),c[K].add(b)}var w=n.groups;w.length===0&&(w=[{start:0,count:r.length}]);for(var d=0,M=w.length;d<M;++d)for(var S=w[d],E=S.start,B=S.count,R=E,C=E+B;R<C;R+=3)x(r[R+0],r[R+1],r[R+2]);var I=new f.Vector3,L=new f.Vector3,T=new f.Vector3,F=new f.Vector3,D,V,z;function U(q){T.fromArray(a,q*3),F.copy(T),V=l[q],I.copy(V),I.sub(T.multiplyScalar(T.dot(V))).normalize(),L.crossVectors(F,V),z=L.dot(c[q]),D=z<0?-1:1,u[q*4]=I.x,u[q*4+1]=I.y,u[q*4+2]=I.z,u[q*4+3]=D}for(var d=0,M=w.length;d<M;++d)for(var S=w[d],E=S.start,B=S.count,R=E,C=E+B;R<C;R+=3)U(r[R+0]),U(r[R+1]),U(r[R+2])},mergeBufferGeometries:function(n,t){for(var e=n[0].index!==null,r=new Set(Object.keys(n[0].attributes)),i=new Set(Object.keys(n[0].morphAttributes)),a={},o={},s=new f.BufferGeometry,u=0,l=0;l<n.length;++l){var c=n[l];if(e!==(c.index!==null))return null;for(var d in c.attributes){if(!r.has(d))return null;a[d]===void 0&&(a[d]=[]),a[d].push(c.attributes[d])}for(var d in c.morphAttributes){if(!i.has(d))return null;o[d]===void 0&&(o[d]=[]),o[d].push(c.morphAttributes[d])}if(s.userData.mergedUserData=s.userData.mergedUserData||[],s.userData.mergedUserData.push(c.userData),t){var p;if(e)p=c.index.count;else if(c.attributes.position!==void 0)p=c.attributes.position.count;else return null;s.addGroup(u,p,l),u+=p}}if(e){for(var A=0,h=[],l=0;l<n.length;++l){for(var v=n[l].index,g=0;g<v.count;++g)h.push(v.getX(g)+A);A+=n[l].attributes.position.count}s.setIndex(h)}for(var d in a){var m=this.mergeBufferAttributes(a[d]);if(!m)return null;s.setAttribute(d,m)}for(var d in o){var y=o[d][0].length;if(y===0)break;s.morphAttributes=s.morphAttributes||{},s.morphAttributes[d]=[];for(var l=0;l<y;++l){for(var b=[],g=0;g<o[d].length;++g)b.push(o[d][g][l]);var x=this.mergeBufferAttributes(b);if(!x)return null;s.morphAttributes[d].push(x)}}return s},mergeBufferAttributes:function(n){for(var t,e,r,i=0,a=0;a<n.length;++a){var o=n[a];if(o.isInterleavedBufferAttribute||(t===void 0&&(t=o.array.constructor),t!==o.array.constructor)||(e===void 0&&(e=o.itemSize),e!==o.itemSize)||(r===void 0&&(r=o.normalized),r!==o.normalized))return null;i+=o.array.length}for(var s=new t(i),u=0,a=0;a<n.length;++a)s.set(n[a].array,u),u+=n[a].array.length;return new f.BufferAttribute(s,e,r)},interleaveAttributes:function(n){for(var t,e=0,r=0,i=0,a=n.length;i<a;++i){var o=n[i];if(t===void 0&&(t=o.array.constructor),t!==o.array.constructor)return console.warn("AttributeBuffers of different types cannot be interleaved"),null;e+=o.array.length,r+=o.itemSize}for(var s=new f.InterleavedBuffer(new t(e),r),u=0,l=[],c=["getX","getY","getZ","getW"],d=["setX","setY","setZ","setW"],p=0,a=n.length;p<a;p++){var o=n[p],A=o.itemSize,h=o.count,v=new f.InterleavedBufferAttribute(s,A,u,o.normalized);l.push(v),u+=A;for(var g=0;g<h;g++)for(var m=0;m<A;m++)v[d[m]](g,o[c[m]](g))}return l},estimateBytesUsed:function(n){var t=0;for(var e in n.attributes){var r=n.getAttribute(e);t+=r.count*r.itemSize*r.array.BYTES_PER_ELEMENT}var i=n.getIndex();return t+=i?i.count*i.itemSize*i.array.BYTES_PER_ELEMENT:0,t},mergeVertices:function(n,t){t===void 0&&(t=1e-4),t=Math.max(t,Number.EPSILON);for(var e={},r=n.getIndex(),i=n.getAttribute("position"),a=r?r.count:i.count,o=0,s=Object.keys(n.attributes),u={},l={},c=[],d=["getX","getY","getZ","getW"],p=0,A=s.length;p<A;p++){var h=s[p];u[h]=[];var v=n.morphAttributes[h];v&&(l[h]=new Array(v.length).fill().map(function(){return[]}))}for(var g=Math.log10(1/t),m=Math.pow(10,g),p=0;p<a;p++){for(var y=r?r.getX(p):p,b="",x=0,A=s.length;x<A;x++)for(var h=s[x],w=n.getAttribute(h),M=w.itemSize,S=0;S<M;S++)b+="".concat(~~(w[d[S]](y)*m),",");if(b in e)c.push(e[b]);else{for(var x=0,A=s.length;x<A;x++)for(var h=s[x],w=n.getAttribute(h),v=n.morphAttributes[h],M=w.itemSize,E=u[h],B=l[h],S=0;S<M;S++){var R=d[S];if(E.push(w[R](y)),v)for(var C=0,I=v.length;C<I;C++)B[C].push(v[C][R](y))}e[b]=o,c.push(o),o++}}for(var L=n.clone(),p=0,A=s.length;p<A;p++){var h=s[p],T=n.getAttribute(h),F=new T.array.constructor(u[h]),w=new f.BufferAttribute(F,T.itemSize,T.normalized);if(L.setAttribute(h,w),h in l)for(var x=0;x<l[h].length;x++){var D=n.morphAttributes[h][x],F=new D.array.constructor(l[h][x]),V=new f.BufferAttribute(F,D.itemSize,D.normalized);L.morphAttributes[h][x]=V}}return L.setIndex(c),L}};function ko(n){switch(n){case"Floorplan":return!0;case"Mapview":return!0;default:return!1}}function yi(n){switch(n){case"Panorama":return!0;case"VRPanorama":return!0;case"XRPanorama":return!0;case"Model":return!0;default:return!1}}var vr=new f.Vector3,to=new f.Sphere,ro=new f.Matrix4,S0=new f.Matrix4,C0=new f.Box3,Zi=new f.Matrix4().fromArray([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),Yi=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]),Ll=new f.Box3(new f.Vector3(-.5,-.5,-.5),new f.Vector3(.5,.5,.5));function E0(n,t,e){switch(n){case"Z":break;case"Y":e.copy(Yi);break;case"-Y":e.copy(Zi);break;case"WGS84":case"GCJ02":case"BD09":Mv(t,e);break;default:e.identity();break}return e}function Dv(n){var t=/([0-9a-z\.\_\-]+)([\?\#].*)?$/i.exec(n);if(t){var e=String(t[1]).trim().split(".").slice(1).reverse()[0];if(e)return e}return""}var $i=function(){function n(t,e){this.scene=t,this.error=e,t.viewLayer=this}return Object.defineProperty(n.prototype,"name",{get:function(){return this.scene.name},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"type",{get:function(){return this.scene.type},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"upAxis",{get:function(){return this.scene.upAxis},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"groundHeight",{get:function(){return this.scene.groundHeight},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"model",{get:function(){return this.scene.model},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"coordinates",{get:function(){vr.setScalar(0);var t=this.scene.localToLla(vr),e=t.x,r=t.y;return[e,r].map(function(i){return(i/Math.PI*180).toFixed(6)}).join(",")},enumerable:!1,configurable:!0}),n.prototype.getTransformMatrix4=function(t){return t===void 0&&(t=new f.Matrix4),t.copy(this.scene.coordinateTransform.ecefToLocalMatrix),this.scene&&t.premultiply(this.scene.matrixWorld),t},n.prototype.coordinatesToWorldPoint=function(t){var e=new f.Vector3(t.latitude,t.longitude,t.altitude);return this.scene.llaToWorld(e)},n.prototype.worldPointToCoordinates=function(t){return vr.copy(t),this.scene.worldToLla(vr),{latitude:vr.x,longitude:vr.y,altitude:vr.z}},n}(),Oo=function(n){ue(t,n);function t(e){e===void 0&&(e={});var r,i,a,o=n.call(this)||this;return o.name="",o.onError=(r=e.onError)!==null&&r!==void 0?r:Q,o.onShownFloorChange=(i=e.onShownFloorChange)!==null&&i!==void 0?i:Q,o.onLoad=(a=e.onLoad)!==null&&a!==void 0?a:Q,o.work=null,o.viewLayers=[],o.bounding=new f.Box3(new f.Vector3,new f.Vector3),o.floorLength=0,o.textureOptions={},o.refined=!1,o.refineProgress=[0,0],o.loaded=!1,o.matrixAutoUpdate=!1,o.needsRender=!0,o.autoRefine=!0,o.materialVersion=0,o.materialParameters=O({},ge),o.cacheCameras=[],o.disposed=!1,o}return Object.defineProperty(t.prototype,"empty",{get:function(){return this.viewLayers.length===0},enumerable:!1,configurable:!0}),t.prototype.getMaterial=function(){return O({},this.materialParameters)},t.prototype.setMaterial=function(e){var r=this.materialParameters.shownFloorIndex,i=yu(this.materialParameters,e);if(i){var a=this.materialParameters.shownFloorIndex;r!==a&&this.onShownFloorChange(a),this.materialVersion++,this.needsRender=!0}},Object.defineProperty(t.prototype,"brightness",{get:function(){return this.materialParameters.brightness},set:function(e){this.setMaterial({brightness:typeof e=="number"?e:1})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shownFloorIndex",{get:function(){return this.materialParameters.shownFloorIndex},set:function(e){this.setMaterial({shownFloorIndex:e})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shownFloor",{get:function(){return this.shownFloorIndex===-1?null:this.shownFloorIndex},set:function(e){this.shownFloorIndex=e===null?-1:e},enumerable:!1,configurable:!0}),t.prototype.show=function(e){this.shownFloor=e!=null?e:null},Object.defineProperty(t.prototype,"clippers",{get:function(){return this.materialParameters.clippers},set:function(e){this.setMaterial({clippers:e})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"customShaders",{get:function(){return this.materialParameters.customShaders},set:function(e){this.setMaterial({customShaders:e})},enumerable:!1,configurable:!0}),t.prototype.getEdgesBySphere=function(e,r){r===void 0&&(r=30/180*Math.PI);for(var i=Math.cos(r),a=[],o=0,s=this.children;o<s.length;o++){var u=s[o];u instanceof wn&&u.tileset.selectedTiles.forEach(function(l){var c,d,p;if(!(l.boundingVolume&&l.boundingVolume.distanceToPoint(e.center)>e.radius)){var A=(d=(c=l.content)===null||c===void 0?void 0:c.data)===null||d===void 0?void 0:d.object;if(A&&A.visible){var h=[];if(A.traverseVisible(function(K){if(K instanceof f.Mesh){var j=Qd.get(K);if(j){ro.copy(K.matrixWorld),S0.getInverse(ro),to.copy(e).applyMatrix4(S0);var J=j.trianglesInSphere(to.center,to.radius),W=new f.BufferGeometry;W.setAttribute("position",new f.BufferAttribute(J,3)),W.applyMatrix4(K.matrixWorld),W=M0.mergeVertices(W,.01),h.push(W)}}}),h.length===0)return;for(var v=["a","b","c"],g=M0.mergeBufferGeometries(h,!1),m=g.getAttribute("position").array,y=((p=g.getIndex())===null||p===void 0?void 0:p.array)||[],b=[],x=[],w=0,M=m.length;w<M;w+=3){var S=new f.Vector3(m[w],m[w+1],m[w+2]);b.push(S)}for(var w=0,M=y.length;w<M;w+=3){var E=y[w],B=y[w+1],R=y[w+2],C=new f.Vector3().crossVectors(b[B].clone().sub(b[E]),b[R].clone().sub(b[E])).normalize();x.push({a:E,b:B,c:R,normal:C})}for(var I={},w=0,M=x.length;w<M;w++)for(var L=x[w],T=0;T<3;T++){var F=L[v[T]],D=L[v[(T+1)%3]],V=[Math.min(F,D),Math.max(F,D)],z=V[0]+"-"+V[1];I[z]===void 0?I[z]={index1:V[0],index2:V[1],face1:w}:I[z].face2=w}for(var z in I){var U=I[z];if(U.face2===void 0||x[U.face1].normal.dot(x[U.face2].normal)<=i){var q=b[U.index1],G=b[U.index2];a.push(new f.Line3(q,G))}}b.length=0,x.length=0}}})}return a},t.prototype.intersectRaycaster=function(e,r,i){r===void 0&&(r=null),i===void 0&&(i=!0);for(var a=[],o=0,s=this.children.length;o<s;o++){var u=this.children[o];u.visible&&u instanceof wn&&u.intersectRaycaster(e,!1,a)}return r!=null&&(a=a.filter(function(l){return l.floor===r})),this.getMaterial().pointBack==="HIDDEN"&&(a=a.filter(function(l){return!(l.object instanceof yr&&l.face&&l.face.normal.angleTo(e.ray.direction)<Math.PI/2)})),i&&a.sort(function(l,c){return l.distance-c.distance}),a},t.prototype.load=function(e,r){var i,a=this,o,s,u,l;if(r===void 0&&(r={}),this.work=e,this.name=this.work.workCode,!e.model)return Promise.resolve();for(var c=e.model,d=0,p=0,A=e.observers;p<A.length;p++){var h=A[p];d=Math.max(d,h.floorIndex)}this.floorLength=d+1;for(var v=!1,g=[],m=function(W){var $=W.tileset,Y=W.upAxis,Z=W.name,oe=W.type;oe==="mesh"&&(v=!0);var ne=$.split("#"),de=ne[0],se=ne[1],ye=(o=(se||de).split("?")[1])!==null&&o!==void 0?o:"",ie=typeof r["3d-tiles"]=="function"?r["3d-tiles"](W):(s=r["3d-tiles"])!==null&&s!==void 0?s:{},xe=pt(e).ajax($,{responseType:"text"}).then(function(Le){var Ce,Oe=$?$.slice(0,$.lastIndexOf("/")+1):"",ee=Wi(JSON.parse(Le.body),Oe),re=ee.root,H=ee.rootMeta,Be=H===void 0?{}:H;Be.upAxis&&Be.upAxis!==Y&&(Y=Be.upAxis),"lodVersion"in ee&&(Y="-Y","floorInfo"in ee&&(ee.properties=ee.properties||{},ee.properties.floorInfo=ee.floorInfo.map(function(St){return{ground:-St.ground,height:St.height}}),delete ee.floorInfo),ee.asset.tilesetVersion=String(ee.lodVersion),delete ee.lodVersion);var Te=re.boundingVolume?Mn(re.boundingVolume):void 0;Te&&re.transform&&Te.applyMatrix4(ro.fromArray(re.transform));var Ee=null,Qe=new f.Matrix4,Ie=new f.Matrix4;Be.coordinate?(Ee=Be.coordinate.ground_height,Qe.fromArray(Be.coordinate.pose_ecef_to_enu),Ie.fromArray(Be.coordinate.pose_enu_to_ecef)):(Te?Te.getCenter(vr):vr.setScalar(0),E0(Y,vr,Qe),Ie.getInverse(Qe));var we=new f.Matrix4().copy(Zi),be=new f.Matrix4().copy(Yi),Ae=new f.Matrix4().premultiply(Qe).premultiply(we),me=new f.Matrix4().getInverse(Ae),ze;if(ie.viewerRequestVolume){var pe=Va(ie.viewerRequestVolume)?ie.viewerRequestVolume:Mn(ie.viewerRequestVolume);pe.applyMatrix4(me),ze=pe.toJson()}ee.root={refine:(Ce=re.refine)!==null&&Ce!==void 0?Ce:"REPLACE",geometricError:re.geometricError,transform:Ae.toArray(),boundingVolume:Te?Te.toJson():void 0,viewerRequestVolume:ze,children:[re]};var Se=new wn(a,ee,{name:Z,type:oe,upAxis:Y,url:$,referer:$,search:ye,fetcher:pt(e),groundHeight:Ee,coordinateTransform:{localToEnuMatrix:be,enuToLocalMatrix:we,enuToEcefMatrix:Ie,ecefToEnuMatrix:Qe,localToEcefMatrix:me,ecefToLocalMatrix:Ae}});return Se.matrix.copy(e.transform),Se.matrix.decompose(Se.position,Se.quaternion,Se.scale),Se.matrixWorldNeedsUpdate=!0,Object.assign(Se.maxMemoryUsage,Se.getRecommendProps()),typeof ie.debug!="undefined"&&(Se.debug=ie.debug),typeof ie.minLevelOfDetail!="undefined"&&(Se.minLevelOfDetail=ie.minLevelOfDetail),typeof ie.maxLevelOfDetail!="undefined"&&(Se.maxLevelOfDetail=ie.maxLevelOfDetail),typeof ie.skipLevelOfDetail!="undefined"&&(Se.skipLevelOfDetail=ie.skipLevelOfDetail),typeof ie.mostDetail!="undefined"&&(Se.mostDetail=ie.mostDetail),typeof ie.loadSiblings!="undefined"&&(Se.loadSiblings=ie.loadSiblings),typeof ie.loadAll!="undefined"&&(Se.loadAll=ie.loadAll),typeof ie.maxMemoryUsage!="undefined"&&(Se.maxMemoryUsage=ie.maxMemoryUsage),typeof ie.maxRequests!="undefined"&&(Se.maxRequests=ie.maxRequests),typeof ie.requestOrder!="undefined"&&(Se.requestOrder=ie.requestOrder),typeof ie.maxScreenSpaceError!="undefined"&&(Se.maxScreenSpaceError=ie.maxScreenSpaceError),(ie.showLayers===!1||Array.isArray(ie.showLayers)&&ie.showLayers.indexOf(Z)===-1)&&(Se.visible=!1),new $i(Se,null)});g.push(xe.catch(function(Le){a.onError(Le);var Ce=new f.Matrix4,Oe=new f.Matrix4,ee=new f.Matrix4().copy(Zi),re=new f.Matrix4().copy(Yi),H=new f.Matrix4().premultiply(Ce).premultiply(ee),Be=new f.Matrix4().getInverse(H),Te=$?$.slice(0,$.lastIndexOf("/")+1):"",Ee;if(ie.viewerRequestVolume){var Qe=Va(ie.viewerRequestVolume)?ie.viewerRequestVolume:Mn(ie.viewerRequestVolume);Qe.applyMatrix4(Be),Ee=Qe.toJson()}var Ie=Wi({asset:{version:"0.0"},geometricError:0,viewerRequestVolume:Ee,root:{geometricError:0}},Te),we=new wn(a,Ie,{name:Z,type:oe,upAxis:Y,url:$,referer:$,search:ye,fetcher:pt(e),groundHeight:null,coordinateTransform:{localToEnuMatrix:re,enuToLocalMatrix:ee,enuToEcefMatrix:Oe,ecefToEnuMatrix:Ce,localToEcefMatrix:Be,ecefToLocalMatrix:H},onError:a.onError});return we.matrix.copy(e.transform),we.matrix.decompose(we.position,we.quaternion,we.scale),we.matrixWorldNeedsUpdate=!0,(ie.showLayers===!1||Array.isArray(ie.showLayers)&&ie.showLayers.indexOf(Z)===-1)&&(we.visible=!1),new $i(we,Le)}))},y=0,b=c.layers;y<b.length;y++){var x=b[y];m(x)}if(!v&&c.file){var w=c.file,M=c.textureBase,S=c.textures,E="fallback",B="mesh",R="Z",C="",x={name:E,type:B,upAxis:R,tileset:C},I=typeof r["3d-tiles"]=="function"?r["3d-tiles"](x):(u=r["3d-tiles"])!==null&&u!==void 0?u:{},L=Dv(w)||"at3d",T=new f.Matrix4,F=new f.Matrix4,D=new f.Matrix4().copy(Zi),V=new f.Matrix4().copy(Yi);E0(R,vr.setScalar(0),T),F.getInverse(T);var z=new f.Matrix4().premultiply(T).premultiply(D),U=new f.Matrix4().getInverse(z),q=void 0;if(I.viewerRequestVolume){var G=Va(I.viewerRequestVolume)?I.viewerRequestVolume:Mn(I.viewerRequestVolume);G.applyMatrix4(U),q=G.toJson()}var K=Wi({asset:{version:"0.0"},geometricError:0,root:{refine:"REPLACE",geometricError:0,transform:z.toArray(),viewerRequestVolume:q,content:{uri:w},extras:(i={},i[L]={textureBaseUri:M,textureArray:S,textureOptions:(l=r.textureOptions)!==null&&l!==void 0?l:{}},i)}},""),j=new wn(this,K,{name:E,type:B,upAxis:R,url:C,referer:w,fetcher:pt(e),groundHeight:null,coordinateTransform:{localToEnuMatrix:V,enuToLocalMatrix:D,enuToEcefMatrix:F,ecefToEnuMatrix:T,localToEcefMatrix:U,ecefToLocalMatrix:z},onError:this.onError});j.matrix.copy(e.transform),j.matrix.decompose(j.position,j.quaternion,j.scale),j.matrixWorldNeedsUpdate=!0,(I.showLayers===!1||Array.isArray(I.showLayers)&&I.showLayers.indexOf(E)===-1)&&(j.visible=!1);var J=new $i(j,null);g.push(Promise.resolve(J))}return Promise.all(g).then(function(W){for(var $=0,Y=W;$<Y.length;$++){var Z=Y[$];if(a.disposed){Z.scene.dispose();continue}a.viewLayers.push(Z),a.add(Z.scene)}})},t.prototype.update=function(e,r,i){if(this.children.length){var a=this.loaded;this.refined=this.work!==null,this.refineProgress[0]=0,this.refineProgress[1]=0,this.loaded=this.work!==null;for(var o=0,s=this.viewLayers;o<s.length;o++){var u=s[o],l=u.scene;l&&(this.work&&(l.cacheCameras=this.cacheCameras,this.autoRefine===!1?l.needsRefined=!1:yi(i)?l.needsRefined=this.materialParameters.modelAlpha===0||this.materialParameters.modelAlpha===1:l.needsRefined=!0,this.work.transform.equals(l.matrix)||(l.matrix.copy(this.work.transform),l.matrix.decompose(l.position,l.quaternion,l.scale),l.matrixWorldNeedsUpdate=!0)),l.update(e,r,i),l.needsRender===!0&&(l.needsRender=!1,this.needsRender=!0),l.refined===!1&&(this.refined=!1),this.refineProgress[0]+=l.refineProgress[0],this.refineProgress[1]+=l.refineProgress[1],l.loaded===!1&&(this.loaded=!1))}this.bounding.makeEmpty();for(var c=0,d=this.viewLayers;c<d.length;c++){var u=d[c],l=u.scene;l&&(l.boundingBox.isEmpty()||(C0.copy(l.boundingBox).applyMatrix4(l.matrix),this.bounding.union(C0)))}this.bounding.isEmpty()&&this.bounding.copy(Ll),a===!1&&this.loaded===!0&&this.onLoad()}else this.work&&!this.work.model?(this.refined=!0,this.refineProgress[0]=0,this.refineProgress[1]=0,this.loaded=!0):(this.refined=!1,this.refineProgress[0]=0,this.refineProgress[1]=0,this.loaded=!1),this.bounding.set(new f.Vector3,new f.Vector3)},t.prototype.dispose=function(){this.disposed=!0;for(var e;e=this.children[0];)e instanceof wn&&e.dispose(),this.remove(e)},t}(f.Object3D);function I0(){var n=new f.Box3,t=Aa(ge,["clippers","shownFloorIndex","brightness","customShaders"]),e=Object.assign([],{bounding:n,needsRender:!1,refined:!1,refineProgress:[0,0],loaded:!1,materialVersion:0,cacheCameras:[],autoUpdate:!0,intersectRaycaster:function(r,i,a){a===void 0&&(a=!0);var o;if(e.length===1)o=e[0].intersectRaycaster(r,i,a);else if(e.length===0)o=[];else{o=[];for(var s=0,u=e;s<u.length;s++){var l=u[s];if(l.visible){var c=l.intersectRaycaster(r,i,!1);c.length&&o.push.apply(o,c)}}a&&o.sort(function(d,p){return d.distance-p.distance})}return o},setMaterial:function(r){var i=yu(t,r);i&&(e.materialVersion++,e.needsRender=!0)},getMaterial:function(){return O({},t)},resetBrightness:function(){for(var r=0,i=e;r<i.length;r++){var a=i[r];a.setMaterial({brightness:1})}},update:function(r,i,a){e.refined=e.length>0,e.loaded=e.length>0,e.refineProgress[0]=0,e.refineProgress[1]=0,n.makeEmpty();for(var o=0,s=e.cacheCameras;o<s.length;o++){var u=s[o];u.updateMatrixWorld(!0),u.updateProjectionMatrix()}for(var l=0,c=0,d=e;c<d.length;c++){for(var p=d[c],A=0,h=p.viewLayers;A<h.length;A++){var v=h[A];v.scene.modelIndex=l++}p.setMaterial(t),p.cacheCameras=e.cacheCameras,p.autoRefine=this.autoUpdate,p.update(r,i,a),p.needsRender===!0&&(e.needsRender=!0,p.needsRender=!1),p.refined===!1&&(e.refined=!1),e.refineProgress[0]+=p.refineProgress[0],e.refineProgress[1]+=p.refineProgress[1],p.loaded===!1&&(e.loaded=!1),n.union(p.bounding)}for(var g=0,m=e;g<m.length;g++)for(var p=m[g],y=0,b=p.viewLayers;y<b.length;y++){var v=b[y];v.scene.modelsLoaded=e.loaded}n.isEmpty()&&n.copy(Ll)}});return e}var T0=function(n){return n*(2-n)},Vv=function(){var n=new Float32Array([-.18,0,-.18,.18,0,-.18,-.18,0,.18,.18,0,.18]),t=new Float32Array([1,0,0,0,1,1,0,1]),e=new Uint8Array([0,2,1,2,3,1]),r=new f.BufferGeometry;return r.setAttribute("position",new f.BufferAttribute(n,3)),r.setAttribute("uv",new f.BufferAttribute(t,2)),r.setIndex(new f.BufferAttribute(e,1)),r}(),Nv=`
|
|
1041
1041
|
varying vec2 vUv;
|
|
1042
1042
|
#include <common>
|
|
1043
1043
|
#include <logdepthbuf_pars_vertex>
|
|
@@ -1260,7 +1260,7 @@ void main() {
|
|
|
1260
1260
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
1261
1261
|
#include <logdepthbuf_vertex>
|
|
1262
1262
|
}
|
|
1263
|
-
`,
|
|
1263
|
+
`,_v=`
|
|
1264
1264
|
#if defined(USE_MAP)
|
|
1265
1265
|
uniform sampler2D map;
|
|
1266
1266
|
uniform float mapAlpha;
|
|
@@ -1394,7 +1394,7 @@ void main() {
|
|
|
1394
1394
|
|
|
1395
1395
|
gl_FragColor = vec4(gl_FragColor.rgb, gl_FragColor.a * opacity);
|
|
1396
1396
|
}
|
|
1397
|
-
`,
|
|
1397
|
+
`,jv=function(n){ue(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,u,l,c=n.call(this)||this,d=(r=e.color)!==null&&r!==void 0?r:16777215,p=(i=e.scale)!==null&&i!==void 0?i:1,A=e.map,h=(a=e.mapAlpha)!==null&&a!==void 0?a:1,v=(o=e.mapUseColor)!==null&&o!==void 0?o:!1,g=(s=e.mapUseReverse)!==null&&s!==void 0?s:!1,m=(u=e.borderWidth)!==null&&u!==void 0?u:.1,y=(l=e.borderColor)!==null&&l!==void 0?l:16777215;return c.progress=0,c.opacity=0,c.loading=!1,c.current=!1,c.disabled=!1,c.currentMotion=new Re({progress:0}),c.tapMotion=new Re({scale:1,opacity:1}),c.loadingOpacityMotion=new Re({opacity:0}),c.progressMotion=new Re({progress:0}),c.progressOpacityMotion=new Re({opacity:0}),c.opacityMotion=new Re({opacity:0}),c.disableMotion=new Re({progress:0}),c.panoMesh=new f.Mesh(Gv,new f.ShaderMaterial({blending:f.CustomBlending,blendSrc:f.SrcAlphaFactor,blendDst:f.OneMinusSrcAlphaFactor,blendSrcAlpha:f.OneFactor,blendDstAlpha:f.OneMinusSrcAlphaFactor,depthWrite:!1,vertexShader:Kv,fragmentShader:_v,defines:{USE_COLOR:v,USE_MAP:A!==void 0,USE_BORDER:m>0,USE_REVERSE:g},uniforms:{baseColor:{value:new f.Color(d)},circleScale:{value:1},circleOpacity:{value:1},loadingAngle:{value:0},loadingOpacity:{value:0},progress:{value:0},progressOpacity:{value:0},expand0:{value:0},expand1:{value:0},expandOpacity:{value:0},opacity:{value:0},tapScale:{value:1},tapOpacity:{value:1},disable:{value:0},map:{value:A},mapAlpha:{value:h},borderWidth:{value:m},borderColor:{value:new f.Color(y)}}})),c.renderOrder=-2,c.panoMesh.renderOrder=-2,c.panoMesh.position.y=.004,c.panoMesh.scale.set(p,1,p),c.add(c.panoMesh),c.currentStartTime=ve(),c.needsRender=!0,c}return t.prototype.setProgress=function(e){var r=this;this.setDisabled(!1),this.setLoading(!1),this.progress!==e&&(e=ce(e,0,1),this.tapMotion.ended&&(this.progress===0&&this.progressOpacityMotion.set({opacity:1},500).catch(Q),e===0?this.progressOpacityMotion.set({opacity:0},500).catch(Q).then(function(){r.progressMotion.set({progress:0},0).catch(Q)}):this.progressMotion.set({progress:ce(e*1.2,0,1)},100).catch(Q)),this.progress=e)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=ce(e,0,1),this.opacityMotion.set({opacity:e},200).catch(Q))},t.prototype.setCurrent=function(e){this.current!==e&&(this.currentMotion.set({progress:e?1:0},2e3).catch(Q),this.current=e,this.current===!0&&(this.currentStartTime=ve()))},t.prototype.setLoading=function(e){this.loading!==e&&(this.loading=e,this.disabled===!0&&this.setDisabled(!1),this.loadingOpacityMotion.set({opacity:e?1:0},500).catch(Q))},t.prototype.setDisabled=function(e){this.disabled!==e&&(this.disabled=e,this.loading===!0&&this.setLoading(!1),this.disableMotion.set({progress:e?1:0},500).catch(Q))},t.prototype.tap=function(){var e=this;if(!this.tapMotion.ended)return Promise.resolve();var r=[{progress:0,value:{scale:1,opacity:1}},{progress:.3,value:{scale:.85,opacity:.5}},{progress:.8,value:{scale:1.05,opacity:.6}},{progress:1,value:{scale:1,opacity:1}}];return this.progressOpacityMotion.set({opacity:0},0).catch(Q),this.progressMotion.set({progress:0},0).catch(Q),this.tapMotion.setKeyframes(r,600).then(function(){e.progressOpacityMotion.set({opacity:e.progress>0?1:0},300).catch(Q),e.progressMotion.set({progress:e.progress},120).catch(Q)}).catch(Q)},t.prototype.updateTime=function(e,r){if(!this.progressMotion.ended){this.progressMotion.update(e);var i=this.progressMotion.value.progress;this.panoMesh.material.uniforms.progress.value=i,this.needsRender=!0}if(!this.progressOpacityMotion.ended){this.progressOpacityMotion.update(e);var a=this.progressOpacityMotion.value.opacity;this.panoMesh.material.uniforms.progressOpacity.value=a,this.needsRender=!0}if(!this.opacityMotion.ended){this.opacityMotion.update(e);var a=this.opacityMotion.value.opacity;this.panoMesh.material.uniforms.opacity.value=a,this.needsRender=!0}if(this.visible=this.opacityMotion.value.opacity!==0,(!this.loadingOpacityMotion.ended||this.loadingOpacityMotion.value.opacity>0)&&(this.loadingOpacityMotion.update(e),this.panoMesh.material.uniforms.loadingOpacity.value=this.loadingOpacityMotion.value.opacity,this.panoMesh.material.uniforms.loadingAngle.value=e/120%(Math.PI*2),this.needsRender=!0),this.tapMotion.ended||(this.tapMotion.update(e),this.panoMesh.material.uniforms.tapOpacity.value=this.tapMotion.value.opacity,this.panoMesh.material.uniforms.tapScale.value=this.tapMotion.value.scale,this.needsRender=!0),this.panoMesh.material.uniforms.circleOpacity.value=Math.max(.6,1-Math.max(this.loadingOpacityMotion.value.opacity,this.progressOpacityMotion.value.opacity)),this.current||!this.currentMotion.ended){this.currentMotion.update(e),this.panoMesh.material.uniforms.expandOpacity.value=this.currentMotion.value.progress;{var o=(e-this.currentStartTime-1500)/2e3;if(o%5<2){var s=o%1;this.panoMesh.material.uniforms.expand0.value=R0(s)*this.currentMotion.value.progress,this.needsRender=!0}}{var u=(e-this.currentStartTime-1e3)/2e3;if(u%5<2){var s=u%1;this.panoMesh.material.uniforms.expand1.value=R0(s)*this.currentMotion.value.progress,this.needsRender=!0}}}if(!this.disableMotion.ended){var i=this.disableMotion.value.progress;this.disableMotion.update(e),this.panoMesh.material.uniforms.disable.value=i,this.needsRender=!0}},t.prototype.dispose=function(){this.tapMotion.dispose(),this.progressMotion.dispose(),this.progressOpacityMotion.dispose(),this.opacityMotion.dispose(),this.currentMotion.dispose(),this.panoMesh.material.dispose()},t}(f.Object3D),Jv=new f.CircleBufferGeometry(.1,16),Xv=`
|
|
1398
1398
|
varying vec2 vUv;
|
|
1399
1399
|
#include <common>
|
|
1400
1400
|
#include <logdepthbuf_pars_vertex>
|
|
@@ -1427,13 +1427,13 @@ void main() {
|
|
|
1427
1427
|
|
|
1428
1428
|
gl_FragColor = vec4(gl_FragColor.rgb, gl_FragColor.a * outside * inside);
|
|
1429
1429
|
}
|
|
1430
|
-
`,Zv=new f.ShaderMaterial({vertexShader:Xv,fragmentShader:Wv,side:f.DoubleSide,blending:f.CustomBlending,blendSrc:f.SrcAlphaFactor,blendDst:f.OneMinusSrcAlphaFactor,blendSrcAlpha:f.OneFactor,blendDstAlpha:f.OneMinusSrcAlphaFactor,depthWrite:!1}),ya=function(n){ue(t,n);function t(){var e=n.call(this)||this;return e.ringMesh=new f.Mesh(Jv,Zv),e.ringMesh.position.z=.01,e.ringMesh.renderOrder=-2,e.add(e.ringMesh),e}return t.prototype.dispose=function(){this.remove(this.ringMesh)},t}(f.Object3D);function ii(n,t,e){var r=Math.abs(n-t);return r<.001||typeof e!="undefined"&&Math.abs(e-r)<.001}function er(n,t,e){return!ii(n,t,e)}function Fi(n,t){return n.distanceTo(t)<.001}function ea(n,t){return!Fi(n,t)}var Ol=new f.Vector3(0,0,0),Yv=function(n){ue(t,n);function t(e,r){r===void 0&&(r=Ol);var i=this,a=new f.BoxBufferGeometry(e.max.x-e.min.x+r.x*2,e.max.y-e.min.y+r.y*2,e.max.z-e.min.z+r.z*2,1,1);a.clearGroups(),a.addGroup(0,a.index?a.index.count:a.attributes.position.count,0),a.applyMatrix4(new f.Matrix4().makeScale(-1,1,1)),a.computeVertexNormals();var o=new br("none");return o.refreshUniforms(),i=n.call(this,a,[o])||this,i.position.copy(e.getCenter(new f.Vector3)),i.frustumCulled=!1,i.boundingBox=new f.Box3,i.boundingBox.setFromObject(i),i.renderOrder=-1001,i}return t}(Ot);function $v(n,t){return t===void 0&&(t=Ol),new Yv(n,t)}function em(n,t){var e=new f.Vector3(0,0,-1);e.applyQuaternion(n.quaternion);var r=t.quaternion.clone().inverse();e.applyQuaternion(r);var i=Math.atan2(e.x,-e.z),a=-Math.asin(e.y);return{theta:i,phi:a,lookAtVector:e}}var Hi=Math.PI*2;function vn(n){return n>=0&&n<Hi?n:(n%Hi+Hi)%Hi}var Do=Math.PI,B0=Do*2;function no(n,t,e){if(n===t)return t;var r=t-n,i=Math.abs(r);if(i<=e)return t;var a=r>0?1:-1;return n+a*e}function tm(n,t,e){if(n.equals(t))return new f.Vector3().copy(t);var r=new f.Vector3().subVectors(t,n);return r.lengthSq()<e*e?r.copy(t):r.setLength(e).add(n)}function F0(n,t,e){if(n.longitude===t.longitude&&n.latitude===t.latitude)return{longitude:t.longitude,latitude:t.latitude};var r=vn(n.longitude),i=n.latitude,a=vn(t.longitude),o=t.latitude;a-r>Do?r+=B0:r-a>Do&&(r-=B0);var s=Math.sqrt(Math.pow(a-r,2)+Math.pow(o-i,2)),u=e/s;return u>=1?{longitude:t.longitude,latitude:t.latitude}:{longitude:r+(a-r)*u,latitude:i+(o-i)*u}}function rm(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}var io,bn=typeof navigator!="undefined"?((io=navigator==null?void 0:navigator.userAgent)!==null&&io!==void 0?io:"").toLowerCase():"node";(function(){try{var n=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(n.getContext("webgl")||n.getContext("experimental-webgl")))}catch(t){return!1}})();var ai=/android/i.test(bn)||/webos/i.test(bn)||/ipad|iphone|ipod/i.test(bn)||/iemobile/i.test(bn)||/opera mini/i.test(bn)||/blackberry/i.test(bn)||/windows phone/i.test(bn);function X(n,t){for(var e=!1,r={type:n,timeStamp:ve(),get defaultPrevented(){return e},preventDefault:function(){e=!0}},i=0,a=Object.keys(t);i<a.length;i++){var o=a[i];o in r||(r[o]=t[o])}return r}function nm(){return typeof location=="undefined"||location.protocol!=="https:"?Promise.reject(new Error("Request DeviceOrientation Permission denied.")):typeof DeviceOrientationEvent!="undefined"&&typeof DeviceOrientationEvent.requestPermission=="function"?DeviceOrientationEvent.requestPermission().then(function(n){if(n=="granted")return Promise.resolve();var t=new Error("Request DeviceOrientation Permission denied.");return Promise.reject(t)}):Promise.resolve()}function im(){if("xr"in navigator)return navigator.xr.isSessionSupported("immersive-vr").then(function(t){return t?Promise.resolve():Promise.reject()}).then(function(){var t={optionalFeatures:["local-floor"]};return navigator.xr.requestSession("immersive-vr",t).then(function(e){return Promise.resolve(e)})});var n=new Error("Request XR Permission denied.");return Promise.reject(n)}function Er(n,t){n.mode=t.mode,n.workCode=t.workCode,n.panoIndex=t.panoIndex,n.longitude=t.longitude,n.latitude=t.latitude,n.fov=t.fov,n.offset.copy(t.offset),n.distance=t.distance}function on(n,t){return n.workCode===t.workCode&&n.mode===t.mode&&n.panoIndex===t.panoIndex&&ii(n.longitude,t.longitude,Math.PI*2)&&ii(n.latitude,t.latitude)&&ii(n.fov,t.fov)&&Fi(n.offset,t.offset)&&ii(n.distance,t.distance)}function am(n,t){n.longitude=t.longitude,n.latitude=t.latitude,n.fov=t.fov,n.distance=t.distance,n.offset.copy(t.offset)}function tt(n){return{longitude:n.longitude,latitude:n.latitude,fov:n.fov,offset:n.offset.clone(),distance:n.distance}}var om=function(n){return Number(n)};function Br(n,t,e){var r;t===void 0&&(t=om),e===void 0&&(e=!1);for(var i,a=1/0,o=0,s=n;o<s.length;o++){var u=s[o],l=t(u);l<=a&&(r=[u,l],i=r[0],a=r[1])}return isFinite(a)||(a=0),e?[i,a]:i}function
|
|
1430
|
+
`,Zv=new f.ShaderMaterial({vertexShader:Xv,fragmentShader:Wv,side:f.DoubleSide,blending:f.CustomBlending,blendSrc:f.SrcAlphaFactor,blendDst:f.OneMinusSrcAlphaFactor,blendSrcAlpha:f.OneFactor,blendDstAlpha:f.OneMinusSrcAlphaFactor,depthWrite:!1}),ya=function(n){ue(t,n);function t(){var e=n.call(this)||this;return e.ringMesh=new f.Mesh(Jv,Zv),e.ringMesh.position.z=.01,e.ringMesh.renderOrder=-2,e.add(e.ringMesh),e}return t.prototype.dispose=function(){this.remove(this.ringMesh)},t}(f.Object3D);function ii(n,t,e){var r=Math.abs(n-t);return r<.001||typeof e!="undefined"&&Math.abs(e-r)<.001}function er(n,t,e){return!ii(n,t,e)}function Fi(n,t){return n.distanceTo(t)<.001}function ea(n,t){return!Fi(n,t)}var Ol=new f.Vector3(0,0,0),Yv=function(n){ue(t,n);function t(e,r){r===void 0&&(r=Ol);var i=this,a=new f.BoxBufferGeometry(e.max.x-e.min.x+r.x*2,e.max.y-e.min.y+r.y*2,e.max.z-e.min.z+r.z*2,1,1);a.clearGroups(),a.addGroup(0,a.index?a.index.count:a.attributes.position.count,0),a.applyMatrix4(new f.Matrix4().makeScale(-1,1,1)),a.computeVertexNormals();var o=new br("none");return o.refreshUniforms(),i=n.call(this,a,[o])||this,i.position.copy(e.getCenter(new f.Vector3)),i.frustumCulled=!1,i.boundingBox=new f.Box3,i.boundingBox.setFromObject(i),i.renderOrder=-1001,i}return t}(Ot);function $v(n,t){return t===void 0&&(t=Ol),new Yv(n,t)}function em(n,t){var e=new f.Vector3(0,0,-1);e.applyQuaternion(n.quaternion);var r=t.quaternion.clone().inverse();e.applyQuaternion(r);var i=Math.atan2(e.x,-e.z),a=-Math.asin(e.y);return{theta:i,phi:a,lookAtVector:e}}var Hi=Math.PI*2;function vn(n){return n>=0&&n<Hi?n:(n%Hi+Hi)%Hi}var Do=Math.PI,B0=Do*2;function no(n,t,e){if(n===t)return t;var r=t-n,i=Math.abs(r);if(i<=e)return t;var a=r>0?1:-1;return n+a*e}function tm(n,t,e){if(n.equals(t))return new f.Vector3().copy(t);var r=new f.Vector3().subVectors(t,n);return r.lengthSq()<e*e?r.copy(t):r.setLength(e).add(n)}function F0(n,t,e){if(n.longitude===t.longitude&&n.latitude===t.latitude)return{longitude:t.longitude,latitude:t.latitude};var r=vn(n.longitude),i=n.latitude,a=vn(t.longitude),o=t.latitude;a-r>Do?r+=B0:r-a>Do&&(r-=B0);var s=Math.sqrt(Math.pow(a-r,2)+Math.pow(o-i,2)),u=e/s;return u>=1?{longitude:t.longitude,latitude:t.latitude}:{longitude:r+(a-r)*u,latitude:i+(o-i)*u}}function rm(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}var io,bn=typeof navigator!="undefined"?((io=navigator==null?void 0:navigator.userAgent)!==null&&io!==void 0?io:"").toLowerCase():"node";(function(){try{var n=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(n.getContext("webgl")||n.getContext("experimental-webgl")))}catch(t){return!1}})();var ai=/android/i.test(bn)||/webos/i.test(bn)||/ipad|iphone|ipod/i.test(bn)||/iemobile/i.test(bn)||/opera mini/i.test(bn)||/blackberry/i.test(bn)||/windows phone/i.test(bn);function X(n,t){for(var e=!1,r={type:n,timeStamp:ve(),get defaultPrevented(){return e},preventDefault:function(){e=!0}},i=0,a=Object.keys(t);i<a.length;i++){var o=a[i];o in r||(r[o]=t[o])}return r}function nm(){return typeof location=="undefined"||location.protocol!=="https:"?Promise.reject(new Error("Request DeviceOrientation Permission denied.")):typeof DeviceOrientationEvent!="undefined"&&typeof DeviceOrientationEvent.requestPermission=="function"?DeviceOrientationEvent.requestPermission().then(function(n){if(n=="granted")return Promise.resolve();var t=new Error("Request DeviceOrientation Permission denied.");return Promise.reject(t)}):Promise.resolve()}function im(){if("xr"in navigator)return navigator.xr.isSessionSupported("immersive-vr").then(function(t){return t?Promise.resolve():Promise.reject()}).then(function(){var t={optionalFeatures:["local-floor"]};return navigator.xr.requestSession("immersive-vr",t).then(function(e){return Promise.resolve(e)})});var n=new Error("Request XR Permission denied.");return Promise.reject(n)}function Er(n,t){n.mode=t.mode,n.workCode=t.workCode,n.panoIndex=t.panoIndex,n.longitude=t.longitude,n.latitude=t.latitude,n.fov=t.fov,n.offset.copy(t.offset),n.distance=t.distance}function on(n,t){return n.workCode===t.workCode&&n.mode===t.mode&&n.panoIndex===t.panoIndex&&ii(n.longitude,t.longitude,Math.PI*2)&&ii(n.latitude,t.latitude)&&ii(n.fov,t.fov)&&Fi(n.offset,t.offset)&&ii(n.distance,t.distance)}function am(n,t){n.longitude=t.longitude,n.latitude=t.latitude,n.fov=t.fov,n.distance=t.distance,n.offset.copy(t.offset)}function tt(n){return{longitude:n.longitude,latitude:n.latitude,fov:n.fov,offset:n.offset.clone(),distance:n.distance}}var om=function(n){return Number(n)};function Br(n,t,e){var r;t===void 0&&(t=om),e===void 0&&(e=!1);for(var i,a=1/0,o=0,s=n;o<s.length;o++){var u=s[o],l=t(u);l<=a&&(r=[u,l],i=r[0],a=r[1])}return isFinite(a)||(a=0),e?[i,a]:i}function ar(n){for(var t in n)return!1;return!0}/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
1431
1431
|
* http://hammerjs.github.io/
|
|
1432
1432
|
*
|
|
1433
1433
|
* Copyright (c) 2016 Jorik Tangelder;
|
|
1434
|
-
* Licensed under the MIT license */var oi=function(n,t,e,r){var i=["","webkit","Moz","MS","ms","o"],a=t.createElement?t.createElement("div"):r,o="function",s=Math.round,u=Math.abs,l=Date.now;function c(
|
|
1434
|
+
* Licensed under the MIT license */var oi=function(n,t,e,r){var i=["","webkit","Moz","MS","ms","o"],a=t.createElement?t.createElement("div"):r,o="function",s=Math.round,u=Math.abs,l=Date.now;function c(P,k,N){return setTimeout(y(P,N),k)}function d(P,k,N){return Array.isArray(P)?(p(P,N[k],N),!0):!1}function p(P,k,N){var _;if(P)if(P.forEach)P.forEach(k,N);else if(P.length!==r)for(_=0;_<P.length;)k.call(N,P[_],_,P),_++;else for(_ in P)P.hasOwnProperty(_)&&k.call(N,P[_],_,P)}function A(P,k,N){var _="DEPRECATED METHOD: "+k+`
|
|
1435
1435
|
`+N+` AT
|
|
1436
|
-
`;return function(){var te=new Error("get-stack-trace"),fe=te&&te.stack?te.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",Fe=n.console&&(n.console.warn||n.console.log);return Fe&&Fe.call(n.console,j,fe),R.apply(this,arguments)}}var h;typeof Object.assign!="function"?h=function(k){if(k===r||k===null)throw new TypeError("Cannot convert undefined or null to object");for(var N=Object(k),j=1;j<arguments.length;j++){var te=arguments[j];if(te!==r&&te!==null)for(var fe in te)te.hasOwnProperty(fe)&&(N[fe]=te[fe])}return N}:h=Object.assign;var v=A(function(k,N,j){for(var te=Object.keys(N),fe=0;fe<te.length;)(!j||j&&k[te[fe]]===r)&&(k[te[fe]]=N[te[fe]]),fe++;return k},"extend","Use `assign`."),g=A(function(k,N){return v(k,N,!0)},"merge","Use `assign`.");function m(R,k,N){var j=k.prototype,te;te=R.prototype=Object.create(j),te.constructor=R,te._super=j,N&&h(te,N)}function y(R,k){return function(){return R.apply(k,arguments)}}function b(R,k){return typeof R==o?R.apply(k&&k[0]||r,k):R}function x(R,k){return R===r?k:R}function w(R,k,N){p(P(k),function(j){R.addEventListener(j,N,!1)})}function M(R,k,N){p(P(k),function(j){R.removeEventListener(j,N,!1)})}function S(R,k){for(;R;){if(R==k)return!0;R=R.parentNode}return!1}function E(R,k){return R.indexOf(k)>-1}function P(R){return R.trim().split(/\s+/g)}function B(R,k,N){if(R.indexOf&&!N)return R.indexOf(k);for(var j=0;j<R.length;){if(N&&R[j][N]==k||!N&&R[j]===k)return j;j++}return-1}function C(R){return Array.prototype.slice.call(R,0)}function I(R,k,N){for(var j=[],te=[],fe=0;fe<R.length;){var Fe=R[fe][k];B(te,Fe)<0&&j.push(R[fe]),te[fe]=Fe,fe++}return j=j.sort(function(Vt,et){return Vt[k]>et[k]}),j}function F(R,k){for(var N,j,te=k[0].toUpperCase()+k.slice(1),fe=0;fe<i.length;){if(N=i[fe],j=N?N+te:k,j in R)return j;fe++}return r}var T=1;function L(){return T++}function D(R){var k=R.ownerDocument||R;return k.defaultView||k.parentWindow||n}var V=/mobile|tablet|ip(ad|hone|od)|android/i,z="ontouchstart"in n,U=F(n,"PointerEvent")!==r,q=z&&V.test(navigator.userAgent),G="touch",K="pen",_="mouse",J="kinect",W=25,$=1,Y=2,Z=4,oe=8,ne=1,de=2,se=4,ye=8,ie=16,xe=de|se,Le=ye|ie,Ce=xe|Le,Oe=["x","y"],ee=["clientX","clientY"];function re(R,k){var N=this;this.manager=R,this.callback=k,this.element=R.element,this.target=R.options.inputTarget,this.domHandler=function(j){b(R.options.enable,[R])&&N.handler(j)},this.init()}re.prototype={handler:function(){},init:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(D(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&M(this.element,this.evEl,this.domHandler),this.evTarget&&M(this.target,this.evTarget,this.domHandler),this.evWin&&M(D(this.element),this.evWin,this.domHandler)}};function H(R){var k,N=R.options.inputClass;return N?k=N:U?k=Ct:q?k=At:z?k=yt:k=it,new k(R,Be)}function Be(R,k,N){var j=N.pointers.length,te=N.changedPointers.length,fe=k&$&&j-te===0,Fe=k&(Z|oe)&&j-te===0;N.isFirst=!!fe,N.isFinal=!!Fe,fe&&(R.session={}),N.eventType=k,Te(R,N),R.emit("hammer.input",N),R.recognize(N),R.session.prevInput=N}function Te(R,k){var N=R.session,j=k.pointers,te=j.length;N.firstInput||(N.firstInput=Ie(k)),te>1&&!N.firstMultiple?N.firstMultiple=Ie(k):te===1&&(N.firstMultiple=!1);var fe=N.firstInput,Fe=N.firstMultiple,ot=Fe?Fe.center:fe.center,Vt=k.center=we(j);k.timeStamp=l(),k.deltaTime=k.timeStamp-fe.timeStamp,k.angle=ze(ot,Vt),k.distance=me(ot,Vt),Ee(N,k),k.offsetDirection=Ae(k.deltaX,k.deltaY);var et=be(k.deltaTime,k.deltaX,k.deltaY);k.overallVelocityX=et.x,k.overallVelocityY=et.y,k.overallVelocity=u(et.x)>u(et.y)?et.x:et.y,k.scale=Fe?Se(Fe.pointers,j):1,k.rotation=Fe?pe(Fe.pointers,j):0,k.maxPointers=N.prevInput?k.pointers.length>N.prevInput.maxPointers?k.pointers.length:N.prevInput.maxPointers:k.pointers.length,Qe(N,k);var Sr=R.element;S(k.srcEvent.target,Sr)&&(Sr=k.srcEvent.target),k.target=Sr}function Ee(R,k){var N=k.center,j=R.offsetDelta||{},te=R.prevDelta||{},fe=R.prevInput||{};(k.eventType===$||fe.eventType===Z)&&(te=R.prevDelta={x:fe.deltaX||0,y:fe.deltaY||0},j=R.offsetDelta={x:N.x,y:N.y}),k.deltaX=te.x+(N.x-j.x),k.deltaY=te.y+(N.y-j.y)}function Qe(R,k){var N=R.lastInterval||k,j=k.timeStamp-N.timeStamp,te,fe,Fe,ot;if(k.eventType!=oe&&(j>W||N.velocity===r)){var Vt=k.deltaX-N.deltaX,et=k.deltaY-N.deltaY,Sr=be(j,Vt,et);fe=Sr.x,Fe=Sr.y,te=u(Sr.x)>u(Sr.y)?Sr.x:Sr.y,ot=Ae(Vt,et),R.lastInterval=k}else te=N.velocity,fe=N.velocityX,Fe=N.velocityY,ot=N.direction;k.velocity=te,k.velocityX=fe,k.velocityY=Fe,k.direction=ot}function Ie(R){for(var k=[],N=0;N<R.pointers.length;)k[N]={clientX:s(R.pointers[N].clientX),clientY:s(R.pointers[N].clientY)},N++;return{timeStamp:l(),pointers:k,center:we(k),deltaX:R.deltaX,deltaY:R.deltaY}}function we(R){var k=R.length;if(k===1)return{x:s(R[0].clientX),y:s(R[0].clientY)};for(var N=0,j=0,te=0;te<k;)N+=R[te].clientX,j+=R[te].clientY,te++;return{x:s(N/k),y:s(j/k)}}function be(R,k,N){return{x:k/R||0,y:N/R||0}}function Ae(R,k){return R===k?ne:u(R)>=u(k)?R<0?de:se:k<0?ye:ie}function me(R,k,N){N||(N=Oe);var j=k[N[0]]-R[N[0]],te=k[N[1]]-R[N[1]];return Math.sqrt(j*j+te*te)}function ze(R,k,N){N||(N=Oe);var j=k[N[0]]-R[N[0]],te=k[N[1]]-R[N[1]];return Math.atan2(te,j)*180/Math.PI}function pe(R,k){return ze(k[1],k[0],ee)+ze(R[1],R[0],ee)}function Se(R,k){return me(k[0],k[1],ee)/me(R[0],R[1],ee)}var St={mousedown:$,mousemove:Y,mouseup:Z},Pe="mousedown",_e="mousemove mouseup";function it(){this.evEl=Pe,this.evWin=_e,this.pressed=!1,re.apply(this,arguments)}m(it,re,{handler:function(k){var N=St[k.type];N&$&&(k.button===0||k.button===2)&&(this.pressed=!0),N&Y&&k.which!==1&&(N=Z),this.pressed&&(N&Z&&(this.pressed=!1),this.callback(this.manager,N,{pointers:[k],changedPointers:[k],pointerType:_,srcEvent:k}))}});var Jt={pointerdown:$,pointermove:Y,pointerup:Z,pointercancel:oe,pointerout:oe},Kr={2:G,3:K,4:_,5:J},Xt="pointerdown",ut="pointermove pointerup pointercancel";n.MSPointerEvent&&!n.PointerEvent&&(Xt="MSPointerDown",ut="MSPointerMove MSPointerUp MSPointerCancel");function Ct(){this.evEl=Xt,this.evWin=ut,re.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}m(Ct,re,{handler:function(k){var N=this.store,j=!1,te=!1,fe=k.type.toLowerCase().replace("ms",""),Fe=Jt[fe],ot=Kr[k.pointerType]||k.pointerType,Vt=ot==G,et=B(N,k.pointerId,"pointerId");Fe&$&&(k.button===0||k.button===2||Vt)?et<0&&(N.push(k),et=N.length-1):Fe&(Z|oe)?j=!0:!Vt&&k.buttons===0&&(j=!0,te=!0,Fe=Jt.pointerup),!(et<0)&&(te||(N[et]=k),this.callback(this.manager,Fe,{pointers:N,changedPointers:[k],pointerType:ot,srcEvent:N[et]}),j&&N.splice(et,1))}});var dt={touchstart:$,touchmove:Y,touchend:Z,touchcancel:oe},Et="touchstart",It="touchstart touchmove touchend touchcancel";function Tt(){this.evTarget=Et,this.evWin=It,this.started=!1,re.apply(this,arguments)}m(Tt,re,{handler:function(k){var N=dt[k.type];if(N===$&&(this.started=!0),!!this.started){var j=Xe.call(this,k,N);N&(Z|oe)&&j[0].length-j[1].length===0&&(this.started=!1),this.callback(this.manager,N,{pointers:j[0],changedPointers:j[1],pointerType:G,srcEvent:k})}}});function Xe(R,k){var N=C(R.touches),j=C(R.changedTouches);return k&(Z|oe)&&(N=I(N.concat(j),"identifier")),[N,j]}var Ne={touchstart:$,touchmove:Y,touchend:Z,touchcancel:oe},We="touchstart touchmove touchend touchcancel";function At(){this.evTarget=We,this.targetIds={},re.apply(this,arguments)}m(At,re,{handler:function(k){var N=Ne[k.type],j=Ze.call(this,k,N);j&&this.callback(this.manager,N,{pointers:j[0],changedPointers:j[1],pointerType:G,srcEvent:k})}});function Ze(R,k){var N=C(R.touches),j=this.targetIds;if(k&($|Y)&&N.length===1)return j[N[0].identifier]=!0,[N,N];var te,fe,Fe=C(R.changedTouches),ot=[],Vt=this.target;if(fe=N.filter(function(et){return S(et.target,Vt)}),k===$)for(te=0;te<fe.length;)j[fe[te].identifier]=!0,te++;for(te=0;te<Fe.length;)j[Fe[te].identifier]&&ot.push(Fe[te]),k&(Z|oe)&&delete j[Fe[te].identifier],te++;if(ot.length)return[I(fe.concat(ot),"identifier"),ot]}var gt=2500,qt=25;function yt(){re.apply(this,arguments);var R=y(this.handler,this);this.touch=new At(this.manager,R),this.mouse=new it(this.manager,R),this.primaryTouch=null,this.lastTouches=[]}m(yt,re,{handler:function(k,N,j){var te=j.pointerType==G,fe=j.pointerType==_;if(!(fe&&j.sourceCapabilities&&j.sourceCapabilities.firesTouchEvents)){if(te)Wt.call(this,N,j);else if(fe&&jr.call(this,j))return;this.callback(k,N,j)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Wt(R,k){R&$?(this.primaryTouch=k.changedPointers[0].identifier,xr.call(this,k)):R&(Z|oe)&&xr.call(this,k)}function xr(R){var k=R.changedPointers[0];if(k.identifier===this.primaryTouch){var N={x:k.clientX,y:k.clientY};this.lastTouches.push(N);var j=this.lastTouches,te=function(){var fe=j.indexOf(N);fe>-1&&j.splice(fe,1)};setTimeout(te,gt)}}function jr(R){for(var k=R.srcEvent.clientX,N=R.srcEvent.clientY,j=0;j<this.lastTouches.length;j++){var te=this.lastTouches[j],fe=Math.abs(k-te.x),Fe=Math.abs(N-te.y);if(fe<=qt&&Fe<=qt)return!0}return!1}var wr=a?F(a.style,"touchAction"):r,Lr=wr!==r,Dt="compute",Ge="auto",ke="manipulation",Ye="none",bt="pan-x",Pt="pan-y",sr=ic();function _r(R,k){this.manager=R,this.set(k)}_r.prototype={set:function(R){R==Dt&&(R=this.compute()),Lr&&this.manager.element.style&&sr[R]&&(this.manager.element.style[wr]=R),this.actions=R.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var R=[];return p(this.manager.recognizers,function(k){b(k.options.enable,[k])&&(R=R.concat(k.getTouchAction()))}),mn(R.join(" "))},preventDefaults:function(R){var k=R.srcEvent,N=R.offsetDirection;if(this.manager.session.prevented){k.preventDefault();return}var j=this.actions,te=E(j,Ye)&&!sr[Ye],fe=E(j,Pt)&&!sr[Pt],Fe=E(j,bt)&&!sr[bt];if(te){var ot=R.pointers.length===1,Vt=R.distance<2,et=R.deltaTime<250;if(ot&&Vt&&et)return}if(!(Fe&&fe)&&(te||fe&&N&xe||Fe&&N&Le))return this.preventSrc(k)},preventSrc:function(R){this.manager.session.prevented=!0,R.preventDefault()}};function mn(R){if(E(R,Ye))return Ye;var k=E(R,bt),N=E(R,Pt);return k&&N?Ye:k||N?k?bt:Pt:E(R,ke)?ke:Ge}function ic(){if(!Lr)return!1;var R={},k=n.CSS&&n.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(N){R[N]=k?n.CSS.supports("touch-action",N):!0}),R}var ki=1,Zt=2,Rn=4,Jr=8,kr=Jr,Wn=16,Mr=32;function Or(R){this.options=h({},this.defaults,R||{}),this.id=L(),this.manager=null,this.options.enable=x(this.options.enable,!0),this.state=ki,this.simultaneous={},this.requireFail=[]}Or.prototype={defaults:{},set:function(R){return h(this.options,R),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(R){if(d(R,"recognizeWith",this))return this;var k=this.simultaneous;return R=Oi(R,this),k[R.id]||(k[R.id]=R,R.recognizeWith(this)),this},dropRecognizeWith:function(R){return d(R,"dropRecognizeWith",this)?this:(R=Oi(R,this),delete this.simultaneous[R.id],this)},requireFailure:function(R){if(d(R,"requireFailure",this))return this;var k=this.requireFail;return R=Oi(R,this),B(k,R)===-1&&(k.push(R),R.requireFailure(this)),this},dropRequireFailure:function(R){if(d(R,"dropRequireFailure",this))return this;R=Oi(R,this);var k=B(this.requireFail,R);return k>-1&&this.requireFail.splice(k,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(R){return!!this.simultaneous[R.id]},emit:function(R){var k=this,N=this.state;function j(te){k.manager.emit(te,R)}N<Jr&&j(k.options.event+bs(N)),j(k.options.event),R.additionalEvent&&j(R.additionalEvent),N>=Jr&&j(k.options.event+bs(N))},tryEmit:function(R){if(this.canEmit())return this.emit(R);this.state=Mr},canEmit:function(){for(var R=0;R<this.requireFail.length;){if(!(this.requireFail[R].state&(Mr|ki)))return!1;R++}return!0},recognize:function(R){var k=h({},R);if(!b(this.options.enable,[this,k])){this.reset(),this.state=Mr;return}this.state&(kr|Wn|Mr)&&(this.state=ki),this.state=this.process(k),this.state&(Zt|Rn|Jr|Wn)&&this.tryEmit(k)},process:function(R){},getTouchAction:function(){},reset:function(){}};function bs(R){return R&Wn?"cancel":R&Jr?"end":R&Rn?"move":R&Zt?"start":""}function xs(R){return R==ie?"down":R==ye?"up":R==de?"left":R==se?"right":""}function Oi(R,k){var N=k.manager;return N?N.get(R):R}function ur(){Or.apply(this,arguments)}m(ur,Or,{defaults:{pointers:1},attrTest:function(R){var k=this.options.pointers;return k===0||R.pointers.length===k},process:function(R){var k=this.state,N=R.eventType,j=k&(Zt|Rn),te=this.attrTest(R);return j&&(N&oe||!te)?k|Wn:j||te?N&Z?k|Jr:k&Zt?k|Rn:Zt:Mr}});function Di(){ur.apply(this,arguments),this.pX=null,this.pY=null}m(Di,ur,{defaults:{event:"pan",threshold:10,pointers:1,direction:Ce},getTouchAction:function(){var R=this.options.direction,k=[];return R&xe&&k.push(Pt),R&Le&&k.push(bt),k},directionTest:function(R){var k=this.options,N=!0,j=R.distance,te=R.direction,fe=R.deltaX,Fe=R.deltaY;return te&k.direction||(k.direction&xe?(te=fe===0?ne:fe<0?de:se,N=fe!=this.pX,j=Math.abs(R.deltaX)):(te=Fe===0?ne:Fe<0?ye:ie,N=Fe!=this.pY,j=Math.abs(R.deltaY))),R.direction=te,N&&j>k.threshold&&te&k.direction},attrTest:function(R){return ur.prototype.attrTest.call(this,R)&&(this.state&Zt||!(this.state&Zt)&&this.directionTest(R))},emit:function(R){this.pX=R.deltaX,this.pY=R.deltaY;var k=xs(R.direction);k&&(R.additionalEvent=this.options.event+k),this._super.emit.call(this,R)}});function Ma(){ur.apply(this,arguments)}m(Ma,ur,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ye]},attrTest:function(R){return this._super.attrTest.call(this,R)&&(Math.abs(R.scale-1)>this.options.threshold||this.state&Zt)},emit:function(R){if(R.scale!==1){var k=R.scale<1?"in":"out";R.additionalEvent=this.options.event+k}this._super.emit.call(this,R)}});function Sa(){Or.apply(this,arguments),this._timer=null,this._input=null}m(Sa,Or,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ge]},process:function(R){var k=this.options,N=R.pointers.length===k.pointers,j=R.distance<k.threshold,te=R.deltaTime>k.time;if(this._input=R,!j||!N||R.eventType&(Z|oe)&&!te)this.reset();else if(R.eventType&$)this.reset(),this._timer=c(function(){this.state=kr,this.tryEmit()},k.time,this);else if(R.eventType&Z)return kr;return Mr},reset:function(){clearTimeout(this._timer)},emit:function(R){this.state===kr&&(R&&R.eventType&Z?this.manager.emit(this.options.event+"up",R):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function Ca(){ur.apply(this,arguments)}m(Ca,ur,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ye]},attrTest:function(R){return this._super.attrTest.call(this,R)&&(Math.abs(R.rotation)>this.options.threshold||this.state&Zt)}});function Ea(){ur.apply(this,arguments)}m(Ea,ur,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:xe|Le,pointers:1},getTouchAction:function(){return Di.prototype.getTouchAction.call(this)},attrTest:function(R){var k=this.options.direction,N;return k&(xe|Le)?N=R.overallVelocity:k&xe?N=R.overallVelocityX:k&Le&&(N=R.overallVelocityY),this._super.attrTest.call(this,R)&&k&R.offsetDirection&&R.distance>this.options.threshold&&R.maxPointers==this.options.pointers&&u(N)>this.options.velocity&&R.eventType&Z},emit:function(R){var k=xs(R.offsetDirection);k&&this.manager.emit(this.options.event+k,R),this.manager.emit(this.options.event,R)}});function Vi(){Or.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}m(Vi,Or,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ke]},process:function(R){var k=this.options,N=R.pointers.length===k.pointers,j=R.distance<k.threshold,te=R.deltaTime<k.time;if(this.reset(),R.eventType&$&&this.count===0)return this.failTimeout();if(j&&te&&N){if(R.eventType!=Z)return this.failTimeout();var fe=this.pTime?R.timeStamp-this.pTime<k.interval:!0,Fe=!this.pCenter||me(this.pCenter,R.center)<k.posThreshold;this.pTime=R.timeStamp,this.pCenter=R.center,!Fe||!fe?this.count=1:this.count+=1,this._input=R;var ot=this.count%k.taps;if(ot===0)return this.hasRequireFailures()?(this._timer=c(function(){this.state=kr,this.tryEmit()},k.interval,this),Zt):kr}return Mr},failTimeout:function(){return this._timer=c(function(){this.state=Mr},this.options.interval,this),Mr},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==kr&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Bn(R,k){return k=k||{},k.recognizers=x(k.recognizers,Bn.defaults.preset),new Ia(R,k)}Bn.VERSION="2.0.7",Bn.defaults={domEvents:!1,touchAction:Dt,enable:!0,inputTarget:null,inputClass:null,preset:[[Ca,{enable:!1}],[Ma,{enable:!1},["rotate"]],[Ea,{direction:xe}],[Di,{direction:xe},["swipe"]],[Vi],[Vi,{event:"doubletap",taps:2},["tap"]],[Sa]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var ac=1,ws=2;function Ia(R,k){this.options=h({},Bn.defaults,k||{}),this.options.inputTarget=this.options.inputTarget||R,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=R,this.input=H(this),this.touchAction=new _r(this,this.options.touchAction),Ms(this,!0),p(this.options.recognizers,function(N){var j=this.add(new N[0](N[1]));N[2]&&j.recognizeWith(N[2]),N[3]&&j.requireFailure(N[3])},this)}Ia.prototype={set:function(R){return h(this.options,R),R.touchAction&&this.touchAction.update(),R.inputTarget&&(this.input.destroy(),this.input.target=R.inputTarget,this.input.init()),this},stop:function(R){this.session.stopped=R?ws:ac},recognize:function(R){var k=this.session;if(!k.stopped){this.touchAction.preventDefaults(R);var N,j=this.recognizers,te=k.curRecognizer;(!te||te&&te.state&kr)&&(te=k.curRecognizer=null);for(var fe=0;fe<j.length;)N=j[fe],k.stopped!==ws&&(!te||N==te||N.canRecognizeWith(te))?N.recognize(R):N.reset(),!te&&N.state&(Zt|Rn|Jr)&&(te=k.curRecognizer=N),fe++}},get:function(R){if(R instanceof Or)return R;for(var k=this.recognizers,N=0;N<k.length;N++)if(k[N].options.event==R)return k[N];return null},add:function(R){if(d(R,"add",this))return this;var k=this.get(R.options.event);return k&&this.remove(k),this.recognizers.push(R),R.manager=this,this.touchAction.update(),R},remove:function(R){if(d(R,"remove",this))return this;if(R=this.get(R),R){var k=this.recognizers,N=B(k,R);N!==-1&&(k.splice(N,1),this.touchAction.update())}return this},on:function(R,k){if(R!==r&&k!==r){var N=this.handlers;return p(P(R),function(j){N[j]=N[j]||[],N[j].push(k)}),this}},off:function(R,k){if(R!==r){var N=this.handlers;return p(P(R),function(j){k?N[j]&&N[j].splice(B(N[j],k),1):delete N[j]}),this}},emit:function(R,k){this.options.domEvents&&oc(R,k);var N=this.handlers[R]&&this.handlers[R].slice();if(!(!N||!N.length)){k.type=R,k.preventDefault=function(){k.srcEvent.preventDefault()};for(var j=0;j<N.length;)N[j](k),j++}},destroy:function(){this.element&&Ms(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Ms(R,k){var N=R.element;if(N.style){var j;p(R.options.cssProps,function(te,fe){j=F(N.style,fe),k?(R.oldCssProps[j]=N.style[j],N.style[j]=te):N.style[j]=R.oldCssProps[j]||""}),k||(R.oldCssProps={})}}function oc(R,k){var N=t.createEvent("Event");N.initEvent(R,!0,!0),N.gesture=k,k.target.dispatchEvent(N)}return h(Bn,{INPUT_START:$,INPUT_MOVE:Y,INPUT_END:Z,INPUT_CANCEL:oe,STATE_POSSIBLE:ki,STATE_BEGAN:Zt,STATE_CHANGED:Rn,STATE_ENDED:Jr,STATE_RECOGNIZED:kr,STATE_CANCELLED:Wn,STATE_FAILED:Mr,DIRECTION_NONE:ne,DIRECTION_LEFT:de,DIRECTION_RIGHT:se,DIRECTION_UP:ye,DIRECTION_DOWN:ie,DIRECTION_HORIZONTAL:xe,DIRECTION_VERTICAL:Le,DIRECTION_ALL:Ce,Manager:Ia,Input:re,TouchAction:_r,TouchInput:At,MouseInput:it,PointerEventInput:Ct,TouchMouseInput:yt,SingleTouchInput:Tt,Recognizer:Or,AttrRecognizer:ur,Tap:Vi,Pan:Di,Swipe:Ea,Pinch:Ma,Rotate:Ca,Press:Sa,on:w,off:M,each:p,merge:g,extend:v,assign:h,inherit:m,bindFn:y,prefixed:F}),Bn}(typeof window!="undefined"?window:{},typeof document!="undefined"?document:{});function L0(n,t,e){var r=t.getBoundingClientRect(),i=r.top,a=r.left,o=r.width,s=r.height;return e&&(a=a+o*e.left,i=i+s*(1-e.bottom-e.height),o=o*e.width,s=s*e.height),new f.Vector2((n.x-a)/o*2-1,-(n.y-i)/s*2+1)}var Dl=new f.OrthographicCamera(-1,1,1,-1,0,1),us=new f.BufferGeometry;us.setAttribute("position",new f.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));us.setAttribute("uv",new f.Float32BufferAttribute([0,2,0,0,2,0],2));var En=new f.Mesh(us),ls=new f.Scene;ls.add(En);var sm=`
|
|
1436
|
+
`;return function(){var te=new Error("get-stack-trace"),fe=te&&te.stack?te.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",Fe=n.console&&(n.console.warn||n.console.log);return Fe&&Fe.call(n.console,_,fe),P.apply(this,arguments)}}var h;typeof Object.assign!="function"?h=function(k){if(k===r||k===null)throw new TypeError("Cannot convert undefined or null to object");for(var N=Object(k),_=1;_<arguments.length;_++){var te=arguments[_];if(te!==r&&te!==null)for(var fe in te)te.hasOwnProperty(fe)&&(N[fe]=te[fe])}return N}:h=Object.assign;var v=A(function(k,N,_){for(var te=Object.keys(N),fe=0;fe<te.length;)(!_||_&&k[te[fe]]===r)&&(k[te[fe]]=N[te[fe]]),fe++;return k},"extend","Use `assign`."),g=A(function(k,N){return v(k,N,!0)},"merge","Use `assign`.");function m(P,k,N){var _=k.prototype,te;te=P.prototype=Object.create(_),te.constructor=P,te._super=_,N&&h(te,N)}function y(P,k){return function(){return P.apply(k,arguments)}}function b(P,k){return typeof P==o?P.apply(k&&k[0]||r,k):P}function x(P,k){return P===r?k:P}function w(P,k,N){p(B(k),function(_){P.addEventListener(_,N,!1)})}function M(P,k,N){p(B(k),function(_){P.removeEventListener(_,N,!1)})}function S(P,k){for(;P;){if(P==k)return!0;P=P.parentNode}return!1}function E(P,k){return P.indexOf(k)>-1}function B(P){return P.trim().split(/\s+/g)}function R(P,k,N){if(P.indexOf&&!N)return P.indexOf(k);for(var _=0;_<P.length;){if(N&&P[_][N]==k||!N&&P[_]===k)return _;_++}return-1}function C(P){return Array.prototype.slice.call(P,0)}function I(P,k,N){for(var _=[],te=[],fe=0;fe<P.length;){var Fe=P[fe][k];R(te,Fe)<0&&_.push(P[fe]),te[fe]=Fe,fe++}return _=_.sort(function(Vt,et){return Vt[k]>et[k]}),_}function L(P,k){for(var N,_,te=k[0].toUpperCase()+k.slice(1),fe=0;fe<i.length;){if(N=i[fe],_=N?N+te:k,_ in P)return _;fe++}return r}var T=1;function F(){return T++}function D(P){var k=P.ownerDocument||P;return k.defaultView||k.parentWindow||n}var V=/mobile|tablet|ip(ad|hone|od)|android/i,z="ontouchstart"in n,U=L(n,"PointerEvent")!==r,q=z&&V.test(navigator.userAgent),G="touch",K="pen",j="mouse",J="kinect",W=25,$=1,Y=2,Z=4,oe=8,ne=1,de=2,se=4,ye=8,ie=16,xe=de|se,Le=ye|ie,Ce=xe|Le,Oe=["x","y"],ee=["clientX","clientY"];function re(P,k){var N=this;this.manager=P,this.callback=k,this.element=P.element,this.target=P.options.inputTarget,this.domHandler=function(_){b(P.options.enable,[P])&&N.handler(_)},this.init()}re.prototype={handler:function(){},init:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(D(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&M(this.element,this.evEl,this.domHandler),this.evTarget&&M(this.target,this.evTarget,this.domHandler),this.evWin&&M(D(this.element),this.evWin,this.domHandler)}};function H(P){var k,N=P.options.inputClass;return N?k=N:U?k=Ct:q?k=At:z?k=yt:k=it,new k(P,Be)}function Be(P,k,N){var _=N.pointers.length,te=N.changedPointers.length,fe=k&$&&_-te===0,Fe=k&(Z|oe)&&_-te===0;N.isFirst=!!fe,N.isFinal=!!Fe,fe&&(P.session={}),N.eventType=k,Te(P,N),P.emit("hammer.input",N),P.recognize(N),P.session.prevInput=N}function Te(P,k){var N=P.session,_=k.pointers,te=_.length;N.firstInput||(N.firstInput=Ie(k)),te>1&&!N.firstMultiple?N.firstMultiple=Ie(k):te===1&&(N.firstMultiple=!1);var fe=N.firstInput,Fe=N.firstMultiple,ot=Fe?Fe.center:fe.center,Vt=k.center=we(_);k.timeStamp=l(),k.deltaTime=k.timeStamp-fe.timeStamp,k.angle=ze(ot,Vt),k.distance=me(ot,Vt),Ee(N,k),k.offsetDirection=Ae(k.deltaX,k.deltaY);var et=be(k.deltaTime,k.deltaX,k.deltaY);k.overallVelocityX=et.x,k.overallVelocityY=et.y,k.overallVelocity=u(et.x)>u(et.y)?et.x:et.y,k.scale=Fe?Se(Fe.pointers,_):1,k.rotation=Fe?pe(Fe.pointers,_):0,k.maxPointers=N.prevInput?k.pointers.length>N.prevInput.maxPointers?k.pointers.length:N.prevInput.maxPointers:k.pointers.length,Qe(N,k);var Sr=P.element;S(k.srcEvent.target,Sr)&&(Sr=k.srcEvent.target),k.target=Sr}function Ee(P,k){var N=k.center,_=P.offsetDelta||{},te=P.prevDelta||{},fe=P.prevInput||{};(k.eventType===$||fe.eventType===Z)&&(te=P.prevDelta={x:fe.deltaX||0,y:fe.deltaY||0},_=P.offsetDelta={x:N.x,y:N.y}),k.deltaX=te.x+(N.x-_.x),k.deltaY=te.y+(N.y-_.y)}function Qe(P,k){var N=P.lastInterval||k,_=k.timeStamp-N.timeStamp,te,fe,Fe,ot;if(k.eventType!=oe&&(_>W||N.velocity===r)){var Vt=k.deltaX-N.deltaX,et=k.deltaY-N.deltaY,Sr=be(_,Vt,et);fe=Sr.x,Fe=Sr.y,te=u(Sr.x)>u(Sr.y)?Sr.x:Sr.y,ot=Ae(Vt,et),P.lastInterval=k}else te=N.velocity,fe=N.velocityX,Fe=N.velocityY,ot=N.direction;k.velocity=te,k.velocityX=fe,k.velocityY=Fe,k.direction=ot}function Ie(P){for(var k=[],N=0;N<P.pointers.length;)k[N]={clientX:s(P.pointers[N].clientX),clientY:s(P.pointers[N].clientY)},N++;return{timeStamp:l(),pointers:k,center:we(k),deltaX:P.deltaX,deltaY:P.deltaY}}function we(P){var k=P.length;if(k===1)return{x:s(P[0].clientX),y:s(P[0].clientY)};for(var N=0,_=0,te=0;te<k;)N+=P[te].clientX,_+=P[te].clientY,te++;return{x:s(N/k),y:s(_/k)}}function be(P,k,N){return{x:k/P||0,y:N/P||0}}function Ae(P,k){return P===k?ne:u(P)>=u(k)?P<0?de:se:k<0?ye:ie}function me(P,k,N){N||(N=Oe);var _=k[N[0]]-P[N[0]],te=k[N[1]]-P[N[1]];return Math.sqrt(_*_+te*te)}function ze(P,k,N){N||(N=Oe);var _=k[N[0]]-P[N[0]],te=k[N[1]]-P[N[1]];return Math.atan2(te,_)*180/Math.PI}function pe(P,k){return ze(k[1],k[0],ee)+ze(P[1],P[0],ee)}function Se(P,k){return me(k[0],k[1],ee)/me(P[0],P[1],ee)}var St={mousedown:$,mousemove:Y,mouseup:Z},Pe="mousedown",je="mousemove mouseup";function it(){this.evEl=Pe,this.evWin=je,this.pressed=!1,re.apply(this,arguments)}m(it,re,{handler:function(k){var N=St[k.type];N&$&&(k.button===0||k.button===2)&&(this.pressed=!0),N&Y&&k.which!==1&&(N=Z),this.pressed&&(N&Z&&(this.pressed=!1),this.callback(this.manager,N,{pointers:[k],changedPointers:[k],pointerType:j,srcEvent:k}))}});var Xt={pointerdown:$,pointermove:Y,pointerup:Z,pointercancel:oe,pointerout:oe},Kr={2:G,3:K,4:j,5:J},Wt="pointerdown",ut="pointermove pointerup pointercancel";n.MSPointerEvent&&!n.PointerEvent&&(Wt="MSPointerDown",ut="MSPointerMove MSPointerUp MSPointerCancel");function Ct(){this.evEl=Wt,this.evWin=ut,re.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}m(Ct,re,{handler:function(k){var N=this.store,_=!1,te=!1,fe=k.type.toLowerCase().replace("ms",""),Fe=Xt[fe],ot=Kr[k.pointerType]||k.pointerType,Vt=ot==G,et=R(N,k.pointerId,"pointerId");Fe&$&&(k.button===0||k.button===2||Vt)?et<0&&(N.push(k),et=N.length-1):Fe&(Z|oe)?_=!0:!Vt&&k.buttons===0&&(_=!0,te=!0,Fe=Xt.pointerup),!(et<0)&&(te||(N[et]=k),this.callback(this.manager,Fe,{pointers:N,changedPointers:[k],pointerType:ot,srcEvent:N[et]}),_&&N.splice(et,1))}});var dt={touchstart:$,touchmove:Y,touchend:Z,touchcancel:oe},Et="touchstart",It="touchstart touchmove touchend touchcancel";function Tt(){this.evTarget=Et,this.evWin=It,this.started=!1,re.apply(this,arguments)}m(Tt,re,{handler:function(k){var N=dt[k.type];if(N===$&&(this.started=!0),!!this.started){var _=Xe.call(this,k,N);N&(Z|oe)&&_[0].length-_[1].length===0&&(this.started=!1),this.callback(this.manager,N,{pointers:_[0],changedPointers:_[1],pointerType:G,srcEvent:k})}}});function Xe(P,k){var N=C(P.touches),_=C(P.changedTouches);return k&(Z|oe)&&(N=I(N.concat(_),"identifier")),[N,_]}var Ne={touchstart:$,touchmove:Y,touchend:Z,touchcancel:oe},We="touchstart touchmove touchend touchcancel";function At(){this.evTarget=We,this.targetIds={},re.apply(this,arguments)}m(At,re,{handler:function(k){var N=Ne[k.type],_=Ze.call(this,k,N);_&&this.callback(this.manager,N,{pointers:_[0],changedPointers:_[1],pointerType:G,srcEvent:k})}});function Ze(P,k){var N=C(P.touches),_=this.targetIds;if(k&($|Y)&&N.length===1)return _[N[0].identifier]=!0,[N,N];var te,fe,Fe=C(P.changedTouches),ot=[],Vt=this.target;if(fe=N.filter(function(et){return S(et.target,Vt)}),k===$)for(te=0;te<fe.length;)_[fe[te].identifier]=!0,te++;for(te=0;te<Fe.length;)_[Fe[te].identifier]&&ot.push(Fe[te]),k&(Z|oe)&&delete _[Fe[te].identifier],te++;if(ot.length)return[I(fe.concat(ot),"identifier"),ot]}var gt=2500,Ht=25;function yt(){re.apply(this,arguments);var P=y(this.handler,this);this.touch=new At(this.manager,P),this.mouse=new it(this.manager,P),this.primaryTouch=null,this.lastTouches=[]}m(yt,re,{handler:function(k,N,_){var te=_.pointerType==G,fe=_.pointerType==j;if(!(fe&&_.sourceCapabilities&&_.sourceCapabilities.firesTouchEvents)){if(te)Zt.call(this,N,_);else if(fe&&_r.call(this,_))return;this.callback(k,N,_)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Zt(P,k){P&$?(this.primaryTouch=k.changedPointers[0].identifier,xr.call(this,k)):P&(Z|oe)&&xr.call(this,k)}function xr(P){var k=P.changedPointers[0];if(k.identifier===this.primaryTouch){var N={x:k.clientX,y:k.clientY};this.lastTouches.push(N);var _=this.lastTouches,te=function(){var fe=_.indexOf(N);fe>-1&&_.splice(fe,1)};setTimeout(te,gt)}}function _r(P){for(var k=P.srcEvent.clientX,N=P.srcEvent.clientY,_=0;_<this.lastTouches.length;_++){var te=this.lastTouches[_],fe=Math.abs(k-te.x),Fe=Math.abs(N-te.y);if(fe<=Ht&&Fe<=Ht)return!0}return!1}var wr=a?L(a.style,"touchAction"):r,Lr=wr!==r,Dt="compute",Ge="auto",ke="manipulation",Ye="none",bt="pan-x",Pt="pan-y",or=ic();function jr(P,k){this.manager=P,this.set(k)}jr.prototype={set:function(P){P==Dt&&(P=this.compute()),Lr&&this.manager.element.style&&or[P]&&(this.manager.element.style[wr]=P),this.actions=P.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var P=[];return p(this.manager.recognizers,function(k){b(k.options.enable,[k])&&(P=P.concat(k.getTouchAction()))}),mn(P.join(" "))},preventDefaults:function(P){var k=P.srcEvent,N=P.offsetDirection;if(this.manager.session.prevented){k.preventDefault();return}var _=this.actions,te=E(_,Ye)&&!or[Ye],fe=E(_,Pt)&&!or[Pt],Fe=E(_,bt)&&!or[bt];if(te){var ot=P.pointers.length===1,Vt=P.distance<2,et=P.deltaTime<250;if(ot&&Vt&&et)return}if(!(Fe&&fe)&&(te||fe&&N&xe||Fe&&N&Le))return this.preventSrc(k)},preventSrc:function(P){this.manager.session.prevented=!0,P.preventDefault()}};function mn(P){if(E(P,Ye))return Ye;var k=E(P,bt),N=E(P,Pt);return k&&N?Ye:k||N?k?bt:Pt:E(P,ke)?ke:Ge}function ic(){if(!Lr)return!1;var P={},k=n.CSS&&n.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(N){P[N]=k?n.CSS.supports("touch-action",N):!0}),P}var ki=1,Yt=2,Rn=4,Jr=8,kr=Jr,Wn=16,Mr=32;function Or(P){this.options=h({},this.defaults,P||{}),this.id=F(),this.manager=null,this.options.enable=x(this.options.enable,!0),this.state=ki,this.simultaneous={},this.requireFail=[]}Or.prototype={defaults:{},set:function(P){return h(this.options,P),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(P){if(d(P,"recognizeWith",this))return this;var k=this.simultaneous;return P=Oi(P,this),k[P.id]||(k[P.id]=P,P.recognizeWith(this)),this},dropRecognizeWith:function(P){return d(P,"dropRecognizeWith",this)?this:(P=Oi(P,this),delete this.simultaneous[P.id],this)},requireFailure:function(P){if(d(P,"requireFailure",this))return this;var k=this.requireFail;return P=Oi(P,this),R(k,P)===-1&&(k.push(P),P.requireFailure(this)),this},dropRequireFailure:function(P){if(d(P,"dropRequireFailure",this))return this;P=Oi(P,this);var k=R(this.requireFail,P);return k>-1&&this.requireFail.splice(k,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(P){return!!this.simultaneous[P.id]},emit:function(P){var k=this,N=this.state;function _(te){k.manager.emit(te,P)}N<Jr&&_(k.options.event+bs(N)),_(k.options.event),P.additionalEvent&&_(P.additionalEvent),N>=Jr&&_(k.options.event+bs(N))},tryEmit:function(P){if(this.canEmit())return this.emit(P);this.state=Mr},canEmit:function(){for(var P=0;P<this.requireFail.length;){if(!(this.requireFail[P].state&(Mr|ki)))return!1;P++}return!0},recognize:function(P){var k=h({},P);if(!b(this.options.enable,[this,k])){this.reset(),this.state=Mr;return}this.state&(kr|Wn|Mr)&&(this.state=ki),this.state=this.process(k),this.state&(Yt|Rn|Jr|Wn)&&this.tryEmit(k)},process:function(P){},getTouchAction:function(){},reset:function(){}};function bs(P){return P&Wn?"cancel":P&Jr?"end":P&Rn?"move":P&Yt?"start":""}function xs(P){return P==ie?"down":P==ye?"up":P==de?"left":P==se?"right":""}function Oi(P,k){var N=k.manager;return N?N.get(P):P}function sr(){Or.apply(this,arguments)}m(sr,Or,{defaults:{pointers:1},attrTest:function(P){var k=this.options.pointers;return k===0||P.pointers.length===k},process:function(P){var k=this.state,N=P.eventType,_=k&(Yt|Rn),te=this.attrTest(P);return _&&(N&oe||!te)?k|Wn:_||te?N&Z?k|Jr:k&Yt?k|Rn:Yt:Mr}});function Di(){sr.apply(this,arguments),this.pX=null,this.pY=null}m(Di,sr,{defaults:{event:"pan",threshold:10,pointers:1,direction:Ce},getTouchAction:function(){var P=this.options.direction,k=[];return P&xe&&k.push(Pt),P&Le&&k.push(bt),k},directionTest:function(P){var k=this.options,N=!0,_=P.distance,te=P.direction,fe=P.deltaX,Fe=P.deltaY;return te&k.direction||(k.direction&xe?(te=fe===0?ne:fe<0?de:se,N=fe!=this.pX,_=Math.abs(P.deltaX)):(te=Fe===0?ne:Fe<0?ye:ie,N=Fe!=this.pY,_=Math.abs(P.deltaY))),P.direction=te,N&&_>k.threshold&&te&k.direction},attrTest:function(P){return sr.prototype.attrTest.call(this,P)&&(this.state&Yt||!(this.state&Yt)&&this.directionTest(P))},emit:function(P){this.pX=P.deltaX,this.pY=P.deltaY;var k=xs(P.direction);k&&(P.additionalEvent=this.options.event+k),this._super.emit.call(this,P)}});function Ma(){sr.apply(this,arguments)}m(Ma,sr,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ye]},attrTest:function(P){return this._super.attrTest.call(this,P)&&(Math.abs(P.scale-1)>this.options.threshold||this.state&Yt)},emit:function(P){if(P.scale!==1){var k=P.scale<1?"in":"out";P.additionalEvent=this.options.event+k}this._super.emit.call(this,P)}});function Sa(){Or.apply(this,arguments),this._timer=null,this._input=null}m(Sa,Or,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ge]},process:function(P){var k=this.options,N=P.pointers.length===k.pointers,_=P.distance<k.threshold,te=P.deltaTime>k.time;if(this._input=P,!_||!N||P.eventType&(Z|oe)&&!te)this.reset();else if(P.eventType&$)this.reset(),this._timer=c(function(){this.state=kr,this.tryEmit()},k.time,this);else if(P.eventType&Z)return kr;return Mr},reset:function(){clearTimeout(this._timer)},emit:function(P){this.state===kr&&(P&&P.eventType&Z?this.manager.emit(this.options.event+"up",P):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function Ca(){sr.apply(this,arguments)}m(Ca,sr,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ye]},attrTest:function(P){return this._super.attrTest.call(this,P)&&(Math.abs(P.rotation)>this.options.threshold||this.state&Yt)}});function Ea(){sr.apply(this,arguments)}m(Ea,sr,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:xe|Le,pointers:1},getTouchAction:function(){return Di.prototype.getTouchAction.call(this)},attrTest:function(P){var k=this.options.direction,N;return k&(xe|Le)?N=P.overallVelocity:k&xe?N=P.overallVelocityX:k&Le&&(N=P.overallVelocityY),this._super.attrTest.call(this,P)&&k&P.offsetDirection&&P.distance>this.options.threshold&&P.maxPointers==this.options.pointers&&u(N)>this.options.velocity&&P.eventType&Z},emit:function(P){var k=xs(P.offsetDirection);k&&this.manager.emit(this.options.event+k,P),this.manager.emit(this.options.event,P)}});function Vi(){Or.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}m(Vi,Or,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ke]},process:function(P){var k=this.options,N=P.pointers.length===k.pointers,_=P.distance<k.threshold,te=P.deltaTime<k.time;if(this.reset(),P.eventType&$&&this.count===0)return this.failTimeout();if(_&&te&&N){if(P.eventType!=Z)return this.failTimeout();var fe=this.pTime?P.timeStamp-this.pTime<k.interval:!0,Fe=!this.pCenter||me(this.pCenter,P.center)<k.posThreshold;this.pTime=P.timeStamp,this.pCenter=P.center,!Fe||!fe?this.count=1:this.count+=1,this._input=P;var ot=this.count%k.taps;if(ot===0)return this.hasRequireFailures()?(this._timer=c(function(){this.state=kr,this.tryEmit()},k.interval,this),Yt):kr}return Mr},failTimeout:function(){return this._timer=c(function(){this.state=Mr},this.options.interval,this),Mr},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==kr&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Bn(P,k){return k=k||{},k.recognizers=x(k.recognizers,Bn.defaults.preset),new Ia(P,k)}Bn.VERSION="2.0.7",Bn.defaults={domEvents:!1,touchAction:Dt,enable:!0,inputTarget:null,inputClass:null,preset:[[Ca,{enable:!1}],[Ma,{enable:!1},["rotate"]],[Ea,{direction:xe}],[Di,{direction:xe},["swipe"]],[Vi],[Vi,{event:"doubletap",taps:2},["tap"]],[Sa]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var ac=1,ws=2;function Ia(P,k){this.options=h({},Bn.defaults,k||{}),this.options.inputTarget=this.options.inputTarget||P,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=P,this.input=H(this),this.touchAction=new jr(this,this.options.touchAction),Ms(this,!0),p(this.options.recognizers,function(N){var _=this.add(new N[0](N[1]));N[2]&&_.recognizeWith(N[2]),N[3]&&_.requireFailure(N[3])},this)}Ia.prototype={set:function(P){return h(this.options,P),P.touchAction&&this.touchAction.update(),P.inputTarget&&(this.input.destroy(),this.input.target=P.inputTarget,this.input.init()),this},stop:function(P){this.session.stopped=P?ws:ac},recognize:function(P){var k=this.session;if(!k.stopped){this.touchAction.preventDefaults(P);var N,_=this.recognizers,te=k.curRecognizer;(!te||te&&te.state&kr)&&(te=k.curRecognizer=null);for(var fe=0;fe<_.length;)N=_[fe],k.stopped!==ws&&(!te||N==te||N.canRecognizeWith(te))?N.recognize(P):N.reset(),!te&&N.state&(Yt|Rn|Jr)&&(te=k.curRecognizer=N),fe++}},get:function(P){if(P instanceof Or)return P;for(var k=this.recognizers,N=0;N<k.length;N++)if(k[N].options.event==P)return k[N];return null},add:function(P){if(d(P,"add",this))return this;var k=this.get(P.options.event);return k&&this.remove(k),this.recognizers.push(P),P.manager=this,this.touchAction.update(),P},remove:function(P){if(d(P,"remove",this))return this;if(P=this.get(P),P){var k=this.recognizers,N=R(k,P);N!==-1&&(k.splice(N,1),this.touchAction.update())}return this},on:function(P,k){if(P!==r&&k!==r){var N=this.handlers;return p(B(P),function(_){N[_]=N[_]||[],N[_].push(k)}),this}},off:function(P,k){if(P!==r){var N=this.handlers;return p(B(P),function(_){k?N[_]&&N[_].splice(R(N[_],k),1):delete N[_]}),this}},emit:function(P,k){this.options.domEvents&&oc(P,k);var N=this.handlers[P]&&this.handlers[P].slice();if(!(!N||!N.length)){k.type=P,k.preventDefault=function(){k.srcEvent.preventDefault()};for(var _=0;_<N.length;)N[_](k),_++}},destroy:function(){this.element&&Ms(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Ms(P,k){var N=P.element;if(N.style){var _;p(P.options.cssProps,function(te,fe){_=L(N.style,fe),k?(P.oldCssProps[_]=N.style[_],N.style[_]=te):N.style[_]=P.oldCssProps[_]||""}),k||(P.oldCssProps={})}}function oc(P,k){var N=t.createEvent("Event");N.initEvent(P,!0,!0),N.gesture=k,k.target.dispatchEvent(N)}return h(Bn,{INPUT_START:$,INPUT_MOVE:Y,INPUT_END:Z,INPUT_CANCEL:oe,STATE_POSSIBLE:ki,STATE_BEGAN:Yt,STATE_CHANGED:Rn,STATE_ENDED:Jr,STATE_RECOGNIZED:kr,STATE_CANCELLED:Wn,STATE_FAILED:Mr,DIRECTION_NONE:ne,DIRECTION_LEFT:de,DIRECTION_RIGHT:se,DIRECTION_UP:ye,DIRECTION_DOWN:ie,DIRECTION_HORIZONTAL:xe,DIRECTION_VERTICAL:Le,DIRECTION_ALL:Ce,Manager:Ia,Input:re,TouchAction:jr,TouchInput:At,MouseInput:it,PointerEventInput:Ct,TouchMouseInput:yt,SingleTouchInput:Tt,Recognizer:Or,AttrRecognizer:sr,Tap:Vi,Pan:Di,Swipe:Ea,Pinch:Ma,Rotate:Ca,Press:Sa,on:w,off:M,each:p,merge:g,extend:v,assign:h,inherit:m,bindFn:y,prefixed:L}),Bn}(typeof window!="undefined"?window:{},typeof document!="undefined"?document:{});function L0(n,t,e){var r=t.getBoundingClientRect(),i=r.top,a=r.left,o=r.width,s=r.height;return e&&(a=a+o*e.left,i=i+s*(1-e.bottom-e.height),o=o*e.width,s=s*e.height),new f.Vector2((n.x-a)/o*2-1,-(n.y-i)/s*2+1)}var Dl=new f.OrthographicCamera(-1,1,1,-1,0,1),us=new f.BufferGeometry;us.setAttribute("position",new f.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));us.setAttribute("uv",new f.Float32BufferAttribute([0,2,0,0,2,0],2));var En=new f.Mesh(us),ls=new f.Scene;ls.add(En);var sm=`
|
|
1437
1437
|
varying vec2 vUv;
|
|
1438
1438
|
void main() {
|
|
1439
1439
|
vUv = uv;
|
|
@@ -1474,7 +1474,7 @@ void main() {
|
|
|
1474
1474
|
|
|
1475
1475
|
gl_Position = projectionMatrix * mvPosition;
|
|
1476
1476
|
}
|
|
1477
|
-
`,pm=new f.OrthographicCamera(-1,1,1,-1,0,1),cs=new f.BufferGeometry;cs.setAttribute("position",new f.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));cs.setAttribute("uv",new f.Float32BufferAttribute([0,2,0,0,2,0],2));var Nl=new f.MeshBasicMaterial,Vo=new f.Mesh(cs,Nl),zl=new f.Scene;zl.add(Vo);var vm=function(){function n(t){this.renderer=t,this.material=new f.ShaderMaterial({vertexShader:hm,fragmentShader:dm,uniforms:Object.assign({depthBuffer:new f.Uniform(null)}),blending:f.NoBlending,depthWrite:!0,depthTest:!0}),this.renderer.getContext()&&this.renderer.getContext()instanceof WebGLRenderingContext&&(this.material.extensions.fragDepth=!0)}return n.prototype.render=function(t,e){var r=this.renderer.getRenderTarget();this.material.uniforms.depthBuffer.value=t,Vo.material=this.material,this.renderer.setRenderTarget(e||null),this.renderer.render(zl,pm),this.renderer.setRenderTarget(r),Vo.material=Nl},n.prototype.dispose=function(){this.material.dispose()},n}(),ao=new f.Vector2,fs=function(n){ue(t,n);function t(e){var r,i,a,o,s,u,l=n.call(this)||this,c=t.parseArgs(e);l.mode="",l.pending=new Set,l.userAction=c.initial.userAction,l.destroyed=!1,l.ident=c.ident,l.scene=c.scene,l.xrCustomObjectsScene=c.xrCustomObjectsScene,l.helper=c.helper,l.boundingMesh=c.boundingMesh,l.camera=c.camera,l.renderer=c.renderer,l.scissor=c.scissor,l.element=c.element,l.models=c.models,l.enableWheel=c.enableWheel,l.enableIOSEDR=(r=c.enableIOSEDR)!==null&&r!==void 0?r:!1,l.enableEDL=(i=c.enableEDL)!==null&&i!==void 0?i:!0,l.enableHQ=(a=c.enableHQ)!==null&&a!==void 0?a:!0,l.works=c.works,l.imageOptions=c.imageOptions,l.videoTexture=c.videoTexture,l.extraElements=c.extraElements,l.initial=c.initial,l.currentPano=typeof l.initial.state.panoIndex=="number"?{workCode:(u=(o=l.initial.state.workCode)!==null&&o!==void 0?o:(s=c.works[0])===null||s===void 0?void 0:s.workCode)!==null&&u!==void 0?u:"",panoIndex:l.initial.state.panoIndex}:{workCode:l.initial.currentState.workCode,panoIndex:l.initial.currentState.panoIndex},l.needsRender=!0,l.modelSceneNeedsRender=!0,l.cameraMotion=new Re({longitude:{value:l.camera.pose.longitude,circle:[0,Math.PI*2]},latitude:l.camera.pose.latitude,fov:l.camera.pose.fov}),l.inMomentumMovement=null,l.eventUnbinds=[c.element].concat(c.extraElements||[]).map(function(p){return l.bindEvents(p)}),l.pending.add("init-animation"),l.initAnimationReady=new Promise(function(p){Mt.shared.add(function(){l.initAnimation().then(function(){l.pending.delete("init-animation"),p()})},!0)}),l.initAnimationIsReady=!1,l.initAnimationReady.then(function(){return l.initAnimationIsReady=!0}),l.modelScene=c.modelScene;var d=new f.Vector2;return l.renderer.getDrawingBufferSize(d),l.modelRenderTarget=c.modelRenderTarget,l.copyPass=new Vl(l.renderer),l.depthCopyPass=new vm(l.renderer),l.screenBuffers=[],l.lastPostProcessingType=null,l}return t.parseArgs=function(e){return e instanceof t?e:O({},e)},t.initAnimationEndState=function(e){var r,i,a,o,s,u,l,c,d=this.parseArgs(e),p=d.initial,A=p.state,h=p.currentState,v=typeof A.panoIndex=="number"?{workCode:(a=(r=A.workCode)!==null&&r!==void 0?r:(i=d.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:A.panoIndex}:{workCode:h.workCode,panoIndex:h.panoIndex};return O(O({},v),{mode:"",longitude:(o=A.longitude)!==null&&o!==void 0?o:h.longitude,latitude:(s=A.latitude)!==null&&s!==void 0?s:h.latitude,fov:(u=A.fov)!==null&&u!==void 0?u:h.fov,offset:(l=A.offset)!==null&&l!==void 0?l:h.offset,distance:(c=A.distance)!==null&&c!==void 0?c:h.distance})},t.prototype.updateConfiguration=function(e){return!0},t.prototype.destroy=function(){var e;this.stopMomentumMovement(),this.destroyed=!0,this.off(),this.cameraMotion.dispose();for(var r=0,i=this.eventUnbinds;r<i.length;r++){var a=i[r];a()}this.copyEffect&&(this.copyEffect.dispose(),delete this.copyEffect),delete this.panState,(e=this.pressState)===null||e===void 0||e.stop(),delete this.pressState},t.prototype.isReady=function(){return this.inMomentumMovement===null&&this.pending.size===0&&this.cameraMotion.ended===!0},t.prototype.bindExtraElement=function(e){for(var r=0,i=this.eventUnbinds;r<i.length;r++){var a=i[r];if(a.element===e)return}this.eventUnbinds.push(this.bindEvents(e))},t.prototype.unbindExtraElement=function(e){for(var r=[],i=0,a=this.eventUnbinds;i<a.length;i++){var o=a[i];o.element===e?o():r.push(o)}this.eventUnbinds=r},t.prototype.updateRenderSize=function(e){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.modelRenderTarget.setSize(e.x,e.y),this.screenBuffers.forEach(function(r){r.setSize(e.x,e.y)})},t.prototype.updateModel=function(e){this.needsRender=!0,this.modelSceneNeedsRender=!0},t.prototype.updateWork=function(e,r,i,a){return this.works=e,this.userAction=a,!1},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={};this.cameraMotion.ended&&(this.cameraMotion.update(e),i.longitude=this.cameraMotion.value.longitude,i.latitude=this.cameraMotion.value.latitude,i.fov=this.cameraMotion.value.fov),or(i)&&this.setCamera(i)}},t.prototype.render=function(e,r){var i=this.renderer.getRenderTarget();this.updateScreenBuffer(r),e&&(this.renderer.setRenderTarget(this.modelRenderTarget),this.renderer.render(this.modelScene,this.camera)),this.depthCopyPass.render(this.modelRenderTarget.depthTexture,i),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.copyPass.render(this.modelRenderTarget,i),this.renderer.setRenderTarget(i),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t.prototype.postProcessing=function(e,r){this.destroyed},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={};return e.longitude!==void 0&&(o.longitude=e.longitude),e.latitude!==void 0&&(o.latitude=e.latitude),e.fov!==void 0&&(o.fov=e.fov),a.cameraMotion.set(o,r).catch(Q)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=0,u=e;s<u.length;s++){var l=u[s];o.push({key:l.key,progress:l.progress,value:{longitude:l.value.longitude,latitude:l.value.latitude,fov:l.value.fov}})}return a.cameraMotion.setKeyframes(o,r)})},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(ve())[1];return O(O({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance})},t.prototype.initAnimation=function(){var e=this.initial;e.state,e.currentState,e.duration;var r=e.userAction,i=t.initAnimationEndState(this);return this.userAction=r,this.emit("initAnimation.start",X("initAnimation.start",{state:i,userAction:this.userAction})),this.emit("initAnimation.end",X("initAnimation.end",{state:i,userAction:this.userAction})),Promise.resolve()},t.prototype.setCamera=function(e){var r,i,a,o,s;e===void 0&&(e={});var u=(r=e.longitude)!==null&&r!==void 0?r:this.camera.pose.longitude,l=(i=e.latitude)!==null&&i!==void 0?i:this.camera.pose.latitude,c=(a=e.fov)!==null&&a!==void 0?a:this.camera.pose.fov,d=(o=e.distance)!==null&&o!==void 0?o:this.camera.pose.distance,p=(s=e.offset)!==null&&s!==void 0?s:this.camera.pose.offset,A=er(u,this.camera.pose.longitude,Math.PI*2)||er(l,this.camera.pose.latitude),h=er(c,this.camera.pose.fov),v=er(d,this.camera.pose.distance),g=ea(p,this.camera.pose.offset);(h||A||g||v)&&(this.camera.setFromPose({longitude:u,latitude:l,fov:c,distance:d,offset:p}),this.emit("camera.update",X("camera.update",{userAction:this.userAction,state:O(O({},this.currentPano),{mode:this.mode,longitude:u,latitude:l,fov:c,offset:p,distance:d})})),this.needsRender=!0,this.modelSceneNeedsRender=!0)},t.prototype.stopMomentumMovement=function(){if(this.inMomentumMovement&&this.inMomentumMovement.event&&!this.inMomentumMovement.event.defaultPrevented&&!this.inMomentumMovement.event.isFinal){var e=X("gesture.momentum",O(O({},this.inMomentumMovement.event),{isFirst:!1,isFinal:!0}));this.emit("gesture.momentum",e)}this.inMomentumMovement=null},t.prototype.onPanGesture=function(e){this.stopMomentumMovement(),this.emit("gesture.pan",e)},t.prototype.onTapGesture=function(e){this.stopMomentumMovement(),this.emit("gesture.tap",e)},t.prototype.onDblTapGesture=function(e){this.stopMomentumMovement(),this.emit("gesture.dbltap",e),!e.defaultPrevented&&(e.type="gesture.tap",this.onTapGesture(e))},t.prototype.onPressGesture=function(e){this.stopMomentumMovement(),this.emit("gesture.press",e)},t.prototype.onPinchGesture=function(e){this.stopMomentumMovement(),this.emit("gesture.pinch",e)},t.prototype.onMouseWheel=function(e){this.stopMomentumMovement(),this.emit("gesture.mousewheel",e)},t.prototype.onMouseMove=function(e){this.stopMomentumMovement(),this.emit("gesture.mousemove",e)},t.prototype.relativeClientPosition=function(e){return L0(e,this.element,this.scissor)},t.prototype.bindEvents=function(e){var r=this,i=function(C){var I=L0(C,r.element,r.scissor);return!(Math.abs(I.x)>1||Math.abs(I.y)>1)},a=new oi.Manager(e),o=function(C){var I=C.session;return I.firstInput||null},s=new oi.Pan({threshold:10,pointers:0}),u=new oi.Tap({interval:410}),l=new oi.Pinch({threshold:0,pointers:2});a.add([s,u,l]),a.on("panstart pan",function(C){var I=o(a);if(!(I&&!i(I.center))){var F=X("gesture.pan",{target:C.target,pointerType:C.pointerType,srcEvent:C.srcEvent,pointers:C.pointers.map(function(T){var L=r.relativeClientPosition(T),D=new f.Raycaster;return D.params.Points={threshold:.1},D.setFromCamera(L,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:L,raycaster:D}}),isFirst:C.isFirst,isFinal:C.isFinal,scale:C.scale,center:function(T){var L=r.relativeClientPosition(T),D=new f.Raycaster;return D.params.Points={threshold:.1},D.setFromCamera(L,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:L,raycaster:D}}(C.center),velocityX:C.velocityX,velocityY:C.velocityY,overallVelocityX:C.overallVelocityX,overallVelocityY:C.overallVelocityY,userAction:!0,state:O(O({mode:r.mode},r.currentPano),tt(r.camera.pose))});r.onPanGesture(F),b()}}),a.on("tap",function(C){if(!(C.pointerType==="mouse"&&C.srcEvent.button!==0)){var I=o(a);if(!(I&&!i(I.center))){var F=X("gesture.tap",{target:C.target,pointerType:C.pointerType,srcEvent:C.srcEvent,pointers:C.pointers.map(function(T){var L=r.relativeClientPosition(T),D=new f.Raycaster;return D.params.Points={threshold:.1},D.setFromCamera(L,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:L,raycaster:D}}),isFirst:!0,isFinal:!0,scale:C.scale,center:function(T){var L=r.relativeClientPosition(T),D=new f.Raycaster;return D.params.Points={threshold:.1},D.setFromCamera(L,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:L,raycaster:D}}(C.center),velocityX:C.velocityX,velocityY:C.velocityY,overallVelocityX:C.overallVelocityX,overallVelocityY:C.overallVelocityY,userAction:!0,state:O(O({mode:r.mode},r.currentPano),tt(r.camera.pose))});r.onTapGesture(F),b()}}}),a.on("pinchstart pinch pinchend",function(C){var I=o(a);if(!(I&&!i(I.center))){var F=X("gesture.pinch",{target:C.target,pointerType:C.pointerType,srcEvent:C.srcEvent,pointers:C.pointers.map(function(T){var L,D=r.relativeClientPosition(T),V=new f.Raycaster;return V.params.Points={threshold:.1},V.setFromCamera(D,r.camera),{x:T.x,y:T.y,delta:(L=T.delta)!==null&&L!==void 0?L:0,buttons:0,coords:D,raycaster:V}}),isFirst:C.type==="pinchstart",isFinal:C.type==="pinchend",scale:C.scale,center:function(T){var L=r.relativeClientPosition(T),D=new f.Raycaster;return D.params.Points={threshold:.1},D.setFromCamera(L,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:L,raycaster:D}}(C.center),velocityX:C.velocityX,velocityY:C.velocityY,overallVelocityX:C.overallVelocityX,overallVelocityY:C.overallVelocityY,userAction:!0,state:O(O({mode:r.mode},r.currentPano),tt(r.camera.pose))});r.onPinchGesture(F),b()}}),a.on("dbltap",function(C){if(!(C.pointerType==="mouse"&&C.srcEvent.button!==0)){var I=o(a);if(!(I&&!i(I.center))){var F=X("gesture.dbltap",{target:C.target,pointerType:C.pointerType,srcEvent:C.srcEvent,pointers:C.pointers.map(function(T){var L=r.relativeClientPosition(T),D=new f.Raycaster;return D.params.Points={threshold:.1},D.setFromCamera(L,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:L,raycaster:D}}),isFirst:!0,isFinal:!0,scale:C.scale,center:function(T){var L=r.relativeClientPosition(T),D=new f.Raycaster;return D.params.Points={threshold:.1},D.setFromCamera(L,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:L,raycaster:D}}(C.center),velocityX:C.velocityX,velocityY:C.velocityY,overallVelocityX:C.overallVelocityX,overallVelocityY:C.overallVelocityY,userAction:!0,state:O(O({mode:r.mode},r.currentPano),tt(r.camera.pose))});r.onDblTapGesture(F),b()}}});var c=null,d=null,p=function(C,I,F){var T={x:F.clientX,y:F.clientY},L=r.relativeClientPosition(T),D=new f.Raycaster;D.params.Points={threshold:.1},D.setFromCamera(L,r.camera);var V=O(O({},T),{coords:L,raycaster:D,buttons:F.buttons,delta:0}),z=C==="pinchend"?I:I-F.deltaY/280,U=X("gesture.pinch",{target:F.target,pointerType:"mouse",srcEvent:F,pointers:[O({},V)],isFirst:C==="pinchstart",isFinal:C==="pinchend",scale:ce(z,.1,10),center:O({},V),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:O(O({mode:r.mode},r.currentPano),tt(r.camera.pose))});return U},A=function(C){var I,F={x:C.clientX,y:C.clientY};if(i(F)){if(C.preventDefault(),C.ctrlKey){var T=(I=c==null?void 0:c.prevEvent.scale)!==null&&I!==void 0?I:1,L=p(c?"pinch":"pinchstart",T,C);c===null?c={firstEvent:L,prevEvent:L}:c.prevEvent=L,r.onPinchGesture(L),d!==null&&window.clearTimeout(d),d=window.setTimeout(function(){var K;d=null;var _=(K=c==null?void 0:c.prevEvent.scale)!==null&&K!==void 0?K:1,J=p("pinchend",_,C);c=null,r.onPinchGesture(J)},200)}else{var D=(Math.abs(C.deltaY)>Math.abs(C.deltaX)?C.deltaY:C.deltaX)/-60,V=r.mouseWheelState!==void 0,z={x:C.clientX,y:C.clientY},U=r.relativeClientPosition(z),q=new f.Raycaster;q.params.Points={threshold:.1},q.setFromCamera(U,r.camera);var G=O(O({},z),{coords:U,raycaster:q,buttons:C.buttons,delta:D}),L=X("gesture.mousewheel",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[O({},G)],isFirst:V,isFinal:!1,scale:0,center:O({},G),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:O(O({mode:r.mode},r.currentPano),tt(r.camera.pose))});r.onMouseWheel(L),r.mouseWheelState&&clearTimeout(r.mouseWheelState.timer),r.mouseWheelState={timer:setTimeout(function(){delete r.mouseWheelState;var _=X("gesture.mousewheel",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[O(O({},G),{delta:0})],isFirst:!1,isFinal:!0,scale:0,center:O(O({},G),{delta:0}),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:O(O({mode:r.mode},r.currentPano),tt(r.camera.pose))});r.onMouseWheel(_)},100)}}b()}},h=function(C){if(!ai){if(!i({x:C.clientX,y:C.clientY})){v();return}var I=!1;r.mouseMoveState||(I=!0);var F={x:C.clientX,y:C.clientY},T=r.relativeClientPosition(F),L=new f.Raycaster;L.params.Points={threshold:.1},L.setFromCamera(T,r.camera);var D=O(O({},F),{coords:T,raycaster:L,buttons:C.buttons,delta:0}),V=X("gesture.mousemove",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[O({},D)],isFirst:I,isFinal:!1,scale:0,center:O({},D),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:O(O({mode:r.mode},r.currentPano),tt(r.camera.pose))});r.mouseMoveState={timeStamp:ve(),event:V},r.onMouseMove(V),r.pressState&&Math.abs(C.clientX-r.pressState.event.center.y)>10&&Math.abs(C.clientY-r.pressState.event.center.y)>10&&b()}},v=function(){if(r.mouseMoveState){var C=X(r.mouseMoveState.event.type,O(O({},r.mouseMoveState.event),{isFinal:!0}));delete r.mouseMoveState,r.onMouseMove(C)}b()},g=function(C){if(!i(C.center)){b();return}var I=!1;r.pressState||(I=!0,r.pressState={event:C,timeStamp:ve(),stop:Q});var F=ve()-r.pressState.timeStamp,T=X(r.pressState.event.type,O(O({},r.pressState.event),{isFirst:I,isFinal:!1,center:O(O({},r.pressState.event.center),{delta:F}),pointers:r.pressState.event.pointers.map(function(L){return O(O({},L),{delta:F})})}));r.onPressGesture(T),r.pressState&&(r.pressState.stop=Mt.shared.add(function(L){g(C)},!0,1))},m=function(C){if(b(),!(C.touches.length>1||C.changedTouches.length<=0)){var I={x:C.changedTouches[0].clientX,y:C.changedTouches[0].clientY},F=r.relativeClientPosition(I),T=new f.Raycaster;T.params.Points={threshold:.1},T.setFromCamera(F,r.camera);var L=O(O({},I),{coords:F,raycaster:T,buttons:0,delta:0}),D=X("gesture.press",{target:C.target,pointerType:"touch",srcEvent:C,pointers:[O({},L)],isFirst:!1,isFinal:!1,scale:0,center:L,velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:O(O({mode:r.mode},r.currentPano),tt(r.camera.pose))});g(D)}},y=function(C){b();var I={x:C.clientX,y:C.clientY},F=r.relativeClientPosition(I),T=new f.Raycaster;T.params.Points={threshold:.1},T.setFromCamera(F,r.camera);var L=O(O({},I),{coords:F,raycaster:T,buttons:C.buttons,delta:0}),D=X("gesture.press",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[O({},L)],isFirst:!1,isFinal:!1,scale:0,center:L,velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:O(O({mode:r.mode},r.currentPano),tt(r.camera.pose))});g(D)},b=function(){var C;if(r.pressState){var I=ve()-r.pressState.timeStamp,F=X(r.pressState.event.type,O(O({},r.pressState.event),{center:O(O({},r.pressState.event.center),{delta:I}),isFirst:!1,isFinal:!0,pointers:r.pressState.event.pointers.map(function(T){return O(O({},T),{delta:I})})}));r.onPressGesture(F),(C=r.pressState)===null||C===void 0||C.stop(),delete r.pressState}},x=null,w=function(C){var I,F=!1,T=!1;switch(C.type){case"gesturestart":F=!0;break;case"gestureend":T=!0;break}var L={x:C.clientX,y:C.clientY},D=r.relativeClientPosition(L),V=new f.Raycaster;V.params.Points={threshold:.1},V.setFromCamera(D,r.camera);var z=O(O({},L),{coords:D,raycaster:V,buttons:0,delta:0}),U=X("gesture.pinch",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[O({},z)],isFirst:F,isFinal:T,scale:(I=C.scale)!==null&&I!==void 0?I:1,center:O({},z),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:O(O({mode:r.mode},r.currentPano),tt(r.camera.pose))});return U},M=function(C){if(C.preventDefault(),!ai){var I=w(C);x={firstEvent:I};var F=x.firstEvent;F&&!i(F.center)||r.onPinchGesture(I)}},S=function(C){if(C.preventDefault(),!ai&&x){var I=w(C),F=x.firstEvent;F&&!i(F.center)||r.onPinchGesture(I)}},E=function(C){if(C.preventDefault(),!ai&&x){var I=w(C),F=x.firstEvent;x=null,!(F&&!i(F.center))&&r.onPinchGesture(I)}},P=function(C){if(C&&typeof C.preventDefault=="function"&&C.currentTarget===e&&C.preventDefault(),typeof getSelection=="function"){var I=getSelection();I&&I.focusNode&&(I.removeAllRanges&&I.removeAllRanges(),I.empty&&I.empty())}};this.enableWheel&&e.addEventListener("wheel",A,{passive:!1}),e.addEventListener("mousemove",h,!1),e.addEventListener("mouseout",v,!1),e.addEventListener("touchstart",m,{passive:!0}),e.addEventListener("touchend",b,!1),e.addEventListener("touchcancel",b,!1),e.addEventListener("mousedown",y,!1),e.addEventListener("mouseup",b,!1),e.addEventListener("gesturestart",M,{passive:!1}),e.addEventListener("gesturechange",S,{passive:!1}),e.addEventListener("gestureend",E,{passive:!1}),e.addEventListener("touchstart",P,{passive:!1}),e.addEventListener("contextmenu",P,!1);var B=function(){a.destroy(),e.removeEventListener("wheel",A,!1),e.removeEventListener("mousemove",h,!1),e.removeEventListener("mouseout",v,!1),e.removeEventListener("touchstart",m,!1),e.removeEventListener("touchend",b,!1),e.removeEventListener("touchcancel",b,!1),e.removeEventListener("mousedown",y,!1),e.removeEventListener("mouseup",b,!1),e.removeEventListener("gesturestart",M,!1),e.removeEventListener("gesturechange",S,!1),e.removeEventListener("gestureend",E,!1),e.removeEventListener("touchstart",P,!1),e.removeEventListener("contextmenu",P,!1)};return Object.assign(B,{element:e})},t.prototype.preloadPano=function(e,r){var i=this;r===void 0&&(r=Q);var a=this.works.getResolvedObserver(e);if(!a)return Promise.resolve();var o=["right","left","up","down","front","back"];return Promise.all(o.map(function(s){var u=O({key:"pano.".concat(He(e),".").concat(s)},_t(i.imageOptions,["size","format","quality","mappings"])),l=a.images[s],c=Cn(l,i.imageOptions.transform,u);return pt(a.work).preload(c,{timeout:500})})).then(function(){return r(e),e})},t.prototype.updateScreenBuffer=function(e){var r,i,a,o,s,u;if(this.lastPostProcessingType!==e)if(this.lastPostProcessingType=e,e==="luminance"){if(this.screenBuffers.length===0){var l=this.renderer.getDrawingBufferSize(ao);this.screenBuffers=[new f.WebGLRenderTarget(l.x,l.y,{generateMipmaps:!1,encoding:(i=(r=this.renderer)===null||r===void 0?void 0:r.outputEncoding)!==null&&i!==void 0?i:f.sRGBEncoding}),this.modelRenderTarget]}}else if(e==="edl"){if(this.screenBuffers.length===0){var l=this.renderer.getDrawingBufferSize(ao);this.screenBuffers=[new f.WebGLRenderTarget(l.x,l.y,{generateMipmaps:!1,encoding:(o=(a=this.renderer)===null||a===void 0?void 0:a.outputEncoding)!==null&&o!==void 0?o:f.sRGBEncoding,minFilter:f.NearestFilter,magFilter:f.NearestFilter,format:f.RGBAFormat,type:f.FloatType}),this.modelRenderTarget]}this.models.setMaterial({useEDL:!0})}else if(e==="hq"){if(this.screenBuffers.length===0){var l=this.renderer.getDrawingBufferSize(ao),c=new f.WebGLRenderTarget(l.x,l.y,{generateMipmaps:!1,minFilter:f.NearestFilter,magFilter:f.NearestFilter,format:f.RGBAFormat,type:f.FloatType,depthTexture:new f.DepthTexture(l.x,l.y,f.UnsignedIntType)});c.depthTexture.format=f.DepthFormat,c.depthBuffer=!0;var d=new f.WebGLRenderTarget(l.x,l.y,{generateMipmaps:!1,encoding:(u=(s=this.renderer)===null||s===void 0?void 0:s.outputEncoding)!==null&&u!==void 0?u:f.sRGBEncoding,minFilter:f.NearestFilter,magFilter:f.NearestFilter,format:f.RGBAFormat,type:f.FloatType,depthTexture:c.depthTexture});this.screenBuffers=[c,d,this.modelRenderTarget]}this.models.setMaterial({useHQDepth:!0,useHQWeight:!1,pointShape:"CIRCLE"})}else this.screenBuffers&&(this.screenBuffers.forEach(function(p){p.dispose()}),this.screenBuffers=[]),this.models.setMaterial({useEDL:!1,useHQDepth:!1,useHQWeight:!1})},t}(va),$t={defaultLongitude:Math.PI/4,defaultLatitude:Math.PI/4,defaultFov:80,maxFov:120,minFov:20,maxLatitude:+Math.PI/2,minLatitude:-Math.PI/2,modelInScreen:"boundingbox-center",intersectMeshCreator:function(){return new ya}},No=function(n){ue(t,n);function t(e){var r=this,i,a=t.parseArgs(e);return r=n.call(this,a)||this,r.mode="Floorplan",r.defaultLongitude=a.defaultLongitude,r.defaultLatitude=a.defaultLatitude,r.defaultFov=a.defaultFov,r.maxFov=a.maxFov,r.minFov=a.minFov,r.maxLatitude=a.maxLatitude,r.minLatitude=a.minLatitude,r.modelInScreen=a.modelInScreen,r.locationMotion=new Re({x:r.camera.pose.offset.x,y:r.camera.pose.offset.y,z:r.camera.pose.offset.z,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Re({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Re({perspToOrtho:r.camera.perspToOrtho.x}),r.currentTapId=null,r.intersectMeshCreator=a.intersectMeshCreator,r.intersectMesh=r.intersectMeshCreator(),r.intersectMesh.name="intersect",r.intersectMesh.visible=!1,r.helper.add(r.intersectMesh),r}return t.distanceFromModel=function(e,r,i){var a=e.bounding,o=Math.pow(Math.pow(a.max.x-a.min.x+1,2)+Math.pow(a.max.y-a.min.y+1,2)+Math.pow(a.max.z-a.min.z+1,2),1/2),s=o/2/Math.tan(Math.PI*r/360);return i<1&&(s=s/i),isNaN(s)?o:s},t.parseArgs=function(e){var r,i,a,o,s,u,l,c,d;if(e instanceof t)return e;var p=n.parseArgs.call(this,e);return O(O({},p),{defaultLongitude:(r=e.defaultLongitude)!==null&&r!==void 0?r:$t.defaultLongitude,defaultLatitude:(i=e.defaultLatitude)!==null&&i!==void 0?i:$t.defaultLatitude,defaultFov:(a=e.defaultFov)!==null&&a!==void 0?a:$t.defaultFov,maxFov:(o=e.maxFov)!==null&&o!==void 0?o:$t.maxFov,minFov:(s=e.minFov)!==null&&s!==void 0?s:$t.minFov,maxLatitude:(u=e.maxLatitude)!==null&&u!==void 0?u:$t.maxLatitude,minLatitude:(l=e.minLatitude)!==null&&l!==void 0?l:$t.minLatitude,modelInScreen:(c=e.modelInScreen)!==null&&c!==void 0?c:$t.modelInScreen,intersectMeshCreator:(d=e.intersectMeshCreator)!==null&&d!==void 0?d:$t.intersectMeshCreator})},t.initAnimationEndState=function(e){var r,i,a,o,s,u,l,c=this.parseArgs(e),d=e.initial,p=d.state,A=d.currentState,h=typeof p.panoIndex=="number"?{workCode:(a=(r=p.workCode)!==null&&r!==void 0?r:(i=c.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:p.panoIndex}:{workCode:A.workCode,panoIndex:A.panoIndex},v=O(O({},h),{mode:"Floorplan",longitude:(o=p.longitude)!==null&&o!==void 0?o:ko(A.mode)?A.longitude:c.defaultLongitude,latitude:ce((s=p.latitude)!==null&&s!==void 0?s:A.mode==="Floorplan"?A.latitude:c.defaultLatitude,c.minLatitude,c.maxLatitude),fov:(u=p.fov)!==null&&u!==void 0?u:c.defaultFov,offset:p.offset?p.offset.clone():e.models.bounding.getCenter(new f.Vector3),distance:(l=p.distance)!==null&&l!==void 0?l:t.distanceFromModel(c.models,c.defaultFov,c.camera.aspect)});return v},t.prototype.updateConfiguration=function(e){var r=n.prototype.updateConfiguration.call(this,e);if(r===!1)return!1;var i=O(O({},$t),e);if(this.defaultLongitude!==i.defaultLongitude&&(this.defaultLongitude=i.defaultLongitude),this.defaultLatitude!==i.defaultLatitude&&(this.defaultLatitude=i.defaultLatitude),this.defaultFov!==i.defaultFov&&(this.defaultFov=i.defaultFov),this.maxFov!==i.maxFov&&(this.maxFov=i.maxFov),this.minFov!==i.minFov&&(this.minFov=i.minFov),this.maxLatitude!==i.maxLatitude&&(this.maxLatitude=i.maxLatitude),this.minLatitude!==i.minLatitude&&(this.minLatitude=i.minLatitude),this.modelInScreen!==i.modelInScreen&&(this.modelInScreen=i.modelInScreen),this.intersectMeshCreator!==i.intersectMeshCreator){this.intersectMeshCreator=i.intersectMeshCreator;var a=this.intersectMesh;this.intersectMesh=this.intersectMeshCreator(),this.intersectMesh.name=a.name,this.intersectMesh.visible=a.visible;var o=this.intersectMesh.parent;o&&o.add(this.intersectMesh),a.dispose()}return!0},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.locationMotion.dispose(),delete this.panState,this.intersectMesh.dispose(),this.helper.remove(this.intersectMesh)},t.prototype.isReady=function(){return this.locationMotion.ended===!1?!1:n.prototype.isReady.call(this)},t.prototype.updateWork=function(e,r,i,a){var o;return this.works=e,this.updateCamera(r,(o=i.duration)!==null&&o!==void 0?o:0,a),!0},t.prototype.updateModel=function(e){n.prototype.updateModel.call(this,e);var r=e.bounding.getCenter(new f.Vector3),i=t.distanceFromModel(e,this.defaultFov,this.camera.aspect);this.updateCamera({offset:r,distance:i},0,!0)},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={},s={};return e.distance!==void 0&&(o.distance=e.distance),e.offset!==void 0&&(o.x=e.offset.x,o.y=e.offset.y,o.z=e.offset.z),e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),a.locationMotion.set(o,r).catch(Q),a.cameraMotion.set(s,r).catch(Q)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=[],u=0,l=e;u<l.length;u++){var c=l[u];o.push({key:c.key,progress:c.progress,value:{distance:c.value.distance,x:c.value.offset.x,y:c.value.offset.x,z:c.value.offset.x}}),s.push({key:c.key,progress:c.progress,value:{longitude:c.value.longitude,latitude:c.value.latitude,fov:c.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(Q),a.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={},a={};if(this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(ce(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended||(this.locationMotion.update(e),a.distance=this.locationMotion.value.distance,a.offset=new f.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z)),this.cameraMotion.ended||(this.cameraMotion.update(e),a.longitude=this.cameraMotion.value.longitude,a.latitude=this.cameraMotion.value.latitude,a.fov=this.cameraMotion.value.fov),or(i)||this.models.setMaterial(i),or(a)||this.setCamera(a),this.intersectMesh&&this.intersectMesh.parent){var o=this.camera.position.distanceTo(this.intersectMesh.position),s=2*Math.tan(.5*this.camera.fov/180*Math.PI),u=o*s/5;this.intersectMesh.scale.setScalar(u)}}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(ve())[1],r=this.locationMotion.getKeyFrameSegment(ve())[1];return O(O({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:new f.Vector3(r.value.x,r.value.y,r.value.z),distance:r.value.distance})},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial;i.state,i.currentState;var a=i.duration,o=i.userAction;e.userAction=o;var s=t.initAnimationEndState(e),u=_t(s,["longitude","latitude","fov"]),l={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance},c={modelAlpha:1},d={perspToOrtho:0};e.emit("initAnimation.start",X("initAnimation.start",{state:s,userAction:e.userAction})),e.modelAlphaMotion.set(c,a/3).catch(Q),e.perspToOrthoMotion.set(d,a).catch(Q),e.cameraMotion.set(u,a).catch(Q),e.locationMotion.set(l,a).then(function(){e.emit("initAnimation.end",X("initAnimation.end",{state:s,userAction:e.userAction}))},function(p){var A=O(O(O({},e.currentPano),{mode:e.mode}),tt(e.camera.pose));e.emit("initAnimation.end",X("initAnimation.end",{state:A,userAction:e.userAction}))}).then(function(){r()})})},t.prototype.updateRenderSize=function(e){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.screenBuffers.forEach(function(r){r.setSize(e.x,e.y)})},t.prototype.getForwardObserverOrNot=function(e){var r=this,i=this.models.intersectRaycaster(e)[0];if(!i)return null;var a=this.works.resolvedObservers.filter(function(l){for(var c,d=0,p=r.models;d<p.length;d++){var A=p[d];if(A.visible&&((c=A.work)===null||c===void 0?void 0:c.workCode)===l.work.workCode)return!0}return!1}),o=Br(a,function(l){return l.standingPosition.distanceTo(i.point)},!0),s=o[0],u=o[1];return s&&u<10?s:null},t.prototype.coordinatesForOffset=function(e){var r=this.renderer.getSize(new f.Vector2);return{longitude:-2*e.x/(r.x*this.scissor.width),latitude:2*e.y/(r.y*this.scissor.height)}},t.prototype.requestMomentumMovement=function(e,r,i,a){var o=this;if(this.inMomentumMovement!==null){for(var s=O({},i),u={longitude:0,latitude:0},l=0;l<a;l++)s.longitude*=.996,s.latitude*=.996*.998,u.longitude+=s.longitude,u.latitude+=s.latitude;var c=vn(this.cameraMotion.value.longitude+u.longitude),d=ce(this.cameraMotion.value.latitude+u.latitude,this.minLatitude,this.maxLatitude),p=O(O({},this.currentPano),{mode:this.mode,longitude:c,latitude:d,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance}),A=!(s.longitude>1e-4||s.longitude<-1e-4||s.latitude>1e-4||s.latitude<-1e-4),h=X("gesture.momentum",O(O({},e),{isFirst:r,isFinal:A,state:p}));if(this.inMomentumMovement.event=h,this.emit("gesture.momentum",h),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:c,latitude:d},0).catch(Q),A?this.inMomentumMovement=null:Mt.shared.add(function(v,g){o.requestMomentumMovement(e,!1,s,g|0)},!0,1))}},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},!(typeof r=="undefined"||r.pointerLength!==i)){var a={x:e.center.x-r.x,y:e.center.y-r.y},o=this.relativeClientPosition(e.center),s=this.camera.pose.latitude<Math.PI/6||o.y<0?1:-1;a.x*=s;var u=this.coordinatesForOffset(a),l=vn(this.cameraMotion.value.longitude+u.longitude),c=ce(this.cameraMotion.value.latitude+u.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(c=this.cameraMotion.value.latitude);var d=O(O({},this.currentPano),{mode:this.mode,longitude:l,latitude:c,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance});if(e.state=d,this.emit("gesture.pan",e),!e.defaultPrevented&&(this.cameraMotion.set({longitude:d.longitude,latitude:d.latitude},0).catch(Q),e.isFinal)){var p=e.velocityX*s,A=e.velocityY;this.inMomentumMovement={uuid:kt()},this.requestMomentumMovement(e,!0,this.coordinatesForOffset({x:p,y:A}),0)}}},t.prototype.onPinchGesture=function(e){var r;if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement();var i=(r=this.pinchState)===null||r===void 0?void 0:r.fov;if(e.isFirst){this.pinchState={x:e.center.x,y:e.center.y,fov:this.cameraMotion.value.fov};return}if(e.isFinal&&(delete this.panState,delete this.pinchState),typeof i!="undefined"){var a=ce(i/e.scale,this.minFov,this.maxFov);e.state.fov=a,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:a},0).catch(Q),this.onPanGesture(e))}}},t.prototype.onMouseMove=function(e){var r,i;if(this.intersectMesh.parent&&!this.panState){if(this.emit("gesture.mousemove",e),e.defaultPrevented){this.hideIntersectMesh();return}var a=e.center.raycaster;if(e.isFinal&&this.intersectMesh.parent&&this.intersectMesh.visible===!0){this.hideIntersectMesh();return}var o=this.models.intersectRaycaster(a)[0],s=X("intersect.update",{raycaster:a,intersection:o!=null?o:null,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var u=(i=(r=o.face)===null||r===void 0?void 0:r.normal)!==null&&i!==void 0?i:new f.Vector3().copy(a.ray.direction).multiplyScalar(-1),l=u.clone(),c=o.point.clone();this.intersectMesh.position.copy(c);var d=c.clone().add(l);if(this.intersectMesh.lookAt(d),Math.abs(u.y)>.99){var p=this.camera.position.clone().sub(c);this.intersectMesh.rotation.z=-Math.atan2(p.z,p.x)}this.intersectMesh.visible=!0,this.needsRender=!0}else this.hideIntersectMesh()}},t.prototype.onMouseWheel=function(e){if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement();var r=this,i=r.minFov,a=r.maxFov,o=ce(this.camera.fov-e.center.delta,i,a);e.state.fov=o,this.emit("gesture.mousewheel",e),!e.defaultPrevented&&this.cameraMotion.set({fov:o},0).catch(Q)}},t.prototype.onTapGesture=function(e){var r=this;this.userAction=!0,this.stopMomentumMovement();var i=e.center.raycaster,a=this.getForwardObserverOrNot(i);if(!a)this.emit("gesture.tap",e);else{var o={longitude:this.camera.pose.longitude,latitude:0},s=O(O({},e.state),{mode:"Panorama",workCode:a.pano.workCode,panoIndex:a.pano.panoIndex,longitude:o.longitude,latitude:o.latitude,offset:a?a.position.clone():new f.Vector3,distance:0});if(e.state=s,this.emit("gesture.tap",e),!e.defaultPrevented&&(this.emit("pano.select",X("pano.select",{prevPano:this.currentPano,state:s,userAction:e.userAction,options:o,progress:0,error:null})),a&&a.active)){var u=this.currentTapId=kt();this.preloadPano(a.pano).then(function(l){r.currentTapId===u&&r.emit("pano.request",X("pano.request",{userAction:!0,prevPano:r.currentPano,progress:0,state:s,options:o,error:null}))})}}},t.prototype.onDblTapGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement();var r=this.cameraMotion.value.fov,i=this.minFov-r<r-this.defaultFov?this.minFov:this.defaultFov;e.state.fov=i,this.emit("gesture.dbltap",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:i},360).catch(Q),this.hideIntersectMesh())},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.needsRender=!0},t}(fs),mm=O({},Aa($t,["defaultLongitude","defaultLatitude","maxLatitude","minLatitude"])),Am=function(n){ue(t,n);function t(e){var r=this,i=t.parseArgs(e);return r=n.call(this,i)||this,r.mode="Topview",r}return t.parseArgs=function(e){if(e instanceof t)return e;var r=O(O({},e),{defaultLongitude:0,defaultLatitude:Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return O(O({},i),{longitude:r.defaultLongitude,latitude:r.defaultLatitude,mode:"Topview"})},t.prototype.updateConfiguration=function(e){return n.prototype.updateConfiguration.call(this,O(O({},e),{defaultLongitude:0,defaultLatitude:Math.PI/2}))},t.prototype.updateModel=function(e){this.needsRender=!0,this.modelSceneNeedsRender=!0;var r=this.models.bounding.getCenter(new f.Vector3);this.locationMotion.set({x:r.x,y:r.y,z:r.z,distance:No.distanceFromModel(this.models,this.defaultFov,this.camera.aspect)},0).catch(Q)},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={},s={};return e.distance!==void 0&&(o.distance=e.distance),e.offset!==void 0&&(o.x=e.offset.x,o.y=e.offset.y,o.z=e.offset.z),e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),a.locationMotion.set(o,r).catch(Q),a.cameraMotion.set(s,r).catch(Q)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=[],u=0,l=e;u<l.length;u++){var c=l[u];o.push({key:c.key,progress:c.progress,value:{distance:c.value.distance,x:c.value.offset.x,y:c.value.offset.y,z:c.value.offset.z}}),s.push({key:c.key,progress:c.progress,value:{longitude:c.value.longitude,latitude:c.value.latitude,fov:c.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(Q),a.cameraMotion.setKeyframes(e,r)})},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial;i.state,i.currentState;var a=i.duration,o=i.userAction;e.userAction=o;var s=t.initAnimationEndState(e),u={longitude:s.longitude,latitude:s.latitude,fov:s.fov},l={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance},c={modelAlpha:1},d={perspToOrtho:1};e.emit("initAnimation.start",X("initAnimation.start",{state:s,userAction:e.userAction})),e.modelAlphaMotion.set(c,a/3).catch(Q),e.perspToOrthoMotion.set(d,a).catch(Q),e.cameraMotion.set(u,a).catch(Q),e.locationMotion.set(l,a).then(function(){e.emit("initAnimation.end",X("initAnimation.end",{state:s,userAction:e.userAction}))},function(p){var A=O(O(O({},e.currentPano),{mode:e.mode}),tt(e.camera.pose));e.emit("initAnimation.end",X("initAnimation.end",{state:A,userAction:e.userAction}))}).then(function(){r()})})},t.prototype.requestMomentumMovement=function(){this.inMomentumMovement=null},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement();var r=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},!(typeof r=="undefined"||r.pointerLength!==i)){var a={x:e.center.x-r.x,y:e.center.y-r.y},o=new f.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),s=this.locationMotion.value.distance;s*=Math.tan(this.cameraMotion.value.fov/2*Math.PI/180);var u=this.renderer.getSize(new f.Vector2),l=2*a.x*s/u.y,c=2*a.y*s/u.y,d=new f.Vector3;d.setFromMatrixColumn(this.camera.matrix,0),d.multiplyScalar(-l),o.add(d),d.setFromMatrixColumn(this.camera.matrix,1),d.multiplyScalar(c),o.add(d),this.modelInScreen==="boundingbox-center"&&o.clamp(this.models.bounding.min,this.models.bounding.max);var p=O(O({},this.currentPano),{mode:this.mode,longitude:0,latitude:Math.PI/2,fov:this.cameraMotion.value.fov,offset:o,distance:this.locationMotion.value.distance});e.state=p,this.emit("gesture.pan",e),!e.defaultPrevented&&this.locationMotion.set({x:o.x,y:o.y,z:o.z},0).catch(Q)}},t.prototype.onPinchGesture=function(e){var r;if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement();var i=(r=this.pinchState)===null||r===void 0?void 0:r.fov;if(e.isFirst){this.pinchState={x:e.center.x,y:e.center.y,fov:this.cameraMotion.value.fov};return}if(e.isFinal&&delete this.pinchState,typeof i!="undefined"){var a=ce(i/e.scale,this.minFov,this.maxFov);e.state.fov=a,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:a},0).catch(Q),e.type="gesture.pan",this.onPanGesture(e))}}},t.prototype.onMouseWheel=function(e){if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement();var r=ce(this.cameraMotion.value.fov-e.center.delta,this.minFov,this.maxFov);e.state.fov=r,this.emit("gesture.mousewheel",e),!e.defaultPrevented&&this.cameraMotion.set({fov:r},0).catch(Q)}},t}(No),dr={defaultLatitude:0,defaultFov:90,maxFov:120,minFov:20,maxLatitude:+Math.PI/2,minLatitude:-Math.PI/2,moveSpeed:3.4,intersectMeshCreator:function(){return new ya}},Ql=function(n){ue(t,n);function t(e){var r=this,i=t.parseArgs(e);return r=n.call(this,i)||this,r.mode="PanoramaLike",r.defaultLatitude=i.defaultLatitude,r.defaultFov=i.defaultFov,r.maxFov=i.maxFov,r.minFov=i.minFov,r.maxLatitude=i.maxLatitude,r.minLatitude=i.minLatitude,r.moveSpeed=i.moveSpeed,r.intersectMeshCreator=i.intersectMeshCreator,r.intersectMesh=r.intersectMeshCreator(),r.intersectMesh.name="intersect",r.intersectMesh.visible=!1,r.helper.add(r.intersectMesh),r}return t.parseArgs=function(e){var r,i,a,o,s,u,l,c;if(e instanceof t)return e;var d=n.parseArgs.call(this,e);return O(O({},d),{defaultLatitude:(r=e.defaultLatitude)!==null&&r!==void 0?r:dr.defaultLatitude,defaultFov:(i=e.defaultFov)!==null&&i!==void 0?i:dr.defaultFov,maxFov:(a=e.maxFov)!==null&&a!==void 0?a:dr.maxFov,minFov:(o=e.minFov)!==null&&o!==void 0?o:dr.minFov,maxLatitude:(s=e.maxLatitude)!==null&&s!==void 0?s:dr.maxLatitude,minLatitude:(u=e.minLatitude)!==null&&u!==void 0?u:dr.minLatitude,moveSpeed:(l=e.moveSpeed)!==null&&l!==void 0?l:dr.moveSpeed,intersectMeshCreator:(c=e.intersectMeshCreator)!==null&&c!==void 0?c:dr.intersectMeshCreator})},t.initAnimationEndState=function(e){var r,i,a,o,s,u,l=this.parseArgs(e),c=l.works,d=e.initial,p=d.state,A=d.currentState,h=typeof p.panoIndex=="number"?{workCode:(a=(r=p.workCode)!==null&&r!==void 0?r:(i=l.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:p.panoIndex}:{workCode:A.workCode,panoIndex:A.panoIndex},v=c.getResolvedObserver(h),g=(o=p.longitude)!==null&&o!==void 0?o:A.longitude,m=ce((s=p.latitude)!==null&&s!==void 0?s:yi(A.mode)?A.latitude:l.defaultLatitude,l.minLatitude,l.maxLatitude),y=ce((u=p.fov)!==null&&u!==void 0?u:yi(A.mode)?A.fov:l.defaultFov,l.minFov,l.maxFov),b=v?v.position.clone():new f.Vector3;return{workCode:h.workCode,panoIndex:h.panoIndex,mode:"PanoramaLike",longitude:g,latitude:m,fov:y,offset:b,distance:0}},t.prototype.updateConfiguration=function(e){var r=n.prototype.updateConfiguration.call(this,e);if(r===!1)return!1;var i=O(O({},dr),e);if(this.defaultLatitude!==i.defaultLatitude&&(this.defaultLatitude=i.defaultLatitude),this.maxLatitude!==i.maxLatitude&&(this.maxLatitude=i.maxLatitude),this.minLatitude!==i.minLatitude&&(this.minLatitude=i.minLatitude),this.defaultFov!==i.defaultFov&&(this.defaultFov=i.defaultFov),this.maxFov!==i.maxFov&&(this.maxFov=i.maxFov),this.minFov!==i.minFov&&(this.minFov=i.minFov),this.moveSpeed!==i.moveSpeed&&(this.moveSpeed=i.moveSpeed),this.intersectMeshCreator!==i.intersectMeshCreator){this.intersectMeshCreator=i.intersectMeshCreator;var a=this.intersectMesh;this.intersectMesh=this.intersectMeshCreator(),this.intersectMesh.name=a.name,this.intersectMesh.visible=a.visible;var o=this.intersectMesh.parent;o&&o.add(this.intersectMesh),a.dispose()}return!0},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.intersectMesh&&(this.helper.remove(this.intersectMesh),this.intersectMesh.dispose()),delete this.panState},t.prototype.isReady=function(){return this.panState||this.pinchState?!1:n.prototype.isReady.call(this)},t.prototype.calculateMovingDuration=function(e,r){switch(typeof e){case"function":return e(r,this.moveSpeed);case"number":return e;case"string":return Number(e);default:return ce(r,2,5)/this.moveSpeed*1e3}},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.needsRender=!0},t.prototype.coordinatesForOffset=function(e){var r=this.cameraMotion.value.fov,i=this.camera.aspect,a=this.renderer.getSize(new f.Vector2);return{longitude:2*e.x/(a.x*this.scissor.width)*r/95*i,latitude:-2*e.y/(a.y*this.scissor.height)*r/95}},t.prototype.cameraBounce=function(){var e=this.cameraMotion.value,r=e.longitude,i=e.latitude,a=e.fov,o=[{progress:0,value:{longitude:r,latitude:i,fov:a}},{progress:.5,value:{longitude:r,latitude:i,fov:a*.98}},{progress:1,value:{longitude:r,latitude:i,fov:a}}];this.cameraMotion.setKeyframes(o,500).catch(Q)},t.prototype.requestMomentumMovement=function(e,r,i,a){var o=this;if(this.inMomentumMovement!==null){for(var s=O({},i),u={longitude:0,latitude:0},l=0;l<a;l++)s.longitude*=.996,s.latitude*=.996*.99,u.longitude+=s.longitude,u.latitude+=s.latitude;var c=vn(this.cameraMotion.value.longitude+u.longitude),d=ce(this.cameraMotion.value.latitude+u.latitude,this.minLatitude,this.maxLatitude),p=O(O({},this.currentPano),{mode:this.mode,longitude:c,latitude:d,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance}),A=!(s.longitude>1e-4||s.longitude<-1e-4||s.latitude>1e-4||s.latitude<-1e-4),h=X("gesture.momentum",O(O({},e),{isFirst:r,isFinal:A,state:p}));if(this.inMomentumMovement.event=h,this.emit("gesture.momentum",h),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:c,latitude:d},0).catch(Q),A?this.inMomentumMovement=null:Mt.shared.add(function(v,g){o.requestMomentumMovement(e,!1,s,g|0)},!0,1))}},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},!(typeof r=="undefined"||r.pointerLength!==i)){var a={x:e.center.x-r.x,y:e.center.y-r.y},o=this.coordinatesForOffset(a),s=vn(this.cameraMotion.value.longitude+o.longitude),u=ce(this.cameraMotion.value.latitude+o.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(u=this.cameraMotion.value.latitude);var l=O(O({},this.currentPano),{mode:this.mode,longitude:s,latitude:u,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance});if(e.state=l,this.emit("gesture.pan",e),!e.defaultPrevented){var c={longitude:l.longitude,latitude:l.latitude,fov:l.fov};if(this.cameraMotion.set(c,0).catch(Q),e.isFinal){var d=e.velocityX,p=e.velocityY*.6;Math.abs(p)>.5&&Math.abs(d)<.5&&(d=0),this.inMomentumMovement={uuid:kt()},this.requestMomentumMovement(e,!0,this.coordinatesForOffset({x:d,y:p}),0)}}}},t.prototype.onPinchGesture=function(e){var r;this.userAction=e.userAction,this.stopMomentumMovement();var i=(r=this.pinchState)===null||r===void 0?void 0:r.fov,a=e.scale;if(e.isFirst){this.pinchState={x:e.center.x,y:e.center.y,fov:this.cameraMotion.value.fov};return}if(e.isFinal&&delete this.pinchState,typeof i!="undefined"){var o=ce(i/a,this.minFov,this.maxFov);e.state.fov=o,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:o},0).catch(Q),e.type="gesture.pan",this.onPanGesture(e))}},t.prototype.onMouseWheel=function(e){this.userAction=e.userAction,this.stopMomentumMovement();var r=ce(this.cameraMotion.value.fov-e.center.delta,this.minFov,this.maxFov);e.state.fov=r,this.emit("gesture.mousewheel",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:r},0).catch(Q),this.onMouseMove(e))},t.prototype.onMouseMove=function(e){var r,i;if(this.intersectMesh.parent&&!this.panState&&(this.emit("gesture.mousemove",e),!e.defaultPrevented)){var a=e.center.raycaster;if(e.isFinal&&this.intersectMesh.parent){this.hideIntersectMesh();return}var o=this.models.intersectRaycaster(a)[0],s=X("intersect.update",{raycaster:a,intersection:o!=null?o:null,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var u=(i=(r=o.face)===null||r===void 0?void 0:r.normal)!==null&&i!==void 0?i:new f.Vector3().copy(a.ray.direction).multiplyScalar(-1),l=u.clone(),c=o.point.clone();this.intersectMesh.position.copy(c);var d=c.clone().add(l);if(this.intersectMesh.lookAt(d),Math.abs(u.y)>.99){var p=this.camera.position.clone().sub(c);this.intersectMesh.rotation.z=-Math.atan2(p.z,p.x)}this.intersectMesh.visible=!0,this.needsRender=!0}else this.hideIntersectMesh()}},t.prototype.onDblTapGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement();var r=this.cameraMotion.value.fov,i=2,a=this.works.getResolvedObserver(this.currentPano);if(a){var o=a.images.tiles;o&&o.length&&(i=Math.max.apply(Math,o.map(function(l){return l.level})))}var s=Math.max(40-i*5,this.minFov,5),u=s-r<r-this.defaultFov?s:this.defaultFov;e.state.fov=u,this.emit("gesture.dbltap",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:u},360).catch(Q),this.hideIntersectMesh())},t}(fs),gm="data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz02IGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmcmFtZXM9MCB3ZWlnaHRwPTAga2V5aW50PTI1MCBrZXlpb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IAAAABAAAAAwAAAAEAAAABAAAABAAAAAIAAAABAAAABgAAAAEAAAABAAAABwAAAAIAAAABAAAACAAAAAEAAAABAAAACQAAAAIAAAABAAAACgAAAAEAAAABAAAACwAAAAIAAAABAAAADQAAAAEAAAABAAAADgAAAAIAAAABAAAADwAAAAEAAAABAAAAEAAAAAIAAAABAAAAEQAAAAEAAAABAAAAEgAAAAIAAAABAAAAFAAAAAEAAAABAAAAFQAAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw",oo;function Ul(){return oo||(oo=new Promise(function(n){var t,e=document.createElement("video");e.muted=!0,e.src=gm,e.addEventListener("timeupdate",function r(){e.removeEventListener("timeupdate",r,!1),clearTimeout(t);var i=document.createElement("canvas");i.width=i.height=1;var a=i.getContext("2d");if(!a){n(!1);return}a.drawImage(e,0,0,1,1);var o=a.getImageData(0,0,1,1).data;o[3]>10?n(!0):n(!1)},!1),e.addEventListener("canplay",function r(){e.removeEventListener("canplay",r,!1),e.play()},!1),t=window.setTimeout(function(){return n(!1)},1e3)}))}var ym=`
|
|
1477
|
+
`,pm=new f.OrthographicCamera(-1,1,1,-1,0,1),cs=new f.BufferGeometry;cs.setAttribute("position",new f.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));cs.setAttribute("uv",new f.Float32BufferAttribute([0,2,0,0,2,0],2));var Nl=new f.MeshBasicMaterial,Vo=new f.Mesh(cs,Nl),zl=new f.Scene;zl.add(Vo);var vm=function(){function n(t){this.renderer=t,this.material=new f.ShaderMaterial({vertexShader:hm,fragmentShader:dm,uniforms:Object.assign({depthBuffer:new f.Uniform(null)}),blending:f.NoBlending,depthWrite:!0,depthTest:!0}),this.renderer.getContext()&&this.renderer.getContext()instanceof WebGLRenderingContext&&(this.material.extensions.fragDepth=!0)}return n.prototype.render=function(t,e){var r=this.renderer.getRenderTarget();this.material.uniforms.depthBuffer.value=t,Vo.material=this.material,this.renderer.setRenderTarget(e||null),this.renderer.render(zl,pm),this.renderer.setRenderTarget(r),Vo.material=Nl},n.prototype.dispose=function(){this.material.dispose()},n}(),ao=new f.Vector2,fs=function(n){ue(t,n);function t(e){var r,i,a,o,s,u,l=n.call(this)||this,c=t.parseArgs(e);l.mode="",l.pending=new Set,l.userAction=c.initial.userAction,l.destroyed=!1,l.ident=c.ident,l.scene=c.scene,l.xrCustomObjectsScene=c.xrCustomObjectsScene,l.helper=c.helper,l.boundingMesh=c.boundingMesh,l.camera=c.camera,l.renderer=c.renderer,l.scissor=c.scissor,l.element=c.element,l.models=c.models,l.enableWheel=c.enableWheel,l.enableIOSEDR=(r=c.enableIOSEDR)!==null&&r!==void 0?r:!1,l.enableEDL=(i=c.enableEDL)!==null&&i!==void 0?i:!0,l.enableHQ=(a=c.enableHQ)!==null&&a!==void 0?a:!0,l.works=c.works,l.imageOptions=c.imageOptions,l.videoTexture=c.videoTexture,l.extraElements=c.extraElements,l.initial=c.initial,l.currentPano=typeof l.initial.state.panoIndex=="number"?{workCode:(u=(o=l.initial.state.workCode)!==null&&o!==void 0?o:(s=c.works[0])===null||s===void 0?void 0:s.workCode)!==null&&u!==void 0?u:"",panoIndex:l.initial.state.panoIndex}:{workCode:l.initial.currentState.workCode,panoIndex:l.initial.currentState.panoIndex},l.needsRender=!0,l.modelSceneNeedsRender=!0,l.cameraMotion=new Re({longitude:{value:l.camera.pose.longitude,circle:[0,Math.PI*2]},latitude:l.camera.pose.latitude,fov:l.camera.pose.fov}),l.inMomentumMovement=null,l.eventUnbinds=[c.element].concat(c.extraElements||[]).map(function(p){return l.bindEvents(p)}),l.pending.add("init-animation"),l.initAnimationReady=new Promise(function(p){Mt.shared.add(function(){l.initAnimation().then(function(){l.pending.delete("init-animation"),p()})},!0)}),l.initAnimationIsReady=!1,l.initAnimationReady.then(function(){return l.initAnimationIsReady=!0}),l.modelScene=c.modelScene;var d=new f.Vector2;return l.renderer.getDrawingBufferSize(d),l.modelRenderTarget=c.modelRenderTarget,l.copyPass=new Vl(l.renderer),l.depthCopyPass=new vm(l.renderer),l.screenBuffers=[],l.lastPostProcessingType=null,l}return t.parseArgs=function(e){return e instanceof t?e:O({},e)},t.initAnimationEndState=function(e){var r,i,a,o,s,u,l,c,d=this.parseArgs(e),p=d.initial,A=p.state,h=p.currentState,v=typeof A.panoIndex=="number"?{workCode:(a=(r=A.workCode)!==null&&r!==void 0?r:(i=d.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:A.panoIndex}:{workCode:h.workCode,panoIndex:h.panoIndex};return O(O({},v),{mode:"",longitude:(o=A.longitude)!==null&&o!==void 0?o:h.longitude,latitude:(s=A.latitude)!==null&&s!==void 0?s:h.latitude,fov:(u=A.fov)!==null&&u!==void 0?u:h.fov,offset:(l=A.offset)!==null&&l!==void 0?l:h.offset,distance:(c=A.distance)!==null&&c!==void 0?c:h.distance})},t.prototype.updateConfiguration=function(e){return!0},t.prototype.destroy=function(){var e;this.stopMomentumMovement(),this.destroyed=!0,this.off(),this.cameraMotion.dispose();for(var r=0,i=this.eventUnbinds;r<i.length;r++){var a=i[r];a()}this.copyEffect&&(this.copyEffect.dispose(),delete this.copyEffect),delete this.panState,(e=this.pressState)===null||e===void 0||e.stop(),delete this.pressState},t.prototype.isReady=function(){return this.inMomentumMovement===null&&this.pending.size===0&&this.cameraMotion.ended===!0},t.prototype.bindExtraElement=function(e){for(var r=0,i=this.eventUnbinds;r<i.length;r++){var a=i[r];if(a.element===e)return}this.eventUnbinds.push(this.bindEvents(e))},t.prototype.unbindExtraElement=function(e){for(var r=[],i=0,a=this.eventUnbinds;i<a.length;i++){var o=a[i];o.element===e?o():r.push(o)}this.eventUnbinds=r},t.prototype.updateRenderSize=function(e){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.modelRenderTarget.setSize(e.x,e.y),this.screenBuffers.forEach(function(r){r.setSize(e.x,e.y)})},t.prototype.updateModel=function(e){this.needsRender=!0,this.modelSceneNeedsRender=!0},t.prototype.updateWork=function(e,r,i,a){return this.works=e,this.userAction=a,!1},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={};this.cameraMotion.ended&&(this.cameraMotion.update(e),i.longitude=this.cameraMotion.value.longitude,i.latitude=this.cameraMotion.value.latitude,i.fov=this.cameraMotion.value.fov),ar(i)&&this.setCamera(i)}},t.prototype.render=function(e,r){var i=this.renderer.getRenderTarget();this.updateScreenBuffer(r),e&&(this.renderer.setRenderTarget(this.modelRenderTarget),this.renderer.render(this.modelScene,this.camera)),this.depthCopyPass.render(this.modelRenderTarget.depthTexture,i),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.copyPass.render(this.modelRenderTarget,i),this.renderer.setRenderTarget(i),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t.prototype.postProcessing=function(e,r){this.destroyed},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={};return e.longitude!==void 0&&(o.longitude=e.longitude),e.latitude!==void 0&&(o.latitude=e.latitude),e.fov!==void 0&&(o.fov=e.fov),a.cameraMotion.set(o,r).catch(Q)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=0,u=e;s<u.length;s++){var l=u[s];o.push({key:l.key,progress:l.progress,value:{longitude:l.value.longitude,latitude:l.value.latitude,fov:l.value.fov}})}return a.cameraMotion.setKeyframes(o,r)})},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(ve())[1];return O(O({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance})},t.prototype.initAnimation=function(){var e=this.initial;e.state,e.currentState,e.duration;var r=e.userAction,i=t.initAnimationEndState(this);return this.userAction=r,this.emit("initAnimation.start",X("initAnimation.start",{state:i,userAction:this.userAction})),this.emit("initAnimation.end",X("initAnimation.end",{state:i,userAction:this.userAction})),Promise.resolve()},t.prototype.setCamera=function(e){var r,i,a,o,s;e===void 0&&(e={});var u=(r=e.longitude)!==null&&r!==void 0?r:this.camera.pose.longitude,l=(i=e.latitude)!==null&&i!==void 0?i:this.camera.pose.latitude,c=(a=e.fov)!==null&&a!==void 0?a:this.camera.pose.fov,d=(o=e.distance)!==null&&o!==void 0?o:this.camera.pose.distance,p=(s=e.offset)!==null&&s!==void 0?s:this.camera.pose.offset,A=er(u,this.camera.pose.longitude,Math.PI*2)||er(l,this.camera.pose.latitude),h=er(c,this.camera.pose.fov),v=er(d,this.camera.pose.distance),g=ea(p,this.camera.pose.offset);(h||A||g||v)&&(this.camera.setFromPose({longitude:u,latitude:l,fov:c,distance:d,offset:p}),this.emit("camera.update",X("camera.update",{userAction:this.userAction,state:O(O({},this.currentPano),{mode:this.mode,longitude:u,latitude:l,fov:c,offset:p,distance:d})})),this.needsRender=!0,this.modelSceneNeedsRender=!0)},t.prototype.stopMomentumMovement=function(){if(this.inMomentumMovement&&this.inMomentumMovement.event&&!this.inMomentumMovement.event.defaultPrevented&&!this.inMomentumMovement.event.isFinal){var e=X("gesture.momentum",O(O({},this.inMomentumMovement.event),{isFirst:!1,isFinal:!0}));this.emit("gesture.momentum",e)}this.inMomentumMovement=null},t.prototype.onPanGesture=function(e){this.stopMomentumMovement(),this.emit("gesture.pan",e)},t.prototype.onTapGesture=function(e){this.stopMomentumMovement(),this.emit("gesture.tap",e)},t.prototype.onDblTapGesture=function(e){this.stopMomentumMovement(),this.emit("gesture.dbltap",e),!e.defaultPrevented&&(e.type="gesture.tap",this.onTapGesture(e))},t.prototype.onPressGesture=function(e){this.stopMomentumMovement(),this.emit("gesture.press",e)},t.prototype.onPinchGesture=function(e){this.stopMomentumMovement(),this.emit("gesture.pinch",e)},t.prototype.onMouseWheel=function(e){this.stopMomentumMovement(),this.emit("gesture.mousewheel",e)},t.prototype.onMouseMove=function(e){this.stopMomentumMovement(),this.emit("gesture.mousemove",e)},t.prototype.relativeClientPosition=function(e){return L0(e,this.element,this.scissor)},t.prototype.bindEvents=function(e){var r=this,i=function(C){var I=L0(C,r.element,r.scissor);return!(Math.abs(I.x)>1||Math.abs(I.y)>1)},a=new oi.Manager(e),o=function(C){var I=C.session;return I.firstInput||null},s=new oi.Pan({threshold:10,pointers:0}),u=new oi.Tap({interval:410}),l=new oi.Pinch({threshold:0,pointers:2});a.add([s,u,l]),a.on("panstart pan",function(C){var I=o(a);if(!(I&&!i(I.center))){var L=X("gesture.pan",{target:C.target,pointerType:C.pointerType,srcEvent:C.srcEvent,pointers:C.pointers.map(function(T){var F=r.relativeClientPosition(T),D=new f.Raycaster;return D.params.Points={threshold:.1},D.setFromCamera(F,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:F,raycaster:D}}),isFirst:C.isFirst,isFinal:C.isFinal,scale:C.scale,center:function(T){var F=r.relativeClientPosition(T),D=new f.Raycaster;return D.params.Points={threshold:.1},D.setFromCamera(F,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:F,raycaster:D}}(C.center),velocityX:C.velocityX,velocityY:C.velocityY,overallVelocityX:C.overallVelocityX,overallVelocityY:C.overallVelocityY,userAction:!0,state:O(O({mode:r.mode},r.currentPano),tt(r.camera.pose))});r.onPanGesture(L),b()}}),a.on("tap",function(C){if(!(C.pointerType==="mouse"&&C.srcEvent.button!==0)){var I=o(a);if(!(I&&!i(I.center))){var L=X("gesture.tap",{target:C.target,pointerType:C.pointerType,srcEvent:C.srcEvent,pointers:C.pointers.map(function(T){var F=r.relativeClientPosition(T),D=new f.Raycaster;return D.params.Points={threshold:.1},D.setFromCamera(F,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:F,raycaster:D}}),isFirst:!0,isFinal:!0,scale:C.scale,center:function(T){var F=r.relativeClientPosition(T),D=new f.Raycaster;return D.params.Points={threshold:.1},D.setFromCamera(F,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:F,raycaster:D}}(C.center),velocityX:C.velocityX,velocityY:C.velocityY,overallVelocityX:C.overallVelocityX,overallVelocityY:C.overallVelocityY,userAction:!0,state:O(O({mode:r.mode},r.currentPano),tt(r.camera.pose))});r.onTapGesture(L),b()}}}),a.on("pinchstart pinch pinchend",function(C){var I=o(a);if(!(I&&!i(I.center))){var L=X("gesture.pinch",{target:C.target,pointerType:C.pointerType,srcEvent:C.srcEvent,pointers:C.pointers.map(function(T){var F,D=r.relativeClientPosition(T),V=new f.Raycaster;return V.params.Points={threshold:.1},V.setFromCamera(D,r.camera),{x:T.x,y:T.y,delta:(F=T.delta)!==null&&F!==void 0?F:0,buttons:0,coords:D,raycaster:V}}),isFirst:C.type==="pinchstart",isFinal:C.type==="pinchend",scale:C.scale,center:function(T){var F=r.relativeClientPosition(T),D=new f.Raycaster;return D.params.Points={threshold:.1},D.setFromCamera(F,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:F,raycaster:D}}(C.center),velocityX:C.velocityX,velocityY:C.velocityY,overallVelocityX:C.overallVelocityX,overallVelocityY:C.overallVelocityY,userAction:!0,state:O(O({mode:r.mode},r.currentPano),tt(r.camera.pose))});r.onPinchGesture(L),b()}}),a.on("dbltap",function(C){if(!(C.pointerType==="mouse"&&C.srcEvent.button!==0)){var I=o(a);if(!(I&&!i(I.center))){var L=X("gesture.dbltap",{target:C.target,pointerType:C.pointerType,srcEvent:C.srcEvent,pointers:C.pointers.map(function(T){var F=r.relativeClientPosition(T),D=new f.Raycaster;return D.params.Points={threshold:.1},D.setFromCamera(F,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:F,raycaster:D}}),isFirst:!0,isFinal:!0,scale:C.scale,center:function(T){var F=r.relativeClientPosition(T),D=new f.Raycaster;return D.params.Points={threshold:.1},D.setFromCamera(F,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:F,raycaster:D}}(C.center),velocityX:C.velocityX,velocityY:C.velocityY,overallVelocityX:C.overallVelocityX,overallVelocityY:C.overallVelocityY,userAction:!0,state:O(O({mode:r.mode},r.currentPano),tt(r.camera.pose))});r.onDblTapGesture(L),b()}}});var c=null,d=null,p=function(C,I,L){var T={x:L.clientX,y:L.clientY},F=r.relativeClientPosition(T),D=new f.Raycaster;D.params.Points={threshold:.1},D.setFromCamera(F,r.camera);var V=O(O({},T),{coords:F,raycaster:D,buttons:L.buttons,delta:0}),z=C==="pinchend"?I:I-L.deltaY/280,U=X("gesture.pinch",{target:L.target,pointerType:"mouse",srcEvent:L,pointers:[O({},V)],isFirst:C==="pinchstart",isFinal:C==="pinchend",scale:ce(z,.1,10),center:O({},V),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:O(O({mode:r.mode},r.currentPano),tt(r.camera.pose))});return U},A=function(C){var I,L={x:C.clientX,y:C.clientY};if(i(L)){if(C.preventDefault(),C.ctrlKey){var T=(I=c==null?void 0:c.prevEvent.scale)!==null&&I!==void 0?I:1,F=p(c?"pinch":"pinchstart",T,C);c===null?c={firstEvent:F,prevEvent:F}:c.prevEvent=F,r.onPinchGesture(F),d!==null&&window.clearTimeout(d),d=window.setTimeout(function(){var K;d=null;var j=(K=c==null?void 0:c.prevEvent.scale)!==null&&K!==void 0?K:1,J=p("pinchend",j,C);c=null,r.onPinchGesture(J)},200)}else{var D=(Math.abs(C.deltaY)>Math.abs(C.deltaX)?C.deltaY:C.deltaX)/-60,V=r.mouseWheelState!==void 0,z={x:C.clientX,y:C.clientY},U=r.relativeClientPosition(z),q=new f.Raycaster;q.params.Points={threshold:.1},q.setFromCamera(U,r.camera);var G=O(O({},z),{coords:U,raycaster:q,buttons:C.buttons,delta:D}),F=X("gesture.mousewheel",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[O({},G)],isFirst:V,isFinal:!1,scale:0,center:O({},G),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:O(O({mode:r.mode},r.currentPano),tt(r.camera.pose))});r.onMouseWheel(F),r.mouseWheelState&&clearTimeout(r.mouseWheelState.timer),r.mouseWheelState={timer:setTimeout(function(){delete r.mouseWheelState;var j=X("gesture.mousewheel",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[O(O({},G),{delta:0})],isFirst:!1,isFinal:!0,scale:0,center:O(O({},G),{delta:0}),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:O(O({mode:r.mode},r.currentPano),tt(r.camera.pose))});r.onMouseWheel(j)},100)}}b()}},h=function(C){if(!ai){if(!i({x:C.clientX,y:C.clientY})){v();return}var I=!1;r.mouseMoveState||(I=!0);var L={x:C.clientX,y:C.clientY},T=r.relativeClientPosition(L),F=new f.Raycaster;F.params.Points={threshold:.1},F.setFromCamera(T,r.camera);var D=O(O({},L),{coords:T,raycaster:F,buttons:C.buttons,delta:0}),V=X("gesture.mousemove",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[O({},D)],isFirst:I,isFinal:!1,scale:0,center:O({},D),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:O(O({mode:r.mode},r.currentPano),tt(r.camera.pose))});r.mouseMoveState={timeStamp:ve(),event:V},r.onMouseMove(V),r.pressState&&Math.abs(C.clientX-r.pressState.event.center.y)>10&&Math.abs(C.clientY-r.pressState.event.center.y)>10&&b()}},v=function(){if(r.mouseMoveState){var C=X(r.mouseMoveState.event.type,O(O({},r.mouseMoveState.event),{isFinal:!0}));delete r.mouseMoveState,r.onMouseMove(C)}b()},g=function(C){if(!i(C.center)){b();return}var I=!1;r.pressState||(I=!0,r.pressState={event:C,timeStamp:ve(),stop:Q});var L=ve()-r.pressState.timeStamp,T=X(r.pressState.event.type,O(O({},r.pressState.event),{isFirst:I,isFinal:!1,center:O(O({},r.pressState.event.center),{delta:L}),pointers:r.pressState.event.pointers.map(function(F){return O(O({},F),{delta:L})})}));r.onPressGesture(T),r.pressState&&(r.pressState.stop=Mt.shared.add(function(F){g(C)},!0,1))},m=function(C){if(b(),!(C.touches.length>1||C.changedTouches.length<=0)){var I={x:C.changedTouches[0].clientX,y:C.changedTouches[0].clientY},L=r.relativeClientPosition(I),T=new f.Raycaster;T.params.Points={threshold:.1},T.setFromCamera(L,r.camera);var F=O(O({},I),{coords:L,raycaster:T,buttons:0,delta:0}),D=X("gesture.press",{target:C.target,pointerType:"touch",srcEvent:C,pointers:[O({},F)],isFirst:!1,isFinal:!1,scale:0,center:F,velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:O(O({mode:r.mode},r.currentPano),tt(r.camera.pose))});g(D)}},y=function(C){b();var I={x:C.clientX,y:C.clientY},L=r.relativeClientPosition(I),T=new f.Raycaster;T.params.Points={threshold:.1},T.setFromCamera(L,r.camera);var F=O(O({},I),{coords:L,raycaster:T,buttons:C.buttons,delta:0}),D=X("gesture.press",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[O({},F)],isFirst:!1,isFinal:!1,scale:0,center:F,velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:O(O({mode:r.mode},r.currentPano),tt(r.camera.pose))});g(D)},b=function(){var C;if(r.pressState){var I=ve()-r.pressState.timeStamp,L=X(r.pressState.event.type,O(O({},r.pressState.event),{center:O(O({},r.pressState.event.center),{delta:I}),isFirst:!1,isFinal:!0,pointers:r.pressState.event.pointers.map(function(T){return O(O({},T),{delta:I})})}));r.onPressGesture(L),(C=r.pressState)===null||C===void 0||C.stop(),delete r.pressState}},x=null,w=function(C){var I,L=!1,T=!1;switch(C.type){case"gesturestart":L=!0;break;case"gestureend":T=!0;break}var F={x:C.clientX,y:C.clientY},D=r.relativeClientPosition(F),V=new f.Raycaster;V.params.Points={threshold:.1},V.setFromCamera(D,r.camera);var z=O(O({},F),{coords:D,raycaster:V,buttons:0,delta:0}),U=X("gesture.pinch",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[O({},z)],isFirst:L,isFinal:T,scale:(I=C.scale)!==null&&I!==void 0?I:1,center:O({},z),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:O(O({mode:r.mode},r.currentPano),tt(r.camera.pose))});return U},M=function(C){if(C.preventDefault(),!ai){var I=w(C);x={firstEvent:I};var L=x.firstEvent;L&&!i(L.center)||r.onPinchGesture(I)}},S=function(C){if(C.preventDefault(),!ai&&x){var I=w(C),L=x.firstEvent;L&&!i(L.center)||r.onPinchGesture(I)}},E=function(C){if(C.preventDefault(),!ai&&x){var I=w(C),L=x.firstEvent;x=null,!(L&&!i(L.center))&&r.onPinchGesture(I)}},B=function(C){if(C&&typeof C.preventDefault=="function"&&C.currentTarget===e&&C.preventDefault(),typeof getSelection=="function"){var I=getSelection();I&&I.focusNode&&(I.removeAllRanges&&I.removeAllRanges(),I.empty&&I.empty())}};this.enableWheel&&e.addEventListener("wheel",A,{passive:!1}),e.addEventListener("mousemove",h,!1),e.addEventListener("mouseout",v,!1),e.addEventListener("touchstart",m,{passive:!0}),e.addEventListener("touchend",b,!1),e.addEventListener("touchcancel",b,!1),e.addEventListener("mousedown",y,!1),e.addEventListener("mouseup",b,!1),e.addEventListener("gesturestart",M,{passive:!1}),e.addEventListener("gesturechange",S,{passive:!1}),e.addEventListener("gestureend",E,{passive:!1}),e.addEventListener("touchstart",B,{passive:!1}),e.addEventListener("contextmenu",B,!1);var R=function(){a.destroy(),e.removeEventListener("wheel",A,!1),e.removeEventListener("mousemove",h,!1),e.removeEventListener("mouseout",v,!1),e.removeEventListener("touchstart",m,!1),e.removeEventListener("touchend",b,!1),e.removeEventListener("touchcancel",b,!1),e.removeEventListener("mousedown",y,!1),e.removeEventListener("mouseup",b,!1),e.removeEventListener("gesturestart",M,!1),e.removeEventListener("gesturechange",S,!1),e.removeEventListener("gestureend",E,!1),e.removeEventListener("touchstart",B,!1),e.removeEventListener("contextmenu",B,!1)};return Object.assign(R,{element:e})},t.prototype.preloadPano=function(e,r){var i=this;r===void 0&&(r=Q);var a=this.works.getResolvedObserver(e);if(!a)return Promise.resolve();var o=["right","left","up","down","front","back"];return Promise.all(o.map(function(s){var u=O({key:"pano.".concat(He(e),".").concat(s)},Jt(i.imageOptions,["size","format","quality","mappings"])),l=a.images[s],c=Cn(l,i.imageOptions.transform,u);return pt(a.work).preload(c,{timeout:500})})).then(function(){return r(e),e})},t.prototype.updateScreenBuffer=function(e){var r,i,a,o,s,u;if(this.lastPostProcessingType!==e)if(this.lastPostProcessingType=e,e==="luminance"){if(this.screenBuffers.length===0){var l=this.renderer.getDrawingBufferSize(ao);this.screenBuffers=[new f.WebGLRenderTarget(l.x,l.y,{generateMipmaps:!1,encoding:(i=(r=this.renderer)===null||r===void 0?void 0:r.outputEncoding)!==null&&i!==void 0?i:f.sRGBEncoding}),this.modelRenderTarget]}}else if(e==="edl"){if(this.screenBuffers.length===0){var l=this.renderer.getDrawingBufferSize(ao);this.screenBuffers=[new f.WebGLRenderTarget(l.x,l.y,{generateMipmaps:!1,encoding:(o=(a=this.renderer)===null||a===void 0?void 0:a.outputEncoding)!==null&&o!==void 0?o:f.sRGBEncoding,minFilter:f.NearestFilter,magFilter:f.NearestFilter,format:f.RGBAFormat,type:f.FloatType}),this.modelRenderTarget]}this.models.setMaterial({useEDL:!0})}else if(e==="hq"){if(this.screenBuffers.length===0){var l=this.renderer.getDrawingBufferSize(ao),c=new f.WebGLRenderTarget(l.x,l.y,{generateMipmaps:!1,minFilter:f.NearestFilter,magFilter:f.NearestFilter,format:f.RGBAFormat,type:f.FloatType,depthTexture:new f.DepthTexture(l.x,l.y,f.UnsignedIntType)});c.depthTexture.format=f.DepthFormat,c.depthBuffer=!0;var d=new f.WebGLRenderTarget(l.x,l.y,{generateMipmaps:!1,encoding:(u=(s=this.renderer)===null||s===void 0?void 0:s.outputEncoding)!==null&&u!==void 0?u:f.sRGBEncoding,minFilter:f.NearestFilter,magFilter:f.NearestFilter,format:f.RGBAFormat,type:f.FloatType,depthTexture:c.depthTexture});this.screenBuffers=[c,d,this.modelRenderTarget]}this.models.setMaterial({useHQDepth:!0,useHQWeight:!1,pointShape:"CIRCLE"})}else this.screenBuffers&&(this.screenBuffers.forEach(function(p){p.dispose()}),this.screenBuffers=[]),this.models.setMaterial({useEDL:!1,useHQDepth:!1,useHQWeight:!1})},t}(va),fr={defaultLongitude:Math.PI/4,defaultLatitude:Math.PI/4,defaultFov:80,maxFov:120,minFov:20,maxLatitude:+Math.PI/2,minLatitude:-Math.PI/2,intersectMeshCreator:function(){return new ya}},No=function(n){ue(t,n);function t(e){var r=this,i,a=t.parseArgs(e);return r=n.call(this,a)||this,r.mode="Floorplan",r.defaultLongitude=a.defaultLongitude,r.defaultLatitude=a.defaultLatitude,r.defaultFov=a.defaultFov,r.maxFov=a.maxFov,r.minFov=a.minFov,r.maxLatitude=a.maxLatitude,r.minLatitude=a.minLatitude,r.locationMotion=new Re({x:r.camera.pose.offset.x,y:r.camera.pose.offset.y,z:r.camera.pose.offset.z,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Re({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Re({perspToOrtho:r.camera.perspToOrtho.x}),r.currentTapId=null,r.intersectMeshCreator=a.intersectMeshCreator,r.intersectMesh=r.intersectMeshCreator(),r.intersectMesh.name="intersect",r.intersectMesh.visible=!1,r.helper.add(r.intersectMesh),r}return t.distanceFromModel=function(e,r,i){var a=e.bounding,o=Math.pow(Math.pow(a.max.x-a.min.x+1,2)+Math.pow(a.max.y-a.min.y+1,2)+Math.pow(a.max.z-a.min.z+1,2),1/2),s=o/2/Math.tan(Math.PI*r/360);return i<1&&(s=s/i),isNaN(s)?o:s},t.parseArgs=function(e){var r,i,a,o,s,u,l,c;if(e instanceof t)return e;var d=n.parseArgs.call(this,e);return O(O({},d),{defaultLongitude:(r=e.defaultLongitude)!==null&&r!==void 0?r:fr.defaultLongitude,defaultLatitude:(i=e.defaultLatitude)!==null&&i!==void 0?i:fr.defaultLatitude,defaultFov:(a=e.defaultFov)!==null&&a!==void 0?a:fr.defaultFov,maxFov:(o=e.maxFov)!==null&&o!==void 0?o:fr.maxFov,minFov:(s=e.minFov)!==null&&s!==void 0?s:fr.minFov,maxLatitude:(u=e.maxLatitude)!==null&&u!==void 0?u:fr.maxLatitude,minLatitude:(l=e.minLatitude)!==null&&l!==void 0?l:fr.minLatitude,intersectMeshCreator:(c=e.intersectMeshCreator)!==null&&c!==void 0?c:fr.intersectMeshCreator})},t.initAnimationEndState=function(e){var r,i,a,o,s,u,l,c=this.parseArgs(e),d=e.initial,p=d.state,A=d.currentState,h=typeof p.panoIndex=="number"?{workCode:(a=(r=p.workCode)!==null&&r!==void 0?r:(i=c.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:p.panoIndex}:{workCode:A.workCode,panoIndex:A.panoIndex},v=O(O({},h),{mode:"Floorplan",longitude:(o=p.longitude)!==null&&o!==void 0?o:ko(A.mode)?A.longitude:c.defaultLongitude,latitude:ce((s=p.latitude)!==null&&s!==void 0?s:A.mode==="Floorplan"?A.latitude:c.defaultLatitude,c.minLatitude,c.maxLatitude),fov:(u=p.fov)!==null&&u!==void 0?u:c.defaultFov,offset:p.offset?p.offset.clone():e.models.bounding.getCenter(new f.Vector3),distance:(l=p.distance)!==null&&l!==void 0?l:t.distanceFromModel(c.models,c.defaultFov,c.camera.aspect)});return v},t.prototype.updateConfiguration=function(e){var r=n.prototype.updateConfiguration.call(this,e);if(r===!1)return!1;var i=O(O({},fr),e);if(this.defaultLongitude!==i.defaultLongitude&&(this.defaultLongitude=i.defaultLongitude),this.defaultLatitude!==i.defaultLatitude&&(this.defaultLatitude=i.defaultLatitude),this.defaultFov!==i.defaultFov&&(this.defaultFov=i.defaultFov),this.maxFov!==i.maxFov&&(this.maxFov=i.maxFov),this.minFov!==i.minFov&&(this.minFov=i.minFov),this.maxLatitude!==i.maxLatitude&&(this.maxLatitude=i.maxLatitude),this.minLatitude!==i.minLatitude&&(this.minLatitude=i.minLatitude),this.intersectMeshCreator!==i.intersectMeshCreator){this.intersectMeshCreator=i.intersectMeshCreator;var a=this.intersectMesh;this.intersectMesh=this.intersectMeshCreator(),this.intersectMesh.name=a.name,this.intersectMesh.visible=a.visible;var o=this.intersectMesh.parent;o&&o.add(this.intersectMesh),a.dispose()}return!0},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.locationMotion.dispose(),delete this.panState,this.intersectMesh.dispose(),this.helper.remove(this.intersectMesh)},t.prototype.isReady=function(){return this.locationMotion.ended===!1?!1:n.prototype.isReady.call(this)},t.prototype.updateWork=function(e,r,i,a){var o;return this.works=e,this.updateCamera(r,(o=i.duration)!==null&&o!==void 0?o:0,a),!0},t.prototype.updateModel=function(e){n.prototype.updateModel.call(this,e);var r=e.bounding.getCenter(new f.Vector3),i=t.distanceFromModel(e,this.defaultFov,this.camera.aspect);this.updateCamera({offset:r,distance:i},0,!0)},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={},s={};return e.distance!==void 0&&(o.distance=e.distance),e.offset!==void 0&&(o.x=e.offset.x,o.y=e.offset.y,o.z=e.offset.z),e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),a.locationMotion.set(o,r).catch(Q),a.cameraMotion.set(s,r).catch(Q)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=[],u=0,l=e;u<l.length;u++){var c=l[u];o.push({key:c.key,progress:c.progress,value:{distance:c.value.distance,x:c.value.offset.x,y:c.value.offset.x,z:c.value.offset.x}}),s.push({key:c.key,progress:c.progress,value:{longitude:c.value.longitude,latitude:c.value.latitude,fov:c.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(Q),a.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={},a={};if(this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(ce(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended||(this.locationMotion.update(e),a.distance=this.locationMotion.value.distance,a.offset=new f.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z)),this.cameraMotion.ended||(this.cameraMotion.update(e),a.longitude=this.cameraMotion.value.longitude,a.latitude=this.cameraMotion.value.latitude,a.fov=this.cameraMotion.value.fov),ar(i)||this.models.setMaterial(i),ar(a)||this.setCamera(a),this.intersectMesh&&this.intersectMesh.parent){var o=this.camera.position.distanceTo(this.intersectMesh.position),s=2*Math.tan(.5*this.camera.fov/180*Math.PI),u=o*s/5;this.intersectMesh.scale.setScalar(u)}}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(ve())[1],r=this.locationMotion.getKeyFrameSegment(ve())[1];return O(O({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:new f.Vector3(r.value.x,r.value.y,r.value.z),distance:r.value.distance})},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial;i.state,i.currentState;var a=i.duration,o=i.userAction;e.userAction=o;var s=t.initAnimationEndState(e),u=Jt(s,["longitude","latitude","fov"]),l={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance},c={modelAlpha:1},d={perspToOrtho:0};e.emit("initAnimation.start",X("initAnimation.start",{state:s,userAction:e.userAction})),e.modelAlphaMotion.set(c,a/3).catch(Q),e.perspToOrthoMotion.set(d,a).catch(Q),e.cameraMotion.set(u,a).catch(Q),e.locationMotion.set(l,a).then(function(){e.emit("initAnimation.end",X("initAnimation.end",{state:s,userAction:e.userAction}))},function(p){var A=O(O(O({},e.currentPano),{mode:e.mode}),tt(e.camera.pose));e.emit("initAnimation.end",X("initAnimation.end",{state:A,userAction:e.userAction}))}).then(function(){r()})})},t.prototype.updateRenderSize=function(e){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.screenBuffers.forEach(function(r){r.setSize(e.x,e.y)})},t.prototype.getForwardObserverOrNot=function(e){var r=this,i=this.models.intersectRaycaster(e)[0];if(!i)return null;var a=this.works.resolvedObservers.filter(function(l){for(var c,d=0,p=r.models;d<p.length;d++){var A=p[d];if(A.visible&&((c=A.work)===null||c===void 0?void 0:c.workCode)===l.work.workCode)return!0}return!1}),o=Br(a,function(l){return l.standingPosition.distanceTo(i.point)},!0),s=o[0],u=o[1];return s&&u<10?s:null},t.prototype.coordinatesForOffset=function(e){var r=this.renderer.getSize(new f.Vector2);return{longitude:-2*e.x/(r.x*this.scissor.width),latitude:2*e.y/(r.y*this.scissor.height)}},t.prototype.requestMomentumMovement=function(e,r,i,a){var o=this;if(this.inMomentumMovement!==null){for(var s=O({},i),u={longitude:0,latitude:0},l=0;l<a;l++)s.longitude*=.996,s.latitude*=.996*.998,u.longitude+=s.longitude,u.latitude+=s.latitude;var c=vn(this.cameraMotion.value.longitude+u.longitude),d=ce(this.cameraMotion.value.latitude+u.latitude,this.minLatitude,this.maxLatitude),p=O(O({},this.currentPano),{mode:this.mode,longitude:c,latitude:d,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance}),A=!(s.longitude>1e-4||s.longitude<-1e-4||s.latitude>1e-4||s.latitude<-1e-4),h=X("gesture.momentum",O(O({},e),{isFirst:r,isFinal:A,state:p}));if(this.inMomentumMovement.event=h,this.emit("gesture.momentum",h),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:c,latitude:d},0).catch(Q),A?this.inMomentumMovement=null:Mt.shared.add(function(v,g){o.requestMomentumMovement(e,!1,s,g|0)},!0,1))}},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},!(typeof r=="undefined"||r.pointerLength!==i)){var a={x:e.center.x-r.x,y:e.center.y-r.y},o=this.relativeClientPosition(e.center),s=this.camera.pose.latitude<Math.PI/6||o.y<0?1:-1;a.x*=s;var u=this.coordinatesForOffset(a),l=vn(this.cameraMotion.value.longitude+u.longitude),c=ce(this.cameraMotion.value.latitude+u.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(c=this.cameraMotion.value.latitude);var d=O(O({},this.currentPano),{mode:this.mode,longitude:l,latitude:c,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance});if(e.state=d,this.emit("gesture.pan",e),!e.defaultPrevented&&(this.cameraMotion.set({longitude:d.longitude,latitude:d.latitude},0).catch(Q),e.isFinal)){var p=e.velocityX*s,A=e.velocityY;this.inMomentumMovement={uuid:kt()},this.requestMomentumMovement(e,!0,this.coordinatesForOffset({x:p,y:A}),0)}}},t.prototype.onPinchGesture=function(e){var r;if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement();var i=(r=this.pinchState)===null||r===void 0?void 0:r.fov;if(e.isFirst){this.pinchState={x:e.center.x,y:e.center.y,fov:this.cameraMotion.value.fov};return}if(e.isFinal&&(delete this.panState,delete this.pinchState),typeof i!="undefined"){var a=ce(i/e.scale,this.minFov,this.maxFov);e.state.fov=a,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:a},0).catch(Q),this.onPanGesture(e))}}},t.prototype.onMouseMove=function(e){var r,i;if(this.intersectMesh.parent&&!this.panState){if(this.emit("gesture.mousemove",e),e.defaultPrevented){this.hideIntersectMesh();return}var a=e.center.raycaster;if(e.isFinal&&this.intersectMesh.parent&&this.intersectMesh.visible===!0){this.hideIntersectMesh();return}var o=this.models.intersectRaycaster(a)[0],s=X("intersect.update",{raycaster:a,intersection:o!=null?o:null,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var u=(i=(r=o.face)===null||r===void 0?void 0:r.normal)!==null&&i!==void 0?i:new f.Vector3().copy(a.ray.direction).multiplyScalar(-1),l=u.clone(),c=o.point.clone();this.intersectMesh.position.copy(c);var d=c.clone().add(l);if(this.intersectMesh.lookAt(d),Math.abs(u.y)>.99){var p=this.camera.position.clone().sub(c);this.intersectMesh.rotation.z=-Math.atan2(p.z,p.x)}this.intersectMesh.visible=!0,this.needsRender=!0}else this.hideIntersectMesh()}},t.prototype.onMouseWheel=function(e){if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement();var r=this,i=r.minFov,a=r.maxFov,o=ce(this.camera.fov-e.center.delta,i,a);e.state.fov=o,this.emit("gesture.mousewheel",e),!e.defaultPrevented&&this.cameraMotion.set({fov:o},0).catch(Q)}},t.prototype.onTapGesture=function(e){var r=this;this.userAction=!0,this.stopMomentumMovement();var i=e.center.raycaster,a=this.getForwardObserverOrNot(i);if(!a)this.emit("gesture.tap",e);else{var o={longitude:this.camera.pose.longitude,latitude:0},s=O(O({},e.state),{mode:"Panorama",workCode:a.pano.workCode,panoIndex:a.pano.panoIndex,longitude:o.longitude,latitude:o.latitude,offset:a?a.position.clone():new f.Vector3,distance:0});if(e.state=s,this.emit("gesture.tap",e),!e.defaultPrevented&&(this.emit("pano.select",X("pano.select",{prevPano:this.currentPano,state:s,userAction:e.userAction,options:o,progress:0,error:null})),a&&a.active)){var u=this.currentTapId=kt();this.preloadPano(a.pano).then(function(l){r.currentTapId===u&&r.emit("pano.request",X("pano.request",{userAction:!0,prevPano:r.currentPano,progress:0,state:s,options:o,error:null}))})}}},t.prototype.onDblTapGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement();var r=this.cameraMotion.value.fov,i=this.minFov-r<r-this.defaultFov?this.minFov:this.defaultFov;e.state.fov=i,this.emit("gesture.dbltap",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:i},360).catch(Q),this.hideIntersectMesh())},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.needsRender=!0},t}(fs),mm=O({},Aa(fr,["defaultLongitude","defaultLatitude","maxLatitude","minLatitude"])),Am=function(n){ue(t,n);function t(e){var r=this,i=t.parseArgs(e);return r=n.call(this,i)||this,r.mode="Topview",r}return t.parseArgs=function(e){if(e instanceof t)return e;var r=O(O({},e),{defaultLongitude:0,defaultLatitude:Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return O(O({},i),{longitude:r.defaultLongitude,latitude:r.defaultLatitude,mode:"Topview"})},t.prototype.updateConfiguration=function(e){return n.prototype.updateConfiguration.call(this,O(O({},e),{defaultLongitude:0,defaultLatitude:Math.PI/2}))},t.prototype.updateModel=function(e){this.needsRender=!0,this.modelSceneNeedsRender=!0;var r=this.models.bounding.getCenter(new f.Vector3);this.locationMotion.set({x:r.x,y:r.y,z:r.z,distance:No.distanceFromModel(this.models,this.defaultFov,this.camera.aspect)},0).catch(Q)},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={},s={};return e.distance!==void 0&&(o.distance=e.distance),e.offset!==void 0&&(o.x=e.offset.x,o.y=e.offset.y,o.z=e.offset.z),e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),a.locationMotion.set(o,r).catch(Q),a.cameraMotion.set(s,r).catch(Q)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=[],u=0,l=e;u<l.length;u++){var c=l[u];o.push({key:c.key,progress:c.progress,value:{distance:c.value.distance,x:c.value.offset.x,y:c.value.offset.y,z:c.value.offset.z}}),s.push({key:c.key,progress:c.progress,value:{longitude:c.value.longitude,latitude:c.value.latitude,fov:c.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(Q),a.cameraMotion.setKeyframes(e,r)})},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial;i.state,i.currentState;var a=i.duration,o=i.userAction;e.userAction=o;var s=t.initAnimationEndState(e),u={longitude:s.longitude,latitude:s.latitude,fov:s.fov},l={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance},c={modelAlpha:1},d={perspToOrtho:1};e.emit("initAnimation.start",X("initAnimation.start",{state:s,userAction:e.userAction})),e.modelAlphaMotion.set(c,a/3).catch(Q),e.perspToOrthoMotion.set(d,a).catch(Q),e.cameraMotion.set(u,a).catch(Q),e.locationMotion.set(l,a).then(function(){e.emit("initAnimation.end",X("initAnimation.end",{state:s,userAction:e.userAction}))},function(p){var A=O(O(O({},e.currentPano),{mode:e.mode}),tt(e.camera.pose));e.emit("initAnimation.end",X("initAnimation.end",{state:A,userAction:e.userAction}))}).then(function(){r()})})},t.prototype.requestMomentumMovement=function(){this.inMomentumMovement=null},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement();var r=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},!(typeof r=="undefined"||r.pointerLength!==i)){var a={x:e.center.x-r.x,y:e.center.y-r.y},o=new f.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),s=this.locationMotion.value.distance;s*=Math.tan(this.cameraMotion.value.fov/2*Math.PI/180);var u=this.renderer.getSize(new f.Vector2),l=2*a.x*s/u.y,c=2*a.y*s/u.y,d=new f.Vector3;d.setFromMatrixColumn(this.camera.matrix,0),d.multiplyScalar(-l),o.add(d),d.setFromMatrixColumn(this.camera.matrix,1),d.multiplyScalar(c),o.add(d);var p=this.models.bounding.getCenter(new f.Vector3),A=this.models.bounding.getSize(new f.Vector3),h=Math.max(A.x,A.y,A.z)/2;o.clamp(p.clone().sub(new f.Vector3().setScalar(h)),p.clone().add(new f.Vector3().setScalar(h)));var v=O(O({},this.currentPano),{mode:this.mode,longitude:0,latitude:Math.PI/2,fov:this.cameraMotion.value.fov,offset:o,distance:this.locationMotion.value.distance});e.state=v,this.emit("gesture.pan",e),!e.defaultPrevented&&this.locationMotion.set({x:o.x,y:o.y,z:o.z},0).catch(Q)}},t.prototype.onPinchGesture=function(e){var r;if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement();var i=(r=this.pinchState)===null||r===void 0?void 0:r.fov;if(e.isFirst){this.pinchState={x:e.center.x,y:e.center.y,fov:this.cameraMotion.value.fov};return}if(e.isFinal&&delete this.pinchState,typeof i!="undefined"){var a=ce(i/e.scale,this.minFov,this.maxFov);e.state.fov=a,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:a},0).catch(Q),e.type="gesture.pan",this.onPanGesture(e))}}},t.prototype.onMouseWheel=function(e){if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement();var r=ce(this.cameraMotion.value.fov-e.center.delta,this.minFov,this.maxFov);e.state.fov=r,this.emit("gesture.mousewheel",e),!e.defaultPrevented&&this.cameraMotion.set({fov:r},0).catch(Q)}},t}(No),dr={defaultLatitude:0,defaultFov:90,maxFov:120,minFov:20,maxLatitude:+Math.PI/2,minLatitude:-Math.PI/2,moveSpeed:3.4,intersectMeshCreator:function(){return new ya}},Ql=function(n){ue(t,n);function t(e){var r=this,i=t.parseArgs(e);return r=n.call(this,i)||this,r.mode="PanoramaLike",r.defaultLatitude=i.defaultLatitude,r.defaultFov=i.defaultFov,r.maxFov=i.maxFov,r.minFov=i.minFov,r.maxLatitude=i.maxLatitude,r.minLatitude=i.minLatitude,r.moveSpeed=i.moveSpeed,r.intersectMeshCreator=i.intersectMeshCreator,r.intersectMesh=r.intersectMeshCreator(),r.intersectMesh.name="intersect",r.intersectMesh.visible=!1,r.helper.add(r.intersectMesh),r}return t.parseArgs=function(e){var r,i,a,o,s,u,l,c;if(e instanceof t)return e;var d=n.parseArgs.call(this,e);return O(O({},d),{defaultLatitude:(r=e.defaultLatitude)!==null&&r!==void 0?r:dr.defaultLatitude,defaultFov:(i=e.defaultFov)!==null&&i!==void 0?i:dr.defaultFov,maxFov:(a=e.maxFov)!==null&&a!==void 0?a:dr.maxFov,minFov:(o=e.minFov)!==null&&o!==void 0?o:dr.minFov,maxLatitude:(s=e.maxLatitude)!==null&&s!==void 0?s:dr.maxLatitude,minLatitude:(u=e.minLatitude)!==null&&u!==void 0?u:dr.minLatitude,moveSpeed:(l=e.moveSpeed)!==null&&l!==void 0?l:dr.moveSpeed,intersectMeshCreator:(c=e.intersectMeshCreator)!==null&&c!==void 0?c:dr.intersectMeshCreator})},t.initAnimationEndState=function(e){var r,i,a,o,s,u,l=this.parseArgs(e),c=l.works,d=e.initial,p=d.state,A=d.currentState,h=typeof p.panoIndex=="number"?{workCode:(a=(r=p.workCode)!==null&&r!==void 0?r:(i=l.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:p.panoIndex}:{workCode:A.workCode,panoIndex:A.panoIndex},v=c.getResolvedObserver(h),g=(o=p.longitude)!==null&&o!==void 0?o:A.longitude,m=ce((s=p.latitude)!==null&&s!==void 0?s:yi(A.mode)?A.latitude:l.defaultLatitude,l.minLatitude,l.maxLatitude),y=ce((u=p.fov)!==null&&u!==void 0?u:yi(A.mode)?A.fov:l.defaultFov,l.minFov,l.maxFov),b=v?v.position.clone():new f.Vector3;return{workCode:h.workCode,panoIndex:h.panoIndex,mode:"PanoramaLike",longitude:g,latitude:m,fov:y,offset:b,distance:0}},t.prototype.updateConfiguration=function(e){var r=n.prototype.updateConfiguration.call(this,e);if(r===!1)return!1;var i=O(O({},dr),e);if(this.defaultLatitude!==i.defaultLatitude&&(this.defaultLatitude=i.defaultLatitude),this.maxLatitude!==i.maxLatitude&&(this.maxLatitude=i.maxLatitude),this.minLatitude!==i.minLatitude&&(this.minLatitude=i.minLatitude),this.defaultFov!==i.defaultFov&&(this.defaultFov=i.defaultFov),this.maxFov!==i.maxFov&&(this.maxFov=i.maxFov),this.minFov!==i.minFov&&(this.minFov=i.minFov),this.moveSpeed!==i.moveSpeed&&(this.moveSpeed=i.moveSpeed),this.intersectMeshCreator!==i.intersectMeshCreator){this.intersectMeshCreator=i.intersectMeshCreator;var a=this.intersectMesh;this.intersectMesh=this.intersectMeshCreator(),this.intersectMesh.name=a.name,this.intersectMesh.visible=a.visible;var o=this.intersectMesh.parent;o&&o.add(this.intersectMesh),a.dispose()}return!0},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.intersectMesh&&(this.helper.remove(this.intersectMesh),this.intersectMesh.dispose()),delete this.panState},t.prototype.isReady=function(){return this.panState||this.pinchState?!1:n.prototype.isReady.call(this)},t.prototype.calculateMovingDuration=function(e,r){switch(typeof e){case"function":return e(r,this.moveSpeed);case"number":return e;case"string":return Number(e);default:return ce(r,2,5)/this.moveSpeed*1e3}},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.needsRender=!0},t.prototype.coordinatesForOffset=function(e){var r=this.cameraMotion.value.fov,i=this.camera.aspect,a=this.renderer.getSize(new f.Vector2);return{longitude:2*e.x/(a.x*this.scissor.width)*r/95*i,latitude:-2*e.y/(a.y*this.scissor.height)*r/95}},t.prototype.cameraBounce=function(){var e=this.cameraMotion.value,r=e.longitude,i=e.latitude,a=e.fov,o=[{progress:0,value:{longitude:r,latitude:i,fov:a}},{progress:.5,value:{longitude:r,latitude:i,fov:a*.98}},{progress:1,value:{longitude:r,latitude:i,fov:a}}];this.cameraMotion.setKeyframes(o,500).catch(Q)},t.prototype.requestMomentumMovement=function(e,r,i,a){var o=this;if(this.inMomentumMovement!==null){for(var s=O({},i),u={longitude:0,latitude:0},l=0;l<a;l++)s.longitude*=.996,s.latitude*=.996*.99,u.longitude+=s.longitude,u.latitude+=s.latitude;var c=vn(this.cameraMotion.value.longitude+u.longitude),d=ce(this.cameraMotion.value.latitude+u.latitude,this.minLatitude,this.maxLatitude),p=O(O({},this.currentPano),{mode:this.mode,longitude:c,latitude:d,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance}),A=!(s.longitude>1e-4||s.longitude<-1e-4||s.latitude>1e-4||s.latitude<-1e-4),h=X("gesture.momentum",O(O({},e),{isFirst:r,isFinal:A,state:p}));if(this.inMomentumMovement.event=h,this.emit("gesture.momentum",h),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:c,latitude:d},0).catch(Q),A?this.inMomentumMovement=null:Mt.shared.add(function(v,g){o.requestMomentumMovement(e,!1,s,g|0)},!0,1))}},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},!(typeof r=="undefined"||r.pointerLength!==i)){var a={x:e.center.x-r.x,y:e.center.y-r.y},o=this.coordinatesForOffset(a),s=vn(this.cameraMotion.value.longitude+o.longitude),u=ce(this.cameraMotion.value.latitude+o.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(u=this.cameraMotion.value.latitude);var l=O(O({},this.currentPano),{mode:this.mode,longitude:s,latitude:u,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance});if(e.state=l,this.emit("gesture.pan",e),!e.defaultPrevented){var c={longitude:l.longitude,latitude:l.latitude,fov:l.fov};if(this.cameraMotion.set(c,0).catch(Q),e.isFinal){var d=e.velocityX,p=e.velocityY*.6;Math.abs(p)>.5&&Math.abs(d)<.5&&(d=0),this.inMomentumMovement={uuid:kt()},this.requestMomentumMovement(e,!0,this.coordinatesForOffset({x:d,y:p}),0)}}}},t.prototype.onPinchGesture=function(e){var r;this.userAction=e.userAction,this.stopMomentumMovement();var i=(r=this.pinchState)===null||r===void 0?void 0:r.fov,a=e.scale;if(e.isFirst){this.pinchState={x:e.center.x,y:e.center.y,fov:this.cameraMotion.value.fov};return}if(e.isFinal&&delete this.pinchState,typeof i!="undefined"){var o=ce(i/a,this.minFov,this.maxFov);e.state.fov=o,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:o},0).catch(Q),e.type="gesture.pan",this.onPanGesture(e))}},t.prototype.onMouseWheel=function(e){this.userAction=e.userAction,this.stopMomentumMovement();var r=ce(this.cameraMotion.value.fov-e.center.delta,this.minFov,this.maxFov);e.state.fov=r,this.emit("gesture.mousewheel",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:r},0).catch(Q),this.onMouseMove(e))},t.prototype.onMouseMove=function(e){var r,i;if(this.intersectMesh.parent&&!this.panState&&(this.emit("gesture.mousemove",e),!e.defaultPrevented)){var a=e.center.raycaster;if(e.isFinal&&this.intersectMesh.parent){this.hideIntersectMesh();return}var o=this.models.intersectRaycaster(a)[0],s=X("intersect.update",{raycaster:a,intersection:o!=null?o:null,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var u=(i=(r=o.face)===null||r===void 0?void 0:r.normal)!==null&&i!==void 0?i:new f.Vector3().copy(a.ray.direction).multiplyScalar(-1),l=u.clone(),c=o.point.clone();this.intersectMesh.position.copy(c);var d=c.clone().add(l);if(this.intersectMesh.lookAt(d),Math.abs(u.y)>.99){var p=this.camera.position.clone().sub(c);this.intersectMesh.rotation.z=-Math.atan2(p.z,p.x)}this.intersectMesh.visible=!0,this.needsRender=!0}else this.hideIntersectMesh()}},t.prototype.onDblTapGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement();var r=this.cameraMotion.value.fov,i=2,a=this.works.getResolvedObserver(this.currentPano);if(a){var o=a.images.tiles;o&&o.length&&(i=Math.max.apply(Math,o.map(function(l){return l.level})))}var s=Math.max(40-i*5,this.minFov,5),u=s-r<r-this.defaultFov?s:this.defaultFov;e.state.fov=u,this.emit("gesture.dbltap",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:u},360).catch(Q),this.hideIntersectMesh())},t}(fs),gm="data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZS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AkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw",oo;function Ul(){return oo||(oo=new Promise(function(n){var t,e=document.createElement("video");e.muted=!0,e.src=gm,e.addEventListener("timeupdate",function r(){e.removeEventListener("timeupdate",r,!1),clearTimeout(t);var i=document.createElement("canvas");i.width=i.height=1;var a=i.getContext("2d");if(!a){n(!1);return}a.drawImage(e,0,0,1,1);var o=a.getImageData(0,0,1,1).data;o[3]>10?n(!0):n(!1)},!1),e.addEventListener("canplay",function r(){e.removeEventListener("canplay",r,!1),e.play()},!1),t=window.setTimeout(function(){return n(!1)},1e3)}))}var ym=`
|
|
1478
1478
|
#include <common>
|
|
1479
1479
|
uniform sampler2D inputBuffer;
|
|
1480
1480
|
uniform float scale;
|
|
@@ -1558,7 +1558,7 @@ void main() {
|
|
|
1558
1558
|
gl_FragColor.a = 1.0 - texture2D(luminanceMap, vUv).r;
|
|
1559
1559
|
#endif
|
|
1560
1560
|
}
|
|
1561
|
-
`,Rm=function(n){ue(t,n);function t(){var e=n.call(this,{uniforms:{map:{value:null},luminanceMap:{value:null},flipY:{value:1},level:{value:0}},vertexShader:Tm,fragmentShader:Pm})||this;return e.depthTest=!1,e.depthWrite=!1,e.blending=f.NoBlending,e.map=e.uniforms.map.value,e.luminanceMap=e.uniforms.luminanceMap.value,e.flipY=!!e.uniforms.flipY.value,e.level=e.uniforms.level.value,Object.defineProperties(e,{map:{get:function(){return this.uniforms.map.value},set:function(r){this.uniforms.map.value=r}},luminanceMap:{get:function(){return this.uniforms.luminanceMap.value},set:function(r){this.uniforms.luminanceMap.value=r,this.defines.USE_LUMINANCE=r!==null,this.needsUpdate=!0}},flipY:{get:function(){return this.uniforms.flipY.value===1},set:function(r){this.uniforms.flipY.value=r?1:0}},level:{get:function(){return this.uniforms.level.value},set:function(r){this.uniforms.level.value=r}}}),e}return t}(f.ShaderMaterial),Bm=function(n){ue(t,n);function t(e,r){var i=n.call(this,xa,new Rm)||this;return e.box.getCenter(i.position),i.quaternion.multiplyQuaternions(new f.Quaternion().setFromAxisAngle(new f.Vector3(0,1,0),-Math.PI),Sm[e.face]),i.scale.setScalar(e.size),i.node=e,i.name="tiling:tile",i.material.visible=!1,i.activeTime=-1,i.disposed=!1,i.needsRender=!1,i.frustumCulled=!1,r.then(function(a){var o=a[0],s=a[1];i.disposed?(o.dispose(),s==null||s.dispose()):(i.material.map=o,i.material.luminanceMap=s,i.material.flipY=!!o.flipY,i.material.level=e.level,i.material.needsUpdate=!0,i.material.visible=!0,i.needsRender=!0)}).catch(Q),i}return t.prototype.updateTime=function(e){},t.prototype.dispose=function(){var e;this.disposed=!0,this.material.map&&(this.material.map.dispose(),(e=this.material.luminanceMap)===null||e===void 0||e.dispose()),this.material.dispose()},t}(f.Mesh),Fm=function(n){ue(t,n);function t(){var e=n.call(this)||this;return e.needsRender=!1,e.name="tiling",e}return t}(f.Group),Lm=function(){function n(t,e,r){this.disposed=!1,this.textureLoader=new Xn,this.minLevel=e,this.level=0,this.panoId="[0]",this.maxRequest=n.DEFAULT_MAX_REQUEST,this.pedding=0,this.tileTree=bo(this.minLevel),this.tileMeshes=new Map,this.resource=[],this.luminance=null,this.imageOptions=r,this.fetcher=t,this.object=new Fm,this.object.renderOrder=-3}return n.prototype.setFetcher=function(t){this.fetcher=t},n.prototype.cleanup=function(){var t=this;this.tileMeshes.forEach(function(e){e.dispose(),t.object.remove(e),t.object.needsRender=!0}),this.tileMeshes.clear()},n.prototype.setRotation=function(t){this.disposed||this.object.quaternion.equals(t)||(this.object.quaternion.copy(t),this.object.needsRender=!0)},n.prototype.setPosition=function(t){this.disposed||this.object.position.equals(t)||(this.object.position.copy(t),this.object.needsRender=!0)},n.prototype.setResource=function(t,e){var r,i;if(!this.disposed&&!(this.resource===t&&this.luminance===e)){this.cleanup(),this.resource=t;var a=(i=(r=t.slice().sort(function(o,s){return s.level-o.level})[0])===null||r===void 0?void 0:r.level)!==null&&i!==void 0?i:0;this.tileTree=bo(a),this.luminance=e,this.object.needsRender=!0}},n.prototype.update=function(t,e,r){var i=this;if(!this.disposed){this.level=e;var a=t.planes[5].normal,o=[];e>=this.minLevel&&
|
|
1561
|
+
`,Rm=function(n){ue(t,n);function t(){var e=n.call(this,{uniforms:{map:{value:null},luminanceMap:{value:null},flipY:{value:1},level:{value:0}},vertexShader:Tm,fragmentShader:Pm})||this;return e.depthTest=!1,e.depthWrite=!1,e.blending=f.NoBlending,e.map=e.uniforms.map.value,e.luminanceMap=e.uniforms.luminanceMap.value,e.flipY=!!e.uniforms.flipY.value,e.level=e.uniforms.level.value,Object.defineProperties(e,{map:{get:function(){return this.uniforms.map.value},set:function(r){this.uniforms.map.value=r}},luminanceMap:{get:function(){return this.uniforms.luminanceMap.value},set:function(r){this.uniforms.luminanceMap.value=r,this.defines.USE_LUMINANCE=r!==null,this.needsUpdate=!0}},flipY:{get:function(){return this.uniforms.flipY.value===1},set:function(r){this.uniforms.flipY.value=r?1:0}},level:{get:function(){return this.uniforms.level.value},set:function(r){this.uniforms.level.value=r}}}),e}return t}(f.ShaderMaterial),Bm=function(n){ue(t,n);function t(e,r){var i=n.call(this,xa,new Rm)||this;return e.box.getCenter(i.position),i.quaternion.multiplyQuaternions(new f.Quaternion().setFromAxisAngle(new f.Vector3(0,1,0),-Math.PI),Sm[e.face]),i.scale.setScalar(e.size),i.node=e,i.name="tiling:tile",i.material.visible=!1,i.activeTime=-1,i.disposed=!1,i.needsRender=!1,i.frustumCulled=!1,r.then(function(a){var o=a[0],s=a[1];i.disposed?(o.dispose(),s==null||s.dispose()):(i.material.map=o,i.material.luminanceMap=s,i.material.flipY=!!o.flipY,i.material.level=e.level,i.material.needsUpdate=!0,i.material.visible=!0,i.needsRender=!0)}).catch(Q),i}return t.prototype.updateTime=function(e){},t.prototype.dispose=function(){var e;this.disposed=!0,this.material.map&&(this.material.map.dispose(),(e=this.material.luminanceMap)===null||e===void 0||e.dispose()),this.material.dispose()},t}(f.Mesh),Fm=function(n){ue(t,n);function t(){var e=n.call(this)||this;return e.needsRender=!1,e.name="tiling",e}return t}(f.Group),Lm=function(){function n(t,e,r){this.disposed=!1,this.textureLoader=new Xn,this.minLevel=e,this.level=0,this.panoId="[0]",this.maxRequest=n.DEFAULT_MAX_REQUEST,this.pedding=0,this.tileTree=bo(this.minLevel),this.tileMeshes=new Map,this.resource=[],this.luminance=null,this.imageOptions=r,this.fetcher=t,this.object=new Fm,this.object.renderOrder=-3}return n.prototype.setFetcher=function(t){this.fetcher=t},n.prototype.cleanup=function(){var t=this;this.tileMeshes.forEach(function(e){e.dispose(),t.object.remove(e),t.object.needsRender=!0}),this.tileMeshes.clear()},n.prototype.setRotation=function(t){this.disposed||this.object.quaternion.equals(t)||(this.object.quaternion.copy(t),this.object.needsRender=!0)},n.prototype.setPosition=function(t){this.disposed||this.object.position.equals(t)||(this.object.position.copy(t),this.object.needsRender=!0)},n.prototype.setResource=function(t,e){var r,i;if(!this.disposed&&!(this.resource===t&&this.luminance===e)){this.cleanup(),this.resource=t;var a=(i=(r=t.slice().sort(function(o,s){return s.level-o.level})[0])===null||r===void 0?void 0:r.level)!==null&&i!==void 0?i:0;this.tileTree=bo(a),this.luminance=e,this.object.needsRender=!0}},n.prototype.update=function(t,e,r){var i=this;if(!this.disposed){this.level=e;var a=t.planes[5].normal,o=[];e>=this.minLevel&&jo(this.tileTree,function(y){if(!(y.level<i.minLevel)){if(y.level>e||!t.intersectsBox(y.box))return!1;o.push(y)}}),o.sort(function(y,b){return y.level!==b.level?y.level-b.level:y.box.getCenter(O0).angleTo(a)-b.box.getCenter(O0).angleTo(a)});for(var s=new Set,u=function(y){var b=l.resource.filter(function(G){return G.level===y.level})[0];if(!b)return"continue";if(s.add(y),l.tileMeshes.has(y))return l.tileMeshes.get(y).activeTime=r,"continue";if(l.pedding>=l.maxRequest)return"continue";var x=b.size,w=l.imageOptions.transform,M=Math.pow(2,y.level)*y.position.y,S=Math.pow(2,y.level)*y.position.x,E="".concat(l.panoId,".").concat(y.face,".").concat(y.level,".").concat(M,".").concat(S),B=O(O({},Jt(l.imageOptions,["format","sharpen","mappings"])),{key:"pano_tile.".concat(E),size:b.scale>=1?void 0:x*y.size*b.scale,cut:[x*y.position.x,x*y.position.y,x*y.size,x*y.size]});y.level===1&&b.scale>=.5&&(B.format==="jpg"||/\.jpg$/.test(b[y.face]))&&(B.size=void 0,B.quality||(B.quality=70));var R=l.textureLoader.loadTexture(b[y.face],{imageURL:{transform:w,options:B},minFilter:f.LinearFilter,magFilter:f.LinearFilter,generateMipmaps:!1,fetcher:l.fetcher}).then(function(G){return G.body}),C=null;if(l.luminance){var I=l.luminance[y.face],L=I.match(/\/cube_(\d+)\//),T=L?Number(L[1]):!1;if(T!==!1){var F=b.size*b.scale/2,D=F*y.size,V=T<F?I.replace(/\/cube_(\d+)\//,"cube_"+F):I,z=O(O({},B),{size:T*y.size===D?void 0:D,cut:[T*y.position.x,T*y.position.y,T*y.size,T*y.size],key:"pano_tile_luminance.".concat(E)});C=l.textureLoader.loadTexture(V,{imageURL:{transform:l.imageOptions.transform,options:z},minFilter:f.LinearFilter,magFilter:f.LinearFilter,fetcher:l.fetcher}).then(function(G){return G.body}).catch(function(){return null})}}l.pedding++;var U=Promise.all([R,C]).then(function(G){return i.pedding--,G},function(G){return i.pedding--,Promise.reject(G)}),q=new Bm(y,U);q.name="tiling:tile-".concat(E),q.activeTime=r,q.renderOrder=y.level,l.tileMeshes.set(y,q),l.object.needsRender=!0,l.object.add(q)},l=this,c=0,d=o;c<d.length;c++){var p=d[c];u(p)}var A=[];this.tileMeshes.forEach(function(y,b){s.has(b)||A.push(b),y.visible=b.level<=e});for(var h=A.sort(function(y,b){var x,w,M,S;return((w=(x=i.tileMeshes.get(b))===null||x===void 0?void 0:x.activeTime)!==null&&w!==void 0?w:0)-((S=(M=i.tileMeshes.get(y))===null||M===void 0?void 0:M.activeTime)!==null&&S!==void 0?S:0)}).slice(Math.max(0,Mm-s.size)),v=0,g=h;v<g.length;v++){var p=g[v],m=this.tileMeshes.get(p);m&&(m.dispose(),this.object.remove(m),this.object.needsRender=!0),this.tileMeshes.delete(p)}}},n.prototype.dispose=function(){this.cleanup(),this.resource=[],this.disposed=!0},n.DEFAULT_MAX_REQUEST=3,n}(),km=new Float32Array([-1,1,1,-1,1,-1,-1,-1,1,-1,-1,-1,1,1,-1,1,1,1,1,-1,-1,1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,-1,1,-1,-1,1,1,-1,-1,-1,-1,-1,1,1,1,-1,1,1,1,-1,1,-1,-1,1,-1,1,-1,1,1,-1,-1,-1,-1,1,-1,-1]),Om=new Uint8Array([0,2,1,2,3,1,4,6,5,6,7,5,8,10,9,10,11,9,12,14,13,14,15,13,16,18,17,18,19,17,20,22,21,22,23,21]),hs=new f.BufferGeometry;hs.setAttribute("position",new f.BufferAttribute(km,3));hs.setIndex(new f.BufferAttribute(Om,1));var Dm=`
|
|
1562
1562
|
#if defined(USE_PANO_VIDEO)
|
|
1563
1563
|
varying vec3 worldPosition;
|
|
1564
1564
|
#endif
|
|
@@ -1593,7 +1593,7 @@ void main() {
|
|
|
1593
1593
|
gl_FragColor = vec4(videoColor.rgb, match * blendAlpha * alpha);
|
|
1594
1594
|
#endif
|
|
1595
1595
|
}
|
|
1596
|
-
`,Nm=function(){function n(){this.material=new f.ShaderMaterial({vertexShader:Dm,fragmentShader:Vm,uniforms:{size:new f.Uniform(null),matrix:new f.Uniform(null),alpha:new f.Uniform(null),map:new f.Uniform(null)},depthTest:!1,depthWrite:!1,defines:{USE_PANO_VIDEO:!1},blending:f.CustomBlending,blendSrc:f.SrcAlphaFactor,blendDst:f.OneMinusSrcAlphaFactor,blendSrcAlpha:f.OneFactor,blendDstAlpha:f.OneMinusSrcAlphaFactor}),this.object=new f.Mesh(hs,this.material),this.object.visible=!1,this.object.renderOrder=-1,this.object.frustumCulled=!1,this.object.name="pano-video",this.alphaMotion=new Re({alpha:0})}return n.prototype.setMaterial=function(t){t?(this.material.uniforms.size.value=t.size,this.material.uniforms.matrix.value=t.matrix,this.material.uniforms.map.value=t.map,this.alphaMotion.set({alpha:t.alpha},500).catch(Q),this.material.uniforms.alpha.value=t.alpha):(this.material.uniforms.size.value=null,this.material.uniforms.matrix.value=null,this.material.uniforms.map.value=null,this.alphaMotion.set({alpha:0},0).catch(Q));var e=t!==null,r=this.material.defines.USE_PANO_VIDEO;e!==r&&(this.material.defines.USE_PANO_VIDEO=e,this.material.needsUpdate=!0,this.object.visible=t!==null)},n.prototype.updateTime=function(t){this.alphaMotion.ended||(this.alphaMotion.update(t),this.material.uniforms.alpha.value=this.alphaMotion.value.alpha)},n.prototype.dispose=function(){this.material.dispose()},n}(),zm=new f.Matrix4().makeRotationAxis(new f.Vector3(0,1,0),Math.PI),D0=new f.Vector3(-1,1,1),V0=function(){function n(t){t===void 0&&(t=0),this.width=t,this.pool=[]}return Object.defineProperty(n.prototype,"size",{get:function(){return this.pool.length},enumerable:!1,configurable:!0}),n.prototype.create=function(){return new f.WebGLCubeRenderTarget(this.width,{stencilBuffer:!1,depthBuffer:!1})},n.prototype.pop=function(){var t=this.pool.pop();return t||this.create()},n.prototype.push=function(t){this.pool.indexOf(t)===-1&&this.pool.push(t)},n.prototype.clear=function(){for(var t=0,e=this.pool;t<e.length;t++){var r=e[t];r.dispose()}this.pool.length=0},n}(),pr=O(O({},dr),{maxAccessibleDistance:5,panoTapTriggerRadius:.5,panoCircleMeshCreator:function(n){return new kl},tiledCubeTextureLevel:2,tileLevelForFov:function(n,t){var e,r=function(s){return s/180*Math.PI},i=(e=Math.log2)!==null&&e!==void 0?e:function(s){return Math.log(s)*Math.LOG2E},a=t.height/2/Math.tan(r(n/2))*Math.tan(r(45))*2,o=Math.max(i(a/512),0);return o<2.3&&o>.1&&(o=1),console.log(o),o=o%1>.75?Math.ceil(o):Math.floor(o),o},tileMaxRequest:3,luminanceAdaptiveEffectEnable:!0}),ps=function(n){ue(t,n);function t(e){var r=this,i,a,o,s,u=t.parseArgs(e);r=n.call(this,u)||this,r.mode="Panorama",r.tileLevel=0,r.initAnimationed=!1,r.maxAccessibleDistance=u.maxAccessibleDistance,r.panoTapTriggerRadius=u.panoTapTriggerRadius,r.panoCircleMeshCreator=u.panoCircleMeshCreator,r.tiledCubeTextureLevel=u.tiledCubeTextureLevel,r.tileLevelForFov=u.tileLevelForFov,r.tileMaxRequest=u.tileMaxRequest,r.luminanceAdaptiveEffectEnable=u.luminanceAdaptiveEffectEnable,r.luminanceAdaptiveEffect=new k0(r.renderer,r.modelScene,r.camera,r.models),r.colorCubeRenderTargetPool=new V0,r.luminanceCubeRenderTargetPool=new V0;var l=r.models.getMaterial()||{},c=l.pano0,d=l.pano1;c&&(d==null?void 0:d.map)!==c.map&&(r.models.setMaterial({pano0:d}),c.map.dispose(),c.map instanceof qe&&c.map.cubeRenderTarget&&r.colorCubeRenderTargetPool.push(c.map.cubeRenderTarget),c.luminanceMap&&(c.luminanceMap.dispose(),c.luminanceMap instanceof qe&&c.luminanceMap.cubeRenderTarget&&r.luminanceCubeRenderTargetPool.push(c.luminanceMap.cubeRenderTarget)));for(var p=r.colorCubeRenderTargetPool.size;p<2;p++){var A=Math.max(1024*r.tiledCubeTextureLevel,512),h=r.colorCubeRenderTargetPool.create();h.setSize(A,A),wo(null,h,r.renderer),r.colorCubeRenderTargetPool.push(h)}r.panoMeshes={},r.updatePanoMeshes(),r.locationMotion=new Re({count:0,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Re({modelAlpha:(a=(i=r.models.getMaterial())===null||i===void 0?void 0:i.modelAlpha)!==null&&a!==void 0?a:0}),r.perspToOrthoMotion=new Re({perspToOrtho:r.camera.perspToOrtho.x}),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=kt()]={panoId:He(r.currentPano),panoPicture:(s=(o=r.models.getMaterial())===null||o===void 0?void 0:o.pano1)!==null&&s!==void 0?s:null,position:r.camera.pose.offset.clone(),effect:"fly",fixCameraTransform:new f.Matrix4};var v=r.works.getResolvedObserver(r.currentPano);return r.textureLoader=new Xn,r.tiling=new Lm(v?pt(v.work):ra,r.tiledCubeTextureLevel+1,r.imageOptions),r.scene.add(r.tiling.object),r.panoVideo=new Nm,r.scene.add(r.panoVideo.object),r}return t.parseArgs=function(e){var r,i,a,o,s,u,l;if(e instanceof t)return e;var c=n.parseArgs.call(this,e);return O(O({},c),{maxAccessibleDistance:(r=e.maxAccessibleDistance)!==null&&r!==void 0?r:pr.maxAccessibleDistance,panoTapTriggerRadius:(i=e.panoTapTriggerRadius)!==null&&i!==void 0?i:pr.panoTapTriggerRadius,panoCircleMeshCreator:(a=e.panoCircleMeshCreator)!==null&&a!==void 0?a:pr.panoCircleMeshCreator,tiledCubeTextureLevel:(o=e.tiledCubeTextureLevel)!==null&&o!==void 0?o:pr.tiledCubeTextureLevel,tileLevelForFov:(s=e.tileLevelForFov)!==null&&s!==void 0?s:pr.tileLevelForFov,tileMaxRequest:(u=e.tileMaxRequest)!==null&&u!==void 0?u:pr.tileMaxRequest,luminanceAdaptiveEffectEnable:(l=e.luminanceAdaptiveEffectEnable)!==null&&l!==void 0?l:pr.luminanceAdaptiveEffectEnable})},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return O(O({},i),{mode:"Panorama"})},t.prototype.updateConfiguration=function(e){var r=this,i=n.prototype.updateConfiguration.call(this,e);if(i===!1)return!1;var a=O(O({},pr),e);if(this.maxAccessibleDistance!==a.maxAccessibleDistance&&(this.maxAccessibleDistance=a.maxAccessibleDistance),this.panoTapTriggerRadius!==a.panoTapTriggerRadius&&(this.panoTapTriggerRadius=a.panoTapTriggerRadius),this.panoCircleMeshCreator!==a.panoCircleMeshCreator&&(this.panoCircleMeshCreator=a.panoCircleMeshCreator,this.panoMeshes)){for(var o=Object.keys(this.panoMeshes),s=0,u=o;s<u.length;s++){var l=u[s],c=this.panoMeshes[l];this.helper.remove(c),c.dispose(),delete this.panoMeshes[l]}this.updatePanoMeshes()}return this.tiledCubeTextureLevel!==a.tiledCubeTextureLevel&&(this.tiledCubeTextureLevel=a.tiledCubeTextureLevel,setTimeout(function(){r.moveToPano(r.currentPano,{},!0)},30)),this.tileLevelForFov!==a.tileLevelForFov&&(this.tileLevelForFov=a.tileLevelForFov),this.tileMaxRequest!==a.tileMaxRequest&&(this.tileMaxRequest=a.tileMaxRequest),this.luminanceAdaptiveEffectEnable!==a.luminanceAdaptiveEffectEnable&&(this.luminanceAdaptiveEffectEnable=a.luminanceAdaptiveEffectEnable),!0},t.prototype.destroy=function(){var e,r;if(n.prototype.destroy.call(this),this.scene.remove(this.tiling.object),this.tiling.dispose(),this.locationMotion.dispose(),this.colorCubeRenderTargetPool.clear(),this.luminanceCubeRenderTargetPool.clear(),delete this.pendingTextureTask,this.panoMeshes)for(var i=Object.keys(this.panoMeshes),a=0,o=i;a<o.length;a++){var s=o[a],u=this.panoMeshes[s];this.helper.remove(u),u.dispose(),delete this.panoMeshes[s]}var l=this.videoTexture.image;l.pause(),l.oncanplay=function(){},l.ontimeupdate=function(){},this.scene.remove(this.panoVideo.object),this.panoVideo.setMaterial(null),this.panoVideo.dispose();for(var c=(e=this.models.getMaterial())!==null&&e!==void 0?e:{},d=c.pano0,p=c.pano1,A=0,h=Object.keys(this.panoResources);A<h.length;A++){var v=h[A],g=this.panoResources[v];if(g.panoPicture){var m=g.panoPicture.map;m&&m!==(d==null?void 0:d.map)&&m!==(p==null?void 0:p.map)&&(m.dispose(),(r=g.panoPicture.luminanceMap)===null||r===void 0||r.dispose(),g.panoPicture=null)}delete this.panoResources[v]}this.luminanceAdaptiveEffect.dispose()},t.prototype.isReady=function(){return this.locationMotion.ended!==!0?!1:n.prototype.isReady.call(this)},t.prototype.isTileReady=function(){var e,r,i,a=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),o=((e=a.panoPicture)===null||e===void 0?void 0:e.map)instanceof qe&&(i=(r=a.panoPicture)===null||r===void 0?void 0:r.map.tilePending)!==null&&i!==void 0?i:0,s=o<=0,u=this.tiling.pedding,l=this.tiling.object.visible&&u<=0;return this.initAnimationed&&s&&l},t.prototype.updateWork=function(e,r,i,a){var o=this;this.userAction=a,this.works=e;var s=t.initAnimationEndState(O(O({},this),{initial:{currentState:O(O({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:a}})),u={workCode:s.workCode,panoIndex:s.panoIndex},l=this.works.getWork(u.workCode);return this.tiling.setFetcher(l?pt(l):ra),this.tiling.cleanup(),this.initAnimationed=!1,this.hideIntersectMesh(),this.updatePanoMeshes(),this.moveToPano(u,{effect:i.effect,duration:i.duration,longitude:r.longitude,latitude:r.latitude,fov:r.fov,moveEndCallback:function(){o.initAnimationed=!0},moveCancelCallback:function(){o.initAnimationed=!0}},a),!0},t.prototype.updateModel=function(e){this.models=e,this.updatePanoMeshes()},t.prototype.updateTime=function(e,r){var i=this,a,o,s,u,l,c,d,p,A,h;if(!this.destroyed){var v={},g={},m=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),y=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),b=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),g.longitude=this.cameraMotion.value.longitude,g.latitude=this.cameraMotion.value.latitude,g.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),v.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(ce(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var x=this.locationMotion.getKeyFrameSegment(e),w=x[0],M=x[1],S=this.panoResourceFromLocationMotionKeyframe(w),E=this.panoResourceFromLocationMotionKeyframe(M),P=new f.Vector3().copy(S.position),B=new f.Vector3().copy(E.position),C=this.locationMotion.value.count-M.value.count+1;v.progress=C,E.panoPicture&&(C<1?S.panoPicture&&(v.pano0=S.panoPicture):v.pano0=E.panoPicture,v.pano1=E.panoPicture),E.effect==="montage"?v.transition="BLACK":E.effect==="spread"?v.transition="SPREAD":v.transition="FADE",(E.effect==="zoomin"||E.effect==="zoomout")&&(v.progress=Math.pow(C,3)),C<1&&E.effect!=="fly"&&(v.pano0&&S.panoPicture&&(v.pano0={map:v.pano0.map,zoom:v.pano0.zoom,luminanceMap:v.pano0.luminanceMap,matrix:S.panoPicture.matrix.clone().premultiply(S.fixCameraTransform).setPosition(E.position)}),P.copy(B),b=!0),g.distance=this.locationMotion.value.distance,g.offset=new f.Vector3(P.x+(B.x-P.x)*C,P.y+(B.y-P.y)*C,P.z+(B.z-P.z)*C);for(var I=[],F=[],T=0,L=this.locationMotion.keyframes;T<L.length;T++){var D=L[T],V=D.key,z=D.progress;V!==void 0&&(I.push(V),z>this.locationMotion.progress&&F.push(V))}for(var U=0,q=Object.keys(this.panoResources);U<q.length;U++){var G=q[U];if(!(F.indexOf(G)>=0)){var K=this.panoResources[G];if(K.panoPicture){var _=K.panoPicture.map,J=K.panoPicture.luminanceMap;if(_){if(_===((a=v.pano0)===null||a===void 0?void 0:a.map)||_===((o=v.pano1)===null||o===void 0?void 0:o.map))continue;_ instanceof qe&&_.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(_.cubeRenderTarget),_.dispose(),J&&(J instanceof qe&&J.cubeRenderTarget&&this.luminanceCubeRenderTargetPool.push(J.cubeRenderTarget),J.dispose()),K.panoPicture=null}}I.indexOf(G)>=0||delete this.panoResources[G]}}this.currentPano=Lt(E.panoId),this.emit("pano.moving",X("pano.moving",{userAction:this.userAction,prevPano:Lt(m.panoId),state:O(O(O(O({},Lt(y.panoId)),{mode:this.mode}),tt(this.camera.pose)),g),options:{},progress:this.locationMotion.progress,error:null}))}or(v)===!1&&(!((s=v.pano0)===null||s===void 0)&&s.map&&v.pano0.map instanceof qe&&!v.pano0.map.cubeRenderTarget&&(v.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((u=v.pano0)===null||u===void 0)&&u.luminanceMap&&v.pano0.luminanceMap instanceof qe&&!v.pano0.luminanceMap.cubeRenderTarget&&(v.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),!((l=v.pano1)===null||l===void 0)&&l.map&&v.pano1.map instanceof qe&&!v.pano1.map.cubeRenderTarget&&(v.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((c=v.pano1)===null||c===void 0)&&c.luminanceMap&&v.pano1.luminanceMap instanceof qe&&!v.pano1.luminanceMap.cubeRenderTarget&&(v.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.models.setMaterial(v)),or(g)===!1&&this.setCamera(g);var W=this.works.getResolvedObserver(this.currentPano),$=this.locationMotion.ended?this.getForwardObserverOrNot():null;if(this.camera.pose.distance>.1||b)for(var Y=0,Z=Object.keys(this.panoMeshes);Y<Z.length;Y++){var oe=Z[Y],ne=this.panoMeshes[oe];ne.setOpacity(0),ne.setCurrent(!1),ne.updateTime&&ne.updateTime(e,r),ne.visible=!1}else if(W){var de=Br(W.visibleIds,function(we){var be=i.works.getResolvedObserver(we);return be?W.standingPosition.distanceTo(be.standingPosition):1/0},!0),se=de[1];se=ce(se,2.5,1/0);for(var ye=W.visibleIds.concat(He(this.currentPano)),ie=this.camera.getDirection(new f.Vector3),xe=0,Le=Object.keys(this.panoMeshes);xe<Le.length;xe++){var oe=Le[xe],ne=this.panoMeshes[oe],Ce=this.works.getResolvedObserver(oe);if(ye.indexOf(oe)===-1)ne.setCurrent(!1),ne.setOpacity(0);else if(!Ce)ne.setCurrent(!1),ne.setOpacity(0);else if(!Ce.loadable&&!Ce.active)ne.setCurrent(!1),ne.setOpacity(0);else{var Oe=ne.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);ne.setCurrent(!ne.loading&&ne.progress===0&&$!==null&&$.panoId===oe),ne.setOpacity(Oe<.01?0:ce(se/Oe*1.2,.4,.85));var ee=this.camera.position.clone().setY(ne.position.y),re=new f.Vector3().copy(ne.position).sub(ee).normalize();if(oe===He(this.currentPano)){var H=ce((.5-ee.distanceTo(ne.position))/.5,0,1);re.multiplyScalar(1-H).add(ie.clone().multiplyScalar(H))}re.length()>0&&ne.quaternion.setFromEuler(new f.Euler(0,Math.atan2(re.x,re.z),0))}ne.updateTime&&ne.updateTime(e,r)}}var Be=this.tileLevel=function(){if(i.tileLevelForFov===!1)return 0;var we=i.renderer.getDrawingBufferSize(new f.Vector2);we.width*=i.scissor.width,we.height*=i.scissor.height;var be=y.panoId,Ae=i.works.getResolvedObserver(be),me=i.imageOptions.size;if(typeof me=="undefined"&&Ae){var ze=Ae.images.up.match(/\/cube_(\d+)\//);ze&&(me=Number(ze[1]))}typeof me=="undefined"&&(me=2048);var pe=0;me>=1024&&(pe=1),me>=2048&&(pe=2),me>=4096&&(pe=3),me>=8192&&(pe=4);var Se=i.tileLevelForFov(i.camera.fov,we);return Se>pe?Se:0}(),Te=function(){var we=i.camera.quaternion.clone(),be=i.works.getResolvedObserver(y.panoId),Ae=be!=null?be:W;Ae&&we.premultiply(Ae.quaternion.clone().inverse());var me=new f.Matrix4().makeRotationFromQuaternion(we),ze=new f.Matrix4().getInverse(me),pe=new f.Frustum().setFromProjectionMatrix(new f.Matrix4().multiplyMatrices(i.camera.projectionMatrix,ze));return pe}();y.panoId===He(this.currentPano)&&(((d=y.panoPicture)===null||d===void 0?void 0:d.map)instanceof qe&&(y.panoPicture.map.maxRequest=this.tileMaxRequest,y.panoPicture.map.update(Te,Math.min(Be,this.tiledCubeTextureLevel)),y.panoPicture.map.needsRender===!0&&(y.panoPicture.map.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)),((p=y.panoPicture)===null||p===void 0?void 0:p.luminanceMap)instanceof qe&&(y.panoPicture.luminanceMap.maxRequest=this.tileMaxRequest,y.panoPicture.luminanceMap.update(Te,Math.min(Be,this.tiledCubeTextureLevel)),y.panoPicture.luminanceMap.needsRender===!0&&(y.panoPicture.luminanceMap.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)));{var Ee=this.tiling.object.visible;if(this.initAnimationed){var Qe=y.panoId,Ie=this.works.getResolvedObserver(Qe);Ie?Fi(this.camera.position,Ie.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==Qe&&this.tiling.cleanup(),this.tiling.panoId=Qe,this.tiling.setResource((h=(A=Ie.images)===null||A===void 0?void 0:A.tiles)!==null&&h!==void 0?h:[],this.enableIOSEDR&&Ie.images.luminance?Ie.images.luminance:null),this.tiling.setFetcher(pt(Ie.work)),this.tiling.setRotation(Ie.quaternion),this.tiling.setPosition(Ie.position),this.tiling.maxRequest=this.tileMaxRequest,Be>this.tiledCubeTextureLevel?this.tiling.update(Te,Be,e):this.tiling.update(Te,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;Ee!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0,this.modelSceneNeedsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e),this.intersectMesh.scale.setScalar(ce(this.cameraMotion.value.fov/45,0,1))}},t.prototype.render=function(e,r){var i=this.renderer.getRenderTarget(),a=this.works.getResolvedObserver(this.currentPano);a&&a.video&&(this.needsRender=!0,this.modelSceneNeedsRender=!0),this.updateScreenBuffer(r),e&&(r==="luminance"?(this.luminanceAdaptiveEffect.enable=this.luminanceAdaptiveEffectEnable,this.luminanceAdaptiveEffect.render(this.screenBuffers)):(this.renderer.setRenderTarget(this.modelRenderTarget),this.renderer.render(this.modelScene,this.camera))),this.depthCopyPass.render(this.modelRenderTarget.depthTexture,i),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.copyPass.render(this.modelRenderTarget,i),this.renderer.setRenderTarget(i),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t.prototype.postProcessing=function(e,r){if(!this.destroyed&&r==="luminance")return this.luminanceAdaptiveEffect||(this.luminanceAdaptiveEffect=new k0(this.renderer,this.scene,this.camera,this.models),this.luminanceAdaptiveEffect.enable=this.luminanceAdaptiveEffectEnable),this.luminanceAdaptiveEffect.render(e)},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(ve())[1],r=this.locationMotion.getKeyFrameSegment(ve())[1],i=this.panoResourceFromLocationMotionKeyframe(r),a=this.works.getResolvedObserver(i.panoId);return{workCode:a?a.work.workCode:this.currentPano.workCode,panoIndex:a?a.panoIndex:this.currentPano.panoIndex,mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:a?a.position.clone():this.camera.position.clone(),distance:this.locationMotion.value.distance}},t.prototype.moveToPano=function(e,r,i){var a=this,o,s,u,l,c=(o=r.effect)!==null&&o!==void 0?o:"fly";this.userAction=i,this.stopMomentumMovement();var d=this.works.getResolvedObserver(e);if(!d)throw new Error("Invalid PanoId ".concat(JSON.stringify(e)));var p=mi(d.images.up),A=this.imageOptions.size;typeof A=="undefined"&&d&&p&&(A=Number(p)),typeof A=="undefined"&&(A=2048);var h=this.imageOptions.transform,v=O({key:"pano.".concat(d.panoId)},_t(this.imageOptions,["format","size","quality","sharpen","mappings"])),g=d.images,m=(u=(s=d.images.tiles)===null||s===void 0?void 0:s.filter(function(L){return L.size>A}))!==null&&u!==void 0?u:null,y=h,b={key:"pano_luminance.".concat(d.panoId),size:v.size?v.size/2:void 0},x=this.enableIOSEDR&&d.images.luminance?d.images.luminance:null,w=function(){if(!d.images.tiles||!x)return null;var L=mi(x.up);return L?m==null?void 0:m.map(function(D){var V=D.size*D.scale/2;return L<V?{level:D.level,size:V,scale:1,back:tr(x.back,V),front:tr(x.front,V),left:tr(x.left,V),right:tr(x.right,V),up:tr(x.up,V),down:tr(x.down,V)}:{level:D.level,size:L,scale:V/L,back:x.back,front:x.front,left:x.left,right:x.right,up:x.up,down:x.down}}):null}(),M="pano:"+ma([g,v,h,this.tiledCubeTextureLevel]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===M)return;var S=this.pendingTextureTask.panoId;(l=this.panoMeshes[S])===null||l===void 0||l.setProgress(0),this.emit("pano.texture.abort",X("pano.texture.abort",{error:null,progress:0,meta:null,pano:d.pano}))}var E="move-to-pano-"+d.panoId;this.pending.add(E);var P=this.models.getMaterial()||{},B=P.pano0,C=P.pano1,I;if(B&&B.map.name===M&&B.luminanceMap!==null===this.enableIOSEDR?I=B:(C==null?void 0:C.map.name)===M&&C.luminanceMap!==null===this.enableIOSEDR&&(I=C),I){var F={panoId:d.panoId,effect:c,panoPicture:{zoom:1,map:I.map,luminanceMap:I.luminanceMap,matrix:new f.Matrix4().compose(d.position,d.quaternion,D0)},position:d.position.clone(),fixCameraTransform:new f.Matrix4};Mt.shared.add(function(){a.pending.delete(E),a.doMoveToPano(d.pano,F,r)},!0,1);return}this.pendingTextureTask={panoId:d.panoId,hash:M,onLoad:function(L,D){var V;if(a.pending.delete(E),a.destroyed)L.body.dispose();else{L.body.name=M;var z={panoId:d.panoId,effect:c,panoPicture:{zoom:1,map:L.body,luminanceMap:(V=D==null?void 0:D.body)!==null&&V!==void 0?V:null,matrix:new f.Matrix4().compose(d.position,d.quaternion,D0)},position:d.position.clone(),fixCameraTransform:new f.Matrix4};a.doMoveToPano(d.pano,z,r)}},onError:function(L){a.pending.delete(E);var D=O(O(O({},d.pano),{mode:a.mode}),tt(a.camera.pose));a.emit("pano.error",X("pano.error",{error:L,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:D})),a.emit("pano.cancel",X("pano.cancel",{error:L,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:D})),a.emit("error",L),r.moveCancelCallback&&r.moveCancelCallback()}};var T=this.panoMeshes[d.panoId];T&&T.tap&&T.tap(),Promise.all([this.tileLevelForFov&&m&&m.length?this.textureLoader.loadTiledCubeTexture(g,m,{tileMaxLevel:this.tiledCubeTextureLevel,imageURL:{transform:h,options:v},minFilter:f.LinearFilter,magFilter:f.LinearFilter,generateMipmaps:!1,format:f.RGBAFormat,viaAjax:!0,fetcher:pt(d.work)},void 0,void 0,function(L){var D,V;a.emit("pano.texture.progress",X("pano.texture.progress",{error:null,progress:L,meta:null,pano:d.pano})),((D=a.pendingTextureTask)===null||D===void 0?void 0:D.hash)===M&&((V=a.panoMeshes[d.panoId])===null||V===void 0||V.setProgress(L))},this.renderer):this.textureLoader.loadCubeTexture(g,{imageURL:{transform:h,options:v},format:f.RGBAFormat,viaAjax:!0,fetcher:pt(d.work)},void 0,void 0,function(L){var D,V;a.emit("pano.texture.progress",X("pano.texture.progress",{error:null,progress:L,meta:null,pano:d.pano})),((D=a.pendingTextureTask)===null||D===void 0?void 0:D.hash)===M&&((V=a.panoMeshes[d.panoId])===null||V===void 0||V.setProgress(L))},this.renderer),x?this.tileLevelForFov&&w&&w.length?this.textureLoader.loadTiledCubeTexture(x,w,{tileMaxLevel:this.tiledCubeTextureLevel,imageURL:{transform:y,options:b},minFilter:f.LinearFilter,magFilter:f.LinearFilter,generateMipmaps:!1,fetcher:pt(d.work)},void 0,void 0,void 0,this.renderer).catch(function(){return null}):this.textureLoader.loadCubeTexture(x,{imageURL:{transform:y,options:b},fetcher:pt(d.work)},void 0,void 0,void 0,this.renderer).catch(function(){return null}):Promise.resolve(null)]).then(function(L){var D,V,z=L[0],U=L[1];((D=a.pendingTextureTask)===null||D===void 0?void 0:D.hash)===M?(a.pendingTextureTask.onLoad(z,U),(V=a.panoMeshes[d.panoId])===null||V===void 0||V.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",X("pano.texture.success",{error:null,progress:1,meta:z.meta,pano:d.pano}))):(z.body.dispose(),U==null||U.body.dispose())}).catch(function(L){var D,V;((D=a.pendingTextureTask)===null||D===void 0?void 0:D.hash)===M&&(a.pendingTextureTask.onError(L),(V=a.panoMeshes[d.panoId])===null||V===void 0||V.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",X("pano.texture.error",{error:L,progress:0,meta:null,pano:d.pano})),a.emit("error",L))}),this.emit("pano.texture.load",X("pano.texture.load",{error:null,progress:0,meta:null,pano:d.pano}))},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial,a=i.duration,o=i.effect,s=i.userAction;e.userAction=s;var u=t.initAnimationEndState(e),l={workCode:u.workCode,panoIndex:u.panoIndex},c={modelAlpha:0},d={perspToOrtho:0},p=!1;e.moveToPano(l,{longitude:u.longitude,latitude:u.latitude,fov:u.fov,effect:o,duration:a,moveStartCallback:function(A){p=!0,e.perspToOrthoMotion.set(d,a).catch(Q),e.modelAlphaMotion.setKeyframes([{progress:0,value:O({},e.modelAlphaMotion.value)},{progress:.6,value:O({},e.modelAlphaMotion.value)},{progress:1,value:c}],a).catch(Q),e.emit("initAnimation.start",X("initAnimation.start",{state:A,userAction:e.userAction}))},moveEndCallback:function(A){e.emit("initAnimation.end",X("initAnimation.end",{state:A,userAction:e.userAction})),e.initAnimationed=!0,r()},moveCancelCallback:function(){var A=O(O(O({},l),{mode:e.mode}),tt(e.camera.pose));p===!1&&e.emit("initAnimation.start",X("initAnimation.start",{state:A,userAction:e.userAction})),e.emit("initAnimation.end",X("initAnimation.end",{state:A,userAction:e.userAction})),e.initAnimationed=!0,r()}},s)})},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.locationMotionKeyframesLength=function(e){for(var r=0,i=1;i<e.length;i++){var a=this.panoResourceFromLocationMotionKeyframe(e[i-1]).position,o=this.panoResourceFromLocationMotionKeyframe(e[i]).position,s=a.distanceTo(o)*(e[i].value.count-e[i-1].value.count);r+=s}return r},t.prototype.updatePanoMeshes=function(){for(var e=this,r={},i=Object.keys(this.panoMeshes),a=0,o=i;a<o.length;a++){var s=o[a],u=this.panoMeshes[s];r[s]=u,delete this.panoMeshes[s]}for(var l=1,c={},d=function(M){var S=Br(M.accessibleIds,function(P){var B=e.works.getResolvedObserver(P);if(!B)return 1/0;var C=B.standingPosition.distanceTo(M.standingPosition);return ce(C,1,1/0)},!0),E=S[1];c[M.panoId]===void 0&&(c[M.panoId]=E)},p=0,A=this.works.resolvedObservers;p<A.length;p++){var h=A[p];d(h)}var v=Object.keys(c).map(function(M){return c[M]});if(v.length){var g=v.reduce(function(M,S){return M+S},0)/v.length;l=ce(g*.6,1,3)}for(var m=0,y=this.works.resolvedObservers;m<y.length;m++){var h=y[m],u=void 0;r[h.panoId]?(u=r[h.panoId],u.loading===!0&&h.loadable===!1&&u.setLoading(!1),delete r[h.panoId]):(u=this.panoCircleMeshCreator(h.pano),u.name="PanoCircleMesh_"+h.panoId,this.helper.add(u)),u.scale.set(l,1,l),u.position.copy(h.standingPosition),this.panoMeshes[h.panoId]=u}for(var b=0,x=Object.keys(r);b<x.length;b++){var w=x[b];this.helper.remove(r[w]),r[w].dispose(),delete r[w]}},t.prototype.doMoveToPano=function(e,r,i){var a=this,o,s,u,l,c,d,p,A,h,v,g;i===void 0&&(i={});var m=ve(),y=kt();this.tiling.cleanup(),this.panoResources[y]=r;var b=1,x,w,M;if(this.locationMotion.ended){var S=this.locationMotion.getKeyFrameSegment(m);S[0];var E=S[1],P=this.locationMotion.value,B=((o=this.panoResourceFromLocationMotionKeyframe(E))!==null&&o!==void 0?o:this.camera).position,C=r.position;x=Math.max(B.distanceTo(C),b),w=[{key:E.key,progress:0,value:O(O({},P),{count:0})},{key:y,progress:1,value:{distance:0,count:1}}],M=0}else{var I=this.locationMotion.getKeyFrameSegment(m),F=I[0],E=I[1],P=this.locationMotion.value,T=this.panoResourceFromLocationMotionKeyframe(F).position,B=this.panoResourceFromLocationMotionKeyframe(E).position,C=r.position,L=E.value.count-P.count,D=Math.max(T.distanceTo(B),b)*L,V=Math.max(B.distanceTo(C),b);x=D+V,w=[{key:F.key,progress:0,value:O({},P)},{key:E.key,progress:D/x,value:E.value},{key:y,progress:1,value:{count:E.value.count+1,distance:0}}];var z=this.locationMotionKeyframesLength(this.locationMotion.keyframes),U=this.locationMotionKeyframesLength(w);z===0||z===0?M=0:M=this.locationMotion.getProgressVelocity(m)*z/U}var q=r.effect==="instant"?0:this.calculateMovingDuration(i.duration,r.effect==="fly"?x:0),G={longitude:i.longitude,latitude:i.latitude,fov:i.fov},K=O(O({},e),{mode:this.mode,longitude:(s=G.longitude)!==null&&s!==void 0?s:this.camera.pose.longitude,latitude:(u=G.latitude)!==null&&u!==void 0?u:this.camera.pose.latitude,fov:(l=G.fov)!==null&&l!==void 0?l:this.camera.pose.fov,offset:r.position.clone(),distance:this.camera.pose.distance}),_=this.currentPano;if(this.emit("pano.moveTo",X("pano.moveTo",{options:i,prevPano:_,progress:0,state:K,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(K),this.videoTexture&&this.videoTexture.image instanceof HTMLVideoElement&&this.videoTexture.image.getAttribute("src")&&(this.videoTexture.image.pause(),this.videoTexture.image.removeAttribute("uuid"),this.videoTexture.image.removeAttribute("src"),this.videoTexture.image.oncanplay=Q,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(G,q).catch(Q);else{var J=nr({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),W=nr({longitude:(c=G.longitude)!==null&&c!==void 0?c:this.cameraMotion.value.longitude,latitude:(d=G.latitude)!==null&&d!==void 0?d:this.cameraMotion.value.latitude}),$=new f.Object3D;$.lookAt(J);var Y=new f.Matrix4().makeRotationFromQuaternion($.quaternion);$.lookAt(W);var Z=new f.Matrix4().makeRotationFromQuaternion($.quaternion),oe=new f.Matrix4().getInverse(Y).premultiply(Z),ne=this.cameraMotion.value.fov,de=(p=G.fov)!==null&&p!==void 0?p:this.cameraMotion.value.fov,se=1;r.effect==="zoomin"?se=1.5:r.effect==="zoomout"&&(se=.4);for(var ye=ce(de*se,1,170),ie=0;ie<w.length-1;ie++){var xe=w[ie].key;if(xe){var Le=this.panoResources[xe];Le&&(Le.fixCameraTransform.copy(oe),Le.panoPicture&&(Le.panoPicture.zoom=Math.tan(ne/2/180*Math.PI)/Math.tan(ye/2/180*Math.PI)))}}this.cameraMotion.setKeyframes([{progress:0,value:{longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:this.cameraMotion.value.fov}},{progress:0,value:{longitude:(A=G.longitude)!==null&&A!==void 0?A:this.cameraMotion.value.longitude,latitude:(h=G.latitude)!==null&&h!==void 0?h:this.cameraMotion.value.latitude,fov:ye}},{progress:1,value:{longitude:(v=G.longitude)!==null&&v!==void 0?v:this.cameraMotion.value.longitude,latitude:(g=G.latitude)!==null&&g!==void 0?g:this.cameraMotion.value.latitude,fov:de}}],q).catch(Q)}var Ce=this.locationMotion.setKeyframes(w,q,M);Ce.then(function(){for(var Oe,ee,re=0,H=a.models;re<H.length;re++){var Be=H[re];Be.show()}var Te=O(O({},e),{mode:a.mode,longitude:a.camera.pose.longitude,latitude:a.camera.pose.latitude,fov:a.camera.pose.fov,offset:a.camera.pose.offset.clone(),distance:a.camera.pose.distance});a.emit("pano.arrived",X("pano.arrived",{options:i,prevPano:_,progress:1,state:Te,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(Te);var Ee=a.works.getResolvedObserver(e);if(Ee&&Ee.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var Qe=zm.clone().multiply((ee=(Oe=a.models.getMaterial().pano1)===null||Oe===void 0?void 0:Oe.matrix)!==null&&ee!==void 0?ee:new f.Matrix4).multiply(Ee.video.matrix),Ie={map:a.videoTexture,size:Ee.video.size,matrix:Qe,alpha:1},we=kt(),be=a.videoTexture.image;be.setAttribute("uuid",we),Ul().then(function(Ae){Ae&&Ee.video&&be.getAttribute("uuid")===we&&(be.oncanplay=function(){be.oncanplay=Q,be.play()},be.ontimeupdate=function(){be.currentTime>.5&&(be.ontimeupdate=Q,a.panoVideo.setMaterial(Ie))},be.src=Ee.video.source)}).catch(function(){be.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",X("pano.cancel",{options:i,prevPano:_,progress:0,state:K,userAction:a.userAction,error:null})),i.moveCancelCallback&&i.moveCancelCallback()})},t.prototype.getForwardObserverOrNot=function(e){var r=this,i=this.works.getResolvedObserver(this.currentPano);if(!i)return null;var a=e!=null?e:new f.Raycaster(this.camera.position.clone(),this.camera.getDirection(new f.Vector3));a.params.Points={threshold:.1};var o=i.standingPosition.clone();if(i.position.distanceTo(a.ray.origin)>1){var s=this.models.intersectRaycaster(new f.Raycaster(a.ray.origin,new f.Vector3(0,-1,0)))[0];s&&s.distance<=2?o.copy(s.point):o.copy(a.ray.origin).add(new f.Vector3(0,-1.5,0))}var u=this.models.intersectRaycaster(a)[0],l=u?u.point:a.ray.origin.clone().add(a.ray.direction.clone().normalize().multiplyScalar(3)),c=l.clone().sub(o).normalize();if(c.length()===0)return null;for(var d=i.accessibleIds.filter(function(w){if(w===He(r.currentPano))return!1;var M=r.works.getResolvedObserver(w);if(!M)return!1;var S=M.standingPosition.clone().project(r.camera);return Math.abs(S.z)>1||Math.abs(S.x)>1||Math.abs(S.y)>1?!1:M.loadable||M.active}),p=d.slice().sort(function(w,M){var S=r.works.getResolvedObserver(w).standingPosition.clone().distanceTo(o),E=r.works.getResolvedObserver(M).standingPosition.clone().distanceTo(o);return S-E}),A=0,h=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];A<h.length;A++)for(var v=h[A],g=0,m=p;g<m.length;g++){var y=m[g],b=this.works.getResolvedObserver(y);if(b){var x=b.standingPosition.clone().sub(o);if(x&&x.length()!==0&&c.angleTo(x)<v)return b}}return null},t.prototype.onTapGesture=function(e){var r=this,i;if(this.userAction=e.userAction,this.stopMomentumMovement(),!!this.initAnimationed){if(!this.locationMotion.ended){var a=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]);if(a.panoId!==He(this.currentPano))return}var o=e.center.raycaster,s=this.camera.getDirection(new f.Vector3).setY(0),u=null,l=this.works.getResolvedObserver(this.currentPano);if(l){var c=l.accessibleIds.filter(function(U){if(U===He(r.currentPano))return!1;var q=r.works.getResolvedObserver(U);return!q||q.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:q.loadable||q.active}),d=this.models.intersectRaycaster(o)[0];if(d){var p=Br(c,function(U){var q=r.works.getResolvedObserver(U);if(!q)return 1/0;var G=q.standingPosition.clone();return G.distanceTo(d.point)},!0),A=p[0],h=p[1];A&&h<this.panoTapTriggerRadius&&(u=(i=this.works.getResolvedObserver(A))!==null&&i!==void 0?i:null)}u||(u=this.getForwardObserverOrNot(o));for(var v=0,g=this.locationMotion.keyframes;v<g.length;v++){var m=g[v],y=this.panoResourceFromLocationMotionKeyframe(m);if(!(m.progress<this.locationMotion.progress)&&u&&y.panoId===u.panoId){u=null;break}}if(!u)this.emit("gesture.tap",e),e.defaultPrevented||this.locationMotion.ended===!0&&this.cameraBounce();else{for(var b={},x=Math.PI/6,w=Math.PI/12,M=u.position.clone().setY(0).sub(l.position.clone().setY(0)).normalize(),S=[],E=[],P=[],B=0,C=u.accessibleIds;B<C.length;B++){var A=C[B],I=Lt(A);if(!(Ar(I,this.currentPano)||Ar(I,u.pano))){var F=this.works.getResolvedObserver(A);if(F){var T=F.position.clone().sub(u.position).setY(0);M.angleTo(T)<x&&P.push(T)}}}var L=P.length>0?P:vt(vt([],S,!0),E,!0),D=L.slice().sort(function(U,q){return U.angleTo(M)-q.angleTo(M)})[0];D&&D.angleTo(s)>w&&(b.longitude=Math.atan2(-D.x,-D.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(b.latitude=ce(0,this.minLatitude,this.maxLatitude));var V=O({},e.state);if(V.workCode=u.pano.workCode,V.panoIndex=u.pano.panoIndex,b.longitude!==void 0&&(V.longitude=b.longitude),b.latitude!==void 0&&(V.latitude=b.latitude),b.fov!==void 0&&(V.fov=b.fov),V.distance=0,V.offset=u.position.clone(),e.state=V,this.emit("gesture.tap",e),!e.defaultPrevented){if(this.emit("pano.select",X("pano.select",{prevPano:this.currentPano,state:V,userAction:e.userAction,options:b,progress:0,error:null})),u&&!u.active){var z=u.panoId;this.panoMeshes[z]&&(this.panoMeshes[z].setDisabled(!1),this.panoMeshes[z].setLoading(!0))}u&&u.active&&this.emit("pano.request",X("pano.request",{userAction:e.userAction,prevPano:this.currentPano,progress:0,state:V,options:b,error:null}))}}}}},t}(Ql),Qr=Math.PI/180,Un=180/Math.PI,ql=.001,Hl=1,pi=function(){var n=typeof navigator!="undefined"&&/iPad|iPhone|iPod/.test(navigator.platform);return function(){return n}}(),Qm=function(){var n=typeof navigator!="undefined"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return function(){return n}}(),Um=function(){var n=typeof navigator!="undefined"&&navigator.userAgent.indexOf("Firefox")!==-1&&navigator.userAgent.indexOf("Android")!==-1;return function(){return n}}(),Gl=function(){var n=typeof navigator!="undefined"?navigator.userAgent.match(/.*Chrome\/([0-9]+)/):null,t=n?parseInt(n[1],10):null;return function(){return t}}(),qm=function(){var n=!1;if(Gl()===65){var t=typeof navigator!="undefined"?navigator.userAgent.match(/.*Chrome\/([0-9\.]*)/):null;if(t){var e=t[1].split(".");e[0],e[1];var r=e[2],i=e[3];n=parseInt(r,10)===3325&&parseInt(i,10)<148}}return function(){return n}}(),Hm=function(){var n=pi()&&Qm()&&typeof navigator!="undefined"&&navigator.userAgent.indexOf("13_4")!==-1;return function(){return n}}(),Kl=function(){var n=typeof navigator!="undefined"&&navigator.userAgent.indexOf("R7 Build")!==-1;return function(){return n}}();function N0(){var n=typeof window!="undefined"&&(window.orientation==90||window.orientation==-90);return Kl()?!n:n}function Gm(n){return!(isNaN(n)||n<=ql||n>Hl)}function Km(n){if(n.w>1)return 0;var t=2*Math.acos(n.w);return t}var z0=function(){var n={};return function(t,e){n[t]===void 0&&(console.warn("cardboard: "+e),n[t]=!0)}}();function Q0(n){var t,e=n.indexOf("://");e!==-1?t=e+3:t=0;var r=n.indexOf("/",t);return r===-1&&(r=n.length),n.substring(0,r)}function jm(){if(typeof window=="undefined"||typeof document=="undefined")return!1;var n=window.self!==window.top,t=Q0(document.referrer),e=Q0(window.location.href);return n&&t!==e}var U0=function(){function n(r,i,a){var o=i?i[0]:0,s=i?i[1]:0,u=i?i[2]:0,l=i?i[3]:1,c=o+o,d=s+s,p=u+u,A=o*c,h=o*d,v=o*p,g=s*d,m=s*p,y=u*p,b=l*c,x=l*d,w=l*p;return r[0]=1-(g+y),r[1]=h+w,r[2]=v-x,r[3]=0,r[4]=h-w,r[5]=1-(A+y),r[6]=m+b,r[7]=0,r[8]=v+x,r[9]=m-b,r[10]=1-(A+g),r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function t(r,i,a){var o=a[0],s=a[1],u=a[2],l,c,d,p,A,h,v,g,m,y,b,x;return i===r?(r[12]=i[0]*o+i[4]*s+i[8]*u+i[12],r[13]=i[1]*o+i[5]*s+i[9]*u+i[13],r[14]=i[2]*o+i[6]*s+i[10]*u+i[14],r[15]=i[3]*o+i[7]*s+i[11]*u+i[15]):(l=i[0],c=i[1],d=i[2],p=i[3],A=i[4],h=i[5],v=i[6],g=i[7],m=i[8],y=i[9],b=i[10],x=i[11],r[0]=l,r[1]=c,r[2]=d,r[3]=p,r[4]=A,r[5]=h,r[6]=v,r[7]=g,r[8]=m,r[9]=y,r[10]=b,r[11]=x,r[12]=l*o+A*s+m*u+i[12],r[13]=c*o+h*s+y*u+i[13],r[14]=d*o+v*s+b*u+i[14],r[15]=p*o+g*s+x*u+i[15]),r}function e(r,i){var a=i[0],o=i[1],s=i[2],u=i[3],l=i[4],c=i[5],d=i[6],p=i[7],A=i[8],h=i[9],v=i[10],g=i[11],m=i[12],y=i[13],b=i[14],x=i[15],w=a*c-o*l,M=a*d-s*l,S=a*p-u*l,E=o*d-s*c,P=o*p-u*c,B=s*p-u*d,C=A*y-h*m,I=A*b-v*m,F=A*x-g*m,T=h*b-v*y,L=h*x-g*y,D=v*x-g*b,V=w*D-M*L+S*T+E*F-P*I+B*C;return V?(V=1/V,r[0]=(c*D-d*L+p*T)*V,r[1]=(s*L-o*D-u*T)*V,r[2]=(y*B-b*P+x*E)*V,r[3]=(v*P-h*B-g*E)*V,r[4]=(d*F-l*D-p*I)*V,r[5]=(a*D-s*F+u*I)*V,r[6]=(b*S-m*B-x*M)*V,r[7]=(A*B-v*S+g*M)*V,r[8]=(l*L-c*F+p*C)*V,r[9]=(o*F-a*L-u*C)*V,r[10]=(m*P-y*S+x*w)*V,r[11]=(h*S-A*P-g*w)*V,r[12]=(c*I-l*T-d*C)*V,r[13]=(a*T-o*I+s*C)*V,r[14]=(y*M-m*E-b*w)*V,r[15]=(A*E-h*M+v*w)*V,r):null}return function(r,i,a){n(r,i),a&&t(r,r,a),e(r,r)}}(),uo=function(){function n(t,e){t===void 0&&(t=new f.Vector3),e===void 0&&(e=0),this.sample=t,this.timestampS=e}return n.prototype.set=function(t,e){this.sample=t,this.timestampS=e},n.prototype.copy=function(t){this.set(t.sample,t.timestampS)},n}(),_m=function(){function n(t,e){this.kFilter=t,this.isDebug=e,this.currentAccelMeasurement=new uo,this.currentGyroMeasurement=new uo,this.previousGyroMeasurement=new uo,pi()?this.filterQ=new f.Quaternion(-1,0,0,1):this.filterQ=new f.Quaternion(1,0,0,1),this.previousFilterQ=new f.Quaternion,this.previousFilterQ.copy(this.filterQ),this.accelQ=new f.Quaternion,this.isOrientationInitialized=!1,this.estimatedGravity=new f.Vector3,this.measuredGravity=new f.Vector3,this.gyroIntegralQ=new f.Quaternion}return n.prototype.addAccelMeasurement=function(t,e){this.currentAccelMeasurement.set(t,e)},n.prototype.addGyroMeasurement=function(t,e){this.currentGyroMeasurement.set(t,e);var r=e-this.previousGyroMeasurement.timestampS;Gm(r)&&this.run_(),this.previousGyroMeasurement.copy(this.currentGyroMeasurement)},n.prototype.getOrientation=function(){return this.filterQ},n.prototype.run_=function(){if(!this.isOrientationInitialized){this.accelQ=this.accelToQuaternion_(this.currentAccelMeasurement.sample),this.previousFilterQ.copy(this.accelQ),this.isOrientationInitialized=!0;return}var t=this.currentGyroMeasurement.timestampS-this.previousGyroMeasurement.timestampS,e=this.gyroToQuaternionDelta_(this.currentGyroMeasurement.sample,t);this.gyroIntegralQ.multiply(e),this.filterQ.copy(this.previousFilterQ),this.filterQ.multiply(e);var r=new f.Quaternion;r.copy(this.filterQ),r.inverse(),this.estimatedGravity.set(0,0,-1),this.estimatedGravity.applyQuaternion(r),this.estimatedGravity.normalize(),this.measuredGravity.copy(this.currentAccelMeasurement.sample),this.measuredGravity.normalize();var i=new f.Quaternion;i.setFromUnitVectors(this.estimatedGravity,this.measuredGravity),i.inverse(),this.isDebug&&console.log("Delta: %d deg, G_est: (%s, %s, %s), G_meas: (%s, %s, %s)",Un*Km(i),this.estimatedGravity.x.toFixed(1),this.estimatedGravity.y.toFixed(1),this.estimatedGravity.z.toFixed(1),this.measuredGravity.x.toFixed(1),this.measuredGravity.y.toFixed(1),this.measuredGravity.z.toFixed(1));var a=new f.Quaternion;a.copy(this.filterQ),a.multiply(i),this.filterQ.slerp(a,1-this.kFilter),this.previousFilterQ.copy(this.filterQ)},n.prototype.accelToQuaternion_=function(t){var e=new f.Vector3;e.copy(t),e.normalize();var r=new f.Quaternion;return r.setFromUnitVectors(new f.Vector3(0,0,-1),e),r.inverse(),r},n.prototype.gyroToQuaternionDelta_=function(t,e){var r=new f.Quaternion,i=new f.Vector3;return i.copy(t),i.normalize(),r.setFromAxisAngle(i,t.length()*e),r},n}(),Jm=function(){function n(t,e){this.predictionTimeS=t,this.isDebug=e,this.previousQ=new f.Quaternion,this.previousTimestampS=null,this.deltaQ=new f.Quaternion,this.outQ=new f.Quaternion}return n.prototype.getPrediction=function(t,e,r){if(!this.previousTimestampS)return this.previousQ.copy(t),this.previousTimestampS=r,t;var i=new f.Vector3;i.copy(e),i.normalize();var a=e.length();if(a<Qr*20)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(Un*a).toFixed(1)),this.outQ.copy(t),this.previousQ.copy(t),this.outQ;var o=a*this.predictionTimeS;return this.deltaQ.setFromAxisAngle(i,o),this.outQ.copy(this.previousQ),this.outQ.multiply(this.deltaQ),this.previousQ.copy(t),this.previousTimestampS=r,this.outQ},n}(),Xm=function(){function n(t){this.coefficients=t}return n.prototype.distortInverse=function(t){for(var e=0,r=1,i=t-this.distort(e);Math.abs(r-e)>1e-4;){var a=t-this.distort(r),o=r-a*((r-e)/(a-i));e=r,r=o,i=a}return r},n.prototype.distort=function(t){for(var e=t*t,r=0,i=0;i<this.coefficients.length;i++)r=e*(r+this.coefficients[i]);return(r+1)*t},n}(),Wm=function(){function n(){this.angularAcceleration=null,this.angularVelocity=null,this.linearAcceleration=null,this.linearVelocity=null,this.orientation=null,this.position=null}return n}(),q0=function(){function n(){this.leftDegrees=0,this.rightDegrees=0,this.upDegrees=0,this.downDegrees=0}return n}(),Zm=function(){function n(t,e,r,i){this.viewer={id:"CardboardV1",label:"Cardboard I/O 2014",fov:40,interLensDistance:.06,baselineLensDistance:.035,screenLensDistance:.042,distortionCoefficients:[.441,.156],inverseCoefficients:[-.4410035,.42756155,-.4804439,.5460139,-.58821183,.5733938,-.48303202,.33299083,-.17573841,.0651772,-.01488963,.001559834]},this.device={widthMeters:.11,heightMeters:.062,bevelMeters:.004},this.depthNear=.01,this.depthFar=1e4,this.yawOnly=r,this.accelerometer=new f.Vector3,this.gyroscope=new f.Vector3,this.filter=new _m(t,i),this.posePredictor=new Jm(e,i),this.isFirefoxAndroid=Um(),this.isIOS=pi();var a=Gl();this.isDeviceMotionInRadians=!this.isIOS&&a!==null&&a<66,this.isWithoutDeviceMotion=qm()||Hm(),this.filterToWorldQ=new f.Quaternion,pi()?this.filterToWorldQ.setFromAxisAngle(new f.Vector3(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new f.Vector3(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new f.Quaternion,this.worldToScreenQ=new f.Quaternion,this.originalPoseAdjustQ=new f.Quaternion;var o=typeof window!="undefined"?-window.orientation*Math.PI/180:0;this.originalPoseAdjustQ.setFromAxisAngle(new f.Vector3(0,0,1),o),this.setScreenTransform_(),N0()&&this.filterToWorldQ.multiply(this.inverseWorldToScreenQ),this.resetQ=new f.Quaternion,this.orientationOut_=new Float32Array(4),this.previousTimestampS=Date.now()}return n.prototype.getPosition=function(){return null},n.prototype.getOrientation=function(){var t;if(this.isWithoutDeviceMotion&&this._deviceOrientationQ){this.deviceOrientationFixQ=this.deviceOrientationFixQ||function(){var a=new f.Quaternion().setFromAxisAngle(new f.Vector3(0,0,-1),0),o=new f.Quaternion;return typeof window!="undefined"&&window.orientation===-90?o.setFromAxisAngle(new f.Vector3(0,1,0),Math.PI/-2):o.setFromAxisAngle(new f.Vector3(0,1,0),Math.PI/2),a.multiply(o)}(),this.deviceOrientationFilterToWorldQ=this.deviceOrientationFilterToWorldQ||function(){var a=new f.Quaternion;return a.setFromAxisAngle(new f.Vector3(1,0,0),-Math.PI/2),a}(),t=this._deviceOrientationQ;var e=new f.Quaternion;return e.copy(t),e.multiply(this.deviceOrientationFilterToWorldQ),e.multiply(this.resetQ),e.multiply(this.worldToScreenQ),e.multiplyQuaternions(this.deviceOrientationFixQ,e),this.yawOnly&&(e.x=0,e.z=0,e.normalize()),this.orientationOut_[0]=e.x,this.orientationOut_[1]=e.y,this.orientationOut_[2]=e.z,this.orientationOut_[3]=e.w,this.orientationOut_}else{var r=this.filter.getOrientation();t=this.posePredictor.getPrediction(r,this.gyroscope,this.previousTimestampS)}var i=new f.Quaternion;return i.copy(this.filterToWorldQ),i.multiply(this.resetQ),i.multiply(t),i.multiply(this.worldToScreenQ),this.yawOnly&&(i.x=0,i.z=0,i.normalize()),this.orientationOut_[0]=i.x,this.orientationOut_[1]=i.y,this.orientationOut_[2]=i.z,this.orientationOut_[3]=i.w,this.orientationOut_},n.prototype.getPose=function(){var t=new Wm;return t.orientation=this.getOrientation(),t},n.prototype.resetPose=function(){this.resetQ.copy(this.filter.getOrientation()),this.resetQ.x=0,this.resetQ.y=0,this.resetQ.z*=-1,this.resetQ.normalize(),N0()&&this.resetQ.multiply(this.inverseWorldToScreenQ),this.resetQ.multiply(this.originalPoseAdjustQ)},n.prototype.getFrameData=function(t){var e=this.getOrientation(),r=this.getEyeOffset(),i=this.getEyeProjectionMatrix();return t.pose.angularAcceleration=null,t.pose.angularVelocity=null,t.pose.linearAcceleration=null,t.pose.linearVelocity=null,t.pose.orientation=e,t.pose.position=null,t.timestamp=this.previousTimestampS,t.leftProjectionMatrix.set(i.left),t.rightProjectionMatrix.set(i.right),U0(t.leftViewMatrix,e,r.left),U0(t.rightViewMatrix,e,r.right),t},n.prototype.start=function(){if(typeof window=="undefined")return function(){};var t=this.onDeviceMotion_.bind(this),e=this.onOrientationChange_.bind(this),r=this.onMessage_.bind(this),i=this.onDeviceOrientation_.bind(this);return pi()&&jm()&&window.addEventListener("message",r),window.addEventListener("orientationchange",e),this.isWithoutDeviceMotion?window.addEventListener("deviceorientation",i):window.addEventListener("devicemotion",t),function(){window.removeEventListener("devicemotion",t),window.removeEventListener("deviceorientation",e),window.removeEventListener("orientationchange",e),window.removeEventListener("message",r)}},n.prototype.getEyeOffset=function(){return{left:[-this.viewer.interLensDistance*.5,0,0],right:[this.viewer.interLensDistance*.5,0,0]}},n.prototype.getEyeProjectionMatrix=function(){var t=this.getEyeFieldOfView(),e=this.depthNear,r=this.depthFar,i={left:[],right:[]};{var a=t.left.upDegrees*Qr,o=t.left.downDegrees*Qr,s=t.left.leftDegrees*Qr,u=t.left.rightDegrees*Qr,l=2/(s+u),c=2/(a+o);i.left[0]=l,i.left[1]=0,i.left[2]=0,i.left[3]=0,i.left[4]=0,i.left[5]=c,i.left[6]=0,i.left[7]=0,i.left[8]=-((s-u)*l*.5),i.left[9]=(a-o)*c*.5,i.left[10]=r/(e-r),i.left[11]=-1,i.left[12]=0,i.left[13]=0,i.left[14]=r*e/(e-r),i.left[15]=0}{var a=t.right.upDegrees*Qr,o=t.right.downDegrees*Qr,s=t.right.leftDegrees*Qr,u=t.right.rightDegrees*Qr,l=2/(s+u),c=2/(a+o);i.right[0]=l,i.right[1]=0,i.right[2]=0,i.right[3]=0,i.right[4]=0,i.right[5]=c,i.right[6]=0,i.right[7]=0,i.right[8]=-((s-u)*l*.5),i.right[9]=(a-o)*c*.5,i.right[10]=r/(e-r),i.right[11]=-1,i.right[12]=0,i.right[13]=0,i.right[14]=r*e/(e-r),i.right[15]=0}return i},n.prototype.getEyeFieldOfView=function(){var t=this.viewer,e=this.device,r=new Xm(t.distortionCoefficients),i=t.screenLensDistance,a=(e.widthMeters-t.interLensDistance)/2,o=t.interLensDistance/2,s=t.baselineLensDistance-e.bevelMeters,u=e.heightMeters-s,l=Un*Math.atan(r.distort(a/i)),c=Un*Math.atan(r.distort(o/i)),d=Un*Math.atan(r.distort(s/i)),p=Un*Math.atan(r.distort(u/i)),A=new q0,h=new q0;return A.leftDegrees=Math.min(l,t.fov),A.rightDegrees=Math.min(c,t.fov),A.downDegrees=Math.min(d,t.fov),A.upDegrees=Math.min(p,t.fov),h.leftDegrees=A.rightDegrees,h.rightDegrees=A.leftDegrees,h.upDegrees=A.upDegrees,h.downDegrees=A.downDegrees,{left:A,right:h}},n.prototype.onDeviceOrientation_=function(t){this._deviceOrientationQ=this._deviceOrientationQ||new f.Quaternion;var e=t.alpha,r=t.beta,i=t.gamma;e=(e||0)*Math.PI/180,r=(r||0)*Math.PI/180,i=(i||0)*Math.PI/180,this._deviceOrientationQ.setFromEuler(new f.Euler(e,r,-i,"YXZ"))},n.prototype.onDeviceMotion_=function(t){this.updateDeviceMotion_(t)},n.prototype.updateDeviceMotion_=function(t){var e=t.accelerationIncludingGravity,r=t.rotationRate,i=t.timeStamp/1e3,a=i-this.previousTimestampS;if(a<0){z0("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),this.previousTimestampS=i;return}else if(a<=ql||a>Hl){z0("fusion-pose-sensor:invalid:outside-threshold","Invalid timestamps detected: Timestamp from devicemotion outside expected range."),this.previousTimestampS=i;return}e&&(this.accelerometer.set(-e.x,-e.y,-e.z),r&&(Kl()?this.gyroscope.set(-r.beta,r.alpha,r.gamma):this.gyroscope.set(r.alpha,r.beta,r.gamma),this.isDeviceMotionInRadians||this.gyroscope.multiplyScalar(Math.PI/180),this.filter.addGyroMeasurement(this.gyroscope,i)),this.filter.addAccelMeasurement(this.accelerometer,i)),this.previousTimestampS=i},n.prototype.onOrientationChange_=function(){this.setScreenTransform_()},n.prototype.onMessage_=function(t){var e=t.data;if(!(!e||!e.type)){var r=e.type.toLowerCase();r==="devicemotion"&&this.updateDeviceMotion_(e.deviceMotionEvent)}},n.prototype.setScreenTransform_=function(){this.worldToScreenQ.set(0,0,0,1);var t=typeof window!="undefined"?window.orientation:0;switch(t){case 0:break;case 90:this.worldToScreenQ.setFromAxisAngle(new f.Vector3(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new f.Vector3(0,0,1),Math.PI/2);break}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},n}(),Gi=[0,0,.5,1],Ki=[.5,0,.5,1],Ym=function(){function n(t){var e=this;this.renderer=t,this.sensor=new Zm(.98,.04,!1,!1),this.scale=1,this.cameraL=new f.PerspectiveCamera,this.cameraR=new f.PerspectiveCamera;var r=this.sensor.start();this.dispose=function(){var i=e.renderer.getSize(new f.Vector2);e.renderer.setScissor(0,0,i.width,i.height),e.renderer.setViewport(0,0,i.width,i.height),e.renderer.setScissorTest(!1),r()}}return n.prototype.render=function(t,e){var r=this.renderer.getSize(new f.Vector2);if(r.width>r.height){var i=t.autoUpdate;i&&(t.updateMatrixWorld(),t.autoUpdate=!1);var a={x:Math.round(r.width*Gi[0]),y:Math.round(r.height*Gi[1]),width:Math.round(r.width*Gi[2]),height:Math.round(r.height*Gi[3])},o={x:Math.round(r.width*Ki[0]),y:Math.round(r.height*Ki[1]),width:Math.round(r.width*Ki[2]),height:Math.round(r.height*Ki[3])};this.renderer.setScissorTest(!0),this.renderer.autoClear&&this.renderer.clear(),e.parent===null&&e.updateMatrixWorld(),e.matrixWorld.decompose(this.cameraL.position,this.cameraL.quaternion,this.cameraL.scale),e.matrixWorld.decompose(this.cameraR.position,this.cameraR.quaternion,this.cameraR.scale);var s=this.sensor.getEyeOffset();this.cameraL.translateOnAxis(new f.Vector3().fromArray(s.left),this.scale),this.cameraR.translateOnAxis(new f.Vector3().fromArray(s.right),this.scale);var u=this.sensor.getEyeProjectionMatrix();this.cameraL.projectionMatrix.elements=u.left.slice(),this.cameraR.projectionMatrix.elements=u.right.slice(),this.renderer.setViewport(a.x,a.y,a.width,a.height),this.renderer.setScissor(a.x,a.y,a.width,a.height),this.renderer.render(t,this.cameraL),this.renderer.setViewport(o.x,o.y,o.width,o.height),this.renderer.setScissor(o.x,o.y,o.width,o.height),this.renderer.render(t,this.cameraR),this.renderer.setViewport(0,0,r.width,r.height),this.renderer.setScissor(0,0,r.width,r.height),this.renderer.setScissorTest(!1),i&&(t.autoUpdate=!0)}else this.renderer.render(t,e)},n.prototype.dispose=function(){},n}();const $m="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADqCAMAAAAvZYhaAAAC/VBMVEUAAAD///99fX37+/v5+fn29vbx8fHv7+/Nzc3o6Ojq6urh4eHU1NTR0dGDg4Pl5eWSkpLHx8fj4+Pe3t7X19fAwMDZ2dnCwsKrq6uioqLb29uNjY2enp67u7t5eXmAgIC2traWlpa5ubnKysqmpqZycnKHh4eurq6ysrKKioqDg4Pd3d12dnb9/f1vb2/s7OxlZWXz8/OoqKiZmZlpaWmbm5teXl7W1tbJycnExMRiYmJsbGywsLCPj49aWlq9vb1UVFRYWFhra2t+fn7t7e1RUVFOTk6Dg4OAgICCgoKKioqEhISIiIhqamqCgoKIiIiQkJCIiIiWlpawsLBmZmaAgICenp6Li4uBgYGTk5OMjIyVlZWFhYWCgoKvr6+Ojo59fX2SkpKvr6+Ojo6QkJCurq6BgYGxsbF8fHx4eHitra2enp6srKyJiYmurq54eHj5+fl+fn57e3v////5+fnS0tLAwMCVlZWwsLCurq5QUFCtra2EhISUlJSwsLCUlJSUlJSlpaWVlZW3t7diYmLAwMCFhYV3d3f///+tra3///9XV1eampqnp6d8fHz///////9VVVVlZWVtbW3+/v5SUlKcnJytra28vLzGxsbR0dHX19doaGiWlpafn5/Hx8ezs7Nzc3Nubm7AwMCIiIjj4+NTU1P29vZbW1vl5eVkZGTMzMxYWFjq6upfX1/k5OT////4+PjV1dWkpKRoaGj4+Pizs7Pm5ubAwMCfn5+vr6+urq4wMDCxsbG2tra5ubliYmIuLi6zs7NHR0empqY0NDRCQkKqqqo5OTmoqKg7OztfX19dXV1oaGikpKRkZGStra0hISE/Pz89PT0pKSlmZmZJSUlERERbW1s2NjZVVVUmJia7u7uEhIRXV1dZWVlLS0tOTk6srKxqamojIyNTU1MrKyuAgICCgoJRUVFra2ttbW13d3dxcXFvb299fX1zc3N2dnZ5eXl8fHyHh4eSkpKenp6Ojo6VlZWMj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DahVtJgkZE0w5QqXJoQVko1y3Wpc0lGPOBaceJBA1ql93NSfHyCD9Uil512j97HfnM7/Ea8Wn96UkNQpV2U6V0tUAaXW7jNwYswYxdL94y7VqSoKFhWiMDXnUBaHBwoQT9Prx4Szm3TyRodLupoMJHH5LyK+9es8+l/CKvDytukQQND8FSlFIOreGM0/omiATVapVo12xd0jhExKW5294RAc40RVoftY47cd2LKtMOFwkajzuAeVOlIhfJeKahLyiWJRhLr3Ai2BVzQYKG4lLYXfg8HCSI33a2nTH5OaVWmzYHJGhsdLmDuN2exAonBTzZIuzEUS+ec0ZMBQn+Ea5KlXNI4C/UAO/k6hKwBptJgn8fgmVckgFXML9YEEFLUKMvlqAp0eWyDEAL65dLqyWo6RekTZ2XNCsD6rgpTK/4p3WcrrPH1ghWJGhONC3JoGAkRHH1JKjpNEcCxOV2I8MWyiUJqNVajSVodgiWcVMVLVeSS1ATCZoc88qjVKlSc3kSLJ5c5V6rTZQAcVkGbBeuOkgCgq2CBM3MoFwGr1tvim2aMpZZqyBBc3N1UF2GX90j9SQJKCBB83OfYAcNVjFcSrvzo95WOShB83Ody5V24fqzO0nAUSzB/89Nph38VqmuOa3gticJOP9fApuHTDt4nFJ7AXdPC0lg8/gq8y5XapSrgpUgbQ0JpF5u97hS1fOC26nlJJA8Yd41Sg3fU4dtRQkKeXSN3jo4Qqm0397OmyZOGatoDrScBIWM3DFn5kXi1ZyqRSUoZtKOa1vWKArztqgEnhIHty4f9/btuEstKwGkxf+XuCT5CbTFnFRuxktuAAAAAElFTkSuQmCC";var lo,co={zh:{TITLE:"眼镜模式",HIT:"请将手机横屏放入 VR 眼镜中"},en:{TITLE:"GLASSES MODE",HIT:"Please put the mobile phone horizontally into the VR glasses."},ja:{TITLE:"メガネモード",HIT:"携帯電話をVRメガネに水平に入れてください。"}},H0=typeof navigator!="undefined"&&(lo=co[navigator.language.split("-")[0]])!==null&&lo!==void 0?lo:co.zh,tA=`
|
|
1596
|
+
`,Nm=function(){function n(){this.material=new f.ShaderMaterial({vertexShader:Dm,fragmentShader:Vm,uniforms:{size:new f.Uniform(null),matrix:new f.Uniform(null),alpha:new f.Uniform(null),map:new f.Uniform(null)},depthTest:!1,depthWrite:!1,defines:{USE_PANO_VIDEO:!1},blending:f.CustomBlending,blendSrc:f.SrcAlphaFactor,blendDst:f.OneMinusSrcAlphaFactor,blendSrcAlpha:f.OneFactor,blendDstAlpha:f.OneMinusSrcAlphaFactor}),this.object=new f.Mesh(hs,this.material),this.object.visible=!1,this.object.renderOrder=-1,this.object.frustumCulled=!1,this.object.name="pano-video",this.alphaMotion=new Re({alpha:0})}return n.prototype.setMaterial=function(t){t?(this.material.uniforms.size.value=t.size,this.material.uniforms.matrix.value=t.matrix,this.material.uniforms.map.value=t.map,this.alphaMotion.set({alpha:t.alpha},500).catch(Q),this.material.uniforms.alpha.value=t.alpha):(this.material.uniforms.size.value=null,this.material.uniforms.matrix.value=null,this.material.uniforms.map.value=null,this.alphaMotion.set({alpha:0},0).catch(Q));var e=t!==null,r=this.material.defines.USE_PANO_VIDEO;e!==r&&(this.material.defines.USE_PANO_VIDEO=e,this.material.needsUpdate=!0,this.object.visible=t!==null)},n.prototype.updateTime=function(t){this.alphaMotion.ended||(this.alphaMotion.update(t),this.material.uniforms.alpha.value=this.alphaMotion.value.alpha)},n.prototype.dispose=function(){this.material.dispose()},n}(),zm=new f.Matrix4().makeRotationAxis(new f.Vector3(0,1,0),Math.PI),D0=new f.Vector3(-1,1,1),V0=function(){function n(t){t===void 0&&(t=0),this.width=t,this.pool=[]}return Object.defineProperty(n.prototype,"size",{get:function(){return this.pool.length},enumerable:!1,configurable:!0}),n.prototype.create=function(){return new f.WebGLCubeRenderTarget(this.width,{stencilBuffer:!1,depthBuffer:!1})},n.prototype.pop=function(){var t=this.pool.pop();return t||this.create()},n.prototype.push=function(t){this.pool.indexOf(t)===-1&&this.pool.push(t)},n.prototype.clear=function(){for(var t=0,e=this.pool;t<e.length;t++){var r=e[t];r.dispose()}this.pool.length=0},n}(),pr=O(O({},dr),{maxAccessibleDistance:5,panoTapTriggerRadius:.5,panoCircleMeshCreator:function(n){return new kl},tiledCubeTextureLevel:2,tileLevelForFov:function(n,t){var e,r=function(s){return s/180*Math.PI},i=(e=Math.log2)!==null&&e!==void 0?e:function(s){return Math.log(s)*Math.LOG2E},a=t.height/2/Math.tan(r(n/2))*Math.tan(r(45))*2,o=Math.max(i(a/512),0);return o<2.3&&o>.1&&(o=1),o=o%1>.75?Math.ceil(o):Math.floor(o),o},tileMaxRequest:3,luminanceAdaptiveEffectEnable:!0}),ps=function(n){ue(t,n);function t(e){var r=this,i,a,o,s,u=t.parseArgs(e);r=n.call(this,u)||this,r.mode="Panorama",r.tileLevel=0,r.initAnimationed=!1,r.maxAccessibleDistance=u.maxAccessibleDistance,r.panoTapTriggerRadius=u.panoTapTriggerRadius,r.panoCircleMeshCreator=u.panoCircleMeshCreator,r.tiledCubeTextureLevel=u.tiledCubeTextureLevel,r.tileLevelForFov=u.tileLevelForFov,r.tileMaxRequest=u.tileMaxRequest,r.luminanceAdaptiveEffectEnable=u.luminanceAdaptiveEffectEnable,r.luminanceAdaptiveEffect=new k0(r.renderer,r.modelScene,r.camera,r.models),r.colorCubeRenderTargetPool=new V0,r.luminanceCubeRenderTargetPool=new V0;var l=r.models.getMaterial()||{},c=l.pano0,d=l.pano1;c&&(d==null?void 0:d.map)!==c.map&&(r.models.setMaterial({pano0:d}),c.map.dispose(),c.map instanceof qe&&c.map.cubeRenderTarget&&r.colorCubeRenderTargetPool.push(c.map.cubeRenderTarget),c.luminanceMap&&(c.luminanceMap.dispose(),c.luminanceMap instanceof qe&&c.luminanceMap.cubeRenderTarget&&r.luminanceCubeRenderTargetPool.push(c.luminanceMap.cubeRenderTarget)));for(var p=r.colorCubeRenderTargetPool.size;p<2;p++){var A=Math.max(1024*r.tiledCubeTextureLevel,512),h=r.colorCubeRenderTargetPool.create();h.setSize(A,A),wo(null,h,r.renderer),r.colorCubeRenderTargetPool.push(h)}r.panoMeshes={},r.updatePanoMeshes(),r.locationMotion=new Re({count:0,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Re({modelAlpha:(a=(i=r.models.getMaterial())===null||i===void 0?void 0:i.modelAlpha)!==null&&a!==void 0?a:0}),r.perspToOrthoMotion=new Re({perspToOrtho:r.camera.perspToOrtho.x}),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=kt()]={panoId:He(r.currentPano),panoPicture:(s=(o=r.models.getMaterial())===null||o===void 0?void 0:o.pano1)!==null&&s!==void 0?s:null,position:r.camera.pose.offset.clone(),effect:"fly",fixCameraTransform:new f.Matrix4};var v=r.works.getResolvedObserver(r.currentPano);return r.textureLoader=new Xn,r.tiling=new Lm(v?pt(v.work):ra,r.tiledCubeTextureLevel+1,r.imageOptions),r.scene.add(r.tiling.object),r.panoVideo=new Nm,r.scene.add(r.panoVideo.object),r}return t.parseArgs=function(e){var r,i,a,o,s,u,l;if(e instanceof t)return e;var c=n.parseArgs.call(this,e);return O(O({},c),{maxAccessibleDistance:(r=e.maxAccessibleDistance)!==null&&r!==void 0?r:pr.maxAccessibleDistance,panoTapTriggerRadius:(i=e.panoTapTriggerRadius)!==null&&i!==void 0?i:pr.panoTapTriggerRadius,panoCircleMeshCreator:(a=e.panoCircleMeshCreator)!==null&&a!==void 0?a:pr.panoCircleMeshCreator,tiledCubeTextureLevel:(o=e.tiledCubeTextureLevel)!==null&&o!==void 0?o:pr.tiledCubeTextureLevel,tileLevelForFov:(s=e.tileLevelForFov)!==null&&s!==void 0?s:pr.tileLevelForFov,tileMaxRequest:(u=e.tileMaxRequest)!==null&&u!==void 0?u:pr.tileMaxRequest,luminanceAdaptiveEffectEnable:(l=e.luminanceAdaptiveEffectEnable)!==null&&l!==void 0?l:pr.luminanceAdaptiveEffectEnable})},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return O(O({},i),{mode:"Panorama"})},t.prototype.updateConfiguration=function(e){var r=this,i=n.prototype.updateConfiguration.call(this,e);if(i===!1)return!1;var a=O(O({},pr),e);if(this.maxAccessibleDistance!==a.maxAccessibleDistance&&(this.maxAccessibleDistance=a.maxAccessibleDistance),this.panoTapTriggerRadius!==a.panoTapTriggerRadius&&(this.panoTapTriggerRadius=a.panoTapTriggerRadius),this.panoCircleMeshCreator!==a.panoCircleMeshCreator&&(this.panoCircleMeshCreator=a.panoCircleMeshCreator,this.panoMeshes)){for(var o=Object.keys(this.panoMeshes),s=0,u=o;s<u.length;s++){var l=u[s],c=this.panoMeshes[l];this.helper.remove(c),c.dispose(),delete this.panoMeshes[l]}this.updatePanoMeshes()}return this.tiledCubeTextureLevel!==a.tiledCubeTextureLevel&&(this.tiledCubeTextureLevel=a.tiledCubeTextureLevel,setTimeout(function(){r.moveToPano(r.currentPano,{},!0)},30)),this.tileLevelForFov!==a.tileLevelForFov&&(this.tileLevelForFov=a.tileLevelForFov),this.tileMaxRequest!==a.tileMaxRequest&&(this.tileMaxRequest=a.tileMaxRequest),this.luminanceAdaptiveEffectEnable!==a.luminanceAdaptiveEffectEnable&&(this.luminanceAdaptiveEffectEnable=a.luminanceAdaptiveEffectEnable),!0},t.prototype.destroy=function(){var e,r;if(n.prototype.destroy.call(this),this.scene.remove(this.tiling.object),this.tiling.dispose(),this.locationMotion.dispose(),this.colorCubeRenderTargetPool.clear(),this.luminanceCubeRenderTargetPool.clear(),delete this.pendingTextureTask,this.panoMeshes)for(var i=Object.keys(this.panoMeshes),a=0,o=i;a<o.length;a++){var s=o[a],u=this.panoMeshes[s];this.helper.remove(u),u.dispose(),delete this.panoMeshes[s]}var l=this.videoTexture.image;l.pause(),l.oncanplay=function(){},l.ontimeupdate=function(){},this.scene.remove(this.panoVideo.object),this.panoVideo.setMaterial(null),this.panoVideo.dispose();for(var c=(e=this.models.getMaterial())!==null&&e!==void 0?e:{},d=c.pano0,p=c.pano1,A=0,h=Object.keys(this.panoResources);A<h.length;A++){var v=h[A],g=this.panoResources[v];if(g.panoPicture){var m=g.panoPicture.map;m&&m!==(d==null?void 0:d.map)&&m!==(p==null?void 0:p.map)&&(m.dispose(),(r=g.panoPicture.luminanceMap)===null||r===void 0||r.dispose(),g.panoPicture=null)}delete this.panoResources[v]}this.luminanceAdaptiveEffect.dispose()},t.prototype.isReady=function(){return this.locationMotion.ended!==!0?!1:n.prototype.isReady.call(this)},t.prototype.isTileReady=function(){var e,r,i,a=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),o=((e=a.panoPicture)===null||e===void 0?void 0:e.map)instanceof qe&&(i=(r=a.panoPicture)===null||r===void 0?void 0:r.map.tilePending)!==null&&i!==void 0?i:0,s=o<=0,u=this.tiling.pedding,l=this.tiling.object.visible&&u<=0;return this.initAnimationed&&s&&l},t.prototype.updateWork=function(e,r,i,a){var o=this;this.userAction=a,this.works=e;var s=t.initAnimationEndState(O(O({},this),{initial:{currentState:O(O({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:a}})),u={workCode:s.workCode,panoIndex:s.panoIndex},l=this.works.getWork(u.workCode);return this.tiling.setFetcher(l?pt(l):ra),this.tiling.cleanup(),this.initAnimationed=!1,this.hideIntersectMesh(),this.updatePanoMeshes(),this.moveToPano(u,{effect:i.effect,duration:i.duration,longitude:r.longitude,latitude:r.latitude,fov:r.fov,moveEndCallback:function(){o.initAnimationed=!0},moveCancelCallback:function(){o.initAnimationed=!0}},a),!0},t.prototype.updateModel=function(e){this.models=e,this.updatePanoMeshes()},t.prototype.updateTime=function(e,r){var i=this,a,o,s,u,l,c,d,p,A,h;if(!this.destroyed){var v={},g={},m=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),y=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),b=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),g.longitude=this.cameraMotion.value.longitude,g.latitude=this.cameraMotion.value.latitude,g.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),v.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(ce(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var x=this.locationMotion.getKeyFrameSegment(e),w=x[0],M=x[1],S=this.panoResourceFromLocationMotionKeyframe(w),E=this.panoResourceFromLocationMotionKeyframe(M),B=new f.Vector3().copy(S.position),R=new f.Vector3().copy(E.position),C=this.locationMotion.value.count-M.value.count+1;v.progress=C,E.panoPicture&&(C<1?S.panoPicture&&(v.pano0=S.panoPicture):v.pano0=E.panoPicture,v.pano1=E.panoPicture),E.effect==="montage"?v.transition="BLACK":E.effect==="spread"?v.transition="SPREAD":v.transition="FADE",(E.effect==="zoomin"||E.effect==="zoomout")&&(v.progress=Math.pow(C,3)),C<1&&E.effect!=="fly"&&(v.pano0&&S.panoPicture&&(v.pano0={map:v.pano0.map,zoom:v.pano0.zoom,luminanceMap:v.pano0.luminanceMap,matrix:S.panoPicture.matrix.clone().premultiply(S.fixCameraTransform).setPosition(E.position)}),B.copy(R),b=!0),g.distance=this.locationMotion.value.distance,g.offset=new f.Vector3(B.x+(R.x-B.x)*C,B.y+(R.y-B.y)*C,B.z+(R.z-B.z)*C);for(var I=[],L=[],T=0,F=this.locationMotion.keyframes;T<F.length;T++){var D=F[T],V=D.key,z=D.progress;V!==void 0&&(I.push(V),z>this.locationMotion.progress&&L.push(V))}for(var U=0,q=Object.keys(this.panoResources);U<q.length;U++){var G=q[U];if(!(L.indexOf(G)>=0)){var K=this.panoResources[G];if(K.panoPicture){var j=K.panoPicture.map,J=K.panoPicture.luminanceMap;if(j){if(j===((a=v.pano0)===null||a===void 0?void 0:a.map)||j===((o=v.pano1)===null||o===void 0?void 0:o.map))continue;j instanceof qe&&j.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(j.cubeRenderTarget),j.dispose(),J&&(J instanceof qe&&J.cubeRenderTarget&&this.luminanceCubeRenderTargetPool.push(J.cubeRenderTarget),J.dispose()),K.panoPicture=null}}I.indexOf(G)>=0||delete this.panoResources[G]}}this.currentPano=Lt(E.panoId),this.emit("pano.moving",X("pano.moving",{userAction:this.userAction,prevPano:Lt(m.panoId),state:O(O(O(O({},Lt(y.panoId)),{mode:this.mode}),tt(this.camera.pose)),g),options:{},progress:this.locationMotion.progress,error:null}))}ar(v)===!1&&(!((s=v.pano0)===null||s===void 0)&&s.map&&v.pano0.map instanceof qe&&!v.pano0.map.cubeRenderTarget&&(v.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((u=v.pano0)===null||u===void 0)&&u.luminanceMap&&v.pano0.luminanceMap instanceof qe&&!v.pano0.luminanceMap.cubeRenderTarget&&(v.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),!((l=v.pano1)===null||l===void 0)&&l.map&&v.pano1.map instanceof qe&&!v.pano1.map.cubeRenderTarget&&(v.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((c=v.pano1)===null||c===void 0)&&c.luminanceMap&&v.pano1.luminanceMap instanceof qe&&!v.pano1.luminanceMap.cubeRenderTarget&&(v.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.models.setMaterial(v)),ar(g)===!1&&this.setCamera(g);var W=this.works.getResolvedObserver(this.currentPano),$=this.locationMotion.ended?this.getForwardObserverOrNot():null;if(this.camera.pose.distance>.1||b)for(var Y=0,Z=Object.keys(this.panoMeshes);Y<Z.length;Y++){var oe=Z[Y],ne=this.panoMeshes[oe];ne.setOpacity(0),ne.setCurrent(!1),ne.updateTime&&ne.updateTime(e,r),ne.visible=!1}else if(W){var de=Br(W.visibleIds,function(we){var be=i.works.getResolvedObserver(we);return be?W.standingPosition.distanceTo(be.standingPosition):1/0},!0),se=de[1];se=ce(se,2.5,1/0);for(var ye=W.visibleIds.concat(He(this.currentPano)),ie=this.camera.getDirection(new f.Vector3),xe=0,Le=Object.keys(this.panoMeshes);xe<Le.length;xe++){var oe=Le[xe],ne=this.panoMeshes[oe],Ce=this.works.getResolvedObserver(oe);if(ye.indexOf(oe)===-1)ne.setCurrent(!1),ne.setOpacity(0);else if(!Ce)ne.setCurrent(!1),ne.setOpacity(0);else if(!Ce.loadable&&!Ce.active)ne.setCurrent(!1),ne.setOpacity(0);else{var Oe=ne.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);ne.setCurrent(!ne.loading&&ne.progress===0&&$!==null&&$.panoId===oe),ne.setOpacity(Oe<.01?0:ce(se/Oe*1.2,.4,.85));var ee=this.camera.position.clone().setY(ne.position.y),re=new f.Vector3().copy(ne.position).sub(ee).normalize();if(oe===He(this.currentPano)){var H=ce((.5-ee.distanceTo(ne.position))/.5,0,1);re.multiplyScalar(1-H).add(ie.clone().multiplyScalar(H))}re.length()>0&&ne.quaternion.setFromEuler(new f.Euler(0,Math.atan2(re.x,re.z),0))}ne.updateTime&&ne.updateTime(e,r)}}var Be=this.tileLevel=function(){if(i.tileLevelForFov===!1)return 0;var we=i.renderer.getDrawingBufferSize(new f.Vector2);we.width*=i.scissor.width,we.height*=i.scissor.height;var be=y.panoId,Ae=i.works.getResolvedObserver(be),me=i.imageOptions.size;if(typeof me=="undefined"&&Ae){var ze=Ae.images.up.match(/\/cube_(\d+)\//);ze&&(me=Number(ze[1]))}typeof me=="undefined"&&(me=2048);var pe=0;me>=1024&&(pe=1),me>=2048&&(pe=2),me>=4096&&(pe=3),me>=8192&&(pe=4);var Se=i.tileLevelForFov(i.camera.fov,we);return Se>pe?Se:0}(),Te=function(){var we=i.camera.quaternion.clone(),be=i.works.getResolvedObserver(y.panoId),Ae=be!=null?be:W;Ae&&we.premultiply(Ae.quaternion.clone().inverse());var me=new f.Matrix4().makeRotationFromQuaternion(we),ze=new f.Matrix4().getInverse(me),pe=new f.Frustum().setFromProjectionMatrix(new f.Matrix4().multiplyMatrices(i.camera.projectionMatrix,ze));return pe}();y.panoId===He(this.currentPano)&&(((d=y.panoPicture)===null||d===void 0?void 0:d.map)instanceof qe&&(y.panoPicture.map.maxRequest=this.tileMaxRequest,y.panoPicture.map.update(Te,Math.min(Be,this.tiledCubeTextureLevel)),y.panoPicture.map.needsRender===!0&&(y.panoPicture.map.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)),((p=y.panoPicture)===null||p===void 0?void 0:p.luminanceMap)instanceof qe&&(y.panoPicture.luminanceMap.maxRequest=this.tileMaxRequest,y.panoPicture.luminanceMap.update(Te,Math.min(Be,this.tiledCubeTextureLevel)),y.panoPicture.luminanceMap.needsRender===!0&&(y.panoPicture.luminanceMap.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)));{var Ee=this.tiling.object.visible;if(this.initAnimationed){var Qe=y.panoId,Ie=this.works.getResolvedObserver(Qe);Ie?Fi(this.camera.position,Ie.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==Qe&&this.tiling.cleanup(),this.tiling.panoId=Qe,this.tiling.setResource((h=(A=Ie.images)===null||A===void 0?void 0:A.tiles)!==null&&h!==void 0?h:[],this.enableIOSEDR&&Ie.images.luminance?Ie.images.luminance:null),this.tiling.setFetcher(pt(Ie.work)),this.tiling.setRotation(Ie.quaternion),this.tiling.setPosition(Ie.position),this.tiling.maxRequest=this.tileMaxRequest,Be>this.tiledCubeTextureLevel?this.tiling.update(Te,Be,e):this.tiling.update(Te,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;Ee!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0,this.modelSceneNeedsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e),this.intersectMesh.scale.setScalar(ce(this.cameraMotion.value.fov/45,0,1))}},t.prototype.render=function(e,r){var i=this.renderer.getRenderTarget(),a=this.works.getResolvedObserver(this.currentPano);a&&a.video&&(this.needsRender=!0,this.modelSceneNeedsRender=!0),this.updateScreenBuffer(r),e&&(r==="luminance"?(this.luminanceAdaptiveEffect.enable=this.luminanceAdaptiveEffectEnable,this.luminanceAdaptiveEffect.render(this.screenBuffers)):(this.renderer.setRenderTarget(this.modelRenderTarget),this.renderer.render(this.modelScene,this.camera))),this.depthCopyPass.render(this.modelRenderTarget.depthTexture,i),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.copyPass.render(this.modelRenderTarget,i),this.renderer.setRenderTarget(i),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t.prototype.postProcessing=function(e,r){if(!this.destroyed&&r==="luminance")return this.luminanceAdaptiveEffect||(this.luminanceAdaptiveEffect=new k0(this.renderer,this.scene,this.camera,this.models),this.luminanceAdaptiveEffect.enable=this.luminanceAdaptiveEffectEnable),this.luminanceAdaptiveEffect.render(e)},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(ve())[1],r=this.locationMotion.getKeyFrameSegment(ve())[1],i=this.panoResourceFromLocationMotionKeyframe(r),a=this.works.getResolvedObserver(i.panoId);return{workCode:a?a.work.workCode:this.currentPano.workCode,panoIndex:a?a.panoIndex:this.currentPano.panoIndex,mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:a?a.position.clone():this.camera.position.clone(),distance:this.locationMotion.value.distance}},t.prototype.moveToPano=function(e,r,i){var a=this,o,s,u,l,c=(o=r.effect)!==null&&o!==void 0?o:"fly";this.userAction=i,this.stopMomentumMovement();var d=this.works.getResolvedObserver(e);if(!d)throw new Error("Invalid PanoId ".concat(JSON.stringify(e)));var p=mi(d.images.up),A=this.imageOptions.size;typeof A=="undefined"&&d&&p&&(A=Number(p)),typeof A=="undefined"&&(A=2048);var h=this.imageOptions.transform,v=O({key:"pano.".concat(d.panoId)},Jt(this.imageOptions,["format","size","quality","sharpen","mappings"])),g=d.images,m=(u=(s=d.images.tiles)===null||s===void 0?void 0:s.filter(function(F){return F.size>A}))!==null&&u!==void 0?u:null,y=h,b={key:"pano_luminance.".concat(d.panoId),size:v.size?v.size/2:void 0},x=this.enableIOSEDR&&d.images.luminance?d.images.luminance:null,w=function(){if(!d.images.tiles||!x)return null;var F=mi(x.up);return F?m==null?void 0:m.map(function(D){var V=D.size*D.scale/2;return F<V?{level:D.level,size:V,scale:1,back:tr(x.back,V),front:tr(x.front,V),left:tr(x.left,V),right:tr(x.right,V),up:tr(x.up,V),down:tr(x.down,V)}:{level:D.level,size:F,scale:V/F,back:x.back,front:x.front,left:x.left,right:x.right,up:x.up,down:x.down}}):null}(),M="pano:"+ma([g,v,h,this.tiledCubeTextureLevel]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===M)return;var S=this.pendingTextureTask.panoId;(l=this.panoMeshes[S])===null||l===void 0||l.setProgress(0),this.emit("pano.texture.abort",X("pano.texture.abort",{error:null,progress:0,meta:null,pano:d.pano}))}var E="move-to-pano-"+d.panoId;this.pending.add(E);var B=this.models.getMaterial()||{},R=B.pano0,C=B.pano1,I;if(R&&R.map.name===M&&R.luminanceMap!==null===this.enableIOSEDR?I=R:(C==null?void 0:C.map.name)===M&&C.luminanceMap!==null===this.enableIOSEDR&&(I=C),I){var L={panoId:d.panoId,effect:c,panoPicture:{zoom:1,map:I.map,luminanceMap:I.luminanceMap,matrix:new f.Matrix4().compose(d.position,d.quaternion,D0)},position:d.position.clone(),fixCameraTransform:new f.Matrix4};Mt.shared.add(function(){a.pending.delete(E),a.doMoveToPano(d.pano,L,r)},!0,1);return}this.pendingTextureTask={panoId:d.panoId,hash:M,onLoad:function(F,D){var V;if(a.pending.delete(E),a.destroyed)F.body.dispose();else{F.body.name=M;var z={panoId:d.panoId,effect:c,panoPicture:{zoom:1,map:F.body,luminanceMap:(V=D==null?void 0:D.body)!==null&&V!==void 0?V:null,matrix:new f.Matrix4().compose(d.position,d.quaternion,D0)},position:d.position.clone(),fixCameraTransform:new f.Matrix4};a.doMoveToPano(d.pano,z,r)}},onError:function(F){a.pending.delete(E);var D=O(O(O({},d.pano),{mode:a.mode}),tt(a.camera.pose));a.emit("pano.error",X("pano.error",{error:F,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:D})),a.emit("pano.cancel",X("pano.cancel",{error:F,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:D})),a.emit("error",F),r.moveCancelCallback&&r.moveCancelCallback()}};var T=this.panoMeshes[d.panoId];T&&T.tap&&T.tap(),Promise.all([this.tileLevelForFov&&m&&m.length?this.textureLoader.loadTiledCubeTexture(g,m,{tileMaxLevel:this.tiledCubeTextureLevel,imageURL:{transform:h,options:v},minFilter:f.LinearFilter,magFilter:f.LinearFilter,generateMipmaps:!1,format:f.RGBAFormat,viaAjax:!0,fetcher:pt(d.work)},void 0,void 0,function(F){var D,V;a.emit("pano.texture.progress",X("pano.texture.progress",{error:null,progress:F,meta:null,pano:d.pano})),((D=a.pendingTextureTask)===null||D===void 0?void 0:D.hash)===M&&((V=a.panoMeshes[d.panoId])===null||V===void 0||V.setProgress(F))},this.renderer):this.textureLoader.loadCubeTexture(g,{imageURL:{transform:h,options:v},format:f.RGBAFormat,viaAjax:!0,fetcher:pt(d.work)},void 0,void 0,function(F){var D,V;a.emit("pano.texture.progress",X("pano.texture.progress",{error:null,progress:F,meta:null,pano:d.pano})),((D=a.pendingTextureTask)===null||D===void 0?void 0:D.hash)===M&&((V=a.panoMeshes[d.panoId])===null||V===void 0||V.setProgress(F))},this.renderer),x?this.tileLevelForFov&&w&&w.length?this.textureLoader.loadTiledCubeTexture(x,w,{tileMaxLevel:this.tiledCubeTextureLevel,imageURL:{transform:y,options:b},minFilter:f.LinearFilter,magFilter:f.LinearFilter,generateMipmaps:!1,fetcher:pt(d.work)},void 0,void 0,void 0,this.renderer).catch(function(){return null}):this.textureLoader.loadCubeTexture(x,{imageURL:{transform:y,options:b},fetcher:pt(d.work)},void 0,void 0,void 0,this.renderer).catch(function(){return null}):Promise.resolve(null)]).then(function(F){var D,V,z=F[0],U=F[1];((D=a.pendingTextureTask)===null||D===void 0?void 0:D.hash)===M?(a.pendingTextureTask.onLoad(z,U),(V=a.panoMeshes[d.panoId])===null||V===void 0||V.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",X("pano.texture.success",{error:null,progress:1,meta:z.meta,pano:d.pano}))):(z.body.dispose(),U==null||U.body.dispose())}).catch(function(F){var D,V;((D=a.pendingTextureTask)===null||D===void 0?void 0:D.hash)===M&&(a.pendingTextureTask.onError(F),(V=a.panoMeshes[d.panoId])===null||V===void 0||V.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",X("pano.texture.error",{error:F,progress:0,meta:null,pano:d.pano})),a.emit("error",F))}),this.emit("pano.texture.load",X("pano.texture.load",{error:null,progress:0,meta:null,pano:d.pano}))},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial,a=i.duration,o=i.effect,s=i.userAction;e.userAction=s;var u=t.initAnimationEndState(e),l={workCode:u.workCode,panoIndex:u.panoIndex},c={modelAlpha:0},d={perspToOrtho:0},p=!1;e.moveToPano(l,{longitude:u.longitude,latitude:u.latitude,fov:u.fov,effect:o,duration:a,moveStartCallback:function(A){p=!0,e.perspToOrthoMotion.set(d,a).catch(Q),e.modelAlphaMotion.setKeyframes([{progress:0,value:O({},e.modelAlphaMotion.value)},{progress:.6,value:O({},e.modelAlphaMotion.value)},{progress:1,value:c}],a).catch(Q),e.emit("initAnimation.start",X("initAnimation.start",{state:A,userAction:e.userAction}))},moveEndCallback:function(A){e.emit("initAnimation.end",X("initAnimation.end",{state:A,userAction:e.userAction})),e.initAnimationed=!0,r()},moveCancelCallback:function(){var A=O(O(O({},l),{mode:e.mode}),tt(e.camera.pose));p===!1&&e.emit("initAnimation.start",X("initAnimation.start",{state:A,userAction:e.userAction})),e.emit("initAnimation.end",X("initAnimation.end",{state:A,userAction:e.userAction})),e.initAnimationed=!0,r()}},s)})},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.locationMotionKeyframesLength=function(e){for(var r=0,i=1;i<e.length;i++){var a=this.panoResourceFromLocationMotionKeyframe(e[i-1]).position,o=this.panoResourceFromLocationMotionKeyframe(e[i]).position,s=a.distanceTo(o)*(e[i].value.count-e[i-1].value.count);r+=s}return r},t.prototype.updatePanoMeshes=function(){for(var e=this,r={},i=Object.keys(this.panoMeshes),a=0,o=i;a<o.length;a++){var s=o[a],u=this.panoMeshes[s];r[s]=u,delete this.panoMeshes[s]}for(var l=1,c={},d=function(M){var S=Br(M.accessibleIds,function(B){var R=e.works.getResolvedObserver(B);if(!R)return 1/0;var C=R.standingPosition.distanceTo(M.standingPosition);return ce(C,1,1/0)},!0),E=S[1];c[M.panoId]===void 0&&(c[M.panoId]=E)},p=0,A=this.works.resolvedObservers;p<A.length;p++){var h=A[p];d(h)}var v=Object.keys(c).map(function(M){return c[M]});if(v.length){var g=v.reduce(function(M,S){return M+S},0)/v.length;l=ce(g*.6,1,3)}for(var m=0,y=this.works.resolvedObservers;m<y.length;m++){var h=y[m],u=void 0;r[h.panoId]?(u=r[h.panoId],u.loading===!0&&h.loadable===!1&&u.setLoading(!1),delete r[h.panoId]):(u=this.panoCircleMeshCreator(h.pano),u.name="PanoCircleMesh_"+h.panoId,this.helper.add(u)),u.scale.set(l,1,l),u.position.copy(h.standingPosition),this.panoMeshes[h.panoId]=u}for(var b=0,x=Object.keys(r);b<x.length;b++){var w=x[b];this.helper.remove(r[w]),r[w].dispose(),delete r[w]}},t.prototype.doMoveToPano=function(e,r,i){var a=this,o,s,u,l,c,d,p,A,h,v,g;i===void 0&&(i={});var m=ve(),y=kt();this.tiling.cleanup(),this.panoResources[y]=r;var b=1,x,w,M;if(this.locationMotion.ended){var S=this.locationMotion.getKeyFrameSegment(m);S[0];var E=S[1],B=this.locationMotion.value,R=((o=this.panoResourceFromLocationMotionKeyframe(E))!==null&&o!==void 0?o:this.camera).position,C=r.position;x=Math.max(R.distanceTo(C),b),w=[{key:E.key,progress:0,value:O(O({},B),{count:0})},{key:y,progress:1,value:{distance:0,count:1}}],M=0}else{var I=this.locationMotion.getKeyFrameSegment(m),L=I[0],E=I[1],B=this.locationMotion.value,T=this.panoResourceFromLocationMotionKeyframe(L).position,R=this.panoResourceFromLocationMotionKeyframe(E).position,C=r.position,F=E.value.count-B.count,D=Math.max(T.distanceTo(R),b)*F,V=Math.max(R.distanceTo(C),b);x=D+V,w=[{key:L.key,progress:0,value:O({},B)},{key:E.key,progress:D/x,value:E.value},{key:y,progress:1,value:{count:E.value.count+1,distance:0}}];var z=this.locationMotionKeyframesLength(this.locationMotion.keyframes),U=this.locationMotionKeyframesLength(w);z===0||z===0?M=0:M=this.locationMotion.getProgressVelocity(m)*z/U}var q=r.effect==="instant"?0:this.calculateMovingDuration(i.duration,r.effect==="fly"?x:0),G={longitude:i.longitude,latitude:i.latitude,fov:i.fov},K=O(O({},e),{mode:this.mode,longitude:(s=G.longitude)!==null&&s!==void 0?s:this.camera.pose.longitude,latitude:(u=G.latitude)!==null&&u!==void 0?u:this.camera.pose.latitude,fov:(l=G.fov)!==null&&l!==void 0?l:this.camera.pose.fov,offset:r.position.clone(),distance:this.camera.pose.distance}),j=this.currentPano;if(this.emit("pano.moveTo",X("pano.moveTo",{options:i,prevPano:j,progress:0,state:K,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(K),this.videoTexture&&this.videoTexture.image instanceof HTMLVideoElement&&this.videoTexture.image.getAttribute("src")&&(this.videoTexture.image.pause(),this.videoTexture.image.removeAttribute("uuid"),this.videoTexture.image.removeAttribute("src"),this.videoTexture.image.oncanplay=Q,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(G,q).catch(Q);else{var J=Ut({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),W=Ut({longitude:(c=G.longitude)!==null&&c!==void 0?c:this.cameraMotion.value.longitude,latitude:(d=G.latitude)!==null&&d!==void 0?d:this.cameraMotion.value.latitude}),$=new f.Object3D;$.lookAt(J);var Y=new f.Matrix4().makeRotationFromQuaternion($.quaternion);$.lookAt(W);var Z=new f.Matrix4().makeRotationFromQuaternion($.quaternion),oe=new f.Matrix4().getInverse(Y).premultiply(Z),ne=this.cameraMotion.value.fov,de=(p=G.fov)!==null&&p!==void 0?p:this.cameraMotion.value.fov,se=1;r.effect==="zoomin"?se=1.5:r.effect==="zoomout"&&(se=.4);for(var ye=ce(de*se,1,170),ie=0;ie<w.length-1;ie++){var xe=w[ie].key;if(xe){var Le=this.panoResources[xe];Le&&(Le.fixCameraTransform.copy(oe),Le.panoPicture&&(Le.panoPicture.zoom=Math.tan(ne/2/180*Math.PI)/Math.tan(ye/2/180*Math.PI)))}}this.cameraMotion.setKeyframes([{progress:0,value:{longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:this.cameraMotion.value.fov}},{progress:0,value:{longitude:(A=G.longitude)!==null&&A!==void 0?A:this.cameraMotion.value.longitude,latitude:(h=G.latitude)!==null&&h!==void 0?h:this.cameraMotion.value.latitude,fov:ye}},{progress:1,value:{longitude:(v=G.longitude)!==null&&v!==void 0?v:this.cameraMotion.value.longitude,latitude:(g=G.latitude)!==null&&g!==void 0?g:this.cameraMotion.value.latitude,fov:de}}],q).catch(Q)}var Ce=this.locationMotion.setKeyframes(w,q,M);Ce.then(function(){for(var Oe,ee,re=0,H=a.models;re<H.length;re++){var Be=H[re];Be.show()}var Te=O(O({},e),{mode:a.mode,longitude:a.camera.pose.longitude,latitude:a.camera.pose.latitude,fov:a.camera.pose.fov,offset:a.camera.pose.offset.clone(),distance:a.camera.pose.distance});a.emit("pano.arrived",X("pano.arrived",{options:i,prevPano:j,progress:1,state:Te,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(Te);var Ee=a.works.getResolvedObserver(e);if(Ee&&Ee.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var Qe=zm.clone().multiply((ee=(Oe=a.models.getMaterial().pano1)===null||Oe===void 0?void 0:Oe.matrix)!==null&&ee!==void 0?ee:new f.Matrix4).multiply(Ee.video.matrix),Ie={map:a.videoTexture,size:Ee.video.size,matrix:Qe,alpha:1},we=kt(),be=a.videoTexture.image;be.setAttribute("uuid",we),Ul().then(function(Ae){Ae&&Ee.video&&be.getAttribute("uuid")===we&&(be.oncanplay=function(){be.oncanplay=Q,be.play()},be.ontimeupdate=function(){be.currentTime>.5&&(be.ontimeupdate=Q,a.panoVideo.setMaterial(Ie))},be.src=Ee.video.source)}).catch(function(){be.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",X("pano.cancel",{options:i,prevPano:j,progress:0,state:K,userAction:a.userAction,error:null})),i.moveCancelCallback&&i.moveCancelCallback()})},t.prototype.getForwardObserverOrNot=function(e){var r=this,i=this.works.getResolvedObserver(this.currentPano);if(!i)return null;var a=e!=null?e:new f.Raycaster(this.camera.position.clone(),this.camera.getDirection(new f.Vector3));a.params.Points={threshold:.1};var o=i.standingPosition.clone();if(i.position.distanceTo(a.ray.origin)>1){var s=this.models.intersectRaycaster(new f.Raycaster(a.ray.origin,new f.Vector3(0,-1,0)))[0];s&&s.distance<=2?o.copy(s.point):o.copy(a.ray.origin).add(new f.Vector3(0,-1.5,0))}var u=this.models.intersectRaycaster(a)[0],l=u?u.point:a.ray.origin.clone().add(a.ray.direction.clone().normalize().multiplyScalar(3)),c=l.clone().sub(o).normalize();if(c.length()===0)return null;for(var d=i.accessibleIds.filter(function(w){if(w===He(r.currentPano))return!1;var M=r.works.getResolvedObserver(w);if(!M)return!1;var S=M.standingPosition.clone().project(r.camera);return Math.abs(S.z)>1||Math.abs(S.x)>1||Math.abs(S.y)>1?!1:M.loadable||M.active}),p=d.slice().sort(function(w,M){var S=r.works.getResolvedObserver(w).standingPosition.clone().distanceTo(o),E=r.works.getResolvedObserver(M).standingPosition.clone().distanceTo(o);return S-E}),A=0,h=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];A<h.length;A++)for(var v=h[A],g=0,m=p;g<m.length;g++){var y=m[g],b=this.works.getResolvedObserver(y);if(b){var x=b.standingPosition.clone().sub(o);if(x&&x.length()!==0&&c.angleTo(x)<v)return b}}return null},t.prototype.onTapGesture=function(e){var r=this,i;if(this.userAction=e.userAction,this.stopMomentumMovement(),!!this.initAnimationed){if(!this.locationMotion.ended){var a=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]);if(a.panoId!==He(this.currentPano))return}var o=e.center.raycaster,s=this.camera.getDirection(new f.Vector3).setY(0),u=null,l=this.works.getResolvedObserver(this.currentPano);if(l){var c=l.accessibleIds.filter(function(U){if(U===He(r.currentPano))return!1;var q=r.works.getResolvedObserver(U);return!q||q.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:q.loadable||q.active}),d=this.models.intersectRaycaster(o)[0];if(d){var p=Br(c,function(U){var q=r.works.getResolvedObserver(U);if(!q)return 1/0;var G=q.standingPosition.clone();return G.distanceTo(d.point)},!0),A=p[0],h=p[1];A&&h<this.panoTapTriggerRadius&&(u=(i=this.works.getResolvedObserver(A))!==null&&i!==void 0?i:null)}u||(u=this.getForwardObserverOrNot(o));for(var v=0,g=this.locationMotion.keyframes;v<g.length;v++){var m=g[v],y=this.panoResourceFromLocationMotionKeyframe(m);if(!(m.progress<this.locationMotion.progress)&&u&&y.panoId===u.panoId){u=null;break}}if(!u)this.emit("gesture.tap",e),e.defaultPrevented||this.locationMotion.ended===!0&&this.cameraBounce();else{for(var b={},x=Math.PI/6,w=Math.PI/12,M=u.position.clone().setY(0).sub(l.position.clone().setY(0)).normalize(),S=[],E=[],B=[],R=0,C=u.accessibleIds;R<C.length;R++){var A=C[R],I=Lt(A);if(!(Ar(I,this.currentPano)||Ar(I,u.pano))){var L=this.works.getResolvedObserver(A);if(L){var T=L.position.clone().sub(u.position).setY(0);M.angleTo(T)<x&&B.push(T)}}}var F=B.length>0?B:vt(vt([],S,!0),E,!0),D=F.slice().sort(function(U,q){return U.angleTo(M)-q.angleTo(M)})[0];D&&D.angleTo(s)>w&&(b.longitude=Math.atan2(-D.x,-D.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(b.latitude=ce(0,this.minLatitude,this.maxLatitude));var V=O({},e.state);if(V.workCode=u.pano.workCode,V.panoIndex=u.pano.panoIndex,b.longitude!==void 0&&(V.longitude=b.longitude),b.latitude!==void 0&&(V.latitude=b.latitude),b.fov!==void 0&&(V.fov=b.fov),V.distance=0,V.offset=u.position.clone(),e.state=V,this.emit("gesture.tap",e),!e.defaultPrevented){if(this.emit("pano.select",X("pano.select",{prevPano:this.currentPano,state:V,userAction:e.userAction,options:b,progress:0,error:null})),u&&!u.active){var z=u.panoId;this.panoMeshes[z]&&(this.panoMeshes[z].setDisabled(!1),this.panoMeshes[z].setLoading(!0))}u&&u.active&&this.emit("pano.request",X("pano.request",{userAction:e.userAction,prevPano:this.currentPano,progress:0,state:V,options:b,error:null}))}}}}},t}(Ql),Qr=Math.PI/180,Un=180/Math.PI,ql=.001,Hl=1,pi=function(){var n=typeof navigator!="undefined"&&/iPad|iPhone|iPod/.test(navigator.platform);return function(){return n}}(),Qm=function(){var n=typeof navigator!="undefined"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return function(){return n}}(),Um=function(){var n=typeof navigator!="undefined"&&navigator.userAgent.indexOf("Firefox")!==-1&&navigator.userAgent.indexOf("Android")!==-1;return function(){return n}}(),Gl=function(){var n=typeof navigator!="undefined"?navigator.userAgent.match(/.*Chrome\/([0-9]+)/):null,t=n?parseInt(n[1],10):null;return function(){return t}}(),qm=function(){var n=!1;if(Gl()===65){var t=typeof navigator!="undefined"?navigator.userAgent.match(/.*Chrome\/([0-9\.]*)/):null;if(t){var e=t[1].split(".");e[0],e[1];var r=e[2],i=e[3];n=parseInt(r,10)===3325&&parseInt(i,10)<148}}return function(){return n}}(),Hm=function(){var n=pi()&&Qm()&&typeof navigator!="undefined"&&navigator.userAgent.indexOf("13_4")!==-1;return function(){return n}}(),Kl=function(){var n=typeof navigator!="undefined"&&navigator.userAgent.indexOf("R7 Build")!==-1;return function(){return n}}();function N0(){var n=typeof window!="undefined"&&(window.orientation==90||window.orientation==-90);return Kl()?!n:n}function Gm(n){return!(isNaN(n)||n<=ql||n>Hl)}function Km(n){if(n.w>1)return 0;var t=2*Math.acos(n.w);return t}var z0=function(){var n={};return function(t,e){n[t]===void 0&&(console.warn("cardboard: "+e),n[t]=!0)}}();function Q0(n){var t,e=n.indexOf("://");e!==-1?t=e+3:t=0;var r=n.indexOf("/",t);return r===-1&&(r=n.length),n.substring(0,r)}function _m(){if(typeof window=="undefined"||typeof document=="undefined")return!1;var n=window.self!==window.top,t=Q0(document.referrer),e=Q0(window.location.href);return n&&t!==e}var U0=function(){function n(r,i,a){var o=i?i[0]:0,s=i?i[1]:0,u=i?i[2]:0,l=i?i[3]:1,c=o+o,d=s+s,p=u+u,A=o*c,h=o*d,v=o*p,g=s*d,m=s*p,y=u*p,b=l*c,x=l*d,w=l*p;return r[0]=1-(g+y),r[1]=h+w,r[2]=v-x,r[3]=0,r[4]=h-w,r[5]=1-(A+y),r[6]=m+b,r[7]=0,r[8]=v+x,r[9]=m-b,r[10]=1-(A+g),r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function t(r,i,a){var o=a[0],s=a[1],u=a[2],l,c,d,p,A,h,v,g,m,y,b,x;return i===r?(r[12]=i[0]*o+i[4]*s+i[8]*u+i[12],r[13]=i[1]*o+i[5]*s+i[9]*u+i[13],r[14]=i[2]*o+i[6]*s+i[10]*u+i[14],r[15]=i[3]*o+i[7]*s+i[11]*u+i[15]):(l=i[0],c=i[1],d=i[2],p=i[3],A=i[4],h=i[5],v=i[6],g=i[7],m=i[8],y=i[9],b=i[10],x=i[11],r[0]=l,r[1]=c,r[2]=d,r[3]=p,r[4]=A,r[5]=h,r[6]=v,r[7]=g,r[8]=m,r[9]=y,r[10]=b,r[11]=x,r[12]=l*o+A*s+m*u+i[12],r[13]=c*o+h*s+y*u+i[13],r[14]=d*o+v*s+b*u+i[14],r[15]=p*o+g*s+x*u+i[15]),r}function e(r,i){var a=i[0],o=i[1],s=i[2],u=i[3],l=i[4],c=i[5],d=i[6],p=i[7],A=i[8],h=i[9],v=i[10],g=i[11],m=i[12],y=i[13],b=i[14],x=i[15],w=a*c-o*l,M=a*d-s*l,S=a*p-u*l,E=o*d-s*c,B=o*p-u*c,R=s*p-u*d,C=A*y-h*m,I=A*b-v*m,L=A*x-g*m,T=h*b-v*y,F=h*x-g*y,D=v*x-g*b,V=w*D-M*F+S*T+E*L-B*I+R*C;return V?(V=1/V,r[0]=(c*D-d*F+p*T)*V,r[1]=(s*F-o*D-u*T)*V,r[2]=(y*R-b*B+x*E)*V,r[3]=(v*B-h*R-g*E)*V,r[4]=(d*L-l*D-p*I)*V,r[5]=(a*D-s*L+u*I)*V,r[6]=(b*S-m*R-x*M)*V,r[7]=(A*R-v*S+g*M)*V,r[8]=(l*F-c*L+p*C)*V,r[9]=(o*L-a*F-u*C)*V,r[10]=(m*B-y*S+x*w)*V,r[11]=(h*S-A*B-g*w)*V,r[12]=(c*I-l*T-d*C)*V,r[13]=(a*T-o*I+s*C)*V,r[14]=(y*M-m*E-b*w)*V,r[15]=(A*E-h*M+v*w)*V,r):null}return function(r,i,a){n(r,i),a&&t(r,r,a),e(r,r)}}(),uo=function(){function n(t,e){t===void 0&&(t=new f.Vector3),e===void 0&&(e=0),this.sample=t,this.timestampS=e}return n.prototype.set=function(t,e){this.sample=t,this.timestampS=e},n.prototype.copy=function(t){this.set(t.sample,t.timestampS)},n}(),jm=function(){function n(t,e){this.kFilter=t,this.isDebug=e,this.currentAccelMeasurement=new uo,this.currentGyroMeasurement=new uo,this.previousGyroMeasurement=new uo,pi()?this.filterQ=new f.Quaternion(-1,0,0,1):this.filterQ=new f.Quaternion(1,0,0,1),this.previousFilterQ=new f.Quaternion,this.previousFilterQ.copy(this.filterQ),this.accelQ=new f.Quaternion,this.isOrientationInitialized=!1,this.estimatedGravity=new f.Vector3,this.measuredGravity=new f.Vector3,this.gyroIntegralQ=new f.Quaternion}return n.prototype.addAccelMeasurement=function(t,e){this.currentAccelMeasurement.set(t,e)},n.prototype.addGyroMeasurement=function(t,e){this.currentGyroMeasurement.set(t,e);var r=e-this.previousGyroMeasurement.timestampS;Gm(r)&&this.run_(),this.previousGyroMeasurement.copy(this.currentGyroMeasurement)},n.prototype.getOrientation=function(){return this.filterQ},n.prototype.run_=function(){if(!this.isOrientationInitialized){this.accelQ=this.accelToQuaternion_(this.currentAccelMeasurement.sample),this.previousFilterQ.copy(this.accelQ),this.isOrientationInitialized=!0;return}var t=this.currentGyroMeasurement.timestampS-this.previousGyroMeasurement.timestampS,e=this.gyroToQuaternionDelta_(this.currentGyroMeasurement.sample,t);this.gyroIntegralQ.multiply(e),this.filterQ.copy(this.previousFilterQ),this.filterQ.multiply(e);var r=new f.Quaternion;r.copy(this.filterQ),r.inverse(),this.estimatedGravity.set(0,0,-1),this.estimatedGravity.applyQuaternion(r),this.estimatedGravity.normalize(),this.measuredGravity.copy(this.currentAccelMeasurement.sample),this.measuredGravity.normalize();var i=new f.Quaternion;i.setFromUnitVectors(this.estimatedGravity,this.measuredGravity),i.inverse(),this.isDebug&&console.log("Delta: %d deg, G_est: (%s, %s, %s), G_meas: (%s, %s, %s)",Un*Km(i),this.estimatedGravity.x.toFixed(1),this.estimatedGravity.y.toFixed(1),this.estimatedGravity.z.toFixed(1),this.measuredGravity.x.toFixed(1),this.measuredGravity.y.toFixed(1),this.measuredGravity.z.toFixed(1));var a=new f.Quaternion;a.copy(this.filterQ),a.multiply(i),this.filterQ.slerp(a,1-this.kFilter),this.previousFilterQ.copy(this.filterQ)},n.prototype.accelToQuaternion_=function(t){var e=new f.Vector3;e.copy(t),e.normalize();var r=new f.Quaternion;return r.setFromUnitVectors(new f.Vector3(0,0,-1),e),r.inverse(),r},n.prototype.gyroToQuaternionDelta_=function(t,e){var r=new f.Quaternion,i=new f.Vector3;return i.copy(t),i.normalize(),r.setFromAxisAngle(i,t.length()*e),r},n}(),Jm=function(){function n(t,e){this.predictionTimeS=t,this.isDebug=e,this.previousQ=new f.Quaternion,this.previousTimestampS=null,this.deltaQ=new f.Quaternion,this.outQ=new f.Quaternion}return n.prototype.getPrediction=function(t,e,r){if(!this.previousTimestampS)return this.previousQ.copy(t),this.previousTimestampS=r,t;var i=new f.Vector3;i.copy(e),i.normalize();var a=e.length();if(a<Qr*20)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(Un*a).toFixed(1)),this.outQ.copy(t),this.previousQ.copy(t),this.outQ;var o=a*this.predictionTimeS;return this.deltaQ.setFromAxisAngle(i,o),this.outQ.copy(this.previousQ),this.outQ.multiply(this.deltaQ),this.previousQ.copy(t),this.previousTimestampS=r,this.outQ},n}(),Xm=function(){function n(t){this.coefficients=t}return n.prototype.distortInverse=function(t){for(var e=0,r=1,i=t-this.distort(e);Math.abs(r-e)>1e-4;){var a=t-this.distort(r),o=r-a*((r-e)/(a-i));e=r,r=o,i=a}return r},n.prototype.distort=function(t){for(var e=t*t,r=0,i=0;i<this.coefficients.length;i++)r=e*(r+this.coefficients[i]);return(r+1)*t},n}(),Wm=function(){function n(){this.angularAcceleration=null,this.angularVelocity=null,this.linearAcceleration=null,this.linearVelocity=null,this.orientation=null,this.position=null}return n}(),q0=function(){function n(){this.leftDegrees=0,this.rightDegrees=0,this.upDegrees=0,this.downDegrees=0}return n}(),Zm=function(){function n(t,e,r,i){this.viewer={id:"CardboardV1",label:"Cardboard I/O 2014",fov:40,interLensDistance:.06,baselineLensDistance:.035,screenLensDistance:.042,distortionCoefficients:[.441,.156],inverseCoefficients:[-.4410035,.42756155,-.4804439,.5460139,-.58821183,.5733938,-.48303202,.33299083,-.17573841,.0651772,-.01488963,.001559834]},this.device={widthMeters:.11,heightMeters:.062,bevelMeters:.004},this.depthNear=.01,this.depthFar=1e4,this.yawOnly=r,this.accelerometer=new f.Vector3,this.gyroscope=new f.Vector3,this.filter=new jm(t,i),this.posePredictor=new Jm(e,i),this.isFirefoxAndroid=Um(),this.isIOS=pi();var a=Gl();this.isDeviceMotionInRadians=!this.isIOS&&a!==null&&a<66,this.isWithoutDeviceMotion=qm()||Hm(),this.filterToWorldQ=new f.Quaternion,pi()?this.filterToWorldQ.setFromAxisAngle(new f.Vector3(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new f.Vector3(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new f.Quaternion,this.worldToScreenQ=new f.Quaternion,this.originalPoseAdjustQ=new f.Quaternion;var o=typeof window!="undefined"?-window.orientation*Math.PI/180:0;this.originalPoseAdjustQ.setFromAxisAngle(new f.Vector3(0,0,1),o),this.setScreenTransform_(),N0()&&this.filterToWorldQ.multiply(this.inverseWorldToScreenQ),this.resetQ=new f.Quaternion,this.orientationOut_=new Float32Array(4),this.previousTimestampS=Date.now()}return n.prototype.getPosition=function(){return null},n.prototype.getOrientation=function(){var t;if(this.isWithoutDeviceMotion&&this._deviceOrientationQ){this.deviceOrientationFixQ=this.deviceOrientationFixQ||function(){var a=new f.Quaternion().setFromAxisAngle(new f.Vector3(0,0,-1),0),o=new f.Quaternion;return typeof window!="undefined"&&window.orientation===-90?o.setFromAxisAngle(new f.Vector3(0,1,0),Math.PI/-2):o.setFromAxisAngle(new f.Vector3(0,1,0),Math.PI/2),a.multiply(o)}(),this.deviceOrientationFilterToWorldQ=this.deviceOrientationFilterToWorldQ||function(){var a=new f.Quaternion;return a.setFromAxisAngle(new f.Vector3(1,0,0),-Math.PI/2),a}(),t=this._deviceOrientationQ;var e=new f.Quaternion;return e.copy(t),e.multiply(this.deviceOrientationFilterToWorldQ),e.multiply(this.resetQ),e.multiply(this.worldToScreenQ),e.multiplyQuaternions(this.deviceOrientationFixQ,e),this.yawOnly&&(e.x=0,e.z=0,e.normalize()),this.orientationOut_[0]=e.x,this.orientationOut_[1]=e.y,this.orientationOut_[2]=e.z,this.orientationOut_[3]=e.w,this.orientationOut_}else{var r=this.filter.getOrientation();t=this.posePredictor.getPrediction(r,this.gyroscope,this.previousTimestampS)}var i=new f.Quaternion;return i.copy(this.filterToWorldQ),i.multiply(this.resetQ),i.multiply(t),i.multiply(this.worldToScreenQ),this.yawOnly&&(i.x=0,i.z=0,i.normalize()),this.orientationOut_[0]=i.x,this.orientationOut_[1]=i.y,this.orientationOut_[2]=i.z,this.orientationOut_[3]=i.w,this.orientationOut_},n.prototype.getPose=function(){var t=new Wm;return t.orientation=this.getOrientation(),t},n.prototype.resetPose=function(){this.resetQ.copy(this.filter.getOrientation()),this.resetQ.x=0,this.resetQ.y=0,this.resetQ.z*=-1,this.resetQ.normalize(),N0()&&this.resetQ.multiply(this.inverseWorldToScreenQ),this.resetQ.multiply(this.originalPoseAdjustQ)},n.prototype.getFrameData=function(t){var e=this.getOrientation(),r=this.getEyeOffset(),i=this.getEyeProjectionMatrix();return t.pose.angularAcceleration=null,t.pose.angularVelocity=null,t.pose.linearAcceleration=null,t.pose.linearVelocity=null,t.pose.orientation=e,t.pose.position=null,t.timestamp=this.previousTimestampS,t.leftProjectionMatrix.set(i.left),t.rightProjectionMatrix.set(i.right),U0(t.leftViewMatrix,e,r.left),U0(t.rightViewMatrix,e,r.right),t},n.prototype.start=function(){if(typeof window=="undefined")return function(){};var t=this.onDeviceMotion_.bind(this),e=this.onOrientationChange_.bind(this),r=this.onMessage_.bind(this),i=this.onDeviceOrientation_.bind(this);return pi()&&_m()&&window.addEventListener("message",r),window.addEventListener("orientationchange",e),this.isWithoutDeviceMotion?window.addEventListener("deviceorientation",i):window.addEventListener("devicemotion",t),function(){window.removeEventListener("devicemotion",t),window.removeEventListener("deviceorientation",e),window.removeEventListener("orientationchange",e),window.removeEventListener("message",r)}},n.prototype.getEyeOffset=function(){return{left:[-this.viewer.interLensDistance*.5,0,0],right:[this.viewer.interLensDistance*.5,0,0]}},n.prototype.getEyeProjectionMatrix=function(){var t=this.getEyeFieldOfView(),e=this.depthNear,r=this.depthFar,i={left:[],right:[]};{var a=t.left.upDegrees*Qr,o=t.left.downDegrees*Qr,s=t.left.leftDegrees*Qr,u=t.left.rightDegrees*Qr,l=2/(s+u),c=2/(a+o);i.left[0]=l,i.left[1]=0,i.left[2]=0,i.left[3]=0,i.left[4]=0,i.left[5]=c,i.left[6]=0,i.left[7]=0,i.left[8]=-((s-u)*l*.5),i.left[9]=(a-o)*c*.5,i.left[10]=r/(e-r),i.left[11]=-1,i.left[12]=0,i.left[13]=0,i.left[14]=r*e/(e-r),i.left[15]=0}{var a=t.right.upDegrees*Qr,o=t.right.downDegrees*Qr,s=t.right.leftDegrees*Qr,u=t.right.rightDegrees*Qr,l=2/(s+u),c=2/(a+o);i.right[0]=l,i.right[1]=0,i.right[2]=0,i.right[3]=0,i.right[4]=0,i.right[5]=c,i.right[6]=0,i.right[7]=0,i.right[8]=-((s-u)*l*.5),i.right[9]=(a-o)*c*.5,i.right[10]=r/(e-r),i.right[11]=-1,i.right[12]=0,i.right[13]=0,i.right[14]=r*e/(e-r),i.right[15]=0}return i},n.prototype.getEyeFieldOfView=function(){var t=this.viewer,e=this.device,r=new Xm(t.distortionCoefficients),i=t.screenLensDistance,a=(e.widthMeters-t.interLensDistance)/2,o=t.interLensDistance/2,s=t.baselineLensDistance-e.bevelMeters,u=e.heightMeters-s,l=Un*Math.atan(r.distort(a/i)),c=Un*Math.atan(r.distort(o/i)),d=Un*Math.atan(r.distort(s/i)),p=Un*Math.atan(r.distort(u/i)),A=new q0,h=new q0;return A.leftDegrees=Math.min(l,t.fov),A.rightDegrees=Math.min(c,t.fov),A.downDegrees=Math.min(d,t.fov),A.upDegrees=Math.min(p,t.fov),h.leftDegrees=A.rightDegrees,h.rightDegrees=A.leftDegrees,h.upDegrees=A.upDegrees,h.downDegrees=A.downDegrees,{left:A,right:h}},n.prototype.onDeviceOrientation_=function(t){this._deviceOrientationQ=this._deviceOrientationQ||new f.Quaternion;var e=t.alpha,r=t.beta,i=t.gamma;e=(e||0)*Math.PI/180,r=(r||0)*Math.PI/180,i=(i||0)*Math.PI/180,this._deviceOrientationQ.setFromEuler(new f.Euler(e,r,-i,"YXZ"))},n.prototype.onDeviceMotion_=function(t){this.updateDeviceMotion_(t)},n.prototype.updateDeviceMotion_=function(t){var e=t.accelerationIncludingGravity,r=t.rotationRate,i=t.timeStamp/1e3,a=i-this.previousTimestampS;if(a<0){z0("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),this.previousTimestampS=i;return}else if(a<=ql||a>Hl){z0("fusion-pose-sensor:invalid:outside-threshold","Invalid timestamps detected: Timestamp from devicemotion outside expected range."),this.previousTimestampS=i;return}e&&(this.accelerometer.set(-e.x,-e.y,-e.z),r&&(Kl()?this.gyroscope.set(-r.beta,r.alpha,r.gamma):this.gyroscope.set(r.alpha,r.beta,r.gamma),this.isDeviceMotionInRadians||this.gyroscope.multiplyScalar(Math.PI/180),this.filter.addGyroMeasurement(this.gyroscope,i)),this.filter.addAccelMeasurement(this.accelerometer,i)),this.previousTimestampS=i},n.prototype.onOrientationChange_=function(){this.setScreenTransform_()},n.prototype.onMessage_=function(t){var e=t.data;if(!(!e||!e.type)){var r=e.type.toLowerCase();r==="devicemotion"&&this.updateDeviceMotion_(e.deviceMotionEvent)}},n.prototype.setScreenTransform_=function(){this.worldToScreenQ.set(0,0,0,1);var t=typeof window!="undefined"?window.orientation:0;switch(t){case 0:break;case 90:this.worldToScreenQ.setFromAxisAngle(new f.Vector3(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new f.Vector3(0,0,1),Math.PI/2);break}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},n}(),Gi=[0,0,.5,1],Ki=[.5,0,.5,1],Ym=function(){function n(t){var e=this;this.renderer=t,this.sensor=new Zm(.98,.04,!1,!1),this.scale=1,this.cameraL=new f.PerspectiveCamera,this.cameraR=new f.PerspectiveCamera;var r=this.sensor.start();this.dispose=function(){var i=e.renderer.getSize(new f.Vector2);e.renderer.setScissor(0,0,i.width,i.height),e.renderer.setViewport(0,0,i.width,i.height),e.renderer.setScissorTest(!1),r()}}return n.prototype.render=function(t,e){var r=this.renderer.getSize(new f.Vector2);if(r.width>r.height){var i=t.autoUpdate;i&&(t.updateMatrixWorld(),t.autoUpdate=!1);var a={x:Math.round(r.width*Gi[0]),y:Math.round(r.height*Gi[1]),width:Math.round(r.width*Gi[2]),height:Math.round(r.height*Gi[3])},o={x:Math.round(r.width*Ki[0]),y:Math.round(r.height*Ki[1]),width:Math.round(r.width*Ki[2]),height:Math.round(r.height*Ki[3])};this.renderer.setScissorTest(!0),this.renderer.autoClear&&this.renderer.clear(),e.parent===null&&e.updateMatrixWorld(),e.matrixWorld.decompose(this.cameraL.position,this.cameraL.quaternion,this.cameraL.scale),e.matrixWorld.decompose(this.cameraR.position,this.cameraR.quaternion,this.cameraR.scale);var s=this.sensor.getEyeOffset();this.cameraL.translateOnAxis(new f.Vector3().fromArray(s.left),this.scale),this.cameraR.translateOnAxis(new f.Vector3().fromArray(s.right),this.scale);var u=this.sensor.getEyeProjectionMatrix();this.cameraL.projectionMatrix.elements=u.left.slice(),this.cameraR.projectionMatrix.elements=u.right.slice(),this.renderer.setViewport(a.x,a.y,a.width,a.height),this.renderer.setScissor(a.x,a.y,a.width,a.height),this.renderer.render(t,this.cameraL),this.renderer.setViewport(o.x,o.y,o.width,o.height),this.renderer.setScissor(o.x,o.y,o.width,o.height),this.renderer.render(t,this.cameraR),this.renderer.setViewport(0,0,r.width,r.height),this.renderer.setScissor(0,0,r.width,r.height),this.renderer.setScissorTest(!1),i&&(t.autoUpdate=!0)}else this.renderer.render(t,e)},n.prototype.dispose=function(){},n}();const $m="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADqCAMAAAAvZYhaAAAC/VBMVEUAAAD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MDXnUBaHBwoQT9Prx4Szm3TyRodLupoMJHH5LyK+9es8+l/CKvDytukQQND8FSlFIOreGM0/omiATVapVo12xd0jhExKW5294RAc40RVoftY47cd2LKtMOFwkajzuAeVOlIhfJeKahLyiWJRhLr3Ai2BVzQYKG4lLYXfg8HCSI33a2nTH5OaVWmzYHJGhsdLmDuN2exAonBTzZIuzEUS+ec0ZMBQn+Ea5KlXNI4C/UAO/k6hKwBptJgn8fgmVckgFXML9YEEFLUKMvlqAp0eWyDEAL65dLqyWo6RekTZ2XNCsD6rgpTK/4p3WcrrPH1ghWJGhONC3JoGAkRHH1JKjpNEcCxOV2I8MWyiUJqNVajSVodgiWcVMVLVeSS1ATCZoc88qjVKlSc3kSLJ5c5V6rTZQAcVkGbBeuOkgCgq2CBM3MoFwGr1tvim2aMpZZqyBBc3N1UF2GX90j9SQJKCBB83OfYAcNVjFcSrvzo95WOShB83Ody5V24fqzO0nAUSzB/89Nph38VqmuOa3gticJOP9fApuHTDt4nFJ7AXdPC0lg8/gq8y5XapSrgpUgbQ0JpF5u97hS1fOC26nlJJA8Yd41Sg3fU4dtRQkKeXSN3jo4Qqm0397OmyZOGatoDrScBIWM3DFn5kXi1ZyqRSUoZtKOa1vWKArztqgEnhIHty4f9/btuEstKwGkxf+XuCT5CbTFnFRuxktuAAAAAElFTkSuQmCC";var lo,co={zh:{TITLE:"眼镜模式",HIT:"请将手机横屏放入 VR 眼镜中"},en:{TITLE:"GLASSES MODE",HIT:"Please put the mobile phone horizontally into the VR glasses."},ja:{TITLE:"メガネモード",HIT:"携帯電話をVRメガネに水平に入れてください。"}},H0=typeof navigator!="undefined"&&(lo=co[navigator.language.split("-")[0]])!==null&&lo!==void 0?lo:co.zh,tA=`
|
|
1597
1597
|
<style>
|
|
1598
1598
|
.$id {
|
|
1599
1599
|
all: initial;
|
|
@@ -1954,7 +1954,7 @@ void main() {
|
|
|
1954
1954
|
|
|
1955
1955
|
gl_FragColor = vec4(gl_FragColor.rgb, gl_FragColor.a * opacity * outside * inside);
|
|
1956
1956
|
}
|
|
1957
|
-
`,uA=function(n){ue(t,n);function t(){var e=n.call(this)||this;e.progress=0,e.opacity=0,e.loading=!1,e.current=!1,e.disabled=!1,e.currentMotion=new Re({ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}),e.opacityMotion=new Re({opacity:0}),e.loadingMotion=new Re({opacity:0}),e.disableMotion=new Re({opacity:0});var r={blending:f.CustomBlending,blendSrc:f.SrcAlphaFactor,blendDst:f.OneMinusSrcAlphaFactor,blendSrcAlpha:f.OneFactor,blendDstAlpha:f.OneMinusSrcAlphaFactor,depthWrite:!1,transparent:!0};return e.hitTestMesh=new f.Mesh(fo,new f.MeshBasicMaterial(O(O({},r),{color:0,opacity:0}))),e.hitTestMesh.scale.set(1.5,1.5,1.5),e.ringMesh=new f.Mesh(fo,new f.ShaderMaterial(O(O({},r),{vertexShader:oA,fragmentShader:sA,uniforms:{opacity:{value:0}}}))),e.panoMesh=new f.Mesh(fo,new f.ShaderMaterial(O(O({},r),{vertexShader:iA,fragmentShader:aA,uniforms:{circleScale:{value:1.1},circleFade:{value:0},circleOpacity:{value:.5},loadingAngle:{value:0},loadingOpacity:{value:0},opacity:{value:0},disable:{value:0}}}))),e.add(e.hitTestMesh),e.add(e.ringMesh),e.add(e.panoMesh),e.renderOrder=1e4,e.needsRender=!0,e}return t.prototype.setProgress=function(e){this.progress=e,this.setLoading(e>0)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=ce(e,0,1),this.opacityMotion.set({opacity:e},30).catch(Q))},t.prototype.setCurrent=function(e){if(this.current!==e){if(e){var r=[{progress:0,value:{ringScale:2,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.05,value:{ringScale:1,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.15,value:{ringScale:1.2,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.25,value:{ringScale:1.1,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.8,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.85,circleScale:1}},{progress:.9,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.65,circleScale:.8}},{progress:.92,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.65,circleScale:.8}},{progress:1,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.85,circleScale:1.1}}];this.currentMotion.setKeyframes(r,1500).catch(Q)}else{var r=[{progress:0,value:O({},this.currentMotion.value)},{progress:1,value:{ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}}];this.currentMotion.setKeyframes(r,200).catch(Q)}this.current=e}},t.prototype.setLoading=function(e){this.loading!==e&&(e?this.loadingMotion.setKeyframes([{progress:0,value:{opacity:0}},{progress:.3,value:{opacity:0}},{progress:1,value:{opacity:.8}}],500).catch(Q):this.loadingMotion.set({opacity:0},0).catch(Q),this.loading=e,this.disabled===!0&&this.setDisabled(!1),this.needsRender=!0)},t.prototype.setDisabled=function(e){this.disabled!==e&&(this.disabled=e,this.loading===!0&&this.setLoading(!1),this.disableMotion.set({opacity:e?1:0},300).catch(Q),this.needsRender=!0)},t.prototype.tap=function(){return Promise.resolve()},t.prototype.updateTime=function(e,r){this.opacityMotion.update(e),this.currentMotion.update(e),this.loadingMotion.update(e);var i=this.opacityMotion.value.opacity;this.visible=i!==0;var a=this.currentMotion.value,o=a.ringScale,s=a.ringOpacity,u=a.circleFade,l=a.circleOpacity,c=a.circleScale;this.ringMesh.scale.set(o,1,o),this.ringMesh.material.uniforms.opacity.value=s*i,this.panoMesh.material.uniforms.opacity.value=i,this.panoMesh.material.uniforms.circleOpacity.value=l,this.panoMesh.material.uniforms.circleScale.value=c,this.panoMesh.material.uniforms.circleFade.value=u,this.panoMesh.material.uniforms.loadingOpacity.value=this.loadingMotion.value.opacity,this.panoMesh.material.uniforms.disable.value=this.disableMotion.value.opacity,this.panoMesh.material.uniforms.loadingAngle.value=e/120%(Math.PI*2),this.needsRender=!0},t.prototype.dispose=function(){this.hitTestMesh.material.dispose(),this.ringMesh.material.dispose(),this.panoMesh.material.dispose()},t}(f.Object3D),lA=1500,cA=O({},Aa(pr,["maxLatitude","minLatitude"])),fA=function(n){ue(t,n);function t(e){var r=this,i=t.parseArgs(e);r=n.call(this,i)||this,r.mode="VRPanorama",r.cardboard=new Ym(r.renderer);var a=nA();r.helperElement=a;var o=new oi(a);return r.element.parentNode&&(r.element.parentNode.insertBefore(a,r.element),r.setHelperElementSize(),o.on("tap",function(){return r.emit("vr.requestExit",X("vr.requestExit",{}))})),r.destroyHelper=function(){o.destroy(),a.parentNode&&a.parentNode.removeChild(a),delete r.helperElement},r}return t.parseArgs=function(e){if(e instanceof t)return e;var r=O(O({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return O(O({},i),{mode:"VRPanorama"})},t.prototype.updateConfiguration=function(e){return n.prototype.updateConfiguration.call(this,O(O({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2}))},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.cardboard.dispose(),this.destroyHelper();for(var e=Object.keys(this.panoMeshes),r=0,i=e;r<i.length;r++){var a=i[r],o=this.panoMeshes[a];this.helper.remove(o),o.dispose(),delete this.panoMeshes[a]}},t.prototype.isReady=function(){return!1},t.prototype.updateRenderSize=function(){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.setHelperElementSize()},t.prototype.updateCamera=function(e,r,i){return Promise.resolve()},t.prototype.updateCameraWithKeyframes=function(e,r,i){return Promise.resolve()},t.prototype.updatePanoMeshesVisible=function(){for(var e=this.works.getResolvedObserver(this.currentPano),r=(e?e.visibleIds:[]).concat(He(this.currentPano)),i=0,a=this.works.resolvedObservers;i<a.length;i++){var o=a[i],s=this.panoMeshes[o.panoId];s&&(r.indexOf(o.panoId)>=0?s.parent!==this.helper&&this.helper.add(s):s.parent===this.helper&&(this.helper.remove(s),s.setOpacity(0)))}},t.prototype.updatePanoMeshes=function(){for(var e=Object.keys(this.panoMeshes),r=0,i=e;r<i.length;r++){var a=i[r],o=this.panoMeshes[a];this.helper.remove(o),o.dispose(),delete this.panoMeshes[a]}for(var s=0,u=this.works.resolvedObservers;s<u.length;s++){var l=u[s],c=l.panoId,d=new uA;d.name="panoSphere_".concat(c),d.position.copy(l.position),d.needsRender=!0,this.panoMeshes[c]=d}this.updatePanoMeshesVisible()},t.prototype.updateTime=function(e,r){var i=this,a,o,s,u,l,c,d,p,A,h;if(!this.destroyed){var v=this.currentPano;this.userAction=!0,this.needsRender=!0,this.modelSceneNeedsRender=!0;var g={},m={},y=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),b=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),x=!1;if(this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),g.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(ce(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var w=this.locationMotion.getKeyFrameSegment(e),M=w[0],S=w[1],E=this.panoResourceFromLocationMotionKeyframe(M),P=this.panoResourceFromLocationMotionKeyframe(S),B=E.position,C=P.position,I=this.locationMotion.value.count-S.value.count+1;g.progress=I,P.panoPicture&&(I<1?E.panoPicture&&(g.pano0=E.panoPicture):g.pano0=P.panoPicture,g.pano1=P.panoPicture),P.effect==="montage"?g.transition="BLACK":P.effect==="spread"?g.transition="SPREAD":g.transition="FADE",(P.effect==="zoomin"||P.effect==="zoomout")&&(g.progress=Math.pow(I,3)),I<1&&P.effect!=="fly"&&(g.pano0&&E.panoPicture&&(g.pano0={map:g.pano0.map,zoom:g.pano0.zoom,luminanceMap:g.pano0.luminanceMap,matrix:E.panoPicture.matrix.clone().premultiply(E.fixCameraTransform).setPosition(P.position)}),B.copy(C),x=!0),m.distance=this.locationMotion.value.distance,m.offset=new f.Vector3(B.x+(C.x-B.x)*I,B.y+(C.y-B.y)*I,B.z+(C.z-B.z)*I);for(var F=[],T=[],L=0,D=this.locationMotion.keyframes;L<D.length;L++){var V=D[L],z=V.key,U=V.progress;z!==void 0&&(F.push(z),U>this.locationMotion.progress&&T.push(z))}for(var q=0,G=Object.keys(this.panoResources);q<G.length;q++){var K=G[q];if(!(T.indexOf(K)>=0)){var _=this.panoResources[K];if(_.panoPicture){var J=_.panoPicture.map,W=_.panoPicture.luminanceMap;if(J){if(J===((a=g.pano0)===null||a===void 0?void 0:a.map)||J===((o=g.pano1)===null||o===void 0?void 0:o.map))continue;J instanceof qe&&J.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(J.cubeRenderTarget),J.dispose(),W&&(W instanceof qe&&W.cubeRenderTarget&&this.luminanceCubeRenderTargetPool.push(W.cubeRenderTarget),W.dispose()),_.panoPicture=null}}F.indexOf(K)>=0||delete this.panoResources[K]}}this.currentPano=Lt(P.panoId),this.emit("pano.moving",X("pano.moving",{userAction:this.userAction,prevPano:Lt(y.panoId),state:O(O(O(O({},Lt(b.panoId)),{mode:this.mode}),tt(this.camera.pose)),m),options:{},progress:this.locationMotion.progress,error:null}))}or(g)===!1&&(!((s=g.pano0)===null||s===void 0)&&s.map&&g.pano0.map instanceof qe&&!g.pano0.map.cubeRenderTarget&&(g.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((u=g.pano0)===null||u===void 0)&&u.luminanceMap&&g.pano0.luminanceMap instanceof qe&&!g.pano0.luminanceMap.cubeRenderTarget&&(g.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),!((l=g.pano1)===null||l===void 0)&&l.map&&g.pano1.map instanceof qe&&!g.pano1.map.cubeRenderTarget&&(g.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((c=g.pano1)===null||c===void 0)&&c.luminanceMap&&g.pano1.luminanceMap instanceof qe&&!g.pano1.luminanceMap.cubeRenderTarget&&(g.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.models.setMaterial(g)),m.offset&&this.camera.position.copy(m.offset),Ar(this.currentPano,v)&&this.updatePanoMeshesVisible();var $=this.camera.pose.longitude,Y=this.camera.pose.latitude;this.camera.quaternion.fromArray(this.cardboard.sensor.getOrientation()),this.camera.computePose();var Z=this.works.getResolvedObserver(this.currentPano);if(this.camera.pose.distance>.1||x)for(var oe=0,ne=Object.keys(this.panoMeshes);oe<ne.length;oe++){var de=ne[oe],se=this.panoMeshes[de];se.setOpacity(0),se.updateTime&&se.updateTime(e,r),se.visible=!1}else if(Z)for(var ye=Z.visibleIds.concat(He(this.currentPano)),ie=0,xe=ye;ie<xe.length;ie++){var de=xe[ie],Le=Lt(de),Ce=this.works.getResolvedObserver(Le);if(Ce){var se=this.panoMeshes[de];if(!Ce.loadable&&!Ce.active){se.setOpacity(0);continue}var Oe=se.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Oe<.05?se.setOpacity(0):se.setOpacity(ce(1.5/Oe,0,1)),Ar(this.currentPano,Le)&&se.setOpacity(0),se.lookAt(this.camera.position)}}if(this.locationMotion.ended)for(var ee=this.intersect(e),re=0,H=this.works.resolvedObservers;re<H.length;re++){var Ce=H[re],se=this.panoMeshes[Ce.panoId];se&&(se.setCurrent(se===ee),se.updateTime&&se.updateTime(e,r))}($!==this.camera.pose.longitude||Y!==this.camera.pose.latitude)&&(this.cameraMotion.set(_t(this.camera.pose,["longitude","latitude"]),0).catch(Q),this.emit("camera.update",X("camera.update",{userAction:!0,state:O(O(O({},this.currentPano),{mode:this.mode}),tt(this.camera.pose))})));var Be=this.tileLevel=function(){if(i.tileLevelForFov===!1)return 0;var we=i.renderer.getDrawingBufferSize(new f.Vector2);we.width*=i.scissor.width,we.height*=i.scissor.height;var be=b.panoId,Ae=i.works.getResolvedObserver(be),me=i.imageOptions.size;if(typeof me=="undefined"&&Ae){var ze=Ae.images.up.match(/\/cube_(\d+)\//);ze&&(me=Number(ze[1]))}typeof me=="undefined"&&(me=2048);var pe=0;me>=1024&&(pe=1),me>=2048&&(pe=2),me>=4096&&(pe=3),me>=8192&&(pe=4);var Se=i.tileLevelForFov(i.camera.fov,we);return Se>pe?Se:0}(),Te=function(){var we=i.camera.quaternion.clone(),be=i.works.getResolvedObserver(b.panoId),Ae=be!=null?be:Z;Ae&&we.premultiply(Ae.quaternion.clone().inverse());var me=new f.Matrix4().makeRotationFromQuaternion(we),ze=new f.Matrix4().getInverse(me),pe=new f.Frustum().setFromProjectionMatrix(new f.Matrix4().multiplyMatrices(i.camera.projectionMatrix,ze));return pe}();b.panoId===He(this.currentPano)&&(((d=b.panoPicture)===null||d===void 0?void 0:d.map)instanceof qe&&(b.panoPicture.map.maxRequest=this.tileMaxRequest,b.panoPicture.map.update(Te,Be),b.panoPicture.map.needsRender===!0&&(b.panoPicture.map.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)),((p=b.panoPicture)===null||p===void 0?void 0:p.luminanceMap)instanceof qe&&(b.panoPicture.luminanceMap.maxRequest=this.tileMaxRequest,b.panoPicture.luminanceMap.update(Te,Be),b.panoPicture.luminanceMap.needsRender===!0&&(b.panoPicture.luminanceMap.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)));{var Ee=this.tiling.object.visible;if(this.initAnimationed){var Qe=b.panoId,Ie=this.works.getResolvedObserver(Qe);Ie?Fi(this.camera.position,Ie.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==Qe&&this.tiling.cleanup(),this.tiling.panoId=Qe,this.tiling.setResource((h=(A=Ie.images)===null||A===void 0?void 0:A.tiles)!==null&&h!==void 0?h:[],this.enableIOSEDR&&Ie.images.luminance?Ie.images.luminance:null),this.tiling.setFetcher(pt(Ie.work)),this.tiling.setRotation(Ie.quaternion),this.tiling.setPosition(Ie.position),this.tiling.maxRequest=this.tileMaxRequest,Be>this.tiledCubeTextureLevel?this.tiling.update(Te,Be,e):this.tiling.update(Te,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;Ee!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0,this.modelSceneNeedsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e)}},t.prototype.render=function(){this.cardboard.render(this.modelScene,this.camera),this.renderer.autoClear=!1,this.cardboard.render(this.scene,this.camera),this.renderer.autoClear=!0},t.prototype.setCamera=function(e){},t.prototype.destroyHelper=function(){},t.prototype.setHelperElementSize=function(){if(this.helperElement){var e=new f.Vector2(this.element.offsetWidth,this.element.offsetHeight),r=e.x*this.scissor.left,i=e.y*(1-this.scissor.bottom-this.scissor.height),a=e.x*this.scissor.width,o=e.y*this.scissor.height;this.helperElement.style.marginLeft=r+"px",this.helperElement.style.marginTop=i+"px",this.helperElement.style.width=a+"px",this.helperElement.style.height=o+"px"}},t.prototype.intersect=function(e){var r,i;if(this.locationMotion.ended===!1){this.intersectMesh.visible=!1,delete this.activePanoMesh,delete this.activeTime;return}if(this.activePanoMesh&&this.activeTime&&e-this.activeTime>lA){for(var a=this.activePanoMesh,o=Object.keys(this.panoMeshes),s=null,u=0,l=o;u<l.length;u++){var c=l[u];if(this.panoMeshes[c]===a){s=c;break}}return s!==null&&this.moveToPano(Lt(s),{},!0),delete this.activePanoMesh,delete this.activeTime,a}var d=this.camera.getDirection(new f.Vector3),p=new f.Raycaster(this.camera.position,d);p.params.Points={threshold:.1};for(var A=void 0,h=[],v=this.works.getResolvedObserver(this.currentPano),g=v?v.visibleIds:[],m=0,y=g;m<y.length;m++){var s=y[m],b=this.panoMeshes[s],x=p.intersectObject((r=b.hitTestMesh)!==null&&r!==void 0?r:b,!0)[0];x&&h.push({panoMesh:b,intersection:O({floor:(i=v==null?void 0:v.floorIndex)!==null&&i!==void 0?i:0},x)})}var w=h.sort(function(B,C){return B.intersection.distance-C.intersection.distance})[0];w?(A=w.intersection,this.activePanoMesh!==w.panoMesh&&(this.activePanoMesh=w.panoMesh,this.activeTime=e),this.intersectMesh.position.copy(w.panoMesh.position),this.intersectMesh.lookAt(this.camera.position)):(this.activePanoMesh=void 0,this.activeTime=void 0),A||(A=this.models.intersectRaycaster(p)[0]);var M=X("intersect.update",{raycaster:p,intersection:A!=null?A:null,object:this.intersectMesh});if(this.emit("intersect.update",M),M.defaultPrevented){this.hideIntersectMesh();return}if(A&&A.face){var S=A.face.normal,E=new f.Quaternion;E.setFromUnitVectors(new f.Vector3(0,0,1),S),this.intersectMesh.quaternion.copy(E);var P=A.point.clone();this.intersectMesh.position.copy(P),w?this.intersectMesh.visible=!1:this.intersectMesh.visible=!0}else this.intersectMesh.visible=!1;return w==null?void 0:w.panoMesh},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t}(ps),dA=new f.Vector3(0,1.6,0),hA=O({},dr),pA=function(n){ue(t,n);function t(e){var r=this,i,a=t.parseArgs(e);return r=n.call(this,a)||this,r.mode="Model",r.locationMotion=new Re({x:r.camera.pose.offset.x,y:r.camera.pose.offset.y,z:r.camera.pose.offset.z,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Re({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Re({perspToOrtho:r.camera.perspToOrtho.x}),r}return t.parseArgs=function(e){return e instanceof t?e:n.parseArgs.call(this,e)},t.initAnimationEndState=function(e){var r,i,a,o,s,u,l=this.parseArgs(e),c=l.works,d=e.initial,p=d.state,A=d.currentState,h=typeof p.panoIndex=="number"?{workCode:(a=(r=p.workCode)!==null&&r!==void 0?r:(i=l.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:p.panoIndex}:{workCode:A.workCode,panoIndex:A.panoIndex},v=c.getResolvedObserver(h),g=(o=p.longitude)!==null&&o!==void 0?o:A.longitude,m=ce((s=p.latitude)!==null&&s!==void 0?s:!v||yi(A.mode)?A.latitude:l.defaultLatitude,l.minLatitude,l.maxLatitude),y=ce((u=p.fov)!==null&&u!==void 0?u:!v||yi(A.mode)?A.fov:l.defaultFov,l.minFov,l.maxFov),b=new f.Vector3;if(l.initial.state.offset)b.copy(l.initial.state.offset);else if(v)b.copy(v.position);else{var x=nr(A).setLength(A.distance);b.copy(l.initial.currentState.offset).sub(x)}return{workCode:h.workCode,panoIndex:h.panoIndex,mode:"Model",longitude:g,latitude:m,fov:y,offset:b,distance:0}},t.prototype.updateConfiguration=function(e){return n.prototype.updateConfiguration.call(this,e)},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.locationMotion.dispose()},t.prototype.isReady=function(){return this.locationMotion.ended===!1?!1:n.prototype.isReady.call(this)},t.prototype.updateWork=function(e,r,i,a){this.works=e;var o=t.initAnimationEndState(O(O({},this),{initial:{currentState:O(O({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:a}}));return this.hideIntersectMesh(),this.moveToPosition(o.offset,{duration:0,longitude:o.longitude,latitude:o.latitude,fov:o.fov},a),!0},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={},s={};return o.distance=0,e.offset!==void 0&&(o.x=e.offset.x,o.y=e.offset.y,o.z=e.offset.z),e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),a.locationMotion.set(o,r).catch(Q),a.cameraMotion.set(s,r).catch(Q)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=[],u=0,l=e;u<l.length;u++){var c=l[u];o.push({key:c.key,progress:c.progress,value:{distance:0,x:c.value.offset.x,y:c.value.offset.x,z:c.value.offset.x}}),s.push({key:c.key,progress:c.progress,value:{longitude:c.value.longitude,latitude:c.value.latitude,fov:c.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(Q),a.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={},a={};if(this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(ce(this.perspToOrthoMotion.value.perspToOrtho,0,1))),!this.locationMotion.ended){this.locationMotion.update(e),a.distance=this.locationMotion.value.distance,a.offset=new f.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z);var o=new f.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),s=this.works.resolvedObservers,u=Br(s,function(l){return l.position.distanceTo(o)});this.currentPano=u?{workCode:u.work.workCode,panoIndex:u.panoIndex}:{workCode:"",panoIndex:0}}this.cameraMotion.ended||(this.cameraMotion.update(e),a.longitude=this.cameraMotion.value.longitude,a.latitude=this.cameraMotion.value.latitude,a.fov=this.cameraMotion.value.fov),or(i)||this.models.setMaterial(i),or(a)||this.setCamera(a)}},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial;i.state,i.currentState;var a=i.duration,o=i.userAction;e.userAction=o;var s=t.initAnimationEndState(e),u={modelAlpha:1},l={perspToOrtho:0},c={longitude:s.longitude,latitude:s.latitude,fov:s.fov,duration:a,moveStartCallback:function(d){e.perspToOrthoMotion.set(l,a).catch(Q),e.modelAlphaMotion.set(u,a).catch(Q),e.emit("initAnimation.start",X("initAnimation.start",{state:d,userAction:e.userAction}))},moveEndCallback:function(d){e.emit("initAnimation.end",X("initAnimation.end",{state:d,userAction:e.userAction})),r()},moveCancelCallback:function(){var d=e.currentPano,p=O(O({},d),{mode:e.mode,longitude:e.camera.pose.longitude,latitude:e.camera.pose.latitude,fov:e.camera.pose.fov,offset:e.camera.pose.offset.clone(),distance:e.camera.pose.distance});e.emit("initAnimation.end",X("initAnimation.end",{state:p,userAction:e.userAction})),r()}};e.moveToPosition(s.offset,c,o)})},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(ve())[1],r=this.locationMotion.getKeyFrameSegment(ve())[1];return O(O({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:new f.Vector3(r.value.x,r.value.y,r.value.z),distance:r.value.distance})},t.prototype.moveToPano=function(e,r,i){r===void 0&&(r={});var a=this.works.getResolvedObserver(e);a&&this.moveToPosition(a.position,r,i)},t.prototype.moveToPosition=function(e,r,i){var a=this,o,s,u;r===void 0&&(r={}),this.userAction=i,this.stopMomentumMovement();for(var l=ve(),c=new f.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),d=c.distanceTo(e),p=this.locationMotion.getProgressVelocity(l),A=0,h=1;h<this.locationMotion.keyframes.length;h++){var v=this.locationMotion.keyframes[h-1].value,g=v.x,m=v.y,y=v.z,b=this.locationMotion.keyframes[h].value,x=b.x,w=b.y,M=b.z;A+=Math.sqrt(Math.pow(x-g,2)+Math.pow(w-m,2)+Math.pow(M-y,2))}var S=d===0?0:p*A/d,E=this.calculateMovingDuration(r.duration,d),P={x:e.x,y:e.y,z:e.z,distance:0},B={longitude:r.longitude,latitude:r.latitude,fov:r.fov},C=this.works.resolvedObservers,I=Br(C,function(D){return D.position.distanceTo(c)}),F=I?{workCode:I.work.workCode,panoIndex:I.panoIndex}:{workCode:"",panoIndex:0},T=O(O({},F),{mode:this.mode,longitude:(o=B.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=B.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(u=B.fov)!==null&&u!==void 0?u:this.camera.pose.fov,offset:e.clone(),distance:0}),L=this.currentPano;this.emit("pano.moveTo",X("pano.moveTo",{options:r,prevPano:L,progress:0,state:T,userAction:this.userAction,error:null})),r.moveStartCallback&&r.moveStartCallback(T),this.cameraMotion.set(B,E).catch(Q),this.locationMotion.set(P,E,S).then(function(){for(var D=0,V=a.models;D<V.length;D++){var z=V[D];z.show()}var U=O(O(O({},F),{mode:a.mode}),tt(a.camera.pose));a.emit("pano.arrived",X("pano.arrived",{options:r,prevPano:L,progress:0,state:U,userAction:a.userAction,error:null})),r.moveEndCallback&&r.moveEndCallback(U)},function(){r.moveCancelCallback&&r.moveCancelCallback(),a.emit("pano.cancel",X("pano.cancel",{options:r,prevPano:L,progress:0,state:T,userAction:a.userAction,error:null}))})},t.prototype.onTapGesture=function(e){var r=e.center.raycaster;this.stopMomentumMovement();var i=this.models.intersectRaycaster(r)[0];if(i&&i.face){var a=i.face.normal,o=i.point;if(new f.Vector3(0,1,0).angleTo(a)>Math.PI/3){var s=a.clone().setLength(.3).add(o);r.set(s,new f.Vector3(0,-1,0)),i=this.models.intersectRaycaster(r)[0]}}if(i){var u=new f.Vector3().copy(i.point).add(dA),l=this.works.resolvedObservers,c=Br(l,function(A){return A.position.distanceTo(u)},!0),d=c[0],p=c[1];d&&p<5&&(u.y=d.position.y),e.state.offset.copy(u),e.state.distance=0,this.emit("gesture.tap",e),e.defaultPrevented||this.moveToPosition(u,{},!0)}else this.emit("gesture.tap",e),e.defaultPrevented||this.cameraBounce()},t}(Ql);const vA=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}(`}rpvv|{-zrqvz}-sy|nH}rpvv|{-zrqvz}-v{Hnvor-rp@-}|vv|{Hnvor-rp?-H{vs|z-znA-}|wrpv|{Znv\x07H{vs|z-znA-z|qrycvrZnv\x07Hn\bv{t-rp?-bH|vq-znv{56-
|
|
1957
|
+
`,uA=function(n){ue(t,n);function t(){var e=n.call(this)||this;e.progress=0,e.opacity=0,e.loading=!1,e.current=!1,e.disabled=!1,e.currentMotion=new Re({ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}),e.opacityMotion=new Re({opacity:0}),e.loadingMotion=new Re({opacity:0}),e.disableMotion=new Re({opacity:0});var r={blending:f.CustomBlending,blendSrc:f.SrcAlphaFactor,blendDst:f.OneMinusSrcAlphaFactor,blendSrcAlpha:f.OneFactor,blendDstAlpha:f.OneMinusSrcAlphaFactor,depthWrite:!1,transparent:!0};return e.hitTestMesh=new f.Mesh(fo,new f.MeshBasicMaterial(O(O({},r),{color:0,opacity:0}))),e.hitTestMesh.scale.set(1.5,1.5,1.5),e.ringMesh=new f.Mesh(fo,new f.ShaderMaterial(O(O({},r),{vertexShader:oA,fragmentShader:sA,uniforms:{opacity:{value:0}}}))),e.panoMesh=new f.Mesh(fo,new f.ShaderMaterial(O(O({},r),{vertexShader:iA,fragmentShader:aA,uniforms:{circleScale:{value:1.1},circleFade:{value:0},circleOpacity:{value:.5},loadingAngle:{value:0},loadingOpacity:{value:0},opacity:{value:0},disable:{value:0}}}))),e.add(e.hitTestMesh),e.add(e.ringMesh),e.add(e.panoMesh),e.renderOrder=1e4,e.needsRender=!0,e}return t.prototype.setProgress=function(e){this.progress=e,this.setLoading(e>0)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=ce(e,0,1),this.opacityMotion.set({opacity:e},30).catch(Q))},t.prototype.setCurrent=function(e){if(this.current!==e){if(e){var r=[{progress:0,value:{ringScale:2,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.05,value:{ringScale:1,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.15,value:{ringScale:1.2,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.25,value:{ringScale:1.1,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.8,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.85,circleScale:1}},{progress:.9,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.65,circleScale:.8}},{progress:.92,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.65,circleScale:.8}},{progress:1,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.85,circleScale:1.1}}];this.currentMotion.setKeyframes(r,1500).catch(Q)}else{var r=[{progress:0,value:O({},this.currentMotion.value)},{progress:1,value:{ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}}];this.currentMotion.setKeyframes(r,200).catch(Q)}this.current=e}},t.prototype.setLoading=function(e){this.loading!==e&&(e?this.loadingMotion.setKeyframes([{progress:0,value:{opacity:0}},{progress:.3,value:{opacity:0}},{progress:1,value:{opacity:.8}}],500).catch(Q):this.loadingMotion.set({opacity:0},0).catch(Q),this.loading=e,this.disabled===!0&&this.setDisabled(!1),this.needsRender=!0)},t.prototype.setDisabled=function(e){this.disabled!==e&&(this.disabled=e,this.loading===!0&&this.setLoading(!1),this.disableMotion.set({opacity:e?1:0},300).catch(Q),this.needsRender=!0)},t.prototype.tap=function(){return Promise.resolve()},t.prototype.updateTime=function(e,r){this.opacityMotion.update(e),this.currentMotion.update(e),this.loadingMotion.update(e);var i=this.opacityMotion.value.opacity;this.visible=i!==0;var a=this.currentMotion.value,o=a.ringScale,s=a.ringOpacity,u=a.circleFade,l=a.circleOpacity,c=a.circleScale;this.ringMesh.scale.set(o,1,o),this.ringMesh.material.uniforms.opacity.value=s*i,this.panoMesh.material.uniforms.opacity.value=i,this.panoMesh.material.uniforms.circleOpacity.value=l,this.panoMesh.material.uniforms.circleScale.value=c,this.panoMesh.material.uniforms.circleFade.value=u,this.panoMesh.material.uniforms.loadingOpacity.value=this.loadingMotion.value.opacity,this.panoMesh.material.uniforms.disable.value=this.disableMotion.value.opacity,this.panoMesh.material.uniforms.loadingAngle.value=e/120%(Math.PI*2),this.needsRender=!0},t.prototype.dispose=function(){this.hitTestMesh.material.dispose(),this.ringMesh.material.dispose(),this.panoMesh.material.dispose()},t}(f.Object3D),lA=1500,cA=O({},Aa(pr,["maxLatitude","minLatitude"])),fA=function(n){ue(t,n);function t(e){var r=this,i=t.parseArgs(e);r=n.call(this,i)||this,r.mode="VRPanorama",r.cardboard=new Ym(r.renderer);var a=nA();r.helperElement=a;var o=new oi(a);return r.element.parentNode&&(r.element.parentNode.insertBefore(a,r.element),r.setHelperElementSize(),o.on("tap",function(){return r.emit("vr.requestExit",X("vr.requestExit",{}))})),r.destroyHelper=function(){o.destroy(),a.parentNode&&a.parentNode.removeChild(a),delete r.helperElement},r}return t.parseArgs=function(e){if(e instanceof t)return e;var r=O(O({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return O(O({},i),{mode:"VRPanorama"})},t.prototype.updateConfiguration=function(e){return n.prototype.updateConfiguration.call(this,O(O({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2}))},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.cardboard.dispose(),this.destroyHelper();for(var e=Object.keys(this.panoMeshes),r=0,i=e;r<i.length;r++){var a=i[r],o=this.panoMeshes[a];this.helper.remove(o),o.dispose(),delete this.panoMeshes[a]}},t.prototype.isReady=function(){return!1},t.prototype.updateRenderSize=function(){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.setHelperElementSize()},t.prototype.updateCamera=function(e,r,i){return Promise.resolve()},t.prototype.updateCameraWithKeyframes=function(e,r,i){return Promise.resolve()},t.prototype.updatePanoMeshesVisible=function(){for(var e=this.works.getResolvedObserver(this.currentPano),r=(e?e.visibleIds:[]).concat(He(this.currentPano)),i=0,a=this.works.resolvedObservers;i<a.length;i++){var o=a[i],s=this.panoMeshes[o.panoId];s&&(r.indexOf(o.panoId)>=0?s.parent!==this.helper&&this.helper.add(s):s.parent===this.helper&&(this.helper.remove(s),s.setOpacity(0)))}},t.prototype.updatePanoMeshes=function(){for(var e=Object.keys(this.panoMeshes),r=0,i=e;r<i.length;r++){var a=i[r],o=this.panoMeshes[a];this.helper.remove(o),o.dispose(),delete this.panoMeshes[a]}for(var s=0,u=this.works.resolvedObservers;s<u.length;s++){var l=u[s],c=l.panoId,d=new uA;d.name="panoSphere_".concat(c),d.position.copy(l.position),d.needsRender=!0,this.panoMeshes[c]=d}this.updatePanoMeshesVisible()},t.prototype.updateTime=function(e,r){var i=this,a,o,s,u,l,c,d,p,A,h;if(!this.destroyed){var v=this.currentPano;this.userAction=!0,this.needsRender=!0,this.modelSceneNeedsRender=!0;var g={},m={},y=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),b=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),x=!1;if(this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),g.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(ce(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var w=this.locationMotion.getKeyFrameSegment(e),M=w[0],S=w[1],E=this.panoResourceFromLocationMotionKeyframe(M),B=this.panoResourceFromLocationMotionKeyframe(S),R=E.position,C=B.position,I=this.locationMotion.value.count-S.value.count+1;g.progress=I,B.panoPicture&&(I<1?E.panoPicture&&(g.pano0=E.panoPicture):g.pano0=B.panoPicture,g.pano1=B.panoPicture),B.effect==="montage"?g.transition="BLACK":B.effect==="spread"?g.transition="SPREAD":g.transition="FADE",(B.effect==="zoomin"||B.effect==="zoomout")&&(g.progress=Math.pow(I,3)),I<1&&B.effect!=="fly"&&(g.pano0&&E.panoPicture&&(g.pano0={map:g.pano0.map,zoom:g.pano0.zoom,luminanceMap:g.pano0.luminanceMap,matrix:E.panoPicture.matrix.clone().premultiply(E.fixCameraTransform).setPosition(B.position)}),R.copy(C),x=!0),m.distance=this.locationMotion.value.distance,m.offset=new f.Vector3(R.x+(C.x-R.x)*I,R.y+(C.y-R.y)*I,R.z+(C.z-R.z)*I);for(var L=[],T=[],F=0,D=this.locationMotion.keyframes;F<D.length;F++){var V=D[F],z=V.key,U=V.progress;z!==void 0&&(L.push(z),U>this.locationMotion.progress&&T.push(z))}for(var q=0,G=Object.keys(this.panoResources);q<G.length;q++){var K=G[q];if(!(T.indexOf(K)>=0)){var j=this.panoResources[K];if(j.panoPicture){var J=j.panoPicture.map,W=j.panoPicture.luminanceMap;if(J){if(J===((a=g.pano0)===null||a===void 0?void 0:a.map)||J===((o=g.pano1)===null||o===void 0?void 0:o.map))continue;J instanceof qe&&J.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(J.cubeRenderTarget),J.dispose(),W&&(W instanceof qe&&W.cubeRenderTarget&&this.luminanceCubeRenderTargetPool.push(W.cubeRenderTarget),W.dispose()),j.panoPicture=null}}L.indexOf(K)>=0||delete this.panoResources[K]}}this.currentPano=Lt(B.panoId),this.emit("pano.moving",X("pano.moving",{userAction:this.userAction,prevPano:Lt(y.panoId),state:O(O(O(O({},Lt(b.panoId)),{mode:this.mode}),tt(this.camera.pose)),m),options:{},progress:this.locationMotion.progress,error:null}))}ar(g)===!1&&(!((s=g.pano0)===null||s===void 0)&&s.map&&g.pano0.map instanceof qe&&!g.pano0.map.cubeRenderTarget&&(g.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((u=g.pano0)===null||u===void 0)&&u.luminanceMap&&g.pano0.luminanceMap instanceof qe&&!g.pano0.luminanceMap.cubeRenderTarget&&(g.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),!((l=g.pano1)===null||l===void 0)&&l.map&&g.pano1.map instanceof qe&&!g.pano1.map.cubeRenderTarget&&(g.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((c=g.pano1)===null||c===void 0)&&c.luminanceMap&&g.pano1.luminanceMap instanceof qe&&!g.pano1.luminanceMap.cubeRenderTarget&&(g.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.models.setMaterial(g)),m.offset&&this.camera.position.copy(m.offset),Ar(this.currentPano,v)&&this.updatePanoMeshesVisible();var $=this.camera.pose.longitude,Y=this.camera.pose.latitude;this.camera.quaternion.fromArray(this.cardboard.sensor.getOrientation()),this.camera.computePose();var Z=this.works.getResolvedObserver(this.currentPano);if(this.camera.pose.distance>.1||x)for(var oe=0,ne=Object.keys(this.panoMeshes);oe<ne.length;oe++){var de=ne[oe],se=this.panoMeshes[de];se.setOpacity(0),se.updateTime&&se.updateTime(e,r),se.visible=!1}else if(Z)for(var ye=Z.visibleIds.concat(He(this.currentPano)),ie=0,xe=ye;ie<xe.length;ie++){var de=xe[ie],Le=Lt(de),Ce=this.works.getResolvedObserver(Le);if(Ce){var se=this.panoMeshes[de];if(!Ce.loadable&&!Ce.active){se.setOpacity(0);continue}var Oe=se.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Oe<.05?se.setOpacity(0):se.setOpacity(ce(1.5/Oe,0,1)),Ar(this.currentPano,Le)&&se.setOpacity(0),se.lookAt(this.camera.position)}}if(this.locationMotion.ended)for(var ee=this.intersect(e),re=0,H=this.works.resolvedObservers;re<H.length;re++){var Ce=H[re],se=this.panoMeshes[Ce.panoId];se&&(se.setCurrent(se===ee),se.updateTime&&se.updateTime(e,r))}($!==this.camera.pose.longitude||Y!==this.camera.pose.latitude)&&(this.cameraMotion.set(Jt(this.camera.pose,["longitude","latitude"]),0).catch(Q),this.emit("camera.update",X("camera.update",{userAction:!0,state:O(O(O({},this.currentPano),{mode:this.mode}),tt(this.camera.pose))})));var Be=this.tileLevel=function(){if(i.tileLevelForFov===!1)return 0;var we=i.renderer.getDrawingBufferSize(new f.Vector2);we.width*=i.scissor.width,we.height*=i.scissor.height;var be=b.panoId,Ae=i.works.getResolvedObserver(be),me=i.imageOptions.size;if(typeof me=="undefined"&&Ae){var ze=Ae.images.up.match(/\/cube_(\d+)\//);ze&&(me=Number(ze[1]))}typeof me=="undefined"&&(me=2048);var pe=0;me>=1024&&(pe=1),me>=2048&&(pe=2),me>=4096&&(pe=3),me>=8192&&(pe=4);var Se=i.tileLevelForFov(i.camera.fov,we);return Se>pe?Se:0}(),Te=function(){var we=i.camera.quaternion.clone(),be=i.works.getResolvedObserver(b.panoId),Ae=be!=null?be:Z;Ae&&we.premultiply(Ae.quaternion.clone().inverse());var me=new f.Matrix4().makeRotationFromQuaternion(we),ze=new f.Matrix4().getInverse(me),pe=new f.Frustum().setFromProjectionMatrix(new f.Matrix4().multiplyMatrices(i.camera.projectionMatrix,ze));return pe}();b.panoId===He(this.currentPano)&&(((d=b.panoPicture)===null||d===void 0?void 0:d.map)instanceof qe&&(b.panoPicture.map.maxRequest=this.tileMaxRequest,b.panoPicture.map.update(Te,Be),b.panoPicture.map.needsRender===!0&&(b.panoPicture.map.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)),((p=b.panoPicture)===null||p===void 0?void 0:p.luminanceMap)instanceof qe&&(b.panoPicture.luminanceMap.maxRequest=this.tileMaxRequest,b.panoPicture.luminanceMap.update(Te,Be),b.panoPicture.luminanceMap.needsRender===!0&&(b.panoPicture.luminanceMap.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)));{var Ee=this.tiling.object.visible;if(this.initAnimationed){var Qe=b.panoId,Ie=this.works.getResolvedObserver(Qe);Ie?Fi(this.camera.position,Ie.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==Qe&&this.tiling.cleanup(),this.tiling.panoId=Qe,this.tiling.setResource((h=(A=Ie.images)===null||A===void 0?void 0:A.tiles)!==null&&h!==void 0?h:[],this.enableIOSEDR&&Ie.images.luminance?Ie.images.luminance:null),this.tiling.setFetcher(pt(Ie.work)),this.tiling.setRotation(Ie.quaternion),this.tiling.setPosition(Ie.position),this.tiling.maxRequest=this.tileMaxRequest,Be>this.tiledCubeTextureLevel?this.tiling.update(Te,Be,e):this.tiling.update(Te,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;Ee!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0,this.modelSceneNeedsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e)}},t.prototype.render=function(){this.cardboard.render(this.modelScene,this.camera),this.renderer.autoClear=!1,this.cardboard.render(this.scene,this.camera),this.renderer.autoClear=!0},t.prototype.setCamera=function(e){},t.prototype.destroyHelper=function(){},t.prototype.setHelperElementSize=function(){if(this.helperElement){var e=new f.Vector2(this.element.offsetWidth,this.element.offsetHeight),r=e.x*this.scissor.left,i=e.y*(1-this.scissor.bottom-this.scissor.height),a=e.x*this.scissor.width,o=e.y*this.scissor.height;this.helperElement.style.marginLeft=r+"px",this.helperElement.style.marginTop=i+"px",this.helperElement.style.width=a+"px",this.helperElement.style.height=o+"px"}},t.prototype.intersect=function(e){var r,i;if(this.locationMotion.ended===!1){this.intersectMesh.visible=!1,delete this.activePanoMesh,delete this.activeTime;return}if(this.activePanoMesh&&this.activeTime&&e-this.activeTime>lA){for(var a=this.activePanoMesh,o=Object.keys(this.panoMeshes),s=null,u=0,l=o;u<l.length;u++){var c=l[u];if(this.panoMeshes[c]===a){s=c;break}}return s!==null&&this.moveToPano(Lt(s),{},!0),delete this.activePanoMesh,delete this.activeTime,a}var d=this.camera.getDirection(new f.Vector3),p=new f.Raycaster(this.camera.position,d);p.params.Points={threshold:.1};for(var A=void 0,h=[],v=this.works.getResolvedObserver(this.currentPano),g=v?v.visibleIds:[],m=0,y=g;m<y.length;m++){var s=y[m],b=this.panoMeshes[s],x=p.intersectObject((r=b.hitTestMesh)!==null&&r!==void 0?r:b,!0)[0];x&&h.push({panoMesh:b,intersection:O({floor:(i=v==null?void 0:v.floorIndex)!==null&&i!==void 0?i:0},x)})}var w=h.sort(function(R,C){return R.intersection.distance-C.intersection.distance})[0];w?(A=w.intersection,this.activePanoMesh!==w.panoMesh&&(this.activePanoMesh=w.panoMesh,this.activeTime=e),this.intersectMesh.position.copy(w.panoMesh.position),this.intersectMesh.lookAt(this.camera.position)):(this.activePanoMesh=void 0,this.activeTime=void 0),A||(A=this.models.intersectRaycaster(p)[0]);var M=X("intersect.update",{raycaster:p,intersection:A!=null?A:null,object:this.intersectMesh});if(this.emit("intersect.update",M),M.defaultPrevented){this.hideIntersectMesh();return}if(A&&A.face){var S=A.face.normal,E=new f.Quaternion;E.setFromUnitVectors(new f.Vector3(0,0,1),S),this.intersectMesh.quaternion.copy(E);var B=A.point.clone();this.intersectMesh.position.copy(B),w?this.intersectMesh.visible=!1:this.intersectMesh.visible=!0}else this.intersectMesh.visible=!1;return w==null?void 0:w.panoMesh},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t}(ps),dA=new f.Vector3(0,1.6,0),hA=O({},dr),pA=function(n){ue(t,n);function t(e){var r=this,i,a=t.parseArgs(e);return r=n.call(this,a)||this,r.mode="Model",r.locationMotion=new Re({x:r.camera.pose.offset.x,y:r.camera.pose.offset.y,z:r.camera.pose.offset.z,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Re({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Re({perspToOrtho:r.camera.perspToOrtho.x}),r}return t.parseArgs=function(e){return e instanceof t?e:n.parseArgs.call(this,e)},t.initAnimationEndState=function(e){var r,i,a,o,s,u,l=this.parseArgs(e),c=l.works,d=e.initial,p=d.state,A=d.currentState,h=typeof p.panoIndex=="number"?{workCode:(a=(r=p.workCode)!==null&&r!==void 0?r:(i=l.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:p.panoIndex}:{workCode:A.workCode,panoIndex:A.panoIndex},v=c.getResolvedObserver(h),g=(o=p.longitude)!==null&&o!==void 0?o:A.longitude,m=ce((s=p.latitude)!==null&&s!==void 0?s:!v||yi(A.mode)?A.latitude:l.defaultLatitude,l.minLatitude,l.maxLatitude),y=ce((u=p.fov)!==null&&u!==void 0?u:!v||yi(A.mode)?A.fov:l.defaultFov,l.minFov,l.maxFov),b=new f.Vector3;if(l.initial.state.offset)b.copy(l.initial.state.offset);else if(v)b.copy(v.position);else{var x=Ut(A).setLength(A.distance);b.copy(l.initial.currentState.offset).sub(x)}return{workCode:h.workCode,panoIndex:h.panoIndex,mode:"Model",longitude:g,latitude:m,fov:y,offset:b,distance:0}},t.prototype.updateConfiguration=function(e){return n.prototype.updateConfiguration.call(this,e)},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.locationMotion.dispose()},t.prototype.isReady=function(){return this.locationMotion.ended===!1?!1:n.prototype.isReady.call(this)},t.prototype.updateWork=function(e,r,i,a){this.works=e;var o=t.initAnimationEndState(O(O({},this),{initial:{currentState:O(O({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:a}}));return this.hideIntersectMesh(),this.moveToPosition(o.offset,{duration:0,longitude:o.longitude,latitude:o.latitude,fov:o.fov},a),!0},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={},s={};return o.distance=0,e.offset!==void 0&&(o.x=e.offset.x,o.y=e.offset.y,o.z=e.offset.z),e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),a.locationMotion.set(o,r).catch(Q),a.cameraMotion.set(s,r).catch(Q)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=[],u=0,l=e;u<l.length;u++){var c=l[u];o.push({key:c.key,progress:c.progress,value:{distance:0,x:c.value.offset.x,y:c.value.offset.x,z:c.value.offset.x}}),s.push({key:c.key,progress:c.progress,value:{longitude:c.value.longitude,latitude:c.value.latitude,fov:c.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(Q),a.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={},a={};if(this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(ce(this.perspToOrthoMotion.value.perspToOrtho,0,1))),!this.locationMotion.ended){this.locationMotion.update(e),a.distance=this.locationMotion.value.distance,a.offset=new f.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z);var o=new f.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),s=this.works.resolvedObservers,u=Br(s,function(l){return l.position.distanceTo(o)});this.currentPano=u?{workCode:u.work.workCode,panoIndex:u.panoIndex}:{workCode:"",panoIndex:0}}this.cameraMotion.ended||(this.cameraMotion.update(e),a.longitude=this.cameraMotion.value.longitude,a.latitude=this.cameraMotion.value.latitude,a.fov=this.cameraMotion.value.fov),ar(i)||this.models.setMaterial(i),ar(a)||this.setCamera(a)}},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial;i.state,i.currentState;var a=i.duration,o=i.userAction;e.userAction=o;var s=t.initAnimationEndState(e),u={modelAlpha:1},l={perspToOrtho:0},c={longitude:s.longitude,latitude:s.latitude,fov:s.fov,duration:a,moveStartCallback:function(d){e.perspToOrthoMotion.set(l,a).catch(Q),e.modelAlphaMotion.set(u,a).catch(Q),e.emit("initAnimation.start",X("initAnimation.start",{state:d,userAction:e.userAction}))},moveEndCallback:function(d){e.emit("initAnimation.end",X("initAnimation.end",{state:d,userAction:e.userAction})),r()},moveCancelCallback:function(){var d=e.currentPano,p=O(O({},d),{mode:e.mode,longitude:e.camera.pose.longitude,latitude:e.camera.pose.latitude,fov:e.camera.pose.fov,offset:e.camera.pose.offset.clone(),distance:e.camera.pose.distance});e.emit("initAnimation.end",X("initAnimation.end",{state:p,userAction:e.userAction})),r()}};e.moveToPosition(s.offset,c,o)})},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(ve())[1],r=this.locationMotion.getKeyFrameSegment(ve())[1];return O(O({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:new f.Vector3(r.value.x,r.value.y,r.value.z),distance:r.value.distance})},t.prototype.moveToPano=function(e,r,i){r===void 0&&(r={});var a=this.works.getResolvedObserver(e);a&&this.moveToPosition(a.position,r,i)},t.prototype.moveToPosition=function(e,r,i){var a=this,o,s,u;r===void 0&&(r={}),this.userAction=i,this.stopMomentumMovement();for(var l=ve(),c=new f.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),d=c.distanceTo(e),p=this.locationMotion.getProgressVelocity(l),A=0,h=1;h<this.locationMotion.keyframes.length;h++){var v=this.locationMotion.keyframes[h-1].value,g=v.x,m=v.y,y=v.z,b=this.locationMotion.keyframes[h].value,x=b.x,w=b.y,M=b.z;A+=Math.sqrt(Math.pow(x-g,2)+Math.pow(w-m,2)+Math.pow(M-y,2))}var S=d===0?0:p*A/d,E=this.calculateMovingDuration(r.duration,d),B={x:e.x,y:e.y,z:e.z,distance:0},R={longitude:r.longitude,latitude:r.latitude,fov:r.fov},C=this.works.resolvedObservers,I=Br(C,function(D){return D.position.distanceTo(c)}),L=I?{workCode:I.work.workCode,panoIndex:I.panoIndex}:{workCode:"",panoIndex:0},T=O(O({},L),{mode:this.mode,longitude:(o=R.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=R.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(u=R.fov)!==null&&u!==void 0?u:this.camera.pose.fov,offset:e.clone(),distance:0}),F=this.currentPano;this.emit("pano.moveTo",X("pano.moveTo",{options:r,prevPano:F,progress:0,state:T,userAction:this.userAction,error:null})),r.moveStartCallback&&r.moveStartCallback(T),this.cameraMotion.set(R,E).catch(Q),this.locationMotion.set(B,E,S).then(function(){for(var D=0,V=a.models;D<V.length;D++){var z=V[D];z.show()}var U=O(O(O({},L),{mode:a.mode}),tt(a.camera.pose));a.emit("pano.arrived",X("pano.arrived",{options:r,prevPano:F,progress:0,state:U,userAction:a.userAction,error:null})),r.moveEndCallback&&r.moveEndCallback(U)},function(){r.moveCancelCallback&&r.moveCancelCallback(),a.emit("pano.cancel",X("pano.cancel",{options:r,prevPano:F,progress:0,state:T,userAction:a.userAction,error:null}))})},t.prototype.onTapGesture=function(e){var r=e.center.raycaster;this.stopMomentumMovement();var i=this.models.intersectRaycaster(r)[0];if(i&&i.face){var a=i.face.normal,o=i.point;if(new f.Vector3(0,1,0).angleTo(a)>Math.PI/3){var s=a.clone().setLength(.3).add(o);r.set(s,new f.Vector3(0,-1,0)),i=this.models.intersectRaycaster(r)[0]}}if(i){var u=new f.Vector3().copy(i.point).add(dA),l=this.works.resolvedObservers,c=Br(l,function(A){return A.position.distanceTo(u)},!0),d=c[0],p=c[1];d&&p<5&&(u.y=d.position.y),e.state.offset.copy(u),e.state.distance=0,this.emit("gesture.tap",e),e.defaultPrevented||this.moveToPosition(u,{},!0)}else this.emit("gesture.tap",e),e.defaultPrevented||this.cameraBounce()},t}(Ql);const vA=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}(`}rpvv|{-zrqvz}-sy|nH}rpvv|{-zrqvz}-v{Hnvor-rp@-}|vv|{Hnvor-rp?-H{vs|z-znA-}|wrpv|{Znv\x07H{vs|z-znA-z|qrycvrZnv\x07Hn\bv{t-rp?-bH|vq-znv{56-
|
|
1958
1958
|
b-J-HrpA-z]|vv|{-J-z|qrycvrZnv\x07-7-rpA5}|vv|{9>;=6Htyl]|vv|{-J-}|wrpv|{Znv\x07-7-z]|vv|{H\f`),mA=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}(`0r\x07r{v|{-TYlRealsntlqr}u-G-r{noyr<<<<-nqn}rq-s|z-ur-RQY-unqr-p|qr-s|z-Puvvn{-O|pur{\b-v{-py|q-p|z}nrG<<-u}G<<tvuo;p|z<py|qp|z}nr<{x<rr<znr<}ytv{<\0RQY<unqr<RQY<<}rpvv|{-zrqvz}-sy|nH}rpvv|{-zrqvz}-v{H{vs|z-sy|n-prr{dvquH{vs|z-sy|n-prr{UrvtuH{vs|z-rp?-{rvtuo|h[RVTUO\\b_lP\\b[ajH{vs|z-sy|n-rqy\`r{tuH{vs|z-sy|n-nqvH{vs|z-sy|n-|}npv\bH{vs|z-sy|n-[rnH{vs|z-sy|n-SnH{vs|z-znA-]|wH{vs|z-nz}yr?Q-RQYP|y|Hn\bv{t-rp?-bHsy|n-r}|{r5sy|n-qr}u6
|
|
1959
1959
|
--rp?-_nqv-J-nqv-<-rp?5prr{dvqu9-prr{Urvtu6H--sy|n-z-J-=;=H--s|5v{-v-J-=H-v-I-[RVTUO\\b_lP\\b[aH-v886
|
|
1960
1960
|
----rp?-[rvtuo|-J-b-8-_nqv-7-{rvtuo|hvjH----sy|n-{rvtuo|Qr}u-J-r\x07r?Q5RQYP|y|9-[rvtuo|6;nH----{rvtuo|Qr}u-J-5{rvtuo|Qr}u-JJ->;=6-L-=;=-G-{rvtuo|Qr}uH----vs5{rvtuo|Qr}u-.J-=;=6
|
|
@@ -1963,11 +1963,11 @@ void main() {
|
|
|
1963
1963
|
--------z-8J-zn\x075=;=9-qr}u-:-{rvtuo|Qr}u6H------\f----\f--\f--r{-z-<-sy|n5[RVTUO\\b_lP\\b[a6H\f|vq-znv{56
|
|
1964
1964
|
--rpA-pRQY-J-r\x07r?Q5RQYP|y|9-b6H--sy|n-qr}u-J-pRQY;nH--qr}u-J-5qr}u-JJ->;=6-L-=;=-G-qr}uH--sy|n-r-J-r}|{r5qr}u6H--sy|n-unqr-J-r\x07}5:r-7-@==;=-7-rqy\`r{tu6H--tylSntP|y|-J-rpA5pRQY;to-7-unqr9-|}npv\b6H--
|
|
1965
1965
|
-<<-vr-rtyn-u\b}ro|yvp-qr}u-nyr-|-qr}u-ossr----sy|n-qy-J-}|5?;=9-qr}u6H----rpA-q}-J-]|w-7-rpA5=;=9-=;=9-:qy9->;=6H----sy|n-} -J-q}; -<-q};H----sy|n-sntQr}u-J-5} -8->;=6-<-?;=H----<<-tylSntQr}uRea-J-sntQr}uH--\f--vs5qr}u-JJ-=;=6
|
|
1966
|
-
----qvpnqH--\f\f`);var AA=function(n){ue(t,n);function t(e){var r=n.call(this)||this;return r.uniforms={screenWidth
|
|
1967
|
-
`,e},t.prototype.updateShaderSource=function(){var e=this.getDefines()+vA,r=this.getDefines()+mA;this.setValues({vertexShader:e,fragmentShader:r}),this.needsUpdate=!0},
|
|
1966
|
+
----qvpnqH--\f\f`);var AA=function(n){ue(t,n);function t(e){var r=n.call(this)||this;return r.uniforms={screenWidth:$t("f",0),screenHeight:$t("f",0),edlStrength:$t("f",1),uNear:$t("f",1),uFar:$t("f",1),radius:$t("f",1),neighbours:$t("2fv",new Float32Array),depthMap:$t("t",new f.Texture),uEDLColor:$t("t",new f.Texture),uEDLDepth:$t("t",new f.Texture),opacity:$t("f",1),uProj:$t("Matrix4fv",new Float32Array)},r.neighbourCount=8,r.updateShaderSource(),r.transparent=!0,r}return t.prototype.getUniform=function(e){return this.uniforms===void 0?void 0:this.uniforms[e].value},t.prototype.setUniform=function(e,r){if(this.uniforms!==void 0){var i=this.uniforms[e];i.value=r}},t.prototype.getDefines=function(){var e="";return e+="#define NEIGHBOUR_COUNT "+this.neighbourCount+`
|
|
1967
|
+
`,e},t.prototype.updateShaderSource=function(){var e=this.getDefines()+vA,r=this.getDefines()+mA;this.setValues({vertexShader:e,fragmentShader:r}),this.needsUpdate=!0},Gt([cr("screenWidth"),Kt("design:type",Number)],t.prototype,"screenWidth",void 0),Gt([cr("screenHeight"),Kt("design:type",Number)],t.prototype,"screenHeight",void 0),Gt([cr("edlStrength"),Kt("design:type",Number)],t.prototype,"edlStrength",void 0),Gt([cr("uNear"),Kt("design:type",Number)],t.prototype,"uNear",void 0),Gt([cr("uFar"),Kt("design:type",Number)],t.prototype,"uFar",void 0),Gt([cr("radius"),Kt("design:type",Number)],t.prototype,"radius",void 0),Gt([cr("neighbours",!0),Kt("design:type",Float32Array)],t.prototype,"neighbours",void 0),Gt([cr("depthMap"),Kt("design:type",f.Texture)],t.prototype,"depthMap",void 0),Gt([cr("uEDLColor"),Kt("design:type",f.Texture)],t.prototype,"uEDLColor",void 0),Gt([cr("uEDLDepth"),Kt("design:type",f.Texture)],t.prototype,"uEDLDepth",void 0),Gt([cr("uProj"),Kt("design:type",Array)],t.prototype,"uProj",void 0),t}(f.RawShaderMaterial);function $t(n,t){return{type:n,value:t}}function cr(n,t){return t===void 0&&(t=!1),function(e,r){Object.defineProperty(e,r,{get:function(){return this.getUniform(n)},set:function(i){i!==this.getUniform(n)&&(this.setUniform(n,i),t&&this.updateShaderSource())}})}}var gA=new f.OrthographicCamera(-1,1,1,-1,0,1),vs=new f.BufferGeometry;vs.setAttribute("position",new f.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));vs.setAttribute("uv",new f.Float32BufferAttribute([0,2,0,0,2,0],2));var _l=new f.Mesh(vs),jl=new f.Scene;jl.add(_l);var yA=function(n){ue(t,n);function t(e,r,i,a){var o=n.call(this,e,r,i,a)||this;return o.sharedV2=new f.Vector2,o.renderer=e,o.material=new AA,_l.material=o.material,o.material.needsUpdate=!0,o}return t.prototype.render=function(e){this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0,this.renderer.setRenderTarget(e[0]),this.renderer.render(this.scene,this.camera);var r=this.camera,i=this.material.uniforms,a=this.renderer.getSize(this.sharedV2);i.screenWidth.value=a.x,i.screenHeight.value=a.y;var o=r.projectionMatrix,s=new Float32Array(16);s.set(o.elements);for(var u=new Float32Array(this.material.neighbourCount*2),l=0;l<this.material.neighbourCount;l++)u[2*l+0]=Math.cos(2*l*Math.PI/this.material.neighbourCount),u[2*l+1]=Math.sin(2*l*Math.PI/this.material.neighbourCount);i.neighbours.value=u,i.uNear.value=r.near,i.uFar.value=r.far,i.uEDLColor.value=e[0].texture,i.uProj.value=s,i.edlStrength.value=.5,i.radius.value=1,i.opacity.value=1,this.renderer.setRenderTarget(e[1]),this.renderer.render(jl,gA)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(ds);const bA=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}(`}rpvv|{-zrqvz}-sy|nH}rpvv|{-zrqvz}-v{H{vs|z-nz}yr?Q-drvtuZn}H{vs|z-nz}yr?Q-Qr}uZn}Hn\bv{t-rp?-bH|vq-znv{56-
|
|
1968
1968
|
sy|n-qr}u-J-r\x07r?Q5Qr}uZn}9-b6;Hvs5qr}u-KJ->;=6
|
|
1969
1969
|
qvpnqH\frpA-p|y|-J-r\x07r?Q5drvtuZn}9-b6H-p|y|-J-p|y|-<-p|y|;HtylSntP|y|-J-rpA5p|y|;\x07\b 9->;=6H-\f`),xA=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}(`}rpvv|{-zrqvz}-sy|nH}rpvv|{-zrqvz}-v{Hnvor-rp@-}|vv|{Hnvor-rp?-H{vs|z-znA-}|wrpv|{Znv\x07H{vs|z-znA-z|qrycvrZnv\x07Hn\bv{t-rp?-bH|vq-znv{56-
|
|
1970
|
-
b-J-Htyl]|vv|{-J-}|wrpv|{Znv\x07-7-z|qrycvrZnv\x07-7-rpA5}|vv|{9>;=6H\f`);var wA=function(n){ue(t,n);function t(e){var r=n.call(this,{vertexShader:xA,fragmentShader:bA})||this;return r.uniforms={uDepthMap:G0("t",null),uWeightMap:G0("t",null)},r.depthTest=!0,r.depthWrite=!0,r.opacity=1,r}return t.prototype.getUniform=function(e){return this.uniforms===void 0?void 0:this.uniforms[e].value},t.prototype.setUniform=function(e,r){if(this.uniforms!==void 0){var i=this.uniforms[e];i.value=r}},Ht([K0("uDepthMap"),Gt("design:type",Number)],t.prototype,"uDepthMap",void 0),Ht([K0("uWeightMap"),Gt("design:type",Number)],t.prototype,"uWeightMap",void 0),t}(f.RawShaderMaterial);function G0(n,t){return{type:n,value:t}}function K0(n,t){return t===void 0&&(t=!1),function(e,r){Object.defineProperty(e,r,{get:function(){return this.getUniform(n)},set:function(i){i!==this.getUniform(n)&&(this.setUniform(n,i),t&&this.updateShaderSource())}})}}var MA=new f.OrthographicCamera(-1,1,1,-1,0,1),ms=new f.BufferGeometry;ms.setAttribute("position",new f.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));ms.setAttribute("uv",new f.Float32BufferAttribute([0,2,0,0,2,0],2));var Jl=new f.Mesh(ms),Xl=new f.Scene;Xl.add(Jl);var SA=function(n){ue(t,n);function t(e,r,i,a){var o=n.call(this,e,r,i,a)||this;return o.sharedV2=new f.Vector2,o.renderer=e,o.material=new wA,o.camera=i,Jl.material=o.material,o}return t.prototype.render=function(e){this.models.setMaterial({useHQDepth:!0,useHQWeight:!1}),this.models.update(this.renderer,this.camera,"Mapview"),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0,this.renderer.setRenderTarget(e[0]),this.renderer.render(this.scene,this.camera),this.models.setMaterial({useHQWeight:!0,useHQDepth:!1}),this.models.update(this.renderer,this.camera,"Mapview"),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.renderer.setClearColor(new f.Color(0,0,0)),this.renderer.setClearAlpha(0),this.renderer.setRenderTarget(e[1]),this.renderer.render(this.scene,this.camera),this.material.uniforms.uWeightMap.value=e[1].texture,this.material.uniforms.uDepthMap.value=e[0].depthTexture,this.renderer.autoClearDepth=!0,this.renderer.autoClearColor=!0,this.renderer.setClearColor(new f.Color(0,0,0)),this.renderer.setClearAlpha(1),this.renderer.setRenderTarget(e[2]),this.renderer.render(Xl,MA)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(ds),ho=.5,j0=Math.PI/7,Ir={defaultLongitude:Math.PI/4,defaultLatitude:Math.PI/4,defaultDistance:150,maxLatitude:+Math.PI/2,minLatitude:0,cameraType:"auto",modelInScreen:"boundingbox-center",intersectMeshCreator:function(){return new ya}},CA=function(n){ue(t,n);function t(e){var r=this,i,a=t.parseArgs(e);return r=n.call(this,a)||this,r.mode="Mapview",r.defaultLongitude=a.defaultLongitude,r.defaultLatitude=a.defaultLatitude,r.defaultDistance=a.defaultDistance,r.maxLatitude=a.maxLatitude,r.minLatitude=a.minLatitude,r.cameraType=a.cameraType,r.modelInScreen=a.modelInScreen,r.locationMotion=new Re({x:r.camera.pose.offset.x,y:r.camera.pose.offset.y,z:r.camera.pose.offset.z,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Re({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Re({perspToOrtho:r.camera.perspToOrtho.x}),r.intersectMeshCreator=a.intersectMeshCreator,r.intersectMesh=r.intersectMeshCreator(),r.intersectMesh.name="intersect",r.intersectMesh.visible=!1,r.currentTapId=null,r.helper.add(r.intersectMesh),r.edlTarget=new f.WebGLRenderTarget(1024,1024,{generateMipmaps:!1,minFilter:f.NearestFilter,magFilter:f.NearestFilter,format:f.RGBAFormat,type:f.FloatType,depthTexture:new f.DepthTexture(1024,1024,f.UnsignedIntType)}),r.edlEffect=new yA(r.renderer,r.modelScene,r.camera,r.models),r.hqEffect=new SA(r.renderer,r.modelScene,r.camera,r.models),r}return t.parseArgs=function(e){var r,i,a,o,s,u,l,c;if(e instanceof t)return e;var d=n.parseArgs.call(this,e);return O(O({},d),{defaultLongitude:(r=e.defaultLongitude)!==null&&r!==void 0?r:Ir.defaultLongitude,defaultLatitude:(i=e.defaultLatitude)!==null&&i!==void 0?i:Ir.defaultLatitude,defaultDistance:(a=e.defaultDistance)!==null&&a!==void 0?a:Ir.defaultDistance,maxLatitude:(o=e.maxLatitude)!==null&&o!==void 0?o:Ir.maxLatitude,minLatitude:(s=e.minLatitude)!==null&&s!==void 0?s:Ir.minLatitude,cameraType:(u=e.cameraType)!==null&&u!==void 0?u:Ir.cameraType,modelInScreen:(l=e.modelInScreen)!==null&&l!==void 0?l:Ir.modelInScreen,intersectMeshCreator:(c=e.intersectMeshCreator)!==null&&c!==void 0?c:Ir.intersectMeshCreator})},t.distanceFromModel=function(e,r,i){var a=e.bounding,o=Math.pow(Math.pow(a.max.x-a.min.x+1,2)+Math.pow(a.max.y-a.min.y+1,2)+Math.pow(a.max.z-a.min.z+1,2),1/2),s=o/2/Math.tan(Math.PI*r/360);return i<1&&(s=s/i),isNaN(s)?o:s},t.initAnimationEndState=function(e){var r,i,a,o,s,u,l,c=this.parseArgs(e),d=c.works,p=c.models,A=e.initial,h=A.state,v=A.currentState,g=typeof h.panoIndex=="number"?{workCode:(a=(r=h.workCode)!==null&&r!==void 0?r:(i=c.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:h.panoIndex}:{workCode:v.workCode,panoIndex:v.panoIndex},m=d.getResolvedObserver(g),y=(o=h.fov)!==null&&o!==void 0?o:60,b=ce((s=h.latitude)!==null&&s!==void 0?s:ko(v.mode)?v.latitude:c.defaultLatitude,c.minLatitude,c.maxLatitude),x=t.distanceFromModel(c.models,y,c.camera.aspect),w=new f.Vector3,M=(u=h.distance)!==null&&u!==void 0?u:Math.min(c.defaultDistance,x),S=(l=h.longitude)!==null&&l!==void 0?l:ko(v.mode)?v.longitude:c.defaultLongitude;return h.offset?w.copy(h.offset):c.defaultDistance<x&&m?(w.copy(m.position),h.longitude===void 0&&(S=v.longitude)):(p.bounding.getCenter(w),M=x),O(O({},g),{mode:"Mapview",longitude:S,latitude:b,fov:y,offset:w,distance:M})},t.prototype.updateConfiguration=function(e){var r=n.prototype.updateConfiguration.call(this,e);if(r===!1)return!1;var i=O(O({},Ir),e);if(this.defaultLongitude!==i.defaultLongitude&&(this.defaultLongitude=i.defaultLongitude),this.defaultLatitude!==i.defaultLatitude&&(this.defaultLatitude=i.defaultLatitude),this.defaultDistance!==i.defaultDistance&&(this.defaultDistance=i.defaultDistance),this.maxLatitude!==i.maxLatitude&&(this.maxLatitude=i.maxLatitude),this.minLatitude!==i.minLatitude&&(this.minLatitude=i.minLatitude),this.cameraType!==i.cameraType&&(this.cameraType=i.cameraType),this.modelInScreen!==i.modelInScreen&&(this.modelInScreen=i.modelInScreen),this.intersectMeshCreator!==i.intersectMeshCreator){this.intersectMeshCreator=i.intersectMeshCreator;var a=this.intersectMesh;this.intersectMesh=this.intersectMeshCreator(),this.intersectMesh.name=a.name,this.intersectMesh.visible=a.visible;var o=this.intersectMesh.parent;o&&o.add(this.intersectMesh),a.dispose()}return!0},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.locationMotion.dispose(),delete this.panState,this.intersectMesh.dispose(),this.helper.remove(this.intersectMesh)},t.prototype.isReady=function(){return this.locationMotion.ended===!1?!1:n.prototype.isReady.call(this)},t.prototype.updateWork=function(e,r,i,a){this.userAction=a,this.works=e;var o=t.initAnimationEndState(O(O({},this),{initial:{currentState:O(O({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:a}}));this.currentPano={workCode:o.workCode,panoIndex:o.panoIndex};var s={longitude:o.longitude,latitude:o.latitude,fov:o.fov},u={x:o.offset.x,y:o.offset.y,z:o.offset.z,distance:o.distance,orthoDistance:o.distance};return this.locationMotion.set(u,i.duration).catch(Q),this.cameraMotion.set(s,i.duration).catch(Q),!0},t.prototype.updateModel=function(e){n.prototype.updateModel.call(this,e);var r=e.bounding.getCenter(new f.Vector3),i=t.distanceFromModel(e,this.cameraMotion.value.fov,this.camera.aspect);this.updateCamera({offset:r,distance:i},0,!0)},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={},s={};return e.distance!==void 0&&(o.distance=e.distance),e.offset!==void 0&&(o.x=e.offset.x,o.y=e.offset.y,o.z=e.offset.z),e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),a.locationMotion.set(o,r).catch(Q),a.cameraMotion.set(s,r).catch(Q)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=[],u=0,l=e;u<l.length;u++){var c=l[u];o.push({key:c.key,progress:c.progress,value:{distance:c.value.distance,x:c.value.offset.x,y:c.value.offset.x,z:c.value.offset.x}}),s.push({key:c.key,progress:c.progress,value:{longitude:c.value.longitude,latitude:c.value.latitude,fov:c.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(Q),a.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={},a={};this.locationMotion.ended||(this.locationMotion.update(e),a.distance=this.locationMotion.value.distance,a.offset=new f.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z)),this.cameraMotion.ended||(this.cameraMotion.update(e),a.longitude=this.cameraMotion.value.longitude,a.latitude=this.cameraMotion.value.latitude,a.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha);var o=0;if(this.cameraType==="auto"?o=Math.abs(Math.PI/2-this.cameraMotion.value.latitude)<.02||Math.abs(-Math.PI/2-this.cameraMotion.value.latitude)<.02?1:0:this.cameraType==="perspective"?o=0:this.cameraType==="orthographic"&&(o=1),this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==o&&this.perspToOrthoMotion.set({perspToOrtho:o},500).catch(Q),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(ce(this.perspToOrthoMotion.value.perspToOrtho,0,1))),or(i)||this.models.setMaterial(i),or(a)||this.setCamera(a),this.intersectMesh&&this.intersectMesh.parent){var s=this.camera.position.distanceTo(this.intersectMesh.position),u=2*Math.tan(.5*this.camera.fov/180*Math.PI),l=s*u/5;this.intersectMesh.scale.setScalar(l)}}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(ve())[1],r=this.locationMotion.getKeyFrameSegment(ve())[1];return O(O({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,distance:r.value.distance,offset:new f.Vector3(r.value.x,r.value.y,r.value.z)})},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial;i.state,i.currentState;var a=i.duration,o=i.userAction;e.userAction=o;var s=t.initAnimationEndState(e),u={longitude:s.longitude,latitude:s.latitude,fov:s.fov},l={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance},c={modelAlpha:1},d={perspToOrtho:0};e.emit("initAnimation.start",X("initAnimation.start",{state:s,userAction:e.userAction})),e.perspToOrthoMotion.set(d,a).catch(Q),e.modelAlphaMotion.set(c,a/3).catch(Q),e.cameraMotion.set(u,a).catch(Q),e.locationMotion.set(l,a).then(function(){e.emit("initAnimation.end",X("initAnimation.end",{state:s,userAction:e.userAction}))},function(p){var A=O(O(O({},e.currentPano),{mode:e.mode}),tt(e.camera.pose));e.emit("initAnimation.end",X("initAnimation.end",{state:A,userAction:e.userAction}))}).then(function(){r()})})},t.prototype.getForwardObserverOrNot=function(e){var r=this,i=this.models.intersectRaycaster(e)[0];if(!i)return null;var a=this.works.resolvedObservers.filter(function(l){for(var c,d=0,p=r.models;d<p.length;d++){var A=p[d];if(A.visible&&((c=A.work)===null||c===void 0?void 0:c.workCode)===l.work.workCode)return!0}return!1}),o=Br(a,function(l){return l.standingPosition.distanceTo(i.point)},!0),s=o[0],u=o[1];return s&&u<10?s:null},t.prototype.coordinatesForOffset=function(e){var r=this.renderer.getSize(new f.Vector2);return{longitude:-2*e.x/(r.x*this.scissor.width),latitude:2*e.y/(r.y*this.scissor.height)}},t.prototype.requestMomentumMovement=function(e,r,i,a){var o=this;if(this.inMomentumMovement!==null){for(var s=O({},i),u={longitude:0,latitude:0,x:0,y:0,z:0},l=0;l<a;l++)s.longitude*=.996,s.latitude*=.996*.998,s.x*=.99,s.y*=.99,s.z*=.99,u.longitude+=s.longitude,u.latitude+=s.latitude,u.x+=s.x,u.y+=s.y,u.z+=s.z;var c=vn(this.cameraMotion.value.longitude+u.longitude),d=ce(this.cameraMotion.value.latitude+u.latitude,this.minLatitude,this.maxLatitude),p=new f.Vector3(this.locationMotion.value.x+u.x,this.locationMotion.value.y+u.y,this.locationMotion.value.z+u.z),A=O(O({},this.currentPano),{mode:this.mode,longitude:c,latitude:d,offset:p,fov:this.cameraMotion.value.fov,distance:this.camera.pose.distance}),h=!(Math.abs(s.longitude)>1e-4||Math.abs(s.latitude)>1e-4||Math.abs(s.x)>1e-4||Math.abs(s.y)>1e-4||Math.abs(s.z)>1e-4),v=X("gesture.momentum",O(O({},e),{isFirst:r,isFinal:h,state:A}));if(this.inMomentumMovement.event=v,this.emit("gesture.momentum",v),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:c,latitude:d},0).catch(Q),this.locationMotion.set({x:A.offset.x,y:A.offset.y,z:A.offset.z},0).catch(Q),h?this.inMomentumMovement=null:Mt.shared.add(function(g,m){o.requestMomentumMovement(e,!1,s,m|0)},!0,1))}},t.prototype.fixFinalState=function(e){if(this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==1){var r=nr(e,new f.Vector3),i=new f.Vector3().copy(e.offset).sub(r.clone().multiplyScalar(e.distance)),a=new f.Raycaster(i,r);a.params.Points={threshold:.1},a.near=this.camera.near,a.far=this.camera.far;var o;if(o=this.models.intersectRaycaster(a).filter(function(d){var p,A=(p=d.face)===null||p===void 0?void 0:p.normal;return A&&a.ray.direction.dot(A)>=0?!1:d.distance>ho+a.near})[0],!o){var s=new f.Plane(new f.Vector3(0,1,0),-this.models.bounding.min.y),u=a.ray.intersectPlane(s,new f.Vector3);if(u){var l=u.distanceTo(a.ray.origin);l<1e3&&l>=a.near&&(o={distance:l,floor:0,point:u,object:this.scene,face:null})}}if(!o){var c=Math.max(e.distance,3);o={distance:c,floor:0,point:a.ray.direction.clone().setLength(c).add(a.ray.origin),object:this.scene,face:null}}o&&(e.distance=ce(o.distance,0,1/0),e.offset.copy(i).add(r.clone().multiplyScalar(e.distance)))}},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=e.pointers.length,i=this.panState,a=0,o=!1;e.pointerType==="mouse"&&(a=e.srcEvent.buttons,o=e.srcEvent.shiftKey),i&&a===0&&i.buttons!==0&&(a=i.buttons);var s=i==null?void 0:i.target;if(!s){var u=this.relativeClientPosition(e.center),l=new f.Raycaster;l.params.Points={threshold:.1},l.setFromCamera(u,this.camera),l.near=this.camera.near,s=new f.Vector3().copy(l.ray.direction).multiplyScalar(3).add(l.ray.origin);var c=this.models.intersectRaycaster(l)[0];if(!c&&l.ray.direction.y<-.3){var d=new f.Plane(new f.Vector3(0,1,0),0),p=l.ray.intersectPlane(d,new f.Vector3);if(p){var A=p.distanceTo(l.ray.origin);A<1e4&&A>=l.near&&(c={distance:A,floor:0,point:p,object:this.scene})}}if(c)s.copy(c.point);else{var h=new f.Vector3().copy(this.camera.pose.offset).sub(this.camera.position).normalize(),d=new f.Plane().setFromNormalAndCoplanarPoint(h,this.camera.pose.offset);l.ray.intersectPlane(d,s)}}if(e.isFinal?delete this.panState:this.panState={target:s,buttons:a,pointerLength:r,x:e.center.x,y:e.center.y},!(typeof i=="undefined"||i.pointerLength!==r)){var v=r>1||a===2||o;if(v){var g={x:e.center.x-i.x,y:e.center.y-i.y},m=new f.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),y=nr(this.cameraMotion.value).setLength(this.locationMotion.value.distance).add(m),b=new f.Vector3().copy(y).sub(i.target).length();b*=Math.tan(this.camera.pose.fov/2*Math.PI/180);var x=this.renderer.getSize(new f.Vector2),w=2*g.x*b/x.y,M=2*g.y*b/x.y,S=new f.Vector3;if(S.setFromMatrixColumn(this.camera.matrix,0),S.multiplyScalar(-w),m.add(S),this.camera.pose.latitude<j0?S.setFromMatrixColumn(this.camera.matrix,1):(S.setFromMatrixColumn(this.camera.matrix,0),S.crossVectors(this.camera.up,S)),S.multiplyScalar(M),m.add(S),this.modelInScreen==="boundingbox-center"){var E=this.models.bounding.clone();E.expandByScalar(this.camera.pose.distance),m.clamp(E.min,E.max)}var P=O(O({},this.currentPano),{mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:m,distance:this.camera.pose.distance});if(e.state=P,this.emit("gesture.pan",e),e.defaultPrevented)return;if(this.locationMotion.set({x:P.offset.x,y:P.offset.y,z:P.offset.z},0).catch(Q),e.isFinal&&(this.fixFinalState(P),Object.assign(e,{__fixFinalState:!0}),this.locationMotion.set({distance:P.distance,x:P.offset.x,y:P.offset.y,z:P.offset.z},0).catch(Q)),e.isFinal){var B=this.renderer.getSize(new f.Vector2),C=2*e.velocityX*b/B.y,I=2*e.velocityY*b/B.y,F=new f.Vector3,T=new f.Vector3;F.setFromMatrixColumn(this.camera.matrix,0),F.multiplyScalar(-C),T.add(F),this.camera.pose.latitude<j0?F.setFromMatrixColumn(this.camera.matrix,1):(F.setFromMatrixColumn(this.camera.matrix,0),F.crossVectors(this.camera.up,F)),F.multiplyScalar(I),T.add(F),this.inMomentumMovement={uuid:kt()},this.requestMomentumMovement(e,!0,{longitude:0,latitude:0,x:T.x,y:T.y,z:T.z},0)}}else{var g={x:e.center.x-i.x,y:e.center.y-i.y},L=this.coordinatesForOffset(g),D=vn(this.cameraMotion.value.longitude+L.longitude),V=ce(this.cameraMotion.value.latitude+L.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(V=this.cameraMotion.value.latitude);var P=O(O({},this.currentPano),{mode:this.mode,longitude:D,latitude:V,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance});if(e.isFinal&&Object.assign(e,{__fixFinalState:!0}),e.state=P,this.emit("gesture.pan",e),e.defaultPrevented)return;if(e.isFinal?this.locationMotion.set({distance:P.distance,x:P.offset.x,y:P.offset.y,z:P.offset.z},0).catch(Q):this.cameraMotion.set({longitude:P.longitude,latitude:P.latitude},0).catch(Q),e.isFinal){var z=e.velocityX,U=e.velocityY;this.inMomentumMovement={uuid:kt()},this.requestMomentumMovement(e,!0,O(O({},this.coordinatesForOffset({x:z,y:U})),{x:0,y:0,z:0}),0)}}}},t.prototype.onPinchGesture=function(e){var r;if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var i=(r=this.pinchState)===null||r===void 0?void 0:r.distance;if(e.isFirst){this.pinchState={x:e.center.x,y:e.center.y,scale:1,distance:this.locationMotion.value.distance};return}if(typeof i!="undefined"){var a=this.models.bounding.getCenter(new f.Vector3),o=t.distanceFromModel(this.models,this.cameraMotion.value.fov,this.camera.aspect),s=ce(i/e.scale,ho,1/0),u=e.state.offset.clone().sub(nr(e.state).setLength(s)),l=this.models.bounding.containsPoint(u),c;if(!l&&this.pinchState&&this.pinchState.scale>e.scale&&a.distanceTo(u)>o?c=e.state.distance:(c=s,this.pinchState&&(this.pinchState.scale=e.scale)),e.state.distance=c,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.locationMotion.set({distance:e.state.distance},0).catch(Q),e.pointerType!=="mouse"&&(e.type="gesture.pan",this.onPanGesture(e)),e.isFinal)){if(!("__fixFinalState"in e)){var d=e.state;this.fixFinalState(e.state);var p={x:d.offset.x,y:d.offset.y,z:d.offset.z,distance:d.distance};this.locationMotion.set(p,0).catch(Q)}delete this.panState,delete this.pinchState}}}},t.prototype.onMouseMove=function(e){var r,i;if(this.intersectMesh.parent&&!this.panState&&!this.pinchState&&!this.mouseWheelState&&(this.emit("gesture.mousemove",e),!e.defaultPrevented)){var a=e.center.raycaster;if(a.near=this.camera.near,a.far=this.camera.far,e.isFinal&&this.intersectMesh.parent&&this.intersectMesh.visible===!0){this.hideIntersectMesh();return}var o=this.models.intersectRaycaster(a)[0],s=X("intersect.update",{raycaster:a,intersection:o!=null?o:null,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var u=(i=(r=o.face)===null||r===void 0?void 0:r.normal)!==null&&i!==void 0?i:new f.Vector3().copy(a.ray.direction).multiplyScalar(-1),l=u.clone(),c=o.point.clone();this.intersectMesh.position.copy(c);var d=c.clone().add(l);if(this.intersectMesh.lookAt(d),Math.abs(u.y)>.99){var p=this.camera.position.clone().sub(c);this.intersectMesh.rotation.z=-Math.atan2(p.z,p.x)}this.intersectMesh.visible=!0,this.needsRender=!0}else this.hideIntersectMesh()}},t.prototype.onMouseWheel=function(e){if(this.initAnimationIsReady)if(this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh(),e.isFinal){var r=e.state;if(this.fixFinalState(r),this.emit("gesture.mousewheel",e),e.defaultPrevented)return;var i={x:r.offset.x,y:r.offset.y,z:r.offset.z,distance:r.distance};this.locationMotion.set(i,0).catch(Q)}else{var a=Math.max(this.locationMotion.value.distance-this.camera.near,0),o=e.center.delta/10*Math.max(a/5,.1);if(this.locationMotion.value.distance-o>=ho){var s=this.locationMotion.value.distance-o;e.state.distance=s}else{var u=nr(this.cameraMotion.value);u.setLength(o),e.state.offset.add(u),this.modelInScreen==="boundingbox-center"&&e.state.offset.clamp(this.models.bounding.min,this.models.bounding.max)}if(this.emit("gesture.mousewheel",e),e.defaultPrevented)return;this.locationMotion.set({distance:e.state.distance,x:e.state.offset.x,y:e.state.offset.y,z:e.state.offset.z},0).catch(Q)}},t.prototype.onTapGesture=function(e){var r=this;this.userAction=e.userAction,this.stopMomentumMovement();var i=e.center.raycaster,a=this.getForwardObserverOrNot(i);if(!a)this.emit("gesture.tap",e);else{var o={longitude:this.camera.pose.longitude,latitude:0},s=O(O({},e.state),{mode:"Panorama",workCode:a.pano.workCode,panoIndex:a.pano.panoIndex,longitude:o.longitude,latitude:o.latitude,offset:a?a.position.clone():new f.Vector3,distance:0});if(e.state=s,this.emit("gesture.tap",e),!e.defaultPrevented&&(this.emit("pano.select",X("pano.select",{prevPano:this.currentPano,state:s,userAction:e.userAction,options:o,progress:0,error:null})),a&&a.active)){var u=this.currentTapId=kt();this.preloadPano(a.pano).then(function(l){r.currentTapId===u&&r.emit("pano.request",X("pano.request",{userAction:!0,prevPano:r.currentPano,progress:0,state:s,options:o,error:null}))})}}},t.prototype.onDblTapGesture=function(e){if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=e.state,i=e.center.raycaster,a=i.ray.origin.clone().add(i.ray.direction.clone().setLength(3)),o=1,s=3,u=o,l=this.models.intersectRaycaster(i)[0];if(l&&(a=l.point.clone(),l.distance>(o+s)/2?u=o:u=s),e.state.distance=u,e.state.offset=a,this.emit("gesture.dbltap",e),!e.defaultPrevented){var c={x:r.offset.x,y:r.offset.y,z:r.offset.z,distance:r.distance};this.locationMotion.set(c,360).catch(Q),this.hideIntersectMesh()}}},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.needsRender=!0},t.prototype.render=function(e,r){var i=this.renderer.getRenderTarget();this.updateScreenBuffer(r),e&&(r==="edl"?this.edlEffect.render(this.screenBuffers):r==="hq"?this.hqEffect.render(this.screenBuffers):(this.renderer.setRenderTarget(this.modelRenderTarget),this.renderer.render(this.modelScene,this.camera))),this.depthCopyPass.render(this.modelRenderTarget.depthTexture,i),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.copyPass.render(this.modelRenderTarget,i),this.renderer.setRenderTarget(i),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t}(fs);function _0(n){return n==null}var EA={type:"move"},J0=function(){function n(){this._targetRay=null,this._grip=null,this._hand=null,this._axes=[0,0]}return n.prototype.getHandSpace=function(){return this._hand===null&&(this._hand=new f.Group,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand},n.prototype.getTargetRaySpace=function(){return this._targetRay===null&&(this._targetRay=new f.Group,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new f.Vector3,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new f.Vector3),this._targetRay},n.prototype.getGripSpace=function(){return this._grip===null&&(this._grip=new f.Group,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new f.Vector3,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new f.Vector3),this._grip},n.prototype.dispatchEvent=function(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this},n.prototype.disconnect=function(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},n.prototype.getAxes=function(){return this._axes},n.prototype.update=function(t,e,r){var i=null,a=null,o=null,s=this._targetRay,u=this._grip,l=this._hand;if(t&&t.gamepad&&t.gamepad.axes&&(this._axes=[t.gamepad.axes[2],t.gamepad.axes[3]]),t&&e.session.visibilityState!=="visible-blurred")if(s!==null&&(i=e.getPose(t.targetRaySpace,r),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(EA))),l&&t.hand){o=!0;for(var c=0,d=t.hand.values();c<d.length;c++){var p=d[c],A=e.getJointPose(p,r);if(l.joints[p.jointName]===void 0){var h=new f.Group;h.matrixAutoUpdate=!1,h.visible=!1,l.joints[p.jointName]=h,l.add(h)}var v=l.joints[p.jointName];A!==null&&(v.matrix.fromArray(A.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.jointRadius=A.radius),v.visible=A!==null}var g=l.joints["index-finger-tip"],m=l.joints["thumb-tip"],y=g.position.distanceTo(m.position),b=.02,x=.005;l.inputState.pinching&&y>b+x?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&y<=b-x&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else u!==null&&t.gripSpace&&(a=e.getPose(t.gripSpace,r),a!==null&&(u.matrix.fromArray(a.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),a.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(a.linearVelocity)):u.hasLinearVelocity=!1,a.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(a.angularVelocity)):u.hasAngularVelocity=!1));return s!==null&&(s.visible=i!==null),u!==null&&(u.visible=a!==null),l!==null&&(l.visible=o!==null),this},n}(),IA=1,TA=function(){function n(t,e,r){var i,a,o,s,u;this.isPanorama=(i=r==null?void 0:r.isPanorama)!==null&&i!==void 0?i:!0;var l=navigator.userAgent.toLowerCase(),c;l.includes("pico")?c="Pico":l.includes("oculus")?c="Oculus":c="VP",this.machineType=(a=r==null?void 0:r.machineType)!==null&&a!==void 0?a:c,this.renderer=t,this.gl=e,this.enabled=!1,this.session=null,this.referenceSpaceType=(o=r==null?void 0:r.referenceSpaceType)!==null&&o!==void 0?o:"local-floor",this.referenceSpace=null,this.onSessionStartCallback=(s=r==null?void 0:r.onSessionStart)!==null&&s!==void 0?s:Q,this.onSessionEndCallback=(u=r==null?void 0:r.onSessionEnd)!==null&&u!==void 0?u:Q,this.controllers=[new J0,new J0],this.inputSourcesMap=new Map,this.cameraVR=new f.ArrayCamera,this.cameraL=new f.PerspectiveCamera,this.cameraR=new f.PerspectiveCamera,this.cameraL.viewport=new f.Vector4,this.cameraR.viewport=new f.Vector4,this.cameraL.layers.enable(1),this.cameraR.layers.enable(2),this.cameraVR.layers.enable(1),this.cameraVR.layers.enable(2),this.isPresenting=!1,this.currentDepthNear=null,this.currentDepthFar=null,this.cameraLPos=new f.Vector3,this.cameraRPos=new f.Vector3}return n.prototype.getController=function(t){var e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getRightController=function(){if(!this.session)return null;var t=this.session.inputSources[0].handedness==="right"?0:1,e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getLeftController=function(){if(!this.session)return null;var t=this.session.inputSources[0].handedness==="left"?0:1,e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getControllerGrip=function(t){var e=this.controllers[t];return e||console.warn("no controller find"),e.getGripSpace()},n.prototype.getCameras=function(){return{cameraL:this.cameraL,cameraR:this.cameraR,cameraVR:this.cameraVR}},n.prototype.updateCamera=function(t,e){e===null?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)},n.prototype.setProjectionFromUnion=function(t,e,r){this.cameraLPos.setFromMatrixPosition(e.matrixWorld),this.cameraRPos.setFromMatrixPosition(r.matrixWorld);var i=this.cameraLPos.distanceTo(this.cameraRPos),a=e.projectionMatrix.elements,o=r.projectionMatrix.elements,s=a[14]/(a[10]-1),u=a[14]/(a[10]+1),l=(a[9]+1)/a[5],c=(a[9]-1)/a[5],d=(a[8]-1)/a[0],p=(o[8]+1)/o[0],A=s*d,h=s*p,v=i/(-d+p),g=v*-d;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(g),t.translateZ(v),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var m=s+v,y=u+v,b=A-g,x=h+(i-g),w=l*u/y*m,M=c*u/y*m;t.projectionMatrix.makePerspective(b,x,w,M,m,y)},n.prototype.getCamera=function(t){this.cameraVR.near=this.cameraR.near=this.cameraL.near=t.near,this.cameraVR.far=this.cameraR.far=this.cameraL.far=t.far,this.session&&(this.currentDepthNear!==this.cameraVR.near||this.currentDepthFar!==this.cameraVR.far)&&(this.session.updateRenderState({depthNear:this.cameraVR.near,depthFar:this.cameraVR.far}),this.currentDepthNear=this.cameraVR.near,this.currentDepthFar=this.cameraVR.far);var e=t.parent,r=this.cameraVR.cameras;this.updateCamera(this.cameraVR,e);for(var i=0;i<r.length;i++)this.updateCamera(r[i],e);t.matrixWorld.copy(this.cameraVR.matrixWorld);for(var a=t.children,i=0,o=a.length;i<o;i++)a[i].updateMatrixWorld(!0);return r.length===2?this.setProjectionFromUnion(this.cameraVR,this.cameraL,this.cameraR):this.cameraVR.projectionMatrix.copy(this.cameraL.projectionMatrix),this.cameraVR},n.prototype.updateInputSources=function(t){if(!this.session){console.warn("session is lose!");return}for(var e=this.session.inputSources,r=0;r<this.controllers.length;r++)this.inputSourcesMap.set(e[r],this.controllers[r]);for(var r=0;r<t.removed.length;r++){var i=t.removed[r],a=this.inputSourcesMap.get(i);a&&(a.dispatchEvent({type:"disconnected",data:i}),this.inputSourcesMap.delete(i))}for(var r=0;r<t.added.length;r++){var i=t.added[r],a=this.inputSourcesMap.get(i);a&&a.dispatchEvent({type:"connected",data:i})}},n.prototype.onSessionEvent=function(t){var e=this.inputSourcesMap.get(t.inputSource);e&&e.dispatchEvent({type:t.type})},n.prototype.onSessionEnd=function(){this.inputSourcesMap.forEach(function(t,e){t.disconnect(e)}),this.inputSourcesMap.clear(),this.renderer.setFramebuffer(null),this.renderer.setRenderTarget(this.renderer.getRenderTarget()),this.isPresenting=!1,this.session=null,Mt.shared.setContext(null),this.onSessionEndCallback()},n.prototype.onRequestReferenceSpace=function(t){this.referenceSpace=t,this.isPresenting=!0,this.session&&this.onSessionStartCallback(this.session)},n.prototype.setSession=function(t){var e=this;if(this.session=t,this.session){this.session.addEventListener("select",function(i){e.onSessionEvent(i)}),this.session.addEventListener("selectstart",function(i){e.onSessionEvent(i)}),this.session.addEventListener("selectend",function(i){e.onSessionEvent(i)}),this.session.addEventListener("squeeze",function(i){e.onSessionEvent(i)}),this.session.addEventListener("squeezestart",function(i){e.onSessionEvent(i)}),this.session.addEventListener("squeezeend",function(i){e.onSessionEvent(i)}),this.session.addEventListener("end",function(i){e.onSessionEnd()});var r=this.gl.getContextAttributes();this.gl.makeXRCompatible().then(function(){var i={antialias:r==null?void 0:r.antialias,alpha:r==null?void 0:r.alpha,depth:r==null?void 0:r.depth,stencil:r==null?void 0:r.stencil,framebufferScaleFactor:IA};if(!e.session){console.error("session is lose while set session!");return}switch(e.machineType){case"Pico":case"VP":e.session.updateRenderState({baseLayer:new XRWebGLLayer(e.session,e.gl,i)});break;case"Oculus":e.session.updateRenderState({baseLayer:new XRWebGLLayer(e.session,e.gl,i)});break;default:e.machineType;break}e.session.requestReferenceSpace(e.referenceSpaceType).then(function(a){e.onRequestReferenceSpace(a)}),e.session.addEventListener("inputsourceschange",function(a){e.updateInputSources(a)})})}},n}(),As=function(n){ue(t,n);function t(){var e=n.call(this)||this;e.type="LineSegmentsGeometry";var r=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],i=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],a=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];return e.setIndex(a),e.setAttribute("position",new f.Float32BufferAttribute(r,3)),e.setAttribute("uv",new f.Float32BufferAttribute(i,2)),e}return t.prototype.applyMatrix4=function(e){var r=this.attributes.instanceStart,i=this.attributes.instanceEnd;return r!==void 0&&(r.applyMatrix4(e),i.applyMatrix4(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this},t.prototype.setPositions=function(e){var r;e instanceof Float32Array?r=e:Array.isArray(e)?r=new Float32Array(e):r=new Float32Array;var i=new f.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceStart",new f.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceEnd",new f.InterleavedBufferAttribute(i,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this},t.prototype.setColors=function(e){var r;e instanceof Float32Array?r=e:Array.isArray(e)?r=new Float32Array(e):r=new Float32Array;var i=new f.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceColorStart",new f.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceColorEnd",new f.InterleavedBufferAttribute(i,3,3)),this},t.prototype.fromWireframeGeometry=function(e){return this.setPositions(e.attributes.position.array),this},t.prototype.fromEdgesGeometry=function(e){return this.setPositions(e.attributes.position.array),this},t.prototype.fromMesh=function(e){return this.fromWireframeGeometry(new f.WireframeGeometry(e.geometry)),this},t.prototype.fromLineSegments=function(e){var r=e.geometry;if(r instanceof f.Geometry){var i=new f.BufferGeometry().fromGeometry(r);this.setPositions(i.attributes.position.array)}else r instanceof f.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.computeBoundingBox=function(){this.boundingBox===null&&(this.boundingBox=new f.Box3);var e=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(e!==void 0&&r!==void 0){var i=new f.Box3;this.boundingBox.setFromBufferAttribute(e),i.setFromBufferAttribute(r),this.boundingBox.union(i)}},t.prototype.computeBoundingSphere=function(){this.boundingSphere===null&&(this.boundingSphere=new f.Sphere),this.boundingBox===null&&this.computeBoundingBox();var e=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(e!==void 0&&r!==void 0){var i=this.boundingSphere.center;this.boundingBox.getCenter(i);for(var a=0,o=new f.Vector3,s=0,u=e.count;s<u;s++)o.fromBufferAttribute(e,s),a=Math.max(a,i.distanceToSquared(o)),o.fromBufferAttribute(r,s),a=Math.max(a,i.distanceToSquared(o));this.boundingSphere.radius=Math.sqrt(a),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}},t.prototype.toJSON=function(){},t}(f.InstancedBufferGeometry);Object.assign(As.prototype,{isLineSegmentsGeometry:!0});var po={uniforms:f.UniformsUtils.merge([f.UniformsLib.common,f.UniformsLib.fog,{linewidth:{value:1},resolution:{value:new f.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},opacity:{value:1}}]),vertexShader:`
|
|
1970
|
+
b-J-Htyl]|vv|{-J-}|wrpv|{Znv\x07-7-z|qrycvrZnv\x07-7-rpA5}|vv|{9>;=6H\f`);var wA=function(n){ue(t,n);function t(e){var r=n.call(this,{vertexShader:xA,fragmentShader:bA})||this;return r.uniforms={uDepthMap:G0("t",null),uWeightMap:G0("t",null)},r.depthTest=!0,r.depthWrite=!0,r.opacity=1,r}return t.prototype.getUniform=function(e){return this.uniforms===void 0?void 0:this.uniforms[e].value},t.prototype.setUniform=function(e,r){if(this.uniforms!==void 0){var i=this.uniforms[e];i.value=r}},Gt([K0("uDepthMap"),Kt("design:type",Number)],t.prototype,"uDepthMap",void 0),Gt([K0("uWeightMap"),Kt("design:type",Number)],t.prototype,"uWeightMap",void 0),t}(f.RawShaderMaterial);function G0(n,t){return{type:n,value:t}}function K0(n,t){return t===void 0&&(t=!1),function(e,r){Object.defineProperty(e,r,{get:function(){return this.getUniform(n)},set:function(i){i!==this.getUniform(n)&&(this.setUniform(n,i),t&&this.updateShaderSource())}})}}var MA=new f.OrthographicCamera(-1,1,1,-1,0,1),ms=new f.BufferGeometry;ms.setAttribute("position",new f.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));ms.setAttribute("uv",new f.Float32BufferAttribute([0,2,0,0,2,0],2));var Jl=new f.Mesh(ms),Xl=new f.Scene;Xl.add(Jl);var SA=function(n){ue(t,n);function t(e,r,i,a){var o=n.call(this,e,r,i,a)||this;return o.sharedV2=new f.Vector2,o.renderer=e,o.material=new wA,o.camera=i,Jl.material=o.material,o}return t.prototype.render=function(e){this.models.setMaterial({useHQDepth:!0,useHQWeight:!1}),this.models.update(this.renderer,this.camera,"Mapview"),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0,this.renderer.setRenderTarget(e[0]),this.renderer.render(this.scene,this.camera),this.models.setMaterial({useHQWeight:!0,useHQDepth:!1}),this.models.update(this.renderer,this.camera,"Mapview"),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.renderer.setClearColor(new f.Color(0,0,0)),this.renderer.setClearAlpha(0),this.renderer.setRenderTarget(e[1]),this.renderer.render(this.scene,this.camera),this.material.uniforms.uWeightMap.value=e[1].texture,this.material.uniforms.uDepthMap.value=e[0].depthTexture,this.renderer.autoClearDepth=!0,this.renderer.autoClearColor=!0,this.renderer.setClearColor(new f.Color(0,0,0)),this.renderer.setClearAlpha(1),this.renderer.setRenderTarget(e[2]),this.renderer.render(Xl,MA)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(ds),ho=.5,_0=Math.PI/7,Ir={defaultLongitude:Math.PI/4,defaultLatitude:Math.PI/4,defaultDistance:150,maxLatitude:+Math.PI/2,minLatitude:0,cameraType:"auto",cameraFence:null,intersectMeshCreator:function(){return new ya}},CA=function(n){ue(t,n);function t(e){var r=this,i,a=t.parseArgs(e);return r=n.call(this,a)||this,r.mode="Mapview",r.defaultLongitude=a.defaultLongitude,r.defaultLatitude=a.defaultLatitude,r.defaultDistance=a.defaultDistance,r.maxLatitude=a.maxLatitude,r.minLatitude=a.minLatitude,r.cameraType=a.cameraType,r.cameraFence=a.cameraFence,r.locationMotion=new Re({x:r.camera.pose.offset.x,y:r.camera.pose.offset.y,z:r.camera.pose.offset.z,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Re({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Re({perspToOrtho:r.camera.perspToOrtho.x}),r.intersectMeshCreator=a.intersectMeshCreator,r.intersectMesh=r.intersectMeshCreator(),r.intersectMesh.name="intersect",r.intersectMesh.visible=!1,r.currentTapId=null,r.helper.add(r.intersectMesh),r.edlTarget=new f.WebGLRenderTarget(1024,1024,{generateMipmaps:!1,minFilter:f.NearestFilter,magFilter:f.NearestFilter,format:f.RGBAFormat,type:f.FloatType,depthTexture:new f.DepthTexture(1024,1024,f.UnsignedIntType)}),r.edlEffect=new yA(r.renderer,r.modelScene,r.camera,r.models),r.hqEffect=new SA(r.renderer,r.modelScene,r.camera,r.models),r}return t.parseArgs=function(e){var r,i,a,o,s,u,l,c;if(e instanceof t)return e;var d=n.parseArgs.call(this,e);return O(O({},d),{defaultLongitude:(r=e.defaultLongitude)!==null&&r!==void 0?r:Ir.defaultLongitude,defaultLatitude:(i=e.defaultLatitude)!==null&&i!==void 0?i:Ir.defaultLatitude,defaultDistance:(a=e.defaultDistance)!==null&&a!==void 0?a:Ir.defaultDistance,maxLatitude:(o=e.maxLatitude)!==null&&o!==void 0?o:Ir.maxLatitude,minLatitude:(s=e.minLatitude)!==null&&s!==void 0?s:Ir.minLatitude,cameraType:(u=e.cameraType)!==null&&u!==void 0?u:Ir.cameraType,cameraFence:(l=e.cameraFence)!==null&&l!==void 0?l:Ir.cameraFence,intersectMeshCreator:(c=e.intersectMeshCreator)!==null&&c!==void 0?c:Ir.intersectMeshCreator})},t.distanceFromModel=function(e,r,i){var a=e.bounding,o=Math.pow(Math.pow(a.max.x-a.min.x+1,2)+Math.pow(a.max.y-a.min.y+1,2)+Math.pow(a.max.z-a.min.z+1,2),1/2),s=o/2/Math.tan(Math.PI*r/360);return i<1&&(s=s/i),isNaN(s)?o:s},t.initAnimationEndState=function(e){var r,i,a,o,s,u,l,c=this.parseArgs(e),d=c.works,p=c.models,A=e.initial,h=A.state,v=A.currentState,g=typeof h.panoIndex=="number"?{workCode:(a=(r=h.workCode)!==null&&r!==void 0?r:(i=c.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:h.panoIndex}:{workCode:v.workCode,panoIndex:v.panoIndex},m=d.getResolvedObserver(g),y=(o=h.fov)!==null&&o!==void 0?o:60,b=ce((s=h.latitude)!==null&&s!==void 0?s:ko(v.mode)?v.latitude:c.defaultLatitude,c.minLatitude,c.maxLatitude),x=t.distanceFromModel(c.models,y,c.camera.aspect),w=new f.Vector3,M=(u=h.distance)!==null&&u!==void 0?u:Math.min(c.defaultDistance,x),S=(l=h.longitude)!==null&&l!==void 0?l:ko(v.mode)?v.longitude:c.defaultLongitude;return h.offset?w.copy(h.offset):c.defaultDistance<x&&m?(w.copy(m.position),h.longitude===void 0&&(S=v.longitude)):(p.bounding.getCenter(w),M=x),O(O({},g),{mode:"Mapview",longitude:S,latitude:b,fov:y,offset:w,distance:M})},t.prototype.updateConfiguration=function(e){var r=n.prototype.updateConfiguration.call(this,e);if(r===!1)return!1;var i=O(O({},Ir),e);if(this.defaultLongitude!==i.defaultLongitude&&(this.defaultLongitude=i.defaultLongitude),this.defaultLatitude!==i.defaultLatitude&&(this.defaultLatitude=i.defaultLatitude),this.defaultDistance!==i.defaultDistance&&(this.defaultDistance=i.defaultDistance),this.maxLatitude!==i.maxLatitude&&(this.maxLatitude=i.maxLatitude),this.minLatitude!==i.minLatitude&&(this.minLatitude=i.minLatitude),this.cameraType!==i.cameraType&&(this.cameraType=i.cameraType),this.cameraFence instanceof f.Box3&&i.cameraFence instanceof f.Box3?this.cameraFence.equals(i.cameraFence)||(this.cameraFence=i.cameraFence):this.cameraFence instanceof f.Sphere&&i.cameraFence instanceof f.Sphere?this.cameraFence.equals(i.cameraFence)||(this.cameraFence=i.cameraFence):this.cameraFence=i.cameraFence,this.intersectMeshCreator!==i.intersectMeshCreator){this.intersectMeshCreator=i.intersectMeshCreator;var a=this.intersectMesh;this.intersectMesh=this.intersectMeshCreator(),this.intersectMesh.name=a.name,this.intersectMesh.visible=a.visible;var o=this.intersectMesh.parent;o&&o.add(this.intersectMesh),a.dispose()}return!0},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.locationMotion.dispose(),delete this.panState,this.intersectMesh.dispose(),this.helper.remove(this.intersectMesh)},t.prototype.isReady=function(){return this.locationMotion.ended===!1?!1:n.prototype.isReady.call(this)},t.prototype.updateWork=function(e,r,i,a){this.userAction=a,this.works=e;var o=t.initAnimationEndState(O(O({},this),{initial:{currentState:O(O({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:a}}));this.currentPano={workCode:o.workCode,panoIndex:o.panoIndex};var s={longitude:o.longitude,latitude:o.latitude,fov:o.fov},u={x:o.offset.x,y:o.offset.y,z:o.offset.z,distance:o.distance,orthoDistance:o.distance};return this.locationMotion.set(u,i.duration).catch(Q),this.cameraMotion.set(s,i.duration).catch(Q),!0},t.prototype.updateModel=function(e){n.prototype.updateModel.call(this,e);var r=e.bounding.getCenter(new f.Vector3),i=t.distanceFromModel(e,this.cameraMotion.value.fov,this.camera.aspect);this.updateCamera({offset:r,distance:i},0,!0)},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={},s={};return e.distance!==void 0&&(o.distance=e.distance),e.offset!==void 0&&(o.x=e.offset.x,o.y=e.offset.y,o.z=e.offset.z),e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),a.locationMotion.set(o,r).catch(Q),a.cameraMotion.set(s,r).catch(Q)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=[],u=0,l=e;u<l.length;u++){var c=l[u];o.push({key:c.key,progress:c.progress,value:{distance:c.value.distance,x:c.value.offset.x,y:c.value.offset.x,z:c.value.offset.x}}),s.push({key:c.key,progress:c.progress,value:{longitude:c.value.longitude,latitude:c.value.latitude,fov:c.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(Q),a.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={},a={};this.locationMotion.ended||(this.locationMotion.update(e),a.distance=this.locationMotion.value.distance,a.offset=new f.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z)),this.cameraMotion.ended||(this.cameraMotion.update(e),a.longitude=this.cameraMotion.value.longitude,a.latitude=this.cameraMotion.value.latitude,a.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha);var o=0;if(this.cameraType==="auto"?o=Math.abs(Math.PI/2-this.cameraMotion.value.latitude)<.02||Math.abs(-Math.PI/2-this.cameraMotion.value.latitude)<.02?1:0:this.cameraType==="perspective"?o=0:this.cameraType==="orthographic"&&(o=1),this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==o&&this.perspToOrthoMotion.set({perspToOrtho:o},500).catch(Q),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(ce(this.perspToOrthoMotion.value.perspToOrtho,0,1))),ar(i)||this.models.setMaterial(i),ar(a)||this.setCamera(a),this.cameraFence&&!this.panState&&!this.pinchState&&!this.mouseWheelState&&!this.inMomentumMovement&&this.locationMotion.ended&&this.perspToOrthoMotion.ended&&this.cameraMotion.ended){var s=Ut(this.camera.pose,new f.Vector3),u=new f.Vector3().copy(this.camera.pose.offset).sub(s.clone().multiplyScalar(this.camera.pose.distance));if(!this.cameraFence.containsPoint(u)){var l=this.cameraFence.clampPoint(u,new f.Vector3),c=this.camera.pose.offset.clone().add(l).sub(u),d=O(O({},this.currentPano),{mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:c,distance:this.camera.pose.distance});this.fixFinalState(d),this.locationMotion.set({x:d.offset.x,y:d.offset.y,z:d.offset.z,distance:d.distance},300).catch(Q)}}if(this.intersectMesh&&this.intersectMesh.parent){var p=this.camera.position.distanceTo(this.intersectMesh.position),A=2*Math.tan(.5*this.camera.fov/180*Math.PI),h=p*A/5;this.intersectMesh.scale.setScalar(h)}}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(ve())[1],r=this.locationMotion.getKeyFrameSegment(ve())[1];return O(O({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,distance:r.value.distance,offset:new f.Vector3(r.value.x,r.value.y,r.value.z)})},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial;i.state,i.currentState;var a=i.duration,o=i.userAction;e.userAction=o;var s=t.initAnimationEndState(e),u={longitude:s.longitude,latitude:s.latitude,fov:s.fov},l={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance},c={modelAlpha:1},d={perspToOrtho:0};e.emit("initAnimation.start",X("initAnimation.start",{state:s,userAction:e.userAction})),e.perspToOrthoMotion.set(d,a).catch(Q),e.modelAlphaMotion.set(c,a/3).catch(Q),e.cameraMotion.set(u,a).catch(Q),e.locationMotion.set(l,a).then(function(){e.emit("initAnimation.end",X("initAnimation.end",{state:s,userAction:e.userAction}))},function(p){var A=O(O(O({},e.currentPano),{mode:e.mode}),tt(e.camera.pose));e.emit("initAnimation.end",X("initAnimation.end",{state:A,userAction:e.userAction}))}).then(function(){r()})})},t.prototype.getForwardObserverOrNot=function(e){var r=this,i=this.models.intersectRaycaster(e)[0];if(!i)return null;var a=this.works.resolvedObservers.filter(function(l){for(var c,d=0,p=r.models;d<p.length;d++){var A=p[d];if(A.visible&&((c=A.work)===null||c===void 0?void 0:c.workCode)===l.work.workCode)return!0}return!1}),o=Br(a,function(l){return l.standingPosition.distanceTo(i.point)},!0),s=o[0],u=o[1];return s&&u<10?s:null},t.prototype.coordinatesForOffset=function(e){var r=this.renderer.getSize(new f.Vector2);return{longitude:-2*e.x/(r.x*this.scissor.width),latitude:2*e.y/(r.y*this.scissor.height)}},t.prototype.requestMomentumMovement=function(e,r,i,a){var o=this;if(this.inMomentumMovement!==null){for(var s=O({},i),u={longitude:0,latitude:0,x:0,y:0,z:0},l=0;l<a;l++)s.longitude*=.996,s.latitude*=.996*.998,s.x*=.99,s.y*=.99,s.z*=.99,u.longitude+=s.longitude,u.latitude+=s.latitude,u.x+=s.x,u.y+=s.y,u.z+=s.z;var c=vn(this.cameraMotion.value.longitude+u.longitude),d=ce(this.cameraMotion.value.latitude+u.latitude,this.minLatitude,this.maxLatitude),p=new f.Vector3(this.locationMotion.value.x+u.x,this.locationMotion.value.y+u.y,this.locationMotion.value.z+u.z),A=O(O({},this.currentPano),{mode:this.mode,longitude:c,latitude:d,offset:p,fov:this.cameraMotion.value.fov,distance:this.locationMotion.value.distance}),h=e.state.offset.clone().sub(Ut(e.state).setLength(A.distance)),v=this.cameraFence?this.cameraFence.containsPoint(h):!0,g=!v&&!(Math.abs(s.longitude)>1e-4||Math.abs(s.latitude)>1e-4||Math.abs(s.x)>1e-4||Math.abs(s.y)>1e-4||Math.abs(s.z)>1e-4),m=X("gesture.momentum",O(O({},e),{isFirst:r,isFinal:g,state:A}));if(this.inMomentumMovement.event=m,this.emit("gesture.momentum",m),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:c,latitude:d},0).catch(Q),this.locationMotion.set({x:A.offset.x,y:A.offset.y,z:A.offset.z,distance:A.distance},0).catch(Q),g?this.inMomentumMovement=null:Mt.shared.add(function(y,b){o.requestMomentumMovement(e,!1,s,b|0)},!0,1))}},t.prototype.fixFinalState=function(e){if(this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==1){var r=Ut(e,new f.Vector3),i=new f.Vector3().copy(e.offset).sub(r.clone().multiplyScalar(e.distance)),a=new f.Raycaster(i,r);a.params.Points={threshold:.1},a.near=this.camera.near,a.far=this.camera.far;var o;if(o=this.models.intersectRaycaster(a).filter(function(d){var p,A=(p=d.face)===null||p===void 0?void 0:p.normal;return A&&a.ray.direction.dot(A)>=0?!1:d.distance>ho+a.near})[0],!o){var s=new f.Plane(new f.Vector3(0,1,0),-this.models.bounding.min.y),u=a.ray.intersectPlane(s,new f.Vector3);if(u){var l=u.distanceTo(a.ray.origin);l<1e3&&l>=a.near&&(o={distance:l,floor:0,point:u,object:this.scene,face:null})}}if(!o){var c=Math.max(e.distance,3);o={distance:c,floor:0,point:a.ray.direction.clone().setLength(c).add(a.ray.origin),object:this.scene,face:null}}o&&(e.distance=ce(o.distance,0,1/0),e.offset.copy(i).add(r.clone().multiplyScalar(e.distance)))}},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=e.pointers.length,i=this.panState,a=0,o=!1;e.pointerType==="mouse"&&(a=e.srcEvent.buttons,o=e.srcEvent.shiftKey),i&&a===0&&i.buttons!==0&&(a=i.buttons);var s=i==null?void 0:i.target;if(!s){var u=this.relativeClientPosition(e.center),l=new f.Raycaster;l.params.Points={threshold:.1},l.setFromCamera(u,this.camera),l.near=this.camera.near,s=new f.Vector3().copy(l.ray.direction).multiplyScalar(3).add(l.ray.origin);var c=this.models.intersectRaycaster(l)[0];if(!c&&l.ray.direction.y<-.3){var d=new f.Plane(new f.Vector3(0,1,0),0),p=l.ray.intersectPlane(d,new f.Vector3);if(p){var A=p.distanceTo(l.ray.origin);A<1e4&&A>=l.near&&(c={distance:A,floor:0,point:p,object:this.scene})}}if(c)s.copy(c.point);else{var h=new f.Vector3().copy(this.camera.pose.offset).sub(this.camera.position).normalize(),d=new f.Plane().setFromNormalAndCoplanarPoint(h,this.camera.pose.offset);l.ray.intersectPlane(d,s)}}if(e.isFinal?delete this.panState:this.panState={target:s,buttons:a,pointerLength:r,x:e.center.x,y:e.center.y},!(typeof i=="undefined"||i.pointerLength!==r)){var v=r>1||a===2||o;if(v){var g={x:e.center.x-i.x,y:e.center.y-i.y},m=new f.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),y=Ut(this.cameraMotion.value).setLength(this.locationMotion.value.distance).add(m),b=new f.Vector3().copy(y).sub(i.target).length();b*=Math.tan(this.camera.pose.fov/2*Math.PI/180);var x=this.renderer.getSize(new f.Vector2),w=2*g.x*b/x.y,M=2*g.y*b/x.y,S=new f.Vector3;S.setFromMatrixColumn(this.camera.matrix,0),S.multiplyScalar(-w),m.add(S),this.camera.pose.latitude<_0?S.setFromMatrixColumn(this.camera.matrix,1):(S.setFromMatrixColumn(this.camera.matrix,0),S.crossVectors(this.camera.up,S)),S.multiplyScalar(M),m.add(S);var E=O(O({},this.currentPano),{mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:m,distance:this.camera.pose.distance});if(e.state=E,this.emit("gesture.pan",e),e.defaultPrevented)return;if(this.locationMotion.set({x:E.offset.x,y:E.offset.y,z:E.offset.z},0).catch(Q),e.isFinal&&(this.fixFinalState(E),Object.assign(e,{__fixFinalState:!0}),this.locationMotion.set({distance:E.distance,x:E.offset.x,y:E.offset.y,z:E.offset.z},0).catch(Q)),e.isFinal){var B=this.renderer.getSize(new f.Vector2),R=2*e.velocityX*b/B.y,C=2*e.velocityY*b/B.y,I=new f.Vector3,L=new f.Vector3;I.setFromMatrixColumn(this.camera.matrix,0),I.multiplyScalar(-R),L.add(I),this.camera.pose.latitude<_0?I.setFromMatrixColumn(this.camera.matrix,1):(I.setFromMatrixColumn(this.camera.matrix,0),I.crossVectors(this.camera.up,I)),I.multiplyScalar(C),L.add(I),this.inMomentumMovement={uuid:kt()},this.requestMomentumMovement(e,!0,{longitude:0,latitude:0,x:L.x,y:L.y,z:L.z},0)}}else{var g={x:e.center.x-i.x,y:e.center.y-i.y},T=this.coordinatesForOffset(g),F=vn(this.cameraMotion.value.longitude+T.longitude),D=ce(this.cameraMotion.value.latitude+T.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(D=this.cameraMotion.value.latitude);var E=O(O({},this.currentPano),{mode:this.mode,longitude:F,latitude:D,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance});if(e.isFinal&&Object.assign(e,{__fixFinalState:!0}),e.state=E,this.emit("gesture.pan",e),e.defaultPrevented)return;if(e.isFinal?this.locationMotion.set({distance:E.distance,x:E.offset.x,y:E.offset.y,z:E.offset.z},0).catch(Q):this.cameraMotion.set({longitude:E.longitude,latitude:E.latitude},0).catch(Q),e.isFinal){var V=e.velocityX,z=e.velocityY;this.inMomentumMovement={uuid:kt()},this.requestMomentumMovement(e,!0,O(O({},this.coordinatesForOffset({x:V,y:z})),{x:0,y:0,z:0}),0)}}}},t.prototype.onPinchGesture=function(e){var r;if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var i=(r=this.pinchState)===null||r===void 0?void 0:r.distance;if(e.isFirst){this.pinchState={x:e.center.x,y:e.center.y,scale:1,distance:this.locationMotion.value.distance};return}if(typeof i!="undefined"){var a=this.models.bounding.getCenter(new f.Vector3),o=t.distanceFromModel(this.models,this.cameraMotion.value.fov,this.camera.aspect),s=ce(i/e.scale,ho,1/0),u=e.state.offset.clone().sub(Ut(e.state).setLength(s)),l=this.models.bounding.containsPoint(u),c;if(!l&&this.pinchState&&this.pinchState.scale>e.scale&&a.distanceTo(u)>o?c=e.state.distance:(c=s,this.pinchState&&(this.pinchState.scale=e.scale)),e.state.distance=c,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.locationMotion.set({distance:e.state.distance},0).catch(Q),e.pointerType!=="mouse"&&(e.type="gesture.pan",this.onPanGesture(e)),e.isFinal)){if(!("__fixFinalState"in e)){var d=e.state;this.fixFinalState(e.state);var p={x:d.offset.x,y:d.offset.y,z:d.offset.z,distance:d.distance};this.locationMotion.set(p,0).catch(Q)}delete this.panState,delete this.pinchState}}}},t.prototype.onMouseMove=function(e){var r,i;if(this.intersectMesh.parent&&!this.panState&&!this.pinchState&&!this.mouseWheelState&&(this.emit("gesture.mousemove",e),!e.defaultPrevented)){var a=e.center.raycaster;if(a.near=this.camera.near,a.far=this.camera.far,e.isFinal&&this.intersectMesh.parent&&this.intersectMesh.visible===!0){this.hideIntersectMesh();return}var o=this.models.intersectRaycaster(a)[0],s=X("intersect.update",{raycaster:a,intersection:o!=null?o:null,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var u=(i=(r=o.face)===null||r===void 0?void 0:r.normal)!==null&&i!==void 0?i:new f.Vector3().copy(a.ray.direction).multiplyScalar(-1),l=u.clone(),c=o.point.clone();this.intersectMesh.position.copy(c);var d=c.clone().add(l);if(this.intersectMesh.lookAt(d),Math.abs(u.y)>.99){var p=this.camera.position.clone().sub(c);this.intersectMesh.rotation.z=-Math.atan2(p.z,p.x)}this.intersectMesh.visible=!0,this.needsRender=!0}else this.hideIntersectMesh()}},t.prototype.onMouseWheel=function(e){if(this.initAnimationIsReady)if(this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh(),e.isFinal){var r=e.state;if(this.fixFinalState(r),this.emit("gesture.mousewheel",e),e.defaultPrevented)return;var i={x:r.offset.x,y:r.offset.y,z:r.offset.z,distance:r.distance};this.locationMotion.set(i,0).catch(Q)}else{var a=Math.max(this.locationMotion.value.distance-this.camera.near,0),o=e.center.delta/10*Math.max(a/5,.1);if(this.locationMotion.value.distance-o>=ho){var s=this.locationMotion.value.distance-o;e.state.distance=s}else{var u=Ut(this.cameraMotion.value);u.setLength(o),e.state.offset.add(u)}if(this.emit("gesture.mousewheel",e),e.defaultPrevented)return;this.locationMotion.set({distance:e.state.distance,x:e.state.offset.x,y:e.state.offset.y,z:e.state.offset.z},0).catch(Q)}},t.prototype.onTapGesture=function(e){var r=this;this.userAction=e.userAction,this.stopMomentumMovement();var i=e.center.raycaster,a=this.getForwardObserverOrNot(i);if(!a)this.emit("gesture.tap",e);else{var o={longitude:this.camera.pose.longitude,latitude:0},s=O(O({},e.state),{mode:"Panorama",workCode:a.pano.workCode,panoIndex:a.pano.panoIndex,longitude:o.longitude,latitude:o.latitude,offset:a?a.position.clone():new f.Vector3,distance:0});if(e.state=s,this.emit("gesture.tap",e),!e.defaultPrevented&&(this.emit("pano.select",X("pano.select",{prevPano:this.currentPano,state:s,userAction:e.userAction,options:o,progress:0,error:null})),a&&a.active)){var u=this.currentTapId=kt();this.preloadPano(a.pano).then(function(l){r.currentTapId===u&&r.emit("pano.request",X("pano.request",{userAction:!0,prevPano:r.currentPano,progress:0,state:s,options:o,error:null}))})}}},t.prototype.onDblTapGesture=function(e){if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=e.state,i=e.center.raycaster,a=i.ray.origin.clone().add(i.ray.direction.clone().setLength(3)),o=1,s=3,u=o,l=this.models.intersectRaycaster(i)[0];if(l&&(a=l.point.clone(),l.distance>(o+s)/2?u=o:u=s),e.state.distance=u,e.state.offset=a,this.emit("gesture.dbltap",e),!e.defaultPrevented){var c={x:r.offset.x,y:r.offset.y,z:r.offset.z,distance:r.distance};this.locationMotion.set(c,360).catch(Q),this.hideIntersectMesh()}}},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.needsRender=!0},t.prototype.render=function(e,r){var i=this.renderer.getRenderTarget();this.updateScreenBuffer(r),e&&(r==="edl"?this.edlEffect.render(this.screenBuffers):r==="hq"?this.hqEffect.render(this.screenBuffers):(this.renderer.setRenderTarget(this.modelRenderTarget),this.renderer.render(this.modelScene,this.camera))),this.depthCopyPass.render(this.modelRenderTarget.depthTexture,i),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.copyPass.render(this.modelRenderTarget,i),this.renderer.setRenderTarget(i),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t}(fs);function j0(n){return n==null}var EA={type:"move"},J0=function(){function n(){this._targetRay=null,this._grip=null,this._hand=null,this._axes=[0,0]}return n.prototype.getHandSpace=function(){return this._hand===null&&(this._hand=new f.Group,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand},n.prototype.getTargetRaySpace=function(){return this._targetRay===null&&(this._targetRay=new f.Group,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new f.Vector3,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new f.Vector3),this._targetRay},n.prototype.getGripSpace=function(){return this._grip===null&&(this._grip=new f.Group,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new f.Vector3,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new f.Vector3),this._grip},n.prototype.dispatchEvent=function(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this},n.prototype.disconnect=function(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},n.prototype.getAxes=function(){return this._axes},n.prototype.update=function(t,e,r){var i=null,a=null,o=null,s=this._targetRay,u=this._grip,l=this._hand;if(t&&t.gamepad&&t.gamepad.axes&&(this._axes=[t.gamepad.axes[2],t.gamepad.axes[3]]),t&&e.session.visibilityState!=="visible-blurred")if(s!==null&&(i=e.getPose(t.targetRaySpace,r),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(EA))),l&&t.hand){o=!0;for(var c=0,d=t.hand.values();c<d.length;c++){var p=d[c],A=e.getJointPose(p,r);if(l.joints[p.jointName]===void 0){var h=new f.Group;h.matrixAutoUpdate=!1,h.visible=!1,l.joints[p.jointName]=h,l.add(h)}var v=l.joints[p.jointName];A!==null&&(v.matrix.fromArray(A.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.jointRadius=A.radius),v.visible=A!==null}var g=l.joints["index-finger-tip"],m=l.joints["thumb-tip"],y=g.position.distanceTo(m.position),b=.02,x=.005;l.inputState.pinching&&y>b+x?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&y<=b-x&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else u!==null&&t.gripSpace&&(a=e.getPose(t.gripSpace,r),a!==null&&(u.matrix.fromArray(a.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),a.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(a.linearVelocity)):u.hasLinearVelocity=!1,a.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(a.angularVelocity)):u.hasAngularVelocity=!1));return s!==null&&(s.visible=i!==null),u!==null&&(u.visible=a!==null),l!==null&&(l.visible=o!==null),this},n}(),IA=1,TA=function(){function n(t,e,r){var i,a,o,s,u;this.isPanorama=(i=r==null?void 0:r.isPanorama)!==null&&i!==void 0?i:!0;var l=navigator.userAgent.toLowerCase(),c;l.includes("pico")?c="Pico":l.includes("oculus")?c="Oculus":c="VP",this.machineType=(a=r==null?void 0:r.machineType)!==null&&a!==void 0?a:c,this.renderer=t,this.gl=e,this.enabled=!1,this.session=null,this.referenceSpaceType=(o=r==null?void 0:r.referenceSpaceType)!==null&&o!==void 0?o:"local-floor",this.referenceSpace=null,this.onSessionStartCallback=(s=r==null?void 0:r.onSessionStart)!==null&&s!==void 0?s:Q,this.onSessionEndCallback=(u=r==null?void 0:r.onSessionEnd)!==null&&u!==void 0?u:Q,this.controllers=[new J0,new J0],this.inputSourcesMap=new Map,this.cameraVR=new f.ArrayCamera,this.cameraL=new f.PerspectiveCamera,this.cameraR=new f.PerspectiveCamera,this.cameraL.viewport=new f.Vector4,this.cameraR.viewport=new f.Vector4,this.cameraL.layers.enable(1),this.cameraR.layers.enable(2),this.cameraVR.layers.enable(1),this.cameraVR.layers.enable(2),this.isPresenting=!1,this.currentDepthNear=null,this.currentDepthFar=null,this.cameraLPos=new f.Vector3,this.cameraRPos=new f.Vector3}return n.prototype.getController=function(t){var e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getRightController=function(){if(!this.session)return null;var t=this.session.inputSources[0].handedness==="right"?0:1,e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getLeftController=function(){if(!this.session)return null;var t=this.session.inputSources[0].handedness==="left"?0:1,e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getControllerGrip=function(t){var e=this.controllers[t];return e||console.warn("no controller find"),e.getGripSpace()},n.prototype.getCameras=function(){return{cameraL:this.cameraL,cameraR:this.cameraR,cameraVR:this.cameraVR}},n.prototype.updateCamera=function(t,e){e===null?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)},n.prototype.setProjectionFromUnion=function(t,e,r){this.cameraLPos.setFromMatrixPosition(e.matrixWorld),this.cameraRPos.setFromMatrixPosition(r.matrixWorld);var i=this.cameraLPos.distanceTo(this.cameraRPos),a=e.projectionMatrix.elements,o=r.projectionMatrix.elements,s=a[14]/(a[10]-1),u=a[14]/(a[10]+1),l=(a[9]+1)/a[5],c=(a[9]-1)/a[5],d=(a[8]-1)/a[0],p=(o[8]+1)/o[0],A=s*d,h=s*p,v=i/(-d+p),g=v*-d;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(g),t.translateZ(v),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var m=s+v,y=u+v,b=A-g,x=h+(i-g),w=l*u/y*m,M=c*u/y*m;t.projectionMatrix.makePerspective(b,x,w,M,m,y)},n.prototype.getCamera=function(t){this.cameraVR.near=this.cameraR.near=this.cameraL.near=t.near,this.cameraVR.far=this.cameraR.far=this.cameraL.far=t.far,this.session&&(this.currentDepthNear!==this.cameraVR.near||this.currentDepthFar!==this.cameraVR.far)&&(this.session.updateRenderState({depthNear:this.cameraVR.near,depthFar:this.cameraVR.far}),this.currentDepthNear=this.cameraVR.near,this.currentDepthFar=this.cameraVR.far);var e=t.parent,r=this.cameraVR.cameras;this.updateCamera(this.cameraVR,e);for(var i=0;i<r.length;i++)this.updateCamera(r[i],e);t.matrixWorld.copy(this.cameraVR.matrixWorld);for(var a=t.children,i=0,o=a.length;i<o;i++)a[i].updateMatrixWorld(!0);return r.length===2?this.setProjectionFromUnion(this.cameraVR,this.cameraL,this.cameraR):this.cameraVR.projectionMatrix.copy(this.cameraL.projectionMatrix),this.cameraVR},n.prototype.updateInputSources=function(t){if(!this.session){console.warn("session is lose!");return}for(var e=this.session.inputSources,r=0;r<this.controllers.length;r++)this.inputSourcesMap.set(e[r],this.controllers[r]);for(var r=0;r<t.removed.length;r++){var i=t.removed[r],a=this.inputSourcesMap.get(i);a&&(a.dispatchEvent({type:"disconnected",data:i}),this.inputSourcesMap.delete(i))}for(var r=0;r<t.added.length;r++){var i=t.added[r],a=this.inputSourcesMap.get(i);a&&a.dispatchEvent({type:"connected",data:i})}},n.prototype.onSessionEvent=function(t){var e=this.inputSourcesMap.get(t.inputSource);e&&e.dispatchEvent({type:t.type})},n.prototype.onSessionEnd=function(){this.inputSourcesMap.forEach(function(t,e){t.disconnect(e)}),this.inputSourcesMap.clear(),this.renderer.setFramebuffer(null),this.renderer.setRenderTarget(this.renderer.getRenderTarget()),this.isPresenting=!1,this.session=null,Mt.shared.setContext(null),this.onSessionEndCallback()},n.prototype.onRequestReferenceSpace=function(t){this.referenceSpace=t,this.isPresenting=!0,this.session&&this.onSessionStartCallback(this.session)},n.prototype.setSession=function(t){var e=this;if(this.session=t,this.session){this.session.addEventListener("select",function(i){e.onSessionEvent(i)}),this.session.addEventListener("selectstart",function(i){e.onSessionEvent(i)}),this.session.addEventListener("selectend",function(i){e.onSessionEvent(i)}),this.session.addEventListener("squeeze",function(i){e.onSessionEvent(i)}),this.session.addEventListener("squeezestart",function(i){e.onSessionEvent(i)}),this.session.addEventListener("squeezeend",function(i){e.onSessionEvent(i)}),this.session.addEventListener("end",function(i){e.onSessionEnd()});var r=this.gl.getContextAttributes();this.gl.makeXRCompatible().then(function(){var i={antialias:r==null?void 0:r.antialias,alpha:r==null?void 0:r.alpha,depth:r==null?void 0:r.depth,stencil:r==null?void 0:r.stencil,framebufferScaleFactor:IA};if(!e.session){console.error("session is lose while set session!");return}switch(e.machineType){case"Pico":case"VP":e.session.updateRenderState({baseLayer:new XRWebGLLayer(e.session,e.gl,i)});break;case"Oculus":e.session.updateRenderState({baseLayer:new XRWebGLLayer(e.session,e.gl,i)});break;default:e.machineType;break}e.session.requestReferenceSpace(e.referenceSpaceType).then(function(a){e.onRequestReferenceSpace(a)}),e.session.addEventListener("inputsourceschange",function(a){e.updateInputSources(a)})})}},n}(),As=function(n){ue(t,n);function t(){var e=n.call(this)||this;e.type="LineSegmentsGeometry";var r=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],i=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],a=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];return e.setIndex(a),e.setAttribute("position",new f.Float32BufferAttribute(r,3)),e.setAttribute("uv",new f.Float32BufferAttribute(i,2)),e}return t.prototype.applyMatrix4=function(e){var r=this.attributes.instanceStart,i=this.attributes.instanceEnd;return r!==void 0&&(r.applyMatrix4(e),i.applyMatrix4(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this},t.prototype.setPositions=function(e){var r;e instanceof Float32Array?r=e:Array.isArray(e)?r=new Float32Array(e):r=new Float32Array;var i=new f.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceStart",new f.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceEnd",new f.InterleavedBufferAttribute(i,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this},t.prototype.setColors=function(e){var r;e instanceof Float32Array?r=e:Array.isArray(e)?r=new Float32Array(e):r=new Float32Array;var i=new f.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceColorStart",new f.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceColorEnd",new f.InterleavedBufferAttribute(i,3,3)),this},t.prototype.fromWireframeGeometry=function(e){return this.setPositions(e.attributes.position.array),this},t.prototype.fromEdgesGeometry=function(e){return this.setPositions(e.attributes.position.array),this},t.prototype.fromMesh=function(e){return this.fromWireframeGeometry(new f.WireframeGeometry(e.geometry)),this},t.prototype.fromLineSegments=function(e){var r=e.geometry;if(r instanceof f.Geometry){var i=new f.BufferGeometry().fromGeometry(r);this.setPositions(i.attributes.position.array)}else r instanceof f.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.computeBoundingBox=function(){this.boundingBox===null&&(this.boundingBox=new f.Box3);var e=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(e!==void 0&&r!==void 0){var i=new f.Box3;this.boundingBox.setFromBufferAttribute(e),i.setFromBufferAttribute(r),this.boundingBox.union(i)}},t.prototype.computeBoundingSphere=function(){this.boundingSphere===null&&(this.boundingSphere=new f.Sphere),this.boundingBox===null&&this.computeBoundingBox();var e=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(e!==void 0&&r!==void 0){var i=this.boundingSphere.center;this.boundingBox.getCenter(i);for(var a=0,o=new f.Vector3,s=0,u=e.count;s<u;s++)o.fromBufferAttribute(e,s),a=Math.max(a,i.distanceToSquared(o)),o.fromBufferAttribute(r,s),a=Math.max(a,i.distanceToSquared(o));this.boundingSphere.radius=Math.sqrt(a),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}},t.prototype.toJSON=function(){},t}(f.InstancedBufferGeometry);Object.assign(As.prototype,{isLineSegmentsGeometry:!0});var po={uniforms:f.UniformsUtils.merge([f.UniformsLib.common,f.UniformsLib.fog,{linewidth:{value:1},resolution:{value:new f.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},opacity:{value:1}}]),vertexShader:`
|
|
1971
1971
|
#include <common>
|
|
1972
1972
|
#include <color_pars_vertex>
|
|
1973
1973
|
#include <fog_pars_vertex>
|
|
@@ -2166,7 +2166,7 @@ void main() {
|
|
|
2166
2166
|
#include <premultiplied_alpha_fragment>
|
|
2167
2167
|
|
|
2168
2168
|
}
|
|
2169
|
-
`},gs=function(n){ue(t,n);function t(e){var r=n.call(this,{uniforms:f.UniformsUtils.clone(po.uniforms),vertexShader:po.vertexShader,fragmentShader:po.fragmentShader,clipping:!0})||this;return r.type="LineMaterial",r.dashed=!1,Object.defineProperties(r,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(i){this.uniforms.diffuse.value=i}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(i){this.uniforms.linewidth.value=i}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(i){this.uniforms.dashScale.value=i}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(i){this.uniforms.dashSize.value=i}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(i){this.uniforms.gapSize.value=i}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(i){this.uniforms.opacity.value=i}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(i){this.uniforms.resolution.value.copy(i)}}}),r.setValues(e),r}return t}(f.ShaderMaterial);Object.assign(gs.prototype,{isLineMaterial:!0});var Wl=function(n){ue(t,n);function t(e,r){var i=n.call(this)||this;return i.type="LineSegments2",i.geometry=e!==void 0?e:new As,i.material=r!==void 0?r:new gs({color:Math.random()*16777215}),i}return t.prototype.computeLineDistances=function(){for(var e=this.geometry,r=e.attributes.instanceStart,i=e.attributes.instanceEnd,a=new Float32Array(2*r.count),o=new f.Vector3,s=new f.Vector3,u=0,l=0,c=r.count;u<c;u++,l+=2)o.fromBufferAttribute(r,u),s.fromBufferAttribute(i,u),a[l]=l===0?0:a[l-1],a[l+1]=a[l]+o.distanceTo(s);var d=new f.InstancedInterleavedBuffer(a,2,1);return e.setAttribute("instanceDistanceStart",new f.InterleavedBufferAttribute(d,1,0)),e.setAttribute("instanceDistanceEnd",new f.InterleavedBufferAttribute(d,1,1)),this},t.prototype.raycast=function(e,r){e.camera===null&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var i=e.ray,a=e.camera,o=a.projectionMatrix,s=this.geometry,u=this.material,l=u.resolution,c=u.linewidth,d=s.attributes.instanceStart,p=s.attributes.instanceEnd,A=new f.Vector4,h=new f.Vector4,v=new f.Vector4,g=new f.Vector3,m=new f.Matrix4,y=new f.Line3,b=new f.Vector3;i.at(1,v),v.w=1,v.applyMatrix4(a.matrixWorldInverse),v.applyMatrix4(o),v.multiplyScalar(1/v.w),v.x*=l.x/2,v.y*=l.y/2,v.z=0,g.copy(v);var x=this.matrixWorld;m.multiplyMatrices(a.matrixWorldInverse,x);for(var w=0,M=d.count;w<M;w++){A.fromBufferAttribute(d,w),h.fromBufferAttribute(p,w),A.w=1,h.w=1,A.applyMatrix4(m),h.applyMatrix4(m),A.applyMatrix4(o),h.applyMatrix4(o),A.multiplyScalar(1/A.w),h.multiplyScalar(1/h.w);var S=A.z<-1&&h.z<-1,E=A.z>1&&h.z>1;if(!(S||E)){A.x*=l.x/2,A.y*=l.y/2,h.x*=l.x/2,h.y*=l.y/2,y.start.copy(A),y.start.z=0,y.end.copy(h),y.end.z=0;var P=y.closestPointToPointParameter(g,!0);y.at(P,b);var B=f.MathUtils.lerp(A.z,h.z,P),C=B>=-1&&B<=1,I=g.distanceTo(b)<c*.5;if(C&&I){y.start.fromBufferAttribute(d,w),y.end.fromBufferAttribute(p,w),y.start.applyMatrix4(x),y.end.applyMatrix4(x);var F=new f.Vector3,T=new f.Vector3;i.distanceSqToSegment(y.start,y.end,T,F),r.push({point:T,pointOnLine:F,distance:i.origin.distanceTo(T),object:this,faceIndex:w})}}}},t}(f.Mesh);Object.assign(Wl.prototype,{isLineSegments2:!0});var Zl=function(n){ue(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.type="Line2",i}return t}(Wl);Object.assign(Zl.prototype,{isLine2:!0});var Yl=function(n){ue(t,n);function t(){var e=n.call(this)||this;return e.type="LineGeometry",e}return t.prototype.setPositions=function(e){for(var r=e.length-3,i=new Float32Array(2*r),a=0;a<r;a+=3)i[2*a]=e[a],i[2*a+1]=e[a+1],i[2*a+2]=e[a+2],i[2*a+3]=e[a+3],i[2*a+4]=e[a+4],i[2*a+5]=e[a+5];return n.prototype.setPositions.call(this,i),this},t.prototype.setColors=function(e){for(var r=e.length-3,i=new Float32Array(2*r),a=0;a<r;a+=3)i[2*a]=e[a],i[2*a+1]=e[a+1],i[2*a+2]=e[a+2],i[2*a+3]=e[a+3],i[2*a+4]=e[a+4],i[2*a+5]=e[a+5];return n.prototype.setColors.call(this,i),this},t.prototype.fromLine=function(e){var r=e.geometry;if(r instanceof f.Geometry){var i=new f.BufferGeometry().fromGeometry(r);this.setPositions(i.attributes.position.array)}else r instanceof f.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.copy=function(){return this},t}(As);Object.assign(Yl.prototype,{isLineGeometry:!0});var PA="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0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NzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==",X0=14467195,RA=8,BA=2,FA=20,W0=null,zo=function(n){ue(t,n);function t(e,r){e===void 0&&(e=new f.Vector3),r===void 0&&(r=new f.Vector3);var i=n.call(this)||this;i.type="FiveLine",i.needsRender=!0;var a=new Yl,o=new gs({color:X0,linewidth:BA,dashScale:FA,dashed:!1});i.line=new Zl(a,o);var s=new f.BufferGeometry,u=new f.PointsMaterial({color:X0,size:RA,map:W0||(W0=new f.TextureLoader().load(PA)),sizeAttenuation:!1,transparent:!0});return i.points=new f.Points(s,u),i.points.renderOrder=11,i.points.frustumCulled=!1,i.setPoints(e,r),i.add(i.line,i.points),i}return Object.defineProperty(t,"version",{get:function(){return"6.4.0-alpha.26"},enumerable:!1,configurable:!0}),t.prototype.setPoints=function(e,r){var i=[].concat(e.toArray(),r.toArray());this.points.geometry.setAttribute("position",new f.BufferAttribute(new Float32Array(i),3)),this.line.geometry.setPositions(i),this.line.computeLineDistances(),this.needsRender=!0},t.prototype.getPoints=function(){var e=this.points.geometry.attributes.position.array;return[new f.Vector3(e[0],e[1],e[2]),new f.Vector3(e[3],e[4],e[5])]},t.prototype.setMaterial=function(e){var r=this.line.material;for(var i in e)if(e.hasOwnProperty(i)){var a=e[i];i==="dashed"?(r.dashed=a,a?r.defines.USE_DASH="":delete r.defines.USE_DASH,r.needsUpdate=!0):r[i]=e[i]}this.needsRender=!0},t.prototype.setResolution=function(e,r){var i=this.line.material.resolution;(i.x!==e||i.y!==r)&&(i.set(e,r),this.needsRender=!0)},t}(f.Object3D);Object.assign(zo.prototype,{isFiveLine:!0});var rt={Handedness:Object.freeze({NONE:"none",LEFT:"left",RIGHT:"right"}),ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})};function $l(n){return ha(this,void 0,void 0,function(){var t;return pa(this,function(e){switch(e.label){case 0:return[4,fetch(n)];case 1:if(t=e.sent(),t.ok)return[2,t.json()];throw new Error(t.statusText)}})})}function LA(n){return ha(this,void 0,void 0,function(){var t,e;return pa(this,function(r){switch(r.label){case 0:if(!n)throw new Error("No basePath supplied");return t="profilesList.json",[4,$l("".concat(n,"/").concat(t))];case 1:return e=r.sent(),[2,e]}})})}function kA(n,t){return ha(this,arguments,void 0,function(e,r,i,a){var o,s,u,l,c,d;return i===void 0&&(i=null),a===void 0&&(a=!0),pa(this,function(p){switch(p.label){case 0:if(!e)throw new Error("No xrInputSource supplied");if(!r)throw new Error("No basePath supplied");return[4,LA(r)];case 1:if(o=p.sent(),e.profiles.some(function(A){var h=o[A];return h&&(s={profileId:A,profilePath:"".concat(r,"/").concat(h.path),deprecated:!!h.deprecated}),!!s}),!s){if(!i)throw new Error("No matching profile name found");if(u=o[i],!u)throw new Error('No matching profile name found and default profile "'.concat(i,'" missing.'));s={profileId:i,profilePath:"".concat(r,"/").concat(u.path),deprecated:!!u.deprecated}}return[4,$l(s.profilePath)];case 2:if(l=p.sent(),a){if(d=void 0,d=l.layouts[e.handedness],!d)throw new Error("No matching handedness, ".concat(e.handedness,", in profile ").concat(s.profileId));d.assetPath&&(c=s.profilePath.replace("profile.json",d.assetPath))}return[2,{profile:l,assetPath:c}]}})})}var OA={xAxis:0,yAxis:0,button:0,state:rt.ComponentState.DEFAULT};function DA(n,t){n===void 0&&(n=0),t===void 0&&(t=0);var e=n,r=t,i=Math.sqrt(n*n+t*t);if(i>1){var a=Math.atan2(t,n);e=Math.cos(a),r=Math.sin(a)}var o={normalizedXAxis:e*.5+.5,normalizedYAxis:r*.5+.5};return o}var VA=function(){function n(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===rt.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(OA)}return n.prototype.updateFromComponent=function(t){var e=t.xAxis,r=t.yAxis,i=t.button,a=t.state,o=DA(e,r),s=o.normalizedXAxis,u=o.normalizedYAxis;switch(this.componentProperty){case rt.ComponentProperty.X_AXIS:this.value=this.states.includes(a)?s:.5;break;case rt.ComponentProperty.Y_AXIS:this.value=this.states.includes(a)?u:.5;break;case rt.ComponentProperty.BUTTON:this.value=this.states.includes(a)?i:0;break;case rt.ComponentProperty.STATE:this.valueNodeProperty===rt.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(a):this.value=this.states.includes(a)?1:0;break;default:throw new Error("Unexpected visualResponse componentProperty ".concat(this.componentProperty))}},n}(),NA=function(){function n(t,e){var r=this;if(!t||!e||!e.visualResponses||!e.gamepadIndices||Object.keys(e.gamepadIndices).length===0)throw new Error("Invalid arguments supplied");this.id=t,this.type=e.type,this.rootNodeName=e.rootNodeName,this.touchPointNodeName=e.touchPointNodeName,this.visualResponses={},Object.keys(e.visualResponses).forEach(function(i){var a=new VA(e.visualResponses[i]);r.visualResponses[i]=a}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:rt.ComponentState.DEFAULT,button:this.gamepadIndices.button!==void 0?0:void 0,xAxis:this.gamepadIndices.xAxis!==void 0?0:void 0,yAxis:this.gamepadIndices.yAxis!==void 0?0:void 0}}return Object.defineProperty(n.prototype,"data",{get:function(){var t=O({id:this.id},this.values);return t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(t){var e=this;if(this.values.state=rt.ComponentState.DEFAULT,this.gamepadIndices.button!==void 0&&t.buttons.length>this.gamepadIndices.button){var r=t.buttons[this.gamepadIndices.button];this.values.button=r.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,r.pressed||this.values.button===1?this.values.state=rt.ComponentState.PRESSED:(r.touched||this.values.button>rt.ButtonTouchThreshold)&&(this.values.state=rt.ComponentState.TOUCHED)}this.gamepadIndices.xAxis!==void 0&&t.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=t.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===rt.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>rt.AxisTouchThreshold&&(this.values.state=rt.ComponentState.TOUCHED)),this.gamepadIndices.yAxis!==void 0&&t.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=t.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===rt.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>rt.AxisTouchThreshold&&(this.values.state=rt.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(function(i){i.updateFromComponent(e.values)})},n}(),zA=function(){function n(t,e,r){var i=this;if(!t)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No profile supplied");this.xrInputSource=t,this.assetUrl=r,this.id=e.profileId,this.layoutDescription=e.layouts[t.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(function(a){var o=i.layoutDescription.components[a];i.components[a]=new NA(a,o)}),this.updateFromGamepad()}return Object.defineProperty(n.prototype,"gripSpace",{get:function(){return this.xrInputSource.gripSpace},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"targetRaySpace",{get:function(){return this.xrInputSource.targetRaySpace},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"data",{get:function(){var t=[];return Object.values(this.components).forEach(function(e){t.push(e.data)}),t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(){var t=this;Object.values(this.components).forEach(function(e){e.updateFromGamepad(t.xrInputSource.gamepad)})},n}(),QA="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",UA="generic-trigger",qA=function(n){ue(t,n);function t(){var e=n.call(this)||this;return e.motionController=null,e.envMap=null,e}return t.prototype.setEnvironmentMap=function(e){var r=this;return this.envMap==e?this:(this.envMap=e,this.traverse(function(i){i instanceof f.Mesh&&i.isMesh&&(i.material.envMap=r.envMap,i.material.needsUpdate=!0)}),this)},t.prototype.updateMatrixWorld=function(e){n.prototype.updateMatrixWorld.call(this,e),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach(function(r){Object.values(r.visualResponses).forEach(function(i){var a=i.valueNode,o=i.minNode,s=i.maxNode,u=i.value,l=i.valueNodeProperty;a&&(l===rt.VisualResponseProperty.VISIBILITY?a.visible=u:l===rt.VisualResponseProperty.TRANSFORM&&(a.quaternion.copy(o.quaternion).slerp(s.quaternion,u),a.position.lerpVectors(o.position,s.position,u)))})}))},t}(si.Object3D);function HA(n,t){Object.values(n.components).forEach(function(e){var r=e.type,i=e.touchPointNodeName,a=e.visualResponses;if(r===rt.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(i),e.touchPointNode){var o=new si.SphereGeometry(.001),s=new si.MeshBasicMaterial({color:255}),u=new si.Mesh(o,s);e.touchPointNode.add(u)}else console.warn("Could not find touch dot, ".concat(e.touchPointNodeName,", in touchpad component ").concat(e.id));Object.values(a).forEach(function(l){var c=l.valueNodeName,d=l.minNodeName,p=l.maxNodeName,A=l.valueNodeProperty;if(A===rt.VisualResponseProperty.TRANSFORM){if(l.minNode=t.getObjectByName(d),l.maxNode=t.getObjectByName(p),!l.minNode){console.warn("Could not find ".concat(d," in the model"));return}if(!l.maxNode){console.warn("Could not find ".concat(p," in the model"));return}}l.valueNode=t.getObjectByName(c),l.valueNode||console.warn("Could not find ".concat(c," in the model"))})})}function Z0(n,t){HA(n.motionController,t),n.envMap&&t.traverse(function(e){e instanceof f.Mesh&&e.isMesh&&(e.material.envMap=n.envMap,e.material.needsUpdate=!0)}),n.add(t)}var GA=function(){function n(t){t===void 0&&(t=null),this.gltfLoader=t,this.path=QA,this._assetCache={}}return n.prototype.createControllerModel=function(t){var e=this,r=new qA,i=null;return t.addEventListener("connected",function(a){var o=a.data;o.targetRayMode!=="tracked-pointer"||!o.gamepad||kA(o,e.path,UA).then(function(s){var u=s.profile,l=s.assetPath;r.motionController=new zA(o,u,l);var c=e._assetCache[r.motionController.assetUrl];if(c)i=c.scene.clone(),Z0(r,i);else{if(!e.gltfLoader)throw new Error("GLTFLoader not set.");e.gltfLoader.load(r.motionController.assetUrl,function(d){e._assetCache[r.motionController.assetUrl]=d,i=d.scene.clone(),Z0(r,i)})}}).catch(function(s){console.warn(s)})}),t.addEventListener("disconnected",function(){r.motionController=null,r.remove(i),i=null}),r},n}(),KA=O({},Aa(pr,["maxLatitude","minLatitude"]));function jA(n,t){return n}var Y0=300,_A=new f.Matrix4().makeRotationAxis(new f.Vector3(0,1,0),Math.PI),$0=new f.Vector3(-1,1,1),JA=function(n){ue(t,n);function t(e){var r=n.call(this,e)||this;r.xrManager=new TA(r.renderer,r.renderer.getContext(),{onSessionStart:function(u){r.emit("xr.session.start",X("xr.session.start",{session:u,machineType:r.xrManager.machineType}))},onSessionEnd:function(){r.emit("xr.session.end",X("xr.session.end",{session:null,machineType:r.xrManager.machineType}))}}),r.xrControllerRay={left:new f.Raycaster,right:new f.Raycaster},r.xrControllerRay.left.params.Points={threshold:.1},r.xrControllerRay.right.params.Points={threshold:.1},r.gazeRay=null,r.pointerLines={left:new zo,right:new zo},r.pointerLines.left.visible=!1,r.pointerLines.right.visible=!0,r.pointerLines.left.setMaterial({color:new f.Vector3(1,1,1)}),r.pointerLines.left.points.material.depthTest=!1,r.pointerLines.right.setMaterial({color:new f.Vector3(1,1,1)}),r.pointerLines.right.points.material.depthTest=!1,r.controllerWrappers=[new f.Group,new f.Group];var i=r.xrManager.getController(0);r.controllerWrappers[0].add(i);var a=r.xrManager.getController(1);r.controllerWrappers[1].add(a);var o=new GA;o.gltfLoader={load:function(u,l){ra.ajax(u,{responseType:"arraybuffer"}).then(function(c){var d;return es(c.body,{resourcePath:u.slice(0,u.lastIndexOf("/")+1),search:(d=u.split("?")[1])!==null&&d!==void 0?d:"",fetcher:ra})}).then(function(c){return l(c)})}},(r.xrManager.machineType==="Oculus"||r.xrManager.machineType==="Pico")&&r.scene.add(r.pointerLines.left,r.pointerLines.right,r.controllerWrappers[0],r.controllerWrappers[1]),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=kt()]={panoId:He(r.currentPano),leftPanoPicture:null,position:r.camera.pose.offset.clone(),effect:"fade",fixCameraTransform:new f.Matrix4},r.parallaxCameraMatrixs=[];var s=Mt.shared.getContext();return s?(r.on("xr.session.end",function(){r.scene.remove(r.pointerLines.left,r.pointerLines.right)}),r.xrManager.setSession(s),r.on("xr.session.start",function(){var u=r.xrManager.getControllerGrip(0);u.add(o.createControllerModel(u)),r.controllerWrappers[0].add(u);var l=r.xrManager.getControllerGrip(1);l.add(o.createControllerModel(l)),r.controllerWrappers[1].add(l)}),r.xrHandleState={LeftAxesUp:{touchStartTime:0,touchStart:!1},LeftAxesDown:{touchStartTime:0,touchStart:!1},LeftAxesLeft:{touchStartTime:0,touchStart:!1},LeftAxesRight:{touchStartTime:0,touchStart:!1},LeftTrigger:{touchStartTime:0,touchStart:!1},LeftPinch:{touchStartTime:0,touchStart:!1},RightAxesUp:{touchStartTime:0,touchStart:!1},RightAxesDown:{touchStartTime:0,touchStart:!1},RightAxesLeft:{touchStartTime:0,touchStart:!1},RightAxesRight:{touchStartTime:0,touchStart:!1},RightTrigger:{touchStartTime:0,touchStart:!1},RightPinch:{touchStartTime:0,touchStart:!1},Y:{touchStartTime:0,touchStart:!1},X:{touchStartTime:0,touchStart:!1},A:{touchStartTime:0,touchStart:!1},B:{touchStartTime:0,touchStart:!1}},r.xrManager.machineType==="VP"&&r.initHandEvent(),r):(console.error("获取session失败,请退出重试"),r)}return t.parseArgs=function(e){if(e instanceof t)return e;var r=O(O({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return O(O({},i),{mode:"XRPanorama"})},t.prototype.updateConfiguration=function(e){return n.prototype.updateConfiguration.call(this,O(O({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2}))},t.prototype.moveToPano=function(e,r,i){var a=this,o,s,u,l,c=(o=r.effect)!==null&&o!==void 0?o:"fade";this.userAction=i,this.stopMomentumMovement();var d=this.works.getResolvedObserver(e);if(!d)throw new Error("Invalid PanoIndex");var p=mi(d.images.up),A=this.imageOptions.size;typeof A=="undefined"&&d&&p&&(A=Number(p)),typeof A=="undefined"&&(A=2048);var h=this.imageOptions.transform,v=function(C,I){return jA(Cn(C,h,I))},g=O({key:"pano.".concat(d.panoId)},_t(this.imageOptions,["format","size","quality"])),m=d.images,y=(u=(s=d.images.tiles)===null||s===void 0?void 0:s.filter(function(C){return C.size>A}))!==null&&u!==void 0?u:null,b="pano:"+ma([m,g,h]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===b)return;var x=this.pendingTextureTask.panoId;(l=this.panoMeshes[x])===null||l===void 0||l.setProgress(0),this.emit("pano.texture.abort",X("pano.texture.abort",{error:null,progress:0,meta:null,pano:d.pano}))}var w=this.models.getMaterial()||{},M=w.pano0,S=w.pano1,E;if((M==null?void 0:M.map.name)===b?E=M:(S==null?void 0:S.map.name)===b&&(E=S),E){var P={panoId:d.panoId,effect:c,leftPanoPicture:{zoom:1,map:E.map,luminanceMap:E.luminanceMap,matrix:new f.Matrix4().compose(d.position,d.quaternion,$0)},position:d.position.clone(),fixCameraTransform:new f.Matrix4};this.doMoveToPano(d.pano,P,r);return}var B="move-to-pano-"+d.panoId;this.pending.add(B),this.pendingTextureTask={panoId:d.panoId,hash:b,onLoad:function(C){if(a.pending.delete(B),a.destroyed)C.body.dispose();else{C.body.name=b;var I={panoId:d.panoId,effect:c,leftPanoPicture:{zoom:1,map:C.body,luminanceMap:null,matrix:new f.Matrix4().compose(d.position,d.quaternion,$0)},position:d.position.clone(),fixCameraTransform:new f.Matrix4};a.doMoveToPano(d.pano,I,r)}},onError:function(C){a.pending.delete(B);var I=O(O(O({},d.pano),{mode:a.mode}),tt(a.camera.pose));a.emit("pano.error",X("pano.error",{error:C,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:I})),a.emit("pano.cancel",X("pano.cancel",{error:null,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:I})),r.moveCancelCallback&&r.moveCancelCallback()}},Promise.all([this.tileLevelForFov&&y&&y.length?this.textureLoader.loadTiledCubeTexture(m,y,{tileMaxLevel:this.tiledCubeTextureLevel,imageURL:{transform:v,options:g},format:f.RGBAFormat,minFilter:f.LinearFilter,magFilter:f.LinearFilter,generateMipmaps:!1,viaAjax:!0,fetcher:pt(d.work)},void 0,void 0,function(C){var I,F;a.emit("pano.texture.progress",X("pano.texture.progress",{error:null,progress:C,meta:null,pano:d.pano})),((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b&&((F=a.panoMeshes[d.panoId])===null||F===void 0||F.setProgress(C))},this.renderer):this.textureLoader.loadCubeTexture(m,{imageURL:{transform:v,options:g},format:f.RGBAFormat,fetcher:pt(d.work)},void 0,void 0,function(C){var I,F;((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b&&((F=a.panoMeshes[d.panoId])===null||F===void 0||F.setProgress(C)),a.emit("pano.texture.progress",X("pano.texture.progress",{error:null,progress:C,meta:null,pano:d.pano}))},this.renderer)]).then(function(C){var I,F,T=C[0];((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b?(a.pendingTextureTask.onLoad(T),(F=a.panoMeshes[d.panoId])===null||F===void 0||F.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",X("pano.texture.success",{error:null,progress:1,meta:T.meta,pano:d.pano}))):T.body.dispose()}).catch(function(C){var I,F;((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b&&(a.pendingTextureTask.onError(C),(F=a.panoMeshes[d.panoId])===null||F===void 0||F.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",X("pano.texture.error",{error:C,progress:0,meta:null,pano:d.pano})),a.emit("error",C))}),this.emit("pano.texture.load",X("pano.texture.load",{error:null,progress:0,meta:null,pano:d.pano}))},t.prototype.doMoveToPano=function(e,r,i){var a=this,o,s,u,l,c,d,p,A,h,v;i===void 0&&(i={});var g=ve(),m=kt();this.panoResources[m]=r;var y=1,b,x,w;if(this.locationMotion.ended){var M=this.locationMotion.getKeyFrameSegment(g);M[0];var S=M[1],E=this.locationMotion.value,P=this.panoResourceFromLocationMotionKeyframe(S).position,B=r.position;b=Math.max(P.distanceTo(B),y),x=[{key:S.key,progress:0,value:O(O({},E),{count:0})},{key:m,progress:1,value:{distance:0,count:1}}],w=0}else{var C=this.locationMotion.getKeyFrameSegment(g),I=C[0],S=C[1],E=this.locationMotion.value,F=this.panoResourceFromLocationMotionKeyframe(I).position,P=this.panoResourceFromLocationMotionKeyframe(S).position,B=r.position,T=S.value.count-E.count,L=Math.max(F.distanceTo(P),y)*T,D=Math.max(P.distanceTo(B),y);b=L+D,x=[{key:I.key,progress:0,value:O({},E)},{key:S.key,progress:L/b,value:S.value},{key:m,progress:1,value:{count:S.value.count+1,distance:0}}];var V=this.locationMotionKeyframesLength(this.locationMotion.keyframes),z=this.locationMotionKeyframesLength(x);w=this.locationMotion.getProgressVelocity(g)*V/z}var U=r.effect==="instant"?0:this.calculateMovingDuration(i.duration,r.effect==="fly"?b:0),q={longitude:i.longitude,latitude:i.latitude,fov:i.fov},G=O(O({},e),{mode:this.mode,longitude:(o=q.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=q.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(u=q.fov)!==null&&u!==void 0?u:this.camera.pose.fov,offset:r.position.clone(),distance:0}),K=this.currentPano;if(this.emit("pano.moveTo",X("pano.moveTo",{options:i,prevPano:K,progress:0,state:G,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(G),this.videoTexture&&this.videoTexture.image instanceof HTMLVideoElement&&this.videoTexture.image.getAttribute("src")&&(this.videoTexture.image.pause(),this.videoTexture.image.removeAttribute("uuid"),this.videoTexture.image.removeAttribute("src"),this.videoTexture.image.oncanplay=Q,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(q,U).catch(Q);else{var _=nr({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),J=nr({longitude:(l=q.longitude)!==null&&l!==void 0?l:this.cameraMotion.value.longitude,latitude:(c=q.latitude)!==null&&c!==void 0?c:this.cameraMotion.value.latitude}),W=new f.Object3D;W.lookAt(_);var $=new f.Matrix4().makeRotationFromQuaternion(W.quaternion);W.lookAt(J);var Y=new f.Matrix4().makeRotationFromQuaternion(W.quaternion),Z=new f.Matrix4().getInverse($).premultiply(Y),oe=this.cameraMotion.value.fov,ne=(d=q.fov)!==null&&d!==void 0?d:this.cameraMotion.value.fov,de=1;r.effect==="zoomin"?de=1.5:r.effect==="zoomout"&&(de=.4);for(var se=ne*de,ye=0;ye<x.length-1;ye++){var ie=x[ye].key;if(ie){var xe=this.panoResources[ie];xe&&(xe.fixCameraTransform.copy(Z),xe.leftPanoPicture&&(xe.leftPanoPicture.zoom=Math.tan(oe/2/180*Math.PI)/Math.tan(se/2/180*Math.PI)))}}this.cameraMotion.setKeyframes([{progress:0,value:{longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:this.cameraMotion.value.fov}},{progress:0,value:{longitude:(p=q.longitude)!==null&&p!==void 0?p:this.cameraMotion.value.longitude,latitude:(A=q.latitude)!==null&&A!==void 0?A:this.cameraMotion.value.latitude,fov:se}},{progress:1,value:{longitude:(h=q.longitude)!==null&&h!==void 0?h:this.cameraMotion.value.longitude,latitude:(v=q.latitude)!==null&&v!==void 0?v:this.cameraMotion.value.latitude,fov:ne}}],U).catch(Q)}var Le=this.locationMotion.setKeyframes(x,U,w);Le.then(function(){for(var Ce,Oe,ee,re=0,H=a.models;re<H.length;re++){var Be=H[re];Be.show()}var Te=O(O({},e),{mode:a.mode,longitude:a.camera.pose.longitude,latitude:a.camera.pose.latitude,fov:a.camera.pose.fov,offset:a.camera.pose.offset.clone(),distance:0});a.emit("pano.arrived",X("pano.arrived",{options:i,prevPano:K,progress:1,state:Te,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(Te);var Ee=a.works.getResolvedObserver(a.currentPano);if(Ee&&Ee.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var Qe=_A.clone().multiply((ee=(Oe=(Ce=a.models.getMaterial())===null||Ce===void 0?void 0:Ce.pano1)===null||Oe===void 0?void 0:Oe.matrix)!==null&&ee!==void 0?ee:new f.Matrix4).multiply(Ee.video.matrix),Ie={map:a.videoTexture,size:Ee.video.size,matrix:Qe,alpha:1},we=kt(),be=a.videoTexture.image;be.setAttribute("uuid",we),Ul().then(function(Ae){Ae&&Ee.video&&be.getAttribute("uuid")===we&&(be.oncanplay=function(){be.oncanplay=Q,be.play()},be.ontimeupdate=function(){be.currentTime>.5&&(be.ontimeupdate=Q,a.panoVideo.setMaterial(Ie))},be.src=Ee.video.source)}).catch(function(){be.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",X("pano.cancel",{options:i,prevPano:K,progress:0,state:G,userAction:a.userAction,error:null})),i.moveCancelCallback&&i.moveCancelCallback()})},t.prototype.checkSelectedPano=function(e){var r=this,i,a,o,s;this.stopMomentumMovement();var u=this.camera.getDirection(new f.Vector3).setY(0),l=null,c=this.works.getResolvedObserver(this.currentPano);if(!c)return null;var d=c.accessibleIds.filter(function(J){var W=Lt(J);if(Ar(W,r.currentPano))return!1;var $=r.works.getResolvedObserver(W);return!$||$.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:$.loadable||$.active}),p=this.models.intersectRaycaster(e)[0];if(p){var A=Br(d,function(J){var W=r.works.getResolvedObserver(J);if(!W)return 1/0;var $=W.standingPosition.clone();return $.distanceTo(p.point)},!0),h=A[0],v=A[1];h&&v<this.panoTapTriggerRadius&&(l=(i=this.works.getResolvedObserver(h))!==null&&i!==void 0?i:null)}if(_0(l)){var g=this.getForwardObserverOrNot(e);g&&(l=g)}for(var m=0,y=this.locationMotion.keyframes;m<y.length;m++){var b=y[m],x=this.panoResourceFromLocationMotionKeyframe(b);if(!(b.progress<this.locationMotion.progress)&&l&&x.panoId===l.panoId){l=null;break}}if(_0(l))return this.locationMotion.ended===!0&&this.cameraBounce(),null;if(l&&!l.active){var w=l.panoId;this.panoMeshes[w]&&(this.panoMeshes[w].setDisabled(!1),this.panoMeshes[w].setLoading(!0))}var M={};if(l){for(var S=Math.PI/6,E=Math.PI/12,P=new f.Vector3(0,1,0),B=l.position.clone().setY(0).sub(c.position.clone().setY(0)).normalize(),C=B.clone().applyAxisAngle(P,S),I=B.clone().applyAxisAngle(P,-S),F=[],T=[],L=[],D=0,V=l.accessibleIds;D<V.length;D++){var h=V[D],z=Lt(h);if(!(Ar(z,this.currentPano)||Ar(z,l.pano))){var U=this.works.getResolvedObserver(h);if(U){var q=U.position.clone().sub(l.position).setY(0);B.angleTo(q)<S?L.push(q):C.angleTo(q)<S?F.push(q):I.angleTo(q)<S&&T.push(q)}}}var G=L.length>0?L:vt(vt([],F,!0),T,!0),K=G.slice().sort(function(J,W){return J.angleTo(B)-W.angleTo(B)})[0];K&&K.angleTo(u)>E&&(M.longitude=Math.atan2(-K.x,-K.z))}this.cameraMotion.value.latitude<-Math.PI/4&&(M.latitude=ce(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(M.fov=this.defaultFov);var _={workCode:l.pano.workCode,panoIndex:l.pano.panoIndex,mode:this.mode,longitude:(a=M.longitude)!==null&&a!==void 0?a:this.camera.pose.longitude,latitude:(o=M.latitude)!==null&&o!==void 0?o:this.camera.pose.latitude,fov:(s=M.fov)!==null&&s!==void 0?s:this.camera.pose.fov,distance:0,offset:l?l.position.clone():new f.Vector3};return this.emit("pano.select",X("pano.select",{prevPano:this.currentPano,state:_,userAction:!0,options:M,progress:0,error:null})),l&&l.active?(this.emit("pano.request",X("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:_,options:M,error:null})),l.pano):null},t.prototype.destroy=function(){n.prototype.destroy.call(this)},t.prototype.isReady=function(){return!1},t.prototype.updateCamera=function(e,r,i){return Promise.resolve()},t.prototype.updateCameraWithKeyframes=function(e,r,i){return Promise.resolve()},t.prototype.updateTime=function(e,r){for(var i=this,a,o,s,u,l,c,d,p,A=[],h=2;h<arguments.length;h++)A[h-2]=arguments[h];this.userAction=!0;var v={},g={},m=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),y=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),b=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),g.longitude=this.cameraMotion.value.longitude,g.latitude=this.cameraMotion.value.latitude,g.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),v.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(ce(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var x=this.locationMotion.getKeyFrameSegment(e),w=x[0],M=x[1],S=this.panoResourceFromLocationMotionKeyframe(w),E=this.panoResourceFromLocationMotionKeyframe(M),P=new f.Vector3().copy(S.position),B=new f.Vector3().copy(E.position),C=this.locationMotion.value.count-M.value.count+1;v.progress=C,E.leftPanoPicture&&(C<1?S.leftPanoPicture&&(v.pano0=S.leftPanoPicture):v.pano0=E.leftPanoPicture,v.pano1=E.leftPanoPicture),E.effect==="montage"?v.transition="BLACK":E.effect==="spread"?v.transition="SPREAD":v.transition="FADE",(E.effect==="zoomin"||E.effect==="zoomout")&&(v.progress=Math.pow(C,3)),C<1&&E.effect!=="fly"&&(v.pano0&&S.leftPanoPicture&&(v.pano0={map:v.pano0.map,zoom:v.pano0.zoom,luminanceMap:v.pano0.luminanceMap,matrix:S.leftPanoPicture.matrix.clone().setPosition(E.position)}),P.copy(B),b=!0),g.distance=this.locationMotion.value.distance,g.offset=new f.Vector3(P.x+(B.x-P.x)*C,P.y+(B.y-P.y)*C,P.z+(B.z-P.z)*C);for(var I=[],F=[],T=0,L=this.locationMotion.keyframes;T<L.length;T++){var D=L[T],V=D.key,z=D.progress;V!==void 0&&(I.push(V),z>this.locationMotion.progress&&F.push(V))}for(var U=0,q=Object.keys(this.panoResources);U<q.length;U++){var G=q[U];if(!(F.indexOf(G)>=0)){var K=this.panoResources[G];if(K.leftPanoPicture){var _=K.leftPanoPicture.map;if(_){if(_===((a=v.pano0)===null||a===void 0?void 0:a.map)||_===((o=v.pano1)===null||o===void 0?void 0:o.map))continue;_ instanceof qe&&_.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(_.cubeRenderTarget),_.dispose(),K.leftPanoPicture=null}}I.indexOf(G)>=0||delete this.panoResources[G]}}this.currentPano=Lt(E.panoId),this.emit("pano.moving",X("pano.moving",{userAction:this.userAction,prevPano:Lt(m.panoId),state:O(O(O(O({},Lt(y.panoId)),{mode:this.mode}),tt(this.camera.pose)),g),options:{},progress:this.locationMotion.progress,error:null}))}or(v)===!1&&(!((s=v.pano0)===null||s===void 0)&&s.map&&v.pano0.map instanceof qe&&!v.pano0.map.cubeRenderTarget&&(v.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((u=v.pano1)===null||u===void 0)&&u.map&&v.pano1.map instanceof qe&&!v.pano1.map.cubeRenderTarget&&(v.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),this.models.setMaterial(v)),or(g)===!1&&this.setCamera(g);var J=this.works.getResolvedObserver(this.currentPano),W=A[1];if(!W){console.error("xrFrame丢失,请重试");return}if(!this.xrManager.session){console.error("session丢失,请重试");return}var $=this.xrManager.referenceSpace;if($){var Y=this.xrManager.cameraVR,Z=this.xrManager.cameraL,oe=this.xrManager.cameraR,ne=[Z,oe],de=W.getViewerPose($),se=new f.Vector3(0,0,0);if(de){var ye;ye=this.xrManager.session.renderState.baseLayer;var ie=de.views;if(!ye){console.error("no layer found");return}this.renderer.setFramebuffer(ye.framebuffer);var xe=!1;ie.length!==Y.cameras.length&&(Y.cameras.length=0,xe=!0),this.parallaxCameraMatrixs=[];var Le=new f.Vector3,Ce=new f.Vector3;new f.Matrix4().fromArray(ie[0].transform.matrix).decompose(Le,new f.Quaternion,new f.Vector3),new f.Matrix4().fromArray(ie[1].transform.matrix).decompose(Ce,new f.Quaternion,new f.Vector3),Ce.clone().sub(Le).normalize();var Oe=new f.Vector3,ee=new f.Quaternion,re=new f.Vector3;this.camera.matrix.decompose(Oe,ee,re);for(var H=0;H<ie.length;H++){var Be=ie[H],Te=ye.getViewport(Be),Ee=ne[H];Ee.matrix.fromArray(Be.transform.matrix);var Qe=new f.Vector3,Ie=new f.Quaternion,we=new f.Vector3;Ee.matrix.decompose(Qe,Ie,we),se.copy(Oe),Ee.position.copy(Oe),Ee.quaternion.copy(Ie),Ee.scale.copy(we),Ee.updateMatrix(),Ee.projectionMatrix.fromArray(Be.projectionMatrix),Ee.viewport.set(Te.x,Te.y,Te.width,Te.height),xe===!0&&Y.cameras.push(Ee)}if(this.xrManager.session&&this.xrManager.session.inputSources){for(var H=0;H<this.xrManager.session.inputSources.length;H++)if(this.xrManager.session.inputSources[H]&&this.xrManager.session.inputSources[H].targetRayMode==="transient-pointer"){var be=W.getPose(this.xrManager.session.inputSources[H].targetRaySpace,$);if(be){var Ae=new f.Vector3(0,0,-1).applyQuaternion(be.transform.orientation),me=new f.Raycaster(this.camera.position,Ae);this.gazeRay=me}}}if(this.xrManager.machineType==="Oculus"||this.xrManager.machineType==="Pico"){for(var ze=this.xrManager.session.inputSources,H=0;H<ze.length;H++){var pe=this.xrManager.controllers[H],Se=ze[H];if(Se){pe&&pe.update(Se,W,$);var me=this.xrManager.getController(H),St=new f.Vector3(0,1.2,0),Pe=me.position.clone().add(se).sub(St);Se.handedness==="left"?this.xrControllerRay.left.set(Pe,new f.Vector3(0,0,-1).applyEuler(me.rotation)):Se.handedness==="right"&&this.xrControllerRay.right.set(Pe,new f.Vector3(0,0,-1).applyEuler(me.rotation)),this.controllerWrappers[H].position.copy(new f.Vector3(0,0,0).add(se).sub(St));var _e=this.models.intersectRaycaster(this.xrControllerRay.right);if(_e.length===0&&(_e=this.xrControllerRay.right.intersectObject(this.boundingMesh,!0).map(function(_r){var mn;return O({floor:(mn=J==null?void 0:J.floorIndex)!==null&&mn!==void 0?mn:0},_r)})),_e.length>=1&&_e[0].face)if(Se.handedness==="right"){var it=this.xrControllerRay.right.intersectObject(this.xrCustomObjectsScene,!0),Jt=_e[0].face.normal,Kr=Jt.clone(),Xt=_e[0].point.clone();this.intersectMesh.position.copy(Xt);var ut=Xt.clone().add(Kr);if(this.intersectMesh.lookAt(ut),Math.abs(Jt.y)>.99){var Ct=this.camera.position.clone().sub(Xt);this.intersectMesh.rotation.z=-Math.atan2(Ct.z,Ct.x)}this.intersectMesh.visible=!0,this.needsRender=!0,it.length>0?(this.pointerLines.right.setPoints(Pe,it[0].point),this.pointerLines.right.points.visible=!0,this.intersectMesh.visible=!1):(this.pointerLines.right.points.visible=!1,this.pointerLines.right.setPoints(Pe,_e[0].point));var dt=_e[0],Et=X("intersect.update",{raycaster:(l=this.xrControllerRay.right)!==null&&l!==void 0?l:null,intersection:dt!=null?dt:null,object:this.intersectMesh});if(this.emit("intersect.update",Et),Et.defaultPrevented){this.hideIntersectMesh();return}}else this.pointerLines.left.setPoints(Pe,_e[0].point)}}this.updateControllerHelper(ze,e,r)}if(this.camera.pose.distance>.1||b)for(var It=0,Tt=Object.keys(this.panoMeshes);It<Tt.length;It++){var Xe=Tt[It],Ne=this.panoMeshes[Xe];Ne.setOpacity(0),Ne.setCurrent(!1),Ne.updateTime&&Ne.updateTime(e,r),Ne.visible=!1}else if(J){var We=Br(J.visibleIds,function(Pt){var sr=i.works.getResolvedObserver(Pt);return sr?J.standingPosition.distanceTo(sr.standingPosition):1/0},!0),At=We[1];At=ce(At,2.5,1/0);for(var Ze=J.visibleIds.concat(He(this.currentPano)),gt=this.getForwardObserverOrNot(),qt=this.camera.getDirection(new f.Vector3),yt=0,Wt=Object.keys(this.panoMeshes);yt<Wt.length;yt++){var Xe=Wt[yt],Ne=this.panoMeshes[Xe],xr=this.works.getResolvedObserver(Xe);if(Ze.indexOf(Xe)===-1)Ne.setCurrent(!1),Ne.setOpacity(0);else if(!xr)Ne.setCurrent(!1),Ne.setOpacity(0);else if(!xr.loadable&&!xr.active)Ne.setCurrent(!1),Ne.setOpacity(0);else{var jr=Ne.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Ne.setCurrent(!Ne.loading&&Ne.progress===0&>!==null&>.panoId===Xe),Ne.setOpacity(jr<.01?0:ce(At/jr*1.2,.65,.98));var wr=this.camera.position.clone().setY(Ne.position.y),Ae=new f.Vector3().copy(Ne.position).sub(wr).normalize();if(Xe===He(this.currentPano)){var Lr=ce((.5-wr.distanceTo(Ne.position))/.5,0,1);Ae.multiplyScalar(1-Lr).add(qt.clone().multiplyScalar(Lr))}Ae.length()>0&&Ne.quaternion.setFromEuler(new f.Euler(0,Math.atan2(Ae.x,Ae.z),0))}Ne.updateTime&&Ne.updateTime(e,r)}}var Dt=function(){return 4}(),Ge=function(){var Pt=new f.PerspectiveCamera;Pt.applyMatrix4(Y.matrix),Pt.position.set(0,0,0);var sr=i.works.getResolvedObserver(y.panoId),_r=sr!=null?sr:J;_r&&Pt.quaternion.premultiply(_r.quaternion.clone().inverse()),Pt.updateProjectionMatrix(),Pt.updateMatrixWorld(!0);var mn=new f.Frustum().setFromProjectionMatrix(new f.Matrix4().multiplyMatrices(Pt.projectionMatrix,Pt.matrixWorldInverse));return mn}();y.panoId===He(this.currentPano)&&((c=y.leftPanoPicture)===null||c===void 0?void 0:c.map)instanceof qe&&(y.leftPanoPicture.map.maxRequest=this.tileMaxRequest,y.leftPanoPicture.map.update(Ge,Dt),y.leftPanoPicture.map.needsRender===!0&&(this.needsRender=!0,this.modelSceneNeedsRender=!0));{var ke=this.tiling.object.visible;if(this.initAnimationed){var Ye=y.panoId,bt=this.works.getResolvedObserver(Ye);bt?Fi(this.camera.position,bt.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==Ye&&this.tiling.cleanup(),this.tiling.panoId=Ye,this.tiling.setResource((p=(d=bt.images)===null||d===void 0?void 0:d.tiles)!==null&&p!==void 0?p:[],this.enableIOSEDR&&bt.images.luminance?bt.images.luminance:null),this.tiling.setFetcher(pt(bt.work)),this.tiling.setRotation(bt.quaternion),this.tiling.setPosition(bt.position),this.tiling.maxRequest=this.tileMaxRequest,Dt>this.tiledCubeTextureLevel?this.tiling.update(Ge,Dt,e):this.tiling.update(Ge,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;ke!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0,this.modelSceneNeedsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e)}}},t.prototype.render=function(){var e=this.xrManager.getCamera(this.camera);this.renderer.render(this.modelScene,e),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,e),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.updateControllerHelper=function(e,r,i){var a=this.xrControllerRay.left,o=this.xrControllerRay.right;if(!(!e||e.length===0)){for(var s={buttons:{X:!1,Y:!1,LeftTrigger:!1,LeftPinch:!1,A:!1,B:!1,RightTrigger:!1,RightPinch:!1}},u=0;u<e.length;u++){var l=e[u].handedness,c=e[u].gamepad;switch(l){case"left":c.axes&&(this.emitHandleEvent(c.axes[2]===-1,"LeftAxesLeft",r),this.emitHandleEvent(c.axes[2]===1,"LeftAxesRight",r),this.emitHandleEvent(c.axes[3]===-1,"LeftAxesUp",r),this.emitHandleEvent(c.axes[3]===1,"LeftAxesDown",r)),c!=null&&c.buttons&&(c.buttons[4]&&this.emitHandleEvent(c.buttons[4].pressed,"X",r),c.buttons[5]&&this.emitHandleEvent(c.buttons[5].pressed,"Y",r),c.buttons[0]&&this.emitHandleEvent(c.buttons[0].pressed,"LeftTrigger",r),c.buttons[1]&&this.emitHandleEvent(c.buttons[1].pressed,"LeftPinch",r));var d={raycaster:a,axes:{up:c.axes&&c.axes[3]<0?Math.abs(c.axes[3]):0,down:c.axes&&c.axes[3]<0?0:Math.abs(c.axes[3]),left:c.axes&&c.axes[2]<0?Math.abs(c.axes[2]):0,right:c.axes&&c.axes[2]<0?0:Math.abs(c.axes[2])},deltaTime:i};s.buttons.X=c.buttons&&c.buttons[4]?c.buttons[4].pressed:!1,s.buttons.Y=c.buttons&&c.buttons[5]?c==null?void 0:c.buttons[5].pressed:!1,s.buttons.LeftTrigger=c.buttons&&c.buttons[0]?c==null?void 0:c.buttons[0].pressed:!1,s.buttons.LeftPinch=c.buttons&&c.buttons[1]?c==null?void 0:c.buttons[1].pressed:!1,s.left=d;break;case"right":c.axes&&(this.emitHandleEvent(c.axes[2]===-1,"RightAxesLeft",r),this.emitHandleEvent(c.axes[2]===1,"RightAxesRight",r),this.emitHandleEvent(c.axes[3]===-1,"RightAxesUp",r),this.emitHandleEvent(c.axes[3]===1,"RightAxesDown",r)),c.buttons&&(c.buttons[4]&&this.emitHandleEvent(c.buttons[4].pressed,"A",r),c.buttons[5]&&this.emitHandleEvent(c.buttons[5].pressed,"B",r),c.buttons[0]&&this.emitHandleEvent(c.buttons[0].pressed,"RightTrigger",r),c.buttons[1]&&this.emitHandleEvent(c.buttons[1].pressed,"RightPinch",r));var p={raycaster:o,axes:{up:c.axes&&c.axes[3]<0?Math.abs(c.axes[3]):0,down:c.axes&&c.axes[3]<0?0:Math.abs(c.axes[3]),left:c.axes&&c.axes[2]<0?Math.abs(c.axes[2]):0,right:c.axes&&c.axes[2]<0?0:Math.abs(c.axes[2])},deltaTime:i};s.right=p,s.buttons.A=c.buttons&&c.buttons[4]?c==null?void 0:c.buttons[4].pressed:!1,s.buttons.B=c.buttons&&c.buttons[5]?c==null?void 0:c.buttons[5].pressed:!1,s.buttons.RightTrigger=c.buttons&&c.buttons[0]?c==null?void 0:c.buttons[0].pressed:!1,s.buttons.RightPinch=c.buttons&&c.buttons[1]?c==null?void 0:c.buttons[1].pressed:!1;break}}this.emit("xr.controller.update",X("xr.controller.update",s))}},t.prototype.emitHandleEvent=function(e,r,i){var a=this.xrControllerRay.left,o=this.xrControllerRay.right;if(e)if(this.xrHandleState[r].touchStart===!1)this.xrHandleState[r].touchStartTime=i,this.xrHandleState[r].touchStart=!0,this.emit("xr.gesture.buttonDown",X("xr.gesture.buttonDown",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!1,isFirst:!0,controllers:{raycaster:{leftRay:a,rightRay:o}}}));else{var s=i-this.xrHandleState[r].touchStartTime;s>Y0&&this.emit("xr.gesture.press",X("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!0,controllers:{raycaster:{leftRay:a,rightRay:o}}}))}else if(this.xrHandleState[r].touchStart===!0){this.emit("xr.gesture.buttonUp",X("xr.gesture.buttonUp",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:a,rightRay:o}}}));var s=i-this.xrHandleState[r].touchStartTime;if(s<=Y0){var u=X("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:a,rightRay:o}}}),l=this.emit("xr.gesture.tap",u);!l&&!u.defaultPrevented&&r==="RightTrigger"&&this.checkSelectedPano(this.xrControllerRay.right)}this.xrHandleState[r].touchStart=!1,this.xrHandleState[r].touchStartTime=0}},t.prototype.initHandEvent=function(){var e=this;if(!this.xrManager.session)throw new Error("初始化失败");this.xrManager.session.addEventListener("select",function(r){e.gazeRay&&e.checkSelectedPano(e.gazeRay)})},t}(ps),ht={Floorplan:No,Topview:Am,Panorama:ps,VRPanorama:fA,Model:pA,Mapview:CA,XRPanorama:JA},XA={Floorplan:$t,Topview:mm,Panorama:pr,VRPanorama:cA,Model:hA,Mapview:Ir,XRPanorama:KA},ec=["gesture.pan","gesture.tap","gesture.dbltap","gesture.press","gesture.pinch","gesture.mousewheel","gesture.mousemove","gesture.momentum","initAnimation.start","initAnimation.end","camera.update","intersect.update","pano.select","pano.moveTo","pano.moving","pano.arrived","pano.cancel","pano.error","pano.texture.load","pano.texture.progress","pano.texture.success","pano.texture.error","pano.texture.abort","xr.session.start","xr.session.end","xr.gesture.tap","xr.gesture.press","xr.gesture.buttonUp","xr.gesture.buttonDown","xr.controller.update"];function WA(n){n.on("initAnimation.start",function(t){n.emit("initAnimationWillStart",t.state.panoIndex,t.state,t.userAction)}),n.on("initAnimation.end",function(t){n.emit("initAnimationEnded",t.state.panoIndex,t.state,t.userAction)}),n.on("gesture.pan",function(t){var e=!1;e=n.emit("wantsGesture","pan",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPanGesture",t.state,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","pan",t.pointers,t.isFinal),n.emit("panGesture",t.state,t.isFinal))}),n.on("gesture.tap",function(t){var e=!1;e=n.emit("wantsGesture","tap",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsTapGesture",t.center.raycaster,t.center.coords,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","tap",t.pointers,t.isFinal),n.emit("tapGesture",t.center.raycaster,t.center.coords,t.isFinal))}),n.on("gesture.dbltap",function(t){var e=!1;e=n.emit("wantsGesture","dbltap",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsDblTapGesture",t.center.raycaster,t.center.coords,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","dbltap",t.pointers,t.isFinal),n.emit("dblTapGesture",t.center.raycaster,t.center.coords,t.isFinal))}),n.on("gesture.press",function(t){var e=!1;e=n.emit("wantsGesture","press",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPressGesture",t.center.raycaster,t.center.coords,t.center.delta,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","press",t.pointers,t.isFinal),n.emit("pressGesture",t.center.raycaster,t.center.coords,t.center.delta,t.isFinal))}),n.on("gesture.pinch",function(t){var e=!1;e=n.emit("wantsGesture","pinch",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPinchGesture",t.scale,t.state.fov,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","pinch",t.pointers,t.isFinal),n.emit("pinchGesture",t.scale,t.state.fov,t.isFinal))}),n.on("gesture.mousewheel",function(t){var e=!1;e=n.emit("wantsGesture","mouseWheel",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsMouseWheel",t.center.delta,t.state.fov,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","mouseWheel",t.pointers,t.isFinal),n.emit("mouseWheel",t.center.delta,t.state.fov,t.isFinal))}),n.on("gesture.mousemove",function(t){var e=!1;e=n.emit("wantsGesture","mouseMove",t.pointers,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","mouseMove",t.pointers,t.isFinal),e=n.emit("wantsChangeCameraFov",t.state.fov),e&&t.preventDefault())}),n.on("gesture.momentum",function(t){var e=!1;e=n.emit("wantsInteriaPan",t.state),e&&t.preventDefault(),t.defaultPrevented||n.emit("interiaPan",t.state,t.isFinal)}),n.on("camera.update",function(t){n.emit("cameraFovUpdate",t.state.fov,t.userAction),n.emit("cameraDirectionUpdate",t.state,t.userAction);var e=nr(t.state);e.setLength(t.state.distance);var r=t.state.offset.clone().sub(e);n.emit("cameraPositionUpdate",r,t.userAction),n.emit("cameraUpdate",t.state,t.userAction)}),n.on("intersect.update",function(t){if(t.intersection){var e=!1;e=n.emit("wantsShowIntersectionOnModel",t.raycaster),e&&t.preventDefault(),t.defaultPrevented||n.emit("intersectionOnModelUpdate",t.intersection,t.object)}else n.emit("intersectionHidden")}),n.on("pano.request",function(t){var e=n.emit("wantsMoveToPano",t.state.panoIndex,t.options,t.userAction);e||(e=n.emit("wantsToMoveToPano",t.state.panoIndex,t.options,t.userAction)),e&&t.preventDefault(),t.defaultPrevented||n.emit("panoWillLoad",t.state.panoIndex)}),n.on("pano.select",function(t){n.emit("panoSelected",t.state.panoIndex)}),n.on("pano.moveTo",function(t){n.emit("panoLoaded",t.state.panoIndex),n.emit("moveToPano",t.state.panoIndex,t.userAction),n.emit("panoWillArrive",t.state.panoIndex,t.state,t.userAction)}),n.on("pano.moving",function(t){n.emit("movingToPano",t.state.panoIndex,t.prevPano.panoIndex,t.progress)}),n.on("pano.arrived",function(t){n.emit("panoArrived",t.state.panoIndex,t.state,t.userAction)}),n.on("pano.cancel",function(t){n.emit("moveToPanoCanceled",t.state.panoIndex)}),n.on("pano.error",function(t){n.emit("panoLoadError",t.error,t.state.panoIndex)}),n.on("pano.texture.load",function(t){n.emit("textureStartLoad",t.pano.panoIndex)}),n.on("pano.texture.success",function(t){n.emit("textureLoaded",t.pano.panoIndex,t.meta)}),n.on("pano.texture.error",function(t){n.emit("textureError",t.error,t.pano.panoIndex)}),n.on("pano.texture.abort",function(t){n.emit("textureAbort",t.pano.panoIndex)}),n.on("pano.texture.progress",function(t){n.emit("textureLoading",t.progress,t.pano.panoIndex)}),n.on("xr.session.start",function(t){n.emit("webXRSessionStart")}),n.on("xr.session.end",function(t){n.emit("webXRSessionEnd")}),n.on("xr.gesture.tap",function(t){n.emit("webXRControllerEvent","tap",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.press",function(t){n.emit("webXRControllerEvent","press",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.buttonUp",function(t){n.emit("webXRControllerEvent","buttonUp",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.buttonDown",function(t){n.emit("webXRControllerEvent","buttonDown",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.controller.update",function(t){n.emit("webXRControllerRayUpdate",{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0}),t.left&&n.emit("webXRAxesUpdate","left",{raycaster:{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0},axesState:{up:t.left.axes.up,down:t.left.axes.down,left:t.left.axes.left,right:t.left.axes.right},deltaTime:t.left.deltaTime}),t.right&&n.emit("webXRAxesUpdate","right",{raycaster:{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0},axesState:{up:t.right.axes.up,down:t.right.axes.down,left:t.right.axes.left,right:t.right.axes.right},deltaTime:t.right.deltaTime})}),n.on("works.request",function(t){n.emit("willLoad",t.input,t.works[0],t.state)}),n.on("works.load",function(t){n.emit("load",t.input,t.works[0],t.state)}),n.on("works.ready",function(t){n.emit("loaded",t.input,t.works[0])}),n.on("state.change",function(t){n.emit("stateChange",t.state,t.userAction)}),n.on("currentState.change",function(t){n.emit("currentStateChange",t.state,t.userAction)}),n.on("state.set",function(t){n.emit("setState",t.state)}),n.on("state.synced",function(t){n.emit("stateSynced",t.state)}),n.on("model.request",function(t){n.emit("modelWillLoad",t.work.model)}),n.on("model.error",function(t){n.emit("modelLoadError",t.error,t.model)}),n.on("model.load",function(t){n.emit("modelLoaded",t.model)}),n.on("model.changeShownFloor",function(t){n.emit("modelShownFloorChange",t.model.shownFloor,t.model.floorLength)}),n.on("render",function(t){n.emit("renderFrame",t.needsRender)}),n.on("mode.change.request",function(t){n.emit("wantsChangeMode",t.mode,t.prevMode)}),n.on("mode.change",function(t){n.emit("modeChange",t.mode,t.prevMode,t.state.panoIndex,t.state,t.userAction)}),n.on("helpers.visible",function(t){n.emit("helpersVisibleChange",t.object.visible)}),n.on("network.resource",function(t){n.emit("network",t.source,t.requestType,t.requestState,t.detail)})}function ZA(){if(typeof window!="undefined"){var n=document.createElement("video");n.loop=!0,n.autoplay=!0,n.playsInline=!0,n.muted=!0,n.crossOrigin="";var t=function(){document.removeEventListener("touchstart",t,!1),document.removeEventListener("mousedown",t,!1),n.muted=!1};return document.addEventListener("touchstart",t,!1),document.addEventListener("mousedown",t,!1),n}else return{}}function eu(n){var t=new f.Group;t.name="internalLights";{var e=new f.DirectionalLight(16777215,.3);e.position.copy(new f.Vector3(1,1,1)),t.add(e)}{var e=new f.DirectionalLight(16777215,.1);e.position.copy(new f.Vector3(-1,-1,-1)),t.add(e)}{var e=new f.DirectionalLight(16777215,.1);t.add(e)}{var e=new f.AmbientLight(16777215,.6);t.add(e)}n.add(t)}function YA(n){for(var t,e,r={},i=n.split(/(\;|\,)/),a=0,o=i;a<o.length;a++){var s=o[a],u=s.split("="),l=(t=u[0])===null||t===void 0?void 0:t.trim(),c=(e=u[1])===null||e===void 0?void 0:e.trim();l&&c&&(r[l]=c)}return r}function tc(){var n;if(typeof document!="undefined")for(var t=document.getElementsByTagName("meta"),e=0;e<t.length;e++){var r=t[e];if(r.getAttribute("name")==="viewport"){var i=YA((n=r.getAttribute("content"))!==null&&n!==void 0?n:""),a=Number(i["initial-scale"]);if(!isNaN(a))return a}}return 1}const $A="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I6DMP+J7cTvEtokEx0aPscyddoFJKpSZqV7G1GTxcpmEthpnw5058c6GfwqpwzGOtGjXSJI3FLYhc+O+jSr9aGhPWQlRshS8AticLX7wnsgbXxt6gsWCpRBa0vRGQM8oB9dhmP3QAwFX4c079dJNq6Qi5xbuyTmpPSJ1Ur4UtF7GoTtmUL3zxaWqMU8P/k3cXSQ1EQRjHGdzdHTa4u7tzBs7CedhykNwF2/5jq56iU11db6Lv2yTj8hs3JoiU9sZZp5/62J5v1z9NjrDHaSbnbFMf52sHrDUVaidDxNG0o9+uLjfosfdb3jT5d5j757riJgst9NIZQ2Pn+ySZll80vjI6Wz/hQJG4vPG0L/H6poQch/dW3vL3B0u8jl0HvVj5PvHCElEF8DUAFikVYTcvmfBdDzQlvvMXSV5lP5zrXj/fJ54zuWaeeuoqkW8AwCIaqeTZKkmYrpPwR2eqN9X72W7EG57vU67OBeuMV8KXLUzv93UTTj42tvaFS++GVsc5JRyLSLJ8nzO555hFBmiSRCqMr4GwrcmGkib5xSvcwmzFK6e8s7DMa2xH4YZdZumSOwsVzFeBWdr37tpIhOpSwXqONNgZq/2KgvBt54znHN1HzlljTO4oVD5fb+prNIJXQNL1ofDKQisbPLJDv3jNSLq9OkYBEIihKIj3v7S1TRQCX5Kdl1ZQlol7LF+E++fwirfiq2sf4cTXxc6hzxffPuLEeqSWrPGWMF58TWr5viyJAP5/4EV4KePiaSE8eNRgjDy8/tyRW+FZjhS+2tlovNJovtJovNJ0uhK6Wo64SDdxEbM//KesjwAAAABJRU5ErkJggg==";var tu=[351,63],ru=[20,20],eg=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),tg=new Float32Array([0,0,1,0,0,1,1,1]),rg=new Uint8Array([0,1,2,1,3,2]),wa=new f.BufferGeometry;wa.setAttribute("position",new f.BufferAttribute(eg,3));wa.setAttribute("uv",new f.BufferAttribute(tg,2));wa.setIndex(new f.BufferAttribute(rg,1));var ta=new f.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),rc=new f.Mesh(wa,ta);rc.matrixAutoUpdate=!1;var ys=new f.Scene;ys.add(rc);ys.matrixAutoUpdate=!1;var Li=new f.OrthographicCamera(-.5,.5,.5,-.5,.1,1);Li.position.set(0,0,.5);Li.lookAt(0,0,0);Li.updateMatrixWorld(!0);Li.matrixAutoUpdate=!1;var ng=new f.Vector4,ig=new f.Vector4;function ag(n){if(ta.map){var r=n.getViewport(ng),i=n.getScissor(ig),a=n.getScissorTest(),o=n.autoClear,s=i.x+ru[0]/3,u=i.y+ru[1]/3,l=tu[0]/3,c=tu[1]/3;n.setViewport(s,u,l,c),n.setScissor(s,u,l,c),n.setScissorTest(!0),n.autoClear=!1,n.render(ys,Li),n.setViewport(r),n.setScissor(i),n.setScissorTest(a),n.autoClear=o}else{var t=new f.Texture,e=new Image;e.onload=function(){t.image=e,t.wrapS=f.ClampToEdgeWrapping,t.wrapT=f.ClampToEdgeWrapping,t.minFilter=f.LinearFilter,t.needsUpdate=!0,t.generateMipmaps=!1,ta.needsUpdate=!0,e.onload=Q},e.src=$A,ta.map=t}}var og=800,nu=90,sg=function(n){return n.replace("//vrlab-public.ljcdn.com/","//vr-public.realsee-cdn.cn/").replace("//vrlab-image4.ljcdn.com/","//vr-image-4.realsee-cdn.cn/").replace("//vrlab-image3.ljcdn.com/","//vr-image-3.realsee-cdn.cn/").replace("//vrlab-image2.ljcdn.com/","//vr-image-2.realsee-cdn.cn/").replace("//vrlab-image1.ljcdn.com/","//vr-image-1.realsee-cdn.cn/")},ug=new f.Vector2,lg=new f.Sphere,ji=new f.Frustum,_i=new f.Matrix4,iu=new WeakMap,vo=new WeakMap,mo=Lo([]);new Xo;var nc=function(n){ue(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,u,l,c,d,p,A,h=n.call(this)||this;if(h.ident=kt(),typeof window!="undefined"&&(Qo.instances[h.ident]=h),h.renderSwitch01=0,h.currentMode="Panorama",h.pano={workCode:"",panoIndex:0},h.needsRender=!1,h.modelSceneNeedsRender=!1,h.onlyRenderIfNeeds=(r=e.onlyRenderIfNeeds)!==null&&r!==void 0?r:!0,h.imageOptions=O({},(i=e.imageOptions)!==null&&i!==void 0?i:{}),h.textureOptions=O({},(a=e.textureOptions)!==null&&a!==void 0?a:{}),h.poweredByRealsee=(o=e.poweredByRealsee)!==null&&o!==void 0?o:!0,h.extraElements=[],h.controllerInits={Panorama:Object.assign({},e.panorama),Model:Object.assign({},e.model),Floorplan:Object.assign({},e.floorplan),Topview:Object.assign({},e.topview),Mapview:Object.assign({},e.mapview),VRPanorama:Object.assign({},e.vrPanorama),XRPanorama:Object.assign({},e.xrPanorama)},h.fps={testCount:0,testTime:ve()},h.info=null,h.modeChangeDuration=(s=e.modeChangeDuration)!==null&&s!==void 0?s:og,h.enableWheel=(u=e.enableWheel)!==null&&u!==void 0?u:!0,typeof window!="undefined")if("renderer"in e)e.renderer instanceof xn&&h.throwError(new Error("cannot render a internal renderer")),h.renderer=e.renderer;else try{h.renderer=new xn({preserveDrawingBuffer:e.preserveDrawingBuffer,backgroundColor:e.backgroundColor,backgroundAlpha:e.backgroundAlpha,antialias:e.antialias,webgl2:e.webgl2,logarithmicDepthBuffer:e.logarithmicDepthBuffer,precision:e.precision,powerPreference:e.powerPreference});var v=tc();h.renderer.setPixelRatio(v===1?window.devicePixelRatio:1),h.renderer.setSize(512,512)}catch(B){B instanceof Error&&h.throwError(B)}h.getPixelsRenderTarget=new f.WebGLRenderTarget(1,1,{encoding:(c=(l=h.renderer)===null||l===void 0?void 0:l.outputEncoding)!==null&&c!==void 0?c:f.sRGBEncoding,generateMipmaps:!1});var g=new f.DepthTexture(1,1);g.generateMipmaps=!1,g.format=f.DepthStencilFormat,g.type=f.UnsignedInt248Type,h.modelRenderTarget=new f.WebGLRenderTarget(1,1,{encoding:(p=(d=h.renderer)===null||d===void 0?void 0:d.outputEncoding)!==null&&p!==void 0?p:f.sRGBEncoding,depthTexture:g,generateMipmaps:!1,depthBuffer:!0,stencilBuffer:!0}),h.scissor=Object.assign({left:0,bottom:0,width:1,height:1},e.scissor),h.camera=new Su(nu),h.scene=new Xo,h.xrCustomObjectsScene=new f.Scene,h.scene.add(h.xrCustomObjectsScene),h.scene.matrixAutoUpdate=!1,h.lastLoadWorkTask=Promise.resolve(),h.requestProxy=(A=e.requestProxy)!==null&&A!==void 0?A:sg,h.networkSubscribe=new du,h.networkSubscribe.on("network",function(B,C,I,F){var T;h.emit("network.resource",X("network.resource",{source:B,requestType:C,requestState:I,detail:F})),(T=h.analysis)===null||T===void 0||T.network(h.works,B,C,I,F)}),h.boundingMesh=$v(new f.Box3(new f.Vector3(-.5,-.5,-.5),new f.Vector3(.5,.5,.5))),h.boundingMesh.name="bounding",h.models=I0(),h.models.push(new Oo),h.lastModels=I0(),h.lastWorks=Lo([]),h.readyCallbacks=[],h.syncingState=!1,h.helperGroup=new f.Group,h.helperGroup.name="helper",h.helperGroup.matrixAutoUpdate=!1,h.scene.add(h.helperGroup),h.modelGroup=new f.Group,h.modelGroup.visible=!1,h.modelGroup.name="model",h.modelGroup.matrixAutoUpdate=!1,h.modelScene=new f.Scene,h.modelScene.add(h.modelGroup),h.modelScene.add(h.boundingMesh),h.modelScene.matrixAutoUpdate=!1,h.videoTexture=new f.VideoTexture(e.videoInstance||ZA()),eu(h.scene),eu(h.modelScene),h.state={mode:h.currentMode,workCode:h.pano.workCode,panoIndex:h.pano.panoIndex,longitude:h.camera.pose.longitude,latitude:h.camera.pose.latitude,fov:h.camera.pose.fov,offset:h.camera.pose.offset.clone(),distance:h.camera.pose.distance},h.stateSynced=!1,h._enablePostProcessing=!1,h._enableIOSEDR=!1,h._enableEDL=!1,h._enableHQ=!1,h.destroyed=!1,h.paused=!0,typeof window!="undefined"&&(e.play!==!1&&h.play(),h.stopAnimationLoop=Mt.shared.add(function(B,C){for(var I=[],F=2;F<arguments.length;F++)I[F-2]=arguments[F];h.updateTime.apply(h,vt([B,C],I,!1))},!1,0,10));var m=function(){typeof document!="undefined"&&document.fullscreenElement===null&&h.currentMode==="VRPanorama"&&h.controller.emit("vr.requestExit",X("vr.requestExit",{}))},y=function(){h.needsRender=!0,h.modelSceneNeedsRender=!0};if(typeof document!="undefined"&&document.addEventListener("fullscreenchange",m,!1),h.renderer&&h.renderer.domElement.addEventListener("webglcontextrestored",y,!1),h.removeEventListeners=function(){typeof document!="undefined"&&document.removeEventListener("fullscreenchange",m,!1),h.renderer&&h.renderer.domElement.removeEventListener("webglcontextrestored",y,!1)},h.plugins={},e.plugins&&e.plugins.length)for(var b=0,x=e.plugins;b<x.length;b++){var w=x[b];if(typeof w=="function")w(h);else if(Array.isArray(w)){var M=w[0],S=w[1],E=w[2];if(typeof M=="function"){var P=M(h,E);typeof S=="string"&&(h.plugins[S]?h.throwError(new Error("plugin name ".concat(S," is exists."))):h.plugins[S]=P)}}}return h.gpuPickingRenderTarget=new f.WebGLRenderTarget(1,1,{generateMipmaps:!1}),h.meshReplaceMaterialMap=new Map,h.meshOriginMaterialMap=new Map,WA(h),h}return Object.defineProperty(t,"version",{get:function(){return"6.4.0-alpha.26"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return ua.decoderPath},set:function(e){ua.setDecoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ktx2Path",{get:function(){return fi.transcoderPath},set:function(e){fi.setTranscoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panoIndex",{get:function(){return this.pano.panoIndex},enumerable:!1,configurable:!0}),t.prototype.getGPUPicking=function(e,r,i,a,o){var s=this;if(a===void 0&&(a=1),o===void 0&&(o=new f.Vector3(0,0,0)),!this.renderer)throw new Error("renderer is not initialized.");var u=this.models.getMaterial(),l=u.constantColor,c=u.colorStyle;this.models.setMaterial({colorStyle:"CONSTANT",constantColor:o}),this.scene.traverse(function(h){if(!(!(h instanceof f.Mesh)||h instanceof Ot)){var v=Object.keys(i).filter(function(m){return m===h.uuid})[0];if(v)if(s.meshOriginMaterialMap.set(v,h.material),s.meshReplaceMaterialMap.get(v))h.material=s.meshReplaceMaterialMap.get(v);else{var g=new f.ShaderMaterial({uniforms:{color:{value:i[v]}},vertexShader:`
|
|
2169
|
+
`},gs=function(n){ue(t,n);function t(e){var r=n.call(this,{uniforms:f.UniformsUtils.clone(po.uniforms),vertexShader:po.vertexShader,fragmentShader:po.fragmentShader,clipping:!0})||this;return r.type="LineMaterial",r.dashed=!1,Object.defineProperties(r,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(i){this.uniforms.diffuse.value=i}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(i){this.uniforms.linewidth.value=i}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(i){this.uniforms.dashScale.value=i}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(i){this.uniforms.dashSize.value=i}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(i){this.uniforms.gapSize.value=i}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(i){this.uniforms.opacity.value=i}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(i){this.uniforms.resolution.value.copy(i)}}}),r.setValues(e),r}return t}(f.ShaderMaterial);Object.assign(gs.prototype,{isLineMaterial:!0});var Wl=function(n){ue(t,n);function t(e,r){var i=n.call(this)||this;return i.type="LineSegments2",i.geometry=e!==void 0?e:new As,i.material=r!==void 0?r:new gs({color:Math.random()*16777215}),i}return t.prototype.computeLineDistances=function(){for(var e=this.geometry,r=e.attributes.instanceStart,i=e.attributes.instanceEnd,a=new Float32Array(2*r.count),o=new f.Vector3,s=new f.Vector3,u=0,l=0,c=r.count;u<c;u++,l+=2)o.fromBufferAttribute(r,u),s.fromBufferAttribute(i,u),a[l]=l===0?0:a[l-1],a[l+1]=a[l]+o.distanceTo(s);var d=new f.InstancedInterleavedBuffer(a,2,1);return e.setAttribute("instanceDistanceStart",new f.InterleavedBufferAttribute(d,1,0)),e.setAttribute("instanceDistanceEnd",new f.InterleavedBufferAttribute(d,1,1)),this},t.prototype.raycast=function(e,r){e.camera===null&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var i=e.ray,a=e.camera,o=a.projectionMatrix,s=this.geometry,u=this.material,l=u.resolution,c=u.linewidth,d=s.attributes.instanceStart,p=s.attributes.instanceEnd,A=new f.Vector4,h=new f.Vector4,v=new f.Vector4,g=new f.Vector3,m=new f.Matrix4,y=new f.Line3,b=new f.Vector3;i.at(1,v),v.w=1,v.applyMatrix4(a.matrixWorldInverse),v.applyMatrix4(o),v.multiplyScalar(1/v.w),v.x*=l.x/2,v.y*=l.y/2,v.z=0,g.copy(v);var x=this.matrixWorld;m.multiplyMatrices(a.matrixWorldInverse,x);for(var w=0,M=d.count;w<M;w++){A.fromBufferAttribute(d,w),h.fromBufferAttribute(p,w),A.w=1,h.w=1,A.applyMatrix4(m),h.applyMatrix4(m),A.applyMatrix4(o),h.applyMatrix4(o),A.multiplyScalar(1/A.w),h.multiplyScalar(1/h.w);var S=A.z<-1&&h.z<-1,E=A.z>1&&h.z>1;if(!(S||E)){A.x*=l.x/2,A.y*=l.y/2,h.x*=l.x/2,h.y*=l.y/2,y.start.copy(A),y.start.z=0,y.end.copy(h),y.end.z=0;var B=y.closestPointToPointParameter(g,!0);y.at(B,b);var R=f.MathUtils.lerp(A.z,h.z,B),C=R>=-1&&R<=1,I=g.distanceTo(b)<c*.5;if(C&&I){y.start.fromBufferAttribute(d,w),y.end.fromBufferAttribute(p,w),y.start.applyMatrix4(x),y.end.applyMatrix4(x);var L=new f.Vector3,T=new f.Vector3;i.distanceSqToSegment(y.start,y.end,T,L),r.push({point:T,pointOnLine:L,distance:i.origin.distanceTo(T),object:this,faceIndex:w})}}}},t}(f.Mesh);Object.assign(Wl.prototype,{isLineSegments2:!0});var Zl=function(n){ue(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.type="Line2",i}return t}(Wl);Object.assign(Zl.prototype,{isLine2:!0});var Yl=function(n){ue(t,n);function t(){var e=n.call(this)||this;return e.type="LineGeometry",e}return t.prototype.setPositions=function(e){for(var r=e.length-3,i=new Float32Array(2*r),a=0;a<r;a+=3)i[2*a]=e[a],i[2*a+1]=e[a+1],i[2*a+2]=e[a+2],i[2*a+3]=e[a+3],i[2*a+4]=e[a+4],i[2*a+5]=e[a+5];return n.prototype.setPositions.call(this,i),this},t.prototype.setColors=function(e){for(var r=e.length-3,i=new Float32Array(2*r),a=0;a<r;a+=3)i[2*a]=e[a],i[2*a+1]=e[a+1],i[2*a+2]=e[a+2],i[2*a+3]=e[a+3],i[2*a+4]=e[a+4],i[2*a+5]=e[a+5];return n.prototype.setColors.call(this,i),this},t.prototype.fromLine=function(e){var r=e.geometry;if(r instanceof f.Geometry){var i=new f.BufferGeometry().fromGeometry(r);this.setPositions(i.attributes.position.array)}else r instanceof f.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.copy=function(){return this},t}(As);Object.assign(Yl.prototype,{isLineGeometry:!0});var PA="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9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r8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==",X0=14467195,RA=8,BA=2,FA=20,W0=null,zo=function(n){ue(t,n);function t(e,r){e===void 0&&(e=new f.Vector3),r===void 0&&(r=new f.Vector3);var i=n.call(this)||this;i.type="FiveLine",i.needsRender=!0;var a=new Yl,o=new gs({color:X0,linewidth:BA,dashScale:FA,dashed:!1});i.line=new Zl(a,o);var s=new f.BufferGeometry,u=new f.PointsMaterial({color:X0,size:RA,map:W0||(W0=new f.TextureLoader().load(PA)),sizeAttenuation:!1,transparent:!0});return i.points=new f.Points(s,u),i.points.renderOrder=11,i.points.frustumCulled=!1,i.setPoints(e,r),i.add(i.line,i.points),i}return Object.defineProperty(t,"version",{get:function(){return"6.4.0-alpha.28"},enumerable:!1,configurable:!0}),t.prototype.setPoints=function(e,r){var i=[].concat(e.toArray(),r.toArray());this.points.geometry.setAttribute("position",new f.BufferAttribute(new Float32Array(i),3)),this.line.geometry.setPositions(i),this.line.computeLineDistances(),this.needsRender=!0},t.prototype.getPoints=function(){var e=this.points.geometry.attributes.position.array;return[new f.Vector3(e[0],e[1],e[2]),new f.Vector3(e[3],e[4],e[5])]},t.prototype.setMaterial=function(e){var r=this.line.material;for(var i in e)if(e.hasOwnProperty(i)){var a=e[i];i==="dashed"?(r.dashed=a,a?r.defines.USE_DASH="":delete r.defines.USE_DASH,r.needsUpdate=!0):r[i]=e[i]}this.needsRender=!0},t.prototype.setResolution=function(e,r){var i=this.line.material.resolution;(i.x!==e||i.y!==r)&&(i.set(e,r),this.needsRender=!0)},t}(f.Object3D);Object.assign(zo.prototype,{isFiveLine:!0});var rt={Handedness:Object.freeze({NONE:"none",LEFT:"left",RIGHT:"right"}),ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})};function $l(n){return ha(this,void 0,void 0,function(){var t;return pa(this,function(e){switch(e.label){case 0:return[4,fetch(n)];case 1:if(t=e.sent(),t.ok)return[2,t.json()];throw new Error(t.statusText)}})})}function LA(n){return ha(this,void 0,void 0,function(){var t,e;return pa(this,function(r){switch(r.label){case 0:if(!n)throw new Error("No basePath supplied");return t="profilesList.json",[4,$l("".concat(n,"/").concat(t))];case 1:return e=r.sent(),[2,e]}})})}function kA(n,t){return ha(this,arguments,void 0,function(e,r,i,a){var o,s,u,l,c,d;return i===void 0&&(i=null),a===void 0&&(a=!0),pa(this,function(p){switch(p.label){case 0:if(!e)throw new Error("No xrInputSource supplied");if(!r)throw new Error("No basePath supplied");return[4,LA(r)];case 1:if(o=p.sent(),e.profiles.some(function(A){var h=o[A];return h&&(s={profileId:A,profilePath:"".concat(r,"/").concat(h.path),deprecated:!!h.deprecated}),!!s}),!s){if(!i)throw new Error("No matching profile name found");if(u=o[i],!u)throw new Error('No matching profile name found and default profile "'.concat(i,'" missing.'));s={profileId:i,profilePath:"".concat(r,"/").concat(u.path),deprecated:!!u.deprecated}}return[4,$l(s.profilePath)];case 2:if(l=p.sent(),a){if(d=void 0,d=l.layouts[e.handedness],!d)throw new Error("No matching handedness, ".concat(e.handedness,", in profile ").concat(s.profileId));d.assetPath&&(c=s.profilePath.replace("profile.json",d.assetPath))}return[2,{profile:l,assetPath:c}]}})})}var OA={xAxis:0,yAxis:0,button:0,state:rt.ComponentState.DEFAULT};function DA(n,t){n===void 0&&(n=0),t===void 0&&(t=0);var e=n,r=t,i=Math.sqrt(n*n+t*t);if(i>1){var a=Math.atan2(t,n);e=Math.cos(a),r=Math.sin(a)}var o={normalizedXAxis:e*.5+.5,normalizedYAxis:r*.5+.5};return o}var VA=function(){function n(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===rt.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(OA)}return n.prototype.updateFromComponent=function(t){var e=t.xAxis,r=t.yAxis,i=t.button,a=t.state,o=DA(e,r),s=o.normalizedXAxis,u=o.normalizedYAxis;switch(this.componentProperty){case rt.ComponentProperty.X_AXIS:this.value=this.states.includes(a)?s:.5;break;case rt.ComponentProperty.Y_AXIS:this.value=this.states.includes(a)?u:.5;break;case rt.ComponentProperty.BUTTON:this.value=this.states.includes(a)?i:0;break;case rt.ComponentProperty.STATE:this.valueNodeProperty===rt.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(a):this.value=this.states.includes(a)?1:0;break;default:throw new Error("Unexpected visualResponse componentProperty ".concat(this.componentProperty))}},n}(),NA=function(){function n(t,e){var r=this;if(!t||!e||!e.visualResponses||!e.gamepadIndices||Object.keys(e.gamepadIndices).length===0)throw new Error("Invalid arguments supplied");this.id=t,this.type=e.type,this.rootNodeName=e.rootNodeName,this.touchPointNodeName=e.touchPointNodeName,this.visualResponses={},Object.keys(e.visualResponses).forEach(function(i){var a=new VA(e.visualResponses[i]);r.visualResponses[i]=a}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:rt.ComponentState.DEFAULT,button:this.gamepadIndices.button!==void 0?0:void 0,xAxis:this.gamepadIndices.xAxis!==void 0?0:void 0,yAxis:this.gamepadIndices.yAxis!==void 0?0:void 0}}return Object.defineProperty(n.prototype,"data",{get:function(){var t=O({id:this.id},this.values);return t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(t){var e=this;if(this.values.state=rt.ComponentState.DEFAULT,this.gamepadIndices.button!==void 0&&t.buttons.length>this.gamepadIndices.button){var r=t.buttons[this.gamepadIndices.button];this.values.button=r.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,r.pressed||this.values.button===1?this.values.state=rt.ComponentState.PRESSED:(r.touched||this.values.button>rt.ButtonTouchThreshold)&&(this.values.state=rt.ComponentState.TOUCHED)}this.gamepadIndices.xAxis!==void 0&&t.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=t.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===rt.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>rt.AxisTouchThreshold&&(this.values.state=rt.ComponentState.TOUCHED)),this.gamepadIndices.yAxis!==void 0&&t.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=t.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===rt.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>rt.AxisTouchThreshold&&(this.values.state=rt.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(function(i){i.updateFromComponent(e.values)})},n}(),zA=function(){function n(t,e,r){var i=this;if(!t)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No profile supplied");this.xrInputSource=t,this.assetUrl=r,this.id=e.profileId,this.layoutDescription=e.layouts[t.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(function(a){var o=i.layoutDescription.components[a];i.components[a]=new NA(a,o)}),this.updateFromGamepad()}return Object.defineProperty(n.prototype,"gripSpace",{get:function(){return this.xrInputSource.gripSpace},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"targetRaySpace",{get:function(){return this.xrInputSource.targetRaySpace},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"data",{get:function(){var t=[];return Object.values(this.components).forEach(function(e){t.push(e.data)}),t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(){var t=this;Object.values(this.components).forEach(function(e){e.updateFromGamepad(t.xrInputSource.gamepad)})},n}(),QA="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",UA="generic-trigger",qA=function(n){ue(t,n);function t(){var e=n.call(this)||this;return e.motionController=null,e.envMap=null,e}return t.prototype.setEnvironmentMap=function(e){var r=this;return this.envMap==e?this:(this.envMap=e,this.traverse(function(i){i instanceof f.Mesh&&i.isMesh&&(i.material.envMap=r.envMap,i.material.needsUpdate=!0)}),this)},t.prototype.updateMatrixWorld=function(e){n.prototype.updateMatrixWorld.call(this,e),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach(function(r){Object.values(r.visualResponses).forEach(function(i){var a=i.valueNode,o=i.minNode,s=i.maxNode,u=i.value,l=i.valueNodeProperty;a&&(l===rt.VisualResponseProperty.VISIBILITY?a.visible=u:l===rt.VisualResponseProperty.TRANSFORM&&(a.quaternion.copy(o.quaternion).slerp(s.quaternion,u),a.position.lerpVectors(o.position,s.position,u)))})}))},t}(si.Object3D);function HA(n,t){Object.values(n.components).forEach(function(e){var r=e.type,i=e.touchPointNodeName,a=e.visualResponses;if(r===rt.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(i),e.touchPointNode){var o=new si.SphereGeometry(.001),s=new si.MeshBasicMaterial({color:255}),u=new si.Mesh(o,s);e.touchPointNode.add(u)}else console.warn("Could not find touch dot, ".concat(e.touchPointNodeName,", in touchpad component ").concat(e.id));Object.values(a).forEach(function(l){var c=l.valueNodeName,d=l.minNodeName,p=l.maxNodeName,A=l.valueNodeProperty;if(A===rt.VisualResponseProperty.TRANSFORM){if(l.minNode=t.getObjectByName(d),l.maxNode=t.getObjectByName(p),!l.minNode){console.warn("Could not find ".concat(d," in the model"));return}if(!l.maxNode){console.warn("Could not find ".concat(p," in the model"));return}}l.valueNode=t.getObjectByName(c),l.valueNode||console.warn("Could not find ".concat(c," in the model"))})})}function Z0(n,t){HA(n.motionController,t),n.envMap&&t.traverse(function(e){e instanceof f.Mesh&&e.isMesh&&(e.material.envMap=n.envMap,e.material.needsUpdate=!0)}),n.add(t)}var GA=function(){function n(t){t===void 0&&(t=null),this.gltfLoader=t,this.path=QA,this._assetCache={}}return n.prototype.createControllerModel=function(t){var e=this,r=new qA,i=null;return t.addEventListener("connected",function(a){var o=a.data;o.targetRayMode!=="tracked-pointer"||!o.gamepad||kA(o,e.path,UA).then(function(s){var u=s.profile,l=s.assetPath;r.motionController=new zA(o,u,l);var c=e._assetCache[r.motionController.assetUrl];if(c)i=c.scene.clone(),Z0(r,i);else{if(!e.gltfLoader)throw new Error("GLTFLoader not set.");e.gltfLoader.load(r.motionController.assetUrl,function(d){e._assetCache[r.motionController.assetUrl]=d,i=d.scene.clone(),Z0(r,i)})}}).catch(function(s){console.warn(s)})}),t.addEventListener("disconnected",function(){r.motionController=null,r.remove(i),i=null}),r},n}(),KA=O({},Aa(pr,["maxLatitude","minLatitude"]));function _A(n,t){return n}var Y0=300,jA=new f.Matrix4().makeRotationAxis(new f.Vector3(0,1,0),Math.PI),$0=new f.Vector3(-1,1,1),JA=function(n){ue(t,n);function t(e){var r=n.call(this,e)||this;r.xrManager=new TA(r.renderer,r.renderer.getContext(),{onSessionStart:function(u){r.emit("xr.session.start",X("xr.session.start",{session:u,machineType:r.xrManager.machineType}))},onSessionEnd:function(){r.emit("xr.session.end",X("xr.session.end",{session:null,machineType:r.xrManager.machineType}))}}),r.xrControllerRay={left:new f.Raycaster,right:new f.Raycaster},r.xrControllerRay.left.params.Points={threshold:.1},r.xrControllerRay.right.params.Points={threshold:.1},r.gazeRay=null,r.pointerLines={left:new zo,right:new zo},r.pointerLines.left.visible=!1,r.pointerLines.right.visible=!0,r.pointerLines.left.setMaterial({color:new f.Vector3(1,1,1)}),r.pointerLines.left.points.material.depthTest=!1,r.pointerLines.right.setMaterial({color:new f.Vector3(1,1,1)}),r.pointerLines.right.points.material.depthTest=!1,r.controllerWrappers=[new f.Group,new f.Group];var i=r.xrManager.getController(0);r.controllerWrappers[0].add(i);var a=r.xrManager.getController(1);r.controllerWrappers[1].add(a);var o=new GA;o.gltfLoader={load:function(u,l){ra.ajax(u,{responseType:"arraybuffer"}).then(function(c){var d;return es(c.body,{resourcePath:u.slice(0,u.lastIndexOf("/")+1),search:(d=u.split("?")[1])!==null&&d!==void 0?d:"",fetcher:ra})}).then(function(c){return l(c)})}},(r.xrManager.machineType==="Oculus"||r.xrManager.machineType==="Pico")&&r.scene.add(r.pointerLines.left,r.pointerLines.right,r.controllerWrappers[0],r.controllerWrappers[1]),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=kt()]={panoId:He(r.currentPano),leftPanoPicture:null,position:r.camera.pose.offset.clone(),effect:"fade",fixCameraTransform:new f.Matrix4},r.parallaxCameraMatrixs=[];var s=Mt.shared.getContext();return s?(r.on("xr.session.end",function(){r.scene.remove(r.pointerLines.left,r.pointerLines.right)}),r.xrManager.setSession(s),r.on("xr.session.start",function(){var u=r.xrManager.getControllerGrip(0);u.add(o.createControllerModel(u)),r.controllerWrappers[0].add(u);var l=r.xrManager.getControllerGrip(1);l.add(o.createControllerModel(l)),r.controllerWrappers[1].add(l)}),r.xrHandleState={LeftAxesUp:{touchStartTime:0,touchStart:!1},LeftAxesDown:{touchStartTime:0,touchStart:!1},LeftAxesLeft:{touchStartTime:0,touchStart:!1},LeftAxesRight:{touchStartTime:0,touchStart:!1},LeftTrigger:{touchStartTime:0,touchStart:!1},LeftPinch:{touchStartTime:0,touchStart:!1},RightAxesUp:{touchStartTime:0,touchStart:!1},RightAxesDown:{touchStartTime:0,touchStart:!1},RightAxesLeft:{touchStartTime:0,touchStart:!1},RightAxesRight:{touchStartTime:0,touchStart:!1},RightTrigger:{touchStartTime:0,touchStart:!1},RightPinch:{touchStartTime:0,touchStart:!1},Y:{touchStartTime:0,touchStart:!1},X:{touchStartTime:0,touchStart:!1},A:{touchStartTime:0,touchStart:!1},B:{touchStartTime:0,touchStart:!1}},r.xrManager.machineType==="VP"&&r.initHandEvent(),r):(console.error("获取session失败,请退出重试"),r)}return t.parseArgs=function(e){if(e instanceof t)return e;var r=O(O({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return O(O({},i),{mode:"XRPanorama"})},t.prototype.updateConfiguration=function(e){return n.prototype.updateConfiguration.call(this,O(O({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2}))},t.prototype.moveToPano=function(e,r,i){var a=this,o,s,u,l,c=(o=r.effect)!==null&&o!==void 0?o:"fade";this.userAction=i,this.stopMomentumMovement();var d=this.works.getResolvedObserver(e);if(!d)throw new Error("Invalid PanoIndex");var p=mi(d.images.up),A=this.imageOptions.size;typeof A=="undefined"&&d&&p&&(A=Number(p)),typeof A=="undefined"&&(A=2048);var h=this.imageOptions.transform,v=function(C,I){return _A(Cn(C,h,I))},g=O({key:"pano.".concat(d.panoId)},Jt(this.imageOptions,["format","size","quality"])),m=d.images,y=(u=(s=d.images.tiles)===null||s===void 0?void 0:s.filter(function(C){return C.size>A}))!==null&&u!==void 0?u:null,b="pano:"+ma([m,g,h]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===b)return;var x=this.pendingTextureTask.panoId;(l=this.panoMeshes[x])===null||l===void 0||l.setProgress(0),this.emit("pano.texture.abort",X("pano.texture.abort",{error:null,progress:0,meta:null,pano:d.pano}))}var w=this.models.getMaterial()||{},M=w.pano0,S=w.pano1,E;if((M==null?void 0:M.map.name)===b?E=M:(S==null?void 0:S.map.name)===b&&(E=S),E){var B={panoId:d.panoId,effect:c,leftPanoPicture:{zoom:1,map:E.map,luminanceMap:E.luminanceMap,matrix:new f.Matrix4().compose(d.position,d.quaternion,$0)},position:d.position.clone(),fixCameraTransform:new f.Matrix4};this.doMoveToPano(d.pano,B,r);return}var R="move-to-pano-"+d.panoId;this.pending.add(R),this.pendingTextureTask={panoId:d.panoId,hash:b,onLoad:function(C){if(a.pending.delete(R),a.destroyed)C.body.dispose();else{C.body.name=b;var I={panoId:d.panoId,effect:c,leftPanoPicture:{zoom:1,map:C.body,luminanceMap:null,matrix:new f.Matrix4().compose(d.position,d.quaternion,$0)},position:d.position.clone(),fixCameraTransform:new f.Matrix4};a.doMoveToPano(d.pano,I,r)}},onError:function(C){a.pending.delete(R);var I=O(O(O({},d.pano),{mode:a.mode}),tt(a.camera.pose));a.emit("pano.error",X("pano.error",{error:C,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:I})),a.emit("pano.cancel",X("pano.cancel",{error:null,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:I})),r.moveCancelCallback&&r.moveCancelCallback()}},Promise.all([this.tileLevelForFov&&y&&y.length?this.textureLoader.loadTiledCubeTexture(m,y,{tileMaxLevel:this.tiledCubeTextureLevel,imageURL:{transform:v,options:g},format:f.RGBAFormat,minFilter:f.LinearFilter,magFilter:f.LinearFilter,generateMipmaps:!1,viaAjax:!0,fetcher:pt(d.work)},void 0,void 0,function(C){var I,L;a.emit("pano.texture.progress",X("pano.texture.progress",{error:null,progress:C,meta:null,pano:d.pano})),((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b&&((L=a.panoMeshes[d.panoId])===null||L===void 0||L.setProgress(C))},this.renderer):this.textureLoader.loadCubeTexture(m,{imageURL:{transform:v,options:g},format:f.RGBAFormat,fetcher:pt(d.work)},void 0,void 0,function(C){var I,L;((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b&&((L=a.panoMeshes[d.panoId])===null||L===void 0||L.setProgress(C)),a.emit("pano.texture.progress",X("pano.texture.progress",{error:null,progress:C,meta:null,pano:d.pano}))},this.renderer)]).then(function(C){var I,L,T=C[0];((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b?(a.pendingTextureTask.onLoad(T),(L=a.panoMeshes[d.panoId])===null||L===void 0||L.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",X("pano.texture.success",{error:null,progress:1,meta:T.meta,pano:d.pano}))):T.body.dispose()}).catch(function(C){var I,L;((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b&&(a.pendingTextureTask.onError(C),(L=a.panoMeshes[d.panoId])===null||L===void 0||L.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",X("pano.texture.error",{error:C,progress:0,meta:null,pano:d.pano})),a.emit("error",C))}),this.emit("pano.texture.load",X("pano.texture.load",{error:null,progress:0,meta:null,pano:d.pano}))},t.prototype.doMoveToPano=function(e,r,i){var a=this,o,s,u,l,c,d,p,A,h,v;i===void 0&&(i={});var g=ve(),m=kt();this.panoResources[m]=r;var y=1,b,x,w;if(this.locationMotion.ended){var M=this.locationMotion.getKeyFrameSegment(g);M[0];var S=M[1],E=this.locationMotion.value,B=this.panoResourceFromLocationMotionKeyframe(S).position,R=r.position;b=Math.max(B.distanceTo(R),y),x=[{key:S.key,progress:0,value:O(O({},E),{count:0})},{key:m,progress:1,value:{distance:0,count:1}}],w=0}else{var C=this.locationMotion.getKeyFrameSegment(g),I=C[0],S=C[1],E=this.locationMotion.value,L=this.panoResourceFromLocationMotionKeyframe(I).position,B=this.panoResourceFromLocationMotionKeyframe(S).position,R=r.position,T=S.value.count-E.count,F=Math.max(L.distanceTo(B),y)*T,D=Math.max(B.distanceTo(R),y);b=F+D,x=[{key:I.key,progress:0,value:O({},E)},{key:S.key,progress:F/b,value:S.value},{key:m,progress:1,value:{count:S.value.count+1,distance:0}}];var V=this.locationMotionKeyframesLength(this.locationMotion.keyframes),z=this.locationMotionKeyframesLength(x);w=this.locationMotion.getProgressVelocity(g)*V/z}var U=r.effect==="instant"?0:this.calculateMovingDuration(i.duration,r.effect==="fly"?b:0),q={longitude:i.longitude,latitude:i.latitude,fov:i.fov},G=O(O({},e),{mode:this.mode,longitude:(o=q.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=q.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(u=q.fov)!==null&&u!==void 0?u:this.camera.pose.fov,offset:r.position.clone(),distance:0}),K=this.currentPano;if(this.emit("pano.moveTo",X("pano.moveTo",{options:i,prevPano:K,progress:0,state:G,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(G),this.videoTexture&&this.videoTexture.image instanceof HTMLVideoElement&&this.videoTexture.image.getAttribute("src")&&(this.videoTexture.image.pause(),this.videoTexture.image.removeAttribute("uuid"),this.videoTexture.image.removeAttribute("src"),this.videoTexture.image.oncanplay=Q,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(q,U).catch(Q);else{var j=Ut({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),J=Ut({longitude:(l=q.longitude)!==null&&l!==void 0?l:this.cameraMotion.value.longitude,latitude:(c=q.latitude)!==null&&c!==void 0?c:this.cameraMotion.value.latitude}),W=new f.Object3D;W.lookAt(j);var $=new f.Matrix4().makeRotationFromQuaternion(W.quaternion);W.lookAt(J);var Y=new f.Matrix4().makeRotationFromQuaternion(W.quaternion),Z=new f.Matrix4().getInverse($).premultiply(Y),oe=this.cameraMotion.value.fov,ne=(d=q.fov)!==null&&d!==void 0?d:this.cameraMotion.value.fov,de=1;r.effect==="zoomin"?de=1.5:r.effect==="zoomout"&&(de=.4);for(var se=ne*de,ye=0;ye<x.length-1;ye++){var ie=x[ye].key;if(ie){var xe=this.panoResources[ie];xe&&(xe.fixCameraTransform.copy(Z),xe.leftPanoPicture&&(xe.leftPanoPicture.zoom=Math.tan(oe/2/180*Math.PI)/Math.tan(se/2/180*Math.PI)))}}this.cameraMotion.setKeyframes([{progress:0,value:{longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:this.cameraMotion.value.fov}},{progress:0,value:{longitude:(p=q.longitude)!==null&&p!==void 0?p:this.cameraMotion.value.longitude,latitude:(A=q.latitude)!==null&&A!==void 0?A:this.cameraMotion.value.latitude,fov:se}},{progress:1,value:{longitude:(h=q.longitude)!==null&&h!==void 0?h:this.cameraMotion.value.longitude,latitude:(v=q.latitude)!==null&&v!==void 0?v:this.cameraMotion.value.latitude,fov:ne}}],U).catch(Q)}var Le=this.locationMotion.setKeyframes(x,U,w);Le.then(function(){for(var Ce,Oe,ee,re=0,H=a.models;re<H.length;re++){var Be=H[re];Be.show()}var Te=O(O({},e),{mode:a.mode,longitude:a.camera.pose.longitude,latitude:a.camera.pose.latitude,fov:a.camera.pose.fov,offset:a.camera.pose.offset.clone(),distance:0});a.emit("pano.arrived",X("pano.arrived",{options:i,prevPano:K,progress:1,state:Te,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(Te);var Ee=a.works.getResolvedObserver(a.currentPano);if(Ee&&Ee.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var Qe=jA.clone().multiply((ee=(Oe=(Ce=a.models.getMaterial())===null||Ce===void 0?void 0:Ce.pano1)===null||Oe===void 0?void 0:Oe.matrix)!==null&&ee!==void 0?ee:new f.Matrix4).multiply(Ee.video.matrix),Ie={map:a.videoTexture,size:Ee.video.size,matrix:Qe,alpha:1},we=kt(),be=a.videoTexture.image;be.setAttribute("uuid",we),Ul().then(function(Ae){Ae&&Ee.video&&be.getAttribute("uuid")===we&&(be.oncanplay=function(){be.oncanplay=Q,be.play()},be.ontimeupdate=function(){be.currentTime>.5&&(be.ontimeupdate=Q,a.panoVideo.setMaterial(Ie))},be.src=Ee.video.source)}).catch(function(){be.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",X("pano.cancel",{options:i,prevPano:K,progress:0,state:G,userAction:a.userAction,error:null})),i.moveCancelCallback&&i.moveCancelCallback()})},t.prototype.checkSelectedPano=function(e){var r=this,i,a,o,s;this.stopMomentumMovement();var u=this.camera.getDirection(new f.Vector3).setY(0),l=null,c=this.works.getResolvedObserver(this.currentPano);if(!c)return null;var d=c.accessibleIds.filter(function(J){var W=Lt(J);if(Ar(W,r.currentPano))return!1;var $=r.works.getResolvedObserver(W);return!$||$.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:$.loadable||$.active}),p=this.models.intersectRaycaster(e)[0];if(p){var A=Br(d,function(J){var W=r.works.getResolvedObserver(J);if(!W)return 1/0;var $=W.standingPosition.clone();return $.distanceTo(p.point)},!0),h=A[0],v=A[1];h&&v<this.panoTapTriggerRadius&&(l=(i=this.works.getResolvedObserver(h))!==null&&i!==void 0?i:null)}if(j0(l)){var g=this.getForwardObserverOrNot(e);g&&(l=g)}for(var m=0,y=this.locationMotion.keyframes;m<y.length;m++){var b=y[m],x=this.panoResourceFromLocationMotionKeyframe(b);if(!(b.progress<this.locationMotion.progress)&&l&&x.panoId===l.panoId){l=null;break}}if(j0(l))return this.locationMotion.ended===!0&&this.cameraBounce(),null;if(l&&!l.active){var w=l.panoId;this.panoMeshes[w]&&(this.panoMeshes[w].setDisabled(!1),this.panoMeshes[w].setLoading(!0))}var M={};if(l){for(var S=Math.PI/6,E=Math.PI/12,B=new f.Vector3(0,1,0),R=l.position.clone().setY(0).sub(c.position.clone().setY(0)).normalize(),C=R.clone().applyAxisAngle(B,S),I=R.clone().applyAxisAngle(B,-S),L=[],T=[],F=[],D=0,V=l.accessibleIds;D<V.length;D++){var h=V[D],z=Lt(h);if(!(Ar(z,this.currentPano)||Ar(z,l.pano))){var U=this.works.getResolvedObserver(h);if(U){var q=U.position.clone().sub(l.position).setY(0);R.angleTo(q)<S?F.push(q):C.angleTo(q)<S?L.push(q):I.angleTo(q)<S&&T.push(q)}}}var G=F.length>0?F:vt(vt([],L,!0),T,!0),K=G.slice().sort(function(J,W){return J.angleTo(R)-W.angleTo(R)})[0];K&&K.angleTo(u)>E&&(M.longitude=Math.atan2(-K.x,-K.z))}this.cameraMotion.value.latitude<-Math.PI/4&&(M.latitude=ce(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(M.fov=this.defaultFov);var j={workCode:l.pano.workCode,panoIndex:l.pano.panoIndex,mode:this.mode,longitude:(a=M.longitude)!==null&&a!==void 0?a:this.camera.pose.longitude,latitude:(o=M.latitude)!==null&&o!==void 0?o:this.camera.pose.latitude,fov:(s=M.fov)!==null&&s!==void 0?s:this.camera.pose.fov,distance:0,offset:l?l.position.clone():new f.Vector3};return this.emit("pano.select",X("pano.select",{prevPano:this.currentPano,state:j,userAction:!0,options:M,progress:0,error:null})),l&&l.active?(this.emit("pano.request",X("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:j,options:M,error:null})),l.pano):null},t.prototype.destroy=function(){n.prototype.destroy.call(this)},t.prototype.isReady=function(){return!1},t.prototype.updateCamera=function(e,r,i){return Promise.resolve()},t.prototype.updateCameraWithKeyframes=function(e,r,i){return Promise.resolve()},t.prototype.updateTime=function(e,r){for(var i=this,a,o,s,u,l,c,d,p,A=[],h=2;h<arguments.length;h++)A[h-2]=arguments[h];this.userAction=!0;var v={},g={},m=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),y=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),b=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),g.longitude=this.cameraMotion.value.longitude,g.latitude=this.cameraMotion.value.latitude,g.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),v.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(ce(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var x=this.locationMotion.getKeyFrameSegment(e),w=x[0],M=x[1],S=this.panoResourceFromLocationMotionKeyframe(w),E=this.panoResourceFromLocationMotionKeyframe(M),B=new f.Vector3().copy(S.position),R=new f.Vector3().copy(E.position),C=this.locationMotion.value.count-M.value.count+1;v.progress=C,E.leftPanoPicture&&(C<1?S.leftPanoPicture&&(v.pano0=S.leftPanoPicture):v.pano0=E.leftPanoPicture,v.pano1=E.leftPanoPicture),E.effect==="montage"?v.transition="BLACK":E.effect==="spread"?v.transition="SPREAD":v.transition="FADE",(E.effect==="zoomin"||E.effect==="zoomout")&&(v.progress=Math.pow(C,3)),C<1&&E.effect!=="fly"&&(v.pano0&&S.leftPanoPicture&&(v.pano0={map:v.pano0.map,zoom:v.pano0.zoom,luminanceMap:v.pano0.luminanceMap,matrix:S.leftPanoPicture.matrix.clone().setPosition(E.position)}),B.copy(R),b=!0),g.distance=this.locationMotion.value.distance,g.offset=new f.Vector3(B.x+(R.x-B.x)*C,B.y+(R.y-B.y)*C,B.z+(R.z-B.z)*C);for(var I=[],L=[],T=0,F=this.locationMotion.keyframes;T<F.length;T++){var D=F[T],V=D.key,z=D.progress;V!==void 0&&(I.push(V),z>this.locationMotion.progress&&L.push(V))}for(var U=0,q=Object.keys(this.panoResources);U<q.length;U++){var G=q[U];if(!(L.indexOf(G)>=0)){var K=this.panoResources[G];if(K.leftPanoPicture){var j=K.leftPanoPicture.map;if(j){if(j===((a=v.pano0)===null||a===void 0?void 0:a.map)||j===((o=v.pano1)===null||o===void 0?void 0:o.map))continue;j instanceof qe&&j.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(j.cubeRenderTarget),j.dispose(),K.leftPanoPicture=null}}I.indexOf(G)>=0||delete this.panoResources[G]}}this.currentPano=Lt(E.panoId),this.emit("pano.moving",X("pano.moving",{userAction:this.userAction,prevPano:Lt(m.panoId),state:O(O(O(O({},Lt(y.panoId)),{mode:this.mode}),tt(this.camera.pose)),g),options:{},progress:this.locationMotion.progress,error:null}))}ar(v)===!1&&(!((s=v.pano0)===null||s===void 0)&&s.map&&v.pano0.map instanceof qe&&!v.pano0.map.cubeRenderTarget&&(v.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((u=v.pano1)===null||u===void 0)&&u.map&&v.pano1.map instanceof qe&&!v.pano1.map.cubeRenderTarget&&(v.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),this.models.setMaterial(v)),ar(g)===!1&&this.setCamera(g);var J=this.works.getResolvedObserver(this.currentPano),W=A[1];if(!W){console.error("xrFrame丢失,请重试");return}if(!this.xrManager.session){console.error("session丢失,请重试");return}var $=this.xrManager.referenceSpace;if($){var Y=this.xrManager.cameraVR,Z=this.xrManager.cameraL,oe=this.xrManager.cameraR,ne=[Z,oe],de=W.getViewerPose($),se=new f.Vector3(0,0,0);if(de){var ye;ye=this.xrManager.session.renderState.baseLayer;var ie=de.views;if(!ye){console.error("no layer found");return}this.renderer.setFramebuffer(ye.framebuffer);var xe=!1;ie.length!==Y.cameras.length&&(Y.cameras.length=0,xe=!0),this.parallaxCameraMatrixs=[];var Le=new f.Vector3,Ce=new f.Vector3;new f.Matrix4().fromArray(ie[0].transform.matrix).decompose(Le,new f.Quaternion,new f.Vector3),new f.Matrix4().fromArray(ie[1].transform.matrix).decompose(Ce,new f.Quaternion,new f.Vector3),Ce.clone().sub(Le).normalize();var Oe=new f.Vector3,ee=new f.Quaternion,re=new f.Vector3;this.camera.matrix.decompose(Oe,ee,re);for(var H=0;H<ie.length;H++){var Be=ie[H],Te=ye.getViewport(Be),Ee=ne[H];Ee.matrix.fromArray(Be.transform.matrix);var Qe=new f.Vector3,Ie=new f.Quaternion,we=new f.Vector3;Ee.matrix.decompose(Qe,Ie,we),se.copy(Oe),Ee.position.copy(Oe),Ee.quaternion.copy(Ie),Ee.scale.copy(we),Ee.updateMatrix(),Ee.projectionMatrix.fromArray(Be.projectionMatrix),Ee.viewport.set(Te.x,Te.y,Te.width,Te.height),xe===!0&&Y.cameras.push(Ee)}if(this.xrManager.session&&this.xrManager.session.inputSources){for(var H=0;H<this.xrManager.session.inputSources.length;H++)if(this.xrManager.session.inputSources[H]&&this.xrManager.session.inputSources[H].targetRayMode==="transient-pointer"){var be=W.getPose(this.xrManager.session.inputSources[H].targetRaySpace,$);if(be){var Ae=new f.Vector3(0,0,-1).applyQuaternion(be.transform.orientation),me=new f.Raycaster(this.camera.position,Ae);this.gazeRay=me}}}if(this.xrManager.machineType==="Oculus"||this.xrManager.machineType==="Pico"){for(var ze=this.xrManager.session.inputSources,H=0;H<ze.length;H++){var pe=this.xrManager.controllers[H],Se=ze[H];if(Se){pe&&pe.update(Se,W,$);var me=this.xrManager.getController(H),St=new f.Vector3(0,1.2,0),Pe=me.position.clone().add(se).sub(St);Se.handedness==="left"?this.xrControllerRay.left.set(Pe,new f.Vector3(0,0,-1).applyEuler(me.rotation)):Se.handedness==="right"&&this.xrControllerRay.right.set(Pe,new f.Vector3(0,0,-1).applyEuler(me.rotation)),this.controllerWrappers[H].position.copy(new f.Vector3(0,0,0).add(se).sub(St));var je=this.models.intersectRaycaster(this.xrControllerRay.right);if(je.length===0&&(je=this.xrControllerRay.right.intersectObject(this.boundingMesh,!0).map(function(jr){var mn;return O({floor:(mn=J==null?void 0:J.floorIndex)!==null&&mn!==void 0?mn:0},jr)})),je.length>=1&&je[0].face)if(Se.handedness==="right"){var it=this.xrControllerRay.right.intersectObject(this.xrCustomObjectsScene,!0),Xt=je[0].face.normal,Kr=Xt.clone(),Wt=je[0].point.clone();this.intersectMesh.position.copy(Wt);var ut=Wt.clone().add(Kr);if(this.intersectMesh.lookAt(ut),Math.abs(Xt.y)>.99){var Ct=this.camera.position.clone().sub(Wt);this.intersectMesh.rotation.z=-Math.atan2(Ct.z,Ct.x)}this.intersectMesh.visible=!0,this.needsRender=!0,it.length>0?(this.pointerLines.right.setPoints(Pe,it[0].point),this.pointerLines.right.points.visible=!0,this.intersectMesh.visible=!1):(this.pointerLines.right.points.visible=!1,this.pointerLines.right.setPoints(Pe,je[0].point));var dt=je[0],Et=X("intersect.update",{raycaster:(l=this.xrControllerRay.right)!==null&&l!==void 0?l:null,intersection:dt!=null?dt:null,object:this.intersectMesh});if(this.emit("intersect.update",Et),Et.defaultPrevented){this.hideIntersectMesh();return}}else this.pointerLines.left.setPoints(Pe,je[0].point)}}this.updateControllerHelper(ze,e,r)}if(this.camera.pose.distance>.1||b)for(var It=0,Tt=Object.keys(this.panoMeshes);It<Tt.length;It++){var Xe=Tt[It],Ne=this.panoMeshes[Xe];Ne.setOpacity(0),Ne.setCurrent(!1),Ne.updateTime&&Ne.updateTime(e,r),Ne.visible=!1}else if(J){var We=Br(J.visibleIds,function(Pt){var or=i.works.getResolvedObserver(Pt);return or?J.standingPosition.distanceTo(or.standingPosition):1/0},!0),At=We[1];At=ce(At,2.5,1/0);for(var Ze=J.visibleIds.concat(He(this.currentPano)),gt=this.getForwardObserverOrNot(),Ht=this.camera.getDirection(new f.Vector3),yt=0,Zt=Object.keys(this.panoMeshes);yt<Zt.length;yt++){var Xe=Zt[yt],Ne=this.panoMeshes[Xe],xr=this.works.getResolvedObserver(Xe);if(Ze.indexOf(Xe)===-1)Ne.setCurrent(!1),Ne.setOpacity(0);else if(!xr)Ne.setCurrent(!1),Ne.setOpacity(0);else if(!xr.loadable&&!xr.active)Ne.setCurrent(!1),Ne.setOpacity(0);else{var _r=Ne.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Ne.setCurrent(!Ne.loading&&Ne.progress===0&>!==null&>.panoId===Xe),Ne.setOpacity(_r<.01?0:ce(At/_r*1.2,.65,.98));var wr=this.camera.position.clone().setY(Ne.position.y),Ae=new f.Vector3().copy(Ne.position).sub(wr).normalize();if(Xe===He(this.currentPano)){var Lr=ce((.5-wr.distanceTo(Ne.position))/.5,0,1);Ae.multiplyScalar(1-Lr).add(Ht.clone().multiplyScalar(Lr))}Ae.length()>0&&Ne.quaternion.setFromEuler(new f.Euler(0,Math.atan2(Ae.x,Ae.z),0))}Ne.updateTime&&Ne.updateTime(e,r)}}var Dt=function(){return 4}(),Ge=function(){var Pt=new f.PerspectiveCamera;Pt.applyMatrix4(Y.matrix),Pt.position.set(0,0,0);var or=i.works.getResolvedObserver(y.panoId),jr=or!=null?or:J;jr&&Pt.quaternion.premultiply(jr.quaternion.clone().inverse()),Pt.updateProjectionMatrix(),Pt.updateMatrixWorld(!0);var mn=new f.Frustum().setFromProjectionMatrix(new f.Matrix4().multiplyMatrices(Pt.projectionMatrix,Pt.matrixWorldInverse));return mn}();y.panoId===He(this.currentPano)&&((c=y.leftPanoPicture)===null||c===void 0?void 0:c.map)instanceof qe&&(y.leftPanoPicture.map.maxRequest=this.tileMaxRequest,y.leftPanoPicture.map.update(Ge,Dt),y.leftPanoPicture.map.needsRender===!0&&(this.needsRender=!0,this.modelSceneNeedsRender=!0));{var ke=this.tiling.object.visible;if(this.initAnimationed){var Ye=y.panoId,bt=this.works.getResolvedObserver(Ye);bt?Fi(this.camera.position,bt.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==Ye&&this.tiling.cleanup(),this.tiling.panoId=Ye,this.tiling.setResource((p=(d=bt.images)===null||d===void 0?void 0:d.tiles)!==null&&p!==void 0?p:[],this.enableIOSEDR&&bt.images.luminance?bt.images.luminance:null),this.tiling.setFetcher(pt(bt.work)),this.tiling.setRotation(bt.quaternion),this.tiling.setPosition(bt.position),this.tiling.maxRequest=this.tileMaxRequest,Dt>this.tiledCubeTextureLevel?this.tiling.update(Ge,Dt,e):this.tiling.update(Ge,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;ke!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0,this.modelSceneNeedsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e)}}},t.prototype.render=function(){var e=this.xrManager.getCamera(this.camera);this.renderer.render(this.modelScene,e),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,e),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.updateControllerHelper=function(e,r,i){var a=this.xrControllerRay.left,o=this.xrControllerRay.right;if(!(!e||e.length===0)){for(var s={buttons:{X:!1,Y:!1,LeftTrigger:!1,LeftPinch:!1,A:!1,B:!1,RightTrigger:!1,RightPinch:!1}},u=0;u<e.length;u++){var l=e[u].handedness,c=e[u].gamepad;switch(l){case"left":c.axes&&(this.emitHandleEvent(c.axes[2]===-1,"LeftAxesLeft",r),this.emitHandleEvent(c.axes[2]===1,"LeftAxesRight",r),this.emitHandleEvent(c.axes[3]===-1,"LeftAxesUp",r),this.emitHandleEvent(c.axes[3]===1,"LeftAxesDown",r)),c!=null&&c.buttons&&(c.buttons[4]&&this.emitHandleEvent(c.buttons[4].pressed,"X",r),c.buttons[5]&&this.emitHandleEvent(c.buttons[5].pressed,"Y",r),c.buttons[0]&&this.emitHandleEvent(c.buttons[0].pressed,"LeftTrigger",r),c.buttons[1]&&this.emitHandleEvent(c.buttons[1].pressed,"LeftPinch",r));var d={raycaster:a,axes:{up:c.axes&&c.axes[3]<0?Math.abs(c.axes[3]):0,down:c.axes&&c.axes[3]<0?0:Math.abs(c.axes[3]),left:c.axes&&c.axes[2]<0?Math.abs(c.axes[2]):0,right:c.axes&&c.axes[2]<0?0:Math.abs(c.axes[2])},deltaTime:i};s.buttons.X=c.buttons&&c.buttons[4]?c.buttons[4].pressed:!1,s.buttons.Y=c.buttons&&c.buttons[5]?c==null?void 0:c.buttons[5].pressed:!1,s.buttons.LeftTrigger=c.buttons&&c.buttons[0]?c==null?void 0:c.buttons[0].pressed:!1,s.buttons.LeftPinch=c.buttons&&c.buttons[1]?c==null?void 0:c.buttons[1].pressed:!1,s.left=d;break;case"right":c.axes&&(this.emitHandleEvent(c.axes[2]===-1,"RightAxesLeft",r),this.emitHandleEvent(c.axes[2]===1,"RightAxesRight",r),this.emitHandleEvent(c.axes[3]===-1,"RightAxesUp",r),this.emitHandleEvent(c.axes[3]===1,"RightAxesDown",r)),c.buttons&&(c.buttons[4]&&this.emitHandleEvent(c.buttons[4].pressed,"A",r),c.buttons[5]&&this.emitHandleEvent(c.buttons[5].pressed,"B",r),c.buttons[0]&&this.emitHandleEvent(c.buttons[0].pressed,"RightTrigger",r),c.buttons[1]&&this.emitHandleEvent(c.buttons[1].pressed,"RightPinch",r));var p={raycaster:o,axes:{up:c.axes&&c.axes[3]<0?Math.abs(c.axes[3]):0,down:c.axes&&c.axes[3]<0?0:Math.abs(c.axes[3]),left:c.axes&&c.axes[2]<0?Math.abs(c.axes[2]):0,right:c.axes&&c.axes[2]<0?0:Math.abs(c.axes[2])},deltaTime:i};s.right=p,s.buttons.A=c.buttons&&c.buttons[4]?c==null?void 0:c.buttons[4].pressed:!1,s.buttons.B=c.buttons&&c.buttons[5]?c==null?void 0:c.buttons[5].pressed:!1,s.buttons.RightTrigger=c.buttons&&c.buttons[0]?c==null?void 0:c.buttons[0].pressed:!1,s.buttons.RightPinch=c.buttons&&c.buttons[1]?c==null?void 0:c.buttons[1].pressed:!1;break}}this.emit("xr.controller.update",X("xr.controller.update",s))}},t.prototype.emitHandleEvent=function(e,r,i){var a=this.xrControllerRay.left,o=this.xrControllerRay.right;if(e)if(this.xrHandleState[r].touchStart===!1)this.xrHandleState[r].touchStartTime=i,this.xrHandleState[r].touchStart=!0,this.emit("xr.gesture.buttonDown",X("xr.gesture.buttonDown",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!1,isFirst:!0,controllers:{raycaster:{leftRay:a,rightRay:o}}}));else{var s=i-this.xrHandleState[r].touchStartTime;s>Y0&&this.emit("xr.gesture.press",X("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!0,controllers:{raycaster:{leftRay:a,rightRay:o}}}))}else if(this.xrHandleState[r].touchStart===!0){this.emit("xr.gesture.buttonUp",X("xr.gesture.buttonUp",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:a,rightRay:o}}}));var s=i-this.xrHandleState[r].touchStartTime;if(s<=Y0){var u=X("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:a,rightRay:o}}}),l=this.emit("xr.gesture.tap",u);!l&&!u.defaultPrevented&&r==="RightTrigger"&&this.checkSelectedPano(this.xrControllerRay.right)}this.xrHandleState[r].touchStart=!1,this.xrHandleState[r].touchStartTime=0}},t.prototype.initHandEvent=function(){var e=this;if(!this.xrManager.session)throw new Error("初始化失败");this.xrManager.session.addEventListener("select",function(r){e.gazeRay&&e.checkSelectedPano(e.gazeRay)})},t}(ps),ht={Floorplan:No,Topview:Am,Panorama:ps,VRPanorama:fA,Model:pA,Mapview:CA,XRPanorama:JA},XA={Floorplan:fr,Topview:mm,Panorama:pr,VRPanorama:cA,Model:hA,Mapview:Ir,XRPanorama:KA},ec=["gesture.pan","gesture.tap","gesture.dbltap","gesture.press","gesture.pinch","gesture.mousewheel","gesture.mousemove","gesture.momentum","initAnimation.start","initAnimation.end","camera.update","intersect.update","pano.select","pano.moveTo","pano.moving","pano.arrived","pano.cancel","pano.error","pano.texture.load","pano.texture.progress","pano.texture.success","pano.texture.error","pano.texture.abort","xr.session.start","xr.session.end","xr.gesture.tap","xr.gesture.press","xr.gesture.buttonUp","xr.gesture.buttonDown","xr.controller.update"];function WA(n){n.on("initAnimation.start",function(t){n.emit("initAnimationWillStart",t.state.panoIndex,t.state,t.userAction)}),n.on("initAnimation.end",function(t){n.emit("initAnimationEnded",t.state.panoIndex,t.state,t.userAction)}),n.on("gesture.pan",function(t){var e=!1;e=n.emit("wantsGesture","pan",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPanGesture",t.state,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","pan",t.pointers,t.isFinal),n.emit("panGesture",t.state,t.isFinal))}),n.on("gesture.tap",function(t){var e=!1;e=n.emit("wantsGesture","tap",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsTapGesture",t.center.raycaster,t.center.coords,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","tap",t.pointers,t.isFinal),n.emit("tapGesture",t.center.raycaster,t.center.coords,t.isFinal))}),n.on("gesture.dbltap",function(t){var e=!1;e=n.emit("wantsGesture","dbltap",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsDblTapGesture",t.center.raycaster,t.center.coords,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","dbltap",t.pointers,t.isFinal),n.emit("dblTapGesture",t.center.raycaster,t.center.coords,t.isFinal))}),n.on("gesture.press",function(t){var e=!1;e=n.emit("wantsGesture","press",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPressGesture",t.center.raycaster,t.center.coords,t.center.delta,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","press",t.pointers,t.isFinal),n.emit("pressGesture",t.center.raycaster,t.center.coords,t.center.delta,t.isFinal))}),n.on("gesture.pinch",function(t){var e=!1;e=n.emit("wantsGesture","pinch",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPinchGesture",t.scale,t.state.fov,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","pinch",t.pointers,t.isFinal),n.emit("pinchGesture",t.scale,t.state.fov,t.isFinal))}),n.on("gesture.mousewheel",function(t){var e=!1;e=n.emit("wantsGesture","mouseWheel",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsMouseWheel",t.center.delta,t.state.fov,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","mouseWheel",t.pointers,t.isFinal),n.emit("mouseWheel",t.center.delta,t.state.fov,t.isFinal))}),n.on("gesture.mousemove",function(t){var e=!1;e=n.emit("wantsGesture","mouseMove",t.pointers,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","mouseMove",t.pointers,t.isFinal),e=n.emit("wantsChangeCameraFov",t.state.fov),e&&t.preventDefault())}),n.on("gesture.momentum",function(t){var e=!1;e=n.emit("wantsInteriaPan",t.state),e&&t.preventDefault(),t.defaultPrevented||n.emit("interiaPan",t.state,t.isFinal)}),n.on("camera.update",function(t){n.emit("cameraFovUpdate",t.state.fov,t.userAction),n.emit("cameraDirectionUpdate",t.state,t.userAction);var e=Ut(t.state);e.setLength(t.state.distance);var r=t.state.offset.clone().sub(e);n.emit("cameraPositionUpdate",r,t.userAction),n.emit("cameraUpdate",t.state,t.userAction)}),n.on("intersect.update",function(t){if(t.intersection){var e=!1;e=n.emit("wantsShowIntersectionOnModel",t.raycaster),e&&t.preventDefault(),t.defaultPrevented||n.emit("intersectionOnModelUpdate",t.intersection,t.object)}else n.emit("intersectionHidden")}),n.on("pano.request",function(t){var e=n.emit("wantsMoveToPano",t.state.panoIndex,t.options,t.userAction);e||(e=n.emit("wantsToMoveToPano",t.state.panoIndex,t.options,t.userAction)),e&&t.preventDefault(),t.defaultPrevented||n.emit("panoWillLoad",t.state.panoIndex)}),n.on("pano.select",function(t){n.emit("panoSelected",t.state.panoIndex)}),n.on("pano.moveTo",function(t){n.emit("panoLoaded",t.state.panoIndex),n.emit("moveToPano",t.state.panoIndex,t.userAction),n.emit("panoWillArrive",t.state.panoIndex,t.state,t.userAction)}),n.on("pano.moving",function(t){n.emit("movingToPano",t.state.panoIndex,t.prevPano.panoIndex,t.progress)}),n.on("pano.arrived",function(t){n.emit("panoArrived",t.state.panoIndex,t.state,t.userAction)}),n.on("pano.cancel",function(t){n.emit("moveToPanoCanceled",t.state.panoIndex)}),n.on("pano.error",function(t){n.emit("panoLoadError",t.error,t.state.panoIndex)}),n.on("pano.texture.load",function(t){n.emit("textureStartLoad",t.pano.panoIndex)}),n.on("pano.texture.success",function(t){n.emit("textureLoaded",t.pano.panoIndex,t.meta)}),n.on("pano.texture.error",function(t){n.emit("textureError",t.error,t.pano.panoIndex)}),n.on("pano.texture.abort",function(t){n.emit("textureAbort",t.pano.panoIndex)}),n.on("pano.texture.progress",function(t){n.emit("textureLoading",t.progress,t.pano.panoIndex)}),n.on("xr.session.start",function(t){n.emit("webXRSessionStart")}),n.on("xr.session.end",function(t){n.emit("webXRSessionEnd")}),n.on("xr.gesture.tap",function(t){n.emit("webXRControllerEvent","tap",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.press",function(t){n.emit("webXRControllerEvent","press",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.buttonUp",function(t){n.emit("webXRControllerEvent","buttonUp",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.buttonDown",function(t){n.emit("webXRControllerEvent","buttonDown",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.controller.update",function(t){n.emit("webXRControllerRayUpdate",{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0}),t.left&&n.emit("webXRAxesUpdate","left",{raycaster:{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0},axesState:{up:t.left.axes.up,down:t.left.axes.down,left:t.left.axes.left,right:t.left.axes.right},deltaTime:t.left.deltaTime}),t.right&&n.emit("webXRAxesUpdate","right",{raycaster:{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0},axesState:{up:t.right.axes.up,down:t.right.axes.down,left:t.right.axes.left,right:t.right.axes.right},deltaTime:t.right.deltaTime})}),n.on("works.request",function(t){n.emit("willLoad",t.input,t.works[0],t.state)}),n.on("works.load",function(t){n.emit("load",t.input,t.works[0],t.state)}),n.on("works.ready",function(t){n.emit("loaded",t.input,t.works[0])}),n.on("state.change",function(t){n.emit("stateChange",t.state,t.userAction)}),n.on("currentState.change",function(t){n.emit("currentStateChange",t.state,t.userAction)}),n.on("state.set",function(t){n.emit("setState",t.state)}),n.on("state.synced",function(t){n.emit("stateSynced",t.state)}),n.on("model.request",function(t){n.emit("modelWillLoad",t.work.model)}),n.on("model.error",function(t){n.emit("modelLoadError",t.error,t.model)}),n.on("model.load",function(t){n.emit("modelLoaded",t.model)}),n.on("model.changeShownFloor",function(t){n.emit("modelShownFloorChange",t.model.shownFloor,t.model.floorLength)}),n.on("render",function(t){n.emit("renderFrame",t.needsRender)}),n.on("mode.change.request",function(t){n.emit("wantsChangeMode",t.mode,t.prevMode)}),n.on("mode.change",function(t){n.emit("modeChange",t.mode,t.prevMode,t.state.panoIndex,t.state,t.userAction)}),n.on("helpers.visible",function(t){n.emit("helpersVisibleChange",t.object.visible)}),n.on("network.resource",function(t){n.emit("network",t.source,t.requestType,t.requestState,t.detail)})}function ZA(){if(typeof window!="undefined"){var n=document.createElement("video");n.loop=!0,n.autoplay=!0,n.playsInline=!0,n.muted=!0,n.crossOrigin="";var t=function(){document.removeEventListener("touchstart",t,!1),document.removeEventListener("mousedown",t,!1),n.muted=!1};return document.addEventListener("touchstart",t,!1),document.addEventListener("mousedown",t,!1),n}else return{}}function eu(n){var t=new f.Group;t.name="internalLights";{var e=new f.DirectionalLight(16777215,.3);e.position.copy(new f.Vector3(1,1,1)),t.add(e)}{var e=new f.DirectionalLight(16777215,.1);e.position.copy(new f.Vector3(-1,-1,-1)),t.add(e)}{var e=new f.DirectionalLight(16777215,.1);t.add(e)}{var e=new f.AmbientLight(16777215,.6);t.add(e)}n.add(t)}function YA(n){for(var t,e,r={},i=n.split(/(\;|\,)/),a=0,o=i;a<o.length;a++){var s=o[a],u=s.split("="),l=(t=u[0])===null||t===void 0?void 0:t.trim(),c=(e=u[1])===null||e===void 0?void 0:e.trim();l&&c&&(r[l]=c)}return r}function tc(){var n;if(typeof document!="undefined")for(var t=document.getElementsByTagName("meta"),e=0;e<t.length;e++){var r=t[e];if(r.getAttribute("name")==="viewport"){var i=YA((n=r.getAttribute("content"))!==null&&n!==void 0?n:""),a=Number(i["initial-scale"]);if(!isNaN(a))return a}}return 1}const $A="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6tn2b/H+TUTLc7yjcOXV46OUAnUs6EbUp022ZBXc1NhoZYYd7fjDRvdcHAwrlK2QBVJ4sgoqONmY45RUT23sZ6H42F2hK5CtkMbjhZlDmUUcvq1zyieUVyjbE4I1GBfItwxG56YaUZTQwyh4P6NgJ4YYYvCuQb5kOyI03pORjiqe4Lwpq5pt1vJqfUwKWJVbSMYfppYconG+maNNQOWBZuwHTzicGel75NtFOkxr5apmV8cikcko0DrDQs863AeGl0cE0+1xy573m0/wf0cEKW6H7BWtggiMG8sy3oHRDpJMw4NWb6am/bv9znkqEzjd61t5oo5clTrjhwevO75EJRBKSRt745Z16ZEjcM73sccZplBPm8PyTcxZAkSRdHm/acJ0Z3JZhHB0BxqDHgWFZFmm0ZbCw87twI/zc3e/Cz93vPneXtU/WdQS3oTviXdY/q5PsJKfoGuQjZuO/0in1qsj85cuXrxqeAOJpGqdJOqrUutgVl2Qb0BWqp/RE8AWWVB7t2KrIzY2Wx2fWKl7yfswgxqj8lYummYa3hfwF9MuQRmbfQE4ocPDjtUWQ6Tq1M2w7gC2EcrMGtWS6xlpGKEDDcb1vUQ25zT4lrC2s0dU4gFPppKkbeIYr7NMpqjStuFg5rNU9epGyt8PXyfX4DE1bKLhR/1XPxwJhp5DAV67T9ZPwFdovhBMIGUYoRBN4wim6S3eoXVEHXdLgmwY0x6BQnO4xPJ0Ar5OVxhQF0L9UslRM4yaQQfQImnBegi8vhY2A1k6YLlrj61TwDdNQnIISwiPvpD7TwYQTssZXK47vg8y9Gp2nxRc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0,1,1,1]),rg=new Uint8Array([0,1,2,1,3,2]),wa=new f.BufferGeometry;wa.setAttribute("position",new f.BufferAttribute(eg,3));wa.setAttribute("uv",new f.BufferAttribute(tg,2));wa.setIndex(new f.BufferAttribute(rg,1));var ta=new f.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),rc=new f.Mesh(wa,ta);rc.matrixAutoUpdate=!1;var ys=new f.Scene;ys.add(rc);ys.matrixAutoUpdate=!1;var Li=new f.OrthographicCamera(-.5,.5,.5,-.5,.1,1);Li.position.set(0,0,.5);Li.lookAt(0,0,0);Li.updateMatrixWorld(!0);Li.matrixAutoUpdate=!1;var ng=new f.Vector4,ig=new f.Vector4;function ag(n){if(ta.map){var r=n.getViewport(ng),i=n.getScissor(ig),a=n.getScissorTest(),o=n.autoClear,s=i.x+ru[0]/3,u=i.y+ru[1]/3,l=tu[0]/3,c=tu[1]/3;n.setViewport(s,u,l,c),n.setScissor(s,u,l,c),n.setScissorTest(!0),n.autoClear=!1,n.render(ys,Li),n.setViewport(r),n.setScissor(i),n.setScissorTest(a),n.autoClear=o}else{var t=new f.Texture,e=new Image;e.onload=function(){t.image=e,t.wrapS=f.ClampToEdgeWrapping,t.wrapT=f.ClampToEdgeWrapping,t.minFilter=f.LinearFilter,t.needsUpdate=!0,t.generateMipmaps=!1,ta.needsUpdate=!0,e.onload=Q},e.src=$A,ta.map=t}}var og=800,nu=90,sg=function(n){return n.replace("//vrlab-public.ljcdn.com/","//vr-public.realsee-cdn.cn/").replace("//vrlab-image4.ljcdn.com/","//vr-image-4.realsee-cdn.cn/").replace("//vrlab-image3.ljcdn.com/","//vr-image-3.realsee-cdn.cn/").replace("//vrlab-image2.ljcdn.com/","//vr-image-2.realsee-cdn.cn/").replace("//vrlab-image1.ljcdn.com/","//vr-image-1.realsee-cdn.cn/")},ug=new f.Vector2,lg=new f.Sphere,_i=new f.Frustum,ji=new f.Matrix4,iu=new WeakMap,vo=new WeakMap,mo=Lo([]);new Xo;var nc=function(n){ue(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,u,l,c,d,p,A,h=n.call(this)||this;if(h.ident=kt(),typeof window!="undefined"&&(Qo.instances[h.ident]=h),h.renderSwitch01=0,h.currentMode="Panorama",h.pano={workCode:"",panoIndex:0},h.needsRender=!1,h.modelSceneNeedsRender=!1,h.onlyRenderIfNeeds=(r=e.onlyRenderIfNeeds)!==null&&r!==void 0?r:!0,h.imageOptions=O({},(i=e.imageOptions)!==null&&i!==void 0?i:{}),h.textureOptions=O({},(a=e.textureOptions)!==null&&a!==void 0?a:{}),h.poweredByRealsee=(o=e.poweredByRealsee)!==null&&o!==void 0?o:!0,h.extraElements=[],h.controllerInits={Panorama:Object.assign({},e.panorama),Model:Object.assign({},e.model),Floorplan:Object.assign({},e.floorplan),Topview:Object.assign({},e.topview),Mapview:Object.assign({},e.mapview),VRPanorama:Object.assign({},e.vrPanorama),XRPanorama:Object.assign({},e.xrPanorama)},h.fps={testCount:0,testTime:ve()},h.info=null,h.modeChangeDuration=(s=e.modeChangeDuration)!==null&&s!==void 0?s:og,h.enableWheel=(u=e.enableWheel)!==null&&u!==void 0?u:!0,typeof window!="undefined")if("renderer"in e)e.renderer instanceof xn&&h.throwError(new Error("cannot render a internal renderer")),h.renderer=e.renderer;else try{h.renderer=new xn({preserveDrawingBuffer:e.preserveDrawingBuffer,backgroundColor:e.backgroundColor,backgroundAlpha:e.backgroundAlpha,antialias:e.antialias,webgl2:e.webgl2,logarithmicDepthBuffer:e.logarithmicDepthBuffer,precision:e.precision,powerPreference:e.powerPreference});var v=tc();h.renderer.setPixelRatio(v===1?window.devicePixelRatio:1),h.renderer.setSize(512,512)}catch(R){R instanceof Error&&h.throwError(R)}h.getPixelsRenderTarget=new f.WebGLRenderTarget(1,1,{encoding:(c=(l=h.renderer)===null||l===void 0?void 0:l.outputEncoding)!==null&&c!==void 0?c:f.sRGBEncoding,generateMipmaps:!1});var g=new f.DepthTexture(1,1);g.generateMipmaps=!1,g.format=f.DepthStencilFormat,g.type=f.UnsignedInt248Type,h.modelRenderTarget=new f.WebGLRenderTarget(1,1,{encoding:(p=(d=h.renderer)===null||d===void 0?void 0:d.outputEncoding)!==null&&p!==void 0?p:f.sRGBEncoding,depthTexture:g,generateMipmaps:!1,depthBuffer:!0,stencilBuffer:!0}),h.scissor=Object.assign({left:0,bottom:0,width:1,height:1},e.scissor),h.camera=new Su(nu),h.scene=new Xo,h.xrCustomObjectsScene=new f.Scene,h.scene.add(h.xrCustomObjectsScene),h.scene.matrixAutoUpdate=!1,h.lastLoadWorkTask=Promise.resolve(),h.requestProxy=(A=e.requestProxy)!==null&&A!==void 0?A:sg,h.networkSubscribe=new du,h.networkSubscribe.on("network",function(R,C,I,L){var T;h.emit("network.resource",X("network.resource",{source:R,requestType:C,requestState:I,detail:L})),(T=h.analysis)===null||T===void 0||T.network(h.works,R,C,I,L)}),h.boundingMesh=$v(new f.Box3(new f.Vector3(-.5,-.5,-.5),new f.Vector3(.5,.5,.5))),h.boundingMesh.name="bounding",h.models=I0(),h.models.push(new Oo),h.lastModels=I0(),h.lastWorks=Lo([]),h.readyCallbacks=[],h.syncingState=!1,h.helperGroup=new f.Group,h.helperGroup.name="helper",h.helperGroup.matrixAutoUpdate=!1,h.scene.add(h.helperGroup),h.modelGroup=new f.Group,h.modelGroup.visible=!1,h.modelGroup.name="model",h.modelGroup.matrixAutoUpdate=!1,h.modelScene=new f.Scene,h.modelScene.add(h.modelGroup),h.modelScene.add(h.boundingMesh),h.modelScene.matrixAutoUpdate=!1,h.videoTexture=new f.VideoTexture(e.videoInstance||ZA()),eu(h.scene),eu(h.modelScene),h.state={mode:h.currentMode,workCode:h.pano.workCode,panoIndex:h.pano.panoIndex,longitude:h.camera.pose.longitude,latitude:h.camera.pose.latitude,fov:h.camera.pose.fov,offset:h.camera.pose.offset.clone(),distance:h.camera.pose.distance},h.stateSynced=!1,h._enablePostProcessing=!1,h._enableIOSEDR=!1,h._enableEDL=!1,h._enableHQ=!1,h.destroyed=!1,h.paused=!0,typeof window!="undefined"&&(e.play!==!1&&h.play(),h.stopAnimationLoop=Mt.shared.add(function(R,C){for(var I=[],L=2;L<arguments.length;L++)I[L-2]=arguments[L];h.updateTime.apply(h,vt([R,C],I,!1))},!1,0,10));var m=function(){typeof document!="undefined"&&document.fullscreenElement===null&&h.currentMode==="VRPanorama"&&h.controller.emit("vr.requestExit",X("vr.requestExit",{}))},y=function(){h.needsRender=!0,h.modelSceneNeedsRender=!0};if(typeof document!="undefined"&&document.addEventListener("fullscreenchange",m,!1),h.renderer&&h.renderer.domElement.addEventListener("webglcontextrestored",y,!1),h.removeEventListeners=function(){typeof document!="undefined"&&document.removeEventListener("fullscreenchange",m,!1),h.renderer&&h.renderer.domElement.removeEventListener("webglcontextrestored",y,!1)},h.plugins={},e.plugins&&e.plugins.length)for(var b=0,x=e.plugins;b<x.length;b++){var w=x[b];if(typeof w=="function")w(h);else if(Array.isArray(w)){var M=w[0],S=w[1],E=w[2];if(typeof M=="function"){var B=M(h,E);typeof S=="string"&&(h.plugins[S]?h.throwError(new Error("plugin name ".concat(S," is exists."))):h.plugins[S]=B)}}}return h.gpuPickingRenderTarget=new f.WebGLRenderTarget(1,1,{generateMipmaps:!1}),h.meshReplaceMaterialMap=new Map,h.meshOriginMaterialMap=new Map,WA(h),h}return Object.defineProperty(t,"version",{get:function(){return"6.4.0-alpha.28"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return ua.decoderPath},set:function(e){ua.setDecoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ktx2Path",{get:function(){return fi.transcoderPath},set:function(e){fi.setTranscoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panoIndex",{get:function(){return this.pano.panoIndex},enumerable:!1,configurable:!0}),t.prototype.getGPUPicking=function(e,r,i,a,o){var s=this;if(a===void 0&&(a=1),o===void 0&&(o=new f.Vector3(0,0,0)),!this.renderer)throw new Error("renderer is not initialized.");var u=this.models.getMaterial(),l=u.constantColor,c=u.colorStyle;this.models.setMaterial({colorStyle:"CONSTANT",constantColor:o}),this.scene.traverse(function(h){if(!(!(h instanceof f.Mesh)||h instanceof Ot)){var v=Object.keys(i).filter(function(m){return m===h.uuid})[0];if(v)if(s.meshOriginMaterialMap.set(v,h.material),s.meshReplaceMaterialMap.get(v))h.material=s.meshReplaceMaterialMap.get(v);else{var g=new f.ShaderMaterial({uniforms:{color:{value:i[v]}},vertexShader:`
|
|
2170
2170
|
void main() {
|
|
2171
2171
|
vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
|
|
2172
2172
|
gl_Position = projectionMatrix * mvPosition;
|
|
@@ -2176,4 +2176,4 @@ void main() {
|
|
|
2176
2176
|
void main() {
|
|
2177
2177
|
gl_FragColor = vec4( color, 1.0 );
|
|
2178
2178
|
}
|
|
2179
|
-
`});g.depthTest=h.material.depthTest,g.side=h.material.side,s.meshReplaceMaterialMap.set(v,g),h.material=g}}});var d=this.renderer.getSize(new f.Vector2);this.camera.setViewOffset(d.width,d.height,e*a,r*a,1,1),this.renderer.setRenderTarget(this.gpuPickingRenderTarget),this.render();var p=new Uint8Array(4);this.renderer.readRenderTargetPixels(this.gpuPickingRenderTarget,0,0,1,1,p),this.renderer.setRenderTarget(null),this.camera.clearViewOffset(),this.scene.traverse(function(h){!(h instanceof f.Mesh)||h instanceof Ot||s.meshOriginMaterialMap.get(h.uuid)&&(h.material=s.meshOriginMaterialMap.get(h.uuid))}),this.models.setMaterial({colorStyle:c,constantColor:l});var A=Object.keys(i).filter(function(h){return i[h].equals(new f.Color().setRGB(p[0]/255,p[1]/255,p[2]/255))})[0];return A||!1},t.prototype.dispose=function(){var e,r;if(this.destroyed!==!0){delete Qo.instances[this.ident],this.emit("dispose"),this.destroyed=!0,this.pause(),this.stopAnimationLoop&&(this.stopAnimationLoop(),delete this.stopAnimationLoop),(e=this.renderer)===null||e===void 0||e.setAnimationLoop(null),this.off(),this.networkSubscribe.off(),this.controller&&(this.controller.destroy(),this.controller=void 0);var i=this.getElement();i&&i.parentNode&&i.parentNode.removeChild(i);var a=this.models.getMaterial();a&&(a.pano0&&a.pano0.map.dispose(),a.pano1&&a.pano1.map!==((r=a.pano0)===null||r===void 0?void 0:r.map)&&a.pano1.map.dispose());for(var o=0,s=this.models;o<s.length;o++){var u=s[o];u.dispose()}this.models.length=0,this.models.setMaterial({pano0:null,pano1:null}),this.meshReplaceMaterialMap.forEach(function(l){l.dispose()}),this.meshOriginMaterialMap.forEach(function(l){l.dispose()}),this.renderer instanceof xn&&this.renderer.forceContextLoss&&this.renderer.forceContextLoss()}},t.prototype.setScissor=function(e){var r;if(Object.assign(this.scissor,e),this.controller&&this.controller.updateRenderSize){var i=new f.Vector2;(r=this.renderer)===null||r===void 0||r.getDrawingBufferSize(i),this.controller.updateRenderSize(i)}},Object.defineProperty(t.prototype,"helperVisible",{get:function(){return this.helperGroup.visible},set:function(e){this.helperGroup.visible!==e&&(this.helperGroup.visible=e,this.emit("helpers.visible",X("helpers.visible",{object:this.helperGroup})),this.needsRender=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableIOSEDR",{get:function(){return this._enableIOSEDR},set:function(e){this._enableIOSEDR!==e&&(this._enableIOSEDR=e,this.currentMode&&this.currentMode==="Panorama"&&this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"postProcessingType",{get:function(){return this.currentMode==="Panorama"&&this.enableIOSEDR&&this.enablePostProcessing?"luminance":this.currentMode==="Mapview"&&this.enableEDL?"edl":this.currentMode==="Mapview"&&this.enableHQ?"hq":null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableEDL",{get:function(){return this._enableEDL},set:function(e){if(e===!0&&this.currentMode!==t.Mode.Mapview)throw new Error("只支持Mapview下开启EDL");this._enableEDL!==e&&(this._enableEDL=e,this.boundingMesh.visible=!e,this.needsRender=!0,this.modelSceneNeedsRender=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableHQ",{get:function(){return this._enableHQ},set:function(e){if(e===!0&&this.currentMode!==t.Mode.Mapview)throw new Error("只支持Mapview下开启HQ");this._enableHQ!==e&&(this._enableHQ=e,this.boundingMesh.visible=!e,this.needsRender=!0,this.modelSceneNeedsRender=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enablePostProcessing",{get:function(){return this._enablePostProcessing},set:function(e){this._enablePostProcessing!==e&&(this._enablePostProcessing=e),this.needsRender=!0,this.modelSceneNeedsRender=!0},enumerable:!1,configurable:!0}),t.prototype.updateConfiguration=function(e,r){r===void 0&&(r=!0);var i=!1;if(e.panorama&&(Object.assign(this.controllerInits.Panorama,e.panorama),this.currentMode==="Panorama"&&(i=!0)),e.model&&(Object.assign(this.controllerInits.Model,e.model),this.currentMode==="Model"&&(i=!0)),e.floorplan&&(Object.assign(this.controllerInits.Floorplan,e.floorplan),this.currentMode==="Floorplan"&&(i=!0)),e.topview&&(Object.assign(this.controllerInits.Topview,e.topview),this.currentMode==="Topview"&&(i=!0)),e.mapview&&(Object.assign(this.controllerInits.Mapview,e.mapview),this.currentMode==="Mapview"&&(i=!0)),e.vrPanorama&&(Object.assign(this.controllerInits.VRPanorama,e.vrPanorama),this.currentMode==="VRPanorama"&&(i=!0)),e.imageOptions&&(Object.assign(this.imageOptions,e.imageOptions),(this.currentMode==="Panorama"||this.currentMode==="VRPanorama")&&(i=!0)),e.textureOptions&&Object.assign(this.textureOptions,e.textureOptions),r&&i&&this.controller&&this.currentMode){var a=this.controller.updateConfiguration(this.controllerInits[this.currentMode]);a||this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0)}},t.prototype.appendTo=function(e,r){if(r===void 0&&(r={}),!!this.renderer){if(!(this.renderer instanceof xn)){this.throwError(new Error("cannot call appendTo method when render a external renderer"));return}var i=this.getElement();if(i){e.appendChild(i),this.refresh(r);var a=window.getComputedStyle(e).position;a!=="relative"&&a!=="absolute"&&a!=="fixed"&&a!=="sticky"&&(e.style.position="relative")}}},t.prototype.refresh=function(e,r){if(e===void 0&&(e={}),!!this.renderer){var i=this.getElement();if(i){var a=i.parentNode;if(a&&a.nodeName){var o=e.width,s=o===void 0?a.offsetWidth:o,u=e.height,l=u===void 0?a.offsetHeight:u;this.renderer instanceof xn&&(r&&this.renderer.setPixelRatio(r),this.renderer.setSize(s,l))}var c=new f.Vector2;if(this.renderer.getDrawingBufferSize(c),this.controller&&this.controller.updateRenderSize&&this.controller.updateRenderSize(c),this.modelRenderTarget.width!==c.x||this.modelRenderTarget.height!==c.y){this.modelRenderTarget.setSize(c.x,c.y),this.modelRenderTarget.depthTexture.dispose();var d=new f.DepthTexture(c.x,c.y);d.generateMipmaps=!1,d.format=f.DepthStencilFormat,d.type=f.UnsignedInt248Type,this.modelRenderTarget.depthTexture=d,this.modelRenderTarget.depthTexture.needsUpdate=!0}this.needsRender=!0,this.modelSceneNeedsRender=!0,this.render(Q,!0)}}},t.prototype.addExtraElement=function(e){var r=this;return this.extraElements.indexOf(e)===-1&&(this.extraElements.push(e),this.controller&&this.controller.bindExtraElement(e)),function(){return r.removeExtraElement(e)}},t.prototype.removeExtraElement=function(e){var r=this.extraElements.indexOf(e);r!==-1&&(this.extraElements.splice(r,1),this.controller&&this.controller.unbindExtraElement(e))},t.prototype.getPose=function(){var e=this.camera.copyPose(),r=e.longitude,i=e.latitude,a=e.fov,o=e.offset,s=e.distance;return{longitude:r,latitude:i,fov:a,offset:o.clone(),distance:s}},t.prototype.getSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getSize(e),e.x*=this.scissor.width,e.y*=this.scissor.height,e},t.prototype.getDrawingBufferSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getDrawingBufferSize(e),e.x*=this.scissor.width,e.y*=this.scissor.height,e},t.prototype.updateCamera=function(e,r,i){if(i===void 0&&(i=!0),!this.controller)throw new Error("controller is not initialized.");return this.controller.updateCamera(e,r,i)},t.prototype.updateCameraWithKeyframes=function(e,r,i){if(i===void 0&&(i=!0),!this.controller)throw new Error("controller is not initialized.");return this.controller.updateCameraWithKeyframes(e,r,i)},t.prototype.getLongitudeAndLatitude=function(){var e=this.getPose(),r=e.longitude,i=e.latitude;return{longitude:r,latitude:i}},t.prototype.getOffset=function(){return this.getPose().offset},t.prototype.getCameraLocal=function(){if(this.pano.workCode&&this.controller&&this.works){var e=this.works.getResolvedObserver(this.pano);if(e){var r=new f.Object3D;return r.position.copy(e.position),r.quaternion.copy(e.quaternion),r.scale.set(1,1,1),r.matrix.compose(r.position,r.quaternion,r.scale),r.matrixAutoUpdate=!1,em(this.camera,r)}}return null},Object.defineProperty(t.prototype,"works",{get:function(){var e=vo.get(this);if(!e)return mo;for(var r=0,i=e;r<i.length;r++){var a=i[r];if(!Bi.has(a))return mo}return e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"work",{get:function(){return this.works[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"model",{get:function(){return this.models[0]},enumerable:!1,configurable:!0}),t.prototype.load=function(e,r,i,a){var o=this;if(a===void 0&&(a=!0),!this.renderer)throw new Error("renderer is not initialized");var s=this.lastLoadWorkTask.then(function(){return rm(e)?e.then(function(u){return o.load_(u,r,i,a)}):o.load_(e,r,i,a)});return this.lastLoadWorkTask=s.catch(function(u){o.throwError(u)}),s},t.prototype.load_=function(e,r,i,a){var o=this,s,u,l,c,d,p,A,h;a===void 0&&(a=!0);var v={};typeof i=="number"?v.duration=i:typeof i=="object"&&Object.assign(v,i),this.works===mo&&(v.duration===void 0&&(v.duration=0),v.effect===void 0&&(v.effect="instant"));var g=[];if(Array.isArray(e))for(var m=0,y=e;m<y.length;m++){var b=y[m];typeof b!="string"&&"work"in b?g.push(hi(b.work,b)):g.push(hi(b))}else g.push(hi(e));for(var x=Lo(g),w=function(J){var W=M,$=new Ut({allowHosts:J.allowHosts,get requestProxy(){return W.requestProxy},get networkSubscribe(){return W.networkSubscribe}});Ov(J,$)},M=this,S=0,E=x;S<E.length;S++){var P=E[S];w(P)}this.lastWorks=this.works,r===void 0&&(r="inherit"),r==="inherit"&&this.lastWorks.length===0&&(r="initial");var B=x.initial,C=B.work.observers[0],I=C?{workCode:C.work.workCode,panoIndex:C.panoIndex}:{workCode:B.work.workCode,panoIndex:0},F=(s=B.mode)!==null&&s!==void 0?s:C?"Panorama":"Mapview",T={};if(r==="inherit"){F=this.currentMode;var L=x.resolvedObservers[this.panoIndex];L?I={workCode:L.work.workCode,panoIndex:L.panoIndex}:typeof x.initial.panoIndex=="number"?I={workCode:x.initial.work.workCode,panoIndex:x.initial.panoIndex}:(F==="Panorama"||F==="VRPanorama"||F==="XRPanorama")&&(F="Mapview"),T={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,distance:void 0,offset:void 0}}else if(r==="initial")typeof B.panoIndex=="number"&&(I={workCode:B.work.workCode,panoIndex:B.panoIndex}),B.mode&&(F=B.mode),T={longitude:B.longitude,latitude:B.latitude,fov:B.fov,distance:B.distance,offset:(u=B.offset)===null||u===void 0?void 0:u.clone()};else{if(F=(l=r.mode)!==null&&l!==void 0?l:this.currentMode,typeof r.panoIndex=="number"){var L=x.getResolvedObserver({workCode:(d=(c=r.workCode)!==null&&c!==void 0?c:B.work.workCode)!==null&&d!==void 0?d:"",panoIndex:r.panoIndex});L&&(I={workCode:L.work.workCode,panoIndex:L.panoIndex})}T={longitude:r.longitude,latitude:r.latitude,fov:r.fov,distance:r.distance,offset:r.offset}}var D=O(O(O({},I),{mode:F}),T),V=this.getCurrentState(),z=(p=v.duration)!==null&&p!==void 0?p:this.modeChangeDuration;(F==="Floorplan"||F==="Topview"||F==="Mapview")&&this.currentMode===F&&(z=0);var U="fly";(F==="Panorama"||F==="VRPanorama"||F==="XRPanorama")&&this.currentMode===F&&(U=(A=v.effect)!==null&&A!==void 0?A:"fade"),this.emit("works.request",X("works.request",{input:e,works:x,state:D,userAction:a}));var q=function(){o.modelGroup.visible=!0,o.pano=I;var J=O(O({initial:{state:D,currentState:V,duration:z,effect:U,userAction:a}},o.commonParams()),o.controllerInits[F]),W=ht[F].initAnimationEndState(J);if(o.controller&&o.currentMode===F)o.controller.updateWork(x,W,{effect:U,duration:z},a)===!1&&(o.controller.destroy(),o.controller=o.applyController(F,J));else{var $=o.currentMode;if(o.controller)o.controller.destroy();else{var Y=ht[F].initAnimationEndState(J);o.camera.setFromPose(Y),o.emit("camera.update",X("camera.update",{state:o.getCurrentState(),userAction:a}))}o.controller=o.applyController(F,J);var Z=X("mode.change",{prevMode:$,mode:F,state:W,userAction:a});o.emit("mode.change",Z)}};vo.set(this,x),this.updateConfiguration(v,!1);var G=Promise.resolve();if(F===t.Mode.Floorplan||F===t.Mode.Topview||F===t.Mode.Mapview||F===t.Mode.Model)this.models.loaded===!1&&(this.camera.setFromPose(D),am(this.state,this.camera.pose)),this.controller||(this.currentMode=F),G=this.loadModel(x,v).then(function(){o.needsRender=!0,o.modelSceneNeedsRender=!0,q(),o.emit("camera.update",X("camera.update",{state:o.getCurrentState(),userAction:a}))});else{q();var K=!1,_=function(){o.works===x&&K===!1&&(o.needsRender=!0,o.modelSceneNeedsRender=!0,o.emit("camera.update",X("camera.update",{state:o.getCurrentState(),userAction:a})),o.loadModel(x,v),K=!0)};this.controller.once("pano.arrived",_),this.controller.once("pano.cancel",_),setTimeout(_,((h=v.duration)!==null&&h!==void 0?h:this.modeChangeDuration)+1e3)}return this.emit("works.load",X("works.load",{input:e,state:this.getCurrentState(),userAction:a,works:x})),G.then(function(){return o.ready()}).then(function(){var J;o.emit("works.ready",X("works.ready",{input:e,state:o.getCurrentState(),userAction:a,works:x})),(J=o.analysis)===null||J===void 0||J.work(x)})},t.prototype.reset=function(){var e=this,r=this.lastLoadWorkTask.then(function(){return e.reset_()});return this.lastLoadWorkTask=r.catch(function(i){e.throwError(i)}),r},t.prototype.reset_=function(){var e=this;return new Promise(function(r){var i;e.controller&&(e.controller.destroy(),e.controller=void 0);var a=e.models.getMaterial();a&&(a.pano0&&a.pano0.map.dispose(),a.pano1&&a.pano1.map!==((i=a.pano0)===null||i===void 0?void 0:i.map)&&a.pano1.map.dispose()),e.models.setMaterial({pano0:null,pano1:null,modelAlpha:1}),e.lastModels.setMaterial({pano0:null,pano1:null,modelAlpha:1}),e.renderer&&(e.models.update(e.renderer,e.camera,e.currentMode),e.lastModels.update(e.renderer,e.camera,e.currentMode),e.model&&e.boundingMesh.update(e.renderer,e.camera,e.model));for(var o=0,s=e.models;o<s.length;o++){var u=s[o];e.lastModels.push(u)}if(e.models.length=0,e.lastModels.length>0){for(var l=0,c=e.lastModels;l<c.length;l++){var u=c[l];e.modelGroup.remove(u),u.dispose(),e.needsRender=!0,e.modelSceneNeedsRender=!0}e.lastModels.length=0}e.lastWorks&&delete e.lastWorks,vo.delete(e),e.currentMode="Mapview",e.pano={workCode:"",panoIndex:0},e.camera.setFromPose({distance:0,fov:nu,longitude:0,latitude:0,offset:new f.Vector3(0,0,0)}),e.state={mode:e.currentMode,workCode:e.pano.workCode,panoIndex:e.pano.panoIndex,longitude:e.camera.pose.longitude,latitude:e.camera.pose.latitude,fov:e.camera.pose.fov,offset:e.camera.pose.offset.clone(),distance:e.camera.pose.distance},e.models.needsRender=!1,e.camera.needsRender=!1,e.needsRender=!1,e.modelSceneNeedsRender=!1,r()})},t.prototype.changeMode=function(e,r,i,a,o){var s=this;return r===void 0&&(r={}),a===void 0&&(a=!0),o===void 0&&(o=!1),new Promise(function(u,l){var c,d,p,A;if(!s.renderer)throw new Error("renderer is not initialized.");r=O({},r);var h=0;s.controller&&(typeof i=="number"?h=i:h=(c=i==null?void 0:i.duration)!==null&&c!==void 0?c:s.modeChangeDuration);var v="fly";s.controller&&typeof i=="object"&&i.effect&&(v=i.effect);var g=typeof r.panoIndex=="number"?{workCode:(A=(d=r.workCode)!==null&&d!==void 0?d:(p=s.work)===null||p===void 0?void 0:p.workCode)!==null&&A!==void 0?A:"",panoIndex:r.panoIndex}:s.pano;if(!t.Mode.hasOwnProperty(e)){var m=new Error('mode "'.concat(e,'" is not existed'));s.throwError(m),l(m);return}if((e===t.Mode.Panorama||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama)&&!s.works.getResolvedObserver(g)){var m=new Error("PanoId ".concat(He(g)," not existed."));s.throwError(m),l(m);return}(e===t.Mode.Floorplan||e===t.Mode.Topview||e===t.Mode.Mapview||e===t.Mode.Model)&&(s.models.loaded||(h=0));var y=s.controller,b=s.currentMode,x=function(){if(s.controller&&s.controller.stopMomentumMovement(),s.controller&&o===!1&&b===e)e===t.Mode.Panorama||e===t.Mode.Model||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama?Ar(s.pano,g)&&"moveToPano"in s.controller&&typeof s.controller.moveToPano=="function"?s.controller.moveToPano(g,O({duration:h},r),a):s.controller.updateCamera(r,h,a).catch(Q):(Ar(s.pano,g)||(s.pano=g),s.controller.updateCamera(r,h,a).catch(Q));else{var M=O(O({},r),g),S=O(O({initial:{state:M,currentState:s.getCurrentState(),duration:h,effect:v,userAction:a}},s.commonParams()),s.controllerInits[e]),E=ht[e].initAnimationEndState(S),P=X("mode.change.request",{prevMode:s.currentMode,mode:e,state:E,userAction:a});if(s.emit("mode.change.request",P),!P.defaultPrevented){y&&y.destroy(),s.controller=s.applyController(e,S);var B=X("mode.change",{prevMode:s.currentMode,mode:e,state:E,userAction:a});s.emit("mode.change",B)}}u()};if(e===t.Mode.VRPanorama)s.requestFullscreen(),nm().then(function(){return x()}).catch(function(M){M instanceof Error&&(s.exitFullscreen(),s.throwError(M),l(M))});else if(e===t.Mode.XRPanorama){var w=Mt.shared.getContext();w?w.end():im().then(function(M){Mt.shared.setContext(M),x()}).catch(function(M){M instanceof Error&&(s.throwError(M),l(M))})}else x()})},t.prototype.getPixels=function(e,r,i,a,o,s,u){if(!this.renderer)throw new Error("renderer is not initialized.");var l=this.renderer.getPixelRatio(),c=this.renderer.getRenderTarget(),d=this.renderer.getSize(new f.Vector2),p=0,A=0,h=1,v=1,g,m,y,b,x;typeof e=="number"?(p=e,typeof r=="number"&&(A=r),typeof i=="number"&&(h=i),typeof a=="number"&&(v=a),g=o,m=s,x=u):(p=e.x,A=e.y,h=e.width,v=e.height,g=e.pixelRatio,m=e.flipY,y=e.helperVisible,b=e.skipPanorama,x=e.buffer),p=Math.ceil(p),A=Math.ceil(A),h=Math.ceil(h),v=Math.ceil(v),g=Math.ceil(g!=null?g:l),m=m!=null?m:!1;var w=this.getPixelsRenderTarget;w.setSize(h*g,v*g),this.renderer.setRenderTarget(w),this.camera.pixelRatio=g,this.camera.resolution.set(h,v),this.camera.setViewOffset(d.width,d.height,p,d.height-A-v,h,v);for(var M=0,S=this.scene.children;M<S.length;M++){var E=S[M];E instanceof f.Object3D&&E.traverseVisible(function(_){_.setResolution&&_.setResolution(h*g/l,v*g/l)})}this.models.autoUpdate=!1;var P=!0,B=0;b&&(this.controller instanceof ht.Panorama||this.controller instanceof ht.VRPanorama||this.controller instanceof ht.XRPanorama)&&(P=this.controller.tiling.object.visible,this.controller.tiling.object.visible=!1,B=this.models.getMaterial().modelAlpha,this.models.setMaterial({modelAlpha:b===!0?1:B}));var C=this.helperVisible;y===!1&&(this.helperVisible=!1),this.models.update(this.renderer,this.camera,this.currentMode),this.controller?(this.controller.updateRenderSize(new f.Vector2(h*g,v*g)),this.controller.render(!0,this.postProcessingType)):(this.renderer.render(this.scene,this.camera),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!1,this.renderer.render(this.modelScene,this.camera),this.renderer.autoClearDepth=!0,this.renderer.autoClearColor=!0),this.helperVisible=C,b&&(this.controller instanceof ht.Panorama||this.controller instanceof ht.VRPanorama||this.controller instanceof ht.XRPanorama)&&(this.controller.tiling.object.visible=P,this.models.setMaterial({modelAlpha:B})),this.models.update(this.renderer,this.camera,this.currentMode),this.models.autoUpdate=!0;var I=h*g,F=v*g,T=I*F,L=T*4,D;try{if(x){if(x.length!==L)throw new Error("buffer length is not equals pixels ".concat(L))}else x=new Uint8Array(L);if(this.renderer.readRenderTargetPixels(w,0,0,h*g,v*g,x),m)for(var V=T/2,z=0,U=0,q=0,G=0;U<V;U++)for(G=(F-Math.floor(U/I)-1)*I+U%I,q=0;q<4;q++)z=x[U*4+q],x[U*4+q]=x[G*4+q],x[G*4+q]=z}catch(_){D=_}if(this.renderer.setRenderTarget(c),this.controller&&this.controller.updateRenderSize){var K=new f.Vector2;this.renderer.getDrawingBufferSize(K),this.controller.updateRenderSize(K)}if(this.camera.clearViewOffset(),this.camera.pixelRatio=l,this.getSize(this.camera.resolution),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height,D)throw D;return x},t.prototype.getElement=function(){var e;return(e=this.renderer)===null||e===void 0?void 0:e.domElement},Object.defineProperty(t.prototype,"observers",{get:function(){return this.works.resolvedObservers},enumerable:!1,configurable:!0}),t.prototype.render=function(e,r){var i=this;if(r===void 0&&(r=!1),!this.renderer)return null;if(r){var a=this.renderer.getSize(ug);this.scene.traverseVisible(function(o){o.setResolution&&o.setResolution(a.x,a.y)})}return this.aroundScissor(function(){i.renderer&&(i.modelScene.background=i.scene.background,i.scene.background=null,i.controller?(i.controller.render(i.onlyRenderIfNeeds?i.modelSceneNeedsRender:!0,i.postProcessingType),i.info={memory:O({},i.controller.renderer.info.memory),render:O({},i.controller.renderer.info.render)}):(i.renderer.render(i.scene,i.camera),i.info={memory:O({},i.renderer.info.memory),render:O({},i.renderer.info.render)}),i.scene.background=i.modelScene.background,i.modelScene.background=null,i.poweredByRealsee&&i.currentMode!=="VRPanorama"&&i.currentMode!=="XRPanorama"&&i.renderer.getRenderTarget()!==i.getPixelsRenderTarget&&ag(i.renderer)),e&&Mt.shared.add(e,!0)}),null},t.prototype.updateTime=function(e,r){for(var i,a=this,o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];if(!this.destroyed){if(this.works.update(),this.syncingState=this.syncState(e,r),this.controller&&(i=this.controller).updateTime.apply(i,vt([e,r],o,!1)),this.renderer&&(this.camera.pixelRatio=this.renderer.getPixelRatio(),this.getSize(this.camera.resolution),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height),this.camera.updateTime(e),this.renderer){fi.detectSupport(this.renderer);var u=this.models.loaded,l=this.models.refined;if(this.models.update(this.renderer,this.camera,this.currentMode),this.camera.autoNearFar){var c=this.models.bounding.getBoundingSphere(lg),d=c.radius*2;c.containsPoint(this.camera.position)||(d=this.camera.position.distanceTo(c.center)+c.radius),d=ce(d,800,5e4),this.camera.far!==d&&(this.camera.far=d);var p=d/1e4;p=ce(p,.03,.1),this.camera.near!==p&&(this.camera.near=p)}if(u===!1&&this.models.loaded===!0&&this.emit("models.load",X("models.load",{models:this.models})),l===!1&&this.models.refined===!0&&this.emit("models.refined",X("models.refined",{models:this.models})),this.models.loaded){for(var A=0,h=this.models;A<h.length;A++){var v=h[A];v.parent!==this.modelGroup&&(this.modelGroup.add(v),this.needsRender=!0,this.modelSceneNeedsRender=!0)}if(this.lastModels.length>0){for(var g=0,m=this.lastModels;g<m.length;g++){var v=m[g];this.modelGroup.remove(v),v.dispose(),this.needsRender=!0,this.modelSceneNeedsRender=!0}this.lastModels.length=0}this.lastWorks&&delete this.lastWorks}this.lastModels.setMaterial(this.models.getMaterial()),this.lastModels.materialVersion=this.models.materialVersion,this.lastModels.update(this.renderer,this.camera,this.currentMode)}this.syncingState=!1;var y=new f.Vector2(512,512),b=new f.Vector2(512,512);this.renderer&&(this.renderer.getSize(y),y.x*=this.scissor.width,y.y*=this.scissor.height,this.renderer.getDrawingBufferSize(b),b.x*=this.scissor.width,b.y*=this.scissor.height);{for(var x=new f.Box3,w=new f.Box3,M=new f.Vector3(4,4,4),S=0,E=this.works.resolvedObservers;S<E.length;S++){var P=E[S];w.setFromCenterAndSize(P.position,M),x.union(w)}if(x.union(this.models.bounding),this.lastWorks)for(var B=0,C=this.lastWorks.resolvedObservers;B<C.length;B++){var P=C[B];w.setFromCenterAndSize(P.position,M),x.union(w)}x.union(this.lastModels.bounding),x.getCenter(this.boundingMesh.position),x.getSize(this.boundingMesh.scale),this.boundingMesh.boundingBox.copy(x),this.renderer&&this.model&&this.boundingMesh.update(this.renderer,this.camera,this.model)}var I=X("render.prepare",{needsRender:!0,info:null});if(this.emit("render.prepare",I),!I.defaultPrevented){var F=[];_i.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),ji.setFromProjectionMatrix(_i);for(var T=0,L=this.scene.children;T<L.length;T++){var D=L[T];D!==this.modelGroup&&D!==this.boundingMesh&&D.traverseVisible(function(K){if(K.setResolution&&K.setResolution(y.x,y.y),K.setTime&&K.setTime(e),K.mixer instanceof f.AnimationMixer){var _=iu.get(K.mixer);_||(_=new f.Clock,iu.set(K.mixer,_)),K.mixer.update(_.getDelta())}(K instanceof f.Mesh||K instanceof f.Line||K instanceof f.Points)&&(K instanceof f.ImmediateRenderObject||!K.frustumCulled||ji.intersectsObject(K))&&F.push(K)})}if(b.width*b.height>4096*2048?this.renderSwitch01=this.renderSwitch01^1:this.renderSwitch01=0,this.renderer&&this.paused===!1&&this.renderSwitch01===0){var V=void 0;if(this.onlyRenderIfNeeds!==!0)V=this.render();else{if(this.controller&&(this.controller.needsRender===!0&&(this.controller.needsRender=!1,this.needsRender=!0),this.controller.modelSceneNeedsRender===!0&&(this.controller.modelSceneNeedsRender=!1,this.modelSceneNeedsRender=!0)),this.camera.needsRender===!0&&(this.camera.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0),this.models.needsRender===!0&&(this.models.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0),this.needsRender!==!0)for(var z=0,U=F;z<U.length;z++){var q=U[z],G=function(K){K.needsRender===!0?(K.needsRender=!1,a.needsRender=!0):K.mixer&&K.mixer.stats.actions.inUse>0&&(a.needsRender=!0)};G(q),q.traverseAncestors(G)}(this.needsRender!==!1||this.modelSceneNeedsRender!==!1)&&(V=this.render())}this.needsRender=!1,this.modelSceneNeedsRender=!1,this.hasListener("render")&&this.emit("render",X("render",{needsRender:V!==void 0,info:this.info}))}this.needsRender=!1,this.modelSceneNeedsRender=!1}this.fps.testTime&&e-this.fps.testTime<1e3?this.fps.testCount++:(this.emit("fps",this.fps.testCount),this.fps.testTime=e,this.fps.testCount=0)}},t.prototype.pause=function(){this.paused=!0,this.renderer&&this.renderer instanceof xn&&this.renderer.clear(!0,!0,!0)},t.prototype.play=function(){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.paused=!1},t.prototype.moveToPano=function(e,r,i){r===void 0&&(r={}),i===void 0&&(i=!0);var a=this,o=a.controller,s=a.renderer;if(!o)return this.throwError(new Error("controller is not initialized.")),Promise.resolve();if(!s)return this.throwError(new Error("renderer is not initialized.")),Promise.resolve();var u=this.works.getResolvedObserver(e);if(!u)return this.throwError(new Error("pano ".concat(JSON.stringify(e)," not existed."))),Promise.resolve();var l={workCode:u.work.workCode,panoIndex:u.panoIndex};return"moveToPano"in o&&typeof o.moveToPano=="function"?o.moveToPano(l,r,i):u&&(this.pano=l,this.once("initAnimation.start",function(c){r.moveStartCallback&&r.moveStartCallback(c.state)}),this.once("initAnimation.end",function(c){r.moveEndCallback&&r.moveEndCallback(c.state)}),this.changeMode(t.Mode.Panorama,r,{effect:r.effect},i)),this.ready()},t.prototype.preloadPano=function(e,r){var i=this;r===void 0&&(r=Q);var a=this.works.getResolvedObserver(e);if(!a)return Promise.reject(new Error("Pano ".concat(JSON.stringify(e)," never found")));var o=["right","left","up","down","front","back"],s=ve();return Promise.all(o.map(function(u){var l=O({key:"pano.".concat(a.panoId,".").concat(u)},_t(i.imageOptions,["size","format","quality","mappings"])),c=a.images[u],d=i.imageOptions.transform?i.imageOptions.transform(c,l):ft(c,l);return pt(a.work).preload(d)})).then(function(){var u=ve()-s;return r(u),u})},t.prototype.project2d=function(e,r){if(r===void 0&&(r=!1),!this.renderer)return null;if(this.models.length>0&&r){var i=this.camera.position,a=e.clone().sub(i),o=new f.Raycaster(i,a.clone().normalize());o.params.Points={threshold:.1};var s=this.models.intersectRaycaster(o)[0];if(s&&s.distance+.01<a.length())return null}var u=e.clone().project(this.camera);if(Math.abs(u.z)>1)return null;var l=this.renderer.getSize(new f.Vector2),c=l.x*this.scissor.width,d=l.y*this.scissor.height,p=l.x*this.scissor.left+(u.x+1)/2*c,A=l.y*(1-this.scissor.bottom-this.scissor.height)+(-u.y+1)/2*d;return new f.Vector2(p,A)},t.prototype.getRenderObjects=function(e){_i.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),ji.setFromProjectionMatrix(_i),e||(e=this.scene);var r=[];return e.traverseVisible(function(i){(i instanceof f.Mesh||i instanceof f.Line||i instanceof f.Points)&&(i instanceof f.ImmediateRenderObject||!i.frustumCulled||ji.intersectsObject(i))&&r.push(i)}),r},t.prototype.getCurrentState=function(){return O(O({},this.getPose()),{mode:this.currentMode,workCode:this.pano.workCode,panoIndex:this.pano.panoIndex})},t.prototype.setState=function(e,r,i){var a,o,s,u,l,c,d,p,A,h;r===void 0&&(r=!1),i===void 0&&(i=!0),e=Object.assign({},e),e.offset&&!(e instanceof f.Vector3)&&(e.offset=new f.Vector3(e.offset.x,e.offset.y,e.offset.z));var v;if(typeof e.panoIndex=="number")if(e.workCode)v={workCode:e.workCode,panoIndex:e.panoIndex};else{var g=(o=(a=this.work)===null||a===void 0?void 0:a.workCode)!==null&&o!==void 0?o:"",m=this.state.workCode;this.works.filter(function(I){return I.workCode===m}).length>0&&(g=m),v={workCode:g,panoIndex:e.panoIndex}}var y=(s=e.mode)!==null&&s!==void 0?s:this.state.mode,b,x,w,M,S;if(this.controller&&this.controller.stopMomentumMovement(),this.state.mode!==y){if(y==="VRPanorama"){this.changeMode("VRPanorama",void 0,void 0,!0);return}var E={workCode:v==null?void 0:v.workCode,panoIndex:v==null?void 0:v.panoIndex};typeof e.longitude=="number"&&(E.longitude=e.longitude),typeof e.latitude=="number"&&(E.latitude=e.latitude),typeof e.fov=="number"&&(E.fov=e.fov),typeof e.distance=="number"&&(E.distance=e.distance),e.offset instanceof f.Vector3&&(E.offset=e.offset);var P=O(O({initial:{state:E,currentState:this.getCurrentState(),duration:this.modeChangeDuration,effect:"fly",userAction:!1}},this.commonParams()),this.controllerInits[y]),B=ht[y].initAnimationEndState(P);b=B.longitude,x=B.latitude,w=B.fov,M=B.offset,S=B.distance}else b=(u=e.longitude)!==null&&u!==void 0?u:this.state.longitude,x=(l=e.latitude)!==null&&l!==void 0?l:this.state.latitude,w=(c=e.fov)!==null&&c!==void 0?c:this.state.fov,M=(d=e.offset)!==null&&d!==void 0?d:this.state.offset,S=(p=e.distance)!==null&&p!==void 0?p:this.state.distance;var C={workCode:(v!=null?v:this.pano).workCode,panoIndex:(v!=null?v:this.pano).panoIndex,mode:y,longitude:b,latitude:x,fov:w,offset:M,distance:S};this.emit("state.set",X("state.set",{userAction:i,state:C})),on(this.state,C)||(this.controller&&C.mode==="VRPanorama"&&C.mode!==this.state.mode?(Er(this.state,C),this.changeMode("VRPanorama")):this.controller&&C.mode==="XRPanorama"&&C.mode!==this.state.mode?(Er(this.state,C),this.changeMode("XRPanorama")):(Er(this.state,C),this.controller&&i&&(this.controller.userAction=!1),r&&this.state.mode===C.mode&&(this.syncingState=this.syncState(ve(),0,r),this.syncingState&&((A=this.controller)===null||A===void 0||A.updateTime(ve(),0),this.syncingState=!1)),this.emit("state.change",X("state.change",{userAction:i,state:this.state})),(h=this.analysis)===null||h===void 0||h.state(this.works,this.state)))},t.prototype.aroundScissor=function(e){if(this.renderer){if(this.state.mode==="XRPanorama"){e();return}var r=new f.Vector2,i=this.scissor.left!==0||this.scissor.bottom!==0||this.scissor.width!==1||this.scissor.height!==1;if(i){this.renderer.getSize(r);var a=Math.floor(r.x*this.scissor.left),o=Math.floor(r.y*this.scissor.bottom),s=Math.floor(r.x*this.scissor.width),u=Math.floor(r.y*this.scissor.height);this.renderer.setViewport(a,o,s,u),this.renderer.setScissor(a,o,s,u),this.renderer.setScissorTest(!0)}e(),i&&(this.renderer.setViewport(0,0,r.x,r.y),this.renderer.setScissor(0,0,r.x,r.y),this.renderer.setScissorTest(!1))}},t.prototype.syncState=function(e,r,i){i===void 0&&(i=!1);var a=this.stateSynced;if(this.stateSynced=!1,!this.controller)return!1;if(this.state.mode!==this.currentMode){var o={mode:this.state.mode,workCode:this.state.workCode,panoIndex:this.state.panoIndex,longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.changeMode(this.state.mode,o,this.modeChangeDuration,this.controller.userAction),!0}if(!this.controller.isReady())return!1;if(this.controller instanceof ht.Model){if(ea(this.camera.pose.offset,this.state.offset)){var s={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return this.controller.moveToPosition(this.state.offset,O(O({},s),{duration:i?0:void 0}),!1),!0}}else{var u={workCode:this.state.workCode,panoIndex:this.state.panoIndex};if(!Ar(u,this.pano)&&"moveToPano"in this.controller&&typeof this.controller.moveToPano=="function"){var s={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.controller.moveToPano(u,s,!1),!0}}if(this.controller instanceof ht.Floorplan||this.controller instanceof ht.Topview||this.controller instanceof ht.Mapview){var l=1,c=.2,d=.2,p=Math.PI/45,A=i?this.state.fov:no(this.camera.pose.fov,this.state.fov,l),h=Math.abs(this.camera.pose.distance-this.state.distance),v=h>d*15?h/15:c,g=i?this.state.distance:no(this.camera.pose.distance,this.state.distance,v),m=this.camera.pose.offset.distanceTo(this.state.offset),y=m>d*15?m/15:d,b=i?new f.Vector3().copy(this.state.offset):tm(this.camera.pose.offset,this.state.offset,y),x=i?{longitude:this.state.longitude,latitude:this.state.latitude}:F0({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},p),w=x.longitude,M=x.latitude;if(er(A,this.camera.pose.fov)||ea(b,this.camera.pose.offset)||er(g,this.camera.pose.distance)||er(w,this.camera.pose.longitude,Math.PI*2)||er(M,this.camera.pose.latitude)){var S={x:b.x,y:b.y,z:b.z},E={fov:A};return Object.assign(S,{distance:g}),Object.assign(E,{longitude:w,latitude:M}),this.controller.stopMomentumMovement(),this.controller.cameraMotion.set(E,0).catch(Q),this.controller.locationMotion.set(S,0).catch(Q),!0}}else{var P=1,B=Math.PI/45,A=i?this.state.fov:no(this.camera.pose.fov,this.state.fov,P),C=i?{longitude:this.state.longitude,latitude:this.state.latitude}:F0({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},B),w=C.longitude,M=C.latitude,g=this.state.distance,b=new f.Vector3().copy(this.state.offset);if(er(g,this.camera.pose.distance)&&(this.state.distance=this.camera.pose.distance),ea(b,this.camera.pose.offset)&&(this.state.offset=this.camera.pose.offset.clone()),er(w,this.camera.pose.longitude,Math.PI*2)||er(M,this.camera.pose.latitude)||er(A,this.camera.pose.fov))return this.controller.stopMomentumMovement(),this.controller.cameraMotion.set({longitude:w,latitude:M,fov:A},0).catch(Q),!0}if(this.stateSynced=!0,a===!1&&this.emit("state.synced",X("state.synced",{userAction:!1,state:this.state})),this.readyCallbacks.length&&this.stateSynced){var I=this.currentMode,F=I===t.Mode.Floorplan||I===t.Mode.Topview||I===t.Mode.Mapview||I===t.Mode.Model;if(!F||this.models.loaded){var T=this.readyCallbacks.slice();this.readyCallbacks.length=0;for(var L=0,D=T;L<D.length;L++){var V=D[L];this.controller instanceof ht.Panorama&&V.tile===!0&&!this.controller.isTileReady()?this.readyCallbacks.push(V):V()}}}return!1},t.prototype.ready=function(e){var r=this;return e===void 0&&(e={}),new Promise(function(i){var a;r.readyCallbacks.push(Object.assign(i,{tile:(a=e.tile)!==null&&a!==void 0?a:!1}))})},t.prototype.requestFullscreen=function(){var e;if(ai){var r=(e=this.getElement())===null||e===void 0?void 0:e.parentNode;r&&"requestFullscreen"in r&&typeof document!="undefined"&&document.fullscreenElement===null&&r.requestFullscreen()}},t.prototype.exitFullscreen=function(){typeof document!="undefined"&&document.fullscreenElement&&"exitFullscreen"in document&&document.exitFullscreen()},t.prototype.throwError=function(e){this.hasListener("error")?this.emit("error",e):console.error(e)},t.prototype.loadModel=function(e,r){for(var i=this,a=[],o=function(g){var m=s.models.filter(function(b){var x;return((x=b.work)===null||x===void 0?void 0:x.workCode)===g.workCode})[0];if(m)m.work=g,a.push(m);else{var y=new Oo({onError:function(b){i.emit("model.error",X("model.error",{work:g,model:y,error:b})),i.throwError(b)},onShownFloorChange:function(b){i.emit("model.changeShownFloor",X("model.changeShownFloor",{work:g,model:y,error:null}))},onLoad:function(){i.emit("model.load",X("model.load",{work:g,model:y,error:null}))}});a.push(y),s.emit("model.request",X("model.request",{work:g,model:y,error:null})),y.load(g,{textureOptions:s.textureOptions,"3d-tiles":r["3d-tiles"]})}},s=this,u=0,l=e;u<l.length;u++){var c=l[u];o(c)}if(this.models.length>0){for(var d=0,p=this.models;d<p.length;d++){var A=p[d];a.indexOf(A)===-1&&this.lastModels.push(A)}this.models.length=0}for(var h=0,v=a;h<v.length;h++){var A=v[h];this.models.push(A)}return this.renderer&&(this.models.loaded=!1),new Promise(function(g){i.on("models.load",function(){i.controller&&i.controller.updateModel(i.models),g()})})},t.prototype.commonParams=function(){return{ident:this.ident,scene:this.scene,xrCustomObjectsScene:this.xrCustomObjectsScene,helper:this.helperGroup,boundingMesh:this.boundingMesh,camera:this.camera,renderer:this.renderer,scissor:this.scissor,element:this.getElement(),models:this.models,works:this.works,imageOptions:this.imageOptions,enableWheel:this.enableWheel,enableIOSEDR:this._enableIOSEDR,enableEDL:this.enableEDL,enableHQ:this.enableHQ,extraElements:this.extraElements,videoTexture:this.videoTexture,modelScene:this.modelScene,modelRenderTarget:this.modelRenderTarget}},t.prototype.applyController=function(e,r){var i=this;if(!this.renderer)throw new Error("renderer is not initialized.");e!==t.Mode.Mapview&&(this.enableEDL=!1,this.enableHQ=!1);var a=ht[e];this.currentMode=e;for(var o=new a(r),s=function(A){o.on(A,function(){for(var h=[],v=0;v<arguments.length;v++)h[v]=arguments[v];var g=i.emit.apply(i,vt([A],h,!1));if(g)return!1})},u=0,l=ec;u<l.length;u++){var c=l[u];s(c)}{var d=ht[e].initAnimationEndState(r),p=r.initial.userAction;on(this.state,d)||(Er(this.state,d),this.emit("state.change",X("state.change",{userAction:p,state:this.state}))),this.emit("currentState.change",X("currentState.change",{userAction:p,state:this.getCurrentState()}))}return o.on("camera.update",function(A){var h;if(i.controller){var v=i.controller.getTargetState();A.userAction&&i.syncingState===!1&&i.state.mode===v.mode&&!on(i.state,v)&&(Er(i.state,v),i.emit("state.change",X("state.change",{userAction:A.userAction,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}i.emit("currentState.change",X("currentState.change",{userAction:A.userAction,state:i.getCurrentState()}))}),o.on("initAnimation.start",function(A){var h,v=A.state,g=A.userAction;g&&i.state.mode===v.mode&&!on(i.state,v)&&(Er(i.state,v),i.emit("state.change",X("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("initAnimation.end",function(A){var h,v=A.state,g=A.userAction;g&&i.state.mode===v.mode&&!on(i.state,v)&&(Er(i.state,v),i.emit("state.change",X("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.moveTo",function(A){var h,v=A.state,g=A.userAction;i.pano={workCode:v.workCode,panoIndex:v.panoIndex},g&&i.state.mode===v.mode&&!on(i.state,v)&&(Er(i.state,v),i.emit("state.change",X("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.arrived",function(A){var h,v=A.state,g=A.userAction;g&&i.state.mode===v.mode&&!on(i.state,v)&&(Er(i.state,v),i.emit("state.change",X("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.cancel",function(A){var h,v=A.state,g=A.userAction;g&&i.state.mode===v.mode&&!on(i.state,v)&&(Er(i.state,v),i.emit("state.change",X("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.moveTo",function(A){var h=A.userAction;i.emit("currentState.change",X("currentState.change",{userAction:h,state:i.getCurrentState()}))}),o.on("pano.request",function(A){i.emit("pano.request",A),A.defaultPrevented||i.moveToPano(A.state,A.options,A.userAction)}),o.on("vr.requestExit",function(){i.currentMode===t.Mode.VRPanorama&&(i.exitFullscreen(),i.changeMode(t.Mode.Panorama))}),o.on("error",function(A){return i.throwError(A)}),o},t.prototype.removeEventListeners=function(){},t.prototype.getWorkResources=function(e){var r=this,i,a=this.models.find(function(l){return l.work===e}),o=((i=a==null?void 0:a.viewLayers)!==null&&i!==void 0?i:[]).map(function(l){return l.scene});function s(l){var c=/([0-9a-z\.\_\-]+)([\?\#].*)?$/i.exec(l);if(c){var d=String(c[1]).trim().split(".").slice(1).reverse()[0];if(d)return d}return""}function u(l,c){c===void 0&&(c=0);var d=[];if(l.content&&l.content.uri){var p=s(l.content.uri);if(p==="json"){var A=ft(l.content.uri,{key:"model.".concat(c)});d.push({url:A,type:"tileset"})}else if(p==="at3d"&&l.extras[p]){var A=l.content.uri;d.push({url:A,type:"model"});for(var h=l.extras[p],v=h.textureArray,g=h.textureOptions,m=0,y=v;m<y.length;m++){var b=y[m],x=O({key:"texture.pbm"},_t(g,["format","quality","size","sharpen","mappings"])),w=Cn(b,g==null?void 0:g.transform,x);d.push({url:w,type:"texture"})}}else{var A=ft(l.content.uri,{key:"model.".concat(c)});d.push({url:A,type:"model"})}}if(l.children)for(var M=0;M<l.children.length;M++){var S=l.children[M];d.push.apply(d,u(S,M))}return d}return Promise.all(o.map(function(l){return l.loadAllTilesets()})).then(function(){for(var l=[],c=["right","left","up","down","front","back"],d=0,p=e.observers;d<p.length;d++){for(var A=p[d],h=0,v=c;h<v.length;h++){var g=v[h],m=O({key:"pano.".concat(He(A.pano),".").concat(g)},_t(r.imageOptions,["size","format","quality","mappings"])),y=A.images[g],b=Cn(y,r.imageOptions.transform,m);l.push({url:b,type:"pano"})}if(A.images.tiles)for(var x=0,w=A.images.tiles;x<w.length;x++)for(var M=w[x],S=0,E=c;S<E.length;S++)for(var g=E[S],P=M.size,B=Math.pow(2,M.level),C=1/B,I=0;I<B;I++)for(var F=0;F<B;F++){var T="".concat(A.panoId,".").concat(g,".").concat(M.level,".").concat(I,".").concat(F),m=O(O({key:"pano_tile.".concat(T)},_t(r.imageOptions,["format","size","quality","sharpen","mappings"])),{size:M.scale>=1?void 0:P*C*M.scale,cut:[P*C*F,P*C*I,P*C,P*C]}),b=Cn(M[g],r.imageOptions.transform,m);l.push({url:b,type:"pano_tile"})}}for(var L=0,D=o;L<D.length;L++){var V=D[L];V.tileset.url&&l.push({url:V.tileset.url,type:"model"}),l.push.apply(l,u(V.tileset.root))}return l})},Object.defineProperty(t.prototype,"internalLightsEnabled",{get:function(){var e=this.scene.children.find(function(r){return r.name==="internalLights"});return e?e.visible:!1},set:function(e){var r=this.scene.children.find(function(i){return i.name==="internalLights"});r&&(r.visible=e)},enumerable:!1,configurable:!0}),t.Mode={Panorama:"Panorama",Model:"Model",Floorplan:"Floorplan",Topview:"Topview",Mapview:"Mapview",VRPanorama:"VRPanorama",XRPanorama:"XRPanorama"},t.Line=null,t}(va),Qo={instances:{},constructor:nc};typeof window!="undefined"&&Object.assign(window,{__FIVE_DEBUG__:Qo});var cg=function(){function n(){}return n.createButton=function(t){var e=document.createElement("button");function r(){e.style.display="",e.style.cursor="pointer",e.style.left="calc(50% - 50px)",e.style.width="100px",e.textContent="ENTER VR",e.onmouseenter=function(){e.style.opacity="1.0"},e.onmouseleave=function(){e.style.opacity="0.5"},e.onclick=function(){t&&t()}}function i(){e.style.display="",e.style.cursor="auto",e.style.left="calc(50% - 75px)",e.style.width="150px",e.onmouseenter=null,e.onmouseleave=null,e.onclick=null}function a(){i(),e.textContent="VR NOT SUPPORTED"}function o(u){u.style.position="absolute",u.style.bottom="20px",u.style.padding="12px 6px",u.style.border="1px solid #fff",u.style.borderRadius="4px",u.style.background="rgba(0,0,0,0.1)",u.style.color="#fff",u.style.font="normal 13px sans-serif",u.style.textAlign="center",u.style.opacity="0.5",u.style.outline="none",u.style.zIndex="999"}if("xr"in navigator)return e.id="VRButton",e.style.display="none",o(e),navigator.xr.isSessionSupported("immersive-vr").then(function(u){u?r():a()}),e;var s=document.createElement("a");return window.isSecureContext===!1?(s.href=document.location.href.replace(/^http:/,"https:"),s.innerHTML="WEBXR NEEDS HTTPS"):(s.href="https://immersiveweb.dev/",s.innerHTML="WEBXR NOT AVAILABLE"),s.style.left="calc(50% - 90px)",s.style.width="180px",s.style.textDecoration="none",o(s),s},n}();exports.AnimationFrameLoop=Mt;exports.Camera=Su;exports.CustomShader=qf;exports.Fetcher=Ut;exports.Five=nc;exports.InternalWebGLRenderer=xn;exports.IntersectMesh=ya;exports.Model=Oo;exports.ModelViewLayer=$i;exports.NetworkSubscribe=du;exports.PBMContainer=Zf;exports.PBMGroup=Uf;exports.PBMMesh=Ot;exports.PBMMeshMaterial=br;exports.PBMPointCloud=yr;exports.PBMPointCloudMaterial=Pi;exports.PROXY_CONTROLLER_EVENT_NAMES=ec;exports.PanoCircleMesh=kl;exports.PanoCircleMeshCustom=_v;exports.PanoCircleMeshSolid=Hv;exports.Scene=Xo;exports.Subscribe=va;exports.TextureLoader=Xn;exports.Tile=Yo;exports.Tile3DModel=wn;exports.TileCache=Pu;exports.TileCubeTextureTarget=qe;exports.TileNode=qu;exports.TileRequestScheduler=Tu;exports.Tileset=zr;exports.Trajectory=Ru;exports.TrajectoryNode=Tl;exports.Work=as;exports.XRButton=cg;exports.controllersDefaultInitArgs=XA;exports.defaultImageURLTransform=ft;exports.defaultPbmParameters=ge;exports.getViewportScale=tc;exports.imageSupport=vu;exports.isPanoId=Au;exports.loadAt3d=sl;exports.loadB3dm=Ju;exports.loadDome=ul;exports.loadDomez=cl;exports.loadFbx=Ml;exports.loadGltf=fl;exports.loadPbm=il;exports.loadPly=ns;exports.loadPnts=Wu;exports.loadX3p=Il;exports.panoEqual=Ar;exports.panoParse=Lt;exports.panoStringify=He;exports.parseWork=hi;
|
|
2179
|
+
`});g.depthTest=h.material.depthTest,g.side=h.material.side,s.meshReplaceMaterialMap.set(v,g),h.material=g}}});var d=this.renderer.getSize(new f.Vector2);this.camera.setViewOffset(d.width,d.height,e*a,r*a,1,1),this.renderer.setRenderTarget(this.gpuPickingRenderTarget),this.render();var p=new Uint8Array(4);this.renderer.readRenderTargetPixels(this.gpuPickingRenderTarget,0,0,1,1,p),this.renderer.setRenderTarget(null),this.camera.clearViewOffset(),this.scene.traverse(function(h){!(h instanceof f.Mesh)||h instanceof Ot||s.meshOriginMaterialMap.get(h.uuid)&&(h.material=s.meshOriginMaterialMap.get(h.uuid))}),this.models.setMaterial({colorStyle:c,constantColor:l});var A=Object.keys(i).filter(function(h){return i[h].equals(new f.Color().setRGB(p[0]/255,p[1]/255,p[2]/255))})[0];return A||!1},t.prototype.dispose=function(){var e,r;if(this.destroyed!==!0){delete Qo.instances[this.ident],this.emit("dispose"),this.destroyed=!0,this.pause(),this.stopAnimationLoop&&(this.stopAnimationLoop(),delete this.stopAnimationLoop),(e=this.renderer)===null||e===void 0||e.setAnimationLoop(null),this.off(),this.networkSubscribe.off(),this.controller&&(this.controller.destroy(),this.controller=void 0);var i=this.getElement();i&&i.parentNode&&i.parentNode.removeChild(i);var a=this.models.getMaterial();a&&(a.pano0&&a.pano0.map.dispose(),a.pano1&&a.pano1.map!==((r=a.pano0)===null||r===void 0?void 0:r.map)&&a.pano1.map.dispose());for(var o=0,s=this.models;o<s.length;o++){var u=s[o];u.dispose()}this.models.length=0,this.models.setMaterial({pano0:null,pano1:null}),this.meshReplaceMaterialMap.forEach(function(l){l.dispose()}),this.meshOriginMaterialMap.forEach(function(l){l.dispose()}),this.renderer instanceof xn&&this.renderer.forceContextLoss&&this.renderer.forceContextLoss()}},t.prototype.setScissor=function(e){var r;if(Object.assign(this.scissor,e),this.controller&&this.controller.updateRenderSize){var i=new f.Vector2;(r=this.renderer)===null||r===void 0||r.getDrawingBufferSize(i),this.controller.updateRenderSize(i)}},Object.defineProperty(t.prototype,"helperVisible",{get:function(){return this.helperGroup.visible},set:function(e){this.helperGroup.visible!==e&&(this.helperGroup.visible=e,this.emit("helpers.visible",X("helpers.visible",{object:this.helperGroup})),this.needsRender=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableIOSEDR",{get:function(){return this._enableIOSEDR},set:function(e){this._enableIOSEDR!==e&&(this._enableIOSEDR=e,this.currentMode&&this.currentMode==="Panorama"&&this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"postProcessingType",{get:function(){return this.currentMode==="Panorama"&&this.enableIOSEDR&&this.enablePostProcessing?"luminance":this.currentMode==="Mapview"&&this.enableEDL?"edl":this.currentMode==="Mapview"&&this.enableHQ?"hq":null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableEDL",{get:function(){return this._enableEDL},set:function(e){if(e===!0&&this.currentMode!==t.Mode.Mapview)throw new Error("只支持Mapview下开启EDL");this._enableEDL!==e&&(this._enableEDL=e,this.boundingMesh.visible=!e,this.needsRender=!0,this.modelSceneNeedsRender=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableHQ",{get:function(){return this._enableHQ},set:function(e){if(e===!0&&this.currentMode!==t.Mode.Mapview)throw new Error("只支持Mapview下开启HQ");this._enableHQ!==e&&(this._enableHQ=e,this.boundingMesh.visible=!e,this.needsRender=!0,this.modelSceneNeedsRender=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enablePostProcessing",{get:function(){return this._enablePostProcessing},set:function(e){this._enablePostProcessing!==e&&(this._enablePostProcessing=e),this.needsRender=!0,this.modelSceneNeedsRender=!0},enumerable:!1,configurable:!0}),t.prototype.updateConfiguration=function(e,r){r===void 0&&(r=!0);var i=!1;if(e.panorama&&(Object.assign(this.controllerInits.Panorama,e.panorama),this.currentMode==="Panorama"&&(i=!0)),e.model&&(Object.assign(this.controllerInits.Model,e.model),this.currentMode==="Model"&&(i=!0)),e.floorplan&&(Object.assign(this.controllerInits.Floorplan,e.floorplan),this.currentMode==="Floorplan"&&(i=!0)),e.topview&&(Object.assign(this.controllerInits.Topview,e.topview),this.currentMode==="Topview"&&(i=!0)),e.mapview&&(Object.assign(this.controllerInits.Mapview,e.mapview),this.currentMode==="Mapview"&&(i=!0)),e.vrPanorama&&(Object.assign(this.controllerInits.VRPanorama,e.vrPanorama),this.currentMode==="VRPanorama"&&(i=!0)),e.imageOptions&&(Object.assign(this.imageOptions,e.imageOptions),(this.currentMode==="Panorama"||this.currentMode==="VRPanorama")&&(i=!0)),e.textureOptions&&Object.assign(this.textureOptions,e.textureOptions),r&&i&&this.controller&&this.currentMode){var a=this.controller.updateConfiguration(this.controllerInits[this.currentMode]);a||this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0)}},t.prototype.appendTo=function(e,r){if(r===void 0&&(r={}),!!this.renderer){if(!(this.renderer instanceof xn)){this.throwError(new Error("cannot call appendTo method when render a external renderer"));return}var i=this.getElement();if(i){e.appendChild(i),this.refresh(r);var a=window.getComputedStyle(e).position;a!=="relative"&&a!=="absolute"&&a!=="fixed"&&a!=="sticky"&&(e.style.position="relative")}}},t.prototype.refresh=function(e,r){if(e===void 0&&(e={}),!!this.renderer){var i=this.getElement();if(i){var a=i.parentNode;if(a&&a.nodeName){var o=e.width,s=o===void 0?a.offsetWidth:o,u=e.height,l=u===void 0?a.offsetHeight:u;this.renderer instanceof xn&&(r&&this.renderer.setPixelRatio(r),this.renderer.setSize(s,l))}var c=new f.Vector2;if(this.renderer.getDrawingBufferSize(c),this.controller&&this.controller.updateRenderSize&&this.controller.updateRenderSize(c),this.modelRenderTarget.width!==c.x||this.modelRenderTarget.height!==c.y){this.modelRenderTarget.setSize(c.x,c.y),this.modelRenderTarget.depthTexture.dispose();var d=new f.DepthTexture(c.x,c.y);d.generateMipmaps=!1,d.format=f.DepthStencilFormat,d.type=f.UnsignedInt248Type,this.modelRenderTarget.depthTexture=d,this.modelRenderTarget.depthTexture.needsUpdate=!0}this.needsRender=!0,this.modelSceneNeedsRender=!0,this.render(Q,!0)}}},t.prototype.addExtraElement=function(e){var r=this;return this.extraElements.indexOf(e)===-1&&(this.extraElements.push(e),this.controller&&this.controller.bindExtraElement(e)),function(){return r.removeExtraElement(e)}},t.prototype.removeExtraElement=function(e){var r=this.extraElements.indexOf(e);r!==-1&&(this.extraElements.splice(r,1),this.controller&&this.controller.unbindExtraElement(e))},t.prototype.getPose=function(){var e=this.camera.copyPose(),r=e.longitude,i=e.latitude,a=e.fov,o=e.offset,s=e.distance;return{longitude:r,latitude:i,fov:a,offset:o.clone(),distance:s}},t.prototype.getSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getSize(e),e.x*=this.scissor.width,e.y*=this.scissor.height,e},t.prototype.getDrawingBufferSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getDrawingBufferSize(e),e.x*=this.scissor.width,e.y*=this.scissor.height,e},t.prototype.updateCamera=function(e,r,i){if(i===void 0&&(i=!0),!this.controller)throw new Error("controller is not initialized.");return this.controller.updateCamera(e,r,i)},t.prototype.updateCameraWithKeyframes=function(e,r,i){if(i===void 0&&(i=!0),!this.controller)throw new Error("controller is not initialized.");return this.controller.updateCameraWithKeyframes(e,r,i)},t.prototype.getLongitudeAndLatitude=function(){var e=this.getPose(),r=e.longitude,i=e.latitude;return{longitude:r,latitude:i}},t.prototype.getOffset=function(){return this.getPose().offset},t.prototype.getCameraLocal=function(){if(this.pano.workCode&&this.controller&&this.works){var e=this.works.getResolvedObserver(this.pano);if(e){var r=new f.Object3D;return r.position.copy(e.position),r.quaternion.copy(e.quaternion),r.scale.set(1,1,1),r.matrix.compose(r.position,r.quaternion,r.scale),r.matrixAutoUpdate=!1,em(this.camera,r)}}return null},Object.defineProperty(t.prototype,"works",{get:function(){var e=vo.get(this);if(!e)return mo;for(var r=0,i=e;r<i.length;r++){var a=i[r];if(!Bi.has(a))return mo}return e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"work",{get:function(){return this.works[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"model",{get:function(){return this.models[0]},enumerable:!1,configurable:!0}),t.prototype.load=function(e,r,i,a){var o=this;if(a===void 0&&(a=!0),!this.renderer)throw new Error("renderer is not initialized");var s=this.lastLoadWorkTask.then(function(){return rm(e)?e.then(function(u){return o.load_(u,r,i,a)}):o.load_(e,r,i,a)});return this.lastLoadWorkTask=s.catch(function(u){o.throwError(u)}),s},t.prototype.load_=function(e,r,i,a){var o=this,s,u,l,c,d,p,A,h;a===void 0&&(a=!0);var v={};typeof i=="number"?v.duration=i:typeof i=="object"&&Object.assign(v,i),this.works===mo&&(v.duration===void 0&&(v.duration=0),v.effect===void 0&&(v.effect="instant"));var g=[];if(Array.isArray(e))for(var m=0,y=e;m<y.length;m++){var b=y[m];typeof b!="string"&&"work"in b?g.push(hi(b.work,b)):g.push(hi(b))}else g.push(hi(e));for(var x=Lo(g),w=function(J){var W=M,$=new qt({allowHosts:J.allowHosts,get requestProxy(){return W.requestProxy},get networkSubscribe(){return W.networkSubscribe}});Ov(J,$)},M=this,S=0,E=x;S<E.length;S++){var B=E[S];w(B)}this.lastWorks=this.works,r===void 0&&(r="inherit"),r==="inherit"&&this.lastWorks.length===0&&(r="initial");var R=x.initial,C=R.work.observers[0],I=C?{workCode:C.work.workCode,panoIndex:C.panoIndex}:{workCode:R.work.workCode,panoIndex:0},L=(s=R.mode)!==null&&s!==void 0?s:C?"Panorama":"Mapview",T={};if(r==="inherit"){L=this.currentMode;var F=x.resolvedObservers[this.panoIndex];F?I={workCode:F.work.workCode,panoIndex:F.panoIndex}:typeof x.initial.panoIndex=="number"?I={workCode:x.initial.work.workCode,panoIndex:x.initial.panoIndex}:(L==="Panorama"||L==="VRPanorama"||L==="XRPanorama")&&(L="Mapview"),T={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,distance:void 0,offset:void 0}}else if(r==="initial")typeof R.panoIndex=="number"&&(I={workCode:R.work.workCode,panoIndex:R.panoIndex}),R.mode&&(L=R.mode),T={longitude:R.longitude,latitude:R.latitude,fov:R.fov,distance:R.distance,offset:(u=R.offset)===null||u===void 0?void 0:u.clone()};else{if(L=(l=r.mode)!==null&&l!==void 0?l:this.currentMode,typeof r.panoIndex=="number"){var F=x.getResolvedObserver({workCode:(d=(c=r.workCode)!==null&&c!==void 0?c:R.work.workCode)!==null&&d!==void 0?d:"",panoIndex:r.panoIndex});F&&(I={workCode:F.work.workCode,panoIndex:F.panoIndex})}T={longitude:r.longitude,latitude:r.latitude,fov:r.fov,distance:r.distance,offset:r.offset}}var D=O(O(O({},I),{mode:L}),T),V=this.getCurrentState(),z=(p=v.duration)!==null&&p!==void 0?p:this.modeChangeDuration;(L==="Floorplan"||L==="Topview"||L==="Mapview")&&this.currentMode===L&&(z=0);var U="fly";(L==="Panorama"||L==="VRPanorama"||L==="XRPanorama")&&this.currentMode===L&&(U=(A=v.effect)!==null&&A!==void 0?A:"fade"),this.emit("works.request",X("works.request",{input:e,works:x,state:D,userAction:a}));var q=function(){o.modelGroup.visible=!0,o.pano=I;var J=O(O({initial:{state:D,currentState:V,duration:z,effect:U,userAction:a}},o.commonParams()),o.controllerInits[L]),W=ht[L].initAnimationEndState(J);if(o.controller&&o.currentMode===L)o.controller.updateWork(x,W,{effect:U,duration:z},a)===!1&&(o.controller.destroy(),o.controller=o.applyController(L,J));else{var $=o.currentMode;if(o.controller)o.controller.destroy();else{var Y=ht[L].initAnimationEndState(J);o.camera.setFromPose(Y),o.emit("camera.update",X("camera.update",{state:o.getCurrentState(),userAction:a}))}o.controller=o.applyController(L,J);var Z=X("mode.change",{prevMode:$,mode:L,state:W,userAction:a});o.emit("mode.change",Z)}};vo.set(this,x),this.updateConfiguration(v,!1);var G=Promise.resolve();if(L===t.Mode.Floorplan||L===t.Mode.Topview||L===t.Mode.Mapview||L===t.Mode.Model)this.models.loaded===!1&&(this.camera.setFromPose(D),am(this.state,this.camera.pose)),this.controller||(this.currentMode=L),G=this.loadModel(x,v).then(function(){o.needsRender=!0,o.modelSceneNeedsRender=!0,q(),o.emit("camera.update",X("camera.update",{state:o.getCurrentState(),userAction:a}))});else{q();var K=!1,j=function(){o.works===x&&K===!1&&(o.needsRender=!0,o.modelSceneNeedsRender=!0,o.emit("camera.update",X("camera.update",{state:o.getCurrentState(),userAction:a})),o.loadModel(x,v),K=!0)};this.controller.once("pano.arrived",j),this.controller.once("pano.cancel",j),setTimeout(j,((h=v.duration)!==null&&h!==void 0?h:this.modeChangeDuration)+1e3)}return this.emit("works.load",X("works.load",{input:e,state:this.getCurrentState(),userAction:a,works:x})),G.then(function(){return o.ready()}).then(function(){var J;o.emit("works.ready",X("works.ready",{input:e,state:o.getCurrentState(),userAction:a,works:x})),(J=o.analysis)===null||J===void 0||J.work(x)})},t.prototype.reset=function(){var e=this,r=this.lastLoadWorkTask.then(function(){return e.reset_()});return this.lastLoadWorkTask=r.catch(function(i){e.throwError(i)}),r},t.prototype.reset_=function(){var e=this;return new Promise(function(r){var i;e.controller&&(e.controller.destroy(),e.controller=void 0);var a=e.models.getMaterial();a&&(a.pano0&&a.pano0.map.dispose(),a.pano1&&a.pano1.map!==((i=a.pano0)===null||i===void 0?void 0:i.map)&&a.pano1.map.dispose()),e.models.setMaterial({pano0:null,pano1:null,modelAlpha:1}),e.lastModels.setMaterial({pano0:null,pano1:null,modelAlpha:1}),e.renderer&&(e.models.update(e.renderer,e.camera,e.currentMode),e.lastModels.update(e.renderer,e.camera,e.currentMode),e.model&&e.boundingMesh.update(e.renderer,e.camera,e.model));for(var o=0,s=e.models;o<s.length;o++){var u=s[o];e.lastModels.push(u)}if(e.models.length=0,e.lastModels.length>0){for(var l=0,c=e.lastModels;l<c.length;l++){var u=c[l];e.modelGroup.remove(u),u.dispose(),e.needsRender=!0,e.modelSceneNeedsRender=!0}e.lastModels.length=0}e.lastWorks&&delete e.lastWorks,vo.delete(e),e.currentMode="Mapview",e.pano={workCode:"",panoIndex:0},e.camera.setFromPose({distance:0,fov:nu,longitude:0,latitude:0,offset:new f.Vector3(0,0,0)}),e.state={mode:e.currentMode,workCode:e.pano.workCode,panoIndex:e.pano.panoIndex,longitude:e.camera.pose.longitude,latitude:e.camera.pose.latitude,fov:e.camera.pose.fov,offset:e.camera.pose.offset.clone(),distance:e.camera.pose.distance},e.models.needsRender=!1,e.camera.needsRender=!1,e.needsRender=!1,e.modelSceneNeedsRender=!1,r()})},t.prototype.changeMode=function(e,r,i,a,o){var s=this;return r===void 0&&(r={}),a===void 0&&(a=!0),o===void 0&&(o=!1),new Promise(function(u,l){var c,d,p,A;if(!s.renderer)throw new Error("renderer is not initialized.");r=O({},r);var h=0;s.controller&&(typeof i=="number"?h=i:h=(c=i==null?void 0:i.duration)!==null&&c!==void 0?c:s.modeChangeDuration);var v="fly";s.controller&&typeof i=="object"&&i.effect&&(v=i.effect);var g=typeof r.panoIndex=="number"?{workCode:(A=(d=r.workCode)!==null&&d!==void 0?d:(p=s.work)===null||p===void 0?void 0:p.workCode)!==null&&A!==void 0?A:"",panoIndex:r.panoIndex}:s.pano;if(!t.Mode.hasOwnProperty(e)){var m=new Error('mode "'.concat(e,'" is not existed'));s.throwError(m),l(m);return}if((e===t.Mode.Panorama||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama)&&!s.works.getResolvedObserver(g)){var m=new Error("PanoId ".concat(He(g)," not existed."));s.throwError(m),l(m);return}(e===t.Mode.Floorplan||e===t.Mode.Topview||e===t.Mode.Mapview||e===t.Mode.Model)&&(s.models.loaded||(h=0));var y=s.controller,b=s.currentMode,x=function(){if(s.controller&&s.controller.stopMomentumMovement(),s.controller&&o===!1&&b===e)e===t.Mode.Panorama||e===t.Mode.Model||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama?Ar(s.pano,g)&&"moveToPano"in s.controller&&typeof s.controller.moveToPano=="function"?s.controller.moveToPano(g,O({duration:h},r),a):s.controller.updateCamera(r,h,a).catch(Q):(Ar(s.pano,g)||(s.pano=g),s.controller.updateCamera(r,h,a).catch(Q));else{var M=O(O({},r),g),S=O(O({initial:{state:M,currentState:s.getCurrentState(),duration:h,effect:v,userAction:a}},s.commonParams()),s.controllerInits[e]),E=ht[e].initAnimationEndState(S),B=X("mode.change.request",{prevMode:s.currentMode,mode:e,state:E,userAction:a});if(s.emit("mode.change.request",B),!B.defaultPrevented){y&&y.destroy(),s.controller=s.applyController(e,S);var R=X("mode.change",{prevMode:s.currentMode,mode:e,state:E,userAction:a});s.emit("mode.change",R)}}u()};if(e===t.Mode.VRPanorama)s.requestFullscreen(),nm().then(function(){return x()}).catch(function(M){M instanceof Error&&(s.exitFullscreen(),s.throwError(M),l(M))});else if(e===t.Mode.XRPanorama){var w=Mt.shared.getContext();w?w.end():im().then(function(M){Mt.shared.setContext(M),x()}).catch(function(M){M instanceof Error&&(s.throwError(M),l(M))})}else x()})},t.prototype.getPixels=function(e,r,i,a,o,s,u){if(!this.renderer)throw new Error("renderer is not initialized.");var l=this.renderer.getPixelRatio(),c=this.renderer.getRenderTarget(),d=this.renderer.getSize(new f.Vector2),p=0,A=0,h=1,v=1,g,m,y,b,x;typeof e=="number"?(p=e,typeof r=="number"&&(A=r),typeof i=="number"&&(h=i),typeof a=="number"&&(v=a),g=o,m=s,x=u):(p=e.x,A=e.y,h=e.width,v=e.height,g=e.pixelRatio,m=e.flipY,y=e.helperVisible,b=e.skipPanorama,x=e.buffer),p=Math.ceil(p),A=Math.ceil(A),h=Math.ceil(h),v=Math.ceil(v),g=Math.ceil(g!=null?g:l),m=m!=null?m:!1;var w=this.getPixelsRenderTarget;w.setSize(h*g,v*g),this.renderer.setRenderTarget(w),this.camera.pixelRatio=g,this.camera.resolution.set(h,v),this.camera.setViewOffset(d.width,d.height,p,d.height-A-v,h,v);for(var M=0,S=this.scene.children;M<S.length;M++){var E=S[M];E instanceof f.Object3D&&E.traverseVisible(function(j){j.setResolution&&j.setResolution(h*g/l,v*g/l)})}this.models.autoUpdate=!1;var B=!0,R=0;b&&(this.controller instanceof ht.Panorama||this.controller instanceof ht.VRPanorama||this.controller instanceof ht.XRPanorama)&&(B=this.controller.tiling.object.visible,this.controller.tiling.object.visible=!1,R=this.models.getMaterial().modelAlpha,this.models.setMaterial({modelAlpha:b===!0?1:R}));var C=this.helperVisible;y===!1&&(this.helperVisible=!1),this.models.update(this.renderer,this.camera,this.currentMode),this.controller?(this.controller.updateRenderSize(new f.Vector2(h*g,v*g)),this.controller.render(!0,this.postProcessingType)):(this.renderer.render(this.scene,this.camera),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!1,this.renderer.render(this.modelScene,this.camera),this.renderer.autoClearDepth=!0,this.renderer.autoClearColor=!0),this.helperVisible=C,b&&(this.controller instanceof ht.Panorama||this.controller instanceof ht.VRPanorama||this.controller instanceof ht.XRPanorama)&&(this.controller.tiling.object.visible=B,this.models.setMaterial({modelAlpha:R})),this.models.update(this.renderer,this.camera,this.currentMode),this.models.autoUpdate=!0;var I=h*g,L=v*g,T=I*L,F=T*4,D;try{if(x){if(x.length!==F)throw new Error("buffer length is not equals pixels ".concat(F))}else x=new Uint8Array(F);if(this.renderer.readRenderTargetPixels(w,0,0,h*g,v*g,x),m)for(var V=T/2,z=0,U=0,q=0,G=0;U<V;U++)for(G=(L-Math.floor(U/I)-1)*I+U%I,q=0;q<4;q++)z=x[U*4+q],x[U*4+q]=x[G*4+q],x[G*4+q]=z}catch(j){D=j}if(this.renderer.setRenderTarget(c),this.controller&&this.controller.updateRenderSize){var K=new f.Vector2;this.renderer.getDrawingBufferSize(K),this.controller.updateRenderSize(K)}if(this.camera.clearViewOffset(),this.camera.pixelRatio=l,this.getSize(this.camera.resolution),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height,D)throw D;return x},t.prototype.getElement=function(){var e;return(e=this.renderer)===null||e===void 0?void 0:e.domElement},Object.defineProperty(t.prototype,"observers",{get:function(){return this.works.resolvedObservers},enumerable:!1,configurable:!0}),t.prototype.render=function(e,r){var i=this;if(r===void 0&&(r=!1),!this.renderer)return null;if(r){var a=this.renderer.getSize(ug);this.scene.traverseVisible(function(o){o.setResolution&&o.setResolution(a.x,a.y)})}return this.aroundScissor(function(){i.renderer&&(i.modelScene.background=i.scene.background,i.scene.background=null,i.controller?(i.controller.render(i.onlyRenderIfNeeds?i.modelSceneNeedsRender:!0,i.postProcessingType),i.info={memory:O({},i.controller.renderer.info.memory),render:O({},i.controller.renderer.info.render)}):(i.renderer.render(i.scene,i.camera),i.info={memory:O({},i.renderer.info.memory),render:O({},i.renderer.info.render)}),i.scene.background=i.modelScene.background,i.modelScene.background=null,i.poweredByRealsee&&i.currentMode!=="VRPanorama"&&i.currentMode!=="XRPanorama"&&i.renderer.getRenderTarget()!==i.getPixelsRenderTarget&&ag(i.renderer)),e&&Mt.shared.add(e,!0)}),null},t.prototype.updateTime=function(e,r){for(var i,a=this,o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];if(!this.destroyed){if(this.works.update(),this.syncingState=this.syncState(e,r),this.controller&&(i=this.controller).updateTime.apply(i,vt([e,r],o,!1)),this.renderer&&(this.camera.pixelRatio=this.renderer.getPixelRatio(),this.getSize(this.camera.resolution),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height),this.camera.updateTime(e),this.renderer){fi.detectSupport(this.renderer);var u=this.models.loaded,l=this.models.refined;if(this.models.update(this.renderer,this.camera,this.currentMode),this.camera.autoNearFar){var c=this.models.bounding.getBoundingSphere(lg),d=c.radius*2;c.containsPoint(this.camera.position)||(d=this.camera.position.distanceTo(c.center)+c.radius),d=ce(d,800,5e4),this.camera.far!==d&&(this.camera.far=d);var p=d/1e4;p=ce(p,.03,.1),this.camera.near!==p&&(this.camera.near=p)}if(u===!1&&this.models.loaded===!0&&this.emit("models.load",X("models.load",{models:this.models})),l===!1&&this.models.refined===!0&&this.emit("models.refined",X("models.refined",{models:this.models})),this.models.loaded){for(var A=0,h=this.models;A<h.length;A++){var v=h[A];v.parent!==this.modelGroup&&(this.modelGroup.add(v),this.needsRender=!0,this.modelSceneNeedsRender=!0)}if(this.lastModels.length>0){for(var g=0,m=this.lastModels;g<m.length;g++){var v=m[g];this.modelGroup.remove(v),v.dispose(),this.needsRender=!0,this.modelSceneNeedsRender=!0}this.lastModels.length=0}this.lastWorks&&delete this.lastWorks}this.lastModels.setMaterial(this.models.getMaterial()),this.lastModels.materialVersion=this.models.materialVersion,this.lastModels.update(this.renderer,this.camera,this.currentMode)}this.syncingState=!1;var y=new f.Vector2(512,512),b=new f.Vector2(512,512);this.renderer&&(this.renderer.getSize(y),y.x*=this.scissor.width,y.y*=this.scissor.height,this.renderer.getDrawingBufferSize(b),b.x*=this.scissor.width,b.y*=this.scissor.height);{for(var x=new f.Box3,w=new f.Box3,M=new f.Vector3(4,4,4),S=0,E=this.works.resolvedObservers;S<E.length;S++){var B=E[S];w.setFromCenterAndSize(B.position,M),x.union(w)}if(x.union(this.models.bounding),this.lastWorks)for(var R=0,C=this.lastWorks.resolvedObservers;R<C.length;R++){var B=C[R];w.setFromCenterAndSize(B.position,M),x.union(w)}x.union(this.lastModels.bounding),x.getCenter(this.boundingMesh.position),x.getSize(this.boundingMesh.scale),this.boundingMesh.boundingBox.copy(x),this.renderer&&this.model&&this.boundingMesh.update(this.renderer,this.camera,this.model)}var I=X("render.prepare",{needsRender:!0,info:null});if(this.emit("render.prepare",I),!I.defaultPrevented){var L=[];ji.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),_i.setFromProjectionMatrix(ji);for(var T=0,F=this.scene.children;T<F.length;T++){var D=F[T];D!==this.modelGroup&&D!==this.boundingMesh&&D.traverseVisible(function(K){if(K.setResolution&&K.setResolution(y.x,y.y),K.setTime&&K.setTime(e),K.mixer instanceof f.AnimationMixer){var j=iu.get(K.mixer);j||(j=new f.Clock,iu.set(K.mixer,j)),K.mixer.update(j.getDelta())}(K instanceof f.Mesh||K instanceof f.Line||K instanceof f.Points)&&(K instanceof f.ImmediateRenderObject||!K.frustumCulled||_i.intersectsObject(K))&&L.push(K)})}if(b.width*b.height>4096*2048?this.renderSwitch01=this.renderSwitch01^1:this.renderSwitch01=0,this.renderer&&this.paused===!1&&this.renderSwitch01===0){var V=void 0;if(this.onlyRenderIfNeeds!==!0)V=this.render();else{if(this.controller&&(this.controller.needsRender===!0&&(this.controller.needsRender=!1,this.needsRender=!0),this.controller.modelSceneNeedsRender===!0&&(this.controller.modelSceneNeedsRender=!1,this.modelSceneNeedsRender=!0)),this.camera.needsRender===!0&&(this.camera.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0),this.models.needsRender===!0&&(this.models.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0),this.needsRender!==!0)for(var z=0,U=L;z<U.length;z++){var q=U[z],G=function(K){K.needsRender===!0?(K.needsRender=!1,a.needsRender=!0):K.mixer&&K.mixer.stats.actions.inUse>0&&(a.needsRender=!0)};G(q),q.traverseAncestors(G)}(this.needsRender!==!1||this.modelSceneNeedsRender!==!1)&&(V=this.render())}this.needsRender=!1,this.modelSceneNeedsRender=!1,this.hasListener("render")&&this.emit("render",X("render",{needsRender:V!==void 0,info:this.info}))}this.needsRender=!1,this.modelSceneNeedsRender=!1}this.fps.testTime&&e-this.fps.testTime<1e3?this.fps.testCount++:(this.emit("fps",this.fps.testCount),this.fps.testTime=e,this.fps.testCount=0)}},t.prototype.pause=function(){this.paused=!0,this.renderer&&this.renderer instanceof xn&&this.renderer.clear(!0,!0,!0)},t.prototype.play=function(){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.paused=!1},t.prototype.moveToPano=function(e,r,i){r===void 0&&(r={}),i===void 0&&(i=!0);var a=this,o=a.controller,s=a.renderer;if(!o)return this.throwError(new Error("controller is not initialized.")),Promise.resolve();if(!s)return this.throwError(new Error("renderer is not initialized.")),Promise.resolve();var u=this.works.getResolvedObserver(e);if(!u)return this.throwError(new Error("pano ".concat(JSON.stringify(e)," not existed."))),Promise.resolve();var l={workCode:u.work.workCode,panoIndex:u.panoIndex};return"moveToPano"in o&&typeof o.moveToPano=="function"?o.moveToPano(l,r,i):u&&(this.pano=l,this.once("initAnimation.start",function(c){r.moveStartCallback&&r.moveStartCallback(c.state)}),this.once("initAnimation.end",function(c){r.moveEndCallback&&r.moveEndCallback(c.state)}),this.changeMode(t.Mode.Panorama,r,{effect:r.effect},i)),this.ready()},t.prototype.preloadPano=function(e,r){var i=this;r===void 0&&(r=Q);var a=this.works.getResolvedObserver(e);if(!a)return Promise.reject(new Error("Pano ".concat(JSON.stringify(e)," never found")));var o=["right","left","up","down","front","back"],s=ve();return Promise.all(o.map(function(u){var l=O({key:"pano.".concat(a.panoId,".").concat(u)},Jt(i.imageOptions,["size","format","quality","mappings"])),c=a.images[u],d=i.imageOptions.transform?i.imageOptions.transform(c,l):ft(c,l);return pt(a.work).preload(d)})).then(function(){var u=ve()-s;return r(u),u})},t.prototype.project2d=function(e,r){if(r===void 0&&(r=!1),!this.renderer)return null;if(this.models.length>0&&r){var i=this.camera.position,a=e.clone().sub(i),o=new f.Raycaster(i,a.clone().normalize());o.params.Points={threshold:.1};var s=this.models.intersectRaycaster(o)[0];if(s&&s.distance+.01<a.length())return null}var u=e.clone().project(this.camera);if(Math.abs(u.z)>1)return null;var l=this.renderer.getSize(new f.Vector2),c=l.x*this.scissor.width,d=l.y*this.scissor.height,p=l.x*this.scissor.left+(u.x+1)/2*c,A=l.y*(1-this.scissor.bottom-this.scissor.height)+(-u.y+1)/2*d;return new f.Vector2(p,A)},t.prototype.getRenderObjects=function(e){ji.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),_i.setFromProjectionMatrix(ji),e||(e=this.scene);var r=[];return e.traverseVisible(function(i){(i instanceof f.Mesh||i instanceof f.Line||i instanceof f.Points)&&(i instanceof f.ImmediateRenderObject||!i.frustumCulled||_i.intersectsObject(i))&&r.push(i)}),r},t.prototype.getCurrentState=function(){return O(O({},this.getPose()),{mode:this.currentMode,workCode:this.pano.workCode,panoIndex:this.pano.panoIndex})},t.prototype.setState=function(e,r,i){var a,o,s,u,l,c,d,p,A,h;r===void 0&&(r=!1),i===void 0&&(i=!0),e=Object.assign({},e),e.offset&&!(e instanceof f.Vector3)&&(e.offset=new f.Vector3(e.offset.x,e.offset.y,e.offset.z));var v;if(typeof e.panoIndex=="number")if(e.workCode)v={workCode:e.workCode,panoIndex:e.panoIndex};else{var g=(o=(a=this.work)===null||a===void 0?void 0:a.workCode)!==null&&o!==void 0?o:"",m=this.state.workCode;this.works.filter(function(I){return I.workCode===m}).length>0&&(g=m),v={workCode:g,panoIndex:e.panoIndex}}var y=(s=e.mode)!==null&&s!==void 0?s:this.state.mode,b,x,w,M,S;if(this.controller&&this.controller.stopMomentumMovement(),this.state.mode!==y){if(y==="VRPanorama"){this.changeMode("VRPanorama",void 0,void 0,!0);return}var E={workCode:v==null?void 0:v.workCode,panoIndex:v==null?void 0:v.panoIndex};typeof e.longitude=="number"&&(E.longitude=e.longitude),typeof e.latitude=="number"&&(E.latitude=e.latitude),typeof e.fov=="number"&&(E.fov=e.fov),typeof e.distance=="number"&&(E.distance=e.distance),e.offset instanceof f.Vector3&&(E.offset=e.offset);var B=O(O({initial:{state:E,currentState:this.getCurrentState(),duration:this.modeChangeDuration,effect:"fly",userAction:!1}},this.commonParams()),this.controllerInits[y]),R=ht[y].initAnimationEndState(B);b=R.longitude,x=R.latitude,w=R.fov,M=R.offset,S=R.distance}else b=(u=e.longitude)!==null&&u!==void 0?u:this.state.longitude,x=(l=e.latitude)!==null&&l!==void 0?l:this.state.latitude,w=(c=e.fov)!==null&&c!==void 0?c:this.state.fov,M=(d=e.offset)!==null&&d!==void 0?d:this.state.offset,S=(p=e.distance)!==null&&p!==void 0?p:this.state.distance;var C={workCode:(v!=null?v:this.pano).workCode,panoIndex:(v!=null?v:this.pano).panoIndex,mode:y,longitude:b,latitude:x,fov:w,offset:M,distance:S};this.emit("state.set",X("state.set",{userAction:i,state:C})),on(this.state,C)||(this.controller&&C.mode==="VRPanorama"&&C.mode!==this.state.mode?(Er(this.state,C),this.changeMode("VRPanorama")):this.controller&&C.mode==="XRPanorama"&&C.mode!==this.state.mode?(Er(this.state,C),this.changeMode("XRPanorama")):(Er(this.state,C),this.controller&&i&&(this.controller.userAction=!1),r&&this.state.mode===C.mode&&(this.syncingState=this.syncState(ve(),0,r),this.syncingState&&((A=this.controller)===null||A===void 0||A.updateTime(ve(),0),this.syncingState=!1)),this.emit("state.change",X("state.change",{userAction:i,state:this.state})),(h=this.analysis)===null||h===void 0||h.state(this.works,this.state)))},t.prototype.aroundScissor=function(e){if(this.renderer){if(this.state.mode==="XRPanorama"){e();return}var r=new f.Vector2,i=this.scissor.left!==0||this.scissor.bottom!==0||this.scissor.width!==1||this.scissor.height!==1;if(i){this.renderer.getSize(r);var a=Math.floor(r.x*this.scissor.left),o=Math.floor(r.y*this.scissor.bottom),s=Math.floor(r.x*this.scissor.width),u=Math.floor(r.y*this.scissor.height);this.renderer.setViewport(a,o,s,u),this.renderer.setScissor(a,o,s,u),this.renderer.setScissorTest(!0)}e(),i&&(this.renderer.setViewport(0,0,r.x,r.y),this.renderer.setScissor(0,0,r.x,r.y),this.renderer.setScissorTest(!1))}},t.prototype.syncState=function(e,r,i){i===void 0&&(i=!1);var a=this.stateSynced;if(this.stateSynced=!1,!this.controller)return!1;if(this.state.mode!==this.currentMode){var o={mode:this.state.mode,workCode:this.state.workCode,panoIndex:this.state.panoIndex,longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.changeMode(this.state.mode,o,this.modeChangeDuration,this.controller.userAction),!0}if(!this.controller.isReady())return!1;if(this.controller instanceof ht.Model){if(ea(this.camera.pose.offset,this.state.offset)){var s={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return this.controller.moveToPosition(this.state.offset,O(O({},s),{duration:i?0:void 0}),!1),!0}}else{var u={workCode:this.state.workCode,panoIndex:this.state.panoIndex};if(!Ar(u,this.pano)&&"moveToPano"in this.controller&&typeof this.controller.moveToPano=="function"){var s={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.controller.moveToPano(u,s,!1),!0}}if(this.controller instanceof ht.Floorplan||this.controller instanceof ht.Topview||this.controller instanceof ht.Mapview){var l=1,c=.2,d=.2,p=Math.PI/45,A=i?this.state.fov:no(this.camera.pose.fov,this.state.fov,l),h=Math.abs(this.camera.pose.distance-this.state.distance),v=h>d*15?h/15:c,g=i?this.state.distance:no(this.camera.pose.distance,this.state.distance,v),m=this.camera.pose.offset.distanceTo(this.state.offset),y=m>d*15?m/15:d,b=i?new f.Vector3().copy(this.state.offset):tm(this.camera.pose.offset,this.state.offset,y),x=i?{longitude:this.state.longitude,latitude:this.state.latitude}:F0({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},p),w=x.longitude,M=x.latitude;if(er(A,this.camera.pose.fov)||ea(b,this.camera.pose.offset)||er(g,this.camera.pose.distance)||er(w,this.camera.pose.longitude,Math.PI*2)||er(M,this.camera.pose.latitude)){var S={x:b.x,y:b.y,z:b.z},E={fov:A};return Object.assign(S,{distance:g}),Object.assign(E,{longitude:w,latitude:M}),this.controller.stopMomentumMovement(),this.controller.cameraMotion.set(E,0).catch(Q),this.controller.locationMotion.set(S,0).catch(Q),!0}}else{var B=1,R=Math.PI/45,A=i?this.state.fov:no(this.camera.pose.fov,this.state.fov,B),C=i?{longitude:this.state.longitude,latitude:this.state.latitude}:F0({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},R),w=C.longitude,M=C.latitude,g=this.state.distance,b=new f.Vector3().copy(this.state.offset);if(er(g,this.camera.pose.distance)&&(this.state.distance=this.camera.pose.distance),ea(b,this.camera.pose.offset)&&(this.state.offset=this.camera.pose.offset.clone()),er(w,this.camera.pose.longitude,Math.PI*2)||er(M,this.camera.pose.latitude)||er(A,this.camera.pose.fov))return this.controller.stopMomentumMovement(),this.controller.cameraMotion.set({longitude:w,latitude:M,fov:A},0).catch(Q),!0}if(this.stateSynced=!0,a===!1&&this.emit("state.synced",X("state.synced",{userAction:!1,state:this.state})),this.readyCallbacks.length&&this.stateSynced){var I=this.currentMode,L=I===t.Mode.Floorplan||I===t.Mode.Topview||I===t.Mode.Mapview||I===t.Mode.Model;if(!L||this.models.loaded){var T=this.readyCallbacks.slice();this.readyCallbacks.length=0;for(var F=0,D=T;F<D.length;F++){var V=D[F];this.controller instanceof ht.Panorama&&V.tile===!0&&!this.controller.isTileReady()?this.readyCallbacks.push(V):V()}}}return!1},t.prototype.ready=function(e){var r=this;return e===void 0&&(e={}),new Promise(function(i){var a;r.readyCallbacks.push(Object.assign(i,{tile:(a=e.tile)!==null&&a!==void 0?a:!1}))})},t.prototype.requestFullscreen=function(){var e;if(ai){var r=(e=this.getElement())===null||e===void 0?void 0:e.parentNode;r&&"requestFullscreen"in r&&typeof document!="undefined"&&document.fullscreenElement===null&&r.requestFullscreen()}},t.prototype.exitFullscreen=function(){typeof document!="undefined"&&document.fullscreenElement&&"exitFullscreen"in document&&document.exitFullscreen()},t.prototype.throwError=function(e){this.hasListener("error")?this.emit("error",e):console.error(e)},t.prototype.loadModel=function(e,r){for(var i=this,a=[],o=function(g){var m=s.models.filter(function(b){var x;return((x=b.work)===null||x===void 0?void 0:x.workCode)===g.workCode})[0];if(m)m.work=g,a.push(m);else{var y=new Oo({onError:function(b){i.emit("model.error",X("model.error",{work:g,model:y,error:b})),i.throwError(b)},onShownFloorChange:function(b){i.emit("model.changeShownFloor",X("model.changeShownFloor",{work:g,model:y,error:null}))},onLoad:function(){i.emit("model.load",X("model.load",{work:g,model:y,error:null}))}});a.push(y),s.emit("model.request",X("model.request",{work:g,model:y,error:null})),y.load(g,{textureOptions:s.textureOptions,"3d-tiles":r["3d-tiles"]})}},s=this,u=0,l=e;u<l.length;u++){var c=l[u];o(c)}if(this.models.length>0){for(var d=0,p=this.models;d<p.length;d++){var A=p[d];a.indexOf(A)===-1&&this.lastModels.push(A)}this.models.length=0}for(var h=0,v=a;h<v.length;h++){var A=v[h];this.models.push(A)}return this.renderer&&(this.models.loaded=!1),new Promise(function(g){i.on("models.load",function(){i.controller&&i.controller.updateModel(i.models),g()})})},t.prototype.commonParams=function(){return{ident:this.ident,scene:this.scene,xrCustomObjectsScene:this.xrCustomObjectsScene,helper:this.helperGroup,boundingMesh:this.boundingMesh,camera:this.camera,renderer:this.renderer,scissor:this.scissor,element:this.getElement(),models:this.models,works:this.works,imageOptions:this.imageOptions,enableWheel:this.enableWheel,enableIOSEDR:this._enableIOSEDR,enableEDL:this.enableEDL,enableHQ:this.enableHQ,extraElements:this.extraElements,videoTexture:this.videoTexture,modelScene:this.modelScene,modelRenderTarget:this.modelRenderTarget}},t.prototype.applyController=function(e,r){var i=this;if(!this.renderer)throw new Error("renderer is not initialized.");e!==t.Mode.Mapview&&(this.enableEDL=!1,this.enableHQ=!1);var a=ht[e];this.currentMode=e;for(var o=new a(r),s=function(A){o.on(A,function(){for(var h=[],v=0;v<arguments.length;v++)h[v]=arguments[v];var g=i.emit.apply(i,vt([A],h,!1));if(g)return!1})},u=0,l=ec;u<l.length;u++){var c=l[u];s(c)}{var d=ht[e].initAnimationEndState(r),p=r.initial.userAction;on(this.state,d)||(Er(this.state,d),this.emit("state.change",X("state.change",{userAction:p,state:this.state}))),this.emit("currentState.change",X("currentState.change",{userAction:p,state:this.getCurrentState()}))}return o.on("camera.update",function(A){var h;if(i.controller){var v=i.controller.getTargetState();A.userAction&&i.syncingState===!1&&i.state.mode===v.mode&&!on(i.state,v)&&(Er(i.state,v),i.emit("state.change",X("state.change",{userAction:A.userAction,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}i.emit("currentState.change",X("currentState.change",{userAction:A.userAction,state:i.getCurrentState()}))}),o.on("initAnimation.start",function(A){var h,v=A.state,g=A.userAction;g&&i.state.mode===v.mode&&!on(i.state,v)&&(Er(i.state,v),i.emit("state.change",X("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("initAnimation.end",function(A){var h,v=A.state,g=A.userAction;g&&i.state.mode===v.mode&&!on(i.state,v)&&(Er(i.state,v),i.emit("state.change",X("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.moveTo",function(A){var h,v=A.state,g=A.userAction;i.pano={workCode:v.workCode,panoIndex:v.panoIndex},g&&i.state.mode===v.mode&&!on(i.state,v)&&(Er(i.state,v),i.emit("state.change",X("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.arrived",function(A){var h,v=A.state,g=A.userAction;g&&i.state.mode===v.mode&&!on(i.state,v)&&(Er(i.state,v),i.emit("state.change",X("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.cancel",function(A){var h,v=A.state,g=A.userAction;g&&i.state.mode===v.mode&&!on(i.state,v)&&(Er(i.state,v),i.emit("state.change",X("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.moveTo",function(A){var h=A.userAction;i.emit("currentState.change",X("currentState.change",{userAction:h,state:i.getCurrentState()}))}),o.on("pano.request",function(A){i.emit("pano.request",A),A.defaultPrevented||i.moveToPano(A.state,A.options,A.userAction)}),o.on("vr.requestExit",function(){i.currentMode===t.Mode.VRPanorama&&(i.exitFullscreen(),i.changeMode(t.Mode.Panorama))}),o.on("error",function(A){return i.throwError(A)}),o},t.prototype.removeEventListeners=function(){},t.prototype.getWorkResources=function(e){var r=this,i,a=this.models.find(function(l){return l.work===e}),o=((i=a==null?void 0:a.viewLayers)!==null&&i!==void 0?i:[]).map(function(l){return l.scene});function s(l){var c=/([0-9a-z\.\_\-]+)([\?\#].*)?$/i.exec(l);if(c){var d=String(c[1]).trim().split(".").slice(1).reverse()[0];if(d)return d}return""}function u(l,c){c===void 0&&(c=0);var d=[];if(l.content&&l.content.uri){var p=s(l.content.uri);if(p==="json"){var A=ft(l.content.uri,{key:"model.".concat(c)});d.push({url:A,type:"tileset"})}else if(p==="at3d"&&l.extras[p]){var A=l.content.uri;d.push({url:A,type:"model"});for(var h=l.extras[p],v=h.textureArray,g=h.textureOptions,m=0,y=v;m<y.length;m++){var b=y[m],x=O({key:"texture.pbm"},Jt(g,["format","quality","size","sharpen","mappings"])),w=Cn(b,g==null?void 0:g.transform,x);d.push({url:w,type:"texture"})}}else{var A=ft(l.content.uri,{key:"model.".concat(c)});d.push({url:A,type:"model"})}}if(l.children)for(var M=0;M<l.children.length;M++){var S=l.children[M];d.push.apply(d,u(S,M))}return d}return Promise.all(o.map(function(l){return l.loadAllTilesets()})).then(function(){for(var l=[],c=["right","left","up","down","front","back"],d=0,p=e.observers;d<p.length;d++){for(var A=p[d],h=0,v=c;h<v.length;h++){var g=v[h],m=O({key:"pano.".concat(He(A.pano),".").concat(g)},Jt(r.imageOptions,["size","format","quality","mappings"])),y=A.images[g],b=Cn(y,r.imageOptions.transform,m);l.push({url:b,type:"pano"})}if(A.images.tiles)for(var x=0,w=A.images.tiles;x<w.length;x++)for(var M=w[x],S=0,E=c;S<E.length;S++)for(var g=E[S],B=M.size,R=Math.pow(2,M.level),C=1/R,I=0;I<R;I++)for(var L=0;L<R;L++){var T="".concat(A.panoId,".").concat(g,".").concat(M.level,".").concat(I,".").concat(L),m=O(O({key:"pano_tile.".concat(T)},Jt(r.imageOptions,["format","size","quality","sharpen","mappings"])),{size:M.scale>=1?void 0:B*C*M.scale,cut:[B*C*L,B*C*I,B*C,B*C]}),b=Cn(M[g],r.imageOptions.transform,m);l.push({url:b,type:"pano_tile"})}}for(var F=0,D=o;F<D.length;F++){var V=D[F];V.tileset.url&&l.push({url:V.tileset.url,type:"model"}),l.push.apply(l,u(V.tileset.root))}return l})},Object.defineProperty(t.prototype,"internalLightsEnabled",{get:function(){var e=this.scene.children.find(function(r){return r.name==="internalLights"});return e?e.visible:!1},set:function(e){var r=this.scene.children.find(function(i){return i.name==="internalLights"});r&&(r.visible=e)},enumerable:!1,configurable:!0}),t.Mode={Panorama:"Panorama",Model:"Model",Floorplan:"Floorplan",Topview:"Topview",Mapview:"Mapview",VRPanorama:"VRPanorama",XRPanorama:"XRPanorama"},t.Line=null,t}(va),Qo={instances:{},constructor:nc};typeof window!="undefined"&&Object.assign(window,{__FIVE_DEBUG__:Qo});var cg=function(){function n(){}return n.createButton=function(t){var e=document.createElement("button");function r(){e.style.display="",e.style.cursor="pointer",e.style.left="calc(50% - 50px)",e.style.width="100px",e.textContent="ENTER VR",e.onmouseenter=function(){e.style.opacity="1.0"},e.onmouseleave=function(){e.style.opacity="0.5"},e.onclick=function(){t&&t()}}function i(){e.style.display="",e.style.cursor="auto",e.style.left="calc(50% - 75px)",e.style.width="150px",e.onmouseenter=null,e.onmouseleave=null,e.onclick=null}function a(){i(),e.textContent="VR NOT SUPPORTED"}function o(u){u.style.position="absolute",u.style.bottom="20px",u.style.padding="12px 6px",u.style.border="1px solid #fff",u.style.borderRadius="4px",u.style.background="rgba(0,0,0,0.1)",u.style.color="#fff",u.style.font="normal 13px sans-serif",u.style.textAlign="center",u.style.opacity="0.5",u.style.outline="none",u.style.zIndex="999"}if("xr"in navigator)return e.id="VRButton",e.style.display="none",o(e),navigator.xr.isSessionSupported("immersive-vr").then(function(u){u?r():a()}),e;var s=document.createElement("a");return window.isSecureContext===!1?(s.href=document.location.href.replace(/^http:/,"https:"),s.innerHTML="WEBXR NEEDS HTTPS"):(s.href="https://immersiveweb.dev/",s.innerHTML="WEBXR NOT AVAILABLE"),s.style.left="calc(50% - 90px)",s.style.width="180px",s.style.textDecoration="none",o(s),s},n}();exports.AnimationFrameLoop=Mt;exports.Camera=Su;exports.CustomShader=qf;exports.Fetcher=qt;exports.Five=nc;exports.InternalWebGLRenderer=xn;exports.IntersectMesh=ya;exports.Model=Oo;exports.ModelViewLayer=$i;exports.NetworkSubscribe=du;exports.PBMContainer=Zf;exports.PBMGroup=Uf;exports.PBMMesh=Ot;exports.PBMMeshMaterial=br;exports.PBMPointCloud=yr;exports.PBMPointCloudMaterial=Pi;exports.PROXY_CONTROLLER_EVENT_NAMES=ec;exports.PanoCircleMesh=kl;exports.PanoCircleMeshCustom=jv;exports.PanoCircleMeshSolid=Hv;exports.Scene=Xo;exports.Subscribe=va;exports.TextureLoader=Xn;exports.Tile=Yo;exports.Tile3DModel=wn;exports.TileCache=Pu;exports.TileCubeTextureTarget=qe;exports.TileNode=qu;exports.TileRequestScheduler=Tu;exports.Tileset=zr;exports.Trajectory=Ru;exports.TrajectoryNode=Tl;exports.Work=as;exports.XRButton=cg;exports.controllersDefaultInitArgs=XA;exports.defaultImageURLTransform=ft;exports.defaultPbmParameters=ge;exports.getViewportScale=tc;exports.imageSupport=vu;exports.isPanoId=Au;exports.loadAt3d=sl;exports.loadB3dm=Ju;exports.loadDome=ul;exports.loadDomez=cl;exports.loadFbx=Ml;exports.loadGltf=fl;exports.loadPbm=il;exports.loadPly=ns;exports.loadPnts=Wu;exports.loadX3p=Il;exports.panoEqual=Ar;exports.panoParse=Lt;exports.panoStringify=He;exports.parseWork=hi;
|