@arcgis/core 4.22.0-next.20211207 → 4.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{44ccee36f8c74f4f134e.js → 025df54bafc05c183182.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{23af0b02208e20d5c07e.js → 22c0032451a4e1d43167.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{fd874267d81bc0b2be50.js → 5915752b754997630665.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{f3da8b797c8e1fcb1c21.js → 63161320a58a0b1702a2.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{96a62dc1e07f3ef20a30.js → 67482a0c298e41ea47f5.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{52aa3b44bddb10caa343.js → 753846665158c1c321ee.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{8bc4ea821be16a752226.js → 764126387018aa548f58.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{bc0b85bc1e5116836ba4.js → 79ddc2e92f0f057f6be3.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{b1e7e0ee0fc8d3ba7c3c.js → 8150ec4b80adcf5fca86.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{6210b23872c362f51b12.js → 89d1c5f6ed167515ad24.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{4417dfcb2ba50ac9f199.js → 8ac288ac3ff8e61b98c4.js} +1 -1
  13. package/assets/esri/core/workers/chunks/95b085ff097005995ced.js +1 -0
  14. package/assets/esri/core/workers/chunks/{6e736a6717e09bf6c1fc.js → ab635e54fda321961683.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{9d66ca0feda89e902494.js → c32a849111ae061ae194.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{6a1ce00bcb689ea95bcb.js → dab0bfa26073cf325e08.js} +1 -1
  17. package/chunks/Clouds.glsl.js +4 -4
  18. package/config.js +1 -1
  19. package/interfaces.d.ts +133 -6
  20. package/package.json +1 -1
  21. package/renderers/VectorFieldRenderer.js +1 -1
  22. package/renderers/support/RasterSymbolizer.js +1 -1
  23. package/renderers/support/rasterRendererHelper.js +1 -1
  24. package/support/revision.js +1 -1
  25. package/views/2d/MapViewConstraints.js +1 -1
  26. package/views/2d/constraints/ZoomConstraint.js +1 -1
  27. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  28. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  29. package/views/3d/environment/Clouds.glsl.js +1 -1
  30. package/views/3d/environment/CloudsGenerator.js +1 -1
  31. package/views/3d/environment/NoiseTextureAtlas.js +1 -1
  32. package/views/MapView.js +1 -1
  33. package/views/webgl/Program.js +1 -1
  34. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  35. package/widgets/UtilityNetworkTrace.js +1 -1
  36. package/assets/esri/core/workers/chunks/26a4a4762a635109383f.js +0 -1
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[176],{97575:(e,t,r)=>{r.d(t,{J:()=>s});var i,n,o,a={exports:{}};i=a,n=function(){var e=function(){function e(e){this.message="JPEG error: "+e}return e.prototype=new Error,e.prototype.name="JpegError",e.constructor=e,e}();return function(){if(!self||!self.Uint8ClampedArray)return null;var t=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),r=4017,i=799,n=3406,o=2276,a=1567,s=3784,l=5793,f=2896;function u(){this.decodeTransform=null,this.colorTransform=-1}function h(e,t){for(var r,i,n=0,o=[],a=16;a>0&&!e[a-1];)a--;o.push({children:[],index:0});var s,l=o[0];for(r=0;r<a;r++){for(i=0;i<e[r];i++){for((l=o.pop()).children[l.index]=t[n];l.index>0;)l=o.pop();for(l.index++,o.push(l);o.length<=r;)o.push(s={children:[],index:0}),l.children[l.index]=s.children,l=s;n++}r+1<a&&(o.push(s={children:[],index:0}),l.children[l.index]=s.children,l=s)}return o[0].children}function c(e,t,r){return 64*((e.blocksPerLine+1)*t+r)}function d(r,i,n,o,a,s,l,f,u){var h=n.mcusPerLine,d=n.progressive,p=i,m=0,y=0;function w(){if(y>0)return y--,m>>y&1;if(255===(m=r[i++])){var t=r[i++];if(t)throw new e("unexpected marker "+(m<<8|t).toString(16))}return y=7,m>>>7}function x(t){for(var r=t;;){if("number"==typeof(r=r[w()]))return r;if("object"!=typeof r)throw new e("invalid huffman sequence")}}function C(e){for(var t=0;e>0;)t=t<<1|w(),e--;return t}function b(e){if(1===e)return 1===w()?1:-1;var t=C(e);return t>=1<<e-1?t:t+(-1<<e)+1}var k,v=0,T=0;function S(e,t,r,i,n){var o=r%h;t(e,c(e,(r/h|0)*e.v+i,o*e.h+n))}function A(e,t,r){t(e,c(e,r/e.blocksPerLine|0,r%e.blocksPerLine))}var I,M,P,D,U,B,E=o.length;B=d?0===s?0===f?function(e,t){var r=x(e.huffmanTableDC),i=0===r?0:b(r)<<u;e.blockData[t]=e.pred+=i}:function(e,t){e.blockData[t]|=w()<<u}:0===f?function(e,r){if(v>0)v--;else for(var i=s,n=l;i<=n;){var o=x(e.huffmanTableAC),a=15&o,f=o>>4;if(0!==a){var h=t[i+=f];e.blockData[r+h]=b(a)*(1<<u),i++}else{if(f<15){v=C(f)+(1<<f)-1;break}i+=16}}}:function(r,i){for(var n,o,a=s,f=l,h=0;a<=f;){var c=t[a];switch(T){case 0:if(h=(o=x(r.huffmanTableAC))>>4,0==(n=15&o))h<15?(v=C(h)+(1<<h),T=4):(h=16,T=1);else{if(1!==n)throw new e("invalid ACn encoding");k=b(n),T=h?2:3}continue;case 1:case 2:r.blockData[i+c]?r.blockData[i+c]+=w()<<u:0==--h&&(T=2===T?3:0);break;case 3:r.blockData[i+c]?r.blockData[i+c]+=w()<<u:(r.blockData[i+c]=k<<u,T=0);break;case 4:r.blockData[i+c]&&(r.blockData[i+c]+=w()<<u)}a++}4===T&&0==--v&&(T=0)}:function(e,r){var i=x(e.huffmanTableDC),n=0===i?0:b(i);e.blockData[r]=e.pred+=n;for(var o=1;o<64;){var a=x(e.huffmanTableAC),s=15&a,l=a>>4;if(0!==s){var f=t[o+=l];e.blockData[r+f]=b(s),o++}else{if(l<15)break;o+=16}}};var L,R,O,_,G=0;for(R=1===E?o[0].blocksPerLine*o[0].blocksPerColumn:h*n.mcusPerColumn;G<R;){var V=a?Math.min(R-G,a):R;for(M=0;M<E;M++)o[M].pred=0;if(v=0,1===E)for(I=o[0],U=0;U<V;U++)A(I,B,G),G++;else for(U=0;U<V;U++){for(M=0;M<E;M++)for(O=(I=o[M]).h,_=I.v,P=0;P<_;P++)for(D=0;D<O;D++)S(I,B,G,P,D);G++}y=0,(L=g(r,i))&&L.invalid&&(console.log("decodeScan - unexpected MCU data, next marker is: "+L.invalid),i=L.offset);var F=L&&L.marker;if(!F||F<=65280)throw new e("marker was not found");if(!(F>=65488&&F<=65495))break;i+=2}return(L=g(r,i))&&L.invalid&&(console.log("decodeScan - unexpected Scan data, next marker is: "+L.invalid),i=L.offset),i-p}function p(t,u,h){var c,d,p,m,g,y,w,x,C,b,k,v,T,S,A,I,M,P=t.quantizationTable,D=t.blockData;if(!P)throw new e("missing required Quantization Table.");for(var U=0;U<64;U+=8)C=D[u+U],b=D[u+U+1],k=D[u+U+2],v=D[u+U+3],T=D[u+U+4],S=D[u+U+5],A=D[u+U+6],I=D[u+U+7],C*=P[U],0!=(b|k|v|T|S|A|I)?(b*=P[U+1],k*=P[U+2],v*=P[U+3],T*=P[U+4],S*=P[U+5],A*=P[U+6],I*=P[U+7],d=(c=(c=l*C+128>>8)+(d=l*T+128>>8)+1>>1)-d,M=(p=k)*s+(m=A)*a+128>>8,p=p*a-m*s+128>>8,w=(g=(g=f*(b-I)+128>>8)+(w=S<<4)+1>>1)-w,y=(x=(x=f*(b+I)+128>>8)+(y=v<<4)+1>>1)-y,m=(c=c+(m=M)+1>>1)-m,p=(d=d+p+1>>1)-p,M=g*o+x*n+2048>>12,g=g*n-x*o+2048>>12,x=M,M=y*i+w*r+2048>>12,y=y*r-w*i+2048>>12,w=M,h[U]=c+x,h[U+7]=c-x,h[U+1]=d+w,h[U+6]=d-w,h[U+2]=p+y,h[U+5]=p-y,h[U+3]=m+g,h[U+4]=m-g):(M=l*C+512>>10,h[U]=M,h[U+1]=M,h[U+2]=M,h[U+3]=M,h[U+4]=M,h[U+5]=M,h[U+6]=M,h[U+7]=M);for(var B=0;B<8;++B)C=h[B],0!=((b=h[B+8])|(k=h[B+16])|(v=h[B+24])|(T=h[B+32])|(S=h[B+40])|(A=h[B+48])|(I=h[B+56]))?(d=(c=4112+((c=l*C+2048>>12)+(d=l*T+2048>>12)+1>>1))-d,M=(p=k)*s+(m=A)*a+2048>>12,p=p*a-m*s+2048>>12,m=M,w=(g=(g=f*(b-I)+2048>>12)+(w=S)+1>>1)-w,y=(x=(x=f*(b+I)+2048>>12)+(y=v)+1>>1)-y,M=g*o+x*n+2048>>12,g=g*n-x*o+2048>>12,x=M,M=y*i+w*r+2048>>12,y=y*r-w*i+2048>>12,C=(C=(c=c+m+1>>1)+x)<16?0:C>=4080?255:C>>4,b=(b=(d=d+p+1>>1)+(w=M))<16?0:b>=4080?255:b>>4,k=(k=(p=d-p)+y)<16?0:k>=4080?255:k>>4,v=(v=(m=c-m)+g)<16?0:v>=4080?255:v>>4,T=(T=m-g)<16?0:T>=4080?255:T>>4,S=(S=p-y)<16?0:S>=4080?255:S>>4,A=(A=d-w)<16?0:A>=4080?255:A>>4,I=(I=c-x)<16?0:I>=4080?255:I>>4,D[u+B]=C,D[u+B+8]=b,D[u+B+16]=k,D[u+B+24]=v,D[u+B+32]=T,D[u+B+40]=S,D[u+B+48]=A,D[u+B+56]=I):(M=(M=l*C+8192>>14)<-2040?0:M>=2024?255:M+2056>>4,D[u+B]=M,D[u+B+8]=M,D[u+B+16]=M,D[u+B+24]=M,D[u+B+32]=M,D[u+B+40]=M,D[u+B+48]=M,D[u+B+56]=M)}function m(e,t){for(var r=t.blocksPerLine,i=t.blocksPerColumn,n=new Int16Array(64),o=0;o<i;o++)for(var a=0;a<r;a++)p(t,c(t,o,a),n);return t.blockData}function g(e,t,r){function i(t){return e[t]<<8|e[t+1]}var n=e.length-1,o=r<t?r:t;if(t>=n)return null;var a=i(t);if(a>=65472&&a<=65534)return{invalid:null,marker:a,offset:t};for(var s=i(o);!(s>=65472&&s<=65534);){if(++o>=n)return null;s=i(o)}return{invalid:a.toString(16),marker:s,offset:o}}return u.prototype={parse:function(r){function i(){var e=r[l]<<8|r[l+1];return l+=2,e}function n(){var e=i(),t=l+e-2,n=g(r,t,l);n&&n.invalid&&(console.log("readDataBlock - incorrect length, next marker is: "+n.invalid),t=n.offset);var o=r.subarray(l,t);return l+=o.length,o}function o(e){for(var t=Math.ceil(e.samplesPerLine/8/e.maxH),r=Math.ceil(e.scanLines/8/e.maxV),i=0;i<e.components.length;i++){G=e.components[i];var n=Math.ceil(Math.ceil(e.samplesPerLine/8)*G.h/e.maxH),o=Math.ceil(Math.ceil(e.scanLines/8)*G.v/e.maxV),a=t*G.h,s=r*G.v*64*(a+1);G.blockData=new Int16Array(s),G.blocksPerLine=n,G.blocksPerColumn=o}e.mcusPerLine=t,e.mcusPerColumn=r}var a,s,l=0,f=null,u=null,c=[],p=[],y=[],w=i();if(65496!==w)throw new e("SOI not found");for(w=i();65497!==w;){var x,C,b;switch(w){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var k=n();65504===w&&74===k[0]&&70===k[1]&&73===k[2]&&70===k[3]&&0===k[4]&&(f={version:{major:k[5],minor:k[6]},densityUnits:k[7],xDensity:k[8]<<8|k[9],yDensity:k[10]<<8|k[11],thumbWidth:k[12],thumbHeight:k[13],thumbData:k.subarray(14,14+3*k[12]*k[13])}),65518===w&&65===k[0]&&100===k[1]&&111===k[2]&&98===k[3]&&101===k[4]&&(u={version:k[5]<<8|k[6],flags0:k[7]<<8|k[8],flags1:k[9]<<8|k[10],transformCode:k[11]});break;case 65499:for(var v=i()+l-2;l<v;){var T=r[l++],S=new Uint16Array(64);if(T>>4==0)for(C=0;C<64;C++)S[t[C]]=r[l++];else{if(T>>4!=1)throw new e("DQT - invalid table spec");for(C=0;C<64;C++)S[t[C]]=i()}c[15&T]=S}break;case 65472:case 65473:case 65474:if(a)throw new e("Only single frame JPEGs supported");i(),(a={}).extended=65473===w,a.progressive=65474===w,a.precision=r[l++],a.scanLines=i(),a.samplesPerLine=i(),a.components=[],a.componentIds={};var A,I=r[l++],M=0,P=0;for(x=0;x<I;x++){A=r[l];var D=r[l+1]>>4,U=15&r[l+1];M<D&&(M=D),P<U&&(P=U);var B=r[l+2];b=a.components.push({h:D,v:U,quantizationId:B,quantizationTable:null}),a.componentIds[A]=b-1,l+=3}a.maxH=M,a.maxV=P,o(a);break;case 65476:var E=i();for(x=2;x<E;){var L=r[l++],R=new Uint8Array(16),O=0;for(C=0;C<16;C++,l++)O+=R[C]=r[l];var _=new Uint8Array(O);for(C=0;C<O;C++,l++)_[C]=r[l];x+=17+O,(L>>4==0?y:p)[15&L]=h(R,_)}break;case 65501:i(),s=i();break;case 65498:i();var G,V=r[l++],F=[];for(x=0;x<V;x++){var N=a.componentIds[r[l++]];G=a.components[N];var z=r[l++];G.huffmanTableDC=y[z>>4],G.huffmanTableAC=p[15&z],F.push(G)}var Z=r[l++],j=r[l++],H=r[l++],Y=d(r,l,a,F,s,Z,j,H>>4,15&H);l+=Y;break;case 65535:255!==r[l]&&l--;break;default:if(255===r[l-3]&&r[l-2]>=192&&r[l-2]<=254){l-=3;break}throw new e("unknown marker "+w.toString(16))}w=i()}for(this.width=a.samplesPerLine,this.height=a.scanLines,this.jfif=f,this.eof=l,this.adobe=u,this.components=[],x=0;x<a.components.length;x++){var J=c[(G=a.components[x]).quantizationId];J&&(G.quantizationTable=J),this.components.push({output:m(0,G),scaleX:G.h/a.maxH,scaleY:G.v/a.maxV,blocksPerLine:G.blocksPerLine,blocksPerColumn:G.blocksPerColumn})}this.numComponents=this.components.length},_getLinearizedBlockData:function(e,t){var r,i,n,o,a,s,l,f,u,h,c,d=this.width/e,p=this.height/t,m=0,g=this.components.length,y=e*t*g,w=new Uint8ClampedArray(y),x=new Uint32Array(e),C=4294967288;for(l=0;l<g;l++){for(i=(r=this.components[l]).scaleX*d,n=r.scaleY*p,m=l,c=r.output,o=r.blocksPerLine+1<<3,a=0;a<e;a++)f=0|a*i,x[a]=(f&C)<<3|7&f;for(s=0;s<t;s++)for(h=o*((f=0|s*n)&C)|(7&f)<<3,a=0;a<e;a++)w[m]=c[h+x[a]],m+=g}var b=this.decodeTransform;if(b)for(l=0;l<y;)for(f=0,u=0;f<g;f++,l++,u+=2)w[l]=(w[l]*b[u]>>8)+b[u+1];return w},_isColorConversionNeeded:function(){return this.adobe?!!this.adobe.transformCode:3===this.numComponents?0!==this.colorTransform:1===this.colorTransform},_convertYccToRgb:function(e){for(var t,r,i,n=0,o=e.length;n<o;n+=3)t=e[n],r=e[n+1],i=e[n+2],e[n]=t-179.456+1.402*i,e[n+1]=t+135.459-.344*r-.714*i,e[n+2]=t-226.816+1.772*r;return e},_convertYcckToRgb:function(e){for(var t,r,i,n,o=0,a=0,s=e.length;a<s;a+=4)t=e[a],r=e[a+1],i=e[a+2],n=e[a+3],e[o++]=r*(-660635669420364e-19*r+.000437130475926232*i-54080610064599e-18*t+.00048449797120281*n-.154362151871126)-122.67195406894+i*(-.000957964378445773*i+.000817076911346625*t-.00477271405408747*n+1.53380253221734)+t*(.000961250184130688*t-.00266257332283933*n+.48357088451265)+n*(-.000336197177618394*n+.484791561490776),e[o++]=107.268039397724+r*(219927104525741e-19*r-.000640992018297945*i+.000659397001245577*t+.000426105652938837*n-.176491792462875)+i*(-.000778269941513683*i+.00130872261408275*t+.000770482631801132*n-.151051492775562)+t*(.00126935368114843*t-.00265090189010898*n+.25802910206845)+n*(-.000318913117588328*n-.213742400323665),e[o++]=r*(-.000570115196973677*r-263409051004589e-19*i+.0020741088115012*t-.00288260236853442*n+.814272968359295)-20.810012546947+i*(-153496057440975e-19*i-.000132689043961446*t+.000560833691242812*n-.195152027534049)+t*(.00174418132927582*t-.00255243321439347*n+.116935020465145)+n*(-.000343531996510555*n+.24165260232407);return e},_convertYcckToCmyk:function(e){for(var t,r,i,n=0,o=e.length;n<o;n+=4)t=e[n],r=e[n+1],i=e[n+2],e[n]=434.456-t-1.402*i,e[n+1]=119.541-t+.344*r+.714*i,e[n+2]=481.816-t-1.772*r;return e},_convertCmykToRgb:function(e){for(var t,r,i,n,o=0,a=1/255,s=0,l=e.length;s<l;s+=4)t=e[s]*a,r=e[s+1]*a,i=e[s+2]*a,n=e[s+3]*a,e[o++]=255+t*(-4.387332384609988*t+54.48615194189176*r+18.82290502165302*i+212.25662451639585*n-285.2331026137004)+r*(1.7149763477362134*r-5.6096736904047315*i-17.873870861415444*n-5.497006427196366)+i*(-2.5217340131683033*i-21.248923337353073*n+17.5119270841813)-n*(21.86122147463605*n+189.48180835922747),e[o++]=255+t*(8.841041422036149*t+60.118027045597366*r+6.871425592049007*i+31.159100130055922*n-79.2970844816548)+r*(-15.310361306967817*r+17.575251261109482*i+131.35250912493976*n-190.9453302588951)+i*(4.444339102852739*i+9.8632861493405*n-24.86741582555878)-n*(20.737325471181034*n+187.80453709719578),e[o++]=255+t*(.8842522430003296*t+8.078677503112928*r+30.89978309703729*i-.23883238689178934*n-14.183576799673286)+r*(10.49593273432072*r+63.02378494754052*i+50.606957656360734*n-112.23884253719248)+i*(.03296041114873217*i+115.60384449646641*n-193.58209356861505)-n*(22.33816807309886*n+180.12613974708367);return e},getData:function(t,r,i){if(this.numComponents>4)throw new e("Unsupported color mode");var n=this._getLinearizedBlockData(t,r);if(1===this.numComponents&&i){for(var o=n.length,a=new Uint8ClampedArray(3*o),s=0,l=0;l<o;l++){var f=n[l];a[s++]=f,a[s++]=f,a[s++]=f}return a}if(3===this.numComponents&&this._isColorConversionNeeded())return this._convertYccToRgb(n);if(4===this.numComponents){if(this._isColorConversionNeeded())return i?this._convertYcckToRgb(n):this._convertYcckToCmyk(n);if(i)return this._convertCmykToRgb(n)}return n}},u}()},void 0!==(o=n())&&(i.exports=o);const s=a.exports},32321:(e,t,r)=>{r.d(t,{d:()=>u});var i=r(22021),n={};n.defaultNoDataValue=(0,i.oK)(-1/0),n.decode=function(e,t){var r=(t=t||{}).encodedMaskData||null===t.encodedMaskData,f=l(e,t.inputOffset||0,r),u=null!=t.noDataValue?(0,i.oK)(t.noDataValue):n.defaultNoDataValue,h=o(f,t.pixelType||Float32Array,t.encodedMaskData,u,t.returnMask),c={width:f.width,height:f.height,pixelData:h.resultPixels,minValue:f.pixels.minValue,maxValue:f.pixels.maxValue,noDataValue:u};return h.resultMask&&(c.maskData=h.resultMask),t.returnEncodedMask&&f.mask&&(c.encodedMaskData=f.mask.bitset?f.mask.bitset:null),t.returnFileInfo&&(c.fileInfo=a(f,u),t.computeUsedBitDepths&&(c.fileInfo.bitDepths=s(f))),c};var o=function(e,t,r,i,n){var o,a,s=0,l=e.pixels.numBlocksX,u=e.pixels.numBlocksY,h=Math.floor(e.width/l),c=Math.floor(e.height/u),d=2*e.maxZError;r=r||(e.mask?e.mask.bitset:null),o=new t(e.width*e.height),n&&r&&(a=new Uint8Array(e.width*e.height));for(var p,m,g=new Float32Array(h*c),y=0;y<=u;y++){var w=y!==u?c:e.height%u;if(0!==w)for(var x=0;x<=l;x++){var C=x!==l?h:e.width%l;if(0!==C){var b,k,v,T,S=y*e.width*c+x*h,A=e.width-C,I=e.pixels.blocks[s];if(I.encoding<2?(0===I.encoding?b=I.rawData:(f(I.stuffedData,I.bitsPerPixel,I.numValidPixels,I.offset,d,g,e.pixels.maxValue),b=g),k=0):v=2===I.encoding?0:I.offset,r)for(m=0;m<w;m++){for(7&S&&(T=r[S>>3],T<<=7&S),p=0;p<C;p++)7&S||(T=r[S>>3]),128&T?(a&&(a[S]=1),o[S++]=I.encoding<2?b[k++]:v):(a&&(a[S]=0),o[S++]=i),T<<=1;S+=A}else if(I.encoding<2)for(m=0;m<w;m++){for(p=0;p<C;p++)o[S++]=b[k++];S+=A}else for(m=0;m<w;m++)if(o.fill)o.fill(v,S,S+C),S+=C+A;else{for(p=0;p<C;p++)o[S++]=v;S+=A}if(1===I.encoding&&k!==I.numValidPixels)throw"Block and Mask do not match";s++}}}return{resultPixels:o,resultMask:a}},a=function(e,t){return{fileIdentifierString:e.fileIdentifierString,fileVersion:e.fileVersion,imageType:e.imageType,height:e.height,width:e.width,maxZError:e.maxZError,eofOffset:e.eofOffset,mask:e.mask?{numBlocksX:e.mask.numBlocksX,numBlocksY:e.mask.numBlocksY,numBytes:e.mask.numBytes,maxValue:e.mask.maxValue}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,numBytes:e.pixels.numBytes,maxValue:e.pixels.maxValue,minValue:e.pixels.minValue,noDataValue:t}}},s=function(e){for(var t=e.pixels.numBlocksX*e.pixels.numBlocksY,r={},i=0;i<t;i++){var n=e.pixels.blocks[i];0===n.encoding?r.float32=!0:1===n.encoding?r[n.bitsPerPixel]=!0:r[0]=!0}return Object.keys(r)},l=function(e,t,r){var i={},n=new Uint8Array(e,t,10);if(i.fileIdentifierString=String.fromCharCode.apply(null,n),"CntZImage"!=i.fileIdentifierString.trim())throw"Unexpected file identifier string: "+i.fileIdentifierString;t+=10;var o=new DataView(e,t,24);if(i.fileVersion=o.getInt32(0,!0),i.imageType=o.getInt32(4,!0),i.height=o.getUint32(8,!0),i.width=o.getUint32(12,!0),i.maxZError=o.getFloat64(16,!0),t+=24,!r)if(o=new DataView(e,t,16),i.mask={},i.mask.numBlocksY=o.getUint32(0,!0),i.mask.numBlocksX=o.getUint32(4,!0),i.mask.numBytes=o.getUint32(8,!0),i.mask.maxValue=o.getFloat32(12,!0),t+=16,i.mask.numBytes>0){var a=new Uint8Array(Math.ceil(i.width*i.height/8)),s=(o=new DataView(e,t,i.mask.numBytes)).getInt16(0,!0),l=2,f=0;do{if(s>0)for(;s--;)a[f++]=o.getUint8(l++);else{var u=o.getUint8(l++);for(s=-s;s--;)a[f++]=u}s=o.getInt16(l,!0),l+=2}while(l<i.mask.numBytes);if(-32768!==s||f<a.length)throw"Unexpected end of mask RLE encoding";i.mask.bitset=a,t+=i.mask.numBytes}else 0==(i.mask.numBytes|i.mask.numBlocksY|i.mask.maxValue)&&(a=new Uint8Array(Math.ceil(i.width*i.height/8)),i.mask.bitset=a);o=new DataView(e,t,16),i.pixels={},i.pixels.numBlocksY=o.getUint32(0,!0),i.pixels.numBlocksX=o.getUint32(4,!0),i.pixels.numBytes=o.getUint32(8,!0),i.pixels.maxValue=o.getFloat32(12,!0),t+=16;var h=i.pixels.numBlocksX,c=i.pixels.numBlocksY,d=h+(i.width%h>0?1:0),p=c+(i.height%c>0?1:0);i.pixels.blocks=new Array(d*p);for(var m=1e9,g=0,y=0;y<p;y++)for(var w=0;w<d;w++){var x=0,C=e.byteLength-t;o=new DataView(e,t,Math.min(10,C));var b={};i.pixels.blocks[g++]=b;var k=o.getUint8(0);if(x++,b.encoding=63&k,b.encoding>3)throw"Invalid block encoding ("+b.encoding+")";if(2!==b.encoding){if(0!==k&&2!==k){if(k>>=6,b.offsetType=k,2===k)b.offset=o.getInt8(1),x++;else if(1===k)b.offset=o.getInt16(1,!0),x+=2;else{if(0!==k)throw"Invalid block offset type";b.offset=o.getFloat32(1,!0),x+=4}if(m=Math.min(b.offset,m),1===b.encoding)if(k=o.getUint8(x),x++,b.bitsPerPixel=63&k,k>>=6,b.numValidPixelsType=k,2===k)b.numValidPixels=o.getUint8(x),x++;else if(1===k)b.numValidPixels=o.getUint16(x,!0),x+=2;else{if(0!==k)throw"Invalid valid pixel count type";b.numValidPixels=o.getUint32(x,!0),x+=4}}var v;if(t+=x,3!=b.encoding)if(0===b.encoding){var T=(i.pixels.numBytes-1)/4;if(T!==Math.floor(T))throw"uncompressed block has invalid length";v=new ArrayBuffer(4*T),new Uint8Array(v).set(new Uint8Array(e,t,4*T));for(var S=new Float32Array(v),A=0;A<S.length;A++)m=Math.min(m,S[A]);b.rawData=S,t+=4*T}else if(1===b.encoding){var I=Math.ceil(b.numValidPixels*b.bitsPerPixel/8),M=Math.ceil(I/4);v=new ArrayBuffer(4*M),new Uint8Array(v).set(new Uint8Array(e,t,I)),b.stuffedData=new Uint32Array(v),t+=I}}else t++,m=Math.min(m,0)}return i.pixels.minValue=m,i.eofOffset=t,i},f=function(e,t,r,i,n,o,a){var s,l,f,u=(1<<t)-1,h=0,c=0,d=Math.ceil((a-i)/n),p=4*e.length-Math.ceil(t*r/8);for(e[e.length-1]<<=8*p,s=0;s<r;s++){if(0===c&&(f=e[h++],c=32),c>=t)l=f>>>c-t&u,c-=t;else{var m=t-c;l=(f&u)<<m&u,l+=(f=e[h++])>>>(c=32-m)}o[s]=l<d?i+l*n:a}return o};const u=n.decode},29825:(e,t,r)=>{r.d(t,{L:()=>p,a:()=>G,b:()=>R,c:()=>M,d:()=>_,g:()=>P,i:()=>D,p:()=>L});var i,n,o,a,s=r(20095),l=r(97575),f=r(88781),u=r(9832),h=r(48279),c=r(80899),d={exports:{}};void 0!==(i={unstuff:function(e,t,r,i,n,o,a,s){var l,f,u,h,c,d=(1<<r)-1,p=0,m=0,g=4*e.length-Math.ceil(r*i/8);if(e[e.length-1]<<=8*g,n)for(l=0;l<i;l++)0===m&&(u=e[p++],m=32),m>=r?(f=u>>>m-r&d,m-=r):(f=(u&d)<<(h=r-m)&d,f+=(u=e[p++])>>>(m=32-h)),t[l]=n[f];else for(c=Math.ceil((s-o)/a),l=0;l<i;l++)0===m&&(u=e[p++],m=32),m>=r?(f=u>>>m-r&d,m-=r):(f=(u&d)<<(h=r-m)&d,f+=(u=e[p++])>>>(m=32-h)),t[l]=f<c?o+f*a:s},unstuffLUT:function(e,t,r,i,n,o){var a,s=(1<<t)-1,l=0,f=0,u=0,h=0,c=0,d=[],p=4*e.length-Math.ceil(t*r/8);e[e.length-1]<<=8*p;var m=Math.ceil((o-i)/n);for(f=0;f<r;f++)0===h&&(a=e[l++],h=32),h>=t?(c=a>>>h-t&s,h-=t):(c=(a&s)<<(u=t-h)&s,c+=(a=e[l++])>>>(h=32-u)),d[f]=c<m?i+c*n:o;return d.unshift(i),d},unstuff2:function(e,t,r,i,n,o,a,s){var l,f,u,h,c=(1<<r)-1,d=0,p=0,m=0;if(n)for(l=0;l<i;l++)0===p&&(u=e[d++],p=32,m=0),p>=r?(f=u>>>m&c,p-=r,m+=r):(f=u>>>m&c,p=32-(h=r-p),f|=((u=e[d++])&(1<<h)-1)<<r-h,m=h),t[l]=n[f];else{var g=Math.ceil((s-o)/a);for(l=0;l<i;l++)0===p&&(u=e[d++],p=32,m=0),p>=r?(f=u>>>m&c,p-=r,m+=r):(f=u>>>m&c,p=32-(h=r-p),f|=((u=e[d++])&(1<<h)-1)<<r-h,m=h),t[l]=f<g?o+f*a:s}return t},unstuffLUT2:function(e,t,r,i,n,o){var a,s=(1<<t)-1,l=0,f=0,u=0,h=0,c=0,d=0,p=[],m=Math.ceil((o-i)/n);for(f=0;f<r;f++)0===h&&(a=e[l++],h=32,d=0),h>=t?(c=a>>>d&s,h-=t,d+=t):(c=a>>>d&s,h=32-(u=t-h),c|=((a=e[l++])&(1<<u)-1)<<t-u,d=u),p[f]=c<m?i+c*n:o;return p.unshift(i),p},originalUnstuff:function(e,t,r,i){var n,o,a,s,l=(1<<r)-1,f=0,u=0,h=4*e.length-Math.ceil(r*i/8);for(e[e.length-1]<<=8*h,n=0;n<i;n++)0===u&&(a=e[f++],u=32),u>=r?(o=a>>>u-r&l,u-=r):(o=(a&l)<<(s=r-u)&l,o+=(a=e[f++])>>>(u=32-s)),t[n]=o;return t},originalUnstuff2:function(e,t,r,i){var n,o,a,s,l=(1<<r)-1,f=0,u=0,h=0;for(n=0;n<i;n++)0===u&&(a=e[f++],u=32,h=0),u>=r?(o=a>>>h&l,u-=r,h+=r):(o=a>>>h&l,u=32-(s=r-u),o|=((a=e[f++])&(1<<s)-1)<<r-s,h=s),t[n]=o;return t}},n={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(e){for(var t=65535,r=65535,i=e.length,n=Math.floor(i/2),o=0;n;){var a=n>=359?359:n;n-=a;do{t+=e[o++]<<8,r+=t+=e[o++]}while(--a);t=(65535&t)+(t>>>16),r=(65535&r)+(r>>>16)}return 1&i&&(r+=t+=e[o]<<8),((r=(65535&r)+(r>>>16))<<16|(t=(65535&t)+(t>>>16)))>>>0},readHeaderInfo:function(e,t){var r=t.ptr,i=new Uint8Array(e,r,6),n={};if(n.fileIdentifierString=String.fromCharCode.apply(null,i),0!==n.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+n.fileIdentifierString;r+=6;var o,a=new DataView(e,r,8),s=a.getInt32(0,!0);if(n.fileVersion=s,r+=4,s>=3&&(n.checksum=a.getUint32(4,!0),r+=4),a=new DataView(e,r,12),n.height=a.getUint32(0,!0),n.width=a.getUint32(4,!0),r+=8,s>=4?(n.numDims=a.getUint32(8,!0),r+=4):n.numDims=1,a=new DataView(e,r,40),n.numValidPixel=a.getUint32(0,!0),n.microBlockSize=a.getInt32(4,!0),n.blobSize=a.getInt32(8,!0),n.imageType=a.getInt32(12,!0),n.maxZError=a.getFloat64(16,!0),n.zMin=a.getFloat64(24,!0),n.zMax=a.getFloat64(32,!0),r+=40,t.headerInfo=n,t.ptr=r,s>=3&&(o=s>=4?52:48,this.computeChecksumFletcher32(new Uint8Array(e,r-o,n.blobSize-14))!==n.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(e,t){var r=t.headerInfo,i=this.getDataTypeArray(r.imageType),n=r.numDims*this.getDataTypeSize(r.imageType),o=this.readSubArray(e,t.ptr,i,n),a=this.readSubArray(e,t.ptr+n,i,n);t.ptr+=2*n;var s,l=!0;for(s=0;s<r.numDims;s++)if(o[s]!==a[s]){l=!1;break}return r.minValues=o,r.maxValues=a,l},readSubArray:function(e,t,r,i){var n;if(r===Uint8Array)n=new Uint8Array(e,t,i);else{var o=new ArrayBuffer(i);new Uint8Array(o).set(new Uint8Array(e,t,i)),n=new r(o)}return n},readMask:function(e,t){var r,i,n=t.ptr,o=t.headerInfo,a=o.width*o.height,s=o.numValidPixel,l=new DataView(e,n,4),f={};if(f.numBytes=l.getUint32(0,!0),n+=4,(0===s||a===s)&&0!==f.numBytes)throw"invalid mask";if(0===s)r=new Uint8Array(Math.ceil(a/8)),f.bitset=r,i=new Uint8Array(a),t.pixels.resultMask=i,n+=f.numBytes;else if(f.numBytes>0){r=new Uint8Array(Math.ceil(a/8));var u=(l=new DataView(e,n,f.numBytes)).getInt16(0,!0),h=2,c=0,d=0;do{if(u>0)for(;u--;)r[c++]=l.getUint8(h++);else for(d=l.getUint8(h++),u=-u;u--;)r[c++]=d;u=l.getInt16(h,!0),h+=2}while(h<f.numBytes);if(-32768!==u||c<r.length)throw"Unexpected end of mask RLE encoding";i=new Uint8Array(a);var p=0,m=0;for(m=0;m<a;m++)7&m?(p=r[m>>3],p<<=7&m):p=r[m>>3],128&p&&(i[m]=1);t.pixels.resultMask=i,f.bitset=r,n+=f.numBytes}return t.ptr=n,t.mask=f,!0},readDataOneSweep:function(e,t,r,i){var o,a=t.ptr,s=t.headerInfo,l=s.numDims,f=s.width*s.height,u=s.imageType,h=s.numValidPixel*n.getDataTypeSize(u)*l,c=t.pixels.resultMask;if(r===Uint8Array)o=new Uint8Array(e,a,h);else{var d=new ArrayBuffer(h);new Uint8Array(d).set(new Uint8Array(e,a,h)),o=new r(d)}if(o.length===f*l)t.pixels.resultPixels=i?n.swapDimensionOrder(o,f,l,r,!0):o;else{t.pixels.resultPixels=new r(f*l);var p=0,m=0,g=0,y=0;if(l>1){if(i){for(m=0;m<f;m++)if(c[m])for(y=m,g=0;g<l;g++,y+=f)t.pixels.resultPixels[y]=o[p++]}else for(m=0;m<f;m++)if(c[m])for(y=m*l,g=0;g<l;g++)t.pixels.resultPixels[y+g]=o[p++]}else for(m=0;m<f;m++)c[m]&&(t.pixels.resultPixels[m]=o[p++])}return a+=h,t.ptr=a,!0},readHuffmanTree:function(e,t){var r=this.HUFFMAN_LUT_BITS_MAX,i=new DataView(e,t.ptr,16);if(t.ptr+=16,i.getInt32(0,!0)<2)throw"unsupported Huffman version";var a=i.getInt32(4,!0),s=i.getInt32(8,!0),l=i.getInt32(12,!0);if(s>=l)return!1;var f=new Uint32Array(l-s);n.decodeBits(e,t,f);var u,h,c,d,p=[];for(u=s;u<l;u++)p[h=u-(u<a?0:a)]={first:f[u-s],second:null};var m=e.byteLength-t.ptr,g=Math.ceil(m/4),y=new ArrayBuffer(4*g);new Uint8Array(y).set(new Uint8Array(e,t.ptr,m));var w,x=new Uint32Array(y),C=0,b=0;for(w=x[0],u=s;u<l;u++)(d=p[h=u-(u<a?0:a)].first)>0&&(p[h].second=w<<C>>>32-d,32-C>=d?32===(C+=d)&&(C=0,w=x[++b]):(C+=d-32,w=x[++b],p[h].second|=w>>>32-C));var k,v=0,T=new o;for(u=0;u<p.length;u++)void 0!==p[u]&&(v=Math.max(v,p[u].first));k=v>=r?r:v;var S,A,I,M,P,D=[];for(u=s;u<l;u++)if((d=p[h=u-(u<a?0:a)].first)>0)if(S=[d,h],d<=k)for(A=p[h].second<<k-d,I=1<<k-d,c=0;c<I;c++)D[A|c]=S;else for(A=p[h].second,P=T,M=d-1;M>=0;M--)A>>>M&1?(P.right||(P.right=new o),P=P.right):(P.left||(P.left=new o),P=P.left),0!==M||P.val||(P.val=S[1]);return{decodeLut:D,numBitsLUTQick:k,numBitsLUT:v,tree:T,stuffedData:x,srcPtr:b,bitPos:C}},readHuffman:function(e,t,r,i){var o,a,s,l,f,u,h,c,d,p=t.headerInfo.numDims,m=t.headerInfo.height,g=t.headerInfo.width,y=g*m,w=this.readHuffmanTree(e,t),x=w.decodeLut,C=w.tree,b=w.stuffedData,k=w.srcPtr,v=w.bitPos,T=w.numBitsLUTQick,S=w.numBitsLUT,A=0===t.headerInfo.imageType?128:0,I=t.pixels.resultMask,M=0;v>0&&(k++,v=0);var P,D=b[k],U=1===t.encodeMode,B=new r(y*p),E=B;if(p<2||U){for(P=0;P<p;P++)if(p>1&&(E=new r(B.buffer,y*P,y),M=0),t.headerInfo.numValidPixel===g*m)for(c=0,u=0;u<m;u++)for(h=0;h<g;h++,c++){if(a=0,f=l=D<<v>>>32-T,32-v<T&&(f=l|=b[k+1]>>>64-v-T),x[f])a=x[f][1],v+=x[f][0];else for(f=l=D<<v>>>32-S,32-v<S&&(f=l|=b[k+1]>>>64-v-S),o=C,d=0;d<S;d++)if(!(o=l>>>S-d-1&1?o.right:o.left).left&&!o.right){a=o.val,v=v+d+1;break}v>=32&&(v-=32,D=b[++k]),s=a-A,U?(s+=h>0?M:u>0?E[c-g]:M,s&=255,E[c]=s,M=s):E[c]=s}else for(c=0,u=0;u<m;u++)for(h=0;h<g;h++,c++)if(I[c]){if(a=0,f=l=D<<v>>>32-T,32-v<T&&(f=l|=b[k+1]>>>64-v-T),x[f])a=x[f][1],v+=x[f][0];else for(f=l=D<<v>>>32-S,32-v<S&&(f=l|=b[k+1]>>>64-v-S),o=C,d=0;d<S;d++)if(!(o=l>>>S-d-1&1?o.right:o.left).left&&!o.right){a=o.val,v=v+d+1;break}v>=32&&(v-=32,D=b[++k]),s=a-A,U?(h>0&&I[c-1]?s+=M:u>0&&I[c-g]?s+=E[c-g]:s+=M,s&=255,E[c]=s,M=s):E[c]=s}}else for(c=0,u=0;u<m;u++)for(h=0;h<g;h++)if(c=u*g+h,!I||I[c])for(P=0;P<p;P++,c+=y){if(a=0,f=l=D<<v>>>32-T,32-v<T&&(f=l|=b[k+1]>>>64-v-T),x[f])a=x[f][1],v+=x[f][0];else for(f=l=D<<v>>>32-S,32-v<S&&(f=l|=b[k+1]>>>64-v-S),o=C,d=0;d<S;d++)if(!(o=l>>>S-d-1&1?o.right:o.left).left&&!o.right){a=o.val,v=v+d+1;break}v>=32&&(v-=32,D=b[++k]),s=a-A,E[c]=s}t.ptr=t.ptr+4*(k+1)+(v>0?4:0),t.pixels.resultPixels=B,p>1&&!i&&(t.pixels.resultPixels=n.swapDimensionOrder(B,y,p,r))},decodeBits:function(e,t,r,n,o){var a=t.headerInfo,s=a.fileVersion,l=0,f=e.byteLength-t.ptr>=5?5:e.byteLength-t.ptr,u=new DataView(e,t.ptr,f),h=u.getUint8(0);l++;var c=h>>6,d=0===c?4:3-c,p=(32&h)>0,m=31&h,g=0;if(1===d)g=u.getUint8(l),l++;else if(2===d)g=u.getUint16(l,!0),l+=2;else{if(4!==d)throw"Invalid valid pixel count type";g=u.getUint32(l,!0),l+=4}var y,w,x,C,b,k,v,T,S,A=2*a.maxZError,I=a.numDims>1?a.maxValues[o]:a.zMax;if(p){for(t.counter.lut++,T=u.getUint8(l),l++,C=Math.ceil((T-1)*m/8),b=Math.ceil(C/4),w=new ArrayBuffer(4*b),x=new Uint8Array(w),t.ptr+=l,x.set(new Uint8Array(e,t.ptr,C)),v=new Uint32Array(w),t.ptr+=C,S=0;T-1>>>S;)S++;C=Math.ceil(g*S/8),b=Math.ceil(C/4),w=new ArrayBuffer(4*b),(x=new Uint8Array(w)).set(new Uint8Array(e,t.ptr,C)),y=new Uint32Array(w),t.ptr+=C,k=s>=3?i.unstuffLUT2(v,m,T-1,n,A,I):i.unstuffLUT(v,m,T-1,n,A,I),s>=3?i.unstuff2(y,r,S,g,k):i.unstuff(y,r,S,g,k)}else t.counter.bitstuffer++,S=m,t.ptr+=l,S>0&&(C=Math.ceil(g*S/8),b=Math.ceil(C/4),w=new ArrayBuffer(4*b),(x=new Uint8Array(w)).set(new Uint8Array(e,t.ptr,C)),y=new Uint32Array(w),t.ptr+=C,s>=3?null==n?i.originalUnstuff2(y,r,S,g):i.unstuff2(y,r,S,g,!1,n,A,I):null==n?i.originalUnstuff(y,r,S,g):i.unstuff(y,r,S,g,!1,n,A,I))},readTiles:function(e,t,r,i){var o=t.headerInfo,a=o.width,s=o.height,l=a*s,f=o.microBlockSize,u=o.imageType,h=n.getDataTypeSize(u),c=Math.ceil(a/f),d=Math.ceil(s/f);t.pixels.numBlocksY=d,t.pixels.numBlocksX=c,t.pixels.ptr=0;var p,m,g,y,w,x,C,b,k,v,T=0,S=0,A=0,I=0,M=0,P=0,D=0,U=0,B=0,E=0,L=0,R=0,O=0,_=0,G=0,V=new r(f*f),F=s%f||f,N=a%f||f,z=o.numDims,Z=t.pixels.resultMask,j=t.pixels.resultPixels,H=o.fileVersion>=5?14:15,Y=o.zMax;for(A=0;A<d;A++)for(M=A!==d-1?f:F,I=0;I<c;I++)for(E=A*a*f+I*f,L=a-(P=I!==c-1?f:N),b=0;b<z;b++){if(z>1?(v=j,E=A*a*f+I*f,j=new r(t.pixels.resultPixels.buffer,l*b*h,l),Y=o.maxValues[b]):v=null,D=e.byteLength-t.ptr,m={},G=0,U=(p=new DataView(e,t.ptr,Math.min(10,D))).getUint8(0),G++,k=o.fileVersion>=5?4&U:0,B=U>>6&255,(U>>2&H)!=(I*f>>3&H))throw"integrity issue";if(k&&0===b)throw"integrity issue";if((w=3&U)>3)throw t.ptr+=G,"Invalid block encoding ("+w+")";if(2!==w)if(0===w){if(k)throw"integrity issue";if(t.counter.uncompressed++,t.ptr+=G,R=(R=M*P*h)<(O=e.byteLength-t.ptr)?R:O,g=new ArrayBuffer(R%h==0?R:R+h-R%h),new Uint8Array(g).set(new Uint8Array(e,t.ptr,R)),y=new r(g),_=0,Z)for(T=0;T<M;T++){for(S=0;S<P;S++)Z[E]&&(j[E]=y[_++]),E++;E+=L}else for(T=0;T<M;T++){for(S=0;S<P;S++)j[E++]=y[_++];E+=L}t.ptr+=_*h}else if(x=n.getDataTypeUsed(k&&u<6?4:u,B),C=n.getOnePixel(m,G,x,p),G+=n.getDataTypeSize(x),3===w)if(t.ptr+=G,t.counter.constantoffset++,Z)for(T=0;T<M;T++){for(S=0;S<P;S++)Z[E]&&(j[E]=k?Math.min(Y,v[E]+C):C),E++;E+=L}else for(T=0;T<M;T++){for(S=0;S<P;S++)j[E]=k?Math.min(Y,v[E]+C):C,E++;E+=L}else if(t.ptr+=G,n.decodeBits(e,t,V,C,b),G=0,k)if(Z)for(T=0;T<M;T++){for(S=0;S<P;S++)Z[E]&&(j[E]=V[G++]+v[E]),E++;E+=L}else for(T=0;T<M;T++){for(S=0;S<P;S++)j[E]=V[G++]+v[E],E++;E+=L}else if(Z)for(T=0;T<M;T++){for(S=0;S<P;S++)Z[E]&&(j[E]=V[G++]),E++;E+=L}else for(T=0;T<M;T++){for(S=0;S<P;S++)j[E++]=V[G++];E+=L}else{if(k)if(Z)for(T=0;T<M;T++)for(S=0;S<P;S++)Z[E]&&(j[E]=v[E]),E++;else for(T=0;T<M;T++)for(S=0;S<P;S++)j[E]=v[E],E++;t.counter.constant++,t.ptr+=G}}z>1&&!i&&(t.pixels.resultPixels=n.swapDimensionOrder(t.pixels.resultPixels,l,z,r))},formatFileInfo:function(e){return{fileIdentifierString:e.headerInfo.fileIdentifierString,fileVersion:e.headerInfo.fileVersion,imageType:e.headerInfo.imageType,height:e.headerInfo.height,width:e.headerInfo.width,numValidPixel:e.headerInfo.numValidPixel,microBlockSize:e.headerInfo.microBlockSize,blobSize:e.headerInfo.blobSize,maxZError:e.headerInfo.maxZError,pixelType:n.getPixelType(e.headerInfo.imageType),eofOffset:e.eofOffset,mask:e.mask?{numBytes:e.mask.numBytes}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,maxValue:e.headerInfo.zMax,minValue:e.headerInfo.zMin,noDataValue:e.noDataValue}}},constructConstantSurface:function(e,t){var r=e.headerInfo.zMax,i=e.headerInfo.zMin,n=e.headerInfo.maxValues,o=e.headerInfo.numDims,a=e.headerInfo.height*e.headerInfo.width,s=0,l=0,f=0,u=e.pixels.resultMask,h=e.pixels.resultPixels;if(u)if(o>1){if(t)for(s=0;s<o;s++)for(f=s*a,r=n[s],l=0;l<a;l++)u[l]&&(h[f+l]=r);else for(l=0;l<a;l++)if(u[l])for(f=l*o,s=0;s<o;s++)h[f+o]=n[s]}else for(l=0;l<a;l++)u[l]&&(h[l]=r);else if(o>1&&i!==r)if(t)for(s=0;s<o;s++)for(f=s*a,r=n[s],l=0;l<a;l++)h[f+l]=r;else for(l=0;l<a;l++)for(f=l*o,s=0;s<o;s++)h[f+s]=n[s];else for(l=0;l<a*o;l++)h[l]=r},getDataTypeArray:function(e){var t;switch(e){case 0:t=Int8Array;break;case 1:t=Uint8Array;break;case 2:t=Int16Array;break;case 3:t=Uint16Array;break;case 4:t=Int32Array;break;case 5:t=Uint32Array;break;case 6:default:t=Float32Array;break;case 7:t=Float64Array}return t},getPixelType:function(e){var t;switch(e){case 0:t="S8";break;case 1:t="U8";break;case 2:t="S16";break;case 3:t="U16";break;case 4:t="S32";break;case 5:t="U32";break;case 6:default:t="F32";break;case 7:t="F64"}return t},isValidPixelValue:function(e,t){if(null==t)return!1;var r;switch(e){case 0:r=t>=-128&&t<=127;break;case 1:r=t>=0&&t<=255;break;case 2:r=t>=-32768&&t<=32767;break;case 3:r=t>=0&&t<=65536;break;case 4:r=t>=-2147483648&&t<=2147483647;break;case 5:r=t>=0&&t<=4294967296;break;case 6:r=t>=-34027999387901484e22&&t<=34027999387901484e22;break;case 7:r=t>=5e-324&&t<=17976931348623157e292;break;default:r=!1}return r},getDataTypeSize:function(e){var t=0;switch(e){case 0:case 1:t=1;break;case 2:case 3:t=2;break;case 4:case 5:case 6:t=4;break;case 7:t=8;break;default:t=e}return t},getDataTypeUsed:function(e,t){var r=e;switch(e){case 2:case 4:r=e-t;break;case 3:case 5:r=e-2*t;break;case 6:r=0===t?e:1===t?2:1;break;case 7:r=0===t?e:e-2*t+1;break;default:r=e}return r},getOnePixel:function(e,t,r,i){var n=0;switch(r){case 0:n=i.getInt8(t);break;case 1:n=i.getUint8(t);break;case 2:n=i.getInt16(t,!0);break;case 3:n=i.getUint16(t,!0);break;case 4:n=i.getInt32(t,!0);break;case 5:n=i.getUInt32(t,!0);break;case 6:n=i.getFloat32(t,!0);break;case 7:n=i.getFloat64(t,!0);break;default:throw"the decoder does not understand this pixel type"}return n},swapDimensionOrder:function(e,t,r,i,n){var o=0,a=0,s=0,l=0,f=e;if(r>1)if(f=new i(t*r),n)for(o=0;o<t;o++)for(l=o,s=0;s<r;s++,l+=t)f[l]=e[a++];else for(o=0;o<t;o++)for(l=o,s=0;s<r;s++,l+=t)f[a++]=e[l];return f}},o=function(e,t,r){this.val=e,this.left=t,this.right=r},a={decode:function(e,t){var r=(t=t||{}).noDataValue,i=0,o={};o.ptr=t.inputOffset||0,o.pixels={},n.readHeaderInfo(e,o);var a=o.headerInfo,s=a.fileVersion,l=n.getDataTypeArray(a.imageType);if(s>5)throw"unsupported lerc version 2."+s;n.readMask(e,o),a.numValidPixel===a.width*a.height||o.pixels.resultMask||(o.pixels.resultMask=t.maskData);var f=a.width*a.height;o.pixels.resultPixels=new l(f*a.numDims),o.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0};var u,h=!t.returnPixelInterleavedDims;if(0!==a.numValidPixel)if(a.zMax===a.zMin)n.constructConstantSurface(o,h);else if(s>=4&&n.checkMinMaxRanges(e,o))n.constructConstantSurface(o,h);else{var c=new DataView(e,o.ptr,2),d=c.getUint8(0);if(o.ptr++,d)n.readDataOneSweep(e,o,l,h);else if(s>1&&a.imageType<=1&&Math.abs(a.maxZError-.5)<1e-5){var p=c.getUint8(1);if(o.ptr++,o.encodeMode=p,p>2||s<4&&p>1)throw"Invalid Huffman flag "+p;p?n.readHuffman(e,o,l,h):n.readTiles(e,o,l,h)}else n.readTiles(e,o,l,h)}o.eofOffset=o.ptr,t.inputOffset?(u=o.headerInfo.blobSize+t.inputOffset-o.ptr,Math.abs(u)>=1&&(o.eofOffset=t.inputOffset+o.headerInfo.blobSize)):(u=o.headerInfo.blobSize-o.ptr,Math.abs(u)>=1&&(o.eofOffset=o.headerInfo.blobSize));var m={width:a.width,height:a.height,pixelData:o.pixels.resultPixels,minValue:a.zMin,maxValue:a.zMax,validPixelCount:a.numValidPixel,dimCount:a.numDims,dimStats:{minValues:a.minValues,maxValues:a.maxValues},maskData:o.pixels.resultMask};if(o.pixels.resultMask&&n.isValidPixelValue(a.imageType,r)){var g=o.pixels.resultMask;for(i=0;i<f;i++)g[i]||(m.pixelData[i]=r);m.noDataValue=r}return o.noDataValue=r,t.returnFileInfo&&(m.fileInfo=n.formatFileInfo(o)),m},getBandCount:function(e){for(var t=0,r=0,i={ptr:0,pixels:{}};r<e.byteLength-58;)n.readHeaderInfo(e,i),r+=i.headerInfo.blobSize,t++,i.ptr=r;return t}})&&(d.exports=a);const p=d.exports,m=[0,1,1,2,4,8,1,1,2,4,8,4,8,-1,-1,-1,8,8,8],g=4294967296,y=new Set([1,5,6,7,8,34712,34887]);function w(e,t){let r="unknown";return 3===e?r="f32":1===e?1===t?r="u1":2===t?r="u2":4===t?r="u4":t<=8?r="u8":t<=16?r="u16":t<=32&&(r="u32"):2===e&&(t<=8?r="s8":t<=16?r="s16":t<=32&&(r="s32")),r}function x(e){let t=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":t=Uint8Array;break;case"u16":t=Uint16Array;break;case"u32":t=Uint32Array;break;case"s8":t=Int8Array;break;case"s16":t=Int16Array;break;case"s32":t=Int32Array;break;default:t=Float32Array}return t}function C(e,t){return{x:t[0]*e.x+t[1]*e.y+t[2],y:t[3]*e.x+t[4]*e.y+t[5]}}function b(e,t){var r;return null==(r=e.get(t))?void 0:r.values}function k(e,t){var r;return null==(r=e.get(t))?void 0:r.values}function v(e,t){var r;return null==(r=e.get(t))?void 0:r.values[0]}function T(e,t){var r;return null==(r=e.get(t))?void 0:r.values[0]}function S(e,t,r,i=0,n=u.Z.TIFF_TAGS,o=4){const a=8===o,s=a?U(new DataView(e,r,8),0,t):new DataView(e,r,2).getUint16(0,t),l=4+2*o,f=a?8:2,h=f+s*l;if(r+h>e.byteLength)return{success:!1,ifd:null,nextIFD:null,requiredBufferSize:h};const c=r+h+4<=e.byteLength?E(new DataView(e,r+h,8===o?8:4),0,t,8===o):null,d=r+f,p=new Map;let m,g,y,w,x,C,b;for(let r=0;r<s;r++){g=new DataView(e,d+l*r,l),y=g.getUint16(0,t),x=g.getUint16(2,t),w=u.Z.getTagName(y,n);const a=[];2===o?(C=g.getUint16(4,t),b=g.getUint16(6,t)):4===o?(C=g.getUint32(4,t),b=g.getUint32(8,t)):8===o&&(C=E(g,4,t,!0),b=E(g,12,t,!0),a.push(g.getUint32(12,t)),a.push(g.getUint32(16,t))),m={id:y,type:x,valueCount:C,valueOffset:b,valueOffsets:a,values:null},M(e,t,m,i,!1,o),p.set(w,m)}return{success:!0,ifd:p,nextIFD:c,requiredBufferSize:h}}const A=function(e,t){return p.decode(e,{inputOffset:t,returnFileInfo:!0}).pixelData},I=function(e,t,r,i,n){var o,a;const s=h.f===t,u=T(r,"BITSPERSAMPLE"),d=w(null!=(o=T(r,"SAMPLEFORMAT"))?o:1,u),p=null!=(a=T(r,"COMPRESSION"))?a:1,m=x(d);let g,y,C,b,k,v,S;if(34887===p)return A(e,i);if(1===p)C=e.slice(i,i+n),b=new Uint8Array(C);else if(8===p||32946===p)b=new Uint8Array(e,i,n),v=new c.Z(b),S=v.getBytes(),C=new ArrayBuffer(S.length),b=new Uint8Array(C),b.set(S);else if(6===p){b=new Uint8Array(e,i,n);const t=new l.J;t.parse(b);const r=t.getData(t.width,t.height,!0);C=new ArrayBuffer(r.length),b=new Uint8Array(C),b.set(r)}else if(7===p){const t=r.get("JPEGTABLES").values,o=t.length-2;b=new Uint8Array(o+n-2);for(let e=0;e<o;e++)b[e]=t[e];const a=new Uint8Array(e,i+2,n-2);for(let e=0;e<a.length;e++)b[o+e]=a[e];const s=new l.J;s.parse(b);const f=s.getData(s.width,s.height,!0);C=new ArrayBuffer(f.length),b=new Uint8Array(C),b.set(f)}else 5===p&&(b=(0,f.J)(e,i,n,t),C=b.buffer);if("u8"===d||"s8"===d||s)y=new m(C);else{switch(C=new ArrayBuffer(b.length),k=new Uint8Array(C),d){case"u16":case"s16":for(g=0;g<b.length;g+=2)k[g]=b[g+1],k[g+1]=b[g];break;case"u32":case"s32":case"f32":for(g=0;g<b.length;g+=4)k[g]=b[g+3],k[g+1]=b[g+2],k[g+2]=b[g+1],k[g+3]=b[g]}y=new m(C)}return y};function M(e,t,r,i=0,n=!1,o=4){if(r.values)return!0;const a=r.type,s=r.valueCount;let l=r.valueOffset,f=[];const u=m[a],h=8*u,c=s*u,d=s*m[a]*8;let p,y;const w=8===o?64:32,x=r.valueOffsets;if(d>w&&c>(n?e.byteLength:e?e.byteLength-l+i:0))return r.offlineOffsetSize=[l,c],r.values=null,!1;if(d<=w){if(!t)if(w<=32)l>>>=32-d;else{const e=null!=x&&x.length?x[0]:l>>>0,t=null!=x&&x.length?x[1]:Math.round((l-e)/g);d<=32?(l=e>>>32-d,x[0]=l):(l=e*2**(32-d)+(t>>>32-d),x[0]=e,x[1]=t>>>32-d)}if(1===s&&h===w)f=[l];else if(64===w){const e=null!=x&&x.length?x[0]:l>>>0,t=null!=x&&x.length?x[1]:Math.round((l-e)/g);let r=e,i=32;for(y=1;y<=s;y++){const e=32-h*y%32;if(i<h){const n=r<<e>>>32-i,o=t<<32-i>>>32-i;r=t,f.push(n+o*2**(h-i)),i-=32-(h-i)}else f.push(r<<e>>>32-h),i-=h;0===i&&(i=32,r=t)}}else for(y=1;y<=s;y++){const e=32-h*y;f.push(l<<e>>>32-h)}}else{l-=i,n&&(l=0);for(let r=l;r<l+c;r+=u){switch(a){case 1:case 2:case 7:p=new DataView(e,r,1).getUint8(0);break;case 3:p=new DataView(e,r,2).getUint16(0,t);break;case 4:case 13:p=new DataView(e,r,4).getUint32(0,t);break;case 5:p=new DataView(e,r,4).getUint32(0,t)/new DataView(e,r+4,4).getUint32(0,t);break;case 6:p=new DataView(e,r,1).getInt8(0);break;case 8:p=new DataView(e,r,2).getInt16(0,t);break;case 9:p=new DataView(e,r,4).getInt32(0,t);break;case 10:p=new DataView(e,r,4).getInt32(0,t)/new DataView(e,r+4,4).getInt32(0,t);break;case 11:p=new DataView(e,r,4).getFloat32(0,t);break;case 12:p=new DataView(e,r,8).getFloat64(0,t);break;case 16:case 18:p=U(new DataView(e,r,8),0,t);break;case 17:p=B(new DataView(e,r,8),0,t);break;default:p=null}f.push(p)}}if(2===a){let e="";const t=f;for(f=[],y=0;y<t.length;y++)0===t[y]&&""!==e?(f.push(e),e=""):e+=String.fromCharCode(t[y]);""===e&&0!==f.length||f.push(e)}return r.values=f,!0}function P(e){var t,r;const i=e[0],n=T(i,"TILEWIDTH"),o=T(i,"TILELENGTH"),a=T(i,"IMAGEWIDTH"),s=T(i,"IMAGELENGTH"),l=T(i,"BITSPERSAMPLE"),f=T(i,"SAMPLESPERPIXEL"),u=null!=(t=T(i,"SAMPLEFORMAT"))?t:1,h=w(u,l),c=D(i),d=b(i,"GDAL_NODATA");let p;null!=d&&d.length&&(p=d.map((e=>parseFloat(e))),p.some((e=>isNaN(e)))&&(p=null));const m=null!=(r=T(i,"COMPRESSION"))?r:1;let g;switch(m){case 1:g="NONE";break;case 2:case 3:case 4:case 32771:g="CCITT";break;case 5:g="LZW";break;case 6:case 7:g="JPEG";break;case 32773:g="PACKBITS";break;case 8:case 32946:g="DEFLATE";break;case 34712:g="JPEG2000";break;case 34887:g="LERC";break;default:g=String(m)}let x=!0,S="";y.has(m)||(x=!1,S+="unsupported tag compression "+m),u>3&&(x=!1,S+="unsupported tag sampleFormat "+u),l%8!=0&&(x=!1,S+="unsupported tag bitsPerSample "+l);const A=v(i,"GEOASCIIPARAMS");let I;if(A){const e=A.split("|").filter((e=>e.indexOf("ESRI PE String = ")>-1))[0],t=e?e.replace("ESRI PE String = ",""):"";I=t.startsWith("COMPD_CS")||t.startsWith("PROJCS")||t.startsWith("GEOGCS")?{wkid:null,wkt:t}:null}const M=k(i,"GEOTIEPOINTS"),P=k(i,"GEOPIXELSCALE"),U=k(i,"GEOTRANSMATRIX"),B=i.has("GEOKEYDIRECTORY")?i.get("GEOKEYDIRECTORY").data:null;let E,L,R=!1;if(B){R=2===T(B,"GTRasterTypeGeoKey");const e=T(B,"GTModelTypeGeoKey");if(2===e){const e=T(B,"GeographicTypeGeoKey");e>=1024&&e<=32766&&(I={wkid:e})}else if(1===e){const e=T(B,"ProjectedCSTypeGeoKey");e>=1024&&e<=32766&&(I={wkid:e})}}if(P&&M&&M.length>=6?(E=[P[0],0,M[3]-M[0]*P[0],0,-Math.abs(P[1]),M[4]-M[1]*P[1]],R&&(E[2]-=.5*E[0]+.5*E[1],E[5]-=.5*E[3]+.5*E[4])):U&&16===U.length&&(E=R?[U[0],U[1],U[3]-.5*U[0],U[4],U[5],U[7]-.5*U[5]]:[U[0],U[1],U[3],U[4],U[5],U[7]]),E){const e=[{x:0,y:s},{x:0,y:0},{x:a,y:s},{x:a,y:0}];let t,r=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY;for(let a=0;a<e.length;a++)t=C(e[a],E),r=t.x>r?r:t.x,n=t.x<n?n:t.x,i=t.y>i?i:t.y,o=t.y<o?o:t.y;L={xmin:r,xmax:n,ymin:i,ymax:o,spatialReference:I}}else L={xmin:-.5,ymin:.5-s,xmax:a-.5,ymax:.5,spatialReference:I};const _=e.filter((e=>1===v(e,"NEWSUBFILETYPE")));let G,V,F,N,z;if(_.length>0){G=Math.round(Math.log(a/T(_[0],"IMAGEWIDTH"))/Math.LN2);const e=_[_.length-1];V=Math.round(Math.log(a/T(e,"IMAGEWIDTH"))/Math.LN2),F=T(e,"TILEWIDTH"),N=T(e,"TILELENGTH")}F=V>0?F||n:null,N=V>0?N||o:null,n&&(z=[{maxCol:Math.ceil(a/n)-1,maxRow:Math.ceil(s/o)-1,minRow:0,minCol:0}],_.forEach((e=>{z.push({maxCol:Math.ceil(T(e,"IMAGEWIDTH")/T(e,"TILEWIDTH"))-1,maxRow:Math.ceil(T(e,"IMAGELENGTH")/T(e,"TILELENGTH"))-1,minRow:0,minCol:0})})));const Z=function(e){if(!e)return null;const t=e.match(/<Item(.*?)Item>/gi);if(!t||0===t.length)return null;const r=new Map;let i,n,o,a,s;for(let e=0;e<t.length;e++)i=t[e],n=i.slice("<Item ".length,i.indexOf(">")),a=i.indexOf("sample="),a>-1&&(s=i.slice(a+'sample="'.length,i.indexOf('"',a+'sample="'.length))),a=i.indexOf("name="),a>-1&&(n=i.slice(a+'name="'.length,i.indexOf('"',a+'name="'.length))),n&&(o=i.slice(i.indexOf(">")+1,i.indexOf("</Item>")).trim(),null!=s?r.has(n)?r.get(n)[s]=o:r.set(n,[o]):r.set(n,o)),s=null;const l=r.get("STATISTICS_MINIMUM"),f=r.get("STATISTICS_MAXIMUM"),u=r.get("STATISTICS_MEAN"),h=r.get("STATISTICS_STDDEV");let c=null;if(l&&f){c=[];for(let e=0;e<l.length;e++)c.push({min:parseFloat(l[e]),max:parseFloat(f[e]),avg:u&&parseFloat(u[e]),stddev:h&&parseFloat(h[e])})}const d=r.get("BandName"),p=r.get("WavelengthMin"),m=r.get("WavelengthMax");let g=null;if(d){g=[];for(let e=0;e<d.length;e++)g.push({BandName:d[e],WavelengthMin:p&&parseFloat(p[e]),WavelengthMax:m&&parseFloat(m[e])})}return{statistics:c,bandProperties:g,dataType:r.get("DataType"),rawMetadata:r}}(v(e[0],"GDAL_METADATA"));return S+=" "+O({width:a,height:s,tileWidth:n,tileHeight:o,planes:f,ifds:e}),{width:a,height:s,tileWidth:n,tileHeight:o,planes:f,isBSQ:c,pixelType:h,compression:g,noData:p,isSupported:x,message:S,extent:L,affine:P?null:E,firstPyramidLevel:G,maximumPyramidLevel:V,pyramidBlockWidth:F,pyramidBlockHeight:N,tileBoundary:z,metadata:Z}}function D(e,t){const r=b(e,"PLANARCONFIGURATION");return r?2===r[0]:!!t&&t.isBSQ}function U(e,t,r){const i=e.getUint32(t,r),n=e.getUint32(t+4,r);return r?n*g+i:i*g+n}function B(e,t,r){let i=r?e.getInt32(t,r):e.getUint32(t,r),n=r?e.getUint32(t+4,r):e.getInt32(t+4,r);const o=(r?i:n)>=0?1:-1;return r?i*=o:n*=o,o*(r?n*g+i:i*g+n)}function E(e,t,r,i){return i?U(e,t,r):e.getUint32(t,r)}function L(e){const t=new DataView(e,0,16),r=t.getUint16(0,!1);let i=null;if(18761===r)i=!0;else{if(19789!==r)throw"unexpected endianess byte";i=!1}const n=t.getUint16(2,i);if(42!==n&&43!==n)throw"unexpected tiff identifier";let o=4;const a=43===n;if(a){const e=t.getUint16(o,i);if(o+=2,8!==e)throw"unsupported bigtiff version";if(0!==t.getUint16(o,i))throw"unsupported bigtiff version";o+=2}return{littleEndian:i,isBigTiff:a,firstIFD:E(t,o,i,a)}}function R(e,t,r,i=0,n=u.Z.TIFF_TAGS,o=4){const a=S(e,t,r,i,n,o);let l;const f=a.ifd;if(f){if(u.Z.ifdTags.forEach(((r,n)=>{f.has(n)&&(l=f.get(n),l.data=S(e,t,l.valueOffset-i,i,r).ifd)})),f.has("GEOKEYDIRECTORY")){l=f.get("GEOKEYDIRECTORY");const r=l.values;if(r&&r.length>4){const n=r[0]+"."+r[1]+"."+r[2];l.data=S(e,t,l.valueOffset+6-i,i,u.Z.GEO_KEYS,2).ifd,l.data&&l.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[n]})}}if(f.has("XMP")){l=f.get("XMP");const e=l.values;"number"==typeof e[0]&&7===l.type&&(l.values=[(0,s.f)(new Uint8Array(e))])}}return a}function O(e){const{width:t,height:r,tileHeight:i,tileWidth:n}=e,o=e.planes,a=n?n*i:t*r,s=T(e.ifds[0],"BITSPERSAMPLE");let l="";return a*o>2**30/(s>8?s/8:1)&&(l=n?"tiled tiff exceeding 1 gigabits per tile is not supported":"scanline tiff exceeding 1 gigabits is not supported"),l}function _(e,t){var r;const{headerInfo:i,ifd:n,offsets:o,sizes:a}=t,s=o.map(((t,r)=>I(e,i.littleEndian,n,t,a[r]||e.byteLength))),l=D(n,i),{pixelType:f,planes:u}=i,h=x(f),c=T(n,"TILEWIDTH"),d=T(n,"TILELENGTH"),p=null!=(r=T(n,"COMPRESSION"))?r:1,m=c*d;let g;const y=[];let w=s[0];const C=34887===p;for(let e=0;e<u;e++){if(g=new h(m),l&&C){w=s[e];for(let t=0;t<m;t++)g[t]=w[e][t+e]}else if(l||C&&!l)g=w.slice(m*e,m*(e+1));else for(let t=0;t<m;t++)g[t]=w[t*u+e];y.push(g)}const b=i.noData?i.noData[0]:null,k=i.metadata?i.metadata.statistics:null,v=k?k.map((e=>e.min)):null,S=k?k.map((e=>e.max)):null;let A,M;if(null!=b)if(A=new Uint8Array(m),Math.abs(b)>1e24)for(M=0;M<m;M++)Math.abs((y[0][M]-b)/b)<1e-6?A[M]=0:A[M]=1;else for(M=0;M<m;M++)y[0][M]===b?A[M]=0:A[M]=1;else v&&S&&t.applyMinMaxConstraint&&(A=function(e,t,r){if(!(e&&e.length>0&&t&&r))return null;let i,n,o;const a=e[0].length,s=e.length,l=new Uint8Array(a);for(let f=0;f<s;f++)if(i=e[f],n=t[f],o=r[f],0===f)for(let e=0;e<a;e++)l[e]=i[e]<n||i[e]>o?0:1;else for(let e=0;e<a;e++)l[e]&&(l[e]=i[e]<n||i[e]>o?0:1);return l}(y,v,S));return{pixelType:f,width:c,height:d,pixels:y,mask:A,noDataValue:b}}function G(e,t=0,r){r=r||function(e){const{littleEndian:t,isBigTiff:r,firstIFD:i}=L(e);let n=i;const o=[];do{const i=R(e,t,n,0,u.Z.TIFF_TAGS,r?8:4);if(!i.success)break;o.push(i.ifd),n=i.nextIFD}while(n>0);return{...P(o),littleEndian:t,isBigTiff:r,ifds:o}}(e);const{ifds:i,noData:n}=r;if(0===i.length)throw"no valid image file directory";const o=O(r);if(o)throw o;let a,s;const d=-1===t?i[i.length-1]:i[t],p=n?n[0]:null;if(s=r.tileWidth?function(e,t,r){var i;const n=k(r,"TILEOFFSETS");if(void 0===n)return null;const o=k(r,"TILEBYTECOUNTS"),{width:a,height:s,pixelType:l,tileWidth:f,tileHeight:u}=P([r]),h=D(r,t),c=t.planes,d=a*s,p=T(r,"BITSPERSAMPLE"),m=34887===(null!=(i=T(r,"COMPRESSION"))?i:1),g=x(l),y=[];for(let e=0;e<c;e++)y.push(new g(d));let w,C,b,v,S,A,M,U,B,E,L,R,O;const _=Math.ceil(a/f);if(p%8==0)if(m&&h&&c>1){const i=Math.round(n.length/c);for(w=0;w<i;w++){A=Math.floor(w/_)*u,M=w%_*f,U=A*a+M;for(let i=0;i<c;i++){const l=w*c+i;for(b=I(e,t.littleEndian,r,n[l],o[l]),E=0,B=U,R=Math.min(f,a-M),L=Math.min(u,s-A),O=y[i],v=0;v<L;v++)for(B=U+v*a,E=v*f,S=0;S<R;S++,B++,E++)O[B]=b[E]}}}else for(w=0;w<n.length;w++)for(A=Math.floor(w/_)*u,M=w%_*f,U=A*a+M,b=I(e,t.littleEndian,r,n[w],o[w]),E=0,B=U,R=Math.min(f,a-M),L=Math.min(u,s-A),C=0;C<c;C++)if(O=y[C],h||m)for(v=0;v<L;v++)for(B=U+v*a,E=f*u*C+v*f,S=0;S<R;S++,B++,E++)O[B]=b[E];else for(v=0;v<L;v++)for(B=U+v*a,E=v*f*c+C,S=0;S<R;S++,B++,E+=c)O[B]=b[E];return{width:a,height:s,pixelType:l,pixels:y}}(e,r,d):function(e,t,r){var i;const n=h.f===t.littleEndian,o=k(r,"STRIPOFFSETS");if(void 0===o)return null;const{width:a,height:s,pixelType:u}=P([r]),d=t.planes,p=a*s,m=T(r,"BITSPERSAMPLE"),g=x(u),y=new g(p*d),w=k(r,"STRIPBYTECOUNTS"),C=T(r,"ROWSPERSTRIP"),b=null!=(i=T(r,"COMPRESSION"))?i:1;let v,S,A,I,M,D,U,B,E,L,R,O=C;if(m%8==0)for(v=0;v<o.length;v++){if(M=v*(C*a)*d,O=(v+1)*C>s?s-v*C:C,"u8"===u||"s8"===u||n){if(8===b||32946===b)U=new Uint8Array(e,o[v],w[v]),L=new c.Z(U),R=L.getBytes(),D=new ArrayBuffer(R.length),U=new Uint8Array(D),U.set(R),U.length!==O*a*d*m/8&&console.log("strip byte counts is different than expected");else if(6===b){U=new Uint8Array(e,o[v],w[v]);const t=new l.J;t.parse(U);const r=t.getData(t.width,t.height,!0);D=new ArrayBuffer(r.length),U=new Uint8Array(D),U.set(r)}else 5===b?(U=(0,f.J)(e,o[v],w[v],t.littleEndian),D=U.buffer):1===b&&(w[v]!==O*a*d*m/8&&console.log("strip byte counts is different than expected"),D=e.slice(o[v],o[v]+w[v]));I=new g(D)}else{switch(6===b||8===b||32946===b?(U=new Uint8Array(e,o[v],w[v]),L=new c.Z(U),U=L.getBytes(),D=new ArrayBuffer(U.length),B=new Uint8Array(D),U.length!==O*a*d*m/8&&console.log("strip byte counts is different than expected")):1===b&&(w[v]!==O*a*d*m/8&&console.log("strip byte counts is different than expected"),D=new ArrayBuffer(w[v]),U=new Uint8Array(e,o[v],w[v]),B=new Uint8Array(D)),u){case"u16":case"s16":for(A=0;A<U.length;A+=2)B[A]=U[A+1],B[A+1]=U[A];break;case"u32":case"s32":case"f32":for(A=0;A<U.length;A+=4)B[A]=U[A+3],B[A+1]=U[A+2],B[A+2]=U[A+1],B[A+3]=U[A]}I=new g(D)}y.set(I,M)}const _=[];if(1===d)_.push(y);else for(v=0;v<d;v++){for(E=new g(p),S=0;S<p;S++)E[S]=y[S*d+v];_.push(E)}return{width:a,height:s,pixelType:u,pixels:_}}(e,r,d),null!==p){if(s.mask=new Uint8Array(s.width*s.height),Math.abs(p)>1e24)for(a=0;a<s.width*s.height;a++)Math.abs((s.pixels[0][a]-p)/p)<1e-6?s.mask[a]=0:s.mask[a]=1;else for(a=0;a<s.width*s.height;a++)s.pixels[0][a]===p?s.mask[a]=0:s.mask[a]=1;s.noDataValue=p}return s}},80899:(e,t,r)=>{r.d(t,{Z:()=>s});var i,n,o,a={exports:{}};n=a,void 0!==(i=function(){function e(){this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=null}return e.prototype={ensureBuffer:function(e){var t=this.buffer,r=t?t.byteLength:0;if(e<r)return t;for(var i=512;i<e;)i<<=1;for(var n=new Uint8Array(i),o=0;o<r;++o)n[o]=t[o];return this.buffer=n},getByte:function(){for(var e=this.pos;this.bufferLength<=e;){if(this.eof)return null;this.readBlock()}return this.buffer[this.pos++]},getBytes:function(e){var t=this.pos;if(e){this.ensureBuffer(t+e);for(var r=t+e;!this.eof&&this.bufferLength<r;)this.readBlock();var i=this.bufferLength;r>i&&(r=i)}else{for(;!this.eof;)this.readBlock();r=this.bufferLength}return this.pos=r,this.buffer.subarray(t,r)},lookChar:function(){for(var e=this.pos;this.bufferLength<=e;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var e=this.pos;this.bufferLength<=e;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(e,t,r){for(var i=e+t;this.bufferLength<=i&&!this.eof;)this.readBlock();return new Stream(this.buffer,e,t,r)},skip:function(e){e||(e=1),this.pos+=e},reset:function(){this.pos=0}},e}(),o=function(){if(!self||!self.Uint32Array)return null;var e=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),t=new Uint32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),r=new Uint32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),n=[new Uint32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],o=[new Uint32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];function a(e){throw new Error(e)}function s(e){var t=0,r=e[t++],n=e[t++];-1!=r&&-1!=n||a("Invalid header in flate stream"),8!=(15&r)&&a("Unknown compression method in flate stream"),((r<<8)+n)%31!=0&&a("Bad FCHECK in flate stream"),32&n&&a("FDICT bit set in flate stream"),this.bytes=e,this.bytesPos=2,this.codeSize=0,this.codeBuf=0,i.call(this)}return s.prototype=Object.create(i.prototype),s.prototype.getBits=function(e){for(var t,r=this.codeSize,i=this.codeBuf,n=this.bytes,o=this.bytesPos;r<e;)void 0===(t=n[o++])&&a("Bad encoding in flate stream"),i|=t<<r,r+=8;return t=i&(1<<e)-1,this.codeBuf=i>>e,this.codeSize=r-=e,this.bytesPos=o,t},s.prototype.getCode=function(e){for(var t=e[0],r=e[1],i=this.codeSize,n=this.codeBuf,o=this.bytes,s=this.bytesPos;i<r;){var l;void 0===(l=o[s++])&&a("Bad encoding in flate stream"),n|=l<<i,i+=8}var f=t[n&(1<<r)-1],u=f>>16,h=65535&f;return(0==i||i<u||0==u)&&a("Bad encoding in flate stream"),this.codeBuf=n>>u,this.codeSize=i-u,this.bytesPos=s,h},s.prototype.generateHuffmanTable=function(e){for(var t=e.length,r=0,i=0;i<t;++i)e[i]>r&&(r=e[i]);for(var n=1<<r,o=new Uint32Array(n),a=1,s=0,l=2;a<=r;++a,s<<=1,l<<=1)for(var f=0;f<t;++f)if(e[f]==a){var u=0,h=s;for(i=0;i<a;++i)u=u<<1|1&h,h>>=1;for(i=u;i<n;i+=l)o[i]=a<<16|f;++s}return[o,r]},s.prototype.readBlock=function(){function i(e,t,r,i,n){for(var o=e.getBits(r)+i;o-- >0;)t[p++]=n}var s=this.getBits(3);if(1&s&&(this.eof=!0),0!=(s>>=1)){var l,f;if(1==s)l=n,f=o;else if(2==s){for(var u=this.getBits(5)+257,h=this.getBits(5)+1,c=this.getBits(4)+4,d=Array(e.length),p=0;p<c;)d[e[p++]]=this.getBits(3);for(var m=this.generateHuffmanTable(d),g=0,y=(p=0,u+h),w=new Array(y);p<y;){var x=this.getCode(m);16==x?i(this,w,2,3,g):17==x?i(this,w,3,3,g=0):18==x?i(this,w,7,11,g=0):w[p++]=g=x}l=this.generateHuffmanTable(w.slice(0,u)),f=this.generateHuffmanTable(w.slice(u,y))}else a("Unknown block type in flate stream");for(var C=(B=this.buffer)?B.length:0,b=this.bufferLength;;){var k=this.getCode(l);if(k<256)b+1>=C&&(C=(B=this.ensureBuffer(b+1)).length),B[b++]=k;else{if(256==k)return void(this.bufferLength=b);var v=(k=t[k-=257])>>16;v>0&&(v=this.getBits(v)),g=(65535&k)+v,k=this.getCode(f),(v=(k=r[k])>>16)>0&&(v=this.getBits(v));var T=(65535&k)+v;b+g>=C&&(C=(B=this.ensureBuffer(b+g)).length);for(var S=0;S<g;++S,++b)B[b]=B[b-T]}}}else{var A,I=this.bytes,M=this.bytesPos;void 0===(A=I[M++])&&a("Bad block header in flate stream");var P=A;void 0===(A=I[M++])&&a("Bad block header in flate stream"),P|=A<<8,void 0===(A=I[M++])&&a("Bad block header in flate stream");var D=A;void 0===(A=I[M++])&&a("Bad block header in flate stream"),(D|=A<<8)!=(65535&~P)&&a("Bad uncompressed block length in flate stream"),this.codeBuf=0,this.codeSize=0;var U=this.bufferLength,B=this.ensureBuffer(U+P),E=U+P;this.bufferLength=E;for(var L=U;L<E;++L){if(void 0===(A=I[M++])){this.eof=!0;break}B[L]=A}this.bytesPos=M}},s}())&&(n.exports=o);const s=a.exports},3892:(e,t,r)=>{function i(e){return"h"in e&&"s"in e&&"v"in e}function n(e){return"l"in e&&"a"in e&&"b"in e}function o(e){return"l"in e&&"c"in e&&"h"in e}r.d(t,{_Y:()=>p,Y3:()=>m,sJ:()=>g,xr:()=>d});const a=[[.4124,.3576,.1805],[.2126,.7152,.0722],[.0193,.1192,.9505]],s=[[3.2406,-1.5372,-.4986],[-.9689,1.8758,.0415],[.0557,-.204,1.057]];function l(e,t){const r=[];let i,n;if(e[0].length!==t.length)throw"dimensions do not match";const o=e.length,a=e[0].length;let s=0;for(i=0;i<o;i++){for(s=0,n=0;n<a;n++)s+=e[i][n]*t[n];r.push(s)}return r}function f(e){const t=[e.r/255,e.g/255,e.b/255].map((e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4)),r=l(a,t);return{x:100*r[0],y:100*r[1],z:100*r[2]}}function u(e){const t=l(s,[e.x/100,e.y/100,e.z/100]).map((e=>{const t=e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055;return Math.min(1,Math.max(t,0))}));return{r:Math.round(255*t[0]),g:Math.round(255*t[1]),b:Math.round(255*t[2])}}function h(e){const t=[e.x/95.047,e.y/100,e.z/108.883].map((e=>e>(6/29)**3?e**(1/3):1/3*(29/6)**2*e+4/29));return{l:116*t[1]-16,a:500*(t[0]-t[1]),b:200*(t[1]-t[2])}}function c(e){const t=e.l,r=[(t+16)/116+e.a/500,(t+16)/116,(t+16)/116-e.b/200].map((e=>e>6/29?e**3:3*(6/29)**2*(e-4/29)));return{x:95.047*r[0],y:100*r[1],z:108.883*r[2]}}function d(e){return"r"in(t=e)&&"g"in t&&"b"in t?e:o(e)?function(e){return u(c(function(e){const t=e.l,r=e.c,i=e.h;return{l:t,a:r*Math.cos(i),b:r*Math.sin(i)}}(e)))}(e):n(e)?function(e){return u(c(e))}(e):function(e){return"x"in e&&"y"in e&&"z"in e}(e)?u(e):i(e)?function(e){const t=(e.h+360)%360/60,r=e.s/100,i=e.v/100*255,n=i*r,o=n*(1-Math.abs(t%2-1));let a;switch(Math.floor(t)){case 0:a={r:n,g:o,b:0};break;case 1:a={r:o,g:n,b:0};break;case 2:a={r:0,g:n,b:o};break;case 3:a={r:0,g:o,b:n};break;case 4:a={r:o,g:0,b:n};break;case 5:case 6:a={r:n,g:0,b:o};break;default:a={r:0,g:0,b:0}}return a.r=Math.round(a.r+i-n),a.g=Math.round(a.g+i-n),a.b=Math.round(a.b+i-n),a}(e):e;var t}function p(e){return i(e)?e:function(e){const t=e.r,r=e.g,i=e.b,n=Math.max(t,r,i),o=n-Math.min(t,r,i);let a=n,s=0===o?0:n===t?(r-i)/o%6:n===r?(i-t)/o+2:(t-r)/o+4,l=0===o?0:o/a;return s<0&&(s+=6),s*=60,l*=100,a*=100/255,{h:s,s:l,v:a}}(d(e))}function m(e){return n(e)?e:function(e){return h(f(e))}(d(e))}function g(e){return o(e)?e:function(e){return function(e){const t=e.l,r=e.a,i=e.b,n=Math.sqrt(r*r+i*i);let o=Math.atan2(i,r);return o=o>0?o:o+2*Math.PI,{l:t,c:n,h:o}}(h(f(e)))}(d(e))}},54163:(e,t,r)=>{r.d(t,{Z:()=>m});var i,n=r(43697),o=(r(80442),r(20102)),a=r(10736),s=r(22974),l=r(92604),f=r(70586),u=r(5600),h=r(90578),c=r(52011);const d=l.Z.getLogger("esri.layers.support.PixelBlock");let p=i=class extends a.wq{constructor(e){super(e),this.width=null,this.height=null,this.pixelType="f32",this.validPixelCount=null,this.mask=null,this.maskIsAlpha=!1,this.pixels=null,this.statistics=null}static createEmptyBand(e,t){return new(i.getPixelArrayConstructor(e))(t)}static getPixelArrayConstructor(e){let t;switch(e){case"u1":case"u2":case"u4":case"u8":t=Uint8Array;break;case"u16":t=Uint16Array;break;case"u32":case"u32":t=Uint32Array;break;case"s8":t=Int8Array;break;case"s16":t=Int16Array;break;case"s32":t=Int32Array;break;case"f32":case"c64":case"c128":case"unknown":t=Float32Array;break;case"f64":t=Float64Array}return t}castPixelType(e){if(!e)return"f32";let t=e.toLowerCase();return["u1","u2","u4"].indexOf(t)>-1?t="u8":-1===["unknown","u8","s8","u16","s16","u32","s32","f32","f64"].indexOf(t)&&(t="f32"),t}getPlaneCount(){return this.pixels&&this.pixels.length}addData(e){if(!e.pixels||e.pixels.length!==this.width*this.height)throw new o.Z("pixelblock:invalid-or-missing-pixels","add data requires valid pixels array that has same length defined by pixel block width * height");this.pixels||(this.pixels=[]),this.statistics||(this.statistics=[]),this.pixels.push(e.pixels),this.statistics.push(e.statistics||{minValue:null,maxValue:null})}getAsRGBA(){const e=new ArrayBuffer(this.width*this.height*4);switch(this.pixelType){case"s8":case"s16":case"u16":case"s32":case"u32":case"f32":case"f64":this._fillFromNon8Bit(e);break;default:this._fillFrom8Bit(e)}return new Uint8ClampedArray(e)}getAsRGBAFloat(){const e=new Float32Array(this.width*this.height*4);return this._fillFrom32Bit(e),e}updateStatistics(){this.statistics=this.pixels.map((e=>this._calculateBandStatistics(e,this.mask)));const e=this.mask;let t=0;if(e)for(let r=0;r<e.length;r++)e[r]&&t++;else t=this.width*this.height;this.validPixelCount=t}clamp(e){if(!e||"f64"===e||"f32"===e)return;let t;switch(e){case"u8":t=[0,255];break;case"u16":t=[0,65535];break;case"u32":t=[0,4294967295];break;case"s8":t=[-128,127];break;case"s16":t=[-32768,32767];break;case"s32":t=[-2147483648,2147483647];break;default:t=[-34e38,34e38]}const[r,n]=t,o=this.pixels,a=this.width*this.height,s=o.length;let l,f,u;const h=[];for(let t=0;t<s;t++){u=i.createEmptyBand(e,a),l=o[t];for(let e=0;e<a;e++)f=l[e],u[e]=f>n?n:f<r?r:f;h.push(u)}this.pixels=h,this.pixelType=e}extractBands(e){if((0,f.Wi)(e)||0===e.length||null==this.pixels||0===this.pixels.length)return this;const t=this.pixels.length,r=e.some((e=>e>=this.pixels.length)),n=t===e.length&&!e.some(((e,t)=>e!==t));return r||n?this:new i({pixelType:this.pixelType,width:this.width,height:this.height,mask:this.mask,validPixelCount:this.validPixelCount,maskIsAlpha:this.maskIsAlpha,pixels:e.map((e=>this.pixels[e])),statistics:this.statistics&&e.map((e=>this.statistics[e]))})}clone(){const e=new i({width:this.width,height:this.height,pixelType:this.pixelType,maskIsAlpha:this.maskIsAlpha,validPixelCount:this.validPixelCount});let t;this.mask&&(this.mask instanceof Uint8Array?e.mask=new Uint8Array(this.mask):e.mask=this.mask.slice(0));const r=i.getPixelArrayConstructor(this.pixelType);if(this.pixels&&this.pixels.length>0){e.pixels=[];const i=this.pixels[0].slice;for(t=0;t<this.pixels.length;t++)e.pixels[t]=i?this.pixels[t].slice(0,this.pixels[t].length):new r(this.pixels[t])}if(this.statistics)for(e.statistics=[],t=0;t<this.statistics.length;t++)e.statistics[t]=(0,s.d9)(this.statistics[t]);return e}_fillFrom8Bit(e){const{mask:t,maskIsAlpha:r,pixels:i}=this;if(!e||!i||!i.length)return void d.error("getAsRGBA()","Unable to convert to RGBA. The input pixel block is empty.");let n,o,a,s;n=o=a=i[0],i.length>=3?(o=i[1],a=i[2]):2===i.length&&(o=i[1]);const l=new Uint32Array(e),f=this.width*this.height;if(n.length===f)if(t&&t.length===f)if(r)for(s=0;s<f;s++)t[s]&&(l[s]=t[s]<<24|a[s]<<16|o[s]<<8|n[s]);else for(s=0;s<f;s++)t[s]&&(l[s]=255<<24|a[s]<<16|o[s]<<8|n[s]);else for(s=0;s<f;s++)l[s]=255<<24|a[s]<<16|o[s]<<8|n[s];else d.error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.")}_fillFromNon8Bit(e){const{pixels:t,mask:r,statistics:i}=this;if(!e||!t||!t.length)return void d.error("getAsRGBA()","Unable to convert to RGBA. The input pixel block is empty.");const n=this.pixelType;let o=1,a=0,s=1;if(i&&i.length>0)a=i.map((e=>e.minValue)).reduce(((e,t)=>Math.min(e,t))),s=i.map((e=>e.maxValue-e.minValue)).reduce(((e,t)=>Math.max(e,t))),o=255/s;else{let e=255;"s8"===n?(a=-128,e=127):"u16"===n?e=65535:"s16"===n?(a=-32768,e=32767):"u32"===n?e=4294967295:"s32"===n?(a=-2147483648,e=2147483647):"f32"===n?(a=-34e38,e=34e38):"f64"===n&&(a=-Number.MAX_VALUE,e=Number.MAX_VALUE),o=255/(e-a)}const l=new Uint32Array(e),f=this.width*this.height;let u,h,c,p,m;if(u=h=c=t[0],u.length!==f)return d.error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.");if(t.length>=2)if(h=t[1],t.length>=3&&(c=t[2]),r&&r.length===f)for(p=0;p<f;p++)r[p]&&(l[p]=255<<24|(c[p]-a)*o<<16|(h[p]-a)*o<<8|(u[p]-a)*o);else for(p=0;p<f;p++)l[p]=255<<24|(c[p]-a)*o<<16|(h[p]-a)*o<<8|(u[p]-a)*o;else if(r&&r.length===f)for(p=0;p<f;p++)m=(u[p]-a)*o,r[p]&&(l[p]=255<<24|m<<16|m<<8|m);else for(p=0;p<f;p++)m=(u[p]-a)*o,l[p]=255<<24|m<<16|m<<8|m}_fillFrom32Bit(e){const{pixels:t,mask:r}=this;if(!e||!t||!t.length)return d.error("getAsRGBAFloat()","Unable to convert to RGBA. The input pixel block is empty.");let i,n,o,a;i=n=o=t[0],t.length>=3?(n=t[1],o=t[2]):2===t.length&&(n=t[1]);const s=this.width*this.height;if(i.length!==s)return d.error("getAsRGBAFloat()","Unable to convert to RGBA. The pixelblock is invalid.");let l=0;if(r&&r.length===s)for(a=0;a<s;a++)e[l++]=i[a],e[l++]=n[a],e[l++]=o[a],e[l++]=1&r[a];else for(a=0;a<s;a++)e[l++]=i[a],e[l++]=n[a],e[l++]=o[a],e[l++]=1}_calculateBandStatistics(e,t){let r=1/0,i=-1/0;const n=e.length;let o,a=0;if(t)for(o=0;o<n;o++)t[o]&&(a=e[o],r=a<r?a:r,i=a>i?a:i);else for(o=0;o<n;o++)a=e[o],r=a<r?a:r,i=a>i?a:i;return{minValue:r,maxValue:i}}};(0,n._)([(0,u.Cb)({json:{write:!0}})],p.prototype,"width",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],p.prototype,"height",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],p.prototype,"pixelType",void 0),(0,n._)([(0,h.p)("pixelType")],p.prototype,"castPixelType",null),(0,n._)([(0,u.Cb)({json:{write:!0}})],p.prototype,"validPixelCount",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],p.prototype,"mask",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],p.prototype,"maskIsAlpha",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],p.prototype,"pixels",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],p.prototype,"statistics",void 0),p=i=(0,n._)([(0,c.j)("esri.layers.support.PixelBlock")],p);const m=p},48526:(e,t,r)=>{r.d(t,{Z:()=>c});var i=r(43697),n=r(10736),o=r(70586),a=r(5600),s=(r(67676),r(80442),r(75215),r(52011)),l=r(6570),f=r(82971),u=r(36679);let h=class extends n.wq{constructor(e){super(e),this.attributeTable=null,this.bandCount=null,this.colormap=null,this.extent=null,this.format=void 0,this.height=null,this.width=null,this.histograms=null,this.keyProperties={},this.multidimensionalInfo=null,this.noDataValue=null,this.pixelSize=null,this.pixelType=null,this.isPseudoSpatialReference=!1,this.spatialReference=null,this.statistics=null,this.storageInfo=null,this.transform=null}get dataType(){var e,t,r;const i=null!=(e=null==(t=this.keyProperties)||null==(r=t.DataType)?void 0:r.toLowerCase())?e:"generic";return"stdtime"===i?"standard-time":i}get nativeExtent(){return this._get("nativeExtent")||this.extent}set nativeExtent(e){e&&this._set("nativeExtent",e)}get nativePixelSize(){if(!(0,o.pC)(this.transform)||!this.transform.affectsPixelSize)return this.pixelSize;const e=this.nativeExtent;return{x:e.width/this.width,y:e.height/this.height}}};(0,i._)([(0,a.Cb)({json:{write:!0}})],h.prototype,"attributeTable",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],h.prototype,"bandCount",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],h.prototype,"colormap",void 0),(0,i._)([(0,a.Cb)({type:String,readOnly:!0})],h.prototype,"dataType",null),(0,i._)([(0,a.Cb)({type:l.Z,json:{write:!0}})],h.prototype,"extent",void 0),(0,i._)([(0,a.Cb)({type:l.Z,json:{write:!0}})],h.prototype,"nativeExtent",null),(0,i._)([(0,a.Cb)({json:{write:!0}})],h.prototype,"nativePixelSize",null),(0,i._)([(0,a.Cb)({json:{write:!0}})],h.prototype,"format",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],h.prototype,"height",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],h.prototype,"width",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],h.prototype,"histograms",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],h.prototype,"keyProperties",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],h.prototype,"multidimensionalInfo",void 0),(0,i._)([(0,a.Cb)()],h.prototype,"noDataValue",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],h.prototype,"pixelSize",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],h.prototype,"pixelType",void 0),(0,i._)([(0,a.Cb)()],h.prototype,"isPseudoSpatialReference",void 0),(0,i._)([(0,a.Cb)({type:f.Z,json:{write:!0}})],h.prototype,"spatialReference",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],h.prototype,"statistics",void 0),(0,i._)([(0,a.Cb)({type:u.Z,json:{write:!0}})],h.prototype,"storageInfo",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],h.prototype,"transform",void 0),h=(0,i._)([(0,s.j)("esri.layers.support.RasterInfo")],h);const c=h},36679:(e,t,r)=>{r.d(t,{Z:()=>f});var i=r(43697),n=r(10736),o=r(5600),a=(r(67676),r(80442),r(75215),r(52011)),s=r(13473);let l=class extends n.wq{constructor(){super(...arguments),this.blockWidth=void 0,this.blockHeight=void 0,this.compression=null,this.origin=null,this.firstPyramidLevel=null,this.maximumPyramidLevel=null,this.pyramidScalingFactor=2,this.pyramidBlockWidth=null,this.pyramidBlockHeight=null,this.isVirtualTileInfo=!1,this.tileInfo=null,this.blockBoundary=null}};(0,i._)([(0,o.Cb)({type:Number,json:{write:!0}})],l.prototype,"blockWidth",void 0),(0,i._)([(0,o.Cb)({type:Number,json:{write:!0}})],l.prototype,"blockHeight",void 0),(0,i._)([(0,o.Cb)({type:String,json:{write:!0}})],l.prototype,"compression",void 0),(0,i._)([(0,o.Cb)({type:s.Z,json:{write:!0}})],l.prototype,"origin",void 0),(0,i._)([(0,o.Cb)({type:Number,json:{write:!0}})],l.prototype,"firstPyramidLevel",void 0),(0,i._)([(0,o.Cb)({type:Number,json:{write:!0}})],l.prototype,"maximumPyramidLevel",void 0),(0,i._)([(0,o.Cb)({json:{write:!0}})],l.prototype,"pyramidResolutions",void 0),(0,i._)([(0,o.Cb)({type:Number,json:{write:!0}})],l.prototype,"pyramidScalingFactor",void 0),(0,i._)([(0,o.Cb)({type:Number,json:{write:!0}})],l.prototype,"pyramidBlockWidth",void 0),(0,i._)([(0,o.Cb)({type:Number,json:{write:!0}})],l.prototype,"pyramidBlockHeight",void 0),(0,i._)([(0,o.Cb)({type:Boolean,json:{write:!0}})],l.prototype,"isVirtualTileInfo",void 0),(0,i._)([(0,o.Cb)({json:{write:!0}})],l.prototype,"tileInfo",void 0),(0,i._)([(0,o.Cb)()],l.prototype,"blockBoundary",void 0),l=(0,i._)([(0,a.j)("esri.layers.support.RasterStorageInfo")],l);const f=l},20095:(e,t,r)=>{function i(e,t){let r=0,i="",n=0,o=0;const a=e.length;for(;r<a;)o=e[r++],n=o>>4,n<8?n=1:15===n?(n=4,o=(7&o)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++]):14===n?(n=3,o=(15&o)<<12|(63&e[r++])<<6|63&e[r++]):(n=2,o=(31&o)<<6|63&e[r++]),(0!==o||t)&&(i+=String.fromCharCode(o));return i}r.d(t,{f:()=>i})},88781:(e,t,r)=>{function i(){const e=[];for(let t=0;t<=257;t++)e[t]=[t];return e}function n(e,t){for(let r=0;r<t.length;r++)e.push(t[r])}r.d(t,{J:()=>a});const o=new Set;function a(e,t,r,a=!0){const s=function(e,t,r,i=!0){if(t%4!=0||r%4!=0){const n=new ArrayBuffer(4*Math.ceil(r/4)),o=new Uint8Array(n),a=new Uint8Array(e,t,r);if(i)for(let e=0;e<o.length;e+=4)o[e]=a[e+3],o[e+1]=a[e+2],o[e+2]=a[e+1],o[e+3]=a[e];else o.set(a);return new Uint32Array(o.buffer)}if(i){const i=new Uint8Array(e,t,r),n=new Uint8Array(i.length);for(let e=0;e<n.length;e+=4)n[e]=i[e+3],n[e+1]=i[e+2],n[e+2]=i[e+1],n[e+3]=i[e];return new Uint32Array(n.buffer)}return new Uint32Array(e,t,r/4)}(e,t,r,a);let l=9,f=i(),u=32,h=f.length,c=[],d=1,p=s[0],m=0;const g=s.length,y=8*(4*g-r),w=[];for(;null!=p;){if(u>=l)u-=l,m=p>>>32-l,p<<=l;else{m=p>>>32-u,p=s[d++];const e=l-u;u=32-e,m=(m<<e)+(p>>>u),p<<=e}if(257===m)break;if(256===m){l=9,f=i(),h=f.length,c=[];continue}const e=f[m];if(null==e){if(m>f.length)throw"data integrity issue: code does not exist on code page";c.push(c[0]),f[h++]=c.slice(),n(w,c)}else n(w,e),c.push(e[0]),c.length>1&&(f[h++]=c.slice()),c=e.slice();if(o.has(h)&&l++,0===u&&(p=s[d++],u=32),d>g||d===g&&u<=y)break}return new Uint8Array(w)}o.add(511),o.add(1023),o.add(2047),o.add(4095),o.add(8191)},75993:(e,t,r)=>{r.d(t,{Jx:()=>D,y6:()=>P});var i=r(20102),n=r(54163),o=r(95330),a=r(80899);class s{constructor(e){e&&(this.canvas=e.canvas,this.ctx=e.ctx||e.canvas&&e.canvas.getContext("2d"))}decode(e,t,r){if(!e||e.byteLength<10)throw new i.Z("imagecanvasdecoder: decode","required a valid encoded data as input.");let{width:n,height:a,format:l}=t;const{applyJpegMask:f}=t;if(f&&(!n||!a))throw new i.Z("imagecanvasdecoder: decode","image width and height are needed to apply jpeg mask directly to canvas");return new Promise(((i,u)=>{let h=null;"jpg"===l&&f&&(h=s.getMask(e,{width:n,height:a}));const c=new Blob([new Uint8Array(e)],{type:"image/"+l=="jpg"?"jpeg":l}),d=URL.createObjectURL(c),p=new Image;let m;p.src=d,p.onload=()=>{if(URL.revokeObjectURL(d),(0,o.Hc)(r))return void u((0,o.zE)());n=p.width,a=p.height,this.canvas?(this.canvas.width===n&&this.canvas.height===a||(this.canvas.width=n,this.canvas.height=a),this.ctx.clearRect(0,0,n,a)):(this.canvas=document.createElement("canvas"),this.canvas.width=n,this.canvas.height=a,this.ctx=this.canvas.getContext("2d")),this.ctx.drawImage(p,0,0);const e=this.ctx.getImageData(0,0,n,a);let s;if(m=e.data,t.renderOnCanvas){if(h)for(s=0;s<h.length;s++)h[s]?m[4*s+3]=255:m[4*s+3]=0;return this.ctx.putImageData(e,0,0),void i(null)}const l=n*a,f=new Uint8Array(l),c=new Uint8Array(l),g=new Uint8Array(l);if(h)for(s=0;s<l;s++)f[s]=m[4*s],c[s]=m[4*s+1],g[s]=m[4*s+2];else for(h=new Uint8Array(l),s=0;s<l;s++)f[s]=m[4*s],c[s]=m[4*s+1],g[s]=m[4*s+2],h[s]=m[4*s+3];i({width:n,height:a,pixels:[f,c,g],mask:h,pixelType:"u8"})},p.onerror=()=>{URL.revokeObjectURL(d),u("cannot load image")}}))}static getMask(e,t){let r=null;try{const i=new Uint8Array(e),n=Math.ceil(i.length/2);let o=0;const s=i.length-2;for(o=n;o<s&&(255!==i[o]||217!==i[o+1]);o++);if(o+=2,o<i.length-1){const e=new a.Z(i.subarray(o)).getBytes();r=new Uint8Array(t.width*t.height);let n=0;for(let t=0;t<e.length;t++)for(let i=7;i>=0;i--)r[n++]=e[t]>>i&1}}catch(e){}return r}}var l=r(97575),f=r(29825),u=r(32321),h=r(88781);const c=function(e,t){const r=t.width*t.height,i=t.pixelType;return Math.floor(e.byteLength/(r*d(i)))},d=function(e){let t=1;switch(e){case Uint8Array:case Int8Array:t=1;break;case Uint16Array:case Int16Array:t=2;break;case Uint32Array:case Int32Array:case Float32Array:t=4;break;case Float64Array:t=8}return t};class p{static decode(e,t){const r=t.pixelType,i=[],n=t.width*t.height,o=c(e,t),{bandIds:a,format:s}=t,l=a&&a.length||c(e,t),f=e.byteLength-e.byteLength%(n*d(r)),u=new r(e,0,n*o);let h,p,m,g,y;if("bip"===s)for(h=0;h<l;h++){for(g=new r(n),y=a?a[h]:h,p=0;p<n;p++)g[p]=u[p*o+y];i.push(g)}else if("bsq"===s)for(h=0;h<l;h++)y=a?a[h]:h,i.push(u.subarray(y*n,(y+1)*n));return f<e.byteLength-1&&(m=function(e,t){if(8*e.byteLength<t)return null;const r=new Uint8Array(e,0,Math.ceil(t/8)),i=new Uint8Array(t);let n=0,o=0,a=0,s=0;for(a=0;a<r.length-1;a++)for(o=r[a],s=7;s>=0;s--)i[n++]=o>>s&1;for(s=7;n<t-1;)o=r[r.length-1],i[n++]=o>>s&1,s--;return i}(e.slice(f),n)),{pixels:i,mask:m}}}var m=r(48279),g=function(e){var t,r,i;function n(e){var t,r,i,n,o,a,s,l,f,u,h,c,d;for(this.data=e,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},o=null;;){switch(t=this.readUInt32(),l=function(){var e,t;for(t=[],e=0;e<4;++e)t.push(String.fromCharCode(this.data[this.pos++]));return t}.call(this).join(""),l){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(t);break;case"fcTL":o&&this.animation.frames.push(o),this.pos+=4,o={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},n=this.readUInt16(),i=this.readUInt16()||100,o.delay=1e3*n/i,o.disposeOp=this.data[this.pos++],o.blendOp=this.data[this.pos++],o.data=[];break;case"IDAT":case"fdAT":for("fdAT"===l&&(this.pos+=4,t-=4),e=(null!=o?o.data:void 0)||this.imgData,h=0;0<=t?h<t:h>t;0<=t?++h:--h)e.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(this.transparency.indexed=this.read(t),(f=255-this.transparency.indexed.length)>0)for(c=0;0<=f?c<f:c>f;0<=f?++c:--c)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(t)[0];break;case 2:this.transparency.rgb=this.read(t)}break;case"tEXt":a=(u=this.read(t)).indexOf(0),s=String.fromCharCode.apply(String,u.slice(0,a)),this.text[s]=String.fromCharCode.apply(String,u.slice(a+1));break;case"IEND":return o&&this.animation.frames.push(o),this.colors=function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}.call(this),this.hasAlphaChannel=4===(d=this.colorType)||6===d,r=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*r,this.colorSpace=function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}.call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=t}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}return n.load=function(e,t,r){var i;return"function"==typeof t&&(r=t),(i=new XMLHttpRequest).open("GET",e,!0),i.responseType="arraybuffer",i.onload=function(){var e;return e=new n(new Uint8Array(i.response||i.mozResponseArrayBuffer)),"function"==typeof(null!=t?t.getContext:void 0)&&e.render(t),"function"==typeof r?r(e):void 0},i.send(null)},n.prototype.read=function(e){var t,r;for(r=[],t=0;0<=e?t<e:t>e;0<=e?++t:--t)r.push(this.data[this.pos++]);return r},n.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},n.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},n.prototype.decodePixels=function(e){var t,r,i,n,o,s,l,f,u,h,c,d,p,m,g,y,w,x,C,b,k,v,T;if(null==e&&(e=this.imgData),0===e.length)return new Uint8Array(0);for(e=(e=new a.Z(e)).getBytes(),y=(d=this.pixelBitlength/8)*this.width,p=new Uint8Array(y*this.height),s=e.length,g=0,m=0,r=0;m<s;){switch(e[m++]){case 0:for(n=C=0;C<y;n=C+=1)p[r++]=e[m++];break;case 1:for(n=b=0;b<y;n=b+=1)t=e[m++],o=n<d?0:p[r-d],p[r++]=(t+o)%256;break;case 2:for(n=k=0;k<y;n=k+=1)t=e[m++],i=(n-n%d)/d,w=g&&p[(g-1)*y+i*d+n%d],p[r++]=(w+t)%256;break;case 3:for(n=v=0;v<y;n=v+=1)t=e[m++],i=(n-n%d)/d,o=n<d?0:p[r-d],w=g&&p[(g-1)*y+i*d+n%d],p[r++]=(t+Math.floor((o+w)/2))%256;break;case 4:for(n=T=0;T<y;n=T+=1)t=e[m++],i=(n-n%d)/d,o=n<d?0:p[r-d],0===g?w=x=0:(w=p[(g-1)*y+i*d+n%d],x=i&&p[(g-1)*y+(i-1)*d+n%d]),l=o+w-x,f=Math.abs(l-o),h=Math.abs(l-w),c=Math.abs(l-x),u=f<=h&&f<=c?o:h<=c?w:x,p[r++]=(t+u)%256;break;default:throw new Error("Invalid filter algorithm: "+e[m-1])}g++}return p},n.prototype.decodePalette=function(){var e,t,r,i,n,o,a,s,l;for(r=this.palette,o=this.transparency.indexed||[],n=new Uint8Array((o.length||0)+r.length),i=0,e=0,t=a=0,s=r.length;a<s;t=a+=3)n[i++]=r[t],n[i++]=r[t+1],n[i++]=r[t+2],n[i++]=null!=(l=o[e++])?l:255;return n},n.prototype.copyToImageData=function(e,t){var r,i,n,o,a,s,l,f,u,h,c;if(i=this.colors,u=null,r=this.hasAlphaChannel,this.palette.length&&(u=null!=(c=this._decodedPalette)?c:this._decodedPalette=this.decodePalette(),i=4,r=!0),f=(n=e.data||e).length,a=u||t,o=s=0,1===i)for(;o<f;)l=u?4*t[o/4]:s,h=a[l++],n[o++]=h,n[o++]=h,n[o++]=h,n[o++]=r?a[l++]:this.transparency.grayscale&&this.transparency.grayscale===h?0:255,s=l;else for(;o<f;)l=u?4*t[o/4]:s,n[o++]=a[l++],n[o++]=a[l++],n[o++]=a[l++],n[o++]=r?a[l++]:this.transparency.rgb&&this.transparency.rgb[1]===a[l-3]&&this.transparency.rgb[3]===a[l-2]&&this.transparency.rgb[5]===a[l-1]?0:255,s=l},n.prototype.decode=function(){var e;return e=new Uint8Array(this.width*this.height*4),this.copyToImageData(e,this.decodePixels()),e},r=e.document&&e.document.createElement("canvas"),i=r&&r.getContext("2d"),t=function(e){var t;return i.width=e.width,i.height=e.height,i.clearRect(0,0,e.width,e.height),i.putImageData(e,0,0),(t=new Image).src=r.toDataURL(),t},n.prototype.decodeFrames=function(e){var r,i,n,o,a,s,l,f;if(this.animation){for(f=[],i=a=0,s=(l=this.animation.frames).length;a<s;i=++a)r=l[i],n=e.createImageData(r.width,r.height),o=this.decodePixels(new Uint8Array(r.data)),this.copyToImageData(n,o),r.imageData=n,f.push(r.image=t(n));return f}},n.prototype.renderFrame=function(e,t){var r,i,n;return r=(i=this.animation.frames)[t],n=i[t-1],0===t&&e.clearRect(0,0,this.width,this.height),1===(null!=n?n.disposeOp:void 0)?e.clearRect(n.xOffset,n.yOffset,n.width,n.height):2===(null!=n?n.disposeOp:void 0)&&e.putImageData(n.imageData,n.xOffset,n.yOffset),0===r.blendOp&&e.clearRect(r.xOffset,r.yOffset,r.width,r.height),e.drawImage(r.image,r.xOffset,r.yOffset)},n.prototype.animate=function(e){var t,r,i,n,o,a,s=this;return r=0,a=this.animation,n=a.numFrames,i=a.frames,o=a.numPlays,(t=function(){var a,l;if(a=r++%n,l=i[a],s.renderFrame(e,a),n>1&&r/n<o)return s.animation._timeout=setTimeout(t,l.delay)})()},n.prototype.stopAnimation=function(){var e;return clearTimeout(null!=(e=this.animation)?e._timeout:void 0)},n.prototype.render=function(e){var t,r;return e._png&&e._png.stopAnimation(),e._png=this,e.width=this.width,e.height=this.height,t=e.getContext("2d"),this.animation?(this.decodeFrames(t),this.animate(t)):(r=t.createImageData(this.width,this.height),this.copyToImageData(r,this.decodePixels()),t.putImageData(r,0,0))},n}(self);const y=new Set(["jpg","png","bmp","gif"]);function w(e,t){if(!m.f)throw new i.Z("rasterCoded:decode","lerc decoder is not supported on big endian platform");const{width:r,height:o,pixelType:a}=t,s=M(a),l=s.pixelTypeCtor,f=null==t.noDataValue?s.noDataValue:t.noDataValue;let h,c,d=0,p=0;const g=e.byteLength-10;for(;p<g;){const t=(0,u.d)(e,{inputOffset:p,encodedMaskData:h,returnMask:0===d,returnEncodedMask:0===d,returnFileInfo:!0,pixelType:l,noDataValue:f});if(r&&o&&(t.width!==r||t.height!==o))throw new i.Z("rasterCoded:decode","lerc decoded result has width or height different from specified in options");if(p=t.fileInfo.eofOffset,0===d&&(h=t.encodedMaskData,c=new n.Z({width:t.width,height:t.height,pixels:[],pixelType:a,mask:t.maskData,statistics:[]})),d++,c.addData({pixels:t.pixelData,statistics:{minValue:t.minValue,maxValue:t.maxValue,noDataValue:t.noDataValue}}),g-p>10){const t=String.fromCharCode.apply(null,new Uint8Array(e,p,10));p+=t.indexOf("CntZ")>-1?t.indexOf("CntZ"):0}}return c}function x(e,t){if(!m.f)throw new i.Z("rasterCoded:decode","lerc decoder is not supported on big endian platform");let r,o,a,s=0,l=t.offset||0,u=0;const h=t.eof||e.byteLength-10,c=[],{width:d,height:p}=t;let g=0;for(;l<h;){var y;if(o=f.L.decode(e,{inputOffset:l,maskData:r,returnFileInfo:!0}),d&&p&&(o.width!==d||o.height!==p))throw new i.Z("rasterCoded:decode","lerc2 decoded result has width or height different from what's specified in options");if(l=o.fileInfo.eofOffset,r=o.maskData,0===s&&(u=o.fileInfo.numValidPixel,a=new n.Z({width:o.width,height:o.height,pixels:[],pixelType:o.fileInfo.pixelType,mask:r,statistics:[]})),o.fileInfo.mask&&o.fileInfo.mask.numBytes>0&&g++,r&&c.push(r),o.dimCount>1&&(null==(y=o.pixelData)?void 0:y.length)===o.width*o.height*o.dimCount){var w,x,C,b;o.pixelData=o.pixelData.slice(-o.width*o.height);const e=null==(w=o.dimStats)||null==(x=w.minValues)?void 0:x[o.dimCount-1],t=null==(C=o.dimStats)||null==(b=C.maxValues)?void 0:b[o.dimCount-1];null!=e&&null!=t&&(o.minValue=e,o.maxValue=t)}if(s++,a.addData({pixels:o.pixelData,statistics:{minValue:o.minValue,maxValue:o.maxValue}}),h-l>10){const t=String.fromCharCode.apply(null,new Uint8Array(e,l,10));l+=t.indexOf("Lerc")>-1?t.indexOf("Lerc"):0}}let k=0,v=0,T=0;if(g>1){for(T=a.width*a.height,r=new Uint8Array(T),r.set(c[0]),k=1;k<c.length;k++){const e=c[k];for(v=0;v<T;v++)r[v]=r[v]&e[v]}for(u=0,v=0;v<T;v++)u+=r[v];a.mask=r}return a.validPixelCount=u,a}function C(e,t){const r=(0,f.a)(e,t.pyramidLevel||0),i=new n.Z({width:r.width,height:r.height,pixels:r.pixels,pixelType:r.pixelType.toLowerCase(),mask:r.mask,statistics:null});return i.updateStatistics(),i}function b(e,t){const r=t.pixelType||"u8",i=n.Z.getPixelArrayConstructor(r),o="u8"===r?e:new i(e.buffer),a=[],s=t.planes||1;if(1===s)a.push(o);else for(let r=0;r<s;r++){const n=(t.width||1)*(t.height||e.length),l=new i(n);for(let e=0;e<n;e++)l[e]=o[e*s+r];a.push(l)}const l=new n.Z({width:t.width||1,height:t.height||e.length,pixels:a,pixelType:r,statistics:null});return l.updateStatistics(),l}function k(e,t){return b(new a.Z(new Uint8Array(e)).getBytes(),t)}function v(e,t){return b((0,h.J)(e,t.offset,t.eof,!t.isInputBigEndian),t)}function T(e){const t=class{static decode(e){const t=new Uint8Array(e),r=new l.J;r.parse(t);const{width:i,height:n,numComponents:o,eof:s}=r,f=r.getData(i,n,!0);let u;const h=i*n;let c=0,d=0,p=0;if(s<t.length-1){const e=new a.Z(t.subarray(s)).getBytes();u=new Uint8Array(h);let r=0;for(c=0;c<e.length;c++)for(p=7;p>=0;p--)u[r++]=e[c]>>p&1}let m,g=null;if(1===o)g=[f,f,f];else{for(g=[],c=0;c<3;c++)m=new Uint8Array(h),g.push(m);for(p=0,d=0;d<h;d++)for(c=0;c<3;c++)g[c][d]=f[p++]}return{width:i,height:n,pixels:g,mask:u}}}.decode(e),r=new n.Z({width:t.width,height:t.height,pixels:t.pixels,pixelType:"U8",mask:t.mask,statistics:null});return r.updateStatistics(),r}function S(e,t){const r=new Uint8Array(e),i=new g(r),{width:o,height:a}=t,s=o*a,l=i.decode();let f,u=0,h=0;const c=new Uint8Array(s);for(u=0;u<s;u++)c[u]=l[4*u+3];const d=new n.Z({width:o,height:a,pixels:[],pixelType:"U8",mask:c,statistics:[]});for(u=0;u<3;u++){for(f=new Uint8Array(s),h=0;h<s;h++)f[h]=l[4*h+u];d.addData({pixels:f})}return d.updateStatistics(),d}async function A(e,t,r,i){const o=new s,a={applyJpegMask:!1,format:t,...r},l=await o.decode(e,a,i),f=new n.Z(l);return f.updateStatistics(),f}function I(e){if(null==e)throw new i.Z("rasterCodec:decode","parameter encodeddata is required.");const t=new Uint8Array(e,0,10);let r="";return 255===t[0]&&216===t[1]?r="jpg":137===t[0]&&80===t[1]&&78===t[2]&&71===t[3]?r="png":67===t[0]&&110===t[1]&&116===t[2]&&90===t[3]&&73===t[4]&&109===t[5]&&97===t[6]&&103===t[7]&&101===t[8]&&32===t[9]?r="lerc":76===t[0]&&101===t[1]&&114===t[2]&&99===t[3]&&50===t[4]&&32===t[5]?r="lerc2":73===t[0]&&73===t[1]&&42===t[2]&&0===t[3]||77===t[0]&&77===t[1]&&0===t[2]&&42===t[3]||73===t[0]&&73===t[1]&&43===t[2]&&0===t[3]||77===t[0]&&77===t[1]&&0===t[2]&&43===t[3]?r="tiff":71===t[0]&&73===t[1]&&70===t[2]?r="gif":66===t[0]&&77===t[1]?r="bmp":String.fromCharCode.apply(null,t).toLowerCase().indexOf("error")>-1&&(r="error"),r}function M(e){let t=null,r=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":r=255,t=Uint8Array;break;case"u16":r=r||65535,t=Uint16Array;break;case"u32":r=r||2**32-1,t=Uint32Array;break;case"s8":r=r||-128,t=Int8Array;break;case"s16":r=r||-32768,t=Int16Array;break;case"s32":r=r||0-2**31,t=Int32Array;break;default:t=Float32Array}return{pixelTypeCtor:t,noDataValue:r}}function P(e){let t=I(e);return"lerc2"===t?t="lerc":"error"===t&&(t=""),t}async function D(e,t={},r){if(null==e)throw new i.Z("rasterCodec:decode","missing encodeddata parameter.");let o,a,s=t.format&&t.format.toLowerCase();if(!("bsq"!==s&&"bip"!==s||null!=t.width&&null!=t.height))throw new i.Z("rasterCodec:decode","requires width and height in options parameter.");return"tiff"===s&&t.customOptions?function(e,t){const r=(0,f.d)(e,t.customOptions),i=new n.Z({width:r.width,height:r.height,pixels:r.pixels,pixelType:r.pixelType.toLowerCase(),mask:r.mask,statistics:null});return i.updateStatistics(),i}(e,t):((!s||"bsq"!==s&&"bip"!==s&&"deflate"!==s&&"lzw"!==s)&&(s=I(e)),t.useCanvas&&y.has(s)?a=await A(e,s,t,r):(o=function(e){let t=null;switch(e){case"lerc":t=w;break;case"lerc2":t=x;break;case"jpg":t=T;break;case"png":t=S;break;case"bsq":case"bip":t=(t,r)=>function(e,t,r){const{pixelTypeCtor:i}=M(t.pixelType),o=(0,p.decode)(e,{width:t.width,height:t.height,pixelType:i,format:r}),a=new n.Z({width:t.width,height:t.height,pixels:o.pixels,pixelType:t.pixelType,mask:o.mask,statistics:null});return a.updateStatistics(),a}(t,r,e);break;case"tiff":t=C;break;case"deflate":t=k;break;case"lzw":t=v;break;case"error":t=()=>{throw new i.Z("rasterCodec:decode","input data contains error")};break;default:t=()=>{throw new i.Z("rasterCodec:decode","unsupported raster format")}}return t}(s),t.isPoint&&((t={...t}).width++,t.height++),a=o(e,t),t.isPoint&&function(e,t=1){if(!e)return;const{pixels:r,width:i,height:o,mask:a}=e;if(!r||0===r.length)return;const s=r.length,l=i-1,f=o-1,u=[];let h,c,d,p,m,g,y;const w=n.Z.getPixelArrayConstructor(e.pixelType);if(0===t){for(h=0;h<s;h++){for(m=r[h],g=new w(l*f),c=0;c<f;c++)for(p=c*i,d=0;d<l;d++)g[c*l+d]=m[p+d];u.push(g)}if(a)for(y=new Uint8Array(l*f),c=0;c<f;c++)for(p=c*i,d=0;d<l;d++)y[c*l+d]=a[p+d]}else{for(h=0;h<s;h++){for(m=r[h],g=new w(l*f),c=0;c<f;c++)for(p=c*i,d=0;d<l;d++)g[c*l+d]=(m[p+d]+m[p+d+1]+m[p+i+d]+m[p+i+d+1])/4;u.push(g)}if(a)for(y=new Uint8Array(l*f),c=0;c<f;c++)for(p=c*i,d=0;d<l;d++)y[c*l+d]=Math.min.apply(null,[a[p+d],a[p+d+1],a[p+i+d],a[p+i+d+1]])}e.width=l,e.height=f,e.mask=y,e.pixels=u}(a)),a)}},9832:(e,t,r)=>{r.d(t,{Z:()=>s});const i=(()=>{const e=[];return e[254]="NEWSUBFILETYPE",e[255]="SUBFILETYPE",e[256]="IMAGEWIDTH",e[257]="IMAGELENGTH",e[258]="BITSPERSAMPLE",e[259]="COMPRESSION",e[262]="PHOTOMETRICINTERPRETATION",e[263]="THRESHHOLDING",e[264]="CELLWIDTH",e[265]="CELLLENGTH",e[266]="FILLORDER",e[269]="DOCUMENTNAME",e[270]="IMAGEDESCRIPTION",e[271]="MAKE",e[272]="MODEL",e[273]="STRIPOFFSETS",e[274]="ORIENTATION",e[277]="SAMPLESPERPIXEL",e[278]="ROWSPERSTRIP",e[279]="STRIPBYTECOUNTS",e[280]="MINSAMPLEVALUE",e[281]="MAXSAMPLEVALUE",e[282]="XRESOLUTION",e[283]="YRESOLUTION",e[284]="PLANARCONFIGURATION",e[285]="PAGENAME",e[286]="XPOSITION",e[287]="YPOSITION",e[288]="FREEOFFSETS",e[289]="FREEBYTECOUNTS",e[290]="GRAYRESPONSEUNIT",e[291]="GRAYRESPONSECURVE",e[292]="T4OPTIONS",e[293]="T6OPTIONS",e[296]="RESOLUTIONUNIT",e[297]="PAGENUMBER",e[300]="COLORRESPONSEUNIT",e[301]="TRANSFERFUNCTION",e[305]="SOFTWARE",e[306]="DATETIME",e[315]="ARTIST",e[316]="HOSTCOMPUTER",e[317]="PREDICTOR",e[318]="WHITEPOINT",e[319]="PRIMARYCHROMATICITIES",e[320]="COLORMAP",e[321]="HALFTONEHINTS",e[322]="TILEWIDTH",e[323]="TILELENGTH",e[324]="TILEOFFSETS",e[325]="TILEBYTECOUNTS",e[326]="BADFAXLINES",e[327]="CLEANFAXDATA",e[328]="CONSECUTIVEBADFAXLINES",e[330]="SUBIFD",e[332]="INKSET",e[333]="INKNAMES",e[334]="NUMBEROFINKS",e[336]="DOTRANGE",e[337]="TARGETPRINTER",e[338]="EXTRASAMPLES",e[339]="SAMPLEFORMAT",e[340]="SMINSAMPLEVALUE",e[341]="SMAXSAMPLEVALUE",e[342]="TRANSFERRANGE",e[347]="JPEGTABLES",e[512]="JPEGPROC",e[513]="JPEGIFOFFSET",e[514]="JPEGIFBYTECOUNT",e[515]="JPEGRESTARTINTERVAL",e[517]="JPEGLOSSLESSPREDICTORS",e[518]="JPEGPOINTTRANSFORM",e[519]="JPEGQTABLES",e[520]="JPEGDCTABLES",e[521]="JPEGACTABLES",e[529]="YCBCRCOEFFICIENTS",e[530]="YCBCRSUBSAMPLING",e[531]="YCBCRPOSITIONING",e[532]="REFERENCEBLACKWHITE",e[700]="XMP",e[33550]="GEOPIXELSCALE",e[33922]="GEOTIEPOINTS",e[33432]="COPYRIGHT",e[42112]="GDAL_METADATA",e[42113]="GDAL_NODATA",e[50844]="RPCCOEFFICIENT",e[34264]="GEOTRANSMATRIX",e[34735]="GEOKEYDIRECTORY",e[34736]="GEODOUBLEPARAMS",e[34737]="GEOASCIIPARAMS",e[34665]="EXIFIFD",e[34853]="GPSIFD",e[40965]="INTEROPERABILITYIFD",e})(),n=(()=>{const e=[].concat(i);return e[36864]="ExifVersion",e[40960]="FlashpixVersion",e[40961]="ColorSpace",e[42240]="Gamma",e[37121]="ComponentsConfiguration",e[37122]="CompressedBitsPerPixel",e[40962]="PixelXDimension",e[40963]="PixelYDimension",e[37500]="MakerNote",e[37510]="UserComment",e[40964]="RelatedSoundFile",e[36867]="DateTimeOriginal",e[36868]="DateTimeDigitized",e[36880]="OffsetTime",e[36881]="OffsetTimeOriginal",e[36882]="OffsetTimeDigitized",e[37520]="SubSecTime",e[37521]="SubSecTimeOriginal",e[37522]="SubSecTimeDigitized",e[37888]="Temperature",e[37889]="Humidity",e[37890]="Pressure",e[37891]="WaterDepth",e[37892]="Acceleration",e[37893]="CameraElevationAngle",e[42016]="ImageUniqueID",e[42032]="CameraOwnerName",e[42033]="BodySerialNumber",e[42034]="LensSpecification",e[42035]="LensMake",e[42036]="LensModel",e[42037]="LensSerialNumber",e[33434]="ExposureTime",e[33437]="FNumber",e[34850]="ExposureProgram",e[34852]="SpectralSensitivity",e[34855]="PhotographicSensitivity",e[34856]="OECF",e[34864]="SensitivityType",e[34865]="StandardOutputSensitivity",e[34866]="RecommendedExposureIndex",e[34867]="ISOSpeed",e[34868]="ISOSpeedLatitudeyyy",e[34869]="ISOSpeedLatitudezzz",e[37377]="ShutterSpeedValue",e[37378]="ApertureValue",e[37379]="BrightnessValue",e[37380]="ExposureBiasValue",e[37381]="MaxApertureValue",e[37382]="SubjectDistance",e[37383]="MeteringMode",e[37384]="LightSource",e[37385]="Flash",e[37386]="FocalLength",e[37396]="SubjectArea",e[41483]="FlashEnergy",e[41484]="SpatialFrequencyResponse",e[41486]="FocalPlaneXResolution",e[41487]="FocalPlaneYResolution",e[41488]="FocalPlaneResolutionUnit",e[41492]="SubjectLocation",e[41493]="ExposureIndex",e[41495]="SensingMethod",e[41728]="FileSource",e[41729]="SceneType",e[41730]="CFAPattern",e[41985]="CustomRendered",e[41986]="ExposureMode",e[41987]="WhiteBalance",e[41988]="DigitalZoomRatio",e[41989]="FocalLengthIn35mmFilm",e[41990]="SceneCaptureType",e[41991]="GainControl",e[41992]="Contrast",e[41993]="Saturation",e[41994]="Sharpness",e[41995]="DeviceSettingDescription",e[41996]="SubjectDistanceRange",e})(),o=(()=>{const e=[];return e[1024]="GTModelTypeGeoKey",e[1025]="GTRasterTypeGeoKey",e[1026]="GTCitationGeoKey",e[2048]="GeographicTypeGeoKey",e[2049]="GeogCitationGeoKey",e[2050]="GeogGeodeticDatumGeoKey",e[2051]="GeogPrimeMeridianGeoKey",e[2052]="GeogLinearUnitsGeoKey",e[2053]="GeogLinearUnitSizeGeoKey",e[2054]="GeogAngularUnitsGeoKey",e[2055]="GeogAngularUnitSizeGeoKey",e[2056]="GeogEllipsoidGeoKey",e[2057]="GeogSemiMajorAxisGeoKey",e[2058]="GeogSemiMinorAxisGeoKey",e[2059]="GeogInvFlatteningGeoKey",e[2061]="GeogPrimeMeridianLongGeoKey",e[2060]="GeogAzimuthUnitsGeoKey",e[3072]="ProjectedCSTypeGeoKey",e[3073]="PCSCitationGeoKey",e[3074]="ProjectionGeoKey",e[3075]="ProjCoordTransGeoKey",e[3076]="ProjLinearUnitsGeoKey",e[3077]="ProjLinearUnitSizeGeoKey",e[3078]="ProjStdParallel1GeoKey",e[3079]="ProjStdParallel2GeoKey",e[3080]="ProjNatOriginLongGeoKey",e[3081]="ProjNatOriginLatGeoKey",e[3082]="ProjFalseEastingGeoKey",e[3083]="ProjFalseNorthingGeoKey",e[3084]="ProjFalseOriginLongGeoKey",e[3085]="ProjFalseOriginLatGeoKey",e[3086]="ProjFalseOriginEastingGeoKey",e[3087]="ProjFalseOriginNorthingGeoKey",e[3088]="ProjCenterLongGeoKey",e[3090]="ProjCenterEastingGeoKey",e[3091]="ProjCenterNorthingGeoKey",e[3092]="ProjScaleAtNatOriginGeoKey",e[3093]="ProjScaleAtCenterGeoKey",e[3094]="ProjAzimuthAngleGeoKey",e[3095]="ProjStraightVertPoleLongGeoKey",e[4096]="VerticalCSTypeGeoKey",e[4097]="VerticalCitationGeoKey",e[4098]="VerticalDatumGeoKey",e[4099]="VerticalUnitsGeoKey",e})(),a=new Map;a.set("EXIFIFD",n),a.set("GPSIFD",["GPSVersionID","GPSLatitudeRef","GPSLatitude","GPSLongitudeRef","GPSLongitude","GPSAltitudeRef","GPSAltitude","GPSTimeStamp","GPSSatellites","GPSStatus","GPSMeasureMode","GPSDOP","GPSSpeedRef","GPSSpeed","GPSTrackRef","GPSTrack","GPSImgDirectionRef","GPSImgDirection","GPSMapDatum","GPSDestLatitudeRef","GPSDestLatitude","GPSDestLongitudeRef","GPSDestLongitude","GPSDestBearingRef","GPSDestBearing","GPSDestDistanceRef","GPSDestDistance","GPSProcessingMethod","GPSAreaInformation","GPSDateStamp","GPSDifferential","GPSHPositioningError"]);const s={TIFF_TAGS:i,ifdTags:a,GEO_KEYS:o,getTagName:function(e,t){let r=(t||i)[e];return void 0===r&&(r="unknown"+String(e)),r}}},48279:(e,t,r)=>{r.d(t,{f:()=>i});const i=(()=>{const e=new ArrayBuffer(4),t=new Uint8Array(e);return new Uint32Array(e)[0]=1,1===t[0]})()},55914:(e,t,r)=>{r.d(t,{Uk:()=>A,SJ:()=>l,Pz:()=>s,oc:()=>c,hE:()=>h,Oh:()=>u,Hv:()=>f,qF:()=>a,nk:()=>o,XV:()=>p,us:()=>y,zp:()=>m,pW:()=>w,Vl:()=>S,dy:()=>d});var i=r(70586),n=r(54163);function o(e){return(0,i.pC)(e)&&"esri.layers.support.PixelBlock"===e.declaredClass&&e.pixels&&e.pixels.length>0}function a(e,t){if(null==t||!t.length||!o(e))return e;const r=e.pixels.length;return t&&t.some((e=>e>=r))||1===r&&1===t.length&&0===t[0]?e:r!==t.length||t.some(((e,t)=>e!==t))?new n.Z({pixelType:e.pixelType,width:e.width,height:e.height,mask:e.mask,validPixelCount:e.validPixelCount,maskIsAlpha:e.maskIsAlpha,pixels:t.map((t=>e.pixels[t])),statistics:e.statistics&&t.map((t=>e.statistics[t]))}):e}function s(e){if(!e)return;const t=e.colormap;if(!t||0===t.length)return;const r=t.sort(((e,t)=>e[0]-t[0]));let i=0;r[0][0]<0&&(i=r[0][0]);const n=Math.max(256,r[r.length-1][0]-i+1),o=new Uint8Array(4*n),a=[];let s,l=0,f=0;const u=5===r[0].length;if(n>65536)return r.forEach((e=>{a[e[0]-i]=u?e.slice(1):e.slice(1).concat([255])})),{indexed2DColormap:a,offset:i,alphaSpecified:u};if(e.fillUnspecified)for(s=r[f],l=s[0]-i;l<n;l++)o[4*l]=s[1],o[4*l+1]=s[2],o[4*l+2]=s[3],o[4*l+3]=u?s[4]:255,l===s[0]-i&&(s=f===r.length-1?s:r[++f]);else for(l=0;l<r.length;l++)s=r[l],f=4*(s[0]-i),o[f]=s[1],o[f+1]=s[2],o[f+2]=s[3],o[f+3]=u?s[4]:255;return{indexedColormap:o,offset:i,alphaSpecified:u}}function l(e,t){if(!o(e))return e;if(!t&&(t.indexedColormap||t.indexed2DColormap))return e;const r=e.clone(),i=r.pixels;let n=r.mask;const a=r.width*r.height;if(1!==i.length)return e;const{indexedColormap:s,indexed2DColormap:l,offset:f,alphaSpecified:u}=t,h=s.length-1;let c=0;const d=i[0],p=new Uint8Array(d.length),m=new Uint8Array(d.length),g=new Uint8Array(d.length);let y,w=0;if(s)if(n)for(c=0;c<a;c++)n[c]&&(w=4*(d[c]-f),w<f||w>h?n[c]=0:(p[c]=s[w],m[c]=s[w+1],g[c]=s[w+2],n[c]=s[w+3]));else{for(n=new Uint8Array(a),c=0;c<a;c++)w=4*(d[c]-f),w<f||w>h?n[c]=0:(p[c]=s[w],m[c]=s[w+1],g[c]=s[w+2],n[c]=s[w+3]);r.mask=n}else if(n)for(c=0;c<a;c++)n[c]&&(y=l[d[c]],p[c]=y[0],m[c]=y[1],g[c]=y[2],n[c]=y[3]);else{for(n=new Uint8Array(a),c=0;c<a;c++)y=l[d[c]],p[c]=y[0],m[c]=y[1],g[c]=y[2],n[c]=y[3];r.mask=n}return r.pixels=[p,m,g],r.statistics=null,r.pixelType="u8",r.maskIsAlpha=u,r}function f(e){if(!o(e))return null;e.statistics||e.updateStatistics();const{pixels:t,mask:r,pixelType:i,statistics:n}=e,a=e.width*e.height,s=t.length;let l,f,u,h,c;const d=[],p=[];let m,g,y,w,x,C,b,k,v,T;const S=256;for(h=0;h<s;h++){if(m=new Uint32Array(S),y=t[h],"u8"===i)if(l=-.5,f=255.5,r)for(c=0;c<a;c++)r[c]&&m[y[c]]++;else for(c=0;c<a;c++)m[y[c]]++;else{if(l=n[h].minValue,f=n[h].maxValue,u=(f-l)/S,g=new Uint32Array(257),r)for(c=0;c<a;c++)r[c]&&g[Math.floor((y[c]-l)/u)]++;else for(c=0;c<a;c++)g[Math.floor((y[c]-l)/u)]++;for(c=0;c<255;c++)m[c]=g[c];m[255]=g[255]+g[256]}for(d.push({min:l,max:f,size:S,counts:m}),w=0,x=0,k=0,c=0;c<S;c++)w+=m[c],x+=c*m[c];for(v=x/w,c=0;c<S;c++)k+=m[c]*(c-v)**2;T=Math.sqrt(k/(w-1)),u=(f-l)/S,C=(v+.5)*u+l,b=T*u,p.push({min:l,max:f,avg:C,stddev:b})}return{statistics:p,histograms:d}}function u(e){const t=[];for(let r=0;r<e.length;r++){const{min:i,max:n,size:o,counts:a}=e[r];let s=0,l=0;for(let e=0;e<o;e++)s+=a[e],l+=e*a[e];const f=l/s;let u=0;for(let e=0;e<o;e++)u+=a[e]*(e-f)**2;const h=(n-i)/o,c=(f+.5)*h+i,d=Math.sqrt(u/(s-1))*h;t.push({min:i,max:n,avg:c,stddev:d})}return t}function h(e){const{minCutOff:t,maxCutOff:r,gamma:i,pixelType:n}=e,o=e.outMin||0,a=e.outMax||255;if(-1===["u8","u16","s8","s16"].indexOf(n))return null;const s=t.length;let l,f,u=0;"s8"===n?u=-127:"s16"===n&&(u=-32767);let h=256;["u16","s16"].indexOf(n)>-1&&(h=65536);const c=[],d=[],p=a-o;for(l=0;l<s;l++)d[l]=r[l]-t[l],c[l]=p/(r[l]-t[l]);const m=i&&i.length>=s,g=[];if(m)for(l=0;l<s;l++)i[l]>1?i[l]>2?g[l]=6.5+(i[l]-2)**2.5:g[l]=6.5+100*(2-i[l])**4:g[l]=1;let y;const w=[];let x,C,b;if(m)for(l=0;l<s;l++){for(b=[],f=0;f<h;f++)x=f+u,y=(x-t[l])/d[l],C=1,i[l]>1&&(C-=(1/p)**(y*g[l])),x<r[l]&&x>t[l]?b[f]=Math.floor(C*p*y**(1/i[l]))+o:x>=r[l]?b[f]=a:b[f]=o;w[l]=b}else for(l=0;l<s;l++){for(b=[],f=0;f<h;f++)x=f+u,x<=t[l]?b[f]=o:x>=r[l]?b[f]=a:b[f]=Math.floor((x-t[l])/d[l]*p)+o;w[l]=b}if(null!=e.contrastOffset){const t=function(e,t){const r=Math.min(Math.max(e,-100),100),i=Math.min(Math.max(t,-100),100),n=255;let o,a;const s=new Uint8Array(256);for(o=0;o<256;o++)r>0&&r<100?a=(200*o-25500+510*i)/(2*(100-r))+128:r<=0&&r>-100?a=(200*o-25500+510*i)*(100+r)/2e4+128:100===r?(a=200*o-25500+256*(100-r)+510*i,a=a>0?n:0):-100===r&&(a=128),s[o]=a>n?n:a<0?0:a;return s}(e.contrastOffset,e.brightnessOffset);for(l=0;l<s;l++)for(b=w[l],f=0;f<h;f++)b[f]=t[b[f]]}return{lut:w,offset:u}}function c(e,t=256){t=Math.min(t,256);const{size:r,counts:i}=e,n=new Uint8Array(r),o=i.reduce(((e,r)=>e+r/t),0);let a=0,s=0,l=0,f=o;for(let e=0;e<r;e++)if(l+=i[e],!(e<r-1&&l+i[e+1]<f)){for(;a<t-1&&f<l;)a++,f+=o;for(let t=s;t<=e;t++)n[t]=a;s=e+1}for(let e=s;e<r;e++)n[e]=t-1;return n}function d(e,t){if(!o(e))return null;const r=e.clone(),{pixels:i,mask:n}=r,{minCutOff:a,maxCutOff:s,gamma:l}=t,f=t.outMin||0,u=t.outMax||255,h=r.width*r.height,c=i.length;let d,p,m,g,y;const w=u-f,x=[],C=[];for(d=0;d<c;d++)C[d]=s[d]-a[d],x[d]=w/(s[d]-a[d]);const b=l&&l.length>=c,k=[];if(b)for(d=0;d<c;d++)l[d]>1?l[d]>2?k[d]=6.5+(l[d]-2)**2.5:k[d]=6.5+100*(2-l[d])**4:k[d]=1;if(b)if(null!=n){for(p=0;p<h;p++)if(n[p])for(d=0;d<c;d++)m=i[d][p],y=(m-a[d])/C[d],g=1,l[d]>1&&(g-=(1/w)**(y*k[d])),m<s[d]&&m>a[d]?i[d][p]=Math.floor(g*w*y**(1/l[d]))+f:m>=s[d]?i[d][p]=u:i[d][p]=f}else for(p=0;p<h;p++)for(d=0;d<c;d++)m=i[d][p],y=(m-a[d])/C[d],g=1,l[d]>1&&(g-=(1/w)**(y*k[d])),m<s[d]&&m>a[d]?i[d][p]=Math.floor(g*w*y**(1/l[d]))+f:m>=s[d]?i[d][p]=u:i[d][p]=f;else if(null!=n){for(p=0;p<h;p++)if(n[p])for(d=0;d<c;d++)m=i[d][p],m<s[d]&&m>a[d]?i[d][p]=Math.floor((m-a[d])/C[d]*w)+f:m>=s[d]?i[d][p]=u:i[d][p]=f}else for(p=0;p<h;p++)for(d=0;d<c;d++)m=i[d][p],m<s[d]&&m>a[d]?i[d][p]=Math.floor((m-a[d])/C[d]*w)+f:m>=s[d]?i[d][p]=u:i[d][p]=f;return r.pixelType="u8",r.updateStatistics(),r}function p(e,t){if(!o(e))return null;const{pixels:r,mask:i}=e,a=e.width*e.height,s=r.length;let l=t.lut;const{offset:f}=t;let u,h;l&&1===l[0].length&&(l=r.map((()=>l)));const c=[];let d,p,m;if(f)if(null==i)for(u=0;u<s;u++){for(d=r[u],p=l[u],m=new Uint8Array(a),h=0;h<a;h++)m[h]=p[d[h]-f];c.push(m)}else for(u=0;u<s;u++){for(d=r[u],p=l[u],m=new Uint8Array(a),h=0;h<a;h++)i[h]&&(m[h]=p[d[h]-f]);c.push(m)}else if(null==i)for(u=0;u<s;u++){for(d=r[u],p=l[u],m=new Uint8Array(a),h=0;h<a;h++)m[h]=p[d[h]];c.push(m)}else for(u=0;u<s;u++){for(d=r[u],p=l[u],m=new Uint8Array(a),h=0;h<a;h++)i[h]&&(m[h]=p[d[h]]);c.push(m)}const g=new n.Z({width:e.width,height:e.height,pixels:c,mask:i,pixelType:"u8"});return g.updateStatistics(),g}function m(e,t){if(!o(e))return null;const r=e.clone(),{pixels:i}=r,n=r.width*r.height,a=t.length,s=Math.floor(a/2),l=t[Math.floor(s)],f=i[0];let u,h,c,d,p,m,g=!1;const y=new Uint8Array(n),w=new Uint8Array(n),x=new Uint8Array(n);let C=r.mask;const b=4===t[0].mappedColor.length;for(C||(C=new Uint8Array(n),C.fill(b?255:1),r.mask=C),p=0;p<n;p++)if(C[p]){for(u=f[p],g=!1,m=s,h=l,c=0,d=a-1;d-c>1;){if(u===h.value){g=!0;break}u>h.value?c=m:d=m,m=Math.floor((c+d)/2),h=t[Math.floor(m)]}g||(u===t[c].value?(h=t[c],g=!0):u===t[d].value?(h=t[d],g=!0):u<t[c].value?(g=!1,h=null):u>t[c].value&&(u<t[d].value?(h=t[c],g=!0):d===a-1?(g=!1,h=null):(h=t[d],g=!0))),g?(y[p]=h.mappedColor[0],w[p]=h.mappedColor[1],x[p]=h.mappedColor[2],C[p]=h.mappedColor[3]):y[p]=w[p]=x[p]=C[p]=0}return r.pixels=[y,w,x],r.mask=C,r.pixelType="u8",r.maskIsAlpha=b,r}function g(e,t,r,i,n,o){const{width:a,height:s}=r.block,{x:l,y:f}=r.offset,{width:u,height:h}=r.mosaic,c=function(e,t,r,i,n,o,a,s){return{xmin:n<=r*e?0:n<r*e+e?n-r*e:e,ymin:o<=i*t?0:o<i*t+t?o-i*t:t,xmax:n+a<=r*e?0:n+a<r*e+e?n+a-r*e:e,ymax:o+s<=i*t?0:o+s<i*t+t?o+s-i*t:t}}(a,s,i,n,l,f,u,h);let d=0,p=0;if(o){const e=o.hasGCSSShiftTransform?360:o.halfWorldWidth,t=a*o.resolutionX,r=o.startX+i*t,n=r+t;r<e&&n>e?p=o.rightPadding:r>=e&&(d=o.leftMargin-o.rightPadding,p=0)}if(c.xmax-=p,"number"!=typeof t)for(let r=c.ymin;r<c.ymax;r++){const o=(n*s+r-f)*u+(i*a-l)+d,h=r*a;for(let r=c.xmin;r<c.xmax;r++)e[o+r]=t[h+r]}else for(let r=c.ymin;r<c.ymax;r++){const o=(n*s+r-f)*u+(i*a-l)+d;for(let r=c.xmin;r<c.xmax;r++)e[o+r]=t}}function y(e,t,r={}){const{clipOffset:a,clipSize:s,alignmentInfo:l,blockWidths:f}=r;if(f)return function(e,t,r){const a=e.find((e=>(0,i.pC)(e)));if(!(0,i.pC)(a))return null;const s=e.some((e=>!(0,i.pC)(e)||!!e.mask)),{width:l,height:f}=t,u=s?new Uint8Array(l*f):null,{blockWidths:h}=r,c=[],d=a.getPlaneCount(),p=n.Z.getPixelArrayConstructor(a.pixelType);if(s)for(let t=0,r=0;t<e.length;r+=h[t],t++){const i=e[t];if(!o(i))continue;const n=i.mask;for(let e=0;e<f;e++)for(let o=0;o<h[t];o++)u[e*l+o+r]=null==n?255:n[e*i.width+o]}for(let t=0;t<d;t++){const r=new p(l*f);for(let i=0,n=0;i<e.length;n+=h[i],i++){const a=e[i];if(!o(a))continue;const s=a.pixels[t];if(null!=s)for(let e=0;e<f;e++)for(let t=0;t<h[i];t++)r[e*l+t+n]=s[e*a.width+t]}c.push(r)}const m=new n.Z({width:l,height:f,mask:u,pixels:c,pixelType:a.pixelType});return m.updateStatistics(),m}(e,t,{blockWidths:f});const u=e.filter((e=>o(e)))[0];if((0,i.Wi)(u))return null;const h=s?s.width:t.width,c=s?s.height:t.height,d=u.width,p=u.height,m=t.width/d,y=t.height/p,w={offset:a||{x:0,y:0},mosaic:s||t,block:{width:d,height:p}},x=u.pixelType,C=n.Z.getPixelArrayConstructor(x),b=u.pixels.length,k=[];let v,T,S;for(let t=0;t<b;t++){T=new C(h*c);for(let r=0;r<y;r++)for(let i=0;i<m;i++){const n=e[r*m+i];o(n)&&(v=n.pixels[t],g(T,v,w,i,r,l))}k.push(T)}if(e.some((e=>(0,i.Wi)(e)||e.mask&&e.mask.length>0))){S=new Uint8Array(h*c);for(let t=0;t<y;t++)for(let r=0;r<m;r++){const n=e[t*m+r];g(S,((0,i.pC)(n)?n.mask:null)||(n?1:0),w,r,t,l)}}const A=new n.Z({width:h,height:c,pixels:k,pixelType:x,mask:S});return A.updateStatistics(),A}function w(e,t,r){if(!o(e))return null;const{width:i,height:n}=e,a=t.x,s=t.y,l=r.width+a,f=r.height+s;if(a<0||s<0||l>i||f>n)return e;if(0===a&&0===s&&l===i&&f===n)return e;e.mask||(e.mask=new Uint8Array(i*n));const u=e.mask;for(let e=0;e<n;e++){const t=e*i;for(let r=0;r<i;r++)u[t+r]=e<s||e>=f||r<a||r>=l?0:1}return e.updateStatistics(),e}function x(e){if(!o(e))return null;const t=e.clone(),{width:r,height:i,pixels:n,mask:a}=e,s=n[0],l=t.pixels[0];for(let e=2;e<i-1;e++){const t=new Map;for(let i=e-2;i<e+2;i++)for(let e=0;e<4;e++){const n=i*r+e;k(t,s[n],a?a[n]:1)}l[e*r]=C(t),l[e*r+1]=l[e*r+2]=l[e*r];let i=3;for(;i<r-1;i++){let n=(e-2)*r+i+1;k(t,s[n],a?a[n]:1),n=(e-1)*r+i+1,k(t,s[n],a?a[n]:1),n=e*r+i+1,k(t,s[n],a?a[n]:1),n=(e+1)*r+i+1,k(t,s[n],a?a[n]:1),n=(e-2)*r+i-3,b(t,s[n],a?a[n]:1),n=(e-1)*r+i-3,b(t,s[n],a?a[n]:1),n=e*r+i-3,b(t,s[n],a?a[n]:1),n=(e+1)*r+i-3,b(t,s[n],a?a[n]:1),l[e*r+i]=C(t)}l[e*r+i+1]=l[e*r+i]}for(let e=0;e<r;e++)l[e]=l[r+e]=l[2*r+e],l[(i-1)*r+e]=l[(i-2)*r+e];return t.updateStatistics(),t}function C(e){if(0===e.size)return 0;let t=0,r=-1,i=0;const n=e.keys();let o=n.next();for(;!o.done;)i=e.get(o.value),i>t&&(r=o.value,t=i),o=n.next();return r}function b(e,t,r){if(0===r)return;const i=e.get(t);1===i?e.delete(t):e.set(t,i-1)}function k(e,t,r){0!==r&&e.set(t,e.has(t)?e.get(t)+1:1)}function v(e,t,r){let{x:i,y:a}=t;const{width:s,height:l}=r;if(0===i&&0===a&&l===e.height&&s===e.width)return e;const{width:f,height:u}=e,h=Math.max(0,a),c=Math.max(0,i),d=Math.min(i+s,f),p=Math.min(a+l,u);if(d<0||p<0||!o(e))return null;i=Math.max(0,-i),a=Math.max(0,-a);const{pixels:m,mask:g}=e,y=s*l,w=m.length,x=[];for(let t=0;t<w;t++){const r=m[t],o=n.Z.createEmptyBand(e.pixelType,y);for(let e=h;e<p;e++){const t=e*f;let n=(e+a-h)*s+i;for(let e=c;e<d;e++)o[n++]=r[t+e]}x.push(o)}const C=new Uint8Array(y);for(let e=h;e<p;e++){const t=e*f;let r=(e+a-h)*s+i;for(let e=c;e<d;e++)C[r++]=g?g[t+e]:1}const b=new n.Z({width:r.width,height:r.height,pixelType:e.pixelType,pixels:x,mask:C});return b.updateStatistics(),b}function T(e,t=!0){if(!o(e))return null;const{pixels:r,width:i,height:a,mask:s,pixelType:l}=e,f=[],u=Math.round(i/2),h=Math.round(a/2),c=a-1,d=i-1;for(let e=0;e<r.length;e++){const o=r[e],s=n.Z.createEmptyBand(l,u*h);let p=0;for(let e=0;e<a;e+=2)for(let r=0;r<i;r+=2){const n=o[e*i+r];if(t){const t=r===d?n:o[e*i+r+1],a=e===c?n:o[e*i+r+i],l=r===d?a:e===c?t:o[e*i+r+i+1];s[p++]=(n+t+a+l)/4}else s[p++]=n}f.push(s)}let p=null;if(s){p=new Uint8Array(u*h);let e=0;for(let r=0;r<a;r+=2)for(let n=0;n<i;n+=2){const o=s[r*i+n];if(t){const t=n===d?o:s[r*i+n+1],a=r===c?o:s[r*i+n+i],l=n===d?a:r===c?t:s[r*i+n+i+1];p[e++]=o*t*a*l?1:0}else p[e++]=o}}return new n.Z({width:u,height:h,pixelType:l,pixels:f,mask:p})}function S(e,t,r){if(!o(e))return null;const{width:i,height:n}=t;let{width:a,height:s}=e;const l=new Map,f={x:0,y:0},u=null==r?1:1+r;let h=e;for(let e=0;e<u;e++){const r=Math.ceil(a/i),o=Math.ceil(s/n);for(let a=0;a<o;a++){f.y=a*n;for(let n=0;n<r;n++){f.x=n*i;const r=v(h,f,t);l.set(`${e}/${a}/${n}`,r)}}e<u-1&&(h=T(h)),a=Math.round(a/2),s=Math.round(s/2)}return l}function A(e,t,r,i,a="nearest"){if(!o(e))return null;"majority"===a&&(e=x(e));const{pixels:s,mask:l,pixelType:f}=e,u=e.width,h=e.height,c=n.Z.getPixelArrayConstructor(f),d=s.length,{width:p,height:m}=t,g=i.cols,y=i.rows,w=Math.ceil(p/g-.1/g),C=Math.ceil(m/y-.1/y);let b,k,v,T,S,A,I,M=!1;for(let e=0;e<r.length;e+=3)-1===r[e]&&-1===r[e+1]&&-1===r[e+2]&&(M=!0);const P=w*g,D=P*C*y,U=new Float32Array(D),B=new Float32Array(D);let E,L,R=0;const O="majority"===a?0:.5;for(let e=0;e<C;e++)for(let t=0;t<w;t++){b=12*(e*w+t),k=r[b],v=r[b+1],T=r[b+2],S=r[b+3],A=r[b+4],I=r[b+5];for(let r=0;r<y;r++){R=(e*y+r)*P+t*g,L=(r+.5)/y;for(let e=0;e<r;e++)E=(e+.5)/g,U[R+e]=Math.round((k*E+v*L+T)*u-O),B[R+e]=Math.round((S*E+A*L+I)*h-O)}b+=6,k=r[b],v=r[b+1],T=r[b+2],S=r[b+3],A=r[b+4],I=r[b+5];for(let r=0;r<y;r++){R=(e*y+r)*P+t*g,L=(r+.5)/y;for(let e=r;e<g;e++)E=(e+.5)/g,U[R+e]=Math.round((k*E+v*L+T)*u-O),B[R+e]=Math.round((S*E+A*L+I)*h-O)}}const _=(e,t)=>{for(let r=0;r<m;r++){b=r*P;for(let i=0;i<p;i++)U[b]<0||B[b]<0?e[r*p+i]=0:e[r*p+i]=t[U[b]+B[b]*u],b++}},G=[];let V;for(let e=0;e<d;e++)V=new c(p*m),_(V,s[e]),G.push(V);const F=new n.Z({width:p,height:m,pixelType:f,pixels:G});if(l)F.mask=new Uint8Array(p*m),_(F.mask,l);else if(M){F.mask=new Uint8Array(p*m);for(let e=0;e<p*m;e++)F.mask[e]=U[e]<0||B[e]<0?0:1}return F.updateStatistics(),F}},80676:(e,t,r)=>{r.d(t,{KC:()=>d,QI:()=>p,Yx:()=>f,NL:()=>l,Tg:()=>h});var i=r(35454),n=r(54163),o=r(55914);const a=new Map;a.set("meter-per-second",1),a.set("kilometer-per-hour",.277778),a.set("knots",.514444),a.set("feet-per-second",.3048),a.set("mile-per-hour",.44704);const s=180/Math.PI,l=new i.Xn({esriMetersPerSecond:"meter-per-second",esriKilometersPerHour:"kilometer-per-hour",esriKnots:"knots",esriFeetPerSecond:"feet-per-second",esriMilesPerHour:"mile-per-hour"});function f(e,t){return a.get(e)/a.get(t)||1}function u(e){return(450-e)%360}function h(e,t="geographic"){const[r,i]=e,n=Math.sqrt(r*r+i*i);let o=Math.atan2(i,r)*s;return o=(360+o)%360,"geographic"===t&&(o=u(o)),[n,o]}function c(e,t="geographic"){let r=e[1];"geographic"===t&&(r=u(r)),r%=360;const i=e[0];return[i*Math.cos(r/s),i*Math.sin(r/s)]}function d(e,t,r="geographic",i=1){if(!(0,o.nk)(e))return e;const{pixels:a,width:s,height:l}=e,f=s*l,u=a[0],d=a[1],p=n.Z.createEmptyBand(e.pixelType,f),m=n.Z.createEmptyBand(e.pixelType,f);let g=0;for(let e=0;e<l;e++)for(let e=0;e<s;e++)"vector-uv"===t?([p[g],m[g]]=h([u[g],d[g]],r),p[g]*=i):([p[g],m[g]]=c([u[g],d[g]],r),p[g]*=i,m[g]*=i),g++;const y=new n.Z({pixelType:e.pixelType,width:e.width,height:e.height,mask:e.mask,validPixelCount:e.validPixelCount,maskIsAlpha:e.maskIsAlpha,pixels:[p,m]});return y.updateStatistics(),y}function p(e,t,r=1){if(1===r||!(0,o.nk)(e))return e;const i=e.clone(),{pixels:n,width:a,height:s}=i,l=n[0],f=n[1];let u=0;for(let e=0;e<s;e++)for(let e=0;e<a;e++)"vector-uv"===t?(l[u]*=r,f[u]*=r):l[u]*=r,u++;return i.updateStatistics(),i}function m(e,t,r,i=1){const n=Math.sqrt(e*e+t*t)/i,o=(2*Math.PI+Math.atan2(t,e))%(2*Math.PI);return[n,(2*Math.PI+o-r)%(2*Math.PI)]}!function(e=0,t=0,r=Math.PI,i=!0){i&&(r=(2*Math.PI-r)%(2*Math.PI));const n=i?-1:1,o=13*n,a=-7*n,s=-2*n,l=-16*n,f=29,[u,h]=m(0,t+o,r,f),[c,d]=m(e-5.5,t+a,r,f),[p,g]=m(e+5.5,t+a,r,f),[y,w]=m(e-1.5,t+s,r,f),[x,C]=m(e+1.5,t+s,r,f),[b,k]=m(e-1.5,t+l,r,f),[v,T]=m(e+1.5,t+l,r,f)}(0,0,0)},91219:(e,t,r)=>{r.d(t,{Z:()=>x});var i=r(43697),n=r(3892),o=r(10736),a=r(92604),s=r(70586),l=r(5600),f=(r(67676),r(80442),r(75215),r(52011)),u=r(48526),h=r(55914),c=r(54163);function d(e){let{altitude:t,azimuth:r}=e;const{hillshadeType:i,pixelSizePower:n,pixelSizeFactor:o,scalingType:a,isGCS:s,resolution:l}=e,f="multi-directional"===i?2*e.zFactor:e.zFactor,{x:u,y:h}=l;let c=f/(8*u),d=f/(8*h);if(s&&f>.001&&(c/=111e3,d/=111e3),"adjusted"===a)if(s){const e=111e3*u,t=111e3*h;c=(f+e**n*o)/(8*e),d=(f+t**n*o)/(8*t)}else c=(f+u**n*o)/(8*u),d=(f+h**n*o)/(8*h);let p=(90-t)*Math.PI/180,m=Math.cos(p),g=(360-r+90)*Math.PI/180,y=Math.sin(p)*Math.cos(g),w=Math.sin(p)*Math.sin(g);const x=[315,270,225,360,180,0],C=[60,60,60,60,60,90],b=new Float32Array([3,5,3,2,1,4]),k=b.reduce(((e,t)=>e+t)),v=b.map((e=>e/k)),T="multi-directional"===i?x.length:1,S=new Float32Array(6),A=new Float32Array(6),I=new Float32Array(6);if("multi-directional"===i)for(let e=0;e<T;e++)t=C[e],r=x[e],p=(90-t)*Math.PI/180,m=Math.cos(p),g=(360-r+90)*Math.PI/180,y=Math.sin(p)*Math.cos(g),w=Math.sin(p)*Math.sin(g),S[e]=m,A[e]=y,I[e]=w;else S.fill(m),A.fill(y),I.fill(w);return{resolution:l,factor:[c,d],sinZcosA:y,sinZsinA:w,cosZ:m,sinZcosAs:A,sinZsinAs:I,cosZs:S,weights:v,hillshadeType:["traditional","multi-directional"].indexOf(i)}}var p=r(93010);const m=a.Z.getLogger("esri.renderers.support.RasterSymbolizer"),g={u1:[0,1],u2:[0,3],u4:[0,15],u8:[0,255],s8:[-128,127],u16:[0,65535],s16:[-32768,32767],u32:[0,4294967295],s32:[-2147483648,2147483647],f32:[-34e38,34e38],f64:[-Number.MAX_VALUE,Number.MAX_VALUE]};let y=class extends o.wq{constructor(e){super(e)}bind(){const{rendererJSON:e}=this;if(!e)return{success:!1};let t;switch(this.lookup={rendererJSON:{}},e.type){case"uniqueValue":t={success:this._updateUVRenderer(e)};break;case"rasterColormap":t={success:this._updateColormapRenderer(e)};break;case"rasterStretch":t={success:this._updateStretchRenderer(e)};break;case"classBreaks":t={success:this._updateClassBreaksRenderer(e)};break;case"rasterShadedRelief":t={success:this._updateShadedReliefRenderer(e)};break;case"vectorField":t={success:this._updateVectorFieldRenderer()};break;case"animatedFlow":t=this._updateAnimatedFlowRenderer()}return t}symbolize(e){let t=e&&e.pixelBlock;if(!w(t))return t;if(e.simpleStretchParams&&"rasterStretch"===this.rendererJSON.type)return this.simpleStretch(t,e.simpleStretchParams);try{let r;switch(t.pixels.length>3&&(t=(0,h.qF)(t,[0,1,2])),this.rendererJSON.type){case"uniqueValue":case"rasterColormap":r=this._symbolize_colormap(t);break;case"classBreaks":r=this._symbolize_classBreaks(t);break;case"rasterStretch":r=this._symbolize_stretch(t,e.bandIds);break;case"rasterShadedRelief":{const{extent:i}=e,n=i.spatialReference.isGeographic,o={x:(i.xmax-i.xmin)/t.width,y:(i.ymax-i.ymin)/t.height};r=this._symbolize_shadedRelief(t,{isGCS:n,resolution:o});break}}return r}catch(e){return m.error("symbolize",e.message),t}}simpleStretch(e,t){if(!w(e))return e;try{return e.pixels.length>3&&(e=(0,h.qF)(e,[0,1,2])),(0,h.dy)(e,t)}catch(t){return m.error("symbolize",t.message),e}}generateWebGLParameters(e){if(["uniqueValue","rasterColormap","classBreaks"].indexOf(this.rendererJSON.type)>-1){var t;const{indexedColormap:e,offset:r}=(null==(t=this.lookup)?void 0:t.colormapLut)||{};return{colormap:e,colormapOffset:r,type:"lut"}}const{pixelBlock:r,isGCS:i,resolution:n,bandIds:o}=e,{rendererJSON:a}=this;return"rasterStretch"===a.type?this.generateStretchWebGLParams(r,a,o):"rasterShadedRelief"===a.type?this.generateShadedReliefWebGLParams(a,i,n):"vectorField"===a.type?this._generateVectorFieldWebGLParams(a):null}_isLUTChanged(e){if(!this.lookup||!this.lookup.rendererJSON)return!0;if("colorRamp"in this.rendererJSON){const t=this.rendererJSON.colorRamp;return e?JSON.stringify(t)!==JSON.stringify(this.lookup.rendererJSON.colorRamp):(this.rendererJSON,this.lookup.rendererJSON,JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON))}return JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON)}_symbolize_colormap(e){return this._isLUTChanged()&&!this.bind().success?e:(0,h.SJ)(e,this.lookup.colormapLut)}_symbolize_classBreaks(e){const t=this.rasterInfo.pixelType,r=["u8","u16","s8","s16"].indexOf(t)>-1;return this._isLUTChanged()&&!this.bind().success?e:r?(0,h.SJ)(e,this.lookup.colormapLut):(0,h.zp)(e,this.lookup.remapLut)}_symbolize_stretch(e,t){const{pixelType:r,bandCount:i}=this.rasterInfo,n=this.rendererJSON,o=["u8","u16","s8","s16"].indexOf(r)>-1;let a,l;const{dra:f}=n,u=n.useGamma?n.gamma:null;if("histogramEqualization"===n.stretchType){const r=f?null:this.lookup.histogramLut,i=this.getStretchCutoff(n,e,t,!r),o=(0,h.dy)(e,{...i,gamma:u});l=(0,h.XV)(o,{lut:f?i.histogramLut:r,offset:0})}else if(o){var c,d;if(f){const i=this.getStretchCutoff(n,e,t);a=(0,h.hE)({pixelType:r,...i,gamma:u})}else if(this._isLUTChanged()){if(!this.bind().success)return e;a=this.lookup?this.lookup.stretchLut:null}else a=this.lookup?this.lookup.stretchLut:null;if(!a)return e;i>1&&(null==t?void 0:t.length)===(null==(c=(0,s.Wg)(e))?void 0:c.pixels.length)&&(null==(d=a)?void 0:d.lut.length)===i&&(a={lut:t.map((e=>a.lut[e])),offset:a.offset}),l=(0,h.XV)(e,a)}else{const r=this.getStretchCutoff(n,e,t);l=(0,h.dy)(e,{...r,gamma:u})}if(n.colorRamp){if(this._isLUTChanged(!0)&&!this.bind().success)return e;l=(0,h.SJ)(l,this.lookup.colormapLut)}return l}_symbolize_shadedRelief(e,t){var r,i;const n=this.rendererJSON,o=function(e,t){if(!(0,h.nk)(e))return e;const{width:r,height:i,mask:n}=e,o=new Uint8Array(r*i);n&&o.set(n);const{factor:a,sinZcosA:s,sinZsinA:l,cosZ:f,sinZcosAs:u,sinZsinAs:p,cosZs:m,weights:g}=d(t),[y,w]=a,{hillshadeType:x}=t,C=e.pixels[0],b=new Uint8Array(r*i);let k,v,T,S,A,I,M,P;for(let e=1;e<i-1;e++){const t=e*r;for(let e=1;e<r-1;e++){if(n&&!n[t+e]){b[t+e]=0;continue}let i=8;if(n&&(i=n[t-r+e-1]+n[t-r+e]+n[t-r+e+1]+n[t+e-1]+n[t+e+1]+n[t+r+e-1]+n[t+r+e]+n[t+r+e+1],i<7)){b[t+e]=0,o[t+e]=0;continue}7===i?(k=n[t-r+e-1]?C[t-r+e-1]:C[t+e],v=n[t-r+e]?C[t-r+e]:C[t+e],T=n[t-r+e+1]?C[t-r+e+1]:C[t+e],S=n[t+e-1]?C[t+e-1]:C[t+e],A=n[t+e+1]?C[t+e+1]:C[t+e],I=n[t+r+e-1]?C[t+r+e-1]:C[t+e],M=n[t+r+e]?C[t+r+e]:C[t+e],P=n[t+r+e+1]?C[t+r+e+1]:C[t+e]):(k=C[t-r+e-1],v=C[t-r+e],T=C[t-r+e+1],S=C[t+e-1],A=C[t+e+1],I=C[t+r+e-1],M=C[t+r+e],P=C[t+r+e+1]);const a=(T+A+A+P-(k+S+S+I))*y,h=(I+M+M+P-(k+v+v+T))*w,c=Math.sqrt(1+a*a+h*h);let d=0;if("traditional"===x){let e=255*(f+l*h-s*a)/c;e<0&&(e=0),d=e}else{const e=p.length;for(let t=0;t<e;t++){let e=255*(m[t]+p[t]*h-u[t]*a)/c;e<0&&(e=0),d+=e*g[t]}}b[t+e]=255&d}}for(let e=0;e<i;e++)b[e*r]=b[e*r+1],b[(e+1)*r-1]=b[(e+1)*r-2];for(let e=1;e<r-1;e++)b[e]=b[e+r],b[e+(i-1)*r]=b[e+(i-2)*r];return new c.Z({width:r,height:i,pixels:[b],mask:n?o:null,pixelType:"u8",validPixelCount:e.validPixelCount,statistics:[{minValue:0,maxValue:255}]})}(e,{...n,...t});if(!n.colorRamp)return o;let a;if(this._isLUTChanged(!0)){if(!this.bind().success)return o;a=this.lookup?this.lookup.hsvMap:null}else a=this.lookup?this.lookup.hsvMap:null;return a?(function(e,t,r,i){if(!(0,h.nk)(e)||!(0,h.nk)(t))return;const{min:n,max:o}=i,a=e.pixels[0],{pixels:s,mask:l}=t,f=s[0],u=255.00001/(o-n),c=new Uint8ClampedArray(f.length),d=new Uint8ClampedArray(f.length),p=new Uint8ClampedArray(f.length),m=r.length-1;for(let e=0;e<f.length;e++){if(l&&0===l[e])continue;const t=Math.floor((f[e]-n)*u),[i,o]=r[t<0?0:t>m?m:t],s=a[e],h=s*o,g=h*(1-Math.abs(i%2-1)),y=s-h;switch(Math.floor(i)){case 0:c[e]=h+y,d[e]=g+y,p[e]=y;break;case 1:c[e]=g+y,d[e]=h+y,p[e]=y;break;case 2:c[e]=y,d[e]=h+y,p[e]=g+y;break;case 3:c[e]=y,d[e]=g+y,p[e]=h+y;break;case 4:c[e]=g+y,d[e]=y,p[e]=h+y;break;case 5:case 6:c[e]=h+y,d[e]=y,p[e]=g+y}}e.pixels=[c,d,p],e.updateStatistics()}(o,e,a,null!=(r=null==(i=(0,s.Wg)(this.rasterInfo.statistics))?void 0:i[0])?r:{min:0,max:8e3}),o):o}_updateVectorFieldRenderer(){const{bandCount:e,dataType:t}=this.rasterInfo;return 2===e&&("vector-magdir"===t||"vector-uv"===t)}_updateAnimatedFlowRenderer(){const{bandCount:e,dataType:t}=this.rasterInfo;return 2!==e||"vector-magdir"!==t&&"vector-uv"!==t?{success:!1,error:`Unsupported data type "${t}"; AnimatedFlowRenderer only supports "vector-magdir" and "vector-uv".`}:{success:!0}}_updateUVRenderer(e){const{bandCount:t,attributeTable:r,pixelType:i}=this.rasterInfo,n=e.field1;if(!n)return!1;const o=e.defaultSymbol,a=1===t&&["u8","s8"].includes(i);if(!function(e,t){const{attributeTable:r,bandCount:i}=e;return!(!(0,s.pC)(r)||i>1||t&&null==r.fields.find((e=>e.name.toLowerCase()===t.toLowerCase())))}(this.rasterInfo,n)&&!a)return!1;const l=[];if(r){const t=r.fields.filter((e=>"value"===e.name.toLowerCase()))[0];if(!t)return!1;r.features.forEach((r=>{var i;const a=e.uniqueValueInfos.filter((e=>String(e.value)===String(r.attributes[n])))[0],s=null==a||null==(i=a.symbol)?void 0:i.color;s?l.push([r.attributes[t.name]].concat(s)):o&&l.push([r.attributes[t.name]].concat(o.color))}))}else{if("value"!==n.toLowerCase())return!1;e.uniqueValueInfos.forEach((e=>{var t;const r=null==e||null==(t=e.symbol)?void 0:t.color;r?l.push([parseInt(""+e.value,10)].concat(r)):o&&l.push([parseInt(""+e.value,10)].concat(o.color))}))}if(0===l.length)return!1;const f=(0,h.Pz)({colormap:l});return this.lookup={rendererJSON:e,colormapLut:f},this.canRenderInWebGL=!0,!0}_updateColormapRenderer(e){if(!function(e){const{bandCount:t,colormap:r}=e;return(0,s.pC)(r)&&r.length&&1===t}(this.rasterInfo))return!1;const t=e.colormapInfos.map((e=>[e.value].concat(e.color))).sort(((e,t)=>e[0]-t[0]));if(!t||0===t.length)return!1;const r=(0,h.Pz)({colormap:t});return this.lookup={rendererJSON:e,colormapLut:r},this.canRenderInWebGL=!0,!0}_updateShadedReliefRenderer(e){if(!function(e){return"elevation"===e.dataType}(this.rasterInfo))return!1;if(e.colorRamp){const t=(0,p.Jw)(e.colorRamp,256,!0),r=(0,h.Pz)({colormap:t}),i=[],o=r.indexedColormap;for(let e=0;e<o.length;e+=4){const t=(0,n._Y)({r:o[e],g:o[e+1],b:o[e+2]});i.push([t.h/60,t.s/100,255*t.v/100])}this.lookup={rendererJSON:e,colormapLut:r,hsvMap:i}}else this.lookup=null;return this.canRenderInWebGL=!0,!0}_updateClassBreaksRenderer(e){const t=this.rasterInfo.pixelType,r=["u8","u16","s8","s16"].indexOf(t)>-1,i=e.classBreakInfos;if(null==i||!i.length)return!1;const n=i.sort(((e,t)=>e.classMaxValue-t.classMaxValue)),o=n[n.length-1];let a=e.minValue;if(!r){const t=[];for(let e=0;e<n.length;e++){var s;t.push({value:null!=(s=n[e].classMinValue)?s:a,mappedColor:n[e].symbol.color}),a=n[e].classMaxValue}return t.push({value:o.classMaxValue,mappedColor:o.symbol.color}),this.lookup={rendererJSON:e,remapLut:t},this.canRenderInWebGL=!1,!0}const l=[];a=Math.floor(e.minValue);for(let e=0;e<n.length;e++){const t=n[e];for(let e=a;e<t.classMaxValue;e++)l.push([e].concat(t.symbol.color));a=Math.ceil(t.classMaxValue)}o.classMaxValue===a&&l.push([o.classMaxValue].concat(o.symbol.color));const f=(0,h.Pz)({colormap:l,fillUnspecified:!1});return this.lookup={rendererJSON:e,colormapLut:f},this.canRenderInWebGL=!0,!0}_isHistogramRequired(e){return"percentClip"===e||"histogramEqualization"===e}_isValidRasterStatistics(e){return(0,s.pC)(e)&&e.length>0&&null!=e[0].min&&null!=e[0].max}_updateStretchRenderer(e){var t;let{stretchType:r,dra:i}=e;if(!("none"===r||null!=(t=e.statistics)&&t.length||this._isValidRasterStatistics(this.rasterInfo.statistics)||i))return!1;const n=(0,s.Wg)(e.histograms||this.rasterInfo.histograms);!this._isHistogramRequired(e.stretchType)||null!=n&&n.length||i||(r="minMax");const{gamma:o,useGamma:a,colorRamp:l}=e,f=this.rasterInfo.pixelType,u=!i&&["u8","u16","s8","s16"].indexOf(f)>-1;if("histogramEqualization"===r){const t=n.map((e=>(0,h.oc)(e)));this.lookup={rendererJSON:e,histogramLut:t}}else if(u){const t=this.getStretchCutoff(e),r=(0,h.hE)({pixelType:f,...t,gamma:a?o:null});this.lookup={rendererJSON:e,stretchLut:r}}if(l){const t=(0,p.Jw)(l,256,!0);this.lookup||(this.lookup={rendererJSON:e}),this.lookup.colormapLut=(0,h.Pz)({colormap:t}),this.lookup.rendererJSON=e}return this.canRenderInWebGL=!0,!0}getStretchCutoff(e,t=null,r,i){var n,o,a;let l,f,u=e.stretchType;var c;if(e.dra)if("minMax"===u&&(0,s.pC)(t)&&t.statistics)l=t.statistics.map((e=>[e.minValue,e.maxValue,0,0]));else{const e=(0,h.Hv)(t);l=(0,s.pC)(e)?e.statistics:null,f=(0,s.pC)(e)?e.histograms:null}else l=(null==(c=e.statistics)?void 0:c.length)>0?e.statistics:(0,s.Wg)(this.rasterInfo.statistics),f=e.histograms||(0,s.Wg)(this.rasterInfo.histograms);!this._isHistogramRequired(u)||null!=(n=f)&&n.length||(u="minMax");const d=(null==(o=l)?void 0:o.length)||(null==(a=f)?void 0:a.length)||this.rasterInfo.bandCount,p=[],m=[];let y,w,x,C,b,k,v,T,S,A,I,M;switch(l&&!Array.isArray(l[0])&&(l=l.map((e=>[e.min,e.max,e.avg,e.stddev]))),u){case"none":{const e=g[this.rasterInfo.pixelType]||g.f32;for(T=0;T<d;T++)p[T]=e[0],m[T]=e[1]}break;case"minMax":for(T=0;T<d;T++)p[T]=l[T][0],m[T]=l[T][1];break;case"standardDeviation":for(T=0;T<d;T++)p[T]=l[T][2]-e.numberOfStandardDeviations*l[T][3],m[T]=l[T][2]+e.numberOfStandardDeviations*l[T][3],p[T]<l[T][0]&&(p[T]=l[T][0]),m[T]>l[T][1]&&(m[T]=l[T][1]);break;case"histogramEqualization":for(T=0;T<d;T++)p[T]=f[T].min,m[T]=f[T].max;break;case"percentClip":for(T=0;T<f.length;T++){for(y=f[T],b=new Uint32Array(y.size),C=y.counts,x=0,w=(y.max-y.min)/y.size,v=-.5===y.min&&1===w?.5:0,S=0;S<y.size;S++)x+=C[S],b[S]=x;for(k=(e.minPercent||0)*x/100,S=0;S<y.size;S++)if(b[S]>k){p[T]=y.min+w*(S+v);break}for(k=(1-(e.maxPercent||0)/100)*x,S=y.size-2;S>=0;S--)if(b[S]<k){m[T]=y.min+w*(S+2-v);break}}break;default:for(T=0;T<d;T++)p[T]=l[T][0],m[T]=l[T][1]}"histogramEqualization"===u?(I=f[0].size||256,A=0,i&&(M=f.map((e=>(0,h.oc)(e))))):(I=e.max||255,A=e.min||0);const P={minCutOff:p,maxCutOff:m,outMax:I,outMin:A,histogramLut:M};return this.getSelectedBandCutoffs(P,r)}getSelectedBandCutoffs(e,t){if(null==t||0===t.length)return e;const r=Math.max.apply(null,t),{minCutOff:i,maxCutOff:n,outMin:o,outMax:a,histogramLut:s}=e;return i.length===t.length||i.length<=r?e:{minCutOff:t.map((e=>i[e])),maxCutOff:t.map((e=>n[e])),histogramLut:s?t.map((e=>s[e])):null,outMin:o,outMax:a}}generateStretchWebGLParams(e,t,r){let i=null,n=null;const o=this.lookup&&this.lookup.colormapLut;t.colorRamp&&o&&(i=o.indexedColormap,n=o.offset),"histogramEqualization"===t.stretchType&&(t={...t,stretchType:"minMax"});const{gamma:a}=t,l=!!(t.useGamma&&a&&a.some((e=>1!==e))),{minCutOff:f,maxCutOff:u,outMin:h,outMax:c}=this.getStretchCutoff(t,e,r);let d=0;(0,s.pC)(e)&&(d=e.getPlaneCount(),2===d&&((e=e.clone()).statistics=[e.statistics[0]],e.pixels=[e.pixels[0]]));const p=Math.min(3,(null==r?void 0:r.length)||d||this.rasterInfo.bandCount),m=new Float32Array(p),g=i||l?1:255;let y;for(y=0;y<p;y++)m[y]=(c-h)/(u[y]-f[y])/g;const w=new Float32Array(p);if(l)for(y=0;y<p;y++)a[y]>1?a[y]>2?w[y]=6.5+(a[y]-2)**2.5:w[y]=6.5+100*(2-a[y])**4:w[y]=1;return{bandCount:p,outMin:h/g,outMax:c/g,minCutOff:f,maxCutOff:u,factor:m,useGamma:l,gamma:l?a:[1,1,1],gammaCorrection:l?w:[1,1,1],colormap:i,colormapOffset:n,stretchType:t.stretchType,type:"stretch"}}generateShadedReliefWebGLParams(e,t,r){var i,n,o;let a=null,l=null;const f=this.lookup&&this.lookup.colormapLut;e.colorRamp&&f&&(a=f.indexedColormap,l=f.offset);const u=d({...e,isGCS:t,resolution:r}),h=null==(i=(0,s.Wg)(this.rasterInfo.statistics))?void 0:i[0];return{...u,minValue:null!=(n=null==h?void 0:h.min)?n:0,maxValue:null!=(o=null==h?void 0:h.max)?o:8e3,hillshadeType:"traditional"===e.hillshadeType?0:1,type:"hillshade",colormap:a,colormapOffset:l}}_generateVectorFieldWebGLParams(e){var t,r,i,n,o;const{style:a,inputUnit:l,outputUnit:f,visualVariables:u,symbolTileSize:h,flowRepresentation:c}=e;let d;const p=null!=(t=null==u?void 0:u.find((e=>"sizeInfo"===e.type)))?t:{type:"sizeInfo",field:"Magnitude",maxDataValue:null==(r=this.rasterInfo.statistics)?void 0:r[0].max,maxSize:.8*h,minDataValue:null==(i=this.rasterInfo.statistics)?void 0:i[0].min,minSize:.2*h},m=p?p.minDataValue:null==(n=this.rasterInfo.statistics)?void 0:n[0].min,g=p?p.maxDataValue:null==(o=this.rasterInfo.statistics)?void 0:o[0].max,y=(0,s.pC)(p.maxSize)&&(0,s.pC)(p.minSize)?[p.minSize/h,p.maxSize/h]:[.2,.8];if("wind_speed"===a||"simple_scalar"===a){const e=(y[0]+y[1])/2;y[0]=y[1]=e}const w=(0,s.pC)(m)&&(0,s.pC)(g)?[m,g]:null;if("classified_arrow"===a)if((0,s.pC)(m)&&(0,s.pC)(g)&&(0,s.pC)(p)){d=[];const e=(p.maxDataValue-p.minDataValue)/5;for(let t=0;t<6;t++)d.push(p.minDataValue+e*t)}else d=[0,1e-6,3.5,7,10.5,14];const x="flow_to"===c==("ocean_current_kn"===a||"ocean_current_m"===a)?0:Math.PI,C=null==u?void 0:u.find((e=>"rotationInfo"===e.type));return{breakValues:d,dataRange:w,inputUnit:l,outputUnit:f,symbolTileSize:h,symbolPercentRange:y,style:a||"single_arrow",rotation:x,rotationType:(null==C?void 0:C.rotationType)||e.rotationType,type:"vectorField"}}};function w(e){return(0,h.nk)(e)&&0!==e.validPixelCount}(0,i._)([(0,l.Cb)({json:{write:!0}})],y.prototype,"rendererJSON",void 0),(0,i._)([(0,l.Cb)({type:u.Z,json:{write:!0}})],y.prototype,"rasterInfo",void 0),(0,i._)([(0,l.Cb)({json:{write:!0}})],y.prototype,"lookup",void 0),(0,i._)([(0,l.Cb)()],y.prototype,"canRenderInWebGL",void 0),y=(0,i._)([(0,f.j)("esri.renderers.support.RasterSymbolizer")],y);const x=y},93010:(e,t,r)=>{r.d(t,{Ms:()=>o,Jw:()=>u,Uh:()=>f});var i=r(22303),n=r(3892);const o=[{id:"aspect_predefined",type:"multipart",colorRamps:[{fromColor:[190,190,190],toColor:[255,45,8]},{fromColor:[255,45,8],toColor:[255,181,61]},{fromColor:[255,181,61],toColor:[255,254,52]},{fromColor:[255,254,52],toColor:[0,251,50]},{fromColor:[0,251,50],toColor:[255,254,52]},{fromColor:[0,253,255],toColor:[0,181,255]},{fromColor:[0,181,255],toColor:[26,35,253]},{fromColor:[26,35,253],toColor:[255,57,251]},{fromColor:[255,57,251],toColor:[255,45,8]}]},{id:"blackToWhite_predefined",fromColor:[0,0,0],toColor:[255,255,255]},{id:"blueBright_predefined",fromColor:[204,204,255],toColor:[0,0,224]},{id:"blueLightToDark_predefined",fromColor:[211,229,232],toColor:[46,100,140]},{id:"blueGreenBright_predefined",fromColor:[203,245,234],toColor:[48,207,146]},{id:"blueGreenLightToDark_predefined",fromColor:[216,242,237],toColor:[21,79,74]},{id:"brownLightToDark_predefined",fromColor:[240,236,170],toColor:[102,72,48]},{id:"brownToBlueGreenDivergingBright_predefined",type:"multipart",colorRamps:[{fromColor:[156,85,31],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[33,130,145]}]},{id:"brownToBlueGreenDivergingDark_predefined",type:"multipart",colorRamps:[{fromColor:[110,70,45],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[48,100,102]}]},{id:"coefficientBias_predefined",fromColor:[214,214,255],toColor:[0,57,148]},{id:"coldToHotDiverging_predefined",type:"multipart",colorRamps:[{fromColor:[69,117,181],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[214,47,39]}]},{id:"conditionNumber_predefined",type:"multipart",colorRamps:[{fromColor:[0,97,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,34,0]}]},{id:"cyanToPurple_predefined",type:"multipart",colorRamps:[{fromColor:[0,245,245],toColor:[0,0,245]},{fromColor:[0,0,245],toColor:[245,0,245]}]},{id:"cyanLightToBlueDark_predefined",type:"multipart",colorRamps:[{fromColor:[182,237,240],toColor:[31,131,224]},{fromColor:[31,131,224],toColor:[9,9,145]}]},{id:"distance_predefined",fromColor:[255,200,0],toColor:[0,0,255]},{id:"elevation1_predefined",type:"multipart",colorRamps:[{fromColor:[175,240,233],toColor:[255,255,179]},{fromColor:[255,255,179],toColor:[0,128,64]},{fromColor:[0,128,64],toColor:[252,186,3]},{fromColor:[252,186,3],toColor:[128,0,0]},{fromColor:[120,0,0],toColor:[105,48,13]},{fromColor:[105,48,13],toColor:[171,171,171]},{fromColor:[171,171,171],toColor:[255,252,255]}]},{id:"elevation2_predefined",type:"multipart",colorRamps:[{fromColor:[118,219,211],toColor:[255,255,199]},{fromColor:[255,255,199],toColor:[255,255,128]},{fromColor:[255,255,128],toColor:[217,194,121]},{fromColor:[217,194,121],toColor:[135,96,38]},{fromColor:[135,96,38],toColor:[150,150,181]},{fromColor:[150,150,181],toColor:[181,150,181]},{fromColor:[181,150,181],toColor:[255,252,255]}]},{id:"errors_predefined",fromColor:[255,235,214],toColor:[196,10,10]},{id:"grayLightToDark_predefined",fromColor:[219,219,219],toColor:[69,69,69]},{id:"greenBright_predefined",fromColor:[204,255,204],toColor:[14,204,14]},{id:"greenLightToDark_predefined",fromColor:[220,245,233],toColor:[34,102,51]},{id:"greenToBlue_predefined",type:"multipart",colorRamps:[{fromColor:[32,204,16],toColor:[0,242,242]},{fromColor:[0,242,242],toColor:[2,33,227]}]},{id:"orangeBright_predefined",fromColor:[255,235,204],toColor:[240,118,5]},{id:"orangeLightToDark_predefined",fromColor:[250,233,212],toColor:[171,65,36]},{id:"partialSpectrum_predefined",type:"multipart",colorRamps:[{fromColor:[242,241,162],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]},{fromColor:[252,3,69],toColor:[176,7,237]},{fromColor:[176,7,237],toColor:[2,29,173]}]},{id:"partialSpectrum1Diverging_predefined",type:"multipart",colorRamps:[{fromColor:[135,38,38],toColor:[240,149,12]},{fromColor:[240,149,12],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[74,80,181]},{fromColor:[74,80,181],toColor:[39,32,122]}]},{id:"partialSpectrum2Diverging_predefined",type:"multipart",colorRamps:[{fromColor:[115,77,42],toColor:[201,137,52]},{fromColor:[201,137,52],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[91,63,176]},{fromColor:[91,63,176],toColor:[81,13,97]}]},{id:"pinkToYellowGreenDivergingBright_predefined",type:"multipart",colorRamps:[{fromColor:[158,30,113],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[99,110,45]}]},{id:"pinkToYellowGreenDivergingDark_predefined",type:"multipart",colorRamps:[{fromColor:[97,47,73],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[22,59,15]}]},{id:"precipitation_predefined",type:"multipart",colorRamps:[{fromColor:[194,82,60],toColor:[237,161,19]},{fromColor:[237,161,19],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,219,0]},{fromColor:[0,219,0],toColor:[32,153,143]},{fromColor:[32,153,143],toColor:[11,44,122]}]},{id:"prediction_predefined",type:"multipart",colorRamps:[{fromColor:[40,146,199],toColor:[250,250,100]},{fromColor:[250,250,100],toColor:[232,16,20]}]},{id:"purpleBright_predefined",fromColor:[255,204,255],toColor:[199,0,199]},{id:"purpleToGreenDivergingBright_predefined",type:"multipart",colorRamps:[{fromColor:[77,32,150],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[20,122,11]}]},{id:"purpleToGreenDivergingDark_predefined",type:"multipart",colorRamps:[{fromColor:[67,14,89],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[24,79,15]}]},{id:"purpleBlueBright_predefined",fromColor:[223,184,230],toColor:[112,12,242]},{id:"purpleBlueLightToDark_predefined",fromColor:[229,213,242],toColor:[93,44,112]},{id:"purpleRedBright_predefined",fromColor:[255,204,225],toColor:[199,0,99]},{id:"purpleRedLightToDark_predefined",fromColor:[250,215,246],toColor:[143,17,57]},{id:"redBright_predefined",fromColor:[255,204,204],toColor:[219,0,0]},{id:"redLightToDark_predefined",fromColor:[255,224,224],toColor:[143,10,10]},{id:"redToBlueDivergingBright_predefined",type:"multipart",colorRamps:[{fromColor:[196,69,57],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[48,95,207]}]},{id:"redToBlueDivergingDark_predefined",type:"multipart",colorRamps:[{fromColor:[107,13,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[13,53,97]}]},{id:"redToGreen_predefined",type:"multipart",colorRamps:[{fromColor:[245,0,0],toColor:[245,245,0]},{fromColor:[245,245,0],toColor:[0,245,0]}]},{id:"redToGreenDivergingBright_predefined",type:"multipart",colorRamps:[{fromColor:[186,20,20],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[54,145,33]}]},{id:"redToGreenDivergingDark_predefined",type:"multipart",colorRamps:[{fromColor:[97,21,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[16,69,16]}]},{id:"slope_predefined",type:"multipart",colorRamps:[{fromColor:[56,168,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]}]},{id:"spectrumFullBright_predefined",type:"multipart",colorRamps:[{fromColor:[255,0,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,0,255]}]},{id:"spectrumFullDark_predefined",type:"multipart",colorRamps:[{fromColor:[153,0,0],toColor:[153,153,0]},{fromColor:[153,153,0],toColor:[0,153,153]},{fromColor:[0,153,153],toColor:[0,0,153]}]},{id:"spectrumFullLight_predefined",type:"multipart",colorRamps:[{fromColor:[255,153,153],toColor:[255,255,153]},{fromColor:[255,255,153],toColor:[153,255,255]},{fromColor:[153,255,255],toColor:[153,153,255]}]},{id:"surface_predefined",type:"multipart",colorRamps:[{fromColor:[112,153,89],toColor:[242,238,162]},{fromColor:[242,238,162],toColor:[242,206,133]},{fromColor:[242,206,133],toColor:[194,140,124]},{fromColor:[194,140,124],toColor:[255,242,255]}]},{id:"temperature_predefined",type:"multipart",colorRamps:[{fromColor:[255,252,255],toColor:[255,0,255]},{fromColor:[255,0,255],toColor:[0,0,255]},{fromColor:[0,0,255],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,255,0]},{fromColor:[0,255,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,128,0]},{fromColor:[255,128,0],toColor:[128,0,0]}]},{id:"whiteToBlack_predefined",fromColor:[255,255,255],toColor:[0,0,0]},{id:"yellowToDarkRed_predefined",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[242,167,46]},{fromColor:[242,167,46],toColor:[107,0,0]}]},{id:"yellowToGreenToDarkBlue_predefined",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[56,224,9]},{fromColor:[56,224,9],toColor:[26,147,171]},{fromColor:[26,147,171],toColor:[12,16,120]}]},{id:"yellowToRed_predefined",fromColor:[245,245,0],toColor:[255,0,0]},{id:"yellowGreenBright_predefined",fromColor:[236,252,204],toColor:[157,204,16]},{id:"yellowGreenLightToDark_predefined",fromColor:[215,240,175],toColor:[96,107,45]}],a={aspect_predefined:"Aspect",blackToWhite_predefined:"Black to White",blueBright_predefined:"Blue Bright",blueLightToDark_predefined:"Blue Light to Dark",blueGreenBright_predefined:"Blue-Green Bright",blueGreenLightToDark_predefined:"Blue-Green Light to Dark",brownLightToDark_predefined:"Brown Light to Dark",brownToBlueGreenDivergingBright_predefined:"Brown to Blue Green Diverging, Bright",brownToBlueGreenDivergingDark_predefined:"Brown to Blue Green Diverging, Dark",coefficientBias_predefined:"Coefficient Bias",coldToHotDiverging_predefined:"Cold to Hot Diverging",conditionNumber_predefined:"Condition Number",cyanToPurple_predefined:"Cyan to Purple",cyanLightToBlueDark_predefined:"Cyan-Light to Blue-Dark",distance_predefined:"Distance",elevation1_predefined:"Elevation #1",elevation2_predefined:"Elevation #2",errors_predefined:"Errors",grayLightToDark_predefined:"Gray Light to Dark",greenBright_predefined:"Green Bright",greenLightToDark_predefined:"Green Light to Dark",greenToBlue_predefined:"Green to Blue",orangeBright_predefined:"Orange Bright",orangeLightToDark_predefined:"Orange Light to Dark",partialSpectrum_predefined:"Partial Spectrum",partialSpectrum1Diverging_predefined:"Partial Spectrum 1 Diverging",partialSpectrum2Diverging_predefined:"Partial Spectrum 2 Diverging",pinkToYellowGreenDivergingBright_predefined:"Pink to YellowGreen Diverging, Bright",pinkToYellowGreenDivergingDark_predefined:"Pink to YellowGreen Diverging, Dark",precipitation_predefined:"Precipitation",prediction_predefined:"Prediction",purpleBright_predefined:"Purple Bright",purpleToGreenDivergingBright_predefined:"Purple to Green Diverging, Bright",purpleToGreenDivergingDark_predefined:"Purple to Green Diverging, Dark",purpleBlueBright_predefined:"Purple-Blue Bright",purpleBlueLightToDark_predefined:"Purple-Blue Light to Dark",purpleRedBright_predefined:"Purple-Red Bright",purpleRedLightToDark_predefined:"Purple-Red Light to Dark",redBright_predefined:"Red Bright",redLightToDark_predefined:"Red Light to Dark",redToBlueDivergingBright_predefined:"Red to Blue Diverging, Bright",redToBlueDivergingDark_predefined:"Red to Blue Diverging, Dark",redToGreen_predefined:"Red to Green",redToGreenDivergingBright_predefined:"Red to Green Diverging, Bright",redToGreenDivergingDark_predefined:"Red to Green Diverging, Dark",slope_predefined:"Slope",spectrumFullBright_predefined:"Spectrum-Full Bright",spectrumFullDark_predefined:"Spectrum-Full Dark",spectrumFullLight_predefined:"Spectrum-Full Light",surface_predefined:"Surface",temperature_predefined:"Temperature",whiteToBlack_predefined:"White to Black",yellowToDarkRed_predefined:"Yellow to Dark Red",yellowToGreenToDarkBlue_predefined:"Yellow to Green to Dark Blue",yellowToRed_predefined:"Yellow to Red",yellowGreenBright_predefined:"Yellow-Green Bright",yellowGreenLightToDark_predefined:"Yellow-Green Light to Dark"};function s(e,t){if(!e||!t||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]>t[r]+2||e[r]<t[r]-2)return!1;return!0}function l(e,t,r){const i=(0,n.Y3)(e),o=(0,n.Y3)(t),a={l:i.l*(1-r)+r*o.l,a:i.a*(1-r)+r*o.a,b:i.b*(1-r)+r*o.b};return(0,n.xr)(a)}function f(e){const t=function(e,t){if(!e)return;const r=o;let n,a=null;return"algorithmic"===e.type?r.some((t=>{if(s(e.fromColor.toRgb(),t.fromColor)&&s(e.toColor.toRgb(),t.toColor))return a=t.id,!0})):"multipart"===e.type&&r.some((t=>{if(e.colorRamps&&t.colorRamps&&e.colorRamps.length===t.colorRamps.length&&(n=e.colorRamps,!t.colorRamps.some(((e,t)=>{if(!s(n[t].fromColor.toRgb(),new i.Z(e.fromColor).toRgb())||!s(n[t].toColor.toRgb(),new i.Z(e.toColor).toRgb()))return!0})))){if(a)return!0;a=t.id}})),a}(e);return t?a[t]:null}function u(e,t,r=!1){if(!e||!t||t<1)return;const i="toJSON"in e?e.toJSON():e,n="multipart"===i.type?i.colorRamps.length:1,o=[],a=[];let s,f,u,h,c,d=0;if(1===t)return s="multipart"===i.type?i.colorRamps[0].fromColor:i.fromColor,a.push([0].concat(s)),a;for(let e=0;e<n;e++)o[e]={start:null,end:null},o[e].start=d,o[e].end=d+1/n,d=o[e].end;for(let e=0;e<t;e++)h=e/(t-1),o.forEach(((o,d)=>{if(h>=o.start&&(h<o.end||e===t-1&&d===n-1)){c=(h-o.start)/(o.end-o.start),"multipart"===i.type?(s=i.colorRamps[d].fromColor,f=i.colorRamps[d].toColor):(s=i.fromColor,f=i.toColor),0===e?a.push([e].concat(s.slice(0,3))):e===t-1?a.push([e].concat(f.slice(0,3))):(u=l({r:s[0],g:s[1],b:s[2]},{r:f[0],g:f[1],b:f[2]},c),a.push([e,u.r,u.g,u.b]));const n=null!=s[3]?s[3]>1?s[3]/255:s[3]:1,p=null!=f[3]?f[3]>1?f[3]/255:f[3]:1;r&&a[e].push(Math.min(255,Math.round(255*(n*(1-c)+p*c))))}}));return a}},23808:(e,t,r)=>{r.d(t,{z_:()=>s}),r(66577);var i=r(92604),n=(r(22021),r(95330)),o=r(77734);r(8744),r(6570);const a=i.Z.getLogger("esri.views.2d.engine.flow.dataUtils");async function s(e,t,r){const i=performance.now(),s=function(e,t){const r=function(e,t,r,i){if(0===i)return e;const n=Math.round(3*i),o=new Array(2*n+1);let a=0;for(let e=-n;e<=n;e++){const t=Math.exp(-e*e/(i*i));o[e+n]=t,a+=t}for(let e=-n;e<=n;e++)o[e+n]/=a;const s=new Float32Array(e.length);for(let i=0;i<r;i++)for(let r=0;r<t;r++){let a=0,l=0;for(let s=-n;s<=n;s++){if(r+s<0||r+s>=t)continue;const f=o[s+n];a+=f*e[2*(i*t+(r+s))+0],l+=f*e[2*(i*t+(r+s))+1]}s[2*(i*t+r)+0]=a,s[2*(i*t+r)+1]=l}const l=new Float32Array(e.length);for(let e=0;e<t;e++)for(let i=0;i<r;i++){let a=0,f=0;for(let l=-n;l<=n;l++){if(i+l<0||i+l>=r)continue;const u=o[l+n];a+=u*s[2*((i+l)*t+e)+0],f+=u*s[2*((i+l)*t+e)+1]}l[2*(i*t+e)+0]=a,l[2*(i*t+e)+1]=f}return l}(t.data,t.width,t.height,e.smoothing);return e.interpolate?(e,i)=>{const n=Math.floor(e),o=Math.floor(i);if(n<0||n>=t.width)return[0,0];if(o<0||o>=t.height)return[0,0];const a=e-n,s=i-o,l=n,f=o,u=n<t.width-1?n+1:n,h=o<t.height-1?o+1:o,c=r[2*(f*t.width+l)],d=r[2*(f*t.width+u)],p=r[2*(h*t.width+l)],m=r[2*(h*t.width+u)],g=r[2*(f*t.width+l)+1],y=r[2*(f*t.width+u)+1];return[(c*(1-s)+p*s)*(1-a)+(d*(1-s)+m*s)*a,(g*(1-s)+r[2*(h*t.width+l)+1]*s)*(1-a)+(y*(1-s)+r[2*(h*t.width+u)+1]*s)*a]}:(e,i)=>{const n=Math.round(e),o=Math.round(i);return n<0||n>=t.width||o<0||o>=t.height?[0,0]:[r[2*(o*t.width+n)+0],r[2*(o*t.width+n)+1]]}}(e,t),l=performance.now(),u=f(e,s,t.width,t.height),h=performance.now(),c=function(e,t){const r=new o.Z,i=e.reduce(((e,t)=>e+t.length),0),n=new Float32Array(3*i),a=new Array(e.length);let s=0,l=0;for(const t of e){const e=s;for(const e of t)n[3*s+0]=e.x,n[3*s+1]=e.y,n[3*s+2]=e.t,s++;a[l++]={startVertex:e,numberOfVertices:t.length,totalTime:t[t.length-1].t,timeSeed:r.getFloat()}}return{lineVertices:n,lineDescriptors:a}}(u),d=performance.now(),p=function(e,t=10){const{lineVertices:r,lineDescriptors:i}=e;let n=0,o=0;for(const e of i)n+=2*e.numberOfVertices,o+=6*(e.numberOfVertices-1);const a=new Float32Array(8*n),s=new Uint32Array(o);let l=0,f=0;function u(){s[f++]=l-2,s[f++]=l,s[f++]=l-1,s[f++]=l,s[f++]=l+1,s[f++]=l-1}function h(e,t,r,i,n,o,s){const f=8*l;let u=0;a[f+u++]=e,a[f+u++]=t,a[f+u++]=1,a[f+u++]=r,a[f+u++]=o,a[f+u++]=s,a[f+u++]=i,a[f+u++]=n,l++,a[f+u++]=e,a[f+u++]=t,a[f+u++]=-1,a[f+u++]=r,a[f+u++]=o,a[f+u++]=s,a[f+u++]=-i,a[f+u++]=-n,l++}for(const e of i){const{totalTime:i,timeSeed:n}=e;let o=null,a=null,s=null,l=null,f=null;for(let c=0;c<e.numberOfVertices;c++){const d=r[3*(e.startVertex+c)+0],p=r[3*(e.startVertex+c)+1],m=r[3*(e.startVertex+c)+2];let g=null,y=null,w=null,x=null;if(c>0){g=d-o,y=p-a;const e=Math.sqrt(g*g+y*y);if(g/=e,y/=e,c>1){let e=g+l,r=y+f;const i=Math.sqrt(e*e+r*r);e/=i,r/=i;const n=Math.min(1/(e*g+r*y),t);e*=n,r*=n,w=-r,x=e}else w=-y,x=g;null!==w&&null!==x&&(h(o,a,s,w,x,i,n),u())}o=d,a=p,s=m,l=g,f=y}h(o,a,s,-f,l,i,n)}return{vertexData:a,indexData:s}}(c),m=performance.now();if(e.profile){const e={"_createFlowFieldFromData()":Math.round(l-i),"_getStreamlines()":Math.round(h-l),"createAnimatedLinesData()":Math.round(d-h),"createLinesMesh()":Math.round(m-d),"Total elapsed time":Math.round(m-i)};a.info("createStreamlinesMesh profile",e)}return await Promise.resolve(),(0,n.k_)(r),p}function l(e,t,r,i,n,o,a,s,l){const f=[];let u,h,c=r,d=i,p=0;f.push({x:c,y:d,t:p});for(let r=0;r<e.verticesPerLine;r++){let[r,i]=t(c,d);r*=e.velocityScale,i*=e.velocityScale;const m=Math.sqrt(r*r+i*i);if(m<e.minSpeedThreshold)return f;const g=r/m,y=i/m;if(c+=g*e.segmentLength,d+=y*e.segmentLength,p+=e.segmentLength/m,Math.acos(g*u+y*h)>e.maxTurnAngle)return f;if(e.mergeLines){const e=Math.round(c*l),t=Math.round(d*l);if(e<0||e>a-1||t<0||t>s-1)return f;const r=o[t*a+e];if(-1!==r&&r!==n)return f;o[t*a+e]=n}f.push({x:c,y:d,t:p}),u=g,h=y}return f}function f(e,t,r,i){const n=[],a=new o.Z,s=1/Math.max(e.lineCollisionWidth,1),f=Math.round(r*s),u=Math.round(i*s),h=new Int32Array(f*u);for(let e=0;e<h.length;e++)h[e]=-1;const c=[];for(let t=0;t<i;t+=e.lineSpacing)for(let i=0;i<r;i+=e.lineSpacing)c.push({x:i,y:t,sort:a.getFloat()});c.sort(((e,t)=>e.sort-t.sort));for(const{x:r,y:i}of c)if(a.getFloat()<e.density){const o=l(e,t,r,i,n.length,h,f,u,s);if(o.length<2)continue;n.push(o)}return n}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[176],{97575:(e,t,r)=>{r.d(t,{J:()=>s});var i,n,o,a={exports:{}};i=a,n=function(){var e=function(){function e(e){this.message="JPEG error: "+e}return e.prototype=new Error,e.prototype.name="JpegError",e.constructor=e,e}();return function(){if(!self||!self.Uint8ClampedArray)return null;var t=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),r=4017,i=799,n=3406,o=2276,a=1567,s=3784,l=5793,f=2896;function u(){this.decodeTransform=null,this.colorTransform=-1}function h(e,t){for(var r,i,n=0,o=[],a=16;a>0&&!e[a-1];)a--;o.push({children:[],index:0});var s,l=o[0];for(r=0;r<a;r++){for(i=0;i<e[r];i++){for((l=o.pop()).children[l.index]=t[n];l.index>0;)l=o.pop();for(l.index++,o.push(l);o.length<=r;)o.push(s={children:[],index:0}),l.children[l.index]=s.children,l=s;n++}r+1<a&&(o.push(s={children:[],index:0}),l.children[l.index]=s.children,l=s)}return o[0].children}function c(e,t,r){return 64*((e.blocksPerLine+1)*t+r)}function d(r,i,n,o,a,s,l,f,u){var h=n.mcusPerLine,d=n.progressive,p=i,m=0,y=0;function w(){if(y>0)return y--,m>>y&1;if(255===(m=r[i++])){var t=r[i++];if(t)throw new e("unexpected marker "+(m<<8|t).toString(16))}return y=7,m>>>7}function x(t){for(var r=t;;){if("number"==typeof(r=r[w()]))return r;if("object"!=typeof r)throw new e("invalid huffman sequence")}}function C(e){for(var t=0;e>0;)t=t<<1|w(),e--;return t}function b(e){if(1===e)return 1===w()?1:-1;var t=C(e);return t>=1<<e-1?t:t+(-1<<e)+1}var k,v=0,T=0;function S(e,t,r,i,n){var o=r%h;t(e,c(e,(r/h|0)*e.v+i,o*e.h+n))}function A(e,t,r){t(e,c(e,r/e.blocksPerLine|0,r%e.blocksPerLine))}var I,M,P,D,U,B,E=o.length;B=d?0===s?0===f?function(e,t){var r=x(e.huffmanTableDC),i=0===r?0:b(r)<<u;e.blockData[t]=e.pred+=i}:function(e,t){e.blockData[t]|=w()<<u}:0===f?function(e,r){if(v>0)v--;else for(var i=s,n=l;i<=n;){var o=x(e.huffmanTableAC),a=15&o,f=o>>4;if(0!==a){var h=t[i+=f];e.blockData[r+h]=b(a)*(1<<u),i++}else{if(f<15){v=C(f)+(1<<f)-1;break}i+=16}}}:function(r,i){for(var n,o,a=s,f=l,h=0;a<=f;){var c=t[a];switch(T){case 0:if(h=(o=x(r.huffmanTableAC))>>4,0==(n=15&o))h<15?(v=C(h)+(1<<h),T=4):(h=16,T=1);else{if(1!==n)throw new e("invalid ACn encoding");k=b(n),T=h?2:3}continue;case 1:case 2:r.blockData[i+c]?r.blockData[i+c]+=w()<<u:0==--h&&(T=2===T?3:0);break;case 3:r.blockData[i+c]?r.blockData[i+c]+=w()<<u:(r.blockData[i+c]=k<<u,T=0);break;case 4:r.blockData[i+c]&&(r.blockData[i+c]+=w()<<u)}a++}4===T&&0==--v&&(T=0)}:function(e,r){var i=x(e.huffmanTableDC),n=0===i?0:b(i);e.blockData[r]=e.pred+=n;for(var o=1;o<64;){var a=x(e.huffmanTableAC),s=15&a,l=a>>4;if(0!==s){var f=t[o+=l];e.blockData[r+f]=b(s),o++}else{if(l<15)break;o+=16}}};var L,R,O,_,G=0;for(R=1===E?o[0].blocksPerLine*o[0].blocksPerColumn:h*n.mcusPerColumn;G<R;){var V=a?Math.min(R-G,a):R;for(M=0;M<E;M++)o[M].pred=0;if(v=0,1===E)for(I=o[0],U=0;U<V;U++)A(I,B,G),G++;else for(U=0;U<V;U++){for(M=0;M<E;M++)for(O=(I=o[M]).h,_=I.v,P=0;P<_;P++)for(D=0;D<O;D++)S(I,B,G,P,D);G++}y=0,(L=g(r,i))&&L.invalid&&(console.log("decodeScan - unexpected MCU data, next marker is: "+L.invalid),i=L.offset);var F=L&&L.marker;if(!F||F<=65280)throw new e("marker was not found");if(!(F>=65488&&F<=65495))break;i+=2}return(L=g(r,i))&&L.invalid&&(console.log("decodeScan - unexpected Scan data, next marker is: "+L.invalid),i=L.offset),i-p}function p(t,u,h){var c,d,p,m,g,y,w,x,C,b,k,v,T,S,A,I,M,P=t.quantizationTable,D=t.blockData;if(!P)throw new e("missing required Quantization Table.");for(var U=0;U<64;U+=8)C=D[u+U],b=D[u+U+1],k=D[u+U+2],v=D[u+U+3],T=D[u+U+4],S=D[u+U+5],A=D[u+U+6],I=D[u+U+7],C*=P[U],0!=(b|k|v|T|S|A|I)?(b*=P[U+1],k*=P[U+2],v*=P[U+3],T*=P[U+4],S*=P[U+5],A*=P[U+6],I*=P[U+7],d=(c=(c=l*C+128>>8)+(d=l*T+128>>8)+1>>1)-d,M=(p=k)*s+(m=A)*a+128>>8,p=p*a-m*s+128>>8,w=(g=(g=f*(b-I)+128>>8)+(w=S<<4)+1>>1)-w,y=(x=(x=f*(b+I)+128>>8)+(y=v<<4)+1>>1)-y,m=(c=c+(m=M)+1>>1)-m,p=(d=d+p+1>>1)-p,M=g*o+x*n+2048>>12,g=g*n-x*o+2048>>12,x=M,M=y*i+w*r+2048>>12,y=y*r-w*i+2048>>12,w=M,h[U]=c+x,h[U+7]=c-x,h[U+1]=d+w,h[U+6]=d-w,h[U+2]=p+y,h[U+5]=p-y,h[U+3]=m+g,h[U+4]=m-g):(M=l*C+512>>10,h[U]=M,h[U+1]=M,h[U+2]=M,h[U+3]=M,h[U+4]=M,h[U+5]=M,h[U+6]=M,h[U+7]=M);for(var B=0;B<8;++B)C=h[B],0!=((b=h[B+8])|(k=h[B+16])|(v=h[B+24])|(T=h[B+32])|(S=h[B+40])|(A=h[B+48])|(I=h[B+56]))?(d=(c=4112+((c=l*C+2048>>12)+(d=l*T+2048>>12)+1>>1))-d,M=(p=k)*s+(m=A)*a+2048>>12,p=p*a-m*s+2048>>12,m=M,w=(g=(g=f*(b-I)+2048>>12)+(w=S)+1>>1)-w,y=(x=(x=f*(b+I)+2048>>12)+(y=v)+1>>1)-y,M=g*o+x*n+2048>>12,g=g*n-x*o+2048>>12,x=M,M=y*i+w*r+2048>>12,y=y*r-w*i+2048>>12,C=(C=(c=c+m+1>>1)+x)<16?0:C>=4080?255:C>>4,b=(b=(d=d+p+1>>1)+(w=M))<16?0:b>=4080?255:b>>4,k=(k=(p=d-p)+y)<16?0:k>=4080?255:k>>4,v=(v=(m=c-m)+g)<16?0:v>=4080?255:v>>4,T=(T=m-g)<16?0:T>=4080?255:T>>4,S=(S=p-y)<16?0:S>=4080?255:S>>4,A=(A=d-w)<16?0:A>=4080?255:A>>4,I=(I=c-x)<16?0:I>=4080?255:I>>4,D[u+B]=C,D[u+B+8]=b,D[u+B+16]=k,D[u+B+24]=v,D[u+B+32]=T,D[u+B+40]=S,D[u+B+48]=A,D[u+B+56]=I):(M=(M=l*C+8192>>14)<-2040?0:M>=2024?255:M+2056>>4,D[u+B]=M,D[u+B+8]=M,D[u+B+16]=M,D[u+B+24]=M,D[u+B+32]=M,D[u+B+40]=M,D[u+B+48]=M,D[u+B+56]=M)}function m(e,t){for(var r=t.blocksPerLine,i=t.blocksPerColumn,n=new Int16Array(64),o=0;o<i;o++)for(var a=0;a<r;a++)p(t,c(t,o,a),n);return t.blockData}function g(e,t,r){function i(t){return e[t]<<8|e[t+1]}var n=e.length-1,o=r<t?r:t;if(t>=n)return null;var a=i(t);if(a>=65472&&a<=65534)return{invalid:null,marker:a,offset:t};for(var s=i(o);!(s>=65472&&s<=65534);){if(++o>=n)return null;s=i(o)}return{invalid:a.toString(16),marker:s,offset:o}}return u.prototype={parse:function(r){function i(){var e=r[l]<<8|r[l+1];return l+=2,e}function n(){var e=i(),t=l+e-2,n=g(r,t,l);n&&n.invalid&&(console.log("readDataBlock - incorrect length, next marker is: "+n.invalid),t=n.offset);var o=r.subarray(l,t);return l+=o.length,o}function o(e){for(var t=Math.ceil(e.samplesPerLine/8/e.maxH),r=Math.ceil(e.scanLines/8/e.maxV),i=0;i<e.components.length;i++){G=e.components[i];var n=Math.ceil(Math.ceil(e.samplesPerLine/8)*G.h/e.maxH),o=Math.ceil(Math.ceil(e.scanLines/8)*G.v/e.maxV),a=t*G.h,s=r*G.v*64*(a+1);G.blockData=new Int16Array(s),G.blocksPerLine=n,G.blocksPerColumn=o}e.mcusPerLine=t,e.mcusPerColumn=r}var a,s,l=0,f=null,u=null,c=[],p=[],y=[],w=i();if(65496!==w)throw new e("SOI not found");for(w=i();65497!==w;){var x,C,b;switch(w){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var k=n();65504===w&&74===k[0]&&70===k[1]&&73===k[2]&&70===k[3]&&0===k[4]&&(f={version:{major:k[5],minor:k[6]},densityUnits:k[7],xDensity:k[8]<<8|k[9],yDensity:k[10]<<8|k[11],thumbWidth:k[12],thumbHeight:k[13],thumbData:k.subarray(14,14+3*k[12]*k[13])}),65518===w&&65===k[0]&&100===k[1]&&111===k[2]&&98===k[3]&&101===k[4]&&(u={version:k[5]<<8|k[6],flags0:k[7]<<8|k[8],flags1:k[9]<<8|k[10],transformCode:k[11]});break;case 65499:for(var v=i()+l-2;l<v;){var T=r[l++],S=new Uint16Array(64);if(T>>4==0)for(C=0;C<64;C++)S[t[C]]=r[l++];else{if(T>>4!=1)throw new e("DQT - invalid table spec");for(C=0;C<64;C++)S[t[C]]=i()}c[15&T]=S}break;case 65472:case 65473:case 65474:if(a)throw new e("Only single frame JPEGs supported");i(),(a={}).extended=65473===w,a.progressive=65474===w,a.precision=r[l++],a.scanLines=i(),a.samplesPerLine=i(),a.components=[],a.componentIds={};var A,I=r[l++],M=0,P=0;for(x=0;x<I;x++){A=r[l];var D=r[l+1]>>4,U=15&r[l+1];M<D&&(M=D),P<U&&(P=U);var B=r[l+2];b=a.components.push({h:D,v:U,quantizationId:B,quantizationTable:null}),a.componentIds[A]=b-1,l+=3}a.maxH=M,a.maxV=P,o(a);break;case 65476:var E=i();for(x=2;x<E;){var L=r[l++],R=new Uint8Array(16),O=0;for(C=0;C<16;C++,l++)O+=R[C]=r[l];var _=new Uint8Array(O);for(C=0;C<O;C++,l++)_[C]=r[l];x+=17+O,(L>>4==0?y:p)[15&L]=h(R,_)}break;case 65501:i(),s=i();break;case 65498:i();var G,V=r[l++],F=[];for(x=0;x<V;x++){var N=a.componentIds[r[l++]];G=a.components[N];var z=r[l++];G.huffmanTableDC=y[z>>4],G.huffmanTableAC=p[15&z],F.push(G)}var Z=r[l++],j=r[l++],H=r[l++],Y=d(r,l,a,F,s,Z,j,H>>4,15&H);l+=Y;break;case 65535:255!==r[l]&&l--;break;default:if(255===r[l-3]&&r[l-2]>=192&&r[l-2]<=254){l-=3;break}throw new e("unknown marker "+w.toString(16))}w=i()}for(this.width=a.samplesPerLine,this.height=a.scanLines,this.jfif=f,this.eof=l,this.adobe=u,this.components=[],x=0;x<a.components.length;x++){var J=c[(G=a.components[x]).quantizationId];J&&(G.quantizationTable=J),this.components.push({output:m(0,G),scaleX:G.h/a.maxH,scaleY:G.v/a.maxV,blocksPerLine:G.blocksPerLine,blocksPerColumn:G.blocksPerColumn})}this.numComponents=this.components.length},_getLinearizedBlockData:function(e,t){var r,i,n,o,a,s,l,f,u,h,c,d=this.width/e,p=this.height/t,m=0,g=this.components.length,y=e*t*g,w=new Uint8ClampedArray(y),x=new Uint32Array(e),C=4294967288;for(l=0;l<g;l++){for(i=(r=this.components[l]).scaleX*d,n=r.scaleY*p,m=l,c=r.output,o=r.blocksPerLine+1<<3,a=0;a<e;a++)f=0|a*i,x[a]=(f&C)<<3|7&f;for(s=0;s<t;s++)for(h=o*((f=0|s*n)&C)|(7&f)<<3,a=0;a<e;a++)w[m]=c[h+x[a]],m+=g}var b=this.decodeTransform;if(b)for(l=0;l<y;)for(f=0,u=0;f<g;f++,l++,u+=2)w[l]=(w[l]*b[u]>>8)+b[u+1];return w},_isColorConversionNeeded:function(){return this.adobe?!!this.adobe.transformCode:3===this.numComponents?0!==this.colorTransform:1===this.colorTransform},_convertYccToRgb:function(e){for(var t,r,i,n=0,o=e.length;n<o;n+=3)t=e[n],r=e[n+1],i=e[n+2],e[n]=t-179.456+1.402*i,e[n+1]=t+135.459-.344*r-.714*i,e[n+2]=t-226.816+1.772*r;return e},_convertYcckToRgb:function(e){for(var t,r,i,n,o=0,a=0,s=e.length;a<s;a+=4)t=e[a],r=e[a+1],i=e[a+2],n=e[a+3],e[o++]=r*(-660635669420364e-19*r+.000437130475926232*i-54080610064599e-18*t+.00048449797120281*n-.154362151871126)-122.67195406894+i*(-.000957964378445773*i+.000817076911346625*t-.00477271405408747*n+1.53380253221734)+t*(.000961250184130688*t-.00266257332283933*n+.48357088451265)+n*(-.000336197177618394*n+.484791561490776),e[o++]=107.268039397724+r*(219927104525741e-19*r-.000640992018297945*i+.000659397001245577*t+.000426105652938837*n-.176491792462875)+i*(-.000778269941513683*i+.00130872261408275*t+.000770482631801132*n-.151051492775562)+t*(.00126935368114843*t-.00265090189010898*n+.25802910206845)+n*(-.000318913117588328*n-.213742400323665),e[o++]=r*(-.000570115196973677*r-263409051004589e-19*i+.0020741088115012*t-.00288260236853442*n+.814272968359295)-20.810012546947+i*(-153496057440975e-19*i-.000132689043961446*t+.000560833691242812*n-.195152027534049)+t*(.00174418132927582*t-.00255243321439347*n+.116935020465145)+n*(-.000343531996510555*n+.24165260232407);return e},_convertYcckToCmyk:function(e){for(var t,r,i,n=0,o=e.length;n<o;n+=4)t=e[n],r=e[n+1],i=e[n+2],e[n]=434.456-t-1.402*i,e[n+1]=119.541-t+.344*r+.714*i,e[n+2]=481.816-t-1.772*r;return e},_convertCmykToRgb:function(e){for(var t,r,i,n,o=0,a=1/255,s=0,l=e.length;s<l;s+=4)t=e[s]*a,r=e[s+1]*a,i=e[s+2]*a,n=e[s+3]*a,e[o++]=255+t*(-4.387332384609988*t+54.48615194189176*r+18.82290502165302*i+212.25662451639585*n-285.2331026137004)+r*(1.7149763477362134*r-5.6096736904047315*i-17.873870861415444*n-5.497006427196366)+i*(-2.5217340131683033*i-21.248923337353073*n+17.5119270841813)-n*(21.86122147463605*n+189.48180835922747),e[o++]=255+t*(8.841041422036149*t+60.118027045597366*r+6.871425592049007*i+31.159100130055922*n-79.2970844816548)+r*(-15.310361306967817*r+17.575251261109482*i+131.35250912493976*n-190.9453302588951)+i*(4.444339102852739*i+9.8632861493405*n-24.86741582555878)-n*(20.737325471181034*n+187.80453709719578),e[o++]=255+t*(.8842522430003296*t+8.078677503112928*r+30.89978309703729*i-.23883238689178934*n-14.183576799673286)+r*(10.49593273432072*r+63.02378494754052*i+50.606957656360734*n-112.23884253719248)+i*(.03296041114873217*i+115.60384449646641*n-193.58209356861505)-n*(22.33816807309886*n+180.12613974708367);return e},getData:function(t,r,i){if(this.numComponents>4)throw new e("Unsupported color mode");var n=this._getLinearizedBlockData(t,r);if(1===this.numComponents&&i){for(var o=n.length,a=new Uint8ClampedArray(3*o),s=0,l=0;l<o;l++){var f=n[l];a[s++]=f,a[s++]=f,a[s++]=f}return a}if(3===this.numComponents&&this._isColorConversionNeeded())return this._convertYccToRgb(n);if(4===this.numComponents){if(this._isColorConversionNeeded())return i?this._convertYcckToRgb(n):this._convertYcckToCmyk(n);if(i)return this._convertCmykToRgb(n)}return n}},u}()},void 0!==(o=n())&&(i.exports=o);const s=a.exports},32321:(e,t,r)=>{r.d(t,{d:()=>u});var i=r(22021),n={};n.defaultNoDataValue=(0,i.oK)(-1/0),n.decode=function(e,t){var r=(t=t||{}).encodedMaskData||null===t.encodedMaskData,f=l(e,t.inputOffset||0,r),u=null!=t.noDataValue?(0,i.oK)(t.noDataValue):n.defaultNoDataValue,h=o(f,t.pixelType||Float32Array,t.encodedMaskData,u,t.returnMask),c={width:f.width,height:f.height,pixelData:h.resultPixels,minValue:f.pixels.minValue,maxValue:f.pixels.maxValue,noDataValue:u};return h.resultMask&&(c.maskData=h.resultMask),t.returnEncodedMask&&f.mask&&(c.encodedMaskData=f.mask.bitset?f.mask.bitset:null),t.returnFileInfo&&(c.fileInfo=a(f,u),t.computeUsedBitDepths&&(c.fileInfo.bitDepths=s(f))),c};var o=function(e,t,r,i,n){var o,a,s=0,l=e.pixels.numBlocksX,u=e.pixels.numBlocksY,h=Math.floor(e.width/l),c=Math.floor(e.height/u),d=2*e.maxZError;r=r||(e.mask?e.mask.bitset:null),o=new t(e.width*e.height),n&&r&&(a=new Uint8Array(e.width*e.height));for(var p,m,g=new Float32Array(h*c),y=0;y<=u;y++){var w=y!==u?c:e.height%u;if(0!==w)for(var x=0;x<=l;x++){var C=x!==l?h:e.width%l;if(0!==C){var b,k,v,T,S=y*e.width*c+x*h,A=e.width-C,I=e.pixels.blocks[s];if(I.encoding<2?(0===I.encoding?b=I.rawData:(f(I.stuffedData,I.bitsPerPixel,I.numValidPixels,I.offset,d,g,e.pixels.maxValue),b=g),k=0):v=2===I.encoding?0:I.offset,r)for(m=0;m<w;m++){for(7&S&&(T=r[S>>3],T<<=7&S),p=0;p<C;p++)7&S||(T=r[S>>3]),128&T?(a&&(a[S]=1),o[S++]=I.encoding<2?b[k++]:v):(a&&(a[S]=0),o[S++]=i),T<<=1;S+=A}else if(I.encoding<2)for(m=0;m<w;m++){for(p=0;p<C;p++)o[S++]=b[k++];S+=A}else for(m=0;m<w;m++)if(o.fill)o.fill(v,S,S+C),S+=C+A;else{for(p=0;p<C;p++)o[S++]=v;S+=A}if(1===I.encoding&&k!==I.numValidPixels)throw"Block and Mask do not match";s++}}}return{resultPixels:o,resultMask:a}},a=function(e,t){return{fileIdentifierString:e.fileIdentifierString,fileVersion:e.fileVersion,imageType:e.imageType,height:e.height,width:e.width,maxZError:e.maxZError,eofOffset:e.eofOffset,mask:e.mask?{numBlocksX:e.mask.numBlocksX,numBlocksY:e.mask.numBlocksY,numBytes:e.mask.numBytes,maxValue:e.mask.maxValue}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,numBytes:e.pixels.numBytes,maxValue:e.pixels.maxValue,minValue:e.pixels.minValue,noDataValue:t}}},s=function(e){for(var t=e.pixels.numBlocksX*e.pixels.numBlocksY,r={},i=0;i<t;i++){var n=e.pixels.blocks[i];0===n.encoding?r.float32=!0:1===n.encoding?r[n.bitsPerPixel]=!0:r[0]=!0}return Object.keys(r)},l=function(e,t,r){var i={},n=new Uint8Array(e,t,10);if(i.fileIdentifierString=String.fromCharCode.apply(null,n),"CntZImage"!=i.fileIdentifierString.trim())throw"Unexpected file identifier string: "+i.fileIdentifierString;t+=10;var o=new DataView(e,t,24);if(i.fileVersion=o.getInt32(0,!0),i.imageType=o.getInt32(4,!0),i.height=o.getUint32(8,!0),i.width=o.getUint32(12,!0),i.maxZError=o.getFloat64(16,!0),t+=24,!r)if(o=new DataView(e,t,16),i.mask={},i.mask.numBlocksY=o.getUint32(0,!0),i.mask.numBlocksX=o.getUint32(4,!0),i.mask.numBytes=o.getUint32(8,!0),i.mask.maxValue=o.getFloat32(12,!0),t+=16,i.mask.numBytes>0){var a=new Uint8Array(Math.ceil(i.width*i.height/8)),s=(o=new DataView(e,t,i.mask.numBytes)).getInt16(0,!0),l=2,f=0;do{if(s>0)for(;s--;)a[f++]=o.getUint8(l++);else{var u=o.getUint8(l++);for(s=-s;s--;)a[f++]=u}s=o.getInt16(l,!0),l+=2}while(l<i.mask.numBytes);if(-32768!==s||f<a.length)throw"Unexpected end of mask RLE encoding";i.mask.bitset=a,t+=i.mask.numBytes}else 0==(i.mask.numBytes|i.mask.numBlocksY|i.mask.maxValue)&&(a=new Uint8Array(Math.ceil(i.width*i.height/8)),i.mask.bitset=a);o=new DataView(e,t,16),i.pixels={},i.pixels.numBlocksY=o.getUint32(0,!0),i.pixels.numBlocksX=o.getUint32(4,!0),i.pixels.numBytes=o.getUint32(8,!0),i.pixels.maxValue=o.getFloat32(12,!0),t+=16;var h=i.pixels.numBlocksX,c=i.pixels.numBlocksY,d=h+(i.width%h>0?1:0),p=c+(i.height%c>0?1:0);i.pixels.blocks=new Array(d*p);for(var m=1e9,g=0,y=0;y<p;y++)for(var w=0;w<d;w++){var x=0,C=e.byteLength-t;o=new DataView(e,t,Math.min(10,C));var b={};i.pixels.blocks[g++]=b;var k=o.getUint8(0);if(x++,b.encoding=63&k,b.encoding>3)throw"Invalid block encoding ("+b.encoding+")";if(2!==b.encoding){if(0!==k&&2!==k){if(k>>=6,b.offsetType=k,2===k)b.offset=o.getInt8(1),x++;else if(1===k)b.offset=o.getInt16(1,!0),x+=2;else{if(0!==k)throw"Invalid block offset type";b.offset=o.getFloat32(1,!0),x+=4}if(m=Math.min(b.offset,m),1===b.encoding)if(k=o.getUint8(x),x++,b.bitsPerPixel=63&k,k>>=6,b.numValidPixelsType=k,2===k)b.numValidPixels=o.getUint8(x),x++;else if(1===k)b.numValidPixels=o.getUint16(x,!0),x+=2;else{if(0!==k)throw"Invalid valid pixel count type";b.numValidPixels=o.getUint32(x,!0),x+=4}}var v;if(t+=x,3!=b.encoding)if(0===b.encoding){var T=(i.pixels.numBytes-1)/4;if(T!==Math.floor(T))throw"uncompressed block has invalid length";v=new ArrayBuffer(4*T),new Uint8Array(v).set(new Uint8Array(e,t,4*T));for(var S=new Float32Array(v),A=0;A<S.length;A++)m=Math.min(m,S[A]);b.rawData=S,t+=4*T}else if(1===b.encoding){var I=Math.ceil(b.numValidPixels*b.bitsPerPixel/8),M=Math.ceil(I/4);v=new ArrayBuffer(4*M),new Uint8Array(v).set(new Uint8Array(e,t,I)),b.stuffedData=new Uint32Array(v),t+=I}}else t++,m=Math.min(m,0)}return i.pixels.minValue=m,i.eofOffset=t,i},f=function(e,t,r,i,n,o,a){var s,l,f,u=(1<<t)-1,h=0,c=0,d=Math.ceil((a-i)/n),p=4*e.length-Math.ceil(t*r/8);for(e[e.length-1]<<=8*p,s=0;s<r;s++){if(0===c&&(f=e[h++],c=32),c>=t)l=f>>>c-t&u,c-=t;else{var m=t-c;l=(f&u)<<m&u,l+=(f=e[h++])>>>(c=32-m)}o[s]=l<d?i+l*n:a}return o};const u=n.decode},29825:(e,t,r)=>{r.d(t,{L:()=>p,a:()=>G,b:()=>R,c:()=>M,d:()=>_,g:()=>P,i:()=>D,p:()=>L});var i,n,o,a,s=r(20095),l=r(97575),f=r(88781),u=r(9832),h=r(48279),c=r(80899),d={exports:{}};void 0!==(i={unstuff:function(e,t,r,i,n,o,a,s){var l,f,u,h,c,d=(1<<r)-1,p=0,m=0,g=4*e.length-Math.ceil(r*i/8);if(e[e.length-1]<<=8*g,n)for(l=0;l<i;l++)0===m&&(u=e[p++],m=32),m>=r?(f=u>>>m-r&d,m-=r):(f=(u&d)<<(h=r-m)&d,f+=(u=e[p++])>>>(m=32-h)),t[l]=n[f];else for(c=Math.ceil((s-o)/a),l=0;l<i;l++)0===m&&(u=e[p++],m=32),m>=r?(f=u>>>m-r&d,m-=r):(f=(u&d)<<(h=r-m)&d,f+=(u=e[p++])>>>(m=32-h)),t[l]=f<c?o+f*a:s},unstuffLUT:function(e,t,r,i,n,o){var a,s=(1<<t)-1,l=0,f=0,u=0,h=0,c=0,d=[],p=4*e.length-Math.ceil(t*r/8);e[e.length-1]<<=8*p;var m=Math.ceil((o-i)/n);for(f=0;f<r;f++)0===h&&(a=e[l++],h=32),h>=t?(c=a>>>h-t&s,h-=t):(c=(a&s)<<(u=t-h)&s,c+=(a=e[l++])>>>(h=32-u)),d[f]=c<m?i+c*n:o;return d.unshift(i),d},unstuff2:function(e,t,r,i,n,o,a,s){var l,f,u,h,c=(1<<r)-1,d=0,p=0,m=0;if(n)for(l=0;l<i;l++)0===p&&(u=e[d++],p=32,m=0),p>=r?(f=u>>>m&c,p-=r,m+=r):(f=u>>>m&c,p=32-(h=r-p),f|=((u=e[d++])&(1<<h)-1)<<r-h,m=h),t[l]=n[f];else{var g=Math.ceil((s-o)/a);for(l=0;l<i;l++)0===p&&(u=e[d++],p=32,m=0),p>=r?(f=u>>>m&c,p-=r,m+=r):(f=u>>>m&c,p=32-(h=r-p),f|=((u=e[d++])&(1<<h)-1)<<r-h,m=h),t[l]=f<g?o+f*a:s}return t},unstuffLUT2:function(e,t,r,i,n,o){var a,s=(1<<t)-1,l=0,f=0,u=0,h=0,c=0,d=0,p=[],m=Math.ceil((o-i)/n);for(f=0;f<r;f++)0===h&&(a=e[l++],h=32,d=0),h>=t?(c=a>>>d&s,h-=t,d+=t):(c=a>>>d&s,h=32-(u=t-h),c|=((a=e[l++])&(1<<u)-1)<<t-u,d=u),p[f]=c<m?i+c*n:o;return p.unshift(i),p},originalUnstuff:function(e,t,r,i){var n,o,a,s,l=(1<<r)-1,f=0,u=0,h=4*e.length-Math.ceil(r*i/8);for(e[e.length-1]<<=8*h,n=0;n<i;n++)0===u&&(a=e[f++],u=32),u>=r?(o=a>>>u-r&l,u-=r):(o=(a&l)<<(s=r-u)&l,o+=(a=e[f++])>>>(u=32-s)),t[n]=o;return t},originalUnstuff2:function(e,t,r,i){var n,o,a,s,l=(1<<r)-1,f=0,u=0,h=0;for(n=0;n<i;n++)0===u&&(a=e[f++],u=32,h=0),u>=r?(o=a>>>h&l,u-=r,h+=r):(o=a>>>h&l,u=32-(s=r-u),o|=((a=e[f++])&(1<<s)-1)<<r-s,h=s),t[n]=o;return t}},n={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(e){for(var t=65535,r=65535,i=e.length,n=Math.floor(i/2),o=0;n;){var a=n>=359?359:n;n-=a;do{t+=e[o++]<<8,r+=t+=e[o++]}while(--a);t=(65535&t)+(t>>>16),r=(65535&r)+(r>>>16)}return 1&i&&(r+=t+=e[o]<<8),((r=(65535&r)+(r>>>16))<<16|(t=(65535&t)+(t>>>16)))>>>0},readHeaderInfo:function(e,t){var r=t.ptr,i=new Uint8Array(e,r,6),n={};if(n.fileIdentifierString=String.fromCharCode.apply(null,i),0!==n.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+n.fileIdentifierString;r+=6;var o,a=new DataView(e,r,8),s=a.getInt32(0,!0);if(n.fileVersion=s,r+=4,s>=3&&(n.checksum=a.getUint32(4,!0),r+=4),a=new DataView(e,r,12),n.height=a.getUint32(0,!0),n.width=a.getUint32(4,!0),r+=8,s>=4?(n.numDims=a.getUint32(8,!0),r+=4):n.numDims=1,a=new DataView(e,r,40),n.numValidPixel=a.getUint32(0,!0),n.microBlockSize=a.getInt32(4,!0),n.blobSize=a.getInt32(8,!0),n.imageType=a.getInt32(12,!0),n.maxZError=a.getFloat64(16,!0),n.zMin=a.getFloat64(24,!0),n.zMax=a.getFloat64(32,!0),r+=40,t.headerInfo=n,t.ptr=r,s>=3&&(o=s>=4?52:48,this.computeChecksumFletcher32(new Uint8Array(e,r-o,n.blobSize-14))!==n.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(e,t){var r=t.headerInfo,i=this.getDataTypeArray(r.imageType),n=r.numDims*this.getDataTypeSize(r.imageType),o=this.readSubArray(e,t.ptr,i,n),a=this.readSubArray(e,t.ptr+n,i,n);t.ptr+=2*n;var s,l=!0;for(s=0;s<r.numDims;s++)if(o[s]!==a[s]){l=!1;break}return r.minValues=o,r.maxValues=a,l},readSubArray:function(e,t,r,i){var n;if(r===Uint8Array)n=new Uint8Array(e,t,i);else{var o=new ArrayBuffer(i);new Uint8Array(o).set(new Uint8Array(e,t,i)),n=new r(o)}return n},readMask:function(e,t){var r,i,n=t.ptr,o=t.headerInfo,a=o.width*o.height,s=o.numValidPixel,l=new DataView(e,n,4),f={};if(f.numBytes=l.getUint32(0,!0),n+=4,(0===s||a===s)&&0!==f.numBytes)throw"invalid mask";if(0===s)r=new Uint8Array(Math.ceil(a/8)),f.bitset=r,i=new Uint8Array(a),t.pixels.resultMask=i,n+=f.numBytes;else if(f.numBytes>0){r=new Uint8Array(Math.ceil(a/8));var u=(l=new DataView(e,n,f.numBytes)).getInt16(0,!0),h=2,c=0,d=0;do{if(u>0)for(;u--;)r[c++]=l.getUint8(h++);else for(d=l.getUint8(h++),u=-u;u--;)r[c++]=d;u=l.getInt16(h,!0),h+=2}while(h<f.numBytes);if(-32768!==u||c<r.length)throw"Unexpected end of mask RLE encoding";i=new Uint8Array(a);var p=0,m=0;for(m=0;m<a;m++)7&m?(p=r[m>>3],p<<=7&m):p=r[m>>3],128&p&&(i[m]=1);t.pixels.resultMask=i,f.bitset=r,n+=f.numBytes}return t.ptr=n,t.mask=f,!0},readDataOneSweep:function(e,t,r,i){var o,a=t.ptr,s=t.headerInfo,l=s.numDims,f=s.width*s.height,u=s.imageType,h=s.numValidPixel*n.getDataTypeSize(u)*l,c=t.pixels.resultMask;if(r===Uint8Array)o=new Uint8Array(e,a,h);else{var d=new ArrayBuffer(h);new Uint8Array(d).set(new Uint8Array(e,a,h)),o=new r(d)}if(o.length===f*l)t.pixels.resultPixels=i?n.swapDimensionOrder(o,f,l,r,!0):o;else{t.pixels.resultPixels=new r(f*l);var p=0,m=0,g=0,y=0;if(l>1){if(i){for(m=0;m<f;m++)if(c[m])for(y=m,g=0;g<l;g++,y+=f)t.pixels.resultPixels[y]=o[p++]}else for(m=0;m<f;m++)if(c[m])for(y=m*l,g=0;g<l;g++)t.pixels.resultPixels[y+g]=o[p++]}else for(m=0;m<f;m++)c[m]&&(t.pixels.resultPixels[m]=o[p++])}return a+=h,t.ptr=a,!0},readHuffmanTree:function(e,t){var r=this.HUFFMAN_LUT_BITS_MAX,i=new DataView(e,t.ptr,16);if(t.ptr+=16,i.getInt32(0,!0)<2)throw"unsupported Huffman version";var a=i.getInt32(4,!0),s=i.getInt32(8,!0),l=i.getInt32(12,!0);if(s>=l)return!1;var f=new Uint32Array(l-s);n.decodeBits(e,t,f);var u,h,c,d,p=[];for(u=s;u<l;u++)p[h=u-(u<a?0:a)]={first:f[u-s],second:null};var m=e.byteLength-t.ptr,g=Math.ceil(m/4),y=new ArrayBuffer(4*g);new Uint8Array(y).set(new Uint8Array(e,t.ptr,m));var w,x=new Uint32Array(y),C=0,b=0;for(w=x[0],u=s;u<l;u++)(d=p[h=u-(u<a?0:a)].first)>0&&(p[h].second=w<<C>>>32-d,32-C>=d?32===(C+=d)&&(C=0,w=x[++b]):(C+=d-32,w=x[++b],p[h].second|=w>>>32-C));var k,v=0,T=new o;for(u=0;u<p.length;u++)void 0!==p[u]&&(v=Math.max(v,p[u].first));k=v>=r?r:v;var S,A,I,M,P,D=[];for(u=s;u<l;u++)if((d=p[h=u-(u<a?0:a)].first)>0)if(S=[d,h],d<=k)for(A=p[h].second<<k-d,I=1<<k-d,c=0;c<I;c++)D[A|c]=S;else for(A=p[h].second,P=T,M=d-1;M>=0;M--)A>>>M&1?(P.right||(P.right=new o),P=P.right):(P.left||(P.left=new o),P=P.left),0!==M||P.val||(P.val=S[1]);return{decodeLut:D,numBitsLUTQick:k,numBitsLUT:v,tree:T,stuffedData:x,srcPtr:b,bitPos:C}},readHuffman:function(e,t,r,i){var o,a,s,l,f,u,h,c,d,p=t.headerInfo.numDims,m=t.headerInfo.height,g=t.headerInfo.width,y=g*m,w=this.readHuffmanTree(e,t),x=w.decodeLut,C=w.tree,b=w.stuffedData,k=w.srcPtr,v=w.bitPos,T=w.numBitsLUTQick,S=w.numBitsLUT,A=0===t.headerInfo.imageType?128:0,I=t.pixels.resultMask,M=0;v>0&&(k++,v=0);var P,D=b[k],U=1===t.encodeMode,B=new r(y*p),E=B;if(p<2||U){for(P=0;P<p;P++)if(p>1&&(E=new r(B.buffer,y*P,y),M=0),t.headerInfo.numValidPixel===g*m)for(c=0,u=0;u<m;u++)for(h=0;h<g;h++,c++){if(a=0,f=l=D<<v>>>32-T,32-v<T&&(f=l|=b[k+1]>>>64-v-T),x[f])a=x[f][1],v+=x[f][0];else for(f=l=D<<v>>>32-S,32-v<S&&(f=l|=b[k+1]>>>64-v-S),o=C,d=0;d<S;d++)if(!(o=l>>>S-d-1&1?o.right:o.left).left&&!o.right){a=o.val,v=v+d+1;break}v>=32&&(v-=32,D=b[++k]),s=a-A,U?(s+=h>0?M:u>0?E[c-g]:M,s&=255,E[c]=s,M=s):E[c]=s}else for(c=0,u=0;u<m;u++)for(h=0;h<g;h++,c++)if(I[c]){if(a=0,f=l=D<<v>>>32-T,32-v<T&&(f=l|=b[k+1]>>>64-v-T),x[f])a=x[f][1],v+=x[f][0];else for(f=l=D<<v>>>32-S,32-v<S&&(f=l|=b[k+1]>>>64-v-S),o=C,d=0;d<S;d++)if(!(o=l>>>S-d-1&1?o.right:o.left).left&&!o.right){a=o.val,v=v+d+1;break}v>=32&&(v-=32,D=b[++k]),s=a-A,U?(h>0&&I[c-1]?s+=M:u>0&&I[c-g]?s+=E[c-g]:s+=M,s&=255,E[c]=s,M=s):E[c]=s}}else for(c=0,u=0;u<m;u++)for(h=0;h<g;h++)if(c=u*g+h,!I||I[c])for(P=0;P<p;P++,c+=y){if(a=0,f=l=D<<v>>>32-T,32-v<T&&(f=l|=b[k+1]>>>64-v-T),x[f])a=x[f][1],v+=x[f][0];else for(f=l=D<<v>>>32-S,32-v<S&&(f=l|=b[k+1]>>>64-v-S),o=C,d=0;d<S;d++)if(!(o=l>>>S-d-1&1?o.right:o.left).left&&!o.right){a=o.val,v=v+d+1;break}v>=32&&(v-=32,D=b[++k]),s=a-A,E[c]=s}t.ptr=t.ptr+4*(k+1)+(v>0?4:0),t.pixels.resultPixels=B,p>1&&!i&&(t.pixels.resultPixels=n.swapDimensionOrder(B,y,p,r))},decodeBits:function(e,t,r,n,o){var a=t.headerInfo,s=a.fileVersion,l=0,f=e.byteLength-t.ptr>=5?5:e.byteLength-t.ptr,u=new DataView(e,t.ptr,f),h=u.getUint8(0);l++;var c=h>>6,d=0===c?4:3-c,p=(32&h)>0,m=31&h,g=0;if(1===d)g=u.getUint8(l),l++;else if(2===d)g=u.getUint16(l,!0),l+=2;else{if(4!==d)throw"Invalid valid pixel count type";g=u.getUint32(l,!0),l+=4}var y,w,x,C,b,k,v,T,S,A=2*a.maxZError,I=a.numDims>1?a.maxValues[o]:a.zMax;if(p){for(t.counter.lut++,T=u.getUint8(l),l++,C=Math.ceil((T-1)*m/8),b=Math.ceil(C/4),w=new ArrayBuffer(4*b),x=new Uint8Array(w),t.ptr+=l,x.set(new Uint8Array(e,t.ptr,C)),v=new Uint32Array(w),t.ptr+=C,S=0;T-1>>>S;)S++;C=Math.ceil(g*S/8),b=Math.ceil(C/4),w=new ArrayBuffer(4*b),(x=new Uint8Array(w)).set(new Uint8Array(e,t.ptr,C)),y=new Uint32Array(w),t.ptr+=C,k=s>=3?i.unstuffLUT2(v,m,T-1,n,A,I):i.unstuffLUT(v,m,T-1,n,A,I),s>=3?i.unstuff2(y,r,S,g,k):i.unstuff(y,r,S,g,k)}else t.counter.bitstuffer++,S=m,t.ptr+=l,S>0&&(C=Math.ceil(g*S/8),b=Math.ceil(C/4),w=new ArrayBuffer(4*b),(x=new Uint8Array(w)).set(new Uint8Array(e,t.ptr,C)),y=new Uint32Array(w),t.ptr+=C,s>=3?null==n?i.originalUnstuff2(y,r,S,g):i.unstuff2(y,r,S,g,!1,n,A,I):null==n?i.originalUnstuff(y,r,S,g):i.unstuff(y,r,S,g,!1,n,A,I))},readTiles:function(e,t,r,i){var o=t.headerInfo,a=o.width,s=o.height,l=a*s,f=o.microBlockSize,u=o.imageType,h=n.getDataTypeSize(u),c=Math.ceil(a/f),d=Math.ceil(s/f);t.pixels.numBlocksY=d,t.pixels.numBlocksX=c,t.pixels.ptr=0;var p,m,g,y,w,x,C,b,k,v,T=0,S=0,A=0,I=0,M=0,P=0,D=0,U=0,B=0,E=0,L=0,R=0,O=0,_=0,G=0,V=new r(f*f),F=s%f||f,N=a%f||f,z=o.numDims,Z=t.pixels.resultMask,j=t.pixels.resultPixels,H=o.fileVersion>=5?14:15,Y=o.zMax;for(A=0;A<d;A++)for(M=A!==d-1?f:F,I=0;I<c;I++)for(E=A*a*f+I*f,L=a-(P=I!==c-1?f:N),b=0;b<z;b++){if(z>1?(v=j,E=A*a*f+I*f,j=new r(t.pixels.resultPixels.buffer,l*b*h,l),Y=o.maxValues[b]):v=null,D=e.byteLength-t.ptr,m={},G=0,U=(p=new DataView(e,t.ptr,Math.min(10,D))).getUint8(0),G++,k=o.fileVersion>=5?4&U:0,B=U>>6&255,(U>>2&H)!=(I*f>>3&H))throw"integrity issue";if(k&&0===b)throw"integrity issue";if((w=3&U)>3)throw t.ptr+=G,"Invalid block encoding ("+w+")";if(2!==w)if(0===w){if(k)throw"integrity issue";if(t.counter.uncompressed++,t.ptr+=G,R=(R=M*P*h)<(O=e.byteLength-t.ptr)?R:O,g=new ArrayBuffer(R%h==0?R:R+h-R%h),new Uint8Array(g).set(new Uint8Array(e,t.ptr,R)),y=new r(g),_=0,Z)for(T=0;T<M;T++){for(S=0;S<P;S++)Z[E]&&(j[E]=y[_++]),E++;E+=L}else for(T=0;T<M;T++){for(S=0;S<P;S++)j[E++]=y[_++];E+=L}t.ptr+=_*h}else if(x=n.getDataTypeUsed(k&&u<6?4:u,B),C=n.getOnePixel(m,G,x,p),G+=n.getDataTypeSize(x),3===w)if(t.ptr+=G,t.counter.constantoffset++,Z)for(T=0;T<M;T++){for(S=0;S<P;S++)Z[E]&&(j[E]=k?Math.min(Y,v[E]+C):C),E++;E+=L}else for(T=0;T<M;T++){for(S=0;S<P;S++)j[E]=k?Math.min(Y,v[E]+C):C,E++;E+=L}else if(t.ptr+=G,n.decodeBits(e,t,V,C,b),G=0,k)if(Z)for(T=0;T<M;T++){for(S=0;S<P;S++)Z[E]&&(j[E]=V[G++]+v[E]),E++;E+=L}else for(T=0;T<M;T++){for(S=0;S<P;S++)j[E]=V[G++]+v[E],E++;E+=L}else if(Z)for(T=0;T<M;T++){for(S=0;S<P;S++)Z[E]&&(j[E]=V[G++]),E++;E+=L}else for(T=0;T<M;T++){for(S=0;S<P;S++)j[E++]=V[G++];E+=L}else{if(k)if(Z)for(T=0;T<M;T++)for(S=0;S<P;S++)Z[E]&&(j[E]=v[E]),E++;else for(T=0;T<M;T++)for(S=0;S<P;S++)j[E]=v[E],E++;t.counter.constant++,t.ptr+=G}}z>1&&!i&&(t.pixels.resultPixels=n.swapDimensionOrder(t.pixels.resultPixels,l,z,r))},formatFileInfo:function(e){return{fileIdentifierString:e.headerInfo.fileIdentifierString,fileVersion:e.headerInfo.fileVersion,imageType:e.headerInfo.imageType,height:e.headerInfo.height,width:e.headerInfo.width,numValidPixel:e.headerInfo.numValidPixel,microBlockSize:e.headerInfo.microBlockSize,blobSize:e.headerInfo.blobSize,maxZError:e.headerInfo.maxZError,pixelType:n.getPixelType(e.headerInfo.imageType),eofOffset:e.eofOffset,mask:e.mask?{numBytes:e.mask.numBytes}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,maxValue:e.headerInfo.zMax,minValue:e.headerInfo.zMin,noDataValue:e.noDataValue}}},constructConstantSurface:function(e,t){var r=e.headerInfo.zMax,i=e.headerInfo.zMin,n=e.headerInfo.maxValues,o=e.headerInfo.numDims,a=e.headerInfo.height*e.headerInfo.width,s=0,l=0,f=0,u=e.pixels.resultMask,h=e.pixels.resultPixels;if(u)if(o>1){if(t)for(s=0;s<o;s++)for(f=s*a,r=n[s],l=0;l<a;l++)u[l]&&(h[f+l]=r);else for(l=0;l<a;l++)if(u[l])for(f=l*o,s=0;s<o;s++)h[f+o]=n[s]}else for(l=0;l<a;l++)u[l]&&(h[l]=r);else if(o>1&&i!==r)if(t)for(s=0;s<o;s++)for(f=s*a,r=n[s],l=0;l<a;l++)h[f+l]=r;else for(l=0;l<a;l++)for(f=l*o,s=0;s<o;s++)h[f+s]=n[s];else for(l=0;l<a*o;l++)h[l]=r},getDataTypeArray:function(e){var t;switch(e){case 0:t=Int8Array;break;case 1:t=Uint8Array;break;case 2:t=Int16Array;break;case 3:t=Uint16Array;break;case 4:t=Int32Array;break;case 5:t=Uint32Array;break;case 6:default:t=Float32Array;break;case 7:t=Float64Array}return t},getPixelType:function(e){var t;switch(e){case 0:t="S8";break;case 1:t="U8";break;case 2:t="S16";break;case 3:t="U16";break;case 4:t="S32";break;case 5:t="U32";break;case 6:default:t="F32";break;case 7:t="F64"}return t},isValidPixelValue:function(e,t){if(null==t)return!1;var r;switch(e){case 0:r=t>=-128&&t<=127;break;case 1:r=t>=0&&t<=255;break;case 2:r=t>=-32768&&t<=32767;break;case 3:r=t>=0&&t<=65536;break;case 4:r=t>=-2147483648&&t<=2147483647;break;case 5:r=t>=0&&t<=4294967296;break;case 6:r=t>=-34027999387901484e22&&t<=34027999387901484e22;break;case 7:r=t>=5e-324&&t<=17976931348623157e292;break;default:r=!1}return r},getDataTypeSize:function(e){var t=0;switch(e){case 0:case 1:t=1;break;case 2:case 3:t=2;break;case 4:case 5:case 6:t=4;break;case 7:t=8;break;default:t=e}return t},getDataTypeUsed:function(e,t){var r=e;switch(e){case 2:case 4:r=e-t;break;case 3:case 5:r=e-2*t;break;case 6:r=0===t?e:1===t?2:1;break;case 7:r=0===t?e:e-2*t+1;break;default:r=e}return r},getOnePixel:function(e,t,r,i){var n=0;switch(r){case 0:n=i.getInt8(t);break;case 1:n=i.getUint8(t);break;case 2:n=i.getInt16(t,!0);break;case 3:n=i.getUint16(t,!0);break;case 4:n=i.getInt32(t,!0);break;case 5:n=i.getUInt32(t,!0);break;case 6:n=i.getFloat32(t,!0);break;case 7:n=i.getFloat64(t,!0);break;default:throw"the decoder does not understand this pixel type"}return n},swapDimensionOrder:function(e,t,r,i,n){var o=0,a=0,s=0,l=0,f=e;if(r>1)if(f=new i(t*r),n)for(o=0;o<t;o++)for(l=o,s=0;s<r;s++,l+=t)f[l]=e[a++];else for(o=0;o<t;o++)for(l=o,s=0;s<r;s++,l+=t)f[a++]=e[l];return f}},o=function(e,t,r){this.val=e,this.left=t,this.right=r},a={decode:function(e,t){var r=(t=t||{}).noDataValue,i=0,o={};o.ptr=t.inputOffset||0,o.pixels={},n.readHeaderInfo(e,o);var a=o.headerInfo,s=a.fileVersion,l=n.getDataTypeArray(a.imageType);if(s>5)throw"unsupported lerc version 2."+s;n.readMask(e,o),a.numValidPixel===a.width*a.height||o.pixels.resultMask||(o.pixels.resultMask=t.maskData);var f=a.width*a.height;o.pixels.resultPixels=new l(f*a.numDims),o.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0};var u,h=!t.returnPixelInterleavedDims;if(0!==a.numValidPixel)if(a.zMax===a.zMin)n.constructConstantSurface(o,h);else if(s>=4&&n.checkMinMaxRanges(e,o))n.constructConstantSurface(o,h);else{var c=new DataView(e,o.ptr,2),d=c.getUint8(0);if(o.ptr++,d)n.readDataOneSweep(e,o,l,h);else if(s>1&&a.imageType<=1&&Math.abs(a.maxZError-.5)<1e-5){var p=c.getUint8(1);if(o.ptr++,o.encodeMode=p,p>2||s<4&&p>1)throw"Invalid Huffman flag "+p;p?n.readHuffman(e,o,l,h):n.readTiles(e,o,l,h)}else n.readTiles(e,o,l,h)}o.eofOffset=o.ptr,t.inputOffset?(u=o.headerInfo.blobSize+t.inputOffset-o.ptr,Math.abs(u)>=1&&(o.eofOffset=t.inputOffset+o.headerInfo.blobSize)):(u=o.headerInfo.blobSize-o.ptr,Math.abs(u)>=1&&(o.eofOffset=o.headerInfo.blobSize));var m={width:a.width,height:a.height,pixelData:o.pixels.resultPixels,minValue:a.zMin,maxValue:a.zMax,validPixelCount:a.numValidPixel,dimCount:a.numDims,dimStats:{minValues:a.minValues,maxValues:a.maxValues},maskData:o.pixels.resultMask};if(o.pixels.resultMask&&n.isValidPixelValue(a.imageType,r)){var g=o.pixels.resultMask;for(i=0;i<f;i++)g[i]||(m.pixelData[i]=r);m.noDataValue=r}return o.noDataValue=r,t.returnFileInfo&&(m.fileInfo=n.formatFileInfo(o)),m},getBandCount:function(e){for(var t=0,r=0,i={ptr:0,pixels:{}};r<e.byteLength-58;)n.readHeaderInfo(e,i),r+=i.headerInfo.blobSize,t++,i.ptr=r;return t}})&&(d.exports=a);const p=d.exports,m=[0,1,1,2,4,8,1,1,2,4,8,4,8,-1,-1,-1,8,8,8],g=4294967296,y=new Set([1,5,6,7,8,34712,34887]);function w(e,t){let r="unknown";return 3===e?r="f32":1===e?1===t?r="u1":2===t?r="u2":4===t?r="u4":t<=8?r="u8":t<=16?r="u16":t<=32&&(r="u32"):2===e&&(t<=8?r="s8":t<=16?r="s16":t<=32&&(r="s32")),r}function x(e){let t=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":t=Uint8Array;break;case"u16":t=Uint16Array;break;case"u32":t=Uint32Array;break;case"s8":t=Int8Array;break;case"s16":t=Int16Array;break;case"s32":t=Int32Array;break;default:t=Float32Array}return t}function C(e,t){return{x:t[0]*e.x+t[1]*e.y+t[2],y:t[3]*e.x+t[4]*e.y+t[5]}}function b(e,t){var r;return null==(r=e.get(t))?void 0:r.values}function k(e,t){var r;return null==(r=e.get(t))?void 0:r.values}function v(e,t){var r;return null==(r=e.get(t))?void 0:r.values[0]}function T(e,t){var r;return null==(r=e.get(t))?void 0:r.values[0]}function S(e,t,r,i=0,n=u.Z.TIFF_TAGS,o=4){const a=8===o,s=a?U(new DataView(e,r,8),0,t):new DataView(e,r,2).getUint16(0,t),l=4+2*o,f=a?8:2,h=f+s*l;if(r+h>e.byteLength)return{success:!1,ifd:null,nextIFD:null,requiredBufferSize:h};const c=r+h+4<=e.byteLength?E(new DataView(e,r+h,8===o?8:4),0,t,8===o):null,d=r+f,p=new Map;let m,g,y,w,x,C,b;for(let r=0;r<s;r++){g=new DataView(e,d+l*r,l),y=g.getUint16(0,t),x=g.getUint16(2,t),w=u.Z.getTagName(y,n);const a=[];2===o?(C=g.getUint16(4,t),b=g.getUint16(6,t)):4===o?(C=g.getUint32(4,t),b=g.getUint32(8,t)):8===o&&(C=E(g,4,t,!0),b=E(g,12,t,!0),a.push(g.getUint32(12,t)),a.push(g.getUint32(16,t))),m={id:y,type:x,valueCount:C,valueOffset:b,valueOffsets:a,values:null},M(e,t,m,i,!1,o),p.set(w,m)}return{success:!0,ifd:p,nextIFD:c,requiredBufferSize:h}}const A=function(e,t){return p.decode(e,{inputOffset:t,returnFileInfo:!0}).pixelData},I=function(e,t,r,i,n){var o,a;const s=h.f===t,u=T(r,"BITSPERSAMPLE"),d=w(null!=(o=T(r,"SAMPLEFORMAT"))?o:1,u),p=null!=(a=T(r,"COMPRESSION"))?a:1,m=x(d);let g,y,C,b,k,v,S;if(34887===p)return A(e,i);if(1===p)C=e.slice(i,i+n),b=new Uint8Array(C);else if(8===p||32946===p)b=new Uint8Array(e,i,n),v=new c.Z(b),S=v.getBytes(),C=new ArrayBuffer(S.length),b=new Uint8Array(C),b.set(S);else if(6===p){b=new Uint8Array(e,i,n);const t=new l.J;t.parse(b);const r=t.getData(t.width,t.height,!0);C=new ArrayBuffer(r.length),b=new Uint8Array(C),b.set(r)}else if(7===p){const t=r.get("JPEGTABLES").values,o=t.length-2;b=new Uint8Array(o+n-2);for(let e=0;e<o;e++)b[e]=t[e];const a=new Uint8Array(e,i+2,n-2);for(let e=0;e<a.length;e++)b[o+e]=a[e];const s=new l.J;s.parse(b);const f=s.getData(s.width,s.height,!0);C=new ArrayBuffer(f.length),b=new Uint8Array(C),b.set(f)}else 5===p&&(b=(0,f.J)(e,i,n,t),C=b.buffer);if("u8"===d||"s8"===d||s)y=new m(C);else{switch(C=new ArrayBuffer(b.length),k=new Uint8Array(C),d){case"u16":case"s16":for(g=0;g<b.length;g+=2)k[g]=b[g+1],k[g+1]=b[g];break;case"u32":case"s32":case"f32":for(g=0;g<b.length;g+=4)k[g]=b[g+3],k[g+1]=b[g+2],k[g+2]=b[g+1],k[g+3]=b[g]}y=new m(C)}return y};function M(e,t,r,i=0,n=!1,o=4){if(r.values)return!0;const a=r.type,s=r.valueCount;let l=r.valueOffset,f=[];const u=m[a],h=8*u,c=s*u,d=s*m[a]*8;let p,y;const w=8===o?64:32,x=r.valueOffsets;if(d>w&&c>(n?e.byteLength:e?e.byteLength-l+i:0))return r.offlineOffsetSize=[l,c],r.values=null,!1;if(d<=w){if(!t)if(w<=32)l>>>=32-d;else{const e=null!=x&&x.length?x[0]:l>>>0,t=null!=x&&x.length?x[1]:Math.round((l-e)/g);d<=32?(l=e>>>32-d,x[0]=l):(l=e*2**(32-d)+(t>>>32-d),x[0]=e,x[1]=t>>>32-d)}if(1===s&&h===w)f=[l];else if(64===w){const e=null!=x&&x.length?x[0]:l>>>0,t=null!=x&&x.length?x[1]:Math.round((l-e)/g);let r=e,i=32;for(y=1;y<=s;y++){const e=32-h*y%32;if(i<h){const n=r<<e>>>32-i,o=t<<32-i>>>32-i;r=t,f.push(n+o*2**(h-i)),i-=32-(h-i)}else f.push(r<<e>>>32-h),i-=h;0===i&&(i=32,r=t)}}else for(y=1;y<=s;y++){const e=32-h*y;f.push(l<<e>>>32-h)}}else{l-=i,n&&(l=0);for(let r=l;r<l+c;r+=u){switch(a){case 1:case 2:case 7:p=new DataView(e,r,1).getUint8(0);break;case 3:p=new DataView(e,r,2).getUint16(0,t);break;case 4:case 13:p=new DataView(e,r,4).getUint32(0,t);break;case 5:p=new DataView(e,r,4).getUint32(0,t)/new DataView(e,r+4,4).getUint32(0,t);break;case 6:p=new DataView(e,r,1).getInt8(0);break;case 8:p=new DataView(e,r,2).getInt16(0,t);break;case 9:p=new DataView(e,r,4).getInt32(0,t);break;case 10:p=new DataView(e,r,4).getInt32(0,t)/new DataView(e,r+4,4).getInt32(0,t);break;case 11:p=new DataView(e,r,4).getFloat32(0,t);break;case 12:p=new DataView(e,r,8).getFloat64(0,t);break;case 16:case 18:p=U(new DataView(e,r,8),0,t);break;case 17:p=B(new DataView(e,r,8),0,t);break;default:p=null}f.push(p)}}if(2===a){let e="";const t=f;for(f=[],y=0;y<t.length;y++)0===t[y]&&""!==e?(f.push(e),e=""):e+=String.fromCharCode(t[y]);""===e&&0!==f.length||f.push(e)}return r.values=f,!0}function P(e){var t,r;const i=e[0],n=T(i,"TILEWIDTH"),o=T(i,"TILELENGTH"),a=T(i,"IMAGEWIDTH"),s=T(i,"IMAGELENGTH"),l=T(i,"BITSPERSAMPLE"),f=T(i,"SAMPLESPERPIXEL"),u=null!=(t=T(i,"SAMPLEFORMAT"))?t:1,h=w(u,l),c=D(i),d=b(i,"GDAL_NODATA");let p;null!=d&&d.length&&(p=d.map((e=>parseFloat(e))),p.some((e=>isNaN(e)))&&(p=null));const m=null!=(r=T(i,"COMPRESSION"))?r:1;let g;switch(m){case 1:g="NONE";break;case 2:case 3:case 4:case 32771:g="CCITT";break;case 5:g="LZW";break;case 6:case 7:g="JPEG";break;case 32773:g="PACKBITS";break;case 8:case 32946:g="DEFLATE";break;case 34712:g="JPEG2000";break;case 34887:g="LERC";break;default:g=String(m)}let x=!0,S="";y.has(m)||(x=!1,S+="unsupported tag compression "+m),u>3&&(x=!1,S+="unsupported tag sampleFormat "+u),l%8!=0&&(x=!1,S+="unsupported tag bitsPerSample "+l);const A=v(i,"GEOASCIIPARAMS");let I;if(A){const e=A.split("|").filter((e=>e.indexOf("ESRI PE String = ")>-1))[0],t=e?e.replace("ESRI PE String = ",""):"";I=t.startsWith("COMPD_CS")||t.startsWith("PROJCS")||t.startsWith("GEOGCS")?{wkid:null,wkt:t}:null}const M=k(i,"GEOTIEPOINTS"),P=k(i,"GEOPIXELSCALE"),U=k(i,"GEOTRANSMATRIX"),B=i.has("GEOKEYDIRECTORY")?i.get("GEOKEYDIRECTORY").data:null;let E,L,R=!1;if(B){R=2===T(B,"GTRasterTypeGeoKey");const e=T(B,"GTModelTypeGeoKey");if(2===e){const e=T(B,"GeographicTypeGeoKey");e>=1024&&e<=32766&&(I={wkid:e})}else if(1===e){const e=T(B,"ProjectedCSTypeGeoKey");e>=1024&&e<=32766&&(I={wkid:e})}}if(P&&M&&M.length>=6?(E=[P[0],0,M[3]-M[0]*P[0],0,-Math.abs(P[1]),M[4]-M[1]*P[1]],R&&(E[2]-=.5*E[0]+.5*E[1],E[5]-=.5*E[3]+.5*E[4])):U&&16===U.length&&(E=R?[U[0],U[1],U[3]-.5*U[0],U[4],U[5],U[7]-.5*U[5]]:[U[0],U[1],U[3],U[4],U[5],U[7]]),E){const e=[{x:0,y:s},{x:0,y:0},{x:a,y:s},{x:a,y:0}];let t,r=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY;for(let a=0;a<e.length;a++)t=C(e[a],E),r=t.x>r?r:t.x,n=t.x<n?n:t.x,i=t.y>i?i:t.y,o=t.y<o?o:t.y;L={xmin:r,xmax:n,ymin:i,ymax:o,spatialReference:I}}else L={xmin:-.5,ymin:.5-s,xmax:a-.5,ymax:.5,spatialReference:I};const _=e.filter((e=>1===v(e,"NEWSUBFILETYPE")));let G,V,F,N,z;if(_.length>0){G=Math.round(Math.log(a/T(_[0],"IMAGEWIDTH"))/Math.LN2);const e=_[_.length-1];V=Math.round(Math.log(a/T(e,"IMAGEWIDTH"))/Math.LN2),F=T(e,"TILEWIDTH"),N=T(e,"TILELENGTH")}F=V>0?F||n:null,N=V>0?N||o:null,n&&(z=[{maxCol:Math.ceil(a/n)-1,maxRow:Math.ceil(s/o)-1,minRow:0,minCol:0}],_.forEach((e=>{z.push({maxCol:Math.ceil(T(e,"IMAGEWIDTH")/T(e,"TILEWIDTH"))-1,maxRow:Math.ceil(T(e,"IMAGELENGTH")/T(e,"TILELENGTH"))-1,minRow:0,minCol:0})})));const Z=function(e){if(!e)return null;const t=e.match(/<Item(.*?)Item>/gi);if(!t||0===t.length)return null;const r=new Map;let i,n,o,a,s;for(let e=0;e<t.length;e++)i=t[e],n=i.slice("<Item ".length,i.indexOf(">")),a=i.indexOf("sample="),a>-1&&(s=i.slice(a+'sample="'.length,i.indexOf('"',a+'sample="'.length))),a=i.indexOf("name="),a>-1&&(n=i.slice(a+'name="'.length,i.indexOf('"',a+'name="'.length))),n&&(o=i.slice(i.indexOf(">")+1,i.indexOf("</Item>")).trim(),null!=s?r.has(n)?r.get(n)[s]=o:r.set(n,[o]):r.set(n,o)),s=null;const l=r.get("STATISTICS_MINIMUM"),f=r.get("STATISTICS_MAXIMUM"),u=r.get("STATISTICS_MEAN"),h=r.get("STATISTICS_STDDEV");let c=null;if(l&&f){c=[];for(let e=0;e<l.length;e++)c.push({min:parseFloat(l[e]),max:parseFloat(f[e]),avg:u&&parseFloat(u[e]),stddev:h&&parseFloat(h[e])})}const d=r.get("BandName"),p=r.get("WavelengthMin"),m=r.get("WavelengthMax");let g=null;if(d){g=[];for(let e=0;e<d.length;e++)g.push({BandName:d[e],WavelengthMin:p&&parseFloat(p[e]),WavelengthMax:m&&parseFloat(m[e])})}return{statistics:c,bandProperties:g,dataType:r.get("DataType"),rawMetadata:r}}(v(e[0],"GDAL_METADATA"));return S+=" "+O({width:a,height:s,tileWidth:n,tileHeight:o,planes:f,ifds:e}),{width:a,height:s,tileWidth:n,tileHeight:o,planes:f,isBSQ:c,pixelType:h,compression:g,noData:p,isSupported:x,message:S,extent:L,affine:P?null:E,firstPyramidLevel:G,maximumPyramidLevel:V,pyramidBlockWidth:F,pyramidBlockHeight:N,tileBoundary:z,metadata:Z}}function D(e,t){const r=b(e,"PLANARCONFIGURATION");return r?2===r[0]:!!t&&t.isBSQ}function U(e,t,r){const i=e.getUint32(t,r),n=e.getUint32(t+4,r);return r?n*g+i:i*g+n}function B(e,t,r){let i=r?e.getInt32(t,r):e.getUint32(t,r),n=r?e.getUint32(t+4,r):e.getInt32(t+4,r);const o=(r?i:n)>=0?1:-1;return r?i*=o:n*=o,o*(r?n*g+i:i*g+n)}function E(e,t,r,i){return i?U(e,t,r):e.getUint32(t,r)}function L(e){const t=new DataView(e,0,16),r=t.getUint16(0,!1);let i=null;if(18761===r)i=!0;else{if(19789!==r)throw"unexpected endianess byte";i=!1}const n=t.getUint16(2,i);if(42!==n&&43!==n)throw"unexpected tiff identifier";let o=4;const a=43===n;if(a){const e=t.getUint16(o,i);if(o+=2,8!==e)throw"unsupported bigtiff version";if(0!==t.getUint16(o,i))throw"unsupported bigtiff version";o+=2}return{littleEndian:i,isBigTiff:a,firstIFD:E(t,o,i,a)}}function R(e,t,r,i=0,n=u.Z.TIFF_TAGS,o=4){const a=S(e,t,r,i,n,o);let l;const f=a.ifd;if(f){if(u.Z.ifdTags.forEach(((r,n)=>{f.has(n)&&(l=f.get(n),l.data=S(e,t,l.valueOffset-i,i,r).ifd)})),f.has("GEOKEYDIRECTORY")){l=f.get("GEOKEYDIRECTORY");const r=l.values;if(r&&r.length>4){const n=r[0]+"."+r[1]+"."+r[2];l.data=S(e,t,l.valueOffset+6-i,i,u.Z.GEO_KEYS,2).ifd,l.data&&l.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[n]})}}if(f.has("XMP")){l=f.get("XMP");const e=l.values;"number"==typeof e[0]&&7===l.type&&(l.values=[(0,s.f)(new Uint8Array(e))])}}return a}function O(e){const{width:t,height:r,tileHeight:i,tileWidth:n}=e,o=e.planes,a=n?n*i:t*r,s=T(e.ifds[0],"BITSPERSAMPLE");let l="";return a*o>2**30/(s>8?s/8:1)&&(l=n?"tiled tiff exceeding 1 gigabits per tile is not supported":"scanline tiff exceeding 1 gigabits is not supported"),l}function _(e,t){var r;const{headerInfo:i,ifd:n,offsets:o,sizes:a}=t,s=o.map(((t,r)=>I(e,i.littleEndian,n,t,a[r]||e.byteLength))),l=D(n,i),{pixelType:f,planes:u}=i,h=x(f),c=T(n,"TILEWIDTH"),d=T(n,"TILELENGTH"),p=null!=(r=T(n,"COMPRESSION"))?r:1,m=c*d;let g;const y=[];let w=s[0];const C=34887===p;for(let e=0;e<u;e++){if(g=new h(m),l&&C){w=s[e];for(let t=0;t<m;t++)g[t]=w[e][t+e]}else if(l||C&&!l)g=w.slice(m*e,m*(e+1));else for(let t=0;t<m;t++)g[t]=w[t*u+e];y.push(g)}const b=i.noData?i.noData[0]:null,k=i.metadata?i.metadata.statistics:null,v=k?k.map((e=>e.min)):null,S=k?k.map((e=>e.max)):null;let A,M;if(null!=b)if(A=new Uint8Array(m),Math.abs(b)>1e24)for(M=0;M<m;M++)Math.abs((y[0][M]-b)/b)<1e-6?A[M]=0:A[M]=1;else for(M=0;M<m;M++)y[0][M]===b?A[M]=0:A[M]=1;else v&&S&&t.applyMinMaxConstraint&&(A=function(e,t,r){if(!(e&&e.length>0&&t&&r))return null;let i,n,o;const a=e[0].length,s=e.length,l=new Uint8Array(a);for(let f=0;f<s;f++)if(i=e[f],n=t[f],o=r[f],0===f)for(let e=0;e<a;e++)l[e]=i[e]<n||i[e]>o?0:1;else for(let e=0;e<a;e++)l[e]&&(l[e]=i[e]<n||i[e]>o?0:1);return l}(y,v,S));return{pixelType:f,width:c,height:d,pixels:y,mask:A,noDataValue:b}}function G(e,t=0,r){r=r||function(e){const{littleEndian:t,isBigTiff:r,firstIFD:i}=L(e);let n=i;const o=[];do{const i=R(e,t,n,0,u.Z.TIFF_TAGS,r?8:4);if(!i.success)break;o.push(i.ifd),n=i.nextIFD}while(n>0);return{...P(o),littleEndian:t,isBigTiff:r,ifds:o}}(e);const{ifds:i,noData:n}=r;if(0===i.length)throw"no valid image file directory";const o=O(r);if(o)throw o;let a,s;const d=-1===t?i[i.length-1]:i[t],p=n?n[0]:null;if(s=r.tileWidth?function(e,t,r){var i;const n=k(r,"TILEOFFSETS");if(void 0===n)return null;const o=k(r,"TILEBYTECOUNTS"),{width:a,height:s,pixelType:l,tileWidth:f,tileHeight:u}=P([r]),h=D(r,t),c=t.planes,d=a*s,p=T(r,"BITSPERSAMPLE"),m=34887===(null!=(i=T(r,"COMPRESSION"))?i:1),g=x(l),y=[];for(let e=0;e<c;e++)y.push(new g(d));let w,C,b,v,S,A,M,U,B,E,L,R,O;const _=Math.ceil(a/f);if(p%8==0)if(m&&h&&c>1){const i=Math.round(n.length/c);for(w=0;w<i;w++){A=Math.floor(w/_)*u,M=w%_*f,U=A*a+M;for(let i=0;i<c;i++){const l=w*c+i;for(b=I(e,t.littleEndian,r,n[l],o[l]),E=0,B=U,R=Math.min(f,a-M),L=Math.min(u,s-A),O=y[i],v=0;v<L;v++)for(B=U+v*a,E=v*f,S=0;S<R;S++,B++,E++)O[B]=b[E]}}}else for(w=0;w<n.length;w++)for(A=Math.floor(w/_)*u,M=w%_*f,U=A*a+M,b=I(e,t.littleEndian,r,n[w],o[w]),E=0,B=U,R=Math.min(f,a-M),L=Math.min(u,s-A),C=0;C<c;C++)if(O=y[C],h||m)for(v=0;v<L;v++)for(B=U+v*a,E=f*u*C+v*f,S=0;S<R;S++,B++,E++)O[B]=b[E];else for(v=0;v<L;v++)for(B=U+v*a,E=v*f*c+C,S=0;S<R;S++,B++,E+=c)O[B]=b[E];return{width:a,height:s,pixelType:l,pixels:y}}(e,r,d):function(e,t,r){var i;const n=h.f===t.littleEndian,o=k(r,"STRIPOFFSETS");if(void 0===o)return null;const{width:a,height:s,pixelType:u}=P([r]),d=t.planes,p=a*s,m=T(r,"BITSPERSAMPLE"),g=x(u),y=new g(p*d),w=k(r,"STRIPBYTECOUNTS"),C=T(r,"ROWSPERSTRIP"),b=null!=(i=T(r,"COMPRESSION"))?i:1;let v,S,A,I,M,D,U,B,E,L,R,O=C;if(m%8==0)for(v=0;v<o.length;v++){if(M=v*(C*a)*d,O=(v+1)*C>s?s-v*C:C,"u8"===u||"s8"===u||n){if(8===b||32946===b)U=new Uint8Array(e,o[v],w[v]),L=new c.Z(U),R=L.getBytes(),D=new ArrayBuffer(R.length),U=new Uint8Array(D),U.set(R),U.length!==O*a*d*m/8&&console.log("strip byte counts is different than expected");else if(6===b){U=new Uint8Array(e,o[v],w[v]);const t=new l.J;t.parse(U);const r=t.getData(t.width,t.height,!0);D=new ArrayBuffer(r.length),U=new Uint8Array(D),U.set(r)}else 5===b?(U=(0,f.J)(e,o[v],w[v],t.littleEndian),D=U.buffer):1===b&&(w[v]!==O*a*d*m/8&&console.log("strip byte counts is different than expected"),D=e.slice(o[v],o[v]+w[v]));I=new g(D)}else{switch(6===b||8===b||32946===b?(U=new Uint8Array(e,o[v],w[v]),L=new c.Z(U),U=L.getBytes(),D=new ArrayBuffer(U.length),B=new Uint8Array(D),U.length!==O*a*d*m/8&&console.log("strip byte counts is different than expected")):1===b&&(w[v]!==O*a*d*m/8&&console.log("strip byte counts is different than expected"),D=new ArrayBuffer(w[v]),U=new Uint8Array(e,o[v],w[v]),B=new Uint8Array(D)),u){case"u16":case"s16":for(A=0;A<U.length;A+=2)B[A]=U[A+1],B[A+1]=U[A];break;case"u32":case"s32":case"f32":for(A=0;A<U.length;A+=4)B[A]=U[A+3],B[A+1]=U[A+2],B[A+2]=U[A+1],B[A+3]=U[A]}I=new g(D)}y.set(I,M)}const _=[];if(1===d)_.push(y);else for(v=0;v<d;v++){for(E=new g(p),S=0;S<p;S++)E[S]=y[S*d+v];_.push(E)}return{width:a,height:s,pixelType:u,pixels:_}}(e,r,d),null!==p){if(s.mask=new Uint8Array(s.width*s.height),Math.abs(p)>1e24)for(a=0;a<s.width*s.height;a++)Math.abs((s.pixels[0][a]-p)/p)<1e-6?s.mask[a]=0:s.mask[a]=1;else for(a=0;a<s.width*s.height;a++)s.pixels[0][a]===p?s.mask[a]=0:s.mask[a]=1;s.noDataValue=p}return s}},80899:(e,t,r)=>{r.d(t,{Z:()=>s});var i,n,o,a={exports:{}};n=a,void 0!==(i=function(){function e(){this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=null}return e.prototype={ensureBuffer:function(e){var t=this.buffer,r=t?t.byteLength:0;if(e<r)return t;for(var i=512;i<e;)i<<=1;for(var n=new Uint8Array(i),o=0;o<r;++o)n[o]=t[o];return this.buffer=n},getByte:function(){for(var e=this.pos;this.bufferLength<=e;){if(this.eof)return null;this.readBlock()}return this.buffer[this.pos++]},getBytes:function(e){var t=this.pos;if(e){this.ensureBuffer(t+e);for(var r=t+e;!this.eof&&this.bufferLength<r;)this.readBlock();var i=this.bufferLength;r>i&&(r=i)}else{for(;!this.eof;)this.readBlock();r=this.bufferLength}return this.pos=r,this.buffer.subarray(t,r)},lookChar:function(){for(var e=this.pos;this.bufferLength<=e;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var e=this.pos;this.bufferLength<=e;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(e,t,r){for(var i=e+t;this.bufferLength<=i&&!this.eof;)this.readBlock();return new Stream(this.buffer,e,t,r)},skip:function(e){e||(e=1),this.pos+=e},reset:function(){this.pos=0}},e}(),o=function(){if(!self||!self.Uint32Array)return null;var e=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),t=new Uint32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),r=new Uint32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),n=[new Uint32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],o=[new Uint32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];function a(e){throw new Error(e)}function s(e){var t=0,r=e[t++],n=e[t++];-1!=r&&-1!=n||a("Invalid header in flate stream"),8!=(15&r)&&a("Unknown compression method in flate stream"),((r<<8)+n)%31!=0&&a("Bad FCHECK in flate stream"),32&n&&a("FDICT bit set in flate stream"),this.bytes=e,this.bytesPos=2,this.codeSize=0,this.codeBuf=0,i.call(this)}return s.prototype=Object.create(i.prototype),s.prototype.getBits=function(e){for(var t,r=this.codeSize,i=this.codeBuf,n=this.bytes,o=this.bytesPos;r<e;)void 0===(t=n[o++])&&a("Bad encoding in flate stream"),i|=t<<r,r+=8;return t=i&(1<<e)-1,this.codeBuf=i>>e,this.codeSize=r-=e,this.bytesPos=o,t},s.prototype.getCode=function(e){for(var t=e[0],r=e[1],i=this.codeSize,n=this.codeBuf,o=this.bytes,s=this.bytesPos;i<r;){var l;void 0===(l=o[s++])&&a("Bad encoding in flate stream"),n|=l<<i,i+=8}var f=t[n&(1<<r)-1],u=f>>16,h=65535&f;return(0==i||i<u||0==u)&&a("Bad encoding in flate stream"),this.codeBuf=n>>u,this.codeSize=i-u,this.bytesPos=s,h},s.prototype.generateHuffmanTable=function(e){for(var t=e.length,r=0,i=0;i<t;++i)e[i]>r&&(r=e[i]);for(var n=1<<r,o=new Uint32Array(n),a=1,s=0,l=2;a<=r;++a,s<<=1,l<<=1)for(var f=0;f<t;++f)if(e[f]==a){var u=0,h=s;for(i=0;i<a;++i)u=u<<1|1&h,h>>=1;for(i=u;i<n;i+=l)o[i]=a<<16|f;++s}return[o,r]},s.prototype.readBlock=function(){function i(e,t,r,i,n){for(var o=e.getBits(r)+i;o-- >0;)t[p++]=n}var s=this.getBits(3);if(1&s&&(this.eof=!0),0!=(s>>=1)){var l,f;if(1==s)l=n,f=o;else if(2==s){for(var u=this.getBits(5)+257,h=this.getBits(5)+1,c=this.getBits(4)+4,d=Array(e.length),p=0;p<c;)d[e[p++]]=this.getBits(3);for(var m=this.generateHuffmanTable(d),g=0,y=(p=0,u+h),w=new Array(y);p<y;){var x=this.getCode(m);16==x?i(this,w,2,3,g):17==x?i(this,w,3,3,g=0):18==x?i(this,w,7,11,g=0):w[p++]=g=x}l=this.generateHuffmanTable(w.slice(0,u)),f=this.generateHuffmanTable(w.slice(u,y))}else a("Unknown block type in flate stream");for(var C=(B=this.buffer)?B.length:0,b=this.bufferLength;;){var k=this.getCode(l);if(k<256)b+1>=C&&(C=(B=this.ensureBuffer(b+1)).length),B[b++]=k;else{if(256==k)return void(this.bufferLength=b);var v=(k=t[k-=257])>>16;v>0&&(v=this.getBits(v)),g=(65535&k)+v,k=this.getCode(f),(v=(k=r[k])>>16)>0&&(v=this.getBits(v));var T=(65535&k)+v;b+g>=C&&(C=(B=this.ensureBuffer(b+g)).length);for(var S=0;S<g;++S,++b)B[b]=B[b-T]}}}else{var A,I=this.bytes,M=this.bytesPos;void 0===(A=I[M++])&&a("Bad block header in flate stream");var P=A;void 0===(A=I[M++])&&a("Bad block header in flate stream"),P|=A<<8,void 0===(A=I[M++])&&a("Bad block header in flate stream");var D=A;void 0===(A=I[M++])&&a("Bad block header in flate stream"),(D|=A<<8)!=(65535&~P)&&a("Bad uncompressed block length in flate stream"),this.codeBuf=0,this.codeSize=0;var U=this.bufferLength,B=this.ensureBuffer(U+P),E=U+P;this.bufferLength=E;for(var L=U;L<E;++L){if(void 0===(A=I[M++])){this.eof=!0;break}B[L]=A}this.bytesPos=M}},s}())&&(n.exports=o);const s=a.exports},3892:(e,t,r)=>{function i(e){return"h"in e&&"s"in e&&"v"in e}function n(e){return"l"in e&&"a"in e&&"b"in e}function o(e){return"l"in e&&"c"in e&&"h"in e}r.d(t,{_Y:()=>p,Y3:()=>m,sJ:()=>g,xr:()=>d});const a=[[.4124,.3576,.1805],[.2126,.7152,.0722],[.0193,.1192,.9505]],s=[[3.2406,-1.5372,-.4986],[-.9689,1.8758,.0415],[.0557,-.204,1.057]];function l(e,t){const r=[];let i,n;if(e[0].length!==t.length)throw"dimensions do not match";const o=e.length,a=e[0].length;let s=0;for(i=0;i<o;i++){for(s=0,n=0;n<a;n++)s+=e[i][n]*t[n];r.push(s)}return r}function f(e){const t=[e.r/255,e.g/255,e.b/255].map((e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4)),r=l(a,t);return{x:100*r[0],y:100*r[1],z:100*r[2]}}function u(e){const t=l(s,[e.x/100,e.y/100,e.z/100]).map((e=>{const t=e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055;return Math.min(1,Math.max(t,0))}));return{r:Math.round(255*t[0]),g:Math.round(255*t[1]),b:Math.round(255*t[2])}}function h(e){const t=[e.x/95.047,e.y/100,e.z/108.883].map((e=>e>(6/29)**3?e**(1/3):1/3*(29/6)**2*e+4/29));return{l:116*t[1]-16,a:500*(t[0]-t[1]),b:200*(t[1]-t[2])}}function c(e){const t=e.l,r=[(t+16)/116+e.a/500,(t+16)/116,(t+16)/116-e.b/200].map((e=>e>6/29?e**3:3*(6/29)**2*(e-4/29)));return{x:95.047*r[0],y:100*r[1],z:108.883*r[2]}}function d(e){return"r"in(t=e)&&"g"in t&&"b"in t?e:o(e)?function(e){return u(c(function(e){const t=e.l,r=e.c,i=e.h;return{l:t,a:r*Math.cos(i),b:r*Math.sin(i)}}(e)))}(e):n(e)?function(e){return u(c(e))}(e):function(e){return"x"in e&&"y"in e&&"z"in e}(e)?u(e):i(e)?function(e){const t=(e.h+360)%360/60,r=e.s/100,i=e.v/100*255,n=i*r,o=n*(1-Math.abs(t%2-1));let a;switch(Math.floor(t)){case 0:a={r:n,g:o,b:0};break;case 1:a={r:o,g:n,b:0};break;case 2:a={r:0,g:n,b:o};break;case 3:a={r:0,g:o,b:n};break;case 4:a={r:o,g:0,b:n};break;case 5:case 6:a={r:n,g:0,b:o};break;default:a={r:0,g:0,b:0}}return a.r=Math.round(a.r+i-n),a.g=Math.round(a.g+i-n),a.b=Math.round(a.b+i-n),a}(e):e;var t}function p(e){return i(e)?e:function(e){const t=e.r,r=e.g,i=e.b,n=Math.max(t,r,i),o=n-Math.min(t,r,i);let a=n,s=0===o?0:n===t?(r-i)/o%6:n===r?(i-t)/o+2:(t-r)/o+4,l=0===o?0:o/a;return s<0&&(s+=6),s*=60,l*=100,a*=100/255,{h:s,s:l,v:a}}(d(e))}function m(e){return n(e)?e:function(e){return h(f(e))}(d(e))}function g(e){return o(e)?e:function(e){return function(e){const t=e.l,r=e.a,i=e.b,n=Math.sqrt(r*r+i*i);let o=Math.atan2(i,r);return o=o>0?o:o+2*Math.PI,{l:t,c:n,h:o}}(h(f(e)))}(d(e))}},54163:(e,t,r)=>{r.d(t,{Z:()=>m});var i,n=r(43697),o=(r(80442),r(20102)),a=r(10736),s=r(22974),l=r(92604),f=r(70586),u=r(5600),h=r(90578),c=r(52011);const d=l.Z.getLogger("esri.layers.support.PixelBlock");let p=i=class extends a.wq{constructor(e){super(e),this.width=null,this.height=null,this.pixelType="f32",this.validPixelCount=null,this.mask=null,this.maskIsAlpha=!1,this.pixels=null,this.statistics=null}static createEmptyBand(e,t){return new(i.getPixelArrayConstructor(e))(t)}static getPixelArrayConstructor(e){let t;switch(e){case"u1":case"u2":case"u4":case"u8":t=Uint8Array;break;case"u16":t=Uint16Array;break;case"u32":case"u32":t=Uint32Array;break;case"s8":t=Int8Array;break;case"s16":t=Int16Array;break;case"s32":t=Int32Array;break;case"f32":case"c64":case"c128":case"unknown":t=Float32Array;break;case"f64":t=Float64Array}return t}castPixelType(e){if(!e)return"f32";let t=e.toLowerCase();return["u1","u2","u4"].indexOf(t)>-1?t="u8":-1===["unknown","u8","s8","u16","s16","u32","s32","f32","f64"].indexOf(t)&&(t="f32"),t}getPlaneCount(){return this.pixels&&this.pixels.length}addData(e){if(!e.pixels||e.pixels.length!==this.width*this.height)throw new o.Z("pixelblock:invalid-or-missing-pixels","add data requires valid pixels array that has same length defined by pixel block width * height");this.pixels||(this.pixels=[]),this.statistics||(this.statistics=[]),this.pixels.push(e.pixels),this.statistics.push(e.statistics||{minValue:null,maxValue:null})}getAsRGBA(){const e=new ArrayBuffer(this.width*this.height*4);switch(this.pixelType){case"s8":case"s16":case"u16":case"s32":case"u32":case"f32":case"f64":this._fillFromNon8Bit(e);break;default:this._fillFrom8Bit(e)}return new Uint8ClampedArray(e)}getAsRGBAFloat(){const e=new Float32Array(this.width*this.height*4);return this._fillFrom32Bit(e),e}updateStatistics(){this.statistics=this.pixels.map((e=>this._calculateBandStatistics(e,this.mask)));const e=this.mask;let t=0;if(e)for(let r=0;r<e.length;r++)e[r]&&t++;else t=this.width*this.height;this.validPixelCount=t}clamp(e){if(!e||"f64"===e||"f32"===e)return;let t;switch(e){case"u8":t=[0,255];break;case"u16":t=[0,65535];break;case"u32":t=[0,4294967295];break;case"s8":t=[-128,127];break;case"s16":t=[-32768,32767];break;case"s32":t=[-2147483648,2147483647];break;default:t=[-34e38,34e38]}const[r,n]=t,o=this.pixels,a=this.width*this.height,s=o.length;let l,f,u;const h=[];for(let t=0;t<s;t++){u=i.createEmptyBand(e,a),l=o[t];for(let e=0;e<a;e++)f=l[e],u[e]=f>n?n:f<r?r:f;h.push(u)}this.pixels=h,this.pixelType=e}extractBands(e){if((0,f.Wi)(e)||0===e.length||null==this.pixels||0===this.pixels.length)return this;const t=this.pixels.length,r=e.some((e=>e>=this.pixels.length)),n=t===e.length&&!e.some(((e,t)=>e!==t));return r||n?this:new i({pixelType:this.pixelType,width:this.width,height:this.height,mask:this.mask,validPixelCount:this.validPixelCount,maskIsAlpha:this.maskIsAlpha,pixels:e.map((e=>this.pixels[e])),statistics:this.statistics&&e.map((e=>this.statistics[e]))})}clone(){const e=new i({width:this.width,height:this.height,pixelType:this.pixelType,maskIsAlpha:this.maskIsAlpha,validPixelCount:this.validPixelCount});let t;this.mask&&(this.mask instanceof Uint8Array?e.mask=new Uint8Array(this.mask):e.mask=this.mask.slice(0));const r=i.getPixelArrayConstructor(this.pixelType);if(this.pixels&&this.pixels.length>0){e.pixels=[];const i=this.pixels[0].slice;for(t=0;t<this.pixels.length;t++)e.pixels[t]=i?this.pixels[t].slice(0,this.pixels[t].length):new r(this.pixels[t])}if(this.statistics)for(e.statistics=[],t=0;t<this.statistics.length;t++)e.statistics[t]=(0,s.d9)(this.statistics[t]);return e}_fillFrom8Bit(e){const{mask:t,maskIsAlpha:r,pixels:i}=this;if(!e||!i||!i.length)return void d.error("getAsRGBA()","Unable to convert to RGBA. The input pixel block is empty.");let n,o,a,s;n=o=a=i[0],i.length>=3?(o=i[1],a=i[2]):2===i.length&&(o=i[1]);const l=new Uint32Array(e),f=this.width*this.height;if(n.length===f)if(t&&t.length===f)if(r)for(s=0;s<f;s++)t[s]&&(l[s]=t[s]<<24|a[s]<<16|o[s]<<8|n[s]);else for(s=0;s<f;s++)t[s]&&(l[s]=255<<24|a[s]<<16|o[s]<<8|n[s]);else for(s=0;s<f;s++)l[s]=255<<24|a[s]<<16|o[s]<<8|n[s];else d.error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.")}_fillFromNon8Bit(e){const{pixels:t,mask:r,statistics:i}=this;if(!e||!t||!t.length)return void d.error("getAsRGBA()","Unable to convert to RGBA. The input pixel block is empty.");const n=this.pixelType;let o=1,a=0,s=1;if(i&&i.length>0)a=i.map((e=>e.minValue)).reduce(((e,t)=>Math.min(e,t))),s=i.map((e=>e.maxValue-e.minValue)).reduce(((e,t)=>Math.max(e,t))),o=255/s;else{let e=255;"s8"===n?(a=-128,e=127):"u16"===n?e=65535:"s16"===n?(a=-32768,e=32767):"u32"===n?e=4294967295:"s32"===n?(a=-2147483648,e=2147483647):"f32"===n?(a=-34e38,e=34e38):"f64"===n&&(a=-Number.MAX_VALUE,e=Number.MAX_VALUE),o=255/(e-a)}const l=new Uint32Array(e),f=this.width*this.height;let u,h,c,p,m;if(u=h=c=t[0],u.length!==f)return d.error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.");if(t.length>=2)if(h=t[1],t.length>=3&&(c=t[2]),r&&r.length===f)for(p=0;p<f;p++)r[p]&&(l[p]=255<<24|(c[p]-a)*o<<16|(h[p]-a)*o<<8|(u[p]-a)*o);else for(p=0;p<f;p++)l[p]=255<<24|(c[p]-a)*o<<16|(h[p]-a)*o<<8|(u[p]-a)*o;else if(r&&r.length===f)for(p=0;p<f;p++)m=(u[p]-a)*o,r[p]&&(l[p]=255<<24|m<<16|m<<8|m);else for(p=0;p<f;p++)m=(u[p]-a)*o,l[p]=255<<24|m<<16|m<<8|m}_fillFrom32Bit(e){const{pixels:t,mask:r}=this;if(!e||!t||!t.length)return d.error("getAsRGBAFloat()","Unable to convert to RGBA. The input pixel block is empty.");let i,n,o,a;i=n=o=t[0],t.length>=3?(n=t[1],o=t[2]):2===t.length&&(n=t[1]);const s=this.width*this.height;if(i.length!==s)return d.error("getAsRGBAFloat()","Unable to convert to RGBA. The pixelblock is invalid.");let l=0;if(r&&r.length===s)for(a=0;a<s;a++)e[l++]=i[a],e[l++]=n[a],e[l++]=o[a],e[l++]=1&r[a];else for(a=0;a<s;a++)e[l++]=i[a],e[l++]=n[a],e[l++]=o[a],e[l++]=1}_calculateBandStatistics(e,t){let r=1/0,i=-1/0;const n=e.length;let o,a=0;if(t)for(o=0;o<n;o++)t[o]&&(a=e[o],r=a<r?a:r,i=a>i?a:i);else for(o=0;o<n;o++)a=e[o],r=a<r?a:r,i=a>i?a:i;return{minValue:r,maxValue:i}}};(0,n._)([(0,u.Cb)({json:{write:!0}})],p.prototype,"width",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],p.prototype,"height",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],p.prototype,"pixelType",void 0),(0,n._)([(0,h.p)("pixelType")],p.prototype,"castPixelType",null),(0,n._)([(0,u.Cb)({json:{write:!0}})],p.prototype,"validPixelCount",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],p.prototype,"mask",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],p.prototype,"maskIsAlpha",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],p.prototype,"pixels",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],p.prototype,"statistics",void 0),p=i=(0,n._)([(0,c.j)("esri.layers.support.PixelBlock")],p);const m=p},48526:(e,t,r)=>{r.d(t,{Z:()=>c});var i=r(43697),n=r(10736),o=r(70586),a=r(5600),s=(r(67676),r(80442),r(75215),r(52011)),l=r(6570),f=r(82971),u=r(36679);let h=class extends n.wq{constructor(e){super(e),this.attributeTable=null,this.bandCount=null,this.colormap=null,this.extent=null,this.format=void 0,this.height=null,this.width=null,this.histograms=null,this.keyProperties={},this.multidimensionalInfo=null,this.noDataValue=null,this.pixelSize=null,this.pixelType=null,this.isPseudoSpatialReference=!1,this.spatialReference=null,this.statistics=null,this.storageInfo=null,this.transform=null}get dataType(){var e,t,r;const i=null!=(e=null==(t=this.keyProperties)||null==(r=t.DataType)?void 0:r.toLowerCase())?e:"generic";return"stdtime"===i?"standard-time":i}get nativeExtent(){return this._get("nativeExtent")||this.extent}set nativeExtent(e){e&&this._set("nativeExtent",e)}get nativePixelSize(){if(!(0,o.pC)(this.transform)||!this.transform.affectsPixelSize)return this.pixelSize;const e=this.nativeExtent;return{x:e.width/this.width,y:e.height/this.height}}};(0,i._)([(0,a.Cb)({json:{write:!0}})],h.prototype,"attributeTable",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],h.prototype,"bandCount",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],h.prototype,"colormap",void 0),(0,i._)([(0,a.Cb)({type:String,readOnly:!0})],h.prototype,"dataType",null),(0,i._)([(0,a.Cb)({type:l.Z,json:{write:!0}})],h.prototype,"extent",void 0),(0,i._)([(0,a.Cb)({type:l.Z,json:{write:!0}})],h.prototype,"nativeExtent",null),(0,i._)([(0,a.Cb)({json:{write:!0}})],h.prototype,"nativePixelSize",null),(0,i._)([(0,a.Cb)({json:{write:!0}})],h.prototype,"format",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],h.prototype,"height",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],h.prototype,"width",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],h.prototype,"histograms",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],h.prototype,"keyProperties",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],h.prototype,"multidimensionalInfo",void 0),(0,i._)([(0,a.Cb)()],h.prototype,"noDataValue",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],h.prototype,"pixelSize",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],h.prototype,"pixelType",void 0),(0,i._)([(0,a.Cb)()],h.prototype,"isPseudoSpatialReference",void 0),(0,i._)([(0,a.Cb)({type:f.Z,json:{write:!0}})],h.prototype,"spatialReference",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],h.prototype,"statistics",void 0),(0,i._)([(0,a.Cb)({type:u.Z,json:{write:!0}})],h.prototype,"storageInfo",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],h.prototype,"transform",void 0),h=(0,i._)([(0,s.j)("esri.layers.support.RasterInfo")],h);const c=h},36679:(e,t,r)=>{r.d(t,{Z:()=>f});var i=r(43697),n=r(10736),o=r(5600),a=(r(67676),r(80442),r(75215),r(52011)),s=r(13473);let l=class extends n.wq{constructor(){super(...arguments),this.blockWidth=void 0,this.blockHeight=void 0,this.compression=null,this.origin=null,this.firstPyramidLevel=null,this.maximumPyramidLevel=null,this.pyramidScalingFactor=2,this.pyramidBlockWidth=null,this.pyramidBlockHeight=null,this.isVirtualTileInfo=!1,this.tileInfo=null,this.blockBoundary=null}};(0,i._)([(0,o.Cb)({type:Number,json:{write:!0}})],l.prototype,"blockWidth",void 0),(0,i._)([(0,o.Cb)({type:Number,json:{write:!0}})],l.prototype,"blockHeight",void 0),(0,i._)([(0,o.Cb)({type:String,json:{write:!0}})],l.prototype,"compression",void 0),(0,i._)([(0,o.Cb)({type:s.Z,json:{write:!0}})],l.prototype,"origin",void 0),(0,i._)([(0,o.Cb)({type:Number,json:{write:!0}})],l.prototype,"firstPyramidLevel",void 0),(0,i._)([(0,o.Cb)({type:Number,json:{write:!0}})],l.prototype,"maximumPyramidLevel",void 0),(0,i._)([(0,o.Cb)({json:{write:!0}})],l.prototype,"pyramidResolutions",void 0),(0,i._)([(0,o.Cb)({type:Number,json:{write:!0}})],l.prototype,"pyramidScalingFactor",void 0),(0,i._)([(0,o.Cb)({type:Number,json:{write:!0}})],l.prototype,"pyramidBlockWidth",void 0),(0,i._)([(0,o.Cb)({type:Number,json:{write:!0}})],l.prototype,"pyramidBlockHeight",void 0),(0,i._)([(0,o.Cb)({type:Boolean,json:{write:!0}})],l.prototype,"isVirtualTileInfo",void 0),(0,i._)([(0,o.Cb)({json:{write:!0}})],l.prototype,"tileInfo",void 0),(0,i._)([(0,o.Cb)()],l.prototype,"blockBoundary",void 0),l=(0,i._)([(0,a.j)("esri.layers.support.RasterStorageInfo")],l);const f=l},20095:(e,t,r)=>{function i(e,t){let r=0,i="",n=0,o=0;const a=e.length;for(;r<a;)o=e[r++],n=o>>4,n<8?n=1:15===n?(n=4,o=(7&o)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++]):14===n?(n=3,o=(15&o)<<12|(63&e[r++])<<6|63&e[r++]):(n=2,o=(31&o)<<6|63&e[r++]),(0!==o||t)&&(i+=String.fromCharCode(o));return i}r.d(t,{f:()=>i})},88781:(e,t,r)=>{function i(){const e=[];for(let t=0;t<=257;t++)e[t]=[t];return e}function n(e,t){for(let r=0;r<t.length;r++)e.push(t[r])}r.d(t,{J:()=>a});const o=new Set;function a(e,t,r,a=!0){const s=function(e,t,r,i=!0){if(t%4!=0||r%4!=0){const n=new ArrayBuffer(4*Math.ceil(r/4)),o=new Uint8Array(n),a=new Uint8Array(e,t,r);if(i)for(let e=0;e<o.length;e+=4)o[e]=a[e+3],o[e+1]=a[e+2],o[e+2]=a[e+1],o[e+3]=a[e];else o.set(a);return new Uint32Array(o.buffer)}if(i){const i=new Uint8Array(e,t,r),n=new Uint8Array(i.length);for(let e=0;e<n.length;e+=4)n[e]=i[e+3],n[e+1]=i[e+2],n[e+2]=i[e+1],n[e+3]=i[e];return new Uint32Array(n.buffer)}return new Uint32Array(e,t,r/4)}(e,t,r,a);let l=9,f=i(),u=32,h=f.length,c=[],d=1,p=s[0],m=0;const g=s.length,y=8*(4*g-r),w=[];for(;null!=p;){if(u>=l)u-=l,m=p>>>32-l,p<<=l;else{m=p>>>32-u,p=s[d++];const e=l-u;u=32-e,m=(m<<e)+(p>>>u),p<<=e}if(257===m)break;if(256===m){l=9,f=i(),h=f.length,c=[];continue}const e=f[m];if(null==e){if(m>f.length)throw"data integrity issue: code does not exist on code page";c.push(c[0]),f[h++]=c.slice(),n(w,c)}else n(w,e),c.push(e[0]),c.length>1&&(f[h++]=c.slice()),c=e.slice();if(o.has(h)&&l++,0===u&&(p=s[d++],u=32),d>g||d===g&&u<=y)break}return new Uint8Array(w)}o.add(511),o.add(1023),o.add(2047),o.add(4095),o.add(8191)},75993:(e,t,r)=>{r.d(t,{Jx:()=>D,y6:()=>P});var i=r(20102),n=r(54163),o=r(95330),a=r(80899);class s{constructor(e){e&&(this.canvas=e.canvas,this.ctx=e.ctx||e.canvas&&e.canvas.getContext("2d"))}decode(e,t,r){if(!e||e.byteLength<10)throw new i.Z("imagecanvasdecoder: decode","required a valid encoded data as input.");let{width:n,height:a,format:l}=t;const{applyJpegMask:f}=t;if(f&&(!n||!a))throw new i.Z("imagecanvasdecoder: decode","image width and height are needed to apply jpeg mask directly to canvas");return new Promise(((i,u)=>{let h=null;"jpg"===l&&f&&(h=s.getMask(e,{width:n,height:a}));const c=new Blob([new Uint8Array(e)],{type:"image/"+l=="jpg"?"jpeg":l}),d=URL.createObjectURL(c),p=new Image;let m;p.src=d,p.onload=()=>{if(URL.revokeObjectURL(d),(0,o.Hc)(r))return void u((0,o.zE)());n=p.width,a=p.height,this.canvas?(this.canvas.width===n&&this.canvas.height===a||(this.canvas.width=n,this.canvas.height=a),this.ctx.clearRect(0,0,n,a)):(this.canvas=document.createElement("canvas"),this.canvas.width=n,this.canvas.height=a,this.ctx=this.canvas.getContext("2d")),this.ctx.drawImage(p,0,0);const e=this.ctx.getImageData(0,0,n,a);let s;if(m=e.data,t.renderOnCanvas){if(h)for(s=0;s<h.length;s++)h[s]?m[4*s+3]=255:m[4*s+3]=0;return this.ctx.putImageData(e,0,0),void i(null)}const l=n*a,f=new Uint8Array(l),c=new Uint8Array(l),g=new Uint8Array(l);if(h)for(s=0;s<l;s++)f[s]=m[4*s],c[s]=m[4*s+1],g[s]=m[4*s+2];else for(h=new Uint8Array(l),s=0;s<l;s++)f[s]=m[4*s],c[s]=m[4*s+1],g[s]=m[4*s+2],h[s]=m[4*s+3];i({width:n,height:a,pixels:[f,c,g],mask:h,pixelType:"u8"})},p.onerror=()=>{URL.revokeObjectURL(d),u("cannot load image")}}))}static getMask(e,t){let r=null;try{const i=new Uint8Array(e),n=Math.ceil(i.length/2);let o=0;const s=i.length-2;for(o=n;o<s&&(255!==i[o]||217!==i[o+1]);o++);if(o+=2,o<i.length-1){const e=new a.Z(i.subarray(o)).getBytes();r=new Uint8Array(t.width*t.height);let n=0;for(let t=0;t<e.length;t++)for(let i=7;i>=0;i--)r[n++]=e[t]>>i&1}}catch(e){}return r}}var l=r(97575),f=r(29825),u=r(32321),h=r(88781);const c=function(e,t){const r=t.width*t.height,i=t.pixelType;return Math.floor(e.byteLength/(r*d(i)))},d=function(e){let t=1;switch(e){case Uint8Array:case Int8Array:t=1;break;case Uint16Array:case Int16Array:t=2;break;case Uint32Array:case Int32Array:case Float32Array:t=4;break;case Float64Array:t=8}return t};class p{static decode(e,t){const r=t.pixelType,i=[],n=t.width*t.height,o=c(e,t),{bandIds:a,format:s}=t,l=a&&a.length||c(e,t),f=e.byteLength-e.byteLength%(n*d(r)),u=new r(e,0,n*o);let h,p,m,g,y;if("bip"===s)for(h=0;h<l;h++){for(g=new r(n),y=a?a[h]:h,p=0;p<n;p++)g[p]=u[p*o+y];i.push(g)}else if("bsq"===s)for(h=0;h<l;h++)y=a?a[h]:h,i.push(u.subarray(y*n,(y+1)*n));return f<e.byteLength-1&&(m=function(e,t){if(8*e.byteLength<t)return null;const r=new Uint8Array(e,0,Math.ceil(t/8)),i=new Uint8Array(t);let n=0,o=0,a=0,s=0;for(a=0;a<r.length-1;a++)for(o=r[a],s=7;s>=0;s--)i[n++]=o>>s&1;for(s=7;n<t-1;)o=r[r.length-1],i[n++]=o>>s&1,s--;return i}(e.slice(f),n)),{pixels:i,mask:m}}}var m=r(48279),g=function(e){var t,r,i;function n(e){var t,r,i,n,o,a,s,l,f,u,h,c,d;for(this.data=e,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},o=null;;){switch(t=this.readUInt32(),l=function(){var e,t;for(t=[],e=0;e<4;++e)t.push(String.fromCharCode(this.data[this.pos++]));return t}.call(this).join(""),l){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(t);break;case"fcTL":o&&this.animation.frames.push(o),this.pos+=4,o={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},n=this.readUInt16(),i=this.readUInt16()||100,o.delay=1e3*n/i,o.disposeOp=this.data[this.pos++],o.blendOp=this.data[this.pos++],o.data=[];break;case"IDAT":case"fdAT":for("fdAT"===l&&(this.pos+=4,t-=4),e=(null!=o?o.data:void 0)||this.imgData,h=0;0<=t?h<t:h>t;0<=t?++h:--h)e.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(this.transparency.indexed=this.read(t),(f=255-this.transparency.indexed.length)>0)for(c=0;0<=f?c<f:c>f;0<=f?++c:--c)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(t)[0];break;case 2:this.transparency.rgb=this.read(t)}break;case"tEXt":a=(u=this.read(t)).indexOf(0),s=String.fromCharCode.apply(String,u.slice(0,a)),this.text[s]=String.fromCharCode.apply(String,u.slice(a+1));break;case"IEND":return o&&this.animation.frames.push(o),this.colors=function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}.call(this),this.hasAlphaChannel=4===(d=this.colorType)||6===d,r=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*r,this.colorSpace=function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}.call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=t}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}return n.load=function(e,t,r){var i;return"function"==typeof t&&(r=t),(i=new XMLHttpRequest).open("GET",e,!0),i.responseType="arraybuffer",i.onload=function(){var e;return e=new n(new Uint8Array(i.response||i.mozResponseArrayBuffer)),"function"==typeof(null!=t?t.getContext:void 0)&&e.render(t),"function"==typeof r?r(e):void 0},i.send(null)},n.prototype.read=function(e){var t,r;for(r=[],t=0;0<=e?t<e:t>e;0<=e?++t:--t)r.push(this.data[this.pos++]);return r},n.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},n.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},n.prototype.decodePixels=function(e){var t,r,i,n,o,s,l,f,u,h,c,d,p,m,g,y,w,x,C,b,k,v,T;if(null==e&&(e=this.imgData),0===e.length)return new Uint8Array(0);for(e=(e=new a.Z(e)).getBytes(),y=(d=this.pixelBitlength/8)*this.width,p=new Uint8Array(y*this.height),s=e.length,g=0,m=0,r=0;m<s;){switch(e[m++]){case 0:for(n=C=0;C<y;n=C+=1)p[r++]=e[m++];break;case 1:for(n=b=0;b<y;n=b+=1)t=e[m++],o=n<d?0:p[r-d],p[r++]=(t+o)%256;break;case 2:for(n=k=0;k<y;n=k+=1)t=e[m++],i=(n-n%d)/d,w=g&&p[(g-1)*y+i*d+n%d],p[r++]=(w+t)%256;break;case 3:for(n=v=0;v<y;n=v+=1)t=e[m++],i=(n-n%d)/d,o=n<d?0:p[r-d],w=g&&p[(g-1)*y+i*d+n%d],p[r++]=(t+Math.floor((o+w)/2))%256;break;case 4:for(n=T=0;T<y;n=T+=1)t=e[m++],i=(n-n%d)/d,o=n<d?0:p[r-d],0===g?w=x=0:(w=p[(g-1)*y+i*d+n%d],x=i&&p[(g-1)*y+(i-1)*d+n%d]),l=o+w-x,f=Math.abs(l-o),h=Math.abs(l-w),c=Math.abs(l-x),u=f<=h&&f<=c?o:h<=c?w:x,p[r++]=(t+u)%256;break;default:throw new Error("Invalid filter algorithm: "+e[m-1])}g++}return p},n.prototype.decodePalette=function(){var e,t,r,i,n,o,a,s,l;for(r=this.palette,o=this.transparency.indexed||[],n=new Uint8Array((o.length||0)+r.length),i=0,e=0,t=a=0,s=r.length;a<s;t=a+=3)n[i++]=r[t],n[i++]=r[t+1],n[i++]=r[t+2],n[i++]=null!=(l=o[e++])?l:255;return n},n.prototype.copyToImageData=function(e,t){var r,i,n,o,a,s,l,f,u,h,c;if(i=this.colors,u=null,r=this.hasAlphaChannel,this.palette.length&&(u=null!=(c=this._decodedPalette)?c:this._decodedPalette=this.decodePalette(),i=4,r=!0),f=(n=e.data||e).length,a=u||t,o=s=0,1===i)for(;o<f;)l=u?4*t[o/4]:s,h=a[l++],n[o++]=h,n[o++]=h,n[o++]=h,n[o++]=r?a[l++]:this.transparency.grayscale&&this.transparency.grayscale===h?0:255,s=l;else for(;o<f;)l=u?4*t[o/4]:s,n[o++]=a[l++],n[o++]=a[l++],n[o++]=a[l++],n[o++]=r?a[l++]:this.transparency.rgb&&this.transparency.rgb[1]===a[l-3]&&this.transparency.rgb[3]===a[l-2]&&this.transparency.rgb[5]===a[l-1]?0:255,s=l},n.prototype.decode=function(){var e;return e=new Uint8Array(this.width*this.height*4),this.copyToImageData(e,this.decodePixels()),e},r=e.document&&e.document.createElement("canvas"),i=r&&r.getContext("2d"),t=function(e){var t;return i.width=e.width,i.height=e.height,i.clearRect(0,0,e.width,e.height),i.putImageData(e,0,0),(t=new Image).src=r.toDataURL(),t},n.prototype.decodeFrames=function(e){var r,i,n,o,a,s,l,f;if(this.animation){for(f=[],i=a=0,s=(l=this.animation.frames).length;a<s;i=++a)r=l[i],n=e.createImageData(r.width,r.height),o=this.decodePixels(new Uint8Array(r.data)),this.copyToImageData(n,o),r.imageData=n,f.push(r.image=t(n));return f}},n.prototype.renderFrame=function(e,t){var r,i,n;return r=(i=this.animation.frames)[t],n=i[t-1],0===t&&e.clearRect(0,0,this.width,this.height),1===(null!=n?n.disposeOp:void 0)?e.clearRect(n.xOffset,n.yOffset,n.width,n.height):2===(null!=n?n.disposeOp:void 0)&&e.putImageData(n.imageData,n.xOffset,n.yOffset),0===r.blendOp&&e.clearRect(r.xOffset,r.yOffset,r.width,r.height),e.drawImage(r.image,r.xOffset,r.yOffset)},n.prototype.animate=function(e){var t,r,i,n,o,a,s=this;return r=0,a=this.animation,n=a.numFrames,i=a.frames,o=a.numPlays,(t=function(){var a,l;if(a=r++%n,l=i[a],s.renderFrame(e,a),n>1&&r/n<o)return s.animation._timeout=setTimeout(t,l.delay)})()},n.prototype.stopAnimation=function(){var e;return clearTimeout(null!=(e=this.animation)?e._timeout:void 0)},n.prototype.render=function(e){var t,r;return e._png&&e._png.stopAnimation(),e._png=this,e.width=this.width,e.height=this.height,t=e.getContext("2d"),this.animation?(this.decodeFrames(t),this.animate(t)):(r=t.createImageData(this.width,this.height),this.copyToImageData(r,this.decodePixels()),t.putImageData(r,0,0))},n}(self);const y=new Set(["jpg","png","bmp","gif"]);function w(e,t){if(!m.f)throw new i.Z("rasterCoded:decode","lerc decoder is not supported on big endian platform");const{width:r,height:o,pixelType:a}=t,s=M(a),l=s.pixelTypeCtor,f=null==t.noDataValue?s.noDataValue:t.noDataValue;let h,c,d=0,p=0;const g=e.byteLength-10;for(;p<g;){const t=(0,u.d)(e,{inputOffset:p,encodedMaskData:h,returnMask:0===d,returnEncodedMask:0===d,returnFileInfo:!0,pixelType:l,noDataValue:f});if(r&&o&&(t.width!==r||t.height!==o))throw new i.Z("rasterCoded:decode","lerc decoded result has width or height different from specified in options");if(p=t.fileInfo.eofOffset,0===d&&(h=t.encodedMaskData,c=new n.Z({width:t.width,height:t.height,pixels:[],pixelType:a,mask:t.maskData,statistics:[]})),d++,c.addData({pixels:t.pixelData,statistics:{minValue:t.minValue,maxValue:t.maxValue,noDataValue:t.noDataValue}}),g-p>10){const t=String.fromCharCode.apply(null,new Uint8Array(e,p,10));p+=t.indexOf("CntZ")>-1?t.indexOf("CntZ"):0}}return c}function x(e,t){if(!m.f)throw new i.Z("rasterCoded:decode","lerc decoder is not supported on big endian platform");let r,o,a,s=0,l=t.offset||0,u=0;const h=t.eof||e.byteLength-10,c=[],{width:d,height:p}=t;let g=0;for(;l<h;){var y;if(o=f.L.decode(e,{inputOffset:l,maskData:r,returnFileInfo:!0}),d&&p&&(o.width!==d||o.height!==p))throw new i.Z("rasterCoded:decode","lerc2 decoded result has width or height different from what's specified in options");if(l=o.fileInfo.eofOffset,r=o.maskData,0===s&&(u=o.fileInfo.numValidPixel,a=new n.Z({width:o.width,height:o.height,pixels:[],pixelType:o.fileInfo.pixelType,mask:r,statistics:[]})),o.fileInfo.mask&&o.fileInfo.mask.numBytes>0&&g++,r&&c.push(r),o.dimCount>1&&(null==(y=o.pixelData)?void 0:y.length)===o.width*o.height*o.dimCount){var w,x,C,b;o.pixelData=o.pixelData.slice(-o.width*o.height);const e=null==(w=o.dimStats)||null==(x=w.minValues)?void 0:x[o.dimCount-1],t=null==(C=o.dimStats)||null==(b=C.maxValues)?void 0:b[o.dimCount-1];null!=e&&null!=t&&(o.minValue=e,o.maxValue=t)}if(s++,a.addData({pixels:o.pixelData,statistics:{minValue:o.minValue,maxValue:o.maxValue}}),h-l>10){const t=String.fromCharCode.apply(null,new Uint8Array(e,l,10));l+=t.indexOf("Lerc")>-1?t.indexOf("Lerc"):0}}let k=0,v=0,T=0;if(g>1){for(T=a.width*a.height,r=new Uint8Array(T),r.set(c[0]),k=1;k<c.length;k++){const e=c[k];for(v=0;v<T;v++)r[v]=r[v]&e[v]}for(u=0,v=0;v<T;v++)u+=r[v];a.mask=r}return a.validPixelCount=u,a}function C(e,t){const r=(0,f.a)(e,t.pyramidLevel||0),i=new n.Z({width:r.width,height:r.height,pixels:r.pixels,pixelType:r.pixelType.toLowerCase(),mask:r.mask,statistics:null});return i.updateStatistics(),i}function b(e,t){const r=t.pixelType||"u8",i=n.Z.getPixelArrayConstructor(r),o="u8"===r?e:new i(e.buffer),a=[],s=t.planes||1;if(1===s)a.push(o);else for(let r=0;r<s;r++){const n=(t.width||1)*(t.height||e.length),l=new i(n);for(let e=0;e<n;e++)l[e]=o[e*s+r];a.push(l)}const l=new n.Z({width:t.width||1,height:t.height||e.length,pixels:a,pixelType:r,statistics:null});return l.updateStatistics(),l}function k(e,t){return b(new a.Z(new Uint8Array(e)).getBytes(),t)}function v(e,t){return b((0,h.J)(e,t.offset,t.eof,!t.isInputBigEndian),t)}function T(e){const t=class{static decode(e){const t=new Uint8Array(e),r=new l.J;r.parse(t);const{width:i,height:n,numComponents:o,eof:s}=r,f=r.getData(i,n,!0);let u;const h=i*n;let c=0,d=0,p=0;if(s<t.length-1){const e=new a.Z(t.subarray(s)).getBytes();u=new Uint8Array(h);let r=0;for(c=0;c<e.length;c++)for(p=7;p>=0;p--)u[r++]=e[c]>>p&1}let m,g=null;if(1===o)g=[f,f,f];else{for(g=[],c=0;c<3;c++)m=new Uint8Array(h),g.push(m);for(p=0,d=0;d<h;d++)for(c=0;c<3;c++)g[c][d]=f[p++]}return{width:i,height:n,pixels:g,mask:u}}}.decode(e),r=new n.Z({width:t.width,height:t.height,pixels:t.pixels,pixelType:"U8",mask:t.mask,statistics:null});return r.updateStatistics(),r}function S(e,t){const r=new Uint8Array(e),i=new g(r),{width:o,height:a}=t,s=o*a,l=i.decode();let f,u=0,h=0;const c=new Uint8Array(s);for(u=0;u<s;u++)c[u]=l[4*u+3];const d=new n.Z({width:o,height:a,pixels:[],pixelType:"U8",mask:c,statistics:[]});for(u=0;u<3;u++){for(f=new Uint8Array(s),h=0;h<s;h++)f[h]=l[4*h+u];d.addData({pixels:f})}return d.updateStatistics(),d}async function A(e,t,r,i){const o=new s,a={applyJpegMask:!1,format:t,...r},l=await o.decode(e,a,i),f=new n.Z(l);return f.updateStatistics(),f}function I(e){if(null==e)throw new i.Z("rasterCodec:decode","parameter encodeddata is required.");const t=new Uint8Array(e,0,10);let r="";return 255===t[0]&&216===t[1]?r="jpg":137===t[0]&&80===t[1]&&78===t[2]&&71===t[3]?r="png":67===t[0]&&110===t[1]&&116===t[2]&&90===t[3]&&73===t[4]&&109===t[5]&&97===t[6]&&103===t[7]&&101===t[8]&&32===t[9]?r="lerc":76===t[0]&&101===t[1]&&114===t[2]&&99===t[3]&&50===t[4]&&32===t[5]?r="lerc2":73===t[0]&&73===t[1]&&42===t[2]&&0===t[3]||77===t[0]&&77===t[1]&&0===t[2]&&42===t[3]||73===t[0]&&73===t[1]&&43===t[2]&&0===t[3]||77===t[0]&&77===t[1]&&0===t[2]&&43===t[3]?r="tiff":71===t[0]&&73===t[1]&&70===t[2]?r="gif":66===t[0]&&77===t[1]?r="bmp":String.fromCharCode.apply(null,t).toLowerCase().indexOf("error")>-1&&(r="error"),r}function M(e){let t=null,r=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":r=255,t=Uint8Array;break;case"u16":r=r||65535,t=Uint16Array;break;case"u32":r=r||2**32-1,t=Uint32Array;break;case"s8":r=r||-128,t=Int8Array;break;case"s16":r=r||-32768,t=Int16Array;break;case"s32":r=r||0-2**31,t=Int32Array;break;default:t=Float32Array}return{pixelTypeCtor:t,noDataValue:r}}function P(e){let t=I(e);return"lerc2"===t?t="lerc":"error"===t&&(t=""),t}async function D(e,t={},r){if(null==e)throw new i.Z("rasterCodec:decode","missing encodeddata parameter.");let o,a,s=t.format&&t.format.toLowerCase();if(!("bsq"!==s&&"bip"!==s||null!=t.width&&null!=t.height))throw new i.Z("rasterCodec:decode","requires width and height in options parameter.");return"tiff"===s&&t.customOptions?function(e,t){const r=(0,f.d)(e,t.customOptions),i=new n.Z({width:r.width,height:r.height,pixels:r.pixels,pixelType:r.pixelType.toLowerCase(),mask:r.mask,statistics:null});return i.updateStatistics(),i}(e,t):((!s||"bsq"!==s&&"bip"!==s&&"deflate"!==s&&"lzw"!==s)&&(s=I(e)),t.useCanvas&&y.has(s)?a=await A(e,s,t,r):(o=function(e){let t=null;switch(e){case"lerc":t=w;break;case"lerc2":t=x;break;case"jpg":t=T;break;case"png":t=S;break;case"bsq":case"bip":t=(t,r)=>function(e,t,r){const{pixelTypeCtor:i}=M(t.pixelType),o=(0,p.decode)(e,{width:t.width,height:t.height,pixelType:i,format:r}),a=new n.Z({width:t.width,height:t.height,pixels:o.pixels,pixelType:t.pixelType,mask:o.mask,statistics:null});return a.updateStatistics(),a}(t,r,e);break;case"tiff":t=C;break;case"deflate":t=k;break;case"lzw":t=v;break;case"error":t=()=>{throw new i.Z("rasterCodec:decode","input data contains error")};break;default:t=()=>{throw new i.Z("rasterCodec:decode","unsupported raster format")}}return t}(s),t.isPoint&&((t={...t}).width++,t.height++),a=o(e,t),t.isPoint&&function(e,t=1){if(!e)return;const{pixels:r,width:i,height:o,mask:a}=e;if(!r||0===r.length)return;const s=r.length,l=i-1,f=o-1,u=[];let h,c,d,p,m,g,y;const w=n.Z.getPixelArrayConstructor(e.pixelType);if(0===t){for(h=0;h<s;h++){for(m=r[h],g=new w(l*f),c=0;c<f;c++)for(p=c*i,d=0;d<l;d++)g[c*l+d]=m[p+d];u.push(g)}if(a)for(y=new Uint8Array(l*f),c=0;c<f;c++)for(p=c*i,d=0;d<l;d++)y[c*l+d]=a[p+d]}else{for(h=0;h<s;h++){for(m=r[h],g=new w(l*f),c=0;c<f;c++)for(p=c*i,d=0;d<l;d++)g[c*l+d]=(m[p+d]+m[p+d+1]+m[p+i+d]+m[p+i+d+1])/4;u.push(g)}if(a)for(y=new Uint8Array(l*f),c=0;c<f;c++)for(p=c*i,d=0;d<l;d++)y[c*l+d]=Math.min.apply(null,[a[p+d],a[p+d+1],a[p+i+d],a[p+i+d+1]])}e.width=l,e.height=f,e.mask=y,e.pixels=u}(a)),a)}},9832:(e,t,r)=>{r.d(t,{Z:()=>s});const i=(()=>{const e=[];return e[254]="NEWSUBFILETYPE",e[255]="SUBFILETYPE",e[256]="IMAGEWIDTH",e[257]="IMAGELENGTH",e[258]="BITSPERSAMPLE",e[259]="COMPRESSION",e[262]="PHOTOMETRICINTERPRETATION",e[263]="THRESHHOLDING",e[264]="CELLWIDTH",e[265]="CELLLENGTH",e[266]="FILLORDER",e[269]="DOCUMENTNAME",e[270]="IMAGEDESCRIPTION",e[271]="MAKE",e[272]="MODEL",e[273]="STRIPOFFSETS",e[274]="ORIENTATION",e[277]="SAMPLESPERPIXEL",e[278]="ROWSPERSTRIP",e[279]="STRIPBYTECOUNTS",e[280]="MINSAMPLEVALUE",e[281]="MAXSAMPLEVALUE",e[282]="XRESOLUTION",e[283]="YRESOLUTION",e[284]="PLANARCONFIGURATION",e[285]="PAGENAME",e[286]="XPOSITION",e[287]="YPOSITION",e[288]="FREEOFFSETS",e[289]="FREEBYTECOUNTS",e[290]="GRAYRESPONSEUNIT",e[291]="GRAYRESPONSECURVE",e[292]="T4OPTIONS",e[293]="T6OPTIONS",e[296]="RESOLUTIONUNIT",e[297]="PAGENUMBER",e[300]="COLORRESPONSEUNIT",e[301]="TRANSFERFUNCTION",e[305]="SOFTWARE",e[306]="DATETIME",e[315]="ARTIST",e[316]="HOSTCOMPUTER",e[317]="PREDICTOR",e[318]="WHITEPOINT",e[319]="PRIMARYCHROMATICITIES",e[320]="COLORMAP",e[321]="HALFTONEHINTS",e[322]="TILEWIDTH",e[323]="TILELENGTH",e[324]="TILEOFFSETS",e[325]="TILEBYTECOUNTS",e[326]="BADFAXLINES",e[327]="CLEANFAXDATA",e[328]="CONSECUTIVEBADFAXLINES",e[330]="SUBIFD",e[332]="INKSET",e[333]="INKNAMES",e[334]="NUMBEROFINKS",e[336]="DOTRANGE",e[337]="TARGETPRINTER",e[338]="EXTRASAMPLES",e[339]="SAMPLEFORMAT",e[340]="SMINSAMPLEVALUE",e[341]="SMAXSAMPLEVALUE",e[342]="TRANSFERRANGE",e[347]="JPEGTABLES",e[512]="JPEGPROC",e[513]="JPEGIFOFFSET",e[514]="JPEGIFBYTECOUNT",e[515]="JPEGRESTARTINTERVAL",e[517]="JPEGLOSSLESSPREDICTORS",e[518]="JPEGPOINTTRANSFORM",e[519]="JPEGQTABLES",e[520]="JPEGDCTABLES",e[521]="JPEGACTABLES",e[529]="YCBCRCOEFFICIENTS",e[530]="YCBCRSUBSAMPLING",e[531]="YCBCRPOSITIONING",e[532]="REFERENCEBLACKWHITE",e[700]="XMP",e[33550]="GEOPIXELSCALE",e[33922]="GEOTIEPOINTS",e[33432]="COPYRIGHT",e[42112]="GDAL_METADATA",e[42113]="GDAL_NODATA",e[50844]="RPCCOEFFICIENT",e[34264]="GEOTRANSMATRIX",e[34735]="GEOKEYDIRECTORY",e[34736]="GEODOUBLEPARAMS",e[34737]="GEOASCIIPARAMS",e[34665]="EXIFIFD",e[34853]="GPSIFD",e[40965]="INTEROPERABILITYIFD",e})(),n=(()=>{const e=[].concat(i);return e[36864]="ExifVersion",e[40960]="FlashpixVersion",e[40961]="ColorSpace",e[42240]="Gamma",e[37121]="ComponentsConfiguration",e[37122]="CompressedBitsPerPixel",e[40962]="PixelXDimension",e[40963]="PixelYDimension",e[37500]="MakerNote",e[37510]="UserComment",e[40964]="RelatedSoundFile",e[36867]="DateTimeOriginal",e[36868]="DateTimeDigitized",e[36880]="OffsetTime",e[36881]="OffsetTimeOriginal",e[36882]="OffsetTimeDigitized",e[37520]="SubSecTime",e[37521]="SubSecTimeOriginal",e[37522]="SubSecTimeDigitized",e[37888]="Temperature",e[37889]="Humidity",e[37890]="Pressure",e[37891]="WaterDepth",e[37892]="Acceleration",e[37893]="CameraElevationAngle",e[42016]="ImageUniqueID",e[42032]="CameraOwnerName",e[42033]="BodySerialNumber",e[42034]="LensSpecification",e[42035]="LensMake",e[42036]="LensModel",e[42037]="LensSerialNumber",e[33434]="ExposureTime",e[33437]="FNumber",e[34850]="ExposureProgram",e[34852]="SpectralSensitivity",e[34855]="PhotographicSensitivity",e[34856]="OECF",e[34864]="SensitivityType",e[34865]="StandardOutputSensitivity",e[34866]="RecommendedExposureIndex",e[34867]="ISOSpeed",e[34868]="ISOSpeedLatitudeyyy",e[34869]="ISOSpeedLatitudezzz",e[37377]="ShutterSpeedValue",e[37378]="ApertureValue",e[37379]="BrightnessValue",e[37380]="ExposureBiasValue",e[37381]="MaxApertureValue",e[37382]="SubjectDistance",e[37383]="MeteringMode",e[37384]="LightSource",e[37385]="Flash",e[37386]="FocalLength",e[37396]="SubjectArea",e[41483]="FlashEnergy",e[41484]="SpatialFrequencyResponse",e[41486]="FocalPlaneXResolution",e[41487]="FocalPlaneYResolution",e[41488]="FocalPlaneResolutionUnit",e[41492]="SubjectLocation",e[41493]="ExposureIndex",e[41495]="SensingMethod",e[41728]="FileSource",e[41729]="SceneType",e[41730]="CFAPattern",e[41985]="CustomRendered",e[41986]="ExposureMode",e[41987]="WhiteBalance",e[41988]="DigitalZoomRatio",e[41989]="FocalLengthIn35mmFilm",e[41990]="SceneCaptureType",e[41991]="GainControl",e[41992]="Contrast",e[41993]="Saturation",e[41994]="Sharpness",e[41995]="DeviceSettingDescription",e[41996]="SubjectDistanceRange",e})(),o=(()=>{const e=[];return e[1024]="GTModelTypeGeoKey",e[1025]="GTRasterTypeGeoKey",e[1026]="GTCitationGeoKey",e[2048]="GeographicTypeGeoKey",e[2049]="GeogCitationGeoKey",e[2050]="GeogGeodeticDatumGeoKey",e[2051]="GeogPrimeMeridianGeoKey",e[2052]="GeogLinearUnitsGeoKey",e[2053]="GeogLinearUnitSizeGeoKey",e[2054]="GeogAngularUnitsGeoKey",e[2055]="GeogAngularUnitSizeGeoKey",e[2056]="GeogEllipsoidGeoKey",e[2057]="GeogSemiMajorAxisGeoKey",e[2058]="GeogSemiMinorAxisGeoKey",e[2059]="GeogInvFlatteningGeoKey",e[2061]="GeogPrimeMeridianLongGeoKey",e[2060]="GeogAzimuthUnitsGeoKey",e[3072]="ProjectedCSTypeGeoKey",e[3073]="PCSCitationGeoKey",e[3074]="ProjectionGeoKey",e[3075]="ProjCoordTransGeoKey",e[3076]="ProjLinearUnitsGeoKey",e[3077]="ProjLinearUnitSizeGeoKey",e[3078]="ProjStdParallel1GeoKey",e[3079]="ProjStdParallel2GeoKey",e[3080]="ProjNatOriginLongGeoKey",e[3081]="ProjNatOriginLatGeoKey",e[3082]="ProjFalseEastingGeoKey",e[3083]="ProjFalseNorthingGeoKey",e[3084]="ProjFalseOriginLongGeoKey",e[3085]="ProjFalseOriginLatGeoKey",e[3086]="ProjFalseOriginEastingGeoKey",e[3087]="ProjFalseOriginNorthingGeoKey",e[3088]="ProjCenterLongGeoKey",e[3090]="ProjCenterEastingGeoKey",e[3091]="ProjCenterNorthingGeoKey",e[3092]="ProjScaleAtNatOriginGeoKey",e[3093]="ProjScaleAtCenterGeoKey",e[3094]="ProjAzimuthAngleGeoKey",e[3095]="ProjStraightVertPoleLongGeoKey",e[4096]="VerticalCSTypeGeoKey",e[4097]="VerticalCitationGeoKey",e[4098]="VerticalDatumGeoKey",e[4099]="VerticalUnitsGeoKey",e})(),a=new Map;a.set("EXIFIFD",n),a.set("GPSIFD",["GPSVersionID","GPSLatitudeRef","GPSLatitude","GPSLongitudeRef","GPSLongitude","GPSAltitudeRef","GPSAltitude","GPSTimeStamp","GPSSatellites","GPSStatus","GPSMeasureMode","GPSDOP","GPSSpeedRef","GPSSpeed","GPSTrackRef","GPSTrack","GPSImgDirectionRef","GPSImgDirection","GPSMapDatum","GPSDestLatitudeRef","GPSDestLatitude","GPSDestLongitudeRef","GPSDestLongitude","GPSDestBearingRef","GPSDestBearing","GPSDestDistanceRef","GPSDestDistance","GPSProcessingMethod","GPSAreaInformation","GPSDateStamp","GPSDifferential","GPSHPositioningError"]);const s={TIFF_TAGS:i,ifdTags:a,GEO_KEYS:o,getTagName:function(e,t){let r=(t||i)[e];return void 0===r&&(r="unknown"+String(e)),r}}},48279:(e,t,r)=>{r.d(t,{f:()=>i});const i=(()=>{const e=new ArrayBuffer(4),t=new Uint8Array(e);return new Uint32Array(e)[0]=1,1===t[0]})()},55914:(e,t,r)=>{r.d(t,{Uk:()=>A,SJ:()=>l,Pz:()=>s,oc:()=>c,hE:()=>h,Oh:()=>u,Hv:()=>f,qF:()=>a,nk:()=>o,XV:()=>p,us:()=>y,zp:()=>m,pW:()=>w,Vl:()=>S,dy:()=>d});var i=r(70586),n=r(54163);function o(e){return(0,i.pC)(e)&&"esri.layers.support.PixelBlock"===e.declaredClass&&e.pixels&&e.pixels.length>0}function a(e,t){if(null==t||!t.length||!o(e))return e;const r=e.pixels.length;return t&&t.some((e=>e>=r))||1===r&&1===t.length&&0===t[0]?e:r!==t.length||t.some(((e,t)=>e!==t))?new n.Z({pixelType:e.pixelType,width:e.width,height:e.height,mask:e.mask,validPixelCount:e.validPixelCount,maskIsAlpha:e.maskIsAlpha,pixels:t.map((t=>e.pixels[t])),statistics:e.statistics&&t.map((t=>e.statistics[t]))}):e}function s(e){if(!e)return;const t=e.colormap;if(!t||0===t.length)return;const r=t.sort(((e,t)=>e[0]-t[0]));let i=0;r[0][0]<0&&(i=r[0][0]);const n=Math.max(256,r[r.length-1][0]-i+1),o=new Uint8Array(4*n),a=[];let s,l=0,f=0;const u=5===r[0].length;if(n>65536)return r.forEach((e=>{a[e[0]-i]=u?e.slice(1):e.slice(1).concat([255])})),{indexed2DColormap:a,offset:i,alphaSpecified:u};if(e.fillUnspecified)for(s=r[f],l=s[0]-i;l<n;l++)o[4*l]=s[1],o[4*l+1]=s[2],o[4*l+2]=s[3],o[4*l+3]=u?s[4]:255,l===s[0]-i&&(s=f===r.length-1?s:r[++f]);else for(l=0;l<r.length;l++)s=r[l],f=4*(s[0]-i),o[f]=s[1],o[f+1]=s[2],o[f+2]=s[3],o[f+3]=u?s[4]:255;return{indexedColormap:o,offset:i,alphaSpecified:u}}function l(e,t){if(!o(e))return e;if(!t&&(t.indexedColormap||t.indexed2DColormap))return e;const r=e.clone(),i=r.pixels;let n=r.mask;const a=r.width*r.height;if(1!==i.length)return e;const{indexedColormap:s,indexed2DColormap:l,offset:f,alphaSpecified:u}=t,h=s.length-1;let c=0;const d=i[0],p=new Uint8Array(d.length),m=new Uint8Array(d.length),g=new Uint8Array(d.length);let y,w=0;if(s)if(n)for(c=0;c<a;c++)n[c]&&(w=4*(d[c]-f),w<f||w>h?n[c]=0:(p[c]=s[w],m[c]=s[w+1],g[c]=s[w+2],n[c]=s[w+3]));else{for(n=new Uint8Array(a),c=0;c<a;c++)w=4*(d[c]-f),w<f||w>h?n[c]=0:(p[c]=s[w],m[c]=s[w+1],g[c]=s[w+2],n[c]=s[w+3]);r.mask=n}else if(n)for(c=0;c<a;c++)n[c]&&(y=l[d[c]],p[c]=y[0],m[c]=y[1],g[c]=y[2],n[c]=y[3]);else{for(n=new Uint8Array(a),c=0;c<a;c++)y=l[d[c]],p[c]=y[0],m[c]=y[1],g[c]=y[2],n[c]=y[3];r.mask=n}return r.pixels=[p,m,g],r.statistics=null,r.pixelType="u8",r.maskIsAlpha=u,r}function f(e){if(!o(e))return null;e.statistics||e.updateStatistics();const{pixels:t,mask:r,pixelType:i,statistics:n}=e,a=e.width*e.height,s=t.length;let l,f,u,h,c;const d=[],p=[];let m,g,y,w,x,C,b,k,v,T;const S=256;for(h=0;h<s;h++){if(m=new Uint32Array(S),y=t[h],"u8"===i)if(l=-.5,f=255.5,r)for(c=0;c<a;c++)r[c]&&m[y[c]]++;else for(c=0;c<a;c++)m[y[c]]++;else{if(l=n[h].minValue,f=n[h].maxValue,u=(f-l)/S,g=new Uint32Array(257),r)for(c=0;c<a;c++)r[c]&&g[Math.floor((y[c]-l)/u)]++;else for(c=0;c<a;c++)g[Math.floor((y[c]-l)/u)]++;for(c=0;c<255;c++)m[c]=g[c];m[255]=g[255]+g[256]}for(d.push({min:l,max:f,size:S,counts:m}),w=0,x=0,k=0,c=0;c<S;c++)w+=m[c],x+=c*m[c];for(v=x/w,c=0;c<S;c++)k+=m[c]*(c-v)**2;T=Math.sqrt(k/(w-1)),u=(f-l)/S,C=(v+.5)*u+l,b=T*u,p.push({min:l,max:f,avg:C,stddev:b})}return{statistics:p,histograms:d}}function u(e){const t=[];for(let r=0;r<e.length;r++){const{min:i,max:n,size:o,counts:a}=e[r];let s=0,l=0;for(let e=0;e<o;e++)s+=a[e],l+=e*a[e];const f=l/s;let u=0;for(let e=0;e<o;e++)u+=a[e]*(e-f)**2;const h=(n-i)/o,c=(f+.5)*h+i,d=Math.sqrt(u/(s-1))*h;t.push({min:i,max:n,avg:c,stddev:d})}return t}function h(e){const{minCutOff:t,maxCutOff:r,gamma:i,pixelType:n}=e,o=e.outMin||0,a=e.outMax||255;if(-1===["u8","u16","s8","s16"].indexOf(n))return null;const s=t.length;let l,f,u=0;"s8"===n?u=-127:"s16"===n&&(u=-32767);let h=256;["u16","s16"].indexOf(n)>-1&&(h=65536);const c=[],d=[],p=a-o;for(l=0;l<s;l++)d[l]=r[l]-t[l],c[l]=p/(r[l]-t[l]);const m=i&&i.length>=s,g=[];if(m)for(l=0;l<s;l++)i[l]>1?i[l]>2?g[l]=6.5+(i[l]-2)**2.5:g[l]=6.5+100*(2-i[l])**4:g[l]=1;let y;const w=[];let x,C,b;if(m)for(l=0;l<s;l++){for(b=[],f=0;f<h;f++)x=f+u,y=(x-t[l])/d[l],C=1,i[l]>1&&(C-=(1/p)**(y*g[l])),x<r[l]&&x>t[l]?b[f]=Math.floor(C*p*y**(1/i[l]))+o:x>=r[l]?b[f]=a:b[f]=o;w[l]=b}else for(l=0;l<s;l++){for(b=[],f=0;f<h;f++)x=f+u,x<=t[l]?b[f]=o:x>=r[l]?b[f]=a:b[f]=Math.floor((x-t[l])/d[l]*p)+o;w[l]=b}if(null!=e.contrastOffset){const t=function(e,t){const r=Math.min(Math.max(e,-100),100),i=Math.min(Math.max(t,-100),100),n=255;let o,a;const s=new Uint8Array(256);for(o=0;o<256;o++)r>0&&r<100?a=(200*o-25500+510*i)/(2*(100-r))+128:r<=0&&r>-100?a=(200*o-25500+510*i)*(100+r)/2e4+128:100===r?(a=200*o-25500+256*(100-r)+510*i,a=a>0?n:0):-100===r&&(a=128),s[o]=a>n?n:a<0?0:a;return s}(e.contrastOffset,e.brightnessOffset);for(l=0;l<s;l++)for(b=w[l],f=0;f<h;f++)b[f]=t[b[f]]}return{lut:w,offset:u}}function c(e,t=256){t=Math.min(t,256);const{size:r,counts:i}=e,n=new Uint8Array(r),o=i.reduce(((e,r)=>e+r/t),0);let a=0,s=0,l=0,f=o;for(let e=0;e<r;e++)if(l+=i[e],!(e<r-1&&l+i[e+1]<f)){for(;a<t-1&&f<l;)a++,f+=o;for(let t=s;t<=e;t++)n[t]=a;s=e+1}for(let e=s;e<r;e++)n[e]=t-1;return n}function d(e,t){if(!o(e))return null;const r=e.clone(),{pixels:i,mask:n}=r,{minCutOff:a,maxCutOff:s,gamma:l}=t,f=t.outMin||0,u=t.outMax||255,h=r.width*r.height,c=i.length;let d,p,m,g,y;const w=u-f,x=[],C=[];for(d=0;d<c;d++)C[d]=s[d]-a[d],x[d]=w/(s[d]-a[d]);const b=l&&l.length>=c,k=[];if(b)for(d=0;d<c;d++)l[d]>1?l[d]>2?k[d]=6.5+(l[d]-2)**2.5:k[d]=6.5+100*(2-l[d])**4:k[d]=1;if(b)if(null!=n){for(p=0;p<h;p++)if(n[p])for(d=0;d<c;d++)m=i[d][p],y=(m-a[d])/C[d],g=1,l[d]>1&&(g-=(1/w)**(y*k[d])),m<s[d]&&m>a[d]?i[d][p]=Math.floor(g*w*y**(1/l[d]))+f:m>=s[d]?i[d][p]=u:i[d][p]=f}else for(p=0;p<h;p++)for(d=0;d<c;d++)m=i[d][p],y=(m-a[d])/C[d],g=1,l[d]>1&&(g-=(1/w)**(y*k[d])),m<s[d]&&m>a[d]?i[d][p]=Math.floor(g*w*y**(1/l[d]))+f:m>=s[d]?i[d][p]=u:i[d][p]=f;else if(null!=n){for(p=0;p<h;p++)if(n[p])for(d=0;d<c;d++)m=i[d][p],m<s[d]&&m>a[d]?i[d][p]=Math.floor((m-a[d])/C[d]*w)+f:m>=s[d]?i[d][p]=u:i[d][p]=f}else for(p=0;p<h;p++)for(d=0;d<c;d++)m=i[d][p],m<s[d]&&m>a[d]?i[d][p]=Math.floor((m-a[d])/C[d]*w)+f:m>=s[d]?i[d][p]=u:i[d][p]=f;return r.pixelType="u8",r.updateStatistics(),r}function p(e,t){if(!o(e))return null;const{pixels:r,mask:i}=e,a=e.width*e.height,s=r.length;let l=t.lut;const{offset:f}=t;let u,h;l&&1===l[0].length&&(l=r.map((()=>l)));const c=[];let d,p,m;if(f)if(null==i)for(u=0;u<s;u++){for(d=r[u],p=l[u],m=new Uint8Array(a),h=0;h<a;h++)m[h]=p[d[h]-f];c.push(m)}else for(u=0;u<s;u++){for(d=r[u],p=l[u],m=new Uint8Array(a),h=0;h<a;h++)i[h]&&(m[h]=p[d[h]-f]);c.push(m)}else if(null==i)for(u=0;u<s;u++){for(d=r[u],p=l[u],m=new Uint8Array(a),h=0;h<a;h++)m[h]=p[d[h]];c.push(m)}else for(u=0;u<s;u++){for(d=r[u],p=l[u],m=new Uint8Array(a),h=0;h<a;h++)i[h]&&(m[h]=p[d[h]]);c.push(m)}const g=new n.Z({width:e.width,height:e.height,pixels:c,mask:i,pixelType:"u8"});return g.updateStatistics(),g}function m(e,t){if(!o(e))return null;const r=e.clone(),{pixels:i}=r,n=r.width*r.height,a=t.length,s=Math.floor(a/2),l=t[Math.floor(s)],f=i[0];let u,h,c,d,p,m,g=!1;const y=new Uint8Array(n),w=new Uint8Array(n),x=new Uint8Array(n);let C=r.mask;const b=4===t[0].mappedColor.length;for(C||(C=new Uint8Array(n),C.fill(b?255:1),r.mask=C),p=0;p<n;p++)if(C[p]){for(u=f[p],g=!1,m=s,h=l,c=0,d=a-1;d-c>1;){if(u===h.value){g=!0;break}u>h.value?c=m:d=m,m=Math.floor((c+d)/2),h=t[Math.floor(m)]}g||(u===t[c].value?(h=t[c],g=!0):u===t[d].value?(h=t[d],g=!0):u<t[c].value?(g=!1,h=null):u>t[c].value&&(u<t[d].value?(h=t[c],g=!0):d===a-1?(g=!1,h=null):(h=t[d],g=!0))),g?(y[p]=h.mappedColor[0],w[p]=h.mappedColor[1],x[p]=h.mappedColor[2],C[p]=h.mappedColor[3]):y[p]=w[p]=x[p]=C[p]=0}return r.pixels=[y,w,x],r.mask=C,r.pixelType="u8",r.maskIsAlpha=b,r}function g(e,t,r,i,n,o){const{width:a,height:s}=r.block,{x:l,y:f}=r.offset,{width:u,height:h}=r.mosaic,c=function(e,t,r,i,n,o,a,s){return{xmin:n<=r*e?0:n<r*e+e?n-r*e:e,ymin:o<=i*t?0:o<i*t+t?o-i*t:t,xmax:n+a<=r*e?0:n+a<r*e+e?n+a-r*e:e,ymax:o+s<=i*t?0:o+s<i*t+t?o+s-i*t:t}}(a,s,i,n,l,f,u,h);let d=0,p=0;if(o){const e=o.hasGCSSShiftTransform?360:o.halfWorldWidth,t=a*o.resolutionX,r=o.startX+i*t,n=r+t;r<e&&n>e?p=o.rightPadding:r>=e&&(d=o.leftMargin-o.rightPadding,p=0)}if(c.xmax-=p,"number"!=typeof t)for(let r=c.ymin;r<c.ymax;r++){const o=(n*s+r-f)*u+(i*a-l)+d,h=r*a;for(let r=c.xmin;r<c.xmax;r++)e[o+r]=t[h+r]}else for(let r=c.ymin;r<c.ymax;r++){const o=(n*s+r-f)*u+(i*a-l)+d;for(let r=c.xmin;r<c.xmax;r++)e[o+r]=t}}function y(e,t,r={}){const{clipOffset:a,clipSize:s,alignmentInfo:l,blockWidths:f}=r;if(f)return function(e,t,r){const a=e.find((e=>(0,i.pC)(e)));if(!(0,i.pC)(a))return null;const s=e.some((e=>!(0,i.pC)(e)||!!e.mask)),{width:l,height:f}=t,u=s?new Uint8Array(l*f):null,{blockWidths:h}=r,c=[],d=a.getPlaneCount(),p=n.Z.getPixelArrayConstructor(a.pixelType);if(s)for(let t=0,r=0;t<e.length;r+=h[t],t++){const i=e[t];if(!o(i))continue;const n=i.mask;for(let e=0;e<f;e++)for(let o=0;o<h[t];o++)u[e*l+o+r]=null==n?255:n[e*i.width+o]}for(let t=0;t<d;t++){const r=new p(l*f);for(let i=0,n=0;i<e.length;n+=h[i],i++){const a=e[i];if(!o(a))continue;const s=a.pixels[t];if(null!=s)for(let e=0;e<f;e++)for(let t=0;t<h[i];t++)r[e*l+t+n]=s[e*a.width+t]}c.push(r)}const m=new n.Z({width:l,height:f,mask:u,pixels:c,pixelType:a.pixelType});return m.updateStatistics(),m}(e,t,{blockWidths:f});const u=e.filter((e=>o(e)))[0];if((0,i.Wi)(u))return null;const h=s?s.width:t.width,c=s?s.height:t.height,d=u.width,p=u.height,m=t.width/d,y=t.height/p,w={offset:a||{x:0,y:0},mosaic:s||t,block:{width:d,height:p}},x=u.pixelType,C=n.Z.getPixelArrayConstructor(x),b=u.pixels.length,k=[];let v,T,S;for(let t=0;t<b;t++){T=new C(h*c);for(let r=0;r<y;r++)for(let i=0;i<m;i++){const n=e[r*m+i];o(n)&&(v=n.pixels[t],g(T,v,w,i,r,l))}k.push(T)}if(e.some((e=>(0,i.Wi)(e)||e.mask&&e.mask.length>0))){S=new Uint8Array(h*c);for(let t=0;t<y;t++)for(let r=0;r<m;r++){const n=e[t*m+r];g(S,((0,i.pC)(n)?n.mask:null)||(n?1:0),w,r,t,l)}}const A=new n.Z({width:h,height:c,pixels:k,pixelType:x,mask:S});return A.updateStatistics(),A}function w(e,t,r){if(!o(e))return null;const{width:i,height:n}=e,a=t.x,s=t.y,l=r.width+a,f=r.height+s;if(a<0||s<0||l>i||f>n)return e;if(0===a&&0===s&&l===i&&f===n)return e;e.mask||(e.mask=new Uint8Array(i*n));const u=e.mask;for(let e=0;e<n;e++){const t=e*i;for(let r=0;r<i;r++)u[t+r]=e<s||e>=f||r<a||r>=l?0:1}return e.updateStatistics(),e}function x(e){if(!o(e))return null;const t=e.clone(),{width:r,height:i,pixels:n,mask:a}=e,s=n[0],l=t.pixels[0];for(let e=2;e<i-1;e++){const t=new Map;for(let i=e-2;i<e+2;i++)for(let e=0;e<4;e++){const n=i*r+e;k(t,s[n],a?a[n]:1)}l[e*r]=C(t),l[e*r+1]=l[e*r+2]=l[e*r];let i=3;for(;i<r-1;i++){let n=(e-2)*r+i+1;k(t,s[n],a?a[n]:1),n=(e-1)*r+i+1,k(t,s[n],a?a[n]:1),n=e*r+i+1,k(t,s[n],a?a[n]:1),n=(e+1)*r+i+1,k(t,s[n],a?a[n]:1),n=(e-2)*r+i-3,b(t,s[n],a?a[n]:1),n=(e-1)*r+i-3,b(t,s[n],a?a[n]:1),n=e*r+i-3,b(t,s[n],a?a[n]:1),n=(e+1)*r+i-3,b(t,s[n],a?a[n]:1),l[e*r+i]=C(t)}l[e*r+i+1]=l[e*r+i]}for(let e=0;e<r;e++)l[e]=l[r+e]=l[2*r+e],l[(i-1)*r+e]=l[(i-2)*r+e];return t.updateStatistics(),t}function C(e){if(0===e.size)return 0;let t=0,r=-1,i=0;const n=e.keys();let o=n.next();for(;!o.done;)i=e.get(o.value),i>t&&(r=o.value,t=i),o=n.next();return r}function b(e,t,r){if(0===r)return;const i=e.get(t);1===i?e.delete(t):e.set(t,i-1)}function k(e,t,r){0!==r&&e.set(t,e.has(t)?e.get(t)+1:1)}function v(e,t,r){let{x:i,y:a}=t;const{width:s,height:l}=r;if(0===i&&0===a&&l===e.height&&s===e.width)return e;const{width:f,height:u}=e,h=Math.max(0,a),c=Math.max(0,i),d=Math.min(i+s,f),p=Math.min(a+l,u);if(d<0||p<0||!o(e))return null;i=Math.max(0,-i),a=Math.max(0,-a);const{pixels:m,mask:g}=e,y=s*l,w=m.length,x=[];for(let t=0;t<w;t++){const r=m[t],o=n.Z.createEmptyBand(e.pixelType,y);for(let e=h;e<p;e++){const t=e*f;let n=(e+a-h)*s+i;for(let e=c;e<d;e++)o[n++]=r[t+e]}x.push(o)}const C=new Uint8Array(y);for(let e=h;e<p;e++){const t=e*f;let r=(e+a-h)*s+i;for(let e=c;e<d;e++)C[r++]=g?g[t+e]:1}const b=new n.Z({width:r.width,height:r.height,pixelType:e.pixelType,pixels:x,mask:C});return b.updateStatistics(),b}function T(e,t=!0){if(!o(e))return null;const{pixels:r,width:i,height:a,mask:s,pixelType:l}=e,f=[],u=Math.round(i/2),h=Math.round(a/2),c=a-1,d=i-1;for(let e=0;e<r.length;e++){const o=r[e],s=n.Z.createEmptyBand(l,u*h);let p=0;for(let e=0;e<a;e+=2)for(let r=0;r<i;r+=2){const n=o[e*i+r];if(t){const t=r===d?n:o[e*i+r+1],a=e===c?n:o[e*i+r+i],l=r===d?a:e===c?t:o[e*i+r+i+1];s[p++]=(n+t+a+l)/4}else s[p++]=n}f.push(s)}let p=null;if(s){p=new Uint8Array(u*h);let e=0;for(let r=0;r<a;r+=2)for(let n=0;n<i;n+=2){const o=s[r*i+n];if(t){const t=n===d?o:s[r*i+n+1],a=r===c?o:s[r*i+n+i],l=n===d?a:r===c?t:s[r*i+n+i+1];p[e++]=o*t*a*l?1:0}else p[e++]=o}}return new n.Z({width:u,height:h,pixelType:l,pixels:f,mask:p})}function S(e,t,r){if(!o(e))return null;const{width:i,height:n}=t;let{width:a,height:s}=e;const l=new Map,f={x:0,y:0},u=null==r?1:1+r;let h=e;for(let e=0;e<u;e++){const r=Math.ceil(a/i),o=Math.ceil(s/n);for(let a=0;a<o;a++){f.y=a*n;for(let n=0;n<r;n++){f.x=n*i;const r=v(h,f,t);l.set(`${e}/${a}/${n}`,r)}}e<u-1&&(h=T(h)),a=Math.round(a/2),s=Math.round(s/2)}return l}function A(e,t,r,i,a="nearest"){if(!o(e))return null;"majority"===a&&(e=x(e));const{pixels:s,mask:l,pixelType:f}=e,u=e.width,h=e.height,c=n.Z.getPixelArrayConstructor(f),d=s.length,{width:p,height:m}=t,g=i.cols,y=i.rows,w=Math.ceil(p/g-.1/g),C=Math.ceil(m/y-.1/y);let b,k,v,T,S,A,I,M=!1;for(let e=0;e<r.length;e+=3)-1===r[e]&&-1===r[e+1]&&-1===r[e+2]&&(M=!0);const P=w*g,D=P*C*y,U=new Float32Array(D),B=new Float32Array(D);let E,L,R=0;const O="majority"===a?0:.5;for(let e=0;e<C;e++)for(let t=0;t<w;t++){b=12*(e*w+t),k=r[b],v=r[b+1],T=r[b+2],S=r[b+3],A=r[b+4],I=r[b+5];for(let r=0;r<y;r++){R=(e*y+r)*P+t*g,L=(r+.5)/y;for(let e=0;e<r;e++)E=(e+.5)/g,U[R+e]=Math.round((k*E+v*L+T)*u-O),B[R+e]=Math.round((S*E+A*L+I)*h-O)}b+=6,k=r[b],v=r[b+1],T=r[b+2],S=r[b+3],A=r[b+4],I=r[b+5];for(let r=0;r<y;r++){R=(e*y+r)*P+t*g,L=(r+.5)/y;for(let e=r;e<g;e++)E=(e+.5)/g,U[R+e]=Math.round((k*E+v*L+T)*u-O),B[R+e]=Math.round((S*E+A*L+I)*h-O)}}const _=(e,t)=>{for(let r=0;r<m;r++){b=r*P;for(let i=0;i<p;i++)U[b]<0||B[b]<0?e[r*p+i]=0:e[r*p+i]=t[U[b]+B[b]*u],b++}},G=[];let V;for(let e=0;e<d;e++)V=new c(p*m),_(V,s[e]),G.push(V);const F=new n.Z({width:p,height:m,pixelType:f,pixels:G});if(l)F.mask=new Uint8Array(p*m),_(F.mask,l);else if(M){F.mask=new Uint8Array(p*m);for(let e=0;e<p*m;e++)F.mask[e]=U[e]<0||B[e]<0?0:1}return F.updateStatistics(),F}},80676:(e,t,r)=>{r.d(t,{KC:()=>d,QI:()=>p,Yx:()=>f,NL:()=>l,Tg:()=>h});var i=r(35454),n=r(54163),o=r(55914);const a=new Map;a.set("meter-per-second",1),a.set("kilometer-per-hour",.277778),a.set("knots",.514444),a.set("feet-per-second",.3048),a.set("mile-per-hour",.44704);const s=180/Math.PI,l=new i.Xn({esriMetersPerSecond:"meter-per-second",esriKilometersPerHour:"kilometer-per-hour",esriKnots:"knots",esriFeetPerSecond:"feet-per-second",esriMilesPerHour:"mile-per-hour"});function f(e,t){return a.get(e)/a.get(t)||1}function u(e){return(450-e)%360}function h(e,t="geographic"){const[r,i]=e,n=Math.sqrt(r*r+i*i);let o=Math.atan2(i,r)*s;return o=(360+o)%360,"geographic"===t&&(o=u(o)),[n,o]}function c(e,t="geographic"){let r=e[1];"geographic"===t&&(r=u(r)),r%=360;const i=e[0];return[i*Math.cos(r/s),i*Math.sin(r/s)]}function d(e,t,r="geographic",i=1){if(!(0,o.nk)(e))return e;const{pixels:a,width:s,height:l}=e,f=s*l,u=a[0],d=a[1],p=n.Z.createEmptyBand(e.pixelType,f),m=n.Z.createEmptyBand(e.pixelType,f);let g=0;for(let e=0;e<l;e++)for(let e=0;e<s;e++)"vector-uv"===t?([p[g],m[g]]=h([u[g],d[g]],r),p[g]*=i):([p[g],m[g]]=c([u[g],d[g]],r),p[g]*=i,m[g]*=i),g++;const y=new n.Z({pixelType:e.pixelType,width:e.width,height:e.height,mask:e.mask,validPixelCount:e.validPixelCount,maskIsAlpha:e.maskIsAlpha,pixels:[p,m]});return y.updateStatistics(),y}function p(e,t,r=1){if(1===r||!(0,o.nk)(e))return e;const i=e.clone(),{pixels:n,width:a,height:s}=i,l=n[0],f=n[1];let u=0;for(let e=0;e<s;e++)for(let e=0;e<a;e++)"vector-uv"===t?(l[u]*=r,f[u]*=r):l[u]*=r,u++;return i.updateStatistics(),i}function m(e,t,r,i=1){const n=Math.sqrt(e*e+t*t)/i,o=(2*Math.PI+Math.atan2(t,e))%(2*Math.PI);return[n,(2*Math.PI+o-r)%(2*Math.PI)]}!function(e=0,t=0,r=Math.PI,i=!0){i&&(r=(2*Math.PI-r)%(2*Math.PI));const n=i?-1:1,o=13*n,a=-7*n,s=-2*n,l=-16*n,f=29,[u,h]=m(0,t+o,r,f),[c,d]=m(e-5.5,t+a,r,f),[p,g]=m(e+5.5,t+a,r,f),[y,w]=m(e-1.5,t+s,r,f),[x,C]=m(e+1.5,t+s,r,f),[b,k]=m(e-1.5,t+l,r,f),[v,T]=m(e+1.5,t+l,r,f)}(0,0,0)},91219:(e,t,r)=>{r.d(t,{Z:()=>x});var i=r(43697),n=r(3892),o=r(10736),a=r(92604),s=r(70586),l=r(5600),f=(r(67676),r(80442),r(75215),r(52011)),u=r(48526),h=r(55914),c=r(54163);function d(e){let{altitude:t,azimuth:r}=e;const{hillshadeType:i,pixelSizePower:n,pixelSizeFactor:o,scalingType:a,isGCS:s,resolution:l}=e,f="multi-directional"===i?2*e.zFactor:e.zFactor,{x:u,y:h}=l;let c=f/(8*u),d=f/(8*h);if(s&&f>.001&&(c/=111e3,d/=111e3),"adjusted"===a)if(s){const e=111e3*u,t=111e3*h;c=(f+e**n*o)/(8*e),d=(f+t**n*o)/(8*t)}else c=(f+u**n*o)/(8*u),d=(f+h**n*o)/(8*h);let p=(90-t)*Math.PI/180,m=Math.cos(p),g=(360-r+90)*Math.PI/180,y=Math.sin(p)*Math.cos(g),w=Math.sin(p)*Math.sin(g);const x=[315,270,225,360,180,0],C=[60,60,60,60,60,90],b=new Float32Array([3,5,3,2,1,4]),k=b.reduce(((e,t)=>e+t)),v=b.map((e=>e/k)),T="multi-directional"===i?x.length:1,S=new Float32Array(6),A=new Float32Array(6),I=new Float32Array(6);if("multi-directional"===i)for(let e=0;e<T;e++)t=C[e],r=x[e],p=(90-t)*Math.PI/180,m=Math.cos(p),g=(360-r+90)*Math.PI/180,y=Math.sin(p)*Math.cos(g),w=Math.sin(p)*Math.sin(g),S[e]=m,A[e]=y,I[e]=w;else S.fill(m),A.fill(y),I.fill(w);return{resolution:l,factor:[c,d],sinZcosA:y,sinZsinA:w,cosZ:m,sinZcosAs:A,sinZsinAs:I,cosZs:S,weights:v,hillshadeType:["traditional","multi-directional"].indexOf(i)}}var p=r(93010);const m=a.Z.getLogger("esri.renderers.support.RasterSymbolizer"),g={u1:[0,1],u2:[0,3],u4:[0,15],u8:[0,255],s8:[-128,127],u16:[0,65535],s16:[-32768,32767],u32:[0,4294967295],s32:[-2147483648,2147483647],f32:[-34e38,34e38],f64:[-Number.MAX_VALUE,Number.MAX_VALUE]};let y=class extends o.wq{constructor(e){super(e)}bind(){const{rendererJSON:e}=this;if(!e)return{success:!1};let t;switch(this.lookup={rendererJSON:{}},e.type){case"uniqueValue":t={success:this._updateUVRenderer(e)};break;case"rasterColormap":t={success:this._updateColormapRenderer(e)};break;case"rasterStretch":t={success:this._updateStretchRenderer(e)};break;case"classBreaks":t={success:this._updateClassBreaksRenderer(e)};break;case"rasterShadedRelief":t={success:this._updateShadedReliefRenderer(e)};break;case"vectorField":t={success:this._updateVectorFieldRenderer()};break;case"animatedFlow":t=this._updateAnimatedFlowRenderer()}return t}symbolize(e){let t=e&&e.pixelBlock;if(!w(t))return t;if(e.simpleStretchParams&&"rasterStretch"===this.rendererJSON.type)return this.simpleStretch(t,e.simpleStretchParams);try{let r;switch(t.pixels.length>3&&(t=(0,h.qF)(t,[0,1,2])),this.rendererJSON.type){case"uniqueValue":case"rasterColormap":r=this._symbolize_colormap(t);break;case"classBreaks":r=this._symbolize_classBreaks(t);break;case"rasterStretch":r=this._symbolize_stretch(t,e.bandIds);break;case"rasterShadedRelief":{const{extent:i}=e,n=i.spatialReference.isGeographic,o={x:(i.xmax-i.xmin)/t.width,y:(i.ymax-i.ymin)/t.height};r=this._symbolize_shadedRelief(t,{isGCS:n,resolution:o});break}}return r}catch(e){return m.error("symbolize",e.message),t}}simpleStretch(e,t){if(!w(e))return e;try{return e.pixels.length>3&&(e=(0,h.qF)(e,[0,1,2])),(0,h.dy)(e,t)}catch(t){return m.error("symbolize",t.message),e}}generateWebGLParameters(e){if(["uniqueValue","rasterColormap","classBreaks"].indexOf(this.rendererJSON.type)>-1){var t;const{indexedColormap:e,offset:r}=(null==(t=this.lookup)?void 0:t.colormapLut)||{};return{colormap:e,colormapOffset:r,type:"lut"}}const{pixelBlock:r,isGCS:i,resolution:n,bandIds:o}=e,{rendererJSON:a}=this;return"rasterStretch"===a.type?this.generateStretchWebGLParams(r,a,o):"rasterShadedRelief"===a.type?this.generateShadedReliefWebGLParams(a,i,n):"vectorField"===a.type?this._generateVectorFieldWebGLParams(a):null}_isLUTChanged(e){if(!this.lookup||!this.lookup.rendererJSON)return!0;if("colorRamp"in this.rendererJSON){const t=this.rendererJSON.colorRamp;return e?JSON.stringify(t)!==JSON.stringify(this.lookup.rendererJSON.colorRamp):(this.rendererJSON,this.lookup.rendererJSON,JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON))}return JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON)}_symbolize_colormap(e){return this._isLUTChanged()&&!this.bind().success?e:(0,h.SJ)(e,this.lookup.colormapLut)}_symbolize_classBreaks(e){const t=this.rasterInfo.pixelType,r=["u8","u16","s8","s16"].indexOf(t)>-1;return this._isLUTChanged()&&!this.bind().success?e:r?(0,h.SJ)(e,this.lookup.colormapLut):(0,h.zp)(e,this.lookup.remapLut)}_symbolize_stretch(e,t){const{pixelType:r,bandCount:i}=this.rasterInfo,n=this.rendererJSON,o=["u8","u16","s8","s16"].indexOf(r)>-1;let a,l;const{dra:f}=n,u=n.useGamma?n.gamma:null;if("histogramEqualization"===n.stretchType){const r=f?null:this.lookup.histogramLut,i=this.getStretchCutoff(n,e,t,!r),o=(0,h.dy)(e,{...i,gamma:u});l=(0,h.XV)(o,{lut:f?i.histogramLut:r,offset:0})}else if(o){var c,d;if(f){const i=this.getStretchCutoff(n,e,t);a=(0,h.hE)({pixelType:r,...i,gamma:u})}else if(this._isLUTChanged()){if(!this.bind().success)return e;a=this.lookup?this.lookup.stretchLut:null}else a=this.lookup?this.lookup.stretchLut:null;if(!a)return e;i>1&&(null==t?void 0:t.length)===(null==(c=(0,s.Wg)(e))?void 0:c.pixels.length)&&(null==(d=a)?void 0:d.lut.length)===i&&(a={lut:t.map((e=>a.lut[e])),offset:a.offset}),l=(0,h.XV)(e,a)}else{const r=this.getStretchCutoff(n,e,t);l=(0,h.dy)(e,{...r,gamma:u})}if(n.colorRamp){if(this._isLUTChanged(!0)&&!this.bind().success)return e;l=(0,h.SJ)(l,this.lookup.colormapLut)}return l}_symbolize_shadedRelief(e,t){var r,i;const n=this.rendererJSON,o=function(e,t){if(!(0,h.nk)(e))return e;const{width:r,height:i,mask:n}=e,o=new Uint8Array(r*i);n&&o.set(n);const{factor:a,sinZcosA:s,sinZsinA:l,cosZ:f,sinZcosAs:u,sinZsinAs:p,cosZs:m,weights:g}=d(t),[y,w]=a,{hillshadeType:x}=t,C=e.pixels[0],b=new Uint8Array(r*i);let k,v,T,S,A,I,M,P;for(let e=1;e<i-1;e++){const t=e*r;for(let e=1;e<r-1;e++){if(n&&!n[t+e]){b[t+e]=0;continue}let i=8;if(n&&(i=n[t-r+e-1]+n[t-r+e]+n[t-r+e+1]+n[t+e-1]+n[t+e+1]+n[t+r+e-1]+n[t+r+e]+n[t+r+e+1],i<7)){b[t+e]=0,o[t+e]=0;continue}7===i?(k=n[t-r+e-1]?C[t-r+e-1]:C[t+e],v=n[t-r+e]?C[t-r+e]:C[t+e],T=n[t-r+e+1]?C[t-r+e+1]:C[t+e],S=n[t+e-1]?C[t+e-1]:C[t+e],A=n[t+e+1]?C[t+e+1]:C[t+e],I=n[t+r+e-1]?C[t+r+e-1]:C[t+e],M=n[t+r+e]?C[t+r+e]:C[t+e],P=n[t+r+e+1]?C[t+r+e+1]:C[t+e]):(k=C[t-r+e-1],v=C[t-r+e],T=C[t-r+e+1],S=C[t+e-1],A=C[t+e+1],I=C[t+r+e-1],M=C[t+r+e],P=C[t+r+e+1]);const a=(T+A+A+P-(k+S+S+I))*y,h=(I+M+M+P-(k+v+v+T))*w,c=Math.sqrt(1+a*a+h*h);let d=0;if("traditional"===x){let e=255*(f+l*h-s*a)/c;e<0&&(e=0),d=e}else{const e=p.length;for(let t=0;t<e;t++){let e=255*(m[t]+p[t]*h-u[t]*a)/c;e<0&&(e=0),d+=e*g[t]}}b[t+e]=255&d}}for(let e=0;e<i;e++)b[e*r]=b[e*r+1],b[(e+1)*r-1]=b[(e+1)*r-2];for(let e=1;e<r-1;e++)b[e]=b[e+r],b[e+(i-1)*r]=b[e+(i-2)*r];return new c.Z({width:r,height:i,pixels:[b],mask:n?o:null,pixelType:"u8",validPixelCount:e.validPixelCount,statistics:[{minValue:0,maxValue:255}]})}(e,{...n,...t});if(!n.colorRamp)return o;let a;if(this._isLUTChanged(!0)){if(!this.bind().success)return o;a=this.lookup?this.lookup.hsvMap:null}else a=this.lookup?this.lookup.hsvMap:null;return a?(function(e,t,r,i){if(!(0,h.nk)(e)||!(0,h.nk)(t))return;const{min:n,max:o}=i,a=e.pixels[0],{pixels:s,mask:l}=t,f=s[0],u=255.00001/(o-n),c=new Uint8ClampedArray(f.length),d=new Uint8ClampedArray(f.length),p=new Uint8ClampedArray(f.length),m=r.length-1;for(let e=0;e<f.length;e++){if(l&&0===l[e])continue;const t=Math.floor((f[e]-n)*u),[i,o]=r[t<0?0:t>m?m:t],s=a[e],h=s*o,g=h*(1-Math.abs(i%2-1)),y=s-h;switch(Math.floor(i)){case 0:c[e]=h+y,d[e]=g+y,p[e]=y;break;case 1:c[e]=g+y,d[e]=h+y,p[e]=y;break;case 2:c[e]=y,d[e]=h+y,p[e]=g+y;break;case 3:c[e]=y,d[e]=g+y,p[e]=h+y;break;case 4:c[e]=g+y,d[e]=y,p[e]=h+y;break;case 5:case 6:c[e]=h+y,d[e]=y,p[e]=g+y}}e.pixels=[c,d,p],e.updateStatistics()}(o,e,a,null!=(r=null==(i=(0,s.Wg)(this.rasterInfo.statistics))?void 0:i[0])?r:{min:0,max:8e3}),o):o}_updateVectorFieldRenderer(){const{bandCount:e,dataType:t}=this.rasterInfo;return 2===e&&("vector-magdir"===t||"vector-uv"===t)}_updateAnimatedFlowRenderer(){const{bandCount:e,dataType:t}=this.rasterInfo;return 2!==e||"vector-magdir"!==t&&"vector-uv"!==t?{success:!1,error:`Unsupported data type "${t}"; AnimatedFlowRenderer only supports "vector-magdir" and "vector-uv".`}:{success:!0}}_updateUVRenderer(e){const{bandCount:t,attributeTable:r,pixelType:i}=this.rasterInfo,n=e.field1;if(!n)return!1;const o=e.defaultSymbol,a=1===t&&["u8","s8"].includes(i);if(!function(e,t){const{attributeTable:r,bandCount:i}=e;return!(!(0,s.pC)(r)||i>1||t&&null==r.fields.find((e=>e.name.toLowerCase()===t.toLowerCase())))}(this.rasterInfo,n)&&!a)return!1;const l=[];if(r){const t=r.fields.filter((e=>"value"===e.name.toLowerCase()))[0];if(!t)return!1;r.features.forEach((r=>{var i;const a=e.uniqueValueInfos.filter((e=>String(e.value)===String(r.attributes[n])))[0],s=null==a||null==(i=a.symbol)?void 0:i.color;s?l.push([r.attributes[t.name]].concat(s)):o&&l.push([r.attributes[t.name]].concat(o.color))}))}else{if("value"!==n.toLowerCase())return!1;e.uniqueValueInfos.forEach((e=>{var t;const r=null==e||null==(t=e.symbol)?void 0:t.color;r?l.push([parseInt(""+e.value,10)].concat(r)):o&&l.push([parseInt(""+e.value,10)].concat(o.color))}))}if(0===l.length)return!1;const f=(0,h.Pz)({colormap:l});return this.lookup={rendererJSON:e,colormapLut:f},this.canRenderInWebGL=!0,!0}_updateColormapRenderer(e){if(!function(e){const{bandCount:t,colormap:r}=e;return(0,s.pC)(r)&&r.length&&1===t}(this.rasterInfo))return!1;const t=e.colormapInfos.map((e=>[e.value].concat(e.color))).sort(((e,t)=>e[0]-t[0]));if(!t||0===t.length)return!1;const r=(0,h.Pz)({colormap:t});return this.lookup={rendererJSON:e,colormapLut:r},this.canRenderInWebGL=!0,!0}_updateShadedReliefRenderer(e){if(!function(e){return"elevation"===e.dataType}(this.rasterInfo))return!1;if(e.colorRamp){const t=(0,p.Jw)(e.colorRamp,256,!0),r=(0,h.Pz)({colormap:t}),i=[],o=r.indexedColormap;for(let e=0;e<o.length;e+=4){const t=(0,n._Y)({r:o[e],g:o[e+1],b:o[e+2]});i.push([t.h/60,t.s/100,255*t.v/100])}this.lookup={rendererJSON:e,colormapLut:r,hsvMap:i}}else this.lookup=null;return this.canRenderInWebGL=!0,!0}_updateClassBreaksRenderer(e){const t=this.rasterInfo.pixelType,r=["u8","u16","s8","s16"].indexOf(t)>-1,i=e.classBreakInfos;if(null==i||!i.length)return!1;const n=i.sort(((e,t)=>e.classMaxValue-t.classMaxValue)),o=n[n.length-1];let a=e.minValue;if(!r){const t=[];for(let e=0;e<n.length;e++){var s;t.push({value:null!=(s=n[e].classMinValue)?s:a,mappedColor:n[e].symbol.color}),a=n[e].classMaxValue}return t.push({value:o.classMaxValue,mappedColor:o.symbol.color}),this.lookup={rendererJSON:e,remapLut:t},this.canRenderInWebGL=!1,!0}const l=[];a=Math.floor(e.minValue);for(let e=0;e<n.length;e++){const t=n[e];for(let e=a;e<t.classMaxValue;e++)l.push([e].concat(t.symbol.color));a=Math.ceil(t.classMaxValue)}o.classMaxValue===a&&l.push([o.classMaxValue].concat(o.symbol.color));const f=(0,h.Pz)({colormap:l,fillUnspecified:!1});return this.lookup={rendererJSON:e,colormapLut:f},this.canRenderInWebGL=!0,!0}_isHistogramRequired(e){return"percentClip"===e||"histogramEqualization"===e}_isValidRasterStatistics(e){return(0,s.pC)(e)&&e.length>0&&null!=e[0].min&&null!=e[0].max}_updateStretchRenderer(e){var t;let{stretchType:r,dra:i}=e;if(!("none"===r||null!=(t=e.statistics)&&t.length||this._isValidRasterStatistics(this.rasterInfo.statistics)||i))return!1;const n=(0,s.Wg)(e.histograms||this.rasterInfo.histograms);!this._isHistogramRequired(e.stretchType)||null!=n&&n.length||i||(r="minMax");const{gamma:o,useGamma:a,colorRamp:l}=e,f=this.rasterInfo.pixelType,u=!i&&["u8","u16","s8","s16"].indexOf(f)>-1;if("histogramEqualization"===r){const t=n.map((e=>(0,h.oc)(e)));this.lookup={rendererJSON:e,histogramLut:t}}else if(u){const t=this.getStretchCutoff(e),r=(0,h.hE)({pixelType:f,...t,gamma:a?o:null});this.lookup={rendererJSON:e,stretchLut:r}}if(l){const t=(0,p.Jw)(l,256,!0);this.lookup||(this.lookup={rendererJSON:e}),this.lookup.colormapLut=(0,h.Pz)({colormap:t}),this.lookup.rendererJSON=e}return this.canRenderInWebGL=!0,!0}getStretchCutoff(e,t=null,r,i){var n,o,a;let l,f,u=e.stretchType;var c;if(e.dra)if("minMax"===u&&(0,s.pC)(t)&&t.statistics)l=t.statistics.map((e=>[e.minValue,e.maxValue,0,0]));else{const e=(0,h.Hv)(t);l=(0,s.pC)(e)?e.statistics:null,f=(0,s.pC)(e)?e.histograms:null}else l=(null==(c=e.statistics)?void 0:c.length)>0?e.statistics:(0,s.Wg)(this.rasterInfo.statistics),f=e.histograms||(0,s.Wg)(this.rasterInfo.histograms);!this._isHistogramRequired(u)||null!=(n=f)&&n.length||(u="minMax");const d=(null==(o=l)?void 0:o.length)||(null==(a=f)?void 0:a.length)||this.rasterInfo.bandCount,p=[],m=[];let y,w,x,C,b,k,v,T,S,A,I,M;switch(l&&!Array.isArray(l[0])&&(l=l.map((e=>[e.min,e.max,e.avg,e.stddev]))),u){case"none":{const e=g[this.rasterInfo.pixelType]||g.f32;for(T=0;T<d;T++)p[T]=e[0],m[T]=e[1]}break;case"minMax":for(T=0;T<d;T++)p[T]=l[T][0],m[T]=l[T][1];break;case"standardDeviation":for(T=0;T<d;T++)p[T]=l[T][2]-e.numberOfStandardDeviations*l[T][3],m[T]=l[T][2]+e.numberOfStandardDeviations*l[T][3],p[T]<l[T][0]&&(p[T]=l[T][0]),m[T]>l[T][1]&&(m[T]=l[T][1]);break;case"histogramEqualization":for(T=0;T<d;T++)p[T]=f[T].min,m[T]=f[T].max;break;case"percentClip":for(T=0;T<f.length;T++){for(y=f[T],b=new Uint32Array(y.size),C=y.counts,x=0,w=(y.max-y.min)/y.size,v=-.5===y.min&&1===w?.5:0,S=0;S<y.size;S++)x+=C[S],b[S]=x;for(k=(e.minPercent||0)*x/100,S=0;S<y.size;S++)if(b[S]>k){p[T]=y.min+w*(S+v);break}for(k=(1-(e.maxPercent||0)/100)*x,S=y.size-2;S>=0;S--)if(b[S]<k){m[T]=y.min+w*(S+2-v);break}}break;default:for(T=0;T<d;T++)p[T]=l[T][0],m[T]=l[T][1]}"histogramEqualization"===u?(I=f[0].size||256,A=0,i&&(M=f.map((e=>(0,h.oc)(e))))):(I=e.max||255,A=e.min||0);const P={minCutOff:p,maxCutOff:m,outMax:I,outMin:A,histogramLut:M};return this.getSelectedBandCutoffs(P,r)}getSelectedBandCutoffs(e,t){if(null==t||0===t.length)return e;const r=Math.max.apply(null,t),{minCutOff:i,maxCutOff:n,outMin:o,outMax:a,histogramLut:s}=e;return i.length===t.length||i.length<=r?e:{minCutOff:t.map((e=>i[e])),maxCutOff:t.map((e=>n[e])),histogramLut:s?t.map((e=>s[e])):null,outMin:o,outMax:a}}generateStretchWebGLParams(e,t,r){let i=null,n=null;const o=this.lookup&&this.lookup.colormapLut;t.colorRamp&&o&&(i=o.indexedColormap,n=o.offset),"histogramEqualization"===t.stretchType&&(t={...t,stretchType:"minMax"});const{gamma:a}=t,l=!!(t.useGamma&&a&&a.some((e=>1!==e))),{minCutOff:f,maxCutOff:u,outMin:h,outMax:c}=this.getStretchCutoff(t,e,r);let d=0;(0,s.pC)(e)&&(d=e.getPlaneCount(),2===d&&((e=e.clone()).statistics=[e.statistics[0]],e.pixels=[e.pixels[0]]));const p=Math.min(3,(null==r?void 0:r.length)||d||this.rasterInfo.bandCount),m=new Float32Array(p),g=i||l?1:255;let y;for(y=0;y<p;y++)m[y]=(c-h)/(u[y]-f[y])/g;const w=new Float32Array(p);if(l)for(y=0;y<p;y++)a[y]>1?a[y]>2?w[y]=6.5+(a[y]-2)**2.5:w[y]=6.5+100*(2-a[y])**4:w[y]=1;return{bandCount:p,outMin:h/g,outMax:c/g,minCutOff:f,maxCutOff:u,factor:m,useGamma:l,gamma:l?a:[1,1,1],gammaCorrection:l?w:[1,1,1],colormap:i,colormapOffset:n,stretchType:t.stretchType,type:"stretch"}}generateShadedReliefWebGLParams(e,t,r){var i,n,o;let a=null,l=null;const f=this.lookup&&this.lookup.colormapLut;e.colorRamp&&f&&(a=f.indexedColormap,l=f.offset);const u=d({...e,isGCS:t,resolution:r}),h=null==(i=(0,s.Wg)(this.rasterInfo.statistics))?void 0:i[0];return{...u,minValue:null!=(n=null==h?void 0:h.min)?n:0,maxValue:null!=(o=null==h?void 0:h.max)?o:8e3,hillshadeType:"traditional"===e.hillshadeType?0:1,type:"hillshade",colormap:a,colormapOffset:l}}_generateVectorFieldWebGLParams(e){var t,r,i,n,o,a;const{style:l,inputUnit:f,outputUnit:u,visualVariables:h,symbolTileSize:c,flowRepresentation:d}=e;let p;const m=null!=(t=null==h?void 0:h.find((e=>"sizeInfo"===e.type)))?t:{type:"sizeInfo",field:"Magnitude",maxDataValue:null==(r=this.rasterInfo.statistics)?void 0:r[0].max,maxSize:.8*c,minDataValue:null==(i=this.rasterInfo.statistics)?void 0:i[0].min,minSize:.2*c},g=m?m.minDataValue:null==(n=this.rasterInfo.statistics)?void 0:n[0].min,y=m?m.maxDataValue:null==(o=this.rasterInfo.statistics)?void 0:o[0].max,w=(0,s.pC)(m.maxSize)&&(0,s.pC)(m.minSize)?[m.minSize/c,m.maxSize/c]:[.2,.8];if("wind_speed"===l||"simple_scalar"===l){const e=(w[0]+w[1])/2;w[0]=w[1]=e}const x=(0,s.pC)(g)&&(0,s.pC)(y)?[g,y]:null;if("classified_arrow"===l)if((0,s.pC)(g)&&(0,s.pC)(y)&&(0,s.pC)(m)){p=[];const e=(m.maxDataValue-m.minDataValue)/5;for(let t=0;t<6;t++)p.push(m.minDataValue+e*t)}else p=[0,1e-6,3.5,7,10.5,14];const C="flow_to"===d==("ocean_current_kn"===l||"ocean_current_m"===l)?0:Math.PI,b=null==h?void 0:h.find((e=>"rotationInfo"===e.type));return{breakValues:p,dataRange:x,inputUnit:f,outputUnit:u,symbolTileSize:c,symbolPercentRange:w,style:l||"single_arrow",rotation:C,rotationType:(null==(a=this.rasterInfo.storageInfo)?void 0:a.tileInfo)&&"vector-uv"===this.rasterInfo.dataType?"geographic":(null==b?void 0:b.rotationType)||e.rotationType,type:"vectorField"}}};function w(e){return(0,h.nk)(e)&&0!==e.validPixelCount}(0,i._)([(0,l.Cb)({json:{write:!0}})],y.prototype,"rendererJSON",void 0),(0,i._)([(0,l.Cb)({type:u.Z,json:{write:!0}})],y.prototype,"rasterInfo",void 0),(0,i._)([(0,l.Cb)({json:{write:!0}})],y.prototype,"lookup",void 0),(0,i._)([(0,l.Cb)()],y.prototype,"canRenderInWebGL",void 0),y=(0,i._)([(0,f.j)("esri.renderers.support.RasterSymbolizer")],y);const x=y},93010:(e,t,r)=>{r.d(t,{Ms:()=>o,Jw:()=>u,Uh:()=>f});var i=r(22303),n=r(3892);const o=[{id:"aspect_predefined",type:"multipart",colorRamps:[{fromColor:[190,190,190],toColor:[255,45,8]},{fromColor:[255,45,8],toColor:[255,181,61]},{fromColor:[255,181,61],toColor:[255,254,52]},{fromColor:[255,254,52],toColor:[0,251,50]},{fromColor:[0,251,50],toColor:[255,254,52]},{fromColor:[0,253,255],toColor:[0,181,255]},{fromColor:[0,181,255],toColor:[26,35,253]},{fromColor:[26,35,253],toColor:[255,57,251]},{fromColor:[255,57,251],toColor:[255,45,8]}]},{id:"blackToWhite_predefined",fromColor:[0,0,0],toColor:[255,255,255]},{id:"blueBright_predefined",fromColor:[204,204,255],toColor:[0,0,224]},{id:"blueLightToDark_predefined",fromColor:[211,229,232],toColor:[46,100,140]},{id:"blueGreenBright_predefined",fromColor:[203,245,234],toColor:[48,207,146]},{id:"blueGreenLightToDark_predefined",fromColor:[216,242,237],toColor:[21,79,74]},{id:"brownLightToDark_predefined",fromColor:[240,236,170],toColor:[102,72,48]},{id:"brownToBlueGreenDivergingBright_predefined",type:"multipart",colorRamps:[{fromColor:[156,85,31],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[33,130,145]}]},{id:"brownToBlueGreenDivergingDark_predefined",type:"multipart",colorRamps:[{fromColor:[110,70,45],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[48,100,102]}]},{id:"coefficientBias_predefined",fromColor:[214,214,255],toColor:[0,57,148]},{id:"coldToHotDiverging_predefined",type:"multipart",colorRamps:[{fromColor:[69,117,181],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[214,47,39]}]},{id:"conditionNumber_predefined",type:"multipart",colorRamps:[{fromColor:[0,97,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,34,0]}]},{id:"cyanToPurple_predefined",type:"multipart",colorRamps:[{fromColor:[0,245,245],toColor:[0,0,245]},{fromColor:[0,0,245],toColor:[245,0,245]}]},{id:"cyanLightToBlueDark_predefined",type:"multipart",colorRamps:[{fromColor:[182,237,240],toColor:[31,131,224]},{fromColor:[31,131,224],toColor:[9,9,145]}]},{id:"distance_predefined",fromColor:[255,200,0],toColor:[0,0,255]},{id:"elevation1_predefined",type:"multipart",colorRamps:[{fromColor:[175,240,233],toColor:[255,255,179]},{fromColor:[255,255,179],toColor:[0,128,64]},{fromColor:[0,128,64],toColor:[252,186,3]},{fromColor:[252,186,3],toColor:[128,0,0]},{fromColor:[120,0,0],toColor:[105,48,13]},{fromColor:[105,48,13],toColor:[171,171,171]},{fromColor:[171,171,171],toColor:[255,252,255]}]},{id:"elevation2_predefined",type:"multipart",colorRamps:[{fromColor:[118,219,211],toColor:[255,255,199]},{fromColor:[255,255,199],toColor:[255,255,128]},{fromColor:[255,255,128],toColor:[217,194,121]},{fromColor:[217,194,121],toColor:[135,96,38]},{fromColor:[135,96,38],toColor:[150,150,181]},{fromColor:[150,150,181],toColor:[181,150,181]},{fromColor:[181,150,181],toColor:[255,252,255]}]},{id:"errors_predefined",fromColor:[255,235,214],toColor:[196,10,10]},{id:"grayLightToDark_predefined",fromColor:[219,219,219],toColor:[69,69,69]},{id:"greenBright_predefined",fromColor:[204,255,204],toColor:[14,204,14]},{id:"greenLightToDark_predefined",fromColor:[220,245,233],toColor:[34,102,51]},{id:"greenToBlue_predefined",type:"multipart",colorRamps:[{fromColor:[32,204,16],toColor:[0,242,242]},{fromColor:[0,242,242],toColor:[2,33,227]}]},{id:"orangeBright_predefined",fromColor:[255,235,204],toColor:[240,118,5]},{id:"orangeLightToDark_predefined",fromColor:[250,233,212],toColor:[171,65,36]},{id:"partialSpectrum_predefined",type:"multipart",colorRamps:[{fromColor:[242,241,162],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]},{fromColor:[252,3,69],toColor:[176,7,237]},{fromColor:[176,7,237],toColor:[2,29,173]}]},{id:"partialSpectrum1Diverging_predefined",type:"multipart",colorRamps:[{fromColor:[135,38,38],toColor:[240,149,12]},{fromColor:[240,149,12],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[74,80,181]},{fromColor:[74,80,181],toColor:[39,32,122]}]},{id:"partialSpectrum2Diverging_predefined",type:"multipart",colorRamps:[{fromColor:[115,77,42],toColor:[201,137,52]},{fromColor:[201,137,52],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[91,63,176]},{fromColor:[91,63,176],toColor:[81,13,97]}]},{id:"pinkToYellowGreenDivergingBright_predefined",type:"multipart",colorRamps:[{fromColor:[158,30,113],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[99,110,45]}]},{id:"pinkToYellowGreenDivergingDark_predefined",type:"multipart",colorRamps:[{fromColor:[97,47,73],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[22,59,15]}]},{id:"precipitation_predefined",type:"multipart",colorRamps:[{fromColor:[194,82,60],toColor:[237,161,19]},{fromColor:[237,161,19],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,219,0]},{fromColor:[0,219,0],toColor:[32,153,143]},{fromColor:[32,153,143],toColor:[11,44,122]}]},{id:"prediction_predefined",type:"multipart",colorRamps:[{fromColor:[40,146,199],toColor:[250,250,100]},{fromColor:[250,250,100],toColor:[232,16,20]}]},{id:"purpleBright_predefined",fromColor:[255,204,255],toColor:[199,0,199]},{id:"purpleToGreenDivergingBright_predefined",type:"multipart",colorRamps:[{fromColor:[77,32,150],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[20,122,11]}]},{id:"purpleToGreenDivergingDark_predefined",type:"multipart",colorRamps:[{fromColor:[67,14,89],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[24,79,15]}]},{id:"purpleBlueBright_predefined",fromColor:[223,184,230],toColor:[112,12,242]},{id:"purpleBlueLightToDark_predefined",fromColor:[229,213,242],toColor:[93,44,112]},{id:"purpleRedBright_predefined",fromColor:[255,204,225],toColor:[199,0,99]},{id:"purpleRedLightToDark_predefined",fromColor:[250,215,246],toColor:[143,17,57]},{id:"redBright_predefined",fromColor:[255,204,204],toColor:[219,0,0]},{id:"redLightToDark_predefined",fromColor:[255,224,224],toColor:[143,10,10]},{id:"redToBlueDivergingBright_predefined",type:"multipart",colorRamps:[{fromColor:[196,69,57],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[48,95,207]}]},{id:"redToBlueDivergingDark_predefined",type:"multipart",colorRamps:[{fromColor:[107,13,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[13,53,97]}]},{id:"redToGreen_predefined",type:"multipart",colorRamps:[{fromColor:[245,0,0],toColor:[245,245,0]},{fromColor:[245,245,0],toColor:[0,245,0]}]},{id:"redToGreenDivergingBright_predefined",type:"multipart",colorRamps:[{fromColor:[186,20,20],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[54,145,33]}]},{id:"redToGreenDivergingDark_predefined",type:"multipart",colorRamps:[{fromColor:[97,21,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[16,69,16]}]},{id:"slope_predefined",type:"multipart",colorRamps:[{fromColor:[56,168,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]}]},{id:"spectrumFullBright_predefined",type:"multipart",colorRamps:[{fromColor:[255,0,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,0,255]}]},{id:"spectrumFullDark_predefined",type:"multipart",colorRamps:[{fromColor:[153,0,0],toColor:[153,153,0]},{fromColor:[153,153,0],toColor:[0,153,153]},{fromColor:[0,153,153],toColor:[0,0,153]}]},{id:"spectrumFullLight_predefined",type:"multipart",colorRamps:[{fromColor:[255,153,153],toColor:[255,255,153]},{fromColor:[255,255,153],toColor:[153,255,255]},{fromColor:[153,255,255],toColor:[153,153,255]}]},{id:"surface_predefined",type:"multipart",colorRamps:[{fromColor:[112,153,89],toColor:[242,238,162]},{fromColor:[242,238,162],toColor:[242,206,133]},{fromColor:[242,206,133],toColor:[194,140,124]},{fromColor:[194,140,124],toColor:[255,242,255]}]},{id:"temperature_predefined",type:"multipart",colorRamps:[{fromColor:[255,252,255],toColor:[255,0,255]},{fromColor:[255,0,255],toColor:[0,0,255]},{fromColor:[0,0,255],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,255,0]},{fromColor:[0,255,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,128,0]},{fromColor:[255,128,0],toColor:[128,0,0]}]},{id:"whiteToBlack_predefined",fromColor:[255,255,255],toColor:[0,0,0]},{id:"yellowToDarkRed_predefined",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[242,167,46]},{fromColor:[242,167,46],toColor:[107,0,0]}]},{id:"yellowToGreenToDarkBlue_predefined",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[56,224,9]},{fromColor:[56,224,9],toColor:[26,147,171]},{fromColor:[26,147,171],toColor:[12,16,120]}]},{id:"yellowToRed_predefined",fromColor:[245,245,0],toColor:[255,0,0]},{id:"yellowGreenBright_predefined",fromColor:[236,252,204],toColor:[157,204,16]},{id:"yellowGreenLightToDark_predefined",fromColor:[215,240,175],toColor:[96,107,45]}],a={aspect_predefined:"Aspect",blackToWhite_predefined:"Black to White",blueBright_predefined:"Blue Bright",blueLightToDark_predefined:"Blue Light to Dark",blueGreenBright_predefined:"Blue-Green Bright",blueGreenLightToDark_predefined:"Blue-Green Light to Dark",brownLightToDark_predefined:"Brown Light to Dark",brownToBlueGreenDivergingBright_predefined:"Brown to Blue Green Diverging, Bright",brownToBlueGreenDivergingDark_predefined:"Brown to Blue Green Diverging, Dark",coefficientBias_predefined:"Coefficient Bias",coldToHotDiverging_predefined:"Cold to Hot Diverging",conditionNumber_predefined:"Condition Number",cyanToPurple_predefined:"Cyan to Purple",cyanLightToBlueDark_predefined:"Cyan-Light to Blue-Dark",distance_predefined:"Distance",elevation1_predefined:"Elevation #1",elevation2_predefined:"Elevation #2",errors_predefined:"Errors",grayLightToDark_predefined:"Gray Light to Dark",greenBright_predefined:"Green Bright",greenLightToDark_predefined:"Green Light to Dark",greenToBlue_predefined:"Green to Blue",orangeBright_predefined:"Orange Bright",orangeLightToDark_predefined:"Orange Light to Dark",partialSpectrum_predefined:"Partial Spectrum",partialSpectrum1Diverging_predefined:"Partial Spectrum 1 Diverging",partialSpectrum2Diverging_predefined:"Partial Spectrum 2 Diverging",pinkToYellowGreenDivergingBright_predefined:"Pink to YellowGreen Diverging, Bright",pinkToYellowGreenDivergingDark_predefined:"Pink to YellowGreen Diverging, Dark",precipitation_predefined:"Precipitation",prediction_predefined:"Prediction",purpleBright_predefined:"Purple Bright",purpleToGreenDivergingBright_predefined:"Purple to Green Diverging, Bright",purpleToGreenDivergingDark_predefined:"Purple to Green Diverging, Dark",purpleBlueBright_predefined:"Purple-Blue Bright",purpleBlueLightToDark_predefined:"Purple-Blue Light to Dark",purpleRedBright_predefined:"Purple-Red Bright",purpleRedLightToDark_predefined:"Purple-Red Light to Dark",redBright_predefined:"Red Bright",redLightToDark_predefined:"Red Light to Dark",redToBlueDivergingBright_predefined:"Red to Blue Diverging, Bright",redToBlueDivergingDark_predefined:"Red to Blue Diverging, Dark",redToGreen_predefined:"Red to Green",redToGreenDivergingBright_predefined:"Red to Green Diverging, Bright",redToGreenDivergingDark_predefined:"Red to Green Diverging, Dark",slope_predefined:"Slope",spectrumFullBright_predefined:"Spectrum-Full Bright",spectrumFullDark_predefined:"Spectrum-Full Dark",spectrumFullLight_predefined:"Spectrum-Full Light",surface_predefined:"Surface",temperature_predefined:"Temperature",whiteToBlack_predefined:"White to Black",yellowToDarkRed_predefined:"Yellow to Dark Red",yellowToGreenToDarkBlue_predefined:"Yellow to Green to Dark Blue",yellowToRed_predefined:"Yellow to Red",yellowGreenBright_predefined:"Yellow-Green Bright",yellowGreenLightToDark_predefined:"Yellow-Green Light to Dark"};function s(e,t){if(!e||!t||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]>t[r]+2||e[r]<t[r]-2)return!1;return!0}function l(e,t,r){const i=(0,n.Y3)(e),o=(0,n.Y3)(t),a={l:i.l*(1-r)+r*o.l,a:i.a*(1-r)+r*o.a,b:i.b*(1-r)+r*o.b};return(0,n.xr)(a)}function f(e){const t=function(e,t){if(!e)return;const r=o;let n,a=null;return"algorithmic"===e.type?r.some((t=>{if(s(e.fromColor.toRgb(),t.fromColor)&&s(e.toColor.toRgb(),t.toColor))return a=t.id,!0})):"multipart"===e.type&&r.some((t=>{if(e.colorRamps&&t.colorRamps&&e.colorRamps.length===t.colorRamps.length&&(n=e.colorRamps,!t.colorRamps.some(((e,t)=>{if(!s(n[t].fromColor.toRgb(),new i.Z(e.fromColor).toRgb())||!s(n[t].toColor.toRgb(),new i.Z(e.toColor).toRgb()))return!0})))){if(a)return!0;a=t.id}})),a}(e);return t?a[t]:null}function u(e,t,r=!1){if(!e||!t||t<1)return;const i="toJSON"in e?e.toJSON():e,n="multipart"===i.type?i.colorRamps.length:1,o=[],a=[];let s,f,u,h,c,d=0;if(1===t)return s="multipart"===i.type?i.colorRamps[0].fromColor:i.fromColor,a.push([0].concat(s)),a;for(let e=0;e<n;e++)o[e]={start:null,end:null},o[e].start=d,o[e].end=d+1/n,d=o[e].end;for(let e=0;e<t;e++)h=e/(t-1),o.forEach(((o,d)=>{if(h>=o.start&&(h<o.end||e===t-1&&d===n-1)){c=(h-o.start)/(o.end-o.start),"multipart"===i.type?(s=i.colorRamps[d].fromColor,f=i.colorRamps[d].toColor):(s=i.fromColor,f=i.toColor),0===e?a.push([e].concat(s.slice(0,3))):e===t-1?a.push([e].concat(f.slice(0,3))):(u=l({r:s[0],g:s[1],b:s[2]},{r:f[0],g:f[1],b:f[2]},c),a.push([e,u.r,u.g,u.b]));const n=null!=s[3]?s[3]>1?s[3]/255:s[3]:1,p=null!=f[3]?f[3]>1?f[3]/255:f[3]:1;r&&a[e].push(Math.min(255,Math.round(255*(n*(1-c)+p*c))))}}));return a}},23808:(e,t,r)=>{r.d(t,{z_:()=>s}),r(66577);var i=r(92604),n=(r(22021),r(95330)),o=r(77734);r(8744),r(6570);const a=i.Z.getLogger("esri.views.2d.engine.flow.dataUtils");async function s(e,t,r){const i=performance.now(),s=function(e,t){const r=function(e,t,r,i){if(0===i)return e;const n=Math.round(3*i),o=new Array(2*n+1);let a=0;for(let e=-n;e<=n;e++){const t=Math.exp(-e*e/(i*i));o[e+n]=t,a+=t}for(let e=-n;e<=n;e++)o[e+n]/=a;const s=new Float32Array(e.length);for(let i=0;i<r;i++)for(let r=0;r<t;r++){let a=0,l=0;for(let s=-n;s<=n;s++){if(r+s<0||r+s>=t)continue;const f=o[s+n];a+=f*e[2*(i*t+(r+s))+0],l+=f*e[2*(i*t+(r+s))+1]}s[2*(i*t+r)+0]=a,s[2*(i*t+r)+1]=l}const l=new Float32Array(e.length);for(let e=0;e<t;e++)for(let i=0;i<r;i++){let a=0,f=0;for(let l=-n;l<=n;l++){if(i+l<0||i+l>=r)continue;const u=o[l+n];a+=u*s[2*((i+l)*t+e)+0],f+=u*s[2*((i+l)*t+e)+1]}l[2*(i*t+e)+0]=a,l[2*(i*t+e)+1]=f}return l}(t.data,t.width,t.height,e.smoothing);return e.interpolate?(e,i)=>{const n=Math.floor(e),o=Math.floor(i);if(n<0||n>=t.width)return[0,0];if(o<0||o>=t.height)return[0,0];const a=e-n,s=i-o,l=n,f=o,u=n<t.width-1?n+1:n,h=o<t.height-1?o+1:o,c=r[2*(f*t.width+l)],d=r[2*(f*t.width+u)],p=r[2*(h*t.width+l)],m=r[2*(h*t.width+u)],g=r[2*(f*t.width+l)+1],y=r[2*(f*t.width+u)+1];return[(c*(1-s)+p*s)*(1-a)+(d*(1-s)+m*s)*a,(g*(1-s)+r[2*(h*t.width+l)+1]*s)*(1-a)+(y*(1-s)+r[2*(h*t.width+u)+1]*s)*a]}:(e,i)=>{const n=Math.round(e),o=Math.round(i);return n<0||n>=t.width||o<0||o>=t.height?[0,0]:[r[2*(o*t.width+n)+0],r[2*(o*t.width+n)+1]]}}(e,t),l=performance.now(),u=f(e,s,t.width,t.height),h=performance.now(),c=function(e,t){const r=new o.Z,i=e.reduce(((e,t)=>e+t.length),0),n=new Float32Array(3*i),a=new Array(e.length);let s=0,l=0;for(const t of e){const e=s;for(const e of t)n[3*s+0]=e.x,n[3*s+1]=e.y,n[3*s+2]=e.t,s++;a[l++]={startVertex:e,numberOfVertices:t.length,totalTime:t[t.length-1].t,timeSeed:r.getFloat()}}return{lineVertices:n,lineDescriptors:a}}(u),d=performance.now(),p=function(e,t=10){const{lineVertices:r,lineDescriptors:i}=e;let n=0,o=0;for(const e of i)n+=2*e.numberOfVertices,o+=6*(e.numberOfVertices-1);const a=new Float32Array(8*n),s=new Uint32Array(o);let l=0,f=0;function u(){s[f++]=l-2,s[f++]=l,s[f++]=l-1,s[f++]=l,s[f++]=l+1,s[f++]=l-1}function h(e,t,r,i,n,o,s){const f=8*l;let u=0;a[f+u++]=e,a[f+u++]=t,a[f+u++]=1,a[f+u++]=r,a[f+u++]=o,a[f+u++]=s,a[f+u++]=i,a[f+u++]=n,l++,a[f+u++]=e,a[f+u++]=t,a[f+u++]=-1,a[f+u++]=r,a[f+u++]=o,a[f+u++]=s,a[f+u++]=-i,a[f+u++]=-n,l++}for(const e of i){const{totalTime:i,timeSeed:n}=e;let o=null,a=null,s=null,l=null,f=null;for(let c=0;c<e.numberOfVertices;c++){const d=r[3*(e.startVertex+c)+0],p=r[3*(e.startVertex+c)+1],m=r[3*(e.startVertex+c)+2];let g=null,y=null,w=null,x=null;if(c>0){g=d-o,y=p-a;const e=Math.sqrt(g*g+y*y);if(g/=e,y/=e,c>1){let e=g+l,r=y+f;const i=Math.sqrt(e*e+r*r);e/=i,r/=i;const n=Math.min(1/(e*g+r*y),t);e*=n,r*=n,w=-r,x=e}else w=-y,x=g;null!==w&&null!==x&&(h(o,a,s,w,x,i,n),u())}o=d,a=p,s=m,l=g,f=y}h(o,a,s,-f,l,i,n)}return{vertexData:a,indexData:s}}(c),m=performance.now();if(e.profile){const e={"_createFlowFieldFromData()":Math.round(l-i),"_getStreamlines()":Math.round(h-l),"createAnimatedLinesData()":Math.round(d-h),"createLinesMesh()":Math.round(m-d),"Total elapsed time":Math.round(m-i)};a.info("createStreamlinesMesh profile",e)}return await Promise.resolve(),(0,n.k_)(r),p}function l(e,t,r,i,n,o,a,s,l){const f=[];let u,h,c=r,d=i,p=0;f.push({x:c,y:d,t:p});for(let r=0;r<e.verticesPerLine;r++){let[r,i]=t(c,d);r*=e.velocityScale,i*=e.velocityScale;const m=Math.sqrt(r*r+i*i);if(m<e.minSpeedThreshold)return f;const g=r/m,y=i/m;if(c+=g*e.segmentLength,d+=y*e.segmentLength,p+=e.segmentLength/m,Math.acos(g*u+y*h)>e.maxTurnAngle)return f;if(e.mergeLines){const e=Math.round(c*l),t=Math.round(d*l);if(e<0||e>a-1||t<0||t>s-1)return f;const r=o[t*a+e];if(-1!==r&&r!==n)return f;o[t*a+e]=n}f.push({x:c,y:d,t:p}),u=g,h=y}return f}function f(e,t,r,i){const n=[],a=new o.Z,s=1/Math.max(e.lineCollisionWidth,1),f=Math.round(r*s),u=Math.round(i*s),h=new Int32Array(f*u);for(let e=0;e<h.length;e++)h[e]=-1;const c=[];for(let t=0;t<i;t+=e.lineSpacing)for(let i=0;i<r;i+=e.lineSpacing)c.push({x:i,y:t,sort:a.getFloat()});c.sort(((e,t)=>e.sort-t.sort));for(const{x:r,y:i}of c)if(a.getFloat()<e.density){const o=l(e,t,r,i,n.length,h,f,u,s);if(o.length<2)continue;n.push(o)}return n}}}]);