@realsee/five 6.3.0-alpha.19 → 6.3.0-alpha.20

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/five/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 12/6/2024
5
- * Version: 6.3.0-alpha.19
4
+ * Generated: 12/10/2024
5
+ * Version: 6.3.0-alpha.20
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={},Ee=Ee||function(n,t){var e={},r=e.lib={},i=r.Base=function(){function v(){}return{extend:function(A){v.prototype=this;var h=new v;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(v,A){v=this.words=v||[],A!=t?this.sigBytes=A:this.sigBytes=v.length*4},toString:function(v){return(v||s).stringify(this)},concat:function(v){var A=this.words,h=v.words,p=this.sigBytes,g=v.sigBytes;if(this.clamp(),p%4)for(var m=0;m<g;m++){var y=h[m>>>2]>>>24-m%4*8&255;A[p+m>>>2]|=y<<24-(p+m)%4*8}else for(var m=0;m<g;m+=4)A[p+m>>>2]=h[m>>>2];return this.sigBytes+=g,this},clamp:function(){var v=this.words,A=this.sigBytes;v[A>>>2]&=4294967295<<32-A%4*8,v.length=n.ceil(A/4)},clone:function(){var v=i.clone.call(this);return v.words=this.words.slice(0),v},random:function(v){for(var A=[],h=0;h<v;h+=4)A.push(n.random()*4294967296|0);return new a.init(A,v)}}),o=e.enc={},s=o.Hex={stringify:function(v){for(var A=v.words,h=v.sigBytes,p=[],g=0;g<h;g++){var m=A[g>>>2]>>>24-g%4*8&255;p.push((m>>>4).toString(16)),p.push((m&15).toString(16))}return p.join("")},parse:function(v){for(var A=v.length,h=[],p=0;p<A;p+=2)h[p>>>3]|=parseInt(v.substr(p,2),16)<<24-p%8*4;return new a.init(h,A/2)}},u=o.Latin1={stringify:function(v){for(var A=v.words,h=v.sigBytes,p=[],g=0;g<h;g++){var m=A[g>>>2]>>>24-g%4*8&255;p.push(String.fromCharCode(m))}return p.join("")},parse:function(v){for(var A=v.length,h=[],p=0;p<A;p++)h[p>>>2]|=(v.charCodeAt(p)&255)<<24-p%4*8;return new a.init(h,A)}},l=o.Utf8={stringify:function(v){try{return decodeURIComponent(escape(u.stringify(v)))}catch(A){throw new Error("Malformed UTF-8 data")}},parse:function(v){return u.parse(unescape(encodeURIComponent(v)))}},c=r.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(v){typeof v=="string"&&(v=l.parse(v)),this._data.concat(v),this._nDataBytes+=v.sigBytes},_process:function(v){var A=this._data,h=A.words,p=A.sigBytes,g=this.blockSize,m=g*4,y=p/m;v?y=n.ceil(y):y=n.max((y|0)-this._minBufferSize,0);var b=y*g,x=n.min(b*4,p);if(b){for(var w=0;w<b;w+=g)this._doProcessBlock(h,w);var E=h.splice(0,b);A.sigBytes-=x}return new a.init(E,x)},clone:function(){var v=i.clone.call(this);return v._data=this._data.clone(),v},_minBufferSize:0});r.Hasher=c.extend({cfg:i.extend(),init:function(v){this.cfg=this.cfg.extend(v),this.reset()},reset:function(){c.reset.call(this),this._doReset()},update:function(v){return this._append(v),this._process(),this},finalize:function(v){v&&this._append(v);var A=this._doFinalize();return A},blockSize:512/32,_createHelper:function(v){return function(A,h){return new v.init(h).finalize(A)}},_createHmacHelper:function(v){return function(A,h){return new d.HMAC.init(v,h).finalize(A)}}});var d=e.algo={};return e}(Math);(function(n){for(var t=Ee,A=t.lib,e=A.WordArray,r=A.Hasher,A=t.algo,i=[],a=[],o=function(p){return 4294967296*(p-(p|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 v=[],A=A.SHA256=r.extend({_doReset:function(){this._hash=new e.init(i.slice(0))},_doProcessBlock:function(h,p){for(var g=this._hash.words,m=g[0],y=g[1],b=g[2],x=g[3],w=g[4],E=g[5],S=g[6],C=g[7],R=0;64>R;R++){if(16>R)v[R]=h[p+R]|0;else{var k=v[R-15],M=v[R-2];v[R]=((k<<25|k>>>7)^(k<<14|k>>>18)^k>>>3)+v[R-7]+((M<<15|M>>>17)^(M<<13|M>>>19)^M>>>10)+v[R-16]}k=C+((w<<26|w>>>6)^(w<<21|w>>>11)^(w<<7|w>>>25))+(w&E^~w&S)+a[R]+v[R],M=((m<<30|m>>>2)^(m<<19|m>>>13)^(m<<10|m>>>22))+(m&y^m&b^y&b),C=S,S=E,E=w,w=x+k|0,x=b,b=y,y=m,m=k+M|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]+E|0,g[6]=g[6]+S|0,g[7]=g[7]+C|0},_doFinalize:function(){var h=this._data,p=h.words,g=8*this._nDataBytes,m=8*h.sigBytes;return p[m>>>5]|=128<<24-m%32,p[(m+64>>>9<<4)+14]=n.floor(g/4294967296),p[(m+64>>>9<<4)+15]=g,h.sigBytes=4*p.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);Ee.lib.Cipher||function(n){var A=Ee,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(p,g){return this.create(this._ENC_XFORM_MODE,p,g)},createDecryptor:function(p,g){return this.create(this._DEC_XFORM_MODE,p,g)},init:function(p,g,m){this.cfg=this.cfg.extend(m),this._xformMode=p,this._key=g,this.reset()},reset:function(){i.reset.call(this),this._doReset()},process:function(p){return this._append(p),this._process()},finalize:function(p){return p&&this._append(p),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(p){return{encrypt:function(g,m,y){return(typeof m=="string"?h:v).encrypt(p,g,m,y)},decrypt:function(g,m,y){return(typeof m=="string"?h:v).decrypt(p,g,m,y)}}}});t.StreamCipher=s.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var d=A.mode={},u=function(p,g,m){var y=this._iv;y?this._iv=n:y=this._prevBlock;for(var b=0;b<m;b++)p[g+b]^=y[b]},l=(t.BlockCipherMode=e.extend({createEncryptor:function(p,g){return this.Encryptor.create(p,g)},createDecryptor:function(p,g){return this.Decryptor.create(p,g)},init:function(p,g){this._cipher=p,this._iv=g}})).extend();l.Encryptor=l.extend({processBlock:function(p,g){var m=this._cipher,y=m.blockSize;u.call(this,p,g,y),m.encryptBlock(p,g),this._prevBlock=p.slice(g,g+y)}}),l.Decryptor=l.extend({processBlock:function(p,g){var m=this._cipher,y=m.blockSize,b=p.slice(g,g+y);m.decryptBlock(p,g),u.call(this,p,g,y),this._prevBlock=b}}),d=d.CBC=l,l=(A.pad={}).Pkcs7={pad:function(p,g){for(var m=4*g,m=m-p.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),p.concat(m)},unpad:function(p){p.sigBytes-=p.words[p.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,p=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,p&&p.words)},_doProcessBlock:function(p,g){this._mode.processBlock(p,g)},_doFinalize:function(){var p=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){p.pad(this._data,this.blockSize);var g=this._process(!0)}else g=this._process(!0),p.unpad(g);return g},blockSize:4});var c=t.CipherParams=e.extend({init:function(p){this.mixIn(p)},toString:function(p){return(p||this.formatter).stringify(this)}}),d=(A.format={}).OpenSSL={stringify:function(p){var g=p.ciphertext;return p=p.salt,(p?r.create([1398893684,1701076831]).concat(p).concat(g):g).toString(a)},parse:function(p){p=a.parse(p);var g=p.words;if(g[0]==1398893684&&g[1]==1701076831){var m=r.create(g.slice(2,4));g.splice(0,4),p.sigBytes-=16}return c.create({ciphertext:p,salt:m})}},v=t.SerializableCipher=e.extend({cfg:e.extend({format:d}),encrypt:function(p,g,m,y){y=this.cfg.extend(y);var b=p.createEncryptor(m,y);return g=b.finalize(g),b=b.cfg,c.create({ciphertext:g,key:m,iv:b.iv,algorithm:p,mode:b.mode,padding:b.padding,blockSize:p.blockSize,formatter:y.format})},decrypt:function(p,g,m,y){return y=this.cfg.extend(y),g=this._parse(g,y.format),p.createDecryptor(m,y).finalize(g.ciphertext)},_parse:function(p,g){return typeof p=="string"?g.parse(p,this):p}}),A=(A.kdf={}).OpenSSL={execute:function(p,g,m,y){return y||(y=r.random(8)),p=o.create({keySize:g+m}).compute(p,y),m=r.create(p.words.slice(g),4*m),p.sigBytes=4*g,c.create({key:p,iv:m,salt:y})}},h=t.PasswordBasedCipher=v.extend({cfg:v.cfg.extend({kdf:A}),encrypt:function(p,g,m,y){return y=this.cfg.extend(y),m=y.kdf.execute(m,p.keySize,p.ivSize),y.iv=m.iv,p=v.encrypt.call(this,p,g,m.key,y),p.mixIn(m),p},decrypt:function(p,g,m,y){return y=this.cfg.extend(y),g=this._parse(g,y.format),m=y.kdf.execute(m,p.keySize,p.ivSize,g.salt),y.iv=m.iv,v.decrypt.call(this,p,g,m.key,y)}})}();(function(){for(var n=Ee,t=n.lib.BlockCipher,E=n.algo,e=[],r=[],i=[],a=[],o=[],s=[],u=[],l=[],c=[],d=[],v=[],A=0;256>A;A++)v[A]=128>A?A<<1:A<<1^283;for(var h=0,p=0,A=0;256>A;A++){var g=p^p<<1^p<<2^p<<3^p<<4,g=g>>>8^g&255^99;e[h]=g,r[g]=h;var m=v[h],y=v[m],b=v[y],x=257*v[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^v[v[v[b^m]]],p^=v[v[p]]):h=p=1}var w=[0,1,2,4,8,16,32,64,128,27,54],E=E.AES=t.extend({_doReset:function(){for(var R=this._key,S=R.words,C=R.sigBytes/4,R=4*((this._nRounds=C+6)+1),k=this._keySchedule=[],M=0;M<R;M++)if(M<C)k[M]=S[M];else{var I=k[M-1];M%C?6<C&&M%C==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[M/C|0]<<24),k[M]=k[M-C]^I}for(S=this._invKeySchedule=[],C=0;C<R;C++)M=R-C,I=C%4?k[M]:k[M-4],S[C]=4>C||4>=M?I:u[e[I>>>24]]^l[e[I>>>16&255]]^c[e[I>>>8&255]]^d[e[I&255]]},encryptBlock:function(S,C){this._doCryptBlock(S,C,this._keySchedule,i,a,o,s,e)},decryptBlock:function(S,C){var R=S[C+1];S[C+1]=S[C+3],S[C+3]=R,this._doCryptBlock(S,C,this._invKeySchedule,u,l,c,d,r),R=S[C+1],S[C+1]=S[C+3],S[C+3]=R},_doCryptBlock:function(S,C,R,k,M,I,L,T){for(var B=this._nRounds,j=S[C]^R[0],_=S[C+1]^R[1],X=S[C+2]^R[2],G=S[C+3]^R[3],D=4,V=1;V<B;V++)var N=k[j>>>24]^M[_>>>16&255]^I[X>>>8&255]^L[G&255]^R[D++],U=k[_>>>24]^M[X>>>16&255]^I[G>>>8&255]^L[j&255]^R[D++],H=k[X>>>24]^M[G>>>16&255]^I[j>>>8&255]^L[_&255]^R[D++],G=k[G>>>24]^M[j>>>16&255]^I[_>>>8&255]^L[X&255]^R[D++],j=N,_=U,X=H;N=(T[j>>>24]<<24|T[_>>>16&255]<<16|T[X>>>8&255]<<8|T[G&255])^R[D++],U=(T[_>>>24]<<24|T[X>>>16&255]<<16|T[G>>>8&255]<<8|T[j&255])^R[D++],H=(T[X>>>24]<<24|T[G>>>16&255]<<16|T[j>>>8&255]<<8|T[_&255])^R[D++],G=(T[G>>>24]<<24|T[j>>>16&255]<<16|T[_>>>8&255]<<8|T[X&255])^R[D++],S[C]=N,S[C+1]=U,S[C+2]=H,S[C+3]=G},keySize:8});n.AES=t._createHelper(E)})();/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
343
- */var Wr;function fe(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 qt(){return new fe(null)}function _l(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 Jl(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 Xl(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"?(fe.prototype.am=Jl,Wr=30):typeof navigator!="undefined"&&navigator.appName!="Netscape"?(fe.prototype.am=_l,Wr=26):(fe.prototype.am=Xl,Wr=28);fe.prototype.DB=Wr;fe.prototype.DM=(1<<Wr)-1;fe.prototype.DV=1<<Wr;var Co=52;fe.prototype.FV=Math.pow(2,Co);fe.prototype.F1=Co-Wr;fe.prototype.F2=2*Wr-Co;var Wl="0123456789abcdefghijklmnopqrstuvwxyz",Yi=new Array,Dn,Nt;Dn=48;for(Nt=0;Nt<=9;++Nt)Yi[Dn++]=Nt;Dn=97;for(Nt=10;Nt<36;++Nt)Yi[Dn++]=Nt;Dn=65;for(Nt=10;Nt<36;++Nt)Yi[Dn++]=Nt;function Tr(n){return Wl.charAt(n)}function Zl(n,t){var e=Yi[n.charCodeAt(t)];return e==null?-1:e}function Yl(n){for(var t=this.t-1;t>=0;--t)n[t]=this[t];n.t=this.t,n.s=this.s}function $l(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 Io(n){var t=qt();return t.fromInt(n),t}function ec(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:Zl(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&&fe.ZERO.subTo(this,this)}function tc(){for(var n=this.s&this.DM;this.t>0&&this[this.t-1]==n;)--this.t}function rc(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=Tr(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+=Tr(r));return i?a:"0"}function nc(){var n=qt();return fe.ZERO.subTo(this,n),n}function ic(){return this.s<0?this.negate():this}function ac(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 To(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 oc(){return this.t<=0?0:this.DB*(this.t-1)+To(this[this.t-1]^this.s&this.DM)}function sc(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 uc(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 lc(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 fc(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 dc(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&&fe.ZERO.subTo(t,t)}function hc(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=qt());var a=qt(),o=this.s,s=n.s,u=this.DB-To(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),v=this.FV/d,A=(1<<this.F1)/d,h=1<<this.F2,p=e.t,g=p-l,m=t==null?qt():t;for(a.dlShiftTo(g,m),e.compareTo(m)>=0&&(e[e.t++]=1,e.subTo(m,e)),fe.ONE.dlShiftTo(l,m),m.subTo(a,a);a.t<l;)a[a.t++]=0;for(;--g>=0;){var y=e[--p]==c?this.DM:Math.floor(e[p]*v+(e[p-1]+h)*A);if((e[p]+=a.am(0,y,e,g,0,l))<y)for(a.dlShiftTo(g,m),e.subTo(m,e);e[p]<--y;)e.subTo(m,e)}t!=null&&(e.drShiftTo(l,t),o!=s&&fe.ZERO.subTo(t,t)),e.t=l,e.clamp(),u>0&&e.rShiftTo(u,e),o<0&&fe.ZERO.subTo(e,e)}}}function vc(n){var t=qt();return this.abs().divRemTo(n,null,t),this.s<0&&t.compareTo(fe.ZERO)>0&&n.subTo(t,t),t}function Vn(n){this.m=n}function mc(n){return n.s<0||n.compareTo(this.m)>=0?n.mod(this.m):n}function Ac(n){return n}function gc(n){n.divRemTo(this.m,null,n)}function yc(n,t,e){n.multiplyTo(t,e),this.reduce(e)}function bc(n,t){n.squareTo(t),this.reduce(t)}Vn.prototype.convert=mc;Vn.prototype.revert=Ac;Vn.prototype.reduce=gc;Vn.prototype.mulTo=yc;Vn.prototype.sqrTo=bc;function xc(){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 zn(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 wc(n){var t=qt();return n.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),n.s<0&&t.compareTo(fe.ZERO)>0&&this.m.subTo(t,t),t}function Ec(n){var t=qt();return n.copyTo(t),this.reduce(t),t}function Sc(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 Mc(n,t){n.squareTo(t),this.reduce(t)}function Cc(n,t,e){n.multiplyTo(t,e),this.reduce(e)}zn.prototype.convert=wc;zn.prototype.revert=Ec;zn.prototype.reduce=Sc;zn.prototype.mulTo=Cc;zn.prototype.sqrTo=Mc;function Ic(){return(this.t>0?this[0]&1:this.s)==0}function Tc(n,t){if(n>4294967295||n<1)return fe.ONE;var e=qt(),r=qt(),i=t.convert(this),a=To(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 Pc(n,t){var e;return n<256||t.isEven()?e=new Vn(t):e=new zn(t),this.exp(n,e)}fe.prototype.copyTo=Yl;fe.prototype.fromInt=$l;fe.prototype.fromString=ec;fe.prototype.clamp=tc;fe.prototype.dlShiftTo=sc;fe.prototype.drShiftTo=uc;fe.prototype.lShiftTo=lc;fe.prototype.rShiftTo=cc;fe.prototype.subTo=fc;fe.prototype.multiplyTo=dc;fe.prototype.squareTo=hc;fe.prototype.divRemTo=pc;fe.prototype.invDigit=xc;fe.prototype.isEven=Ic;fe.prototype.exp=Tc;fe.prototype.toString=rc;fe.prototype.negate=nc;fe.prototype.abs=ic;fe.prototype.compareTo=ac;fe.prototype.bitLength=oc;fe.prototype.mod=vc;fe.prototype.modPowInt=Pc;fe.ZERO=Io(0);fe.ONE=Io(1);/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function Rc(){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 Bc(n){return Math.floor(Math.LN2*this.DB/Math.log(n))}function Fc(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function Lc(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=Io(e),i=qt(),a=qt(),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}fe.prototype.chunkSize=Bc;fe.prototype.toRadix=Lc;fe.prototype.intValue=Rc;fe.prototype.signum=Fc;/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */var Tn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",K0="=";function kc(n){var t,e,r="";for(t=0;t+3<=n.length;t+=3)e=parseInt(n.substring(t,t+3),16),r+=Tn.charAt(e>>6)+Tn.charAt(e&63);for(t+1==n.length?(e=parseInt(n.substring(t,t+1),16),r+=Tn.charAt(e<<2)):t+2==n.length&&(e=parseInt(n.substring(t,t+2),16),r+=Tn.charAt(e>>2)+Tn.charAt((e&3)<<4));(r.length&3)>0;)r+=K0;return r}function Po(n){var t="",e,r=0,i,a;for(e=0;e<n.length&&n.charAt(e)!=K0;++e)a=Tn.indexOf(n.charAt(e)),!(a<0)&&(r==0?(t+=Tr(a>>2),i=a&3,r=1):r==1?(t+=Tr(i<<2|a>>4),i=a&15,r=2):r==2?(t+=Tr(i),t+=Tr(a>>2),i=a&3,r=3):(t+=Tr(i<<2|a>>4),t+=Tr(a&15),r=0));return r==1&&(t+=Tr(i<<2)),t}/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function St(n,t){return new fe(n,t)}function Oc(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 fe(e)}function ss(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 Dc(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(p){return Rr(a.hashHex($i(p),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=ss(c,l.length,e),v=[];for(u=0;u<l.length;u+=1)v[u]=l.charCodeAt(u)^d.charCodeAt(u);var A=ss(v,c.length,e),h=[0];for(u=0;u<c.length;u+=1)h[u+1]=c[u]^A.charCodeAt(u);return new fe(h.concat(v))}function Re(){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 Vc(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=St(n,16),this.e=parseInt(t,16);else throw"Invalid RSA public key"}function zc(n){return n.modPowInt(this.e,this.n)}function Nc(n){var t=Oc(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 Qc(n,t,e){var r=Dc(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}Re.prototype.doPublic=zc;Re.prototype.setPublic=Vc;Re.prototype.encrypt=Nc;Re.prototype.encryptOAEP=Qc;Re.prototype.type="RSA";/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function Uc(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 us(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 Hc(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 Rr(a.hashHex($i(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=us(u,r,e),c=[],d;for(d=0;d<s.length;d+=1)c[d]=s.charCodeAt(d)^l.charCodeAt(d);var v=us(String.fromCharCode.apply(String,c),n.length-r,e),A=[];for(d=0;d<u.length;d+=1)A[d]=u.charCodeAt(d)^v.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(""),p=h!=-1?A.substr(0,h).lastIndexOf("\0"):-1;if(p+1!=h)throw"Malformed data";return A.substr(h+1)}function qc(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=St(n,16),this.e=parseInt(t,16),this.d=St(e,16);else throw"Invalid RSA private key"}function Gc(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=St(n,16),this.e=parseInt(t,16),this.d=St(e,16),this.p=St(r,16),this.q=St(i,16),this.dmp1=St(a,16),this.dmq1=St(o,16),this.coeff=St(s,16);else throw"Invalid RSA private key in RSASetPrivateEx"}function Kc(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 jc(n){if(n.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var t=St(n,16),e=this.doPrivate(t);return e==null?null:Uc(e,this.n.bitLength()+7>>3)}function _c(n,t,e){if(n.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var r=St(n,16),i=this.doPrivate(r);return i==null?null:Hc(i,this.n.bitLength()+7>>3,t,e)}Re.prototype.doPrivate=Kc;Re.prototype.setPrivate=qc;Re.prototype.setPrivateEx=Gc;Re.prototype.decrypt=jc;Re.prototype.decryptOAEP=_c;(typeof ae.lang=="undefined"||!ae.lang)&&(ae.lang={});ae.lang.String=function(){};function Jc(n){return n.length%4==2?n=n+"==":n.length%4==3&&(n=n+"="),n=n.replace(/-/g,"+"),n=n.replace(/_/g,"/"),n}function tt(n){return Po(Jc(n))}function pr(n){return decodeURIComponent($c(n))}function Rr(n){for(var t="",e=0;e<n.length-1;e+=2)t+=String.fromCharCode(parseInt(n.substr(e,2),16));return t}function $i(n){for(var t="",e=0;e<n.length;e++)t+=("0"+n.charCodeAt(e).toString(16)).slice(-2);return t}function Xc(n){return kc(n)}function Wc(n){var t=Xc(n),e=t.replace(/(.{64})/g,`$1\r
342
+ */var ae={},Ee=Ee||function(n,t){var e={},r=e.lib={},i=r.Base=function(){function v(){}return{extend:function(A){v.prototype=this;var h=new v;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(v,A){v=this.words=v||[],A!=t?this.sigBytes=A:this.sigBytes=v.length*4},toString:function(v){return(v||s).stringify(this)},concat:function(v){var A=this.words,h=v.words,p=this.sigBytes,g=v.sigBytes;if(this.clamp(),p%4)for(var m=0;m<g;m++){var y=h[m>>>2]>>>24-m%4*8&255;A[p+m>>>2]|=y<<24-(p+m)%4*8}else for(var m=0;m<g;m+=4)A[p+m>>>2]=h[m>>>2];return this.sigBytes+=g,this},clamp:function(){var v=this.words,A=this.sigBytes;v[A>>>2]&=4294967295<<32-A%4*8,v.length=n.ceil(A/4)},clone:function(){var v=i.clone.call(this);return v.words=this.words.slice(0),v},random:function(v){for(var A=[],h=0;h<v;h+=4)A.push(n.random()*4294967296|0);return new a.init(A,v)}}),o=e.enc={},s=o.Hex={stringify:function(v){for(var A=v.words,h=v.sigBytes,p=[],g=0;g<h;g++){var m=A[g>>>2]>>>24-g%4*8&255;p.push((m>>>4).toString(16)),p.push((m&15).toString(16))}return p.join("")},parse:function(v){for(var A=v.length,h=[],p=0;p<A;p+=2)h[p>>>3]|=parseInt(v.substr(p,2),16)<<24-p%8*4;return new a.init(h,A/2)}},u=o.Latin1={stringify:function(v){for(var A=v.words,h=v.sigBytes,p=[],g=0;g<h;g++){var m=A[g>>>2]>>>24-g%4*8&255;p.push(String.fromCharCode(m))}return p.join("")},parse:function(v){for(var A=v.length,h=[],p=0;p<A;p++)h[p>>>2]|=(v.charCodeAt(p)&255)<<24-p%4*8;return new a.init(h,A)}},l=o.Utf8={stringify:function(v){try{return decodeURIComponent(escape(u.stringify(v)))}catch(A){throw new Error("Malformed UTF-8 data")}},parse:function(v){return u.parse(unescape(encodeURIComponent(v)))}},c=r.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(v){typeof v=="string"&&(v=l.parse(v)),this._data.concat(v),this._nDataBytes+=v.sigBytes},_process:function(v){var A=this._data,h=A.words,p=A.sigBytes,g=this.blockSize,m=g*4,y=p/m;v?y=n.ceil(y):y=n.max((y|0)-this._minBufferSize,0);var b=y*g,x=n.min(b*4,p);if(b){for(var w=0;w<b;w+=g)this._doProcessBlock(h,w);var E=h.splice(0,b);A.sigBytes-=x}return new a.init(E,x)},clone:function(){var v=i.clone.call(this);return v._data=this._data.clone(),v},_minBufferSize:0});r.Hasher=c.extend({cfg:i.extend(),init:function(v){this.cfg=this.cfg.extend(v),this.reset()},reset:function(){c.reset.call(this),this._doReset()},update:function(v){return this._append(v),this._process(),this},finalize:function(v){v&&this._append(v);var A=this._doFinalize();return A},blockSize:512/32,_createHelper:function(v){return function(A,h){return new v.init(h).finalize(A)}},_createHmacHelper:function(v){return function(A,h){return new d.HMAC.init(v,h).finalize(A)}}});var d=e.algo={};return e}(Math);(function(n){for(var t=Ee,A=t.lib,e=A.WordArray,r=A.Hasher,A=t.algo,i=[],a=[],o=function(p){return 4294967296*(p-(p|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 v=[],A=A.SHA256=r.extend({_doReset:function(){this._hash=new e.init(i.slice(0))},_doProcessBlock:function(h,p){for(var g=this._hash.words,m=g[0],y=g[1],b=g[2],x=g[3],w=g[4],E=g[5],S=g[6],C=g[7],R=0;64>R;R++){if(16>R)v[R]=h[p+R]|0;else{var k=v[R-15],M=v[R-2];v[R]=((k<<25|k>>>7)^(k<<14|k>>>18)^k>>>3)+v[R-7]+((M<<15|M>>>17)^(M<<13|M>>>19)^M>>>10)+v[R-16]}k=C+((w<<26|w>>>6)^(w<<21|w>>>11)^(w<<7|w>>>25))+(w&E^~w&S)+a[R]+v[R],M=((m<<30|m>>>2)^(m<<19|m>>>13)^(m<<10|m>>>22))+(m&y^m&b^y&b),C=S,S=E,E=w,w=x+k|0,x=b,b=y,y=m,m=k+M|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]+E|0,g[6]=g[6]+S|0,g[7]=g[7]+C|0},_doFinalize:function(){var h=this._data,p=h.words,g=8*this._nDataBytes,m=8*h.sigBytes;return p[m>>>5]|=128<<24-m%32,p[(m+64>>>9<<4)+14]=n.floor(g/4294967296),p[(m+64>>>9<<4)+15]=g,h.sigBytes=4*p.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);Ee.lib.Cipher||function(n){var A=Ee,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(p,g){return this.create(this._ENC_XFORM_MODE,p,g)},createDecryptor:function(p,g){return this.create(this._DEC_XFORM_MODE,p,g)},init:function(p,g,m){this.cfg=this.cfg.extend(m),this._xformMode=p,this._key=g,this.reset()},reset:function(){i.reset.call(this),this._doReset()},process:function(p){return this._append(p),this._process()},finalize:function(p){return p&&this._append(p),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(p){return{encrypt:function(g,m,y){return(typeof m=="string"?h:v).encrypt(p,g,m,y)},decrypt:function(g,m,y){return(typeof m=="string"?h:v).decrypt(p,g,m,y)}}}});t.StreamCipher=s.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var d=A.mode={},u=function(p,g,m){var y=this._iv;y?this._iv=n:y=this._prevBlock;for(var b=0;b<m;b++)p[g+b]^=y[b]},l=(t.BlockCipherMode=e.extend({createEncryptor:function(p,g){return this.Encryptor.create(p,g)},createDecryptor:function(p,g){return this.Decryptor.create(p,g)},init:function(p,g){this._cipher=p,this._iv=g}})).extend();l.Encryptor=l.extend({processBlock:function(p,g){var m=this._cipher,y=m.blockSize;u.call(this,p,g,y),m.encryptBlock(p,g),this._prevBlock=p.slice(g,g+y)}}),l.Decryptor=l.extend({processBlock:function(p,g){var m=this._cipher,y=m.blockSize,b=p.slice(g,g+y);m.decryptBlock(p,g),u.call(this,p,g,y),this._prevBlock=b}}),d=d.CBC=l,l=(A.pad={}).Pkcs7={pad:function(p,g){for(var m=4*g,m=m-p.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),p.concat(m)},unpad:function(p){p.sigBytes-=p.words[p.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,p=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,p&&p.words)},_doProcessBlock:function(p,g){this._mode.processBlock(p,g)},_doFinalize:function(){var p=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){p.pad(this._data,this.blockSize);var g=this._process(!0)}else g=this._process(!0),p.unpad(g);return g},blockSize:4});var c=t.CipherParams=e.extend({init:function(p){this.mixIn(p)},toString:function(p){return(p||this.formatter).stringify(this)}}),d=(A.format={}).OpenSSL={stringify:function(p){var g=p.ciphertext;return p=p.salt,(p?r.create([1398893684,1701076831]).concat(p).concat(g):g).toString(a)},parse:function(p){p=a.parse(p);var g=p.words;if(g[0]==1398893684&&g[1]==1701076831){var m=r.create(g.slice(2,4));g.splice(0,4),p.sigBytes-=16}return c.create({ciphertext:p,salt:m})}},v=t.SerializableCipher=e.extend({cfg:e.extend({format:d}),encrypt:function(p,g,m,y){y=this.cfg.extend(y);var b=p.createEncryptor(m,y);return g=b.finalize(g),b=b.cfg,c.create({ciphertext:g,key:m,iv:b.iv,algorithm:p,mode:b.mode,padding:b.padding,blockSize:p.blockSize,formatter:y.format})},decrypt:function(p,g,m,y){return y=this.cfg.extend(y),g=this._parse(g,y.format),p.createDecryptor(m,y).finalize(g.ciphertext)},_parse:function(p,g){return typeof p=="string"?g.parse(p,this):p}}),A=(A.kdf={}).OpenSSL={execute:function(p,g,m,y){return y||(y=r.random(8)),p=o.create({keySize:g+m}).compute(p,y),m=r.create(p.words.slice(g),4*m),p.sigBytes=4*g,c.create({key:p,iv:m,salt:y})}},h=t.PasswordBasedCipher=v.extend({cfg:v.cfg.extend({kdf:A}),encrypt:function(p,g,m,y){return y=this.cfg.extend(y),m=y.kdf.execute(m,p.keySize,p.ivSize),y.iv=m.iv,p=v.encrypt.call(this,p,g,m.key,y),p.mixIn(m),p},decrypt:function(p,g,m,y){return y=this.cfg.extend(y),g=this._parse(g,y.format),m=y.kdf.execute(m,p.keySize,p.ivSize,g.salt),y.iv=m.iv,v.decrypt.call(this,p,g,m.key,y)}})}();(function(){for(var n=Ee,t=n.lib.BlockCipher,E=n.algo,e=[],r=[],i=[],a=[],o=[],s=[],u=[],l=[],c=[],d=[],v=[],A=0;256>A;A++)v[A]=128>A?A<<1:A<<1^283;for(var h=0,p=0,A=0;256>A;A++){var g=p^p<<1^p<<2^p<<3^p<<4,g=g>>>8^g&255^99;e[h]=g,r[g]=h;var m=v[h],y=v[m],b=v[y],x=257*v[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^v[v[v[b^m]]],p^=v[v[p]]):h=p=1}var w=[0,1,2,4,8,16,32,64,128,27,54],E=E.AES=t.extend({_doReset:function(){for(var R=this._key,S=R.words,C=R.sigBytes/4,R=4*((this._nRounds=C+6)+1),k=this._keySchedule=[],M=0;M<R;M++)if(M<C)k[M]=S[M];else{var I=k[M-1];M%C?6<C&&M%C==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[M/C|0]<<24),k[M]=k[M-C]^I}for(S=this._invKeySchedule=[],C=0;C<R;C++)M=R-C,I=C%4?k[M]:k[M-4],S[C]=4>C||4>=M?I:u[e[I>>>24]]^l[e[I>>>16&255]]^c[e[I>>>8&255]]^d[e[I&255]]},encryptBlock:function(S,C){this._doCryptBlock(S,C,this._keySchedule,i,a,o,s,e)},decryptBlock:function(S,C){var R=S[C+1];S[C+1]=S[C+3],S[C+3]=R,this._doCryptBlock(S,C,this._invKeySchedule,u,l,c,d,r),R=S[C+1],S[C+1]=S[C+3],S[C+3]=R},_doCryptBlock:function(S,C,R,k,M,I,L,T){for(var B=this._nRounds,j=S[C]^R[0],J=S[C+1]^R[1],X=S[C+2]^R[2],G=S[C+3]^R[3],D=4,V=1;V<B;V++)var N=k[j>>>24]^M[J>>>16&255]^I[X>>>8&255]^L[G&255]^R[D++],U=k[J>>>24]^M[X>>>16&255]^I[G>>>8&255]^L[j&255]^R[D++],H=k[X>>>24]^M[G>>>16&255]^I[j>>>8&255]^L[J&255]^R[D++],G=k[G>>>24]^M[j>>>16&255]^I[J>>>8&255]^L[X&255]^R[D++],j=N,J=U,X=H;N=(T[j>>>24]<<24|T[J>>>16&255]<<16|T[X>>>8&255]<<8|T[G&255])^R[D++],U=(T[J>>>24]<<24|T[X>>>16&255]<<16|T[G>>>8&255]<<8|T[j&255])^R[D++],H=(T[X>>>24]<<24|T[G>>>16&255]<<16|T[j>>>8&255]<<8|T[J&255])^R[D++],G=(T[G>>>24]<<24|T[j>>>16&255]<<16|T[J>>>8&255]<<8|T[X&255])^R[D++],S[C]=N,S[C+1]=U,S[C+2]=H,S[C+3]=G},keySize:8});n.AES=t._createHelper(E)})();/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
343
+ */var Wr;function fe(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 qt(){return new fe(null)}function Jl(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 _l(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 Xl(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"?(fe.prototype.am=_l,Wr=30):typeof navigator!="undefined"&&navigator.appName!="Netscape"?(fe.prototype.am=Jl,Wr=26):(fe.prototype.am=Xl,Wr=28);fe.prototype.DB=Wr;fe.prototype.DM=(1<<Wr)-1;fe.prototype.DV=1<<Wr;var Co=52;fe.prototype.FV=Math.pow(2,Co);fe.prototype.F1=Co-Wr;fe.prototype.F2=2*Wr-Co;var Wl="0123456789abcdefghijklmnopqrstuvwxyz",Yi=new Array,Dn,Nt;Dn=48;for(Nt=0;Nt<=9;++Nt)Yi[Dn++]=Nt;Dn=97;for(Nt=10;Nt<36;++Nt)Yi[Dn++]=Nt;Dn=65;for(Nt=10;Nt<36;++Nt)Yi[Dn++]=Nt;function Tr(n){return Wl.charAt(n)}function Zl(n,t){var e=Yi[n.charCodeAt(t)];return e==null?-1:e}function Yl(n){for(var t=this.t-1;t>=0;--t)n[t]=this[t];n.t=this.t,n.s=this.s}function $l(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 Io(n){var t=qt();return t.fromInt(n),t}function ec(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:Zl(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&&fe.ZERO.subTo(this,this)}function tc(){for(var n=this.s&this.DM;this.t>0&&this[this.t-1]==n;)--this.t}function rc(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=Tr(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+=Tr(r));return i?a:"0"}function nc(){var n=qt();return fe.ZERO.subTo(this,n),n}function ic(){return this.s<0?this.negate():this}function ac(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 To(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 oc(){return this.t<=0?0:this.DB*(this.t-1)+To(this[this.t-1]^this.s&this.DM)}function sc(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 uc(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 lc(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 fc(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 dc(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&&fe.ZERO.subTo(t,t)}function hc(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=qt());var a=qt(),o=this.s,s=n.s,u=this.DB-To(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),v=this.FV/d,A=(1<<this.F1)/d,h=1<<this.F2,p=e.t,g=p-l,m=t==null?qt():t;for(a.dlShiftTo(g,m),e.compareTo(m)>=0&&(e[e.t++]=1,e.subTo(m,e)),fe.ONE.dlShiftTo(l,m),m.subTo(a,a);a.t<l;)a[a.t++]=0;for(;--g>=0;){var y=e[--p]==c?this.DM:Math.floor(e[p]*v+(e[p-1]+h)*A);if((e[p]+=a.am(0,y,e,g,0,l))<y)for(a.dlShiftTo(g,m),e.subTo(m,e);e[p]<--y;)e.subTo(m,e)}t!=null&&(e.drShiftTo(l,t),o!=s&&fe.ZERO.subTo(t,t)),e.t=l,e.clamp(),u>0&&e.rShiftTo(u,e),o<0&&fe.ZERO.subTo(e,e)}}}function vc(n){var t=qt();return this.abs().divRemTo(n,null,t),this.s<0&&t.compareTo(fe.ZERO)>0&&n.subTo(t,t),t}function Vn(n){this.m=n}function mc(n){return n.s<0||n.compareTo(this.m)>=0?n.mod(this.m):n}function Ac(n){return n}function gc(n){n.divRemTo(this.m,null,n)}function yc(n,t,e){n.multiplyTo(t,e),this.reduce(e)}function bc(n,t){n.squareTo(t),this.reduce(t)}Vn.prototype.convert=mc;Vn.prototype.revert=Ac;Vn.prototype.reduce=gc;Vn.prototype.mulTo=yc;Vn.prototype.sqrTo=bc;function xc(){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 zn(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 wc(n){var t=qt();return n.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),n.s<0&&t.compareTo(fe.ZERO)>0&&this.m.subTo(t,t),t}function Ec(n){var t=qt();return n.copyTo(t),this.reduce(t),t}function Sc(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 Mc(n,t){n.squareTo(t),this.reduce(t)}function Cc(n,t,e){n.multiplyTo(t,e),this.reduce(e)}zn.prototype.convert=wc;zn.prototype.revert=Ec;zn.prototype.reduce=Sc;zn.prototype.mulTo=Cc;zn.prototype.sqrTo=Mc;function Ic(){return(this.t>0?this[0]&1:this.s)==0}function Tc(n,t){if(n>4294967295||n<1)return fe.ONE;var e=qt(),r=qt(),i=t.convert(this),a=To(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 Pc(n,t){var e;return n<256||t.isEven()?e=new Vn(t):e=new zn(t),this.exp(n,e)}fe.prototype.copyTo=Yl;fe.prototype.fromInt=$l;fe.prototype.fromString=ec;fe.prototype.clamp=tc;fe.prototype.dlShiftTo=sc;fe.prototype.drShiftTo=uc;fe.prototype.lShiftTo=lc;fe.prototype.rShiftTo=cc;fe.prototype.subTo=fc;fe.prototype.multiplyTo=dc;fe.prototype.squareTo=hc;fe.prototype.divRemTo=pc;fe.prototype.invDigit=xc;fe.prototype.isEven=Ic;fe.prototype.exp=Tc;fe.prototype.toString=rc;fe.prototype.negate=nc;fe.prototype.abs=ic;fe.prototype.compareTo=ac;fe.prototype.bitLength=oc;fe.prototype.mod=vc;fe.prototype.modPowInt=Pc;fe.ZERO=Io(0);fe.ONE=Io(1);/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function Rc(){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 Bc(n){return Math.floor(Math.LN2*this.DB/Math.log(n))}function Fc(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function Lc(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=Io(e),i=qt(),a=qt(),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}fe.prototype.chunkSize=Bc;fe.prototype.toRadix=Lc;fe.prototype.intValue=Rc;fe.prototype.signum=Fc;/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */var Tn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",K0="=";function kc(n){var t,e,r="";for(t=0;t+3<=n.length;t+=3)e=parseInt(n.substring(t,t+3),16),r+=Tn.charAt(e>>6)+Tn.charAt(e&63);for(t+1==n.length?(e=parseInt(n.substring(t,t+1),16),r+=Tn.charAt(e<<2)):t+2==n.length&&(e=parseInt(n.substring(t,t+2),16),r+=Tn.charAt(e>>2)+Tn.charAt((e&3)<<4));(r.length&3)>0;)r+=K0;return r}function Po(n){var t="",e,r=0,i,a;for(e=0;e<n.length&&n.charAt(e)!=K0;++e)a=Tn.indexOf(n.charAt(e)),!(a<0)&&(r==0?(t+=Tr(a>>2),i=a&3,r=1):r==1?(t+=Tr(i<<2|a>>4),i=a&15,r=2):r==2?(t+=Tr(i),t+=Tr(a>>2),i=a&3,r=3):(t+=Tr(i<<2|a>>4),t+=Tr(a&15),r=0));return r==1&&(t+=Tr(i<<2)),t}/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function St(n,t){return new fe(n,t)}function Oc(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 fe(e)}function ss(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 Dc(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(p){return Rr(a.hashHex($i(p),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=ss(c,l.length,e),v=[];for(u=0;u<l.length;u+=1)v[u]=l.charCodeAt(u)^d.charCodeAt(u);var A=ss(v,c.length,e),h=[0];for(u=0;u<c.length;u+=1)h[u+1]=c[u]^A.charCodeAt(u);return new fe(h.concat(v))}function Re(){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 Vc(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=St(n,16),this.e=parseInt(t,16);else throw"Invalid RSA public key"}function zc(n){return n.modPowInt(this.e,this.n)}function Nc(n){var t=Oc(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 Qc(n,t,e){var r=Dc(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}Re.prototype.doPublic=zc;Re.prototype.setPublic=Vc;Re.prototype.encrypt=Nc;Re.prototype.encryptOAEP=Qc;Re.prototype.type="RSA";/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function Uc(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 us(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 Hc(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 Rr(a.hashHex($i(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=us(u,r,e),c=[],d;for(d=0;d<s.length;d+=1)c[d]=s.charCodeAt(d)^l.charCodeAt(d);var v=us(String.fromCharCode.apply(String,c),n.length-r,e),A=[];for(d=0;d<u.length;d+=1)A[d]=u.charCodeAt(d)^v.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(""),p=h!=-1?A.substr(0,h).lastIndexOf("\0"):-1;if(p+1!=h)throw"Malformed data";return A.substr(h+1)}function qc(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=St(n,16),this.e=parseInt(t,16),this.d=St(e,16);else throw"Invalid RSA private key"}function Gc(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=St(n,16),this.e=parseInt(t,16),this.d=St(e,16),this.p=St(r,16),this.q=St(i,16),this.dmp1=St(a,16),this.dmq1=St(o,16),this.coeff=St(s,16);else throw"Invalid RSA private key in RSASetPrivateEx"}function Kc(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 jc(n){if(n.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var t=St(n,16),e=this.doPrivate(t);return e==null?null:Uc(e,this.n.bitLength()+7>>3)}function Jc(n,t,e){if(n.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var r=St(n,16),i=this.doPrivate(r);return i==null?null:Hc(i,this.n.bitLength()+7>>3,t,e)}Re.prototype.doPrivate=Kc;Re.prototype.setPrivate=qc;Re.prototype.setPrivateEx=Gc;Re.prototype.decrypt=jc;Re.prototype.decryptOAEP=Jc;(typeof ae.lang=="undefined"||!ae.lang)&&(ae.lang={});ae.lang.String=function(){};function _c(n){return n.length%4==2?n=n+"==":n.length%4==3&&(n=n+"="),n=n.replace(/-/g,"+"),n=n.replace(/_/g,"/"),n}function tt(n){return Po(_c(n))}function pr(n){return decodeURIComponent($c(n))}function Rr(n){for(var t="",e=0;e<n.length-1;e+=2)t+=String.fromCharCode(parseInt(n.substr(e,2),16));return t}function $i(n){for(var t="",e=0;e<n.length;e++)t+=("0"+n.charCodeAt(e).toString(16)).slice(-2);return t}function Xc(n){return kc(n)}function Wc(n){var t=Xc(n),e=t.replace(/(.{64})/g,`$1\r
344
344
  `);return e=e.replace(/\r\n$/,""),e}function Zc(n){var t=n.replace(/[^0-9A-Za-z\/+=]*/g,""),e=Po(t);return e}function Yc(n,t){var e=Wc(n);return"-----BEGIN "+t+`-----\r
345
345
  `+e+`\r
346
346
  -----END `+t+`-----\r
@@ -359,11 +359,11 @@
359
359
  `,R+=`\r
360
360
  `,R+=C,R+=`\r
361
361
  -----END `+h+` PRIVATE KEY-----\r
362
- `,R},parseHexOfEncryptedPKCS8:function(h){var p=le,g=p.getChildIdx,m=p.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 E=g(h,w[1]);if(E.length!=2)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+E.length;if(m(h,E[0])!="2a864886f70d0307")throw"this only supports TripleDES";y.encryptionSchemeAlg="TripleDES",y.encryptionSchemeIV=m(h,E[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 C=g(h,S[1]);if(C.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+C.length;y.pbkdf2Salt=m(h,C[0]);var R=m(h,C[1]);try{y.pbkdf2Iter=parseInt(R,16)}catch(k){throw"malformed format pbkdf2Iter: "+R}return y},getPBKDF2KeyHexFromParam:function(h,p){var g=Ee.enc.Hex.parse(h.pbkdf2Salt),m=h.pbkdf2Iter,y=Ee.PBKDF2(p,g,{keySize:192/32,iterations:m}),b=Ee.enc.Hex.stringify(y);return b},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(h,p){var g=vn(h,"ENCRYPTED PRIVATE KEY"),m=this.parseHexOfEncryptedPKCS8(g),y=dn.getPBKDF2KeyHexFromParam(m,p),b={};b.ciphertext=Ee.enc.Hex.parse(m.ciphertext);var x=Ee.enc.Hex.parse(y),w=Ee.enc.Hex.parse(m.encryptionSchemeIV),E=Ee.TripleDES.decrypt(b,x,{iv:w}),S=Ee.enc.Hex.stringify(E);return S},getKeyFromEncryptedPKCS8PEM:function(h,p){var g=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(h,p),m=this.getKeyFromPlainPrivatePKCS8Hex(g);return m},parsePlainPrivatePKCS8Hex:function(h){var p=le,g=p.getChildIdx,m=p.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=p.getVidx(h,b[2]),y},getKeyFromPlainPrivatePKCS8PEM:function(h){var p=vn(h,"PRIVATE KEY"),g=this.getKeyFromPlainPrivatePKCS8Hex(p);return g},getKeyFromPlainPrivatePKCS8Hex:function(h){var p=this.parsePlainPrivatePKCS8Hex(h),g;if(p.algoid=="2a864886f70d010101")g=new Re;else if(ae.crypto.DSA&&p.algoid=="2a8648ce380401")g=new ae.crypto.DSA;else if(ae.crypto.ECDSA&&p.algoid=="2a8648ce3d0201")g=new ae.crypto.ECDSA;else throw"unsupported private key algorithm";return g.readPKCS8PrvKeyHex(h),g},_getKeyFromPublicPKCS8Hex:function(h){var p,g=le.getVbyList(h,0,[0,0],"06");if(g==="2a864886f70d010101")p=new Re;else if(ae.crypto.DSA&&g==="2a8648ce380401")p=new ae.crypto.DSA;else if(ae.crypto.ECDSA&&g==="2a8648ce3d0201")p=new ae.crypto.ECDSA;else throw"unsupported PKCS#8 public key hex";return p.readPKCS8PubKeyHex(h),p},parsePublicRawRSAKeyHex:function(h){var p=le,g=p.getChildIdx,m=p.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 p=le,g=p.getChildIdx,m=p.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=p.getVbyList(h,w[1],[0],"02"),y.algparam.q=p.getVbyList(h,w[1],[1],"02"),y.algparam.g=p.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}}}();dn.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=Re,c=vn,d=dn;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 v=new l;return v.setPublic(n.n,n.e),v}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 v=new l;return v.setPrivateEx(n.n,n.e,n.d,n.p,n.q,n.dp,n.dq,n.co),v}if(n.kty===void 0&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0&&n.p===void 0){var v=new l;return v.setPrivate(n.n,n.e,n.d),v}if(n.p!==void 0&&n.q!==void 0&&n.g!==void 0&&n.y!==void 0&&n.x===void 0){var v=new u;return v.setPublic(n.p,n.q,n.g,n.y),v}if(n.p!==void 0&&n.q!==void 0&&n.g!==void 0&&n.y!==void 0&&n.x!==void 0){var v=new u;return v.setPrivate(n.p,n.q,n.g,n.y,n.x),v}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d===void 0){var v=new l;return v.setPublic(tt(n.n),tt(n.e)),v}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 v=new l;return v.setPrivateEx(tt(n.n),tt(n.e),tt(n.d),tt(n.p),tt(n.q),tt(n.dp),tt(n.dq),tt(n.qi)),v}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0){var v=new l;return v.setPrivate(tt(n.n),tt(n.e),tt(n.d)),v}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,p=("0000000000"+tt(n.x)).slice(-h),g=("0000000000"+tt(n.y)).slice(-h),m="04"+p+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,p=("0000000000"+tt(n.x)).slice(-h),g=("0000000000"+tt(n.y)).slice(-h),m="04"+p+g,y=("0000000000"+tt(n.d)).slice(-h);return A.setPublicKeyHex(m),A.setPrivateKeyHex(y),A}if(e==="pkcs5prv"){var b=n,r=le,x,v;if(x=i(b,0),x.length===9)v=new l,v.readPKCS5PrvKeyHex(b);else if(x.length===6)v=new u,v.readPKCS5PrvKeyHex(b);else if(x.length>2&&b.substr(x[1],2)==="04")v=new s,v.readPKCS5PrvKeyHex(b);else throw"unsupported PKCS#1/5 hexadecimal key";return v}if(e==="pkcs8prv"){var v=d.getKeyFromPlainPrivatePKCS8Hex(n);return v}if(e==="pkcs8pub")return d._getKeyFromPublicPKCS8Hex(n);if(e==="x509pub")return Ge.getPublicKeyFromCertHex(n);if(n.indexOf("-END CERTIFICATE-",0)!=-1||n.indexOf("-END X509 CERTIFICATE-",0)!=-1||n.indexOf("-END TRUSTED CERTIFICATE-",0)!=-1)return Ge.getPublicKeyFromCertPEM(n);if(n.indexOf("-END PUBLIC KEY-")!=-1){var w=vn(n,"PUBLIC KEY");return d._getKeyFromPublicPKCS8Hex(w)}if(n.indexOf("-END RSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var E=c(n,"RSA PRIVATE KEY");return d.getKey(E,null,"pkcs5prv")}if(n.indexOf("-END DSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var S=c(n,"DSA PRIVATE KEY"),C=a(S,0,[1],"02"),R=a(S,0,[2],"02"),k=a(S,0,[3],"02"),M=a(S,0,[4],"02"),I=a(S,0,[5],"02"),v=new u;return v.setPrivate(new fe(C,16),new fe(R,16),new fe(k,16),new fe(M,16),new fe(I,16)),v}if(n.indexOf("-END EC PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var E=c(n,"EC PRIVATE KEY");return d.getKey(E,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 Re;return T.readPKCS5PrvKeyHex(L),T}if(n.indexOf("-END EC PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var S=d.getDecryptedKeyHex(n,t),v=a(S,0,[1],"04"),B=a(S,0,[2,0],"06"),D=a(S,0,[3,0],"03").substr(2),V="";if(ae.crypto.OID.oidhex2name[B]!==void 0)V=ae.crypto.OID.oidhex2name[B];else throw"undefined OID(hex) in KJUR.crypto.OID: "+B;var A=new s({curve:V});return A.setPublicKeyHex(D),A.setPrivateKeyHex(v),A.isPublic=!1,A}if(n.indexOf("-END DSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var S=d.getDecryptedKeyHex(n,t),C=a(S,0,[1],"02"),R=a(S,0,[2],"02"),k=a(S,0,[3],"02"),M=a(S,0,[4],"02"),I=a(S,0,[5],"02"),v=new u;return v.setPrivate(new fe(C,16),new fe(R,16),new fe(k,16),new fe(M,16),new fe(I,16)),v}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 fe(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 fe(e.substr(2),16):r=new fe(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):nf(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 rf(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 Rr(r)}catch(i){return e}};le.hextooidstr=function(n){var t=function(d,v){return d.length>=v?d:new Array(v-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 v=a.getVblen(n,t),A=0,h=a.getChildIdx(n,t),p=0;p<h.length;p++){var g=a.getTLV(n,h[p]);A+=g.length,a.checkStrictDER(n,h[p],e,r,i)}if(v*2!=A)throw new Error("sum of children's TLV length and L unmatch: "+v*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]};Re.getPosArrayOfChildrenFromHex=function(n){return le.getChildIdx(n,0)};Re.getHexValueArrayOfChildrenFromHex=function(n){var t=le,e=t.getV,v=Re.getPosArrayOfChildrenFromHex(n),r=e(n,v[0]),i=e(n,v[1]),a=e(n,v[2]),o=e(n,v[3]),s=e(n,v[4]),u=e(n,v[5]),l=e(n,v[6]),c=e(n,v[7]),d=e(n,v[8]),v=new Array;return v.push(r,i,a,o,s,u,l,c,d),v};Re.prototype.readPrivateKeyFromPEMString=function(n){var t=vn(n),e=Re.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};Re.prototype.readPKCS5PrvKeyHex=function(n){var t=Re.getHexValueArrayOfChildrenFromHex(n);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])};Re.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)};Re.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)};Re.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)};Re.prototype.readCertPubKeyHex=function(n,t){var e,r;e=new Ge,e.readCertHex(n),r=e.getPublicKeyHex(),this.readPKCS8PubKeyHex(r)};function _0(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[]}Re.prototype.verify=function(n,t){if(t=t.toLowerCase(),t.match(/^[0-9a-f]+$/)==null)return!1;var e=St(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=_0(o);if(s.length==0)return!1;var u=s[0],l=s[1],c=function(v){return ae.crypto.Util.hashString(v,u)},d=c(n);return l==d};Re.prototype.verifyWithMessageHash=function(n,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var e=St(t,16);if(e.bitLength()>this.n.bitLength())return 0;var r=this.doPublic(e),i=r.toString(16).replace(/^1f+00/,""),a=_0(i);if(a.length==0)return!1;a[0];var o=a[1];return o==n};Re.prototype.verifyPSS=function(n,t,e,r){var i=function(o){return ae.crypto.Util.hashHex(o,e)},a=i($i(n));return r===void 0&&(r=-1),this.verifyWithMessageHashPSS(a,t,e,r)};Re.prototype.verifyWithMessageHashPSS=function(n,t,e,r){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var i=new fe(t,16),a=function(y){return ae.crypto.Util.hashHex(y,e)},o=Rr(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 v=d.substr(0,l-s-1),A=d.substr(v.length,s),h=65280>>8*l-u&255;if(v.charCodeAt(0)&h)throw new Error("bits beyond keysize not zero");var p=pss_mgf1_str(A,v.length,a),g=[];for(c=0;c<v.length;c+=1)g[c]=v.charCodeAt(c)^p.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===Rr(a($i("\0\0\0\0\0\0\0\0"+o+String.fromCharCode.apply(String,g.slice(-r)))))};Re.SALT_LEN_HLEN=-1;Re.SALT_LEN_MAX=-2;Re.SALT_LEN_RECOVER=-2;function Ge(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,v=t.getInt,A=t.oidname,h=t.hextooidstr,p=vn,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=v(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 dn.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=vn(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 E=0;E<b.length;E++){var S={};S.critical=!1;var C=e(x,b[E]),R=0;C.length===3&&(S.critical=!0,R=1),S.oid=t.hextooidstr(a(x,b[E],[0],"06"));var k=l(x,b[E],[1+R]);S.vidx=d(x,k),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),E=parseInt(w,16);return x.cA=!0,x.pathLen=E,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(Ge.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),E=0;E<w.length;E++){var S=m.substr(w[E],2);if(S==="80"&&(x.kid={hex:r(m,w[E])}),S==="a1"){var C=i(m,w[E]),R=this.getGeneralNames(C);x.issuer=R[0].dn}S==="82"&&(x.sn={hex:r(m,w[E])})}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),E=0;E<w.length;E++)x.array.push(A(r(m,w[E])));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=Rr(b);if(y=="81")return{rfc822:x};if(y=="82")return{dns:x};if(y=="86")return{uri:x};if(y=="87")return{ip:ls(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,E=i(this.hex,x.vidx),S=e(E,0),C=0;C<S.length;C++)b=E.substr(S[C],2),m=r(E,S[C]),b==="81"&&(y=pr(m),w.push(["MAIL",y])),b==="82"&&(y=pr(m),w.push(["DNS",y])),b==="84"&&(y=Ge.hex2dn(m,0),w.push(["DN",y])),b==="86"&&(y=pr(m),w.push(["URI",y])),b==="87"&&(y=ls(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),E=0;E<w.length;E++){var S=i(m,w[E]);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),E=i(m,b[x]);w=="a0"&&(y.dpname=this.getDistributionPointName(E))}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),E=i(m,b[x]);w=="a0"&&(y.full=this.getGeneralNames(E))}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"),E=pr(w);y.push(E)}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"),E=a(this.hex,b[x],[1],"86");w==="2b06010505073001"&&y.ocsp.push(pr(E)),w==="2b06010505073002"&&y.caissuer.push(pr(E))}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),E=0;E<w.length;E++){var S=o(m,w[E],[0],"06"),C=a(m,w[E],[1],"86"),R=pr(C);if(S=="2b06010505073001")x.array.push({ocsp:R});else if(S=="2b06010505073002")x.array.push({caissuer:R});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),E=0;E<w.length;E++){var S=i(m,w[E]),C=this.getPolicyInformation(S);x.array.push(C)}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),E=0;E<w.length;E++){var S=i(m,w[E]),C=this.getPolicyQualifierInfo(S);y.array.push(C)}}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=Rr(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=Rr(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 E=i(m,w[1]),S=this.getGeneralName(E);S.uri!=null&&(x.uri=S.uri)}if(w.length>2){var C=i(m,w[2]);C=="0101ff"&&(x.reqauth=!0),C=="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],E=0;E<w.length;E++)b.push(w[E]);for(var x=0;x<b.length;x++){var S=b[x],C=S.ds,R=S.value,k=S.type;if(C!="prn"&&C!="utf8"&&C!="ia5")return"mixed";if(C=="ia5"){if(k!="CN")return"mixed";if(ae.lang.String.isMail(R))continue;return"mixed"}if(k=="C"){if(C=="prn")continue;return"mixed"}if(y==null)y=C;else if(y!==C)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],[]),E=ae.asn1.ASN1Util.oidHexToInt(x);return y.type=ae.asn1.x509.OID.oid2atype(E),y.ds=this.HEX2STAG[m.substr(b[1],2)],y.ds!="bmp"?y.value=pr(w):y.value=tf(w),y},this.readCertPEM=function(m){this.readCertHex(p(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=Yc(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 E=i(m,x[w]),S=this.getExtParam(E);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 E=s(m,0,[b-1,0]),S=void 0;if(x=="2.5.29.14"?S=this.getExtSubjectKeyIdentifier(E,w):x=="2.5.29.15"?S=this.getExtKeyUsage(E,w):x=="2.5.29.17"?S=this.getExtSubjectAltName(E,w):x=="2.5.29.18"?S=this.getExtIssuerAltName(E,w):x=="2.5.29.19"?S=this.getExtBasicConstraints(E,w):x=="2.5.29.31"?S=this.getExtCRLDistributionPoints(E,w):x=="2.5.29.32"?S=this.getExtCertificatePolicies(E,w):x=="2.5.29.35"?S=this.getExtAuthorityKeyIdentifier(E,w):x=="2.5.29.37"?S=this.getExtExtKeyUsage(E,w):x=="1.3.6.1.5.5.7.1.1"?S=this.getExtAuthorityInfoAccess(E,w):x=="2.5.29.20"?S=this.getExtCRLNumber(E,w):x=="2.5.29.21"?S=this.getExtCRLReason(E,w):x=="1.3.6.1.5.5.7.48.1.2"?S=this.getExtOcspNonce(E,w):x=="1.3.6.1.5.5.7.48.1.5"?S=this.getExtOcspNoCheck(E,w):x=="1.2.840.113583.1.1.9.1"&&(S=this.getExtAdobeTimeStamp(E,w)),S!=null)return S;var C={extname:x,extn:E};return w&&(C.critical=!0),C},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(N){var U=JSON.stringify(N.array).replace(/[\[\]\{\}\"]/g,"");return U},y=function(N){for(var U="",H=N.array,G=0;G<H.length;G++){var j=H[G];if(U+=" policy oid: "+j.policyoid+`
363
- `,j.array!==void 0)for(var _=0;_<j.array.length;_++){var X=j.array[_];X.cps!==void 0&&(U+=" cps: "+X.cps+`
362
+ `,R},parseHexOfEncryptedPKCS8:function(h){var p=le,g=p.getChildIdx,m=p.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 E=g(h,w[1]);if(E.length!=2)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+E.length;if(m(h,E[0])!="2a864886f70d0307")throw"this only supports TripleDES";y.encryptionSchemeAlg="TripleDES",y.encryptionSchemeIV=m(h,E[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 C=g(h,S[1]);if(C.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+C.length;y.pbkdf2Salt=m(h,C[0]);var R=m(h,C[1]);try{y.pbkdf2Iter=parseInt(R,16)}catch(k){throw"malformed format pbkdf2Iter: "+R}return y},getPBKDF2KeyHexFromParam:function(h,p){var g=Ee.enc.Hex.parse(h.pbkdf2Salt),m=h.pbkdf2Iter,y=Ee.PBKDF2(p,g,{keySize:192/32,iterations:m}),b=Ee.enc.Hex.stringify(y);return b},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(h,p){var g=vn(h,"ENCRYPTED PRIVATE KEY"),m=this.parseHexOfEncryptedPKCS8(g),y=dn.getPBKDF2KeyHexFromParam(m,p),b={};b.ciphertext=Ee.enc.Hex.parse(m.ciphertext);var x=Ee.enc.Hex.parse(y),w=Ee.enc.Hex.parse(m.encryptionSchemeIV),E=Ee.TripleDES.decrypt(b,x,{iv:w}),S=Ee.enc.Hex.stringify(E);return S},getKeyFromEncryptedPKCS8PEM:function(h,p){var g=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(h,p),m=this.getKeyFromPlainPrivatePKCS8Hex(g);return m},parsePlainPrivatePKCS8Hex:function(h){var p=le,g=p.getChildIdx,m=p.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=p.getVidx(h,b[2]),y},getKeyFromPlainPrivatePKCS8PEM:function(h){var p=vn(h,"PRIVATE KEY"),g=this.getKeyFromPlainPrivatePKCS8Hex(p);return g},getKeyFromPlainPrivatePKCS8Hex:function(h){var p=this.parsePlainPrivatePKCS8Hex(h),g;if(p.algoid=="2a864886f70d010101")g=new Re;else if(ae.crypto.DSA&&p.algoid=="2a8648ce380401")g=new ae.crypto.DSA;else if(ae.crypto.ECDSA&&p.algoid=="2a8648ce3d0201")g=new ae.crypto.ECDSA;else throw"unsupported private key algorithm";return g.readPKCS8PrvKeyHex(h),g},_getKeyFromPublicPKCS8Hex:function(h){var p,g=le.getVbyList(h,0,[0,0],"06");if(g==="2a864886f70d010101")p=new Re;else if(ae.crypto.DSA&&g==="2a8648ce380401")p=new ae.crypto.DSA;else if(ae.crypto.ECDSA&&g==="2a8648ce3d0201")p=new ae.crypto.ECDSA;else throw"unsupported PKCS#8 public key hex";return p.readPKCS8PubKeyHex(h),p},parsePublicRawRSAKeyHex:function(h){var p=le,g=p.getChildIdx,m=p.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 p=le,g=p.getChildIdx,m=p.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=p.getVbyList(h,w[1],[0],"02"),y.algparam.q=p.getVbyList(h,w[1],[1],"02"),y.algparam.g=p.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}}}();dn.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=Re,c=vn,d=dn;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 v=new l;return v.setPublic(n.n,n.e),v}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 v=new l;return v.setPrivateEx(n.n,n.e,n.d,n.p,n.q,n.dp,n.dq,n.co),v}if(n.kty===void 0&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0&&n.p===void 0){var v=new l;return v.setPrivate(n.n,n.e,n.d),v}if(n.p!==void 0&&n.q!==void 0&&n.g!==void 0&&n.y!==void 0&&n.x===void 0){var v=new u;return v.setPublic(n.p,n.q,n.g,n.y),v}if(n.p!==void 0&&n.q!==void 0&&n.g!==void 0&&n.y!==void 0&&n.x!==void 0){var v=new u;return v.setPrivate(n.p,n.q,n.g,n.y,n.x),v}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d===void 0){var v=new l;return v.setPublic(tt(n.n),tt(n.e)),v}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 v=new l;return v.setPrivateEx(tt(n.n),tt(n.e),tt(n.d),tt(n.p),tt(n.q),tt(n.dp),tt(n.dq),tt(n.qi)),v}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0){var v=new l;return v.setPrivate(tt(n.n),tt(n.e),tt(n.d)),v}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,p=("0000000000"+tt(n.x)).slice(-h),g=("0000000000"+tt(n.y)).slice(-h),m="04"+p+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,p=("0000000000"+tt(n.x)).slice(-h),g=("0000000000"+tt(n.y)).slice(-h),m="04"+p+g,y=("0000000000"+tt(n.d)).slice(-h);return A.setPublicKeyHex(m),A.setPrivateKeyHex(y),A}if(e==="pkcs5prv"){var b=n,r=le,x,v;if(x=i(b,0),x.length===9)v=new l,v.readPKCS5PrvKeyHex(b);else if(x.length===6)v=new u,v.readPKCS5PrvKeyHex(b);else if(x.length>2&&b.substr(x[1],2)==="04")v=new s,v.readPKCS5PrvKeyHex(b);else throw"unsupported PKCS#1/5 hexadecimal key";return v}if(e==="pkcs8prv"){var v=d.getKeyFromPlainPrivatePKCS8Hex(n);return v}if(e==="pkcs8pub")return d._getKeyFromPublicPKCS8Hex(n);if(e==="x509pub")return Ge.getPublicKeyFromCertHex(n);if(n.indexOf("-END CERTIFICATE-",0)!=-1||n.indexOf("-END X509 CERTIFICATE-",0)!=-1||n.indexOf("-END TRUSTED CERTIFICATE-",0)!=-1)return Ge.getPublicKeyFromCertPEM(n);if(n.indexOf("-END PUBLIC KEY-")!=-1){var w=vn(n,"PUBLIC KEY");return d._getKeyFromPublicPKCS8Hex(w)}if(n.indexOf("-END RSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var E=c(n,"RSA PRIVATE KEY");return d.getKey(E,null,"pkcs5prv")}if(n.indexOf("-END DSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var S=c(n,"DSA PRIVATE KEY"),C=a(S,0,[1],"02"),R=a(S,0,[2],"02"),k=a(S,0,[3],"02"),M=a(S,0,[4],"02"),I=a(S,0,[5],"02"),v=new u;return v.setPrivate(new fe(C,16),new fe(R,16),new fe(k,16),new fe(M,16),new fe(I,16)),v}if(n.indexOf("-END EC PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var E=c(n,"EC PRIVATE KEY");return d.getKey(E,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 Re;return T.readPKCS5PrvKeyHex(L),T}if(n.indexOf("-END EC PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var S=d.getDecryptedKeyHex(n,t),v=a(S,0,[1],"04"),B=a(S,0,[2,0],"06"),D=a(S,0,[3,0],"03").substr(2),V="";if(ae.crypto.OID.oidhex2name[B]!==void 0)V=ae.crypto.OID.oidhex2name[B];else throw"undefined OID(hex) in KJUR.crypto.OID: "+B;var A=new s({curve:V});return A.setPublicKeyHex(D),A.setPrivateKeyHex(v),A.isPublic=!1,A}if(n.indexOf("-END DSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var S=d.getDecryptedKeyHex(n,t),C=a(S,0,[1],"02"),R=a(S,0,[2],"02"),k=a(S,0,[3],"02"),M=a(S,0,[4],"02"),I=a(S,0,[5],"02"),v=new u;return v.setPrivate(new fe(C,16),new fe(R,16),new fe(k,16),new fe(M,16),new fe(I,16)),v}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 fe(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 fe(e.substr(2),16):r=new fe(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):nf(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 rf(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 Rr(r)}catch(i){return e}};le.hextooidstr=function(n){var t=function(d,v){return d.length>=v?d:new Array(v-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 v=a.getVblen(n,t),A=0,h=a.getChildIdx(n,t),p=0;p<h.length;p++){var g=a.getTLV(n,h[p]);A+=g.length,a.checkStrictDER(n,h[p],e,r,i)}if(v*2!=A)throw new Error("sum of children's TLV length and L unmatch: "+v*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]};Re.getPosArrayOfChildrenFromHex=function(n){return le.getChildIdx(n,0)};Re.getHexValueArrayOfChildrenFromHex=function(n){var t=le,e=t.getV,v=Re.getPosArrayOfChildrenFromHex(n),r=e(n,v[0]),i=e(n,v[1]),a=e(n,v[2]),o=e(n,v[3]),s=e(n,v[4]),u=e(n,v[5]),l=e(n,v[6]),c=e(n,v[7]),d=e(n,v[8]),v=new Array;return v.push(r,i,a,o,s,u,l,c,d),v};Re.prototype.readPrivateKeyFromPEMString=function(n){var t=vn(n),e=Re.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};Re.prototype.readPKCS5PrvKeyHex=function(n){var t=Re.getHexValueArrayOfChildrenFromHex(n);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])};Re.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)};Re.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)};Re.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)};Re.prototype.readCertPubKeyHex=function(n,t){var e,r;e=new Ge,e.readCertHex(n),r=e.getPublicKeyHex(),this.readPKCS8PubKeyHex(r)};function J0(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[]}Re.prototype.verify=function(n,t){if(t=t.toLowerCase(),t.match(/^[0-9a-f]+$/)==null)return!1;var e=St(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=J0(o);if(s.length==0)return!1;var u=s[0],l=s[1],c=function(v){return ae.crypto.Util.hashString(v,u)},d=c(n);return l==d};Re.prototype.verifyWithMessageHash=function(n,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var e=St(t,16);if(e.bitLength()>this.n.bitLength())return 0;var r=this.doPublic(e),i=r.toString(16).replace(/^1f+00/,""),a=J0(i);if(a.length==0)return!1;a[0];var o=a[1];return o==n};Re.prototype.verifyPSS=function(n,t,e,r){var i=function(o){return ae.crypto.Util.hashHex(o,e)},a=i($i(n));return r===void 0&&(r=-1),this.verifyWithMessageHashPSS(a,t,e,r)};Re.prototype.verifyWithMessageHashPSS=function(n,t,e,r){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var i=new fe(t,16),a=function(y){return ae.crypto.Util.hashHex(y,e)},o=Rr(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 v=d.substr(0,l-s-1),A=d.substr(v.length,s),h=65280>>8*l-u&255;if(v.charCodeAt(0)&h)throw new Error("bits beyond keysize not zero");var p=pss_mgf1_str(A,v.length,a),g=[];for(c=0;c<v.length;c+=1)g[c]=v.charCodeAt(c)^p.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===Rr(a($i("\0\0\0\0\0\0\0\0"+o+String.fromCharCode.apply(String,g.slice(-r)))))};Re.SALT_LEN_HLEN=-1;Re.SALT_LEN_MAX=-2;Re.SALT_LEN_RECOVER=-2;function Ge(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,v=t.getInt,A=t.oidname,h=t.hextooidstr,p=vn,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=v(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 dn.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=vn(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 E=0;E<b.length;E++){var S={};S.critical=!1;var C=e(x,b[E]),R=0;C.length===3&&(S.critical=!0,R=1),S.oid=t.hextooidstr(a(x,b[E],[0],"06"));var k=l(x,b[E],[1+R]);S.vidx=d(x,k),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),E=parseInt(w,16);return x.cA=!0,x.pathLen=E,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(Ge.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),E=0;E<w.length;E++){var S=m.substr(w[E],2);if(S==="80"&&(x.kid={hex:r(m,w[E])}),S==="a1"){var C=i(m,w[E]),R=this.getGeneralNames(C);x.issuer=R[0].dn}S==="82"&&(x.sn={hex:r(m,w[E])})}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),E=0;E<w.length;E++)x.array.push(A(r(m,w[E])));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=Rr(b);if(y=="81")return{rfc822:x};if(y=="82")return{dns:x};if(y=="86")return{uri:x};if(y=="87")return{ip:ls(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,E=i(this.hex,x.vidx),S=e(E,0),C=0;C<S.length;C++)b=E.substr(S[C],2),m=r(E,S[C]),b==="81"&&(y=pr(m),w.push(["MAIL",y])),b==="82"&&(y=pr(m),w.push(["DNS",y])),b==="84"&&(y=Ge.hex2dn(m,0),w.push(["DN",y])),b==="86"&&(y=pr(m),w.push(["URI",y])),b==="87"&&(y=ls(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),E=0;E<w.length;E++){var S=i(m,w[E]);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),E=i(m,b[x]);w=="a0"&&(y.dpname=this.getDistributionPointName(E))}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),E=i(m,b[x]);w=="a0"&&(y.full=this.getGeneralNames(E))}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"),E=pr(w);y.push(E)}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"),E=a(this.hex,b[x],[1],"86");w==="2b06010505073001"&&y.ocsp.push(pr(E)),w==="2b06010505073002"&&y.caissuer.push(pr(E))}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),E=0;E<w.length;E++){var S=o(m,w[E],[0],"06"),C=a(m,w[E],[1],"86"),R=pr(C);if(S=="2b06010505073001")x.array.push({ocsp:R});else if(S=="2b06010505073002")x.array.push({caissuer:R});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),E=0;E<w.length;E++){var S=i(m,w[E]),C=this.getPolicyInformation(S);x.array.push(C)}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),E=0;E<w.length;E++){var S=i(m,w[E]),C=this.getPolicyQualifierInfo(S);y.array.push(C)}}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=Rr(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=Rr(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 E=i(m,w[1]),S=this.getGeneralName(E);S.uri!=null&&(x.uri=S.uri)}if(w.length>2){var C=i(m,w[2]);C=="0101ff"&&(x.reqauth=!0),C=="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],E=0;E<w.length;E++)b.push(w[E]);for(var x=0;x<b.length;x++){var S=b[x],C=S.ds,R=S.value,k=S.type;if(C!="prn"&&C!="utf8"&&C!="ia5")return"mixed";if(C=="ia5"){if(k!="CN")return"mixed";if(ae.lang.String.isMail(R))continue;return"mixed"}if(k=="C"){if(C=="prn")continue;return"mixed"}if(y==null)y=C;else if(y!==C)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],[]),E=ae.asn1.ASN1Util.oidHexToInt(x);return y.type=ae.asn1.x509.OID.oid2atype(E),y.ds=this.HEX2STAG[m.substr(b[1],2)],y.ds!="bmp"?y.value=pr(w):y.value=tf(w),y},this.readCertPEM=function(m){this.readCertHex(p(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=Yc(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 E=i(m,x[w]),S=this.getExtParam(E);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 E=s(m,0,[b-1,0]),S=void 0;if(x=="2.5.29.14"?S=this.getExtSubjectKeyIdentifier(E,w):x=="2.5.29.15"?S=this.getExtKeyUsage(E,w):x=="2.5.29.17"?S=this.getExtSubjectAltName(E,w):x=="2.5.29.18"?S=this.getExtIssuerAltName(E,w):x=="2.5.29.19"?S=this.getExtBasicConstraints(E,w):x=="2.5.29.31"?S=this.getExtCRLDistributionPoints(E,w):x=="2.5.29.32"?S=this.getExtCertificatePolicies(E,w):x=="2.5.29.35"?S=this.getExtAuthorityKeyIdentifier(E,w):x=="2.5.29.37"?S=this.getExtExtKeyUsage(E,w):x=="1.3.6.1.5.5.7.1.1"?S=this.getExtAuthorityInfoAccess(E,w):x=="2.5.29.20"?S=this.getExtCRLNumber(E,w):x=="2.5.29.21"?S=this.getExtCRLReason(E,w):x=="1.3.6.1.5.5.7.48.1.2"?S=this.getExtOcspNonce(E,w):x=="1.3.6.1.5.5.7.48.1.5"?S=this.getExtOcspNoCheck(E,w):x=="1.2.840.113583.1.1.9.1"&&(S=this.getExtAdobeTimeStamp(E,w)),S!=null)return S;var C={extname:x,extn:E};return w&&(C.critical=!0),C},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(N){var U=JSON.stringify(N.array).replace(/[\[\]\{\}\"]/g,"");return U},y=function(N){for(var U="",H=N.array,G=0;G<H.length;G++){var j=H[G];if(U+=" policy oid: "+j.policyoid+`
363
+ `,j.array!==void 0)for(var J=0;J<j.array.length;J++){var X=j.array[J];X.cps!==void 0&&(U+=" cps: "+X.cps+`
364
364
  `)}}return U},b=function(N){for(var U="",H=N.array,G=0;G<H.length;G++){var j=H[G];try{j.dpname.full[0].uri!==void 0&&(U+=" "+j.dpname.full[0].uri+`
365
- `)}catch(_){}try{j.dname.full[0].dn.hex!==void 0&&(U+=" "+Ge.hex2dn(j.dpname.full[0].dn.hex)+`
366
- `)}catch(_){}}return U},x=function(N){for(var U="",H=N.array,G=0;G<H.length;G++){var j=H[G];j.caissuer!==void 0&&(U+=" caissuer: "+j.caissuer+`
365
+ `)}catch(J){}try{j.dname.full[0].dn.hex!==void 0&&(U+=" "+Ge.hex2dn(j.dpname.full[0].dn.hex)+`
366
+ `)}catch(J){}}return U},x=function(N){for(var U="",H=N.array,G=0;G<H.length;G++){var j=H[G];j.caissuer!==void 0&&(U+=" caissuer: "+j.caissuer+`
367
367
  `),j.ocsp!==void 0&&(U+=" ocsp: "+j.ocsp+`
368
368
  `)}return U},w,E,S;if(w=`Basic Fields
369
369
  `,w+=" serial number: "+this.getSerialNumberHex()+`
@@ -387,8 +387,8 @@
387
387
  `}else if(k==="subjectAltName"){var B=m(this.getExtSubjectAltName());w+=" "+B+`
388
388
  `}else if(k==="cRLDistributionPoints"){var D=this.getExtCRLDistributionPoints();w+=b(D)}else if(k==="authorityInfoAccess"){var V=this.getExtAuthorityInfoAccess();w+=x(V)}else k==="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))}Ge.hex2dn=function(n,t){t===void 0&&(t=0);var e=new Ge;le.getTLV(n,t);var r=e.getX500Name(n);return r.str};Ge.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(Ge.hex2attrTypeValue(n,r[i]));return e=e.map(function(a){return a.replace("+","\\+")}),e.join("+")};Ge.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=Rr(u);return s+"="+l};Ge.getPublicKeyFromCertHex=function(n){var t=new Ge;return t.readCertHex(n),t.getPublicKey()};Ge.getPublicKeyFromCertPEM=function(n){var t=new Ge;return t.readCertPEM(n),t.getPublicKey()};Ge.getPublicKeyInfoPropOfCertPEM=function(n){var t=le,e=t.getVbyList,r={},i,a;return r.algparam=null,i=new Ge,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};Ge.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"];function ds(n){return Ee.SHA256(n).toString()}var J0=[function(){var n=new Ge;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\\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T`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 af(n,t){for(var e=0,r=t;e<r.length;e++){var i=r[e];if(i.getSubjectHex()===n)return i}}function X0(n,t){var e=n.getIssuerHex();if(e===n.getSubjectHex())return n.verifySignature(n.getPublicKey());var r=af(e,t);return!r||n.verifySignature(r.getPublicKey())===!1?!1:X0(r,t)}function W0(n){var t=n.getIssuerHex();return t===n.getSubjectHex()?!1:X0(n,J0)}function of(n){var t=new Ge;typeof n=="string"?t.readCertPEM(n):t.readCertHex(n.hex);var e=W0(t);return J0.push(t),e}function sf(n,t,e){var r=new Ge;if(typeof e=="string"?r.readCertPEM(e):r.readCertHex(e.hex),W0(r)===!1)return!1;var i=new Re;return i.readCertPubKeyHex(r.hex,6),!!i.verify(n,Po(t))}of(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[o\x008 wTQcrA <z{DZoEE^rZ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ouTX^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 to=function(n,t){return to=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])},to(n,t)};function se(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");to(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 Tt(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 Pt(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)}function ea(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 ta(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 dt(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 uf(n){return typeof Symbol=="undefined"?"$Symbol<".concat(n,">$"):Symbol(n)}var Zn=uf("$$FIVE_EVENT$$");function Ci(n){return n[Zn]||(n[Zn]={}),n[Zn]}function lf(n){n[Zn]&&delete n[Zn]}var ra=function(){function n(){}return n.prototype.hasListener=function(t){var e=Ci(this);return e&&e[t]&&e[t].callbacks.length>0},n.prototype.on=function(t,e,r){var i=this,a=Ci(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){lf(this);return}var r=Ci(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=Ci(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],v=d===void 0?!1:d,A=c.apply(void 0,e);v&&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(),he=typeof performance!="undefined"?function(){return cf+performance.now()}:function(){return Date.now()};function Pn(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])&&Pn(n[r])}),n}var hs=/^([^.]+)(\.([^.]+))*$/;function ff(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 mn(n){return/^(([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])(\.(?!$)|$)){4}$/.test(n)}function Yr(n,t){return hs.test(n)&&hs.test(t)&&ff(n,t)}var df=[/\.([0-9a-z]+)\.jsonp([\?\#].*)?$/i,/jsonp_([0-9a-z]+)([\?\#].*)?$/i],vr=Pn(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"))),li=function(n){se(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),On=function(n){se(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){se(t,n);function t(e,r){return n.call(this,"[NETWORK]: request abort(type: ".concat(r,"): ").concat(e))||this}return t})(Error);var ii=function(n){se(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),Ro=function(n){se(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 hf(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 ro(n){for(var t=0,e=df;t<e.length;t++){var r=e[t],i=n.match(r);if(i)return"jsonp_"+i[1]}return null}function ps(n){return ro(n)!==null}function vs(n){var t=n.match(/^([0-9a-z]+\:)\/\/(([^:/?#]*)(?::[0-9]+)?)/);return t?t[1]:location.protocol}function Bo(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 Z0=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(ra);function Fn(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=he(),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=ro(n),c=l?"Script":"XMLHttpRequest",d=new li(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?vr.concat(t.allowHosts):vr.slice(),v=Bo(s),A=ro(s);if(location.hostname.length!==0&&!mn(location.hostname)&&vr.filter(function(L){return Yr(L,location.hostname)}).length===0&&!mn(v)&&d.filter(function(L){return Yr(L,v)}).length===0){var h=A?"Script":"XMLHttpRequest",p=new Ro(s,h,"request host(".concat(v,") is not allowed"));r(p),l(p),(c=t.networkSubscribe)===null||c===void 0||c.emit("network",s,h,"forbidden",p.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 ii(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,B,D=he(),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 N=new On(s,"Script",500);r(N),l(N),(T=t.networkSubscribe)===null||T===void 0||T.emit("network",s,"Script","error",N.message);return}var U=L.split(","),H=(U[0].match(/:(.*?);/)||[])[1],G=U[1];if(t.responseType==="arraybuffer"||t.responseType==="blob"){for(var j=atob(U[1]),_=j.length,X=new Uint8Array(_),Z=0;Z<_;Z++)X[Z]=j.charCodeAt(Z);t.responseType==="arraybuffer"?G=X.buffer:G=new Blob([X],{type:H})}var W={},$={body:G,meta:{origin:o,source:s,requestTime:a,responseTime:D,costs:V,headers:W}};e($),u($),(B=t.networkSubscribe)===null||B===void 0||B.emit("network",s,"Script","ok",JSON.stringify($.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 E=!1,S=new XMLHttpRequest,C=function(){S&&(S.removeEventListener("timeout",R,!1),S.removeEventListener("progress",k,!1),S.removeEventListener("load",M,!1),S.removeEventListener("error",I,!1)),S=null,C=Q},R=function(){var L;if(E!==!0){E=!0,C();var T=new ii(s,"XMLHttpRequest",t.timeout||NaN);r(T),l(T),(L=t.networkSubscribe)===null||L===void 0||L.emit("network",s,"XMLHttpRequest","timeout",T.message)}},k=function(L){E!==!0&&L.lengthComputable&&(L.total<=0||i(L.loaded/L.total))},M=function(L){var T;if(E!==!0){var B=this.status;if(B===0||B>=200&&B<400){E=!0,C();var D=he(),V=D-a,N=hf(this.getAllResponseHeaders()),U=L.total,H={body:this.response,meta:{origin:o,source:s,requestTime:a,responseTime:D,costs:V,headers:N,size:U}};e(H),u(H),(T=t.networkSubscribe)===null||T===void 0||T.emit("network",s,"XMLHttpRequest","ok",JSON.stringify(H.meta))}else I.call(this)}},I=function(){var L;if(E!==!0){E=!0,C();var T=new On(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",R,!1),S.addEventListener("progress",k,!1),S.addEventListener("load",M,!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 pa={};function pf(n,t){t===void 0&&(t={});var e=he(),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 li(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 pa?pa[i]:pa[i]=new Promise(function(a,o){var s,u=t.allowHosts?vr.concat(t.allowHosts):vr.slice(),l=Bo(i);if(location.hostname.length!==0&&!mn(location.hostname)&&vr.filter(function(p){return Yr(p,location.hostname)}).length===0&&!mn(l)&&u.filter(function(p){return Yr(p,l)}).length===0){var c=new Ro(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"),v=!1,A=null;d.onload=function(p){var g;if(A!==null&&(clearTimeout(A),A=null),v!==!0){v=!0,a();var m=he(),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(p){var g;if(A!==null&&(clearTimeout(A),A=null),v!==!0){v=!0;var m=new On(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 p;if(A=null,v!==!0){v=!0,a();var g=he(),m=g-e,y={},b={origin:r,source:i,requestTime:e,responseTime:g,costs:m,headers:y};(p=t.networkSubscribe)===null||p===void 0||p.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 vf(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=he(),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 li(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,v=t.allowHosts?vr.concat(t.allowHosts):vr.slice(),A=Bo(u);if(location.hostname.length!==0&&!mn(location.hostname)&&vr.filter(function(x){return Yr(x,location.hostname)}).length===0&&!mn(A)&&v.filter(function(x){return Yr(x,A)}).length===0){var h=new Ro(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 p=a!=null?a:new Image,g=!1,m=null,y=function(){var x;if(p.onload=Q,p.onerror=Q,m!==null&&(clearTimeout(m),m=null),g!==!0){var w=he(),E={headers:{},origin:s,source:u,requestTime:o,responseTime:w,costs:w-o};g=!0;var S={body:p,meta:E};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(p.onload=Q,p.onerror=Q,m!==null&&(clearTimeout(m),m=null),g!==!0){g=!0;var w=new On(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(p.onload=Q,p.onerror=Q,m=null,g!==!0){g=!0;var w=new ii(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)),p.onload=y,p.onerror=b,i(0),p.src=u})})}var Rt=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 Fn(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 vf(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}(),Ki=new Rt;function de(n,t,e){return n<t?t:n>e?e:n}var no=function(){var n=he();return{requestAnimationFrame:function(t){var e=he(),r=de(16+(e-n),16,33),i=setTimeout(function(){t(e+r)},r);return n=e+r,i},cancelAnimationFrame:function(t){return clearTimeout(t)}}}(),ms=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 no}(),mf=5,As=16,ht=function(){function n(){this.loopType="raf",this.frames=[],this.isAnimating=!1,this.context=null;var t=he();this.loop=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(this.isAnimating!==!1){var i=he(),a=i-t;t=i,As=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,dt([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 As},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 ms.requestAnimationFrame(t);if(this.loopType==="sto")return no.requestAnimationFrame(t)},n.prototype.cancelAnimationFrame=function(t){if(this.context)this.context.cancelAnimationFrame(t);else if(this.loopType==="raf")ms.cancelAnimationFrame(t);else if(this.loopType==="sto")return no.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=mf);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}(),Af={"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"]}},Y0=/^https?\:\/\/?([^\/]+)/;function gf(n){var t=n.match(Y0);return t===null?null:t[1]}function wn(n,t){return n.replace(Y0,function(e,r){return e.slice(0,e.length-r.length)+t})}function yf(n,t,e){var r=t.split("."),i=r[0],a=r.slice(1);if(i==="texture")return wn(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 wn(n,e.pano[0]);case"down":case"right":case"back":return wn(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 wn(n,e.tile[c%2])}else if(i==="model"){var d=a[0],c=Number(d);if(!isNaN(c))return wn(n,e.model[c%2])}return wn(n,e.default[0])}var bf=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},xf=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],v=c[1],A=c[2],h=c[3];o.push("crop,x_".concat(d,",y_").concat(v,",w_").concat(A,",h_").concat(h,",g_nw"))}if(u!==void 0&&u!==100){var p=(e=t.format)!==null&&e!==void 0?e:i;p&&["jpg","webp"].indexOf(p)>=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},En=9007199254740991;function on(n){var t=Math.round(n);return Math.abs(t-n)<.001?t:Math.floor(n)}function wf(n){return n=Object.assign({},n),n.size!==void 0&&(n.size=on(de(n.size,0,En))),n.quality!==void 0&&(n.quality=on(de(n.quality,0,100))),n.cut!==void 0&&(n.cut=[on(de(n.cut[0],0,En)),on(de(n.cut[1],0,En)),on(de(n.cut[2],0,En)),on(de(n.cut[3],0,En))]),n.sharpen!==void 0&&(n.sharpen=on(de(n.sharpen,0,En))),n}function ot(n,t){var e=O(O({},Af),t.mappings),r=gf(n);if(r===null)return n;t=wf(t);var i=e[r];return i?(n=yf(n,t.key,i),/\.basis(\?|$)/.test(n)&&(n=n.replace(/\.basis(\?|$)/,".jpg$1")),i.type==="tencentCloud"?bf(n,t):i.type==="aliyun"?xf(n,t):n):n}function hn(n,t,e){t===void 0&&(t=ot);var r=t(n,e);if(r===n&&e.cut)throw new Error("ImageURL: cut option not applied.");return r}var $0=/\/cube_(\d+)\//;function ai(n){var t=n.match($0);return t?Number(t[1]):null}function Vt(n,t){return n.replace($0,"/cube_".concat(t,"/"))}var Ef="data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAIAAUAmJaQAA3AA/vz0AAA=",Sf="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAAGhbWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAsaWxvYwAAAABEAAACAAEAAAABAAAB3gAAABkAAgAAAAEAAAHJAAAAFQAAAEJpaW5mAAAAAAACAAAAGmluZmUCAAAAAAEAAGF2MDFDb2xvcgAAAAAaaW5mZQIAAAAAAgAAYXYwMUFscGhhAAAAABppcmVmAAAAAAAAAA5hdXhsAAIAAQABAAAA12lwcnAAAACxaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIAAoAAAAAUaXNwZQAAAAAAAAACAAAAAgAAAA5waXhpAAAAAAEIAAAADGF2MUOBABwAAAAAOGF1eEMAAAAAdXJuOm1wZWc6bXBlZ0I6Y2ljcDpzeXN0ZW1zOmF1eGlsaWFyeTphbHBoYQAAAAAeaXBtYQAAAAAAAAACAAEEAQKDBAACBAUGhwgAAAA2bWRhdBIACgQYADLVMgsWQBhhIAQqrNj/+BIACgUYADLEoDIOFkADDDDCQAACDaqCCb4=",Mf="data:image/heif;base64,AAAAGGZ0eXBoZWljAAAAAG1pZjFoZWljAAABL21ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAHBpY3QAAAAAAAAAAAAAAAAAAAAADnBpdG0AAAAAAAEAAAAjaWluZgAAAAAAAQAAABVpbmZlAgAAAAABAABodmMxAAAAAK9pcHJwAAAAkmlwY28AAAB2aHZjQwEBYAAAAAAAAAAAAADwAPz9+PgAACcDoAABAB5AAQwG//8BYAAAAwAAAwAAAwAAAwAAAwAAreTLgSChAAEAI0IBBwFgAAADAAADAAADAAADAAADAAChInJJlreTLySZNdggogABAAdEAcA98DMkAAAAFGlzcGUAAAAAAAAAAgAAAAIAAAAVaXBtYQAAAAAAAAABAAECgQIAAAAiaWxvYwAAAABEQAABAAEAAAAAAU8AAQAAAAAAAAAOAAAAFm1kYXQAAAAKJgGvLvkQwuWM4A==";function va(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 ma=null;function eu(){return ma||(ma=Promise.all([va(Ef),va(Sf),va(Mf)]).then(function(n){return{webp:n[0],avif:n[1],heif:n[2]}}))}var tu=/^(.*)\[(\d+)\]$/;function ze(n){if(!isNaN(n.panoIndex)&&isFinite(n.panoIndex))return"".concat(n.workCode,"[").concat(n.panoIndex,"]");throw new Error("Invalid Pano")}function yt(n){var t=n.match(tu);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 nr(n,t){return ze(n)===ze(t)}function ru(n){return typeof n=="string"&&tu.test(n)}var Cf=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(f.Group),Ct=function(n){se(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),nu=function(n){se(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 Gn(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+=Gn(n[a],!1)+",";return i>-1&&(r+=Gn(n[a],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return Gn(n.toJSON(),t);for(var o=Object.keys(n).sort(),s=o.length,r="",a=0;a<s;){var u=o[a],l=Gn(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 na(n){return"hash::".concat(Gn(n,!1))}var If=function(){function n(t){var e,r,i,a,o,s,u,l,c,d,v,A,h,p,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=(v=t.fragment)===null||v===void 0?void 0:v.mainStart)!==null&&A!==void 0?A:"",mainModelColor:(p=(h=t.fragment)===null||h===void 0?void 0:h.mainModelColor)!==null&&p!==void 0?p:"",mainEnd:(m=(g=t.fragment)===null||g===void 0?void 0:g.mainEnd)!==null&&m!==void 0?m:""}}return n.prototype.getHash=function(){return na({vertex:this.vertex,fragment:this.fragment,defines:this.defines})},n.prototype.onBeforeCompile=function(t,e){},n}(),ci=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}();ci.minFilter=f.NearestFilter;ci.magFilter=f.NearestFilter;ci.wrapS=f.RepeatWrapping;ci.wrapT=f.RepeatWrapping;var Ae={customShaders:[],pano0:null,pano1:null,floorStyle:"OPACITY",shownFloorIndex:-1,modelAlpha:1,opacity:1,progress:0,transition:"FADE",clippers:null,brightness:1,constantColor:null,useEDL:!1,useHQWeight:!1,useHQDepth:!1,pointColor:"RGB",pointSize:"ATTENUATION",pointBack:"DARK",pointShape:"CIRCLE",pointScale:.03,pointMaxPixel:40,pointMinPixel:1,gradientTexture:ci,colorSaturation:0,colorBrightness:0};function Tf(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 Pf(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 iu(n,t){var e=!1;for(var r in t)switch(r){case"clippers":Tf(n[r],t[r])||(n[r]=t[r],e=!0);break;case"pano0":case"pano1":Pf(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 Di(n,t,e){return n+(t-n)*e}function Rf(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 Bf(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 Ff(n,t,e,r){var i=r[1]-r[0];return n=ji(n,r),t=ji(t,r),t-n>i/2?Di(n+i,t,e):n-t>i/2?Di(n-i,t,e):Di(n,t,e)}function ji(n,t){var e=t[1]-t[0];return n<t[0]?ji(n+e,t):n>=t[1]?ji(n-e,t):n}function Lf(n,t,e,r){return r?Ff(n,t,e,r):Di(n,t,e)}function gs(n){var t=Number(n);return isNaN(t)||!isFinite(t)?0:t}var Me=function(){function n(t){this.config={},this.progress=1,this.ended=!0,this.value={},this.startTime=he(),this.startVelocity=0,this.duration=0,this.keyframes=[];for(var e in t){var r=t[e];typeof r=="object"?(this.value[e]=gs(r.value),this.config[e]={circle:r.circle}):(this.value[e]=gs(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-Rf(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]=Lf(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:Bf(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:he();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:he(),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}(),kf=500;function Of(n){return-(Math.cos(Math.PI*n)-1)/2}var ar=function(n){se(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.appearMotion=new Me({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,v=a.state.screenSpaceError,A=(s=(o=a.parent)===null||o===void 0?void 0:o.state.screenSpaceError)!==null&&s!==void 0?s:v,h=1;if(a.levelOfContent>a.tileset.minLevelOfDetail&&A!==v&&(h=(A-d)/(A-v)),h=de(h,0,1),h=Of(h),c){var p=1;l.getTargetKeyframe().value.appear!==p&&l.set({appear:p},kf).catch(Q)}else{var p=0;l.getTargetKeyframe().value.appear!==p&&l.set({appear:p},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),Sn=new Set,Df=function(n){se(t,n);function t(){var e=n.call(this)||this;return e.needsRender=!0,e.pbmMaterialParametersVersion=0,e.materialParameters=O({},Ae),e}return t.prototype.getMaterial=function(){return O({},this.materialParameters)},t.prototype.setMaterial=function(e){var r=this;Object.assign(this.materialParameters,e),Sn.clear(),this.traverse(function(i){if(i instanceof Ct)for(var a=0,o=i.material;a<o.length;a++){var s=o[a];Sn.has(s)||(Object.assign(s,r.materialParameters),Sn.add(s))}i instanceof ar&&(Sn.has(i.material)||(Object.assign(i.material,r.materialParameters),Sn.add(i.material)))}),Sn.clear(),this.needsRender=!0},t}(f.Group),Vf=["right","left","up","down","front","back"];function au(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 ou=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:au(n.face,s.x,s.y,r),parent:n,children:[]};n.children.push(u),ou(u,t)}};function zf(n,t){var e={level:0,face:n,position:new f.Vector2(0,0),size:1,box:au(n,0,0,1),parent:null,children:[]};return ou(e,t),e}function io(n){var t=Vf.map(function(e){return zf(e,n)});return{children:t}}function Fo(n,t){for(var e=0,r=n.children;e<r.length;e++){var i=r[e],a=t(i);a!==!1&&Fo(i,t)}}var fi=new f.BoxBufferGeometry(1,1,1,1,1);fi.deleteAttribute("uv");fi.deleteAttribute("normal");fi.groups=[];fi.scale(-1,1,1);var Nf=`
390
+ `,w},typeof n=="string"&&(n.indexOf("-----BEGIN")!=-1?this.readCertPEM(n):ae.lang.String.isHex(n)&&this.readCertHex(n))}Ge.hex2dn=function(n,t){t===void 0&&(t=0);var e=new Ge;le.getTLV(n,t);var r=e.getX500Name(n);return r.str};Ge.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(Ge.hex2attrTypeValue(n,r[i]));return e=e.map(function(a){return a.replace("+","\\+")}),e.join("+")};Ge.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=Rr(u);return s+"="+l};Ge.getPublicKeyFromCertHex=function(n){var t=new Ge;return t.readCertHex(n),t.getPublicKey()};Ge.getPublicKeyFromCertPEM=function(n){var t=new Ge;return t.readCertPEM(n),t.getPublicKey()};Ge.getPublicKeyInfoPropOfCertPEM=function(n){var t=le,e=t.getVbyList,r={},i,a;return r.algparam=null,i=new Ge,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};Ge.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"];function ds(n){return Ee.SHA256(n).toString()}var _0=[function(){var n=new Ge;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]ZN=TN>bRPtTn?bf?FZ_NQtfQc^^YQNq`gdSp?cyZ^P^fQc^^QQNWQ^aRvZPNTP`\0T`Vo@Q^RWN_fapzFqSFwfbOndSnzyuYz[oaPPNvVQ^fWX|gVup[N^ROO^NQttV]NQPPNt|PttVONZU|C\b\\@@e^Xv{[vTtd8`nyO@\x07ebN[bqx=ng? S^w@|XAz|qUTwfzn]Bu<qs_ae\\y<}u`eRAoE`_\\s\0r|b{rp_o<oC@o=x\bw_cUUZPApQevD\\FxFo\x07FgE=<s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nWfR[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 af(n,t){for(var e=0,r=t;e<r.length;e++){var i=r[e];if(i.getSubjectHex()===n)return i}}function X0(n,t){var e=n.getIssuerHex();if(e===n.getSubjectHex())return n.verifySignature(n.getPublicKey());var r=af(e,t);return!r||n.verifySignature(r.getPublicKey())===!1?!1:X0(r,t)}function W0(n){var t=n.getIssuerHex();return t===n.getSubjectHex()?!1:X0(n,_0)}function of(n){var t=new Ge;typeof n=="string"?t.readCertPEM(n):t.readCertHex(n.hex);var e=W0(t);return _0.push(t),e}function sf(n,t,e){var r=new Ge;if(typeof e=="string"?r.readCertPEM(e):r.readCertHex(e.hex),W0(r)===!1)return!1;var i=new Re;return i.readCertPubKeyHex(r.hex,6),!!i.verify(n,Po(t))}of(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_fapzFq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07WadZcAD peXybcW@}Qf\\QNsOt[cU`ZRTQNdtOaAFXw= PCVxsv?{`a\bvS8YQ[aN]Ot[cU_ZONsEROaNQN^U<ZNTN>bqQ^RNVOOwN[Otx\0uxvTF=ON^SNN\\PNtRNrx a[}tP_g8FbD\0^\0qt<f88ufuN]^}]gp\bqYudF88Fas_Ef` ?^x>X}esa{>\\r?eE]CC_cZ[vQs >gX[szONg=^pn=<e]nbSz\bZvac\b[w^nA_`vP|@8w[}nQobe=??oRYf{vpRxcC}yCd>8[NDx{Ne\\t8oou=guC\x07>>g\x07vb}ACd ``Ntq\0yC[Q{|ynpNQqSqzxF<_PFDw<]Bnnu>F<XgU_Zf\\\\A=gu\\codOwQ]oQ<f>gv_pwozwC}xX>C`c]suEdfW?cbeo\b`BbyR@eFTUwSud=t]sS\\onc XSq {\0\x07DvAVBbnTqEE[QzDyqF`bF}R=Q?VeDo<Vzb\0w}D}NZ\0t}^?OyFP\bVaVNrTNYqe?[NRYTSQby@yzWvT`wQo}y]c_WgxBYCy RNRg@\x07NZCaaq8?` ^`?ryD =obzw?E]Ou\x07]n@>bVzqAQT?@_zo@}CxWVTUsAYdNd?{APQr8{P]]AZ>aR\0[D<z?Tr@`u@X|YDwd_<p<>zWE>]\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 to=function(n,t){return to=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])},to(n,t)};function se(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");to(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 Tt(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 Pt(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)}function ea(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 ta(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 dt(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 uf(n){return typeof Symbol=="undefined"?"$Symbol<".concat(n,">$"):Symbol(n)}var Zn=uf("$$FIVE_EVENT$$");function Ci(n){return n[Zn]||(n[Zn]={}),n[Zn]}function lf(n){n[Zn]&&delete n[Zn]}var ra=function(){function n(){}return n.prototype.hasListener=function(t){var e=Ci(this);return e&&e[t]&&e[t].callbacks.length>0},n.prototype.on=function(t,e,r){var i=this,a=Ci(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){lf(this);return}var r=Ci(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=Ci(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],v=d===void 0?!1:d,A=c.apply(void 0,e);v&&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(),he=typeof performance!="undefined"?function(){return cf+performance.now()}:function(){return Date.now()};function Pn(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])&&Pn(n[r])}),n}var hs=/^([^.]+)(\.([^.]+))*$/;function ff(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 mn(n){return/^(([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])(\.(?!$)|$)){4}$/.test(n)}function Yr(n,t){return hs.test(n)&&hs.test(t)&&ff(n,t)}var df=[/\.([0-9a-z]+)\.jsonp([\?\#].*)?$/i,/jsonp_([0-9a-z]+)([\?\#].*)?$/i],vr=Pn(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"))),li=function(n){se(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),On=function(n){se(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){se(t,n);function t(e,r){return n.call(this,"[NETWORK]: request abort(type: ".concat(r,"): ").concat(e))||this}return t})(Error);var ii=function(n){se(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),Ro=function(n){se(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 hf(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 ro(n){for(var t=0,e=df;t<e.length;t++){var r=e[t],i=n.match(r);if(i)return"jsonp_"+i[1]}return null}function ps(n){return ro(n)!==null}function vs(n){var t=n.match(/^([0-9a-z]+\:)\/\/(([^:/?#]*)(?::[0-9]+)?)/);return t?t[1]:location.protocol}function Bo(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 Z0=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(ra);function Fn(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=he(),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=ro(n),c=l?"Script":"XMLHttpRequest",d=new li(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?vr.concat(t.allowHosts):vr.slice(),v=Bo(s),A=ro(s);if(location.hostname.length!==0&&!mn(location.hostname)&&vr.filter(function(L){return Yr(L,location.hostname)}).length===0&&!mn(v)&&d.filter(function(L){return Yr(L,v)}).length===0){var h=A?"Script":"XMLHttpRequest",p=new Ro(s,h,"request host(".concat(v,") is not allowed"));r(p),l(p),(c=t.networkSubscribe)===null||c===void 0||c.emit("network",s,h,"forbidden",p.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 ii(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,B,D=he(),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 N=new On(s,"Script",500);r(N),l(N),(T=t.networkSubscribe)===null||T===void 0||T.emit("network",s,"Script","error",N.message);return}var U=L.split(","),H=(U[0].match(/:(.*?);/)||[])[1],G=U[1];if(t.responseType==="arraybuffer"||t.responseType==="blob"){for(var j=atob(U[1]),J=j.length,X=new Uint8Array(J),Z=0;Z<J;Z++)X[Z]=j.charCodeAt(Z);t.responseType==="arraybuffer"?G=X.buffer:G=new Blob([X],{type:H})}var W={},$={body:G,meta:{origin:o,source:s,requestTime:a,responseTime:D,costs:V,headers:W}};e($),u($),(B=t.networkSubscribe)===null||B===void 0||B.emit("network",s,"Script","ok",JSON.stringify($.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 E=!1,S=new XMLHttpRequest,C=function(){S&&(S.removeEventListener("timeout",R,!1),S.removeEventListener("progress",k,!1),S.removeEventListener("load",M,!1),S.removeEventListener("error",I,!1)),S=null,C=Q},R=function(){var L;if(E!==!0){E=!0,C();var T=new ii(s,"XMLHttpRequest",t.timeout||NaN);r(T),l(T),(L=t.networkSubscribe)===null||L===void 0||L.emit("network",s,"XMLHttpRequest","timeout",T.message)}},k=function(L){E!==!0&&L.lengthComputable&&(L.total<=0||i(L.loaded/L.total))},M=function(L){var T;if(E!==!0){var B=this.status;if(B===0||B>=200&&B<400){E=!0,C();var D=he(),V=D-a,N=hf(this.getAllResponseHeaders()),U=L.total,H={body:this.response,meta:{origin:o,source:s,requestTime:a,responseTime:D,costs:V,headers:N,size:U}};e(H),u(H),(T=t.networkSubscribe)===null||T===void 0||T.emit("network",s,"XMLHttpRequest","ok",JSON.stringify(H.meta))}else I.call(this)}},I=function(){var L;if(E!==!0){E=!0,C();var T=new On(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",R,!1),S.addEventListener("progress",k,!1),S.addEventListener("load",M,!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 pa={};function pf(n,t){t===void 0&&(t={});var e=he(),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 li(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 pa?pa[i]:pa[i]=new Promise(function(a,o){var s,u=t.allowHosts?vr.concat(t.allowHosts):vr.slice(),l=Bo(i);if(location.hostname.length!==0&&!mn(location.hostname)&&vr.filter(function(p){return Yr(p,location.hostname)}).length===0&&!mn(l)&&u.filter(function(p){return Yr(p,l)}).length===0){var c=new Ro(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"),v=!1,A=null;d.onload=function(p){var g;if(A!==null&&(clearTimeout(A),A=null),v!==!0){v=!0,a();var m=he(),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(p){var g;if(A!==null&&(clearTimeout(A),A=null),v!==!0){v=!0;var m=new On(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 p;if(A=null,v!==!0){v=!0,a();var g=he(),m=g-e,y={},b={origin:r,source:i,requestTime:e,responseTime:g,costs:m,headers:y};(p=t.networkSubscribe)===null||p===void 0||p.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 vf(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=he(),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 li(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,v=t.allowHosts?vr.concat(t.allowHosts):vr.slice(),A=Bo(u);if(location.hostname.length!==0&&!mn(location.hostname)&&vr.filter(function(x){return Yr(x,location.hostname)}).length===0&&!mn(A)&&v.filter(function(x){return Yr(x,A)}).length===0){var h=new Ro(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 p=a!=null?a:new Image,g=!1,m=null,y=function(){var x;if(p.onload=Q,p.onerror=Q,m!==null&&(clearTimeout(m),m=null),g!==!0){var w=he(),E={headers:{},origin:s,source:u,requestTime:o,responseTime:w,costs:w-o};g=!0;var S={body:p,meta:E};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(p.onload=Q,p.onerror=Q,m!==null&&(clearTimeout(m),m=null),g!==!0){g=!0;var w=new On(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(p.onload=Q,p.onerror=Q,m=null,g!==!0){g=!0;var w=new ii(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)),p.onload=y,p.onerror=b,i(0),p.src=u})})}var Rt=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 Fn(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 vf(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}(),Ki=new Rt;function de(n,t,e){return n<t?t:n>e?e:n}var no=function(){var n=he();return{requestAnimationFrame:function(t){var e=he(),r=de(16+(e-n),16,33),i=setTimeout(function(){t(e+r)},r);return n=e+r,i},cancelAnimationFrame:function(t){return clearTimeout(t)}}}(),ms=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 no}(),mf=5,As=16,ht=function(){function n(){this.loopType="raf",this.frames=[],this.isAnimating=!1,this.context=null;var t=he();this.loop=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(this.isAnimating!==!1){var i=he(),a=i-t;t=i,As=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,dt([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 As},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 ms.requestAnimationFrame(t);if(this.loopType==="sto")return no.requestAnimationFrame(t)},n.prototype.cancelAnimationFrame=function(t){if(this.context)this.context.cancelAnimationFrame(t);else if(this.loopType==="raf")ms.cancelAnimationFrame(t);else if(this.loopType==="sto")return no.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=mf);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}(),Af={"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"]}},Y0=/^https?\:\/\/?([^\/]+)/;function gf(n){var t=n.match(Y0);return t===null?null:t[1]}function wn(n,t){return n.replace(Y0,function(e,r){return e.slice(0,e.length-r.length)+t})}function yf(n,t,e){var r=t.split("."),i=r[0],a=r.slice(1);if(i==="texture")return wn(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 wn(n,e.pano[0]);case"down":case"right":case"back":return wn(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 wn(n,e.tile[c%2])}else if(i==="model"){var d=a[0],c=Number(d);if(!isNaN(c))return wn(n,e.model[c%2])}return wn(n,e.default[0])}var bf=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},xf=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],v=c[1],A=c[2],h=c[3];o.push("crop,x_".concat(d,",y_").concat(v,",w_").concat(A,",h_").concat(h,",g_nw"))}if(u!==void 0&&u!==100){var p=(e=t.format)!==null&&e!==void 0?e:i;p&&["jpg","webp"].indexOf(p)>=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},En=9007199254740991;function on(n){var t=Math.round(n);return Math.abs(t-n)<.001?t:Math.floor(n)}function wf(n){return n=Object.assign({},n),n.size!==void 0&&(n.size=on(de(n.size,0,En))),n.quality!==void 0&&(n.quality=on(de(n.quality,0,100))),n.cut!==void 0&&(n.cut=[on(de(n.cut[0],0,En)),on(de(n.cut[1],0,En)),on(de(n.cut[2],0,En)),on(de(n.cut[3],0,En))]),n.sharpen!==void 0&&(n.sharpen=on(de(n.sharpen,0,En))),n}function ot(n,t){var e=O(O({},Af),t.mappings),r=gf(n);if(r===null)return n;t=wf(t);var i=e[r];return i?(n=yf(n,t.key,i),/\.basis(\?|$)/.test(n)&&(n=n.replace(/\.basis(\?|$)/,".jpg$1")),i.type==="tencentCloud"?bf(n,t):i.type==="aliyun"?xf(n,t):n):n}function hn(n,t,e){t===void 0&&(t=ot);var r=t(n,e);if(r===n&&e.cut)throw new Error("ImageURL: cut option not applied.");return r}var $0=/\/cube_(\d+)\//;function ai(n){var t=n.match($0);return t?Number(t[1]):null}function Vt(n,t){return n.replace($0,"/cube_".concat(t,"/"))}var Ef="data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAIAAUAmJaQAA3AA/vz0AAA=",Sf="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAAGhbWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAsaWxvYwAAAABEAAACAAEAAAABAAAB3gAAABkAAgAAAAEAAAHJAAAAFQAAAEJpaW5mAAAAAAACAAAAGmluZmUCAAAAAAEAAGF2MDFDb2xvcgAAAAAaaW5mZQIAAAAAAgAAYXYwMUFscGhhAAAAABppcmVmAAAAAAAAAA5hdXhsAAIAAQABAAAA12lwcnAAAACxaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIAAoAAAAAUaXNwZQAAAAAAAAACAAAAAgAAAA5waXhpAAAAAAEIAAAADGF2MUOBABwAAAAAOGF1eEMAAAAAdXJuOm1wZWc6bXBlZ0I6Y2ljcDpzeXN0ZW1zOmF1eGlsaWFyeTphbHBoYQAAAAAeaXBtYQAAAAAAAAACAAEEAQKDBAACBAUGhwgAAAA2bWRhdBIACgQYADLVMgsWQBhhIAQqrNj/+BIACgUYADLEoDIOFkADDDDCQAACDaqCCb4=",Mf="data:image/heif;base64,AAAAGGZ0eXBoZWljAAAAAG1pZjFoZWljAAABL21ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAHBpY3QAAAAAAAAAAAAAAAAAAAAADnBpdG0AAAAAAAEAAAAjaWluZgAAAAAAAQAAABVpbmZlAgAAAAABAABodmMxAAAAAK9pcHJwAAAAkmlwY28AAAB2aHZjQwEBYAAAAAAAAAAAAADwAPz9+PgAACcDoAABAB5AAQwG//8BYAAAAwAAAwAAAwAAAwAAAwAAreTLgSChAAEAI0IBBwFgAAADAAADAAADAAADAAADAAChInJJlreTLySZNdggogABAAdEAcA98DMkAAAAFGlzcGUAAAAAAAAAAgAAAAIAAAAVaXBtYQAAAAAAAAABAAECgQIAAAAiaWxvYwAAAABEQAABAAEAAAAAAU8AAQAAAAAAAAAOAAAAFm1kYXQAAAAKJgGvLvkQwuWM4A==";function va(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 ma=null;function eu(){return ma||(ma=Promise.all([va(Ef),va(Sf),va(Mf)]).then(function(n){return{webp:n[0],avif:n[1],heif:n[2]}}))}var tu=/^(.*)\[(\d+)\]$/;function ze(n){if(!isNaN(n.panoIndex)&&isFinite(n.panoIndex))return"".concat(n.workCode,"[").concat(n.panoIndex,"]");throw new Error("Invalid Pano")}function yt(n){var t=n.match(tu);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 nr(n,t){return ze(n)===ze(t)}function ru(n){return typeof n=="string"&&tu.test(n)}var Cf=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(f.Group),Ct=function(n){se(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),nu=function(n){se(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 Gn(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+=Gn(n[a],!1)+",";return i>-1&&(r+=Gn(n[a],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return Gn(n.toJSON(),t);for(var o=Object.keys(n).sort(),s=o.length,r="",a=0;a<s;){var u=o[a],l=Gn(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 na(n){return"hash::".concat(Gn(n,!1))}var If=function(){function n(t){var e,r,i,a,o,s,u,l,c,d,v,A,h,p,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=(v=t.fragment)===null||v===void 0?void 0:v.mainStart)!==null&&A!==void 0?A:"",mainModelColor:(p=(h=t.fragment)===null||h===void 0?void 0:h.mainModelColor)!==null&&p!==void 0?p:"",mainEnd:(m=(g=t.fragment)===null||g===void 0?void 0:g.mainEnd)!==null&&m!==void 0?m:""}}return n.prototype.getHash=function(){return na({vertex:this.vertex,fragment:this.fragment,defines:this.defines})},n.prototype.onBeforeCompile=function(t,e){},n}(),ci=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}();ci.minFilter=f.NearestFilter;ci.magFilter=f.NearestFilter;ci.wrapS=f.RepeatWrapping;ci.wrapT=f.RepeatWrapping;var Ae={customShaders:[],pano0:null,pano1:null,floorStyle:"OPACITY",shownFloorIndex:-1,modelAlpha:1,opacity:1,progress:0,transition:"FADE",clippers:null,brightness:1,constantColor:null,useEDL:!1,useHQWeight:!1,useHQDepth:!1,pointColor:"RGB",pointSize:"ATTENUATION",pointBack:"DARK",pointShape:"CIRCLE",pointScale:.03,pointMaxPixel:40,pointMinPixel:1,gradientTexture:ci,colorSaturation:0,colorBrightness:0};function Tf(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 Pf(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 iu(n,t){var e=!1;for(var r in t)switch(r){case"clippers":Tf(n[r],t[r])||(n[r]=t[r],e=!0);break;case"pano0":case"pano1":Pf(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 Di(n,t,e){return n+(t-n)*e}function Rf(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 Bf(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 Ff(n,t,e,r){var i=r[1]-r[0];return n=ji(n,r),t=ji(t,r),t-n>i/2?Di(n+i,t,e):n-t>i/2?Di(n-i,t,e):Di(n,t,e)}function ji(n,t){var e=t[1]-t[0];return n<t[0]?ji(n+e,t):n>=t[1]?ji(n-e,t):n}function Lf(n,t,e,r){return r?Ff(n,t,e,r):Di(n,t,e)}function gs(n){var t=Number(n);return isNaN(t)||!isFinite(t)?0:t}var Me=function(){function n(t){this.config={},this.progress=1,this.ended=!0,this.value={},this.startTime=he(),this.startVelocity=0,this.duration=0,this.keyframes=[];for(var e in t){var r=t[e];typeof r=="object"?(this.value[e]=gs(r.value),this.config[e]={circle:r.circle}):(this.value[e]=gs(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-Rf(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]=Lf(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:Bf(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:he();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:he(),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}(),kf=500;function Of(n){return-(Math.cos(Math.PI*n)-1)/2}var ar=function(n){se(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.appearMotion=new Me({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,v=a.state.screenSpaceError,A=(s=(o=a.parent)===null||o===void 0?void 0:o.state.screenSpaceError)!==null&&s!==void 0?s:v,h=1;if(a.levelOfContent>a.tileset.minLevelOfDetail&&A!==v&&(h=(A-d)/(A-v)),h=de(h,0,1),h=Of(h),c){var p=1;l.getTargetKeyframe().value.appear!==p&&l.set({appear:p},kf).catch(Q)}else{var p=0;l.getTargetKeyframe().value.appear!==p&&l.set({appear:p},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),Sn=new Set,Df=function(n){se(t,n);function t(){var e=n.call(this)||this;return e.needsRender=!0,e.pbmMaterialParametersVersion=0,e.materialParameters=O({},Ae),e}return t.prototype.getMaterial=function(){return O({},this.materialParameters)},t.prototype.setMaterial=function(e){var r=this;Object.assign(this.materialParameters,e),Sn.clear(),this.traverse(function(i){if(i instanceof Ct)for(var a=0,o=i.material;a<o.length;a++){var s=o[a];Sn.has(s)||(Object.assign(s,r.materialParameters),Sn.add(s))}i instanceof ar&&(Sn.has(i.material)||(Object.assign(i.material,r.materialParameters),Sn.add(i.material)))}),Sn.clear(),this.needsRender=!0},t}(f.Group),Vf=["right","left","up","down","front","back"];function au(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 ou=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:au(n.face,s.x,s.y,r),parent:n,children:[]};n.children.push(u),ou(u,t)}};function zf(n,t){var e={level:0,face:n,position:new f.Vector2(0,0),size:1,box:au(n,0,0,1),parent:null,children:[]};return ou(e,t),e}function io(n){var t=Vf.map(function(e){return zf(e,n)});return{children:t}}function Fo(n,t){for(var e=0,r=n.children;e<r.length;e++){var i=r[e],a=t(i);a!==!1&&Fo(i,t)}}var fi=new f.BoxBufferGeometry(1,1,1,1,1);fi.deleteAttribute("uv");fi.deleteAttribute("normal");fi.groups=[];fi.scale(-1,1,1);var Nf=`
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
- `,uu=[],di=new f.PerspectiveCamera(90,1,.1,2);di.up.set(0,-1,0);di.lookAt(new f.Vector3(1,0,0));di.updateMatrix();di.matrixAutoUpdate=!1;var hi=new f.PerspectiveCamera(90,1,.1,2);hi.up.set(0,-1,0);hi.lookAt(new f.Vector3(-1,0,0));hi.updateMatrix();hi.matrixAutoUpdate=!1;var pi=new f.PerspectiveCamera(90,1,.1,2);pi.up.set(0,0,1);pi.lookAt(new f.Vector3(0,1,0));pi.updateMatrix();pi.matrixAutoUpdate=!1;var vi=new f.PerspectiveCamera(90,1,.1,2);vi.up.set(0,0,-1);vi.lookAt(new f.Vector3(0,-1,0));vi.updateMatrix();vi.matrixAutoUpdate=!1;var mi=new f.PerspectiveCamera(90,1,.1,2);mi.up.set(0,-1,0);mi.lookAt(new f.Vector3(0,0,1));mi.updateMatrix();mi.matrixAutoUpdate=!1;var Ai=new f.PerspectiveCamera(90,1,.1,2);Ai.up.set(0,-1,0);Ai.lookAt(new f.Vector3(0,0,-1));Ai.updateMatrix();Ai.matrixAutoUpdate=!1;var ys={front:{camera:mi,index:4},back:{camera:Ai,index:5},up:{camera:pi,index:2},down:{camera:vi,index:3},left:{camera:hi,index:1},right:{camera:di,index:0}};function Kf(){var n=uu.pop();return n||new f.ShaderMaterial({uniforms:{map:{value:null},flipY:{value:0}},vertexShader:qf,fragmentShader:Gf,depthTest:!1,depthWrite:!1,stencilWrite:!1,blending:f.NoBlending,lights:!1,toneMapped:!1,fog:!1})}function jf(n){n.uniforms.map.value=null,uu.push(n)}function _f(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=Kf();a.push(c),c.uniforms.map.value=l.texture,c.uniforms.flipY.value=l.flipY?1:0;var d=new f.Group,v=new f.Mesh(Hf,c);v.position.set(l.position.x+l.size.x/2-.5,1-(l.position.y+l.size.y/2)-.5,-.5),v.scale.set(l.size.x,l.size.y,1),d.quaternion.copy(Uf[l.face]),d.add(v),i.add(d)}var A=e.autoClear,h=e.sortObjects,p=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,ys[w].index),e.render(r,ys[w].camera)}),e.setRenderTarget(m),e.autoClear=A,e.sortObjects=h,e.xr.enabled=p;for(var b=0,x=a;b<x.length;b++){var c=x[b];jf(c)}}var Jf=function(){return!1}();function oi(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 so(n){return new Promise(function(t,e){var r=URL.createObjectURL(n),i=oi({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 bs=[];function Xf(n,t){var e=bs.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,bs.push(r)}});return r}function xs(n,t){if(t&&(n.width>t.width||n.height>t.height)){var e=Xf(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 Wf(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 ws=new f.Vector3,sn=["right","left","up","down","front","back"],Ve=function(){function n(t,e,r,i,a){this.tileTree=e,this.tileSources=r,this.options=i,this.renderer=a,this.name="",this.needsRender=!1,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}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&&(oo(this.baseCubeTexture,t,this.renderer),this.baseCubeTexture.dispose(),this.baseCubeTexture=null),this._cubeRenderTarget&&oo(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(p){return p.level===t.level})[0];if(!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,v=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(v),h=O(O({},(s=(o=this.options.imageURL)===null||o===void 0?void 0:o.options)!==null&&s!==void 0?s:{key:"unknown"}),{key:A,size:l.scale>=1?void 0:c*t.size*l.scale,quality:void 0,cut:[c*t.position.x,c*t.position.y,c*t.size,c*t.size]});return 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(p){if(e.disposed){p.body.dispose();return}e.prepareToRender.push({node:t,texture:p.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=[];Fo(this.tileTree,function(p){if(p.level>e||!t.intersectsBox(p.box))return!1;!r.loadedCubeNodes.has(p)&&!r.loadingCubeNodes.has(p)&&o.push(p)}),o.sort(function(p,g){return p.level!==g.level?p.level-g.level:p.box.getCenter(ws).angleTo(i)-g.box.getCenter(ws).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(p,g){return p.node.level-g.node.level});for(var d=[],v=0;v<this.prepareToRender.length;v++){var A=this.prepareToRender[v],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(v,1),v--)}d.length&&(_f(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}(),Nn=function(){function n(){}return n.prototype.loadTexture=function(t,e,r,i,a,o){var s,u,l,c,d,v,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 p=(d=(c=e.imageURL)===null||c===void 0?void 0:c.options)!==null&&d!==void 0?d:{key:"unknown"};t=hn(t,(v=e.imageURL)===null||v===void 0?void 0:v.transform,p);var g=vs(t),m=(A=e.viaAjax)!==null&&A!==void 0?A:Jf,y=ps(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(C){return so(C.body)}).then(function(C){return xs(C,e.maxSize)}).then(function(C){return Object.assign(C,h),C}).then(function(C){var R={meta:x,body:C};return r(R),R}).catch(function(C){return i(C),Promise.reject(C)})}else{var E=null,S;return Promise.resolve().then(function(){return oi()}).then(function(C){return S=C,e.fetcher.loadImage(t,{timeout:e.timeout},void 0,void 0,a,C)}).then(function(C){return E=C.meta,xs(C.body,e.maxSize)}).then(function(C){return Object.assign(C,h),C}).then(function(C){var R={meta:E,body:C};return r(R),R}).catch(function(C){return S&&S.close(),i(C),Promise.reject(C)})}},n.prototype.loadCubeTexture=function(t,e,r,i,a,o){var s,u,l,c,d,v,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 p=[t[sn[0]],t[sn[1]],t[sn[2]],t[sn[3]],t[sn[4]],t[sn[5]]],g=[],m=[0,0,0,0,0,0],y=[],b=function(w){var E=(d=(c=e.imageURL)===null||c===void 0?void 0:c.options)!==null&&d!==void 0?d:{key:"unknown"},S=hn(p[w],(v=e.imageURL)===null||v===void 0?void 0:v.transform,O(O({},E),{key:E.key+"."+sn[w]})),C=vs(S),R=function(D){m[w]=D,a(m.reduce(function(V,N){return V+N},0)/6)},k=(A=e.viaAjax)!==null&&A!==void 0?A:!1,M=/^https?:$/.test(C),I=ps(S);if(I?k=!0:M||(k=!1),k){var L="blob",T=e.fetcher.ajax(S,{timeout:e.timeout,responseType:L},void 0,void 0,R).then(function(D){return y[w]=D.meta,so(D.body)});g.push(T)}else{var B,T=Promise.resolve().then(function(){return oi()}).then(function(V){return B=V,e.fetcher.loadImage(S,{timeout:e.timeout},void 0,void 0,R,V)}).then(function(V){return y[w]=V.meta,V.body}).catch(function(V){return B&&B.close(),Promise.reject(V)});g.push(T)}},x=0;x<6;x++)b(x);return Promise.all(g).then(function(w){return Wf(w)}).then(function(w){return Object.assign(w,O({encoding:f.sRGBEncoding},h)),w}).then(function(w){var E={body:w,meta:y};return r(E),E}).catch(function(w){for(var E=0,S=g;E<S.length;E++){var C=S[E];C.then(function(R){return R.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,v;u.loadCubeTexture(t,{imageURL:{transform:(d=r.imageURL)===null||d===void 0?void 0:d.transform,options:(v=r.imageURL)===null||v===void 0?void 0:v.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,p=A.meta,g=A.body,m=(h=r.tileMaxLevel)!==null&&h!==void 0?h:2,y=Math.max(1024*m,512),b=io(m),x=new Ve(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:p,body:x};i(w),l(w)},function(A){a(A),c(A)},o,s).catch(Q)})},n}();const Zf=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"),Yf=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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H--}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"),$f=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\bv{t-sy|n-V_||sZnxHn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{Hn\bv{t-rp@-cvr]|vv|{H0v{pyqr-Ip|zz|{K0v{pyqr-Il}nlrr\x07K0v{pyqr-I?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-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-Ixv{onrlrr\x07K--0vsqrs-b`RlR[cZN]--0v{pyqr-Iortv{{|znylrr\x07K--0v{pyqr-Iz|}u{|znylrr\x07K--0v{pyqr-Ixv{{|znylrr\x07K--0v{pyqr-Iqrsny{|znylrr\x07K--0r{qvs--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--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-Is|tlrr\x07K--ZNV[lR[Q\f"),ed=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-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-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\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--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--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--0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6----tylSntP|y|-J-rpA5p|{n{P|y|;9-p|{n{P|y|;t9-p|{n{P|y|;o9-|}npv\b6H--0r{qvs--<<-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\b-7-ovtu{rH--<<-JJJJJJJJJJJJJJ--<<-颜色增益调整,在色调映射前--rp@-toP|y|-J-tylSntP|y|;toH--rp@-uP|y|-J-to?u5toP|y|6H--rp@-sv{nyU`c-J-rp@5uP|y|;\x079-uP|y|;\b-8-p|y|`nnv|{9-uP|y|; -8-p|y|Ovtu{r6H--tylSntP|y|;to-J-u?to5sv{nyU`c6H---ZNV[lZ\\QRYlP\\Y\\_--<<色调映射-色彩空间转换--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{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-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"),td=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"),rd=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|z-nz}yrPor-}n{|=lzn}H{vs|z-znA-}n{|=lznv\x07H{vs|z-sy|n-}n{|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}l}nlsntzr{K0v{pyqr-Ir{zn}lp|zz|{l}nlsntzr{K0v{pyqr-Ir{zn}l}nlsntzr{K0v{pyqr-Iporllrsyrpv|{lsntzr{K0v{pyqr-Is|tl}nlsntzr{K0v{pyqr-IoqsK0v{pyqr-Iyvtul}nlortv{K0v{pyqr-Iyvtul}u|{tl}nlsntzr{K0v{pyqr-Iunq|zn}l}nlsntzr{K0v{pyqr-Ioz}zn}l}nlsntzr{K0v{pyqr-I{|znyzn}l}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\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--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--_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--0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6----tylSntP|y|-J-rpA5p|{n{P|y|;9-p|{n{P|y|;t9-p|{n{P|y|;o9-|}npv\b6H--0r{qvs--<<-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\b-7-ovtu{rH--<<-JJJJJJJJJJJJJJ--<<-颜色增益调整,在色调映射前--rp@-toP|y|-J-tylSntP|y|;toH--rp@-uP|y|-J-to?u5toP|y|6H--rp@-sv{nyU`c-J-rp@5uP|y|;\x079-uP|y|;\b-8-p|y|`nnv|{9-uP|y|; -8-p|y|Ovtu{r6H--tylSntP|y|;to-J-u?to5sv{nyU`c6H---ZNV[lZ\\QRYlP\\Y\\_--<<色调映射-色彩空间转换--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{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-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");new f.Vector4;var ga={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),clippers:new f.Uniform([]),shownFloorIndex:new f.Uniform(-1),constantColor:new f.Uniform(null),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)},nd={none:{vertexShader:Zf,fragmentShader:Yf,uniforms:f.UniformsUtils.merge([ga,{opacity:{value:1}},f.UniformsLib.fog]),lights:!1,clipping:!1},basic:{vertexShader:$f,fragmentShader:ed,uniforms:f.UniformsUtils.merge([ga,f.ShaderLib.basic.uniforms]),lights:!1,clipping:!0},phong:{vertexShader:td,fragmentShader:rd,uniforms:f.UniformsUtils.merge([ga,f.ShaderLib.phong.uniforms]),lights:!0,clipping:!0}},Ar=function(n){se(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,v,A,h,p,g,m,y,b,x,w,E,S,C,R,k,M,I,L,T=nd[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_CONSTANT_COLOR:!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_PANO_OPACITY:!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 B,D=null,V=null;return Object.defineProperties(i,{pano0:{get:function(){return D},set:function(N){if(D!==N){D=N,N===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=N.map instanceof Ve?N.map.texture:N.map,this.uniforms.pano0_luminanceMap.value=N.luminanceMap instanceof Ve?N.luminanceMap.texture:N.luminanceMap,this.uniforms.pano0_matrix.value.copy(N.matrix),this.uniforms.pano0_zoom.value=N.zoom);var U=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,H=this.defines.USE_LUMINANCE;H!==U&&(this.defines.USE_LUMINANCE=U,this.needsUpdate=!0)}}},pano1:{get:function(){return V},set:function(N){if(V!==N){V=N,N===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=N.map instanceof Ve?N.map.texture:N.map,this.uniforms.pano1_luminanceMap.value=N.luminanceMap instanceof Ve?N.luminanceMap.texture:N.luminanceMap,this.uniforms.pano1_matrix.value.copy(N.matrix),this.uniforms.pano1_zoom.value=N.zoom);var U=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,H=this.defines.USE_LUMINANCE;H!==U&&(this.defines.USE_LUMINANCE=U,this.needsUpdate=!0)}}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(N){this.uniforms.modelAlpha.value=N}},progress:{get:function(){return this.uniforms.progress.value},set:function(N){this.uniforms.progress.value=N}},transition:{get:function(){return this.defines.USE_BLACK_TRANSITION?"BLACK":this.defines.USE_SPREAD_TRANSITION?"SPREAD":"FADE"},set:function(N){var U=this.defines.USE_BLACK_TRANSITION,H=this.defines.USE_SPREAD_TRANSITION;this.defines.USE_BLACK_TRANSITION=!1,this.defines.USE_SPREAD_TRANSITION=!1,this.defines["USE_".concat(N,"_TRANSITION")]=!0;var G=!1;U!==this.defines.USE_BLACK_TRANSITION&&(G=!0),H!==this.defines.USE_SPREAD_TRANSITION&&(G=!0),G&&(this.needsUpdate=!0)}},constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(N){this.uniforms.constantColor.value=N;var U=this.defines.USE_CONSTANT_COLOR,H=N!==null;U!==H&&(this.defines.USE_CONSTANT_COLOR=H,this.needsUpdate=!0)}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(N){this.uniforms.opacity.value=N}},shownFloorIndex:{get:function(){return this.uniforms.shownFloorIndex.value},set:function(N){this.uniforms.shownFloorIndex.value=N}},brightness:{get:function(){return this.uniforms.brightness.value},set:function(N){this.uniforms.brightness.value=N}},clippers:{get:function(){return B},set:function(N){B!==N&&(B=N,this.uniforms.clippers.value=(B||[]).map(function(U){var H=typeof U.floorIndex=="number"?U.floorIndex:-1,G=new f.Matrix4().getInverse(U.clippingBoxMatrix);return{matrixInverse:G,floorIndex:H}}),this.needsUpdate=!0)}},useEDL:{get:function(){return this.defines.USE_EDL},set:function(N){N!==this.defines.USE_EDL&&(this.defines.USE_EDL=N,this.needsUpdate=!0)}},useHQWeight:{get:function(){return this.defines.USE_HQ_WEIGHT},set:function(N){N!==this.defines.USE_HQ_WEIGHT&&(this.defines.USE_HQ_WEIGHT=N,this.needsUpdate=!0)}},useHQDepth:{get:function(){return this.defines.USE_HQ_DEPTH},set:function(N){N!==this.defines.USE_HQ_DEPTH&&(this.defines.USE_HQ_DEPTH=N,this.needsUpdate=!0)}},floor:{get:function(){return this.uniforms.floor.value},set:function(N){this.uniforms.floor.value=N}},colorSaturation:{get:function(){return this.uniforms.colorSaturation.value},set:function(N){this.uniforms.colorSaturation.value=N}},colorBrightness:{get:function(){return this.uniforms.colorBrightness.value},set:function(N){this.uniforms.colorBrightness.value=N}}}),i.pano0=(a=r.pano0)!==null&&a!==void 0?a:Ae.pano0,i.pano1=(o=r.pano1)!==null&&o!==void 0?o:Ae.pano1,i.modelAlpha=(s=r.modelAlpha)!==null&&s!==void 0?s:Ae.modelAlpha,i.progress=(u=r.progress)!==null&&u!==void 0?u:Ae.progress,i.transition=(l=r.transition)!==null&&l!==void 0?l:Ae.transition,i.constantColor=(c=r.constantColor)!==null&&c!==void 0?c:Ae.constantColor,i.opacity=(d=r.opacity)!==null&&d!==void 0?d:Ae.opacity,i.floorStyle=(v=r.floorStyle)!==null&&v!==void 0?v:Ae.floorStyle,i.shownFloorIndex=(A=r.shownFloorIndex)!==null&&A!==void 0?A:Ae.shownFloorIndex,i.clippers=(h=r.clippers)!==null&&h!==void 0?h:Ae.clippers,i.useEDL=(p=r.useEDL)!==null&&p!==void 0?p:Ae.useEDL,i.useHQWeight=(g=r.useHQWeight)!==null&&g!==void 0?g:Ae.useHQWeight,i.useHQDepth=(m=r.useHQDepth)!==null&&m!==void 0?m:Ae.useHQDepth,i.pointSize=(y=r.pointSize)!==null&&y!==void 0?y:Ae.pointSize,i.pointColor=(b=r.pointColor)!==null&&b!==void 0?b:Ae.pointColor,i.pointShape=(x=r.pointShape)!==null&&x!==void 0?x:Ae.pointShape,i.pointScale=(w=r.pointScale)!==null&&w!==void 0?w:Ae.pointScale,i.pointBack=(E=r.pointBack)!==null&&E!==void 0?E:Ae.pointBack,i.pointMinPixel=(S=r.pointMinPixel)!==null&&S!==void 0?S:Ae.pointMinPixel,i.pointMaxPixel=(C=r.pointMaxPixel)!==null&&C!==void 0?C:Ae.pointMaxPixel,i.gradientTexture=(R=r.gradientTexture)!==null&&R!==void 0?R:Ae.gradientTexture,i.brightness=(k=r.brightness)!==null&&k!==void 0?k:Ae.brightness,i.colorSaturation=(M=r.colorSaturation)!==null&&M!==void 0?M:Ae.colorSaturation,i.colorBrightness=(I=r.colorBrightness)!==null&&I!==void 0?I:Ae.colorBrightness,i.customShaders=(L=r.customShaders)!==null&&L!==void 0?L:Ae.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},""),v=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,v),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 p=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,p),e.fragmentShader=e.fragmentShader.replace(/NUM_CLIPPERS/g,p),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 v=this.customShaders.reduce(function(m,y){return Object.assign(m,y.uniforms)},{}),A=Object.keys(this.customShaderUniforms),h=0,p=A;h<p.length;h++){var g=p[h];delete this.uniforms[g]}this.customShaderUniforms=v,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.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.pointColor=e.pointColor,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 id=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`RlP\\[`aN[alP\\Y\\_6--{vs|z-rp@-p|{n{P|y|H0r{qvs0vs-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--0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6----tylSntP|y|-J-rpA5p|{n{P|y|;9-p|{n{P|y|;t9-p|{n{P|y|;o9-|}npv\b6H--0r{qvs--<<-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--<<提取亮度--rp@-toP|y|-J-tylSntP|y|;toH--rp@-uP|y|-J-to?u5toP|y|6H--rp@-sv{nyU`c-J-rp@5uP|y|;\x079-uP|y|;\b-8-p|y|`nnv|{9-uP|y|; -8-p|y|Ovtu{r6H--tylSntP|y|;to-J-u?to5sv{nyU`c6H--ZNV[lZ\\QRYlP\\Y\\_--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{K--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"),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)}("nvor-rp@-p|y|H0vs-qrsv{rq5b`Rl]\\V[alP\\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{tZv{Hn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{Hn\bv{t-rp@-P|y|Hn\bv{t-sy|n-]|v{`v rH0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6--n\bv{t-rp@-[|znyH0r{qvs0v{pyqr-Ip|zz|{K0v{pyqr-Is|tl}nlrr\x07K0v{pyqr-Iz|}untrl}nlrr\x07K0v{pyqr-Iy|tqr}uosl}nlrr\x07K0v{pyqr-Ipyv}}v{tl}yn{rl}nlrr\x07Krp@-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--sy|n--J-d|yq]|vv|{;\b-<->=;=H--r{-r\x07r?Q5tnqvr{ar\x07r9-rp?59-=;B66;toH\fZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--0v{pyqr-Iortv{lrr\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--rpA-z]|vv|{-J-vrZnv\x07-7-d|yq]|vv|{H--tyl]|vv|{-J-}|wrpv|{Znv\x07-7-z]|vv|{H--0v{pyqr-Iy|tqr}uoslrr\x07K--0v{pyqr-Ipyv}}v{tl}yn{rlrr\x07K--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--<<传递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--0vs-qrsv{rq5b`Rl]\\V[alP\\Y\\_lNYaVabQR6----P|y|-J-trP|y|O\bUrvtu5tnqvr{ar\x07r9-d|yq]|vv|{6H--0ryr----P|y|-J-p|y|H--0r{qvs--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 od=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(null),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)),gi=function(n){se(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,u,l,c,d,v,A,h,p,g,m,y,b,x,w,E,S,C,R,k,M,I=n.call(this,{vertexShader:ad,fragmentShader:id,uniforms:f.UniformsUtils.clone(od),lights:!1,clipping:!0,defines:{USE_CONSTANT_COLOR:!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_PANO_OPACITY:!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;var B=this.defines.USE_CONSTANT_COLOR,D=T!==null;B!==D&&(this.defines.USE_CONSTANT_COLOR=D,this.needsUpdate=!0)}},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(B){var D=typeof B.floorIndex=="number"?B.floorIndex:-1,V=new f.Matrix4().getInverse(B.clippingBoxMatrix);return{matrixInverse:V,floorIndex:D}}),this.needsUpdate=!0)}},pointColor:{get:function(){return this.defines.USE_POINT_COLOR_ALTITUDE===!0?"ALTITUDE":"RGB"},set:function(T){var B=T==="ALTITUDE";this.defines.USE_POINT_COLOR_ALTITUDE!==B&&(this.defines.USE_POINT_COLOR_ALTITUDE=B,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 B=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!==B&&(this.defines.USE_POINT_SIZE_ATTENUATION=B,this.needsUpdate=!0)}},pointShape:{get:function(){return this.defines.USE_POINT_SHAPE_CIRCLE===!0?"CIRCLE":"SQUARE"},set:function(T){var B=T==="CIRCLE";this.defines.USE_POINT_SHAPE_CIRCLE!==B&&(this.defines.USE_POINT_SHAPE_CIRCLE=B,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 B=T==="HIDDEN",D=T==="DARK";this.defines.USE_POINT_BACK_HIDDEN!==B&&(this.defines.USE_POINT_BACK_HIDDEN=B,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:Ae.pano0,I.pano1=(i=e.pano1)!==null&&i!==void 0?i:Ae.pano1,I.modelAlpha=(a=e.modelAlpha)!==null&&a!==void 0?a:Ae.modelAlpha,I.progress=(o=e.progress)!==null&&o!==void 0?o:Ae.progress,I.transition=(s=e.transition)!==null&&s!==void 0?s:Ae.transition,I.constantColor=(u=e.constantColor)!==null&&u!==void 0?u:Ae.constantColor,I.opacity=(l=e.opacity)!==null&&l!==void 0?l:Ae.opacity,I.floorStyle=(c=e.floorStyle)!==null&&c!==void 0?c:Ae.floorStyle,I.shownFloorIndex=(d=e.shownFloorIndex)!==null&&d!==void 0?d:Ae.shownFloorIndex,I.clippers=(v=e.clippers)!==null&&v!==void 0?v:Ae.clippers,I.useEDL=(A=e.useEDL)!==null&&A!==void 0?A:Ae.useEDL,I.useHQWeight=(h=e.useHQWeight)!==null&&h!==void 0?h:Ae.useHQWeight,I.useHQDepth=(p=e.useHQDepth)!==null&&p!==void 0?p:Ae.useHQDepth,I.pointColor=(g=e.pointColor)!==null&&g!==void 0?g:Ae.pointColor,I.pointShape=(m=e.pointShape)!==null&&m!==void 0?m:Ae.pointShape,I.pointSize=(y=e.pointSize)!==null&&y!==void 0?y:Ae.pointSize,I.pointScale=(b=e.pointScale)!==null&&b!==void 0?b:Ae.pointScale,I.pointBack=(x=e.pointBack)!==null&&x!==void 0?x:Ae.pointBack,I.pointMinPixel=(w=e.pointMinPixel)!==null&&w!==void 0?w:Ae.pointMinPixel,I.pointMaxPixel=(E=e.pointMaxPixel)!==null&&E!==void 0?E:Ae.pointMaxPixel,I.gradientTexture=(S=e.gradientTexture)!==null&&S!==void 0?S:Ae.gradientTexture,I.brightness=(C=e.brightness)!==null&&C!==void 0?C:Ae.brightness,I.colorSaturation=(R=e.colorSaturation)!==null&&R!==void 0?R:Ae.colorSaturation,I.colorBrightness=(k=e.colorBrightness)!==null&&k!==void 0?k:Ae.colorBrightness,I.customShaders=(M=e.customShaders)!==null&&M!==void 0?M:Ae.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(p){return p.type.includes("pointcloud")}),s=o.reduce(function(p,g){return p+g.vertex.mainBefore},""),u=o.reduce(function(p,g){return p+g.vertex.mainStart},""),l=o.reduce(function(p,g){return p+g.vertex.mainEnd},""),c=o.reduce(function(p,g){return p+g.fragment.mainBefore},""),d=o.reduce(function(p,g){return p+g.fragment.mainStart},""),v=o.reduce(function(p,g){return p+g.fragment.mainModelColor},""),A=o.reduce(function(p,g){return p+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,v);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(p){p.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 v=this.customShaders.reduce(function(m,y){return Object.assign(m,y.uniforms)},{}),A=Object.keys(this.customShaderUniforms),h=0,p=A;h<p.length;h++){var g=p[h];delete this.uniforms[g]}this.customShaderUniforms=v,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.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.pointColor=e.pointColor,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),cn=function(n){se(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,v=d===void 0?1:d,A=e.pixelRatio,h=A===void 0?1:A,p=e.antialias,g=p===void 0?!1:p,m=e.webgl2,y=e.logarithmicDepthBuffer,b=e.precision,x=e.powerPreference,w=this,E={antialias:g,alpha:!0,depth:!0,preserveDrawingBuffer:i,stencil:u,premultipliedAlpha:o,powerPreference:x},S={logarithmicDepthBuffer:y,precision:b};if(m){var C=document.createElement("canvas"),R=C.getContext("webgl2",E);R?w=n.call(this,O(O(O({},E),S),{antialias:!0,canvas:C,context:R}))||this:(console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."),w=n.call(this,O(O({},E),S))||this)}else w=n.call(this,O(O({},E),S))||this;return w.setPixelRatio(h),w.setClearColor(c,v),w.outputEncoding=f.sRGBEncoding,w.autoClear=!0,w}return t}(f.WebGLRenderer),lu=function(n){se(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 Qt(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 sd=1,ud=.1,ld=2e3,Ii=Math.PI*2,Es=Math.PI/2;function ya(n){return n>0&&n<=Ii?n:(n%Ii+Ii)%Ii}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 cu=function(n){se(t,n);function t(e,r,i,a,o,s,u){r===void 0&&(r=sd),i===void 0&&(i=ud),a===void 0&&(a=ld),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}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 Qt(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(de(r[9],-1,1)),Math.abs(r[9])<.9999999?this.pose.longitude=ya(Math.atan2(r[8],r[10])):this.pose.longitude=ya(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=ya((r=e.longitude)!==null&&r!==void 0?r:this.pose.longitude),l=Math.max(-Es+1e-4,Math.min(Es-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,v=(s=e.offset)!==null&&s!==void 0?s:this.pose.offset,A=Qt({longitude:u,latitude:l}).normalize();return this.position.set(0,0,0),this.lookAt(A),this.position.add(v).sub(A.clone().setLength(d)),this.fov!==c&&(this.fov=c,this.updateProjectionMatrix()),this.updateMatrixWorld(),this.pose.longitude=u,this.pose.latitude=l,this.pose.fov=c,this.pose.distance=d,this.pose.offset.copy(v),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(he()),this},t}(f.Camera),gt;(function(n){n[n.Outside=-1]="Outside",n[n.Intersecting=0]="Intersecting",n[n.Inside=1]="Inside"})(gt||(gt={}));var fu=1e-6,Ne=new f.Vector3,Jr=new f.Matrix4,Vr=new f.Vector3,zr=new f.Vector3,Nr=new f.Vector3,uo=new f.Vector3,ba=new f.Box3,xa=new f.Sphere,Ss=new f.Matrix4,wa=new f.Ray,mt=new f.Object3D,Ms=new f.Frustum;function du(n,t){var e=n.elements;return t.setFromRotationMatrix(Jr.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 Yn=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 Jr.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),Ms.setFromProjectionMatrix(Jr),this.setFromFrustum(Ms),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=gt.Inside,r=0,i=this.planes;r<i.length;r++){var a=i[r],o=t.intersectPlane(a);switch(o){case gt.Outside:return gt.Outside;case gt.Intersecting:e=gt.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===gt.Outside)return n.MASK_OUTSIDE;u===gt.Intersecting&&(r|=o)}}return r},n}(),hu=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],v=Math.sqrt(r*r+i*i+a*a),A=Math.sqrt(o*o+s*s+u*u),h=Math.sqrt(l*l+c*c+d*d);this.halfSize.set(v,A,h);var p=this.halfSize.toArray().reduce(function(g,m){return g+m},0);return(isNaN(p)||p<=0)&&this.halfSize.setScalar(fu),this.rotation.fromArray([r/v,i/v,a/v,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(Vr,zr,Nr),{box:dt(dt(dt(dt([],this.center.toArray(),!0),Vr.multiplyScalar(this.halfSize.x).toArray(),!0),zr.multiplyScalar(this.halfSize.y).toArray(),!0),Nr.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 mt.position.copy(this.center),du(this.rotation,mt.quaternion),mt.scale.copy(this.halfSize),mt.matrix.compose(mt.position,mt.quaternion,mt.scale),mt.matrix.premultiply(t),mt.matrix.decompose(mt.position,mt.quaternion,mt.scale),this.center.copy(mt.position),this.rotation.setFromMatrix4(Jr.makeRotationFromQuaternion(mt.quaternion)),this.halfSize.copy(mt.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(Vr,zr,Nr),Vr.setLength(this.halfSize.x),zr.setLength(this.halfSize.y),Nr.setLength(this.halfSize.z),t.expandByPoint(Ne.copy(this.center).add(Vr)),t.expandByPoint(Ne.copy(this.center).sub(Vr)),t.expandByPoint(Ne.copy(this.center).add(zr)),t.expandByPoint(Ne.copy(this.center).sub(zr)),t.expandByPoint(Ne.copy(this.center).add(Nr)),t.expandByPoint(Ne.copy(this.center).sub(Nr)),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);Ne.set(this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,0),Ne.set(-this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,3),Ne.set(-this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,6),Ne.set(this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,9),Ne.set(this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,12),Ne.set(-this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,15),Ne.set(-this.halfSize.x,-this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,18),Ne.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?gt.Outside:c>=l?gt.Inside:gt.Intersecting},n.prototype.intersectRay=function(t,e){if(uo.copy(this.halfSize).multiplyScalar(2),ba.setFromCenterAndSize(Ne.set(0,0,0),uo),this.rotation.extractBasis(Vr,zr,Nr),Jr.makeBasis(Vr,zr,Nr),Jr.setPosition(this.center),Ss.getInverse(Jr),wa.copy(t).applyMatrix4(Ss),ba.containsPoint(wa.origin))return!0;var r=wa.intersectBox(ba,Ne);return r?e!==void 0?r.applyMatrix4(Jr).distanceTo(t.origin)<e:!0:!1},n}(),pu=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],fu),this},n.prototype.toJson=function(){return{sphere:dt(dt([],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,uo.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?gt.Outside:a<r?gt.Intersecting:gt.Inside},n.prototype.intersectRay=function(t,e){if(xa.set(this.center,this.radius),xa.containsPoint(t.origin))return!0;var r=t.intersectSphere(xa,Ne);return r?e!==void 0?t.origin.distanceTo(r)<e:!0:!1},n}(),fd=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 Vi(n){if("box"in n)return new hu().fromJson(n);if("sphere"in n)return new pu().fromJson(n);if("region"in n)return new fd().fromJson(n);throw new Error("BoundingVolume ".concat(JSON.stringify(n)," never suppored."))}var Ti=[4821759,8191922,16637280,16739958,5822969,376977,16747077,9259235,14514687].map(function(n){return new f.LineBasicMaterial({color:n,depthWrite:!1,depthTest:!1,transparent:!0})}),dd=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);Ne.set(1,1,1).toArray(t,0),Ne.set(-1,1,1).toArray(t,3),Ne.set(-1,-1,1).toArray(t,6),Ne.set(1,-1,1).toArray(t,9),Ne.set(1,1,-1).toArray(t,12),Ne.set(-1,1,-1).toArray(t,15),Ne.set(-1,-1,-1).toArray(t,18),Ne.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}(),hd=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 pd(n,t){if(n instanceof hu){var e=new f.LineSegments(dd,Ti[Math.min(t,Ti.length-1)]);return e.position.copy(n.center),du(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 pu){var e=new f.LineSegments(hd,Ti[Math.min(t,Ti.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 vd=new f.Vector3,ko=function(){function n(t,e,r,i){var a=this,o,s,u,l;this.parent=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.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:he(),loadfailRetryDelay:0,byteLength:0},e.content.group!==void 0&&(this.content.group=e.content.group),e.content.boundingVolume&&(this.content.boundingVolume=Vi(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=Vi(e.boundingVolume).applyMatrix4(this.transform)),e.viewerRequestVolume&&(this.viewerRequestVolume=Vi(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=pd(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(vd).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:Yn.MASK_INDETERMINATE;this.state.visibilityPlaneMask=t.cullingVolume.computeVisibilityWithPlaneMask(r,o),this.state.visible=this.state.visibilityPlaneMask!==Yn.MASK_OUTSIDE}else this.state.distanceToCamera=0,this.state.centerZDepth=0,this.state.visibilityPlaneMask=Yn.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=Math.max(e,.001),u=o*t.height/(s*t.sseDenominator);return u},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}();function Cs(n){var t=n.refine==="ADD"||n.tileset.skipLevelOfDetail,e=n.parent,r=e&&(!t||n.state.screenSpaceError===0),i=r?e.state.screenSpaceError:n.state.screenSpaceError,a=n.tileset.root?n.tileset.root.state.screenSpaceError:0,o=Math.max(a-i,0);return o}var vu=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(h){o.push({tile:h,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(e){case"SCREEN_SPACE_ERROR":{var d=new Map;o.sort(function(h,p){if(h.tile.state.requestedFrameNumber!==p.tile.state.requestedFrameNumber)return p.tile.state.requestedFrameNumber-h.tile.state.requestedFrameNumber;if(h.tile.state.requestedFrameNumber===r.frameNumber){var g=d.get(h.tile.id);g===void 0&&(g=Cs(h.tile),d.set(h.tile.id,g));var m=d.get(p.tile.id);return m===void 0&&(m=Cs(p.tile),d.set(p.tile.id,m)),g-m}else return h.tile.level!==p.tile.level?h.tile.level-p.tile.level:h.tile.state.distanceToCamera-p.tile.state.distanceToCamera});break}case"SCREEN_VERTICAL":{o.sort(function(h,p){return h.tile.state.requestedFrameNumber!==p.tile.state.requestedFrameNumber?p.tile.state.requestedFrameNumber-h.tile.state.requestedFrameNumber:h.tile.state.requestedFrameNumber===r.frameNumber?h.tile.state.centerScreenY!==p.tile.state.centerScreenY?h.tile.state.centerScreenY-p.tile.state.centerScreenY:h.tile.state.centerZDepth!==p.tile.state.centerZDepth?h.tile.state.centerZDepth-p.tile.state.centerZDepth:h.tile.level!==p.tile.level?h.tile.level-p.tile.level:h.tile.state.distanceToCamera-p.tile.state.distanceToCamera:h.tile.level!==p.tile.level?h.tile.level-p.tile.level:h.tile.state.distanceToCamera-p.tile.state.distanceToCamera});break}case"SCREEN_LEVEL_VERTICAL":{o.sort(function(h,p){return h.tile.state.requestedFrameNumber!==p.tile.state.requestedFrameNumber?p.tile.state.requestedFrameNumber-h.tile.state.requestedFrameNumber:h.tile.state.requestedFrameNumber===r.frameNumber?h.tile.level!==p.tile.level?h.tile.level-p.tile.level:h.tile.state.centerScreenY!==p.tile.state.centerScreenY?h.tile.state.centerScreenY-p.tile.state.centerScreenY:h.tile.state.centerZDepth!==p.tile.state.centerZDepth?h.tile.state.centerZDepth-p.tile.state.centerZDepth:h.tile.state.distanceToCamera-p.tile.state.distanceToCamera:h.tile.level!==p.tile.level?h.tile.level-p.tile.level:h.tile.state.distanceToCamera-p.tile.state.distanceToCamera});break}}c=Math.max(this.tileset.maxRequests-this.activeRequests,0);for(var v=function(h){var p=o[h];p.status==="WAITING"&&(c--,p.status="PENDING",p.time=a,A.activeRequests++,A.tileset.options.tileLoader(p.tile).catch(function(g){p.error=g}).then(function(){p.status="DONE",p.tile.content&&p.tile.content.loadState==="READY"&&(p.tile.content.loadState="LOADING"),i.activeRequests--}))},A=this,u=0;u<o.length&&c>0;u++)v(u)},n}(),md=function(){function n(t,e,r){this.item=t,this.previous=e,this.next=r}return n}(),Ad=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 md(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}(),mu=function(){function n(t){t===void 0&&(t={}),this.options=t,this.cacheNodeMap=new Map,this.list=new Ad,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}(),Xr=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}(),Oo=function(){function n(t){this.tileset=t,this._canSelectTile=!0,this._loadAllTilesTraversalStack=new Xr,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.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}(),gd=function(n){se(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r._traversalStack=new Xr,r._emptyTraversalStack=new Xr,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,v=0,A=a;v<A.length;v++){var u=A[v];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}(Oo),yd=function(n){se(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 Xr,r._descendantTraversalStack=new Xr,r._selectionTraversalStack=new Xr,r._selectionTraversalancestorStack=new Xr,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 v=d[c];v.state.visible&&i.push(v)}}}},t}(Oo),bd=function(n){se(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r._traversalStack=new Xr,r}return t.prototype.canTraverse=function(e,r){return!(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}(Oo),Is=[5635925,5592575,16733525],Au=function(){function n(t,e,r){var i;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,color:new f.Color((i=e.color)!==null&&i!==void 0?i:Is[t%Is.length]),byteLength:0,loadState:"UNLOADED",loadStateUpdateTime:he(),loadfailRetryDelay:0,data:void 0}}return n}(),xd=new f.Matrix4,Cr=function(){function n(t,e,r){var i=this,a,o,s,u,l,c,d,v,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:[]},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=(v=this.rootMeta.numFloors)!==null&&v!==void 0?v: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 gd(this),this.skipTraverser=new yd(this),this.mostDetailTraverser=new bd(this),this.cache=new mu({onTileLoad:function(g){i.memoryUsageInBytes+=g.contentByteLength},onTileUnload:function(g){i.memoryUsageInBytes-=g.contentByteLength,i.unloadTiles.push(g)}}),this.requestScheduler=new vu(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 ko("".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 p=new Au(h,this.asset.trajectories[h],this);this.trajectories.push(p)}}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(xd),this.traverser.traverse(this.root,t,e),this.cache.unloadTiles(function(){var v=r.memoryUsageInBytes>r.maxMemoryUsage*1024*1024;return v}),this.requestScheduler.update(this.requestedTiles,this.tileRequestOrder,t);for(var a=function(){var v=o.unloadTiles.pop();v&&(o.loadedTiles.delete(v),o.options.tileUnloader(v).catch(function(){}).then(function(){r.options.onTileUnload&&r.options.onTileUnload(v)}))},o=this;this.unloadTiles.length;)a();this.selectedTrajectories.length=0;for(var s=function(v){v.visible===!0&&v.content.loadState==="READY"&&(!((i=v.content.data)===null||i===void 0)&&i.object)?u.selectedTrajectories.push(v):v.visible===!0&&(v.content.loadState==="FAILED"&&t.time-v.content.loadStateUpdateTime>v.content.loadfailRetryDelay&&(v.content.loadState="UNLOADED",v.content.loadStateUpdateTime=t.time),v.content.loadState==="UNLOADED"&&u.options.trajectoryLoader(v).then(function(){r.options.onTrajectoryLoad(v)}).catch(function(A){r.options.onTrajectoryError(v,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}(),gu=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,v=(i=s.offset)!==null&&i!==void 0?i:0;l=c[t*d+v]}var A=u.array,h=(a=u.stride)!==null&&a!==void 0?a:3,p=(o=u.offset)!==null&&o!==void 0?o:0;return l=l*h+p,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}(),Ln=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}(),Pr=6*4+4+4+2+2;function yu(n,t){for(var e=new ArrayBuffer(t*Pr),r=new Float32Array(e),i=new Uint32Array(e),a=new Uint16Array(e),o=[n],s,u;s=o.pop();)u=s.id*Pr/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*Pr/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 bu(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,v=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,v=(o-n.y)*t.y):(d=(o-n.y)*t.y,v=(r-n.y)*t.y),!(l>v||d>c||(d>l&&(l=d),v<c&&(c=v),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 An=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}(),xu=function(){function n(t,e,r){this.triangle=t,this.intersectionPoint=e,this.index=r}return n}(),Ts=1e-6,He=new An(0,0,0),Qr=new An(0,0,0),Ur=new An(0,0,0),Hr=new An(0,0,0),wu=function(n){se(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,v=0,A=0,h=void 0,p=void 0,g=void 0,m=void 0,y=void 0,b=void 0,x=void 0;d<a;d+=1,v+=3,A+=6)o[d]=d,this.getPositionByIndex(v,Qr),this.getPositionByIndex(v+1,Ur),this.getPositionByIndex(v+2,Hr),h=m=Qr.x,x=Ur.x,x<h&&(h=x),x>m&&(m=x),x=Hr.x,x<h&&(h=x),x>m&&(m=x),p=y=Qr.y,x=Ur.y,x<p&&(p=x),x>y&&(y=x),x=Hr.y,x<p&&(p=x),x>y&&(y=x),g=b=Qr.z,x=Ur.z,x<g&&(g=x),x>b&&(b=x),x=Hr.z,x<g&&(g=x),x>b&&(b=x),s[A]=h,s[A+1]=p,s[A+2]=g,s[A+3]=m,s[A+4]=y,s[A+5]=b;else{for(var w=1/0,E=1/0,S=1/0,C=-1/0,R=-1/0,k=-1/0,d=0,v=0,A=0,h=void 0,p=void 0,g=void 0,m=void 0,y=void 0,b=void 0,x=void 0;d<a;d+=1,v+=3,A+=6)o[d]=d,this.getPositionByIndex(v,Qr),this.getPositionByIndex(v+1,Ur),this.getPositionByIndex(v+2,Hr),h=m=Qr.x,x=Ur.x,x<h&&(h=x),x>m&&(m=x),x=Hr.x,x<h&&(h=x),x>m&&(m=x),p=y=Qr.y,x=Ur.y,x<p&&(p=x),x>y&&(y=x),x=Hr.y,x<p&&(p=x),x>y&&(y=x),g=b=Qr.z,x=Ur.z,x<g&&(g=x),x>b&&(b=x),x=Hr.z,x<g&&(g=x),x>b&&(b=x),s[A]=h,s[A+1]=p,s[A+2]=g,s[A+3]=m,s[A+4]=y,s[A+5]=b,h<w&&(w=h),m>C&&(C=m),p<E&&(E=p),y>R&&(R=y),g<S&&(S=g),b>k&&(k=b);i=[w,E,S,C,R,k]}var M=new Ln(++c,i,0,a,0);u[l++]=M;var I=[],L=[0,1,2],T=function(D,V){return I[V]-I[D]};function B(D){var V=D.startIndex,N=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 H=0;H<3;H++){for(var G=L[H],j=U[G]+U[G+3],_=V,X=N-1,Z=-1,W=void 0;_<=X;)Z===-1?(W=o[_],s[W*6+G]+s[W*6+G+3]<j?_++:Z=W):(W=o[X],s[W*6+G]+s[W*6+G+3]>=j||(o[_]=W,o[X]=Z,Z=-1,_++),X--);if(_>V&&_<N){var $=new Ln(++c,Ps(o,s,V,_,Ts),V,_,D.deepth+1);$.deepth<r&&$.endIndex-$.startIndex>e&&(u[l++]=$);var Y=new Ln(++c,Ps(o,s,_,N,Ts),_,N,D.deepth+1);Y.deepth<r&&Y.endIndex-Y.startIndex>e&&(u[l++]=Y),D.node0=$,D.node1=Y,D.startIndex=0,D.endIndex=0;break}}}for(;l;)B(u[--l]);return this.offsetArray=o,this.rootNodePacked=yu(M,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,v,A,h;(d=l.pop())!==void 0;){h=d*Pr/4;var p=Ea(e.x,o[h],o[h+3])-e.x,g=Ea(e.y,o[h+1],o[h+4])-e.y,m=Ea(e.z,o[h+2],o[h+5])-e.z;if(p*p+g*g+m*m<=r*r){for(var y=s[h+6];y<s[h+7];y++)c.push(i[y]);h=d*Pr/2,v=u[h+16],A=u[h+17],v&&l.push(v),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,He),x[y*9]=He.x,x[y*9+1]=He.y,x[y*9+2]=He.z,this.getPositionByIndex(w+1,He),x[y*9+3]=He.x,x[y*9+4]=He.y,x[y*9+5]=He.z,this.getPositionByIndex(w+2,He),x[y*9+6]=He.x,x[y*9+7]=He.y,x[y*9+8]=He.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 An(1/r.x,1/r.y,1/r.z),v=[0],A,h,p,g;(A=v.pop())!==void 0;)if(g=A*Pr/4,bu(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,E=e.x,S=e.y,C=e.z,R=r.x,k=r.y,M=r.z,I=void 0,L=void 0,T=void 0,B=void 0,D=void 0,V=void 0,N=void 0,U=void 0,H=void 0,G=void 0,j=void 0,_=void 0,X=void 0,Z=void 0,W=void 0,$=void 0,Y=void 0,ne=void 0,te=void 0,ue=void 0,ie=void 0,ge=void 0,pe=void 0,ye=void 0,Be=void 0,Se=void 0,Te=void 0;m<y;m++){if(b=o[m],x=b*3,this.getPositionByIndex(x,He),I=He.x,L=He.y,T=He.z,this.getPositionByIndex(x+1,He),B=He.x,D=He.y,V=He.z,this.getPositionByIndex(x+2,He),N=He.x,U=He.y,H=He.z,G=B-I,j=D-L,_=V-T,X=N-I,Z=U-L,W=H-T,$=j*W-_*Z,Y=_*X-G*W,ne=G*Z-j*X,pe=R*$+k*Y+M*ne,pe>0)ge=1;else if(pe<0)ge=-1,pe=-pe;else continue;te=E-I,ue=S-L,ie=C-T,ye=ge*(R*(ue*W-ie*Z)+k*(ie*X-te*W)+M*(te*Z-ue*X)),!(ye<0)&&(Be=ge*(R*(j*ie-_*ue)+k*(_*te-G*ie)+M*(G*ue-j*te)),!(Be<0)&&(ye+Be>pe||(Se=-ge*(te*$+ue*Y+ie*ne),!(Se<0)&&(Te=Se/pe,a.push(new xu([I,L,T,B,D,V,N,U,H],[E+R*Te,S+k*Te,C+M*Te],b))))))}g=A*Pr/2,h=c[g+16],p=c[g+17],h&&v.push(h),p&&v.push(p)}return a},t}(gu);function Ea(n,t,e){return n<t?t:n>e?e:n}function Ps(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,v=void 0,A=void 0;d<r;d++)v=n[d]*6,A=t[v],A<a&&(a=A),A=t[v+1],A<o&&(o=A),A=t[v+2],A<s&&(s=A),A=t[v+3],A>u&&(u=A),A=t[v+4],A>l&&(l=A),A=t[v+5],A>c&&(c=A);return[a-i,o-i,s-i,u+i,l+i,c+i]}var Rs=1e-6,wd=["x","y","z"],ct=new An(0,0,0),Eu=function(n){se(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,ct);for(var v=ct.x,A=ct.y,h=ct.z,p=v,g=A,m=h,d=0,y=void 0,b=void 0,x=void 0;d<o;d+=1)s[d]=d,a(d,ct),y=ct.x,b=ct.y,x=ct.z,y<v?v=y:y>p&&(p=y),b<A?A=b:b>g&&(g=b),x<h?h=x:x>m&&(m=x);i=[v,A,h,p,g,m]}var w=new Ln(++c,i,0,o,0);u[l++]=w;var E=[],S=[0,1,2],C=function(k,M){return E[M]-E[k]};function R(k){var M=k.startIndex,I=k.endIndex,L=k.extents;E[0]=L[3]-L[0],E[1]=L[4]-L[1],E[2]=L[5]-L[2];for(var T=S.sort(C)[0],B=wd[T],D=(L[T]+L[T+3])/2,V=M,N=I-1,U=-1,H;V<=N;)U===-1?(H=s[V],a(H,ct),ct[B]<D?V++:U=H):(H=s[N],a(H,ct),ct[B]>=D||(s[V]=H,s[N]=U,U=-1,V++),N--);if(V>M){var G=L.slice();G[T+3]=D+Rs;var j=new Ln(++c,G,M,V,k.deepth+1);j.deepth<r&&j.endIndex-j.startIndex>e&&(u[l++]=j),k.node0=j}if(I>V){var _=L.slice();_[T]=D-Rs;var X=new Ln(++c,_,V,I,k.deepth+1);X.deepth<r&&X.endIndex-X.startIndex>e&&(u[l++]=X),k.node1=X}k.startIndex=0,k.endIndex=0}for(;l;)R(u[--l]);return this.offsetArray=s,this.rootNodePacked=yu(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,v=new An(1/r.x,1/r.y,1/r.z),A=[0],h,p,g,m;(h=A.pop())!==void 0;)if(m=h*Pr/4,bu(e,v,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,E=void 0,S=void 0,C=void 0,R=void 0,k=void 0,M=void 0,I=void 0,L=void 0,T=void 0,B=void 0;y<b;y++)x=o[y],this.getPositionByIndex(x,ct),w=ct.x,E=ct.y,S=ct.z,C=e.x,R=e.y,k=e.z,M=r.x,I=r.y,L=r.z,T=M*(w-C)+I*(E-R)+L*(S-k),T>0&&(C+=M*T,R+=I*T,k+=L*T),M=w-C,I=E-R,L=S-k,T=M*M+I*I+L*L,T<=d&&a.push(new xu([w,E,S,w,E,S,w,E,S],[C,R,k],x));m=h*Pr/2,p=c[m+16],g=c[m+17],p&&A.push(p),g&&A.push(g)}return a},t}(gu);const Su="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBlcj1mdW5jdGlvbihlLHIpe3JldHVybiBlcj1PYmplY3Quc2V0UHJvdG90eXBlT2Z8fHtfX3Byb3RvX186W119aW5zdGFuY2VvZiBBcnJheSYmZnVuY3Rpb24odCxvKXt0Ll9fcHJvdG9fXz1vfXx8ZnVuY3Rpb24odCxvKXtmb3IodmFyIGYgaW4gbylPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwobyxmKSYmKHRbZl09b1tmXSl9LGVyKGUscil9O2Z1bmN0aW9uIGhyKGUscil7aWYodHlwZW9mIHIhPSJmdW5jdGlvbiImJnIhPT1udWxsKXRocm93IG5ldyBUeXBlRXJyb3IoIkNsYXNzIGV4dGVuZHMgdmFsdWUgIitTdHJpbmcocikrIiBpcyBub3QgYSBjb25zdHJ1Y3RvciBvciBudWxsIik7ZXIoZSxyKTtmdW5jdGlvbiB0KCl7dGhpcy5jb25zdHJ1Y3Rvcj1lfWUucHJv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JuIHIueD49MD8odT0odC1lLngpKnIueCx3PShkLWUueCkqci54KToodT0oZC1lLngpKnIueCx3PSh0LWUueCkqci54KSxyLnk+PTA/KHk9KG8tZS55KSpyLnkscD0odi1lLnkpKnIueSk6KHk9KHYtZS55KSpyLnkscD0oby1lLnkpKnIueSksISh1PnB8fHk+d3x8KHk+dSYmKHU9eSkscDx3JiYodz1wKSxyLno+PTA/KGE9KGYtZS56KSpyLnosaD0obi1lLnopKnIueik6KGE9KG4tZS56KSpyLnosaD0oZi1lLnopKnIueiksdT5ofHxhPncpfHwoYT51JiYodT1hKSxoPHcmJih3PWgpLHc8MCkpfXZhciBZPWZ1bmN0aW9uKCl7ZnVuY3Rpb24gZShyLHQsbyl7dGhpcy54PXIsdGhpcy55PXQsdGhpcy56PW99cmV0dXJuIGUucHJvdG90eXBlLmNvcHk9ZnVuY3Rpb24ocil7cmV0dXJuIHRoaXMueD1yLngsdGhpcy55PXIueSx0aGlzLno9ci56LHRoaXN9LGUucHJvdG90eXBlLnNldD1mdW5jdGlvbihyLHQsbyl7cmV0dXJuIHRoaXMueD1yLHRoaXMueT10LHRoaXMuej1vLHRoaXN9LGUucHJvdG90eXBlLmZyb21BcnJheT1mdW5jdGlvbihyLHQpe3JldHVybiB0PT09dm9pZCAwJiYodD0wKSx0aGlzLng9clt0XSx0aGlzLnk9clt0KzFdLHRoaXMuej1yW3QrMl0sdGhpc30sZS5wcm90b3R5cGUudG9BcnJheT1mdW5jdGlvbihyLHQpe3JldHVybiByPT09dm9pZCAwJiYocj1bXSksdD09PXZvaWQgMCYmKHQ9MCksclt0XT10aGlzLngsclt0KzFdPXRoaXMueSxyW3QrMl09dGhpcy56LHJ9LGUucHJvdG90eXBlLmFkZD1mdW5jdGlvbihyKXtyZXR1cm4gdGhpcy54Kz1yLngsdGhpcy55Kz1yLnksdGhpcy56Kz1yLnosdGhpc30sZS5wcm90b3R5cGUubXVsdGlwbHlTY2FsYXI9ZnVuY3Rpb24ocil7cmV0dXJuIHR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2VvZiBBcnJheUJ1ZmZlciYmby5hZGQodS5idWZmZXIpLG8uYWRkKHMucm9vdE5vZGVQYWNrZWQpfXJldHVybntvdXRwdXQ6dCx0cmFuc2ZlcjpBcnJheS5mcm9tKG8pfX0pfSl9KSgpOwo=",Ed=n=>Uint8Array.from(atob(n),t=>t.charCodeAt(0)),Bs=typeof self!="undefined"&&self.Blob&&new Blob([Ed(Su)],{type:"text/javascript;charset=utf-8"});function Sd(n){let t;try{if(t=Bs&&(self.URL||self.webkitURL).createObjectURL(Bs),!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,"+Su,{name:n==null?void 0:n.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var Mu=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}(),Md=new Mu(function(){return new Sd},4),Cd=new Map,kn=new f.Ray,Fs=new f.Matrix3,$n=new f.Matrix4,Cu=new f.Vector3,Id=new f.Vector3,Td=new f.Vector3,Pd=new f.Triangle;function Rd(n,t,e,r){var i,a=n.matrixWorld;$n.getInverse(a),kn.copy(e.ray).applyMatrix4($n);for(var o=t.intersectRay(kn.origin,kn.direction,0,[]),s=n.geometry,u=n.material,l=s.groups,c=s.index,d=0,v=o.length;d<v;d++){var A=o[d],h=A.triangle,p=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=p*3,w=0,E=l;w<E.length;w++){var S=E[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 C=Pd.set(Cu.set(h[0],h[1],h[2]).applyMatrix4(a),Id.set(h[3],h[4],h[5]).applyMatrix4(a),Td.set(h[6],h[7],h[8]).applyMatrix4(a)).getNormal(new f.Vector3),R=p*3,k=new f.Face3(c?c.array[R]:R,c?c.array[R+1]:R+1,c?c.array[R+2]:R+2,C),M=e.ray.direction.dot(C);b.side===f.FrontSide&&M>=0||b.side===f.BackSide&&M<=0||r.push({distance:y,object:n,face:k,point:m,distanceToRay:0,faceIndex:p})}}}}function Bd(n,t,e,r){var i,a,o=n.matrixWorld;Fs.getNormalMatrix(o),$n.getInverse(o);var s=((a=(i=e.params.Points)===null||i===void 0?void 0:i.threshold)!==null&&a!==void 0?a:1)*$n.getMaxScaleOnAxis();kn.copy(e.ray).applyMatrix4($n);for(var u=t.intersectRay(kn.origin,kn.direction,s,[]),l=n.geometry,c=l.index,d=l.getAttribute("normal"),v=0,A=u.length;v<A;v++){var h=u[v],p=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=Cu.set(p[0],p[1],p[2]).applyMatrix4(o),w=c?c.array[g]:g,E=void 0;if(d instanceof f.BufferAttribute){var S=new f.Vector3().fromBufferAttribute(d,w).applyNormalMatrix(Fs);E=new f.Face3(w,w,w,S)}r.push({distance:b,object:n,face:E,point:y,distanceToRay:y.distanceTo(x),index:g})}}}var Iu="__bvh_mesh__",Fd=f.Mesh.prototype.raycast;function Ld(n,t){var e=kd(this);e?Rd(this,e,n,t):Fd.call(this,n,t)}function kd(n){var t=n[Iu];return t instanceof wu,t}function Od(n,t){var e;Object.assign(n,(e={},e[Iu]=t,e.raycast=Ld,e))}var Tu="__bvh_points__",Dd=f.Points.prototype.raycast;function Vd(n,t){var e=zd(this);e?Bd(this,e,n,t):Dd.call(this,n,t)}function zd(n){var t=n[Tu];return t instanceof Eu,t}function Nd(n,t){var e;Object.assign(n,(e={},e[Tu]=t,e.raycast=Vd,e))}function Qd(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 v=c.boundingBox,A=v?[v.min.x,v.min.y,v.min.z,v.max.x,v.max.y,v.max.z]:void 0,h={};for(var p in c.attributes){var g=c.attributes[p];g instanceof f.InterleavedBufferAttribute?(h[p]={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[p]={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 Md.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,v=u.attributes[c];v instanceof f.InterleavedBufferAttribute?v.data.array=d:v.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 wu(l.attributes.position,l.indices);h.offsetArray=l.offsetArray,h.rootNodePacked=l.rootNodePacked,Od(s,h)}else if(s instanceof f.Points){var h=new Eu(l.attributes.position,l.indices);h.offsetArray=l.offsetArray,h.rootNodePacked=l.rootNodePacked,Nd(s,h)}}}return n})}var Pu=function(n){se(t,n);function t(e,r,i){i===void 0&&(i=Q);var a=n.call(this)||this;return a.contentObject=r,a.disposer=i,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 Ct||o instanceof ar)&&a.pbmObjects.push(o)}),a}return t.prototype.generateBvhTree=function(){return Qd(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 Ct||c.object instanceof ar)&&c.face){var v=Array.isArray(c.object.material)?c.object.material[c.face.materialIndex]:c.object.material;v&&(d=v.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 nt(){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 zi(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,v=s;d<v.length;d++){var A=v[d];if(!(A===""||A===".")){if(A===".."){c.pop();continue}c.push(A)}}return r+"//"+u+"/"+c.join("/")+"/"+l}function Br(n){return n.indexOf("//")===0||/^[0-9a-z]+\:/i.test(n)}function Ru(n,t,e){if(n.content&&n.content.uri&&(Br(n.content.uri)||(n.content.uri=zi(nt(t,n.content.uri)))),n.transform){for(var r=!1,i=0;i<16;i++){var a=n.transform[i];if(typeof a!="number"||isNaN(a)||!isFinite(a)){r=!0;break}}if(n.transform[15]===0&&(r=!0),r)throw new Error("Invalid Tile Transform: "+JSON.stringify(n.transform))}if(n.children)for(var o=0,s=n.children;o<s.length;o++){var u=s[o];Ru(u,t)}return n}function Ni(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;Br(e.imageFile)||(e.imageFile=zi(nt(t,e.imageFile))),Br(e.worldFile)||(e.worldFile=zi(nt(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=zi(nt(t,i.file))}return Ru(n.root,t),n}function Ud(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(v){ht.shared.add(function(){for(var A=0,h=u;A<h.length;A++){var p=h[A];t.initTexture(p)}v()},!0)})}).catch(function(){})};o.length>0;)s();return a}function ia(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 Sa=4;function Bu(n,t,e){var r=new DataView(t);if(n.magic=r.getUint32(e,!0),e+=Sa,n.version=r.getUint32(e,!0),e+=Sa,n.byteLength=r.getUint32(e,!0),e+=Sa,n.version!==1)throw new Error("3D Tile Version ".concat(n.version," not supported"));return e}var dr,Ze;(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"})(Ze||(Ze={}));var Hd=(dr={},dr[Ze.DOUBLE]=Float64Array,dr[Ze.FLOAT]=Float32Array,dr[Ze.UNSIGNED_SHORT]=Uint16Array,dr[Ze.UNSIGNED_INT]=Uint32Array,dr[Ze.UNSIGNED_BYTE]=Uint8Array,dr[Ze.BYTE]=Int8Array,dr[Ze.SHORT]=Int16Array,dr[Ze.INT]=Int32Array,dr),qd={DOUBLE:Ze.DOUBLE,FLOAT:Ze.FLOAT,UNSIGNED_SHORT:Ze.UNSIGNED_SHORT,UNSIGNED_INT:Ze.UNSIGNED_INT,UNSIGNED_BYTE:Ze.UNSIGNED_BYTE,BYTE:Ze.BYTE,SHORT:Ze.SHORT,INT:Ze.INT};function _i(n){var t=Hd[n];if(!t)throw new Error("Failed to convert GL type");return t}function Ma(n){var t=_i(n);return t.BYTES_PER_ELEMENT}function Ls(n,t,e,r){e===void 0&&(e=0);var i=_i(n);if(e%Ma(n)!==0){var a=r?t.slice(e,e+r*Ma(n)):t.slice(e);return new i(a)}else return new i(t,e,r!=null?r:(t.byteLength-e)/Ma(n))}function Gd(n){var t=qd[n];if(!t)throw new Error("Failed to convert GL type");return t}var Fu=function(){function n(t,e){this.featuresLength=0,this.cachedTypedArrays={},this.json=t,this.buffer=e;var r=this.getGlobalProperty("POINTS_LENGTH",Ze.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=_i(e);return new a([i])}else if(Array.isArray(i)){var a=_i(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=Gd(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=Ls(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=Ls(e,r),i[t]=a),a},n}(),Mn=4,ks="b3dm tile in legacy format.";function Lu(n,t,e){var r=new TextDecoder("utf8"),i=new Uint8Array(n,t,e),a=r.decode(i);return a}function ku(n,t,e){return e=Kd(n,t,e),e=jd(n,t,e),e=_d(n,t,e),e}function Kd(n,t,e){var r=new DataView(t),i=0;n.header=n.header||{};var a=r.getUint32(e,!0);e+=Mn;var o=r.getUint32(e,!0);e+=Mn;var s=r.getUint32(e,!0);e+=Mn;var u=r.getUint32(e,!0);return e+=Mn,s>=570425344?(e-=Mn*2,i=a,s=o,u=0,a=0,o=0,console.warn(ks)):u>=570425344&&(e-=Mn,i=s,s=a,u=o,a=0,o=0,console.warn(ks)),n.header.featureTableJsonByteLength=a,n.header.featureTableBinaryByteLength=o,n.header.batchTableJsonByteLength=s,n.header.batchTableBinaryByteLength=u,n.header.batchLength=i,e}function jd(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=Lu(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 Fu(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",Ze.FLOAT,3);l&&(n.rtcCenter[0]=l[0],n.rtcCenter[1]=l[1],n.rtcCenter[2]=l[2])}return e}function _d(n,t,e){var r=n.header||{},i=r.batchTableJsonByteLength,a=r.batchTableBinaryByteLength;if(i&&i>0){var o=Lu(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 Jd(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 Xd(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=Jd(t,e,r),n.byteLength}function lo(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 Oe={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},Kn={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Ji={9728:f.NearestFilter,9729:f.LinearFilter,9984:f.NearestMipmapNearestFilter,9985:f.LinearMipmapNearestFilter,9986:f.NearestMipmapLinearFilter,9987:f.LinearMipmapLinearFilter},Xi={33071:f.ClampToEdgeWrapping,33648:f.MirroredRepeatWrapping,10497:f.RepeatWrapping},Os={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ot={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},qr={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Wd={CUBICSPLINE:void 0,LINEAR:f.InterpolateLinear,STEP:f.InterpolateDiscrete},Mr={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function At(n){var t=[];for(var e in n)t.push(n[e]);return t}function Zd(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 Yd=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=At(r);i<a.length;i++){var o=a[i];o.markDefs(this)}return Promise.all(At(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(At(r).map(function(u){return u.emitResult(s,t)})).then(function(){return s})}).then(function(s){var u=Array.from(t.textureSet),l=Zd(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=At(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=At(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=[],v=[],A=[],h=[],p=0,g=l.channels.length;p<g;p++){var m=l.channels[p],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,E=l.parameters!==void 0?l.parameters[y.output]:y.output;c.push(this.loadNode(x)),d.push(this.loadAccessor(w)),v.push(this.loadAccessor(E)),A.push(y),h.push(b)}i=Promise.all([Promise.all(c),Promise.all(d),Promise.all(v),Promise.all(A),Promise.all(h)]).then(function(S){for(var C=S[0],R=S[1],k=S[2],M=S[3],I=S[4],L=[],T=function(N,U){var H=C[N],G=R[N],j=k[N],_=M[N],X=I[N];if(H===void 0)return"continue";H.updateMatrix(),H.matrixAutoUpdate=!0;var Z=void 0;switch(qr[X.path]){case qr.weights:Z=f.NumberKeyframeTrack;break;case qr.rotation:Z=f.QuaternionKeyframeTrack;break;case qr.position:case qr.scale:default:Z=f.VectorKeyframeTrack;break}var W=H.name?H.name:H.uuid,$=_.interpolation!==void 0?Wd[_.interpolation]:f.InterpolateLinear,Y=[];qr[X.path]===qr.weights?H.traverse(function(ye){ye.morphTargetInfluences&&Y.push(ye.name?ye.name:ye.uuid)}):Y.push(W);var ne=j.array;if(j.normalized){for(var te=Ca(ne.constructor),ue=new Float32Array(ne.length),ie=0,ge=ne.length;ie<ge;ie++)ue[ie]=ne[ie]*te;ne=ue}for(var ie=0,ge=Y.length;ie<ge;ie++){var pe=new Z(Y[ie]+"."+qr[X.path],G.array,ne,$);L.push(pe)}},B=0,D=C.length;B<D;B++)T(B);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=At(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=At(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=Os[o.type],d=Kn[o.componentType],v=d.BYTES_PER_ELEMENT,A=v*c,h=o.byteOffset||0,p=o.bufferView!==void 0?e.json.bufferViews[o.bufferView].byteStride:void 0,g=o.normalized===!0,m,y;if(p&&p!==A){var b=Math.floor(h/p),x="InterleavedBuffer:"+o.bufferView+":"+o.componentType+":"+b+":"+o.count,w=e.cache.get(x);w||(m=new d(l,b*p,o.count*p/v),w=new f.InterleavedBuffer(m,p/v),e.cache.set(x,w)),y=new f.InterleavedBufferAttribute(w,c,h%p/v,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 E=Os.SCALAR,S=Kn[o.sparse.indices.componentType],C=o.sparse.indices.byteOffset||0,R=o.sparse.values.byteOffset||0,k=new S(u[1],C,o.sparse.count*E),M=new d(u[2],R,o.sparse.count*c);l!==null&&(y=new f.BufferAttribute(y.array.slice(),y.itemSize,y.normalized));for(var I=0,L=k.length;I<L;I++){var T=k[I];if(y.setX(T,M[I*c]),c>=2&&y.setY(T,M[I*c+1]),c>=3&&y.setZ(T,M[I*c+2]),c>=4&&y.setW(T,M[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=At(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=At(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=At(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,v=u.byteLength||0,A=new Uint8Array(c,d,v),h=new Blob([A],{type:s.mimeType});return so(h)})}else if(s.uri){var l=this.resolveResouce(s.uri);r=this.options.fetcher.loadImage(l,{},void 0,void 0,void 0,oi()).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 Ot[c]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(c){return Ot[c]==="normal"}).length===0&&(i.flatShading=!0),Object.keys(t.attributes).filter(function(c){return Ot[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||Mr.OPAQUE;if(u===Mr.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,u===Mr.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 Ot[u]==="color"}).length>0&&(r.vertexColors=!0),Object.keys(t.attributes).filter(function(u){return Ot[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||Mr.OPAQUE;s===Mr.BLEND?(r.transparent=!0,r.depthWrite=!1):(r.transparent=!1,s===Mr.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 Ot[l]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(l){return Ot[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||Mr.OPAQUE;u===Mr.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,u===Mr.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:Oe.TRIANGLES,i="material:"+this.createPrimitiveKey(t),a=this.cache.get(i);if(a)return a;for(var o=null,s=0,u=At(this.extensions);s<u.length;s++){var l=u[s];if(o=l.loadMaterial(t,this),o)break}if(r===Oe.TRIANGLES||r===Oe.TRIANGLE_STRIP||r===Oe.TRIANGLE_FAN)o=this.loadMaterialAsMeshStandardMaterial(t);else if(r===Oe.LINES||r===Oe.LINE_STRIP||r===Oe.LINE_LOOP)o=this.loadMaterialAsLineBasicMaterial(t);else if(r===Oe.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=At(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 v=e.json.samplers||{},A=v[l.sampler]||{};return d.magFilter=Ji[A.magFilter]||f.LinearFilter,d.minFilter=Ji[A.minFilter]||f.LinearMipmapLinearFilter,d.wrapS=Xi[A.wrapS]||f.RepeatWrapping,d.wrapT=Xi[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=At(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 v=d[0],A=d[1],h=[],p=0;p<u.length;p++){var g=u[p],m=v[p],y=A[p],b=g.mode||Oe.TRIANGLES,x=void 0;if(b===Oe.TRIANGLES||b===Oe.TRIANGLE_STRIP||b===Oe.TRIANGLE_FAN)if(b===Oe.TRIANGLE_STRIP?m=e.toGeometryTrianglesDrawMode(m,f.TriangleStripDrawMode):b===Oe.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===Oe.POINTS)x=new f.Points(m,y);else if(b===Oe.LINES)x=new f.LineSegments(m,y);else if(b===Oe.LINE_STRIP)x=new f.Line(m,y);else if(b===Oe.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 E=0,S=s.weights.length;E<S;E++)x.morphTargetInfluences[E]=s.weights[E];if(s.extras&&Array.isArray(s.extras.targetNames)){var C=s.extras.targetNames;if(x.morphTargetInfluences.length===C.length){x.morphTargetDictionary={};for(var E=0,S=C.length;E<S;E++)x.morphTargetDictionary[C[E]]=E}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 R=new f.Group,k=0,M=h;k<M.length;k++){var x=M[k];R.add(x)}return R})}return r},n.prototype.loadNodeAttachments=function(t){for(var e=[],r=0,i=At(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(v){if(a.weights!==void 0){var A=a.weights;v.traverse(function(h){if(h instanceof f.Mesh||h instanceof f.Line||h instanceof f.Points)for(var p=0,g=A.length;p<g;p++)h.morphTargetInfluences[p]=A[p]})}return v})),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(v){var A;if(a.isBone===!0?A=new f.Bone:v.length>1?A=new f.Group:v.length===1?A=v[0]:A=new f.Object3D,A!==v[0])for(var h=0,p=v.length;h<p;h++)A.add(v[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=At(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 E=Ot[w]||w.toLowerCase();if(E in t.attributes)return"continue";a.push(s.loadAccessor(i[w]).then(function(S){S&&t.setAttribute(E,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,v=c.max;if(d!==void 0&&v!==void 0){if(l.set(new f.Vector3(d[0],d[1],d[2]),new f.Vector3(v[0],v[1],v[2])),c.normalized){var A=Ca(Kn[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 p=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,v=c.max;if(d!==void 0&&v!==void 0){if(g.setX(Math.max(Math.abs(d[0]),Math.abs(v[0]))),g.setY(Math.max(Math.abs(d[1]),Math.abs(v[1]))),g.setZ(Math.max(Math.abs(d[2]),Math.abs(v[2]))),c.normalized){var A=Ca(Kn[c.componentType]);g.multiplyScalar(A)}p.max(g)}else console.warn("glTF: Missing min/max properties for accessor POSITION.")}}l.expandByVector(p)}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,E=!1,S=0,C=e.targets.length;S<C;S++){var R=e.targets[S];if(R.POSITION!==void 0&&(w=!0),R.NORMAL!==void 0&&(E=!0),w&&E)break}if(!w&&!E)return t;var k=[];t.morphTargetsRelative=!0;for(var M=function(I,L){var T=e.targets[I];w?k.push(r.loadAccessor(T.POSITION).then(function(B){B&&(t.morphAttributes.position[I]=B)})):t.morphAttributes.position[I]=t.attributes.position,E?k.push(r.loadAccessor(T.NORMAL).then(function(B){B&&(t.morphAttributes.normal[I]=B)})):t.morphAttributes.normal[I]=t.attributes.normal},S=0,C=e.targets.length;S<C;S++)M(S,C);return Promise.all(k).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,v=s.length;d<v;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 nt(this.options.resourcePath,ia(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 Ca(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 gr=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}(),$d=function(n){se(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 lo(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=lo(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}(gr),eh="https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/draco/1.5.6/",Ds={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},Vs={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"},th=function(){function n(){this.decoderPath=eh,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||Ds,attributeTypes:i||Vs,useUniqueIDs:!!r};this.decodeGeometry(t,a).then(e)},n.prototype.decodeGeometry=function(t,e){var r=this;e===void 0&&(e={attributeIDs:Ds,attributeTypes:Vs,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,v){o._callbacks[s]={resolve:d,reject:v},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;e.setAttribute(a,new f.BufferAttribute(o,s))}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=Fn(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 */",zs].join(`
417
+ `,uu=[],di=new f.PerspectiveCamera(90,1,.1,2);di.up.set(0,-1,0);di.lookAt(new f.Vector3(1,0,0));di.updateMatrix();di.matrixAutoUpdate=!1;var hi=new f.PerspectiveCamera(90,1,.1,2);hi.up.set(0,-1,0);hi.lookAt(new f.Vector3(-1,0,0));hi.updateMatrix();hi.matrixAutoUpdate=!1;var pi=new f.PerspectiveCamera(90,1,.1,2);pi.up.set(0,0,1);pi.lookAt(new f.Vector3(0,1,0));pi.updateMatrix();pi.matrixAutoUpdate=!1;var vi=new f.PerspectiveCamera(90,1,.1,2);vi.up.set(0,0,-1);vi.lookAt(new f.Vector3(0,-1,0));vi.updateMatrix();vi.matrixAutoUpdate=!1;var mi=new f.PerspectiveCamera(90,1,.1,2);mi.up.set(0,-1,0);mi.lookAt(new f.Vector3(0,0,1));mi.updateMatrix();mi.matrixAutoUpdate=!1;var Ai=new f.PerspectiveCamera(90,1,.1,2);Ai.up.set(0,-1,0);Ai.lookAt(new f.Vector3(0,0,-1));Ai.updateMatrix();Ai.matrixAutoUpdate=!1;var ys={front:{camera:mi,index:4},back:{camera:Ai,index:5},up:{camera:pi,index:2},down:{camera:vi,index:3},left:{camera:hi,index:1},right:{camera:di,index:0}};function Kf(){var n=uu.pop();return n||new f.ShaderMaterial({uniforms:{map:{value:null},flipY:{value:0}},vertexShader:qf,fragmentShader:Gf,depthTest:!1,depthWrite:!1,stencilWrite:!1,blending:f.NoBlending,lights:!1,toneMapped:!1,fog:!1})}function jf(n){n.uniforms.map.value=null,uu.push(n)}function Jf(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=Kf();a.push(c),c.uniforms.map.value=l.texture,c.uniforms.flipY.value=l.flipY?1:0;var d=new f.Group,v=new f.Mesh(Hf,c);v.position.set(l.position.x+l.size.x/2-.5,1-(l.position.y+l.size.y/2)-.5,-.5),v.scale.set(l.size.x,l.size.y,1),d.quaternion.copy(Uf[l.face]),d.add(v),i.add(d)}var A=e.autoClear,h=e.sortObjects,p=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,ys[w].index),e.render(r,ys[w].camera)}),e.setRenderTarget(m),e.autoClear=A,e.sortObjects=h,e.xr.enabled=p;for(var b=0,x=a;b<x.length;b++){var c=x[b];jf(c)}}var _f=function(){return!1}();function oi(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 so(n){return new Promise(function(t,e){var r=URL.createObjectURL(n),i=oi({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 bs=[];function Xf(n,t){var e=bs.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,bs.push(r)}});return r}function xs(n,t){if(t&&(n.width>t.width||n.height>t.height)){var e=Xf(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 Wf(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 ws=new f.Vector3,sn=["right","left","up","down","front","back"],Ve=function(){function n(t,e,r,i,a){this.tileTree=e,this.tileSources=r,this.options=i,this.renderer=a,this.name="",this.needsRender=!1,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}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&&(oo(this.baseCubeTexture,t,this.renderer),this.baseCubeTexture.dispose(),this.baseCubeTexture=null),this._cubeRenderTarget&&oo(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(p){return p.level===t.level})[0];if(!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,v=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(v),h=O(O({},(s=(o=this.options.imageURL)===null||o===void 0?void 0:o.options)!==null&&s!==void 0?s:{key:"unknown"}),{key:A,size:l.scale>=1?void 0:c*t.size*l.scale,quality:void 0,cut:[c*t.position.x,c*t.position.y,c*t.size,c*t.size]});return 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(p){if(e.disposed){p.body.dispose();return}e.prepareToRender.push({node:t,texture:p.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=[];Fo(this.tileTree,function(p){if(p.level>e||!t.intersectsBox(p.box))return!1;!r.loadedCubeNodes.has(p)&&!r.loadingCubeNodes.has(p)&&o.push(p)}),o.sort(function(p,g){return p.level!==g.level?p.level-g.level:p.box.getCenter(ws).angleTo(i)-g.box.getCenter(ws).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(p,g){return p.node.level-g.node.level});for(var d=[],v=0;v<this.prepareToRender.length;v++){var A=this.prepareToRender[v],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(v,1),v--)}d.length&&(Jf(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}(),Nn=function(){function n(){}return n.prototype.loadTexture=function(t,e,r,i,a,o){var s,u,l,c,d,v,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 p=(d=(c=e.imageURL)===null||c===void 0?void 0:c.options)!==null&&d!==void 0?d:{key:"unknown"};t=hn(t,(v=e.imageURL)===null||v===void 0?void 0:v.transform,p);var g=vs(t),m=(A=e.viaAjax)!==null&&A!==void 0?A:_f,y=ps(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(C){return so(C.body)}).then(function(C){return xs(C,e.maxSize)}).then(function(C){return Object.assign(C,h),C}).then(function(C){var R={meta:x,body:C};return r(R),R}).catch(function(C){return i(C),Promise.reject(C)})}else{var E=null,S;return Promise.resolve().then(function(){return oi()}).then(function(C){return S=C,e.fetcher.loadImage(t,{timeout:e.timeout},void 0,void 0,a,C)}).then(function(C){return E=C.meta,xs(C.body,e.maxSize)}).then(function(C){return Object.assign(C,h),C}).then(function(C){var R={meta:E,body:C};return r(R),R}).catch(function(C){return S&&S.close(),i(C),Promise.reject(C)})}},n.prototype.loadCubeTexture=function(t,e,r,i,a,o){var s,u,l,c,d,v,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 p=[t[sn[0]],t[sn[1]],t[sn[2]],t[sn[3]],t[sn[4]],t[sn[5]]],g=[],m=[0,0,0,0,0,0],y=[],b=function(w){var E=(d=(c=e.imageURL)===null||c===void 0?void 0:c.options)!==null&&d!==void 0?d:{key:"unknown"},S=hn(p[w],(v=e.imageURL)===null||v===void 0?void 0:v.transform,O(O({},E),{key:E.key+"."+sn[w]})),C=vs(S),R=function(D){m[w]=D,a(m.reduce(function(V,N){return V+N},0)/6)},k=(A=e.viaAjax)!==null&&A!==void 0?A:!1,M=/^https?:$/.test(C),I=ps(S);if(I?k=!0:M||(k=!1),k){var L="blob",T=e.fetcher.ajax(S,{timeout:e.timeout,responseType:L},void 0,void 0,R).then(function(D){return y[w]=D.meta,so(D.body)});g.push(T)}else{var B,T=Promise.resolve().then(function(){return oi()}).then(function(V){return B=V,e.fetcher.loadImage(S,{timeout:e.timeout},void 0,void 0,R,V)}).then(function(V){return y[w]=V.meta,V.body}).catch(function(V){return B&&B.close(),Promise.reject(V)});g.push(T)}},x=0;x<6;x++)b(x);return Promise.all(g).then(function(w){return Wf(w)}).then(function(w){return Object.assign(w,O({encoding:f.sRGBEncoding},h)),w}).then(function(w){var E={body:w,meta:y};return r(E),E}).catch(function(w){for(var E=0,S=g;E<S.length;E++){var C=S[E];C.then(function(R){return R.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,v;u.loadCubeTexture(t,{imageURL:{transform:(d=r.imageURL)===null||d===void 0?void 0:d.transform,options:(v=r.imageURL)===null||v===void 0?void 0:v.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,p=A.meta,g=A.body,m=(h=r.tileMaxLevel)!==null&&h!==void 0?h:2,y=Math.max(1024*m,512),b=io(m),x=new Ve(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:p,body:x};i(w),l(w)},function(A){a(A),c(A)},o,s).catch(Q)})},n}();const Zf=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"),Yf=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"),$f=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\bv{t-sy|n-V_||sZnxHn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{Hn\bv{t-rp@-cvr]|vv|{H0v{pyqr-Ip|zz|{K0v{pyqr-Il}nlrr\x07K0v{pyqr-I?l}nlrr\x07K0v{pyqr-Ir{zn}l}nlrr\x07K0v{pyqr-Ip|y|l}nlrr\x07K0v{py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nx-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"),ed=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\\[`aN[alP\\Y\\_6--{vs|z-rp@-p|{n{P|y|H0r{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{qvs0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvsn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{Hn\bv{t-sy|n-V_||sZnxH{vs|z-sy|n-u|{Sy||V{qr\x07H{vs|z-rp?-r|yv|{H{vs|z-sy|n-}v\x07ry_nv|H{vs|z-rp@-qvssrH{vs|z-sy|n-|}npv\bH{vs|z-sy|n-ovtu{rH{vs|z-rp@-z|qryO|{qv{tZn\x07H{v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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--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--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--0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6----tylSntP|y|-J-rpA5p|{n{P|y|;9-p|{n{P|y|;t9-p|{n{P|y|;o9-|}npv\b6H--0r{qvs--<<-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\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"),td=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}n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|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"),rd=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|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\\[`aN[alP\\Y\\_6--{vs|z-rp@-p|{n{P|y|H0r{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{qvs0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvsn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-Pn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q-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\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--_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--0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6----tylSntP|y|-J-rpA5p|{n{P|y|;9-p|{n{P|y|;t9-p|{n{P|y|;o9-|}npv\b6H--0r{qvs--<<-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\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");new f.Vector4;var ga={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),clippers:new f.Uniform([]),shownFloorIndex:new f.Uniform(-1),constantColor:new f.Uniform(null),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)},nd={none:{vertexShader:Zf,fragmentShader:Yf,uniforms:f.UniformsUtils.merge([ga,{opacity:{value:1}},f.UniformsLib.fog]),lights:!1,clipping:!1},basic:{vertexShader:$f,fragmentShader:ed,uniforms:f.UniformsUtils.merge([ga,f.ShaderLib.basic.uniforms]),lights:!1,clipping:!0},phong:{vertexShader:td,fragmentShader:rd,uniforms:f.UniformsUtils.merge([ga,f.ShaderLib.phong.uniforms]),lights:!0,clipping:!0}},Ar=function(n){se(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,v,A,h,p,g,m,y,b,x,w,E,S,C,R,k,M,I,L,T=nd[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_CONSTANT_COLOR:!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_PANO_OPACITY:!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 B,D=null,V=null;return Object.defineProperties(i,{pano0:{get:function(){return D},set:function(N){if(D!==N){D=N,N===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=N.map instanceof Ve?N.map.texture:N.map,this.uniforms.pano0_luminanceMap.value=N.luminanceMap instanceof Ve?N.luminanceMap.texture:N.luminanceMap,this.uniforms.pano0_matrix.value.copy(N.matrix),this.uniforms.pano0_zoom.value=N.zoom);var U=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,H=this.defines.USE_LUMINANCE;H!==U&&(this.defines.USE_LUMINANCE=U,this.needsUpdate=!0)}}},pano1:{get:function(){return V},set:function(N){if(V!==N){V=N,N===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=N.map instanceof Ve?N.map.texture:N.map,this.uniforms.pano1_luminanceMap.value=N.luminanceMap instanceof Ve?N.luminanceMap.texture:N.luminanceMap,this.uniforms.pano1_matrix.value.copy(N.matrix),this.uniforms.pano1_zoom.value=N.zoom);var U=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,H=this.defines.USE_LUMINANCE;H!==U&&(this.defines.USE_LUMINANCE=U,this.needsUpdate=!0)}}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(N){this.uniforms.modelAlpha.value=N}},progress:{get:function(){return this.uniforms.progress.value},set:function(N){this.uniforms.progress.value=N}},transition:{get:function(){return this.defines.USE_BLACK_TRANSITION?"BLACK":this.defines.USE_SPREAD_TRANSITION?"SPREAD":"FADE"},set:function(N){var U=this.defines.USE_BLACK_TRANSITION,H=this.defines.USE_SPREAD_TRANSITION;this.defines.USE_BLACK_TRANSITION=!1,this.defines.USE_SPREAD_TRANSITION=!1,this.defines["USE_".concat(N,"_TRANSITION")]=!0;var G=!1;U!==this.defines.USE_BLACK_TRANSITION&&(G=!0),H!==this.defines.USE_SPREAD_TRANSITION&&(G=!0),G&&(this.needsUpdate=!0)}},constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(N){this.uniforms.constantColor.value=N;var U=this.defines.USE_CONSTANT_COLOR,H=N!==null;U!==H&&(this.defines.USE_CONSTANT_COLOR=H,this.needsUpdate=!0)}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(N){this.uniforms.opacity.value=N}},shownFloorIndex:{get:function(){return this.uniforms.shownFloorIndex.value},set:function(N){this.uniforms.shownFloorIndex.value=N}},brightness:{get:function(){return this.uniforms.brightness.value},set:function(N){this.uniforms.brightness.value=N}},clippers:{get:function(){return B},set:function(N){B!==N&&(B=N,this.uniforms.clippers.value=(B||[]).map(function(U){var H=typeof U.floorIndex=="number"?U.floorIndex:-1,G=new f.Matrix4().getInverse(U.clippingBoxMatrix);return{matrixInverse:G,floorIndex:H}}),this.needsUpdate=!0)}},useEDL:{get:function(){return this.defines.USE_EDL},set:function(N){N!==this.defines.USE_EDL&&(this.defines.USE_EDL=N,this.needsUpdate=!0)}},useHQWeight:{get:function(){return this.defines.USE_HQ_WEIGHT},set:function(N){N!==this.defines.USE_HQ_WEIGHT&&(this.defines.USE_HQ_WEIGHT=N,this.needsUpdate=!0)}},useHQDepth:{get:function(){return this.defines.USE_HQ_DEPTH},set:function(N){N!==this.defines.USE_HQ_DEPTH&&(this.defines.USE_HQ_DEPTH=N,this.needsUpdate=!0)}},floor:{get:function(){return this.uniforms.floor.value},set:function(N){this.uniforms.floor.value=N}},colorSaturation:{get:function(){return this.uniforms.colorSaturation.value},set:function(N){this.uniforms.colorSaturation.value=N}},colorBrightness:{get:function(){return this.uniforms.colorBrightness.value},set:function(N){this.uniforms.colorBrightness.value=N}}}),i.pano0=(a=r.pano0)!==null&&a!==void 0?a:Ae.pano0,i.pano1=(o=r.pano1)!==null&&o!==void 0?o:Ae.pano1,i.modelAlpha=(s=r.modelAlpha)!==null&&s!==void 0?s:Ae.modelAlpha,i.progress=(u=r.progress)!==null&&u!==void 0?u:Ae.progress,i.transition=(l=r.transition)!==null&&l!==void 0?l:Ae.transition,i.constantColor=(c=r.constantColor)!==null&&c!==void 0?c:Ae.constantColor,i.opacity=(d=r.opacity)!==null&&d!==void 0?d:Ae.opacity,i.floorStyle=(v=r.floorStyle)!==null&&v!==void 0?v:Ae.floorStyle,i.shownFloorIndex=(A=r.shownFloorIndex)!==null&&A!==void 0?A:Ae.shownFloorIndex,i.clippers=(h=r.clippers)!==null&&h!==void 0?h:Ae.clippers,i.useEDL=(p=r.useEDL)!==null&&p!==void 0?p:Ae.useEDL,i.useHQWeight=(g=r.useHQWeight)!==null&&g!==void 0?g:Ae.useHQWeight,i.useHQDepth=(m=r.useHQDepth)!==null&&m!==void 0?m:Ae.useHQDepth,i.pointSize=(y=r.pointSize)!==null&&y!==void 0?y:Ae.pointSize,i.pointColor=(b=r.pointColor)!==null&&b!==void 0?b:Ae.pointColor,i.pointShape=(x=r.pointShape)!==null&&x!==void 0?x:Ae.pointShape,i.pointScale=(w=r.pointScale)!==null&&w!==void 0?w:Ae.pointScale,i.pointBack=(E=r.pointBack)!==null&&E!==void 0?E:Ae.pointBack,i.pointMinPixel=(S=r.pointMinPixel)!==null&&S!==void 0?S:Ae.pointMinPixel,i.pointMaxPixel=(C=r.pointMaxPixel)!==null&&C!==void 0?C:Ae.pointMaxPixel,i.gradientTexture=(R=r.gradientTexture)!==null&&R!==void 0?R:Ae.gradientTexture,i.brightness=(k=r.brightness)!==null&&k!==void 0?k:Ae.brightness,i.colorSaturation=(M=r.colorSaturation)!==null&&M!==void 0?M:Ae.colorSaturation,i.colorBrightness=(I=r.colorBrightness)!==null&&I!==void 0?I:Ae.colorBrightness,i.customShaders=(L=r.customShaders)!==null&&L!==void 0?L:Ae.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},""),v=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,v),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 p=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,p),e.fragmentShader=e.fragmentShader.replace(/NUM_CLIPPERS/g,p),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 v=this.customShaders.reduce(function(m,y){return Object.assign(m,y.uniforms)},{}),A=Object.keys(this.customShaderUniforms),h=0,p=A;h<p.length;h++){var g=p[h];delete this.uniforms[g]}this.customShaderUniforms=v,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.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.pointColor=e.pointColor,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 id=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`RlP\\[`aN[alP\\Y\\_6--{vs|z-rp@-p|{n{P|y|H0r{qvs0vs-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--0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6----tylSntP|y|-J-rpA5p|{n{P|y|;9-p|{n{P|y|;t9-p|{n{P|y|;o9-|}npv\b6H--0r{qvs--<<-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"),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)}("nvor-rp@-p|y|H0vs-qrsv{rq5b`Rl]\\V[alP\\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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Znv\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--0vs-qrsv{rq5b`Rl]\\V[alP\\Y\\_lNYaVabQR6----P|y|-J-trP|y|O\bUrvtu5tnqvr{ar\x07r9-d|yq]|vv|{6H--0ryr----P|y|-J-p|y|H--0r{qvs--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 od=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(null),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)),gi=function(n){se(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,u,l,c,d,v,A,h,p,g,m,y,b,x,w,E,S,C,R,k,M,I=n.call(this,{vertexShader:ad,fragmentShader:id,uniforms:f.UniformsUtils.clone(od),lights:!1,clipping:!0,defines:{USE_CONSTANT_COLOR:!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_PANO_OPACITY:!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;var B=this.defines.USE_CONSTANT_COLOR,D=T!==null;B!==D&&(this.defines.USE_CONSTANT_COLOR=D,this.needsUpdate=!0)}},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(B){var D=typeof B.floorIndex=="number"?B.floorIndex:-1,V=new f.Matrix4().getInverse(B.clippingBoxMatrix);return{matrixInverse:V,floorIndex:D}}),this.needsUpdate=!0)}},pointColor:{get:function(){return this.defines.USE_POINT_COLOR_ALTITUDE===!0?"ALTITUDE":"RGB"},set:function(T){var B=T==="ALTITUDE";this.defines.USE_POINT_COLOR_ALTITUDE!==B&&(this.defines.USE_POINT_COLOR_ALTITUDE=B,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 B=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!==B&&(this.defines.USE_POINT_SIZE_ATTENUATION=B,this.needsUpdate=!0)}},pointShape:{get:function(){return this.defines.USE_POINT_SHAPE_CIRCLE===!0?"CIRCLE":"SQUARE"},set:function(T){var B=T==="CIRCLE";this.defines.USE_POINT_SHAPE_CIRCLE!==B&&(this.defines.USE_POINT_SHAPE_CIRCLE=B,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 B=T==="HIDDEN",D=T==="DARK";this.defines.USE_POINT_BACK_HIDDEN!==B&&(this.defines.USE_POINT_BACK_HIDDEN=B,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:Ae.pano0,I.pano1=(i=e.pano1)!==null&&i!==void 0?i:Ae.pano1,I.modelAlpha=(a=e.modelAlpha)!==null&&a!==void 0?a:Ae.modelAlpha,I.progress=(o=e.progress)!==null&&o!==void 0?o:Ae.progress,I.transition=(s=e.transition)!==null&&s!==void 0?s:Ae.transition,I.constantColor=(u=e.constantColor)!==null&&u!==void 0?u:Ae.constantColor,I.opacity=(l=e.opacity)!==null&&l!==void 0?l:Ae.opacity,I.floorStyle=(c=e.floorStyle)!==null&&c!==void 0?c:Ae.floorStyle,I.shownFloorIndex=(d=e.shownFloorIndex)!==null&&d!==void 0?d:Ae.shownFloorIndex,I.clippers=(v=e.clippers)!==null&&v!==void 0?v:Ae.clippers,I.useEDL=(A=e.useEDL)!==null&&A!==void 0?A:Ae.useEDL,I.useHQWeight=(h=e.useHQWeight)!==null&&h!==void 0?h:Ae.useHQWeight,I.useHQDepth=(p=e.useHQDepth)!==null&&p!==void 0?p:Ae.useHQDepth,I.pointColor=(g=e.pointColor)!==null&&g!==void 0?g:Ae.pointColor,I.pointShape=(m=e.pointShape)!==null&&m!==void 0?m:Ae.pointShape,I.pointSize=(y=e.pointSize)!==null&&y!==void 0?y:Ae.pointSize,I.pointScale=(b=e.pointScale)!==null&&b!==void 0?b:Ae.pointScale,I.pointBack=(x=e.pointBack)!==null&&x!==void 0?x:Ae.pointBack,I.pointMinPixel=(w=e.pointMinPixel)!==null&&w!==void 0?w:Ae.pointMinPixel,I.pointMaxPixel=(E=e.pointMaxPixel)!==null&&E!==void 0?E:Ae.pointMaxPixel,I.gradientTexture=(S=e.gradientTexture)!==null&&S!==void 0?S:Ae.gradientTexture,I.brightness=(C=e.brightness)!==null&&C!==void 0?C:Ae.brightness,I.colorSaturation=(R=e.colorSaturation)!==null&&R!==void 0?R:Ae.colorSaturation,I.colorBrightness=(k=e.colorBrightness)!==null&&k!==void 0?k:Ae.colorBrightness,I.customShaders=(M=e.customShaders)!==null&&M!==void 0?M:Ae.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(p){return p.type.includes("pointcloud")}),s=o.reduce(function(p,g){return p+g.vertex.mainBefore},""),u=o.reduce(function(p,g){return p+g.vertex.mainStart},""),l=o.reduce(function(p,g){return p+g.vertex.mainEnd},""),c=o.reduce(function(p,g){return p+g.fragment.mainBefore},""),d=o.reduce(function(p,g){return p+g.fragment.mainStart},""),v=o.reduce(function(p,g){return p+g.fragment.mainModelColor},""),A=o.reduce(function(p,g){return p+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,v);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(p){p.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 v=this.customShaders.reduce(function(m,y){return Object.assign(m,y.uniforms)},{}),A=Object.keys(this.customShaderUniforms),h=0,p=A;h<p.length;h++){var g=p[h];delete this.uniforms[g]}this.customShaderUniforms=v,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.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.pointColor=e.pointColor,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),cn=function(n){se(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,v=d===void 0?1:d,A=e.pixelRatio,h=A===void 0?1:A,p=e.antialias,g=p===void 0?!1:p,m=e.webgl2,y=e.logarithmicDepthBuffer,b=e.precision,x=e.powerPreference,w=this,E={antialias:g,alpha:!0,depth:!0,preserveDrawingBuffer:i,stencil:u,premultipliedAlpha:o,powerPreference:x},S={logarithmicDepthBuffer:y,precision:b};if(m){var C=document.createElement("canvas"),R=C.getContext("webgl2",E);R?w=n.call(this,O(O(O({},E),S),{antialias:!0,canvas:C,context:R}))||this:(console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."),w=n.call(this,O(O({},E),S))||this)}else w=n.call(this,O(O({},E),S))||this;return w.setPixelRatio(h),w.setClearColor(c,v),w.outputEncoding=f.sRGBEncoding,w.autoClear=!0,w}return t}(f.WebGLRenderer),lu=function(n){se(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 Qt(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 sd=1,ud=.1,ld=2e3,Ii=Math.PI*2,Es=Math.PI/2;function ya(n){return n>0&&n<=Ii?n:(n%Ii+Ii)%Ii}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 cu=function(n){se(t,n);function t(e,r,i,a,o,s,u){r===void 0&&(r=sd),i===void 0&&(i=ud),a===void 0&&(a=ld),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}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 Qt(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(de(r[9],-1,1)),Math.abs(r[9])<.9999999?this.pose.longitude=ya(Math.atan2(r[8],r[10])):this.pose.longitude=ya(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=ya((r=e.longitude)!==null&&r!==void 0?r:this.pose.longitude),l=Math.max(-Es+1e-4,Math.min(Es-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,v=(s=e.offset)!==null&&s!==void 0?s:this.pose.offset,A=Qt({longitude:u,latitude:l}).normalize();return this.position.set(0,0,0),this.lookAt(A),this.position.add(v).sub(A.clone().setLength(d)),this.fov!==c&&(this.fov=c,this.updateProjectionMatrix()),this.updateMatrixWorld(),this.pose.longitude=u,this.pose.latitude=l,this.pose.fov=c,this.pose.distance=d,this.pose.offset.copy(v),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(he()),this},t}(f.Camera),gt;(function(n){n[n.Outside=-1]="Outside",n[n.Intersecting=0]="Intersecting",n[n.Inside=1]="Inside"})(gt||(gt={}));var fu=1e-6,Ne=new f.Vector3,_r=new f.Matrix4,Vr=new f.Vector3,zr=new f.Vector3,Nr=new f.Vector3,uo=new f.Vector3,ba=new f.Box3,xa=new f.Sphere,Ss=new f.Matrix4,wa=new f.Ray,mt=new f.Object3D,Ms=new f.Frustum;function du(n,t){var e=n.elements;return t.setFromRotationMatrix(_r.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 Yn=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 _r.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),Ms.setFromProjectionMatrix(_r),this.setFromFrustum(Ms),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=gt.Inside,r=0,i=this.planes;r<i.length;r++){var a=i[r],o=t.intersectPlane(a);switch(o){case gt.Outside:return gt.Outside;case gt.Intersecting:e=gt.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===gt.Outside)return n.MASK_OUTSIDE;u===gt.Intersecting&&(r|=o)}}return r},n}(),hu=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],v=Math.sqrt(r*r+i*i+a*a),A=Math.sqrt(o*o+s*s+u*u),h=Math.sqrt(l*l+c*c+d*d);this.halfSize.set(v,A,h);var p=this.halfSize.toArray().reduce(function(g,m){return g+m},0);return(isNaN(p)||p<=0)&&this.halfSize.setScalar(fu),this.rotation.fromArray([r/v,i/v,a/v,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(Vr,zr,Nr),{box:dt(dt(dt(dt([],this.center.toArray(),!0),Vr.multiplyScalar(this.halfSize.x).toArray(),!0),zr.multiplyScalar(this.halfSize.y).toArray(),!0),Nr.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 mt.position.copy(this.center),du(this.rotation,mt.quaternion),mt.scale.copy(this.halfSize),mt.matrix.compose(mt.position,mt.quaternion,mt.scale),mt.matrix.premultiply(t),mt.matrix.decompose(mt.position,mt.quaternion,mt.scale),this.center.copy(mt.position),this.rotation.setFromMatrix4(_r.makeRotationFromQuaternion(mt.quaternion)),this.halfSize.copy(mt.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(Vr,zr,Nr),Vr.setLength(this.halfSize.x),zr.setLength(this.halfSize.y),Nr.setLength(this.halfSize.z),t.expandByPoint(Ne.copy(this.center).add(Vr)),t.expandByPoint(Ne.copy(this.center).sub(Vr)),t.expandByPoint(Ne.copy(this.center).add(zr)),t.expandByPoint(Ne.copy(this.center).sub(zr)),t.expandByPoint(Ne.copy(this.center).add(Nr)),t.expandByPoint(Ne.copy(this.center).sub(Nr)),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);Ne.set(this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,0),Ne.set(-this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,3),Ne.set(-this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,6),Ne.set(this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,9),Ne.set(this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,12),Ne.set(-this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,15),Ne.set(-this.halfSize.x,-this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,18),Ne.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?gt.Outside:c>=l?gt.Inside:gt.Intersecting},n.prototype.intersectRay=function(t,e){if(uo.copy(this.halfSize).multiplyScalar(2),ba.setFromCenterAndSize(Ne.set(0,0,0),uo),this.rotation.extractBasis(Vr,zr,Nr),_r.makeBasis(Vr,zr,Nr),_r.setPosition(this.center),Ss.getInverse(_r),wa.copy(t).applyMatrix4(Ss),ba.containsPoint(wa.origin))return!0;var r=wa.intersectBox(ba,Ne);return r?e!==void 0?r.applyMatrix4(_r).distanceTo(t.origin)<e:!0:!1},n}(),pu=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],fu),this},n.prototype.toJson=function(){return{sphere:dt(dt([],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,uo.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?gt.Outside:a<r?gt.Intersecting:gt.Inside},n.prototype.intersectRay=function(t,e){if(xa.set(this.center,this.radius),xa.containsPoint(t.origin))return!0;var r=t.intersectSphere(xa,Ne);return r?e!==void 0?t.origin.distanceTo(r)<e:!0:!1},n}(),fd=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 Vi(n){if("box"in n)return new hu().fromJson(n);if("sphere"in n)return new pu().fromJson(n);if("region"in n)return new fd().fromJson(n);throw new Error("BoundingVolume ".concat(JSON.stringify(n)," never suppored."))}var Ti=[4821759,8191922,16637280,16739958,5822969,376977,16747077,9259235,14514687].map(function(n){return new f.LineBasicMaterial({color:n,depthWrite:!1,depthTest:!1,transparent:!0})}),dd=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);Ne.set(1,1,1).toArray(t,0),Ne.set(-1,1,1).toArray(t,3),Ne.set(-1,-1,1).toArray(t,6),Ne.set(1,-1,1).toArray(t,9),Ne.set(1,1,-1).toArray(t,12),Ne.set(-1,1,-1).toArray(t,15),Ne.set(-1,-1,-1).toArray(t,18),Ne.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}(),hd=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 pd(n,t){if(n instanceof hu){var e=new f.LineSegments(dd,Ti[Math.min(t,Ti.length-1)]);return e.position.copy(n.center),du(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 pu){var e=new f.LineSegments(hd,Ti[Math.min(t,Ti.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 vd=new f.Vector3,ko=function(){function n(t,e,r,i){var a=this,o,s,u,l;this.parent=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.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:he(),loadfailRetryDelay:0,byteLength:0},e.content.group!==void 0&&(this.content.group=e.content.group),e.content.boundingVolume&&(this.content.boundingVolume=Vi(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=Vi(e.boundingVolume).applyMatrix4(this.transform)),e.viewerRequestVolume&&(this.viewerRequestVolume=Vi(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=pd(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(vd).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:Yn.MASK_INDETERMINATE;this.state.visibilityPlaneMask=t.cullingVolume.computeVisibilityWithPlaneMask(r,o),this.state.visible=this.state.visibilityPlaneMask!==Yn.MASK_OUTSIDE}else this.state.distanceToCamera=0,this.state.centerZDepth=0,this.state.visibilityPlaneMask=Yn.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=Math.max(e,.001),u=o*t.height/(s*t.sseDenominator);return u},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}();function Cs(n){var t=n.refine==="ADD"||n.tileset.skipLevelOfDetail,e=n.parent,r=e&&(!t||n.state.screenSpaceError===0),i=r?e.state.screenSpaceError:n.state.screenSpaceError,a=n.tileset.root?n.tileset.root.state.screenSpaceError:0,o=Math.max(a-i,0);return o}var vu=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(h){o.push({tile:h,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(e){case"SCREEN_SPACE_ERROR":{var d=new Map;o.sort(function(h,p){if(h.tile.state.requestedFrameNumber!==p.tile.state.requestedFrameNumber)return p.tile.state.requestedFrameNumber-h.tile.state.requestedFrameNumber;if(h.tile.state.requestedFrameNumber===r.frameNumber){var g=d.get(h.tile.id);g===void 0&&(g=Cs(h.tile),d.set(h.tile.id,g));var m=d.get(p.tile.id);return m===void 0&&(m=Cs(p.tile),d.set(p.tile.id,m)),g-m}else return h.tile.level!==p.tile.level?h.tile.level-p.tile.level:h.tile.state.distanceToCamera-p.tile.state.distanceToCamera});break}case"SCREEN_VERTICAL":{o.sort(function(h,p){return h.tile.state.requestedFrameNumber!==p.tile.state.requestedFrameNumber?p.tile.state.requestedFrameNumber-h.tile.state.requestedFrameNumber:h.tile.state.requestedFrameNumber===r.frameNumber?h.tile.state.centerScreenY!==p.tile.state.centerScreenY?h.tile.state.centerScreenY-p.tile.state.centerScreenY:h.tile.state.centerZDepth!==p.tile.state.centerZDepth?h.tile.state.centerZDepth-p.tile.state.centerZDepth:h.tile.level!==p.tile.level?h.tile.level-p.tile.level:h.tile.state.distanceToCamera-p.tile.state.distanceToCamera:h.tile.level!==p.tile.level?h.tile.level-p.tile.level:h.tile.state.distanceToCamera-p.tile.state.distanceToCamera});break}case"SCREEN_LEVEL_VERTICAL":{o.sort(function(h,p){return h.tile.state.requestedFrameNumber!==p.tile.state.requestedFrameNumber?p.tile.state.requestedFrameNumber-h.tile.state.requestedFrameNumber:h.tile.state.requestedFrameNumber===r.frameNumber?h.tile.level!==p.tile.level?h.tile.level-p.tile.level:h.tile.state.centerScreenY!==p.tile.state.centerScreenY?h.tile.state.centerScreenY-p.tile.state.centerScreenY:h.tile.state.centerZDepth!==p.tile.state.centerZDepth?h.tile.state.centerZDepth-p.tile.state.centerZDepth:h.tile.state.distanceToCamera-p.tile.state.distanceToCamera:h.tile.level!==p.tile.level?h.tile.level-p.tile.level:h.tile.state.distanceToCamera-p.tile.state.distanceToCamera});break}}c=Math.max(this.tileset.maxRequests-this.activeRequests,0);for(var v=function(h){var p=o[h];p.status==="WAITING"&&(c--,p.status="PENDING",p.time=a,A.activeRequests++,A.tileset.options.tileLoader(p.tile).catch(function(g){p.error=g}).then(function(){p.status="DONE",p.tile.content&&p.tile.content.loadState==="READY"&&(p.tile.content.loadState="LOADING"),i.activeRequests--}))},A=this,u=0;u<o.length&&c>0;u++)v(u)},n}(),md=function(){function n(t,e,r){this.item=t,this.previous=e,this.next=r}return n}(),Ad=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 md(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}(),mu=function(){function n(t){t===void 0&&(t={}),this.options=t,this.cacheNodeMap=new Map,this.list=new Ad,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}(),Xr=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}(),Oo=function(){function n(t){this.tileset=t,this._canSelectTile=!0,this._loadAllTilesTraversalStack=new Xr,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.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}(),gd=function(n){se(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r._traversalStack=new Xr,r._emptyTraversalStack=new Xr,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,v=0,A=a;v<A.length;v++){var u=A[v];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}(Oo),yd=function(n){se(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 Xr,r._descendantTraversalStack=new Xr,r._selectionTraversalStack=new Xr,r._selectionTraversalancestorStack=new Xr,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 v=d[c];v.state.visible&&i.push(v)}}}},t}(Oo),bd=function(n){se(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r._traversalStack=new Xr,r}return t.prototype.canTraverse=function(e,r){return!(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}(Oo),Is=[5635925,5592575,16733525],Au=function(){function n(t,e,r){var i;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,color:new f.Color((i=e.color)!==null&&i!==void 0?i:Is[t%Is.length]),byteLength:0,loadState:"UNLOADED",loadStateUpdateTime:he(),loadfailRetryDelay:0,data:void 0}}return n}(),xd=new f.Matrix4,Cr=function(){function n(t,e,r){var i=this,a,o,s,u,l,c,d,v,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:[]},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=(v=this.rootMeta.numFloors)!==null&&v!==void 0?v: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 gd(this),this.skipTraverser=new yd(this),this.mostDetailTraverser=new bd(this),this.cache=new mu({onTileLoad:function(g){i.memoryUsageInBytes+=g.contentByteLength},onTileUnload:function(g){i.memoryUsageInBytes-=g.contentByteLength,i.unloadTiles.push(g)}}),this.requestScheduler=new vu(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 ko("".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 p=new Au(h,this.asset.trajectories[h],this);this.trajectories.push(p)}}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(xd),this.traverser.traverse(this.root,t,e),this.cache.unloadTiles(function(){var v=r.memoryUsageInBytes>r.maxMemoryUsage*1024*1024;return v}),this.requestScheduler.update(this.requestedTiles,this.tileRequestOrder,t);for(var a=function(){var v=o.unloadTiles.pop();v&&(o.loadedTiles.delete(v),o.options.tileUnloader(v).catch(function(){}).then(function(){r.options.onTileUnload&&r.options.onTileUnload(v)}))},o=this;this.unloadTiles.length;)a();this.selectedTrajectories.length=0;for(var s=function(v){v.visible===!0&&v.content.loadState==="READY"&&(!((i=v.content.data)===null||i===void 0)&&i.object)?u.selectedTrajectories.push(v):v.visible===!0&&(v.content.loadState==="FAILED"&&t.time-v.content.loadStateUpdateTime>v.content.loadfailRetryDelay&&(v.content.loadState="UNLOADED",v.content.loadStateUpdateTime=t.time),v.content.loadState==="UNLOADED"&&u.options.trajectoryLoader(v).then(function(){r.options.onTrajectoryLoad(v)}).catch(function(A){r.options.onTrajectoryError(v,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}(),gu=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,v=(i=s.offset)!==null&&i!==void 0?i:0;l=c[t*d+v]}var A=u.array,h=(a=u.stride)!==null&&a!==void 0?a:3,p=(o=u.offset)!==null&&o!==void 0?o:0;return l=l*h+p,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}(),Ln=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}(),Pr=6*4+4+4+2+2;function yu(n,t){for(var e=new ArrayBuffer(t*Pr),r=new Float32Array(e),i=new Uint32Array(e),a=new Uint16Array(e),o=[n],s,u;s=o.pop();)u=s.id*Pr/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*Pr/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 bu(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,v=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,v=(o-n.y)*t.y):(d=(o-n.y)*t.y,v=(r-n.y)*t.y),!(l>v||d>c||(d>l&&(l=d),v<c&&(c=v),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 An=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}(),xu=function(){function n(t,e,r){this.triangle=t,this.intersectionPoint=e,this.index=r}return n}(),Ts=1e-6,He=new An(0,0,0),Qr=new An(0,0,0),Ur=new An(0,0,0),Hr=new An(0,0,0),wu=function(n){se(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,v=0,A=0,h=void 0,p=void 0,g=void 0,m=void 0,y=void 0,b=void 0,x=void 0;d<a;d+=1,v+=3,A+=6)o[d]=d,this.getPositionByIndex(v,Qr),this.getPositionByIndex(v+1,Ur),this.getPositionByIndex(v+2,Hr),h=m=Qr.x,x=Ur.x,x<h&&(h=x),x>m&&(m=x),x=Hr.x,x<h&&(h=x),x>m&&(m=x),p=y=Qr.y,x=Ur.y,x<p&&(p=x),x>y&&(y=x),x=Hr.y,x<p&&(p=x),x>y&&(y=x),g=b=Qr.z,x=Ur.z,x<g&&(g=x),x>b&&(b=x),x=Hr.z,x<g&&(g=x),x>b&&(b=x),s[A]=h,s[A+1]=p,s[A+2]=g,s[A+3]=m,s[A+4]=y,s[A+5]=b;else{for(var w=1/0,E=1/0,S=1/0,C=-1/0,R=-1/0,k=-1/0,d=0,v=0,A=0,h=void 0,p=void 0,g=void 0,m=void 0,y=void 0,b=void 0,x=void 0;d<a;d+=1,v+=3,A+=6)o[d]=d,this.getPositionByIndex(v,Qr),this.getPositionByIndex(v+1,Ur),this.getPositionByIndex(v+2,Hr),h=m=Qr.x,x=Ur.x,x<h&&(h=x),x>m&&(m=x),x=Hr.x,x<h&&(h=x),x>m&&(m=x),p=y=Qr.y,x=Ur.y,x<p&&(p=x),x>y&&(y=x),x=Hr.y,x<p&&(p=x),x>y&&(y=x),g=b=Qr.z,x=Ur.z,x<g&&(g=x),x>b&&(b=x),x=Hr.z,x<g&&(g=x),x>b&&(b=x),s[A]=h,s[A+1]=p,s[A+2]=g,s[A+3]=m,s[A+4]=y,s[A+5]=b,h<w&&(w=h),m>C&&(C=m),p<E&&(E=p),y>R&&(R=y),g<S&&(S=g),b>k&&(k=b);i=[w,E,S,C,R,k]}var M=new Ln(++c,i,0,a,0);u[l++]=M;var I=[],L=[0,1,2],T=function(D,V){return I[V]-I[D]};function B(D){var V=D.startIndex,N=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 H=0;H<3;H++){for(var G=L[H],j=U[G]+U[G+3],J=V,X=N-1,Z=-1,W=void 0;J<=X;)Z===-1?(W=o[J],s[W*6+G]+s[W*6+G+3]<j?J++:Z=W):(W=o[X],s[W*6+G]+s[W*6+G+3]>=j||(o[J]=W,o[X]=Z,Z=-1,J++),X--);if(J>V&&J<N){var $=new Ln(++c,Ps(o,s,V,J,Ts),V,J,D.deepth+1);$.deepth<r&&$.endIndex-$.startIndex>e&&(u[l++]=$);var Y=new Ln(++c,Ps(o,s,J,N,Ts),J,N,D.deepth+1);Y.deepth<r&&Y.endIndex-Y.startIndex>e&&(u[l++]=Y),D.node0=$,D.node1=Y,D.startIndex=0,D.endIndex=0;break}}}for(;l;)B(u[--l]);return this.offsetArray=o,this.rootNodePacked=yu(M,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,v,A,h;(d=l.pop())!==void 0;){h=d*Pr/4;var p=Ea(e.x,o[h],o[h+3])-e.x,g=Ea(e.y,o[h+1],o[h+4])-e.y,m=Ea(e.z,o[h+2],o[h+5])-e.z;if(p*p+g*g+m*m<=r*r){for(var y=s[h+6];y<s[h+7];y++)c.push(i[y]);h=d*Pr/2,v=u[h+16],A=u[h+17],v&&l.push(v),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,He),x[y*9]=He.x,x[y*9+1]=He.y,x[y*9+2]=He.z,this.getPositionByIndex(w+1,He),x[y*9+3]=He.x,x[y*9+4]=He.y,x[y*9+5]=He.z,this.getPositionByIndex(w+2,He),x[y*9+6]=He.x,x[y*9+7]=He.y,x[y*9+8]=He.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 An(1/r.x,1/r.y,1/r.z),v=[0],A,h,p,g;(A=v.pop())!==void 0;)if(g=A*Pr/4,bu(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,E=e.x,S=e.y,C=e.z,R=r.x,k=r.y,M=r.z,I=void 0,L=void 0,T=void 0,B=void 0,D=void 0,V=void 0,N=void 0,U=void 0,H=void 0,G=void 0,j=void 0,J=void 0,X=void 0,Z=void 0,W=void 0,$=void 0,Y=void 0,ne=void 0,te=void 0,ue=void 0,ie=void 0,ge=void 0,pe=void 0,ye=void 0,Be=void 0,Se=void 0,Te=void 0;m<y;m++){if(b=o[m],x=b*3,this.getPositionByIndex(x,He),I=He.x,L=He.y,T=He.z,this.getPositionByIndex(x+1,He),B=He.x,D=He.y,V=He.z,this.getPositionByIndex(x+2,He),N=He.x,U=He.y,H=He.z,G=B-I,j=D-L,J=V-T,X=N-I,Z=U-L,W=H-T,$=j*W-J*Z,Y=J*X-G*W,ne=G*Z-j*X,pe=R*$+k*Y+M*ne,pe>0)ge=1;else if(pe<0)ge=-1,pe=-pe;else continue;te=E-I,ue=S-L,ie=C-T,ye=ge*(R*(ue*W-ie*Z)+k*(ie*X-te*W)+M*(te*Z-ue*X)),!(ye<0)&&(Be=ge*(R*(j*ie-J*ue)+k*(J*te-G*ie)+M*(G*ue-j*te)),!(Be<0)&&(ye+Be>pe||(Se=-ge*(te*$+ue*Y+ie*ne),!(Se<0)&&(Te=Se/pe,a.push(new xu([I,L,T,B,D,V,N,U,H],[E+R*Te,S+k*Te,C+M*Te],b))))))}g=A*Pr/2,h=c[g+16],p=c[g+17],h&&v.push(h),p&&v.push(p)}return a},t}(gu);function Ea(n,t,e){return n<t?t:n>e?e:n}function Ps(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,v=void 0,A=void 0;d<r;d++)v=n[d]*6,A=t[v],A<a&&(a=A),A=t[v+1],A<o&&(o=A),A=t[v+2],A<s&&(s=A),A=t[v+3],A>u&&(u=A),A=t[v+4],A>l&&(l=A),A=t[v+5],A>c&&(c=A);return[a-i,o-i,s-i,u+i,l+i,c+i]}var Rs=1e-6,wd=["x","y","z"],ct=new An(0,0,0),Eu=function(n){se(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,ct);for(var v=ct.x,A=ct.y,h=ct.z,p=v,g=A,m=h,d=0,y=void 0,b=void 0,x=void 0;d<o;d+=1)s[d]=d,a(d,ct),y=ct.x,b=ct.y,x=ct.z,y<v?v=y:y>p&&(p=y),b<A?A=b:b>g&&(g=b),x<h?h=x:x>m&&(m=x);i=[v,A,h,p,g,m]}var w=new Ln(++c,i,0,o,0);u[l++]=w;var E=[],S=[0,1,2],C=function(k,M){return E[M]-E[k]};function R(k){var M=k.startIndex,I=k.endIndex,L=k.extents;E[0]=L[3]-L[0],E[1]=L[4]-L[1],E[2]=L[5]-L[2];for(var T=S.sort(C)[0],B=wd[T],D=(L[T]+L[T+3])/2,V=M,N=I-1,U=-1,H;V<=N;)U===-1?(H=s[V],a(H,ct),ct[B]<D?V++:U=H):(H=s[N],a(H,ct),ct[B]>=D||(s[V]=H,s[N]=U,U=-1,V++),N--);if(V>M){var G=L.slice();G[T+3]=D+Rs;var j=new Ln(++c,G,M,V,k.deepth+1);j.deepth<r&&j.endIndex-j.startIndex>e&&(u[l++]=j),k.node0=j}if(I>V){var J=L.slice();J[T]=D-Rs;var X=new Ln(++c,J,V,I,k.deepth+1);X.deepth<r&&X.endIndex-X.startIndex>e&&(u[l++]=X),k.node1=X}k.startIndex=0,k.endIndex=0}for(;l;)R(u[--l]);return this.offsetArray=s,this.rootNodePacked=yu(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,v=new An(1/r.x,1/r.y,1/r.z),A=[0],h,p,g,m;(h=A.pop())!==void 0;)if(m=h*Pr/4,bu(e,v,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,E=void 0,S=void 0,C=void 0,R=void 0,k=void 0,M=void 0,I=void 0,L=void 0,T=void 0,B=void 0;y<b;y++)x=o[y],this.getPositionByIndex(x,ct),w=ct.x,E=ct.y,S=ct.z,C=e.x,R=e.y,k=e.z,M=r.x,I=r.y,L=r.z,T=M*(w-C)+I*(E-R)+L*(S-k),T>0&&(C+=M*T,R+=I*T,k+=L*T),M=w-C,I=E-R,L=S-k,T=M*M+I*I+L*L,T<=d&&a.push(new xu([w,E,S,w,E,S,w,E,S],[C,R,k],x));m=h*Pr/2,p=c[m+16],g=c[m+17],p&&A.push(p),g&&A.push(g)}return a},t}(gu);const Su="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBlcj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Ob2RlLHYubWF4VHJlZURlcHRoLHYuZXh0ZW50cyk7dmFyIHM9e3R5cGU6di50eXBlLGF0dHJpYnV0ZXM6di5hdHRyaWJ1dGVzLGluZGljZXM6di5pbmRpY2VzLG9mZnNldEFycmF5Om4ub2Zmc2V0QXJyYXkscm9vdE5vZGVQYWNrZWQ6bi5yb290Tm9kZVBhY2tlZH07dC5wdXNoKHMpO3ZhciB1PXZvaWQgMDtmb3IodmFyIHcgaW4gcy5hdHRyaWJ1dGVzKXt2YXIgeT1zLmF0dHJpYnV0ZXNbd107eSYmeS5idWZmZXIgaW5zdGFuY2VvZiBBcnJheUJ1ZmZlciYmby5hZGQoeS5idWZmZXIpfXU9cy5pbmRpY2VzLHUmJnUuYnVmZmVyIGluc3RhbmNlb2YgQXJyYXlCdWZmZXImJm8uYWRkKHUuYnVmZmVyKSx1PXMub2Zmc2V0QXJyYXksdSYmdS5idWZmZXIgaW5zdGFuY2VvZiBBcnJheUJ1ZmZlciYmby5hZGQodS5idWZmZXIpLG8uYWRkKHMucm9vdE5vZGVQYWNrZWQpfXJldHVybntvdXRwdXQ6dCx0cmFuc2ZlcjpBcnJheS5mcm9tKG8pfX0pfSl9KSgpOwo=",Ed=n=>Uint8Array.from(atob(n),t=>t.charCodeAt(0)),Bs=typeof self!="undefined"&&self.Blob&&new Blob([Ed(Su)],{type:"text/javascript;charset=utf-8"});function Sd(n){let t;try{if(t=Bs&&(self.URL||self.webkitURL).createObjectURL(Bs),!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,"+Su,{name:n==null?void 0:n.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var Mu=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}(),Md=new Mu(function(){return new Sd},4),Cd=new Map,kn=new f.Ray,Fs=new f.Matrix3,$n=new f.Matrix4,Cu=new f.Vector3,Id=new f.Vector3,Td=new f.Vector3,Pd=new f.Triangle;function Rd(n,t,e,r){var i,a=n.matrixWorld;$n.getInverse(a),kn.copy(e.ray).applyMatrix4($n);for(var o=t.intersectRay(kn.origin,kn.direction,0,[]),s=n.geometry,u=n.material,l=s.groups,c=s.index,d=0,v=o.length;d<v;d++){var A=o[d],h=A.triangle,p=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=p*3,w=0,E=l;w<E.length;w++){var S=E[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 C=Pd.set(Cu.set(h[0],h[1],h[2]).applyMatrix4(a),Id.set(h[3],h[4],h[5]).applyMatrix4(a),Td.set(h[6],h[7],h[8]).applyMatrix4(a)).getNormal(new f.Vector3),R=p*3,k=new f.Face3(c?c.array[R]:R,c?c.array[R+1]:R+1,c?c.array[R+2]:R+2,C),M=e.ray.direction.dot(C);b.side===f.FrontSide&&M>=0||b.side===f.BackSide&&M<=0||r.push({distance:y,object:n,face:k,point:m,distanceToRay:0,faceIndex:p})}}}}function Bd(n,t,e,r){var i,a,o=n.matrixWorld;Fs.getNormalMatrix(o),$n.getInverse(o);var s=((a=(i=e.params.Points)===null||i===void 0?void 0:i.threshold)!==null&&a!==void 0?a:1)*$n.getMaxScaleOnAxis();kn.copy(e.ray).applyMatrix4($n);for(var u=t.intersectRay(kn.origin,kn.direction,s,[]),l=n.geometry,c=l.index,d=l.getAttribute("normal"),v=0,A=u.length;v<A;v++){var h=u[v],p=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=Cu.set(p[0],p[1],p[2]).applyMatrix4(o),w=c?c.array[g]:g,E=void 0;if(d instanceof f.BufferAttribute){var S=new f.Vector3().fromBufferAttribute(d,w).applyNormalMatrix(Fs);E=new f.Face3(w,w,w,S)}r.push({distance:b,object:n,face:E,point:y,distanceToRay:y.distanceTo(x),index:g})}}}var Iu="__bvh_mesh__",Fd=f.Mesh.prototype.raycast;function Ld(n,t){var e=kd(this);e?Rd(this,e,n,t):Fd.call(this,n,t)}function kd(n){var t=n[Iu];return t instanceof wu,t}function Od(n,t){var e;Object.assign(n,(e={},e[Iu]=t,e.raycast=Ld,e))}var Tu="__bvh_points__",Dd=f.Points.prototype.raycast;function Vd(n,t){var e=zd(this);e?Bd(this,e,n,t):Dd.call(this,n,t)}function zd(n){var t=n[Tu];return t instanceof Eu,t}function Nd(n,t){var e;Object.assign(n,(e={},e[Tu]=t,e.raycast=Vd,e))}function Qd(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 v=c.boundingBox,A=v?[v.min.x,v.min.y,v.min.z,v.max.x,v.max.y,v.max.z]:void 0,h={};for(var p in c.attributes){var g=c.attributes[p];g instanceof f.InterleavedBufferAttribute?(h[p]={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[p]={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 Md.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,v=u.attributes[c];v instanceof f.InterleavedBufferAttribute?v.data.array=d:v.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 wu(l.attributes.position,l.indices);h.offsetArray=l.offsetArray,h.rootNodePacked=l.rootNodePacked,Od(s,h)}else if(s instanceof f.Points){var h=new Eu(l.attributes.position,l.indices);h.offsetArray=l.offsetArray,h.rootNodePacked=l.rootNodePacked,Nd(s,h)}}}return n})}var Pu=function(n){se(t,n);function t(e,r,i){i===void 0&&(i=Q);var a=n.call(this)||this;return a.contentObject=r,a.disposer=i,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 Ct||o instanceof ar)&&a.pbmObjects.push(o)}),a}return t.prototype.generateBvhTree=function(){return Qd(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 Ct||c.object instanceof ar)&&c.face){var v=Array.isArray(c.object.material)?c.object.material[c.face.materialIndex]:c.object.material;v&&(d=v.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 nt(){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 zi(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,v=s;d<v.length;d++){var A=v[d];if(!(A===""||A===".")){if(A===".."){c.pop();continue}c.push(A)}}return r+"//"+u+"/"+c.join("/")+"/"+l}function Br(n){return n.indexOf("//")===0||/^[0-9a-z]+\:/i.test(n)}function Ru(n,t,e){if(n.content&&n.content.uri&&(Br(n.content.uri)||(n.content.uri=zi(nt(t,n.content.uri)))),n.transform){for(var r=!1,i=0;i<16;i++){var a=n.transform[i];if(typeof a!="number"||isNaN(a)||!isFinite(a)){r=!0;break}}if(n.transform[15]===0&&(r=!0),r)throw new Error("Invalid Tile Transform: "+JSON.stringify(n.transform))}if(n.children)for(var o=0,s=n.children;o<s.length;o++){var u=s[o];Ru(u,t)}return n}function Ni(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;Br(e.imageFile)||(e.imageFile=zi(nt(t,e.imageFile))),Br(e.worldFile)||(e.worldFile=zi(nt(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=zi(nt(t,i.file))}return Ru(n.root,t),n}function Ud(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(v){ht.shared.add(function(){for(var A=0,h=u;A<h.length;A++){var p=h[A];t.initTexture(p)}v()},!0)})}).catch(function(){})};o.length>0;)s();return a}function ia(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 Sa=4;function Bu(n,t,e){var r=new DataView(t);if(n.magic=r.getUint32(e,!0),e+=Sa,n.version=r.getUint32(e,!0),e+=Sa,n.byteLength=r.getUint32(e,!0),e+=Sa,n.version!==1)throw new Error("3D Tile Version ".concat(n.version," not supported"));return e}var dr,Ze;(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"})(Ze||(Ze={}));var Hd=(dr={},dr[Ze.DOUBLE]=Float64Array,dr[Ze.FLOAT]=Float32Array,dr[Ze.UNSIGNED_SHORT]=Uint16Array,dr[Ze.UNSIGNED_INT]=Uint32Array,dr[Ze.UNSIGNED_BYTE]=Uint8Array,dr[Ze.BYTE]=Int8Array,dr[Ze.SHORT]=Int16Array,dr[Ze.INT]=Int32Array,dr),qd={DOUBLE:Ze.DOUBLE,FLOAT:Ze.FLOAT,UNSIGNED_SHORT:Ze.UNSIGNED_SHORT,UNSIGNED_INT:Ze.UNSIGNED_INT,UNSIGNED_BYTE:Ze.UNSIGNED_BYTE,BYTE:Ze.BYTE,SHORT:Ze.SHORT,INT:Ze.INT};function Ji(n){var t=Hd[n];if(!t)throw new Error("Failed to convert GL type");return t}function Ma(n){var t=Ji(n);return t.BYTES_PER_ELEMENT}function Ls(n,t,e,r){e===void 0&&(e=0);var i=Ji(n);if(e%Ma(n)!==0){var a=r?t.slice(e,e+r*Ma(n)):t.slice(e);return new i(a)}else return new i(t,e,r!=null?r:(t.byteLength-e)/Ma(n))}function Gd(n){var t=qd[n];if(!t)throw new Error("Failed to convert GL type");return t}var Fu=function(){function n(t,e){this.featuresLength=0,this.cachedTypedArrays={},this.json=t,this.buffer=e;var r=this.getGlobalProperty("POINTS_LENGTH",Ze.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=Ji(e);return new a([i])}else if(Array.isArray(i)){var a=Ji(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=Gd(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=Ls(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=Ls(e,r),i[t]=a),a},n}(),Mn=4,ks="b3dm tile in legacy format.";function Lu(n,t,e){var r=new TextDecoder("utf8"),i=new Uint8Array(n,t,e),a=r.decode(i);return a}function ku(n,t,e){return e=Kd(n,t,e),e=jd(n,t,e),e=Jd(n,t,e),e}function Kd(n,t,e){var r=new DataView(t),i=0;n.header=n.header||{};var a=r.getUint32(e,!0);e+=Mn;var o=r.getUint32(e,!0);e+=Mn;var s=r.getUint32(e,!0);e+=Mn;var u=r.getUint32(e,!0);return e+=Mn,s>=570425344?(e-=Mn*2,i=a,s=o,u=0,a=0,o=0,console.warn(ks)):u>=570425344&&(e-=Mn,i=s,s=a,u=o,a=0,o=0,console.warn(ks)),n.header.featureTableJsonByteLength=a,n.header.featureTableBinaryByteLength=o,n.header.batchTableJsonByteLength=s,n.header.batchTableBinaryByteLength=u,n.header.batchLength=i,e}function jd(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=Lu(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 Fu(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",Ze.FLOAT,3);l&&(n.rtcCenter[0]=l[0],n.rtcCenter[1]=l[1],n.rtcCenter[2]=l[2])}return e}function Jd(n,t,e){var r=n.header||{},i=r.batchTableJsonByteLength,a=r.batchTableBinaryByteLength;if(i&&i>0){var o=Lu(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 _d(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 Xd(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=_d(t,e,r),n.byteLength}function lo(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 Oe={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},Kn={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},_i={9728:f.NearestFilter,9729:f.LinearFilter,9984:f.NearestMipmapNearestFilter,9985:f.LinearMipmapNearestFilter,9986:f.NearestMipmapLinearFilter,9987:f.LinearMipmapLinearFilter},Xi={33071:f.ClampToEdgeWrapping,33648:f.MirroredRepeatWrapping,10497:f.RepeatWrapping},Os={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ot={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},qr={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Wd={CUBICSPLINE:void 0,LINEAR:f.InterpolateLinear,STEP:f.InterpolateDiscrete},Mr={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function At(n){var t=[];for(var e in n)t.push(n[e]);return t}function Zd(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 Yd=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=At(r);i<a.length;i++){var o=a[i];o.markDefs(this)}return Promise.all(At(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(At(r).map(function(u){return u.emitResult(s,t)})).then(function(){return s})}).then(function(s){var u=Array.from(t.textureSet),l=Zd(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=At(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=At(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=[],v=[],A=[],h=[],p=0,g=l.channels.length;p<g;p++){var m=l.channels[p],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,E=l.parameters!==void 0?l.parameters[y.output]:y.output;c.push(this.loadNode(x)),d.push(this.loadAccessor(w)),v.push(this.loadAccessor(E)),A.push(y),h.push(b)}i=Promise.all([Promise.all(c),Promise.all(d),Promise.all(v),Promise.all(A),Promise.all(h)]).then(function(S){for(var C=S[0],R=S[1],k=S[2],M=S[3],I=S[4],L=[],T=function(N,U){var H=C[N],G=R[N],j=k[N],J=M[N],X=I[N];if(H===void 0)return"continue";H.updateMatrix(),H.matrixAutoUpdate=!0;var Z=void 0;switch(qr[X.path]){case qr.weights:Z=f.NumberKeyframeTrack;break;case qr.rotation:Z=f.QuaternionKeyframeTrack;break;case qr.position:case qr.scale:default:Z=f.VectorKeyframeTrack;break}var W=H.name?H.name:H.uuid,$=J.interpolation!==void 0?Wd[J.interpolation]:f.InterpolateLinear,Y=[];qr[X.path]===qr.weights?H.traverse(function(ye){ye.morphTargetInfluences&&Y.push(ye.name?ye.name:ye.uuid)}):Y.push(W);var ne=j.array;if(j.normalized){for(var te=Ca(ne.constructor),ue=new Float32Array(ne.length),ie=0,ge=ne.length;ie<ge;ie++)ue[ie]=ne[ie]*te;ne=ue}for(var ie=0,ge=Y.length;ie<ge;ie++){var pe=new Z(Y[ie]+"."+qr[X.path],G.array,ne,$);L.push(pe)}},B=0,D=C.length;B<D;B++)T(B);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=At(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=At(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=Os[o.type],d=Kn[o.componentType],v=d.BYTES_PER_ELEMENT,A=v*c,h=o.byteOffset||0,p=o.bufferView!==void 0?e.json.bufferViews[o.bufferView].byteStride:void 0,g=o.normalized===!0,m,y;if(p&&p!==A){var b=Math.floor(h/p),x="InterleavedBuffer:"+o.bufferView+":"+o.componentType+":"+b+":"+o.count,w=e.cache.get(x);w||(m=new d(l,b*p,o.count*p/v),w=new f.InterleavedBuffer(m,p/v),e.cache.set(x,w)),y=new f.InterleavedBufferAttribute(w,c,h%p/v,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 E=Os.SCALAR,S=Kn[o.sparse.indices.componentType],C=o.sparse.indices.byteOffset||0,R=o.sparse.values.byteOffset||0,k=new S(u[1],C,o.sparse.count*E),M=new d(u[2],R,o.sparse.count*c);l!==null&&(y=new f.BufferAttribute(y.array.slice(),y.itemSize,y.normalized));for(var I=0,L=k.length;I<L;I++){var T=k[I];if(y.setX(T,M[I*c]),c>=2&&y.setY(T,M[I*c+1]),c>=3&&y.setZ(T,M[I*c+2]),c>=4&&y.setW(T,M[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=At(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=At(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=At(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,v=u.byteLength||0,A=new Uint8Array(c,d,v),h=new Blob([A],{type:s.mimeType});return so(h)})}else if(s.uri){var l=this.resolveResouce(s.uri);r=this.options.fetcher.loadImage(l,{},void 0,void 0,void 0,oi()).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 Ot[c]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(c){return Ot[c]==="normal"}).length===0&&(i.flatShading=!0),Object.keys(t.attributes).filter(function(c){return Ot[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||Mr.OPAQUE;if(u===Mr.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,u===Mr.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 Ot[u]==="color"}).length>0&&(r.vertexColors=!0),Object.keys(t.attributes).filter(function(u){return Ot[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||Mr.OPAQUE;s===Mr.BLEND?(r.transparent=!0,r.depthWrite=!1):(r.transparent=!1,s===Mr.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 Ot[l]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(l){return Ot[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||Mr.OPAQUE;u===Mr.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,u===Mr.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:Oe.TRIANGLES,i="material:"+this.createPrimitiveKey(t),a=this.cache.get(i);if(a)return a;for(var o=null,s=0,u=At(this.extensions);s<u.length;s++){var l=u[s];if(o=l.loadMaterial(t,this),o)break}if(r===Oe.TRIANGLES||r===Oe.TRIANGLE_STRIP||r===Oe.TRIANGLE_FAN)o=this.loadMaterialAsMeshStandardMaterial(t);else if(r===Oe.LINES||r===Oe.LINE_STRIP||r===Oe.LINE_LOOP)o=this.loadMaterialAsLineBasicMaterial(t);else if(r===Oe.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=At(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 v=e.json.samplers||{},A=v[l.sampler]||{};return d.magFilter=_i[A.magFilter]||f.LinearFilter,d.minFilter=_i[A.minFilter]||f.LinearMipmapLinearFilter,d.wrapS=Xi[A.wrapS]||f.RepeatWrapping,d.wrapT=Xi[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=At(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 v=d[0],A=d[1],h=[],p=0;p<u.length;p++){var g=u[p],m=v[p],y=A[p],b=g.mode||Oe.TRIANGLES,x=void 0;if(b===Oe.TRIANGLES||b===Oe.TRIANGLE_STRIP||b===Oe.TRIANGLE_FAN)if(b===Oe.TRIANGLE_STRIP?m=e.toGeometryTrianglesDrawMode(m,f.TriangleStripDrawMode):b===Oe.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===Oe.POINTS)x=new f.Points(m,y);else if(b===Oe.LINES)x=new f.LineSegments(m,y);else if(b===Oe.LINE_STRIP)x=new f.Line(m,y);else if(b===Oe.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 E=0,S=s.weights.length;E<S;E++)x.morphTargetInfluences[E]=s.weights[E];if(s.extras&&Array.isArray(s.extras.targetNames)){var C=s.extras.targetNames;if(x.morphTargetInfluences.length===C.length){x.morphTargetDictionary={};for(var E=0,S=C.length;E<S;E++)x.morphTargetDictionary[C[E]]=E}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 R=new f.Group,k=0,M=h;k<M.length;k++){var x=M[k];R.add(x)}return R})}return r},n.prototype.loadNodeAttachments=function(t){for(var e=[],r=0,i=At(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(v){if(a.weights!==void 0){var A=a.weights;v.traverse(function(h){if(h instanceof f.Mesh||h instanceof f.Line||h instanceof f.Points)for(var p=0,g=A.length;p<g;p++)h.morphTargetInfluences[p]=A[p]})}return v})),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(v){var A;if(a.isBone===!0?A=new f.Bone:v.length>1?A=new f.Group:v.length===1?A=v[0]:A=new f.Object3D,A!==v[0])for(var h=0,p=v.length;h<p;h++)A.add(v[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=At(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 E=Ot[w]||w.toLowerCase();if(E in t.attributes)return"continue";a.push(s.loadAccessor(i[w]).then(function(S){S&&t.setAttribute(E,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,v=c.max;if(d!==void 0&&v!==void 0){if(l.set(new f.Vector3(d[0],d[1],d[2]),new f.Vector3(v[0],v[1],v[2])),c.normalized){var A=Ca(Kn[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 p=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,v=c.max;if(d!==void 0&&v!==void 0){if(g.setX(Math.max(Math.abs(d[0]),Math.abs(v[0]))),g.setY(Math.max(Math.abs(d[1]),Math.abs(v[1]))),g.setZ(Math.max(Math.abs(d[2]),Math.abs(v[2]))),c.normalized){var A=Ca(Kn[c.componentType]);g.multiplyScalar(A)}p.max(g)}else console.warn("glTF: Missing min/max properties for accessor POSITION.")}}l.expandByVector(p)}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,E=!1,S=0,C=e.targets.length;S<C;S++){var R=e.targets[S];if(R.POSITION!==void 0&&(w=!0),R.NORMAL!==void 0&&(E=!0),w&&E)break}if(!w&&!E)return t;var k=[];t.morphTargetsRelative=!0;for(var M=function(I,L){var T=e.targets[I];w?k.push(r.loadAccessor(T.POSITION).then(function(B){B&&(t.morphAttributes.position[I]=B)})):t.morphAttributes.position[I]=t.attributes.position,E?k.push(r.loadAccessor(T.NORMAL).then(function(B){B&&(t.morphAttributes.normal[I]=B)})):t.morphAttributes.normal[I]=t.attributes.normal},S=0,C=e.targets.length;S<C;S++)M(S,C);return Promise.all(k).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,v=s.length;d<v;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 nt(this.options.resourcePath,ia(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 Ca(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 gr=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}(),$d=function(n){se(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 lo(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=lo(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}(gr),eh="https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/draco/1.5.6/",Ds={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},Vs={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"},th=function(){function n(){this.decoderPath=eh,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||Ds,attributeTypes:i||Vs,useUniqueIDs:!!r};this.decodeGeometry(t,a).then(e)},n.prototype.decodeGeometry=function(t,e){var r=this;e===void 0&&(e={attributeIDs:Ds,attributeTypes:Vs,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,v){o._callbacks[s]={resolve:d,reject:v},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;e.setAttribute(a,new f.BufferAttribute(o,s))}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=Fn(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 */",zs].join(`
418
418
  `);t.workerSourceURL=URL.createObjectURL(new Blob([o]))})}else{var r=Fn(this.decoderPath+"draco_wasm_wrapper.js",{responseType:"text"}).then(function(o){return o.body}),i=Fn(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 */",zs].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}(),Wi=new th,zs=`
420
420
  let decoderConfig;
@@ -880,7 +880,7 @@ void main() {
880
880
  return ( value & ( value - 1 ) ) === 0 && value !== 0;
881
881
 
882
882
  }
883
- `,Ns="KHR_texture_basisu",dh=function(n){se(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[Ns])return null;var a=i.extensions[Ns],o=r.json.images[a.source],s=null;if(o.bufferView!==void 0)s=r.loadBufferView(o.bufferView).then(function(u){return ei.parse(u)});else if(o.uri)s=r.options.fetcher.ajax(r.resolveResouce(o.uri),{responseType:"arraybuffer"}).then(function(u){return ei.parse(u.body)});else throw new Error("glTF: Invalid image defs.");return s},t}(gr),Qs="KHR_texture_transform",hh=function(n){se(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[Qs]:void 0;return a?(a.texCoord!==void 0&&console.warn('glTF: Custom UV sets in "'+Qs+'" 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}(gr),ph=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(gr),vh=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(gr),Ta=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:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaiczfgiak6mbkkalTmbaAci6hHalhOaAcefgAclSmdxekkcbhlaHceGmdkdnakTmbavcjdfazfhiavazfpbdbhYcbhXinaiavcj;cbfaXfgopblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLaoakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEaoamfpblbg3cep9Ta3aQp9op9Hp9rg3aoaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;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,E){var S=a.exports.sbrk,C=b+3&-4,R=S(C*x),k=S(w.length),M=new Uint8Array(a.exports.memory.buffer);M.set(w,k);var I=m(R,b,x,k,w.length);if(I==0&&E&&E(R,C,x),y.set(M.subarray(R,R+b*x)),S(R-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=[],v=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 p(m,y,b,x,w){for(var E=d[0],S=1;S<d.length;++S)d[S].pending<E.pending&&(E=d[S]);return new Promise(function(C,R){var k=new Uint8Array(b),M=v++;E.pending+=m,E.requests[M]={resolve:C,reject:R},E.object.postMessage({id:M,count:m,size:y,source:k,mode:x,filter:w},[k.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,E){u(a.exports[c[w]],m,y,b,x,a.exports[l[E]])},decodeGltfBufferAsync:function(m,y,b,x,w){return d.length>0?p(m,y,b,c[x],l[w]):o.then(function(){var E=new Uint8Array(m*y);return u(a.exports[c[x]],E,m,y,b,a.exports[l[w]]),E})}}}(),Pa="EXT_meshopt_compression",mh=function(n){se(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[Pa]){var o=a.extensions[Pa],s=r.loadBuffer(o.buffer);if(!Ta.supported){if(i.extensionsRequired&&i.extensionsRequired.indexOf(Pa)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([s,Ta.ready]).then(function(u){var l=u[0],c=o.byteOffset||0,d=o.byteLength||0,v=o.count,A=o.byteStride,h=new ArrayBuffer(v*A),p=new Uint8Array(l,c,d);return Ta.decodeGltfBuffer(new Uint8Array(h),v,A,p,o.mode,o.filter),h})}else return null},t}(gr),Us="EXT_texture_webp",Ah=function(n){se(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 eu().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[Us]||!this.supportsWep)return null;var o=a.extensions[Us];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=Ji[c.magFilter]||f.LinearFilter,u.minFilter=Ji[c.minFilter]||f.LinearMipmapLinearFilter,u.wrapS=Xi[c.wrapS]||f.RepeatWrapping,u.wrapT=Xi[c.wrapT]||f.RepeatWrapping,u.onUpdate=function(){s.close()},u})},t}(gr),Ra="CESIUM_RTC",gh=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.emitResult=function(e,r){if(r.json.extensions[Ra]&&r.json.extensions[Ra].center){var i=r.json.extensions[Ra].center;e.CESIUM_RTC={center:new f.Vector3().fromArray(i)}}},t}(gr),yh=function(n){se(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],v=c[1],A=[],h=0;h<o.length;h++){var p=o[h],g=d[h],m=v[h];g.attributes.normal===void 0&&(m.flatShading=!0),g.attributes.tangent===void 0&&m.normalScale&&(m.normalScale.y*=-1);var y=p.mode||Oe.TRIANGLES,b=void 0;if(y===Oe.TRIANGLES||y===Oe.TRIANGLE_STRIP||y===Oe.TRIANGLE_FAN)if(y===Oe.TRIANGLE_STRIP?g=r.toGeometryTrianglesDrawMode(g,f.TriangleStripDrawMode):y===Oe.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 nu(g,[m]);g.attributes.skinWeight.normalized||x.normalizeSkinWeights(),b=x}else b=new Ct(g,[m]);else if(y===Oe.POINTS)b=new ar(g,m);else throw new Error("glTF: Primitive mode unsupported: "+y);b.name=r.createUniqueName(a.name||"mesh_"+e),A.push(b)}if(A.length===1)return A[0];for(var w=new f.Group,E=0,S=A;E<S.length;E++){var b=S[E];w.add(b)}return w});return l},t.prototype.loadPBMMaterial=function(e,r){var i,a=(i=e.mode)!==null&&i!==void 0?i:Oe.TRIANGLES,o=null;if(a===Oe.TRIANGLES||a===Oe.TRIANGLE_STRIP||a===Oe.TRIANGLE_FAN)o=this.loadPBMMeshMaterial(e,r);else if(a===Oe.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 gi;return Object.keys(e.attributes).filter(function(a){return Ot[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 Ar("basic");if(a.color=new f.Color(1,1,1),Object.keys(e.attributes).filter(function(c){return Ot[c]==="color"}).length>0&&(a.vertexColors=!0),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),a.refreshUniforms(),Promise.all(i).then(function(){return a})},t}(gr),un={KHR_binary_glTF:$d,KHR_draco_mesh_compression:rh,KHR_texture_basisu:dh,KHR_texture_transform:hh,KHR_mesh_quantization:ph,KHR_materials_unlit:vh,EXT_meshopt_compression:mh,EXT_texture_webp:Ah,CESIUM_RTC:gh,PBM_mesh:yh};function Do(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 un&&(a[u]=new un[u])}var l,c;if(typeof n=="string")c=n;else{var d=un.KHR_binary_glTF.getMagic(n);if(d===un.KHR_binary_glTF.HEADER_MAGIC){l=new un.KHR_binary_glTF;try{l.loadGlbBinary(n)}catch(m){return Promise.reject(m)}a.KHR_binary_glTF=l,c=l.content}else c=lo(new Uint8Array(n))}var v=JSON.parse(c);if(v.asset===void 0||Number(v.asset.version[0])<2)return Promise.reject(new Error("glTF: Unsupported asset. glTF versions >=2.0 are supported."));if(v.extensionsUsed)for(var A=v.extensionsRequired||[],h=0;h<v.extensionsUsed.length;h++){var p=v.extensionsUsed[h];a[p]||(un[p]?a[p]=new un[p]:A.indexOf(p)>=0&&console.warn('glTF: Unknown extension "'+p+'".'))}var g=new Yd(v,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 bh=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function Ou(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new Rt({allowHosts:["*"]}),i={uri:n,gltfUpAxis:t.upAxis};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 Bu(i,a,o)}).then(function(o){return ku(i,a,o)}).then(function(o){return Xd(i,a,o)})}).then(function(){var a;return Do(i.gltfArrayBuffer,{copyUV2:!1,addonExtensions:["PBM_mesh"],resourcePath:n.slice(0,n.lastIndexOf("/")+1),search:(a=n.split("?")[1])!==null&&a!==void 0?a:"",fetcher:r}).then(function(o){var s=new f.Matrix4;t.upAxis!=="Z"&&s.premultiply(bh);var u=new f.Matrix4().setPosition(i.rtcCenter[0],i.rtcCenter[1],i.rtcCenter[2]);if(s.premultiply(u),o.CESIUM_RTC){var l=new f.Matrix4().setPosition(o.CESIUM_RTC.center);s.premultiply(l)}var c=o.scene;return c.applyMatrix4(s),delete i.featureTableBinary,delete i.batchTableBinary,delete i.gltfArrayBuffer,{type:"b3dm",uri:i.uri,byteLength:i.byteLength,scene:c,textures:o.textures,dispose:function(){return o.dispose()}}})})}const Du="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Z1bmN0aW9uIEIoYSl7b25tZXNzYWdlPWZ1bmN0aW9uKHIpe1Byb21pc2UucmVzb2x2ZShyLmRhdGEpLnRoZW4oZnVuY3Rpb24obil7cmV0dXJuIGEobil9KS50aGVuKGZ1bmN0aW9uKG4pe3ZhciBlPW4ub3V0cHV0LHQ9bi50cmFuc2ZlcjtyZXR1cm4gcG9zdE1lc3NhZ2UoZSx0KX0pLmNhdGNoKGZ1bmN0aW9uKG4pe3JldHVybiBwb3N0TWVzc2FnZSh7JCRlcnJvcjpufSl9KX19dmFyIHUseTsoZnVuY3Rpb24oYSl7YVthLkJZVE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7aWYoYS5oYXNQcm9wZXJ0eSgiTk9STUFMIikpe2Zvcih2YXIgcj1hLmdldFByb3BlcnR5QXJyYXkoIk5PUk1BTCIseS5GTE9BVCwzKSxuPXIubGVuZ3RoLzMsZT1uZXcgSW50OEFycmF5KG4qNCksdD0wLGk9dm9pZCAwLG89dm9pZCAwO3Q8bjt0Kyspbz10KjQsaT10KjMsZVtvXT1yW2ldKmgsZVsrK29dPXJbKytpXSpoLGVbKytvXT1yWysraV0qaDtyZXR1cm57YXJyYXk6ZSxpdGVtU2l6ZTo0LG5vcm1hbGl6ZWQ6ITB9fWVsc2UgaWYoYS5oYXNQcm9wZXJ0eSgiTk9STUFMX09DVDE2UCIpKXtmb3IodmFyIHI9YS5nZXRQcm9wZXJ0eUFycmF5KCJOT1JNQUxfT0NUMTZQIix5LlVOU0lHTkVEX0JZVEUsMiksbj1yLmxlbmd0aC8yLGU9bmV3IEludDhBcnJheShuKjQpLHQ9MCx2PXZvaWQgMCxBPXZvaWQgMCxOPXZvaWQgMCxFPXZvaWQgMCxTPXZvaWQgMCxzPXZvaWQgMCxUPXZvaWQgMDt0PG47dCsrKXY9dCoyLEE9clt2XSpELTEsTj1yWysrdl0qRC0xLFM9QTwwPy1BOkEscz1OPDA/LU46TixFPTEtKFMrcyksRTwwJiYoQT0oMS1zKSooQTwwPy0xOjEpLE49KDEtUykqKE48MD8tMToxKSksVD1NYXRoLnNxcnQoQSpBK04qTitFKkUpLHY9dCo0LGVbdl09QS9UKmgsZVsrK3ZdPU4vVCpoLGVbKyt2XT1FL1QqaDtyZXR1cm57YXJyYXk6ZSxpdGVtU2l6ZTo0LG5vcm1hbGl6ZWQ6ITB9fXJldHVybiBudWxsfX0pKCk7Cg==",xh=n=>Uint8Array.from(atob(n),t=>t.charCodeAt(0)),Hs=typeof self!="undefined"&&self.Blob&&new Blob([xh(Du)],{type:"text/javascript;charset=utf-8"});function wh(n){let t;try{if(t=Hs&&(self.URL||self.webkitURL).createObjectURL(Hs),!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,"+Du,{name:n==null?void 0:n.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var Eh=new Mu(function(){return new wh},2);function Sh(n,t,e){var r=new Fu(n.featureTableJson,n.featureTableBinary);return Promise.resolve().then(function(){var i=r.getExtension("3DTILES_draco_point_compression");return i?Mh(i,r):Eh.postMessage({featureTableBinary:r.buffer,featureTableJson:r.json},[r.buffer.buffer])}).then(function(i){return n.attributes=i,e})}function Mh(n,t){return ea(this,void 0,void 0,function(){var e,r,i,a,o,s;return ta(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,Wi.decodeGeometry(a.buffer,{attributeIDs:o,attributeTypes:s,useUniqueIDs:!0}).then(function(l){var c=l.getAttribute("POSITION"),d=l.getAttribute("RGB"),v=l.getAttribute("RGBA"),A=l.getAttribute("NORMAL"),h;if(v)h=v;else if(d){for(var p=d.count,g=d.array,m=new Uint8Array(p*4),y=0,b=void 0,x=void 0;y<p;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 Vu(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new Rt({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 Bu(i,a,o)}).then(function(o){return ku(i,a,o)}).then(function(o){return Sh(i,a,o)})}).then(function(){var a;return Ch(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",uri:i.uri,byteLength:i.byteLength,scene:a.object,textures:[],dispose:function(){return a.dispose()}}})}function Ch(n,t){var e=new Set,r=new f.BufferGeometry;e.add(r);var i=new gi;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 ar(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,v,A,h,p,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)v=this._literalDecoder.getDecoder(l++,c),i>=7?c=v.decodeWithMatchByte(this._rangeDecoder,this._outWindow.getByte(a)):c=v.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,p=this._posSlotDecoder[A<=5?A-2:3].decode(this._rangeDecoder),p>=4){if(g=(p>>1)-1,a=(2|p&1)<<g,p<14)a+=n.reverseDecode2(this._posDecoders,a-p-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=p;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 Ih=zu();function Th(){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,v,A;e[e.length-1]==="="&&(o--,e[e.length-2]==="="&&o--);var h=new ArrayBuffer(o),p=new Uint8Array(h);for(u=0;u<s;u+=4)c=i[e.charCodeAt(u)],d=i[e.charCodeAt(u+1)],v=i[e.charCodeAt(u+2)],A=i[e.charCodeAt(u+3)],p[l++]=c<<2|d>>4,p[l++]=(d&15)<<4|v>>2,p[l++]=(v&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/QRQQASIAQQA2AgAgAEEAOgAEIABBADYCCCAAQQA2AgwgAEEANgIQIABBDTYCCCAAC0IBAX9BGRABIgBBADYCACAAQQA2AgQgAEEANgIIIABBADYCDCAAQQA2AhAgAEEANgIUIABBADoAGCAAQQA2AhAgAAu1AgEEf0HQABABIgBBADoAACAAQQA2AgQgAEE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AAAAdQBzAGUAIABzAHQAcgBpAGMAdABBIAsdDQAAAH4AbABpAGIALwBhAHIAcgBhAHkALgB0AHMAQcAACzkbAAAAfgBsAGkAYgAvAGkAbgB0AGUAcgBuAGEAbAAvAHQAeQBwAGUAZABhAHIAcgBhAHkALgB0AHMAQYABCzMYAAAAcwByAGMALwBsAHoAbQBhAC8AbAB6AG0AYQAtAGQAZQBjAG8AZABlAHIALgB0AHM=";return n(t)}function Ph(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 Rh(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),v=d[0],A=d[2],h=d[3];v?e(null,new Uint8Array(i.buffer,h+r,A).slice(0,A)):e(new Error("lzma deocder error"))}catch(p){e(p)}}var Bh=`
883
+ `,Ns="KHR_texture_basisu",dh=function(n){se(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[Ns])return null;var a=i.extensions[Ns],o=r.json.images[a.source],s=null;if(o.bufferView!==void 0)s=r.loadBufferView(o.bufferView).then(function(u){return ei.parse(u)});else if(o.uri)s=r.options.fetcher.ajax(r.resolveResouce(o.uri),{responseType:"arraybuffer"}).then(function(u){return ei.parse(u.body)});else throw new Error("glTF: Invalid image defs.");return s},t}(gr),Qs="KHR_texture_transform",hh=function(n){se(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[Qs]:void 0;return a?(a.texCoord!==void 0&&console.warn('glTF: Custom UV sets in "'+Qs+'" 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}(gr),ph=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(gr),vh=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(gr),Ta=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:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaiczfgiak6mbkkalTmbaAci6hHalhOaAcefgAclSmdxekkcbhlaHceGmdkdnakTmbavcjdfazfhiavazfpbdbhYcbhXinaiavcj;cbfaXfgopblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLaoakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEaoamfpblbg3cep9Ta3aQp9op9Hp9rg3aoaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;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,E){var S=a.exports.sbrk,C=b+3&-4,R=S(C*x),k=S(w.length),M=new Uint8Array(a.exports.memory.buffer);M.set(w,k);var I=m(R,b,x,k,w.length);if(I==0&&E&&E(R,C,x),y.set(M.subarray(R,R+b*x)),S(R-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=[],v=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 p(m,y,b,x,w){for(var E=d[0],S=1;S<d.length;++S)d[S].pending<E.pending&&(E=d[S]);return new Promise(function(C,R){var k=new Uint8Array(b),M=v++;E.pending+=m,E.requests[M]={resolve:C,reject:R},E.object.postMessage({id:M,count:m,size:y,source:k,mode:x,filter:w},[k.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,E){u(a.exports[c[w]],m,y,b,x,a.exports[l[E]])},decodeGltfBufferAsync:function(m,y,b,x,w){return d.length>0?p(m,y,b,c[x],l[w]):o.then(function(){var E=new Uint8Array(m*y);return u(a.exports[c[x]],E,m,y,b,a.exports[l[w]]),E})}}}(),Pa="EXT_meshopt_compression",mh=function(n){se(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[Pa]){var o=a.extensions[Pa],s=r.loadBuffer(o.buffer);if(!Ta.supported){if(i.extensionsRequired&&i.extensionsRequired.indexOf(Pa)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([s,Ta.ready]).then(function(u){var l=u[0],c=o.byteOffset||0,d=o.byteLength||0,v=o.count,A=o.byteStride,h=new ArrayBuffer(v*A),p=new Uint8Array(l,c,d);return Ta.decodeGltfBuffer(new Uint8Array(h),v,A,p,o.mode,o.filter),h})}else return null},t}(gr),Us="EXT_texture_webp",Ah=function(n){se(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 eu().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[Us]||!this.supportsWep)return null;var o=a.extensions[Us];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=_i[c.magFilter]||f.LinearFilter,u.minFilter=_i[c.minFilter]||f.LinearMipmapLinearFilter,u.wrapS=Xi[c.wrapS]||f.RepeatWrapping,u.wrapT=Xi[c.wrapT]||f.RepeatWrapping,u.onUpdate=function(){s.close()},u})},t}(gr),Ra="CESIUM_RTC",gh=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.emitResult=function(e,r){if(r.json.extensions[Ra]&&r.json.extensions[Ra].center){var i=r.json.extensions[Ra].center;e.CESIUM_RTC={center:new f.Vector3().fromArray(i)}}},t}(gr),yh=function(n){se(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],v=c[1],A=[],h=0;h<o.length;h++){var p=o[h],g=d[h],m=v[h];g.attributes.normal===void 0&&(m.flatShading=!0),g.attributes.tangent===void 0&&m.normalScale&&(m.normalScale.y*=-1);var y=p.mode||Oe.TRIANGLES,b=void 0;if(y===Oe.TRIANGLES||y===Oe.TRIANGLE_STRIP||y===Oe.TRIANGLE_FAN)if(y===Oe.TRIANGLE_STRIP?g=r.toGeometryTrianglesDrawMode(g,f.TriangleStripDrawMode):y===Oe.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 nu(g,[m]);g.attributes.skinWeight.normalized||x.normalizeSkinWeights(),b=x}else b=new Ct(g,[m]);else if(y===Oe.POINTS)b=new ar(g,m);else throw new Error("glTF: Primitive mode unsupported: "+y);b.name=r.createUniqueName(a.name||"mesh_"+e),A.push(b)}if(A.length===1)return A[0];for(var w=new f.Group,E=0,S=A;E<S.length;E++){var b=S[E];w.add(b)}return w});return l},t.prototype.loadPBMMaterial=function(e,r){var i,a=(i=e.mode)!==null&&i!==void 0?i:Oe.TRIANGLES,o=null;if(a===Oe.TRIANGLES||a===Oe.TRIANGLE_STRIP||a===Oe.TRIANGLE_FAN)o=this.loadPBMMeshMaterial(e,r);else if(a===Oe.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 gi;return Object.keys(e.attributes).filter(function(a){return Ot[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 Ar("basic");if(a.color=new f.Color(1,1,1),Object.keys(e.attributes).filter(function(c){return Ot[c]==="color"}).length>0&&(a.vertexColors=!0),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),a.refreshUniforms(),Promise.all(i).then(function(){return a})},t}(gr),un={KHR_binary_glTF:$d,KHR_draco_mesh_compression:rh,KHR_texture_basisu:dh,KHR_texture_transform:hh,KHR_mesh_quantization:ph,KHR_materials_unlit:vh,EXT_meshopt_compression:mh,EXT_texture_webp:Ah,CESIUM_RTC:gh,PBM_mesh:yh};function Do(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 un&&(a[u]=new un[u])}var l,c;if(typeof n=="string")c=n;else{var d=un.KHR_binary_glTF.getMagic(n);if(d===un.KHR_binary_glTF.HEADER_MAGIC){l=new un.KHR_binary_glTF;try{l.loadGlbBinary(n)}catch(m){return Promise.reject(m)}a.KHR_binary_glTF=l,c=l.content}else c=lo(new Uint8Array(n))}var v=JSON.parse(c);if(v.asset===void 0||Number(v.asset.version[0])<2)return Promise.reject(new Error("glTF: Unsupported asset. glTF versions >=2.0 are supported."));if(v.extensionsUsed)for(var A=v.extensionsRequired||[],h=0;h<v.extensionsUsed.length;h++){var p=v.extensionsUsed[h];a[p]||(un[p]?a[p]=new un[p]:A.indexOf(p)>=0&&console.warn('glTF: Unknown extension "'+p+'".'))}var g=new Yd(v,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 bh=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function Ou(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new Rt({allowHosts:["*"]}),i={uri:n,gltfUpAxis:t.upAxis};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 Bu(i,a,o)}).then(function(o){return ku(i,a,o)}).then(function(o){return Xd(i,a,o)})}).then(function(){var a;return Do(i.gltfArrayBuffer,{copyUV2:!1,addonExtensions:["PBM_mesh"],resourcePath:n.slice(0,n.lastIndexOf("/")+1),search:(a=n.split("?")[1])!==null&&a!==void 0?a:"",fetcher:r}).then(function(o){var s=new f.Matrix4;t.upAxis!=="Z"&&s.premultiply(bh);var u=new f.Matrix4().setPosition(i.rtcCenter[0],i.rtcCenter[1],i.rtcCenter[2]);if(s.premultiply(u),o.CESIUM_RTC){var l=new f.Matrix4().setPosition(o.CESIUM_RTC.center);s.premultiply(l)}var c=o.scene;return c.applyMatrix4(s),delete i.featureTableBinary,delete i.batchTableBinary,delete i.gltfArrayBuffer,{type:"b3dm",uri:i.uri,byteLength:i.byteLength,scene:c,textures:o.textures,dispose:function(){return o.dispose()}}})})}const Du="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Z1bmN0aW9uIEIoYSl7b25tZXNzYWdlPWZ1bmN0aW9uKHIpe1Byb21pc2UucmVzb2x2ZShyLmRhdGEpLnRoZW4oZnVuY3Rpb24obil7cmV0dXJuIGEobil9KS50aGVuKGZ1bmN0aW9uKG4pe3ZhciBlPW4ub3V0cHV0LHQ9bi50cmFuc2ZlcjtyZXR1cm4gcG9zdE1lc3NhZ2UoZSx0KX0pLmNhdGNoKGZ1bmN0aW9uKG4pe3JldHVybiBwb3N0TWVzc2FnZSh7JCRlcnJvcjpufSl9KX19dmFyIHUseTsoZnVuY3Rpb24oYSl7YVthLkJZVEU9NTEyMF09IkJZVEUiLGFbYS5VTlNJR05FRF9CWVRFPTUxMjFdPSJVTlNJR05FRF9CWVRFIixhW2EuU0hPUlQ9NTEyMl09IlNIT1JUIixhW2EuVU5TSUdORURfU0hPUlQ9NTEyM109IlVOU0lHTkVEX1NIT1JUIixhW2EuSU5UPTUxMjRdPSJJTlQiLGFbYS5VTlNJR05FRF9JTlQ9NTEyNV09IlVOU0lHTkVEX0lOVCIsYVthLkZMT0FUPTUxMjZdPSJGTE9BVCIsYVthLkRPVUJMRT01MTMwXT0iRE9VQkxFIn0pKHl8fCh5PXt9KSk7d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c2UgaWYoYS5oYXNQcm9wZXJ0eSgiTk9STUFMX09DVDE2UCIpKXtmb3IodmFyIHI9YS5nZXRQcm9wZXJ0eUFycmF5KCJOT1JNQUxfT0NUMTZQIix5LlVOU0lHTkVEX0JZVEUsMiksbj1yLmxlbmd0aC8yLGU9bmV3IEludDhBcnJheShuKjQpLHQ9MCx2PXZvaWQgMCxBPXZvaWQgMCxOPXZvaWQgMCxFPXZvaWQgMCxTPXZvaWQgMCxzPXZvaWQgMCxUPXZvaWQgMDt0PG47dCsrKXY9dCoyLEE9clt2XSpELTEsTj1yWysrdl0qRC0xLFM9QTwwPy1BOkEscz1OPDA/LU46TixFPTEtKFMrcyksRTwwJiYoQT0oMS1zKSooQTwwPy0xOjEpLE49KDEtUykqKE48MD8tMToxKSksVD1NYXRoLnNxcnQoQSpBK04qTitFKkUpLHY9dCo0LGVbdl09QS9UKmgsZVsrK3ZdPU4vVCpoLGVbKyt2XT1FL1QqaDtyZXR1cm57YXJyYXk6ZSxpdGVtU2l6ZTo0LG5vcm1hbGl6ZWQ6ITB9fXJldHVybiBudWxsfX0pKCk7Cg==",xh=n=>Uint8Array.from(atob(n),t=>t.charCodeAt(0)),Hs=typeof self!="undefined"&&self.Blob&&new Blob([xh(Du)],{type:"text/javascript;charset=utf-8"});function wh(n){let t;try{if(t=Hs&&(self.URL||self.webkitURL).createObjectURL(Hs),!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,"+Du,{name:n==null?void 0:n.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var Eh=new Mu(function(){return new wh},2);function Sh(n,t,e){var r=new Fu(n.featureTableJson,n.featureTableBinary);return Promise.resolve().then(function(){var i=r.getExtension("3DTILES_draco_point_compression");return i?Mh(i,r):Eh.postMessage({featureTableBinary:r.buffer,featureTableJson:r.json},[r.buffer.buffer])}).then(function(i){return n.attributes=i,e})}function Mh(n,t){return ea(this,void 0,void 0,function(){var e,r,i,a,o,s;return ta(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,Wi.decodeGeometry(a.buffer,{attributeIDs:o,attributeTypes:s,useUniqueIDs:!0}).then(function(l){var c=l.getAttribute("POSITION"),d=l.getAttribute("RGB"),v=l.getAttribute("RGBA"),A=l.getAttribute("NORMAL"),h;if(v)h=v;else if(d){for(var p=d.count,g=d.array,m=new Uint8Array(p*4),y=0,b=void 0,x=void 0;y<p;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 Vu(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new Rt({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 Bu(i,a,o)}).then(function(o){return ku(i,a,o)}).then(function(o){return Sh(i,a,o)})}).then(function(){var a;return Ch(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",uri:i.uri,byteLength:i.byteLength,scene:a.object,textures:[],dispose:function(){return a.dispose()}}})}function Ch(n,t){var e=new Set,r=new f.BufferGeometry;e.add(r);var i=new gi;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 ar(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,v,A,h,p,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)v=this._literalDecoder.getDecoder(l++,c),i>=7?c=v.decodeWithMatchByte(this._rangeDecoder,this._outWindow.getByte(a)):c=v.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,p=this._posSlotDecoder[A<=5?A-2:3].decode(this._rangeDecoder),p>=4){if(g=(p>>1)-1,a=(2|p&1)<<g,p<14)a+=n.reverseDecode2(this._posDecoders,a-p-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=p;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 Ih=zu();function Th(){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,v,A;e[e.length-1]==="="&&(o--,e[e.length-2]==="="&&o--);var h=new ArrayBuffer(o),p=new Uint8Array(h);for(u=0;u<s;u+=4)c=i[e.charCodeAt(u)],d=i[e.charCodeAt(u+1)],v=i[e.charCodeAt(u+2)],A=i[e.charCodeAt(u+3)],p[l++]=c<<2|d>>4,p[l++]=(d&15)<<4|v>>2,p[l++]=(v&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/QRQQASIAQQA2AgAgAEEAOgAEIABBADYCCCAAQQA2AgwgAEEANgIQIABBDTYCCCAAC0IBAX9BGRABIgBBADYCACAAQQA2AgQgAEEANgIIIABBADYCDCAAQQA2AhAgAEEANgIUIABBADoAGCAAQQA2AhAgAAu1AgEEf0HQABABIgBBADoAACAAQQA2AgQgAEEANgIIIABBADYCDCAAQQA2AhAgAEEAOgAUIABBADYCGCAAQQA2AhwgAEEANgIgIABBADYCJCAAQQA2AiggAEEANgIsIABBADYCMCAAQQA2AjQgAEEANgI4IABBADYCPCAAQQA2AkAgAEEANgJEIABBADYCSCAAQQA2AkxBBBAEIQIDQCABQQRIBEBBBhAHIQMgAigCACABQQJ0aiADNgIIIAFBAWohAQwBCwsgACACNgIkIABBBBAHNgIoIABB8wAQBjYCLCAAQcABEAY2AjAgAEEMEAY2AjQgAEEMEAY2AjggAEEMEAY2AjwgAEEMEAY2AkAgAEHAARAGNgJEIAAQCDYCSCAAEAg2AkwgABAJNgIEIAAQCjYCCCAACx8BAX9BCBABIgBBADYCACAAQQA2AgQgABALNgIAIAALCgAjACQBEAwkAwthAQF/IAFB+P///wNLBEBBAEHAAEEXQSIQAAALIAEQAiICQQhqIAEQAyAARQRAQQwQASEACyAAQQA2AgAgAEEANgIEIABBADYCCCAAIAI2AgAgAEEANgIEIAAgATYCCCAACwoAQQwQASAAEA4LBgAgABAPCyoAIAEgACgCCE8EQEEAQcAAQSdBPxAAAAsgACgCBCABIAAoAgBqai0ACAssACABIAAoAghPBEBBAEHAAEEyQT8QAAALIAAoAgQgASAAKAIAamogAjoACAtkAQJ/QQ0QDyECA0AgAUENSARAIAIgASAAIAEQEUH/AXEQEiABQQFqIQEMAQsLQQAhAEEAIQEDQCABQQhIBEAgAiABQQVqEBFB/wFxIAFBA3R0IAByIQAgAUEBaiEBDAELCyAACwYAIAAQEwsnACAAIAEQDzYCCCAAQQA2AgwgACABNgIUIABBADoAGCAAQQA2AgALJAAgACgCCCAAKAIYEBUgAEGABiAAKAIMIAAtABRqdBAGNgIgC5UBAQR/IAEhBSAAIgYoAgAhASAAKAIEIQcgACgCCEEBdiEEIAJBAEgEfyACIARqIgBBACAAQQBKGwUgAiIAIAQgACAESBsLIQIgA0EASAR/IAMgBGoiAEEAIABBAEobBSADIgAgBCAAIARIGwshAwNAIAIgA05FBEAgAkEBdCABaiAHaiAFOwEIIAJBAWohAgwBCwsgBgssAQF/AkACQAJAIwRBAWsOAwEBAgALAAtB/////wchAQsgAEGACEEAIAEQFwvBAQECfyAAQQIQBjYCACAAKAIAIgEoAgAgASgCBGpBgAg7AQggACgCACICKAIAIQEgAigCBCABQQJqakGACDsBCCAAKAIMKAIAQQEkBBAYGkEAIQIDQCACQRBIBEAgAiAAKAIEKAIAIgEoAgBBAnZJBH8gAkECdCABaigCCAUACygCAEEBJAQQGBogAiAAKAIIKAIAIgEoAgBBAnZJBH8gAkECdCABaigCCAUACygCAEEBJAQQGBogAkEBai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QEUH/AXEQEiADQQFqIQMMAQsLIAAoAgAhBCACIQZBBBAPIgIoAgQgAigCAGogBigCBCAGKAIAai0ACCIDOgAIIANB/wFxQeEBTwRAQQBBgAFBoQFBDBAAAAsgAigCBCACKAIAQQFqaiADQf8BcUEJcCIHOgAIIAIoAgQgAigCAGogA0H/AXFBCW4iAzoACCADQQVwIQUgAigCBCACKAIAQQJqaiADQQVuIgM6AAggAigCBCACKAIAQQNqaiAFOgAIIAQgBzYCDCAEIAM2AhAgBCAFOgAUIARBADYCHEEAIQIDQAJAIAJBBE8NACAEIAQoAhwgBigCBCAGKAIAIAJBAWpqai0ACCACQQN0dHI2AhwgAkEBaiECDAELCyAEIAQoAhw2AhggBCgCGEGAIEkEQCAEQYAgNgIYC0EAIQJBACEFQQAhAwNAAkAgA0EITg0AIAYgA0EFahARQf8BcSIEQf8BRwRAQQEhBQsgBCADQQN0dCACciECIANBAWohAwwBCwsgACgCACAFRToAACAAKAIAKAIEIAE2AgAgACgCABAWAkAgACgCACAFIAIQICIBQQFGDQAgAUEDRwRAIAFBAkYEQCAFBEAgACgCACgCCCgCECACRw0DCwUMAgsLIAAoAgAoAgQtAAQaQQFBACAAKAIAKAIIKAIQIAAoAgAoAggoAgQQIQ8LQQBBAUEAQQAQIQsIACMDIAAQIgsWAEG4ASQAIwAkAUGAgIAIJAIQDCQDCwMAAQsLtwEEAEEICxcKAAAAdQBzAGUAIABzAHQAcgBpAGMAdABBIAsdDQAAAH4AbABpAGIALwBhAHIAcgBhAHkALgB0AHMAQcAACzkbAAAAfgBsAGkAYgAvAGkAbgB0AGUAcgBuAGEAbAAvAHQAeQBwAGUAZABhAHIAcgBhAHkALgB0AHMAQYABCzMYAAAAcwByAGMALwBsAHoAbQBhAC8AbAB6AG0AYQAtAGQAZQBjAG8AZABlAHIALgB0AHM=";return n(t)}function Ph(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 Rh(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),v=d[0],A=d[2],h=d[3];v?e(null,new Uint8Array(i.buffer,h+r,A).slice(0,A)):e(new Error("lzma deocder error"))}catch(p){e(p)}}var Bh=`
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",Nu="";if(co)try{var Fh=new Blob([Bh],{type:"text/javascript"});Nu=URL.createObjectURL(Fh)}catch(n){}var Qu=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(Nu);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 qs(n){return Array.prototype.reduce.call(n,function(t,e,r){return t|e<<r*8},0)}function Lh(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 v=Math.floor(this.offset/u);this.data[v]||(this.data[v]=new Uint8Array(u)),this.data[v][this.offset%u]=d,this.offset++}};Ih.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 kh(n){for(var t=[],e=n.length,r=function(a){t.push(new Promise(function(o,s){var u=new Qu;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 Uu(n){var t=new Uint8Array(n),e=qs(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]=qs(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 Qu.support?kh(r):Promise.resolve(Lh(r))}var Ba=!1,Hu=[];function qu(n){if(n===void 0&&(n=!1),!(!n&&Ba)){Ba=!0;var t=Hu.shift();if(t){try{t()}catch(e){}ht.shared.add(function(){return qu(!0)},!0,2,-100)}else Ba=!1}}function Zi(n){return new Promise(function(t,e){var r=function(){try{t(n())}catch(i){e(i)}};Hu.push(r),ht.shared.add(function(){return qu()},!0,2,-100)})}function Ut(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 Oh(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}const $r=Zr.Reader,ir=Zr.util,Ht=Zr.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]||(Zr.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]={}),Gu=Ht.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=ir.emptyArray,n.prototype.createAt=ir.Long?ir.Long.fromBits(0,0,!0):0,n.prototype.description="",n.decode=function(e,r){e instanceof $r||(e=$r.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ht.Model;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.chunks&&a.chunks.length||(a.chunks=[]),a.chunks.push(Ht.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})();Ht.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 $r||(e=$r.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ht.Chunk;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.vertices=Ht.Vertices.decode(e,e.uint32());break}case 2:{a.faces=Ht.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 ir.ProtocolError("missing required 'vertices'",{instance:a});if(!a.hasOwnProperty("faces"))throw ir.ProtocolError("missing required 'faces'",{instance:a});if(!a.hasOwnProperty("name"))throw ir.ProtocolError("missing required 'name'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();Ht.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=ir.emptyArray,n.prototype.uvs=ir.emptyArray,n.prototype.marks=ir.emptyArray,n.decode=function(e,r){e instanceof $r||(e=$r.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ht.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})();Ht.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=ir.emptyArray,n.prototype.normals=ir.emptyArray,n.decode=function(e,r){e instanceof $r||(e=$r.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ht.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})();Ht.VertexMark=(()=>{const n={},t=Object.create(n);return t[n[0]="VERTEX_MARK_UNSPECIFIED"]=0,t[n[1]="VERTEX_MARK_ROOF"]=1,t})();function Ku(n,t){var e,r,i,a;t===void 0&&(t={});var o=(e=t.fetcher)!==null&&e!==void 0?e:new Rt({allowHosts:["*"]}),s={byteLength:0},u=zo((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 v=d[c];l[v]=Vo(v,u,o)}return Promise.resolve().then(function(){return o.ajax(n,{responseType:"arraybuffer"})}).then(function(A){return s.byteLength=A.body.byteLength,Zi(function(){var h=new Uint8Array(A.body);return Gu.decode(h)})}).then(function(A){return Zi(function(){var h,p;return _u(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""}(),((p=t.textureArray)!==null&&p!==void 0?p:[]).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 p=0,g=A.objects;p<g.length;p++){var m=g[p];h.add(m)}return{type:"pbm",uri:n,byteLength:s.byteLength,scene:h,textures:A.textures,dispose:function(){return A.dispose()}}})}function ju(n){var t=n.match(/(group|floor)-?(\d+)/);return t?parseInt(t[2],10):0}function fo(n){var t=n.match(/(chunk)-?(\d+)/);return t?parseInt(t[2],10):0}function Dh(n){var t=n.match(/(sub)-?(\d+)/);return t?parseInt(t[2],10):0}function Gs(n){var t=ju(n.name),e=fo(n.name),r=Dh(n.name);return t*1e6+e*1e3+r}function Vh(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 v=0,A=n.chunks;v<A.length;v++){var d=A[v];if(!d.faces.normals||d.faces.normals.length===0){s=!1;break}}for(var h=n.chunks.sort(function(pe,ye){return Gs(pe)-Gs(ye)}),p=[],g=0,m=h;g<m.length;g++){var d=m[g],y=ju(d.name);p[y]||(p[y]=[]),p[y].push(d)}for(var b=0;b<p.length;b++){var x=p[b];if(x)if(s){for(var w=0,E=0;E<x.length;E++){var d=x[E];w+=d.faces.indices.length}for(var S=new Float32Array(w*3),C=new Float32Array(w*2),R=new Float32Array(w*3),k=u?new Float32Array(w):void 0,M=[],I=[1/0,1/0,1/0,-1/0,-1/0,-1/0],L=0,T=0;T<x.length;T++){for(var B=[1/0,1/0,1/0,-1/0,-1/0,-1/0],d=x[T],D=d.vertices.xyz,V=d.vertices.uvs,N=d.faces.indices,U=d.faces.normals,H=d.vertices.marks,G=N.length,E=0;E<G;E++){var j=N[E],_=S[L*3+E*3]=D[j*3],X=S[L*3+E*3+1]=D[j*3+1],Z=S[L*3+E*3+2]=D[j*3+2];k&&(k[L+E]=H[j]),C[L*2+E*2]=V[j*2],C[L*2+E*2+1]=V[j*2+1];var W=Math.floor(E/3)*3;R[L*3+E*3]=U[W],R[L*3+E*3+1]=U[W+1],R[L*3+E*3+2]=U[W+2],_<B[0]&&(B[0]=_),X<B[1]&&(B[1]=X),Z<B[2]&&(B[2]=Z),_>B[3]&&(B[3]=_),X>B[4]&&(B[4]=X),Z>B[5]&&(B[5]=Z)}B[0]<I[0]&&(I[0]=B[0]),B[1]<I[1]&&(I[1]=B[1]),B[2]<I[2]&&(I[2]=B[2]),B[3]>I[3]&&(I[3]=B[3]),B[4]>I[4]&&(I[4]=B[4]),B[5]>I[5]&&(I[5]=B[5]),M.push({materialIndex:T,name:d.name,chunkName:fo(d.name),start:L,count:d.faces.indices.length,texture:(e=d.texture)!==null&&e!==void 0?e:void 0}),L+=G}var $={createAt:i,description:a,vertices:S,uvs:C,normals:R,masks:k,indices:null,floorIndex:b,groups:M,extents:I};o.push($)}else{for(var w=0,Y=0,E=0;E<x.length;E++){var d=x[E];Y+=d.vertices.xyz.length/3,w+=d.faces.indices.length}for(var S=new Float32Array(Y*3),C=new Float32Array(Y*2),R=void 0,ne=new Float32Array(Y),te=new Uint32Array(w),k=u?new Float32Array(w):void 0,M=[],I=[1/0,1/0,1/0,-1/0,-1/0,-1/0],ue=0,L=0,T=0;T<x.length;T++){for(var B=[1/0,1/0,1/0,-1/0,-1/0,-1/0],d=x[T],D=d.vertices.xyz,ie=d.vertices.marks,V=d.vertices.uvs,N=d.faces.indices,ge=D.length/3,G=N.length,E=0;E<ge;E++){var _=S[L*3+E*3]=D[E*3],X=S[L*3+E*3+1]=D[E*3+1],Z=S[L*3+E*3+2]=D[E*3+2];k&&(k[L+E]=ie[E]),C[L*2+E*2]=V[E*2],C[L*2+E*2+1]=V[E*2+1],ne[L+E]=b,_<B[0]&&(B[0]=_),X<B[1]&&(B[1]=X),Z<B[2]&&(B[2]=Z),_>B[3]&&(B[3]=_),X>B[4]&&(B[4]=X),Z>B[5]&&(B[5]=Z)}B[0]<I[0]&&(I[0]=B[0]),B[1]<I[1]&&(I[1]=B[1]),B[2]<I[2]&&(I[2]=B[2]),B[3]>I[3]&&(I[3]=B[3]),B[4]>I[4]&&(I[4]=B[4]),B[5]>I[5]&&(I[5]=B[5]);for(var E=0;E<G;E++)te[ue+E]=L+N[E];M.push({materialIndex:T,name:d.name,chunkName:fo(d.name),start:ue,count:d.faces.indices.length,texture:(r=d.texture)!==null&&r!==void 0?r:void 0}),L+=ge,ue+=G}var $={createAt:i,description:a,vertices:S,uvs:C,normals:R,masks:k,indices:te,floorIndex:b,groups:M,extents:I};o.push($)}}return o}function Vo(n,t,e){var r=O({key:"texture.pbm"},Ut(t,["format","quality","size","sharpen","mappings"])),i=new Nn,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 _u(n,t,e,r,i,a){i===void 0&&(i={});for(var o=Vh(n),s=0,u="",l=[],c={},d=new Set,v=0,A=o;v<A.length;v++){var h=A[v],p=h.createAt,g=h.description,m=h.vertices,y=h.masks,b=h.uvs,x=h.normals,w=h.indices,E=h.floorIndex,S=h.groups,C=h.extents,R=new f.Box3;R.min.x=C[0],R.min.y=C[1],R.min.z=C[2],R.max.x=C[3],R.max.y=C[4],R.max.z=C[5];var k=new f.BufferGeometry;k.setAttribute("position",new f.BufferAttribute(m,3)),k.setAttribute("uv",new f.BufferAttribute(b,2)),x&&k.setAttribute("normal",new f.BufferAttribute(x,3)),y&&k.setAttribute("mask",new f.BufferAttribute(y,1)),w&&k.setIndex(new f.BufferAttribute(w,1)),k.boundingBox=R,k.boundingSphere=R.getBoundingSphere(new f.Sphere);for(var M=0,I=S;M<I.length;M++){var L=I[M];k.addGroup(L.start,L.count,L.materialIndex)}d.add(k);for(var T=[],B=0,D=S;B<D.length;B++){var L=D[B],V=e[L.chunkName]||(L.texture?nt(t||"",L.texture):void 0),N=new Ar("basic");N.floor=E,k.attributes.normal===void 0&&(N.flatShading=!0),k.attributes.mask&&(N.defines.USE_VERTEX_MARK=!0),T.push(N),V?c[V]?c[V].push(N):c[V]=[N]:N.color=new f.Color(16777215),d.add(N),N.refreshUniforms()}var U=new Ct(k,T);U.name="model_floor_"+E,U.userData.createAt=p,U.userData.description=g,U.matrix.compose(U.position,U.quaternion,U.scale),U.matrixAutoUpdate=!1,U.frustumCulled=!1,s=p,u=g,l.push(U)}var H=function(G){G=zo(G,e.length);for(var j=[],_=function($){var Y=null;$ in i&&(Y=i[$]),Y||(Y=Vo($,G,a)),j.push(Y.then(function(ne){for(var te=0,ue=c[$];te<ue.length;te++){var ie=ue[te];ie.map&&(d.delete(ie.map),ie.map.dispose()),ie.map=ne,ie.refreshUniforms(),d.add(ne)}return ne}).catch(function(){for(var ne=0,te=c[$];ne<te.length;ne++){var ue=te[ne];ue.map&&(d.delete(ue.map),ue.map.dispose()),ue.map=null,ue.color=new f.Color(16777215),ue.refreshUniforms()}return null}))},X=0,Z=Object.keys(c);X<Z.length;X++){var W=Z[X];_(W)}for(var W in i)delete i[W];return Promise.all(j).then(function($){return $.filter(function(Y){return Y})})};return H(r).then(function(G){return{createAt:s,description:u,objects:l,textures:G,dispose:function(){d.forEach(function(j){j.dispose()}),d.clear()}}})}function zo(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 Ju(n,t){var e,r,i,a;t===void 0&&(t={});var o=(e=t.fetcher)!==null&&e!==void 0?e:new Rt({allowHosts:["*"]}),s={byteLength:0},u=zo((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 v=d[c];l[v]=Vo(v,u,o)}return Promise.resolve().then(function(){return o.ajax(n,{responseType:"arraybuffer"})}).then(function(A){return Uu(A.body)}).then(function(A){return Zi(function(){for(var h,p={chunks:[],createAt:void 0,description:void 0},g=0,m=A;g<m.length;g++){var y=m[g],b=Gu.decode(y);b.chunks.length&&((h=p.chunks).push.apply(h,b.chunks),p.createAt=b.createAt,p.description=b.description)}return p})}).then(function(A){return Zi(function(){var h,p,g;return _u(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""}(),((p=t.textureArray)!==null&&p!==void 0?p:[]).slice(),(g=t.textureOptions)!==null&&g!==void 0?g:{},l,o)})}).then(function(A){var h=new f.Group;h.name=n;for(var p=0,g=A.objects;p<g.length;p++){var m=g[p];h.add(m)}return{type:"at3d",uri:n,byteLength:s.byteLength,scene:h,textures:A.textures,dispose:function(){return A.dispose()}}})}const We=Zr.Reader,ut=Zr.util,Pe=Zr.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]||(Zr.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]={}),zh=Pe.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=ut.emptyArray,n.decode=function(e,r){e instanceof We||(e=We.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.Model;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.meshes&&a.meshes.length||(a.meshes=[]),a.meshes.push(Pe.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})();Pe.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=ut.emptyArray,n.prototype.matrix=ut.emptyArray,n.decode=function(e,r){e instanceof We||(e=We.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.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(Pe.Chunk.decode(e,e.uint32()));break}case 3:{a.matrix&&a.matrix.length||(a.matrix=[]),a.matrix.push(Pe.Matrix.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("name"))throw ut.ProtocolError("missing required 'name'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Mesh"},n})();Pe.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=ut.emptyArray,n.decode=function(e,r){e instanceof We||(e=We.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.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})();Pe.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=ut.emptyArray,n.decode=function(e,r){e instanceof We||(e=We.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.Chunk;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 2:{a.geometry=Pe.Geometry.decode(e,e.uint32());break}case 3:{a.material&&a.material.length||(a.material=[]),a.material.push(Pe.Material.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("geometry"))throw ut.ProtocolError("missing required 'geometry'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();Pe.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=ut.emptyArray,n.decode=function(e,r){e instanceof We||(e=We.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.Geometry;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.position=Pe.Position.decode(e,e.uint32());break}case 2:{a.uv=Pe.UV.decode(e,e.uint32());break}case 3:{a.uv2=Pe.UV.decode(e,e.uint32());break}case 4:{a.normal=Pe.Normal.decode(e,e.uint32());break}case 5:{a.groups&&a.groups.length||(a.groups=[]),a.groups.push(Pe.Group.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("position"))throw ut.ProtocolError("missing required 'position'",{instance:a});if(!a.hasOwnProperty("normal"))throw ut.ProtocolError("missing required 'normal'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Geometry"},n})();Pe.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=ut.emptyArray,n.decode=function(e,r){e instanceof We||(e=We.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.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})();Pe.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=ut.emptyArray,n.decode=function(e,r){e instanceof We||(e=We.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.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})();Pe.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=ut.emptyArray,n.decode=function(e,r){e instanceof We||(e=We.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.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})();Pe.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 We||(e=We.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.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 ut.ProtocolError("missing required 'start'",{instance:a});if(!a.hasOwnProperty("count"))throw ut.ProtocolError("missing required 'count'",{instance:a});if(!a.hasOwnProperty("materialIndex"))throw ut.ProtocolError("missing required 'materialIndex'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Group"},n})();Pe.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 We||(e=We.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.Material;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.kd=Pe.Color.decode(e,e.uint32());break}case 2:{a.ks=Pe.Color.decode(e,e.uint32());break}case 3:{a.ke=Pe.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})();Pe.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=ut.emptyArray,n.decode=function(e,r){e instanceof We||(e=We.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.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})();function Xu(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new Rt({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,Wu(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.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",uri:n,byteLength:i.byteLength,scene:o,textures:a.textures,dispose:function(){return a.dispose()}}})}function Nh(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 Qh(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 Cn(n,t,e,r,i,a,o){if(o.hasOwnProperty(n))return o[n];n=n.split("?")[0],Br(n)||(n=nt(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},Ut(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 Uh(n,t,e,r,i,a,o,s){var u=[],l=new Ar("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(p){return Number(p)}),v=d[0],A=d[1];c=new f.Vector2(v,A)}u.push(Cn(n.mapkd,t,e,c,r,i,a).then(function(p){p.encoding=f.sRGBEncoding,l.map=p,o.add(p),s.add(p),l.needsUpdate=!0}).catch(Q))}if(n.ks&&(l.specular=new f.Color().fromArray(n.ks.rgb).convertLinearToSRGB()),n.mapks&&u.push(Cn(n.mapks,t,e,null,r,i,a).then(function(p){l.specularMap=p,o.add(p),s.add(p)}).catch(Q)),n.ke&&(l.emissive=new f.Color().fromArray(n.ke.rgb).convertLinearToSRGB()),n.mapke&&u.push(Cn(n.mapke,t,e,null,r,i,a).then(function(p){p.encoding=f.sRGBEncoding,l.emissiveMap=p,o.add(p),s.add(p)}).catch(Q)),n.norm&&u.push(Cn(n.norm,t,e,null,r,i,a).then(function(p){l.normalMap=p,o.add(p),s.add(p)}).catch(Q)),n.mapbump&&u.push(Cn(n.mapbump,t,e,null,r,i,a).then(function(p){l.bumpMap=p,o.add(p),s.add(p)}).catch(Q)),n.bump&&u.push(Cn(n.bump,t,e,null,r,i,a).then(function(p){l.bumpMap=p,o.add(p),s.add(p)}).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(Q)}}function Hh(n){return zh.decode(n).meshes}function Wu(n,t,e,r){for(var i=[],a=[],o=new Set,s=Hh(n),u=new Nn,l=new f.Matrix4,c=new f.Vector3,d=new f.Quaternion,v=new f.Vector3,A={},h=new Set,p=0,g=s;p<g.length;p++){var m=g[p],y=m.name,b=m.chunks,x=m.matrix;if(!(y==="Ceiling"||y==="CeilingDrop"))for(var w=0,E=x;w<E.length;w++){var S=E[w];l.elements=S.elements;for(var C=new f.Group,R=0;R<b.length;R++){var k=Qh(b[R].geometry);k.applyMatrix4(l),l.decompose(c,d,v),v.x*v.y*v.z<0&&k.attributes.normal&&k.attributes.position&&k.attributes.uv&&Nh(k),o.add(k);for(var M=[],I=0,L=b[R].material;I<L.length;I++){var T=L[I],B=Uh(T,t||"",e,u,r,A,o,h),D=B.material,V=B.textureReady;a.push(V),M.push(D)}var N=new Ct(k,M);N.name="chunk_"+R,N.matrix.compose(N.position,N.quaternion,N.scale),N.matrixAutoUpdate=!1,N.frustumCulled=!1,C.add(N)}C.name=y,i.push(C)}}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()}}})}function Zu(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new Rt({allowHosts:["*"]}),i={byteLength:0};return Promise.resolve().then(function(){return r.ajax(n,{responseType:"arraybuffer"})}).then(function(a){return i.byteLength=a.body.byteLength,Uu(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 Wu(a,t.textureBaseUri||"",(o=t.textureOptions)!==null&&o!==void 0?o:{},r)}).then(function(a){var o=new f.Group;o.name=n;for(var s=0,u=a.objects;s<u.length;s++){var l=u[s];o.add(l)}return{type:"domez",uri:n,byteLength:i.byteLength,scene:o,textures:a.textures,dispose:function(){return a.dispose()}}})}var qh=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function Yu(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new Rt({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 Do(a,{copyUV2:!1,addonExtensions:["PBM_mesh"],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.Matrix4;if(t.upAxis!=="Z"&&o.premultiply(qh),a.CESIUM_RTC){var s=new f.Matrix4().setPosition(a.CESIUM_RTC.center);o.premultiply(s)}var u=a.scene;return u.applyMatrix4(o),{type:"glb",uri:n,byteLength:i,scene:u,textures:a.textures,dispose:function(){return a.dispose()}}})}var Et=new f.Color;function No(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new Rt({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,s;return Gh(a,{propertyNameMapping:(o=t.propertyNameMapping)!==null&&o!==void 0?o:{},customPropertyMapping:(s=t.customPropertyMapping)!==null&&s!==void 0?s:{}})}).then(function(a){var o=a.geometry;switch(t.type){case"geometry":{var s=o;return{type:"ply",uri:n,byteLength:i,scene:s,meta:{},textures:[],dispose:function(){o.dispose()}}}case"mesh":{var u="color"in o.attributes,l=new f.MeshBasicMaterial({vertexColors:u}),s=new f.Mesh(o,l);return{type:"ply",uri:n,byteLength:i,scene:s,meta:{},textures:[],dispose:function(){o.dispose(),l.dispose()}}}case"line":{var u="color"in o.attributes,c=new f.LineBasicMaterial({vertexColors:u}),s=new f.Line(o,c);return s.computeLineDistances(),{type:"ply",uri:n,byteLength:i,scene:s,meta:{},textures:[],dispose:function(){o.dispose(),c.dispose()}}}case"points":{var d=new f.PointsMaterial({}),s=new f.Points(o,d);return{type:"ply",uri:n,byteLength:i,scene:s,meta:{},textures:[],dispose:function(){o.dispose(),d.dispose()}}}case"pbmPointCloud":{var v=new gi,s=new ar(o,v);return{type:"ply",uri:n,byteLength:i,scene:s,meta:{},textures:[],dispose:function(){o.dispose(),v.dispose()}}}}throw new Error("Invalid Type: ".concat(t.type))})}function Gh(n,t){var e=new Uint8Array(n),r=Yh(e),i=r.headerText,a=r.headerLength,o=jh(i,a,t);if(o.format==="ascii"){var s=new TextDecoder().decode(e);return{header:o,geometry:Jh(s,o,t)}}else return{header:o,geometry:Zh(n,o,t)}}function Kh(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 jh(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+/),v=d.shift();switch(c=d.join(" "),v){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(Kh(d,e));break;case"obj_info":o.objInfo=c;break;default:console.log("unhandled",v,d)}}}return u&&o.elements.push(u),o}function Fa(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 _h(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=Fa(t.next(),n[r].countType),o=0;o<a;o++){if(t.empty())return null;i.push(Fa(t.next(),n[r].itemType))}e[n[r].name]=i}else e[n[r].name]=Fa(t.next(),n[r].type)}return e}function $u(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 el(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 Jh(n,t,e){var r=$u(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 $h(a);e:for(var u=0;u<t.elements.length;u++)for(var l=t.elements[u],c=el(l.properties),d=0;d<l.count;d++){var v=_h(l.properties,s);if(!v)break e;rl(r,l.name,v,c,e)}return tl(r,e)}function tl(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];n[a].length>0&&e.setAttribute(a,new f.Float32BufferAttribute(n[a],t.customPropertyMapping[a].length))}return e.computeBoundingSphere(),e}function rl(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&&(Et.setRGB(e[r.attrR]/255,e[r.attrG]/255,e[r.attrB]/255),n.colors.push(Et.r,Et.g,Et.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];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,v=e.texcoord;d.length===3?(n.indices.push(d[0],d[1],d[2]),v&&v.length===6&&(n.faceVertexUvs.push(v[0],v[1]),n.faceVertexUvs.push(v[2],v[3]),n.faceVertexUvs.push(v[4],v[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&&(Et.setRGB(e[r.attrR]/255,e[r.attrG]/255,e[r.attrB]/255),n.faceVertexColors.push(Et.r,Et.g,Et.b),n.faceVertexColors.push(Et.r,Et.g,Et.b),n.faceVertexColors.push(Et.r,Et.g,Et.b))}}function Xh(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 Wh(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 Zh(n,t,e){for(var r=$u(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=el(c);Wh(c,a,i);for(var v=0;v<l.count;v++){o=Xh(s,c),s+=o[1];var A=o[0];rl(r,l.name,A,d,e)}}return tl(r,e)}function Yh(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!==`
928
+ `),co=typeof Worker!="undefined"&&typeof Blob!="undefined",Nu="";if(co)try{var Fh=new Blob([Bh],{type:"text/javascript"});Nu=URL.createObjectURL(Fh)}catch(n){}var Qu=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(Nu);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 qs(n){return Array.prototype.reduce.call(n,function(t,e,r){return t|e<<r*8},0)}function Lh(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 v=Math.floor(this.offset/u);this.data[v]||(this.data[v]=new Uint8Array(u)),this.data[v][this.offset%u]=d,this.offset++}};Ih.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 kh(n){for(var t=[],e=n.length,r=function(a){t.push(new Promise(function(o,s){var u=new Qu;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 Uu(n){var t=new Uint8Array(n),e=qs(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]=qs(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 Qu.support?kh(r):Promise.resolve(Lh(r))}var Ba=!1,Hu=[];function qu(n){if(n===void 0&&(n=!1),!(!n&&Ba)){Ba=!0;var t=Hu.shift();if(t){try{t()}catch(e){}ht.shared.add(function(){return qu(!0)},!0,2,-100)}else Ba=!1}}function Zi(n){return new Promise(function(t,e){var r=function(){try{t(n())}catch(i){e(i)}};Hu.push(r),ht.shared.add(function(){return qu()},!0,2,-100)})}function Ut(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 Oh(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}const $r=Zr.Reader,ir=Zr.util,Ht=Zr.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]||(Zr.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]={}),Gu=Ht.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=ir.emptyArray,n.prototype.createAt=ir.Long?ir.Long.fromBits(0,0,!0):0,n.prototype.description="",n.decode=function(e,r){e instanceof $r||(e=$r.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ht.Model;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.chunks&&a.chunks.length||(a.chunks=[]),a.chunks.push(Ht.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})();Ht.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 $r||(e=$r.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ht.Chunk;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.vertices=Ht.Vertices.decode(e,e.uint32());break}case 2:{a.faces=Ht.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 ir.ProtocolError("missing required 'vertices'",{instance:a});if(!a.hasOwnProperty("faces"))throw ir.ProtocolError("missing required 'faces'",{instance:a});if(!a.hasOwnProperty("name"))throw ir.ProtocolError("missing required 'name'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();Ht.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=ir.emptyArray,n.prototype.uvs=ir.emptyArray,n.prototype.marks=ir.emptyArray,n.decode=function(e,r){e instanceof $r||(e=$r.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ht.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})();Ht.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=ir.emptyArray,n.prototype.normals=ir.emptyArray,n.decode=function(e,r){e instanceof $r||(e=$r.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ht.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})();Ht.VertexMark=(()=>{const n={},t=Object.create(n);return t[n[0]="VERTEX_MARK_UNSPECIFIED"]=0,t[n[1]="VERTEX_MARK_ROOF"]=1,t})();function Ku(n,t){var e,r,i,a;t===void 0&&(t={});var o=(e=t.fetcher)!==null&&e!==void 0?e:new Rt({allowHosts:["*"]}),s={byteLength:0},u=zo((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 v=d[c];l[v]=Vo(v,u,o)}return Promise.resolve().then(function(){return o.ajax(n,{responseType:"arraybuffer"})}).then(function(A){return s.byteLength=A.body.byteLength,Zi(function(){var h=new Uint8Array(A.body);return Gu.decode(h)})}).then(function(A){return Zi(function(){var h,p;return Ju(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""}(),((p=t.textureArray)!==null&&p!==void 0?p:[]).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 p=0,g=A.objects;p<g.length;p++){var m=g[p];h.add(m)}return{type:"pbm",uri:n,byteLength:s.byteLength,scene:h,textures:A.textures,dispose:function(){return A.dispose()}}})}function ju(n){var t=n.match(/(group|floor)-?(\d+)/);return t?parseInt(t[2],10):0}function fo(n){var t=n.match(/(chunk)-?(\d+)/);return t?parseInt(t[2],10):0}function Dh(n){var t=n.match(/(sub)-?(\d+)/);return t?parseInt(t[2],10):0}function Gs(n){var t=ju(n.name),e=fo(n.name),r=Dh(n.name);return t*1e6+e*1e3+r}function Vh(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 v=0,A=n.chunks;v<A.length;v++){var d=A[v];if(!d.faces.normals||d.faces.normals.length===0){s=!1;break}}for(var h=n.chunks.sort(function(pe,ye){return Gs(pe)-Gs(ye)}),p=[],g=0,m=h;g<m.length;g++){var d=m[g],y=ju(d.name);p[y]||(p[y]=[]),p[y].push(d)}for(var b=0;b<p.length;b++){var x=p[b];if(x)if(s){for(var w=0,E=0;E<x.length;E++){var d=x[E];w+=d.faces.indices.length}for(var S=new Float32Array(w*3),C=new Float32Array(w*2),R=new Float32Array(w*3),k=u?new Float32Array(w):void 0,M=[],I=[1/0,1/0,1/0,-1/0,-1/0,-1/0],L=0,T=0;T<x.length;T++){for(var B=[1/0,1/0,1/0,-1/0,-1/0,-1/0],d=x[T],D=d.vertices.xyz,V=d.vertices.uvs,N=d.faces.indices,U=d.faces.normals,H=d.vertices.marks,G=N.length,E=0;E<G;E++){var j=N[E],J=S[L*3+E*3]=D[j*3],X=S[L*3+E*3+1]=D[j*3+1],Z=S[L*3+E*3+2]=D[j*3+2];k&&(k[L+E]=H[j]),C[L*2+E*2]=V[j*2],C[L*2+E*2+1]=V[j*2+1];var W=Math.floor(E/3)*3;R[L*3+E*3]=U[W],R[L*3+E*3+1]=U[W+1],R[L*3+E*3+2]=U[W+2],J<B[0]&&(B[0]=J),X<B[1]&&(B[1]=X),Z<B[2]&&(B[2]=Z),J>B[3]&&(B[3]=J),X>B[4]&&(B[4]=X),Z>B[5]&&(B[5]=Z)}B[0]<I[0]&&(I[0]=B[0]),B[1]<I[1]&&(I[1]=B[1]),B[2]<I[2]&&(I[2]=B[2]),B[3]>I[3]&&(I[3]=B[3]),B[4]>I[4]&&(I[4]=B[4]),B[5]>I[5]&&(I[5]=B[5]),M.push({materialIndex:T,name:d.name,chunkName:fo(d.name),start:L,count:d.faces.indices.length,texture:(e=d.texture)!==null&&e!==void 0?e:void 0}),L+=G}var $={createAt:i,description:a,vertices:S,uvs:C,normals:R,masks:k,indices:null,floorIndex:b,groups:M,extents:I};o.push($)}else{for(var w=0,Y=0,E=0;E<x.length;E++){var d=x[E];Y+=d.vertices.xyz.length/3,w+=d.faces.indices.length}for(var S=new Float32Array(Y*3),C=new Float32Array(Y*2),R=void 0,ne=new Float32Array(Y),te=new Uint32Array(w),k=u?new Float32Array(w):void 0,M=[],I=[1/0,1/0,1/0,-1/0,-1/0,-1/0],ue=0,L=0,T=0;T<x.length;T++){for(var B=[1/0,1/0,1/0,-1/0,-1/0,-1/0],d=x[T],D=d.vertices.xyz,ie=d.vertices.marks,V=d.vertices.uvs,N=d.faces.indices,ge=D.length/3,G=N.length,E=0;E<ge;E++){var J=S[L*3+E*3]=D[E*3],X=S[L*3+E*3+1]=D[E*3+1],Z=S[L*3+E*3+2]=D[E*3+2];k&&(k[L+E]=ie[E]),C[L*2+E*2]=V[E*2],C[L*2+E*2+1]=V[E*2+1],ne[L+E]=b,J<B[0]&&(B[0]=J),X<B[1]&&(B[1]=X),Z<B[2]&&(B[2]=Z),J>B[3]&&(B[3]=J),X>B[4]&&(B[4]=X),Z>B[5]&&(B[5]=Z)}B[0]<I[0]&&(I[0]=B[0]),B[1]<I[1]&&(I[1]=B[1]),B[2]<I[2]&&(I[2]=B[2]),B[3]>I[3]&&(I[3]=B[3]),B[4]>I[4]&&(I[4]=B[4]),B[5]>I[5]&&(I[5]=B[5]);for(var E=0;E<G;E++)te[ue+E]=L+N[E];M.push({materialIndex:T,name:d.name,chunkName:fo(d.name),start:ue,count:d.faces.indices.length,texture:(r=d.texture)!==null&&r!==void 0?r:void 0}),L+=ge,ue+=G}var $={createAt:i,description:a,vertices:S,uvs:C,normals:R,masks:k,indices:te,floorIndex:b,groups:M,extents:I};o.push($)}}return o}function Vo(n,t,e){var r=O({key:"texture.pbm"},Ut(t,["format","quality","size","sharpen","mappings"])),i=new Nn,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 Ju(n,t,e,r,i,a){i===void 0&&(i={});for(var o=Vh(n),s=0,u="",l=[],c={},d=new Set,v=0,A=o;v<A.length;v++){var h=A[v],p=h.createAt,g=h.description,m=h.vertices,y=h.masks,b=h.uvs,x=h.normals,w=h.indices,E=h.floorIndex,S=h.groups,C=h.extents,R=new f.Box3;R.min.x=C[0],R.min.y=C[1],R.min.z=C[2],R.max.x=C[3],R.max.y=C[4],R.max.z=C[5];var k=new f.BufferGeometry;k.setAttribute("position",new f.BufferAttribute(m,3)),k.setAttribute("uv",new f.BufferAttribute(b,2)),x&&k.setAttribute("normal",new f.BufferAttribute(x,3)),y&&k.setAttribute("mask",new f.BufferAttribute(y,1)),w&&k.setIndex(new f.BufferAttribute(w,1)),k.boundingBox=R,k.boundingSphere=R.getBoundingSphere(new f.Sphere);for(var M=0,I=S;M<I.length;M++){var L=I[M];k.addGroup(L.start,L.count,L.materialIndex)}d.add(k);for(var T=[],B=0,D=S;B<D.length;B++){var L=D[B],V=e[L.chunkName]||(L.texture?nt(t||"",L.texture):void 0),N=new Ar("basic");N.floor=E,k.attributes.normal===void 0&&(N.flatShading=!0),k.attributes.mask&&(N.defines.USE_VERTEX_MARK=!0),T.push(N),V?c[V]?c[V].push(N):c[V]=[N]:N.color=new f.Color(16777215),d.add(N),N.refreshUniforms()}var U=new Ct(k,T);U.name="model_floor_"+E,U.userData.createAt=p,U.userData.description=g,U.matrix.compose(U.position,U.quaternion,U.scale),U.matrixAutoUpdate=!1,U.frustumCulled=!1,s=p,u=g,l.push(U)}var H=function(G){G=zo(G,e.length);for(var j=[],J=function($){var Y=null;$ in i&&(Y=i[$]),Y||(Y=Vo($,G,a)),j.push(Y.then(function(ne){for(var te=0,ue=c[$];te<ue.length;te++){var ie=ue[te];ie.map&&(d.delete(ie.map),ie.map.dispose()),ie.map=ne,ie.refreshUniforms(),d.add(ne)}return ne}).catch(function(){for(var ne=0,te=c[$];ne<te.length;ne++){var ue=te[ne];ue.map&&(d.delete(ue.map),ue.map.dispose()),ue.map=null,ue.color=new f.Color(16777215),ue.refreshUniforms()}return null}))},X=0,Z=Object.keys(c);X<Z.length;X++){var W=Z[X];J(W)}for(var W in i)delete i[W];return Promise.all(j).then(function($){return $.filter(function(Y){return Y})})};return H(r).then(function(G){return{createAt:s,description:u,objects:l,textures:G,dispose:function(){d.forEach(function(j){j.dispose()}),d.clear()}}})}function zo(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 _u(n,t){var e,r,i,a;t===void 0&&(t={});var o=(e=t.fetcher)!==null&&e!==void 0?e:new Rt({allowHosts:["*"]}),s={byteLength:0},u=zo((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 v=d[c];l[v]=Vo(v,u,o)}return Promise.resolve().then(function(){return o.ajax(n,{responseType:"arraybuffer"})}).then(function(A){return Uu(A.body)}).then(function(A){return Zi(function(){for(var h,p={chunks:[],createAt:void 0,description:void 0},g=0,m=A;g<m.length;g++){var y=m[g],b=Gu.decode(y);b.chunks.length&&((h=p.chunks).push.apply(h,b.chunks),p.createAt=b.createAt,p.description=b.description)}return p})}).then(function(A){return Zi(function(){var h,p,g;return Ju(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""}(),((p=t.textureArray)!==null&&p!==void 0?p:[]).slice(),(g=t.textureOptions)!==null&&g!==void 0?g:{},l,o)})}).then(function(A){var h=new f.Group;h.name=n;for(var p=0,g=A.objects;p<g.length;p++){var m=g[p];h.add(m)}return{type:"at3d",uri:n,byteLength:s.byteLength,scene:h,textures:A.textures,dispose:function(){return A.dispose()}}})}const We=Zr.Reader,ut=Zr.util,Pe=Zr.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]||(Zr.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]={}),zh=Pe.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=ut.emptyArray,n.decode=function(e,r){e instanceof We||(e=We.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.Model;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.meshes&&a.meshes.length||(a.meshes=[]),a.meshes.push(Pe.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})();Pe.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=ut.emptyArray,n.prototype.matrix=ut.emptyArray,n.decode=function(e,r){e instanceof We||(e=We.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.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(Pe.Chunk.decode(e,e.uint32()));break}case 3:{a.matrix&&a.matrix.length||(a.matrix=[]),a.matrix.push(Pe.Matrix.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("name"))throw ut.ProtocolError("missing required 'name'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Mesh"},n})();Pe.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=ut.emptyArray,n.decode=function(e,r){e instanceof We||(e=We.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.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})();Pe.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=ut.emptyArray,n.decode=function(e,r){e instanceof We||(e=We.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.Chunk;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 2:{a.geometry=Pe.Geometry.decode(e,e.uint32());break}case 3:{a.material&&a.material.length||(a.material=[]),a.material.push(Pe.Material.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("geometry"))throw ut.ProtocolError("missing required 'geometry'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();Pe.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=ut.emptyArray,n.decode=function(e,r){e instanceof We||(e=We.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.Geometry;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.position=Pe.Position.decode(e,e.uint32());break}case 2:{a.uv=Pe.UV.decode(e,e.uint32());break}case 3:{a.uv2=Pe.UV.decode(e,e.uint32());break}case 4:{a.normal=Pe.Normal.decode(e,e.uint32());break}case 5:{a.groups&&a.groups.length||(a.groups=[]),a.groups.push(Pe.Group.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("position"))throw ut.ProtocolError("missing required 'position'",{instance:a});if(!a.hasOwnProperty("normal"))throw ut.ProtocolError("missing required 'normal'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Geometry"},n})();Pe.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=ut.emptyArray,n.decode=function(e,r){e instanceof We||(e=We.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.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})();Pe.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=ut.emptyArray,n.decode=function(e,r){e instanceof We||(e=We.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.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})();Pe.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=ut.emptyArray,n.decode=function(e,r){e instanceof We||(e=We.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.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})();Pe.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 We||(e=We.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.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 ut.ProtocolError("missing required 'start'",{instance:a});if(!a.hasOwnProperty("count"))throw ut.ProtocolError("missing required 'count'",{instance:a});if(!a.hasOwnProperty("materialIndex"))throw ut.ProtocolError("missing required 'materialIndex'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Group"},n})();Pe.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 We||(e=We.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.Material;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.kd=Pe.Color.decode(e,e.uint32());break}case 2:{a.ks=Pe.Color.decode(e,e.uint32());break}case 3:{a.ke=Pe.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})();Pe.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=ut.emptyArray,n.decode=function(e,r){e instanceof We||(e=We.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.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})();function Xu(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new Rt({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,Wu(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.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",uri:n,byteLength:i.byteLength,scene:o,textures:a.textures,dispose:function(){return a.dispose()}}})}function Nh(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 Qh(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 Cn(n,t,e,r,i,a,o){if(o.hasOwnProperty(n))return o[n];n=n.split("?")[0],Br(n)||(n=nt(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},Ut(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 Uh(n,t,e,r,i,a,o,s){var u=[],l=new Ar("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(p){return Number(p)}),v=d[0],A=d[1];c=new f.Vector2(v,A)}u.push(Cn(n.mapkd,t,e,c,r,i,a).then(function(p){p.encoding=f.sRGBEncoding,l.map=p,o.add(p),s.add(p),l.needsUpdate=!0}).catch(Q))}if(n.ks&&(l.specular=new f.Color().fromArray(n.ks.rgb).convertLinearToSRGB()),n.mapks&&u.push(Cn(n.mapks,t,e,null,r,i,a).then(function(p){l.specularMap=p,o.add(p),s.add(p)}).catch(Q)),n.ke&&(l.emissive=new f.Color().fromArray(n.ke.rgb).convertLinearToSRGB()),n.mapke&&u.push(Cn(n.mapke,t,e,null,r,i,a).then(function(p){p.encoding=f.sRGBEncoding,l.emissiveMap=p,o.add(p),s.add(p)}).catch(Q)),n.norm&&u.push(Cn(n.norm,t,e,null,r,i,a).then(function(p){l.normalMap=p,o.add(p),s.add(p)}).catch(Q)),n.mapbump&&u.push(Cn(n.mapbump,t,e,null,r,i,a).then(function(p){l.bumpMap=p,o.add(p),s.add(p)}).catch(Q)),n.bump&&u.push(Cn(n.bump,t,e,null,r,i,a).then(function(p){l.bumpMap=p,o.add(p),s.add(p)}).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(Q)}}function Hh(n){return zh.decode(n).meshes}function Wu(n,t,e,r){for(var i=[],a=[],o=new Set,s=Hh(n),u=new Nn,l=new f.Matrix4,c=new f.Vector3,d=new f.Quaternion,v=new f.Vector3,A={},h=new Set,p=0,g=s;p<g.length;p++){var m=g[p],y=m.name,b=m.chunks,x=m.matrix;if(!(y==="Ceiling"||y==="CeilingDrop"))for(var w=0,E=x;w<E.length;w++){var S=E[w];l.elements=S.elements;for(var C=new f.Group,R=0;R<b.length;R++){var k=Qh(b[R].geometry);k.applyMatrix4(l),l.decompose(c,d,v),v.x*v.y*v.z<0&&k.attributes.normal&&k.attributes.position&&k.attributes.uv&&Nh(k),o.add(k);for(var M=[],I=0,L=b[R].material;I<L.length;I++){var T=L[I],B=Uh(T,t||"",e,u,r,A,o,h),D=B.material,V=B.textureReady;a.push(V),M.push(D)}var N=new Ct(k,M);N.name="chunk_"+R,N.matrix.compose(N.position,N.quaternion,N.scale),N.matrixAutoUpdate=!1,N.frustumCulled=!1,C.add(N)}C.name=y,i.push(C)}}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()}}})}function Zu(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new Rt({allowHosts:["*"]}),i={byteLength:0};return Promise.resolve().then(function(){return r.ajax(n,{responseType:"arraybuffer"})}).then(function(a){return i.byteLength=a.body.byteLength,Uu(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 Wu(a,t.textureBaseUri||"",(o=t.textureOptions)!==null&&o!==void 0?o:{},r)}).then(function(a){var o=new f.Group;o.name=n;for(var s=0,u=a.objects;s<u.length;s++){var l=u[s];o.add(l)}return{type:"domez",uri:n,byteLength:i.byteLength,scene:o,textures:a.textures,dispose:function(){return a.dispose()}}})}var qh=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function Yu(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new Rt({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 Do(a,{copyUV2:!1,addonExtensions:["PBM_mesh"],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.Matrix4;if(t.upAxis!=="Z"&&o.premultiply(qh),a.CESIUM_RTC){var s=new f.Matrix4().setPosition(a.CESIUM_RTC.center);o.premultiply(s)}var u=a.scene;return u.applyMatrix4(o),{type:"glb",uri:n,byteLength:i,scene:u,textures:a.textures,dispose:function(){return a.dispose()}}})}var Et=new f.Color;function No(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new Rt({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,s;return Gh(a,{propertyNameMapping:(o=t.propertyNameMapping)!==null&&o!==void 0?o:{},customPropertyMapping:(s=t.customPropertyMapping)!==null&&s!==void 0?s:{}})}).then(function(a){var o=a.geometry;switch(t.type){case"geometry":{var s=o;return{type:"ply",uri:n,byteLength:i,scene:s,meta:{},textures:[],dispose:function(){o.dispose()}}}case"mesh":{var u="color"in o.attributes,l=new f.MeshBasicMaterial({vertexColors:u}),s=new f.Mesh(o,l);return{type:"ply",uri:n,byteLength:i,scene:s,meta:{},textures:[],dispose:function(){o.dispose(),l.dispose()}}}case"line":{var u="color"in o.attributes,c=new f.LineBasicMaterial({vertexColors:u}),s=new f.Line(o,c);return s.computeLineDistances(),{type:"ply",uri:n,byteLength:i,scene:s,meta:{},textures:[],dispose:function(){o.dispose(),c.dispose()}}}case"points":{var d=new f.PointsMaterial({}),s=new f.Points(o,d);return{type:"ply",uri:n,byteLength:i,scene:s,meta:{},textures:[],dispose:function(){o.dispose(),d.dispose()}}}case"pbmPointCloud":{var v=new gi,s=new ar(o,v);return{type:"ply",uri:n,byteLength:i,scene:s,meta:{},textures:[],dispose:function(){o.dispose(),v.dispose()}}}}throw new Error("Invalid Type: ".concat(t.type))})}function Gh(n,t){var e=new Uint8Array(n),r=Yh(e),i=r.headerText,a=r.headerLength,o=jh(i,a,t);if(o.format==="ascii"){var s=new TextDecoder().decode(e);return{header:o,geometry:_h(s,o,t)}}else return{header:o,geometry:Zh(n,o,t)}}function Kh(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 jh(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+/),v=d.shift();switch(c=d.join(" "),v){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(Kh(d,e));break;case"obj_info":o.objInfo=c;break;default:console.log("unhandled",v,d)}}}return u&&o.elements.push(u),o}function Fa(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 Jh(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=Fa(t.next(),n[r].countType),o=0;o<a;o++){if(t.empty())return null;i.push(Fa(t.next(),n[r].itemType))}e[n[r].name]=i}else e[n[r].name]=Fa(t.next(),n[r].type)}return e}function $u(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 el(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 _h(n,t,e){var r=$u(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 $h(a);e:for(var u=0;u<t.elements.length;u++)for(var l=t.elements[u],c=el(l.properties),d=0;d<l.count;d++){var v=Jh(l.properties,s);if(!v)break e;rl(r,l.name,v,c,e)}return tl(r,e)}function tl(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];n[a].length>0&&e.setAttribute(a,new f.Float32BufferAttribute(n[a],t.customPropertyMapping[a].length))}return e.computeBoundingSphere(),e}function rl(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&&(Et.setRGB(e[r.attrR]/255,e[r.attrG]/255,e[r.attrB]/255),n.colors.push(Et.r,Et.g,Et.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];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,v=e.texcoord;d.length===3?(n.indices.push(d[0],d[1],d[2]),v&&v.length===6&&(n.faceVertexUvs.push(v[0],v[1]),n.faceVertexUvs.push(v[2],v[3]),n.faceVertexUvs.push(v[4],v[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&&(Et.setRGB(e[r.attrR]/255,e[r.attrG]/255,e[r.attrB]/255),n.faceVertexColors.push(Et.r,Et.g,Et.b),n.faceVertexColors.push(Et.r,Et.g,Et.b),n.faceVertexColors.push(Et.r,Et.g,Et.b))}}function Xh(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 Wh(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 Zh(n,t,e){for(var r=$u(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=el(c);Wh(c,a,i);for(var v=0;v<l.count;v++){o=Xh(s,c),s+=o[1];var A=o[0];rl(r,l.name,A,d,e)}}return tl(r,e)}function Yh(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
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 $h=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}(),ep=/^[og]\s*(.+)?/,tp=/^mtllib /,rp=/^usemtl /,np=/^usemap /,Ks=/\s+/,Un=new f.Color,ip=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 v={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 v.clone=this.clone.bind(v),v}};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,v=this.normals.length,A=this.uvs.length,h=this.parseVertexIndex(t,d),p=this.parseVertexIndex(e,d),g=this.parseVertexIndex(r,d),m=s!==void 0?this.parseNormalIndex(s,v):void 0,y=u!==void 0?this.parseNormalIndex(u,v):void 0,b=l!==void 0?this.parseNormalIndex(l,v):void 0,x=i!==void 0?this.parseUVIndex(i,A):void 0,w=a!==void 0?this.parseUVIndex(a,A):void 0,E=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||E===void 0)&&(c.hasUV=!1);var S=[h,x,m].join(":"),C=c.indexMap[S];C===void 0&&(C=c.vertices.length/3,c.indexMap[S]=C,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(C);var R=[p,w,y].join(":"),k=c.indexMap[R];k===void 0&&(k=c.vertices.length/3,c.indexMap[R]=k,c.vertices.push(this.vertices[p+0],this.vertices[p+1],this.vertices[p+2]),c.hasColor&&(this.colors[p]===void 0?c.hasColor=!1:c.colors.push(this.colors[p+0],this.colors[p+1],this.colors[p+2])),c.hasNormal&&c.normals.push(this.normals[p+0],this.normals[p+1],this.normals[p+2]),c.hasUV&&c.uvs.push(this.uvs[w+0],this.uvs[w+1])),c.index.push(k);var M=[g,E,b].join(":"),I=c.indexMap[M];I===void 0&&(I=c.vertices.length/3,c.indexMap[M]=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[E+0],this.uvs[E+1])),c.index.push(I)},n}();function ap(n){var t=new ip;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(Ks);switch(u[0]){case"v":t.vertices.push(parseFloat(u[1]),parseFloat(u[2]),parseFloat(u[3])),u.length>=7?(Un.setRGB(parseFloat(u[4]),parseFloat(u[5]),parseFloat(u[6])),Un.convertSRGBToLinear(),t.colors.push(Un.r,Un.g,Un.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(Ks),d=[],v=0,A=c.length;v<A;v++){var h=c[v];if(h.length>0){var p=h.split("/");d.push(p)}}for(var g=d[0],v=1,A=d.length-1;v<A;v++){var m=d[v],y=d[v+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=ep.exec(o))!==null){var b=(" "+r[0].slice(1).trim()).slice(1);t.startObject(b)}else if(rp.test(o))t.object.startMaterial(o.substring(7).trim(),t.materialLibraries);else if(tp.test(o))t.materialLibraries.push(o.substring(7).trim());else if(np.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 op(n,t,e){for(var r=new Nn,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 v=c>=0?l.substring(c+1):"";if(v=v.trim(),d==="newmtl")a={name:v},s[v]=a;else if(d==="ka"||d==="kd"||d==="ks"||d==="ke"){var A=v.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]=v)}}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 p(g,m,y){var b=h(y),x=nt(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 E=w.body;return E.repeat.copy(b.scale),E.offset.copy(b.offset),g.bumpScale=b.bumpScale,g[m]=E,E})}return{name:n,create:function(g){var m=new Ar,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(p(m,"map",b.map_kd)),b.map_ks!==void 0&&y.push(p(m,"specularMap",b.map_ks)),b.map_ke!==void 0&&y.push(p(m,"emissiveMap",b.map_ke)),b.norm!==void 0&&y.push(p(m,"normalMap",b.norm)),b.map_bump!==void 0&&y.push(p(m,"bumpMap",b.map_bump)),b.bump!==void 0&&y.push(p(m,"bumpMap",b.bump)),b.map_d!==void 0&&y.push(p(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(E){return m.refreshUniforms(),E});return[m,w]}}}function sp(n,t){for(var e,r,i=[],a=[],o=new f.Group,s=function(c,d){var v=n.objects[c],A=v.geometry,h=v.materials,p=!1;if(A.vertices.length===0)return"continue";var g=new f.BufferGeometry;a.push(function(){return g.dispose()}),g.setAttribute("position",new f.BufferAttribute(new Float32Array(A.vertices),3)),A.normals.length>0&&g.setAttribute("normal",new f.BufferAttribute(new Float32Array(A.normals),3)),A.colors.length>0&&(p=!0,g.setAttribute("color",new f.BufferAttribute(new Float32Array(A.colors),3))),A.uvs.length>0&&g.setAttribute("uv",new f.BufferAttribute(new Float32Array(A.uvs),2)),A.index.length>0&&g.setIndex(new f.BufferAttribute(new Uint32Array(A.index),1)),g.computeBoundingBox(),g.computeBoundingSphere();for(var m=[],y=function(S,C){var R=h[S],k=R.name+"_"+R.smooth+"_"+p,M=n.materials[k];if(!M){for(var I=null,L=0,T=t;L<T.length;L++){var B=T[L],D=B.name,V=B.create;D===R.mtllib&&(I=V(R.name))}if(!I){var N=new Ar;N.refreshUniforms(),I=[N,Promise.resolve([])]}M=I[0],M.name=R.name,M.flatShading=!(R.smooth||g.attributes.normal),M.vertexColors=p,n.materials[k]=M;var U=I[1];i.push(U),a.push(function(){return M.dispose()})}m.push(M)},b=0,x=h.length;b<x;b++)y(b);for(var b=0,x=h.length;b<x;b++){var w=h[b];g.addGroup((e=w.groupStart)!==null&&e!==void 0?e:0,(r=w.groupCount)!==null&&r!==void 0?r:0,b)}var E=new Ct(g,m);E.name=v.name,o.add(E)},u=0,l=n.objects.length;u<l;u++)s(u);return Promise.all(i).then(function(c){for(var d=[],v=0,A=c;v<A.length;v++){var h=A[v];d=d.concat(h)}return{scene:o,textures:d,dispose:function(){return a.forEach(function(p){return p()})}}})}function up(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new Rt({allowHosts:["*"]}),i=n.slice(0,n.lastIndexOf("/")+1),a=0,o;return Promise.resolve().then(function(){return r.ajax(n,{responseType:"arraybuffer"})}).then(function(s){a=s.body.byteLength;var u=new TextDecoder;return u.decode(s.body)}).then(function(s){return o=ap(s),Promise.all(o.materialLibraries.map(function(u){var l=nt(i,u),c=l.slice(0,l.lastIndexOf("/")+1);return r.ajax(l,{responseType:"text"}).then(function(d){return op(u,d.body,{path:c,fetcher:r})})}))}).then(function(s){return sp(o,s)}).then(function(s){return{type:"obj",uri:n,byteLength:a,scene:s.scene,textures:s.textures,dispose:function(){return s.dispose()}}})}var zt=Uint8Array,Rn=Uint16Array,lp=Int32Array,nl=new zt([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]),il=new zt([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]),cp=new zt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),al=function(n,t){for(var e=new Rn(31),r=0;r<31;++r)e[r]=t+=1<<n[r-1];for(var i=new lp(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}},ol=al(nl,2),sl=ol.b,fp=ol.r;sl[28]=258,fp[258]=28;var dp=al(il,0),hp=dp.b,ho=new Rn(32768);for(var Qe=0;Qe<32768;++Qe){var Gr=(Qe&43690)>>1|(Qe&21845)<<1;Gr=(Gr&52428)>>2|(Gr&13107)<<2,Gr=(Gr&61680)>>4|(Gr&3855)<<4,ho[Qe]=((Gr&65280)>>8|(Gr&255)<<8)>>1}var ti=function(n,t,e){for(var r=n.length,i=0,a=new Rn(t);i<r;++i)n[i]&&++a[n[i]-1];var o=new Rn(t);for(i=1;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(e){s=new Rn(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,v=d|(1<<c)-1;d<=v;++d)s[ho[d]>>u]=l}else for(s=new Rn(r),i=0;i<r;++i)n[i]&&(s[i]=ho[o[n[i]-1]++]>>15-n[i]);return s},yi=new zt(288);for(var Qe=0;Qe<144;++Qe)yi[Qe]=8;for(var Qe=144;Qe<256;++Qe)yi[Qe]=9;for(var Qe=256;Qe<280;++Qe)yi[Qe]=7;for(var Qe=280;Qe<288;++Qe)yi[Qe]=8;var ul=new zt(32);for(var Qe=0;Qe<32;++Qe)ul[Qe]=5;var pp=ti(yi,9,1),vp=ti(ul,5,1),La=function(n){for(var t=n[0],e=1;e<n.length;++e)n[e]>t&&(t=n[e]);return t},Zt=function(n,t,e){var r=t/8|0;return(n[r]|n[r+1]<<8)>>(t&7)&e},ka=function(n,t){var e=t/8|0;return(n[e]|n[e+1]<<8|n[e+2]<<16)>>(t&7)},mp=function(n){return(n+7)/8|0},Ap=function(n,t,e){return(e==null||e>n.length)&&(e=n.length),new zt(n.subarray(t,e))},gp=["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"],er=function(n,t,e){var r=new Error(t||gp[n]);if(r.code=n,Error.captureStackTrace&&Error.captureStackTrace(r,er),!e)throw r;return r},yp=function(n,t,e,r){var i=n.length,a=0;if(!i||t.f&&!t.l)return e||new zt(0);var o=!e,s=o||t.i!=2,u=t.i;o&&(e=new zt(i*3));var l=function(ue){var ie=e.length;if(ue>ie){var ge=new zt(Math.max(ie*2,ue));ge.set(e),e=ge}},c=t.f||0,d=t.p||0,v=t.b||0,A=t.l,h=t.d,p=t.m,g=t.n,m=i*8;do{if(!A){c=Zt(n,d,1);var y=Zt(n,d+1,3);if(d+=3,y)if(y==1)A=pp,h=vp,p=9,g=5;else if(y==2){var E=Zt(n,d,31)+257,S=Zt(n,d+10,15)+4,C=E+Zt(n,d+5,31)+1;d+=14;for(var R=new zt(C),k=new zt(19),M=0;M<S;++M)k[cp[M]]=Zt(n,d+M*3,7);d+=S*3;for(var I=La(k),L=(1<<I)-1,T=ti(k,I,1),M=0;M<C;){var B=T[Zt(n,d,L)];d+=B&15;var b=B>>4;if(b<16)R[M++]=b;else{var D=0,V=0;for(b==16?(V=3+Zt(n,d,3),d+=2,D=R[M-1]):b==17?(V=3+Zt(n,d,7),d+=3):b==18&&(V=11+Zt(n,d,127),d+=7);V--;)R[M++]=D}}var N=R.subarray(0,E),U=R.subarray(E);p=La(N),g=La(U),A=ti(N,p,1),h=ti(U,g,1)}else er(1);else{var b=mp(d)+4,x=n[b-4]|n[b-3]<<8,w=b+x;if(w>i){u&&er(0);break}s&&l(v+x),e.set(n.subarray(b,w),v),t.b=v+=x,t.p=d=w*8,t.f=c;continue}if(d>m){u&&er(0);break}}s&&l(v+131072);for(var H=(1<<p)-1,G=(1<<g)-1,j=d;;j=d){var D=A[ka(n,d)&H],_=D>>4;if(d+=D&15,d>m){u&&er(0);break}if(D||er(2),_<256)e[v++]=_;else if(_==256){j=d,A=null;break}else{var X=_-254;if(_>264){var M=_-257,Z=nl[M];X=Zt(n,d,(1<<Z)-1)+sl[M],d+=Z}var W=h[ka(n,d)&G],$=W>>4;W||er(3),d+=W&15;var U=hp[$];if($>3){var Z=il[$];U+=ka(n,d)&(1<<Z)-1,d+=Z}if(d>m){u&&er(0);break}s&&l(v+131072);var Y=v+X;if(v<U){var ne=a-U,te=Math.min(U,Y);for(ne+v<0&&er(3);v<te;++v)e[v]=r[ne+v]}for(;v<Y;++v)e[v]=e[v-U]}}t.l=A,t.p=j,t.b=v,t.f=c,A&&(c=1,t.m=p,t.d=h,t.n=g)}while(!c);return v!=e.length&&o?Ap(e,0,v):e.subarray(0,v)},bp=new zt(0),xp=function(n,t){return((n[0]&15)!=8||n[0]>>4>7||(n[0]<<8|n[1])%31)&&er(6,"invalid zlib data"),(n[1]>>5&1)==+!t&&er(6,"invalid zlib data: "+(n[1]&32?"need":"unexpected")+" dictionary"),(n[1]>>3&4)+2};function wp(n,t){return yp(n.subarray(xp(n,t),-4),{i:2},t,t)}var Ep=typeof TextDecoder!="undefined"&&new TextDecoder,Sp=0;try{Ep.decode(bp,{stream:!0}),Sp=1}catch(n){}var Mp=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function ll(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new Rt({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 Cp(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!=="Z"&&u.premultiply(Mp),o.applyMatrix4(u),{type:"fbx",uri:n,byteLength:i,scene:o,textures:a.textures,dispose:function(){return a.dispose()}}})}function Cp(n,t){var e;if(Fp(n))e=new Bp().parse(n);else{var r=fl(n);if(!Lp(r))throw new Error("THREE.FBXLoader: Unknown format.");if(_s(r)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+_s(r));e=new Rp().parse(r)}return new Ip(t).parse(e)}var Ip=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=this.parseConnections(t),s=new f.Group,u=[],l=this.parseImages(t),c=this.parseTextures(t,l,o,u),d=this.parseMaterials(t,c,o),v=this.parseDeformers(t,o),A=new Tp().parse(t,v,o);this.parseScene(t,v,A,d,o,s);var h=(r=(e=t.GlobalSettings.UpAxis)===null||e===void 0?void 0:e.value)!==null&&r!==void 0?r:1,p=(a=(i=t.GlobalSettings.UnitScaleFactor)===null||i===void 0?void 0:i.value)!==null&&a!==void 0?a:1,g;if(t.GlobalSettings.AmbientColor){var m=t.GlobalSettings.AmbientColor.value,y=m[0],b=m[1],x=m[2];if(y!==0||b!==0||x!==0){var w=new f.Color().setRGB(y,b,x);g=new f.AmbientLight(w,1)}}return Promise.all(u).then(function(E){return{scene:s,textures:E,ambientLight:g,upAxis:["X","Y","Z"][h],unitScale:p,dispose:function(){E.forEach(function(S){return S.dispose()}),d.forEach(function(S){return S.dispose()}),A.forEach(function(S){return S.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=nt(this.resourcePath,ia(o,this.search));var s=Object.assign(new f.Texture,{ID:0}),u;u=this.fetcher.loadImage(o,{},void 0,void 0,void 0,oi()).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 Ar(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 v=u[d.ID];l.setLookAtProperties(t,d,v,a,o);var A=a.get(d.ID).parents;A.forEach(function(h){var p=s.get(h.ID);p!==void 0&&p.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 v=cl(d.userData.transformData);d.applyMatrix4(v),d.updateWorldMatrix(!0,!0)}});var c=new Pp().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),v=this.buildSkeleton(d,e,l,c.attrName);if(!v){switch(c.attrType){case"Camera":v=this.createCamera(t,d);break;case"Light":v=this.createLight(t,d);break;case"Mesh":v=this.createMesh(d,r,i);break;case"NurbsCurve":case"LimbNode":case"Root":v=new f.Bone;break;case"Null":default:v=new f.Group;break}v.name=c.attrName?f.PropertyBinding.sanitizeNodeName(c.attrName):"",v.userData.originalName=c.attrName,v.ID=l}this.getTransformData(v,c),o.set(l,v)}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,v){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[v]=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 v=i.FocalLength?i.FocalLength.value:null;switch(a){case 0:r=new f.PerspectiveCamera(d,c,o,s),v!==null&&r.setFocalLength(v);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(v){var A=t.Objects.NodeAttribute[v.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 Ar(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 nu(a,o),i.normalizeSkinWeights()):i=new Ct(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=si(e.RotationOrder.value):r.eulerOrder=si(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(v){if(r.has(v.ID)){var A=v.ID,h=a.get(A);h.parents.forEach(function(p){if(i.has(p.ID)){var g=i.get(p.ID);g instanceof f.SkinnedMesh&&g.bind(new f.Skeleton(c.bones),o[p.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}(),Tp=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(v){return t.Objects.Model[v.ID]});if(s.length!==0){var u=e.children.reduce(function(v,A){return a[A.ID]!==void 0&&(v=a[A.ID]),v},null);e.children.forEach(function(v){i.morphTargets[v.ID]!==void 0&&o.push(i.morphTargets[v.ID])});var l=s[0],c={};l.RotationOrder&&(c.eulerOrder=si(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=cl(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 v=u.materialIndex[0],A=0;if(u.materialIndex.forEach(function(g,m){g!==v&&(o.addGroup(A,m-A,v),v=g,A=m)}),o.groups.length>0){var h=o.groups[o.groups.length-1],p=h.start+h.count;p!==u.materialIndex.length&&o.addGroup(p,u.materialIndex.length-p,v)}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=[],v=this;return t.vertexIndices.forEach(function(A,h){var p=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=Pi(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,C){var R=S,k=m[C];w.forEach(function(M,I,L){if(R>M){L[I]=R,R=M;var T=x[I];x[I]=k,k=T}})}),m=x,y=w}for(;y.length<4;)y.push(0),m.push(0);for(var E=0;E<4;++E)c.push(y[E]),d.push(m[E])}if(t.normal){var b=Pi(h,r,A,t.normal);s.push(b[0],b[1],b[2])}t.material&&t.material.mappingType!=="AllSame"&&(p=Pi(h,r,A,t.material)[0],p<0&&(v.negativeMaterialIndices=!0,p=0)),t.uv&&t.uv.forEach(function(S,C){var R=Pi(h,r,A,S);l[C]===void 0&&(l[C]=[]),l[C].push(R[0]),l[C].push(R[1])}),i++,g&&(v.genFace(e,t,o,p,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 v=[],A=e.baseVertexPositions||e.vertexPositions,h=0;h<r.length;h+=3)v.push(new f.Vector3(A[r[h]],A[r[h+1]],A[r[h+2]]));for(var p=this.getNormalTangentAndBitangent(v),g=p.tangent,m=p.bitangent,y=[],b=0,x=v;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 E=function(L,T,B){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[B*3]]),t.vertex.push(e.vertexPositions[r[B*3+1]]),t.vertex.push(e.vertexPositions[r[B*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[B*4]),t.vertexWeights.push(u[B*4+1]),t.vertexWeights.push(u[B*4+2]),t.vertexWeights.push(u[B*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[B*4]),t.weightsIndices.push(l[B*4+1]),t.weightsIndices.push(l[B*4+2]),t.weightsIndices.push(l[B*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[B*3]),t.colors.push(o[B*3+1]),t.colors.push(o[B*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[B*3]),t.normal.push(a[B*3+1]),t.normal.push(a[B*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][B*2]),t.uvs[V].push(s[V][B*2+1])})},S=0,C=d;S<C.length;S++){var R=C[S],k=R[0],M=R[1],I=R[2];E(k,M,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),v=0;v<l.length;v++){var A=l[v]*3;d[A]=u[v*3],d[A+1]=u[v*3+1],d[A+2]=u[v*3+2]}var h={vertexIndices:s,vertexPositions:d,baseVertexPositions:o},p=this.genBuffers(h),g=new f.Float32BufferAttribute(p.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 zp(r,i,a,l,c),v=d.getPoints(a.length*12);return new f.BufferGeometry().setFromPoints(v)},n}(),Pp=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(kp),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 v=d.children;v.forEach(function(A,h){if(e.has(A.ID)){var p=e.get(A.ID);if(p.curves.x!==void 0||p.curves.y!==void 0||p.curves.z!==void 0){if(c[h]===void 0){var g=r.get(A.ID).parents.filter(function(C){return C.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(C){C.ID===m.id&&(y.transform=C.matrix,C.userData.transformData&&(y.eulerOrder=C.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][p.attr]=p)}else if(p.curves.morph!==void 0){if(c[h]===void 0){var b=r.get(A.ID).parents.filter(function(R){return R.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,E=t.Objects.Model[g],S={modelName:E.attrName?f.PropertyBinding.sanitizeNodeName(E.attrName):"",morphName:t.Objects.Deformer[b].attrName};c[h]=S}c[h][p.attr]=p}}}),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=si(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 v=new f.Quaternion,A=new f.Euler,h=[];if(!s||!o)return new f.QuaternionKeyframeTrack(t+".quaternion",[0],[0]);for(var p=0;p<s.length;p+=3){if(A.set(s[p],s[p+1],s[p+2],a),v.setFromEuler(A),v.premultiply(c),v.multiply(d),p>2){var g=new f.Quaternion().fromArray(h,(p-3)/3*4);g.dot(v)<0&&v.set(-v.x,-v.y,-v.z,-v.w)}v.toArray(h,p/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 v=e.z.values[u];a.push(v),i[2]=v}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]],v=[Math.abs(d[0]),Math.abs(d[1]),Math.abs(d[2])];if(v[0]>=180||v[1]>=180||v[2]>=180){var A=Math.max.apply(Math,v),h=A/180,p=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(p),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,E=new f.Euler,S=0;S<1;S+=1/h)w.copy(m.clone().slerp(y.clone(),S)),a.push(b+S*x),E.setFromQuaternion(w,i),o.push(E.x),o.push(E.y),o.push(E.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}(),Rp=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(v){return v.trim().replace(/^"/,"")}),i="connections",a=[l,c],Dp(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=Da(a))},n.prototype.parseNodePropertyContinued=function(t){var e=this.getCurrentNode();e.a+=t,t.slice(-1)!==","&&(e.a=Da(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=Da(l);break}this.getPrevNode()[a]={type:o,type2:s,flag:u,value:l},this.setCurrentProp(this.getPrevNode(),a)},n}(),Bp=function(){function n(){}return n.prototype.parse=function(t){var e=new js(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]:"",v=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),v!==""&&(r.attrType=v),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(v,A){A!==0&&a.push(v)}),e.connections===void 0&&(e.connections=[]),e.connections.push(a)}else if(r.name==="Properties70"){var o=Object.keys(r);o.forEach(function(v){e[v]=r[v]})}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=wp(new Uint8Array(t.getArrayBuffer(o))),u=new js(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}(),js=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 Fp(n){var t="Kaydara FBX Binary \0";return n.byteLength>=t.length&&t===fl(n,0,t.length)}function Lp(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 _s(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 kp(n){return n/46186158e3}var Op=[];function Pi(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 Vp(Op,r.buffer,a,o)}var Oa=new f.Euler,In=new f.Vector3;function cl(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,v=new f.Matrix4,A=n.inheritType?n.inheritType:0;n.translation&&t.setPosition(In.fromArray(n.translation));var h=si(0);if(n.preRotation){var p=n.preRotation.map(f.MathUtils.degToRad);p.push(h),e.makeRotationFromEuler(Oa.fromArray(p))}if(n.rotation){var p=n.rotation.map(f.MathUtils.degToRad);p.push(n.eulerOrder||h),r.makeRotationFromEuler(Oa.fromArray(p))}if(n.postRotation){var p=n.postRotation.map(f.MathUtils.degToRad);p.push(h),i.makeRotationFromEuler(Oa.fromArray(p)),i.copy(new f.Matrix4().getInverse(i))}n.scale&&a.scale(In.fromArray(n.scale)),n.scalingOffset&&s.setPosition(In.fromArray(n.scalingOffset)),n.scalingPivot&&o.setPosition(In.fromArray(n.scalingPivot)),n.rotationOffset&&u.setPosition(In.fromArray(n.rotationOffset)),n.rotationPivot&&l.setPosition(In.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,E=new f.Matrix4;if(A===0)E.copy(m).multiply(g).multiply(x).multiply(w);else if(A===1)E.copy(m).multiply(x).multiply(g).multiply(w);else{var S=new f.Matrix4().scale(new f.Vector3().setFromMatrixScale(d)),C=new f.Matrix4().getInverse(S),R=x.clone().multiply(C);E.copy(m).multiply(g).multiply(R).multiply(w)}var k=new f.Matrix4().getInverse(l),M=new f.Matrix4().getInverse(o),I=t.clone().multiply(u).multiply(l).multiply(e).multiply(r).multiply(i).multiply(k).multiply(s).multiply(o).multiply(a).multiply(M),L=new f.Matrix4().copyPosition(I),T=c.clone().multiply(L);return v.copyPosition(T),I=v.clone().multiply(E),I.premultiply(new f.Matrix4().getInverse(c)),I}function si(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 Da(n){var t=n.split(",").map(function(e){return parseFloat(e)});return t}function fl(n,t,e){return t===void 0&&(t=0),e===void 0&&(e=n.byteLength),new TextDecoder().decode(new Uint8Array(n,t,e))}function Dp(n,t){for(var e=0,r=n.length,i=t.length;e<i;e++,r++)n[r]=t[e]}function Vp(n,t,e,r){for(var i=e,a=0;i<r;i++,a++)n[a]=t[i];return n}var zp=function(n){se(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=Qp(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=Kp(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=dt([],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=dt([],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 dl(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 Np(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],v=i[l]/(c+d);i[l]=u+c*v,u=d*v}i[s]=u}return i}function Qp(n,t,e,r){for(var i=dl(n,r,t),a=Np(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 Up(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 v=0,A=0;A<d;++A){var h=c[A+1],p=l[d-A];u[d][A]=h+p;var g=u[A][d-1]/u[d][A];u[A][d]=v+h*g,v=p*g}u[d][d]=v}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 E=0,S=m-w,C=e-w;m>=w&&(x[b][0]=x[y][0]/u[C+1][S],E=x[b][0]*u[S][C]);for(var R=S>=-1?1:-S,k=m-1<=C?w-1:e-m,M=R;M<=k;++M)x[b][M]=(x[y][M]-x[y][M-1])/u[C+1][S+M],E+=x[b][M]*u[S+M][C];m<=C&&(x[b][w]=-x[y][w-1]/u[C+1][m],E+=x[b][w]*u[m][C]),s[w][m]=E;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 Hp(n,t,e,r,i){for(var a=i<n?i:n,o=[],s=dl(n,r,t),u=Up(s,r,n,a,t),l=[],c=0;c<e.length;++c){var d=e[c].clone(),v=d.w;d.x*=v,d.y*=v,d.z*=v,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 qp(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 Gp(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(qp(s,i)*r[i]));o[s]=u.divideScalar(r[0])}return o}function Kp(n,t,e,r,i){var a=Hp(n,t,e,r,i);return Gp(a)}var Js=new f.Matrix4,jp=5e3,Xs=1e3;function Va(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 Ar||s instanceof gi)&&(s.floor=t.extras.floor)}}else if(!(r instanceof ar)){if(r instanceof Ct&&e){for(var u=new f.Box3().expandByObject(r),l=u.getCenter(new f.Vector3),c=0,d=0;d<e.length;d++){var v=e[d],A=v.ground,h=v.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(p){return p.floor=c})}}})}function _p(n,t){if(!n.content)return Promise.resolve(n);var e=n.content,r=ia(e.uri,t.search);if(n.type==="TILESET"){var i=ot(r,{key:"model.".concat(n.siblingIndex)});return e.loadState="LOADING",e.loadStateUpdateTime=he(),t.fetcher.ajax(i,{responseType:"text"}).then(function(a){return a.body}).then(function(a){var o=r.slice(0,r.lastIndexOf("/")+1);return Ni(JSON.parse(a),o)}).then(function(a){e.loadState="READY",e.loadStateUpdateTime=he(),e.loadfailRetryDelay=0,n.children.length===0&&(n.children=[new ko("".concat(n.id,".0"),a.root,n.tileset,n)])}).then(function(){return n}).catch(function(a){return e.loadState="FAILED",e.loadStateUpdateTime=he(),e.loadfailRetryDelay=Math.min(e.loadfailRetryDelay+1e3,5e3),Promise.reject(a)})}if(n.type==="SCENEGRAPH")return e.loadState="LOADING",e.loadStateUpdateTime=he(),Promise.resolve().then(function(){var a,o,s,u,l,c,d,v,A,h,p="",g=r.split("#"),m=g[0],y=g[1],b=(y||m).split("?")[0].match(/\.([0-9a-zA-Z]+)$/);if(b&&(p=b[1]),p==="b3dm"){var x=ot(r,{key:"model.".concat(n.siblingIndex)});return Ou(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,Va(w.scene,n),w})}if(p==="pnts"){var x=ot(r,{key:"model.".concat(n.siblingIndex)});return Vu(x,{computeBoundingBox:!1,fetcher:t.fetcher}).then(function(E){if(E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,n.boundingVolume){var S=n.boundingVolume;E.scene.traverse(function(C){if(C instanceof ar){Js.getInverse(C.matrixWorld);var R=new f.Box3;S.getBoundingBox(R),R.applyMatrix4(Js),C.geometry.boundingBox=R}})}return Va(E.scene,n),E})}if(p==="glb"){var x=ot(r,{key:"model.".concat(n.siblingIndex)});return Yu(x,{upAxis:n.tileset.asset.gltfUpAxis,fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,Va(E.scene,n),E})}if(p==="at3d"){var x=n.extras.at3d?r:ot(r,{key:"model.".concat(n.siblingIndex)});return Ju(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(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(p==="pbm"){var x=n.extras.pbm?r:ot(r,{key:"model.".concat(n.siblingIndex)});return Ku(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(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(p==="dome"){var x=n.extras.dome?r:ot(r,{key:"model.".concat(n.siblingIndex)});return Xu(x,{textureBaseUri:(d=n.extras.dome)===null||d===void 0?void 0:d.textureBaseUri,textureOptions:(v=n.extras.dome)===null||v===void 0?void 0:v.textureOptions,fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(p==="domez"){var x=n.extras.domez?r:ot(r,{key:"model.".concat(n.siblingIndex)});return Zu(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(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(p==="ply"){var x=n.extras.ply?r:ot(r,{key:"model.".concat(n.siblingIndex)});return No(x,{type:"pbmPointCloud",fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(p==="obj"){var x=n.extras.obj?r:ot(r,{key:"model.".concat(n.siblingIndex)});return up(x,{fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(p==="fbx"){var x=n.extras.obj?r:ot(r,{key:"model.".concat(n.siblingIndex)});return ll(x,{fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}throw new Error("Invalid Tile content: ".concat(r))}).then(function(a){a.scene.traverse(function(s){if(s instanceof ar)s.material.uniforms.geometricError.value=n.geometricError;else if(s instanceof Ct)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 Pu(n.id,a.scene,a.dispose)};return Promise.resolve().then(function(){return Promise.all([o.object.generateBvhTree(),t.renderer&&a.textures.length<16?Ud(a.textures,t.renderer,1024*1024):null])}).then(function(){return e.loadState="READY",e.loadStateUpdateTime=he(),e.loadfailRetryDelay=0,e.byteLength=o.byteLength,e.data=o,n}).catch(function(s){return vo(n),Promise.reject(s)})}).catch(function(a){return e.loadState="FAILED",e.loadStateUpdateTime=he(),a instanceof On&&a.httpStatus===0||a instanceof ii||a instanceof li?e.loadfailRetryDelay=de(e.loadfailRetryDelay+Xs,Xs,jp):e.loadfailRetryDelay=1/0,Promise.reject(a)});throw new Error("Invalid Tile type: ".concat(n.type))}function vo(n){n.content&&(n.content.data&&n.content.data.object.dispose(),n.content.data=void 0,n.content.loadState="UNLOADED",n.content.loadStateUpdateTime=he(),n.content.byteLength=0)}var hl=function(n){se(t,n);function t(e,r,i){var a=n.call(this)||this;return a.name=e,a.line=r,a.edge=i,a.name=e,a.add(r),a.add(i),a}return t.prototype.update=function(e,r,i){var a=i.bounding.distanceToPoint(r.position),o=this.line.material.uniforms;o.totalSize.value=.1+Math.sqrt(a)/10,o.dashSize.value=o.totalSize.value/2,o.dashOffset.value=-r.time/2e3*(1+a/10)%o.totalSize.value,i.needsRender=!0},t.prototype.dispose=function(){this.line.geometry.dispose(),this.line.material.dispose(),this.edge.geometry.dispose(),this.edge.material.dispose()},t}(f.Object3D),Jp=5e3,Ws=1e3,za={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 v=c>=0?l.substring(c+1):"";if(v=v.trim(),d==="newmtl")a={name:v},s[v]=a;else if(d==="ka"||d==="kd"||d==="ks"||d==="ke"){var A=v.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]=v)}}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 p(g,m,y){var b=h(y),x=nt(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 E=w.body;return E.repeat.copy(b.scale),E.offset.copy(b.offset),g.bumpScale=b.bumpScale,g[m]=E,E})}return{name:n,create:function(g){var m=new Ar,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(p(m,"map",b.map_kd)),b.map_ks!==void 0&&y.push(p(m,"specularMap",b.map_ks)),b.map_ke!==void 0&&y.push(p(m,"emissiveMap",b.map_ke)),b.norm!==void 0&&y.push(p(m,"normalMap",b.norm)),b.map_bump!==void 0&&y.push(p(m,"bumpMap",b.map_bump)),b.bump!==void 0&&y.push(p(m,"bumpMap",b.bump)),b.map_d!==void 0&&y.push(p(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(E){return m.refreshUniforms(),E});return[m,w]}}}function sp(n,t){for(var e,r,i=[],a=[],o=new f.Group,s=function(c,d){var v=n.objects[c],A=v.geometry,h=v.materials,p=!1;if(A.vertices.length===0)return"continue";var g=new f.BufferGeometry;a.push(function(){return g.dispose()}),g.setAttribute("position",new f.BufferAttribute(new Float32Array(A.vertices),3)),A.normals.length>0&&g.setAttribute("normal",new f.BufferAttribute(new Float32Array(A.normals),3)),A.colors.length>0&&(p=!0,g.setAttribute("color",new f.BufferAttribute(new Float32Array(A.colors),3))),A.uvs.length>0&&g.setAttribute("uv",new f.BufferAttribute(new Float32Array(A.uvs),2)),A.index.length>0&&g.setIndex(new f.BufferAttribute(new Uint32Array(A.index),1)),g.computeBoundingBox(),g.computeBoundingSphere();for(var m=[],y=function(S,C){var R=h[S],k=R.name+"_"+R.smooth+"_"+p,M=n.materials[k];if(!M){for(var I=null,L=0,T=t;L<T.length;L++){var B=T[L],D=B.name,V=B.create;D===R.mtllib&&(I=V(R.name))}if(!I){var N=new Ar;N.refreshUniforms(),I=[N,Promise.resolve([])]}M=I[0],M.name=R.name,M.flatShading=!(R.smooth||g.attributes.normal),M.vertexColors=p,n.materials[k]=M;var U=I[1];i.push(U),a.push(function(){return M.dispose()})}m.push(M)},b=0,x=h.length;b<x;b++)y(b);for(var b=0,x=h.length;b<x;b++){var w=h[b];g.addGroup((e=w.groupStart)!==null&&e!==void 0?e:0,(r=w.groupCount)!==null&&r!==void 0?r:0,b)}var E=new Ct(g,m);E.name=v.name,o.add(E)},u=0,l=n.objects.length;u<l;u++)s(u);return Promise.all(i).then(function(c){for(var d=[],v=0,A=c;v<A.length;v++){var h=A[v];d=d.concat(h)}return{scene:o,textures:d,dispose:function(){return a.forEach(function(p){return p()})}}})}function up(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new Rt({allowHosts:["*"]}),i=n.slice(0,n.lastIndexOf("/")+1),a=0,o;return Promise.resolve().then(function(){return r.ajax(n,{responseType:"arraybuffer"})}).then(function(s){a=s.body.byteLength;var u=new TextDecoder;return u.decode(s.body)}).then(function(s){return o=ap(s),Promise.all(o.materialLibraries.map(function(u){var l=nt(i,u),c=l.slice(0,l.lastIndexOf("/")+1);return r.ajax(l,{responseType:"text"}).then(function(d){return op(u,d.body,{path:c,fetcher:r})})}))}).then(function(s){return sp(o,s)}).then(function(s){return{type:"obj",uri:n,byteLength:a,scene:s.scene,textures:s.textures,dispose:function(){return s.dispose()}}})}var zt=Uint8Array,Rn=Uint16Array,lp=Int32Array,nl=new zt([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]),il=new zt([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]),cp=new zt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),al=function(n,t){for(var e=new Rn(31),r=0;r<31;++r)e[r]=t+=1<<n[r-1];for(var i=new lp(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}},ol=al(nl,2),sl=ol.b,fp=ol.r;sl[28]=258,fp[258]=28;var dp=al(il,0),hp=dp.b,ho=new Rn(32768);for(var Qe=0;Qe<32768;++Qe){var Gr=(Qe&43690)>>1|(Qe&21845)<<1;Gr=(Gr&52428)>>2|(Gr&13107)<<2,Gr=(Gr&61680)>>4|(Gr&3855)<<4,ho[Qe]=((Gr&65280)>>8|(Gr&255)<<8)>>1}var ti=function(n,t,e){for(var r=n.length,i=0,a=new Rn(t);i<r;++i)n[i]&&++a[n[i]-1];var o=new Rn(t);for(i=1;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(e){s=new Rn(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,v=d|(1<<c)-1;d<=v;++d)s[ho[d]>>u]=l}else for(s=new Rn(r),i=0;i<r;++i)n[i]&&(s[i]=ho[o[n[i]-1]++]>>15-n[i]);return s},yi=new zt(288);for(var Qe=0;Qe<144;++Qe)yi[Qe]=8;for(var Qe=144;Qe<256;++Qe)yi[Qe]=9;for(var Qe=256;Qe<280;++Qe)yi[Qe]=7;for(var Qe=280;Qe<288;++Qe)yi[Qe]=8;var ul=new zt(32);for(var Qe=0;Qe<32;++Qe)ul[Qe]=5;var pp=ti(yi,9,1),vp=ti(ul,5,1),La=function(n){for(var t=n[0],e=1;e<n.length;++e)n[e]>t&&(t=n[e]);return t},Zt=function(n,t,e){var r=t/8|0;return(n[r]|n[r+1]<<8)>>(t&7)&e},ka=function(n,t){var e=t/8|0;return(n[e]|n[e+1]<<8|n[e+2]<<16)>>(t&7)},mp=function(n){return(n+7)/8|0},Ap=function(n,t,e){return(e==null||e>n.length)&&(e=n.length),new zt(n.subarray(t,e))},gp=["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"],er=function(n,t,e){var r=new Error(t||gp[n]);if(r.code=n,Error.captureStackTrace&&Error.captureStackTrace(r,er),!e)throw r;return r},yp=function(n,t,e,r){var i=n.length,a=0;if(!i||t.f&&!t.l)return e||new zt(0);var o=!e,s=o||t.i!=2,u=t.i;o&&(e=new zt(i*3));var l=function(ue){var ie=e.length;if(ue>ie){var ge=new zt(Math.max(ie*2,ue));ge.set(e),e=ge}},c=t.f||0,d=t.p||0,v=t.b||0,A=t.l,h=t.d,p=t.m,g=t.n,m=i*8;do{if(!A){c=Zt(n,d,1);var y=Zt(n,d+1,3);if(d+=3,y)if(y==1)A=pp,h=vp,p=9,g=5;else if(y==2){var E=Zt(n,d,31)+257,S=Zt(n,d+10,15)+4,C=E+Zt(n,d+5,31)+1;d+=14;for(var R=new zt(C),k=new zt(19),M=0;M<S;++M)k[cp[M]]=Zt(n,d+M*3,7);d+=S*3;for(var I=La(k),L=(1<<I)-1,T=ti(k,I,1),M=0;M<C;){var B=T[Zt(n,d,L)];d+=B&15;var b=B>>4;if(b<16)R[M++]=b;else{var D=0,V=0;for(b==16?(V=3+Zt(n,d,3),d+=2,D=R[M-1]):b==17?(V=3+Zt(n,d,7),d+=3):b==18&&(V=11+Zt(n,d,127),d+=7);V--;)R[M++]=D}}var N=R.subarray(0,E),U=R.subarray(E);p=La(N),g=La(U),A=ti(N,p,1),h=ti(U,g,1)}else er(1);else{var b=mp(d)+4,x=n[b-4]|n[b-3]<<8,w=b+x;if(w>i){u&&er(0);break}s&&l(v+x),e.set(n.subarray(b,w),v),t.b=v+=x,t.p=d=w*8,t.f=c;continue}if(d>m){u&&er(0);break}}s&&l(v+131072);for(var H=(1<<p)-1,G=(1<<g)-1,j=d;;j=d){var D=A[ka(n,d)&H],J=D>>4;if(d+=D&15,d>m){u&&er(0);break}if(D||er(2),J<256)e[v++]=J;else if(J==256){j=d,A=null;break}else{var X=J-254;if(J>264){var M=J-257,Z=nl[M];X=Zt(n,d,(1<<Z)-1)+sl[M],d+=Z}var W=h[ka(n,d)&G],$=W>>4;W||er(3),d+=W&15;var U=hp[$];if($>3){var Z=il[$];U+=ka(n,d)&(1<<Z)-1,d+=Z}if(d>m){u&&er(0);break}s&&l(v+131072);var Y=v+X;if(v<U){var ne=a-U,te=Math.min(U,Y);for(ne+v<0&&er(3);v<te;++v)e[v]=r[ne+v]}for(;v<Y;++v)e[v]=e[v-U]}}t.l=A,t.p=j,t.b=v,t.f=c,A&&(c=1,t.m=p,t.d=h,t.n=g)}while(!c);return v!=e.length&&o?Ap(e,0,v):e.subarray(0,v)},bp=new zt(0),xp=function(n,t){return((n[0]&15)!=8||n[0]>>4>7||(n[0]<<8|n[1])%31)&&er(6,"invalid zlib data"),(n[1]>>5&1)==+!t&&er(6,"invalid zlib data: "+(n[1]&32?"need":"unexpected")+" dictionary"),(n[1]>>3&4)+2};function wp(n,t){return yp(n.subarray(xp(n,t),-4),{i:2},t,t)}var Ep=typeof TextDecoder!="undefined"&&new TextDecoder,Sp=0;try{Ep.decode(bp,{stream:!0}),Sp=1}catch(n){}var Mp=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function ll(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new Rt({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 Cp(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!=="Z"&&u.premultiply(Mp),o.applyMatrix4(u),{type:"fbx",uri:n,byteLength:i,scene:o,textures:a.textures,dispose:function(){return a.dispose()}}})}function Cp(n,t){var e;if(Fp(n))e=new Bp().parse(n);else{var r=fl(n);if(!Lp(r))throw new Error("THREE.FBXLoader: Unknown format.");if(Js(r)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+Js(r));e=new Rp().parse(r)}return new Ip(t).parse(e)}var Ip=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=this.parseConnections(t),s=new f.Group,u=[],l=this.parseImages(t),c=this.parseTextures(t,l,o,u),d=this.parseMaterials(t,c,o),v=this.parseDeformers(t,o),A=new Tp().parse(t,v,o);this.parseScene(t,v,A,d,o,s);var h=(r=(e=t.GlobalSettings.UpAxis)===null||e===void 0?void 0:e.value)!==null&&r!==void 0?r:1,p=(a=(i=t.GlobalSettings.UnitScaleFactor)===null||i===void 0?void 0:i.value)!==null&&a!==void 0?a:1,g;if(t.GlobalSettings.AmbientColor){var m=t.GlobalSettings.AmbientColor.value,y=m[0],b=m[1],x=m[2];if(y!==0||b!==0||x!==0){var w=new f.Color().setRGB(y,b,x);g=new f.AmbientLight(w,1)}}return Promise.all(u).then(function(E){return{scene:s,textures:E,ambientLight:g,upAxis:["X","Y","Z"][h],unitScale:p,dispose:function(){E.forEach(function(S){return S.dispose()}),d.forEach(function(S){return S.dispose()}),A.forEach(function(S){return S.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=nt(this.resourcePath,ia(o,this.search));var s=Object.assign(new f.Texture,{ID:0}),u;u=this.fetcher.loadImage(o,{},void 0,void 0,void 0,oi()).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 Ar(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 v=u[d.ID];l.setLookAtProperties(t,d,v,a,o);var A=a.get(d.ID).parents;A.forEach(function(h){var p=s.get(h.ID);p!==void 0&&p.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 v=cl(d.userData.transformData);d.applyMatrix4(v),d.updateWorldMatrix(!0,!0)}});var c=new Pp().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),v=this.buildSkeleton(d,e,l,c.attrName);if(!v){switch(c.attrType){case"Camera":v=this.createCamera(t,d);break;case"Light":v=this.createLight(t,d);break;case"Mesh":v=this.createMesh(d,r,i);break;case"NurbsCurve":case"LimbNode":case"Root":v=new f.Bone;break;case"Null":default:v=new f.Group;break}v.name=c.attrName?f.PropertyBinding.sanitizeNodeName(c.attrName):"",v.userData.originalName=c.attrName,v.ID=l}this.getTransformData(v,c),o.set(l,v)}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,v){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[v]=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 v=i.FocalLength?i.FocalLength.value:null;switch(a){case 0:r=new f.PerspectiveCamera(d,c,o,s),v!==null&&r.setFocalLength(v);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(v){var A=t.Objects.NodeAttribute[v.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 Ar(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 nu(a,o),i.normalizeSkinWeights()):i=new Ct(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=si(e.RotationOrder.value):r.eulerOrder=si(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(v){if(r.has(v.ID)){var A=v.ID,h=a.get(A);h.parents.forEach(function(p){if(i.has(p.ID)){var g=i.get(p.ID);g instanceof f.SkinnedMesh&&g.bind(new f.Skeleton(c.bones),o[p.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}(),Tp=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(v){return t.Objects.Model[v.ID]});if(s.length!==0){var u=e.children.reduce(function(v,A){return a[A.ID]!==void 0&&(v=a[A.ID]),v},null);e.children.forEach(function(v){i.morphTargets[v.ID]!==void 0&&o.push(i.morphTargets[v.ID])});var l=s[0],c={};l.RotationOrder&&(c.eulerOrder=si(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=cl(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 v=u.materialIndex[0],A=0;if(u.materialIndex.forEach(function(g,m){g!==v&&(o.addGroup(A,m-A,v),v=g,A=m)}),o.groups.length>0){var h=o.groups[o.groups.length-1],p=h.start+h.count;p!==u.materialIndex.length&&o.addGroup(p,u.materialIndex.length-p,v)}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=[],v=this;return t.vertexIndices.forEach(function(A,h){var p=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=Pi(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,C){var R=S,k=m[C];w.forEach(function(M,I,L){if(R>M){L[I]=R,R=M;var T=x[I];x[I]=k,k=T}})}),m=x,y=w}for(;y.length<4;)y.push(0),m.push(0);for(var E=0;E<4;++E)c.push(y[E]),d.push(m[E])}if(t.normal){var b=Pi(h,r,A,t.normal);s.push(b[0],b[1],b[2])}t.material&&t.material.mappingType!=="AllSame"&&(p=Pi(h,r,A,t.material)[0],p<0&&(v.negativeMaterialIndices=!0,p=0)),t.uv&&t.uv.forEach(function(S,C){var R=Pi(h,r,A,S);l[C]===void 0&&(l[C]=[]),l[C].push(R[0]),l[C].push(R[1])}),i++,g&&(v.genFace(e,t,o,p,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 v=[],A=e.baseVertexPositions||e.vertexPositions,h=0;h<r.length;h+=3)v.push(new f.Vector3(A[r[h]],A[r[h+1]],A[r[h+2]]));for(var p=this.getNormalTangentAndBitangent(v),g=p.tangent,m=p.bitangent,y=[],b=0,x=v;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 E=function(L,T,B){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[B*3]]),t.vertex.push(e.vertexPositions[r[B*3+1]]),t.vertex.push(e.vertexPositions[r[B*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[B*4]),t.vertexWeights.push(u[B*4+1]),t.vertexWeights.push(u[B*4+2]),t.vertexWeights.push(u[B*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[B*4]),t.weightsIndices.push(l[B*4+1]),t.weightsIndices.push(l[B*4+2]),t.weightsIndices.push(l[B*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[B*3]),t.colors.push(o[B*3+1]),t.colors.push(o[B*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[B*3]),t.normal.push(a[B*3+1]),t.normal.push(a[B*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][B*2]),t.uvs[V].push(s[V][B*2+1])})},S=0,C=d;S<C.length;S++){var R=C[S],k=R[0],M=R[1],I=R[2];E(k,M,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),v=0;v<l.length;v++){var A=l[v]*3;d[A]=u[v*3],d[A+1]=u[v*3+1],d[A+2]=u[v*3+2]}var h={vertexIndices:s,vertexPositions:d,baseVertexPositions:o},p=this.genBuffers(h),g=new f.Float32BufferAttribute(p.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 zp(r,i,a,l,c),v=d.getPoints(a.length*12);return new f.BufferGeometry().setFromPoints(v)},n}(),Pp=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(kp),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 v=d.children;v.forEach(function(A,h){if(e.has(A.ID)){var p=e.get(A.ID);if(p.curves.x!==void 0||p.curves.y!==void 0||p.curves.z!==void 0){if(c[h]===void 0){var g=r.get(A.ID).parents.filter(function(C){return C.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(C){C.ID===m.id&&(y.transform=C.matrix,C.userData.transformData&&(y.eulerOrder=C.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][p.attr]=p)}else if(p.curves.morph!==void 0){if(c[h]===void 0){var b=r.get(A.ID).parents.filter(function(R){return R.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,E=t.Objects.Model[g],S={modelName:E.attrName?f.PropertyBinding.sanitizeNodeName(E.attrName):"",morphName:t.Objects.Deformer[b].attrName};c[h]=S}c[h][p.attr]=p}}}),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=si(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 v=new f.Quaternion,A=new f.Euler,h=[];if(!s||!o)return new f.QuaternionKeyframeTrack(t+".quaternion",[0],[0]);for(var p=0;p<s.length;p+=3){if(A.set(s[p],s[p+1],s[p+2],a),v.setFromEuler(A),v.premultiply(c),v.multiply(d),p>2){var g=new f.Quaternion().fromArray(h,(p-3)/3*4);g.dot(v)<0&&v.set(-v.x,-v.y,-v.z,-v.w)}v.toArray(h,p/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 v=e.z.values[u];a.push(v),i[2]=v}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]],v=[Math.abs(d[0]),Math.abs(d[1]),Math.abs(d[2])];if(v[0]>=180||v[1]>=180||v[2]>=180){var A=Math.max.apply(Math,v),h=A/180,p=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(p),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,E=new f.Euler,S=0;S<1;S+=1/h)w.copy(m.clone().slerp(y.clone(),S)),a.push(b+S*x),E.setFromQuaternion(w,i),o.push(E.x),o.push(E.y),o.push(E.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}(),Rp=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(v){return v.trim().replace(/^"/,"")}),i="connections",a=[l,c],Dp(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=Da(a))},n.prototype.parseNodePropertyContinued=function(t){var e=this.getCurrentNode();e.a+=t,t.slice(-1)!==","&&(e.a=Da(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=Da(l);break}this.getPrevNode()[a]={type:o,type2:s,flag:u,value:l},this.setCurrentProp(this.getPrevNode(),a)},n}(),Bp=function(){function n(){}return n.prototype.parse=function(t){var e=new js(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]:"",v=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),v!==""&&(r.attrType=v),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(v,A){A!==0&&a.push(v)}),e.connections===void 0&&(e.connections=[]),e.connections.push(a)}else if(r.name==="Properties70"){var o=Object.keys(r);o.forEach(function(v){e[v]=r[v]})}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=wp(new Uint8Array(t.getArrayBuffer(o))),u=new js(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}(),js=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 Fp(n){var t="Kaydara FBX Binary \0";return n.byteLength>=t.length&&t===fl(n,0,t.length)}function Lp(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 Js(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 kp(n){return n/46186158e3}var Op=[];function Pi(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 Vp(Op,r.buffer,a,o)}var Oa=new f.Euler,In=new f.Vector3;function cl(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,v=new f.Matrix4,A=n.inheritType?n.inheritType:0;n.translation&&t.setPosition(In.fromArray(n.translation));var h=si(0);if(n.preRotation){var p=n.preRotation.map(f.MathUtils.degToRad);p.push(h),e.makeRotationFromEuler(Oa.fromArray(p))}if(n.rotation){var p=n.rotation.map(f.MathUtils.degToRad);p.push(n.eulerOrder||h),r.makeRotationFromEuler(Oa.fromArray(p))}if(n.postRotation){var p=n.postRotation.map(f.MathUtils.degToRad);p.push(h),i.makeRotationFromEuler(Oa.fromArray(p)),i.copy(new f.Matrix4().getInverse(i))}n.scale&&a.scale(In.fromArray(n.scale)),n.scalingOffset&&s.setPosition(In.fromArray(n.scalingOffset)),n.scalingPivot&&o.setPosition(In.fromArray(n.scalingPivot)),n.rotationOffset&&u.setPosition(In.fromArray(n.rotationOffset)),n.rotationPivot&&l.setPosition(In.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,E=new f.Matrix4;if(A===0)E.copy(m).multiply(g).multiply(x).multiply(w);else if(A===1)E.copy(m).multiply(x).multiply(g).multiply(w);else{var S=new f.Matrix4().scale(new f.Vector3().setFromMatrixScale(d)),C=new f.Matrix4().getInverse(S),R=x.clone().multiply(C);E.copy(m).multiply(g).multiply(R).multiply(w)}var k=new f.Matrix4().getInverse(l),M=new f.Matrix4().getInverse(o),I=t.clone().multiply(u).multiply(l).multiply(e).multiply(r).multiply(i).multiply(k).multiply(s).multiply(o).multiply(a).multiply(M),L=new f.Matrix4().copyPosition(I),T=c.clone().multiply(L);return v.copyPosition(T),I=v.clone().multiply(E),I.premultiply(new f.Matrix4().getInverse(c)),I}function si(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 Da(n){var t=n.split(",").map(function(e){return parseFloat(e)});return t}function fl(n,t,e){return t===void 0&&(t=0),e===void 0&&(e=n.byteLength),new TextDecoder().decode(new Uint8Array(n,t,e))}function Dp(n,t){for(var e=0,r=n.length,i=t.length;e<i;e++,r++)n[r]=t[e]}function Vp(n,t,e,r){for(var i=e,a=0;i<r;i++,a++)n[a]=t[i];return n}var zp=function(n){se(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=Qp(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=Kp(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=dt([],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=dt([],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 dl(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 Np(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],v=i[l]/(c+d);i[l]=u+c*v,u=d*v}i[s]=u}return i}function Qp(n,t,e,r){for(var i=dl(n,r,t),a=Np(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 Up(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 v=0,A=0;A<d;++A){var h=c[A+1],p=l[d-A];u[d][A]=h+p;var g=u[A][d-1]/u[d][A];u[A][d]=v+h*g,v=p*g}u[d][d]=v}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 E=0,S=m-w,C=e-w;m>=w&&(x[b][0]=x[y][0]/u[C+1][S],E=x[b][0]*u[S][C]);for(var R=S>=-1?1:-S,k=m-1<=C?w-1:e-m,M=R;M<=k;++M)x[b][M]=(x[y][M]-x[y][M-1])/u[C+1][S+M],E+=x[b][M]*u[S+M][C];m<=C&&(x[b][w]=-x[y][w-1]/u[C+1][m],E+=x[b][w]*u[m][C]),s[w][m]=E;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 Hp(n,t,e,r,i){for(var a=i<n?i:n,o=[],s=dl(n,r,t),u=Up(s,r,n,a,t),l=[],c=0;c<e.length;++c){var d=e[c].clone(),v=d.w;d.x*=v,d.y*=v,d.z*=v,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 qp(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 Gp(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(qp(s,i)*r[i]));o[s]=u.divideScalar(r[0])}return o}function Kp(n,t,e,r,i){var a=Hp(n,t,e,r,i);return Gp(a)}var _s=new f.Matrix4,jp=5e3,Xs=1e3;function Va(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 Ar||s instanceof gi)&&(s.floor=t.extras.floor)}}else if(!(r instanceof ar)){if(r instanceof Ct&&e){for(var u=new f.Box3().expandByObject(r),l=u.getCenter(new f.Vector3),c=0,d=0;d<e.length;d++){var v=e[d],A=v.ground,h=v.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(p){return p.floor=c})}}})}function Jp(n,t){if(!n.content)return Promise.resolve(n);var e=n.content,r=ia(e.uri,t.search);if(n.type==="TILESET"){var i=ot(r,{key:"model.".concat(n.siblingIndex)});return e.loadState="LOADING",e.loadStateUpdateTime=he(),t.fetcher.ajax(i,{responseType:"text"}).then(function(a){return a.body}).then(function(a){var o=r.slice(0,r.lastIndexOf("/")+1);return Ni(JSON.parse(a),o)}).then(function(a){e.loadState="READY",e.loadStateUpdateTime=he(),e.loadfailRetryDelay=0,n.children.length===0&&(n.children=[new ko("".concat(n.id,".0"),a.root,n.tileset,n)])}).then(function(){return n}).catch(function(a){return e.loadState="FAILED",e.loadStateUpdateTime=he(),e.loadfailRetryDelay=Math.min(e.loadfailRetryDelay+1e3,5e3),Promise.reject(a)})}if(n.type==="SCENEGRAPH")return e.loadState="LOADING",e.loadStateUpdateTime=he(),Promise.resolve().then(function(){var a,o,s,u,l,c,d,v,A,h,p="",g=r.split("#"),m=g[0],y=g[1],b=(y||m).split("?")[0].match(/\.([0-9a-zA-Z]+)$/);if(b&&(p=b[1]),p==="b3dm"){var x=ot(r,{key:"model.".concat(n.siblingIndex)});return Ou(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,Va(w.scene,n),w})}if(p==="pnts"){var x=ot(r,{key:"model.".concat(n.siblingIndex)});return Vu(x,{computeBoundingBox:!1,fetcher:t.fetcher}).then(function(E){if(E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,n.boundingVolume){var S=n.boundingVolume;E.scene.traverse(function(C){if(C instanceof ar){_s.getInverse(C.matrixWorld);var R=new f.Box3;S.getBoundingBox(R),R.applyMatrix4(_s),C.geometry.boundingBox=R}})}return Va(E.scene,n),E})}if(p==="glb"){var x=ot(r,{key:"model.".concat(n.siblingIndex)});return Yu(x,{upAxis:n.tileset.asset.gltfUpAxis,fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,Va(E.scene,n),E})}if(p==="at3d"){var x=n.extras.at3d?r:ot(r,{key:"model.".concat(n.siblingIndex)});return _u(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(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(p==="pbm"){var x=n.extras.pbm?r:ot(r,{key:"model.".concat(n.siblingIndex)});return Ku(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(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(p==="dome"){var x=n.extras.dome?r:ot(r,{key:"model.".concat(n.siblingIndex)});return Xu(x,{textureBaseUri:(d=n.extras.dome)===null||d===void 0?void 0:d.textureBaseUri,textureOptions:(v=n.extras.dome)===null||v===void 0?void 0:v.textureOptions,fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(p==="domez"){var x=n.extras.domez?r:ot(r,{key:"model.".concat(n.siblingIndex)});return Zu(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(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(p==="ply"){var x=n.extras.ply?r:ot(r,{key:"model.".concat(n.siblingIndex)});return No(x,{type:"pbmPointCloud",fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(p==="obj"){var x=n.extras.obj?r:ot(r,{key:"model.".concat(n.siblingIndex)});return up(x,{fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(p==="fbx"){var x=n.extras.obj?r:ot(r,{key:"model.".concat(n.siblingIndex)});return ll(x,{fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}throw new Error("Invalid Tile content: ".concat(r))}).then(function(a){a.scene.traverse(function(s){if(s instanceof ar)s.material.uniforms.geometricError.value=n.geometricError;else if(s instanceof Ct)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 Pu(n.id,a.scene,a.dispose)};return Promise.resolve().then(function(){return Promise.all([o.object.generateBvhTree(),t.renderer&&a.textures.length<16?Ud(a.textures,t.renderer,1024*1024):null])}).then(function(){return e.loadState="READY",e.loadStateUpdateTime=he(),e.loadfailRetryDelay=0,e.byteLength=o.byteLength,e.data=o,n}).catch(function(s){return vo(n),Promise.reject(s)})}).catch(function(a){return e.loadState="FAILED",e.loadStateUpdateTime=he(),a instanceof On&&a.httpStatus===0||a instanceof ii||a instanceof li?e.loadfailRetryDelay=de(e.loadfailRetryDelay+Xs,Xs,jp):e.loadfailRetryDelay=1/0,Promise.reject(a)});throw new Error("Invalid Tile type: ".concat(n.type))}function vo(n){n.content&&(n.content.data&&n.content.data.object.dispose(),n.content.data=void 0,n.content.loadState="UNLOADED",n.content.loadStateUpdateTime=he(),n.content.byteLength=0)}var hl=function(n){se(t,n);function t(e,r,i){var a=n.call(this)||this;return a.name=e,a.line=r,a.edge=i,a.name=e,a.add(r),a.add(i),a}return t.prototype.update=function(e,r,i){var a=i.bounding.distanceToPoint(r.position),o=this.line.material.uniforms;o.totalSize.value=.1+Math.sqrt(a)/10,o.dashSize.value=o.totalSize.value/2,o.dashOffset.value=-r.time/2e3*(1+a/10)%o.totalSize.value,i.needsRender=!0},t.prototype.dispose=function(){this.line.geometry.dispose(),this.line.material.dispose(),this.edge.geometry.dispose(),this.edge.material.dispose()},t}(f.Object3D),_p=5e3,Ws=1e3,za={vertexShader:`
935
935
  uniform float scale;
936
936
  attribute float lineDistance;
937
937
  varying float vLineDistance;
@@ -1029,11 +1029,11 @@ void main() {
1029
1029
  #include <fog_fragment>
1030
1030
  #include <premultiplied_alpha_fragment>
1031
1031
  }
1032
- `,uniforms:{diffuse:{value:new f.Color},size:{value:1}}},Xp=function(n){se(t,n);function t(e,r,i,a){var o=new Float32Array([e.x,e.y,e.z,r.x,r.y,r.z]),s=new Float32Array([0,1]),u=new f.BufferGeometry;u.setAttribute("position",new f.BufferAttribute(o,3)),u.setAttribute("start",new f.BufferAttribute(s,1));var l=new f.ShaderMaterial({vertexShader:Na.vertexShader,fragmentShader:Na.fragmentShader,uniforms:f.UniformsUtils.clone(Na.uniforms)});return l.uniforms.size.value=i,l.uniforms.diffuse.value.copy(a),n.call(this,u,l)||this}return t}(f.Points);function Wp(n,t){var e=n.name,r=ia(n.content.uri,t.search),i=ot(r,{key:"model.0"}),a=n.content.color;return n.content.loadState="LOADING",n.content.loadStateUpdateTime=he(),No(i,{type:"geometry",fetcher:t.fetcher}).then(function(o){var s=o.scene,u=new f.ShaderMaterial({vertexShader:za.vertexShader,fragmentShader:za.fragmentShader,uniforms:f.UniformsUtils.clone(za.uniforms)});u.uniforms.diffuse.value.set(a),u.uniforms.totalSize.value=.2,u.uniforms.dashSize.value=u.uniforms.totalSize.value/2;var l=new f.Line(s,u);l.computeLineDistances(),l.applyMatrix4(n.transform),l.updateWorldMatrix(!1,!0),l.matrixAutoUpdate=!1;var c=s.attributes.position.array,d=new Xp(new f.Vector3().fromArray(c,0),new f.Vector3().fromArray(c,c.length-3),12,a);d.applyMatrix4(n.transform),d.updateWorldMatrix(!1,!0),d.matrixAutoUpdate=!1;var v=new hl(e,l,d);return n.content.data={byteLength:o.byteLength,object:v,uri:i},n.content.byteLength=o.byteLength,n.content.loadState="READY",n.content.loadStateUpdateTime=he(),n}).catch(function(o){return n.content.data=void 0,n.content.loadState="FAILED",n.content.loadStateUpdateTime=he(),o instanceof On&&o.httpStatus===0||o instanceof ii||o instanceof li?n.content.loadfailRetryDelay=de(n.content.loadfailRetryDelay+Ws,Ws,Jp):n.content.loadfailRetryDelay=1/0,Promise.reject(o)})}function Zs(n){n.content&&(n.content.data&&n.content.data.object.dispose(),n.content.data=void 0,n.content.loadState="UNLOADED",n.content.loadStateUpdateTime=he(),n.content.byteLength=0)}var Ys=new f.Vector3,Zp=new f.Matrix3,Yp=new f.Matrix4,ft=6378137,pl=298.257223563;function vl(n){for(var t=ft-ft/pl,e=(ft*ft-t*t)/(ft*ft),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=ft/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 v=Math.abs(d-s);if(v<i)break;s=d}return n.set(s,Math.atan2(n.y,n.x),u)}function $p(n){var t=n.x,e=n.y,r=n.z,i=ft-ft/pl,a=(ft*ft-i*i)/(ft*ft),o=Math.sin(t),s=Math.cos(t),u=Math.sin(e),l=Math.cos(e),c=ft/Math.sqrt(1-a*o*o),d=(c+r)*s*l,v=(c+r)*s*u,A=(i*i/(ft*ft)*c+r)*o;return n.set(d,v,A)}function ev(n,t){var e=vl(Ys.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=Zp.setFromMatrix4(t),d=Ys.copy(n).applyMatrix3(c).multiplyScalar(-1);t.setPosition(d);var v=Yp.fromArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,a,1]);return t.premultiply(v),t}var tr={TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15},$s=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=tr.TILE_MASK,n.stencilFunc=f.AlwaysStencilFunc,n.stencilFuncMask=tr.TILE_MASK,n.stencilZPass=f.ReplaceStencilOp,n.stencilWriteMask=tr.TILE_MASK,n}(),e0=function(){var n=new f.MeshBasicMaterial;return n.visible=!1,n}(),tv=new f.BufferGeometry,rv=new f.MeshBasicMaterial,fn=function(n){se(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.idle=!1,u.minLevelOfDetail=t.DEFAULT_MIN_LEVEL_OF_DETAIL,u.maxLevelOfDetail=t.DEFAULT_MAX_LEVEL_OF_DETAIL,u.needsRefined=!0,u.refined=!1,u.refineProgress=[0,0],u.loaded=!1,u.disposed=!1,u.needsRender=!0,u.lastRenderHash="",u.matrixAutoUpdate=!1,u.cacheCameras=[],u.clearStencilObject=new f.Mesh(tv,rv),u.clearStencilObject.frustumCulled=!1,u.clearStencilObject.onAfterRender=function(l){return l.clearStencil()},u.tileset=new Cr((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.getRenderHash=function(){return na([this.tileset.id,this.tileset.skipLevelOfDetail,this.tileset.selectedTiles.map(function(e){return e.id}),this.tileset.trajectories.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 vl(this.localToEcef(e))},t.prototype.llaToLocal=function(e){return this.ecefToLocal($p(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 _p(e,{fetcher:this.fetcher,search:this.search,renderer:this.renderer}).then(function(i){e.type==="SCENEGRAPH"&&(r.disposed||!e.content?vo(e):e.content.data&&r.boundingBox.expandByObject(e.content.data.object))})},t.prototype.unloadContent=function(e){return vo(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 Wp(e,{fetcher:this.fetcher,search:this.search,renderer:this.renderer}).then(function(i){r.disposed&&Zs(i)})},t.prototype.unloadTrajectory=function(e){return Zs(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 v=u?l.boundingVolume:l.boundingVolume.clone().applyMatrix4(s);d=v.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(p){return p.floor===a.model.shownFloorIndex})),r&&c.sort(function(p,g){return p.distance-g.distance}),c.map(function(p){p.model=a.model,p.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?e0:$s}):e.material&&e.material.transparent?e0:$s):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){var i,a,o,s=this,u,l,c;this.renderObjects.length=0,this.backfaceObjects.length=0,this.debugObjects.length=0,this.tileObjects.length=0,this.renderer=e,this.tileset.transform.equals(this.matrixWorld)||this.tileset.transform.copy(this.matrixWorld),this.tileset.cache.reset();var d=this.tileset.frameNumber+1,v=this.visible,A=Math.max(this.maxLevelOfDetail,0),h=Math.min(this.minLevelOfDetail,A),p=Math.max(h,0),g={time:he(),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:h,maxLevelOfDetail:v&&!this.idle&&this.loaded?A:p,height:r.resolution.height,pixelRatio:r.pixelRatio,frameNumber:d,sseDenominator:2*Math.tan(.5*r.fov/180*Math.PI),cullingVolume:new Yn().setFromCamera(r)},m=this.cacheCameras.map(function($){return O(O({},g),{camera:{type:r.type,position:new f.Vector3().copy($.position),direction:$.getWorldDirection(new f.Vector3),near:r.near,far:r.far,up:new f.Vector3().copy($.up),visible:$.visible,refine:!0},cullingVolume:new Yn().setFromCamera($)})});this.needsRefined&&this.tileset.update(g,m),this.refined=!0,this.refineProgress[0]=0,this.refineProgress[1]=0,this.tileset.needsRefinedTiles.forEach(function($){if(s.refineProgress[1]++,$.content){var Y=$.content.loadState;if(Y==="UNLOADED"||Y==="LOADING"){s.refined=!1;return}}s.refineProgress[0]++}),this.loaded===!1&&this.tileset.selectedTiles.length>0&&this.tileset.needsRefinedTiles.size>0&&(this.loaded=!0,this.tileset.needsRefinedTiles.forEach(function($){if(s.loaded!==!1){if(s.tileset.skipLevelOfDetail){if($.state.finalResolution&&$.content){var Y=$.state.ancestorWithContentAvailable,ne=Y&&Y.content?Y.content:$.content,te=ne.loadState;(te==="UNLOADED"||te==="LOADING")&&(s.loaded=!1)}}else if($.state.visible&&$.content&&$.levelOfContent<=0){var te=$.content.loadState;(te==="UNLOADED"||te==="LOADING")&&(s.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){return $.floor-Y.floor}),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=(l=(u=x.content)===null||u===void 0?void 0:u.data)===null||l===void 0?void 0:l.object;if(w){if(w.update(e,r,this.model,x),this.tileset.hasMixedContent&&this.tileset.skipLevelOfDetail){if(!x.state.finalResolution){var E=this.cloneSkipBackfaceObject(w);this.backfaceObjects.push(E)}for(var S=x.state.selectionDepth,C=tr.TILE_MASK|S<<tr.SKIP_LOD_BIT_SHIFT,R=f.GreaterEqualStencilFunc,k=tr.SKIP_LOD_MASK,M=f.ReplaceStencilOp,I=tr.TILE_MASK|tr.SKIP_LOD_MASK,L=0,T=w.materials;L<T.length;L++){var B=T[L];B.stencilWrite=!0,B.stencilRef=C,B.stencilFunc=R,B.stencilFuncMask=k,B.stencilZPass=M,B.stencilWriteMask=I}}else for(var D=0,V=w.materials;D<V.length;D++){var B=V[D];B.stencilWrite=!1,B.stencilRef=tr.TILE_MASK,B.stencilFunc=f.AlwaysStencilFunc,B.stencilFuncMask=tr.TILE_MASK,B.stencilZPass=f.ReplaceStencilOp,B.stencilWriteMask=tr.TILE_MASK}this.tileObjects.push(w)}}this.tileset.skipLevelOfDetail&&this.backfaceObjects.length&&(i=this.renderObjects).push.apply(i,this.backfaceObjects),this.tileObjects.length&&(a=this.renderObjects).push.apply(a,this.tileObjects),this.tileset.skipLevelOfDetail&&this.renderObjects.push(this.clearStencilObject);for(var N=0,U=this.tileset.selectedTrajectories;N<U.length;N++){var H=U[N],G=(c=H.content.data)===null||c===void 0?void 0:c.object;G&&(G.update(e,r,this.model),this.renderObjects.push(G))}this.debug&&(o=this.renderObjects).push.apply(o,this.debugObjects);for(var j=this.modelIndex*1e4,_=function($){var Y=X.renderObjects[$],ne=$+j;Y.traverse(function(te){(te instanceof f.Mesh||te instanceof f.Line||te instanceof f.Points)&&(te.renderOrder=ne)}),X.add(Y)},X=this,Z=0;Z<this.renderObjects.length;Z++)_(Z);var W=this.getRenderHash();this.lastRenderHash!==W&&(this.needsRender=!0,this.lastRenderHash=W)},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=Cr.DEFAULT_MAX_SCREEN_SPACE_ERROR,t.DEFAULT_SKIP_LEVEL_OF_DETAIL=Cr.DEFAULT_SKIP_LEVEL_OF_DETAIL,t.DEFAULT_MOST_DETAIL=Cr.DEFAULT_MOST_DETAIL,t.DEFAULT_LOAD_SIBLINGS=Cr.DEFAULT_LOAD_SIBLINGS,t.DEFAULT_LOAD_ALL=Cr.DEFAULT_LOAD_ALL,t.DEFAULT_MAX_REQUESTS=Cr.DEFAULT_MAX_REQUESTS,t.DEFAULT_REQUEST_ORDER=Cr.DEFAULT_REQUEST_ORDER,t}(f.Object3D);function nv(n){return-((n-.25)*360+90)/180*Math.PI}function mo(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(!mo(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(!mo(n[a],t[a]))return!1}return!0}return n!==n&&t!==t}function Yt(n){return typeof n=="number"}var t0=function(){return new Error("Invalid input.")},r0=function(){return new Error("Invalid certificate.")},n0=function(){return new Error("Invalid signature.")},iv=function(n){return new Error("date(".concat(n.toString(),") expired."))},av=function(n){return new Error("host(".concat(JSON.stringify(n),") is not allowed."))};function ov(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 jn(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+=jn(n[a],!1)+",";return i>-1&&(r+=jn(n[a],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return jn(n.toJSON(),t);for(var o=Object.keys(n).sort(),s=o.length,r="",a=0;a<s;){var u=o[a],l=jn(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 sv(n){return String(jn(n,!1))}function ml(n){var t,e,r;if(Array.isArray(n)){var i=void 0,a,o;if(n.length<=0)return t0();for(var s=function(w){var E=ml(n[w]);if(E instanceof Error)return{value:E};if(!i)i=E.issuer;else if(i!==E.issuer)return{value:r0()};a?E.expire.getTime()<a.getTime()&&(a=E.expire):a=E.expire,o?o=o.filter(function(S){return E.allowHosts.indexOf(S)!==-1}):o=E.allowHosts},u=0;u<n.length;u++){var l=s(u);if(typeof l=="object")return l.value}return Pn({issuer:i,expire:a,allowHosts:o})}var c=JSON.parse(n),d=typeof location!="undefined"?location.hostname:"",v=Date.now();if(typeof c!="object")return t0();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||mn(d)||vr.filter(function(w){return Yr(w,d)}).length>0){var p=String((t=c.certificate)!==null&&t!==void 0?t:"");if(p){var g=new Ge;return g.readCertPEM(p),Pn({issuer:g.getSubjectString(),expire:A,allowHosts:h})}return Pn({issuer:"none",expire:A,allowHosts:h})}var m=String((e=c.certificate)!==null&&e!==void 0?e:"");if(!m)return r0();var y=new Ge;y.readCertPEM(m);var b=String((r=c._signature)!==null&&r!==void 0?r:"");if(!b)return n0();var x=sv(ov(c,["_signature"]));return sf(x,b,y)===!1?n0():v<A.getTime()?h.filter(function(w){return Yr(w,d)}).length===0?av(d):Pn({issuer:y.getSubjectString(),expire:A,allowHosts:h}):iv(A)}var i0=new f.Matrix4,Qo=new WeakMap,Hn=new Set,Uo=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)}}}var i=lv(t,e,this);if(i instanceof Error)throw new Error("[PARSE FAILED]: "+i.message+`
1032
+ `,uniforms:{diffuse:{value:new f.Color},size:{value:1}}},Xp=function(n){se(t,n);function t(e,r,i,a){var o=new Float32Array([e.x,e.y,e.z,r.x,r.y,r.z]),s=new Float32Array([0,1]),u=new f.BufferGeometry;u.setAttribute("position",new f.BufferAttribute(o,3)),u.setAttribute("start",new f.BufferAttribute(s,1));var l=new f.ShaderMaterial({vertexShader:Na.vertexShader,fragmentShader:Na.fragmentShader,uniforms:f.UniformsUtils.clone(Na.uniforms)});return l.uniforms.size.value=i,l.uniforms.diffuse.value.copy(a),n.call(this,u,l)||this}return t}(f.Points);function Wp(n,t){var e=n.name,r=ia(n.content.uri,t.search),i=ot(r,{key:"model.0"}),a=n.content.color;return n.content.loadState="LOADING",n.content.loadStateUpdateTime=he(),No(i,{type:"geometry",fetcher:t.fetcher}).then(function(o){var s=o.scene,u=new f.ShaderMaterial({vertexShader:za.vertexShader,fragmentShader:za.fragmentShader,uniforms:f.UniformsUtils.clone(za.uniforms)});u.uniforms.diffuse.value.set(a),u.uniforms.totalSize.value=.2,u.uniforms.dashSize.value=u.uniforms.totalSize.value/2;var l=new f.Line(s,u);l.computeLineDistances(),l.applyMatrix4(n.transform),l.updateWorldMatrix(!1,!0),l.matrixAutoUpdate=!1;var c=s.attributes.position.array,d=new Xp(new f.Vector3().fromArray(c,0),new f.Vector3().fromArray(c,c.length-3),12,a);d.applyMatrix4(n.transform),d.updateWorldMatrix(!1,!0),d.matrixAutoUpdate=!1;var v=new hl(e,l,d);return n.content.data={byteLength:o.byteLength,object:v,uri:i},n.content.byteLength=o.byteLength,n.content.loadState="READY",n.content.loadStateUpdateTime=he(),n}).catch(function(o){return n.content.data=void 0,n.content.loadState="FAILED",n.content.loadStateUpdateTime=he(),o instanceof On&&o.httpStatus===0||o instanceof ii||o instanceof li?n.content.loadfailRetryDelay=de(n.content.loadfailRetryDelay+Ws,Ws,_p):n.content.loadfailRetryDelay=1/0,Promise.reject(o)})}function Zs(n){n.content&&(n.content.data&&n.content.data.object.dispose(),n.content.data=void 0,n.content.loadState="UNLOADED",n.content.loadStateUpdateTime=he(),n.content.byteLength=0)}var Ys=new f.Vector3,Zp=new f.Matrix3,Yp=new f.Matrix4,ft=6378137,pl=298.257223563;function vl(n){for(var t=ft-ft/pl,e=(ft*ft-t*t)/(ft*ft),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=ft/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 v=Math.abs(d-s);if(v<i)break;s=d}return n.set(s,Math.atan2(n.y,n.x),u)}function $p(n){var t=n.x,e=n.y,r=n.z,i=ft-ft/pl,a=(ft*ft-i*i)/(ft*ft),o=Math.sin(t),s=Math.cos(t),u=Math.sin(e),l=Math.cos(e),c=ft/Math.sqrt(1-a*o*o),d=(c+r)*s*l,v=(c+r)*s*u,A=(i*i/(ft*ft)*c+r)*o;return n.set(d,v,A)}function ev(n,t){var e=vl(Ys.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=Zp.setFromMatrix4(t),d=Ys.copy(n).applyMatrix3(c).multiplyScalar(-1);t.setPosition(d);var v=Yp.fromArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,a,1]);return t.premultiply(v),t}var tr={TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15},$s=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=tr.TILE_MASK,n.stencilFunc=f.AlwaysStencilFunc,n.stencilFuncMask=tr.TILE_MASK,n.stencilZPass=f.ReplaceStencilOp,n.stencilWriteMask=tr.TILE_MASK,n}(),e0=function(){var n=new f.MeshBasicMaterial;return n.visible=!1,n}(),tv=new f.BufferGeometry,rv=new f.MeshBasicMaterial,fn=function(n){se(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.idle=!1,u.minLevelOfDetail=t.DEFAULT_MIN_LEVEL_OF_DETAIL,u.maxLevelOfDetail=t.DEFAULT_MAX_LEVEL_OF_DETAIL,u.needsRefined=!0,u.refined=!1,u.refineProgress=[0,0],u.loaded=!1,u.disposed=!1,u.needsRender=!0,u.lastRenderHash="",u.matrixAutoUpdate=!1,u.cacheCameras=[],u.clearStencilObject=new f.Mesh(tv,rv),u.clearStencilObject.frustumCulled=!1,u.clearStencilObject.onAfterRender=function(l){return l.clearStencil()},u.tileset=new Cr((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.getRenderHash=function(){return na([this.tileset.id,this.tileset.skipLevelOfDetail,this.tileset.selectedTiles.map(function(e){return e.id}),this.tileset.trajectories.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 vl(this.localToEcef(e))},t.prototype.llaToLocal=function(e){return this.ecefToLocal($p(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 Jp(e,{fetcher:this.fetcher,search:this.search,renderer:this.renderer}).then(function(i){e.type==="SCENEGRAPH"&&(r.disposed||!e.content?vo(e):e.content.data&&r.boundingBox.expandByObject(e.content.data.object))})},t.prototype.unloadContent=function(e){return vo(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 Wp(e,{fetcher:this.fetcher,search:this.search,renderer:this.renderer}).then(function(i){r.disposed&&Zs(i)})},t.prototype.unloadTrajectory=function(e){return Zs(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 v=u?l.boundingVolume:l.boundingVolume.clone().applyMatrix4(s);d=v.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(p){return p.floor===a.model.shownFloorIndex})),r&&c.sort(function(p,g){return p.distance-g.distance}),c.map(function(p){p.model=a.model,p.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?e0:$s}):e.material&&e.material.transparent?e0:$s):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){var i,a,o,s=this,u,l,c;this.renderObjects.length=0,this.backfaceObjects.length=0,this.debugObjects.length=0,this.tileObjects.length=0,this.renderer=e,this.tileset.transform.equals(this.matrixWorld)||this.tileset.transform.copy(this.matrixWorld),this.tileset.cache.reset();var d=this.tileset.frameNumber+1,v=this.visible,A=Math.max(this.maxLevelOfDetail,0),h=Math.min(this.minLevelOfDetail,A),p=Math.max(h,0),g={time:he(),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:h,maxLevelOfDetail:v&&!this.idle&&this.loaded?A:p,height:r.resolution.height,pixelRatio:r.pixelRatio,frameNumber:d,sseDenominator:2*Math.tan(.5*r.fov/180*Math.PI),cullingVolume:new Yn().setFromCamera(r)},m=this.cacheCameras.map(function($){return O(O({},g),{camera:{type:r.type,position:new f.Vector3().copy($.position),direction:$.getWorldDirection(new f.Vector3),near:r.near,far:r.far,up:new f.Vector3().copy($.up),visible:$.visible,refine:!0},cullingVolume:new Yn().setFromCamera($)})});this.needsRefined&&this.tileset.update(g,m),this.refined=!0,this.refineProgress[0]=0,this.refineProgress[1]=0,this.tileset.needsRefinedTiles.forEach(function($){if(s.refineProgress[1]++,$.content){var Y=$.content.loadState;if(Y==="UNLOADED"||Y==="LOADING"){s.refined=!1;return}}s.refineProgress[0]++}),this.loaded===!1&&this.tileset.selectedTiles.length>0&&this.tileset.needsRefinedTiles.size>0&&(this.loaded=!0,this.tileset.needsRefinedTiles.forEach(function($){if(s.loaded!==!1){if(s.tileset.skipLevelOfDetail){if($.state.finalResolution&&$.content){var Y=$.state.ancestorWithContentAvailable,ne=Y&&Y.content?Y.content:$.content,te=ne.loadState;(te==="UNLOADED"||te==="LOADING")&&(s.loaded=!1)}}else if($.state.visible&&$.content&&$.levelOfContent<=0){var te=$.content.loadState;(te==="UNLOADED"||te==="LOADING")&&(s.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){return $.floor-Y.floor}),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=(l=(u=x.content)===null||u===void 0?void 0:u.data)===null||l===void 0?void 0:l.object;if(w){if(w.update(e,r,this.model,x),this.tileset.hasMixedContent&&this.tileset.skipLevelOfDetail){if(!x.state.finalResolution){var E=this.cloneSkipBackfaceObject(w);this.backfaceObjects.push(E)}for(var S=x.state.selectionDepth,C=tr.TILE_MASK|S<<tr.SKIP_LOD_BIT_SHIFT,R=f.GreaterEqualStencilFunc,k=tr.SKIP_LOD_MASK,M=f.ReplaceStencilOp,I=tr.TILE_MASK|tr.SKIP_LOD_MASK,L=0,T=w.materials;L<T.length;L++){var B=T[L];B.stencilWrite=!0,B.stencilRef=C,B.stencilFunc=R,B.stencilFuncMask=k,B.stencilZPass=M,B.stencilWriteMask=I}}else for(var D=0,V=w.materials;D<V.length;D++){var B=V[D];B.stencilWrite=!1,B.stencilRef=tr.TILE_MASK,B.stencilFunc=f.AlwaysStencilFunc,B.stencilFuncMask=tr.TILE_MASK,B.stencilZPass=f.ReplaceStencilOp,B.stencilWriteMask=tr.TILE_MASK}this.tileObjects.push(w)}}this.tileset.skipLevelOfDetail&&this.backfaceObjects.length&&(i=this.renderObjects).push.apply(i,this.backfaceObjects),this.tileObjects.length&&(a=this.renderObjects).push.apply(a,this.tileObjects),this.tileset.skipLevelOfDetail&&this.renderObjects.push(this.clearStencilObject);for(var N=0,U=this.tileset.selectedTrajectories;N<U.length;N++){var H=U[N],G=(c=H.content.data)===null||c===void 0?void 0:c.object;G&&(G.update(e,r,this.model),this.renderObjects.push(G))}this.debug&&(o=this.renderObjects).push.apply(o,this.debugObjects);for(var j=this.modelIndex*1e4,J=function($){var Y=X.renderObjects[$],ne=$+j;Y.traverse(function(te){(te instanceof f.Mesh||te instanceof f.Line||te instanceof f.Points)&&(te.renderOrder=ne)}),X.add(Y)},X=this,Z=0;Z<this.renderObjects.length;Z++)J(Z);var W=this.getRenderHash();this.lastRenderHash!==W&&(this.needsRender=!0,this.lastRenderHash=W)},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=Cr.DEFAULT_MAX_SCREEN_SPACE_ERROR,t.DEFAULT_SKIP_LEVEL_OF_DETAIL=Cr.DEFAULT_SKIP_LEVEL_OF_DETAIL,t.DEFAULT_MOST_DETAIL=Cr.DEFAULT_MOST_DETAIL,t.DEFAULT_LOAD_SIBLINGS=Cr.DEFAULT_LOAD_SIBLINGS,t.DEFAULT_LOAD_ALL=Cr.DEFAULT_LOAD_ALL,t.DEFAULT_MAX_REQUESTS=Cr.DEFAULT_MAX_REQUESTS,t.DEFAULT_REQUEST_ORDER=Cr.DEFAULT_REQUEST_ORDER,t}(f.Object3D);function nv(n){return-((n-.25)*360+90)/180*Math.PI}function mo(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(!mo(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(!mo(n[a],t[a]))return!1}return!0}return n!==n&&t!==t}function Yt(n){return typeof n=="number"}var t0=function(){return new Error("Invalid input.")},r0=function(){return new Error("Invalid certificate.")},n0=function(){return new Error("Invalid signature.")},iv=function(n){return new Error("date(".concat(n.toString(),") expired."))},av=function(n){return new Error("host(".concat(JSON.stringify(n),") is not allowed."))};function ov(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 jn(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+=jn(n[a],!1)+",";return i>-1&&(r+=jn(n[a],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return jn(n.toJSON(),t);for(var o=Object.keys(n).sort(),s=o.length,r="",a=0;a<s;){var u=o[a],l=jn(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 sv(n){return String(jn(n,!1))}function ml(n){var t,e,r;if(Array.isArray(n)){var i=void 0,a,o;if(n.length<=0)return t0();for(var s=function(w){var E=ml(n[w]);if(E instanceof Error)return{value:E};if(!i)i=E.issuer;else if(i!==E.issuer)return{value:r0()};a?E.expire.getTime()<a.getTime()&&(a=E.expire):a=E.expire,o?o=o.filter(function(S){return E.allowHosts.indexOf(S)!==-1}):o=E.allowHosts},u=0;u<n.length;u++){var l=s(u);if(typeof l=="object")return l.value}return Pn({issuer:i,expire:a,allowHosts:o})}var c=JSON.parse(n),d=typeof location!="undefined"?location.hostname:"",v=Date.now();if(typeof c!="object")return t0();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||mn(d)||vr.filter(function(w){return Yr(w,d)}).length>0){var p=String((t=c.certificate)!==null&&t!==void 0?t:"");if(p){var g=new Ge;return g.readCertPEM(p),Pn({issuer:g.getSubjectString(),expire:A,allowHosts:h})}return Pn({issuer:"none",expire:A,allowHosts:h})}var m=String((e=c.certificate)!==null&&e!==void 0?e:"");if(!m)return r0();var y=new Ge;y.readCertPEM(m);var b=String((r=c._signature)!==null&&r!==void 0?r:"");if(!b)return n0();var x=sv(ov(c,["_signature"]));return sf(x,b,y)===!1?n0():v<A.getTime()?h.filter(function(w){return Yr(w,d)}).length===0?av(d):Pn({issuer:y.getSubjectString(),expire:A,allowHosts:h}):iv(A)}var i0=new f.Matrix4,Qo=new WeakMap,Hn=new Set,Uo=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)}}}var i=lv(t,e,this);if(i instanceof Error)throw new Error("[PARSE FAILED]: "+i.message+`
1033
1033
  Error work input:
1034
- `+JSON.stringify(t))}return n.prototype.toJSON=function(){return this.raw},n.parse=ri,n}();function a0(n){return n==null?"null":Array.isArray(n)?"array":typeof n=="object"?"dict":"value"}function Ao(n,t){var e=a0(n),r=a0(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]=Ao(n[i],t[i]);else if(r==="dict")for(var a in t)n[a]=Ao(n[a],t[a]);return n}function Ho(n,t){return n.indexOf(t)===0}function qo(n,t,e,r){var i,a=t;if(r.jsonp===!0){a=t.replace(/([\?\#].*)?$/i,"");var o=ds("".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=nt(n,ds(u))+(l?"."+l:"")}var c=a.replace(n,"");return r.baseURL&&(a=nt(r.baseURL,c)),r.traverseResource&&r.traverseResource({origin:t,absolute:a,relative:c,type:e}),a}function rt(n,t,e,r,i){var a=e;return Br(e)||(t&&(t=nt(t,String(r))),a=nt(t,a)),Br(a)||(a=nt(n,a)),Ho(a,n)||console.warn("".concat(a," is not start with base_url(").concat(n,").")),qo(n,a,"panorama",i)}function qn(n,t,e){var r=t;return Br(r)||(r=nt(n,t)),Ho(r,n)||console.warn("".concat(r," is not start with base_url(").concat(n,").")),qo(n,r,"model",e)}function Ri(n,t,e,r){var i=t;return Br(i)||(i=nt(e,i)),Br(i)||(i=nt(n,i)),Ho(i,n)||console.warn("".concat(i," is not start with base_url(").concat(n,").")),qo(n,i,"texture",r)}var o0=function(n){for(var t=10;t>=0;t--){var e=512*Math.pow(2,t);if(e<=n)return t}return null},uv=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 lv(n,t,e){for(var r,i,a,o,s,u,l,c,d,v,A,h,p,g,m,y,b,x,w,E=JSON.stringify(t),S=[],C=0,R=[].concat(n);C<R.length;C++){var k=R[C];k instanceof Uo?S.push.apply(S,k.raw.works):typeof k=="string"?S.push(k):S.push(JSON.stringify(k))}var M=ml(S);if(M instanceof Error)return M;Array.isArray(t.transform)?e.transform.fromArray(t.transform):t.transform&&e.transform.copy(t.transform),n=S.map(function(re){return JSON.parse(re)}).reduce(function(re,oe){return Ao(re,oe)}),Object.defineProperty(e,"raw",{configurable:!1,get:function(){return{works:S,options:E}}});{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(M instanceof Error)return M;Object.defineProperty(e,"issuer",{configurable:!1,get:function(){return M.issuer}}),Object.defineProperty(e,"expire",{configurable:!1,get:function(){return M.expire}}),Object.defineProperty(e,"allowHosts",{configurable:!1,get:function(){return M.allowHosts}});var T=(r=n.base_url)!==null&&r!==void 0?r:"";if(T&&T[T.length-1]!=="/"&&(T+="/"),M instanceof Error)return M;if(n.model){var B={work:e,layers:[]},D;n.model.file?D=qn(T,n.model.file,t):n.model.file_url&&(D=qn(T,n.model.file_url,t)),Object.defineProperty(B,"file",{configurable:!1,get:function(){return D}});var V;n.model.textureBase?V=Ri(T,"",n.model.textureBase,t):n.model.material_base_url?V=Ri(T,"",n.model.material_base_url,t):B.file&&(V=B.file.split("/").slice(0,-1).join("/").replace("/model/","/materials/")),Object.defineProperty(B,"textureBase",{configurable:!1,get:function(){return V}});var N;Array.isArray(n.model.textures)?(N=n.model.textures.map(function(re){var oe,q;return Ri(T,re,(q=(oe=n.model.textureBase)!==null&&oe!==void 0?oe:n.model.material_base_url)!==null&&q!==void 0?q:"",t)}),Object.freeze(N)):Array.isArray(n.model.material_textures)&&(N=n.model.material_textures.map(function(re){var oe,q;return Ri(T,re,(q=(oe=n.model.textureBase)!==null&&oe!==void 0?oe:n.model.material_base_url)!==null&&q!==void 0?q:"",t)}),Object.freeze(N)),Object.defineProperty(B,"textures",{configurable:!1,get:function(){return N}});var U=[];if(Array.isArray(n.model.tiles))for(var H=0,G=n.model.tiles;H<G.length;H++){var j=G[H];j&&(j.tileset||j.tileset_url)&&U.push(Object.freeze({type:(i=j.type)!==null&&i!==void 0?i:"mesh",name:(a=j.name)!==null&&a!==void 0?a:"",upAxis:(s=(o=j.upAxis)!==null&&o!==void 0?o:j.up_axis)!==null&&s!==void 0?s:"-Y",tileset:qn(T,j.tileset||j.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:qn(T,n.model.tiles.tileset||n.model.tiles.tileset_url,t)}));if(Array.isArray(n.model.layers))for(var _=0,X=n.model.layers;_<X.length;_++){var Z=X[_];Z&&(Z.tileset||Z.tileset_url)&&U.push(Object.freeze({type:(v=Z.type)!==null&&v!==void 0?v:"mesh",name:(A=Z.name)!==null&&A!==void 0?A:"",upAxis:(h=Z.upAxis)!==null&&h!==void 0?h:Z.up_axis,tileset:qn(T,Z.tileset||Z.tileset_url,t)}))}Object.freeze(U),Object.defineProperty(B,"layers",{configurable:!1,get:function(){return U}}),Object.defineProperty(e,"model",{configurable:!1,get:function(){if(B.file||B.layers.length)return B}})}if(M instanceof Error)return M;var W=new Set,$=new Set;{var Y=[];if(n.observers&&Array.isArray(n.observers)){var ne=[];n.panorama&&(Array.isArray(n.panorama)?ne=n.panorama:Array.isArray(n.panorama.list)?ne=n.panorama.list:Array.isArray(n.panorama.info)&&(ne=n.panorama.info));for(var te=function(re){var oe={},q=n.observers[re];if(!q)return"break";var De=ne[re];if(!De)return"break";q=Object.assign({},q,De,{active:q.active!==!1&&De.active!==!1}),Object.defineProperty(oe,"work",{configurable:!1,get:function(){return e}}),Object.defineProperty(oe,"index",{configurable:!1,get:function(){return re}}),$.add(re),Object.defineProperty(oe,"panoIndex",{configurable:!1,get:function(){return re}});var Fe=ze({workCode:e.workCode,panoIndex:re});W.add(Fe),Object.defineProperty(oe,"panoId",{configurable:!1,get:function(){return Fe}});var Ie=Object.freeze({workCode:e.workCode,panoIndex:re});Object.defineProperty(oe,"pano",{configurable:!1,get:function(){return Ie}});var Ke=q.active!==!1;Object.defineProperty(oe,"active",{configurable:!1,get:function(){return Ke}});var xe=q.loadable===!0;Object.defineProperty(oe,"loadable",{configurable:!1,get:function(){return xe}});var ve=q.derived_id;Object.defineProperty(oe,"derivedId",{configurable:!1,get:function(){return ve}});var we=q.derived_id_str;Object.defineProperty(oe,"derivedIdStr",{configurable:!1,get:function(){return we}});var be=(x=(y=(g=(p=n.panorama)===null||p===void 0?void 0:p.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:rt(T,be,q.images?q.images.up:q.up,re,t),down:rt(T,be,q.images?q.images.down:q.down,re,t),right:rt(T,be,q.images?q.images.right:q.right,re,t),left:rt(T,be,q.images?q.images.left:q.left,re,t),front:rt(T,be,q.images?q.images.front:q.front,re,t),back:rt(T,be,q.images?q.images.back:q.back,re,t)};if(q.size_list)me.sizeList=q.size_list.slice();else{var Ue=ai(me.up);if(Ue&&(me.sizeList=[Ue],q.tiles))for(var je=q.tiles.slice().sort(function(qe,at){return qe-at}).map(function(qe){return 512*Math.pow(2,qe)}),it=0,tn=je;it<tn.length;it++){var Le=tn[it];Le>Ue&&me.sizeList.push(Le)}}var Ye=q.images?q.images.luminance:q.luminance;Ye&&(me.luminance=Object.freeze({up:rt(T,be,Ye.up,re,t),down:rt(T,be,Ye.down,re,t),right:rt(T,be,Ye.right,re,t),left:rt(T,be,Ye.left,re,t),front:rt(T,be,Ye.front,re,t),back:rt(T,be,Ye.back,re,t)}));var lt=void 0;if(q.images)lt=q.images.tiles;else if(Array.isArray(q.size_list)){var or=q.size_list.slice().sort(function(qe,at){return qe-at});if(or[0]){var gn=o0(or[0]);if(gn)for(var sr=gn-1;sr>=0;sr--)or.unshift(512*Math.pow(2,sr));lt=or}}else Array.isArray(q.tiles)&&(lt=q.tiles.slice(),typeof lt[0]=="number"&&(lt=lt.sort(function(qe,at){return qe-at}).map(function(qe){return 512*Math.pow(2,qe)})));if(lt){for(var Bt=[],ur=0,Fr=lt;ur<Fr.length;ur++){var Le=Fr[ur];if(typeof Le=="number"){var Kt=o0(Le);if(typeof Kt!="number")continue;var lr=ai(me.front);if(!lr)continue;if(Le>lr){var jt=Vt(me.up,Le),pt=Vt(me.down,Le),ke=Vt(me.right,Le),yr=Vt(me.left,Le),bt=Vt(me.front,Le),br=Vt(me.back,Le);Bt.push(Object.freeze({level:Kt,size:Le,scale:1,up:jt,down:pt,right:ke,left:yr,front:bt,back:br}))}else{var jt=me.up,pt=me.down,ke=me.right,yr=me.left,bt=me.front,br=me.back;Bt.push(Object.freeze({level:Kt,size:lr,scale:Le/lr,up:jt,down:pt,right:ke,left:yr,front:bt,back:br}))}}else{var Kt=Le.level;if(typeof Kt!="number")continue;var Ue=Le.size;if(typeof Ue!="number")continue;var jt=rt(T,be,Le.up,re,t),pt=rt(T,be,Le.down,re,t),ke=rt(T,be,Le.right,re,t),yr=rt(T,be,Le.left,re,t),bt=rt(T,be,Le.front,re,t),br=rt(T,be,Le.back,re,t);Bt.push(Object.freeze({level:Kt,size:Ue,scale:(w=Le.scale)!==null&&w!==void 0?w:1,up:jt,down:pt,right:ke,left:yr,front:bt,back:br}))}}Bt=uv(Bt),Object.freeze(Bt),Object.defineProperty(me,"tiles",{configurable:!1,get:function(){return Bt}})}Object.freeze(me),Object.defineProperty(oe,"images",{configurable:!1,get:function(){return me}});var xr=new f.Vector3;if(q.position instanceof f.Vector3)xr.copy(q.position);else if(Array.isArray(q.position))xr.fromArray(q.position);else return"break";Object.freeze(xr),Object.defineProperty(oe,"position",{configurable:!1,get:function(){return xr}});var _t=new f.Vector3;if(q.standingPosition instanceof f.Vector3)_t.copy(q.standingPosition);else if(Array.isArray(q.standingPosition))_t.fromArray(q.standingPosition);else if(q.standing_position instanceof f.Vector3)_t.copy(q.standing_position);else if(Array.isArray(q.standing_position))_t.fromArray(q.standing_position);else return"break";Object.freeze(_t),Object.defineProperty(oe,"standingPosition",{configurable:!1,get:function(){return _t}});var It=new f.Quaternion;if(q.quaternion instanceof f.Quaternion)It.copy(q.quaternion);else if(Array.isArray(q.quaternion))It.fromArray(q.quaternion);else if(q.quaternion){var wr=q.quaternion,Lr=wr.x,yn=wr.y,rn=wr.z,nn=wr.w;It.set(Lr,yn,rn,nn)}else return"break";Object.freeze(It),Object.defineProperty(oe,"quaternion",{configurable:!1,get:function(){return It}});var Jt=0;Yt(q.floorIndex)?Jt=q.floorIndex:Yt(q.floor_index)?Jt=q.floor_index:Yt(q.floor)&&(Jt=q.floor),Object.defineProperty(oe,"floorIndex",{configurable:!1,get:function(){return Jt}});var $e;q.video&&($e={},typeof q.video.source=="string"&&($e.source=q.video.source),q.video.matrix instanceof f.Matrix4?$e.matrix=q.video.matrix.clone():Array.isArray(q.video.matrix)&&($e.matrix=new f.Matrix4().fromArray(q.video.matrix)),q.video.size instanceof f.Vector2?$e.size=q.video.size.clone():Array.isArray(q.video.size)&&($e.size=new f.Vector2().fromArray(q.video.size)),$e.source&&$e.matrix&&$e.size&&(oe.video=$e)),Object.freeze($e),Object.defineProperty(oe,"video",{configurable:!1,get:function(){return $e}}),Array.isArray(q.accessibleNodes)?(oe.accessibleNodes=q.accessibleNodes.slice(),oe.accessibleIds=q.accessibleNodes.map(function(qe){return ze({workCode:e.workCode,panoIndex:qe})})):Array.isArray(q.accessible_nodes)&&(oe.accessibleNodes=q.accessible_nodes.slice(),oe.accessibleIds=q.accessible_nodes.map(function(qe){return ze({workCode:e.workCode,panoIndex:qe})})),Array.isArray(q.visibleNodes)?(oe.visibleNodes=q.visibleNodes.slice(),oe.visibleIds=q.visibleNodes.map(function(qe){return ze({workCode:e.workCode,panoIndex:qe})})):Array.isArray(q.visible_nodes)&&(oe.visibleNodes=q.visible_nodes.slice(),oe.visibleIds=q.visible_nodes.map(function(qe){return ze({workCode:e.workCode,panoIndex:qe})})),Y[re]=oe},ue=0;ue<n.observers.length;ue++){var ie=te(ue);if(ie==="break")break}}for(var ge=function(re){if(re.accessibleIds){var De=re.accessibleIds.filter(function(be){return W.has(be)});Object.freeze(De),Object.defineProperty(re,"accessibleIds",{configurable:!1,get:function(){return De}})}else{for(var oe=[],q=0;q<Y.length;q++)Y[q]!==re&&(Math.abs(Y[q].position.y-re.position.y)>3||Y[q].position.distanceTo(re.position)>10||oe.push(Y[q].panoId));Object.freeze(oe),Object.defineProperty(re,"accessibleIds",{configurable:!1,get:function(){return oe}})}if(re.accessibleNodes){var Ie=re.accessibleNodes.filter(function(be){return $.has(be)});Object.freeze(Ie),Object.defineProperty(re,"accessibleNodes",{configurable:!1,get:function(){return Ie}})}else{for(var Fe=[],q=0;q<Y.length;q++)Y[q]!==re&&(Math.abs(Y[q].position.y-re.position.y)>3||Y[q].position.distanceTo(re.position)>10||Fe.push(Y[q].panoIndex));Object.freeze(Fe),Object.defineProperty(re,"accessibleNodes",{configurable:!1,get:function(){return Fe}})}if(re.visibleIds){var xe=re.visibleIds.filter(function(be){return W.has(be)});Object.freeze(xe),Object.defineProperty(re,"visibleIds",{configurable:!1,get:function(){return xe}})}else{var Ke=re.accessibleIds.slice();Object.freeze(Ke),Object.defineProperty(re,"visibleIds",{configurable:!1,get:function(){return Ke}})}if(re.visibleNodes){var we=re.visibleNodes.filter(function(be){return $.has(be)});Object.freeze(we),Object.defineProperty(re,"visibleNodes",{configurable:!1,get:function(){return we}})}else{var ve=re.accessibleNodes.slice();Object.freeze(ve),Object.defineProperty(re,"visibleNodes",{configurable:!1,get:function(){return ve}})}},pe=0,ye=Y;pe<ye.length;pe++){var Be=ye[pe];ge(Be)}Object.freeze(Y),Object.defineProperty(e,"observers",{configurable:!1,get:function(){return Y}})}if(M instanceof Error)return M;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),Yt(n.initial.latitude)&&(e.initial.latitude=n.initial.latitude),Yt(n.initial.longitude)?e.initial.longitude=n.initial.longitude:Yt(n.initial.heading)&&(e.initial.longitude=nv(n.initial.heading)),Yt(n.initial.fov)&&(e.initial.fov=n.initial.fov),e.observers.length>0){var Se=void 0;Yt(n.initial.panoIndex)?Se=n.initial.panoIndex:Yt(n.initial.pano_index)?Se=n.initial.pano_index:Yt(n.initial.pano)&&(Se=n.initial.pano),typeof Se=="number"&&(Se=de(Se,0,e.observers.length-1),e.initial.panoIndex=Se)}if(Yt(n.initial.distance)&&(e.initial.distance=n.initial.distance),Array.isArray(n.initial.offset)){var Te=[0,0,0].map(function(re,oe){var q=Number(n.initial.offset[oe]);return isNaN(q)||!isFinite(q)?0:q});e.initial.offset=new f.Vector3().fromArray(Te)}!e.initial.mode&&typeof e.initial.panoIndex=="number"&&(e.initial.mode="Panorama")}return M instanceof Error?M:(Qo.set(e,{works:S,options:E}),e)}function ri(n,t){typeof n=="string"&&n.trim()[0]==="{"&&(n=JSON.parse(n));var e=Qo.get(n);if(e){if(t&&!mo(JSON.parse(e.options),t))throw new Error("[PARSE FAILED]: work is parsed with different options.");return n}else try{return new Uo(n,t!=null?t:{})}catch(r){throw new Error("[PARSE FAILED]: "+r.message+`
1034
+ `+JSON.stringify(t))}return n.prototype.toJSON=function(){return this.raw},n.parse=ri,n}();function a0(n){return n==null?"null":Array.isArray(n)?"array":typeof n=="object"?"dict":"value"}function Ao(n,t){var e=a0(n),r=a0(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]=Ao(n[i],t[i]);else if(r==="dict")for(var a in t)n[a]=Ao(n[a],t[a]);return n}function Ho(n,t){return n.indexOf(t)===0}function qo(n,t,e,r){var i,a=t;if(r.jsonp===!0){a=t.replace(/([\?\#].*)?$/i,"");var o=ds("".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=nt(n,ds(u))+(l?"."+l:"")}var c=a.replace(n,"");return r.baseURL&&(a=nt(r.baseURL,c)),r.traverseResource&&r.traverseResource({origin:t,absolute:a,relative:c,type:e}),a}function rt(n,t,e,r,i){var a=e;return Br(e)||(t&&(t=nt(t,String(r))),a=nt(t,a)),Br(a)||(a=nt(n,a)),Ho(a,n)||console.warn("".concat(a," is not start with base_url(").concat(n,").")),qo(n,a,"panorama",i)}function qn(n,t,e){var r=t;return Br(r)||(r=nt(n,t)),Ho(r,n)||console.warn("".concat(r," is not start with base_url(").concat(n,").")),qo(n,r,"model",e)}function Ri(n,t,e,r){var i=t;return Br(i)||(i=nt(e,i)),Br(i)||(i=nt(n,i)),Ho(i,n)||console.warn("".concat(i," is not start with base_url(").concat(n,").")),qo(n,i,"texture",r)}var o0=function(n){for(var t=10;t>=0;t--){var e=512*Math.pow(2,t);if(e<=n)return t}return null},uv=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 lv(n,t,e){for(var r,i,a,o,s,u,l,c,d,v,A,h,p,g,m,y,b,x,w,E=JSON.stringify(t),S=[],C=0,R=[].concat(n);C<R.length;C++){var k=R[C];k instanceof Uo?S.push.apply(S,k.raw.works):typeof k=="string"?S.push(k):S.push(JSON.stringify(k))}var M=ml(S);if(M instanceof Error)return M;Array.isArray(t.transform)?e.transform.fromArray(t.transform):t.transform&&e.transform.copy(t.transform),n=S.map(function(re){return JSON.parse(re)}).reduce(function(re,oe){return Ao(re,oe)}),Object.defineProperty(e,"raw",{configurable:!1,get:function(){return{works:S,options:E}}});{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(M instanceof Error)return M;Object.defineProperty(e,"issuer",{configurable:!1,get:function(){return M.issuer}}),Object.defineProperty(e,"expire",{configurable:!1,get:function(){return M.expire}}),Object.defineProperty(e,"allowHosts",{configurable:!1,get:function(){return M.allowHosts}});var T=(r=n.base_url)!==null&&r!==void 0?r:"";if(T&&T[T.length-1]!=="/"&&(T+="/"),M instanceof Error)return M;if(n.model){var B={work:e,layers:[]},D;n.model.file?D=qn(T,n.model.file,t):n.model.file_url&&(D=qn(T,n.model.file_url,t)),Object.defineProperty(B,"file",{configurable:!1,get:function(){return D}});var V;n.model.textureBase?V=Ri(T,"",n.model.textureBase,t):n.model.material_base_url?V=Ri(T,"",n.model.material_base_url,t):B.file&&(V=B.file.split("/").slice(0,-1).join("/").replace("/model/","/materials/")),Object.defineProperty(B,"textureBase",{configurable:!1,get:function(){return V}});var N;Array.isArray(n.model.textures)?(N=n.model.textures.map(function(re){var oe,q;return Ri(T,re,(q=(oe=n.model.textureBase)!==null&&oe!==void 0?oe:n.model.material_base_url)!==null&&q!==void 0?q:"",t)}),Object.freeze(N)):Array.isArray(n.model.material_textures)&&(N=n.model.material_textures.map(function(re){var oe,q;return Ri(T,re,(q=(oe=n.model.textureBase)!==null&&oe!==void 0?oe:n.model.material_base_url)!==null&&q!==void 0?q:"",t)}),Object.freeze(N)),Object.defineProperty(B,"textures",{configurable:!1,get:function(){return N}});var U=[];if(Array.isArray(n.model.tiles))for(var H=0,G=n.model.tiles;H<G.length;H++){var j=G[H];j&&(j.tileset||j.tileset_url)&&U.push(Object.freeze({type:(i=j.type)!==null&&i!==void 0?i:"mesh",name:(a=j.name)!==null&&a!==void 0?a:"",upAxis:(s=(o=j.upAxis)!==null&&o!==void 0?o:j.up_axis)!==null&&s!==void 0?s:"-Y",tileset:qn(T,j.tileset||j.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:qn(T,n.model.tiles.tileset||n.model.tiles.tileset_url,t)}));if(Array.isArray(n.model.layers))for(var J=0,X=n.model.layers;J<X.length;J++){var Z=X[J];Z&&(Z.tileset||Z.tileset_url)&&U.push(Object.freeze({type:(v=Z.type)!==null&&v!==void 0?v:"mesh",name:(A=Z.name)!==null&&A!==void 0?A:"",upAxis:(h=Z.upAxis)!==null&&h!==void 0?h:Z.up_axis,tileset:qn(T,Z.tileset||Z.tileset_url,t)}))}Object.freeze(U),Object.defineProperty(B,"layers",{configurable:!1,get:function(){return U}}),Object.defineProperty(e,"model",{configurable:!1,get:function(){if(B.file||B.layers.length)return B}})}if(M instanceof Error)return M;var W=new Set,$=new Set;{var Y=[];if(n.observers&&Array.isArray(n.observers)){var ne=[];n.panorama&&(Array.isArray(n.panorama)?ne=n.panorama:Array.isArray(n.panorama.list)?ne=n.panorama.list:Array.isArray(n.panorama.info)&&(ne=n.panorama.info));for(var te=function(re){var oe={},q=n.observers[re];if(!q)return"break";var De=ne[re];if(!De)return"break";q=Object.assign({},q,De,{active:q.active!==!1&&De.active!==!1}),Object.defineProperty(oe,"work",{configurable:!1,get:function(){return e}}),Object.defineProperty(oe,"index",{configurable:!1,get:function(){return re}}),$.add(re),Object.defineProperty(oe,"panoIndex",{configurable:!1,get:function(){return re}});var Fe=ze({workCode:e.workCode,panoIndex:re});W.add(Fe),Object.defineProperty(oe,"panoId",{configurable:!1,get:function(){return Fe}});var Ie=Object.freeze({workCode:e.workCode,panoIndex:re});Object.defineProperty(oe,"pano",{configurable:!1,get:function(){return Ie}});var Ke=q.active!==!1;Object.defineProperty(oe,"active",{configurable:!1,get:function(){return Ke}});var xe=q.loadable===!0;Object.defineProperty(oe,"loadable",{configurable:!1,get:function(){return xe}});var ve=q.derived_id;Object.defineProperty(oe,"derivedId",{configurable:!1,get:function(){return ve}});var we=q.derived_id_str;Object.defineProperty(oe,"derivedIdStr",{configurable:!1,get:function(){return we}});var be=(x=(y=(g=(p=n.panorama)===null||p===void 0?void 0:p.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:rt(T,be,q.images?q.images.up:q.up,re,t),down:rt(T,be,q.images?q.images.down:q.down,re,t),right:rt(T,be,q.images?q.images.right:q.right,re,t),left:rt(T,be,q.images?q.images.left:q.left,re,t),front:rt(T,be,q.images?q.images.front:q.front,re,t),back:rt(T,be,q.images?q.images.back:q.back,re,t)};if(q.size_list)me.sizeList=q.size_list.slice();else{var Ue=ai(me.up);if(Ue&&(me.sizeList=[Ue],q.tiles))for(var je=q.tiles.slice().sort(function(qe,at){return qe-at}).map(function(qe){return 512*Math.pow(2,qe)}),it=0,tn=je;it<tn.length;it++){var Le=tn[it];Le>Ue&&me.sizeList.push(Le)}}var Ye=q.images?q.images.luminance:q.luminance;Ye&&(me.luminance=Object.freeze({up:rt(T,be,Ye.up,re,t),down:rt(T,be,Ye.down,re,t),right:rt(T,be,Ye.right,re,t),left:rt(T,be,Ye.left,re,t),front:rt(T,be,Ye.front,re,t),back:rt(T,be,Ye.back,re,t)}));var lt=void 0;if(q.images)lt=q.images.tiles;else if(Array.isArray(q.size_list)){var or=q.size_list.slice().sort(function(qe,at){return qe-at});if(or[0]){var gn=o0(or[0]);if(gn)for(var sr=gn-1;sr>=0;sr--)or.unshift(512*Math.pow(2,sr));lt=or}}else Array.isArray(q.tiles)&&(lt=q.tiles.slice(),typeof lt[0]=="number"&&(lt=lt.sort(function(qe,at){return qe-at}).map(function(qe){return 512*Math.pow(2,qe)})));if(lt){for(var Bt=[],ur=0,Fr=lt;ur<Fr.length;ur++){var Le=Fr[ur];if(typeof Le=="number"){var Kt=o0(Le);if(typeof Kt!="number")continue;var lr=ai(me.front);if(!lr)continue;if(Le>lr){var jt=Vt(me.up,Le),pt=Vt(me.down,Le),ke=Vt(me.right,Le),yr=Vt(me.left,Le),bt=Vt(me.front,Le),br=Vt(me.back,Le);Bt.push(Object.freeze({level:Kt,size:Le,scale:1,up:jt,down:pt,right:ke,left:yr,front:bt,back:br}))}else{var jt=me.up,pt=me.down,ke=me.right,yr=me.left,bt=me.front,br=me.back;Bt.push(Object.freeze({level:Kt,size:lr,scale:Le/lr,up:jt,down:pt,right:ke,left:yr,front:bt,back:br}))}}else{var Kt=Le.level;if(typeof Kt!="number")continue;var Ue=Le.size;if(typeof Ue!="number")continue;var jt=rt(T,be,Le.up,re,t),pt=rt(T,be,Le.down,re,t),ke=rt(T,be,Le.right,re,t),yr=rt(T,be,Le.left,re,t),bt=rt(T,be,Le.front,re,t),br=rt(T,be,Le.back,re,t);Bt.push(Object.freeze({level:Kt,size:Ue,scale:(w=Le.scale)!==null&&w!==void 0?w:1,up:jt,down:pt,right:ke,left:yr,front:bt,back:br}))}}Bt=uv(Bt),Object.freeze(Bt),Object.defineProperty(me,"tiles",{configurable:!1,get:function(){return Bt}})}Object.freeze(me),Object.defineProperty(oe,"images",{configurable:!1,get:function(){return me}});var xr=new f.Vector3;if(q.position instanceof f.Vector3)xr.copy(q.position);else if(Array.isArray(q.position))xr.fromArray(q.position);else return"break";Object.freeze(xr),Object.defineProperty(oe,"position",{configurable:!1,get:function(){return xr}});var Jt=new f.Vector3;if(q.standingPosition instanceof f.Vector3)Jt.copy(q.standingPosition);else if(Array.isArray(q.standingPosition))Jt.fromArray(q.standingPosition);else if(q.standing_position instanceof f.Vector3)Jt.copy(q.standing_position);else if(Array.isArray(q.standing_position))Jt.fromArray(q.standing_position);else return"break";Object.freeze(Jt),Object.defineProperty(oe,"standingPosition",{configurable:!1,get:function(){return Jt}});var It=new f.Quaternion;if(q.quaternion instanceof f.Quaternion)It.copy(q.quaternion);else if(Array.isArray(q.quaternion))It.fromArray(q.quaternion);else if(q.quaternion){var wr=q.quaternion,Lr=wr.x,yn=wr.y,rn=wr.z,nn=wr.w;It.set(Lr,yn,rn,nn)}else return"break";Object.freeze(It),Object.defineProperty(oe,"quaternion",{configurable:!1,get:function(){return It}});var _t=0;Yt(q.floorIndex)?_t=q.floorIndex:Yt(q.floor_index)?_t=q.floor_index:Yt(q.floor)&&(_t=q.floor),Object.defineProperty(oe,"floorIndex",{configurable:!1,get:function(){return _t}});var $e;q.video&&($e={},typeof q.video.source=="string"&&($e.source=q.video.source),q.video.matrix instanceof f.Matrix4?$e.matrix=q.video.matrix.clone():Array.isArray(q.video.matrix)&&($e.matrix=new f.Matrix4().fromArray(q.video.matrix)),q.video.size instanceof f.Vector2?$e.size=q.video.size.clone():Array.isArray(q.video.size)&&($e.size=new f.Vector2().fromArray(q.video.size)),$e.source&&$e.matrix&&$e.size&&(oe.video=$e)),Object.freeze($e),Object.defineProperty(oe,"video",{configurable:!1,get:function(){return $e}}),Array.isArray(q.accessibleNodes)?(oe.accessibleNodes=q.accessibleNodes.slice(),oe.accessibleIds=q.accessibleNodes.map(function(qe){return ze({workCode:e.workCode,panoIndex:qe})})):Array.isArray(q.accessible_nodes)&&(oe.accessibleNodes=q.accessible_nodes.slice(),oe.accessibleIds=q.accessible_nodes.map(function(qe){return ze({workCode:e.workCode,panoIndex:qe})})),Array.isArray(q.visibleNodes)?(oe.visibleNodes=q.visibleNodes.slice(),oe.visibleIds=q.visibleNodes.map(function(qe){return ze({workCode:e.workCode,panoIndex:qe})})):Array.isArray(q.visible_nodes)&&(oe.visibleNodes=q.visible_nodes.slice(),oe.visibleIds=q.visible_nodes.map(function(qe){return ze({workCode:e.workCode,panoIndex:qe})})),Y[re]=oe},ue=0;ue<n.observers.length;ue++){var ie=te(ue);if(ie==="break")break}}for(var ge=function(re){if(re.accessibleIds){var De=re.accessibleIds.filter(function(be){return W.has(be)});Object.freeze(De),Object.defineProperty(re,"accessibleIds",{configurable:!1,get:function(){return De}})}else{for(var oe=[],q=0;q<Y.length;q++)Y[q]!==re&&(Math.abs(Y[q].position.y-re.position.y)>3||Y[q].position.distanceTo(re.position)>10||oe.push(Y[q].panoId));Object.freeze(oe),Object.defineProperty(re,"accessibleIds",{configurable:!1,get:function(){return oe}})}if(re.accessibleNodes){var Ie=re.accessibleNodes.filter(function(be){return $.has(be)});Object.freeze(Ie),Object.defineProperty(re,"accessibleNodes",{configurable:!1,get:function(){return Ie}})}else{for(var Fe=[],q=0;q<Y.length;q++)Y[q]!==re&&(Math.abs(Y[q].position.y-re.position.y)>3||Y[q].position.distanceTo(re.position)>10||Fe.push(Y[q].panoIndex));Object.freeze(Fe),Object.defineProperty(re,"accessibleNodes",{configurable:!1,get:function(){return Fe}})}if(re.visibleIds){var xe=re.visibleIds.filter(function(be){return W.has(be)});Object.freeze(xe),Object.defineProperty(re,"visibleIds",{configurable:!1,get:function(){return xe}})}else{var Ke=re.accessibleIds.slice();Object.freeze(Ke),Object.defineProperty(re,"visibleIds",{configurable:!1,get:function(){return Ke}})}if(re.visibleNodes){var we=re.visibleNodes.filter(function(be){return $.has(be)});Object.freeze(we),Object.defineProperty(re,"visibleNodes",{configurable:!1,get:function(){return we}})}else{var ve=re.accessibleNodes.slice();Object.freeze(ve),Object.defineProperty(re,"visibleNodes",{configurable:!1,get:function(){return ve}})}},pe=0,ye=Y;pe<ye.length;pe++){var Be=ye[pe];ge(Be)}Object.freeze(Y),Object.defineProperty(e,"observers",{configurable:!1,get:function(){return Y}})}if(M instanceof Error)return M;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),Yt(n.initial.latitude)&&(e.initial.latitude=n.initial.latitude),Yt(n.initial.longitude)?e.initial.longitude=n.initial.longitude:Yt(n.initial.heading)&&(e.initial.longitude=nv(n.initial.heading)),Yt(n.initial.fov)&&(e.initial.fov=n.initial.fov),e.observers.length>0){var Se=void 0;Yt(n.initial.panoIndex)?Se=n.initial.panoIndex:Yt(n.initial.pano_index)?Se=n.initial.pano_index:Yt(n.initial.pano)&&(Se=n.initial.pano),typeof Se=="number"&&(Se=de(Se,0,e.observers.length-1),e.initial.panoIndex=Se)}if(Yt(n.initial.distance)&&(e.initial.distance=n.initial.distance),Array.isArray(n.initial.offset)){var Te=[0,0,0].map(function(re,oe){var q=Number(n.initial.offset[oe]);return isNaN(q)||!isFinite(q)?0:q});e.initial.offset=new f.Vector3().fromArray(Te)}!e.initial.mode&&typeof e.initial.panoIndex=="number"&&(e.initial.mode="Panorama")}return M instanceof Error?M:(Qo.set(e,{works:S,options:E}),e)}function ri(n,t){typeof n=="string"&&n.trim()[0]==="{"&&(n=JSON.parse(n));var e=Qo.get(n);if(e){if(t&&!mo(JSON.parse(e.options),t))throw new Error("[PARSE FAILED]: work is parsed with different options.");return n}else try{return new Uo(n,t!=null?t:{})}catch(r){throw new Error("[PARSE FAILED]: "+r.message+`
1035
1035
  Error work input:
1036
- `+JSON.stringify(n))}}function go(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(i0.makeRotationFromQuaternion(c.quaternion).premultiply(s))};Object.freeze(d),e.push(d),r[d.panoId]=d}}Object.freeze(e);for(var v=n.slice(),A={},h=0,p=v;h<p.length;h++){var o=p[h];A[o.workCode]=o}return Object.freeze(Object.assign(v,{get initial(){return v.length>0?v[0].initial:{work:{}}},get resolvedObservers(){return e},getWork:function(g){return A[g]},getResolvedObserver:function(g){var m,y;return ru(g)?r[g]:typeof g=="number"?r[ze({workCode:(y=(m=n[0])===null||m===void 0?void 0:m.workCode)!==null&&y!==void 0?y:"",panoIndex:g})]:r[ze(g)]},update:function(){for(var g=0,m=v;g<m.length;g++){var y=m[g],b=y.transform,x=t[y.workCode];x?x.equals(b)||(x.copy(b),Hn.add(y.workCode)):(t[y.workCode]=new f.Matrix4().copy(b),Hn.add(y.workCode))}if(Hn.size>0){for(var w=0,E=e;w<E.length;w++){var S=E[w];if(Hn.has(S.work.workCode)){var C=S.work.observers[S.index],R=S.work.transform;S.position.copy(C.position).applyMatrix4(R),S.standingPosition.copy(C.standingPosition).applyMatrix4(R),S.quaternion.setFromRotationMatrix(i0.makeRotationFromQuaternion(C.quaternion).premultiply(R))}}Hn.clear()}}}))}var Al=new Map;function st(n){var t=Al.get(n);if(t)return t;throw new Error("fetcher never registered.")}function cv(n,t){return Al.set(n,t)}var s0={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 v=new f.Vector3,A=new f.Vector3,h=new f.Vector3,p=new f.Vector2,g=new f.Vector2,m=new f.Vector2,y=new f.Vector3,b=new f.Vector3;function x(H,G,j){v.fromArray(i,H*3),A.fromArray(i,G*3),h.fromArray(i,j*3),p.fromArray(o,H*2),g.fromArray(o,G*2),m.fromArray(o,j*2);var _=A.x-v.x,X=h.x-v.x,Z=A.y-v.y,W=h.y-v.y,$=A.z-v.z,Y=h.z-v.z,ne=g.x-p.x,te=m.x-p.x,ue=g.y-p.y,ie=m.y-p.y,ge=1/(ne*ie-te*ue);y.set((ie*_-ue*X)*ge,(ie*Z-ue*W)*ge,(ie*$-ue*Y)*ge),b.set((ne*X-te*_)*ge,(ne*W-te*Z)*ge,(ne*Y-te*$)*ge),l[H].add(y),l[G].add(y),l[j].add(y),c[H].add(b),c[G].add(b),c[j].add(b)}var w=n.groups;w.length===0&&(w=[{start:0,count:r.length}]);for(var d=0,E=w.length;d<E;++d)for(var S=w[d],C=S.start,R=S.count,k=C,M=C+R;k<M;k+=3)x(r[k+0],r[k+1],r[k+2]);var I=new f.Vector3,L=new f.Vector3,T=new f.Vector3,B=new f.Vector3,D,V,N;function U(H){T.fromArray(a,H*3),B.copy(T),V=l[H],I.copy(V),I.sub(T.multiplyScalar(T.dot(V))).normalize(),L.crossVectors(B,V),N=L.dot(c[H]),D=N<0?-1:1,u[H*4]=I.x,u[H*4+1]=I.y,u[H*4+2]=I.z,u[H*4+3]=D}for(var d=0,E=w.length;d<E;++d)for(var S=w[d],C=S.start,R=S.count,k=C,M=C+R;k<M;k+=3)U(r[k+0]),U(r[k+1]),U(r[k+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 v;if(e)v=c.index.count;else if(c.attributes.position!==void 0)v=c.attributes.position.count;else return null;s.addGroup(u,v,l),u+=v}}if(e){for(var A=0,h=[],l=0;l<n.length;++l){for(var p=n[l].index,g=0;g<p.count;++g)h.push(p.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"],v=0,a=n.length;v<a;v++){var o=n[v],A=o.itemSize,h=o.count,p=new f.InterleavedBufferAttribute(s,A,u,o.normalized);l.push(p),u+=A;for(var g=0;g<h;g++)for(var m=0;m<A;m++)p[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"],v=0,A=s.length;v<A;v++){var h=s[v];u[h]=[];var p=n.morphAttributes[h];p&&(l[h]=new Array(p.length).fill().map(function(){return[]}))}for(var g=Math.log10(1/t),m=Math.pow(10,g),v=0;v<a;v++){for(var y=r?r.getX(v):v,b="",x=0,A=s.length;x<A;x++)for(var h=s[x],w=n.getAttribute(h),E=w.itemSize,S=0;S<E;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),p=n.morphAttributes[h],E=w.itemSize,C=u[h],R=l[h],S=0;S<E;S++){var k=d[S];if(C.push(w[k](y)),p)for(var M=0,I=p.length;M<I;M++)R[M].push(p[M][k](y))}e[b]=o,c.push(o),o++}}for(var L=n.clone(),v=0,A=s.length;v<A;v++){var h=s[v],T=n.getAttribute(h),B=new T.array.constructor(u[h]),w=new f.BufferAttribute(B,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],B=new D.array.constructor(l[h][x]),V=new f.BufferAttribute(B,D.itemSize,D.normalized);L.morphAttributes[h][x]=V}}return L.setIndex(c),L}};function yo(n){switch(n){case"Floorplan":return!0;case"Mapview":return!0;default:return!1}}function ui(n){switch(n){case"Panorama":return!0;case"VRPanorama":return!0;case"XRPanorama":return!0;case"Model":return!0;default:return!1}}var rr=new f.Vector3,Qa=new f.Sphere,Ua=new f.Matrix4,u0=new f.Matrix4,l0=new f.Box3,Qi=new f.Matrix4().fromArray([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),Ui=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]),gl=new f.Box3(new f.Vector3(-.5,-.5,-.5),new f.Vector3(.5,.5,.5));function c0(n,t,e){switch(n){case"Z":break;case"Y":e.copy(Ui);break;case"-Y":e.copy(Qi);break;case"WGS84":case"GCJ02":case"BD09":ev(t,e);break;default:e.identity();break}return e}function fv(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 Hi=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(){rr.setScalar(0);var t=this.scene.localToLla(rr),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 rr.copy(t),this.scene.worldToLla(rr),{latitude:rr.x,longitude:rr.y,altitude:rr.z}},n}(),bo=function(n){se(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({},Ae),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=iu(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 fn&&u.tileset.selectedTiles.forEach(function(l){var c,d,v;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(j){if(j instanceof f.Mesh){var _=Cd.get(j);if(_){Ua.copy(j.matrixWorld),u0.getInverse(Ua),Qa.copy(e).applyMatrix4(u0);var X=_.trianglesInSphere(Qa.center,Qa.radius),Z=new f.BufferGeometry;Z.setAttribute("position",new f.BufferAttribute(X,3)),Z.applyMatrix4(j.matrixWorld),Z=s0.mergeVertices(Z,.01),h.push(Z)}}}),h.length===0)return;for(var p=["a","b","c"],g=s0.mergeBufferGeometries(h,!1),m=g.getAttribute("position").array,y=((v=g.getIndex())===null||v===void 0?void 0:v.array)||[],b=[],x=[],w=0,E=m.length;w<E;w+=3){var S=new f.Vector3(m[w],m[w+1],m[w+2]);b.push(S)}for(var w=0,E=y.length;w<E;w+=3){var C=y[w],R=y[w+1],k=y[w+2],M=new f.Vector3().crossVectors(b[R].clone().sub(b[C]),b[k].clone().sub(b[C])).normalize();x.push({a:C,b:R,c:k,normal:M})}for(var I={},w=0,E=x.length;w<E;w++)for(var L=x[w],T=0;T<3;T++){var B=L[p[T]],D=L[p[(T+1)%3]],V=[Math.min(B,D),Math.max(B,D)],N=V[0]+"-"+V[1];I[N]===void 0?I[N]={index1:V[0],index2:V[1],face1:w}:I[N].face2=w}for(var N in I){var U=I[N];if(U.face2===void 0||x[U.face1].normal.dot(x[U.face2].normal)<=i){var H=b[U.index1],G=b[U.index2];a.push(new f.Line3(H,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 fn&&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 ar&&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,v=0,A=e.observers;v<A.length;v++){var h=A[v];d=Math.max(d,h.floorIndex)}this.floorLength=d+1;for(var p=!1,g=[],m=function(U){var H=U.tileset,G=U.upAxis,j=U.name,_=U.type;_==="mesh"&&(p=!0);var X=H.split("#"),Z=X[0],W=X[1],$=(o=(W||Z).split("?")[1])!==null&&o!==void 0?o:"",Y=st(e).ajax(H,{responseType:"text"}).then(function(ne){var te,ue,ie,ge=H?H.slice(0,H.lastIndexOf("/")+1):"",pe=Ni(JSON.parse(ne.body),ge),ye=pe.root,Be=pe.rootMeta,Se=Be===void 0?{}:Be;Se.upAxis&&Se.upAxis!==G&&(G=Se.upAxis),"lodVersion"in pe&&(G="-Y","floorInfo"in pe&&(pe.properties=pe.properties||{},pe.properties.floorInfo=pe.floorInfo.map(function(we){return{ground:-we.ground,height:we.height}}),delete pe.floorInfo),pe.asset.tilesetVersion=String(pe.lodVersion),delete pe.lodVersion);var Te=ye.boundingVolume?Vi(ye.boundingVolume):void 0;Te&&ye.transform&&Te.applyMatrix4(Ua.fromArray(ye.transform));var re=null,oe=new f.Matrix4,q=new f.Matrix4;Se.coordinate?(re=Se.coordinate.ground_height,oe.fromArray(Se.coordinate.pose_ecef_to_enu),q.fromArray(Se.coordinate.pose_enu_to_ecef)):(Te?Te.getCenter(rr):rr.setScalar(0),c0(G,rr,oe),q.getInverse(oe));var De=new f.Matrix4().copy(Qi),Fe=new f.Matrix4().copy(Ui),Ie=new f.Matrix4().premultiply(oe).premultiply(De),Ke=new f.Matrix4().getInverse(Ie);pe.root={refine:(te=ye.refine)!==null&&te!==void 0?te:"REPLACE",geometricError:ye.geometricError,transform:Ie.toArray(),boundingVolume:Te?Te.toJson():void 0,viewerRequestVolume:!((ue=r["3d-tiles"])===null||ue===void 0)&&ue.viewerRequestVolume?(ie=r["3d-tiles"])===null||ie===void 0?void 0:ie.viewerRequestVolume.toJson():void 0,children:[ye]};var xe=new fn(a,pe,{name:j,type:_,upAxis:G,url:H,referer:H,search:$,fetcher:st(e),groundHeight:re,coordinateTransform:{localToEnuMatrix:Fe,enuToLocalMatrix:De,enuToEcefMatrix:q,ecefToEnuMatrix:oe,localToEcefMatrix:Ke,ecefToLocalMatrix:Ie}});if(xe.matrix.copy(e.transform),xe.matrix.decompose(xe.position,xe.quaternion,xe.scale),xe.matrixWorldNeedsUpdate=!0,r["3d-tiles"]){var ve=r["3d-tiles"];typeof ve.debug!="undefined"&&(xe.debug=ve.debug),typeof ve.minLevelOfDetail!="undefined"&&(xe.minLevelOfDetail=ve.minLevelOfDetail),typeof ve.maxLevelOfDetail!="undefined"&&(xe.maxLevelOfDetail=ve.maxLevelOfDetail),typeof ve.skipLevelOfDetail!="undefined"&&(xe.skipLevelOfDetail=ve.skipLevelOfDetail),typeof ve.mostDetail!="undefined"&&(xe.mostDetail=ve.mostDetail),typeof ve.loadSiblings!="undefined"&&(xe.loadSiblings=ve.loadSiblings),typeof ve.loadAll!="undefined"&&(xe.loadAll=ve.loadAll),typeof ve.maxMemoryUsage!="undefined"&&(xe.maxMemoryUsage=ve.maxMemoryUsage),typeof ve.maxRequests!="undefined"&&(xe.maxRequests=ve.maxRequests),typeof ve.requestOrder!="undefined"&&(xe.requestOrder=ve.requestOrder),typeof ve.maxScreenSpaceError!="undefined"&&(xe.maxScreenSpaceError=ve.maxScreenSpaceError)}return new Hi(xe,null)});g.push(Y.catch(function(ne){a.onError(ne);var te=new f.Matrix4,ue=new f.Matrix4,ie=new f.Matrix4().copy(Qi),ge=new f.Matrix4().copy(Ui),pe=new f.Matrix4().premultiply(te).premultiply(ie),ye=new f.Matrix4().getInverse(pe),Be=H?H.slice(0,H.lastIndexOf("/")+1):"",Se=Ni({asset:{version:"0.0"},geometricError:0,root:{geometricError:0}},Be),Te=new fn(a,Se,{name:j,type:_,upAxis:G,url:H,referer:H,search:$,fetcher:st(e),groundHeight:null,coordinateTransform:{localToEnuMatrix:ge,enuToLocalMatrix:ie,enuToEcefMatrix:ue,ecefToEnuMatrix:te,localToEcefMatrix:ye,ecefToLocalMatrix:pe},onError:a.onError});return new Hi(Te,ne)}))},y=0,b=c.layers;y<b.length;y++){var x=b[y];m(x)}if(!p&&c.file){var w=c.file,E=c.textureBase,S=c.textures,C=fv(w)||"at3d",R=C==="dome"||C==="domez"?"Y":"Z",k=new f.Matrix4,M=new f.Matrix4,I=new f.Matrix4().copy(Qi),L=new f.Matrix4().copy(Ui);c0(R,rr.setScalar(0),k),M.getInverse(k);var T=new f.Matrix4().premultiply(k).premultiply(I),B=new f.Matrix4().getInverse(T),D=Ni({asset:{gltfUpAxis:"Z",version:"0.0"},geometricError:0,root:{refine:"REPLACE",geometricError:0,transform:T.toArray(),viewerRequestVolume:!((s=r["3d-tiles"])===null||s===void 0)&&s.viewerRequestVolume?(u=r["3d-tiles"])===null||u===void 0?void 0:u.viewerRequestVolume.toJson():void 0,content:{uri:w},extras:(i={},i[C]={textureBaseUri:E,textureArray:S,textureOptions:(l=r.textureOptions)!==null&&l!==void 0?l:{}},i)}},""),V=new fn(this,D,{name:"fallback",type:"mesh",upAxis:R,url:"",referer:w,fetcher:st(e),groundHeight:null,coordinateTransform:{localToEnuMatrix:L,enuToLocalMatrix:I,enuToEcefMatrix:M,ecefToEnuMatrix:k,localToEcefMatrix:B,ecefToLocalMatrix:T},onError:this.onError});V.matrix.copy(e.transform),V.matrix.decompose(V.position,V.quaternion,V.scale),V.matrixWorldNeedsUpdate=!0;var N=new Hi(V,null);g.push(Promise.resolve(N))}return Promise.all(g).then(function(U){for(var H,G=[],j=[],_=[],X=0,Z=U;X<Z.length;X++){var W=Z[X];if(a.viewLayers.push(W),a.disposed){W.scene.dispose();continue}switch(a.add(W.scene),W.scene.visible=!1,W.scene.type){case"mesh":G.push(W.scene);break;case"point_cloud":j.push(W.scene);break;default:_.push(W.scene);break}}G.length?G[0].visible=!0:j.length?j[0].visible=!0:_.length&&(_[0].visible=!0);var $=(H=r["3d-tiles"])===null||H===void 0?void 0:H.showLayers;if(typeof $=="boolean")for(var Y=0,ne=U;Y<ne.length;Y++){var W=ne[Y];W.scene&&(W.scene.visible=$)}else if(Array.isArray($))for(var te=0,ue=U;te<ue.length;te++){var W=ue[te];W.scene&&(W.scene.visible=$.indexOf(W.scene.name)!==-1)}})},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.idle=this.materialParameters.modelAlpha<=0,l.cacheCameras=this.cacheCameras,this.autoRefine===!1?l.needsRefined=!1:ui(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),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()||(l0.copy(l.boundingBox).applyMatrix4(l.matrix),this.bounding.union(l0)))}this.bounding.isEmpty()&&this.bounding.copy(gl),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 fn&&e.dispose(),this.remove(e)},t}(f.Object3D);function f0(){var n=new f.Box3,t=Oh(Ae,["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,v){return d.distance-v.distance})}return o},setMaterial:function(r){var i=iu(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 v=d[c],A=0,h=v.viewLayers;A<h.length;A++){var p=h[A];p.scene.modelIndex=l++}v.setMaterial(t),v.cacheCameras=e.cacheCameras,v.autoRefine=this.autoUpdate,v.update(r,i,a),v.needsRender===!0&&(e.needsRender=!0,v.needsRender=!1),v.refined===!1&&(e.refined=!1),e.refineProgress[0]+=v.refineProgress[0],e.refineProgress[1]+=v.refineProgress[1],v.loaded===!1&&(e.loaded=!1),n.union(v.bounding)}n.isEmpty()&&n.copy(gl)}});return e}var d0=function(n){return n*(2-n)},dv=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}(),hv=`
1036
+ `+JSON.stringify(n))}}function go(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(i0.makeRotationFromQuaternion(c.quaternion).premultiply(s))};Object.freeze(d),e.push(d),r[d.panoId]=d}}Object.freeze(e);for(var v=n.slice(),A={},h=0,p=v;h<p.length;h++){var o=p[h];A[o.workCode]=o}return Object.freeze(Object.assign(v,{get initial(){return v.length>0?v[0].initial:{work:{}}},get resolvedObservers(){return e},getWork:function(g){return A[g]},getResolvedObserver:function(g){var m,y;return ru(g)?r[g]:typeof g=="number"?r[ze({workCode:(y=(m=n[0])===null||m===void 0?void 0:m.workCode)!==null&&y!==void 0?y:"",panoIndex:g})]:r[ze(g)]},update:function(){for(var g=0,m=v;g<m.length;g++){var y=m[g],b=y.transform,x=t[y.workCode];x?x.equals(b)||(x.copy(b),Hn.add(y.workCode)):(t[y.workCode]=new f.Matrix4().copy(b),Hn.add(y.workCode))}if(Hn.size>0){for(var w=0,E=e;w<E.length;w++){var S=E[w];if(Hn.has(S.work.workCode)){var C=S.work.observers[S.index],R=S.work.transform;S.position.copy(C.position).applyMatrix4(R),S.standingPosition.copy(C.standingPosition).applyMatrix4(R),S.quaternion.setFromRotationMatrix(i0.makeRotationFromQuaternion(C.quaternion).premultiply(R))}}Hn.clear()}}}))}var Al=new Map;function st(n){var t=Al.get(n);if(t)return t;throw new Error("fetcher never registered.")}function cv(n,t){return Al.set(n,t)}var s0={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 v=new f.Vector3,A=new f.Vector3,h=new f.Vector3,p=new f.Vector2,g=new f.Vector2,m=new f.Vector2,y=new f.Vector3,b=new f.Vector3;function x(H,G,j){v.fromArray(i,H*3),A.fromArray(i,G*3),h.fromArray(i,j*3),p.fromArray(o,H*2),g.fromArray(o,G*2),m.fromArray(o,j*2);var J=A.x-v.x,X=h.x-v.x,Z=A.y-v.y,W=h.y-v.y,$=A.z-v.z,Y=h.z-v.z,ne=g.x-p.x,te=m.x-p.x,ue=g.y-p.y,ie=m.y-p.y,ge=1/(ne*ie-te*ue);y.set((ie*J-ue*X)*ge,(ie*Z-ue*W)*ge,(ie*$-ue*Y)*ge),b.set((ne*X-te*J)*ge,(ne*W-te*Z)*ge,(ne*Y-te*$)*ge),l[H].add(y),l[G].add(y),l[j].add(y),c[H].add(b),c[G].add(b),c[j].add(b)}var w=n.groups;w.length===0&&(w=[{start:0,count:r.length}]);for(var d=0,E=w.length;d<E;++d)for(var S=w[d],C=S.start,R=S.count,k=C,M=C+R;k<M;k+=3)x(r[k+0],r[k+1],r[k+2]);var I=new f.Vector3,L=new f.Vector3,T=new f.Vector3,B=new f.Vector3,D,V,N;function U(H){T.fromArray(a,H*3),B.copy(T),V=l[H],I.copy(V),I.sub(T.multiplyScalar(T.dot(V))).normalize(),L.crossVectors(B,V),N=L.dot(c[H]),D=N<0?-1:1,u[H*4]=I.x,u[H*4+1]=I.y,u[H*4+2]=I.z,u[H*4+3]=D}for(var d=0,E=w.length;d<E;++d)for(var S=w[d],C=S.start,R=S.count,k=C,M=C+R;k<M;k+=3)U(r[k+0]),U(r[k+1]),U(r[k+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 v;if(e)v=c.index.count;else if(c.attributes.position!==void 0)v=c.attributes.position.count;else return null;s.addGroup(u,v,l),u+=v}}if(e){for(var A=0,h=[],l=0;l<n.length;++l){for(var p=n[l].index,g=0;g<p.count;++g)h.push(p.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"],v=0,a=n.length;v<a;v++){var o=n[v],A=o.itemSize,h=o.count,p=new f.InterleavedBufferAttribute(s,A,u,o.normalized);l.push(p),u+=A;for(var g=0;g<h;g++)for(var m=0;m<A;m++)p[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"],v=0,A=s.length;v<A;v++){var h=s[v];u[h]=[];var p=n.morphAttributes[h];p&&(l[h]=new Array(p.length).fill().map(function(){return[]}))}for(var g=Math.log10(1/t),m=Math.pow(10,g),v=0;v<a;v++){for(var y=r?r.getX(v):v,b="",x=0,A=s.length;x<A;x++)for(var h=s[x],w=n.getAttribute(h),E=w.itemSize,S=0;S<E;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),p=n.morphAttributes[h],E=w.itemSize,C=u[h],R=l[h],S=0;S<E;S++){var k=d[S];if(C.push(w[k](y)),p)for(var M=0,I=p.length;M<I;M++)R[M].push(p[M][k](y))}e[b]=o,c.push(o),o++}}for(var L=n.clone(),v=0,A=s.length;v<A;v++){var h=s[v],T=n.getAttribute(h),B=new T.array.constructor(u[h]),w=new f.BufferAttribute(B,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],B=new D.array.constructor(l[h][x]),V=new f.BufferAttribute(B,D.itemSize,D.normalized);L.morphAttributes[h][x]=V}}return L.setIndex(c),L}};function yo(n){switch(n){case"Floorplan":return!0;case"Mapview":return!0;default:return!1}}function ui(n){switch(n){case"Panorama":return!0;case"VRPanorama":return!0;case"XRPanorama":return!0;case"Model":return!0;default:return!1}}var rr=new f.Vector3,Qa=new f.Sphere,Ua=new f.Matrix4,u0=new f.Matrix4,l0=new f.Box3,Qi=new f.Matrix4().fromArray([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),Ui=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]),gl=new f.Box3(new f.Vector3(-.5,-.5,-.5),new f.Vector3(.5,.5,.5));function c0(n,t,e){switch(n){case"Z":break;case"Y":e.copy(Ui);break;case"-Y":e.copy(Qi);break;case"WGS84":case"GCJ02":case"BD09":ev(t,e);break;default:e.identity();break}return e}function fv(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 Hi=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(){rr.setScalar(0);var t=this.scene.localToLla(rr),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 rr.copy(t),this.scene.worldToLla(rr),{latitude:rr.x,longitude:rr.y,altitude:rr.z}},n}(),bo=function(n){se(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({},Ae),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=iu(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 fn&&u.tileset.selectedTiles.forEach(function(l){var c,d,v;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(j){if(j instanceof f.Mesh){var J=Cd.get(j);if(J){Ua.copy(j.matrixWorld),u0.getInverse(Ua),Qa.copy(e).applyMatrix4(u0);var X=J.trianglesInSphere(Qa.center,Qa.radius),Z=new f.BufferGeometry;Z.setAttribute("position",new f.BufferAttribute(X,3)),Z.applyMatrix4(j.matrixWorld),Z=s0.mergeVertices(Z,.01),h.push(Z)}}}),h.length===0)return;for(var p=["a","b","c"],g=s0.mergeBufferGeometries(h,!1),m=g.getAttribute("position").array,y=((v=g.getIndex())===null||v===void 0?void 0:v.array)||[],b=[],x=[],w=0,E=m.length;w<E;w+=3){var S=new f.Vector3(m[w],m[w+1],m[w+2]);b.push(S)}for(var w=0,E=y.length;w<E;w+=3){var C=y[w],R=y[w+1],k=y[w+2],M=new f.Vector3().crossVectors(b[R].clone().sub(b[C]),b[k].clone().sub(b[C])).normalize();x.push({a:C,b:R,c:k,normal:M})}for(var I={},w=0,E=x.length;w<E;w++)for(var L=x[w],T=0;T<3;T++){var B=L[p[T]],D=L[p[(T+1)%3]],V=[Math.min(B,D),Math.max(B,D)],N=V[0]+"-"+V[1];I[N]===void 0?I[N]={index1:V[0],index2:V[1],face1:w}:I[N].face2=w}for(var N in I){var U=I[N];if(U.face2===void 0||x[U.face1].normal.dot(x[U.face2].normal)<=i){var H=b[U.index1],G=b[U.index2];a.push(new f.Line3(H,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 fn&&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 ar&&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,v=0,A=e.observers;v<A.length;v++){var h=A[v];d=Math.max(d,h.floorIndex)}this.floorLength=d+1;for(var p=!1,g=[],m=function(U){var H=U.tileset,G=U.upAxis,j=U.name,J=U.type;J==="mesh"&&(p=!0);var X=H.split("#"),Z=X[0],W=X[1],$=(o=(W||Z).split("?")[1])!==null&&o!==void 0?o:"",Y=st(e).ajax(H,{responseType:"text"}).then(function(ne){var te,ue,ie,ge=H?H.slice(0,H.lastIndexOf("/")+1):"",pe=Ni(JSON.parse(ne.body),ge),ye=pe.root,Be=pe.rootMeta,Se=Be===void 0?{}:Be;Se.upAxis&&Se.upAxis!==G&&(G=Se.upAxis),"lodVersion"in pe&&(G="-Y","floorInfo"in pe&&(pe.properties=pe.properties||{},pe.properties.floorInfo=pe.floorInfo.map(function(we){return{ground:-we.ground,height:we.height}}),delete pe.floorInfo),pe.asset.tilesetVersion=String(pe.lodVersion),delete pe.lodVersion);var Te=ye.boundingVolume?Vi(ye.boundingVolume):void 0;Te&&ye.transform&&Te.applyMatrix4(Ua.fromArray(ye.transform));var re=null,oe=new f.Matrix4,q=new f.Matrix4;Se.coordinate?(re=Se.coordinate.ground_height,oe.fromArray(Se.coordinate.pose_ecef_to_enu),q.fromArray(Se.coordinate.pose_enu_to_ecef)):(Te?Te.getCenter(rr):rr.setScalar(0),c0(G,rr,oe),q.getInverse(oe));var De=new f.Matrix4().copy(Qi),Fe=new f.Matrix4().copy(Ui),Ie=new f.Matrix4().premultiply(oe).premultiply(De),Ke=new f.Matrix4().getInverse(Ie);pe.root={refine:(te=ye.refine)!==null&&te!==void 0?te:"REPLACE",geometricError:ye.geometricError,transform:Ie.toArray(),boundingVolume:Te?Te.toJson():void 0,viewerRequestVolume:!((ue=r["3d-tiles"])===null||ue===void 0)&&ue.viewerRequestVolume?(ie=r["3d-tiles"])===null||ie===void 0?void 0:ie.viewerRequestVolume.toJson():void 0,children:[ye]};var xe=new fn(a,pe,{name:j,type:J,upAxis:G,url:H,referer:H,search:$,fetcher:st(e),groundHeight:re,coordinateTransform:{localToEnuMatrix:Fe,enuToLocalMatrix:De,enuToEcefMatrix:q,ecefToEnuMatrix:oe,localToEcefMatrix:Ke,ecefToLocalMatrix:Ie}});if(xe.matrix.copy(e.transform),xe.matrix.decompose(xe.position,xe.quaternion,xe.scale),xe.matrixWorldNeedsUpdate=!0,r["3d-tiles"]){var ve=r["3d-tiles"];typeof ve.debug!="undefined"&&(xe.debug=ve.debug),typeof ve.minLevelOfDetail!="undefined"&&(xe.minLevelOfDetail=ve.minLevelOfDetail),typeof ve.maxLevelOfDetail!="undefined"&&(xe.maxLevelOfDetail=ve.maxLevelOfDetail),typeof ve.skipLevelOfDetail!="undefined"&&(xe.skipLevelOfDetail=ve.skipLevelOfDetail),typeof ve.mostDetail!="undefined"&&(xe.mostDetail=ve.mostDetail),typeof ve.loadSiblings!="undefined"&&(xe.loadSiblings=ve.loadSiblings),typeof ve.loadAll!="undefined"&&(xe.loadAll=ve.loadAll),typeof ve.maxMemoryUsage!="undefined"&&(xe.maxMemoryUsage=ve.maxMemoryUsage),typeof ve.maxRequests!="undefined"&&(xe.maxRequests=ve.maxRequests),typeof ve.requestOrder!="undefined"&&(xe.requestOrder=ve.requestOrder),typeof ve.maxScreenSpaceError!="undefined"&&(xe.maxScreenSpaceError=ve.maxScreenSpaceError)}return new Hi(xe,null)});g.push(Y.catch(function(ne){a.onError(ne);var te=new f.Matrix4,ue=new f.Matrix4,ie=new f.Matrix4().copy(Qi),ge=new f.Matrix4().copy(Ui),pe=new f.Matrix4().premultiply(te).premultiply(ie),ye=new f.Matrix4().getInverse(pe),Be=H?H.slice(0,H.lastIndexOf("/")+1):"",Se=Ni({asset:{version:"0.0"},geometricError:0,root:{geometricError:0}},Be),Te=new fn(a,Se,{name:j,type:J,upAxis:G,url:H,referer:H,search:$,fetcher:st(e),groundHeight:null,coordinateTransform:{localToEnuMatrix:ge,enuToLocalMatrix:ie,enuToEcefMatrix:ue,ecefToEnuMatrix:te,localToEcefMatrix:ye,ecefToLocalMatrix:pe},onError:a.onError});return new Hi(Te,ne)}))},y=0,b=c.layers;y<b.length;y++){var x=b[y];m(x)}if(!p&&c.file){var w=c.file,E=c.textureBase,S=c.textures,C=fv(w)||"at3d",R=C==="dome"||C==="domez"?"Y":"Z",k=new f.Matrix4,M=new f.Matrix4,I=new f.Matrix4().copy(Qi),L=new f.Matrix4().copy(Ui);c0(R,rr.setScalar(0),k),M.getInverse(k);var T=new f.Matrix4().premultiply(k).premultiply(I),B=new f.Matrix4().getInverse(T),D=Ni({asset:{gltfUpAxis:"Z",version:"0.0"},geometricError:0,root:{refine:"REPLACE",geometricError:0,transform:T.toArray(),viewerRequestVolume:!((s=r["3d-tiles"])===null||s===void 0)&&s.viewerRequestVolume?(u=r["3d-tiles"])===null||u===void 0?void 0:u.viewerRequestVolume.toJson():void 0,content:{uri:w},extras:(i={},i[C]={textureBaseUri:E,textureArray:S,textureOptions:(l=r.textureOptions)!==null&&l!==void 0?l:{}},i)}},""),V=new fn(this,D,{name:"fallback",type:"mesh",upAxis:R,url:"",referer:w,fetcher:st(e),groundHeight:null,coordinateTransform:{localToEnuMatrix:L,enuToLocalMatrix:I,enuToEcefMatrix:M,ecefToEnuMatrix:k,localToEcefMatrix:B,ecefToLocalMatrix:T},onError:this.onError});V.matrix.copy(e.transform),V.matrix.decompose(V.position,V.quaternion,V.scale),V.matrixWorldNeedsUpdate=!0;var N=new Hi(V,null);g.push(Promise.resolve(N))}return Promise.all(g).then(function(U){for(var H,G=[],j=[],J=[],X=0,Z=U;X<Z.length;X++){var W=Z[X];if(a.viewLayers.push(W),a.disposed){W.scene.dispose();continue}switch(a.add(W.scene),W.scene.visible=!1,W.scene.type){case"mesh":G.push(W.scene);break;case"point_cloud":j.push(W.scene);break;default:J.push(W.scene);break}}G.length?G[0].visible=!0:j.length?j[0].visible=!0:J.length&&(J[0].visible=!0);var $=(H=r["3d-tiles"])===null||H===void 0?void 0:H.showLayers;if(typeof $=="boolean")for(var Y=0,ne=U;Y<ne.length;Y++){var W=ne[Y];W.scene&&(W.scene.visible=$)}else if(Array.isArray($))for(var te=0,ue=U;te<ue.length;te++){var W=ue[te];W.scene&&(W.scene.visible=$.indexOf(W.scene.name)!==-1)}})},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.idle=this.materialParameters.modelAlpha<=0,l.cacheCameras=this.cacheCameras,this.autoRefine===!1?l.needsRefined=!1:ui(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),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()||(l0.copy(l.boundingBox).applyMatrix4(l.matrix),this.bounding.union(l0)))}this.bounding.isEmpty()&&this.bounding.copy(gl),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 fn&&e.dispose(),this.remove(e)},t}(f.Object3D);function f0(){var n=new f.Box3,t=Oh(Ae,["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,v){return d.distance-v.distance})}return o},setMaterial:function(r){var i=iu(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 v=d[c],A=0,h=v.viewLayers;A<h.length;A++){var p=h[A];p.scene.modelIndex=l++}v.setMaterial(t),v.cacheCameras=e.cacheCameras,v.autoRefine=this.autoUpdate,v.update(r,i,a),v.needsRender===!0&&(e.needsRender=!0,v.needsRender=!1),v.refined===!1&&(e.refined=!1),e.refineProgress[0]+=v.refineProgress[0],e.refineProgress[1]+=v.refineProgress[1],v.loaded===!1&&(e.loaded=!1),n.union(v.bounding)}n.isEmpty()&&n.copy(gl)}});return e}var d0=function(n){return n*(2-n)},dv=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}(),hv=`
1037
1037
  varying vec2 vUv;
1038
1038
  #include <common>
1039
1039
  #include <logdepthbuf_pars_vertex>
@@ -1423,13 +1423,13 @@ void main() {
1423
1423
 
1424
1424
  gl_FragColor = vec4(gl_FragColor.rgb, gl_FragColor.a * outside * inside);
1425
1425
  }
1426
- `,Cv=new f.ShaderMaterial({vertexShader:Sv,fragmentShader:Mv,side:f.DoubleSide,blending:f.CustomBlending,blendSrc:f.SrcAlphaFactor,blendDst:f.OneMinusSrcAlphaFactor,blendSrcAlpha:f.OneFactor,blendDstAlpha:f.OneMinusSrcAlphaFactor,depthWrite:!1}),aa=function(n){se(t,n);function t(){var e=n.call(this)||this;return e.ringMesh=new f.Mesh(Ev,Cv),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 Kr(){return((1+Math.random())*65536|0).toString(16).substring(1)}function Mt(){return(Kr()+Kr()+"-"+Kr()+"-4"+Kr().substr(0,3)+"-"+Kr()+"-"+Kr()+Kr()+Kr()).toLowerCase()}function _n(n,t,e){var r=Math.abs(n-t);return r<.001||typeof e!="undefined"&&Math.abs(e-r)<.001}function Dt(n,t,e){return!_n(n,t,e)}function bi(n,t){return n.distanceTo(t)<.001}function qi(n,t){return!bi(n,t)}var bl=new f.Vector3(0,0,0),Iv=function(n){se(t,n);function t(e,r){r===void 0&&(r=bl);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 Ar("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}(Ct);function Tv(n,t){return t===void 0&&(t=bl),new Iv(n,t)}function Pv(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 Bi=Math.PI*2;function en(n){return n>=0&&n<Bi?n:(n%Bi+Bi)%Bi}var xo=Math.PI,v0=xo*2;function Ha(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 Rv(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 m0(n,t,e){if(n.longitude===t.longitude&&n.latitude===t.latitude)return{longitude:t.longitude,latitude:t.latitude};var r=en(n.longitude),i=n.latitude,a=en(t.longitude),o=t.latitude;a-r>xo?r+=v0:r-a>xo&&(r-=v0);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 Bv(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}var qa,ln=typeof navigator!="undefined"?((qa=navigator==null?void 0:navigator.userAgent)!==null&&qa!==void 0?qa:"").toLowerCase():"node";(function(){try{var n=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(n.getContext("webgl")||n.getContext("experimental-webgl")))}catch(t){return!1}})();var Jn=/android/i.test(ln)||/webos/i.test(ln)||/ipad|iphone|ipod/i.test(ln)||/iemobile/i.test(ln)||/opera mini/i.test(ln)||/blackberry/i.test(ln)||/windows phone/i.test(ln);function J(n,t){for(var e=!1,r={type:n,timeStamp:he(),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 Fv(){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 Lv(){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 hr(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 jr(n,t){return n.workCode===t.workCode&&n.mode===t.mode&&n.panoIndex===t.panoIndex&&_n(n.longitude,t.longitude,Math.PI*2)&&_n(n.latitude,t.latitude)&&_n(n.fov,t.fov)&&bi(n.offset,t.offset)&&_n(n.distance,t.distance)}var kv=function(n){return Number(n)};function mr(n,t,e){var r;t===void 0&&(t=kv),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 Gt(n){for(var t in n)return!1;return!0}function Je(n){return{longitude:n.longitude,latitude:n.latitude,fov:n.fov,offset:n.offset.clone(),distance:n.distance}}/*! Hammer.JS - v2.0.7 - 2016-04-22
1426
+ `,Cv=new f.ShaderMaterial({vertexShader:Sv,fragmentShader:Mv,side:f.DoubleSide,blending:f.CustomBlending,blendSrc:f.SrcAlphaFactor,blendDst:f.OneMinusSrcAlphaFactor,blendSrcAlpha:f.OneFactor,blendDstAlpha:f.OneMinusSrcAlphaFactor,depthWrite:!1}),aa=function(n){se(t,n);function t(){var e=n.call(this)||this;return e.ringMesh=new f.Mesh(Ev,Cv),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 Kr(){return((1+Math.random())*65536|0).toString(16).substring(1)}function Mt(){return(Kr()+Kr()+"-"+Kr()+"-4"+Kr().substr(0,3)+"-"+Kr()+"-"+Kr()+Kr()+Kr()).toLowerCase()}function Jn(n,t,e){var r=Math.abs(n-t);return r<.001||typeof e!="undefined"&&Math.abs(e-r)<.001}function Dt(n,t,e){return!Jn(n,t,e)}function bi(n,t){return n.distanceTo(t)<.001}function qi(n,t){return!bi(n,t)}var bl=new f.Vector3(0,0,0),Iv=function(n){se(t,n);function t(e,r){r===void 0&&(r=bl);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 Ar("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}(Ct);function Tv(n,t){return t===void 0&&(t=bl),new Iv(n,t)}function Pv(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 Bi=Math.PI*2;function en(n){return n>=0&&n<Bi?n:(n%Bi+Bi)%Bi}var xo=Math.PI,v0=xo*2;function Ha(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 Rv(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 m0(n,t,e){if(n.longitude===t.longitude&&n.latitude===t.latitude)return{longitude:t.longitude,latitude:t.latitude};var r=en(n.longitude),i=n.latitude,a=en(t.longitude),o=t.latitude;a-r>xo?r+=v0:r-a>xo&&(r-=v0);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 Bv(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}var qa,ln=typeof navigator!="undefined"?((qa=navigator==null?void 0:navigator.userAgent)!==null&&qa!==void 0?qa:"").toLowerCase():"node";(function(){try{var n=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(n.getContext("webgl")||n.getContext("experimental-webgl")))}catch(t){return!1}})();var _n=/android/i.test(ln)||/webos/i.test(ln)||/ipad|iphone|ipod/i.test(ln)||/iemobile/i.test(ln)||/opera mini/i.test(ln)||/blackberry/i.test(ln)||/windows phone/i.test(ln);function _(n,t){for(var e=!1,r={type:n,timeStamp:he(),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 Fv(){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 Lv(){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 hr(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 jr(n,t){return n.workCode===t.workCode&&n.mode===t.mode&&n.panoIndex===t.panoIndex&&Jn(n.longitude,t.longitude,Math.PI*2)&&Jn(n.latitude,t.latitude)&&Jn(n.fov,t.fov)&&bi(n.offset,t.offset)&&Jn(n.distance,t.distance)}var kv=function(n){return Number(n)};function mr(n,t,e){var r;t===void 0&&(t=kv),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 Gt(n){for(var t in n)return!1;return!0}function _e(n){return{longitude:n.longitude,latitude:n.latitude,fov:n.fov,offset:n.offset.clone(),distance:n.distance}}/*! Hammer.JS - v2.0.7 - 2016-04-22
1427
1427
  * http://hammerjs.github.io/
1428
1428
  *
1429
1429
  * Copyright (c) 2016 Jorik Tangelder;
1430
1430
  * Licensed under the MIT license */var Xn=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,F,z){return setTimeout(y(P,z),F)}function d(P,F,z){return Array.isArray(P)?(v(P,z[F],z),!0):!1}function v(P,F,z){var K;if(P)if(P.forEach)P.forEach(F,z);else if(P.length!==r)for(K=0;K<P.length;)F.call(z,P[K],K,P),K++;else for(K in P)P.hasOwnProperty(K)&&F.call(z,P[K],K,P)}function A(P,F,z){var K="DEPRECATED METHOD: "+F+`
1431
1431
  `+z+` AT
1432
- `;return function(){var ee=new Error("get-stack-trace"),ce=ee&&ee.stack?ee.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",Ce=n.console&&(n.console.warn||n.console.log);return Ce&&Ce.call(n.console,K,ce),P.apply(this,arguments)}}var h;typeof Object.assign!="function"?h=function(F){if(F===r||F===null)throw new TypeError("Cannot convert undefined or null to object");for(var z=Object(F),K=1;K<arguments.length;K++){var ee=arguments[K];if(ee!==r&&ee!==null)for(var ce in ee)ee.hasOwnProperty(ce)&&(z[ce]=ee[ce])}return z}:h=Object.assign;var p=A(function(F,z,K){for(var ee=Object.keys(z),ce=0;ce<ee.length;)(!K||K&&F[ee[ce]]===r)&&(F[ee[ce]]=z[ee[ce]]),ce++;return F},"extend","Use `assign`."),g=A(function(F,z){return p(F,z,!0)},"merge","Use `assign`.");function m(P,F,z){var K=F.prototype,ee;ee=P.prototype=Object.create(K),ee.constructor=P,ee._super=K,z&&h(ee,z)}function y(P,F){return function(){return P.apply(F,arguments)}}function b(P,F){return typeof P==o?P.apply(F&&F[0]||r,F):P}function x(P,F){return P===r?F:P}function w(P,F,z){v(R(F),function(K){P.addEventListener(K,z,!1)})}function E(P,F,z){v(R(F),function(K){P.removeEventListener(K,z,!1)})}function S(P,F){for(;P;){if(P==F)return!0;P=P.parentNode}return!1}function C(P,F){return P.indexOf(F)>-1}function R(P){return P.trim().split(/\s+/g)}function k(P,F,z){if(P.indexOf&&!z)return P.indexOf(F);for(var K=0;K<P.length;){if(z&&P[K][z]==F||!z&&P[K]===F)return K;K++}return-1}function M(P){return Array.prototype.slice.call(P,0)}function I(P,F,z){for(var K=[],ee=[],ce=0;ce<P.length;){var Ce=P[ce][F];k(ee,Ce)<0&&K.push(P[ce]),ee[ce]=Ce,ce++}return K=K.sort(function(wt,_e){return wt[F]>_e[F]}),K}function L(P,F){for(var z,K,ee=F[0].toUpperCase()+F.slice(1),ce=0;ce<i.length;){if(z=i[ce],K=z?z+ee:F,K in P)return K;ce++}return r}var T=1;function B(){return T++}function D(P){var F=P.ownerDocument||P;return F.defaultView||F.parentWindow||n}var V=/mobile|tablet|ip(ad|hone|od)|android/i,N="ontouchstart"in n,U=L(n,"PointerEvent")!==r,H=N&&V.test(navigator.userAgent),G="touch",j="pen",_="mouse",X="kinect",Z=25,W=1,$=2,Y=4,ne=8,te=1,ue=2,ie=4,ge=8,pe=16,ye=ue|ie,Be=ge|pe,Se=ye|Be,Te=["x","y"],re=["clientX","clientY"];function oe(P,F){var z=this;this.manager=P,this.callback=F,this.element=P.element,this.target=P.options.inputTarget,this.domHandler=function(K){b(P.options.enable,[P])&&z.handler(K)},this.init()}oe.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&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(D(this.element),this.evWin,this.domHandler)}};function q(P){var F,z=P.options.inputClass;return z?F=z:U?F=ur:H?F=bt:N?F=It:F=lt,new F(P,De)}function De(P,F,z){var K=z.pointers.length,ee=z.changedPointers.length,ce=F&W&&K-ee===0,Ce=F&(Y|ne)&&K-ee===0;z.isFirst=!!ce,z.isFinal=!!Ce,ce&&(P.session={}),z.eventType=F,Fe(P,z),P.emit("hammer.input",z),P.recognize(z),P.session.prevInput=z}function Fe(P,F){var z=P.session,K=F.pointers,ee=K.length;z.firstInput||(z.firstInput=xe(F)),ee>1&&!z.firstMultiple?z.firstMultiple=xe(F):ee===1&&(z.firstMultiple=!1);var ce=z.firstInput,Ce=z.firstMultiple,et=Ce?Ce.center:ce.center,wt=F.center=ve(K);F.timeStamp=l(),F.deltaTime=F.timeStamp-ce.timeStamp,F.angle=Ue(et,wt),F.distance=me(et,wt),Ie(z,F),F.offsetDirection=be(F.deltaX,F.deltaY);var _e=we(F.deltaTime,F.deltaX,F.deltaY);F.overallVelocityX=_e.x,F.overallVelocityY=_e.y,F.overallVelocity=u(_e.x)>u(_e.y)?_e.x:_e.y,F.scale=Ce?it(Ce.pointers,K):1,F.rotation=Ce?je(Ce.pointers,K):0,F.maxPointers=z.prevInput?F.pointers.length>z.prevInput.maxPointers?F.pointers.length:z.prevInput.maxPointers:F.pointers.length,Ke(z,F);var fr=P.element;S(F.srcEvent.target,fr)&&(fr=F.srcEvent.target),F.target=fr}function Ie(P,F){var z=F.center,K=P.offsetDelta||{},ee=P.prevDelta||{},ce=P.prevInput||{};(F.eventType===W||ce.eventType===Y)&&(ee=P.prevDelta={x:ce.deltaX||0,y:ce.deltaY||0},K=P.offsetDelta={x:z.x,y:z.y}),F.deltaX=ee.x+(z.x-K.x),F.deltaY=ee.y+(z.y-K.y)}function Ke(P,F){var z=P.lastInterval||F,K=F.timeStamp-z.timeStamp,ee,ce,Ce,et;if(F.eventType!=ne&&(K>Z||z.velocity===r)){var wt=F.deltaX-z.deltaX,_e=F.deltaY-z.deltaY,fr=we(K,wt,_e);ce=fr.x,Ce=fr.y,ee=u(fr.x)>u(fr.y)?fr.x:fr.y,et=be(wt,_e),P.lastInterval=F}else ee=z.velocity,ce=z.velocityX,Ce=z.velocityY,et=z.direction;F.velocity=ee,F.velocityX=ce,F.velocityY=Ce,F.direction=et}function xe(P){for(var F=[],z=0;z<P.pointers.length;)F[z]={clientX:s(P.pointers[z].clientX),clientY:s(P.pointers[z].clientY)},z++;return{timeStamp:l(),pointers:F,center:ve(F),deltaX:P.deltaX,deltaY:P.deltaY}}function ve(P){var F=P.length;if(F===1)return{x:s(P[0].clientX),y:s(P[0].clientY)};for(var z=0,K=0,ee=0;ee<F;)z+=P[ee].clientX,K+=P[ee].clientY,ee++;return{x:s(z/F),y:s(K/F)}}function we(P,F,z){return{x:F/P||0,y:z/P||0}}function be(P,F){return P===F?te:u(P)>=u(F)?P<0?ue:ie:F<0?ge:pe}function me(P,F,z){z||(z=Te);var K=F[z[0]]-P[z[0]],ee=F[z[1]]-P[z[1]];return Math.sqrt(K*K+ee*ee)}function Ue(P,F,z){z||(z=Te);var K=F[z[0]]-P[z[0]],ee=F[z[1]]-P[z[1]];return Math.atan2(ee,K)*180/Math.PI}function je(P,F){return Ue(F[1],F[0],re)+Ue(P[1],P[0],re)}function it(P,F){return me(F[0],F[1],re)/me(P[0],P[1],re)}var tn={mousedown:W,mousemove:$,mouseup:Y},Le="mousedown",Ye="mousemove mouseup";function lt(){this.evEl=Le,this.evWin=Ye,this.pressed=!1,oe.apply(this,arguments)}m(lt,oe,{handler:function(F){var z=tn[F.type];z&W&&(F.button===0||F.button===2)&&(this.pressed=!0),z&$&&F.which!==1&&(z=Y),this.pressed&&(z&Y&&(this.pressed=!1),this.callback(this.manager,z,{pointers:[F],changedPointers:[F],pointerType:_,srcEvent:F}))}});var or={pointerdown:W,pointermove:$,pointerup:Y,pointercancel:ne,pointerout:ne},gn={2:G,3:j,4:_,5:X},sr="pointerdown",Bt="pointermove pointerup pointercancel";n.MSPointerEvent&&!n.PointerEvent&&(sr="MSPointerDown",Bt="MSPointerMove MSPointerUp MSPointerCancel");function ur(){this.evEl=sr,this.evWin=Bt,oe.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}m(ur,oe,{handler:function(F){var z=this.store,K=!1,ee=!1,ce=F.type.toLowerCase().replace("ms",""),Ce=or[ce],et=gn[F.pointerType]||F.pointerType,wt=et==G,_e=k(z,F.pointerId,"pointerId");Ce&W&&(F.button===0||F.button===2||wt)?_e<0&&(z.push(F),_e=z.length-1):Ce&(Y|ne)?K=!0:!wt&&F.buttons===0&&(K=!0,ee=!0,Ce=or.pointerup),!(_e<0)&&(ee||(z[_e]=F),this.callback(this.manager,Ce,{pointers:z,changedPointers:[F],pointerType:et,srcEvent:z[_e]}),K&&z.splice(_e,1))}});var Fr={touchstart:W,touchmove:$,touchend:Y,touchcancel:ne},Kt="touchstart",lr="touchstart touchmove touchend touchcancel";function jt(){this.evTarget=Kt,this.evWin=lr,this.started=!1,oe.apply(this,arguments)}m(jt,oe,{handler:function(F){var z=Fr[F.type];if(z===W&&(this.started=!0),!!this.started){var K=pt.call(this,F,z);z&(Y|ne)&&K[0].length-K[1].length===0&&(this.started=!1),this.callback(this.manager,z,{pointers:K[0],changedPointers:K[1],pointerType:G,srcEvent:F})}}});function pt(P,F){var z=M(P.touches),K=M(P.changedTouches);return F&(Y|ne)&&(z=I(z.concat(K),"identifier")),[z,K]}var ke={touchstart:W,touchmove:$,touchend:Y,touchcancel:ne},yr="touchstart touchmove touchend touchcancel";function bt(){this.evTarget=yr,this.targetIds={},oe.apply(this,arguments)}m(bt,oe,{handler:function(F){var z=ke[F.type],K=br.call(this,F,z);K&&this.callback(this.manager,z,{pointers:K[0],changedPointers:K[1],pointerType:G,srcEvent:F})}});function br(P,F){var z=M(P.touches),K=this.targetIds;if(F&(W|$)&&z.length===1)return K[z[0].identifier]=!0,[z,z];var ee,ce,Ce=M(P.changedTouches),et=[],wt=this.target;if(ce=z.filter(function(_e){return S(_e.target,wt)}),F===W)for(ee=0;ee<ce.length;)K[ce[ee].identifier]=!0,ee++;for(ee=0;ee<Ce.length;)K[Ce[ee].identifier]&&et.push(Ce[ee]),F&(Y|ne)&&delete K[Ce[ee].identifier],ee++;if(et.length)return[I(ce.concat(et),"identifier"),et]}var xr=2500,_t=25;function It(){oe.apply(this,arguments);var P=y(this.handler,this);this.touch=new bt(this.manager,P),this.mouse=new lt(this.manager,P),this.primaryTouch=null,this.lastTouches=[]}m(It,oe,{handler:function(F,z,K){var ee=K.pointerType==G,ce=K.pointerType==_;if(!(ce&&K.sourceCapabilities&&K.sourceCapabilities.firesTouchEvents)){if(ee)wr.call(this,z,K);else if(ce&&yn.call(this,K))return;this.callback(F,z,K)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function wr(P,F){P&W?(this.primaryTouch=F.changedPointers[0].identifier,Lr.call(this,F)):P&(Y|ne)&&Lr.call(this,F)}function Lr(P){var F=P.changedPointers[0];if(F.identifier===this.primaryTouch){var z={x:F.clientX,y:F.clientY};this.lastTouches.push(z);var K=this.lastTouches,ee=function(){var ce=K.indexOf(z);ce>-1&&K.splice(ce,1)};setTimeout(ee,xr)}}function yn(P){for(var F=P.srcEvent.clientX,z=P.srcEvent.clientY,K=0;K<this.lastTouches.length;K++){var ee=this.lastTouches[K],ce=Math.abs(F-ee.x),Ce=Math.abs(z-ee.y);if(ce<=_t&&Ce<=_t)return!0}return!1}var rn=a?L(a.style,"touchAction"):r,nn=rn!==r,Jt="compute",$e="auto",qe="manipulation",at="none",xt="pan-x",vt="pan-y",Xt=ql();function kr(P,F){this.manager=P,this.set(F)}kr.prototype={set:function(P){P==Jt&&(P=this.compute()),nn&&this.manager.element.style&&Xt[P]&&(this.manager.element.style[rn]=P),this.actions=P.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var P=[];return v(this.manager.recognizers,function(F){b(F.options.enable,[F])&&(P=P.concat(F.getTouchAction()))}),an(P.join(" "))},preventDefaults:function(P){var F=P.srcEvent,z=P.offsetDirection;if(this.manager.session.prevented){F.preventDefault();return}var K=this.actions,ee=C(K,at)&&!Xt[at],ce=C(K,vt)&&!Xt[vt],Ce=C(K,xt)&&!Xt[xt];if(ee){var et=P.pointers.length===1,wt=P.distance<2,_e=P.deltaTime<250;if(et&&wt&&_e)return}if(!(Ce&&ce)&&(ee||ce&&z&ye||Ce&&z&Be))return this.preventSrc(F)},preventSrc:function(P){this.manager.session.prevented=!0,P.preventDefault()}};function an(P){if(C(P,at))return at;var F=C(P,xt),z=C(P,vt);return F&&z?at:F||z?F?xt:vt:C(P,qe)?qe:$e}function ql(){if(!nn)return!1;var P={},F=n.CSS&&n.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(z){P[z]=F?n.CSS.supports("touch-action",z):!0}),P}var wi=1,Ft=2,bn=4,Or=8,Er=Or,Qn=16,cr=32;function Sr(P){this.options=h({},this.defaults,P||{}),this.id=B(),this.manager=null,this.options.enable=x(this.options.enable,!0),this.state=wi,this.simultaneous={},this.requireFail=[]}Sr.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 F=this.simultaneous;return P=Ei(P,this),F[P.id]||(F[P.id]=P,P.recognizeWith(this)),this},dropRecognizeWith:function(P){return d(P,"dropRecognizeWith",this)?this:(P=Ei(P,this),delete this.simultaneous[P.id],this)},requireFailure:function(P){if(d(P,"requireFailure",this))return this;var F=this.requireFail;return P=Ei(P,this),k(F,P)===-1&&(F.push(P),P.requireFailure(this)),this},dropRequireFailure:function(P){if(d(P,"dropRequireFailure",this))return this;P=Ei(P,this);var F=k(this.requireFail,P);return F>-1&&this.requireFail.splice(F,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(P){return!!this.simultaneous[P.id]},emit:function(P){var F=this,z=this.state;function K(ee){F.manager.emit(ee,P)}z<Or&&K(F.options.event+rs(z)),K(F.options.event),P.additionalEvent&&K(P.additionalEvent),z>=Or&&K(F.options.event+rs(z))},tryEmit:function(P){if(this.canEmit())return this.emit(P);this.state=cr},canEmit:function(){for(var P=0;P<this.requireFail.length;){if(!(this.requireFail[P].state&(cr|wi)))return!1;P++}return!0},recognize:function(P){var F=h({},P);if(!b(this.options.enable,[this,F])){this.reset(),this.state=cr;return}this.state&(Er|Qn|cr)&&(this.state=wi),this.state=this.process(F),this.state&(Ft|bn|Or|Qn)&&this.tryEmit(F)},process:function(P){},getTouchAction:function(){},reset:function(){}};function rs(P){return P&Qn?"cancel":P&Or?"end":P&bn?"move":P&Ft?"start":""}function ns(P){return P==pe?"down":P==ge?"up":P==ue?"left":P==ie?"right":""}function Ei(P,F){var z=F.manager;return z?z.get(P):P}function Wt(){Sr.apply(this,arguments)}m(Wt,Sr,{defaults:{pointers:1},attrTest:function(P){var F=this.options.pointers;return F===0||P.pointers.length===F},process:function(P){var F=this.state,z=P.eventType,K=F&(Ft|bn),ee=this.attrTest(P);return K&&(z&ne||!ee)?F|Qn:K||ee?z&Y?F|Or:F&Ft?F|bn:Ft:cr}});function Si(){Wt.apply(this,arguments),this.pX=null,this.pY=null}m(Si,Wt,{defaults:{event:"pan",threshold:10,pointers:1,direction:Se},getTouchAction:function(){var P=this.options.direction,F=[];return P&ye&&F.push(vt),P&Be&&F.push(xt),F},directionTest:function(P){var F=this.options,z=!0,K=P.distance,ee=P.direction,ce=P.deltaX,Ce=P.deltaY;return ee&F.direction||(F.direction&ye?(ee=ce===0?te:ce<0?ue:ie,z=ce!=this.pX,K=Math.abs(P.deltaX)):(ee=Ce===0?te:Ce<0?ge:pe,z=Ce!=this.pY,K=Math.abs(P.deltaY))),P.direction=ee,z&&K>F.threshold&&ee&F.direction},attrTest:function(P){return Wt.prototype.attrTest.call(this,P)&&(this.state&Ft||!(this.state&Ft)&&this.directionTest(P))},emit:function(P){this.pX=P.deltaX,this.pY=P.deltaY;var F=ns(P.direction);F&&(P.additionalEvent=this.options.event+F),this._super.emit.call(this,P)}});function la(){Wt.apply(this,arguments)}m(la,Wt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[at]},attrTest:function(P){return this._super.attrTest.call(this,P)&&(Math.abs(P.scale-1)>this.options.threshold||this.state&Ft)},emit:function(P){if(P.scale!==1){var F=P.scale<1?"in":"out";P.additionalEvent=this.options.event+F}this._super.emit.call(this,P)}});function ca(){Sr.apply(this,arguments),this._timer=null,this._input=null}m(ca,Sr,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[$e]},process:function(P){var F=this.options,z=P.pointers.length===F.pointers,K=P.distance<F.threshold,ee=P.deltaTime>F.time;if(this._input=P,!K||!z||P.eventType&(Y|ne)&&!ee)this.reset();else if(P.eventType&W)this.reset(),this._timer=c(function(){this.state=Er,this.tryEmit()},F.time,this);else if(P.eventType&Y)return Er;return cr},reset:function(){clearTimeout(this._timer)},emit:function(P){this.state===Er&&(P&&P.eventType&Y?this.manager.emit(this.options.event+"up",P):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function fa(){Wt.apply(this,arguments)}m(fa,Wt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[at]},attrTest:function(P){return this._super.attrTest.call(this,P)&&(Math.abs(P.rotation)>this.options.threshold||this.state&Ft)}});function da(){Wt.apply(this,arguments)}m(da,Wt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:ye|Be,pointers:1},getTouchAction:function(){return Si.prototype.getTouchAction.call(this)},attrTest:function(P){var F=this.options.direction,z;return F&(ye|Be)?z=P.overallVelocity:F&ye?z=P.overallVelocityX:F&Be&&(z=P.overallVelocityY),this._super.attrTest.call(this,P)&&F&P.offsetDirection&&P.distance>this.options.threshold&&P.maxPointers==this.options.pointers&&u(z)>this.options.velocity&&P.eventType&Y},emit:function(P){var F=ns(P.offsetDirection);F&&this.manager.emit(this.options.event+F,P),this.manager.emit(this.options.event,P)}});function Mi(){Sr.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}m(Mi,Sr,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[qe]},process:function(P){var F=this.options,z=P.pointers.length===F.pointers,K=P.distance<F.threshold,ee=P.deltaTime<F.time;if(this.reset(),P.eventType&W&&this.count===0)return this.failTimeout();if(K&&ee&&z){if(P.eventType!=Y)return this.failTimeout();var ce=this.pTime?P.timeStamp-this.pTime<F.interval:!0,Ce=!this.pCenter||me(this.pCenter,P.center)<F.posThreshold;this.pTime=P.timeStamp,this.pCenter=P.center,!Ce||!ce?this.count=1:this.count+=1,this._input=P;var et=this.count%F.taps;if(et===0)return this.hasRequireFailures()?(this._timer=c(function(){this.state=Er,this.tryEmit()},F.interval,this),Ft):Er}return cr},failTimeout:function(){return this._timer=c(function(){this.state=cr},this.options.interval,this),cr},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Er&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function xn(P,F){return F=F||{},F.recognizers=x(F.recognizers,xn.defaults.preset),new ha(P,F)}xn.VERSION="2.0.7",xn.defaults={domEvents:!1,touchAction:Jt,enable:!0,inputTarget:null,inputClass:null,preset:[[fa,{enable:!1}],[la,{enable:!1},["rotate"]],[da,{direction:ye}],[Si,{direction:ye},["swipe"]],[Mi],[Mi,{event:"doubletap",taps:2},["tap"]],[ca]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Gl=1,is=2;function ha(P,F){this.options=h({},xn.defaults,F||{}),this.options.inputTarget=this.options.inputTarget||P,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=P,this.input=q(this),this.touchAction=new kr(this,this.options.touchAction),as(this,!0),v(this.options.recognizers,function(z){var K=this.add(new z[0](z[1]));z[2]&&K.recognizeWith(z[2]),z[3]&&K.requireFailure(z[3])},this)}ha.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?is:Gl},recognize:function(P){var F=this.session;if(!F.stopped){this.touchAction.preventDefaults(P);var z,K=this.recognizers,ee=F.curRecognizer;(!ee||ee&&ee.state&Er)&&(ee=F.curRecognizer=null);for(var ce=0;ce<K.length;)z=K[ce],F.stopped!==is&&(!ee||z==ee||z.canRecognizeWith(ee))?z.recognize(P):z.reset(),!ee&&z.state&(Ft|bn|Or)&&(ee=F.curRecognizer=z),ce++}},get:function(P){if(P instanceof Sr)return P;for(var F=this.recognizers,z=0;z<F.length;z++)if(F[z].options.event==P)return F[z];return null},add:function(P){if(d(P,"add",this))return this;var F=this.get(P.options.event);return F&&this.remove(F),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 F=this.recognizers,z=k(F,P);z!==-1&&(F.splice(z,1),this.touchAction.update())}return this},on:function(P,F){if(P!==r&&F!==r){var z=this.handlers;return v(R(P),function(K){z[K]=z[K]||[],z[K].push(F)}),this}},off:function(P,F){if(P!==r){var z=this.handlers;return v(R(P),function(K){F?z[K]&&z[K].splice(k(z[K],F),1):delete z[K]}),this}},emit:function(P,F){this.options.domEvents&&Kl(P,F);var z=this.handlers[P]&&this.handlers[P].slice();if(!(!z||!z.length)){F.type=P,F.preventDefault=function(){F.srcEvent.preventDefault()};for(var K=0;K<z.length;)z[K](F),K++}},destroy:function(){this.element&&as(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function as(P,F){var z=P.element;if(z.style){var K;v(P.options.cssProps,function(ee,ce){K=L(z.style,ce),F?(P.oldCssProps[K]=z.style[K],z.style[K]=ee):z.style[K]=P.oldCssProps[K]||""}),F||(P.oldCssProps={})}}function Kl(P,F){var z=t.createEvent("Event");z.initEvent(P,!0,!0),z.gesture=F,F.target.dispatchEvent(z)}return h(xn,{INPUT_START:W,INPUT_MOVE:$,INPUT_END:Y,INPUT_CANCEL:ne,STATE_POSSIBLE:wi,STATE_BEGAN:Ft,STATE_CHANGED:bn,STATE_ENDED:Or,STATE_RECOGNIZED:Er,STATE_CANCELLED:Qn,STATE_FAILED:cr,DIRECTION_NONE:te,DIRECTION_LEFT:ue,DIRECTION_RIGHT:ie,DIRECTION_UP:ge,DIRECTION_DOWN:pe,DIRECTION_HORIZONTAL:ye,DIRECTION_VERTICAL:Be,DIRECTION_ALL:Se,Manager:ha,Input:oe,TouchAction:kr,TouchInput:bt,MouseInput:lt,PointerEventInput:ur,TouchMouseInput:It,SingleTouchInput:jt,Recognizer:Sr,AttrRecognizer:Wt,Tap:Mi,Pan:Si,Swipe:da,Pinch:la,Rotate:fa,Press:ca,on:w,off:E,each:v,merge:g,extend:p,assign:h,inherit:m,bindFn:y,prefixed:L}),xn}(typeof window!="undefined"?window:{},typeof document!="undefined"?document:{});function A0(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 xl=new f.OrthographicCamera(-1,1,1,-1,0,1),Go=new f.BufferGeometry;Go.setAttribute("position",new f.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));Go.setAttribute("uv",new f.Float32BufferAttribute([0,2,0,0,2,0],2));var pn=new f.Mesh(Go),Ko=new f.Scene;Ko.add(pn);var Ov=`
1432
+ `;return function(){var ee=new Error("get-stack-trace"),ce=ee&&ee.stack?ee.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",Ce=n.console&&(n.console.warn||n.console.log);return Ce&&Ce.call(n.console,K,ce),P.apply(this,arguments)}}var h;typeof Object.assign!="function"?h=function(F){if(F===r||F===null)throw new TypeError("Cannot convert undefined or null to object");for(var z=Object(F),K=1;K<arguments.length;K++){var ee=arguments[K];if(ee!==r&&ee!==null)for(var ce in ee)ee.hasOwnProperty(ce)&&(z[ce]=ee[ce])}return z}:h=Object.assign;var p=A(function(F,z,K){for(var ee=Object.keys(z),ce=0;ce<ee.length;)(!K||K&&F[ee[ce]]===r)&&(F[ee[ce]]=z[ee[ce]]),ce++;return F},"extend","Use `assign`."),g=A(function(F,z){return p(F,z,!0)},"merge","Use `assign`.");function m(P,F,z){var K=F.prototype,ee;ee=P.prototype=Object.create(K),ee.constructor=P,ee._super=K,z&&h(ee,z)}function y(P,F){return function(){return P.apply(F,arguments)}}function b(P,F){return typeof P==o?P.apply(F&&F[0]||r,F):P}function x(P,F){return P===r?F:P}function w(P,F,z){v(R(F),function(K){P.addEventListener(K,z,!1)})}function E(P,F,z){v(R(F),function(K){P.removeEventListener(K,z,!1)})}function S(P,F){for(;P;){if(P==F)return!0;P=P.parentNode}return!1}function C(P,F){return P.indexOf(F)>-1}function R(P){return P.trim().split(/\s+/g)}function k(P,F,z){if(P.indexOf&&!z)return P.indexOf(F);for(var K=0;K<P.length;){if(z&&P[K][z]==F||!z&&P[K]===F)return K;K++}return-1}function M(P){return Array.prototype.slice.call(P,0)}function I(P,F,z){for(var K=[],ee=[],ce=0;ce<P.length;){var Ce=P[ce][F];k(ee,Ce)<0&&K.push(P[ce]),ee[ce]=Ce,ce++}return K=K.sort(function(wt,Je){return wt[F]>Je[F]}),K}function L(P,F){for(var z,K,ee=F[0].toUpperCase()+F.slice(1),ce=0;ce<i.length;){if(z=i[ce],K=z?z+ee:F,K in P)return K;ce++}return r}var T=1;function B(){return T++}function D(P){var F=P.ownerDocument||P;return F.defaultView||F.parentWindow||n}var V=/mobile|tablet|ip(ad|hone|od)|android/i,N="ontouchstart"in n,U=L(n,"PointerEvent")!==r,H=N&&V.test(navigator.userAgent),G="touch",j="pen",J="mouse",X="kinect",Z=25,W=1,$=2,Y=4,ne=8,te=1,ue=2,ie=4,ge=8,pe=16,ye=ue|ie,Be=ge|pe,Se=ye|Be,Te=["x","y"],re=["clientX","clientY"];function oe(P,F){var z=this;this.manager=P,this.callback=F,this.element=P.element,this.target=P.options.inputTarget,this.domHandler=function(K){b(P.options.enable,[P])&&z.handler(K)},this.init()}oe.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&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(D(this.element),this.evWin,this.domHandler)}};function q(P){var F,z=P.options.inputClass;return z?F=z:U?F=ur:H?F=bt:N?F=It:F=lt,new F(P,De)}function De(P,F,z){var K=z.pointers.length,ee=z.changedPointers.length,ce=F&W&&K-ee===0,Ce=F&(Y|ne)&&K-ee===0;z.isFirst=!!ce,z.isFinal=!!Ce,ce&&(P.session={}),z.eventType=F,Fe(P,z),P.emit("hammer.input",z),P.recognize(z),P.session.prevInput=z}function Fe(P,F){var z=P.session,K=F.pointers,ee=K.length;z.firstInput||(z.firstInput=xe(F)),ee>1&&!z.firstMultiple?z.firstMultiple=xe(F):ee===1&&(z.firstMultiple=!1);var ce=z.firstInput,Ce=z.firstMultiple,et=Ce?Ce.center:ce.center,wt=F.center=ve(K);F.timeStamp=l(),F.deltaTime=F.timeStamp-ce.timeStamp,F.angle=Ue(et,wt),F.distance=me(et,wt),Ie(z,F),F.offsetDirection=be(F.deltaX,F.deltaY);var Je=we(F.deltaTime,F.deltaX,F.deltaY);F.overallVelocityX=Je.x,F.overallVelocityY=Je.y,F.overallVelocity=u(Je.x)>u(Je.y)?Je.x:Je.y,F.scale=Ce?it(Ce.pointers,K):1,F.rotation=Ce?je(Ce.pointers,K):0,F.maxPointers=z.prevInput?F.pointers.length>z.prevInput.maxPointers?F.pointers.length:z.prevInput.maxPointers:F.pointers.length,Ke(z,F);var fr=P.element;S(F.srcEvent.target,fr)&&(fr=F.srcEvent.target),F.target=fr}function Ie(P,F){var z=F.center,K=P.offsetDelta||{},ee=P.prevDelta||{},ce=P.prevInput||{};(F.eventType===W||ce.eventType===Y)&&(ee=P.prevDelta={x:ce.deltaX||0,y:ce.deltaY||0},K=P.offsetDelta={x:z.x,y:z.y}),F.deltaX=ee.x+(z.x-K.x),F.deltaY=ee.y+(z.y-K.y)}function Ke(P,F){var z=P.lastInterval||F,K=F.timeStamp-z.timeStamp,ee,ce,Ce,et;if(F.eventType!=ne&&(K>Z||z.velocity===r)){var wt=F.deltaX-z.deltaX,Je=F.deltaY-z.deltaY,fr=we(K,wt,Je);ce=fr.x,Ce=fr.y,ee=u(fr.x)>u(fr.y)?fr.x:fr.y,et=be(wt,Je),P.lastInterval=F}else ee=z.velocity,ce=z.velocityX,Ce=z.velocityY,et=z.direction;F.velocity=ee,F.velocityX=ce,F.velocityY=Ce,F.direction=et}function xe(P){for(var F=[],z=0;z<P.pointers.length;)F[z]={clientX:s(P.pointers[z].clientX),clientY:s(P.pointers[z].clientY)},z++;return{timeStamp:l(),pointers:F,center:ve(F),deltaX:P.deltaX,deltaY:P.deltaY}}function ve(P){var F=P.length;if(F===1)return{x:s(P[0].clientX),y:s(P[0].clientY)};for(var z=0,K=0,ee=0;ee<F;)z+=P[ee].clientX,K+=P[ee].clientY,ee++;return{x:s(z/F),y:s(K/F)}}function we(P,F,z){return{x:F/P||0,y:z/P||0}}function be(P,F){return P===F?te:u(P)>=u(F)?P<0?ue:ie:F<0?ge:pe}function me(P,F,z){z||(z=Te);var K=F[z[0]]-P[z[0]],ee=F[z[1]]-P[z[1]];return Math.sqrt(K*K+ee*ee)}function Ue(P,F,z){z||(z=Te);var K=F[z[0]]-P[z[0]],ee=F[z[1]]-P[z[1]];return Math.atan2(ee,K)*180/Math.PI}function je(P,F){return Ue(F[1],F[0],re)+Ue(P[1],P[0],re)}function it(P,F){return me(F[0],F[1],re)/me(P[0],P[1],re)}var tn={mousedown:W,mousemove:$,mouseup:Y},Le="mousedown",Ye="mousemove mouseup";function lt(){this.evEl=Le,this.evWin=Ye,this.pressed=!1,oe.apply(this,arguments)}m(lt,oe,{handler:function(F){var z=tn[F.type];z&W&&(F.button===0||F.button===2)&&(this.pressed=!0),z&$&&F.which!==1&&(z=Y),this.pressed&&(z&Y&&(this.pressed=!1),this.callback(this.manager,z,{pointers:[F],changedPointers:[F],pointerType:J,srcEvent:F}))}});var or={pointerdown:W,pointermove:$,pointerup:Y,pointercancel:ne,pointerout:ne},gn={2:G,3:j,4:J,5:X},sr="pointerdown",Bt="pointermove pointerup pointercancel";n.MSPointerEvent&&!n.PointerEvent&&(sr="MSPointerDown",Bt="MSPointerMove MSPointerUp MSPointerCancel");function ur(){this.evEl=sr,this.evWin=Bt,oe.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}m(ur,oe,{handler:function(F){var z=this.store,K=!1,ee=!1,ce=F.type.toLowerCase().replace("ms",""),Ce=or[ce],et=gn[F.pointerType]||F.pointerType,wt=et==G,Je=k(z,F.pointerId,"pointerId");Ce&W&&(F.button===0||F.button===2||wt)?Je<0&&(z.push(F),Je=z.length-1):Ce&(Y|ne)?K=!0:!wt&&F.buttons===0&&(K=!0,ee=!0,Ce=or.pointerup),!(Je<0)&&(ee||(z[Je]=F),this.callback(this.manager,Ce,{pointers:z,changedPointers:[F],pointerType:et,srcEvent:z[Je]}),K&&z.splice(Je,1))}});var Fr={touchstart:W,touchmove:$,touchend:Y,touchcancel:ne},Kt="touchstart",lr="touchstart touchmove touchend touchcancel";function jt(){this.evTarget=Kt,this.evWin=lr,this.started=!1,oe.apply(this,arguments)}m(jt,oe,{handler:function(F){var z=Fr[F.type];if(z===W&&(this.started=!0),!!this.started){var K=pt.call(this,F,z);z&(Y|ne)&&K[0].length-K[1].length===0&&(this.started=!1),this.callback(this.manager,z,{pointers:K[0],changedPointers:K[1],pointerType:G,srcEvent:F})}}});function pt(P,F){var z=M(P.touches),K=M(P.changedTouches);return F&(Y|ne)&&(z=I(z.concat(K),"identifier")),[z,K]}var ke={touchstart:W,touchmove:$,touchend:Y,touchcancel:ne},yr="touchstart touchmove touchend touchcancel";function bt(){this.evTarget=yr,this.targetIds={},oe.apply(this,arguments)}m(bt,oe,{handler:function(F){var z=ke[F.type],K=br.call(this,F,z);K&&this.callback(this.manager,z,{pointers:K[0],changedPointers:K[1],pointerType:G,srcEvent:F})}});function br(P,F){var z=M(P.touches),K=this.targetIds;if(F&(W|$)&&z.length===1)return K[z[0].identifier]=!0,[z,z];var ee,ce,Ce=M(P.changedTouches),et=[],wt=this.target;if(ce=z.filter(function(Je){return S(Je.target,wt)}),F===W)for(ee=0;ee<ce.length;)K[ce[ee].identifier]=!0,ee++;for(ee=0;ee<Ce.length;)K[Ce[ee].identifier]&&et.push(Ce[ee]),F&(Y|ne)&&delete K[Ce[ee].identifier],ee++;if(et.length)return[I(ce.concat(et),"identifier"),et]}var xr=2500,Jt=25;function It(){oe.apply(this,arguments);var P=y(this.handler,this);this.touch=new bt(this.manager,P),this.mouse=new lt(this.manager,P),this.primaryTouch=null,this.lastTouches=[]}m(It,oe,{handler:function(F,z,K){var ee=K.pointerType==G,ce=K.pointerType==J;if(!(ce&&K.sourceCapabilities&&K.sourceCapabilities.firesTouchEvents)){if(ee)wr.call(this,z,K);else if(ce&&yn.call(this,K))return;this.callback(F,z,K)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function wr(P,F){P&W?(this.primaryTouch=F.changedPointers[0].identifier,Lr.call(this,F)):P&(Y|ne)&&Lr.call(this,F)}function Lr(P){var F=P.changedPointers[0];if(F.identifier===this.primaryTouch){var z={x:F.clientX,y:F.clientY};this.lastTouches.push(z);var K=this.lastTouches,ee=function(){var ce=K.indexOf(z);ce>-1&&K.splice(ce,1)};setTimeout(ee,xr)}}function yn(P){for(var F=P.srcEvent.clientX,z=P.srcEvent.clientY,K=0;K<this.lastTouches.length;K++){var ee=this.lastTouches[K],ce=Math.abs(F-ee.x),Ce=Math.abs(z-ee.y);if(ce<=Jt&&Ce<=Jt)return!0}return!1}var rn=a?L(a.style,"touchAction"):r,nn=rn!==r,_t="compute",$e="auto",qe="manipulation",at="none",xt="pan-x",vt="pan-y",Xt=ql();function kr(P,F){this.manager=P,this.set(F)}kr.prototype={set:function(P){P==_t&&(P=this.compute()),nn&&this.manager.element.style&&Xt[P]&&(this.manager.element.style[rn]=P),this.actions=P.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var P=[];return v(this.manager.recognizers,function(F){b(F.options.enable,[F])&&(P=P.concat(F.getTouchAction()))}),an(P.join(" "))},preventDefaults:function(P){var F=P.srcEvent,z=P.offsetDirection;if(this.manager.session.prevented){F.preventDefault();return}var K=this.actions,ee=C(K,at)&&!Xt[at],ce=C(K,vt)&&!Xt[vt],Ce=C(K,xt)&&!Xt[xt];if(ee){var et=P.pointers.length===1,wt=P.distance<2,Je=P.deltaTime<250;if(et&&wt&&Je)return}if(!(Ce&&ce)&&(ee||ce&&z&ye||Ce&&z&Be))return this.preventSrc(F)},preventSrc:function(P){this.manager.session.prevented=!0,P.preventDefault()}};function an(P){if(C(P,at))return at;var F=C(P,xt),z=C(P,vt);return F&&z?at:F||z?F?xt:vt:C(P,qe)?qe:$e}function ql(){if(!nn)return!1;var P={},F=n.CSS&&n.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(z){P[z]=F?n.CSS.supports("touch-action",z):!0}),P}var wi=1,Ft=2,bn=4,Or=8,Er=Or,Qn=16,cr=32;function Sr(P){this.options=h({},this.defaults,P||{}),this.id=B(),this.manager=null,this.options.enable=x(this.options.enable,!0),this.state=wi,this.simultaneous={},this.requireFail=[]}Sr.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 F=this.simultaneous;return P=Ei(P,this),F[P.id]||(F[P.id]=P,P.recognizeWith(this)),this},dropRecognizeWith:function(P){return d(P,"dropRecognizeWith",this)?this:(P=Ei(P,this),delete this.simultaneous[P.id],this)},requireFailure:function(P){if(d(P,"requireFailure",this))return this;var F=this.requireFail;return P=Ei(P,this),k(F,P)===-1&&(F.push(P),P.requireFailure(this)),this},dropRequireFailure:function(P){if(d(P,"dropRequireFailure",this))return this;P=Ei(P,this);var F=k(this.requireFail,P);return F>-1&&this.requireFail.splice(F,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(P){return!!this.simultaneous[P.id]},emit:function(P){var F=this,z=this.state;function K(ee){F.manager.emit(ee,P)}z<Or&&K(F.options.event+rs(z)),K(F.options.event),P.additionalEvent&&K(P.additionalEvent),z>=Or&&K(F.options.event+rs(z))},tryEmit:function(P){if(this.canEmit())return this.emit(P);this.state=cr},canEmit:function(){for(var P=0;P<this.requireFail.length;){if(!(this.requireFail[P].state&(cr|wi)))return!1;P++}return!0},recognize:function(P){var F=h({},P);if(!b(this.options.enable,[this,F])){this.reset(),this.state=cr;return}this.state&(Er|Qn|cr)&&(this.state=wi),this.state=this.process(F),this.state&(Ft|bn|Or|Qn)&&this.tryEmit(F)},process:function(P){},getTouchAction:function(){},reset:function(){}};function rs(P){return P&Qn?"cancel":P&Or?"end":P&bn?"move":P&Ft?"start":""}function ns(P){return P==pe?"down":P==ge?"up":P==ue?"left":P==ie?"right":""}function Ei(P,F){var z=F.manager;return z?z.get(P):P}function Wt(){Sr.apply(this,arguments)}m(Wt,Sr,{defaults:{pointers:1},attrTest:function(P){var F=this.options.pointers;return F===0||P.pointers.length===F},process:function(P){var F=this.state,z=P.eventType,K=F&(Ft|bn),ee=this.attrTest(P);return K&&(z&ne||!ee)?F|Qn:K||ee?z&Y?F|Or:F&Ft?F|bn:Ft:cr}});function Si(){Wt.apply(this,arguments),this.pX=null,this.pY=null}m(Si,Wt,{defaults:{event:"pan",threshold:10,pointers:1,direction:Se},getTouchAction:function(){var P=this.options.direction,F=[];return P&ye&&F.push(vt),P&Be&&F.push(xt),F},directionTest:function(P){var F=this.options,z=!0,K=P.distance,ee=P.direction,ce=P.deltaX,Ce=P.deltaY;return ee&F.direction||(F.direction&ye?(ee=ce===0?te:ce<0?ue:ie,z=ce!=this.pX,K=Math.abs(P.deltaX)):(ee=Ce===0?te:Ce<0?ge:pe,z=Ce!=this.pY,K=Math.abs(P.deltaY))),P.direction=ee,z&&K>F.threshold&&ee&F.direction},attrTest:function(P){return Wt.prototype.attrTest.call(this,P)&&(this.state&Ft||!(this.state&Ft)&&this.directionTest(P))},emit:function(P){this.pX=P.deltaX,this.pY=P.deltaY;var F=ns(P.direction);F&&(P.additionalEvent=this.options.event+F),this._super.emit.call(this,P)}});function la(){Wt.apply(this,arguments)}m(la,Wt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[at]},attrTest:function(P){return this._super.attrTest.call(this,P)&&(Math.abs(P.scale-1)>this.options.threshold||this.state&Ft)},emit:function(P){if(P.scale!==1){var F=P.scale<1?"in":"out";P.additionalEvent=this.options.event+F}this._super.emit.call(this,P)}});function ca(){Sr.apply(this,arguments),this._timer=null,this._input=null}m(ca,Sr,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[$e]},process:function(P){var F=this.options,z=P.pointers.length===F.pointers,K=P.distance<F.threshold,ee=P.deltaTime>F.time;if(this._input=P,!K||!z||P.eventType&(Y|ne)&&!ee)this.reset();else if(P.eventType&W)this.reset(),this._timer=c(function(){this.state=Er,this.tryEmit()},F.time,this);else if(P.eventType&Y)return Er;return cr},reset:function(){clearTimeout(this._timer)},emit:function(P){this.state===Er&&(P&&P.eventType&Y?this.manager.emit(this.options.event+"up",P):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function fa(){Wt.apply(this,arguments)}m(fa,Wt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[at]},attrTest:function(P){return this._super.attrTest.call(this,P)&&(Math.abs(P.rotation)>this.options.threshold||this.state&Ft)}});function da(){Wt.apply(this,arguments)}m(da,Wt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:ye|Be,pointers:1},getTouchAction:function(){return Si.prototype.getTouchAction.call(this)},attrTest:function(P){var F=this.options.direction,z;return F&(ye|Be)?z=P.overallVelocity:F&ye?z=P.overallVelocityX:F&Be&&(z=P.overallVelocityY),this._super.attrTest.call(this,P)&&F&P.offsetDirection&&P.distance>this.options.threshold&&P.maxPointers==this.options.pointers&&u(z)>this.options.velocity&&P.eventType&Y},emit:function(P){var F=ns(P.offsetDirection);F&&this.manager.emit(this.options.event+F,P),this.manager.emit(this.options.event,P)}});function Mi(){Sr.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}m(Mi,Sr,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[qe]},process:function(P){var F=this.options,z=P.pointers.length===F.pointers,K=P.distance<F.threshold,ee=P.deltaTime<F.time;if(this.reset(),P.eventType&W&&this.count===0)return this.failTimeout();if(K&&ee&&z){if(P.eventType!=Y)return this.failTimeout();var ce=this.pTime?P.timeStamp-this.pTime<F.interval:!0,Ce=!this.pCenter||me(this.pCenter,P.center)<F.posThreshold;this.pTime=P.timeStamp,this.pCenter=P.center,!Ce||!ce?this.count=1:this.count+=1,this._input=P;var et=this.count%F.taps;if(et===0)return this.hasRequireFailures()?(this._timer=c(function(){this.state=Er,this.tryEmit()},F.interval,this),Ft):Er}return cr},failTimeout:function(){return this._timer=c(function(){this.state=cr},this.options.interval,this),cr},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Er&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function xn(P,F){return F=F||{},F.recognizers=x(F.recognizers,xn.defaults.preset),new ha(P,F)}xn.VERSION="2.0.7",xn.defaults={domEvents:!1,touchAction:_t,enable:!0,inputTarget:null,inputClass:null,preset:[[fa,{enable:!1}],[la,{enable:!1},["rotate"]],[da,{direction:ye}],[Si,{direction:ye},["swipe"]],[Mi],[Mi,{event:"doubletap",taps:2},["tap"]],[ca]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Gl=1,is=2;function ha(P,F){this.options=h({},xn.defaults,F||{}),this.options.inputTarget=this.options.inputTarget||P,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=P,this.input=q(this),this.touchAction=new kr(this,this.options.touchAction),as(this,!0),v(this.options.recognizers,function(z){var K=this.add(new z[0](z[1]));z[2]&&K.recognizeWith(z[2]),z[3]&&K.requireFailure(z[3])},this)}ha.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?is:Gl},recognize:function(P){var F=this.session;if(!F.stopped){this.touchAction.preventDefaults(P);var z,K=this.recognizers,ee=F.curRecognizer;(!ee||ee&&ee.state&Er)&&(ee=F.curRecognizer=null);for(var ce=0;ce<K.length;)z=K[ce],F.stopped!==is&&(!ee||z==ee||z.canRecognizeWith(ee))?z.recognize(P):z.reset(),!ee&&z.state&(Ft|bn|Or)&&(ee=F.curRecognizer=z),ce++}},get:function(P){if(P instanceof Sr)return P;for(var F=this.recognizers,z=0;z<F.length;z++)if(F[z].options.event==P)return F[z];return null},add:function(P){if(d(P,"add",this))return this;var F=this.get(P.options.event);return F&&this.remove(F),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 F=this.recognizers,z=k(F,P);z!==-1&&(F.splice(z,1),this.touchAction.update())}return this},on:function(P,F){if(P!==r&&F!==r){var z=this.handlers;return v(R(P),function(K){z[K]=z[K]||[],z[K].push(F)}),this}},off:function(P,F){if(P!==r){var z=this.handlers;return v(R(P),function(K){F?z[K]&&z[K].splice(k(z[K],F),1):delete z[K]}),this}},emit:function(P,F){this.options.domEvents&&Kl(P,F);var z=this.handlers[P]&&this.handlers[P].slice();if(!(!z||!z.length)){F.type=P,F.preventDefault=function(){F.srcEvent.preventDefault()};for(var K=0;K<z.length;)z[K](F),K++}},destroy:function(){this.element&&as(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function as(P,F){var z=P.element;if(z.style){var K;v(P.options.cssProps,function(ee,ce){K=L(z.style,ce),F?(P.oldCssProps[K]=z.style[K],z.style[K]=ee):z.style[K]=P.oldCssProps[K]||""}),F||(P.oldCssProps={})}}function Kl(P,F){var z=t.createEvent("Event");z.initEvent(P,!0,!0),z.gesture=F,F.target.dispatchEvent(z)}return h(xn,{INPUT_START:W,INPUT_MOVE:$,INPUT_END:Y,INPUT_CANCEL:ne,STATE_POSSIBLE:wi,STATE_BEGAN:Ft,STATE_CHANGED:bn,STATE_ENDED:Or,STATE_RECOGNIZED:Er,STATE_CANCELLED:Qn,STATE_FAILED:cr,DIRECTION_NONE:te,DIRECTION_LEFT:ue,DIRECTION_RIGHT:ie,DIRECTION_UP:ge,DIRECTION_DOWN:pe,DIRECTION_HORIZONTAL:ye,DIRECTION_VERTICAL:Be,DIRECTION_ALL:Se,Manager:ha,Input:oe,TouchAction:kr,TouchInput:bt,MouseInput:lt,PointerEventInput:ur,TouchMouseInput:It,SingleTouchInput:jt,Recognizer:Sr,AttrRecognizer:Wt,Tap:Mi,Pan:Si,Swipe:da,Pinch:la,Rotate:fa,Press:ca,on:w,off:E,each:v,merge:g,extend:p,assign:h,inherit:m,bindFn:y,prefixed:L}),xn}(typeof window!="undefined"?window:{},typeof document!="undefined"?document:{});function A0(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 xl=new f.OrthographicCamera(-1,1,1,-1,0,1),Go=new f.BufferGeometry;Go.setAttribute("position",new f.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));Go.setAttribute("uv",new f.Float32BufferAttribute([0,2,0,0,2,0],2));var pn=new f.Mesh(Go),Ko=new f.Scene;Ko.add(pn);var Ov=`
1433
1433
  varying vec2 vUv;
1434
1434
  void main() {
1435
1435
  vUv = uv;
@@ -1470,7 +1470,7 @@ void main() {
1470
1470
 
1471
1471
  gl_Position = projectionMatrix * mvPosition;
1472
1472
  }
1473
- `,Hv=new f.OrthographicCamera(-1,1,1,-1,0,1),jo=new f.BufferGeometry;jo.setAttribute("position",new f.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));jo.setAttribute("uv",new f.Float32BufferAttribute([0,2,0,0,2,0],2));var El=new f.MeshBasicMaterial,wo=new f.Mesh(jo,El),Sl=new f.Scene;Sl.add(wo);var qv=function(){function n(t){this.renderer=t,this.material=new f.ShaderMaterial({vertexShader:Uv,fragmentShader:Qv,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,wo.material=this.material,this.renderer.setRenderTarget(e||null),this.renderer.render(Sl,Hv),this.renderer.setRenderTarget(r),wo.material=El},n.prototype.dispose=function(){this.material.dispose()},n}(),Ga=new f.Vector2,_o=function(n){se(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 Me({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(v){return l.bindEvents(v)}),l.pending.add("init-animation"),l.initAnimationReady=new Promise(function(v){ht.shared.add(function(){l.initAnimation().then(function(){l.pending.delete("init-animation"),v()})},!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 wl(l.renderer),l.depthCopyPass=new qv(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),v=d.initial,A=v.state,h=v.currentState,p=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({},p),{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.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),Gt(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(he())[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",J("initAnimation.start",{state:i,userAction:this.userAction})),this.emit("initAnimation.end",J("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,v=(s=e.offset)!==null&&s!==void 0?s:this.camera.pose.offset,A=Dt(u,this.camera.pose.longitude,Math.PI*2)||Dt(l,this.camera.pose.latitude),h=Dt(c,this.camera.pose.fov),p=Dt(d,this.camera.pose.distance),g=qi(v,this.camera.pose.offset);(h||A||g||p)&&(this.camera.setFromPose({longitude:u,latitude:l,fov:c,distance:d,offset:v}),this.emit("camera.update",J("camera.update",{userAction:this.userAction,state:O(O({},this.currentPano),{mode:this.mode,longitude:u,latitude:l,fov:c,offset:v,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=J("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 A0(e,this.element,this.scissor)},t.prototype.bindEvents=function(e){var r=this,i=function(M){var I=A0(M,r.element,r.scissor);return!(Math.abs(I.x)>1||Math.abs(I.y)>1)},a=new Xn.Manager(e),o=function(M){var I=M.session;return I.firstInput||null},s=new Xn.Pan({threshold:10,pointers:0}),u=new Xn.Tap({interval:410}),l=new Xn.Pinch({threshold:0,pointers:2});a.add([s,u,l]),a.on("panstart pan",function(M){var I=o(a);if(!(I&&!i(I.center))){var L=J("gesture.pan",{target:M.target,pointerType:M.pointerType,srcEvent:M.srcEvent,pointers:M.pointers.map(function(T){var B=r.relativeClientPosition(T),D=new f.Raycaster;return D.params.Points={threshold:.1},D.setFromCamera(B,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:B,raycaster:D}}),isFirst:M.isFirst,isFinal:M.isFinal,scale:M.scale,center:function(T){var B=r.relativeClientPosition(T),D=new f.Raycaster;return D.params.Points={threshold:.1},D.setFromCamera(B,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:B,raycaster:D}}(M.center),velocityX:M.velocityX,velocityY:M.velocityY,overallVelocityX:M.overallVelocityX,overallVelocityY:M.overallVelocityY,userAction:!0,state:O(O({mode:r.mode},r.currentPano),Je(r.camera.pose))});r.onPanGesture(L),b()}}),a.on("tap",function(M){if(!(M.pointerType==="mouse"&&M.srcEvent.button!==0)){var I=o(a);if(!(I&&!i(I.center))){var L=J("gesture.tap",{target:M.target,pointerType:M.pointerType,srcEvent:M.srcEvent,pointers:M.pointers.map(function(T){var B=r.relativeClientPosition(T),D=new f.Raycaster;return D.params.Points={threshold:.1},D.setFromCamera(B,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:B,raycaster:D}}),isFirst:!0,isFinal:!0,scale:M.scale,center:function(T){var B=r.relativeClientPosition(T),D=new f.Raycaster;return D.params.Points={threshold:.1},D.setFromCamera(B,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:B,raycaster:D}}(M.center),velocityX:M.velocityX,velocityY:M.velocityY,overallVelocityX:M.overallVelocityX,overallVelocityY:M.overallVelocityY,userAction:!0,state:O(O({mode:r.mode},r.currentPano),Je(r.camera.pose))});r.onTapGesture(L),b()}}}),a.on("pinchstart pinch pinchend",function(M){var I=o(a);if(!(I&&!i(I.center))){var L=J("gesture.pinch",{target:M.target,pointerType:M.pointerType,srcEvent:M.srcEvent,pointers:M.pointers.map(function(T){var B,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:(B=T.delta)!==null&&B!==void 0?B:0,buttons:0,coords:D,raycaster:V}}),isFirst:M.type==="pinchstart",isFinal:M.type==="pinchend",scale:M.scale,center:function(T){var B=r.relativeClientPosition(T),D=new f.Raycaster;return D.params.Points={threshold:.1},D.setFromCamera(B,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:B,raycaster:D}}(M.center),velocityX:M.velocityX,velocityY:M.velocityY,overallVelocityX:M.overallVelocityX,overallVelocityY:M.overallVelocityY,userAction:!0,state:O(O({mode:r.mode},r.currentPano),Je(r.camera.pose))});r.onPinchGesture(L),b()}}),a.on("dbltap",function(M){if(!(M.pointerType==="mouse"&&M.srcEvent.button!==0)){var I=o(a);if(!(I&&!i(I.center))){var L=J("gesture.dbltap",{target:M.target,pointerType:M.pointerType,srcEvent:M.srcEvent,pointers:M.pointers.map(function(T){var B=r.relativeClientPosition(T),D=new f.Raycaster;return D.params.Points={threshold:.1},D.setFromCamera(B,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:B,raycaster:D}}),isFirst:!0,isFinal:!0,scale:M.scale,center:function(T){var B=r.relativeClientPosition(T),D=new f.Raycaster;return D.params.Points={threshold:.1},D.setFromCamera(B,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:B,raycaster:D}}(M.center),velocityX:M.velocityX,velocityY:M.velocityY,overallVelocityX:M.overallVelocityX,overallVelocityY:M.overallVelocityY,userAction:!0,state:O(O({mode:r.mode},r.currentPano),Je(r.camera.pose))});r.onDblTapGesture(L),b()}}});var c=null,d=null,v=function(M,I,L){var T={x:L.clientX,y:L.clientY},B=r.relativeClientPosition(T),D=new f.Raycaster;D.params.Points={threshold:.1},D.setFromCamera(B,r.camera);var V=O(O({},T),{coords:B,raycaster:D,buttons:L.buttons,delta:0}),N=M==="pinchend"?I:I-L.deltaY/280,U=J("gesture.pinch",{target:L.target,pointerType:"mouse",srcEvent:L,pointers:[O({},V)],isFirst:M==="pinchstart",isFinal:M==="pinchend",scale:de(N,.1,10),center:O({},V),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:O(O({mode:r.mode},r.currentPano),Je(r.camera.pose))});return U},A=function(M){var I,L={x:M.clientX,y:M.clientY};if(i(L)){if(M.preventDefault(),M.ctrlKey){var T=(I=c==null?void 0:c.prevEvent.scale)!==null&&I!==void 0?I:1,B=v(c?"pinch":"pinchstart",T,M);c===null?c={firstEvent:B,prevEvent:B}:c.prevEvent=B,r.onPinchGesture(B),d!==null&&window.clearTimeout(d),d=window.setTimeout(function(){var j;d=null;var _=(j=c==null?void 0:c.prevEvent.scale)!==null&&j!==void 0?j:1,X=v("pinchend",_,M);c=null,r.onPinchGesture(X)},200)}else{var D=(Math.abs(M.deltaY)>Math.abs(M.deltaX)?M.deltaY:M.deltaX)/-60,V=r.mouseWheelState!==void 0,N={x:M.clientX,y:M.clientY},U=r.relativeClientPosition(N),H=new f.Raycaster;H.params.Points={threshold:.1},H.setFromCamera(U,r.camera);var G=O(O({},N),{coords:U,raycaster:H,buttons:M.buttons,delta:D}),B=J("gesture.mousewheel",{target:M.target,pointerType:"mouse",srcEvent:M,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),Je(r.camera.pose))});r.onMouseWheel(B),r.mouseWheelState&&clearTimeout(r.mouseWheelState.timer),r.mouseWheelState={timer:setTimeout(function(){delete r.mouseWheelState;var _=J("gesture.mousewheel",{target:M.target,pointerType:"mouse",srcEvent:M,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),Je(r.camera.pose))});r.onMouseWheel(_)},100)}}b()}},h=function(M){if(!Jn){if(!i({x:M.clientX,y:M.clientY})){p();return}var I=!1;r.mouseMoveState||(I=!0);var L={x:M.clientX,y:M.clientY},T=r.relativeClientPosition(L),B=new f.Raycaster;B.params.Points={threshold:.1},B.setFromCamera(T,r.camera);var D=O(O({},L),{coords:T,raycaster:B,buttons:M.buttons,delta:0}),V=J("gesture.mousemove",{target:M.target,pointerType:"mouse",srcEvent:M,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),Je(r.camera.pose))});r.mouseMoveState={timeStamp:he(),event:V},r.onMouseMove(V),r.pressState&&Math.abs(M.clientX-r.pressState.event.center.y)>10&&Math.abs(M.clientY-r.pressState.event.center.y)>10&&b()}},p=function(){if(r.mouseMoveState){var M=J(r.mouseMoveState.event.type,O(O({},r.mouseMoveState.event),{isFinal:!0}));delete r.mouseMoveState,r.onMouseMove(M)}b()},g=function(M){if(!i(M.center)){b();return}var I=!1;r.pressState||(I=!0,r.pressState={event:M,timeStamp:he(),stop:Q});var L=he()-r.pressState.timeStamp,T=J(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(B){return O(O({},B),{delta:L})})}));r.onPressGesture(T),r.pressState&&(r.pressState.stop=ht.shared.add(function(B){g(M)},!0,1))},m=function(M){if(b(),!(M.touches.length>1||M.changedTouches.length<=0)){var I={x:M.changedTouches[0].clientX,y:M.changedTouches[0].clientY},L=r.relativeClientPosition(I),T=new f.Raycaster;T.params.Points={threshold:.1},T.setFromCamera(L,r.camera);var B=O(O({},I),{coords:L,raycaster:T,buttons:0,delta:0}),D=J("gesture.press",{target:M.target,pointerType:"touch",srcEvent:M,pointers:[O({},B)],isFirst:!1,isFinal:!1,scale:0,center:B,velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:O(O({mode:r.mode},r.currentPano),Je(r.camera.pose))});g(D)}},y=function(M){b();var I={x:M.clientX,y:M.clientY},L=r.relativeClientPosition(I),T=new f.Raycaster;T.params.Points={threshold:.1},T.setFromCamera(L,r.camera);var B=O(O({},I),{coords:L,raycaster:T,buttons:M.buttons,delta:0}),D=J("gesture.press",{target:M.target,pointerType:"mouse",srcEvent:M,pointers:[O({},B)],isFirst:!1,isFinal:!1,scale:0,center:B,velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:O(O({mode:r.mode},r.currentPano),Je(r.camera.pose))});g(D)},b=function(){var M;if(r.pressState){var I=he()-r.pressState.timeStamp,L=J(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),(M=r.pressState)===null||M===void 0||M.stop(),delete r.pressState}},x=null,w=function(M){var I,L=!1,T=!1;switch(M.type){case"gesturestart":L=!0;break;case"gestureend":T=!0;break}var B={x:M.clientX,y:M.clientY},D=r.relativeClientPosition(B),V=new f.Raycaster;V.params.Points={threshold:.1},V.setFromCamera(D,r.camera);var N=O(O({},B),{coords:D,raycaster:V,buttons:0,delta:0}),U=J("gesture.pinch",{target:M.target,pointerType:"mouse",srcEvent:M,pointers:[O({},N)],isFirst:L,isFinal:T,scale:(I=M.scale)!==null&&I!==void 0?I:1,center:O({},N),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:O(O({mode:r.mode},r.currentPano),Je(r.camera.pose))});return U},E=function(M){if(M.preventDefault(),!Jn){var I=w(M);x={firstEvent:I};var L=x.firstEvent;L&&!i(L.center)||r.onPinchGesture(I)}},S=function(M){if(M.preventDefault(),!Jn&&x){var I=w(M),L=x.firstEvent;L&&!i(L.center)||r.onPinchGesture(I)}},C=function(M){if(M.preventDefault(),!Jn&&x){var I=w(M),L=x.firstEvent;x=null,!(L&&!i(L.center))&&r.onPinchGesture(I)}},R=function(M){if(M&&typeof M.preventDefault=="function"&&M.currentTarget===e&&M.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",p,!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",E,{passive:!1}),e.addEventListener("gesturechange",S,{passive:!1}),e.addEventListener("gestureend",C,{passive:!1}),e.addEventListener("touchstart",R,{passive:!1}),e.addEventListener("contextmenu",R,!1);var k=function(){a.destroy(),e.removeEventListener("wheel",A,!1),e.removeEventListener("mousemove",h,!1),e.removeEventListener("mouseout",p,!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",E,!1),e.removeEventListener("gesturechange",S,!1),e.removeEventListener("gestureend",C,!1),e.removeEventListener("touchstart",R,!1),e.removeEventListener("contextmenu",R,!1)};return Object.assign(k,{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(ze(e),".").concat(s)},Ut(i.imageOptions,["size","format","quality","mappings"])),l=a.images[s],c=hn(l,i.imageOptions.transform,u);return st(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(Ga);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(Ga);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(Ga),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(v){v.dispose()}),this.screenBuffers=[]),this.models.setMaterial({useEDL:!1,useHQDepth:!1,useHQWeight:!1})},t}(ra),Eo=function(n){se(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 Me({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 Me({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Me({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 v=n.parseArgs.call(this,e);return O(O({},v),{defaultLongitude:(r=e.defaultLongitude)!==null&&r!==void 0?r:Math.PI/4,defaultLatitude:(i=e.defaultLatitude)!==null&&i!==void 0?i:Math.PI/4,defaultFov:(a=e.defaultFov)!==null&&a!==void 0?a:80,maxFov:(o=e.maxFov)!==null&&o!==void 0?o:120,minFov:(s=e.minFov)!==null&&s!==void 0?s:20,maxLatitude:(u=e.maxLatitude)!==null&&u!==void 0?u:+Math.PI/2,minLatitude:(l=e.minLatitude)!==null&&l!==void 0?l:-Math.PI/2,modelInScreen:(c=e.modelInScreen)!==null&&c!==void 0?c:"boundingbox-center",intersectMeshCreator:(d=e.intersectMeshCreator)!==null&&d!==void 0?d:function(){return new aa}})},t.initAnimationEndState=function(e){var r,i,a,o,s,u,l,c=this.parseArgs(e),d=e.initial,v=d.state,A=d.currentState,h=typeof v.panoIndex=="number"?{workCode:(a=(r=v.workCode)!==null&&r!==void 0?r:(i=c.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:v.panoIndex}:{workCode:A.workCode,panoIndex:A.panoIndex},p=O(O({},h),{mode:"Floorplan",longitude:(o=v.longitude)!==null&&o!==void 0?o:yo(A.mode)?A.longitude:c.defaultLongitude,latitude:de((s=v.latitude)!==null&&s!==void 0?s:A.mode==="Floorplan"?A.latitude:c.defaultLatitude,c.minLatitude,c.maxLatitude),fov:(u=v.fov)!==null&&u!==void 0?u:c.defaultFov,offset:v.offset?v.offset.clone():e.models.bounding.getCenter(new f.Vector3),distance:(l=v.distance)!==null&&l!==void 0?l:t.distanceFromModel(c.models,c.defaultFov,c.camera.aspect)});return p},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.locationMotion.set({x:r.x,y:r.y,z:r.z,distance:i},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.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.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(de(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),Gt(i)||this.models.setMaterial(i),Gt(a)||this.setCamera(a)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(he())[1],r=this.locationMotion.getKeyFrameSegment(he())[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=Ut(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",J("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",J("initAnimation.end",{state:s,userAction:e.userAction}))},function(v){var A=O(O(O({},e.currentPano),{mode:e.mode}),Je(e.camera.pose));e.emit("initAnimation.end",J("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,v=r.models;d<v.length;d++){var A=v[d];if(A.visible&&((c=A.work)===null||c===void 0?void 0:c.workCode)===l.work.workCode)return!0}return!1}),o=mr(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=en(this.cameraMotion.value.longitude+u.longitude),d=de(this.cameraMotion.value.latitude+u.latitude,this.minLatitude,this.maxLatitude),v=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=J("gesture.momentum",O(O({},e),{isFirst:r,isFinal:A,state:v}));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:ht.shared.add(function(p,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=en(this.cameraMotion.value.longitude+u.longitude),c=de(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 v=e.velocityX*s,A=e.velocityY;this.inMomentumMovement={uuid:Mt()},this.requestMomentumMovement(e,!0,this.coordinatesForOffset({x:v,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=de(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=J("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=a.ray.origin.distanceTo(c),v=2*Math.tan(.5*this.camera.fov/180*Math.PI),A=Math.max(d*v/10,1);this.intersectMesh.scale.set(A,A,A);var h=c.clone().add(l);if(this.intersectMesh.lookAt(h),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=de(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",J("pano.select",{prevPano:this.currentPano,state:s,userAction:e.userAction,options:o,progress:0,error:null})),a&&a.active)){var u=this.currentTapId=Mt();this.preloadPano(a.pano).then(function(l){r.currentTapId===u&&r.emit("pano.request",J("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}(_o),Gv=function(n){se(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.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:Eo.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",J("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",J("initAnimation.end",{state:s,userAction:e.userAction}))},function(v){var A=O(O(O({},e.currentPano),{mode:e.mode}),Je(e.camera.pose));e.emit("initAnimation.end",J("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 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=de(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=de(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}(Eo),Ml=function(n){se(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:0,defaultFov:(i=e.defaultFov)!==null&&i!==void 0?i:90,maxFov:(a=e.maxFov)!==null&&a!==void 0?a:120,minFov:(o=e.minFov)!==null&&o!==void 0?o:20,maxLatitude:(s=e.maxLatitude)!==null&&s!==void 0?s:+Math.PI/2,minLatitude:(u=e.minLatitude)!==null&&u!==void 0?u:-Math.PI/2,moveSpeed:(l=e.moveSpeed)!==null&&l!==void 0?l:3.4,intersectMeshCreator:(c=e.intersectMeshCreator)!==null&&c!==void 0?c:function(){return new aa}})},t.initAnimationEndState=function(e){var r,i,a,o,s,u,l=this.parseArgs(e),c=l.works,d=e.initial,v=d.state,A=d.currentState,h=typeof v.panoIndex=="number"?{workCode:(a=(r=v.workCode)!==null&&r!==void 0?r:(i=l.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:v.panoIndex}:{workCode:A.workCode,panoIndex:A.panoIndex},p=c.getResolvedObserver(h),g=(o=v.longitude)!==null&&o!==void 0?o:A.longitude,m=de((s=v.latitude)!==null&&s!==void 0?s:ui(A.mode)?A.latitude:l.defaultLatitude,l.minLatitude,l.maxLatitude),y=de((u=v.fov)!==null&&u!==void 0?u:ui(A.mode)?A.fov:l.defaultFov,l.minFov,l.maxFov),b=p?p.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.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 de(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=en(this.cameraMotion.value.longitude+u.longitude),d=de(this.cameraMotion.value.latitude+u.latitude,this.minLatitude,this.maxLatitude),v=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=J("gesture.momentum",O(O({},e),{isFirst:r,isFinal:A,state:v}));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:ht.shared.add(function(p,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=en(this.cameraMotion.value.longitude+o.longitude),u=de(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,v=e.velocityY*.6;Math.abs(v)>.5&&Math.abs(d)<.5&&(d=0),this.inMomentumMovement={uuid:Mt()},this.requestMomentumMovement(e,!0,this.coordinatesForOffset({x:d,y:v}),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=de(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=de(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=J("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 v=this.camera.position.clone().sub(c);this.intersectMesh.rotation.z=-Math.atan2(v.z,v.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).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AGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw",Ka;function Cl(){return Ka||(Ka=new Promise(function(n){var t,e=document.createElement("video");e.muted=!0,e.src=Kv,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 jv=`
1473
+ `,Hv=new f.OrthographicCamera(-1,1,1,-1,0,1),jo=new f.BufferGeometry;jo.setAttribute("position",new f.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));jo.setAttribute("uv",new f.Float32BufferAttribute([0,2,0,0,2,0],2));var El=new f.MeshBasicMaterial,wo=new f.Mesh(jo,El),Sl=new f.Scene;Sl.add(wo);var qv=function(){function n(t){this.renderer=t,this.material=new f.ShaderMaterial({vertexShader:Uv,fragmentShader:Qv,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,wo.material=this.material,this.renderer.setRenderTarget(e||null),this.renderer.render(Sl,Hv),this.renderer.setRenderTarget(r),wo.material=El},n.prototype.dispose=function(){this.material.dispose()},n}(),Ga=new f.Vector2,Jo=function(n){se(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 Me({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(v){return l.bindEvents(v)}),l.pending.add("init-animation"),l.initAnimationReady=new Promise(function(v){ht.shared.add(function(){l.initAnimation().then(function(){l.pending.delete("init-animation"),v()})},!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 wl(l.renderer),l.depthCopyPass=new qv(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),v=d.initial,A=v.state,h=v.currentState,p=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({},p),{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.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),Gt(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(he())[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",_("initAnimation.start",{state:i,userAction:this.userAction})),this.emit("initAnimation.end",_("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,v=(s=e.offset)!==null&&s!==void 0?s:this.camera.pose.offset,A=Dt(u,this.camera.pose.longitude,Math.PI*2)||Dt(l,this.camera.pose.latitude),h=Dt(c,this.camera.pose.fov),p=Dt(d,this.camera.pose.distance),g=qi(v,this.camera.pose.offset);(h||A||g||p)&&(this.camera.setFromPose({longitude:u,latitude:l,fov:c,distance:d,offset:v}),this.emit("camera.update",_("camera.update",{userAction:this.userAction,state:O(O({},this.currentPano),{mode:this.mode,longitude:u,latitude:l,fov:c,offset:v,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=_("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 A0(e,this.element,this.scissor)},t.prototype.bindEvents=function(e){var r=this,i=function(M){var I=A0(M,r.element,r.scissor);return!(Math.abs(I.x)>1||Math.abs(I.y)>1)},a=new Xn.Manager(e),o=function(M){var I=M.session;return I.firstInput||null},s=new Xn.Pan({threshold:10,pointers:0}),u=new Xn.Tap({interval:410}),l=new Xn.Pinch({threshold:0,pointers:2});a.add([s,u,l]),a.on("panstart pan",function(M){var I=o(a);if(!(I&&!i(I.center))){var L=_("gesture.pan",{target:M.target,pointerType:M.pointerType,srcEvent:M.srcEvent,pointers:M.pointers.map(function(T){var B=r.relativeClientPosition(T),D=new f.Raycaster;return D.params.Points={threshold:.1},D.setFromCamera(B,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:B,raycaster:D}}),isFirst:M.isFirst,isFinal:M.isFinal,scale:M.scale,center:function(T){var B=r.relativeClientPosition(T),D=new f.Raycaster;return D.params.Points={threshold:.1},D.setFromCamera(B,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:B,raycaster:D}}(M.center),velocityX:M.velocityX,velocityY:M.velocityY,overallVelocityX:M.overallVelocityX,overallVelocityY:M.overallVelocityY,userAction:!0,state:O(O({mode:r.mode},r.currentPano),_e(r.camera.pose))});r.onPanGesture(L),b()}}),a.on("tap",function(M){if(!(M.pointerType==="mouse"&&M.srcEvent.button!==0)){var I=o(a);if(!(I&&!i(I.center))){var L=_("gesture.tap",{target:M.target,pointerType:M.pointerType,srcEvent:M.srcEvent,pointers:M.pointers.map(function(T){var B=r.relativeClientPosition(T),D=new f.Raycaster;return D.params.Points={threshold:.1},D.setFromCamera(B,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:B,raycaster:D}}),isFirst:!0,isFinal:!0,scale:M.scale,center:function(T){var B=r.relativeClientPosition(T),D=new f.Raycaster;return D.params.Points={threshold:.1},D.setFromCamera(B,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:B,raycaster:D}}(M.center),velocityX:M.velocityX,velocityY:M.velocityY,overallVelocityX:M.overallVelocityX,overallVelocityY:M.overallVelocityY,userAction:!0,state:O(O({mode:r.mode},r.currentPano),_e(r.camera.pose))});r.onTapGesture(L),b()}}}),a.on("pinchstart pinch pinchend",function(M){var I=o(a);if(!(I&&!i(I.center))){var L=_("gesture.pinch",{target:M.target,pointerType:M.pointerType,srcEvent:M.srcEvent,pointers:M.pointers.map(function(T){var B,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:(B=T.delta)!==null&&B!==void 0?B:0,buttons:0,coords:D,raycaster:V}}),isFirst:M.type==="pinchstart",isFinal:M.type==="pinchend",scale:M.scale,center:function(T){var B=r.relativeClientPosition(T),D=new f.Raycaster;return D.params.Points={threshold:.1},D.setFromCamera(B,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:B,raycaster:D}}(M.center),velocityX:M.velocityX,velocityY:M.velocityY,overallVelocityX:M.overallVelocityX,overallVelocityY:M.overallVelocityY,userAction:!0,state:O(O({mode:r.mode},r.currentPano),_e(r.camera.pose))});r.onPinchGesture(L),b()}}),a.on("dbltap",function(M){if(!(M.pointerType==="mouse"&&M.srcEvent.button!==0)){var I=o(a);if(!(I&&!i(I.center))){var L=_("gesture.dbltap",{target:M.target,pointerType:M.pointerType,srcEvent:M.srcEvent,pointers:M.pointers.map(function(T){var B=r.relativeClientPosition(T),D=new f.Raycaster;return D.params.Points={threshold:.1},D.setFromCamera(B,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:B,raycaster:D}}),isFirst:!0,isFinal:!0,scale:M.scale,center:function(T){var B=r.relativeClientPosition(T),D=new f.Raycaster;return D.params.Points={threshold:.1},D.setFromCamera(B,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:B,raycaster:D}}(M.center),velocityX:M.velocityX,velocityY:M.velocityY,overallVelocityX:M.overallVelocityX,overallVelocityY:M.overallVelocityY,userAction:!0,state:O(O({mode:r.mode},r.currentPano),_e(r.camera.pose))});r.onDblTapGesture(L),b()}}});var c=null,d=null,v=function(M,I,L){var T={x:L.clientX,y:L.clientY},B=r.relativeClientPosition(T),D=new f.Raycaster;D.params.Points={threshold:.1},D.setFromCamera(B,r.camera);var V=O(O({},T),{coords:B,raycaster:D,buttons:L.buttons,delta:0}),N=M==="pinchend"?I:I-L.deltaY/280,U=_("gesture.pinch",{target:L.target,pointerType:"mouse",srcEvent:L,pointers:[O({},V)],isFirst:M==="pinchstart",isFinal:M==="pinchend",scale:de(N,.1,10),center:O({},V),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:O(O({mode:r.mode},r.currentPano),_e(r.camera.pose))});return U},A=function(M){var I,L={x:M.clientX,y:M.clientY};if(i(L)){if(M.preventDefault(),M.ctrlKey){var T=(I=c==null?void 0:c.prevEvent.scale)!==null&&I!==void 0?I:1,B=v(c?"pinch":"pinchstart",T,M);c===null?c={firstEvent:B,prevEvent:B}:c.prevEvent=B,r.onPinchGesture(B),d!==null&&window.clearTimeout(d),d=window.setTimeout(function(){var j;d=null;var J=(j=c==null?void 0:c.prevEvent.scale)!==null&&j!==void 0?j:1,X=v("pinchend",J,M);c=null,r.onPinchGesture(X)},200)}else{var D=(Math.abs(M.deltaY)>Math.abs(M.deltaX)?M.deltaY:M.deltaX)/-60,V=r.mouseWheelState!==void 0,N={x:M.clientX,y:M.clientY},U=r.relativeClientPosition(N),H=new f.Raycaster;H.params.Points={threshold:.1},H.setFromCamera(U,r.camera);var G=O(O({},N),{coords:U,raycaster:H,buttons:M.buttons,delta:D}),B=_("gesture.mousewheel",{target:M.target,pointerType:"mouse",srcEvent:M,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),_e(r.camera.pose))});r.onMouseWheel(B),r.mouseWheelState&&clearTimeout(r.mouseWheelState.timer),r.mouseWheelState={timer:setTimeout(function(){delete r.mouseWheelState;var J=_("gesture.mousewheel",{target:M.target,pointerType:"mouse",srcEvent:M,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),_e(r.camera.pose))});r.onMouseWheel(J)},100)}}b()}},h=function(M){if(!_n){if(!i({x:M.clientX,y:M.clientY})){p();return}var I=!1;r.mouseMoveState||(I=!0);var L={x:M.clientX,y:M.clientY},T=r.relativeClientPosition(L),B=new f.Raycaster;B.params.Points={threshold:.1},B.setFromCamera(T,r.camera);var D=O(O({},L),{coords:T,raycaster:B,buttons:M.buttons,delta:0}),V=_("gesture.mousemove",{target:M.target,pointerType:"mouse",srcEvent:M,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),_e(r.camera.pose))});r.mouseMoveState={timeStamp:he(),event:V},r.onMouseMove(V),r.pressState&&Math.abs(M.clientX-r.pressState.event.center.y)>10&&Math.abs(M.clientY-r.pressState.event.center.y)>10&&b()}},p=function(){if(r.mouseMoveState){var M=_(r.mouseMoveState.event.type,O(O({},r.mouseMoveState.event),{isFinal:!0}));delete r.mouseMoveState,r.onMouseMove(M)}b()},g=function(M){if(!i(M.center)){b();return}var I=!1;r.pressState||(I=!0,r.pressState={event:M,timeStamp:he(),stop:Q});var L=he()-r.pressState.timeStamp,T=_(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(B){return O(O({},B),{delta:L})})}));r.onPressGesture(T),r.pressState&&(r.pressState.stop=ht.shared.add(function(B){g(M)},!0,1))},m=function(M){if(b(),!(M.touches.length>1||M.changedTouches.length<=0)){var I={x:M.changedTouches[0].clientX,y:M.changedTouches[0].clientY},L=r.relativeClientPosition(I),T=new f.Raycaster;T.params.Points={threshold:.1},T.setFromCamera(L,r.camera);var B=O(O({},I),{coords:L,raycaster:T,buttons:0,delta:0}),D=_("gesture.press",{target:M.target,pointerType:"touch",srcEvent:M,pointers:[O({},B)],isFirst:!1,isFinal:!1,scale:0,center:B,velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:O(O({mode:r.mode},r.currentPano),_e(r.camera.pose))});g(D)}},y=function(M){b();var I={x:M.clientX,y:M.clientY},L=r.relativeClientPosition(I),T=new f.Raycaster;T.params.Points={threshold:.1},T.setFromCamera(L,r.camera);var B=O(O({},I),{coords:L,raycaster:T,buttons:M.buttons,delta:0}),D=_("gesture.press",{target:M.target,pointerType:"mouse",srcEvent:M,pointers:[O({},B)],isFirst:!1,isFinal:!1,scale:0,center:B,velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:O(O({mode:r.mode},r.currentPano),_e(r.camera.pose))});g(D)},b=function(){var M;if(r.pressState){var I=he()-r.pressState.timeStamp,L=_(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),(M=r.pressState)===null||M===void 0||M.stop(),delete r.pressState}},x=null,w=function(M){var I,L=!1,T=!1;switch(M.type){case"gesturestart":L=!0;break;case"gestureend":T=!0;break}var B={x:M.clientX,y:M.clientY},D=r.relativeClientPosition(B),V=new f.Raycaster;V.params.Points={threshold:.1},V.setFromCamera(D,r.camera);var N=O(O({},B),{coords:D,raycaster:V,buttons:0,delta:0}),U=_("gesture.pinch",{target:M.target,pointerType:"mouse",srcEvent:M,pointers:[O({},N)],isFirst:L,isFinal:T,scale:(I=M.scale)!==null&&I!==void 0?I:1,center:O({},N),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:O(O({mode:r.mode},r.currentPano),_e(r.camera.pose))});return U},E=function(M){if(M.preventDefault(),!_n){var I=w(M);x={firstEvent:I};var L=x.firstEvent;L&&!i(L.center)||r.onPinchGesture(I)}},S=function(M){if(M.preventDefault(),!_n&&x){var I=w(M),L=x.firstEvent;L&&!i(L.center)||r.onPinchGesture(I)}},C=function(M){if(M.preventDefault(),!_n&&x){var I=w(M),L=x.firstEvent;x=null,!(L&&!i(L.center))&&r.onPinchGesture(I)}},R=function(M){if(M&&typeof M.preventDefault=="function"&&M.currentTarget===e&&M.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",p,!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",E,{passive:!1}),e.addEventListener("gesturechange",S,{passive:!1}),e.addEventListener("gestureend",C,{passive:!1}),e.addEventListener("touchstart",R,{passive:!1}),e.addEventListener("contextmenu",R,!1);var k=function(){a.destroy(),e.removeEventListener("wheel",A,!1),e.removeEventListener("mousemove",h,!1),e.removeEventListener("mouseout",p,!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",E,!1),e.removeEventListener("gesturechange",S,!1),e.removeEventListener("gestureend",C,!1),e.removeEventListener("touchstart",R,!1),e.removeEventListener("contextmenu",R,!1)};return Object.assign(k,{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(ze(e),".").concat(s)},Ut(i.imageOptions,["size","format","quality","mappings"])),l=a.images[s],c=hn(l,i.imageOptions.transform,u);return st(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(Ga);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(Ga);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(Ga),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(v){v.dispose()}),this.screenBuffers=[]),this.models.setMaterial({useEDL:!1,useHQDepth:!1,useHQWeight:!1})},t}(ra),Eo=function(n){se(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 Me({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 Me({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Me({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 v=n.parseArgs.call(this,e);return O(O({},v),{defaultLongitude:(r=e.defaultLongitude)!==null&&r!==void 0?r:Math.PI/4,defaultLatitude:(i=e.defaultLatitude)!==null&&i!==void 0?i:Math.PI/4,defaultFov:(a=e.defaultFov)!==null&&a!==void 0?a:80,maxFov:(o=e.maxFov)!==null&&o!==void 0?o:120,minFov:(s=e.minFov)!==null&&s!==void 0?s:20,maxLatitude:(u=e.maxLatitude)!==null&&u!==void 0?u:+Math.PI/2,minLatitude:(l=e.minLatitude)!==null&&l!==void 0?l:-Math.PI/2,modelInScreen:(c=e.modelInScreen)!==null&&c!==void 0?c:"boundingbox-center",intersectMeshCreator:(d=e.intersectMeshCreator)!==null&&d!==void 0?d:function(){return new aa}})},t.initAnimationEndState=function(e){var r,i,a,o,s,u,l,c=this.parseArgs(e),d=e.initial,v=d.state,A=d.currentState,h=typeof v.panoIndex=="number"?{workCode:(a=(r=v.workCode)!==null&&r!==void 0?r:(i=c.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:v.panoIndex}:{workCode:A.workCode,panoIndex:A.panoIndex},p=O(O({},h),{mode:"Floorplan",longitude:(o=v.longitude)!==null&&o!==void 0?o:yo(A.mode)?A.longitude:c.defaultLongitude,latitude:de((s=v.latitude)!==null&&s!==void 0?s:A.mode==="Floorplan"?A.latitude:c.defaultLatitude,c.minLatitude,c.maxLatitude),fov:(u=v.fov)!==null&&u!==void 0?u:c.defaultFov,offset:v.offset?v.offset.clone():e.models.bounding.getCenter(new f.Vector3),distance:(l=v.distance)!==null&&l!==void 0?l:t.distanceFromModel(c.models,c.defaultFov,c.camera.aspect)});return p},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.locationMotion.set({x:r.x,y:r.y,z:r.z,distance:i},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.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.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(de(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),Gt(i)||this.models.setMaterial(i),Gt(a)||this.setCamera(a)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(he())[1],r=this.locationMotion.getKeyFrameSegment(he())[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=Ut(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",_("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",_("initAnimation.end",{state:s,userAction:e.userAction}))},function(v){var A=O(O(O({},e.currentPano),{mode:e.mode}),_e(e.camera.pose));e.emit("initAnimation.end",_("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,v=r.models;d<v.length;d++){var A=v[d];if(A.visible&&((c=A.work)===null||c===void 0?void 0:c.workCode)===l.work.workCode)return!0}return!1}),o=mr(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=en(this.cameraMotion.value.longitude+u.longitude),d=de(this.cameraMotion.value.latitude+u.latitude,this.minLatitude,this.maxLatitude),v=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=_("gesture.momentum",O(O({},e),{isFirst:r,isFinal:A,state:v}));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:ht.shared.add(function(p,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=en(this.cameraMotion.value.longitude+u.longitude),c=de(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 v=e.velocityX*s,A=e.velocityY;this.inMomentumMovement={uuid:Mt()},this.requestMomentumMovement(e,!0,this.coordinatesForOffset({x:v,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=de(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=_("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=a.ray.origin.distanceTo(c),v=2*Math.tan(.5*this.camera.fov/180*Math.PI),A=Math.max(d*v/10,1);this.intersectMesh.scale.set(A,A,A);var h=c.clone().add(l);if(this.intersectMesh.lookAt(h),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=de(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",_("pano.select",{prevPano:this.currentPano,state:s,userAction:e.userAction,options:o,progress:0,error:null})),a&&a.active)){var u=this.currentTapId=Mt();this.preloadPano(a.pano).then(function(l){r.currentTapId===u&&r.emit("pano.request",_("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}(Jo),Gv=function(n){se(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.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:Eo.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",_("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",_("initAnimation.end",{state:s,userAction:e.userAction}))},function(v){var A=O(O(O({},e.currentPano),{mode:e.mode}),_e(e.camera.pose));e.emit("initAnimation.end",_("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 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=de(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=de(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}(Eo),Ml=function(n){se(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:0,defaultFov:(i=e.defaultFov)!==null&&i!==void 0?i:90,maxFov:(a=e.maxFov)!==null&&a!==void 0?a:120,minFov:(o=e.minFov)!==null&&o!==void 0?o:20,maxLatitude:(s=e.maxLatitude)!==null&&s!==void 0?s:+Math.PI/2,minLatitude:(u=e.minLatitude)!==null&&u!==void 0?u:-Math.PI/2,moveSpeed:(l=e.moveSpeed)!==null&&l!==void 0?l:3.4,intersectMeshCreator:(c=e.intersectMeshCreator)!==null&&c!==void 0?c:function(){return new aa}})},t.initAnimationEndState=function(e){var r,i,a,o,s,u,l=this.parseArgs(e),c=l.works,d=e.initial,v=d.state,A=d.currentState,h=typeof v.panoIndex=="number"?{workCode:(a=(r=v.workCode)!==null&&r!==void 0?r:(i=l.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:v.panoIndex}:{workCode:A.workCode,panoIndex:A.panoIndex},p=c.getResolvedObserver(h),g=(o=v.longitude)!==null&&o!==void 0?o:A.longitude,m=de((s=v.latitude)!==null&&s!==void 0?s:ui(A.mode)?A.latitude:l.defaultLatitude,l.minLatitude,l.maxLatitude),y=de((u=v.fov)!==null&&u!==void 0?u:ui(A.mode)?A.fov:l.defaultFov,l.minFov,l.maxFov),b=p?p.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.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 de(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=en(this.cameraMotion.value.longitude+u.longitude),d=de(this.cameraMotion.value.latitude+u.latitude,this.minLatitude,this.maxLatitude),v=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=_("gesture.momentum",O(O({},e),{isFirst:r,isFinal:A,state:v}));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:ht.shared.add(function(p,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=en(this.cameraMotion.value.longitude+o.longitude),u=de(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,v=e.velocityY*.6;Math.abs(v)>.5&&Math.abs(d)<.5&&(d=0),this.inMomentumMovement={uuid:Mt()},this.requestMomentumMovement(e,!0,this.coordinatesForOffset({x:d,y:v}),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=de(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=de(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=_("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 v=this.camera.position.clone().sub(c);this.intersectMesh.rotation.z=-Math.atan2(v.z,v.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}(Jo),Kv="data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz02IGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmcmFtZXM9MCB3ZWlnaHRwPTAga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9M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AAABAAAABwAAAAIAAAABAAAACAAAAAEAAAABAAAACQAAAAIAAAABAAAACgAAAAEAAAABAAAACwAAAAIAAAABAAAADQAAAAEAAAABAAAADgAAAAIAAAABAAAADwAAAAEAAAABAAAAEAAAAAIAAAABAAAAEQAAAAEAAAABAAAAEgAAAAIAAAABAAAAFAAAAAEAAAABAAAAFQAAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw",Ka;function Cl(){return Ka||(Ka=new Promise(function(n){var t,e=document.createElement("video");e.muted=!0,e.src=Kv,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 jv=`
1474
1474
  #include <common>
1475
1475
  uniform sampler2D inputBuffer;
1476
1476
  uniform float scale;
@@ -1483,7 +1483,7 @@ void main() {
1483
1483
  float luminance = clamp(linearToRelativeLuminance(rgb), 0.1, 0.9);
1484
1484
  gl_FragColor = vec4(luminance);
1485
1485
  }
1486
- `,_v=function(n){se(t,n);function t(e,r){return r===void 0&&(r=.5),n.call(this,e,{uniforms:{inputBuffer:new f.Uniform(null),scale:new f.Uniform(r)},fragment:jv})||this}return t}(oa),Jo=function(){function n(t,e,r,i){this.enable=!0,this.renderer=t,this.camera=r,this.models=i,this.scene=e,this.copyPass=new wl(this.renderer)}return n.prototype.render=function(t,e){},n.prototype.dispose=function(){this.copyPass.dispose()},n}(),Jv=function(n){se(t,n);function t(e,r){r===void 0&&(r=.002);var i=n.call(this,e,{uniforms:{targetBuffer:new f.Uniform(null),inputBuffer:new f.Uniform(null),step:new f.Uniform(r)},fragment:`
1486
+ `,Jv=function(n){se(t,n);function t(e,r){return r===void 0&&(r=.5),n.call(this,e,{uniforms:{inputBuffer:new f.Uniform(null),scale:new f.Uniform(r)},fragment:jv})||this}return t}(oa),_o=function(){function n(t,e,r,i){this.enable=!0,this.renderer=t,this.camera=r,this.models=i,this.scene=e,this.copyPass=new wl(this.renderer)}return n.prototype.render=function(t,e){},n.prototype.dispose=function(){this.copyPass.dispose()},n}(),_v=function(n){se(t,n);function t(e,r){r===void 0&&(r=.002);var i=n.call(this,e,{uniforms:{targetBuffer:new f.Uniform(null),inputBuffer:new f.Uniform(null),step:new f.Uniform(r)},fragment:`
1487
1487
  uniform sampler2D targetBuffer;
1488
1488
  uniform sampler2D inputBuffer;
1489
1489
  uniform float step;
@@ -1533,7 +1533,7 @@ void main() {
1533
1533
  rgb = clamp(lumCompressed * rgb, 0.0, 1.0);
1534
1534
  gl_FragColor = mix(inputColor, vec4(rgb, alpha), progress * 0.9);
1535
1535
  }
1536
- `})||this;return r.material.transparent=!0,r}return Object.defineProperty(t.prototype,"luminanceAdaptiveBuffer",{get:function(){return this.material.uniforms.luminanceAdaptiveBuffer.value},set:function(e){this.material.uniforms.luminanceAdaptiveBuffer.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"progress",{get:function(){return this.material.uniforms.progress.value},set:function(e){this.material.uniforms.progress.value=e},enumerable:!1,configurable:!0}),t}(oa),g0=function(n){se(t,n);function t(e,r,i,a){var o=n.call(this,e,r,i,a)||this;return o.enableTime=he(),o.renderer=e,o.valuePass=new zv(o.renderer),o.luminancePass=new _v(o.renderer,Math.sqrt(1/3)),o.nextStepPass=new Jv(o.renderer,.01),o.luminanceAdaptivePass=new Xv(o.renderer),o}return t.prototype.render=function(e){this.renderer.setRenderTarget(e[0]),this.renderer.render(this.scene,this.camera),this.enableTime===null&&(this.enableTime=he()),this.luminanceTargetBuffer||(this.luminanceTargetBuffer=new f.WebGLRenderTarget(128,128,{minFilter:f.LinearMipmapLinearFilter,magFilter:f.LinearFilter,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1,format:f.RGBAFormat,generateMipmaps:!0}),this.nextStepPass.targetBuffer=this.luminanceTargetBuffer.texture),this.luminancePass.render(e[0],this.luminanceTargetBuffer),this.luminancePrevBuffer||(this.luminancePrevBuffer=new f.WebGLRenderTarget(1,1,{minFilter:f.NearestFilter,magFilter:f.NearestFilter,type:f.HalfFloatType,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1}),this.valuePass.render(new f.Vector3(.5,.5,.5),this.luminancePrevBuffer)),this.luminanceNextBuffer||(this.luminanceNextBuffer=new f.WebGLRenderTarget(1,1,{minFilter:f.NearestFilter,magFilter:f.NearestFilter,type:f.HalfFloatType,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1}),this.valuePass.render(new f.Vector3(.5,.5,.5),this.luminanceNextBuffer),this.luminanceAdaptivePass.luminanceAdaptiveBuffer=this.luminanceNextBuffer.texture),this.copyPass.render(this.luminanceNextBuffer,this.luminancePrevBuffer),this.nextStepPass.render(this.luminancePrevBuffer,this.luminanceNextBuffer),this.luminanceAdaptivePass.progress=Math.min((he()-this.enableTime)/100,1),this.luminanceAdaptivePass.render(e[0],e[1])},t.prototype.dispose=function(){var e,r,i;(e=this.luminanceTargetBuffer)===null||e===void 0||e.dispose(),(r=this.luminancePrevBuffer)===null||r===void 0||r.dispose(),(i=this.luminanceNextBuffer)===null||i===void 0||i.dispose(),this.copyPass.dispose(),this.luminancePass.dispose(),this.nextStepPass.dispose(),this.luminanceAdaptivePass.dispose()},t}(Jo),ja,y0=new f.Vector3,Wv=64,_r=(ja=Math.SQRT1_2)!==null&&ja!==void 0?ja:Math.sqrt(2),Zv={up:new f.Quaternion(_r,0,0,_r),down:new f.Quaternion(-_r,0,0,_r),left:new f.Quaternion(0,_r,0,_r),right:new f.Quaternion(0,-_r,0,_r),front:new f.Quaternion(0,0,0,1),back:new f.Quaternion(0,1,0,0)},Yv=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),$v=new Float32Array([0,0,1,0,0,1,1,1]),em=new Uint8Array([0,1,2,1,3,2]),sa=new f.BufferGeometry;sa.setAttribute("position",new f.BufferAttribute(Yv,3));sa.setAttribute("uv",new f.BufferAttribute($v,2));sa.setIndex(new f.BufferAttribute(em,1));var tm=`
1536
+ `})||this;return r.material.transparent=!0,r}return Object.defineProperty(t.prototype,"luminanceAdaptiveBuffer",{get:function(){return this.material.uniforms.luminanceAdaptiveBuffer.value},set:function(e){this.material.uniforms.luminanceAdaptiveBuffer.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"progress",{get:function(){return this.material.uniforms.progress.value},set:function(e){this.material.uniforms.progress.value=e},enumerable:!1,configurable:!0}),t}(oa),g0=function(n){se(t,n);function t(e,r,i,a){var o=n.call(this,e,r,i,a)||this;return o.enableTime=he(),o.renderer=e,o.valuePass=new zv(o.renderer),o.luminancePass=new Jv(o.renderer,Math.sqrt(1/3)),o.nextStepPass=new _v(o.renderer,.01),o.luminanceAdaptivePass=new Xv(o.renderer),o}return t.prototype.render=function(e){this.renderer.setRenderTarget(e[0]),this.renderer.render(this.scene,this.camera),this.enableTime===null&&(this.enableTime=he()),this.luminanceTargetBuffer||(this.luminanceTargetBuffer=new f.WebGLRenderTarget(128,128,{minFilter:f.LinearMipmapLinearFilter,magFilter:f.LinearFilter,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1,format:f.RGBAFormat,generateMipmaps:!0}),this.nextStepPass.targetBuffer=this.luminanceTargetBuffer.texture),this.luminancePass.render(e[0],this.luminanceTargetBuffer),this.luminancePrevBuffer||(this.luminancePrevBuffer=new f.WebGLRenderTarget(1,1,{minFilter:f.NearestFilter,magFilter:f.NearestFilter,type:f.HalfFloatType,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1}),this.valuePass.render(new f.Vector3(.5,.5,.5),this.luminancePrevBuffer)),this.luminanceNextBuffer||(this.luminanceNextBuffer=new f.WebGLRenderTarget(1,1,{minFilter:f.NearestFilter,magFilter:f.NearestFilter,type:f.HalfFloatType,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1}),this.valuePass.render(new f.Vector3(.5,.5,.5),this.luminanceNextBuffer),this.luminanceAdaptivePass.luminanceAdaptiveBuffer=this.luminanceNextBuffer.texture),this.copyPass.render(this.luminanceNextBuffer,this.luminancePrevBuffer),this.nextStepPass.render(this.luminancePrevBuffer,this.luminanceNextBuffer),this.luminanceAdaptivePass.progress=Math.min((he()-this.enableTime)/100,1),this.luminanceAdaptivePass.render(e[0],e[1])},t.prototype.dispose=function(){var e,r,i;(e=this.luminanceTargetBuffer)===null||e===void 0||e.dispose(),(r=this.luminancePrevBuffer)===null||r===void 0||r.dispose(),(i=this.luminanceNextBuffer)===null||i===void 0||i.dispose(),this.copyPass.dispose(),this.luminancePass.dispose(),this.nextStepPass.dispose(),this.luminanceAdaptivePass.dispose()},t}(_o),ja,y0=new f.Vector3,Wv=64,Jr=(ja=Math.SQRT1_2)!==null&&ja!==void 0?ja:Math.sqrt(2),Zv={up:new f.Quaternion(Jr,0,0,Jr),down:new f.Quaternion(-Jr,0,0,Jr),left:new f.Quaternion(0,Jr,0,Jr),right:new f.Quaternion(0,-Jr,0,Jr),front:new f.Quaternion(0,0,0,1),back:new f.Quaternion(0,1,0,0)},Yv=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),$v=new Float32Array([0,0,1,0,0,1,1,1]),em=new Uint8Array([0,1,2,1,3,2]),sa=new f.BufferGeometry;sa.setAttribute("position",new f.BufferAttribute(Yv,3));sa.setAttribute("uv",new f.BufferAttribute($v,2));sa.setIndex(new f.BufferAttribute(em,1));var tm=`
1537
1537
  uniform float flipY;
1538
1538
  varying vec2 vUv;
1539
1539
  void main() {
@@ -1589,7 +1589,7 @@ void main() {
1589
1589
  gl_FragColor = vec4(videoColor.rgb, match * blendAlpha * alpha);
1590
1590
  #endif
1591
1591
  }
1592
- `,fm=function(){function n(){this.material=new f.ShaderMaterial({vertexShader:lm,fragmentShader:cm,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(Xo,this.material),this.object.visible=!1,this.object.renderOrder=-1,this.object.frustumCulled=!1,this.object.name="pano-video",this.alphaMotion=new Me({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}(),dm=new f.Matrix4().makeRotationAxis(new f.Vector3(0,1,0),Math.PI),b0=new f.Vector3(-1,1,1),x0=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}(),Wo=function(n){se(t,n);function t(e){var r=this,i,a,o,s,u=t.parseArgs(e);r=n.call(this,u)||this,r.TILED_CUBE_TEXTURE_LEVEL=2,r.mode="Panorama",r.tileLevel=0,r.initAnimationed=!1,r.maxAccessibleDistance=u.maxAccessibleDistance,r.panoTapTriggerRadius=u.panoTapTriggerRadius,r.panoCircleMeshCreator=u.panoCircleMeshCreator,r.tileLevelForFov=u.tileLevelForFov,r.tileMaxRequest=u.tileMaxRequest,r.luminanceAdaptiveEffectEnable=u.luminanceAdaptiveEffectEnable,r.luminanceAdaptiveEffect=new g0(r.renderer,r.modelScene,r.camera,r.models),r.colorCubeRenderTargetPool=new x0,r.luminanceCubeRenderTargetPool=new x0;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 Ve&&c.map.cubeRenderTarget&&r.colorCubeRenderTargetPool.push(c.map.cubeRenderTarget),c.luminanceMap&&(c.luminanceMap.dispose(),c.luminanceMap instanceof Ve&&c.luminanceMap.cubeRenderTarget&&r.luminanceCubeRenderTargetPool.push(c.luminanceMap.cubeRenderTarget)));for(var v=r.colorCubeRenderTargetPool.size;v<2;v++){var A=Math.max(1024*r.TILED_CUBE_TEXTURE_LEVEL,512),h=r.colorCubeRenderTargetPool.create();h.setSize(A,A),oo(null,h,r.renderer),r.colorCubeRenderTargetPool.push(h)}r.panoMeshes={},r.updatePanoMeshes(),r.locationMotion=new Me({count:0,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Me({modelAlpha:(a=(i=r.models.getMaterial())===null||i===void 0?void 0:i.modelAlpha)!==null&&a!==void 0?a:0}),r.perspToOrthoMotion=new Me({perspToOrtho:r.camera.perspToOrtho.x}),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=Mt()]={panoId:ze(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 p=r.works.getResolvedObserver(r.currentPano);return r.textureLoader=new Nn,r.tiling=new om(p?st(p.work):Ki,r.TILED_CUBE_TEXTURE_LEVEL+1,r.imageOptions),r.scene.add(r.tiling.object),r.panoVideo=new fm,r.scene.add(r.panoVideo.object),r}return t.parseArgs=function(e){var r,i,a,o,s,u;if(e instanceof t)return e;var l=n.parseArgs.call(this,e);return O(O({},l),{maxAccessibleDistance:(r=e.maxAccessibleDistance)!==null&&r!==void 0?r:5,panoTapTriggerRadius:(i=e.panoTapTriggerRadius)!==null&&i!==void 0?i:.5,panoCircleMeshCreator:(a=e.panoCircleMeshCreator)!==null&&a!==void 0?a:function(c){return new yl},tileLevelForFov:(o=e.tileLevelForFov)!==null&&o!==void 0?o:function(c,d){var v=function(m){return m/Math.PI*180},A=function(m){return m/180*Math.PI},h=d.height/2/Math.tan(A(c/2)),p=d.width>d.height?c:v(Math.atan(Math.tan(A(c/2))*(d.width/d.height))*2);p*=.9;var g=h*(Math.tan(A(p/2))-Math.tan(A(p/2-1)));return g>80?5:g>60?4:g>40?3:g>18?2:g>12?1:0},tileMaxRequest:(s=e.tileMaxRequest)!==null&&s!==void 0?s:3,luminanceAdaptiveEffectEnable:(u=e.luminanceAdaptiveEffectEnable)!==null&&u!==void 0?u:!0})},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return O(O({},i),{mode:"Panorama"})},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,v=c.pano1,A=0,h=Object.keys(this.panoResources);A<h.length;A++){var p=h[A],g=this.panoResources[p];if(g.panoPicture){var m=g.panoPicture.map;m&&m!==(d==null?void 0:d.map)&&m!==(v==null?void 0:v.map)&&(m.dispose(),(r=g.panoPicture.luminanceMap)===null||r===void 0||r.dispose(),g.panoPicture=null)}delete this.panoResources[p]}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 Ve&&(i=(r=a.panoPicture)===null||r===void 0?void 0:r.map.tilePending)!==null&&i!==void 0?i:0,s=this.tiling.pedding;return this.initAnimationed&&o<=0&&s<=0},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?st(l):Ki),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,v,A,h;if(!this.destroyed){var p={},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),p.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(de(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var x=this.locationMotion.getKeyFrameSegment(e),w=x[0],E=x[1],S=this.panoResourceFromLocationMotionKeyframe(w),C=this.panoResourceFromLocationMotionKeyframe(E),R=new f.Vector3().copy(S.position),k=new f.Vector3().copy(C.position),M=this.locationMotion.value.count-E.value.count+1;p.progress=M,C.panoPicture&&(M<1?S.panoPicture&&(p.pano0=S.panoPicture):p.pano0=C.panoPicture,p.pano1=C.panoPicture),C.effect==="montage"?p.transition="BLACK":C.effect==="spread"?p.transition="SPREAD":p.transition="FADE",(C.effect==="zoomin"||C.effect==="zoomout")&&(p.progress=Math.pow(M,3)),M<1&&C.effect!=="fly"&&(p.pano0&&S.panoPicture&&(p.pano0={map:p.pano0.map,zoom:p.pano0.zoom,luminanceMap:p.pano0.luminanceMap,matrix:S.panoPicture.matrix.clone().premultiply(S.fixCameraTransform).setPosition(C.position)}),R.copy(k),b=!0),g.distance=this.locationMotion.value.distance,g.offset=new f.Vector3(R.x+(k.x-R.x)*M,R.y+(k.y-R.y)*M,R.z+(k.z-R.z)*M);for(var I=[],L=[],T=0,B=this.locationMotion.keyframes;T<B.length;T++){var D=B[T],V=D.key,N=D.progress;V!==void 0&&(I.push(V),N>this.locationMotion.progress&&L.push(V))}for(var U=0,H=Object.keys(this.panoResources);U<H.length;U++){var G=H[U];if(!(L.indexOf(G)>=0)){var j=this.panoResources[G];if(j.panoPicture){var _=j.panoPicture.map,X=j.panoPicture.luminanceMap;if(_){if(_===((a=p.pano0)===null||a===void 0?void 0:a.map)||_===((o=p.pano1)===null||o===void 0?void 0:o.map))continue;_ instanceof Ve&&_.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(_.cubeRenderTarget),_.dispose(),X&&(X instanceof Ve&&X.cubeRenderTarget&&this.luminanceCubeRenderTargetPool.push(X.cubeRenderTarget),X.dispose()),j.panoPicture=null}}I.indexOf(G)>=0||delete this.panoResources[G]}}this.currentPano=yt(C.panoId),this.emit("pano.moving",J("pano.moving",{userAction:this.userAction,prevPano:yt(m.panoId),state:O(O(O(O({},yt(y.panoId)),{mode:this.mode}),Je(this.camera.pose)),g),options:{},progress:this.locationMotion.progress,error:null}))}Gt(p)===!1&&(!((s=p.pano0)===null||s===void 0)&&s.map&&p.pano0.map instanceof Ve&&!p.pano0.map.cubeRenderTarget&&(p.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((u=p.pano0)===null||u===void 0)&&u.luminanceMap&&p.pano0.luminanceMap instanceof Ve&&!p.pano0.luminanceMap.cubeRenderTarget&&(p.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),!((l=p.pano1)===null||l===void 0)&&l.map&&p.pano1.map instanceof Ve&&!p.pano1.map.cubeRenderTarget&&(p.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((c=p.pano1)===null||c===void 0)&&c.luminanceMap&&p.pano1.luminanceMap instanceof Ve&&!p.pano1.luminanceMap.cubeRenderTarget&&(p.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.models.setMaterial(p)),Gt(g)===!1&&this.setCamera(g);var Z=this.works.getResolvedObserver(this.currentPano),W=this.locationMotion.ended?this.getForwardObserverOrNot():null;if(this.camera.pose.distance>.1||b)for(var $=0,Y=Object.keys(this.panoMeshes);$<Y.length;$++){var ne=Y[$],te=this.panoMeshes[ne];te.setOpacity(0),te.setCurrent(!1),te.updateTime&&te.updateTime(e,r),te.visible=!1}else if(Z){var ue=mr(Z.visibleIds,function(ve){var we=i.works.getResolvedObserver(ve);return we?Z.standingPosition.distanceTo(we.standingPosition):1/0},!0),ie=ue[1];ie=de(ie,2.5,1/0);for(var ge=Z.visibleIds.concat(ze(this.currentPano)),pe=this.camera.getDirection(new f.Vector3),ye=0,Be=Object.keys(this.panoMeshes);ye<Be.length;ye++){var ne=Be[ye],te=this.panoMeshes[ne],Se=this.works.getResolvedObserver(ne);if(ge.indexOf(ne)===-1)te.setCurrent(!1),te.setOpacity(0);else if(!Se)te.setCurrent(!1),te.setOpacity(0);else if(!Se.loadable&&!Se.active)te.setCurrent(!1),te.setOpacity(0);else{var Te=te.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);te.setCurrent(!te.loading&&te.progress===0&&W!==null&&W.panoId===ne),te.setOpacity(Te<.01?0:de(ie/Te*1.2,.4,.85));var re=this.camera.position.clone().setY(te.position.y),oe=new f.Vector3().copy(te.position).sub(re).normalize();if(ne===ze(this.currentPano)){var q=de((.5-re.distanceTo(te.position))/.5,0,1);oe.multiplyScalar(1-q).add(pe.clone().multiplyScalar(q))}oe.length()>0&&te.quaternion.setFromEuler(new f.Euler(0,Math.atan2(oe.x,oe.z),0))}te.updateTime&&te.updateTime(e,r)}}var De=this.tileLevel=function(){if(i.tileLevelForFov===!1)return 0;var ve=i.renderer.getDrawingBufferSize(new f.Vector2);ve.width*=i.scissor.width,ve.height*=i.scissor.height;var we=y.panoId,be=i.works.getResolvedObserver(we),me=i.imageOptions.size;if(typeof me=="undefined"&&be){var Ue=be.images.up.match(/\/cube_(\d+)\//);Ue&&(me=Number(Ue[1]))}typeof me=="undefined"&&(me=2048);var je=0;me>=1024&&(je=1),me>=2048&&(je=2),me>=4096&&(je=3),me>=8192&&(je=4);var it=i.tileLevelForFov(i.camera.fov,ve);return it>je?it:0}(),Fe=function(){var ve=i.camera.quaternion.clone(),we=i.works.getResolvedObserver(y.panoId),be=we!=null?we:Z;be&&ve.premultiply(be.quaternion.clone().inverse());var me=new f.Matrix4().makeRotationFromQuaternion(ve),Ue=new f.Matrix4().getInverse(me),je=new f.Frustum().setFromProjectionMatrix(new f.Matrix4().multiplyMatrices(i.camera.projectionMatrix,Ue));return je}();y.panoId===ze(this.currentPano)&&(((d=y.panoPicture)===null||d===void 0?void 0:d.map)instanceof Ve&&(y.panoPicture.map.maxRequest=this.tileMaxRequest,y.panoPicture.map.update(Fe,De),y.panoPicture.map.needsRender===!0&&(y.panoPicture.map.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)),((v=y.panoPicture)===null||v===void 0?void 0:v.luminanceMap)instanceof Ve&&(y.panoPicture.luminanceMap.maxRequest=this.tileMaxRequest,y.panoPicture.luminanceMap.update(Fe,De),y.panoPicture.luminanceMap.needsRender===!0&&(y.panoPicture.luminanceMap.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)));{var Ie=this.tiling.object.visible;if(this.initAnimationed){var Ke=y.panoId,xe=this.works.getResolvedObserver(Ke);xe?bi(this.camera.position,xe.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==Ke&&this.tiling.cleanup(),this.tiling.panoId=Ke,this.tiling.setResource((h=(A=xe.images)===null||A===void 0?void 0:A.tiles)!==null&&h!==void 0?h:[],this.enableIOSEDR&&xe.images.luminance?xe.images.luminance:null),this.tiling.setFetcher(st(xe.work)),this.tiling.setRotation(xe.quaternion),this.tiling.setPosition(xe.position),this.tiling.maxRequest=this.tileMaxRequest,De>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(Fe,De,e):this.tiling.update(Fe,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;Ie!==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(de(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 g0(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(he())[1],r=this.locationMotion.getKeyFrameSegment(he())[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 v=ai(d.images.up),A=this.imageOptions.size;typeof A=="undefined"&&d&&v&&(A=Number(v)),typeof A=="undefined"&&(A=2048);var h=this.imageOptions.transform,p=O({key:"pano.".concat(d.panoId)},Ut(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(B){return B.size>A}))!==null&&u!==void 0?u:null,y=h,b={key:"pano_luminance.".concat(d.panoId),size:p.size?p.size/2:void 0},x=this.enableIOSEDR&&d.images.luminance?d.images.luminance:null,w=function(){if(!d.images.tiles||!x)return null;var B=ai(x.up);return B?m==null?void 0:m.map(function(D){var V=D.size*D.scale/2;return B<V?{level:D.level,size:V,scale:1,back:Vt(x.back,V),front:Vt(x.front,V),left:Vt(x.left,V),right:Vt(x.right,V),up:Vt(x.up,V),down:Vt(x.down,V)}:{level:D.level,size:B,scale:V/B,back:x.back,front:x.front,left:x.left,right:x.right,up:x.up,down:x.down}}):null}(),E="pano:"+na([g,p,h]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===E)return;var S=this.pendingTextureTask.panoId;(l=this.panoMeshes[S])===null||l===void 0||l.setProgress(0),this.emit("pano.texture.abort",J("pano.texture.abort",{error:null,progress:0,meta:null,pano:d.pano}))}var C="move-to-pano-"+d.panoId;this.pending.add(C);var R=this.models.getMaterial()||{},k=R.pano0,M=R.pano1,I;if(k&&k.map.name===E&&k.luminanceMap!==null===this.enableIOSEDR?I=k:(M==null?void 0:M.map.name)===E&&M.luminanceMap!==null===this.enableIOSEDR&&(I=M),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,b0)},position:d.position.clone(),fixCameraTransform:new f.Matrix4};ht.shared.add(function(){a.pending.delete(C),a.doMoveToPano(d.pano,L,r)},!0,1);return}this.pendingTextureTask={panoId:d.panoId,hash:E,onLoad:function(B,D){var V;if(a.pending.delete(C),a.destroyed)B.body.dispose();else{B.body.name=E;var N={panoId:d.panoId,effect:c,panoPicture:{zoom:1,map:B.body,luminanceMap:(V=D==null?void 0:D.body)!==null&&V!==void 0?V:null,matrix:new f.Matrix4().compose(d.position,d.quaternion,b0)},position:d.position.clone(),fixCameraTransform:new f.Matrix4};a.doMoveToPano(d.pano,N,r)}},onError:function(B){a.pending.delete(C);var D=O(O(O({},d.pano),{mode:a.mode}),Je(a.camera.pose));a.emit("pano.error",J("pano.error",{error:B,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:D})),a.emit("pano.cancel",J("pano.cancel",{error:B,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:D})),a.emit("error",B),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.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:h,options:p},minFilter:f.LinearFilter,magFilter:f.LinearFilter,generateMipmaps:!1,format:f.RGBAFormat,viaAjax:!0,fetcher:st(d.work)},void 0,void 0,function(B){var D,V;a.emit("pano.texture.progress",J("pano.texture.progress",{error:null,progress:B,meta:null,pano:d.pano})),((D=a.pendingTextureTask)===null||D===void 0?void 0:D.hash)===E&&((V=a.panoMeshes[d.panoId])===null||V===void 0||V.setProgress(B))},this.renderer):this.textureLoader.loadCubeTexture(g,{imageURL:{transform:h,options:p},format:f.RGBAFormat,viaAjax:!0,fetcher:st(d.work)},void 0,void 0,function(B){var D,V;a.emit("pano.texture.progress",J("pano.texture.progress",{error:null,progress:B,meta:null,pano:d.pano})),((D=a.pendingTextureTask)===null||D===void 0?void 0:D.hash)===E&&((V=a.panoMeshes[d.panoId])===null||V===void 0||V.setProgress(B))},this.renderer),x?this.tileLevelForFov&&w&&w.length?this.textureLoader.loadTiledCubeTexture(x,w,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:y,options:b},minFilter:f.LinearFilter,magFilter:f.LinearFilter,generateMipmaps:!1,fetcher:st(d.work)},void 0,void 0,void 0,this.renderer).catch(function(){return null}):this.textureLoader.loadCubeTexture(x,{imageURL:{transform:y,options:b},fetcher:st(d.work)},void 0,void 0,void 0,this.renderer).catch(function(){return null}):Promise.resolve(null)]).then(function(B){var D,V,N=B[0],U=B[1];((D=a.pendingTextureTask)===null||D===void 0?void 0:D.hash)===E?(a.pendingTextureTask.onLoad(N,U),(V=a.panoMeshes[d.panoId])===null||V===void 0||V.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",J("pano.texture.success",{error:null,progress:1,meta:N.meta,pano:d.pano}))):(N.body.dispose(),U==null||U.body.dispose())}).catch(function(B){var D,V;((D=a.pendingTextureTask)===null||D===void 0?void 0:D.hash)===E&&(a.pendingTextureTask.onError(B),(V=a.panoMeshes[d.panoId])===null||V===void 0||V.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",J("pano.texture.error",{error:B,progress:0,meta:null,pano:d.pano})),a.emit("error",B))}),this.emit("pano.texture.load",J("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},v=!1;e.moveToPano(l,{longitude:u.longitude,latitude:u.latitude,fov:u.fov,effect:o,duration:a,moveStartCallback:function(A){v=!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",J("initAnimation.start",{state:A,userAction:e.userAction}))},moveEndCallback:function(A){e.emit("initAnimation.end",J("initAnimation.end",{state:A,userAction:e.userAction})),e.initAnimationed=!0,r()},moveCancelCallback:function(){var A=O(O(O({},l),{mode:e.mode}),Je(e.camera.pose));v===!1&&e.emit("initAnimation.start",J("initAnimation.start",{state:A,userAction:e.userAction})),e.emit("initAnimation.end",J("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(E){var S=mr(E.accessibleIds,function(R){var k=e.works.getResolvedObserver(R);if(!k)return 1/0;var M=k.standingPosition.distanceTo(E.standingPosition);return de(M,1,1/0)},!0),C=S[1];c[E.panoId]===void 0&&(c[E.panoId]=C)},v=0,A=this.works.resolvedObservers;v<A.length;v++){var h=A[v];d(h)}var p=Object.keys(c).map(function(E){return c[E]});if(p.length){var g=p.reduce(function(E,S){return E+S},0)/p.length;l=de(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,v,A,h,p,g;i===void 0&&(i={});var m=he(),y=Mt();this.tiling.cleanup(),this.panoResources[y]=r;var b=1,x,w,E;if(this.locationMotion.ended){var S=this.locationMotion.getKeyFrameSegment(m);S[0];var C=S[1],R=this.locationMotion.value,k=((o=this.panoResourceFromLocationMotionKeyframe(C))!==null&&o!==void 0?o:this.camera).position,M=r.position;x=Math.max(k.distanceTo(M),b),w=[{key:C.key,progress:0,value:O(O({},R),{count:0})},{key:y,progress:1,value:{distance:0,count:1}}],E=0}else{var I=this.locationMotion.getKeyFrameSegment(m),L=I[0],C=I[1],R=this.locationMotion.value,T=this.panoResourceFromLocationMotionKeyframe(L).position,k=this.panoResourceFromLocationMotionKeyframe(C).position,M=r.position,B=C.value.count-R.count,D=Math.max(T.distanceTo(k),b)*B,V=Math.max(k.distanceTo(M),b);x=D+V,w=[{key:L.key,progress:0,value:O({},R)},{key:C.key,progress:D/x,value:C.value},{key:y,progress:1,value:{count:C.value.count+1,distance:0}}];var N=this.locationMotionKeyframesLength(this.locationMotion.keyframes),U=this.locationMotionKeyframesLength(w);N===0||N===0?E=0:E=this.locationMotion.getProgressVelocity(m)*N/U}var H=r.effect==="instant"?0:this.calculateMovingDuration(i.duration,r.effect==="fly"?x:0),G={longitude:i.longitude,latitude:i.latitude,fov:i.fov},j=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",J("pano.moveTo",{options:i,prevPano:_,progress:0,state:j,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(j),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,H).catch(Q);else{var X=Qt({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),Z=Qt({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}),W=new f.Object3D;W.lookAt(X);var $=new f.Matrix4().makeRotationFromQuaternion(W.quaternion);W.lookAt(Z);var Y=new f.Matrix4().makeRotationFromQuaternion(W.quaternion),ne=new f.Matrix4().getInverse($).premultiply(Y),te=this.cameraMotion.value.fov,ue=(v=G.fov)!==null&&v!==void 0?v:this.cameraMotion.value.fov,ie=1;r.effect==="zoomin"?ie=1.5:r.effect==="zoomout"&&(ie=.4);for(var ge=de(ue*ie,1,170),pe=0;pe<w.length-1;pe++){var ye=w[pe].key;if(ye){var Be=this.panoResources[ye];Be&&(Be.fixCameraTransform.copy(ne),Be.panoPicture&&(Be.panoPicture.zoom=Math.tan(te/2/180*Math.PI)/Math.tan(ge/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:ge}},{progress:1,value:{longitude:(p=G.longitude)!==null&&p!==void 0?p:this.cameraMotion.value.longitude,latitude:(g=G.latitude)!==null&&g!==void 0?g:this.cameraMotion.value.latitude,fov:ue}}],H).catch(Q)}var Se=this.locationMotion.setKeyframes(w,H,E);Se.then(function(){for(var Te,re,oe=0,q=a.models;oe<q.length;oe++){var De=q[oe];De.show()}var Fe=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",J("pano.arrived",{options:i,prevPano:_,progress:1,state:Fe,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(Fe);var Ie=a.works.getResolvedObserver(e);if(Ie&&Ie.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var Ke=dm.clone().multiply((re=(Te=a.models.getMaterial().pano1)===null||Te===void 0?void 0:Te.matrix)!==null&&re!==void 0?re:new f.Matrix4).multiply(Ie.video.matrix),xe={map:a.videoTexture,size:Ie.video.size,matrix:Ke,alpha:1},ve=Mt(),we=a.videoTexture.image;we.setAttribute("uuid",ve),Cl().then(function(be){be&&Ie.video&&we.getAttribute("uuid")===ve&&(we.oncanplay=function(){we.oncanplay=Q,we.play()},we.ontimeupdate=function(){we.currentTime>.5&&(we.ontimeupdate=Q,a.panoVideo.setMaterial(xe))},we.src=Ie.video.source)}).catch(function(){we.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",J("pano.cancel",{options:i,prevPano:_,progress:0,state:j,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===ze(r.currentPano))return!1;var E=r.works.getResolvedObserver(w);if(!E)return!1;var S=E.standingPosition.clone().project(r.camera);return Math.abs(S.z)>1||Math.abs(S.x)>1||Math.abs(S.y)>1?!1:E.loadable||E.active}),v=d.slice().sort(function(w,E){var S=r.works.getResolvedObserver(w).standingPosition.clone().distanceTo(o),C=r.works.getResolvedObserver(E).standingPosition.clone().distanceTo(o);return S-C}),A=0,h=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];A<h.length;A++)for(var p=h[A],g=0,m=v;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)<p)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!==ze(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===ze(r.currentPano))return!1;var H=r.works.getResolvedObserver(U);return!H||H.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:H.loadable||H.active}),d=this.models.intersectRaycaster(o)[0];if(d){var v=mr(c,function(U){var H=r.works.getResolvedObserver(U);if(!H)return 1/0;var G=H.standingPosition.clone();return G.distanceTo(d.point)},!0),A=v[0],h=v[1];A&&h<this.panoTapTriggerRadius&&(u=(i=this.works.getResolvedObserver(A))!==null&&i!==void 0?i:null)}u||(u=this.getForwardObserverOrNot(o));for(var p=0,g=this.locationMotion.keyframes;p<g.length;p++){var m=g[p],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,E=u.position.clone().setY(0).sub(l.position.clone().setY(0)).normalize(),S=[],C=[],R=[],k=0,M=u.accessibleIds;k<M.length;k++){var A=M[k],I=yt(A);if(!(nr(I,this.currentPano)||nr(I,u.pano))){var L=this.works.getResolvedObserver(A);if(L){var T=L.position.clone().sub(u.position).setY(0);E.angleTo(T)<x&&R.push(T)}}}var B=R.length>0?R:dt(dt([],S,!0),C,!0),D=B.slice().sort(function(U,H){return U.angleTo(E)-H.angleTo(E)})[0];D&&D.angleTo(s)>w&&(b.longitude=Math.atan2(-D.x,-D.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(b.latitude=de(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",J("pano.select",{prevPano:this.currentPano,state:V,userAction:e.userAction,options:b,progress:0,error:null})),u&&!u.active){var N=u.panoId;this.panoMeshes[N]&&(this.panoMeshes[N].setDisabled(!1),this.panoMeshes[N].setLoading(!0))}u&&u.active&&this.emit("pano.request",J("pano.request",{userAction:e.userAction,prevPano:this.currentPano,progress:0,state:V,options:b,error:null}))}}}}},t}(Ml),Ir=Math.PI/180,Bn=180/Math.PI,Il=.001,Tl=1,ni=function(){var n=typeof navigator!="undefined"&&/iPad|iPhone|iPod/.test(navigator.platform);return function(){return n}}(),hm=function(){var n=typeof navigator!="undefined"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return function(){return n}}(),pm=function(){var n=typeof navigator!="undefined"&&navigator.userAgent.indexOf("Firefox")!==-1&&navigator.userAgent.indexOf("Android")!==-1;return function(){return n}}(),Pl=function(){var n=typeof navigator!="undefined"?navigator.userAgent.match(/.*Chrome\/([0-9]+)/):null,t=n?parseInt(n[1],10):null;return function(){return t}}(),vm=function(){var n=!1;if(Pl()===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}}(),mm=function(){var n=ni()&&hm()&&typeof navigator!="undefined"&&navigator.userAgent.indexOf("13_4")!==-1;return function(){return n}}(),Rl=function(){var n=typeof navigator!="undefined"&&navigator.userAgent.indexOf("R7 Build")!==-1;return function(){return n}}();function w0(){var n=typeof window!="undefined"&&(window.orientation==90||window.orientation==-90);return Rl()?!n:n}function Am(n){return!(isNaN(n)||n<=Il||n>Tl)}function gm(n){if(n.w>1)return 0;var t=2*Math.acos(n.w);return t}var E0=function(){var n={};return function(t,e){n[t]===void 0&&(console.warn("cardboard: "+e),n[t]=!0)}}();function S0(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 ym(){if(typeof window=="undefined"||typeof document=="undefined")return!1;var n=window.self!==window.top,t=S0(document.referrer),e=S0(window.location.href);return n&&t!==e}var M0=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,v=u+u,A=o*c,h=o*d,p=o*v,g=s*d,m=s*v,y=u*v,b=l*c,x=l*d,w=l*v;return r[0]=1-(g+y),r[1]=h+w,r[2]=p-x,r[3]=0,r[4]=h-w,r[5]=1-(A+y),r[6]=m+b,r[7]=0,r[8]=p+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,v,A,h,p,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],v=i[3],A=i[4],h=i[5],p=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]=v,r[4]=A,r[5]=h,r[6]=p,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+p*s+b*u+i[14],r[15]=v*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],v=i[7],A=i[8],h=i[9],p=i[10],g=i[11],m=i[12],y=i[13],b=i[14],x=i[15],w=a*c-o*l,E=a*d-s*l,S=a*v-u*l,C=o*d-s*c,R=o*v-u*c,k=s*v-u*d,M=A*y-h*m,I=A*b-p*m,L=A*x-g*m,T=h*b-p*y,B=h*x-g*y,D=p*x-g*b,V=w*D-E*B+S*T+C*L-R*I+k*M;return V?(V=1/V,r[0]=(c*D-d*B+v*T)*V,r[1]=(s*B-o*D-u*T)*V,r[2]=(y*k-b*R+x*C)*V,r[3]=(p*R-h*k-g*C)*V,r[4]=(d*L-l*D-v*I)*V,r[5]=(a*D-s*L+u*I)*V,r[6]=(b*S-m*k-x*E)*V,r[7]=(A*k-p*S+g*E)*V,r[8]=(l*B-c*L+v*M)*V,r[9]=(o*L-a*B-u*M)*V,r[10]=(m*R-y*S+x*w)*V,r[11]=(h*S-A*R-g*w)*V,r[12]=(c*I-l*T-d*M)*V,r[13]=(a*T-o*I+s*M)*V,r[14]=(y*E-m*C-b*w)*V,r[15]=(A*C-h*E+p*w)*V,r):null}return function(r,i,a){n(r,i),a&&t(r,r,a),e(r,r)}}(),_a=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}(),bm=function(){function n(t,e){this.kFilter=t,this.isDebug=e,this.currentAccelMeasurement=new _a,this.currentGyroMeasurement=new _a,this.previousGyroMeasurement=new _a,ni()?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;Am(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)",Bn*gm(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}(),xm=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<Ir*20)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(Bn*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}(),wm=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}(),Em=function(){function n(){this.angularAcceleration=null,this.angularVelocity=null,this.linearAcceleration=null,this.linearVelocity=null,this.orientation=null,this.position=null}return n}(),C0=function(){function n(){this.leftDegrees=0,this.rightDegrees=0,this.upDegrees=0,this.downDegrees=0}return n}(),Sm=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 bm(t,i),this.posePredictor=new xm(e,i),this.isFirefoxAndroid=pm(),this.isIOS=ni();var a=Pl();this.isDeviceMotionInRadians=!this.isIOS&&a!==null&&a<66,this.isWithoutDeviceMotion=vm()||mm(),this.filterToWorldQ=new f.Quaternion,ni()?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_(),w0()&&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 Em;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(),w0()&&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),M0(t.leftViewMatrix,e,r.left),M0(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 ni()&&ym()&&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*Ir,o=t.left.downDegrees*Ir,s=t.left.leftDegrees*Ir,u=t.left.rightDegrees*Ir,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*Ir,o=t.right.downDegrees*Ir,s=t.right.leftDegrees*Ir,u=t.right.rightDegrees*Ir,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 wm(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=Bn*Math.atan(r.distort(a/i)),c=Bn*Math.atan(r.distort(o/i)),d=Bn*Math.atan(r.distort(s/i)),v=Bn*Math.atan(r.distort(u/i)),A=new C0,h=new C0;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(v,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){E0("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),this.previousTimestampS=i;return}else if(a<=Il||a>Tl){E0("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&&(Rl()?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}(),Fi=[0,0,.5,1],Li=[.5,0,.5,1],Mm=function(){function n(t){var e=this;this.renderer=t,this.sensor=new Sm(.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*Fi[0]),y:Math.round(r.height*Fi[1]),width:Math.round(r.width*Fi[2]),height:Math.round(r.height*Fi[3])},o={x:Math.round(r.width*Li[0]),y:Math.round(r.height*Li[1]),width:Math.round(r.width*Li[2]),height:Math.round(r.height*Li[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 Cm="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADqCAMAAAAvZYhaAAAC/VBMVEUAAAD///99fX37+/v5+fn29vbx8fHv7+/Nzc3o6Ojq6urh4eHU1NTR0dGDg4Pl5eWSkpLHx8fj4+Pe3t7X19fAwMDZ2dnCwsKrq6uioqLb29uNjY2enp67u7t5eXmAgIC2traWlpa5ubnKysqmpqZycnKHh4eurq6ysrKKioqDg4Pd3d12dnb9/f1vb2/s7OxlZWXz8/OoqKiZmZlpaWmbm5teXl7W1tbJycnExMRiYmJsbGywsLCPj49aWlq9vb1UVFRYWFhra2t+fn7t7e1RUVFOTk6Dg4OAgIC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TZ2XNCsD6rgpTK/4p3WcrrPH1ghWJGhONC3JoGAkRHH1JKjpNEcCxOV2I8MWyiUJqNVajSVodgiWcVMVLVeSS1ATCZoc88qjVKlSc3kSLJ5c5V6rTZQAcVkGbBeuOkgCgq2CBM3MoFwGr1tvim2aMpZZqyBBc3N1UF2GX90j9SQJKCBB83OfYAcNVjFcSrvzo95WOShB83Ody5V24fqzO0nAUSzB/89Nph38VqmuOa3gticJOP9fApuHTDt4nFJ7AXdPC0lg8/gq8y5XapSrgpUgbQ0JpF5u97hS1fOC26nlJJA8Yd41Sg3fU4dtRQkKeXSN3jo4Qqm0397OmyZOGatoDrScBIWM3DFn5kXi1ZyqRSUoZtKOa1vWKArztqgEnhIHty4f9/btuEstKwGkxf+XuCT5CbTFnFRuxktuAAAAAElFTkSuQmCC";var Ja,Xa={zh:{TITLE:"眼镜模式",HIT:"请将手机横屏放入 VR 眼镜中"},en:{TITLE:"GLASSES MODE",HIT:"Please put the mobile phone horizontally into the VR glasses."},ja:{TITLE:"メガネモード",HIT:"携帯電話をVRメガネに水平に入れてください。"}},I0=typeof navigator!="undefined"&&(Ja=Xa[navigator.language.split("-")[0]])!==null&&Ja!==void 0?Ja:Xa.zh,Tm=`
1592
+ `,fm=function(){function n(){this.material=new f.ShaderMaterial({vertexShader:lm,fragmentShader:cm,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(Xo,this.material),this.object.visible=!1,this.object.renderOrder=-1,this.object.frustumCulled=!1,this.object.name="pano-video",this.alphaMotion=new Me({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}(),dm=new f.Matrix4().makeRotationAxis(new f.Vector3(0,1,0),Math.PI),b0=new f.Vector3(-1,1,1),x0=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}(),Wo=function(n){se(t,n);function t(e){var r=this,i,a,o,s,u=t.parseArgs(e);r=n.call(this,u)||this,r.TILED_CUBE_TEXTURE_LEVEL=2,r.mode="Panorama",r.tileLevel=0,r.initAnimationed=!1,r.maxAccessibleDistance=u.maxAccessibleDistance,r.panoTapTriggerRadius=u.panoTapTriggerRadius,r.panoCircleMeshCreator=u.panoCircleMeshCreator,r.tileLevelForFov=u.tileLevelForFov,r.tileMaxRequest=u.tileMaxRequest,r.luminanceAdaptiveEffectEnable=u.luminanceAdaptiveEffectEnable,r.luminanceAdaptiveEffect=new g0(r.renderer,r.modelScene,r.camera,r.models),r.colorCubeRenderTargetPool=new x0,r.luminanceCubeRenderTargetPool=new x0;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 Ve&&c.map.cubeRenderTarget&&r.colorCubeRenderTargetPool.push(c.map.cubeRenderTarget),c.luminanceMap&&(c.luminanceMap.dispose(),c.luminanceMap instanceof Ve&&c.luminanceMap.cubeRenderTarget&&r.luminanceCubeRenderTargetPool.push(c.luminanceMap.cubeRenderTarget)));for(var v=r.colorCubeRenderTargetPool.size;v<2;v++){var A=Math.max(1024*r.TILED_CUBE_TEXTURE_LEVEL,512),h=r.colorCubeRenderTargetPool.create();h.setSize(A,A),oo(null,h,r.renderer),r.colorCubeRenderTargetPool.push(h)}r.panoMeshes={},r.updatePanoMeshes(),r.locationMotion=new Me({count:0,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Me({modelAlpha:(a=(i=r.models.getMaterial())===null||i===void 0?void 0:i.modelAlpha)!==null&&a!==void 0?a:0}),r.perspToOrthoMotion=new Me({perspToOrtho:r.camera.perspToOrtho.x}),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=Mt()]={panoId:ze(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 p=r.works.getResolvedObserver(r.currentPano);return r.textureLoader=new Nn,r.tiling=new om(p?st(p.work):Ki,r.TILED_CUBE_TEXTURE_LEVEL+1,r.imageOptions),r.scene.add(r.tiling.object),r.panoVideo=new fm,r.scene.add(r.panoVideo.object),r}return t.parseArgs=function(e){var r,i,a,o,s,u;if(e instanceof t)return e;var l=n.parseArgs.call(this,e);return O(O({},l),{maxAccessibleDistance:(r=e.maxAccessibleDistance)!==null&&r!==void 0?r:5,panoTapTriggerRadius:(i=e.panoTapTriggerRadius)!==null&&i!==void 0?i:.5,panoCircleMeshCreator:(a=e.panoCircleMeshCreator)!==null&&a!==void 0?a:function(c){return new yl},tileLevelForFov:(o=e.tileLevelForFov)!==null&&o!==void 0?o:function(c,d){var v=function(m){return m/Math.PI*180},A=function(m){return m/180*Math.PI},h=d.height/2/Math.tan(A(c/2)),p=d.width>d.height?c:v(Math.atan(Math.tan(A(c/2))*(d.width/d.height))*2);p*=.9;var g=h*(Math.tan(A(p/2))-Math.tan(A(p/2-1)));return g>80?5:g>60?4:g>40?3:g>18?2:g>12?1:0},tileMaxRequest:(s=e.tileMaxRequest)!==null&&s!==void 0?s:3,luminanceAdaptiveEffectEnable:(u=e.luminanceAdaptiveEffectEnable)!==null&&u!==void 0?u:!0})},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return O(O({},i),{mode:"Panorama"})},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,v=c.pano1,A=0,h=Object.keys(this.panoResources);A<h.length;A++){var p=h[A],g=this.panoResources[p];if(g.panoPicture){var m=g.panoPicture.map;m&&m!==(d==null?void 0:d.map)&&m!==(v==null?void 0:v.map)&&(m.dispose(),(r=g.panoPicture.luminanceMap)===null||r===void 0||r.dispose(),g.panoPicture=null)}delete this.panoResources[p]}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 Ve&&(i=(r=a.panoPicture)===null||r===void 0?void 0:r.map.tilePending)!==null&&i!==void 0?i:0,s=this.tiling.pedding;return this.initAnimationed&&o<=0&&s<=0},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?st(l):Ki),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,v,A,h;if(!this.destroyed){var p={},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),p.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(de(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var x=this.locationMotion.getKeyFrameSegment(e),w=x[0],E=x[1],S=this.panoResourceFromLocationMotionKeyframe(w),C=this.panoResourceFromLocationMotionKeyframe(E),R=new f.Vector3().copy(S.position),k=new f.Vector3().copy(C.position),M=this.locationMotion.value.count-E.value.count+1;p.progress=M,C.panoPicture&&(M<1?S.panoPicture&&(p.pano0=S.panoPicture):p.pano0=C.panoPicture,p.pano1=C.panoPicture),C.effect==="montage"?p.transition="BLACK":C.effect==="spread"?p.transition="SPREAD":p.transition="FADE",(C.effect==="zoomin"||C.effect==="zoomout")&&(p.progress=Math.pow(M,3)),M<1&&C.effect!=="fly"&&(p.pano0&&S.panoPicture&&(p.pano0={map:p.pano0.map,zoom:p.pano0.zoom,luminanceMap:p.pano0.luminanceMap,matrix:S.panoPicture.matrix.clone().premultiply(S.fixCameraTransform).setPosition(C.position)}),R.copy(k),b=!0),g.distance=this.locationMotion.value.distance,g.offset=new f.Vector3(R.x+(k.x-R.x)*M,R.y+(k.y-R.y)*M,R.z+(k.z-R.z)*M);for(var I=[],L=[],T=0,B=this.locationMotion.keyframes;T<B.length;T++){var D=B[T],V=D.key,N=D.progress;V!==void 0&&(I.push(V),N>this.locationMotion.progress&&L.push(V))}for(var U=0,H=Object.keys(this.panoResources);U<H.length;U++){var G=H[U];if(!(L.indexOf(G)>=0)){var j=this.panoResources[G];if(j.panoPicture){var J=j.panoPicture.map,X=j.panoPicture.luminanceMap;if(J){if(J===((a=p.pano0)===null||a===void 0?void 0:a.map)||J===((o=p.pano1)===null||o===void 0?void 0:o.map))continue;J instanceof Ve&&J.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(J.cubeRenderTarget),J.dispose(),X&&(X instanceof Ve&&X.cubeRenderTarget&&this.luminanceCubeRenderTargetPool.push(X.cubeRenderTarget),X.dispose()),j.panoPicture=null}}I.indexOf(G)>=0||delete this.panoResources[G]}}this.currentPano=yt(C.panoId),this.emit("pano.moving",_("pano.moving",{userAction:this.userAction,prevPano:yt(m.panoId),state:O(O(O(O({},yt(y.panoId)),{mode:this.mode}),_e(this.camera.pose)),g),options:{},progress:this.locationMotion.progress,error:null}))}Gt(p)===!1&&(!((s=p.pano0)===null||s===void 0)&&s.map&&p.pano0.map instanceof Ve&&!p.pano0.map.cubeRenderTarget&&(p.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((u=p.pano0)===null||u===void 0)&&u.luminanceMap&&p.pano0.luminanceMap instanceof Ve&&!p.pano0.luminanceMap.cubeRenderTarget&&(p.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),!((l=p.pano1)===null||l===void 0)&&l.map&&p.pano1.map instanceof Ve&&!p.pano1.map.cubeRenderTarget&&(p.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((c=p.pano1)===null||c===void 0)&&c.luminanceMap&&p.pano1.luminanceMap instanceof Ve&&!p.pano1.luminanceMap.cubeRenderTarget&&(p.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.models.setMaterial(p)),Gt(g)===!1&&this.setCamera(g);var Z=this.works.getResolvedObserver(this.currentPano),W=this.locationMotion.ended?this.getForwardObserverOrNot():null;if(this.camera.pose.distance>.1||b)for(var $=0,Y=Object.keys(this.panoMeshes);$<Y.length;$++){var ne=Y[$],te=this.panoMeshes[ne];te.setOpacity(0),te.setCurrent(!1),te.updateTime&&te.updateTime(e,r),te.visible=!1}else if(Z){var ue=mr(Z.visibleIds,function(ve){var we=i.works.getResolvedObserver(ve);return we?Z.standingPosition.distanceTo(we.standingPosition):1/0},!0),ie=ue[1];ie=de(ie,2.5,1/0);for(var ge=Z.visibleIds.concat(ze(this.currentPano)),pe=this.camera.getDirection(new f.Vector3),ye=0,Be=Object.keys(this.panoMeshes);ye<Be.length;ye++){var ne=Be[ye],te=this.panoMeshes[ne],Se=this.works.getResolvedObserver(ne);if(ge.indexOf(ne)===-1)te.setCurrent(!1),te.setOpacity(0);else if(!Se)te.setCurrent(!1),te.setOpacity(0);else if(!Se.loadable&&!Se.active)te.setCurrent(!1),te.setOpacity(0);else{var Te=te.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);te.setCurrent(!te.loading&&te.progress===0&&W!==null&&W.panoId===ne),te.setOpacity(Te<.01?0:de(ie/Te*1.2,.4,.85));var re=this.camera.position.clone().setY(te.position.y),oe=new f.Vector3().copy(te.position).sub(re).normalize();if(ne===ze(this.currentPano)){var q=de((.5-re.distanceTo(te.position))/.5,0,1);oe.multiplyScalar(1-q).add(pe.clone().multiplyScalar(q))}oe.length()>0&&te.quaternion.setFromEuler(new f.Euler(0,Math.atan2(oe.x,oe.z),0))}te.updateTime&&te.updateTime(e,r)}}var De=this.tileLevel=function(){if(i.tileLevelForFov===!1)return 0;var ve=i.renderer.getDrawingBufferSize(new f.Vector2);ve.width*=i.scissor.width,ve.height*=i.scissor.height;var we=y.panoId,be=i.works.getResolvedObserver(we),me=i.imageOptions.size;if(typeof me=="undefined"&&be){var Ue=be.images.up.match(/\/cube_(\d+)\//);Ue&&(me=Number(Ue[1]))}typeof me=="undefined"&&(me=2048);var je=0;me>=1024&&(je=1),me>=2048&&(je=2),me>=4096&&(je=3),me>=8192&&(je=4);var it=i.tileLevelForFov(i.camera.fov,ve);return it>je?it:0}(),Fe=function(){var ve=i.camera.quaternion.clone(),we=i.works.getResolvedObserver(y.panoId),be=we!=null?we:Z;be&&ve.premultiply(be.quaternion.clone().inverse());var me=new f.Matrix4().makeRotationFromQuaternion(ve),Ue=new f.Matrix4().getInverse(me),je=new f.Frustum().setFromProjectionMatrix(new f.Matrix4().multiplyMatrices(i.camera.projectionMatrix,Ue));return je}();y.panoId===ze(this.currentPano)&&(((d=y.panoPicture)===null||d===void 0?void 0:d.map)instanceof Ve&&(y.panoPicture.map.maxRequest=this.tileMaxRequest,y.panoPicture.map.update(Fe,De),y.panoPicture.map.needsRender===!0&&(y.panoPicture.map.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)),((v=y.panoPicture)===null||v===void 0?void 0:v.luminanceMap)instanceof Ve&&(y.panoPicture.luminanceMap.maxRequest=this.tileMaxRequest,y.panoPicture.luminanceMap.update(Fe,De),y.panoPicture.luminanceMap.needsRender===!0&&(y.panoPicture.luminanceMap.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)));{var Ie=this.tiling.object.visible;if(this.initAnimationed){var Ke=y.panoId,xe=this.works.getResolvedObserver(Ke);xe?bi(this.camera.position,xe.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==Ke&&this.tiling.cleanup(),this.tiling.panoId=Ke,this.tiling.setResource((h=(A=xe.images)===null||A===void 0?void 0:A.tiles)!==null&&h!==void 0?h:[],this.enableIOSEDR&&xe.images.luminance?xe.images.luminance:null),this.tiling.setFetcher(st(xe.work)),this.tiling.setRotation(xe.quaternion),this.tiling.setPosition(xe.position),this.tiling.maxRequest=this.tileMaxRequest,De>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(Fe,De,e):this.tiling.update(Fe,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;Ie!==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(de(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 g0(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(he())[1],r=this.locationMotion.getKeyFrameSegment(he())[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 v=ai(d.images.up),A=this.imageOptions.size;typeof A=="undefined"&&d&&v&&(A=Number(v)),typeof A=="undefined"&&(A=2048);var h=this.imageOptions.transform,p=O({key:"pano.".concat(d.panoId)},Ut(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(B){return B.size>A}))!==null&&u!==void 0?u:null,y=h,b={key:"pano_luminance.".concat(d.panoId),size:p.size?p.size/2:void 0},x=this.enableIOSEDR&&d.images.luminance?d.images.luminance:null,w=function(){if(!d.images.tiles||!x)return null;var B=ai(x.up);return B?m==null?void 0:m.map(function(D){var V=D.size*D.scale/2;return B<V?{level:D.level,size:V,scale:1,back:Vt(x.back,V),front:Vt(x.front,V),left:Vt(x.left,V),right:Vt(x.right,V),up:Vt(x.up,V),down:Vt(x.down,V)}:{level:D.level,size:B,scale:V/B,back:x.back,front:x.front,left:x.left,right:x.right,up:x.up,down:x.down}}):null}(),E="pano:"+na([g,p,h]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===E)return;var S=this.pendingTextureTask.panoId;(l=this.panoMeshes[S])===null||l===void 0||l.setProgress(0),this.emit("pano.texture.abort",_("pano.texture.abort",{error:null,progress:0,meta:null,pano:d.pano}))}var C="move-to-pano-"+d.panoId;this.pending.add(C);var R=this.models.getMaterial()||{},k=R.pano0,M=R.pano1,I;if(k&&k.map.name===E&&k.luminanceMap!==null===this.enableIOSEDR?I=k:(M==null?void 0:M.map.name)===E&&M.luminanceMap!==null===this.enableIOSEDR&&(I=M),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,b0)},position:d.position.clone(),fixCameraTransform:new f.Matrix4};ht.shared.add(function(){a.pending.delete(C),a.doMoveToPano(d.pano,L,r)},!0,1);return}this.pendingTextureTask={panoId:d.panoId,hash:E,onLoad:function(B,D){var V;if(a.pending.delete(C),a.destroyed)B.body.dispose();else{B.body.name=E;var N={panoId:d.panoId,effect:c,panoPicture:{zoom:1,map:B.body,luminanceMap:(V=D==null?void 0:D.body)!==null&&V!==void 0?V:null,matrix:new f.Matrix4().compose(d.position,d.quaternion,b0)},position:d.position.clone(),fixCameraTransform:new f.Matrix4};a.doMoveToPano(d.pano,N,r)}},onError:function(B){a.pending.delete(C);var D=O(O(O({},d.pano),{mode:a.mode}),_e(a.camera.pose));a.emit("pano.error",_("pano.error",{error:B,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:D})),a.emit("pano.cancel",_("pano.cancel",{error:B,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:D})),a.emit("error",B),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.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:h,options:p},minFilter:f.LinearFilter,magFilter:f.LinearFilter,generateMipmaps:!1,format:f.RGBAFormat,viaAjax:!0,fetcher:st(d.work)},void 0,void 0,function(B){var D,V;a.emit("pano.texture.progress",_("pano.texture.progress",{error:null,progress:B,meta:null,pano:d.pano})),((D=a.pendingTextureTask)===null||D===void 0?void 0:D.hash)===E&&((V=a.panoMeshes[d.panoId])===null||V===void 0||V.setProgress(B))},this.renderer):this.textureLoader.loadCubeTexture(g,{imageURL:{transform:h,options:p},format:f.RGBAFormat,viaAjax:!0,fetcher:st(d.work)},void 0,void 0,function(B){var D,V;a.emit("pano.texture.progress",_("pano.texture.progress",{error:null,progress:B,meta:null,pano:d.pano})),((D=a.pendingTextureTask)===null||D===void 0?void 0:D.hash)===E&&((V=a.panoMeshes[d.panoId])===null||V===void 0||V.setProgress(B))},this.renderer),x?this.tileLevelForFov&&w&&w.length?this.textureLoader.loadTiledCubeTexture(x,w,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:y,options:b},minFilter:f.LinearFilter,magFilter:f.LinearFilter,generateMipmaps:!1,fetcher:st(d.work)},void 0,void 0,void 0,this.renderer).catch(function(){return null}):this.textureLoader.loadCubeTexture(x,{imageURL:{transform:y,options:b},fetcher:st(d.work)},void 0,void 0,void 0,this.renderer).catch(function(){return null}):Promise.resolve(null)]).then(function(B){var D,V,N=B[0],U=B[1];((D=a.pendingTextureTask)===null||D===void 0?void 0:D.hash)===E?(a.pendingTextureTask.onLoad(N,U),(V=a.panoMeshes[d.panoId])===null||V===void 0||V.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",_("pano.texture.success",{error:null,progress:1,meta:N.meta,pano:d.pano}))):(N.body.dispose(),U==null||U.body.dispose())}).catch(function(B){var D,V;((D=a.pendingTextureTask)===null||D===void 0?void 0:D.hash)===E&&(a.pendingTextureTask.onError(B),(V=a.panoMeshes[d.panoId])===null||V===void 0||V.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",_("pano.texture.error",{error:B,progress:0,meta:null,pano:d.pano})),a.emit("error",B))}),this.emit("pano.texture.load",_("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},v=!1;e.moveToPano(l,{longitude:u.longitude,latitude:u.latitude,fov:u.fov,effect:o,duration:a,moveStartCallback:function(A){v=!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",_("initAnimation.start",{state:A,userAction:e.userAction}))},moveEndCallback:function(A){e.emit("initAnimation.end",_("initAnimation.end",{state:A,userAction:e.userAction})),e.initAnimationed=!0,r()},moveCancelCallback:function(){var A=O(O(O({},l),{mode:e.mode}),_e(e.camera.pose));v===!1&&e.emit("initAnimation.start",_("initAnimation.start",{state:A,userAction:e.userAction})),e.emit("initAnimation.end",_("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(E){var S=mr(E.accessibleIds,function(R){var k=e.works.getResolvedObserver(R);if(!k)return 1/0;var M=k.standingPosition.distanceTo(E.standingPosition);return de(M,1,1/0)},!0),C=S[1];c[E.panoId]===void 0&&(c[E.panoId]=C)},v=0,A=this.works.resolvedObservers;v<A.length;v++){var h=A[v];d(h)}var p=Object.keys(c).map(function(E){return c[E]});if(p.length){var g=p.reduce(function(E,S){return E+S},0)/p.length;l=de(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,v,A,h,p,g;i===void 0&&(i={});var m=he(),y=Mt();this.tiling.cleanup(),this.panoResources[y]=r;var b=1,x,w,E;if(this.locationMotion.ended){var S=this.locationMotion.getKeyFrameSegment(m);S[0];var C=S[1],R=this.locationMotion.value,k=((o=this.panoResourceFromLocationMotionKeyframe(C))!==null&&o!==void 0?o:this.camera).position,M=r.position;x=Math.max(k.distanceTo(M),b),w=[{key:C.key,progress:0,value:O(O({},R),{count:0})},{key:y,progress:1,value:{distance:0,count:1}}],E=0}else{var I=this.locationMotion.getKeyFrameSegment(m),L=I[0],C=I[1],R=this.locationMotion.value,T=this.panoResourceFromLocationMotionKeyframe(L).position,k=this.panoResourceFromLocationMotionKeyframe(C).position,M=r.position,B=C.value.count-R.count,D=Math.max(T.distanceTo(k),b)*B,V=Math.max(k.distanceTo(M),b);x=D+V,w=[{key:L.key,progress:0,value:O({},R)},{key:C.key,progress:D/x,value:C.value},{key:y,progress:1,value:{count:C.value.count+1,distance:0}}];var N=this.locationMotionKeyframesLength(this.locationMotion.keyframes),U=this.locationMotionKeyframesLength(w);N===0||N===0?E=0:E=this.locationMotion.getProgressVelocity(m)*N/U}var H=r.effect==="instant"?0:this.calculateMovingDuration(i.duration,r.effect==="fly"?x:0),G={longitude:i.longitude,latitude:i.latitude,fov:i.fov},j=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",_("pano.moveTo",{options:i,prevPano:J,progress:0,state:j,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(j),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,H).catch(Q);else{var X=Qt({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),Z=Qt({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}),W=new f.Object3D;W.lookAt(X);var $=new f.Matrix4().makeRotationFromQuaternion(W.quaternion);W.lookAt(Z);var Y=new f.Matrix4().makeRotationFromQuaternion(W.quaternion),ne=new f.Matrix4().getInverse($).premultiply(Y),te=this.cameraMotion.value.fov,ue=(v=G.fov)!==null&&v!==void 0?v:this.cameraMotion.value.fov,ie=1;r.effect==="zoomin"?ie=1.5:r.effect==="zoomout"&&(ie=.4);for(var ge=de(ue*ie,1,170),pe=0;pe<w.length-1;pe++){var ye=w[pe].key;if(ye){var Be=this.panoResources[ye];Be&&(Be.fixCameraTransform.copy(ne),Be.panoPicture&&(Be.panoPicture.zoom=Math.tan(te/2/180*Math.PI)/Math.tan(ge/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:ge}},{progress:1,value:{longitude:(p=G.longitude)!==null&&p!==void 0?p:this.cameraMotion.value.longitude,latitude:(g=G.latitude)!==null&&g!==void 0?g:this.cameraMotion.value.latitude,fov:ue}}],H).catch(Q)}var Se=this.locationMotion.setKeyframes(w,H,E);Se.then(function(){for(var Te,re,oe=0,q=a.models;oe<q.length;oe++){var De=q[oe];De.show()}var Fe=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",_("pano.arrived",{options:i,prevPano:J,progress:1,state:Fe,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(Fe);var Ie=a.works.getResolvedObserver(e);if(Ie&&Ie.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var Ke=dm.clone().multiply((re=(Te=a.models.getMaterial().pano1)===null||Te===void 0?void 0:Te.matrix)!==null&&re!==void 0?re:new f.Matrix4).multiply(Ie.video.matrix),xe={map:a.videoTexture,size:Ie.video.size,matrix:Ke,alpha:1},ve=Mt(),we=a.videoTexture.image;we.setAttribute("uuid",ve),Cl().then(function(be){be&&Ie.video&&we.getAttribute("uuid")===ve&&(we.oncanplay=function(){we.oncanplay=Q,we.play()},we.ontimeupdate=function(){we.currentTime>.5&&(we.ontimeupdate=Q,a.panoVideo.setMaterial(xe))},we.src=Ie.video.source)}).catch(function(){we.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",_("pano.cancel",{options:i,prevPano:J,progress:0,state:j,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===ze(r.currentPano))return!1;var E=r.works.getResolvedObserver(w);if(!E)return!1;var S=E.standingPosition.clone().project(r.camera);return Math.abs(S.z)>1||Math.abs(S.x)>1||Math.abs(S.y)>1?!1:E.loadable||E.active}),v=d.slice().sort(function(w,E){var S=r.works.getResolvedObserver(w).standingPosition.clone().distanceTo(o),C=r.works.getResolvedObserver(E).standingPosition.clone().distanceTo(o);return S-C}),A=0,h=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];A<h.length;A++)for(var p=h[A],g=0,m=v;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)<p)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!==ze(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===ze(r.currentPano))return!1;var H=r.works.getResolvedObserver(U);return!H||H.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:H.loadable||H.active}),d=this.models.intersectRaycaster(o)[0];if(d){var v=mr(c,function(U){var H=r.works.getResolvedObserver(U);if(!H)return 1/0;var G=H.standingPosition.clone();return G.distanceTo(d.point)},!0),A=v[0],h=v[1];A&&h<this.panoTapTriggerRadius&&(u=(i=this.works.getResolvedObserver(A))!==null&&i!==void 0?i:null)}u||(u=this.getForwardObserverOrNot(o));for(var p=0,g=this.locationMotion.keyframes;p<g.length;p++){var m=g[p],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,E=u.position.clone().setY(0).sub(l.position.clone().setY(0)).normalize(),S=[],C=[],R=[],k=0,M=u.accessibleIds;k<M.length;k++){var A=M[k],I=yt(A);if(!(nr(I,this.currentPano)||nr(I,u.pano))){var L=this.works.getResolvedObserver(A);if(L){var T=L.position.clone().sub(u.position).setY(0);E.angleTo(T)<x&&R.push(T)}}}var B=R.length>0?R:dt(dt([],S,!0),C,!0),D=B.slice().sort(function(U,H){return U.angleTo(E)-H.angleTo(E)})[0];D&&D.angleTo(s)>w&&(b.longitude=Math.atan2(-D.x,-D.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(b.latitude=de(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",_("pano.select",{prevPano:this.currentPano,state:V,userAction:e.userAction,options:b,progress:0,error:null})),u&&!u.active){var N=u.panoId;this.panoMeshes[N]&&(this.panoMeshes[N].setDisabled(!1),this.panoMeshes[N].setLoading(!0))}u&&u.active&&this.emit("pano.request",_("pano.request",{userAction:e.userAction,prevPano:this.currentPano,progress:0,state:V,options:b,error:null}))}}}}},t}(Ml),Ir=Math.PI/180,Bn=180/Math.PI,Il=.001,Tl=1,ni=function(){var n=typeof navigator!="undefined"&&/iPad|iPhone|iPod/.test(navigator.platform);return function(){return n}}(),hm=function(){var n=typeof navigator!="undefined"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return function(){return n}}(),pm=function(){var n=typeof navigator!="undefined"&&navigator.userAgent.indexOf("Firefox")!==-1&&navigator.userAgent.indexOf("Android")!==-1;return function(){return n}}(),Pl=function(){var n=typeof navigator!="undefined"?navigator.userAgent.match(/.*Chrome\/([0-9]+)/):null,t=n?parseInt(n[1],10):null;return function(){return t}}(),vm=function(){var n=!1;if(Pl()===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}}(),mm=function(){var n=ni()&&hm()&&typeof navigator!="undefined"&&navigator.userAgent.indexOf("13_4")!==-1;return function(){return n}}(),Rl=function(){var n=typeof navigator!="undefined"&&navigator.userAgent.indexOf("R7 Build")!==-1;return function(){return n}}();function w0(){var n=typeof window!="undefined"&&(window.orientation==90||window.orientation==-90);return Rl()?!n:n}function Am(n){return!(isNaN(n)||n<=Il||n>Tl)}function gm(n){if(n.w>1)return 0;var t=2*Math.acos(n.w);return t}var E0=function(){var n={};return function(t,e){n[t]===void 0&&(console.warn("cardboard: "+e),n[t]=!0)}}();function S0(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 ym(){if(typeof window=="undefined"||typeof document=="undefined")return!1;var n=window.self!==window.top,t=S0(document.referrer),e=S0(window.location.href);return n&&t!==e}var M0=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,v=u+u,A=o*c,h=o*d,p=o*v,g=s*d,m=s*v,y=u*v,b=l*c,x=l*d,w=l*v;return r[0]=1-(g+y),r[1]=h+w,r[2]=p-x,r[3]=0,r[4]=h-w,r[5]=1-(A+y),r[6]=m+b,r[7]=0,r[8]=p+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,v,A,h,p,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],v=i[3],A=i[4],h=i[5],p=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]=v,r[4]=A,r[5]=h,r[6]=p,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+p*s+b*u+i[14],r[15]=v*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],v=i[7],A=i[8],h=i[9],p=i[10],g=i[11],m=i[12],y=i[13],b=i[14],x=i[15],w=a*c-o*l,E=a*d-s*l,S=a*v-u*l,C=o*d-s*c,R=o*v-u*c,k=s*v-u*d,M=A*y-h*m,I=A*b-p*m,L=A*x-g*m,T=h*b-p*y,B=h*x-g*y,D=p*x-g*b,V=w*D-E*B+S*T+C*L-R*I+k*M;return V?(V=1/V,r[0]=(c*D-d*B+v*T)*V,r[1]=(s*B-o*D-u*T)*V,r[2]=(y*k-b*R+x*C)*V,r[3]=(p*R-h*k-g*C)*V,r[4]=(d*L-l*D-v*I)*V,r[5]=(a*D-s*L+u*I)*V,r[6]=(b*S-m*k-x*E)*V,r[7]=(A*k-p*S+g*E)*V,r[8]=(l*B-c*L+v*M)*V,r[9]=(o*L-a*B-u*M)*V,r[10]=(m*R-y*S+x*w)*V,r[11]=(h*S-A*R-g*w)*V,r[12]=(c*I-l*T-d*M)*V,r[13]=(a*T-o*I+s*M)*V,r[14]=(y*E-m*C-b*w)*V,r[15]=(A*C-h*E+p*w)*V,r):null}return function(r,i,a){n(r,i),a&&t(r,r,a),e(r,r)}}(),Ja=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}(),bm=function(){function n(t,e){this.kFilter=t,this.isDebug=e,this.currentAccelMeasurement=new Ja,this.currentGyroMeasurement=new Ja,this.previousGyroMeasurement=new Ja,ni()?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;Am(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)",Bn*gm(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}(),xm=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<Ir*20)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(Bn*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}(),wm=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}(),Em=function(){function n(){this.angularAcceleration=null,this.angularVelocity=null,this.linearAcceleration=null,this.linearVelocity=null,this.orientation=null,this.position=null}return n}(),C0=function(){function n(){this.leftDegrees=0,this.rightDegrees=0,this.upDegrees=0,this.downDegrees=0}return n}(),Sm=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 bm(t,i),this.posePredictor=new xm(e,i),this.isFirefoxAndroid=pm(),this.isIOS=ni();var a=Pl();this.isDeviceMotionInRadians=!this.isIOS&&a!==null&&a<66,this.isWithoutDeviceMotion=vm()||mm(),this.filterToWorldQ=new f.Quaternion,ni()?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_(),w0()&&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 Em;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(),w0()&&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),M0(t.leftViewMatrix,e,r.left),M0(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 ni()&&ym()&&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*Ir,o=t.left.downDegrees*Ir,s=t.left.leftDegrees*Ir,u=t.left.rightDegrees*Ir,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*Ir,o=t.right.downDegrees*Ir,s=t.right.leftDegrees*Ir,u=t.right.rightDegrees*Ir,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 wm(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=Bn*Math.atan(r.distort(a/i)),c=Bn*Math.atan(r.distort(o/i)),d=Bn*Math.atan(r.distort(s/i)),v=Bn*Math.atan(r.distort(u/i)),A=new C0,h=new C0;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(v,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){E0("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),this.previousTimestampS=i;return}else if(a<=Il||a>Tl){E0("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&&(Rl()?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}(),Fi=[0,0,.5,1],Li=[.5,0,.5,1],Mm=function(){function n(t){var e=this;this.renderer=t,this.sensor=new Sm(.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*Fi[0]),y:Math.round(r.height*Fi[1]),width:Math.round(r.width*Fi[2]),height:Math.round(r.height*Fi[3])},o={x:Math.round(r.width*Li[0]),y:Math.round(r.height*Li[1]),width:Math.round(r.width*Li[2]),height:Math.round(r.height*Li[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 Cm="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADqCAMAAAAvZYhaAAAC/VBMVEUAAAD///99fX37+/v5+fn29vbx8fHv7+/Nzc3o6Ojq6urh4eHU1NTR0dGDg4Pl5eWSkpLHx8fj4+Pe3t7X19fAwMDZ2dnCwsKrq6uioqLb29uNjY2enp67u7t5eXmAgIC2traWlpa5ubnKysqmpqZycnKHh4eurq6ysrKKioqDg4Pd3d12dnb9/f1vb2/s7OxlZWXz8/OoqKiZmZlpaWmbm5teXl7W1tbJycnExMRiYmJsbGywsLCPj49aWlq9vb1UVFRYWFhra2t+fn7t7e1RUVFOTk6Dg4OAgICCgoKKioqEhISIiIhqamqCgoKIiIiQkJCIiIi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C3JoGAkRHH1JKjpNEcCxOV2I8MWyiUJqNVajSVodgiWcVMVLVeSS1ATCZoc88qjVKlSc3kSLJ5c5V6rTZQAcVkGbBeuOkgCgq2CBM3MoFwGr1tvim2aMpZZqyBBc3N1UF2GX90j9SQJKCBB83OfYAcNVjFcSrvzo95WOShB83Ody5V24fqzO0nAUSzB/89Nph38VqmuOa3gticJOP9fApuHTDt4nFJ7AXdPC0lg8/gq8y5XapSrgpUgbQ0JpF5u97hS1fOC26nlJJA8Yd41Sg3fU4dtRQkKeXSN3jo4Qqm0397OmyZOGatoDrScBIWM3DFn5kXi1ZyqRSUoZtKOa1vWKArztqgEnhIHty4f9/btuEstKwGkxf+XuCT5CbTFnFRuxktuAAAAAElFTkSuQmCC";var _a,Xa={zh:{TITLE:"眼镜模式",HIT:"请将手机横屏放入 VR 眼镜中"},en:{TITLE:"GLASSES MODE",HIT:"Please put the mobile phone horizontally into the VR glasses."},ja:{TITLE:"メガネモード",HIT:"携帯電話をVRメガネに水平に入れてください。"}},I0=typeof navigator!="undefined"&&(_a=Xa[navigator.language.split("-")[0]])!==null&&_a!==void 0?_a:Xa.zh,Tm=`
1593
1593
  <style>
1594
1594
  .$id {
1595
1595
  all: initial;
@@ -1950,7 +1950,7 @@ void main() {
1950
1950
 
1951
1951
  gl_FragColor = vec4(gl_FragColor.rgb, gl_FragColor.a * opacity * outside * inside);
1952
1952
  }
1953
- `,Om=function(n){se(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 Me({ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}),e.opacityMotion=new Me({opacity:0}),e.loadingMotion=new Me({opacity:0}),e.disableMotion=new Me({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(Wa,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(Wa,new f.ShaderMaterial(O(O({},r),{vertexShader:Lm,fragmentShader:km,uniforms:{opacity:{value:0}}}))),e.panoMesh=new f.Mesh(Wa,new f.ShaderMaterial(O(O({},r),{vertexShader:Bm,fragmentShader:Fm,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=de(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),Dm=1500,Vm=function(n){se(t,n);function t(e){var r=this,i=t.parseArgs(e);r=n.call(this,i)||this,r.mode="VRPanorama",r.cardboard=new Mm(r.renderer);var a=Rm();r.helperElement=a;var o=new Xn(a);return r.element.parentNode&&(r.element.parentNode.insertBefore(a,r.element),r.setHelperElementSize(),o.on("tap",function(){return r.emit("vr.requestExit",J("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.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(ze(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 Om;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,v,A,h;if(!this.destroyed){var p=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(de(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var w=this.locationMotion.getKeyFrameSegment(e),E=w[0],S=w[1],C=this.panoResourceFromLocationMotionKeyframe(E),R=this.panoResourceFromLocationMotionKeyframe(S),k=C.position,M=R.position,I=this.locationMotion.value.count-S.value.count+1;g.progress=I,R.panoPicture&&(I<1?C.panoPicture&&(g.pano0=C.panoPicture):g.pano0=R.panoPicture,g.pano1=R.panoPicture),R.effect==="montage"?g.transition="BLACK":R.effect==="spread"?g.transition="SPREAD":g.transition="FADE",(R.effect==="zoomin"||R.effect==="zoomout")&&(g.progress=Math.pow(I,3)),I<1&&R.effect!=="fly"&&(g.pano0&&C.panoPicture&&(g.pano0={map:g.pano0.map,zoom:g.pano0.zoom,luminanceMap:g.pano0.luminanceMap,matrix:C.panoPicture.matrix.clone().premultiply(C.fixCameraTransform).setPosition(R.position)}),k.copy(M),x=!0),m.distance=this.locationMotion.value.distance,m.offset=new f.Vector3(k.x+(M.x-k.x)*I,k.y+(M.y-k.y)*I,k.z+(M.z-k.z)*I);for(var L=[],T=[],B=0,D=this.locationMotion.keyframes;B<D.length;B++){var V=D[B],N=V.key,U=V.progress;N!==void 0&&(L.push(N),U>this.locationMotion.progress&&T.push(N))}for(var H=0,G=Object.keys(this.panoResources);H<G.length;H++){var j=G[H];if(!(T.indexOf(j)>=0)){var _=this.panoResources[j];if(_.panoPicture){var X=_.panoPicture.map,Z=_.panoPicture.luminanceMap;if(X){if(X===((a=g.pano0)===null||a===void 0?void 0:a.map)||X===((o=g.pano1)===null||o===void 0?void 0:o.map))continue;X instanceof Ve&&X.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(X.cubeRenderTarget),X.dispose(),Z&&(Z instanceof Ve&&Z.cubeRenderTarget&&this.luminanceCubeRenderTargetPool.push(Z.cubeRenderTarget),Z.dispose()),_.panoPicture=null}}L.indexOf(j)>=0||delete this.panoResources[j]}}this.currentPano=yt(R.panoId),this.emit("pano.moving",J("pano.moving",{userAction:this.userAction,prevPano:yt(y.panoId),state:O(O(O(O({},yt(b.panoId)),{mode:this.mode}),Je(this.camera.pose)),m),options:{},progress:this.locationMotion.progress,error:null}))}Gt(g)===!1&&(!((s=g.pano0)===null||s===void 0)&&s.map&&g.pano0.map instanceof Ve&&!g.pano0.map.cubeRenderTarget&&(g.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((u=g.pano0)===null||u===void 0)&&u.luminanceMap&&g.pano0.luminanceMap instanceof Ve&&!g.pano0.luminanceMap.cubeRenderTarget&&(g.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),!((l=g.pano1)===null||l===void 0)&&l.map&&g.pano1.map instanceof Ve&&!g.pano1.map.cubeRenderTarget&&(g.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((c=g.pano1)===null||c===void 0)&&c.luminanceMap&&g.pano1.luminanceMap instanceof Ve&&!g.pano1.luminanceMap.cubeRenderTarget&&(g.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.models.setMaterial(g)),m.offset&&this.camera.position.copy(m.offset),nr(this.currentPano,p)&&this.updatePanoMeshesVisible();var W=this.camera.pose.longitude,$=this.camera.pose.latitude;this.camera.quaternion.fromArray(this.cardboard.sensor.getOrientation()),this.camera.computePose();var Y=this.works.getResolvedObserver(this.currentPano);if(this.camera.pose.distance>.1||x)for(var ne=0,te=Object.keys(this.panoMeshes);ne<te.length;ne++){var ue=te[ne],ie=this.panoMeshes[ue];ie.setOpacity(0),ie.updateTime&&ie.updateTime(e,r),ie.visible=!1}else if(Y)for(var ge=Y.visibleIds.concat(ze(this.currentPano)),pe=0,ye=ge;pe<ye.length;pe++){var ue=ye[pe],Be=yt(ue),Se=this.works.getResolvedObserver(Be);if(Se){var ie=this.panoMeshes[ue];if(!Se.loadable&&!Se.active){ie.setOpacity(0);continue}var Te=ie.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Te<.05?ie.setOpacity(0):ie.setOpacity(de(1.5/Te,0,1)),nr(this.currentPano,Be)&&ie.setOpacity(0),ie.lookAt(this.camera.position)}}if(this.locationMotion.ended)for(var re=this.intersect(e),oe=0,q=this.works.resolvedObservers;oe<q.length;oe++){var Se=q[oe],ie=this.panoMeshes[Se.panoId];ie&&(ie.setCurrent(ie===re),ie.updateTime&&ie.updateTime(e,r))}(W!==this.camera.pose.longitude||$!==this.camera.pose.latitude)&&(this.cameraMotion.set(Ut(this.camera.pose,["longitude","latitude"]),0).catch(Q),this.emit("camera.update",J("camera.update",{userAction:!0,state:O(O(O({},this.currentPano),{mode:this.mode}),Je(this.camera.pose))})));var De=this.tileLevel=function(){if(i.tileLevelForFov===!1)return 0;var ve=i.renderer.getDrawingBufferSize(new f.Vector2);ve.width*=i.scissor.width,ve.height*=i.scissor.height;var we=b.panoId,be=i.works.getResolvedObserver(we),me=i.imageOptions.size;if(typeof me=="undefined"&&be){var Ue=be.images.up.match(/\/cube_(\d+)\//);Ue&&(me=Number(Ue[1]))}typeof me=="undefined"&&(me=2048);var je=0;me>=1024&&(je=1),me>=2048&&(je=2),me>=4096&&(je=3),me>=8192&&(je=4);var it=i.tileLevelForFov(i.camera.fov,ve);return it>je?it:0}(),Fe=function(){var ve=i.camera.quaternion.clone(),we=i.works.getResolvedObserver(b.panoId),be=we!=null?we:Y;be&&ve.premultiply(be.quaternion.clone().inverse());var me=new f.Matrix4().makeRotationFromQuaternion(ve),Ue=new f.Matrix4().getInverse(me),je=new f.Frustum().setFromProjectionMatrix(new f.Matrix4().multiplyMatrices(i.camera.projectionMatrix,Ue));return je}();b.panoId===ze(this.currentPano)&&(((d=b.panoPicture)===null||d===void 0?void 0:d.map)instanceof Ve&&(b.panoPicture.map.maxRequest=this.tileMaxRequest,b.panoPicture.map.update(Fe,De),b.panoPicture.map.needsRender===!0&&(b.panoPicture.map.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)),((v=b.panoPicture)===null||v===void 0?void 0:v.luminanceMap)instanceof Ve&&(b.panoPicture.luminanceMap.maxRequest=this.tileMaxRequest,b.panoPicture.luminanceMap.update(Fe,De),b.panoPicture.luminanceMap.needsRender===!0&&(b.panoPicture.luminanceMap.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)));{var Ie=this.tiling.object.visible;if(this.initAnimationed){var Ke=b.panoId,xe=this.works.getResolvedObserver(Ke);xe?bi(this.camera.position,xe.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==Ke&&this.tiling.cleanup(),this.tiling.panoId=Ke,this.tiling.setResource((h=(A=xe.images)===null||A===void 0?void 0:A.tiles)!==null&&h!==void 0?h:[],this.enableIOSEDR&&xe.images.luminance?xe.images.luminance:null),this.tiling.setFetcher(st(xe.work)),this.tiling.setRotation(xe.quaternion),this.tiling.setPosition(xe.position),this.tiling.maxRequest=this.tileMaxRequest,De>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(Fe,De,e):this.tiling.update(Fe,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;Ie!==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>Dm){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(yt(s),{},!0),delete this.activePanoMesh,delete this.activeTime,a}var d=this.camera.getDirection(new f.Vector3),v=new f.Raycaster(this.camera.position,d);v.params.Points={threshold:.1};for(var A=void 0,h=[],p=this.works.getResolvedObserver(this.currentPano),g=p?p.visibleIds:[],m=0,y=g;m<y.length;m++){var s=y[m],b=this.panoMeshes[s],x=v.intersectObject((r=b.hitTestMesh)!==null&&r!==void 0?r:b,!0)[0];x&&h.push({panoMesh:b,intersection:O({floor:(i=p==null?void 0:p.floorIndex)!==null&&i!==void 0?i:0},x)})}var w=h.sort(function(k,M){return k.intersection.distance-M.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(v)[0]);var E=J("intersect.update",{raycaster:v,intersection:A!=null?A:null,object:this.intersectMesh});if(this.emit("intersect.update",E),E.defaultPrevented){this.hideIntersectMesh();return}if(A&&A.face){var S=A.face.normal,C=new f.Quaternion;C.setFromUnitVectors(new f.Vector3(0,0,1),S),this.intersectMesh.quaternion.copy(C);var R=A.point.clone();this.intersectMesh.position.copy(R),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}(Wo),zm=new f.Vector3(0,1.6,0),Nm=function(n){se(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 Me({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 Me({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Me({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,v=d.state,A=d.currentState,h=typeof v.panoIndex=="number"?{workCode:(a=(r=v.workCode)!==null&&r!==void 0?r:(i=l.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:v.panoIndex}:{workCode:A.workCode,panoIndex:A.panoIndex},p=c.getResolvedObserver(h),g=(o=v.longitude)!==null&&o!==void 0?o:A.longitude,m=de((s=v.latitude)!==null&&s!==void 0?s:!p||ui(A.mode)?A.latitude:l.defaultLatitude,l.minLatitude,l.maxLatitude),y=de((u=v.fov)!==null&&u!==void 0?u:!p||ui(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(p)b.copy(p.position);else{var x=Qt(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.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(de(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=mr(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),Gt(i)||this.models.setMaterial(i),Gt(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",J("initAnimation.start",{state:d,userAction:e.userAction}))},moveEndCallback:function(d){e.emit("initAnimation.end",J("initAnimation.end",{state:d,userAction:e.userAction})),r()},moveCancelCallback:function(){var d=e.currentPano,v=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",J("initAnimation.end",{state:v,userAction:e.userAction})),r()}};e.moveToPosition(s.offset,c,o)})},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(he())[1],r=this.locationMotion.getKeyFrameSegment(he())[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=he(),c=new f.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),d=c.distanceTo(e),v=this.locationMotion.getProgressVelocity(l),A=0,h=1;h<this.locationMotion.keyframes.length;h++){var p=this.locationMotion.keyframes[h-1].value,g=p.x,m=p.y,y=p.z,b=this.locationMotion.keyframes[h].value,x=b.x,w=b.y,E=b.z;A+=Math.sqrt(Math.pow(x-g,2)+Math.pow(w-m,2)+Math.pow(E-y,2))}var S=d===0?0:v*A/d,C=this.calculateMovingDuration(r.duration,d),R={x:e.x,y:e.y,z:e.z,distance:0},k={longitude:r.longitude,latitude:r.latitude,fov:r.fov},M=this.works.resolvedObservers,I=mr(M,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=k.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=k.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(u=k.fov)!==null&&u!==void 0?u:this.camera.pose.fov,offset:e.clone(),distance:0}),B=this.currentPano;this.emit("pano.moveTo",J("pano.moveTo",{options:r,prevPano:B,progress:0,state:T,userAction:this.userAction,error:null})),r.moveStartCallback&&r.moveStartCallback(T),this.cameraMotion.set(k,C).catch(Q),this.locationMotion.set(R,C,S).then(function(){for(var D=0,V=a.models;D<V.length;D++){var N=V[D];N.show()}var U=O(O(O({},L),{mode:a.mode}),Je(a.camera.pose));a.emit("pano.arrived",J("pano.arrived",{options:r,prevPano:B,progress:0,state:U,userAction:a.userAction,error:null})),r.moveEndCallback&&r.moveEndCallback(U)},function(){r.moveCancelCallback&&r.moveCancelCallback(),a.emit("pano.cancel",J("pano.cancel",{options:r,prevPano:B,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(zm),l=this.works.resolvedObservers,c=mr(l,function(A){return A.position.distanceTo(u)},!0),d=c[0],v=c[1];d&&v<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}(Ml);const Qm=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-
1953
+ `,Om=function(n){se(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 Me({ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}),e.opacityMotion=new Me({opacity:0}),e.loadingMotion=new Me({opacity:0}),e.disableMotion=new Me({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(Wa,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(Wa,new f.ShaderMaterial(O(O({},r),{vertexShader:Lm,fragmentShader:km,uniforms:{opacity:{value:0}}}))),e.panoMesh=new f.Mesh(Wa,new f.ShaderMaterial(O(O({},r),{vertexShader:Bm,fragmentShader:Fm,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=de(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),Dm=1500,Vm=function(n){se(t,n);function t(e){var r=this,i=t.parseArgs(e);r=n.call(this,i)||this,r.mode="VRPanorama",r.cardboard=new Mm(r.renderer);var a=Rm();r.helperElement=a;var o=new Xn(a);return r.element.parentNode&&(r.element.parentNode.insertBefore(a,r.element),r.setHelperElementSize(),o.on("tap",function(){return r.emit("vr.requestExit",_("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.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(ze(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 Om;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,v,A,h;if(!this.destroyed){var p=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(de(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var w=this.locationMotion.getKeyFrameSegment(e),E=w[0],S=w[1],C=this.panoResourceFromLocationMotionKeyframe(E),R=this.panoResourceFromLocationMotionKeyframe(S),k=C.position,M=R.position,I=this.locationMotion.value.count-S.value.count+1;g.progress=I,R.panoPicture&&(I<1?C.panoPicture&&(g.pano0=C.panoPicture):g.pano0=R.panoPicture,g.pano1=R.panoPicture),R.effect==="montage"?g.transition="BLACK":R.effect==="spread"?g.transition="SPREAD":g.transition="FADE",(R.effect==="zoomin"||R.effect==="zoomout")&&(g.progress=Math.pow(I,3)),I<1&&R.effect!=="fly"&&(g.pano0&&C.panoPicture&&(g.pano0={map:g.pano0.map,zoom:g.pano0.zoom,luminanceMap:g.pano0.luminanceMap,matrix:C.panoPicture.matrix.clone().premultiply(C.fixCameraTransform).setPosition(R.position)}),k.copy(M),x=!0),m.distance=this.locationMotion.value.distance,m.offset=new f.Vector3(k.x+(M.x-k.x)*I,k.y+(M.y-k.y)*I,k.z+(M.z-k.z)*I);for(var L=[],T=[],B=0,D=this.locationMotion.keyframes;B<D.length;B++){var V=D[B],N=V.key,U=V.progress;N!==void 0&&(L.push(N),U>this.locationMotion.progress&&T.push(N))}for(var H=0,G=Object.keys(this.panoResources);H<G.length;H++){var j=G[H];if(!(T.indexOf(j)>=0)){var J=this.panoResources[j];if(J.panoPicture){var X=J.panoPicture.map,Z=J.panoPicture.luminanceMap;if(X){if(X===((a=g.pano0)===null||a===void 0?void 0:a.map)||X===((o=g.pano1)===null||o===void 0?void 0:o.map))continue;X instanceof Ve&&X.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(X.cubeRenderTarget),X.dispose(),Z&&(Z instanceof Ve&&Z.cubeRenderTarget&&this.luminanceCubeRenderTargetPool.push(Z.cubeRenderTarget),Z.dispose()),J.panoPicture=null}}L.indexOf(j)>=0||delete this.panoResources[j]}}this.currentPano=yt(R.panoId),this.emit("pano.moving",_("pano.moving",{userAction:this.userAction,prevPano:yt(y.panoId),state:O(O(O(O({},yt(b.panoId)),{mode:this.mode}),_e(this.camera.pose)),m),options:{},progress:this.locationMotion.progress,error:null}))}Gt(g)===!1&&(!((s=g.pano0)===null||s===void 0)&&s.map&&g.pano0.map instanceof Ve&&!g.pano0.map.cubeRenderTarget&&(g.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((u=g.pano0)===null||u===void 0)&&u.luminanceMap&&g.pano0.luminanceMap instanceof Ve&&!g.pano0.luminanceMap.cubeRenderTarget&&(g.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),!((l=g.pano1)===null||l===void 0)&&l.map&&g.pano1.map instanceof Ve&&!g.pano1.map.cubeRenderTarget&&(g.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((c=g.pano1)===null||c===void 0)&&c.luminanceMap&&g.pano1.luminanceMap instanceof Ve&&!g.pano1.luminanceMap.cubeRenderTarget&&(g.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.models.setMaterial(g)),m.offset&&this.camera.position.copy(m.offset),nr(this.currentPano,p)&&this.updatePanoMeshesVisible();var W=this.camera.pose.longitude,$=this.camera.pose.latitude;this.camera.quaternion.fromArray(this.cardboard.sensor.getOrientation()),this.camera.computePose();var Y=this.works.getResolvedObserver(this.currentPano);if(this.camera.pose.distance>.1||x)for(var ne=0,te=Object.keys(this.panoMeshes);ne<te.length;ne++){var ue=te[ne],ie=this.panoMeshes[ue];ie.setOpacity(0),ie.updateTime&&ie.updateTime(e,r),ie.visible=!1}else if(Y)for(var ge=Y.visibleIds.concat(ze(this.currentPano)),pe=0,ye=ge;pe<ye.length;pe++){var ue=ye[pe],Be=yt(ue),Se=this.works.getResolvedObserver(Be);if(Se){var ie=this.panoMeshes[ue];if(!Se.loadable&&!Se.active){ie.setOpacity(0);continue}var Te=ie.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Te<.05?ie.setOpacity(0):ie.setOpacity(de(1.5/Te,0,1)),nr(this.currentPano,Be)&&ie.setOpacity(0),ie.lookAt(this.camera.position)}}if(this.locationMotion.ended)for(var re=this.intersect(e),oe=0,q=this.works.resolvedObservers;oe<q.length;oe++){var Se=q[oe],ie=this.panoMeshes[Se.panoId];ie&&(ie.setCurrent(ie===re),ie.updateTime&&ie.updateTime(e,r))}(W!==this.camera.pose.longitude||$!==this.camera.pose.latitude)&&(this.cameraMotion.set(Ut(this.camera.pose,["longitude","latitude"]),0).catch(Q),this.emit("camera.update",_("camera.update",{userAction:!0,state:O(O(O({},this.currentPano),{mode:this.mode}),_e(this.camera.pose))})));var De=this.tileLevel=function(){if(i.tileLevelForFov===!1)return 0;var ve=i.renderer.getDrawingBufferSize(new f.Vector2);ve.width*=i.scissor.width,ve.height*=i.scissor.height;var we=b.panoId,be=i.works.getResolvedObserver(we),me=i.imageOptions.size;if(typeof me=="undefined"&&be){var Ue=be.images.up.match(/\/cube_(\d+)\//);Ue&&(me=Number(Ue[1]))}typeof me=="undefined"&&(me=2048);var je=0;me>=1024&&(je=1),me>=2048&&(je=2),me>=4096&&(je=3),me>=8192&&(je=4);var it=i.tileLevelForFov(i.camera.fov,ve);return it>je?it:0}(),Fe=function(){var ve=i.camera.quaternion.clone(),we=i.works.getResolvedObserver(b.panoId),be=we!=null?we:Y;be&&ve.premultiply(be.quaternion.clone().inverse());var me=new f.Matrix4().makeRotationFromQuaternion(ve),Ue=new f.Matrix4().getInverse(me),je=new f.Frustum().setFromProjectionMatrix(new f.Matrix4().multiplyMatrices(i.camera.projectionMatrix,Ue));return je}();b.panoId===ze(this.currentPano)&&(((d=b.panoPicture)===null||d===void 0?void 0:d.map)instanceof Ve&&(b.panoPicture.map.maxRequest=this.tileMaxRequest,b.panoPicture.map.update(Fe,De),b.panoPicture.map.needsRender===!0&&(b.panoPicture.map.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)),((v=b.panoPicture)===null||v===void 0?void 0:v.luminanceMap)instanceof Ve&&(b.panoPicture.luminanceMap.maxRequest=this.tileMaxRequest,b.panoPicture.luminanceMap.update(Fe,De),b.panoPicture.luminanceMap.needsRender===!0&&(b.panoPicture.luminanceMap.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)));{var Ie=this.tiling.object.visible;if(this.initAnimationed){var Ke=b.panoId,xe=this.works.getResolvedObserver(Ke);xe?bi(this.camera.position,xe.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==Ke&&this.tiling.cleanup(),this.tiling.panoId=Ke,this.tiling.setResource((h=(A=xe.images)===null||A===void 0?void 0:A.tiles)!==null&&h!==void 0?h:[],this.enableIOSEDR&&xe.images.luminance?xe.images.luminance:null),this.tiling.setFetcher(st(xe.work)),this.tiling.setRotation(xe.quaternion),this.tiling.setPosition(xe.position),this.tiling.maxRequest=this.tileMaxRequest,De>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(Fe,De,e):this.tiling.update(Fe,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;Ie!==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>Dm){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(yt(s),{},!0),delete this.activePanoMesh,delete this.activeTime,a}var d=this.camera.getDirection(new f.Vector3),v=new f.Raycaster(this.camera.position,d);v.params.Points={threshold:.1};for(var A=void 0,h=[],p=this.works.getResolvedObserver(this.currentPano),g=p?p.visibleIds:[],m=0,y=g;m<y.length;m++){var s=y[m],b=this.panoMeshes[s],x=v.intersectObject((r=b.hitTestMesh)!==null&&r!==void 0?r:b,!0)[0];x&&h.push({panoMesh:b,intersection:O({floor:(i=p==null?void 0:p.floorIndex)!==null&&i!==void 0?i:0},x)})}var w=h.sort(function(k,M){return k.intersection.distance-M.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(v)[0]);var E=_("intersect.update",{raycaster:v,intersection:A!=null?A:null,object:this.intersectMesh});if(this.emit("intersect.update",E),E.defaultPrevented){this.hideIntersectMesh();return}if(A&&A.face){var S=A.face.normal,C=new f.Quaternion;C.setFromUnitVectors(new f.Vector3(0,0,1),S),this.intersectMesh.quaternion.copy(C);var R=A.point.clone();this.intersectMesh.position.copy(R),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}(Wo),zm=new f.Vector3(0,1.6,0),Nm=function(n){se(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 Me({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 Me({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Me({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,v=d.state,A=d.currentState,h=typeof v.panoIndex=="number"?{workCode:(a=(r=v.workCode)!==null&&r!==void 0?r:(i=l.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:v.panoIndex}:{workCode:A.workCode,panoIndex:A.panoIndex},p=c.getResolvedObserver(h),g=(o=v.longitude)!==null&&o!==void 0?o:A.longitude,m=de((s=v.latitude)!==null&&s!==void 0?s:!p||ui(A.mode)?A.latitude:l.defaultLatitude,l.minLatitude,l.maxLatitude),y=de((u=v.fov)!==null&&u!==void 0?u:!p||ui(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(p)b.copy(p.position);else{var x=Qt(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.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(de(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=mr(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),Gt(i)||this.models.setMaterial(i),Gt(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",_("initAnimation.start",{state:d,userAction:e.userAction}))},moveEndCallback:function(d){e.emit("initAnimation.end",_("initAnimation.end",{state:d,userAction:e.userAction})),r()},moveCancelCallback:function(){var d=e.currentPano,v=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",_("initAnimation.end",{state:v,userAction:e.userAction})),r()}};e.moveToPosition(s.offset,c,o)})},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(he())[1],r=this.locationMotion.getKeyFrameSegment(he())[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=he(),c=new f.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),d=c.distanceTo(e),v=this.locationMotion.getProgressVelocity(l),A=0,h=1;h<this.locationMotion.keyframes.length;h++){var p=this.locationMotion.keyframes[h-1].value,g=p.x,m=p.y,y=p.z,b=this.locationMotion.keyframes[h].value,x=b.x,w=b.y,E=b.z;A+=Math.sqrt(Math.pow(x-g,2)+Math.pow(w-m,2)+Math.pow(E-y,2))}var S=d===0?0:v*A/d,C=this.calculateMovingDuration(r.duration,d),R={x:e.x,y:e.y,z:e.z,distance:0},k={longitude:r.longitude,latitude:r.latitude,fov:r.fov},M=this.works.resolvedObservers,I=mr(M,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=k.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=k.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(u=k.fov)!==null&&u!==void 0?u:this.camera.pose.fov,offset:e.clone(),distance:0}),B=this.currentPano;this.emit("pano.moveTo",_("pano.moveTo",{options:r,prevPano:B,progress:0,state:T,userAction:this.userAction,error:null})),r.moveStartCallback&&r.moveStartCallback(T),this.cameraMotion.set(k,C).catch(Q),this.locationMotion.set(R,C,S).then(function(){for(var D=0,V=a.models;D<V.length;D++){var N=V[D];N.show()}var U=O(O(O({},L),{mode:a.mode}),_e(a.camera.pose));a.emit("pano.arrived",_("pano.arrived",{options:r,prevPano:B,progress:0,state:U,userAction:a.userAction,error:null})),r.moveEndCallback&&r.moveEndCallback(U)},function(){r.moveCancelCallback&&r.moveCancelCallback(),a.emit("pano.cancel",_("pano.cancel",{options:r,prevPano:B,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(zm),l=this.works.resolvedObservers,c=mr(l,function(A){return A.position.distanceTo(u)},!0),d=c[0],v=c[1];d&&v<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}(Ml);const Qm=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-
1954
1954
  b-J-HrpA-z]|vv|{-J-z|qrycvrZnv\x07-7-rpA5}|vv|{9>;=6Htyl]|vv|{-J-}|wrpv|{Znv\x07-7-z]|vv|{H\f`),Um=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
1955
1955
  --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
1956
1956
  ----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
@@ -1960,10 +1960,10 @@ void main() {
1960
1960
  --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--
1961
1961
  -<<-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
1962
1962
  ----qvpnqH--\f\f`);var Hm=function(n){se(t,n);function t(e){var r=n.call(this)||this;return r.uniforms={screenWidth:Lt("f",0),screenHeight:Lt("f",0),edlStrength:Lt("f",1),uNear:Lt("f",1),uFar:Lt("f",1),radius:Lt("f",1),neighbours:Lt("2fv",new Float32Array),depthMap:Lt("t",new f.Texture),uEDLColor:Lt("t",new f.Texture),uEDLDepth:Lt("t",new f.Texture),opacity:Lt("f",1),uProj:Lt("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+`
1963
- `,e},t.prototype.updateShaderSource=function(){var e=this.getDefines()+Qm,r=this.getDefines()+Um;this.setValues({vertexShader:e,fragmentShader:r}),this.needsUpdate=!0},Tt([$t("screenWidth"),Pt("design:type",Number)],t.prototype,"screenWidth",void 0),Tt([$t("screenHeight"),Pt("design:type",Number)],t.prototype,"screenHeight",void 0),Tt([$t("edlStrength"),Pt("design:type",Number)],t.prototype,"edlStrength",void 0),Tt([$t("uNear"),Pt("design:type",Number)],t.prototype,"uNear",void 0),Tt([$t("uFar"),Pt("design:type",Number)],t.prototype,"uFar",void 0),Tt([$t("radius"),Pt("design:type",Number)],t.prototype,"radius",void 0),Tt([$t("neighbours",!0),Pt("design:type",Float32Array)],t.prototype,"neighbours",void 0),Tt([$t("depthMap"),Pt("design:type",f.Texture)],t.prototype,"depthMap",void 0),Tt([$t("uEDLColor"),Pt("design:type",f.Texture)],t.prototype,"uEDLColor",void 0),Tt([$t("uEDLDepth"),Pt("design:type",f.Texture)],t.prototype,"uEDLDepth",void 0),Tt([$t("uProj"),Pt("design:type",Array)],t.prototype,"uProj",void 0),t}(f.RawShaderMaterial);function Lt(n,t){return{type:n,value:t}}function $t(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 qm=new f.OrthographicCamera(-1,1,1,-1,0,1),Zo=new f.BufferGeometry;Zo.setAttribute("position",new f.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));Zo.setAttribute("uv",new f.Float32BufferAttribute([0,2,0,0,2,0],2));var Bl=new f.Mesh(Zo),Fl=new f.Scene;Fl.add(Bl);var Gm=function(n){se(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 Hm,Bl.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=.25,i.radius.value=1,i.opacity.value=1,this.renderer.setRenderTarget(e[1]),this.renderer.render(Fl,qm)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(Jo);const Km=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-
1963
+ `,e},t.prototype.updateShaderSource=function(){var e=this.getDefines()+Qm,r=this.getDefines()+Um;this.setValues({vertexShader:e,fragmentShader:r}),this.needsUpdate=!0},Tt([$t("screenWidth"),Pt("design:type",Number)],t.prototype,"screenWidth",void 0),Tt([$t("screenHeight"),Pt("design:type",Number)],t.prototype,"screenHeight",void 0),Tt([$t("edlStrength"),Pt("design:type",Number)],t.prototype,"edlStrength",void 0),Tt([$t("uNear"),Pt("design:type",Number)],t.prototype,"uNear",void 0),Tt([$t("uFar"),Pt("design:type",Number)],t.prototype,"uFar",void 0),Tt([$t("radius"),Pt("design:type",Number)],t.prototype,"radius",void 0),Tt([$t("neighbours",!0),Pt("design:type",Float32Array)],t.prototype,"neighbours",void 0),Tt([$t("depthMap"),Pt("design:type",f.Texture)],t.prototype,"depthMap",void 0),Tt([$t("uEDLColor"),Pt("design:type",f.Texture)],t.prototype,"uEDLColor",void 0),Tt([$t("uEDLDepth"),Pt("design:type",f.Texture)],t.prototype,"uEDLDepth",void 0),Tt([$t("uProj"),Pt("design:type",Array)],t.prototype,"uProj",void 0),t}(f.RawShaderMaterial);function Lt(n,t){return{type:n,value:t}}function $t(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 qm=new f.OrthographicCamera(-1,1,1,-1,0,1),Zo=new f.BufferGeometry;Zo.setAttribute("position",new f.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));Zo.setAttribute("uv",new f.Float32BufferAttribute([0,2,0,0,2,0],2));var Bl=new f.Mesh(Zo),Fl=new f.Scene;Fl.add(Bl);var Gm=function(n){se(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 Hm,Bl.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=.25,i.radius.value=1,i.opacity.value=1,this.renderer.setRenderTarget(e[1]),this.renderer.render(Fl,qm)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(_o);const Km=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-
1964
1964
  sy|n-qr}u-J-r\x07r?Q5Qr}uZn}9-b6;Hvs5qr}u-KJ->;=6
1965
1965
  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`),jm=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-
1966
- b-J-Htyl]|vv|{-J-}|wrpv|{Znv\x07-7-z|qrycvrZnv\x07-7-rpA5}|vv|{9>;=6H\f`);var _m=function(n){se(t,n);function t(e){var r=n.call(this,{vertexShader:jm,fragmentShader:Km})||this;return r.uniforms={uDepthMap:T0("t",null),uWeightMap:T0("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}},Tt([P0("uDepthMap"),Pt("design:type",Number)],t.prototype,"uDepthMap",void 0),Tt([P0("uWeightMap"),Pt("design:type",Number)],t.prototype,"uWeightMap",void 0),t}(f.RawShaderMaterial);function T0(n,t){return{type:n,value:t}}function P0(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 Jm=new f.OrthographicCamera(-1,1,1,-1,0,1),Yo=new f.BufferGeometry;Yo.setAttribute("position",new f.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));Yo.setAttribute("uv",new f.Float32BufferAttribute([0,2,0,0,2,0],2));var Ll=new f.Mesh(Yo),kl=new f.Scene;kl.add(Ll);var Xm=function(n){se(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 _m,o.camera=i,Ll.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(kl,Jm)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(Jo),Za=.5,Ya=.5,R0=Math.PI/7,Wm=function(n){se(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 Me({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 Me({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Me({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 Gm(r.renderer,r.modelScene,r.camera,r.models),r.hqEffect=new Xm(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:Math.PI/4,defaultLatitude:(i=e.defaultLatitude)!==null&&i!==void 0?i:Math.PI/4,defaultDistance:(a=e.defaultDistance)!==null&&a!==void 0?a:150,maxLatitude:(o=e.maxLatitude)!==null&&o!==void 0?o:+Math.PI/2,minLatitude:(s=e.minLatitude)!==null&&s!==void 0?s:0,cameraType:(u=e.cameraType)!==null&&u!==void 0?u:"auto",modelInScreen:(l=e.modelInScreen)!==null&&l!==void 0?l:"boundingbox-center",intersectMeshCreator:(c=e.intersectMeshCreator)!==null&&c!==void 0?c:function(){return new aa}})},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,v=c.models,A=e.initial,h=A.state,p=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:p.workCode,panoIndex:p.panoIndex},m=d.getResolvedObserver(g),y=(o=h.fov)!==null&&o!==void 0?o:60,b=de((s=h.latitude)!==null&&s!==void 0?s:yo(p.mode)?p.latitude:c.defaultLatitude,c.minLatitude,c.maxLatitude),x=t.distanceFromModel(c.models,y,c.camera.aspect),w=new f.Vector3,E=(u=h.distance)!==null&&u!==void 0?u:Math.min(c.defaultDistance,x),S=(l=h.longitude)!==null&&l!==void 0?l:yo(p.mode)?p.longitude:c.defaultLongitude;return h.offset?w.copy(h.offset):c.defaultDistance<x&&m?(w.copy(m.position),h.longitude===void 0&&(S=p.longitude)):w.copy(v.bounding.getCenter(w)),O(O({},g),{mode:"Mapview",longitude:S,latitude:b,fov:y,offset:w,distance:E})},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)},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;this.cameraType==="auto"?o=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(de(this.perspToOrthoMotion.value.perspToOrtho,0,1))),Gt(i)||this.models.setMaterial(i),Gt(a)||this.setCamera(a)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(he())[1],r=this.locationMotion.getKeyFrameSegment(he())[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",J("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",J("initAnimation.end",{state:s,userAction:e.userAction}))},function(v){var A=O(O(O({},e.currentPano),{mode:e.mode}),Je(e.camera.pose));e.emit("initAnimation.end",J("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,v=r.models;d<v.length;d++){var A=v[d];if(A.visible&&((c=A.work)===null||c===void 0?void 0:c.workCode)===l.work.workCode)return!0}return!1}),o=mr(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=en(this.cameraMotion.value.longitude+u.longitude),d=de(this.cameraMotion.value.latitude+u.latitude,this.minLatitude,this.maxLatitude),v=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:v,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),p=J("gesture.momentum",O(O({},e),{isFirst:r,isFinal:h,state:A}));if(this.inMomentumMovement.event=p,this.emit("gesture.momentum",p),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:ht.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=Qt(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=Za;var o;if(a.ray.direction.y<-.3&&(o=this.models.intersectRaycaster(a).filter(function(d){var v,A=(v=d.face)===null||v===void 0?void 0:v.normal;return A&&a.ray.direction.dot(A)>=0?!1:d.distance>Ya+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<1e4&&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=de(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;e.pointerType==="mouse"&&(a=e.srcEvent.buttons),i&&a===0&&i.buttons!==0&&(a=i.buttons);var o=i==null?void 0:i.target;if(!o){var s=this.relativeClientPosition(e.center),u=new f.Raycaster;u.params.Points={threshold:.1},u.setFromCamera(s,this.camera),u.near=Za,o=new f.Vector3().copy(u.ray.direction).multiplyScalar(3).add(u.ray.origin);var l=this.models.intersectRaycaster(u)[0];if(!l&&u.ray.direction.y<-.3){var c=new f.Plane(new f.Vector3(0,1,0),0),d=u.ray.intersectPlane(c,new f.Vector3);if(d){var v=d.distanceTo(u.ray.origin);v<1e4&&v>=u.near&&(l={distance:v,floor:0,point:d,object:this.scene})}}if(l)o.copy(l.point);else{var A=new f.Vector3().copy(this.camera.pose.offset).sub(this.camera.position).normalize(),c=new f.Plane().setFromNormalAndCoplanarPoint(A,this.camera.pose.offset);u.ray.intersectPlane(c,o)}}if(e.isFinal?delete this.panState:this.panState={target:o,buttons:a,pointerLength:r,x:e.center.x,y:e.center.y},!(typeof i=="undefined"||i.pointerLength!==r)){var h=r>1||a===2;if(h){var p={x:e.center.x-i.x,y:e.center.y-i.y},g=new f.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),m=Qt(this.cameraMotion.value).setLength(this.locationMotion.value.distance).add(g),y=new f.Vector3().copy(m).sub(i.target).length();y*=Math.tan(this.camera.pose.fov/2*Math.PI/180);var b=this.renderer.getSize(new f.Vector2),x=2*p.x*y/b.y,w=2*p.y*y/b.y,E=new f.Vector3;if(E.setFromMatrixColumn(this.camera.matrix,0),E.multiplyScalar(-x),g.add(E),this.camera.pose.latitude<R0?E.setFromMatrixColumn(this.camera.matrix,1):(E.setFromMatrixColumn(this.camera.matrix,0),E.crossVectors(this.camera.up,E)),E.multiplyScalar(w),g.add(E),this.modelInScreen==="boundingbox-center"){var S=this.models.bounding.clone();S.expandByScalar(this.camera.pose.distance),g.clamp(S.min,S.max)}var C=O(O({},this.currentPano),{mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:g,distance:this.camera.pose.distance});if(e.state=C,this.emit("gesture.pan",e),e.defaultPrevented)return;if(this.locationMotion.set({x:C.offset.x,y:C.offset.y,z:C.offset.z},0).catch(Q),e.isFinal&&(this.fixFinalState(C),Object.assign(e,{__fixFinalState:!0}),this.locationMotion.set({distance:C.distance,x:C.offset.x,y:C.offset.y,z:C.offset.z},0).catch(Q)),e.isFinal){var R=this.renderer.getSize(new f.Vector2),k=2*e.velocityX*y/R.y,M=2*e.velocityY*y/R.y,I=new f.Vector3,L=new f.Vector3;I.setFromMatrixColumn(this.camera.matrix,0),I.multiplyScalar(-k),L.add(I),this.camera.pose.latitude<R0?I.setFromMatrixColumn(this.camera.matrix,1):(I.setFromMatrixColumn(this.camera.matrix,0),I.crossVectors(this.camera.up,I)),I.multiplyScalar(M),L.add(I),this.inMomentumMovement={uuid:Mt()},this.requestMomentumMovement(e,!0,{longitude:0,latitude:0,x:L.x,y:L.y,z:L.z},0)}}else{var p={x:e.center.x-i.x,y:e.center.y-i.y},T=this.coordinatesForOffset(p),B=en(this.cameraMotion.value.longitude+T.longitude),D=de(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 C=O(O({},this.currentPano),{mode:this.mode,longitude:B,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=C,this.emit("gesture.pan",e),e.defaultPrevented)return;if(e.isFinal?this.locationMotion.set({distance:C.distance,x:C.offset.x,y:C.offset.y,z:C.offset.z},0).catch(Q):this.cameraMotion.set({longitude:C.longitude,latitude:C.latitude},0).catch(Q),e.isFinal){var V=e.velocityX,N=e.velocityY;this.inMomentumMovement={uuid:Mt()},this.requestMomentumMovement(e,!0,O(O({},this.coordinatesForOffset({x:V,y:N})),{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=de(i/e.scale,Ya,1/0),u=e.state.offset.clone().sub(Qt(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 v={x:d.offset.x,y:d.offset.y,z:d.offset.z,distance:d.distance};this.locationMotion.set(v,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=Za,a.far=500,e.isFinal&&this.intersectMesh.parent&&this.intersectMesh.visible===!0){this.hideIntersectMesh();return}var o=this.models.intersectRaycaster(a)[0],s=J("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=a.ray.origin.distanceTo(c),v=2*Math.tan(.5*this.camera.fov/180*Math.PI),A=Math.max(d*v/10,1);this.intersectMesh.scale.set(A,A,A);var h=c.clone().add(l);if(this.intersectMesh.lookAt(h),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=e.center.delta/2*Math.max(Math.log(this.locationMotion.value.distance),1);if(this.locationMotion.value.distance-a>=Ya){var o=this.locationMotion.value.distance-a;e.state.distance=o}else{var s=Qt(this.cameraMotion.value);s.setLength(a),e.state.offset.add(s),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",J("pano.select",{prevPano:this.currentPano,state:s,userAction:e.userAction,options:o,progress:0,error:null})),a&&a.active)){var u=this.currentTapId=Mt();this.preloadPano(a.pano).then(function(l){r.currentTapId===u&&r.emit("pano.request",J("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}(_o);function B0(n){return n==null}var Zm={type:"move"},F0=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(Zm))),l&&t.hand){o=!0;for(var c=0,d=t.hand.values();c<d.length;c++){var v=d[c],A=e.getJointPose(v,r);if(l.joints[v.jointName]===void 0){var h=new f.Group;h.matrixAutoUpdate=!1,h.visible=!1,l.joints[v.jointName]=h,l.add(h)}var p=l.joints[v.jointName];A!==null&&(p.matrix.fromArray(A.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.jointRadius=A.radius),p.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}(),Ym=1,$m=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 F0,new F0],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],v=(o[8]+1)/o[0],A=s*d,h=s*v,p=i/(-d+v),g=p*-d;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(g),t.translateZ(p),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var m=s+p,y=u+p,b=A-g,x=h+(i-g),w=l*u/y*m,E=c*u/y*m;t.projectionMatrix.makePerspective(b,x,w,E,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,ht.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:Ym};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}(),$o=function(n){se(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($o.prototype,{isLineSegmentsGeometry:!0});var $a={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:`
1966
+ b-J-Htyl]|vv|{-J-}|wrpv|{Znv\x07-7-z|qrycvrZnv\x07-7-rpA5}|vv|{9>;=6H\f`);var Jm=function(n){se(t,n);function t(e){var r=n.call(this,{vertexShader:jm,fragmentShader:Km})||this;return r.uniforms={uDepthMap:T0("t",null),uWeightMap:T0("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}},Tt([P0("uDepthMap"),Pt("design:type",Number)],t.prototype,"uDepthMap",void 0),Tt([P0("uWeightMap"),Pt("design:type",Number)],t.prototype,"uWeightMap",void 0),t}(f.RawShaderMaterial);function T0(n,t){return{type:n,value:t}}function P0(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 _m=new f.OrthographicCamera(-1,1,1,-1,0,1),Yo=new f.BufferGeometry;Yo.setAttribute("position",new f.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));Yo.setAttribute("uv",new f.Float32BufferAttribute([0,2,0,0,2,0],2));var Ll=new f.Mesh(Yo),kl=new f.Scene;kl.add(Ll);var Xm=function(n){se(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 Jm,o.camera=i,Ll.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(kl,_m)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(_o),Za=.5,Ya=.5,R0=Math.PI/7,Wm=function(n){se(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 Me({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 Me({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Me({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 Gm(r.renderer,r.modelScene,r.camera,r.models),r.hqEffect=new Xm(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:Math.PI/4,defaultLatitude:(i=e.defaultLatitude)!==null&&i!==void 0?i:Math.PI/4,defaultDistance:(a=e.defaultDistance)!==null&&a!==void 0?a:150,maxLatitude:(o=e.maxLatitude)!==null&&o!==void 0?o:+Math.PI/2,minLatitude:(s=e.minLatitude)!==null&&s!==void 0?s:0,cameraType:(u=e.cameraType)!==null&&u!==void 0?u:"auto",modelInScreen:(l=e.modelInScreen)!==null&&l!==void 0?l:"boundingbox-center",intersectMeshCreator:(c=e.intersectMeshCreator)!==null&&c!==void 0?c:function(){return new aa}})},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,v=c.models,A=e.initial,h=A.state,p=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:p.workCode,panoIndex:p.panoIndex},m=d.getResolvedObserver(g),y=(o=h.fov)!==null&&o!==void 0?o:60,b=de((s=h.latitude)!==null&&s!==void 0?s:yo(p.mode)?p.latitude:c.defaultLatitude,c.minLatitude,c.maxLatitude),x=t.distanceFromModel(c.models,y,c.camera.aspect),w=new f.Vector3,E=(u=h.distance)!==null&&u!==void 0?u:Math.min(c.defaultDistance,x),S=(l=h.longitude)!==null&&l!==void 0?l:yo(p.mode)?p.longitude:c.defaultLongitude;return h.offset?w.copy(h.offset):c.defaultDistance<x&&m?(w.copy(m.position),h.longitude===void 0&&(S=p.longitude)):w.copy(v.bounding.getCenter(w)),O(O({},g),{mode:"Mapview",longitude:S,latitude:b,fov:y,offset:w,distance:E})},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)},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;this.cameraType==="auto"?o=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(de(this.perspToOrthoMotion.value.perspToOrtho,0,1))),Gt(i)||this.models.setMaterial(i),Gt(a)||this.setCamera(a)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(he())[1],r=this.locationMotion.getKeyFrameSegment(he())[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",_("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",_("initAnimation.end",{state:s,userAction:e.userAction}))},function(v){var A=O(O(O({},e.currentPano),{mode:e.mode}),_e(e.camera.pose));e.emit("initAnimation.end",_("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,v=r.models;d<v.length;d++){var A=v[d];if(A.visible&&((c=A.work)===null||c===void 0?void 0:c.workCode)===l.work.workCode)return!0}return!1}),o=mr(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=en(this.cameraMotion.value.longitude+u.longitude),d=de(this.cameraMotion.value.latitude+u.latitude,this.minLatitude,this.maxLatitude),v=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:v,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),p=_("gesture.momentum",O(O({},e),{isFirst:r,isFinal:h,state:A}));if(this.inMomentumMovement.event=p,this.emit("gesture.momentum",p),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:ht.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=Qt(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=Za;var o;if(a.ray.direction.y<-.3&&(o=this.models.intersectRaycaster(a).filter(function(d){var v,A=(v=d.face)===null||v===void 0?void 0:v.normal;return A&&a.ray.direction.dot(A)>=0?!1:d.distance>Ya+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<1e4&&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=de(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;e.pointerType==="mouse"&&(a=e.srcEvent.buttons),i&&a===0&&i.buttons!==0&&(a=i.buttons);var o=i==null?void 0:i.target;if(!o){var s=this.relativeClientPosition(e.center),u=new f.Raycaster;u.params.Points={threshold:.1},u.setFromCamera(s,this.camera),u.near=Za,o=new f.Vector3().copy(u.ray.direction).multiplyScalar(3).add(u.ray.origin);var l=this.models.intersectRaycaster(u)[0];if(!l&&u.ray.direction.y<-.3){var c=new f.Plane(new f.Vector3(0,1,0),0),d=u.ray.intersectPlane(c,new f.Vector3);if(d){var v=d.distanceTo(u.ray.origin);v<1e4&&v>=u.near&&(l={distance:v,floor:0,point:d,object:this.scene})}}if(l)o.copy(l.point);else{var A=new f.Vector3().copy(this.camera.pose.offset).sub(this.camera.position).normalize(),c=new f.Plane().setFromNormalAndCoplanarPoint(A,this.camera.pose.offset);u.ray.intersectPlane(c,o)}}if(e.isFinal?delete this.panState:this.panState={target:o,buttons:a,pointerLength:r,x:e.center.x,y:e.center.y},!(typeof i=="undefined"||i.pointerLength!==r)){var h=r>1||a===2;if(h){var p={x:e.center.x-i.x,y:e.center.y-i.y},g=new f.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),m=Qt(this.cameraMotion.value).setLength(this.locationMotion.value.distance).add(g),y=new f.Vector3().copy(m).sub(i.target).length();y*=Math.tan(this.camera.pose.fov/2*Math.PI/180);var b=this.renderer.getSize(new f.Vector2),x=2*p.x*y/b.y,w=2*p.y*y/b.y,E=new f.Vector3;if(E.setFromMatrixColumn(this.camera.matrix,0),E.multiplyScalar(-x),g.add(E),this.camera.pose.latitude<R0?E.setFromMatrixColumn(this.camera.matrix,1):(E.setFromMatrixColumn(this.camera.matrix,0),E.crossVectors(this.camera.up,E)),E.multiplyScalar(w),g.add(E),this.modelInScreen==="boundingbox-center"){var S=this.models.bounding.clone();S.expandByScalar(this.camera.pose.distance),g.clamp(S.min,S.max)}var C=O(O({},this.currentPano),{mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:g,distance:this.camera.pose.distance});if(e.state=C,this.emit("gesture.pan",e),e.defaultPrevented)return;if(this.locationMotion.set({x:C.offset.x,y:C.offset.y,z:C.offset.z},0).catch(Q),e.isFinal&&(this.fixFinalState(C),Object.assign(e,{__fixFinalState:!0}),this.locationMotion.set({distance:C.distance,x:C.offset.x,y:C.offset.y,z:C.offset.z},0).catch(Q)),e.isFinal){var R=this.renderer.getSize(new f.Vector2),k=2*e.velocityX*y/R.y,M=2*e.velocityY*y/R.y,I=new f.Vector3,L=new f.Vector3;I.setFromMatrixColumn(this.camera.matrix,0),I.multiplyScalar(-k),L.add(I),this.camera.pose.latitude<R0?I.setFromMatrixColumn(this.camera.matrix,1):(I.setFromMatrixColumn(this.camera.matrix,0),I.crossVectors(this.camera.up,I)),I.multiplyScalar(M),L.add(I),this.inMomentumMovement={uuid:Mt()},this.requestMomentumMovement(e,!0,{longitude:0,latitude:0,x:L.x,y:L.y,z:L.z},0)}}else{var p={x:e.center.x-i.x,y:e.center.y-i.y},T=this.coordinatesForOffset(p),B=en(this.cameraMotion.value.longitude+T.longitude),D=de(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 C=O(O({},this.currentPano),{mode:this.mode,longitude:B,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=C,this.emit("gesture.pan",e),e.defaultPrevented)return;if(e.isFinal?this.locationMotion.set({distance:C.distance,x:C.offset.x,y:C.offset.y,z:C.offset.z},0).catch(Q):this.cameraMotion.set({longitude:C.longitude,latitude:C.latitude},0).catch(Q),e.isFinal){var V=e.velocityX,N=e.velocityY;this.inMomentumMovement={uuid:Mt()},this.requestMomentumMovement(e,!0,O(O({},this.coordinatesForOffset({x:V,y:N})),{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=de(i/e.scale,Ya,1/0),u=e.state.offset.clone().sub(Qt(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 v={x:d.offset.x,y:d.offset.y,z:d.offset.z,distance:d.distance};this.locationMotion.set(v,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=Za,a.far=500,e.isFinal&&this.intersectMesh.parent&&this.intersectMesh.visible===!0){this.hideIntersectMesh();return}var o=this.models.intersectRaycaster(a)[0],s=_("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=a.ray.origin.distanceTo(c),v=2*Math.tan(.5*this.camera.fov/180*Math.PI),A=Math.max(d*v/10,1);this.intersectMesh.scale.set(A,A,A);var h=c.clone().add(l);if(this.intersectMesh.lookAt(h),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=e.center.delta/2*Math.max(Math.log(this.locationMotion.value.distance),1);if(this.locationMotion.value.distance-a>=Ya){var o=this.locationMotion.value.distance-a;e.state.distance=o}else{var s=Qt(this.cameraMotion.value);s.setLength(a),e.state.offset.add(s),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",_("pano.select",{prevPano:this.currentPano,state:s,userAction:e.userAction,options:o,progress:0,error:null})),a&&a.active)){var u=this.currentTapId=Mt();this.preloadPano(a.pano).then(function(l){r.currentTapId===u&&r.emit("pano.request",_("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}(Jo);function B0(n){return n==null}var Zm={type:"move"},F0=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(Zm))),l&&t.hand){o=!0;for(var c=0,d=t.hand.values();c<d.length;c++){var v=d[c],A=e.getJointPose(v,r);if(l.joints[v.jointName]===void 0){var h=new f.Group;h.matrixAutoUpdate=!1,h.visible=!1,l.joints[v.jointName]=h,l.add(h)}var p=l.joints[v.jointName];A!==null&&(p.matrix.fromArray(A.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.jointRadius=A.radius),p.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}(),Ym=1,$m=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 F0,new F0],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],v=(o[8]+1)/o[0],A=s*d,h=s*v,p=i/(-d+v),g=p*-d;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(g),t.translateZ(p),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var m=s+p,y=u+p,b=A-g,x=h+(i-g),w=l*u/y*m,E=c*u/y*m;t.projectionMatrix.makePerspective(b,x,w,E,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,ht.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:Ym};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}(),$o=function(n){se(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($o.prototype,{isLineSegmentsGeometry:!0});var $a={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:`
1967
1967
  #include <common>
1968
1968
  #include <color_pars_vertex>
1969
1969
  #include <fog_pars_vertex>
@@ -2162,7 +2162,7 @@ void main() {
2162
2162
  #include <premultiplied_alpha_fragment>
2163
2163
 
2164
2164
  }
2165
- `},es=function(n){se(t,n);function t(e){var r=n.call(this,{uniforms:f.UniformsUtils.clone($a.uniforms),vertexShader:$a.vertexShader,fragmentShader:$a.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(es.prototype,{isLineMaterial:!0});var Ol=function(n){se(t,n);function t(e,r){var i=n.call(this)||this;return i.type="LineSegments2",i.geometry=e!==void 0?e:new $o,i.material=r!==void 0?r:new es({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,v=s.attributes.instanceEnd,A=new f.Vector4,h=new f.Vector4,p=new f.Vector4,g=new f.Vector3,m=new f.Matrix4,y=new f.Line3,b=new f.Vector3;i.at(1,p),p.w=1,p.applyMatrix4(a.matrixWorldInverse),p.applyMatrix4(o),p.multiplyScalar(1/p.w),p.x*=l.x/2,p.y*=l.y/2,p.z=0,g.copy(p);var x=this.matrixWorld;m.multiplyMatrices(a.matrixWorldInverse,x);for(var w=0,E=d.count;w<E;w++){A.fromBufferAttribute(d,w),h.fromBufferAttribute(v,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,C=A.z>1&&h.z>1;if(!(S||C)){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 R=y.closestPointToPointParameter(g,!0);y.at(R,b);var k=f.MathUtils.lerp(A.z,h.z,R),M=k>=-1&&k<=1,I=g.distanceTo(b)<c*.5;if(M&&I){y.start.fromBufferAttribute(d,w),y.end.fromBufferAttribute(v,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(Ol.prototype,{isLineSegments2:!0});var Dl=function(n){se(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.type="Line2",i}return t}(Ol);Object.assign(Dl.prototype,{isLine2:!0});var Vl=function(n){se(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}($o);Object.assign(Vl.prototype,{is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GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==",L0=14467195,tA=8,rA=2,nA=20,k0=null,So=function(n){se(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 Vl,o=new es({color:L0,linewidth:rA,dashScale:nA,dashed:!1});i.line=new Dl(a,o);var s=new f.BufferGeometry,u=new f.PointsMaterial({color:L0,size:tA,map:k0||(k0=new f.TextureLoader().load(eA)),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.3.0-alpha.19"},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(So.prototype,{isFiveLine:!0});var Xe={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 zl(n){return ea(this,void 0,void 0,function(){var t;return ta(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 iA(n){return ea(this,void 0,void 0,function(){var t,e;return ta(this,function(r){switch(r.label){case 0:if(!n)throw new Error("No basePath supplied");return t="profilesList.json",[4,zl("".concat(n,"/").concat(t))];case 1:return e=r.sent(),[2,e]}})})}function aA(n,t){return ea(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),ta(this,function(v){switch(v.label){case 0:if(!e)throw new Error("No xrInputSource supplied");if(!r)throw new Error("No basePath supplied");return[4,iA(r)];case 1:if(o=v.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,zl(s.profilePath)];case 2:if(l=v.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:Xe.ComponentState.DEFAULT};function sA(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 uA=function(){function n(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===Xe.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=sA(e,r),s=o.normalizedXAxis,u=o.normalizedYAxis;switch(this.componentProperty){case Xe.ComponentProperty.X_AXIS:this.value=this.states.includes(a)?s:.5;break;case Xe.ComponentProperty.Y_AXIS:this.value=this.states.includes(a)?u:.5;break;case Xe.ComponentProperty.BUTTON:this.value=this.states.includes(a)?i:0;break;case Xe.ComponentProperty.STATE:this.valueNodeProperty===Xe.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}(),lA=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 uA(e.visualResponses[i]);r.visualResponses[i]=a}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:Xe.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=Xe.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=Xe.ComponentState.PRESSED:(r.touched||this.values.button>Xe.ButtonTouchThreshold)&&(this.values.state=Xe.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===Xe.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>Xe.AxisTouchThreshold&&(this.values.state=Xe.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===Xe.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>Xe.AxisTouchThreshold&&(this.values.state=Xe.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(function(i){i.updateFromComponent(e.values)})},n}(),cA=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 lA(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}(),fA="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",dA="generic-trigger",hA=function(n){se(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===Xe.VisualResponseProperty.VISIBILITY?a.visible=u:l===Xe.VisualResponseProperty.TRANSFORM&&(a.quaternion.copy(o.quaternion).slerp(s.quaternion,u),a.position.lerpVectors(o.position,s.position,u)))})}))},t}(Wn.Object3D);function pA(n,t){Object.values(n.components).forEach(function(e){var r=e.type,i=e.touchPointNodeName,a=e.visualResponses;if(r===Xe.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(i),e.touchPointNode){var o=new Wn.SphereGeometry(.001),s=new Wn.MeshBasicMaterial({color:255}),u=new Wn.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,v=l.maxNodeName,A=l.valueNodeProperty;if(A===Xe.VisualResponseProperty.TRANSFORM){if(l.minNode=t.getObjectByName(d),l.maxNode=t.getObjectByName(v),!l.minNode){console.warn("Could not find ".concat(d," in the model"));return}if(!l.maxNode){console.warn("Could not find ".concat(v," in the model"));return}}l.valueNode=t.getObjectByName(c),l.valueNode||console.warn("Could not find ".concat(c," in the model"))})})}function O0(n,t){pA(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 vA=function(){function n(t){t===void 0&&(t=null),this.gltfLoader=t,this.path=fA,this._assetCache={}}return n.prototype.createControllerModel=function(t){var e=this,r=new hA,i=null;return t.addEventListener("connected",function(a){var o=a.data;o.targetRayMode!=="tracked-pointer"||!o.gamepad||aA(o,e.path,dA).then(function(s){var u=s.profile,l=s.assetPath;r.motionController=new cA(o,u,l);var c=e._assetCache[r.motionController.assetUrl];if(c)i=c.scene.clone(),O0(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(),O0(r,i)})}}).catch(function(s){console.warn(s)})}),t.addEventListener("disconnected",function(){r.motionController=null,r.remove(i),i=null}),r},n}();function mA(n,t){return n}var D0=300,AA=new f.Matrix4().makeRotationAxis(new f.Vector3(0,1,0),Math.PI),V0=new f.Vector3(-1,1,1),gA=function(n){se(t,n);function t(e){var r=n.call(this,e)||this;r.xrManager=new $m(r.renderer,r.renderer.getContext(),{onSessionStart:function(u){r.emit("xr.session.start",J("xr.session.start",{session:u,machineType:r.xrManager.machineType}))},onSessionEnd:function(){r.emit("xr.session.end",J("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 So,right:new So},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 vA;o.gltfLoader={load:function(u,l){Ki.ajax(u,{responseType:"arraybuffer"}).then(function(c){var d;return Do(c.body,{resourcePath:u.slice(0,u.lastIndexOf("/")+1),search:(d=u.split("?")[1])!==null&&d!==void 0?d:"",fetcher:Ki})}).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=Mt()]={panoId:ze(r.currentPano),leftPanoPicture:null,position:r.camera.pose.offset.clone(),effect:"fade",fixCameraTransform:new f.Matrix4},r.parallaxCameraMatrixs=[];var s=ht.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.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 v=ai(d.images.up),A=this.imageOptions.size;typeof A=="undefined"&&d&&v&&(A=Number(v)),typeof A=="undefined"&&(A=2048);var h=this.imageOptions.transform,p=function(M,I){return mA(hn(M,h,I))},g=O({key:"pano.".concat(d.panoId)},Ut(this.imageOptions,["format","size","quality"])),m=d.images,y=(u=(s=d.images.tiles)===null||s===void 0?void 0:s.filter(function(M){return M.size>A}))!==null&&u!==void 0?u:null,b="pano:"+na([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",J("pano.texture.abort",{error:null,progress:0,meta:null,pano:d.pano}))}var w=this.models.getMaterial()||{},E=w.pano0,S=w.pano1,C;if((E==null?void 0:E.map.name)===b?C=E:(S==null?void 0:S.map.name)===b&&(C=S),C){var R={panoId:d.panoId,effect:c,leftPanoPicture:{zoom:1,map:C.map,luminanceMap:C.luminanceMap,matrix:new f.Matrix4().compose(d.position,d.quaternion,V0)},position:d.position.clone(),fixCameraTransform:new f.Matrix4};this.doMoveToPano(d.pano,R,r);return}var k="move-to-pano-"+d.panoId;this.pending.add(k),this.pendingTextureTask={panoId:d.panoId,hash:b,onLoad:function(M){if(a.pending.delete(k),a.destroyed)M.body.dispose();else{M.body.name=b;var I={panoId:d.panoId,effect:c,leftPanoPicture:{zoom:1,map:M.body,luminanceMap:null,matrix:new f.Matrix4().compose(d.position,d.quaternion,V0)},position:d.position.clone(),fixCameraTransform:new f.Matrix4};a.doMoveToPano(d.pano,I,r)}},onError:function(M){a.pending.delete(k);var I=O(O(O({},d.pano),{mode:a.mode}),Je(a.camera.pose));a.emit("pano.error",J("pano.error",{error:M,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:I})),a.emit("pano.cancel",J("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.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:p,options:g},format:f.RGBAFormat,minFilter:f.LinearFilter,magFilter:f.LinearFilter,generateMipmaps:!1,viaAjax:!0,fetcher:st(d.work)},void 0,void 0,function(M){var I,L;a.emit("pano.texture.progress",J("pano.texture.progress",{error:null,progress:M,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(M))},this.renderer):this.textureLoader.loadCubeTexture(m,{imageURL:{transform:p,options:g},format:f.RGBAFormat,fetcher:st(d.work)},void 0,void 0,function(M){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(M)),a.emit("pano.texture.progress",J("pano.texture.progress",{error:null,progress:M,meta:null,pano:d.pano}))},this.renderer)]).then(function(M){var I,L,T=M[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",J("pano.texture.success",{error:null,progress:1,meta:T.meta,pano:d.pano}))):T.body.dispose()}).catch(function(M){var I,L;((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b&&(a.pendingTextureTask.onError(M),(L=a.panoMeshes[d.panoId])===null||L===void 0||L.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",J("pano.texture.error",{error:M,progress:0,meta:null,pano:d.pano})),a.emit("error",M))}),this.emit("pano.texture.load",J("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,v,A,h,p;i===void 0&&(i={});var g=he(),m=Mt();this.panoResources[m]=r;var y=1,b,x,w;if(this.locationMotion.ended){var E=this.locationMotion.getKeyFrameSegment(g);E[0];var S=E[1],C=this.locationMotion.value,R=this.panoResourceFromLocationMotionKeyframe(S).position,k=r.position;b=Math.max(R.distanceTo(k),y),x=[{key:S.key,progress:0,value:O(O({},C),{count:0})},{key:m,progress:1,value:{distance:0,count:1}}],w=0}else{var M=this.locationMotion.getKeyFrameSegment(g),I=M[0],S=M[1],C=this.locationMotion.value,L=this.panoResourceFromLocationMotionKeyframe(I).position,R=this.panoResourceFromLocationMotionKeyframe(S).position,k=r.position,T=S.value.count-C.count,B=Math.max(L.distanceTo(R),y)*T,D=Math.max(R.distanceTo(k),y);b=B+D,x=[{key:I.key,progress:0,value:O({},C)},{key:S.key,progress:B/b,value:S.value},{key:m,progress:1,value:{count:S.value.count+1,distance:0}}];var V=this.locationMotionKeyframesLength(this.locationMotion.keyframes),N=this.locationMotionKeyframesLength(x);w=this.locationMotion.getProgressVelocity(g)*V/N}var U=r.effect==="instant"?0:this.calculateMovingDuration(i.duration,r.effect==="fly"?b:0),H={longitude:i.longitude,latitude:i.latitude,fov:i.fov},G=O(O({},e),{mode:this.mode,longitude:(o=H.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=H.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(u=H.fov)!==null&&u!==void 0?u:this.camera.pose.fov,offset:r.position.clone(),distance:0}),j=this.currentPano;if(this.emit("pano.moveTo",J("pano.moveTo",{options:i,prevPano:j,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(H,U).catch(Q);else{var _=Qt({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),X=Qt({longitude:(l=H.longitude)!==null&&l!==void 0?l:this.cameraMotion.value.longitude,latitude:(c=H.latitude)!==null&&c!==void 0?c:this.cameraMotion.value.latitude}),Z=new f.Object3D;Z.lookAt(_);var W=new f.Matrix4().makeRotationFromQuaternion(Z.quaternion);Z.lookAt(X);var $=new f.Matrix4().makeRotationFromQuaternion(Z.quaternion),Y=new f.Matrix4().getInverse(W).premultiply($),ne=this.cameraMotion.value.fov,te=(d=H.fov)!==null&&d!==void 0?d:this.cameraMotion.value.fov,ue=1;r.effect==="zoomin"?ue=1.5:r.effect==="zoomout"&&(ue=.4);for(var ie=te*ue,ge=0;ge<x.length-1;ge++){var pe=x[ge].key;if(pe){var ye=this.panoResources[pe];ye&&(ye.fixCameraTransform.copy(Y),ye.leftPanoPicture&&(ye.leftPanoPicture.zoom=Math.tan(ne/2/180*Math.PI)/Math.tan(ie/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:(v=H.longitude)!==null&&v!==void 0?v:this.cameraMotion.value.longitude,latitude:(A=H.latitude)!==null&&A!==void 0?A:this.cameraMotion.value.latitude,fov:ie}},{progress:1,value:{longitude:(h=H.longitude)!==null&&h!==void 0?h:this.cameraMotion.value.longitude,latitude:(p=H.latitude)!==null&&p!==void 0?p:this.cameraMotion.value.latitude,fov:te}}],U).catch(Q)}var Be=this.locationMotion.setKeyframes(x,U,w);Be.then(function(){for(var Se,Te,re,oe=0,q=a.models;oe<q.length;oe++){var De=q[oe];De.show()}var Fe=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",J("pano.arrived",{options:i,prevPano:j,progress:1,state:Fe,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(Fe);var Ie=a.works.getResolvedObserver(a.currentPano);if(Ie&&Ie.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var Ke=AA.clone().multiply((re=(Te=(Se=a.models.getMaterial())===null||Se===void 0?void 0:Se.pano1)===null||Te===void 0?void 0:Te.matrix)!==null&&re!==void 0?re:new f.Matrix4).multiply(Ie.video.matrix),xe={map:a.videoTexture,size:Ie.video.size,matrix:Ke,alpha:1},ve=Mt(),we=a.videoTexture.image;we.setAttribute("uuid",ve),Cl().then(function(be){be&&Ie.video&&we.getAttribute("uuid")===ve&&(we.oncanplay=function(){we.oncanplay=Q,we.play()},we.ontimeupdate=function(){we.currentTime>.5&&(we.ontimeupdate=Q,a.panoVideo.setMaterial(xe))},we.src=Ie.video.source)}).catch(function(){we.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",J("pano.cancel",{options:i,prevPano:j,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(X){var Z=yt(X);if(nr(Z,r.currentPano))return!1;var W=r.works.getResolvedObserver(Z);return!W||W.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:W.loadable||W.active}),v=this.models.intersectRaycaster(e)[0];if(v){var A=mr(d,function(X){var Z=r.works.getResolvedObserver(X);if(!Z)return 1/0;var W=Z.standingPosition.clone();return W.distanceTo(v.point)},!0),h=A[0],p=A[1];h&&p<this.panoTapTriggerRadius&&(l=(i=this.works.getResolvedObserver(h))!==null&&i!==void 0?i:null)}if(B0(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(B0(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 E={};if(l){for(var S=Math.PI/6,C=Math.PI/12,R=new f.Vector3(0,1,0),k=l.position.clone().setY(0).sub(c.position.clone().setY(0)).normalize(),M=k.clone().applyAxisAngle(R,S),I=k.clone().applyAxisAngle(R,-S),L=[],T=[],B=[],D=0,V=l.accessibleIds;D<V.length;D++){var h=V[D],N=yt(h);if(!(nr(N,this.currentPano)||nr(N,l.pano))){var U=this.works.getResolvedObserver(h);if(U){var H=U.position.clone().sub(l.position).setY(0);k.angleTo(H)<S?B.push(H):M.angleTo(H)<S?L.push(H):I.angleTo(H)<S&&T.push(H)}}}var G=B.length>0?B:dt(dt([],L,!0),T,!0),j=G.slice().sort(function(X,Z){return X.angleTo(k)-Z.angleTo(k)})[0];j&&j.angleTo(u)>C&&(E.longitude=Math.atan2(-j.x,-j.z))}this.cameraMotion.value.latitude<-Math.PI/4&&(E.latitude=de(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(E.fov=this.defaultFov);var _={workCode:l.pano.workCode,panoIndex:l.pano.panoIndex,mode:this.mode,longitude:(a=E.longitude)!==null&&a!==void 0?a:this.camera.pose.longitude,latitude:(o=E.latitude)!==null&&o!==void 0?o:this.camera.pose.latitude,fov:(s=E.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",J("pano.select",{prevPano:this.currentPano,state:_,userAction:!0,options:E,progress:0,error:null})),l&&l.active?(this.emit("pano.request",J("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:_,options:E,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,v,A=[],h=2;h<arguments.length;h++)A[h-2]=arguments[h];this.userAction=!0;var p={},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),p.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(de(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var x=this.locationMotion.getKeyFrameSegment(e),w=x[0],E=x[1],S=this.panoResourceFromLocationMotionKeyframe(w),C=this.panoResourceFromLocationMotionKeyframe(E),R=new f.Vector3().copy(S.position),k=new f.Vector3().copy(C.position),M=this.locationMotion.value.count-E.value.count+1;p.progress=M,C.leftPanoPicture&&(M<1?S.leftPanoPicture&&(p.pano0=S.leftPanoPicture):p.pano0=C.leftPanoPicture,p.pano1=C.leftPanoPicture),C.effect==="montage"?p.transition="BLACK":C.effect==="spread"?p.transition="SPREAD":p.transition="FADE",(C.effect==="zoomin"||C.effect==="zoomout")&&(p.progress=Math.pow(M,3)),M<1&&C.effect!=="fly"&&(p.pano0&&S.leftPanoPicture&&(p.pano0={map:p.pano0.map,zoom:p.pano0.zoom,luminanceMap:p.pano0.luminanceMap,matrix:S.leftPanoPicture.matrix.clone().setPosition(C.position)}),R.copy(k),b=!0),g.distance=this.locationMotion.value.distance,g.offset=new f.Vector3(R.x+(k.x-R.x)*M,R.y+(k.y-R.y)*M,R.z+(k.z-R.z)*M);for(var I=[],L=[],T=0,B=this.locationMotion.keyframes;T<B.length;T++){var D=B[T],V=D.key,N=D.progress;V!==void 0&&(I.push(V),N>this.locationMotion.progress&&L.push(V))}for(var U=0,H=Object.keys(this.panoResources);U<H.length;U++){var G=H[U];if(!(L.indexOf(G)>=0)){var j=this.panoResources[G];if(j.leftPanoPicture){var _=j.leftPanoPicture.map;if(_){if(_===((a=p.pano0)===null||a===void 0?void 0:a.map)||_===((o=p.pano1)===null||o===void 0?void 0:o.map))continue;_ instanceof Ve&&_.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(_.cubeRenderTarget),_.dispose(),j.leftPanoPicture=null}}I.indexOf(G)>=0||delete this.panoResources[G]}}this.currentPano=yt(C.panoId),this.emit("pano.moving",J("pano.moving",{userAction:this.userAction,prevPano:yt(m.panoId),state:O(O(O(O({},yt(y.panoId)),{mode:this.mode}),Je(this.camera.pose)),g),options:{},progress:this.locationMotion.progress,error:null}))}Gt(p)===!1&&(!((s=p.pano0)===null||s===void 0)&&s.map&&p.pano0.map instanceof Ve&&!p.pano0.map.cubeRenderTarget&&(p.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((u=p.pano1)===null||u===void 0)&&u.map&&p.pano1.map instanceof Ve&&!p.pano1.map.cubeRenderTarget&&(p.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),this.models.setMaterial(p)),Gt(g)===!1&&this.setCamera(g);var X=this.works.getResolvedObserver(this.currentPano),Z=A[1];if(!Z){console.error("xrFrame丢失,请重试");return}if(!this.xrManager.session){console.error("session丢失,请重试");return}var W=this.xrManager.referenceSpace;if(W){var $=this.xrManager.cameraVR,Y=this.xrManager.cameraL,ne=this.xrManager.cameraR,te=[Y,ne],ue=Z.getViewerPose(W),ie=new f.Vector3(0,0,0);if(ue){var ge;ge=this.xrManager.session.renderState.baseLayer;var pe=ue.views;if(!ge){console.error("no layer found");return}this.renderer.setFramebuffer(ge.framebuffer);var ye=!1;pe.length!==$.cameras.length&&($.cameras.length=0,ye=!0),this.parallaxCameraMatrixs=[];var Be=new f.Vector3,Se=new f.Vector3;new f.Matrix4().fromArray(pe[0].transform.matrix).decompose(Be,new f.Quaternion,new f.Vector3),new f.Matrix4().fromArray(pe[1].transform.matrix).decompose(Se,new f.Quaternion,new f.Vector3),Se.clone().sub(Be).normalize();var Te=new f.Vector3,re=new f.Quaternion,oe=new f.Vector3;this.camera.matrix.decompose(Te,re,oe);for(var q=0;q<pe.length;q++){var De=pe[q],Fe=ge.getViewport(De),Ie=te[q];Ie.matrix.fromArray(De.transform.matrix);var Ke=new f.Vector3,xe=new f.Quaternion,ve=new f.Vector3;Ie.matrix.decompose(Ke,xe,ve),ie.copy(Te),Ie.position.copy(Te),Ie.quaternion.copy(xe),Ie.scale.copy(ve),Ie.updateMatrix(),Ie.projectionMatrix.fromArray(De.projectionMatrix),Ie.viewport.set(Fe.x,Fe.y,Fe.width,Fe.height),ye===!0&&$.cameras.push(Ie)}if(this.xrManager.session&&this.xrManager.session.inputSources){for(var q=0;q<this.xrManager.session.inputSources.length;q++)if(this.xrManager.session.inputSources[q]&&this.xrManager.session.inputSources[q].targetRayMode==="transient-pointer"){var we=Z.getPose(this.xrManager.session.inputSources[q].targetRaySpace,W);if(we){var be=new f.Vector3(0,0,-1).applyQuaternion(we.transform.orientation),me=new f.Raycaster(this.camera.position,be);this.gazeRay=me}}}if(this.xrManager.machineType==="Oculus"||this.xrManager.machineType==="Pico"){for(var Ue=this.xrManager.session.inputSources,q=0;q<Ue.length;q++){var je=this.xrManager.controllers[q],it=Ue[q];if(it){je&&je.update(it,Z,W);var me=this.xrManager.getController(q),tn=new f.Vector3(0,1.2,0),Le=me.position.clone().add(ie).sub(tn);it.handedness==="left"?this.xrControllerRay.left.set(Le,new f.Vector3(0,0,-1).applyEuler(me.rotation)):it.handedness==="right"&&this.xrControllerRay.right.set(Le,new f.Vector3(0,0,-1).applyEuler(me.rotation)),this.controllerWrappers[q].position.copy(new f.Vector3(0,0,0).add(ie).sub(tn));var Ye=this.models.intersectRaycaster(this.xrControllerRay.right);if(Ye.length===0&&(Ye=this.xrControllerRay.right.intersectObject(this.boundingMesh,!0).map(function(kr){var an;return O({floor:(an=X==null?void 0:X.floorIndex)!==null&&an!==void 0?an:0},kr)})),Ye.length>=1&&Ye[0].face)if(it.handedness==="right"){var lt=this.xrControllerRay.right.intersectObject(this.xrCustomObjectsScene,!0),or=Ye[0].face.normal,gn=or.clone(),sr=Ye[0].point.clone();this.intersectMesh.position.copy(sr);var Bt=sr.clone().add(gn);if(this.intersectMesh.lookAt(Bt),Math.abs(or.y)>.99){var ur=this.camera.position.clone().sub(sr);this.intersectMesh.rotation.z=-Math.atan2(ur.z,ur.x)}this.intersectMesh.visible=!0,this.needsRender=!0,lt.length>0?(this.pointerLines.right.setPoints(Le,lt[0].point),this.pointerLines.right.points.visible=!0,this.intersectMesh.visible=!1):(this.pointerLines.right.points.visible=!1,this.pointerLines.right.setPoints(Le,Ye[0].point));var Fr=Ye[0],Kt=J("intersect.update",{raycaster:(l=this.xrControllerRay.right)!==null&&l!==void 0?l:null,intersection:Fr!=null?Fr:null,object:this.intersectMesh});if(this.emit("intersect.update",Kt),Kt.defaultPrevented){this.hideIntersectMesh();return}}else this.pointerLines.left.setPoints(Le,Ye[0].point)}}this.updateControllerHelper(Ue,e,r)}if(this.camera.pose.distance>.1||b)for(var lr=0,jt=Object.keys(this.panoMeshes);lr<jt.length;lr++){var pt=jt[lr],ke=this.panoMeshes[pt];ke.setOpacity(0),ke.setCurrent(!1),ke.updateTime&&ke.updateTime(e,r),ke.visible=!1}else if(X){var yr=mr(X.visibleIds,function(vt){var Xt=i.works.getResolvedObserver(vt);return Xt?X.standingPosition.distanceTo(Xt.standingPosition):1/0},!0),bt=yr[1];bt=de(bt,2.5,1/0);for(var br=X.visibleIds.concat(ze(this.currentPano)),xr=this.getForwardObserverOrNot(),_t=this.camera.getDirection(new f.Vector3),It=0,wr=Object.keys(this.panoMeshes);It<wr.length;It++){var pt=wr[It],ke=this.panoMeshes[pt],Lr=this.works.getResolvedObserver(pt);if(br.indexOf(pt)===-1)ke.setCurrent(!1),ke.setOpacity(0);else if(!Lr)ke.setCurrent(!1),ke.setOpacity(0);else if(!Lr.loadable&&!Lr.active)ke.setCurrent(!1),ke.setOpacity(0);else{var yn=ke.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);ke.setCurrent(!ke.loading&&ke.progress===0&&xr!==null&&xr.panoId===pt),ke.setOpacity(yn<.01?0:de(bt/yn*1.2,.65,.98));var rn=this.camera.position.clone().setY(ke.position.y),be=new f.Vector3().copy(ke.position).sub(rn).normalize();if(pt===ze(this.currentPano)){var nn=de((.5-rn.distanceTo(ke.position))/.5,0,1);be.multiplyScalar(1-nn).add(_t.clone().multiplyScalar(nn))}be.length()>0&&ke.quaternion.setFromEuler(new f.Euler(0,Math.atan2(be.x,be.z),0))}ke.updateTime&&ke.updateTime(e,r)}}var Jt=function(){return 4}(),$e=function(){var vt=new f.PerspectiveCamera;vt.applyMatrix4($.matrix),vt.position.set(0,0,0);var Xt=i.works.getResolvedObserver(y.panoId),kr=Xt!=null?Xt:X;kr&&vt.quaternion.premultiply(kr.quaternion.clone().inverse()),vt.updateProjectionMatrix(),vt.updateMatrixWorld(!0);var an=new f.Frustum().setFromProjectionMatrix(new f.Matrix4().multiplyMatrices(vt.projectionMatrix,vt.matrixWorldInverse));return an}();y.panoId===ze(this.currentPano)&&((c=y.leftPanoPicture)===null||c===void 0?void 0:c.map)instanceof Ve&&(y.leftPanoPicture.map.maxRequest=this.tileMaxRequest,y.leftPanoPicture.map.update($e,Jt),y.leftPanoPicture.map.needsRender===!0&&(this.needsRender=!0,this.modelSceneNeedsRender=!0));{var qe=this.tiling.object.visible;if(this.initAnimationed){var at=y.panoId,xt=this.works.getResolvedObserver(at);xt?bi(this.camera.position,xt.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==at&&this.tiling.cleanup(),this.tiling.panoId=at,this.tiling.setResource((v=(d=xt.images)===null||d===void 0?void 0:d.tiles)!==null&&v!==void 0?v:[],this.enableIOSEDR&&xt.images.luminance?xt.images.luminance:null),this.tiling.setFetcher(st(xt.work)),this.tiling.setRotation(xt.quaternion),this.tiling.setPosition(xt.position),this.tiling.maxRequest=this.tileMaxRequest,Jt>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update($e,Jt,e):this.tiling.update($e,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;qe!==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 v={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=v,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",J("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",J("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>D0&&this.emit("xr.gesture.press",J("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",J("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<=D0){var u=J("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}(Wo),kt={Floorplan:Eo,Topview:Gv,Panorama:Wo,VRPanorama:Vm,Model:Nm,Mapview:Wm,XRPanorama:gA},Nl=["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 yA(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=Qt(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 bA(){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 z0(n){{var t=new f.DirectionalLight(16777215,.3);t.position.copy(new f.Vector3(1,1,1)),n.add(t)}{var t=new f.DirectionalLight(16777215,.1);t.position.copy(new f.Vector3(-1,-1,-1)),n.add(t)}{var t=new f.DirectionalLight(16777215,.1);n.add(t)}{var t=new f.AmbientLight(16777215,.6);n.add(t)}}function xA(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 Ql(){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=xA((n=r.getAttribute("content"))!==null&&n!==void 0?n:""),a=Number(i["initial-scale"]);if(!isNaN(a))return a}}return 1}const wA="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6tn2b/H+TUTLc7yjcOXV46OUAnUs6EbUp022ZBXc1NhoZYYd7fjDRvdcHAwrlK2QBVJ4sgoqONmY45RUT23sZ6H42F2hK5CtkMbjhZlDmUUcvq1zyieUVyjbE4I1GBfItwxG56YaUZTQwyh4P6NgJ4YYYvCuQb5kOyI03pORjiqe4Lwpq5pt1vJqfUwKWJVbSMYfppYconG+maNNQOWBZuwHTzicGel75NtFOkxr5apmV8cikcko0DrDQs863AeGl0cE0+1xy573m0/wf0cEKW6H7BWtggiMG8sy3oHRDpJMw4NWb6am/bv9znkqEzjd61t5oo5clTrjhwevO75EJRBKSRt745Z16ZEjcM73sccZplBPm8PyTcxZAkSRdHm/acJ0Z3JZhHB0BxqDHgWFZFmm0ZbCw87twI/zc3e/Cz93vPneXtU/WdQS3oTviXdY/q5PsJKfoGuQjZuO/0in1qsj85cuXrxqeAOJpGqdJOqrUutgVl2Qb0BWqp/RE8AWWVB7t2KrIzY2Wx2fWKl7yfswgxqj8lYummY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XQNL1ofDKQisbPLJDv3jNSLq9OkYBEIihKIj3v7S1TRQCX5Kdl1ZQlol7LF+E++fwirfiq2sf4cTXxc6hzxffPuLEeqSWrPGWMF58TWr5viyJAP5/4EV4KePiaSE8eNRgjDy8/tyRW+FZjhS+2tlovNJovtJovNJ0uhK6Wo64SDdxEbM//KesjwAAAABJRU5ErkJggg==";var N0=[351,63],Q0=[20,20],EA=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),SA=new Float32Array([0,0,1,0,0,1,1,1]),MA=new Uint8Array([0,1,2,1,3,2]),ua=new f.BufferGeometry;ua.setAttribute("position",new f.BufferAttribute(EA,3));ua.setAttribute("uv",new f.BufferAttribute(SA,2));ua.setIndex(new f.BufferAttribute(MA,1));var Gi=new f.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),Ul=new f.Mesh(ua,Gi);Ul.matrixAutoUpdate=!1;var ts=new f.Scene;ts.add(Ul);ts.matrixAutoUpdate=!1;var xi=new f.OrthographicCamera(-.5,.5,.5,-.5,.1,1);xi.position.set(0,0,.5);xi.lookAt(0,0,0);xi.updateMatrixWorld(!0);xi.matrixAutoUpdate=!1;var CA=new f.Vector4,IA=new f.Vector4;function TA(n){if(Gi.map){var r=n.getViewport(CA),i=n.getScissor(IA),a=n.getScissorTest(),o=n.autoClear,s=i.x+Q0[0]/3,u=i.y+Q0[1]/3,l=N0[0]/3,c=N0[1]/3;n.setViewport(s,u,l,c),n.setScissor(s,u,l,c),n.setScissorTest(!0),n.autoClear=!1,n.render(ts,xi),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,Gi.needsUpdate=!0,e.onload=Q},e.src=wA,Gi.map=t}}var PA=800,U0=90,RA=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/")},BA=new f.Vector2,ki=new f.Frustum,Oi=new f.Matrix4,H0=new WeakMap,eo=new WeakMap,q0=go([]),Hl=function(n){se(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,u,l,c,d,v,A,h=n.call(this)||this;if(h.ident=Mt(),typeof window!="undefined"&&(Mo.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:he()},h.info=null,h.modeChangeDuration=(s=e.modeChangeDuration)!==null&&s!==void 0?s:PA,h.enableWheel=(u=e.enableWheel)!==null&&u!==void 0?u:!0,typeof window!="undefined")if("renderer"in e)e.renderer instanceof cn&&h.throwError(new Error("cannot render a internal renderer")),h.renderer=e.renderer;else try{h.renderer=new cn({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 p=Ql();h.renderer.setPixelRatio(p===1?window.devicePixelRatio:1),h.renderer.setSize(512,512)}catch(k){k instanceof Error&&h.throwError(k)}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:(v=(d=h.renderer)===null||d===void 0?void 0:d.outputEncoding)!==null&&v!==void 0?v: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 cu(U0),h.scene=new lu,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:RA,h.networkSubscribe=new Z0,h.networkSubscribe.on("network",function(k,M,I,L){var T;h.emit("network.resource",J("network.resource",{source:k,requestType:M,requestState:I,detail:L})),(T=h.analysis)===null||T===void 0||T.network(h.works,k,M,I,L)}),h.boundingMesh=Tv(new f.Box3(new f.Vector3(-.5,-.5,-.5),new f.Vector3(.5,.5,.5))),h.boundingMesh.name="bounding",h.models=f0(),h.models.push(new bo),h.lastModels=f0(),h.lastWorks=go([]),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||bA()),z0(h.scene),z0(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=ht.shared.add(function(k,M){for(var I=[],L=2;L<arguments.length;L++)I[L-2]=arguments[L];h.updateTime.apply(h,dt([k,M],I,!1))},!1,0,10));var m=function(){typeof document!="undefined"&&document.fullscreenElement===null&&h.currentMode==="VRPanorama"&&h.controller.emit("vr.requestExit",J("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 E=w[0],S=w[1],C=w[2];if(typeof E=="function"){var R=E(h,C);typeof S=="string"&&(h.plugins[S]?h.throwError(new Error("plugin name ".concat(S," is exists."))):h.plugins[S]=R)}}}return h.gpuPickingRenderTarget=new f.WebGLRenderTarget(1,1,{generateMipmaps:!1}),h.meshReplaceMaterialMap=new Map,h.meshOriginMaterialMap=new Map,yA(h),h}return Object.defineProperty(t,"version",{get:function(){return"6.3.0-alpha.19"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return Wi.decoderPath},set:function(e){Wi.setDecoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ktx2Path",{get:function(){return ei.transcoderPath},set:function(e){ei.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.");this.models.setMaterial({constantColor:o}),this.scene.traverse(function(d){if(!(!(d instanceof f.Mesh)||d instanceof Ct)){var v=Object.keys(i).filter(function(h){return h===d.uuid})[0];if(v)if(s.meshOriginMaterialMap.set(v,d.material),s.meshReplaceMaterialMap.get(v))d.material=s.meshReplaceMaterialMap.get(v);else{var A=new f.ShaderMaterial({uniforms:{color:{value:i[v]}},vertexShader:`
2165
+ `},es=function(n){se(t,n);function t(e){var r=n.call(this,{uniforms:f.UniformsUtils.clone($a.uniforms),vertexShader:$a.vertexShader,fragmentShader:$a.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(es.prototype,{isLineMaterial:!0});var Ol=function(n){se(t,n);function t(e,r){var i=n.call(this)||this;return i.type="LineSegments2",i.geometry=e!==void 0?e:new $o,i.material=r!==void 0?r:new es({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,v=s.attributes.instanceEnd,A=new f.Vector4,h=new f.Vector4,p=new f.Vector4,g=new f.Vector3,m=new f.Matrix4,y=new f.Line3,b=new f.Vector3;i.at(1,p),p.w=1,p.applyMatrix4(a.matrixWorldInverse),p.applyMatrix4(o),p.multiplyScalar(1/p.w),p.x*=l.x/2,p.y*=l.y/2,p.z=0,g.copy(p);var x=this.matrixWorld;m.multiplyMatrices(a.matrixWorldInverse,x);for(var w=0,E=d.count;w<E;w++){A.fromBufferAttribute(d,w),h.fromBufferAttribute(v,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,C=A.z>1&&h.z>1;if(!(S||C)){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 R=y.closestPointToPointParameter(g,!0);y.at(R,b);var k=f.MathUtils.lerp(A.z,h.z,R),M=k>=-1&&k<=1,I=g.distanceTo(b)<c*.5;if(M&&I){y.start.fromBufferAttribute(d,w),y.end.fromBufferAttribute(v,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(Ol.prototype,{isLineSegments2:!0});var Dl=function(n){se(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.type="Line2",i}return t}(Ol);Object.assign(Dl.prototype,{isLine2:!0});var Vl=function(n){se(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}($o);Object.assign(Vl.prototype,{isLineGeometry:!0});var eA="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEw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tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==",L0=14467195,tA=8,rA=2,nA=20,k0=null,So=function(n){se(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 Vl,o=new es({color:L0,linewidth:rA,dashScale:nA,dashed:!1});i.line=new Dl(a,o);var s=new f.BufferGeometry,u=new f.PointsMaterial({color:L0,size:tA,map:k0||(k0=new f.TextureLoader().load(eA)),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.3.0-alpha.20"},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(So.prototype,{isFiveLine:!0});var Xe={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 zl(n){return ea(this,void 0,void 0,function(){var t;return ta(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 iA(n){return ea(this,void 0,void 0,function(){var t,e;return ta(this,function(r){switch(r.label){case 0:if(!n)throw new Error("No basePath supplied");return t="profilesList.json",[4,zl("".concat(n,"/").concat(t))];case 1:return e=r.sent(),[2,e]}})})}function aA(n,t){return ea(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),ta(this,function(v){switch(v.label){case 0:if(!e)throw new Error("No xrInputSource supplied");if(!r)throw new Error("No basePath supplied");return[4,iA(r)];case 1:if(o=v.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,zl(s.profilePath)];case 2:if(l=v.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:Xe.ComponentState.DEFAULT};function sA(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 uA=function(){function n(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===Xe.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=sA(e,r),s=o.normalizedXAxis,u=o.normalizedYAxis;switch(this.componentProperty){case Xe.ComponentProperty.X_AXIS:this.value=this.states.includes(a)?s:.5;break;case Xe.ComponentProperty.Y_AXIS:this.value=this.states.includes(a)?u:.5;break;case Xe.ComponentProperty.BUTTON:this.value=this.states.includes(a)?i:0;break;case Xe.ComponentProperty.STATE:this.valueNodeProperty===Xe.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}(),lA=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 uA(e.visualResponses[i]);r.visualResponses[i]=a}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:Xe.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=Xe.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=Xe.ComponentState.PRESSED:(r.touched||this.values.button>Xe.ButtonTouchThreshold)&&(this.values.state=Xe.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===Xe.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>Xe.AxisTouchThreshold&&(this.values.state=Xe.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===Xe.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>Xe.AxisTouchThreshold&&(this.values.state=Xe.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(function(i){i.updateFromComponent(e.values)})},n}(),cA=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 lA(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}(),fA="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",dA="generic-trigger",hA=function(n){se(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===Xe.VisualResponseProperty.VISIBILITY?a.visible=u:l===Xe.VisualResponseProperty.TRANSFORM&&(a.quaternion.copy(o.quaternion).slerp(s.quaternion,u),a.position.lerpVectors(o.position,s.position,u)))})}))},t}(Wn.Object3D);function pA(n,t){Object.values(n.components).forEach(function(e){var r=e.type,i=e.touchPointNodeName,a=e.visualResponses;if(r===Xe.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(i),e.touchPointNode){var o=new Wn.SphereGeometry(.001),s=new Wn.MeshBasicMaterial({color:255}),u=new Wn.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,v=l.maxNodeName,A=l.valueNodeProperty;if(A===Xe.VisualResponseProperty.TRANSFORM){if(l.minNode=t.getObjectByName(d),l.maxNode=t.getObjectByName(v),!l.minNode){console.warn("Could not find ".concat(d," in the model"));return}if(!l.maxNode){console.warn("Could not find ".concat(v," in the model"));return}}l.valueNode=t.getObjectByName(c),l.valueNode||console.warn("Could not find ".concat(c," in the model"))})})}function O0(n,t){pA(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 vA=function(){function n(t){t===void 0&&(t=null),this.gltfLoader=t,this.path=fA,this._assetCache={}}return n.prototype.createControllerModel=function(t){var e=this,r=new hA,i=null;return t.addEventListener("connected",function(a){var o=a.data;o.targetRayMode!=="tracked-pointer"||!o.gamepad||aA(o,e.path,dA).then(function(s){var u=s.profile,l=s.assetPath;r.motionController=new cA(o,u,l);var c=e._assetCache[r.motionController.assetUrl];if(c)i=c.scene.clone(),O0(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(),O0(r,i)})}}).catch(function(s){console.warn(s)})}),t.addEventListener("disconnected",function(){r.motionController=null,r.remove(i),i=null}),r},n}();function mA(n,t){return n}var D0=300,AA=new f.Matrix4().makeRotationAxis(new f.Vector3(0,1,0),Math.PI),V0=new f.Vector3(-1,1,1),gA=function(n){se(t,n);function t(e){var r=n.call(this,e)||this;r.xrManager=new $m(r.renderer,r.renderer.getContext(),{onSessionStart:function(u){r.emit("xr.session.start",_("xr.session.start",{session:u,machineType:r.xrManager.machineType}))},onSessionEnd:function(){r.emit("xr.session.end",_("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 So,right:new So},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 vA;o.gltfLoader={load:function(u,l){Ki.ajax(u,{responseType:"arraybuffer"}).then(function(c){var d;return Do(c.body,{resourcePath:u.slice(0,u.lastIndexOf("/")+1),search:(d=u.split("?")[1])!==null&&d!==void 0?d:"",fetcher:Ki})}).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=Mt()]={panoId:ze(r.currentPano),leftPanoPicture:null,position:r.camera.pose.offset.clone(),effect:"fade",fixCameraTransform:new f.Matrix4},r.parallaxCameraMatrixs=[];var s=ht.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.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 v=ai(d.images.up),A=this.imageOptions.size;typeof A=="undefined"&&d&&v&&(A=Number(v)),typeof A=="undefined"&&(A=2048);var h=this.imageOptions.transform,p=function(M,I){return mA(hn(M,h,I))},g=O({key:"pano.".concat(d.panoId)},Ut(this.imageOptions,["format","size","quality"])),m=d.images,y=(u=(s=d.images.tiles)===null||s===void 0?void 0:s.filter(function(M){return M.size>A}))!==null&&u!==void 0?u:null,b="pano:"+na([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",_("pano.texture.abort",{error:null,progress:0,meta:null,pano:d.pano}))}var w=this.models.getMaterial()||{},E=w.pano0,S=w.pano1,C;if((E==null?void 0:E.map.name)===b?C=E:(S==null?void 0:S.map.name)===b&&(C=S),C){var R={panoId:d.panoId,effect:c,leftPanoPicture:{zoom:1,map:C.map,luminanceMap:C.luminanceMap,matrix:new f.Matrix4().compose(d.position,d.quaternion,V0)},position:d.position.clone(),fixCameraTransform:new f.Matrix4};this.doMoveToPano(d.pano,R,r);return}var k="move-to-pano-"+d.panoId;this.pending.add(k),this.pendingTextureTask={panoId:d.panoId,hash:b,onLoad:function(M){if(a.pending.delete(k),a.destroyed)M.body.dispose();else{M.body.name=b;var I={panoId:d.panoId,effect:c,leftPanoPicture:{zoom:1,map:M.body,luminanceMap:null,matrix:new f.Matrix4().compose(d.position,d.quaternion,V0)},position:d.position.clone(),fixCameraTransform:new f.Matrix4};a.doMoveToPano(d.pano,I,r)}},onError:function(M){a.pending.delete(k);var I=O(O(O({},d.pano),{mode:a.mode}),_e(a.camera.pose));a.emit("pano.error",_("pano.error",{error:M,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:I})),a.emit("pano.cancel",_("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.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:p,options:g},format:f.RGBAFormat,minFilter:f.LinearFilter,magFilter:f.LinearFilter,generateMipmaps:!1,viaAjax:!0,fetcher:st(d.work)},void 0,void 0,function(M){var I,L;a.emit("pano.texture.progress",_("pano.texture.progress",{error:null,progress:M,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(M))},this.renderer):this.textureLoader.loadCubeTexture(m,{imageURL:{transform:p,options:g},format:f.RGBAFormat,fetcher:st(d.work)},void 0,void 0,function(M){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(M)),a.emit("pano.texture.progress",_("pano.texture.progress",{error:null,progress:M,meta:null,pano:d.pano}))},this.renderer)]).then(function(M){var I,L,T=M[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",_("pano.texture.success",{error:null,progress:1,meta:T.meta,pano:d.pano}))):T.body.dispose()}).catch(function(M){var I,L;((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b&&(a.pendingTextureTask.onError(M),(L=a.panoMeshes[d.panoId])===null||L===void 0||L.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",_("pano.texture.error",{error:M,progress:0,meta:null,pano:d.pano})),a.emit("error",M))}),this.emit("pano.texture.load",_("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,v,A,h,p;i===void 0&&(i={});var g=he(),m=Mt();this.panoResources[m]=r;var y=1,b,x,w;if(this.locationMotion.ended){var E=this.locationMotion.getKeyFrameSegment(g);E[0];var S=E[1],C=this.locationMotion.value,R=this.panoResourceFromLocationMotionKeyframe(S).position,k=r.position;b=Math.max(R.distanceTo(k),y),x=[{key:S.key,progress:0,value:O(O({},C),{count:0})},{key:m,progress:1,value:{distance:0,count:1}}],w=0}else{var M=this.locationMotion.getKeyFrameSegment(g),I=M[0],S=M[1],C=this.locationMotion.value,L=this.panoResourceFromLocationMotionKeyframe(I).position,R=this.panoResourceFromLocationMotionKeyframe(S).position,k=r.position,T=S.value.count-C.count,B=Math.max(L.distanceTo(R),y)*T,D=Math.max(R.distanceTo(k),y);b=B+D,x=[{key:I.key,progress:0,value:O({},C)},{key:S.key,progress:B/b,value:S.value},{key:m,progress:1,value:{count:S.value.count+1,distance:0}}];var V=this.locationMotionKeyframesLength(this.locationMotion.keyframes),N=this.locationMotionKeyframesLength(x);w=this.locationMotion.getProgressVelocity(g)*V/N}var U=r.effect==="instant"?0:this.calculateMovingDuration(i.duration,r.effect==="fly"?b:0),H={longitude:i.longitude,latitude:i.latitude,fov:i.fov},G=O(O({},e),{mode:this.mode,longitude:(o=H.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=H.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(u=H.fov)!==null&&u!==void 0?u:this.camera.pose.fov,offset:r.position.clone(),distance:0}),j=this.currentPano;if(this.emit("pano.moveTo",_("pano.moveTo",{options:i,prevPano:j,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(H,U).catch(Q);else{var J=Qt({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),X=Qt({longitude:(l=H.longitude)!==null&&l!==void 0?l:this.cameraMotion.value.longitude,latitude:(c=H.latitude)!==null&&c!==void 0?c:this.cameraMotion.value.latitude}),Z=new f.Object3D;Z.lookAt(J);var W=new f.Matrix4().makeRotationFromQuaternion(Z.quaternion);Z.lookAt(X);var $=new f.Matrix4().makeRotationFromQuaternion(Z.quaternion),Y=new f.Matrix4().getInverse(W).premultiply($),ne=this.cameraMotion.value.fov,te=(d=H.fov)!==null&&d!==void 0?d:this.cameraMotion.value.fov,ue=1;r.effect==="zoomin"?ue=1.5:r.effect==="zoomout"&&(ue=.4);for(var ie=te*ue,ge=0;ge<x.length-1;ge++){var pe=x[ge].key;if(pe){var ye=this.panoResources[pe];ye&&(ye.fixCameraTransform.copy(Y),ye.leftPanoPicture&&(ye.leftPanoPicture.zoom=Math.tan(ne/2/180*Math.PI)/Math.tan(ie/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:(v=H.longitude)!==null&&v!==void 0?v:this.cameraMotion.value.longitude,latitude:(A=H.latitude)!==null&&A!==void 0?A:this.cameraMotion.value.latitude,fov:ie}},{progress:1,value:{longitude:(h=H.longitude)!==null&&h!==void 0?h:this.cameraMotion.value.longitude,latitude:(p=H.latitude)!==null&&p!==void 0?p:this.cameraMotion.value.latitude,fov:te}}],U).catch(Q)}var Be=this.locationMotion.setKeyframes(x,U,w);Be.then(function(){for(var Se,Te,re,oe=0,q=a.models;oe<q.length;oe++){var De=q[oe];De.show()}var Fe=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",_("pano.arrived",{options:i,prevPano:j,progress:1,state:Fe,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(Fe);var Ie=a.works.getResolvedObserver(a.currentPano);if(Ie&&Ie.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var Ke=AA.clone().multiply((re=(Te=(Se=a.models.getMaterial())===null||Se===void 0?void 0:Se.pano1)===null||Te===void 0?void 0:Te.matrix)!==null&&re!==void 0?re:new f.Matrix4).multiply(Ie.video.matrix),xe={map:a.videoTexture,size:Ie.video.size,matrix:Ke,alpha:1},ve=Mt(),we=a.videoTexture.image;we.setAttribute("uuid",ve),Cl().then(function(be){be&&Ie.video&&we.getAttribute("uuid")===ve&&(we.oncanplay=function(){we.oncanplay=Q,we.play()},we.ontimeupdate=function(){we.currentTime>.5&&(we.ontimeupdate=Q,a.panoVideo.setMaterial(xe))},we.src=Ie.video.source)}).catch(function(){we.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",_("pano.cancel",{options:i,prevPano:j,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(X){var Z=yt(X);if(nr(Z,r.currentPano))return!1;var W=r.works.getResolvedObserver(Z);return!W||W.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:W.loadable||W.active}),v=this.models.intersectRaycaster(e)[0];if(v){var A=mr(d,function(X){var Z=r.works.getResolvedObserver(X);if(!Z)return 1/0;var W=Z.standingPosition.clone();return W.distanceTo(v.point)},!0),h=A[0],p=A[1];h&&p<this.panoTapTriggerRadius&&(l=(i=this.works.getResolvedObserver(h))!==null&&i!==void 0?i:null)}if(B0(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(B0(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 E={};if(l){for(var S=Math.PI/6,C=Math.PI/12,R=new f.Vector3(0,1,0),k=l.position.clone().setY(0).sub(c.position.clone().setY(0)).normalize(),M=k.clone().applyAxisAngle(R,S),I=k.clone().applyAxisAngle(R,-S),L=[],T=[],B=[],D=0,V=l.accessibleIds;D<V.length;D++){var h=V[D],N=yt(h);if(!(nr(N,this.currentPano)||nr(N,l.pano))){var U=this.works.getResolvedObserver(h);if(U){var H=U.position.clone().sub(l.position).setY(0);k.angleTo(H)<S?B.push(H):M.angleTo(H)<S?L.push(H):I.angleTo(H)<S&&T.push(H)}}}var G=B.length>0?B:dt(dt([],L,!0),T,!0),j=G.slice().sort(function(X,Z){return X.angleTo(k)-Z.angleTo(k)})[0];j&&j.angleTo(u)>C&&(E.longitude=Math.atan2(-j.x,-j.z))}this.cameraMotion.value.latitude<-Math.PI/4&&(E.latitude=de(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(E.fov=this.defaultFov);var J={workCode:l.pano.workCode,panoIndex:l.pano.panoIndex,mode:this.mode,longitude:(a=E.longitude)!==null&&a!==void 0?a:this.camera.pose.longitude,latitude:(o=E.latitude)!==null&&o!==void 0?o:this.camera.pose.latitude,fov:(s=E.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",_("pano.select",{prevPano:this.currentPano,state:J,userAction:!0,options:E,progress:0,error:null})),l&&l.active?(this.emit("pano.request",_("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:J,options:E,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,v,A=[],h=2;h<arguments.length;h++)A[h-2]=arguments[h];this.userAction=!0;var p={},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),p.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(de(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var x=this.locationMotion.getKeyFrameSegment(e),w=x[0],E=x[1],S=this.panoResourceFromLocationMotionKeyframe(w),C=this.panoResourceFromLocationMotionKeyframe(E),R=new f.Vector3().copy(S.position),k=new f.Vector3().copy(C.position),M=this.locationMotion.value.count-E.value.count+1;p.progress=M,C.leftPanoPicture&&(M<1?S.leftPanoPicture&&(p.pano0=S.leftPanoPicture):p.pano0=C.leftPanoPicture,p.pano1=C.leftPanoPicture),C.effect==="montage"?p.transition="BLACK":C.effect==="spread"?p.transition="SPREAD":p.transition="FADE",(C.effect==="zoomin"||C.effect==="zoomout")&&(p.progress=Math.pow(M,3)),M<1&&C.effect!=="fly"&&(p.pano0&&S.leftPanoPicture&&(p.pano0={map:p.pano0.map,zoom:p.pano0.zoom,luminanceMap:p.pano0.luminanceMap,matrix:S.leftPanoPicture.matrix.clone().setPosition(C.position)}),R.copy(k),b=!0),g.distance=this.locationMotion.value.distance,g.offset=new f.Vector3(R.x+(k.x-R.x)*M,R.y+(k.y-R.y)*M,R.z+(k.z-R.z)*M);for(var I=[],L=[],T=0,B=this.locationMotion.keyframes;T<B.length;T++){var D=B[T],V=D.key,N=D.progress;V!==void 0&&(I.push(V),N>this.locationMotion.progress&&L.push(V))}for(var U=0,H=Object.keys(this.panoResources);U<H.length;U++){var G=H[U];if(!(L.indexOf(G)>=0)){var j=this.panoResources[G];if(j.leftPanoPicture){var J=j.leftPanoPicture.map;if(J){if(J===((a=p.pano0)===null||a===void 0?void 0:a.map)||J===((o=p.pano1)===null||o===void 0?void 0:o.map))continue;J instanceof Ve&&J.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(J.cubeRenderTarget),J.dispose(),j.leftPanoPicture=null}}I.indexOf(G)>=0||delete this.panoResources[G]}}this.currentPano=yt(C.panoId),this.emit("pano.moving",_("pano.moving",{userAction:this.userAction,prevPano:yt(m.panoId),state:O(O(O(O({},yt(y.panoId)),{mode:this.mode}),_e(this.camera.pose)),g),options:{},progress:this.locationMotion.progress,error:null}))}Gt(p)===!1&&(!((s=p.pano0)===null||s===void 0)&&s.map&&p.pano0.map instanceof Ve&&!p.pano0.map.cubeRenderTarget&&(p.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((u=p.pano1)===null||u===void 0)&&u.map&&p.pano1.map instanceof Ve&&!p.pano1.map.cubeRenderTarget&&(p.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),this.models.setMaterial(p)),Gt(g)===!1&&this.setCamera(g);var X=this.works.getResolvedObserver(this.currentPano),Z=A[1];if(!Z){console.error("xrFrame丢失,请重试");return}if(!this.xrManager.session){console.error("session丢失,请重试");return}var W=this.xrManager.referenceSpace;if(W){var $=this.xrManager.cameraVR,Y=this.xrManager.cameraL,ne=this.xrManager.cameraR,te=[Y,ne],ue=Z.getViewerPose(W),ie=new f.Vector3(0,0,0);if(ue){var ge;ge=this.xrManager.session.renderState.baseLayer;var pe=ue.views;if(!ge){console.error("no layer found");return}this.renderer.setFramebuffer(ge.framebuffer);var ye=!1;pe.length!==$.cameras.length&&($.cameras.length=0,ye=!0),this.parallaxCameraMatrixs=[];var Be=new f.Vector3,Se=new f.Vector3;new f.Matrix4().fromArray(pe[0].transform.matrix).decompose(Be,new f.Quaternion,new f.Vector3),new f.Matrix4().fromArray(pe[1].transform.matrix).decompose(Se,new f.Quaternion,new f.Vector3),Se.clone().sub(Be).normalize();var Te=new f.Vector3,re=new f.Quaternion,oe=new f.Vector3;this.camera.matrix.decompose(Te,re,oe);for(var q=0;q<pe.length;q++){var De=pe[q],Fe=ge.getViewport(De),Ie=te[q];Ie.matrix.fromArray(De.transform.matrix);var Ke=new f.Vector3,xe=new f.Quaternion,ve=new f.Vector3;Ie.matrix.decompose(Ke,xe,ve),ie.copy(Te),Ie.position.copy(Te),Ie.quaternion.copy(xe),Ie.scale.copy(ve),Ie.updateMatrix(),Ie.projectionMatrix.fromArray(De.projectionMatrix),Ie.viewport.set(Fe.x,Fe.y,Fe.width,Fe.height),ye===!0&&$.cameras.push(Ie)}if(this.xrManager.session&&this.xrManager.session.inputSources){for(var q=0;q<this.xrManager.session.inputSources.length;q++)if(this.xrManager.session.inputSources[q]&&this.xrManager.session.inputSources[q].targetRayMode==="transient-pointer"){var we=Z.getPose(this.xrManager.session.inputSources[q].targetRaySpace,W);if(we){var be=new f.Vector3(0,0,-1).applyQuaternion(we.transform.orientation),me=new f.Raycaster(this.camera.position,be);this.gazeRay=me}}}if(this.xrManager.machineType==="Oculus"||this.xrManager.machineType==="Pico"){for(var Ue=this.xrManager.session.inputSources,q=0;q<Ue.length;q++){var je=this.xrManager.controllers[q],it=Ue[q];if(it){je&&je.update(it,Z,W);var me=this.xrManager.getController(q),tn=new f.Vector3(0,1.2,0),Le=me.position.clone().add(ie).sub(tn);it.handedness==="left"?this.xrControllerRay.left.set(Le,new f.Vector3(0,0,-1).applyEuler(me.rotation)):it.handedness==="right"&&this.xrControllerRay.right.set(Le,new f.Vector3(0,0,-1).applyEuler(me.rotation)),this.controllerWrappers[q].position.copy(new f.Vector3(0,0,0).add(ie).sub(tn));var Ye=this.models.intersectRaycaster(this.xrControllerRay.right);if(Ye.length===0&&(Ye=this.xrControllerRay.right.intersectObject(this.boundingMesh,!0).map(function(kr){var an;return O({floor:(an=X==null?void 0:X.floorIndex)!==null&&an!==void 0?an:0},kr)})),Ye.length>=1&&Ye[0].face)if(it.handedness==="right"){var lt=this.xrControllerRay.right.intersectObject(this.xrCustomObjectsScene,!0),or=Ye[0].face.normal,gn=or.clone(),sr=Ye[0].point.clone();this.intersectMesh.position.copy(sr);var Bt=sr.clone().add(gn);if(this.intersectMesh.lookAt(Bt),Math.abs(or.y)>.99){var ur=this.camera.position.clone().sub(sr);this.intersectMesh.rotation.z=-Math.atan2(ur.z,ur.x)}this.intersectMesh.visible=!0,this.needsRender=!0,lt.length>0?(this.pointerLines.right.setPoints(Le,lt[0].point),this.pointerLines.right.points.visible=!0,this.intersectMesh.visible=!1):(this.pointerLines.right.points.visible=!1,this.pointerLines.right.setPoints(Le,Ye[0].point));var Fr=Ye[0],Kt=_("intersect.update",{raycaster:(l=this.xrControllerRay.right)!==null&&l!==void 0?l:null,intersection:Fr!=null?Fr:null,object:this.intersectMesh});if(this.emit("intersect.update",Kt),Kt.defaultPrevented){this.hideIntersectMesh();return}}else this.pointerLines.left.setPoints(Le,Ye[0].point)}}this.updateControllerHelper(Ue,e,r)}if(this.camera.pose.distance>.1||b)for(var lr=0,jt=Object.keys(this.panoMeshes);lr<jt.length;lr++){var pt=jt[lr],ke=this.panoMeshes[pt];ke.setOpacity(0),ke.setCurrent(!1),ke.updateTime&&ke.updateTime(e,r),ke.visible=!1}else if(X){var yr=mr(X.visibleIds,function(vt){var Xt=i.works.getResolvedObserver(vt);return Xt?X.standingPosition.distanceTo(Xt.standingPosition):1/0},!0),bt=yr[1];bt=de(bt,2.5,1/0);for(var br=X.visibleIds.concat(ze(this.currentPano)),xr=this.getForwardObserverOrNot(),Jt=this.camera.getDirection(new f.Vector3),It=0,wr=Object.keys(this.panoMeshes);It<wr.length;It++){var pt=wr[It],ke=this.panoMeshes[pt],Lr=this.works.getResolvedObserver(pt);if(br.indexOf(pt)===-1)ke.setCurrent(!1),ke.setOpacity(0);else if(!Lr)ke.setCurrent(!1),ke.setOpacity(0);else if(!Lr.loadable&&!Lr.active)ke.setCurrent(!1),ke.setOpacity(0);else{var yn=ke.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);ke.setCurrent(!ke.loading&&ke.progress===0&&xr!==null&&xr.panoId===pt),ke.setOpacity(yn<.01?0:de(bt/yn*1.2,.65,.98));var rn=this.camera.position.clone().setY(ke.position.y),be=new f.Vector3().copy(ke.position).sub(rn).normalize();if(pt===ze(this.currentPano)){var nn=de((.5-rn.distanceTo(ke.position))/.5,0,1);be.multiplyScalar(1-nn).add(Jt.clone().multiplyScalar(nn))}be.length()>0&&ke.quaternion.setFromEuler(new f.Euler(0,Math.atan2(be.x,be.z),0))}ke.updateTime&&ke.updateTime(e,r)}}var _t=function(){return 4}(),$e=function(){var vt=new f.PerspectiveCamera;vt.applyMatrix4($.matrix),vt.position.set(0,0,0);var Xt=i.works.getResolvedObserver(y.panoId),kr=Xt!=null?Xt:X;kr&&vt.quaternion.premultiply(kr.quaternion.clone().inverse()),vt.updateProjectionMatrix(),vt.updateMatrixWorld(!0);var an=new f.Frustum().setFromProjectionMatrix(new f.Matrix4().multiplyMatrices(vt.projectionMatrix,vt.matrixWorldInverse));return an}();y.panoId===ze(this.currentPano)&&((c=y.leftPanoPicture)===null||c===void 0?void 0:c.map)instanceof Ve&&(y.leftPanoPicture.map.maxRequest=this.tileMaxRequest,y.leftPanoPicture.map.update($e,_t),y.leftPanoPicture.map.needsRender===!0&&(this.needsRender=!0,this.modelSceneNeedsRender=!0));{var qe=this.tiling.object.visible;if(this.initAnimationed){var at=y.panoId,xt=this.works.getResolvedObserver(at);xt?bi(this.camera.position,xt.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==at&&this.tiling.cleanup(),this.tiling.panoId=at,this.tiling.setResource((v=(d=xt.images)===null||d===void 0?void 0:d.tiles)!==null&&v!==void 0?v:[],this.enableIOSEDR&&xt.images.luminance?xt.images.luminance:null),this.tiling.setFetcher(st(xt.work)),this.tiling.setRotation(xt.quaternion),this.tiling.setPosition(xt.position),this.tiling.maxRequest=this.tileMaxRequest,_t>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update($e,_t,e):this.tiling.update($e,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;qe!==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 v={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=v,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",_("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",_("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>D0&&this.emit("xr.gesture.press",_("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",_("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<=D0){var u=_("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}(Wo),kt={Floorplan:Eo,Topview:Gv,Panorama:Wo,VRPanorama:Vm,Model:Nm,Mapview:Wm,XRPanorama:gA},Nl=["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 yA(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=Qt(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 bA(){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 z0(n){{var t=new f.DirectionalLight(16777215,.3);t.position.copy(new f.Vector3(1,1,1)),n.add(t)}{var t=new f.DirectionalLight(16777215,.1);t.position.copy(new f.Vector3(-1,-1,-1)),n.add(t)}{var t=new f.DirectionalLight(16777215,.1);n.add(t)}{var t=new f.AmbientLight(16777215,.6);n.add(t)}}function xA(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 Ql(){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=xA((n=r.getAttribute("content"))!==null&&n!==void 0?n:""),a=Number(i["initial-scale"]);if(!isNaN(a))return a}}return 1}const wA="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6tn2b/H+TUTLc7yjcOXV46OUAnUs6EbUp022ZBXc1NhoZYYd7fjDRvdcHAwrlK2QBVJ4sgoqONmY45RUT23sZ6H42F2hK5CtkMbjhZlDmUUcvq1zyieUVyjbE4I1GBfItwxG56YaUZTQwyh4P6NgJ4YYYvCuQb5kOyI03pORjiqe4Lwpq5pt1vJqfUwKWJVbSMYfppYconG+maNNQOWBZuwHTzicGel75NtFOkxr5apmV8cikcko0DrDQs863AeGl0cE0+1xy573m0/wf0cEKW6H7BWtggiMG8sy3oHRDpJMw4NWb6am/bv9znkqEzjd61t5oo5clTrjhwevO75EJRBKSRt745Z16ZEjcM73sccZplBPm8PyTcxZAkSRdHm/acJ0Z3JZhHB0BxqDHgWFZFmm0ZbCw87twI/zc3e/Cz93vPneXtU/WdQS3oTviXdY/q5PsJKfoGuQjZuO/0in1qsj85cuXrxqeAOJpGqdJOqrUutgVl2Qb0BWqp/RE8AWWVB7t2KrIzY2Wx2fWKl7yfswgxqj8lYummYa3hfwF9MuQRmbfQE4ocPDjtUWQ6Tq1M2w7gC2EcrMGtWS6xlpGKEDDcb1vUQ25zT4lrC2s0dU4gFPppKkbeIYr7NMpqjStuFg5rNU9epGyt8PXyfX4DE1bKLhR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gjDy8/tyRW+FZjhS+2tlovNJovtJovNJ0uhK6Wo64SDdxEbM//KesjwAAAABJRU5ErkJggg==";var N0=[351,63],Q0=[20,20],EA=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),SA=new Float32Array([0,0,1,0,0,1,1,1]),MA=new Uint8Array([0,1,2,1,3,2]),ua=new f.BufferGeometry;ua.setAttribute("position",new f.BufferAttribute(EA,3));ua.setAttribute("uv",new f.BufferAttribute(SA,2));ua.setIndex(new f.BufferAttribute(MA,1));var Gi=new f.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),Ul=new f.Mesh(ua,Gi);Ul.matrixAutoUpdate=!1;var ts=new f.Scene;ts.add(Ul);ts.matrixAutoUpdate=!1;var xi=new f.OrthographicCamera(-.5,.5,.5,-.5,.1,1);xi.position.set(0,0,.5);xi.lookAt(0,0,0);xi.updateMatrixWorld(!0);xi.matrixAutoUpdate=!1;var CA=new f.Vector4,IA=new f.Vector4;function TA(n){if(Gi.map){var r=n.getViewport(CA),i=n.getScissor(IA),a=n.getScissorTest(),o=n.autoClear,s=i.x+Q0[0]/3,u=i.y+Q0[1]/3,l=N0[0]/3,c=N0[1]/3;n.setViewport(s,u,l,c),n.setScissor(s,u,l,c),n.setScissorTest(!0),n.autoClear=!1,n.render(ts,xi),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,Gi.needsUpdate=!0,e.onload=Q},e.src=wA,Gi.map=t}}var PA=800,U0=90,RA=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/")},BA=new f.Vector2,ki=new f.Frustum,Oi=new f.Matrix4,H0=new WeakMap,eo=new WeakMap,q0=go([]),Hl=function(n){se(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,u,l,c,d,v,A,h=n.call(this)||this;if(h.ident=Mt(),typeof window!="undefined"&&(Mo.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:he()},h.info=null,h.modeChangeDuration=(s=e.modeChangeDuration)!==null&&s!==void 0?s:PA,h.enableWheel=(u=e.enableWheel)!==null&&u!==void 0?u:!0,typeof window!="undefined")if("renderer"in e)e.renderer instanceof cn&&h.throwError(new Error("cannot render a internal renderer")),h.renderer=e.renderer;else try{h.renderer=new cn({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 p=Ql();h.renderer.setPixelRatio(p===1?window.devicePixelRatio:1),h.renderer.setSize(512,512)}catch(k){k instanceof Error&&h.throwError(k)}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:(v=(d=h.renderer)===null||d===void 0?void 0:d.outputEncoding)!==null&&v!==void 0?v: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 cu(U0),h.scene=new lu,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:RA,h.networkSubscribe=new Z0,h.networkSubscribe.on("network",function(k,M,I,L){var T;h.emit("network.resource",_("network.resource",{source:k,requestType:M,requestState:I,detail:L})),(T=h.analysis)===null||T===void 0||T.network(h.works,k,M,I,L)}),h.boundingMesh=Tv(new f.Box3(new f.Vector3(-.5,-.5,-.5),new f.Vector3(.5,.5,.5))),h.boundingMesh.name="bounding",h.models=f0(),h.models.push(new bo),h.lastModels=f0(),h.lastWorks=go([]),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||bA()),z0(h.scene),z0(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=ht.shared.add(function(k,M){for(var I=[],L=2;L<arguments.length;L++)I[L-2]=arguments[L];h.updateTime.apply(h,dt([k,M],I,!1))},!1,0,10));var m=function(){typeof document!="undefined"&&document.fullscreenElement===null&&h.currentMode==="VRPanorama"&&h.controller.emit("vr.requestExit",_("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 E=w[0],S=w[1],C=w[2];if(typeof E=="function"){var R=E(h,C);typeof S=="string"&&(h.plugins[S]?h.throwError(new Error("plugin name ".concat(S," is exists."))):h.plugins[S]=R)}}}return h.gpuPickingRenderTarget=new f.WebGLRenderTarget(1,1,{generateMipmaps:!1}),h.meshReplaceMaterialMap=new Map,h.meshOriginMaterialMap=new Map,yA(h),h}return Object.defineProperty(t,"version",{get:function(){return"6.3.0-alpha.20"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return Wi.decoderPath},set:function(e){Wi.setDecoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ktx2Path",{get:function(){return ei.transcoderPath},set:function(e){ei.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.");this.models.setMaterial({constantColor:o}),this.scene.traverse(function(d){if(!(!(d instanceof f.Mesh)||d instanceof Ct)){var v=Object.keys(i).filter(function(h){return h===d.uuid})[0];if(v)if(s.meshOriginMaterialMap.set(v,d.material),s.meshReplaceMaterialMap.get(v))d.material=s.meshReplaceMaterialMap.get(v);else{var A=new f.ShaderMaterial({uniforms:{color:{value:i[v]}},vertexShader:`
2166
2166
  void main() {
2167
2167
  vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
2168
2168
  gl_Position = projectionMatrix * mvPosition;
@@ -2172,4 +2172,4 @@ void main() {
2172
2172
  void main() {
2173
2173
  gl_FragColor = vec4( color, 1.0 );
2174
2174
  }
2175
- `});A.depthTest=d.material.depthTest,A.side=d.material.side,s.meshReplaceMaterialMap.set(v,A),d.material=A}}});var u=this.renderer.getSize(new f.Vector2);this.camera.setViewOffset(u.width,u.height,e*a,r*a,1,1),this.renderer.setRenderTarget(this.gpuPickingRenderTarget),this.render();var l=new Uint8Array(4);this.renderer.readRenderTargetPixels(this.gpuPickingRenderTarget,0,0,1,1,l),this.renderer.setRenderTarget(null),this.camera.clearViewOffset(),this.scene.traverse(function(d){!(d instanceof f.Mesh)||d instanceof Ct||s.meshOriginMaterialMap.get(d.uuid)&&(d.material=s.meshOriginMaterialMap.get(d.uuid))}),this.models.setMaterial({constantColor:null});var c=Object.keys(i).filter(function(d){return i[d].equals(new f.Color().setRGB(l[0]/255,l[1]/255,l[2]/255))})[0];return c||!1},t.prototype.dispose=function(){var e,r;if(this.destroyed!==!0){delete Mo.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 cn&&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",J("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;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&&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 cn)){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 cn&&(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){return i===void 0&&(i=!0),this.controller?this.controller.updateCamera(e,r,i):Promise.reject(new Error("controller is not initialized."))},t.prototype.updateCameraWithKeyframes=function(e,r,i){return i===void 0&&(i=!0),this.controller?this.controller.updateCameraWithKeyframes(e,r,i):Promise.reject(new Error("controller is not initialized."))},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,Pv(this.camera,r)}}return null},Object.defineProperty(t.prototype,"works",{get:function(){var e=eo.get(this);if(!e)return q0;for(var r=0,i=e;r<i.length;r++){var a=i[r];if(!Qo.has(a))return q0}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 Bv(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,v,A,h,p;a===void 0&&(a=!0);var g={};typeof i=="number"?g.duration=i:typeof i=="object"&&Object.assign(g,i),this.controller||(g.duration=0,g.effect="instant");var m=[];if(Array.isArray(e))for(var y=0,b=e;y<b.length;y++){var x=b[y];typeof x!="string"&&"work"in x?m.push(ri(x.work,x)):m.push(ri(x))}else m.push(ri(e));for(var w=go(m),E=function(W){var $=S,Y=new Rt({allowHosts:W.allowHosts,get requestProxy(){return $.requestProxy},get networkSubscribe(){return $.networkSubscribe}});cv(W,Y)},S=this,C=0,R=w;C<R.length;C++){var k=R[C];E(k)}this.lastWorks=this.works,r===void 0&&(r="inherit"),r==="inherit"&&this.lastWorks.length===0&&(r="initial");var M=w.initial,I=M.work.observers[0],L=I?{workCode:I.work.workCode,panoIndex:I.panoIndex}:{workCode:M.work.workCode,panoIndex:0},T=(s=M.mode)!==null&&s!==void 0?s:I?"Panorama":"Mapview",B={};if(r==="inherit"){T=this.currentMode;var D=w.resolvedObservers[this.panoIndex];D?L={workCode:D.work.workCode,panoIndex:D.panoIndex}:typeof w.initial.panoIndex=="number"?L={workCode:w.initial.work.workCode,panoIndex:w.initial.panoIndex}:(T==="Panorama"||T==="VRPanorama"||T==="XRPanorama")&&(T="Mapview"),B={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,distance:this.camera.pose.distance,offset:this.camera.pose.offset.clone()}}else if(r==="initial")typeof M.panoIndex=="number"&&(L={workCode:M.work.workCode,panoIndex:M.panoIndex}),M.mode&&(T=M.mode),B={longitude:M.longitude,latitude:M.latitude,fov:M.fov,distance:M.distance,offset:(u=M.offset)===null||u===void 0?void 0:u.clone()};else{if(T=(l=r.mode)!==null&&l!==void 0?l:this.currentMode,typeof r.panoIndex=="number"){var D=w.getResolvedObserver({workCode:(d=(c=r.workCode)!==null&&c!==void 0?c:M.work.workCode)!==null&&d!==void 0?d:"",panoIndex:r.panoIndex});D&&(L={workCode:D.work.workCode,panoIndex:D.panoIndex})}B={longitude:r.longitude,latitude:r.latitude,fov:r.fov,distance:r.distance,offset:r.offset}}var V=O(O(O({},L),{mode:T}),B);this.emit("works.request",J("works.request",{input:e,works:w,state:V,userAction:a}));var N=function(){var W,$;o.pano=L;var Y=(W=g.duration)!==null&&W!==void 0?W:o.modeChangeDuration,ne="fly";(o.currentMode==="Panorama"||o.currentMode==="VRPanorama"||o.currentMode==="XRPanorama")&&o.currentMode===T&&(ne=($=g.effect)!==null&&$!==void 0?$:"fade");var te=O(O({initial:{state:V,currentState:o.getCurrentState(),duration:Y,effect:ne,userAction:a}},o.commonParams()),o.controllerInits[T]);if(o.controller&&o.currentMode===T)o.controller.updateWork(w,V,{effect:ne,duration:Y},a)===!1&&(o.controller.destroy(),o.controller=o.applyController(T,te));else{var ue=o.currentMode,ie=kt[T].initAnimationEndState(te);if(o.controller)o.controller.destroy();else{var ge=kt[T].initAnimationEndState(te);o.camera.setFromPose(ge),o.modelGroup.visible=!0,o.emit("camera.update",J("camera.update",{state:o.getCurrentState(),userAction:a}))}o.controller=o.applyController(T,te);var pe=J("mode.change",{prevMode:ue,mode:T,state:ie,userAction:a});o.emit("mode.change",pe)}};if(eo.set(this,w),!this.controller){var U=O(O({initial:{state:V,currentState:this.getCurrentState(),duration:(v=g.duration)!==null&&v!==void 0?v:this.modeChangeDuration,effect:(A=g.effect)!==null&&A!==void 0?A:"fade",userAction:a}},this.commonParams()),this.controllerInits[T]),H=kt[T].initAnimationEndState(U);this.camera.setFromPose(H),this.emit("camera.update",J("camera.update",{state:this.getCurrentState(),userAction:a}))}this.updateConfiguration(g,!1);var G=Promise.resolve();if(T===t.Mode.Floorplan||T===t.Mode.Topview||T===t.Mode.Mapview||T===t.Mode.Model)G=this.loadModel(w,g).then(function(){o.needsRender=!0,o.modelSceneNeedsRender=!0,N(),o.emit("camera.update",J("camera.update",{state:o.getCurrentState(),userAction:a}))});else{if(!this.controller){var j=new f.Vector3,_=w.getResolvedObserver(L);_&&j.copy(_.position),this.camera.setFromPose({fov:B.fov,longitude:B.longitude,latitude:B.latitude,distance:B.distance,offset:(h=B.offset)!==null&&h!==void 0?h:j}),this.needsRender=!0,this.modelSceneNeedsRender=!0}N();var X=!1,Z=function(){o.works===w&&X===!1&&(o.needsRender=!0,o.modelSceneNeedsRender=!0,o.emit("camera.update",J("camera.update",{state:o.getCurrentState(),userAction:a})),o.loadModel(w,g),X=!0)};this.controller.once("pano.arrived",Z),this.controller.once("pano.cancel",Z),setTimeout(Z,((p=g.duration)!==null&&p!==void 0?p:this.modeChangeDuration)+1e3)}return this.emit("works.load",J("works.load",{input:e,state:this.getCurrentState(),userAction:a,works:w})),G.then(function(){return o.ready()}).then(function(){var W;o.emit("works.ready",J("works.ready",{input:e,state:o.getCurrentState(),userAction:a,works:w})),(W=o.analysis)===null||W===void 0||W.work(w)})},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,eo.delete(e),e.currentMode="Panorama",e.pano={workCode:"",panoIndex:0},e.camera.setFromPose({distance:0,fov:U0,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,v,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 p="fly";s.controller&&typeof i=="object"&&i.effect&&(p=i.effect);var g=typeof r.panoIndex=="number"?{workCode:(A=(d=r.workCode)!==null&&d!==void 0?d:(v=s.work)===null||v===void 0?void 0:v.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.Floorplan||e===t.Mode.Topview||e===t.Mode.Mapview||e===t.Mode.Model)&&!s.models.loaded){var m=new Error("model is not ready.");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(ze(g)," not existed."));s.throwError(m),l(m);return}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?nr(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):(nr(s.pano,g)||(s.pano=g),s.controller.updateCamera(r,h,a).catch(Q));else{var E=O(O({},r),g),S=O(O({initial:{state:E,currentState:s.getCurrentState(),duration:h,effect:p,userAction:a}},s.commonParams()),s.controllerInits[e]),C=kt[e].initAnimationEndState(S),R=J("mode.change.request",{prevMode:s.currentMode,mode:e,state:C,userAction:a});if(s.emit("mode.change.request",R),!R.defaultPrevented){y&&y.destroy(),s.controller=s.applyController(e,S);var k=J("mode.change",{prevMode:s.currentMode,mode:e,state:C,userAction:a});s.emit("mode.change",k)}}u()};if(e===t.Mode.VRPanorama)s.requestFullscreen(),Fv().then(function(){return x()}).catch(function(E){E instanceof Error&&(s.exitFullscreen(),s.throwError(E),l(E))});else if(e===t.Mode.XRPanorama){var w=ht.shared.getContext();w?w.end():Lv().then(function(E){ht.shared.setContext(E),x()}).catch(function(E){E instanceof Error&&(s.throwError(E),l(E))})}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);e=Math.ceil(e),r=Math.ceil(r),i=Math.ceil(i),a=Math.ceil(a),o=Math.ceil(o!=null?o:l),s=s!=null?s:!1;var v=this.getPixelsRenderTarget;v.setSize(i*o,a*o),this.renderer.setRenderTarget(v),this.camera.pixelRatio=o,this.camera.resolution.set(i,a),this.camera.setViewOffset(d.width,d.height,e,d.height-r-a,i,a),this.models.autoUpdate=!1,this.models.update(this.renderer,this.camera,this.currentMode),this.models.autoUpdate=!0;for(var A=0,h=this.scene.children;A<h.length;A++){var p=h[A];p instanceof f.Object3D&&p.traverseVisible(function(M){M.setResolution&&M.setResolution(i*o/l,a*o/l)})}this.controller?(this.controller.updateRenderSize(new f.Vector2(i*o,a*o)),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);var g=i*o,m=a*o,y=g*m,b=y*4,x;try{if(u){if(u.length!==b)throw new Error("buffer length is not equals pixels ".concat(b))}else u=new Uint8Array(b);if(this.renderer.readRenderTargetPixels(v,0,0,i*o,a*o,u),s)for(var w=y/2,E=0,S=0,C=0,R=0;S<w;S++)for(R=(m-Math.floor(S/g)-1)*g+S%g,C=0;C<4;C++)E=u[S*4+C],u[S*4+C]=u[R*4+C],u[R*4+C]=E}catch(M){x=M}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,x)throw x;return u},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(BA);this.scene.traverseVisible(function(o){o.setResolution&&o.setResolution(a.x,a.y)})}return this.aroundScissor(function(){i.renderer&&(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.poweredByRealsee&&i.currentMode!=="VRPanorama"&&i.currentMode!=="XRPanorama"&&i.renderer.getRenderTarget()!==i.getPixelsRenderTarget&&TA(i.renderer)),e&&ht.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,dt([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){ei.detectSupport(this.renderer);var u=this.models.loaded,l=this.models.refined;if(this.models.update(this.renderer,this.camera,this.currentMode),u===!1&&this.models.loaded===!0&&this.emit("models.load",J("models.load",{models:this.models})),l===!1&&this.models.refined===!0&&this.emit("models.refined",J("models.refined",{models:this.models})),this.models.loaded){for(var c=0,d=this.models;c<d.length;c++){var v=d[c];v.parent!==this.modelGroup&&(this.modelGroup.add(v),this.needsRender=!0,this.modelSceneNeedsRender=!0)}if(this.lastModels.length>0){for(var A=0,h=this.lastModels;A<h.length;A++){var v=h[A];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 p=new f.Vector2(512,512),g=new f.Vector2(512,512);this.renderer&&(this.renderer.getSize(p),p.x*=this.scissor.width,p.y*=this.scissor.height,this.renderer.getDrawingBufferSize(g),g.x*=this.scissor.width,g.y*=this.scissor.height);{for(var m=new f.Box3,y=new f.Box3,b=new f.Vector3(4,4,4),x=0,w=this.works.resolvedObservers;x<w.length;x++){var E=w[x];y.setFromCenterAndSize(E.position,b),m.union(y)}if(m.union(this.models.bounding),this.lastWorks)for(var S=0,C=this.lastWorks.resolvedObservers;S<C.length;S++){var E=C[S];y.setFromCenterAndSize(E.position,b),m.union(y)}m.union(this.lastModels.bounding),m.getCenter(this.boundingMesh.position),m.getSize(this.boundingMesh.scale),this.boundingMesh.boundingBox.copy(m),this.renderer&&this.model&&this.boundingMesh.update(this.renderer,this.camera,this.model)}var R=J("render.prepare",{needsRender:!0,info:null});if(this.emit("render.prepare",R),!R.defaultPrevented){var k=[];Oi.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),ki.setFromProjectionMatrix(Oi);for(var M=0,I=this.scene.children;M<I.length;M++){var L=I[M];L!==this.modelGroup&&L!==this.boundingMesh&&L.traverseVisible(function(U){if(U.setResolution&&U.setResolution(p.x,p.y),U.setTime&&U.setTime(e),U.mixer instanceof f.AnimationMixer){var H=H0.get(U.mixer);H||(H=new f.Clock,H0.set(U.mixer,H)),U.mixer.update(H.getDelta())}(U instanceof f.Mesh||U instanceof f.Line||U instanceof f.Points)&&(U instanceof f.ImmediateRenderObject||!U.frustumCulled||ki.intersectsObject(U))&&k.push(U)})}if(g.width*g.height>4096*2048?this.renderSwitch01=this.renderSwitch01^1:this.renderSwitch01=0,this.renderer&&this.paused===!1&&this.renderSwitch01===0){var T=void 0;if(this.onlyRenderIfNeeds!==!0)T=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 B=0,D=k;B<D.length;B++){var V=D[B],N=function(U){U.needsRender===!0?(U.needsRender=!1,a.needsRender=!0):U.mixer&&U.mixer.stats.actions.inUse>0&&(a.needsRender=!0)};N(V),V.traverseAncestors(N)}(this.needsRender!==!1||this.modelSceneNeedsRender!==!1)&&(T=this.render())}this.needsRender=!1,this.modelSceneNeedsRender=!1,this.hasListener("render")&&this.emit("render",J("render",{needsRender:T!==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 cn&&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=he();return Promise.all(o.map(function(u){var l=O({key:"pano.".concat(a.panoId,".").concat(u)},Ut(i.imageOptions,["size","format","quality","mappings"])),c=a.images[u],d=i.imageOptions.transform?i.imageOptions.transform(c,l):ot(c,l);return st(a.work).preload(d)})).then(function(){var u=he()-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,v=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(v,A)},t.prototype.getRenderObjects=function(e){Oi.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),ki.setFromProjectionMatrix(Oi),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||ki.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,v,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 p;typeof e.panoIndex=="number"&&(e.workCode?p={workCode:e.workCode,panoIndex:e.panoIndex}:p={workCode:(o=(a=this.work)===null||a===void 0?void 0:a.workCode)!==null&&o!==void 0?o:"",panoIndex:e.panoIndex});var g=(s=e.mode)!==null&&s!==void 0?s:this.state.mode,m,y,b,x,w;if((e.mode===t.Mode.Floorplan||e.mode===t.Mode.Topview||e.mode===t.Mode.Mapview||e.mode===t.Mode.Model)&&!this.models.loaded){this.throwError(new Error("model is not ready."));return}if(this.controller&&this.controller.stopMomentumMovement(),this.state.mode!==g){if(g==="VRPanorama"){this.changeMode("VRPanorama",void 0,void 0,!0);return}var E={workCode:p==null?void 0:p.workCode,panoIndex:p==null?void 0:p.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 S=O(O({initial:{state:E,currentState:this.getCurrentState(),duration:this.modeChangeDuration,effect:"fly",userAction:!1}},this.commonParams()),this.controllerInits[g]),C=kt[g].initAnimationEndState(S);m=C.longitude,y=C.latitude,b=C.fov,x=C.offset,w=C.distance}else m=(u=e.longitude)!==null&&u!==void 0?u:this.state.longitude,y=(l=e.latitude)!==null&&l!==void 0?l:this.state.latitude,b=(c=e.fov)!==null&&c!==void 0?c:this.state.fov,x=(d=e.offset)!==null&&d!==void 0?d:this.state.offset,w=(v=e.distance)!==null&&v!==void 0?v:this.state.distance;var R={workCode:(p!=null?p:this.pano).workCode,panoIndex:(p!=null?p:this.pano).panoIndex,mode:g,longitude:m,latitude:y,fov:b,offset:x,distance:w};this.emit("state.set",J("state.set",{userAction:i,state:R})),jr(this.state,R)||(this.controller&&R.mode==="VRPanorama"&&R.mode!==this.state.mode?(hr(this.state,R),this.changeMode("VRPanorama")):this.controller&&R.mode==="XRPanorama"&&R.mode!==this.state.mode?(hr(this.state,R),this.changeMode("XRPanorama")):(hr(this.state,R),this.controller&&i&&(this.controller.userAction=!1),r&&this.state.mode===R.mode&&(this.syncingState=this.syncState(he(),0,r),this.syncingState&&((A=this.controller)===null||A===void 0||A.updateTime(he(),0),this.syncingState=!1)),this.emit("state.change",J("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.works.length===0||!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 kt.Model){if(qi(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(!nr(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 kt.Floorplan||this.controller instanceof kt.Topview||this.controller instanceof kt.Mapview){var l=1,c=.2,d=.2,v=Math.PI/45,A=i?this.state.fov:Ha(this.camera.pose.fov,this.state.fov,l),h=Math.abs(this.camera.pose.distance-this.state.distance),p=h>d*15?h/15:c,g=i?this.state.distance:Ha(this.camera.pose.distance,this.state.distance,p),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):Rv(this.camera.pose.offset,this.state.offset,y),x=i?{longitude:this.state.longitude,latitude:this.state.latitude}:m0({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},v),w=x.longitude,E=x.latitude;if(Dt(A,this.camera.pose.fov)||qi(b,this.camera.pose.offset)||Dt(g,this.camera.pose.distance)||Dt(w,this.camera.pose.longitude,Math.PI*2)||Dt(E,this.camera.pose.latitude)){var S={x:b.x,y:b.y,z:b.z},C={fov:A};return Object.assign(S,{distance:g}),Object.assign(C,{longitude:w,latitude:E}),this.controller.stopMomentumMovement(),this.controller.cameraMotion.set(C,0).catch(Q),this.controller.locationMotion.set(S,0).catch(Q),!0}}else{var R=1,k=Math.PI/45,A=i?this.state.fov:Ha(this.camera.pose.fov,this.state.fov,R),M=i?{longitude:this.state.longitude,latitude:this.state.latitude}:m0({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},k),w=M.longitude,E=M.latitude,g=this.state.distance,b=new f.Vector3().copy(this.state.offset);if(Dt(g,this.camera.pose.distance)&&(this.state.distance=this.camera.pose.distance),qi(b,this.camera.pose.offset)&&(this.state.offset=this.camera.pose.offset.clone()),Dt(w,this.camera.pose.longitude,Math.PI*2)||Dt(E,this.camera.pose.latitude)||Dt(A,this.camera.pose.fov))return this.controller.stopMomentumMovement(),this.controller.cameraMotion.set({longitude:w,latitude:E,fov:A},0).catch(Q),!0}if(this.stateSynced=!0,a===!1&&this.emit("state.synced",J("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 B=0,D=T;B<D.length;B++){var V=D[B];this.controller instanceof kt.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(Jn){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 bo({onError:function(b){i.emit("model.error",J("model.error",{work:g,model:y,error:b})),i.throwError(b)},onShownFloorChange:function(b){i.emit("model.changeShownFloor",J("model.changeShownFloor",{work:g,model:y,error:null}))},onLoad:function(){i.emit("model.load",J("model.load",{work:g,model:y,error:null}))}});a.push(y),s.emit("model.request",J("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,v=this.models;d<v.length;d++){var A=v[d];a.indexOf(A)===-1&&this.lastModels.push(A)}this.models.length=0}for(var h=0,p=a;h<p.length;h++){var A=p[h];this.models.push(A)}return this.renderer&&(this.models.loaded=!1),new Promise(function(g){i.on("models.load",function(){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=kt[e];this.currentMode=e;for(var o=new a(r),s=function(A){o.on(A,function(){for(var h=[],p=0;p<arguments.length;p++)h[p]=arguments[p];var g=i.emit.apply(i,dt([A],h,!1));if(g)return!1})},u=0,l=Nl;u<l.length;u++){var c=l[u];s(c)}{var d=kt[e].initAnimationEndState(r),v=r.initial.userAction;jr(this.state,d)||(hr(this.state,d),this.emit("state.change",J("state.change",{userAction:v,state:this.state}))),this.emit("currentState.change",J("currentState.change",{userAction:v,state:this.getCurrentState()}))}return o.on("camera.update",function(A){var h;if(i.controller){var p=i.controller.getTargetState();A.userAction&&i.syncingState===!1&&i.state.mode===p.mode&&!jr(i.state,p)&&(hr(i.state,p),i.emit("state.change",J("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",J("currentState.change",{userAction:A.userAction,state:i.getCurrentState()}))}),o.on("initAnimation.start",function(A){var h,p=A.state,g=A.userAction;g&&i.state.mode===p.mode&&!jr(i.state,p)&&(hr(i.state,p),i.emit("state.change",J("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,p=A.state,g=A.userAction;g&&i.state.mode===p.mode&&!jr(i.state,p)&&(hr(i.state,p),i.emit("state.change",J("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,p=A.state,g=A.userAction;i.pano={workCode:p.workCode,panoIndex:p.panoIndex},g&&i.state.mode===p.mode&&!jr(i.state,p)&&(hr(i.state,p),i.emit("state.change",J("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,p=A.state,g=A.userAction;g&&i.state.mode===p.mode&&!jr(i.state,p)&&(hr(i.state,p),i.emit("state.change",J("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,p=A.state,g=A.userAction;g&&i.state.mode===p.mode&&!jr(i.state,p)&&(hr(i.state,p),i.emit("state.change",J("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",J("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 v=s(l.content.uri);if(v==="json"){var A=ot(l.content.uri,{key:"model.".concat(c)});d.push({url:A,type:"tileset"})}else if(v==="at3d"&&l.extras[v]){var A=l.content.uri;d.push({url:A,type:"model"});for(var h=l.extras[v],p=h.textureArray,g=h.textureOptions,m=0,y=p;m<y.length;m++){var b=y[m],x=O({key:"texture.pbm"},Ut(g,["format","quality","size","sharpen","mappings"])),w=hn(b,g==null?void 0:g.transform,x);d.push({url:w,type:"texture"})}}else{var A=ot(l.content.uri,{key:"model.".concat(c)});d.push({url:A,type:"model"})}}if(l.children)for(var E=0;E<l.children.length;E++){var S=l.children[E];d.push.apply(d,u(S,E))}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,v=e.observers;d<v.length;d++){for(var A=v[d],h=0,p=c;h<p.length;h++){var g=p[h],m=O({key:"pano.".concat(ze(A.pano),".").concat(g)},Ut(r.imageOptions,["size","format","quality","mappings"])),y=A.images[g],b=hn(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 E=w[x],S=0,C=c;S<C.length;S++)for(var g=C[S],R=E.size,k=Math.pow(2,E.level),M=1/k,I=0;I<k;I++)for(var L=0;L<k;L++){var T="".concat(A.panoId,".").concat(g,".").concat(E.level,".").concat(I,".").concat(L),m=O(O({key:"pano_tile.".concat(T)},Ut(r.imageOptions,["format","size","quality","sharpen","mappings"])),{size:E.scale>=1?void 0:R*M*E.scale,cut:[R*M*L,R*M*I,R*M,R*M]}),b=hn(E[g],r.imageOptions.transform,m);l.push({url:b,type:"pano_tile"})}}for(var B=0,D=o;B<D.length;B++){var V=D[B];V.tileset.url&&l.push({url:V.tileset.url,type:"model"}),l.push.apply(l,u(V.tileset.root))}return l})},t.Mode={Panorama:"Panorama",Model:"Model",Floorplan:"Floorplan",Topview:"Topview",Mapview:"Mapview",VRPanorama:"VRPanorama",XRPanorama:"XRPanorama"},t.Line=null,t}(ra),Mo={instances:{},constructor:Hl};typeof window!="undefined"&&Object.assign(window,{__FIVE_DEBUG__:Mo});var FA=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=ht;exports.Camera=cu;exports.CustomShader=If;exports.Fetcher=Rt;exports.Five=Hl;exports.InternalWebGLRenderer=cn;exports.IntersectMesh=aa;exports.Model=bo;exports.ModelViewLayer=Hi;exports.NetworkSubscribe=Z0;exports.PBMContainer=Df;exports.PBMGroup=Cf;exports.PBMMesh=Ct;exports.PBMMeshMaterial=Ar;exports.PBMPointCloud=ar;exports.PBMPointCloudMaterial=gi;exports.PROXY_CONTROLLER_EVENT_NAMES=Nl;exports.PanoCircleMesh=yl;exports.PanoCircleMeshCustom=wv;exports.PanoCircleMeshSolid=gv;exports.Scene=lu;exports.Subscribe=ra;exports.TextureLoader=Nn;exports.Tile=ko;exports.Tile3DModel=fn;exports.TileCache=mu;exports.TileCubeTextureTarget=Ve;exports.TileNode=Pu;exports.TileRequestScheduler=vu;exports.Tileset=Cr;exports.Trajectory=Au;exports.TrajectoryNode=hl;exports.Work=Uo;exports.XRButton=FA;exports.defaultImageURLTransform=ot;exports.defaultPbmParameters=Ae;exports.getViewportScale=Ql;exports.imageSupport=eu;exports.isPanoId=ru;exports.loadAt3d=Ju;exports.loadB3dm=Ou;exports.loadDome=Xu;exports.loadDomez=Zu;exports.loadFbx=ll;exports.loadGlb=Yu;exports.loadPbm=Ku;exports.loadPly=No;exports.loadPnts=Vu;exports.panoEqual=nr;exports.panoParse=yt;exports.panoStringify=ze;exports.parseWork=ri;
2175
+ `});A.depthTest=d.material.depthTest,A.side=d.material.side,s.meshReplaceMaterialMap.set(v,A),d.material=A}}});var u=this.renderer.getSize(new f.Vector2);this.camera.setViewOffset(u.width,u.height,e*a,r*a,1,1),this.renderer.setRenderTarget(this.gpuPickingRenderTarget),this.render();var l=new Uint8Array(4);this.renderer.readRenderTargetPixels(this.gpuPickingRenderTarget,0,0,1,1,l),this.renderer.setRenderTarget(null),this.camera.clearViewOffset(),this.scene.traverse(function(d){!(d instanceof f.Mesh)||d instanceof Ct||s.meshOriginMaterialMap.get(d.uuid)&&(d.material=s.meshOriginMaterialMap.get(d.uuid))}),this.models.setMaterial({constantColor:null});var c=Object.keys(i).filter(function(d){return i[d].equals(new f.Color().setRGB(l[0]/255,l[1]/255,l[2]/255))})[0];return c||!1},t.prototype.dispose=function(){var e,r;if(this.destroyed!==!0){delete Mo.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 cn&&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",_("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;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&&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 cn)){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 cn&&(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){return i===void 0&&(i=!0),this.controller?this.controller.updateCamera(e,r,i):Promise.reject(new Error("controller is not initialized."))},t.prototype.updateCameraWithKeyframes=function(e,r,i){return i===void 0&&(i=!0),this.controller?this.controller.updateCameraWithKeyframes(e,r,i):Promise.reject(new Error("controller is not initialized."))},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,Pv(this.camera,r)}}return null},Object.defineProperty(t.prototype,"works",{get:function(){var e=eo.get(this);if(!e)return q0;for(var r=0,i=e;r<i.length;r++){var a=i[r];if(!Qo.has(a))return q0}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 Bv(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,v,A,h,p;a===void 0&&(a=!0);var g={};typeof i=="number"?g.duration=i:typeof i=="object"&&Object.assign(g,i),this.controller||(g.duration=0,g.effect="instant");var m=[];if(Array.isArray(e))for(var y=0,b=e;y<b.length;y++){var x=b[y];typeof x!="string"&&"work"in x?m.push(ri(x.work,x)):m.push(ri(x))}else m.push(ri(e));for(var w=go(m),E=function(W){var $=S,Y=new Rt({allowHosts:W.allowHosts,get requestProxy(){return $.requestProxy},get networkSubscribe(){return $.networkSubscribe}});cv(W,Y)},S=this,C=0,R=w;C<R.length;C++){var k=R[C];E(k)}this.lastWorks=this.works,r===void 0&&(r="inherit"),r==="inherit"&&this.lastWorks.length===0&&(r="initial");var M=w.initial,I=M.work.observers[0],L=I?{workCode:I.work.workCode,panoIndex:I.panoIndex}:{workCode:M.work.workCode,panoIndex:0},T=(s=M.mode)!==null&&s!==void 0?s:I?"Panorama":"Mapview",B={};if(r==="inherit"){T=this.currentMode;var D=w.resolvedObservers[this.panoIndex];D?L={workCode:D.work.workCode,panoIndex:D.panoIndex}:typeof w.initial.panoIndex=="number"?L={workCode:w.initial.work.workCode,panoIndex:w.initial.panoIndex}:(T==="Panorama"||T==="VRPanorama"||T==="XRPanorama")&&(T="Mapview"),B={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,distance:this.camera.pose.distance,offset:this.camera.pose.offset.clone()}}else if(r==="initial")typeof M.panoIndex=="number"&&(L={workCode:M.work.workCode,panoIndex:M.panoIndex}),M.mode&&(T=M.mode),B={longitude:M.longitude,latitude:M.latitude,fov:M.fov,distance:M.distance,offset:(u=M.offset)===null||u===void 0?void 0:u.clone()};else{if(T=(l=r.mode)!==null&&l!==void 0?l:this.currentMode,typeof r.panoIndex=="number"){var D=w.getResolvedObserver({workCode:(d=(c=r.workCode)!==null&&c!==void 0?c:M.work.workCode)!==null&&d!==void 0?d:"",panoIndex:r.panoIndex});D&&(L={workCode:D.work.workCode,panoIndex:D.panoIndex})}B={longitude:r.longitude,latitude:r.latitude,fov:r.fov,distance:r.distance,offset:r.offset}}var V=O(O(O({},L),{mode:T}),B);this.emit("works.request",_("works.request",{input:e,works:w,state:V,userAction:a}));var N=function(){var W,$;o.pano=L;var Y=(W=g.duration)!==null&&W!==void 0?W:o.modeChangeDuration,ne="fly";(o.currentMode==="Panorama"||o.currentMode==="VRPanorama"||o.currentMode==="XRPanorama")&&o.currentMode===T&&(ne=($=g.effect)!==null&&$!==void 0?$:"fade");var te=O(O({initial:{state:V,currentState:o.getCurrentState(),duration:Y,effect:ne,userAction:a}},o.commonParams()),o.controllerInits[T]);if(o.controller&&o.currentMode===T)o.controller.updateWork(w,V,{effect:ne,duration:Y},a)===!1&&(o.controller.destroy(),o.controller=o.applyController(T,te));else{var ue=o.currentMode,ie=kt[T].initAnimationEndState(te);if(o.controller)o.controller.destroy();else{var ge=kt[T].initAnimationEndState(te);o.camera.setFromPose(ge),o.modelGroup.visible=!0,o.emit("camera.update",_("camera.update",{state:o.getCurrentState(),userAction:a}))}o.controller=o.applyController(T,te);var pe=_("mode.change",{prevMode:ue,mode:T,state:ie,userAction:a});o.emit("mode.change",pe)}};if(eo.set(this,w),!this.controller){var U=O(O({initial:{state:V,currentState:this.getCurrentState(),duration:(v=g.duration)!==null&&v!==void 0?v:this.modeChangeDuration,effect:(A=g.effect)!==null&&A!==void 0?A:"fade",userAction:a}},this.commonParams()),this.controllerInits[T]),H=kt[T].initAnimationEndState(U);this.camera.setFromPose(H),this.emit("camera.update",_("camera.update",{state:this.getCurrentState(),userAction:a}))}this.updateConfiguration(g,!1);var G=Promise.resolve();if(T===t.Mode.Floorplan||T===t.Mode.Topview||T===t.Mode.Mapview||T===t.Mode.Model)G=this.loadModel(w,g).then(function(){o.needsRender=!0,o.modelSceneNeedsRender=!0,N(),o.emit("camera.update",_("camera.update",{state:o.getCurrentState(),userAction:a}))});else{if(!this.controller){var j=new f.Vector3,J=w.getResolvedObserver(L);J&&j.copy(J.position),this.camera.setFromPose({fov:B.fov,longitude:B.longitude,latitude:B.latitude,distance:B.distance,offset:(h=B.offset)!==null&&h!==void 0?h:j}),this.needsRender=!0,this.modelSceneNeedsRender=!0}N();var X=!1,Z=function(){o.works===w&&X===!1&&(o.needsRender=!0,o.modelSceneNeedsRender=!0,o.emit("camera.update",_("camera.update",{state:o.getCurrentState(),userAction:a})),o.loadModel(w,g),X=!0)};this.controller.once("pano.arrived",Z),this.controller.once("pano.cancel",Z),setTimeout(Z,((p=g.duration)!==null&&p!==void 0?p:this.modeChangeDuration)+1e3)}return this.emit("works.load",_("works.load",{input:e,state:this.getCurrentState(),userAction:a,works:w})),G.then(function(){return o.ready()}).then(function(){var W;o.emit("works.ready",_("works.ready",{input:e,state:o.getCurrentState(),userAction:a,works:w})),(W=o.analysis)===null||W===void 0||W.work(w)})},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,eo.delete(e),e.currentMode="Panorama",e.pano={workCode:"",panoIndex:0},e.camera.setFromPose({distance:0,fov:U0,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,v,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 p="fly";s.controller&&typeof i=="object"&&i.effect&&(p=i.effect);var g=typeof r.panoIndex=="number"?{workCode:(A=(d=r.workCode)!==null&&d!==void 0?d:(v=s.work)===null||v===void 0?void 0:v.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.Floorplan||e===t.Mode.Topview||e===t.Mode.Mapview||e===t.Mode.Model)&&!s.models.loaded){var m=new Error("model is not ready.");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(ze(g)," not existed."));s.throwError(m),l(m);return}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?nr(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):(nr(s.pano,g)||(s.pano=g),s.controller.updateCamera(r,h,a).catch(Q));else{var E=O(O({},r),g),S=O(O({initial:{state:E,currentState:s.getCurrentState(),duration:h,effect:p,userAction:a}},s.commonParams()),s.controllerInits[e]),C=kt[e].initAnimationEndState(S),R=_("mode.change.request",{prevMode:s.currentMode,mode:e,state:C,userAction:a});if(s.emit("mode.change.request",R),!R.defaultPrevented){y&&y.destroy(),s.controller=s.applyController(e,S);var k=_("mode.change",{prevMode:s.currentMode,mode:e,state:C,userAction:a});s.emit("mode.change",k)}}u()};if(e===t.Mode.VRPanorama)s.requestFullscreen(),Fv().then(function(){return x()}).catch(function(E){E instanceof Error&&(s.exitFullscreen(),s.throwError(E),l(E))});else if(e===t.Mode.XRPanorama){var w=ht.shared.getContext();w?w.end():Lv().then(function(E){ht.shared.setContext(E),x()}).catch(function(E){E instanceof Error&&(s.throwError(E),l(E))})}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);e=Math.ceil(e),r=Math.ceil(r),i=Math.ceil(i),a=Math.ceil(a),o=Math.ceil(o!=null?o:l),s=s!=null?s:!1;var v=this.getPixelsRenderTarget;v.setSize(i*o,a*o),this.renderer.setRenderTarget(v),this.camera.pixelRatio=o,this.camera.resolution.set(i,a),this.camera.setViewOffset(d.width,d.height,e,d.height-r-a,i,a),this.models.autoUpdate=!1,this.models.update(this.renderer,this.camera,this.currentMode),this.models.autoUpdate=!0;for(var A=0,h=this.scene.children;A<h.length;A++){var p=h[A];p instanceof f.Object3D&&p.traverseVisible(function(M){M.setResolution&&M.setResolution(i*o/l,a*o/l)})}this.controller?(this.controller.updateRenderSize(new f.Vector2(i*o,a*o)),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);var g=i*o,m=a*o,y=g*m,b=y*4,x;try{if(u){if(u.length!==b)throw new Error("buffer length is not equals pixels ".concat(b))}else u=new Uint8Array(b);if(this.renderer.readRenderTargetPixels(v,0,0,i*o,a*o,u),s)for(var w=y/2,E=0,S=0,C=0,R=0;S<w;S++)for(R=(m-Math.floor(S/g)-1)*g+S%g,C=0;C<4;C++)E=u[S*4+C],u[S*4+C]=u[R*4+C],u[R*4+C]=E}catch(M){x=M}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,x)throw x;return u},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(BA);this.scene.traverseVisible(function(o){o.setResolution&&o.setResolution(a.x,a.y)})}return this.aroundScissor(function(){i.renderer&&(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.poweredByRealsee&&i.currentMode!=="VRPanorama"&&i.currentMode!=="XRPanorama"&&i.renderer.getRenderTarget()!==i.getPixelsRenderTarget&&TA(i.renderer)),e&&ht.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,dt([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){ei.detectSupport(this.renderer);var u=this.models.loaded,l=this.models.refined;if(this.models.update(this.renderer,this.camera,this.currentMode),u===!1&&this.models.loaded===!0&&this.emit("models.load",_("models.load",{models:this.models})),l===!1&&this.models.refined===!0&&this.emit("models.refined",_("models.refined",{models:this.models})),this.models.loaded){for(var c=0,d=this.models;c<d.length;c++){var v=d[c];v.parent!==this.modelGroup&&(this.modelGroup.add(v),this.needsRender=!0,this.modelSceneNeedsRender=!0)}if(this.lastModels.length>0){for(var A=0,h=this.lastModels;A<h.length;A++){var v=h[A];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 p=new f.Vector2(512,512),g=new f.Vector2(512,512);this.renderer&&(this.renderer.getSize(p),p.x*=this.scissor.width,p.y*=this.scissor.height,this.renderer.getDrawingBufferSize(g),g.x*=this.scissor.width,g.y*=this.scissor.height);{for(var m=new f.Box3,y=new f.Box3,b=new f.Vector3(4,4,4),x=0,w=this.works.resolvedObservers;x<w.length;x++){var E=w[x];y.setFromCenterAndSize(E.position,b),m.union(y)}if(m.union(this.models.bounding),this.lastWorks)for(var S=0,C=this.lastWorks.resolvedObservers;S<C.length;S++){var E=C[S];y.setFromCenterAndSize(E.position,b),m.union(y)}m.union(this.lastModels.bounding),m.getCenter(this.boundingMesh.position),m.getSize(this.boundingMesh.scale),this.boundingMesh.boundingBox.copy(m),this.renderer&&this.model&&this.boundingMesh.update(this.renderer,this.camera,this.model)}var R=_("render.prepare",{needsRender:!0,info:null});if(this.emit("render.prepare",R),!R.defaultPrevented){var k=[];Oi.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),ki.setFromProjectionMatrix(Oi);for(var M=0,I=this.scene.children;M<I.length;M++){var L=I[M];L!==this.modelGroup&&L!==this.boundingMesh&&L.traverseVisible(function(U){if(U.setResolution&&U.setResolution(p.x,p.y),U.setTime&&U.setTime(e),U.mixer instanceof f.AnimationMixer){var H=H0.get(U.mixer);H||(H=new f.Clock,H0.set(U.mixer,H)),U.mixer.update(H.getDelta())}(U instanceof f.Mesh||U instanceof f.Line||U instanceof f.Points)&&(U instanceof f.ImmediateRenderObject||!U.frustumCulled||ki.intersectsObject(U))&&k.push(U)})}if(g.width*g.height>4096*2048?this.renderSwitch01=this.renderSwitch01^1:this.renderSwitch01=0,this.renderer&&this.paused===!1&&this.renderSwitch01===0){var T=void 0;if(this.onlyRenderIfNeeds!==!0)T=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 B=0,D=k;B<D.length;B++){var V=D[B],N=function(U){U.needsRender===!0?(U.needsRender=!1,a.needsRender=!0):U.mixer&&U.mixer.stats.actions.inUse>0&&(a.needsRender=!0)};N(V),V.traverseAncestors(N)}(this.needsRender!==!1||this.modelSceneNeedsRender!==!1)&&(T=this.render())}this.needsRender=!1,this.modelSceneNeedsRender=!1,this.hasListener("render")&&this.emit("render",_("render",{needsRender:T!==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 cn&&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=he();return Promise.all(o.map(function(u){var l=O({key:"pano.".concat(a.panoId,".").concat(u)},Ut(i.imageOptions,["size","format","quality","mappings"])),c=a.images[u],d=i.imageOptions.transform?i.imageOptions.transform(c,l):ot(c,l);return st(a.work).preload(d)})).then(function(){var u=he()-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,v=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(v,A)},t.prototype.getRenderObjects=function(e){Oi.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),ki.setFromProjectionMatrix(Oi),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||ki.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,v,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 p;typeof e.panoIndex=="number"&&(e.workCode?p={workCode:e.workCode,panoIndex:e.panoIndex}:p={workCode:(o=(a=this.work)===null||a===void 0?void 0:a.workCode)!==null&&o!==void 0?o:"",panoIndex:e.panoIndex});var g=(s=e.mode)!==null&&s!==void 0?s:this.state.mode,m,y,b,x,w;if((e.mode===t.Mode.Floorplan||e.mode===t.Mode.Topview||e.mode===t.Mode.Mapview||e.mode===t.Mode.Model)&&!this.models.loaded){this.throwError(new Error("model is not ready."));return}if(this.controller&&this.controller.stopMomentumMovement(),this.state.mode!==g){if(g==="VRPanorama"){this.changeMode("VRPanorama",void 0,void 0,!0);return}var E={workCode:p==null?void 0:p.workCode,panoIndex:p==null?void 0:p.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 S=O(O({initial:{state:E,currentState:this.getCurrentState(),duration:this.modeChangeDuration,effect:"fly",userAction:!1}},this.commonParams()),this.controllerInits[g]),C=kt[g].initAnimationEndState(S);m=C.longitude,y=C.latitude,b=C.fov,x=C.offset,w=C.distance}else m=(u=e.longitude)!==null&&u!==void 0?u:this.state.longitude,y=(l=e.latitude)!==null&&l!==void 0?l:this.state.latitude,b=(c=e.fov)!==null&&c!==void 0?c:this.state.fov,x=(d=e.offset)!==null&&d!==void 0?d:this.state.offset,w=(v=e.distance)!==null&&v!==void 0?v:this.state.distance;var R={workCode:(p!=null?p:this.pano).workCode,panoIndex:(p!=null?p:this.pano).panoIndex,mode:g,longitude:m,latitude:y,fov:b,offset:x,distance:w};this.emit("state.set",_("state.set",{userAction:i,state:R})),jr(this.state,R)||(this.controller&&R.mode==="VRPanorama"&&R.mode!==this.state.mode?(hr(this.state,R),this.changeMode("VRPanorama")):this.controller&&R.mode==="XRPanorama"&&R.mode!==this.state.mode?(hr(this.state,R),this.changeMode("XRPanorama")):(hr(this.state,R),this.controller&&i&&(this.controller.userAction=!1),r&&this.state.mode===R.mode&&(this.syncingState=this.syncState(he(),0,r),this.syncingState&&((A=this.controller)===null||A===void 0||A.updateTime(he(),0),this.syncingState=!1)),this.emit("state.change",_("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.works.length===0||!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 kt.Model){if(qi(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(!nr(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 kt.Floorplan||this.controller instanceof kt.Topview||this.controller instanceof kt.Mapview){var l=1,c=.2,d=.2,v=Math.PI/45,A=i?this.state.fov:Ha(this.camera.pose.fov,this.state.fov,l),h=Math.abs(this.camera.pose.distance-this.state.distance),p=h>d*15?h/15:c,g=i?this.state.distance:Ha(this.camera.pose.distance,this.state.distance,p),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):Rv(this.camera.pose.offset,this.state.offset,y),x=i?{longitude:this.state.longitude,latitude:this.state.latitude}:m0({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},v),w=x.longitude,E=x.latitude;if(Dt(A,this.camera.pose.fov)||qi(b,this.camera.pose.offset)||Dt(g,this.camera.pose.distance)||Dt(w,this.camera.pose.longitude,Math.PI*2)||Dt(E,this.camera.pose.latitude)){var S={x:b.x,y:b.y,z:b.z},C={fov:A};return Object.assign(S,{distance:g}),Object.assign(C,{longitude:w,latitude:E}),this.controller.stopMomentumMovement(),this.controller.cameraMotion.set(C,0).catch(Q),this.controller.locationMotion.set(S,0).catch(Q),!0}}else{var R=1,k=Math.PI/45,A=i?this.state.fov:Ha(this.camera.pose.fov,this.state.fov,R),M=i?{longitude:this.state.longitude,latitude:this.state.latitude}:m0({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},k),w=M.longitude,E=M.latitude,g=this.state.distance,b=new f.Vector3().copy(this.state.offset);if(Dt(g,this.camera.pose.distance)&&(this.state.distance=this.camera.pose.distance),qi(b,this.camera.pose.offset)&&(this.state.offset=this.camera.pose.offset.clone()),Dt(w,this.camera.pose.longitude,Math.PI*2)||Dt(E,this.camera.pose.latitude)||Dt(A,this.camera.pose.fov))return this.controller.stopMomentumMovement(),this.controller.cameraMotion.set({longitude:w,latitude:E,fov:A},0).catch(Q),!0}if(this.stateSynced=!0,a===!1&&this.emit("state.synced",_("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 B=0,D=T;B<D.length;B++){var V=D[B];this.controller instanceof kt.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(_n){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 bo({onError:function(b){i.emit("model.error",_("model.error",{work:g,model:y,error:b})),i.throwError(b)},onShownFloorChange:function(b){i.emit("model.changeShownFloor",_("model.changeShownFloor",{work:g,model:y,error:null}))},onLoad:function(){i.emit("model.load",_("model.load",{work:g,model:y,error:null}))}});a.push(y),s.emit("model.request",_("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,v=this.models;d<v.length;d++){var A=v[d];a.indexOf(A)===-1&&this.lastModels.push(A)}this.models.length=0}for(var h=0,p=a;h<p.length;h++){var A=p[h];this.models.push(A)}return this.renderer&&(this.models.loaded=!1),new Promise(function(g){i.on("models.load",function(){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=kt[e];this.currentMode=e;for(var o=new a(r),s=function(A){o.on(A,function(){for(var h=[],p=0;p<arguments.length;p++)h[p]=arguments[p];var g=i.emit.apply(i,dt([A],h,!1));if(g)return!1})},u=0,l=Nl;u<l.length;u++){var c=l[u];s(c)}{var d=kt[e].initAnimationEndState(r),v=r.initial.userAction;jr(this.state,d)||(hr(this.state,d),this.emit("state.change",_("state.change",{userAction:v,state:this.state}))),this.emit("currentState.change",_("currentState.change",{userAction:v,state:this.getCurrentState()}))}return o.on("camera.update",function(A){var h;if(i.controller){var p=i.controller.getTargetState();A.userAction&&i.syncingState===!1&&i.state.mode===p.mode&&!jr(i.state,p)&&(hr(i.state,p),i.emit("state.change",_("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",_("currentState.change",{userAction:A.userAction,state:i.getCurrentState()}))}),o.on("initAnimation.start",function(A){var h,p=A.state,g=A.userAction;g&&i.state.mode===p.mode&&!jr(i.state,p)&&(hr(i.state,p),i.emit("state.change",_("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,p=A.state,g=A.userAction;g&&i.state.mode===p.mode&&!jr(i.state,p)&&(hr(i.state,p),i.emit("state.change",_("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,p=A.state,g=A.userAction;i.pano={workCode:p.workCode,panoIndex:p.panoIndex},g&&i.state.mode===p.mode&&!jr(i.state,p)&&(hr(i.state,p),i.emit("state.change",_("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,p=A.state,g=A.userAction;g&&i.state.mode===p.mode&&!jr(i.state,p)&&(hr(i.state,p),i.emit("state.change",_("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,p=A.state,g=A.userAction;g&&i.state.mode===p.mode&&!jr(i.state,p)&&(hr(i.state,p),i.emit("state.change",_("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",_("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 v=s(l.content.uri);if(v==="json"){var A=ot(l.content.uri,{key:"model.".concat(c)});d.push({url:A,type:"tileset"})}else if(v==="at3d"&&l.extras[v]){var A=l.content.uri;d.push({url:A,type:"model"});for(var h=l.extras[v],p=h.textureArray,g=h.textureOptions,m=0,y=p;m<y.length;m++){var b=y[m],x=O({key:"texture.pbm"},Ut(g,["format","quality","size","sharpen","mappings"])),w=hn(b,g==null?void 0:g.transform,x);d.push({url:w,type:"texture"})}}else{var A=ot(l.content.uri,{key:"model.".concat(c)});d.push({url:A,type:"model"})}}if(l.children)for(var E=0;E<l.children.length;E++){var S=l.children[E];d.push.apply(d,u(S,E))}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,v=e.observers;d<v.length;d++){for(var A=v[d],h=0,p=c;h<p.length;h++){var g=p[h],m=O({key:"pano.".concat(ze(A.pano),".").concat(g)},Ut(r.imageOptions,["size","format","quality","mappings"])),y=A.images[g],b=hn(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 E=w[x],S=0,C=c;S<C.length;S++)for(var g=C[S],R=E.size,k=Math.pow(2,E.level),M=1/k,I=0;I<k;I++)for(var L=0;L<k;L++){var T="".concat(A.panoId,".").concat(g,".").concat(E.level,".").concat(I,".").concat(L),m=O(O({key:"pano_tile.".concat(T)},Ut(r.imageOptions,["format","size","quality","sharpen","mappings"])),{size:E.scale>=1?void 0:R*M*E.scale,cut:[R*M*L,R*M*I,R*M,R*M]}),b=hn(E[g],r.imageOptions.transform,m);l.push({url:b,type:"pano_tile"})}}for(var B=0,D=o;B<D.length;B++){var V=D[B];V.tileset.url&&l.push({url:V.tileset.url,type:"model"}),l.push.apply(l,u(V.tileset.root))}return l})},t.Mode={Panorama:"Panorama",Model:"Model",Floorplan:"Floorplan",Topview:"Topview",Mapview:"Mapview",VRPanorama:"VRPanorama",XRPanorama:"XRPanorama"},t.Line=null,t}(ra),Mo={instances:{},constructor:Hl};typeof window!="undefined"&&Object.assign(window,{__FIVE_DEBUG__:Mo});var FA=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=ht;exports.Camera=cu;exports.CustomShader=If;exports.Fetcher=Rt;exports.Five=Hl;exports.InternalWebGLRenderer=cn;exports.IntersectMesh=aa;exports.Model=bo;exports.ModelViewLayer=Hi;exports.NetworkSubscribe=Z0;exports.PBMContainer=Df;exports.PBMGroup=Cf;exports.PBMMesh=Ct;exports.PBMMeshMaterial=Ar;exports.PBMPointCloud=ar;exports.PBMPointCloudMaterial=gi;exports.PROXY_CONTROLLER_EVENT_NAMES=Nl;exports.PanoCircleMesh=yl;exports.PanoCircleMeshCustom=wv;exports.PanoCircleMeshSolid=gv;exports.Scene=lu;exports.Subscribe=ra;exports.TextureLoader=Nn;exports.Tile=ko;exports.Tile3DModel=fn;exports.TileCache=mu;exports.TileCubeTextureTarget=Ve;exports.TileNode=Pu;exports.TileRequestScheduler=vu;exports.Tileset=Cr;exports.Trajectory=Au;exports.TrajectoryNode=hl;exports.Work=Uo;exports.XRButton=FA;exports.defaultImageURLTransform=ot;exports.defaultPbmParameters=Ae;exports.getViewportScale=Ql;exports.imageSupport=eu;exports.isPanoId=ru;exports.loadAt3d=_u;exports.loadB3dm=Ou;exports.loadDome=Xu;exports.loadDomez=Zu;exports.loadFbx=ll;exports.loadGlb=Yu;exports.loadPbm=Ku;exports.loadPly=No;exports.loadPnts=Vu;exports.panoEqual=nr;exports.panoParse=yt;exports.panoStringify=ze;exports.parseWork=ri;