@arcgis/core 6.0.0-next.30 → 6.0.0-next.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/00d1c99779bd91b1d10e.js +1 -0
- package/assets/esri/core/workers/chunks/0694c7bcfe71692e2ccf.js +1 -0
- package/assets/esri/core/workers/chunks/{e2c6cd8dac01e129ccfe.js → 0e445ec3523de9f2dfa2.js} +1 -1
- package/assets/esri/core/workers/chunks/0f6c0d42100c21367e5c.js +1 -0
- package/assets/esri/core/workers/chunks/16cda273927ab0a39544.js +1 -0
- package/assets/esri/core/workers/chunks/1a3f71c4d97c36050030.js +1 -0
- package/assets/esri/core/workers/chunks/{0b4481b57a611b15f65c.js → 1eaf8bfdd3765a90ccc2.js} +1 -1
- package/assets/esri/core/workers/chunks/{8ca2bb3c0551bb1898b6.js → 3fdcc383bbd9cf0d274c.js} +1 -1
- package/assets/esri/core/workers/chunks/{fefdd10bdd5a4c8d8ed0.js → 4741fac6b6b4202a97c5.js} +1 -1
- package/assets/esri/core/workers/chunks/{ad21757d78e372fa2ed6.js → 4a979fce1c971b614a18.js} +1 -1
- package/assets/esri/core/workers/chunks/4d8833f48348cbbcc947.js +1 -0
- package/assets/esri/core/workers/chunks/{865cebc5c982c040ab6f.js → 55a9eaeb152a3abada67.js} +1 -1
- package/assets/esri/core/workers/chunks/572aec57593a08b8045b.js +1 -0
- package/assets/esri/core/workers/chunks/6029773458ab98600f67.js +1 -0
- package/assets/esri/core/workers/chunks/6b5c073dddd89d06ed80.js +1 -0
- package/assets/esri/core/workers/chunks/7cc9d7a88b64e25fce14.js +1 -0
- package/assets/esri/core/workers/chunks/7e211d8a8ad6c6a7cf3e.js +1 -0
- package/assets/esri/core/workers/chunks/{64b360625c68cb863a08.js → 84940d8e14caf5a27e04.js} +1 -1
- package/assets/esri/core/workers/chunks/{c90388932a7825d9d933.js → 85de980c5b296ec69323.js} +1 -1
- package/assets/esri/core/workers/chunks/89dc49e784f7ba3b93ea.js +1 -0
- package/assets/esri/core/workers/chunks/{9d40786c5ceface786ba.js → 8a485130781b49dbf608.js} +1 -1
- package/assets/esri/core/workers/chunks/8d13f11d0bcc8d3a4bdf.js +1 -0
- package/assets/esri/core/workers/chunks/8da2a10318f49d0dc73a.js +1 -0
- package/assets/esri/core/workers/chunks/8e6276ddd8d094c61f08.js +1 -0
- package/assets/esri/core/workers/chunks/{1dc6f093028530a492e6.js → 90ba0af9690dc32b2958.js} +1 -1
- package/assets/esri/core/workers/chunks/{71f792a20077aa739f87.js → a607541959169741a943.js} +1 -1
- package/assets/esri/core/workers/chunks/b2d6b1ac9fbb50c7c8ab.js +1 -0
- package/assets/esri/core/workers/chunks/b657363113f4a37e634b.js +1 -0
- package/assets/esri/core/workers/chunks/b9cb92858a576eb6aa06.js +1 -0
- package/assets/esri/core/workers/chunks/{4419732baf3459a80e6d.js → ceb2d5b0a23f0ab81f68.js} +1 -1
- package/assets/esri/core/workers/chunks/{7030a4d0714a35995a58.js → d09d8cd43e846d467827.js} +1 -1
- package/assets/esri/core/workers/chunks/{12b84262dedc6b393136.js → d9a240a3c6bf85124474.js} +1 -1
- package/assets/esri/core/workers/chunks/{8f008eedb11685ee2048.js → e096c1d9d53af74d3207.js} +1 -1
- package/assets/esri/core/workers/chunks/e30fdde253e5521473a2.js +1 -0
- package/assets/esri/core/workers/chunks/e4e2edfdc85dd14e66d4.js +1 -0
- package/assets/esri/core/workers/chunks/{ba4520ddcb6a49988da6.js → f21edbfdcab111d8a6cd.js} +1 -1
- package/assets/esri/core/workers/chunks/f4d91d470ca5fea0bd26.js +1 -0
- package/assets/esri/core/workers/chunks/f717005e14a7e9141df7.js +1 -0
- package/assets/esri/core/workers/chunks/f75eec2cbc541eec9712.js +1 -0
- package/assets/esri/core/workers/chunks/{b5eff28cf482d920b9ea.js → f7fb6cb7f08c16384443.js} +1 -1
- package/assets/esri/core/workers/chunks/fcc3902d6d9eda6f09f5.js +1 -0
- package/assets/esri/core/workers/chunks/{28a821de9dbf10324033.js → fd031150d3a7f896e6b3.js} +1 -1
- package/assets/esri/core/workers/chunks/{cc97e4fd0dacad970a23.js → ffaaa388773e60869df0.js} +1 -1
- package/config.js +1 -1
- package/core/scheduling.js +1 -1
- package/geometry/Mesh.d.ts +2 -125
- package/geometry/Mesh.js +1 -1
- package/geometry/support/meshErrors.js +1 -1
- package/geometry/support/plane.js +1 -1
- package/geometry/support/polygonUtils.js +1 -1
- package/interfaces.d.ts +0 -3
- package/kernel.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/raster/functions/rasterProjectionHelper.js +1 -1
- package/layers/support/featureLayerUtils.js +1 -1
- package/package.json +2 -2
- package/support/arcadeUtils.js +1 -1
- package/views/2d/engine/webgl/SpriteMosaic.js +1 -1
- package/views/2d/layers/ImageryLayerView2D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightConfiguration.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightEditTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightManipulators.js +1 -1
- package/views/3d/environment/SunLighting.d.ts +10 -8
- package/views/3d/environment/VirtualLighting.d.ts +10 -8
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/support/renderInfoUtils/polygon.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/PlanarPatch.js +1 -1
- package/views/3d/terrain/SphericalPatch.js +1 -1
- package/views/3d/webgl-engine/lib/Path.js +1 -1
- package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
- package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
- package/views/support/TextureCompressionWorker.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/webscene/Environment.d.ts +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
- package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/assets/esri/core/workers/chunks/02335385b1476fe322eb.js +0 -1
- package/assets/esri/core/workers/chunks/07b726a46864501b90a0.js +0 -1
- package/assets/esri/core/workers/chunks/189321d88026bd7e6d3e.js +0 -1
- package/assets/esri/core/workers/chunks/18d47ab571b613fbe719.js +0 -1
- package/assets/esri/core/workers/chunks/1967b9c96045a5802d08.js +0 -1
- package/assets/esri/core/workers/chunks/199a7f97916679e0257c.js +0 -1
- package/assets/esri/core/workers/chunks/1d96fbad881a7d14a950.js +0 -1
- package/assets/esri/core/workers/chunks/2cd60fd062d954322c1f.js +0 -1
- package/assets/esri/core/workers/chunks/2d3e0e4442dbc6ec6def.js +0 -1
- package/assets/esri/core/workers/chunks/2f5d014d6a72108b0b3a.js +0 -1
- package/assets/esri/core/workers/chunks/3105336a05f38a95ebea.js +0 -1
- package/assets/esri/core/workers/chunks/4fb2fcc95f852bf8f86c.js +0 -1
- package/assets/esri/core/workers/chunks/59bc55880e6fd8ce20c0.js +0 -1
- package/assets/esri/core/workers/chunks/5f787809b74eed7b9a91.js +0 -1
- package/assets/esri/core/workers/chunks/6a7de221cea4426cb490.js +0 -1
- package/assets/esri/core/workers/chunks/7a0b4dc0cda190367a39.js +0 -1
- package/assets/esri/core/workers/chunks/7d3f7940815fa5dc244e.js +0 -1
- package/assets/esri/core/workers/chunks/999c23da883eb11cb29e.js +0 -1
- package/assets/esri/core/workers/chunks/9bc3afe7013ef4ae737b.js +0 -1
- package/assets/esri/core/workers/chunks/bab1d010970d98c25470.js +0 -1
- package/assets/esri/core/workers/chunks/c4f78a481f43cfae7b63.js +0 -1
- package/assets/esri/core/workers/chunks/dcf6024dc19428ff2b9d.js +0 -1
- package/assets/esri/core/workers/chunks/ee0dc906cc7979080329.js +0 -1
- package/assets/esri/core/workers/chunks/f0d0ed155275c2e6d3da.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1969],{83349(t,e,n){n.d(e,{e:()=>l});const r=new Set;let i=!1;function l(t,e,n=2){let i=e&&e.length,l=i?e[0]*n:t.length;r.size&&r.clear();let s=x(t,0,l,n,!0),y=[];if(!s||s.next===s.prev)return y;let a=0,u=0,h=0;if(i&&(s=c(t,e,s,n)),t.length>80*n){a=t[0],u=t[1];let e=a,r=u;for(let i=n;i<l;i+=n){let n=t[i],l=t[i+1];n<a&&(a=n),l<u&&(u=l),n>e&&(e=n),l>r&&(r=l)}h=Math.max(e-a,r-u),h=0===h?0:32767/h}return o(s,y,a,u,h),y}function x(t,e,n,r,i){let l=null;if(i===D(t,e,n,r)>0)for(let i=e;i<n;i+=r)l=Y(i/r|0,t[i],t[i+1],l);else for(let i=n-r;i>=e;i-=r)l=Y(i/r|0,t[i],t[i+1],l);return l&&U(l,l.next)&&(O(l),l=l.next),l}function s(t,e=t){let n,l=e===t,x=t;do{n=!1,x===x.next||0!==r.size&&r.has(x)||!U(x,x.next)&&0!==V(x.prev,x,x.next)?(l||x!==e)&&(x=x.next,n=!l):((l||x===e)&&(e=x.prev),i=!0,O(x),x=x.prev,n=!0)}while(n||x!==e);return e}function o(t,e,n,r,l){l&&function(t,e,n,r){let i=t,l=0;do{i.z=k(i.x,i.y,e,n,r),A[l++]=i,i=i.next}while(i!==t);!function(t){if(t<=32)for(let e=1;e<t;e++){let t=A[e],n=t.z,r=e-1;for(;r>=0&&A[r].z>n;)A[r+1]=A[r],r--;A[r+1]=t}else{C.length<t&&(C=new Uint32Array(t),S=new Uint32Array(t),T=Array(t));for(let e=0;e<t;e++)C[e]=A[e].z;P(t,A,C,T,S,0),P(t,T,S,A,C,8),P(t,A,C,T,S,16),P(t,T,S,A,C,24)}}(l);let x=null;for(let t=0;t<l;t++){let e=A[t];e.prevZ=x,x&&(x.nextZ=e),x=e}x.nextZ=null,A.fill(null,0,l),T.fill(null,0,l)}(t,n,r,l);let x=t,o=!1;for(;t.prev!==t.next;){let f=t.prev,c=t.next;if(V(f,t,c)<0&&(l?a(t,n,r,l):y(t)))e.push(f.i,t.i,c.i),O(t),t=c,x=c;else if((t=c)===x){if(i=!1,t=s(t),i){x=t;continue}if(!o){x=t=u(t,e),o=!0;continue}h(t,e,n,r,l);break}}}function y(t){let e=t.prev,n=t,r=t.next,i=e.x,l=n.x,x=r.x,s=e.y,o=n.y,y=r.y,a=Math.min(i,l,x),u=Math.min(s,o,y),h=Math.max(i,l,x),f=Math.max(s,o,y),c=r.next;for(;c!==e;){if(c.x>=a&&c.x<=h&&c.y>=u&&c.y<=f&&(i!==c.x||s!==c.y)&&L(i,s,l,o,x,y,c.x,c.y)&&V(c.prev,c,c.next)>=0)return!1;c=c.next}return!0}function a(t,e,n,r){let i=t.prev,l=t,x=t.next,s=i.x,o=l.x,y=x.x,a=i.y,u=l.y,h=x.y,f=Math.min(s,o,y),c=Math.min(a,u,h),d=Math.max(s,o,y),_=Math.max(a,u,h),p=k(f,c,e,n,r),v=k(d,_,e,n,r),w=t.prevZ;for(;w&&w.z>=p;){if(w.x>=f&&w.x<=d&&w.y>=c&&w.y<=_&&w!==x&&(s!==w.x||a!==w.y)&&L(s,a,o,u,y,h,w.x,w.y)&&V(w.prev,w,w.next)>=0)return!1;w=w.prevZ}let g=t.nextZ;for(;g&&g.z<=v;){if(g.x>=f&&g.x<=d&&g.y>=c&&g.y<=_&&g!==x&&(s!==g.x||a!==g.y)&&L(s,a,o,u,y,h,g.x,g.y)&&V(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function u(t,e){let n=t,r=!1;do{let i=n.prev,l=n.next.next;z(i,n,n.next,l,!1)&&Z(i,l)&&Z(l,i)&&(e.push(i.i,n.i,l.i),O(n),O(n.next),n=t=l,r=!0),n=n.next}while(n!==t);return r?s(n):n}function h(t,e,n,r,i){let l=t;do{let t=l.next.next;for(;t!==l.prev;){if(l.i!==t.i&&R(l,t)){let x=F(l,t);return l=s(l,l.next),x=s(x,x.next),o(l,e,n,r,i),void o(x,e,n,r,i)}t=t.next}l=l.next}while(l!==t)}let f=!1;function c(t,e,n,i){let l=[];for(let n=0,s=e.length;n<s;n++){let o=x(t,e[n]*i,n<s-1?e[n+1]*i:t.length,i,!1);o===o.next&&r.add(o),l.push(I(o))}l.sort(d),function(t,e){let n=Math.ceil((t+2*e)/16)+e+2;p.length<4*n&&(p=new Float64Array(4*n)),v=0}(t.length/i,e.length),m(n,n),f=!0;for(let t=0;t<l.length;t++)n=_(l[t],n);return f=!1,s(n)}function d(t,e){return t.x-e.x||t.y-e.y||(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)}function _(t,e){let n=function(t,e){let n,r=e,i=t.x,l=t.y,x=-1/0;if(U(t,r))return r;for(let e=0,s=0;e<v;e++,s+=4){if(l<p[s+1]||l>p[s+3]||p[s]>i||p[s+2]<=x)continue;let o=E(e);r=b(e);do{if(r.prev.next===r){if(U(t,r.next))return r.next;if(l<=r.y&&l>=r.next.y&&r.next.y!==r.y){let t=r.x+(l-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(t<=i&&t>x&&(x=t,n=r.x<r.next.x?r:r.next,t===i))return n}}r=r.next}while(r!==o)}if(!n)return null;let s=n.x,o=n.y,y=Math.min(l,o),a=Math.max(l,o),u=1/0;for(let e=0,h=0;e<v;e++,h+=4){if(p[h+2]<s||p[h]>i||p[h+3]<y||p[h+1]>a)continue;let f=E(e);r=b(e);do{if(r.prev.next===r&&i>=r.x&&r.x>=s&&i!==r.x&&L(l<o?i:x,l,s,o,l<o?x:i,l,r.x,r.y)){let e=Math.abs(l-r.y)/(i-r.x);(Z(r,t)||r.y===l&&r.next.y===l&&r.next.x>i)&&(e<u||e===u&&(r.x>n.x||r.x===n.x&&M(n,r)))&&(n=r,u=e)}r=r.next}while(r!==f)}return n}(t,e);if(!n)return e;let r=F(n,t);return m(n,r.next.next),s(r,r.next),s(n,n.next)}let p=new Float64Array,v=0;const w=[],g=[];function m(t,e){let n=t;do{let t=v++;w[t]=n;let r=1/0,i=1/0,l=-1/0,x=-1/0,s=0;do{let e=n.next;n.z=t,n.x<r&&(r=n.x),n.x>l&&(l=n.x),n.y<i&&(i=n.y),n.y>x&&(x=n.y),e.x<r&&(r=e.x),e.x>l&&(l=e.x),e.y<i&&(i=e.y),e.y>x&&(x=e.y),n=e}while(++s<16&&n!==e);g[t]=n;let o=4*t;p[o]=r,p[o+1]=i,p[o+2]=l,p[o+3]=x}while(n!==e)}function E(t){let e=g[t];for(;e.prev.next!==e;)e=e.next;return g[t]=e,e}function b(t){let e=w[t];for(;e.prev.next!==e;)e=e.next;return w[t]=e,e}function M(t,e){return V(t.prev,t,e.prev)<0&&V(e.next,t,t.next)<0}const A=[];let T=[],C=new Uint32Array,S=new Uint32Array;const N=new Uint32Array(256);function P(t,e,n,r,i,l){N.fill(0);for(let e=0;e<t;e++)N[n[e]>>>l&255]++;let x=0;for(let t=0;t<256;t++){let e=N[t];N[t]=x,x+=e}for(let x=0;x<t;x++){let t=n[x],s=N[t>>>l&255]++;r[s]=e[x],i[s]=t}}function k(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function I(t){let e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function L(t,e,n,r,i,l,x,s){return(i-x)*(e-s)>=(t-x)*(l-s)&&(t-x)*(r-s)>=(n-x)*(e-s)&&(n-x)*(l-s)>=(i-x)*(r-s)}function R(t,e){let n=U(t,e)&&V(t.prev,t,t.next)>0&&V(e.prev,e,e.next)>0;return t.next.i!==e.i&&(n||Z(t,e)&&Z(e,t)&&(0!==V(t.prev,t,e.prev)||0!==V(t,e.prev,e)))&&!function(t,e){let n=Math.min(t.x,e.x),r=Math.max(t.x,e.x),i=Math.min(t.y,e.y),l=Math.max(t.y,e.y),x=t;do{let s=x.next;if(x.x>r&&s.x>r||x.x<n&&s.x<n||x.y>l&&s.y>l||x.y<i&&s.y<i)x=s;else{if(x.i!==t.i&&s.i!==t.i&&x.i!==e.i&&s.i!==e.i&&z(x,s,t,e))return!0;x=s}}while(x!==t);return!1}(t,e)&&(n||function(t,e){let n=t,r=!1,i=(t.x+e.x)/2,l=(t.y+e.y)/2;do{let t=n.next;n.y>l!=t.y>l&&i<(t.x-n.x)*(l-n.y)/(t.y-n.y)+n.x&&(r=!r),n=t}while(n!==t);return r}(t,e))}function V(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function U(t,e){return t.x===e.x&&t.y===e.y}function z(t,e,n,r,i=!0){let l=V(t,e,n),x=V(t,e,r),s=V(n,r,t),o=V(n,r,e);return(l>0&&x<0||l<0&&x>0)&&(s>0&&o<0||s<0&&o>0)||!!i&&!!(0===l&&B(t,n,e)||0===x&&B(t,r,e)||0===s&&B(n,t,r)||0===o&&B(n,e,r))}function B(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Z(t,e){return V(t.prev,t,t.next)<0?V(t,e,t.next)>=0&&V(t,t.prev,e)>=0:V(t,e,t.prev)<0||V(t,t.next,e)<0}function F(t,e){let n=j(t.i,t.x,t.y),r=j(e.i,e.x,e.y),i=t.next,l=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,l.next=r,r.prev=l,r}function Y(t,e,n,r){let i=j(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function O(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ),f&&function(t,e){let n=4*t.z;e.x<p[n]&&(p[n]=e.x),e.y<p[n+1]&&(p[n+1]=e.y),e.x>p[n+2]&&(p[n+2]=e.x),e.y>p[n+3]&&(p[n+3]=e.y)}(t.prev,t.next)}function j(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function D(t,e,n,r){let i=0;for(let l=e,x=n-r;l<n;l+=r)i+=(t[x]-t[l])*(t[l+1]+t[x+1]),x=l;return i}let H,W,$,q,X,Q=0,G=0;function J(t,e,n,r,i,l){return(n-t)*(l-e)-(r-e)*(i-t)}function K(t,e,n,r,i,l,x,s){let o=t-x,y=e-s,a=n-x,u=r-s,h=i-x,f=l-s,c=o*o+y*y,d=a*a+u*u,_=h*h+f*f,p=c+d+_;return o*(u*_-d*f)-y*(a*_-d*h)+c*(a*f-u*h)<=1e-13*p*p}function tt(t){return t-t%3+(t+1)%3}l.deviation=function(t,e,n,r){let i=e&&e.length,l=i?e[0]*n:t.length,x=Math.abs(D(t,0,l,n));if(i)for(let r=0,i=e.length;r<i;r++){let l=e[r]*n,s=r<i-1?e[r+1]*n:t.length;x-=Math.abs(D(t,l,s,n))}let s=0;for(let e=0;e<r.length;e+=3){let i=r[e]*n,l=r[e+1]*n,x=r[e+2]*n;s+=Math.abs((t[i]-t[x])*(t[l+1]-t[i+1])-(t[i]-t[l])*(t[x+1]-t[i+1]))}return 0===x&&0===s?0:Math.abs((s-x)/x)},l.flatten=function(t){let e=[],n=[],r=t[0][0].length,i=0,l=0;for(let x of t){for(let t of x)for(let n=0;n<r;n++)e.push(t[n]);l&&(i+=l,n.push(i)),l=x.length}return{vertices:e,holes:n,dimensions:r}},l.refine=function(t,e,n=2){let r=t,i=r.length;if(i<6)return;(function(t){(!H||H.length<t)&&(H=new Int32Array(t)),(!W||W.length<t)&&(W=new Int32Array(t)),(!X||X.length<t)&&(X=new Uint8Array(t));let e=1;for(;e<4*t;)e<<=1;(!$||$.length<e)&&($=new Int32Array(e),q=new Uint32Array(e)),Q=e-1})(i),G++,W.fill(-1,0,i);let l=0;for(let t=0;t<i;t++){let e=r[t],n=r[tt(t)],i=e<n?e:n,x=e<n?n:e,s=(Math.imul(i,2654435761)^Math.imul(x,2246822507))&Q;for(;q[s]===G;){let e=$[s];if(-1!==e){let n=r[e],o=r[tt(e)];if(n===i&&o===x||n===x&&o===i){W[t]=e,W[e]=t,$[s]=-1,X[e]=1,H[l++]=e;break}}s=s+1&Q}q[s]!==G&&($[s]=t,q[s]=G)}for(;l>0;){let t=H[--l];X[t]=0;let i=W[t];if(-1===i)continue;let x=t-t%3,s=i-i%3,o=x+(t+2)%3,y=x+(t+1)%3,a=s+(i+2)%3,u=s+(i+1)%3,h=r[o],f=r[t],c=r[y],d=r[a],_=e[h*n],p=e[h*n+1],v=e[f*n],w=e[f*n+1],g=e[c*n],m=e[c*n+1],E=e[d*n],b=e[d*n+1];if(!K(_,p,v,w,g,m,E,b)&&J(_,p,v,w,E,b)>0&&J(_,p,E,b,g,m)>0){r[t]=d,r[i]=h;let e=W[a],n=W[o];W[t]=e,-1!==e&&(W[e]=t),W[i]=n,-1!==n&&(W[n]=i),W[o]=a,W[a]=o,-1!==e&&0===X[t]&&(X[t]=1,H[l++]=t),-1!==n&&0===X[i]&&(X[i]=1,H[l++]=i),-1!==W[y]&&0===X[y]&&(X[y]=1,H[l++]=y),-1!==W[u]&&0===X[u]&&(X[u]=1,H[l++]=u)}}}},15585(t,e,n){n.d(e,{If:()=>f,O5:()=>p,O9:()=>d,QT:()=>_,l3:()=>c});var r=n(32198),i=n(2741),l=n(49186),x=n(44208),s=n(34727);let o=null,y=null,a=null,u=null;const h=(new Float32Array,new Uint32Array,new Uint32Array,new Uint32Array,{vertices:new Float64Array,indices:new Uint32Array,outlineIndices:new Uint32Array,outlineRingLengths:new Uint32Array,vertexCount:0,indexCount:0,outlineIndexCount:0,outlineRingCount:0});async function f(){return o??=async function(){a=await(await n.e(2997).then(()=>n(42997))).default({locateFile:t=>(0,i.s)(`esri/core/libs/libtess/${t}`)})}(),o}async function c(){return y??=async function(){u=await(await n.e(9134).then(()=>n(99134))).default({locateFile:t=>(0,i.s)(`esri/core/libs/libtess/${t}`)})}(),y}function d(){return null!==u}function _(t,e,n=2){let i={stack:[],error:void 0,hasError:!1};try{let s=a;if(!s)throw new l.A("libtess:not-loaded","libtessF32 not loaded");let o=(0,r.mS)(i,m.from(s,t),!1),y=(0,r.mS)(i,b.from(s,e),!1),u=t.length/n*4,h=(0,r.mS)(i,new m(s,u*n),!1),f=s.triangulate(o.ptr,y.ptr,y.size,n,h.ptr,u);if((0,x.A)("esri-tessellation-debug")){let t=s.getError();0!==t&&console.warn("libtess:triangulation",M(t))}return{buffer:h.slice(0,f*n),vertexCount:f}}catch(t){i.error=t,i.hasError=!0}finally{(0,r.hk)(i)}}function p(t,e,n=2,i=!0){let o={stack:[],error:void 0,hasError:!1};try{let y=u;if(!y)throw new l.A("libtess:not-loaded","libtessF64 not loaded");let a=(0,r.mS)(o,E.from(y,t),!1),f=(0,r.mS)(o,b.from(y,e),!1),c=(0,r.mS)(o,new b(y,1),!1),d=(0,r.mS)(o,new b(y,1),!1),_=(0,r.mS)(o,new b(y,1),!1),p=(0,r.mS)(o,new b(y,1),!1),{maxVertexCount:v,maxIndexCount:w,maxOutlineIndexCount:m,maxOutlineRingCount:A}=function(t,e){let n=t.reduce((t,e)=>t+e,0),r=t.length,i=Math.max(0,t.length-1),l=Math.max(0,n+2*i-2),x=Math.max(0,Math.ceil(2*n)),o=Math.max(0,Math.ceil(3*l*2)),y=(0,s.mP)(o,3),a=n>0?Math.max(2,Math.ceil(.25*n)):0,u=n>0?Math.max(1,Math.ceil(a/3)):0;return{maxVertexCount:x,maxIndexCount:y,maxOutlineIndexCount:e?Math.max(0,n+r+a):0,maxOutlineRingCount:e?Math.max(0,r+u):0}}(e,i),T=0,C=0,S=0,N=0,P=0;{let t={stack:[],error:void 0,hasError:!1};try{let e=(0,r.mS)(t,new E(y,v*n),!1),l=(0,r.mS)(t,new b(y,w),!1),x=(0,r.mS)(t,i?new b(y,m):null,!1),s=(0,r.mS)(t,i?new b(y,A):null,!1);if(y.triangulateIndexed(a.ptr,f.ptr,f.size,n,e.ptr,v,n,l.ptr,w,c.ptr,d.ptr,x?.ptr??0,m,s?.ptr??0,A,_.ptr,p.ptr),P=y.getError(),T=g(y)[c.ptr/Int32Array.BYTES_PER_ELEMENT],C=g(y)[d.ptr/Int32Array.BYTES_PER_ELEMENT],S=g(y)[_.ptr/Int32Array.BYTES_PER_ELEMENT],N=g(y)[p.ptr/Int32Array.BYTES_PER_ELEMENT],0===P)return{vertices:e.slice(0,T*n),indices:l.slice(0,C),outlineIndices:i&&x?x.slice(0,S):h.outlineIndices,outlineRingLengths:i&&s?s.slice(0,N):h.outlineRingLengths,vertexCount:T,indexCount:C,outlineIndexCount:i?S:0,outlineRingCount:i?N:0}}catch(e){t.error=e,t.hasError=!0}finally{(0,r.hk)(t)}}if(100903!==P)return(0,x.A)("esri-tessellation-debug")&&console.warn("libtess:triangulation",M(P)),h;let k=(0,r.mS)(o,new E(y,T*n),!1),I=(0,r.mS)(o,new b(y,C),!1),L=(0,r.mS)(o,i?new b(y,S):null,!1),R=(0,r.mS)(o,i?new b(y,N):null,!1);if(y.triangulateIndexed(a.ptr,f.ptr,f.size,n,k.ptr,T,n,I.ptr,C,c.ptr,d.ptr,L?.ptr??0,i?S:0,R?.ptr??0,i?N:0,_.ptr,p.ptr),P=y.getError(),0!==P)return(0,x.A)("esri-tessellation-debug")&&console.warn("libtess:triangulation",M(P)),h;let V=g(y)[c.ptr/Int32Array.BYTES_PER_ELEMENT],U=g(y)[d.ptr/Int32Array.BYTES_PER_ELEMENT],z=g(y)[_.ptr/Int32Array.BYTES_PER_ELEMENT],B=g(y)[p.ptr/Int32Array.BYTES_PER_ELEMENT];return{vertices:k.slice(0,V*n),indices:I.slice(0,U),outlineIndices:i&&L?L.slice(0,z):h.outlineIndices,outlineRingLengths:i&&R?R.slice(0,B):h.outlineRingLengths,vertexCount:V,indexCount:U,outlineIndexCount:i?z:0,outlineRingCount:i?B:0}}catch(t){o.error=t,o.hasError=!0}finally{(0,r.hk)(o)}}function v(t){return t.HEAPF64}function w(t){return t.HEAPF32}function g(t){return t.HEAP32}class m{static from(t,e){let n=new m(t,e.length);return n.set(e),n}constructor(t,e){this._libtess=t,this.size=e,this.ptr=t.allocateCoordinateArray(e)}destroy(){this._libtess.destroyCoordinateArray(this.ptr)}[Symbol.dispose](){this.destroy()}get bytesPerCoordinate(){return Float32Array.BYTES_PER_ELEMENT}set(t){w(this._libtess).set(t,this.ptr/this.bytesPerCoordinate)}slice(t,e){let n=this.ptr/this.bytesPerCoordinate;return w(this._libtess).slice(n+t,n+e)}}class E{static from(t,e){let n=new E(t,e.length);return n.set(e),n}constructor(t,e){this._libtess=t,this.size=e,this.ptr=t.allocateCoordinateArray(e)}destroy(){this._libtess.destroyCoordinateArray(this.ptr)}[Symbol.dispose](){this.destroy()}get bytesPerCoordinate(){return Float64Array.BYTES_PER_ELEMENT}set(t){v(this._libtess).set(t,this.ptr/this.bytesPerCoordinate)}slice(t,e){let n=this.ptr/this.bytesPerCoordinate;return v(this._libtess).slice(n+t,n+e)}}class b{static from(t,e){let n=new b(t,e.length);return n.set(e),n}constructor(t,e){this._libtess=t,this.size=e,this.ptr=t.allocateLengthsArray(e)}destroy(){this._libtess.destroyLengthsArray(this.ptr)}[Symbol.dispose](){this.destroy()}get bytesPerCoordinate(){return Int32Array.BYTES_PER_ELEMENT}set(t){g(this._libtess).set(t,this.ptr/this.bytesPerCoordinate)}slice(t,e){let n=this.ptr/this.bytesPerCoordinate;return function(t){let e=g(t);return new Uint32Array(e.buffer,e.byteOffset,e.length)}(this._libtess).slice(n+t,n+e)}}function M(t){switch(t){case 100903:return"Insufficient output buffer";case 100902:return"Out of memory";case 100151:return"Missing begin polygon";case 100152:return"Missing begin contour";case 100153:return"Missing end polygon";case 100154:return"Missing end countour";case 100155:return"Coordinates too large";case 100156:return"Missing combine callback";default:return`Unknown: ${t}`}}},83773(t,e,n){function r(t,e){return t.x===e.x&&t.y===e.y}function i(t){if(!t)return;let e=t.length;if(e<=1)return;let n=0;for(let i=1;i<e;i++)!r(t[i],t[n])&&++n!==i&&(t[n]=t[i]);t.length=n+1}function l(t,e){return t.x=e.y,t.y=-e.x,t}function x(t,e){return t.x=-e.y,t.y=e.x,t}function s(t,e){return t.x=e.x,t.y=e.y,t}function o(t,e){return t.x=-e.x,t.y=-e.y,t}function y(t){return Math.sqrt(t.x*t.x+t.y*t.y)}function a(t,e){return t.x*e.y-t.y*e.x}function u(t,e){return t.x*e.x+t.y*e.y}function h(t,e,n,r){return t.x=e.x*n+e.y*r,t.y=e.x*r-e.y*n,t}n.d(e,{i:()=>f});class f{constructor(t,e,n){this._writeVertex=t,this._writeTriangle=e,this._canUseThinTessellation=n,this._prevNormal={x:void 0,y:void 0},this._nextNormal={x:void 0,y:void 0},this._textureNormalLeft={x:0,y:1},this._textureNormalRight={x:0,y:-1},this._textureNormal={x:void 0,y:void 0},this._joinNormal={x:void 0,y:void 0},this._inner={x:void 0,y:void 0},this._outer={x:void 0,y:void 0},this._roundStart={x:void 0,y:void 0},this._roundEnd={x:void 0,y:void 0},this._startBreak={x:void 0,y:void 0},this._endBreak={x:void 0,y:void 0},this._innerPrev={x:void 0,y:void 0},this._innerNext={x:void 0,y:void 0},this._bevelStart={x:void 0,y:void 0},this._bevelEnd={x:void 0,y:void 0},this._bevelMiddle={x:void 0,y:void 0}}tessellate(t,e,n=this._canUseThinTessellation){i(t),n&&e.halfWidth<1.05&&!e.offset?this._tessellateThin(t,e):this._tessellate(t,e)}_tessellateThin(t,e){if(t.length<2)return;let n=e.wrapDistance||65535,r=e.initialDistance||0,i=!1,l=t[0].x,x=t[0].y,s=t.length;for(let e=1;e<s;++e){i&&(i=!1,r=0);let s=t[e].x,o=t[e].y,y=s-l,a=o-x,u=Math.sqrt(y*y+a*a);if(y/=u,a/=u,r+u>n){i=!0;let t=(n-r)/u;u=n-r,s=(1-t)*l+t*s,o=(1-t)*x+t*o,--e}let h=this._writeVertex(l,x,0,0,y,a,a,-y,0,-1,r),f=this._writeVertex(l,x,0,0,y,a,-a,y,0,1,r);r+=u;let c=this._writeVertex(s,o,0,0,y,a,a,-y,0,-1,r),d=this._writeVertex(s,o,0,0,y,a,-a,y,0,1,r);this._writeTriangle(h,f,c),this._writeTriangle(f,c,d),l=s,x=o}}_tessellate(t,e){let n=t[0],i=t[t.length-1],f=r(n,i),c=f?3:2;if(t.length<c)return;let d,_,p,v,w,g=e.pixelCoordRatio,m=null==e.capType?0:e.capType,E=null==e.joinType?2:e.joinType,b=null==e.miterLimit?2:Math.min(e.miterLimit,4),M=null==e.roundLimit?1.05:Math.min(e.roundLimit,1.05),A=null==e.halfWidth?2:e.halfWidth,T=!!e.textured,C=null,S=this._prevNormal,N=this._nextNormal,P=-1,k=-1,I=this._joinNormal,L=this._textureNormalLeft,R=this._textureNormalRight,V=this._textureNormal,U=-1,z=-1,B=e.wrapDistance||65535,Z=e.initialDistance||0,F=this._writeVertex,Y=this._writeTriangle,O=(t,e,n,r,i,l)=>{let x=F(_,p,v,w,n,r,t,e,i,l,Z);return U>=0&&z>=0&&x>=0&&Y(U,z,x),U=z,z=x,x};f&&(d=t[t.length-2],N.x=i.x-d.x,N.y=i.y-d.y,k=y(N),N.x/=k,N.y/=k);let j=!1;for(let e=0;e<t.length;++e){if(j&&(j=!1,Z=0),d&&(S.x=-N.x,S.y=-N.y,P=k,Z+P>B&&(j=!0)),j){let n=(B-Z)/P;P=B-Z,d={x:(1-n)*d.x+n*t[e].x,y:(1-n)*d.y+n*t[e].y},--e}else d=t[e];_=d.x,p=d.y;let n=e<=0&&!j,r=e===t.length-1;if(n||(Z+=P),C=r?f?t[1]:null:t[e+1],C?(N.x=C.x-_,N.y=C.y-p,k=y(N),N.x/=k,N.y/=k):(N.x=void 0,N.y=void 0),!f){if(n){x(I,N),v=I.x,w=I.y,2===m&&(O(-N.y-N.x,N.x-N.y,N.x,N.y,0,-1),O(N.y-N.x,-N.x-N.y,N.x,N.y,0,1)),1===m&&(O(-N.y-N.x,N.x-N.y,N.x,N.y,-1,-1),O(N.y-N.x,-N.x-N.y,N.x,N.y,-1,1)),(1===m||0===m)&&(O(-N.y,N.x,N.x,N.y,0,-1),O(N.y,-N.x,N.x,N.y,0,1));continue}if(r){l(I,S),v=I.x,w=I.y,(1===m||0===m)&&(O(S.y,-S.x,-S.x,-S.y,0,-1),O(-S.y,S.x,-S.x,-S.y,0,1)),2===m&&(O(S.y-S.x,-S.x-S.y,-S.x,-S.y,0,-1),O(-S.y-S.x,S.x-S.y,-S.x,-S.y,0,1)),1===m&&(O(S.y-S.x,-S.x-S.y,-S.x,-S.y,1,-1),O(-S.y-S.x,S.x-S.y,-S.x,-S.y,1,1));continue}}let i,c,F=-a(S,N);if(Math.abs(F)<.01)u(S,N)>0?(I.x=S.x,I.y=S.y,F=1,i=Number.MAX_VALUE,c=!0):(x(I,N),F=1,i=1,c=!1);else{I.x=(S.x+N.x)/F,I.y=(S.y+N.y)/F,i=y(I);let t=(i-1)*A*g;c=i>4||t>P&&t>k}v=I.x,w=I.y;let Y=E;switch(E){case 0:i<1.05&&(Y=2);break;case 1:i<M&&(Y=2);break;case 2:i>b&&(Y=0)}switch(Y){case 2:if(O(I.x,I.y,-S.x,-S.y,0,-1),O(-I.x,-I.y,-S.x,-S.y,0,1),r)break;if(T){let t=j?0:Z;U=this._writeVertex(_,p,v,w,N.x,N.y,I.x,I.y,0,-1,t),z=this._writeVertex(_,p,v,w,N.x,N.y,-I.x,-I.y,0,1,t)}break;case 0:{let t,e,n,i,y=F<0;if(y){let n=U;U=z,z=n,t=L,e=R}else t=R,e=L;if(c)n=y?x(this._innerPrev,S):l(this._innerPrev,S),i=y?l(this._innerNext,N):x(this._innerNext,N);else{let t=y?o(this._inner,I):s(this._inner,I);n=t,i=t}let a=y?l(this._bevelStart,S):x(this._bevelStart,S);O(n.x,n.y,-S.x,-S.y,t.x,t.y);let u=O(a.x,a.y,-S.x,-S.y,e.x,e.y);if(r)break;let f=y?x(this._bevelEnd,N):l(this._bevelEnd,N);if(c){let n=this._writeVertex(_,p,v,w,-S.x,-S.y,0,0,0,0,Z);U=this._writeVertex(_,p,v,w,N.x,N.y,i.x,i.y,t.x,t.y,Z),z=this._writeVertex(_,p,v,w,N.x,N.y,f.x,f.y,e.x,e.y,Z),this._writeTriangle(u,n,z)}else{if(T){let e=this._bevelMiddle;e.x=(a.x+f.x)/2,e.y=(a.y+f.y)/2,h(V,e,-S.x,-S.y),O(e.x,e.y,-S.x,-S.y,V.x,V.y),h(V,e,N.x,N.y),U=this._writeVertex(_,p,v,w,N.x,N.y,e.x,e.y,V.x,V.y,Z),z=this._writeVertex(_,p,v,w,N.x,N.y,i.x,i.y,t.x,t.y,Z)}else{let t=U;U=z,z=t}O(f.x,f.y,N.x,N.y,e.x,e.y)}if(y){let t=U;U=z,z=t}break}case 1:{let t,e,n=F<0;if(n){let n=U;U=z,z=n,t=L,e=R}else t=R,e=L;let y,a,f=n?o(this._inner,I):s(this._inner,I);c?(y=n?x(this._innerPrev,S):l(this._innerPrev,S),a=n?l(this._innerNext,N):x(this._innerNext,N)):(y=f,a=f);let d=n?l(this._roundStart,S):x(this._roundStart,S),g=n?x(this._roundEnd,N):l(this._roundEnd,N),m=O(y.x,y.y,-S.x,-S.y,t.x,t.y),E=O(d.x,d.y,-S.x,-S.y,e.x,e.y);if(r)break;let b=this._writeVertex(_,p,v,w,-S.x,-S.y,0,0,0,0,Z);c||this._writeTriangle(U,z,b);let M,A,C=o(this._outer,f),P=this._writeVertex(_,p,v,w,N.x,N.y,g.x,g.y,e.x,e.y,Z),k=i>2;if(k){let t;i===Number.MAX_VALUE?t=-1:(C.x/=i,C.y/=i,t=u(S,C),t=(i*(t*t-1)+1)/t),M=n?l(this._startBreak,S):x(this._startBreak,S),M.x+=S.x*t,M.y+=S.y*t,A=n?x(this._endBreak,N):l(this._endBreak,N),A.x+=N.x*t,A.y+=N.y*t}h(V,C,-S.x,-S.y);let B=this._writeVertex(_,p,v,w,-S.x,-S.y,C.x,C.y,V.x,V.y,Z);h(V,C,N.x,N.y);let Y=T?this._writeVertex(_,p,v,w,N.x,N.y,C.x,C.y,V.x,V.y,Z):B,j=b,D=T?this._writeVertex(_,p,v,w,N.x,N.y,0,0,0,0,Z):b,H=-1,W=-1;if(k&&(h(V,M,-S.x,-S.y),H=this._writeVertex(_,p,v,w,-S.x,-S.y,M.x,M.y,V.x,V.y,Z),h(V,A,N.x,N.y),W=this._writeVertex(_,p,v,w,N.x,N.y,A.x,A.y,V.x,V.y,Z)),T?k?(this._writeTriangle(j,E,H),this._writeTriangle(j,H,B),this._writeTriangle(D,Y,W),this._writeTriangle(D,W,P)):(this._writeTriangle(j,E,B),this._writeTriangle(D,Y,P)):k?(this._writeTriangle(b,E,H),this._writeTriangle(b,H,W),this._writeTriangle(b,W,P)):(this._writeTriangle(b,E,B),this._writeTriangle(b,Y,P)),c?(U=this._writeVertex(_,p,v,w,N.x,N.y,a.x,a.y,t.x,t.y,Z),z=P):(U=T?this._writeVertex(_,p,v,w,N.x,N.y,a.x,a.y,t.x,t.y,Z):m,this._writeTriangle(U,D,P),z=P),n){let t=U;U=z,z=t}break}}}}}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9235],{34930(e,t,r){r.d(t,{$Q:()=>l,Sd:()=>c,T5:()=>a,b7:()=>h});var n=r(86211),s=r(5443),i=r(86738),o=r(14140);function a(e,t){if(e.spatialReference.equals(t))return e;let r=(0,n.GA)(e.spatialReference),s=(0,n.GA)(t);if(r===s)return e;let i=r/s;return{x:e.x*i,y:e.y*i}}async function l(e,t,n,s){if("extent"===n.type)return function(e,t,r){let{width:n,height:s}=e,i=new Uint8Array(n*s),a=t.width/n,l=t.height/s;if(r.width/a<.5||r.height/l<.5)return new o.A({pixelType:e.pixelType,width:n,height:s,mask:i,pixels:[...e.pixels]});let{xmin:u,xmax:p,ymin:c,ymax:h}=t,{xmin:m,xmax:f,ymin:g,ymax:d}=r,y=Math.max(u,m),x=Math.min(p,f),w=Math.max(c,g),A=Math.min(h,d),v=.5*a,b=.5*l;if(x-y<v||A-w<b||x<u+v||y>p-v||w>h-b||A<c+b)return new o.A({pixelType:e.pixelType,width:n,height:s,mask:i,pixels:[...e.pixels]});let C=Math.max(0,(y-u)/a),M=Math.min(n,Math.max(0,(x-u)/a)),P=Math.max(0,(h-A)/l),T=Math.min(s,Math.max(0,(h-w)/l)),R=Math.round(C),N=Math.round(M)-1,k=Math.round(P),I=Math.round(T)-1;if(R===N&&C%1>.5&&M%1<.5||k===I&&P%1>.5&&T%1<.5)return new o.A({pixelType:e.pixelType,width:n,height:s,mask:i,pixels:[...e.pixels]});if(0===R&&0===k&&N===n&&I===s)return e;let S=e.mask;for(let e=k;e<=I;e++)for(let t=R;t<=N;t++){let r=e*n+t;i[r]=S?S[r]:255}return new o.A({pixelType:e.pixelType,width:n,height:s,mask:i,pixels:[...e.pixels]})}(e,t,n);let{width:i,height:a}=e,l=new Uint8Array(i*a),{intersectsExecute:u}=await Promise.all([r.e(9187),r.e(8885),r.e(9117),r.e(3299),r.e(1132)]).then(()=>r(25275));if(!u(t,n))return new o.A({pixelType:e.pixelType,width:i,height:a,mask:l,maskIsAlpha:!1,pixels:[...e.pixels]});if("polyline"===n.type)return s?.thinPolyline?p(e,t,n):function(e,t,r){let{width:n,height:s}=e,i=new Uint8Array(n*s),a=t.width/n,l=t.height/s,{xmin:u,ymax:p}=t,{paths:c}=r,h=e.mask;for(let e=0;e<c.length;e++){let t=c[e];for(let e=0;e<t.length-1;e++){let[r,o]=t[e],[c,m]=t[e+1],f=Math.min(o,m),g=Math.max(o,m),d=Math.max(0,Math.floor((p-g)/l)),y=Math.min(s-1,Math.floor((p-f)/l));if(!(y<d))if(o===m){let e=Math.min(r,c),t=Math.max(r,c),s=Math.max(0,Math.floor((e-u)/a)),o=Math.min(n-1,Math.floor((t-u)/a));if(o<s)continue;let l=d*n;for(let e=l+s;e<=l+o;e++)i[e]=h?h[e]:255}else{let e=(r-u)/a,t=(c-r)/(m-o)/a;for(let r=d;r<=y;r++){let s=t*(Math.min(g,p-r*l)-o)+e,a=t*(Math.max(f,p-(r+1)*l)-o)+e,u=Math.max(0,Math.floor(Math.min(s,a))),c=Math.min(n-1,Math.floor(Math.max(s,a)));if(c<u)continue;let m=r*n;for(let e=m+u;e<=m+c;e++)i[e]=h?h[e]:255}}}}return new o.A({pixelType:e.pixelType,width:n,height:s,mask:i,maskIsAlpha:e.maskIsAlpha,pixels:[...e.pixels]})}(e,t,n);let{containsExecute:c}=await Promise.all([r.e(9187),r.e(8885),r.e(9117),r.e(3299),r.e(6671)]).then(()=>r(30912));return c(n,t)?e:function(e,t,r){if(!e)return e;let{width:n,height:s}=e,i=function(e){let t,{geometry:r,size:n,srcExtent:s,srcMask:i}=e,[o,a]=n,l=s.width/o,u=s.height/a,{xmin:p,ymax:c}=s;if("extent"===r.type){let e=(r.xmin-p)/l,n=(r.xmax-p)/l,s=(c-r.ymax)/u,i=(c-r.ymin)/u;t=[[[e,s],[e,i],[n,i],[n,s],[e,s]]]}else t=r.rings.map(e=>e.map(([e,t])=>[(e-p)/l,(c-t)/u]));return function(e,t,r){let[n,s]=t,i=new OffscreenCanvas(n,s).getContext("2d");i.fillStyle="#f00",i.beginPath(),e.forEach(e=>{i.moveTo(e[0][0],e[0][1]);for(let t=0;t<e.length;t++)i.lineTo(e[t][0],e[t][1]);i.closePath()}),i.fill();let o=i.getImageData(0,0,n,s).data,a=n*s,l=new Uint8Array(a),u=!1;for(let e=0;e<a;e++)(!r||r[e])&&(o[4*e+3]>127?l[e]=255:u=!0);return u||r?l:void 0}(t,n,i)}({geometry:r,size:[n,s],srcExtent:t,srcMask:e.mask});return new o.A({pixelType:e.pixelType,width:n,height:s,mask:i,maskIsAlpha:!1,pixels:[...e.pixels]})}(e,t,n)}function u(e){let{size:t,start:r,end:n,outMask:s,srcMask:i}=e,[o,a]=t,[l,u]=r,[p,c]=n;if(Math.max(l,p)<=0||Math.min(l,p)>=o||Math.max(u,c)<=0||Math.min(u,c)>=a)return;let h=Math.abs(p-l),m=Math.abs(c-u);if(0===h&&0===m){let e=Math.floor(l),t=Math.floor(u)*o+e;return void(s[t]=i?i[t]:255)}let f=m>h;f&&([l,u]=[u,l],[p,c]=[c,p],[h,m]=[m,h],[o,a]=[a,o]),l>p&&([l,p]=[p,l],[u,c]=[c,u]);let g=Math.max(0,Math.floor(l)),d=Math.min(o-1,Math.floor(p)),y=u<=c?1:-1,x=Math.floor(Math.min(u,c)),w=Math.floor(Math.max(u,c)),A=m/h,v=u+(g+.5-l)*y*A,b=y>0?Math.floor(v):Math.ceil(v)-1,C=y>0?v-b:b+1-v;for(let e=g;e<=d;e++){let t=Math.max(x,Math.min(w,b));if(t>=0&&t<a){let r=f?e*a+t:t*o+e;s[r]=i?i[r]:255}C+=A,C>=1&&(b+=y,--C)}}function p(e,t,r){let{width:n,height:s,mask:i}=e,a=new Uint8Array(n*s),l=t.width/n,p=t.height/s,{xmin:c,ymax:h}=t,m=[n,s];for(let e of r.paths)for(let t=0;t<e.length-1;t++){let[r,n]=e[t],[s,o]=e[t+1];u({size:m,start:[(r-c)/l,(h-n)/p],end:[(s-c)/l,(h-o)/p],srcMask:i,outMask:a})}return new o.A({pixelType:e.pixelType,width:n,height:s,mask:a,maskIsAlpha:e.maskIsAlpha,pixels:[...e.pixels]})}function c(e,t){let{extent:r}=h(e,t,new i.A({x:e.pixelSize.x,y:e.pixelSize.y,spatialReference:e.spatialReference})),{extent:n}=e.extent;if(r.xmax=Math.min(r.xmax,n.xmax),r.ymax=Math.min(r.ymax,n.ymax),r.xmin<r.xmax&&r.ymin<r.ymax){let{x:t,y:n}=e.pixelSize,s=Math.round(r.width/t),i=Math.round(r.height/n);e.extent=r,e.width=s,e.height=i}}function h(e,t,r,n=!0){let i,o,l,{spatialReference:u}=e,{x:p,y:c}=a(r,u),{xmin:h,xmax:m,ymax:f,ymin:g}="extent"===t.type?t:t.extent,{xmin:d,ymax:y}=e.extent;return n?(h=d+(h>d?p*Math.round((h-d)/p):0),f=y-(f<y?c*Math.round((y-f)/c):0),m=d+(m>d?p*Math.round((m-d)/p):0),g=y-(g<y?c*Math.round((y-g)/c):0),i=new s.A({xmin:h,ymax:f,xmax:m,ymin:g,spatialReference:u}),o=Math.round(i.width/p),l=Math.round(i.height/c)):(o=Math.floor((m-h)/p+.8),l=Math.floor((f-g)/c+.8),h=d+(h>d?p*Math.floor((h-d)/p+.1):0),f=y-(f<y?c*Math.floor((y-f)/c+.1):0),m=h+o*p,g=f-l*c,i=new s.A({xmin:h,ymax:f,xmax:m,ymin:g,spatialReference:u})),{extent:i,width:o,height:l}}},99235(e,t,r){r.d(t,{vt:()=>Un,UD:()=>Vn});var n=r(85334),s=r(49186),i=r(4718),o=r(32198),a=r(91429),l=r(94778),u=r(25482);let p=class extends u.o{constructor(){super(...arguments),this.raster=void 0}};(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],p.prototype,"raster",void 0),p=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.BaseFunctionArguments")],p);const c=p;var h;let m=h=class extends c{constructor(){super(...arguments),this.raster2=void 0}get rasters(){return[this.raster,this.raster2]}clone(){return new h({raster:this.raster,raster2:this.raster2,operation:this.operation})}};(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],m.prototype,"operation",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],m.prototype,"raster2",void 0),(0,o.Cg)([(0,a.MZ)({readOnly:!0})],m.prototype,"rasters",null),m=h=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ArithmeticFunctionArguments")],m);const f=m;var g=r(14140),d=r(87186);const y=new Set(["slope","aspect","curvature","hillshade","shadedrelief","statistics"]);let x=class extends u.o{constructor(){super(...arguments),this.functionArguments=null,this.readingBufferSize=0,this.id=-1,this.isNoopProcess=!1,this.rawInputBandIds=[],this.rawSourceRasterInfos=null,this.isInputBandIdsSwizzled=!1,this.swizzledBandSelection=[],this.isBranch=!1,this.isRoot=!1,this._bindingResult=null}get supportsGPU(){return this._bindingResult.supportsGPU}get flatWebGLFunctionChain(){let e=this.getWebGLProcessorDefinition();if(!e)return null;let t=[e],{parameters:r}=e,n=r.rasters||r.raster&&[r.raster];for(;n?.length;){t.unshift(...n);let e=[];for(let t=0;t<n.length;t++){let{parameters:r}=n[t],s=r.rasters||r.raster&&[r.raster];s?.length&&e.push(...s)}n=e}for(let e=t.length-1;e>=0;e--)t[e].isNoopProcess&&t.splice(e,1);let s=!1;for(let e=0;e<t.length;e++){let r=t[e];r.id=t.length-e-1;let{rasters:n}=r.parameters;s||=null!=n&&n.length>1}let i=t.some(({name:e})=>y.has(e.toLowerCase())),{rawSourceRasterInfos:o}=this;return{functions:t,hasBranches:s,hasFocalFunction:i,isSourceSingleBand:1===o?.[0]?.bandCount}}get neighborhoodSize(){let{rows:e,cols:t}=this._getNeighborhoodSize(),r=this.getImmediateChildFunctions();for(let n of r){let r=n.neighborhoodSize;e=Math.max(e,r.rows),t=Math.max(t,r.cols)}return{rows:e,cols:t}}bind(e,t=!1,r=-1){this.id=r+1;let n=this._getRasterValues(),s=!0;for(let r=0;r<n.length;r++){let i=n[r];if(null!=i&&this._isRasterFunctionValue(i)){let n=i.bind(e,t,this.id+r);if(!n.success)return this._bindingResult=n,n;s&&=n.supportsGPU}}return!this.rasterInfo||t?(this.sourceRasterInfos=this._getSourceRasterInfos(e),this._bindingResult=this._bindSourceRasters(),s&&=this._bindingResult.supportsGPU,this._bindingResult.success&&(this._patchRasterInfo(),s&&this.isRoot&&(this.processInputBandIds(),this.swizzleInputBandIds(this.rawInputBandIds)||(s=this.rawInputBandIds.length<=3))),this._bindingResult.supportsGPU=s,this._bindingResult):(this._bindingResult={success:!0,supportsGPU:!0},this._bindingResult)}queryRasterFunction(e){let t=[this];for(;t.length;){let r=t.pop();if(e(r))return r;let n=r.getImmediateChildFunctions();t.push(...n)}}getImmediateChildFunctions(){return this._getRasterValues().filter(e=>e&&"object"==typeof e&&"bind"in e)}process(e,t){let r=this._getRasterValues(),n=0===r.length?e.pixelBlocks??e.primaryPixelBlocks:r.map(r=>this._readRasterValue(r,e,t));return this._processPixels({...e,pixelBlocks:n},t)}processInputBandIds(){let e=this._getRasterValues().filter(this._isRasterFunctionValue);if(e.length>1){let t=e.map(e=>e.processInputBandIds());return this.rawInputBandIds=[...new Set(t.flat())],this.rawInputBandIds}let t=e[0];if(t)return this.rawInputBandIds=t.processInputBandIds(),this.rawInputBandIds;let{bandCount:r}=this.sourceRasterInfos[0],n=Array.from({length:r},(e,t)=>t);return this.rawInputBandIds=this._getInputBandIds(n),this.rawInputBandIds}swizzleInputBandIds(e){let t=this._getRasterValues().filter(this._isRasterFunctionValue),r=!0;for(let n of t)r=n.swizzleInputBandIds(e)&&r;return!!r&&this._swizzleBandIds(e)}getPrimaryRasters(){let e=[],t=[];return this._getPrimaryRasters(this,e,t),{rasters:e,rasterIds:t}}getWebGLProcessorDefinition(){let e=this._getWebGLParameters(),{raster:t,rasters:r}=this.functionArguments;return r&&Array.isArray(r)&&r.length?(e.rasters=r.map(e=>this._isRasterFunctionValue(e)?e.getWebGLProcessorDefinition():"number"==typeof e?{name:"Constant",parameters:{value:e},pixelType:"f32",id:-1,isNoopProcess:!1}:{name:"Identity",parameters:{value:e},pixelType:"f32",id:-1,isNoopProcess:!1}),e.rasters.some(e=>null!=e)||(e.rasters=null)):this._isRasterFunctionValue(t)&&(e.raster=t.getWebGLProcessorDefinition()),{name:this.functionName,parameters:e,pixelType:this.outputPixelType,id:this.id,isNoopProcess:this.isNoopProcess}}getClippingGeometries(){let e=[];"Clip"===this.functionName&&e.push(this.functionArguments);let{raster:t,rasters:r}=this.functionArguments;if(r&&Array.isArray(r)&&r.length)r.forEach(t=>{if(this._isRasterFunctionValue(t)){let r=t.getClippingGeometries();e.push(...r)}});else if(this._isRasterFunctionValue(t)){let r=t.getClippingGeometries();e.push(...r)}return e}_getOutputPixelType(e){return"unknown"===this.outputPixelType?e:this.outputPixelType??e}_getWebGLParameters(){return{}}_getInputBandIds(e){return e}_swizzleBandIds(e){return!0}_isInputRasterPrimaryOrConstant(){return!this._getRasterValues().some(e=>e&&"object"==typeof e&&"rasterFunction"in e&&e.rasterFunction)}_getNeighborhoodSize(){return{rows:1,cols:1}}_removeStatsHistColormapVAT(e){e.statistics=null,e.histograms=null,e.colormap=null,e.attributeTable=null,e.multidimensionalInfo?.variables.forEach(e=>{e.statistics=void 0,e.histograms=void 0})}_getRasterValues(){let{rasterArgumentNames:e}=this;return"rasters"===e[0]?this.functionArguments.rasters??[]:e.flatMap(e=>this.functionArguments[e])}_getSourceRasterInfos(e){let t=this._getRasterValues(),{rasterInfos:r,rasterIds:n}=e;if(0===t.length)return r;let s=t.map(e=>e&&"object"==typeof e&&"bind"in e&&e.rasterInfo?e.rasterInfo:"string"==typeof e&&n.includes(e)?r[n.indexOf(e)]:"number"!=typeof e?r[0]:void 0),i=s.find(e=>e)??r[0];return s.forEach((e,t)=>{void 0===e&&(s[t]=i)}),s}_getPrimaryRasterId(e){return e?.rasterId}_getPrimaryRasters(e,t=[],r=[]){for(let n=0;n<e.sourceRasters.length;n++){let s=e.sourceRasters[n];if("number"!=typeof s)if("bind"in s)this._getPrimaryRasters(s,t,r);else{let e=s,n=this._getPrimaryRasterId(e);if(null==n)continue;r.includes(n)||(this.mainPrimaryRasterId===n?(t.unshift(e),r.unshift(n)):(t.push(e),r.push(n)))}}}_isRasterFunctionValue(e){return"object"==typeof e&&!!e&&"getWebGLProcessorDefinition"in e}_readRasterValue(e,t,r){let{primaryPixelBlocks:n}=t;if(null==e||"$$"===e){let e=n[0];return null==e?null:e.clone()}if("string"==typeof e){let r=t.primaryRasterIds.indexOf(e);return-1===r?null:n[r]}if("number"==typeof e){let t=n[0];if(null==t)return null;let{width:r,height:s,pixelType:i}=t,o=new Float32Array(r*s);o.fill(e);let a=this.sourceRasterInfos[0].bandCount,l=Array(a).fill(o);return new g.A({width:r,height:s,pixelType:i,pixels:l})}return e.process(t,r)}_patchRasterInfo(){let{rasterInfo:e}=this;if(!e?.keyProperties)return;let{bandCount:t,keyProperties:r,statistics:n,histograms:s}=e,i=r.BandProperties;i&&i.length!==t&&(e.keyProperties={...r,BandProperties:void 0}),n&&n.length!==t&&(e.statistics=n.length>t?n.slice(0,t):null),s&&s.length!==t&&(e.histograms=s.length>t?s.slice(0,t):null),r.BAND_COUNT&&Number(r.BAND_COUNT)!==t&&(e.keyProperties={...r,BAND_COUNT:"string"==typeof r.BAND_COUNT?String(t):t})}};(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],x.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}}),(0,a.wg)(e=>e?.toLowerCase())],x.prototype,"outputPixelType",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"mainPrimaryRasterId",void 0),(0,o.Cg)([(0,a.MZ)()],x.prototype,"sourceRasters",void 0),(0,o.Cg)([(0,a.MZ)({type:[d.A],json:{write:!0}})],x.prototype,"sourceRasterInfos",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"rasterInfo",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"readingBufferSize",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"id",void 0),(0,o.Cg)([(0,a.MZ)()],x.prototype,"isNoopProcess",void 0),(0,o.Cg)([(0,a.MZ)()],x.prototype,"supportsGPU",null),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"rawInputBandIds",void 0),(0,o.Cg)([(0,a.MZ)()],x.prototype,"rawSourceRasterInfos",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"isInputBandIdsSwizzled",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"swizzledBandSelection",void 0),(0,o.Cg)([(0,a.MZ)()],x.prototype,"isBranch",void 0),(0,o.Cg)([(0,a.MZ)()],x.prototype,"isRoot",void 0),(0,o.Cg)([(0,a.MZ)({readOnly:!0})],x.prototype,"flatWebGLFunctionChain",null),(0,o.Cg)([(0,a.MZ)({readOnly:!0})],x.prototype,"neighborhoodSize",null),(0,o.Cg)([(0,a.MZ)()],x.prototype,"_bindingResult",void 0),x=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.BaseRasterFunction")],x);const w=x,A={userDefined:-1,lineDetectionHorizontal:0,lineDetectionVertical:1,lineDetectionLeftDiagonal:2,lineDetectionRightDiagonal:3,gradientNorth:4,gradientWest:5,gradientEast:6,gradientSouth:7,gradientNorthEast:8,gradientNorthWest:9,smoothArithmeticMean:10,smoothing3x3:11,smoothing5x5:12,sharpening3x3:13,sharpening5x5:14,laplacian3x3:15,laplacian5x5:16,sobelHorizontal:17,sobelVertical:18,sharpen:19,sharpen2:20,pointSpread:21,none:255},v={bitwiseAnd:11,bitwiseLeftShift:12,bitwiseNot:13,bitwiseOr:14,bitwiseRightShift:15,bitwiseXOr:16,booleanAnd:17,booleanNot:18,booleanOr:19,booleanXOr:20,equalTo:24,greaterThan:28,greaterThanEqual:29,lessThan:33,lessThanEqual:34,isNull:31,notEqual:46},b={acos:6,asin:7,atan:8,atanh:9,cos:21,cosh:22,sin:51,sinh:52,tan:56,tanh:57,acosh:59,asinh:60,atan2:61},C={setNull:50,conditional:78},M={plus:1,minus:2,times:3,sqrt:4,power:5,abs:10,divide:23,exp:25,exp10:26,exp2:27,int:30,float:32,ln:35,log10:36,log2:37,mod:44,negate:45,roundDown:48,roundUp:49,square:53,floatDivide:64,floorDivide:65,...v,...b,majority:38,max:39,mean:40,med:41,min:42,minority:43,range:47,stddev:54,sum:55,variety:58,majorityIgnoreNoData:66,maxIgnoreNoData:67,meanIgnoreNoData:68,medIgnoreNoData:69,minIgnoreNoData:70,minorityIgnoreNoData:71,rangeIgnoreNoData:72,stddevIgnoreNoData:73,sumIgnoreNoData:74,varietyIgnoreNoData:75,...C},P=new Map([[b.acos,{domain:[0,Math.PI],isInteger:!1}],[b.asin,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[b.atan,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[b.cos,{domain:[-1,1],isInteger:!1}],[b.sin,{domain:[-1,1],isInteger:!1}],[v.booleanAnd,{domain:[0,1],isInteger:!0}],[v.booleanNot,{domain:[0,1],isInteger:!0}],[v.booleanOr,{domain:[0,1],isInteger:!0}],[v.booleanXOr,{domain:[0,1],isInteger:!0}],[v.equalTo,{domain:[0,1],isInteger:!0}],[v.notEqual,{domain:[0,1],isInteger:!0}],[v.greaterThan,{domain:[0,1],isInteger:!0}],[v.greaterThanEqual,{domain:[0,1],isInteger:!0}],[v.lessThan,{domain:[0,1],isInteger:!0}],[v.lessThanEqual,{domain:[0,1],isInteger:!0}],[v.isNull,{domain:[0,1],isInteger:!0}]]);function T(e){return P.get(e)}const R=[0,2,2,2,1,2,1,1,1,1,1,2,2,1,2,2,2,2,1,2,2,1,1,2,2,1,1,1,2,2,1,1,1,2,2,1,1,1,999,999,999,999,999,999,2,1,2,999,1,1,2,1,1,1,999,999,1,1,999,1,1,2,999,999,2,2,999,999,999,999,999,999,999,999,999,999,3,999,3];function N(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=n[e]+s[e]);return o}function k(e,t,r){let[n]=e,s=n.length,i=g.A.createEmptyBand("f32",s);return i.set(n),i}function I(e,t,r){let[n]=e,s=n.length,i=g.A.createEmptyBand(r,s);for(let e=0;e<s;e++)(!t||t[e])&&(i[e]=n[e]*n[e]);return i}function S(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=n[e]-s[e]);return o}function _(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=n[e]*s[e]);return o}function F(e,t,r){let[n]=e,s=n.length,i=g.A.createEmptyBand(r,s);for(let e=0;e<s;e++)(!t||t[e])&&(i[e]=Math.sign(n[e])*Math.floor(Math.abs(n[e])));return i}function B(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=n[e]/s[e]);return o}function j(e,t,r){return B(e,t,"f32")}function Z(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=Math.floor(n[e]/s[e]));return o}function z(e,t,r,n){let s=e[0],i=s.length,o=g.A.createEmptyBand(r,i);if(n===b.atanh){for(let e=0;e<i;e++)if(t[e]){let r=s[e];Math.abs(r)>=1?t[e]=0:o[e]=Math.atanh(r)}return o}let a=n===b.asin?Math.asin:Math.acos;for(let e=0;e<i;e++)if(t[e]){let r=s[e];Math.abs(r)>1?t[e]=0:o[e]=a(r)}return o}function G(e,t,r,n){let[s]=e,i=s.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=n(s[e]));return o}function E(e,t,r,n){let[s,i]=e,o=s.length,a=g.A.createEmptyBand(r,o);for(let e=0;e<o;e++)(!t||t[e])&&(a[e]=n(s[e],i[e]));return a}function O(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=n[e]&s[e]);return o}function D(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=n[e]<<s[e]);return o}function V(e,t,r){let[n]=e,s=n.length,i=g.A.createEmptyBand(r,s);for(let e=0;e<s;e++)(!t||t[e])&&(i[e]=~n[e]);return i}function U(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=n[e]|s[e]);return o}function L(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=n[e]>>s[e]);return o}function W(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=n[e]^s[e]);return o}function $(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=n[e]&&s[e]?1:0);return o}function K(e,t,r){let[n]=e,s=n.length,i=g.A.createEmptyBand(r,s);for(let e=0;e<s;e++)(!t||t[e])&&(i[e]=+!n[e]);return i}function H(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=n[e]||s[e]?1:0);return o}function q(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=+!!n[e]^!!s[e]);return o}function J(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=+(n[e]===s[e]));return o}function X(e,t,r,n){let[s]=e,i=s.length,o=g.A.createEmptyBand(r,i),a=n===Math.E;for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=a?Math.exp(s[e]):n**s[e]);return o}function Y(e,t,r){return X(e,t,r,10)}function Q(e,t,r){return X(e,t,r,2)}function ee(e,t,r){return X(e,t,r,Math.E)}function te(e,t,r,n){let[s]=e,i=s.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(s[e]<=0?t[e]=0:o[e]=n(s[e]));return o}function re(e,t,r){return te(e,t,r,Math.log10)}function ne(e,t,r){return te(e,t,r,Math.log2)}function se(e,t,r){return te(e,t,r,Math.log)}function ie(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=+(n[e]>s[e]));return o}function oe(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=+(n[e]>=s[e]));return o}function ae(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=+(n[e]<s[e]));return o}function le(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=+(n[e]<=s[e]));return o}function ue(e,t,r){let[n]=e,s=n.length,i=g.A.createEmptyBand(r,s);if(!t)return i;for(let e=0;e<s;e++)i[e]=+!t[e];return i}function pe(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=n[e]%s[e]);return o}function ce(e,t,r){let[n]=e,s=n.length,i=g.A.createEmptyBand(r,s);for(let e=0;e<s;e++)(!t||t[e])&&(i[e]=-n[e]);return i}function he(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=n[e]===s[e]?0:1);return o}function me(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i),a=new Uint8Array(i);for(let e=0;e<i;e++)(null==t||t[e])&&0===n[e]&&(o[e]=s[e],a[e]=255);return{band:o,mask:a}}function fe(e,t,r){let[n,s,i]=e,o=n.length,a=g.A.createEmptyBand(r,o);for(let e=0;e<o;e++)(!t||t[e])&&(a[e]=n[e]?s[e]:i[e]);return a}function ge(e,t,r){let n=e.length;if(n<2)return e[0];let[s]=e,i=s.length,o=g.A.createEmptyBand(r,i);for(let r=0;r<i;r++)if(!t||t[r]){let t=s[r];for(let s=1;s<n;s++){let n=e[s][r];t<n&&(t=n)}o[r]=t}return o}function de(e,t,r){let n=e.length;if(n<2)return e[0];let[s]=e,i=s.length,o=g.A.createEmptyBand(r,i);for(let r=0;r<i;r++)if(!t||t[r]){let t=s[r];for(let s=1;s<n;s++){let n=e[s][r];t>n&&(t=n)}o[r]=t}return o}function ye(e,t,r){let n=e.length;if(n<2)return e[0];let[s]=e,i=s.length,o=g.A.createEmptyBand(r,i);for(let r=0;r<i;r++)if(!t||t[r]){let t=s[r],i=t;for(let s=1;s<n;s++){let n=e[s][r];i<n?i=n:t>n&&(t=n)}o[r]=i-t}return o}function xe(e,t,r){let n=e.length;if(n<2)return e[0];let[s]=e,i=s.length,o=g.A.createEmptyBand(r,i);for(let r=0;r<i;r++)if(!t||t[r]){let t=0;for(let s=0;s<n;s++)t+=e[s][r];o[r]=t/n}return o}function we(e,t,r){let n=e.length;if(n<2)return e[0];let[s]=e,i=s.length,o=g.A.createEmptyBand(r,i);for(let r=0;r<i;r++)if(!t||t[r])for(let t=0;t<n;t++){let n=e[t];o[r]+=n[r]}return o}function Ae(e,t,r){let n=e.length;if(n<2)return e[0];let[s]=e,i=s.length,o=g.A.createEmptyBand(r,i);for(let r=0;r<i;r++)if(!t||t[r]){let t=new Float32Array(n),s=0;for(let i=0;i<n;i++){let n=e[i];s+=n[r],t[i]=n[r]}s/=n;let i=0;for(let e=0;e<n;e++)i+=(t[e]-s)**2;o[r]=Math.sqrt(i/n)}return o}function ve(e,t,r){let n=e.length;if(n<2)return e[0];let s=Math.floor(n/2),[i]=e,o=i.length,a=g.A.createEmptyBand(r,o),l=new Float32Array(n),u=n%2==1;for(let r=0;r<o;r++)if(!t||t[r]){for(let t=0;t<n;t++)l[t]=e[t][r];l.sort(),a[r]=u?l[s]:(l[s]+l[s-1])/2}return a}function be(e,t,r){let[n,s]=e;if(null==s)return n;let i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=n[e]<s[e]?n[e]:s[e]);return o}function Ce(e,t,r){let n=e.length;if(n<=2)return be(e,t,r);let s=e[0].length,i=g.A.createEmptyBand(r,s),o=new Map;for(let r=0;r<s;r++)if(!t||t[r]){o.clear();for(let t=0;t<n;t++){let n=e[t][r];o.set(n,o.has(n)?o.get(n)+1:1)}let t=0,s=0,a=[];for(let e of o.keys())t=o.get(e),t>s?(s=t,a.length=0,a.push(e)):t===s&&a.push(e);a.length>1&&a.sort((e,t)=>e-t),i[r]=a[0]}return i}function Me(e,t,r){let n=e.length;if(n<=2)return be(e,t,r);let s=e[0].length,i=g.A.createEmptyBand(r,s),o=new Map;for(let r=0;r<s;r++)if(!t||t[r]){o.clear();for(let t=0;t<n;t++){let n=e[t][r];o.set(n,o.has(n)?o.get(n)+1:1)}let t=0,s=e.length,a=[];for(let e of o.keys())t=o.get(e),t<s?(s=t,a.length=0,a.push(e)):t===s&&a.push(e);a.length>1&&a.sort((e,t)=>e-t),i[r]=a[0]}return i}function Pe(e,t,r){let n=e.length;if(n<2)return e[0];let[s]=e,i=s.length,o=g.A.createEmptyBand(r,i),a=new Set;for(let r=0;r<i;r++)if(!t||t[r]){let t;a.clear();for(let s=0;s<n;s++)t=e[s][r],a.add(t);o[r]=a.size}return o}const Te=new Map,Re=new Map,Ne=new Map,ke=new Map;function Ie(){Te.size||(Te.set(4,Math.sqrt),Te.set(6,Math.acos),Te.set(7,Math.asin),Te.set(8,Math.atan),Te.set(9,Math.atanh),Te.set(10,Math.abs),Te.set(21,Math.cos),Te.set(22,Math.cosh),Te.set(48,Math.floor),Te.set(49,Math.ceil),Te.set(51,Math.sin),Te.set(52,Math.sinh),Te.set(56,Math.tan),Te.set(57,Math.tanh),Te.set(59,Math.acosh),Te.set(60,Math.asinh),Te.set(65,Math.floor),Re.set(5,Math.pow),Re.set(61,Math.atan2),Ne.set(1,N),Ne.set(2,S),Ne.set(3,_),Ne.set(11,O),Ne.set(12,D),Ne.set(13,V),Ne.set(14,U),Ne.set(15,L),Ne.set(16,W),Ne.set(17,$),Ne.set(18,K),Ne.set(19,H),Ne.set(20,q),Ne.set(23,B),Ne.set(24,J),Ne.set(25,ee),Ne.set(26,Y),Ne.set(27,Q),Ne.set(28,ie),Ne.set(29,oe),Ne.set(30,F),Ne.set(31,ue),Ne.set(32,k),Ne.set(33,ae),Ne.set(34,le),Ne.set(35,se),Ne.set(36,re),Ne.set(37,ne),Ne.set(44,pe),Ne.set(45,ce),Ne.set(46,he),Ne.set(53,I),Ne.set(64,j),Ne.set(65,Z),Ne.set(76,fe),Ne.set(78,fe),ke.set(38,Ce),ke.set(39,ge),ke.set(40,xe),ke.set(41,ve),ke.set(42,de),ke.set(43,Me),ke.set(47,ye),ke.set(54,Ae),ke.set(55,we),ke.set(58,Pe),ke.set(66,Ce),ke.set(67,ge),ke.set(68,xe),ke.set(69,ve),ke.set(70,de),ke.set(71,Me),ke.set(72,ye),ke.set(73,Ae),ke.set(74,we),ke.set(75,Pe))}function Se(e,t,r={}){Ie();let n=function(e,t=!1){let r=e.map(e=>e.mask),n=r.filter(e=>null!=e),s=e[0].pixels[0].length;if(0===n.length||t&&n.length!==r.length)return new Uint8Array(s).fill(255);let i=n[0],o=new Uint8Array(i);if(1===n.length)return o;if(!t){for(let e=1;e<n.length;e++){let t=n[e];for(let e=0;e<o.length;e++)o[e]&&(o[e]=t[e]?255:0)}return o}for(let e=1;e<n.length;e++){let t=n[e];for(let e=0;e<o.length;e++)0===o[e]&&(o[e]=t[e]?255:0)}return o}(e,t>=66&&t<=75),{outputPixelType:s="f32"}=r,i=!ke.has(t)||r.processAsMultiband,o=i?e[0].pixels.length:1,a=[];for(let r=0;r<o;r++){let o,u=ke.has(t)&&!i?e.flatMap(e=>e.pixels):e.map(e=>e.pixels[r]),p=!0;if(t===C.setNull){let e=me(u,n,s);o=e.band,n=e.mask,p=!1}else Ne.has(t)?o=Ne.get(t)(u,n,"f64"):Te.has(t)?o=t===b.asin||t===b.acos||t===b.atanh?z(u,n,"f64",t):G(u,n,"f64",Te.get(t)):Re.has(t)?o=E(u,n,"f64",Re.get(t)):ke.has(t)?o=ke.get(t)(u,n,"f64"):(o=u[0],p=!1);if(p&&t!==v.isNull&&!P.has(t)){let e=g.A.createEmptyBand(s,o.length);n||=new Uint8Array(o.length).fill(255),(0,l.$p)(o,n),(0,l.yM)(o,n,s,e),o=e}a.push(o)}let u=e[0];return new g.A({width:u.width,height:u.height,pixelType:s,mask:t===v.isNull?null:n,pixels:a})}let _e=class extends w{constructor(){super(...arguments),this.functionName="Arithmetic",this.functionArguments=null,this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){let{operation:e}=this.functionArguments;if(e<1||e>6)return{success:!1,supportsGPU:!1,error:"unsupported operation"};let t=this.sourceRasterInfos[0].clone();return this.outputPixelType=this._getOutputPixelType(t.pixelType),t.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(t),this.rasterInfo=t,{success:!0,supportsGPU:t.bandCount<=3}}_processPixels(e){let{pixelBlocks:t}=e;return null==t?.[0]||null==t?.[1]?null:function(e,t,r){return Se(e,t=[null,1,2,3,23,5,44][t]??1,{outputPixelType:r})}(t,this.functionArguments.operation,this.outputPixelType)}_getWebGLParameters(){let{operation:e}=this.functionArguments,t=["","plus","minus","times","divide","power","mod"][e],r=this.outputPixelType??"f32",[n,s]=(0,l.hP)(r),i=(0,l.zw)(r);return i&&(n-=1e-4,s+=1e-4),{imageCount:2,operationName:t,domainRange:[n,s],isOutputRounded:i}}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],_e.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:f,json:{write:!0,name:"rasterFunctionArguments"}})],_e.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],_e.prototype,"rasterArgumentNames",void 0),_e=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ArithmeticFunction")],_e);const Fe=_e;var Be;let je=Be=class extends c{clone(){return new Be({raster:this.raster})}};je=Be=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.AspectFunctionArguments")],je);const Ze=je;var ze=r(51181);let Ge=class extends w{constructor(){super(...arguments),this.functionName="Aspect",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){let e=this.sourceRasterInfos[0];this.isGCS=e.spatialReference?.isGeographic??!1,this.outputPixelType=this._getOutputPixelType("f32");let t=e.clone();return t.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(t),t.statistics=[{min:-1,max:360,avg:180,stddev:30}],t.bandCount=1,this.rasterInfo=t,{success:!0,supportsGPU:!0}}_processPixels(e){let t=e.pixelBlocks?.[0];if(null==t)return null;let{extent:r,primaryPixelSizes:n}=e,s=n?.[0]??(r?{x:r.width/t.width,y:r.height/t.height}:{x:1,y:1});return(0,ze.di)(t,{resolution:s})}_getNeighborhoodSize(){return{rows:3,cols:3}}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Ge.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:Ze,json:{write:!0,name:"rasterFunctionArguments"}})],Ge.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],Ge.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Ge.prototype,"isGCS",void 0),Ge=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.AspectFunction")],Ge);const Ee=Ge;var Oe=r(66552);const De=new Set(["+","-","*","/","(",")"]);function Ve(e,t){return e.toLowerCase().startsWith("b")?t[parseInt(e.slice(1),10)-1]:parseFloat(e)}function Ue(e,t,r,n){if("number"==typeof r&&"number"==typeof n)return r+n;let s,i,o;"number"==typeof r?(o=n,s=o.length,i=new Float32Array(s),i.fill(r)):(s=r.length,i=r,n.constructor===Number?(o=new Float32Array(s),o.fill(n)):o=n);let a=new Float32Array(s);switch(t){case"+":for(let t=0;t<s;t++)(null==e||e[t])&&(a[t]=i[t]+o[t]);break;case"-":for(let t=0;t<s;t++)(null==e||e[t])&&(a[t]=i[t]-o[t]);break;case"*":for(let t=0;t<s;t++)(null==e||e[t])&&(a[t]=i[t]*o[t]);break;case"/":for(let t=0;t<s;t++)(null==e||e[t])&&o[t]&&(a[t]=i[t]/o[t]);break;case"(":case")":throw Error("encountered error with custom band index equation")}return a}function Le(e,t){e.splice(t,1);let r=0,n=0;do{r=0,n=0;for(let t=0;t<e.length;t++)if("("===e[t])r=t;else if(")"===e[t]){n=t;break}n===r+1&&e.splice(r,2)}while(n===r+1);return e}function We(e){if(1===e.length)return{opIndex:0,numIndex:0};let t=0,r=0;for(let n=0;n<e.length;n++)if("("===e[n])t=n;else if(")"===e[n]){r=n;break}let n=0===r?e:e.slice(t+1,r),s=-1;for(let e=0;e<n.length;e++)if("*"===n[e]||"/"===n[e]){s=e;break}if(s>-1)r>0&&(s+=t+1);else{for(let e=0;e<n.length;e++)if("+"===n[e]||"-"===n[e]){s=e;break}r>0&&(s+=t+1)}let i=0;for(let t=0;t<s;t++)"("===e[t]&&i++;return{opIndex:s,numIndex:s-i}}var $e=r(47520);const Ke=new Oe.J({0:"custom",1:"ndvi",2:"savi",3:"tsavi",4:"msavi",5:"gemi",6:"pvi",7:"gvitm",8:"sultan",9:"vari",10:"gndvi",11:"sr",12:"ndvi-re",13:"sr-re",14:"mtvi2",15:"rtvi-core",16:"ci-re",17:"ci-g",18:"ndwi",19:"evi",20:"iron-oxide",21:"ferrous-minerals",22:"clay-minerals",23:"wndwi",24:"bai",25:"nbr",26:"ndbi",27:"ndmi",28:"ndsi",29:"mndwi"},{useNumericKeys:!0});function He(e,t){if(!(0,$e.AB)(e))return e;let r,{equation:n,method:s}=t,i=t.bandIndexes.map(e=>e-1),{pixels:o,mask:a}=e;switch(s){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":r=Je(a,o[i[0]],o[i[1]]);break;case"ndwi":r=Je(a,o[i[1]],o[i[0]]);break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":r=function(e,t,r){let n=r.length,s=new Float32Array(n);for(let i=0;i<n;i++)if(null==e||e[i]){let e=t[i],n=r[i];n&&(s[i]=e/n)}return[s]}(a,o[i[0]],o[i[1]]);break;case"ci-g":case"ci-re":r=function(e,t,r){let n=t.length,s=new Float32Array(n);for(let i=0;i<n;i++)if(null==e||e[i]){let e=t[i],n=r[i];n&&(s[i]=e/n-1)}return[s]}(a,o[i[0]],o[i[1]]);break;case"savi":r=function(e,t,r,n){let s=r.length,i=new Float32Array(s);for(let o=0;o<s;o++)if(null==e||e[o]){let e=r[o],s=t[o],a=s+e+n;a&&(i[o]=(s-e)/a*(1+n))}return[i]}(a,o[i[0]],o[i[1]],i[2]+1);break;case"tsavi":r=function(e,t,r,n,s,i){let o=r.length,a=new Float32Array(o),l=-s*n+i*(1+n*n);for(let i=0;i<o;i++)if(null==e||e[i]){let e=r[i],o=t[i],u=s*o+e+l;u&&(a[i]=n*(o-n*e-s)/u)}return[a]}(a,o[i[0]],o[i[1]],i[2]+1,i[3]+1,i[4]+1);break;case"msavi":r=function(e,t,r){let n=r.length,s=new Float32Array(n);for(let i=0;i<n;i++)if(null==e||e[i]){let e=r[i],n=t[i],o=2*n+1;s[i]=.5*(o-Math.sqrt(o*o-8*(n-e)))}return[s]}(a,o[i[0]],o[i[1]]);break;case"gemi":r=function(e,t,r){let n=r.length,s=new Float32Array(n);for(let i=0;i<n;i++)if(null==e||e[i]){let e=r[i],n=t[i];if(1!==e&&n+e+.5!==0){let t=(2*(n*n-e*e)+1.5*n+.5*e)/(n+e+.5);s[i]=t*(1-.25*t)-(e-.125)/(1-e)}}return[s]}(a,o[i[0]],o[i[1]]);break;case"pvi":r=function(e,t,r,n,s){let i=r.length,o=new Float32Array(i),a=1/Math.sqrt(1+n*n);for(let l=0;l<i;l++)if(null==e||e[l]){let e=r[l],i=t[l];o[l]=(i-n*e-s)*a}return[o]}(a,o[i[0]],o[i[1]],i[2]+1,i[3]+1);break;case"gvitm":r=function(e,t){let[r,n,s,i,o,a]=t,l=r.length,u=new Float32Array(l);for(let t=0;t<l;t++)(null==e||e[t])&&(u[t]=-.2848*r[t]-.2435*n[t]-.5436*s[t]+.7243*i[t]+.084*o[t]-.18*a[t]);return[u]}(a,[o[i[0]],o[i[1]],o[i[2]],o[i[3]],o[i[4]],o[i[5]]]);break;case"sultan":r=function(e,t){let[r,n,s,i,o]=t,a=r.length,l=new Float32Array(a),u=new Float32Array(a),p=new Float32Array(a);for(let t=0;t<a;t++)(null==e||e[t])&&(l[t]=o[t]?i[t]/o[t]*100:0,u[t]=r[t]?i[t]/r[t]*100:0,p[t]=s[t]?n[t]/s[t]*(i[t]/s[t])*100:0);return[l,u,p]}(a,[o[i[0]],o[i[1]],o[i[2]],o[i[3]],o[i[4]]]);break;case"vari":r=function(e,t){let[r,n,s]=t,i=r.length,o=new Float32Array(i);for(let t=0;t<i;t++)if(null==e||e[t])for(t=0;t<i;t++){let e=r[t],i=n[t],a=i+e-s[t];a&&(o[t]=(i-e)/a)}return[o]}(a,[o[i[0]],o[i[1]],o[i[2]]]);break;case"mtvi2":r=function(e,t){let[r,n,s]=t,i=r.length,o=new Float32Array(i);for(let t=0;t<i;t++)if(null==e||e[t])for(t=0;t<i;t++){let e=r[t],i=n[t],a=s[t],l=Math.sqrt((2*e+1)**2-(6*e-5*Math.sqrt(i))-.5);if(l){let r=1.5*(1.2*(e-a)-2.5*(i-a));o[t]=r/l}}return[o]}(a,[o[i[0]],o[i[1]],o[i[2]]]);break;case"rtvi-core":r=function(e,t){let[r,n,s]=t,i=r.length,o=new Float32Array(i);for(let t=0;t<i;t++)if(null==e||e[t])for(t=0;t<i;t++){let e=r[t],i=n[t],a=s[t];o[t]=100*(e-i)-10*(e-a)}return[o]}(a,[o[i[0]],o[i[1]],o[i[2]]]);break;case"evi":r=function(e,t){let[r,n,s]=t,i=r.length,o=new Float32Array(i);for(let t=0;t<i;t++)if(null==e||e[t])for(t=0;t<i;t++){let e=r[t],i=n[t],a=e+6*i-7.5*s[t]+1;a&&(o[t]=2.5*(e-i)/a)}return[o]}(a,[o[i[0]],o[i[1]],o[i[2]]]);break;case"wndwi":r=function(e,t,r=.5){let[n,s,i]=t,o=s.length,a=new Float32Array(o);for(let t=0;t<o;t++)if(null==e||e[t])for(t=0;t<o;t++){let e=n[t],o=s[t],l=i[t],u=e+r*o+(1-r)*l;u&&(a[t]=(e-r*o-(1-r)*l)/u)}return[a]}(a,[o[i[0]],o[i[1]],o[i[2]]],i[3]?i[3]+1:.5);break;case"bai":r=function(e,t,r){let n=r.length,s=new Float32Array(n);for(let i=0;i<n;i++)if(null==e||e[i])for(i=0;i<n;i++){let e=(.1-t[i])**2+(.06-r[i])**2;e&&(s[i]=1/e)}return[s]}(a,o[i[0]],o[i[1]]);break;case"custom":r=function(e,t,r){let n,{ops:s,nums:i}=function(e,t){(e=e.replaceAll(" ","")).startsWith("-")&&(e="0"+e),e.startsWith("+")&&(e=e.slice(1));let r=e.split(""),n=[],s=[],i="";for(let e=0;e<r.length;e++){let o=r[e];De.has(o)?(i.length&&s.push(Ve(i,t)),n.push(o),i=""):i=i.concat(o)}return i.length&&s.push(Ve(i,t)),{ops:n,nums:s}}(r,t);if(0===s.length){let e=1===i.length?i[0]:t[0];if(e instanceof Float32Array)return[e];let r=new Float32Array(t[0].length);return"number"==typeof e?r.fill(e):r.set(e),[r]}for(;s.length>0;){let{numIndex:t,opIndex:r}=We(s);if(n=Ue(e,s[r],i[t],i[t+1]),1===s.length)break;s=Le(s,r),i.splice(t,2,n)}return[n]}(a,o,n);break;default:return e}let u,{outputPixelType:p="f32"}=t,c=null!=p&&(0,l.zw)(p);a?(u=new Uint8Array(e.width*e.height),u.set(a)):c&&(u=new Uint8Array(e.width*e.height).fill(255)),c&&(r=r.map(e=>{let t=g.A.createEmptyBand(p,e.length);return(0,l.yM)(e,u,p,t),t}));let h=new g.A({width:e.width,height:e.height,pixelType:p,pixels:r,mask:u});return h.updateStatistics(),h}function qe(e){let t=new Float32Array(9);return t[3*e[0]]=1,t[3*e[1]+1]=1,t[3*e[2]+2]=1,t}function Je(e,t,r){let n=r.length,s=new Float32Array(n);for(let i=0;i<n;i++)if(null==e||e[i]){let e=t[i],n=r[i],o=e+n;o&&(s[i]=(e-n)/o)}return[s]}var Xe,Ye=r(93223);let Qe=Xe=class extends c{constructor(){super(...arguments),this.method="custom"}clone(){return new Xe({method:this.method,bandIndexes:this.bandIndexes,raster:(0,i.o8)(this.raster)})}};(0,o.Cg)([(0,a.MZ)({json:{type:String,write:!0}})],Qe.prototype,"bandIndexes",void 0),(0,o.Cg)([(0,Ye.e)(Ke)],Qe.prototype,"method",void 0),Qe=Xe=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.BandArithmeticFunctionArguments")],Qe);const et=Qe,tt=new Set(["vari","mtvi2","rtvi-core","evi"]);let rt=class extends w{constructor(){super(...arguments),this.functionName="BandArithmetic",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");let e=this.sourceRasterInfos[0];if(e.bandCount<2)return{success:!1,supportsGPU:!1,error:"band-arithmetic-function: source raster has insufficient amount of raster bands"};let t=e.clone();return t.pixelType=this.outputPixelType,t.bandCount="sultan"===this.functionArguments.method?3:1,this._removeStatsHistColormapVAT(t),t.keyProperties={...t.keyProperties,BandProperties:void 0},this.rasterInfo=t,{success:!0,supportsGPU:!["custom","gvitm","sultan"].includes(this.functionArguments.method)}}_processPixels(e){let t=e.pixelBlocks?.[0];if(null==t)return t;let{method:r,bandIndexes:n}=this.functionArguments,s=n.split(" ").map(e=>parseFloat(e));if(this.rasterInfo.storageInfo.isBsqTile){let{rawInputBandIds:e}=this,t=tt.has(this.functionArguments.method)?3:2,r=s.slice(0,t).map(t=>e.indexOf(t-1));s.splice(0,t,...r)}return He(t,{method:r,bandIndexes:s,equation:n,outputPixelType:this.outputPixelType})}_getWebGLParameters(){let e=this.functionArguments.bandIndexes.split(" ").map(e=>parseFloat(e)-1);2===e.length&&e.push(0);let t,r,n=this.isInputBandIdsSwizzled?[0,1,2]:e,s=new Float32Array(3),{method:i}=this.functionArguments;switch(i){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":t=qe([n[0],n[1],0]),r="ndxi";break;case"ndwi":t=qe([n[1],n[0],0]),r="ndxi";break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":t=qe([n[0],n[1],0]),r="sr";break;case"ci-g":case"ci-re":t=qe([n[0],n[1],0]),r="ci";break;case"savi":t=qe([n[0],n[1],0]),r="savi",s[0]=e[2]+1;break;case"tsavi":t=qe([n[0],n[1],0]),r="tsavi",s[0]=e[2]+1,s[1]=e[3]+1,s[2]=e[4]+1;break;case"msavi":t=qe([n[0],n[1],0]),r="msavi";break;case"gemi":t=qe([n[0],n[1],0]),r="gemi";break;case"pvi":t=qe([n[0],n[1],0]),r="tsavi",s[0]=e[2]+1,s[1]=e[3]+1;break;case"vari":t=qe([n[0],n[1],n[2]]),r="vari";break;case"mtvi2":t=qe([n[0],n[1],n[2]]),r="mtvi";break;case"rtvi-core":t=qe([n[0],n[1],n[2]]),r="rtvicore";break;case"evi":t=qe([n[0],n[1],n[2]]),r="evi";break;case"wndwi":t=qe([n[0],n[1],0]),r="wndwi",s[0]=e[3]?e[3]+1:.5;break;case"bai":t=qe([n[1],n[0],0]),r="bai";break;default:t=qe([0,1,2]),r="custom"}return{bandIndexMat3:t,indexType:r,adjustments:s,isOutputRounded:(0,l.zw)(this.outputPixelType)}}_getInputBandIds(e){if("custom"===this.functionArguments.method)return e;let t=this.functionArguments.bandIndexes.split(" ").map(e=>parseFloat(e)-1),r=e.length,n=t.map(e=>e>=r?r-1:e),s=tt.has(this.functionArguments.method)?3:2,i=n.slice(0,s).map(t=>e[t]);return 2===i.length&&i.push(0),i}_swizzleBandIds(e){let t=this.functionArguments.bandIndexes.split(" ").map(e=>parseFloat(e)-1);2===t.length&&t.push(0);let{method:r}=this.functionArguments,n=(["vari","mtvi2","rtvi-core","evi"].includes(r)?t.slice(0,3):"bai"===r||"ndwi"===r?[t[1],t[0]]:t.slice(0,2)).map(t=>e.indexOf(t));return n[2]??=n[1],this.isInputBandIdsSwizzled=!0,this.swizzledBandSelection=n,!1}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],rt.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:et,json:{write:!0,name:"rasterFunctionArguments"}})],rt.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],rt.prototype,"rasterArgumentNames",void 0),rt=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.BandArithmeticFunction")],rt);const nt=rt;var st,it=r(65864),ot=r(50498);const at=new Oe.J({1:"outside",2:"inside"},{useNumericKeys:!0});let lt=st=class extends c{constructor(){super(...arguments),this.clippingType="outside"}clone(){return new st({clippingGeometry:this.clippingGeometry.clone(),clippingType:this.clippingType})}};(0,o.Cg)([(0,a.MZ)({types:ot.yR,json:{read:it.rS,write:!0}})],lt.prototype,"clippingGeometry",void 0),(0,o.Cg)([(0,a.MZ)({json:{read:at.read,write:at.write}})],lt.prototype,"clippingType",void 0),lt=st=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ClipFunctionArguments")],lt);const ut=lt;var pt=r(34930),ct=r(37373);let ht=class extends w{constructor(){super(...arguments),this.functionName="Clip",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){let e=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType,this.rasterInfo=e;let{functionArguments:t}=this,{clippingGeometry:r,clippingType:n}=t;if(!r)return{success:!1,supportsGPU:!1,error:"missing clipping geometry"};if("outside"===n)try{let{spatialReference:t}=e,n="extent"===r.type?(0,ct._l)(r,t):(0,ct.uk)(r,t).extent;n&&(0,pt.Sd)(e,n)}catch{}return{success:!0,supportsGPU:!0}}_processPixels(e){return e.pixelBlocks?.[0]}_getWebGLParameters(){let{clippingGeometry:e,clippingType:t}=this.functionArguments;return{clippingGeometry:e.toJSON(),clippingType:t}}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],ht.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:ut,json:{write:!0,name:"rasterFunctionArguments"}})],ht.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],ht.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)()],ht.prototype,"isNoopProcess",void 0),ht=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ClipFunction")],ht);const mt=ht;var ft,gt=r(67369),dt=r(95349),yt=r(36005);let xt=ft=class extends c{castColormapName(e){if(!e)return null;let t=e.toLowerCase();return gt.L7.includes(t)?t:null}readColorRamp(e){return(0,dt.r)(e)}readColorRampName(e,t){if(!e)return null;let r=gt.kH.jsonValues.find(t=>t.toLowerCase()===e.toLowerCase());return r?gt.kH.fromJSON(r):null}clone(){return new ft({colormap:(0,i.o8)(this.colormap),colormapName:this.colormapName,colorRamp:this.colorRamp?.clone(),colorRampName:this.colorRampName})}};(0,o.Cg)([(0,a.MZ)({type:[[Number]],json:{write:!0}})],xt.prototype,"colormap",void 0),(0,o.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],xt.prototype,"colormapName",void 0),(0,o.Cg)([(0,a.wg)("colormapName")],xt.prototype,"castColormapName",null),(0,o.Cg)([(0,a.MZ)({types:dt.g,json:{write:!0}})],xt.prototype,"colorRamp",void 0),(0,o.Cg)([(0,yt.w)("colorRamp")],xt.prototype,"readColorRamp",null),(0,o.Cg)([(0,a.MZ)({type:gt.kH.apiValues,json:{type:gt.kH.jsonValues,write:gt.kH.write}})],xt.prototype,"colorRampName",void 0),(0,o.Cg)([(0,yt.w)("colorRampName")],xt.prototype,"readColorRampName",null),xt=ft=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ColormapFunctionArguments")],xt);const wt=xt,At=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[112,75,3],[113,76,3],[114,77,3],[115,77,3],[116,78,3],[117,79,3],[118,79,3],[119,80,3],[121,81,4],[122,82,4],[123,82,4],[124,83,4],[125,84,4],[126,84,4],[127,85,4],[128,86,4],[129,86,4],[130,87,4],[131,88,4],[132,89,4],[133,89,4],[134,90,4],[135,91,4],[136,91,4],[137,92,4],[138,93,4],[139,94,4],[140,94,4],[142,95,5],[143,96,5],[144,96,5],[145,97,5],[146,98,5],[147,99,5],[148,99,5],[149,100,5],[150,101,5],[151,101,5],[152,102,5],[153,103,5],[154,104,5],[155,104,5],[156,105,5],[157,106,5],[158,106,5],[159,107,5],[160,108,5],[161,108,5],[162,109,5],[164,110,6],[165,111,6],[166,111,6],[167,112,6],[168,113,6],[169,113,6],[170,114,6],[171,115,6],[172,116,6],[173,116,6],[174,117,6],[245,0,0],[245,5,0],[245,10,0],[246,15,0],[246,20,0],[246,25,0],[246,30,0],[247,35,0],[247,40,0],[247,45,0],[247,50,0],[247,55,0],[248,60,0],[248,65,0],[248,70,0],[248,75,0],[249,81,0],[249,86,0],[249,91,0],[249,96,0],[250,101,0],[250,106,0],[250,111,0],[250,116,0],[250,121,0],[251,126,0],[251,131,0],[251,136,0],[251,141,0],[252,146,0],[252,151,0],[252,156,0],[252,156,0],[251,159,0],[250,162,0],[249,165,0],[248,168,0],[247,171,0],[246,174,0],[245,177,0],[245,179,0],[244,182,0],[243,185,0],[242,188,0],[241,191,0],[240,194,0],[239,197,0],[238,200,0],[237,203,0],[236,206,0],[235,209,0],[234,212,0],[233,215,0],[232,218,0],[231,221,0],[230,224,0],[230,226,0],[229,229,0],[228,232,0],[227,235,0],[226,238,0],[225,241,0],[224,244,0],[223,247,0],[165,247,0],[163,244,0],[161,240,0],[158,237,0],[156,233,1],[154,230,1],[152,227,1],[149,223,1],[147,220,1],[145,216,1],[143,213,1],[140,210,2],[138,206,2],[136,203,2],[134,200,2],[132,196,2],[129,193,2],[127,189,2],[125,186,3],[123,183,3],[120,179,3],[118,176,3],[116,172,3],[114,169,3],[111,166,3],[109,162,4],[107,159,4],[105,155,4],[103,152,4],[100,149,4],[98,145,4],[96,142,4],[94,138,5],[91,135,5],[89,132,5],[87,128,5],[85,125,5],[82,121,5],[80,118,5],[78,115,6],[76,111,6],[73,108,6],[71,105,6],[69,101,6],[67,98,6],[65,94,6],[62,91,7],[60,88,7],[58,84,7],[56,81,7],[53,77,7],[51,74,7],[49,71,7],[47,67,8],[44,64,8],[42,60,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8]],vt=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[245,20,0],[245,24,0],[245,29,0],[245,31,0],[247,33,0],[247,33,0],[247,37,0],[247,41,0],[247,41,0],[247,41,0],[247,45,0],[247,45,0],[247,47,0],[247,49,0],[247,49,0],[247,54,0],[247,54,0],[247,56,0],[247,58,0],[247,58,0],[250,62,0],[250,62,0],[250,62,0],[250,67,0],[250,67,0],[250,67,0],[250,69,0],[250,71,0],[250,71,0],[250,75,0],[250,75,0],[250,78,0],[250,79,0],[250,79,0],[250,79,0],[250,81,0],[250,83,0],[250,83,0],[250,87,0],[250,87,0],[250,90,0],[250,92,0],[252,93,0],[252,93,0],[252,97,0],[252,97,0],[252,97,0],[252,97,0],[252,101,0],[252,101,0],[252,101,0],[252,101,0],[252,105,0],[252,105,0],[252,107,0],[252,109,0],[252,109,0],[252,113,13],[255,118,20],[255,119,23],[255,121,25],[255,126,33],[255,132,38],[255,133,40],[255,135,43],[255,141,48],[255,144,54],[255,150,59],[255,152,61],[255,153,64],[255,159,69],[255,163,77],[255,165,79],[255,168,82],[255,174,87],[255,176,92],[255,181,97],[255,183,99],[255,186,102],[255,191,107],[255,197,115],[255,201,120],[255,203,123],[255,205,125],[255,209,130],[255,214,138],[255,216,141],[255,218,143],[255,224,150],[255,228,156],[255,234,163],[255,236,165],[255,238,168],[255,243,173],[255,248,181],[255,252,186],[253,252,186],[250,252,187],[244,250,180],[238,247,176],[234,246,173],[231,245,169],[223,240,163],[217,237,157],[211,235,150],[205,233,146],[200,230,142],[195,227,136],[189,224,132],[184,222,126],[180,220,123],[174,217,119],[169,214,114],[163,212,108],[160,210,105],[154,207,101],[148,204,96],[143,201,93],[138,199,88],[134,197,84],[130,194,81],[126,191,77],[117,189,70],[115,186,68],[112,184,64],[106,181,60],[100,179,55],[94,176,49],[92,174,47],[90,173,45],[81,168,37],[75,166,33],[71,163,28],[66,160,24],[62,158,21],[56,156,14],[51,153,0],[51,153,0],[51,153,0],[50,150,0],[50,150,0],[50,150,0],[50,150,0],[49,148,0],[49,148,0],[49,148,0],[48,145,0],[48,145,0],[48,145,0],[48,145,0],[48,143,0],[48,143,0],[48,143,0],[48,143,0],[47,140,0],[47,140,0],[47,140,0],[47,140,0],[46,138,0],[46,138,0],[46,138,0],[46,138,0],[45,135,0],[45,135,0],[45,135,0],[45,135,0],[44,133,0],[44,133,0],[44,133,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[42,128,0],[42,128,0],[42,128,0],[42,125,0],[42,125,0],[42,125,0],[42,125,0],[41,122,0],[41,122,0],[41,122,0],[41,122,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[39,117,0],[39,117,0],[39,117,0],[39,117,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0]];function bt(e,t){let r=[],n=[];for(let t=0;t<e.length-1;t++)r.push({type:"algorithmic",algorithm:"esriHSVAlgorithm",fromColor:e[t].slice(1),toColor:e[t+1].slice(1)}),n.push(e[t+1][0]-e[t][0]);let s=e[e.length-1][0];return t??=n,(0,gt.iv)({type:"multipart",colorRamps:r},{numColors:s,weights:t})}let Ct=class extends w{constructor(){super(...arguments),this.functionName="Colormap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){let e=this.sourceRasterInfos[0];if(e.bandCount>1)return{success:!1,supportsGPU:!1,error:"colormap-function: source data must be single band"};let{colormap:t,colormapName:r,colorRamp:n,colorRampName:s}=this.functionArguments;if(!t?.length)if(n)this.colorRamp=n,t=(0,gt.R8)(n,{interpolateAlpha:!0});else if(s){let e=(0,gt.M5)(s);e&&(t=(0,gt.R8)(e),this.colorRamp=(0,dt.r)(e))}else r&&(t=function(e){let t;switch(e){case"elevation":t=bt([[0,0,191,191],[51,0,0,255],[102,255,0,255],[153,255,0,127],[204,191,63,127],[256,20,20,20]]);break;case"gray":t=(0,gt.iv)({type:"algorithmic",algorithm:"esriHSVAlgorithm",fromColor:[0,0,0],toColor:[255,255,255]});break;case"hillshade":t=bt([[0,38,41,54],[69,79,82,90],[131,156,156,156],[256,253,253,241]],[.268,.238,.495]);break;case"ndvi":t=At;break;case"ndvi2":t=function(){let e=bt([[0,255,255,255],[70,0,255,0],[80,205,173,193],[100,150,150,150],[110,120,51,100],[130,120,100,200],[140,28,3,144],[160,6,0,55],[180,10,25,30],[201,6,7,27]]);for(let t=e.length;t<256;t++)e.push([6,27,7]);return e}();break;case"ndvi3":t=vt;break;case"random":t=function(){let e=[];for(let t=0;t<256;t++){let t=[];for(let e=0;e<3;e++)t.push(Math.round(255*Math.random()));e.push(t)}return e}()}return t?(t=t.map((e,t)=>[t,...e]),t):null}(r));if(!t?.length)return{success:!1,supportsGPU:!1,error:"colormap-function: missing colormap argument"};let i=this._getOutputPixelType(e.pixelType);this.outputPixelType=i.startsWith("f")?"s32":i;let o=e.clone();return o.pixelType=this.outputPixelType,o.colormap=t,o.bandCount=1,this.rasterInfo=o,{success:!0,supportsGPU:!0}}_processPixels(e){let t=e.pixelBlocks?.[0];return!t||(0,l.zw)(t.pixelType)||(t=t.clone(),t.clamp(this.outputPixelType)),t}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Ct.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:wt,json:{write:!0,name:"rasterFunctionArguments"}})],Ct.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],Ct.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)()],Ct.prototype,"isNoopProcess",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Ct.prototype,"indexedColormap",void 0),(0,o.Cg)([(0,a.MZ)()],Ct.prototype,"colorRamp",void 0),Ct=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ColormapFunction")],Ct);const Mt=Ct;var Pt;let Tt=Pt=class extends c{clone(){return new Pt({raster:this.raster})}};Tt=Pt=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ColormapToRGBFunctionArguments")],Tt);const Rt=Tt;var Nt=r(4151),kt=r(88178);let It=class extends w{constructor(){super(...arguments),this.functionName="ColormapToRGB",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){let e=this.sourceRasterInfos[0];if(e.bandCount>1||!e.colormap?.length)return{success:!1,supportsGPU:!1,error:"colormap-to-rgb-function: source data must be single band with a colormap"};let t=e.clone();t.pixelType=this.outputPixelType=this._getOutputPixelType("u8"),this._removeStatsHistColormapVAT(t),t.bandCount=3,t.statistics=[{min:0,max:255,avg:100,stddev:20},{min:0,max:255,avg:100,stddev:20},{min:0,max:255,avg:100,stddev:20}],this.rasterInfo=t;let r=[...e.colormap].sort((e,t)=>e[0]-t[0]),{indexedColormap:n,offset:s}=(0,$e.zg)({colormap:r});return n?(this.lookup={indexedColormap:n,offset:s},{success:!0,supportsGPU:(0,kt.WN)(n)}):{success:!1,supportsGPU:!1,error:"colormap-to-rgb-function: the colormap is not supported"}}_processPixels(e){let t=e.pixelBlocks?.[0];if(!t||!this.lookup)return t;t=t.clone();let r=t.pixels[0],n=t.mask??new Uint8Array(r.length).fill(255),s=new Uint8Array(r.length),i=new Uint8Array(r.length),o=new Uint8Array(r.length),{indexedColormap:a,offset:l}=this.lookup,u=a.length;for(let e=0;e<r.length;e++)if(n[e]){let t=4*(r[e]-l);t<0||t>u-4?n[e]=0:(s[e]=a[t++],i[e]=a[t++],o[e]=a[t++])}return t.pixels=[s,i,o],t.statistics=[new Nt.A(0,255),new Nt.A(0,255),new Nt.A(0,255)],t.pixelType=this.outputPixelType,t}_getWebGLParameters(){return this.lookup}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],It.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:Rt,json:{write:!0,name:"rasterFunctionArguments"}})],It.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],It.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],It.prototype,"lookup",void 0),It=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ColormapToRGBFunction")],It);const St=It;var _t,Ft=r(43937);let Bt=_t=class extends c{constructor(){super(...arguments),this.rasters=[]}writeRasters(e,t){t.rasters=e.map(e=>"number"==typeof e||"string"==typeof e?e:e.toJSON())}clone(){return new _t({rasters:(0,i.o8)(this.rasters)})}};(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Bt.prototype,"rasters",void 0),(0,o.Cg)([(0,Ft.K)("rasters")],Bt.prototype,"writeRasters",null),Bt=_t=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.CompositeBandFunctionArguments")],Bt);const jt=Bt;let Zt=class extends w{constructor(){super(...arguments),this.functionName="CompositeBand",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){let{sourceRasterInfos:e}=this,t=e[0];this.outputPixelType=this._getOutputPixelType(t.pixelType);let r=t.clone();if(r.attributeTable=null,r.colormap=null,r.pixelType=this.outputPixelType,r.bandCount=e.map(({bandCount:e})=>e).reduce((e,t)=>e+t),e.every(({statistics:e})=>null!=e&&e.length)){let t=[];e.forEach(({statistics:e})=>null!=e&&t.push(...e)),r.statistics=t}if(e.every(({histograms:e})=>null!=e&&e.length)){let t=[];e.forEach(({histograms:e})=>null!=e&&t.push(...e)),r.histograms=t}r.multidimensionalInfo&&r.multidimensionalInfo.variables.forEach(t=>{let r=e.map(e=>e.multidimensionalInfo?.variables.find(({name:e})=>e===t.name)),n=r.map(e=>e?.statistics?.length?e.statistics:null),s=r.map(e=>e?.histograms?.length?e.histograms:null);t.statistics=n.every(e=>null!=e)?n.flat():null,t.histograms=s.every(e=>null!=e)?s.flat():null}),r.bandCount>1&&(r.colormap=null,r.attributeTable=null);let n=e.every(e=>e.keyProperties.BandProperties?.length)?e.flatMap(e=>e.keyProperties.BandProperties):void 0;return r.keyProperties={...r.keyProperties,BandProperties:n},this.rasterInfo=r,{success:!0,supportsGPU:r.bandCount<=3}}_processPixels(e){let{pixelBlocks:t}=e;return t&&null!=t?.[0]?(0,$e.Wy)(t):null}_getWebGLParameters(){return{bandCount:this.rasterInfo.bandCount}}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Zt.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:jt,json:{write:!0,name:"rasterFunctionArguments"}})],Zt.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],Zt.prototype,"rasterArgumentNames",void 0),Zt=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.CompositeBandFunction")],Zt);const zt=Zt,Gt=new Oe.J({0:"difference",1:"relative-difference",2:"categorical",3:"euclidean-distance",4:"angle-difference",5:"band-with-most-change"},{useNumericKeys:!0}),Et=new Oe.J({0:"all",1:"changed",2:"unchanged"},{useNumericKeys:!0});var Ot;let Dt=Ot=class extends c{constructor(){super(...arguments),this.method="difference",this.keepMethod="all",this.raster2=void 0}get rasters(){return[this.raster,this.raster2]}clone(){return new Ot({raster:this.raster,raster2:this.raster2,method:this.method,keepMethod:this.keepMethod})}};(0,o.Cg)([(0,Ye.e)(Gt)],Dt.prototype,"method",void 0),(0,o.Cg)([(0,Ye.e)(Et)],Dt.prototype,"keepMethod",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Dt.prototype,"raster2",void 0),(0,o.Cg)([(0,a.MZ)({readOnly:!0})],Dt.prototype,"rasters",null),Dt=Ot=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ComputeChangeFunctionArguments")],Dt);const Vt=Dt;var Ut=r(20437);let Lt=class extends w{constructor(){super(...arguments),this.functionName="ComputeChange",this.functionArguments=null,this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){let{method:e}=this.functionArguments,t=this.sourceRasterInfos[0].clone();if(this.outputPixelType=this._getOutputPixelType(t.pixelType),t.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(t),"categorical"===e){let e=this.sourceRasterInfos.map(e=>e.attributeTable),r=this._getFieldNames(e,"value"),n=e.map(e=>this._getClassFieldName(e));if(null==r[0]||null==r[1]||null==n[0]||null==n[1])return{success:!1,supportsGPU:!1,error:"both inputs must have proper attribute table with value and class fields"};this._updateAttributeTable(t,r,n)}return t.bandCount=1,this.rasterInfo=t,{success:!0,supportsGPU:"difference"===e||"relative-difference"===e}}_processPixels(e){let{pixelBlocks:t}=e;if(null==t?.[0]||null==t?.[1])return null;let{method:r}=this.functionArguments;return function(e,t,r,n){let[s,i]=e,o=(0,l.zw)(r)&&!(0,l.zw)(s.pixelType)&&!(0,l.zw)(i.pixelType),a=[s.mask,i.mask].filter(e=>e),u=g.A.combineBandMasks(a),p=e.map(e=>e.pixels[0]),{width:c,height:h}=s,m=g.A.createEmptyBand(r,c*h);switch(t){case"difference":case"relative-difference":!function(e){let{bands:[t,r],mask:n,isRelative:s,isRoundingNeeded:i,outBand:o}=e,a=t.length;for(let e=0;e<a;e++)if(!n||n[e]){let n=t[e]-r[e];if(s){let s=Math.max(Math.abs(t[e]),Math.abs(r[e]));n=0===s?0:n/s}o[e]=i?Math.round(n):n}}({bands:p,mask:u,outBand:m,isRoundingNeeded:o,isRelative:"relative-difference"===t});break;case"categorical":!function(e){let{bands:[t,r],categoryIndexLookups:[n,s],classNames:[i,o],mask:a,keepMethod:l,outBand:u}=e,p=t.length,c=i.length,h=o.length,m=c*h,f=m+1,g=m+2;for(let e=0;e<p;e++)if(!a||a[e]){let a=t[e],p=r[e],c=n[a],d=s[p],y=i[c],x=o[d];u[e]=null==c||null==d?m:"changed"===l&&y===x?f:"unchanged"===l&&y!==x?g:c*h+d}}({bands:p,mask:u,outBand:m,...n});break;case"euclidean-distance":!function(e){let{pixels:[t,r],mask:n,outBand:s}=e,i=t[0].length,o=t.length;for(let e=0;e<i;e++)if(!n||n[e]){let n=0;for(let s=0;s<o;s++){let i=t[s][e]-r[s][e];n+=i*i}s[e]=Math.sqrt(n)}}({pixels:e.map(e=>e.pixels),mask:u,outBand:m});break;case"angle-difference":!function(e){let{pixels:[t,r],mask:n,outBand:s}=e,i=t[0].length,o=t.length;for(let e=0;e<i;e++)if(!n||n[e]){let n=0,i=0,a=0;for(let s=0;s<o;s++){let o=t[s][e],l=r[s][e];n+=o*l,i+=o*o,a+=l*l}let l=Math.sqrt(i*a);s[e]=l?Math.acos(n/l):1.5707963267948966}}({pixels:e.map(e=>e.pixels),mask:u,outBand:m});break;case"band-with-most-change":!function(e){let{pixels:[t,r],mask:n,outBand:s}=e,i=t[0].length,o=t.length;for(let e=0;e<i;e++)if(!n||n[e]){let n=0,i=0;for(let s=0;s<o;s++){let o=Math.abs(t[s][e]-r[s][e]);o>n&&(n=o,i=s)}s[e]=i}}({pixels:e.map(e=>e.pixels),mask:u,outBand:m})}let f=new g.A({width:c,height:h,pixels:[m],pixelType:r,mask:u});return f.updateStatistics(),f}(t,r,this.outputPixelType,this._categoryConfig)}_getWebGLParameters(){let e=this.outputPixelType??"f32",[t,r]=(0,l.hP)(e),n=(0,l.zw)(e);return n&&(t-=1e-4,r+=1e-4),{method:this.functionArguments.method,domainRange:[t,r],isOutputRounded:n}}_updateAttributeTable(e,t,r){let n=this.sourceRasterInfos.map(e=>e.attributeTable),s=n.map((e,r)=>e.features.map(e=>e.attributes[t[r]])),i=n.map((e,t)=>e.features.map(e=>e.attributes[r[t]])),o=s.map(e=>{let t=[];return e.forEach((e,r)=>t[e]=r),t}),{keepMethod:a}=this.functionArguments;this._categoryConfig={categoryIndexLookups:o,classNames:i,keepMethod:a};let l=n[0].clone();l.fields=[new Ut.A({name:"OID",type:"oid"}),new Ut.A({name:"Value",type:"integer"}),new Ut.A({name:"ClassName",type:"string"}),new Ut.A({name:"Class_From",type:"string"}),new Ut.A({name:"Class_To",type:"string"})];let u=this._getFieldNames(n,"red"),p=this._getFieldNames(n,"green"),c=this._getFieldNames(n,"blue"),h=[],m=2===u.length&&2===p.length&&2===c.length;m&&(h.push(...n.map((e,t)=>e.features.map(e=>[e.attributes[u[t]],e.attributes[p[t]],e.attributes[c[t]]]))),l.fields.push(new Ut.A({name:"Red",type:"integer"}),new Ut.A({name:"Green",type:"integer"}),new Ut.A({name:"Blue",type:"integer"})));let f=l.features[0].clone();f.geometry=null;let g=[],[d,y]=s.map(e=>e.length),x=1;for(let e=0;e<d;e++){let t=i[0][e];for(let r=0;r<y;r++){let n=i[1][r];if("changed"===a&&t===n||"unchanged"===a&&t!==n)continue;let s=f.clone();s.attributes={OID:x++,Value:e*y+r,ClassName:t===n?t:`${t} -> ${n}`,Class_From:t,Class_To:n},m&&(s.attributes.Red=h[0][e][0]+h[1][r][0]>>1,s.attributes.Green=h[0][e][1]+h[1][r][1]>>1,s.attributes.Blue=h[0][e][2]+h[1][r][2]>>1),g.push(s)}}if("changed"===a){let e=f.clone();e.attributes={OID:x++,Value:d*y+1,ClassName:"No Change",Class_From:"Same",Class_To:"Same"},g.push(e)}else if("unchanged"===a){let e=f.clone();e.attributes={OID:x++,Value:d*y+2,ClassName:"Changed",Class_From:"Any",Class_To:"Any"},g.push(e)}l.features=g,e.attributeTable=l}_getFieldNames(e,t){return e.map(({fields:e})=>e.find(e=>e.name.toLowerCase()===t)?.name).filter(e=>e)}_getClassFieldName(e){return(e.fields.find(e=>"string"===e.type&&e.name.toLowerCase().startsWith("class"))??e.fields.find(e=>"string"===e.type&&e.name.toLowerCase().includes("class")||e.name.toLowerCase().includes("type")||e.name.toLowerCase().includes("name"))??e.fields.find(e=>"string"===e.type))?.name}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Lt.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:Vt,json:{write:!0,name:"rasterFunctionArguments"}})],Lt.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],Lt.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Lt.prototype,"_categoryConfig",void 0),Lt=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ComputeChangeFunction")],Lt);const Wt=Lt;var $t;let Kt=$t=class extends c{constructor(){super(...arguments),this.contrastOffset=0,this.brightnessOffset=0}clone(){return new $t({contrastOffset:this.contrastOffset,brightnessOffset:this.brightnessOffset,raster:this.raster})}};(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Kt.prototype,"contrastOffset",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Kt.prototype,"brightnessOffset",void 0),Kt=$t=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ContrastBrightnessFunctionArguments")],Kt);const Ht=Kt;var qt=r(51927);let Jt=class extends w{constructor(){super(...arguments),this.functionName="ContrastBrightness",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){let{sourceRasterInfos:e}=this,t=e[0];if("u8"!==t.pixelType)return{success:!1,supportsGPU:!1,error:"Only unsigned 8 bit raster is supported by ContrastBrightness function."};this.outputPixelType=this._getOutputPixelType("u8");let r=t.clone();this._removeStatsHistColormapVAT(r),this.rasterInfo=r;let{contrastOffset:n,brightnessOffset:s}=this.functionArguments;return this.lookup=(0,qt.zj)(n,s),{success:!0,supportsGPU:!0}}_processPixels(e){let t=e.pixelBlocks?.[0];return null==t?null:(0,$e.eH)(t,{lut:t.pixels.map(()=>this.lookup),offset:0,outputPixelType:"u8"})}_getWebGLParameters(){let{contrastOffset:e,brightnessOffset:t}=this.functionArguments;return{contrastOffset:e,brightnessOffset:t}}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Jt.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:Ht,json:{write:!0,name:"rasterFunctionArguments"}})],Jt.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],Jt.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Jt.prototype,"lookup",void 0),Jt=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ContrastBrightnessFunction")],Jt);const Xt=Jt;function Yt(e,t,r,n,s){let i=Math.floor(n/2);for(let n=0;n<i;n++)for(let i=0;i<t;i++)e[n*t+i]=e[(s-1-n)*t+i],e[(r-1-n)*t+i]=e[(r-s+n)*t+i];let o=Math.floor(s/2);for(let n=0;n<r;n++){let r=n*t;for(let n=0;n<o;n++)e[r+n]=e[r+s-1-n],e[r+t-n-1]=e[r+t+n-s]}}const Qt=new Map;function er(e,t,r,n,s,i,o){let a=new Float32Array(t*r),l=i.length,u=o?0:n,p=o?n:0,c=o?1:t;for(let o=u;o<r-u;o++){let r=o*t;for(let o=p;o<t-p;o++){if(s&&!s[r+o])continue;let t=0;for(let s=0;s<l;s++)t+=e[r+o+(s-n)*c]*i[s];a[r+o]=t}}return a}function tr(e,t,r,n,s,i,o){let a=new Float32Array(t*r),l=Math.floor(n/2),u=Math.floor(s/2);for(let p=l;p<r-l;p++){let r=p*t;for(let p=u;p<t-u;p++){if(i&&!i[r+p])continue;let c=0;for(let i=0;i<n;i++)for(let n=0;n<s;n++)c+=e[r+p+(i-l)*t+n-u]*o[i*s+n];a[r+p]=c}}return a}var rr;Qt.set(A.none,[0,0,0,0,1,0,0,0,0]),Qt.set(A.lineDetectionHorizontal,[-1,-1,-1,2,2,2,-1,-1,-1]),Qt.set(A.lineDetectionVertical,[-1,2,-1,-1,2,-1,-1,2,-1]),Qt.set(A.lineDetectionLeftDiagonal,[2,-1,-1,-1,2,-1,-1,-1,2]),Qt.set(A.lineDetectionRightDiagonal,[-1,-1,2,-1,2,-1,2,-1,-1]),Qt.set(A.gradientNorth,[-1,-2,-1,0,0,0,1,2,1]),Qt.set(A.gradientWest,[-1,0,1,-2,0,2,-1,0,1]),Qt.set(A.gradientEast,[1,0,-1,2,0,-2,1,0,-1]),Qt.set(A.gradientSouth,[1,2,1,0,0,0,-1,-2,-1]),Qt.set(A.gradientNorthEast,[0,-1,-2,1,0,-1,2,1,0]),Qt.set(A.gradientNorthWest,[-2,-1,0,-1,0,1,0,1,2]),Qt.set(A.smoothArithmeticMean,[.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111]),Qt.set(A.smoothing3x3,[.0625,.125,.0625,.125,.25,.125,.0625,.125,.0625]),Qt.set(A.smoothing5x5,[1,1,1,1,1,1,4,4,4,1,1,4,12,4,1,1,4,4,4,1,1,1,1,1,1]),Qt.set(A.sharpening3x3,[-1,-1,-1,-1,9,-1,-1,-1,-1]),Qt.set(A.sharpening5x5,[-1,-3,-4,-3,-1,-3,0,6,0,-3,-4,6,21,6,-4,-3,0,6,0,-3,-1,-3,-4,-3,-1]),Qt.set(A.laplacian3x3,[0,-1,0,-1,4,-1,0,-1,0]),Qt.set(A.laplacian5x5,[0,0,-1,0,0,0,-1,-2,-1,0,-1,-2,17,-2,-1,0,-1,-2,-1,0,0,0,-1,0,0]),Qt.set(A.sobelHorizontal,[-1,-2,-1,0,0,0,1,2,1]),Qt.set(A.sobelVertical,[-1,0,1,-2,0,2,-1,0,1]),Qt.set(A.sharpen,[0,-.25,0,-.25,2,-.25,0,-.25,0]),Qt.set(A.sharpen2,[-.25,-.25,-.25,-.25,3,-.25,-.25,-.25,-.25]),Qt.set(A.pointSpread,[-.627,.352,-.627,.352,2.923,.352,-.627,.352,-.627]);let nr=rr=class extends c{constructor(){super(...arguments),this.rows=3,this.cols=3,this.kernel=[0,0,0,0,1,0,0,0,0]}set convolutionType(e){this._set("convolutionType",e);let t=Qt.get(e);if(!t||e===A.userDefined||e===A.none)return;let r=Math.round(Math.sqrt(t.length));this._set("kernel",t),this._set("cols",r),this._set("rows",r)}clone(){return new rr({cols:this.cols,rows:this.rows,kernel:[...this.kernel],convolutionType:this.convolutionType,raster:(0,i.o8)(this.raster)})}};(0,o.Cg)([(0,a.MZ)({json:{type:Number,write:!0}})],nr.prototype,"rows",void 0),(0,o.Cg)([(0,a.MZ)({json:{type:Number,write:!0,name:"columns"}})],nr.prototype,"cols",void 0),(0,o.Cg)([(0,a.MZ)({json:{name:"type",type:Number,write:!0}})],nr.prototype,"convolutionType",null),(0,o.Cg)([(0,a.MZ)({json:{type:[Number],write:!0}})],nr.prototype,"kernel",void 0),nr=rr=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ConvolutionFunctionArguments")],nr);const sr=nr;let ir=class extends w{constructor(){super(...arguments),this.functionName="Convolution",this.rasterArgumentNames=["raster"]}get _normalizedKernel(){let{kernel:e,convolutionType:t}=this.functionArguments,r=e.reduce((e,t)=>e+t);return-1===t||0===r||1===r?e:e.map(e=>e/r)}_bindSourceRasters(){let{convolutionType:e,rows:t,cols:r,kernel:n}=this.functionArguments;if(!Object.values(A).includes(e))return{success:!1,supportsGPU:!1,error:`convolution-function: the specified kernel type is not supported ${e}`};if(e!==A.none&&t*r!==n.length)return{success:!1,supportsGPU:!1,error:"convolution-function: the specified rows and cols do not match the length of the kernel"};let s=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(s.pixelType);let i=s.clone();i.pixelType=this.outputPixelType;let o=[A.none,A.sharpen,A.sharpen2,A.sharpening3x3,A.sharpening5x5];return(-1===e||"u8"!==this.outputPixelType&&!o.includes(e))&&(i.statistics=null,i.histograms=null),i.colormap=null,i.attributeTable=null,this.rasterInfo=i,{success:!0,supportsGPU:n.length<=25}}_processPixels(e){let t=e.pixelBlocks?.[0];if(null==t||this.functionArguments.convolutionType===A.none)return t;let{rows:r,cols:n}=this.functionArguments,{_normalizedKernel:s}=this;return function(e,t){let r=function(e){let t=Math.sqrt(e.length),r=e.slice(0,t),n=[1];for(let r=1;r<t;r++){let s=null;for(let n=0;n<t;n++){let i=e[n+r*t],o=e[n];if(null==s)if(0===o){if(i)return{separable:!1,row:null,col:null}}else s=i/o;else if(i/o!==s)return{separable:!1,row:null,col:null}}if(null==s)return{separable:!1,row:null,col:null};n.push(s)}return{separable:!0,row:r,col:n}}(t.kernel),n=!1!==t.mirrorEdges,s=r.separable?function(e,t,r,n=!0){let{pixels:s,width:i,height:o,pixelType:a,mask:l}=e,u=s.length,p=[],c=t.length,h=r.length,m=Math.floor(c/2),f=Math.floor(h/2);for(let e=0;e<u;e++){let a=er(s[e],i,o,m,l,t,!0);a=er(a,i,o,f,l,r,!1),n&&Yt(a,i,o,c,h),p.push(a)}return new g.A({width:i,height:o,pixelType:a,pixels:p,mask:l})}(e,r.row,r.col,n):function(e,t,r=!0){let{pixels:n,width:s,height:i,pixelType:o,mask:a}=e,l=n.length,u=[],{kernel:p,rows:c,cols:h}=t;for(let e=0;e<l;e++){let t=tr(n[e],s,i,c,h,a,p);r&&Yt(t,s,i,c,h),u.push(t)}return new g.A({width:s,height:i,pixelType:o,pixels:u,mask:a})}(e,t,n),{outputPixelType:i}=t;return i&&s.clamp(i),s}(t,{kernel:s,rows:r,cols:n,outputPixelType:this.outputPixelType})}_getWebGLParameters(){let e=new Float32Array(25),{rows:t,cols:r}=this.functionArguments,{_normalizedKernel:n}=this;for(let s=0;s<t;s++)for(let t=0;t<r;t++)e[5*s+t]=n[s*r+t];return{kernelRows:t,kernelCols:r,kernel:e,clampRange:(0,l.hP)(this.outputPixelType)}}_getNeighborhoodSize(){let{rows:e,cols:t}=this.functionArguments;return{rows:e,cols:t}}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],ir.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:sr,json:{write:!0,name:"rasterFunctionArguments"}})],ir.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],ir.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)()],ir.prototype,"_normalizedKernel",null),ir=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ConvolutionFunction")],ir);const or=ir;var ar;const lr=new Oe.J({0:"standard",1:"planform",2:"profile"},{useNumericKeys:!0});let ur=ar=class extends c{constructor(){super(...arguments),this.curvatureType="standard",this.zFactor=1}readCurvatureType(e,t){return lr.fromJSON(t.type??t.curvatureType??0)}clone(){return new ar({curvatureType:this.curvatureType,zFactor:this.zFactor,raster:this.raster})}};(0,o.Cg)([(0,a.MZ)({json:{write:{target:"type"}}}),(0,Ye.e)(lr)],ur.prototype,"curvatureType",void 0),(0,o.Cg)([(0,yt.w)("curvatureType",["type","curvatureType"])],ur.prototype,"readCurvatureType",null),(0,o.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],ur.prototype,"zFactor",void 0),ur=ar=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.CurvatureFunctionArguments")],ur);const pr=ur;let cr=class extends w{constructor(){super(...arguments),this.functionName="Curvature",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");let e=this.sourceRasterInfos[0].clone();return e.pixelType=this.outputPixelType,e.bandCount=1,this._removeStatsHistColormapVAT(e),this.rasterInfo=e,this.isGCS=e.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(e){let t=e.pixelBlocks?.[0];if(null==t)return null;let{zFactor:r,curvatureType:n}=this.functionArguments,{extent:s,primaryPixelSizes:i}=e,o=i?.[0]??(s?{x:s.width/t.width,y:s.height/t.height}:{x:1,y:1}),a=this.isGCS&&r>=1?r*ze.rk:r;return(0,ze.E0)(t,{zFactor:a,curvatureType:n,resolution:o})}_getWebGLParameters(){let{zFactor:e,curvatureType:t}=this.functionArguments;return{curvatureType:t,zFactor:this.isGCS&&e>=1?e*ze.rk:e}}_getNeighborhoodSize(){return{rows:3,cols:3}}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],cr.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:pr,json:{write:!0,name:"rasterFunctionArguments"}})],cr.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],cr.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],cr.prototype,"isGCS",void 0),cr=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.CurvatureFunction")],cr);const hr=cr;var mr;let fr=mr=class extends c{constructor(){super(...arguments),this.bandIds=[],this.bandNames=[],this.bandWavelengths=[],this.missingBandAction=0}clone(){return new mr({bandIds:this.bandIds?.slice(),bandNames:this.bandNames?.slice(),bandWavelengths:this.bandWavelengths?.slice(),missingBandAction:this.missingBandAction,method:this.method,wavelengthMatchTolerance:this.wavelengthMatchTolerance})}};(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],fr.prototype,"bandIds",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],fr.prototype,"bandNames",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],fr.prototype,"bandWavelengths",void 0),(0,o.Cg)([(0,Ye.e)({0:"name",1:"wavelength",2:"id"})],fr.prototype,"method",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],fr.prototype,"missingBandAction",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],fr.prototype,"wavelengthMatchTolerance",void 0),fr=mr=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ExtractBandFunctionArguments")],fr);const gr=fr;let dr=class extends w{constructor(){super(...arguments),this.functionName="ExtractBand",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){let{functionArguments:e,sourceRasterInfos:t}=this,r=t[0],{method:n,bandNames:s,bandWavelengths:i,bandIds:o,missingBandAction:a}=e,l=s?.length&&("name"===n||"id"!==n&&!o?.length),u=i?.length&&("wavelength"===n||"id"!==n&&!o?.length),p=1===a,c=l?function(e,t){let r=e.bandInfos.map(({name:e})=>e.toLowerCase()),n=[];for(let e=0;e<t.length;e++){let s=t[e].toLowerCase(),i=r.indexOf(s);if(-1===i&&"nearinfrared"===s&&(i=r.findIndex(e=>e.startsWith("nearinfrared_1")),-1===i&&(i=r.findIndex(e=>e.startsWith("nearinfrared")))),-1===i)return null;n.push(i)}return n}(r,s):u?function(e,t,{wavelengthMatchTolerance:r},n){let{bandInfos:s}=e,i=[];for(let e=0;e<s.length;e++){let{minWavelength:t,maxWavelength:r}=s[e];if(!t||!r)return null;i.push({minWavelength:t,maxWavelength:r})}let o=[];for(let e=0;e<t.length;e++){let s=t[e],a=!1,l=-1,u=Number.MAX_VALUE;for(let e=0;e<i.length;e++){let t=i[e],r=s>=t.minWavelength&&s<=t.maxWavelength,n=Math.abs(s-(t.minWavelength+t.maxWavelength)/2);r?n<u&&(a=!0,l=e,u=n):!a&&n<u&&(l=e,u=n)}if(!a&&r&&u<r&&(a=!0),!a&&n)return null;o.push(l)}return o}(r,i,this.functionArguments,p):function(e,t,r){let{bandCount:n}=e;return!t?.length||r&&t.some(e=>e<0||e>=n)?null:t}(r,o,p);if(null==c)return{success:!1,supportsGPU:!1,error:`extract-band-function: Invalid ${l?"band names":u?"band wavelengths":"band ids"} for the imagery data source`};this.functionArguments.bandIds=c,this.functionArguments.method="id",this.outputPixelType=this._getOutputPixelType(r.pixelType);let h=r.clone();h.pixelType=this.outputPixelType,h.bandCount=c.length;let{statistics:m,histograms:f}=h;null!=m&&m.length&&(h.statistics=c.map(e=>m[e]||m[m.length-1])),null!=f&&f.length&&(h.histograms=c.map(e=>f[e]||f[f.length-1])),h.multidimensionalInfo&&h.multidimensionalInfo.variables.forEach(e=>{let{statistics:t,histograms:r}=e;null!=t&&t.length&&(e.statistics=c.map(e=>t[e]||t[t.length-1])),null!=r&&r.length&&(e.histograms=c.map(e=>r[e]||r[r.length-1]))});let g=h.keyProperties?.BandProperties;return g?.length&&(g=c.map(e=>e>=g.length?g[g.length-1]:g[e]),h.keyProperties={...h.keyProperties,BandProperties:g}),this.rasterInfo=h,{success:!0,supportsGPU:h.bandCount<=3}}_processPixels(e){let t=e.pixelBlocks?.[0];if(null==t)return null;let{bandIds:r}=this.functionArguments;if(this.rasterInfo.storageInfo.isBsqTile){let{rawInputBandIds:e}=this;r=r.map(t=>e.indexOf(t))}else{let e=t.pixels.length;r=r.map(t=>t>=e?e-1:t)}return t.extractBands(r)}_getWebGLParameters(){let e;if(this.isInputBandIdsSwizzled)e=this.swizzledBandSelection.length?this.swizzledBandSelection:[0,1,2];else{e=[...this.functionArguments.bandIds],0===e.length?e=[0,1,2]:e.length<3&&(e[1]=e[1]??e[0],e[2]=e[2]??e[1]);for(let t=0;t<3;t++)e[t]=Math.min(e[t],2)}return{bandIndexMat3:qe(e)}}_getInputBandIds(e){let t=e.length;return this.functionArguments.bandIds.map(e=>e>=t?t-1:e).map(t=>e[t])}_swizzleBandIds(e){let t=this.functionArguments.bandIds.map(t=>e.indexOf(t));return this.isInputBandIdsSwizzled=!0,t[1]??=t[0],t[2]??=t[1],this.swizzledBandSelection=t,!1}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],dr.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:gr,json:{write:!0,name:"rasterFunctionArguments"}})],dr.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],dr.prototype,"rasterArgumentNames",void 0),dr=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ExtractBandFunction")],dr);const yr=dr;function xr(e,t,r,n){let{pixels:s,width:i,height:o}=e,a=s.length,u=r.startsWith("f"),p=!u,[c,h]=(0,l.hP)(r),m=i*o,f=g.A.createEmptyBand(r,m);for(let e=0;e<o;e++){let r=e*i;for(let e=0;e<i;e++,r++)if(!n||n[r]){let e=0;for(let n=0;n<a;n++)e+=t[n]*s[n][r];u||(e=Math.round(e),p&&(e=e>h?h:e<c?c:e)),f[r]=e}}return f}var wr;let Ar=wr=class extends c{clone(){return new wr({conversionParameters:[...this.conversionParameters],raster:this.raster})}};(0,o.Cg)([(0,a.MZ)({type:[Number],json:{write:!0}})],Ar.prototype,"conversionParameters",void 0),Ar=wr=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.GrayscaleFunctionArguments")],Ar);const vr=Ar;let br=class extends w{constructor(){super(...arguments),this.functionName="Grayscale",this.functionArguments=null,this.rasterArgumentNames=["raster"]}get _normalizedWeights(){let{conversionParameters:e}=this.functionArguments,t=e.reduce((e,t)=>e+t);return e.map(e=>e/t)}_bindSourceRasters(){let{conversionParameters:e}=this.functionArguments;if(!e?.length)return{success:!1,supportsGPU:!1,error:"missing valid conversion parameters."};let t=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(t.pixelType),t.pixelType=this.outputPixelType;let r=3===e.length||3===t.bandCount&&e.length>3;return t.bandCount=1,this._removeStatsHistColormapVAT(t),this.rasterInfo=t,{success:!0,supportsGPU:r}}_processPixels(e){let t=e.pixelBlocks?.[0];return null==t?null:function(e,t,r){let{width:n,height:s,mask:i,bandMasks:o}=e,a=o?.length?g.A.combineBandMasks(o):i,l=xr(e,t,r,a),u=new g.A({width:n,height:s,pixels:[l],pixelType:r,mask:a});return u.updateStatistics(),u}(t,this._normalizedWeights,this.outputPixelType)}_getWebGLParameters(){return{weights:this._normalizedWeights}}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],br.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:vr,json:{write:!0,name:"rasterFunctionArguments"}})],br.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],br.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)()],br.prototype,"_normalizedWeights",null),br=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.GrayscaleFunction")],br);const Cr=br;var Mr;const Pr=new Oe.J({0:"traditional",1:"multi-directional"},{useNumericKeys:!0}),Tr=new Oe.J({1:"degree",2:"percent-rise",3:"scaled"},{useNumericKeys:!0});let Rr=Mr=class extends c{constructor(){super(...arguments),this.altitude=45,this.azimuth=315,this.hillshadeType="traditional",this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.slopeType="degree",this.zFactor=1,this.removeEdgeEffect=!1}clone(){return new Mr({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,slopeType:this.slopeType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,removeEdgeEffect:this.removeEdgeEffect,raster:this.raster})}};(0,o.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],Rr.prototype,"altitude",void 0),(0,o.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],Rr.prototype,"azimuth",void 0),(0,o.Cg)([(0,a.MZ)(),(0,Ye.e)(Pr)],Rr.prototype,"hillshadeType",void 0),(0,o.Cg)([(0,a.MZ)({type:Number,json:{write:!0,name:"psPower"}})],Rr.prototype,"pixelSizePower",void 0),(0,o.Cg)([(0,a.MZ)({type:Number,json:{write:!0,name:"psZFactor"}})],Rr.prototype,"pixelSizeFactor",void 0),(0,o.Cg)([(0,a.MZ)(),(0,Ye.e)(Tr)],Rr.prototype,"slopeType",void 0),(0,o.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],Rr.prototype,"zFactor",void 0),(0,o.Cg)([(0,a.MZ)({type:Boolean,json:{write:!0}})],Rr.prototype,"removeEdgeEffect",void 0),Rr=Mr=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.HillshadeFunctionArguments")],Rr);const Nr=Rr;let kr=class extends w{constructor(){super(...arguments),this.functionName="Hillshade",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){let e=this.sourceRasterInfos[0];if(e.bandCount>1)return{success:!1,supportsGPU:!1,error:"hillshade-function: source data must be single band"};this.outputPixelType=this._getOutputPixelType("u8");let t=e.clone();return this._removeStatsHistColormapVAT(t),t.pixelType=this.outputPixelType,t.bandCount=1,t.statistics=[{min:0,max:255,avg:60,stddev:10}],this.rasterInfo=t,this.isGCS=t.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(e){let t=e.pixelBlocks?.[0];if(!t)return null;let{extent:r,primaryPixelSizes:n}=e,s=n?.[0]??(r?{x:r.width/t.width,y:r.height/t.height}:{x:1,y:1}),i=(0,ze.PP)(this.functionArguments,s,this.isGCS),o=(0,ze.fw)(t,i);return o.pixelType=this.outputPixelType,o}_getWebGLParameters(){let e=(0,ze.PP)(this.functionArguments,{x:1,y:1},this.isGCS),t=(0,ze.ng)(e),{slopeType:r,zFactor:n,pixelSizeFactor:s,pixelSizePower:i}=this.functionArguments,o="scaled"===r,a=(0,l.zw)(this.outputPixelType);return{...t,zFactor:n,gcsFactor:this.isGCS?ze.rk:1,pixelSizeFactor:o?s:0,pixelSizePower:o?i:0,isOutputRounded:a}}_getNeighborhoodSize(){return{rows:3,cols:3}}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],kr.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:Nr,json:{write:!0,name:"rasterFunctionArguments"}})],kr.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],kr.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],kr.prototype,"isGCS",void 0),kr=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.HillshadeFunction")],kr);const Ir=kr;var Sr;let _r=Sr=class extends c{constructor(){super(...arguments),this.rasters=[],this.processAsMultiband=!0}writeRasters(e,t){t.rasters=e.map(e=>"number"==typeof e||"string"==typeof e?e:e.toJSON())}clone(){return new Sr({operation:this.operation,processAsMultiband:this.processAsMultiband,rasters:(0,i.o8)(this.rasters)})}};(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],_r.prototype,"operation",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],_r.prototype,"rasters",void 0),(0,o.Cg)([(0,Ft.K)("rasters")],_r.prototype,"writeRasters",null),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],_r.prototype,"processAsMultiband",void 0),_r=Sr=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.LocalFunctionArguments")],_r);const Fr=_r;let Br=class extends w{constructor(){super(...arguments),this.functionName="Local",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){let{sourceRasterInfos:e}=this,t=e[0],{bandCount:r}=t,{processAsMultiband:n}=this.functionArguments;if(e.some(e=>e.bandCount!==r))return{success:!1,supportsGPU:!1,error:"local-function: input rasters do not have same band count"};let{operation:s,rasters:i}=this.functionArguments,o=R[s];if(!(999===o||i.length===o||i.length<=1&&1===o))return{success:!1,supportsGPU:!1,error:`local-function: the length of functionArguments.rasters does not match operation's requirement: ${o}`};let a=t.clone();return a.bandCount=999!==o||n?r:1,this._removeStatsHistColormapVAT(a),this._updateStatistics(a),this._updatePixelType(a),this.rasterInfo=a,{success:!0,supportsGPU:1===a.bandCount&&o<=3}}_processPixels(e){let{pixelBlocks:t}=e;return null==t||t.some(e=>null==e)?null:Se(t,this.functionArguments.operation,{processAsMultiband:this.functionArguments.processAsMultiband,outputPixelType:this.outputPixelType??void 0})}_getWebGLParameters(){let{operation:e}=this.functionArguments,t=R[e],r=Object.keys(M).find(t=>M[t]===e)?.toLowerCase()??"undefined",n=this.outputPixelType??"f32",[s,i]=(0,l.hP)(n),o=(0,l.zw)(n);return o&&(s-=1e-4,i+=1e-4),{imageCount:t,operationName:r,domainRange:[s,i],isOutputRounded:o}}_updateStatistics(e){let t=this.sourceRasterInfos[0],{operation:r}=this.functionArguments,n=T(r)?.domain;if(n){e.statistics=[];for(let t=0;t<e.bandCount;t++)e.statistics[t]={min:n[0],max:n[1],avg:(n[0]+n[1])/2,stddev:(n[0]+n[1])/10}}else 45===r&&t.statistics?.length&&(e.statistics=t.statistics.map(e=>({min:-e.max,max:-e.min,avg:null==e.avg?void 0:-e.avg,stddev:null==e.stddev?void 0:-e.stddev})))}_updatePixelType(e){let{statistics:t,pixelType:r}=this.sourceRasterInfos[0],{operation:n}=this.functionArguments,{domain:s,isInteger:i}=T(n)??{domain:null,isInteger:!1},o="f32";if(s&&i)o=(0,l.X1)(s[0],s[1]);else if(30===n){let e=t?.[0];o=e?(0,l.X1)(e.min,e.max):(0,l.zw)(r)?r:"s32"}else if(45===n&&(0,l.zw)(r)){let e=t?.map(({max:e})=>-e),n=t?.map(({min:e})=>-e),s=e?.length?Math.min(...e):null,i=n?.length?Math.min(...n):null;o=null!=s&&null!=i?(0,l.X1)(s,i):r.startsWith("s")?r.replace("s","u"):"u1"===r||"u2"===r||"u4"===r?"s8":"u8"===r?"s16":"s32"}e.pixelType=this.outputPixelType=this._getOutputPixelType(o)}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Br.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:Fr,json:{write:!0,name:"rasterFunctionArguments"}})],Br.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],Br.prototype,"rasterArgumentNames",void 0),Br=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.LocalFunction")],Br);const jr=Br;var Zr,zr=r(34727);let Gr=Zr=class extends c{constructor(){super(...arguments),this.includedRanges=null,this.noDataValues=null,this.noDataInterpretation=0}get normalizedNoDataValues(){let{noDataValues:e}=this;if(!e?.length)return null;let t=!1,r=e.map(e=>{if("number"==typeof e)return t=!0,[e];if("string"==typeof e){let r=e.trim().split(" ").filter(e=>""!==e.trim()).map(e=>Number(e));return t||=r.length>0,0===r.length?null:r}return null});return t?r:null}clone(){return new Zr({includedRanges:this.includedRanges?.slice()??[],noDataValues:this.noDataValues?.slice()??[],noDataInterpretation:this.noDataInterpretation})}};(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Gr.prototype,"includedRanges",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Gr.prototype,"noDataValues",void 0),(0,o.Cg)([(0,a.MZ)()],Gr.prototype,"normalizedNoDataValues",null),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Gr.prototype,"noDataInterpretation",void 0),Gr=Zr=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.MaskFunctionArguments")],Gr);const Er=Gr;let Or=class extends w{constructor(){super(...arguments),this.functionName="Mask",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){let e=this.sourceRasterInfos[0].clone(),{pixelType:t}=e;this.outputPixelType=this._getOutputPixelType(t),e.pixelType=this.outputPixelType,this.rasterInfo=e;let{includedRanges:r,normalizedNoDataValues:n}=this.functionArguments;if(!r?.length&&!n?.length)return{success:!1,supportsGPU:!1,error:"missing includedRanges or noDataValues argument"};let s=[];for(let i=0;i<e.bandCount;i++){let e=(0,$e.Wt)(t,r?.slice(2*i,2*i+2),n?.[i]);if(null==e){s=null;break}s.push(e)}this.lookups=s;let i=null!=n&&n.every(e=>e?.length===n[0]?.length);return{success:!0,supportsGPU:(!r||r.length<=18)&&(!n||i&&n[0].length<=9)}}_processPixels(e){let t=e.pixelBlocks?.[0];if(null==t)return null;let{outputPixelType:r,lookups:n}=this,{includedRanges:s,noDataInterpretation:i,normalizedNoDataValues:o}=this.functionArguments;return(0,$e.dK)(t,{includedRanges:s,noDataValues:o,outputPixelType:r,matchAll:1===i,lookups:n})}_getWebGLParameters(){let{includedRanges:e,normalizedNoDataValues:t}=this.functionArguments,r=new Float32Array(9);r.fill(zr.pq),t?.[0]?.length&&r.set(t[0]);let n=new Float32Array(6);for(let t=0;t<n.length;t+=2)n[t]=e?.[t]??-zr.pq,n[t+1]=e?.[t+1]??zr.pq;return e?.length&&n.set(e),{bandCount:this.sourceRasterInfos[0].bandCount,noDataValues:r,includedRanges:n}}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Or.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:Er,json:{write:!0,name:"rasterFunctionArguments"}})],Or.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],Or.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Or.prototype,"lookups",void 0),Or=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.MaskFunction")],Or);const Dr=Or;var Vr;let Ur=Vr=class extends c{constructor(){super(...arguments),this.visibleBandID=0,this.infraredBandID=1,this.scientificOutput=!1}clone(){let{visibleBandID:e,infraredBandID:t,scientificOutput:r}=this;return new Vr({visibleBandID:e,infraredBandID:t,scientificOutput:r})}};(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Ur.prototype,"visibleBandID",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Ur.prototype,"infraredBandID",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Ur.prototype,"scientificOutput",void 0),Ur=Vr=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.NDVIFunctionArguments")],Ur);const Lr=Ur;let Wr=class extends w{constructor(){super(...arguments),this.functionName="NDVI",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){let{scientificOutput:e,visibleBandID:t,infraredBandID:r}=this.functionArguments;this.outputPixelType=this._getOutputPixelType(e?"f32":"u8");let n=this.sourceRasterInfos[0],s=Math.max(t,r);if(n.bandCount<2||s>=n.bandCount)return{success:!1,supportsGPU:!1,error:"ndvi-function: source raster has insufficient amount of raster bands"};if(t<0||r<0)return{success:!1,supportsGPU:!1,error:"ndvi-function: invalid visible or infrared band id"};let i=n.clone();i.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(i),i.bandCount=1,i.keyProperties={...i.keyProperties,BandProperties:void 0};let[o,a,l,u]=e?[-1,1,0,.1]:[0,200,100,10];return i.statistics=[{min:o,max:a,avg:l,stddev:u}],this.rasterInfo=i,{success:!0,supportsGPU:!0}}_processPixels(e){let t=e.pixelBlocks?.[0];if(null==t)return null;let{visibleBandID:r,infraredBandID:n,scientificOutput:s}=this.functionArguments;if(this.rasterInfo.storageInfo.isBsqTile){let{rawInputBandIds:e}=this;n=e.indexOf(n),r=e.indexOf(r)}return function(e,t,r,n){let{mask:s,pixels:i,width:o,height:a}=e,l=i[r],u=i[t],p=u.length,c=n?new Uint8Array(p):new Float32Array(p),h=n?100:1,m=n?100.5:0;for(let e=0;e<p;e++)if(null==s||s[e]){let t=l[e],r=u[e],n=t+r;n&&(c[e]=(t-r)/n*h+m)}let f=new g.A({width:o,height:a,mask:s,pixelType:n?"u8":"f32",pixels:[c]});return f.updateStatistics(),f}(t,r,n,!s)}_getWebGLParameters(){let{visibleBandID:e,infraredBandID:t,scientificOutput:r}=this.functionArguments;return{bandIndexMat3:qe(this.isInputBandIdsSwizzled?[0,1,2]:[t,e,0]),scaled:!r}}_getInputBandIds(e){let{visibleBandID:t,infraredBandID:r}=this.functionArguments;return[r,t,0].map(t=>e[t])}_swizzleBandIds(e){let{visibleBandID:t,infraredBandID:r}=this.functionArguments,n=[t,r].map(t=>e.indexOf(t));return n[2]=n[1],this.isInputBandIdsSwizzled=!0,this.swizzledBandSelection=n,!1}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Wr.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:Lr,json:{write:!0,name:"rasterFunctionArguments"}})],Wr.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],Wr.prototype,"rasterArgumentNames",void 0),Wr=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.NDVIFunction")],Wr);const $r=Wr;var Kr;let Hr=Kr=class extends c{constructor(){super(...arguments),this.inputRanges=null,this.outputValues=null,this.noDataRanges=null,this.allowUnmatched=!1,this.isLastInputRangeInclusive=!1}clone(){return new Kr({inputRanges:[...this.inputRanges],outputValues:[...this.outputValues],noDataRanges:[...this.noDataRanges],allowUnmatched:this.allowUnmatched,isLastInputRangeInclusive:this.isLastInputRangeInclusive})}};(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Hr.prototype,"inputRanges",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Hr.prototype,"outputValues",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Hr.prototype,"noDataRanges",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Hr.prototype,"allowUnmatched",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Hr.prototype,"replacementValue",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Hr.prototype,"isLastInputRangeInclusive",void 0),Hr=Kr=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.RemapFunctionArguments")],Hr);const qr=Hr;let Jr=class extends w{constructor(){super(...arguments),this.functionName="Remap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){let e=this.sourceRasterInfos[0].clone(),{pixelType:t}=e;e.bandCount=1;let{statistics:r}=e;this._removeStatsHistColormapVAT(e);let{allowUnmatched:n,replacementValue:s,outputValues:i,inputRanges:o,noDataRanges:a,isLastInputRangeInclusive:u}=this.functionArguments,p="unknown"===this.outputPixelType||null==this.outputPixelType;if(this.outputPixelType=this._getOutputPixelType(t),i?.length){let o=r?.[0];if(n&&null==s){let t=o?.min??i[0],r=o?.max??i[0];t=Math.min.apply(null,[...i,t]),r=Math.max.apply(null,[...i,r]),e.statistics=[{min:t,max:r,avg:o?.avg??0,stddev:o?.stddev??-1}]}else{let t=i[0],r=t;for(let e=0;e<i.length;e++)t=t>i[e]?i[e]:t,r=r>i[e]?r:i[e];n&&null!=s&&(t=Math.min(t,s),r=Math.max(r,s)),e.statistics=[{min:t,max:r,avg:o?.avg??0,stddev:o?.stddev??-1}]}if(p){let{min:r,max:o}=e.statistics[0],a=["u8","s8","u16","s16","u32","s32","f32"],u=a.find(e=>{let[t,n]=(0,l.hP)(e);return r>=t&&o<=n})??"f64";this.outputPixelType=i.some(e=>Math.floor(e)!==e)?"f64"===u?"f64":"f32":n&&null==s&&a.indexOf(t)>a.indexOf(u)?t:u}}return e.pixelType=this.outputPixelType,this.rasterInfo=e,this.lookup=n?null:(0,$e.XU)({srcPixelType:t,inputRanges:o,outputValues:i,noDataRanges:a,allowUnmatched:n,isLastInputRangeInclusive:u,outputPixelType:this.outputPixelType}),{success:!0,supportsGPU:(!i||i.length<=9)&&(!a||a.length<=9)}}_processPixels(e){let t=e.pixelBlocks?.[0];if(null==t)return null;let{lookup:r,outputPixelType:n}=this;if(r){let e=(0,$e.eH)(t,{lut:[r.lut],offset:r.offset,outputPixelType:n});return null!=e&&r.mask&&(e.mask=(0,$e.UK)(t.pixels[0],t.mask,r.mask,r.offset,"u8")),e}let{inputRanges:s,outputValues:i,noDataRanges:o,allowUnmatched:a,isLastInputRangeInclusive:l,replacementValue:u}=this.functionArguments;return(0,$e.Ew)(t,{inputRanges:s,outputValues:i,noDataRanges:o,outputPixelType:n,allowUnmatched:a,isLastInputRangeInclusive:l,replacementValue:u})}_getWebGLParameters(){let{allowUnmatched:e,noDataRanges:t,isLastInputRangeInclusive:r}=this.functionArguments,n=this.functionArguments.inputRanges??[],s=this.functionArguments.outputValues??[],i=(0,$e.bL)(n,s,r),o=new Float32Array(18);return o.fill(zr.pq),t?.length&&o.set(t),{allowUnmatched:e,rangeMaps:i,noDataRanges:o,clampRange:(0,l.hP)(this.outputPixelType),replacementValue:this.functionArguments.replacementValue}}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Jr.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:qr,json:{write:!0,name:"rasterFunctionArguments"}})],Jr.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],Jr.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Jr.prototype,"lookup",void 0),Jr=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.RemapFunction")],Jr);const Xr=Jr;var Yr;let Qr=Yr=class extends Nr{readColorRamp(e){if("string"==typeof e){let t=gt.kH.jsonValues.find(t=>t.toLowerCase()===e.toLowerCase());return t?(0,gt.M5)(gt.kH.fromJSON(t)):null}return"toJSON"in e?e.toJSON():e}clone(){return new Yr({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,slopeType:this.slopeType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,removeEdgeEffect:this.removeEdgeEffect,colorRamp:this.colorRamp,colormap:this.colormap,raster:this.raster})}};(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Qr.prototype,"colorRamp",void 0),(0,o.Cg)([(0,yt.w)("colorRamp")],Qr.prototype,"readColorRamp",null),(0,o.Cg)([(0,a.MZ)({type:[[Number]],json:{write:!0}})],Qr.prototype,"colormap",void 0),Qr=Yr=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ShadedReliefFunctionArguments")],Qr);const en=Qr;let tn=class extends w{constructor(){super(...arguments),this.functionName="ShadedRelief",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){let e=this.sourceRasterInfos[0];if(e.bandCount>1)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: source data must be single band"};let{colorRamp:t,colormap:r}=this.functionArguments;if(!t&&!r?.length)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: a color ramp argument must be specified"};this.outputPixelType=this._getOutputPixelType("u8");let n=e.clone();this._removeStatsHistColormapVAT(n),n.pixelType=this.outputPixelType,n.bandCount=3,n.statistics=[{min:0,max:255,avg:60,stddev:10},{min:0,max:255,avg:60,stddev:10},{min:0,max:255,avg:60,stddev:10}],this.rasterInfo=n,this.isGCS=n.spatialReference?.isGeographic??!1,r?.length||(r=(0,gt.R8)(t,{interpolateAlpha:!0}));let{indexedColormap:s,offset:i}=(0,$e.zg)({colormap:r});if(!s?.length)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: a valid colorramp is required"};let o=(0,gt.S2)(s);return this.lookup={indexedColormap:s,offset:i,hsvMap:o},{success:!0,supportsGPU:(0,kt.WN)(s)}}_processPixels(e){let t=e.pixelBlocks?.[0];if(!t||!this.lookup)return null;let r=e.primaryPixelSizes?.[0];if(null==r){let{extent:n}=e;r=n?{x:n.width/t.width,y:n.height/t.height}:{x:1,y:1}}let n=(0,ze.PP)(this.functionArguments,r,this.isGCS),s=(0,ze.fw)(t,n),i=this.sourceRasterInfos[0].statistics?.[0]??{min:0,max:8e3};return(0,ze.SC)(s,t,this.lookup.hsvMap,i),s.pixelType=this.outputPixelType,s}_getWebGLParameters(){let e=(0,ze.PP)(this.functionArguments,{x:1,y:1},this.isGCS),t=(0,ze.ng)(e),{slopeType:r,zFactor:n,pixelSizeFactor:s,pixelSizePower:i}=this.functionArguments,o="scaled"===r,{indexedColormap:a,offset:u}=this.lookup,p=this.sourceRasterInfos[0].statistics?.[0],c=(0,l.zw)(this.outputPixelType);return{...t,indexedColormap:a,offset:u,zFactor:n,gcsFactor:this.isGCS?ze.rk:1,pixelSizeFactor:o?s:0,pixelSizePower:o?i:0,minValue:p?.min??0,maxValue:p?.max??8e3,isOutputRounded:c}}_getNeighborhoodSize(){return{rows:3,cols:3}}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],tn.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:en,json:{write:!0,name:"rasterFunctionArguments"}})],tn.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],tn.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],tn.prototype,"isGCS",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],tn.prototype,"lookup",void 0),tn=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ShadedReliefFunction")],tn);const rn=tn;var nn;const sn=new Oe.J({1:"degree",2:"percent-rise",3:"adjusted"},{useNumericKeys:!0});let on=nn=class extends c{constructor(){super(...arguments),this.slopeType="degree",this.zFactor=1,this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.removeEdgeEffect=!1}clone(){return new nn({slopeType:this.slopeType,zFactor:this.zFactor,pixelSizePower:this.pixelSizePower,pixelSizeFactor:this.pixelSizeFactor,removeEdgeEffect:this.removeEdgeEffect,raster:this.raster})}};(0,o.Cg)([(0,Ye.e)(sn)],on.prototype,"slopeType",void 0),(0,o.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],on.prototype,"zFactor",void 0),(0,o.Cg)([(0,a.MZ)({type:Number,json:{name:"psPower",write:!0}})],on.prototype,"pixelSizePower",void 0),(0,o.Cg)([(0,a.MZ)({type:Number,json:{name:"psZFactor",write:!0}})],on.prototype,"pixelSizeFactor",void 0),(0,o.Cg)([(0,a.MZ)({type:Boolean,json:{write:!0}})],on.prototype,"removeEdgeEffect",void 0),on=nn=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.SlopeFunctionArguments")],on);const an=on;let ln=class extends w{constructor(){super(...arguments),this.functionName="Slope",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");let e=this.sourceRasterInfos[0].clone();return e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),e.statistics="percent-rise"===this.functionArguments.slopeType?null:[{min:0,max:90,avg:1,stddev:1}],e.bandCount=1,this.rasterInfo=e,this.isGCS=e.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(e){let t=e.pixelBlocks?.[0];if(null==t)return null;let{zFactor:r,slopeType:n,pixelSizePower:s,pixelSizeFactor:i}=this.functionArguments,{isGCS:o}=this,{extent:a,primaryPixelSizes:l}=e,u=l?.[0]??(a?{x:a.width/t.width,y:a.height/t.height}:{x:1,y:1});return(0,ze.yy)(t,{zFactor:r,slopeType:n,pixelSizePower:s,pixelSizeFactor:i,isGCS:o,resolution:u})}_getWebGLParameters(){let{zFactor:e,slopeType:t,pixelSizeFactor:r,pixelSizePower:n}=this.functionArguments;return{zFactor:this.isGCS&&e>=1?e*ze.rk:e,slopeType:t,pixelSizeFactor:r??0,pixelSizePower:n??0,isOutputRounded:(0,l.zw)(this.outputPixelType)}}_getNeighborhoodSize(){return{rows:3,cols:3}}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],ln.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:an,json:{write:!0,name:"rasterFunctionArguments"}})],ln.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],ln.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],ln.prototype,"isGCS",void 0),ln=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.SlopeFunction")],ln);const un=ln;var pn;let cn=pn=class extends c{clone(){return new pn({conversionMatrix:[...this.conversionMatrix],raster:this.raster})}};(0,o.Cg)([(0,a.MZ)({type:[Number],json:{write:!0}})],cn.prototype,"conversionMatrix",void 0),cn=pn=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.SpectralConversionFunctionArguments")],cn);const hn=cn;let mn=class extends w{constructor(){super(...arguments),this.functionName="SpectralConversion",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){let e=this.sourceRasterInfos[0].clone();return this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),this.rasterInfo=e,{success:!0,supportsGPU:3===e.bandCount&&9===this.functionArguments.conversionMatrix.length}}_processPixels(e){let t=e.pixelBlocks?.[0];return null==t?null:function(e,t,r){let{width:n,height:s,mask:i,bandMasks:o}=e,a=o?.length?g.A.combineBandMasks(o):i,l=[],u=e.pixels.length;for(let n=0;n<t.length/u;n++){let s=xr(e,t.slice(n*u,(n+1)*u),r,a);l.push(s)}let p=new g.A({width:n,height:s,pixels:l,pixelType:r,mask:a});return p.updateStatistics(),p}(t,this.functionArguments.conversionMatrix,this.outputPixelType)}_getWebGLParameters(){let e=(0,l.hP)(this.outputPixelType),[t,r,n,s,i,o,a,u,p]=this.functionArguments.conversionMatrix;return{weights:[t,s,a,r,i,u,n,o,p],clampRange:e}}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],mn.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:hn,json:{write:!0,name:"rasterFunctionArguments"}})],mn.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],mn.prototype,"rasterArgumentNames",void 0),mn=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.SpectralConversionFunction")],mn);const fn=mn,gn=new Oe.J({1:"min",2:"max",3:"mean",4:"stddev",5:"median",6:"majority",7:"minority"},{useNumericKeys:!0});function dn(e,t){let{fillNoDataOnly:r}=t,{band:n,width:s,height:i,mask:o,outBand:a}=e;if(r&&!o)return void a.set(n);let{statisticsType:l,kernelRows:u,kernelCols:p}=t,c="stddev"===l,h=s*i,m=new Float64Array(h),f=new Float64Array(h),g=new Uint32Array(h);for(let e=0;e<i;e++){let t=e*s,r=0,i=0,a=0;for(let e=0;e<p;e++)(!o||o[t+e])&&(r+=n[t+e],c&&(i+=n[t+e]**2),a++);m[t]=r,f[t]=i,g[t]=a;for(let e=1;e<=s-p;e++){let s=t+e-1,l=s+p;o?(o[s]&&(a--,r-=n[s],c&&(i-=n[s]**2)),o[l]&&(a++,r+=n[l],c&&(i+=n[l]**2))):(r-=n[s],r+=n[l],c&&(i-=n[s]**2,i+=n[l]**2)),m[t+e]=r,g[t+e]=a,c&&(f[t+e]=i)}}let d=new Float64Array(h),y=new Float64Array(h),x=new Uint32Array(h),w=u*s;for(let e=0;e<=s-p;e++){let t=0,r=0,n=0;for(let i=0;i<u;i++){let o=i*s+e;t+=m[o],n+=g[o],c&&(r+=f[o])}d[e]=t,y[e]=r,x[e]=n;for(let o=1;o<=i-u;o++){let i=(o-1)*s+e,a=i+w;t-=m[i],t+=m[a],n-=g[i],n+=g[a],c&&(r-=f[i],r+=f[a]),d[o*s+e]=t,y[o*s+e]=r,x[o*s+e]=n}}let A=Math.floor(u/2),v=Math.floor(p/2);for(let e=A;e<i-A;e++){let t=e*s;for(let n=v;n<s-v;n++){let i=(e-A)*s+n-v,l=x[i];if(0===l||r&&(!o||o[t+n]))continue;let u=d[i]/l,p=c?Math.sqrt((y[i]-d[i]*u)/l):u;a[t+n]=p,o&&(o[t+n]=255)}}}function yn(e,t){let{fillNoDataOnly:r}=t,{band:n,width:s,height:i,mask:o,outBand:a}=e;if(r&&!o)return void a.set(n);let{kernelRows:l,kernelCols:u,statisticsType:p}=t,c=Math.floor(l/2),h=Math.floor(u/2),m="min"===p,f=a.slice(),g=new Uint32Array(s*i);for(let e=c;e<i-c;e++){let t=e*s;for(let e=h;e<s-h;e++){let r=m?Number.MAX_VALUE:-Number.MAX_VALUE,i=0;for(let a=0;a<l;a++)for(let l=0;l<u;l++){let u=t+e+(a-c)*s+l-h;(!o||o[u])&&(r=m?Math.min(r,n[u]):Math.max(r,n[u]),i++)}o?(f[t+e]=0===i?0:r,g[t+e]=i):a[t+e]=0===i?0:r}}if(o)for(let e=c;e<i-c;e++){let t=e*s;for(let e=h;e<s-h;e++)if(g[t+e]){if(r&&o[t+e])continue;a[t+e]=f[t+e],o[t+e]=255}}}function xn(e,t){let{fillNoDataOnly:r}=t,{band:n,width:s,height:i,mask:o,outBand:a}=e;if(r&&!o)return void a.set(n);let{kernelRows:l,kernelCols:u}=t,p=Math.floor(l/2),c=Math.floor(u/2),h=a.slice(),m=new Uint32Array(s*i);for(let e=p;e<i-p;e++){let t=e*s;for(let e=c;e<s-c;e++){if(r&&o?.[t+e])continue;let i=[];for(let r=0;r<l;r++)for(let a=0;a<u;a++){let l=t+e+(r-p)*s+a-c;(!o||o[l])&&i.push(n[l])}i.length&&(i.sort((e,t)=>e-t),o?(h[t+e]=i[Math.floor((i.length-1)/2)],m[t+e]=i.length):a[t+e]=i[Math.floor((i.length-1)/2)])}}if(o)for(let e=p;e<i-p;e++){let t=e*s;for(let e=c;e<s-c;e++)if(m[t+e]){if(r&&o[t+e])continue;a[t+e]=h[t+e],o[t+e]=255}}}function wn(e,t){let{fillNoDataOnly:r}=t,{band:n,width:s,height:i,mask:o,outBand:a}=e;if(r&&!o)return void a.set(n);let{kernelRows:l,kernelCols:u}=t,p=Math.floor(l/2),c=Math.floor(u/2),h="majority"===t.statisticsType,m=l*u,f=a.slice(),g=new Uint32Array(s*i);for(let e=p;e<i-p;e++){let t=e*s;for(let e=c;e<s-c;e++){if(r&&o?.[t+e])continue;let i=new Map;for(let r=0;r<l;r++)for(let a=0;a<u;a++){let l=t+e+(r-p)*s+a-c;if(o&&!o[l])continue;let u=n[l];i.set(u,i.has(u)?i.get(u)+1:1)}if(0===i.size)continue;let d=0,y=0,x=h?0:m+1;for(let e of i.keys())y=i.get(e),h===y>x&&(x=y,d=e);o?(f[t+e]=d,g[t+e]=i.size):a[t+e]=d}}if(o)for(let e=p;e<i-p;e++){let t=e*s;for(let e=c;e<s-c;e++)if(g[t+e]){if(r&&o[t+e])continue;a[t+e]=f[t+e],o[t+e]=255}}}var An;let vn=An=class extends c{constructor(){super(...arguments),this.rows=3,this.cols=3,this.fillNoDataOnly=!1,this.statisticsType="min"}clone(){return new An({rows:this.rows,cols:this.cols,fillNoDataOnly:this.fillNoDataOnly,statisticsType:this.statisticsType,raster:(0,i.o8)(this.raster)})}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,read:{source:["kernelRows","rows"],reader:(e,t)=>Number(e??t?.kernelRows??3)}}})],vn.prototype,"rows",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0,read:{source:["kernelCols","cols"],reader:(e,t)=>Number(e??t?.kernelCols??3)}}})],vn.prototype,"cols",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],vn.prototype,"fillNoDataOnly",void 0),(0,o.Cg)([(0,a.MZ)({json:{read:{source:["statisticsType","type"],reader:(e,t)=>gn.fromJSON(t?.statisticsType??t?.type)??"min"},write:{target:"type"}}}),(0,Ye.e)(gn)],vn.prototype,"statisticsType",void 0),vn=An=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.StatisticsFunctionArguments")],vn);const bn=vn;let Cn=class extends w{constructor(){super(...arguments),this.functionName="Statistics",this.rasterArgumentNames=["raster"]}_bindSourceRasters(){let{type:e}=this.functionArguments.toJSON();if(e<1||e>7)return{success:!1,supportsGPU:!1,error:`statistics-function: the given statistics type is not supported ${e}`};let t=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(t.pixelType);let r=t.clone();r.pixelType=this.outputPixelType;let{statisticsType:n}=this.functionArguments;return"stddev"===n&&this._removeStatsHistColormapVAT(r),this.rasterInfo=r,{success:!0,supportsGPU:r.bandCount<=3&&e<5}}_processPixels(e){let t=e.pixelBlocks?.[0];if(null==t)return t;let{statisticsType:r,rows:n,cols:s,fillNoDataOnly:i}=this.functionArguments;return function(e,t){let{mask:r}=e,{fillNoDataOnly:n}=t;if(n&&!r)return e;let{pixels:s,width:i,height:o,bandMasks:a,pixelType:l}=e,u=s.length,p=i*o,c=[],{kernelRows:h,kernelCols:m,statisticsType:f,mirrorEdges:d}=t;if(n&&!r)return e;let y=t.outputPixelType??l,x=[];for(let e=0;e<u;e++){let l=s[e],u=g.A.createEmptyBand(y,p);n&&u.set(l);let w=(a?.[e]??r)?.slice()??null,A={band:l,width:i,height:o,mask:w,outBand:u};switch(f){case"min":case"max":yn(A,t);break;case"mean":case"stddev":dn(A,t);break;case"median":xn(A,t);break;case"majority":case"minority":wn(A,t)}d&&!n&&Yt(u,i,o,h,m),c.push(u),w&&x.push(w)}let w=x[0]??r;x.length!==u&&(x.length=0),u>1&&a?.length&&(w=g.A.combineBandMasks(a));let A=new g.A({pixelType:y,width:i,height:o,pixels:c,bandMasks:a&&x.length?x:null,mask:w});return A.updateStatistics(),A}(t,{kernelRows:n,kernelCols:s,fillNoDataOnly:i,outputPixelType:this.outputPixelType,statisticsType:r,mirrorEdges:!0})}_getWebGLParameters(){let{rows:e,cols:t,statisticsType:r,fillNoDataOnly:n}=this.functionArguments;return{fillNoDataOnly:n,kernelRows:e,kernelCols:t,statisticsType:r,clampRange:(0,l.hP)(this.outputPixelType)}}_getNeighborhoodSize(){let{rows:e,cols:t}=this.functionArguments;return{rows:e,cols:t}}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Cn.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:bn,json:{write:!0,name:"rasterFunctionArguments"}})],Cn.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],Cn.prototype,"rasterArgumentNames",void 0),Cn=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.StatisticsFunction")],Cn);const Mn=Cn;var Pn;let Tn=Pn=class extends c{constructor(){super(...arguments),this.statistics=null,this.histograms=null}readStatistics(e,t){if(!e?.length)return null;let r=[];return e.forEach(e=>{let t={min:e.min,max:e.max,avg:e.avg??e.mean,stddev:e.stddev??e.standardDeviation};r.push(t)}),r}writeStatistics(e,t,r){if(!e?.length)return;let n=[];e.forEach(e=>{let t={...e,mean:e.avg,standardDeviation:e.stddev};delete t.avg,delete t.stddev,n.push(t)}),t[r]=n}clone(){return new Pn({statistics:(0,i.o8)(this.statistics),histograms:(0,i.o8)(this.histograms)})}};(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Tn.prototype,"statistics",void 0),(0,o.Cg)([(0,yt.w)("statistics")],Tn.prototype,"readStatistics",null),(0,o.Cg)([(0,Ft.K)("statistics")],Tn.prototype,"writeStatistics",null),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Tn.prototype,"histograms",void 0),Tn=Pn=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.StatisticsHistogramFunctionArguments")],Tn);const Rn=Tn;let Nn=class extends w{constructor(){super(...arguments),this.functionName="StatisticsHistogram",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){let e=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType("u8");let t=e.clone(),{statistics:r,histograms:n}=this.functionArguments;return n&&(t.histograms=n),r&&(t.statistics=r),this.rasterInfo=t,{success:!0,supportsGPU:!0}}_processPixels(e){return e.pixelBlocks?.[0]}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Nn.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:Rn,json:{write:!0,name:"rasterFunctionArguments"}})],Nn.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],Nn.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Nn.prototype,"indexedColormap",void 0),(0,o.Cg)([(0,a.MZ)()],Nn.prototype,"isNoopProcess",void 0),Nn=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.StatisticsHistogramFunction")],Nn);const kn=Nn;var In;const Sn=new Oe.J({0:"none",3:"standard-deviation",4:"histogram-equalization",5:"min-max",6:"percent-clip",9:"sigmoid"},{useNumericKeys:!0});let _n=In=class extends c{constructor(){super(...arguments),this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.histograms=null,this.statistics=null,this.stretchType="none",this.useGamma=!1}writeStatistics(e,t,r){e?.length&&(Array.isArray(e[0])||(e=e.map(e=>[e.min,e.max,e.avg,e.stddev])),t[r]=e)}clone(){return new In({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:(0,i.o8)(this.statistics),gamma:(0,i.o8)(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,histograms:(0,i.o8)(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment,raster:this.raster})}};(0,o.Cg)([(0,a.MZ)({type:Boolean,json:{write:!0}})],_n.prototype,"computeGamma",void 0),(0,o.Cg)([(0,a.MZ)({type:Boolean,json:{name:"dra",write:!0}})],_n.prototype,"dynamicRangeAdjustment",void 0),(0,o.Cg)([(0,a.MZ)({type:[Number],json:{write:!0}})],_n.prototype,"gamma",void 0),(0,o.Cg)([(0,a.MZ)()],_n.prototype,"histograms",void 0),(0,o.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],_n.prototype,"maxPercent",void 0),(0,o.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],_n.prototype,"minPercent",void 0),(0,o.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],_n.prototype,"numberOfStandardDeviations",void 0),(0,o.Cg)([(0,a.MZ)({type:Number,json:{name:"max",write:!0}})],_n.prototype,"outputMax",void 0),(0,o.Cg)([(0,a.MZ)({type:Number,json:{name:"min",write:!0}})],_n.prototype,"outputMin",void 0),(0,o.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],_n.prototype,"sigmoidStrengthLevel",void 0),(0,o.Cg)([(0,a.MZ)({json:{type:[[Number]],write:!0}})],_n.prototype,"statistics",void 0),(0,o.Cg)([(0,Ft.K)("statistics")],_n.prototype,"writeStatistics",null),(0,o.Cg)([(0,Ye.e)(Sn)],_n.prototype,"stretchType",void 0),(0,o.Cg)([(0,a.MZ)({type:Boolean,json:{write:!0}})],_n.prototype,"useGamma",void 0),_n=In=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.StretchFunctionArguments")],_n);const Fn=_n;let Bn=class extends w{constructor(){super(...arguments),this.functionName="Stretch",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null,this.cutOffs=null}_bindSourceRasters(){this.lookup=null,this.cutOffs=null;let e=this.sourceRasterInfos[0],{pixelType:t}=e,{functionArguments:r}=this,{dynamicRangeAdjustment:n,gamma:s,useGamma:i}=r;if(!n&&["u8","u16","s8","s16"].includes(t)){let n=(0,qt.DP)(r.toJSON(),{rasterInfo:e}),o=(0,l.zw)(this.outputPixelType)?"round":"float";this.lookup=(0,qt.RP)({pixelType:t,...n,gamma:i?s:null,rounding:o}),this.cutOffs=n}else n||(this.cutOffs=(0,qt.DP)(r.toJSON(),{rasterInfo:e}));this.outputPixelType=this._getOutputPixelType(t);let o=e.clone();o.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(o),"u8"===this.outputPixelType&&(o.keyProperties.DataType="processed");let{outputMin:a=0,outputMax:u=255}=this.functionArguments;o.statistics=[];for(let e=0;e<o.bandCount;e++)o.statistics[e]={min:a,max:u};return this.rasterInfo=o,{success:!0,supportsGPU:!n}}_processPixels(e,t){let r=e.pixelBlocks?.[0];if(null==r)return r;let{lookup:n}=this;if(n)return(0,$e.eH)(r,{...n,outputPixelType:this.rasterInfo.pixelType});let{functionArguments:s}=this,i=t?.stretchCutoff??this.cutOffs??(0,qt.DP)(s.toJSON(),{rasterInfo:this.sourceRasterInfos[0],pixelBlock:r}),o=s.useGamma?s.gamma:null;return(0,qt._N)(r,{...i,gamma:o,outputPixelType:this.outputPixelType})}_getWebGLParameters(){let{outputMin:e=0,outputMax:t=255,gamma:r,useGamma:n}=this.functionArguments,s=this.rasterInfo.bandCount>=2?3:1,i=n&&r?.length?(0,qt.Nh)(s,r):[1,1,1],{minCutOff:o,maxCutOff:a}=this.cutOffs??{minCutOff:[0,0,0],maxCutOff:[255,255,255]};1===o.length&&(o[1]=o[2]=o[0],a[1]=a[2]=a[0]);let u=a.map((r,n)=>(t-e)/(a[n]-o[n])),p=(0,l.zw)(this.outputPixelType);return{bandCount:s,minOutput:e,maxOutput:t,minCutOff:o,maxCutOff:a,factor:u,useGamma:n,gamma:n&&r?[r[0],r[1]??r[0],r[2]??r[0]]:[1,1,1],gammaCorrection:n?[i[0],i[1]??i[0],i[2]??i[0]]:[1,1,1],stretchType:this.functionArguments.stretchType,isOutputRounded:p,type:"stretch"}}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Bn.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:Fn,json:{write:!0,name:"rasterFunctionArguments"}})],Bn.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],Bn.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Bn.prototype,"lookup",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Bn.prototype,"cutOffs",void 0),Bn=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.StretchFunction")],Bn);const jn=Bn;var Zn;let zn=Zn=class extends c{constructor(){super(...arguments),this.attributeTableAsRecordSet=null}clone(){return new Zn({attributeTableAsRecordSet:(0,i.o8)(this.attributeTableAsRecordSet)})}};(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],zn.prototype,"attributeTableAsRecordSet",void 0),zn=Zn=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.TableFunctionArguments")],zn);const Gn=zn;let En=class extends w{constructor(){super(...arguments),this.functionName="Table",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){let e=this.sourceRasterInfos[0];if(e.bandCount>1||e.pixelType.startsWith("f"))return{success:!1,supportsGPU:!1,error:"table-function: Source data must be single band and integer pixel type."};let{attributeTableAsRecordSet:t}=this.functionArguments;if(!t)return{success:!1,supportsGPU:!1,error:"table-function: Missing attributeTableAsRecordSet argument."};this.outputPixelType=this._getOutputPixelType(e.pixelType);let r=e.clone();return r.pixelType=this.outputPixelType,r.bandCount=1,"thematic"!==r.dataType&&(r.keyProperties=r.keyProperties?{...r.keyProperties,DataType:"thematic"}:{DataType:"thematic"}),this.rasterInfo=r,{success:!0,supportsGPU:!0}}_processPixels(e){return e.pixelBlocks?.[0]}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],En.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:Gn,json:{write:!0,name:"rasterFunctionArguments"}})],En.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],En.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)()],En.prototype,"isNoopProcess",void 0),En=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.TableFunction")],En);const On=En,Dn=new Map;function Vn(e,t){let{rasterFunctionArguments:r}=e;r&&(r.rasters||[r.raster,r.raster2]).forEach(e=>{e&&"number"!=typeof e&&("string"==typeof e?e.startsWith("http")&&(t.includes(e)||t.push(e)):"rasterFunctionArguments"in e&&Vn(e,t))})}function Un(e,t){t??={};try{if("function"in(e=(0,i.o8)(e))&&"arguments"in e&&e.arguments){let r=Jn(e,new Map,t);if(Yn(r),!r.renderingRule)throw new s.A("raster-function-helper","Unsupported raster function json.");e=r.renderingRule}if("rasterFunction"in e){let r=$n(e=Wn(e),t);return r.isRoot=!0,r}}catch{}throw new s.A("raster-function-helper","unsupported raster function json.")}function Ln(e){return!!(e&&"object"==typeof e&&e.rasterFunction&&e.rasterFunctionArguments)}function Wn(e){let{rasterFunction:t,rasterFunctionArguments:r}=e,n={};for(let e in r){let t=r[e],s=e.toLowerCase();if("rasters"===s&&Array.isArray(t))n.rasters=t.map(e=>Ln(e)?Wn(e):e);else switch(Ln(t)&&(t=Wn(t)),s){case"dra":n.dra=t;break;case"pspower":n.psPower=t;break;case"pszfactor":n.psZFactor=t;break;case"bandids":n.bandIds=t;break;default:n[e[0].toLowerCase()+e.slice(1)]=t}}return"Local"===t&&!n.rasters?.length&&(n.rasters=["$$"]),{...e,rasterFunctionArguments:n}}function $n(e,t){let{rasterFunction:r,rasterFunctionArguments:n}=e,i=e.outputPixelType?.toLowerCase();if(null==r||!Dn.has(r))throw new s.A("raster-function-helper",`unsupported raster function: ${r}`);let o=Dn.get(r),a=("function"==typeof o.ctor?o.ctor:o.ctor.default).fromJSON({...e,outputPixelType:i}),{rasterArgumentNames:l}=a,u=[],p=function(e,t){return"rasters"===t[0]&&Array.isArray(e.rasters)?e.rasters:t.map(t=>e[t])}(n,l),c="rasters"===l[0]||l.length>1,h=[];for(let e=0;e<p.length;e++){let r,n=p[e];null==n||"string"==typeof n&&n.startsWith("$")?u.push(t?.raster):"string"==typeof n?t[n]&&u.push(t[n]):"number"!=typeof n&&"rasterFunction"in n&&(r=$n(n,t),c||(a.functionArguments[l[e]]=r),u.push(r)),c&&h.push(r??n)}if(c&&("rasters"===l[0]?a.functionArguments.rasters=h:l.forEach((e,t)=>{a.functionArguments[e]=h[t]})),t){a.sourceRasters=u;let e=t.raster?.url;e&&(a.mainPrimaryRasterId=e)}return a}function Kn(e,t){if(e&&t)for(let r in e){let n=e[r];n&&"object"==typeof n&&"type"in n&&("RasterFunctionTemplate"===n.type?Kn(n.arguments,t):"RasterFunctionVariable"===n.type&&null!=t[n.name]&&(n.value=t[n.name]))}}function Hn(e,t){if(!e||"object"!=typeof e)return e;let{value:r}=e;if(!r||"object"!=typeof r)return e.isDataset?"$$":r;if(Array.isArray(r))return 0===r.length?[]:r.map(e=>e&&"object"==typeof e&&"RasterFunctionVariable"===e.type?Hn(e,t):e);if("value"in r&&["number","string","boolean"].includes(typeof r.value))return r.value;if(e.isDataset&&"Scalar"!==r.type)return"$$";if(!("type"in r))return r;let n=r;switch(r.type){case"Scalar":n=r.value;break;case"AlgorithmicColorRamp":n=qn(r);break;case"MultiPartColorRamp":n={type:"multipart",colorRamps:r.ArrayOfColorRamp.map(qn)};break;case"ArgumentArray":if(r.elements?.length&&"RasterStatistics"!==r.elements[0].type){let e=[];for(let n=0;n<r.elements.length;n++){let i=r.elements[n],{type:o}=i;if(o)if("RasterFunctionTemplate"===o){let{renderingRule:r}=Jn(i,t);e.push(r),null!=i._object_id&&t.set(i._object_id,r)}else{if("RasterFunctionVariable"!==o)throw new s.A("raster-function-helper","unsupported raster function json.");{let r=Hn(i,t);e.push(r),null!=i._object_id&&t.set(i._object_id,r)}}else e.push(i)}n=e}else n=r.elements}return null!=r._object_id&&t.set(r._object_id,n),n}function qn(e){let t=e.algorithm??"esriHSVAlgorithm",{FromColor:r,ToColor:s}=e;if(!Array.isArray(r)){let{r:e,g:t,b:s}=(0,n.$)({h:r.Hue,s:r.Saturation,v:r.Value});r=[e,t,s,r.AlphaValue]}if(!Array.isArray(s)){let{r:e,g:t,b:r}=(0,n.$)({h:s.Hue,s:s.Saturation,v:s.Value});s=[e,t,r,s.AlphaValue]}return{type:"algorithmic",algorithm:t,fromColor:r,toColor:s}}function Jn(e,t,r){r&&Kn(e,r);let n={renderingRule:{},templates:t};return Xn(e,n),n}function Xn(e,t){if(!e||!t.renderingRule)return;let{renderingRule:r,templates:n}=t,{function:s,arguments:i,_object_id:o}=e;if(!s||!i)return;null!=o&&n.set(o,r),r.rasterFunction=s.type.replace("Function",""),r.outputPixelType=s.pixelType;let a={};r.rasterFunctionArguments=a;for(let e in i){if("type"===e||"object_id"===e||"_object_ref_id"===e)continue;let t=i[e];!t||"object"!=typeof t||!("type"in t)||"RasterFunctionTemplate"!==t.type&&"RasterFunctionVariable"!==t.type?a[e]=t:("RasterFunctionVariable"===t.type?a[e]=Hn(t,n):(r.rasterFunctionArguments[e]={},Xn(t,{renderingRule:r.rasterFunctionArguments[e],templates:n})),null!=t._object_id&&n.set(t._object_id,a[e]))}switch(a.DEM&&!a.Raster&&(a.Raster=a.DEM,delete a.DEM),r.rasterFunction){case"Stretch":!function(e){e.Statistics?.length&&"object"==typeof e.Statistics&&(e.Statistics=e.Statistics.map(e=>[e.min,e.max,e.mean,e.standardDeviation])),null!=e.NumberOfStandardDeviation&&(e.NumberOfStandardDeviations=e.NumberOfStandardDeviation,delete e.NumberOfStandardDeviation)}(a);break;case"Colormap":!function(e){"randomcolorramp"===e.ColorRamp?.type?.toLowerCase()&&(delete e.ColorRamp,e.ColormapName="Random"),0===e.ColorSchemeType&&delete e.ColorRamp}(a);break;case"Convolution":!function(e){null!=e.ConvolutionType&&(e.Type=e.ConvolutionType,delete e.ConvolutionType)}(a);break;case"Mask":!function(e){e.NoDataValues?.length&&"string"==typeof e.NoDataValues[0]&&(e.NoDataValues=e.NoDataValues.filter(e=>""!==e).map(e=>Number(e)))}(a)}}function Yn(e){let{renderingRule:t,templates:r}=e;if("object"!=typeof t||!t?.rasterFunctionArguments||!r.size)return;let{rasterFunctionArguments:n}=t;for(let e in n){let t=n[e],i="_object_ref_id"===e?t:t&&"object"==typeof t&&"_object_ref_id"in t?t._object_ref_id:null;if(null!=i){if(!r.has(i))throw new s.A("raster-function-helper",`unsupported raster function json. _object_ref_id: ${i} does not exist`);let t=r.get(i);"_object_ref_id"===e?t&&"object"==typeof t&&Object.assign(n,t):n[e]=t}else t&&"object"==typeof t&&(t.rasterFunctionArguments&&Yn({renderingRule:t,templates:r}),Array.isArray(t)&&t.forEach((e,n)=>{if(e&&"object"==typeof e)if(null!=e._object_ref_id){if(!r.has(e._object_ref_id))throw new s.A("raster-function-helper",`unsupported raster function json. _object_ref_id: ${t} does not exist`);let o=r.get(i);o&&"object"==typeof o?Object.assign(e,o):t[n]=o}else Yn({renderingRule:e,templates:r})}))}}Dn.set("Arithmetic",{desc:"Arithmetic Function",ctor:Fe,rasterArgumentNames:["rasters"]}),Dn.set("Aspect",{desc:"Aspect Function",ctor:Ee,rasterArgumentNames:["raster"]}),Dn.set("BandArithmetic",{desc:"Band Arithmetic Function",ctor:nt,rasterArgumentNames:["raster"]}),Dn.set("Colormap",{desc:"Colormap Function",ctor:Mt,rasterArgumentNames:["raster"]}),Dn.set("ColormapToRGB",{desc:"ColormapToRGB Function",ctor:St,rasterArgumentNames:["raster"]}),Dn.set("CompositeBand",{desc:"CompositeBand Function",ctor:zt,rasterArgumentNames:["rasters"]}),Dn.set("ComputeChange",{desc:"ComputeChange Function",ctor:Wt,rasterArgumentNames:["rasters"]}),Dn.set("Convolution",{desc:"Convolution Function",ctor:or,rasterArgumentNames:["raster"]}),Dn.set("ContrastBrightness",{desc:"Contrast Brightness Function",ctor:Xt,rasterArgumentNames:["raster"]}),Dn.set("ExtractBand",{desc:"ExtractBand Function",ctor:yr,rasterArgumentNames:["raster"]}),Dn.set("Curvature",{desc:"Curvature Function",ctor:hr,rasterArgumentNames:["raster"]}),Dn.set("Hillshade",{desc:"Hillshade Function",ctor:Ir,rasterArgumentNames:["raster"]}),Dn.set("ShadedRelief",{desc:"ShadedRelief Function",ctor:rn,rasterArgumentNames:["raster"]}),Dn.set("Grayscale",{desc:"Grayscale Function",ctor:Cr,rasterArgumentNames:["raster"]}),Dn.set("Clip",{desc:"Clip Function",ctor:mt,rasterArgumentNames:["raster"]}),Dn.set("Local",{desc:"Local Function",ctor:jr,rasterArgumentNames:["rasters"]}),Dn.set("Mask",{desc:"Mask Function",ctor:Dr,rasterArgumentNames:["raster"]}),Dn.set("NDVI",{desc:"NDVI Function",ctor:$r,rasterArgumentNames:["raster"]}),Dn.set("Remap",{desc:"Remap Function",ctor:Xr,rasterArgumentNames:["raster"]}),Dn.set("Slope",{desc:"Slope Function",ctor:un,rasterArgumentNames:["raster"]}),Dn.set("SpectralConversion",{desc:"Spectral Conversion",ctor:fn,rasterArgumentNames:["raster"]}),Dn.set("Statistics",{desc:"Focal Statistics Function",ctor:Mn,rasterArgumentNames:["raster"]}),Dn.set("StatisticsHistogram",{desc:"Statistics Histogram Function",ctor:kn,rasterArgumentNames:["raster"]}),Dn.set("Stretch",{desc:"Stretch Function",ctor:jn,rasterArgumentNames:["raster"]}),Dn.set("Table",{desc:"Attribute Table Function",ctor:On,rasterArgumentNames:["raster"]})},37373(e,t,r){r.d(t,{DO:()=>G,FT:()=>B,Hh:()=>b,OM:()=>z,Ps:()=>V,Wo:()=>C,_I:()=>P,_l:()=>S,l0:()=>E,t$:()=>U,uk:()=>_});var n=r(4576),s=r(49186),i=r(86211),o=r(5443),a=r(83290),l=r(86738),u=r(39829),p=r(99917),c=r(16930),h=r(21325);function m(){if(!v)throw new s.A("rasterprojectionhelper-project","projection operator is not loaded")}const f=(e,t,r,n=0)=>{if(1===r[0])return[0,0];let s=1,i=-1,o=1,a=-1;for(let t=0;t<e.length;t+=2)isNaN(e[t])||(s=s>e[t]?e[t]:s,i=i>e[t]?i:e[t],o=o>e[t+1]?e[t+1]:o,a=a>e[t+1]?a:e[t+1]);let{cols:l,rows:u}=t,p=(i-s)/l/r[0],c=(a-o)/u/r[1],h=2*n,m=0,f=!1,g=[0,0];for(let t=0;t<l-3;t++){for(let r=0;r<u-3;r++){let n=t*u*2+2*r,s=(e[n]+e[n+4]+e[n+4*u]+e[n+4*u+4])/4,i=(e[n+1]+e[n+5]+e[n+4*u+1]+e[n+4*u+5])/4,o=Math.abs((s-e[n+2*u+2])/p),a=Math.abs((i-e[n+2*u+3])/c);if(o+a>m&&(m=o+a,g=[o,a]),h&&m>h){f=!0;break}}if(f)break}return g},g={3395:20037508.342789244,3410:17334193.943686873,3857:20037508.342788905,3975:17367530.445161372,4087:20037508.342789244,4088:20015108.787169147,6933:17367530.445161372,32662:20037508.342789244,53001:20015086.79602057,53002:10007543.39801029,53003:20015086.79602057,53004:20015086.79602057,53016:14152803.599503474,53017:17333573.624304302,53034:20015086.79602057,53079:20015114.352186374,53080:20015114.352186374,54001:20037508.342789244,54002:10018754.171394624,54003:20037508.342789244,54004:20037508.342789244,54016:14168658.027268292,54017:17367530.44516137,54034:20037508.342789244,54079:20037508.342789244,54080:20037508.342789244,54100:20037508.342789244,54101:20037508.342789244},d=new Map,y=new Map;let x,w,A,v=!1;async function b(){return x||(x=Promise.withResolvers(),w=await r.e(3276).then(()=>r(83276)),A=await r.e(2158).then(()=>r(12158)),w.projectIsLoaded()||await w.projectLoad(),A.isLoaded()||await A.load(),v=!0,x.resolve()),x.promise}function C(e,t,r,n){let s=e.spatialReference;if(!s||!t||s.equals(t))return e;m();let a=r.center,l=new o.A({xmin:a.x-e.x/2,xmax:a.x+e.x/2,ymin:a.y-e.y/2,ymax:a.y+e.y/2,spatialReference:s}),u=w.projectExecute(l,t,{geographicTransformation:n}),p=B(t);return null==u||null!=p&&u.width>=p?function(e,t,r){let n=(0,i.GA)(t)/(0,i.GA)(r);return{x:e.x*n,y:e.y*n}}(e,s,t):{x:u.width,y:u.height}}function M(e,t=.01){return(0,i.GA)(e)?t/(0,i.GA)(e):0}function P(e,t,r,n=!0){let s=e.spatialReference;if(s.equals(t))return e;m();let i=w.projectExecute(e,t,{geographicTransformation:r});return!n||!i||T([e],[i],s,t),i}function T(e,t,r,n){let s=j(r,!0),i=j(n,!0),o=M(r,500),a=M(n,500);if(o&&null!=s&&null!=i)for(let r=0;r<e.length;r++){let n=t[r];if(!n)continue;let{x:l}=e[r],{x:u}=n;u>=i[1]-a&&Math.abs(l-s[0])<o?n.x-=i[1]-i[0]:u<=i[0]+a&&Math.abs(l-s[1])<o&&(n.x+=i[1]-i[0])}}function R(e){let{inSR:t,outSR:r,preferPE:n}=e;if(t.equals(r)){let{points:t}=I(e,null);return t}return t.isWebMercator&&r.isWGS84||t.isWGS84&&r.isWebMercator?function(e){let{cols:t,rows:r,xres:n,yres:s,usePixelCenter:i,inSR:o,outSR:a}=e,{xmin:u,ymax:c}=e;i&&(u+=n/2,c-=s/2);let h=[],m=[],f=Math.max(t,r);for(let e=0;e<f;e++){let i=u+n*Math.min(t,e),f=c-s*Math.min(r,e),g=(0,p.projectWithoutEngine)(new l.A({x:i,y:f,spatialReference:o}),o,a);e<=t&&h.push(g.x),e<=r&&m.push(g.y)}let g=[];for(let e=0;e<t;e++)for(let t=0;t<r;t++)g.push([h[e],m[t]]);return g}(e):n&&(t.isGeographic||null!=N(t))?function(e){let{inSR:t,outSR:r,datumTransformation:n}=e,{points:s,mask:i}=I(e,N(t));if(!t.isGeographic){let e=t.wkid?a.P.coordsys(t.wkid):a.P.fromString(t.isGeographic?a.a.PE_TYPE_GEOGCS:a.a.PE_TYPE_PROJCS,t.wkt2||t.wkt);a.c.projToGeog(e,s.length,s)}if(null!=n&&n.steps.length){let e,t=179.9955;if(r.isGeographic&&(e=s.map(([e])=>e>t?1:e<-179.9955?-1:0)),n.steps.forEach(e=>{let t=e.wkid?a.P.geogtran(e.wkid):a.P.fromString(a.a.PE_TYPE_GEOGTRAN,e.wkt);a.d.geogToGeog(t,s.length,s,null,e.isInverse?a.a.PE_TRANSFORM_2_TO_1:a.a.PE_TRANSFORM_1_TO_2)}),e)for(let r=0;r<s.length;r++){let n=e[r],i=s[r][0],o=i>t?1:i<-179.9955?-1:0;n&&o&&n!==o&&(s[r][0]=n>0?i+360:i-360)}}if(!r.isGeographic){let e=N(r,!0);!function(e,t){let[r,n]=t;for(let t=0;t<e.length;t++){let s=e[t][1];(s<r||s>n)&&(e[t]=[NaN,NaN])}}(s,null!=e&&e.isEnvelope?[e.bbox[1],e.bbox[3]]:[-90,90]);let t=r.wkid?a.P.coordsys(r.wkid):a.P.fromString(r.isGeographic?a.a.PE_TYPE_GEOGCS:a.a.PE_TYPE_PROJCS,r.wkt2||r.wkt);a.c.geogToProj(t,s.length,s)}let o=s;if(i&&s.length!==i.length){o=[];for(let e=0,t=0;e<i.length;e++)i[e]?o.push(s[t++]):o.push([NaN,NaN])}return o}(e):function(e){let{points:t}=I(e,null),{inSR:r,outSR:n,datumTransformation:s}=e,i=t.map(e=>new l.A(e[0],e[1],r)),o=w.projectExecuteMany(i,n,{geographicTransformation:s});return s&&T(i,o,r,n),o.map(e=>e?[e.x,e.y]:[NaN,NaN])}(e)}function N(e,t=!1){let r=e.wkid||e.wkt2||e.wkt;if(!r||e.isGeographic)return null;if(r=String(r),d.has(r)){let e=d.get(r);return t?e?.gcs:e?.pcs}let n=e.wkid?a.P.coordsys(e.wkid):a.P.fromString(e.isGeographic?a.a.PE_TYPE_GEOGCS:a.a.PE_TYPE_PROJCS,e.wkt2||e.wkt),s=k(n,M(e,1e-4)),i=k(n,0,!0);return d.set(r,{pcs:s,gcs:i}),t?i:s}function k(e,t=0,r=!1){let n=a.b.generate(e),s=r?e.horizonGcsGenerate():e.horizonPcsGenerate();if(!n||!s?.length)return null;let i=!1,o=s.find(e=>1===e.getInclusive()&&1===e.getKind());if(!o){if(o=s.find(e=>1===e.getInclusive()&&0===e.getKind()),!o)return null;i=!0}let l=r?0:+(2===n.getNorthPoleLocation())|(2===n.getSouthPoleLocation()?2:0),u=n.isPannableRectangle(),p=o.getCoord();if(i)return{isEnvelope:i,isPannable:u,vertices:p,coef:null,bbox:[p[0][0]-t,p[0][1]-t,p[1][0]+t,p[1][1]+t],poleLocation:l};let c=0,h=[],[m,f]=p[0],[g,d]=p[0];for(let e=0,t=p.length;e<t;e++){c++,c===t&&(c=0);let[r,n]=p[e],[s,i]=p[c];if(i===n)h.push([r,s,n,i,2]);else{let e=(s-r)/(i-n||1e-4),t=r-e*n;n<i?h.push([e,t,n,i,0]):h.push([e,t,i,n,1])}m=m<r?m:r,f=f<n?f:n,g=g>r?g:r,d=d>n?d:n}return{isEnvelope:!1,isPannable:u,vertices:p,coef:h,bbox:[m,f,g,d],poleLocation:l}}function I(e,t){let r=[],{cols:n,rows:s,xres:i,yres:o,usePixelCenter:a}=e,{xmin:l,ymax:u}=e;if(a&&(l+=i/2,u-=o/2),null==t){for(let e=0;e<n;e++)for(let t=0;t<s;t++)r.push([l+i*e,u-o*t]);return{points:r}}let p=new Uint8Array(n*s);if(t.isEnvelope){let{isPannable:e,bbox:[a,c,h,m]}=t;for(let t=0,f=0;t<n;t++){let n=l+i*t,g=e||n>=a&&n<=h;for(let e=0;e<s;e++,f++){let t=u-o*e;g&&t>=c&&t<=m&&(r.push([n,t]),p[f]=1)}}return{points:r,mask:p}}let c=t.coef,h=[];for(let e=0;e<s;e++){let t=u-o*e,r=[],n=[];for(let e=0;e<c.length;e++){let[s,i,o,a,l]=c[e];if(t===o&&o===a)r.push(s),r.push(i),n.push(2),n.push(2);else if(t>=o&&t<=a){let e=s*t+i;r.push(e),n.push(l)}}let s=r;if(r.length>2){let e=2===n[0]?0:n[0],t=r[0];s=[];for(let i=1;i<n.length;i++)(2!==n[i]||i===n.length-1)&&(n[i]!==e&&(s.push(0===e?Math.min(t,r[i-1]):Math.max(t,r[i-1])),e=n[i],t=r[i]),i===n.length-1&&s.push(0===n[i]?Math.min(t,r[i]):Math.max(t,r[i])));s.sort((e,t)=>e-t)}else r[0]>r[1]&&(s=[r[1],r[0]]);h.push(s)}for(let e=0,t=0;e<n;e++){let n=l+i*e;for(let e=0;e<s;e++,t++){let s=u-o*e,i=h[e];if(2===i.length)n>=i[0]&&n<=i[1]&&(r.push([n,s]),p[t]=1);else if(i.length>2){let e=!1;for(let t=0;t<i.length;t+=2)if(n>=i[t]&&n<=i[t+1]){e=!0;break}e&&(r.push([n,s]),p[t]=1)}}}return{points:r,mask:p}}function S(e,t,r=null,s=!0){let i=e.spatialReference;if(i.equals(t)||!t)return e;let a=z(e),l=B(i,!0),p=B(t);if(0===a||null==l||null==p){let n=F(e,t,r,s);if(n&&null==l&&null!=p&&Math.abs(n.width-p)<M(t)&&w.projectIsLoaded()){let r=N(i);if(null!=r&&0===r.poleLocation&&e.width<(r.bbox[2]-r.bbox[0])/2)return function(e,t){let r=B(t);if(null==r)return null;let{xmin:n,ymin:s,xmax:i,ymax:a}=e,l=e.spatialReference,p=new u.A({spatialReference:l,rings:[[[n,s],[i,s],[i,a],[n,a],[n,s]]]}),c=w.projectExecute(p,t);if(2!==c.rings.length||!c.rings[0].length||!c.rings[1].length)return null;let{rings:h}=c,m=M(l),f=new o.A({spatialReference:t});for(let e=0;e<2;e++){n=i=h[e][0][0],s=a=h[e][0][1];for(let t=0;t<h[e].length;t++)n=n>h[e][t][0]?h[e][t][0]:n,i=i<h[e][t][0]?h[e][t][0]:i,s=s>h[e][t][1]?h[e][t][1]:s,a=a<h[e][t][1]?h[e][t][1]:a;if(0===e)f.ymin=s,f.ymax=a,f.xmin=n,f.xmax=i;else if(f.ymin=Math.min(f.ymin,s),f.ymax=Math.max(f.ymax,a),Math.abs(i-r/2)<m)f.xmin=n,f.xmax+=r;else{if(!(Math.abs(n+r/2)<m))return null;f.xmax=i+r}}return f}(e,t)||n}return n}let c=e.clone().normalize();if(1===c.length&&e.xmax<l&&e.xmax-l/2>M(i)){let{xmin:t,xmax:r}=e;for(let n=0;n<=a;n++){let s=0===n?t:-l/2,u=n===a?r-l*n:l/2;c[n]=new o.A({xmin:s,xmax:u,ymin:e.ymin,ymax:e.ymax,spatialReference:i})}}let h=c.map(e=>F(e,t,r,s)).filter(n.Ru);return 0===h.length?null:function(e,t){let r=B(e[0].spatialReference);if(e.length<2||null==r||(t??=M(e[0].spatialReference),1===(e=e.filter(e=>e.width>t)).length))return e[0];let{xmin:n,xmax:s,ymin:i,ymax:a}=e[0];for(let t=1;t<e.length;t++){let n=e[t];s=n.xmax+r*t,i=Math.min(i,n.ymin),a=Math.max(a,n.ymax)}return new o.A({xmin:n,xmax:s,ymin:i,ymax:a,spatialReference:e[0].spatialReference})}(h)}function _(e,t,r){if("extent"===e.type){let{xmin:t,ymin:r,xmax:n,ymax:s,spatialReference:i}=e;e=new u.A({rings:[[[t,s],[n,s],[n,r],[t,r],[t,s]]],spatialReference:i})}return e.spatialReference.equals(t)?e:(m(),w.projectExecute(e,t,{geographicTransformation:r}))}function F(e,t,r,n=!0,s=!0){let i=e.spatialReference;if(i.equals(t)||!t)return e;m();let o=w.projectExecute(e,t,{geographicTransformation:r});if(s&&t.isWebMercator&&o&&(o.ymax=Math.min(20037508.342787,o.ymax),o.ymin=Math.max(-20037508.342787,o.ymin),o.ymin>=o.ymax))return null;if(!n||!o)return o;let a=j(i,!0),u=j(t,!0);if(null==a||null==u)return o;let p=M(i,.001),c=M(i,500),h=M(t,.001);if(Math.abs(o.xmin-u[0])<h&&Math.abs(o.xmax-u[1])<h){let n=Math.abs(e.xmin-a[0]),s=Math.abs(a[1]-e.xmax);if(n<p&&s>c){o.xmin=u[0];let n=[];n.push(new l.A(e.xmax,e.ymin,i)),n.push(new l.A(e.xmax,(e.ymin+e.ymax)/2,i)),n.push(new l.A(e.xmax,e.ymax,i));let s=n.map(e=>P(e,t,r)).filter(e=>!isNaN(e?.x)).map(e=>e.x);o.xmax=Math.max.apply(null,s)}if(s<p&&n>c){o.xmax=u[1];let n=[];n.push(new l.A(e.xmin,e.ymin,i)),n.push(new l.A(e.xmin,(e.ymin+e.ymax)/2,i)),n.push(new l.A(e.xmin,e.ymax,i));let s=n.map(e=>P(e,t,r)).filter(e=>!isNaN(e?.x)).map(e=>e.x);o.xmin=Math.min.apply(null,s)}}else{let e=M(t,.001);Math.abs(o.xmin-u[0])<e&&(o.xmin=u[0]),Math.abs(o.xmax-u[1])<e&&(o.xmax=u[1])}return o}function B(e,t=!1){if(!e)return null;let r=t?20037508.342787:20037508.342788905;return e.isWebMercator?2*r:e.wkid&&e.isGeographic?360:2*g[e.wkid]||null}function j(e,t=!1){if(e.isGeographic)return[-180,180];let r=B(e,t);return r?[-r/2,r/2]:null}function Z(e,t,r,n){let s=(e-t)/r;return s-Math.floor(s)===0?n&&--s:s=Math.floor(s),s}function z(e,t=!1){let r=B(e.spatialReference);if(null==r)return 0;let n=t?0:-r/2,s=M(e.spatialReference),i=!t&&Math.abs(e.xmax-r/2)<s?r/2:e.xmax,o=!t&&Math.abs(e.xmin+r/2)<s?-r/2:e.xmin;return Z(i,n,r,!0)-Z(o,n,r,!1)}function G(e){let t=e.storageInfo.origin.x,r=B(e.spatialReference,!0);if(null==r)return{originX:t,halfWorldWidth:null,pyramidsInfo:null};let n=r/2,{nativePixelSize:s,storageInfo:i,extent:o}=e,{maximumPyramidLevel:a,blockWidth:l,pyramidScalingFactor:u}=i,p=s.x,c=[],h=null!=e.transform&&"gcs-shift"===e.transform.type,m=t+(h?0:n),f=h?r-t:n-t;for(let e=0;e<=a;e++){let e=(o.xmax-t)/p/l,r=e-Math.floor(e)===0?e:Math.ceil(e),n=f/p/l,s=n-Math.floor(n)===0?n:Math.ceil(n),i=Math.floor(m/p/l),a=Math.round(m/p)%l,h=(l-Math.round(f/p)%l)%l;c.push({resolutionX:p,blockWidth:l,datasetColumnCount:r,worldColumnCountFromOrigin:s,leftMargin:a,rightPadding:h,originColumnOffset:i}),p*=u}return{originX:t,halfWorldWidth:n,pyramidsInfo:c,hasGCSSShiftTransform:h}}function E(e){let t=e.isAdaptive&&null==e.spacing,r=e.spacing||[32,32],n=O(e),s={cols:n.size[0]+1,rows:n.size[1]+1},i=n.outofBoundPointCount>0&&n.outofBoundPointCount<n.offsets.length/2,o=n.outofBoundPointCount===n.offsets.length/2||t&&i?[0,0]:f(n.offsets,s,r,4),l=(o[0]+o[1])/2,u=e.projectedExtent.spatialReference,p=e.srcBufferExtent.spatialReference;if(t&&(i||l>4)&&(u.isGeographic||N(u),r=[4,4],n=O({...e,spacing:r}),s={cols:n.size[0]+1,rows:n.size[1]+1},o=f(n.offsets,s,r,4)),n.error=o,r[0]>1&&(n.coefficients=D(n.offsets,s,i)),e.includeGCSGrid&&!u.isGeographic&&!u.isWebMercator)if(p.isGeographic)n.gcsGrid={offsets:n.offsets,coefficients:n.coefficients,spacing:r};else{let t=N(u);if(null!=t&&!t.isEnvelope){let t=function(e){if(!e||e.isGeographic)return e;let t,r=String(e.wkid||e.wkt2||e.wkt);return y.has(r)?t=y.get(r):(t=(e.wkid?a.P.coordsys(e.wkid):a.P.fromString(a.a.PE_TYPE_PROJCS,e.wkt2||e.wkt)).getGeogcs().getCode(),y.set(r,t)),new c.A({wkid:t})}(u),o=S(e.projectedExtent,t),{offsets:l}=O({...e,srcBufferExtent:o,spacing:r}),p=D(l,s,i);n.gcsGrid={offsets:l,coefficients:p,spacing:r}}}return n}function O(e){let{projectedExtent:t,srcBufferExtent:r,pixelSize:n,datumTransformation:s,rasterTransform:i}=e,o=t.spatialReference,a=r.spatialReference;m();let u,{xmin:p,ymin:c,xmax:h,ymax:f}=t,g=B(a),d=null!=g&&(e.hasWrapAround||"gcs-shift"===i?.type),y=e.spacing||[32,32],x=y[0]*n.x,w=y[1]*n.y,A=1===y[0],v=Math.ceil((h-p)/x-.1/y[0])+ +!A,b=Math.ceil((f-c)/w-.1/y[1])+ +!A,C=R({cols:v,rows:b,xmin:p,ymax:f,xres:x,yres:w,inSR:o,outSR:a,datumTransformation:s,preferPE:y[0]<=4,usePixelCenter:A}),P=[],T=0,k=A?-1:NaN,{xmin:I,xmax:S,ymax:_,width:F,height:j}=r,Z=M(a,500),z=null!=g&&I>0&&S>g/2,G=N(o),E=null!=G&&G.poleLocation>0;for(let e=0;e<v;e++){let t=[];for(let r=0;r<b;r++){let n=C[e*b+r];if(d&&n[0]>S&&n[0]>g/2-Z?n[0]-=g:d&&0===e&&n[0]<0&&z&&!i&&(n[0]+=g),!n||isNaN(n[0])||isNaN(n[1]))P.push(k),P.push(k),t.push(null),T++;else{if(i){let e=i.inverseTransform(new l.A({x:n[0],y:n[1],spatialReference:a}));n=[e.x,e.y]}t.push(n),e>0&&d&&u[r]&&n[0]<u[r][0]&&(n[0]+=g,E&&n[0]>S&&n[0]>g&&(n[0]-=g)),P.push((n[0]-I)/F),P.push((_-n[1])/j)}}u=t}return{offsets:P,error:null,coefficients:null,outofBoundPointCount:T,spacing:y,size:A?[v,b]:[v-1,b-1]}}function D(e,t,r){let{cols:n,rows:s}=t,i=new Float32Array((n-1)*(s-1)*2*6),o=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),a=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let t=0;t<n-1;t++){for(let r=0;r<s-1;r++){let l=t*s*2+2*r,u=e[l],p=e[l+1],c=e[l+2],h=e[l+3];l+=2*s;let m=e[l],f=e[l+1],g=e[l+2],d=e[l+3],y=0,x=12*(r*(n-1)+t);for(let e=0;e<3;e++)i[x++]=o[y++]*u+o[y++]*c+o[y++]*g;y=0;for(let e=0;e<3;e++)i[x++]=o[y++]*p+o[y++]*h+o[y++]*d;y=0;for(let e=0;e<3;e++)i[x++]=a[y++]*u+a[y++]*m+a[y++]*g;y=0;for(let e=0;e<3;e++)i[x++]=a[y++]*p+a[y++]*f+a[y++]*d}if(r)for(let e=0;e<i.length;e++)isNaN(i[e])&&(i[e]=-1)}return i}function V(e){let{spatialReference:t}=e,r=(0,h.Vp)(t);if(!r)return e;let[n,s]=r.valid,i=s-n,a=0;if(e.xmin<n){let t=n-e.xmin;a=Math.ceil(t/i)}else if(e.xmin>s){let t=e.xmin-s;a=-Math.ceil(t/i)}return new o.A({spatialReference:e.spatialReference,xmin:e.xmin+a*i,ymin:e.ymin,xmax:e.xmax+a*i,ymax:e.ymax})}function U(e,t,r){let{storageInfo:n,pixelSize:s}=t,o=0,a=!1,{pyramidResolutions:u}=n,p="mixed"===n.tileInfo.format?.toLowerCase()?Math.max(1,Math.min(3,n.tileInfo.dpi/96)):1,c=(e.x+e.y)/2/p;if(null!=u&&u.length){let e=u[u.length-1],n=(e.x+e.y)/2,p=(s.x+s.y)/2;if(c<=p)o=0;else if(c>=n)o=u.length,a=c/n>8;else{let e,t=p;for(let n=1;n<=u.length;n++){if(e=(u[n-1].x+u[n-1].y)/2,c<=e){c===e?o=n:"down"===r?(o=n-1,a=c/t>8):o="up"===r||c-t>e-c||c/t>2?n:n-1;break}t=e}}let h=0===o?s:u[o-1];return a&&Math.min(h.x,h.y)*(0,i.GA)(t.spatialReference)>19567&&(a=!1),{pyramidLevel:o,pyramidResolution:new l.A({x:h.x,y:h.y,spatialReference:t.spatialReference}),excessiveReading:a}}let h=Math.log(e.x/s.x)/Math.LN2,m=Math.log(e.y/s.y)/Math.LN2,f=t.storageInfo.maximumPyramidLevel||0;o="down"===r?Math.floor(Math.min(h,m)):"up"===r?Math.ceil(Math.max(h,m)):Math.round((h+m)/2),o<0?o=0:o>f&&(a=o>f+3,o=f);let g=2**o;return{pyramidLevel:o,pyramidResolution:new l.A({x:g*t.nativePixelSize.x,y:g*t.nativePixelSize.y,spatialReference:t.spatialReference}),excessiveReading:a}}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9616],{69540(e,t,i){var n=i(32198),r=i(69622),s=(i(44208),i(4718)),o=(i(53966),i(97768)),a=i(88620),l=i(64108);const u=Symbol("ClonableMixin"),h=e=>{var t;let i=e,r=class extends i{constructor(){super(...arguments),this[t]=!0}static{t=u}clone(e){let t=(0,a.oY)(this);(0,o.Lw)(t,"unable to clone instance of non-accessor class");let i=t.metadata,n=t.store,r={},l=new Map;for(let t in i){let o=i[t],a=n?.originOf(t),u=o.clonable;if(o.readOnly||!1===u||7!==a&&0!==a&&5!==a&&4!==a)continue;let h=this[t],d=null;if("function"==typeof u)d=u(h,e);else if("reference"===u)d=h;else if(d=(0,s.TU)(h,e),null!=h&&null==d)continue;0===a?l.set(t,d):r[t]=d}let u=new(0,Object.getPrototypeOf(this).constructor)(r);if(l.size){let e=(0,a.oY)(u)?.store;if(e)for(let[t,i]of l)e.set(t,i,0)}return u}};return r=(0,n.Cg)([(0,l.$)("esri.core.Clonable")],r),r},d=h(r.A);i.d(t,["OU",0,h,"Pw",0,d])},66344(e,t,i){i.d(t,{q:()=>a});const n=!!(0,i(44208).A)("esri-tests-disable-gpu-memory-measurements");Symbol.iterator;class r{get size(){return this._size}constructor(e=10485760,t=.3){this._maxSize=e,this._maxClientSizeRatio=t,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._clients=new Map,this._sizeLimits=new Map}destroy(){this.clearAll(),this._sizeLimits.clear(),this._clients.clear(),this._db.clear()}register(e){this._clients.set(e.id.slice(0,-1),e)}deregister(e){this.clear(e),this._sizeLimits.delete(e),this._clients.delete(e.id.slice(0,-1))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,-1),this._checkSize()}get _maxClientSize(){return this._maxSize*this._maxClientSizeRatio}getSize(e,t){return this._db.get(e.id+t)?.size??0}put(e,t,i,r,o){t=e.id+t;let a=this._db.get(t);if(a&&(this._size-=a.size,e.size-=a.size,this._db.delete(t),a.entry!==i&&this._notifyRemove(t,a.entry,a.size,0)),r>this._maxSize)return void this._notifyRemove(t,i,r,0);if(void 0===i)return void console.warn("Refusing to cache undefined entry ");if(!r||r<0)return n||console.warn(`Refusing to cache entry with size ${r} for key ${t}`),void this._notifyRemove(t,i,0,0);let l=1+Math.max(o,-4)- -3;this._db.set(t,new s(i,r,l)),this._size+=r,e.size+=r,this._checkSize()}updateSize(e,t){t=e.id+t;let i=this._db.get(t);if(!i)return;this._size-=i.size,e.size-=i.size;let n=i.entry.usedMemory;for(;n>this._maxSize;){let e=this._notifyRemove(t,i.entry,n,1);if(!(null!=e&&e>0))return void this._db.delete(t);n=e}i.size=n,this._size+=n,e.size+=n,this._checkSize()}pop(e,t){t=e.id+t;let i=this._db.get(t);if(i)return this._size-=i.size,e.size-=i.size,this._db.delete(t),++this._hit,i.entry;++this._miss}get(e,t){t=e.id+t;let i=this._db.get(t);if(void 0!==i)return this._db.delete(t),i.lives=i.lifetime,this._db.set(t,i),++this._hit,i.entry;++this._miss}peek(e,t){let i=this._db.get(e.id+t);return i?++this._hit:++this._miss,i?.entry}get performanceInfo(){let e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},i=[];this._db.forEach((e,n)=>{let r=e.lifetime;i[r]=(i[r]||0)+e.size,this._clients.forEach(i=>{let{id:r,name:s}=i;if(n.startsWith(r)){let i=t[s]||0;t[s]=i+e.size}})});let n={};this._clients.forEach(e=>{let i=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){let r=t[i]||0;t[i]=r,n[i]=Math.round(100*e.hitRate)+"%"}else n[i]="0%"});let r=Object.keys(t);r.sort((e,i)=>t[i]-t[e]),r.forEach(i=>e[i]=Math.round(t[i]/2**20)+"MB / "+n[i]);for(let t=i.length-1;t>=0;--t){let n=i[t];n&&(e["Priority "+(t+-3-1)]=Math.round(n/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._clients.forEach(e=>e.resetHitRate())}clear(e){let t=e.id;this._db.forEach((e,i)=>{i.startsWith(t)&&(this._size-=e.size,this._db.delete(i),this._notifyRemove(i,e.entry,e.size,0))}),e.size=0}clearAll(){this._db.forEach((e,t)=>this._notifyRemove(t,e.entry,e.size,0)),this._clients.forEach(e=>e.size=0),this._size=0,this._db.clear()}*values(e){for(let[t,i]of this._db)t.startsWith(e.id)&&(yield i.entry)}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,i,n){let r=this._clients.get(e.split(o)[0])?.removeFunc,s=r?.(t,n,i);return"number"==typeof s?s:null}_checkSize(){this._sizeLimits.forEach((e,t)=>this._checkSizeLimits(e,t)),this._clients.forEach(e=>this._checkSizeLimits(this._maxClientSize,e)),this._checkSizeLimits(this.maxSize)}setMaxClientSize(e,t){null==t||t<=0?this._sizeLimits.delete(e):this._sizeLimits.set(e,t)}_checkSizeLimits(e,t){let i=t??this;if(i.size<=e)return;let n=t?.id,r=!0;for(;r;){r=!1;for(let[s,a]of this._db)if(0===a.lifetime&&(!n||s.startsWith(n))){let n=t??this._clients.get(s.split(o)[0]);if(this._purgeItem(s,a,n),i.size<=.9*e)return;r||=this._db.has(s)}}for(let[r,s]of this._db)if(!n||r.startsWith(n)){let n=t??this._clients.get(r.split(o)[0]);if(this._purgeItem(r,s,n),i.size<=.9*e)return}}_purgeItem(e,t,i){if(this._db.delete(e),t.lives<=1){this._size-=t.size,i&&(i.size-=t.size);let n=this._notifyRemove(e,t.entry,t.size,1);null!=n&&n>0&&(this._size+=n,i&&(i.size+=n),t.lives=t.lifetime,t.size=n,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}new r(0);class s{constructor(e,t,i){this.entry=e,this.size=t,this.lifetime=i,this.lives=i}}const o=":";class a{constructor(e,t){this.removeFunc=t,this.id="",this.name="",this.size=0,this._storage=new r(e,1),this._storage.register(this)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(e,t,i=1){this._storage.put(this,e,t,i,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}}},67482(e,t,i){function n(e){return null!==r(e)}function r(e){return function(e){let t=s.exec(e);if(!t?.groups)return null;let i=t.groups,n=+i.year,r=i.month-1,o=+i.day,a=+(i.hours??"0"),l=+(i.minutes??"0"),u=+(i.seconds??"0");if(a>23||l>59||u>59)return null;let h,d=i.ms??"0",c=d?+d.padEnd(3,"0").slice(0,3):0;if(i.isUTC||!i.offsetSign)h=Date.UTC(n,r,o,a,l,u,c);else{let e=+i.offsetHours,t=+i.offsetMinutes;h=6e4*("+"===i.offsetSign?-1:1)*(60*e+t)+Date.UTC(n,r,o,a,l,u,c)}return Number.isNaN(h)?null:h}(e)??function(e){let t=new Date(e),i=t.getTime();return Number.isNaN(i)?null:e.toLowerCase()===t.toUTCString().toLowerCase()?i:null}(e)??function(e){if(!o.test(e))return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t.getTime()-6e4*t.getTimezoneOffset()}(e)}i.d(t,{C:()=>n,_:()=>r});const s=/^(?:(?<year>-?\d{4,})-(?<month>\d{2})-(?<day>\d{2}))(?:T(?<hours>\d{2}):(?<minutes>\d{2}):(?<seconds>\d{2})(?:\.(?<ms>\d+))?)?(?:(?<isUTC>Z)|(?:(?<offsetSign>\+|-)(?<offsetHours>\d{2}):(?<offsetMinutes>\d{2})))?$/,o=/^((\d{1,2}[/-]\d{1,2}[/-]\d{4})|(\d{4}[/-]\d{1,2}[/-]\d{1,2}))( \d{1,2}:\d{1,2}:\d{1,2}( ((AM)|(PM)))?)?$/i},9093(e,t,i){function n(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function r(e){return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]}i.d(t,{o8:()=>r,vt:()=>n});const s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:s,clone:r,create:n,fromValues:function(e,t,i,n,r,s,o,a,l,u,h,d,c,m,f,p){return[e,t,i,n,r,s,o,a,l,u,h,d,c,m,f,p]}},Symbol.toStringTag,{value:"Module"})),i.d(t,["zK",0,s])},35522(e,t,i){i.d(t,{$A:()=>F,Bw:()=>s,C:()=>o,Cc:()=>w,DI:()=>v,Io:()=>_,Ln:()=>g,Om:()=>I,Qr:()=>d,Re:()=>u,S8:()=>S,T9:()=>p,WQ:()=>l,Z0:()=>T,_S:()=>m,aI:()=>D,ei:()=>A,fw:()=>B,gL:()=>z,hG:()=>M,hZ:()=>a,hs:()=>y,jk:()=>f,lw:()=>h,m3:()=>b,oW:()=>O,t2:()=>E,tn:()=>c,ze:()=>x});var n=i(51850),r=i(34304);function s(e){let t=e[0],i=e[1],n=e[2];return Math.sqrt(t*t+i*i+n*n)}function o(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function a(e,t,i,n){return e[0]=t,e[1]=i,e[2]=n,e}function l(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e}function u(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e}function h(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e[2]=t[2]*i[2],e}function d(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e[2]=t[2]/i[2],e}function c(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}function m(e,t){return e[0]=Math.sign(t[0]),e[1]=Math.sign(t[1]),e[2]=Math.sign(t[2]),e}function f(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e[2]=Math.min(t[2],i[2]),e}function p(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e[2]=Math.max(t[2],i[2]),e}function y(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e}function g(e,t,i,n){return e[0]=t[0]+i[0]*n,e[1]=t[1]+i[1]*n,e[2]=t[2]+i[2]*n,e}function _(e,t){let i=t[0]-e[0],n=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(i*i+n*n+r*r)}function M(e,t){let i=t[0]-e[0],n=t[1]-e[1],r=t[2]-e[2];return i*i+n*n+r*r}function b(e){let t=e[0],i=e[1],n=e[2];return t*t+i*i+n*n}function x(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function v(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function S(e,t=e){let i=t[0],n=t[1],r=t[2],s=i*i+n*n+r*r;return s>0&&(s=1/Math.sqrt(s),e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s),e}function I(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function F(e,t,i){let n=t[0],r=t[1],s=t[2],o=i[0],a=i[1],l=i[2];return e[0]=r*l-s*a,e[1]=s*o-n*l,e[2]=n*a-r*o,e}function w(e,t,i,n){let r=t[0],s=t[1],o=t[2];return e[0]=r+n*(i[0]-r),e[1]=s+n*(i[1]-s),e[2]=o+n*(i[2]-o),e}function T(e,t,i){let n=t[0],r=t[1],s=t[2];return e[0]=i[0]*n+i[4]*r+i[8]*s+i[12],e[1]=i[1]*n+i[5]*r+i[9]*s+i[13],e[2]=i[2]*n+i[6]*r+i[10]*s+i[14],e}function A(e,t,i){let n=t[0],r=t[1],s=t[2];return e[0]=n*i[0]+r*i[3]+s*i[6],e[1]=n*i[1]+r*i[4]+s*i[7],e[2]=n*i[2]+r*i[5]+s*i[8],e}function z(e,t,i){return B(e,t,i[0],i[1],i[2],i[3])}function B(e,t,i,n,r,s){let o=t[0],a=t[1],l=t[2],u=n*l-r*a,h=r*o-i*l,d=i*a-n*o,c=n*d-r*h,m=r*u-i*d,f=i*h-n*u,p=2*s;return e[0]=o+u*p+2*c,e[1]=a+h*p+2*m,e[2]=l+d*p+2*f,e}const C=(0,n.vt)(),R=(0,n.vt)();function E(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function D(e,t){if(e===t)return!0;let i=e[0],n=e[1],s=e[2],o=t[0],a=t[1],l=t[2],u=(0,r.FD)();return Math.abs(i-o)<=u*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(n-a)<=u*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-l)<=u*Math.max(1,Math.abs(s),Math.abs(l))}function O(e,t,i){let n=i[0]-t[0],r=i[1]-t[1],s=i[2]-t[2],o=n*n+r*r+s*s;return o>0?(o=1/Math.sqrt(o),e[0]=n*o,e[1]=r*o,e[2]=s*o,e):(e[0]=0,e[1]=0,e[2]=0,e)}const q=u,N=h,P=d,Z=_,L=M,j=s,Y=b;Object.freeze(Object.defineProperty({__proto__:null,abs:c,add:l,angle:function(e,t){S(C,e),S(R,t);let i=I(C,R);return i>1?0:i<-1?Math.PI:Math.acos(i)},bezier:function(e,t,i,n,r,s){let o=1-s,a=o*o,l=s*s,u=a*o,h=3*s*a,d=3*l*o,c=l*s;return e[0]=t[0]*u+i[0]*h+n[0]*d+r[0]*c,e[1]=t[1]*u+i[1]*h+n[1]*d+r[1]*c,e[2]=t[2]*u+i[2]*h+n[2]*d+r[2]*c,e},ceil:function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e},clamp:function(e,t=0,i=1){return e[0]=Math.min(Math.max(e[0],t),i),e[1]=Math.min(Math.max(e[1],t),i),e[2]=Math.min(Math.max(e[2],t),i),e},copy:o,cross:F,crossAndNormalize:function(e,t,i){let n=t[0],r=t[1],s=t[2],o=i[0],a=i[1],l=i[2],u=r*l-s*a,h=s*o-n*l,d=n*a-r*o,c=Math.sqrt(u*u+h*h+d*d);return e[0]=u/c,e[1]=h/c,e[2]=d/c,e},direction:O,dist:Z,distance:_,div:P,divide:d,dot:I,equals:D,exactEquals:E,floor:function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e},hermite:function(e,t,i,n,r,s){let o=s*s,a=o*(2*s-3)+1,l=o*(s-2)+s,u=o*(s-1),h=o*(3-2*s);return e[0]=t[0]*a+i[0]*l+n[0]*u+r[0]*h,e[1]=t[1]*a+i[1]*l+n[1]*u+r[1]*h,e[2]=t[2]*a+i[2]*l+n[2]*u+r[2]*h,e},inverse:v,len:j,length:s,lerp:w,max:p,min:f,mul:N,multiply:h,negate:x,normalize:S,random:function(e,t=1){let i=r.Ov,n=2*i()*Math.PI,s=2*i()-1,o=Math.sqrt(1-s*s)*t;return e[0]=Math.cos(n)*o,e[1]=Math.sin(n)*o,e[2]=s*t,e},rotateX:function(e,t,i,n){let r=[],s=[];return r[0]=t[0]-i[0],r[1]=t[1]-i[1],r[2]=t[2]-i[2],s[0]=r[0],s[1]=r[1]*Math.cos(n)-r[2]*Math.sin(n),s[2]=r[1]*Math.sin(n)+r[2]*Math.cos(n),e[0]=s[0]+i[0],e[1]=s[1]+i[1],e[2]=s[2]+i[2],e},rotateY:function(e,t,i,n){let r=[],s=[];return r[0]=t[0]-i[0],r[1]=t[1]-i[1],r[2]=t[2]-i[2],s[0]=r[2]*Math.sin(n)+r[0]*Math.cos(n),s[1]=r[1],s[2]=r[2]*Math.cos(n)-r[0]*Math.sin(n),e[0]=s[0]+i[0],e[1]=s[1]+i[1],e[2]=s[2]+i[2],e},rotateZ:function(e,t,i,n){let r=[],s=[];return r[0]=t[0]-i[0],r[1]=t[1]-i[1],r[2]=t[2]-i[2],s[0]=r[0]*Math.cos(n)-r[1]*Math.sin(n),s[1]=r[0]*Math.sin(n)+r[1]*Math.cos(n),s[2]=r[2],e[0]=s[0]+i[0],e[1]=s[1]+i[1],e[2]=s[2]+i[2],e},round:function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e},scale:y,scaleAndAdd:g,scaleTo:function(e,t){return y(e,e,t/j(e))},set:a,sign:m,sqrDist:L,sqrLen:Y,squaredDistance:M,squaredLength:b,str:function(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"},sub:q,subtract:u,transformMat3:A,transformMat4:T,transformMat4Z:function(e,t){return t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]},transformQuat:z,transformQuatValues:B},Symbol.toStringTag,{value:"Module"})),i.d(t,["Il",0,j,"jb",0,q,"lo",0,L,"uE",0,Y])},75503(e,t,i){i.d(t,{wq:()=>a});var n=i(4576),r=i(21818),s=(i(44208),i(15142)),o=i(11006);class a{constructor(e=9,t){this._compareMinX=c,this._compareMinY=m,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),x.prune(),v.prune(),S.prune(),I.prune()}all(e){l(this._data,e)}search(e,t){let i=this._data,n=this._toBBox;if(M(e,i))for(x.clear();i;){for(let r=0,s=i.children.length;r<s;r++){let s=i.children[r],o=i.leaf?n(s):s;M(e,o)&&(i.leaf?t(s):_(e,o)?l(s,t):x.push(s))}i=x.pop()}}collides(e){let t=this._data,i=this._toBBox;if(!M(e,t))return!1;for(x.clear();t;){for(let n=0,r=t.children.length;n<r;n++){let r=t.children[n],s=t.leaf?i(r):r;if(M(e,s)){if(t.leaf||_(e,s))return!0;x.push(r)}}t=x.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,i=e.length;t<i;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){let e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new T([]),this}remove(e){if(!e)return this;let t,i=this._data,s=null,o=0,a=!1,l=this._toBBox(e);for(S.clear(),I.clear();i||S.length>0;){if(i||(i=S.pop(),s=S.data[S.length-1],o=I.pop()??0,a=!0),i.leaf&&(t=(0,n.qh)(i.children,(0,r.z)(e),i.children.length,i.indexHint),-1!==t))return i.children.splice(t,1),S.push(i),this._condense(S),this;a||i.leaf||!_(i,l)?s?(o++,i=s.children[o],a=!1):i=null:(S.push(i),I.push(o),o=0,s=i,i=i.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_build(e,t,i,n){let r=i-t+1,s=this._maxEntries;if(r<=s){let n=new T(e.slice(t,i+1));return u(n,this._toBBox),n}n||(n=Math.ceil(Math.log(r)/Math.log(s)),s=Math.ceil(r/s**(n-1)));let o=new A([]);o.height=n;let a=Math.ceil(r/s),l=a*Math.ceil(Math.sqrt(s));b(e,t,i,l,this._compareMinX);for(let r=t;r<=i;r+=l){let t=Math.min(r+l-1,i);b(e,r,t,a,this._compareMinY);for(let i=r;i<=t;i+=a){let r=Math.min(i+a-1,t);o.children.push(this._build(e,i,r,n-1))}}return u(o,this._toBBox),o}_insert(e,t,i){let n=this._toBBox,r=i?e:n(e);S.clear();let s=function(e,t,i,n){for(;n.push(t),!0!==t.leaf&&n.length-1!==i;){let i,n=1/0,r=1/0;for(let s=0,o=t.children.length;s<o;s++){let o=t.children[s],a=f(o),l=y(e,o)-a;l<r?(r=l,n=a<n?a:n,i=o):l===r&&a<n&&(n=a,i=o)}t=i||t.children[0]}return t}(r,this._data,t,S);for(s.children.push(e),d(s,r);t>=0&&S.data[t].children.length>this._maxEntries;)this._split(S,t),t--;!function(e,t,i){for(let n=i;n>=0;n--)d(t.data[n],e)}(r,S,t)}_split(e,t){let i=e.data[t],n=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,n);let s=this._chooseSplitIndex(i,r,n);if(!s)return;let o=i.children.splice(s,i.children.length-s),a=i.leaf?new T(o):new A(o);a.height=i.height,u(i,this._toBBox),u(a,this._toBBox),t?e.data[t-1].children.push(a):this._splitRoot(i,a)}_splitRoot(e,t){this._data=new A([e,t]),this._data.height=e.height+1,u(this._data,this._toBBox)}_chooseSplitIndex(e,t,i){let n,r,s;n=r=1/0;for(let o=t;o<=i-t;o++){let t=h(e,0,o,this._toBBox),a=h(e,o,i,this._toBBox),l=g(t,a),u=f(t)+f(a);l<n?(n=l,s=o,r=u<r?u:r):l===n&&u<r&&(r=u,s=o)}return s}_chooseSplitAxis(e,t,i){let n=e.leaf?this._compareMinX:c,r=e.leaf?this._compareMinY:m;this._allDistMargin(e,t,i,n)<this._allDistMargin(e,t,i,r)&&e.children.sort(n)}_allDistMargin(e,t,i,n){e.children.sort(n);let r=this._toBBox,s=h(e,0,t,r),o=h(e,i-t,i,r),a=p(s)+p(o);for(let n=t;n<i-t;n++){let t=e.children[n];d(s,e.leaf?r(t):t),a+=p(s)}for(let n=i-t-1;n>=t;n--){let t=e.children[n];d(o,e.leaf?r(t):t),a+=p(o)}return a}_condense(e){for(let t=e.length-1;t>=0;t--){let i=e.data[t];if(0===i.children.length)if(t>0){let r=e.data[t-1],s=r.children;s.splice((0,n.qh)(s,i,s.length,r.indexHint),1)}else this.clear();else u(i,this._toBBox)}}_initFormat(e){let t=["return a"," - b",";"];this._compareMinX=Function("a","b",t.join(e[0])),this._compareMinY=Function("a","b",t.join(e[1])),this._toBBox=Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function l(e,t){let i=e;for(v.clear();i;){if(!0===i.leaf)for(let e of i.children)t((0,r.z)(e));else v.pushArray(i.children);i=v.pop()??null}}function u(e,t){h(e,0,e.children.length,t,e)}function h(e,t,i,n,r){r||=new T([]),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let s,o=t;o<i;o++)s=e.children[o],d(r,e.leaf?n(s):s);return r}function d(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function c(e,t){return e.minX-t.minX}function m(e,t){return e.minY-t.minY}function f(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function p(e){return e.maxX-e.minX+(e.maxY-e.minY)}function y(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function g(e,t){let i=Math.max(e.minX,t.minX),n=Math.max(e.minY,t.minY),r=Math.min(e.maxX,t.maxX),s=Math.min(e.maxY,t.maxY);return Math.max(0,r-i)*Math.max(0,s-n)}function _(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function M(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function b(e,t,i,n,r){let s=[t,i];for(;s.length;){let t=s.pop(),i=s.pop();if(t-i<=n)continue;let a=i+Math.ceil((t-i)/n/2)*n;(0,o.q)(e,a,i,t,r),s.push(i,a,a,t)}}const x=new s.A,v=new s.A,S=new s.A,I=new s.A({deallocator:void 0});class F{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class w extends F{constructor(){super(...arguments),this.height=1,this.indexHint=new n.vW}}class T extends w{constructor(e){super(),this.children=e,this.leaf=!0}}class A extends w{constructor(e){super(),this.children=e,this.leaf=!1}}},69397(e,t,i){i.d(t,{Qf:()=>l,Qh:()=>o,lM:()=>s,ro:()=>u,rq:()=>h});var n=i(44208),r=i(34275);function s(e){if(!e)return 0;let t=d;for(let i in e)e.hasOwnProperty(i)&&(t+=a(e[i],!1));return t}function o(e){if(!e)return 0;if("number"==typeof e[0])return l(e);if(Array.isArray(e))return function(e){let t=e.length;if(0===t||"number"==typeof e[0])return h(e,8);let i=c;for(let n=0;n<t;n++)i+=a(e[n]);return i}(e);let t=d;for(let i in e)e.hasOwnProperty(i)&&(t+=a(e[i]));return t}function a(e,t=!0){switch(typeof e){case"object":return t?o(e):d;case"string":return function(e){return 32+e.length}(e);case"number":return 16;case"boolean":return 4;default:return 8}}function l(...e){return e.reduce((e,t)=>e+u(t),0)}function u(e,t=16){return e?(0,r.iu)(e)?e.byteLength+f:Array.isArray(e)?h(e,t):0:0}function h(e,t){return c+e.length*t}const d=32,c=16,m=(0,n.A)("ios")||!(0,n.A)("chrome")&&!(0,n.A)("opr")?8:4,f=145;i.d(t,["JY",0,m])},36708(e,t,i){i.d(t,{C_:()=>c,on:()=>d,wB:()=>l,z7:()=>u});var n=i(37955),r=i(36563),s=i(97768),o=i(17676),a=i(14012);function l(e,t,i={}){return h(e,t,i,m)}function u(e,t,i={}){return h(e,t,i,f)}function h(e,t,i={},n){let r=null,o=i.once?(e,i)=>{n(e)&&((0,s.xt)(r),t(e,i))}:(e,i)=>{n(e)&&t(e,i)};if(r=(0,a.Cn)(e,o,i.sync,i.equals),i.initial){let t=e();o(t,t)}return r}function d(e,t,i,o={}){let a=null,u=null,h=null;function d(){a&&u&&(u.remove(),o.onListenerRemove?.(a),a=null,u=null)}function c(e){o.once&&o.once&&(0,s.xt)(h),i(e)}let m=l(e,(e,i)=>{d(),(0,n.wb)(e)&&(a=e,u=(0,n.on)(e,t,c),o.onListenerAdd?.(e))},{sync:o.sync,initial:!0});return h=(0,r.hA)(()=>{m.remove(),d()}),h}function c(e,t){return function(e,t,i){if((0,o.G4)(i))return Promise.reject((0,o.NK)());let n=e();if(t?.(n))return Promise.resolve(n);let a=null;function l(){a=(0,s.xt)(a)}return new Promise((n,s)=>{a=(0,r.vE)([(0,o.u7)(i,()=>{l(),s((0,o.NK)())}),h(e,e=>{l(),n(e)},{sync:!1,once:!0},t??m)])})}(e,f,t)}function m(e){return!0}function f(e){return!!e}i(80559),i.d(t,["OH",0,{sync:!0},"Vh",0,{initial:!0},"pc",0,{sync:!0,initial:!0}])},44794(e,t,i){i.d(t,{v:()=>a});var n=i(4718),r=i(62788),s=i(95488);class o{constructor(e,t){this._observable=new s.I,this._value=e,this._equalityFunction=t}get value(){return(0,r.gc)(this._observable),this._value}set value(e){this._equalityFunction(e,this._value)||(this._value=e,this._observable.notify())}mutate(e){e(this._value),this._observable.notify()}}function a(e,t=n.gh){return new o(e,t)}},88930(e,t,i){i.d(t,{S1:()=>a,VW:()=>l,lL:()=>u,rb:()=>h,t:()=>d});var n=i(97770),r=(i(98623),i(34747));const s=/^(?<hh>([01][0-9])|(2[0-3])):(?<mm>[0-5][0-9])(:(?<ss>[0-5][0-9]))?(\.(?<ms>\d+))?$/,o={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8,unknown:NaN};function a(e,t,i,s="system"){if("unknown"===i)return e;let o=new r.oh((0,n.wj)(s)),a=r.c9.fromJSDate(e,{zone:o}),l="decades"===i||"centuries"===i?"year":function(e){switch(e){case"milliseconds":return"millisecond";case"seconds":return"second";case"minutes":return"minute";case"hours":return"hour";case"days":return"day";case"weeks":return"week";case"months":return"month";case"years":return"year"}}(i);return"decades"===i&&(t*=10),"centuries"===i&&(t*=100),a.plus({[l]:t}).toJSDate()}function l(e,t,i="milliseconds"){let n=e.getTime(),r=d(t,i,"milliseconds");return new Date(n+r)}function u(e,t,i="system"){let{unit:s}=t,o=Math.max(1,Math.trunc(t.value)),a=new r.oh((0,n.wj)(i)),l=r.c9.fromJSDate(e,{zone:a}),u=e=>e-e%o;switch(s){case"milliseconds":return l.startOf("second").plus({millisecond:u(l.millisecond)}).toJSDate();case"seconds":return l.startOf("minute").plus({second:u(l.second)}).toJSDate();case"minutes":return l.startOf("hour").plus({minute:u(l.minute)}).toJSDate();case"hours":return l.startOf("day").plus({hour:u(l.hour)}).toJSDate();case"days":return l.startOf("month").plus({day:u(l.day-1)}).toJSDate();case"weeks":{let e=l.startOf("year").startOf("week"),t=Math.floor(l.diff(e,"weeks").weeks);return e.plus({week:u(t)}).toJSDate()}case"months":return l.startOf("year").plus({month:u(l.month-1)}).toJSDate();case"years":case"decades":case"centuries":{let e=l.startOf("year"),t=("decades"===s?10:"centuries"===s?100:1)*o,i=e.year-e.year%t;return e.set({year:i}).toJSDate()}case"unknown":return e}}function h(e){let t=s.exec(e);if(!t)return null;let{hh:i,mm:n,ss:r,ms:a}=t.groups;return Number(i)*o.hours+Number(n)*o.minutes+Number(r||0)*o.seconds+Number(a||0)}function d(e,t,i){return 0===e?0:e*o[t]/o[i]}},48526(e,t,i){i.d(t,{A:()=>y});var n,r=i(32198),s=i(4576),o=i(4718),a=i(91429),l=i(5443),u=i(91075),h=i(86738),d=i(16930),c=i(90634),m=i(47610),f=i(56993),p=i(43937);let y=n=class extends u.A{constructor(e){super(function(e){if(!e)return;let{points:t,hasM:i,hasZ:n,spatialReference:r}=e;switch(t??=[],t?.at(0)?.length){case 4:n??=!0,i??=!0;break;case 3:n??=!0!==i,i??=!n;break;default:n??=!1,i??=!1}return r??=d.A.WGS84,{...e,hasM:i,hasZ:n,points:t,spatialReference:r}}(e)),this.points=[],this.type="multipoint"}get cache(){return this.commitProperty("points"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get extent(){let e=(0,c.ge)(this);return e?new l.A({...e,spatialReference:this.spatialReference}):null}writePoints(e,t){t.points=(0,o.o8)(this.points)}clone(){let{points:e,spatialReference:t,hasM:i,hasZ:r}=this;return new n({points:(0,o.o8)(e),spatialReference:t.clone(),hasM:i,hasZ:r})}equals(e){if(this===e)return!0;if(null==e)return!1;let t=this.spatialReference,i=e.spatialReference;return!(null!=t!=(null!=i)||null!=t&&null!=i&&!t.equals(i))&&(0,s.aI)(this.points,e.points,m.v6)}addPoint(e){return(0,f.h)(this,e),Array.isArray(e)?this.points.push(e):this.points.push(e.toArray()),this.notifyChange("points"),this}getPoint(e){if(!this._validateInputs(e))return null;let t=this.points[e],i={x:t[0],y:t[1],spatialReference:this.spatialReference},n=2;return this.hasZ&&(i.z=t[2],n=3),this.hasM&&(i.m=t[n]),new h.A(i)}removePoint(e){if(!this._validateInputs(e))return null;let t=new h.A(this.points.splice(e,1)[0],this.spatialReference);return this.notifyChange("points"),t}setPoint(e,t){return this._validateInputs(e)&&((0,f.h)(this,t),Array.isArray(t)||(t=t.toArray()),this.points[e]=t,this.notifyChange("points")),this}toJSON(e){return this.write({},e)}_validateInputs(e){return null!=e&&e>=0&&e<this.points.length}};(0,r.Cg)([(0,a.MZ)({readOnly:!0})],y.prototype,"cache",null),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],y.prototype,"extent",null),(0,r.Cg)([(0,a.MZ)({type:[[Number]],json:{write:{isRequired:!0}}})],y.prototype,"points",void 0),(0,r.Cg)([(0,p.K)("points")],y.prototype,"writePoints",null),y=n=(0,r.Cg)([(0,a.$K)("esri.geometry.Multipoint")],y),y.prototype.toJSON.isDefaultToJSON=!0},82799(e,t,i){i.d(t,{A:()=>f});var n,r=i(32198),s=i(4718),o=i(91429),a=i(5443),l=i(91075),u=i(86738),h=i(16930),d=i(90634),c=i(56993),m=i(43937);let f=n=class extends l.A{constructor(e){super(function(e){if(!e)return;let{paths:t,hasM:i,hasZ:n,spatialReference:r}=e;switch(t??=[],function(e){return"number"==typeof e[0]?.[0]}(t)&&(t=[t]),t[0]?.[0]?.length){case 4:n??=!0,i??=!0;break;case 3:n??=!0!==i,i??=!n;break;default:n??=!1,i??=!1}return r??=h.A.WGS84,{...e,hasM:i,hasZ:n,paths:t,spatialReference:r}}(e)),this.curvePaths=void 0,this.paths=[],this.type="polyline"}get cache(){return this.commitProperty("curvePaths"),this.commitProperty("hasM"),this.commitProperty("hasZ"),this.commitProperty("paths"),this.commitProperty("spatialReference"),{}}writeCurvePaths(e,t){t.curvePaths=(0,s.o8)(e)}get extent(){let e=(0,d.Z3)(this),{spatialReference:t}=this;return e?new a.A({...e,spatialReference:t}):null}writePaths(e,t){t.paths=(0,s.o8)(this.paths)}addPath(e){if(!e)return;let t=this.paths,i=t.length;if(function(e){return!Array.isArray(e[0])}(e)){let n=[];for(let t=0,i=e.length;t<i;t++)n[t]=e[t].toArray();t[i]=n}else t[i]=e.slice();return this.notifyChange("paths"),this}clone(){let e=new n;return e.spatialReference=this.spatialReference,e.paths=(0,s.o8)(this.paths),e.curvePaths=(0,s.o8)(this.curvePaths),e.hasZ=this.hasZ,e.hasM=this.hasM,e}getPoint(e,t){if(!this._validateInputs(e,t))return null;let i=this.paths[e][t],n=this.hasZ,r=this.hasM;return n&&!r?new u.A(i[0],i[1],i[2],void 0,this.spatialReference):r&&!n?new u.A(i[0],i[1],void 0,i[2],this.spatialReference):n&&r?new u.A(i[0],i[1],i[2],i[3],this.spatialReference):new u.A(i[0],i[1],this.spatialReference)}insertPoint(e,t,i){return this._validateInputs(e,t,!0)&&((0,c.h)(this,i),Array.isArray(i)||(i=i.toArray()),this.paths[e].splice(t,0,i),this.notifyChange("paths")),this}removePath(e){if(!this._validateInputs(e,null))return null;let t=this.paths.splice(e,1)[0],i=this.spatialReference,n=t.map(e=>new u.A(e,i));return this.notifyChange("paths"),n}removePoint(e,t){if(!this._validateInputs(e,t))return null;let i=new u.A(this.paths[e].splice(t,1)[0],this.spatialReference);return this.notifyChange("paths"),i}setPoint(e,t,i){return this._validateInputs(e,t)&&((0,c.h)(this,i),Array.isArray(i)||(i=i.toArray()),this.paths[e][t]=i,this.notifyChange("paths")),this}_validateInputs(e,t,i=!1){if(null==e||e<0||e>=this.paths.length)return!1;if(null!=t){let n=this.paths[e];if(i&&(t<0||t>n.length)||!i&&(t<0||t>=n.length))return!1}return!0}toJSON(e){return this.write({},e)}};(0,r.Cg)([(0,o.MZ)({readOnly:!0})],f.prototype,"cache",null),(0,r.Cg)([(0,o.MZ)({json:{write:!0,origins:{"portal-item":{write:!1},"web-map":{write:!1},"web-scene":{write:!1}}}})],f.prototype,"curvePaths",void 0),(0,r.Cg)([(0,m.K)("curvePaths")],f.prototype,"writeCurvePaths",null),(0,r.Cg)([(0,o.MZ)({readOnly:!0})],f.prototype,"extent",null),(0,r.Cg)([(0,o.MZ)({type:[[[Number]]],json:{write:{isRequired:!0}}})],f.prototype,"paths",void 0),(0,r.Cg)([(0,m.K)("paths")],f.prototype,"writePaths",null),f=n=(0,r.Cg)([(0,o.$K)("esri.geometry.Polyline")],f),f.prototype.toJSON.isDefaultToJSON=!0},4197(e,t,i){i.d(t,{Vj:()=>h,cj:()=>u,jh:()=>s,l5:()=>a,yH:()=>l});var n=i(34275),r=i(9093);function s(e){return e<=1024?Array(e).fill(0):new Float64Array(e)}function o(e){return((0,n.iu)(e)?e.byteLength/8:e.length)<=1024?Array.from(e):new Float64Array(e)}function a(e,t,i){return Array.isArray(e)?e.slice(t,t+i):e.subarray(t,t+i)}function l(e,t){if(0===t.length)return o(e);if(0===e.length)return o(t);let i=s(e.length+t.length);for(let t=0;t<e.length;++t)i[t]=e[t];for(let n=0;n<t.length;++n)i[e.length+n]=t[n];return i}function u(e){return[...e]}function h(e){let t=(0,r.vt)();for(let i=0;i<16;++i)t[i]=e[i];return t}},70328(e,t,i){i.d(t,{BI:()=>T,C:()=>o,DC:()=>c,Ej:()=>M,Ie:()=>F,Jt:()=>w,Lu:()=>x,Ne:()=>v,RF:()=>d,TF:()=>g,VL:()=>f,aI:()=>z,fA:()=>a,gE:()=>u,gX:()=>_,hZ:()=>I,iT:()=>m,is:()=>A,pg:()=>b,uJ:()=>y,vI:()=>S,vY:()=>l,vt:()=>s,w1:()=>h,yr:()=>p}),i(35522);var n=i(5443),r=(i(19419),i(4197));function s(e=C){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function o(e,t){for(let i=0;i<6;i++)e[i]=t[i];return e}function a(e,t,i,n,r,o,a=s()){return a[0]=e,a[1]=t,a[2]=i,a[3]=n,a[4]=r,a[5]=o,a}function l(e,t=s()){return function(e,t,i,n=s()){return I(n,B),function(e,t,i=0,n=t.length/3){let r=e[0],s=e[1],o=e[2],a=e[3],l=e[4],u=e[5];for(let e=0;e<n;e++)r=Math.min(r,t[i+3*e]),s=Math.min(s,t[i+3*e+1]),o=Math.min(o,t[i+3*e+2]),a=Math.max(a,t[i+3*e]),l=Math.max(l,t[i+3*e+1]),u=Math.max(u,t[i+3*e+2]);e[0]=r,e[1]=s,e[2]=o,e[3]=a,e[4]=l,e[5]=u}(n,e,t,i),n}(e,0,e.length/3,t)}function u(e,t=(0,r.jh)(24)){let[i,n,s,o,a,l]=e;return t[0]=i,t[1]=n,t[2]=s,t[3]=i,t[4]=n,t[5]=l,t[6]=i,t[7]=a,t[8]=s,t[9]=i,t[10]=a,t[11]=l,t[12]=o,t[13]=n,t[14]=s,t[15]=o,t[16]=n,t[17]=l,t[18]=o,t[19]=a,t[20]=s,t[21]=o,t[22]=a,t[23]=l,t}function h(e,t){return isFinite(e[2])||isFinite(e[5])?new n.A({xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],zmin:e[2],zmax:e[5],spatialReference:t}):new n.A({xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],spatialReference:t})}function d(e,t,i=e){i[0]=Math.min(e[0],t[0]),i[1]=Math.min(e[1],t[1]),i[2]=Math.min(e[2],t[2]),i[3]=Math.max(e[3],t[3]),i[4]=Math.max(e[4],t[4]),i[5]=Math.max(e[5],t[5])}function c(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[3]=Math.max(e[3],t[2]),e[4]=Math.max(e[4],t[3])}function m(e,[t,i,n]){!function(e,t,i,n){e[0]=Math.min(e[0],t),e[1]=Math.min(e[1],i),e[2]=Math.min(e[2],n),e[3]=Math.max(e[3],t),e[4]=Math.max(e[4],i),e[5]=Math.max(e[5],n)}(e,t,i,n)}function f(e){return e[0]>=e[3]?0:e[3]-e[0]}function p(e){return e[1]>=e[4]?0:e[4]-e[1]}function y(e){return e[2]>=e[5]?0:e[5]-e[2]}function g(e){let t=f(e),i=y(e),n=p(e);return t*t+i*i+n*n}function _(e,t=[0,0,0]){return t[0]=e[0]+f(e)/2,t[1]=e[1]+p(e)/2,t[2]=e[2]+y(e)/2,t}function M(e,t=[0,0,0]){return t[0]=f(e),t[1]=p(e),t[2]=y(e),t}function b(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function x(e,t){return t[0]=e[3],t[1]=e[4],t[2]=e[5],t}function v(e,t,i=e){return i[0]=t[0],i[1]=t[1],i[2]=t[2],i!==e&&(i[3]=e[3],i[4]=e[4],i[5]=e[5]),i}function S(e,t,i=e){return i[3]=t[0],i[4]=t[1],i[5]=t[2],i!==e&&(i[0]=e[0],i[1]=e[1],i[2]=e[2]),e}function I(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function F(e){return e?I(e,B):s(B)}function w(e,t){return e[0]=t[0],e[1]=t[1],e[2]=-1/0,e[3]=t[2],e[4]=t[3],e[5]=1/0,e}function T(e,t,i,n,r){return e[0]=t,e[1]=i,e[2]=-1/0,e[3]=n,e[4]=r,e[5]=1/0,e}function A(e){return 6===e.length}function z(e,t,i){if(null==e||null==t)return e===t;if(!A(e)||!A(t))return!1;if(i){for(let n=0;n<e.length;n++)if(!i(e[n],t[n]))return!1}else for(let i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0}const B=[1/0,1/0,1/0,-1/0,-1/0,-1/0],C=[0,0,0,0,0,0];s(),i.d(t,["qv",0,B,"v_",0,C])},46329(e,t,i){i.d(t,{y:()=>d});var n=i(49186),r=i(4305),s=i(513),o=i(50954),a=i(52006),l=i(49663),u=i(46068),h=i(59803);function d(e,t,i){if((0,a.Xq)(t))return(0,h.T)(e,t,i);if((0,a.n1)(t)){let s=(0,r.m_)(e,t,i)[0];if(null==s)throw new n.A("closestPointOnCurve:unexpected-error","Failed to find close point on bezier curve");return s}if((0,a.aO)(t)){let n=(0,o.pM)(e,t);return(0,s.fM)(n,i)}if((0,a.DA)(t)){let n=(0,l.io)(e,t);return(0,s.fM)(n,i)}let d=(0,u.SW)(e,t);return(0,u.pb)(d,i)}},60408(e,t,i){function n(e){return void 0!==e.xmin&&void 0!==e.ymin&&void 0!==e.xmax&&void 0!==e.ymax}function r(e){return void 0!==e.points}function s(e){return void 0!==e.x&&void 0!==e.y}function o(e){return void 0!==e.paths||void 0!==e.curvePaths}function a(e){return void 0!==e.rings||void 0!==e.curveRings}function l(e){return"object"==typeof e&&"vertexAttributes"in e}function u(e){return e?s(e)?"esriGeometryPoint":o(e)?"esriGeometryPolyline":a(e)?"esriGeometryPolygon":n(e)?"esriGeometryEnvelope":r(e)?"esriGeometryMultipoint":null:null}function h(e){return null!=e&&("hasZ"in e&&e.hasZ||"z"in e&&null!=e.z)}function d(e){return null!=e&&("hasM"in e&&e.hasM||"m"in e&&null!=e.m)}i.d(t,{$B:()=>u,Bi:()=>a,Pv:()=>h,Rg:()=>o,U9:()=>r,W0:()=>d,ZC:()=>n,fT:()=>s,uW:()=>l})},65864(e,t,i){i.d(t,{rS:()=>h,xD:()=>c});var n=i(5443),r=i(91075),s=i(48526),o=i(86738),a=i(39829),l=i(82799),u=i(60408);function h(e){return null==e?null:e instanceof r.A?e:(0,u.fT)(e)?o.A.fromJSON(e):(0,u.Rg)(e)?l.A.fromJSON(e):(0,u.Bi)(e)?a.A.fromJSON(e):(0,u.U9)(e)?s.A.fromJSON(e):(0,u.ZC)(e)?n.A.fromJSON(e):null}const d={esriGeometryPoint:o.A,esriGeometryPolyline:l.A,esriGeometryPolygon:a.A,esriGeometryEnvelope:n.A,esriGeometryMultipoint:s.A,esriGeometryMultiPatch:a.A};function c(e){return e&&d[e]||null}},97770(e,t,i){i.d(t,{Ey:()=>B,F8:()=>z,J2:()=>F,Yq:()=>T,_m:()=>w,iS:()=>A,wj:()=>C});var n=i(66552),r=i(73444),s=i(98623),o=i(34747);const a={dateStyle:void 0,year:void 0,month:void 0,day:void 0,weekday:void 0},l={timeStyle:void 0,hour12:void 0,hourCycle:void 0,hour:void 0,minute:void 0,second:void 0},u={timeZone:"UTC"},h={year:"numeric",month:"numeric",day:"numeric"},d={year:"numeric",month:"long",day:"numeric"},c={year:"numeric",month:"short",day:"numeric"},m={year:"numeric",month:"long",weekday:"long",day:"numeric"},f={hour:"numeric",minute:"numeric"},p={...f,second:"numeric"},y={hourCycle:"h23"},g={...f,...y},_={...p,...y},M={"short-date":h,"short-date-short-time":{...h,...f},"short-date-short-time-24":{...h,...g},"short-date-long-time":{...h,...p},"short-date-long-time-24":{...h,..._},"short-date-le":h,"short-date-le-short-time":{...h,...f},"short-date-le-short-time-24":{...h,...g},"short-date-le-long-time":{...h,...p},"short-date-le-long-time-24":{...h,..._},"long-month-day-year":d,"long-month-day-year-short-time":{...d,...f},"long-month-day-year-short-time-24":{...d,...g},"long-month-day-year-long-time":{...d,...p},"long-month-day-year-long-time-24":{...d,..._},"day-short-month-year":c,"day-short-month-year-short-time":{...c,...f},"day-short-month-year-short-time-24":{...c,...g},"day-short-month-year-long-time":{...c,...p},"day-short-month-year-long-time-24":{...c,..._},"long-date":m,"long-date-short-time":{...m,...f},"long-date-short-time-24":{...m,...g},"long-date-long-time":{...m,...p},"long-date-long-time-24":{...m,..._},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":f,"long-time":p},b=(0,n.O)()({shortDate:"short-date",shortDateShortTime:"short-date-short-time",shortDateShortTime24:"short-date-short-time-24",shortDateLongTime:"short-date-long-time",shortDateLongTime24:"short-date-long-time-24",shortDateLE:"short-date-le",shortDateLEShortTime:"short-date-le-short-time",shortDateLEShortTime24:"short-date-le-short-time-24",shortDateLELongTime:"short-date-le-long-time",shortDateLELongTime24:"short-date-le-long-time-24",longMonthDayYear:"long-month-day-year",longMonthDayYearShortTime:"long-month-day-year-short-time",longMonthDayYearShortTime24:"long-month-day-year-short-time-24",longMonthDayYearLongTime:"long-month-day-year-long-time",longMonthDayYearLongTime24:"long-month-day-year-long-time-24",dayShortMonthYear:"day-short-month-year",dayShortMonthYearShortTime:"day-short-month-year-short-time",dayShortMonthYearShortTime24:"day-short-month-year-short-time-24",dayShortMonthYearLongTime:"day-short-month-year-long-time",dayShortMonthYearLongTime24:"day-short-month-year-long-time-24",longDate:"long-date",longDateShortTime:"long-date-short-time",longDateShortTime24:"long-date-short-time-24",longDateLongTime:"long-date-long-time",longDateLongTime24:"long-date-long-time-24",longMonthYear:"long-month-year",shortMonthYear:"short-month-year",year:"year"}),x={ar:"ar-u-nu-latn-ca-gregory",nn:"no-NN"};function v(){let e=(0,r.lR)();return(e&&x[e])??(0,r.QC)()}"mart"!==new Intl.DateTimeFormat("bs",{month:"long"}).formatToParts(new Date(2025,2)).find(({type:e})=>"month"===e)?.value.toLowerCase()&&(x.bs="sr-Latn-CS");let S=new WeakMap;const I=M["short-date-short-time"];function F(e){return M[e]}function w(e){let{dateStyle:t,timeStyle:i,hour12:n,year:r,month:s}=e,o={};return t?o.dateStyle=t:r&&(o.year=r,o.month=s||void 0),i&&!o.year&&(o.timeStyle=i,o.hour12="auto"===n?void 0:"always"===n),o}function T(e,t=I){return function(e){let t=S.get(e);if(!t){let i=v(),n=C(e.timeZone??"system"),r={...e,timeZone:n};t=new Intl.DateTimeFormat(i,r),S.set(e,t)}return t}(t).format(e)}function A(e,t=I){return T(new Date(e),{...t,...u,...l})}function z(e,t=I){return T(new Date(`1970-01-01T${e}Z`),{...t,...u,...a})}function B(e,t=I){let i=o.c9.fromISO(e,{setZone:!0});if(!i.isValid)return e;if(t.timeZone)return T(i.toJSDate(),t);let n=0===i.offset?"UTC":t.timeZone,r={...t,timeZone:n};return i.toLocaleString(r,{locale:v()})}function C(e){switch(e){case"system":return s.N;case s.L:return"UTC";default:return e}}(0,r.Ml)(()=>{S=new WeakMap}),i.d(t,["_v",0,b])},73444(e,t,i){i.d(t,{JK:()=>l,Ml:()=>y,QC:()=>d,lR:()=>h,oQ:()=>f});var n=i(36563);let r;i(44208);const s=globalThis.esriConfig?.locale,o=globalThis.document?.documentElement;function a(){let e=o?.getAttribute("lang"),t=globalThis.navigator?.language;return s??e??t??"en"}function l(){return void 0===r&&(r=a()),r}const u=/^(?<language>[a-z]{2,3})(?:-(?<extlang>[a-z]{3}))?(?:-[A-Z][a-z]{3})?(?:-(?<region>[A-Z]{2}|\d{3}))?(?:-.*)?$/;function h(e=l()){return c(e)?.language}function d(e=l()){let t=c(e);return t?.language&&t?.extlang?e.replace(`${t.language}-`,""):e}function c(e=l()){return u.exec(e)?.groups}const m=[];function f(e){return m.push(e),(0,n.hA)(()=>{m.splice(m.indexOf(e),1)})}new Map;const p=[];function y(e){return p.push(e),(0,n.hA)(()=>p.splice(p.indexOf(e),1))}function g(){let e=a();r!==e&&([...p].forEach(t=>t(e)),r=e,[...m].forEach(t=>t(e)))}globalThis.addEventListener?.("languagechange",g),o&&new MutationObserver(()=>{g()}).observe(o,{attributeFilter:["lang"]})},6518(e,t,i){i.d(t,{F:()=>a});var n=i(44208),r=i(75503),s=i(19419);const o={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new r.wq(9,(0,n.A)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){let e=Array(this._idByBounds.size),t=0;this._idByBounds.forEach((i,n)=>{e[t++]=n}),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter(e=>this._idByBounds.has(e))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;let e=(0,s.Ie)();for(let t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){let t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,i){(function(e){o.minX=e[0],o.minY=e[1],o.maxX=e[2],o.maxY=e[3]})(t),e.search(o,i)}(this._index,e,e=>t(this._idByBounds.get(e)))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){let t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},83221(e,t,i){i.d(t,{A:()=>m});var n=i(4576),r=i(49186),s=i(65529),o=i(53966),a=i(70328),l=i(19419),u=i(90708),h=i(6518),d=i(37730);const c=(0,a.vt)();class m{constructor(e){this.geometryInfo=e,this._boundsStore=new h.F,this._featuresById=new Map,this._usedMemory=0,this.events=new s.bk,this.featureAdapter=d.T}get usedMemory(){return this._usedMemory}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach(t=>{null!=t.geometry&&t.geometry.coords&&(e+=t.geometry.coords.length)}),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(e){if(null==this.fullBounds)return null;let[t,i,n,r]=this.fullBounds;return{xmin:t,ymin:i,xmax:n,ymax:r,spatialReference:e}}add(e){this._add(e),this._emitChanged()}addMany(e){for(let t of e)this._add(t);this._emitChanged()}upsertMany(e){let t=e.map(e=>this._upsert(e));return this._emitChanged(),t.filter(n.Ru)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged(),this._usedMemory=0}removeById(e){let t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(let t of e){let e=this._featuresById.get(t);e&&this._remove(e)}this._emitChanged()}forEachBounds(e,t){for(let i of e){let e=this._boundsStore.get(i.objectId);e&&t((0,a.Jt)(c,e))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach(t=>e(t))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,e=>{t(this._featuresById.get(e))})}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;let t=e.objectId;if(null==t)return void o.A.getLogger("esri.layers.graphics.data.FeatureStore").error(new r.A("featurestore:invalid-feature","feature id is missing",{feature:e}));let i,n=this._featuresById.get(t);n?(e.displayId=n.displayId,i=this._boundsStore.get(t),this._boundsStore.delete(t),this._usedMemory-=this.estimateFeatureUsedMemory?.(n)??0):null!=this.onFeatureAdd&&this.onFeatureAdd(e),e.geometry?.coords?.length?(i=(0,u.jQ)(i??(0,l.vt)(),e.geometry),null!=i&&this._boundsStore.set(t,i),this._featuresById.set(t,e),this._usedMemory+=this.estimateFeatureUsedMemory?.(e)??0):(this._boundsStore.set(t,null),this._featuresById.set(t,e))}_upsert(e){let t=e?.objectId;if(null==t)return o.A.getLogger("esri.layers.graphics.data.FeatureStore").error(new r.A("featurestore:invalid-feature","feature id is missing",{feature:e})),null;let i=this._featuresById.get(t);if(!i)return this._add(e),e;this._usedMemory-=this.estimateFeatureUsedMemory?.(i)??0;let{geometry:n,attributes:s}=e;for(let e in s)i.attributes[e]=s[e];return n&&(i.geometry=n,this._boundsStore.set(t,(0,u.jQ)((0,l.vt)(),n)??null)),this._usedMemory+=this.estimateFeatureUsedMemory?.(i)??0,i}_remove(e){null!=this.onFeatureRemove&&this.onFeatureRemove(e);let t=e.objectId;return this._boundsStore.delete(t),this._featuresById.delete(t),this._usedMemory-=this.estimateFeatureUsedMemory?.(e)??0,e}}},37730(e,t,i){var n=i(43334);const r={getObjectId:e=>e.objectId,getAttributes:e=>e.attributes,getAttribute:(e,t)=>e.attributes[t],cloneWithGeometry:(e,t,i)=>new n.Om(t,e.attributes,null,e.objectId,e.displayId,e.distance,e.vertexCount),getGeometry:e=>e.geometry,getCentroid:(e,t)=>e.ensureCentroid(t)};i.d(t,["T",0,r])},33032(e,t,i){function n(e,t){let i=0;for(let n of t){let t=n.attributes?.[e];"number"==typeof t&&isFinite(t)&&(i=Math.max(i,t))}return i}i.d(t,{H:()=>n})},29432(e,t,i){i.r(t),i.d(t,{default:()=>v});var n=i(4576),r=i(49186),s=i(60408),o=i(21325),a=i(90708),l=i(33032),u=i(83221),h=i(31464),d=i(75752),c=i(64714),m=i(82832),f=i(95466),p=i(98453),y=i(30524);i(98623);const g=o.KK,_={xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:o.KK};function M(e){return(0,s.fT)(e)?null!=e.z:!!e.hasZ}function b(e){return(0,s.fT)(e)?null!=e.m:!!e.hasM}function x(e,t){let i,n=[];if("unique-id-composite"===t.type){let r=[];for(let i of t.fieldNames)e.attributes[i]?r.push(e.attributes[i]):n.push(i);i=0===n.length?JSON.stringify(r):null}else i=e.attributes[t.fieldName],i||n.push(t.fieldName);return{objectId:i,missingFields:n}}class v{constructor(){this._uniqueIdInfo=null,this._queryEngine=null,this._nextObjectId=null}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e){let t=[],{features:i}=e,n=this._inferLayerProperties(i,e.fields),s=e.fields||[],o=null==e.hasM?!!n.hasM:e.hasM,a=null==e.hasZ?!!n.hasZ:e.hasZ,M=!e.spatialReference&&!n.spatialReference,b=M?g:e.spatialReference||n.spatialReference,x=M?_:null,v=e.geometryType||n.geometryType,S=!v,I=e.uniqueIdInfo,F=e.objectIdField??n.objectIdField,w=e.timeInfo,T=new f.A(s);if(!S&&(M&&t.push({name:"feature-layer:spatial-reference-not-found",message:"Spatial reference not provided or found in features. Defaults to WGS84"}),!v))throw new r.A("feature-layer:missing-property","geometryType not set and couldn't be inferred from the provided features");if(I){let e=new Set(s.map(({name:e})=>e));if(!I.fields.every(t=>e.has(t))){let t=I.fields.filter(t=>!e.has(t));throw new r.A("feature-layer:missing-property","UniqueIdFields not set and couldn't be found in the provided fields. Fields: "+t+" are mssing.")}F=null}else if(!F)throw new r.A("feature-layer:missing-property","objectIdField not set and uniqueIdInfo not provided.");if(n.objectIdField&&F!==n.objectIdField&&(t.push({name:"feature-layer:duplicated-oid-field",message:`Provided objectIdField "${F}" doesn't match the field name "${n.objectIdField}", found in the provided fields`}),F=n.objectIdField),F&&!n.objectIdField){let e=T.get(F);e?(F=e.name,e.type="esriFieldTypeOID",e.editable=!1,e.nullable=!1):s.unshift({alias:F,name:F,type:"esriFieldTypeOID",editable:!1,nullable:!1})}for(let e of s){if(e.name??=e.alias,e.alias??=e.name,!e.name)throw new r.A("feature-layer:invalid-field-name","field name is missing",{field:e});if(e.name===F&&(e.type="esriFieldTypeOID"),!p.m.jsonValues.includes(e.type))throw new r.A("feature-layer:invalid-field-type",`invalid type for field "${e.name}"`,{field:e});e.length??=(0,y._b)(e)}let A={};for(let e of s)if("esriFieldTypeOID"!==e.type&&"esriFieldTypeGlobalID"!==e.type){let t=(0,y.lD)(e);void 0!==t&&(A[e.name]=t)}if(w){if(w.startTimeField){let e=T.get(w.startTimeField);e?(w.startTimeField=e.name,e.type="esriFieldTypeDate"):w.startTimeField=null}if(w.endTimeField){let e=T.get(w.endTimeField);e?(w.endTimeField=e.name,e.type="esriFieldTypeDate"):w.endTimeField=null}if(w.trackIdField){let e=T.get(w.trackIdField);e?w.trackIdField=e.name:(w.trackIdField=null,t.push({name:"feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:w}}))}!w.startTimeField&&!w.endTimeField&&(t.push({name:"feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing or invalid",details:{timeInfo:w}}),w=null)}let z=T.dateFields.length?{timeZoneIANA:e.dateFieldsTimeZone??"UTC"}:null;this._createDefaultAttributes=(0,c.Vx)(A,F),this._uniqueIdInfo=e.uniqueIdInfo??void 0;let B={warnings:t,featureErrors:[],layerDefinition:{...S?m.Xn:m.CI,drawingInfo:(0,c.F0)(v),templates:(0,c.e2)(A),extent:x,geometryType:v,objectIdField:F,fields:s,hasZ:a,hasM:o,timeInfo:w,dateFieldsTimeReference:z,uniqueIdInfo:this._uniqueIdInfo??void 0},assignedObjectIds:{}},C=this._uniqueIdInfo?.OIDFieldContainsHashValue?"simple"===this._uniqueIdInfo.type?{type:"unique-id-simple",fieldName:this._uniqueIdInfo.fields[0]}:{type:"unique-id-composite",fieldNames:this._uniqueIdInfo.fields}:{type:"object-id",fieldName:F};if(this._queryEngine=new d.do({fieldsIndex:f.A.fromLayerJSON({fields:s,timeInfo:w,dateFieldsTimeReference:z}),geometryType:v,hasM:o,hasZ:a,featureIdInfo:C,spatialReference:b,featureStore:new u.A({geometryType:v,hasM:o,hasZ:a}),timeInfo:w}),!i?.length)return this._nextObjectId=1,B;if(F){let e=(0,l.H)(F,i);this._nextObjectId=e+1}return await(0,h.Nk)(i,b),this._loadInitialFeatures(B,i)}async applyEdits(e){let{spatialReference:t,geometryType:i}=this._queryEngine;return await Promise.all([(0,m.$1)(t,i),(0,h.Nk)(e.adds,t),(0,h.Nk)(e.updates,t)]),this._applyEdits(e)}queryFeatures(e,t={}){return this._queryEngine.executeQuery(e,t.signal)}queryFeatureCount(e,t={}){return this._queryEngine.executeQueryForCount(e,t.signal)}queryObjectIds(e,t={}){return this._queryEngine.executeQueryForIds(e,t.signal)}queryExtent(e,t={}){return this._queryEngine.executeQueryForExtent(e,t.signal)}querySnapping(e,t={}){return this._queryEngine.executeQueryForSnapping(e,t.signal)}queryAttributeBins(e,t={}){return this._queryEngine.executeAttributeBinsQuery(e,t.signal)}_inferLayerProperties(e,t){let i,n,r=null,o=null,a=null;for(let t of e){let e=t.geometry;if(null!=e&&(r||=(0,s.$B)(e),o||=e.spatialReference,i??=M(e),n??=b(e),r&&o&&null!=i&&null!=n))break}if(t&&t.length){let e=null;t.some(t=>{let i="esriFieldTypeOID"===t.type,n=!t.type&&t.name&&"objectid"===t.name.toLowerCase();return e=t,i||n})&&(a=e.name)}return{geometryType:r,spatialReference:o,objectIdField:a,hasM:n,hasZ:i}}async _loadInitialFeatures(e,t){let{geometryType:i,hasM:n,hasZ:r,spatialReference:o,featureStore:l,fieldsIndex:u,featureIdInfo:d}=this._queryEngine,c=[];for(let n of t){if(null!=n.uid&&(e.assignedObjectIds[n.uid]=-1),n.geometry&&i!==(0,s.$B)(n.geometry)){e.featureErrors.push((0,m.Yx)("Incorrect geometry type."));continue}let t=this._createDefaultAttributes(),r=(0,m.MB)(u,t,n.attributes,!0);r?e.featureErrors.push(r):(this._assignObjectId(t,n.attributes,!0),n.attributes=t,n.uid&&(e.assignedObjectIds[n.uid]=x(n,d).objectId),null!=n.geometry&&(n.geometry=(0,h.Cv)(n.geometry,n.geometry.spatialReference,o)),c.push(n))}l.addMany((0,a.Di)([],c,i,r,n,d));let{fullExtent:f,timeExtent:p}=await this._queryEngine.fetchRecomputedExtents();if(e.layerDefinition.extent=f,p){let{start:t,end:i}=p;e.layerDefinition.timeInfo.timeExtent=[t,i]}return e}async _applyEdits(e){let{adds:t,updates:i,deletes:n}=e,r={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(r,t),i?.length&&this._applyUpdateEdits(r,i),n?.length){for(let e of n)r.deleteResults.push((0,m.bP)(e));this._queryEngine.featureStore.removeManyById(n)}let{fullExtent:s,timeExtent:o}=await this._queryEngine.fetchRecomputedExtents();return{extent:s,timeExtent:o,featureEditResults:r}}_applyAddEdits(e,t){let{addResults:i,updateResults:r}=e,{geometryType:o,hasM:l,hasZ:u,spatialReference:d,featureStore:c,featureIdInfo:f,fieldsIndex:p}=this._queryEngine,y=[],g=new Map;for(let a of t){if(a.geometry&&o!==(0,s.$B)(a.geometry)){i.push((0,m.Yx)("Incorrect geometry type."));continue}let t=this._createDefaultAttributes(),l=(0,m.MB)(p,t,a.attributes);if(l){i.push(l);continue}this._assignObjectId(t,a.attributes),a.attributes=t;let{objectId:u,missingFields:_}=x(a,f);if(u){if(null!=a.uid&&(e.uidToObjectId[a.uid]=u),null!=a.geometry){let e=a.geometry.spatialReference??d;a.geometry=(0,h.Cv)((0,m.CR)(a.geometry,e),e,d)}y.push(a);let t=(0,m.bP)(u);g.has(u)?(0,n.TF)(y,g.get(u)):c.has(u)?r.push(t):i.push(t),g.set(u,a)}else i.push((0,m.Yx)(`Missing unique id field value for fields: ${_.join()}`))}c.addMany((0,a.Di)([],y,o,u,l,f))}_applyUpdateEdits({updateResults:e},t){let{geometryType:i,hasM:n,hasZ:r,spatialReference:o,featureStore:l,fieldsIndex:u,featureIdInfo:d}=this._queryEngine;for(let c of t){let{attributes:t,geometry:f}=c,{objectId:p,missingFields:y}=x(c,d);if(null==p){let t="unique-id-composite"===d.type?y:d.fieldName;e.push((0,m.Yx)(`Identifier fields: ${t} missing`));continue}if(!l.has(p)){e.push((0,m.Yx)(`Feature with object id ${p} missing`));continue}let g=(0,a.oN)(l.getFeature(p),i,r,n);if(null!=f){if(i!==(0,s.$B)(f)){e.push((0,m.Yx)("Incorrect geometry type."));continue}let t=f.spatialReference??o;g.geometry=(0,h.Cv)((0,m.CR)(f,t),t,o)}if(t){let i=(0,m.MB)(u,g.attributes,t);if(i){e.push(i);continue}}l.add((0,a.E2)(g,i,r,n,d)),e.push((0,m.bP)(p))}}_assignObjectId(e,t,i=!1){if("object-id"===this._queryEngine.featureIdInfo.type){let n=this._queryEngine.featureIdInfo.fieldName;e[n]=i&&t&&isFinite(t[n])?t[n]:this._nextObjectId++}}}},64714(e,t,i){i.d(t,{F0:()=>a,Vx:()=>h,e2:()=>c,f:()=>p});var n=i(44208),r=i(4718),s=i(99352),o=i(93470);function a(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?o.Cb:"esriGeometryPolyline"===e?o.yM:o.WR}}}const l=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let u=1;function h(e,t){if((0,n.A)("esri-csp-restrictions"))return()=>t?{[t]:null,...e}:{...e};try{let i="";t&&(i+=`this${d(t)} = null;`);for(let t in e)i+=`this${d(t)} = ${JSON.stringify(e[t])};`;let n=Function(`\n return class AttributesClass$${u++} {\n constructor() {\n ${i};\n }\n }\n `)();return()=>new n}catch{return()=>t?{[t]:null,...e}:{...e}}}function d(e){return l.test(e)?`.${e}`:`[${JSON.stringify(e)}]`}function c(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,r.o8)(e)}}]}const m={...s.F,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsCentroid:!1,supportsDistance:!1,supportsExtent:!1,supportsQuantization:!1,supportsQueryGeometry:!1,supportsDisjointSpatialRelationship:!1},f={...s.P,supportedStatistics:{...s.P.supportedStatistics,envelope:!1,centroid:!1,convexHull:!1}};function p(e,t,i=!1){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportedCurveTypes:[],supportsAttachment:!1,supportsM:!1,supportsTrueCurve:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!0,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:i?m:s.F,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:i?f:s.P,editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsTrueCurveUpdate:t,supportsTrueCurveUpdateByTrueCurveClientsOnly:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}},82832(e,t,i){i.d(t,{$1:()=>_,CR:()=>g,MB:()=>f,Yx:()=>h,bP:()=>c});var n=i(67482),r=i(18370),s=i(60408),o=i(21325),a=i(30524);class l{constructor(e){this.description=e,this.code=null}}class u{constructor(e){this.globalId=null,this.objectId=null,this.success=!1,this.uniqueId=null,this.error=new l(e)}}function h(e){return new u(e)}class d{constructor(e){this.globalId=null,this.success=!0,this.objectId=this.uniqueId=e}}function c(e){return new d(e)}const m=new Set;function f(e,t,i,n=!1){m.clear();for(let r in i){let s=e.get(r);if(!s)continue;let o=p(s,i[r]);if(m.add(s.name),s&&(n||s.editable)){let e=(0,a.CJ)(s,o);if(e)return h((0,a.uo)(e,s,o));t[s.name]=o}}for(let t of e.requiredFields??[])if(!m.has(t.name))return h(`missing required field "${t.name}"`);return null}function p(e,t){let i=t;return(0,a.WA)(e)&&"string"==typeof t?i=(0,a.XT)(t):(0,a.yM)(e)&&null!=t&&"string"!=typeof t?i=String(t):(0,a.vE)(e)&&"string"==typeof t&&(i=(0,n._)(t)),(0,a.WX)(i)}const y=(0,r.z)(()=>Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(3299),i.e(3456)]).then(()=>i(3637)));function g(e,t){if(!(0,s.Bi)(e)&&!(0,s.Rg)(e)||!(0,o.fn)(t))return e;let i=y.module;if(null==i)throw TypeError("simplify operator not loaded");return i.simplifyExecute({...e,spatialReference:t})??e}async function _(e,t){(0,o.fn)(e)&&("esriGeometryPolygon"===t||"esriGeometryPolyline"===t)&&await y.getImportPromise()}const M={supportsAutoIntervalBin:!0,supportsFixedIntervalBin:!0,supportsFixedBoundariesBin:!0,supportsDateBin:!0,supportsStackBy:!0,supportsSplitBy:!0,supportsNormalization:!0,supportedStatisticTypes:["COUNT","SUM","AVG","VAR","STDDEV","MIN","MAX","PERCENTILE_CONT","PERCENTILE_DISC","CentroidAggregate","EnvelopeAggregate","ConvexHullAggregate"],supportedNormalizationTypes:["field","log","naturalLog","percentOfTotal","squareRoot"]},b={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsQueryAttachmentsCountOnly:!1,supportsQueryAttachmentOrderByFields:!1,supportsQueryAttachmentWithTypeWildcard:!1,supportsQueryBins:!0,supportsQueryPivot:!1,supportsSpatialAggregationStatistics:!0,supportedSpatialAggregationStatistics:["EnvelopeAggregate","CentroidAggregate","ConvexHullAggregate"],supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsOutDistance:!1,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!0,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0,supportsQueryWithCacheHint:!0},queryBinsCapabilities:M},x={...b,supportsCoordinatesQuantization:!1,supportsReturningQueryGeometry:!1,advancedQueryCapabilities:{...b.advancedQueryCapabilities,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:[],supportsReturningGeometryCentroid:!1,supportsQueryWithDistance:!1,supportsReturningQueryExtent:!1,supportsDisjointSpatialRel:!1},queryBinsCapabilities:{...M,supportedStatisticTypes:M.supportedStatisticTypes.filter(e=>"EnvelopeAggregate"!==e&&"CentroidAggregate"!==e&&"ConvexHullAggregate"!==e)}};i.d(t,["CI",0,b,"Xn",0,x])},95466(e,t,i){i.d(t,{A:()=>u});var n=i(49186),r=i(53966),s=i(12195),o=i(30524),a=i(98623),l=i(56400);class u{static fromJSON(e){return new u(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new u(e.fields??[],d(e))}static fromLayerJSON(e){return new u(e.fields??[],d(e))}constructor(e=[],t){this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=t?new Map(t):null;let i=[];for(let e of this.fields){let t=e?.name,n=(0,o.GZ)(t);if(t&&n){let r=(0,o.NF)(t);this._fieldsMap.set(t,e),this._fieldsMap.set(r,e),this._normalizedFieldsMap.set(n,e),i.push(`${r}:${e.type}:${this._timeZoneByFieldName?.get(t)}`),(0,o.vE)(e)?(this.dateFields.push(e),this._dateFieldsSet.add(e)):(0,o.WA)(e)&&(this._numericFieldsSet.add(e),this.numericFields.push(e)),!(0,o.te)(e)&&!(0,o.Xz)(e)&&(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable)}}i.sort(),this.uid=i.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(let e of this.fields)(0,o.te)(e)||(0,o.Xz)(e)||e.nullable||void 0!==(0,o.lD)(e)||this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===e?.uid}has(e){return null!=this.get(e)}get(e){return(0,o.Vb)({fieldName:e,fieldsMap:this._fieldsMap,normalizedFieldsMap:this._normalizedFieldsMap})}getTimeZone(e){let t=this.get(e&&"string"!=typeof e?e.name:e);return t?this._timeZoneByFieldName?this._timeZoneByFieldName.get(t.name):"date"===t.type||"esriFieldTypeDate"===t.type?(r.A.getLogger("esri.layers.support.FieldsIndex").errorOnce(new n.A("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),"UTC"):h.has(t.type)?a.L:null:null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return(0,o.OH)(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map(e=>(0,s.W)(e)?e.toJSON():e),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}}const h=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function d(e){let t=new Map;if(!e.fields)return t;let i=!0===e.datesInUnknownTimezone,{timeInfo:n,editFieldsInfo:r}=e,s=(n?"startField"in n?n.startField:n.startTimeField:"")??"",u=(n?"endField"in n?n.endField:n.endTimeField:"")??"",d=function(e){return"dateFieldsTimeZone"in e}(e)?e.dateFieldsTimeZone??null:e.dateFieldsTimeReference?(0,l.ZS)(e.dateFieldsTimeReference):null,c=r?function(e){return"timeZone"in e}(r)?r.timeZone??d:r.dateFieldsTimeReference?(0,l.ZS)(r.dateFieldsTimeReference):d??"UTC":null,m=n?function(e){return"timeZone"in e}(n)?n.timeZone??d:n.timeReference?(0,l.ZS)(n.timeReference):d:null,f=new Map([[(0,o.NF)(r?.creationDateField??""),c],[(0,o.NF)(r?.editDateField??""),c],[(0,o.NF)(s),m],[(0,o.NF)(u),m]]);for(let{name:n,type:r}of e.fields)if(h.has(r))t.set(n,a.L);else if("date"!==r&&"esriFieldTypeDate"!==r)t.set(n,null);else if(i)t.set(n,a.L);else{let e=f.get((0,o.NF)(n??""))??d;t.set(n,e)}return t}},98453(e,t,i){const n=new(i(66552).J)({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"});i.d(t,["m",0,n])},93470(e,t,i){const n=[252,146,31,255],r={type:"esriSMS",style:"esriSMSCircle",size:6,color:n,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},s={type:"esriSLS",style:"esriSLSSolid",width:.75,color:n};i.d(t,["Cb",0,r,"HW",0,{type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},"JR",0,[153,153,153,255],"JZ",0,{type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},"WR",0,{type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},"b6",0,{type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null},"fT",0,n,"nC",0,{type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},"yM",0,s])}}]);
|