* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{aasC}from"./chunk-IIL7G2BA.js";import{aasv}from"./chunk-ZFTFDHK4.js";import{basz}from"./chunk-CKMJZ5B3.js";import"./chunk-EEKB62LQ.js";import{aasO}from"./chunk-NNHN6WUY.js";import{aasY}from"./chunk-T7ERZ2CJ.js";import{basB,casq,dasy}from"./chunk-GSNDLQ4C.js";import{dasR}from"./chunk-BKSIEBAA.js";import{hasb}from"./chunk-YWRPWWKI.js";import{aasT}from"./chunk-VTVHUB7E.js";import{aasU,basM,dasw}from"./chunk-JMSSU44E.js";import{aasP}from"./chunk-4UYSGV57.js";import"./chunk-ANLJ4KBN.js";import"./chunk-ID6SFQTL.js";import{aasE}from"./chunk-VLPNAR64.js";import{aasN}from"./chunk-GE5NEIZC.js";import{easS}from"./chunk-35CVRQTC.js";varj=newR,K=newR,Q=newU,W=newb;functionF(t,e){leti=t._ellipsoid,m=e.height,s=e.width,h=e.northCap,a=e.southCap,_=m,A=2,o=0,g=4;h&&(A-=1,_-=1,o+=1,g-=2),a&&(A-=1,_-=1,o+=1,g-=2),o+=A*s+2*_-g;letn=newFloat64Array(o*3),l=0,f=0,p,r=Q;if(h)C.computePosition(e,i,!1,f,0,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;elsefor(p=0;p<s;p++)C.computePosition(e,i,!1,f,p,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;for(p=s-1,f=1;f<m;f++)C.computePosition(e,i,!1,f,p,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;if(f=m-1,!a)for(p=s-2;p>=0;p--)C.computePosition(e,i,!1,f,p,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;for(p=0,f=m-2;f>0;f--)C.computePosition(e,i,!1,f,p,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;letu=n.length/3*2,c=O.createTypedArray(n.length/3,u),H=0;for(letD=0;D<n.length/3-1;D++)c[H++]=D,c[H++]=D+1;c[H++]=n.length/3-1,c[H++]=0;letd=newq({attributes:newY,primitiveType:B.LINES});returnd.attributes.position=newy({componentDatatype:T.DOUBLE,componentsPerAttribute:3,values:n}),d.indices=c,d}functionX(t,e){leti=t._surfaceHeight,m=t._extrudedHeight,s=t._ellipsoid,h=F(t,e),a=e.height,_=e.width,A=z.scaleToGeodeticHeight(h.attributes.position.values,i,s,!1),o=A.length,g=newFloat64Array(o*2);g.set(A);letn=z.scaleToGeodeticHeight(h.attributes.position.values,m,s);g.set(n,o),h.attributes.position.values=g;letl=e.northCap,f=e.southCap,p=4;l&&(p-=1),f&&(p-=1);letr=(g.length/3+p)*2,u=O.createTypedArray(g.length/3,r);o=g.length/6;letc=0;for(letd=0;d<o-1;d++)u[c++]=d,u[c++]=d+1,u[c++]=d+o,u[c++]=d+o+1;u[c++]=o-1,u[c++]=0,u[c++]=o+o-1,u[c++]=o,u[c++]=0,u[c++]=o;letH;if(l)H=a-1;else{letd=_-1;u[c++]=d,u[c++]=d+o,H=_+a-2}if(u[c++]=H,u[c++]=H+o,!f){letd=_+H-1;u[c++]=d,u[c]=d+o}returnh.indices=u,h}functionL(t){t=E(t,E.EMPTY_OBJECT);lete=t.rectangle,i=E(t.granularity,P.RADIANS_PER_DEGREE),m=E(t.ellipsoid,w.default),s=E(t.rotation,0);if(!S(e))thrownewN("rectangle is required.");if(b._validate(e),e.north<e.south)thrownewN("options.rectangle.north must be greater than options.rectangle.south");leth=E(t.height,0),a=E(t.extrudedHeight,h);this._rectangle=b.clone(e),this._granularity=i,this._ellipsoid=m,this._surfaceHeight=Math.max(h,a),this._rotation=s,this._extrudedHeight=Math.min(h,a),this._offsetAttribute=t.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}L.packedLength=b.packedLength+w.packedLength+5;L.pack=function(t,e,i){if(!S(t))thrownewN("value is required");if(!S(e))thrownewN("array is required");returni=E(i,0),b.pack(t._rectangle,e,i),i+=b.packedLength,w.pack(t._ellipsoid,e,i),i+=w.packedLength,e[i++]=t._granularity,e[i++]=t._surfaceHeight,e[i++]=t._rotation,e[i++]=t._extrudedHeight,e[i]=E(t._offsetAttribute,-1),e};varV=newb,J=w.clone(w.UNIT_SPHERE),k={rectangle:V,ellipsoid:J,granularity:void0,height:void0,rotation:void0,extrudedHeight:void0,offsetAttribute:void0};L.unpack=function(t,e,i){if(!S(t))thrownewN("array is required");e=E(e,0);letm=b.unpack(t,e,V);e+=b.packedLength;lets=w.unpack(t,e,J);e+=w.packedLength;leth=t[e++],a=t[e++],_=t[e++],A=t[e++],o=t[e];returnS(i)?(i._rectangle=b.clone(m,i._rectangle),i._ellipsoid=w.clone(s,i._ellipsoid),i._surfaceHeight=a,i._rotation=_,i._extrudedHeight=A,i._offsetAttribute=o===-1?void0:o,i):(k.granularity=h,k.height=a,k.rotation=_,k.extrudedHeight=A,k.offsetAttribute=o===-1?void0:o,newL(k))};varZ=newM;L.createGeometry=function(t){lete=t._rectangle,i=t._ellipsoid,m=C.computeOptions(e,t._granularity,t._rotation,0,W,Z),s,h;if(P.equalsEpsilon(e.north,e.south,P.EPSILON10)||P.equalsEpsilon(e.east,e.west,P.EPSILON10))return;leta=t._surfaceHeight,_=t._extrudedHeight,A=!P.equalsEpsilon(a,_,0,P.EPSILON2),o;if(A){if(s=X(t,m),S(t._offsetAttribute)){letl=s.attributes.position.values.length/3,f=newUint8Array(l);t._offsetAttribute===v.TOP?f=f.fill(1,0,l/2):(o=t._offsetAttribute===v.NONE?0:1,f=f.fill(o)),s.attributes.applyOffset=newy({componentDatatype:T.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}letg=R.fromRectangle3D(e,i,a,K),n=R.fromRectangle3D(e,i,_,j);h=R.union(g,n)}else{if(s=F(t,m),s.attributes.position.values=z.scaleToGeodeticHeight(s.attributes.position.values,a,i,!1),S(t._offsetAttribute)){letg=s.attributes.position.values.length;o=t._offsetAttribute===v.NONE?0:1;letn=newUint8Array(g/3).fill(o);s.attributes.applyOffset=newy({componentDatatype:T.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}h=R.fromRectangle3D(e,i,a)}returnnewq({attributes:s.attributes,indices:s.indices,primitiveType:B.LINES,boundingSphere:h,offsetAttribute:t._offsetAttribute})};varx=L;function$(t,e){returnS(e)&&(t=x.unpack(t,e)),t._ellipsoid=w.clone(t._ellipsoid),t._rectangle=b.clone(t._rectangle),x.createGeometry(t)}varEt=$;export{Etasdefault};
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{aasr}from"./chunk-JS6PT4NQ.js";import{aasS}from"./chunk-GHQSI7F2.js";import{aasE}from"./chunk-M5SITFFN.js";import"./chunk-ZPYKVVFF.js";import"./chunk-EEKB62LQ.js";import"./chunk-V3DSE3OK.js";import"./chunk-FMRIJYNG.js";import{aasX}from"./chunk-NNHN6WUY.js";import{aasW}from"./chunk-T7ERZ2CJ.js";import{basK,casQ,dasY}from"./chunk-GSNDLQ4C.js";import{dasj}from"./chunk-BKSIEBAA.js";import"./chunk-YWRPWWKI.js";import{aasH}from"./chunk-VTVHUB7E.js";import{aask,dasb}from"./chunk-JMSSU44E.js";import{aasq}from"./chunk-4UYSGV57.js";import"./chunk-ANLJ4KBN.js";import"./chunk-ID6SFQTL.js";import{aasw}from"./chunk-VLPNAR64.js";import{aasL}from"./chunk-GE5NEIZC.js";import{easu}from"./chunk-35CVRQTC.js";functionZ(t,e,o,i,s,l,p){letg=E.numberOfPoints(t,e,s),f,n=o.red,m=o.green,d=o.blue,T=o.alpha,c=i.red,h=i.green,y=i.blue,V=i.alpha;if(r.equals(o,i)){for(f=0;f<g;f++)l[p++]=r.floatToByte(n),l[p++]=r.floatToByte(m),l[p++]=r.floatToByte(d),l[p++]=r.floatToByte(T);returnp}letM=(c-n)/g,C=(h-m)/g,G=(y-d)/g,_=(V-T)/g,a=p;for(f=0;f<g;f++)l[a++]=r.floatToByte(n+f*M),l[a++]=r.floatToByte(m+f*C),l[a++]=r.floatToByte(d+f*G),l[a++]=r.floatToByte(T+f*_);returna}functionR(t){t=w(t,w.EMPTY_OBJECT);lete=t.positions,o=t.colors,i=w(t.colorsPerVertex,!1);if(!u(e)||e.length<2)thrownewL("At least two positions are required.");if(u(o)&&(i&&o.length<e.length||!i&&o.length<e.length-1))thrownewL("colors has an invalid length.");this._positions=e,this._colors=o,this._colorsPerVertex=i,this._arcType=w(t.arcType,S.GEODESIC),this._granularity=w(t.granularity,q.RADIANS_PER_DEGREE),this._ellipsoid=w(t.ellipsoid,b.default),this._workerName="createSimplePolylineGeometry";lets=1+e.length*k.packedLength;s+=u(o)?1+o.length*r.packedLength:1,this.packedLength=s+b.packedLength+3}R.pack=function(t,e,o){if(!u(t))thrownewL("value is required");if(!u(e))thrownewL("array is required");o=w(o,0);leti,s=t._positions,l=s.length;for(e[o++]=l,i=0;i<l;++i,o+=k.packedLength)k.pack(s[i],e,o);letp=t._colors;for(l=u(p)?p.length:0,e[o++]=l,i=0;i<l;++i,o+=r.packedLength)r.pack(p[i],e,o);returnb.pack(t._ellipsoid,e,o),o+=b.packedLength,e[o++]=t._colorsPerVertex?1:0,e[o++]=t._arcType,e[o]=t._granularity,e};R.unpack=function(t,e,o){if(!u(t))thrownewL("array is required");e=w(e,0);leti,s=t[e++],l=newArray(s);for(i=0;i<s;++i,e+=k.packedLength)l[i]=k.unpack(t,e);s=t[e++];letp=s>0?newArray(s):void0;for(i=0;i<s;++i,e+=r.packedLength)p[i]=r.unpack(t,e);letg=b.unpack(t,e);e+=b.packedLength;letf=t[e++]===1,n=t[e++],m=t[e];returnu(o)?(o._positions=l,o._colors=p,o._ellipsoid=g,o._colorsPerVertex=f,o._arcType=n,o._granularity=m,o):newR({positions:l,colors:p,ellipsoid:g,colorsPerVertex:f,arcType:n,granularity:m})};varF=newArray(2),N=newArray(2),$={positions:F,height:N,ellipsoid:void0,minDistance:void0,granularity:void0};R.createGeometry=function(t){lete=t._positions,o=t._colors,i=t._colorsPerVertex,s=t._arcType,l=t._granularity,p=t._ellipsoid,g=q.chordLength(l,p.maximumRadius),f=u(o)&&!i,n,m=e.length,d,T,c,h,y=0;if(s===S.GEODESIC||s===S.RHUMB){let_,a,P;s===S.GEODESIC?(_=q.chordLength(l,p.maximumRadius),a=E.numberOfPoints,P=E.generateArc):(_=l,a=E.numberOfPointsRhumbLine,P=E.generateRhumbArc);letv=E.extractHeights(e,p),B=$;if(s===S.GEODESIC?B.minDistance=g:B.granularity=l,B.ellipsoid=p,f){letA=0;for(n=0;n<m-1;n++)A+=a(e[n],e[n+1],_)+1;d=newFloat64Array(A*3),c=newUint8Array(A*4),B.positions=F,B.height=N;letD=0;for(n=0;n<m-1;++n){F[0]=e[n],F[1]=e[n+1],N[0]=v[n],N[1]=v[n+1];letO=P(B);if(u(o)){letz=O.length/3;h=o[n];for(letU=0;U<z;++U)c[D++]=r.floatToByte(h.red),c[D++]=r.floatToByte(h.green),c[D++]=r.floatToByte(h.blue),c[D++]=r.floatToByte(h.alpha)}d.set(O,y),y+=O.length}}elseif(B.positions=e,B.height=v,d=newFloat64Array(P(B)),u(o)){for(c=newUint8Array(d.length/3*4),n=0;n<m-1;++n){letD=e[n],O=e[n+1],z=o[n],U=o[n+1];y=Z(D,O,z,U,g,c,y)}letA=o[m-1];c[y++]=r.floatToByte(A.red),c[y++]=r.floatToByte(A.green),c[y++]=r.floatToByte(A.blue),c[y++]=r.floatToByte(A.alpha)}}else{T=f?m*2-2:m,d=newFloat64Array(T*3),c=u(o)?newUint8Array(T*4):void0;let_=0,a=0;for(n=0;n<m;++n){letP=e[n];if(f&&n>0&&(k.pack(P,d,_),_+=3,h=o[n-1],c[a++]=r.floatToByte(h.red),c[a++]=r.floatToByte(h.green),c[a++]=r.floatToByte(h.blue),c[a++]=r.floatToByte(h.alpha)),f&&n===m-1)break;k.pack(P,d,_),_+=3,u(o)&&(h=o[n],c[a++]=r.floatToByte(h.red),c[a++]=r.floatToByte(h.green),c[a++]=r.floatToByte(h.blue),c[a++]=r.floatToByte(h.alpha))}}letV=newW;V.position=newY({componentDatatype:H.DOUBLE,componentsPerAttribute:3,values:d}),u(o)&&(V.color=newY({componentDatatype:H.UNSIGNED_BYTE,componentsPerAttribute:4,values:c,normalize:!0})),T=d.length/3;letM=(T-1)*2,C=X.createTypedArray(T,M),G=0;for(n=0;n<T-1;++n)C[G++]=n,C[G++]=n+1;returnnewQ({attributes:V,indices:C,primitiveType:K.LINES,boundingSphere:j.fromPoints(e)})};varJ=R;functionx(t,e){returnu(e)&&(t=J.unpack(t,e)),t._ellipsoid=b.clone(t._ellipsoid),J.createGeometry(t)}var_e=x;export{_easdefault};
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{aassr,basfr}from"./chunk-AZ3SWEDV.js";import{aastr}from"./chunk-PWAJ3RAI.js";import{aasUe}from"./chunk-R3AL5FUL.js";import{aasar}from"./chunk-O3CFQFRB.js";import"./chunk-CXNPIJLB.js";import"./chunk-FNJKWSPR.js";import{aasnr}from"./chunk-KSZ5EBRB.js";import"./chunk-V3DSE3OK.js";import"./chunk-FMRIJYNG.js";import{dasir}from"./chunk-BKSIEBAA.js";import{basxe,gasrr,hasae}from"./chunk-YWRPWWKI.js";import"./chunk-VTVHUB7E.js";import{aasie,caser,dasIe}from"./chunk-JMSSU44E.js";import{aasge}from"./chunk-4UYSGV57.js";import"./chunk-ANLJ4KBN.js";import{aasHe}from"./chunk-ID6SFQTL.js";import{aasY}from"./chunk-VLPNAR64.js";import{aashe}from"./chunk-GE5NEIZC.js";import{casIr,dasxr,easG}from"./chunk-35CVRQTC.js";varur=Ir((qr,Te)=>{/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){varD=function(){varA={};A.defaultNoDataValue=-34027999387901484e22,A.decode=function(r,a){a=a||{};vart=a.encodedMaskData||a.encodedMaskData===null,i=n(r,a.inputOffset||0,t),o=a.noDataValue!==null?a.noDataValue:A.defaultNoDataValue,s=V(i,a.pixelType||Float32Array,a.encodedMaskData,o,a.returnMask),u={width:i.width,height:i.height,pixelData:s.resultPixels,minValue:s.minValue,maxValue:i.pixels.maxValue,noDataValue:o};returns.resultMask&&(u.maskData=s.resultMask),a.returnEncodedMask&&i.mask&&(u.encodedMaskData=i.mask.bitset?i.mask.bitset:null),a.returnFileInfo&&(u.fileInfo=b(i),a.computeUsedBitDepths&&(u.fileInfo.bitDepths=X(i))),u};varV=function(r,a,t,i,o){vars=0,u=r.pixels.numBlocksX,m=r.pixels.numBlocksY,l=Math.floor(r.width/u),f=Math.floor(r.height/m),h=2*r.maxZError,c=Number.MAX_VALUE,g;t=t||(r.mask?r.mask.bitset:null);varv,U;v=newa(r.width*r.height),o&&t&&(U=newUint8Array(r.width*r.height));for(varM=newFloat32Array(l*f),S,I,k=0;k<=m;k++){varw=k!==m?f:r.height%m;if(w!==0)for(vard=0;d<=u;d++){varx=d!==u?l:r.width%u;if(x!==0){varT=k*r.width*f+d*l,y=r.width-x,p=r.pixels.blocks[s],L,B,E;p.encoding<2?(p.encoding===0?L=p.rawData:(e(p.stuffedData,p.bitsPerPixel,p.numValidPixels,p.offset,h,M,r.pixels.maxValue),L=M),B=0):p.encoding===2?E=0:E=p.offset;varO;if(t)for(I=0;I<w;I++){for(T&7&&(O=t[T>>3],O<<=T&7),S=0;S<x;S++)T&7||(O=t[T>>3]),O&128?(U&&(U[T]=1),g=p.encoding<2?L[B++]:E,c=c>g?g:c,v[T++]=g):(U&&(U[T]=0),v[T++]=i),O<<=1;T+=y}elseif(p.encoding<2)for(I=0;I<w;I++){for(S=0;S<x;S++)g=L[B++],c=c>g?g:c,v[T++]=g;T+=y}elsefor(c=c>E?E:c,I=0;I<w;I++){for(S=0;S<x;S++)v[T++]=E;T+=y}if(p.encoding===1&&B!==p.numValidPixels)throw"Block and Mask do not match";s++}}}return{resultPixels:v,resultMask:U,minValue:c}},b=function(r){return{fileIdentifierString:r.fileIdentifierString,fileVersion:r.fileVersion,imageType:r.imageType,height:r.height,width:r.width,maxZError:r.maxZError,eofOffset:r.eofOffset,mask:r.mask?{numBlocksX:r.mask.numBlocksX,numBlocksY:r.mask.numBlocksY,numBytes:r.mask.numBytes,maxValue:r.mask.maxValue}:null,pixels:{numBlocksX:r.pixels.numBlocksX,numBlocksY:r.pixels.numBlocksY,numBytes:r.pixels.numBytes,maxValue:r.pixels.maxValue,noDataValue:r.noDataValue}}},X=function(r){for(vara=r.pixels.numBlocksX*r.pixels.numBlocksY,t={},i=0;i<a;i++){varo=r.pixels.blocks[i];o.encoding===0?t.float32=!0:o.encoding===1?t[o.bitsPerPixel]=!0:t[0]=!0}returnObject.keys(t)},n=function(r,a,t){vari={},o=newUint8Array(r,a,10);if(i.fileIdentifierString=String.fromCharCode.apply(null,o),i.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+i.fileIdentifierString;a+=10;vars=newDataView(r,a,24);if(i.fileVersion=s.getInt32(0,!0),i.imageType=s.getInt32(4,!0),i.height=s.getUint32(8,!0),i.width=s.getUint32(12,!0),i.maxZError=s.getFloat64(16,!0),a+=24,!t)if(s=newDataView(r,a,16),i.mask={},i.mask.numBlocksY=s.getUint32(0,!0),i.mask.numBlocksX=s.getUint32(4,!0),i.mask.numBytes=s.getUint32(8,!0),i.mask.maxValue=s.getFloat32(12,!0),a+=16,i.mask.numBytes>0){varu=newUint8Array(Math.ceil(i.width*i.height/8));s=newDataView(r,a,i.mask.numBytes);varm=s.getInt16(0,!0),l=2,f=0;do{if(m>0)for(;m--;)u[f++]=s.getUint8(l++);else{varh=s.getUint8(l++);for(m=-m;m--;)u[f++]=h}m=s.getInt16(l,!0),l+=2}while(l<i.mask.numBytes);if(m!==-32768||f<u.length)throw"Unexpected end of mask RLE encoding";i.mask.bitset=u,a+=i.mask.numBytes}else(i.mask.numBytes|i.mask.numBlocksY|i.mask.maxValue)===0&&(i.mask.bitset=newUint8Array(Math.ceil(i.width*i.height/8)));s=newDataView(r,a,16),i.pixels={},i.pixels.numBlocksY=s.getUint32(0,!0),i.pixels.numBlocksX=s.getUint32(4,!0),i.pixels.numBytes=s.getUint32(8,!0),i.pixels.maxValue=s.getFloat32(12,!0),a+=16;varc=i.pixels.numBlocksX,g=i.pixels.numBlocksY,v=c+(i.width%c>0?1:0),U=g+(i.height%g>0?1:0);i.pixels.blocks=newArray(v*U);for(varM=0,S=0;S<U;S++)for(varI=0;I<v;I++){vark=0,w=r.byteLength-a;s=newDataView(r,a,Math.min(10,w));vard={};i.pixels.blocks[M++]=d;varx=s.getUint8(0);if(k++,d.encoding=x&63,d.encoding>3)throw"Invalid block encoding ("+d.encoding+")";if(d.encoding===2){a++;continue}if(x!==0&&x!==2){if(x>>=6,d.offsetType=x,x===2)d.offset=s.getInt8(1),k++;elseif(x===1)d.offset=s.getInt16(1,!0),k+=2;elseif(x===0)d.offset=s.getFloat32(1,!0),k+=4;elsethrow"Invalid block offset type";if(d.encoding===1)if(x=s.getUint8(k),k++,d.bitsPerPixel=x&63,x>>=6,d.numValidPixelsType=x,x===2)d.numValidPixels=s.getUint8(k),k++;elseif(x===1)d.numValidPixels=s.getUint16(k,!0),k+=2;elseif(x===0)d.numValidPixels=s.getUint32(k,!0),k+=4;elsethrow"Invalid valid pixel count type"}if(a+=k,d.encoding!==3){varT,y;if(d.encoding===0){varp=(i.pixels.numBytes-1)/4;if(p!==Math.floor(p))throw"uncompressed block has invalid length";T=newArrayBuffer(p*4),y=newUint8Array(T),y.set(newUint8Array(r,a,p*4));varL=newFloat32Array(T);d.rawData=L,a+=p*4}elseif(d.encoding===1){varB=Math.ceil(d.numValidPixels*d.bitsPerPixel/8),E=Math.ceil(B/4);T=newArrayBuffer(E*4),y=newUint8Array(T),y.set(newUint8Array(r,a,B)),d.stuffedData=newUint32Array(T),a+=B}}}returni.eofOffset=a,i},e=function(r,a,t,i,o,s,u){varm=(1<<a)-1,l=0,f,h=0,c,g,v=Math.ceil((u-i)/o),U=r.length*4-Math.ceil(a*t/8);for(r[r.length-1]<<=8*U,f=0;f<t;f++){if(h===0&&(g=r[l++],h=32),h>=a)c=g>>>h-a&m,h-=a;else{varM=a-h;c=(g&m)<<M&m,g=r[l++],h=32-M,c+=g>>>h}s[f]=c<v?i+c*o:u}returns};returnA}(),se=function(){"use strict";varA={unstuff:function(n,e,r,a,t,i,o,s){varu=(1<<r)-1,m=0,l,f=0,h,c,g,v,U=n.length*4-Math.ceil(r*a/8);if(n[n.length-1]<<=8*U,t)for(l=0;l<a;l++)f===0&&(c=n[m++],f=32),f>=r?(h=c>>>f-r&u,f-=r):(g=r-f,h=(c&u)<<g&u,c=n[m++],f=32-g,h+=c>>>f),e[l]=t[h];elsefor(v=Math.ceil((s-i)/o),l=0;l<a;l++)f===0&&(c=n[m++],f=32),f>=r?(h=c>>>f-r&u,f-=r):(g=r-f,h=(c&u)<<g&u,c=n[m++],f=32-g,h+=c>>>f),e[l]=h<v?i+h*o:s},unstuffLUT:function(n,e,r,a,t,i){varo=(1<<e)-1,s=0,u=0,m=0,l=0,f=0,h,c=[],g=n.length*4-Math.ceil(e*r/8);n[n.length-1]<<=8*g;varv=Math.ceil((i-a)/t);for(u=0;u<r;u++)l===0&&(h=n[s++],l=32),l>=e?(f=h>>>l-e&o,l-=e):(m=e-l,f=(h&o)<<m&o,h=n[s++],l=32-m,f+=h>>>l),c[u]=f<v?a+f*t:i;returnc.unshift(a),c},unstuff2:function(n,e,r,a,t,i,o,s){varu=(1<<r)-1,m=0,l,f=0,h=0,c,g,v;if(t)for(l=0;l<a;l++)f===0&&(g=n[m++],f=32,h=0),f>=r?(c=g>>>h&u,f-=r,h+=r):(v=r-f,c=g>>>h&u,g=n[m++],f=32-v,c|=(g&(1<<v)-1)<<r-v,h=v),e[l]=t[c];else{varU=Math.ceil((s-i)/o);for(l=0;l<a;l++)f===0&&(g=n[m++],f=32,h=0),f>=r?(c=g>>>h&u,f-=r,h+=r):(v=r-f,c=g>>>h&u,g=n[m++],f=32-v,c|=(g&(1<<v)-1)<<r-v,h=v),e[l]=c<U?i+c*o:s}returne},unstuffLUT2:function(n,e,r,a,t,i){varo=(1<<e)-1,s=0,u=0,m=0,l=0,f=0,h=0,c,g=[],v=Math.ceil((i-a)/t);for(u=0;u<r;u++)l===0&&(c=n[s++],l=32,h=0),l>=e?(f=c>>>h&o,l-=e,h+=e):(m=e-l,f=c>>>h&o,c=n[s++],l=32-m,f|=(c&(1<<m)-1)<<e-m,h=m),g[u]=f<v?a+f*t:i;returng.unshift(a),g},originalUnstuff:function(n,e,r,a){vart=(1<<r)-1,i=0,o,s=0,u,m,l,f=n.length*4-Math.ceil(r*a/8);for(n[n.length-1]<<=8*f,o=0;o<a;o++)s===0&&(m=n[i++],s=32),s>=r?(u=m>>>s-r&t,s-=r):(l=r-s,u=(m&t)<<l&t,m=n[i++],s=32-l,u+=m>>>s),e[o]=u;returne},originalUnstuff2:function(n,e,r,a){vart=(1<<r)-1,i=0,o,s=0,u=0,m,l,f;for(o=0;o<a;o++)s===0&&(l=n[i++],s=32,u=0),s>=r?(m=l>>>u&t,s-=r,u+=r):(f=r-s,m=l>>>u&t,l=n[i++],s=32-f,m|=(l&(1<<f)-1)<<r-f,u=f),e[o]=m;returne}},V={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(n){for(vare=65535,r=65535,a=n.length,t=Math.floor(a/2),i=0;t;){varo=t>=359?359:t;t-=o;doe+=n[i++]<<8,r+=e+=n[i++];while(--o);e=(e&65535)+(e>>>16),r=(r&65535)+(r>>>16)}returna&1&&(r+=e+=n[i]<<8),e=(e&65535)+(e>>>16),r=(r&65535)+(r>>>16),(r<<16|e)>>>0},readHeaderInfo:function(n,e){varr=e.ptr,a=newUint8Array(n,r,6),t={};if(t.fileIdentifierString=String.fromCharCode.apply(null,a),t.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+t.fileIdentifierString;r+=6;vari=newDataView(n,r,8),o=i.getInt32(0,!0);t.fileVersion=o,r+=4,o>=3&&(t.checksum=i.getUint32(4,!0),r+=4),i=newDataView(n,r,12),t.height=i.getUint32(0,!0),t.width=i.getUint32(4,!0),r+=8,o>=4?(t.numDims=i.getUint32(8,!0),r+=4):t.numDims=1,i=newDataView(n,r,40),t.numValidPixel=i.getUint32(0,!0),t.microBlockSize=i.getInt32(4,!0),t.blobSize=i.getInt32(8,!0),t.imageType=i.getInt32(12,!0),t.maxZError=i.getFloat64(16,!0),t.zMin=i.getFloat64(24,!0),t.zMax=i.getFloat64(32,!0),r+=40,e.headerInfo=t,e.ptr=r;vars,u;if(o>=3&&(u=o>=4?52:48,s=this.computeChecksumFletcher32(newUint8Array(n,r-u,t.blobSize-14)),s!==t.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(n,e){varr=e.headerInfo,a=this.getDataTypeArray(r.imageType),t=r.numDims*this.getDataTypeSize(r.imageType),i=this.readSubArray(n,e.ptr,a,t),o=this.readSubArray(n,e.ptr+t,a,t);e.ptr+=2*t;vars,u=!0;for(s=0;s<r.numDims;s++)if(i[s]!==o[s]){u=!1;break}returnr.minValues=i,r.maxValues=o,u},readSubArray:function(n,e,r,a){vart;if(r===Uint8Array)t=newUint8Array(n,e,a);else{vari=newArrayBuffer(a),o=newUint8Array(i);o.set(newUint8Array(n,e,a)),t=newr(i)}returnt},readMask:function(n,e){varr=e.ptr,a=e.headerInfo,t=a.width*a.height,i=a.numValidPixel,o=newDataView(n,r,4),s={};if(s.numBytes=o.getUint32(0,!0),r+=4,(i===0||t===i)&&s.numBytes!==0)throw"invalid mask";varu,m;if(i===0)u=newUint8Array(Math.ceil(t/8)),s.bitset=u,m=newUint8Array(t),e.pixels.resultMask=m,r+=s.numBytes;elseif(s.numBytes>0){u=newUint8Array(Math.ceil(t/8)),o=newDataView(n,r,s.numBytes);varl=o.getInt16(0,!0),f=2,h=0,c=0;do{if(l>0)for(;l--;)u[h++]=o.getUint8(f++);elsefor(c=o.getUint8(f++),l=-l;l--;)u[h++]=c;l=o.getInt16(f,!0),f+=2}while(f<s.numBytes);if(l!==-32768||h<u.length)throw"Unexpected end of mask RLE encoding";m=newUint8Array(t);varg=0,v=0;for(v=0;v<t;v++)v&7?(g=u[v>>3],g<<=v&7):g=u[v>>3],g&128&&(m[v]=1);e.pixels.resultMask=m,s.bitset=u,r+=s.numBytes}returne.ptr=r,e.mask=s,!0},readDataOneSweep:function(n,e,r){vara=e.ptr,t=e.headerInfo,i=t.numDims,o=t.width*t.height,s=t.imageType,u=t.numValidPixel*V.getDataTypeSize(s)*i,m,l=e.pixels.resultMask;if(r===Uint8Array)m=newUint8Array(n,a,u);else{varf=newArrayBuffer(u),h=newUint8Array(f);h.set(newUint8Array(n,a,u)),m=newr(f)}if(m.length===o*i)e.pixels.resultPixels=m;else{e.pixels.resultPixels=newr(o*i);varc=0,g=0,v=0,U=0;if(i>1)for(v=0;v<i;v++)for(U=v*o,g=0;g<o;g++)l[g]&&(e.pixels.resultPixels[U+g]=m[c++]);elsefor(g=0;g<o;g++)l[g]&&(e.pixels.resultPixels[g]=m[c++])}returna+=u,e.ptr=a,!0},readHuffmanTree:function(n,e){varr=this.HUFFMAN_LUT_BITS_MAX,a=newDataView(n,e.ptr,16);e.ptr+=16;vart=a.getInt32(0,!0);if(t<2)throw"unsupported Huffman version";vari=a.getInt32(4,!0),o=a.getInt32(8,!0),s=a.getInt32(12,!0);if(o>=s)return!1;varu=newUint32Array(s-o);V.decodeBits(n,e,u);varm=[],l,f,h,c;for(l=o;l<s;l++)f=l-(l<i?0:i),m[f]={first:u[l-o],second:null};varg=n.byteLength-e.ptr,v=Math.ceil(g/4),U=newArrayBuffer(v*4),M=newUint8Array(U);M.set(newUint8Array(n,e.ptr,g));varS=newUint32Array(U),I=0,k,w=0;for(k=S[0],l=o;l<s;l++)f=l-(l<i?0:i),c=m[f].first,c>0&&(m[f].second=k<<I>>>32-c,32-I>=c?(I+=c,I===32&&(I=0,w++,k=S[w])):(I+=c-32,w++,k=S[w],m[f].second|=k>>>32-I));vard=0,x=0,T=newb;for(l=0;l<m.length;l++)m[l]!==void0&&(d=Math.max(d,m[l].first));d>=r?x=r:x=d,d>=30&&console.log("WARning, large NUM LUT BITS IS "+d);vary=[],p,L,B,E,O,F;for(l=o;l<s;l++)if(f=l-(l<i?0:i),c=m[f].first,c>0)if(p=[c,f],c<=x)for(L=m[f].second<<x-c,B=1<<x-c,h=0;h<B;h++)y[L|h]=p;elsefor(L=m[f].second,F=T,E=c-1;E>=0;E--)O=L>>>E&1,O?(F.right||(F.right=newb),F=F.right):(F.left||(F.left=newb),F=F.left),E===0&&!F.val&&(F.val=p[1]);return{decodeLut:y,numBitsLUTQick:x,numBitsLUT:d,tree:T,stuffedData:S,srcPtr:w,bitPos:I}},readHuffman:function(n,e,r){vara=e.headerInfo,t=a.numDims,i=e.headerInfo.height,o=e.headerInfo.width,s=o*i,u=this.readHuffmanTree(n,e),m=u.decodeLut,l=u.tree,f=u.stuffedData,h=u.srcPtr,c=u.bitPos,g=u.numBitsLUTQick,v=u.numBitsLUT,U=e.headerInfo.imageType===0?128:0,M,S,I,k=e.pixels.resultMask,w,d,x,T,y,p,L,B=0;c>0&&(h++,c=0);varE=f[h],O=e.encodeMode===1,F=newr(s*t),N=F,z;for(z=0;z<a.numDims;z++){if(t>1&&(N=newr(F.buffer,s*z,s),B=0),e.headerInfo.numValidPixel===o*i)for(p=0,T=0;T<i;T++)for(y=0;y<o;y++,p++){if(S=0,w=E<<c>>>32-g,d=w,32-c<g&&(w|=f[h+1]>>>64-c-g,d=w),m[d])S=m[d][1],c+=m[d][0];elsefor(w=E<<c>>>32-v,d=w,32-c<v&&(w|=f[h+1]>>>64-c-v,d=w),M=l,L=0;L<v;L++)if(x=w>>>v-L-1&1,M=x?M.right:M.left,!(M.left||M.right)){S=M.val,c=c+L+1;break}c>=32&&(c-=32,h++,E=f[h]),I=S-U,O?(y>0?I+=B:T>0?I+=N[p-o]:I+=B,I&=255,N[p]=I,B=I):N[p]=I}elsefor(p=0,T=0;T<i;T++)for(y=0;y<o;y++,p++)if(k[p]){if(S=0,w=E<<c>>>32-g,d=w,32-c<g&&(w|=f[h+1]>>>64-c-g,d=w),m[d])S=m[d][1],c+=m[d][0];elsefor(w=E<<c>>>32-v,d=w,32-c<v&&(w|=f[h+1]>>>64-c-v,d=w),M=l,L=0;L<v;L++)if(x=w>>>v-L-1&1,M=x?M.right:M.left,!(M.left||M.right)){S=M.val,c=c+L+1;break}c>=32&&(c-=32,h++,E=f[h]),I=S-U,O?(y>0&&k[p-1]?I+=B:T>0&&k[p-o]?I+=N[p-o]:I+=B,I&=255,N[p]=I,B=I):N[p]=I}e.ptr=e.ptr+(h+1)*4+(c>0?4:0)}e.pixels.resultPixels=F},decodeBits:function(n,e,r,a,t){{vari=e.headerInfo,o=i.fileVersion,s=0,u=newDataView(n,e.ptr,5),m=u.getUint8(0);s++;varl=m>>6,f=l===0?4:3-l,h=(m&32)>0,c=m&31,g=0;if(f===1)g=u.getUint8(s),s++;elseif(f===2)g=u.getUint16(s,!0),s+=2;elseif(f===4)g=u.getUint32(s,!0),s+=4;elsethrow"Invalid valid pixel count type";varv=2*i.maxZError,U,M,S,I,k,w,d,x,T,y,p=i.numDims>1?i.maxValues[t]:i.zMax;if(h){for(e.counter.lut++,x=u.getUint8(s),T=c,s++,I=Math.ceil((x-1)*c/8),k=Math.ceil(I/4),M=newArrayBuffer(k*4),S=newUint8Array(M),e.ptr+=s,S.set(newUint8Array(n,e.ptr,I)),d=newUint32Array(M),e.ptr+=I,y=0;x-1>>>y;)y++;I=Math.ceil(g*y/8),k=Math.ceil(I/4),M=newArrayBuffer(k*4),S=newUint8Array(M),S.set(newUint8Array(n,e.ptr,I)),U=newUint32Array(M),e.ptr+=I,o>=3?w=A.unstuffLUT2(d,c,x-1,a,v,p):w=A.unstuffLUT(d,c,x-1,a,v,p),o>=3?A.unstuff2(U,r,y,g,w):A.unstuff(U,r,y,g,w)}elsee.counter.bitstuffer++,y=c,e.ptr+=s,y>0&&(I=Math.ceil(g*y/8),k=Math.ceil(I/4),M=newArrayBuffer(k*4),S=newUint8Array(M),S.set(newUint8Array(n,e.ptr,I)),U=newUint32Array(M),e.ptr+=I,o>=3?a==null?A.originalUnstuff2(U,r,y,g):A.unstuff2(U,r,y,g,!1,a,v,p):a==null?A.originalUnstuff(U,r,y,g):A.unstuff(U,r,y,g,!1,a,v,p))}},readTiles:function(n,e,r){vara=e.headerInfo,t=a.width,i=a.height,o=a.microBlockSize,s=a.imageType,u=V.getDataTypeSize(s),m=Math.ceil(t/o),l=Math.ceil(i/o);e.pixels.numBlocksY=l,e.pixels.numBlocksX=m,e.pixels.ptr=0;varf=0,h=0,c=0,g=0,v=0,U=0,M=0,S=0,I=0,k=0,w=0,d=0,x=0,T=0,y=0,p=0,L,B,E,O,F,N,z=newr(o*o),ke=i%o||o,ye=t%o||o,J,Z,ue=a.numDims,te,j=e.pixels.resultMask,q=e.pixels.resultPixels;for(c=0;c<l;c++)for(v=c!==l-1?o:ke,g=0;g<m;g++)for(U=g!==m-1?o:ye,w=c*t*o+g*o,d=t-U,te=0;te<ue;te++){if(ue>1&&(q=newr(e.pixels.resultPixels.buffer,t*i*te*u,t*i)),M=n.byteLength-e.ptr,L=newDataView(n,e.ptr,Math.min(10,M)),B={},p=0,S=L.getUint8(0),p++,I=S>>6&255,k=S>>2&15,k!==(g*o>>3&15))throw"integrity issue";if(N=S&3,N>3)throwe.ptr+=p,"Invalid block encoding ("+N+")";if(N===2){e.counter.constant++,e.ptr+=p;continue}elseif(N===0){if(e.counter.uncompressed++,e.ptr+=p,x=v*U*u,T=n.byteLength-e.ptr,x=x<T?x:T,E=newArrayBuffer(x%u===0?x:x+u-x%u),O=newUint8Array(E),O.set(newUint8Array(n,e.ptr,x)),F=newr(E),y=0,j)for(f=0;f<v;f++){for(h=0;h<U;h++)j[w]&&(q[w]=F[y++]),w++;w+=d}elsefor(f=0;f<v;f++){for(h=0;h<U;h++)q[w++]=F[y++];w+=d}e.ptr+=y*u}elseif(J=V.getDataTypeUsed(s,I),Z=V.getOnePixel(B,p,J,L),p+=V.getDataTypeSize(J),N===3)if(e.ptr+=p,e.counter.constantoffset++,j)for(f=0;f<v;f++){for(h=0;h<U;h++)j[w]&&(q[w]=Z),w++;w+=d}elsefor(f=0;f<v;f++){for(h=0;h<U;h++)q[w++]=Z;w+=d}elseif(e.ptr+=p,V.decodeBits(n,e,z,Z,te),p=0,j)for(f=0;f<v;f++){for(h=0;h<U;h++)j[w]&&(q[w]=z[p++]),w++;w+=d}elsefor(f=0;f<v;f++){for(h=0;h<U;h++)q[w++]=z[p++];w+=d}}},formatFileInfo:function(n){return{fileIdentifierString:n.headerInfo.fileIdentifierString,fileVersion:n.headerInfo.fileVersion,imageType:n.headerInfo.imageType,height:n.headerInfo.height,width:n.headerInfo.width,numValidPixel:n.headerInfo.numValidPixel,microBlockSize:n.headerInfo.microBlockSize,blobSize:n.headerInfo.blobSize,maxZError:n.headerInfo.maxZError,pixelType:V.getPixelType(n.headerInfo.imageType),eofOffset:n.eofOffset,mask:n.mask?{numBytes:n.mask.numBytes}:null,pixels:{numBlocksX:n.pixels.numBlocksX,numBlocksY:n.pixels.numBlocksY,maxValue:n.headerInfo.zMax,minValue:n.headerInfo.zMin,noDataValue:n.noDataValue}}},constructConstantSurface:function(n){vare=n.headerInfo.zMax,r=n.headerInfo.numDims,a=n.headerInfo.height*n.headerInfo.width,t=a*r,i=0,o=0,s=0,u=n.pixels.resultMask;if(u)if(r>1)for(i=0;i<r;i++)for(s=i*a,o=0;o<a;o++)u[o]&&(n.pixels.resultPixels[s+o]=e);elsefor(o=0;o<a;o++)u[o]&&(n.pixels.resultPixels[o]=e);elseif(n.pixels.resultPixels.fill)n.pixels.resultPixels.fill(e);elsefor(o=0;o<t;o++)n.pixels.resultPixels[o]=e},getDataTypeArray:function(n){vare;switch(n){case0:e=Int8Array;break;case1:e=Uint8Array;break;case2:e=Int16Array;break;case3:e=Uint16Array;break;case4:e=Int32Array;break;case5:e=Uint32Array;break;case6:e=Float32Array;break;case7:e=Float64Array;break;default:e=Float32Array}returne},getPixelType:function(n){vare;switch(n){case0:e="S8";break;case1:e="U8";break;case2:e="S16";break;case3:e="U16";break;case4:e="S32";break;case5:e="U32";break;case6:e="F32";break;case7:e="F64";break;default:e="F32"}returne},isValidPixelValue:function(n,e){if(e==null)return!1;varr;switch(n){case0:r=e>=-128&&e<=127;break;case1:r=e>=0&&e<=255;break;case2:r=e>=-32768&&e<=32767;break;case3:r=e>=0&&e<=65536;break;case4:r=e>=-2147483648&&e<=2147483647;break;case5:r=e>=0&&e<=4294967296;break;case6:r=e>=-34027999387901484e22&&e<=34027999387901484e22;break;case7:r=e>=5e-324&&e<=17976931348623157e292;break;default:r=!1}returnr},getDataTypeSize:function(n){vare=0;switch(n){case0:case1:e=1;break;case2:case3:e=2;break;case4:case5:case6:e=4;break;case7:e=8;break;default:e=n}returne},getDataTypeUsed:function(n,e){varr=n;switch(n){case2:case4:r=n-e;break;case3:case5:r=n-2*e;break;case6:e===0?r=n:e===1?r=2:r=1;break;case7:e===0?r=n:r=n-2*e+1;break;default:r=n;break}returnr},getOnePixel:function(n,e,r,a){vart=0;switch(r){case0:t=a.getInt8(e);break;case1:t=a.getUint8(e);break;case2:t=a.getInt16(e,!0);break;case3:t=a.getUint16(e,!0);break;case4:t=a.getInt32(e,!0);break;case5:t=a.getUInt32(e,!0);break;case6:t=a.getFloat32(e,!0);break;case7:t=a.getFloat64(e,!0);break;default:throw"the decoder does not understand this pixel type"}returnt}},b=function(n,e,r){this.val=n,this.left=e,this.right=r},X={decode:function(n,e){e=e||{};varr=e.noDataValue,a=0,t={};if(t.ptr=e.inputOffset||0,t.pixels={},!!V.readHeaderInfo(n,t)){vari=t.headerInfo,o=i.fileVersion,s=V.getDataTypeArray(i.imageType);V.readMask(n,t),i.numValidPixel!==i.width*i.height&&!t.pixels.resultMask&&(t.pixels.resultMask=e.maskData);varu=i.width*i.height;if(t.pixels.resultPixels=news(u*i.numDims),t.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},i.numValidPixel!==0)if(i.zMax===i.zMin)V.constructConstantSurface(t);elseif(o>=4&&V.checkMinMaxRanges(n,t))V.constructConstantSurface(t);else{varm=newDataView(n,t.ptr,2),l=m.getUint8(0);if(t.ptr++,l)V.readDataOneSweep(n,t,s);elseif(o>1&&i.imageType<=1&&Math.abs(i.maxZError-.5)<1e-5){varf=m.getUint8(1);if(t.ptr++,t.encodeMode=f,f>2||o<4&&f>1)throw"Invalid Huffman flag "+f;f?V.readHuffman(n,t,s):V.readTiles(n,t,s)}elseV.readTiles(n,t,s)}t.eofOffset=t.ptr;varh;e.inputOffset?(h=t.headerInfo.blobSize+e.inputOffset-t.ptr,Math.abs(h)>=1&&(t.eofOffset=e.inputOffset+t.headerInfo.blobSize)):(h=t.headerInfo.blobSize-t.ptr,Math.abs(h)>=1&&(t.eofOffset=t.headerInfo.blobSize));varc={width:i.width,height:i.height,pixelData:t.pixels.resultPixels,minValue:i.zMin,maxValue:i.zMax,validPixelCount:i.numValidPixel,dimCount:i.numDims,dimStats:{minValues:i.minValues,maxValues:i.maxValues},maskData:t.pixels.resultMask};if(t.pixels.resultMask&&V.isValidPixelValue(i.imageType,r)){varg=t.pixels.resultMask;for(a=0;a<u;a++)g[a]||(c.pixelData[a]=r);c.noDataValue=r}returnt.noDataValue=r,e.returnFileInfo&&(c.fileInfo=V.formatFileInfo(t)),c}},getBandCount:function(n){vare=0,r=0,a={};for(a.ptr=0,a.pixels={};r<n.byteLength-58;)V.readHeaderInfo(n,a),r+=a.headerInfo.blobSize,e++,a.ptr=r;returne}};returnX}(),C=function(){varA=newArrayBuffer(4),V=newUint8Array(A),b=newUint32Array(A);returnb[0]=1,V[0]===1}(),re={decode:function(A,V){if(!C)throw"Big endian system is not supported.";V=V||{};varb=V.inputOffset||0,X=newUint8Array(A,b,10),n=String.fromCharCode.apply(null,X),e,r;if(n.trim()==="CntZImage")e=D,r=1;elseif(n.substring(0,5)==="Lerc2")e=se,r=2;elsethrow"Unexpected file identifier string: "+n;for(vara=0,t=A.byteLength-10,i,o=[],s,u,m={width:0,height:0,pixels:[],pixelType:V.pixelType,mask:null,statistics:[]};b<t;){varl=e.decode(A,{inputOffset:b,encodedMaskData:i,maskData:u,returnMask:a===0,returnEncodedMask:a===0,returnFileInfo:!0,pixelType:V.pixelType||null,noDataValue:V.noDataValue||null});b=l.fileInfo.eofOffset,a===0&&(i=l.encodedMaskData,u=l.maskData,m.width=l.width,m.height=l.height,m.dimCount=l.dimCount||1,m.pixelType=l.pixelType||l.fileInfo.pixelType,m.mask=l.maskData),r>1&&l.fileInfo.mask&&l.fileInfo.mask.numBytes>0&&o.push(l.maskData),a++,m.pixels.push(l.pixelData),m.statistics.push({minValue:l.minValue,maxValue:l.maxValue,noDataValue:l.noDataValue,dimStats:l.dimStats})}varf,h,c;if(r>1&&o.length>1){for(c=m.width*m.height,m.bandMasks=o,u=newUint8Array(c),u.set(o[0]),f=1;f<o.length;f++)for(s=o[f],h=0;h<c;h++)u[h]=u[h]&s[h];m.maskData=u}returnm}};typeofdefine=="function"&&define.amd?define([],function(){returnre}):typeofTe<"u"&&Te.exports?Te.exports=re:this.Lerc=re})()});varUr={NONE:0,LERC:1},or=Object.freeze(Ur);varQ={};Q.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});varYe=newie,Tr=newxe,kr=newie,yr=newie;Q.computeVertices=function(D){if(!G(D)||!G(D.heightmap))thrownewhe("options.heightmap is required.");if(!G(D.width)||!G(D.height))thrownewhe("options.width and options.height are required.");if(!G(D.nativeRectangle))thrownewhe("options.nativeRectangle is required.");if(!G(D.skirtHeight))thrownewhe("options.skirtHeight is required.");letse=Math.cos,C=Math.sin,re=Math.sqrt,A=Math.atan,V=Math.exp,b=ge.PI_OVER_TWO,X=ge.toRadians,n=D.heightmap,e=D.width,r=D.height,a=D.skirtHeight,t=a>0,i=Y(D.isGeographic,!0),o=Y(D.ellipsoid,Ie.default),s=1/o.maximumRadius,u=ae.clone(D.nativeRectangle),m=ae.clone(D.rectangle),l,f,h,c;G(m)?(l=m.west,f=m.south,h=m.east,c=m.north):i?(l=X(u.west),f=X(u.south),h=X(u.east),c=X(u.north)):(l=u.west*s,f=b-2*A(V(-u.south*s)),h=u.east*s,c=b-2*A(V(-u.north*s)));letg=D.relativeToCenter,v=G(g);g=v?g:ie.ZERO;letU=Y(D.includeWebMercatorT,!1),M=Y(D.exaggeration,1),S=Y(D.exaggerationRelativeHeight,0),k=M!==1,w=Y(D.structure,Q.DEFAULT_STRUCTURE),d=Y(w.heightScale,Q.DEFAULT_STRUCTURE.heightScale),x=Y(w.heightOffset,Q.DEFAULT_STRUCTURE.heightOffset),T=Y(w.elementsPerHeight,Q.DEFAULT_STRUCTURE.elementsPerHeight),y=Y(w.stride,Q.DEFAULT_STRUCTURE.stride),p=Y(w.elementMultiplier,Q.DEFAULT_STRUCTURE.elementMultiplier),L=Y(w.isBigEndian,Q.DEFAULT_STRUCTURE.isBigEndian),B=ae.computeWidth(u),E=ae.computeHeight(u),O=B/(e-1),F=E/(r-1);i||(B*=s,E*=s);letN=o.radiiSquared,z=N.x,ke=N.y,ye=N.z,J=65536,Z=-65536,ue=rr.eastNorthUpToFixedFrame(g,o),te=xe.inverseTransformation(ue,Tr),j,q;U&&(j=Ue.geodeticLatitudeToMercatorAngle(f),q=1/(Ue.geodeticLatitudeToMercatorAngle(c)-j));letfe=kr;fe.x=Number.POSITIVE_INFINITY,fe.y=Number.POSITIVE_INFINITY,fe.z=Number.POSITIVE_INFINITY;letoe=yr;oe.x=Number.NEGATIVE_INFINITY,oe.y=Number.NEGATIVE_INFINITY,oe.z=Number.NEGATIVE_INFINITY;letMe=Number.POSITIVE_INFINITY,ce=e*r,mr=a>0?e*2+r*2:0,ne=ce+mr,ve=newArray(ne),Xe=newArray(ne),_e=newArray(ne),ze=U?newArray(ne):[],Ze=k?newArray(ne):[],Se=0,Ve=r,De=0,Ae=e;t&&(--Se,++Ve,--De,++Ae);letde=1e-5;for(letH=Se;H<Ve;++H){letK=H;K<0&&(K=0),K>=r&&(K=r-1);letW=u.north-F*K;i?W=X(W):W=b-2*A(V(-W*s));letLe=(W-f)/(c-f);Le=ge.clamp(Le,0,1);letwe=H===Se,pe=H===Ve-1;a>0&&(we?W+=de*E:pe&&(W-=de*E));letQe=se(W),Be=C(W),Je=ye*Be,Ke;U&&(Ke=(Ue.geodeticLatitudeToMercatorAngle(W)-j)*q);for(letme=De;me<Ae;++me){let$=me;$<0&&($=0),$>=e&&($=e-1);letFe=K*(e*y)+$*y,R;if(T===1)R=n[Fe];else{R=0;let_;if(L)for(_=0;_<T;++_)R=R*p+n[Fe+_];elsefor(_=T-1;_>=0;--_)R=R*p+n[Fe+_]}R=R*d+x,Z=Math.max(Z,R),J=Math.min(J,R);letP=u.west+O*$;i?P=X(P):P=P*s;letbe=(P-l)/(h-l);be=ge.clamp(be,0,1);letee=K*e+$;if(a>0){let_=me===De,Re=me===Ae-1,pr=we||pe||_||Re;if((we||pe)&&(_||Re))continue;pr&&(R-=a,_?(ee=ce+(r-K-1),P-=de*B):pe?ee=ce+r+(e-$-1):Re?(ee=ce+r+e+K,P+=de*B):we&&(ee=ce+r+e+r+$))}letNe=Qe*se(P),Ce=Qe*C(P),$e=z*Ne,Pe=ke*Ce,Oe=1/re($e*Ne+Pe*Ce+Je*Be),vr=$e*Oe,dr=Pe*Oe,wr=Je*Oe,le=newie;le.x=vr+Ne*R,le.y=dr+Ce*R,le.z=wr+Be*R,xe.multiplyByPoint(te,le,Ye),ie.minimumByComponent(Ye,fe,fe),ie.maximumByComponent(Ye,oe,oe),Me=Math.min(Me,R),ve[ee]=le,_e[ee]=newer(be,Le),Xe[ee]=R,U&&(ze[ee]=Ke),k&&(Ze[ee]=o.geodeticSurfaceNormal(le))}}lethr=ir.fromPoints(ve),je;G(m)&&(je=ar.fromRectangle(m,J,Z,o));letqe;v&&(qe=newsr(o).computeHorizonCullingPointPossiblyUnderEllipsoid(g,ve,J));letgr=newnr(fe,oe,g),Ee=newfr(g,gr,Me,Z,ue,!1,U,k,M,S),We=newFloat32Array(ne*Ee.stride),Ge=0;for(letH=0;H<ne;++H)Ge=Ee.encode(We,Ge,ve[H],_e[H],Xe[H],void0,ze[H],Ze[H]);return{vertices:We,maximumHeight:Z,minimumHeight:J,encoding:Ee,boundingSphere3D:hr,orientedBoundingBox:je,occludeePointInScaledSpace:qe}};varlr=Q;varcr=xr(ur(),1);functionMr(D,se){if(D.encoding===or.LERC){letA;try{A=cr.default.decode(D.heightmap)}catch(b){thrownewHe(b)}if(A.statistics[0].minValue===Number.MAX_VALUE)thrownewHe("Invalid tile data");D.heightmap=A.pixels[0],D.width=A.width,D.height=A.height}D.ellipsoid=Ie.clone(D.ellipsoid),D.rectangle=ae.clone(D.rectangle);letC=lr.computeVertices(D),re=C.vertices;returnse.push(re.buffer),{vertices:re.buffer,numberOfAttributes:C.encoding.stride,minimumHeight:C.minimumHeight,maximumHeight:C.maximumHeight,gridWidth:D.width,gridHeight:D.height,boundingSphere3D:C.boundingSphere3D,orientedBoundingBox:C.orientedBoundingBox,occludeePointInScaledSpace:C.occludeePointInScaledSpace,encoding:C.encoding,westIndicesSouthToNorth:C.westIndicesSouthToNorth,southIndicesEastToWest:C.southIndicesEastToWest,eastIndicesNorthToSouth:C.eastIndicesNorthToSouth,northIndicesWestToEast:C.northIndicesWestToEast}}varPr=tr(Mr);export{Prasdefault};
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{aasCt,basvt}from"./chunk-AZ3SWEDV.js";import{aasMt}from"./chunk-PWAJ3RAI.js";import{aasz}from"./chunk-R3AL5FUL.js";import"./chunk-CXNPIJLB.js";import{aasWt}from"./chunk-KSZ5EBRB.js";import{aasX}from"./chunk-NNHN6WUY.js";import"./chunk-BKSIEBAA.js";import{basU,gasbt,hasAt}from"./chunk-YWRPWWKI.js";import"./chunk-VTVHUB7E.js";import{aasP,baswt,caslt,daspt}from"./chunk-JMSSU44E.js";import{aasf}from"./chunk-4UYSGV57.js";import"./chunk-ANLJ4KBN.js";import"./chunk-ID6SFQTL.js";import"./chunk-VLPNAR64.js";import{aasm}from"./chunk-GE5NEIZC.js";import{easw}from"./chunk-35CVRQTC.js";functionT(){m.throwInstantiationError()}Object.defineProperties(T.prototype,{errorEvent:{get:m.throwInstantiationError},credit:{get:m.throwInstantiationError},tilingScheme:{get:m.throwInstantiationError},hasWaterMask:{get:m.throwInstantiationError},hasVertexNormals:{get:m.throwInstantiationError},availability:{get:m.throwInstantiationError}});varOt=[];T.getRegularGridIndices=function(t,n){if(t*n>=f.FOUR_GIGABYTES)thrownewm("The total number of vertices (width * height) must be less than 4,294,967,296.");leto=Ot[t];w(o)||(Ot[t]=o=[]);lete=o[n];returnw(e)||(t*n<f.SIXTY_FOUR_KILOBYTES?e=o[n]=newUint16Array((t-1)*(n-1)*6):e=o[n]=newUint32Array((t-1)*(n-1)*6),Pt(t,n,e,0)),e};varGt=[];T.getRegularGridIndicesAndEdgeIndices=function(t,n){if(t*n>=f.FOUR_GIGABYTES)thrownewm("The total number of vertices (width * height) must be less than 4,294,967,296.");leto=Gt[t];w(o)||(Gt[t]=o=[]);lete=o[n];if(!w(e)){letr=T.getRegularGridIndices(t,n),s=Lt(t,n),i=s.westIndicesSouthToNorth,c=s.southIndicesEastToWest,h=s.eastIndicesNorthToSouth,E=s.northIndicesWestToEast;e=o[n]={indices:r,westIndicesSouthToNorth:i,southIndicesEastToWest:c,eastIndicesNorthToSouth:h,northIndicesWestToEast:E}}returne};varkt=[];T.getRegularGridAndSkirtIndicesAndEdgeIndices=function(t,n){if(t*n>=f.FOUR_GIGABYTES)thrownewm("The total number of vertices (width * height) must be less than 4,294,967,296.");leto=kt[t];w(o)||(kt[t]=o=[]);lete=o[n];if(!w(e)){letr=t*n,s=(t-1)*(n-1)*6,i=t*2+n*2,c=Math.max(0,i-4)*6,h=r+i,E=s+c,g=Lt(t,n),d=g.westIndicesSouthToNorth,p=g.southIndicesEastToWest,b=g.eastIndicesNorthToSouth,L=g.northIndicesWestToEast,N=X.createTypedArray(h,E);Pt(t,n,N,0),T.addSkirtIndices(d,p,b,L,r,N,s),e=o[n]={indices:N,westIndicesSouthToNorth:d,southIndicesEastToWest:p,eastIndicesNorthToSouth:b,northIndicesWestToEast:L,indexCountWithoutSkirts:s}}returne};T.addSkirtIndices=function(t,n,o,e,r,s,i){letc=r;i=Z(t,c,s,i),c+=t.length,i=Z(n,c,s,i),c+=n.length,i=Z(o,c,s,i),c+=o.length,Z(e,c,s,i)};functionLt(t,n){leto=newArray(n),e=newArray(t),r=newArray(n),s=newArray(t),i;for(i=0;i<t;++i)s[i]=i,e[i]=t*n-1-i;for(i=0;i<n;++i)r[i]=(i+1)*t-1,o[i]=(n-i-1)*t;return{westIndicesSouthToNorth:o,southIndicesEastToWest:e,eastIndicesNorthToSouth:r,northIndicesWestToEast:s}}functionPt(t,n,o,e){letr=0;for(lets=0;s<n-1;++s){for(leti=0;i<t-1;++i){letc=r,h=c+t,E=h+1,g=c+1;o[e++]=c,o[e++]=h,o[e++]=g,o[e++]=g,o[e++]=h,o[e++]=E,++r}++r}}functionZ(t,n,o,e){letr=t[0],s=t.length;for(leti=1;i<s;++i){letc=t[i];o[e++]=r,o[e++]=c,o[e++]=n,o[e++]=n,o[e++]=c,o[e++]=n+1,r=c,++n}returne}T.heightmapTerrainQuality=.25;T.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(t,n,o){returnt.maximumRadius*2*Math.PI*T.heightmapTerrainQuality/(n*o)};T.prototype.requestTileGeometry=m.throwInstantiationError;T.prototype.getLevelMaximumGeometricError=m.throwInstantiationError;T.prototype.getTileDataAvailable=m.throwInstantiationError;T.prototype.loadTileDataAvailability=m.throwInstantiationError;varVt=T;varht=32767,D=newP,Xt=newP,Zt=newP,u=newwt,Y=newlt;functionJt(t,n){leto=t.quantizedVertices,e=o.length/3,r=t.octEncodedNormals,s=t.westIndices.length+t.eastIndices.length+t.southIndices.length+t.northIndices.length,i=t.includeWebMercatorT,c=t.exaggeration,h=t.exaggerationRelativeHeight,g=c!==1,d=At.clone(t.rectangle),p=d.west,b=d.south,L=d.east,N=d.north,I=pt.clone(t.ellipsoid),y=t.minimumHeight,v=t.maximumHeight,S=t.relativeToCenter,_=bt.eastNorthUpToFixedFrame(S,I),O=U.inverseTransformation(_,newU),G,A;i&&(G=z.geodeticLatitudeToMercatorAngle(b),A=1/(z.geodeticLatitudeToMercatorAngle(N)-G));letj=o.subarray(0,e),q=o.subarray(e,2*e),Q=o.subarray(e*2,3*e),R=w(r),l=newArray(e),M=newArray(e),et=newArray(e),It=i?newArray(e):[],gt=g?newArray(e):[],W=Xt;W.x=Number.POSITIVE_INFINITY,W.y=Number.POSITIVE_INFINITY,W.z=Number.POSITIVE_INFINITY;letC=Zt;C.x=Number.NEGATIVE_INFINITY,C.y=Number.NEGATIVE_INFINITY,C.z=Number.NEGATIVE_INFINITY;letot=Number.POSITIVE_INFINITY,nt=Number.NEGATIVE_INFINITY,it=Number.POSITIVE_INFINITY,rt=Number.NEGATIVE_INFINITY;for(leta=0;a<e;++a){letx=j[a],Kt=q[a],St=x/ht,xt=Kt/ht,yt=f.lerp(y,v,Q[a]/ht);u.longitude=f.lerp(p,L,St),u.latitude=f.lerp(b,N,xt),u.height=yt,ot=Math.min(u.longitude,ot),nt=Math.max(u.longitude,nt),it=Math.min(u.latitude,it),rt=Math.max(u.latitude,rt);letdt=I.cartographicToCartesian(u);l[a]=newlt(St,xt),M[a]=yt,et[a]=dt,i&&(It[a]=(z.geodeticLatitudeToMercatorAngle(u.latitude)-G)*A),g&&(gt[a]=I.geodeticSurfaceNormal(dt)),U.multiplyByPoint(O,dt,D),P.minimumByComponent(D,W,W),P.maximumByComponent(D,C,C)}letst=tt(t.westIndices,function(a,x){returnl[a].y-l[x].y}),ct=tt(t.eastIndices,function(a,x){returnl[x].y-l[a].y}),at=tt(t.southIndices,function(a,x){returnl[x].x-l[a].x}),ut=tt(t.northIndices,function(a,x){returnl[a].x-l[x].x}),mt;y<0&&(mt=newCt(I).computeHorizonCullingPointPossiblyUnderEllipsoid(S,et,y));letk=y;k=Math.min(k,J(t.westIndices,t.westSkirtHeight,M,l,d,I,O,W,C)),k=Math.min(k,J(t.southIndices,t.southSkirtHeight,M,l,d,I,O,W,C)),k=Math.min(k,J(t.eastIndices,t.eastSkirtHeight,M,l,d,I,O,W,C)),k=Math.min(k,J(t.northIndices,t.northSkirtHeight,M,l,d,I,O,W,C));letFt=newWt(W,C,S),V=newvt(S,Ft,k,v,_,R,i,g,c,h),F=V.stride,Bt=e*F+s*F,B=newFloat32Array(Bt),ft=0;for(leta=0;a<e;++a){if(R){letx=a*2;Y.x=r[x],Y.y=r[x+1]}ft=V.encode(B,ft,et[a],l[a],M[a],Y,It[a],gt[a])}letHt=Math.max(0,(s-4)*2),_t=t.indices.length+Ht*3,K=X.createTypedArray(e+s,_t);K.set(t.indices,0);letTt=1e-4,Et=(nt-ot)*Tt,Nt=(rt-it)*Tt,Yt=-Et,Rt=0,Ut=Et,zt=0,Dt=0,jt=Nt,qt=0,Qt=-Nt,H=e*F;return$(B,H,st,V,M,l,r,I,d,t.westSkirtHeight,G,A,Yt,Rt),H+=t.westIndices.length*F,$(B,H,at,V,M,l,r,I,d,t.southSkirtHeight,G,A,qt,Qt),H+=t.southIndices.length*F,$(B,H,ct,V,M,l,r,I,d,t.eastSkirtHeight,G,A,Ut,zt),H+=t.eastIndices.length*F,$(B,H,ut,V,M,l,r,I,d,t.northSkirtHeight,G,A,Dt,jt),Vt.addSkirtIndices(st,at,ct,ut,e,K,t.indices.length),n.push(B.buffer,K.buffer),{vertices:B.buffer,indices:K.buffer,westIndicesSouthToNorth:st,southIndicesEastToWest:at,eastIndicesNorthToSouth:ct,northIndicesWestToEast:ut,vertexStride:F,center:S,minimumHeight:y,maximumHeight:v,occludeePointInScaledSpace:mt,encoding:V,indexCountWithoutSkirts:t.indices.length}}functionJ(t,n,o,e,r,s,i,c,h){letE=Number.POSITIVE_INFINITY,g=r.north,d=r.south,p=r.east,b=r.west;p<b&&(p+=f.TWO_PI);letL=t.length;for(letN=0;N<L;++N){letI=t[N],y=o[I],v=e[I];u.longitude=f.lerp(b,p,v.x),u.latitude=f.lerp(d,g,v.y),u.height=y-n;letS=s.cartographicToCartesian(u,D);U.multiplyByPoint(i,S,S),P.minimumByComponent(S,c,c),P.maximumByComponent(S,h,h),E=Math.min(E,u.height)}returnE}function$(t,n,o,e,r,s,i,c,h,E,g,d,p,b){letL=w(i),N=h.north,I=h.south,y=h.east,v=h.west;y<v&&(y+=f.TWO_PI);letS=o.length;for(let_=0;_<S;++_){letO=o[_],G=r[O],A=s[O];u.longitude=f.lerp(v,y,A.x)+p,u.latitude=f.lerp(I,N,A.y)+b,u.height=G-E;letj=c.cartographicToCartesian(u,D);if(L){letR=O*2;Y.x=i[R],Y.y=i[R+1]}letq;e.hasWebMercatorT&&(q=(z.geodeticLatitudeToMercatorAngle(u.latitude)-g)*d);letQ;e.hasGeodeticSurfaceNormals&&(Q=c.geodeticSurfaceNormal(j)),n=e.encode(t,n,j,A,u.height,Y,q,Q)}}functiontt(t,n){leto;returntypeoft.slice=="function"&&(o=t.slice(),typeofo.sort!="function"&&(o=void0)),w(o)||(o=Array.prototype.slice.call(t)),o.sort(n),o}varSe=Mt(Jt);export{Seasdefault};
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{aasnt}from"./chunk-II4JDBXY.js";import"./chunk-M5SITFFN.js";import"./chunk-ZPYKVVFF.js";import{aas_}from"./chunk-74GQJJ7R.js";import"./chunk-WNTCOVG2.js";import"./chunk-EEKB62LQ.js";import"./chunk-V3DSE3OK.js";import"./chunk-FMRIJYNG.js";import{aasot}from"./chunk-NNHN6WUY.js";import{aasit}from"./chunk-T7ERZ2CJ.js";import{bastt,caset,dasS}from"./chunk-GSNDLQ4C.js";import{dasI}from"./chunk-BKSIEBAA.js";import"./chunk-YWRPWWKI.js";import{aasR}from"./chunk-VTVHUB7E.js";import{aass,dasl}from"./chunk-JMSSU44E.js";import{aasJ}from"./chunk-4UYSGV57.js";import"./chunk-ANLJ4KBN.js";import"./chunk-ID6SFQTL.js";import{aasw}from"./chunk-VLPNAR64.js";import{aasP}from"./chunk-GE5NEIZC.js";import{easr}from"./chunk-35CVRQTC.js";varQ=news,Y=news,lt=news,st=news,pt=news,ut=news,ft=news;functionk(t){t=w(t,w.EMPTY_OBJECT);lete=t.positions,o=t.maximumHeights,n=t.minimumHeights;if(!r(e))thrownewP("options.positions is required.");if(r(o)&&o.length!==e.length)thrownewP("options.positions and options.maximumHeights must have the same length.");if(r(n)&&n.length!==e.length)thrownewP("options.positions and options.minimumHeights must have the same length.");leti=w(t.vertexFormat,_.DEFAULT),c=w(t.granularity,J.RADIANS_PER_DEGREE),a=w(t.ellipsoid,l.default);this._positions=e,this._minimumHeights=n,this._maximumHeights=o,this._vertexFormat=_.clone(i),this._granularity=c,this._ellipsoid=l.clone(a),this._workerName="createWallGeometry";letm=1+e.length*s.packedLength+2;r(n)&&(m+=n.length),r(o)&&(m+=o.length),this.packedLength=m+l.packedLength+_.packedLength+1}k.pack=function(t,e,o){if(!r(t))thrownewP("value is required");if(!r(e))thrownewP("array is required");o=w(o,0);letn,i=t._positions,c=i.length;for(e[o++]=c,n=0;n<c;++n,o+=s.packedLength)s.pack(i[n],e,o);leta=t._minimumHeights;if(c=r(a)?a.length:0,e[o++]=c,r(a))for(n=0;n<c;++n)e[o++]=a[n];letm=t._maximumHeights;if(c=r(m)?m.length:0,e[o++]=c,r(m))for(n=0;n<c;++n)e[o++]=m[n];returnl.pack(t._ellipsoid,e,o),o+=l.packedLength,_.pack(t._vertexFormat,e,o),o+=_.packedLength,e[o]=t._granularity,e};varmt=l.clone(l.UNIT_SPHERE),rt=new_,V={positions:void0,minimumHeights:void0,maximumHeights:void0,ellipsoid:mt,vertexFormat:rt,granularity:void0};k.unpack=function(t,e,o){if(!r(t))thrownewP("array is required");e=w(e,0);letn,i=t[e++],c=newArray(i);for(n=0;n<i;++n,e+=s.packedLength)c[n]=s.unpack(t,e);i=t[e++];leta;if(i>0)for(a=newArray(i),n=0;n<i;++n)a[n]=t[e++];i=t[e++];letm;if(i>0)for(m=newArray(i),n=0;n<i;++n)m[n]=t[e++];letq=l.unpack(t,e,mt);e+=l.packedLength;letH=_.unpack(t,e,rt);e+=_.packedLength;letf=t[e];returnr(o)?(o._positions=c,o._minimumHeights=a,o._maximumHeights=m,o._ellipsoid=l.clone(q,o._ellipsoid),o._vertexFormat=_.clone(H,o._vertexFormat),o._granularity=f,o):(V.positions=c,V.minimumHeights=a,V.maximumHeights=m,V.granularity=f,newk(V))};k.fromConstantHeights=function(t){t=w(t,w.EMPTY_OBJECT);lete=t.positions;if(!r(e))thrownewP("options.positions is required.");leto,n,i=t.minimumHeight,c=t.maximumHeight,a=r(i),m=r(c);if(a||m){letH=e.length;o=a?newArray(H):void0,n=m?newArray(H):void0;for(letf=0;f<H;++f)a&&(o[f]=i),m&&(n[f]=c)}letq={positions:e,maximumHeights:n,minimumHeights:o,ellipsoid:t.ellipsoid,vertexFormat:t.vertexFormat};returnnewk(q)};k.createGeometry=function(t){lete=t._positions,o=t._minimumHeights,n=t._maximumHeights,i=t._vertexFormat,c=t._granularity,a=t._ellipsoid,m=nt.computePositions(a,e,n,o,c,!0);if(!r(m))return;letq=m.bottomPositions,H=m.topPositions,f=m.numCorners,B=H.length,y=B*2,h=i.position?newFloat64Array(y):void0,b=i.normal?newFloat32Array(y):void0,x=i.tangent?newFloat32Array(y):void0,F=i.bitangent?newFloat32Array(y):void0,M=i.st?newFloat32Array(y/3*2):void0,v=0,T=0,C=0,z=0,W=0,g=ft,d=ut,A=pt,Z=!0;B/=3;letp,j=0,ct=1/(B-f-1);for(p=0;p<B;++p){letE=p*3,u=s.fromArray(H,E,Q),U=s.fromArray(q,E,Y);if(i.position&&(h[v++]=U.x,h[v++]=U.y,h[v++]=U.z,h[v++]=u.x,h[v++]=u.y,h[v++]=u.z),i.st&&(M[W++]=j,M[W++]=0,M[W++]=j,M[W++]=1),i.normal||i.tangent||i.bitangent){letN=s.clone(s.ZERO,st),K=s.subtract(u,a.geodeticSurfaceNormal(u,Y),Y);if(p+1<B&&(N=s.fromArray(H,E+3,st)),Z){letG=s.subtract(N,u,lt),at=s.subtract(K,u,Q);g=s.normalize(s.cross(at,G,g),g),Z=!1}s.equalsEpsilon(u,N,J.EPSILON10)?Z=!0:(j+=ct,i.tangent&&(d=s.normalize(s.subtract(N,u,d),d)),i.bitangent&&(A=s.normalize(s.cross(g,d,A),A))),i.normal&&(b[T++]=g.x,b[T++]=g.y,b[T++]=g.z,b[T++]=g.x,b[T++]=g.y,b[T++]=g.z),i.tangent&&(x[z++]=d.x,x[z++]=d.y,x[z++]=d.z,x[z++]=d.x,x[z++]=d.y,x[z++]=d.z),i.bitangent&&(F[C++]=A.x,F[C++]=A.y,F[C++]=A.z,F[C++]=A.x,F[C++]=A.y,F[C++]=A.z)}}letD=newit;i.position&&(D.position=newS({componentDatatype:R.DOUBLE,componentsPerAttribute:3,values:h})),i.normal&&(D.normal=newS({componentDatatype:R.FLOAT,componentsPerAttribute:3,values:b})),i.tangent&&(D.tangent=newS({componentDatatype:R.FLOAT,componentsPerAttribute:3,values:x})),i.bitangent&&(D.bitangent=newS({componentDatatype:R.FLOAT,componentsPerAttribute:3,values:F})),i.st&&(D.st=newS({componentDatatype:R.FLOAT,componentsPerAttribute:2,values:M}));let$=y/3;y-=6*(f+1);letL=ot.createTypedArray($,y),O=0;for(p=0;p<$-2;p+=2){letE=p,u=p+2,U=s.fromArray(h,E*3,Q),N=s.fromArray(h,u*3,Y);if(s.equalsEpsilon(U,N,J.EPSILON10))continue;letK=p+1,G=p+3;L[O++]=K,L[O++]=E,L[O++]=G,L[O++]=G,L[O++]=E,L[O++]=u}returnnewet({attributes:D,indices:L,primitiveType:tt.TRIANGLES,boundingSphere:newI.fromVertices(h)})};varX=k;functionht(t,e){returnr(e)&&(t=X.unpack(t,e)),t._ellipsoid=l.clone(t._ellipsoid),X.createGeometry(t)}varOt=ht;export{Otasdefault};
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{aasB}from"./chunk-II4JDBXY.js";import"./chunk-M5SITFFN.js";import"./chunk-ZPYKVVFF.js";import"./chunk-WNTCOVG2.js";import"./chunk-EEKB62LQ.js";import"./chunk-V3DSE3OK.js";import"./chunk-FMRIJYNG.js";import{aasW}from"./chunk-NNHN6WUY.js";import{aasN}from"./chunk-T7ERZ2CJ.js";import{basR,casS,dasM}from"./chunk-GSNDLQ4C.js";import{dasD}from"./chunk-BKSIEBAA.js";import"./chunk-YWRPWWKI.js";import{aasq}from"./chunk-VTVHUB7E.js";import{aasp,dasl}from"./chunk-JMSSU44E.js";import{aasO}from"./chunk-4UYSGV57.js";import"./chunk-ANLJ4KBN.js";import"./chunk-ID6SFQTL.js";import{aasd}from"./chunk-VLPNAR64.js";import{aas_}from"./chunk-GE5NEIZC.js";import{easm}from"./chunk-35CVRQTC.js";varU=newp,z=newp;functionw(i){i=d(i,d.EMPTY_OBJECT);lett=i.positions,e=i.maximumHeights,o=i.minimumHeights;if(!m(t))thrownew_("options.positions is required.");if(m(e)&&e.length!==t.length)thrownew_("options.positions and options.maximumHeights must have the same length.");if(m(o)&&o.length!==t.length)thrownew_("options.positions and options.minimumHeights must have the same length.");lets=d(i.granularity,O.RADIANS_PER_DEGREE),r=d(i.ellipsoid,l.default);this._positions=t,this._minimumHeights=o,this._maximumHeights=e,this._granularity=s,this._ellipsoid=l.clone(r),this._workerName="createWallOutlineGeometry";letn=1+t.length*p.packedLength+2;m(o)&&(n+=o.length),m(e)&&(n+=e.length),this.packedLength=n+l.packedLength+1}w.pack=function(i,t,e){if(!m(i))thrownew_("value is required");if(!m(t))thrownew_("array is required");e=d(e,0);leto,s=i._positions,r=s.length;for(t[e++]=r,o=0;o<r;++o,e+=p.packedLength)p.pack(s[o],t,e);letn=i._minimumHeights;if(r=m(n)?n.length:0,t[e++]=r,m(n))for(o=0;o<r;++o)t[e++]=n[o];letc=i._maximumHeights;if(r=m(c)?c.length:0,t[e++]=r,m(c))for(o=0;o<r;++o)t[e++]=c[o];returnl.pack(i._ellipsoid,t,e),e+=l.packedLength,t[e]=i._granularity,t};varG=l.clone(l.UNIT_SPHERE),b={positions:void0,minimumHeights:void0,maximumHeights:void0,ellipsoid:G,granularity:void0};w.unpack=function(i,t,e){if(!m(i))thrownew_("array is required");t=d(t,0);leto,s=i[t++],r=newArray(s);for(o=0;o<s;++o,t+=p.packedLength)r[o]=p.unpack(i,t);s=i[t++];letn;if(s>0)for(n=newArray(s),o=0;o<s;++o)n[o]=i[t++];s=i[t++];letc;if(s>0)for(c=newArray(s),o=0;o<s;++o)c[o]=i[t++];letE=l.unpack(i,t,G);t+=l.packedLength;letu=i[t];returnm(e)?(e._positions=r,e._minimumHeights=n,e._maximumHeights=c,e._ellipsoid=l.clone(E,e._ellipsoid),e._granularity=u,e):(b.positions=r,b.minimumHeights=n,b.maximumHeights=c,b.granularity=u,neww(b))};w.fromConstantHeights=function(i){i=d(i,d.EMPTY_OBJECT);lett=i.positions;if(!m(t))thrownew_("options.positions is required.");lete,o,s=i.minimumHeight,r=i.maximumHeight,n=m(s),c=m(r);if(n||c){letu=t.length;e=n?newArray(u):void0,o=c?newArray(u):void0;for(leta=0;a<u;++a)n&&(e[a]=s),c&&(o[a]=r)}letE={positions:t,maximumHeights:o,minimumHeights:e,ellipsoid:i.ellipsoid};returnneww(E)};w.createGeometry=function(i){lett=i._positions,e=i._minimumHeights,o=i._maximumHeights,s=i._granularity,r=i._ellipsoid,n=B.computePositions(r,t,o,e,s,!1);if(!m(n))return;letc=n.bottomPositions,E=n.topPositions,u=E.length,a=u*2,f=newFloat64Array(a),P=0;u/=3;leth;for(h=0;h<u;++h){letA=h*3,k=p.fromArray(E,A,U),L=p.fromArray(c,A,z);f[P++]=L.x,f[P++]=L.y,f[P++]=L.z,f[P++]=k.x,f[P++]=k.y,f[P++]=k.z}letV=newN({position:newM({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:f})}),y=a/3;a=2*y-4+y;letg=W.createTypedArray(y,a),H=0;for(h=0;h<y-2;h+=2){letA=h,k=h+2,L=p.fromArray(f,A*3,U),v=p.fromArray(f,k*3,z);if(p.equalsEpsilon(L,v,O.EPSILON10))continue;letT=h+1,x=h+3;g[H++]=T,g[H++]=A,g[H++]=T,g[H++]=x,g[H++]=A,g[H++]=k}returng[H++]=y-2,g[H++]=y-1,newS({attributes:V,indices:g,primitiveType:R.LINES,boundingSphere:newD.fromVertices(f)})};varC=w;functionJ(i,t){returnm(t)&&(i=C.unpack(i,t)),i._ellipsoid=l.clone(i._ellipsoid),C.createGeometry(i)}varpi=J;export{piasdefault};
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{aasD}from"./chunk-JCUVYVZU.js";import{aasI}from"./chunk-PWAJ3RAI.js";import{aasm}from"./chunk-NNHN6WUY.js";import{aasw}from"./chunk-VTVHUB7E.js";import"./chunk-4UYSGV57.js";import"./chunk-ANLJ4KBN.js";import{aasA}from"./chunk-ID6SFQTL.js";import"./chunk-VLPNAR64.js";import"./chunk-GE5NEIZC.js";import{dasP,easd}from"./chunk-35CVRQTC.js";varb=P(D(),1),r;functionF(t,n){leto=t.num_points(),a=t.num_faces(),i=newr.DracoInt32Array,e=a*3,s=m.createTypedArray(o,e),u=0;for(letf=0;f<a;++f)n.GetFaceFromMesh(t,f,i),s[u+0]=i.GetValue(0),s[u+1]=i.GetValue(1),s[u+2]=i.GetValue(2),u+=3;returnr.destroy(i),{typedArray:s,numberOfIndices:e}}functionU(t,n,o,a,i){lete,s;a.quantizationBits<=8?(s=newr.DracoUInt8Array,e=newUint8Array(i),n.GetAttributeUInt8ForAllPoints(t,o,s)):a.quantizationBits<=16?(s=newr.DracoUInt16Array,e=newUint16Array(i),n.GetAttributeUInt16ForAllPoints(t,o,s)):(s=newr.DracoFloat32Array,e=newFloat32Array(i),n.GetAttributeFloatForAllPoints(t,o,s));for(letu=0;u<i;++u)e[u]=s.GetValue(u);returnr.destroy(s),e}functionk(t,n,o,a){leti,e;switch(o.data_type()){case1:case11:e=newr.DracoInt8Array,i=newInt8Array(a),n.GetAttributeInt8ForAllPoints(t,o,e);break;case2:e=newr.DracoUInt8Array,i=newUint8Array(a),n.GetAttributeUInt8ForAllPoints(t,o,e);break;case3:e=newr.DracoInt16Array,i=newInt16Array(a),n.GetAttributeInt16ForAllPoints(t,o,e);break;case4:e=newr.DracoUInt16Array,i=newUint16Array(a),n.GetAttributeUInt16ForAllPoints(t,o,e);break;case5:case7:e=newr.DracoInt32Array,i=newInt32Array(a),n.GetAttributeInt32ForAllPoints(t,o,e);break;case6:case8:e=newr.DracoUInt32Array,i=newUint32Array(a),n.GetAttributeUInt32ForAllPoints(t,o,e);break;case9:case10:e=newr.DracoFloat32Array,i=newFloat32Array(a),n.GetAttributeFloatForAllPoints(t,o,e);break}for(lets=0;s<a;++s)i[s]=e.GetValue(s);returnr.destroy(e),i}functionp(t,n,o){leta=t.num_points(),i=o.num_components(),e,s=newr.AttributeQuantizationTransform;if(s.InitFromAttribute(o)){letc=newArray(i);for(lety=0;y<i;++y)c[y]=s.min_value(y);e={quantizationBits:s.quantization_bits(),minValues:c,range:s.range(),octEncoded:!1}}r.destroy(s),s=newr.AttributeOctahedronTransform,s.InitFromAttribute(o)&&(e={quantizationBits:s.quantization_bits(),octEncoded:!0}),r.destroy(s);letu=a*i,f;d(e)?f=U(t,n,o,e,u):f=k(t,n,o,u);letl=w.fromTypedArray(f);return{array:f,data:{componentsPerAttribute:i,componentDatatype:l,byteOffset:o.byte_offset(),byteStride:w.getSizeInBytes(l)*i,normalized:o.normalized(),quantization:e}}}functionO(t){letn=newr.Decoder;t.dequantizeInShader&&(n.SkipAttributeTransform(r.POSITION),n.SkipAttributeTransform(r.NORMAL));leto=newr.DecoderBuffer;if(o.Init(t.buffer,t.buffer.length),n.GetEncodedGeometryType(o)!==r.POINT_CLOUD)thrownewA("Draco geometry type must be POINT_CLOUD.");leti=newr.PointCloud,e=n.DecodeBufferToPointCloud(o,i);if(!e.ok()||i.ptr===0)thrownewA(`Error decoding draco point cloud: ${e.error_msg()}`);r.destroy(o);lets={},u=t.properties;for(letfinu)if(u.hasOwnProperty(f)){letl;if(f==="POSITION"||f==="NORMAL"){letc=n.GetAttributeId(i,r[f]);l=n.GetAttribute(i,c)}else{letc=u[f];l=n.GetAttributeByUniqueId(i,c)}s[f]=p(i,n,l)}returnr.destroy(i),r.destroy(n),s}functiong(t){letn=newr.Decoder;if(t.dequantizeInShader)for(letc=0;c<t.attributesToSkipTransform.length;++c)n.SkipAttributeTransform(r[t.attributesToSkipTransform[c]]);leto=t.bufferView,a=newr.DecoderBuffer;if(a.Init(t.array,o.byteLength),n.GetEncodedGeometryType(a)!==r.TRIANGULAR_MESH)thrownewA("Unsupported draco mesh geometry type.");lete=newr.Mesh,s=n.DecodeBufferToMesh(a,e);if(!s.ok()||e.ptr===0)thrownewA(`Error decoding draco mesh geometry: ${s.error_msg()}`);r.destroy(a);letu={},f=t.compressedAttributes;for(letcinf)if(f.hasOwnProperty(c)){lety=f[c],T=n.GetAttributeByUniqueId(e,y);u[c]=p(e,n,T)}letl={indexArray:F(e,n),attributeData:u};returnr.destroy(e),r.destroy(n),l}asyncfunctionz(t,n){returnd(t.bufferView)?g(t):O(t)}asyncfunctionG(t,n){leto=t.webAssemblyConfig;returnd(o)&&d(o.wasmBinaryFile)?r=await(0,b.default)(o):r=await(0,b.default)(),!0}asyncfunctionS(t,n){leto=t.webAssemblyConfig;returnd(o)?G(t,n):z(t,n)}varh=I(S);export{hasdefault};
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{aasSe}from"./chunk-PWAJ3RAI.js";import{aasD}from"./chunk-ID6SFQTL.js";import{basae}from"./chunk-GE5NEIZC.js";import{casR,dasOt,easme}from"./chunk-35CVRQTC.js";varIe=R((Li,Ae)=>{"use strict";varzt=(t,i,e,r)=>{lets=t&65535|0,n=t>>>16&65535|0,c=0;for(;e!==0;){c=e>2e3?2e3:e,e-=c;dos=s+i[r++]|0,n=n+s|0;while(--c);s%=65521,n%=65521}returns|n<<16|0};Ae.exports=zt});varDe=R((Pi,Re)=>{"use strict";varHt=()=>{lett,i=[];for(vare=0;e<256;e++){t=e;for(varr=0;r<8;r++)t=t&1?3988292384^t>>>1:t>>>1;i[e]=t}returni},Ft=newUint32Array(Ht()),Vt=(t,i,e,r)=>{lets=Ft,n=r+e;t^=-1;for(letc=r;c<n;c++)t=t>>>8^s[(t^i[c])&255];returnt^-1};Re.exports=Vt});varOe=R((zi,Ue)=>{"use strict";Ue.exports=function(i,e){letr,s,n,c,f,_,a,o,v,w,l,u,I,p,x,T,g,d,E,A,h,S,k,b,m=i.state;r=i.next_in,k=i.input,s=r+(i.avail_in-5),n=i.next_out,b=i.output,c=n-(e-i.avail_out),f=n+(i.avail_out-257),_=m.dmax,a=m.wsize,o=m.whave,v=m.wnext,w=m.window,l=m.hold,u=m.bits,I=m.lencode,p=m.distcode,x=(1<<m.lenbits)-1,T=(1<<m.distbits)-1;e:do{u<15&&(l+=k[r++]<<u,u+=8,l+=k[r++]<<u,u+=8),g=I[l&x];t:for(;;){if(d=g>>>24,l>>>=d,u-=d,d=g>>>16&255,d===0)b[n++]=g&65535;elseif(d&16){E=g&65535,d&=15,d&&(u<d&&(l+=k[r++]<<u,u+=8),E+=l&(1<<d)-1,l>>>=d,u-=d),u<15&&(l+=k[r++]<<u,u+=8,l+=k[r++]<<u,u+=8),g=p[l&T];i:for(;;){if(d=g>>>24,l>>>=d,u-=d,d=g>>>16&255,d&16){if(A=g&65535,d&=15,u<d&&(l+=k[r++]<<u,u+=8,u<d&&(l+=k[r++]<<u,u+=8)),A+=l&(1<<d)-1,A>_){i.msg="invalid distance too far back",m.mode=16209;breake}if(l>>>=d,u-=d,d=n-c,A>d){if(d=A-d,d>o&&m.sane){i.msg="invalid distance too far back",m.mode=16209;breake}if(h=0,S=w,v===0){if(h+=a-d,d<E){E-=d;dob[n++]=w[h++];while(--d);h=n-A,S=b}}elseif(v<d){if(h+=a+v-d,d-=v,d<E){E-=d;dob[n++]=w[h++];while(--d);if(h=0,v<E){d=v,E-=d;dob[n++]=w[h++];while(--d);h=n-A,S=b}}}elseif(h+=v-d,d<E){E-=d;dob[n++]=w[h++];while(--d);h=n-A,S=b}for(;E>2;)b[n++]=S[h++],b[n++]=S[h++],b[n++]=S[h++],E-=3;E&&(b[n++]=S[h++],E>1&&(b[n++]=S[h++]))}else{h=n-A;dob[n++]=b[h++],b[n++]=b[h++],b[n++]=b[h++],E-=3;while(E>2);E&&(b[n++]=b[h++],E>1&&(b[n++]=b[h++]))}}elseif((d&64)===0){g=p[(g&65535)+(l&(1<<d)-1)];continuei}else{i.msg="invalid distance code",m.mode=16209;breake}break}}elseif((d&64)===0){g=I[(g&65535)+(l&(1<<d)-1)];continuet}elseif(d&32){m.mode=16191;breake}else{i.msg="invalid literal/length code",m.mode=16209;breake}break}}while(r<s&&n<f);E=u>>3,r-=E,u-=E<<3,l&=(1<<u)-1,i.next_in=r,i.next_out=n,i.avail_in=r<s?5+(s-r):5-(r-s),i.avail_out=n<f?257+(f-n):257-(n-f),m.hold=l,m.bits=u}});varMe=R((Hi,Ne)=>{"use strict";varGt=newUint16Array([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]),Yt=newUint8Array([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]),Xt=newUint16Array([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]),qt=newUint8Array([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]),Kt=(t,i,e,r,s,n,c,f)=>{let_=f.bits,a=0,o=0,v=0,w=0,l=0,u=0,I=0,p=0,x=0,T=0,g,d,E,A,h,S=null,k,b=newUint16Array(16),m=newUint16Array(16),L=null,Ee,W,Q;for(a=0;a<=15;a++)b[a]=0;for(o=0;o<r;o++)b[i[e+o]]++;for(l=_,w=15;w>=1&&b[w]===0;w--);if(l>w&&(l=w),w===0)returns[n++]=1<<24|64<<16|0,s[n++]=1<<24|64<<16|0,f.bits=1,0;for(v=1;v<w&&b[v]===0;v++);for(l<v&&(l=v),p=1,a=1;a<=15;a++)if(p<<=1,p-=b[a],p<0)return-1;if(p>0&&(t===0||w!==1))return-1;for(m[1]=0,a=1;a<15;a++)m[a+1]=m[a]+b[a];for(o=0;o<r;o++)i[e+o]!==0&&(c[m[i[e+o]]++]=o);if(t===0?(S=L=c,k=20):t===1?(S=Gt,L=Yt,k=257):(S=Xt,L=qt,k=0),T=0,o=0,a=v,h=n,u=l,I=0,E=-1,x=1<<l,A=x-1,t===1&&x>852||t===2&&x>592)return1;for(;;){Ee=a-I,c[o]+1<k?(W=0,Q=c[o]):c[o]>=k?(W=L[c[o]-k],Q=S[c[o]-k]):(W=96,Q=0),g=1<<a-I,d=1<<u,v=d;dod-=g,s[h+(T>>I)+d]=Ee<<24|W<<16|Q|0;while(d!==0);for(g=1<<a-1;T&g;)g>>=1;if(g!==0?(T&=g-1,T+=g):T=0,o++,--b[a]===0){if(a===w)break;a=i[e+c[o]]}if(a>l&&(T&A)!==E){for(I===0&&(I=l),h+=v,u=a-I,p=1<<u;u+I<w&&(p-=b[u+I],!(p<=0));)u++,p<<=1;if(x+=1<<u,t===1&&x>852||t===2&&x>592)return1;E=T&A,s[E]=l<<24|u<<16|h-n|0}}returnT!==0&&(s[h+T]=a-I<<24|64<<16|0),f.bits=l,0};Ne.exports=Kt});varJ=R((Fi,Ze)=>{"use strict";Ze.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_MEM_ERROR:-4,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}});varbt=R((Vi,O)=>{"use strict";varhe=Ie(),M=De(),jt=Oe(),X=Me(),Wt=0,st=1,ft=2,{Z_FINISH:Be,Z_BLOCK:Qt,Z_TREES:$,Z_OK:P,Z_STREAM_END:Jt,Z_NEED_DICT:$t,Z_STREAM_ERROR:U,Z_DATA_ERROR:lt,Z_MEM_ERROR:ue,Z_BUF_ERROR:ei,Z_DEFLATED:Ce}=J(),ne=16180,Le=16181,Pe=16182,ze=16183,He=16184,Fe=16185,Ve=16186,Ge=16187,Ye=16188,Xe=16189,ie=16190,Z=16191,se=16192,qe=16193,fe=16194,Ke=16195,je=16196,We=16197,Qe=16198,ee=16199,te=16200,Je=16201,$e=16202,et=16203,tt=16204,it=16205,le=16206,nt=16207,rt=16208,y=16209,we=16210,ct=16211,ti=852,ii=592,ni=15,ri=ni,at=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);functionai(){this.strm=null,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=newUint16Array(320),this.work=newUint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}varz=t=>{if(!t)return1;leti=t.state;return!i||i.strm!==t||i.mode<ne||i.mode>ct?1:0},dt=t=>{if(z(t))returnU;leti=t.state;returnt.total_in=t.total_out=i.total=0,t.msg="",i.wrap&&(t.adler=i.wrap&1),i.mode=ne,i.last=0,i.havedict=0,i.flags=-1,i.dmax=32768,i.head=null,i.hold=0,i.bits=0,i.lencode=i.lendyn=newInt32Array(ti),i.distcode=i.distdyn=newInt32Array(ii),i.sane=1,i.back=-1,P},ht=t=>{if(z(t))returnU;leti=t.state;returni.wsize=0,i.whave=0,i.wnext=0,dt(t)},ut=(t,i)=>{lete;if(z(t))returnU;letr=t.state;returni<0?(e=0,i=-i):(e=(i>>4)+5,i<48&&(i&=15)),i&&(i<8||i>15)?U:(r.window!==null&&r.wbits!==i&&(r.window=null),r.wrap=e,r.wbits=i,ht(t))},wt=(t,i)=>{if(!t)returnU;lete=newai;t.state=e,e.strm=t,e.window=null,e.mode=ne;letr=ut(t,i);returnr!==P&&(t.state=null),r},oi=t=>wt(t,ri),ot=!0,ce,de,si=t=>{if(ot){ce=newInt32Array(512),de=newInt32Array(32);leti=0;for(;i<144;)t.lens[i++]=8;for(;i<256;)t.lens[i++]=9;for(;i<280;)t.lens[i++]=7;for(;i<288;)t.lens[i++]=8;for(X(st,t.lens,0,288,ce,0,t.work,{bits:9}),i=0;i<32;)t.lens[i++]=5;X(ft,t.lens,0,32,de,0,t.work,{bits:5}),ot=!1}t.lencode=ce,t.lenbits=9,t.distcode=de,t.distbits=5},xt=(t,i,e,r)=>{lets,n=t.state;returnn.window===null&&(n.wsize=1<<n.wbits,n.wnext=0,n.whave=0,n.window=newUint8Array(n.wsize)),r>=n.wsize?(n.window.set(i.subarray(e-n.wsize,e),0),n.wnext=0,n.whave=n.wsize):(s=n.wsize-n.wnext,s>r&&(s=r),n.window.set(i.subarray(e-r,e-r+s),n.wnext),r-=s,r?(n.window.set(i.subarray(e-r,e),0),n.wnext=r,n.whave=n.wsize):(n.wnext+=s,n.wnext===n.wsize&&(n.wnext=0),n.whave<n.wsize&&(n.whave+=s))),0},fi=(t,i)=>{lete,r,s,n,c,f,_,a,o,v,w,l,u,I,p=0,x,T,g,d,E,A,h,S,k=newUint8Array(4),b,m,L=newUint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(z(t)||!t.output||!t.input&&t.avail_in!==0)returnU;e=t.state,e.mode===Z&&(e.mode=se),c=t.next_out,s=t.output,_=t.avail_out,n=t.next_in,r=t.input,f=t.avail_in,a=e.hold,o=e.bits,v=f,w=_,S=P;e:for(;;)switch(e.mode){casene:if(e.wrap===0){e.mode=se;break}for(;o<16;){if(f===0)breake;f--,a+=r[n++]<<o,o+=8}if(e.wrap&2&&a===35615){e.wbits===0&&(e.wbits=15),e.check=0,k[0]=a&255,k[1]=a>>>8&255,e.check=M(e.check,k,2,0),a=0,o=0,e.mode=Le;break}if(e.head&&(e.head.done=!1),!(e.wrap&1)||(((a&255)<<8)+(a>>8))%31){t.msg="incorrect header check",e.mode=y;break}if((a&15)!==Ce){t.msg="unknown compression method",e.mode=y;break}if(a>>>=4,o-=4,h=(a&15)+8,e.wbits===0&&(e.wbits=h),h>15||h>e.wbits){t.msg="invalid window size",e.mode=y;break}e.dmax=1<<e.wbits,e.flags=0,t.adler=e.check=1,e.mode=a&512?Xe:Z,a=0,o=0;break;caseLe:for(;o<16;){if(f===0)breake;f--,a+=r[n++]<<o,o+=8}if(e.flags=a,(e.flags&255)!==Ce){t.msg="unknown compression method",e.mode=y;break}if(e.flags&57344){t.msg="unknown header flags set",e.mode=y;break}e.head&&(e.head.text=a>>8&1),e.flags&512&&e.wrap&4&&(k[0]=a&255,k[1]=a>>>8&255,e.check=M(e.check,k,2,0)),a=0,o=0,e.mode=Pe;casePe:for(;o<32;){if(f===0)breake;f--,a+=r[n++]<<o,o+=8}e.head&&(e.head.time=a),e.flags&512&&e.wrap&4&&(k[0]=a&255,k[1]=a>>>8&255,k[2]=a>>>16&255,k[3]=a>>>24&255,e.check=M(e.check,k,4,0)),a=0,o=0,e.mode=ze;caseze:for(;o<16;){if(f===0)breake;f--,a+=r[n++]<<o,o+=8}e.head&&(e.head.xflags=a&255,e.head.os=a>>8),e.flags&512&&e.wrap&4&&(k[0]=a&255,k[1]=a>>>8&255,e.check=M(e.check,k,2,0)),a=0,o=0,e.mode=He;caseHe:if(e.flags&1024){for(;o<16;){if(f===0)breake;f--,a+=r[n++]<<o,o+=8}e.length=a,e.head&&(e.head.extra_len=a),e.flags&512&&e.wrap&4&&(k[0]=a&255,k[1]=a>>>8&255,e.check=M(e.check,k,2,0)),a=0,o=0}elsee.head&&(e.head.extra=null);e.mode=Fe;caseFe:if(e.flags&1024&&(l=e.length,l>f&&(l=f),l&&(e.head&&(h=e.head.extra_len-e.length,e.head.extra||(e.head.extra=newUint8Array(e.head.extra_len)),e.head.extra.set(r.subarray(n,n+l),h)),e.flags&512&&e.wrap&4&&(e.check=M(e.check,r,l,n)),f-=l,n+=l,e.length-=l),e.length))breake;e.length=0,e.mode=Ve;caseVe:if(e.flags&2048){if(f===0)breake;l=0;doh=r[n+l++],e.head&&h&&e.length<65536&&(e.head.name+=String.fromCharCode(h));while(h&&l<f);if(e.flags&512&&e.wrap&4&&(e.check=M(e.check,r,l,n)),f-=l,n+=l,h)breake}elsee.head&&(e.head.name=null);e.length=0,e.mode=Ge;caseGe:if(e.flags&4096){if(f===0)breake;l=0;doh=r[n+l++],e.head&&h&&e.length<65536&&(e.head.comment+=String.fromCharCode(h));while(h&&l<f);if(e.flags&512&&e.wrap&4&&(e.check=M(e.check,r,l,n)),f-=l,n+=l,h)breake}elsee.head&&(e.head.comment=null);e.mode=Ye;caseYe:if(e.flags&512){for(;o<16;){if(f===0)breake;f--,a+=r[n++]<<o,o+=8}if(e.wrap&4&&a!==(e.check&65535)){t.msg="header crc mismatch",e.mode=y;break}a=0,o=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0),t.adler=e.check=0,e.mode=Z;break;caseXe:for(;o<32;){if(f===0)breake;f--,a+=r[n++]<<o,o+=8}t.adler=e.check=at(a),a=0,o=0,e.mode=ie;caseie:if(e.havedict===0)returnt.next_out=c,t.avail_out=_,t.next_in=n,t.avail_in=f,e.hold=a,e.bits=o,$t;t.adler=e.check=1,e.mode=Z;caseZ:if(i===Qt||i===$)breake;casese:if(e.last){a>>>=o&7,o-=o&7,e.mode=le;break}for(;o<3;){if(f===0)breake;f--,a+=r[n++]<<o,o+=8}switch(e.last=a&1,a>>>=1,o-=1,a&3){case0:e.mode=qe;break;case1:if(si(e),e.mode=ee,i===$){a>>>=2,o-=2;breake}break;case2:e.mode=je;break;case3:t.msg="invalid block type",e.mode=y}a>>>=2,o-=2;break;caseqe:for(a>>>=o&7,o-=o&7;o<32;){if(f===0)breake;f--,a+=r[n++]<<o,o+=8}if((a&65535)!==(a>>>16^65535)){t.msg="invalid stored block lengths",e.mode=y;break}if(e.length=a&65535,a=0,o=0,e.mode=fe,i===$)breake;casefe:e.mode=Ke;caseKe:if(l=e.length,l){if(l>f&&(l=f),l>_&&(l=_),l===0)breake;s.set(r.subarray(n,n+l),c),f-=l,n+=l,_-=l,c+=l,e.length-=l;break}e.mode=Z;break;caseje:for(;o<14;){if(f===0)breake;f--,a+=r[n++]<<o,o+=8}if(e.nlen=(a&31)+257,a>>>=5,o-=5,e.ndist=(a&31)+1,a>>>=5,o-=5,e.ncode=(a&15)+4,a>>>=4,o-=4,e.nlen>286||e.ndist>30){t.msg="too many length or distance symbols",e.mode=y;break}e.have=0,e.mode=We;caseWe:for(;e.have<e.ncode;){for(;o<3;){if(f===0)breake;f--,a+=r[n++]<<o,o+=8}e.lens[L[e.have++]]=a&7,a>>>=3,o-=3}for(;e.have<19;)e.lens[L[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,b={bits:e.lenbits},S=X(Wt,e.lens,0,19,e.lencode,0,e.work,b),e.lenbits=b.bits,S){t.msg="invalid code lengths set",e.mode=y;break}e.have=0,e.mode=Qe;caseQe:for(;e.have<e.nlen+e.ndist;){for(;p=e.lencode[a&(1<<e.lenbits)-1],x=p>>>24,T=p>>>16&255,g=p&65535,!(x<=o);){if(f===0)breake;f--,a+=r[n++]<<o,o+=8}if(g<16)a>>>=x,o-=x,e.lens[e.have++]=g;else{if(g===16){for(m=x+2;o<m;){if(f===0)breake;f--,a+=r[n++]<<o,o+=8}if(a>>>=x,o-=x,e.have===0){t.msg="invalid bit length repeat",e.mode=y;break}h=e.lens[e.have-1],l=3+(a&3),a>>>=2,o-=2}elseif(g===17){for(m=x+3;o<m;){if(f===0)breake;f--,a+=r[n++]<<o,o+=8}a>>>=x,o-=x,h=0,l=3+(a&7),a>>>=3,o-=3}else{for(m=x+7;o<m;){if(f===0)breake;f--,a+=r[n++]<<o,o+=8}a>>>=x,o-=x,h=0,l=11+(a&127),a>>>=7,o-=7}if(e.have+l>e.nlen+e.ndist){t.msg="invalid bit length repeat",e.mode=y;break}for(;l--;)e.lens[e.have++]=h}}if(e.mode===y)break;if(e.lens[256]===0){t.msg="invalid code -- missing end-of-block",e.mode=y;break}if(e.lenbits=9,b={bits:e.lenbits},S=X(st,e.lens,0,e.nlen,e.lencode,0,e.work,b),e.lenbits=b.bits,S){t.msg="invalid literal/lengths set",e.mode=y;break}if(e.distbits=6,e.distcode=e.distdyn,b={bits:e.distbits},S=X(ft,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,b),e.distbits=b.bits,S){t.msg="invalid distances set",e.mode=y;break}if(e.mode=ee,i===$)breake;caseee:e.mode=te;casete:if(f>=6&&_>=258){t.next_out=c,t.avail_out=_,t.next_in=n,t.avail_in=f,e.hold=a,e.bits=o,jt(t,w),c=t.next_out,s=t.output,_=t.avail_out,n=t.next_in,r=t.input,f=t.avail_in,a=e.hold,o=e.bits,e.mode===Z&&(e.back=-1);break}for(e.back=0;p=e.lencode[a&(1<<e.lenbits)-1],x=p>>>24,T=p>>>16&255,g=p&65535,!(x<=o);){if(f===0)breake;f--,a+=r[n++]<<o,o+=8}if(T&&(T&240)===0){for(d=x,E=T,A=g;p=e.lencode[A+((a&(1<<d+E)-1)>>d)],x=p>>>24,T=p>>>16&255,g=p&65535,!(d+x<=o);){if(f===0)breake;f--,a+=r[n++]<<o,o+=8}a>>>=d,o-=d,e.back+=d}if(a>>>=x,o-=x,e.back+=x,e.length=g,T===0){e.mode=it;break}if(T&32){e.back=-1,e.mode=Z;break}if(T&64){t.msg="invalid literal/length code",e.mode=y;break}e.extra=T&15,e.mode=Je;caseJe:if(e.extra){for(m=e.extra;o<m;){if(f===0)breake;f--,a+=r[n++]<<o,o+=8}e.length+=a&(1<<e.extra)-1,a>>>=e.extra,o-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=$e;case$e:for(;p=e.distcode[a&(1<<e.distbits)-1],x=p>>>24,T=p>>>16&255,g=p&65535,!(x<=o);){if(f===0)breake;f--,a+=r[n++]<<o,o+=8}if((T&240)===0){for(d=x,E=T,A=g;p=e.distcode[A+((a&(1<<d+E)-1)>>d)],x=p>>>24,T=p>>>16&255,g=p&65535,!(d+x<=o);){if(f===0)breake;f--,a+=r[n++]<<o,o+=8}a>>>=d,o-=d,e.back+=d}if(a>>>=x,o-=x,e.back+=x,T&64){t.msg="invalid distance code",e.mode=y;break}e.offset=g,e.extra=T&15,e.mode=et;caseet:if(e.extra){for(m=e.extra;o<m;){if(f===0)breake;f--,a+=r[n++]<<o,o+=8}e.offset+=a&(1<<e.extra)-1,a>>>=e.extra,o-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){t.msg="invalid distance too far back",e.mode=y;break}e.mode=tt;casett:if(_===0)breake;if(l=w-_,e.offset>l){if(l=e.offset-l,l>e.whave&&e.sane){t.msg="invalid distance too far back",e.mode=y;break}l>e.wnext?(l-=e.wnext,u=e.wsize-l):u=e.wnext-l,l>e.length&&(l=e.length),I=e.window}elseI=s,u=c-e.offset,l=e.length;l>_&&(l=_),_-=l,e.length-=l;dos[c++]=I[u++];while(--l);e.length===0&&(e.mode=te);break;caseit:if(_===0)breake;s[c++]=e.length,_--,e.mode=te;break;casele:if(e.wrap){for(;o<32;){if(f===0)breake;f--,a|=r[n++]<<o,o+=8}if(w-=_,t.total_out+=w,e.total+=w,e.wrap&4&&w&&(t.adler=e.check=e.flags?M(e.check,s,w,c-w):he(e.check,s,w,c-w)),w=_,e.wrap&4&&(e.flags?a:at(a))!==e.check){t.msg="incorrect data check",e.mode=y;break}a=0,o=0}e.mode=nt;casent:if(e.wrap&&e.flags){for(;o<32;){if(f===0)breake;f--,a+=r[n++]<<o,o+=8}if(e.wrap&4&&a!==(e.total&4294967295)){t.msg="incorrect length check",e.mode=y;break}a=0,o=0}e.mode=rt;casert:S=Jt;breake;casey:S=lt;breake;casewe:returnue;casect:default:returnU}returnt.next_out=c,t.avail_out=_,t.next_in=n,t.avail_in=f,e.hold=a,e.bits=o,(e.wsize||w!==t.avail_out&&e.mode<y&&(e.mode<le||i!==Be))&&xt(t,t.output,t.next_out,w-t.avail_out)?(e.mode=we,ue):(v-=t.avail_in,w-=t.avail_out,t.total_in+=v,t.total_out+=w,e.total+=w,e.wrap&4&&w&&(t.adler=e.check=e.flags?M(e.check,s,w,t.next_out-w):he(e.check,s,w,t.next_out-w)),t.data_type=e.bits+(e.last?64:0)+(e.mode===Z?128:0)+(e.mode===ee||e.mode===fe?256:0),(v===0&&w===0||i===Be)&&S===P&&(S=ei),S)},li=t=>{if(z(t))returnU;leti=t.state;returni.window&&(i.window=null),t.state=null,P},ci=(t,i)=>{if(z(t))returnU;lete=t.state;return(e.wrap&2)===0?U:(e.head=i,i.done=!1,P)},di=(t,i)=>{lete=i.length,r,s,n;returnz(t)||(r=t.state,r.wrap!==0&&r.mode!==ie)?U:r.mode===ie&&(s=1,s=he(s,i,e,0),s!==r.check)?lt:(n=xt(t,i,e,e),n?(r.mode=we,ue):(r.havedict=1,P))};O.exports.inflateReset=ht;O.exports.inflateReset2=ut;O.exports.inflateResetKeep=dt;O.exports.inflateInit=oi;O.exports.inflateInit2=wt;O.exports.inflate=fi;O.exports.inflateEnd=li;O.exports.inflateGetHeader=ci;O.exports.inflateSetDictionary=di;O.exports.inflateInfo="pako inflate (from Nodeca project)"});var_t=R((Gi,xe)=>{"use strict";varhi=(t,i)=>Object.prototype.hasOwnProperty.call(t,i);xe.exports.assign=function(t){leti=Array.prototype.slice.call(arguments,1);for(;i.length;){lete=i.shift();if(e){if(typeofe!="object")thrownewTypeError(e+"must be non-object");for(letrine)hi(e,r)&&(t[r]=e[r])}}returnt};xe.exports.flattenChunks=t=>{leti=0;for(letr=0,s=t.length;r<s;r++)i+=t[r].length;lete=newUint8Array(i);for(letr=0,s=0,n=t.length;r<n;r++){letc=t[r];e.set(c,s),s+=c.length}returne}});varkt=R((Yi,re)=>{"use strict";vargt=!0;try{String.fromCharCode.apply(null,newUint8Array(1))}catch{gt=!1}varq=newUint8Array(256);for(lett=0;t<256;t++)q[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;q[254]=q[254]=1;re.exports.string2buf=t=>{if(typeofTextEncoder=="function"&&TextEncoder.prototype.encode)returnnewTextEncoder().encode(t);leti,e,r,s,n,c=t.length,f=0;for(s=0;s<c;s++)e=t.charCodeAt(s),(e&64512)===55296&&s+1<c&&(r=t.charCodeAt(s+1),(r&64512)===56320&&(e=65536+(e-55296<<10)+(r-56320),s++)),f+=e<128?1:e<2048?2:e<65536?3:4;for(i=newUint8Array(f),n=0,s=0;n<f;s++)e=t.charCodeAt(s),(e&64512)===55296&&s+1<c&&(r=t.charCodeAt(s+1),(r&64512)===56320&&(e=65536+(e-55296<<10)+(r-56320),s++)),e<128?i[n++]=e:e<2048?(i[n++]=192|e>>>6,i[n++]=128|e&63):e<65536?(i[n++]=224|e>>>12,i[n++]=128|e>>>6&63,i[n++]=128|e&63):(i[n++]=240|e>>>18,i[n++]=128|e>>>12&63,i[n++]=128|e>>>6&63,i[n++]=128|e&63);returni};varui=(t,i)=>{if(i<65534&&t.subarray&>)returnString.fromCharCode.apply(null,t.length===i?t:t.subarray(0,i));lete="";for(letr=0;r<i;r++)e+=String.fromCharCode(t[r]);returne};re.exports.buf2string=(t,i)=>{lete=i||t.length;if(typeofTextDecoder=="function"&&TextDecoder.prototype.decode)returnnewTextDecoder().decode(t.subarray(0,i));letr,s,n=newArray(e*2);for(s=0,r=0;r<e;){letc=t[r++];if(c<128){n[s++]=c;continue}letf=q[c];if(f>4){n[s++]=65533,r+=f-1;continue}for(c&=f===2?31:f===3?15:7;f>1&&r<e;)c=c<<6|t[r++]&63,f--;if(f>1){n[s++]=65533;continue}c<65536?n[s++]=c:(c-=65536,n[s++]=55296|c>>10&1023,n[s++]=56320|c&1023)}returnui(n,s)};re.exports.utf8border=(t,i)=>{i=i||t.length,i>t.length&&(i=t.length);lete=i-1;for(;e>=0&&(t[e]&192)===128;)e--;returne<0||e===0?i:e+q[t[e]]>i?e:i}});varEt=R((Xi,pt)=>{"use strict";pt.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"}});varSt=R((qi,mt)=>{"use strict";functionwi(){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}mt.exports=wi});varvt=R((Ki,Tt)=>{"use strict";functionxi(){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}Tt.exports=xi});varRt=R((ji,V)=>{"use strict";varB=bt(),At=_t(),ge=kt(),ke=Et(),bi=St(),_i=vt(),It=Object.prototype.toString,{Z_NO_FLUSH:gi,Z_FINISH:ki,Z_OK:K,Z_STREAM_END:be,Z_NEED_DICT:_e,Z_STREAM_ERROR:pi,Z_DATA_ERROR:yt,Z_MEM_ERROR:Ei}=J();functionj(t){this.options=At.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});leti=this.options;i.raw&&i.windowBits>=0&&i.windowBits<16&&(i.windowBits=-i.windowBits,i.windowBits===0&&(i.windowBits=-15)),i.windowBits>=0&&i.windowBits<16&&!(t&&t.windowBits)&&(i.windowBits+=32),i.windowBits>15&&i.windowBits<48&&(i.windowBits&15)===0&&(i.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=newbi,this.strm.avail_out=0;lete=B.inflateInit2(this.strm,i.windowBits);if(e!==K)thrownewError(ke[e]);if(this.header=new_i,B.inflateGetHeader(this.strm,this.header),i.dictionary&&(typeofi.dictionary=="string"?i.dictionary=ge.string2buf(i.dictionary):It.call(i.dictionary)==="[object ArrayBuffer]"&&(i.dictionary=newUint8Array(i.dictionary)),i.raw&&(e=B.inflateSetDictionary(this.strm,i.dictionary),e!==K)))thrownewError(ke[e])}j.prototype.push=function(t,i){lete=this.strm,r=this.options.chunkSize,s=this.options.dictionary,n,c,f;if(this.ended)return!1;for(i===~~i?c=i:c=i===!0?ki:gi,It.call(t)==="[object ArrayBuffer]"?e.input=newUint8Array(t):e.input=t,e.next_in=0,e.avail_in=e.input.length;;){for(e.avail_out===0&&(e.output=newUint8Array(r),e.next_out=0,e.avail_out=r),n=B.inflate(e,c),n===_e&&s&&(n=B.inflateSetDictionary(e,s),n===K?n=B.inflate(e,c):n===yt&&(n=_e));e.avail_in>0&&n===be&&e.state.wrap>0&&t[e.next_in]!==0;)B.inflateReset(e),n=B.inflate(e,c);switch(n){casepi:caseyt:case_e:caseEi:returnthis.onEnd(n),this.ended=!0,!1}if(f=e.avail_out,e.next_out&&(e.avail_out===0||n===be))if(this.options.to==="string"){let_=ge.utf8border(e.output,e.next_out),a=e.next_out-_,o=ge.buf2string(e.output,_);e.next_out=a,e.avail_out=r-a,a&&e.output.set(e.output.subarray(_,_+a),0),this.onData(o)}elsethis.onData(e.output.length===e.next_out?e.output:e.output.subarray(0,e.next_out));if(!(n===K&&f===0)){if(n===be)returnn=B.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,!0;if(e.avail_in===0)break}}return!0};j.prototype.onData=function(t){this.chunks.push(t)};j.prototype.onEnd=function(t){t===K&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=At.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};functionpe(t,i){lete=newj(i);if(e.push(t),e.err)throwe.msg||ke[e.err];returne.result}functionmi(t,i){returni=i||{},i.raw=!0,pe(t,i)}V.exports.Inflate=j;V.exports.inflate=pe;V.exports.inflateRaw=mi;V.exports.ungzip=pe;V.exports.constants=J()});varNt=1953029805,Mt=2917034100;functionoe(t,i){if(oe.passThroughDataForTesting)returni;ae.typeOf.object("key",t),ae.typeOf.object("data",i);lete=t.byteLength;if(e===0||e%4!==0)thrownewD("The length of key must be greater than 0 and a multiple of 4.");letr=newDataView(i),s=r.getUint32(0,!0);if(s===Nt||s===Mt)returni;letn=newDataView(t),c=0,f=i.byteLength,_=f-f%8,a=e,o,v=8;for(;c<_;)for(v=(v+8)%24,o=v;c<_&&o<a;)r.setUint32(c,r.getUint32(c,!0)^n.getUint32(o,!0),!0),r.setUint32(c+4,r.getUint32(c+4,!0)^n.getUint32(o+4,!0),!0),c+=8,o+=24;if(c<f)for(o>=a&&(v=(v+8)%24,o=v);c<f;)r.setUint8(c,r.getUint8(c)^n.getUint8(o)),c++,o++}oe.passThroughDataForTesting=!1;varTe=oe;functionZt(t,i){return(t&i)!==0}varF=Zt;varBt=[1,2,4,8],ve=15,Ct=16,Lt=64,Pt=128;functionN(t,i,e,r,s,n){this._bits=t,this.cnodeVersion=i,this.imageryVersion=e,this.terrainVersion=r,this.imageryProvider=s,this.terrainProvider=n,this.ancestorHasTerrain=!1,this.terrainState=void0}N.clone=function(t,i){returnme(i)?(i._bits=t._bits,i.cnodeVersion=t.cnodeVersion,i.imageryVersion=t.imageryVersion,i.terrainVersion=t.terrainVersion,i.imageryProvider=t.imageryProvider,i.terrainProvider=t.terrainProvider):i=newN(t._bits,t.cnodeVersion,t.imageryVersion,t.terrainVersion,t.imageryProvider,t.terrainProvider),i.ancestorHasTerrain=t.ancestorHasTerrain,i.terrainState=t.terrainState,i};N.prototype.setParent=function(t){this.ancestorHasTerrain=t.ancestorHasTerrain||this.hasTerrain()};N.prototype.hasSubtree=function(){returnF(this._bits,Ct)};N.prototype.hasImagery=function(){returnF(this._bits,Lt)};N.prototype.hasTerrain=function(){returnF(this._bits,Pt)};N.prototype.hasChildren=function(){returnF(this._bits,ve)};N.prototype.hasChild=function(t){returnF(this._bits,Bt[t])};N.prototype.getChildBitmask=function(){returnthis._bits&ve};varye=N;varUt=Ot(Rt(),1);varG=Uint16Array.BYTES_PER_ELEMENT,H=Int32Array.BYTES_PER_ELEMENT,Y=Uint32Array.BYTES_PER_ELEMENT,C={METADATA:0,TERRAIN:1,DBROOT:2};C.fromString=function(t){if(t==="Metadata")returnC.METADATA;if(t==="Terrain")returnC.TERRAIN;if(t==="DbRoot")returnC.DBROOT};functionSi(t,i){lete=C.fromString(t.type),r=t.buffer;Te(t.key,r);lets=Di(r);r=s.buffer;letn=s.length;switch(e){caseC.METADATA:returnvi(r,n,t.quadKey);caseC.TERRAIN:returnIi(r,n,i);caseC.DBROOT:returni.push(r),{buffer:r}}}varTi=32301;functionvi(t,i,e){letr=newDataView(t),s=0,n=r.getUint32(s,!0);if(s+=Y,n!==Ti)thrownewD("Invalid magic");letc=r.getUint32(s,!0);if(s+=Y,c!==1)thrownewD("Invalid data type. Must be 1 for QuadTreePacket");letf=r.getUint32(s,!0);if(s+=Y,f!==2)thrownewD("Invalid QuadTreePacket version. Only version 2 is supported.");let_=r.getInt32(s,!0);s+=H;leta=r.getInt32(s,!0);if(s+=H,a!==32)thrownewD("Invalid instance size.");leto=r.getInt32(s,!0);s+=H;letv=r.getInt32(s,!0);s+=H;letw=r.getInt32(s,!0);if(s+=H,o!==_*a+s)thrownewD("Invalid dataBufferOffset");if(o+v+w!==i)thrownewD("Invalid packet offsets");letl=[];for(letg=0;g<_;++g){letd=r.getUint8(s);++s,++s;letE=r.getUint16(s,!0);s+=G;letA=r.getUint16(s,!0);s+=G;leth=r.getUint16(s,!0);s+=G,s+=G,s+=G,s+=H,s+=H,s+=8;letS=r.getUint8(s++),k=r.getUint8(s++);s+=G,l.push(newye(d,E,A,h,S,k))}letu=[],I=0;functionp(g,d,E){letA=!1;if(E===4){if(d.hasSubtree())return;A=!0}for(leth=0;h<4;++h){letS=g+h.toString();if(A)u[S]=null;elseif(E<4)if(!d.hasChild(h))u[S]=null;else{if(I===_){console.log("Incorrect number of instances");return}letk=l[I++];u[S]=k,p(S,k,E+1)}}}letx=0,T=l[I++];returne===""?++x:u[e]=T,p(e,T,x),u}varyi=5,Ai=4;functionIi(t,i,e){letr=newDataView(t),s=function(f){for(let_=0;_<Ai;++_){leta=r.getUint32(f,!0);if(f+=Y,f+=a,f>i)thrownewD("Malformed terrain packet found.")}returnf},n=0,c=[];for(;c.length<yi;){letf=n;n=s(n);let_=t.slice(f,n);e.push(_),c.push(_)}returnc}varDt=1953029805,Ri=2917034100;functionDi(t){leti=newDataView(t),e=0,r=i.getUint32(e,!0);if(e+=Y,r!==Dt&&r!==Ri)thrownewD("Invalid magic");lets=i.getUint32(e,r===Dt);e+=Y;letn=newUint8Array(t,e),c=Ut.default.inflate(n);if(c.length!==s)thrownewD("Size of packet doesn't match header");returnc}varen=Se(Si);export{enasdefault};
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{aasRn}from"./chunk-PWAJ3RAI.js";import{aasM}from"./chunk-ANLJ4KBN.js";import{aasre}from"./chunk-ID6SFQTL.js";import{aassn}from"./chunk-VLPNAR64.js";import{bason}from"./chunk-GE5NEIZC.js";import{aasPt,casor,dassr,easLe}from"./chunk-35CVRQTC.js";varAn=or((st,Et)=>{varpt=function(){varo=typeofdocument<"u"&&document.currentScript?document.currentScript.src:void0;returntypeof__filename<"u"&&(o=o||__filename),function(f){f=f||{};varr=typeoff<"u"?f:{},C,l;r.ready=newPromise(function(e,t){C=e,l=t});varE={},F;for(Finr)r.hasOwnProperty(F)&&(E[F]=r[F]);varg=[],m="./this.program",I=function(e,t){throwt},N=!1,d=!1,P=!1,Q=!1;N=typeofwindow=="object",d=typeofimportScripts=="function",P=typeofprocess=="object"&&typeofprocess.versions=="object"&&typeofprocess.versions.node=="string",Q=!N&&!P&&!d;varu="";functionW(e){returnr.locateFile?r.locateFile(e,u):u+e}varJ,ae,j,Be,Ce,Fe;P?(d?u=Pt("path").dirname(u)+"/":u=__dirname+"/",J=function(t,n){returnCe||(Ce=Pt("fs")),Fe||(Fe=Pt("path")),t=Fe.normalize(t),Ce.readFileSync(t,n?null:"utf8")},j=function(t){varn=J(t,!0);returnn.buffer||(n=newUint8Array(n)),D(n.buffer),n},process.argv.length>1&&(m=process.argv[1].replace(/\\/g,"/")),g=process.argv.slice(2),process.on("uncaughtException",function(e){if(!(einstanceof_r))throwe}),process.on("unhandledRejection",Oe),I=function(e){process.exit(e)},r.inspect=function(){return"[Emscripten Module object]"}):Q?(typeofread<"u"&&(J=function(t){returnread(t)}),j=function(t){varn;returntypeofreadbuffer=="function"?newUint8Array(readbuffer(t)):(n=read(t,"binary"),D(typeofn=="object"),n)},typeofscriptArgs<"u"?g=scriptArgs:typeofarguments<"u"&&(g=arguments),typeofquit=="function"&&(I=function(e){quit(e)}),typeofprint<"u"&&(typeofconsole>"u"&&(console={}),console.log=print,console.warn=console.error=typeofprintErr<"u"?printErr:print)):(N||d)&&(d?u=self.location.href:typeofdocument<"u"&&document.currentScript&&(u=document.currentScript.src),o&&(u=o),u.indexOf("blob:")!==0?u=u.substr(0,u.lastIndexOf("/")+1):u="",J=function(e){vart=newXMLHttpRequest;returnt.open("GET",e,!1),t.send(null),t.responseText},d&&(j=function(e){vart=newXMLHttpRequest;returnt.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),newUint8Array(t.response)}),ae=function(e,t,n){var_=newXMLHttpRequest;_.open("GET",e,!0),_.responseType="arraybuffer",_.onload=function(){if(_.status==200||_.status==0&&_.response){t(_.response);return}n()},_.onerror=n,_.send(null)},Be=function(e){document.title=e});varit=r.print||console.log.bind(console),oe=r.printErr||console.warn.bind(console);for(FinE)E.hasOwnProperty(F)&&(r[F]=E[F]);E=null,r.arguments&&(g=r.arguments),r.thisProgram&&(m=r.thisProgram),r.quit&&(I=r.quit);varRt=0,vt=function(e){Rt=e},se;r.wasmBinary&&(se=r.wasmBinary);varln=r.noExitRuntime||!0;typeofWebAssembly!="object"&&Oe("no native wasm support detected");varde,Ie=!1,ce;functionD(e,t){e||Oe("Assertion failed: "+t)}varbe=typeofTextDecoder<"u"?newTextDecoder("utf8"):void0;functionwe(e,t,n){for(var_=t+n,s=t;e[s]&&!(s>=_);)++s;if(s-t>16&&e.subarray&&be)returnbe.decode(e.subarray(t,s));for(vara="";t<s;){varc=e[t++];if(!(c&128)){a+=String.fromCharCode(c);continue}vari=e[t++]&63;if((c&224)==192){a+=String.fromCharCode((c&31)<<6|i);continue}varR=e[t++]&63;if((c&240)==224?c=(c&15)<<12|i<<6|R:c=(c&7)<<18|i<<12|R<<6|e[t++]&63,c<65536)a+=String.fromCharCode(c);else{varT=c-65536;a+=String.fromCharCode(55296|T>>10,56320|T&1023)}}returna}functionSe(e,t){returne?we(p,e,t):""}functionHe(e,t,n,_){if(!(_>0))return0;for(vars=n,a=n+_-1,c=0;c<e.length;++c){vari=e.charCodeAt(c);if(i>=55296&&i<=57343){varR=e.charCodeAt(++c);i=65536+((i&1023)<<10)|R&1023}if(i<=127){if(n>=a)break;t[n++]=i}elseif(i<=2047){if(n+1>=a)break;t[n++]=192|i>>6,t[n++]=128|i&63}elseif(i<=65535){if(n+2>=a)break;t[n++]=224|i>>12,t[n++]=128|i>>6&63,t[n++]=128|i&63}else{if(n+3>=a)break;t[n++]=240|i>>18,t[n++]=128|i>>12&63,t[n++]=128|i>>6&63,t[n++]=128|i&63}}returnt[n]=0,n-s}functionXe(e,t,n){returnHe(e,p,t,n)}functionat(e){for(vart=0,n=0;n<e.length;++n){var_=e.charCodeAt(n);_>=55296&&_<=57343&&(_=65536+((_&1023)<<10)|e.charCodeAt(++n)&1023),_<=127?++t:_<=2047?t+=2:_<=65535?t+=3:t+=4}returnt}varGe=typeofTextDecoder<"u"?newTextDecoder("utf-16le"):void0;functionxe(e,t){for(varn=e,_=n>>1,s=_+t/2;!(_>=s)&&Ae[_];)++_;if(n=_<<1,n-e>32&&Ge)returnGe.decode(p.subarray(e,n));for(vara="",c=0;!(c>=t/2);++c){vari=k[e+c*2>>1];if(i==0)break;a+=String.fromCharCode(i)}returna}functionke(e,t,n){if(n===void0&&(n=2147483647),n<2)return0;n-=2;for(var_=t,s=n<e.length*2?n/2:e.length,a=0;a<s;++a){varc=e.charCodeAt(a);k[t>>1]=c,t+=2}returnk[t>>1]=0,t-_}function$e(e){returne.length*2}functionct(e,t){for(varn=0,_="";!(n>=t/4);){vars=L[e+n*4>>2];if(s==0)break;if(++n,s>=65536){vara=s-65536;_+=String.fromCharCode(55296|a>>10,56320|a&1023)}else_+=String.fromCharCode(s)}return_}functionAt(e,t,n){if(n===void0&&(n=2147483647),n<4)return0;for(var_=t,s=_+n-4,a=0;a<e.length;++a){varc=e.charCodeAt(a);if(c>=55296&&c<=57343){vari=e.charCodeAt(++a);c=65536+((c&1023)<<10)|i&1023}if(L[t>>2]=c,t+=4,t+4>s)break}returnL[t>>2]=0,t-_}functionft(e){for(vart=0,n=0;n<e.length;++n){var_=e.charCodeAt(n);_>=55296&&_<=57343&&++n,t+=4}returnt}functionTt(e,t){returne%t>0&&(e+=t-e%t),e}varNe,U,p,k,Ae,L,z,Ut,ht;functionyt(e){Ne=e,r.HEAP8=U=newInt8Array(e),r.HEAP16=k=newInt16Array(e),r.HEAP32=L=newInt32Array(e),r.HEAPU8=p=newUint8Array(e),r.HEAPU16=Ae=newUint16Array(e),r.HEAPU32=z=newUint32Array(e),r.HEAPF32=Ut=newFloat32Array(e),r.HEAPF64=ht=newFloat64Array(e)}varur=r.INITIAL_MEMORY||16777216,Ve,gt=[],Lt=[],Mn=[],mt=[],Kn=!1;functionBn(){if(r.preRun)for(typeofr.preRun=="function"&&(r.preRun=[r.preRun]);r.preRun.length;)Sn(r.preRun.shift());We(gt)}functionCn(){Kn=!0,We(Lt)}functionFn(){We(Mn)}functiondn(){if(r.postRun)for(typeofr.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;)Nn(r.postRun.shift());We(mt)}functionSn(e){gt.unshift(e)}functionGn(e){Lt.unshift(e)}functionNn(e){mt.unshift(e)}varfe=0,ut=null,Pe=null;functionVn(e){fe++,r.monitorRunDependencies&&r.monitorRunDependencies(fe)}functionPn(e){if(fe--,r.monitorRunDependencies&&r.monitorRunDependencies(fe),fe==0&&(ut!==null&&(clearInterval(ut),ut=null),Pe)){vart=Pe;Pe=null,t()}}r.preloadedImages={},r.preloadedAudios={};functionOe(e){r.onAbort&&r.onAbort(e),e+="",oe(e),Ie=!0,ce=1,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.";vart=newWebAssembly.RuntimeError(e);throwl(t),t}functionDt(e,t){returnString.prototype.startsWith?e.startsWith(t):e.indexOf(t)===0}varpn="data:application/octet-stream;base64,";functionIt(e){returnDt(e,pn)}varEn="file://";functionbt(e){returnDt(e,En)}varX="basis_transcoder.wasm";It(X)||(X=W(X));functionwt(e){try{if(e==X&&se)returnnewUint8Array(se);if(j)returnj(e);throw"both async and sync fetching of the wasm failed"}catch(t){Oe(t)}}functionvn(){if(!se&&(N||d)){if(typeoffetch=="function"&&!bt(X))returnfetch(X,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+X+"'";returne.arrayBuffer()}).catch(function(){returnwt(X)});if(ae)returnnewPromise(function(e,t){ae(X,function(n){e(newUint8Array(n))},t)})}returnPromise.resolve().then(function(){returnwt(X)})}functionUn(){vare={a:J_};functiont(c,i){varR=c.exports;r.asm=R,de=r.asm.K,yt(de.buffer),Ve=r.asm.O,Gn(r.asm.L),Pn("wasm-instantiate")}Vn("wasm-instantiate");functionn(c){t(c.instance)}function_(c){returnvn().then(function(i){varR=WebAssembly.instantiate(i,e);returnR}).then(c,function(i){oe("failed to asynchronously prepare wasm: "+i),Oe(i)})}functions(){return!se&&typeofWebAssembly.instantiateStreaming=="function"&&!It(X)&&!bt(X)&&typeoffetch=="function"?fetch(X,{credentials:"same-origin"}).then(function(c){vari=WebAssembly.instantiateStreaming(c,e);returni.then(n,function(R){returnoe("wasm streaming compile failed: "+R),oe("falling back to ArrayBuffer instantiation"),_(n)})}):_(n)}if(r.instantiateWasm)try{vara=r.instantiateWasm(e,t);returna}catch(c){returnoe("Module.instantiateWasm callback failed with error: "+c),!1}returns().catch(l),{}}functionWe(e){for(;e.length>0;){vart=e.shift();if(typeoft=="function"){t(r);continue}varn=t.func;typeofn=="number"?t.arg===void0?Ve.get(n)():Ve.get(n)(t.arg):n(t.arg===void0?null:t.arg)}}varje={};functionYe(e){for(;e.length;){vart=e.pop(),n=e.pop();n(t)}}functionpe(e){returnthis.fromWireType(z[e>>2])}varle={},Te={},ze={},hn=48,yn=57;functionqe(e){if(e===void0)return"_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");vart=e.charCodeAt(0);returnt>=hn&&t<=yn?"_"+e:e}functionZe(e,t){returne=qe(e),newFunction("body","return function "+e+`() {
`+s.replace(/^Error(:[^\n]*)?\n/,""))});returnn.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.prototype.toString=function(){returnthis.message===void0?this.name:this.name+": "+this.message},n}varHt=void0;functionQe(e){thrownewHt(e)}functionie(e,t,n){e.forEach(function(i){ze[i]=t});function_(i){varR=n(i);R.length!==e.length&&Qe("Mismatched type converter count");for(varT=0;T<e.length;++T)q(e[T],R[T])}vars=newArray(t.length),a=[],c=0;t.forEach(function(i,R){Te.hasOwnProperty(i)?s[R]=Te[i]:(a.push(i),le.hasOwnProperty(i)||(le[i]=[]),le[i].push(function(){s[R]=Te[i],++c,c===a.length&&_(s)}))}),a.length===0&&_(s)}functiongn(e){vart=je[e];deleteje[e];varn=t.rawConstructor,_=t.rawDestructor,s=t.fields,a=s.map(function(c){returnc.getterReturnType}).concat(s.map(function(c){returnc.setterArgumentType}));ie([e],a,function(c){vari={};returns.forEach(function(R,T){varO=R.fieldName,K=c[T],G=R.getter,V=R.getterContext,y=c[T+s.length],b=R.setter,$=R.setterContext;i[O]={read:function(Z){returnK.fromWireType(G(V,Z))},write:function(Z,ge){var_e=[];b($,Z,y.toWireType(_e,ge)),Ye(_e)}}}),[{name:t.name,fromWireType:function(R){varT={};for(varOini)T[O]=i[O].read(R);return_(R),T},toWireType:function(R,T){for(varOini)if(!(OinT))thrownewTypeError('Missing field: "'+O+'"');varK=n();for(Oini)i[O].write(K,T[O]);returnR!==null&&R.push(_,K),K},argPackAdvance:8,readValueFromPointer:pe,destructorFunction:_}]})}functionJe(e){switch(e){case1:return0;case2:return1;case4:return2;case8:return3;default:thrownewTypeError("Unknown type size: "+e)}}functionLn(){for(vare=newArray(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);Xt=e}varXt=void0;functionh(e){for(vart="",n=e;p[n];)t+=Xt[p[n++]];returnt}varMe=void0;functionS(e){thrownewMe(e)}functionq(e,t,n){if(n=n||{},!("argPackAdvance"int))thrownewTypeError("registerType registeredInstance requires argPackAdvance");var_=t.name;if(e||S('type "'+_+'" must have a positive integer typeid pointer'),Te.hasOwnProperty(e)){if(n.ignoreDuplicateRegistrations)return;S("Cannot register type '"+_+"' twice")}if(Te[e]=t,deleteze[e],le.hasOwnProperty(e)){vars=le[e];deletele[e],s.forEach(function(a){a()})}}functionmn(e,t,n,_,s){vara=Je(n);t=h(t),q(e,{name:t,fromWireType:function(c){return!!c},toWireType:function(c,i){returni?_:s},argPackAdvance:8,readValueFromPointer:function(c){vari;if(n===1)i=U;elseif(n===2)i=k;elseif(n===4)i=L;elsethrownewTypeError("Unknown boolean type size: "+t);returnthis.fromWireType(i[c>>a])},destructorFunction:null})}functionDn(e){if(!(thisinstanceofRe)||!(einstanceofRe))return!1;for(vart=this.$$.ptrType.registeredClass,n=this.$$.ptr,_=e.$$.ptrType.registeredClass,s=e.$$.ptr;t.baseClass;)n=t.upcast(n),t=t.baseClass;for(;_.baseClass;)s=_.upcast(s),_=_.baseClass;returnt===_&&n===s}functionIn(e){return{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}}functionlt(e){functiont(n){returnn.$$.ptrType.registeredClass.name}S(t(e)+" instance already deleted")}varMt=!1;functionxt(e){}functionbn(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}functionkt(e){e.count.value-=1;vart=e.count.value===0;t&&bn(e)}functionEe(e){returntypeofFinalizationGroup>"u"?(Ee=function(t){returnt},e):(Mt=newFinalizationGroup(function(t){for(varn=t.next();!n.done;n=t.next()){var_=n.value;_.ptr?kt(_):console.warn("object already deleted: "+_.ptr)}}),Ee=function(t){returnMt.register(t,t.$$,t.$$),t},xt=function(t){Mt.unregister(t.$$)},Ee(e))}functionwn(){if(this.$$.ptr||lt(this),this.$$.preservePointerOnDelete)returnthis.$$.count.value+=1,this;vare=Ee(Object.create(Object.getPrototypeOf(this),{$$:{value:In(this.$$)}}));returne.$$.count.value+=1,e.$$.deleteScheduled=!1,e}functionHn(){this.$$.ptr||lt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&S("Object already scheduled for deletion"),xt(this),kt(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void0,this.$$.ptr=void0)}functionXn(){return!this.$$.ptr}varve=void0,Ue=[];functionKt(){for(;Ue.length;){vare=Ue.pop();e.$$.deleteScheduled=!1,e.delete()}}functionxn(){returnthis.$$.ptr||lt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&S("Object already scheduled for deletion"),Ue.push(this),Ue.length===1&&ve&&ve(Kt),this.$$.deleteScheduled=!0,this}functionkn(){Re.prototype.isAliasOf=Dn,Re.prototype.clone=wn,Re.prototype.delete=Hn,Re.prototype.isDeleted=Xn,Re.prototype.deleteLater=xn}functionRe(){}var$t={};functionWt(e,t,n){if(e[t].overloadTable===void0){var_=e[t];e[t]=function(){returne[t].overloadTable.hasOwnProperty(arguments.length)||S("Function '"+n+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+e[t].overloadTable+")!"),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[_.argCount]=_}}functionBt(e,t,n){r.hasOwnProperty(e)?((n===void0||r[e].overloadTable!==void0&&r[e].overloadTable[n]!==void0)&&S("Cannot register public name '"+e+"' twice"),Wt(r,e,e),r.hasOwnProperty(n)&&S("Cannot register multiple overloads of a function with the same number of arguments ("+n+")!"),r[e].overloadTable[n]=t):(r[e]=t,n!==void0&&(r[e].numArguments=n))}function$n(e,t,n,_,s,a,c,i){this.name=e,this.constructor=t,this.instancePrototype=n,this.rawDestructor=_,this.baseClass=s,this.getActualType=a,this.upcast=c,this.downcast=i,this.pureVirtualFunctions=[]}functionCt(e,t,n){for(;t!==n;)t.upcast||S("Expected null or instance of "+n.name+", got an instance of "+t.name),e=t.upcast(e),t=t.baseClass;returne}functionWn(e,t){if(t===null)returnthis.isReference&&S("null is not a valid "+this.name),0;t.$$||S('Cannot pass "'+Ke(t)+'" as a '+this.name),t.$$.ptr||S("Cannot pass deleted object as a pointer of type "+this.name);varn=t.$$.ptrType.registeredClass,_=Ct(t.$$.ptr,n,this.registeredClass);return_}functionjn(e,t){varn;if(t===null)returnthis.isReference&&S("null is not a valid "+this.name),this.isSmartPointer?(n=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,n),n):0;t.$$||S('Cannot pass "'+Ke(t)+'" as a '+this.name),t.$$.ptr||S("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&t.$$.ptrType.isConst&&S("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);var_=t.$$.ptrType.registeredClass;if(n=Ct(t.$$.ptr,_,this.registeredClass),this.isSmartPointer)switch(t.$$.smartPtr===void0&&S("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case0:t.$$.smartPtrType===this?n=t.$$.smartPtr:S("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);break;case1:n=t.$$.smartPtr;break;case2:if(t.$$.smartPtrType===this)n=t.$$.smartPtr;else{vars=t.clone();n=this.rawShare(n,te(function(){s.delete()})),e!==null&&e.push(this.rawDestructor,n)}break;default:S("Unsupporting sharing policy")}returnn}functionYn(e,t){if(t===null)returnthis.isReference&&S("null is not a valid "+this.name),0;t.$$||S('Cannot pass "'+Ke(t)+'" as a '+this.name),t.$$.ptr||S("Cannot pass deleted object as a pointer of type "+this.name),t.$$.ptrType.isConst&&S("Cannot convert argument of type "+t.$$.ptrType.name+" to parameter type "+this.name);varn=t.$$.ptrType.registeredClass,_=Ct(t.$$.ptr,n,this.registeredClass);return_}functionzn(e){returnthis.rawGetPointee&&(e=this.rawGetPointee(e)),e}functionqn(e){this.rawDestructor&&this.rawDestructor(e)}functionZn(e){e!==null&&e.delete()}functionjt(e,t,n){if(t===n)returne;if(n.baseClass===void0)returnnull;var_=jt(e,t,n.baseClass);return_===null?null:n.downcast(_)}functionQn(){returnObject.keys(he).length}functionJn(){vare=[];for(vartinhe)he.hasOwnProperty(t)&&e.push(he[t]);returne}functione_(e){ve=e,Ue.length&&ve&&ve(Kt)}functiont_(){r.getInheritedInstanceCount=Qn,r.getLiveInheritedInstances=Jn,r.flushPendingDeletes=Kt,r.setDelayFunction=e_}varhe={};functionn_(e,t){for(t===void0&&S("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;returnt}function__(e,t){returnt=n_(e,t),he[t]}functionet(e,t){(!t.ptrType||!t.ptr)&&Qe("makeClassHandle requires ptr and ptrType");varn=!!t.smartPtrType,_=!!t.smartPtr;returnn!==_&&Qe("Both smartPtrType and smartPtr must be specified"),t.count={value:1},Ee(Object.create(e,{$$:{value:t}}))}functionr_(e){vart=this.getPointee(e);if(!t)returnthis.destructor(e),null;varn=__(this.registeredClass,t);if(n!==void0){if(n.$$.count.value===0)returnn.$$.ptr=t,n.$$.smartPtr=e,n.clone();var_=n.clone();returnthis.destructor(e),_}functions(){returnthis.isSmartPointer?et(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):et(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}vara=this.registeredClass.getActualType(t),c=$t[a];if(!c)returns.call(this);vari;this.isConst?i=c.constPointerType:i=c.pointerType;varR=jt(t,this.registeredClass,i.registeredClass);returnR===null?s.call(this):this.isSmartPointer?et(i.registeredClass.instancePrototype,{ptrType:i,ptr:R,smartPtrType:this,smartPtr:e}):et(i.registeredClass.instancePrototype,{ptrType:i,ptr:R})}functiono_(){ee.prototype.getPointee=zn,ee.prototype.destructor=qn,ee.prototype.argPackAdvance=8,ee.prototype.readValueFromPointer=pe,ee.prototype.deleteObject=Zn,ee.prototype.fromWireType=r_}functionee(e,t,n,_,s,a,c,i,R,T,O){this.name=e,this.registeredClass=t,this.isReference=n,this.isConst=_,this.isSmartPointer=s,this.pointeeType=a,this.sharingPolicy=c,this.rawGetPointee=i,this.rawConstructor=R,this.rawShare=T,this.rawDestructor=O,!s&&t.baseClass===void0?_?(this.toWireType=Wn,this.destructorFunction=null):(this.toWireType=Yn,this.destructorFunction=null):this.toWireType=jn}functionYt(e,t,n){r.hasOwnProperty(e)||Qe("Replacing nonexistant public symbol"),r[e].overloadTable!==void0&&n!==void0?r[e].overloadTable[n]=t:(r[e]=t,r[e].argCount=n)}functions_(e,t,n){var_=r["dynCall_"+e];returnn&&n.length?_.apply(null,[t].concat(n)):_.call(null,t)}functioni_(e,t,n){returne.indexOf("j")!=-1?s_(e,t,n):Ve.get(t).apply(null,n)}functionR_(e,t){varn=[];returnfunction(){n.length=arguments.length;for(var_=0;_<arguments.length;_++)n[_]=arguments[_];returni_(e,t,n)}}functionY(e,t){e=h(e);functionn(){returne.indexOf("j")!=-1?R_(e,t):Ve.get(t)}var_=n();returntypeof_!="function"&&S("unknown function pointer with signature "+e+": "+t),_}varzt=void0;functionqt(e){vart=tn(e),n=h(t);returnne(t),n}functiontt(e,t){varn=[],_={};functions(a){if(!_[a]&&!Te[a]){if(ze[a]){ze[a].forEach(s);return}n.push(a),_[a]=!0}}throwt.forEach(s),newzt(e+": "+n.map(qt).join([", "]))}functiona_(e,t,n,_,s,a,c,i,R,T,O,K,G){O=h(O),a=Y(s,a),i&&(i=Y(c,i)),T&&(T=Y(R,T)),G=Y(K,G);varV=qe(O);Bt(V,function(){tt("Cannot construct "+O+" due to unbound types",[_])}),ie([e,t,n],_?[_]:[],function(y){y=y[0];varb,$;_?(b=y.registeredClass,$=b.instancePrototype):$=Re.prototype;varZ=Ze(V,function(){if(Object.getPrototypeOf(this)!==ge)thrownewMe("Use 'new' to construct "+O);if(_e.constructor_body===void0)thrownewMe(O+" has no accessible constructor");varrn=_e.constructor_body[arguments.length];if(rn===void0)thrownewMe("Tried to invoke ctor of "+O+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(_e.constructor_body).toString()+") parameters instead!");returnrn.apply(this,arguments)}),ge=Object.create($,{constructor:{value:Z}});Z.prototype=ge;var_e=new$n(O,Z,ge,G,b,a,i,T),rr=newee(O,_e,!0,!1,!1),nn=newee(O+"*",_e,!1,!1,!1),_n=newee(O+" const*",_e,!1,!0,!1);return$t[e]={pointerType:nn,constPointerType:_n},Yt(V,Z),[rr,nn,_n]})}functionFt(e,t){for(varn=[],_=0;_<e;_++)n.push(L[(t>>2)+_]);returnn}functionc_(e,t,n,_,s,a){D(t>0);varc=Ft(t,n);s=Y(_,s);vari=[a],R=[];ie([],[e],function(T){T=T[0];varO="constructor "+T.name;if(T.registeredClass.constructor_body===void0&&(T.registeredClass.constructor_body=[]),T.registeredClass.constructor_body[t-1]!==void0)thrownewMe("Cannot register multiple constructors with identical number of parameters ("+(t-1)+") for class '"+T.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");returnT.registeredClass.constructor_body[t-1]=function(){tt("Cannot construct "+T.name+" due to unbound types",c)},ie([],c,function(K){returnT.registeredClass.constructor_body[t-1]=function(){arguments.length!==t-1&&S(O+" called with "+arguments.length+" arguments, expected "+(t-1)),R.length=0,i.length=t;for(varV=1;V<t;++V)i[V]=K[V].toWireType(R,arguments[V-1]);vary=s.apply(null,i);returnYe(R),K[0].fromWireType(y)},[]}),[]})}functionZt(e,t){if(!(einstanceofFunction))thrownewTypeError("new_ called with constructor type "+typeofe+" which is not a function");varn=Ze(e.name||"unknownFunctionName",function(){});n.prototype=e.prototype;var_=newn,s=e.apply(_,t);returnsinstanceofObject?s:_}functionQt(e,t,n,_,s){vara=t.length;a<2&&S("argTypes array size mismatch! Must at least get return value and 'this' types!");for(varc=t[1]!==null&&n!==null,i=!1,R=1;R<t.length;++R)if(t[R]!==null&&t[R].destructorFunction===void0){i=!0;break}for(varT=t[0].name!=="void",O="",K="",R=0;R<a-2;++R)O+=(R!==0?", ":"")+"arg"+R,K+=(R!==0?", ":"")+"arg"+R+"Wired";varG="return function "+qe(e)+"("+O+`) {
if (arguments.length !== `+(a-2)+`) {
throwBindingError('function `+e+" called with ' + arguments.length + ' arguments, expected "+(a-2)+` args!');
`,y.push($+"_dtor"),b.push(t[R].destructorFunction))}T&&(G+=`var ret = retType.fromWireType(rv);
return ret;
`),G+=`}
`,y.push(G);varZ=Zt(Function,y).apply(null,b);returnZ}functionA_(e,t,n,_,s,a,c,i){varR=Ft(n,_);t=h(t),a=Y(s,a),ie([],[e],function(T){T=T[0];varO=T.name+"."+t;i&&T.registeredClass.pureVirtualFunctions.push(t);functionK(){tt("Cannot call "+O+" due to unbound types",R)}varG=T.registeredClass.instancePrototype,V=G[t];returnV===void0||V.overloadTable===void0&&V.className!==T.name&&V.argCount===n-2?(K.argCount=n-2,K.className=T.name,G[t]=K):(Wt(G,t,O),G[t].overloadTable[n-2]=K),ie([],R,function(y){varb=Qt(O,y,T,a,c);returnG[t].overloadTable===void0?(b.argCount=n-2,G[t]=b):G[t].overloadTable[n-2]=b,[]}),[]})}functionf_(e,t,n){e=h(e),ie([],[t],function(_){return_=_[0],r[e]=_.fromWireType(n),[]})}vardt=[],x=[{},{value:void0},{value:null},{value:!0},{value:!1}];functionSt(e){e>4&&--x[e].refcount===0&&(x[e]=void0,dt.push(e))}functionT_(){for(vare=0,t=5;t<x.length;++t)x[t]!==void0&&++e;returne}functionu_(){for(vare=5;e<x.length;++e)if(x[e]!==void0)returnx[e];returnnull}functionO_(){r.count_emval_handles=T_,r.get_first_emval=u_}functionte(e){switch(e){casevoid0:return1;casenull:return2;case!0:return3;case!1:return4;default:{vart=dt.length?dt.pop():x.length;returnx[t]={refcount:1,value:e},t}}}functionl_(e,t){t=h(t),q(e,{name:t,fromWireType:function(n){var_=x[n].value;returnSt(n),_},toWireType:function(n,_){returnte(_)},argPackAdvance:8,readValueFromPointer:pe,destructorFunction:null})}functionM_(e,t,n){switch(t){case0:returnfunction(_){vars=n?U:p;returnthis.fromWireType(s[_])};case1:returnfunction(_){vars=n?k:Ae;returnthis.fromWireType(s[_>>1])};case2:returnfunction(_){vars=n?L:z;returnthis.fromWireType(s[_>>2])};default:thrownewTypeError("Unknown integer type: "+e)}}functionK_(e,t,n,_){vars=Je(n);t=h(t);functiona(){}a.values={},q(e,{name:t,constructor:a,fromWireType:function(c){returnthis.constructor.values[c]},toWireType:function(c,i){returni.value},argPackAdvance:8,readValueFromPointer:M_(t,s,_),destructorFunction:null}),Bt(t,a)}functionnt(e,t){varn=Te[e];returnn===void0&&S(t+" has unknown type "+qt(e)),n}functionB_(e,t,n){var_=nt(e,"enum");t=h(t);vars=_.constructor,a=Object.create(_.constructor.prototype,{value:{value:n},constructor:{value:Ze(_.name+"_"+t,function(){})}});s.values[n]=a,s[t]=a}functionKe(e){if(e===null)return"null";vart=typeofe;returnt==="object"||t==="array"||t==="function"?e.toString():""+e}functionC_(e,t){switch(t){case2:returnfunction(n){returnthis.fromWireType(Ut[n>>2])};case3:returnfunction(n){returnthis.fromWireType(ht[n>>3])};default:thrownewTypeError("Unknown float type: "+e)}}functionF_(e,t,n){var_=Je(n);t=h(t),q(e,{name:t,fromWireType:function(s){returns},toWireType:function(s,a){if(typeofa!="number"&&typeofa!="boolean")thrownewTypeError('Cannot convert "'+Ke(a)+'" to '+this.name);returna},argPackAdvance:8,readValueFromPointer:C_(t,_),destructorFunction:null})}functiond_(e,t,n,_,s,a){varc=Ft(t,n);e=h(e),s=Y(_,s),Bt(e,function(){tt("Cannot call "+e+" due to unbound types",c)},t-1),ie([],c,function(i){varR=[i[0],null].concat(i.slice(1));returnYt(e,Qt(e,R,null,s,a),t-1),[]})}functionS_(e,t,n){switch(t){case0:returnn?function(s){returnU[s]}:function(s){returnp[s]};case1:returnn?function(s){returnk[s>>1]}:function(s){returnAe[s>>1]};case2:returnn?function(s){returnL[s>>2]}:function(s){returnz[s>>2]};default:thrownewTypeError("Unknown integer type: "+e)}}functionG_(e,t,n,_,s){t=h(t),s===-1&&(s=4294967295);vara=Je(n),c=function(T){returnT};if(_===0){vari=32-8*n;c=function(T){returnT<<i>>>i}}varR=t.indexOf("unsigned")!=-1;q(e,{name:t,fromWireType:c,toWireType:function(T,O){if(typeofO!="number"&&typeofO!="boolean")thrownewTypeError('Cannot convert "'+Ke(O)+'" to '+this.name);if(O<_||O>s)thrownewTypeError('Passing a number "'+Ke(O)+'" from JS side to C/C++ side to an argument of type "'+t+'", which is outside the valid range ['+_+", "+s+"]!");returnR?O>>>0:O|0},argPackAdvance:8,readValueFromPointer:S_(t,a,_!==0),destructorFunction:null})}functionN_(e,t,n){var_=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],s=_[t];functiona(c){c=c>>2;vari=z,R=i[c],T=i[c+1];returnnews(Ne,T,R)}n=h(n),q(e,{name:n,fromWireType:a,argPackAdvance:8,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})}functionV_(e,t){t=h(t);varn=t==="std::string";q(e,{name:t,fromWireType:function(_){vars=z[_>>2],a;if(n)for(varc=_+4,i=0;i<=s;++i){varR=_+4+i;if(i==s||p[R]==0){varT=R-c,O=Se(c,T);a===void0?a=O:(a+="\0",a+=O),c=R+1}}else{for(varK=newArray(s),i=0;i<s;++i)K[i]=String.fromCharCode(p[_+4+i]);a=K.join("")}returnne(_),a},toWireType:function(_,s){sinstanceofArrayBuffer&&(s=newUint8Array(s));vara,c=typeofs=="string";c||sinstanceofUint8Array||sinstanceofUint8ClampedArray||sinstanceofInt8Array||S("Cannot pass non-string to std::string"),n&&c?a=function(){returnat(s)}:a=function(){returns.length};vari=a(),R=Nt(4+i+1);if(z[R>>2]=i,n&&c)Xe(s,R+4,i+1);elseif(c)for(varT=0;T<i;++T){varO=s.charCodeAt(T);O>255&&(ne(R),S("String has UTF-16 code units that do not fit in 8 bits")),p[R+4+T]=O}elsefor(varT=0;T<i;++T)p[R+4+T]=s[T];return_!==null&&_.push(ne,R),R},argPackAdvance:8,readValueFromPointer:pe,destructorFunction:function(_){ne(_)}})}functionP_(e,t,n){n=h(n);var_,s,a,c,i;t===2?(_=xe,s=ke,c=$e,a=function(){returnAe},i=1):t===4&&(_=ct,s=At,c=ft,a=function(){returnz},i=2),q(e,{name:n,fromWireType:function(R){for(varT=z[R>>2],O=a(),K,G=R+4,V=0;V<=T;++V){vary=R+4+V*t;if(V==T||O[y>>i]==0){varb=y-G,$=_(G,b);K===void0?K=$:(K+="\0",K+=$),G=y+t}}returnne(R),K},toWireType:function(R,T){typeofT!="string"&&S("Cannot pass non-string to C++ string type "+n);varO=c(T),K=Nt(4+O+t);returnz[K>>2]=O>>i,s(T,K+4,O+t),R!==null&&R.push(ne,K),K},argPackAdvance:8,readValueFromPointer:pe,destructorFunction:function(R){ne(R)}})}functionp_(e,t,n,_,s,a){je[e]={name:h(t),rawConstructor:Y(n,_),rawDestructor:Y(s,a),fields:[]}}functionE_(e,t,n,_,s,a,c,i,R,T){je[e].fields.push({fieldName:h(t),getterReturnType:n,getter:Y(_,s),getterContext:a,setterArgumentType:c,setter:Y(i,R),setterContext:T})}functionv_(e,t){t=h(t),q(e,{isVoid:!0,name:t,argPackAdvance:0,fromWireType:function(){},toWireType:function(n,_){}})}functionye(e){returne||S("Cannot use deleted val. handle = "+e),x[e].value}functionU_(e,t,n){e=ye(e),t=nt(t,"emval::as");var_=[],s=te(_);returnL[n>>2]=s,t.toWireType(_,e)}varh_={};function_t(e){vart=h_[e];returnt===void0?h(e):t}varGt=[];functiony_(e,t,n,_){e=Gt[e],t=ye(t),n=_t(n),e(t,n,null,_)}functionJt(){returntypeofglobalThis=="object"?globalThis:function(){returnFunction}()("return this")()}functiong_(e){returne===0?te(Jt()):(e=_t(e),te(Jt()[e]))}functionL_(e){vart=Gt.length;returnGt.push(e),t}functionm_(e,t){for(varn=newArray(e),_=0;_<e;++_)n[_]=nt(L[(t>>2)+_],"parameter "+_);returnn}functionD_(e,t){for(varn=m_(e,t),_=n[0],s=_.name+"_$"+n.slice(1).map(function(V){returnV.name}).join("_")+"$",a=["retType"],c=[_],i="",R=0;R<e-1;++R)i+=(R!==0?", ":"")+"arg"+R,a.push("argType"+R),c.push(n[1+R]);for(varT=qe("methodCaller_"+s),O="return function "+T+`(handle, name, destructors, args) {
`,K=0,R=0;R<e-1;++R)O+=" var arg"+R+" = argType"+R+".readValueFromPointer(args"+(K?"+"+K:"")+`);
`,K+=n[R+1].argPackAdvance;O+=" var rv = handle[name]("+i+`);
var arg`+n+" = argType"+n+`.readValueFromPointer(args);
args += argType`+n+`['argPackAdvance'];
`;return_+="var obj = new constructor("+t+`);
return __emval_register(obj);
}
`,newFunction("requireRegisteredType","Module","__emval_register",_)(nt,r,te)}varen={};functionX_(e,t,n,_){e=ye(e);vars=en[t];returns||(s=H_(t),en[t]=s),s(e,n,_)}functionx_(e){returnte(_t(e))}functionk_(e){vart=x[e].value;Ye(t),St(e)}function$_(){Oe()}functionW_(e,t,n){p.copyWithin(e,t,t+n)}functionj_(e){try{returnde.grow(e-Ne.byteLength+65535>>>16),yt(de.buffer),1}catch{}}functionY_(e){vart=p.length;e=e>>>0;varn=2147483648;if(e>n)return!1;for(var_=1;_<=4;_*=2){vars=t*(1+.2/_);s=Math.min(s,e+100663296);vara=Math.min(n,Tt(Math.max(e,s),65536)),c=j_(a);if(c)return!0}return!1}varrt={mappings:{},buffers:[null,[],[]],printChar:function(e,t){varn=rt.buffers[e];t===0||t===10?((e===1?it:oe)(we(n,0)),n.length=0):n.push(t)},varargs:void0,get:function(){rt.varargs+=4;vare=L[rt.varargs-4>>2];returne},getStr:function(e){vart=Se(e);returnt},get64:function(e,t){returne}};functionz_(e){return0}functionq_(e,t,n,_,s){}functionZ_(e,t,n,_){for(vars=0,a=0;a<n;a++){for(varc=L[t+a*8>>2],i=L[t+(a*8+4)>>2],R=0;R<i;R++)rt.printChar(e,p[c+R]);s+=i}returnL[_>>2]=s,0}functionQ_(e){vt(e|0)}Ht=r.InternalError=Ot(Error,"InternalError"),Ln(),Me=r.BindingError=Ot(Error,"BindingError"),kn(),o_(),t_(),zt=r.UnboundTypeError=Ot(Error,"UnboundTypeError"),O_();varJ_={t:gn,I:mn,x:a_,w:c_,d:A_,k:f_,H:l_,n:K_,a:B_,A:F_,i:d_,j:G_,h:N_,B:V_,v:P_,u:p_,c:E_,J:v_,m:U_,s:y_,b:St,y:g_,p:D_,r:I_,e:b_,g:w_,q:X_,f:x_,l:k_,o:$_,E:W_,F:Y_,G:z_,C:q_,z:Z_,D:Q_},Or=Un(),er=r.___wasm_call_ctors=function(){return(er=r.___wasm_call_ctors=r.asm.L).apply(null,arguments)},Nt=r._malloc=function(){return(Nt=r._malloc=r.asm.M).apply(null,arguments)},ne=r._free=function(){return(ne=r._free=r.asm.N).apply(null,arguments)},tn=r.___getTypeName=function(){return(tn=r.___getTypeName=r.asm.P).apply(null,arguments)},tr=r.___embind_register_native_and_builtin_types=function(){return(tr=r.___embind_register_native_and_builtin_types=r.asm.Q).apply(null,arguments)},nr=r.dynCall_jiji=function(){return(nr=r.dynCall_jiji=r.asm.R).apply(null,arguments)},ot;function_r(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}Pe=functione(){ot||Vt(),ot||(Pe=e)};functionVt(e){if(e=e||g,fe>0||(Bn(),fe>0))return;functiont(){ot||(ot=!0,r.calledRun=!0,!Ie&&(Cn(),Fn(),C(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),dn()))}r.setStatus?(r.setStatus("Running..."),setTimeout(function(){setTimeout(function(){r.setStatus("")},1),t()},1)):t()}if(r.run=Vt,r.preInit)for(typeofr.preInit=="function"&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();returnVt(),f.ready}}();typeofst=="object"&&typeofEt=="object"?Et.exports=pt:typeofdefine=="function"&&define.amd?define([],function(){returnpt}):typeofst=="object"&&(st.BASIS=pt)});varB={UNSIGNED_BYTE:M.UNSIGNED_BYTE,UNSIGNED_SHORT:M.UNSIGNED_SHORT,UNSIGNED_INT:M.UNSIGNED_INT,FLOAT:M.FLOAT,HALF_FLOAT:M.HALF_FLOAT_OES,UNSIGNED_INT_24_8:M.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:M.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:M.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:M.UNSIGNED_SHORT_5_6_5};B.toWebGLConstant=function(o,f){switch(o){caseB.UNSIGNED_BYTE:returnM.UNSIGNED_BYTE;caseB.UNSIGNED_SHORT:returnM.UNSIGNED_SHORT;caseB.UNSIGNED_INT:returnM.UNSIGNED_INT;caseB.FLOAT:returnM.FLOAT;caseB.HALF_FLOAT:returnf.webgl2?M.HALF_FLOAT:M.HALF_FLOAT_OES;caseB.UNSIGNED_INT_24_8:returnM.UNSIGNED_INT_24_8;caseB.UNSIGNED_SHORT_4_4_4_4:returnM.UNSIGNED_SHORT_4_4_4_4;caseB.UNSIGNED_SHORT_5_5_5_1:returnM.UNSIGNED_SHORT_5_5_5_1;caseB.UNSIGNED_SHORT_5_6_5:returnB.UNSIGNED_SHORT_5_6_5}};B.isPacked=function(o){returno===B.UNSIGNED_INT_24_8||o===B.UNSIGNED_SHORT_4_4_4_4||o===B.UNSIGNED_SHORT_5_5_5_1||o===B.UNSIGNED_SHORT_5_6_5};B.sizeInBytes=function(o){switch(o){caseB.UNSIGNED_BYTE:return1;caseB.UNSIGNED_SHORT:caseB.UNSIGNED_SHORT_4_4_4_4:caseB.UNSIGNED_SHORT_5_5_5_1:caseB.UNSIGNED_SHORT_5_6_5:caseB.HALF_FLOAT:return2;caseB.UNSIGNED_INT:caseB.FLOAT:caseB.UNSIGNED_INT_24_8:return4}};B.validate=function(o){returno===B.UNSIGNED_BYTE||o===B.UNSIGNED_SHORT||o===B.UNSIGNED_INT||o===B.FLOAT||o===B.HALF_FLOAT||o===B.UNSIGNED_INT_24_8||o===B.UNSIGNED_SHORT_4_4_4_4||o===B.UNSIGNED_SHORT_5_5_5_1||o===B.UNSIGNED_SHORT_5_6_5};B.getTypedArrayConstructor=function(o){letf=B.sizeInBytes(o);returnf===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:f===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:f===Float32Array.BYTES_PER_ELEMENT&&o===B.FLOAT?Float32Array:Uint32Array};varH=Object.freeze(B);varA={DEPTH_COMPONENT:M.DEPTH_COMPONENT,DEPTH_STENCIL:M.DEPTH_STENCIL,ALPHA:M.ALPHA,RED:M.RED,RG:M.RG,RGB:M.RGB,RGBA:M.RGBA,LUMINANCE:M.LUMINANCE,LUMINANCE_ALPHA:M.LUMINANCE_ALPHA,RGB_DXT1:M.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:M.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:M.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:M.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:M.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:M.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:M.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:M.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:M.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:M.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:M.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:M.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:M.COMPRESSED_RGBA_BPTC_UNORM};A.componentsLength=function(o){switch(o){caseA.RGB:return3;caseA.RGBA:return4;caseA.LUMINANCE_ALPHA:caseA.RG:return2;caseA.ALPHA:caseA.RED:caseA.LUMINANCE:return1;default:return1}};A.validate=function(o){returno===A.DEPTH_COMPONENT||o===A.DEPTH_STENCIL||o===A.ALPHA||o===A.RED||o===A.RG||o===A.RGB||o===A.RGBA||o===A.LUMINANCE||o===A.LUMINANCE_ALPHA||o===A.RGB_DXT1||o===A.RGBA_DXT1||o===A.RGBA_DXT3||o===A.RGBA_DXT5||o===A.RGB_PVRTC_4BPPV1||o===A.RGB_PVRTC_2BPPV1||o===A.RGBA_PVRTC_4BPPV1||o===A.RGBA_PVRTC_2BPPV1||o===A.RGBA_ASTC||o===A.RGB_ETC1||o===A.RGB8_ETC2||o===A.RGBA8_ETC2_EAC||o===A.RGBA_BC7};A.isColorFormat=function(o){returno===A.RED||o===A.ALPHA||o===A.RGB||o===A.RGBA||o===A.LUMINANCE||o===A.LUMINANCE_ALPHA};A.isDepthFormat=function(o){returno===A.DEPTH_COMPONENT||o===A.DEPTH_STENCIL};A.isCompressedFormat=function(o){returno===A.RGB_DXT1||o===A.RGBA_DXT1||o===A.RGBA_DXT3||o===A.RGBA_DXT5||o===A.RGB_PVRTC_4BPPV1||o===A.RGB_PVRTC_2BPPV1||o===A.RGBA_PVRTC_4BPPV1||o===A.RGBA_PVRTC_2BPPV1||o===A.RGBA_ASTC||o===A.RGB_ETC1||o===A.RGB8_ETC2||o===A.RGBA8_ETC2_EAC||o===A.RGBA_BC7};A.isDXTFormat=function(o){returno===A.RGB_DXT1||o===A.RGBA_DXT1||o===A.RGBA_DXT3||o===A.RGBA_DXT5};A.isPVRTCFormat=function(o){returno===A.RGB_PVRTC_4BPPV1||o===A.RGB_PVRTC_2BPPV1||o===A.RGBA_PVRTC_4BPPV1||o===A.RGBA_PVRTC_2BPPV1};A.isASTCFormat=function(o){returno===A.RGBA_ASTC};A.isETC1Format=function(o){returno===A.RGB_ETC1};A.isETC2Format=function(o){returno===A.RGB8_ETC2||o===A.RGBA8_ETC2_EAC};A.isBC7Format=function(o){returno===A.RGBA_BC7};A.compressedTextureSizeInBytes=function(o,f,r){switch(o){caseA.RGB_DXT1:caseA.RGBA_DXT1:caseA.RGB_ETC1:caseA.RGB8_ETC2:returnMath.floor((f+3)/4)*Math.floor((r+3)/4)*8;caseA.RGBA_DXT3:caseA.RGBA_DXT5:caseA.RGBA_ASTC:caseA.RGBA8_ETC2_EAC:returnMath.floor((f+3)/4)*Math.floor((r+3)/4)*16;caseA.RGB_PVRTC_4BPPV1:caseA.RGBA_PVRTC_4BPPV1:returnMath.floor((Math.max(f,8)*Math.max(r,8)*4+7)/8);caseA.RGB_PVRTC_2BPPV1:caseA.RGBA_PVRTC_2BPPV1:returnMath.floor((Math.max(f,16)*Math.max(r,8)*2+7)/8);caseA.RGBA_BC7:returnMath.ceil(f/4)*Math.ceil(r/4)*16;default:return0}};A.textureSizeInBytes=function(o,f,r,C){letl=A.componentsLength(o);returnH.isPacked(f)&&(l=1),l*H.sizeInBytes(f)*r*C};A.alignmentInBytes=function(o,f,r){letC=A.textureSizeInBytes(o,f,r,1)%4;returnC===0?4:C===2?2:1};A.createTypedArray=function(o,f,r,C){letl=H.getTypedArrayConstructor(f),E=A.componentsLength(o)*r*C;returnnewl(E)};A.flipY=function(o,f,r,C,l){if(l===1)returno;letE=A.createTypedArray(f,r,C,l),F=A.componentsLength(f),g=C*F;for(letm=0;m<l;++m){letI=m*C*F,N=(l-m-1)*C*F;for(letd=0;d<g;++d)E[N+d]=o[I+d]}returnE};A.toInternalFormat=function(o,f,r){if(!r.webgl2)returno;if(o===A.DEPTH_STENCIL)returnM.DEPTH24_STENCIL8;if(o===A.DEPTH_COMPONENT){if(f===H.UNSIGNED_SHORT)returnM.DEPTH_COMPONENT16;if(f===H.UNSIGNED_INT)returnM.DEPTH_COMPONENT24}if(f===H.FLOAT)switch(o){caseA.RGBA:returnM.RGBA32F;caseA.RGB:returnM.RGB32F;caseA.RG:returnM.RG32F;caseA.RED:returnM.R32F}if(f===H.HALF_FLOAT)switch(o){caseA.RGBA:returnM.RGBA16F;caseA.RGB:returnM.RGB16F;caseA.RG:returnM.RG16F;caseA.RED:returnM.R16F}returno};varv=Object.freeze(A);varir={VK_FORMAT_UNDEFINED:0,VK_FORMAT_R4G4_UNORM_PACK8:1,VK_FORMAT_R4G4B4A4_UNORM_PACK16:2,VK_FORMAT_B4G4R4A4_UNORM_PACK16:3,VK_FORMAT_R5G6B5_UNORM_PACK16:4,VK_FORMAT_B5G6R5_UNORM_PACK16:5,VK_FORMAT_R5G5B5A1_UNORM_PACK16:6,VK_FORMAT_B5G5R5A1_UNORM_PACK16:7,VK_FORMAT_A1R5G5B5_UNORM_PACK16:8,VK_FORMAT_R8_UNORM:9,VK_FORMAT_R8_SNORM:10,VK_FORMAT_R8_USCALED:11,VK_FORMAT_R8_SSCALED:12,VK_FORMAT_R8_UINT:13,VK_FORMAT_R8_SINT:14,VK_FORMAT_R8_SRGB:15,VK_FORMAT_R8G8_UNORM:16,VK_FORMAT_R8G8_SNORM:17,VK_FORMAT_R8G8_USCALED:18,VK_FORMAT_R8G8_SSCALED:19,VK_FORMAT_R8G8_UINT:20,VK_FORMAT_R8G8_SINT:21,VK_FORMAT_R8G8_SRGB:22,VK_FORMAT_R8G8B8_UNORM:23,VK_FORMAT_R8G8B8_SNORM:24,VK_FORMAT_R8G8B8_USCALED:25,VK_FORMAT_R8G8B8_SSCALED:26,VK_FORMAT_R8G8B8_UINT:27,VK_FORMAT_R8G8B8_SINT:28,VK_FORMAT_R8G8B8_SRGB:29,VK_FORMAT_B8G8R8_UNORM:30,VK_FORMAT_B8G8R8_SNORM:31,VK_FORMAT_B8G8R8_USCALED:32,VK_FORMAT_B8G8R8_SSCALED:33,VK_FORMAT_B8G8R8_UINT:34,VK_FORMAT_B8G8R8_SINT:35,VK_FORMAT_B8G8R8_SRGB:36,VK_FORMAT_R8G8B8A8_UNORM:37,VK_FORMAT_R8G8B8A8_SNORM:38,VK_FORMAT_R8G8B8A8_USCALED:39,VK_FORMAT_R8G8B8A8_SSCALED:40,VK_FORMAT_R8G8B8A8_UINT:41,VK_FORMAT_R8G8B8A8_SINT:42,VK_FORMAT_R8G8B8A8_SRGB:43,VK_FORMAT_B8G8R8A8_UNORM:44,VK_FORMAT_B8G8R8A8_SNORM:45,VK_FORMAT_B8G8R8A8_USCALED:46,VK_FORMAT_B8G8R8A8_SSCALED:47,VK_FORMAT_B8G8R8A8_UINT:48,VK_FORMAT_B8G8R8A8_SINT:49,VK_FORMAT_B8G8R8A8_SRGB:50,VK_FORMAT_A8B8G8R8_UNORM_PACK32:51,VK_FORMAT_A8B8G8R8_SNORM_PACK32:52,VK_FORMAT_A8B8G8R8_USCALED_PACK32:53,VK_FORMAT_A8B8G8R8_SSCALED_PACK32:54,VK_FORMAT_A8B8G8R8_UINT_PACK32:55,VK_FORMAT_A8B8G8R8_SINT_PACK32:56,VK_FORMAT_A8B8G8R8_SRGB_PACK32:57,VK_FORMAT_A2R10G10B10_UNORM_PACK32:58,VK_FORMAT_A2R10G10B10_SNORM_PACK32:59,VK_FORMAT_A2R10G10B10_USCALED_PACK32:60,VK_FORMAT_A2R10G10B10_SSCALED_PACK32:61,VK_FORMAT_A2R10G10B10_UINT_PACK32:62,VK_FORMAT_A2R10G10B10_SINT_PACK32:63,VK_FORMAT_A2B10G10R10_UNORM_PACK32:64,VK_FORMAT_A2B10G10R10_SNORM_PACK32:65,VK_FORMAT_A2B10G10R10_USCALED_PACK32:66,VK_FORMAT_A2B10G10R10_SSCALED_PACK32:67,VK_FORMAT_A2B10G10R10_UINT_PACK32:68,VK_FORMAT_A2B10G10R10_SINT_PACK32:69,VK_FORMAT_R16_UNORM:70,VK_FORMAT_R16_SNORM:71,VK_FORMAT_R16_USCALED:72,VK_FORMAT_R16_SSCALED:73,VK_FORMAT_R16_UINT:74,VK_FORMAT_R16_SINT:75,VK_FORMAT_R16_SFLOAT:76,VK_FORMAT_R16G16_UNORM:77,VK_FORMAT_R16G16_SNORM:78,VK_FORMAT_R16G16_USCALED:79,VK_FORMAT_R16G16_SSCALED:80,VK_FORMAT_R16G16_UINT:81,VK_FORMAT_R16G16_SINT:82,VK_FORMAT_R16G16_SFLOAT:83,VK_FORMAT_R16G16B16_UNORM:84,VK_FORMAT_R16G16B16_SNORM:85,VK_FORMAT_R16G16B16_USCALED:86,VK_FORMAT_R16G16B16_SSCALED:87,VK_FORMAT_R16G16B16_UINT:88,VK_FORMAT_R16G16B16_SINT:89,VK_FORMAT_R16G16B16_SFLOAT:90,VK_FORMAT_R16G16B16A16_UNORM:91,VK_FORMAT_R16G16B16A16_SNORM:92,VK_FORMAT_R16G16B16A16_USCALED:93,VK_FORMAT_R16G16B16A16_SSCALED:94,VK_FORMAT_R16G16B16A16_UINT:95,VK_FORMAT_R16G16B16A16_SINT:96,VK_FORMAT_R16G16B16A16_SFLOAT:97,VK_FORMAT_R32_UINT:98,VK_FORMAT_R32_SINT:99,VK_FORMAT_R32_SFLOAT:100,VK_FORMAT_R32G32_UINT:101,VK_FORMAT_R32G32_SINT:102,VK_FORMAT_R32G32_SFLOAT:103,VK_FORMAT_R32G32B32_UINT:104,VK_FORMAT_R32G32B32_SINT:105,VK_FORMAT_R32G32B32_SFLOAT:106,VK_FORMAT_R32G32B32A32_UINT:107,VK_FORMAT_R32G32B32A32_SINT:108,VK_FORMAT_R32G32B32A32_SFLOAT:109,VK_FORMAT_R64_UINT:110,VK_FORMAT_R64_SINT:111,VK_FORMAT_R64_SFLOAT:112,VK_FORMAT_R64G64_UINT:113,VK_FORMAT_R64G64_SINT:114,VK_FORMAT_R64G64_SFLOAT:115,VK_FORMAT_R64G64B64_UINT:116,VK_FORMAT_R64G64B64_SINT:117,VK_FORMAT_R64G64B64_SFLOAT:118,VK_FORMAT_R64G64B64A64_UINT:119,VK_FORMAT_R64G64B64A64_SINT:120,VK_FORMAT_R64G64B64A64_SFLOAT:121,VK_FORMAT_B10G11R11_UFLOAT_PACK32:122,VK_FORMAT_E5B9G9R9_UFLOAT_PACK32:123,VK_FORMAT_D16_UNORM:124,VK_FORMAT_X8_D24_UNORM_PACK32:125,VK_FORMAT_D32_SFLOAT:126,VK_FORMAT_S8_UINT:127,VK_FORMAT_D16_UNORM_S8_UINT:128,VK_FORMAT_D24_UNORM_S8_UINT:129,VK_FORMAT_D32_SFLOAT_S8_UINT:130,VK_FORMAT_BC1_RGB_UNORM_BLOCK:131,VK_FORMAT_BC1_RGB_SRGB_BLOCK:132,VK_FORMAT_BC1_RGBA_UNORM_BLOCK:133,VK_FORMAT_BC1_RGBA_SRGB_BLOCK:134,VK_FORMAT_BC2_UNORM_BLOCK:135,VK_FORMAT_BC2_SRGB_BLOCK:136,VK_FORMAT_BC3_UNORM_BLOCK:137,VK_FORMAT_BC3_SRGB_BLOCK:138,VK_FORMAT_BC4_UNORM_BLOCK:139,VK_FORMAT_BC4_SNORM_BLOCK:140,VK_FORMAT_BC5_UNORM_BLOCK:141,VK_FORMAT_BC5_SNORM_BLOCK:142,VK_FORMAT_BC6H_UFLOAT_BLOCK:143,VK_FORMAT_BC6H_SFLOAT_BLOCK:144,VK_FORMAT_BC7_UNORM_BLOCK:145,VK_FORMAT_BC7_SRGB_BLOCK:146,VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:147,VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:148,VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:149,VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:150,VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:151,VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:152,VK_FORMAT_EAC_R11_UNORM_BLOCK:153,VK_FORMAT_EAC_R11_SNORM_BLOCK:154,VK_FORMAT_EAC_R11G11_UNORM_BLOCK:155,VK_FORMAT_EAC_R11G11_SNORM_BLOCK:156,VK_FORMAT_ASTC_4x4_UNORM_BLOCK:157,VK_FORMAT_ASTC_4x4_SRGB_BLOCK:158,VK_FORMAT_ASTC_5x4_UNORM_BLOCK:159,VK_FORMAT_ASTC_5x4_SRGB_BLOCK:160,VK_FORMAT_ASTC_5x5_UNORM_BLOCK:161,VK_FORMAT_ASTC_5x5_SRGB_BLOCK:162,VK_FORMAT_ASTC_6x5_UNORM_BLOCK:163,VK_FORMAT_ASTC_6x5_SRGB_BLOCK:164,VK_FORMAT_ASTC_6x6_UNORM_BLOCK:165,VK_FORMAT_ASTC_6x6_SRGB_BLOCK:166,VK_FORMAT_ASTC_8x5_UNORM_BLOCK:167,VK_FORMAT_ASTC_8x5_SRGB_BLOCK:168,VK_FORMAT_ASTC_8x6_UNORM_BLOCK:169,VK_FORMAT_ASTC_8x6_SRGB_BLOCK:170,VK_FORMAT_ASTC_8x8_UNORM_BLOCK:171,VK_FORMAT_ASTC_8x8_SRGB_BLOCK:172,VK_FORMAT_ASTC_10x5_UNORM_BLOCK:173,VK_FORMAT_ASTC_10x5_SRGB_BLOCK:174,VK_FORMAT_ASTC_10x6_UNORM_BLOCK:175,VK_FORMAT_ASTC_10x6_SRGB_BLOCK:176,VK_FORMAT_ASTC_10x8_UNORM_BLOCK:177,VK_FORMAT_ASTC_10x8_SRGB_BLOCK:178,VK_FORMAT_ASTC_10x10_UNORM_BLOCK:179,VK_FORMAT_ASTC_10x10_SRGB_BLOCK:180,VK_FORMAT_ASTC_12x10_UNORM_BLOCK:181,VK_FORMAT_ASTC_12x10_SRGB_BLOCK:182,VK_FORMAT_ASTC_12x12_UNORM_BLOCK:183,VK_FORMAT_ASTC_12x12_SRGB_BLOCK:184,VK_FORMAT_G8B8G8R8_422_UNORM:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM:1000156006,VK_FORMAT_R10X6_UNORM_PACK16:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16:1000156016,VK_FORMAT_R12X4_UNORM_PACK16:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM:1000156033,VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG:1000054e3,VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG:1000054001,VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG:1000054002,VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG:1000054003,VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG:1000054004,VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG:1000054005,VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG:1000054006,VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG:1000054007,VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT:1000066e3,VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT:1000066001,VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT:1000066002,VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT:1000066003,VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT:1000066004,VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT:1000066005,VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT:1000066006,VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT:1000066007,VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT:1000066008,VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT:1000066009,VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT:1000066010,VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT:1000066011,VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT:1000066012,VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT:1000066013,VK_FORMAT_G8B8G8R8_422_UNORM_KHR:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM_KHR:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR:1000156006,VK_FORMAT_R10X6_UNORM_PACK16_KHR:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR:1000156016,VK_FORMAT_R12X4_UNORM_PACK16_KHR:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM_KHR:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM_KHR:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR:1000156033},me=Object.freeze(ir);functionRr(){return{vkFormat:0,typeSize:1,pixelWidth:0,pixelHeight:0,pixelDepth:0,layerCount:0,faceCount:1,supercompressionScheme:0,levels:[],dataFormatDescriptor:[{vendorId:0,descriptorType:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],keyValue:{},globalData:null}}varue=class{constructor(f,r,C,l){this._dataView=void0,this._littleEndian=void0,this._offset=void0,this._dataView=newDataView(f.buffer,f.byteOffset+r,C),this._littleEndian=l,this._offset=0}_nextUint8(){letf=this._dataView.getUint8(this._offset);returnthis._offset+=1,f}_nextUint16(){letf=this._dataView.getUint16(this._offset,this._littleEndian);returnthis._offset+=2,f}_nextUint32(){letf=this._dataView.getUint32(this._offset,this._littleEndian);returnthis._offset+=4,f}_nextUint64(){letf=this._dataView.getUint32(this._offset,this._littleEndian),r=this._dataView.getUint32(this._offset+4,this._littleEndian),C=f+2**32*r;returnthis._offset+=8,C}_nextInt32(){letf=this._dataView.getInt32(this._offset,this._littleEndian);returnthis._offset+=4,f}_nextUint8Array(f){letr=newUint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,f);returnthis._offset+=f,r}_skip(f){returnthis._offset+=f,this}_scan(f,r=0){letC=this._offset,l=0;for(;this._dataView.getUint8(this._offset)!==r&&l<f;)l++,this._offset++;returnl<f&&this._offset++,newUint8Array(this._dataView.buffer,this._dataView.byteOffset+C,l)}};vardr=newUint8Array([0]),w=[171,75,84,88,32,50,48,187,13,10,26,10];functionan(o){returnnewTextDecoder().decode(o)}functioncn(o){letf=newUint8Array(o.buffer,o.byteOffset,w.length);if(f[0]!==w[0]||f[1]!==w[1]||f[2]!==w[2]||f[3]!==w[3]||f[4]!==w[4]||f[5]!==w[5]||f[6]!==w[6]||f[7]!==w[7]||f[8]!==w[8]||f[9]!==w[9]||f[10]!==w[10]||f[11]!==w[11])thrownewError("Missing KTX 2.0 identifier.");letr=Rr(),C=17*Uint32Array.BYTES_PER_ELEMENT,l=newue(o,w.length,C,!0);r.vkFormat=l._nextUint32(),r.typeSize=l._nextUint32(),r.pixelWidth=l._nextUint32(),r.pixelHeight=l._nextUint32(),r.pixelDepth=l._nextUint32(),r.layerCount=l._nextUint32(),r.faceCount=l._nextUint32();letE=l._nextUint32();r.supercompressionScheme=l._nextUint32();letF=l._nextUint32(),g=l._nextUint32(),m=l._nextUint32(),I=l._nextUint32(),N=l._nextUint64(),d=l._nextUint64(),P=E*3*8,Q=newue(o,w.length+C,P,!0);for(letU=0;U<E;U++)r.levels.push({levelData:newUint8Array(o.buffer,o.byteOffset+Q._nextUint64(),Q._nextUint64()),uncompressedByteLength:Q._nextUint64()});letu=newue(o,F,g,!0);u._skip(4);letW=u._nextUint16(),J=u._nextUint16(),ae=u._nextUint16(),j=u._nextUint16(),Be=u._nextUint8(),Ce=u._nextUint8(),Fe=u._nextUint8(),it=u._nextUint8(),oe=[u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8()],Rt=[u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8()],se={vendorId:W,descriptorType:J,versionNumber:ae,colorModel:Be,colorPrimaries:Ce,transferFunction:Fe,flags:it,texelBlockDimension:oe,bytesPlane:Rt,samples:[]},Ie=(j/4-6)/4;for(letU=0;U<Ie;U++){letp={bitOffset:u._nextUint16(),bitLength:u._nextUint8(),channelType:u._nextUint8(),samplePosition:[u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8()],sampleLower:Number.NEGATIVE_INFINITY,sampleUpper:Number.POSITIVE_INFINITY};p.channelType&64?(p.sampleLower=u._nextInt32(),p.sampleUpper=u._nextInt32()):(p.sampleLower=u._nextUint32(),p.sampleUpper=u._nextUint32()),se.samples[U]=p}r.dataFormatDescriptor.length=0,r.dataFormatDescriptor.push(se);letce=newue(o,m,I,!0);for(;ce._offset<I;){letU=ce._nextUint32(),p=ce._scan(U),k=an(p);if(r.keyValue[k]=ce._nextUint8Array(U-p.byteLength-1),k.match(/^ktx/i)){letL=an(r.keyValue[k]);r.keyValue[k]=L.substring(0,L.lastIndexOf("\0"))}letAe=U%4?4-U%4:0;ce._skip(Ae)}if(d<=0)returnr;letD=newue(o,N,d,!0),be=D._nextUint16(),we=D._nextUint16(),Se=D._nextUint32(),He=D._nextUint32(),Xe=D._nextUint32(),at=D._nextUint32(),Ge=[];for(letU=0;U<E;U++)Ge.push({imageFlags:D._nextUint32(),rgbSliceByteOffset:D._nextUint32(),rgbSliceByteLength:D._nextUint32(),alphaSliceByteOffset:D._nextUint32(),alphaSliceByteLength:D._nextUint32()});letxe=N+D._offset,ke=xe+Se,$e=ke+He,ct=$e+Xe,At=newUint8Array(o.buffer,o.byteOffset+xe,Se),ft=newUint8Array(o.buffer,o.byteOffset+ke,He),Tt=newUint8Array(o.buffer,o.byteOffset+$e,Xe),Ne=newUint8Array(o.buffer,o.byteOffset+ct,at);returnr.globalData={endpointCount:be,selectorCount:we,imageDescs:Ge,endpointsData:At,selectorsData:ft,tablesData:Tt,extendedData:Ne},r}varfn=sr(An(),1),Tn=["positiveX","negativeX","positiveY","negativeY","positiveZ","negativeZ"],un=163,On=166,De;functionar(o,f){on.typeOf.object("transcoderModule",De);letr=o.ktx2Buffer,C=o.supportedTargetFormats,l;try{l=cn(r)}catch{thrownewre("Invalid KTX2 file.")}if(l.layerCount!==0)thrownewre("KTX2 texture arrays are not supported.");if(l.pixelDepth!==0)thrownewre("KTX2 3D textures are unsupported.");letE=l.dataFormatDescriptor[0],F=newArray(l.levelCount);returnl.vkFormat===0&&(E.colorModel===un||E.colorModel===On)?Ar(r,l,C,De,f,F):(f.push(r.buffer),cr(l,F)),F}functioncr(o,f){letr=o.vkFormat===me.VK_FORMAT_R8G8B8_SRGB?v.RGB:v.RGBA,C;o.vkFormat===me.VK_FORMAT_R8G8B8A8_UNORM?C=H.UNSIGNED_BYTE:o.vkFormat===me.VK_FORMAT_R16G16B16A16_SFLOAT?C=H.HALF_FLOAT:o.vkFormat===me.VK_FORMAT_R32G32B32A32_SFLOAT&&(C=H.FLOAT);for(letl=0;l<o.levels.length;++l){letE={};f[l]=E;letF=o.levels[l].levelData,g=o.pixelWidth>>l,m=o.pixelHeight>>l,I=g*m*v.componentsLength(r);for(letN=0;N<o.faceCount;++N){letd=F.byteOffset+I*o.typeSize*N,P;!Le(C)||H.sizeInBytes(C)===1?P=newUint8Array(F.buffer,d,I):H.sizeInBytes(C)===2?P=newUint16Array(F.buffer,d,I):P=newFloat32Array(F.buffer,d,I),E[Tn[N]]={internalFormat:r,datatype:C,width:g,height:m,levelBuffer:P}}}}functionAr(o,f,r,C,l,E){letF=newC.KTX2File(o),g=F.getWidth(),m=F.getHeight(),I=F.getLevels(),N=F.getHasAlpha();if(!(g>0)||!(m>0)||!(I>0))throwF.close(),F.delete(),newre("Invalid KTX2 file");letd,P,Q=f.dataFormatDescriptor[0],u=C.transcoder_texture_format;if(Q.colorModel===un)if(r.etc)d=N?v.RGBA8_ETC2_EAC:v.RGB8_ETC2,P=N?u.cTFETC2_RGBA:u.cTFETC1_RGB;elseif(r.etc1&&!N)d=v.RGB_ETC1,P=u.cTFETC1_RGB;elseif(r.s3tc)d=N?v.RGBA_DXT5:v.RGB_DXT1,P=N?u.cTFBC3_RGBA:u.cTFBC1_RGB;elseif(r.pvrtc)d=N?v.RGBA_PVRTC_4BPPV1:v.RGB_PVRTC_4BPPV1,P=N?u.cTFPVRTC1_4_RGBA:u.cTFPVRTC1_4_RGB;elseif(r.astc)d=v.RGBA_ASTC,P=u.cTFASTC_4x4_RGBA;elseif(r.bc7)d=v.RGBA_BC7,P=u.cTFBC7_RGBA;elsethrownewre("No transcoding format target available for ETC1S compressed ktx2.");elseif(Q.colorModel===On)if(r.astc)d=v.RGBA_ASTC,P=u.cTFASTC_4x4_RGBA;elseif(r.bc7)d=v.RGBA_BC7,P=u.cTFBC7_RGBA;elseif(r.s3tc)d=N?v.RGBA_DXT5:v.RGB_DXT1,P=N?u.cTFBC3_RGBA:u.cTFBC1_RGB;elseif(r.etc)d=N?v.RGBA8_ETC2_EAC:v.RGB8_ETC2,P=N?u.cTFETC2_RGBA:u.cTFETC1_RGB;elseif(r.etc1&&!N)d=v.RGB_ETC1,P=u.cTFETC1_RGB;elseif(r.pvrtc)d=N?v.RGBA_PVRTC_4BPPV1:v.RGB_PVRTC_4BPPV1,P=N?u.cTFPVRTC1_4_RGBA:u.cTFPVRTC1_4_RGB;elsethrownewre("No transcoding format target available for UASTC compressed ktx2.");if(!F.startTranscoding())throwF.close(),F.delete(),newre("startTranscoding() failed");for(letW=0;W<f.levels.length;++W){letJ={};E[W]=J,g=f.pixelWidth>>W,m=f.pixelHeight>>W;letae=F.getImageTranscodedSizeInBytes(W,0,0,P.value),j=newUint8Array(ae),Be=F.transcodeImage(j,W,0,0,P.value,0,-1,-1);if(!Le(Be))thrownewre("transcodeImage() failed.");l.push(j.buffer),J[Tn[0]]={internalFormat:d,width:g,height:m,levelBuffer:j}}returnF.close(),F.delete(),E}asyncfunctionfr(o,f){letr=o.webAssemblyConfig,C=sn(fn.default,self.BASIS);returnLe(r.wasmBinaryFile)?De=awaitC(r):De=awaitC(),De.initializeBasis(),!0}functionTr(o,f){letr=o.webAssemblyConfig;returnLe(r)?fr(o,f):ar(o,f)}varyr=Rn(Tr);export{yrasdefault};