@loaders.gl/3d-tiles 4.3.0-alpha.2 → 4.3.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dist.min.js CHANGED
@@ -4,7 +4,7 @@
4
4
  else if (typeof define === 'function' && define.amd) define([], factory);
5
5
  else if (typeof exports === 'object') exports['loaders'] = factory();
6
6
  else root['loaders'] = factory();})(globalThis, function () {
7
- "use strict";var __exports__=(()=>{var qd=Object.create;var ps=Object.defineProperty;var Wd=Object.getOwnPropertyDescriptor;var $d=Object.getOwnPropertyNames;var t1=Object.getPrototypeOf,e1=Object.prototype.hasOwnProperty;var ct=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ut=(e,t)=>{for(var r in t)ps(e,r,{get:t[r],enumerable:!0})},ms=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of $d(t))!e1.call(e,s)&&s!==r&&ps(e,s,{get:()=>t[s],enumerable:!(n=Wd(t,s))||n.enumerable});return e},gs=(e,t,r)=>(ms(e,t,"default"),r&&ms(r,t,"default")),xr=(e,t,r)=>(r=e!=null?qd(t1(e)):{},ms(t||!e||!e.__esModule?ps(r,"default",{value:e,enumerable:!0}):r,e)),r1=e=>ms(ps({},"__esModule",{value:!0}),e);var gn=ct((V_,Yc)=>{Yc.exports=globalThis.loaders});var xe=ct(gt=>{"use strict";var V2=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function j2(e,t){return Object.prototype.hasOwnProperty.call(e,t)}gt.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var n in r)j2(r,n)&&(e[n]=r[n])}}return e};gt.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var K2={arraySet:function(e,t,r,n,s){if(t.subarray&&e.subarray){e.set(t.subarray(r,r+n),s);return}for(var o=0;o<n;o++)e[s+o]=t[r+o]},flattenChunks:function(e){var t,r,n,s,o,i;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(i=new Uint8Array(n),s=0,t=0,r=e.length;t<r;t++)o=e[t],i.set(o,s),s+=o.length;return i}},X2={arraySet:function(e,t,r,n,s){for(var o=0;o<n;o++)e[s+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};gt.setTyped=function(e){e?(gt.Buf8=Uint8Array,gt.Buf16=Uint16Array,gt.Buf32=Int32Array,gt.assign(gt,K2)):(gt.Buf8=Array,gt.Buf16=Array,gt.Buf32=Array,gt.assign(gt,X2))};gt.setTyped(V2)});var y0=ct(an=>{"use strict";var Y2=xe(),Z2=4,t0=0,e0=1,q2=2;function on(e){for(var t=e.length;--t>=0;)e[t]=0}var W2=0,a0=1,$2=2,tE=3,eE=258,dc=29,ts=256,Zn=ts+1+dc,sn=30,Ac=19,c0=2*Zn+1,ir=15,ac=16,rE=7,mc=256,f0=16,h0=17,l0=18,lc=[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],wo=[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],nE=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],u0=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],sE=512,Be=new Array((Zn+2)*2);on(Be);var Yn=new Array(sn*2);on(Yn);var qn=new Array(sE);on(qn);var Wn=new Array(eE-tE+1);on(Wn);var pc=new Array(dc);on(pc);var Io=new Array(sn);on(Io);function cc(e,t,r,n,s){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=s,this.has_stree=e&&e.length}var d0,A0,m0;function fc(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function p0(e){return e<256?qn[e]:qn[256+(e>>>7)]}function $n(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function Mt(e,t,r){e.bi_valid>ac-r?(e.bi_buf|=t<<e.bi_valid&65535,$n(e,e.bi_buf),e.bi_buf=t>>ac-e.bi_valid,e.bi_valid+=r-ac):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function se(e,t,r){Mt(e,r[t*2],r[t*2+1])}function g0(e,t){var r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1}function oE(e){e.bi_valid===16?($n(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function iE(e,t){var r=t.dyn_tree,n=t.max_code,s=t.stat_desc.static_tree,o=t.stat_desc.has_stree,i=t.stat_desc.extra_bits,a=t.stat_desc.extra_base,c=t.stat_desc.max_length,f,h,u,l,d,A,m=0;for(l=0;l<=ir;l++)e.bl_count[l]=0;for(r[e.heap[e.heap_max]*2+1]=0,f=e.heap_max+1;f<c0;f++)h=e.heap[f],l=r[r[h*2+1]*2+1]+1,l>c&&(l=c,m++),r[h*2+1]=l,!(h>n)&&(e.bl_count[l]++,d=0,h>=a&&(d=i[h-a]),A=r[h*2],e.opt_len+=A*(l+d),o&&(e.static_len+=A*(s[h*2+1]+d)));if(m!==0){do{for(l=c-1;e.bl_count[l]===0;)l--;e.bl_count[l]--,e.bl_count[l+1]+=2,e.bl_count[c]--,m-=2}while(m>0);for(l=c;l!==0;l--)for(h=e.bl_count[l];h!==0;)u=e.heap[--f],!(u>n)&&(r[u*2+1]!==l&&(e.opt_len+=(l-r[u*2+1])*r[u*2],r[u*2+1]=l),h--)}}function x0(e,t,r){var n=new Array(ir+1),s=0,o,i;for(o=1;o<=ir;o++)n[o]=s=s+r[o-1]<<1;for(i=0;i<=t;i++){var a=e[i*2+1];a!==0&&(e[i*2]=g0(n[a]++,a))}}function aE(){var e,t,r,n,s,o=new Array(ir+1);for(r=0,n=0;n<dc-1;n++)for(pc[n]=r,e=0;e<1<<lc[n];e++)Wn[r++]=n;for(Wn[r-1]=n,s=0,n=0;n<16;n++)for(Io[n]=s,e=0;e<1<<wo[n];e++)qn[s++]=n;for(s>>=7;n<sn;n++)for(Io[n]=s<<7,e=0;e<1<<wo[n]-7;e++)qn[256+s++]=n;for(t=0;t<=ir;t++)o[t]=0;for(e=0;e<=143;)Be[e*2+1]=8,e++,o[8]++;for(;e<=255;)Be[e*2+1]=9,e++,o[9]++;for(;e<=279;)Be[e*2+1]=7,e++,o[7]++;for(;e<=287;)Be[e*2+1]=8,e++,o[8]++;for(x0(Be,Zn+1,o),e=0;e<sn;e++)Yn[e*2+1]=5,Yn[e*2]=g0(e,5);d0=new cc(Be,lc,ts+1,Zn,ir),A0=new cc(Yn,wo,0,sn,ir),m0=new cc(new Array(0),nE,0,Ac,rE)}function B0(e){var t;for(t=0;t<Zn;t++)e.dyn_ltree[t*2]=0;for(t=0;t<sn;t++)e.dyn_dtree[t*2]=0;for(t=0;t<Ac;t++)e.bl_tree[t*2]=0;e.dyn_ltree[mc*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function E0(e){e.bi_valid>8?$n(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function cE(e,t,r,n){E0(e),n&&($n(e,r),$n(e,~r)),Y2.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}function r0(e,t,r,n){var s=t*2,o=r*2;return e[s]<e[o]||e[s]===e[o]&&n[t]<=n[r]}function hc(e,t,r){for(var n=e.heap[r],s=r<<1;s<=e.heap_len&&(s<e.heap_len&&r0(t,e.heap[s+1],e.heap[s],e.depth)&&s++,!r0(t,n,e.heap[s],e.depth));)e.heap[r]=e.heap[s],r=s,s<<=1;e.heap[r]=n}function n0(e,t,r){var n,s,o=0,i,a;if(e.last_lit!==0)do n=e.pending_buf[e.d_buf+o*2]<<8|e.pending_buf[e.d_buf+o*2+1],s=e.pending_buf[e.l_buf+o],o++,n===0?se(e,s,t):(i=Wn[s],se(e,i+ts+1,t),a=lc[i],a!==0&&(s-=pc[i],Mt(e,s,a)),n--,i=p0(n),se(e,i,r),a=wo[i],a!==0&&(n-=Io[i],Mt(e,n,a)));while(o<e.last_lit);se(e,mc,t)}function uc(e,t){var r=t.dyn_tree,n=t.stat_desc.static_tree,s=t.stat_desc.has_stree,o=t.stat_desc.elems,i,a,c=-1,f;for(e.heap_len=0,e.heap_max=c0,i=0;i<o;i++)r[i*2]!==0?(e.heap[++e.heap_len]=c=i,e.depth[i]=0):r[i*2+1]=0;for(;e.heap_len<2;)f=e.heap[++e.heap_len]=c<2?++c:0,r[f*2]=1,e.depth[f]=0,e.opt_len--,s&&(e.static_len-=n[f*2+1]);for(t.max_code=c,i=e.heap_len>>1;i>=1;i--)hc(e,r,i);f=o;do i=e.heap[1],e.heap[1]=e.heap[e.heap_len--],hc(e,r,1),a=e.heap[1],e.heap[--e.heap_max]=i,e.heap[--e.heap_max]=a,r[f*2]=r[i*2]+r[a*2],e.depth[f]=(e.depth[i]>=e.depth[a]?e.depth[i]:e.depth[a])+1,r[i*2+1]=r[a*2+1]=f,e.heap[1]=f++,hc(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],iE(e,t),x0(r,c,e.bl_count)}function s0(e,t,r){var n,s=-1,o,i=t[0*2+1],a=0,c=7,f=4;for(i===0&&(c=138,f=3),t[(r+1)*2+1]=65535,n=0;n<=r;n++)o=i,i=t[(n+1)*2+1],!(++a<c&&o===i)&&(a<f?e.bl_tree[o*2]+=a:o!==0?(o!==s&&e.bl_tree[o*2]++,e.bl_tree[f0*2]++):a<=10?e.bl_tree[h0*2]++:e.bl_tree[l0*2]++,a=0,s=o,i===0?(c=138,f=3):o===i?(c=6,f=3):(c=7,f=4))}function o0(e,t,r){var n,s=-1,o,i=t[0*2+1],a=0,c=7,f=4;for(i===0&&(c=138,f=3),n=0;n<=r;n++)if(o=i,i=t[(n+1)*2+1],!(++a<c&&o===i)){if(a<f)do se(e,o,e.bl_tree);while(--a!==0);else o!==0?(o!==s&&(se(e,o,e.bl_tree),a--),se(e,f0,e.bl_tree),Mt(e,a-3,2)):a<=10?(se(e,h0,e.bl_tree),Mt(e,a-3,3)):(se(e,l0,e.bl_tree),Mt(e,a-11,7));a=0,s=o,i===0?(c=138,f=3):o===i?(c=6,f=3):(c=7,f=4)}}function fE(e){var t;for(s0(e,e.dyn_ltree,e.l_desc.max_code),s0(e,e.dyn_dtree,e.d_desc.max_code),uc(e,e.bl_desc),t=Ac-1;t>=3&&e.bl_tree[u0[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function hE(e,t,r,n){var s;for(Mt(e,t-257,5),Mt(e,r-1,5),Mt(e,n-4,4),s=0;s<n;s++)Mt(e,e.bl_tree[u0[s]*2+1],3);o0(e,e.dyn_ltree,t-1),o0(e,e.dyn_dtree,r-1)}function lE(e){var t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return t0;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return e0;for(r=32;r<ts;r++)if(e.dyn_ltree[r*2]!==0)return e0;return t0}var i0=!1;function uE(e){i0||(aE(),i0=!0),e.l_desc=new fc(e.dyn_ltree,d0),e.d_desc=new fc(e.dyn_dtree,A0),e.bl_desc=new fc(e.bl_tree,m0),e.bi_buf=0,e.bi_valid=0,B0(e)}function _0(e,t,r,n){Mt(e,(W2<<1)+(n?1:0),3),cE(e,t,r,!0)}function dE(e){Mt(e,a0<<1,3),se(e,mc,Be),oE(e)}function AE(e,t,r,n){var s,o,i=0;e.level>0?(e.strm.data_type===q2&&(e.strm.data_type=lE(e)),uc(e,e.l_desc),uc(e,e.d_desc),i=fE(e),s=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=s&&(s=o)):s=o=r+5,r+4<=s&&t!==-1?_0(e,t,r,n):e.strategy===Z2||o===s?(Mt(e,(a0<<1)+(n?1:0),3),n0(e,Be,Yn)):(Mt(e,($2<<1)+(n?1:0),3),hE(e,e.l_desc.max_code+1,e.d_desc.max_code+1,i+1),n0(e,e.dyn_ltree,e.dyn_dtree)),B0(e),n&&E0(e)}function mE(e,t,r){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=r&255,e.last_lit++,t===0?e.dyn_ltree[r*2]++:(e.matches++,t--,e.dyn_ltree[(Wn[r]+ts+1)*2]++,e.dyn_dtree[p0(t)*2]++),e.last_lit===e.lit_bufsize-1}an._tr_init=uE;an._tr_stored_block=_0;an._tr_flush_block=AE;an._tr_tally=mE;an._tr_align=dE});var gc=ct((pL,T0)=>{"use strict";function pE(e,t,r,n){for(var s=e&65535|0,o=e>>>16&65535|0,i=0;r!==0;){i=r>2e3?2e3:r,r-=i;do s=s+t[n++]|0,o=o+s|0;while(--i);s%=65521,o%=65521}return s|o<<16|0}T0.exports=pE});var xc=ct((gL,C0)=>{"use strict";function gE(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t}var xE=gE();function BE(e,t,r,n){var s=xE,o=n+r;e^=-1;for(var i=n;i<o;i++)e=e>>>8^s[(e^t[i])&255];return e^-1}C0.exports=BE});var So=ct((xL,M0)=>{"use strict";M0.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var O0=ct(ae=>{"use strict";var xt=xe(),Nt=y0(),S0=gc(),Le=xc(),EE=So(),hr=0,_E=1,yE=3,Ue=4,b0=5,ie=0,w0=1,Gt=-2,TE=-3,Bc=-5,CE=-1,ME=1,Ro=2,bE=3,wE=4,IE=0,SE=2,Oo=8,RE=9,FE=15,DE=8,LE=29,OE=256,_c=OE+1+LE,vE=30,NE=19,GE=2*_c+1,UE=15,k=3,Ne=258,jt=Ne+k+1,PE=32,vo=42,yc=69,Fo=73,Do=91,Lo=103,ar=113,rs=666,it=1,ns=2,cr=3,hn=4,HE=3;function Ge(e,t){return e.msg=EE[t],t}function I0(e){return(e<<1)-(e>4?9:0)}function ve(e){for(var t=e.length;--t>=0;)e[t]=0}function Oe(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(xt.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0&&(t.pending_out=0))}function lt(e,t){Nt._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Oe(e.strm)}function V(e,t){e.pending_buf[e.pending++]=t}function es(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function kE(e,t,r,n){var s=e.avail_in;return s>n&&(s=n),s===0?0:(e.avail_in-=s,xt.arraySet(t,e.input,e.next_in,s,r),e.state.wrap===1?e.adler=S0(e.adler,t,s,r):e.state.wrap===2&&(e.adler=Le(e.adler,t,s,r)),e.next_in+=s,e.total_in+=s,s)}function R0(e,t){var r=e.max_chain_length,n=e.strstart,s,o,i=e.prev_length,a=e.nice_match,c=e.strstart>e.w_size-jt?e.strstart-(e.w_size-jt):0,f=e.window,h=e.w_mask,u=e.prev,l=e.strstart+Ne,d=f[n+i-1],A=f[n+i];e.prev_length>=e.good_match&&(r>>=2),a>e.lookahead&&(a=e.lookahead);do if(s=t,!(f[s+i]!==A||f[s+i-1]!==d||f[s]!==f[n]||f[++s]!==f[n+1])){n+=2,s++;do;while(f[++n]===f[++s]&&f[++n]===f[++s]&&f[++n]===f[++s]&&f[++n]===f[++s]&&f[++n]===f[++s]&&f[++n]===f[++s]&&f[++n]===f[++s]&&f[++n]===f[++s]&&n<l);if(o=Ne-(l-n),n=l-Ne,o>i){if(e.match_start=t,i=o,o>=a)break;d=f[n+i-1],A=f[n+i]}}while((t=u[t&h])>c&&--r!==0);return i<=e.lookahead?i:e.lookahead}function fr(e){var t=e.w_size,r,n,s,o,i;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-jt)){xt.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,n=e.hash_size,r=n;do s=e.head[--r],e.head[r]=s>=t?s-t:0;while(--n);n=t,r=n;do s=e.prev[--r],e.prev[r]=s>=t?s-t:0;while(--n);o+=t}if(e.strm.avail_in===0)break;if(n=kE(e.strm,e.window,e.strstart+e.lookahead,o),e.lookahead+=n,e.lookahead+e.insert>=k)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=(e.ins_h<<e.hash_shift^e.window[i+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[i+k-1])&e.hash_mask,e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<k)););}while(e.lookahead<jt&&e.strm.avail_in!==0)}function zE(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(fr(e),e.lookahead===0&&t===hr)return it;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((e.strstart===0||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,lt(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-jt&&(lt(e,!1),e.strm.avail_out===0))return it}return e.insert=0,t===Ue?(lt(e,!0),e.strm.avail_out===0?cr:hn):(e.strstart>e.block_start&&(lt(e,!1),e.strm.avail_out===0),it)}function Ec(e,t){for(var r,n;;){if(e.lookahead<jt){if(fr(e),e.lookahead<jt&&t===hr)return it;if(e.lookahead===0)break}if(r=0,e.lookahead>=k&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+k-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-jt&&(e.match_length=R0(e,r)),e.match_length>=k)if(n=Nt._tr_tally(e,e.strstart-e.match_start,e.match_length-k),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=k){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+k-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=Nt._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(lt(e,!1),e.strm.avail_out===0))return it}return e.insert=e.strstart<k-1?e.strstart:k-1,t===Ue?(lt(e,!0),e.strm.avail_out===0?cr:hn):e.last_lit&&(lt(e,!1),e.strm.avail_out===0)?it:ns}function cn(e,t){for(var r,n,s;;){if(e.lookahead<jt){if(fr(e),e.lookahead<jt&&t===hr)return it;if(e.lookahead===0)break}if(r=0,e.lookahead>=k&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+k-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=k-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-jt&&(e.match_length=R0(e,r),e.match_length<=5&&(e.strategy===ME||e.match_length===k&&e.strstart-e.match_start>4096)&&(e.match_length=k-1)),e.prev_length>=k&&e.match_length<=e.prev_length){s=e.strstart+e.lookahead-k,n=Nt._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-k),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=s&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+k-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=k-1,e.strstart++,n&&(lt(e,!1),e.strm.avail_out===0))return it}else if(e.match_available){if(n=Nt._tr_tally(e,0,e.window[e.strstart-1]),n&&lt(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return it}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=Nt._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<k-1?e.strstart:k-1,t===Ue?(lt(e,!0),e.strm.avail_out===0?cr:hn):e.last_lit&&(lt(e,!1),e.strm.avail_out===0)?it:ns}function JE(e,t){for(var r,n,s,o,i=e.window;;){if(e.lookahead<=Ne){if(fr(e),e.lookahead<=Ne&&t===hr)return it;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=k&&e.strstart>0&&(s=e.strstart-1,n=i[s],n===i[++s]&&n===i[++s]&&n===i[++s])){o=e.strstart+Ne;do;while(n===i[++s]&&n===i[++s]&&n===i[++s]&&n===i[++s]&&n===i[++s]&&n===i[++s]&&n===i[++s]&&n===i[++s]&&s<o);e.match_length=Ne-(o-s),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=k?(r=Nt._tr_tally(e,1,e.match_length-k),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=Nt._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(lt(e,!1),e.strm.avail_out===0))return it}return e.insert=0,t===Ue?(lt(e,!0),e.strm.avail_out===0?cr:hn):e.last_lit&&(lt(e,!1),e.strm.avail_out===0)?it:ns}function QE(e,t){for(var r;;){if(e.lookahead===0&&(fr(e),e.lookahead===0)){if(t===hr)return it;break}if(e.match_length=0,r=Nt._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(lt(e,!1),e.strm.avail_out===0))return it}return e.insert=0,t===Ue?(lt(e,!0),e.strm.avail_out===0?cr:hn):e.last_lit&&(lt(e,!1),e.strm.avail_out===0)?it:ns}function oe(e,t,r,n,s){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=s}var fn;fn=[new oe(0,0,0,0,zE),new oe(4,4,8,4,Ec),new oe(4,5,16,8,Ec),new oe(4,6,32,32,Ec),new oe(4,4,16,16,cn),new oe(8,16,32,32,cn),new oe(8,16,128,128,cn),new oe(8,32,128,256,cn),new oe(32,128,258,1024,cn),new oe(32,258,258,4096,cn)];function VE(e){e.window_size=2*e.w_size,ve(e.head),e.max_lazy_match=fn[e.level].max_lazy,e.good_match=fn[e.level].good_length,e.nice_match=fn[e.level].nice_length,e.max_chain_length=fn[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=k-1,e.match_available=0,e.ins_h=0}function jE(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Oo,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new xt.Buf16(GE*2),this.dyn_dtree=new xt.Buf16((2*vE+1)*2),this.bl_tree=new xt.Buf16((2*NE+1)*2),ve(this.dyn_ltree),ve(this.dyn_dtree),ve(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new xt.Buf16(UE+1),this.heap=new xt.Buf16(2*_c+1),ve(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new xt.Buf16(2*_c+1),ve(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function F0(e){var t;return!e||!e.state?Ge(e,Gt):(e.total_in=e.total_out=0,e.data_type=SE,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?vo:ar,e.adler=t.wrap===2?0:1,t.last_flush=hr,Nt._tr_init(t),ie)}function D0(e){var t=F0(e);return t===ie&&VE(e.state),t}function KE(e,t){return!e||!e.state||e.state.wrap!==2?Gt:(e.state.gzhead=t,ie)}function L0(e,t,r,n,s,o){if(!e)return Gt;var i=1;if(t===CE&&(t=6),n<0?(i=0,n=-n):n>15&&(i=2,n-=16),s<1||s>RE||r!==Oo||n<8||n>15||t<0||t>9||o<0||o>wE)return Ge(e,Gt);n===8&&(n=9);var a=new jE;return e.state=a,a.strm=e,a.wrap=i,a.gzhead=null,a.w_bits=n,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=s+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+k-1)/k),a.window=new xt.Buf8(a.w_size*2),a.head=new xt.Buf16(a.hash_size),a.prev=new xt.Buf16(a.w_size),a.lit_bufsize=1<<s+6,a.pending_buf_size=a.lit_bufsize*4,a.pending_buf=new xt.Buf8(a.pending_buf_size),a.d_buf=1*a.lit_bufsize,a.l_buf=(1+2)*a.lit_bufsize,a.level=t,a.strategy=o,a.method=r,D0(e)}function XE(e,t){return L0(e,t,Oo,FE,DE,IE)}function YE(e,t){var r,n,s,o;if(!e||!e.state||t>b0||t<0)return e?Ge(e,Gt):Gt;if(n=e.state,!e.output||!e.input&&e.avail_in!==0||n.status===rs&&t!==Ue)return Ge(e,e.avail_out===0?Bc:Gt);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===vo)if(n.wrap===2)e.adler=0,V(n,31),V(n,139),V(n,8),n.gzhead?(V(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),V(n,n.gzhead.time&255),V(n,n.gzhead.time>>8&255),V(n,n.gzhead.time>>16&255),V(n,n.gzhead.time>>24&255),V(n,n.level===9?2:n.strategy>=Ro||n.level<2?4:0),V(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(V(n,n.gzhead.extra.length&255),V(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Le(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=yc):(V(n,0),V(n,0),V(n,0),V(n,0),V(n,0),V(n,n.level===9?2:n.strategy>=Ro||n.level<2?4:0),V(n,HE),n.status=ar);else{var i=Oo+(n.w_bits-8<<4)<<8,a=-1;n.strategy>=Ro||n.level<2?a=0:n.level<6?a=1:n.level===6?a=2:a=3,i|=a<<6,n.strstart!==0&&(i|=PE),i+=31-i%31,n.status=ar,es(n,i),n.strstart!==0&&(es(n,e.adler>>>16),es(n,e.adler&65535)),e.adler=1}if(n.status===yc)if(n.gzhead.extra){for(s=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>s&&(e.adler=Le(e.adler,n.pending_buf,n.pending-s,s)),Oe(e),s=n.pending,n.pending===n.pending_buf_size));)V(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>s&&(e.adler=Le(e.adler,n.pending_buf,n.pending-s,s)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=Fo)}else n.status=Fo;if(n.status===Fo)if(n.gzhead.name){s=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>s&&(e.adler=Le(e.adler,n.pending_buf,n.pending-s,s)),Oe(e),s=n.pending,n.pending===n.pending_buf_size)){o=1;break}n.gzindex<n.gzhead.name.length?o=n.gzhead.name.charCodeAt(n.gzindex++)&255:o=0,V(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>s&&(e.adler=Le(e.adler,n.pending_buf,n.pending-s,s)),o===0&&(n.gzindex=0,n.status=Do)}else n.status=Do;if(n.status===Do)if(n.gzhead.comment){s=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>s&&(e.adler=Le(e.adler,n.pending_buf,n.pending-s,s)),Oe(e),s=n.pending,n.pending===n.pending_buf_size)){o=1;break}n.gzindex<n.gzhead.comment.length?o=n.gzhead.comment.charCodeAt(n.gzindex++)&255:o=0,V(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>s&&(e.adler=Le(e.adler,n.pending_buf,n.pending-s,s)),o===0&&(n.status=Lo)}else n.status=Lo;if(n.status===Lo&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Oe(e),n.pending+2<=n.pending_buf_size&&(V(n,e.adler&255),V(n,e.adler>>8&255),e.adler=0,n.status=ar)):n.status=ar),n.pending!==0){if(Oe(e),e.avail_out===0)return n.last_flush=-1,ie}else if(e.avail_in===0&&I0(t)<=I0(r)&&t!==Ue)return Ge(e,Bc);if(n.status===rs&&e.avail_in!==0)return Ge(e,Bc);if(e.avail_in!==0||n.lookahead!==0||t!==hr&&n.status!==rs){var c=n.strategy===Ro?QE(n,t):n.strategy===bE?JE(n,t):fn[n.level].func(n,t);if((c===cr||c===hn)&&(n.status=rs),c===it||c===cr)return e.avail_out===0&&(n.last_flush=-1),ie;if(c===ns&&(t===_E?Nt._tr_align(n):t!==b0&&(Nt._tr_stored_block(n,0,0,!1),t===yE&&(ve(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Oe(e),e.avail_out===0))return n.last_flush=-1,ie}return t!==Ue?ie:n.wrap<=0?w0:(n.wrap===2?(V(n,e.adler&255),V(n,e.adler>>8&255),V(n,e.adler>>16&255),V(n,e.adler>>24&255),V(n,e.total_in&255),V(n,e.total_in>>8&255),V(n,e.total_in>>16&255),V(n,e.total_in>>24&255)):(es(n,e.adler>>>16),es(n,e.adler&65535)),Oe(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?ie:w0)}function ZE(e){var t;return!e||!e.state?Gt:(t=e.state.status,t!==vo&&t!==yc&&t!==Fo&&t!==Do&&t!==Lo&&t!==ar&&t!==rs?Ge(e,Gt):(e.state=null,t===ar?Ge(e,TE):ie))}function qE(e,t){var r=t.length,n,s,o,i,a,c,f,h;if(!e||!e.state||(n=e.state,i=n.wrap,i===2||i===1&&n.status!==vo||n.lookahead))return Gt;for(i===1&&(e.adler=S0(e.adler,t,r,0)),n.wrap=0,r>=n.w_size&&(i===0&&(ve(n.head),n.strstart=0,n.block_start=0,n.insert=0),h=new xt.Buf8(n.w_size),xt.arraySet(h,t,r-n.w_size,n.w_size,0),t=h,r=n.w_size),a=e.avail_in,c=e.next_in,f=e.input,e.avail_in=r,e.next_in=0,e.input=t,fr(n);n.lookahead>=k;){s=n.strstart,o=n.lookahead-(k-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[s+k-1])&n.hash_mask,n.prev[s&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=s,s++;while(--o);n.strstart=s,n.lookahead=k-1,fr(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=k-1,n.match_available=0,e.next_in=c,e.input=f,e.avail_in=a,n.wrap=i,ie}ae.deflateInit=XE;ae.deflateInit2=L0;ae.deflateReset=D0;ae.deflateResetKeep=F0;ae.deflateSetHeader=KE;ae.deflate=YE;ae.deflateEnd=ZE;ae.deflateSetDictionary=qE;ae.deflateInfo="pako deflate (from Nodeca project)"});var Tc=ct(ln=>{"use strict";var No=xe(),v0=!0,N0=!0;try{String.fromCharCode.apply(null,[0])}catch{v0=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{N0=!1}var ss=new No.Buf8(256);for(Ee=0;Ee<256;Ee++)ss[Ee]=Ee>=252?6:Ee>=248?5:Ee>=240?4:Ee>=224?3:Ee>=192?2:1;var Ee;ss[254]=ss[254]=1;ln.string2buf=function(e){var t,r,n,s,o,i=e.length,a=0;for(s=0;s<i;s++)r=e.charCodeAt(s),(r&64512)===55296&&s+1<i&&(n=e.charCodeAt(s+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),s++)),a+=r<128?1:r<2048?2:r<65536?3:4;for(t=new No.Buf8(a),o=0,s=0;o<a;s++)r=e.charCodeAt(s),(r&64512)===55296&&s+1<i&&(n=e.charCodeAt(s+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),s++)),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|r&63):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|r&63):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|r&63);return t};function G0(e,t){if(t<65534&&(e.subarray&&N0||!e.subarray&&v0))return String.fromCharCode.apply(null,No.shrinkBuf(e,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}ln.buf2binstring=function(e){return G0(e,e.length)};ln.binstring2buf=function(e){for(var t=new No.Buf8(e.length),r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t};ln.buf2string=function(e,t){var r,n,s,o,i=t||e.length,a=new Array(i*2);for(n=0,r=0;r<i;){if(s=e[r++],s<128){a[n++]=s;continue}if(o=ss[s],o>4){a[n++]=65533,r+=o-1;continue}for(s&=o===2?31:o===3?15:7;o>1&&r<i;)s=s<<6|e[r++]&63,o--;if(o>1){a[n++]=65533;continue}s<65536?a[n++]=s:(s-=65536,a[n++]=55296|s>>10&1023,a[n++]=56320|s&1023)}return G0(a,n)};ln.utf8border=function(e,t){var r;for(t=t||e.length,t>e.length&&(t=e.length),r=t-1;r>=0&&(e[r]&192)===128;)r--;return r<0||r===0?t:r+ss[e[r]]>t?r:t}});var Cc=ct((_L,U0)=>{"use strict";function WE(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}U0.exports=WE});var z0=ct(as=>{"use strict";var os=O0(),is=xe(),bc=Tc(),wc=So(),$E=Cc(),k0=Object.prototype.toString,t_=0,Mc=4,un=0,P0=1,H0=2,e_=-1,r_=0,n_=8;function lr(e){if(!(this instanceof lr))return new lr(e);this.options=is.assign({level:e_,method:n_,chunkSize:16384,windowBits:15,memLevel:8,strategy:r_,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new $E,this.strm.avail_out=0;var r=os.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==un)throw new Error(wc[r]);if(t.header&&os.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(typeof t.dictionary=="string"?n=bc.string2buf(t.dictionary):k0.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,r=os.deflateSetDictionary(this.strm,n),r!==un)throw new Error(wc[r]);this._dict_set=!0}}lr.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,s,o;if(this.ended)return!1;o=t===~~t?t:t===!0?Mc:t_,typeof e=="string"?r.input=bc.string2buf(e):k0.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new is.Buf8(n),r.next_out=0,r.avail_out=n),s=os.deflate(r,o),s!==P0&&s!==un)return this.onEnd(s),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(o===Mc||o===H0))&&(this.options.to==="string"?this.onData(bc.buf2binstring(is.shrinkBuf(r.output,r.next_out))):this.onData(is.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&s!==P0);return o===Mc?(s=os.deflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===un):(o===H0&&(this.onEnd(un),r.avail_out=0),!0)};lr.prototype.onData=function(e){this.chunks.push(e)};lr.prototype.onEnd=function(e){e===un&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=is.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Ic(e,t){var r=new lr(t);if(r.push(e,!0),r.err)throw r.msg||wc[r.err];return r.result}function s_(e,t){return t=t||{},t.raw=!0,Ic(e,t)}function o_(e,t){return t=t||{},t.gzip=!0,Ic(e,t)}as.Deflate=lr;as.deflate=Ic;as.deflateRaw=s_;as.gzip=o_});var Q0=ct((TL,J0)=>{"use strict";var Go=30,i_=12;J0.exports=function(t,r){var n,s,o,i,a,c,f,h,u,l,d,A,m,p,E,y,C,M,T,I,w,L,x,g,B;n=t.state,s=t.next_in,g=t.input,o=s+(t.avail_in-5),i=t.next_out,B=t.output,a=i-(r-t.avail_out),c=i+(t.avail_out-257),f=n.dmax,h=n.wsize,u=n.whave,l=n.wnext,d=n.window,A=n.hold,m=n.bits,p=n.lencode,E=n.distcode,y=(1<<n.lenbits)-1,C=(1<<n.distbits)-1;t:do{m<15&&(A+=g[s++]<<m,m+=8,A+=g[s++]<<m,m+=8),M=p[A&y];e:for(;;){if(T=M>>>24,A>>>=T,m-=T,T=M>>>16&255,T===0)B[i++]=M&65535;else if(T&16){I=M&65535,T&=15,T&&(m<T&&(A+=g[s++]<<m,m+=8),I+=A&(1<<T)-1,A>>>=T,m-=T),m<15&&(A+=g[s++]<<m,m+=8,A+=g[s++]<<m,m+=8),M=E[A&C];r:for(;;){if(T=M>>>24,A>>>=T,m-=T,T=M>>>16&255,T&16){if(w=M&65535,T&=15,m<T&&(A+=g[s++]<<m,m+=8,m<T&&(A+=g[s++]<<m,m+=8)),w+=A&(1<<T)-1,w>f){t.msg="invalid distance too far back",n.mode=Go;break t}if(A>>>=T,m-=T,T=i-a,w>T){if(T=w-T,T>u&&n.sane){t.msg="invalid distance too far back",n.mode=Go;break t}if(L=0,x=d,l===0){if(L+=h-T,T<I){I-=T;do B[i++]=d[L++];while(--T);L=i-w,x=B}}else if(l<T){if(L+=h+l-T,T-=l,T<I){I-=T;do B[i++]=d[L++];while(--T);if(L=0,l<I){T=l,I-=T;do B[i++]=d[L++];while(--T);L=i-w,x=B}}}else if(L+=l-T,T<I){I-=T;do B[i++]=d[L++];while(--T);L=i-w,x=B}for(;I>2;)B[i++]=x[L++],B[i++]=x[L++],B[i++]=x[L++],I-=3;I&&(B[i++]=x[L++],I>1&&(B[i++]=x[L++]))}else{L=i-w;do B[i++]=B[L++],B[i++]=B[L++],B[i++]=B[L++],I-=3;while(I>2);I&&(B[i++]=B[L++],I>1&&(B[i++]=B[L++]))}}else if(T&64){t.msg="invalid distance code",n.mode=Go;break t}else{M=E[(M&65535)+(A&(1<<T)-1)];continue r}break}}else if(T&64)if(T&32){n.mode=i_;break t}else{t.msg="invalid literal/length code",n.mode=Go;break t}else{M=p[(M&65535)+(A&(1<<T)-1)];continue e}break}}while(s<o&&i<c);I=m>>3,s-=I,m-=I<<3,A&=(1<<m)-1,t.next_in=s,t.next_out=i,t.avail_in=s<o?5+(o-s):5-(s-o),t.avail_out=i<c?257+(c-i):257-(i-c),n.hold=A,n.bits=m}});var q0=ct((CL,Z0)=>{"use strict";var V0=xe(),dn=15,j0=852,K0=592,X0=0,Sc=1,Y0=2,a_=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],c_=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],f_=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],h_=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];Z0.exports=function(t,r,n,s,o,i,a,c){var f=c.bits,h=0,u=0,l=0,d=0,A=0,m=0,p=0,E=0,y=0,C=0,M,T,I,w,L,x=null,g=0,B,_=new V0.Buf16(dn+1),U=new V0.Buf16(dn+1),G=null,P=0,v,at,mt;for(h=0;h<=dn;h++)_[h]=0;for(u=0;u<s;u++)_[r[n+u]]++;for(A=f,d=dn;d>=1&&_[d]===0;d--);if(A>d&&(A=d),d===0)return o[i++]=1<<24|64<<16|0,o[i++]=1<<24|64<<16|0,c.bits=1,0;for(l=1;l<d&&_[l]===0;l++);for(A<l&&(A=l),E=1,h=1;h<=dn;h++)if(E<<=1,E-=_[h],E<0)return-1;if(E>0&&(t===X0||d!==1))return-1;for(U[1]=0,h=1;h<dn;h++)U[h+1]=U[h]+_[h];for(u=0;u<s;u++)r[n+u]!==0&&(a[U[r[n+u]]++]=u);if(t===X0?(x=G=a,B=19):t===Sc?(x=a_,g-=257,G=c_,P-=257,B=256):(x=f_,G=h_,B=-1),C=0,u=0,h=l,L=i,m=A,p=0,I=-1,y=1<<A,w=y-1,t===Sc&&y>j0||t===Y0&&y>K0)return 1;for(;;){v=h-p,a[u]<B?(at=0,mt=a[u]):a[u]>B?(at=G[P+a[u]],mt=x[g+a[u]]):(at=32+64,mt=0),M=1<<h-p,T=1<<m,l=T;do T-=M,o[L+(C>>p)+T]=v<<24|at<<16|mt|0;while(T!==0);for(M=1<<h-1;C&M;)M>>=1;if(M!==0?(C&=M-1,C+=M):C=0,u++,--_[h]===0){if(h===d)break;h=r[n+a[u]]}if(h>A&&(C&w)!==I){for(p===0&&(p=A),L+=l,m=h-p,E=1<<m;m+p<d&&(E-=_[m+p],!(E<=0));)m++,E<<=1;if(y+=1<<m,t===Sc&&y>j0||t===Y0&&y>K0)return 1;I=C&w,o[I]=A<<24|m<<16|L-i|0}}return C!==0&&(o[L+C]=h-p<<24|64<<16|0),c.bits=A,0}});var Dd=ct(Kt=>{"use strict";var St=xe(),vc=gc(),ce=xc(),l_=Q0(),cs=q0(),u_=0,Td=1,Cd=2,W0=4,d_=5,Uo=6,ur=0,A_=1,m_=2,Ut=-2,Md=-3,Nc=-4,p_=-5,$0=8,bd=1,td=2,ed=3,rd=4,nd=5,sd=6,od=7,id=8,ad=9,cd=10,ko=11,_e=12,Rc=13,fd=14,Fc=15,hd=16,ld=17,ud=18,dd=19,Po=20,Ho=21,Ad=22,md=23,pd=24,gd=25,xd=26,Dc=27,Bd=28,Ed=29,$=30,Gc=31,g_=32,x_=852,B_=592,E_=15,__=E_;function _d(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function y_(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new St.Buf16(320),this.work=new St.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function wd(e){var t;return!e||!e.state?Ut:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=bd,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new St.Buf32(x_),t.distcode=t.distdyn=new St.Buf32(B_),t.sane=1,t.back=-1,ur)}function Id(e){var t;return!e||!e.state?Ut:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,wd(e))}function Sd(e,t){var r,n;return!e||!e.state||(n=e.state,t<0?(r=0,t=-t):(r=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?Ut:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,Id(e))}function Rd(e,t){var r,n;return e?(n=new y_,e.state=n,n.window=null,r=Sd(e,t),r!==ur&&(e.state=null),r):Ut}function T_(e){return Rd(e,__)}var yd=!0,Lc,Oc;function C_(e){if(yd){var t;for(Lc=new St.Buf32(512),Oc=new St.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(cs(Td,e.lens,0,288,Lc,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;cs(Cd,e.lens,0,32,Oc,0,e.work,{bits:5}),yd=!1}e.lencode=Lc,e.lenbits=9,e.distcode=Oc,e.distbits=5}function Fd(e,t,r,n){var s,o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new St.Buf8(o.wsize)),n>=o.wsize?(St.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(s=o.wsize-o.wnext,s>n&&(s=n),St.arraySet(o.window,t,r-n,s,o.wnext),n-=s,n?(St.arraySet(o.window,t,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=s,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=s))),0}function M_(e,t){var r,n,s,o,i,a,c,f,h,u,l,d,A,m,p=0,E,y,C,M,T,I,w,L,x=new St.Buf8(4),g,B,_=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return Ut;r=e.state,r.mode===_e&&(r.mode=Rc),i=e.next_out,s=e.output,c=e.avail_out,o=e.next_in,n=e.input,a=e.avail_in,f=r.hold,h=r.bits,u=a,l=c,L=ur;t:for(;;)switch(r.mode){case bd:if(r.wrap===0){r.mode=Rc;break}for(;h<16;){if(a===0)break t;a--,f+=n[o++]<<h,h+=8}if(r.wrap&2&&f===35615){r.check=0,x[0]=f&255,x[1]=f>>>8&255,r.check=ce(r.check,x,2,0),f=0,h=0,r.mode=td;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((f&255)<<8)+(f>>8))%31){e.msg="incorrect header check",r.mode=$;break}if((f&15)!==$0){e.msg="unknown compression method",r.mode=$;break}if(f>>>=4,h-=4,w=(f&15)+8,r.wbits===0)r.wbits=w;else if(w>r.wbits){e.msg="invalid window size",r.mode=$;break}r.dmax=1<<w,e.adler=r.check=1,r.mode=f&512?cd:_e,f=0,h=0;break;case td:for(;h<16;){if(a===0)break t;a--,f+=n[o++]<<h,h+=8}if(r.flags=f,(r.flags&255)!==$0){e.msg="unknown compression method",r.mode=$;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=$;break}r.head&&(r.head.text=f>>8&1),r.flags&512&&(x[0]=f&255,x[1]=f>>>8&255,r.check=ce(r.check,x,2,0)),f=0,h=0,r.mode=ed;case ed:for(;h<32;){if(a===0)break t;a--,f+=n[o++]<<h,h+=8}r.head&&(r.head.time=f),r.flags&512&&(x[0]=f&255,x[1]=f>>>8&255,x[2]=f>>>16&255,x[3]=f>>>24&255,r.check=ce(r.check,x,4,0)),f=0,h=0,r.mode=rd;case rd:for(;h<16;){if(a===0)break t;a--,f+=n[o++]<<h,h+=8}r.head&&(r.head.xflags=f&255,r.head.os=f>>8),r.flags&512&&(x[0]=f&255,x[1]=f>>>8&255,r.check=ce(r.check,x,2,0)),f=0,h=0,r.mode=nd;case nd:if(r.flags&1024){for(;h<16;){if(a===0)break t;a--,f+=n[o++]<<h,h+=8}r.length=f,r.head&&(r.head.extra_len=f),r.flags&512&&(x[0]=f&255,x[1]=f>>>8&255,r.check=ce(r.check,x,2,0)),f=0,h=0}else r.head&&(r.head.extra=null);r.mode=sd;case sd:if(r.flags&1024&&(d=r.length,d>a&&(d=a),d&&(r.head&&(w=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),St.arraySet(r.head.extra,n,o,d,w)),r.flags&512&&(r.check=ce(r.check,n,d,o)),a-=d,o+=d,r.length-=d),r.length))break t;r.length=0,r.mode=od;case od:if(r.flags&2048){if(a===0)break t;d=0;do w=n[o+d++],r.head&&w&&r.length<65536&&(r.head.name+=String.fromCharCode(w));while(w&&d<a);if(r.flags&512&&(r.check=ce(r.check,n,d,o)),a-=d,o+=d,w)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=id;case id:if(r.flags&4096){if(a===0)break t;d=0;do w=n[o+d++],r.head&&w&&r.length<65536&&(r.head.comment+=String.fromCharCode(w));while(w&&d<a);if(r.flags&512&&(r.check=ce(r.check,n,d,o)),a-=d,o+=d,w)break t}else r.head&&(r.head.comment=null);r.mode=ad;case ad:if(r.flags&512){for(;h<16;){if(a===0)break t;a--,f+=n[o++]<<h,h+=8}if(f!==(r.check&65535)){e.msg="header crc mismatch",r.mode=$;break}f=0,h=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=_e;break;case cd:for(;h<32;){if(a===0)break t;a--,f+=n[o++]<<h,h+=8}e.adler=r.check=_d(f),f=0,h=0,r.mode=ko;case ko:if(r.havedict===0)return e.next_out=i,e.avail_out=c,e.next_in=o,e.avail_in=a,r.hold=f,r.bits=h,m_;e.adler=r.check=1,r.mode=_e;case _e:if(t===d_||t===Uo)break t;case Rc:if(r.last){f>>>=h&7,h-=h&7,r.mode=Dc;break}for(;h<3;){if(a===0)break t;a--,f+=n[o++]<<h,h+=8}switch(r.last=f&1,f>>>=1,h-=1,f&3){case 0:r.mode=fd;break;case 1:if(C_(r),r.mode=Po,t===Uo){f>>>=2,h-=2;break t}break;case 2:r.mode=ld;break;case 3:e.msg="invalid block type",r.mode=$}f>>>=2,h-=2;break;case fd:for(f>>>=h&7,h-=h&7;h<32;){if(a===0)break t;a--,f+=n[o++]<<h,h+=8}if((f&65535)!==(f>>>16^65535)){e.msg="invalid stored block lengths",r.mode=$;break}if(r.length=f&65535,f=0,h=0,r.mode=Fc,t===Uo)break t;case Fc:r.mode=hd;case hd:if(d=r.length,d){if(d>a&&(d=a),d>c&&(d=c),d===0)break t;St.arraySet(s,n,o,d,i),a-=d,o+=d,c-=d,i+=d,r.length-=d;break}r.mode=_e;break;case ld:for(;h<14;){if(a===0)break t;a--,f+=n[o++]<<h,h+=8}if(r.nlen=(f&31)+257,f>>>=5,h-=5,r.ndist=(f&31)+1,f>>>=5,h-=5,r.ncode=(f&15)+4,f>>>=4,h-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=$;break}r.have=0,r.mode=ud;case ud:for(;r.have<r.ncode;){for(;h<3;){if(a===0)break t;a--,f+=n[o++]<<h,h+=8}r.lens[_[r.have++]]=f&7,f>>>=3,h-=3}for(;r.have<19;)r.lens[_[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,g={bits:r.lenbits},L=cs(u_,r.lens,0,19,r.lencode,0,r.work,g),r.lenbits=g.bits,L){e.msg="invalid code lengths set",r.mode=$;break}r.have=0,r.mode=dd;case dd:for(;r.have<r.nlen+r.ndist;){for(;p=r.lencode[f&(1<<r.lenbits)-1],E=p>>>24,y=p>>>16&255,C=p&65535,!(E<=h);){if(a===0)break t;a--,f+=n[o++]<<h,h+=8}if(C<16)f>>>=E,h-=E,r.lens[r.have++]=C;else{if(C===16){for(B=E+2;h<B;){if(a===0)break t;a--,f+=n[o++]<<h,h+=8}if(f>>>=E,h-=E,r.have===0){e.msg="invalid bit length repeat",r.mode=$;break}w=r.lens[r.have-1],d=3+(f&3),f>>>=2,h-=2}else if(C===17){for(B=E+3;h<B;){if(a===0)break t;a--,f+=n[o++]<<h,h+=8}f>>>=E,h-=E,w=0,d=3+(f&7),f>>>=3,h-=3}else{for(B=E+7;h<B;){if(a===0)break t;a--,f+=n[o++]<<h,h+=8}f>>>=E,h-=E,w=0,d=11+(f&127),f>>>=7,h-=7}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=$;break}for(;d--;)r.lens[r.have++]=w}}if(r.mode===$)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=$;break}if(r.lenbits=9,g={bits:r.lenbits},L=cs(Td,r.lens,0,r.nlen,r.lencode,0,r.work,g),r.lenbits=g.bits,L){e.msg="invalid literal/lengths set",r.mode=$;break}if(r.distbits=6,r.distcode=r.distdyn,g={bits:r.distbits},L=cs(Cd,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,g),r.distbits=g.bits,L){e.msg="invalid distances set",r.mode=$;break}if(r.mode=Po,t===Uo)break t;case Po:r.mode=Ho;case Ho:if(a>=6&&c>=258){e.next_out=i,e.avail_out=c,e.next_in=o,e.avail_in=a,r.hold=f,r.bits=h,l_(e,l),i=e.next_out,s=e.output,c=e.avail_out,o=e.next_in,n=e.input,a=e.avail_in,f=r.hold,h=r.bits,r.mode===_e&&(r.back=-1);break}for(r.back=0;p=r.lencode[f&(1<<r.lenbits)-1],E=p>>>24,y=p>>>16&255,C=p&65535,!(E<=h);){if(a===0)break t;a--,f+=n[o++]<<h,h+=8}if(y&&!(y&240)){for(M=E,T=y,I=C;p=r.lencode[I+((f&(1<<M+T)-1)>>M)],E=p>>>24,y=p>>>16&255,C=p&65535,!(M+E<=h);){if(a===0)break t;a--,f+=n[o++]<<h,h+=8}f>>>=M,h-=M,r.back+=M}if(f>>>=E,h-=E,r.back+=E,r.length=C,y===0){r.mode=xd;break}if(y&32){r.back=-1,r.mode=_e;break}if(y&64){e.msg="invalid literal/length code",r.mode=$;break}r.extra=y&15,r.mode=Ad;case Ad:if(r.extra){for(B=r.extra;h<B;){if(a===0)break t;a--,f+=n[o++]<<h,h+=8}r.length+=f&(1<<r.extra)-1,f>>>=r.extra,h-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=md;case md:for(;p=r.distcode[f&(1<<r.distbits)-1],E=p>>>24,y=p>>>16&255,C=p&65535,!(E<=h);){if(a===0)break t;a--,f+=n[o++]<<h,h+=8}if(!(y&240)){for(M=E,T=y,I=C;p=r.distcode[I+((f&(1<<M+T)-1)>>M)],E=p>>>24,y=p>>>16&255,C=p&65535,!(M+E<=h);){if(a===0)break t;a--,f+=n[o++]<<h,h+=8}f>>>=M,h-=M,r.back+=M}if(f>>>=E,h-=E,r.back+=E,y&64){e.msg="invalid distance code",r.mode=$;break}r.offset=C,r.extra=y&15,r.mode=pd;case pd:if(r.extra){for(B=r.extra;h<B;){if(a===0)break t;a--,f+=n[o++]<<h,h+=8}r.offset+=f&(1<<r.extra)-1,f>>>=r.extra,h-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=$;break}r.mode=gd;case gd:if(c===0)break t;if(d=l-c,r.offset>d){if(d=r.offset-d,d>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=$;break}d>r.wnext?(d-=r.wnext,A=r.wsize-d):A=r.wnext-d,d>r.length&&(d=r.length),m=r.window}else m=s,A=i-r.offset,d=r.length;d>c&&(d=c),c-=d,r.length-=d;do s[i++]=m[A++];while(--d);r.length===0&&(r.mode=Ho);break;case xd:if(c===0)break t;s[i++]=r.length,c--,r.mode=Ho;break;case Dc:if(r.wrap){for(;h<32;){if(a===0)break t;a--,f|=n[o++]<<h,h+=8}if(l-=c,e.total_out+=l,r.total+=l,l&&(e.adler=r.check=r.flags?ce(r.check,s,l,i-l):vc(r.check,s,l,i-l)),l=c,(r.flags?f:_d(f))!==r.check){e.msg="incorrect data check",r.mode=$;break}f=0,h=0}r.mode=Bd;case Bd:if(r.wrap&&r.flags){for(;h<32;){if(a===0)break t;a--,f+=n[o++]<<h,h+=8}if(f!==(r.total&4294967295)){e.msg="incorrect length check",r.mode=$;break}f=0,h=0}r.mode=Ed;case Ed:L=A_;break t;case $:L=Md;break t;case Gc:return Nc;case g_:default:return Ut}return e.next_out=i,e.avail_out=c,e.next_in=o,e.avail_in=a,r.hold=f,r.bits=h,(r.wsize||l!==e.avail_out&&r.mode<$&&(r.mode<Dc||t!==W0))&&Fd(e,e.output,e.next_out,l-e.avail_out)?(r.mode=Gc,Nc):(u-=e.avail_in,l-=e.avail_out,e.total_in+=u,e.total_out+=l,r.total+=l,r.wrap&&l&&(e.adler=r.check=r.flags?ce(r.check,s,l,e.next_out-l):vc(r.check,s,l,e.next_out-l)),e.data_type=r.bits+(r.last?64:0)+(r.mode===_e?128:0)+(r.mode===Po||r.mode===Fc?256:0),(u===0&&l===0||t===W0)&&L===ur&&(L=p_),L)}function b_(e){if(!e||!e.state)return Ut;var t=e.state;return t.window&&(t.window=null),e.state=null,ur}function w_(e,t){var r;return!e||!e.state||(r=e.state,!(r.wrap&2))?Ut:(r.head=t,t.done=!1,ur)}function I_(e,t){var r=t.length,n,s,o;return!e||!e.state||(n=e.state,n.wrap!==0&&n.mode!==ko)?Ut:n.mode===ko&&(s=1,s=vc(s,t,r,0),s!==n.check)?Md:(o=Fd(e,t,r,r),o?(n.mode=Gc,Nc):(n.havedict=1,ur))}Kt.inflateReset=Id;Kt.inflateReset2=Sd;Kt.inflateResetKeep=wd;Kt.inflateInit=T_;Kt.inflateInit2=Rd;Kt.inflate=M_;Kt.inflateEnd=b_;Kt.inflateGetHeader=w_;Kt.inflateSetDictionary=I_;Kt.inflateInfo="pako inflate (from Nodeca project)"});var Uc=ct((bL,Ld)=>{"use strict";Ld.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var vd=ct((wL,Od)=>{"use strict";function S_(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}Od.exports=S_});var Gd=ct(hs=>{"use strict";var An=Dd(),fs=xe(),zo=Tc(),st=Uc(),Pc=So(),R_=Cc(),F_=vd(),Nd=Object.prototype.toString;function dr(e){if(!(this instanceof dr))return new dr(e);this.options=fs.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new R_,this.strm.avail_out=0;var r=An.inflateInit2(this.strm,t.windowBits);if(r!==st.Z_OK)throw new Error(Pc[r]);if(this.header=new F_,An.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=zo.string2buf(t.dictionary):Nd.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=An.inflateSetDictionary(this.strm,t.dictionary),r!==st.Z_OK)))throw new Error(Pc[r])}dr.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,s=this.options.dictionary,o,i,a,c,f,h=!1;if(this.ended)return!1;i=t===~~t?t:t===!0?st.Z_FINISH:st.Z_NO_FLUSH,typeof e=="string"?r.input=zo.binstring2buf(e):Nd.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new fs.Buf8(n),r.next_out=0,r.avail_out=n),o=An.inflate(r,st.Z_NO_FLUSH),o===st.Z_NEED_DICT&&s&&(o=An.inflateSetDictionary(this.strm,s)),o===st.Z_BUF_ERROR&&h===!0&&(o=st.Z_OK,h=!1),o!==st.Z_STREAM_END&&o!==st.Z_OK)return this.onEnd(o),this.ended=!0,!1;r.next_out&&(r.avail_out===0||o===st.Z_STREAM_END||r.avail_in===0&&(i===st.Z_FINISH||i===st.Z_SYNC_FLUSH))&&(this.options.to==="string"?(a=zo.utf8border(r.output,r.next_out),c=r.next_out-a,f=zo.buf2string(r.output,a),r.next_out=c,r.avail_out=n-c,c&&fs.arraySet(r.output,r.output,a,c,0),this.onData(f)):this.onData(fs.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(h=!0)}while((r.avail_in>0||r.avail_out===0)&&o!==st.Z_STREAM_END);return o===st.Z_STREAM_END&&(i=st.Z_FINISH),i===st.Z_FINISH?(o=An.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===st.Z_OK):(i===st.Z_SYNC_FLUSH&&(this.onEnd(st.Z_OK),r.avail_out=0),!0)};dr.prototype.onData=function(e){this.chunks.push(e)};dr.prototype.onEnd=function(e){e===st.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=fs.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Hc(e,t){var r=new dr(t);if(r.push(e,!0),r.err)throw r.msg||Pc[r.err];return r.result}function D_(e,t){return t=t||{},t.raw=!0,Hc(e,t)}hs.Inflate=dr;hs.inflate=Hc;hs.inflateRaw=D_;hs.ungzip=Hc});var Hd=ct((SL,Pd)=>{"use strict";var L_=xe().assign,O_=z0(),v_=Gd(),N_=Uc(),Ud={};L_(Ud,O_,v_,N_);Pd.exports=Ud});var kd=ct(()=>{});var ls={};ut(ls,{CesiumIonLoader:()=>rc,TILE3D_TYPE:()=>_t,Tile3DBatchTable:()=>ue,Tile3DFeatureTable:()=>kt,Tile3DSubtreeLoader:()=>Xr,Tile3DWriter:()=>Yd,Tiles3DArchive:()=>mn,Tiles3DArchiveFileLoader:()=>Jd,Tiles3DLoader:()=>nr,_getIonTilesetMetadata:()=>To});gs(ls,xr(gn(),1));async function Pt(e,t,r,n){return n._parse(e,t,r,n)}function z(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var Yt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},n1=Yt.self||Yt.window||Yt.global||{},s1=Yt.window||Yt.self||Yt.global||{},o1=Yt.global||Yt.self||Yt.window||{},i1=Yt.document||{};var Et=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var Zc=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),a1=Zc&&parseFloat(Zc[1])||0;function xn(e){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,e)}function Vo(e){return globalThis.loaders?.modules?.[e]||null}function c1(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.3.0-alpha.1"),globalThis._loadersgl_.version}var qc=c1();function Wc(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}var Zt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},W_=Zt.self||Zt.window||Zt.global||{},$_=Zt.window||Zt.self||Zt.global||{},ty=Zt.global||Zt.self||Zt.window||{},ey=Zt.document||{};var Br=typeof process!="object"||String(process)!=="[object process]"||process.browser,xs=typeof importScripts=="function",ry=typeof window<"u"&&typeof window.orientation<"u",$c=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),ny=$c&&parseFloat($c[1])||0;var jo={};async function qt(e,t=null,r={},n=null){return t&&(e=tf(e,t,r,n)),jo[e]=jo[e]||f1(e),await jo[e]}function tf(e,t,r={},n=null){if(!r.useLocalLibraries&&e.startsWith("http"))return e;n=n||e;let s=r.modules||{};return s[n]?s[n]:Br?r.CDN?(Wc(r.CDN.startsWith("http")),`${r.CDN}/${t}@${qc}/dist/libs/${n}`):xs?`../src/libs/${n}`:`modules/${t}/src/libs/${n}`:`modules/${t}/dist/libs/${n}`}async function f1(e){if(e.endsWith("wasm"))return await l1(e);if(!Br)try{let{requireFromFile:r}=globalThis.loaders||{};return await r?.(e)}catch(r){return console.error(r),null}if(xs)return importScripts(e);let t=await u1(e);return h1(t,e)}function h1(e,t){if(!Br){let{requireFromString:n}=globalThis.loaders||{};return n?.(e,t)}if(xs)return eval.call(globalThis,e),null;let r=document.createElement("script");r.id=t;try{r.appendChild(document.createTextNode(e))}catch{r.text=e}return document.body.appendChild(r),null}async function l1(e){let{readFileAsArrayBuffer:t}=globalThis.loaders||{};return Br||!t||e.startsWith("http")?await(await fetch(e)).arrayBuffer():await t(e)}async function u1(e){let{readFileAsText:t}=globalThis.loaders||{};return Br||!t||e.startsWith("http")?await(await fetch(e)).text():await t(e)}function rf(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?ef(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?ef(e,0,t):""}function ef(e,t,r){if(e.byteLength<=t+r)return"";let n=new DataView(e),s="";for(let o=0;o<r;o++)s+=String.fromCharCode(n.getUint8(t+o));return s}function Ko(e){try{return JSON.parse(e)}catch{throw new Error(`Failed to parse JSON from data starting with "${rf(e)}"`)}}function Te(e,t,r){if(r=r||e.byteLength,e.byteLength<r||t.byteLength<r)return!1;let n=new Uint8Array(e),s=new Uint8Array(t);for(let o=0;o<n.length;++o)if(n[o]!==s[o])return!1;return!0}function Er(...e){return nf(e)}function nf(e){let t=e.map(o=>o instanceof ArrayBuffer?new Uint8Array(o):o),r=t.reduce((o,i)=>o+i.byteLength,0),n=new Uint8Array(r),s=0;for(let o of t)n.set(o,s),s+=o.byteLength;return n.buffer}function ze(e,t,r){let n=r!==void 0?new Uint8Array(e).subarray(t,t+r):new Uint8Array(e).subarray(t);return new Uint8Array(n).buffer}function bt(e,t){return z(e>=0),z(t>0),e+(t-1)&~(t-1)}function Xo(e,t,r){let n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{let s=e.byteOffset,o=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,s,o)}return t.set(n,r),r+bt(n.byteLength,4)}function Yo(e,t){let r=e.length,s=Math.ceil(r/t)*t-r,o="";for(let i=0;i<s;++i)o+=" ";return e+o}function _r(e,t,r,n){if(e)for(let s=0;s<n;s++)e.setUint8(t+s,r.charCodeAt(s));return t+n}function Bn(e,t,r,n){if(e)for(let s=0;s<n;s++)e.setUint8(t+s,r[s]);return t+n}function sf(e,t,r,n){let s=bt(r.byteLength,n),o=s-r.byteLength;if(e){let i=new Uint8Array(e.buffer,e.byteOffset+t,r.byteLength),a=new Uint8Array(r);i.set(a);for(let c=0;c<o;++c)e.setUint8(t+r.byteLength+c,32)}return t+=s,t}function Bs(e,t,r,n){let o=new TextEncoder().encode(r);return t=sf(e,t,o,n),t}async function En(e){let t=[];for await(let r of e)t.push(r);return Er(...t)}function of(e){return e&&typeof e=="object"&&e.isBuffer}function yr(e){if(of(e))return e;if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function Tr(e){return t=>new Promise((r,n)=>e(t,(s,o)=>s?n(s):r(o)))}var Cr={};ut(Cr,{dirname:()=>A1,filename:()=>d1,join:()=>m1,resolve:()=>p1});function af(){if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let e=window.location?.pathname;return e?.slice(0,e.lastIndexOf("/")+1)||""}function d1(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function A1(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function m1(...e){let t="/";return e=e.map((r,n)=>(n&&(r=r.replace(new RegExp(`^${t}`),"")),n!==e.length-1&&(r=r.replace(new RegExp(`${t}$`),"")),r)),e.join(t)}function p1(...e){let t=[];for(let o=0;o<e.length;o++)t[o]=e[o];let r="",n=!1,s;for(let o=t.length-1;o>=-1&&!n;o--){let i;o>=0?i=t[o]:(s===void 0&&(s=af()),i=s),i.length!==0&&(r=`${i}/${r}`,n=i.charCodeAt(0)===_n)}return r=g1(r,!n),n?`/${r}`:r.length>0?r:"."}var _n=47,Zo=46;function g1(e,t){let r="",n=-1,s=0,o,i=!1;for(let a=0;a<=e.length;++a){if(a<e.length)o=e.charCodeAt(a);else{if(o===_n)break;o=_n}if(o===_n){if(!(n===a-1||s===1))if(n!==a-1&&s===2){if(r.length<2||!i||r.charCodeAt(r.length-1)!==Zo||r.charCodeAt(r.length-2)!==Zo){if(r.length>2){let c=r.length-1,f=c;for(;f>=0&&r.charCodeAt(f)!==_n;--f);if(f!==c){r=f===-1?"":r.slice(0,f),n=a,s=0,i=!1;continue}}else if(r.length===2||r.length===1){r="",n=a,s=0,i=!1;continue}}t&&(r.length>0?r+="/..":r="..",i=!0)}else{let c=e.slice(n+1,a);r.length>0?r+=`/${c}`:r=c,i=!1}n=a,s=0}else o===Zo&&s!==-1?++s:s=-1}return r}var yn=new Error("Not implemented"),Es=class{handle;size=0;bigsize=0n;url="";constructor(t,r,n){if(globalThis.loaders?.NodeFile)return new globalThis.loaders.NodeFile(t,r,n);throw Et?new Error("Can't instantiate NodeFile in browser."):new Error("Can't instantiate NodeFile. Make sure to import @loaders.gl/polyfills first.")}async read(t,r){throw yn}async write(t,r,n){throw yn}async stat(){throw yn}async truncate(t){throw yn}async append(t){throw yn}async close(){}};var qo=e=>e?.getUint8&&e?.slice&&e?.length;var Tn=class{file;constructor(t,r=!1){this.file=new Es(t,r?"a+":"r")}async truncate(t){await this.file.truncate(t)}async append(t){await this.file.append(t)}async destroy(){await this.file.close()}async getUint8(t){let r=await this.file.read(t,1),n=new Uint8Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getUint16(t){let r=await this.file.read(t,2),n=new Uint16Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getUint32(t){let r=await this.file.read(t,4),n=new Uint32Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getBigUint64(t){let r=await this.file.read(t,8),n=new BigInt64Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async slice(t,r){let n=r-t;if(n>Number.MAX_SAFE_INTEGER)throw new Error("too big slice");let s=Number(n);return await this.file.read(t,s)}get length(){return this.file.bigsize}};var Mr=e=>{if(e>Number.MAX_SAFE_INTEGER)throw new Error("Offset is out of bounds");return Number(e)},Je=class{file;constructor(t){this.file=t}async destroy(){}async getUint8(t){return this.file.getUint8(Mr(t))}async getUint16(t){return this.file.getUint16(Mr(t),!0)}async getUint32(t){return this.file.getUint32(Mr(t),!0)}async getBigUint64(t){return this.file.getBigUint64(Mr(t),!0)}async slice(t,r){return this.file.buffer.slice(Mr(t),Mr(r))}get length(){return BigInt(this.file.byteLength)}};var nT=1/Math.PI*180,sT=1/180*Math.PI,x1={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...x1}};var et=globalThis.mathgl.config;function Wo(e,{precision:t=et.precision}={}){return e=B1(e),"".concat(parseFloat(e.toPrecision(t)))}function Wt(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function $o(e,t,r){return _1(e,n=>Math.max(t,Math.min(r,n)))}function _s(e,t,r){let n=et.EPSILON;r&&(et.EPSILON=r);try{if(e===t)return!0;if(Wt(e)&&Wt(t)){if(e.length!==t.length)return!1;for(let s=0;s<e.length;++s)if(!_s(e[s],t[s]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):typeof e=="number"&&typeof t=="number"?Math.abs(e-t)<=et.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{et.EPSILON=n}}function B1(e){return Math.round(e/et.EPSILON)*et.EPSILON}function E1(e){return e.clone?e.clone():new Array(e.length)}function _1(e,t,r){if(Wt(e)){let n=e;r=r||E1(n);for(let s=0;s<r.length&&s<n.length;++s){let o=typeof e=="number"?e:e[s];r[s]=t(o,s,r)}return r}return t(e)}function y1(e){function t(){var r=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(r,Object.getPrototypeOf(this)),r}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}var br=class extends y1(Array){clone(){return new this.constructor().copy(this)}fromArray(t,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=t[n+r];return this.check()}toArray(t=[],r=0){for(let n=0;n<this.ELEMENTS;++n)t[r+n]=this[n];return t}toObject(t){return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:Wt(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(et)}formatString(t){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+Wo(this[n],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(r,"]")}equals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!_s(this[r],t[r]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==t[r])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,r,n){if(n===void 0)return this.lerp(this,t,r);for(let s=0;s<this.ELEMENTS;++s){let o=t[s],i=typeof r=="number"?r:r[s];this[s]=o+n*(i-o)}return this.check()}min(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(t[r],this[r]);return this.check()}max(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(t[r],this[r]);return this.check()}clamp(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),r[n]);return this.check()}add(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(t){if(typeof t=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;else for(let r=0;r<this.ELEMENTS&&r<t.length;++r)this[r]*=t[r];return this.check()}multiplyByScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}check(){if(et.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let t=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)t=t&&Number.isFinite(this[r]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=t;return this.check()}addScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),r);return this.check()}get elements(){return this}};function T1(e,t){if(e.length!==t)return!1;for(let r=0;r<e.length;++r)if(!Number.isFinite(e[r]))return!1;return!0}function rt(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(JSON.stringify(e)));return e}function cf(e,t,r=""){if(et.debug&&!T1(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}function ti(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var wr=class extends br{get x(){return this[0]}set x(t){this[0]=rt(t)}get y(){return this[1]}set y(t){this[1]=rt(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let r=0;r<this.ELEMENTS;++r)t+=this[r]*this[r];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let r=0;for(let n=0;n<this.ELEMENTS;++n){let s=this[n]-t[n];r+=s*s}return rt(r)}dot(t){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*t[n];return rt(r)}normalize(){let t=this.magnitude();if(t!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=t;return this.check()}multiply(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return ti(t>=0&&t<this.ELEMENTS,"index is out of range"),rt(this[t])}setComponent(t,r){return ti(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=r,this.check()}addVectors(t,r){return this.copy(t).add(r)}subVectors(t,r){return this.copy(t).subtract(r)}multiplyVectors(t,r){return this.copy(t).multiply(r)}addScaledVector(t,r){return this.add(new this.constructor(t).multiplyScalar(r))}};var Ir=typeof Float32Array<"u"?Float32Array:Array;var mT=Math.PI/180;function w1(){let e=new Ir(2);return Ir!=Float32Array&&(e[0]=0,e[1]=0),e}function hf(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[2]*s,e[1]=r[1]*n+r[3]*s,e}function lf(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[2]*s+r[4],e[1]=r[1]*n+r[3]*s+r[5],e}function ys(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[3]*s+r[6],e[1]=r[1]*n+r[4]*s+r[7],e}function uf(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[4]*s+r[12],e[1]=r[1]*n+r[5]*s+r[13],e}var pT=function(){let e=w1();return function(t,r,n,s,o,i){let a,c;for(r||(r=2),n||(n=0),s?c=Math.min(s*r+n,t.length):c=t.length,a=n;a<c;a+=r)e[0]=t[a],e[1]=t[a+1],o(e,e,i),t[a]=e[0],t[a+1]=e[1];return t}}();function df(e,t,r){let n=t[0],s=t[1],o=r[3]*n+r[7]*s||1;return e[0]=(r[0]*n+r[4]*s)/o,e[1]=(r[1]*n+r[5]*s)/o,e}function Af(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[3]*n+r[7]*s+r[11]*o||1;return e[0]=(r[0]*n+r[4]*s+r[8]*o)/i,e[1]=(r[1]*n+r[5]*s+r[9]*o)/i,e[2]=(r[2]*n+r[6]*s+r[10]*o)/i,e}function mf(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[2]*s,e[1]=r[1]*n+r[3]*s,e[2]=t[2],e}function pf(e,t,r){let n=t[0],s=t[1],o=t[2];return e[0]=r[0]*n+r[3]*s+r[6]*o,e[1]=r[1]*n+r[4]*s+r[7]*o,e[2]=r[2]*n+r[5]*s+r[8]*o,e[3]=t[3],e}var Qe=class extends wr{constructor(t=0,r=0){super(2),Wt(t)&&arguments.length===1?this.copy(t):(et.debug&&(rt(t),rt(r)),this[0]=t,this[1]=r)}set(t,r){return this[0]=t,this[1]=r,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this.check()}fromObject(t){return et.debug&&(rt(t.x),rt(t.y)),this[0]=t.x,this[1]=t.y,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return uf(this,this,t),this.check()}transformAsVector(t){return df(this,this,t),this.check()}transformByMatrix3(t){return ys(this,this,t),this.check()}transformByMatrix2x3(t){return lf(this,this,t),this.check()}transformByMatrix2(t){return hf(this,this,t),this.check()}};function I1(){let e=new Ir(3);return Ir!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function S1(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function gf(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[0],a=r[1],c=r[2];return e[0]=s*c-o*a,e[1]=o*i-n*c,e[2]=n*a-s*i,e}function xf(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[3]*n+r[7]*s+r[11]*o+r[15];return i=i||1,e[0]=(r[0]*n+r[4]*s+r[8]*o+r[12])/i,e[1]=(r[1]*n+r[5]*s+r[9]*o+r[13])/i,e[2]=(r[2]*n+r[6]*s+r[10]*o+r[14])/i,e}function Ts(e,t,r){let n=t[0],s=t[1],o=t[2];return e[0]=n*r[0]+s*r[3]+o*r[6],e[1]=n*r[1]+s*r[4]+o*r[7],e[2]=n*r[2]+s*r[5]+o*r[8],e}function Bf(e,t,r){let n=r[0],s=r[1],o=r[2],i=r[3],a=t[0],c=t[1],f=t[2],h=s*f-o*c,u=o*a-n*f,l=n*c-s*a,d=s*l-o*u,A=o*h-n*l,m=n*u-s*h,p=i*2;return h*=p,u*=p,l*=p,d*=2,A*=2,m*=2,e[0]=a+h+d,e[1]=c+u+A,e[2]=f+l+m,e}function Ef(e,t,r,n){let s=[],o=[];return s[0]=t[0]-r[0],s[1]=t[1]-r[1],s[2]=t[2]-r[2],o[0]=s[0],o[1]=s[1]*Math.cos(n)-s[2]*Math.sin(n),o[2]=s[1]*Math.sin(n)+s[2]*Math.cos(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function _f(e,t,r,n){let s=[],o=[];return s[0]=t[0]-r[0],s[1]=t[1]-r[1],s[2]=t[2]-r[2],o[0]=s[2]*Math.sin(n)+s[0]*Math.cos(n),o[1]=s[1],o[2]=s[2]*Math.cos(n)-s[0]*Math.sin(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function yf(e,t,r,n){let s=[],o=[];return s[0]=t[0]-r[0],s[1]=t[1]-r[1],s[2]=t[2]-r[2],o[0]=s[0]*Math.cos(n)-s[1]*Math.sin(n),o[1]=s[0]*Math.sin(n)+s[1]*Math.cos(n),o[2]=s[2],e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function Tf(e,t){let r=e[0],n=e[1],s=e[2],o=t[0],i=t[1],a=t[2],c=Math.sqrt((r*r+n*n+s*s)*(o*o+i*i+a*a)),f=c&&S1(e,t)/c;return Math.acos(Math.min(Math.max(f,-1),1))}var MT=function(){let e=I1();return function(t,r,n,s,o,i){let a,c;for(r||(r=3),n||(n=0),s?c=Math.min(s*r+n,t.length):c=t.length,a=n;a<c;a+=r)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],o(e,e,i),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2];return t}}();var ei=[0,0,0],Cs,fe=class extends wr{static get ZERO(){return Cs||(Cs=new fe(0,0,0),Object.freeze(Cs)),Cs}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&Wt(t)?this.copy(t):(et.debug&&(rt(t),rt(r),rt(n)),this[0]=t,this[1]=r,this[2]=n)}set(t,r,n){return this[0]=t,this[1]=r,this[2]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return et.debug&&(rt(t.x),rt(t.y),rt(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=rt(t)}angle(t){return Tf(this,t)}cross(t){return gf(this,this,t),this.check()}rotateX({radians:t,origin:r=ei}){return Ef(this,this,r,t),this.check()}rotateY({radians:t,origin:r=ei}){return _f(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=ei}){return yf(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return xf(this,this,t),this.check()}transformAsVector(t){return Af(this,this,t),this.check()}transformByMatrix3(t){return Ts(this,this,t),this.check()}transformByMatrix2(t){return mf(this,this,t),this.check()}transformByQuaternion(t){return Bf(this,this,t),this.check()}};var Ms=class extends br{toString(){let t="[";if(et.printRowMajor){t+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)t+=" ".concat(this[n*this.RANK+r])}else{t+="column-major:";for(let r=0;r<this.ELEMENTS;++r)t+=" ".concat(this[r])}return t+="]",t}getElementIndex(t,r){return r*this.RANK+t}getElement(t,r){return this[r*this.RANK+t]}setElement(t,r,n){return this[r*this.RANK+t]=rt(n),this}getColumn(t,r=new Array(this.RANK).fill(-0)){let n=t*this.RANK;for(let s=0;s<this.RANK;++s)r[s]=this[n+s];return r}setColumn(t,r){let n=t*this.RANK;for(let s=0;s<this.RANK;++s)this[n+s]=r[s];return this}};function Cf(e,t){if(e===t){let r=t[1],n=t[2],s=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=s}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function Mf(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=t[4],a=t[5],c=t[6],f=t[7],h=t[8],u=h*i-a*f,l=-h*o+a*c,d=f*o-i*c,A=r*u+n*l+s*d;return A?(A=1/A,e[0]=u*A,e[1]=(-h*n+s*f)*A,e[2]=(a*n-s*i)*A,e[3]=l*A,e[4]=(h*r-s*c)*A,e[5]=(-a*r+s*o)*A,e[6]=d*A,e[7]=(-f*r+n*c)*A,e[8]=(i*r-n*o)*A,e):null}function bf(e){let t=e[0],r=e[1],n=e[2],s=e[3],o=e[4],i=e[5],a=e[6],c=e[7],f=e[8];return t*(f*o-i*c)+r*(-f*s+i*a)+n*(c*s-o*a)}function ri(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],c=t[5],f=t[6],h=t[7],u=t[8],l=r[0],d=r[1],A=r[2],m=r[3],p=r[4],E=r[5],y=r[6],C=r[7],M=r[8];return e[0]=l*n+d*i+A*f,e[1]=l*s+d*a+A*h,e[2]=l*o+d*c+A*u,e[3]=m*n+p*i+E*f,e[4]=m*s+p*a+E*h,e[5]=m*o+p*c+E*u,e[6]=y*n+C*i+M*f,e[7]=y*s+C*a+M*h,e[8]=y*o+C*c+M*u,e}function wf(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],c=t[5],f=t[6],h=t[7],u=t[8],l=r[0],d=r[1];return e[0]=n,e[1]=s,e[2]=o,e[3]=i,e[4]=a,e[5]=c,e[6]=l*n+d*i+f,e[7]=l*s+d*a+h,e[8]=l*o+d*c+u,e}function If(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],c=t[5],f=t[6],h=t[7],u=t[8],l=Math.sin(r),d=Math.cos(r);return e[0]=d*n+l*i,e[1]=d*s+l*a,e[2]=d*o+l*c,e[3]=d*i-l*n,e[4]=d*a-l*s,e[5]=d*c-l*o,e[6]=f,e[7]=h,e[8]=u,e}function ni(e,t,r){let n=r[0],s=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=s*t[3],e[4]=s*t[4],e[5]=s*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function Sf(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=r+r,a=n+n,c=s+s,f=r*i,h=n*i,u=n*a,l=s*i,d=s*a,A=s*c,m=o*i,p=o*a,E=o*c;return e[0]=1-u-A,e[3]=h-E,e[6]=l+p,e[1]=h+E,e[4]=1-f-A,e[7]=d-m,e[2]=l-p,e[5]=d+m,e[8]=1-f-u,e}var si;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"})(si||(si={}));var R1=Object.freeze([1,0,0,0,1,0,0,0,1]),he=class extends Ms{static get IDENTITY(){return D1()}static get ZERO(){return F1()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return si}constructor(t,...r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):r.length>0?this.copy([t,...r]):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}identity(){return this.copy(R1)}fromObject(t){return this.check()}fromQuaternion(t){return Sf(this,t),this.check()}set(t,r,n,s,o,i,a,c,f){return this[0]=t,this[1]=r,this[2]=n,this[3]=s,this[4]=o,this[5]=i,this[6]=a,this[7]=c,this[8]=f,this.check()}setRowMajor(t,r,n,s,o,i,a,c,f){return this[0]=t,this[1]=s,this[2]=a,this[3]=r,this[4]=o,this[5]=c,this[6]=n,this[7]=i,this[8]=f,this.check()}determinant(){return bf(this)}transpose(){return Cf(this,this),this.check()}invert(){return Mf(this,this),this.check()}multiplyLeft(t){return ri(this,t,this),this.check()}multiplyRight(t){return ri(this,this,t),this.check()}rotate(t){return If(this,this,t),this.check()}scale(t){return Array.isArray(t)?ni(this,this,t):ni(this,this,[t,t]),this.check()}translate(t){return wf(this,this,t),this.check()}transform(t,r){let n;switch(t.length){case 2:n=ys(r||[-0,-0],t,this);break;case 3:n=Ts(r||[-0,-0,-0],t,this);break;case 4:n=pf(r||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return cf(n,t.length),n}transformVector(t,r){return this.transform(t,r)}transformVector2(t,r){return this.transform(t,r)}transformVector3(t,r){return this.transform(t,r)}},bs,ws=null;function F1(){return bs||(bs=new he([0,0,0,0,0,0,0,0,0]),Object.freeze(bs)),bs}function D1(){return ws||(ws=new he,Object.freeze(ws)),ws}var Sr;(function(e){e[e.ADD=1]="ADD",e[e.REPLACE=2]="REPLACE"})(Sr||(Sr={}));var Ce;(function(e){e.EMPTY="empty",e.SCENEGRAPH="scenegraph",e.POINTCLOUD="pointcloud",e.MESH="mesh"})(Ce||(Ce={}));var Cn;(function(e){e.I3S="I3S",e.TILES3D="TILES3D"})(Cn||(Cn={}));var le;(function(e){e.GEOMETRIC_ERROR="geometricError",e.MAX_SCREEN_THRESHOLD="maxScreenThreshold"})(le||(le={}));var Rr="4.3.0-alpha.1";var _t={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},pC=Object.keys(_t),Me={BATCHED_MODEL:[98,51,100,109],INSTANCED_MODEL:[105,51,100,109],POINT_CLOUD:[112,110,116,115],COMPOSITE:[99,109,112,116]};function oi(e,t,r){z(e instanceof ArrayBuffer);let n=new TextDecoder("utf8"),s=new Uint8Array(e,t,r);return n.decode(s)}function Rf(e,t=0){let r=new DataView(e);return`${String.fromCharCode(r.getUint8(t+0))}${String.fromCharCode(r.getUint8(t+1))}${String.fromCharCode(r.getUint8(t+2))}${String.fromCharCode(r.getUint8(t+3))}`}var Ff="4.3.0-alpha.1";var Df={dataType:null,batchType:null,name:"Draco",id:"draco",module:"draco",version:Ff,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}};function Lf(e){switch(e.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}function ii(e){let t=1/0,r=1/0,n=1/0,s=-1/0,o=-1/0,i=-1/0,a=e.POSITION?e.POSITION.value:[],c=a&&a.length;for(let f=0;f<c;f+=3){let h=a[f],u=a[f+1],l=a[f+2];t=h<t?h:t,r=u<r?u:r,n=l<n?l:n,s=h>s?h:s,o=u>o?u:o,i=l>i?l:i}return[[t,r,n],[s,o,i]]}function ai(e,t,r){let n=Lf(t.value),s=r||Of(t);return{name:e,type:{type:"fixed-size-list",listSize:t.size,children:[{name:"value",type:n}]},nullable:!1,metadata:s}}function Of(e){let t={};return"byteOffset"in e&&(t.byteOffset=e.byteOffset.toString(10)),"byteStride"in e&&(t.byteStride=e.byteStride.toString(10)),"normalized"in e&&(t.normalized=e.normalized.toString()),t}function Nf(e,t,r){let n=Gf(t.metadata),s=[],o=L1(t.attributes);for(let i in e){let a=e[i],c=vf(i,a,o[i]);s.push(c)}if(r){let i=vf("indices",r);s.push(i)}return{fields:s,metadata:n}}function L1(e){let t={};for(let r in e){let n=e[r];t[n.name||"undefined"]=n}return t}function vf(e,t,r){let n=r?Gf(r.metadata):void 0;return ai(e,t,n)}function Gf(e){Object.entries(e);let t={};for(let r in e)t[`${r}.string`]=JSON.stringify(e[r]);return t}var Uf={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},O1={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},v1=4,Mn=class{draco;decoder;metadataQuerier;constructor(t){this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t,r={}){let n=new this.draco.DecoderBuffer;n.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(r);let s=this.decoder.GetEncodedGeometryType(n),o=s===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let i;switch(s){case this.draco.TRIANGULAR_MESH:i=this.decoder.DecodeBufferToMesh(n,o);break;case this.draco.POINT_CLOUD:i=this.decoder.DecodeBufferToPointCloud(n,o);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!i.ok()||!o.ptr){let l=`DRACO decompression failed: ${i.error_msg()}`;throw new Error(l)}let a=this._getDracoLoaderData(o,s,r),c=this._getMeshData(o,a,r),f=ii(c.attributes),h=Nf(c.attributes,a,c.indices);return{loader:"draco",loaderData:a,header:{vertexCount:o.num_points(),boundingBox:f},...c,schema:h}}finally{this.draco.destroy(n),o&&this.draco.destroy(o)}}_getDracoLoaderData(t,r,n){let s=this._getTopLevelMetadata(t),o=this._getDracoAttributes(t,n);return{geometry_type:r,num_attributes:t.num_attributes(),num_points:t.num_points(),num_faces:t instanceof this.draco.Mesh?t.num_faces():0,metadata:s,attributes:o}}_getDracoAttributes(t,r){let n={};for(let s=0;s<t.num_attributes();s++){let o=this.decoder.GetAttribute(t,s),i=this._getAttributeMetadata(t,s);n[o.unique_id()]={unique_id:o.unique_id(),attribute_type:o.attribute_type(),data_type:o.data_type(),num_components:o.num_components(),byte_offset:o.byte_offset(),byte_stride:o.byte_stride(),normalized:o.normalized(),attribute_index:s,metadata:i};let a=this._getQuantizationTransform(o,r);a&&(n[o.unique_id()].quantization_transform=a);let c=this._getOctahedronTransform(o,r);c&&(n[o.unique_id()].octahedron_transform=c)}return n}_getMeshData(t,r,n){let s=this._getMeshAttributes(r,t,n);if(!s.POSITION)throw new Error("DRACO: No position attribute found.");if(t instanceof this.draco.Mesh)switch(n.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:s,indices:{value:this._getTriangleStripIndices(t),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:s,indices:{value:this._getTriangleListIndices(t),size:1}}}return{topology:"point-list",mode:0,attributes:s}}_getMeshAttributes(t,r,n){let s={};for(let o of Object.values(t.attributes)){let i=this._deduceAttributeName(o,n);o.name=i;let a=this._getAttributeValues(r,o);if(a){let{value:c,size:f}=a;s[i]={value:c,size:f,byteOffset:o.byte_offset,byteStride:o.byte_stride,normalized:o.normalized}}}return s}_getTriangleListIndices(t){let n=t.num_faces()*3,s=n*v1,o=this.draco._malloc(s);try{return this.decoder.GetTrianglesUInt32Array(t,s,o),new Uint32Array(this.draco.HEAPF32.buffer,o,n).slice()}finally{this.draco._free(o)}}_getTriangleStripIndices(t){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,r),U1(r)}finally{this.draco.destroy(r)}}_getAttributeValues(t,r){let n=O1[r.data_type];if(!n)return console.warn(`DRACO: Unsupported attribute type ${r.data_type}`),null;let s=r.num_components,i=t.num_points()*s,a=i*n.BYTES_PER_ELEMENT,c=N1(this.draco,n),f,h=this.draco._malloc(a);try{let u=this.decoder.GetAttribute(t,r.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(t,u,c,a,h),f=new n(this.draco.HEAPF32.buffer,h,i).slice()}finally{this.draco._free(h)}return{value:f,size:s}}_deduceAttributeName(t,r){let n=t.unique_id;for(let[i,a]of Object.entries(r.extraAttributes||{}))if(a===n)return i;let s=t.attribute_type;for(let i in Uf)if(this.draco[i]===s)return Uf[i];let o=r.attributeNameEntry||"name";return t.metadata[o]?t.metadata[o].string:`CUSTOM_ATTRIBUTE_${n}`}_getTopLevelMetadata(t){let r=this.decoder.GetMetadata(t);return this._getDracoMetadata(r)}_getAttributeMetadata(t,r){let n=this.decoder.GetAttributeMetadata(t,r);return this._getDracoMetadata(n)}_getDracoMetadata(t){if(!t||!t.ptr)return{};let r={},n=this.metadataQuerier.NumEntries(t);for(let s=0;s<n;s++){let o=this.metadataQuerier.GetEntryName(t,s);r[o]=this._getDracoMetadataField(t,o)}return r}_getDracoMetadataField(t,r){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,r,n);let s=G1(n);return{int:this.metadataQuerier.GetIntEntry(t,r),string:this.metadataQuerier.GetStringEntry(t,r),double:this.metadataQuerier.GetDoubleEntry(t,r),intArray:s}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(t){let{quantizedAttributes:r=[],octahedronAttributes:n=[]}=t,s=[...r,...n];for(let o of s)this.decoder.SkipAttributeTransform(this.draco[o])}_getQuantizationTransform(t,r){let{quantizedAttributes:n=[]}=r,s=t.attribute_type();if(n.map(i=>this.decoder[i]).includes(s)){let i=new this.draco.AttributeQuantizationTransform;try{if(i.InitFromAttribute(t))return{quantization_bits:i.quantization_bits(),range:i.range(),min_values:new Float32Array([1,2,3]).map(a=>i.min_value(a))}}finally{this.draco.destroy(i)}}return null}_getOctahedronTransform(t,r){let{octahedronAttributes:n=[]}=r,s=t.attribute_type();if(n.map(i=>this.decoder[i]).includes(s)){let i=new this.draco.AttributeQuantizationTransform;try{if(i.InitFromAttribute(t))return{quantization_bits:i.quantization_bits()}}finally{this.draco.destroy(i)}}return null}};function N1(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32;default:return e.DT_INVALID}}function G1(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}function U1(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}var P1="1.5.6",H1="1.4.1",ci=`https://www.gstatic.com/draco/versioned/decoders/${P1}`,yt={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},fi={[yt.DECODER]:`${ci}/${yt.DECODER}`,[yt.DECODER_WASM]:`${ci}/${yt.DECODER_WASM}`,[yt.FALLBACK_DECODER]:`${ci}/${yt.FALLBACK_DECODER}`,[yt.ENCODER]:`https://raw.githubusercontent.com/google/draco/${H1}/javascript/${yt.ENCODER}`},hi;async function Pf(e){let t=e.modules||{};return t.draco3d?hi||=t.draco3d.createDecoderModule({}).then(r=>({draco:r})):hi||=k1(e),await hi}async function k1(e){let t,r;switch(e.draco&&e.draco.decoderType){case"js":t=await qt(fi[yt.FALLBACK_DECODER],"draco",e,yt.FALLBACK_DECODER);break;case"wasm":default:[t,r]=await Promise.all([await qt(fi[yt.DECODER],"draco",e,yt.DECODER),await qt(fi[yt.DECODER_WASM],"draco",e,yt.DECODER_WASM)])}return t=t||globalThis.DracoDecoderModule,await z1(t,r)}function z1(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e({...r,onModuleLoaded:s=>n({draco:s})})})}var Is={...Df,parse:J1};async function J1(e,t){let{draco:r}=await Pf(t),n=new Mn(r);try{return n.parseSync(e,t?.draco)}finally{n.destroy()}}var Q1={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},nt={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},H={...Q1,...nt};var li={[nt.DOUBLE]:Float64Array,[nt.FLOAT]:Float32Array,[nt.UNSIGNED_SHORT]:Uint16Array,[nt.UNSIGNED_INT]:Uint32Array,[nt.UNSIGNED_BYTE]:Uint8Array,[nt.BYTE]:Int8Array,[nt.SHORT]:Int16Array,[nt.INT]:Int32Array},V1={DOUBLE:nt.DOUBLE,FLOAT:nt.FLOAT,UNSIGNED_SHORT:nt.UNSIGNED_SHORT,UNSIGNED_INT:nt.UNSIGNED_INT,UNSIGNED_BYTE:nt.UNSIGNED_BYTE,BYTE:nt.BYTE,SHORT:nt.SHORT,INT:nt.INT},ui="Failed to convert GL type",dt=class{static fromTypedArray(t){t=ArrayBuffer.isView(t)?t.constructor:t;for(let r in li)if(li[r]===t)return r;throw new Error(ui)}static fromName(t){let r=V1[t];if(!r)throw new Error(ui);return r}static getArrayType(t){switch(t){case nt.UNSIGNED_SHORT_5_6_5:case nt.UNSIGNED_SHORT_4_4_4_4:case nt.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:let r=li[t];if(!r)throw new Error(ui);return r}}static getByteSize(t){return dt.getArrayType(t).BYTES_PER_ELEMENT}static validate(t){return Boolean(dt.getArrayType(t))}static createTypedArray(t,r,n=0,s){s===void 0&&(s=(r.byteLength-n)/dt.getByteSize(t));let o=dt.getArrayType(t);return new o(r,n,s)}};function Hf(e,t){if(!e)throw new Error(`math.gl assertion failed. ${t}`)}function di(e,t=[0,0,0]){let r=e>>11&31,n=e>>5&63,s=e&31;return t[0]=r<<3,t[1]=n<<2,t[2]=s<<3,t}var qC=1/256;var WC=new Qe,$C=new fe,tM=new Qe,eM=new Qe,rM=new Uint8Array(1);function kf(e,t=255){return $o(e,0,t)/t*2-1}function zf(e){return e<0?-1:1}function Jf(e,t,r,n){if(Hf(n),e<0||e>r||t<0||t>r)throw new Error(`x and y must be unsigned normalized integers between 0 and ${r}`);if(n.x=kf(e,r),n.y=kf(t,r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){let s=n.x;n.x=(1-Math.abs(n.y))*zf(s),n.y=(1-Math.abs(s))*zf(n.y)}return n.normalize()}function Ai(e,t,r){return Jf(e,t,255,r)}var j1=1/Math.PI*180,K1=1/180*Math.PI,X1={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...X1}};var q=globalThis.mathgl.config;function mi(e,{precision:t=q.precision}={}){return e=Y1(e),`${parseFloat(e.toPrecision(t))}`}function $t(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function pi(e){return Qf(e)}function gi(e){return Vf(e)}function Qf(e,t){return jf(e,r=>r*K1,t)}function Vf(e,t){return jf(e,r=>r*j1,t)}function wt(e,t,r){let n=q.EPSILON;r&&(q.EPSILON=r);try{if(e===t)return!0;if($t(e)&&$t(t)){if(e.length!==t.length)return!1;for(let s=0;s<e.length;++s)if(!wt(e[s],t[s]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):typeof e=="number"&&typeof t=="number"?Math.abs(e-t)<=q.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{q.EPSILON=n}}function Y1(e){return Math.round(e/q.EPSILON)*q.EPSILON}function Z1(e){return e.clone?e.clone():new Array(e.length)}function jf(e,t,r){if($t(e)){let n=e;r=r||Z1(n);for(let s=0;s<r.length&&s<n.length;++s){let o=typeof e=="number"?e:e[s];r[s]=t(o,s,r)}return r}return t(e)}var be=class extends Array{clone(){return new this.constructor().copy(this)}fromArray(t,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=t[n+r];return this.check()}toArray(t=[],r=0){for(let n=0;n<this.ELEMENTS;++n)t[r+n]=this[n];return t}toObject(t){return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:$t(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(q)}formatString(t){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+mi(this[n],t);return`${t.printTypes?this.constructor.name:""}[${r}]`}equals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!wt(this[r],t[r]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==t[r])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,r,n){if(n===void 0)return this.lerp(this,t,r);for(let s=0;s<this.ELEMENTS;++s){let o=t[s],i=typeof r=="number"?r:r[s];this[s]=o+n*(i-o)}return this.check()}min(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(t[r],this[r]);return this.check()}max(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(t[r],this[r]);return this.check()}clamp(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),r[n]);return this.check()}add(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(t){if(typeof t=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;else for(let r=0;r<this.ELEMENTS&&r<t.length;++r)this[r]*=t[r];return this.check()}multiplyByScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}check(){if(q.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let t=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)t=t&&Number.isFinite(this[r]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=t;return this.check()}addScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),r);return this.check()}get elements(){return this}};function q1(e,t){if(e.length!==t)return!1;for(let r=0;r<e.length;++r)if(!Number.isFinite(e[r]))return!1;return!0}function J(e){if(!Number.isFinite(e))throw new Error(`Invalid number ${JSON.stringify(e)}`);return e}function we(e,t,r=""){if(q.debug&&!q1(e,t))throw new Error(`math.gl: ${r} some fields set to invalid numbers'`);return e}function ft(e,t){if(!e)throw new Error(`math.gl assertion ${t}`)}var Fr=class extends be{get x(){return this[0]}set x(t){this[0]=J(t)}get y(){return this[1]}set y(t){this[1]=J(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let r=0;r<this.ELEMENTS;++r)t+=this[r]*this[r];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let r=0;for(let n=0;n<this.ELEMENTS;++n){let s=this[n]-t[n];r+=s*s}return J(r)}dot(t){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*t[n];return J(r)}normalize(){let t=this.magnitude();if(t!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=t;return this.check()}multiply(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return ft(t>=0&&t<this.ELEMENTS,"index is out of range"),J(this[t])}setComponent(t,r){return ft(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=r,this.check()}addVectors(t,r){return this.copy(t).add(r)}subVectors(t,r){return this.copy(t).subtract(r)}multiplyVectors(t,r){return this.copy(t).multiply(r)}addScaledVector(t,r){return this.add(new this.constructor(t).multiplyScalar(r))}};var W=typeof Float32Array<"u"?Float32Array:Array,bn=Math.random;function Dr(e){return e>=0?Math.round(e):e%.5===0?Math.floor(e):Math.round(e)}var DM=Math.PI/180;function W1(){let e=new W(2);return W!=Float32Array&&(e[0]=0,e[1]=0),e}function Kf(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[3]*s+r[6],e[1]=r[1]*n+r[4]*s+r[7],e}function Xf(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[4]*s+r[12],e[1]=r[1]*n+r[5]*s+r[13],e}var LM=function(){let e=W1();return function(t,r,n,s,o,i){let a,c;for(r||(r=2),n||(n=0),s?c=Math.min(s*r+n,t.length):c=t.length,a=n;a<c;a+=r)e[0]=t[a],e[1]=t[a+1],o(e,e,i),t[a]=e[0],t[a+1]=e[1];return t}}();function Yf(e,t,r){let n=t[0],s=t[1],o=r[3]*n+r[7]*s||1;return e[0]=(r[0]*n+r[4]*s)/o,e[1]=(r[1]*n+r[5]*s)/o,e}function Ss(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[3]*n+r[7]*s+r[11]*o||1;return e[0]=(r[0]*n+r[4]*s+r[8]*o)/i,e[1]=(r[1]*n+r[5]*s+r[9]*o)/i,e[2]=(r[2]*n+r[6]*s+r[10]*o)/i,e}function Zf(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[2]*s,e[1]=r[1]*n+r[3]*s,e[2]=t[2],e}function qf(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[2]*s,e[1]=r[1]*n+r[3]*s,e[2]=t[2],e[3]=t[3],e}function Rs(e,t,r){let n=t[0],s=t[1],o=t[2];return e[0]=r[0]*n+r[3]*s+r[6]*o,e[1]=r[1]*n+r[4]*s+r[7]*o,e[2]=r[2]*n+r[5]*s+r[8]*o,e[3]=t[3],e}var Ke={};ut(Ke,{add:()=>rA,angle:()=>yi,bezier:()=>mA,ceil:()=>nA,clone:()=>$1,copy:()=>tA,create:()=>Fs,cross:()=>Ve,dist:()=>CA,distance:()=>rh,div:()=>TA,divide:()=>eh,dot:()=>wn,equals:()=>EA,exactEquals:()=>BA,floor:()=>sA,forEach:()=>wA,fromValues:()=>Ds,hermite:()=>AA,inverse:()=>lA,len:()=>Ti,length:()=>Wf,lerp:()=>uA,max:()=>iA,min:()=>oA,mul:()=>yA,multiply:()=>th,negate:()=>hA,normalize:()=>xi,random:()=>pA,rotateX:()=>Bi,rotateY:()=>Ei,rotateZ:()=>_i,round:()=>aA,scale:()=>cA,scaleAndAdd:()=>fA,set:()=>eA,slerp:()=>dA,sqrDist:()=>MA,sqrLen:()=>bA,squaredDistance:()=>nh,squaredLength:()=>sh,str:()=>xA,sub:()=>_A,subtract:()=>$f,transformMat3:()=>In,transformMat4:()=>je,transformQuat:()=>Sn,zero:()=>gA});function Fs(){let e=new W(3);return W!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function $1(e){let t=new W(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Wf(e){let t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)}function Ds(e,t,r){let n=new W(3);return n[0]=e,n[1]=t,n[2]=r,n}function tA(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function eA(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}function rA(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function $f(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function th(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function eh(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}function nA(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function sA(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}function oA(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e}function iA(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e}function aA(e,t){return e[0]=Dr(t[0]),e[1]=Dr(t[1]),e[2]=Dr(t[2]),e}function cA(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function fA(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e}function rh(e,t){let r=t[0]-e[0],n=t[1]-e[1],s=t[2]-e[2];return Math.sqrt(r*r+n*n+s*s)}function nh(e,t){let r=t[0]-e[0],n=t[1]-e[1],s=t[2]-e[2];return r*r+n*n+s*s}function sh(e){let t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}function hA(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function lA(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function xi(e,t){let r=t[0],n=t[1],s=t[2],o=r*r+n*n+s*s;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function wn(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Ve(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[0],a=r[1],c=r[2];return e[0]=s*c-o*a,e[1]=o*i-n*c,e[2]=n*a-s*i,e}function uA(e,t,r,n){let s=t[0],o=t[1],i=t[2];return e[0]=s+n*(r[0]-s),e[1]=o+n*(r[1]-o),e[2]=i+n*(r[2]-i),e}function dA(e,t,r,n){let s=Math.acos(Math.min(Math.max(wn(t,r),-1),1)),o=Math.sin(s),i=Math.sin((1-n)*s)/o,a=Math.sin(n*s)/o;return e[0]=i*t[0]+a*r[0],e[1]=i*t[1]+a*r[1],e[2]=i*t[2]+a*r[2],e}function AA(e,t,r,n,s,o){let i=o*o,a=i*(2*o-3)+1,c=i*(o-2)+o,f=i*(o-1),h=i*(3-2*o);return e[0]=t[0]*a+r[0]*c+n[0]*f+s[0]*h,e[1]=t[1]*a+r[1]*c+n[1]*f+s[1]*h,e[2]=t[2]*a+r[2]*c+n[2]*f+s[2]*h,e}function mA(e,t,r,n,s,o){let i=1-o,a=i*i,c=o*o,f=a*i,h=3*o*a,u=3*c*i,l=c*o;return e[0]=t[0]*f+r[0]*h+n[0]*u+s[0]*l,e[1]=t[1]*f+r[1]*h+n[1]*u+s[1]*l,e[2]=t[2]*f+r[2]*h+n[2]*u+s[2]*l,e}function pA(e,t){t=t===void 0?1:t;let r=bn()*2*Math.PI,n=bn()*2-1,s=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*s,e[1]=Math.sin(r)*s,e[2]=n*t,e}function je(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[3]*n+r[7]*s+r[11]*o+r[15];return i=i||1,e[0]=(r[0]*n+r[4]*s+r[8]*o+r[12])/i,e[1]=(r[1]*n+r[5]*s+r[9]*o+r[13])/i,e[2]=(r[2]*n+r[6]*s+r[10]*o+r[14])/i,e}function In(e,t,r){let n=t[0],s=t[1],o=t[2];return e[0]=n*r[0]+s*r[3]+o*r[6],e[1]=n*r[1]+s*r[4]+o*r[7],e[2]=n*r[2]+s*r[5]+o*r[8],e}function Sn(e,t,r){let n=r[0],s=r[1],o=r[2],i=r[3],a=t[0],c=t[1],f=t[2],h=s*f-o*c,u=o*a-n*f,l=n*c-s*a,d=s*l-o*u,A=o*h-n*l,m=n*u-s*h,p=i*2;return h*=p,u*=p,l*=p,d*=2,A*=2,m*=2,e[0]=a+h+d,e[1]=c+u+A,e[2]=f+l+m,e}function Bi(e,t,r,n){let s=[],o=[];return s[0]=t[0]-r[0],s[1]=t[1]-r[1],s[2]=t[2]-r[2],o[0]=s[0],o[1]=s[1]*Math.cos(n)-s[2]*Math.sin(n),o[2]=s[1]*Math.sin(n)+s[2]*Math.cos(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function Ei(e,t,r,n){let s=[],o=[];return s[0]=t[0]-r[0],s[1]=t[1]-r[1],s[2]=t[2]-r[2],o[0]=s[2]*Math.sin(n)+s[0]*Math.cos(n),o[1]=s[1],o[2]=s[2]*Math.cos(n)-s[0]*Math.sin(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function _i(e,t,r,n){let s=[],o=[];return s[0]=t[0]-r[0],s[1]=t[1]-r[1],s[2]=t[2]-r[2],o[0]=s[0]*Math.cos(n)-s[1]*Math.sin(n),o[1]=s[0]*Math.sin(n)+s[1]*Math.cos(n),o[2]=s[2],e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function yi(e,t){let r=e[0],n=e[1],s=e[2],o=t[0],i=t[1],a=t[2],c=Math.sqrt((r*r+n*n+s*s)*(o*o+i*i+a*a)),f=c&&wn(e,t)/c;return Math.acos(Math.min(Math.max(f,-1),1))}function gA(e){return e[0]=0,e[1]=0,e[2]=0,e}function xA(e){return`vec3(${e[0]}, ${e[1]}, ${e[2]})`}function BA(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function EA(e,t){let r=e[0],n=e[1],s=e[2],o=t[0],i=t[1],a=t[2];return Math.abs(r-o)<=1e-6*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}var _A=$f,yA=th,TA=eh,CA=rh,MA=nh,Ti=Wf,bA=sh,wA=function(){let e=Fs();return function(t,r,n,s,o,i){let a,c;for(r||(r=3),n||(n=0),s?c=Math.min(s*r+n,t.length):c=t.length,a=n;a<c;a+=r)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],o(e,e,i),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2];return t}}();var Ci=[0,0,0],Ls,b=class extends Fr{static get ZERO(){return Ls||(Ls=new b(0,0,0),Object.freeze(Ls)),Ls}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&$t(t)?this.copy(t):(q.debug&&(J(t),J(r),J(n)),this[0]=t,this[1]=r,this[2]=n)}set(t,r,n){return this[0]=t,this[1]=r,this[2]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return q.debug&&(J(t.x),J(t.y),J(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=J(t)}angle(t){return yi(this,t)}cross(t){return Ve(this,this,t),this.check()}rotateX({radians:t,origin:r=Ci}){return Bi(this,this,r,t),this.check()}rotateY({radians:t,origin:r=Ci}){return Ei(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=Ci}){return _i(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return je(this,this,t),this.check()}transformAsVector(t){return Ss(this,this,t),this.check()}transformByMatrix3(t){return In(this,this,t),this.check()}transformByMatrix2(t){return Zf(this,this,t),this.check()}transformByQuaternion(t){return Sn(this,this,t),this.check()}};var Os,Or=class extends Fr{static get ZERO(){return Os||(Os=new Or(0,0,0,0),Object.freeze(Os)),Os}constructor(t=0,r=0,n=0,s=0){super(-0,-0,-0,-0),$t(t)&&arguments.length===1?this.copy(t):(q.debug&&(J(t),J(r),J(n),J(s)),this[0]=t,this[1]=r,this[2]=n,this[3]=s)}set(t,r,n,s){return this[0]=t,this[1]=r,this[2]=n,this[3]=s,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}fromObject(t){return q.debug&&(J(t.x),J(t.y),J(t.z),J(t.w)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t.w=this[3],t}get ELEMENTS(){return 4}get z(){return this[2]}set z(t){this[2]=J(t)}get w(){return this[3]}set w(t){this[3]=J(t)}transform(t){return je(this,this,t),this.check()}transformByMatrix3(t){return Rs(this,this,t),this.check()}transformByMatrix2(t){return qf(this,this,t),this.check()}transformByQuaternion(t){return Sn(this,this,t),this.check()}applyMatrix4(t){return t.transform(this,this),this}};var vr=class extends be{toString(){let t="[";if(q.printRowMajor){t+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)t+=` ${this[n*this.RANK+r]}`}else{t+="column-major:";for(let r=0;r<this.ELEMENTS;++r)t+=` ${this[r]}`}return t+="]",t}getElementIndex(t,r){return r*this.RANK+t}getElement(t,r){return this[r*this.RANK+t]}setElement(t,r,n){return this[r*this.RANK+t]=J(n),this}getColumn(t,r=new Array(this.RANK).fill(-0)){let n=t*this.RANK;for(let s=0;s<this.RANK;++s)r[s]=this[n+s];return r}setColumn(t,r){let n=t*this.RANK;for(let s=0;s<this.RANK;++s)this[n+s]=r[s];return this}};function oh(){let e=new W(9);return W!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function ih(e,t){if(e===t){let r=t[1],n=t[2],s=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=s}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function ah(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=t[4],a=t[5],c=t[6],f=t[7],h=t[8],u=h*i-a*f,l=-h*o+a*c,d=f*o-i*c,A=r*u+n*l+s*d;return A?(A=1/A,e[0]=u*A,e[1]=(-h*n+s*f)*A,e[2]=(a*n-s*i)*A,e[3]=l*A,e[4]=(h*r-s*c)*A,e[5]=(-a*r+s*o)*A,e[6]=d*A,e[7]=(-f*r+n*c)*A,e[8]=(i*r-n*o)*A,e):null}function ch(e){let t=e[0],r=e[1],n=e[2],s=e[3],o=e[4],i=e[5],a=e[6],c=e[7],f=e[8];return t*(f*o-i*c)+r*(-f*s+i*a)+n*(c*s-o*a)}function Mi(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],c=t[5],f=t[6],h=t[7],u=t[8],l=r[0],d=r[1],A=r[2],m=r[3],p=r[4],E=r[5],y=r[6],C=r[7],M=r[8];return e[0]=l*n+d*i+A*f,e[1]=l*s+d*a+A*h,e[2]=l*o+d*c+A*u,e[3]=m*n+p*i+E*f,e[4]=m*s+p*a+E*h,e[5]=m*o+p*c+E*u,e[6]=y*n+C*i+M*f,e[7]=y*s+C*a+M*h,e[8]=y*o+C*c+M*u,e}function fh(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],c=t[5],f=t[6],h=t[7],u=t[8],l=r[0],d=r[1];return e[0]=n,e[1]=s,e[2]=o,e[3]=i,e[4]=a,e[5]=c,e[6]=l*n+d*i+f,e[7]=l*s+d*a+h,e[8]=l*o+d*c+u,e}function hh(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],c=t[5],f=t[6],h=t[7],u=t[8],l=Math.sin(r),d=Math.cos(r);return e[0]=d*n+l*i,e[1]=d*s+l*a,e[2]=d*o+l*c,e[3]=d*i-l*n,e[4]=d*a-l*s,e[5]=d*c-l*o,e[6]=f,e[7]=h,e[8]=u,e}function bi(e,t,r){let n=r[0],s=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=s*t[3],e[4]=s*t[4],e[5]=s*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function lh(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=r+r,a=n+n,c=s+s,f=r*i,h=n*i,u=n*a,l=s*i,d=s*a,A=s*c,m=o*i,p=o*a,E=o*c;return e[0]=1-u-A,e[3]=h-E,e[6]=l+p,e[1]=h+E,e[4]=1-f-A,e[7]=d-m,e[2]=l-p,e[5]=d+m,e[8]=1-f-u,e}var wi;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"})(wi||(wi={}));var SA=Object.freeze([1,0,0,0,1,0,0,0,1]),Z=class extends vr{static get IDENTITY(){return FA()}static get ZERO(){return RA()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return wi}constructor(t,...r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):r.length>0?this.copy([t,...r]):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}identity(){return this.copy(SA)}fromObject(t){return this.check()}fromQuaternion(t){return lh(this,t),this.check()}set(t,r,n,s,o,i,a,c,f){return this[0]=t,this[1]=r,this[2]=n,this[3]=s,this[4]=o,this[5]=i,this[6]=a,this[7]=c,this[8]=f,this.check()}setRowMajor(t,r,n,s,o,i,a,c,f){return this[0]=t,this[1]=s,this[2]=a,this[3]=r,this[4]=o,this[5]=c,this[6]=n,this[7]=i,this[8]=f,this.check()}determinant(){return ch(this)}transpose(){return ih(this,this),this.check()}invert(){return ah(this,this),this.check()}multiplyLeft(t){return Mi(this,t,this),this.check()}multiplyRight(t){return Mi(this,this,t),this.check()}rotate(t){return hh(this,this,t),this.check()}scale(t){return Array.isArray(t)?bi(this,this,t):bi(this,this,[t,t]),this.check()}translate(t){return fh(this,this,t),this.check()}transform(t,r){let n;switch(t.length){case 2:n=Kf(r||[-0,-0],t,this);break;case 3:n=In(r||[-0,-0,-0],t,this);break;case 4:n=Rs(r||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return we(n,t.length),n}transformVector(t,r){return this.transform(t,r)}transformVector2(t,r){return this.transform(t,r)}transformVector3(t,r){return this.transform(t,r)}},vs,Ns=null;function RA(){return vs||(vs=new Z([0,0,0,0,0,0,0,0,0]),Object.freeze(vs)),vs}function FA(){return Ns||(Ns=new Z,Object.freeze(Ns)),Ns}var Fn={};ut(Fn,{add:()=>rm,adjoint:()=>GA,clone:()=>LA,copy:()=>OA,create:()=>DA,decompose:()=>KA,determinant:()=>Ri,equals:()=>im,exactEquals:()=>om,frob:()=>em,fromQuat:()=>Gi,fromQuat2:()=>QA,fromRotation:()=>HA,fromRotationTranslation:()=>dh,fromRotationTranslationScale:()=>XA,fromRotationTranslationScaleOrigin:()=>YA,fromScaling:()=>PA,fromTranslation:()=>UA,fromValues:()=>vA,fromXRotation:()=>kA,fromYRotation:()=>zA,fromZRotation:()=>JA,frustum:()=>Ui,getRotation:()=>jA,getScaling:()=>Ah,getTranslation:()=>VA,identity:()=>uh,invert:()=>Si,lookAt:()=>ki,mul:()=>am,multiply:()=>Rn,multiplyScalar:()=>nm,multiplyScalarAndAdd:()=>sm,ortho:()=>Hi,orthoNO:()=>ph,orthoZO:()=>WA,perspective:()=>Pi,perspectiveFromFieldOfView:()=>qA,perspectiveNO:()=>mh,perspectiveZO:()=>ZA,rotate:()=>Li,rotateX:()=>Oi,rotateY:()=>vi,rotateZ:()=>Ni,scale:()=>Di,set:()=>NA,str:()=>tm,sub:()=>cm,subtract:()=>gh,targetTo:()=>$A,translate:()=>Fi,transpose:()=>Ii});function DA(){let e=new W(16);return W!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function LA(e){let t=new W(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function OA(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function vA(e,t,r,n,s,o,i,a,c,f,h,u,l,d,A,m){let p=new W(16);return p[0]=e,p[1]=t,p[2]=r,p[3]=n,p[4]=s,p[5]=o,p[6]=i,p[7]=a,p[8]=c,p[9]=f,p[10]=h,p[11]=u,p[12]=l,p[13]=d,p[14]=A,p[15]=m,p}function NA(e,t,r,n,s,o,i,a,c,f,h,u,l,d,A,m,p){return e[0]=t,e[1]=r,e[2]=n,e[3]=s,e[4]=o,e[5]=i,e[6]=a,e[7]=c,e[8]=f,e[9]=h,e[10]=u,e[11]=l,e[12]=d,e[13]=A,e[14]=m,e[15]=p,e}function uh(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Ii(e,t){if(e===t){let r=t[1],n=t[2],s=t[3],o=t[6],i=t[7],a=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=o,e[11]=t[14],e[12]=s,e[13]=i,e[14]=a}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function Si(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=t[4],a=t[5],c=t[6],f=t[7],h=t[8],u=t[9],l=t[10],d=t[11],A=t[12],m=t[13],p=t[14],E=t[15],y=r*a-n*i,C=r*c-s*i,M=r*f-o*i,T=n*c-s*a,I=n*f-o*a,w=s*f-o*c,L=h*m-u*A,x=h*p-l*A,g=h*E-d*A,B=u*p-l*m,_=u*E-d*m,U=l*E-d*p,G=y*U-C*_+M*B+T*g-I*x+w*L;return G?(G=1/G,e[0]=(a*U-c*_+f*B)*G,e[1]=(s*_-n*U-o*B)*G,e[2]=(m*w-p*I+E*T)*G,e[3]=(l*I-u*w-d*T)*G,e[4]=(c*g-i*U-f*x)*G,e[5]=(r*U-s*g+o*x)*G,e[6]=(p*M-A*w-E*C)*G,e[7]=(h*w-l*M+d*C)*G,e[8]=(i*_-a*g+f*L)*G,e[9]=(n*g-r*_-o*L)*G,e[10]=(A*I-m*M+E*y)*G,e[11]=(u*M-h*I-d*y)*G,e[12]=(a*x-i*B-c*L)*G,e[13]=(r*B-n*x+s*L)*G,e[14]=(m*C-A*T-p*y)*G,e[15]=(h*T-u*C+l*y)*G,e):null}function GA(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=t[4],a=t[5],c=t[6],f=t[7],h=t[8],u=t[9],l=t[10],d=t[11],A=t[12],m=t[13],p=t[14],E=t[15],y=r*a-n*i,C=r*c-s*i,M=r*f-o*i,T=n*c-s*a,I=n*f-o*a,w=s*f-o*c,L=h*m-u*A,x=h*p-l*A,g=h*E-d*A,B=u*p-l*m,_=u*E-d*m,U=l*E-d*p;return e[0]=a*U-c*_+f*B,e[1]=s*_-n*U-o*B,e[2]=m*w-p*I+E*T,e[3]=l*I-u*w-d*T,e[4]=c*g-i*U-f*x,e[5]=r*U-s*g+o*x,e[6]=p*M-A*w-E*C,e[7]=h*w-l*M+d*C,e[8]=i*_-a*g+f*L,e[9]=n*g-r*_-o*L,e[10]=A*I-m*M+E*y,e[11]=u*M-h*I-d*y,e[12]=a*x-i*B-c*L,e[13]=r*B-n*x+s*L,e[14]=m*C-A*T-p*y,e[15]=h*T-u*C+l*y,e}function Ri(e){let t=e[0],r=e[1],n=e[2],s=e[3],o=e[4],i=e[5],a=e[6],c=e[7],f=e[8],h=e[9],u=e[10],l=e[11],d=e[12],A=e[13],m=e[14],p=e[15],E=t*i-r*o,y=t*a-n*o,C=r*a-n*i,M=f*A-h*d,T=f*m-u*d,I=h*m-u*A,w=t*I-r*T+n*M,L=o*I-i*T+a*M,x=f*C-h*y+u*E,g=d*C-A*y+m*E;return c*w-s*L+p*x-l*g}function Rn(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],c=t[5],f=t[6],h=t[7],u=t[8],l=t[9],d=t[10],A=t[11],m=t[12],p=t[13],E=t[14],y=t[15],C=r[0],M=r[1],T=r[2],I=r[3];return e[0]=C*n+M*a+T*u+I*m,e[1]=C*s+M*c+T*l+I*p,e[2]=C*o+M*f+T*d+I*E,e[3]=C*i+M*h+T*A+I*y,C=r[4],M=r[5],T=r[6],I=r[7],e[4]=C*n+M*a+T*u+I*m,e[5]=C*s+M*c+T*l+I*p,e[6]=C*o+M*f+T*d+I*E,e[7]=C*i+M*h+T*A+I*y,C=r[8],M=r[9],T=r[10],I=r[11],e[8]=C*n+M*a+T*u+I*m,e[9]=C*s+M*c+T*l+I*p,e[10]=C*o+M*f+T*d+I*E,e[11]=C*i+M*h+T*A+I*y,C=r[12],M=r[13],T=r[14],I=r[15],e[12]=C*n+M*a+T*u+I*m,e[13]=C*s+M*c+T*l+I*p,e[14]=C*o+M*f+T*d+I*E,e[15]=C*i+M*h+T*A+I*y,e}function Fi(e,t,r){let n=r[0],s=r[1],o=r[2],i,a,c,f,h,u,l,d,A,m,p,E;return t===e?(e[12]=t[0]*n+t[4]*s+t[8]*o+t[12],e[13]=t[1]*n+t[5]*s+t[9]*o+t[13],e[14]=t[2]*n+t[6]*s+t[10]*o+t[14],e[15]=t[3]*n+t[7]*s+t[11]*o+t[15]):(i=t[0],a=t[1],c=t[2],f=t[3],h=t[4],u=t[5],l=t[6],d=t[7],A=t[8],m=t[9],p=t[10],E=t[11],e[0]=i,e[1]=a,e[2]=c,e[3]=f,e[4]=h,e[5]=u,e[6]=l,e[7]=d,e[8]=A,e[9]=m,e[10]=p,e[11]=E,e[12]=i*n+h*s+A*o+t[12],e[13]=a*n+u*s+m*o+t[13],e[14]=c*n+l*s+p*o+t[14],e[15]=f*n+d*s+E*o+t[15]),e}function Di(e,t,r){let n=r[0],s=r[1],o=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*s,e[5]=t[5]*s,e[6]=t[6]*s,e[7]=t[7]*s,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Li(e,t,r,n){let s=n[0],o=n[1],i=n[2],a=Math.sqrt(s*s+o*o+i*i),c,f,h,u,l,d,A,m,p,E,y,C,M,T,I,w,L,x,g,B,_,U,G,P;return a<1e-6?null:(a=1/a,s*=a,o*=a,i*=a,f=Math.sin(r),c=Math.cos(r),h=1-c,u=t[0],l=t[1],d=t[2],A=t[3],m=t[4],p=t[5],E=t[6],y=t[7],C=t[8],M=t[9],T=t[10],I=t[11],w=s*s*h+c,L=o*s*h+i*f,x=i*s*h-o*f,g=s*o*h-i*f,B=o*o*h+c,_=i*o*h+s*f,U=s*i*h+o*f,G=o*i*h-s*f,P=i*i*h+c,e[0]=u*w+m*L+C*x,e[1]=l*w+p*L+M*x,e[2]=d*w+E*L+T*x,e[3]=A*w+y*L+I*x,e[4]=u*g+m*B+C*_,e[5]=l*g+p*B+M*_,e[6]=d*g+E*B+T*_,e[7]=A*g+y*B+I*_,e[8]=u*U+m*G+C*P,e[9]=l*U+p*G+M*P,e[10]=d*U+E*G+T*P,e[11]=A*U+y*G+I*P,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function Oi(e,t,r){let n=Math.sin(r),s=Math.cos(r),o=t[4],i=t[5],a=t[6],c=t[7],f=t[8],h=t[9],u=t[10],l=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*s+f*n,e[5]=i*s+h*n,e[6]=a*s+u*n,e[7]=c*s+l*n,e[8]=f*s-o*n,e[9]=h*s-i*n,e[10]=u*s-a*n,e[11]=l*s-c*n,e}function vi(e,t,r){let n=Math.sin(r),s=Math.cos(r),o=t[0],i=t[1],a=t[2],c=t[3],f=t[8],h=t[9],u=t[10],l=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*s-f*n,e[1]=i*s-h*n,e[2]=a*s-u*n,e[3]=c*s-l*n,e[8]=o*n+f*s,e[9]=i*n+h*s,e[10]=a*n+u*s,e[11]=c*n+l*s,e}function Ni(e,t,r){let n=Math.sin(r),s=Math.cos(r),o=t[0],i=t[1],a=t[2],c=t[3],f=t[4],h=t[5],u=t[6],l=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*s+f*n,e[1]=i*s+h*n,e[2]=a*s+u*n,e[3]=c*s+l*n,e[4]=f*s-o*n,e[5]=h*s-i*n,e[6]=u*s-a*n,e[7]=l*s-c*n,e}function UA(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function PA(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function HA(e,t,r){let n=r[0],s=r[1],o=r[2],i=Math.sqrt(n*n+s*s+o*o),a,c,f;return i<1e-6?null:(i=1/i,n*=i,s*=i,o*=i,c=Math.sin(t),a=Math.cos(t),f=1-a,e[0]=n*n*f+a,e[1]=s*n*f+o*c,e[2]=o*n*f-s*c,e[3]=0,e[4]=n*s*f-o*c,e[5]=s*s*f+a,e[6]=o*s*f+n*c,e[7]=0,e[8]=n*o*f+s*c,e[9]=s*o*f-n*c,e[10]=o*o*f+a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function kA(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function zA(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function JA(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function dh(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=n+n,c=s+s,f=o+o,h=n*a,u=n*c,l=n*f,d=s*c,A=s*f,m=o*f,p=i*a,E=i*c,y=i*f;return e[0]=1-(d+m),e[1]=u+y,e[2]=l-E,e[3]=0,e[4]=u-y,e[5]=1-(h+m),e[6]=A+p,e[7]=0,e[8]=l+E,e[9]=A-p,e[10]=1-(h+d),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function QA(e,t){let r=new W(3),n=-t[0],s=-t[1],o=-t[2],i=t[3],a=t[4],c=t[5],f=t[6],h=t[7],u=n*n+s*s+o*o+i*i;return u>0?(r[0]=(a*i+h*n+c*o-f*s)*2/u,r[1]=(c*i+h*s+f*n-a*o)*2/u,r[2]=(f*i+h*o+a*s-c*n)*2/u):(r[0]=(a*i+h*n+c*o-f*s)*2,r[1]=(c*i+h*s+f*n-a*o)*2,r[2]=(f*i+h*o+a*s-c*n)*2),dh(e,t,r),e}function VA(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function Ah(e,t){let r=t[0],n=t[1],s=t[2],o=t[4],i=t[5],a=t[6],c=t[8],f=t[9],h=t[10];return e[0]=Math.sqrt(r*r+n*n+s*s),e[1]=Math.sqrt(o*o+i*i+a*a),e[2]=Math.sqrt(c*c+f*f+h*h),e}function jA(e,t){let r=new W(3);Ah(r,t);let n=1/r[0],s=1/r[1],o=1/r[2],i=t[0]*n,a=t[1]*s,c=t[2]*o,f=t[4]*n,h=t[5]*s,u=t[6]*o,l=t[8]*n,d=t[9]*s,A=t[10]*o,m=i+h+A,p=0;return m>0?(p=Math.sqrt(m+1)*2,e[3]=.25*p,e[0]=(u-d)/p,e[1]=(l-c)/p,e[2]=(a-f)/p):i>h&&i>A?(p=Math.sqrt(1+i-h-A)*2,e[3]=(u-d)/p,e[0]=.25*p,e[1]=(a+f)/p,e[2]=(l+c)/p):h>A?(p=Math.sqrt(1+h-i-A)*2,e[3]=(l-c)/p,e[0]=(a+f)/p,e[1]=.25*p,e[2]=(u+d)/p):(p=Math.sqrt(1+A-i-h)*2,e[3]=(a-f)/p,e[0]=(l+c)/p,e[1]=(u+d)/p,e[2]=.25*p),e}function KA(e,t,r,n){t[0]=n[12],t[1]=n[13],t[2]=n[14];let s=n[0],o=n[1],i=n[2],a=n[4],c=n[5],f=n[6],h=n[8],u=n[9],l=n[10];r[0]=Math.sqrt(s*s+o*o+i*i),r[1]=Math.sqrt(a*a+c*c+f*f),r[2]=Math.sqrt(h*h+u*u+l*l);let d=1/r[0],A=1/r[1],m=1/r[2],p=s*d,E=o*A,y=i*m,C=a*d,M=c*A,T=f*m,I=h*d,w=u*A,L=l*m,x=p+M+L,g=0;return x>0?(g=Math.sqrt(x+1)*2,e[3]=.25*g,e[0]=(T-w)/g,e[1]=(I-y)/g,e[2]=(E-C)/g):p>M&&p>L?(g=Math.sqrt(1+p-M-L)*2,e[3]=(T-w)/g,e[0]=.25*g,e[1]=(E+C)/g,e[2]=(I+y)/g):M>L?(g=Math.sqrt(1+M-p-L)*2,e[3]=(I-y)/g,e[0]=(E+C)/g,e[1]=.25*g,e[2]=(T+w)/g):(g=Math.sqrt(1+L-p-M)*2,e[3]=(E-C)/g,e[0]=(I+y)/g,e[1]=(T+w)/g,e[2]=.25*g),e}function XA(e,t,r,n){let s=t[0],o=t[1],i=t[2],a=t[3],c=s+s,f=o+o,h=i+i,u=s*c,l=s*f,d=s*h,A=o*f,m=o*h,p=i*h,E=a*c,y=a*f,C=a*h,M=n[0],T=n[1],I=n[2];return e[0]=(1-(A+p))*M,e[1]=(l+C)*M,e[2]=(d-y)*M,e[3]=0,e[4]=(l-C)*T,e[5]=(1-(u+p))*T,e[6]=(m+E)*T,e[7]=0,e[8]=(d+y)*I,e[9]=(m-E)*I,e[10]=(1-(u+A))*I,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function YA(e,t,r,n,s){let o=t[0],i=t[1],a=t[2],c=t[3],f=o+o,h=i+i,u=a+a,l=o*f,d=o*h,A=o*u,m=i*h,p=i*u,E=a*u,y=c*f,C=c*h,M=c*u,T=n[0],I=n[1],w=n[2],L=s[0],x=s[1],g=s[2],B=(1-(m+E))*T,_=(d+M)*T,U=(A-C)*T,G=(d-M)*I,P=(1-(l+E))*I,v=(p+y)*I,at=(A+C)*w,mt=(p-y)*w,X=(1-(l+m))*w;return e[0]=B,e[1]=_,e[2]=U,e[3]=0,e[4]=G,e[5]=P,e[6]=v,e[7]=0,e[8]=at,e[9]=mt,e[10]=X,e[11]=0,e[12]=r[0]+L-(B*L+G*x+at*g),e[13]=r[1]+x-(_*L+P*x+mt*g),e[14]=r[2]+g-(U*L+v*x+X*g),e[15]=1,e}function Gi(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=r+r,a=n+n,c=s+s,f=r*i,h=n*i,u=n*a,l=s*i,d=s*a,A=s*c,m=o*i,p=o*a,E=o*c;return e[0]=1-u-A,e[1]=h+E,e[2]=l-p,e[3]=0,e[4]=h-E,e[5]=1-f-A,e[6]=d+m,e[7]=0,e[8]=l+p,e[9]=d-m,e[10]=1-f-u,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Ui(e,t,r,n,s,o,i){let a=1/(r-t),c=1/(s-n),f=1/(o-i);return e[0]=o*2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o*2*c,e[6]=0,e[7]=0,e[8]=(r+t)*a,e[9]=(s+n)*c,e[10]=(i+o)*f,e[11]=-1,e[12]=0,e[13]=0,e[14]=i*o*2*f,e[15]=0,e}function mh(e,t,r,n,s){let o=1/Math.tan(t/2);if(e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,s!=null&&s!==1/0){let i=1/(n-s);e[10]=(s+n)*i,e[14]=2*s*n*i}else e[10]=-1,e[14]=-2*n;return e}var Pi=mh;function ZA(e,t,r,n,s){let o=1/Math.tan(t/2);if(e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,s!=null&&s!==1/0){let i=1/(n-s);e[10]=s*i,e[14]=s*n*i}else e[10]=-1,e[14]=-n;return e}function qA(e,t,r,n){let s=Math.tan(t.upDegrees*Math.PI/180),o=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),a=Math.tan(t.rightDegrees*Math.PI/180),c=2/(i+a),f=2/(s+o);return e[0]=c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=f,e[6]=0,e[7]=0,e[8]=-((i-a)*c*.5),e[9]=(s-o)*f*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e}function ph(e,t,r,n,s,o,i){let a=1/(t-r),c=1/(n-s),f=1/(o-i);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*f,e[11]=0,e[12]=(t+r)*a,e[13]=(s+n)*c,e[14]=(i+o)*f,e[15]=1,e}var Hi=ph;function WA(e,t,r,n,s,o,i){let a=1/(t-r),c=1/(n-s),f=1/(o-i);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=f,e[11]=0,e[12]=(t+r)*a,e[13]=(s+n)*c,e[14]=o*f,e[15]=1,e}function ki(e,t,r,n){let s,o,i,a,c,f,h,u,l,d,A=t[0],m=t[1],p=t[2],E=n[0],y=n[1],C=n[2],M=r[0],T=r[1],I=r[2];return Math.abs(A-M)<1e-6&&Math.abs(m-T)<1e-6&&Math.abs(p-I)<1e-6?uh(e):(u=A-M,l=m-T,d=p-I,s=1/Math.sqrt(u*u+l*l+d*d),u*=s,l*=s,d*=s,o=y*d-C*l,i=C*u-E*d,a=E*l-y*u,s=Math.sqrt(o*o+i*i+a*a),s?(s=1/s,o*=s,i*=s,a*=s):(o=0,i=0,a=0),c=l*a-d*i,f=d*o-u*a,h=u*i-l*o,s=Math.sqrt(c*c+f*f+h*h),s?(s=1/s,c*=s,f*=s,h*=s):(c=0,f=0,h=0),e[0]=o,e[1]=c,e[2]=u,e[3]=0,e[4]=i,e[5]=f,e[6]=l,e[7]=0,e[8]=a,e[9]=h,e[10]=d,e[11]=0,e[12]=-(o*A+i*m+a*p),e[13]=-(c*A+f*m+h*p),e[14]=-(u*A+l*m+d*p),e[15]=1,e)}function $A(e,t,r,n){let s=t[0],o=t[1],i=t[2],a=n[0],c=n[1],f=n[2],h=s-r[0],u=o-r[1],l=i-r[2],d=h*h+u*u+l*l;d>0&&(d=1/Math.sqrt(d),h*=d,u*=d,l*=d);let A=c*l-f*u,m=f*h-a*l,p=a*u-c*h;return d=A*A+m*m+p*p,d>0&&(d=1/Math.sqrt(d),A*=d,m*=d,p*=d),e[0]=A,e[1]=m,e[2]=p,e[3]=0,e[4]=u*p-l*m,e[5]=l*A-h*p,e[6]=h*m-u*A,e[7]=0,e[8]=h,e[9]=u,e[10]=l,e[11]=0,e[12]=s,e[13]=o,e[14]=i,e[15]=1,e}function tm(e){return`mat4(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]}, ${e[4]}, ${e[5]}, ${e[6]}, ${e[7]}, ${e[8]}, ${e[9]}, ${e[10]}, ${e[11]}, ${e[12]}, ${e[13]}, ${e[14]}, ${e[15]})`}function em(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}function rm(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e[9]=t[9]+r[9],e[10]=t[10]+r[10],e[11]=t[11]+r[11],e[12]=t[12]+r[12],e[13]=t[13]+r[13],e[14]=t[14]+r[14],e[15]=t[15]+r[15],e}function gh(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e}function nm(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12]*r,e[13]=t[13]*r,e[14]=t[14]*r,e[15]=t[15]*r,e}function sm(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e[6]=t[6]+r[6]*n,e[7]=t[7]+r[7]*n,e[8]=t[8]+r[8]*n,e[9]=t[9]+r[9]*n,e[10]=t[10]+r[10]*n,e[11]=t[11]+r[11]*n,e[12]=t[12]+r[12]*n,e[13]=t[13]+r[13]*n,e[14]=t[14]+r[14]*n,e[15]=t[15]+r[15]*n,e}function om(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function im(e,t){let r=e[0],n=e[1],s=e[2],o=e[3],i=e[4],a=e[5],c=e[6],f=e[7],h=e[8],u=e[9],l=e[10],d=e[11],A=e[12],m=e[13],p=e[14],E=e[15],y=t[0],C=t[1],M=t[2],T=t[3],I=t[4],w=t[5],L=t[6],x=t[7],g=t[8],B=t[9],_=t[10],U=t[11],G=t[12],P=t[13],v=t[14],at=t[15];return Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(n-C)<=1e-6*Math.max(1,Math.abs(n),Math.abs(C))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(o-T)<=1e-6*Math.max(1,Math.abs(o),Math.abs(T))&&Math.abs(i-I)<=1e-6*Math.max(1,Math.abs(i),Math.abs(I))&&Math.abs(a-w)<=1e-6*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(c-L)<=1e-6*Math.max(1,Math.abs(c),Math.abs(L))&&Math.abs(f-x)<=1e-6*Math.max(1,Math.abs(f),Math.abs(x))&&Math.abs(h-g)<=1e-6*Math.max(1,Math.abs(h),Math.abs(g))&&Math.abs(u-B)<=1e-6*Math.max(1,Math.abs(u),Math.abs(B))&&Math.abs(l-_)<=1e-6*Math.max(1,Math.abs(l),Math.abs(_))&&Math.abs(d-U)<=1e-6*Math.max(1,Math.abs(d),Math.abs(U))&&Math.abs(A-G)<=1e-6*Math.max(1,Math.abs(A),Math.abs(G))&&Math.abs(m-P)<=1e-6*Math.max(1,Math.abs(m),Math.abs(P))&&Math.abs(p-v)<=1e-6*Math.max(1,Math.abs(p),Math.abs(v))&&Math.abs(E-at)<=1e-6*Math.max(1,Math.abs(E),Math.abs(at))}var am=Rn,cm=gh;function fm(){let e=new W(4);return W!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function xh(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}function Bh(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function Eh(e){let t=e[0],r=e[1],n=e[2],s=e[3];return Math.sqrt(t*t+r*r+n*n+s*s)}function _h(e){let t=e[0],r=e[1],n=e[2],s=e[3];return t*t+r*r+n*n+s*s}function yh(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=r*r+n*n+s*s+o*o;return i>0&&(i=1/Math.sqrt(i)),e[0]=r*i,e[1]=n*i,e[2]=s*i,e[3]=o*i,e}function Th(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function Ch(e,t,r,n){let s=t[0],o=t[1],i=t[2],a=t[3];return e[0]=s+n*(r[0]-s),e[1]=o+n*(r[1]-o),e[2]=i+n*(r[2]-i),e[3]=a+n*(r[3]-a),e}function Mh(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3];return e[0]=r[0]*n+r[4]*s+r[8]*o+r[12]*i,e[1]=r[1]*n+r[5]*s+r[9]*o+r[13]*i,e[2]=r[2]*n+r[6]*s+r[10]*o+r[14]*i,e[3]=r[3]*n+r[7]*s+r[11]*o+r[15]*i,e}function bh(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[0],a=r[1],c=r[2],f=r[3],h=f*n+a*o-c*s,u=f*s+c*n-i*o,l=f*o+i*s-a*n,d=-i*n-a*s-c*o;return e[0]=h*f+d*-i+u*-c-l*-a,e[1]=u*f+d*-a+l*-i-h*-c,e[2]=l*f+d*-c+h*-a-u*-i,e[3]=t[3],e}var ob=function(){let e=fm();return function(t,r,n,s,o,i){let a,c;for(r||(r=4),n||(n=0),s?c=Math.min(s*r+n,t.length):c=t.length,a=n;a<c;a+=r)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],e[3]=t[a+3],o(e,e,i),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2],t[a+3]=e[3];return t}}();var Qi;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL0ROW3=3]="COL0ROW3",e[e.COL1ROW0=4]="COL1ROW0",e[e.COL1ROW1=5]="COL1ROW1",e[e.COL1ROW2=6]="COL1ROW2",e[e.COL1ROW3=7]="COL1ROW3",e[e.COL2ROW0=8]="COL2ROW0",e[e.COL2ROW1=9]="COL2ROW1",e[e.COL2ROW2=10]="COL2ROW2",e[e.COL2ROW3=11]="COL2ROW3",e[e.COL3ROW0=12]="COL3ROW0",e[e.COL3ROW1=13]="COL3ROW1",e[e.COL3ROW2=14]="COL3ROW2",e[e.COL3ROW3=15]="COL3ROW3"})(Qi||(Qi={}));var lm=45*Math.PI/180,um=1,zi=.1,Ji=500,dm=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Rt=class extends vr{static get IDENTITY(){return mm()}static get ZERO(){return Am()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return Qi}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,r,n,s,o,i,a,c,f,h,u,l,d,A,m,p){return this[0]=t,this[1]=r,this[2]=n,this[3]=s,this[4]=o,this[5]=i,this[6]=a,this[7]=c,this[8]=f,this[9]=h,this[10]=u,this[11]=l,this[12]=d,this[13]=A,this[14]=m,this[15]=p,this.check()}setRowMajor(t,r,n,s,o,i,a,c,f,h,u,l,d,A,m,p){return this[0]=t,this[1]=o,this[2]=f,this[3]=d,this[4]=r,this[5]=i,this[6]=h,this[7]=A,this[8]=n,this[9]=a,this[10]=u,this[11]=m,this[12]=s,this[13]=c,this[14]=l,this[15]=p,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(dm)}fromObject(t){return this.check()}fromQuaternion(t){return Gi(this,t),this.check()}frustum(t){let{left:r,right:n,bottom:s,top:o,near:i=zi,far:a=Ji}=t;return a===1/0?pm(this,r,n,s,o,i):Ui(this,r,n,s,o,i,a),this.check()}lookAt(t){let{eye:r,center:n=[0,0,0],up:s=[0,1,0]}=t;return ki(this,r,n,s),this.check()}ortho(t){let{left:r,right:n,bottom:s,top:o,near:i=zi,far:a=Ji}=t;return Hi(this,r,n,s,o,i,a),this.check()}orthographic(t){let{fovy:r=lm,aspect:n=um,focalDistance:s=1,near:o=zi,far:i=Ji}=t;wh(r);let a=r/2,c=s*Math.tan(a),f=c*n;return this.ortho({left:-f,right:f,bottom:-c,top:c,near:o,far:i})}perspective(t){let{fovy:r=45*Math.PI/180,aspect:n=1,near:s=.1,far:o=500}=t;return wh(r),Pi(this,r,n,s,o),this.check()}determinant(){return Ri(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),s=1/n[0],o=1/n[1],i=1/n[2];return t[0]=this[0]*s,t[1]=this[1]*o,t[2]=this[2]*i,t[3]=0,t[4]=this[4]*s,t[5]=this[5]*o,t[6]=this[6]*i,t[7]=0,t[8]=this[8]*s,t[9]=this[9]*o,t[10]=this[10]*i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),s=1/n[0],o=1/n[1],i=1/n[2];return t[0]=this[0]*s,t[1]=this[1]*o,t[2]=this[2]*i,t[3]=this[4]*s,t[4]=this[5]*o,t[5]=this[6]*i,t[6]=this[8]*s,t[7]=this[9]*o,t[8]=this[10]*i,t}transpose(){return Ii(this,this),this.check()}invert(){return Si(this,this),this.check()}multiplyLeft(t){return Rn(this,t,this),this.check()}multiplyRight(t){return Rn(this,this,t),this.check()}rotateX(t){return Oi(this,this,t),this.check()}rotateY(t){return vi(this,this,t),this.check()}rotateZ(t){return Ni(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,r){return Li(this,this,t,r),this.check()}scale(t){return Di(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return Fi(this,this,t),this.check()}transform(t,r){return t.length===4?(r=Mh(r||[-0,-0,-0,-0],t,this),we(r,4),r):this.transformAsPoint(t,r)}transformAsPoint(t,r){let{length:n}=t,s;switch(n){case 2:s=Xf(r||[-0,-0],t,this);break;case 3:s=je(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return we(s,t.length),s}transformAsVector(t,r){let n;switch(t.length){case 2:n=Yf(r||[-0,-0],t,this);break;case 3:n=Ss(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return we(n,t.length),n}transformPoint(t,r){return this.transformAsPoint(t,r)}transformVector(t,r){return this.transformAsPoint(t,r)}transformDirection(t,r){return this.transformAsVector(t,r)}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,r,n){return this.identity().translate([t,r,n])}},Gs,Us;function Am(){return Gs||(Gs=new Rt([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Gs)),Gs}function mm(){return Us||(Us=new Rt,Object.freeze(Us)),Us}function wh(e){if(e>Math.PI*2)throw Error("expected radians")}function pm(e,t,r,n,s,o){let i=2*o/(r-t),a=2*o/(s-n),c=(r+t)/(r-t),f=(s+n)/(s-n),h=-1,u=-1,l=-2*o;return e[0]=i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=c,e[9]=f,e[10]=h,e[11]=u,e[12]=0,e[13]=0,e[14]=l,e[15]=0,e}function Ih(){let e=new W(4);return W!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Sh(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function Vi(e,t,r){r=r*.5;let n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e}function ji(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=r[0],c=r[1],f=r[2],h=r[3];return e[0]=n*h+i*a+s*f-o*c,e[1]=s*h+i*c+o*a-n*f,e[2]=o*h+i*f+n*c-s*a,e[3]=i*h-n*a-s*c-o*f,e}function Rh(e,t,r){r*=.5;let n=t[0],s=t[1],o=t[2],i=t[3],a=Math.sin(r),c=Math.cos(r);return e[0]=n*c+i*a,e[1]=s*c+o*a,e[2]=o*c-s*a,e[3]=i*c-n*a,e}function Fh(e,t,r){r*=.5;let n=t[0],s=t[1],o=t[2],i=t[3],a=Math.sin(r),c=Math.cos(r);return e[0]=n*c-o*a,e[1]=s*c+i*a,e[2]=o*c+n*a,e[3]=i*c-s*a,e}function Dh(e,t,r){r*=.5;let n=t[0],s=t[1],o=t[2],i=t[3],a=Math.sin(r),c=Math.cos(r);return e[0]=n*c+s*a,e[1]=s*c-n*a,e[2]=o*c+i*a,e[3]=i*c-o*a,e}function Lh(e,t){let r=t[0],n=t[1],s=t[2];return e[0]=r,e[1]=n,e[2]=s,e[3]=Math.sqrt(Math.abs(1-r*r-n*n-s*s)),e}function Dn(e,t,r,n){let s=t[0],o=t[1],i=t[2],a=t[3],c=r[0],f=r[1],h=r[2],u=r[3],l,d,A,m,p;return l=s*c+o*f+i*h+a*u,l<0&&(l=-l,c=-c,f=-f,h=-h,u=-u),1-l>1e-6?(d=Math.acos(l),p=Math.sin(d),A=Math.sin((1-n)*d)/p,m=Math.sin(n*d)/p):(A=1-n,m=n),e[0]=A*s+m*c,e[1]=A*o+m*f,e[2]=A*i+m*h,e[3]=A*a+m*u,e}function Oh(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=r*r+n*n+s*s+o*o,a=i?1/i:0;return e[0]=-r*a,e[1]=-n*a,e[2]=-s*a,e[3]=o*a,e}function vh(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function Ki(e,t){let r=t[0]+t[4]+t[8],n;if(r>0)n=Math.sqrt(r+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{let s=0;t[4]>t[0]&&(s=1),t[8]>t[s*3+s]&&(s=2);let o=(s+1)%3,i=(s+2)%3;n=Math.sqrt(t[s*3+s]-t[o*3+o]-t[i*3+i]+1),e[s]=.5*n,n=.5/n,e[3]=(t[o*3+i]-t[i*3+o])*n,e[o]=(t[o*3+s]+t[s*3+o])*n,e[i]=(t[i*3+s]+t[s*3+i])*n}return e}var Nh=xh;var Gh=Bh,Uh=Th,Ph=Ch,Hh=Eh;var kh=_h;var zh=yh;var Jh=function(){let e=Fs(),t=Ds(1,0,0),r=Ds(0,1,0);return function(n,s,o){let i=wn(s,o);return i<-.999999?(Ve(e,t,s),Ti(e)<1e-6&&Ve(e,r,s),xi(e,e),Vi(n,e,Math.PI),n):i>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Ve(e,s,o),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=1+i,zh(n,n))}}(),Bb=function(){let e=Ih(),t=Ih();return function(r,n,s,o,i,a){return Dn(e,n,i,a),Dn(t,s,o,a),Dn(r,e,t,2*a*(1-a)),r}}(),Eb=function(){let e=oh();return function(t,r,n,s){return e[0]=n[0],e[3]=n[1],e[6]=n[2],e[1]=s[0],e[4]=s[1],e[7]=s[2],e[2]=-r[0],e[5]=-r[1],e[8]=-r[2],zh(t,Ki(t,e))}}();var gm=[0,0,0,1],Ie=class extends be{constructor(t=0,r=0,n=0,s=1){super(-0,-0,-0,-0),Array.isArray(t)&&arguments.length===1?this.copy(t):this.set(t,r,n,s)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}set(t,r,n,s){return this[0]=t,this[1]=r,this[2]=n,this[3]=s,this.check()}fromObject(t){return this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this.check()}fromMatrix3(t){return Ki(this,t),this.check()}fromAxisRotation(t,r){return Vi(this,t,r),this.check()}identity(){return Sh(this),this.check()}setAxisAngle(t,r){return this.fromAxisRotation(t,r)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=J(t)}get y(){return this[1]}set y(t){this[1]=J(t)}get z(){return this[2]}set z(t){this[2]=J(t)}get w(){return this[3]}set w(t){this[3]=J(t)}len(){return Hh(this)}lengthSquared(){return kh(this)}dot(t){return Uh(this,t)}rotationTo(t,r){return Jh(this,t,r),this.check()}add(t){return Nh(this,this,t),this.check()}calculateW(){return Lh(this,this),this.check()}conjugate(){return vh(this,this),this.check()}invert(){return Oh(this,this),this.check()}lerp(t,r,n){return n===void 0?this.lerp(this,t,r):(Ph(this,t,r,n),this.check())}multiplyRight(t){return ji(this,this,t),this.check()}multiplyLeft(t){return ji(this,t,this),this.check()}normalize(){let t=this.len(),r=t>0?1/t:0;return this[0]=this[0]*r,this[1]=this[1]*r,this[2]=this[2]*r,this[3]=this[3]*r,t===0&&(this[3]=1),this.check()}rotateX(t){return Rh(this,this,t),this.check()}rotateY(t){return Fh(this,this,t),this.check()}rotateZ(t){return Dh(this,this,t),this.check()}scale(t){return Gh(this,this,t),this.check()}slerp(t,r,n){let s,o,i;switch(arguments.length){case 1:({start:s=gm,target:o,ratio:i}=t);break;case 2:s=this,o=t,i=r;break;default:s=t,o=r,i=n}return Dn(this,s,o,i),this.check()}transformVector4(t,r=new Or){return bh(r,t,this),we(r,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,r){return this.setAxisAngle(t,r)}premultiply(t){return this.multiplyLeft(t)}multiply(t){return this.multiplyRight(t)}};var Ht={};ut(Ht,{EPSILON1:()=>xm,EPSILON10:()=>wm,EPSILON11:()=>Im,EPSILON12:()=>Sm,EPSILON13:()=>Rm,EPSILON14:()=>Fm,EPSILON15:()=>Dm,EPSILON16:()=>Lm,EPSILON17:()=>Om,EPSILON18:()=>vm,EPSILON19:()=>Nm,EPSILON2:()=>Bm,EPSILON20:()=>Gm,EPSILON3:()=>Em,EPSILON4:()=>_m,EPSILON5:()=>ym,EPSILON6:()=>Tm,EPSILON7:()=>Cm,EPSILON8:()=>Mm,EPSILON9:()=>bm,PI_OVER_FOUR:()=>Pm,PI_OVER_SIX:()=>Hm,PI_OVER_TWO:()=>Um,TWO_PI:()=>km});var xm=.1,Bm=.01,Em=.001,_m=1e-4,ym=1e-5,Tm=1e-6,Cm=1e-7,Mm=1e-8,bm=1e-9,wm=1e-10,Im=1e-11,Sm=1e-12,Rm=1e-13,Fm=1e-14,Dm=1e-15,Lm=1e-16,Om=1e-17,vm=1e-18,Nm=1e-19,Gm=1e-20,Um=Math.PI/2,Pm=Math.PI/4,Hm=Math.PI/6,km=Math.PI*2;var kt=class{json;buffer;featuresLength=0;_cachedTypedArrays={};constructor(t,r){this.json=t,this.buffer=r}getExtension(t){return this.json.extensions&&this.json.extensions[t]}hasProperty(t){return Boolean(this.json[t])}getGlobalProperty(t,r=H.UNSIGNED_INT,n=1){let s=this.json[t];return s&&Number.isFinite(s.byteOffset)?this._getTypedArrayFromBinary(t,r,n,1,s.byteOffset):s}getPropertyArray(t,r,n){let s=this.json[t];return s&&Number.isFinite(s.byteOffset)?("componentType"in s&&(r=dt.fromName(s.componentType)),this._getTypedArrayFromBinary(t,r,n,this.featuresLength,s.byteOffset)):this._getTypedArrayFromArray(t,r,s)}getProperty(t,r,n,s,o){let i=this.json[t];if(!i)return i;let a=this.getPropertyArray(t,r,n);if(n===1)return a[s];for(let c=0;c<n;++c)o[c]=a[n*s+c];return o}_getTypedArrayFromBinary(t,r,n,s,o){let i=this._cachedTypedArrays,a=i[t];return a||(a=dt.createTypedArray(r,this.buffer.buffer,this.buffer.byteOffset+o,s*n),i[t]=a),a}_getTypedArrayFromArray(t,r,n){let s=this._cachedTypedArrays,o=s[t];return o||(o=dt.createTypedArray(r,n),s[t]=o),o}};var zm={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Jm={SCALAR:(e,t)=>e[t],VEC2:(e,t)=>[e[2*t+0],e[2*t+1]],VEC3:(e,t)=>[e[3*t+0],e[3*t+1],e[3*t+2]],VEC4:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT2:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT3:(e,t)=>[e[9*t+0],e[9*t+1],e[9*t+2],e[9*t+3],e[9*t+4],e[9*t+5],e[9*t+6],e[9*t+7],e[9*t+8]],MAT4:(e,t)=>[e[16*t+0],e[16*t+1],e[16*t+2],e[16*t+3],e[16*t+4],e[16*t+5],e[16*t+6],e[16*t+7],e[16*t+8],e[16*t+9],e[16*t+10],e[16*t+11],e[16*t+12],e[16*t+13],e[16*t+14],e[16*t+15]]},Qm={SCALAR:(e,t,r)=>{t[r]=e},VEC2:(e,t,r)=>{t[2*r+0]=e[0],t[2*r+1]=e[1]},VEC3:(e,t,r)=>{t[3*r+0]=e[0],t[3*r+1]=e[1],t[3*r+2]=e[2]},VEC4:(e,t,r)=>{t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT2:(e,t,r)=>{t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT3:(e,t,r)=>{t[9*r+0]=e[0],t[9*r+1]=e[1],t[9*r+2]=e[2],t[9*r+3]=e[3],t[9*r+4]=e[4],t[9*r+5]=e[5],t[9*r+6]=e[6],t[9*r+7]=e[7],t[9*r+8]=e[8],t[9*r+9]=e[9]},MAT4:(e,t,r)=>{t[16*r+0]=e[0],t[16*r+1]=e[1],t[16*r+2]=e[2],t[16*r+3]=e[3],t[16*r+4]=e[4],t[16*r+5]=e[5],t[16*r+6]=e[6],t[16*r+7]=e[7],t[16*r+8]=e[8],t[16*r+9]=e[9],t[16*r+10]=e[10],t[16*r+11]=e[11],t[16*r+12]=e[12],t[16*r+13]=e[13],t[16*r+14]=e[14],t[16*r+15]=e[15]}};function Qh(e,t,r,n){let{componentType:s}=e;z(e.componentType);let o=typeof s=="string"?dt.fromName(s):s,i=zm[e.type],a=Jm[e.type],c=Qm[e.type];return r+=e.byteOffset,{values:dt.createTypedArray(o,t,r,i*n),type:o,size:i,unpacker:a,packer:c}}var te=e=>e!==void 0;function Vh(e,t,r){if(!t)return null;let n=e.getExtension("3DTILES_batch_table_hierarchy"),s=t.HIERARCHY;return s&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),t.extensions=t.extensions||{},t.extensions["3DTILES_batch_table_hierarchy"]=s,n=s),n?Vm(n,r):null}function Vm(e,t){let r,n,s,o=e.instancesLength,i=e.classes,a=e.classIds,c=e.parentCounts,f=e.parentIds,h=o;te(a.byteOffset)&&(a.componentType=defaultValue(a.componentType,GL.UNSIGNED_SHORT),a.type=AttributeType.SCALAR,s=getBinaryAccessor(a),a=s.createArrayBufferView(t.buffer,t.byteOffset+a.byteOffset,o));let u;if(te(c))for(te(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,s=getBinaryAccessor(c),c=s.createArrayBufferView(t.buffer,t.byteOffset+c.byteOffset,o)),u=new Uint16Array(o),h=0,r=0;r<o;++r)u[r]=h,h+=c[r];te(f)&&te(f.byteOffset)&&(f.componentType=defaultValue(f.componentType,GL.UNSIGNED_SHORT),f.type=AttributeType.SCALAR,s=getBinaryAccessor(f),f=s.createArrayBufferView(t.buffer,t.byteOffset+f.byteOffset,h));let l=i.length;for(r=0;r<l;++r){let p=i[r].length,E=i[r].instances,y=getBinaryProperties(p,E,t);i[r].instances=combine(y,E)}let d=new Array(l).fill(0),A=new Uint16Array(o);for(r=0;r<o;++r)n=a[r],A[r]=d[n],++d[n];let m={classes:i,classIds:a,classIndexes:A,parentCounts:c,parentIndexes:u,parentIds:f};return Xm(m),m}function Nr(e,t,r){if(!e)return;let n=e.parentCounts;return e.parentIds?r(e,t):n>0?jm(e,t,r):Km(e,t,r)}function jm(e,t,r){let n=e.classIds,s=e.parentCounts,o=e.parentIds,i=e.parentIndexes,a=n.length,c=scratchVisited;c.length=Math.max(c.length,a);let f=++marker,h=scratchStack;for(h.length=0,h.push(t);h.length>0;){if(t=h.pop(),c[t]===f)continue;c[t]=f;let u=r(e,t);if(te(u))return u;let l=s[t],d=i[t];for(let A=0;A<l;++A){let m=o[d+A];m!==t&&h.push(m)}}return null}function Km(e,t,r){let n=!0;for(;n;){let s=r(e,t);if(te(s))return s;let o=e.parentIds[t];n=o!==t,t=o}throw new Error("traverseHierarchySingleParent")}function Xm(e){let t=[],n=e.classIds.length;for(let s=0;s<n;++s)jh(e,s,stack)}function jh(e,t,r){let n=e.parentCounts,s=e.parentIds,o=e.parentIndexes,a=e.classIds.length;if(!te(s))return;assert(t<a,`Parent index ${t} exceeds the total number of instances: ${a}`),assert(r.indexOf(t)===-1,"Circular dependency detected in the batch table hierarchy."),r.push(t);let c=te(n)?n[t]:1,f=te(n)?o[t]:t;for(let h=0;h<c;++h){let u=s[f+h];u!==t&&jh(e,u,r)}r.pop(t)}function Tt(e){return e!=null}var Ps=(e,t)=>e,Ym={HIERARCHY:!0,extensions:!0,extras:!0},ue=class{json;binary;featureCount;_extensions;_properties;_binaryProperties;_hierarchy;constructor(t,r,n,s={}){z(n>=0),this.json=t||{},this.binary=r,this.featureCount=n,this._extensions=this.json?.extensions||{},this._properties={};for(let o in this.json)Ym[o]||(this._properties[o]=this.json[o]);this._binaryProperties=this._initializeBinaryProperties(),s["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=Vh(this,this.json,this.binary))}getExtension(t){return this.json&&this.json.extensions&&this.json.extensions[t]}memorySizeInBytes(){return 0}isClass(t,r){if(this._checkBatchId(t),z(typeof r=="string",r),this._hierarchy){let n=Nr(this._hierarchy,t,(s,o)=>{let i=s.classIds[o];return s.classes[i].name===r});return Tt(n)}return!1}isExactClass(t,r){return z(typeof r=="string",r),this.getExactClassName(t)===r}getExactClassName(t){if(this._checkBatchId(t),this._hierarchy){let r=this._hierarchy.classIds[t];return this._hierarchy.classes[r].name}}hasProperty(t,r){return this._checkBatchId(t),z(typeof r=="string",r),Tt(this._properties[r])||this._hasPropertyInHierarchy(t,r)}getPropertyNames(t,r){this._checkBatchId(t),r=Tt(r)?r:[],r.length=0;let n=Object.keys(this._properties);return r.push(...n),this._hierarchy&&this._getPropertyNamesInHierarchy(t,r),r}getProperty(t,r){if(this._checkBatchId(t),z(typeof r=="string",r),this._binaryProperties){let s=this._binaryProperties[r];if(Tt(s))return this._getBinaryProperty(s,t)}let n=this._properties[r];if(Tt(n))return Ps(n[t],!0);if(this._hierarchy){let s=this._getHierarchyProperty(t,r);if(Tt(s))return s}}setProperty(t,r,n){let s=this.featureCount;if(this._checkBatchId(t),z(typeof r=="string",r),this._binaryProperties){let i=this._binaryProperties[r];if(i){this._setBinaryProperty(i,t,n);return}}if(this._hierarchy&&this._setHierarchyProperty(this,t,r,n))return;let o=this._properties[r];Tt(o)||(this._properties[r]=new Array(s),o=this._properties[r]),o[t]=Ps(n,!0)}_checkBatchId(t){if(!(t>=0&&t<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(t,r){return t.unpack(t.typedArray,r)}_setBinaryProperty(t,r,n){t.pack(n,t.typedArray,r)}_initializeBinaryProperties(){let t=null;for(let r in this._properties){let n=this._properties[r],s=this._initializeBinaryProperty(r,n);s&&(t=t||{},t[r]=s)}return t}_initializeBinaryProperty(t,r){if("byteOffset"in r){let n=r;z(this.binary,`Property ${t} requires a batch table binary.`),z(n.type,`Property ${t} requires a type.`);let s=Qh(n,this.binary.buffer,this.binary.byteOffset|0,this.featureCount);return{typedArray:s.values,componentCount:s.size,unpack:s.unpacker,pack:s.packer}}return null}_hasPropertyInHierarchy(t,r){if(!this._hierarchy)return!1;let n=Nr(this._hierarchy,t,(s,o)=>{let i=s.classIds[o],a=s.classes[i].instances;return Tt(a[r])});return Tt(n)}_getPropertyNamesInHierarchy(t,r){Nr(this._hierarchy,t,(n,s)=>{let o=n.classIds[s],i=n.classes[o].instances;for(let a in i)i.hasOwnProperty(a)&&r.indexOf(a)===-1&&r.push(a)})}_getHierarchyProperty(t,r){return Nr(this._hierarchy,t,(n,s)=>{let o=n.classIds[s],i=n.classes[o],a=n.classIndexes[s],c=i.instances[r];return Tt(c)?Tt(c.typedArray)?this._getBinaryProperty(c,a):Ps(c[a],!0):null})}_setHierarchyProperty(t,r,n,s){let o=Nr(this._hierarchy,r,(i,a)=>{let c=i.classIds[a],f=i.classes[c],h=i.classIndexes[a],u=f.instances[n];return Tt(u)?(z(a===r,`Inherited property "${n}" is read-only.`),Tt(u.typedArray)?this._setBinaryProperty(u,h,s):u[h]=Ps(s,!0),!0):!1});return Tt(o)}};function Se(e,t,r=0){let n=new DataView(t);if(e.magic=n.getUint32(r,!0),r+=4,e.version=n.getUint32(r,!0),r+=4,e.byteLength=n.getUint32(r,!0),r+=4,e.version!==1)throw new Error(`3D Tile Version ${e.version} not supported`);return r}var Gr=4,Kh="b3dm tile in legacy format.";function Ur(e,t,r){let n=new DataView(t),s;e.header=e.header||{};let o=n.getUint32(r,!0);r+=Gr;let i=n.getUint32(r,!0);r+=Gr;let a=n.getUint32(r,!0);r+=Gr;let c=n.getUint32(r,!0);return r+=Gr,a>=570425344?(r-=Gr*2,s=o,a=i,c=0,o=0,i=0,console.warn(Kh)):c>=570425344&&(r-=Gr,s=a,a=o,c=i,o=0,i=0,console.warn(Kh)),e.header.featureTableJsonByteLength=o,e.header.featureTableBinaryByteLength=i,e.header.batchTableJsonByteLength=a,e.header.batchTableBinaryByteLength=c,e.header.batchLength=s,r}function Pr(e,t,r,n){return r=Zm(e,t,r,n),r=qm(e,t,r,n),r}function Zm(e,t,r,n){let{featureTableJsonByteLength:s,featureTableBinaryByteLength:o,batchLength:i}=e.header||{};if(e.featureTableJson={BATCH_LENGTH:i||0},s&&s>0){let a=oi(t,r,s);e.featureTableJson=JSON.parse(a)}return r+=s||0,e.featureTableBinary=new Uint8Array(t,r,o),r+=o||0,r}function qm(e,t,r,n){let{batchTableJsonByteLength:s,batchTableBinaryByteLength:o}=e.header||{};if(s&&s>0){let i=oi(t,r,s);e.batchTableJson=JSON.parse(i),r+=s,o&&o>0&&(e.batchTableBinary=new Uint8Array(t,r,o),e.batchTableBinary=new Uint8Array(e.batchTableBinary),r+=o)}return r}function Xi(e,t,r){if(!t&&(!e||!e.batchIds||!r))return null;let{batchIds:n,isRGB565:s,pointCount:o=0}=e;if(n&&r){let i=new Uint8ClampedArray(o*3);for(let a=0;a<o;a++){let c=n[a],h=r.getProperty(c,"dimensions").map(u=>u*255);i[a*3]=h[0],i[a*3+1]=h[1],i[a*3+2]=h[2]}return{type:H.UNSIGNED_BYTE,value:i,size:3,normalized:!0}}if(t&&s){let i=new Uint8ClampedArray(o*3);for(let a=0;a<o;a++){let c=di(t[a]);i[a*3]=c[0],i[a*3+1]=c[1],i[a*3+2]=c[2]}return{type:H.UNSIGNED_BYTE,value:i,size:3,normalized:!0}}return t&&t.length===o*3?{type:H.UNSIGNED_BYTE,value:t,size:3,normalized:!0}:{type:H.UNSIGNED_BYTE,value:t||new Uint8ClampedArray,size:4,normalized:!0}}var Xh=new b;function Yh(e,t){if(!t)return null;if(e.isOctEncoded16P){let r=new Float32Array((e.pointsLength||0)*3);for(let n=0;n<(e.pointsLength||0);n++)Ai(t[n*2],t[n*2+1],Xh),Xh.toArray(r,n*3);return{type:H.FLOAT,size:2,value:r}}return{type:H.FLOAT,size:2,value:t}}function Zh(e,t,r){return e.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,Wm(e,t)):{type:H.UNSIGNED_SHORT,value:t,size:3,normalized:!0}:t}function Wm(e,t){let r=new b,n=new Float32Array(e.pointCount*3);for(let s=0;s<e.pointCount;s++)r.set(t[s*3],t[s*3+1],t[s*3+2]).scale(1/e.quantizedRange).multiply(e.quantizedVolumeScale).add(e.quantizedVolumeOffset).toArray(n,s*3);return n}async function qh(e,t,r,n,s){r=Se(e,t,r),r=Ur(e,t,r),r=Pr(e,t,r,n),$m(e);let{featureTable:o,batchTable:i}=tp(e);return await op(e,o,i,n,s),ep(e,o,n),rp(e,o,i),np(e,o),r}function $m(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}function tp(e){let t=new kt(e.featureTableJson,e.featureTableBinary),r=t.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(r))throw new Error("POINTS_LENGTH must be defined");t.featuresLength=r,e.featuresLength=r,e.pointsLength=r,e.pointCount=r,e.rtcCenter=t.getGlobalProperty("RTC_CENTER",H.FLOAT,3);let n=sp(e,t);return{featureTable:t,batchTable:n}}function ep(e,t,r){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.positions){if(t.hasProperty("POSITION"))e.attributes.positions=t.getPropertyArray("POSITION",H.FLOAT,3);else if(t.hasProperty("POSITION_QUANTIZED")){let n=t.getPropertyArray("POSITION_QUANTIZED",H.UNSIGNED_SHORT,3);if(e.isQuantized=!0,e.quantizedRange=(1<<16)-1,e.quantizedVolumeScale=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",H.FLOAT,3),!e.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(e.quantizedVolumeOffset=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",H.FLOAT,3),!e.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e.attributes.positions=Zh(e,n,r)}}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function rp(e,t,r){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.colors){let n=null;t.hasProperty("RGBA")?(n=t.getPropertyArray("RGBA",H.UNSIGNED_BYTE,4),e.isTranslucent=!0):t.hasProperty("RGB")?n=t.getPropertyArray("RGB",H.UNSIGNED_BYTE,3):t.hasProperty("RGB565")&&(n=t.getPropertyArray("RGB565",H.UNSIGNED_SHORT,1),e.isRGB565=!0),e.attributes.colors=Xi(e,n,r)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",H.UNSIGNED_BYTE,4))}function np(e,t){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.normals){let r=null;t.hasProperty("NORMAL")?r=t.getPropertyArray("NORMAL",H.FLOAT,3):t.hasProperty("NORMAL_OCT16P")&&(r=t.getPropertyArray("NORMAL_OCT16P",H.UNSIGNED_BYTE,2),e.isOctEncoded16P=!0),e.attributes.normals=Yh(e,r)}}function sp(e,t){let r=null;if(!e.batchIds&&t.hasProperty("BATCH_ID")&&(e.batchIds=t.getPropertyArray("BATCH_ID",H.UNSIGNED_SHORT,1),e.batchIds)){let n=t.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");let{batchTableJson:s,batchTableBinary:o}=e;r=new ue(s,o,n)}return r}async function op(e,t,r,n,s){let o,i,a,c=e.batchTableJson&&e.batchTableJson.extensions&&e.batchTableJson.extensions["3DTILES_draco_point_compression"];c&&(a=c.properties);let f=t.getExtension("3DTILES_draco_point_compression");if(f){i=f.properties;let u=f.byteOffset,l=f.byteLength;if(!i||!Number.isFinite(u)||!l)throw new Error("Draco properties, byteOffset, and byteLength must be defined");o=(e.featureTableBinary||[]).slice(u,u+l),e.hasPositions=Number.isFinite(i.POSITION),e.hasColors=Number.isFinite(i.RGB)||Number.isFinite(i.RGBA),e.hasNormals=Number.isFinite(i.NORMAL),e.hasBatchIds=Number.isFinite(i.BATCH_ID),e.isTranslucent=Number.isFinite(i.RGBA)}if(!o)return!0;let h={buffer:o,properties:{...i,...a},featureTableProperties:i,batchTableProperties:a,dequantizeInShader:!1};return await ip(e,h,n,s)}async function ip(e,t,r,n){if(!n)return;let s={...r,draco:{...r?.draco,extraAttributes:t.batchTableProperties||{}}};delete s["3d-tiles"];let o=await Pt(t.buffer,Is,s,n),i=o.attributes.POSITION&&o.attributes.POSITION.value,a=o.attributes.COLOR_0&&o.attributes.COLOR_0.value,c=o.attributes.NORMAL&&o.attributes.NORMAL.value,f=o.attributes.BATCH_ID&&o.attributes.BATCH_ID.value,h=i&&o.attributes.POSITION.value.quantization,u=c&&o.attributes.NORMAL.value.quantization;if(h){let d=o.POSITION.data.quantization,A=d.range;e.quantizedVolumeScale=new b(A,A,A),e.quantizedVolumeOffset=new b(d.minValues),e.quantizedRange=(1<<d.quantizationBits)-1,e.isQuantizedDraco=!0}u&&(e.octEncodedRange=(1<<o.NORMAL.data.quantization.quantizationBits)-1,e.isOctEncodedDraco=!0);let l={};if(t.batchTableProperties)for(let d of Object.keys(t.batchTableProperties))o.attributes[d]&&o.attributes[d].value&&(l[d.toLowerCase()]=o.attributes[d].value);e.attributes={positions:i,colors:Xi(e,a,void 0),normals:c,batchIds:f,...l}}var ra={};ut(ra,{decode:()=>Qp,name:()=>Jp});var Wh="4.3.0-alpha.1";var ap=globalThis.loaders?.parseImageNode,Yi=typeof Image<"u",Zi=typeof ImageBitmap<"u",cp=Boolean(ap),qi=Et?!0:cp;function $h(e){switch(e){case"auto":return Zi||Yi||qi;case"imagebitmap":return Zi;case"image":return Yi;case"data":return qi;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function tl(){if(Zi)return"imagebitmap";if(Yi)return"image";if(qi)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function el(e){let t=fp(e);if(!t)throw new Error("Not an image");return t}function Ln(e){switch(el(e)){case"data":return e;case"image":case"imagebitmap":let t=document.createElement("canvas"),r=t.getContext("2d");if(!r)throw new Error("getImageData");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function fp(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&e instanceof Image?"image":e&&typeof e=="object"&&e.data&&e.width&&e.height?"data":null}var hp=/^data:image\/svg\+xml/,lp=/\.svg((\?|#).*)?$/;function Hs(e){return e&&(hp.test(e)||lp.test(e))}function rl(e,t){if(Hs(t)){let n=new TextDecoder().decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(o){throw new Error(o.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return Wi(e,t)}function Wi(e,t){if(Hs(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function ks(e,t,r){let n=rl(e,r),s=self.URL||self.webkitURL,o=typeof n!="string"&&s.createObjectURL(n);try{return await up(o||n,t)}finally{o&&s.revokeObjectURL(o)}}async function up(e,t){let r=new Image;return r.src=e,t.image&&t.image.decode&&r.decode?(await r.decode(),r):await new Promise((n,s)=>{try{r.onload=()=>n(r),r.onerror=o=>{let i=o instanceof Error?o.message:"error";s(new Error(i))}}catch(o){s(o)}})}var dp={},nl=!0;async function sl(e,t,r){let n;Hs(r)?n=await ks(e,t,r):n=Wi(e,r);let s=t&&t.imagebitmap;return await Ap(n,s)}async function Ap(e,t=null){if((mp(t)||!nl)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),nl=!1}return await createImageBitmap(e)}function mp(e){for(let t in e||dp)return!1;return!0}function ol(e){return!Bp(e,"ftyp",4)||!(e[8]&96)?null:pp(e)}function pp(e){switch(gp(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function gp(e,t,r){return String.fromCharCode(...e.slice(t,r))}function xp(e){return[...e].map(t=>t.charCodeAt(0))}function Bp(e,t,r=0){let n=xp(t);for(let s=0;s<n.length;++s)if(n[s]!==e[s+r])return!1;return!0}var ee=!1,On=!0;function Xe(e){let t=vn(e);return _p(t)||Cp(t)||yp(t)||Tp(t)||Ep(t)}function Ep(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=ol(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function _p(e){let t=vn(e);return t.byteLength>=24&&t.getUint32(0,ee)===2303741511?{mimeType:"image/png",width:t.getUint32(16,ee),height:t.getUint32(20,ee)}:null}function yp(e){let t=vn(e);return t.byteLength>=10&&t.getUint32(0,ee)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,On),height:t.getUint16(8,On)}:null}function Tp(e){let t=vn(e);return t.byteLength>=14&&t.getUint16(0,ee)===16973&&t.getUint32(2,On)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,On),height:t.getUint32(22,On)}:null}function Cp(e){let t=vn(e);if(!(t.byteLength>=3&&t.getUint16(0,ee)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:s}=Mp(),o=2;for(;o+9<t.byteLength;){let i=t.getUint16(o,ee);if(s.has(i))return{mimeType:"image/jpeg",height:t.getUint16(o+5,ee),width:t.getUint16(o+7,ee)};if(!n.has(i))return null;o+=2,o+=t.getUint16(o,ee)}return null}function Mp(){let e=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)e.add(r);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function vn(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}async function il(e,t){let{mimeType:r}=Xe(e)||{},n=globalThis.loaders?.parseImageNode;return z(n),await n(e,r)}async function al(e,t,r){t=t||{};let s=(t.image||{}).type||"auto",{url:o}=r||{},i=bp(s),a;switch(i){case"imagebitmap":a=await sl(e,t,o);break;case"image":a=await ks(e,t,o);break;case"data":a=await il(e,t);break;default:z(!1)}return s==="data"&&(a=Ln(a)),a}function bp(e){switch(e){case"auto":case"data":return tl();default:return $h(e),e}}var wp=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],Ip=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],Sp={image:{type:"auto",decode:!0}},$i={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:Wh,mimeTypes:Ip,extensions:wp,parse:al,tests:[e=>Boolean(Xe(new DataView(e)))],options:Sp};var ta={};function ea(e){if(ta[e]===void 0){let t=Et?Fp(e):Rp(e);ta[e]=t}return ta[e]}function Rp(e){let t=["image/png","image/jpeg","image/gif"],r=globalThis.loaders?.imageFormatsNode||t,n=globalThis.loaders?.parseImageNode;return Boolean(n)&&r.includes(e)}function Fp(e){switch(e){case"image/avif":case"image/webp":return Dp(e);default:return!0}}function Dp(e){try{return document.createElement("canvas").toDataURL(e).indexOf(`data:${e}`)===0}catch{return!1}}function ot(e,t){if(!e)throw new Error(t||"assert failed: gltf")}var zs={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Js={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};var Lp=1.33,cl=["SCALAR","VEC2","VEC3","VEC4"],Op=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],vp=new Map(Op),Np={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Gp={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Up={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Qs(e){return cl[e-1]||cl[0]}function Hr(e){let t=vp.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function kr(e,t){let r=Up[e.componentType],n=Np[e.type],s=Gp[e.componentType],o=e.count*n,i=e.count*n*s;ot(i>=0&&i<=t.byteLength);let a=Js[e.componentType],c=zs[e.type];return{ArrayType:r,length:o,byteLength:i,componentByteSize:a,numberOfComponentsInElement:c}}function Nn(e){let{images:t,bufferViews:r}=e;t=t||[],r=r||[];let n=t.map(i=>i.bufferView);r=r.filter(i=>!n.includes(i));let s=r.reduce((i,a)=>i+a.byteLength,0),o=t.reduce((i,a)=>{let{width:c,height:f}=a.image;return i+c*f},0);return s+Math.ceil(4*o*Lp)}function fl(e,t,r){let n=e.bufferViews[r];ot(n);let s=n.buffer,o=t[s];ot(o);let i=(n.byteOffset||0)+o.byteOffset;return new Uint8Array(o.arrayBuffer,i,n.byteLength)}function hl(e,t,r){let n=typeof r=="number"?e.accessors?.[r]:r;if(!n)throw new Error(`No gltf accessor ${JSON.stringify(r)}`);let s=e.bufferViews?.[n.bufferView||0];if(!s)throw new Error(`No gltf buffer view for accessor ${s}`);let{arrayBuffer:o,byteOffset:i}=t[s.buffer],a=(i||0)+(n.byteOffset||0)+(s.byteOffset||0),{ArrayType:c,length:f,componentByteSize:h,numberOfComponentsInElement:u}=kr(n,s),l=h*u,d=s.byteStride||l;if(typeof s.byteStride>"u"||s.byteStride===l)return new c(o,a,f);let A=new c(f);for(let m=0;m<n.count;m++){let p=new c(o,a+m*d,u);A.set(p,m*u)}return A}function Pp(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}var K=class{gltf;sourceBuffers;byteLength;constructor(t){this.gltf={json:t?.json||Pp(),buffers:t?.buffers||[],images:t?.images||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(t){return this.json[t]}getExtraData(t){return(this.json.extras||{})[t]}hasExtension(t){let r=this.getUsedExtensions().find(s=>s===t),n=this.getRequiredExtensions().find(s=>s===t);return typeof r=="string"||typeof n=="string"}getExtension(t){let r=this.getUsedExtensions().find(s=>s===t),n=this.json.extensions||{};return r?n[t]:null}getRequiredExtension(t){return this.getRequiredExtensions().find(n=>n===t)?this.getExtension(t):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(t,r){return(t.extensions||{})[r]}getScene(t){return this.getObject("scenes",t)}getNode(t){return this.getObject("nodes",t)}getSkin(t){return this.getObject("skins",t)}getMesh(t){return this.getObject("meshes",t)}getMaterial(t){return this.getObject("materials",t)}getAccessor(t){return this.getObject("accessors",t)}getTexture(t){return this.getObject("textures",t)}getSampler(t){return this.getObject("samplers",t)}getImage(t){return this.getObject("images",t)}getBufferView(t){return this.getObject("bufferViews",t)}getBuffer(t){return this.getObject("buffers",t)}getObject(t,r){if(typeof r=="object")return r;let n=this.json[t]&&this.json[t][r];if(!n)throw new Error(`glTF file error: Could not find ${t}[${r}]`);return n}getTypedArrayForBufferView(t){t=this.getBufferView(t);let r=t.buffer,n=this.gltf.buffers[r];ot(n);let s=(t.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,s,t.byteLength)}getTypedArrayForAccessor(t){let r=this.getAccessor(t);return hl(this.gltf.json,this.gltf.buffers,r)}getTypedArrayForImageData(t){t=this.getAccessor(t);let r=this.getBufferView(t.bufferView),s=this.getBuffer(r.buffer).data,o=r.byteOffset||0;return new Uint8Array(s,o,r.byteLength)}addApplicationData(t,r){return this.json[t]=r,this}addExtraData(t,r){return this.json.extras=this.json.extras||{},this.json.extras[t]=r,this}addObjectExtension(t,r,n){return t.extensions=t.extensions||{},t.extensions[r]=n,this.registerUsedExtension(r),this}setObjectExtension(t,r,n){let s=t.extensions||{};s[r]=n}removeObjectExtension(t,r){let n=t?.extensions||{};if(n[r]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let s=this.json.extensionsRemoved;s.includes(r)||s.push(r)}delete n[r]}addExtension(t,r={}){return ot(r),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=r,this.registerUsedExtension(t),r}addRequiredExtension(t,r={}){return ot(r),this.addExtension(t,r),this.registerRequiredExtension(t),r}registerUsedExtension(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(r=>r===t)||this.json.extensionsUsed.push(t)}registerRequiredExtension(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(r=>r===t)||this.json.extensionsRequired.push(t)}removeExtension(t){if(this.json.extensions?.[t]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let r=this.json.extensionsRemoved;r.includes(t)||r.push(t)}this.json.extensions&&delete this.json.extensions[t],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t)}setDefaultScene(t){this.json.scene=t}addScene(t){let{nodeIndices:r}=t;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:r}),this.json.scenes.length-1}addNode(t){let{meshIndex:r,matrix:n}=t;this.json.nodes=this.json.nodes||[];let s={mesh:r};return n&&(s.matrix=n),this.json.nodes.push(s),this.json.nodes.length-1}addMesh(t){let{attributes:r,indices:n,material:s,mode:o=4}=t,a={primitives:[{attributes:this._addAttributes(r),mode:o}]};if(n){let c=this._addIndices(n);a.primitives[0].indices=c}return Number.isFinite(s)&&(a.primitives[0].material=s),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(t){let n={primitives:[{attributes:this._addAttributes(t),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(n),this.json.meshes.length-1}addImage(t,r){let n=Xe(t),s=r||n?.mimeType,i={bufferView:this.addBufferView(t),mimeType:s};return this.json.images=this.json.images||[],this.json.images.push(i),this.json.images.length-1}addBufferView(t,r=0,n=this.byteLength){let s=t.byteLength;ot(Number.isFinite(s)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);let o={buffer:r,byteOffset:n,byteLength:s};return this.byteLength+=bt(s,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(o),this.json.bufferViews.length-1}addAccessor(t,r){let n={bufferView:t,type:Qs(r.size),componentType:r.componentType,count:r.count,max:r.max,min:r.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(n),this.json.accessors.length-1}addBinaryBuffer(t,r={size:3}){let n=this.addBufferView(t),s={min:r.min,max:r.max};(!s.min||!s.max)&&(s=this._getAccessorMinMax(t,r.size));let o={size:r.size,componentType:Hr(t),count:Math.round(t.length/r.size),min:s.min,max:s.max};return this.addAccessor(n,Object.assign(o,r))}addTexture(t){let{imageIndex:r}=t,n={source:r};return this.json.textures=this.json.textures||[],this.json.textures.push(n),this.json.textures.length-1}addMaterial(t){return this.json.materials=this.json.materials||[],this.json.materials.push(t),this.json.materials.length-1}createBinaryChunk(){this.gltf.buffers=[];let t=this.byteLength,r=new ArrayBuffer(t),n=new Uint8Array(r),s=0;for(let o of this.sourceBuffers||[])s=Xo(o,n,s);this.json?.buffers?.[0]?this.json.buffers[0].byteLength=t:this.json.buffers=[{byteLength:t}],this.gltf.binary=r,this.sourceBuffers=[r]}_removeStringFromArray(t,r){let n=!0;for(;n;){let s=t.indexOf(r);s>-1?t.splice(s,1):n=!1}}_addAttributes(t={}){let r={};for(let n in t){let s=t[n],o=this._getGltfAttributeName(n),i=this.addBinaryBuffer(s.value,s);r[o]=i}return r}_addIndices(t){return this.addBinaryBuffer(t,{size:1})}_getGltfAttributeName(t){switch(t.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return t}}_getAccessorMinMax(t,r){let n={min:null,max:null};if(t.length<r)return n;n.min=[],n.max=[];let s=t.subarray(0,r);for(let o of s)n.min.push(o),n.max.push(o);for(let o=r;o<t.length;o+=r)for(let i=0;i<r;i++)n.min[0+i]=Math.min(n.min[0+i],t[o+i]),n.max[0+i]=Math.max(n.max[0+i],t[o+i]);return n}};function ll(e){return(e%1+1)%1}var ul={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},Hp={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},dl={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8};function Gn(e,t){return dl[t]*ul[e]}function zr(e,t,r,n){if(r!=="UINT8"&&r!=="UINT16"&&r!=="UINT32"&&r!=="UINT64")return null;let s=e.getTypedArrayForBufferView(t),o=Jr(s,"SCALAR",r,n+1);return o instanceof BigInt64Array||o instanceof BigUint64Array?null:o}function Jr(e,t,r,n=1){let s=ul[t],o=Hp[r],i=dl[r],a=n*s,c=a*i,f=e.buffer,h=e.byteOffset;return h%i!==0&&(f=new Uint8Array(f).slice(h,h+c).buffer,h=0),new o(f,h,a)}function Qr(e,t,r){let n=`TEXCOORD_${t.texCoord||0}`,s=r.attributes[n],o=e.getTypedArrayForAccessor(s),i=e.gltf.json,a=t.index,c=i.textures?.[a]?.source;if(typeof c<"u"){let f=i.images?.[c]?.mimeType,h=e.gltf.images?.[c];if(h&&typeof h.width<"u"){let u=[];for(let l=0;l<o.length;l+=2){let d=kp(h,f,o,l,t.channels);u.push(d)}return u}}return[]}function Vs(e,t,r,n,s){if(!r?.length)return;let o=[];for(let h of r){let u=n.findIndex(l=>l===h);u===-1&&(u=n.push(h)-1),o.push(u)}let i=new Uint32Array(o),a=e.gltf.buffers.push({arrayBuffer:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength})-1,c=e.addBufferView(i,a,0),f=e.addAccessor(c,{size:1,componentType:Hr(i),count:i.length});s.attributes[t]=f}function kp(e,t,r,n,s=[0]){let o={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},i=r[n],a=r[n+1],c=1;t&&(t.indexOf("image/jpeg")!==-1||t.indexOf("image/png")!==-1)&&(c=4);let f=zp(i,a,e,c),h=0;for(let u of s){let l=typeof u=="number"?Object.values(o)[u]:o[u],d=f+l.offset,A=Ln(e);if(A.data.length<=d)throw new Error(`${A.data.length} <= ${d}`);let m=A.data[d];h|=m<<l.shift}return h}function zp(e,t,r,n=1){let s=r.width,o=ll(e)*(s-1),i=Math.round(o),a=r.height,c=ll(t)*(a-1),f=Math.round(c),h=r.components?r.components:n;return(f*s+i)*h}function js(e,t,r,n,s){let o=[];for(let i=0;i<t;i++){let a=r[i],c=r[i+1]-r[i];if(c+a>n)break;let f=a/s,h=c/s;o.push(e.slice(f,f+h))}return o}function Ks(e,t,r){let n=[];for(let s=0;s<t;s++){let o=s*r;n.push(e.slice(o,o+r))}return n}function Xs(e,t,r,n){if(r)throw new Error("Not implemented - arrayOffsets for strings is specified");if(n){let s=[],o=new TextDecoder("utf8"),i=0;for(let a=0;a<e;a++){let c=n[a+1]-n[a];if(c+i<=t.length){let f=t.subarray(i,c+i),h=o.decode(f);s.push(h),i+=c}}return s}return[]}var Al="EXT_mesh_features",Jp=Al;async function Qp(e,t){let r=new K(e);Vp(r,t)}function Vp(e,t){let r=e.gltf.json;if(r.meshes)for(let n of r.meshes)for(let s of n.primitives)jp(e,s,t)}function jp(e,t,r){if(!r?.gltf?.loadBuffers)return;let s=t.extensions?.[Al]?.featureIds;if(s)for(let o of s){let i;if(typeof o.attribute<"u"){let a=`_FEATURE_ID_${o.attribute}`,c=t.attributes[a];i=e.getTypedArrayForAccessor(c)}else typeof o.texture<"u"&&r?.gltf?.loadImages?i=Qr(e,o.texture,t):i=[];o.data=i}}var oa={};ut(oa,{decode:()=>Xp,name:()=>Kp});var na="EXT_structural_metadata",Kp=na;async function Xp(e,t){let r=new K(e);Yp(r,t)}function Yp(e,t){if(!t.gltf?.loadBuffers)return;let r=e.getExtension(na);r&&(t.gltf?.loadImages&&Zp(e,r),qp(e,r))}function Zp(e,t){let r=t.propertyTextures,n=e.gltf.json;if(r&&n.meshes)for(let s of n.meshes)for(let o of s.primitives)$p(e,r,o,t)}function qp(e,t){let r=t.schema;if(!r)return;let n=r.classes,s=t.propertyTables;if(n&&s)for(let o in n){let i=Wp(s,o);i&&eg(e,r,i)}}function Wp(e,t){for(let r of e)if(r.class===t)return r;return null}function $p(e,t,r,n){if(!t)return;let o=r.extensions?.[na]?.propertyTextures;if(o)for(let i of o){let a=t[i];tg(e,a,r,n)}}function tg(e,t,r,n){if(!t.properties)return;n.dataAttributeNames||(n.dataAttributeNames=[]);let s=t.class;for(let o in t.properties){let i=`${s}_${o}`,a=t.properties?.[o];if(!a)continue;a.data||(a.data=[]);let c=a.data,f=Qr(e,a,r);f!==null&&(Vs(e,i,f,c,r),a.data=c,n.dataAttributeNames.push(i))}}function eg(e,t,r){let n=t.classes?.[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let s=r.count;for(let o in n.properties){let i=n.properties[o],a=r.properties?.[o];if(a){let c=rg(e,t,i,s,a);a.data=c}}}function rg(e,t,r,n,s){let o=[],i=s.values,a=e.getTypedArrayForBufferView(i),c=ng(e,r,s,n),f=sg(e,s,n);switch(r.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{o=og(r,n,a,c);break}case"BOOLEAN":throw new Error(`Not implemented - classProperty.type=${r.type}`);case"STRING":{o=Xs(n,a,c,f);break}case"ENUM":{o=ig(t,r,n,a,c);break}default:throw new Error(`Unknown classProperty type ${r.type}`)}return o}function ng(e,t,r,n){return t.array&&typeof t.count>"u"&&typeof r.arrayOffsets<"u"?zr(e,r.arrayOffsets,r.arrayOffsetType||"UINT32",n):null}function sg(e,t,r){return typeof t.stringOffsets<"u"?zr(e,t.stringOffsets,t.stringOffsetType||"UINT32",r):null}function og(e,t,r,n){let s=e.array,o=e.count,i=Gn(e.type,e.componentType),a=r.byteLength/i,c;return e.componentType?c=Jr(r,e.type,e.componentType,a):c=r,s?n?js(c,t,n,r.length,i):o?Ks(c,t,o):[]:c}function ig(e,t,r,n,s){let o=t.enumType;if(!o)throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");let i=e.enums?.[o];if(!i)throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${o}`);let a=i.valueType||"UINT16",c=Gn(t.type,a),f=n.byteLength/c,h=Jr(n,t.type,a,f);if(h||(h=n),t.array){if(s)return ag({valuesData:h,numberOfElements:r,arrayOffsets:s,valuesDataBytesLength:n.length,elementSize:c,enumEntry:i});let u=t.count;return u?cg(h,r,u,i):[]}return sa(h,0,r,i)}function ag(e){let{valuesData:t,numberOfElements:r,arrayOffsets:n,valuesDataBytesLength:s,elementSize:o,enumEntry:i}=e,a=[];for(let c=0;c<r;c++){let f=n[c],h=n[c+1]-n[c];if(h+f>s)break;let u=f/o,l=h/o,d=sa(t,u,l,i);a.push(d)}return a}function cg(e,t,r,n){let s=[];for(let o=0;o<t;o++){let i=r*o,a=sa(e,i,r,n);s.push(a)}return s}function sa(e,t,r,n){let s=[];for(let o=0;o<r;o++)if(e instanceof BigInt64Array||e instanceof BigUint64Array)s.push("");else{let i=e[t+o],a=fg(n,i);a?s.push(a.name):s.push("")}return s}function fg(e,t){for(let r of e.values)if(r.value===t)return r;return null}var ia={};ut(ia,{decode:()=>lg,name:()=>hg});var ml="EXT_feature_metadata",hg=ml;async function lg(e,t){let r=new K(e);ug(r,t)}function ug(e,t){if(!t.gltf?.loadBuffers)return;let r=e.getExtension(ml);r&&(t.gltf?.loadImages&&dg(e,r),Ag(e,r))}function dg(e,t){let r=t.schema;if(!r)return;let n=r.classes,{featureTextures:s}=t;if(n&&s)for(let o in n){let i=n[o],a=pg(s,o);a&&xg(e,a,i)}}function Ag(e,t){let r=t.schema;if(!r)return;let n=r.classes,s=t.featureTables;if(n&&s)for(let o in n){let i=mg(s,o);i&&gg(e,r,i)}}function mg(e,t){for(let r in e){let n=e[r];if(n.class===t)return n}return null}function pg(e,t){for(let r in e){let n=e[r];if(n.class===t)return n}return null}function gg(e,t,r){if(!r.class)return;let n=t.classes?.[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let s=r.count;for(let o in n.properties){let i=n.properties[o],a=r.properties?.[o];if(a){let c=Bg(e,t,i,s,a);a.data=c}}}function xg(e,t,r){let n=t.class;for(let s in r.properties){let o=t?.properties?.[s];if(o){let i=Cg(e,o,n);o.data=i}}}function Bg(e,t,r,n,s){let o=[],i=s.bufferView,a=e.getTypedArrayForBufferView(i),c=Eg(e,r,s,n),f=_g(e,r,s,n);return r.type==="STRING"||r.componentType==="STRING"?o=Xs(n,a,c,f):yg(r)&&(o=Tg(r,n,a,c)),o}function Eg(e,t,r,n){return t.type==="ARRAY"&&typeof t.componentCount>"u"&&typeof r.arrayOffsetBufferView<"u"?zr(e,r.arrayOffsetBufferView,r.offsetType||"UINT32",n):null}function _g(e,t,r,n){return typeof r.stringOffsetBufferView<"u"?zr(e,r.stringOffsetBufferView,r.offsetType||"UINT32",n):null}function yg(e){let t=["UINT8","INT16","UINT16","INT32","UINT32","INT64","UINT64","FLOAT32","FLOAT64"];return t.includes(e.type)||typeof e.componentType<"u"&&t.includes(e.componentType)}function Tg(e,t,r,n){let s=e.type==="ARRAY",o=e.componentCount,i="SCALAR",a=e.componentType||e.type,c=Gn(i,a),f=r.byteLength/c,h=Jr(r,i,a,f);return s?n?js(h,t,n,r.length,c):o?Ks(h,t,o):[]:h}function Cg(e,t,r){let n=e.gltf.json;if(!n.meshes)return[];let s=[];for(let o of n.meshes)for(let i of o.primitives)Mg(e,r,t,s,i);return s}function Mg(e,t,r,n,s){let o={channels:r.channels,...r.texture},i=Qr(e,o,s);i&&Vs(e,t,i,n,s)}var pl="4.3.0-alpha.1";var gl="4.3.0-alpha.1";var Ys={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},xl;async function ca(e){xn(e.modules);let t=Vo("basis");return t||(xl||=bg(e),await xl)}async function bg(e){let t=null,r=null;return[t,r]=await Promise.all([await qt(Ys.TRANSCODER,"textures",e),await qt(Ys.TRANSCODER_WASM,"textures",e)]),t=t||globalThis.BASIS,await wg(t,r)}function wg(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e(r).then(s=>{let{BasisFile:o,initializeBasis:i}=s;i(),n({BasisFile:o})})})}var aa;async function fa(e){let t=e.modules||{};return t.basisEncoder?t.basisEncoder:(aa=aa||Ig(e),await aa)}async function Ig(e){let t=null,r=null;return[t,r]=await Promise.all([await qt(Ys.ENCODER,"textures",e),await qt(Ys.ENCODER_WASM,"textures",e)]),t=t||globalThis.BASIS,await Sg(t,r)}function Sg(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e(r).then(s=>{let{BasisFile:o,KTX2File:i,initializeBasis:a,BasisEncoder:c}=s;a(),n({BasisFile:o,KTX2File:i,BasisEncoder:c})})})}var Ye={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35987,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,COMPRESSED_RGBA_ASTC_4X4_KHR:37808,COMPRESSED_RGBA_ASTC_5X4_KHR:37809,COMPRESSED_RGBA_ASTC_5X5_KHR:37810,COMPRESSED_RGBA_ASTC_6X5_KHR:37811,COMPRESSED_RGBA_ASTC_6X6_KHR:37812,COMPRESSED_RGBA_ASTC_8X5_KHR:37813,COMPRESSED_RGBA_ASTC_8X6_KHR:37814,COMPRESSED_RGBA_ASTC_8X8_KHR:37815,COMPRESSED_RGBA_ASTC_10X5_KHR:37816,COMPRESSED_RGBA_ASTC_10X6_KHR:37817,COMPRESSED_RGBA_ASTC_10X8_KHR:37818,COMPRESSED_RGBA_ASTC_10X10_KHR:37819,COMPRESSED_RGBA_ASTC_12X10_KHR:37820,COMPRESSED_RGBA_ASTC_12X12_KHR:37821,COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR:37840,COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR:37841,COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR:37842,COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR:37843,COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR:37844,COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR:37845,COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR:37846,COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR:37847,COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR:37848,COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR:37849,COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR:37850,COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR:37851,COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR:37852,COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR:37853,COMPRESSED_RED_RGTC1_EXT:36283,COMPRESSED_SIGNED_RED_RGTC1_EXT:36284,COMPRESSED_RED_GREEN_RGTC2_EXT:36285,COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:36286,COMPRESSED_SRGB_S3TC_DXT1_EXT:35916,COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:35917,COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:35918,COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:35919};var Rg=["","WEBKIT_","MOZ_"],Bl={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"},Zs=null;function El(e){if(!Zs){e=e||Fg()||void 0,Zs=new Set;for(let t of Rg)for(let r in Bl)if(e&&e.getExtension(`${t}${r}`)){let n=Bl[r];Zs.add(n)}}return Zs}function Fg(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var U3=new Uint8Array([0]);var _l,yl,Tl,Cl,Ml,bl,wl,Il;(function(e){e[e.NONE=0]="NONE",e[e.BASISLZ=1]="BASISLZ",e[e.ZSTD=2]="ZSTD",e[e.ZLIB=3]="ZLIB"})(_l||(_l={})),function(e){e[e.BASICFORMAT=0]="BASICFORMAT"}(yl||(yl={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ETC1S=163]="ETC1S",e[e.UASTC=166]="UASTC"}(Tl||(Tl={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SRGB=1]="SRGB"}(Cl||(Cl={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LINEAR=1]="LINEAR",e[e.SRGB=2]="SRGB",e[e.ITU=3]="ITU",e[e.NTSC=4]="NTSC",e[e.SLOG=5]="SLOG",e[e.SLOG2=6]="SLOG2"}(Ml||(Ml={})),function(e){e[e.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",e[e.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(bl||(bl={})),function(e){e[e.RGB=0]="RGB",e[e.RRR=3]="RRR",e[e.GGG=4]="GGG",e[e.AAA=15]="AAA"}(wl||(wl={})),function(e){e[e.RGB=0]="RGB",e[e.RGBA=3]="RGBA",e[e.RRR=4]="RRR",e[e.RRRG=5]="RRRG"}(Il||(Il={}));var It=[171,75,84,88,32,50,48,187,13,10,26,10];function Sl(e){let t=new Uint8Array(e);return!(t.byteLength<It.length||t[0]!==It[0]||t[1]!==It[1]||t[2]!==It[2]||t[3]!==It[3]||t[4]!==It[4]||t[5]!==It[5]||t[6]!==It[6]||t[7]!==It[7]||t[8]!==It[8]||t[9]!==It[9]||t[10]!==It[10]||t[11]!==It[11])}var Dg={etc1:{basisFormat:0,compressed:!0,format:Ye.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:Ye.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:Ye.COMPRESSED_RGBA_S3TC_DXT5_EXT},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:Ye.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:Ye.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:Ye.COMPRESSED_RGBA_ASTC_4X4_KHR},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};async function la(e,t){if(t.basis.containerFormat==="auto"){if(Sl(e)){let n=await fa(t);return Rl(n.KTX2File,e,t)}let{BasisFile:r}=await ca(t);return ha(r,e,t)}switch(t.basis.module){case"encoder":let r=await fa(t);switch(t.basis.containerFormat){case"ktx2":return Rl(r.KTX2File,e,t);case"basis":default:return ha(r.BasisFile,e,t)}case"transcoder":default:let{BasisFile:n}=await ca(t);return ha(n,e,t)}}function ha(e,t,r){let n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");let s=n.getNumImages(),o=[];for(let i=0;i<s;i++){let a=n.getNumLevels(i),c=[];for(let f=0;f<a;f++)c.push(Lg(n,i,f,r));o.push(c)}return o}finally{n.close(),n.delete()}}function Lg(e,t,r,n){let s=e.getImageWidth(t,r),o=e.getImageHeight(t,r),i=e.getHasAlpha(),{compressed:a,format:c,basisFormat:f}=Fl(n,i),h=e.getImageTranscodedSizeInBytes(t,r,f),u=new Uint8Array(h);if(!e.transcodeImage(u,t,r,f,0,0))throw new Error("failed to start Basis transcoding");return{width:s,height:o,data:u,compressed:a,format:c,hasAlpha:i}}function Rl(e,t,r){let n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");let s=n.getLevels(),o=[];for(let i=0;i<s;i++){o.push(Og(n,i,r));break}return[o]}finally{n.close(),n.delete()}}function Og(e,t,r){let{alphaFlag:n,height:s,width:o}=e.getImageLevelInfo(t,0,0),{compressed:i,format:a,basisFormat:c}=Fl(r,n),f=e.getImageTranscodedSizeInBytes(t,0,0,c),h=new Uint8Array(f);if(!e.transcodeImage(h,t,0,0,c,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:o,height:s,data:h,compressed:i,levelSize:f,hasAlpha:n,format:a}}function Fl(e,t){let r=e&&e.basis&&e.basis.format;return r==="auto"&&(r=qs()),typeof r=="object"&&(r=t?r.alpha:r.noAlpha),r=r.toLowerCase(),Dg[r]}function qs(){let e=El();return e.has("astc")?"astc-4x4":e.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:e.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:e.has("etc1")?"etc1":e.has("etc2")?"etc2":"rgb565"}var Dl={dataType:null,batchType:null,name:"Basis",id:"basis",module:"textures",version:gl,worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}},ua={...Dl,parse:la};var Vr=!0,Ll=1735152710,ma=12,Ws=8,vg=1313821514,Ng=5130562,Gg=0,Ug=0,Pg=1;function Hg(e,t=0){return`${String.fromCharCode(e.getUint8(t+0))}${String.fromCharCode(e.getUint8(t+1))}${String.fromCharCode(e.getUint8(t+2))}${String.fromCharCode(e.getUint8(t+3))}`}function Ol(e,t=0,r={}){let n=new DataView(e),{magic:s=Ll}=r,o=n.getUint32(t,!1);return o===s||o===Ll}function vl(e,t,r=0,n={}){let s=new DataView(t),o=Hg(s,r+0),i=s.getUint32(r+4,Vr),a=s.getUint32(r+8,Vr);switch(Object.assign(e,{header:{byteOffset:r,byteLength:a,hasBinChunk:!1},type:o,version:i,json:{},binChunks:[]}),r+=ma,e.version){case 1:return kg(e,s,r);case 2:return zg(e,s,r,n={});default:throw new Error(`Invalid GLB version ${e.version}. Only supports version 1 and 2.`)}}function kg(e,t,r){z(e.header.byteLength>ma+Ws);let n=t.getUint32(r+0,Vr),s=t.getUint32(r+4,Vr);return r+=Ws,z(s===Gg),da(e,t,r,n),r+=n,r+=Aa(e,t,r,e.header.byteLength),r}function zg(e,t,r,n){return z(e.header.byteLength>ma+Ws),Jg(e,t,r,n),r+e.header.byteLength}function Jg(e,t,r,n){for(;r+8<=e.header.byteLength;){let s=t.getUint32(r+0,Vr),o=t.getUint32(r+4,Vr);switch(r+=Ws,o){case vg:da(e,t,r,s);break;case Ng:Aa(e,t,r,s);break;case Ug:n.strict||da(e,t,r,s);break;case Pg:n.strict||Aa(e,t,r,s);break;default:break}r+=bt(s,4)}return r}function da(e,t,r,n){let s=new Uint8Array(t.buffer,r,n),i=new TextDecoder("utf8").decode(s);return e.json=JSON.parse(i),bt(n,4)}function Aa(e,t,r,n){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:t.buffer}),bt(n,4)}function pa(e,t){if(e.startsWith("data:")||e.startsWith("http:")||e.startsWith("https:"))return e;let n=t.baseUri||t.uri;if(!n)throw new Error(`'baseUri' must be provided to resolve relative url ${e}`);return n.substr(0,n.lastIndexOf("/")+1)+e}var xa={};ut(xa,{decode:()=>ex,name:()=>tx});var Qg="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCI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UBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",jg=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]),Kg=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),Xg={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},Yg={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};async function Nl(e,t,r,n,s,o="NONE"){let i=await Zg();$g(i,i.exports[Yg[s]],e,t,r,n,i.exports[Xg[o||"NONE"]])}var ga;async function Zg(){return ga||(ga=qg()),ga}async function qg(){let e=Qg;WebAssembly.validate(jg)&&(e=Vg,console.log("Warning: meshopt_decoder is using experimental SIMD support"));let t=await WebAssembly.instantiate(Wg(e),{});return await t.instance.exports.__wasm_call_ctors(),t.instance}function Wg(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;++n){let s=e.charCodeAt(n);t[n]=s>96?s-71:s>64?s-65:s>47?s+4:s>46?63:62}let r=0;for(let n=0;n<e.length;++n)t[r++]=t[n]<60?Kg[t[n]]:(t[n]-60)*64+t[++n];return t.buffer.slice(0,r)}function $g(e,t,r,n,s,o,i){let a=e.exports.sbrk,c=n+3&-4,f=a(c*s),h=a(o.length),u=new Uint8Array(e.exports.memory.buffer);u.set(o,h);let l=t(f,n,s,h,o.length);if(l===0&&i&&i(f,c,s),r.set(u.subarray(f,f+n*s)),a(f-a(0)),l!==0)throw new Error(`Malformed buffer data: ${l}`)}var $s="EXT_meshopt_compression",tx=$s;async function ex(e,t){let r=new K(e);if(!t?.gltf?.decompressMeshes||!t.gltf?.loadBuffers)return;let n=[];for(let s of e.json.bufferViews||[])n.push(rx(r,s));await Promise.all(n),r.removeExtension($s)}async function rx(e,t){let r=e.getObjectExtension(t,$s);if(r){let{byteOffset:n=0,byteLength:s=0,byteStride:o,count:i,mode:a,filter:c="NONE",buffer:f}=r,h=e.gltf.buffers[f],u=new Uint8Array(h.arrayBuffer,h.byteOffset+n,s),l=new Uint8Array(e.gltf.buffers[t.buffer].arrayBuffer,t.byteOffset,t.byteLength);await Nl(l,i,o,u,a,c),e.removeObjectExtension(t,$s)}}var Ba={};ut(Ba,{name:()=>nx,preprocess:()=>sx});var jr="EXT_texture_webp",nx=jr;function sx(e,t){let r=new K(e);if(!ea("image/webp")){if(r.getRequiredExtensions().includes(jr))throw new Error(`gltf: Required extension ${jr} not supported by browser`);return}let{json:n}=r;for(let s of n.textures||[]){let o=r.getObjectExtension(s,jr);o&&(s.source=o.source),r.removeObjectExtension(s,jr)}r.removeExtension(jr)}var Ea={};ut(Ea,{name:()=>ox,preprocess:()=>ix});var to="KHR_texture_basisu",ox=to;function ix(e,t){let r=new K(e),{json:n}=r;for(let s of n.textures||[]){let o=r.getObjectExtension(s,to);o&&(s.source=o.source,r.removeObjectExtension(s,to))}r.removeExtension(to)}var ya={};ut(ya,{decode:()=>lx,encode:()=>ux,name:()=>fx,preprocess:()=>hx});function Gl(e){let t={};for(let r in e){let n=e[r];if(r!=="indices"){let s=_a(n);t[r]=s}}return t}function _a(e){let{buffer:t,size:r,count:n}=ax(e);return{value:t,size:r,byteOffset:0,count:n,type:Qs(r),componentType:Hr(t)}}function ax(e){let t=e,r=1,n=0;return e&&e.value&&(t=e.value,r=e.size||1),t&&(ArrayBuffer.isView(t)||(t=cx(t,Float32Array)),n=t.length/r),{buffer:t,size:r,count:n}}function cx(e,t,r=!1){return e?Array.isArray(e)?new t(e):r&&!(e instanceof t)?new t(e):e:null}var Re="KHR_draco_mesh_compression",fx=Re;function hx(e,t,r){let n=new K(e);for(let s of Ul(n))n.getObjectExtension(s,Re)}async function lx(e,t,r){if(!t?.gltf?.decompressMeshes)return;let n=new K(e),s=[];for(let o of Ul(n))n.getObjectExtension(o,Re)&&s.push(dx(n,o,t,r));await Promise.all(s),n.removeExtension(Re)}function ux(e,t={}){let r=new K(e);for(let n of r.json.meshes||[])Ax(n,t),r.addRequiredExtension(Re)}async function dx(e,t,r,n){let s=e.getObjectExtension(t,Re);if(!s)return;let o=e.getTypedArrayForBufferView(s.bufferView),i=ze(o.buffer,o.byteOffset),a={...r};delete a["3d-tiles"];let c=await Pt(i,Is,a,n),f=Gl(c.attributes);for(let[h,u]of Object.entries(f))if(h in t.attributes){let l=t.attributes[h],d=e.getAccessor(l);d?.min&&d?.max&&(u.min=d.min,u.max=d.max)}t.attributes=f,c.indices&&(t.indices=_a(c.indices)),e.removeObjectExtension(t,Re),mx(t)}function Ax(e,t,r=4,n,s){if(!n.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");let o=n.DracoWriter.encodeSync({attributes:e}),i=s?.parseSync?.({attributes:e}),a=n._addFauxAttributes(i.attributes),c=n.addBufferView(o);return{primitives:[{attributes:a,mode:r,extensions:{[Re]:{bufferView:c,attributes:a}}}]}}function mx(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*Ul(e){for(let t of e.json.meshes||[])for(let r of t.primitives)yield r}var Ta={};ut(Ta,{decode:()=>Bx,name:()=>px});var ro="KHR_texture_transform",px=ro,eo=new fe,gx=new he,xx=new he;async function Bx(e,t){if(!new K(e).hasExtension(ro)||!t.gltf?.loadBuffers)return;let s=e.json.materials||[];for(let o=0;o<s.length;o++)Ex(o,e)}function Ex(e,t){let r=t.json.materials?.[e],n=[r?.pbrMetallicRoughness?.baseColorTexture,r?.emissiveTexture,r?.normalTexture,r?.occlusionTexture,r?.pbrMetallicRoughness?.metallicRoughnessTexture],s=[];for(let o of n)o&&o?.extensions?.[ro]&&_x(t,e,o,s)}function _x(e,t,r,n){let s=yx(r,n);if(!s)return;let o=e.json.meshes||[];for(let i of o)for(let a of i.primitives){let c=a.material;Number.isFinite(c)&&t===c&&Tx(e,a,s)}}function yx(e,t){let r=e.extensions?.[ro],{texCoord:n=0}=e,{texCoord:s=n}=r;if(!(t.findIndex(([i,a])=>i===n&&a===s)!==-1)){let i=bx(r);return n!==s&&(e.texCoord=s),t.push([n,s]),{originalTexCoord:n,texCoord:s,matrix:i}}return null}function Tx(e,t,r){let{originalTexCoord:n,texCoord:s,matrix:o}=r,i=t.attributes[`TEXCOORD_${n}`];if(Number.isFinite(i)){let a=e.json.accessors?.[i];if(a&&a.bufferView){let c=e.json.bufferViews?.[a.bufferView];if(c){let{arrayBuffer:f,byteOffset:h}=e.buffers[c.buffer],u=(h||0)+(a.byteOffset||0)+(c.byteOffset||0),{ArrayType:l,length:d}=kr(a,c),A=Js[a.componentType],m=zs[a.type],p=c.byteStride||A*m,E=new Float32Array(d);for(let y=0;y<a.count;y++){let C=new l(f,u+y*p,2);eo.set(C[0],C[1],1),eo.transformByMatrix3(o),E.set([eo[0],eo[1]],y*m)}n===s?Cx(a,c,e.buffers,E):Mx(s,a,t,e,E)}}}}function Cx(e,t,r,n){e.componentType=5126,r.push({arrayBuffer:n.buffer,byteOffset:0,byteLength:n.buffer.byteLength}),t.buffer=r.length-1,t.byteLength=n.buffer.byteLength,t.byteOffset=0,delete t.byteStride}function Mx(e,t,r,n,s){n.buffers.push({arrayBuffer:s.buffer,byteOffset:0,byteLength:s.buffer.byteLength});let o=n.json.bufferViews;if(!o)return;o.push({buffer:n.buffers.length-1,byteLength:s.buffer.byteLength,byteOffset:0});let i=n.json.accessors;i&&(i.push({bufferView:o?.length-1,byteOffset:0,componentType:5126,count:t.count,type:"VEC2"}),r.attributes[`TEXCOORD_${e}`]=i.length-1)}function bx(e){let{offset:t=[0,0],rotation:r=0,scale:n=[1,1]}=e,s=new he().set(1,0,0,0,1,0,t[0],t[1],1),o=gx.set(Math.cos(r),Math.sin(r),0,-Math.sin(r),Math.cos(r),0,0,0,1),i=xx.set(n[0],0,0,0,n[1],0,0,0,1);return s.multiplyRight(o).multiplyRight(i)}var Ca={};ut(Ca,{decode:()=>Ix,encode:()=>Sx,name:()=>wx});var Ze="KHR_lights_punctual",wx=Ze;async function Ix(e){let t=new K(e),{json:r}=t,n=t.getExtension(Ze);n&&(t.json.lights=n.lights,t.removeExtension(Ze));for(let s of r.nodes||[]){let o=t.getObjectExtension(s,Ze);o&&(s.light=o.light),t.removeObjectExtension(s,Ze)}}async function Sx(e){let t=new K(e),{json:r}=t;if(r.lights){let n=t.addExtension(Ze);ot(!n.lights),n.lights=r.lights,delete r.lights}if(t.json.lights){for(let n of t.json.lights){let s=n.node;t.addObjectExtension(s,Ze,n)}delete t.json.lights}}var Ma={};ut(Ma,{decode:()=>Fx,encode:()=>Dx,name:()=>Rx});var Un="KHR_materials_unlit",Rx=Un;async function Fx(e){let t=new K(e),{json:r}=t;for(let n of r.materials||[])n.extensions&&n.extensions.KHR_materials_unlit&&(n.unlit=!0),t.removeObjectExtension(n,Un);t.removeExtension(Un)}function Dx(e){let t=new K(e),{json:r}=t;if(t.materials)for(let n of r.materials||[])n.unlit&&(delete n.unlit,t.addObjectExtension(n,Un,{}),t.addExtension(Un))}var ba={};ut(ba,{decode:()=>Ox,encode:()=>vx,name:()=>Lx});var Pn="KHR_techniques_webgl",Lx=Pn;async function Ox(e){let t=new K(e),{json:r}=t,n=t.getExtension(Pn);if(n){let s=Nx(n,t);for(let o of r.materials||[]){let i=t.getObjectExtension(o,Pn);i&&(o.technique=Object.assign({},i,s[i.technique]),o.technique.values=Gx(o.technique,t)),t.removeObjectExtension(o,Pn)}t.removeExtension(Pn)}}async function vx(e,t){}function Nx(e,t){let{programs:r=[],shaders:n=[],techniques:s=[]}=e,o=new TextDecoder;return n.forEach(i=>{if(Number.isFinite(i.bufferView))i.code=o.decode(t.getTypedArrayForBufferView(i.bufferView));else throw new Error("KHR_techniques_webgl: no shader code")}),r.forEach(i=>{i.fragmentShader=n[i.fragmentShader],i.vertexShader=n[i.vertexShader]}),s.forEach(i=>{i.program=r[i.program]}),s}function Gx(e,t){let r=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach(n=>{e.uniforms[n].value&&!(n in r)&&(r[n]=e.uniforms[n].value)}),Object.keys(r).forEach(n=>{typeof r[n]=="object"&&r[n].index!==void 0&&(r[n].texture=t.getTexture(r[n].index))}),r}var Pl=[oa,ra,xa,Ba,Ea,ya,Ca,Ma,ba,Ta,ia];function Hl(e,t={},r){let n=Pl.filter(s=>zl(s.name,t));for(let s of n)s.preprocess?.(e,t,r)}async function kl(e,t={},r){let n=Pl.filter(s=>zl(s.name,t));for(let s of n)await s.decode?.(e,t,r)}function zl(e,t){let r=t?.gltf?.excludeExtensions||{};return!(e in r&&!r[e])}var wa="KHR_binary_glTF";function Jl(e){let t=new K(e),{json:r}=t;for(let n of r.images||[]){let s=t.getObjectExtension(n,wa);s&&Object.assign(n,s),t.removeObjectExtension(n,wa)}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,t.removeExtension(wa)}var Ql={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},Px={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},Ia=class{idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}};json;normalize(t,r){this.json=t.json;let n=t.json;switch(n.asset&&n.asset.version){case"2.0":return;case void 0:case"1.0":break;default:console.warn(`glTF: Unknown version ${n.asset.version}`);return}if(!r.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(n),this._convertTopLevelObjectsToArrays(n),Jl(t),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n),this._updateMaterial(n)}_addAsset(t){t.asset=t.asset||{},t.asset.version="2.0",t.asset.generator=t.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(t){for(let r in Ql)this._convertTopLevelObjectToArray(t,r)}_convertTopLevelObjectToArray(t,r){let n=t[r];if(!(!n||Array.isArray(n))){t[r]=[];for(let s in n){let o=n[s];o.id=o.id||s;let i=t[r].length;t[r].push(o),this.idToIndexMap[r][s]=i}}}_convertObjectIdsToArrayIndices(t){for(let r in Ql)this._convertIdsToIndices(t,r);"scene"in t&&(t.scene=this._convertIdToIndex(t.scene,"scene"));for(let r of t.textures)this._convertTextureIds(r);for(let r of t.meshes)this._convertMeshIds(r);for(let r of t.nodes)this._convertNodeIds(r);for(let r of t.scenes)this._convertSceneIds(r)}_convertTextureIds(t){t.source&&(t.source=this._convertIdToIndex(t.source,"image"))}_convertMeshIds(t){for(let r of t.primitives){let{attributes:n,indices:s,material:o}=r;for(let i in n)n[i]=this._convertIdToIndex(n[i],"accessor");s&&(r.indices=this._convertIdToIndex(s,"accessor")),o&&(r.material=this._convertIdToIndex(o,"material"))}}_convertNodeIds(t){t.children&&(t.children=t.children.map(r=>this._convertIdToIndex(r,"node"))),t.meshes&&(t.meshes=t.meshes.map(r=>this._convertIdToIndex(r,"mesh")))}_convertSceneIds(t){t.nodes&&(t.nodes=t.nodes.map(r=>this._convertIdToIndex(r,"node")))}_convertIdsToIndices(t,r){t[r]||(console.warn(`gltf v1: json doesn't contain attribute ${r}`),t[r]=[]);for(let n of t[r])for(let s in n){let o=n[s],i=this._convertIdToIndex(o,s);n[s]=i}}_convertIdToIndex(t,r){let n=Px[r];if(n in this.idToIndexMap){let s=this.idToIndexMap[n][t];if(!Number.isFinite(s))throw new Error(`gltf v1: failed to resolve ${r} with id ${t}`);return s}return t}_updateObjects(t){for(let r of this.json.buffers)delete r.type}_updateMaterial(t){for(let r of t.materials){r.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};let n=r.values?.tex||r.values?.texture2d_0||r.values?.diffuseTex,s=t.textures.findIndex(o=>o.id===n);s!==-1&&(r.pbrMetallicRoughness.baseColorTexture={index:s})}}};function Vl(e,t={}){return new Ia().normalize(e,t)}async function jl(e,t,r=0,n,s){return Hx(e,t,r,n),Vl(e,{normalize:n?.gltf?.normalize}),Hl(e,n,s),n?.gltf?.loadBuffers&&e.json.buffers&&await kx(e,n,s),n?.gltf?.loadImages&&await zx(e,n,s),await kl(e,n,s),e}function Hx(e,t,r,n){if(n.uri&&(e.baseUri=n.uri),t instanceof ArrayBuffer&&!Ol(t,r,n)&&(t=new TextDecoder().decode(t)),typeof t=="string")e.json=Ko(t);else if(t instanceof ArrayBuffer){let i={};r=vl(i,t,r,n.glb),ot(i.type==="glTF",`Invalid GLB magic string ${i.type}`),e._glb=i,e.json=i.json}else ot(!1,"GLTF: must be ArrayBuffer or string");let s=e.json.buffers||[];if(e.buffers=new Array(s.length).fill(null),e._glb&&e._glb.header.hasBinChunk){let{binChunks:i}=e._glb;e.buffers[0]={arrayBuffer:i[0].arrayBuffer,byteOffset:i[0].byteOffset,byteLength:i[0].byteLength}}let o=e.json.images||[];e.images=new Array(o.length).fill({})}async function kx(e,t,r){let n=e.json.buffers||[];for(let s=0;s<n.length;++s){let o=n[s];if(o.uri){let{fetch:i}=r;ot(i);let a=pa(o.uri,t),f=await(await r?.fetch?.(a))?.arrayBuffer?.();e.buffers[s]={arrayBuffer:f,byteOffset:0,byteLength:f.byteLength},delete o.uri}else e.buffers[s]===null&&(e.buffers[s]={arrayBuffer:new ArrayBuffer(o.byteLength),byteOffset:0,byteLength:o.byteLength})}}async function zx(e,t,r){let n=Jx(e),s=e.json.images||[],o=[];for(let i of n)o.push(Qx(e,s[i],i,t,r));return await Promise.all(o)}function Jx(e){let t=new Set,r=e.json.textures||[];for(let n of r)n.source!==void 0&&t.add(n.source);return Array.from(t).sort()}async function Qx(e,t,r,n,s){let o;if(t.uri&&!t.hasOwnProperty("bufferView")){let a=pa(t.uri,n),{fetch:c}=s;o=await(await c(a)).arrayBuffer(),t.bufferView={data:o}}if(Number.isFinite(t.bufferView)){let a=fl(e.json,e.buffers,t.bufferView);o=ze(a.buffer,a.byteOffset,a.byteLength)}ot(o,"glTF image has no data");let i=await Pt(o,[$i,ua],{...n,mimeType:t.mimeType,basis:n.basis||{format:qs()}},s);i&&i[0]&&(i={compressed:!0,mipmaps:!1,width:i[0].width,height:i[0].height,data:i[0]}),e.images=e.images||[],e.images[r]=i}var qe={dataType:null,batchType:null,name:"glTF",id:"gltf",module:"gltf",version:pl,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:Vx,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0},log:console}};async function Vx(e,t={},r){t={...qe.options,...t},t.gltf={...qe.options.gltf,...t.gltf};let{byteOffset:n=0}=t;return await jl({},e,n,t,r)}var jx={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Kx={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Ft={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},Xx={magFilter:Ft.TEXTURE_MAG_FILTER,minFilter:Ft.TEXTURE_MIN_FILTER,wrapS:Ft.TEXTURE_WRAP_S,wrapT:Ft.TEXTURE_WRAP_T},Yx={[Ft.TEXTURE_MAG_FILTER]:Ft.LINEAR,[Ft.TEXTURE_MIN_FILTER]:Ft.NEAREST_MIPMAP_LINEAR,[Ft.TEXTURE_WRAP_S]:Ft.REPEAT,[Ft.TEXTURE_WRAP_T]:Ft.REPEAT};function Zx(){return{id:"default-sampler",parameters:Yx}}function qx(e){return Kx[e]}function Wx(e){return jx[e]}var Sa=class{baseUri="";jsonUnprocessed;json;buffers=[];images=[];postProcess(t,r={}){let{json:n,buffers:s=[],images:o=[]}=t,{baseUri:i=""}=t;return ot(n),this.baseUri=i,this.buffers=s,this.images=o,this.jsonUnprocessed=n,this.json=this._resolveTree(t.json,r),this.json}_resolveTree(t,r={}){let n={...t};return this.json=n,t.bufferViews&&(n.bufferViews=t.bufferViews.map((s,o)=>this._resolveBufferView(s,o))),t.images&&(n.images=t.images.map((s,o)=>this._resolveImage(s,o))),t.samplers&&(n.samplers=t.samplers.map((s,o)=>this._resolveSampler(s,o))),t.textures&&(n.textures=t.textures.map((s,o)=>this._resolveTexture(s,o))),t.accessors&&(n.accessors=t.accessors.map((s,o)=>this._resolveAccessor(s,o))),t.materials&&(n.materials=t.materials.map((s,o)=>this._resolveMaterial(s,o))),t.meshes&&(n.meshes=t.meshes.map((s,o)=>this._resolveMesh(s,o))),t.nodes&&(n.nodes=t.nodes.map((s,o)=>this._resolveNode(s,o)),n.nodes=n.nodes.map((s,o)=>this._resolveNodeChildren(s))),t.skins&&(n.skins=t.skins.map((s,o)=>this._resolveSkin(s,o))),t.scenes&&(n.scenes=t.scenes.map((s,o)=>this._resolveScene(s,o))),typeof this.json.scene=="number"&&n.scenes&&(n.scene=n.scenes[this.json.scene]),n}getScene(t){return this._get(this.json.scenes,t)}getNode(t){return this._get(this.json.nodes,t)}getSkin(t){return this._get(this.json.skins,t)}getMesh(t){return this._get(this.json.meshes,t)}getMaterial(t){return this._get(this.json.materials,t)}getAccessor(t){return this._get(this.json.accessors,t)}getCamera(t){return this._get(this.json.cameras,t)}getTexture(t){return this._get(this.json.textures,t)}getSampler(t){return this._get(this.json.samplers,t)}getImage(t){return this._get(this.json.images,t)}getBufferView(t){return this._get(this.json.bufferViews,t)}getBuffer(t){return this._get(this.json.buffers,t)}_get(t,r){if(typeof r=="object")return r;let n=t&&t[r];return n||console.warn(`glTF file error: Could not find ${t}[${r}]`),n}_resolveScene(t,r){return{...t,id:t.id||`scene-${r}`,nodes:(t.nodes||[]).map(n=>this.getNode(n))}}_resolveNode(t,r){let n={...t,id:t?.id||`node-${r}`};return t.mesh!==void 0&&(n.mesh=this.getMesh(t.mesh)),t.camera!==void 0&&(n.camera=this.getCamera(t.camera)),t.skin!==void 0&&(n.skin=this.getSkin(t.skin)),t.meshes!==void 0&&t.meshes.length&&(n.mesh=t.meshes.reduce((s,o)=>{let i=this.getMesh(o);return s.id=i.id,s.primitives=s.primitives.concat(i.primitives),s},{primitives:[]})),n}_resolveNodeChildren(t){return t.children&&(t.children=t.children.map(r=>this.getNode(r))),t}_resolveSkin(t,r){let n=typeof t.inverseBindMatrices=="number"?this.getAccessor(t.inverseBindMatrices):void 0;return{...t,id:t.id||`skin-${r}`,inverseBindMatrices:n}}_resolveMesh(t,r){let n={...t,id:t.id||`mesh-${r}`,primitives:[]};return t.primitives&&(n.primitives=t.primitives.map(s=>{let o={...s,attributes:{},indices:void 0,material:void 0},i=s.attributes;for(let a in i)o.attributes[a]=this.getAccessor(i[a]);return s.indices!==void 0&&(o.indices=this.getAccessor(s.indices)),s.material!==void 0&&(o.material=this.getMaterial(s.material)),o})),n}_resolveMaterial(t,r){let n={...t,id:t.id||`material-${r}`};if(n.normalTexture&&(n.normalTexture={...n.normalTexture},n.normalTexture.texture=this.getTexture(n.normalTexture.index)),n.occlusionTexture&&(n.occlusionTexture={...n.occlusionTexture},n.occlusionTexture.texture=this.getTexture(n.occlusionTexture.index)),n.emissiveTexture&&(n.emissiveTexture={...n.emissiveTexture},n.emissiveTexture.texture=this.getTexture(n.emissiveTexture.index)),n.emissiveFactor||(n.emissiveFactor=n.emissiveTexture?[1,1,1]:[0,0,0]),n.pbrMetallicRoughness){n.pbrMetallicRoughness={...n.pbrMetallicRoughness};let s=n.pbrMetallicRoughness;s.baseColorTexture&&(s.baseColorTexture={...s.baseColorTexture},s.baseColorTexture.texture=this.getTexture(s.baseColorTexture.index)),s.metallicRoughnessTexture&&(s.metallicRoughnessTexture={...s.metallicRoughnessTexture},s.metallicRoughnessTexture.texture=this.getTexture(s.metallicRoughnessTexture.index))}return n}_resolveAccessor(t,r){let n=qx(t.componentType),s=Wx(t.type),o=n*s,i={...t,id:t.id||`accessor-${r}`,bytesPerComponent:n,components:s,bytesPerElement:o,value:void 0,bufferView:void 0,sparse:void 0};if(t.bufferView!==void 0&&(i.bufferView=this.getBufferView(t.bufferView)),i.bufferView){let a=i.bufferView.buffer,{ArrayType:c,byteLength:f}=kr(i,i.bufferView),h=(i.bufferView.byteOffset||0)+(i.byteOffset||0)+a.byteOffset,u=a.arrayBuffer.slice(h,h+f);i.bufferView.byteStride&&(u=this._getValueFromInterleavedBuffer(a,h,i.bufferView.byteStride,i.bytesPerElement,i.count)),i.value=new c(u)}return i}_getValueFromInterleavedBuffer(t,r,n,s,o){let i=new Uint8Array(o*s);for(let a=0;a<o;a++){let c=r+a*n;i.set(new Uint8Array(t.arrayBuffer.slice(c,c+s)),a*s)}return i.buffer}_resolveTexture(t,r){return{...t,id:t.id||`texture-${r}`,sampler:typeof t.sampler=="number"?this.getSampler(t.sampler):Zx(),source:typeof t.source=="number"?this.getImage(t.source):void 0}}_resolveSampler(t,r){let n={id:t.id||`sampler-${r}`,...t,parameters:{}};for(let s in n){let o=this._enumSamplerParameter(s);o!==void 0&&(n.parameters[o]=n[s])}return n}_enumSamplerParameter(t){return Xx[t]}_resolveImage(t,r){let n={...t,id:t.id||`image-${r}`,image:null,bufferView:t.bufferView!==void 0?this.getBufferView(t.bufferView):void 0},s=this.images[r];return s&&(n.image=s),n}_resolveBufferView(t,r){let n=t.buffer,s=this.buffers[n].arrayBuffer,o=this.buffers[n].byteOffset||0;return t.byteOffset&&(o+=t.byteOffset),{id:`bufferView-${r}`,...t,buffer:this.buffers[n],data:new Uint8Array(s,o,t.byteLength)}}_resolveCamera(t,r){let n={...t,id:t.id||`camera-${r}`};return n.perspective,n.orthographic,n}};function Hn(e,t){return new Sa().postProcess(e,t)}var no={URI:0,EMBEDDED:1};function so(e,t,r,n){e.rotateYtoZ=!0;let s=(e.byteOffset||0)+(e.byteLength||0)-r;if(s===0)throw new Error("glTF byte length must be greater than 0.");return e.gltfUpAxis=n?.["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",e.gltfArrayBuffer=ze(t,r,s),e.gltfByteOffset=0,e.gltfByteLength=s,r%4===0||console.warn(`${e.type}: embedded glb is not aligned to a 4-byte boundary.`),(e.byteOffset||0)+(e.byteLength||0)}async function oo(e,t,r,n){let s=r?.["3d-tiles"]||{};if($x(e,t,r),s.loadGLTF){if(!n)return;if(e.gltfUrl){let{fetch:o}=n,i=await o(e.gltfUrl,r);e.gltfArrayBuffer=await i.arrayBuffer(),e.gltfByteOffset=0}if(e.gltfArrayBuffer){let o=await Pt(e.gltfArrayBuffer,qe,r,n);e.gltf=Hn(o),e.gpuMemoryUsageInBytes=Nn(e.gltf),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength}}}function $x(e,t,r){switch(t){case no.URI:if(e.gltfArrayBuffer){let n=new Uint8Array(e.gltfArrayBuffer,e.gltfByteOffset),o=new TextDecoder().decode(n);e.gltfUrl=o.replace(/[\s\0]+$/,"")}delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength;break;case no.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}async function Kl(e,t,r,n,s){r=tB(e,t,r,n,s),await oo(e,no.EMBEDDED,n,s);let o=e?.gltf?.extensions;return o&&o.CESIUM_RTC&&(e.rtcCenter=o.CESIUM_RTC.center),r}function tB(e,t,r,n,s){r=Se(e,t,r),r=Ur(e,t,r),r=Pr(e,t,r,n),r=so(e,t,r,n);let o=new kt(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=o.getGlobalProperty("RTC_CENTER",H.FLOAT,3),r}var de=6356752314245179e-9,eB={radii:[6378137,6378137,de],radiiSquared:[6378137*6378137,6378137*6378137,de*de],oneOverRadii:[1/6378137,1/6378137,1/de],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(de*de)],maximumRadius:Math.max(6378137,6378137,de),centerToleranceSquared:.1};function io(e){return e}var sS=new b;function rB(e,t=[],r=io){return"longitude"in e?(t[0]=r(e.longitude),t[1]=r(e.latitude),t[2]=e.height):"x"in e?(t[0]=r(e.x),t[1]=r(e.y),t[2]=e.z):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function Xl(e,t=[]){return rB(e,t,q._cartographicRadians?io:pi)}function nB(e,t,r=io){return"longitude"in t?(t.longitude=r(e[0]),t.latitude=r(e[1]),t.height=e[2]):"x"in t?(t.x=r(e[0]),t.y=r(e[1]),t.z=e[2]):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function Yl(e,t){return nB(e,t,q._cartographicRadians?io:gi)}var Zl=1e-14,sB=new b,ql={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},Ra={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},kn={east:new b,north:new b,up:new b,west:new b,south:new b,down:new b},oB=new b,iB=new b,aB=new b;function Fa(e,t,r,n,s,o){let i=ql[t]&&ql[t][r];ft(i&&(!n||n===i));let a,c,f,h=sB.copy(s);if(wt(h.x,0,Zl)&&wt(h.y,0,Zl)){let l=Math.sign(h.z);a=oB.fromArray(Ra[t]),t!=="east"&&t!=="west"&&a.scale(l),c=iB.fromArray(Ra[r]),r!=="east"&&r!=="west"&&c.scale(l),f=aB.fromArray(Ra[n]),n!=="east"&&n!=="west"&&f.scale(l)}else{let{up:l,east:d,north:A}=kn;d.set(-h.y,h.x,0).normalize(),e.geodeticSurfaceNormal(h,l),A.copy(l).cross(d);let{down:m,west:p,south:E}=kn;m.copy(l).scale(-1),p.copy(d).scale(-1),E.copy(A).scale(-1),a=kn[t],c=kn[r],f=kn[n]}return o[0]=a.x,o[1]=a.y,o[2]=a.z,o[3]=0,o[4]=c.x,o[5]=c.y,o[6]=c.z,o[7]=0,o[8]=f.x,o[9]=f.y,o[10]=f.z,o[11]=0,o[12]=h.x,o[13]=h.y,o[14]=h.z,o[15]=1,o}var Kr=new b,cB=new b,fB=new b;function Wl(e,t,r=[]){let{oneOverRadii:n,oneOverRadiiSquared:s,centerToleranceSquared:o}=t;Kr.from(e);let i=Kr.x,a=Kr.y,c=Kr.z,f=n.x,h=n.y,u=n.z,l=i*i*f*f,d=a*a*h*h,A=c*c*u*u,m=l+d+A,p=Math.sqrt(1/m);if(!Number.isFinite(p))return;let E=cB;if(E.copy(e).scale(p),m<o)return E.to(r);let y=s.x,C=s.y,M=s.z,T=fB;T.set(E.x*y*2,E.y*C*2,E.z*M*2);let I=(1-p)*Kr.len()/(.5*T.len()),w=0,L,x,g,B;do{I-=w,L=1/(1+I*y),x=1/(1+I*C),g=1/(1+I*M);let _=L*L,U=x*x,G=g*g,P=_*L,v=U*x,at=G*g;B=l*_+d*U+A*G-1;let X=-2*(l*P*y+d*v*C+A*at*M);w=B/X}while(Math.abs(B)>Ht.EPSILON12);return Kr.scale([L,x,g]).to(r)}var ao=new b,$l=new b,uB=new b,zt=new b,dB=new b,co=new b,Ae=class{constructor(t=0,r=0,n=0){this.centerToleranceSquared=Ht.EPSILON1,ft(t>=0),ft(r>=0),ft(n>=0),this.radii=new b(t,r,n),this.radiiSquared=new b(t*t,r*r,n*n),this.radiiToTheFourth=new b(t*t*t*t,r*r*r*r,n*n*n*n),this.oneOverRadii=new b(t===0?0:1/t,r===0?0:1/r,n===0?0:1/n),this.oneOverRadiiSquared=new b(t===0?0:1/(t*t),r===0?0:1/(r*r),n===0?0:1/(n*n)),this.minimumRadius=Math.min(t,r,n),this.maximumRadius=Math.max(t,r,n),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(t){return this===t||Boolean(t&&this.radii.equals(t.radii))}toString(){return this.radii.toString()}cartographicToCartesian(t,r=[0,0,0]){let n=$l,s=uB,[,,o]=t;this.geodeticSurfaceNormalCartographic(t,n),s.copy(this.radiiSquared).scale(n);let i=Math.sqrt(n.dot(s));return s.scale(1/i),n.scale(o),s.add(n),s.to(r)}cartesianToCartographic(t,r=[0,0,0]){co.from(t);let n=this.scaleToGeodeticSurface(co,zt);if(!n)return;let s=this.geodeticSurfaceNormal(n,$l),o=dB;o.copy(co).subtract(n);let i=Math.atan2(s.y,s.x),a=Math.asin(s.z),c=Math.sign(Ke.dot(o,co))*Ke.length(o);return Yl([i,a,c],r)}eastNorthUpToFixedFrame(t,r=new Rt){return Fa(this,"east","north","up",t,r)}localFrameToFixedFrame(t,r,n,s,o=new Rt){return Fa(this,t,r,n,s,o)}geocentricSurfaceNormal(t,r=[0,0,0]){return ao.from(t).normalize().to(r)}geodeticSurfaceNormalCartographic(t,r=[0,0,0]){let n=Xl(t),s=n[0],o=n[1],i=Math.cos(o);return ao.set(i*Math.cos(s),i*Math.sin(s),Math.sin(o)).normalize(),ao.to(r)}geodeticSurfaceNormal(t,r=[0,0,0]){return ao.from(t).scale(this.oneOverRadiiSquared).normalize().to(r)}scaleToGeodeticSurface(t,r){return Wl(t,this,r)}scaleToGeocentricSurface(t,r=[0,0,0]){zt.from(t);let n=zt.x,s=zt.y,o=zt.z,i=this.oneOverRadiiSquared,a=1/Math.sqrt(n*n*i.x+s*s*i.y+o*o*i.z);return zt.multiplyScalar(a).to(r)}transformPositionToScaledSpace(t,r=[0,0,0]){return zt.from(t).scale(this.oneOverRadii).to(r)}transformPositionFromScaledSpace(t,r=[0,0,0]){return zt.from(t).scale(this.radii).to(r)}getSurfaceNormalIntersectionWithZAxis(t,r=0,n=[0,0,0]){ft(wt(this.radii.x,this.radii.y,Ht.EPSILON15)),ft(this.radii.z>0),zt.from(t);let s=zt.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(s)>=this.radii.z-r))return zt.set(0,0,s).to(n)}};Ae.WGS84=new Ae(6378137,6378137,de);async function tu(e,t,r,n,s){return r=AB(e,t,r,n,s),await oo(e,e.gltfFormat||0,n,s),r}function AB(e,t,r,n,s){if(r=Se(e,t,r),e.version!==1)throw new Error(`Instanced 3D Model version ${e.version} is not supported`);r=Ur(e,t,r);let o=new DataView(t);if(e.gltfFormat=o.getUint32(r,!0),r+=4,r=Pr(e,t,r,n),r=so(e,t,r,n),!e?.header?.featureTableJsonByteLength||e.header.featureTableJsonByteLength===0)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");let i=new kt(e.featureTableJson,e.featureTableBinary),a=i.getGlobalProperty("INSTANCES_LENGTH");if(i.featuresLength=a,!Number.isFinite(a))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");e.eastNorthUp=i.getGlobalProperty("EAST_NORTH_UP"),e.rtcCenter=i.getGlobalProperty("RTC_CENTER",H.FLOAT,3);let c=new ue(e.batchTableJson,e.batchTableBinary,a);return mB(e,i,c,a),r}function mB(e,t,r,n){let s=new Array(n),o=new b,i=new b,a=new b,c=new b,f=new Z,h=new Ie,u=new b,l={},d=new Rt,A=[],m=[],p=[],E=[];for(let y=0;y<n;y++){let C;if(t.hasProperty("POSITION"))C=t.getProperty("POSITION",H.FLOAT,3,y,o);else if(t.hasProperty("POSITION_QUANTIZED")){C=t.getProperty("POSITION_QUANTIZED",H.UNSIGNED_SHORT,3,y,o);let g=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",H.FLOAT,3);if(!g)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let B=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",H.FLOAT,3);if(!B)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let _=65535;for(let U=0;U<3;U++)C[U]=C[U]/_*B[U]+g[U]}if(!C)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");o.copy(C),l.translation=o,e.normalUp=t.getProperty("NORMAL_UP",H.FLOAT,3,y,A),e.normalRight=t.getProperty("NORMAL_RIGHT",H.FLOAT,3,y,m);let M=!1;if(e.normalUp){if(!e.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");e.hasCustomOrientation=!0}else{if(e.octNormalUp=t.getProperty("NORMAL_UP_OCT32P",H.UNSIGNED_SHORT,2,y,A),e.octNormalRight=t.getProperty("NORMAL_RIGHT_OCT32P",H.UNSIGNED_SHORT,2,y,m),e.octNormalUp)throw e.octNormalRight?new Error("i3dm: oct-encoded orientation not implemented"):new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");e.eastNorthUp?(Ae.WGS84.eastNorthUpToFixedFrame(o,d),d.getRotationMatrix3(f)):f.identity()}M&&(c.copy(i).cross(a).normalize(),f.setColumn(0,i),f.setColumn(1,a),f.setColumn(2,c)),h.fromMatrix3(f),l.rotation=h,u.set(1,1,1);let T=t.getProperty("SCALE",H.FLOAT,1,y,p);Number.isFinite(T)&&u.multiplyByScalar(T);let I=t.getProperty("SCALE_NON_UNIFORM",H.FLOAT,3,y,A);I&&u.scale(I),l.scale=u;let w=t.getProperty("BATCH_ID",H.UNSIGNED_SHORT,1,y,E);w===void 0&&(w=y);let L=new Rt().fromQuaternion(l.rotation);d.identity(),d.translate(l.translation),d.multiplyRight(L),d.scale(l.scale);let x=d.clone();s[y]={modelMatrix:x,batchId:w}}e.instances=s}async function eu(e,t,r,n,s,o){r=Se(e,t,r);let i=new DataView(t);for(e.tilesLength=i.getUint32(r,!0),r+=4,e.tiles=[];e.tiles.length<e.tilesLength&&(e.byteLength||0)-r>12;){let a={shape:"tile3d"};e.tiles.push(a),r=await o(t,r,n,s,a)}return r}async function ru(e,t,r,n){if(e.rotateYtoZ=!0,e.gltfUpAxis=r?.["3d-tiles"]?.assetGltfUpAxis?r["3d-tiles"].assetGltfUpAxis:"Y",r?.["3d-tiles"]?.loadGLTF){if(!n)return t.byteLength;let s=await Pt(t,qe,r,n);e.gltf=Hn(s),e.gpuMemoryUsageInBytes=Nn(e.gltf)}else e.gltfArrayBuffer=t;return t.byteLength}async function Da(e,t=0,r,n,s={shape:"tile3d"}){switch(s.byteOffset=t,s.type=Rf(e,t),s.type){case _t.COMPOSITE:return await eu(s,e,t,r,n,Da);case _t.BATCHED_3D_MODEL:return await Kl(s,e,t,r,n);case _t.GLTF:return await ru(s,e,r,n);case _t.INSTANCED_3D_MODEL:return await tu(s,e,t,r,n);case _t.POINT_CLOUD:return await qh(s,e,t,r,n);default:throw new Error(`3DTileLoader: unknown type ${s.type}`)}}async function La(e,t,r){if(new Uint32Array(e.slice(0,4))[0]!==1952609651)throw new Error("Wrong subtree file magic number");if(new Uint32Array(e.slice(4,8))[0]!==1)throw new Error("Wrong subtree file verson, must be 1");let o=nu(e.slice(8,16)),i=new Uint8Array(e,24,o),c=new TextDecoder("utf8").decode(i),f=JSON.parse(c),h=nu(e.slice(16,24)),u=new ArrayBuffer(0);if(h&&(u=e.slice(24+o)),await fo(f,f.tileAvailability,u,r),Array.isArray(f.contentAvailability))for(let l of f.contentAvailability)await fo(f,l,u,r);else await fo(f,f.contentAvailability,u,r);return await fo(f,f.childSubtreeAvailability,u,r),f}async function fo(e,t,r,n){let s=Number.isFinite(t.bitstream)?t.bitstream:t.bufferView;if(typeof s!="number")return;let o=e.bufferViews[s],i=e.buffers[o.buffer];if(!n?.baseUrl)throw new Error("Url is not provided");if(!n.fetch)throw new Error("fetch is not provided");if(i.uri){let c=`${n?.baseUrl||""}/${i.uri}`,h=await(await n.fetch(c)).arrayBuffer();t.explicitBitstream=new Uint8Array(h,o.byteOffset,o.byteLength);return}let a=e.buffers.slice(0,o.buffer).reduce((c,f)=>c+f.byteLength,0);t.explicitBitstream=new Uint8Array(r.slice(a,a+i.byteLength),o.byteOffset,o.byteLength)}function nu(e){let t=new DataView(e),r=t.getUint32(0,!0),n=t.getUint32(4,!0);return r+2**32*n}var Xr={dataType:null,batchType:null,id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:Rr,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:La,options:{}};var Hu=xr(gn(),1);var Nu=xr(gn(),1);function Oa(e){if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&Boolean(process.versions.electron))return!0;let t=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}function Jt(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||Oa()}var pB=globalThis.self||globalThis.window||globalThis.global,Yr=globalThis.window||globalThis.self||globalThis.global,gB=globalThis.document||{},We=globalThis.process||{},xB=globalThis.console,YS=globalThis.navigator||{};var ho=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",WS=Jt();function BB(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var lo=class{constructor(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";this.storage=void 0,this.id=void 0,this.config=void 0,this.storage=BB(n),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}};function su(e){let t;return e<10?t="".concat(e.toFixed(2),"ms"):e<100?t="".concat(e.toFixed(1),"ms"):e<1e3?t="".concat(e.toFixed(0),"ms"):t="".concat((e/1e3).toFixed(2),"s"),t}function ou(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}function uo(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,s=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));let o=e.width*r,i=e.height*r,a=["font-size:1px;","padding:".concat(Math.floor(i/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(i,"px;"),"background:url(".concat(s,");"),"background-size:".concat(o,"px ").concat(i,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),a]}var Ao;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Ao||(Ao={}));var EB=10;function iu(e){return typeof e!="string"?e:(e=e.toUpperCase(),Ao[e]||Ao.WHITE)}function au(e,t,r){if(!Jt&&typeof e=="string"){if(t){let n=iu(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=iu(r);e="\x1B[".concat(n+EB,"m").concat(e,"\x1B[49m")}}return e}function cu(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),s=e;for(let o of n){let i=s[o];typeof i=="function"&&(t.find(a=>o===a)||(s[o]=i.bind(e)))}}function Zr(e,t){if(!e)throw new Error(t||"Assertion failed")}function $e(){let e;if(Jt()&&Yr.performance){var t,r;e=Yr===null||Yr===void 0||(t=Yr.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in We){var n;let s=We===null||We===void 0||(n=We.hrtime)===null||n===void 0?void 0:n.call(We);e=s[0]*1e3+s[1]/1e6}else e=Date.now();return e}var qr={debug:Jt()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},_B={enabled:!0,level:0};function Dt(){}var fu={},hu={once:!0},zn=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=ho,this._startTs=$e(),this._deltaTs=$e(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new lo("__probe-".concat(this.id,"__"),_B),this.timeStamp("".concat(this.id," started")),cu(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number(($e()-this._startTs).toPrecision(10))}getDelta(){return Number(($e()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,r){this._storage.setConfiguration({[t]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,r){Zr(t,r)}warn(t){return this._getLogFunction(0,t,qr.warn,arguments,hu)}error(t){return this._getLogFunction(0,t,qr.error,arguments)}deprecated(t,r){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(t,r){return this.error("`".concat(t,"` has been removed. Use `").concat(r,"` instead"))}probe(t,r){return this._getLogFunction(t,r,qr.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,qr.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,qr.debug||qr.info,arguments,hu)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||Dt,n&&[n],{tag:MB(r)}):Dt}image(t){let{logLevel:r,priority:n,image:s,message:o="",scale:i=1}=t;return this._shouldLog(r||n)?Jt()?CB({image:s,message:o,scale:i}):TB({image:s,message:o,scale:i}):Dt}time(t,r){return this._getLogFunction(t,r,console.time?console.time:console.info)}timeEnd(t,r){return this._getLogFunction(t,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,r){return this._getLogFunction(t,r,console.timeStamp||Dt)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},s=lu({logLevel:t,message:r,opts:n}),{collapsed:o}=n;return s.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(s)}groupCollapsed(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,r,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||Dt)}withGroup(t,r,n){this.group(t,r)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=uu(t)}_getLogFunction(t,r,n,s,o){if(this._shouldLog(t)){o=lu({logLevel:t,message:r,args:s,opts:o}),n=n||o.method,Zr(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=$e();let i=o.tag||o.message;if(o.once&&i)if(!fu[i])fu[i]=$e();else return Dt;return r=yB(this.id,o.message,o),n.bind(console,r,...o.args)}return Dt}};zn.VERSION=ho;function uu(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return Zr(Number.isFinite(t)&&t>=0),t}function lu(e){let{logLevel:t,message:r}=e;e.logLevel=uu(t);let n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let s=typeof e.message;return Zr(s==="string"||s==="object"),Object.assign(e,{args:n},e.opts)}function yB(e,t,r){if(typeof t=="string"){let n=r.time?ou(su(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=au(t,r.color,r.background)}return t}function TB(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),Dt}function CB(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let o=new Image;return o.onload=()=>{let i=uo(o,r,n);console.log(...i)},o.src=t,Dt}let s=t.nodeName||"";if(s.toLowerCase()==="img")return console.log(...uo(t,r,n)),Dt;if(s.toLowerCase()==="canvas"){let o=new Image;return o.onload=()=>console.log(...uo(o,r,n)),o.src=t.toDataURL(),Dt}return Dt}function MB(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var va=new zn({id:"@probe.gl/log"});var Lt=null;try{Lt=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function Y(e,t,r){this.low=e|0,this.high=t|0,this.unsigned=!!r}Y.prototype.__isLong__;Object.defineProperty(Y.prototype,"__isLong__",{value:!0});function At(e){return(e&&e.__isLong__)===!0}function du(e){var t=Math.clz32(e&-e);return e?31-t:t}Y.isLong=At;var Au={},mu={};function tr(e,t){var r,n,s;return t?(e>>>=0,(s=0<=e&&e<256)&&(n=mu[e],n)?n:(r=Q(e,0,!0),s&&(mu[e]=r),r)):(e|=0,(s=-128<=e&&e<128)&&(n=Au[e],n)?n:(r=Q(e,e<0?-1:0,!1),s&&(Au[e]=r),r))}Y.fromInt=tr;function Ot(e,t){if(isNaN(e))return t?me:Qt;if(t){if(e<0)return me;if(e>=Bu)return yu}else{if(e<=-gu)return Ct;if(e+1>=gu)return _u}return e<0?Ot(-e,t).neg():Q(e%$r|0,e/$r|0,t)}Y.fromNumber=Ot;function Q(e,t,r){return new Y(e,t,r)}Y.fromBits=Q;var mo=Math.pow;function Ga(e,t,r){if(e.length===0)throw Error("empty string");if(typeof t=="number"?(r=t,t=!1):t=!!t,e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return t?me:Qt;if(r=r||10,r<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(n===0)return Ga(e.substring(1),t,r).neg();for(var s=Ot(mo(r,8)),o=Qt,i=0;i<e.length;i+=8){var a=Math.min(8,e.length-i),c=parseInt(e.substring(i,i+a),r);if(a<8){var f=Ot(mo(r,a));o=o.mul(f).add(Ot(c))}else o=o.mul(s),o=o.add(Ot(c))}return o.unsigned=t,o}Y.fromString=Ga;function Vt(e,t){return typeof e=="number"?Ot(e,t):typeof e=="string"?Ga(e,t):Q(e.low,e.high,typeof t=="boolean"?t:e.unsigned)}Y.fromValue=Vt;var pu=1<<16,bB=1<<24,$r=pu*pu,Bu=$r*$r,gu=Bu/2,xu=tr(bB),Qt=tr(0);Y.ZERO=Qt;var me=tr(0,!0);Y.UZERO=me;var Wr=tr(1);Y.ONE=Wr;var Eu=tr(1,!0);Y.UONE=Eu;var Na=tr(-1);Y.NEG_ONE=Na;var _u=Q(-1,2147483647,!1);Y.MAX_VALUE=_u;var yu=Q(-1,-1,!0);Y.MAX_UNSIGNED_VALUE=yu;var Ct=Q(0,-2147483648,!1);Y.MIN_VALUE=Ct;var O=Y.prototype;O.toInt=function(){return this.unsigned?this.low>>>0:this.low};O.toNumber=function(){return this.unsigned?(this.high>>>0)*$r+(this.low>>>0):this.high*$r+(this.low>>>0)};O.toString=function(t){if(t=t||10,t<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(Ct)){var r=Ot(t),n=this.div(r),s=n.mul(r).sub(this);return n.toString(t)+s.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var o=Ot(mo(t,6),this.unsigned),i=this,a="";;){var c=i.div(o),f=i.sub(c.mul(o)).toInt()>>>0,h=f.toString(t);if(i=c,i.isZero())return h+a;for(;h.length<6;)h="0"+h;a=""+h+a}};O.getHighBits=function(){return this.high};O.getHighBitsUnsigned=function(){return this.high>>>0};O.getLowBits=function(){return this.low};O.getLowBitsUnsigned=function(){return this.low>>>0};O.getNumBitsAbs=function(){if(this.isNegative())return this.eq(Ct)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,r=31;r>0&&!(t&1<<r);r--);return this.high!=0?r+33:r+1};O.isZero=function(){return this.high===0&&this.low===0};O.eqz=O.isZero;O.isNegative=function(){return!this.unsigned&&this.high<0};O.isPositive=function(){return this.unsigned||this.high>=0};O.isOdd=function(){return(this.low&1)===1};O.isEven=function(){return(this.low&1)===0};O.equals=function(t){return At(t)||(t=Vt(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low};O.eq=O.equals;O.notEquals=function(t){return!this.eq(t)};O.neq=O.notEquals;O.ne=O.notEquals;O.lessThan=function(t){return this.comp(t)<0};O.lt=O.lessThan;O.lessThanOrEqual=function(t){return this.comp(t)<=0};O.lte=O.lessThanOrEqual;O.le=O.lessThanOrEqual;O.greaterThan=function(t){return this.comp(t)>0};O.gt=O.greaterThan;O.greaterThanOrEqual=function(t){return this.comp(t)>=0};O.gte=O.greaterThanOrEqual;O.ge=O.greaterThanOrEqual;O.compare=function(t){if(At(t)||(t=Vt(t)),this.eq(t))return 0;var r=this.isNegative(),n=t.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1};O.comp=O.compare;O.negate=function(){return!this.unsigned&&this.eq(Ct)?Ct:this.not().add(Wr)};O.neg=O.negate;O.add=function(t){At(t)||(t=Vt(t));var r=this.high>>>16,n=this.high&65535,s=this.low>>>16,o=this.low&65535,i=t.high>>>16,a=t.high&65535,c=t.low>>>16,f=t.low&65535,h=0,u=0,l=0,d=0;return d+=o+f,l+=d>>>16,d&=65535,l+=s+c,u+=l>>>16,l&=65535,u+=n+a,h+=u>>>16,u&=65535,h+=r+i,h&=65535,Q(l<<16|d,h<<16|u,this.unsigned)};O.subtract=function(t){return At(t)||(t=Vt(t)),this.add(t.neg())};O.sub=O.subtract;O.multiply=function(t){if(this.isZero())return this;if(At(t)||(t=Vt(t)),Lt){var r=Lt.mul(this.low,this.high,t.low,t.high);return Q(r,Lt.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?me:Qt;if(this.eq(Ct))return t.isOdd()?Ct:Qt;if(t.eq(Ct))return this.isOdd()?Ct:Qt;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(xu)&&t.lt(xu))return Ot(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,s=this.high&65535,o=this.low>>>16,i=this.low&65535,a=t.high>>>16,c=t.high&65535,f=t.low>>>16,h=t.low&65535,u=0,l=0,d=0,A=0;return A+=i*h,d+=A>>>16,A&=65535,d+=o*h,l+=d>>>16,d&=65535,d+=i*f,l+=d>>>16,d&=65535,l+=s*h,u+=l>>>16,l&=65535,l+=o*f,u+=l>>>16,l&=65535,l+=i*c,u+=l>>>16,l&=65535,u+=n*h+s*f+o*c+i*a,u&=65535,Q(d<<16|A,u<<16|l,this.unsigned)};O.mul=O.multiply;O.divide=function(t){if(At(t)||(t=Vt(t)),t.isZero())throw Error("division by zero");if(Lt){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var r=(this.unsigned?Lt.div_u:Lt.div_s)(this.low,this.high,t.low,t.high);return Q(r,Lt.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?me:Qt;var n,s,o;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return me;if(t.gt(this.shru(1)))return Eu;o=me}else{if(this.eq(Ct)){if(t.eq(Wr)||t.eq(Na))return Ct;if(t.eq(Ct))return Wr;var i=this.shr(1);return n=i.div(t).shl(1),n.eq(Qt)?t.isNegative()?Wr:Na:(s=this.sub(t.mul(n)),o=n.add(s.div(t)),o)}else if(t.eq(Ct))return this.unsigned?me:Qt;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();o=Qt}for(s=this;s.gte(t);){n=Math.max(1,Math.floor(s.toNumber()/t.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),c=a<=48?1:mo(2,a-48),f=Ot(n),h=f.mul(t);h.isNegative()||h.gt(s);)n-=c,f=Ot(n,this.unsigned),h=f.mul(t);f.isZero()&&(f=Wr),o=o.add(f),s=s.sub(h)}return o};O.div=O.divide;O.modulo=function(t){if(At(t)||(t=Vt(t)),Lt){var r=(this.unsigned?Lt.rem_u:Lt.rem_s)(this.low,this.high,t.low,t.high);return Q(r,Lt.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))};O.mod=O.modulo;O.rem=O.modulo;O.not=function(){return Q(~this.low,~this.high,this.unsigned)};O.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};O.clz=O.countLeadingZeros;O.countTrailingZeros=function(){return this.low?du(this.low):du(this.high)+32};O.ctz=O.countTrailingZeros;O.and=function(t){return At(t)||(t=Vt(t)),Q(this.low&t.low,this.high&t.high,this.unsigned)};O.or=function(t){return At(t)||(t=Vt(t)),Q(this.low|t.low,this.high|t.high,this.unsigned)};O.xor=function(t){return At(t)||(t=Vt(t)),Q(this.low^t.low,this.high^t.high,this.unsigned)};O.shiftLeft=function(t){return At(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Q(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):Q(0,this.low<<t-32,this.unsigned)};O.shl=O.shiftLeft;O.shiftRight=function(t){return At(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Q(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):Q(this.high>>t-32,this.high>=0?0:-1,this.unsigned)};O.shr=O.shiftRight;O.shiftRightUnsigned=function(t){return At(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Q(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?Q(this.high,0,this.unsigned):Q(this.high>>>t-32,0,this.unsigned)};O.shru=O.shiftRightUnsigned;O.shr_u=O.shiftRightUnsigned;O.rotateLeft=function(t){var r;return At(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?Q(this.high,this.low,this.unsigned):t<32?(r=32-t,Q(this.low<<t|this.high>>>r,this.high<<t|this.low>>>r,this.unsigned)):(t-=32,r=32-t,Q(this.high<<t|this.low>>>r,this.low<<t|this.high>>>r,this.unsigned))};O.rotl=O.rotateLeft;O.rotateRight=function(t){var r;return At(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?Q(this.high,this.low,this.unsigned):t<32?(r=32-t,Q(this.high<<r|this.low>>>t,this.low<<r|this.high>>>t,this.unsigned)):(t-=32,r=32-t,Q(this.low<<r|this.high>>>t,this.high<<r|this.low>>>t,this.unsigned))};O.rotr=O.rotateRight;O.toSigned=function(){return this.unsigned?Q(this.low,this.high,!1):this};O.toUnsigned=function(){return this.unsigned?this:Q(this.low,this.high,!0)};O.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()};O.toBytesLE=function(){var t=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]};O.toBytesBE=function(){var t=this.high,r=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,r>>>24,r>>>16&255,r>>>8&255,r&255]};Y.fromBytes=function(t,r,n){return n?Y.fromBytesLE(t,r):Y.fromBytesBE(t,r)};Y.fromBytesLE=function(t,r){return new Y(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r)};Y.fromBytesBE=function(t,r){return new Y(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],r)};var tn=Y;var wB=16;function Jn(e){e==="X"&&(e="");let t=e.padEnd(wB,"0");return tn.fromString(t,!0,16)}function Ua(e){if(e.isZero())return"X";let t=e.countTrailingZeros(),r=t%4;t=(t-r)/4;let n=t;t*=4;let o=e.shiftRightUnsigned(t).toString(16).replace(/0+$/,"");return Array(17-n-o.length).join("0")+o}function Pa(e,t){let r=IB(e).shiftRightUnsigned(2);return e.add(tn.fromNumber(2*t+1-4).multiply(r))}function IB(e){return e.and(e.not().add(1))}var SB=3,RB=30,FB=2*RB+1,Tu=180/Math.PI;function Mu(e){if(e.length===0)throw new Error(`Invalid Hilbert quad key ${e}`);let t=e.split("/"),r=parseInt(t[0],10),n=t[1],s=n.length,o=0,i=[0,0];for(let a=s-1;a>=0;a--){o=s-a;let c=n[a],f=0,h=0;c==="1"?h=1:c==="2"?(f=1,h=1):c==="3"&&(f=1);let u=Math.pow(2,o-1);DB(u,i,f,h),i[0]+=u*f,i[1]+=u*h}if(r%2===1){let a=i[0];i[0]=i[1],i[1]=a}return{face:r,ij:i,level:o}}function bu(e){if(e.isZero())return"";let t=e.toString(2);for(;t.length<SB+FB;)t="0"+t;let r=t.lastIndexOf("1"),n=t.substring(0,3),s=t.substring(3,r),o=s.length/2,i=tn.fromString(n,!0,2).toString(10),a="";if(o!==0)for(a=tn.fromString(s,!0,2).toString(4);a.length<o;)a="0"+a;return`${i}/${a}`}function Ha(e,t,r){let n=1<<t;return[(e[0]+r[0])/n,(e[1]+r[1])/n]}function Cu(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function ka(e){return[Cu(e[0]),Cu(e[1])]}function za(e,[t,r]){switch(e){case 0:return[1,t,r];case 1:return[-t,1,r];case 2:return[-t,-r,1];case 3:return[-1,-r,-t];case 4:return[r,-1,-t];case 5:return[r,t,-1];default:throw new Error("Invalid face")}}function Ja([e,t,r]){let n=Math.atan2(r,Math.sqrt(e*e+t*t));return[Math.atan2(t,e)*Tu,n*Tu]}function DB(e,t,r,n){if(n===0){r===1&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);let s=t[0];t[0]=t[1],t[1]=s}}function wu(e){let t=Ha(e.ij,e.level,[.5,.5]),r=ka(t),n=za(e.face,r);return Ja(n)}var LB=100;function Qa(e){let{face:t,ij:r,level:n}=e,s=[[0,0],[0,1],[1,1],[1,0],[0,0]],o=Math.max(1,Math.ceil(LB*Math.pow(2,-n))),i=new Float64Array(4*o*2+2),a=0,c=0;for(let f=0;f<4;f++){let h=s[f].slice(0),u=s[f+1],l=(u[0]-h[0])/o,d=(u[1]-h[1])/o;for(let A=0;A<o;A++){h[0]+=l,h[1]+=d;let m=Ha(r,n,h),p=ka(m),E=za(t,p),y=Ja(E);Math.abs(y[1])>89.999&&(y[0]=c);let C=y[0]-c;y[0]+=C>180?-360:C<-180?360:0,i[a++]=y[0],i[a++]=y[1],c=y[0]}}return i[a++]=i[0],i[a++]=i[1],i}function en(e){let t=OB(e);return Mu(t)}function OB(e){if(e.indexOf("/")>0)return e;let t=Jn(e);return bu(t)}function Va(e){let t=en(e);return wu(t)}function Su(e){let t;if(e.face===2||e.face===5){let r=null,n=0;for(let s=0;s<4;s++){let o=`${e.face}/${s}`,i=en(o),a=Qa(i);(typeof r>"u"||r===null)&&(r=new Float64Array(4*a.length)),r.set(a,n),n+=a.length}t=Iu(r)}else{let r=Qa(e);t=Iu(r)}return t}function Iu(e){if(e.length%2!==0)throw new Error("Invalid corners");let t=[],r=[];for(let n=0;n<e.length;n+=2)t.push(e[n]),r.push(e[n+1]);return t.sort((n,s)=>n-s),r.sort((n,s)=>n-s),{west:t[0],east:t[t.length-1],north:r[r.length-1],south:r[0]}}function ja(e,t){let r=t?.minimumHeight||0,n=t?.maximumHeight||0,s=en(e),o=Su(s),i=o.west,a=o.south,c=o.east,f=o.north,h=[];return h.push(new b(i,f,r)),h.push(new b(c,f,r)),h.push(new b(c,a,r)),h.push(new b(i,a,r)),h.push(new b(i,f,n)),h.push(new b(c,f,n)),h.push(new b(c,a,n)),h.push(new b(i,a,n)),h}var ht={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var WR=new b,$R=new b;var Qn=new b,Ru=new b,Fe=class{constructor(t=[0,0,0],r=0){this.radius=-0,this.center=new b,this.fromCenterRadius(t,r)}fromCenterRadius(t,r){return this.center.from(t),this.radius=r,this}fromCornerPoints(t,r){return r=Qn.from(r),this.center=new b().from(t).add(r).scale(.5),this.radius=this.center.distance(r),this}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.radius===t.radius}clone(){return new Fe(this.center,this.radius)}union(t){let r=this.center,n=this.radius,s=t.center,o=t.radius,i=Qn.copy(s).subtract(r),a=i.magnitude();if(n>=a+o)return this.clone();if(o>=a+n)return t.clone();let c=(n+a+o)*.5;return Ru.copy(i).scale((-n+c)/a).add(r),this.center.copy(Ru),this.radius=c,this}expand(t){let n=Qn.from(t).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(t){this.center.transform(t);let r=Fn.getScaling(Qn,t);return this.radius=Math.max(r[0],Math.max(r[1],r[2]))*this.radius,this}distanceSquaredTo(t){let r=this.distanceTo(t);return r*r}distanceTo(t){let n=Qn.from(t).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(t){let r=this.center,n=this.radius,o=t.normal.dot(r)+t.distance;return o<-n?ht.OUTSIDE:o<n?ht.INTERSECTING:ht.INSIDE}};var vB=new b,NB=new b,po=new b,go=new b,xo=new b,GB=new b,UB=new b,pe={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},er=class{constructor(t=[0,0,0],r=[0,0,0,0,0,0,0,0,0]){this.center=new b().from(t),this.halfAxes=new Z(r)}get halfSize(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new b(t).len(),new b(r).len(),new b(n).len()]}get quaternion(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),s=new b(t).normalize(),o=new b(r).normalize(),i=new b(n).normalize();return new Ie().fromMatrix3(new Z([...s,...o,...i]))}fromCenterHalfSizeQuaternion(t,r,n){let s=new Ie(n),o=new Z().fromQuaternion(s);return o[0]=o[0]*r[0],o[1]=o[1]*r[0],o[2]=o[2]*r[0],o[3]=o[3]*r[1],o[4]=o[4]*r[1],o[5]=o[5]*r[1],o[6]=o[6]*r[2],o[7]=o[7]*r[2],o[8]=o[8]*r[2],this.center=new b().from(t),this.halfAxes=o,this}clone(){return new er(this.center,this.halfAxes)}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}getBoundingSphere(t=new Fe){let r=this.halfAxes,n=r.getColumn(0,po),s=r.getColumn(1,go),o=r.getColumn(2,xo),i=vB.copy(n).add(s).add(o);return t.center.copy(this.center),t.radius=i.magnitude(),t}intersectPlane(t){let r=this.center,n=t.normal,s=this.halfAxes,o=n.x,i=n.y,a=n.z,c=Math.abs(o*s[pe.COLUMN0ROW0]+i*s[pe.COLUMN0ROW1]+a*s[pe.COLUMN0ROW2])+Math.abs(o*s[pe.COLUMN1ROW0]+i*s[pe.COLUMN1ROW1]+a*s[pe.COLUMN1ROW2])+Math.abs(o*s[pe.COLUMN2ROW0]+i*s[pe.COLUMN2ROW1]+a*s[pe.COLUMN2ROW2]),f=n.dot(r)+t.distance;return f<=-c?ht.OUTSIDE:f>=c?ht.INSIDE:ht.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){let r=NB.from(t).subtract(this.center),n=this.halfAxes,s=n.getColumn(0,po),o=n.getColumn(1,go),i=n.getColumn(2,xo),a=s.magnitude(),c=o.magnitude(),f=i.magnitude();s.normalize(),o.normalize(),i.normalize();let h=0,u;return u=Math.abs(r.dot(s))-a,u>0&&(h+=u*u),u=Math.abs(r.dot(o))-c,u>0&&(h+=u*u),u=Math.abs(r.dot(i))-f,u>0&&(h+=u*u),h}computePlaneDistances(t,r,n=[-0,-0]){let s=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=this.center,a=this.halfAxes,c=a.getColumn(0,po),f=a.getColumn(1,go),h=a.getColumn(2,xo),u=GB.copy(c).add(f).add(h).add(i),l=UB.copy(u).subtract(t),d=r.dot(l);return s=Math.min(d,s),o=Math.max(d,o),u.copy(i).add(c).add(f).subtract(h),l.copy(u).subtract(t),d=r.dot(l),s=Math.min(d,s),o=Math.max(d,o),u.copy(i).add(c).subtract(f).add(h),l.copy(u).subtract(t),d=r.dot(l),s=Math.min(d,s),o=Math.max(d,o),u.copy(i).add(c).subtract(f).subtract(h),l.copy(u).subtract(t),d=r.dot(l),s=Math.min(d,s),o=Math.max(d,o),i.copy(u).subtract(c).add(f).add(h),l.copy(u).subtract(t),d=r.dot(l),s=Math.min(d,s),o=Math.max(d,o),i.copy(u).subtract(c).add(f).subtract(h),l.copy(u).subtract(t),d=r.dot(l),s=Math.min(d,s),o=Math.max(d,o),i.copy(u).subtract(c).subtract(f).add(h),l.copy(u).subtract(t),d=r.dot(l),s=Math.min(d,s),o=Math.max(d,o),i.copy(u).subtract(c).subtract(f).subtract(h),l.copy(u).subtract(t),d=r.dot(l),s=Math.min(d,s),o=Math.max(d,o),n[0]=s,n[1]=o,n}transform(t){this.center.transformAsPoint(t);let r=this.halfAxes.getColumn(0,po);r.transformAsPoint(t);let n=this.halfAxes.getColumn(1,go);n.transformAsPoint(t);let s=this.halfAxes.getColumn(2,xo);return s.transformAsPoint(t),this.halfAxes=new Z([...r,...n,...s]),this}getTransform(){throw new Error("not implemented")}};var Fu=new b,Du=new b,ge=class{constructor(t=[0,0,1],r=0){this.normal=new b,this.distance=-0,this.fromNormalDistance(t,r)}fromNormalDistance(t,r){return ft(Number.isFinite(r)),this.normal.from(t).normalize(),this.distance=r,this}fromPointNormal(t,r){t=Fu.from(t),this.normal.from(r).normalize();let n=-this.normal.dot(t);return this.distance=n,this}fromCoefficients(t,r,n,s){return this.normal.set(t,r,n),ft(wt(this.normal.len(),1)),this.distance=s,this}clone(){return new ge(this.normal,this.distance)}equals(t){return wt(this.distance,t.distance)&&wt(this.normal,t.normal)}getPointDistance(t){return this.normal.dot(t)+this.distance}transform(t){let r=Du.copy(this.normal).transformAsVector(t).normalize(),n=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(n,r)}projectPointOntoPlane(t,r=[0,0,0]){let n=Fu.from(t),s=this.getPointDistance(n),o=Du.copy(this.normal).scale(s);return n.subtract(o).to(r)}};var Lu=[new b([1,0,0]),new b([0,1,0]),new b([0,0,1])],Ou=new b,PB=new b,vt=class{constructor(t=[]){this.planes=t}fromBoundingSphere(t){this.planes.length=2*Lu.length;let r=t.center,n=t.radius,s=0;for(let o of Lu){let i=this.planes[s],a=this.planes[s+1];i||(i=this.planes[s]=new ge),a||(a=this.planes[s+1]=new ge);let c=Ou.copy(o).scale(-n).add(r);i.fromPointNormal(c,o);let f=Ou.copy(o).scale(n).add(r),h=PB.copy(o).negate();a.fromPointNormal(f,h),s+=2}return this}computeVisibility(t){let r=ht.INSIDE;for(let n of this.planes)switch(t.intersectPlane(n)){case ht.OUTSIDE:return ht.OUTSIDE;case ht.INTERSECTING:r=ht.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(t,r){if(ft(Number.isFinite(r),"parentPlaneMask is required."),r===vt.MASK_OUTSIDE||r===vt.MASK_INSIDE)return r;let n=vt.MASK_INSIDE,s=this.planes;for(let o=0;o<this.planes.length;++o){let i=o<31?1<<o:0;if(o<31&&!(r&i))continue;let a=s[o],c=t.intersectPlane(a);if(c===ht.OUTSIDE)return vt.MASK_OUTSIDE;c===ht.INTERSECTING&&(n|=i)}return n}};vt.MASK_OUTSIDE=4294967295;vt.MASK_INSIDE=0;vt.MASK_INDETERMINATE=2147483647;var gF=new b,xF=new b,BF=new b,EF=new b,_F=new b;var wF=new b,IF=new b,SF=new b,RF=new b,FF=new b,DF=new b,LF=new b,OF=new b,vF=new b,NF=new b,GF=new b,UF=new b;var re=new Z,kB=new Z,zB=new Z,Bo=new Z,vu=new Z;function Ya(e,t={}){let r=Ht.EPSILON20,n=10,s=0,o=0,i=kB,a=zB;i.identity(),a.copy(e);let c=r*JB(a);for(;o<n&&QB(a)>c;)VB(a,Bo),vu.copy(Bo).transpose(),a.multiplyRight(Bo),a.multiplyLeft(vu),i.multiplyRight(Bo),++s>2&&(++o,s=0);return t.unitary=i.toTarget(t.unitary),t.diagonal=a.toTarget(t.diagonal),t}function JB(e){let t=0;for(let r=0;r<9;++r){let n=e[r];t+=n*n}return Math.sqrt(t)}var Ka=[1,0,0],Xa=[2,2,1];function QB(e){let t=0;for(let r=0;r<3;++r){let n=e[re.getElementIndex(Xa[r],Ka[r])];t+=2*n*n}return Math.sqrt(t)}function VB(e,t){let r=Ht.EPSILON15,n=0,s=1;for(let f=0;f<3;++f){let h=Math.abs(e[re.getElementIndex(Xa[f],Ka[f])]);h>n&&(s=f,n=h)}let o=Ka[s],i=Xa[s],a=1,c=0;if(Math.abs(e[re.getElementIndex(i,o)])>r){let f=e[re.getElementIndex(i,i)],h=e[re.getElementIndex(o,o)],u=e[re.getElementIndex(i,o)],l=(f-h)/2/u,d;l<0?d=-1/(-l+Math.sqrt(1+l*l)):d=1/(l+Math.sqrt(1+l*l)),a=1/Math.sqrt(1+d*d),c=d*a}return Z.IDENTITY.to(t),t[re.getElementIndex(o,o)]=t[re.getElementIndex(i,i)]=a,t[re.getElementIndex(i,o)]=c,t[re.getElementIndex(o,i)]=-c,t}var De=new b,KB=new b,XB=new b,YB=new b,ZB=new b,qB=new Z,WB={diagonal:new Z,unitary:new Z};function Za(e,t=new er){if(!e||e.length===0)return t.halfAxes=new Z([0,0,0,0,0,0,0,0,0]),t.center=new b,t;let r=e.length,n=new b(0,0,0);for(let x of e)n.add(x);let s=1/r;n.multiplyByScalar(s);let o=0,i=0,a=0,c=0,f=0,h=0;for(let x of e){let g=De.copy(x).subtract(n);o+=g.x*g.x,i+=g.x*g.y,a+=g.x*g.z,c+=g.y*g.y,f+=g.y*g.z,h+=g.z*g.z}o*=s,i*=s,a*=s,c*=s,f*=s,h*=s;let u=qB;u[0]=o,u[1]=i,u[2]=a,u[3]=i,u[4]=c,u[5]=f,u[6]=a,u[7]=f,u[8]=h;let{unitary:l}=Ya(u,WB),d=t.halfAxes.copy(l),A=d.getColumn(0,XB),m=d.getColumn(1,YB),p=d.getColumn(2,ZB),E=-Number.MAX_VALUE,y=-Number.MAX_VALUE,C=-Number.MAX_VALUE,M=Number.MAX_VALUE,T=Number.MAX_VALUE,I=Number.MAX_VALUE;for(let x of e)De.copy(x),E=Math.max(De.dot(A),E),y=Math.max(De.dot(m),y),C=Math.max(De.dot(p),C),M=Math.min(De.dot(A),M),T=Math.min(De.dot(m),T),I=Math.min(De.dot(p),I);A=A.multiplyByScalar(.5*(M+E)),m=m.multiplyByScalar(.5*(T+y)),p=p.multiplyByScalar(.5*(I+C)),t.center.copy(A).add(m).add(p);let w=KB.set(E-M,y-T,C-I).multiplyByScalar(.5),L=new Z([w[0],0,0,0,w[1],0,0,0,w[2]]);return t.halfAxes.multiplyRight(L),t}function Eo(e){let t=e.token,r={minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight},n=ja(t,r),s=Va(t),o=s[0],i=s[1],a=Ae.WGS84.cartographicToCartesian([o,i,r.maximumHeight]),c=new b(a[0],a[1],a[2]);n.push(c);let f=Za(n);return[...f.center,...f.halfAxes]}var $B=4,t2=8,e2={QUADTREE:$B,OCTREE:t2};function r2(e,t,r){if(e?.box){let n=Jn(e.s2VolumeInfo.token),s=Pa(n,t),o=Ua(s),i={...e.s2VolumeInfo};switch(i.token=o,r){case"OCTREE":let f=e.s2VolumeInfo,h=f.maximumHeight-f.minimumHeight,u=h/2,l=f.minimumHeight+h/2;f.minimumHeight=l-u,f.maximumHeight=l+u;break;default:break}return{box:Eo(i),s2VolumeInfo:i}}}async function Wa(e){let{implicitOptions:t,parentData:r={mortonIndex:0,x:0,y:0,z:0},childIndex:n=0,s2VolumeBox:s,loaderOptions:o}=e,{subtree:i,level:a=0,globalData:c={level:0,mortonIndex:0,x:0,y:0,z:0}}=e,{subdivisionScheme:f,subtreeLevels:h,maximumLevel:u,contentUrlTemplate:l,subtreesUriTemplate:d,basePath:A}=t,m={children:[],lodMetricValue:0,contentUrl:""};if(!u)return va.once(`Missing 'maximumLevel' or 'availableLevels' property. The subtree ${l} won't be loaded...`),m;let p=a+c.level;if(p>u)return m;let E=e2[f],y=Math.log2(E),C=n&1,M=n>>1&1,T=n>>2&1,I=(E**a-1)/(E-1),w=rr(r.mortonIndex,n,y),L=I+w,x=rr(r.x,C,1),g=rr(r.y,M,1),B=rr(r.z,T,1),_=!1;a>=h&&(_=qa(i.childSubtreeAvailability,w));let U=rr(c.x,x,a),G=rr(c.y,g,a),P=rr(c.z,B,a);if(_){let ke=`${A}/${d}`,us=_o(ke,p,U,G,P);i=await(0,Nu.load)(us,Xr,o),c={mortonIndex:w,x,y:g,z:B,level:a},w=0,L=0,x=0,g=0,B=0,a=0}if(!qa(i.tileAvailability,L))return m;qa(i.contentAvailability,L)&&(m.contentUrl=_o(l,p,U,G,P));let mt=a+1,X={mortonIndex:w,x,y:g,z:B};for(let ke=0;ke<E;ke++){let us=r2(s,ke,f),gr=await Wa({subtree:i,implicitOptions:t,loaderOptions:o,parentData:X,childIndex:ke,level:mt,globalData:{...c},s2VolumeBox:us});if(gr.contentUrl||gr.children.length){let S=p+1,R=n2(gr,S,{childTileX:x,childTileY:g,childTileZ:B},t,s);m.children.push(R)}}return m}function qa(e,t){let r;return Array.isArray(e)?(r=e[0],e.length>1&&va.once('Not supported extension "3DTILES_multiple_contents" has been detected')):r=e,"constant"in r?Boolean(r.constant):r.explicitBitstream?i2(t,r.explicitBitstream):!1}function n2(e,t,r,n,s){let{basePath:o,refine:i,getRefine:a,lodMetricType:c,getTileType:f,rootLodMetricValue:h,rootBoundingVolume:u}=n,l=e.contentUrl&&e.contentUrl.replace(`${o}/`,""),d=h/2**t,A=s?.box?{box:s.box}:u,m=s2(t,A,r);return{children:e.children,contentUrl:e.contentUrl,content:{uri:l},id:e.contentUrl,refine:a(i),type:f(e),lodMetricType:c,lodMetricValue:d,geometricError:d,transform:e.transform,boundingVolume:m}}function s2(e,t,r){if(t.region){let{childTileX:n,childTileY:s,childTileZ:o}=r,[i,a,c,f,h,u]=t.region,l=2**e,d=(c-i)/l,A=(f-a)/l,m=(u-h)/l,[p,E]=[i+d*n,i+d*(n+1)],[y,C]=[a+A*s,a+A*(s+1)],[M,T]=[h+m*o,h+m*(o+1)];return{region:[p,y,E,C,M,T]}}if(t.box)return t;throw new Error(`Unsupported bounding volume type ${JSON.stringify(t)}`)}function rr(e,t,r){return(e<<r)+t}function _o(e,t,r,n,s){let o=o2({level:t,x:r,y:n,z:s});return e.replace(/{level}|{x}|{y}|{z}/gi,i=>o[i])}function o2(e){let t={};for(let r in e)t[`{${r}}`]=e[r];return t}function i2(e,t){let r=Math.floor(e/8),n=e%8;return(t[r]>>n&1)===1}function tc(e,t=""){if(!t)return Ce.EMPTY;let n=t.split("?")[0].split(".").pop();switch(n){case"pnts":return Ce.POINTCLOUD;case"i3dm":case"b3dm":case"glb":case"gltf":return Ce.SCENEGRAPH;default:return n||Ce.EMPTY}}function ec(e){switch(e){case"REPLACE":case"replace":return Sr.REPLACE;case"ADD":case"add":return Sr.ADD;default:return e}}function $a(e,t){if(/^[a-z][0-9a-z+.-]*:/i.test(t)){let n=new URL(e,`${t}/`);return decodeURI(n.toString())}else if(e.startsWith("/"))return e;return Cr.resolve(t,e)}function Gu(e,t){if(!e)return null;let r;if(e.content){let s=e.content.uri||e.content?.url;typeof s<"u"&&(r=$a(s,t))}return{...e,id:r,contentUrl:r,lodMetricType:le.GEOMETRIC_ERROR,lodMetricValue:e.geometricError,transformMatrix:e.transform,type:tc(e,r),refine:ec(e.refine)}}async function ku(e,t,r){let n=null,s=Pu(e.root);s&&e.root?n=await Uu(e.root,e,t,s,r):n=Gu(e.root,t);let o=[];for(o.push(n);o.length>0;){let i=o.pop()||{},a=i.children||[],c=[];for(let f of a){let h=Pu(f),u;h?u=await Uu(f,e,t,h,r):u=Gu(f,t),u&&(c.push(u),o.push(u))}i.children=c}return n}async function Uu(e,t,r,n,s){let{subdivisionScheme:o,maximumLevel:i,availableLevels:a,subtreeLevels:c,subtrees:{uri:f}}=n,h=_o(f,0,0,0,0),u=$a(h,r),l=await(0,Hu.load)(u,Xr,s),d=e.content?.uri,A=d?$a(d,r):"",m=t?.root?.refine,p=e.geometricError,E=e.boundingVolume.extensions?.["3DTILES_bounding_volume_S2"];if(E){let T={box:Eo(E),s2VolumeInfo:E};e.boundingVolume=T}let y=e.boundingVolume,C={contentUrlTemplate:A,subtreesUriTemplate:f,subdivisionScheme:o,subtreeLevels:c,maximumLevel:Number.isFinite(a)?a-1:i,refine:m,basePath:r,lodMetricType:le.GEOMETRIC_ERROR,rootLodMetricValue:p,rootBoundingVolume:y,getTileType:tc,getRefine:ec};return await a2(e,r,l,C,s)}async function a2(e,t,r,n,s){if(!e)return null;let{children:o,contentUrl:i}=await Wa({subtree:r,implicitOptions:n,loaderOptions:s}),a,c=null;return i&&(a=i,c={uri:i.replace(`${t}/`,"")}),{...e,id:a,contentUrl:a,lodMetricType:le.GEOMETRIC_ERROR,lodMetricValue:e.geometricError,transformMatrix:e.transform,type:tc(e,a),refine:ec(e.refine),content:c||e.content,children:o}}function Pu(e){return e?.extensions?.["3DTILES_implicit_tiling"]||e?.implicitTiling}var nr={dataType:null,batchType:null,id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:Rr,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:c2,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};async function c2(e,t={},r){let n=t["3d-tiles"]||{},s;return n.isTileset==="auto"?s=r?.url&&r.url.indexOf(".json")!==-1:s=n.isTileset,s?f2(e,t,r):h2(e,t,r)}async function f2(e,t,r){let n=JSON.parse(new TextDecoder().decode(e)),s=r?.url||"",o=l2(s),i=await ku(n,o,t||{});return{...n,shape:"tileset3d",loader:nr,url:s,queryString:r?.queryString||"",basePath:o,root:i||n.root,type:Cn.TILES3D,lodMetricType:le.GEOMETRIC_ERROR,lodMetricValue:n.root?.geometricError||0}}async function h2(e,t,r){let n={content:{shape:"tile3d",featureIds:null}};return await Da(e,0,t,r,n.content),n.content}function l2(e){return Cr.dirname(e)}var yo=xr(gn(),1);var zu="https://api.cesium.com/v1/assets";async function To(e,t){if(!t){let o=await u2(e);for(let i of o.items)i.type==="3DTILES"&&(t=i.id)}let r=await d2(e,t),{type:n,url:s}=r;return z(n==="3DTILES"&&s),r.headers={Authorization:`Bearer ${r.accessToken}`},r}async function u2(e){z(e);let t=zu,r={Authorization:`Bearer ${e}`},n=await(0,yo.fetchFile)(t,{headers:r});if(!n.ok)throw new Error(n.statusText);return await n.json()}async function d2(e,t){z(e,t);let r={Authorization:`Bearer ${e}`},n=`${zu}/${t}`,s=await(0,yo.fetchFile)(`${n}`,{headers:r});if(!s.ok)throw new Error(s.statusText);let o=await s.json();if(s=await(0,yo.fetchFile)(`${n}/endpoint`,{headers:r}),!s.ok)throw new Error(s.statusText);let i=await s.json();return o={...o,...i},o}async function A2(e,t={}){t=t["cesium-ion"]||{};let{accessToken:r}=t,n=t.assetId;if(!Number.isFinite(n)){let s=e.match(/\/([0-9]+)\/tileset.json/);n=s&&s[1]}return To(r,n)}var rc={...nr,id:"cesium-ion",name:"Cesium Ion",preload:A2,parse:async(e,t,r)=>(t={...t},t["3d-tiles"]=t["cesium-ion"],t.loader=rc,nr.parse(e,t,r)),options:{"cesium-ion":{...nr.options["3d-tiles"],accessToken:null}}};var Vn=async(e,t)=>{let r=[await e.getUint8(e.length-1n),await e.getUint8(e.length-2n),await e.getUint8(e.length-3n),void 0],n=-1,s=e.length-4n;do{let o=s;s-=BigInt(1024),s=s>=0n?s:0n;let i=new Uint8Array(await e.slice(s,o));for(let a=i.length-1;a>-1;a--)if(r[3]=r[2],r[2]=r[1],r[1]=r[0],r[0]=i[a],r.every((c,f)=>c===t[f])){n=a;break}}while(n===-1&&s>0n);return s+BigInt(n)};var Ju=new Uint8Array([80,75,5,6]),Qu=new Uint8Array([80,75,6,7]),Vu=new Uint8Array([80,75,6,6]),m2=8n;var p2=12n,g2=16n;var x2=8n,B2=24n;var E2=40n,_2=48n;var ju=async e=>{let t=await Vn(e,Ju),r=BigInt(await e.getUint16(t+m2)),n=BigInt(await e.getUint32(t+p2)),s=BigInt(await e.getUint32(t+g2)),o=t-20n,i=0n,a=await e.slice(o,o+4n);if(Te(a,Qu)){i=await e.getBigUint64(o+x2);let c=await e.slice(i,i+4n);if(!Te(c,Vu.buffer))throw new Error("zip64 EoCD not found");r=await e.getBigUint64(i+B2),n=await e.getBigUint64(i+E2),s=await e.getBigUint64(i+_2)}else o=0n;return{cdRecordsNumber:r,cdStartOffset:s,cdByteSize:n,offsets:{zip64EoCDOffset:i,zip64EoCDLocatorOffset:o,zipEoCDOffset:t}}};var PD=[{offset:0,size:4,default:new DataView(Ju.buffer).getUint32(0,!0)},{offset:4,size:2,default:0},{offset:6,size:2,default:0},{offset:8,size:2,name:"recordsNumber"},{offset:10,size:2,name:"recordsNumber"},{offset:12,size:4,name:"cdSize"},{offset:16,size:4,name:"cdOffset"},{offset:20,size:2,default:0}];var HD=[{offset:0,size:4,default:new DataView(Qu.buffer).getUint32(0,!0)},{offset:4,size:4,default:0},{offset:8,size:8,name:"eoCDStart"},{offset:16,size:4,default:1}],kD=[{offset:0,size:4,default:new DataView(Vu.buffer).getUint32(0,!0)},{offset:4,size:8,default:44},{offset:12,size:2,default:45},{offset:14,size:2,default:45},{offset:16,size:4,default:0},{offset:20,size:4,default:0},{offset:24,size:8,name:"recordsNumber"},{offset:32,size:8,name:"recordsNumber"},{offset:40,size:8,name:"cdSize"},{offset:48,size:8,name:"cdOffset"}];var y2=20,T2=24,C2=28,M2=30,b2=32,w2=42,Co=46n,Kn=new Uint8Array([80,75,1,2]),jn=async(e,t)=>{if(e>=t.length)return null;let r=new DataView(await t.slice(e,e+Co)),n=r.buffer.slice(0,4);if(!Te(n,Kn.buffer))return null;let s=BigInt(r.getUint32(y2,!0)),o=BigInt(r.getUint32(T2,!0)),i=r.getUint16(M2,!0),a=BigInt(r.getUint16(b2,!0)),c=r.getUint16(C2,!0),f=await t.slice(e+Co,e+Co+BigInt(c+i)),h=f.slice(0,c),u=new TextDecoder().decode(h),l=e+Co+BigInt(c),d=r.getUint32(w2,!0),A=BigInt(d),m=new DataView(f.slice(c,f.byteLength)),p={uncompressedSize:o,compressedSize:s,localHeaderOffset:A,startDisk:a},E=I2(p,m);return{...p,...E,extraFieldLength:i,fileNameLength:c,fileName:u,extraOffset:l}};async function*rn(e){let{cdStartOffset:t,cdByteSize:r}=await ju(e),n=new Je(new DataView(await e.slice(t,t+r))),s=await jn(0n,n);for(;s;)yield s,s=await jn(s.extraOffset+BigInt(s.extraFieldLength),n)}var Ku=(...e)=>e[0]+e[1]*16,I2=(e,t)=>{let r=S2(e),n={};if(r.length>0){let s=r.reduce((a,c)=>a+c.length,0),o=new Uint8Array(t.buffer).findIndex((a,c,f)=>Ku(f[c],f[c+1])===1&&Ku(f[c+2],f[c+3])===s),i=0;for(let a of r){let c=i;n[a.name]=t.getBigUint64(o+4+c,!0),i=c+a.length}}return n},S2=e=>{let t=[];return e.uncompressedSize===BigInt(4294967295)&&t.push({name:"uncompressedSize",length:8}),e.compressedSize===BigInt(4294967295)&&t.push({name:"compressedSize",length:8}),e.localHeaderOffset===BigInt(4294967295)&&t.push({name:"localHeaderOffset",length:8}),e.startDisk===BigInt(4294967295)&&t.push({name:"startDisk",length:4}),t};var VD=[{offset:0,size:4,default:new DataView(Kn.buffer).getUint32(0,!0)},{offset:4,size:2,default:45},{offset:6,size:2,default:45},{offset:8,size:2,default:0},{offset:10,size:2,default:0},{offset:12,size:2,default:0},{offset:14,size:2,default:0},{offset:16,size:4,name:"crc32"},{offset:20,size:4,name:"length"},{offset:24,size:4,name:"length"},{offset:28,size:2,name:"fnlength"},{offset:30,size:2,default:0,name:"extraLength"},{offset:32,size:2,default:0},{offset:34,size:2,default:0},{offset:36,size:2,default:0},{offset:38,size:4,default:0},{offset:42,size:4,name:"offset"}];var R2=8,F2=18,D2=22,L2=26,O2=28,Mo=30n,nc=new Uint8Array([80,75,3,4]),sr=async(e,t)=>{let r=new DataView(await t.slice(e,e+Mo)),n=r.buffer.slice(0,4);if(!Te(n,nc))return null;let s=r.getUint16(L2,!0),o=r.getUint16(O2,!0),i=await t.slice(e+Mo,e+Mo+BigInt(s+o)),a=i.slice(0,s),c=new DataView(i.slice(s,i.byteLength)),f=new TextDecoder().decode(a).split("\\").join("/"),h=e+Mo+BigInt(s+o),u=r.getUint16(R2,!0),l=BigInt(r.getUint32(F2,!0)),d=BigInt(r.getUint32(D2,!0)),A=4;return d===BigInt(4294967295)&&(d=c.getBigUint64(A,!0),A+=8),l===BigInt(4294967295)&&(l=c.getBigUint64(A,!0),A+=8),h===BigInt(4294967295)&&(h=c.getBigUint64(A,!0)),{fileNameLength:s,fileName:f,extraFieldLength:o,fileDataOffset:h,compressedSize:l,compressionMethod:u}};var XD=[{offset:0,size:4,default:new DataView(nc.buffer).getUint32(0,!0)},{offset:4,size:2,default:45},{offset:6,size:2,default:0},{offset:8,size:2,default:0},{offset:10,size:2,default:0},{offset:12,size:2,default:0},{offset:14,size:4,name:"crc32"},{offset:18,size:4,name:"length"},{offset:22,size:4,name:"length"},{offset:26,size:2,name:"fnlength"},{offset:28,size:2,default:0,name:"extraLength"}];var bo=class{constructor(t={}){this.hashBatches=this.hashBatches.bind(this)}async preload(){}async*hashBatches(t,r="base64"){let n=[];for await(let i of t)n.push(i),yield i;let s=await this.concatenate(n),o=await this.hash(s,r);this.options.crypto?.onEnd?.({hash:o})}async concatenate(t){return await En(t)}};function Xu(e){e=`${e}`;for(let r=0;r<e.length;r++)if(e.charCodeAt(r)>255)return null;let t="";for(let r=0;r<e.length;r+=3){let n=[void 0,void 0,void 0,void 0];n[0]=e.charCodeAt(r)>>2,n[1]=(e.charCodeAt(r)&3)<<4,e.length>r+1&&(n[1]|=e.charCodeAt(r+1)>>4,n[2]=(e.charCodeAt(r+1)&15)<<2),e.length>r+2&&(n[2]|=e.charCodeAt(r+2)>>6,n[3]=e.charCodeAt(r+2)&63);for(let s=0;s<n.length;s++)typeof n[s]>"u"?t+="=":t+=v2(n[s])}return t}function v2(e){if(e<26)return String.fromCharCode(e+"A".charCodeAt(0));if(e<52)return String.fromCharCode(e-26+"a".charCodeAt(0));if(e<62)return String.fromCharCode(e-52+"0".charCodeAt(0));if(e===62)return"+";if(e===63)return"/"}function Yu(e,t){switch(t){case"hex":return e;case"base64":return N2(e);default:throw new Error(t)}}function N2(e){e.length%2!==0&&(e=`0${e}`);let r=(e.match(/\w{2}/g)||[]).map(n=>String.fromCharCode(parseInt(n,16))).join("");return Xu(r)||""}var qu=typeof atob=="function"?atob:typeof Buffer=="function"?J2:$u,G2=qu("AGFzbQEAAAABDANgAX8AYAAAYAABfwIeAgdpbXBvcnRzA2xvZwAAB2ltcG9ydHMDbWVtAgABAzIxAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAAAAAAAAAAAAgICAgIAAAAAAAaYARt/AUGBxpS6Bgt/AUGJ17b+fgt/AUH+uevFeQt/AUH2qMmBAQt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALB7oCJQhvbmVGdWxsQQAYCG9uZUZ1bGxCABkIb25lRnVsbEMAGghvbmVGdWxsRAAbBWxvb3BzAAEEbG9vcAACBXByaW1lAAMFbG9vcEEABAZsb29wQTEABQZsb29wQTIABgZsb29wQTMABwZsb29wQTQACAVsb29wQgAJBmxvb3BCMQAKBmxvb3BCMgALBmxvb3BCMwAMBmxvb3BCNAANBWxvb3BDAA4GbG9vcEMxAA8GbG9vcEMyABAGbG9vcEMzABEGbG9vcEM0ABIFbG9vcEQAEwZsb29wRDEAFAZsb29wRDIAFQZsb29wRDMAFgZsb29wRDQAFwRnZXRBACgEZ2V0QgApBGdldEMAKgRnZXREACs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z2(G2).buffer:!1,ne=Q2(),oc=240*16*16,Wu=Math.floor(oc*16*1.066666667),U2=268435456-65536,Zu="Parameter must be Buffer, ArrayBuffer or Uint8Array",P2="Parameter exceeds max size of 255.9 Mbytes";sc||console.log("WebAssembly not available or WASM module could not be decoded; md5WASM will fall back to JavaScript");function ic(e){var t,r,n,s,o,i,a,c,f,h;let u=k2(),l=H2(),d={},A=new Date().getTime();return d.then=function(y){return a=y,p(),d},d.catch=function(y){return c=y,d},e&&typeof e=="object"?typeof Buffer=="function"&&e.constructor===Buffer?i=e:e.constructor===Uint8Array||e.constructor===ArrayBuffer?i=e.constructor===ArrayBuffer?new Uint8Array(e):e:E(new TypeError(Zu)):E(new TypeError(Zu)),i&&(o=i.length,sc&&o>Wu?o>U2?E(new Error(P2)):(t=new WebAssembly.Memory({initial:o>32e6?o>64e6?o>128e6?4096:2048:1024:512}),r=new Uint32Array(t.buffer),s={mem:t,log:console.log},n={imports:s},WebAssembly.instantiate(sc,n).then(m)):p(u(i))),d;function m(y){p(l(i,y.instance.exports,r))}function p(y){var C=Boolean(y)?y:f;Boolean(y)&&(h=new Date().getTime()),typeof a=="function"?Boolean(C)&&(a(C,h-A),a=c=null):Boolean(y)&&(f=y)}function E(y){typeof c=="function"&&c(y)}}function H2(){var e,t,r,n,s,o,i,a,c,f,h,u,l,d=function(A){var m,p,E,y,C,M,T,I,w,L,x,g,B,_,U,G,P,v,at,mt,X,ke,us=new Date().getTime(),gr=0,S=1732584193,F=-271733879,R=-1732584194,D=271733878,tt=0,pn=A.length*8,ds;for(ds=Zd(A,l),l[pn>>>5]|=128<<pn%32,l[(pn+64>>>9<<4)+14]=pn,ds=(pn+64>>>9<<4)+15,X=l;tt<ds;)ds>tt+Wu?(n(S),o(F),a(R),f(D),t(oc),tt=tt+oc*16,S=r(),F=s(),R=i(),D=c(),gr++):(P=S,v=F,at=R,mt=D,m=X[tt+0]>>>0,p=X[tt+1]>>>0,E=X[tt+2]>>>0,y=X[tt+3]>>>0,C=X[tt+4]>>>0,M=X[tt+5]>>>0,T=X[tt+6]>>>0,I=X[tt+7]>>>0,w=X[tt+8]>>>0,L=X[tt+9]>>>0,x=X[tt+10]>>>0,g=X[tt+11]>>>0,B=X[tt+12]>>>0,_=X[tt+13]>>>0,U=X[tt+14]>>>0,G=X[tt+15]>>>0,S=N(7,25,S+(F&R|~F&D)+m-680876936)+F,D=N(12,20,D+(S&F|~S&R)+p-389564586)+S,R=N(17,15,R+(D&S|~D&F)+E+606105819)+D,F=N(22,10,F+(R&D|~R&S)+y-1044525330)+R,S=N(7,25,S+(F&R|~F&D)+C-176418897)+F,D=N(12,20,D+(S&F|~S&R)+M+1200080426)+S,R=N(17,15,R+(D&S|~D&F)+T-1473231341)+D,F=N(22,10,F+(R&D|~R&S)+I-45705983)+R,S=N(7,25,S+(F&R|~F&D)+w+1770035416)+F,D=N(12,20,D+(S&F|~S&R)+L-1958414417)+S,R=N(17,15,R+(D&S|~D&F)+x-42063)+D,F=N(22,10,F+(R&D|~R&S)+g-1990404162)+R,S=N(7,25,S+(F&R|~F&D)+B+1804603682)+F,D=N(12,20,D+(S&F|~S&R)+_-40341101)+S,R=N(17,15,R+(D&S|~D&F)+U-1502002290)+D,F=N(22,10,F+(R&D|~R&S)+G+1236535329)+R,S=N(5,27,S+(F&D|R&~D)+p-165796510)+F,D=N(9,23,D+(S&R|F&~R)+T-1069501632)+S,R=N(14,18,R+(D&F|S&~F)+g+643717713)+D,F=N(20,12,F+(R&S|D&~S)+m-373897302)+R,S=N(5,27,S+(F&D|R&~D)+M-701558691)+F,D=N(9,23,D+(S&R|F&~R)+x+38016083)+S,R=N(14,18,R+(D&F|S&~F)+G-660478335)+D,F=N(20,12,F+(R&S|D&~S)+C-405537848)+R,S=N(5,27,S+(F&D|R&~D)+L+568446438)+F,D=N(9,23,D+(S&R|F&~R)+U-1019803690)+S,R=N(14,18,R+(D&F|S&~F)+y-187363961)+D,F=N(20,12,F+(R&S|D&~S)+w+1163531501)+R,S=N(5,27,S+(F&D|R&~D)+_-1444681467)+F,D=N(9,23,D+(S&R|F&~R)+E-51403784)+S,R=N(14,18,R+(D&F|S&~F)+I+1735328473)+D,F=N(20,12,F+(R&S|D&~S)+B-1926607734)+R,S=N(4,28,S+(F^R^D)+M-378558)+F,D=N(11,21,D+(S^F^R)+w-2022574463)+S,R=N(16,16,R+(D^S^F)+g+1839030562)+D,F=N(23,9,F+(R^D^S)+U-35309556)+R,S=N(4,28,S+(F^R^D)+p-1530992060)+F,D=N(11,21,D+(S^F^R)+C+1272893353)+S,R=N(16,16,R+(D^S^F)+I-155497632)+D,F=N(23,9,F+(R^D^S)+x-1094730640)+R,S=N(4,28,S+(F^R^D)+_+681279174)+F,D=N(11,21,D+(S^F^R)+m-358537222)+S,R=N(16,16,R+(D^S^F)+y-722521979)+D,F=N(23,9,F+(R^D^S)+T+76029189)+R,S=N(4,28,S+(F^R^D)+L-640364487)+F,D=N(11,21,D+(S^F^R)+B-421815835)+S,R=N(16,16,R+(D^S^F)+G+530742520)+D,F=N(23,9,F+(R^D^S)+E-995338651)+R,S=N(6,26,S+(R^(F|~D))+m-198630844)+F,D=N(10,22,D+(F^(S|~R))+I+1126891415)+S,R=N(15,17,R+(S^(D|~F))+U-1416354905)+D,F=N(21,11,F+(D^(R|~S))+M-57434055)+R,S=N(6,26,S+(R^(F|~D))+B+1700485571)+F,D=N(10,22,D+(F^(S|~R))+y-1894986606)+S,R=N(15,17,R+(S^(D|~F))+x-1051523)+D,F=N(21,11,F+(D^(R|~S))+p-2054922799)+R,S=N(6,26,S+(R^(F|~D))+w+1873313359)+F,D=N(10,22,D+(F^(S|~R))+G-30611744)+S,R=N(15,17,R+(S^(D|~F))+T-1560198380)+D,F=N(21,11,F+(D^(R|~S))+_+1309151649)+R,S=N(6,26,S+(R^(F|~D))+C-145523070)+F,D=N(10,22,D+(F^(S|~R))+g-1120210379)+S,R=N(15,17,R+(S^(D|~F))+E+718787259)+D,F=N(21,11,F+(D^(R|~S))+L-343485551)+R,tt=tt+16,S=S+P>>>0,F=F+v>>>0,R=R+at>>>0,D=D+mt>>>0);return ne.endian([S,F,R,D]);function N(pt,As,Xt){return Xt<<pt|Xt>>>As}function Zd(pt,As){for(var Xt=-1,Qo=Math.floor((pt.length-1)/4),Bt=0,Vc,jc,Kc,Xc;Qo-8>Xt++;)Bt=Xt<<2,As[Xt]=pt[Bt+0]|pt[Bt+1]<<8|pt[Bt+2]<<16|pt[Bt+3]<<24;for(Xt--;Qo>Xt++;)Bt=Xt<<2,Vc=typeof pt[Bt+0]>"u"?0:pt[Bt+0],jc=typeof pt[Bt+1]>"u"?0:pt[Bt+1],Kc=typeof pt[Bt+2]>"u"?0:pt[Bt+2],Xc=typeof pt[Bt+3]>"u"?0:pt[Bt+3],As[Xt]=Vc|jc<<8|Kc<<16|Xc<<24;return Qo+1}};return function(A,m,p,E){var y;return t=m.loops,e=m.loop,r=m.getA,s=m.getB,i=m.getC,c=m.getD,h=m.getX,n=m.setA,o=m.setB,a=m.setC,f=m.setD,u=m.setX,l=p,y=ne.wordsToBytes(d(A)),E&&E.asBytes?y:ne.bytesconvertNumberToHex(y)}}function k2(){var e=function(t,r){var n,s,o,i,a,c,f,h,u,l,d,A,m,p,E,y,C,M,T,I,w,L=new Date().getTime(),x=1732584193,g=-271733879,B=-1732584194,_=271733878,U=t.length*8;w=ne.bytesToWords(t);for(var G=0;G<w.length;G++)w[G]=(w[G]<<8|w[G]>>>24)&16711935|(w[G]<<24|w[G]>>>8)&4278255360;w[U>>>5]|=128<<U%32,w[(U+64>>>9<<4)+14]=U;for(var P=0;P<w.length;P+=16)C=x,M=g,T=B,I=_,n=w[P+0]>>>0,s=w[P+1]>>>0,o=w[P+2]>>>0,i=w[P+3]>>>0,a=w[P+4]>>>0,c=w[P+5]>>>0,f=w[P+6]>>>0,h=w[P+7]>>>0,u=w[P+8]>>>0,l=w[P+9]>>>0,d=w[P+10]>>>0,A=w[P+11]>>>0,m=w[P+12]>>>0,p=w[P+13]>>>0,E=w[P+14]>>>0,y=w[P+15]>>>0,x=v(7,25,x+(g&B|~g&_)+n-680876936)+g,_=v(12,20,_+(x&g|~x&B)+s-389564586)+x,B=v(17,15,B+(_&x|~_&g)+o+606105819)+_,g=v(22,10,g+(B&_|~B&x)+i-1044525330)+B,x=v(7,25,x+(g&B|~g&_)+a-176418897)+g,_=v(12,20,_+(x&g|~x&B)+c+1200080426)+x,B=v(17,15,B+(_&x|~_&g)+f-1473231341)+_,g=v(22,10,g+(B&_|~B&x)+h-45705983)+B,x=v(7,25,x+(g&B|~g&_)+u+1770035416)+g,_=v(12,20,_+(x&g|~x&B)+l-1958414417)+x,B=v(17,15,B+(_&x|~_&g)+d-42063)+_,g=v(22,10,g+(B&_|~B&x)+A-1990404162)+B,x=v(7,25,x+(g&B|~g&_)+m+1804603682)+g,_=v(12,20,_+(x&g|~x&B)+p-40341101)+x,B=v(17,15,B+(_&x|~_&g)+E-1502002290)+_,g=v(22,10,g+(B&_|~B&x)+y+1236535329)+B,x=v(5,27,x+(g&_|B&~_)+s-165796510)+g,_=v(9,23,_+(x&B|g&~B)+f-1069501632)+x,B=v(14,18,B+(_&g|x&~g)+A+643717713)+_,g=v(20,12,g+(B&x|_&~x)+n-373897302)+B,x=v(5,27,x+(g&_|B&~_)+c-701558691)+g,_=v(9,23,_+(x&B|g&~B)+d+38016083)+x,B=v(14,18,B+(_&g|x&~g)+y-660478335)+_,g=v(20,12,g+(B&x|_&~x)+a-405537848)+B,x=v(5,27,x+(g&_|B&~_)+l+568446438)+g,_=v(9,23,_+(x&B|g&~B)+E-1019803690)+x,B=v(14,18,B+(_&g|x&~g)+i-187363961)+_,g=v(20,12,g+(B&x|_&~x)+u+1163531501)+B,x=v(5,27,x+(g&_|B&~_)+p-1444681467)+g,_=v(9,23,_+(x&B|g&~B)+o-51403784)+x,B=v(14,18,B+(_&g|x&~g)+h+1735328473)+_,g=v(20,12,g+(B&x|_&~x)+m-1926607734)+B,x=v(4,28,x+(g^B^_)+c-378558)+g,_=v(11,21,_+(x^g^B)+u-2022574463)+x,B=v(16,16,B+(_^x^g)+A+1839030562)+_,g=v(23,9,g+(B^_^x)+E-35309556)+B,x=v(4,28,x+(g^B^_)+s-1530992060)+g,_=v(11,21,_+(x^g^B)+a+1272893353)+x,B=v(16,16,B+(_^x^g)+h-155497632)+_,g=v(23,9,g+(B^_^x)+d-1094730640)+B,x=v(4,28,x+(g^B^_)+p+681279174)+g,_=v(11,21,_+(x^g^B)+n-358537222)+x,B=v(16,16,B+(_^x^g)+i-722521979)+_,g=v(23,9,g+(B^_^x)+f+76029189)+B,x=v(4,28,x+(g^B^_)+l-640364487)+g,_=v(11,21,_+(x^g^B)+m-421815835)+x,B=v(16,16,B+(_^x^g)+y+530742520)+_,g=v(23,9,g+(B^_^x)+o-995338651)+B,x=v(6,26,x+(B^(g|~_))+n-198630844)+g,_=v(10,22,_+(g^(x|~B))+h+1126891415)+x,B=v(15,17,B+(x^(_|~g))+E-1416354905)+_,g=v(21,11,g+(_^(B|~x))+c-57434055)+B,x=v(6,26,x+(B^(g|~_))+m+1700485571)+g,_=v(10,22,_+(g^(x|~B))+i-1894986606)+x,B=v(15,17,B+(x^(_|~g))+d-1051523)+_,g=v(21,11,g+(_^(B|~x))+s-2054922799)+B,x=v(6,26,x+(B^(g|~_))+u+1873313359)+g,_=v(10,22,_+(g^(x|~B))+y-30611744)+x,B=v(15,17,B+(x^(_|~g))+f-1560198380)+_,g=v(21,11,g+(_^(B|~x))+p+1309151649)+B,x=v(6,26,x+(B^(g|~_))+a-145523070)+g,_=v(10,22,_+(g^(x|~B))+A-1120210379)+x,B=v(15,17,B+(x^(_|~g))+o+718787259)+_,g=v(21,11,g+(_^(B|~x))+l-343485551)+B,x=x+C>>>0,g=g+M>>>0,B=B+T>>>0,_=_+I>>>0;return ne.endian([x,g,B,_]);function v(at,mt,X){return X<<at|X>>>mt}};return function(t,r){var n=ne.wordsToBytes(e(t,r)),s=r&&r.asBytes?n:ne.bytesconvertNumberToHex(n);return s}}function z2(e){var t,r,n,s=-1;for(t=e.length-1,r=new ArrayBuffer(e.length),n=new Uint8Array(r);t>s++;)n[s]=e.charCodeAt(s);return n}function J2(e){return Buffer.from(e,"base64").toString("binary")}function $u(e){return e}function Q2(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";return{rotl:function(t,r){return t<<r|t>>>32-r},endian:function(t){if(t.constructor==Number)return ne.rotl(t,8)&16711935|ne.rotl(t,24)&4278255360;for(var r=0;r<t.length;r++)t[r]=ne.endian(t[r]);return t},bytesToWords:function(t){for(var r=[],n=0,s=0;n<t.length;n++,s+=8)r[s>>>5]|=t[n]<<24-s%32;return r},wordsToBytes:function(t){for(var r=[],n=0;n<t.length*32;n+=8)r.push(t[n>>>5]>>>24-n%32&255);return r},bytesconvertNumberToHex:function(t){for(var r=[],n=0;n<t.length;n++)r.push((t[n]>>>4).toString(16)),r.push((t[n]&15).toString(16));return r.join("")}}}var or=class extends bo{name="md5";options;constructor(t={}){super(),this.options=t}async hash(t,r){let s=await new Promise((o,i)=>ic(t).then(o).catch(i));return Yu(s,r)}};var nn=class{constructor(t){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(t={}){xn(t)}async compress(t){return await this.preload(),this.compressSync(t)}async decompress(t,r){return await this.preload(),this.decompressSync(t,r)}compressSync(t){throw new Error(`${this.name}: sync compression not supported`)}decompressSync(t,r){throw new Error(`${this.name}: sync decompression not supported`)}async*compressBatches(t){let r=await this.concatenate(t);yield this.compress(r)}async*decompressBatches(t){let r=await this.concatenate(t);yield this.decompress(r)}concatenate(t){return En(t)}improveError(t){return t.message.includes(this.name)||(t.message=`${this.name} ${t.message}`),t}};var Xn=class extends nn{name="uncompressed";extensions=[];contentEncodings=[];isSupported=!0;options;constructor(t){super(t),this.options=t||{}}compressSync(t){return t}decompressSync(t){return t}async*compressBatches(t){return yield*t}async*decompressBatches(t){return yield*t}};var Ar=xr(Hd(),1),ye=xr(kd(),1);var mr=class extends nn{name="deflate";extensions=[];contentEncodings=["deflate"];isSupported=!0;options;_chunks=[];constructor(t={}){super(t),this.options=t}async compress(t){if(!Et&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await Tr(ye.default.gzip)(t):await Tr(ye.default.deflate)(t);return yr(r)}return this.compressSync(t)}async decompress(t){if(!Et&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await Tr(ye.default.gunzip)(t):await Tr(ye.default.inflate)(t);return yr(r)}return this.decompressSync(t)}compressSync(t){if(!Et&&this.options.deflate?.useZlib){let o=this.options.deflate?.gzip?ye.default.gzipSync(t):ye.default.deflateSync(t);return yr(o)}let r=this.options?.deflate||{},n=new Uint8Array(t);return(this.options?.raw?Ar.default.deflateRaw:Ar.default.deflate)(n,r).buffer}decompressSync(t){if(!Et&&this.options.deflate?.useZlib){let o=this.options.deflate?.gzip?ye.default.gunzipSync(t):ye.default.inflateSync(t);return yr(o)}let r=this.options?.deflate||{},n=new Uint8Array(t);return(this.options?.raw?Ar.default.inflateRaw:Ar.default.inflate)(n,r).buffer}async*compressBatches(t){let r=this.options?.deflate||{},n=new Ar.default.Deflate(r);yield*this.transformBatches(n,t)}async*decompressBatches(t){let r=this.options?.deflate||{},n=new Ar.default.Inflate(r);yield*this.transformBatches(n,t)}async*transformBatches(t,r){t.onData=this._onData.bind(this),t.onEnd=this._onEnd.bind(this);for await(let i of r){let a=new Uint8Array(i);if(!t.push(a,!1))throw new Error(`${this._getError()}write`);yield*this._getChunks()}let n=new Uint8Array(0),s=t.push(n,!0);yield*this._getChunks()}_onData(t){this._chunks.push(t)}_onEnd(t){if(t!==0)throw new Error(this._getError(t)+this._chunks.length)}_getChunks(){let t=this._chunks;return this._chunks=[],t}_getError(t=0){let r={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};return`${this.name}: ${r[t]}`}};var G_={0:async e=>e,8:async e=>await new mr({raw:!0}).decompress(e)},Jo=class{fileProvider=null;fileName;archive=null;constructor(t){if(typeof t=="string")if(this.fileName=t,!Et)this.fileProvider=new Tn(t);else throw new Error("Cannot open file for random access in a WEB browser");else t instanceof pr?(this.fileProvider=t.fileProvider,this.archive=t,this.fileName=t.fileName):qo(t)&&(this.fileProvider=t)}async destroy(){this.fileProvider&&await this.fileProvider.destroy()}async readdir(){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let t=[],r=rn(this.fileProvider);for await(let n of r)t.push(n.fileName);return t}async stat(t){let r=await this.getCDFileHeader(t);return{...r,size:Number(r.uncompressedSize)}}async fetch(t){this.fileName&&t.indexOf(this.fileName)===0&&(t=t.substring(this.fileName.length+1));let r;if(this.archive)r=await this.archive.getFile(t,"http");else{if(!this.fileProvider)throw new Error("No data detected in the zip archive");let s=await this.getCDFileHeader(t),o=await sr(s.localHeaderOffset,this.fileProvider);if(!o)throw new Error("Local file header has not been found in the zip archive`");let i=G_[o.compressionMethod.toString()];if(!i)throw Error("Only Deflation compression is supported");let a=await this.fileProvider.slice(o.fileDataOffset,o.fileDataOffset+o.compressedSize);r=await i(a)}let n=new Response(r);return Object.defineProperty(n,"url",{value:t?`${this.fileName||""}/${t}`:this.fileName||""}),n}async getCDFileHeader(t){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let r=rn(this.fileProvider),n=null;for await(let s of r)if(s.fileName===t){n=s;break}if(!n)throw new Error("File has not been found in the zip archive");return n}};var pr=class{fileProvider;fileName;constructor(t,r,n){this.fileProvider=t,this.fileName=n}async getFileWithoutHash(t){return await(await new Jo(this.fileProvider).fetch(t)).arrayBuffer()}};function kc(e){let t=new DataView(e),r={};for(let n=0;n<e.byteLength;n=n+24){let s=t.getBigUint64(n+16,!0),o=U_(e,n,16);r[o]=s}return r}function U_(e,t,r){return[...new Uint8Array(e,t,r)].map(n=>n.toString(16).padStart(2,"0")).join("")}async function zc(e){let t=rn(e);return P_(t)}async function P_(e){let t=new or,r=new TextEncoder,n={};for await(let s of e){let o=s.fileName.split("\\").join("/").toLocaleLowerCase(),i=r.encode(o).buffer,a=await t.hash(i,"hex");n[a]=s.localHeaderOffset}return n}var H_={0:e=>new Xn().decompress(e),8:e=>new mr({raw:!0}).decompress(e)},mn=class extends pr{hashTable;constructor(t,r,n){super(t,r,n),this.hashTable=r}async getFile(t){let r=await this.getFileBytes(t.toLocaleLowerCase());if(r||(r=await this.getFileBytes(t)),!r)throw new Error(`No such file in the archive: ${t}`);return r}async getFileBytes(t){let r;if(this.hashTable){let n=new TextEncoder().encode(t).buffer,s=await new or().hash(n,"hex"),o=this.hashTable[s];if(o===void 0)return null;let i=await sr(o,this.fileProvider);if(!i)return null;let a=await this.fileProvider.slice(i.fileDataOffset,i.fileDataOffset+i.compressedSize),c=H_[i.compressionMethod];if(!c)throw Error("Only Deflation compression is supported");r=await c(a)}else r=await this.getFileWithoutHash(t);return r}};var zd=async(e,t)=>{let r=await Vn(e,Kn),n=await jn(r,e),s;if(n?.fileName!=="@3dtilesIndex1@")s=await zc(e),t?.("3tz doesnt contain hash file, hash info has been composed according to zip archive headers");else{let o=await sr(n.localHeaderOffset,e);if(!o)throw new Error("corrupted 3tz zip archive");let i=o.fileDataOffset,a=await e.slice(i,i+o.compressedSize);s=kc(a)}return new mn(e,s)};var k_="4.3.0-alpha.1",Jd={dataType:null,batchType:null,name:"3tz",id:"3tz",module:"3d-tiles",version:k_,mimeTypes:["application/octet-stream","application/vnd.maxar.archive.3tz+zip"],parse:z_,extensions:["3tz"],options:{}};async function z_(e,t={}){return(await zd(new Je(new DataView(e)))).getFile(t["3d-tiles-archive"]?.path??"")}function Pe(e,t,r){if(!t)return r+12;let{magic:s,version:o=1,byteLength:i=12}=e;return z(Array.isArray(s)&&Number.isFinite(o)&&Number.isFinite(i)),t.setUint8(r+0,s[0]),t.setUint8(r+1,s[1]),t.setUint8(r+2,s[2]),t.setUint8(r+3,s[3]),t.setUint32(r+4,o,!0),t.setUint32(r+8,i,!0),r+=12,r}function He(e,t,r){e&&e.setUint32(t+8,r,!0)}function Qd(e,t,r,n,s){e={magic:Me.COMPOSITE,tiles:[],...e};let o=r;r+=Pe(e,t,r),t&&t.setUint32(r,e.tiles.length,!0),r+=4;for(let i=0;i<e.tiles.length;++i)r+=s(e.tiles[i],t,r,n);return He(t,o,r-o),r}function Vd(e,t,r,n){let{featuresLength:s=0,batchTable:o}=e,a=JSON.stringify({BATCH_LENGTH:s}),c=o?JSON.stringify(o):"",f=bt(a.length,8),h=c?bt(c.length,8):0;e={magic:Me.BATCHED_MODEL,...e};let u=r;r=Pe(e,t,r),t&&(t.setUint32(12,f,!0),t.setUint32(16,0,!0),t.setUint32(20,h,!0),t.setUint32(24,0,!0)),r+=16,r=Bs(t,r,a,8),o&&(r=Bs(t,r,c,8));let l=e.gltfEncoded;return l&&(r=Bn(t,r,l,l.byteLength)),He(t,u,r-u),r}function jd(e,t,r,n){let{featuresLength:s=1,gltfFormat:o=1,gltfUri:i=""}=e,a=i.length,c={INSTANCES_LENGTH:s,POSITION:new Array(s*3).fill(0)},f=JSON.stringify(c),h=f.length;e={magic:Me.INSTANCED_MODEL,...e};let u=r;return r=Pe(e,t,0),t&&(t.setUint32(12,h,!0),t.setUint32(16,0,!0),t.setUint32(20,0,!0),t.setUint32(24,0,!0),t.setUint32(28,o,!0)),r+=20,r+=_r(t,r,f,h),r+=_r(t,r,i,a),He(t,u,r-u),r}var J_={POINTS_LENGTH:1,POSITIONS:{byteOffset:0}};function Kd(e,t,r,n){let{featureTableJson:s=J_}=e,o=JSON.stringify(s);o=Yo(o,4);let{featureTableJsonByteLength:i=o.length}=e,a=new ArrayBuffer(12),c=a.byteLength;e={magic:Me.POINT_CLOUD,...e};let f=r;return r+=Pe(e,t,0),t&&(t.setUint32(r+0,i,!0),t.setUint32(r+4,c,!0),t.setUint32(r+8,0,!0),t.setUint32(r+12,0,!0)),r+=16,r+=_r(t,r,o,i),r+=Bn(t,r,a,c),He(t,f,r-f),r}function Qc(e,t){let r=Jc(e,null,0,t),n=new ArrayBuffer(r),s=new DataView(n);return Jc(e,s,0,t),n}function Jc(e,t,r,n){switch(z(typeof e.type=="string"),e.type){case _t.COMPOSITE:return Qd(e,t,r,n,Jc);case _t.POINT_CLOUD:return Kd(e,t,r,n);case _t.BATCHED_3D_MODEL:return Vd(e,t,r,n);case _t.INSTANCED_3D_MODEL:return jd(e,t,r,n);default:throw new Error("3D Tiles: unknown tile type")}}var Yd={name:"3D Tile",id:"3d-tiles",module:"3d-tiles",version:Rr,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],binary:!0,options:{["3d-tiles"]:{}},encode:async(e,t)=>Xd(e,t),encodeSync:Xd};function Xd(e,t){return Qc(e,t)}return r1(ls);})();
7
+ "use strict";var __exports__=(()=>{var zd=Object.create;var go=Object.defineProperty;var Qd=Object.getOwnPropertyDescriptor;var Vd=Object.getOwnPropertyNames;var jd=Object.getPrototypeOf,Kd=Object.prototype.hasOwnProperty;var ct=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ut=(e,t)=>{for(var r in t)go(e,r,{get:t[r],enumerable:!0})},po=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Vd(t))!Kd.call(e,o)&&o!==r&&go(e,o,{get:()=>t[o],enumerable:!(n=Qd(t,o))||n.enumerable});return e},xo=(e,t,r)=>(po(e,t,"default"),r&&po(r,t,"default")),xr=(e,t,r)=>(r=e!=null?zd(jd(e)):{},po(t||!e||!e.__esModule?go(r,"default",{value:e,enumerable:!0}):r,e)),Xd=e=>po(go({},"__esModule",{value:!0}),e);var gn=ct((G_,Yc)=>{Yc.exports=globalThis.loaders});var xe=ct(gt=>{"use strict";var G2=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function P2(e,t){return Object.prototype.hasOwnProperty.call(e,t)}gt.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var n in r)P2(r,n)&&(e[n]=r[n])}}return e};gt.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var U2={arraySet:function(e,t,r,n,o){if(t.subarray&&e.subarray){e.set(t.subarray(r,r+n),o);return}for(var s=0;s<n;s++)e[o+s]=t[r+s]},flattenChunks:function(e){var t,r,n,o,s,i;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(i=new Uint8Array(n),o=0,t=0,r=e.length;t<r;t++)s=e[t],i.set(s,o),o+=s.length;return i}},H2={arraySet:function(e,t,r,n,o){for(var s=0;s<n;s++)e[o+s]=t[r+s]},flattenChunks:function(e){return[].concat.apply([],e)}};gt.setTyped=function(e){e?(gt.Buf8=Uint8Array,gt.Buf16=Uint16Array,gt.Buf32=Int32Array,gt.assign(gt,U2)):(gt.Buf8=Array,gt.Buf16=Array,gt.Buf32=Array,gt.assign(gt,H2))};gt.setTyped(G2)});var A0=ct(an=>{"use strict";var k2=xe(),J2=4,ju=0,Ku=1,z2=2;function sn(e){for(var t=e.length;--t>=0;)e[t]=0}var Q2=0,$u=1,V2=2,j2=3,K2=258,dc=29,to=256,Zn=to+1+dc,on=30,Ac=19,t0=2*Zn+1,ir=15,ac=16,X2=7,mc=256,e0=16,r0=17,n0=18,lc=[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],ws=[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],Y2=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],o0=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Z2=512,Be=new Array((Zn+2)*2);sn(Be);var Yn=new Array(on*2);sn(Yn);var qn=new Array(Z2);sn(qn);var Wn=new Array(K2-j2+1);sn(Wn);var pc=new Array(dc);sn(pc);var Is=new Array(on);sn(Is);function cc(e,t,r,n,o){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=o,this.has_stree=e&&e.length}var s0,i0,a0;function fc(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function c0(e){return e<256?qn[e]:qn[256+(e>>>7)]}function $n(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function Mt(e,t,r){e.bi_valid>ac-r?(e.bi_buf|=t<<e.bi_valid&65535,$n(e,e.bi_buf),e.bi_buf=t>>ac-e.bi_valid,e.bi_valid+=r-ac):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function oe(e,t,r){Mt(e,r[t*2],r[t*2+1])}function f0(e,t){var r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1}function q2(e){e.bi_valid===16?($n(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function W2(e,t){var r=t.dyn_tree,n=t.max_code,o=t.stat_desc.static_tree,s=t.stat_desc.has_stree,i=t.stat_desc.extra_bits,a=t.stat_desc.extra_base,c=t.stat_desc.max_length,f,h,u,l,d,A,m=0;for(l=0;l<=ir;l++)e.bl_count[l]=0;for(r[e.heap[e.heap_max]*2+1]=0,f=e.heap_max+1;f<t0;f++)h=e.heap[f],l=r[r[h*2+1]*2+1]+1,l>c&&(l=c,m++),r[h*2+1]=l,!(h>n)&&(e.bl_count[l]++,d=0,h>=a&&(d=i[h-a]),A=r[h*2],e.opt_len+=A*(l+d),s&&(e.static_len+=A*(o[h*2+1]+d)));if(m!==0){do{for(l=c-1;e.bl_count[l]===0;)l--;e.bl_count[l]--,e.bl_count[l+1]+=2,e.bl_count[c]--,m-=2}while(m>0);for(l=c;l!==0;l--)for(h=e.bl_count[l];h!==0;)u=e.heap[--f],!(u>n)&&(r[u*2+1]!==l&&(e.opt_len+=(l-r[u*2+1])*r[u*2],r[u*2+1]=l),h--)}}function h0(e,t,r){var n=new Array(ir+1),o=0,s,i;for(s=1;s<=ir;s++)n[s]=o=o+r[s-1]<<1;for(i=0;i<=t;i++){var a=e[i*2+1];a!==0&&(e[i*2]=f0(n[a]++,a))}}function $2(){var e,t,r,n,o,s=new Array(ir+1);for(r=0,n=0;n<dc-1;n++)for(pc[n]=r,e=0;e<1<<lc[n];e++)Wn[r++]=n;for(Wn[r-1]=n,o=0,n=0;n<16;n++)for(Is[n]=o,e=0;e<1<<ws[n];e++)qn[o++]=n;for(o>>=7;n<on;n++)for(Is[n]=o<<7,e=0;e<1<<ws[n]-7;e++)qn[256+o++]=n;for(t=0;t<=ir;t++)s[t]=0;for(e=0;e<=143;)Be[e*2+1]=8,e++,s[8]++;for(;e<=255;)Be[e*2+1]=9,e++,s[9]++;for(;e<=279;)Be[e*2+1]=7,e++,s[7]++;for(;e<=287;)Be[e*2+1]=8,e++,s[8]++;for(h0(Be,Zn+1,s),e=0;e<on;e++)Yn[e*2+1]=5,Yn[e*2]=f0(e,5);s0=new cc(Be,lc,to+1,Zn,ir),i0=new cc(Yn,ws,0,on,ir),a0=new cc(new Array(0),Y2,0,Ac,X2)}function l0(e){var t;for(t=0;t<Zn;t++)e.dyn_ltree[t*2]=0;for(t=0;t<on;t++)e.dyn_dtree[t*2]=0;for(t=0;t<Ac;t++)e.bl_tree[t*2]=0;e.dyn_ltree[mc*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function u0(e){e.bi_valid>8?$n(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function tE(e,t,r,n){u0(e),n&&($n(e,r),$n(e,~r)),k2.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}function Xu(e,t,r,n){var o=t*2,s=r*2;return e[o]<e[s]||e[o]===e[s]&&n[t]<=n[r]}function hc(e,t,r){for(var n=e.heap[r],o=r<<1;o<=e.heap_len&&(o<e.heap_len&&Xu(t,e.heap[o+1],e.heap[o],e.depth)&&o++,!Xu(t,n,e.heap[o],e.depth));)e.heap[r]=e.heap[o],r=o,o<<=1;e.heap[r]=n}function Yu(e,t,r){var n,o,s=0,i,a;if(e.last_lit!==0)do n=e.pending_buf[e.d_buf+s*2]<<8|e.pending_buf[e.d_buf+s*2+1],o=e.pending_buf[e.l_buf+s],s++,n===0?oe(e,o,t):(i=Wn[o],oe(e,i+to+1,t),a=lc[i],a!==0&&(o-=pc[i],Mt(e,o,a)),n--,i=c0(n),oe(e,i,r),a=ws[i],a!==0&&(n-=Is[i],Mt(e,n,a)));while(s<e.last_lit);oe(e,mc,t)}function uc(e,t){var r=t.dyn_tree,n=t.stat_desc.static_tree,o=t.stat_desc.has_stree,s=t.stat_desc.elems,i,a,c=-1,f;for(e.heap_len=0,e.heap_max=t0,i=0;i<s;i++)r[i*2]!==0?(e.heap[++e.heap_len]=c=i,e.depth[i]=0):r[i*2+1]=0;for(;e.heap_len<2;)f=e.heap[++e.heap_len]=c<2?++c:0,r[f*2]=1,e.depth[f]=0,e.opt_len--,o&&(e.static_len-=n[f*2+1]);for(t.max_code=c,i=e.heap_len>>1;i>=1;i--)hc(e,r,i);f=s;do i=e.heap[1],e.heap[1]=e.heap[e.heap_len--],hc(e,r,1),a=e.heap[1],e.heap[--e.heap_max]=i,e.heap[--e.heap_max]=a,r[f*2]=r[i*2]+r[a*2],e.depth[f]=(e.depth[i]>=e.depth[a]?e.depth[i]:e.depth[a])+1,r[i*2+1]=r[a*2+1]=f,e.heap[1]=f++,hc(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],W2(e,t),h0(r,c,e.bl_count)}function Zu(e,t,r){var n,o=-1,s,i=t[0*2+1],a=0,c=7,f=4;for(i===0&&(c=138,f=3),t[(r+1)*2+1]=65535,n=0;n<=r;n++)s=i,i=t[(n+1)*2+1],!(++a<c&&s===i)&&(a<f?e.bl_tree[s*2]+=a:s!==0?(s!==o&&e.bl_tree[s*2]++,e.bl_tree[e0*2]++):a<=10?e.bl_tree[r0*2]++:e.bl_tree[n0*2]++,a=0,o=s,i===0?(c=138,f=3):s===i?(c=6,f=3):(c=7,f=4))}function qu(e,t,r){var n,o=-1,s,i=t[0*2+1],a=0,c=7,f=4;for(i===0&&(c=138,f=3),n=0;n<=r;n++)if(s=i,i=t[(n+1)*2+1],!(++a<c&&s===i)){if(a<f)do oe(e,s,e.bl_tree);while(--a!==0);else s!==0?(s!==o&&(oe(e,s,e.bl_tree),a--),oe(e,e0,e.bl_tree),Mt(e,a-3,2)):a<=10?(oe(e,r0,e.bl_tree),Mt(e,a-3,3)):(oe(e,n0,e.bl_tree),Mt(e,a-11,7));a=0,o=s,i===0?(c=138,f=3):s===i?(c=6,f=3):(c=7,f=4)}}function eE(e){var t;for(Zu(e,e.dyn_ltree,e.l_desc.max_code),Zu(e,e.dyn_dtree,e.d_desc.max_code),uc(e,e.bl_desc),t=Ac-1;t>=3&&e.bl_tree[o0[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function rE(e,t,r,n){var o;for(Mt(e,t-257,5),Mt(e,r-1,5),Mt(e,n-4,4),o=0;o<n;o++)Mt(e,e.bl_tree[o0[o]*2+1],3);qu(e,e.dyn_ltree,t-1),qu(e,e.dyn_dtree,r-1)}function nE(e){var t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return ju;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return Ku;for(r=32;r<to;r++)if(e.dyn_ltree[r*2]!==0)return Ku;return ju}var Wu=!1;function oE(e){Wu||($2(),Wu=!0),e.l_desc=new fc(e.dyn_ltree,s0),e.d_desc=new fc(e.dyn_dtree,i0),e.bl_desc=new fc(e.bl_tree,a0),e.bi_buf=0,e.bi_valid=0,l0(e)}function d0(e,t,r,n){Mt(e,(Q2<<1)+(n?1:0),3),tE(e,t,r,!0)}function sE(e){Mt(e,$u<<1,3),oe(e,mc,Be),q2(e)}function iE(e,t,r,n){var o,s,i=0;e.level>0?(e.strm.data_type===z2&&(e.strm.data_type=nE(e)),uc(e,e.l_desc),uc(e,e.d_desc),i=eE(e),o=e.opt_len+3+7>>>3,s=e.static_len+3+7>>>3,s<=o&&(o=s)):o=s=r+5,r+4<=o&&t!==-1?d0(e,t,r,n):e.strategy===J2||s===o?(Mt(e,($u<<1)+(n?1:0),3),Yu(e,Be,Yn)):(Mt(e,(V2<<1)+(n?1:0),3),rE(e,e.l_desc.max_code+1,e.d_desc.max_code+1,i+1),Yu(e,e.dyn_ltree,e.dyn_dtree)),l0(e),n&&u0(e)}function aE(e,t,r){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=r&255,e.last_lit++,t===0?e.dyn_ltree[r*2]++:(e.matches++,t--,e.dyn_ltree[(Wn[r]+to+1)*2]++,e.dyn_dtree[c0(t)*2]++),e.last_lit===e.lit_bufsize-1}an._tr_init=oE;an._tr_stored_block=d0;an._tr_flush_block=iE;an._tr_tally=aE;an._tr_align=sE});var gc=ct((oO,m0)=>{"use strict";function cE(e,t,r,n){for(var o=e&65535|0,s=e>>>16&65535|0,i=0;r!==0;){i=r>2e3?2e3:r,r-=i;do o=o+t[n++]|0,s=s+o|0;while(--i);o%=65521,s%=65521}return o|s<<16|0}m0.exports=cE});var xc=ct((sO,p0)=>{"use strict";function fE(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t}var hE=fE();function lE(e,t,r,n){var o=hE,s=n+r;e^=-1;for(var i=n;i<s;i++)e=e>>>8^o[(e^t[i])&255];return e^-1}p0.exports=lE});var Ss=ct((iO,g0)=>{"use strict";g0.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var b0=ct(ae=>{"use strict";var xt=xe(),Nt=A0(),_0=gc(),Oe=xc(),uE=Ss(),hr=0,dE=1,AE=3,Pe=4,x0=5,ie=0,B0=1,Gt=-2,mE=-3,Bc=-5,pE=-1,gE=1,Rs=2,xE=3,BE=4,EE=0,_E=2,Ls=8,yE=9,TE=15,CE=8,ME=29,bE=256,_c=bE+1+ME,wE=30,IE=19,SE=2*_c+1,RE=15,k=3,Ne=258,jt=Ne+k+1,FE=32,vs=42,yc=69,Fs=73,Ds=91,Os=103,ar=113,ro=666,it=1,no=2,cr=3,hn=4,DE=3;function Ge(e,t){return e.msg=uE[t],t}function E0(e){return(e<<1)-(e>4?9:0)}function ve(e){for(var t=e.length;--t>=0;)e[t]=0}function Le(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(xt.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0&&(t.pending_out=0))}function lt(e,t){Nt._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Le(e.strm)}function V(e,t){e.pending_buf[e.pending++]=t}function eo(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function OE(e,t,r,n){var o=e.avail_in;return o>n&&(o=n),o===0?0:(e.avail_in-=o,xt.arraySet(t,e.input,e.next_in,o,r),e.state.wrap===1?e.adler=_0(e.adler,t,o,r):e.state.wrap===2&&(e.adler=Oe(e.adler,t,o,r)),e.next_in+=o,e.total_in+=o,o)}function y0(e,t){var r=e.max_chain_length,n=e.strstart,o,s,i=e.prev_length,a=e.nice_match,c=e.strstart>e.w_size-jt?e.strstart-(e.w_size-jt):0,f=e.window,h=e.w_mask,u=e.prev,l=e.strstart+Ne,d=f[n+i-1],A=f[n+i];e.prev_length>=e.good_match&&(r>>=2),a>e.lookahead&&(a=e.lookahead);do if(o=t,!(f[o+i]!==A||f[o+i-1]!==d||f[o]!==f[n]||f[++o]!==f[n+1])){n+=2,o++;do;while(f[++n]===f[++o]&&f[++n]===f[++o]&&f[++n]===f[++o]&&f[++n]===f[++o]&&f[++n]===f[++o]&&f[++n]===f[++o]&&f[++n]===f[++o]&&f[++n]===f[++o]&&n<l);if(s=Ne-(l-n),n=l-Ne,s>i){if(e.match_start=t,i=s,s>=a)break;d=f[n+i-1],A=f[n+i]}}while((t=u[t&h])>c&&--r!==0);return i<=e.lookahead?i:e.lookahead}function fr(e){var t=e.w_size,r,n,o,s,i;do{if(s=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-jt)){xt.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,n=e.hash_size,r=n;do o=e.head[--r],e.head[r]=o>=t?o-t:0;while(--n);n=t,r=n;do o=e.prev[--r],e.prev[r]=o>=t?o-t:0;while(--n);s+=t}if(e.strm.avail_in===0)break;if(n=OE(e.strm,e.window,e.strstart+e.lookahead,s),e.lookahead+=n,e.lookahead+e.insert>=k)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=(e.ins_h<<e.hash_shift^e.window[i+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[i+k-1])&e.hash_mask,e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<k)););}while(e.lookahead<jt&&e.strm.avail_in!==0)}function LE(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(fr(e),e.lookahead===0&&t===hr)return it;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((e.strstart===0||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,lt(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-jt&&(lt(e,!1),e.strm.avail_out===0))return it}return e.insert=0,t===Pe?(lt(e,!0),e.strm.avail_out===0?cr:hn):(e.strstart>e.block_start&&(lt(e,!1),e.strm.avail_out===0),it)}function Ec(e,t){for(var r,n;;){if(e.lookahead<jt){if(fr(e),e.lookahead<jt&&t===hr)return it;if(e.lookahead===0)break}if(r=0,e.lookahead>=k&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+k-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-jt&&(e.match_length=y0(e,r)),e.match_length>=k)if(n=Nt._tr_tally(e,e.strstart-e.match_start,e.match_length-k),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=k){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+k-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=Nt._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(lt(e,!1),e.strm.avail_out===0))return it}return e.insert=e.strstart<k-1?e.strstart:k-1,t===Pe?(lt(e,!0),e.strm.avail_out===0?cr:hn):e.last_lit&&(lt(e,!1),e.strm.avail_out===0)?it:no}function cn(e,t){for(var r,n,o;;){if(e.lookahead<jt){if(fr(e),e.lookahead<jt&&t===hr)return it;if(e.lookahead===0)break}if(r=0,e.lookahead>=k&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+k-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=k-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-jt&&(e.match_length=y0(e,r),e.match_length<=5&&(e.strategy===gE||e.match_length===k&&e.strstart-e.match_start>4096)&&(e.match_length=k-1)),e.prev_length>=k&&e.match_length<=e.prev_length){o=e.strstart+e.lookahead-k,n=Nt._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-k),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=o&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+k-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=k-1,e.strstart++,n&&(lt(e,!1),e.strm.avail_out===0))return it}else if(e.match_available){if(n=Nt._tr_tally(e,0,e.window[e.strstart-1]),n&&lt(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return it}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=Nt._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<k-1?e.strstart:k-1,t===Pe?(lt(e,!0),e.strm.avail_out===0?cr:hn):e.last_lit&&(lt(e,!1),e.strm.avail_out===0)?it:no}function vE(e,t){for(var r,n,o,s,i=e.window;;){if(e.lookahead<=Ne){if(fr(e),e.lookahead<=Ne&&t===hr)return it;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=k&&e.strstart>0&&(o=e.strstart-1,n=i[o],n===i[++o]&&n===i[++o]&&n===i[++o])){s=e.strstart+Ne;do;while(n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&o<s);e.match_length=Ne-(s-o),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=k?(r=Nt._tr_tally(e,1,e.match_length-k),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=Nt._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(lt(e,!1),e.strm.avail_out===0))return it}return e.insert=0,t===Pe?(lt(e,!0),e.strm.avail_out===0?cr:hn):e.last_lit&&(lt(e,!1),e.strm.avail_out===0)?it:no}function NE(e,t){for(var r;;){if(e.lookahead===0&&(fr(e),e.lookahead===0)){if(t===hr)return it;break}if(e.match_length=0,r=Nt._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(lt(e,!1),e.strm.avail_out===0))return it}return e.insert=0,t===Pe?(lt(e,!0),e.strm.avail_out===0?cr:hn):e.last_lit&&(lt(e,!1),e.strm.avail_out===0)?it:no}function se(e,t,r,n,o){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=o}var fn;fn=[new se(0,0,0,0,LE),new se(4,4,8,4,Ec),new se(4,5,16,8,Ec),new se(4,6,32,32,Ec),new se(4,4,16,16,cn),new se(8,16,32,32,cn),new se(8,16,128,128,cn),new se(8,32,128,256,cn),new se(32,128,258,1024,cn),new se(32,258,258,4096,cn)];function GE(e){e.window_size=2*e.w_size,ve(e.head),e.max_lazy_match=fn[e.level].max_lazy,e.good_match=fn[e.level].good_length,e.nice_match=fn[e.level].nice_length,e.max_chain_length=fn[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=k-1,e.match_available=0,e.ins_h=0}function PE(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Ls,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new xt.Buf16(SE*2),this.dyn_dtree=new xt.Buf16((2*wE+1)*2),this.bl_tree=new xt.Buf16((2*IE+1)*2),ve(this.dyn_ltree),ve(this.dyn_dtree),ve(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new xt.Buf16(RE+1),this.heap=new xt.Buf16(2*_c+1),ve(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new xt.Buf16(2*_c+1),ve(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function T0(e){var t;return!e||!e.state?Ge(e,Gt):(e.total_in=e.total_out=0,e.data_type=_E,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?vs:ar,e.adler=t.wrap===2?0:1,t.last_flush=hr,Nt._tr_init(t),ie)}function C0(e){var t=T0(e);return t===ie&&GE(e.state),t}function UE(e,t){return!e||!e.state||e.state.wrap!==2?Gt:(e.state.gzhead=t,ie)}function M0(e,t,r,n,o,s){if(!e)return Gt;var i=1;if(t===pE&&(t=6),n<0?(i=0,n=-n):n>15&&(i=2,n-=16),o<1||o>yE||r!==Ls||n<8||n>15||t<0||t>9||s<0||s>BE)return Ge(e,Gt);n===8&&(n=9);var a=new PE;return e.state=a,a.strm=e,a.wrap=i,a.gzhead=null,a.w_bits=n,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=o+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+k-1)/k),a.window=new xt.Buf8(a.w_size*2),a.head=new xt.Buf16(a.hash_size),a.prev=new xt.Buf16(a.w_size),a.lit_bufsize=1<<o+6,a.pending_buf_size=a.lit_bufsize*4,a.pending_buf=new xt.Buf8(a.pending_buf_size),a.d_buf=1*a.lit_bufsize,a.l_buf=(1+2)*a.lit_bufsize,a.level=t,a.strategy=s,a.method=r,C0(e)}function HE(e,t){return M0(e,t,Ls,TE,CE,EE)}function kE(e,t){var r,n,o,s;if(!e||!e.state||t>x0||t<0)return e?Ge(e,Gt):Gt;if(n=e.state,!e.output||!e.input&&e.avail_in!==0||n.status===ro&&t!==Pe)return Ge(e,e.avail_out===0?Bc:Gt);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===vs)if(n.wrap===2)e.adler=0,V(n,31),V(n,139),V(n,8),n.gzhead?(V(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),V(n,n.gzhead.time&255),V(n,n.gzhead.time>>8&255),V(n,n.gzhead.time>>16&255),V(n,n.gzhead.time>>24&255),V(n,n.level===9?2:n.strategy>=Rs||n.level<2?4:0),V(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(V(n,n.gzhead.extra.length&255),V(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Oe(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=yc):(V(n,0),V(n,0),V(n,0),V(n,0),V(n,0),V(n,n.level===9?2:n.strategy>=Rs||n.level<2?4:0),V(n,DE),n.status=ar);else{var i=Ls+(n.w_bits-8<<4)<<8,a=-1;n.strategy>=Rs||n.level<2?a=0:n.level<6?a=1:n.level===6?a=2:a=3,i|=a<<6,n.strstart!==0&&(i|=FE),i+=31-i%31,n.status=ar,eo(n,i),n.strstart!==0&&(eo(n,e.adler>>>16),eo(n,e.adler&65535)),e.adler=1}if(n.status===yc)if(n.gzhead.extra){for(o=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=Oe(e.adler,n.pending_buf,n.pending-o,o)),Le(e),o=n.pending,n.pending===n.pending_buf_size));)V(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(e.adler=Oe(e.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=Fs)}else n.status=Fs;if(n.status===Fs)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=Oe(e.adler,n.pending_buf,n.pending-o,o)),Le(e),o=n.pending,n.pending===n.pending_buf_size)){s=1;break}n.gzindex<n.gzhead.name.length?s=n.gzhead.name.charCodeAt(n.gzindex++)&255:s=0,V(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>o&&(e.adler=Oe(e.adler,n.pending_buf,n.pending-o,o)),s===0&&(n.gzindex=0,n.status=Ds)}else n.status=Ds;if(n.status===Ds)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=Oe(e.adler,n.pending_buf,n.pending-o,o)),Le(e),o=n.pending,n.pending===n.pending_buf_size)){s=1;break}n.gzindex<n.gzhead.comment.length?s=n.gzhead.comment.charCodeAt(n.gzindex++)&255:s=0,V(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>o&&(e.adler=Oe(e.adler,n.pending_buf,n.pending-o,o)),s===0&&(n.status=Os)}else n.status=Os;if(n.status===Os&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Le(e),n.pending+2<=n.pending_buf_size&&(V(n,e.adler&255),V(n,e.adler>>8&255),e.adler=0,n.status=ar)):n.status=ar),n.pending!==0){if(Le(e),e.avail_out===0)return n.last_flush=-1,ie}else if(e.avail_in===0&&E0(t)<=E0(r)&&t!==Pe)return Ge(e,Bc);if(n.status===ro&&e.avail_in!==0)return Ge(e,Bc);if(e.avail_in!==0||n.lookahead!==0||t!==hr&&n.status!==ro){var c=n.strategy===Rs?NE(n,t):n.strategy===xE?vE(n,t):fn[n.level].func(n,t);if((c===cr||c===hn)&&(n.status=ro),c===it||c===cr)return e.avail_out===0&&(n.last_flush=-1),ie;if(c===no&&(t===dE?Nt._tr_align(n):t!==x0&&(Nt._tr_stored_block(n,0,0,!1),t===AE&&(ve(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Le(e),e.avail_out===0))return n.last_flush=-1,ie}return t!==Pe?ie:n.wrap<=0?B0:(n.wrap===2?(V(n,e.adler&255),V(n,e.adler>>8&255),V(n,e.adler>>16&255),V(n,e.adler>>24&255),V(n,e.total_in&255),V(n,e.total_in>>8&255),V(n,e.total_in>>16&255),V(n,e.total_in>>24&255)):(eo(n,e.adler>>>16),eo(n,e.adler&65535)),Le(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?ie:B0)}function JE(e){var t;return!e||!e.state?Gt:(t=e.state.status,t!==vs&&t!==yc&&t!==Fs&&t!==Ds&&t!==Os&&t!==ar&&t!==ro?Ge(e,Gt):(e.state=null,t===ar?Ge(e,mE):ie))}function zE(e,t){var r=t.length,n,o,s,i,a,c,f,h;if(!e||!e.state||(n=e.state,i=n.wrap,i===2||i===1&&n.status!==vs||n.lookahead))return Gt;for(i===1&&(e.adler=_0(e.adler,t,r,0)),n.wrap=0,r>=n.w_size&&(i===0&&(ve(n.head),n.strstart=0,n.block_start=0,n.insert=0),h=new xt.Buf8(n.w_size),xt.arraySet(h,t,r-n.w_size,n.w_size,0),t=h,r=n.w_size),a=e.avail_in,c=e.next_in,f=e.input,e.avail_in=r,e.next_in=0,e.input=t,fr(n);n.lookahead>=k;){o=n.strstart,s=n.lookahead-(k-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[o+k-1])&n.hash_mask,n.prev[o&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=o,o++;while(--s);n.strstart=o,n.lookahead=k-1,fr(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=k-1,n.match_available=0,e.next_in=c,e.input=f,e.avail_in=a,n.wrap=i,ie}ae.deflateInit=HE;ae.deflateInit2=M0;ae.deflateReset=C0;ae.deflateResetKeep=T0;ae.deflateSetHeader=UE;ae.deflate=kE;ae.deflateEnd=JE;ae.deflateSetDictionary=zE;ae.deflateInfo="pako deflate (from Nodeca project)"});var Tc=ct(ln=>{"use strict";var Ns=xe(),w0=!0,I0=!0;try{String.fromCharCode.apply(null,[0])}catch{w0=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{I0=!1}var oo=new Ns.Buf8(256);for(Ee=0;Ee<256;Ee++)oo[Ee]=Ee>=252?6:Ee>=248?5:Ee>=240?4:Ee>=224?3:Ee>=192?2:1;var Ee;oo[254]=oo[254]=1;ln.string2buf=function(e){var t,r,n,o,s,i=e.length,a=0;for(o=0;o<i;o++)r=e.charCodeAt(o),(r&64512)===55296&&o+1<i&&(n=e.charCodeAt(o+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),o++)),a+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Ns.Buf8(a),s=0,o=0;s<a;o++)r=e.charCodeAt(o),(r&64512)===55296&&o+1<i&&(n=e.charCodeAt(o+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),o++)),r<128?t[s++]=r:r<2048?(t[s++]=192|r>>>6,t[s++]=128|r&63):r<65536?(t[s++]=224|r>>>12,t[s++]=128|r>>>6&63,t[s++]=128|r&63):(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63,t[s++]=128|r>>>6&63,t[s++]=128|r&63);return t};function S0(e,t){if(t<65534&&(e.subarray&&I0||!e.subarray&&w0))return String.fromCharCode.apply(null,Ns.shrinkBuf(e,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}ln.buf2binstring=function(e){return S0(e,e.length)};ln.binstring2buf=function(e){for(var t=new Ns.Buf8(e.length),r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t};ln.buf2string=function(e,t){var r,n,o,s,i=t||e.length,a=new Array(i*2);for(n=0,r=0;r<i;){if(o=e[r++],o<128){a[n++]=o;continue}if(s=oo[o],s>4){a[n++]=65533,r+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&r<i;)o=o<<6|e[r++]&63,s--;if(s>1){a[n++]=65533;continue}o<65536?a[n++]=o:(o-=65536,a[n++]=55296|o>>10&1023,a[n++]=56320|o&1023)}return S0(a,n)};ln.utf8border=function(e,t){var r;for(t=t||e.length,t>e.length&&(t=e.length),r=t-1;r>=0&&(e[r]&192)===128;)r--;return r<0||r===0?t:r+oo[e[r]]>t?r:t}});var Cc=ct((fO,R0)=>{"use strict";function QE(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}R0.exports=QE});var L0=ct(ao=>{"use strict";var so=b0(),io=xe(),bc=Tc(),wc=Ss(),VE=Cc(),O0=Object.prototype.toString,jE=0,Mc=4,un=0,F0=1,D0=2,KE=-1,XE=0,YE=8;function lr(e){if(!(this instanceof lr))return new lr(e);this.options=io.assign({level:KE,method:YE,chunkSize:16384,windowBits:15,memLevel:8,strategy:XE,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new VE,this.strm.avail_out=0;var r=so.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==un)throw new Error(wc[r]);if(t.header&&so.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(typeof t.dictionary=="string"?n=bc.string2buf(t.dictionary):O0.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,r=so.deflateSetDictionary(this.strm,n),r!==un)throw new Error(wc[r]);this._dict_set=!0}}lr.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,o,s;if(this.ended)return!1;s=t===~~t?t:t===!0?Mc:jE,typeof e=="string"?r.input=bc.string2buf(e):O0.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new io.Buf8(n),r.next_out=0,r.avail_out=n),o=so.deflate(r,s),o!==F0&&o!==un)return this.onEnd(o),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(s===Mc||s===D0))&&(this.options.to==="string"?this.onData(bc.buf2binstring(io.shrinkBuf(r.output,r.next_out))):this.onData(io.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&o!==F0);return s===Mc?(o=so.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===un):(s===D0&&(this.onEnd(un),r.avail_out=0),!0)};lr.prototype.onData=function(e){this.chunks.push(e)};lr.prototype.onEnd=function(e){e===un&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=io.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Ic(e,t){var r=new lr(t);if(r.push(e,!0),r.err)throw r.msg||wc[r.err];return r.result}function ZE(e,t){return t=t||{},t.raw=!0,Ic(e,t)}function qE(e,t){return t=t||{},t.gzip=!0,Ic(e,t)}ao.Deflate=lr;ao.deflate=Ic;ao.deflateRaw=ZE;ao.gzip=qE});var N0=ct((lO,v0)=>{"use strict";var Gs=30,WE=12;v0.exports=function(t,r){var n,o,s,i,a,c,f,h,u,l,d,A,m,p,E,y,C,M,T,I,w,O,x,g,B;n=t.state,o=t.next_in,g=t.input,s=o+(t.avail_in-5),i=t.next_out,B=t.output,a=i-(r-t.avail_out),c=i+(t.avail_out-257),f=n.dmax,h=n.wsize,u=n.whave,l=n.wnext,d=n.window,A=n.hold,m=n.bits,p=n.lencode,E=n.distcode,y=(1<<n.lenbits)-1,C=(1<<n.distbits)-1;t:do{m<15&&(A+=g[o++]<<m,m+=8,A+=g[o++]<<m,m+=8),M=p[A&y];e:for(;;){if(T=M>>>24,A>>>=T,m-=T,T=M>>>16&255,T===0)B[i++]=M&65535;else if(T&16){I=M&65535,T&=15,T&&(m<T&&(A+=g[o++]<<m,m+=8),I+=A&(1<<T)-1,A>>>=T,m-=T),m<15&&(A+=g[o++]<<m,m+=8,A+=g[o++]<<m,m+=8),M=E[A&C];r:for(;;){if(T=M>>>24,A>>>=T,m-=T,T=M>>>16&255,T&16){if(w=M&65535,T&=15,m<T&&(A+=g[o++]<<m,m+=8,m<T&&(A+=g[o++]<<m,m+=8)),w+=A&(1<<T)-1,w>f){t.msg="invalid distance too far back",n.mode=Gs;break t}if(A>>>=T,m-=T,T=i-a,w>T){if(T=w-T,T>u&&n.sane){t.msg="invalid distance too far back",n.mode=Gs;break t}if(O=0,x=d,l===0){if(O+=h-T,T<I){I-=T;do B[i++]=d[O++];while(--T);O=i-w,x=B}}else if(l<T){if(O+=h+l-T,T-=l,T<I){I-=T;do B[i++]=d[O++];while(--T);if(O=0,l<I){T=l,I-=T;do B[i++]=d[O++];while(--T);O=i-w,x=B}}}else if(O+=l-T,T<I){I-=T;do B[i++]=d[O++];while(--T);O=i-w,x=B}for(;I>2;)B[i++]=x[O++],B[i++]=x[O++],B[i++]=x[O++],I-=3;I&&(B[i++]=x[O++],I>1&&(B[i++]=x[O++]))}else{O=i-w;do B[i++]=B[O++],B[i++]=B[O++],B[i++]=B[O++],I-=3;while(I>2);I&&(B[i++]=B[O++],I>1&&(B[i++]=B[O++]))}}else if(T&64){t.msg="invalid distance code",n.mode=Gs;break t}else{M=E[(M&65535)+(A&(1<<T)-1)];continue r}break}}else if(T&64)if(T&32){n.mode=WE;break t}else{t.msg="invalid literal/length code",n.mode=Gs;break t}else{M=p[(M&65535)+(A&(1<<T)-1)];continue e}break}}while(o<s&&i<c);I=m>>3,o-=I,m-=I<<3,A&=(1<<m)-1,t.next_in=o,t.next_out=i,t.avail_in=o<s?5+(s-o):5-(o-s),t.avail_out=i<c?257+(c-i):257-(i-c),n.hold=A,n.bits=m}});var z0=ct((uO,J0)=>{"use strict";var G0=xe(),dn=15,P0=852,U0=592,H0=0,Sc=1,k0=2,$E=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],t_=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],e_=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],r_=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];J0.exports=function(t,r,n,o,s,i,a,c){var f=c.bits,h=0,u=0,l=0,d=0,A=0,m=0,p=0,E=0,y=0,C=0,M,T,I,w,O,x=null,g=0,B,_=new G0.Buf16(dn+1),P=new G0.Buf16(dn+1),G=null,U=0,v,at,mt;for(h=0;h<=dn;h++)_[h]=0;for(u=0;u<o;u++)_[r[n+u]]++;for(A=f,d=dn;d>=1&&_[d]===0;d--);if(A>d&&(A=d),d===0)return s[i++]=1<<24|64<<16|0,s[i++]=1<<24|64<<16|0,c.bits=1,0;for(l=1;l<d&&_[l]===0;l++);for(A<l&&(A=l),E=1,h=1;h<=dn;h++)if(E<<=1,E-=_[h],E<0)return-1;if(E>0&&(t===H0||d!==1))return-1;for(P[1]=0,h=1;h<dn;h++)P[h+1]=P[h]+_[h];for(u=0;u<o;u++)r[n+u]!==0&&(a[P[r[n+u]]++]=u);if(t===H0?(x=G=a,B=19):t===Sc?(x=$E,g-=257,G=t_,U-=257,B=256):(x=e_,G=r_,B=-1),C=0,u=0,h=l,O=i,m=A,p=0,I=-1,y=1<<A,w=y-1,t===Sc&&y>P0||t===k0&&y>U0)return 1;for(;;){v=h-p,a[u]<B?(at=0,mt=a[u]):a[u]>B?(at=G[U+a[u]],mt=x[g+a[u]]):(at=32+64,mt=0),M=1<<h-p,T=1<<m,l=T;do T-=M,s[O+(C>>p)+T]=v<<24|at<<16|mt|0;while(T!==0);for(M=1<<h-1;C&M;)M>>=1;if(M!==0?(C&=M-1,C+=M):C=0,u++,--_[h]===0){if(h===d)break;h=r[n+a[u]]}if(h>A&&(C&w)!==I){for(p===0&&(p=A),O+=l,m=h-p,E=1<<m;m+p<d&&(E-=_[m+p],!(E<=0));)m++,E<<=1;if(y+=1<<m,t===Sc&&y>P0||t===k0&&y>U0)return 1;I=C&w,s[I]=A<<24|m<<16|O-i|0}}return C!==0&&(s[O+C]=h-p<<24|64<<16|0),c.bits=A,0}});var Cd=ct(Kt=>{"use strict";var St=xe(),vc=gc(),ce=xc(),n_=N0(),co=z0(),o_=0,md=1,pd=2,Q0=4,s_=5,Ps=6,ur=0,i_=1,a_=2,Pt=-2,gd=-3,Nc=-4,c_=-5,V0=8,xd=1,j0=2,K0=3,X0=4,Y0=5,Z0=6,q0=7,W0=8,$0=9,td=10,ks=11,_e=12,Rc=13,ed=14,Fc=15,rd=16,nd=17,od=18,sd=19,Us=20,Hs=21,id=22,ad=23,cd=24,fd=25,hd=26,Dc=27,ld=28,ud=29,$=30,Gc=31,f_=32,h_=852,l_=592,u_=15,d_=u_;function dd(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function A_(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new St.Buf16(320),this.work=new St.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Bd(e){var t;return!e||!e.state?Pt:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=xd,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new St.Buf32(h_),t.distcode=t.distdyn=new St.Buf32(l_),t.sane=1,t.back=-1,ur)}function Ed(e){var t;return!e||!e.state?Pt:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,Bd(e))}function _d(e,t){var r,n;return!e||!e.state||(n=e.state,t<0?(r=0,t=-t):(r=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?Pt:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,Ed(e))}function yd(e,t){var r,n;return e?(n=new A_,e.state=n,n.window=null,r=_d(e,t),r!==ur&&(e.state=null),r):Pt}function m_(e){return yd(e,d_)}var Ad=!0,Oc,Lc;function p_(e){if(Ad){var t;for(Oc=new St.Buf32(512),Lc=new St.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(co(md,e.lens,0,288,Oc,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;co(pd,e.lens,0,32,Lc,0,e.work,{bits:5}),Ad=!1}e.lencode=Oc,e.lenbits=9,e.distcode=Lc,e.distbits=5}function Td(e,t,r,n){var o,s=e.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new St.Buf8(s.wsize)),n>=s.wsize?(St.arraySet(s.window,t,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(o=s.wsize-s.wnext,o>n&&(o=n),St.arraySet(s.window,t,r-n,o,s.wnext),n-=o,n?(St.arraySet(s.window,t,r-n,n,0),s.wnext=n,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=o))),0}function g_(e,t){var r,n,o,s,i,a,c,f,h,u,l,d,A,m,p=0,E,y,C,M,T,I,w,O,x=new St.Buf8(4),g,B,_=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return Pt;r=e.state,r.mode===_e&&(r.mode=Rc),i=e.next_out,o=e.output,c=e.avail_out,s=e.next_in,n=e.input,a=e.avail_in,f=r.hold,h=r.bits,u=a,l=c,O=ur;t:for(;;)switch(r.mode){case xd:if(r.wrap===0){r.mode=Rc;break}for(;h<16;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}if(r.wrap&2&&f===35615){r.check=0,x[0]=f&255,x[1]=f>>>8&255,r.check=ce(r.check,x,2,0),f=0,h=0,r.mode=j0;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((f&255)<<8)+(f>>8))%31){e.msg="incorrect header check",r.mode=$;break}if((f&15)!==V0){e.msg="unknown compression method",r.mode=$;break}if(f>>>=4,h-=4,w=(f&15)+8,r.wbits===0)r.wbits=w;else if(w>r.wbits){e.msg="invalid window size",r.mode=$;break}r.dmax=1<<w,e.adler=r.check=1,r.mode=f&512?td:_e,f=0,h=0;break;case j0:for(;h<16;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}if(r.flags=f,(r.flags&255)!==V0){e.msg="unknown compression method",r.mode=$;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=$;break}r.head&&(r.head.text=f>>8&1),r.flags&512&&(x[0]=f&255,x[1]=f>>>8&255,r.check=ce(r.check,x,2,0)),f=0,h=0,r.mode=K0;case K0:for(;h<32;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}r.head&&(r.head.time=f),r.flags&512&&(x[0]=f&255,x[1]=f>>>8&255,x[2]=f>>>16&255,x[3]=f>>>24&255,r.check=ce(r.check,x,4,0)),f=0,h=0,r.mode=X0;case X0:for(;h<16;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}r.head&&(r.head.xflags=f&255,r.head.os=f>>8),r.flags&512&&(x[0]=f&255,x[1]=f>>>8&255,r.check=ce(r.check,x,2,0)),f=0,h=0,r.mode=Y0;case Y0:if(r.flags&1024){for(;h<16;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}r.length=f,r.head&&(r.head.extra_len=f),r.flags&512&&(x[0]=f&255,x[1]=f>>>8&255,r.check=ce(r.check,x,2,0)),f=0,h=0}else r.head&&(r.head.extra=null);r.mode=Z0;case Z0:if(r.flags&1024&&(d=r.length,d>a&&(d=a),d&&(r.head&&(w=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),St.arraySet(r.head.extra,n,s,d,w)),r.flags&512&&(r.check=ce(r.check,n,d,s)),a-=d,s+=d,r.length-=d),r.length))break t;r.length=0,r.mode=q0;case q0:if(r.flags&2048){if(a===0)break t;d=0;do w=n[s+d++],r.head&&w&&r.length<65536&&(r.head.name+=String.fromCharCode(w));while(w&&d<a);if(r.flags&512&&(r.check=ce(r.check,n,d,s)),a-=d,s+=d,w)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=W0;case W0:if(r.flags&4096){if(a===0)break t;d=0;do w=n[s+d++],r.head&&w&&r.length<65536&&(r.head.comment+=String.fromCharCode(w));while(w&&d<a);if(r.flags&512&&(r.check=ce(r.check,n,d,s)),a-=d,s+=d,w)break t}else r.head&&(r.head.comment=null);r.mode=$0;case $0:if(r.flags&512){for(;h<16;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}if(f!==(r.check&65535)){e.msg="header crc mismatch",r.mode=$;break}f=0,h=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=_e;break;case td:for(;h<32;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}e.adler=r.check=dd(f),f=0,h=0,r.mode=ks;case ks:if(r.havedict===0)return e.next_out=i,e.avail_out=c,e.next_in=s,e.avail_in=a,r.hold=f,r.bits=h,a_;e.adler=r.check=1,r.mode=_e;case _e:if(t===s_||t===Ps)break t;case Rc:if(r.last){f>>>=h&7,h-=h&7,r.mode=Dc;break}for(;h<3;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}switch(r.last=f&1,f>>>=1,h-=1,f&3){case 0:r.mode=ed;break;case 1:if(p_(r),r.mode=Us,t===Ps){f>>>=2,h-=2;break t}break;case 2:r.mode=nd;break;case 3:e.msg="invalid block type",r.mode=$}f>>>=2,h-=2;break;case ed:for(f>>>=h&7,h-=h&7;h<32;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}if((f&65535)!==(f>>>16^65535)){e.msg="invalid stored block lengths",r.mode=$;break}if(r.length=f&65535,f=0,h=0,r.mode=Fc,t===Ps)break t;case Fc:r.mode=rd;case rd:if(d=r.length,d){if(d>a&&(d=a),d>c&&(d=c),d===0)break t;St.arraySet(o,n,s,d,i),a-=d,s+=d,c-=d,i+=d,r.length-=d;break}r.mode=_e;break;case nd:for(;h<14;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}if(r.nlen=(f&31)+257,f>>>=5,h-=5,r.ndist=(f&31)+1,f>>>=5,h-=5,r.ncode=(f&15)+4,f>>>=4,h-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=$;break}r.have=0,r.mode=od;case od:for(;r.have<r.ncode;){for(;h<3;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}r.lens[_[r.have++]]=f&7,f>>>=3,h-=3}for(;r.have<19;)r.lens[_[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,g={bits:r.lenbits},O=co(o_,r.lens,0,19,r.lencode,0,r.work,g),r.lenbits=g.bits,O){e.msg="invalid code lengths set",r.mode=$;break}r.have=0,r.mode=sd;case sd:for(;r.have<r.nlen+r.ndist;){for(;p=r.lencode[f&(1<<r.lenbits)-1],E=p>>>24,y=p>>>16&255,C=p&65535,!(E<=h);){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}if(C<16)f>>>=E,h-=E,r.lens[r.have++]=C;else{if(C===16){for(B=E+2;h<B;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}if(f>>>=E,h-=E,r.have===0){e.msg="invalid bit length repeat",r.mode=$;break}w=r.lens[r.have-1],d=3+(f&3),f>>>=2,h-=2}else if(C===17){for(B=E+3;h<B;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}f>>>=E,h-=E,w=0,d=3+(f&7),f>>>=3,h-=3}else{for(B=E+7;h<B;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}f>>>=E,h-=E,w=0,d=11+(f&127),f>>>=7,h-=7}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=$;break}for(;d--;)r.lens[r.have++]=w}}if(r.mode===$)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=$;break}if(r.lenbits=9,g={bits:r.lenbits},O=co(md,r.lens,0,r.nlen,r.lencode,0,r.work,g),r.lenbits=g.bits,O){e.msg="invalid literal/lengths set",r.mode=$;break}if(r.distbits=6,r.distcode=r.distdyn,g={bits:r.distbits},O=co(pd,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,g),r.distbits=g.bits,O){e.msg="invalid distances set",r.mode=$;break}if(r.mode=Us,t===Ps)break t;case Us:r.mode=Hs;case Hs:if(a>=6&&c>=258){e.next_out=i,e.avail_out=c,e.next_in=s,e.avail_in=a,r.hold=f,r.bits=h,n_(e,l),i=e.next_out,o=e.output,c=e.avail_out,s=e.next_in,n=e.input,a=e.avail_in,f=r.hold,h=r.bits,r.mode===_e&&(r.back=-1);break}for(r.back=0;p=r.lencode[f&(1<<r.lenbits)-1],E=p>>>24,y=p>>>16&255,C=p&65535,!(E<=h);){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}if(y&&!(y&240)){for(M=E,T=y,I=C;p=r.lencode[I+((f&(1<<M+T)-1)>>M)],E=p>>>24,y=p>>>16&255,C=p&65535,!(M+E<=h);){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}f>>>=M,h-=M,r.back+=M}if(f>>>=E,h-=E,r.back+=E,r.length=C,y===0){r.mode=hd;break}if(y&32){r.back=-1,r.mode=_e;break}if(y&64){e.msg="invalid literal/length code",r.mode=$;break}r.extra=y&15,r.mode=id;case id:if(r.extra){for(B=r.extra;h<B;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}r.length+=f&(1<<r.extra)-1,f>>>=r.extra,h-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=ad;case ad:for(;p=r.distcode[f&(1<<r.distbits)-1],E=p>>>24,y=p>>>16&255,C=p&65535,!(E<=h);){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}if(!(y&240)){for(M=E,T=y,I=C;p=r.distcode[I+((f&(1<<M+T)-1)>>M)],E=p>>>24,y=p>>>16&255,C=p&65535,!(M+E<=h);){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}f>>>=M,h-=M,r.back+=M}if(f>>>=E,h-=E,r.back+=E,y&64){e.msg="invalid distance code",r.mode=$;break}r.offset=C,r.extra=y&15,r.mode=cd;case cd:if(r.extra){for(B=r.extra;h<B;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}r.offset+=f&(1<<r.extra)-1,f>>>=r.extra,h-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=$;break}r.mode=fd;case fd:if(c===0)break t;if(d=l-c,r.offset>d){if(d=r.offset-d,d>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=$;break}d>r.wnext?(d-=r.wnext,A=r.wsize-d):A=r.wnext-d,d>r.length&&(d=r.length),m=r.window}else m=o,A=i-r.offset,d=r.length;d>c&&(d=c),c-=d,r.length-=d;do o[i++]=m[A++];while(--d);r.length===0&&(r.mode=Hs);break;case hd:if(c===0)break t;o[i++]=r.length,c--,r.mode=Hs;break;case Dc:if(r.wrap){for(;h<32;){if(a===0)break t;a--,f|=n[s++]<<h,h+=8}if(l-=c,e.total_out+=l,r.total+=l,l&&(e.adler=r.check=r.flags?ce(r.check,o,l,i-l):vc(r.check,o,l,i-l)),l=c,(r.flags?f:dd(f))!==r.check){e.msg="incorrect data check",r.mode=$;break}f=0,h=0}r.mode=ld;case ld:if(r.wrap&&r.flags){for(;h<32;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}if(f!==(r.total&4294967295)){e.msg="incorrect length check",r.mode=$;break}f=0,h=0}r.mode=ud;case ud:O=i_;break t;case $:O=gd;break t;case Gc:return Nc;case f_:default:return Pt}return e.next_out=i,e.avail_out=c,e.next_in=s,e.avail_in=a,r.hold=f,r.bits=h,(r.wsize||l!==e.avail_out&&r.mode<$&&(r.mode<Dc||t!==Q0))&&Td(e,e.output,e.next_out,l-e.avail_out)?(r.mode=Gc,Nc):(u-=e.avail_in,l-=e.avail_out,e.total_in+=u,e.total_out+=l,r.total+=l,r.wrap&&l&&(e.adler=r.check=r.flags?ce(r.check,o,l,e.next_out-l):vc(r.check,o,l,e.next_out-l)),e.data_type=r.bits+(r.last?64:0)+(r.mode===_e?128:0)+(r.mode===Us||r.mode===Fc?256:0),(u===0&&l===0||t===Q0)&&O===ur&&(O=c_),O)}function x_(e){if(!e||!e.state)return Pt;var t=e.state;return t.window&&(t.window=null),e.state=null,ur}function B_(e,t){var r;return!e||!e.state||(r=e.state,!(r.wrap&2))?Pt:(r.head=t,t.done=!1,ur)}function E_(e,t){var r=t.length,n,o,s;return!e||!e.state||(n=e.state,n.wrap!==0&&n.mode!==ks)?Pt:n.mode===ks&&(o=1,o=vc(o,t,r,0),o!==n.check)?gd:(s=Td(e,t,r,r),s?(n.mode=Gc,Nc):(n.havedict=1,ur))}Kt.inflateReset=Ed;Kt.inflateReset2=_d;Kt.inflateResetKeep=Bd;Kt.inflateInit=m_;Kt.inflateInit2=yd;Kt.inflate=g_;Kt.inflateEnd=x_;Kt.inflateGetHeader=B_;Kt.inflateSetDictionary=E_;Kt.inflateInfo="pako inflate (from Nodeca project)"});var Pc=ct((AO,Md)=>{"use strict";Md.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var wd=ct((mO,bd)=>{"use strict";function __(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}bd.exports=__});var Sd=ct(ho=>{"use strict";var An=Cd(),fo=xe(),Js=Tc(),ot=Pc(),Uc=Ss(),y_=Cc(),T_=wd(),Id=Object.prototype.toString;function dr(e){if(!(this instanceof dr))return new dr(e);this.options=fo.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new y_,this.strm.avail_out=0;var r=An.inflateInit2(this.strm,t.windowBits);if(r!==ot.Z_OK)throw new Error(Uc[r]);if(this.header=new T_,An.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=Js.string2buf(t.dictionary):Id.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=An.inflateSetDictionary(this.strm,t.dictionary),r!==ot.Z_OK)))throw new Error(Uc[r])}dr.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,o=this.options.dictionary,s,i,a,c,f,h=!1;if(this.ended)return!1;i=t===~~t?t:t===!0?ot.Z_FINISH:ot.Z_NO_FLUSH,typeof e=="string"?r.input=Js.binstring2buf(e):Id.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new fo.Buf8(n),r.next_out=0,r.avail_out=n),s=An.inflate(r,ot.Z_NO_FLUSH),s===ot.Z_NEED_DICT&&o&&(s=An.inflateSetDictionary(this.strm,o)),s===ot.Z_BUF_ERROR&&h===!0&&(s=ot.Z_OK,h=!1),s!==ot.Z_STREAM_END&&s!==ot.Z_OK)return this.onEnd(s),this.ended=!0,!1;r.next_out&&(r.avail_out===0||s===ot.Z_STREAM_END||r.avail_in===0&&(i===ot.Z_FINISH||i===ot.Z_SYNC_FLUSH))&&(this.options.to==="string"?(a=Js.utf8border(r.output,r.next_out),c=r.next_out-a,f=Js.buf2string(r.output,a),r.next_out=c,r.avail_out=n-c,c&&fo.arraySet(r.output,r.output,a,c,0),this.onData(f)):this.onData(fo.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(h=!0)}while((r.avail_in>0||r.avail_out===0)&&s!==ot.Z_STREAM_END);return s===ot.Z_STREAM_END&&(i=ot.Z_FINISH),i===ot.Z_FINISH?(s=An.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===ot.Z_OK):(i===ot.Z_SYNC_FLUSH&&(this.onEnd(ot.Z_OK),r.avail_out=0),!0)};dr.prototype.onData=function(e){this.chunks.push(e)};dr.prototype.onEnd=function(e){e===ot.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=fo.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Hc(e,t){var r=new dr(t);if(r.push(e,!0),r.err)throw r.msg||Uc[r.err];return r.result}function C_(e,t){return t=t||{},t.raw=!0,Hc(e,t)}ho.Inflate=dr;ho.inflate=Hc;ho.inflateRaw=C_;ho.ungzip=Hc});var Dd=ct((gO,Fd)=>{"use strict";var M_=xe().assign,b_=L0(),w_=Sd(),I_=Pc(),Rd={};M_(Rd,b_,w_,I_);Fd.exports=Rd});var Od=ct(()=>{});var lo={};ut(lo,{CesiumIonLoader:()=>rc,TILE3D_TYPE:()=>_t,Tile3DBatchTable:()=>ue,Tile3DFeatureTable:()=>kt,Tile3DSubtreeLoader:()=>Xr,Tile3DWriter:()=>kd,Tiles3DArchive:()=>mn,Tiles3DArchiveFileLoader:()=>vd,Tiles3DLoader:()=>nr,_getIonTilesetMetadata:()=>Ts});xo(lo,xr(gn(),1));async function Ut(e,t,r,n){return n._parse(e,t,r,n)}function J(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var Yt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Yd=Yt.self||Yt.window||Yt.global||{},Zd=Yt.window||Yt.self||Yt.global||{},qd=Yt.global||Yt.self||Yt.window||{},Wd=Yt.document||{};var Et=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var Zc=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),$d=Zc&&parseFloat(Zc[1])||0;function xn(e){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,e)}function Vs(e){return globalThis.loaders?.modules?.[e]||null}function t1(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.3.0-alpha.3"),globalThis._loadersgl_.version}var qc=t1();function Wc(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}var Zt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Q_=Zt.self||Zt.window||Zt.global||{},V_=Zt.window||Zt.self||Zt.global||{},j_=Zt.global||Zt.self||Zt.window||{},K_=Zt.document||{};var Br=typeof process!="object"||String(process)!=="[object process]"||process.browser,Bo=typeof importScripts=="function",X_=typeof window<"u"&&typeof window.orientation<"u",$c=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Y_=$c&&parseFloat($c[1])||0;var js={};async function qt(e,t=null,r={},n=null){return t&&(e=tf(e,t,r,n)),js[e]=js[e]||e1(e),await js[e]}function tf(e,t,r={},n=null){if(!r.useLocalLibraries&&e.startsWith("http"))return e;n=n||e;let o=r.modules||{};return o[n]?o[n]:Br?r.CDN?(Wc(r.CDN.startsWith("http")),`${r.CDN}/${t}@${qc}/dist/libs/${n}`):Bo?`../src/libs/${n}`:`modules/${t}/src/libs/${n}`:`modules/${t}/dist/libs/${n}`}async function e1(e){if(e.endsWith("wasm"))return await n1(e);if(!Br)try{let{requireFromFile:r}=globalThis.loaders||{};return await r?.(e)}catch(r){return console.error(r),null}if(Bo)return importScripts(e);let t=await o1(e);return r1(t,e)}function r1(e,t){if(!Br){let{requireFromString:n}=globalThis.loaders||{};return n?.(e,t)}if(Bo)return eval.call(globalThis,e),null;let r=document.createElement("script");r.id=t;try{r.appendChild(document.createTextNode(e))}catch{r.text=e}return document.body.appendChild(r),null}async function n1(e){let{readFileAsArrayBuffer:t}=globalThis.loaders||{};return Br||!t||e.startsWith("http")?await(await fetch(e)).arrayBuffer():await t(e)}async function o1(e){let{readFileAsText:t}=globalThis.loaders||{};return Br||!t||e.startsWith("http")?await(await fetch(e)).text():await t(e)}function rf(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?ef(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?ef(e,0,t):""}function ef(e,t,r){if(e.byteLength<=t+r)return"";let n=new DataView(e),o="";for(let s=0;s<r;s++)o+=String.fromCharCode(n.getUint8(t+s));return o}function Ks(e){try{return JSON.parse(e)}catch{throw new Error(`Failed to parse JSON from data starting with "${rf(e)}"`)}}function Te(e,t,r){if(r=r||e.byteLength,e.byteLength<r||t.byteLength<r)return!1;let n=new Uint8Array(e),o=new Uint8Array(t);for(let s=0;s<n.length;++s)if(n[s]!==o[s])return!1;return!0}function Er(...e){return nf(e)}function nf(e){let t=e.map(s=>s instanceof ArrayBuffer?new Uint8Array(s):s),r=t.reduce((s,i)=>s+i.byteLength,0),n=new Uint8Array(r),o=0;for(let s of t)n.set(s,o),o+=s.byteLength;return n.buffer}function Je(e,t,r){let n=r!==void 0?new Uint8Array(e).subarray(t,t+r):new Uint8Array(e).subarray(t);return new Uint8Array(n).buffer}function bt(e,t){return J(e>=0),J(t>0),e+(t-1)&~(t-1)}function Xs(e,t,r){let n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{let o=e.byteOffset,s=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,o,s)}return t.set(n,r),r+bt(n.byteLength,4)}function Ys(e,t){let r=e.length,o=Math.ceil(r/t)*t-r,s="";for(let i=0;i<o;++i)s+=" ";return e+s}function _r(e,t,r,n){if(e)for(let o=0;o<n;o++)e.setUint8(t+o,r.charCodeAt(o));return t+n}function Bn(e,t,r,n){if(e)for(let o=0;o<n;o++)e.setUint8(t+o,r[o]);return t+n}function of(e,t,r,n){let o=bt(r.byteLength,n),s=o-r.byteLength;if(e){let i=new Uint8Array(e.buffer,e.byteOffset+t,r.byteLength),a=new Uint8Array(r);i.set(a);for(let c=0;c<s;++c)e.setUint8(t+r.byteLength+c,32)}return t+=o,t}function Eo(e,t,r,n){let s=new TextEncoder().encode(r);return t=of(e,t,s,n),t}async function En(e){let t=[];for await(let r of e)t.push(r);return Er(...t)}function sf(e){return e&&typeof e=="object"&&e.isBuffer}function yr(e){if(sf(e))return e;if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function Tr(e){return t=>new Promise((r,n)=>e(t,(o,s)=>o?n(o):r(s)))}var Cr={};ut(Cr,{dirname:()=>i1,filename:()=>s1,join:()=>a1,resolve:()=>c1});function af(){if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let e=window.location?.pathname;return e?.slice(0,e.lastIndexOf("/")+1)||""}function s1(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function i1(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function a1(...e){let t="/";return e=e.map((r,n)=>(n&&(r=r.replace(new RegExp(`^${t}`),"")),n!==e.length-1&&(r=r.replace(new RegExp(`${t}$`),"")),r)),e.join(t)}function c1(...e){let t=[];for(let s=0;s<e.length;s++)t[s]=e[s];let r="",n=!1,o;for(let s=t.length-1;s>=-1&&!n;s--){let i;s>=0?i=t[s]:(o===void 0&&(o=af()),i=o),i.length!==0&&(r=`${i}/${r}`,n=i.charCodeAt(0)===_n)}return r=f1(r,!n),n?`/${r}`:r.length>0?r:"."}var _n=47,Zs=46;function f1(e,t){let r="",n=-1,o=0,s,i=!1;for(let a=0;a<=e.length;++a){if(a<e.length)s=e.charCodeAt(a);else{if(s===_n)break;s=_n}if(s===_n){if(!(n===a-1||o===1))if(n!==a-1&&o===2){if(r.length<2||!i||r.charCodeAt(r.length-1)!==Zs||r.charCodeAt(r.length-2)!==Zs){if(r.length>2){let c=r.length-1,f=c;for(;f>=0&&r.charCodeAt(f)!==_n;--f);if(f!==c){r=f===-1?"":r.slice(0,f),n=a,o=0,i=!1;continue}}else if(r.length===2||r.length===1){r="",n=a,o=0,i=!1;continue}}t&&(r.length>0?r+="/..":r="..",i=!0)}else{let c=e.slice(n+1,a);r.length>0?r+=`/${c}`:r=c,i=!1}n=a,o=0}else s===Zs&&o!==-1?++o:o=-1}return r}var yn=new Error("Not implemented"),_o=class{handle;size=0;bigsize=0n;url="";constructor(t,r,n){if(globalThis.loaders?.NodeFile)return new globalThis.loaders.NodeFile(t,r,n);throw Et?new Error("Can't instantiate NodeFile in browser."):new Error("Can't instantiate NodeFile. Make sure to import @loaders.gl/polyfills first.")}async read(t,r){throw yn}async write(t,r,n){throw yn}async stat(){throw yn}async truncate(t){throw yn}async append(t){throw yn}async close(){}};var qs=e=>e?.getUint8&&e?.slice&&e?.length;var Tn=class{file;constructor(t,r=!1){this.file=new _o(t,r?"a+":"r")}async truncate(t){await this.file.truncate(t)}async append(t){await this.file.append(t)}async destroy(){await this.file.close()}async getUint8(t){let r=await this.file.read(t,1),n=new Uint8Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getUint16(t){let r=await this.file.read(t,2),n=new Uint16Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getUint32(t){let r=await this.file.read(t,4),n=new Uint32Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getBigUint64(t){let r=await this.file.read(t,8),n=new BigInt64Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async slice(t,r){let n=r-t;if(n>Number.MAX_SAFE_INTEGER)throw new Error("too big slice");let o=Number(n);return await this.file.read(t,o)}get length(){return this.file.bigsize}};var Mr=e=>{if(e>Number.MAX_SAFE_INTEGER)throw new Error("Offset is out of bounds");return Number(e)},ze=class{file;constructor(t){this.file=t}async destroy(){}async getUint8(t){return this.file.getUint8(Mr(t))}async getUint16(t){return this.file.getUint16(Mr(t),!0)}async getUint32(t){return this.file.getUint32(Mr(t),!0)}async getBigUint64(t){return this.file.getBigUint64(Mr(t),!0)}async slice(t,r){return this.file.buffer.slice(Mr(t),Mr(r))}get length(){return BigInt(this.file.byteLength)}};var Yy=1/Math.PI*180,Zy=1/180*Math.PI,h1={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...h1}};var et=globalThis.mathgl.config;function Ws(e,{precision:t=et.precision}={}){return e=l1(e),"".concat(parseFloat(e.toPrecision(t)))}function Wt(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function $s(e,t,r){return d1(e,n=>Math.max(t,Math.min(r,n)))}function yo(e,t,r){let n=et.EPSILON;r&&(et.EPSILON=r);try{if(e===t)return!0;if(Wt(e)&&Wt(t)){if(e.length!==t.length)return!1;for(let o=0;o<e.length;++o)if(!yo(e[o],t[o]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):typeof e=="number"&&typeof t=="number"?Math.abs(e-t)<=et.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{et.EPSILON=n}}function l1(e){return Math.round(e/et.EPSILON)*et.EPSILON}function u1(e){return e.clone?e.clone():new Array(e.length)}function d1(e,t,r){if(Wt(e)){let n=e;r=r||u1(n);for(let o=0;o<r.length&&o<n.length;++o){let s=typeof e=="number"?e:e[o];r[o]=t(s,o,r)}return r}return t(e)}function A1(e){function t(){var r=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(r,Object.getPrototypeOf(this)),r}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}var br=class extends A1(Array){clone(){return new this.constructor().copy(this)}fromArray(t,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=t[n+r];return this.check()}toArray(t=[],r=0){for(let n=0;n<this.ELEMENTS;++n)t[r+n]=this[n];return t}toObject(t){return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:Wt(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(et)}formatString(t){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+Ws(this[n],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(r,"]")}equals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!yo(this[r],t[r]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==t[r])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,r,n){if(n===void 0)return this.lerp(this,t,r);for(let o=0;o<this.ELEMENTS;++o){let s=t[o],i=typeof r=="number"?r:r[o];this[o]=s+n*(i-s)}return this.check()}min(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(t[r],this[r]);return this.check()}max(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(t[r],this[r]);return this.check()}clamp(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),r[n]);return this.check()}add(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(t){if(typeof t=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;else for(let r=0;r<this.ELEMENTS&&r<t.length;++r)this[r]*=t[r];return this.check()}multiplyByScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}check(){if(et.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let t=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)t=t&&Number.isFinite(this[r]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=t;return this.check()}addScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),r);return this.check()}get elements(){return this}};function m1(e,t){if(e.length!==t)return!1;for(let r=0;r<e.length;++r)if(!Number.isFinite(e[r]))return!1;return!0}function rt(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(JSON.stringify(e)));return e}function cf(e,t,r=""){if(et.debug&&!m1(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}function ti(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var wr=class extends br{get x(){return this[0]}set x(t){this[0]=rt(t)}get y(){return this[1]}set y(t){this[1]=rt(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let r=0;r<this.ELEMENTS;++r)t+=this[r]*this[r];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let r=0;for(let n=0;n<this.ELEMENTS;++n){let o=this[n]-t[n];r+=o*o}return rt(r)}dot(t){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*t[n];return rt(r)}normalize(){let t=this.magnitude();if(t!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=t;return this.check()}multiply(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return ti(t>=0&&t<this.ELEMENTS,"index is out of range"),rt(this[t])}setComponent(t,r){return ti(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=r,this.check()}addVectors(t,r){return this.copy(t).add(r)}subVectors(t,r){return this.copy(t).subtract(r)}multiplyVectors(t,r){return this.copy(t).multiply(r)}addScaledVector(t,r){return this.add(new this.constructor(t).multiplyScalar(r))}};var Ir=typeof Float32Array<"u"?Float32Array:Array;var aT=Math.PI/180;function B1(){let e=new Ir(2);return Ir!=Float32Array&&(e[0]=0,e[1]=0),e}function hf(e,t,r){let n=t[0],o=t[1];return e[0]=r[0]*n+r[2]*o,e[1]=r[1]*n+r[3]*o,e}function lf(e,t,r){let n=t[0],o=t[1];return e[0]=r[0]*n+r[2]*o+r[4],e[1]=r[1]*n+r[3]*o+r[5],e}function To(e,t,r){let n=t[0],o=t[1];return e[0]=r[0]*n+r[3]*o+r[6],e[1]=r[1]*n+r[4]*o+r[7],e}function uf(e,t,r){let n=t[0],o=t[1];return e[0]=r[0]*n+r[4]*o+r[12],e[1]=r[1]*n+r[5]*o+r[13],e}var cT=function(){let e=B1();return function(t,r,n,o,s,i){let a,c;for(r||(r=2),n||(n=0),o?c=Math.min(o*r+n,t.length):c=t.length,a=n;a<c;a+=r)e[0]=t[a],e[1]=t[a+1],s(e,e,i),t[a]=e[0],t[a+1]=e[1];return t}}();function df(e,t,r){let n=t[0],o=t[1],s=r[3]*n+r[7]*o||1;return e[0]=(r[0]*n+r[4]*o)/s,e[1]=(r[1]*n+r[5]*o)/s,e}function Af(e,t,r){let n=t[0],o=t[1],s=t[2],i=r[3]*n+r[7]*o+r[11]*s||1;return e[0]=(r[0]*n+r[4]*o+r[8]*s)/i,e[1]=(r[1]*n+r[5]*o+r[9]*s)/i,e[2]=(r[2]*n+r[6]*o+r[10]*s)/i,e}function mf(e,t,r){let n=t[0],o=t[1];return e[0]=r[0]*n+r[2]*o,e[1]=r[1]*n+r[3]*o,e[2]=t[2],e}function pf(e,t,r){let n=t[0],o=t[1],s=t[2];return e[0]=r[0]*n+r[3]*o+r[6]*s,e[1]=r[1]*n+r[4]*o+r[7]*s,e[2]=r[2]*n+r[5]*o+r[8]*s,e[3]=t[3],e}var Qe=class extends wr{constructor(t=0,r=0){super(2),Wt(t)&&arguments.length===1?this.copy(t):(et.debug&&(rt(t),rt(r)),this[0]=t,this[1]=r)}set(t,r){return this[0]=t,this[1]=r,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this.check()}fromObject(t){return et.debug&&(rt(t.x),rt(t.y)),this[0]=t.x,this[1]=t.y,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return uf(this,this,t),this.check()}transformAsVector(t){return df(this,this,t),this.check()}transformByMatrix3(t){return To(this,this,t),this.check()}transformByMatrix2x3(t){return lf(this,this,t),this.check()}transformByMatrix2(t){return hf(this,this,t),this.check()}};function E1(){let e=new Ir(3);return Ir!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function _1(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function gf(e,t,r){let n=t[0],o=t[1],s=t[2],i=r[0],a=r[1],c=r[2];return e[0]=o*c-s*a,e[1]=s*i-n*c,e[2]=n*a-o*i,e}function xf(e,t,r){let n=t[0],o=t[1],s=t[2],i=r[3]*n+r[7]*o+r[11]*s+r[15];return i=i||1,e[0]=(r[0]*n+r[4]*o+r[8]*s+r[12])/i,e[1]=(r[1]*n+r[5]*o+r[9]*s+r[13])/i,e[2]=(r[2]*n+r[6]*o+r[10]*s+r[14])/i,e}function Co(e,t,r){let n=t[0],o=t[1],s=t[2];return e[0]=n*r[0]+o*r[3]+s*r[6],e[1]=n*r[1]+o*r[4]+s*r[7],e[2]=n*r[2]+o*r[5]+s*r[8],e}function Bf(e,t,r){let n=r[0],o=r[1],s=r[2],i=r[3],a=t[0],c=t[1],f=t[2],h=o*f-s*c,u=s*a-n*f,l=n*c-o*a,d=o*l-s*u,A=s*h-n*l,m=n*u-o*h,p=i*2;return h*=p,u*=p,l*=p,d*=2,A*=2,m*=2,e[0]=a+h+d,e[1]=c+u+A,e[2]=f+l+m,e}function Ef(e,t,r,n){let o=[],s=[];return o[0]=t[0]-r[0],o[1]=t[1]-r[1],o[2]=t[2]-r[2],s[0]=o[0],s[1]=o[1]*Math.cos(n)-o[2]*Math.sin(n),s[2]=o[1]*Math.sin(n)+o[2]*Math.cos(n),e[0]=s[0]+r[0],e[1]=s[1]+r[1],e[2]=s[2]+r[2],e}function _f(e,t,r,n){let o=[],s=[];return o[0]=t[0]-r[0],o[1]=t[1]-r[1],o[2]=t[2]-r[2],s[0]=o[2]*Math.sin(n)+o[0]*Math.cos(n),s[1]=o[1],s[2]=o[2]*Math.cos(n)-o[0]*Math.sin(n),e[0]=s[0]+r[0],e[1]=s[1]+r[1],e[2]=s[2]+r[2],e}function yf(e,t,r,n){let o=[],s=[];return o[0]=t[0]-r[0],o[1]=t[1]-r[1],o[2]=t[2]-r[2],s[0]=o[0]*Math.cos(n)-o[1]*Math.sin(n),s[1]=o[0]*Math.sin(n)+o[1]*Math.cos(n),s[2]=o[2],e[0]=s[0]+r[0],e[1]=s[1]+r[1],e[2]=s[2]+r[2],e}function Tf(e,t){let r=e[0],n=e[1],o=e[2],s=t[0],i=t[1],a=t[2],c=Math.sqrt((r*r+n*n+o*o)*(s*s+i*i+a*a)),f=c&&_1(e,t)/c;return Math.acos(Math.min(Math.max(f,-1),1))}var gT=function(){let e=E1();return function(t,r,n,o,s,i){let a,c;for(r||(r=3),n||(n=0),o?c=Math.min(o*r+n,t.length):c=t.length,a=n;a<c;a+=r)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],s(e,e,i),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2];return t}}();var ei=[0,0,0],Mo,fe=class extends wr{static get ZERO(){return Mo||(Mo=new fe(0,0,0),Object.freeze(Mo)),Mo}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&Wt(t)?this.copy(t):(et.debug&&(rt(t),rt(r),rt(n)),this[0]=t,this[1]=r,this[2]=n)}set(t,r,n){return this[0]=t,this[1]=r,this[2]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return et.debug&&(rt(t.x),rt(t.y),rt(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=rt(t)}angle(t){return Tf(this,t)}cross(t){return gf(this,this,t),this.check()}rotateX({radians:t,origin:r=ei}){return Ef(this,this,r,t),this.check()}rotateY({radians:t,origin:r=ei}){return _f(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=ei}){return yf(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return xf(this,this,t),this.check()}transformAsVector(t){return Af(this,this,t),this.check()}transformByMatrix3(t){return Co(this,this,t),this.check()}transformByMatrix2(t){return mf(this,this,t),this.check()}transformByQuaternion(t){return Bf(this,this,t),this.check()}};var bo=class extends br{toString(){let t="[";if(et.printRowMajor){t+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)t+=" ".concat(this[n*this.RANK+r])}else{t+="column-major:";for(let r=0;r<this.ELEMENTS;++r)t+=" ".concat(this[r])}return t+="]",t}getElementIndex(t,r){return r*this.RANK+t}getElement(t,r){return this[r*this.RANK+t]}setElement(t,r,n){return this[r*this.RANK+t]=rt(n),this}getColumn(t,r=new Array(this.RANK).fill(-0)){let n=t*this.RANK;for(let o=0;o<this.RANK;++o)r[o]=this[n+o];return r}setColumn(t,r){let n=t*this.RANK;for(let o=0;o<this.RANK;++o)this[n+o]=r[o];return this}};function Cf(e,t){if(e===t){let r=t[1],n=t[2],o=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=o}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function Mf(e,t){let r=t[0],n=t[1],o=t[2],s=t[3],i=t[4],a=t[5],c=t[6],f=t[7],h=t[8],u=h*i-a*f,l=-h*s+a*c,d=f*s-i*c,A=r*u+n*l+o*d;return A?(A=1/A,e[0]=u*A,e[1]=(-h*n+o*f)*A,e[2]=(a*n-o*i)*A,e[3]=l*A,e[4]=(h*r-o*c)*A,e[5]=(-a*r+o*s)*A,e[6]=d*A,e[7]=(-f*r+n*c)*A,e[8]=(i*r-n*s)*A,e):null}function bf(e){let t=e[0],r=e[1],n=e[2],o=e[3],s=e[4],i=e[5],a=e[6],c=e[7],f=e[8];return t*(f*s-i*c)+r*(-f*o+i*a)+n*(c*o-s*a)}function ri(e,t,r){let n=t[0],o=t[1],s=t[2],i=t[3],a=t[4],c=t[5],f=t[6],h=t[7],u=t[8],l=r[0],d=r[1],A=r[2],m=r[3],p=r[4],E=r[5],y=r[6],C=r[7],M=r[8];return e[0]=l*n+d*i+A*f,e[1]=l*o+d*a+A*h,e[2]=l*s+d*c+A*u,e[3]=m*n+p*i+E*f,e[4]=m*o+p*a+E*h,e[5]=m*s+p*c+E*u,e[6]=y*n+C*i+M*f,e[7]=y*o+C*a+M*h,e[8]=y*s+C*c+M*u,e}function wf(e,t,r){let n=t[0],o=t[1],s=t[2],i=t[3],a=t[4],c=t[5],f=t[6],h=t[7],u=t[8],l=r[0],d=r[1];return e[0]=n,e[1]=o,e[2]=s,e[3]=i,e[4]=a,e[5]=c,e[6]=l*n+d*i+f,e[7]=l*o+d*a+h,e[8]=l*s+d*c+u,e}function If(e,t,r){let n=t[0],o=t[1],s=t[2],i=t[3],a=t[4],c=t[5],f=t[6],h=t[7],u=t[8],l=Math.sin(r),d=Math.cos(r);return e[0]=d*n+l*i,e[1]=d*o+l*a,e[2]=d*s+l*c,e[3]=d*i-l*n,e[4]=d*a-l*o,e[5]=d*c-l*s,e[6]=f,e[7]=h,e[8]=u,e}function ni(e,t,r){let n=r[0],o=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=o*t[3],e[4]=o*t[4],e[5]=o*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function Sf(e,t){let r=t[0],n=t[1],o=t[2],s=t[3],i=r+r,a=n+n,c=o+o,f=r*i,h=n*i,u=n*a,l=o*i,d=o*a,A=o*c,m=s*i,p=s*a,E=s*c;return e[0]=1-u-A,e[3]=h-E,e[6]=l+p,e[1]=h+E,e[4]=1-f-A,e[7]=d-m,e[2]=l-p,e[5]=d+m,e[8]=1-f-u,e}var oi;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"})(oi||(oi={}));var y1=Object.freeze([1,0,0,0,1,0,0,0,1]),he=class extends bo{static get IDENTITY(){return C1()}static get ZERO(){return T1()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return oi}constructor(t,...r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):r.length>0?this.copy([t,...r]):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}identity(){return this.copy(y1)}fromObject(t){return this.check()}fromQuaternion(t){return Sf(this,t),this.check()}set(t,r,n,o,s,i,a,c,f){return this[0]=t,this[1]=r,this[2]=n,this[3]=o,this[4]=s,this[5]=i,this[6]=a,this[7]=c,this[8]=f,this.check()}setRowMajor(t,r,n,o,s,i,a,c,f){return this[0]=t,this[1]=o,this[2]=a,this[3]=r,this[4]=s,this[5]=c,this[6]=n,this[7]=i,this[8]=f,this.check()}determinant(){return bf(this)}transpose(){return Cf(this,this),this.check()}invert(){return Mf(this,this),this.check()}multiplyLeft(t){return ri(this,t,this),this.check()}multiplyRight(t){return ri(this,this,t),this.check()}rotate(t){return If(this,this,t),this.check()}scale(t){return Array.isArray(t)?ni(this,this,t):ni(this,this,[t,t]),this.check()}translate(t){return wf(this,this,t),this.check()}transform(t,r){let n;switch(t.length){case 2:n=To(r||[-0,-0],t,this);break;case 3:n=Co(r||[-0,-0,-0],t,this);break;case 4:n=pf(r||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return cf(n,t.length),n}transformVector(t,r){return this.transform(t,r)}transformVector2(t,r){return this.transform(t,r)}transformVector3(t,r){return this.transform(t,r)}},wo,Io=null;function T1(){return wo||(wo=new he([0,0,0,0,0,0,0,0,0]),Object.freeze(wo)),wo}function C1(){return Io||(Io=new he,Object.freeze(Io)),Io}var Sr;(function(e){e[e.ADD=1]="ADD",e[e.REPLACE=2]="REPLACE"})(Sr||(Sr={}));var Ce;(function(e){e.EMPTY="empty",e.SCENEGRAPH="scenegraph",e.POINTCLOUD="pointcloud",e.MESH="mesh"})(Ce||(Ce={}));var Cn;(function(e){e.I3S="I3S",e.TILES3D="TILES3D"})(Cn||(Cn={}));var le;(function(e){e.GEOMETRIC_ERROR="geometricError",e.MAX_SCREEN_THRESHOLD="maxScreenThreshold"})(le||(le={}));var Rr="4.3.0-alpha.3";var _t={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},cC=Object.keys(_t),Me={BATCHED_MODEL:[98,51,100,109],INSTANCED_MODEL:[105,51,100,109],POINT_CLOUD:[112,110,116,115],COMPOSITE:[99,109,112,116]};function si(e,t,r){J(e instanceof ArrayBuffer);let n=new TextDecoder("utf8"),o=new Uint8Array(e,t,r);return n.decode(o)}function Rf(e,t=0){let r=new DataView(e);return`${String.fromCharCode(r.getUint8(t+0))}${String.fromCharCode(r.getUint8(t+1))}${String.fromCharCode(r.getUint8(t+2))}${String.fromCharCode(r.getUint8(t+3))}`}var Ff="4.3.0-alpha.3";var Df={dataType:null,batchType:null,name:"Draco",id:"draco",module:"draco",version:Ff,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}};function Of(e){switch(e.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}function ii(e){let t=1/0,r=1/0,n=1/0,o=-1/0,s=-1/0,i=-1/0,a=e.POSITION?e.POSITION.value:[],c=a&&a.length;for(let f=0;f<c;f+=3){let h=a[f],u=a[f+1],l=a[f+2];t=h<t?h:t,r=u<r?u:r,n=l<n?l:n,o=h>o?h:o,s=u>s?u:s,i=l>i?l:i}return[[t,r,n],[o,s,i]]}function ai(e,t,r){let n=Of(t.value),o=r||Lf(t);return{name:e,type:{type:"fixed-size-list",listSize:t.size,children:[{name:"value",type:n}]},nullable:!1,metadata:o}}function Lf(e){let t={};return"byteOffset"in e&&(t.byteOffset=e.byteOffset.toString(10)),"byteStride"in e&&(t.byteStride=e.byteStride.toString(10)),"normalized"in e&&(t.normalized=e.normalized.toString()),t}function Nf(e,t,r){let n=Gf(t.metadata),o=[],s=M1(t.attributes);for(let i in e){let a=e[i],c=vf(i,a,s[i]);o.push(c)}if(r){let i=vf("indices",r);o.push(i)}return{fields:o,metadata:n}}function M1(e){let t={};for(let r in e){let n=e[r];t[n.name||"undefined"]=n}return t}function vf(e,t,r){let n=r?Gf(r.metadata):void 0;return ai(e,t,n)}function Gf(e){Object.entries(e);let t={};for(let r in e)t[`${r}.string`]=JSON.stringify(e[r]);return t}var Pf={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},b1={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},w1=4,Mn=class{draco;decoder;metadataQuerier;constructor(t){this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t,r={}){let n=new this.draco.DecoderBuffer;n.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(r);let o=this.decoder.GetEncodedGeometryType(n),s=o===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let i;switch(o){case this.draco.TRIANGULAR_MESH:i=this.decoder.DecodeBufferToMesh(n,s);break;case this.draco.POINT_CLOUD:i=this.decoder.DecodeBufferToPointCloud(n,s);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!i.ok()||!s.ptr){let l=`DRACO decompression failed: ${i.error_msg()}`;throw new Error(l)}let a=this._getDracoLoaderData(s,o,r),c=this._getMeshData(s,a,r),f=ii(c.attributes),h=Nf(c.attributes,a,c.indices);return{loader:"draco",loaderData:a,header:{vertexCount:s.num_points(),boundingBox:f},...c,schema:h}}finally{this.draco.destroy(n),s&&this.draco.destroy(s)}}_getDracoLoaderData(t,r,n){let o=this._getTopLevelMetadata(t),s=this._getDracoAttributes(t,n);return{geometry_type:r,num_attributes:t.num_attributes(),num_points:t.num_points(),num_faces:t instanceof this.draco.Mesh?t.num_faces():0,metadata:o,attributes:s}}_getDracoAttributes(t,r){let n={};for(let o=0;o<t.num_attributes();o++){let s=this.decoder.GetAttribute(t,o),i=this._getAttributeMetadata(t,o);n[s.unique_id()]={unique_id:s.unique_id(),attribute_type:s.attribute_type(),data_type:s.data_type(),num_components:s.num_components(),byte_offset:s.byte_offset(),byte_stride:s.byte_stride(),normalized:s.normalized(),attribute_index:o,metadata:i};let a=this._getQuantizationTransform(s,r);a&&(n[s.unique_id()].quantization_transform=a);let c=this._getOctahedronTransform(s,r);c&&(n[s.unique_id()].octahedron_transform=c)}return n}_getMeshData(t,r,n){let o=this._getMeshAttributes(r,t,n);if(!o.POSITION)throw new Error("DRACO: No position attribute found.");if(t instanceof this.draco.Mesh)switch(n.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:o,indices:{value:this._getTriangleStripIndices(t),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:o,indices:{value:this._getTriangleListIndices(t),size:1}}}return{topology:"point-list",mode:0,attributes:o}}_getMeshAttributes(t,r,n){let o={};for(let s of Object.values(t.attributes)){let i=this._deduceAttributeName(s,n);s.name=i;let a=this._getAttributeValues(r,s);if(a){let{value:c,size:f}=a;o[i]={value:c,size:f,byteOffset:s.byte_offset,byteStride:s.byte_stride,normalized:s.normalized}}}return o}_getTriangleListIndices(t){let n=t.num_faces()*3,o=n*w1,s=this.draco._malloc(o);try{return this.decoder.GetTrianglesUInt32Array(t,o,s),new Uint32Array(this.draco.HEAPF32.buffer,s,n).slice()}finally{this.draco._free(s)}}_getTriangleStripIndices(t){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,r),R1(r)}finally{this.draco.destroy(r)}}_getAttributeValues(t,r){let n=b1[r.data_type];if(!n)return console.warn(`DRACO: Unsupported attribute type ${r.data_type}`),null;let o=r.num_components,i=t.num_points()*o,a=i*n.BYTES_PER_ELEMENT,c=I1(this.draco,n),f,h=this.draco._malloc(a);try{let u=this.decoder.GetAttribute(t,r.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(t,u,c,a,h),f=new n(this.draco.HEAPF32.buffer,h,i).slice()}finally{this.draco._free(h)}return{value:f,size:o}}_deduceAttributeName(t,r){let n=t.unique_id;for(let[i,a]of Object.entries(r.extraAttributes||{}))if(a===n)return i;let o=t.attribute_type;for(let i in Pf)if(this.draco[i]===o)return Pf[i];let s=r.attributeNameEntry||"name";return t.metadata[s]?t.metadata[s].string:`CUSTOM_ATTRIBUTE_${n}`}_getTopLevelMetadata(t){let r=this.decoder.GetMetadata(t);return this._getDracoMetadata(r)}_getAttributeMetadata(t,r){let n=this.decoder.GetAttributeMetadata(t,r);return this._getDracoMetadata(n)}_getDracoMetadata(t){if(!t||!t.ptr)return{};let r={},n=this.metadataQuerier.NumEntries(t);for(let o=0;o<n;o++){let s=this.metadataQuerier.GetEntryName(t,o);r[s]=this._getDracoMetadataField(t,s)}return r}_getDracoMetadataField(t,r){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,r,n);let o=S1(n);return{int:this.metadataQuerier.GetIntEntry(t,r),string:this.metadataQuerier.GetStringEntry(t,r),double:this.metadataQuerier.GetDoubleEntry(t,r),intArray:o}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(t){let{quantizedAttributes:r=[],octahedronAttributes:n=[]}=t,o=[...r,...n];for(let s of o)this.decoder.SkipAttributeTransform(this.draco[s])}_getQuantizationTransform(t,r){let{quantizedAttributes:n=[]}=r,o=t.attribute_type();if(n.map(i=>this.decoder[i]).includes(o)){let i=new this.draco.AttributeQuantizationTransform;try{if(i.InitFromAttribute(t))return{quantization_bits:i.quantization_bits(),range:i.range(),min_values:new Float32Array([1,2,3]).map(a=>i.min_value(a))}}finally{this.draco.destroy(i)}}return null}_getOctahedronTransform(t,r){let{octahedronAttributes:n=[]}=r,o=t.attribute_type();if(n.map(i=>this.decoder[i]).includes(o)){let i=new this.draco.AttributeQuantizationTransform;try{if(i.InitFromAttribute(t))return{quantization_bits:i.quantization_bits()}}finally{this.draco.destroy(i)}}return null}};function I1(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32;default:return e.DT_INVALID}}function S1(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}function R1(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}var F1="1.5.6",D1="1.4.1",ci=`https://www.gstatic.com/draco/versioned/decoders/${F1}`,yt={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},fi={[yt.DECODER]:`${ci}/${yt.DECODER}`,[yt.DECODER_WASM]:`${ci}/${yt.DECODER_WASM}`,[yt.FALLBACK_DECODER]:`${ci}/${yt.FALLBACK_DECODER}`,[yt.ENCODER]:`https://raw.githubusercontent.com/google/draco/${D1}/javascript/${yt.ENCODER}`},hi;async function Uf(e){let t=e.modules||{};return t.draco3d?hi||=t.draco3d.createDecoderModule({}).then(r=>({draco:r})):hi||=O1(e),await hi}async function O1(e){let t,r;switch(e.draco&&e.draco.decoderType){case"js":t=await qt(fi[yt.FALLBACK_DECODER],"draco",e,yt.FALLBACK_DECODER);break;case"wasm":default:[t,r]=await Promise.all([await qt(fi[yt.DECODER],"draco",e,yt.DECODER),await qt(fi[yt.DECODER_WASM],"draco",e,yt.DECODER_WASM)])}return t=t||globalThis.DracoDecoderModule,await L1(t,r)}function L1(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e({...r,onModuleLoaded:o=>n({draco:o})})})}var So={...Df,parse:v1};async function v1(e,t){let{draco:r}=await Uf(t),n=new Mn(r);try{return n.parseSync(e,t?.draco)}finally{n.destroy()}}var N1={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},nt={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},H={...N1,...nt};var li={[nt.DOUBLE]:Float64Array,[nt.FLOAT]:Float32Array,[nt.UNSIGNED_SHORT]:Uint16Array,[nt.UNSIGNED_INT]:Uint32Array,[nt.UNSIGNED_BYTE]:Uint8Array,[nt.BYTE]:Int8Array,[nt.SHORT]:Int16Array,[nt.INT]:Int32Array},G1={DOUBLE:nt.DOUBLE,FLOAT:nt.FLOAT,UNSIGNED_SHORT:nt.UNSIGNED_SHORT,UNSIGNED_INT:nt.UNSIGNED_INT,UNSIGNED_BYTE:nt.UNSIGNED_BYTE,BYTE:nt.BYTE,SHORT:nt.SHORT,INT:nt.INT},ui="Failed to convert GL type",dt=class{static fromTypedArray(t){t=ArrayBuffer.isView(t)?t.constructor:t;for(let r in li)if(li[r]===t)return r;throw new Error(ui)}static fromName(t){let r=G1[t];if(!r)throw new Error(ui);return r}static getArrayType(t){switch(t){case nt.UNSIGNED_SHORT_5_6_5:case nt.UNSIGNED_SHORT_4_4_4_4:case nt.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:let r=li[t];if(!r)throw new Error(ui);return r}}static getByteSize(t){return dt.getArrayType(t).BYTES_PER_ELEMENT}static validate(t){return Boolean(dt.getArrayType(t))}static createTypedArray(t,r,n=0,o){o===void 0&&(o=(r.byteLength-n)/dt.getByteSize(t));let s=dt.getArrayType(t);return new s(r,n,o)}};function Hf(e,t){if(!e)throw new Error(`math.gl assertion failed. ${t}`)}function di(e,t=[0,0,0]){let r=e>>11&31,n=e>>5&63,o=e&31;return t[0]=r<<3,t[1]=n<<2,t[2]=o<<3,t}var zC=1/256;var QC=new Qe,VC=new fe,jC=new Qe,KC=new Qe,XC=new Uint8Array(1);function kf(e,t=255){return $s(e,0,t)/t*2-1}function Jf(e){return e<0?-1:1}function zf(e,t,r,n){if(Hf(n),e<0||e>r||t<0||t>r)throw new Error(`x and y must be unsigned normalized integers between 0 and ${r}`);if(n.x=kf(e,r),n.y=kf(t,r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){let o=n.x;n.x=(1-Math.abs(n.y))*Jf(o),n.y=(1-Math.abs(o))*Jf(n.y)}return n.normalize()}function Ai(e,t,r){return zf(e,t,255,r)}var P1=1/Math.PI*180,U1=1/180*Math.PI,H1={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...H1}};var q=globalThis.mathgl.config;function mi(e,{precision:t=q.precision}={}){return e=k1(e),`${parseFloat(e.toPrecision(t))}`}function $t(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function pi(e){return Qf(e)}function gi(e){return Vf(e)}function Qf(e,t){return jf(e,r=>r*U1,t)}function Vf(e,t){return jf(e,r=>r*P1,t)}function wt(e,t,r){let n=q.EPSILON;r&&(q.EPSILON=r);try{if(e===t)return!0;if($t(e)&&$t(t)){if(e.length!==t.length)return!1;for(let o=0;o<e.length;++o)if(!wt(e[o],t[o]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):typeof e=="number"&&typeof t=="number"?Math.abs(e-t)<=q.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{q.EPSILON=n}}function k1(e){return Math.round(e/q.EPSILON)*q.EPSILON}function J1(e){return e.clone?e.clone():new Array(e.length)}function jf(e,t,r){if($t(e)){let n=e;r=r||J1(n);for(let o=0;o<r.length&&o<n.length;++o){let s=typeof e=="number"?e:e[o];r[o]=t(s,o,r)}return r}return t(e)}var be=class extends Array{clone(){return new this.constructor().copy(this)}fromArray(t,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=t[n+r];return this.check()}toArray(t=[],r=0){for(let n=0;n<this.ELEMENTS;++n)t[r+n]=this[n];return t}toObject(t){return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:$t(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(q)}formatString(t){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+mi(this[n],t);return`${t.printTypes?this.constructor.name:""}[${r}]`}equals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!wt(this[r],t[r]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==t[r])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,r,n){if(n===void 0)return this.lerp(this,t,r);for(let o=0;o<this.ELEMENTS;++o){let s=t[o],i=typeof r=="number"?r:r[o];this[o]=s+n*(i-s)}return this.check()}min(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(t[r],this[r]);return this.check()}max(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(t[r],this[r]);return this.check()}clamp(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),r[n]);return this.check()}add(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(t){if(typeof t=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;else for(let r=0;r<this.ELEMENTS&&r<t.length;++r)this[r]*=t[r];return this.check()}multiplyByScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}check(){if(q.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let t=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)t=t&&Number.isFinite(this[r]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=t;return this.check()}addScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),r);return this.check()}get elements(){return this}};function z1(e,t){if(e.length!==t)return!1;for(let r=0;r<e.length;++r)if(!Number.isFinite(e[r]))return!1;return!0}function z(e){if(!Number.isFinite(e))throw new Error(`Invalid number ${JSON.stringify(e)}`);return e}function we(e,t,r=""){if(q.debug&&!z1(e,t))throw new Error(`math.gl: ${r} some fields set to invalid numbers'`);return e}function ft(e,t){if(!e)throw new Error(`math.gl assertion ${t}`)}var Fr=class extends be{get x(){return this[0]}set x(t){this[0]=z(t)}get y(){return this[1]}set y(t){this[1]=z(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let r=0;r<this.ELEMENTS;++r)t+=this[r]*this[r];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let r=0;for(let n=0;n<this.ELEMENTS;++n){let o=this[n]-t[n];r+=o*o}return z(r)}dot(t){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*t[n];return z(r)}normalize(){let t=this.magnitude();if(t!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=t;return this.check()}multiply(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return ft(t>=0&&t<this.ELEMENTS,"index is out of range"),z(this[t])}setComponent(t,r){return ft(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=r,this.check()}addVectors(t,r){return this.copy(t).add(r)}subVectors(t,r){return this.copy(t).subtract(r)}multiplyVectors(t,r){return this.copy(t).multiply(r)}addScaledVector(t,r){return this.add(new this.constructor(t).multiplyScalar(r))}};var W=typeof Float32Array<"u"?Float32Array:Array,bn=Math.random;function Dr(e){return e>=0?Math.round(e):e%.5===0?Math.floor(e):Math.round(e)}var CM=Math.PI/180;function Q1(){let e=new W(2);return W!=Float32Array&&(e[0]=0,e[1]=0),e}function Kf(e,t,r){let n=t[0],o=t[1];return e[0]=r[0]*n+r[3]*o+r[6],e[1]=r[1]*n+r[4]*o+r[7],e}function Xf(e,t,r){let n=t[0],o=t[1];return e[0]=r[0]*n+r[4]*o+r[12],e[1]=r[1]*n+r[5]*o+r[13],e}var MM=function(){let e=Q1();return function(t,r,n,o,s,i){let a,c;for(r||(r=2),n||(n=0),o?c=Math.min(o*r+n,t.length):c=t.length,a=n;a<c;a+=r)e[0]=t[a],e[1]=t[a+1],s(e,e,i),t[a]=e[0],t[a+1]=e[1];return t}}();function Yf(e,t,r){let n=t[0],o=t[1],s=r[3]*n+r[7]*o||1;return e[0]=(r[0]*n+r[4]*o)/s,e[1]=(r[1]*n+r[5]*o)/s,e}function Ro(e,t,r){let n=t[0],o=t[1],s=t[2],i=r[3]*n+r[7]*o+r[11]*s||1;return e[0]=(r[0]*n+r[4]*o+r[8]*s)/i,e[1]=(r[1]*n+r[5]*o+r[9]*s)/i,e[2]=(r[2]*n+r[6]*o+r[10]*s)/i,e}function Zf(e,t,r){let n=t[0],o=t[1];return e[0]=r[0]*n+r[2]*o,e[1]=r[1]*n+r[3]*o,e[2]=t[2],e}function qf(e,t,r){let n=t[0],o=t[1];return e[0]=r[0]*n+r[2]*o,e[1]=r[1]*n+r[3]*o,e[2]=t[2],e[3]=t[3],e}function Fo(e,t,r){let n=t[0],o=t[1],s=t[2];return e[0]=r[0]*n+r[3]*o+r[6]*s,e[1]=r[1]*n+r[4]*o+r[7]*s,e[2]=r[2]*n+r[5]*o+r[8]*s,e[3]=t[3],e}var Ke={};ut(Ke,{add:()=>X1,angle:()=>yi,bezier:()=>aA,ceil:()=>Y1,clone:()=>V1,copy:()=>j1,create:()=>Do,cross:()=>Ve,dist:()=>pA,distance:()=>rh,div:()=>mA,divide:()=>eh,dot:()=>wn,equals:()=>uA,exactEquals:()=>lA,floor:()=>Z1,forEach:()=>BA,fromValues:()=>Oo,hermite:()=>iA,inverse:()=>nA,len:()=>Ti,length:()=>Wf,lerp:()=>oA,max:()=>W1,min:()=>q1,mul:()=>AA,multiply:()=>th,negate:()=>rA,normalize:()=>xi,random:()=>cA,rotateX:()=>Bi,rotateY:()=>Ei,rotateZ:()=>_i,round:()=>$1,scale:()=>tA,scaleAndAdd:()=>eA,set:()=>K1,slerp:()=>sA,sqrDist:()=>gA,sqrLen:()=>xA,squaredDistance:()=>nh,squaredLength:()=>oh,str:()=>hA,sub:()=>dA,subtract:()=>$f,transformMat3:()=>In,transformMat4:()=>je,transformQuat:()=>Sn,zero:()=>fA});function Do(){let e=new W(3);return W!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function V1(e){let t=new W(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Wf(e){let t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)}function Oo(e,t,r){let n=new W(3);return n[0]=e,n[1]=t,n[2]=r,n}function j1(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function K1(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}function X1(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function $f(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function th(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function eh(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}function Y1(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function Z1(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}function q1(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e}function W1(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e}function $1(e,t){return e[0]=Dr(t[0]),e[1]=Dr(t[1]),e[2]=Dr(t[2]),e}function tA(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function eA(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e}function rh(e,t){let r=t[0]-e[0],n=t[1]-e[1],o=t[2]-e[2];return Math.sqrt(r*r+n*n+o*o)}function nh(e,t){let r=t[0]-e[0],n=t[1]-e[1],o=t[2]-e[2];return r*r+n*n+o*o}function oh(e){let t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}function rA(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function nA(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function xi(e,t){let r=t[0],n=t[1],o=t[2],s=r*r+n*n+o*o;return s>0&&(s=1/Math.sqrt(s)),e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e}function wn(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Ve(e,t,r){let n=t[0],o=t[1],s=t[2],i=r[0],a=r[1],c=r[2];return e[0]=o*c-s*a,e[1]=s*i-n*c,e[2]=n*a-o*i,e}function oA(e,t,r,n){let o=t[0],s=t[1],i=t[2];return e[0]=o+n*(r[0]-o),e[1]=s+n*(r[1]-s),e[2]=i+n*(r[2]-i),e}function sA(e,t,r,n){let o=Math.acos(Math.min(Math.max(wn(t,r),-1),1)),s=Math.sin(o),i=Math.sin((1-n)*o)/s,a=Math.sin(n*o)/s;return e[0]=i*t[0]+a*r[0],e[1]=i*t[1]+a*r[1],e[2]=i*t[2]+a*r[2],e}function iA(e,t,r,n,o,s){let i=s*s,a=i*(2*s-3)+1,c=i*(s-2)+s,f=i*(s-1),h=i*(3-2*s);return e[0]=t[0]*a+r[0]*c+n[0]*f+o[0]*h,e[1]=t[1]*a+r[1]*c+n[1]*f+o[1]*h,e[2]=t[2]*a+r[2]*c+n[2]*f+o[2]*h,e}function aA(e,t,r,n,o,s){let i=1-s,a=i*i,c=s*s,f=a*i,h=3*s*a,u=3*c*i,l=c*s;return e[0]=t[0]*f+r[0]*h+n[0]*u+o[0]*l,e[1]=t[1]*f+r[1]*h+n[1]*u+o[1]*l,e[2]=t[2]*f+r[2]*h+n[2]*u+o[2]*l,e}function cA(e,t){t=t===void 0?1:t;let r=bn()*2*Math.PI,n=bn()*2-1,o=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*o,e[1]=Math.sin(r)*o,e[2]=n*t,e}function je(e,t,r){let n=t[0],o=t[1],s=t[2],i=r[3]*n+r[7]*o+r[11]*s+r[15];return i=i||1,e[0]=(r[0]*n+r[4]*o+r[8]*s+r[12])/i,e[1]=(r[1]*n+r[5]*o+r[9]*s+r[13])/i,e[2]=(r[2]*n+r[6]*o+r[10]*s+r[14])/i,e}function In(e,t,r){let n=t[0],o=t[1],s=t[2];return e[0]=n*r[0]+o*r[3]+s*r[6],e[1]=n*r[1]+o*r[4]+s*r[7],e[2]=n*r[2]+o*r[5]+s*r[8],e}function Sn(e,t,r){let n=r[0],o=r[1],s=r[2],i=r[3],a=t[0],c=t[1],f=t[2],h=o*f-s*c,u=s*a-n*f,l=n*c-o*a,d=o*l-s*u,A=s*h-n*l,m=n*u-o*h,p=i*2;return h*=p,u*=p,l*=p,d*=2,A*=2,m*=2,e[0]=a+h+d,e[1]=c+u+A,e[2]=f+l+m,e}function Bi(e,t,r,n){let o=[],s=[];return o[0]=t[0]-r[0],o[1]=t[1]-r[1],o[2]=t[2]-r[2],s[0]=o[0],s[1]=o[1]*Math.cos(n)-o[2]*Math.sin(n),s[2]=o[1]*Math.sin(n)+o[2]*Math.cos(n),e[0]=s[0]+r[0],e[1]=s[1]+r[1],e[2]=s[2]+r[2],e}function Ei(e,t,r,n){let o=[],s=[];return o[0]=t[0]-r[0],o[1]=t[1]-r[1],o[2]=t[2]-r[2],s[0]=o[2]*Math.sin(n)+o[0]*Math.cos(n),s[1]=o[1],s[2]=o[2]*Math.cos(n)-o[0]*Math.sin(n),e[0]=s[0]+r[0],e[1]=s[1]+r[1],e[2]=s[2]+r[2],e}function _i(e,t,r,n){let o=[],s=[];return o[0]=t[0]-r[0],o[1]=t[1]-r[1],o[2]=t[2]-r[2],s[0]=o[0]*Math.cos(n)-o[1]*Math.sin(n),s[1]=o[0]*Math.sin(n)+o[1]*Math.cos(n),s[2]=o[2],e[0]=s[0]+r[0],e[1]=s[1]+r[1],e[2]=s[2]+r[2],e}function yi(e,t){let r=e[0],n=e[1],o=e[2],s=t[0],i=t[1],a=t[2],c=Math.sqrt((r*r+n*n+o*o)*(s*s+i*i+a*a)),f=c&&wn(e,t)/c;return Math.acos(Math.min(Math.max(f,-1),1))}function fA(e){return e[0]=0,e[1]=0,e[2]=0,e}function hA(e){return`vec3(${e[0]}, ${e[1]}, ${e[2]})`}function lA(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function uA(e,t){let r=e[0],n=e[1],o=e[2],s=t[0],i=t[1],a=t[2];return Math.abs(r-s)<=1e-6*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(o-a)<=1e-6*Math.max(1,Math.abs(o),Math.abs(a))}var dA=$f,AA=th,mA=eh,pA=rh,gA=nh,Ti=Wf,xA=oh,BA=function(){let e=Do();return function(t,r,n,o,s,i){let a,c;for(r||(r=3),n||(n=0),o?c=Math.min(o*r+n,t.length):c=t.length,a=n;a<c;a+=r)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],s(e,e,i),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2];return t}}();var Ci=[0,0,0],Lo,b=class extends Fr{static get ZERO(){return Lo||(Lo=new b(0,0,0),Object.freeze(Lo)),Lo}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&$t(t)?this.copy(t):(q.debug&&(z(t),z(r),z(n)),this[0]=t,this[1]=r,this[2]=n)}set(t,r,n){return this[0]=t,this[1]=r,this[2]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return q.debug&&(z(t.x),z(t.y),z(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=z(t)}angle(t){return yi(this,t)}cross(t){return Ve(this,this,t),this.check()}rotateX({radians:t,origin:r=Ci}){return Bi(this,this,r,t),this.check()}rotateY({radians:t,origin:r=Ci}){return Ei(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=Ci}){return _i(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return je(this,this,t),this.check()}transformAsVector(t){return Ro(this,this,t),this.check()}transformByMatrix3(t){return In(this,this,t),this.check()}transformByMatrix2(t){return Zf(this,this,t),this.check()}transformByQuaternion(t){return Sn(this,this,t),this.check()}};var vo,Lr=class extends Fr{static get ZERO(){return vo||(vo=new Lr(0,0,0,0),Object.freeze(vo)),vo}constructor(t=0,r=0,n=0,o=0){super(-0,-0,-0,-0),$t(t)&&arguments.length===1?this.copy(t):(q.debug&&(z(t),z(r),z(n),z(o)),this[0]=t,this[1]=r,this[2]=n,this[3]=o)}set(t,r,n,o){return this[0]=t,this[1]=r,this[2]=n,this[3]=o,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}fromObject(t){return q.debug&&(z(t.x),z(t.y),z(t.z),z(t.w)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t.w=this[3],t}get ELEMENTS(){return 4}get z(){return this[2]}set z(t){this[2]=z(t)}get w(){return this[3]}set w(t){this[3]=z(t)}transform(t){return je(this,this,t),this.check()}transformByMatrix3(t){return Fo(this,this,t),this.check()}transformByMatrix2(t){return qf(this,this,t),this.check()}transformByQuaternion(t){return Sn(this,this,t),this.check()}applyMatrix4(t){return t.transform(this,this),this}};var vr=class extends be{toString(){let t="[";if(q.printRowMajor){t+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)t+=` ${this[n*this.RANK+r]}`}else{t+="column-major:";for(let r=0;r<this.ELEMENTS;++r)t+=` ${this[r]}`}return t+="]",t}getElementIndex(t,r){return r*this.RANK+t}getElement(t,r){return this[r*this.RANK+t]}setElement(t,r,n){return this[r*this.RANK+t]=z(n),this}getColumn(t,r=new Array(this.RANK).fill(-0)){let n=t*this.RANK;for(let o=0;o<this.RANK;++o)r[o]=this[n+o];return r}setColumn(t,r){let n=t*this.RANK;for(let o=0;o<this.RANK;++o)this[n+o]=r[o];return this}};function sh(){let e=new W(9);return W!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function ih(e,t){if(e===t){let r=t[1],n=t[2],o=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=o}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function ah(e,t){let r=t[0],n=t[1],o=t[2],s=t[3],i=t[4],a=t[5],c=t[6],f=t[7],h=t[8],u=h*i-a*f,l=-h*s+a*c,d=f*s-i*c,A=r*u+n*l+o*d;return A?(A=1/A,e[0]=u*A,e[1]=(-h*n+o*f)*A,e[2]=(a*n-o*i)*A,e[3]=l*A,e[4]=(h*r-o*c)*A,e[5]=(-a*r+o*s)*A,e[6]=d*A,e[7]=(-f*r+n*c)*A,e[8]=(i*r-n*s)*A,e):null}function ch(e){let t=e[0],r=e[1],n=e[2],o=e[3],s=e[4],i=e[5],a=e[6],c=e[7],f=e[8];return t*(f*s-i*c)+r*(-f*o+i*a)+n*(c*o-s*a)}function Mi(e,t,r){let n=t[0],o=t[1],s=t[2],i=t[3],a=t[4],c=t[5],f=t[6],h=t[7],u=t[8],l=r[0],d=r[1],A=r[2],m=r[3],p=r[4],E=r[5],y=r[6],C=r[7],M=r[8];return e[0]=l*n+d*i+A*f,e[1]=l*o+d*a+A*h,e[2]=l*s+d*c+A*u,e[3]=m*n+p*i+E*f,e[4]=m*o+p*a+E*h,e[5]=m*s+p*c+E*u,e[6]=y*n+C*i+M*f,e[7]=y*o+C*a+M*h,e[8]=y*s+C*c+M*u,e}function fh(e,t,r){let n=t[0],o=t[1],s=t[2],i=t[3],a=t[4],c=t[5],f=t[6],h=t[7],u=t[8],l=r[0],d=r[1];return e[0]=n,e[1]=o,e[2]=s,e[3]=i,e[4]=a,e[5]=c,e[6]=l*n+d*i+f,e[7]=l*o+d*a+h,e[8]=l*s+d*c+u,e}function hh(e,t,r){let n=t[0],o=t[1],s=t[2],i=t[3],a=t[4],c=t[5],f=t[6],h=t[7],u=t[8],l=Math.sin(r),d=Math.cos(r);return e[0]=d*n+l*i,e[1]=d*o+l*a,e[2]=d*s+l*c,e[3]=d*i-l*n,e[4]=d*a-l*o,e[5]=d*c-l*s,e[6]=f,e[7]=h,e[8]=u,e}function bi(e,t,r){let n=r[0],o=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=o*t[3],e[4]=o*t[4],e[5]=o*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function lh(e,t){let r=t[0],n=t[1],o=t[2],s=t[3],i=r+r,a=n+n,c=o+o,f=r*i,h=n*i,u=n*a,l=o*i,d=o*a,A=o*c,m=s*i,p=s*a,E=s*c;return e[0]=1-u-A,e[3]=h-E,e[6]=l+p,e[1]=h+E,e[4]=1-f-A,e[7]=d-m,e[2]=l-p,e[5]=d+m,e[8]=1-f-u,e}var wi;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"})(wi||(wi={}));var _A=Object.freeze([1,0,0,0,1,0,0,0,1]),Z=class extends vr{static get IDENTITY(){return TA()}static get ZERO(){return yA()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return wi}constructor(t,...r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):r.length>0?this.copy([t,...r]):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}identity(){return this.copy(_A)}fromObject(t){return this.check()}fromQuaternion(t){return lh(this,t),this.check()}set(t,r,n,o,s,i,a,c,f){return this[0]=t,this[1]=r,this[2]=n,this[3]=o,this[4]=s,this[5]=i,this[6]=a,this[7]=c,this[8]=f,this.check()}setRowMajor(t,r,n,o,s,i,a,c,f){return this[0]=t,this[1]=o,this[2]=a,this[3]=r,this[4]=s,this[5]=c,this[6]=n,this[7]=i,this[8]=f,this.check()}determinant(){return ch(this)}transpose(){return ih(this,this),this.check()}invert(){return ah(this,this),this.check()}multiplyLeft(t){return Mi(this,t,this),this.check()}multiplyRight(t){return Mi(this,this,t),this.check()}rotate(t){return hh(this,this,t),this.check()}scale(t){return Array.isArray(t)?bi(this,this,t):bi(this,this,[t,t]),this.check()}translate(t){return fh(this,this,t),this.check()}transform(t,r){let n;switch(t.length){case 2:n=Kf(r||[-0,-0],t,this);break;case 3:n=In(r||[-0,-0,-0],t,this);break;case 4:n=Fo(r||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return we(n,t.length),n}transformVector(t,r){return this.transform(t,r)}transformVector2(t,r){return this.transform(t,r)}transformVector3(t,r){return this.transform(t,r)}},No,Go=null;function yA(){return No||(No=new Z([0,0,0,0,0,0,0,0,0]),Object.freeze(No)),No}function TA(){return Go||(Go=new Z,Object.freeze(Go)),Go}var Fn={};ut(Fn,{add:()=>XA,adjoint:()=>SA,clone:()=>MA,copy:()=>bA,create:()=>CA,decompose:()=>UA,determinant:()=>Ri,equals:()=>WA,exactEquals:()=>qA,frob:()=>KA,fromQuat:()=>Gi,fromQuat2:()=>NA,fromRotation:()=>DA,fromRotationTranslation:()=>dh,fromRotationTranslationScale:()=>HA,fromRotationTranslationScaleOrigin:()=>kA,fromScaling:()=>FA,fromTranslation:()=>RA,fromValues:()=>wA,fromXRotation:()=>OA,fromYRotation:()=>LA,fromZRotation:()=>vA,frustum:()=>Pi,getRotation:()=>PA,getScaling:()=>Ah,getTranslation:()=>GA,identity:()=>uh,invert:()=>Si,lookAt:()=>ki,mul:()=>$A,multiply:()=>Rn,multiplyScalar:()=>YA,multiplyScalarAndAdd:()=>ZA,ortho:()=>Hi,orthoNO:()=>ph,orthoZO:()=>QA,perspective:()=>Ui,perspectiveFromFieldOfView:()=>zA,perspectiveNO:()=>mh,perspectiveZO:()=>JA,rotate:()=>Oi,rotateX:()=>Li,rotateY:()=>vi,rotateZ:()=>Ni,scale:()=>Di,set:()=>IA,str:()=>jA,sub:()=>tm,subtract:()=>gh,targetTo:()=>VA,translate:()=>Fi,transpose:()=>Ii});function CA(){let e=new W(16);return W!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function MA(e){let t=new W(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function bA(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function wA(e,t,r,n,o,s,i,a,c,f,h,u,l,d,A,m){let p=new W(16);return p[0]=e,p[1]=t,p[2]=r,p[3]=n,p[4]=o,p[5]=s,p[6]=i,p[7]=a,p[8]=c,p[9]=f,p[10]=h,p[11]=u,p[12]=l,p[13]=d,p[14]=A,p[15]=m,p}function IA(e,t,r,n,o,s,i,a,c,f,h,u,l,d,A,m,p){return e[0]=t,e[1]=r,e[2]=n,e[3]=o,e[4]=s,e[5]=i,e[6]=a,e[7]=c,e[8]=f,e[9]=h,e[10]=u,e[11]=l,e[12]=d,e[13]=A,e[14]=m,e[15]=p,e}function uh(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Ii(e,t){if(e===t){let r=t[1],n=t[2],o=t[3],s=t[6],i=t[7],a=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=s,e[11]=t[14],e[12]=o,e[13]=i,e[14]=a}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function Si(e,t){let r=t[0],n=t[1],o=t[2],s=t[3],i=t[4],a=t[5],c=t[6],f=t[7],h=t[8],u=t[9],l=t[10],d=t[11],A=t[12],m=t[13],p=t[14],E=t[15],y=r*a-n*i,C=r*c-o*i,M=r*f-s*i,T=n*c-o*a,I=n*f-s*a,w=o*f-s*c,O=h*m-u*A,x=h*p-l*A,g=h*E-d*A,B=u*p-l*m,_=u*E-d*m,P=l*E-d*p,G=y*P-C*_+M*B+T*g-I*x+w*O;return G?(G=1/G,e[0]=(a*P-c*_+f*B)*G,e[1]=(o*_-n*P-s*B)*G,e[2]=(m*w-p*I+E*T)*G,e[3]=(l*I-u*w-d*T)*G,e[4]=(c*g-i*P-f*x)*G,e[5]=(r*P-o*g+s*x)*G,e[6]=(p*M-A*w-E*C)*G,e[7]=(h*w-l*M+d*C)*G,e[8]=(i*_-a*g+f*O)*G,e[9]=(n*g-r*_-s*O)*G,e[10]=(A*I-m*M+E*y)*G,e[11]=(u*M-h*I-d*y)*G,e[12]=(a*x-i*B-c*O)*G,e[13]=(r*B-n*x+o*O)*G,e[14]=(m*C-A*T-p*y)*G,e[15]=(h*T-u*C+l*y)*G,e):null}function SA(e,t){let r=t[0],n=t[1],o=t[2],s=t[3],i=t[4],a=t[5],c=t[6],f=t[7],h=t[8],u=t[9],l=t[10],d=t[11],A=t[12],m=t[13],p=t[14],E=t[15],y=r*a-n*i,C=r*c-o*i,M=r*f-s*i,T=n*c-o*a,I=n*f-s*a,w=o*f-s*c,O=h*m-u*A,x=h*p-l*A,g=h*E-d*A,B=u*p-l*m,_=u*E-d*m,P=l*E-d*p;return e[0]=a*P-c*_+f*B,e[1]=o*_-n*P-s*B,e[2]=m*w-p*I+E*T,e[3]=l*I-u*w-d*T,e[4]=c*g-i*P-f*x,e[5]=r*P-o*g+s*x,e[6]=p*M-A*w-E*C,e[7]=h*w-l*M+d*C,e[8]=i*_-a*g+f*O,e[9]=n*g-r*_-s*O,e[10]=A*I-m*M+E*y,e[11]=u*M-h*I-d*y,e[12]=a*x-i*B-c*O,e[13]=r*B-n*x+o*O,e[14]=m*C-A*T-p*y,e[15]=h*T-u*C+l*y,e}function Ri(e){let t=e[0],r=e[1],n=e[2],o=e[3],s=e[4],i=e[5],a=e[6],c=e[7],f=e[8],h=e[9],u=e[10],l=e[11],d=e[12],A=e[13],m=e[14],p=e[15],E=t*i-r*s,y=t*a-n*s,C=r*a-n*i,M=f*A-h*d,T=f*m-u*d,I=h*m-u*A,w=t*I-r*T+n*M,O=s*I-i*T+a*M,x=f*C-h*y+u*E,g=d*C-A*y+m*E;return c*w-o*O+p*x-l*g}function Rn(e,t,r){let n=t[0],o=t[1],s=t[2],i=t[3],a=t[4],c=t[5],f=t[6],h=t[7],u=t[8],l=t[9],d=t[10],A=t[11],m=t[12],p=t[13],E=t[14],y=t[15],C=r[0],M=r[1],T=r[2],I=r[3];return e[0]=C*n+M*a+T*u+I*m,e[1]=C*o+M*c+T*l+I*p,e[2]=C*s+M*f+T*d+I*E,e[3]=C*i+M*h+T*A+I*y,C=r[4],M=r[5],T=r[6],I=r[7],e[4]=C*n+M*a+T*u+I*m,e[5]=C*o+M*c+T*l+I*p,e[6]=C*s+M*f+T*d+I*E,e[7]=C*i+M*h+T*A+I*y,C=r[8],M=r[9],T=r[10],I=r[11],e[8]=C*n+M*a+T*u+I*m,e[9]=C*o+M*c+T*l+I*p,e[10]=C*s+M*f+T*d+I*E,e[11]=C*i+M*h+T*A+I*y,C=r[12],M=r[13],T=r[14],I=r[15],e[12]=C*n+M*a+T*u+I*m,e[13]=C*o+M*c+T*l+I*p,e[14]=C*s+M*f+T*d+I*E,e[15]=C*i+M*h+T*A+I*y,e}function Fi(e,t,r){let n=r[0],o=r[1],s=r[2],i,a,c,f,h,u,l,d,A,m,p,E;return t===e?(e[12]=t[0]*n+t[4]*o+t[8]*s+t[12],e[13]=t[1]*n+t[5]*o+t[9]*s+t[13],e[14]=t[2]*n+t[6]*o+t[10]*s+t[14],e[15]=t[3]*n+t[7]*o+t[11]*s+t[15]):(i=t[0],a=t[1],c=t[2],f=t[3],h=t[4],u=t[5],l=t[6],d=t[7],A=t[8],m=t[9],p=t[10],E=t[11],e[0]=i,e[1]=a,e[2]=c,e[3]=f,e[4]=h,e[5]=u,e[6]=l,e[7]=d,e[8]=A,e[9]=m,e[10]=p,e[11]=E,e[12]=i*n+h*o+A*s+t[12],e[13]=a*n+u*o+m*s+t[13],e[14]=c*n+l*o+p*s+t[14],e[15]=f*n+d*o+E*s+t[15]),e}function Di(e,t,r){let n=r[0],o=r[1],s=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*o,e[5]=t[5]*o,e[6]=t[6]*o,e[7]=t[7]*o,e[8]=t[8]*s,e[9]=t[9]*s,e[10]=t[10]*s,e[11]=t[11]*s,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Oi(e,t,r,n){let o=n[0],s=n[1],i=n[2],a=Math.sqrt(o*o+s*s+i*i),c,f,h,u,l,d,A,m,p,E,y,C,M,T,I,w,O,x,g,B,_,P,G,U;return a<1e-6?null:(a=1/a,o*=a,s*=a,i*=a,f=Math.sin(r),c=Math.cos(r),h=1-c,u=t[0],l=t[1],d=t[2],A=t[3],m=t[4],p=t[5],E=t[6],y=t[7],C=t[8],M=t[9],T=t[10],I=t[11],w=o*o*h+c,O=s*o*h+i*f,x=i*o*h-s*f,g=o*s*h-i*f,B=s*s*h+c,_=i*s*h+o*f,P=o*i*h+s*f,G=s*i*h-o*f,U=i*i*h+c,e[0]=u*w+m*O+C*x,e[1]=l*w+p*O+M*x,e[2]=d*w+E*O+T*x,e[3]=A*w+y*O+I*x,e[4]=u*g+m*B+C*_,e[5]=l*g+p*B+M*_,e[6]=d*g+E*B+T*_,e[7]=A*g+y*B+I*_,e[8]=u*P+m*G+C*U,e[9]=l*P+p*G+M*U,e[10]=d*P+E*G+T*U,e[11]=A*P+y*G+I*U,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function Li(e,t,r){let n=Math.sin(r),o=Math.cos(r),s=t[4],i=t[5],a=t[6],c=t[7],f=t[8],h=t[9],u=t[10],l=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=s*o+f*n,e[5]=i*o+h*n,e[6]=a*o+u*n,e[7]=c*o+l*n,e[8]=f*o-s*n,e[9]=h*o-i*n,e[10]=u*o-a*n,e[11]=l*o-c*n,e}function vi(e,t,r){let n=Math.sin(r),o=Math.cos(r),s=t[0],i=t[1],a=t[2],c=t[3],f=t[8],h=t[9],u=t[10],l=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=s*o-f*n,e[1]=i*o-h*n,e[2]=a*o-u*n,e[3]=c*o-l*n,e[8]=s*n+f*o,e[9]=i*n+h*o,e[10]=a*n+u*o,e[11]=c*n+l*o,e}function Ni(e,t,r){let n=Math.sin(r),o=Math.cos(r),s=t[0],i=t[1],a=t[2],c=t[3],f=t[4],h=t[5],u=t[6],l=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=s*o+f*n,e[1]=i*o+h*n,e[2]=a*o+u*n,e[3]=c*o+l*n,e[4]=f*o-s*n,e[5]=h*o-i*n,e[6]=u*o-a*n,e[7]=l*o-c*n,e}function RA(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function FA(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function DA(e,t,r){let n=r[0],o=r[1],s=r[2],i=Math.sqrt(n*n+o*o+s*s),a,c,f;return i<1e-6?null:(i=1/i,n*=i,o*=i,s*=i,c=Math.sin(t),a=Math.cos(t),f=1-a,e[0]=n*n*f+a,e[1]=o*n*f+s*c,e[2]=s*n*f-o*c,e[3]=0,e[4]=n*o*f-s*c,e[5]=o*o*f+a,e[6]=s*o*f+n*c,e[7]=0,e[8]=n*s*f+o*c,e[9]=o*s*f-n*c,e[10]=s*s*f+a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function OA(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function LA(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function vA(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function dh(e,t,r){let n=t[0],o=t[1],s=t[2],i=t[3],a=n+n,c=o+o,f=s+s,h=n*a,u=n*c,l=n*f,d=o*c,A=o*f,m=s*f,p=i*a,E=i*c,y=i*f;return e[0]=1-(d+m),e[1]=u+y,e[2]=l-E,e[3]=0,e[4]=u-y,e[5]=1-(h+m),e[6]=A+p,e[7]=0,e[8]=l+E,e[9]=A-p,e[10]=1-(h+d),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function NA(e,t){let r=new W(3),n=-t[0],o=-t[1],s=-t[2],i=t[3],a=t[4],c=t[5],f=t[6],h=t[7],u=n*n+o*o+s*s+i*i;return u>0?(r[0]=(a*i+h*n+c*s-f*o)*2/u,r[1]=(c*i+h*o+f*n-a*s)*2/u,r[2]=(f*i+h*s+a*o-c*n)*2/u):(r[0]=(a*i+h*n+c*s-f*o)*2,r[1]=(c*i+h*o+f*n-a*s)*2,r[2]=(f*i+h*s+a*o-c*n)*2),dh(e,t,r),e}function GA(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function Ah(e,t){let r=t[0],n=t[1],o=t[2],s=t[4],i=t[5],a=t[6],c=t[8],f=t[9],h=t[10];return e[0]=Math.sqrt(r*r+n*n+o*o),e[1]=Math.sqrt(s*s+i*i+a*a),e[2]=Math.sqrt(c*c+f*f+h*h),e}function PA(e,t){let r=new W(3);Ah(r,t);let n=1/r[0],o=1/r[1],s=1/r[2],i=t[0]*n,a=t[1]*o,c=t[2]*s,f=t[4]*n,h=t[5]*o,u=t[6]*s,l=t[8]*n,d=t[9]*o,A=t[10]*s,m=i+h+A,p=0;return m>0?(p=Math.sqrt(m+1)*2,e[3]=.25*p,e[0]=(u-d)/p,e[1]=(l-c)/p,e[2]=(a-f)/p):i>h&&i>A?(p=Math.sqrt(1+i-h-A)*2,e[3]=(u-d)/p,e[0]=.25*p,e[1]=(a+f)/p,e[2]=(l+c)/p):h>A?(p=Math.sqrt(1+h-i-A)*2,e[3]=(l-c)/p,e[0]=(a+f)/p,e[1]=.25*p,e[2]=(u+d)/p):(p=Math.sqrt(1+A-i-h)*2,e[3]=(a-f)/p,e[0]=(l+c)/p,e[1]=(u+d)/p,e[2]=.25*p),e}function UA(e,t,r,n){t[0]=n[12],t[1]=n[13],t[2]=n[14];let o=n[0],s=n[1],i=n[2],a=n[4],c=n[5],f=n[6],h=n[8],u=n[9],l=n[10];r[0]=Math.sqrt(o*o+s*s+i*i),r[1]=Math.sqrt(a*a+c*c+f*f),r[2]=Math.sqrt(h*h+u*u+l*l);let d=1/r[0],A=1/r[1],m=1/r[2],p=o*d,E=s*A,y=i*m,C=a*d,M=c*A,T=f*m,I=h*d,w=u*A,O=l*m,x=p+M+O,g=0;return x>0?(g=Math.sqrt(x+1)*2,e[3]=.25*g,e[0]=(T-w)/g,e[1]=(I-y)/g,e[2]=(E-C)/g):p>M&&p>O?(g=Math.sqrt(1+p-M-O)*2,e[3]=(T-w)/g,e[0]=.25*g,e[1]=(E+C)/g,e[2]=(I+y)/g):M>O?(g=Math.sqrt(1+M-p-O)*2,e[3]=(I-y)/g,e[0]=(E+C)/g,e[1]=.25*g,e[2]=(T+w)/g):(g=Math.sqrt(1+O-p-M)*2,e[3]=(E-C)/g,e[0]=(I+y)/g,e[1]=(T+w)/g,e[2]=.25*g),e}function HA(e,t,r,n){let o=t[0],s=t[1],i=t[2],a=t[3],c=o+o,f=s+s,h=i+i,u=o*c,l=o*f,d=o*h,A=s*f,m=s*h,p=i*h,E=a*c,y=a*f,C=a*h,M=n[0],T=n[1],I=n[2];return e[0]=(1-(A+p))*M,e[1]=(l+C)*M,e[2]=(d-y)*M,e[3]=0,e[4]=(l-C)*T,e[5]=(1-(u+p))*T,e[6]=(m+E)*T,e[7]=0,e[8]=(d+y)*I,e[9]=(m-E)*I,e[10]=(1-(u+A))*I,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function kA(e,t,r,n,o){let s=t[0],i=t[1],a=t[2],c=t[3],f=s+s,h=i+i,u=a+a,l=s*f,d=s*h,A=s*u,m=i*h,p=i*u,E=a*u,y=c*f,C=c*h,M=c*u,T=n[0],I=n[1],w=n[2],O=o[0],x=o[1],g=o[2],B=(1-(m+E))*T,_=(d+M)*T,P=(A-C)*T,G=(d-M)*I,U=(1-(l+E))*I,v=(p+y)*I,at=(A+C)*w,mt=(p-y)*w,X=(1-(l+m))*w;return e[0]=B,e[1]=_,e[2]=P,e[3]=0,e[4]=G,e[5]=U,e[6]=v,e[7]=0,e[8]=at,e[9]=mt,e[10]=X,e[11]=0,e[12]=r[0]+O-(B*O+G*x+at*g),e[13]=r[1]+x-(_*O+U*x+mt*g),e[14]=r[2]+g-(P*O+v*x+X*g),e[15]=1,e}function Gi(e,t){let r=t[0],n=t[1],o=t[2],s=t[3],i=r+r,a=n+n,c=o+o,f=r*i,h=n*i,u=n*a,l=o*i,d=o*a,A=o*c,m=s*i,p=s*a,E=s*c;return e[0]=1-u-A,e[1]=h+E,e[2]=l-p,e[3]=0,e[4]=h-E,e[5]=1-f-A,e[6]=d+m,e[7]=0,e[8]=l+p,e[9]=d-m,e[10]=1-f-u,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Pi(e,t,r,n,o,s,i){let a=1/(r-t),c=1/(o-n),f=1/(s-i);return e[0]=s*2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s*2*c,e[6]=0,e[7]=0,e[8]=(r+t)*a,e[9]=(o+n)*c,e[10]=(i+s)*f,e[11]=-1,e[12]=0,e[13]=0,e[14]=i*s*2*f,e[15]=0,e}function mh(e,t,r,n,o){let s=1/Math.tan(t/2);if(e[0]=s/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,o!=null&&o!==1/0){let i=1/(n-o);e[10]=(o+n)*i,e[14]=2*o*n*i}else e[10]=-1,e[14]=-2*n;return e}var Ui=mh;function JA(e,t,r,n,o){let s=1/Math.tan(t/2);if(e[0]=s/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,o!=null&&o!==1/0){let i=1/(n-o);e[10]=o*i,e[14]=o*n*i}else e[10]=-1,e[14]=-n;return e}function zA(e,t,r,n){let o=Math.tan(t.upDegrees*Math.PI/180),s=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),a=Math.tan(t.rightDegrees*Math.PI/180),c=2/(i+a),f=2/(o+s);return e[0]=c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=f,e[6]=0,e[7]=0,e[8]=-((i-a)*c*.5),e[9]=(o-s)*f*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e}function ph(e,t,r,n,o,s,i){let a=1/(t-r),c=1/(n-o),f=1/(s-i);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*f,e[11]=0,e[12]=(t+r)*a,e[13]=(o+n)*c,e[14]=(i+s)*f,e[15]=1,e}var Hi=ph;function QA(e,t,r,n,o,s,i){let a=1/(t-r),c=1/(n-o),f=1/(s-i);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=f,e[11]=0,e[12]=(t+r)*a,e[13]=(o+n)*c,e[14]=s*f,e[15]=1,e}function ki(e,t,r,n){let o,s,i,a,c,f,h,u,l,d,A=t[0],m=t[1],p=t[2],E=n[0],y=n[1],C=n[2],M=r[0],T=r[1],I=r[2];return Math.abs(A-M)<1e-6&&Math.abs(m-T)<1e-6&&Math.abs(p-I)<1e-6?uh(e):(u=A-M,l=m-T,d=p-I,o=1/Math.sqrt(u*u+l*l+d*d),u*=o,l*=o,d*=o,s=y*d-C*l,i=C*u-E*d,a=E*l-y*u,o=Math.sqrt(s*s+i*i+a*a),o?(o=1/o,s*=o,i*=o,a*=o):(s=0,i=0,a=0),c=l*a-d*i,f=d*s-u*a,h=u*i-l*s,o=Math.sqrt(c*c+f*f+h*h),o?(o=1/o,c*=o,f*=o,h*=o):(c=0,f=0,h=0),e[0]=s,e[1]=c,e[2]=u,e[3]=0,e[4]=i,e[5]=f,e[6]=l,e[7]=0,e[8]=a,e[9]=h,e[10]=d,e[11]=0,e[12]=-(s*A+i*m+a*p),e[13]=-(c*A+f*m+h*p),e[14]=-(u*A+l*m+d*p),e[15]=1,e)}function VA(e,t,r,n){let o=t[0],s=t[1],i=t[2],a=n[0],c=n[1],f=n[2],h=o-r[0],u=s-r[1],l=i-r[2],d=h*h+u*u+l*l;d>0&&(d=1/Math.sqrt(d),h*=d,u*=d,l*=d);let A=c*l-f*u,m=f*h-a*l,p=a*u-c*h;return d=A*A+m*m+p*p,d>0&&(d=1/Math.sqrt(d),A*=d,m*=d,p*=d),e[0]=A,e[1]=m,e[2]=p,e[3]=0,e[4]=u*p-l*m,e[5]=l*A-h*p,e[6]=h*m-u*A,e[7]=0,e[8]=h,e[9]=u,e[10]=l,e[11]=0,e[12]=o,e[13]=s,e[14]=i,e[15]=1,e}function jA(e){return`mat4(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]}, ${e[4]}, ${e[5]}, ${e[6]}, ${e[7]}, ${e[8]}, ${e[9]}, ${e[10]}, ${e[11]}, ${e[12]}, ${e[13]}, ${e[14]}, ${e[15]})`}function KA(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}function XA(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e[9]=t[9]+r[9],e[10]=t[10]+r[10],e[11]=t[11]+r[11],e[12]=t[12]+r[12],e[13]=t[13]+r[13],e[14]=t[14]+r[14],e[15]=t[15]+r[15],e}function gh(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e}function YA(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12]*r,e[13]=t[13]*r,e[14]=t[14]*r,e[15]=t[15]*r,e}function ZA(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e[6]=t[6]+r[6]*n,e[7]=t[7]+r[7]*n,e[8]=t[8]+r[8]*n,e[9]=t[9]+r[9]*n,e[10]=t[10]+r[10]*n,e[11]=t[11]+r[11]*n,e[12]=t[12]+r[12]*n,e[13]=t[13]+r[13]*n,e[14]=t[14]+r[14]*n,e[15]=t[15]+r[15]*n,e}function qA(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function WA(e,t){let r=e[0],n=e[1],o=e[2],s=e[3],i=e[4],a=e[5],c=e[6],f=e[7],h=e[8],u=e[9],l=e[10],d=e[11],A=e[12],m=e[13],p=e[14],E=e[15],y=t[0],C=t[1],M=t[2],T=t[3],I=t[4],w=t[5],O=t[6],x=t[7],g=t[8],B=t[9],_=t[10],P=t[11],G=t[12],U=t[13],v=t[14],at=t[15];return Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(n-C)<=1e-6*Math.max(1,Math.abs(n),Math.abs(C))&&Math.abs(o-M)<=1e-6*Math.max(1,Math.abs(o),Math.abs(M))&&Math.abs(s-T)<=1e-6*Math.max(1,Math.abs(s),Math.abs(T))&&Math.abs(i-I)<=1e-6*Math.max(1,Math.abs(i),Math.abs(I))&&Math.abs(a-w)<=1e-6*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(c-O)<=1e-6*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(f-x)<=1e-6*Math.max(1,Math.abs(f),Math.abs(x))&&Math.abs(h-g)<=1e-6*Math.max(1,Math.abs(h),Math.abs(g))&&Math.abs(u-B)<=1e-6*Math.max(1,Math.abs(u),Math.abs(B))&&Math.abs(l-_)<=1e-6*Math.max(1,Math.abs(l),Math.abs(_))&&Math.abs(d-P)<=1e-6*Math.max(1,Math.abs(d),Math.abs(P))&&Math.abs(A-G)<=1e-6*Math.max(1,Math.abs(A),Math.abs(G))&&Math.abs(m-U)<=1e-6*Math.max(1,Math.abs(m),Math.abs(U))&&Math.abs(p-v)<=1e-6*Math.max(1,Math.abs(p),Math.abs(v))&&Math.abs(E-at)<=1e-6*Math.max(1,Math.abs(E),Math.abs(at))}var $A=Rn,tm=gh;function em(){let e=new W(4);return W!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function xh(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}function Bh(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function Eh(e){let t=e[0],r=e[1],n=e[2],o=e[3];return Math.sqrt(t*t+r*r+n*n+o*o)}function _h(e){let t=e[0],r=e[1],n=e[2],o=e[3];return t*t+r*r+n*n+o*o}function yh(e,t){let r=t[0],n=t[1],o=t[2],s=t[3],i=r*r+n*n+o*o+s*s;return i>0&&(i=1/Math.sqrt(i)),e[0]=r*i,e[1]=n*i,e[2]=o*i,e[3]=s*i,e}function Th(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function Ch(e,t,r,n){let o=t[0],s=t[1],i=t[2],a=t[3];return e[0]=o+n*(r[0]-o),e[1]=s+n*(r[1]-s),e[2]=i+n*(r[2]-i),e[3]=a+n*(r[3]-a),e}function Mh(e,t,r){let n=t[0],o=t[1],s=t[2],i=t[3];return e[0]=r[0]*n+r[4]*o+r[8]*s+r[12]*i,e[1]=r[1]*n+r[5]*o+r[9]*s+r[13]*i,e[2]=r[2]*n+r[6]*o+r[10]*s+r[14]*i,e[3]=r[3]*n+r[7]*o+r[11]*s+r[15]*i,e}function bh(e,t,r){let n=t[0],o=t[1],s=t[2],i=r[0],a=r[1],c=r[2],f=r[3],h=f*n+a*s-c*o,u=f*o+c*n-i*s,l=f*s+i*o-a*n,d=-i*n-a*o-c*s;return e[0]=h*f+d*-i+u*-c-l*-a,e[1]=u*f+d*-a+l*-i-h*-c,e[2]=l*f+d*-c+h*-a-u*-i,e[3]=t[3],e}var qM=function(){let e=em();return function(t,r,n,o,s,i){let a,c;for(r||(r=4),n||(n=0),o?c=Math.min(o*r+n,t.length):c=t.length,a=n;a<c;a+=r)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],e[3]=t[a+3],s(e,e,i),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2],t[a+3]=e[3];return t}}();var Qi;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL0ROW3=3]="COL0ROW3",e[e.COL1ROW0=4]="COL1ROW0",e[e.COL1ROW1=5]="COL1ROW1",e[e.COL1ROW2=6]="COL1ROW2",e[e.COL1ROW3=7]="COL1ROW3",e[e.COL2ROW0=8]="COL2ROW0",e[e.COL2ROW1=9]="COL2ROW1",e[e.COL2ROW2=10]="COL2ROW2",e[e.COL2ROW3=11]="COL2ROW3",e[e.COL3ROW0=12]="COL3ROW0",e[e.COL3ROW1=13]="COL3ROW1",e[e.COL3ROW2=14]="COL3ROW2",e[e.COL3ROW3=15]="COL3ROW3"})(Qi||(Qi={}));var nm=45*Math.PI/180,om=1,Ji=.1,zi=500,sm=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Rt=class extends vr{static get IDENTITY(){return am()}static get ZERO(){return im()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return Qi}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,r,n,o,s,i,a,c,f,h,u,l,d,A,m,p){return this[0]=t,this[1]=r,this[2]=n,this[3]=o,this[4]=s,this[5]=i,this[6]=a,this[7]=c,this[8]=f,this[9]=h,this[10]=u,this[11]=l,this[12]=d,this[13]=A,this[14]=m,this[15]=p,this.check()}setRowMajor(t,r,n,o,s,i,a,c,f,h,u,l,d,A,m,p){return this[0]=t,this[1]=s,this[2]=f,this[3]=d,this[4]=r,this[5]=i,this[6]=h,this[7]=A,this[8]=n,this[9]=a,this[10]=u,this[11]=m,this[12]=o,this[13]=c,this[14]=l,this[15]=p,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(sm)}fromObject(t){return this.check()}fromQuaternion(t){return Gi(this,t),this.check()}frustum(t){let{left:r,right:n,bottom:o,top:s,near:i=Ji,far:a=zi}=t;return a===1/0?cm(this,r,n,o,s,i):Pi(this,r,n,o,s,i,a),this.check()}lookAt(t){let{eye:r,center:n=[0,0,0],up:o=[0,1,0]}=t;return ki(this,r,n,o),this.check()}ortho(t){let{left:r,right:n,bottom:o,top:s,near:i=Ji,far:a=zi}=t;return Hi(this,r,n,o,s,i,a),this.check()}orthographic(t){let{fovy:r=nm,aspect:n=om,focalDistance:o=1,near:s=Ji,far:i=zi}=t;wh(r);let a=r/2,c=o*Math.tan(a),f=c*n;return this.ortho({left:-f,right:f,bottom:-c,top:c,near:s,far:i})}perspective(t){let{fovy:r=45*Math.PI/180,aspect:n=1,near:o=.1,far:s=500}=t;return wh(r),Ui(this,r,n,o,s),this.check()}determinant(){return Ri(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),o=1/n[0],s=1/n[1],i=1/n[2];return t[0]=this[0]*o,t[1]=this[1]*s,t[2]=this[2]*i,t[3]=0,t[4]=this[4]*o,t[5]=this[5]*s,t[6]=this[6]*i,t[7]=0,t[8]=this[8]*o,t[9]=this[9]*s,t[10]=this[10]*i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),o=1/n[0],s=1/n[1],i=1/n[2];return t[0]=this[0]*o,t[1]=this[1]*s,t[2]=this[2]*i,t[3]=this[4]*o,t[4]=this[5]*s,t[5]=this[6]*i,t[6]=this[8]*o,t[7]=this[9]*s,t[8]=this[10]*i,t}transpose(){return Ii(this,this),this.check()}invert(){return Si(this,this),this.check()}multiplyLeft(t){return Rn(this,t,this),this.check()}multiplyRight(t){return Rn(this,this,t),this.check()}rotateX(t){return Li(this,this,t),this.check()}rotateY(t){return vi(this,this,t),this.check()}rotateZ(t){return Ni(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,r){return Oi(this,this,t,r),this.check()}scale(t){return Di(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return Fi(this,this,t),this.check()}transform(t,r){return t.length===4?(r=Mh(r||[-0,-0,-0,-0],t,this),we(r,4),r):this.transformAsPoint(t,r)}transformAsPoint(t,r){let{length:n}=t,o;switch(n){case 2:o=Xf(r||[-0,-0],t,this);break;case 3:o=je(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return we(o,t.length),o}transformAsVector(t,r){let n;switch(t.length){case 2:n=Yf(r||[-0,-0],t,this);break;case 3:n=Ro(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return we(n,t.length),n}transformPoint(t,r){return this.transformAsPoint(t,r)}transformVector(t,r){return this.transformAsPoint(t,r)}transformDirection(t,r){return this.transformAsVector(t,r)}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,r,n){return this.identity().translate([t,r,n])}},Po,Uo;function im(){return Po||(Po=new Rt([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Po)),Po}function am(){return Uo||(Uo=new Rt,Object.freeze(Uo)),Uo}function wh(e){if(e>Math.PI*2)throw Error("expected radians")}function cm(e,t,r,n,o,s){let i=2*s/(r-t),a=2*s/(o-n),c=(r+t)/(r-t),f=(o+n)/(o-n),h=-1,u=-1,l=-2*s;return e[0]=i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=c,e[9]=f,e[10]=h,e[11]=u,e[12]=0,e[13]=0,e[14]=l,e[15]=0,e}function Ih(){let e=new W(4);return W!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Sh(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function Vi(e,t,r){r=r*.5;let n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e}function ji(e,t,r){let n=t[0],o=t[1],s=t[2],i=t[3],a=r[0],c=r[1],f=r[2],h=r[3];return e[0]=n*h+i*a+o*f-s*c,e[1]=o*h+i*c+s*a-n*f,e[2]=s*h+i*f+n*c-o*a,e[3]=i*h-n*a-o*c-s*f,e}function Rh(e,t,r){r*=.5;let n=t[0],o=t[1],s=t[2],i=t[3],a=Math.sin(r),c=Math.cos(r);return e[0]=n*c+i*a,e[1]=o*c+s*a,e[2]=s*c-o*a,e[3]=i*c-n*a,e}function Fh(e,t,r){r*=.5;let n=t[0],o=t[1],s=t[2],i=t[3],a=Math.sin(r),c=Math.cos(r);return e[0]=n*c-s*a,e[1]=o*c+i*a,e[2]=s*c+n*a,e[3]=i*c-o*a,e}function Dh(e,t,r){r*=.5;let n=t[0],o=t[1],s=t[2],i=t[3],a=Math.sin(r),c=Math.cos(r);return e[0]=n*c+o*a,e[1]=o*c-n*a,e[2]=s*c+i*a,e[3]=i*c-s*a,e}function Oh(e,t){let r=t[0],n=t[1],o=t[2];return e[0]=r,e[1]=n,e[2]=o,e[3]=Math.sqrt(Math.abs(1-r*r-n*n-o*o)),e}function Dn(e,t,r,n){let o=t[0],s=t[1],i=t[2],a=t[3],c=r[0],f=r[1],h=r[2],u=r[3],l,d,A,m,p;return l=o*c+s*f+i*h+a*u,l<0&&(l=-l,c=-c,f=-f,h=-h,u=-u),1-l>1e-6?(d=Math.acos(l),p=Math.sin(d),A=Math.sin((1-n)*d)/p,m=Math.sin(n*d)/p):(A=1-n,m=n),e[0]=A*o+m*c,e[1]=A*s+m*f,e[2]=A*i+m*h,e[3]=A*a+m*u,e}function Lh(e,t){let r=t[0],n=t[1],o=t[2],s=t[3],i=r*r+n*n+o*o+s*s,a=i?1/i:0;return e[0]=-r*a,e[1]=-n*a,e[2]=-o*a,e[3]=s*a,e}function vh(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function Ki(e,t){let r=t[0]+t[4]+t[8],n;if(r>0)n=Math.sqrt(r+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{let o=0;t[4]>t[0]&&(o=1),t[8]>t[o*3+o]&&(o=2);let s=(o+1)%3,i=(o+2)%3;n=Math.sqrt(t[o*3+o]-t[s*3+s]-t[i*3+i]+1),e[o]=.5*n,n=.5/n,e[3]=(t[s*3+i]-t[i*3+s])*n,e[s]=(t[s*3+o]+t[o*3+s])*n,e[i]=(t[i*3+o]+t[o*3+i])*n}return e}var Nh=xh;var Gh=Bh,Ph=Th,Uh=Ch,Hh=Eh;var kh=_h;var Jh=yh;var zh=function(){let e=Do(),t=Oo(1,0,0),r=Oo(0,1,0);return function(n,o,s){let i=wn(o,s);return i<-.999999?(Ve(e,t,o),Ti(e)<1e-6&&Ve(e,r,o),xi(e,e),Vi(n,e,Math.PI),n):i>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Ve(e,o,s),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=1+i,Jh(n,n))}}(),lb=function(){let e=Ih(),t=Ih();return function(r,n,o,s,i,a){return Dn(e,n,i,a),Dn(t,o,s,a),Dn(r,e,t,2*a*(1-a)),r}}(),ub=function(){let e=sh();return function(t,r,n,o){return e[0]=n[0],e[3]=n[1],e[6]=n[2],e[1]=o[0],e[4]=o[1],e[7]=o[2],e[2]=-r[0],e[5]=-r[1],e[8]=-r[2],Jh(t,Ki(t,e))}}();var fm=[0,0,0,1],Ie=class extends be{constructor(t=0,r=0,n=0,o=1){super(-0,-0,-0,-0),Array.isArray(t)&&arguments.length===1?this.copy(t):this.set(t,r,n,o)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}set(t,r,n,o){return this[0]=t,this[1]=r,this[2]=n,this[3]=o,this.check()}fromObject(t){return this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this.check()}fromMatrix3(t){return Ki(this,t),this.check()}fromAxisRotation(t,r){return Vi(this,t,r),this.check()}identity(){return Sh(this),this.check()}setAxisAngle(t,r){return this.fromAxisRotation(t,r)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=z(t)}get y(){return this[1]}set y(t){this[1]=z(t)}get z(){return this[2]}set z(t){this[2]=z(t)}get w(){return this[3]}set w(t){this[3]=z(t)}len(){return Hh(this)}lengthSquared(){return kh(this)}dot(t){return Ph(this,t)}rotationTo(t,r){return zh(this,t,r),this.check()}add(t){return Nh(this,this,t),this.check()}calculateW(){return Oh(this,this),this.check()}conjugate(){return vh(this,this),this.check()}invert(){return Lh(this,this),this.check()}lerp(t,r,n){return n===void 0?this.lerp(this,t,r):(Uh(this,t,r,n),this.check())}multiplyRight(t){return ji(this,this,t),this.check()}multiplyLeft(t){return ji(this,t,this),this.check()}normalize(){let t=this.len(),r=t>0?1/t:0;return this[0]=this[0]*r,this[1]=this[1]*r,this[2]=this[2]*r,this[3]=this[3]*r,t===0&&(this[3]=1),this.check()}rotateX(t){return Rh(this,this,t),this.check()}rotateY(t){return Fh(this,this,t),this.check()}rotateZ(t){return Dh(this,this,t),this.check()}scale(t){return Gh(this,this,t),this.check()}slerp(t,r,n){let o,s,i;switch(arguments.length){case 1:({start:o=fm,target:s,ratio:i}=t);break;case 2:o=this,s=t,i=r;break;default:o=t,s=r,i=n}return Dn(this,o,s,i),this.check()}transformVector4(t,r=new Lr){return bh(r,t,this),we(r,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,r){return this.setAxisAngle(t,r)}premultiply(t){return this.multiplyLeft(t)}multiply(t){return this.multiplyRight(t)}};var Ht={};ut(Ht,{EPSILON1:()=>hm,EPSILON10:()=>Bm,EPSILON11:()=>Em,EPSILON12:()=>_m,EPSILON13:()=>ym,EPSILON14:()=>Tm,EPSILON15:()=>Cm,EPSILON16:()=>Mm,EPSILON17:()=>bm,EPSILON18:()=>wm,EPSILON19:()=>Im,EPSILON2:()=>lm,EPSILON20:()=>Sm,EPSILON3:()=>um,EPSILON4:()=>dm,EPSILON5:()=>Am,EPSILON6:()=>mm,EPSILON7:()=>pm,EPSILON8:()=>gm,EPSILON9:()=>xm,PI_OVER_FOUR:()=>Fm,PI_OVER_SIX:()=>Dm,PI_OVER_TWO:()=>Rm,TWO_PI:()=>Om});var hm=.1,lm=.01,um=.001,dm=1e-4,Am=1e-5,mm=1e-6,pm=1e-7,gm=1e-8,xm=1e-9,Bm=1e-10,Em=1e-11,_m=1e-12,ym=1e-13,Tm=1e-14,Cm=1e-15,Mm=1e-16,bm=1e-17,wm=1e-18,Im=1e-19,Sm=1e-20,Rm=Math.PI/2,Fm=Math.PI/4,Dm=Math.PI/6,Om=Math.PI*2;var kt=class{json;buffer;featuresLength=0;_cachedTypedArrays={};constructor(t,r){this.json=t,this.buffer=r}getExtension(t){return this.json.extensions&&this.json.extensions[t]}hasProperty(t){return Boolean(this.json[t])}getGlobalProperty(t,r=H.UNSIGNED_INT,n=1){let o=this.json[t];return o&&Number.isFinite(o.byteOffset)?this._getTypedArrayFromBinary(t,r,n,1,o.byteOffset):o}getPropertyArray(t,r,n){let o=this.json[t];return o&&Number.isFinite(o.byteOffset)?("componentType"in o&&(r=dt.fromName(o.componentType)),this._getTypedArrayFromBinary(t,r,n,this.featuresLength,o.byteOffset)):this._getTypedArrayFromArray(t,r,o)}getProperty(t,r,n,o,s){let i=this.json[t];if(!i)return i;let a=this.getPropertyArray(t,r,n);if(n===1)return a[o];for(let c=0;c<n;++c)s[c]=a[n*o+c];return s}_getTypedArrayFromBinary(t,r,n,o,s){let i=this._cachedTypedArrays,a=i[t];return a||(a=dt.createTypedArray(r,this.buffer.buffer,this.buffer.byteOffset+s,o*n),i[t]=a),a}_getTypedArrayFromArray(t,r,n){let o=this._cachedTypedArrays,s=o[t];return s||(s=dt.createTypedArray(r,n),o[t]=s),s}};var Lm={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},vm={SCALAR:(e,t)=>e[t],VEC2:(e,t)=>[e[2*t+0],e[2*t+1]],VEC3:(e,t)=>[e[3*t+0],e[3*t+1],e[3*t+2]],VEC4:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT2:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT3:(e,t)=>[e[9*t+0],e[9*t+1],e[9*t+2],e[9*t+3],e[9*t+4],e[9*t+5],e[9*t+6],e[9*t+7],e[9*t+8]],MAT4:(e,t)=>[e[16*t+0],e[16*t+1],e[16*t+2],e[16*t+3],e[16*t+4],e[16*t+5],e[16*t+6],e[16*t+7],e[16*t+8],e[16*t+9],e[16*t+10],e[16*t+11],e[16*t+12],e[16*t+13],e[16*t+14],e[16*t+15]]},Nm={SCALAR:(e,t,r)=>{t[r]=e},VEC2:(e,t,r)=>{t[2*r+0]=e[0],t[2*r+1]=e[1]},VEC3:(e,t,r)=>{t[3*r+0]=e[0],t[3*r+1]=e[1],t[3*r+2]=e[2]},VEC4:(e,t,r)=>{t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT2:(e,t,r)=>{t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT3:(e,t,r)=>{t[9*r+0]=e[0],t[9*r+1]=e[1],t[9*r+2]=e[2],t[9*r+3]=e[3],t[9*r+4]=e[4],t[9*r+5]=e[5],t[9*r+6]=e[6],t[9*r+7]=e[7],t[9*r+8]=e[8],t[9*r+9]=e[9]},MAT4:(e,t,r)=>{t[16*r+0]=e[0],t[16*r+1]=e[1],t[16*r+2]=e[2],t[16*r+3]=e[3],t[16*r+4]=e[4],t[16*r+5]=e[5],t[16*r+6]=e[6],t[16*r+7]=e[7],t[16*r+8]=e[8],t[16*r+9]=e[9],t[16*r+10]=e[10],t[16*r+11]=e[11],t[16*r+12]=e[12],t[16*r+13]=e[13],t[16*r+14]=e[14],t[16*r+15]=e[15]}};function Qh(e,t,r,n){let{componentType:o}=e;J(e.componentType);let s=typeof o=="string"?dt.fromName(o):o,i=Lm[e.type],a=vm[e.type],c=Nm[e.type];return r+=e.byteOffset,{values:dt.createTypedArray(s,t,r,i*n),type:s,size:i,unpacker:a,packer:c}}var te=e=>e!==void 0;function Vh(e,t,r){if(!t)return null;let n=e.getExtension("3DTILES_batch_table_hierarchy"),o=t.HIERARCHY;return o&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),t.extensions=t.extensions||{},t.extensions["3DTILES_batch_table_hierarchy"]=o,n=o),n?Gm(n,r):null}function Gm(e,t){let r,n,o,s=e.instancesLength,i=e.classes,a=e.classIds,c=e.parentCounts,f=e.parentIds,h=s;te(a.byteOffset)&&(a.componentType=defaultValue(a.componentType,GL.UNSIGNED_SHORT),a.type=AttributeType.SCALAR,o=getBinaryAccessor(a),a=o.createArrayBufferView(t.buffer,t.byteOffset+a.byteOffset,s));let u;if(te(c))for(te(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,o=getBinaryAccessor(c),c=o.createArrayBufferView(t.buffer,t.byteOffset+c.byteOffset,s)),u=new Uint16Array(s),h=0,r=0;r<s;++r)u[r]=h,h+=c[r];te(f)&&te(f.byteOffset)&&(f.componentType=defaultValue(f.componentType,GL.UNSIGNED_SHORT),f.type=AttributeType.SCALAR,o=getBinaryAccessor(f),f=o.createArrayBufferView(t.buffer,t.byteOffset+f.byteOffset,h));let l=i.length;for(r=0;r<l;++r){let p=i[r].length,E=i[r].instances,y=getBinaryProperties(p,E,t);i[r].instances=combine(y,E)}let d=new Array(l).fill(0),A=new Uint16Array(s);for(r=0;r<s;++r)n=a[r],A[r]=d[n],++d[n];let m={classes:i,classIds:a,classIndexes:A,parentCounts:c,parentIndexes:u,parentIds:f};return Hm(m),m}function Nr(e,t,r){if(!e)return;let n=e.parentCounts;return e.parentIds?r(e,t):n>0?Pm(e,t,r):Um(e,t,r)}function Pm(e,t,r){let n=e.classIds,o=e.parentCounts,s=e.parentIds,i=e.parentIndexes,a=n.length,c=scratchVisited;c.length=Math.max(c.length,a);let f=++marker,h=scratchStack;for(h.length=0,h.push(t);h.length>0;){if(t=h.pop(),c[t]===f)continue;c[t]=f;let u=r(e,t);if(te(u))return u;let l=o[t],d=i[t];for(let A=0;A<l;++A){let m=s[d+A];m!==t&&h.push(m)}}return null}function Um(e,t,r){let n=!0;for(;n;){let o=r(e,t);if(te(o))return o;let s=e.parentIds[t];n=s!==t,t=s}throw new Error("traverseHierarchySingleParent")}function Hm(e){let t=[],n=e.classIds.length;for(let o=0;o<n;++o)jh(e,o,stack)}function jh(e,t,r){let n=e.parentCounts,o=e.parentIds,s=e.parentIndexes,a=e.classIds.length;if(!te(o))return;assert(t<a,`Parent index ${t} exceeds the total number of instances: ${a}`),assert(r.indexOf(t)===-1,"Circular dependency detected in the batch table hierarchy."),r.push(t);let c=te(n)?n[t]:1,f=te(n)?s[t]:t;for(let h=0;h<c;++h){let u=o[f+h];u!==t&&jh(e,u,r)}r.pop(t)}function Tt(e){return e!=null}var Ho=(e,t)=>e,km={HIERARCHY:!0,extensions:!0,extras:!0},ue=class{json;binary;featureCount;_extensions;_properties;_binaryProperties;_hierarchy;constructor(t,r,n,o={}){J(n>=0),this.json=t||{},this.binary=r,this.featureCount=n,this._extensions=this.json?.extensions||{},this._properties={};for(let s in this.json)km[s]||(this._properties[s]=this.json[s]);this._binaryProperties=this._initializeBinaryProperties(),o["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=Vh(this,this.json,this.binary))}getExtension(t){return this.json&&this.json.extensions&&this.json.extensions[t]}memorySizeInBytes(){return 0}isClass(t,r){if(this._checkBatchId(t),J(typeof r=="string",r),this._hierarchy){let n=Nr(this._hierarchy,t,(o,s)=>{let i=o.classIds[s];return o.classes[i].name===r});return Tt(n)}return!1}isExactClass(t,r){return J(typeof r=="string",r),this.getExactClassName(t)===r}getExactClassName(t){if(this._checkBatchId(t),this._hierarchy){let r=this._hierarchy.classIds[t];return this._hierarchy.classes[r].name}}hasProperty(t,r){return this._checkBatchId(t),J(typeof r=="string",r),Tt(this._properties[r])||this._hasPropertyInHierarchy(t,r)}getPropertyNames(t,r){this._checkBatchId(t),r=Tt(r)?r:[],r.length=0;let n=Object.keys(this._properties);return r.push(...n),this._hierarchy&&this._getPropertyNamesInHierarchy(t,r),r}getProperty(t,r){if(this._checkBatchId(t),J(typeof r=="string",r),this._binaryProperties){let o=this._binaryProperties[r];if(Tt(o))return this._getBinaryProperty(o,t)}let n=this._properties[r];if(Tt(n))return Ho(n[t],!0);if(this._hierarchy){let o=this._getHierarchyProperty(t,r);if(Tt(o))return o}}setProperty(t,r,n){let o=this.featureCount;if(this._checkBatchId(t),J(typeof r=="string",r),this._binaryProperties){let i=this._binaryProperties[r];if(i){this._setBinaryProperty(i,t,n);return}}if(this._hierarchy&&this._setHierarchyProperty(this,t,r,n))return;let s=this._properties[r];Tt(s)||(this._properties[r]=new Array(o),s=this._properties[r]),s[t]=Ho(n,!0)}_checkBatchId(t){if(!(t>=0&&t<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(t,r){return t.unpack(t.typedArray,r)}_setBinaryProperty(t,r,n){t.pack(n,t.typedArray,r)}_initializeBinaryProperties(){let t=null;for(let r in this._properties){let n=this._properties[r],o=this._initializeBinaryProperty(r,n);o&&(t=t||{},t[r]=o)}return t}_initializeBinaryProperty(t,r){if("byteOffset"in r){let n=r;J(this.binary,`Property ${t} requires a batch table binary.`),J(n.type,`Property ${t} requires a type.`);let o=Qh(n,this.binary.buffer,this.binary.byteOffset|0,this.featureCount);return{typedArray:o.values,componentCount:o.size,unpack:o.unpacker,pack:o.packer}}return null}_hasPropertyInHierarchy(t,r){if(!this._hierarchy)return!1;let n=Nr(this._hierarchy,t,(o,s)=>{let i=o.classIds[s],a=o.classes[i].instances;return Tt(a[r])});return Tt(n)}_getPropertyNamesInHierarchy(t,r){Nr(this._hierarchy,t,(n,o)=>{let s=n.classIds[o],i=n.classes[s].instances;for(let a in i)i.hasOwnProperty(a)&&r.indexOf(a)===-1&&r.push(a)})}_getHierarchyProperty(t,r){return Nr(this._hierarchy,t,(n,o)=>{let s=n.classIds[o],i=n.classes[s],a=n.classIndexes[o],c=i.instances[r];return Tt(c)?Tt(c.typedArray)?this._getBinaryProperty(c,a):Ho(c[a],!0):null})}_setHierarchyProperty(t,r,n,o){let s=Nr(this._hierarchy,r,(i,a)=>{let c=i.classIds[a],f=i.classes[c],h=i.classIndexes[a],u=f.instances[n];return Tt(u)?(J(a===r,`Inherited property "${n}" is read-only.`),Tt(u.typedArray)?this._setBinaryProperty(u,h,o):u[h]=Ho(o,!0),!0):!1});return Tt(s)}};function Se(e,t,r=0){let n=new DataView(t);if(e.magic=n.getUint32(r,!0),r+=4,e.version=n.getUint32(r,!0),r+=4,e.byteLength=n.getUint32(r,!0),r+=4,e.version!==1)throw new Error(`3D Tile Version ${e.version} not supported`);return r}var Gr=4,Kh="b3dm tile in legacy format.";function Pr(e,t,r){let n=new DataView(t),o;e.header=e.header||{};let s=n.getUint32(r,!0);r+=Gr;let i=n.getUint32(r,!0);r+=Gr;let a=n.getUint32(r,!0);r+=Gr;let c=n.getUint32(r,!0);return r+=Gr,a>=570425344?(r-=Gr*2,o=s,a=i,c=0,s=0,i=0,console.warn(Kh)):c>=570425344&&(r-=Gr,o=a,a=s,c=i,s=0,i=0,console.warn(Kh)),e.header.featureTableJsonByteLength=s,e.header.featureTableBinaryByteLength=i,e.header.batchTableJsonByteLength=a,e.header.batchTableBinaryByteLength=c,e.header.batchLength=o,r}function Ur(e,t,r,n){return r=Jm(e,t,r,n),r=zm(e,t,r,n),r}function Jm(e,t,r,n){let{featureTableJsonByteLength:o,featureTableBinaryByteLength:s,batchLength:i}=e.header||{};if(e.featureTableJson={BATCH_LENGTH:i||0},o&&o>0){let a=si(t,r,o);e.featureTableJson=JSON.parse(a)}return r+=o||0,e.featureTableBinary=new Uint8Array(t,r,s),r+=s||0,r}function zm(e,t,r,n){let{batchTableJsonByteLength:o,batchTableBinaryByteLength:s}=e.header||{};if(o&&o>0){let i=si(t,r,o);e.batchTableJson=JSON.parse(i),r+=o,s&&s>0&&(e.batchTableBinary=new Uint8Array(t,r,s),e.batchTableBinary=new Uint8Array(e.batchTableBinary),r+=s)}return r}function Xi(e,t,r){if(!t&&(!e||!e.batchIds||!r))return null;let{batchIds:n,isRGB565:o,pointCount:s=0}=e;if(n&&r){let i=new Uint8ClampedArray(s*3);for(let a=0;a<s;a++){let c=n[a],h=r.getProperty(c,"dimensions").map(u=>u*255);i[a*3]=h[0],i[a*3+1]=h[1],i[a*3+2]=h[2]}return{type:H.UNSIGNED_BYTE,value:i,size:3,normalized:!0}}if(t&&o){let i=new Uint8ClampedArray(s*3);for(let a=0;a<s;a++){let c=di(t[a]);i[a*3]=c[0],i[a*3+1]=c[1],i[a*3+2]=c[2]}return{type:H.UNSIGNED_BYTE,value:i,size:3,normalized:!0}}return t&&t.length===s*3?{type:H.UNSIGNED_BYTE,value:t,size:3,normalized:!0}:{type:H.UNSIGNED_BYTE,value:t||new Uint8ClampedArray,size:4,normalized:!0}}var Xh=new b;function Yh(e,t){if(!t)return null;if(e.isOctEncoded16P){let r=new Float32Array((e.pointsLength||0)*3);for(let n=0;n<(e.pointsLength||0);n++)Ai(t[n*2],t[n*2+1],Xh),Xh.toArray(r,n*3);return{type:H.FLOAT,size:2,value:r}}return{type:H.FLOAT,size:2,value:t}}function Zh(e,t,r){return e.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,Qm(e,t)):{type:H.UNSIGNED_SHORT,value:t,size:3,normalized:!0}:t}function Qm(e,t){let r=new b,n=new Float32Array(e.pointCount*3);for(let o=0;o<e.pointCount;o++)r.set(t[o*3],t[o*3+1],t[o*3+2]).scale(1/e.quantizedRange).multiply(e.quantizedVolumeScale).add(e.quantizedVolumeOffset).toArray(n,o*3);return n}async function qh(e,t,r,n,o){r=Se(e,t,r),r=Pr(e,t,r),r=Ur(e,t,r,n),Vm(e);let{featureTable:s,batchTable:i}=jm(e);return await qm(e,s,i,n,o),Km(e,s,n),Xm(e,s,i),Ym(e,s),r}function Vm(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}function jm(e){let t=new kt(e.featureTableJson,e.featureTableBinary),r=t.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(r))throw new Error("POINTS_LENGTH must be defined");t.featuresLength=r,e.featuresLength=r,e.pointsLength=r,e.pointCount=r,e.rtcCenter=t.getGlobalProperty("RTC_CENTER",H.FLOAT,3);let n=Zm(e,t);return{featureTable:t,batchTable:n}}function Km(e,t,r){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.positions){if(t.hasProperty("POSITION"))e.attributes.positions=t.getPropertyArray("POSITION",H.FLOAT,3);else if(t.hasProperty("POSITION_QUANTIZED")){let n=t.getPropertyArray("POSITION_QUANTIZED",H.UNSIGNED_SHORT,3);if(e.isQuantized=!0,e.quantizedRange=(1<<16)-1,e.quantizedVolumeScale=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",H.FLOAT,3),!e.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(e.quantizedVolumeOffset=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",H.FLOAT,3),!e.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e.attributes.positions=Zh(e,n,r)}}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function Xm(e,t,r){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.colors){let n=null;t.hasProperty("RGBA")?(n=t.getPropertyArray("RGBA",H.UNSIGNED_BYTE,4),e.isTranslucent=!0):t.hasProperty("RGB")?n=t.getPropertyArray("RGB",H.UNSIGNED_BYTE,3):t.hasProperty("RGB565")&&(n=t.getPropertyArray("RGB565",H.UNSIGNED_SHORT,1),e.isRGB565=!0),e.attributes.colors=Xi(e,n,r)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",H.UNSIGNED_BYTE,4))}function Ym(e,t){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.normals){let r=null;t.hasProperty("NORMAL")?r=t.getPropertyArray("NORMAL",H.FLOAT,3):t.hasProperty("NORMAL_OCT16P")&&(r=t.getPropertyArray("NORMAL_OCT16P",H.UNSIGNED_BYTE,2),e.isOctEncoded16P=!0),e.attributes.normals=Yh(e,r)}}function Zm(e,t){let r=null;if(!e.batchIds&&t.hasProperty("BATCH_ID")&&(e.batchIds=t.getPropertyArray("BATCH_ID",H.UNSIGNED_SHORT,1),e.batchIds)){let n=t.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");let{batchTableJson:o,batchTableBinary:s}=e;r=new ue(o,s,n)}return r}async function qm(e,t,r,n,o){let s,i,a,c=e.batchTableJson&&e.batchTableJson.extensions&&e.batchTableJson.extensions["3DTILES_draco_point_compression"];c&&(a=c.properties);let f=t.getExtension("3DTILES_draco_point_compression");if(f){i=f.properties;let u=f.byteOffset,l=f.byteLength;if(!i||!Number.isFinite(u)||!l)throw new Error("Draco properties, byteOffset, and byteLength must be defined");s=(e.featureTableBinary||[]).slice(u,u+l),e.hasPositions=Number.isFinite(i.POSITION),e.hasColors=Number.isFinite(i.RGB)||Number.isFinite(i.RGBA),e.hasNormals=Number.isFinite(i.NORMAL),e.hasBatchIds=Number.isFinite(i.BATCH_ID),e.isTranslucent=Number.isFinite(i.RGBA)}if(!s)return!0;let h={buffer:s,properties:{...i,...a},featureTableProperties:i,batchTableProperties:a,dequantizeInShader:!1};return await Wm(e,h,n,o)}async function Wm(e,t,r,n){if(!n)return;let o={...r,draco:{...r?.draco,extraAttributes:t.batchTableProperties||{}}};delete o["3d-tiles"];let s=await Ut(t.buffer,So,o,n),i=s.attributes.POSITION&&s.attributes.POSITION.value,a=s.attributes.COLOR_0&&s.attributes.COLOR_0.value,c=s.attributes.NORMAL&&s.attributes.NORMAL.value,f=s.attributes.BATCH_ID&&s.attributes.BATCH_ID.value,h=i&&s.attributes.POSITION.value.quantization,u=c&&s.attributes.NORMAL.value.quantization;if(h){let d=s.POSITION.data.quantization,A=d.range;e.quantizedVolumeScale=new b(A,A,A),e.quantizedVolumeOffset=new b(d.minValues),e.quantizedRange=(1<<d.quantizationBits)-1,e.isQuantizedDraco=!0}u&&(e.octEncodedRange=(1<<s.NORMAL.data.quantization.quantizationBits)-1,e.isOctEncodedDraco=!0);let l={};if(t.batchTableProperties)for(let d of Object.keys(t.batchTableProperties))s.attributes[d]&&s.attributes[d].value&&(l[d.toLowerCase()]=s.attributes[d].value);e.attributes={positions:i,colors:Xi(e,a,void 0),normals:c,batchIds:f,...l}}var ra={};ut(ra,{decode:()=>Np,name:()=>vp});var Wh="4.3.0-alpha.3";var $m=globalThis.loaders?.parseImageNode,Yi=typeof Image<"u",Zi=typeof ImageBitmap<"u",tp=Boolean($m),qi=Et?!0:tp;function $h(e){switch(e){case"auto":return Zi||Yi||qi;case"imagebitmap":return Zi;case"image":return Yi;case"data":return qi;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function tl(){if(Zi)return"imagebitmap";if(Yi)return"image";if(qi)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function el(e){let t=ep(e);if(!t)throw new Error("Not an image");return t}function On(e){switch(el(e)){case"data":return e;case"image":case"imagebitmap":let t=document.createElement("canvas"),r=t.getContext("2d");if(!r)throw new Error("getImageData");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function ep(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&e instanceof Image?"image":e&&typeof e=="object"&&e.data&&e.width&&e.height?"data":null}var rp=/^data:image\/svg\+xml/,np=/\.svg((\?|#).*)?$/;function ko(e){return e&&(rp.test(e)||np.test(e))}function rl(e,t){if(ko(t)){let n=new TextDecoder().decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(s){throw new Error(s.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return Wi(e,t)}function Wi(e,t){if(ko(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function Jo(e,t,r){let n=rl(e,r),o=self.URL||self.webkitURL,s=typeof n!="string"&&o.createObjectURL(n);try{return await op(s||n,t)}finally{s&&o.revokeObjectURL(s)}}async function op(e,t){let r=new Image;return r.src=e,t.image&&t.image.decode&&r.decode?(await r.decode(),r):await new Promise((n,o)=>{try{r.onload=()=>n(r),r.onerror=s=>{let i=s instanceof Error?s.message:"error";o(new Error(i))}}catch(s){o(s)}})}var sp={},nl=!0;async function ol(e,t,r){let n;ko(r)?n=await Jo(e,t,r):n=Wi(e,r);let o=t&&t.imagebitmap;return await ip(n,o)}async function ip(e,t=null){if((ap(t)||!nl)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),nl=!1}return await createImageBitmap(e)}function ap(e){for(let t in e||sp)return!1;return!0}function sl(e){return!lp(e,"ftyp",4)||!(e[8]&96)?null:cp(e)}function cp(e){switch(fp(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function fp(e,t,r){return String.fromCharCode(...e.slice(t,r))}function hp(e){return[...e].map(t=>t.charCodeAt(0))}function lp(e,t,r=0){let n=hp(t);for(let o=0;o<n.length;++o)if(n[o]!==e[o+r])return!1;return!0}var ee=!1,Ln=!0;function Xe(e){let t=vn(e);return dp(t)||pp(t)||Ap(t)||mp(t)||up(t)}function up(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=sl(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function dp(e){let t=vn(e);return t.byteLength>=24&&t.getUint32(0,ee)===2303741511?{mimeType:"image/png",width:t.getUint32(16,ee),height:t.getUint32(20,ee)}:null}function Ap(e){let t=vn(e);return t.byteLength>=10&&t.getUint32(0,ee)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,Ln),height:t.getUint16(8,Ln)}:null}function mp(e){let t=vn(e);return t.byteLength>=14&&t.getUint16(0,ee)===16973&&t.getUint32(2,Ln)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,Ln),height:t.getUint32(22,Ln)}:null}function pp(e){let t=vn(e);if(!(t.byteLength>=3&&t.getUint16(0,ee)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:o}=gp(),s=2;for(;s+9<t.byteLength;){let i=t.getUint16(s,ee);if(o.has(i))return{mimeType:"image/jpeg",height:t.getUint16(s+5,ee),width:t.getUint16(s+7,ee)};if(!n.has(i))return null;s+=2,s+=t.getUint16(s,ee)}return null}function gp(){let e=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)e.add(r);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function vn(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}async function il(e,t){let{mimeType:r}=Xe(e)||{},n=globalThis.loaders?.parseImageNode;return J(n),await n(e,r)}async function al(e,t,r){t=t||{};let o=(t.image||{}).type||"auto",{url:s}=r||{},i=xp(o),a;switch(i){case"imagebitmap":a=await ol(e,t,s);break;case"image":a=await Jo(e,t,s);break;case"data":a=await il(e,t);break;default:J(!1)}return o==="data"&&(a=On(a)),a}function xp(e){switch(e){case"auto":case"data":return tl();default:return $h(e),e}}var Bp=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],Ep=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],_p={image:{type:"auto",decode:!0}},$i={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:Wh,mimeTypes:Ep,extensions:Bp,parse:al,tests:[e=>Boolean(Xe(new DataView(e)))],options:_p};var ta={};function ea(e){if(ta[e]===void 0){let t=Et?Tp(e):yp(e);ta[e]=t}return ta[e]}function yp(e){let t=["image/png","image/jpeg","image/gif"],r=globalThis.loaders?.imageFormatsNode||t,n=globalThis.loaders?.parseImageNode;return Boolean(n)&&r.includes(e)}function Tp(e){switch(e){case"image/avif":case"image/webp":return Cp(e);default:return!0}}function Cp(e){try{return document.createElement("canvas").toDataURL(e).indexOf(`data:${e}`)===0}catch{return!1}}function st(e,t){if(!e)throw new Error(t||"assert failed: gltf")}var zo={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Qo={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};var Mp=1.33,cl=["SCALAR","VEC2","VEC3","VEC4"],bp=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],wp=new Map(bp),Ip={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Sp={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Rp={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Vo(e){return cl[e-1]||cl[0]}function Hr(e){let t=wp.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function kr(e,t){let r=Rp[e.componentType],n=Ip[e.type],o=Sp[e.componentType],s=e.count*n,i=e.count*n*o;st(i>=0&&i<=t.byteLength);let a=Qo[e.componentType],c=zo[e.type];return{ArrayType:r,length:s,byteLength:i,componentByteSize:a,numberOfComponentsInElement:c}}function Nn(e){let{images:t,bufferViews:r}=e;t=t||[],r=r||[];let n=t.map(i=>i.bufferView);r=r.filter(i=>!n.includes(i));let o=r.reduce((i,a)=>i+a.byteLength,0),s=t.reduce((i,a)=>{let{width:c,height:f}=a.image;return i+c*f},0);return o+Math.ceil(4*s*Mp)}function fl(e,t,r){let n=e.bufferViews[r];st(n);let o=n.buffer,s=t[o];st(s);let i=(n.byteOffset||0)+s.byteOffset;return new Uint8Array(s.arrayBuffer,i,n.byteLength)}function hl(e,t,r){let n=typeof r=="number"?e.accessors?.[r]:r;if(!n)throw new Error(`No gltf accessor ${JSON.stringify(r)}`);let o=e.bufferViews?.[n.bufferView||0];if(!o)throw new Error(`No gltf buffer view for accessor ${o}`);let{arrayBuffer:s,byteOffset:i}=t[o.buffer],a=(i||0)+(n.byteOffset||0)+(o.byteOffset||0),{ArrayType:c,length:f,componentByteSize:h,numberOfComponentsInElement:u}=kr(n,o),l=h*u,d=o.byteStride||l;if(typeof o.byteStride>"u"||o.byteStride===l)return new c(s,a,f);let A=new c(f);for(let m=0;m<n.count;m++){let p=new c(s,a+m*d,u);A.set(p,m*u)}return A}function Fp(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}var K=class{gltf;sourceBuffers;byteLength;constructor(t){this.gltf={json:t?.json||Fp(),buffers:t?.buffers||[],images:t?.images||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(t){return this.json[t]}getExtraData(t){return(this.json.extras||{})[t]}hasExtension(t){let r=this.getUsedExtensions().find(o=>o===t),n=this.getRequiredExtensions().find(o=>o===t);return typeof r=="string"||typeof n=="string"}getExtension(t){let r=this.getUsedExtensions().find(o=>o===t),n=this.json.extensions||{};return r?n[t]:null}getRequiredExtension(t){return this.getRequiredExtensions().find(n=>n===t)?this.getExtension(t):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(t,r){return(t.extensions||{})[r]}getScene(t){return this.getObject("scenes",t)}getNode(t){return this.getObject("nodes",t)}getSkin(t){return this.getObject("skins",t)}getMesh(t){return this.getObject("meshes",t)}getMaterial(t){return this.getObject("materials",t)}getAccessor(t){return this.getObject("accessors",t)}getTexture(t){return this.getObject("textures",t)}getSampler(t){return this.getObject("samplers",t)}getImage(t){return this.getObject("images",t)}getBufferView(t){return this.getObject("bufferViews",t)}getBuffer(t){return this.getObject("buffers",t)}getObject(t,r){if(typeof r=="object")return r;let n=this.json[t]&&this.json[t][r];if(!n)throw new Error(`glTF file error: Could not find ${t}[${r}]`);return n}getTypedArrayForBufferView(t){t=this.getBufferView(t);let r=t.buffer,n=this.gltf.buffers[r];st(n);let o=(t.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,o,t.byteLength)}getTypedArrayForAccessor(t){let r=this.getAccessor(t);return hl(this.gltf.json,this.gltf.buffers,r)}getTypedArrayForImageData(t){t=this.getAccessor(t);let r=this.getBufferView(t.bufferView),o=this.getBuffer(r.buffer).data,s=r.byteOffset||0;return new Uint8Array(o,s,r.byteLength)}addApplicationData(t,r){return this.json[t]=r,this}addExtraData(t,r){return this.json.extras=this.json.extras||{},this.json.extras[t]=r,this}addObjectExtension(t,r,n){return t.extensions=t.extensions||{},t.extensions[r]=n,this.registerUsedExtension(r),this}setObjectExtension(t,r,n){let o=t.extensions||{};o[r]=n}removeObjectExtension(t,r){let n=t?.extensions||{};if(n[r]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let o=this.json.extensionsRemoved;o.includes(r)||o.push(r)}delete n[r]}addExtension(t,r={}){return st(r),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=r,this.registerUsedExtension(t),r}addRequiredExtension(t,r={}){return st(r),this.addExtension(t,r),this.registerRequiredExtension(t),r}registerUsedExtension(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(r=>r===t)||this.json.extensionsUsed.push(t)}registerRequiredExtension(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(r=>r===t)||this.json.extensionsRequired.push(t)}removeExtension(t){if(this.json.extensions?.[t]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let r=this.json.extensionsRemoved;r.includes(t)||r.push(t)}this.json.extensions&&delete this.json.extensions[t],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t)}setDefaultScene(t){this.json.scene=t}addScene(t){let{nodeIndices:r}=t;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:r}),this.json.scenes.length-1}addNode(t){let{meshIndex:r,matrix:n}=t;this.json.nodes=this.json.nodes||[];let o={mesh:r};return n&&(o.matrix=n),this.json.nodes.push(o),this.json.nodes.length-1}addMesh(t){let{attributes:r,indices:n,material:o,mode:s=4}=t,a={primitives:[{attributes:this._addAttributes(r),mode:s}]};if(n){let c=this._addIndices(n);a.primitives[0].indices=c}return Number.isFinite(o)&&(a.primitives[0].material=o),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(t){let n={primitives:[{attributes:this._addAttributes(t),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(n),this.json.meshes.length-1}addImage(t,r){let n=Xe(t),o=r||n?.mimeType,i={bufferView:this.addBufferView(t),mimeType:o};return this.json.images=this.json.images||[],this.json.images.push(i),this.json.images.length-1}addBufferView(t,r=0,n=this.byteLength){let o=t.byteLength;st(Number.isFinite(o)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);let s={buffer:r,byteOffset:n,byteLength:o};return this.byteLength+=bt(o,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(s),this.json.bufferViews.length-1}addAccessor(t,r){let n={bufferView:t,type:Vo(r.size),componentType:r.componentType,count:r.count,max:r.max,min:r.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(n),this.json.accessors.length-1}addBinaryBuffer(t,r={size:3}){let n=this.addBufferView(t),o={min:r.min,max:r.max};(!o.min||!o.max)&&(o=this._getAccessorMinMax(t,r.size));let s={size:r.size,componentType:Hr(t),count:Math.round(t.length/r.size),min:o.min,max:o.max};return this.addAccessor(n,Object.assign(s,r))}addTexture(t){let{imageIndex:r}=t,n={source:r};return this.json.textures=this.json.textures||[],this.json.textures.push(n),this.json.textures.length-1}addMaterial(t){return this.json.materials=this.json.materials||[],this.json.materials.push(t),this.json.materials.length-1}createBinaryChunk(){this.gltf.buffers=[];let t=this.byteLength,r=new ArrayBuffer(t),n=new Uint8Array(r),o=0;for(let s of this.sourceBuffers||[])o=Xs(s,n,o);this.json?.buffers?.[0]?this.json.buffers[0].byteLength=t:this.json.buffers=[{byteLength:t}],this.gltf.binary=r,this.sourceBuffers=[r]}_removeStringFromArray(t,r){let n=!0;for(;n;){let o=t.indexOf(r);o>-1?t.splice(o,1):n=!1}}_addAttributes(t={}){let r={};for(let n in t){let o=t[n],s=this._getGltfAttributeName(n),i=this.addBinaryBuffer(o.value,o);r[s]=i}return r}_addIndices(t){return this.addBinaryBuffer(t,{size:1})}_getGltfAttributeName(t){switch(t.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return t}}_getAccessorMinMax(t,r){let n={min:null,max:null};if(t.length<r)return n;n.min=[],n.max=[];let o=t.subarray(0,r);for(let s of o)n.min.push(s),n.max.push(s);for(let s=r;s<t.length;s+=r)for(let i=0;i<r;i++)n.min[0+i]=Math.min(n.min[0+i],t[s+i]),n.max[0+i]=Math.max(n.max[0+i],t[s+i]);return n}};function ll(e){return(e%1+1)%1}var ul={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},Dp={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},dl={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8};function Gn(e,t){return dl[t]*ul[e]}function Jr(e,t,r,n){if(r!=="UINT8"&&r!=="UINT16"&&r!=="UINT32"&&r!=="UINT64")return null;let o=e.getTypedArrayForBufferView(t),s=zr(o,"SCALAR",r,n+1);return s instanceof BigInt64Array||s instanceof BigUint64Array?null:s}function zr(e,t,r,n=1){let o=ul[t],s=Dp[r],i=dl[r],a=n*o,c=a*i,f=e.buffer,h=e.byteOffset;return h%i!==0&&(f=new Uint8Array(f).slice(h,h+c).buffer,h=0),new s(f,h,a)}function Qr(e,t,r){let n=`TEXCOORD_${t.texCoord||0}`,o=r.attributes[n],s=e.getTypedArrayForAccessor(o),i=e.gltf.json,a=t.index,c=i.textures?.[a]?.source;if(typeof c<"u"){let f=i.images?.[c]?.mimeType,h=e.gltf.images?.[c];if(h&&typeof h.width<"u"){let u=[];for(let l=0;l<s.length;l+=2){let d=Op(h,f,s,l,t.channels);u.push(d)}return u}}return[]}function jo(e,t,r,n,o){if(!r?.length)return;let s=[];for(let h of r){let u=n.findIndex(l=>l===h);u===-1&&(u=n.push(h)-1),s.push(u)}let i=new Uint32Array(s),a=e.gltf.buffers.push({arrayBuffer:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength})-1,c=e.addBufferView(i,a,0),f=e.addAccessor(c,{size:1,componentType:Hr(i),count:i.length});o.attributes[t]=f}function Op(e,t,r,n,o=[0]){let s={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},i=r[n],a=r[n+1],c=1;t&&(t.indexOf("image/jpeg")!==-1||t.indexOf("image/png")!==-1)&&(c=4);let f=Lp(i,a,e,c),h=0;for(let u of o){let l=typeof u=="number"?Object.values(s)[u]:s[u],d=f+l.offset,A=On(e);if(A.data.length<=d)throw new Error(`${A.data.length} <= ${d}`);let m=A.data[d];h|=m<<l.shift}return h}function Lp(e,t,r,n=1){let o=r.width,s=ll(e)*(o-1),i=Math.round(s),a=r.height,c=ll(t)*(a-1),f=Math.round(c),h=r.components?r.components:n;return(f*o+i)*h}function Ko(e,t,r,n,o){let s=[];for(let i=0;i<t;i++){let a=r[i],c=r[i+1]-r[i];if(c+a>n)break;let f=a/o,h=c/o;s.push(e.slice(f,f+h))}return s}function Xo(e,t,r){let n=[];for(let o=0;o<t;o++){let s=o*r;n.push(e.slice(s,s+r))}return n}function Yo(e,t,r,n){if(r)throw new Error("Not implemented - arrayOffsets for strings is specified");if(n){let o=[],s=new TextDecoder("utf8"),i=0;for(let a=0;a<e;a++){let c=n[a+1]-n[a];if(c+i<=t.length){let f=t.subarray(i,c+i),h=s.decode(f);o.push(h),i+=c}}return o}return[]}var Al="EXT_mesh_features",vp=Al;async function Np(e,t){let r=new K(e);Gp(r,t)}function Gp(e,t){let r=e.gltf.json;if(r.meshes)for(let n of r.meshes)for(let o of n.primitives)Pp(e,o,t)}function Pp(e,t,r){if(!r?.gltf?.loadBuffers)return;let o=t.extensions?.[Al]?.featureIds;if(o)for(let s of o){let i;if(typeof s.attribute<"u"){let a=`_FEATURE_ID_${s.attribute}`,c=t.attributes[a];i=e.getTypedArrayForAccessor(c)}else typeof s.texture<"u"&&r?.gltf?.loadImages?i=Qr(e,s.texture,t):i=[];s.data=i}}var sa={};ut(sa,{decode:()=>Hp,name:()=>Up});var na="EXT_structural_metadata",Up=na;async function Hp(e,t){let r=new K(e);kp(r,t)}function kp(e,t){if(!t.gltf?.loadBuffers)return;let r=e.getExtension(na);r&&(t.gltf?.loadImages&&Jp(e,r),zp(e,r))}function Jp(e,t){let r=t.propertyTextures,n=e.gltf.json;if(r&&n.meshes)for(let o of n.meshes)for(let s of o.primitives)Vp(e,r,s,t)}function zp(e,t){let r=t.schema;if(!r)return;let n=r.classes,o=t.propertyTables;if(n&&o)for(let s in n){let i=Qp(o,s);i&&Kp(e,r,i)}}function Qp(e,t){for(let r of e)if(r.class===t)return r;return null}function Vp(e,t,r,n){if(!t)return;let s=r.extensions?.[na]?.propertyTextures;if(s)for(let i of s){let a=t[i];jp(e,a,r,n)}}function jp(e,t,r,n){if(!t.properties)return;n.dataAttributeNames||(n.dataAttributeNames=[]);let o=t.class;for(let s in t.properties){let i=`${o}_${s}`,a=t.properties?.[s];if(!a)continue;a.data||(a.data=[]);let c=a.data,f=Qr(e,a,r);f!==null&&(jo(e,i,f,c,r),a.data=c,n.dataAttributeNames.push(i))}}function Kp(e,t,r){let n=t.classes?.[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let o=r.count;for(let s in n.properties){let i=n.properties[s],a=r.properties?.[s];if(a){let c=Xp(e,t,i,o,a);a.data=c}}}function Xp(e,t,r,n,o){let s=[],i=o.values,a=e.getTypedArrayForBufferView(i),c=Yp(e,r,o,n),f=Zp(e,o,n);switch(r.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{s=qp(r,n,a,c);break}case"BOOLEAN":throw new Error(`Not implemented - classProperty.type=${r.type}`);case"STRING":{s=Yo(n,a,c,f);break}case"ENUM":{s=Wp(t,r,n,a,c);break}default:throw new Error(`Unknown classProperty type ${r.type}`)}return s}function Yp(e,t,r,n){return t.array&&typeof t.count>"u"&&typeof r.arrayOffsets<"u"?Jr(e,r.arrayOffsets,r.arrayOffsetType||"UINT32",n):null}function Zp(e,t,r){return typeof t.stringOffsets<"u"?Jr(e,t.stringOffsets,t.stringOffsetType||"UINT32",r):null}function qp(e,t,r,n){let o=e.array,s=e.count,i=Gn(e.type,e.componentType),a=r.byteLength/i,c;return e.componentType?c=zr(r,e.type,e.componentType,a):c=r,o?n?Ko(c,t,n,r.length,i):s?Xo(c,t,s):[]:c}function Wp(e,t,r,n,o){let s=t.enumType;if(!s)throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");let i=e.enums?.[s];if(!i)throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${s}`);let a=i.valueType||"UINT16",c=Gn(t.type,a),f=n.byteLength/c,h=zr(n,t.type,a,f);if(h||(h=n),t.array){if(o)return $p({valuesData:h,numberOfElements:r,arrayOffsets:o,valuesDataBytesLength:n.length,elementSize:c,enumEntry:i});let u=t.count;return u?tg(h,r,u,i):[]}return oa(h,0,r,i)}function $p(e){let{valuesData:t,numberOfElements:r,arrayOffsets:n,valuesDataBytesLength:o,elementSize:s,enumEntry:i}=e,a=[];for(let c=0;c<r;c++){let f=n[c],h=n[c+1]-n[c];if(h+f>o)break;let u=f/s,l=h/s,d=oa(t,u,l,i);a.push(d)}return a}function tg(e,t,r,n){let o=[];for(let s=0;s<t;s++){let i=r*s,a=oa(e,i,r,n);o.push(a)}return o}function oa(e,t,r,n){let o=[];for(let s=0;s<r;s++)if(e instanceof BigInt64Array||e instanceof BigUint64Array)o.push("");else{let i=e[t+s],a=eg(n,i);a?o.push(a.name):o.push("")}return o}function eg(e,t){for(let r of e.values)if(r.value===t)return r;return null}var ia={};ut(ia,{decode:()=>ng,name:()=>rg});var ml="EXT_feature_metadata",rg=ml;async function ng(e,t){let r=new K(e);og(r,t)}function og(e,t){if(!t.gltf?.loadBuffers)return;let r=e.getExtension(ml);r&&(t.gltf?.loadImages&&sg(e,r),ig(e,r))}function sg(e,t){let r=t.schema;if(!r)return;let n=r.classes,{featureTextures:o}=t;if(n&&o)for(let s in n){let i=n[s],a=cg(o,s);a&&hg(e,a,i)}}function ig(e,t){let r=t.schema;if(!r)return;let n=r.classes,o=t.featureTables;if(n&&o)for(let s in n){let i=ag(o,s);i&&fg(e,r,i)}}function ag(e,t){for(let r in e){let n=e[r];if(n.class===t)return n}return null}function cg(e,t){for(let r in e){let n=e[r];if(n.class===t)return n}return null}function fg(e,t,r){if(!r.class)return;let n=t.classes?.[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let o=r.count;for(let s in n.properties){let i=n.properties[s],a=r.properties?.[s];if(a){let c=lg(e,t,i,o,a);a.data=c}}}function hg(e,t,r){let n=t.class;for(let o in r.properties){let s=t?.properties?.[o];if(s){let i=pg(e,s,n);s.data=i}}}function lg(e,t,r,n,o){let s=[],i=o.bufferView,a=e.getTypedArrayForBufferView(i),c=ug(e,r,o,n),f=dg(e,r,o,n);return r.type==="STRING"||r.componentType==="STRING"?s=Yo(n,a,c,f):Ag(r)&&(s=mg(r,n,a,c)),s}function ug(e,t,r,n){return t.type==="ARRAY"&&typeof t.componentCount>"u"&&typeof r.arrayOffsetBufferView<"u"?Jr(e,r.arrayOffsetBufferView,r.offsetType||"UINT32",n):null}function dg(e,t,r,n){return typeof r.stringOffsetBufferView<"u"?Jr(e,r.stringOffsetBufferView,r.offsetType||"UINT32",n):null}function Ag(e){let t=["UINT8","INT16","UINT16","INT32","UINT32","INT64","UINT64","FLOAT32","FLOAT64"];return t.includes(e.type)||typeof e.componentType<"u"&&t.includes(e.componentType)}function mg(e,t,r,n){let o=e.type==="ARRAY",s=e.componentCount,i="SCALAR",a=e.componentType||e.type,c=Gn(i,a),f=r.byteLength/c,h=zr(r,i,a,f);return o?n?Ko(h,t,n,r.length,c):s?Xo(h,t,s):[]:h}function pg(e,t,r){let n=e.gltf.json;if(!n.meshes)return[];let o=[];for(let s of n.meshes)for(let i of s.primitives)gg(e,r,t,o,i);return o}function gg(e,t,r,n,o){let s={channels:r.channels,...r.texture},i=Qr(e,s,o);i&&jo(e,t,i,n,o)}var pl="4.3.0-alpha.3";var gl="4.3.0-alpha.3";var Zo={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},xl;async function ca(e){xn(e.modules);let t=Vs("basis");return t||(xl||=xg(e),await xl)}async function xg(e){let t=null,r=null;return[t,r]=await Promise.all([await qt(Zo.TRANSCODER,"textures",e),await qt(Zo.TRANSCODER_WASM,"textures",e)]),t=t||globalThis.BASIS,await Bg(t,r)}function Bg(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e(r).then(o=>{let{BasisFile:s,initializeBasis:i}=o;i(),n({BasisFile:s})})})}var aa;async function fa(e){let t=e.modules||{};return t.basisEncoder?t.basisEncoder:(aa=aa||Eg(e),await aa)}async function Eg(e){let t=null,r=null;return[t,r]=await Promise.all([await qt(Zo.ENCODER,"textures",e),await qt(Zo.ENCODER_WASM,"textures",e)]),t=t||globalThis.BASIS,await _g(t,r)}function _g(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e(r).then(o=>{let{BasisFile:s,KTX2File:i,initializeBasis:a,BasisEncoder:c}=o;a(),n({BasisFile:s,KTX2File:i,BasisEncoder:c})})})}var Ye={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35987,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,COMPRESSED_RGBA_ASTC_4X4_KHR:37808,COMPRESSED_RGBA_ASTC_5X4_KHR:37809,COMPRESSED_RGBA_ASTC_5X5_KHR:37810,COMPRESSED_RGBA_ASTC_6X5_KHR:37811,COMPRESSED_RGBA_ASTC_6X6_KHR:37812,COMPRESSED_RGBA_ASTC_8X5_KHR:37813,COMPRESSED_RGBA_ASTC_8X6_KHR:37814,COMPRESSED_RGBA_ASTC_8X8_KHR:37815,COMPRESSED_RGBA_ASTC_10X5_KHR:37816,COMPRESSED_RGBA_ASTC_10X6_KHR:37817,COMPRESSED_RGBA_ASTC_10X8_KHR:37818,COMPRESSED_RGBA_ASTC_10X10_KHR:37819,COMPRESSED_RGBA_ASTC_12X10_KHR:37820,COMPRESSED_RGBA_ASTC_12X12_KHR:37821,COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR:37840,COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR:37841,COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR:37842,COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR:37843,COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR:37844,COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR:37845,COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR:37846,COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR:37847,COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR:37848,COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR:37849,COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR:37850,COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR:37851,COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR:37852,COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR:37853,COMPRESSED_RED_RGTC1_EXT:36283,COMPRESSED_SIGNED_RED_RGTC1_EXT:36284,COMPRESSED_RED_GREEN_RGTC2_EXT:36285,COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:36286,COMPRESSED_SRGB_S3TC_DXT1_EXT:35916,COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:35917,COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:35918,COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:35919};var yg=["","WEBKIT_","MOZ_"],Bl={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"},qo=null;function El(e){if(!qo){e=e||Tg()||void 0,qo=new Set;for(let t of yg)for(let r in Bl)if(e&&e.getExtension(`${t}${r}`)){let n=Bl[r];qo.add(n)}}return qo}function Tg(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var It=[171,75,84,88,32,50,48,187,13,10,26,10];function _l(e){let t=new Uint8Array(e);return!(t.byteLength<It.length||t[0]!==It[0]||t[1]!==It[1]||t[2]!==It[2]||t[3]!==It[3]||t[4]!==It[4]||t[5]!==It[5]||t[6]!==It[6]||t[7]!==It[7]||t[8]!==It[8]||t[9]!==It[9]||t[10]!==It[10]||t[11]!==It[11])}var Cg={etc1:{basisFormat:0,compressed:!0,format:Ye.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:Ye.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:Ye.COMPRESSED_RGBA_S3TC_DXT5_EXT},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:Ye.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:Ye.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:Ye.COMPRESSED_RGBA_ASTC_4X4_KHR},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};async function la(e,t){if(t.basis.containerFormat==="auto"){if(_l(e)){let n=await fa(t);return yl(n.KTX2File,e,t)}let{BasisFile:r}=await ca(t);return ha(r,e,t)}switch(t.basis.module){case"encoder":let r=await fa(t);switch(t.basis.containerFormat){case"ktx2":return yl(r.KTX2File,e,t);case"basis":default:return ha(r.BasisFile,e,t)}case"transcoder":default:let{BasisFile:n}=await ca(t);return ha(n,e,t)}}function ha(e,t,r){let n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");let o=n.getNumImages(),s=[];for(let i=0;i<o;i++){let a=n.getNumLevels(i),c=[];for(let f=0;f<a;f++)c.push(Mg(n,i,f,r));s.push(c)}return s}finally{n.close(),n.delete()}}function Mg(e,t,r,n){let o=e.getImageWidth(t,r),s=e.getImageHeight(t,r),i=e.getHasAlpha(),{compressed:a,format:c,basisFormat:f}=Tl(n,i),h=e.getImageTranscodedSizeInBytes(t,r,f),u=new Uint8Array(h);if(!e.transcodeImage(u,t,r,f,0,0))throw new Error("failed to start Basis transcoding");return{width:o,height:s,data:u,compressed:a,format:c,hasAlpha:i}}function yl(e,t,r){let n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");let o=n.getLevels(),s=[];for(let i=0;i<o;i++)s.push(bg(n,i,r));return[s]}finally{n.close(),n.delete()}}function bg(e,t,r){let{alphaFlag:n,height:o,width:s}=e.getImageLevelInfo(t,0,0),{compressed:i,format:a,basisFormat:c}=Tl(r,n),f=e.getImageTranscodedSizeInBytes(t,0,0,c),h=new Uint8Array(f);if(!e.transcodeImage(h,t,0,0,c,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:s,height:o,data:h,compressed:i,levelSize:f,hasAlpha:n,format:a}}function Tl(e,t){let r=e&&e.basis&&e.basis.format;return r==="auto"&&(r=Wo()),typeof r=="object"&&(r=t?r.alpha:r.noAlpha),r=r.toLowerCase(),Cg[r]}function Wo(){let e=El();return e.has("astc")?"astc-4x4":e.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:e.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:e.has("etc1")?"etc1":e.has("etc2")?"etc2":"rgb565"}var Cl={dataType:null,batchType:null,name:"Basis",id:"basis",module:"textures",version:gl,worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}},ua={...Cl,parse:la};var Vr=!0,Ml=1735152710,ma=12,$o=8,wg=1313821514,Ig=5130562,Sg=0,Rg=0,Fg=1;function Dg(e,t=0){return`${String.fromCharCode(e.getUint8(t+0))}${String.fromCharCode(e.getUint8(t+1))}${String.fromCharCode(e.getUint8(t+2))}${String.fromCharCode(e.getUint8(t+3))}`}function bl(e,t=0,r={}){let n=new DataView(e),{magic:o=Ml}=r,s=n.getUint32(t,!1);return s===o||s===Ml}function wl(e,t,r=0,n={}){let o=new DataView(t),s=Dg(o,r+0),i=o.getUint32(r+4,Vr),a=o.getUint32(r+8,Vr);switch(Object.assign(e,{header:{byteOffset:r,byteLength:a,hasBinChunk:!1},type:s,version:i,json:{},binChunks:[]}),r+=ma,e.version){case 1:return Og(e,o,r);case 2:return Lg(e,o,r,n={});default:throw new Error(`Invalid GLB version ${e.version}. Only supports version 1 and 2.`)}}function Og(e,t,r){J(e.header.byteLength>ma+$o);let n=t.getUint32(r+0,Vr),o=t.getUint32(r+4,Vr);return r+=$o,J(o===Sg),da(e,t,r,n),r+=n,r+=Aa(e,t,r,e.header.byteLength),r}function Lg(e,t,r,n){return J(e.header.byteLength>ma+$o),vg(e,t,r,n),r+e.header.byteLength}function vg(e,t,r,n){for(;r+8<=e.header.byteLength;){let o=t.getUint32(r+0,Vr),s=t.getUint32(r+4,Vr);switch(r+=$o,s){case wg:da(e,t,r,o);break;case Ig:Aa(e,t,r,o);break;case Rg:n.strict||da(e,t,r,o);break;case Fg:n.strict||Aa(e,t,r,o);break;default:break}r+=bt(o,4)}return r}function da(e,t,r,n){let o=new Uint8Array(t.buffer,r,n),i=new TextDecoder("utf8").decode(o);return e.json=JSON.parse(i),bt(n,4)}function Aa(e,t,r,n){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:t.buffer}),bt(n,4)}function pa(e,t){if(e.startsWith("data:")||e.startsWith("http:")||e.startsWith("https:"))return e;let n=t.baseUri||t.uri;if(!n)throw new Error(`'baseUri' must be provided to resolve relative url ${e}`);return n.substr(0,n.lastIndexOf("/")+1)+e}var xa={};ut(xa,{decode:()=>Kg,name:()=>jg});var Ng="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9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/mFAID/kFCTD+rFAKAND/mFAID/kFAcD9OD9QHNDQBFTtGEmYILPdKOenHID8dBAGDBIBDyB+t+J83EBABCNJAID8dFAGDBIBDyF+t+J83EBALAVANDQNVi8ZcMpySQ8c8dfb8e8fHND8dBAGDBIBDyG+t+J83EBABCiJAND8dFAGDBIBDyE+t+J83EBABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",Pg=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]),Ug=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),Hg={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},kg={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};async function Il(e,t,r,n,o,s="NONE"){let i=await Jg();Vg(i,i.exports[kg[o]],e,t,r,n,i.exports[Hg[s||"NONE"]])}var ga;async function Jg(){return ga||(ga=zg()),ga}async function zg(){let e=Ng;WebAssembly.validate(Pg)&&(e=Gg,console.log("Warning: meshopt_decoder is using experimental SIMD support"));let t=await WebAssembly.instantiate(Qg(e),{});return await t.instance.exports.__wasm_call_ctors(),t.instance}function Qg(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;++n){let o=e.charCodeAt(n);t[n]=o>96?o-71:o>64?o-65:o>47?o+4:o>46?63:62}let r=0;for(let n=0;n<e.length;++n)t[r++]=t[n]<60?Ug[t[n]]:(t[n]-60)*64+t[++n];return t.buffer.slice(0,r)}function Vg(e,t,r,n,o,s,i){let a=e.exports.sbrk,c=n+3&-4,f=a(c*o),h=a(s.length),u=new Uint8Array(e.exports.memory.buffer);u.set(s,h);let l=t(f,n,o,h,s.length);if(l===0&&i&&i(f,c,o),r.set(u.subarray(f,f+n*o)),a(f-a(0)),l!==0)throw new Error(`Malformed buffer data: ${l}`)}var ts="EXT_meshopt_compression",jg=ts;async function Kg(e,t){let r=new K(e);if(!t?.gltf?.decompressMeshes||!t.gltf?.loadBuffers)return;let n=[];for(let o of e.json.bufferViews||[])n.push(Xg(r,o));await Promise.all(n),r.removeExtension(ts)}async function Xg(e,t){let r=e.getObjectExtension(t,ts);if(r){let{byteOffset:n=0,byteLength:o=0,byteStride:s,count:i,mode:a,filter:c="NONE",buffer:f}=r,h=e.gltf.buffers[f],u=new Uint8Array(h.arrayBuffer,h.byteOffset+n,o),l=new Uint8Array(e.gltf.buffers[t.buffer].arrayBuffer,t.byteOffset,t.byteLength);await Il(l,i,s,u,a,c),e.removeObjectExtension(t,ts)}}var Ba={};ut(Ba,{name:()=>Yg,preprocess:()=>Zg});var jr="EXT_texture_webp",Yg=jr;function Zg(e,t){let r=new K(e);if(!ea("image/webp")){if(r.getRequiredExtensions().includes(jr))throw new Error(`gltf: Required extension ${jr} not supported by browser`);return}let{json:n}=r;for(let o of n.textures||[]){let s=r.getObjectExtension(o,jr);s&&(o.source=s.source),r.removeObjectExtension(o,jr)}r.removeExtension(jr)}var Ea={};ut(Ea,{name:()=>qg,preprocess:()=>Wg});var es="KHR_texture_basisu",qg=es;function Wg(e,t){let r=new K(e),{json:n}=r;for(let o of n.textures||[]){let s=r.getObjectExtension(o,es);s&&(o.source=s.source,r.removeObjectExtension(o,es))}r.removeExtension(es)}var ya={};ut(ya,{decode:()=>nx,encode:()=>ox,name:()=>ex,preprocess:()=>rx});function Sl(e){let t={};for(let r in e){let n=e[r];if(r!=="indices"){let o=_a(n);t[r]=o}}return t}function _a(e){let{buffer:t,size:r,count:n}=$g(e);return{value:t,size:r,byteOffset:0,count:n,type:Vo(r),componentType:Hr(t)}}function $g(e){let t=e,r=1,n=0;return e&&e.value&&(t=e.value,r=e.size||1),t&&(ArrayBuffer.isView(t)||(t=tx(t,Float32Array)),n=t.length/r),{buffer:t,size:r,count:n}}function tx(e,t,r=!1){return e?Array.isArray(e)?new t(e):r&&!(e instanceof t)?new t(e):e:null}var Re="KHR_draco_mesh_compression",ex=Re;function rx(e,t,r){let n=new K(e);for(let o of Rl(n))n.getObjectExtension(o,Re)}async function nx(e,t,r){if(!t?.gltf?.decompressMeshes)return;let n=new K(e),o=[];for(let s of Rl(n))n.getObjectExtension(s,Re)&&o.push(sx(n,s,t,r));await Promise.all(o),n.removeExtension(Re)}function ox(e,t={}){let r=new K(e);for(let n of r.json.meshes||[])ix(n,t),r.addRequiredExtension(Re)}async function sx(e,t,r,n){let o=e.getObjectExtension(t,Re);if(!o)return;let s=e.getTypedArrayForBufferView(o.bufferView),i=Je(s.buffer,s.byteOffset),a={...r};delete a["3d-tiles"];let c=await Ut(i,So,a,n),f=Sl(c.attributes);for(let[h,u]of Object.entries(f))if(h in t.attributes){let l=t.attributes[h],d=e.getAccessor(l);d?.min&&d?.max&&(u.min=d.min,u.max=d.max)}t.attributes=f,c.indices&&(t.indices=_a(c.indices)),e.removeObjectExtension(t,Re),ax(t)}function ix(e,t,r=4,n,o){if(!n.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");let s=n.DracoWriter.encodeSync({attributes:e}),i=o?.parseSync?.({attributes:e}),a=n._addFauxAttributes(i.attributes),c=n.addBufferView(s);return{primitives:[{attributes:a,mode:r,extensions:{[Re]:{bufferView:c,attributes:a}}}]}}function ax(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*Rl(e){for(let t of e.json.meshes||[])for(let r of t.primitives)yield r}var Ta={};ut(Ta,{decode:()=>lx,name:()=>cx});var ns="KHR_texture_transform",cx=ns,rs=new fe,fx=new he,hx=new he;async function lx(e,t){if(!new K(e).hasExtension(ns)||!t.gltf?.loadBuffers)return;let o=e.json.materials||[];for(let s=0;s<o.length;s++)ux(s,e)}function ux(e,t){let r=t.json.materials?.[e],n=[r?.pbrMetallicRoughness?.baseColorTexture,r?.emissiveTexture,r?.normalTexture,r?.occlusionTexture,r?.pbrMetallicRoughness?.metallicRoughnessTexture],o=[];for(let s of n)s&&s?.extensions?.[ns]&&dx(t,e,s,o)}function dx(e,t,r,n){let o=Ax(r,n);if(!o)return;let s=e.json.meshes||[];for(let i of s)for(let a of i.primitives){let c=a.material;Number.isFinite(c)&&t===c&&mx(e,a,o)}}function Ax(e,t){let r=e.extensions?.[ns],{texCoord:n=0}=e,{texCoord:o=n}=r;if(!(t.findIndex(([i,a])=>i===n&&a===o)!==-1)){let i=xx(r);return n!==o&&(e.texCoord=o),t.push([n,o]),{originalTexCoord:n,texCoord:o,matrix:i}}return null}function mx(e,t,r){let{originalTexCoord:n,texCoord:o,matrix:s}=r,i=t.attributes[`TEXCOORD_${n}`];if(Number.isFinite(i)){let a=e.json.accessors?.[i];if(a&&a.bufferView){let c=e.json.bufferViews?.[a.bufferView];if(c){let{arrayBuffer:f,byteOffset:h}=e.buffers[c.buffer],u=(h||0)+(a.byteOffset||0)+(c.byteOffset||0),{ArrayType:l,length:d}=kr(a,c),A=Qo[a.componentType],m=zo[a.type],p=c.byteStride||A*m,E=new Float32Array(d);for(let y=0;y<a.count;y++){let C=new l(f,u+y*p,2);rs.set(C[0],C[1],1),rs.transformByMatrix3(s),E.set([rs[0],rs[1]],y*m)}n===o?px(a,c,e.buffers,E):gx(o,a,t,e,E)}}}}function px(e,t,r,n){e.componentType=5126,r.push({arrayBuffer:n.buffer,byteOffset:0,byteLength:n.buffer.byteLength}),t.buffer=r.length-1,t.byteLength=n.buffer.byteLength,t.byteOffset=0,delete t.byteStride}function gx(e,t,r,n,o){n.buffers.push({arrayBuffer:o.buffer,byteOffset:0,byteLength:o.buffer.byteLength});let s=n.json.bufferViews;if(!s)return;s.push({buffer:n.buffers.length-1,byteLength:o.buffer.byteLength,byteOffset:0});let i=n.json.accessors;i&&(i.push({bufferView:s?.length-1,byteOffset:0,componentType:5126,count:t.count,type:"VEC2"}),r.attributes[`TEXCOORD_${e}`]=i.length-1)}function xx(e){let{offset:t=[0,0],rotation:r=0,scale:n=[1,1]}=e,o=new he().set(1,0,0,0,1,0,t[0],t[1],1),s=fx.set(Math.cos(r),Math.sin(r),0,-Math.sin(r),Math.cos(r),0,0,0,1),i=hx.set(n[0],0,0,0,n[1],0,0,0,1);return o.multiplyRight(s).multiplyRight(i)}var Ca={};ut(Ca,{decode:()=>Ex,encode:()=>_x,name:()=>Bx});var Ze="KHR_lights_punctual",Bx=Ze;async function Ex(e){let t=new K(e),{json:r}=t,n=t.getExtension(Ze);n&&(t.json.lights=n.lights,t.removeExtension(Ze));for(let o of r.nodes||[]){let s=t.getObjectExtension(o,Ze);s&&(o.light=s.light),t.removeObjectExtension(o,Ze)}}async function _x(e){let t=new K(e),{json:r}=t;if(r.lights){let n=t.addExtension(Ze);st(!n.lights),n.lights=r.lights,delete r.lights}if(t.json.lights){for(let n of t.json.lights){let o=n.node;t.addObjectExtension(o,Ze,n)}delete t.json.lights}}var Ma={};ut(Ma,{decode:()=>Tx,encode:()=>Cx,name:()=>yx});var Pn="KHR_materials_unlit",yx=Pn;async function Tx(e){let t=new K(e),{json:r}=t;for(let n of r.materials||[])n.extensions&&n.extensions.KHR_materials_unlit&&(n.unlit=!0),t.removeObjectExtension(n,Pn);t.removeExtension(Pn)}function Cx(e){let t=new K(e),{json:r}=t;if(t.materials)for(let n of r.materials||[])n.unlit&&(delete n.unlit,t.addObjectExtension(n,Pn,{}),t.addExtension(Pn))}var ba={};ut(ba,{decode:()=>bx,encode:()=>wx,name:()=>Mx});var Un="KHR_techniques_webgl",Mx=Un;async function bx(e){let t=new K(e),{json:r}=t,n=t.getExtension(Un);if(n){let o=Ix(n,t);for(let s of r.materials||[]){let i=t.getObjectExtension(s,Un);i&&(s.technique=Object.assign({},i,o[i.technique]),s.technique.values=Sx(s.technique,t)),t.removeObjectExtension(s,Un)}t.removeExtension(Un)}}async function wx(e,t){}function Ix(e,t){let{programs:r=[],shaders:n=[],techniques:o=[]}=e,s=new TextDecoder;return n.forEach(i=>{if(Number.isFinite(i.bufferView))i.code=s.decode(t.getTypedArrayForBufferView(i.bufferView));else throw new Error("KHR_techniques_webgl: no shader code")}),r.forEach(i=>{i.fragmentShader=n[i.fragmentShader],i.vertexShader=n[i.vertexShader]}),o.forEach(i=>{i.program=r[i.program]}),o}function Sx(e,t){let r=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach(n=>{e.uniforms[n].value&&!(n in r)&&(r[n]=e.uniforms[n].value)}),Object.keys(r).forEach(n=>{typeof r[n]=="object"&&r[n].index!==void 0&&(r[n].texture=t.getTexture(r[n].index))}),r}var Fl=[sa,ra,xa,Ba,Ea,ya,Ca,Ma,ba,Ta,ia];function Dl(e,t={},r){let n=Fl.filter(o=>Ll(o.name,t));for(let o of n)o.preprocess?.(e,t,r)}async function Ol(e,t={},r){let n=Fl.filter(o=>Ll(o.name,t));for(let o of n)await o.decode?.(e,t,r)}function Ll(e,t){let r=t?.gltf?.excludeExtensions||{};return!(e in r&&!r[e])}var wa="KHR_binary_glTF";function vl(e){let t=new K(e),{json:r}=t;for(let n of r.images||[]){let o=t.getObjectExtension(n,wa);o&&Object.assign(n,o),t.removeObjectExtension(n,wa)}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,t.removeExtension(wa)}var Nl={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},Fx={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},Ia=class{idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}};json;normalize(t,r){this.json=t.json;let n=t.json;switch(n.asset&&n.asset.version){case"2.0":return;case void 0:case"1.0":break;default:console.warn(`glTF: Unknown version ${n.asset.version}`);return}if(!r.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(n),this._convertTopLevelObjectsToArrays(n),vl(t),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n),this._updateMaterial(n)}_addAsset(t){t.asset=t.asset||{},t.asset.version="2.0",t.asset.generator=t.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(t){for(let r in Nl)this._convertTopLevelObjectToArray(t,r)}_convertTopLevelObjectToArray(t,r){let n=t[r];if(!(!n||Array.isArray(n))){t[r]=[];for(let o in n){let s=n[o];s.id=s.id||o;let i=t[r].length;t[r].push(s),this.idToIndexMap[r][o]=i}}}_convertObjectIdsToArrayIndices(t){for(let r in Nl)this._convertIdsToIndices(t,r);"scene"in t&&(t.scene=this._convertIdToIndex(t.scene,"scene"));for(let r of t.textures)this._convertTextureIds(r);for(let r of t.meshes)this._convertMeshIds(r);for(let r of t.nodes)this._convertNodeIds(r);for(let r of t.scenes)this._convertSceneIds(r)}_convertTextureIds(t){t.source&&(t.source=this._convertIdToIndex(t.source,"image"))}_convertMeshIds(t){for(let r of t.primitives){let{attributes:n,indices:o,material:s}=r;for(let i in n)n[i]=this._convertIdToIndex(n[i],"accessor");o&&(r.indices=this._convertIdToIndex(o,"accessor")),s&&(r.material=this._convertIdToIndex(s,"material"))}}_convertNodeIds(t){t.children&&(t.children=t.children.map(r=>this._convertIdToIndex(r,"node"))),t.meshes&&(t.meshes=t.meshes.map(r=>this._convertIdToIndex(r,"mesh")))}_convertSceneIds(t){t.nodes&&(t.nodes=t.nodes.map(r=>this._convertIdToIndex(r,"node")))}_convertIdsToIndices(t,r){t[r]||(console.warn(`gltf v1: json doesn't contain attribute ${r}`),t[r]=[]);for(let n of t[r])for(let o in n){let s=n[o],i=this._convertIdToIndex(s,o);n[o]=i}}_convertIdToIndex(t,r){let n=Fx[r];if(n in this.idToIndexMap){let o=this.idToIndexMap[n][t];if(!Number.isFinite(o))throw new Error(`gltf v1: failed to resolve ${r} with id ${t}`);return o}return t}_updateObjects(t){for(let r of this.json.buffers)delete r.type}_updateMaterial(t){for(let r of t.materials){r.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};let n=r.values?.tex||r.values?.texture2d_0||r.values?.diffuseTex,o=t.textures.findIndex(s=>s.id===n);o!==-1&&(r.pbrMetallicRoughness.baseColorTexture={index:o})}}};function Gl(e,t={}){return new Ia().normalize(e,t)}async function Pl(e,t,r=0,n,o){return Dx(e,t,r,n),Gl(e,{normalize:n?.gltf?.normalize}),Dl(e,n,o),n?.gltf?.loadBuffers&&e.json.buffers&&await Ox(e,n,o),n?.gltf?.loadImages&&await Lx(e,n,o),await Ol(e,n,o),e}function Dx(e,t,r,n){if(n.uri&&(e.baseUri=n.uri),t instanceof ArrayBuffer&&!bl(t,r,n)&&(t=new TextDecoder().decode(t)),typeof t=="string")e.json=Ks(t);else if(t instanceof ArrayBuffer){let i={};r=wl(i,t,r,n.glb),st(i.type==="glTF",`Invalid GLB magic string ${i.type}`),e._glb=i,e.json=i.json}else st(!1,"GLTF: must be ArrayBuffer or string");let o=e.json.buffers||[];if(e.buffers=new Array(o.length).fill(null),e._glb&&e._glb.header.hasBinChunk){let{binChunks:i}=e._glb;e.buffers[0]={arrayBuffer:i[0].arrayBuffer,byteOffset:i[0].byteOffset,byteLength:i[0].byteLength}}let s=e.json.images||[];e.images=new Array(s.length).fill({})}async function Ox(e,t,r){let n=e.json.buffers||[];for(let o=0;o<n.length;++o){let s=n[o];if(s.uri){let{fetch:i}=r;st(i);let a=pa(s.uri,t),f=await(await r?.fetch?.(a))?.arrayBuffer?.();e.buffers[o]={arrayBuffer:f,byteOffset:0,byteLength:f.byteLength},delete s.uri}else e.buffers[o]===null&&(e.buffers[o]={arrayBuffer:new ArrayBuffer(s.byteLength),byteOffset:0,byteLength:s.byteLength})}}async function Lx(e,t,r){let n=vx(e),o=e.json.images||[],s=[];for(let i of n)s.push(Nx(e,o[i],i,t,r));return await Promise.all(s)}function vx(e){let t=new Set,r=e.json.textures||[];for(let n of r)n.source!==void 0&&t.add(n.source);return Array.from(t).sort()}async function Nx(e,t,r,n,o){let s;if(t.uri&&!t.hasOwnProperty("bufferView")){let a=pa(t.uri,n),{fetch:c}=o;s=await(await c(a)).arrayBuffer(),t.bufferView={data:s}}if(Number.isFinite(t.bufferView)){let a=fl(e.json,e.buffers,t.bufferView);s=Je(a.buffer,a.byteOffset,a.byteLength)}st(s,"glTF image has no data");let i=await Ut(s,[$i,ua],{...n,mimeType:t.mimeType,basis:n.basis||{format:Wo()}},o);i&&i[0]&&(i={compressed:!0,mipmaps:!1,width:i[0].width,height:i[0].height,data:i[0]}),e.images=e.images||[],e.images[r]=i}var qe={dataType:null,batchType:null,name:"glTF",id:"gltf",module:"gltf",version:pl,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:Gx,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0},log:console}};async function Gx(e,t={},r){t={...qe.options,...t},t.gltf={...qe.options.gltf,...t.gltf};let{byteOffset:n=0}=t;return await Pl({},e,n,t,r)}var Px={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ux={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Ft={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},Hx={magFilter:Ft.TEXTURE_MAG_FILTER,minFilter:Ft.TEXTURE_MIN_FILTER,wrapS:Ft.TEXTURE_WRAP_S,wrapT:Ft.TEXTURE_WRAP_T},kx={[Ft.TEXTURE_MAG_FILTER]:Ft.LINEAR,[Ft.TEXTURE_MIN_FILTER]:Ft.NEAREST_MIPMAP_LINEAR,[Ft.TEXTURE_WRAP_S]:Ft.REPEAT,[Ft.TEXTURE_WRAP_T]:Ft.REPEAT};function Jx(){return{id:"default-sampler",parameters:kx}}function zx(e){return Ux[e]}function Qx(e){return Px[e]}var Sa=class{baseUri="";jsonUnprocessed;json;buffers=[];images=[];postProcess(t,r={}){let{json:n,buffers:o=[],images:s=[]}=t,{baseUri:i=""}=t;return st(n),this.baseUri=i,this.buffers=o,this.images=s,this.jsonUnprocessed=n,this.json=this._resolveTree(t.json,r),this.json}_resolveTree(t,r={}){let n={...t};return this.json=n,t.bufferViews&&(n.bufferViews=t.bufferViews.map((o,s)=>this._resolveBufferView(o,s))),t.images&&(n.images=t.images.map((o,s)=>this._resolveImage(o,s))),t.samplers&&(n.samplers=t.samplers.map((o,s)=>this._resolveSampler(o,s))),t.textures&&(n.textures=t.textures.map((o,s)=>this._resolveTexture(o,s))),t.accessors&&(n.accessors=t.accessors.map((o,s)=>this._resolveAccessor(o,s))),t.materials&&(n.materials=t.materials.map((o,s)=>this._resolveMaterial(o,s))),t.meshes&&(n.meshes=t.meshes.map((o,s)=>this._resolveMesh(o,s))),t.nodes&&(n.nodes=t.nodes.map((o,s)=>this._resolveNode(o,s)),n.nodes=n.nodes.map((o,s)=>this._resolveNodeChildren(o))),t.skins&&(n.skins=t.skins.map((o,s)=>this._resolveSkin(o,s))),t.scenes&&(n.scenes=t.scenes.map((o,s)=>this._resolveScene(o,s))),typeof this.json.scene=="number"&&n.scenes&&(n.scene=n.scenes[this.json.scene]),n}getScene(t){return this._get(this.json.scenes,t)}getNode(t){return this._get(this.json.nodes,t)}getSkin(t){return this._get(this.json.skins,t)}getMesh(t){return this._get(this.json.meshes,t)}getMaterial(t){return this._get(this.json.materials,t)}getAccessor(t){return this._get(this.json.accessors,t)}getCamera(t){return this._get(this.json.cameras,t)}getTexture(t){return this._get(this.json.textures,t)}getSampler(t){return this._get(this.json.samplers,t)}getImage(t){return this._get(this.json.images,t)}getBufferView(t){return this._get(this.json.bufferViews,t)}getBuffer(t){return this._get(this.json.buffers,t)}_get(t,r){if(typeof r=="object")return r;let n=t&&t[r];return n||console.warn(`glTF file error: Could not find ${t}[${r}]`),n}_resolveScene(t,r){return{...t,id:t.id||`scene-${r}`,nodes:(t.nodes||[]).map(n=>this.getNode(n))}}_resolveNode(t,r){let n={...t,id:t?.id||`node-${r}`};return t.mesh!==void 0&&(n.mesh=this.getMesh(t.mesh)),t.camera!==void 0&&(n.camera=this.getCamera(t.camera)),t.skin!==void 0&&(n.skin=this.getSkin(t.skin)),t.meshes!==void 0&&t.meshes.length&&(n.mesh=t.meshes.reduce((o,s)=>{let i=this.getMesh(s);return o.id=i.id,o.primitives=o.primitives.concat(i.primitives),o},{primitives:[]})),n}_resolveNodeChildren(t){return t.children&&(t.children=t.children.map(r=>this.getNode(r))),t}_resolveSkin(t,r){let n=typeof t.inverseBindMatrices=="number"?this.getAccessor(t.inverseBindMatrices):void 0;return{...t,id:t.id||`skin-${r}`,inverseBindMatrices:n}}_resolveMesh(t,r){let n={...t,id:t.id||`mesh-${r}`,primitives:[]};return t.primitives&&(n.primitives=t.primitives.map(o=>{let s={...o,attributes:{},indices:void 0,material:void 0},i=o.attributes;for(let a in i)s.attributes[a]=this.getAccessor(i[a]);return o.indices!==void 0&&(s.indices=this.getAccessor(o.indices)),o.material!==void 0&&(s.material=this.getMaterial(o.material)),s})),n}_resolveMaterial(t,r){let n={...t,id:t.id||`material-${r}`};if(n.normalTexture&&(n.normalTexture={...n.normalTexture},n.normalTexture.texture=this.getTexture(n.normalTexture.index)),n.occlusionTexture&&(n.occlusionTexture={...n.occlusionTexture},n.occlusionTexture.texture=this.getTexture(n.occlusionTexture.index)),n.emissiveTexture&&(n.emissiveTexture={...n.emissiveTexture},n.emissiveTexture.texture=this.getTexture(n.emissiveTexture.index)),n.emissiveFactor||(n.emissiveFactor=n.emissiveTexture?[1,1,1]:[0,0,0]),n.pbrMetallicRoughness){n.pbrMetallicRoughness={...n.pbrMetallicRoughness};let o=n.pbrMetallicRoughness;o.baseColorTexture&&(o.baseColorTexture={...o.baseColorTexture},o.baseColorTexture.texture=this.getTexture(o.baseColorTexture.index)),o.metallicRoughnessTexture&&(o.metallicRoughnessTexture={...o.metallicRoughnessTexture},o.metallicRoughnessTexture.texture=this.getTexture(o.metallicRoughnessTexture.index))}return n}_resolveAccessor(t,r){let n=zx(t.componentType),o=Qx(t.type),s=n*o,i={...t,id:t.id||`accessor-${r}`,bytesPerComponent:n,components:o,bytesPerElement:s,value:void 0,bufferView:void 0,sparse:void 0};if(t.bufferView!==void 0&&(i.bufferView=this.getBufferView(t.bufferView)),i.bufferView){let a=i.bufferView.buffer,{ArrayType:c,byteLength:f}=kr(i,i.bufferView),h=(i.bufferView.byteOffset||0)+(i.byteOffset||0)+a.byteOffset,u=a.arrayBuffer.slice(h,h+f);i.bufferView.byteStride&&(u=this._getValueFromInterleavedBuffer(a,h,i.bufferView.byteStride,i.bytesPerElement,i.count)),i.value=new c(u)}return i}_getValueFromInterleavedBuffer(t,r,n,o,s){let i=new Uint8Array(s*o);for(let a=0;a<s;a++){let c=r+a*n;i.set(new Uint8Array(t.arrayBuffer.slice(c,c+o)),a*o)}return i.buffer}_resolveTexture(t,r){return{...t,id:t.id||`texture-${r}`,sampler:typeof t.sampler=="number"?this.getSampler(t.sampler):Jx(),source:typeof t.source=="number"?this.getImage(t.source):void 0}}_resolveSampler(t,r){let n={id:t.id||`sampler-${r}`,...t,parameters:{}};for(let o in n){let s=this._enumSamplerParameter(o);s!==void 0&&(n.parameters[s]=n[o])}return n}_enumSamplerParameter(t){return Hx[t]}_resolveImage(t,r){let n={...t,id:t.id||`image-${r}`,image:null,bufferView:t.bufferView!==void 0?this.getBufferView(t.bufferView):void 0},o=this.images[r];return o&&(n.image=o),n}_resolveBufferView(t,r){let n=t.buffer,o=this.buffers[n].arrayBuffer,s=this.buffers[n].byteOffset||0;return t.byteOffset&&(s+=t.byteOffset),{id:`bufferView-${r}`,...t,buffer:this.buffers[n],data:new Uint8Array(o,s,t.byteLength)}}_resolveCamera(t,r){let n={...t,id:t.id||`camera-${r}`};return n.perspective,n.orthographic,n}};function Hn(e,t){return new Sa().postProcess(e,t)}var os={URI:0,EMBEDDED:1};function ss(e,t,r,n){e.rotateYtoZ=!0;let o=(e.byteOffset||0)+(e.byteLength||0)-r;if(o===0)throw new Error("glTF byte length must be greater than 0.");return e.gltfUpAxis=n?.["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",e.gltfArrayBuffer=Je(t,r,o),e.gltfByteOffset=0,e.gltfByteLength=o,r%4===0||console.warn(`${e.type}: embedded glb is not aligned to a 4-byte boundary.`),(e.byteOffset||0)+(e.byteLength||0)}async function is(e,t,r,n){let o=r?.["3d-tiles"]||{};if(Vx(e,t,r),o.loadGLTF){if(!n)return;if(e.gltfUrl){let{fetch:s}=n,i=await s(e.gltfUrl,r);e.gltfArrayBuffer=await i.arrayBuffer(),e.gltfByteOffset=0}if(e.gltfArrayBuffer){let s=await Ut(e.gltfArrayBuffer,qe,r,n);e.gltf=Hn(s),e.gpuMemoryUsageInBytes=Nn(e.gltf),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength}}}function Vx(e,t,r){switch(t){case os.URI:if(e.gltfArrayBuffer){let n=new Uint8Array(e.gltfArrayBuffer,e.gltfByteOffset),s=new TextDecoder().decode(n);e.gltfUrl=s.replace(/[\s\0]+$/,"")}delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength;break;case os.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}async function Ul(e,t,r,n,o){r=jx(e,t,r,n,o),await is(e,os.EMBEDDED,n,o);let s=e?.gltf?.extensions;return s&&s.CESIUM_RTC&&(e.rtcCenter=s.CESIUM_RTC.center),r}function jx(e,t,r,n,o){r=Se(e,t,r),r=Pr(e,t,r),r=Ur(e,t,r,n),r=ss(e,t,r,n);let s=new kt(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=s.getGlobalProperty("RTC_CENTER",H.FLOAT,3),r}var de=6356752314245179e-9,Kx={radii:[6378137,6378137,de],radiiSquared:[6378137*6378137,6378137*6378137,de*de],oneOverRadii:[1/6378137,1/6378137,1/de],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(de*de)],maximumRadius:Math.max(6378137,6378137,de),centerToleranceSquared:.1};function as(e){return e}var jI=new b;function Xx(e,t=[],r=as){return"longitude"in e?(t[0]=r(e.longitude),t[1]=r(e.latitude),t[2]=e.height):"x"in e?(t[0]=r(e.x),t[1]=r(e.y),t[2]=e.z):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function Hl(e,t=[]){return Xx(e,t,q._cartographicRadians?as:pi)}function Yx(e,t,r=as){return"longitude"in t?(t.longitude=r(e[0]),t.latitude=r(e[1]),t.height=e[2]):"x"in t?(t.x=r(e[0]),t.y=r(e[1]),t.z=e[2]):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function kl(e,t){return Yx(e,t,q._cartographicRadians?as:gi)}var Jl=1e-14,Zx=new b,zl={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},Ra={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},kn={east:new b,north:new b,up:new b,west:new b,south:new b,down:new b},qx=new b,Wx=new b,$x=new b;function Fa(e,t,r,n,o,s){let i=zl[t]&&zl[t][r];ft(i&&(!n||n===i));let a,c,f,h=Zx.copy(o);if(wt(h.x,0,Jl)&&wt(h.y,0,Jl)){let l=Math.sign(h.z);a=qx.fromArray(Ra[t]),t!=="east"&&t!=="west"&&a.scale(l),c=Wx.fromArray(Ra[r]),r!=="east"&&r!=="west"&&c.scale(l),f=$x.fromArray(Ra[n]),n!=="east"&&n!=="west"&&f.scale(l)}else{let{up:l,east:d,north:A}=kn;d.set(-h.y,h.x,0).normalize(),e.geodeticSurfaceNormal(h,l),A.copy(l).cross(d);let{down:m,west:p,south:E}=kn;m.copy(l).scale(-1),p.copy(d).scale(-1),E.copy(A).scale(-1),a=kn[t],c=kn[r],f=kn[n]}return s[0]=a.x,s[1]=a.y,s[2]=a.z,s[3]=0,s[4]=c.x,s[5]=c.y,s[6]=c.z,s[7]=0,s[8]=f.x,s[9]=f.y,s[10]=f.z,s[11]=0,s[12]=h.x,s[13]=h.y,s[14]=h.z,s[15]=1,s}var Kr=new b,tB=new b,eB=new b;function Ql(e,t,r=[]){let{oneOverRadii:n,oneOverRadiiSquared:o,centerToleranceSquared:s}=t;Kr.from(e);let i=Kr.x,a=Kr.y,c=Kr.z,f=n.x,h=n.y,u=n.z,l=i*i*f*f,d=a*a*h*h,A=c*c*u*u,m=l+d+A,p=Math.sqrt(1/m);if(!Number.isFinite(p))return;let E=tB;if(E.copy(e).scale(p),m<s)return E.to(r);let y=o.x,C=o.y,M=o.z,T=eB;T.set(E.x*y*2,E.y*C*2,E.z*M*2);let I=(1-p)*Kr.len()/(.5*T.len()),w=0,O,x,g,B;do{I-=w,O=1/(1+I*y),x=1/(1+I*C),g=1/(1+I*M);let _=O*O,P=x*x,G=g*g,U=_*O,v=P*x,at=G*g;B=l*_+d*P+A*G-1;let X=-2*(l*U*y+d*v*C+A*at*M);w=B/X}while(Math.abs(B)>Ht.EPSILON12);return Kr.scale([O,x,g]).to(r)}var cs=new b,Vl=new b,oB=new b,Jt=new b,sB=new b,fs=new b,Ae=class{constructor(t=0,r=0,n=0){this.centerToleranceSquared=Ht.EPSILON1,ft(t>=0),ft(r>=0),ft(n>=0),this.radii=new b(t,r,n),this.radiiSquared=new b(t*t,r*r,n*n),this.radiiToTheFourth=new b(t*t*t*t,r*r*r*r,n*n*n*n),this.oneOverRadii=new b(t===0?0:1/t,r===0?0:1/r,n===0?0:1/n),this.oneOverRadiiSquared=new b(t===0?0:1/(t*t),r===0?0:1/(r*r),n===0?0:1/(n*n)),this.minimumRadius=Math.min(t,r,n),this.maximumRadius=Math.max(t,r,n),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(t){return this===t||Boolean(t&&this.radii.equals(t.radii))}toString(){return this.radii.toString()}cartographicToCartesian(t,r=[0,0,0]){let n=Vl,o=oB,[,,s]=t;this.geodeticSurfaceNormalCartographic(t,n),o.copy(this.radiiSquared).scale(n);let i=Math.sqrt(n.dot(o));return o.scale(1/i),n.scale(s),o.add(n),o.to(r)}cartesianToCartographic(t,r=[0,0,0]){fs.from(t);let n=this.scaleToGeodeticSurface(fs,Jt);if(!n)return;let o=this.geodeticSurfaceNormal(n,Vl),s=sB;s.copy(fs).subtract(n);let i=Math.atan2(o.y,o.x),a=Math.asin(o.z),c=Math.sign(Ke.dot(s,fs))*Ke.length(s);return kl([i,a,c],r)}eastNorthUpToFixedFrame(t,r=new Rt){return Fa(this,"east","north","up",t,r)}localFrameToFixedFrame(t,r,n,o,s=new Rt){return Fa(this,t,r,n,o,s)}geocentricSurfaceNormal(t,r=[0,0,0]){return cs.from(t).normalize().to(r)}geodeticSurfaceNormalCartographic(t,r=[0,0,0]){let n=Hl(t),o=n[0],s=n[1],i=Math.cos(s);return cs.set(i*Math.cos(o),i*Math.sin(o),Math.sin(s)).normalize(),cs.to(r)}geodeticSurfaceNormal(t,r=[0,0,0]){return cs.from(t).scale(this.oneOverRadiiSquared).normalize().to(r)}scaleToGeodeticSurface(t,r){return Ql(t,this,r)}scaleToGeocentricSurface(t,r=[0,0,0]){Jt.from(t);let n=Jt.x,o=Jt.y,s=Jt.z,i=this.oneOverRadiiSquared,a=1/Math.sqrt(n*n*i.x+o*o*i.y+s*s*i.z);return Jt.multiplyScalar(a).to(r)}transformPositionToScaledSpace(t,r=[0,0,0]){return Jt.from(t).scale(this.oneOverRadii).to(r)}transformPositionFromScaledSpace(t,r=[0,0,0]){return Jt.from(t).scale(this.radii).to(r)}getSurfaceNormalIntersectionWithZAxis(t,r=0,n=[0,0,0]){ft(wt(this.radii.x,this.radii.y,Ht.EPSILON15)),ft(this.radii.z>0),Jt.from(t);let o=Jt.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(o)>=this.radii.z-r))return Jt.set(0,0,o).to(n)}};Ae.WGS84=new Ae(6378137,6378137,de);async function jl(e,t,r,n,o){return r=iB(e,t,r,n,o),await is(e,e.gltfFormat||0,n,o),r}function iB(e,t,r,n,o){if(r=Se(e,t,r),e.version!==1)throw new Error(`Instanced 3D Model version ${e.version} is not supported`);r=Pr(e,t,r);let s=new DataView(t);if(e.gltfFormat=s.getUint32(r,!0),r+=4,r=Ur(e,t,r,n),r=ss(e,t,r,n),!e?.header?.featureTableJsonByteLength||e.header.featureTableJsonByteLength===0)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");let i=new kt(e.featureTableJson,e.featureTableBinary),a=i.getGlobalProperty("INSTANCES_LENGTH");if(i.featuresLength=a,!Number.isFinite(a))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");e.eastNorthUp=i.getGlobalProperty("EAST_NORTH_UP"),e.rtcCenter=i.getGlobalProperty("RTC_CENTER",H.FLOAT,3);let c=new ue(e.batchTableJson,e.batchTableBinary,a);return aB(e,i,c,a),r}function aB(e,t,r,n){let o=new Array(n),s=new b,i=new b,a=new b,c=new b,f=new Z,h=new Ie,u=new b,l={},d=new Rt,A=[],m=[],p=[],E=[];for(let y=0;y<n;y++){let C;if(t.hasProperty("POSITION"))C=t.getProperty("POSITION",H.FLOAT,3,y,s);else if(t.hasProperty("POSITION_QUANTIZED")){C=t.getProperty("POSITION_QUANTIZED",H.UNSIGNED_SHORT,3,y,s);let g=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",H.FLOAT,3);if(!g)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let B=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",H.FLOAT,3);if(!B)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let _=65535;for(let P=0;P<3;P++)C[P]=C[P]/_*B[P]+g[P]}if(!C)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");s.copy(C),l.translation=s,e.normalUp=t.getProperty("NORMAL_UP",H.FLOAT,3,y,A),e.normalRight=t.getProperty("NORMAL_RIGHT",H.FLOAT,3,y,m);let M=!1;if(e.normalUp){if(!e.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");e.hasCustomOrientation=!0}else{if(e.octNormalUp=t.getProperty("NORMAL_UP_OCT32P",H.UNSIGNED_SHORT,2,y,A),e.octNormalRight=t.getProperty("NORMAL_RIGHT_OCT32P",H.UNSIGNED_SHORT,2,y,m),e.octNormalUp)throw e.octNormalRight?new Error("i3dm: oct-encoded orientation not implemented"):new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");e.eastNorthUp?(Ae.WGS84.eastNorthUpToFixedFrame(s,d),d.getRotationMatrix3(f)):f.identity()}M&&(c.copy(i).cross(a).normalize(),f.setColumn(0,i),f.setColumn(1,a),f.setColumn(2,c)),h.fromMatrix3(f),l.rotation=h,u.set(1,1,1);let T=t.getProperty("SCALE",H.FLOAT,1,y,p);Number.isFinite(T)&&u.multiplyByScalar(T);let I=t.getProperty("SCALE_NON_UNIFORM",H.FLOAT,3,y,A);I&&u.scale(I),l.scale=u;let w=t.getProperty("BATCH_ID",H.UNSIGNED_SHORT,1,y,E);w===void 0&&(w=y);let O=new Rt().fromQuaternion(l.rotation);d.identity(),d.translate(l.translation),d.multiplyRight(O),d.scale(l.scale);let x=d.clone();o[y]={modelMatrix:x,batchId:w}}e.instances=o}async function Kl(e,t,r,n,o,s){r=Se(e,t,r);let i=new DataView(t);for(e.tilesLength=i.getUint32(r,!0),r+=4,e.tiles=[];e.tiles.length<e.tilesLength&&(e.byteLength||0)-r>12;){let a={shape:"tile3d"};e.tiles.push(a),r=await s(t,r,n,o,a)}return r}async function Xl(e,t,r,n){if(e.rotateYtoZ=!0,e.gltfUpAxis=r?.["3d-tiles"]?.assetGltfUpAxis?r["3d-tiles"].assetGltfUpAxis:"Y",r?.["3d-tiles"]?.loadGLTF){if(!n)return t.byteLength;let o=await Ut(t,qe,r,n);e.gltf=Hn(o),e.gpuMemoryUsageInBytes=Nn(e.gltf)}else e.gltfArrayBuffer=t;return t.byteLength}async function Da(e,t=0,r,n,o={shape:"tile3d"}){switch(o.byteOffset=t,o.type=Rf(e,t),o.type){case _t.COMPOSITE:return await Kl(o,e,t,r,n,Da);case _t.BATCHED_3D_MODEL:return await Ul(o,e,t,r,n);case _t.GLTF:return await Xl(o,e,r,n);case _t.INSTANCED_3D_MODEL:return await jl(o,e,t,r,n);case _t.POINT_CLOUD:return await qh(o,e,t,r,n);default:throw new Error(`3DTileLoader: unknown type ${o.type}`)}}async function Oa(e,t,r){if(new Uint32Array(e.slice(0,4))[0]!==1952609651)throw new Error("Wrong subtree file magic number");if(new Uint32Array(e.slice(4,8))[0]!==1)throw new Error("Wrong subtree file verson, must be 1");let s=Yl(e.slice(8,16)),i=new Uint8Array(e,24,s),c=new TextDecoder("utf8").decode(i),f=JSON.parse(c),h=Yl(e.slice(16,24)),u=new ArrayBuffer(0);if(h&&(u=e.slice(24+s)),await hs(f,f.tileAvailability,u,r),Array.isArray(f.contentAvailability))for(let l of f.contentAvailability)await hs(f,l,u,r);else await hs(f,f.contentAvailability,u,r);return await hs(f,f.childSubtreeAvailability,u,r),f}async function hs(e,t,r,n){let o=Number.isFinite(t.bitstream)?t.bitstream:t.bufferView;if(typeof o!="number")return;let s=e.bufferViews[o],i=e.buffers[s.buffer];if(!n?.baseUrl)throw new Error("Url is not provided");if(!n.fetch)throw new Error("fetch is not provided");if(i.uri){let c=`${n?.baseUrl||""}/${i.uri}`,h=await(await n.fetch(c)).arrayBuffer();t.explicitBitstream=new Uint8Array(h,s.byteOffset,s.byteLength);return}let a=e.buffers.slice(0,s.buffer).reduce((c,f)=>c+f.byteLength,0);t.explicitBitstream=new Uint8Array(r.slice(a,a+i.byteLength),s.byteOffset,s.byteLength)}function Yl(e){let t=new DataView(e),r=t.getUint32(0,!0),n=t.getUint32(4,!0);return r+2**32*n}var Xr={dataType:null,batchType:null,id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:Rr,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:Oa,options:{}};var Du=xr(gn(),1);var Iu=xr(gn(),1);function La(e){if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&Boolean(process.versions.electron))return!0;let t=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}function zt(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||La()}var cB=globalThis.self||globalThis.window||globalThis.global,Yr=globalThis.window||globalThis.self||globalThis.global,fB=globalThis.document||{},We=globalThis.process||{},hB=globalThis.console,GS=globalThis.navigator||{};var ls=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",HS=zt();function lB(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var us=class{constructor(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";this.storage=void 0,this.id=void 0,this.config=void 0,this.storage=lB(n),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}};function Zl(e){let t;return e<10?t="".concat(e.toFixed(2),"ms"):e<100?t="".concat(e.toFixed(1),"ms"):e<1e3?t="".concat(e.toFixed(0),"ms"):t="".concat((e/1e3).toFixed(2),"s"),t}function ql(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}function ds(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,o=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));let s=e.width*r,i=e.height*r,a=["font-size:1px;","padding:".concat(Math.floor(i/2),"px ").concat(Math.floor(s/2),"px;"),"line-height:".concat(i,"px;"),"background:url(".concat(o,");"),"background-size:".concat(s,"px ").concat(i,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),a]}var As;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(As||(As={}));var uB=10;function Wl(e){return typeof e!="string"?e:(e=e.toUpperCase(),As[e]||As.WHITE)}function $l(e,t,r){if(!zt&&typeof e=="string"){if(t){let n=Wl(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=Wl(r);e="\x1B[".concat(n+uB,"m").concat(e,"\x1B[49m")}}return e}function tu(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),o=e;for(let s of n){let i=o[s];typeof i=="function"&&(t.find(a=>s===a)||(o[s]=i.bind(e)))}}function Zr(e,t){if(!e)throw new Error(t||"Assertion failed")}function $e(){let e;if(zt()&&Yr.performance){var t,r;e=Yr===null||Yr===void 0||(t=Yr.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in We){var n;let o=We===null||We===void 0||(n=We.hrtime)===null||n===void 0?void 0:n.call(We);e=o[0]*1e3+o[1]/1e6}else e=Date.now();return e}var qr={debug:zt()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},dB={enabled:!0,level:0};function Dt(){}var eu={},ru={once:!0},Jn=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=ls,this._startTs=$e(),this._deltaTs=$e(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new us("__probe-".concat(this.id,"__"),dB),this.timeStamp("".concat(this.id," started")),tu(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number(($e()-this._startTs).toPrecision(10))}getDelta(){return Number(($e()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,r){this._storage.setConfiguration({[t]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,r){Zr(t,r)}warn(t){return this._getLogFunction(0,t,qr.warn,arguments,ru)}error(t){return this._getLogFunction(0,t,qr.error,arguments)}deprecated(t,r){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(t,r){return this.error("`".concat(t,"` has been removed. Use `").concat(r,"` instead"))}probe(t,r){return this._getLogFunction(t,r,qr.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,qr.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,qr.debug||qr.info,arguments,ru)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||Dt,n&&[n],{tag:gB(r)}):Dt}image(t){let{logLevel:r,priority:n,image:o,message:s="",scale:i=1}=t;return this._shouldLog(r||n)?zt()?pB({image:o,message:s,scale:i}):mB({image:o,message:s,scale:i}):Dt}time(t,r){return this._getLogFunction(t,r,console.time?console.time:console.info)}timeEnd(t,r){return this._getLogFunction(t,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,r){return this._getLogFunction(t,r,console.timeStamp||Dt)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},o=nu({logLevel:t,message:r,opts:n}),{collapsed:s}=n;return o.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(o)}groupCollapsed(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,r,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||Dt)}withGroup(t,r,n){this.group(t,r)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=ou(t)}_getLogFunction(t,r,n,o,s){if(this._shouldLog(t)){s=nu({logLevel:t,message:r,args:o,opts:s}),n=n||s.method,Zr(n),s.total=this.getTotal(),s.delta=this.getDelta(),this._deltaTs=$e();let i=s.tag||s.message;if(s.once&&i)if(!eu[i])eu[i]=$e();else return Dt;return r=AB(this.id,s.message,s),n.bind(console,r,...s.args)}return Dt}};Jn.VERSION=ls;function ou(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return Zr(Number.isFinite(t)&&t>=0),t}function nu(e){let{logLevel:t,message:r}=e;e.logLevel=ou(t);let n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let o=typeof e.message;return Zr(o==="string"||o==="object"),Object.assign(e,{args:n},e.opts)}function AB(e,t,r){if(typeof t=="string"){let n=r.time?ql(Zl(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=$l(t,r.color,r.background)}return t}function mB(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),Dt}function pB(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let s=new Image;return s.onload=()=>{let i=ds(s,r,n);console.log(...i)},s.src=t,Dt}let o=t.nodeName||"";if(o.toLowerCase()==="img")return console.log(...ds(t,r,n)),Dt;if(o.toLowerCase()==="canvas"){let s=new Image;return s.onload=()=>console.log(...ds(s,r,n)),s.src=t.toDataURL(),Dt}return Dt}function gB(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var va=new Jn({id:"@probe.gl/log"});var Ot=null;try{Ot=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function Y(e,t,r){this.low=e|0,this.high=t|0,this.unsigned=!!r}Y.prototype.__isLong__;Object.defineProperty(Y.prototype,"__isLong__",{value:!0});function At(e){return(e&&e.__isLong__)===!0}function su(e){var t=Math.clz32(e&-e);return e?31-t:t}Y.isLong=At;var iu={},au={};function tr(e,t){var r,n,o;return t?(e>>>=0,(o=0<=e&&e<256)&&(n=au[e],n)?n:(r=Q(e,0,!0),o&&(au[e]=r),r)):(e|=0,(o=-128<=e&&e<128)&&(n=iu[e],n)?n:(r=Q(e,e<0?-1:0,!1),o&&(iu[e]=r),r))}Y.fromInt=tr;function Lt(e,t){if(isNaN(e))return t?me:Qt;if(t){if(e<0)return me;if(e>=lu)return Au}else{if(e<=-fu)return Ct;if(e+1>=fu)return du}return e<0?Lt(-e,t).neg():Q(e%$r|0,e/$r|0,t)}Y.fromNumber=Lt;function Q(e,t,r){return new Y(e,t,r)}Y.fromBits=Q;var ms=Math.pow;function Ga(e,t,r){if(e.length===0)throw Error("empty string");if(typeof t=="number"?(r=t,t=!1):t=!!t,e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return t?me:Qt;if(r=r||10,r<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(n===0)return Ga(e.substring(1),t,r).neg();for(var o=Lt(ms(r,8)),s=Qt,i=0;i<e.length;i+=8){var a=Math.min(8,e.length-i),c=parseInt(e.substring(i,i+a),r);if(a<8){var f=Lt(ms(r,a));s=s.mul(f).add(Lt(c))}else s=s.mul(o),s=s.add(Lt(c))}return s.unsigned=t,s}Y.fromString=Ga;function Vt(e,t){return typeof e=="number"?Lt(e,t):typeof e=="string"?Ga(e,t):Q(e.low,e.high,typeof t=="boolean"?t:e.unsigned)}Y.fromValue=Vt;var cu=1<<16,xB=1<<24,$r=cu*cu,lu=$r*$r,fu=lu/2,hu=tr(xB),Qt=tr(0);Y.ZERO=Qt;var me=tr(0,!0);Y.UZERO=me;var Wr=tr(1);Y.ONE=Wr;var uu=tr(1,!0);Y.UONE=uu;var Na=tr(-1);Y.NEG_ONE=Na;var du=Q(-1,2147483647,!1);Y.MAX_VALUE=du;var Au=Q(-1,-1,!0);Y.MAX_UNSIGNED_VALUE=Au;var Ct=Q(0,-2147483648,!1);Y.MIN_VALUE=Ct;var L=Y.prototype;L.toInt=function(){return this.unsigned?this.low>>>0:this.low};L.toNumber=function(){return this.unsigned?(this.high>>>0)*$r+(this.low>>>0):this.high*$r+(this.low>>>0)};L.toString=function(t){if(t=t||10,t<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(Ct)){var r=Lt(t),n=this.div(r),o=n.mul(r).sub(this);return n.toString(t)+o.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var s=Lt(ms(t,6),this.unsigned),i=this,a="";;){var c=i.div(s),f=i.sub(c.mul(s)).toInt()>>>0,h=f.toString(t);if(i=c,i.isZero())return h+a;for(;h.length<6;)h="0"+h;a=""+h+a}};L.getHighBits=function(){return this.high};L.getHighBitsUnsigned=function(){return this.high>>>0};L.getLowBits=function(){return this.low};L.getLowBitsUnsigned=function(){return this.low>>>0};L.getNumBitsAbs=function(){if(this.isNegative())return this.eq(Ct)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,r=31;r>0&&!(t&1<<r);r--);return this.high!=0?r+33:r+1};L.isZero=function(){return this.high===0&&this.low===0};L.eqz=L.isZero;L.isNegative=function(){return!this.unsigned&&this.high<0};L.isPositive=function(){return this.unsigned||this.high>=0};L.isOdd=function(){return(this.low&1)===1};L.isEven=function(){return(this.low&1)===0};L.equals=function(t){return At(t)||(t=Vt(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low};L.eq=L.equals;L.notEquals=function(t){return!this.eq(t)};L.neq=L.notEquals;L.ne=L.notEquals;L.lessThan=function(t){return this.comp(t)<0};L.lt=L.lessThan;L.lessThanOrEqual=function(t){return this.comp(t)<=0};L.lte=L.lessThanOrEqual;L.le=L.lessThanOrEqual;L.greaterThan=function(t){return this.comp(t)>0};L.gt=L.greaterThan;L.greaterThanOrEqual=function(t){return this.comp(t)>=0};L.gte=L.greaterThanOrEqual;L.ge=L.greaterThanOrEqual;L.compare=function(t){if(At(t)||(t=Vt(t)),this.eq(t))return 0;var r=this.isNegative(),n=t.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1};L.comp=L.compare;L.negate=function(){return!this.unsigned&&this.eq(Ct)?Ct:this.not().add(Wr)};L.neg=L.negate;L.add=function(t){At(t)||(t=Vt(t));var r=this.high>>>16,n=this.high&65535,o=this.low>>>16,s=this.low&65535,i=t.high>>>16,a=t.high&65535,c=t.low>>>16,f=t.low&65535,h=0,u=0,l=0,d=0;return d+=s+f,l+=d>>>16,d&=65535,l+=o+c,u+=l>>>16,l&=65535,u+=n+a,h+=u>>>16,u&=65535,h+=r+i,h&=65535,Q(l<<16|d,h<<16|u,this.unsigned)};L.subtract=function(t){return At(t)||(t=Vt(t)),this.add(t.neg())};L.sub=L.subtract;L.multiply=function(t){if(this.isZero())return this;if(At(t)||(t=Vt(t)),Ot){var r=Ot.mul(this.low,this.high,t.low,t.high);return Q(r,Ot.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?me:Qt;if(this.eq(Ct))return t.isOdd()?Ct:Qt;if(t.eq(Ct))return this.isOdd()?Ct:Qt;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(hu)&&t.lt(hu))return Lt(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,o=this.high&65535,s=this.low>>>16,i=this.low&65535,a=t.high>>>16,c=t.high&65535,f=t.low>>>16,h=t.low&65535,u=0,l=0,d=0,A=0;return A+=i*h,d+=A>>>16,A&=65535,d+=s*h,l+=d>>>16,d&=65535,d+=i*f,l+=d>>>16,d&=65535,l+=o*h,u+=l>>>16,l&=65535,l+=s*f,u+=l>>>16,l&=65535,l+=i*c,u+=l>>>16,l&=65535,u+=n*h+o*f+s*c+i*a,u&=65535,Q(d<<16|A,u<<16|l,this.unsigned)};L.mul=L.multiply;L.divide=function(t){if(At(t)||(t=Vt(t)),t.isZero())throw Error("division by zero");if(Ot){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var r=(this.unsigned?Ot.div_u:Ot.div_s)(this.low,this.high,t.low,t.high);return Q(r,Ot.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?me:Qt;var n,o,s;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return me;if(t.gt(this.shru(1)))return uu;s=me}else{if(this.eq(Ct)){if(t.eq(Wr)||t.eq(Na))return Ct;if(t.eq(Ct))return Wr;var i=this.shr(1);return n=i.div(t).shl(1),n.eq(Qt)?t.isNegative()?Wr:Na:(o=this.sub(t.mul(n)),s=n.add(o.div(t)),s)}else if(t.eq(Ct))return this.unsigned?me:Qt;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();s=Qt}for(o=this;o.gte(t);){n=Math.max(1,Math.floor(o.toNumber()/t.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),c=a<=48?1:ms(2,a-48),f=Lt(n),h=f.mul(t);h.isNegative()||h.gt(o);)n-=c,f=Lt(n,this.unsigned),h=f.mul(t);f.isZero()&&(f=Wr),s=s.add(f),o=o.sub(h)}return s};L.div=L.divide;L.modulo=function(t){if(At(t)||(t=Vt(t)),Ot){var r=(this.unsigned?Ot.rem_u:Ot.rem_s)(this.low,this.high,t.low,t.high);return Q(r,Ot.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))};L.mod=L.modulo;L.rem=L.modulo;L.not=function(){return Q(~this.low,~this.high,this.unsigned)};L.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};L.clz=L.countLeadingZeros;L.countTrailingZeros=function(){return this.low?su(this.low):su(this.high)+32};L.ctz=L.countTrailingZeros;L.and=function(t){return At(t)||(t=Vt(t)),Q(this.low&t.low,this.high&t.high,this.unsigned)};L.or=function(t){return At(t)||(t=Vt(t)),Q(this.low|t.low,this.high|t.high,this.unsigned)};L.xor=function(t){return At(t)||(t=Vt(t)),Q(this.low^t.low,this.high^t.high,this.unsigned)};L.shiftLeft=function(t){return At(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Q(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):Q(0,this.low<<t-32,this.unsigned)};L.shl=L.shiftLeft;L.shiftRight=function(t){return At(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Q(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):Q(this.high>>t-32,this.high>=0?0:-1,this.unsigned)};L.shr=L.shiftRight;L.shiftRightUnsigned=function(t){return At(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Q(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?Q(this.high,0,this.unsigned):Q(this.high>>>t-32,0,this.unsigned)};L.shru=L.shiftRightUnsigned;L.shr_u=L.shiftRightUnsigned;L.rotateLeft=function(t){var r;return At(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?Q(this.high,this.low,this.unsigned):t<32?(r=32-t,Q(this.low<<t|this.high>>>r,this.high<<t|this.low>>>r,this.unsigned)):(t-=32,r=32-t,Q(this.high<<t|this.low>>>r,this.low<<t|this.high>>>r,this.unsigned))};L.rotl=L.rotateLeft;L.rotateRight=function(t){var r;return At(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?Q(this.high,this.low,this.unsigned):t<32?(r=32-t,Q(this.high<<r|this.low>>>t,this.low<<r|this.high>>>t,this.unsigned)):(t-=32,r=32-t,Q(this.low<<r|this.high>>>t,this.high<<r|this.low>>>t,this.unsigned))};L.rotr=L.rotateRight;L.toSigned=function(){return this.unsigned?Q(this.low,this.high,!1):this};L.toUnsigned=function(){return this.unsigned?this:Q(this.low,this.high,!0)};L.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()};L.toBytesLE=function(){var t=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]};L.toBytesBE=function(){var t=this.high,r=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,r>>>24,r>>>16&255,r>>>8&255,r&255]};Y.fromBytes=function(t,r,n){return n?Y.fromBytesLE(t,r):Y.fromBytesBE(t,r)};Y.fromBytesLE=function(t,r){return new Y(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r)};Y.fromBytesBE=function(t,r){return new Y(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],r)};var tn=Y;var BB=16;function zn(e){e==="X"&&(e="");let t=e.padEnd(BB,"0");return tn.fromString(t,!0,16)}function Pa(e){if(e.isZero())return"X";let t=e.countTrailingZeros(),r=t%4;t=(t-r)/4;let n=t;t*=4;let s=e.shiftRightUnsigned(t).toString(16).replace(/0+$/,"");return Array(17-n-s.length).join("0")+s}function Ua(e,t){let r=EB(e).shiftRightUnsigned(2);return e.add(tn.fromNumber(2*t+1-4).multiply(r))}function EB(e){return e.and(e.not().add(1))}var _B=3,yB=30,TB=2*yB+1,mu=180/Math.PI;function gu(e){if(e.length===0)throw new Error(`Invalid Hilbert quad key ${e}`);let t=e.split("/"),r=parseInt(t[0],10),n=t[1],o=n.length,s=0,i=[0,0];for(let a=o-1;a>=0;a--){s=o-a;let c=n[a],f=0,h=0;c==="1"?h=1:c==="2"?(f=1,h=1):c==="3"&&(f=1);let u=Math.pow(2,s-1);CB(u,i,f,h),i[0]+=u*f,i[1]+=u*h}if(r%2===1){let a=i[0];i[0]=i[1],i[1]=a}return{face:r,ij:i,level:s}}function xu(e){if(e.isZero())return"";let t=e.toString(2);for(;t.length<_B+TB;)t="0"+t;let r=t.lastIndexOf("1"),n=t.substring(0,3),o=t.substring(3,r),s=o.length/2,i=tn.fromString(n,!0,2).toString(10),a="";if(s!==0)for(a=tn.fromString(o,!0,2).toString(4);a.length<s;)a="0"+a;return`${i}/${a}`}function Ha(e,t,r){let n=1<<t;return[(e[0]+r[0])/n,(e[1]+r[1])/n]}function pu(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function ka(e){return[pu(e[0]),pu(e[1])]}function Ja(e,[t,r]){switch(e){case 0:return[1,t,r];case 1:return[-t,1,r];case 2:return[-t,-r,1];case 3:return[-1,-r,-t];case 4:return[r,-1,-t];case 5:return[r,t,-1];default:throw new Error("Invalid face")}}function za([e,t,r]){let n=Math.atan2(r,Math.sqrt(e*e+t*t));return[Math.atan2(t,e)*mu,n*mu]}function CB(e,t,r,n){if(n===0){r===1&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);let o=t[0];t[0]=t[1],t[1]=o}}function Bu(e){let t=Ha(e.ij,e.level,[.5,.5]),r=ka(t),n=Ja(e.face,r);return za(n)}var MB=100;function Qa(e){let{face:t,ij:r,level:n}=e,o=[[0,0],[0,1],[1,1],[1,0],[0,0]],s=Math.max(1,Math.ceil(MB*Math.pow(2,-n))),i=new Float64Array(4*s*2+2),a=0,c=0;for(let f=0;f<4;f++){let h=o[f].slice(0),u=o[f+1],l=(u[0]-h[0])/s,d=(u[1]-h[1])/s;for(let A=0;A<s;A++){h[0]+=l,h[1]+=d;let m=Ha(r,n,h),p=ka(m),E=Ja(t,p),y=za(E);Math.abs(y[1])>89.999&&(y[0]=c);let C=y[0]-c;y[0]+=C>180?-360:C<-180?360:0,i[a++]=y[0],i[a++]=y[1],c=y[0]}}return i[a++]=i[0],i[a++]=i[1],i}function en(e){let t=bB(e);return gu(t)}function bB(e){if(e.indexOf("/")>0)return e;let t=zn(e);return xu(t)}function Va(e){let t=en(e);return Bu(t)}function _u(e){let t;if(e.face===2||e.face===5){let r=null,n=0;for(let o=0;o<4;o++){let s=`${e.face}/${o}`,i=en(s),a=Qa(i);(typeof r>"u"||r===null)&&(r=new Float64Array(4*a.length)),r.set(a,n),n+=a.length}t=Eu(r)}else{let r=Qa(e);t=Eu(r)}return t}function Eu(e){if(e.length%2!==0)throw new Error("Invalid corners");let t=[],r=[];for(let n=0;n<e.length;n+=2)t.push(e[n]),r.push(e[n+1]);return t.sort((n,o)=>n-o),r.sort((n,o)=>n-o),{west:t[0],east:t[t.length-1],north:r[r.length-1],south:r[0]}}function ja(e,t){let r=t?.minimumHeight||0,n=t?.maximumHeight||0,o=en(e),s=_u(o),i=s.west,a=s.south,c=s.east,f=s.north,h=[];return h.push(new b(i,f,r)),h.push(new b(c,f,r)),h.push(new b(c,a,r)),h.push(new b(i,a,r)),h.push(new b(i,f,n)),h.push(new b(c,f,n)),h.push(new b(c,a,n)),h.push(new b(i,a,n)),h}var ht={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var HR=new b,kR=new b;var Qn=new b,yu=new b,Fe=class{constructor(t=[0,0,0],r=0){this.radius=-0,this.center=new b,this.fromCenterRadius(t,r)}fromCenterRadius(t,r){return this.center.from(t),this.radius=r,this}fromCornerPoints(t,r){return r=Qn.from(r),this.center=new b().from(t).add(r).scale(.5),this.radius=this.center.distance(r),this}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.radius===t.radius}clone(){return new Fe(this.center,this.radius)}union(t){let r=this.center,n=this.radius,o=t.center,s=t.radius,i=Qn.copy(o).subtract(r),a=i.magnitude();if(n>=a+s)return this.clone();if(s>=a+n)return t.clone();let c=(n+a+s)*.5;return yu.copy(i).scale((-n+c)/a).add(r),this.center.copy(yu),this.radius=c,this}expand(t){let n=Qn.from(t).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(t){this.center.transform(t);let r=Fn.getScaling(Qn,t);return this.radius=Math.max(r[0],Math.max(r[1],r[2]))*this.radius,this}distanceSquaredTo(t){let r=this.distanceTo(t);return r*r}distanceTo(t){let n=Qn.from(t).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(t){let r=this.center,n=this.radius,s=t.normal.dot(r)+t.distance;return s<-n?ht.OUTSIDE:s<n?ht.INTERSECTING:ht.INSIDE}};var wB=new b,IB=new b,ps=new b,gs=new b,xs=new b,SB=new b,RB=new b,pe={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},er=class{constructor(t=[0,0,0],r=[0,0,0,0,0,0,0,0,0]){this.center=new b().from(t),this.halfAxes=new Z(r)}get halfSize(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new b(t).len(),new b(r).len(),new b(n).len()]}get quaternion(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),o=new b(t).normalize(),s=new b(r).normalize(),i=new b(n).normalize();return new Ie().fromMatrix3(new Z([...o,...s,...i]))}fromCenterHalfSizeQuaternion(t,r,n){let o=new Ie(n),s=new Z().fromQuaternion(o);return s[0]=s[0]*r[0],s[1]=s[1]*r[0],s[2]=s[2]*r[0],s[3]=s[3]*r[1],s[4]=s[4]*r[1],s[5]=s[5]*r[1],s[6]=s[6]*r[2],s[7]=s[7]*r[2],s[8]=s[8]*r[2],this.center=new b().from(t),this.halfAxes=s,this}clone(){return new er(this.center,this.halfAxes)}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}getBoundingSphere(t=new Fe){let r=this.halfAxes,n=r.getColumn(0,ps),o=r.getColumn(1,gs),s=r.getColumn(2,xs),i=wB.copy(n).add(o).add(s);return t.center.copy(this.center),t.radius=i.magnitude(),t}intersectPlane(t){let r=this.center,n=t.normal,o=this.halfAxes,s=n.x,i=n.y,a=n.z,c=Math.abs(s*o[pe.COLUMN0ROW0]+i*o[pe.COLUMN0ROW1]+a*o[pe.COLUMN0ROW2])+Math.abs(s*o[pe.COLUMN1ROW0]+i*o[pe.COLUMN1ROW1]+a*o[pe.COLUMN1ROW2])+Math.abs(s*o[pe.COLUMN2ROW0]+i*o[pe.COLUMN2ROW1]+a*o[pe.COLUMN2ROW2]),f=n.dot(r)+t.distance;return f<=-c?ht.OUTSIDE:f>=c?ht.INSIDE:ht.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){let r=IB.from(t).subtract(this.center),n=this.halfAxes,o=n.getColumn(0,ps),s=n.getColumn(1,gs),i=n.getColumn(2,xs),a=o.magnitude(),c=s.magnitude(),f=i.magnitude();o.normalize(),s.normalize(),i.normalize();let h=0,u;return u=Math.abs(r.dot(o))-a,u>0&&(h+=u*u),u=Math.abs(r.dot(s))-c,u>0&&(h+=u*u),u=Math.abs(r.dot(i))-f,u>0&&(h+=u*u),h}computePlaneDistances(t,r,n=[-0,-0]){let o=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,i=this.center,a=this.halfAxes,c=a.getColumn(0,ps),f=a.getColumn(1,gs),h=a.getColumn(2,xs),u=SB.copy(c).add(f).add(h).add(i),l=RB.copy(u).subtract(t),d=r.dot(l);return o=Math.min(d,o),s=Math.max(d,s),u.copy(i).add(c).add(f).subtract(h),l.copy(u).subtract(t),d=r.dot(l),o=Math.min(d,o),s=Math.max(d,s),u.copy(i).add(c).subtract(f).add(h),l.copy(u).subtract(t),d=r.dot(l),o=Math.min(d,o),s=Math.max(d,s),u.copy(i).add(c).subtract(f).subtract(h),l.copy(u).subtract(t),d=r.dot(l),o=Math.min(d,o),s=Math.max(d,s),i.copy(u).subtract(c).add(f).add(h),l.copy(u).subtract(t),d=r.dot(l),o=Math.min(d,o),s=Math.max(d,s),i.copy(u).subtract(c).add(f).subtract(h),l.copy(u).subtract(t),d=r.dot(l),o=Math.min(d,o),s=Math.max(d,s),i.copy(u).subtract(c).subtract(f).add(h),l.copy(u).subtract(t),d=r.dot(l),o=Math.min(d,o),s=Math.max(d,s),i.copy(u).subtract(c).subtract(f).subtract(h),l.copy(u).subtract(t),d=r.dot(l),o=Math.min(d,o),s=Math.max(d,s),n[0]=o,n[1]=s,n}transform(t){this.center.transformAsPoint(t);let r=this.halfAxes.getColumn(0,ps);r.transformAsPoint(t);let n=this.halfAxes.getColumn(1,gs);n.transformAsPoint(t);let o=this.halfAxes.getColumn(2,xs);return o.transformAsPoint(t),this.halfAxes=new Z([...r,...n,...o]),this}getTransform(){throw new Error("not implemented")}};var Tu=new b,Cu=new b,ge=class{constructor(t=[0,0,1],r=0){this.normal=new b,this.distance=-0,this.fromNormalDistance(t,r)}fromNormalDistance(t,r){return ft(Number.isFinite(r)),this.normal.from(t).normalize(),this.distance=r,this}fromPointNormal(t,r){t=Tu.from(t),this.normal.from(r).normalize();let n=-this.normal.dot(t);return this.distance=n,this}fromCoefficients(t,r,n,o){return this.normal.set(t,r,n),ft(wt(this.normal.len(),1)),this.distance=o,this}clone(){return new ge(this.normal,this.distance)}equals(t){return wt(this.distance,t.distance)&&wt(this.normal,t.normal)}getPointDistance(t){return this.normal.dot(t)+this.distance}transform(t){let r=Cu.copy(this.normal).transformAsVector(t).normalize(),n=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(n,r)}projectPointOntoPlane(t,r=[0,0,0]){let n=Tu.from(t),o=this.getPointDistance(n),s=Cu.copy(this.normal).scale(o);return n.subtract(s).to(r)}};var Mu=[new b([1,0,0]),new b([0,1,0]),new b([0,0,1])],bu=new b,FB=new b,vt=class{constructor(t=[]){this.planes=t}fromBoundingSphere(t){this.planes.length=2*Mu.length;let r=t.center,n=t.radius,o=0;for(let s of Mu){let i=this.planes[o],a=this.planes[o+1];i||(i=this.planes[o]=new ge),a||(a=this.planes[o+1]=new ge);let c=bu.copy(s).scale(-n).add(r);i.fromPointNormal(c,s);let f=bu.copy(s).scale(n).add(r),h=FB.copy(s).negate();a.fromPointNormal(f,h),o+=2}return this}computeVisibility(t){let r=ht.INSIDE;for(let n of this.planes)switch(t.intersectPlane(n)){case ht.OUTSIDE:return ht.OUTSIDE;case ht.INTERSECTING:r=ht.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(t,r){if(ft(Number.isFinite(r),"parentPlaneMask is required."),r===vt.MASK_OUTSIDE||r===vt.MASK_INSIDE)return r;let n=vt.MASK_INSIDE,o=this.planes;for(let s=0;s<this.planes.length;++s){let i=s<31?1<<s:0;if(s<31&&!(r&i))continue;let a=o[s],c=t.intersectPlane(a);if(c===ht.OUTSIDE)return vt.MASK_OUTSIDE;c===ht.INTERSECTING&&(n|=i)}return n}};vt.MASK_OUTSIDE=4294967295;vt.MASK_INSIDE=0;vt.MASK_INDETERMINATE=2147483647;var sF=new b,iF=new b,aF=new b,cF=new b,fF=new b;var mF=new b,pF=new b,gF=new b,xF=new b,BF=new b,EF=new b,_F=new b,yF=new b,TF=new b,CF=new b,MF=new b,bF=new b;var re=new Z,OB=new Z,LB=new Z,Bs=new Z,wu=new Z;function Ya(e,t={}){let r=Ht.EPSILON20,n=10,o=0,s=0,i=OB,a=LB;i.identity(),a.copy(e);let c=r*vB(a);for(;s<n&&NB(a)>c;)GB(a,Bs),wu.copy(Bs).transpose(),a.multiplyRight(Bs),a.multiplyLeft(wu),i.multiplyRight(Bs),++o>2&&(++s,o=0);return t.unitary=i.toTarget(t.unitary),t.diagonal=a.toTarget(t.diagonal),t}function vB(e){let t=0;for(let r=0;r<9;++r){let n=e[r];t+=n*n}return Math.sqrt(t)}var Ka=[1,0,0],Xa=[2,2,1];function NB(e){let t=0;for(let r=0;r<3;++r){let n=e[re.getElementIndex(Xa[r],Ka[r])];t+=2*n*n}return Math.sqrt(t)}function GB(e,t){let r=Ht.EPSILON15,n=0,o=1;for(let f=0;f<3;++f){let h=Math.abs(e[re.getElementIndex(Xa[f],Ka[f])]);h>n&&(o=f,n=h)}let s=Ka[o],i=Xa[o],a=1,c=0;if(Math.abs(e[re.getElementIndex(i,s)])>r){let f=e[re.getElementIndex(i,i)],h=e[re.getElementIndex(s,s)],u=e[re.getElementIndex(i,s)],l=(f-h)/2/u,d;l<0?d=-1/(-l+Math.sqrt(1+l*l)):d=1/(l+Math.sqrt(1+l*l)),a=1/Math.sqrt(1+d*d),c=d*a}return Z.IDENTITY.to(t),t[re.getElementIndex(s,s)]=t[re.getElementIndex(i,i)]=a,t[re.getElementIndex(i,s)]=c,t[re.getElementIndex(s,i)]=-c,t}var De=new b,UB=new b,HB=new b,kB=new b,JB=new b,zB=new Z,QB={diagonal:new Z,unitary:new Z};function Za(e,t=new er){if(!e||e.length===0)return t.halfAxes=new Z([0,0,0,0,0,0,0,0,0]),t.center=new b,t;let r=e.length,n=new b(0,0,0);for(let x of e)n.add(x);let o=1/r;n.multiplyByScalar(o);let s=0,i=0,a=0,c=0,f=0,h=0;for(let x of e){let g=De.copy(x).subtract(n);s+=g.x*g.x,i+=g.x*g.y,a+=g.x*g.z,c+=g.y*g.y,f+=g.y*g.z,h+=g.z*g.z}s*=o,i*=o,a*=o,c*=o,f*=o,h*=o;let u=zB;u[0]=s,u[1]=i,u[2]=a,u[3]=i,u[4]=c,u[5]=f,u[6]=a,u[7]=f,u[8]=h;let{unitary:l}=Ya(u,QB),d=t.halfAxes.copy(l),A=d.getColumn(0,HB),m=d.getColumn(1,kB),p=d.getColumn(2,JB),E=-Number.MAX_VALUE,y=-Number.MAX_VALUE,C=-Number.MAX_VALUE,M=Number.MAX_VALUE,T=Number.MAX_VALUE,I=Number.MAX_VALUE;for(let x of e)De.copy(x),E=Math.max(De.dot(A),E),y=Math.max(De.dot(m),y),C=Math.max(De.dot(p),C),M=Math.min(De.dot(A),M),T=Math.min(De.dot(m),T),I=Math.min(De.dot(p),I);A=A.multiplyByScalar(.5*(M+E)),m=m.multiplyByScalar(.5*(T+y)),p=p.multiplyByScalar(.5*(I+C)),t.center.copy(A).add(m).add(p);let w=UB.set(E-M,y-T,C-I).multiplyByScalar(.5),O=new Z([w[0],0,0,0,w[1],0,0,0,w[2]]);return t.halfAxes.multiplyRight(O),t}function Es(e){let t=e.token,r={minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight},n=ja(t,r),o=Va(t),s=o[0],i=o[1],a=Ae.WGS84.cartographicToCartesian([s,i,r.maximumHeight]),c=new b(a[0],a[1],a[2]);n.push(c);let f=Za(n);return[...f.center,...f.halfAxes]}var VB=4,jB=8,KB={QUADTREE:VB,OCTREE:jB};function XB(e,t,r){if(e?.box){let n=zn(e.s2VolumeInfo.token),o=Ua(n,t),s=Pa(o),i={...e.s2VolumeInfo};switch(i.token=s,r){case"OCTREE":let f=e.s2VolumeInfo,h=f.maximumHeight-f.minimumHeight,u=h/2,l=f.minimumHeight+h/2;f.minimumHeight=l-u,f.maximumHeight=l+u;break;default:break}return{box:Es(i),s2VolumeInfo:i}}}async function Wa(e){let{implicitOptions:t,parentData:r={mortonIndex:0,x:0,y:0,z:0},childIndex:n=0,s2VolumeBox:o,loaderOptions:s}=e,{subtree:i,level:a=0,globalData:c={level:0,mortonIndex:0,x:0,y:0,z:0}}=e,{subdivisionScheme:f,subtreeLevels:h,maximumLevel:u,contentUrlTemplate:l,subtreesUriTemplate:d,basePath:A}=t,m={children:[],lodMetricValue:0,contentUrl:""};if(!u)return va.once(`Missing 'maximumLevel' or 'availableLevels' property. The subtree ${l} won't be loaded...`),m;let p=a+c.level;if(p>u)return m;let E=KB[f],y=Math.log2(E),C=n&1,M=n>>1&1,T=n>>2&1,I=(E**a-1)/(E-1),w=rr(r.mortonIndex,n,y),O=I+w,x=rr(r.x,C,1),g=rr(r.y,M,1),B=rr(r.z,T,1),_=!1;a>=h&&(_=qa(i.childSubtreeAvailability,w));let P=rr(c.x,x,a),G=rr(c.y,g,a),U=rr(c.z,B,a);if(_){let ke=`${A}/${d}`,uo=_s(ke,p,P,G,U);i=await(0,Iu.load)(uo,Xr,s),c={mortonIndex:w,x,y:g,z:B,level:a},w=0,O=0,x=0,g=0,B=0,a=0}if(!qa(i.tileAvailability,O))return m;qa(i.contentAvailability,O)&&(m.contentUrl=_s(l,p,P,G,U));let mt=a+1,X={mortonIndex:w,x,y:g,z:B};for(let ke=0;ke<E;ke++){let uo=XB(o,ke,f),gr=await Wa({subtree:i,implicitOptions:t,loaderOptions:s,parentData:X,childIndex:ke,level:mt,globalData:{...c},s2VolumeBox:uo});if(gr.contentUrl||gr.children.length){let S=p+1,R=YB(gr,S,{childTileX:x,childTileY:g,childTileZ:B},t,o);m.children.push(R)}}return m}function qa(e,t){let r;return Array.isArray(e)?(r=e[0],e.length>1&&va.once('Not supported extension "3DTILES_multiple_contents" has been detected')):r=e,"constant"in r?Boolean(r.constant):r.explicitBitstream?WB(t,r.explicitBitstream):!1}function YB(e,t,r,n,o){let{basePath:s,refine:i,getRefine:a,lodMetricType:c,getTileType:f,rootLodMetricValue:h,rootBoundingVolume:u}=n,l=e.contentUrl&&e.contentUrl.replace(`${s}/`,""),d=h/2**t,A=o?.box?{box:o.box}:u,m=ZB(t,A,r);return{children:e.children,contentUrl:e.contentUrl,content:{uri:l},id:e.contentUrl,refine:a(i),type:f(e),lodMetricType:c,lodMetricValue:d,geometricError:d,transform:e.transform,boundingVolume:m}}function ZB(e,t,r){if(t.region){let{childTileX:n,childTileY:o,childTileZ:s}=r,[i,a,c,f,h,u]=t.region,l=2**e,d=(c-i)/l,A=(f-a)/l,m=(u-h)/l,[p,E]=[i+d*n,i+d*(n+1)],[y,C]=[a+A*o,a+A*(o+1)],[M,T]=[h+m*s,h+m*(s+1)];return{region:[p,y,E,C,M,T]}}if(t.box)return t;throw new Error(`Unsupported bounding volume type ${JSON.stringify(t)}`)}function rr(e,t,r){return(e<<r)+t}function _s(e,t,r,n,o){let s=qB({level:t,x:r,y:n,z:o});return e.replace(/{level}|{x}|{y}|{z}/gi,i=>s[i])}function qB(e){let t={};for(let r in e)t[`{${r}}`]=e[r];return t}function WB(e,t){let r=Math.floor(e/8),n=e%8;return(t[r]>>n&1)===1}function tc(e,t=""){if(!t)return Ce.EMPTY;let n=t.split("?")[0].split(".").pop();switch(n){case"pnts":return Ce.POINTCLOUD;case"i3dm":case"b3dm":case"glb":case"gltf":return Ce.SCENEGRAPH;default:return n||Ce.EMPTY}}function ec(e){switch(e){case"REPLACE":case"replace":return Sr.REPLACE;case"ADD":case"add":return Sr.ADD;default:return e}}function $a(e,t){if(/^[a-z][0-9a-z+.-]*:/i.test(t)){let n=new URL(e,`${t}/`);return decodeURI(n.toString())}else if(e.startsWith("/"))return e;return Cr.resolve(t,e)}function Su(e,t){if(!e)return null;let r;if(e.content){let o=e.content.uri||e.content?.url;typeof o<"u"&&(r=$a(o,t))}return{...e,id:r,contentUrl:r,lodMetricType:le.GEOMETRIC_ERROR,lodMetricValue:e.geometricError,transformMatrix:e.transform,type:tc(e,r),refine:ec(e.refine)}}async function Ou(e,t,r){let n=null,o=Fu(e.root);o&&e.root?n=await Ru(e.root,e,t,o,r):n=Su(e.root,t);let s=[];for(s.push(n);s.length>0;){let i=s.pop()||{},a=i.children||[],c=[];for(let f of a){let h=Fu(f),u;h?u=await Ru(f,e,t,h,r):u=Su(f,t),u&&(c.push(u),s.push(u))}i.children=c}return n}async function Ru(e,t,r,n,o){let{subdivisionScheme:s,maximumLevel:i,availableLevels:a,subtreeLevels:c,subtrees:{uri:f}}=n,h=_s(f,0,0,0,0),u=$a(h,r),l=await(0,Du.load)(u,Xr,o),d=e.content?.uri,A=d?$a(d,r):"",m=t?.root?.refine,p=e.geometricError,E=e.boundingVolume.extensions?.["3DTILES_bounding_volume_S2"];if(E){let T={box:Es(E),s2VolumeInfo:E};e.boundingVolume=T}let y=e.boundingVolume,C={contentUrlTemplate:A,subtreesUriTemplate:f,subdivisionScheme:s,subtreeLevels:c,maximumLevel:Number.isFinite(a)?a-1:i,refine:m,basePath:r,lodMetricType:le.GEOMETRIC_ERROR,rootLodMetricValue:p,rootBoundingVolume:y,getTileType:tc,getRefine:ec};return await $B(e,r,l,C,o)}async function $B(e,t,r,n,o){if(!e)return null;let{children:s,contentUrl:i}=await Wa({subtree:r,implicitOptions:n,loaderOptions:o}),a,c=null;return i&&(a=i,c={uri:i.replace(`${t}/`,"")}),{...e,id:a,contentUrl:a,lodMetricType:le.GEOMETRIC_ERROR,lodMetricValue:e.geometricError,transformMatrix:e.transform,type:tc(e,a),refine:ec(e.refine),content:c||e.content,children:s}}function Fu(e){return e?.extensions?.["3DTILES_implicit_tiling"]||e?.implicitTiling}var nr={dataType:null,batchType:null,id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:Rr,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:t2,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};async function t2(e,t={},r){let n=t["3d-tiles"]||{},o;return n.isTileset==="auto"?o=r?.url&&r.url.indexOf(".json")!==-1:o=n.isTileset,o?e2(e,t,r):r2(e,t,r)}async function e2(e,t,r){let n=JSON.parse(new TextDecoder().decode(e)),o=r?.url||"",s=n2(o),i=await Ou(n,s,t||{});return{...n,shape:"tileset3d",loader:nr,url:o,queryString:r?.queryString||"",basePath:s,root:i||n.root,type:Cn.TILES3D,lodMetricType:le.GEOMETRIC_ERROR,lodMetricValue:n.root?.geometricError||0}}async function r2(e,t,r){let n={content:{shape:"tile3d",featureIds:null}};return await Da(e,0,t,r,n.content),n.content}function n2(e){return Cr.dirname(e)}var ys=xr(gn(),1);var Lu="https://api.cesium.com/v1/assets";async function Ts(e,t){if(!t){let s=await o2(e);for(let i of s.items)i.type==="3DTILES"&&(t=i.id)}let r=await s2(e,t),{type:n,url:o}=r;return J(n==="3DTILES"&&o),r.headers={Authorization:`Bearer ${r.accessToken}`},r}async function o2(e){J(e);let t=Lu,r={Authorization:`Bearer ${e}`},n=await(0,ys.fetchFile)(t,{headers:r});if(!n.ok)throw new Error(n.statusText);return await n.json()}async function s2(e,t){J(e,t);let r={Authorization:`Bearer ${e}`},n=`${Lu}/${t}`,o=await(0,ys.fetchFile)(`${n}`,{headers:r});if(!o.ok)throw new Error(o.statusText);let s=await o.json();if(o=await(0,ys.fetchFile)(`${n}/endpoint`,{headers:r}),!o.ok)throw new Error(o.statusText);let i=await o.json();return s={...s,...i},s}async function i2(e,t={}){t=t["cesium-ion"]||{};let{accessToken:r}=t,n=t.assetId;if(!Number.isFinite(n)){let o=e.match(/\/([0-9]+)\/tileset.json/);n=o&&o[1]}return Ts(r,n)}var rc={...nr,id:"cesium-ion",name:"Cesium Ion",preload:i2,parse:async(e,t,r)=>(t={...t},t["3d-tiles"]=t["cesium-ion"],t.loader=rc,nr.parse(e,t,r)),options:{"cesium-ion":{...nr.options["3d-tiles"],accessToken:null}}};var Vn=async(e,t)=>{let r=[await e.getUint8(e.length-1n),await e.getUint8(e.length-2n),await e.getUint8(e.length-3n),void 0],n=-1,o=e.length-4n;do{let s=o;o-=BigInt(1024),o=o>=0n?o:0n;let i=new Uint8Array(await e.slice(o,s));for(let a=i.length-1;a>-1;a--)if(r[3]=r[2],r[2]=r[1],r[1]=r[0],r[0]=i[a],r.every((c,f)=>c===t[f])){n=a;break}}while(n===-1&&o>0n);return o+BigInt(n)};var vu=new Uint8Array([80,75,5,6]),Nu=new Uint8Array([80,75,6,7]),Gu=new Uint8Array([80,75,6,6]),a2=8n;var c2=12n,f2=16n;var h2=8n,l2=24n;var u2=40n,d2=48n;var Pu=async e=>{let t=await Vn(e,vu),r=BigInt(await e.getUint16(t+a2)),n=BigInt(await e.getUint32(t+c2)),o=BigInt(await e.getUint32(t+f2)),s=t-20n,i=0n,a=await e.slice(s,s+4n);if(Te(a,Nu)){i=await e.getBigUint64(s+h2);let c=await e.slice(i,i+4n);if(!Te(c,Gu.buffer))throw new Error("zip64 EoCD not found");r=await e.getBigUint64(i+l2),n=await e.getBigUint64(i+u2),o=await e.getBigUint64(i+d2)}else s=0n;return{cdRecordsNumber:r,cdStartOffset:o,cdByteSize:n,offsets:{zip64EoCDOffset:i,zip64EoCDLocatorOffset:s,zipEoCDOffset:t}}};var wD=[{offset:0,size:4,default:new DataView(vu.buffer).getUint32(0,!0)},{offset:4,size:2,default:0},{offset:6,size:2,default:0},{offset:8,size:2,name:"recordsNumber"},{offset:10,size:2,name:"recordsNumber"},{offset:12,size:4,name:"cdSize"},{offset:16,size:4,name:"cdOffset"},{offset:20,size:2,default:0}];var ID=[{offset:0,size:4,default:new DataView(Nu.buffer).getUint32(0,!0)},{offset:4,size:4,default:0},{offset:8,size:8,name:"eoCDStart"},{offset:16,size:4,default:1}],SD=[{offset:0,size:4,default:new DataView(Gu.buffer).getUint32(0,!0)},{offset:4,size:8,default:44},{offset:12,size:2,default:45},{offset:14,size:2,default:45},{offset:16,size:4,default:0},{offset:20,size:4,default:0},{offset:24,size:8,name:"recordsNumber"},{offset:32,size:8,name:"recordsNumber"},{offset:40,size:8,name:"cdSize"},{offset:48,size:8,name:"cdOffset"}];var A2=20,m2=24,p2=28,g2=30,x2=32,B2=42,Cs=46n,Kn=new Uint8Array([80,75,1,2]),jn=async(e,t)=>{if(e>=t.length)return null;let r=new DataView(await t.slice(e,e+Cs)),n=r.buffer.slice(0,4);if(!Te(n,Kn.buffer))return null;let o=BigInt(r.getUint32(A2,!0)),s=BigInt(r.getUint32(m2,!0)),i=r.getUint16(g2,!0),a=BigInt(r.getUint16(x2,!0)),c=r.getUint16(p2,!0),f=await t.slice(e+Cs,e+Cs+BigInt(c+i)),h=f.slice(0,c),u=new TextDecoder().decode(h),l=e+Cs+BigInt(c),d=r.getUint32(B2,!0),A=BigInt(d),m=new DataView(f.slice(c,f.byteLength)),p={uncompressedSize:s,compressedSize:o,localHeaderOffset:A,startDisk:a},E=E2(p,m);return{...p,...E,extraFieldLength:i,fileNameLength:c,fileName:u,extraOffset:l}};async function*rn(e){let{cdStartOffset:t,cdByteSize:r}=await Pu(e),n=new ze(new DataView(await e.slice(t,t+r))),o=await jn(0n,n);for(;o;)yield o,o=await jn(o.extraOffset+BigInt(o.extraFieldLength),n)}var Uu=(...e)=>e[0]+e[1]*16,E2=(e,t)=>{let r=_2(e),n={};if(r.length>0){let o=r.reduce((a,c)=>a+c.length,0),s=new Uint8Array(t.buffer).findIndex((a,c,f)=>Uu(f[c],f[c+1])===1&&Uu(f[c+2],f[c+3])===o),i=0;for(let a of r){let c=i;n[a.name]=t.getBigUint64(s+4+c,!0),i=c+a.length}}return n},_2=e=>{let t=[];return e.uncompressedSize===BigInt(4294967295)&&t.push({name:"uncompressedSize",length:8}),e.compressedSize===BigInt(4294967295)&&t.push({name:"compressedSize",length:8}),e.localHeaderOffset===BigInt(4294967295)&&t.push({name:"localHeaderOffset",length:8}),e.startDisk===BigInt(4294967295)&&t.push({name:"startDisk",length:4}),t};var OD=[{offset:0,size:4,default:new DataView(Kn.buffer).getUint32(0,!0)},{offset:4,size:2,default:45},{offset:6,size:2,default:45},{offset:8,size:2,default:0},{offset:10,size:2,default:0},{offset:12,size:2,default:0},{offset:14,size:2,default:0},{offset:16,size:4,name:"crc32"},{offset:20,size:4,name:"length"},{offset:24,size:4,name:"length"},{offset:28,size:2,name:"fnlength"},{offset:30,size:2,default:0,name:"extraLength"},{offset:32,size:2,default:0},{offset:34,size:2,default:0},{offset:36,size:2,default:0},{offset:38,size:4,default:0},{offset:42,size:4,name:"offset"}];var y2=8,T2=18,C2=22,M2=26,b2=28,Ms=30n,nc=new Uint8Array([80,75,3,4]),or=async(e,t)=>{let r=new DataView(await t.slice(e,e+Ms)),n=r.buffer.slice(0,4);if(!Te(n,nc))return null;let o=r.getUint16(M2,!0),s=r.getUint16(b2,!0),i=await t.slice(e+Ms,e+Ms+BigInt(o+s)),a=i.slice(0,o),c=new DataView(i.slice(o,i.byteLength)),f=new TextDecoder().decode(a).split("\\").join("/"),h=e+Ms+BigInt(o+s),u=r.getUint16(y2,!0),l=BigInt(r.getUint32(T2,!0)),d=BigInt(r.getUint32(C2,!0)),A=4;return d===BigInt(4294967295)&&(d=c.getBigUint64(A,!0),A+=8),l===BigInt(4294967295)&&(l=c.getBigUint64(A,!0),A+=8),h===BigInt(4294967295)&&(h=c.getBigUint64(A,!0)),{fileNameLength:o,fileName:f,extraFieldLength:s,fileDataOffset:h,compressedSize:l,compressionMethod:u}};var ND=[{offset:0,size:4,default:new DataView(nc.buffer).getUint32(0,!0)},{offset:4,size:2,default:45},{offset:6,size:2,default:0},{offset:8,size:2,default:0},{offset:10,size:2,default:0},{offset:12,size:2,default:0},{offset:14,size:4,name:"crc32"},{offset:18,size:4,name:"length"},{offset:22,size:4,name:"length"},{offset:26,size:2,name:"fnlength"},{offset:28,size:2,default:0,name:"extraLength"}];var bs=class{constructor(t={}){this.hashBatches=this.hashBatches.bind(this)}async preload(){}async*hashBatches(t,r="base64"){let n=[];for await(let i of t)n.push(i),yield i;let o=await this.concatenate(n),s=await this.hash(o,r);this.options.crypto?.onEnd?.({hash:s})}async concatenate(t){return await En(t)}};function Hu(e){e=`${e}`;for(let r=0;r<e.length;r++)if(e.charCodeAt(r)>255)return null;let t="";for(let r=0;r<e.length;r+=3){let n=[void 0,void 0,void 0,void 0];n[0]=e.charCodeAt(r)>>2,n[1]=(e.charCodeAt(r)&3)<<4,e.length>r+1&&(n[1]|=e.charCodeAt(r+1)>>4,n[2]=(e.charCodeAt(r+1)&15)<<2),e.length>r+2&&(n[2]|=e.charCodeAt(r+2)>>6,n[3]=e.charCodeAt(r+2)&63);for(let o=0;o<n.length;o++)typeof n[o]>"u"?t+="=":t+=w2(n[o])}return t}function w2(e){if(e<26)return String.fromCharCode(e+"A".charCodeAt(0));if(e<52)return String.fromCharCode(e-26+"a".charCodeAt(0));if(e<62)return String.fromCharCode(e-52+"0".charCodeAt(0));if(e===62)return"+";if(e===63)return"/"}function ku(e,t){switch(t){case"hex":return e;case"base64":return I2(e);default:throw new Error(t)}}function I2(e){e.length%2!==0&&(e=`0${e}`);let r=(e.match(/\w{2}/g)||[]).map(n=>String.fromCharCode(parseInt(n,16))).join("");return Hu(r)||""}var zu=typeof atob=="function"?atob:typeof Buffer=="function"?v2:Vu,S2=zu("AGFzbQEAAAABDANgAX8AYAAAYAABfwIeAgdpbXBvcnRzA2xvZwAAB2ltcG9ydHMDbWVtAgABAzIxAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAAAAAAAAAAAAgICAgIAAAAAAAaYARt/AUGBxpS6Bgt/AUGJ17b+fgt/AUH+uev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h0d29GdWxsQx8IdHdvRnVsbEQgCHRyZUZ1bGxBIQh0cmVGdWxsQiIIdHJlRnVsbEMjCHRyZUZ1bGxEJAhxdWFGdWxsQSUIcXVhRnVsbEImCHF1YUZ1bGxDJwhxdWFGdWxsRCgEZ2V0QSkEZ2V0QioEZ2V0QysEZ2V0RCwEZ2V0WC0Ec2V0QS4Ec2V0Qi8Ec2V0QzAEc2V0RDEEc2V0WALNATIAAQAAAQIAAAEIbnVtbG9vcHMCAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgCAAABAW4ZAgAAAQFuGgIAAAEBbhsCAAABAW4cAgAAAQFuHQIAAAEBbh4CAAABAW4fAgAAAQFuIAIAAAEBbiECAAABAW4iAgAAAQFuIwIAAAEBbiQCAAABAW4lAgAAAQFuJgIAAAEBbicCAAABAW4oACkAKgArACwALQEAAC4BAAAvAQAAMAEAADEBAAA="),oc=WebAssembly&&zu!==Vu?L2(S2).buffer:!1,ne=N2(),sc=240*16*16,Qu=Math.floor(sc*16*1.066666667),R2=268435456-65536,Ju="Parameter must be Buffer, ArrayBuffer or Uint8Array",F2="Parameter exceeds max size of 255.9 Mbytes";oc||console.log("WebAssembly not available or WASM module could not be decoded; md5WASM will fall back to JavaScript");function ic(e){var t,r,n,o,s,i,a,c,f,h;let u=O2(),l=D2(),d={},A=new Date().getTime();return d.then=function(y){return a=y,p(),d},d.catch=function(y){return c=y,d},e&&typeof e=="object"?typeof Buffer=="function"&&e.constructor===Buffer?i=e:e.constructor===Uint8Array||e.constructor===ArrayBuffer?i=e.constructor===ArrayBuffer?new Uint8Array(e):e:E(new TypeError(Ju)):E(new TypeError(Ju)),i&&(s=i.length,oc&&s>Qu?s>R2?E(new Error(F2)):(t=new WebAssembly.Memory({initial:s>32e6?s>64e6?s>128e6?4096:2048:1024:512}),r=new Uint32Array(t.buffer),o={mem:t,log:console.log},n={imports:o},WebAssembly.instantiate(oc,n).then(m)):p(u(i))),d;function m(y){p(l(i,y.instance.exports,r))}function p(y){var C=Boolean(y)?y:f;Boolean(y)&&(h=new Date().getTime()),typeof a=="function"?Boolean(C)&&(a(C,h-A),a=c=null):Boolean(y)&&(f=y)}function E(y){typeof c=="function"&&c(y)}}function D2(){var e,t,r,n,o,s,i,a,c,f,h,u,l,d=function(A){var m,p,E,y,C,M,T,I,w,O,x,g,B,_,P,G,U,v,at,mt,X,ke,uo=new Date().getTime(),gr=0,S=1732584193,F=-271733879,R=-1732584194,D=271733878,tt=0,pn=A.length*8,Ao;for(Ao=Jd(A,l),l[pn>>>5]|=128<<pn%32,l[(pn+64>>>9<<4)+14]=pn,Ao=(pn+64>>>9<<4)+15,X=l;tt<Ao;)Ao>tt+Qu?(n(S),s(F),a(R),f(D),t(sc),tt=tt+sc*16,S=r(),F=o(),R=i(),D=c(),gr++):(U=S,v=F,at=R,mt=D,m=X[tt+0]>>>0,p=X[tt+1]>>>0,E=X[tt+2]>>>0,y=X[tt+3]>>>0,C=X[tt+4]>>>0,M=X[tt+5]>>>0,T=X[tt+6]>>>0,I=X[tt+7]>>>0,w=X[tt+8]>>>0,O=X[tt+9]>>>0,x=X[tt+10]>>>0,g=X[tt+11]>>>0,B=X[tt+12]>>>0,_=X[tt+13]>>>0,P=X[tt+14]>>>0,G=X[tt+15]>>>0,S=N(7,25,S+(F&R|~F&D)+m-680876936)+F,D=N(12,20,D+(S&F|~S&R)+p-389564586)+S,R=N(17,15,R+(D&S|~D&F)+E+606105819)+D,F=N(22,10,F+(R&D|~R&S)+y-1044525330)+R,S=N(7,25,S+(F&R|~F&D)+C-176418897)+F,D=N(12,20,D+(S&F|~S&R)+M+1200080426)+S,R=N(17,15,R+(D&S|~D&F)+T-1473231341)+D,F=N(22,10,F+(R&D|~R&S)+I-45705983)+R,S=N(7,25,S+(F&R|~F&D)+w+1770035416)+F,D=N(12,20,D+(S&F|~S&R)+O-1958414417)+S,R=N(17,15,R+(D&S|~D&F)+x-42063)+D,F=N(22,10,F+(R&D|~R&S)+g-1990404162)+R,S=N(7,25,S+(F&R|~F&D)+B+1804603682)+F,D=N(12,20,D+(S&F|~S&R)+_-40341101)+S,R=N(17,15,R+(D&S|~D&F)+P-1502002290)+D,F=N(22,10,F+(R&D|~R&S)+G+1236535329)+R,S=N(5,27,S+(F&D|R&~D)+p-165796510)+F,D=N(9,23,D+(S&R|F&~R)+T-1069501632)+S,R=N(14,18,R+(D&F|S&~F)+g+643717713)+D,F=N(20,12,F+(R&S|D&~S)+m-373897302)+R,S=N(5,27,S+(F&D|R&~D)+M-701558691)+F,D=N(9,23,D+(S&R|F&~R)+x+38016083)+S,R=N(14,18,R+(D&F|S&~F)+G-660478335)+D,F=N(20,12,F+(R&S|D&~S)+C-405537848)+R,S=N(5,27,S+(F&D|R&~D)+O+568446438)+F,D=N(9,23,D+(S&R|F&~R)+P-1019803690)+S,R=N(14,18,R+(D&F|S&~F)+y-187363961)+D,F=N(20,12,F+(R&S|D&~S)+w+1163531501)+R,S=N(5,27,S+(F&D|R&~D)+_-1444681467)+F,D=N(9,23,D+(S&R|F&~R)+E-51403784)+S,R=N(14,18,R+(D&F|S&~F)+I+1735328473)+D,F=N(20,12,F+(R&S|D&~S)+B-1926607734)+R,S=N(4,28,S+(F^R^D)+M-378558)+F,D=N(11,21,D+(S^F^R)+w-2022574463)+S,R=N(16,16,R+(D^S^F)+g+1839030562)+D,F=N(23,9,F+(R^D^S)+P-35309556)+R,S=N(4,28,S+(F^R^D)+p-1530992060)+F,D=N(11,21,D+(S^F^R)+C+1272893353)+S,R=N(16,16,R+(D^S^F)+I-155497632)+D,F=N(23,9,F+(R^D^S)+x-1094730640)+R,S=N(4,28,S+(F^R^D)+_+681279174)+F,D=N(11,21,D+(S^F^R)+m-358537222)+S,R=N(16,16,R+(D^S^F)+y-722521979)+D,F=N(23,9,F+(R^D^S)+T+76029189)+R,S=N(4,28,S+(F^R^D)+O-640364487)+F,D=N(11,21,D+(S^F^R)+B-421815835)+S,R=N(16,16,R+(D^S^F)+G+530742520)+D,F=N(23,9,F+(R^D^S)+E-995338651)+R,S=N(6,26,S+(R^(F|~D))+m-198630844)+F,D=N(10,22,D+(F^(S|~R))+I+1126891415)+S,R=N(15,17,R+(S^(D|~F))+P-1416354905)+D,F=N(21,11,F+(D^(R|~S))+M-57434055)+R,S=N(6,26,S+(R^(F|~D))+B+1700485571)+F,D=N(10,22,D+(F^(S|~R))+y-1894986606)+S,R=N(15,17,R+(S^(D|~F))+x-1051523)+D,F=N(21,11,F+(D^(R|~S))+p-2054922799)+R,S=N(6,26,S+(R^(F|~D))+w+1873313359)+F,D=N(10,22,D+(F^(S|~R))+G-30611744)+S,R=N(15,17,R+(S^(D|~F))+T-1560198380)+D,F=N(21,11,F+(D^(R|~S))+_+1309151649)+R,S=N(6,26,S+(R^(F|~D))+C-145523070)+F,D=N(10,22,D+(F^(S|~R))+g-1120210379)+S,R=N(15,17,R+(S^(D|~F))+E+718787259)+D,F=N(21,11,F+(D^(R|~S))+O-343485551)+R,tt=tt+16,S=S+U>>>0,F=F+v>>>0,R=R+at>>>0,D=D+mt>>>0);return ne.endian([S,F,R,D]);function N(pt,mo,Xt){return Xt<<pt|Xt>>>mo}function Jd(pt,mo){for(var Xt=-1,Qs=Math.floor((pt.length-1)/4),Bt=0,Vc,jc,Kc,Xc;Qs-8>Xt++;)Bt=Xt<<2,mo[Xt]=pt[Bt+0]|pt[Bt+1]<<8|pt[Bt+2]<<16|pt[Bt+3]<<24;for(Xt--;Qs>Xt++;)Bt=Xt<<2,Vc=typeof pt[Bt+0]>"u"?0:pt[Bt+0],jc=typeof pt[Bt+1]>"u"?0:pt[Bt+1],Kc=typeof pt[Bt+2]>"u"?0:pt[Bt+2],Xc=typeof pt[Bt+3]>"u"?0:pt[Bt+3],mo[Xt]=Vc|jc<<8|Kc<<16|Xc<<24;return Qs+1}};return function(A,m,p,E){var y;return t=m.loops,e=m.loop,r=m.getA,o=m.getB,i=m.getC,c=m.getD,h=m.getX,n=m.setA,s=m.setB,a=m.setC,f=m.setD,u=m.setX,l=p,y=ne.wordsToBytes(d(A)),E&&E.asBytes?y:ne.bytesconvertNumberToHex(y)}}function O2(){var e=function(t,r){var n,o,s,i,a,c,f,h,u,l,d,A,m,p,E,y,C,M,T,I,w,O=new Date().getTime(),x=1732584193,g=-271733879,B=-1732584194,_=271733878,P=t.length*8;w=ne.bytesToWords(t);for(var G=0;G<w.length;G++)w[G]=(w[G]<<8|w[G]>>>24)&16711935|(w[G]<<24|w[G]>>>8)&4278255360;w[P>>>5]|=128<<P%32,w[(P+64>>>9<<4)+14]=P;for(var U=0;U<w.length;U+=16)C=x,M=g,T=B,I=_,n=w[U+0]>>>0,o=w[U+1]>>>0,s=w[U+2]>>>0,i=w[U+3]>>>0,a=w[U+4]>>>0,c=w[U+5]>>>0,f=w[U+6]>>>0,h=w[U+7]>>>0,u=w[U+8]>>>0,l=w[U+9]>>>0,d=w[U+10]>>>0,A=w[U+11]>>>0,m=w[U+12]>>>0,p=w[U+13]>>>0,E=w[U+14]>>>0,y=w[U+15]>>>0,x=v(7,25,x+(g&B|~g&_)+n-680876936)+g,_=v(12,20,_+(x&g|~x&B)+o-389564586)+x,B=v(17,15,B+(_&x|~_&g)+s+606105819)+_,g=v(22,10,g+(B&_|~B&x)+i-1044525330)+B,x=v(7,25,x+(g&B|~g&_)+a-176418897)+g,_=v(12,20,_+(x&g|~x&B)+c+1200080426)+x,B=v(17,15,B+(_&x|~_&g)+f-1473231341)+_,g=v(22,10,g+(B&_|~B&x)+h-45705983)+B,x=v(7,25,x+(g&B|~g&_)+u+1770035416)+g,_=v(12,20,_+(x&g|~x&B)+l-1958414417)+x,B=v(17,15,B+(_&x|~_&g)+d-42063)+_,g=v(22,10,g+(B&_|~B&x)+A-1990404162)+B,x=v(7,25,x+(g&B|~g&_)+m+1804603682)+g,_=v(12,20,_+(x&g|~x&B)+p-40341101)+x,B=v(17,15,B+(_&x|~_&g)+E-1502002290)+_,g=v(22,10,g+(B&_|~B&x)+y+1236535329)+B,x=v(5,27,x+(g&_|B&~_)+o-165796510)+g,_=v(9,23,_+(x&B|g&~B)+f-1069501632)+x,B=v(14,18,B+(_&g|x&~g)+A+643717713)+_,g=v(20,12,g+(B&x|_&~x)+n-373897302)+B,x=v(5,27,x+(g&_|B&~_)+c-701558691)+g,_=v(9,23,_+(x&B|g&~B)+d+38016083)+x,B=v(14,18,B+(_&g|x&~g)+y-660478335)+_,g=v(20,12,g+(B&x|_&~x)+a-405537848)+B,x=v(5,27,x+(g&_|B&~_)+l+568446438)+g,_=v(9,23,_+(x&B|g&~B)+E-1019803690)+x,B=v(14,18,B+(_&g|x&~g)+i-187363961)+_,g=v(20,12,g+(B&x|_&~x)+u+1163531501)+B,x=v(5,27,x+(g&_|B&~_)+p-1444681467)+g,_=v(9,23,_+(x&B|g&~B)+s-51403784)+x,B=v(14,18,B+(_&g|x&~g)+h+1735328473)+_,g=v(20,12,g+(B&x|_&~x)+m-1926607734)+B,x=v(4,28,x+(g^B^_)+c-378558)+g,_=v(11,21,_+(x^g^B)+u-2022574463)+x,B=v(16,16,B+(_^x^g)+A+1839030562)+_,g=v(23,9,g+(B^_^x)+E-35309556)+B,x=v(4,28,x+(g^B^_)+o-1530992060)+g,_=v(11,21,_+(x^g^B)+a+1272893353)+x,B=v(16,16,B+(_^x^g)+h-155497632)+_,g=v(23,9,g+(B^_^x)+d-1094730640)+B,x=v(4,28,x+(g^B^_)+p+681279174)+g,_=v(11,21,_+(x^g^B)+n-358537222)+x,B=v(16,16,B+(_^x^g)+i-722521979)+_,g=v(23,9,g+(B^_^x)+f+76029189)+B,x=v(4,28,x+(g^B^_)+l-640364487)+g,_=v(11,21,_+(x^g^B)+m-421815835)+x,B=v(16,16,B+(_^x^g)+y+530742520)+_,g=v(23,9,g+(B^_^x)+s-995338651)+B,x=v(6,26,x+(B^(g|~_))+n-198630844)+g,_=v(10,22,_+(g^(x|~B))+h+1126891415)+x,B=v(15,17,B+(x^(_|~g))+E-1416354905)+_,g=v(21,11,g+(_^(B|~x))+c-57434055)+B,x=v(6,26,x+(B^(g|~_))+m+1700485571)+g,_=v(10,22,_+(g^(x|~B))+i-1894986606)+x,B=v(15,17,B+(x^(_|~g))+d-1051523)+_,g=v(21,11,g+(_^(B|~x))+o-2054922799)+B,x=v(6,26,x+(B^(g|~_))+u+1873313359)+g,_=v(10,22,_+(g^(x|~B))+y-30611744)+x,B=v(15,17,B+(x^(_|~g))+f-1560198380)+_,g=v(21,11,g+(_^(B|~x))+p+1309151649)+B,x=v(6,26,x+(B^(g|~_))+a-145523070)+g,_=v(10,22,_+(g^(x|~B))+A-1120210379)+x,B=v(15,17,B+(x^(_|~g))+s+718787259)+_,g=v(21,11,g+(_^(B|~x))+l-343485551)+B,x=x+C>>>0,g=g+M>>>0,B=B+T>>>0,_=_+I>>>0;return ne.endian([x,g,B,_]);function v(at,mt,X){return X<<at|X>>>mt}};return function(t,r){var n=ne.wordsToBytes(e(t,r)),o=r&&r.asBytes?n:ne.bytesconvertNumberToHex(n);return o}}function L2(e){var t,r,n,o=-1;for(t=e.length-1,r=new ArrayBuffer(e.length),n=new Uint8Array(r);t>o++;)n[o]=e.charCodeAt(o);return n}function v2(e){return Buffer.from(e,"base64").toString("binary")}function Vu(e){return e}function N2(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";return{rotl:function(t,r){return t<<r|t>>>32-r},endian:function(t){if(t.constructor==Number)return ne.rotl(t,8)&16711935|ne.rotl(t,24)&4278255360;for(var r=0;r<t.length;r++)t[r]=ne.endian(t[r]);return t},bytesToWords:function(t){for(var r=[],n=0,o=0;n<t.length;n++,o+=8)r[o>>>5]|=t[n]<<24-o%32;return r},wordsToBytes:function(t){for(var r=[],n=0;n<t.length*32;n+=8)r.push(t[n>>>5]>>>24-n%32&255);return r},bytesconvertNumberToHex:function(t){for(var r=[],n=0;n<t.length;n++)r.push((t[n]>>>4).toString(16)),r.push((t[n]&15).toString(16));return r.join("")}}}var sr=class extends bs{name="md5";options;constructor(t={}){super(),this.options=t}async hash(t,r){let o=await new Promise((s,i)=>ic(t).then(s).catch(i));return ku(o,r)}};var nn=class{constructor(t){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(t={}){xn(t)}async compress(t){return await this.preload(),this.compressSync(t)}async decompress(t,r){return await this.preload(),this.decompressSync(t,r)}compressSync(t){throw new Error(`${this.name}: sync compression not supported`)}decompressSync(t,r){throw new Error(`${this.name}: sync decompression not supported`)}async*compressBatches(t){let r=await this.concatenate(t);yield this.compress(r)}async*decompressBatches(t){let r=await this.concatenate(t);yield this.decompress(r)}concatenate(t){return En(t)}improveError(t){return t.message.includes(this.name)||(t.message=`${this.name} ${t.message}`),t}};var Xn=class extends nn{name="uncompressed";extensions=[];contentEncodings=[];isSupported=!0;options;constructor(t){super(t),this.options=t||{}}compressSync(t){return t}decompressSync(t){return t}async*compressBatches(t){return yield*t}async*decompressBatches(t){return yield*t}};var Ar=xr(Dd(),1),ye=xr(Od(),1);var mr=class extends nn{name="deflate";extensions=[];contentEncodings=["deflate"];isSupported=!0;options;_chunks=[];constructor(t={}){super(t),this.options=t}async compress(t){if(!Et&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await Tr(ye.default.gzip)(t):await Tr(ye.default.deflate)(t);return yr(r)}return this.compressSync(t)}async decompress(t){if(!Et&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await Tr(ye.default.gunzip)(t):await Tr(ye.default.inflate)(t);return yr(r)}return this.decompressSync(t)}compressSync(t){if(!Et&&this.options.deflate?.useZlib){let s=this.options.deflate?.gzip?ye.default.gzipSync(t):ye.default.deflateSync(t);return yr(s)}let r=this.options?.deflate||{},n=new Uint8Array(t);return(this.options?.raw?Ar.default.deflateRaw:Ar.default.deflate)(n,r).buffer}decompressSync(t){if(!Et&&this.options.deflate?.useZlib){let s=this.options.deflate?.gzip?ye.default.gunzipSync(t):ye.default.inflateSync(t);return yr(s)}let r=this.options?.deflate||{},n=new Uint8Array(t);return(this.options?.raw?Ar.default.inflateRaw:Ar.default.inflate)(n,r).buffer}async*compressBatches(t){let r=this.options?.deflate||{},n=new Ar.default.Deflate(r);yield*this.transformBatches(n,t)}async*decompressBatches(t){let r=this.options?.deflate||{},n=new Ar.default.Inflate(r);yield*this.transformBatches(n,t)}async*transformBatches(t,r){t.onData=this._onData.bind(this),t.onEnd=this._onEnd.bind(this);for await(let i of r){let a=new Uint8Array(i);if(!t.push(a,!1))throw new Error(`${this._getError()}write`);yield*this._getChunks()}let n=new Uint8Array(0),o=t.push(n,!0);yield*this._getChunks()}_onData(t){this._chunks.push(t)}_onEnd(t){if(t!==0)throw new Error(this._getError(t)+this._chunks.length)}_getChunks(){let t=this._chunks;return this._chunks=[],t}_getError(t=0){let r={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};return`${this.name}: ${r[t]}`}};var S_={0:async e=>e,8:async e=>await new mr({raw:!0}).decompress(e)},zs=class{fileProvider=null;fileName;archive=null;constructor(t){if(typeof t=="string")if(this.fileName=t,!Et)this.fileProvider=new Tn(t);else throw new Error("Cannot open file for random access in a WEB browser");else t instanceof pr?(this.fileProvider=t.fileProvider,this.archive=t,this.fileName=t.fileName):qs(t)&&(this.fileProvider=t)}async destroy(){this.fileProvider&&await this.fileProvider.destroy()}async readdir(){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let t=[],r=rn(this.fileProvider);for await(let n of r)t.push(n.fileName);return t}async stat(t){let r=await this.getCDFileHeader(t);return{...r,size:Number(r.uncompressedSize)}}async fetch(t){this.fileName&&t.indexOf(this.fileName)===0&&(t=t.substring(this.fileName.length+1));let r;if(this.archive)r=await this.archive.getFile(t,"http");else{if(!this.fileProvider)throw new Error("No data detected in the zip archive");let o=await this.getCDFileHeader(t),s=await or(o.localHeaderOffset,this.fileProvider);if(!s)throw new Error("Local file header has not been found in the zip archive`");let i=S_[s.compressionMethod.toString()];if(!i)throw Error("Only Deflation compression is supported");let a=await this.fileProvider.slice(s.fileDataOffset,s.fileDataOffset+s.compressedSize);r=await i(a)}let n=new Response(r);return Object.defineProperty(n,"url",{value:t?`${this.fileName||""}/${t}`:this.fileName||""}),n}async getCDFileHeader(t){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let r=rn(this.fileProvider),n=null;for await(let o of r)if(o.fileName===t){n=o;break}if(!n)throw new Error("File has not been found in the zip archive");return n}};var pr=class{fileProvider;fileName;constructor(t,r,n){this.fileProvider=t,this.fileName=n}async getFileWithoutHash(t){return await(await new zs(this.fileProvider).fetch(t)).arrayBuffer()}};function kc(e){let t=new DataView(e),r={};for(let n=0;n<e.byteLength;n=n+24){let o=t.getBigUint64(n+16,!0),s=R_(e,n,16);r[s]=o}return r}function R_(e,t,r){return[...new Uint8Array(e,t,r)].map(n=>n.toString(16).padStart(2,"0")).join("")}async function Jc(e){let t=rn(e);return F_(t)}async function F_(e){let t=new sr,r=new TextEncoder,n={};for await(let o of e){let s=o.fileName.split("\\").join("/").toLocaleLowerCase(),i=r.encode(s).buffer,a=await t.hash(i,"hex");n[a]=o.localHeaderOffset}return n}var D_={0:e=>new Xn().decompress(e),8:e=>new mr({raw:!0}).decompress(e)},mn=class extends pr{hashTable;constructor(t,r,n){super(t,r,n),this.hashTable=r}async getFile(t){let r=await this.getFileBytes(t.toLocaleLowerCase());if(r||(r=await this.getFileBytes(t)),!r)throw new Error(`No such file in the archive: ${t}`);return r}async getFileBytes(t){let r;if(this.hashTable){let n=new TextEncoder().encode(t).buffer,o=await new sr().hash(n,"hex"),s=this.hashTable[o];if(s===void 0)return null;let i=await or(s,this.fileProvider);if(!i)return null;let a=await this.fileProvider.slice(i.fileDataOffset,i.fileDataOffset+i.compressedSize),c=D_[i.compressionMethod];if(!c)throw Error("Only Deflation compression is supported");r=await c(a)}else r=await this.getFileWithoutHash(t);return r}};var Ld=async(e,t)=>{let r=await Vn(e,Kn),n=await jn(r,e),o;if(n?.fileName!=="@3dtilesIndex1@")o=await Jc(e),t?.("3tz doesnt contain hash file, hash info has been composed according to zip archive headers");else{let s=await or(n.localHeaderOffset,e);if(!s)throw new Error("corrupted 3tz zip archive");let i=s.fileDataOffset,a=await e.slice(i,i+s.compressedSize);o=kc(a)}return new mn(e,o)};var O_="4.3.0-alpha.3",vd={dataType:null,batchType:null,name:"3tz",id:"3tz",module:"3d-tiles",version:O_,mimeTypes:["application/octet-stream","application/vnd.maxar.archive.3tz+zip"],parse:L_,extensions:["3tz"],options:{}};async function L_(e,t={}){return(await Ld(new ze(new DataView(e)))).getFile(t["3d-tiles-archive"]?.path??"")}function Ue(e,t,r){if(!t)return r+12;let{magic:o,version:s=1,byteLength:i=12}=e;return J(Array.isArray(o)&&Number.isFinite(s)&&Number.isFinite(i)),t.setUint8(r+0,o[0]),t.setUint8(r+1,o[1]),t.setUint8(r+2,o[2]),t.setUint8(r+3,o[3]),t.setUint32(r+4,s,!0),t.setUint32(r+8,i,!0),r+=12,r}function He(e,t,r){e&&e.setUint32(t+8,r,!0)}function Nd(e,t,r,n,o){e={magic:Me.COMPOSITE,tiles:[],...e};let s=r;r+=Ue(e,t,r),t&&t.setUint32(r,e.tiles.length,!0),r+=4;for(let i=0;i<e.tiles.length;++i)r+=o(e.tiles[i],t,r,n);return He(t,s,r-s),r}function Gd(e,t,r,n){let{featuresLength:o=0,batchTable:s}=e,a=JSON.stringify({BATCH_LENGTH:o}),c=s?JSON.stringify(s):"",f=bt(a.length,8),h=c?bt(c.length,8):0;e={magic:Me.BATCHED_MODEL,...e};let u=r;r=Ue(e,t,r),t&&(t.setUint32(12,f,!0),t.setUint32(16,0,!0),t.setUint32(20,h,!0),t.setUint32(24,0,!0)),r+=16,r=Eo(t,r,a,8),s&&(r=Eo(t,r,c,8));let l=e.gltfEncoded;return l&&(r=Bn(t,r,l,l.byteLength)),He(t,u,r-u),r}function Pd(e,t,r,n){let{featuresLength:o=1,gltfFormat:s=1,gltfUri:i=""}=e,a=i.length,c={INSTANCES_LENGTH:o,POSITION:new Array(o*3).fill(0)},f=JSON.stringify(c),h=f.length;e={magic:Me.INSTANCED_MODEL,...e};let u=r;return r=Ue(e,t,0),t&&(t.setUint32(12,h,!0),t.setUint32(16,0,!0),t.setUint32(20,0,!0),t.setUint32(24,0,!0),t.setUint32(28,s,!0)),r+=20,r+=_r(t,r,f,h),r+=_r(t,r,i,a),He(t,u,r-u),r}var v_={POINTS_LENGTH:1,POSITIONS:{byteOffset:0}};function Ud(e,t,r,n){let{featureTableJson:o=v_}=e,s=JSON.stringify(o);s=Ys(s,4);let{featureTableJsonByteLength:i=s.length}=e,a=new ArrayBuffer(12),c=a.byteLength;e={magic:Me.POINT_CLOUD,...e};let f=r;return r+=Ue(e,t,0),t&&(t.setUint32(r+0,i,!0),t.setUint32(r+4,c,!0),t.setUint32(r+8,0,!0),t.setUint32(r+12,0,!0)),r+=16,r+=_r(t,r,s,i),r+=Bn(t,r,a,c),He(t,f,r-f),r}function Qc(e,t){let r=zc(e,null,0,t),n=new ArrayBuffer(r),o=new DataView(n);return zc(e,o,0,t),n}function zc(e,t,r,n){switch(J(typeof e.type=="string"),e.type){case _t.COMPOSITE:return Nd(e,t,r,n,zc);case _t.POINT_CLOUD:return Ud(e,t,r,n);case _t.BATCHED_3D_MODEL:return Gd(e,t,r,n);case _t.INSTANCED_3D_MODEL:return Pd(e,t,r,n);default:throw new Error("3D Tiles: unknown tile type")}}var kd={name:"3D Tile",id:"3d-tiles",module:"3d-tiles",version:Rr,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],binary:!0,options:{["3d-tiles"]:{}},encode:async(e,t)=>Hd(e,t),encodeSync:Hd};function Hd(e,t){return Qc(e,t)}return Xd(lo);})();
8
8
  /*! Bundled license information:
9
9
 
10
10
  long/index.js: