@arcgis/core 5.1.0-next.52 → 5.1.0-next.53
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/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/009db7b459b18f6a668b.js +1 -0
- package/assets/esri/core/workers/chunks/{386435341e949f5573b4.js → 0fc60b4c44c4e865b699.js} +2 -2
- package/assets/esri/core/workers/chunks/199f70c0373f6008a545.js +1 -0
- package/assets/esri/core/workers/chunks/{d2af5342fbe80e2d8c60.js → 20f9f3470cad47d01803.js} +1 -1
- package/assets/esri/core/workers/chunks/2757cf54656b5d318b11.js +1 -0
- package/assets/esri/core/workers/chunks/2aaeaf022af8493281dc.js +1 -0
- package/assets/esri/core/workers/chunks/34fe4570eef9e73839b8.js +1 -0
- package/assets/esri/core/workers/chunks/{7480bd6f892abf444cac.js → 3c9e1ec94bbcbf494916.js} +3 -3
- package/assets/esri/core/workers/chunks/40bcfc4f8efe7de7ec9d.js +1 -0
- package/assets/esri/core/workers/chunks/{cc1f3a2f281a2f6e0f94.js → 4d54beab8ae5ff31e7b0.js} +1 -1
- package/assets/esri/core/workers/chunks/55bb5b7817c2963c8bfa.js +1 -0
- package/assets/esri/core/workers/chunks/{39f3bea123f20c816ab2.js → 662932d2effd2b384b9e.js} +1 -1
- package/assets/esri/core/workers/chunks/7d56b2ac5030dd8b748e.js +1 -0
- package/assets/esri/core/workers/chunks/{720a33a7f118d2769133.js → 851dd71d28681d4eccfd.js} +1 -1
- package/assets/esri/core/workers/chunks/{88c6cc90606409b5c884.js → 87d2021e91d025a2a142.js} +1 -1
- package/assets/esri/core/workers/chunks/{fe7dec83e40014c55a6b.js → 96e799ca97989a6ed448.js} +1 -1
- package/assets/esri/core/workers/chunks/9db2ff1d4cbb5d1b623e.js +1 -0
- package/assets/esri/core/workers/chunks/a462aa1c7b68efad6906.js +1 -0
- package/assets/esri/core/workers/chunks/{f5fd59291cb161fdc05b.js → a787fe09d3df9d4254ba.js} +1 -1
- package/assets/esri/core/workers/chunks/a971e61336f455b953d5.js +1 -0
- package/assets/esri/core/workers/chunks/b2b77598048818c957b7.js +1 -0
- package/assets/esri/core/workers/chunks/{3fa5f102b6f77c523a76.js → b3e5dcb530cef678c8f8.js} +1 -1
- package/assets/esri/core/workers/chunks/{daf65bccc45dc5c400ae.js → c460ca93ed8e20d8b53a.js} +1 -1
- package/assets/esri/core/workers/chunks/{3fcc8c455af56ae89030.js → ccf845ac0ac354507a25.js} +1 -1
- package/assets/esri/core/workers/chunks/{c48d1ee37c207bfb0aac.js → dd319d5fe89b275e93cf.js} +1 -1
- package/assets/esri/core/workers/chunks/ec91d5081f423755cb07.js +1 -0
- package/assets/esri/core/workers/chunks/{eb36417edc11fa80e312.js → ee8cd91c27e9cdfc3b2e.js} +1 -1
- package/assets/esri/core/workers/chunks/f8eb14170f927aecfbc8.js +1 -0
- package/assets/esri/core/workers/chunks/{792219a079c28bcdc003.js → fcfaaced184f8da3e28d.js} +1 -1
- package/config.js +1 -1
- package/core/arrayUtils.js +1 -1
- package/core/maybe.js +1 -1
- package/kernel.js +1 -1
- package/layers/FeatureLayer.js +1 -1
- package/layers/OrientedImageryLayer.js +1 -1
- package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
- package/layers/graphics/sources/OGCFeatureSource.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/knowledgeGraph/nodeMovementUtils.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/mixins/FeatureLayerBase.js +1 -1
- package/layers/raster/datasets/FunctionRaster.js +1 -1
- package/layers/raster/functions/AspectFunction.js +1 -1
- package/layers/raster/functions/BaseRasterFunction.js +1 -1
- package/layers/raster/functions/ConvolutionFunction.js +1 -1
- package/layers/raster/functions/CurvatureFunction.js +1 -1
- package/layers/raster/functions/HillshadeFunction.js +1 -1
- package/layers/raster/functions/ShadedReliefFunction.js +1 -1
- package/layers/raster/functions/SlopeFunction.js +1 -1
- package/layers/raster/functions/StatisticsFunction.js +1 -1
- package/layers/raster/functions/pixelUtils.js +1 -1
- package/layers/support/capabilities.js +1 -1
- package/layers/support/serviceCapabilitiesUtils.js +1 -1
- package/package.json +3 -3
- package/support/revision.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
- package/views/3d/support/ResourceController.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/webgl/ManagedFBO.d.ts +1 -0
- package/views/3d/webgl/ManagedFBOResource.d.ts +1 -0
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/FBOCacheUsage.js +1 -1
- package/views/3d/webgl-engine/effects/RenderNodes.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
- package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
- package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/PolygonOffset.js +1 -1
- package/views/3d/webgl-engine/materials/TriangleTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
- package/views/3d/webgl.js +1 -1
- package/views/webgl/Program.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/assets/esri/core/workers/chunks/0b661b90f7ee3ae23425.js +0 -1
- package/assets/esri/core/workers/chunks/167e4ff7cbc88b42db71.js +0 -1
- package/assets/esri/core/workers/chunks/1a481f3ae3146682eb00.js +0 -1
- package/assets/esri/core/workers/chunks/30654845ca1334f1c206.js +0 -1
- package/assets/esri/core/workers/chunks/34207774bc371e95ba3c.js +0 -1
- package/assets/esri/core/workers/chunks/35dbe1eeb6932b03aea2.js +0 -1
- package/assets/esri/core/workers/chunks/380bb57bccc266d6442a.js +0 -1
- package/assets/esri/core/workers/chunks/5351e71ce7839636d06d.js +0 -1
- package/assets/esri/core/workers/chunks/55edd712c6d2d044e550.js +0 -1
- package/assets/esri/core/workers/chunks/64da1ad9df9094ef5c12.js +0 -1
- package/assets/esri/core/workers/chunks/666f201d222c50ab8428.js +0 -1
- package/assets/esri/core/workers/chunks/7380177f16d914fdbc63.js +0 -1
- package/assets/esri/core/workers/chunks/7dba4121cdd20dbc4b20.js +0 -1
- package/assets/esri/core/workers/chunks/bb659dcd297b895830df.js +0 -1
- /package/assets/esri/core/workers/chunks/{386435341e949f5573b4.js.LICENSE.txt → 0fc60b4c44c4e865b699.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9235],{34930(t,e,s){s.d(e,{$Q:()=>a,Sd:()=>u,b7:()=>l});var n=s(86211),r=s(5443),o=s(86738),i=s(14140);async function a(t,e,n){if("extent"===n.type)return function(t,e,s){const{width:n,height:r}=t,o=new Uint8Array(n*r),a=e.width/n,u=e.height/r;if(s.width/a<.5||s.height/u<.5)return new i.A({pixelType:t.pixelType,width:n,height:r,mask:o,pixels:[...t.pixels]});const{xmin:l,xmax:c,ymin:p,ymax:h}=e,{xmin:m,xmax:d,ymin:g,ymax:f}=s,y=Math.max(l,m),x=Math.min(c,d),w=Math.max(p,g),A=Math.min(h,f),v=.5*a,C=.5*u;if(x-y<v||A-w<C||x<l+v||y>c-v||w>h-C||A<p+C)return new i.A({pixelType:t.pixelType,width:n,height:r,mask:o,pixels:[...t.pixels]});const b=Math.max(0,(y-l)/a),M=Math.min(n,Math.max(0,(x-l)/a)),T=Math.max(0,(h-A)/u),P=Math.min(r,Math.max(0,(h-w)/u)),N=Math.round(b),I=Math.round(M)-1,R=Math.round(T),F=Math.round(P)-1;if(N===I&&b%1>.5&&M%1<.5||R===F&&T%1>.5&&P%1<.5)return new i.A({pixelType:t.pixelType,width:n,height:r,mask:o,pixels:[...t.pixels]});if(0===N&&0===R&&I===n&&F===r)return t;const k=t.mask;for(let t=R;t<=F;t++)for(let e=N;e<=I;e++){const s=t*n+e;o[s]=k?k[s]:255}return new i.A({pixelType:t.pixelType,width:n,height:r,mask:o,pixels:[...t.pixels]})}(t,e,n);const{width:r,height:o}=t,a=new Uint8Array(r*o);return(await Promise.all([s.e(3661),s.e(1878),s.e(8885),s.e(5756),s.e(3299),s.e(1132)]).then(s.bind(s,25275))).execute(e,n)?"polyline"===n.type?function(t,e,s){const{width:n,height:r}=t,o=new Uint8Array(n*r),a=e.width/n,u=e.height/r,{xmin:l,ymax:c}=e,{paths:p}=s,h=t.mask;for(let t=0;t<p.length;t++){const e=p[t];for(let t=0;t<e.length-1;t++){const[s,i]=e[t],[p,m]=e[t+1],d=Math.min(i,m),g=Math.max(i,m),f=Math.max(0,Math.floor((c-g)/u)),y=Math.min(r-1,Math.floor((c-d)/u));if(!(y<f))if(f===y){const t=Math.min(s,p),e=Math.max(s,p),r=Math.max(0,Math.floor((t-l)/a)),i=Math.min(n-1,Math.floor((e-l)/a));if(i<r)continue;const u=f*n;for(let t=u+r;t<=u+i;t++)o[t]=h?h[t]:255}else{const t=(s-l)/a,e=(p-s)/(m-i)/a,r=u*e;for(let s=f;s<=y;s++){const a=e*(c-s*u-i)+t,l=Math.max(0,Math.floor(r>0?a-r:a)),p=Math.min(n-1,Math.floor(r>0?a:a-r));if(p<l)continue;const m=s*n;for(let t=m+l;t<=m+p;t++)o[t]=h?h[t]:255}}}}return new i.A({pixelType:t.pixelType,width:n,height:r,mask:o,pixels:[...t.pixels]})}(t,e,n):(await Promise.all([s.e(3661),s.e(1878),s.e(8885),s.e(5756),s.e(3299),s.e(6671)]).then(s.bind(s,30912))).execute(n,e)?t:function(t,e,s){if(!t)return t;const{width:n,height:r}=t,o=function(t){const{geometry:e,size:s,srcExtent:n,srcMask:r}=t,[o,i]=s;let a;const u=n.width/o,l=n.height/i,{xmin:c,ymax:p}=n;if("extent"===e.type){const t=(e.xmin-c)/u,s=(e.xmax-c)/u,n=(p-e.ymax)/l,r=(p-e.ymin)/l;a=[[[t,n],[t,r],[s,r],[s,n],[t,n]]]}else a=e.rings.map(t=>t.map(([t,e])=>[(t-c)/u,(p-e)/l]));return function(t,e,s){const[n,r]=e,o=new OffscreenCanvas(n,r).getContext("2d");o.fillStyle="#f00",o.beginPath(),t.forEach(t=>{o.moveTo(t[0][0],t[0][1]);for(let e=0;e<t.length;e++)o.lineTo(t[e][0],t[e][1]);o.closePath()}),o.fill();const i=o.getImageData(0,0,n,r).data,a=n*r,u=new Uint8Array(a);let l=!1;for(let t=0;t<a;t++)s&&!s[t]||(i[4*t+3]>127?u[t]=255:l=!0);return l||s?u:void 0}(a,s,r)}({geometry:s,size:[n,r],srcExtent:e,srcMask:t.mask});return new i.A({pixelType:t.pixelType,width:n,height:r,mask:o,maskIsAlpha:!1,pixels:[...t.pixels]})}(t,e,n):new i.A({pixelType:t.pixelType,width:r,height:o,mask:a,maskIsAlpha:!1,pixels:[...t.pixels]})}function u(t,e){const{extent:s}=l(t,e,new o.A({x:t.pixelSize.x,y:t.pixelSize.y,spatialReference:t.spatialReference})),{extent:n}=t.extent;if(s.xmax=Math.min(s.xmax,n.xmax),s.ymax=Math.min(s.ymax,n.ymax),s.xmin<s.xmax&&s.ymin<s.ymax){const{x:e,y:n}=t.pixelSize,r=Math.round(s.width/e),o=Math.round(s.height/n);t.extent=s,t.width=r,t.height=o}}function l(t,e,s,o=!0){const{spatialReference:i}=t,{x:a,y:u}=function(t,e){if(t.spatialReference.equals(e))return t;const s=(0,n.GA)(t.spatialReference),r=(0,n.GA)(e);if(s===r)return t;const o=s/r;return{x:t.x*o,y:t.y*o}}(s,i);let l,c,p;const h="extent"===e.type?e:e.extent;let{xmin:m,xmax:d,ymax:g,ymin:f}=h;const{xmin:y,ymax:x}=t.extent;return o?(m=y+(m>y?a*Math.round((m-y)/a):0),g=x-(g<x?u*Math.round((x-g)/u):0),d=y+(d>y?a*Math.round((d-y)/a):0),f=x-(f<x?u*Math.round((x-f)/u):0),l=new r.A({xmin:m,ymax:g,xmax:d,ymin:f,spatialReference:i}),c=Math.round(l.width/a),p=Math.round(l.height/u)):(c=Math.floor((d-m)/a+.8),p=Math.floor((g-f)/u+.8),m=y+(m>y?a*Math.floor((m-y)/a+.1):0),g=x-(g<x?u*Math.floor((x-g)/u+.1):0),d=m+c*a,f=g-p*u,l=new r.A({xmin:m,ymax:g,xmax:d,ymin:f,spatialReference:i})),{extent:l,width:c,height:p}}},99235(t,e,s){s.d(e,{vt:()=>Un,UD:()=>Vn});var n=s(85334),r=s(49186),o=s(4718),i=s(5482),a=s(91429),u=s(94778),l=s(25482);let c=class extends l.o{constructor(){super(...arguments),this.raster=void 0}};(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],c.prototype,"raster",void 0),c=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.BaseFunctionArguments")],c);const p=c;var h;let m=h=class extends p{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,i.Cg)([(0,a.MZ)({json:{write:!0}})],m.prototype,"operation",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],m.prototype,"raster2",void 0),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],m.prototype,"rasters",null),m=h=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ArithmeticFunctionArguments")],m);const d=m;var g=s(14140),f=s(87186);const y=new Set(["slope","aspect","curvature","hillshade","shadedrelief","statistics"]);let x=class extends l.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(){const t=this.getWebGLProcessorDefinition();if(!t)return null;const e=[t],{parameters:s}=t;let n=s.rasters||s.raster&&[s.raster];for(;n?.length;){e.unshift(...n);const t=[];for(let e=0;e<n.length;e++){const{parameters:s}=n[e],r=s.rasters||s.raster&&[s.raster];r?.length&&t.push(...r)}n=t}for(let t=e.length-1;t>=0;t--)e[t].isNoopProcess&&e.splice(t,1);let r=!1;for(let t=0;t<e.length;t++){const s=e[t];s.id=e.length-t-1;const{rasters:n}=s.parameters;r=r||null!=n&&n.length>1}const o=e.some(({name:t})=>y.has(t.toLowerCase())),{rawSourceRasterInfos:i}=this;return{functions:e,hasBranches:r,hasFocalFunction:o,isSourceSingleBand:1===i?.[0]?.bandCount}}get neighborhoodSize(){let{rows:t,cols:e}=this._getNeighborhoodSize();const s=this.getImmediateChildFunctions();for(const n of s){const s=n.neighborhoodSize;t=Math.max(t,s.rows),e=Math.max(e,s.cols)}return{rows:t,cols:e}}bind(t,e=!1,s=-1){this.id=s+1;const n=this._getRasterValues();let r=!0;for(let s=0;s<n.length;s++){const o=n[s];if(null!=o&&this._isRasterFunctionValue(o)){const n=o.bind(t,e,this.id+s);if(!n.success)return this._bindingResult=n,n;r=r&&n.supportsGPU}}return!this.rasterInfo||e?(this.sourceRasterInfos=this._getSourceRasterInfos(t),this._bindingResult=this._bindSourceRasters(),r&&=this._bindingResult.supportsGPU,this._bindingResult.success&&(this._patchRasterInfo(),r&&this.isRoot)&&(this.processInputBandIds(),this.swizzleInputBandIds(this.rawInputBandIds)||(r=this.rawInputBandIds.length<=3)),this._bindingResult.supportsGPU=r,this._bindingResult):(this._bindingResult={success:!0,supportsGPU:!0},this._bindingResult)}queryRasterFunction(t){const e=[this];for(;e.length;){const s=e.pop();if(t(s))return s;const n=s.getImmediateChildFunctions();e.push(...n)}}getImmediateChildFunctions(){return this._getRasterValues().filter(t=>t&&"object"==typeof t&&"bind"in t)}process(t,e){const s=this._getRasterValues(),n=0===s.length?t.pixelBlocks??t.primaryPixelBlocks:s.map(s=>this._readRasterValue(s,t,e));return this._processPixels({...t,pixelBlocks:n},e)}processInputBandIds(){const t=this._getRasterValues().filter(this._isRasterFunctionValue);if(t.length>1){const e=t.map(t=>t.processInputBandIds());return this.rawInputBandIds=[...new Set(e.flat())],this.rawInputBandIds}const e=t[0];if(e)return this.rawInputBandIds=e.processInputBandIds(),this.rawInputBandIds;const{bandCount:s}=this.sourceRasterInfos[0],n=Array.from({length:s},(t,e)=>e);return this.rawInputBandIds=this._getInputBandIds(n),this.rawInputBandIds}swizzleInputBandIds(t){const e=this._getRasterValues().filter(this._isRasterFunctionValue);let s=!0;for(const n of e)s=n.swizzleInputBandIds(t)&&s;return!!s&&this._swizzleBandIds(t)}getPrimaryRasters(){const t=[],e=[];return this._getPrimaryRasters(this,t,e),{rasters:t,rasterIds:e}}getWebGLProcessorDefinition(){const t=this._getWebGLParameters(),{raster:e,rasters:s}=this.functionArguments;return s&&Array.isArray(s)&&s.length?(t.rasters=s.map(t=>this._isRasterFunctionValue(t)?t.getWebGLProcessorDefinition():"number"==typeof t?{name:"Constant",parameters:{value:t},pixelType:"f32",id:-1,isNoopProcess:!1}:{name:"Identity",parameters:{value:t},pixelType:"f32",id:-1,isNoopProcess:!1}),t.rasters.some(t=>null!=t)||(t.rasters=null)):this._isRasterFunctionValue(e)&&(t.raster=e.getWebGLProcessorDefinition()),{name:this.functionName,parameters:t,pixelType:this.outputPixelType,id:this.id,isNoopProcess:this.isNoopProcess}}getClippingGeometries(){const t=[];"Clip"===this.functionName&&t.push(this.functionArguments);const{raster:e,rasters:s}=this.functionArguments;if(s&&Array.isArray(s)&&s.length)s.forEach(e=>{if(this._isRasterFunctionValue(e)){const s=e.getClippingGeometries();t.push(...s)}});else if(this._isRasterFunctionValue(e)){const s=e.getClippingGeometries();t.push(...s)}return t}_getOutputPixelType(t){return"unknown"===this.outputPixelType?t:this.outputPixelType??t}_getWebGLParameters(){return{}}_getInputBandIds(t){return t}_swizzleBandIds(t){return!0}_isInputRasterPrimaryOrConstant(){return!this._getRasterValues().some(t=>t&&"object"==typeof t&&"rasterFunction"in t&&t.rasterFunction)}_getNeighborhoodSize(){return{rows:1,cols:1}}_removeStatsHistColormapVAT(t){t.statistics=null,t.histograms=null,t.colormap=null,t.attributeTable=null,t.multidimensionalInfo?.variables.forEach(t=>{t.statistics=void 0,t.histograms=void 0})}_getRasterValues(){const{rasterArgumentNames:t}=this;return"rasters"===t[0]?this.functionArguments.rasters??[]:t.flatMap(t=>this.functionArguments[t])}_getSourceRasterInfos(t){const e=this._getRasterValues(),{rasterInfos:s,rasterIds:n}=t;if(0===e.length)return s;const r=e.map(t=>t&&"object"==typeof t&&"bind"in t&&t.rasterInfo?t.rasterInfo:"string"==typeof t&&n.includes(t)?s[n.indexOf(t)]:"number"!=typeof t?s[0]:void 0),o=r.find(t=>t)??s[0];return r.forEach((t,e)=>{void 0===t&&(r[e]=o)}),r}_getPrimaryRasterId(t){return t?.rasterId}_getPrimaryRasters(t,e=[],s=[]){for(let n=0;n<t.sourceRasters.length;n++){const r=t.sourceRasters[n];if("number"!=typeof r)if("bind"in r)this._getPrimaryRasters(r,e,s);else{const t=r,n=this._getPrimaryRasterId(t);if(null==n)continue;s.includes(n)||(this.mainPrimaryRasterId===n?(e.unshift(t),s.unshift(n)):(e.push(t),s.push(n)))}}}_isRasterFunctionValue(t){return null!=t&&"object"==typeof t&&"getWebGLProcessorDefinition"in t}_readRasterValue(t,e,s){const{primaryPixelBlocks:n}=e;if(null==t||"$$"===t){const t=n[0];return null==t?null:t.clone()}if("string"==typeof t){const s=e.primaryRasterIds.indexOf(t);return-1===s?null:n[s]}if("number"==typeof t){const e=n[0];if(null==e)return null;const{width:s,height:r,pixelType:o}=e,i=new Float32Array(s*r);i.fill(t);const a=this.sourceRasterInfos[0].bandCount,u=new Array(a).fill(i);return new g.A({width:s,height:r,pixelType:o,pixels:u})}return t.process(e,s)}_patchRasterInfo(){const{rasterInfo:t}=this;if(!t?.keyProperties)return;const{bandCount:e,keyProperties:s,statistics:n,histograms:r}=t,o=s.BandProperties;o&&o.length!==e&&(t.keyProperties={...s,BandProperties:void 0}),n&&n.length!==e&&(t.statistics=n.length>e?n.slice(0,e):null),r&&r.length!==e&&(t.histograms=r.length>e?r.slice(0,e):null),s.BAND_COUNT&&Number(s.BAND_COUNT)!==e&&(t.keyProperties={...s,BAND_COUNT:"string"==typeof s.BAND_COUNT?String(e):e})}};(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],x.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}}),(0,a.wg)(t=>t?.toLowerCase())],x.prototype,"outputPixelType",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"mainPrimaryRasterId",void 0),(0,i.Cg)([(0,a.MZ)()],x.prototype,"sourceRasters",void 0),(0,i.Cg)([(0,a.MZ)({type:[f.A],json:{write:!0}})],x.prototype,"sourceRasterInfos",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"rasterInfo",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"readingBufferSize",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"id",void 0),(0,i.Cg)([(0,a.MZ)()],x.prototype,"isNoopProcess",void 0),(0,i.Cg)([(0,a.MZ)()],x.prototype,"supportsGPU",null),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"rawInputBandIds",void 0),(0,i.Cg)([(0,a.MZ)()],x.prototype,"rawSourceRasterInfos",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"isInputBandIdsSwizzled",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"swizzledBandSelection",void 0),(0,i.Cg)([(0,a.MZ)()],x.prototype,"isBranch",void 0),(0,i.Cg)([(0,a.MZ)()],x.prototype,"isRoot",void 0),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],x.prototype,"flatWebGLFunctionChain",null),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],x.prototype,"neighborhoodSize",null),(0,i.Cg)([(0,a.MZ)()],x.prototype,"_bindingResult",void 0),x=(0,i.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},C={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},b={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,...C,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,...b},T=new Map([[C.acos,{domain:[0,Math.PI],isInteger:!1}],[C.asin,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[C.atan,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[C.cos,{domain:[-1,1],isInteger:!1}],[C.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 P(t){return T.get(t)}const N=[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 I(t,e,s){const[n,r]=t,o=n.length,i=g.A.createEmptyBand(s,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=n[t]+r[t]);return i}function R(t,e,s){const[n]=t,r=n.length,o=g.A.createEmptyBand("f32",r);return o.set(n),o}function F(t,e,s){const[n]=t,r=n.length,o=g.A.createEmptyBand(s,r);for(let t=0;t<r;t++)e&&!e[t]||(o[t]=n[t]*n[t]);return o}function k(t,e,s){const[n,r]=t,o=n.length,i=g.A.createEmptyBand(s,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=n[t]-r[t]);return i}function _(t,e,s){const[n,r]=t,o=n.length,i=g.A.createEmptyBand(s,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=n[t]*r[t]);return i}function S(t,e,s){const[n]=t,r=n.length,o=g.A.createEmptyBand(s,r);for(let t=0;t<r;t++)e&&!e[t]||(o[t]=Math.sign(n[t])*Math.floor(Math.abs(n[t])));return o}function B(t,e,s){const[n,r]=t,o=n.length,i=g.A.createEmptyBand(s,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=n[t]/r[t]);return i}function j(t,e,s){return B(t,e,"f32")}function Z(t,e,s){const[n,r]=t,o=n.length,i=g.A.createEmptyBand(s,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=Math.floor(n[t]/r[t]));return i}function z(t,e,s,n){const r=t[0],o=r.length,i=g.A.createEmptyBand(s,o);if(n===C.atanh){for(let t=0;t<o;t++)if(e[t]){const s=r[t];Math.abs(s)>=1?e[t]=0:i[t]=Math.atanh(s)}return i}const a=n===C.asin?Math.asin:Math.acos;for(let t=0;t<o;t++)if(e[t]){const s=r[t];Math.abs(s)>1?e[t]=0:i[t]=a(s)}return i}function G(t,e,s,n){const[r]=t,o=r.length,i=g.A.createEmptyBand(s,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=n(r[t]));return i}function O(t,e,s,n){const[r,o]=t,i=r.length,a=g.A.createEmptyBand(s,i);for(let t=0;t<i;t++)e&&!e[t]||(a[t]=n(r[t],o[t]));return a}function D(t,e,s){const[n,r]=t,o=n.length,i=g.A.createEmptyBand(s,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=n[t]&r[t]);return i}function E(t,e,s){const[n,r]=t,o=n.length,i=g.A.createEmptyBand(s,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=n[t]<<r[t]);return i}function V(t,e,s){const[n]=t,r=n.length,o=g.A.createEmptyBand(s,r);for(let t=0;t<r;t++)e&&!e[t]||(o[t]=~n[t]);return o}function U(t,e,s){const[n,r]=t,o=n.length,i=g.A.createEmptyBand(s,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=n[t]|r[t]);return i}function L(t,e,s){const[n,r]=t,o=n.length,i=g.A.createEmptyBand(s,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=n[t]>>r[t]);return i}function $(t,e,s){const[n,r]=t,o=n.length,i=g.A.createEmptyBand(s,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=n[t]^r[t]);return i}function K(t,e,s){const[n,r]=t,o=n.length,i=g.A.createEmptyBand(s,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=n[t]&&r[t]?1:0);return i}function W(t,e,s){const[n]=t,r=n.length,o=g.A.createEmptyBand(s,r);for(let t=0;t<r;t++)e&&!e[t]||(o[t]=n[t]?0:1);return o}function H(t,e,s){const[n,r]=t,o=n.length,i=g.A.createEmptyBand(s,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=n[t]||r[t]?1:0);return i}function q(t,e,s){const[n,r]=t,o=n.length,i=g.A.createEmptyBand(s,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=(n[t]?1:0)^(r[t]?1:0));return i}function J(t,e,s){const[n,r]=t,o=n.length,i=g.A.createEmptyBand(s,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=n[t]===r[t]?1:0);return i}function X(t,e,s,n){const[r]=t,o=r.length,i=g.A.createEmptyBand(s,o),a=n===Math.E;for(let t=0;t<o;t++)e&&!e[t]||(i[t]=a?Math.exp(r[t]):n**r[t]);return i}function Q(t,e,s){return X(t,e,s,10)}function Y(t,e,s){return X(t,e,s,2)}function tt(t,e,s){return X(t,e,s,Math.E)}function et(t,e,s,n){const[r]=t,o=r.length,i=g.A.createEmptyBand(s,o);for(let t=0;t<o;t++)e&&!e[t]||(r[t]<=0?e[t]=0:i[t]=n(r[t]));return i}function st(t,e,s){return et(t,e,s,Math.log10)}function nt(t,e,s){return et(t,e,s,Math.log2)}function rt(t,e,s){return et(t,e,s,Math.log)}function ot(t,e,s){const[n,r]=t,o=n.length,i=g.A.createEmptyBand(s,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=n[t]>r[t]?1:0);return i}function it(t,e,s){const[n,r]=t,o=n.length,i=g.A.createEmptyBand(s,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=n[t]>=r[t]?1:0);return i}function at(t,e,s){const[n,r]=t,o=n.length,i=g.A.createEmptyBand(s,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=n[t]<r[t]?1:0);return i}function ut(t,e,s){const[n,r]=t,o=n.length,i=g.A.createEmptyBand(s,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=n[t]<=r[t]?1:0);return i}function lt(t,e,s){const[n]=t,r=n.length,o=g.A.createEmptyBand(s,r);if(!e)return o;for(let t=0;t<r;t++)o[t]=e[t]?0:1;return o}function ct(t,e,s){const[n,r]=t,o=n.length,i=g.A.createEmptyBand(s,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=n[t]%r[t]);return i}function pt(t,e,s){const[n]=t,r=n.length,o=g.A.createEmptyBand(s,r);for(let t=0;t<r;t++)e&&!e[t]||(o[t]=-n[t]);return o}function ht(t,e,s){const[n,r]=t,o=n.length,i=g.A.createEmptyBand(s,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=n[t]===r[t]?0:1);return i}function mt(t,e,s){const[n,r]=t,o=n.length,i=g.A.createEmptyBand(s,o),a=new Uint8Array(o);for(let t=0;t<o;t++)null!=e&&!e[t]||0!==n[t]||(i[t]=r[t],a[t]=255);return{band:i,mask:a}}function dt(t,e,s){const[n,r,o]=t,i=n.length,a=g.A.createEmptyBand(s,i);for(let t=0;t<i;t++)e&&!e[t]||(a[t]=n[t]?r[t]:o[t]);return a}function gt(t,e,s){const n=t.length;if(n<2)return t[0];const[r]=t,o=r.length,i=g.A.createEmptyBand(s,o);for(let s=0;s<o;s++)if(!e||e[s]){let e=r[s];for(let r=1;r<n;r++){const n=t[r][s];e<n&&(e=n)}i[s]=e}return i}function ft(t,e,s){const n=t.length;if(n<2)return t[0];const[r]=t,o=r.length,i=g.A.createEmptyBand(s,o);for(let s=0;s<o;s++)if(!e||e[s]){let e=r[s];for(let r=1;r<n;r++){const n=t[r][s];e>n&&(e=n)}i[s]=e}return i}function yt(t,e,s){const n=t.length;if(n<2)return t[0];const[r]=t,o=r.length,i=g.A.createEmptyBand(s,o);for(let s=0;s<o;s++)if(!e||e[s]){let e=r[s],o=e;for(let r=1;r<n;r++){const n=t[r][s];o<n?o=n:e>n&&(e=n)}i[s]=o-e}return i}function xt(t,e,s){const n=t.length;if(n<2)return t[0];const[r]=t,o=r.length,i=g.A.createEmptyBand(s,o);for(let s=0;s<o;s++)if(!e||e[s]){let e=0;for(let r=0;r<n;r++)e+=t[r][s];i[s]=e/n}return i}function wt(t,e,s){const n=t.length;if(n<2)return t[0];const[r]=t,o=r.length,i=g.A.createEmptyBand(s,o);for(let s=0;s<o;s++)if(!e||e[s])for(let e=0;e<n;e++){const n=t[e];i[s]+=n[s]}return i}function At(t,e,s){const n=t.length;if(n<2)return t[0];const[r]=t,o=r.length,i=g.A.createEmptyBand(s,o);for(let s=0;s<o;s++)if(!e||e[s]){const e=new Float32Array(n);let r=0;for(let o=0;o<n;o++){const n=t[o];r+=n[s],e[o]=n[s]}r/=n;let o=0;for(let t=0;t<n;t++)o+=(e[t]-r)**2;i[s]=Math.sqrt(o/n)}return i}function vt(t,e,s){const n=t.length;if(n<2)return t[0];const r=Math.floor(n/2),[o]=t,i=o.length,a=g.A.createEmptyBand(s,i),u=new Float32Array(n),l=n%2==1;for(let s=0;s<i;s++)if(!e||e[s]){for(let e=0;e<n;e++)u[e]=t[e][s];u.sort(),a[s]=l?u[r]:(u[r]+u[r-1])/2}return a}function Ct(t,e,s){const[n,r]=t;if(null==r)return n;const o=n.length,i=g.A.createEmptyBand(s,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=n[t]<r[t]?n[t]:r[t]);return i}function bt(t,e,s){const n=t.length;if(n<=2)return Ct(t,e,s);const r=t[0].length,o=g.A.createEmptyBand(s,r),i=new Map;for(let s=0;s<r;s++)if(!e||e[s]){i.clear();for(let e=0;e<n;e++){const n=t[e][s];i.set(n,i.has(n)?i.get(n)+1:1)}let e=0,r=0;const a=[];for(const t of i.keys())e=i.get(t),e>r?(r=e,a.length=0,a.push(t)):e===r&&a.push(t);a.length>1&&a.sort((t,e)=>t-e),o[s]=a[0]}return o}function Mt(t,e,s){const n=t.length;if(n<=2)return Ct(t,e,s);const r=t[0].length,o=g.A.createEmptyBand(s,r),i=new Map;for(let s=0;s<r;s++)if(!e||e[s]){i.clear();for(let e=0;e<n;e++){const n=t[e][s];i.set(n,i.has(n)?i.get(n)+1:1)}let e=0,r=t.length;const a=[];for(const t of i.keys())e=i.get(t),e<r?(r=e,a.length=0,a.push(t)):e===r&&a.push(t);a.length>1&&a.sort((t,e)=>t-e),o[s]=a[0]}return o}function Tt(t,e,s){const n=t.length;if(n<2)return t[0];const[r]=t,o=r.length,i=g.A.createEmptyBand(s,o),a=new Set;for(let s=0;s<o;s++)if(!e||e[s]){let e;a.clear();for(let r=0;r<n;r++)e=t[r][s],a.add(e);i[s]=a.size}return i}const Pt=new Map,Nt=new Map,It=new Map,Rt=new Map;function Ft(){Pt.size||(Pt.set(4,Math.sqrt),Pt.set(6,Math.acos),Pt.set(7,Math.asin),Pt.set(8,Math.atan),Pt.set(9,Math.atanh),Pt.set(10,Math.abs),Pt.set(21,Math.cos),Pt.set(22,Math.cosh),Pt.set(48,Math.floor),Pt.set(49,Math.ceil),Pt.set(51,Math.sin),Pt.set(52,Math.sinh),Pt.set(56,Math.tan),Pt.set(57,Math.tanh),Pt.set(59,Math.acosh),Pt.set(60,Math.asinh),Pt.set(65,Math.floor),Nt.set(5,Math.pow),Nt.set(61,Math.atan2),It.set(1,I),It.set(2,k),It.set(3,_),It.set(11,D),It.set(12,E),It.set(13,V),It.set(14,U),It.set(15,L),It.set(16,$),It.set(17,K),It.set(18,W),It.set(19,H),It.set(20,q),It.set(23,B),It.set(24,J),It.set(25,tt),It.set(26,Q),It.set(27,Y),It.set(28,ot),It.set(29,it),It.set(30,S),It.set(31,lt),It.set(32,R),It.set(33,at),It.set(34,ut),It.set(35,rt),It.set(36,st),It.set(37,nt),It.set(44,ct),It.set(45,pt),It.set(46,ht),It.set(53,F),It.set(64,j),It.set(65,Z),It.set(76,dt),It.set(78,dt),Rt.set(38,bt),Rt.set(39,gt),Rt.set(40,xt),Rt.set(41,vt),Rt.set(42,ft),Rt.set(43,Mt),Rt.set(47,yt),Rt.set(54,At),Rt.set(55,wt),Rt.set(58,Tt),Rt.set(66,bt),Rt.set(67,gt),Rt.set(68,xt),Rt.set(69,vt),Rt.set(70,ft),Rt.set(71,Mt),Rt.set(72,yt),Rt.set(73,At),Rt.set(74,wt),Rt.set(75,Tt))}function kt(t,e,s={}){Ft();let n=function(t,e=!1){const s=t.map(t=>t.mask),n=s.filter(t=>null!=t),r=t[0].pixels[0].length;if(0===n.length||e&&n.length!==s.length)return new Uint8Array(r).fill(255);const o=n[0],i=new Uint8Array(o);if(1===n.length)return i;if(!e){for(let t=1;t<n.length;t++){const e=n[t];for(let t=0;t<i.length;t++)i[t]&&(i[t]=e[t]?255:0)}return i}for(let t=1;t<n.length;t++){const e=n[t];for(let t=0;t<i.length;t++)0===i[t]&&(i[t]=e[t]?255:0)}return i}(t,e>=66&&e<=75);const{outputPixelType:r="f32"}=s,o=!Rt.has(e)||s.processAsMultiband,i=o?t[0].pixels.length:1,a=[];for(let s=0;s<i;s++){const i=Rt.has(e)&&!o?t.flatMap(t=>t.pixels):t.map(t=>t.pixels[s]);let l,c=!0;if(e===b.setNull){const t=mt(i,n,r);l=t.band,n=t.mask,c=!1}else It.has(e)?l=It.get(e)(i,n,"f64"):Pt.has(e)?l=e===C.asin||e===C.acos||e===C.atanh?z(i,n,"f64",e):G(i,n,"f64",Pt.get(e)):Nt.has(e)?l=O(i,n,"f64",Nt.get(e)):Rt.has(e)?l=Rt.get(e)(i,n,"f64"):(l=i[0],c=!1);if(c&&e!==v.isNull&&!T.has(e)){const t=g.A.createEmptyBand(r,l.length);n||(n=new Uint8Array(l.length).fill(255)),(0,u.$p)(l,n),(0,u.yM)(l,n,r,t),l=t}a.push(l)}const l=t[0];return new g.A({width:l.width,height:l.height,pixelType:r,mask:e===v.isNull?null:n,pixels:a})}let _t=class extends w{constructor(){super(...arguments),this.functionName="Arithmetic",this.functionArguments=null,this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){const{operation:t}=this.functionArguments;if(t<1||t>6)return{success:!1,supportsGPU:!1,error:"unsupported operation"};const 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:e.bandCount<=3}}_processPixels(t){const{pixelBlocks:e}=t;return null==e?.[0]||null==e?.[1]?null:function(t,e,s){return kt(t,e=[null,1,2,3,23,5,44][e]??1,{outputPixelType:s})}(e,this.functionArguments.operation,this.outputPixelType)}_getWebGLParameters(){const{operation:t}=this.functionArguments,e=["","plus","minus","times","divide","power","mod"][t],s=this.outputPixelType??"f32";let[n,r]=(0,u.hP)(s);const o=(0,u.zw)(s);return o&&(n-=1e-4,r+=1e-4),{imageCount:2,operationName:e,domainRange:[n,r],isOutputRounded:o}}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],_t.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:d,json:{write:!0,name:"rasterFunctionArguments"}})],_t.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],_t.prototype,"rasterArgumentNames",void 0),_t=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ArithmeticFunction")],_t);const St=_t;var Bt;let jt=Bt=class extends p{clone(){return new Bt({raster:this.raster})}};jt=Bt=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.AspectFunctionArguments")],jt);const Zt=jt;var zt=s(51181);let Gt=class extends w{constructor(){super(...arguments),this.functionName="Aspect",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];this.isGCS=t.spatialReference?.isGeographic??!1,this.outputPixelType=this._getOutputPixelType("f32");const e=t.clone();return e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),e.statistics=[{min:-1,max:360,avg:180,stddev:30}],e.bandCount=1,this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{extent:s,primaryPixelSizes:n}=t,r=n?.[0],o=r??(s?{x:s.width/e.width,y:s.height/e.height}:{x:1,y:1});return(0,zt.di)(e,{resolution:o})}_getNeighborhoodSize(){return{rows:3,cols:3}}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Gt.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:Zt,json:{write:!0,name:"rasterFunctionArguments"}})],Gt.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],Gt.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Gt.prototype,"isGCS",void 0),Gt=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.AspectFunction")],Gt);const Ot=Gt;var Dt=s(66552);const Et=new Set(["+","-","*","/","(",")"]);function Vt(t,e){return t.toLowerCase().startsWith("b")?e[parseInt(t.slice(1),10)-1]:parseFloat(t)}function Ut(t,e,s,n){if("number"==typeof s&&"number"==typeof n)return s+n;let r,o,i;"number"==typeof s?(i=n,r=i.length,o=new Float32Array(r),o.fill(s)):(r=s.length,o=s,n.constructor===Number?(i=new Float32Array(r),i.fill(n)):i=n);const a=new Float32Array(r);switch(e){case"+":for(let e=0;e<r;e++)(null==t||t[e])&&(a[e]=o[e]+i[e]);break;case"-":for(let e=0;e<r;e++)(null==t||t[e])&&(a[e]=o[e]-i[e]);break;case"*":for(let e=0;e<r;e++)(null==t||t[e])&&(a[e]=o[e]*i[e]);break;case"/":for(let e=0;e<r;e++)(null==t||t[e])&&i[e]&&(a[e]=o[e]/i[e]);break;case"(":case")":throw new Error("encountered error with custom band index equation")}return a}function Lt(t,e){t.splice(e,1);let s=0,n=0;do{s=0,n=0;for(let e=0;e<t.length;e++)if("("===t[e])s=e;else if(")"===t[e]){n=e;break}n===s+1&&t.splice(s,2)}while(n===s+1);return t}function $t(t){if(1===t.length)return{opIndex:0,numIndex:0};let e=0,s=0;for(let n=0;n<t.length;n++)if("("===t[n])e=n;else if(")"===t[n]){s=n;break}const n=0===s?t:t.slice(e+1,s);let r=-1;for(let t=0;t<n.length;t++)if("*"===n[t]||"/"===n[t]){r=t;break}if(r>-1)s>0&&(r+=e+1);else{for(let t=0;t<n.length;t++)if("+"===n[t]||"-"===n[t]){r=t;break}s>0&&(r+=e+1)}let o=0;for(let e=0;e<r;e++)"("===t[e]&&o++;return{opIndex:r,numIndex:r-o}}var Kt=s(47520);const Wt=new Dt.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 Ht(t,e){if(!(0,Kt.AB)(t))return t;const{equation:s,method:n}=e,r=e.bandIndexes.map(t=>t-1),{pixels:o,mask:i}=t;let a;switch(n){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":a=Jt(i,o[r[0]],o[r[1]]);break;case"ndwi":a=Jt(i,o[r[1]],o[r[0]]);break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":a=function(t,e,s){const n=s.length,r=new Float32Array(n);for(let o=0;o<n;o++)if(null==t||t[o]){const t=e[o],n=s[o];n&&(r[o]=t/n)}return[r]}(i,o[r[0]],o[r[1]]);break;case"ci-g":case"ci-re":a=function(t,e,s){const n=e.length,r=new Float32Array(n);for(let o=0;o<n;o++)if(null==t||t[o]){const t=e[o],n=s[o];n&&(r[o]=t/n-1)}return[r]}(i,o[r[0]],o[r[1]]);break;case"savi":a=function(t,e,s,n){const r=s.length,o=new Float32Array(r);for(let i=0;i<r;i++)if(null==t||t[i]){const t=s[i],r=e[i],a=r+t+n;a&&(o[i]=(r-t)/a*(1+n))}return[o]}(i,o[r[0]],o[r[1]],r[2]+1);break;case"tsavi":a=function(t,e,s,n,r,o){const i=s.length,a=new Float32Array(i),u=-r*n+o*(1+n*n);for(let o=0;o<i;o++)if(null==t||t[o]){const t=s[o],i=e[o],l=r*i+t+u;l&&(a[o]=n*(i-n*t-r)/l)}return[a]}(i,o[r[0]],o[r[1]],r[2]+1,r[3]+1,r[4]+1);break;case"msavi":a=function(t,e,s){const n=s.length,r=new Float32Array(n);for(let o=0;o<n;o++)if(null==t||t[o]){const t=s[o],n=e[o],i=2*n+1;r[o]=.5*(i-Math.sqrt(i*i-8*(n-t)))}return[r]}(i,o[r[0]],o[r[1]]);break;case"gemi":a=function(t,e,s){const n=s.length,r=new Float32Array(n);for(let o=0;o<n;o++)if(null==t||t[o]){const t=s[o],n=e[o];if(1!==t&&n+t+.5!==0){const e=(2*(n*n-t*t)+1.5*n+.5*t)/(n+t+.5);r[o]=e*(1-.25*e)-(t-.125)/(1-t)}}return[r]}(i,o[r[0]],o[r[1]]);break;case"pvi":a=function(t,e,s,n,r){const o=s.length,i=new Float32Array(o),a=1/Math.sqrt(1+n*n);for(let u=0;u<o;u++)if(null==t||t[u]){const t=s[u],o=e[u];i[u]=(o-n*t-r)*a}return[i]}(i,o[r[0]],o[r[1]],r[2]+1,r[3]+1);break;case"gvitm":a=function(t,e){const[s,n,r,o,i,a]=e,u=s.length,l=new Float32Array(u);for(let e=0;e<u;e++)(null==t||t[e])&&(l[e]=-.2848*s[e]-.2435*n[e]-.5436*r[e]+.7243*o[e]+.084*i[e]-.18*a[e]);return[l]}(i,[o[r[0]],o[r[1]],o[r[2]],o[r[3]],o[r[4]],o[r[5]]]);break;case"sultan":a=function(t,e){const[s,n,r,o,i]=e,a=s.length,u=new Float32Array(a),l=new Float32Array(a),c=new Float32Array(a);for(let e=0;e<a;e++)(null==t||t[e])&&(u[e]=i[e]?o[e]/i[e]*100:0,l[e]=s[e]?o[e]/s[e]*100:0,c[e]=r[e]?n[e]/r[e]*(o[e]/r[e])*100:0);return[u,l,c]}(i,[o[r[0]],o[r[1]],o[r[2]],o[r[3]],o[r[4]]]);break;case"vari":a=function(t,e){const[s,n,r]=e,o=s.length,i=new Float32Array(o);for(let e=0;e<o;e++)if(null==t||t[e])for(e=0;e<o;e++){const t=s[e],o=n[e],a=o+t-r[e];a&&(i[e]=(o-t)/a)}return[i]}(i,[o[r[0]],o[r[1]],o[r[2]]]);break;case"mtvi2":a=function(t,e){const[s,n,r]=e,o=s.length,i=new Float32Array(o);for(let e=0;e<o;e++)if(null==t||t[e])for(e=0;e<o;e++){const t=s[e],o=n[e],a=r[e],u=Math.sqrt((2*t+1)**2-(6*t-5*Math.sqrt(o))-.5);if(u){const s=1.5*(1.2*(t-a)-2.5*(o-a));i[e]=s/u}}return[i]}(i,[o[r[0]],o[r[1]],o[r[2]]]);break;case"rtvi-core":a=function(t,e){const[s,n,r]=e,o=s.length,i=new Float32Array(o);for(let e=0;e<o;e++)if(null==t||t[e])for(e=0;e<o;e++){const t=s[e],o=n[e],a=r[e];i[e]=100*(t-o)-10*(t-a)}return[i]}(i,[o[r[0]],o[r[1]],o[r[2]]]);break;case"evi":a=function(t,e){const[s,n,r]=e,o=s.length,i=new Float32Array(o);for(let e=0;e<o;e++)if(null==t||t[e])for(e=0;e<o;e++){const t=s[e],o=n[e],a=t+6*o-7.5*r[e]+1;a&&(i[e]=2.5*(t-o)/a)}return[i]}(i,[o[r[0]],o[r[1]],o[r[2]]]);break;case"wndwi":a=function(t,e,s=.5){const[n,r,o]=e,i=r.length,a=new Float32Array(i);for(let e=0;e<i;e++)if(null==t||t[e])for(e=0;e<i;e++){const t=n[e],i=r[e],u=o[e],l=t+s*i+(1-s)*u;l&&(a[e]=(t-s*i-(1-s)*u)/l)}return[a]}(i,[o[r[0]],o[r[1]],o[r[2]]],r[3]?r[3]+1:.5);break;case"bai":a=function(t,e,s){const n=s.length,r=new Float32Array(n);for(let o=0;o<n;o++)if(null==t||t[o])for(o=0;o<n;o++){const t=(.1-e[o])**2+(.06-s[o])**2;t&&(r[o]=1/t)}return[r]}(i,o[r[0]],o[r[1]]);break;case"custom":a=function(t,e,s){let n,{ops:r,nums:o}=function(t,e){(t=t.replaceAll(" ","")).startsWith("-")&&(t="0"+t),t.startsWith("+")&&(t=t.slice(1));const s=t.split(""),n=[],r=[];let o="";for(let t=0;t<s.length;t++){const i=s[t];Et.has(i)?(o.length&&r.push(Vt(o,e)),n.push(i),o=""):o=o.concat(i)}return o.length&&r.push(Vt(o,e)),{ops:n,nums:r}}(s,e);if(0===r.length){const t=1===o.length?o[0]:e[0];if(t instanceof Float32Array)return[t];const s=new Float32Array(e[0].length);return"number"==typeof t?s.fill(t):s.set(t),[s]}for(;r.length>0;){const{numIndex:e,opIndex:s}=$t(r);if(n=Ut(t,r[s],o[e],o[e+1]),1===r.length)break;r=Lt(r,s),o.splice(e,2,n)}return[n]}(i,o,s);break;default:return t}const{outputPixelType:l="f32"}=e,c=null!=l&&(0,u.zw)(l);let p;i?(p=new Uint8Array(t.width*t.height),p.set(i)):c&&(p=new Uint8Array(t.width*t.height).fill(255)),c&&(a=a.map(t=>{const e=g.A.createEmptyBand(l,t.length);return(0,u.yM)(t,p,l,e),e}));const h=new g.A({width:t.width,height:t.height,pixelType:l,pixels:a,mask:p});return h.updateStatistics(),h}function qt(t){const e=new Float32Array(9);return e[3*t[0]]=1,e[3*t[1]+1]=1,e[3*t[2]+2]=1,e}function Jt(t,e,s){const n=s.length,r=new Float32Array(n);for(let o=0;o<n;o++)if(null==t||t[o]){const t=e[o],n=s[o],i=t+n;i&&(r[o]=(t-n)/i)}return[r]}var Xt,Qt=s(93223);let Yt=Xt=class extends p{constructor(){super(...arguments),this.method="custom"}clone(){return new Xt({method:this.method,bandIndexes:this.bandIndexes,raster:(0,o.o8)(this.raster)})}};(0,i.Cg)([(0,a.MZ)({json:{type:String,write:!0}})],Yt.prototype,"bandIndexes",void 0),(0,i.Cg)([(0,Qt.e)(Wt)],Yt.prototype,"method",void 0),Yt=Xt=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.BandArithmeticFunctionArguments")],Yt);const te=Yt,ee=new Set(["vari","mtvi2","rtvi-core","evi"]);let se=class extends w{constructor(){super(...arguments),this.functionName="BandArithmetic",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0];if(t.bandCount<2)return{success:!1,supportsGPU:!1,error:"band-arithmetic-function: source raster has insufficient amount of raster bands"};const e=t.clone();return e.pixelType=this.outputPixelType,e.bandCount="sultan"===this.functionArguments.method?3:1,this._removeStatsHistColormapVAT(e),e.keyProperties={...e.keyProperties,BandProperties:void 0},this.rasterInfo=e,{success:!0,supportsGPU:!["custom","gvitm","sultan"].includes(this.functionArguments.method)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return e;const{method:s,bandIndexes:n}=this.functionArguments,r=n.split(" ").map(t=>parseFloat(t));if(this.rasterInfo.storageInfo.isBsqTile){const{rawInputBandIds:t}=this,e=ee.has(this.functionArguments.method)?3:2,s=r.slice(0,e).map(e=>t.indexOf(e-1));r.splice(0,e,...s)}return Ht(e,{method:s,bandIndexes:r,equation:n,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const t=this.functionArguments.bandIndexes.split(" ").map(t=>parseFloat(t)-1);2===t.length&&t.push(0);const e=this.isInputBandIdsSwizzled?[0,1,2]:t;let s,n;const r=new Float32Array(3),{method:o}=this.functionArguments;switch(o){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":s=qt([e[0],e[1],0]),n="ndxi";break;case"ndwi":s=qt([e[1],e[0],0]),n="ndxi";break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":s=qt([e[0],e[1],0]),n="sr";break;case"ci-g":case"ci-re":s=qt([e[0],e[1],0]),n="ci";break;case"savi":s=qt([e[0],e[1],0]),n="savi",r[0]=t[2]+1;break;case"tsavi":s=qt([e[0],e[1],0]),n="tsavi",r[0]=t[2]+1,r[1]=t[3]+1,r[2]=t[4]+1;break;case"msavi":s=qt([e[0],e[1],0]),n="msavi";break;case"gemi":s=qt([e[0],e[1],0]),n="gemi";break;case"pvi":s=qt([e[0],e[1],0]),n="tsavi",r[0]=t[2]+1,r[1]=t[3]+1;break;case"vari":s=qt([e[0],e[1],e[2]]),n="vari";break;case"mtvi2":s=qt([e[0],e[1],e[2]]),n="mtvi";break;case"rtvi-core":s=qt([e[0],e[1],e[2]]),n="rtvicore";break;case"evi":s=qt([e[0],e[1],e[2]]),n="evi";break;case"wndwi":s=qt([e[0],e[1],0]),n="wndwi",r[0]=t[3]?t[3]+1:.5;break;case"bai":s=qt([e[1],e[0],0]),n="bai";break;default:s=qt([0,1,2]),n="custom"}return{bandIndexMat3:s,indexType:n,adjustments:r,isOutputRounded:(0,u.zw)(this.outputPixelType)}}_getInputBandIds(t){if("custom"===this.functionArguments.method)return t;const e=this.functionArguments.bandIndexes.split(" ").map(t=>parseFloat(t)-1),s=t.length,n=e.map(t=>t>=s?s-1:t),r=ee.has(this.functionArguments.method)?3:2,o=n.slice(0,r).map(e=>t[e]);return 2===o.length&&o.push(0),o}_swizzleBandIds(t){const e=this.functionArguments.bandIndexes.split(" ").map(t=>parseFloat(t)-1);2===e.length&&e.push(0);const{method:s}=this.functionArguments,n=(["vari","mtvi2","rtvi-core","evi"].includes(s)?e.slice(0,3):"bai"===s||"ndwi"===s?[e[1],e[0]]:e.slice(0,2)).map(e=>t.indexOf(e));return n[2]??=n[1],this.isInputBandIdsSwizzled=!0,this.swizzledBandSelection=n,!1}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],se.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:te,json:{write:!0,name:"rasterFunctionArguments"}})],se.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],se.prototype,"rasterArgumentNames",void 0),se=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.BandArithmeticFunction")],se);const ne=se;var re,oe=s(65864),ie=s(50498);const ae=new Dt.J({1:"outside",2:"inside"},{useNumericKeys:!0});let ue=re=class extends p{constructor(){super(...arguments),this.clippingType="outside"}clone(){return new re({clippingGeometry:this.clippingGeometry.clone(),clippingType:this.clippingType})}};(0,i.Cg)([(0,a.MZ)({types:ie.yR,json:{read:oe.rS,write:!0}})],ue.prototype,"clippingGeometry",void 0),(0,i.Cg)([(0,a.MZ)({json:{read:ae.read,write:ae.write}})],ue.prototype,"clippingType",void 0),ue=re=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ClipFunctionArguments")],ue);const le=ue;var ce=s(34930),pe=s(37373);let he=class extends w{constructor(){super(...arguments),this.functionName="Clip",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(t.pixelType),t.pixelType=this.outputPixelType,this.rasterInfo=t;const{functionArguments:e}=this,{clippingGeometry:s,clippingType:n}=e;if(!s)return{success:!1,supportsGPU:!1,error:"missing clipping geometry"};if("outside"===n)try{const{spatialReference:e}=t,n="extent"===s.type?(0,pe._l)(s,e):(0,pe.uk)(s,e).extent;n&&(0,ce.Sd)(t,n)}catch{}return{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}_getWebGLParameters(){const{clippingGeometry:t,clippingType:e}=this.functionArguments;return{clippingGeometry:t.toJSON(),clippingType:e}}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],he.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:le,json:{write:!0,name:"rasterFunctionArguments"}})],he.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],he.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)()],he.prototype,"isNoopProcess",void 0),he=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ClipFunction")],he);const me=he;var de,ge=s(67369),fe=s(95349),ye=s(36005);let xe=de=class extends p{castColormapName(t){if(!t)return null;const e=t.toLowerCase();return ge.L7.includes(e)?e:null}readColorRamp(t){return(0,fe.r)(t)}readColorRampName(t,e){if(!t)return null;const s=ge.kH.jsonValues.find(e=>e.toLowerCase()===t.toLowerCase());return s?ge.kH.fromJSON(s):null}clone(){return new de({colormap:(0,o.o8)(this.colormap),colormapName:this.colormapName,colorRamp:this.colorRamp?.clone(),colorRampName:this.colorRampName})}};(0,i.Cg)([(0,a.MZ)({type:[[Number]],json:{write:!0}})],xe.prototype,"colormap",void 0),(0,i.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],xe.prototype,"colormapName",void 0),(0,i.Cg)([(0,a.wg)("colormapName")],xe.prototype,"castColormapName",null),(0,i.Cg)([(0,a.MZ)({types:fe.g,json:{write:!0}})],xe.prototype,"colorRamp",void 0),(0,i.Cg)([(0,ye.w)("colorRamp")],xe.prototype,"readColorRamp",null),(0,i.Cg)([(0,a.MZ)({type:ge.kH.apiValues,json:{type:ge.kH.jsonValues,write:ge.kH.write}})],xe.prototype,"colorRampName",void 0),(0,i.Cg)([(0,ye.w)("colorRampName")],xe.prototype,"readColorRampName",null),xe=de=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ColormapFunctionArguments")],xe);const we=xe,Ae=[[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]],ve=[[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 Ce(t,e){const s=[],n=[];for(let e=0;e<t.length-1;e++)s.push({type:"algorithmic",algorithm:"esriHSVAlgorithm",fromColor:t[e].slice(1),toColor:t[e+1].slice(1)}),n.push(t[e+1][0]-t[e][0]);const r=t[t.length-1][0];return(0,ge.iv)({type:"multipart",colorRamps:s},{numColors:r,weights:e=e??n})}let be=class extends w{constructor(){super(...arguments),this.functionName="Colormap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"colormap-function: source data must be single band"};let{colormap:e,colormapName:s,colorRamp:n,colorRampName:r}=this.functionArguments;if(!e?.length)if(n)this.colorRamp=n,e=(0,ge.R8)(n,{interpolateAlpha:!0});else if(r){const t=(0,ge.M5)(r);t&&(e=(0,ge.R8)(t),this.colorRamp=(0,fe.r)(t))}else s&&(e=function(t){let e;switch(t){case"elevation":e=Ce([[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":e=(0,ge.iv)({type:"algorithmic",algorithm:"esriHSVAlgorithm",fromColor:[0,0,0],toColor:[255,255,255]});break;case"hillshade":e=Ce([[0,38,41,54],[69,79,82,90],[131,156,156,156],[256,253,253,241]],[.268,.238,.495]);break;case"ndvi":e=Ae;break;case"ndvi2":e=function(){const t=Ce([[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 e=t.length;e<256;e++)t.push([6,27,7]);return t}();break;case"ndvi3":e=ve;break;case"random":e=function(){const t=[];for(let e=0;e<256;e++){const e=[];for(let t=0;t<3;t++)e.push(Math.round(255*Math.random()));t.push(e)}return t}()}return e?(e=e.map((t,e)=>[e,...t]),e):null}(s));if(!e?.length)return{success:!1,supportsGPU:!1,error:"colormap-function: missing colormap argument"};const o=this._getOutputPixelType(t.pixelType);this.outputPixelType=o.startsWith("f")?"s32":o;const i=t.clone();return i.pixelType=this.outputPixelType,i.colormap=e,i.bandCount=1,this.rasterInfo=i,{success:!0,supportsGPU:!0}}_processPixels(t){let e=t.pixelBlocks?.[0];return!e||(0,u.zw)(e.pixelType)||(e=e.clone(),e.clamp(this.outputPixelType)),e}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],be.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:we,json:{write:!0,name:"rasterFunctionArguments"}})],be.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],be.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)()],be.prototype,"isNoopProcess",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],be.prototype,"indexedColormap",void 0),(0,i.Cg)([(0,a.MZ)()],be.prototype,"colorRamp",void 0),be=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ColormapFunction")],be);const Me=be;var Te;let Pe=Te=class extends p{clone(){return new Te({raster:this.raster})}};Pe=Te=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ColormapToRGBFunctionArguments")],Pe);const Ne=Pe;var Ie=s(4151),Re=s(88178);let Fe=class extends w{constructor(){super(...arguments),this.functionName="ColormapToRGB",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1||!t.colormap?.length)return{success:!1,supportsGPU:!1,error:"colormap-to-rgb-function: source data must be single band with a colormap"};const e=t.clone();e.pixelType=this.outputPixelType=this._getOutputPixelType("u8"),this._removeStatsHistColormapVAT(e),e.bandCount=3,e.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=e;const s=[...t.colormap].sort((t,e)=>t[0]-e[0]),{indexedColormap:n,offset:r}=(0,Kt.zg)({colormap:s});return n?(this.lookup={indexedColormap:n,offset:r},{success:!0,supportsGPU:(0,Re.WN)(n)}):{success:!1,supportsGPU:!1,error:"colormap-to-rgb-function: the colormap is not supported"}}_processPixels(t){let e=t.pixelBlocks?.[0];if(!e||!this.lookup)return e;e=e.clone();const s=e.pixels[0],n=e.mask??new Uint8Array(s.length).fill(255),r=new Uint8Array(s.length),o=new Uint8Array(s.length),i=new Uint8Array(s.length),{indexedColormap:a,offset:u}=this.lookup,l=a.length;for(let t=0;t<s.length;t++)if(n[t]){let e=4*(s[t]-u);e<0||e>l-4?n[t]=0:(r[t]=a[e++],o[t]=a[e++],i[t]=a[e++])}return e.pixels=[r,o,i],e.statistics=[new Ie.A(0,255),new Ie.A(0,255),new Ie.A(0,255)],e.pixelType=this.outputPixelType,e}_getWebGLParameters(){return this.lookup}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Fe.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:Ne,json:{write:!0,name:"rasterFunctionArguments"}})],Fe.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],Fe.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Fe.prototype,"lookup",void 0),Fe=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ColormapToRGBFunction")],Fe);const ke=Fe;var _e,Se=s(43937);let Be=_e=class extends p{constructor(){super(...arguments),this.rasters=[]}writeRasters(t,e){e.rasters=t.map(t=>"number"==typeof t||"string"==typeof t?t:t.toJSON())}clone(){return new _e({rasters:(0,o.o8)(this.rasters)})}};(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Be.prototype,"rasters",void 0),(0,i.Cg)([(0,Se.K)("rasters")],Be.prototype,"writeRasters",null),Be=_e=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.CompositeBandFunctionArguments")],Be);const je=Be;let Ze=class extends w{constructor(){super(...arguments),this.functionName="CompositeBand",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0];this.outputPixelType=this._getOutputPixelType(e.pixelType);const s=e.clone();if(s.attributeTable=null,s.colormap=null,s.pixelType=this.outputPixelType,s.bandCount=t.map(({bandCount:t})=>t).reduce((t,e)=>t+e),t.every(({statistics:t})=>null!=t&&t.length)){const e=[];t.forEach(({statistics:t})=>null!=t&&e.push(...t)),s.statistics=e}if(t.every(({histograms:t})=>null!=t&&t.length)){const e=[];t.forEach(({histograms:t})=>null!=t&&e.push(...t)),s.histograms=e}s.multidimensionalInfo&&s.multidimensionalInfo.variables.forEach(e=>{const s=t.map(t=>t.multidimensionalInfo?.variables.find(({name:t})=>t===e.name)),n=s.map(t=>t?.statistics?.length?t.statistics:null),r=s.map(t=>t?.histograms?.length?t.histograms:null);e.statistics=n.every(t=>null!=t)?n.flat():null,e.histograms=r.every(t=>null!=t)?r.flat():null}),s.bandCount>1&&(s.colormap=null,s.attributeTable=null);const n=t.every(t=>t.keyProperties.BandProperties?.length)?t.flatMap(t=>t.keyProperties.BandProperties):void 0;return s.keyProperties={...s.keyProperties,BandProperties:n},this.rasterInfo=s,{success:!0,supportsGPU:s.bandCount<=3}}_processPixels(t){const{pixelBlocks:e}=t;if(!e)return null;const s=e?.[0];return null==s?null:(0,Kt.Wy)(e)}_getWebGLParameters(){return{bandCount:this.rasterInfo.bandCount}}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Ze.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:je,json:{write:!0,name:"rasterFunctionArguments"}})],Ze.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],Ze.prototype,"rasterArgumentNames",void 0),Ze=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.CompositeBandFunction")],Ze);const ze=Ze,Ge=new Dt.J({0:"difference",1:"relative-difference",2:"categorical",3:"euclidean-distance",4:"angle-difference",5:"band-with-most-change"},{useNumericKeys:!0}),Oe=new Dt.J({0:"all",1:"changed",2:"unchanged"},{useNumericKeys:!0});var De;let Ee=De=class extends p{constructor(){super(...arguments),this.method="difference",this.keepMethod="all",this.raster2=void 0}get rasters(){return[this.raster,this.raster2]}clone(){return new De({raster:this.raster,raster2:this.raster2,method:this.method,keepMethod:this.keepMethod})}};(0,i.Cg)([(0,Qt.e)(Ge)],Ee.prototype,"method",void 0),(0,i.Cg)([(0,Qt.e)(Oe)],Ee.prototype,"keepMethod",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Ee.prototype,"raster2",void 0),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],Ee.prototype,"rasters",null),Ee=De=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ComputeChangeFunctionArguments")],Ee);const Ve=Ee;var Ue=s(20437);let Le=class extends w{constructor(){super(...arguments),this.functionName="ComputeChange",this.functionArguments=null,this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){const{method:t}=this.functionArguments,e=this.sourceRasterInfos[0].clone();if(this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),"categorical"===t){const t=this.sourceRasterInfos.map(t=>t.attributeTable),s=this._getFieldNames(t,"value"),n=t.map(t=>this._getClassFieldName(t));if(null==s[0]||null==s[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(e,s,n)}return e.bandCount=1,this.rasterInfo=e,{success:!0,supportsGPU:"difference"===t||"relative-difference"===t}}_processPixels(t){const{pixelBlocks:e}=t;if(null==e?.[0]||null==e?.[1])return null;const{method:s}=this.functionArguments;return function(t,e,s,n){const[r,o]=t,i=(0,u.zw)(s)&&!(0,u.zw)(r.pixelType)&&!(0,u.zw)(o.pixelType),a=[r.mask,o.mask].filter(t=>t),l=g.A.combineBandMasks(a),c=t.map(t=>t.pixels[0]),{width:p,height:h}=r,m=g.A.createEmptyBand(s,p*h);switch(e){case"difference":case"relative-difference":!function(t){const{bands:[e,s],mask:n,isRelative:r,isRoundingNeeded:o,outBand:i}=t,a=e.length;for(let t=0;t<a;t++)if(!n||n[t]){let n=e[t]-s[t];if(r){const r=Math.max(Math.abs(e[t])-Math.abs(s[t]));n=r>0?n/r:0}i[t]=o?Math.round(n):n}}({bands:c,mask:l,outBand:m,isRoundingNeeded:i,isRelative:"relative-difference"===e});break;case"categorical":!function(t){const{bands:[e,s],categoryIndexLookups:[n,r],classNames:[o,i],mask:a,keepMethod:u,outBand:l}=t,c=e.length,p=o.length,h=i.length,m=p*h,d=m+1,g=m+2;for(let t=0;t<c;t++)if(!a||a[t]){const a=e[t],c=s[t],p=n[a],f=r[c],y=o[p],x=i[f];l[t]=null==p||null==f?m:"changed"===u&&y===x?d:"unchanged"===u&&y!==x?g:p*h+f}}({bands:c,mask:l,outBand:m,...n});break;case"euclidean-distance":!function(t){const{pixels:[e,s],mask:n,outBand:r}=t,o=e[0].length,i=e.length;for(let t=0;t<o;t++)if(!n||n[t]){let n=0;for(let r=0;r<i;r++){const o=e[r][t]-s[r][t];n+=o*o}r[t]=Math.sqrt(n)}}({pixels:t.map(t=>t.pixels),mask:l,outBand:m});break;case"angle-difference":!function(t){const{pixels:[e,s],mask:n,outBand:r}=t,o=e[0].length,i=e.length;for(let t=0;t<o;t++)if(!n||n[t]){let n=0,o=0,a=0;for(let r=0;r<i;r++){const i=e[r][t],u=s[r][t];n+=i*u,o+=i*i,a+=u*u}const u=Math.sqrt(o*a);r[t]=u?Math.acos(n/u):1.5707963267948966}}({pixels:t.map(t=>t.pixels),mask:l,outBand:m});break;case"band-with-most-change":!function(t){const{pixels:[e,s],mask:n,outBand:r}=t,o=e[0].length,i=e.length;for(let t=0;t<o;t++)if(!n||n[t]){let n=0,o=0;for(let r=0;r<i;r++){const i=Math.abs(e[r][t]-s[r][t]);i>n&&(n=i,o=r)}r[t]=o}}({pixels:t.map(t=>t.pixels),mask:l,outBand:m})}const d=new g.A({width:p,height:h,pixels:[m],pixelType:s,mask:l});return d.updateStatistics(),d}(e,s,this.outputPixelType,this._categoryConfig)}_getWebGLParameters(){const t=this.outputPixelType??"f32";let[e,s]=(0,u.hP)(t);const n=(0,u.zw)(t);return n&&(e-=1e-4,s+=1e-4),{method:this.functionArguments.method,domainRange:[e,s],isOutputRounded:n}}_updateAttributeTable(t,e,s){const n=this.sourceRasterInfos.map(t=>t.attributeTable),r=n.map((t,s)=>t.features.map(t=>t.attributes[e[s]])),o=n.map((t,e)=>t.features.map(t=>t.attributes[s[e]])),i=r.map(t=>{const e=[];return t.forEach((t,s)=>e[t]=s),e}),{keepMethod:a}=this.functionArguments;this._categoryConfig={categoryIndexLookups:i,classNames:o,keepMethod:a};const u=n[0].clone();u.fields=[new Ue.A({name:"OID",type:"oid"}),new Ue.A({name:"Value",type:"integer"}),new Ue.A({name:"ClassName",type:"string"}),new Ue.A({name:"Class_From",type:"string"}),new Ue.A({name:"Class_To",type:"string"})];const l=this._getFieldNames(n,"red"),c=this._getFieldNames(n,"green"),p=this._getFieldNames(n,"blue"),h=[],m=2===l.length&&2===c.length&&2===p.length;m&&(h.push(...n.map((t,e)=>t.features.map(t=>[t.attributes[l[e]],t.attributes[c[e]],t.attributes[p[e]]]))),u.fields.push(new Ue.A({name:"Red",type:"integer"}),new Ue.A({name:"Green",type:"integer"}),new Ue.A({name:"Blue",type:"integer"})));const d=u.features[0].clone();d.geometry=null;const g=[],[f,y]=r.map(t=>t.length);let x=1;for(let t=0;t<f;t++){const e=o[0][t];for(let s=0;s<y;s++){const n=o[1][s];if("changed"===a&&e===n||"unchanged"===a&&e!==n)continue;const r=d.clone();r.attributes={OID:x++,Value:t*y+s,ClassName:e===n?e:`${e} -> ${n}`,Class_From:e,Class_To:n},m&&(r.attributes.Red=h[0][t][0]+h[1][s][0]>>1,r.attributes.Green=h[0][t][1]+h[1][s][1]>>1,r.attributes.Blue=h[0][t][2]+h[1][s][2]>>1),g.push(r)}}if("changed"===a){const t=d.clone();t.attributes={OID:x++,Value:f*y+1,ClassName:"No Change",Class_From:"Same",Class_To:"Same"},g.push(t)}else if("unchanged"===a){const t=d.clone();t.attributes={OID:x++,Value:f*y+2,ClassName:"Changed",Class_From:"Any",Class_To:"Any"},g.push(t)}u.features=g,t.attributeTable=u}_getFieldNames(t,e){return t.map(({fields:t})=>t.find(t=>t.name.toLowerCase()===e)?.name).filter(t=>t)}_getClassFieldName(t){const e=t.fields.find(t=>"string"===t.type&&t.name.toLowerCase().startsWith("class"))??t.fields.find(t=>"string"===t.type&&t.name.toLowerCase().includes("class")||t.name.toLowerCase().includes("type")||t.name.toLowerCase().includes("name"))??t.fields.find(t=>"string"===t.type);return e?.name}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Le.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:Ve,json:{write:!0,name:"rasterFunctionArguments"}})],Le.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],Le.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Le.prototype,"_categoryConfig",void 0),Le=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ComputeChangeFunction")],Le);const $e=Le;var Ke;let We=Ke=class extends p{constructor(){super(...arguments),this.contrastOffset=0,this.brightnessOffset=0}clone(){return new Ke({contrastOffset:this.contrastOffset,brightnessOffset:this.brightnessOffset,raster:this.raster})}};(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],We.prototype,"contrastOffset",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],We.prototype,"brightnessOffset",void 0),We=Ke=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ContrastBrightnessFunctionArguments")],We);const He=We;var qe=s(51927);let Je=class extends w{constructor(){super(...arguments),this.functionName="ContrastBrightness",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0];if("u8"!==e.pixelType)return{success:!1,supportsGPU:!1,error:"Only unsigned 8 bit raster is supported by ContrastBrightness function."};this.outputPixelType=this._getOutputPixelType("u8");const s=e.clone();this._removeStatsHistColormapVAT(s),this.rasterInfo=s;const{contrastOffset:n,brightnessOffset:r}=this.functionArguments;return this.lookup=(0,qe.zj)(n,r),{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];return null==e?null:(0,Kt.eH)(e,{lut:e.pixels.map(()=>this.lookup),offset:0,outputPixelType:"u8"})}_getWebGLParameters(){const{contrastOffset:t,brightnessOffset:e}=this.functionArguments;return{contrastOffset:t,brightnessOffset:e}}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Je.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:He,json:{write:!0,name:"rasterFunctionArguments"}})],Je.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],Je.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Je.prototype,"lookup",void 0),Je=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ContrastBrightnessFunction")],Je);const Xe=Je;function Qe(t,e,s,n,r){const o=Math.floor(n/2);for(let n=0;n<o;n++)for(let o=0;o<e;o++)t[n*e+o]=t[(r-1-n)*e+o],t[(s-1-n)*e+o]=t[(s-r+n)*e+o];const i=Math.floor(r/2);for(let n=0;n<s;n++){const s=n*e;for(let n=0;n<i;n++)t[s+n]=t[s+r-1-n],t[s+e-n-1]=t[s+e+n-r]}}const Ye=new Map;function ts(t,e,s,n,r,o,i){const a=new Float32Array(e*s),u=o.length,l=i?0:n,c=i?n:0,p=i?1:e;for(let i=l;i<s-l;i++){const s=i*e;for(let i=c;i<e-c;i++){if(r&&!r[s+i])continue;let e=0;for(let r=0;r<u;r++)e+=t[s+i+(r-n)*p]*o[r];a[s+i]=e}}return a}function es(t,e,s,n,r,o,i){const a=new Float32Array(e*s),u=Math.floor(n/2),l=Math.floor(r/2);for(let c=u;c<s-u;c++){const s=c*e;for(let c=l;c<e-l;c++){if(o&&!o[s+c])continue;let p=0;for(let o=0;o<n;o++)for(let n=0;n<r;n++)p+=t[s+c+(o-u)*e+n-l]*i[o*r+n];a[s+c]=p}}return a}var ss;Ye.set(A.none,[0,0,0,0,1,0,0,0,0]),Ye.set(A.lineDetectionHorizontal,[-1,-1,-1,2,2,2,-1,-1,-1]),Ye.set(A.lineDetectionVertical,[-1,2,-1,-1,2,-1,-1,2,-1]),Ye.set(A.lineDetectionLeftDiagonal,[2,-1,-1,-1,2,-1,-1,-1,2]),Ye.set(A.lineDetectionRightDiagonal,[-1,-1,2,-1,2,-1,2,-1,-1]),Ye.set(A.gradientNorth,[-1,-2,-1,0,0,0,1,2,1]),Ye.set(A.gradientWest,[-1,0,1,-2,0,2,-1,0,1]),Ye.set(A.gradientEast,[1,0,-1,2,0,-2,1,0,-1]),Ye.set(A.gradientSouth,[1,2,1,0,0,0,-1,-2,-1]),Ye.set(A.gradientNorthEast,[0,-1,-2,1,0,-1,2,1,0]),Ye.set(A.gradientNorthWest,[-2,-1,0,-1,0,1,0,1,2]),Ye.set(A.smoothArithmeticMean,[.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111]),Ye.set(A.smoothing3x3,[.0625,.125,.0625,.125,.25,.125,.0625,.125,.0625]),Ye.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]),Ye.set(A.sharpening3x3,[-1,-1,-1,-1,9,-1,-1,-1,-1]),Ye.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]),Ye.set(A.laplacian3x3,[0,-1,0,-1,4,-1,0,-1,0]),Ye.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]),Ye.set(A.sobelHorizontal,[-1,-2,-1,0,0,0,1,2,1]),Ye.set(A.sobelVertical,[-1,0,1,-2,0,2,-1,0,1]),Ye.set(A.sharpen,[0,-.25,0,-.25,2,-.25,0,-.25,0]),Ye.set(A.sharpen2,[-.25,-.25,-.25,-.25,3,-.25,-.25,-.25,-.25]),Ye.set(A.pointSpread,[-.627,.352,-.627,.352,2.923,.352,-.627,.352,-.627]);let ns=ss=class extends p{constructor(){super(...arguments),this.rows=3,this.cols=3,this.kernel=[0,0,0,0,1,0,0,0,0]}set convolutionType(t){this._set("convolutionType",t);const e=Ye.get(t);if(!e||t===A.userDefined||t===A.none)return;const s=Math.round(Math.sqrt(e.length));this._set("kernel",e),this._set("cols",s),this._set("rows",s)}clone(){return new ss({cols:this.cols,rows:this.rows,kernel:[...this.kernel],convolutionType:this.convolutionType,raster:(0,o.o8)(this.raster)})}};(0,i.Cg)([(0,a.MZ)({json:{type:Number,write:!0}})],ns.prototype,"rows",void 0),(0,i.Cg)([(0,a.MZ)({json:{type:Number,write:!0,name:"columns"}})],ns.prototype,"cols",void 0),(0,i.Cg)([(0,a.MZ)({json:{name:"type",type:Number,write:!0}})],ns.prototype,"convolutionType",null),(0,i.Cg)([(0,a.MZ)({json:{type:[Number],write:!0}})],ns.prototype,"kernel",void 0),ns=ss=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ConvolutionFunctionArguments")],ns);const rs=ns;let os=class extends w{constructor(){super(...arguments),this.functionName="Convolution",this.rasterArgumentNames=["raster"]}get _normalizedKernel(){const{kernel:t,convolutionType:e}=this.functionArguments,s=t.reduce((t,e)=>t+e);return-1===e||0===s||1===s?t:t.map(t=>t/s)}_bindSourceRasters(){const{convolutionType:t,rows:e,cols:s,kernel:n}=this.functionArguments;if(!Object.values(A).includes(t))return{success:!1,supportsGPU:!1,error:`convolution-function: the specified kernel type is not supported ${t}`};if(t!==A.none&&e*s!==n.length)return{success:!1,supportsGPU:!1,error:"convolution-function: the specified rows and cols do not match the length of the kernel"};const r=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(r.pixelType);const o=r.clone();o.pixelType=this.outputPixelType;const i=[A.none,A.sharpen,A.sharpen2,A.sharpening3x3,A.sharpening5x5];return(-1===t||"u8"!==this.outputPixelType&&!i.includes(t))&&(o.statistics=null,o.histograms=null),o.colormap=null,o.attributeTable=null,this.rasterInfo=o,{success:!0,supportsGPU:n.length<=25}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e||this.functionArguments.convolutionType===A.none)return e;const{rows:s,cols:n}=this.functionArguments,{_normalizedKernel:r}=this;return function(t,e){const s=function(t){const e=Math.sqrt(t.length),s=t.slice(0,e),n=[1];for(let s=1;s<e;s++){let r=null;for(let n=0;n<e;n++){const o=t[n+s*e],i=t[n];if(null==r)if(0===i){if(o)return{separable:!1,row:null,col:null}}else r=o/i;else if(o/i!==r)return{separable:!1,row:null,col:null}}if(null==r)return{separable:!1,row:null,col:null};n.push(r)}return{separable:!0,row:s,col:n}}(e.kernel),n=!1!==e.mirrorEdges,r=s.separable?function(t,e,s,n=!0){const{pixels:r,width:o,height:i,pixelType:a,mask:u}=t,l=r.length,c=[],p=e.length,h=s.length,m=Math.floor(p/2),d=Math.floor(h/2);for(let t=0;t<l;t++){let a=ts(r[t],o,i,m,u,e,!0);a=ts(a,o,i,d,u,s,!1),n&&Qe(a,o,i,p,h),c.push(a)}return new g.A({width:o,height:i,pixelType:a,pixels:c,mask:u})}(t,s.row,s.col,n):function(t,e,s=!0){const{pixels:n,width:r,height:o,pixelType:i,mask:a}=t,u=n.length,l=[],{kernel:c,rows:p,cols:h}=e;for(let t=0;t<u;t++){const e=es(n[t],r,o,p,h,a,c);s&&Qe(e,r,o,p,h),l.push(e)}return new g.A({width:r,height:o,pixelType:i,pixels:l,mask:a})}(t,e,n),{outputPixelType:o}=e;return o&&r.clamp(o),r}(e,{kernel:r,rows:s,cols:n,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const t=new Float32Array(25),{rows:e,cols:s}=this.functionArguments,{_normalizedKernel:n}=this;for(let r=0;r<e;r++)for(let e=0;e<s;e++)t[5*r+e]=n[r*s+e];return{kernelRows:e,kernelCols:s,kernel:t,clampRange:(0,u.hP)(this.outputPixelType)}}_getNeighborhoodSize(){const{rows:t,cols:e}=this.functionArguments;return{rows:t,cols:e}}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],os.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:rs,json:{write:!0,name:"rasterFunctionArguments"}})],os.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],os.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)()],os.prototype,"_normalizedKernel",null),os=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ConvolutionFunction")],os);const is=os;var as;const us=new Dt.J({0:"standard",1:"planform",2:"profile"},{useNumericKeys:!0});let ls=as=class extends p{constructor(){super(...arguments),this.curvatureType="standard",this.zFactor=1}readCurvatureType(t,e){return us.fromJSON(e.type??e.curvatureType??0)}clone(){return new as({curvatureType:this.curvatureType,zFactor:this.zFactor,raster:this.raster})}};(0,i.Cg)([(0,a.MZ)({json:{write:{target:"type"}}}),(0,Qt.e)(us)],ls.prototype,"curvatureType",void 0),(0,i.Cg)([(0,ye.w)("curvatureType",["type","curvatureType"])],ls.prototype,"readCurvatureType",null),(0,i.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],ls.prototype,"zFactor",void 0),ls=as=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.CurvatureFunctionArguments")],ls);const cs=ls;let ps=class extends w{constructor(){super(...arguments),this.functionName="Curvature",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0].clone();return t.pixelType=this.outputPixelType,t.bandCount=1,this._removeStatsHistColormapVAT(t),this.rasterInfo=t,this.isGCS=t.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{zFactor:s,curvatureType:n}=this.functionArguments,{extent:r,primaryPixelSizes:o}=t,i=o?.[0],a=i??(r?{x:r.width/e.width,y:r.height/e.height}:{x:1,y:1}),u=this.isGCS&&s>=1?s*zt.rk:s;return(0,zt.E0)(e,{zFactor:u,curvatureType:n,resolution:a})}_getWebGLParameters(){const{zFactor:t,curvatureType:e}=this.functionArguments;return{curvatureType:e,zFactor:this.isGCS&&t>=1?t*zt.rk:t}}_getNeighborhoodSize(){return{rows:3,cols:3}}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],ps.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:cs,json:{write:!0,name:"rasterFunctionArguments"}})],ps.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],ps.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],ps.prototype,"isGCS",void 0),ps=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.CurvatureFunction")],ps);const hs=ps;var ms;let ds=ms=class extends p{constructor(){super(...arguments),this.bandIds=[],this.bandNames=[],this.bandWavelengths=[],this.missingBandAction=0}clone(){return new ms({bandIds:this.bandIds?.slice(),bandNames:this.bandNames?.slice(),bandWavelengths:this.bandWavelengths?.slice(),missingBandAction:this.missingBandAction,method:this.method,wavelengthMatchTolerance:this.wavelengthMatchTolerance})}};(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],ds.prototype,"bandIds",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],ds.prototype,"bandNames",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],ds.prototype,"bandWavelengths",void 0),(0,i.Cg)([(0,Qt.e)({0:"name",1:"wavelength",2:"id"})],ds.prototype,"method",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],ds.prototype,"missingBandAction",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],ds.prototype,"wavelengthMatchTolerance",void 0),ds=ms=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ExtractBandFunctionArguments")],ds);const gs=ds;let fs=class extends w{constructor(){super(...arguments),this.functionName="ExtractBand",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{functionArguments:t,sourceRasterInfos:e}=this,s=e[0],{method:n,bandNames:r,bandWavelengths:o,bandIds:i,missingBandAction:a}=t,u=r?.length&&("name"===n||"id"!==n&&!i?.length),l=o?.length&&("wavelength"===n||"id"!==n&&!i?.length),c=1===a,p=u?function(t,e){const s=t.bandInfos.map(({name:t})=>t.toLowerCase()),n=[];for(let t=0;t<e.length;t++){const r=e[t].toLowerCase();let o=s.indexOf(r);if(-1===o&&"nearinfrared"===r&&(o=s.findIndex(t=>t.startsWith("nearinfrared_1")),-1===o&&(o=s.findIndex(t=>t.startsWith("nearinfrared")))),-1===o)return null;n.push(o)}return n}(s,r):l?function(t,e,{wavelengthMatchTolerance:s},n){const{bandInfos:r}=t,o=[];for(let t=0;t<r.length;t++){const{minWavelength:e,maxWavelength:s}=r[t];if(!e||!s)return null;o.push({minWavelength:e,maxWavelength:s})}const i=[];for(let t=0;t<e.length;t++){const r=e[t];let a=!1,u=-1,l=Number.MAX_VALUE;for(let t=0;t<o.length;t++){const e=o[t],s=r>=e.minWavelength&&r<=e.maxWavelength,n=Math.abs(r-(e.minWavelength+e.maxWavelength)/2);s?n<l&&(a=!0,u=t,l=n):!a&&n<l&&(u=t,l=n)}if(!a&&s&&l<s&&(a=!0),!a&&n)return null;i.push(u)}return i}(s,o,this.functionArguments,c):function(t,e,s){const{bandCount:n}=t;return!e?.length||s&&e.some(t=>t<0||t>=n)?null:e}(s,i,c);if(null==p)return{success:!1,supportsGPU:!1,error:`extract-band-function: Invalid ${u?"band names":l?"band wavelengths":"band ids"} for the imagery data source`};this.functionArguments.bandIds=p,this.functionArguments.method="id",this.outputPixelType=this._getOutputPixelType(s.pixelType);const h=s.clone();h.pixelType=this.outputPixelType,h.bandCount=p.length;const{statistics:m,histograms:d}=h;null!=m&&m.length&&(h.statistics=p.map(t=>m[t]||m[m.length-1])),null!=d&&d.length&&(h.histograms=p.map(t=>d[t]||d[d.length-1])),h.multidimensionalInfo&&h.multidimensionalInfo.variables.forEach(t=>{const{statistics:e,histograms:s}=t;null!=e&&e.length&&(t.statistics=p.map(t=>e[t]||e[e.length-1])),null!=s&&s.length&&(t.histograms=p.map(t=>s[t]||s[s.length-1]))});let g=h.keyProperties?.BandProperties;return g?.length&&(g=p.map(t=>t>=g.length?g[g.length-1]:g[t]),h.keyProperties={...h.keyProperties,BandProperties:g}),this.rasterInfo=h,{success:!0,supportsGPU:h.bandCount<=3}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;let{bandIds:s}=this.functionArguments;if(this.rasterInfo.storageInfo.isBsqTile){const{rawInputBandIds:t}=this;s=s.map(e=>t.indexOf(e))}else{const t=e.pixels.length;s=s.map(e=>e>=t?t-1:e)}return e.extractBands(s)}_getWebGLParameters(){let t;if(this.isInputBandIdsSwizzled)t=this.swizzledBandSelection.length?this.swizzledBandSelection:[0,1,2];else{t=[...this.functionArguments.bandIds],0===t.length?t=[0,1,2]:t.length<3&&(t[1]=t[1]??t[0],t[2]=t[2]??t[1]);for(let e=0;e<3;e++)t[e]=Math.min(t[e],2)}return{bandIndexMat3:qt(t)}}_getInputBandIds(t){const e=t.length;return this.functionArguments.bandIds.map(t=>t>=e?e-1:t).map(e=>t[e])}_swizzleBandIds(t){const e=this.functionArguments.bandIds.map(e=>t.indexOf(e));return this.isInputBandIdsSwizzled=!0,e[1]??=e[0],e[2]??=e[1],this.swizzledBandSelection=e,!1}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],fs.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:gs,json:{write:!0,name:"rasterFunctionArguments"}})],fs.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],fs.prototype,"rasterArgumentNames",void 0),fs=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ExtractBandFunction")],fs);const ys=fs;function xs(t,e,s,n){const{pixels:r,width:o,height:i}=t,a=r.length,l=s.startsWith("f"),c=!l,[p,h]=(0,u.hP)(s),m=o*i,d=g.A.createEmptyBand(s,m);for(let t=0;t<i;t++){let s=t*o;for(let t=0;t<o;t++,s++)if(!n||n[s]){let t=0;for(let n=0;n<a;n++)t+=e[n]*r[n][s];l||(t=Math.round(t),c&&(t=t>h?h:t<p?p:t)),d[s]=t}}return d}var ws;let As=ws=class extends p{clone(){return new ws({conversionParameters:[...this.conversionParameters],raster:this.raster})}};(0,i.Cg)([(0,a.MZ)({type:[Number],json:{write:!0}})],As.prototype,"conversionParameters",void 0),As=ws=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.GrayscaleFunctionArguments")],As);const vs=As;let Cs=class extends w{constructor(){super(...arguments),this.functionName="Grayscale",this.functionArguments=null,this.rasterArgumentNames=["raster"]}get _normalizedWeights(){const{conversionParameters:t}=this.functionArguments,e=t.reduce((t,e)=>t+e);return t.map(t=>t/e)}_bindSourceRasters(){const{conversionParameters:t}=this.functionArguments;if(!t?.length)return{success:!1,supportsGPU:!1,error:"missing valid conversion parameters."};const e=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType;const s=3===t.length||3===e.bandCount&&t.length>3;return e.bandCount=1,this._removeStatsHistColormapVAT(e),this.rasterInfo=e,{success:!0,supportsGPU:s}}_processPixels(t){const e=t.pixelBlocks?.[0];return null==e?null:function(t,e,s){const{width:n,height:r,mask:o,bandMasks:i}=t,a=i?.length?g.A.combineBandMasks(i):o,u=xs(t,e,s,a),l=new g.A({width:n,height:r,pixels:[u],pixelType:s,mask:a});return l.updateStatistics(),l}(e,this._normalizedWeights,this.outputPixelType)}_getWebGLParameters(){return{weights:this._normalizedWeights}}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Cs.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:vs,json:{write:!0,name:"rasterFunctionArguments"}})],Cs.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],Cs.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)()],Cs.prototype,"_normalizedWeights",null),Cs=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.GrayscaleFunction")],Cs);const bs=Cs;var Ms;const Ts=new Dt.J({0:"traditional",1:"multi-directional"},{useNumericKeys:!0}),Ps=new Dt.J({1:"degree",2:"percent-rise",3:"scaled"},{useNumericKeys:!0});let Ns=Ms=class extends p{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 Ms({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,i.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],Ns.prototype,"altitude",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],Ns.prototype,"azimuth",void 0),(0,i.Cg)([(0,a.MZ)(),(0,Qt.e)(Ts)],Ns.prototype,"hillshadeType",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{write:!0,name:"psPower"}})],Ns.prototype,"pixelSizePower",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{write:!0,name:"psZFactor"}})],Ns.prototype,"pixelSizeFactor",void 0),(0,i.Cg)([(0,a.MZ)(),(0,Qt.e)(Ps)],Ns.prototype,"slopeType",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],Ns.prototype,"zFactor",void 0),(0,i.Cg)([(0,a.MZ)({type:Boolean,json:{write:!0}})],Ns.prototype,"removeEdgeEffect",void 0),Ns=Ms=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.HillshadeFunctionArguments")],Ns);const Is=Ns;let Rs=class extends w{constructor(){super(...arguments),this.functionName="Hillshade",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"hillshade-function: source data must be single band"};this.outputPixelType=this._getOutputPixelType("u8");const e=t.clone();return this._removeStatsHistColormapVAT(e),e.pixelType=this.outputPixelType,e.bandCount=1,e.statistics=[{min:0,max:255,avg:60,stddev:10}],this.rasterInfo=e,this.isGCS=e.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(!e)return null;const{extent:s,primaryPixelSizes:n}=t,r=n?.[0],o=r??(s?{x:s.width/e.width,y:s.height/e.height}:{x:1,y:1}),i=(0,zt.PP)(this.functionArguments,o,this.isGCS),a=(0,zt.fw)(e,i);return a.pixelType=this.outputPixelType,a}_getWebGLParameters(){const t=(0,zt.PP)(this.functionArguments,{x:1,y:1},this.isGCS),e=(0,zt.ng)(t),{slopeType:s,zFactor:n,pixelSizeFactor:r,pixelSizePower:o}=this.functionArguments,i="scaled"===s,a=(0,u.zw)(this.outputPixelType);return{...e,zFactor:n,gcsFactor:this.isGCS?zt.rk:1,pixelSizeFactor:i?r:0,pixelSizePower:i?o:0,isOutputRounded:a}}_getNeighborhoodSize(){return{rows:3,cols:3}}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Rs.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:Is,json:{write:!0,name:"rasterFunctionArguments"}})],Rs.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],Rs.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Rs.prototype,"isGCS",void 0),Rs=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.HillshadeFunction")],Rs);const Fs=Rs;var ks;let _s=ks=class extends p{constructor(){super(...arguments),this.rasters=[],this.processAsMultiband=!0}writeRasters(t,e){e.rasters=t.map(t=>"number"==typeof t||"string"==typeof t?t:t.toJSON())}clone(){return new ks({operation:this.operation,processAsMultiband:this.processAsMultiband,rasters:(0,o.o8)(this.rasters)})}};(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],_s.prototype,"operation",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],_s.prototype,"rasters",void 0),(0,i.Cg)([(0,Se.K)("rasters")],_s.prototype,"writeRasters",null),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],_s.prototype,"processAsMultiband",void 0),_s=ks=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.LocalFunctionArguments")],_s);const Ss=_s;let Bs=class extends w{constructor(){super(...arguments),this.functionName="Local",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0],{bandCount:s}=e,{processAsMultiband:n}=this.functionArguments;if(t.some(t=>t.bandCount!==s))return{success:!1,supportsGPU:!1,error:"local-function: input rasters do not have same band count"};const{operation:r,rasters:o}=this.functionArguments,i=N[r];if(!(999===i||o.length===i||o.length<=1&&1===i))return{success:!1,supportsGPU:!1,error:`local-function: the length of functionArguments.rasters does not match operation's requirement: ${i}`};const a=e.clone();return a.bandCount=999!==i||n?s:1,this._removeStatsHistColormapVAT(a),this._updateStatistics(a),this._updatePixelType(a),this.rasterInfo=a,{success:!0,supportsGPU:1===a.bandCount&&i<=3}}_processPixels(t){const{pixelBlocks:e}=t;return null==e||e.some(t=>null==t)?null:kt(e,this.functionArguments.operation,{processAsMultiband:this.functionArguments.processAsMultiband,outputPixelType:this.outputPixelType??void 0})}_getWebGLParameters(){const{operation:t}=this.functionArguments,e=N[t],s=Object.keys(M).find(e=>M[e]===t)?.toLowerCase()??"undefined",n=this.outputPixelType??"f32";let[r,o]=(0,u.hP)(n);const i=(0,u.zw)(n);return i&&(r-=1e-4,o+=1e-4),{imageCount:e,operationName:s,domainRange:[r,o],isOutputRounded:i}}_updateStatistics(t){const e=this.sourceRasterInfos[0],{operation:s}=this.functionArguments,n=P(s)?.domain;if(n){t.statistics=[];for(let e=0;e<t.bandCount;e++)t.statistics[e]={min:n[0],max:n[1],avg:(n[0]+n[1])/2,stddev:(n[0]+n[1])/10}}else 45===s&&e.statistics?.length&&(t.statistics=e.statistics.map(t=>({min:-t.max,max:-t.min,avg:null!=t.avg?-t.avg:void 0,stddev:null!=t.stddev?-t.stddev:void 0})))}_updatePixelType(t){const{statistics:e,pixelType:s}=this.sourceRasterInfos[0],{operation:n}=this.functionArguments,{domain:r,isInteger:o}=P(n)??{domain:null,isInteger:!1};let i="f32";if(r&&o)i=(0,u.X1)(r[0],r[1]);else if(30===n){const t=e?.[0];i=t?(0,u.X1)(t.min,t.max):(0,u.zw)(s)?s:"s32"}else if(45===n&&(0,u.zw)(s)){const t=e?.map(({max:t})=>-t),n=e?.map(({min:t})=>-t),r=t?.length?Math.min(...t):null,o=n?.length?Math.min(...n):null;i=null!=r&&null!=o?(0,u.X1)(r,o):s.startsWith("s")?s.replace("s","u"):"u1"===s||"u2"===s||"u4"===s?"s8":"u8"===s?"s16":"s32"}t.pixelType=this.outputPixelType=this._getOutputPixelType(i)}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Bs.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:Ss,json:{write:!0,name:"rasterFunctionArguments"}})],Bs.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],Bs.prototype,"rasterArgumentNames",void 0),Bs=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.LocalFunction")],Bs);const js=Bs;var Zs,zs=s(34727);let Gs=Zs=class extends p{constructor(){super(...arguments),this.includedRanges=null,this.noDataValues=null,this.noDataInterpretation=0}get normalizedNoDataValues(){const{noDataValues:t}=this;if(!t?.length)return null;let e=!1;const s=t.map(t=>{if("number"==typeof t)return e=!0,[t];if("string"==typeof t){const s=t.trim().split(" ").filter(t=>""!==t.trim()).map(t=>Number(t));return e=e||s.length>0,0===s.length?null:s}return null});return e?s:null}clone(){return new Zs({includedRanges:this.includedRanges?.slice()??[],noDataValues:this.noDataValues?.slice()??[],noDataInterpretation:this.noDataInterpretation})}};(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Gs.prototype,"includedRanges",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Gs.prototype,"noDataValues",void 0),(0,i.Cg)([(0,a.MZ)()],Gs.prototype,"normalizedNoDataValues",null),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Gs.prototype,"noDataInterpretation",void 0),Gs=Zs=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.MaskFunctionArguments")],Gs);const Os=Gs;let Ds=class extends w{constructor(){super(...arguments),this.functionName="Mask",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,this.rasterInfo=t;const{includedRanges:s,normalizedNoDataValues:n}=this.functionArguments;if(!s?.length&&!n?.length)return{success:!1,supportsGPU:!1,error:"missing includedRanges or noDataValues argument"};let r=[];for(let o=0;o<t.bandCount;o++){const t=(0,Kt.Wt)(e,s?.slice(2*o,2*o+2),n?.[o]);if(null==t){r=null;break}r.push(t)}this.lookups=r;const o=null!=n&&n.every(t=>t?.length===n[0]?.length);return{success:!0,supportsGPU:(!s||s.length<=2*Kt.et)&&(!n||o&&n[0].length<=Kt.et)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{outputPixelType:s,lookups:n}=this,{includedRanges:r,noDataInterpretation:o,normalizedNoDataValues:i}=this.functionArguments;return(0,Kt.dK)(e,{includedRanges:r,noDataValues:i,outputPixelType:s,matchAll:1===o,lookups:n})}_getWebGLParameters(){const{includedRanges:t,normalizedNoDataValues:e}=this.functionArguments,s=new Float32Array(Kt.et);s.fill(zs.pq),e?.[0]?.length&&s.set(e[0]);const n=new Float32Array(6);for(let e=0;e<n.length;e+=2)n[e]=t?.[e]??-zs.pq,n[e+1]=t?.[e+1]??zs.pq;return t?.length&&n.set(t),{bandCount:this.sourceRasterInfos[0].bandCount,noDataValues:s,includedRanges:n}}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Ds.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:Os,json:{write:!0,name:"rasterFunctionArguments"}})],Ds.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],Ds.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Ds.prototype,"lookups",void 0),Ds=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.MaskFunction")],Ds);const Es=Ds;var Vs;let Us=Vs=class extends p{constructor(){super(...arguments),this.visibleBandID=0,this.infraredBandID=1,this.scientificOutput=!1}clone(){const{visibleBandID:t,infraredBandID:e,scientificOutput:s}=this;return new Vs({visibleBandID:t,infraredBandID:e,scientificOutput:s})}};(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Us.prototype,"visibleBandID",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Us.prototype,"infraredBandID",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Us.prototype,"scientificOutput",void 0),Us=Vs=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.NDVIFunctionArguments")],Us);const Ls=Us;let $s=class extends w{constructor(){super(...arguments),this.functionName="NDVI",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{scientificOutput:t,visibleBandID:e,infraredBandID:s}=this.functionArguments;this.outputPixelType=this._getOutputPixelType(t?"f32":"u8");const n=this.sourceRasterInfos[0],r=Math.max(e,s);if(n.bandCount<2||r>=n.bandCount)return{success:!1,supportsGPU:!1,error:"ndvi-function: source raster has insufficient amount of raster bands"};if(e<0||s<0)return{success:!1,supportsGPU:!1,error:"ndvi-function: invalid visible or infrared band id"};const o=n.clone();o.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(o),o.bandCount=1,o.keyProperties={...o.keyProperties,BandProperties:void 0};const[i,a,u,l]=t?[-1,1,0,.1]:[0,200,100,10];return o.statistics=[{min:i,max:a,avg:u,stddev:l}],this.rasterInfo=o,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;let{visibleBandID:s,infraredBandID:n,scientificOutput:r}=this.functionArguments;if(this.rasterInfo.storageInfo.isBsqTile){const{rawInputBandIds:t}=this;n=t.indexOf(n),s=t.indexOf(s)}return function(t,e,s,n){const{mask:r,pixels:o,width:i,height:a}=t,u=o[s],l=o[e],c=l.length,p=n?new Uint8Array(c):new Float32Array(c),h=n?100:1,m=n?100.5:0;for(let t=0;t<c;t++)if(null==r||r[t]){const e=u[t],s=l[t],n=e+s;n&&(p[t]=(e-s)/n*h+m)}const d=new g.A({width:i,height:a,mask:r,pixelType:n?"u8":"f32",pixels:[p]});return d.updateStatistics(),d}(e,s,n,!r)}_getWebGLParameters(){const{visibleBandID:t,infraredBandID:e,scientificOutput:s}=this.functionArguments;return{bandIndexMat3:qt(this.isInputBandIdsSwizzled?[0,1,2]:[e,t,0]),scaled:!s}}_getInputBandIds(t){const{visibleBandID:e,infraredBandID:s}=this.functionArguments;return[s,e,0].map(e=>t[e])}_swizzleBandIds(t){const{visibleBandID:e,infraredBandID:s}=this.functionArguments,n=[e,s].map(e=>t.indexOf(e));return n[2]=n[1],this.isInputBandIdsSwizzled=!0,this.swizzledBandSelection=n,!1}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],$s.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:Ls,json:{write:!0,name:"rasterFunctionArguments"}})],$s.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],$s.prototype,"rasterArgumentNames",void 0),$s=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.NDVIFunction")],$s);const Ks=$s;var Ws;let Hs=Ws=class extends p{constructor(){super(...arguments),this.inputRanges=null,this.outputValues=null,this.noDataRanges=null,this.allowUnmatched=!1,this.isLastInputRangeInclusive=!1}clone(){return new Ws({inputRanges:[...this.inputRanges],outputValues:[...this.outputValues],noDataRanges:[...this.noDataRanges],allowUnmatched:this.allowUnmatched,isLastInputRangeInclusive:this.isLastInputRangeInclusive})}};(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Hs.prototype,"inputRanges",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Hs.prototype,"outputValues",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Hs.prototype,"noDataRanges",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Hs.prototype,"allowUnmatched",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Hs.prototype,"replacementValue",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Hs.prototype,"isLastInputRangeInclusive",void 0),Hs=Ws=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.RemapFunctionArguments")],Hs);const qs=Hs;let Js=class extends w{constructor(){super(...arguments),this.functionName="Remap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;t.bandCount=1;const{statistics:s}=t;this._removeStatsHistColormapVAT(t);const{allowUnmatched:n,replacementValue:r,outputValues:o,inputRanges:i,noDataRanges:a,isLastInputRangeInclusive:l}=this.functionArguments,c="unknown"===this.outputPixelType||null==this.outputPixelType;if(this.outputPixelType=this._getOutputPixelType(e),o?.length){const i=s?.[0];if(n&&null==r){let e=i?.min??o[0],s=i?.max??o[0];e=Math.min.apply(null,[...o,e]),s=Math.max.apply(null,[...o,s]),t.statistics=[{min:e,max:s,avg:i?.avg??0,stddev:i?.stddev??-1}]}else{let e=o[0],s=e;for(let t=0;t<o.length;t++)e=e>o[t]?o[t]:e,s=s>o[t]?s:o[t];n&&null!=r&&(e=Math.min(e,r),s=Math.max(s,r)),t.statistics=[{min:e,max:s,avg:i?.avg??0,stddev:i?.stddev??-1}]}if(c){const{min:s,max:i}=t.statistics[0],a=["u8","s8","u16","s16","u32","s32","f32"],l=a.find(t=>{const[e,n]=(0,u.hP)(t);return s>=e&&i<=n})??"f64";o.some(t=>Math.floor(t)!==t)?this.outputPixelType="f64"===l?"f64":"f32":this.outputPixelType=n&&null==r&&a.indexOf(e)>a.indexOf(l)?e:l}}return t.pixelType=this.outputPixelType,this.rasterInfo=t,this.lookup=n?null:(0,Kt.XU)({srcPixelType:e,inputRanges:i,outputValues:o,noDataRanges:a,allowUnmatched:n,isLastInputRangeInclusive:l,outputPixelType:this.outputPixelType}),{success:!0,supportsGPU:(!o||o.length<=Kt.et)&&(!a||a.length<=Kt.et)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{lookup:s,outputPixelType:n}=this;if(s){const t=(0,Kt.eH)(e,{lut:[s.lut],offset:s.offset,outputPixelType:n});return null!=t&&s.mask&&(t.mask=(0,Kt.UK)(e.pixels[0],e.mask,s.mask,s.offset,"u8")),t}const{inputRanges:r,outputValues:o,noDataRanges:i,allowUnmatched:a,isLastInputRangeInclusive:u,replacementValue:l}=this.functionArguments;return(0,Kt.Ew)(e,{inputRanges:r,outputValues:o,noDataRanges:i,outputPixelType:n,allowUnmatched:a,isLastInputRangeInclusive:u,replacementValue:l})}_getWebGLParameters(){const{allowUnmatched:t,noDataRanges:e,isLastInputRangeInclusive:s}=this.functionArguments,n=this.functionArguments.inputRanges??[],r=this.functionArguments.outputValues??[],o=(0,Kt.bL)(n,r,s),i=new Float32Array(2*Kt.et);return i.fill(zs.pq),e?.length&&i.set(e),{allowUnmatched:t,rangeMaps:o,noDataRanges:i,clampRange:(0,u.hP)(this.outputPixelType),replacementValue:this.functionArguments.replacementValue}}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Js.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:qs,json:{write:!0,name:"rasterFunctionArguments"}})],Js.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],Js.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Js.prototype,"lookup",void 0),Js=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.RemapFunction")],Js);const Xs=Js;var Qs;let Ys=Qs=class extends Is{readColorRamp(t){if("string"==typeof t){const e=ge.kH.jsonValues.find(e=>e.toLowerCase()===t.toLowerCase());return e?(0,ge.M5)(ge.kH.fromJSON(e)):null}return"toJSON"in t?t.toJSON():t}clone(){return new Qs({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,i.Cg)([(0,a.MZ)({json:{write:!0}})],Ys.prototype,"colorRamp",void 0),(0,i.Cg)([(0,ye.w)("colorRamp")],Ys.prototype,"readColorRamp",null),(0,i.Cg)([(0,a.MZ)({type:[[Number]],json:{write:!0}})],Ys.prototype,"colormap",void 0),Ys=Qs=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ShadedReliefFunctionArguments")],Ys);const tn=Ys;let en=class extends w{constructor(){super(...arguments),this.functionName="ShadedRelief",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: source data must be single band"};let{colorRamp:e,colormap:s}=this.functionArguments;if(!e&&!s?.length)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: a color ramp argument must be specified"};this.outputPixelType=this._getOutputPixelType("u8");const n=t.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,s?.length||(s=(0,ge.R8)(e,{interpolateAlpha:!0}));const{indexedColormap:r,offset:o}=(0,Kt.zg)({colormap:s});if(!r?.length)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: a valid colorramp is required"};const i=(0,ge.S2)(r);return this.lookup={indexedColormap:r,offset:o,hsvMap:i},{success:!0,supportsGPU:(0,Re.WN)(r)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(!e||!this.lookup)return null;let s=t.primaryPixelSizes?.[0];if(null==s){const{extent:n}=t;s=n?{x:n.width/e.width,y:n.height/e.height}:{x:1,y:1}}const n=(0,zt.PP)(this.functionArguments,s,this.isGCS),r=(0,zt.fw)(e,n),o=this.sourceRasterInfos[0].statistics?.[0]??{min:0,max:8e3};return(0,zt.SC)(r,e,this.lookup.hsvMap,o),r.pixelType=this.outputPixelType,r}_getWebGLParameters(){const t=(0,zt.PP)(this.functionArguments,{x:1,y:1},this.isGCS),e=(0,zt.ng)(t),{slopeType:s,zFactor:n,pixelSizeFactor:r,pixelSizePower:o}=this.functionArguments,i="scaled"===s,{indexedColormap:a,offset:l}=this.lookup,c=this.sourceRasterInfos[0].statistics?.[0],p=(0,u.zw)(this.outputPixelType);return{...e,indexedColormap:a,offset:l,zFactor:n,gcsFactor:this.isGCS?zt.rk:1,pixelSizeFactor:i?r:0,pixelSizePower:i?o:0,minValue:c?.min??0,maxValue:c?.max??8e3,isOutputRounded:p}}_getNeighborhoodSize(){return{rows:3,cols:3}}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],en.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:tn,json:{write:!0,name:"rasterFunctionArguments"}})],en.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],en.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],en.prototype,"isGCS",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],en.prototype,"lookup",void 0),en=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ShadedReliefFunction")],en);const sn=en;var nn;const rn=new Dt.J({1:"degree",2:"percent-rise",3:"adjusted"},{useNumericKeys:!0});let on=nn=class extends p{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,i.Cg)([(0,Qt.e)(rn)],on.prototype,"slopeType",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],on.prototype,"zFactor",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{name:"psPower",write:!0}})],on.prototype,"pixelSizePower",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{name:"psZFactor",write:!0}})],on.prototype,"pixelSizeFactor",void 0),(0,i.Cg)([(0,a.MZ)({type:Boolean,json:{write:!0}})],on.prototype,"removeEdgeEffect",void 0),on=nn=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.SlopeFunctionArguments")],on);const an=on;let un=class extends w{constructor(){super(...arguments),this.functionName="Slope",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0].clone();return t.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(t),t.statistics="percent-rise"!==this.functionArguments.slopeType?[{min:0,max:90,avg:1,stddev:1}]:null,t.bandCount=1,this.rasterInfo=t,this.isGCS=t.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{zFactor:s,slopeType:n,pixelSizePower:r,pixelSizeFactor:o}=this.functionArguments,{isGCS:i}=this,{extent:a,primaryPixelSizes:u}=t,l=u?.[0],c=l??(a?{x:a.width/e.width,y:a.height/e.height}:{x:1,y:1});return(0,zt.yy)(e,{zFactor:s,slopeType:n,pixelSizePower:r,pixelSizeFactor:o,isGCS:i,resolution:c})}_getWebGLParameters(){const{zFactor:t,slopeType:e,pixelSizeFactor:s,pixelSizePower:n}=this.functionArguments;return{zFactor:this.isGCS&&t>=1?t*zt.rk:t,slopeType:e,pixelSizeFactor:s??0,pixelSizePower:n??0,isOutputRounded:(0,u.zw)(this.outputPixelType)}}_getNeighborhoodSize(){return{rows:3,cols:3}}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],un.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:an,json:{write:!0,name:"rasterFunctionArguments"}})],un.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],un.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],un.prototype,"isGCS",void 0),un=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.SlopeFunction")],un);const ln=un;var cn;let pn=cn=class extends p{clone(){return new cn({conversionMatrix:[...this.conversionMatrix],raster:this.raster})}};(0,i.Cg)([(0,a.MZ)({type:[Number],json:{write:!0}})],pn.prototype,"conversionMatrix",void 0),pn=cn=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.SpectralConversionFunctionArguments")],pn);const hn=pn;let mn=class extends w{constructor(){super(...arguments),this.functionName="SpectralConversion",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const 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:3===t.bandCount&&9===this.functionArguments.conversionMatrix.length}}_processPixels(t){const e=t.pixelBlocks?.[0];return null==e?null:function(t,e,s){const{width:n,height:r,mask:o,bandMasks:i}=t,a=i?.length?g.A.combineBandMasks(i):o,u=[],l=t.pixels.length;for(let n=0;n<e.length/l;n++){const r=xs(t,e.slice(n*l,(n+1)*l),s,a);u.push(r)}const c=new g.A({width:n,height:r,pixels:u,pixelType:s,mask:a});return c.updateStatistics(),c}(e,this.functionArguments.conversionMatrix,this.outputPixelType)}_getWebGLParameters(){const t=(0,u.hP)(this.outputPixelType),[e,s,n,r,o,i,a,l,c]=this.functionArguments.conversionMatrix;return{weights:[e,r,a,s,o,l,n,i,c],clampRange:t}}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],mn.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:hn,json:{write:!0,name:"rasterFunctionArguments"}})],mn.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],mn.prototype,"rasterArgumentNames",void 0),mn=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.SpectralConversionFunction")],mn);const dn=mn,gn=new Dt.J({1:"min",2:"max",3:"mean",4:"stddev",5:"median",6:"majority",7:"minority"},{useNumericKeys:!0});function fn(t,e){const{fillNoDataOnly:s}=e,{band:n,width:r,height:o,mask:i,outBand:a}=t;if(s&&!i)return void a.set(n);const{statisticsType:u,kernelRows:l,kernelCols:c}=e,p="stddev"===u,h=r*o,m=new Float64Array(h),d=new Float64Array(h),g=new Uint32Array(h);for(let t=0;t<o;t++){const e=t*r;let s=0,o=0,a=0;for(let t=0;t<c;t++)i&&!i[e+t]||(s+=n[e+t],p&&(o+=n[e+t]**2),a++);m[e]=s,d[e]=o,g[e]=a;for(let t=1;t<=r-c;t++){const r=e+t-1,u=r+c;i?(i[r]&&(a--,s-=n[r],p&&(o-=n[r]**2)),i[u]&&(a++,s+=n[u],p&&(o+=n[u]**2))):(s-=n[r],s+=n[u],p&&(o-=n[r]**2,o+=n[u]**2)),m[e+t]=s,g[e+t]=a,p&&(d[e+t]=o)}}const f=new Float64Array(h),y=new Float64Array(h),x=new Uint32Array(h),w=l*r;for(let t=0;t<=r-c;t++){let e=0,s=0,n=0;for(let o=0;o<l;o++){const i=o*r+t;e+=m[i],n+=g[i],p&&(s+=d[i])}f[t]=e,y[t]=s,x[t]=n;for(let i=1;i<=o-l;i++){const o=(i-1)*r+t,a=o+w;e-=m[o],e+=m[a],n-=g[o],n+=g[a],p&&(s-=d[o],s+=d[a]),f[i*r+t]=e,y[i*r+t]=s,x[i*r+t]=n}}const A=Math.floor(l/2),v=Math.floor(c/2);for(let t=A;t<o-A;t++){const e=t*r;for(let n=v;n<r-v;n++){const o=(t-A)*r+n-v,u=x[o];if(0===u||s&&(!i||i[e+n]))continue;const l=f[o]/u,c=p?Math.sqrt((y[o]-f[o]*l)/u):l;a[e+n]=c,i&&(i[e+n]=255)}}}function yn(t,e){const{fillNoDataOnly:s}=e,{band:n,width:r,height:o,mask:i,outBand:a}=t;if(s&&!i)return void a.set(n);const{kernelRows:u,kernelCols:l,statisticsType:c}=e,p=Math.floor(u/2),h=Math.floor(l/2),m="min"===c,d=a.slice(),g=new Uint32Array(r*o);for(let t=p;t<o-p;t++){const e=t*r;for(let t=h;t<r-h;t++){let s=m?Number.MAX_VALUE:-Number.MAX_VALUE,o=0;for(let a=0;a<u;a++)for(let u=0;u<l;u++){const l=e+t+(a-p)*r+u-h;i&&!i[l]||(s=m?Math.min(s,n[l]):Math.max(s,n[l]),o++)}i?(d[e+t]=0===o?0:s,g[e+t]=o):a[e+t]=0===o?0:s}}if(i)for(let t=p;t<o-p;t++){const e=t*r;for(let t=h;t<r-h;t++)if(g[e+t]){if(s&&i[e+t])continue;a[e+t]=d[e+t],i[e+t]=255}}}function xn(t,e){const{fillNoDataOnly:s}=e,{band:n,width:r,height:o,mask:i,outBand:a}=t;if(s&&!i)return void a.set(n);const{kernelRows:u,kernelCols:l}=e,c=Math.floor(u/2),p=Math.floor(l/2),h=a.slice(),m=new Uint32Array(r*o);for(let t=c;t<o-c;t++){const e=t*r;for(let t=p;t<r-p;t++){if(s&&i?.[e+t])continue;const o=[];for(let s=0;s<u;s++)for(let a=0;a<l;a++){const u=e+t+(s-c)*r+a-p;i&&!i[u]||o.push(n[u])}o.length&&(o.sort((t,e)=>t-e),i?(h[e+t]=o[Math.floor((o.length-1)/2)],m[e+t]=o.length):a[e+t]=o[Math.floor((o.length-1)/2)])}}if(i)for(let t=c;t<o-c;t++){const e=t*r;for(let t=p;t<r-p;t++)if(m[e+t]){if(s&&i[e+t])continue;a[e+t]=h[e+t],i[e+t]=255}}}function wn(t,e){const{fillNoDataOnly:s}=e,{band:n,width:r,height:o,mask:i,outBand:a}=t;if(s&&!i)return void a.set(n);const{kernelRows:u,kernelCols:l}=e,c=Math.floor(u/2),p=Math.floor(l/2),h="majority"===e.statisticsType,m=u*l,d=a.slice(),g=new Uint32Array(r*o);for(let t=c;t<o-c;t++){const e=t*r;for(let t=p;t<r-p;t++){if(s&&i?.[e+t])continue;const o=new Map;for(let s=0;s<u;s++)for(let a=0;a<l;a++){const u=e+t+(s-c)*r+a-p;if(i&&!i[u])continue;const l=n[u];o.set(l,o.has(l)?o.get(l)+1:1)}if(0===o.size)continue;let f=0,y=0,x=h?0:m+1;for(const t of o.keys())y=o.get(t),h===y>x&&(x=y,f=t);i?(d[e+t]=f,g[e+t]=o.size):a[e+t]=f}}if(i)for(let t=c;t<o-c;t++){const e=t*r;for(let t=p;t<r-p;t++)if(g[e+t]){if(s&&i[e+t])continue;a[e+t]=d[e+t],i[e+t]=255}}}var An;let vn=An=class extends p{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,o.o8)(this.raster)})}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,read:{source:["kernelRows","rows"],reader:(t,e)=>Number(t??e?.kernelRows??3)}}})],vn.prototype,"rows",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0,read:{source:["kernelCols","cols"],reader:(t,e)=>Number(t??e?.kernelCols??3)}}})],vn.prototype,"cols",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],vn.prototype,"fillNoDataOnly",void 0),(0,i.Cg)([(0,a.MZ)({json:{read:{source:["statisticsType","type"],reader:(t,e)=>gn.fromJSON(e?.statisticsType??e?.type)??"min"},write:{target:"type"}}}),(0,Qt.e)(gn)],vn.prototype,"statisticsType",void 0),vn=An=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.StatisticsFunctionArguments")],vn);const Cn=vn;let bn=class extends w{constructor(){super(...arguments),this.functionName="Statistics",this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{type:t}=this.functionArguments.toJSON();if(t<1||t>7)return{success:!1,supportsGPU:!1,error:`statistics-function: the given statistics type is not supported ${t}`};const e=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(e.pixelType);const s=e.clone();s.pixelType=this.outputPixelType;const{statisticsType:n}=this.functionArguments;return"stddev"===n&&this._removeStatsHistColormapVAT(s),this.rasterInfo=s,{success:!0,supportsGPU:s.bandCount<=3&&t<5}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return e;const{statisticsType:s,rows:n,cols:r,fillNoDataOnly:o}=this.functionArguments;return function(t,e){const{mask:s}=t,{fillNoDataOnly:n}=e;if(n&&!s)return t;const{pixels:r,width:o,height:i,bandMasks:a,pixelType:u}=t,l=r.length,c=o*i,p=[],{kernelRows:h,kernelCols:m,statisticsType:d,mirrorEdges:f}=e;if(n&&!s)return t;const y=e.outputPixelType??u,x=[];for(let t=0;t<l;t++){const u=r[t],l=g.A.createEmptyBand(y,c);n&&l.set(u);const w=a?.[t]??s,A=w?.slice()??null,v={band:u,width:o,height:i,mask:A,outBand:l};switch(d){case"min":case"max":yn(v,e);break;case"mean":case"stddev":fn(v,e);break;case"median":xn(v,e);break;case"majority":case"minority":wn(v,e)}f&&!n&&Qe(l,o,i,h,m),p.push(l),A&&x.push(A)}let w=x[0]??s;x.length!==l&&(x.length=0),l>1&&a?.length&&(w=g.A.combineBandMasks(a));const A=new g.A({pixelType:y,width:o,height:i,pixels:p,bandMasks:a&&x.length?x:null,mask:w});return A.updateStatistics(),A}(e,{kernelRows:n,kernelCols:r,fillNoDataOnly:o,outputPixelType:this.outputPixelType,statisticsType:s,mirrorEdges:!0})}_getWebGLParameters(){const{rows:t,cols:e,statisticsType:s,fillNoDataOnly:n}=this.functionArguments;return{fillNoDataOnly:n,kernelRows:t,kernelCols:e,statisticsType:s,clampRange:(0,u.hP)(this.outputPixelType)}}_getNeighborhoodSize(){const{rows:t,cols:e}=this.functionArguments;return{rows:t,cols:e}}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],bn.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:Cn,json:{write:!0,name:"rasterFunctionArguments"}})],bn.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],bn.prototype,"rasterArgumentNames",void 0),bn=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.StatisticsFunction")],bn);const Mn=bn;var Tn;let Pn=Tn=class extends p{constructor(){super(...arguments),this.statistics=null,this.histograms=null}readStatistics(t,e){if(!t?.length)return null;const s=[];return t.forEach(t=>{const e={min:t.min,max:t.max,avg:t.avg??t.mean,stddev:t.stddev??t.standardDeviation};s.push(e)}),s}writeStatistics(t,e,s){if(!t?.length)return;const n=[];t.forEach(t=>{const e={...t,mean:t.avg,standardDeviation:t.stddev};delete e.avg,delete e.stddev,n.push(e)}),e[s]=n}clone(){return new Tn({statistics:(0,o.o8)(this.statistics),histograms:(0,o.o8)(this.histograms)})}};(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Pn.prototype,"statistics",void 0),(0,i.Cg)([(0,ye.w)("statistics")],Pn.prototype,"readStatistics",null),(0,i.Cg)([(0,Se.K)("statistics")],Pn.prototype,"writeStatistics",null),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Pn.prototype,"histograms",void 0),Pn=Tn=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.StatisticsHistogramFunctionArguments")],Pn);const Nn=Pn;let In=class extends w{constructor(){super(...arguments),this.functionName="StatisticsHistogram",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType("u8");const e=t.clone(),{statistics:s,histograms:n}=this.functionArguments;return n&&(e.histograms=n),s&&(e.statistics=s),this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],In.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:Nn,json:{write:!0,name:"rasterFunctionArguments"}})],In.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],In.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],In.prototype,"indexedColormap",void 0),(0,i.Cg)([(0,a.MZ)()],In.prototype,"isNoopProcess",void 0),In=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.StatisticsHistogramFunction")],In);const Rn=In;var Fn;const kn=new Dt.J({0:"none",3:"standard-deviation",4:"histogram-equalization",5:"min-max",6:"percent-clip",9:"sigmoid"},{useNumericKeys:!0});let _n=Fn=class extends p{constructor(){super(...arguments),this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.histograms=null,this.statistics=null,this.stretchType="none",this.useGamma=!1}writeStatistics(t,e,s){t?.length&&(Array.isArray(t[0])||(t=t.map(t=>[t.min,t.max,t.avg,t.stddev])),e[s]=t)}clone(){return new Fn({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:(0,o.o8)(this.statistics),gamma:(0,o.o8)(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,histograms:(0,o.o8)(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment,raster:this.raster})}};(0,i.Cg)([(0,a.MZ)({type:Boolean,json:{write:!0}})],_n.prototype,"computeGamma",void 0),(0,i.Cg)([(0,a.MZ)({type:Boolean,json:{name:"dra",write:!0}})],_n.prototype,"dynamicRangeAdjustment",void 0),(0,i.Cg)([(0,a.MZ)({type:[Number],json:{write:!0}})],_n.prototype,"gamma",void 0),(0,i.Cg)([(0,a.MZ)()],_n.prototype,"histograms",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],_n.prototype,"maxPercent",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],_n.prototype,"minPercent",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],_n.prototype,"numberOfStandardDeviations",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{name:"max",write:!0}})],_n.prototype,"outputMax",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{name:"min",write:!0}})],_n.prototype,"outputMin",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],_n.prototype,"sigmoidStrengthLevel",void 0),(0,i.Cg)([(0,a.MZ)({json:{type:[[Number]],write:!0}})],_n.prototype,"statistics",void 0),(0,i.Cg)([(0,Se.K)("statistics")],_n.prototype,"writeStatistics",null),(0,i.Cg)([(0,Qt.e)(kn)],_n.prototype,"stretchType",void 0),(0,i.Cg)([(0,a.MZ)({type:Boolean,json:{write:!0}})],_n.prototype,"useGamma",void 0),_n=Fn=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.StretchFunctionArguments")],_n);const Sn=_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;const t=this.sourceRasterInfos[0],{pixelType:e}=t,{functionArguments:s}=this,{dynamicRangeAdjustment:n,gamma:r,useGamma:o}=s;if(!n&&["u8","u16","s8","s16"].includes(e)){const n=(0,qe.DP)(s.toJSON(),{rasterInfo:t}),i=(0,u.zw)(this.outputPixelType)?"round":"float";this.lookup=(0,qe.RP)({pixelType:e,...n,gamma:o?r:null,rounding:i}),this.cutOffs=n}else n||(this.cutOffs=(0,qe.DP)(s.toJSON(),{rasterInfo:t}));this.outputPixelType=this._getOutputPixelType(e);const i=t.clone();i.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(i),"u8"===this.outputPixelType&&(i.keyProperties.DataType="processed");const{outputMin:a=0,outputMax:l=255}=this.functionArguments;i.statistics=[];for(let t=0;t<i.bandCount;t++)i.statistics[t]={min:a,max:l};return this.rasterInfo=i,{success:!0,supportsGPU:!n}}_processPixels(t,e){const s=t.pixelBlocks?.[0];if(null==s)return s;const{lookup:n}=this;if(n)return(0,Kt.eH)(s,{...n,outputPixelType:this.rasterInfo.pixelType});const{functionArguments:r}=this,o=e?.stretchCutoff??this.cutOffs??(0,qe.DP)(r.toJSON(),{rasterInfo:this.sourceRasterInfos[0],pixelBlock:s}),i=r.useGamma?r.gamma:null;return(0,qe._N)(s,{...o,gamma:i,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const{outputMin:t=0,outputMax:e=255,gamma:s,useGamma:n}=this.functionArguments,r=this.rasterInfo.bandCount>=2?3:1,o=n&&s?.length?(0,qe.Nh)(r,s):[1,1,1],{minCutOff:i,maxCutOff:a}=this.cutOffs??{minCutOff:[0,0,0],maxCutOff:[255,255,255]};1===i.length&&(i[1]=i[2]=i[0],a[1]=a[2]=a[0]);const l=a.map((s,n)=>(e-t)/(a[n]-i[n])),c=(0,u.zw)(this.outputPixelType),p=n&&s?[s[0],s[1]??s[0],s[2]??s[0]]:[1,1,1],h=n?[o[0],o[1]??o[0],o[2]??o[0]]:[1,1,1];return{bandCount:r,minOutput:t,maxOutput:e,minCutOff:i,maxCutOff:a,factor:l,useGamma:n,gamma:p,gammaCorrection:h,stretchType:this.functionArguments.stretchType,isOutputRounded:c,type:"stretch"}}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Bn.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:Sn,json:{write:!0,name:"rasterFunctionArguments"}})],Bn.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],Bn.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Bn.prototype,"lookup",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Bn.prototype,"cutOffs",void 0),Bn=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.StretchFunction")],Bn);const jn=Bn;var Zn;let zn=Zn=class extends p{constructor(){super(...arguments),this.attributeTableAsRecordSet=null}clone(){return new Zn({attributeTableAsRecordSet:(0,o.o8)(this.attributeTableAsRecordSet)})}};(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],zn.prototype,"attributeTableAsRecordSet",void 0),zn=Zn=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.TableFunctionArguments")],zn);const Gn=zn;let On=class extends w{constructor(){super(...arguments),this.functionName="Table",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1||t.pixelType.startsWith("f"))return{success:!1,supportsGPU:!1,error:"table-function: Source data must be single band and integer pixel type."};const{attributeTableAsRecordSet:e}=this.functionArguments;if(!e)return{success:!1,supportsGPU:!1,error:"table-function: Missing attributeTableAsRecordSet argument."};this.outputPixelType=this._getOutputPixelType(t.pixelType);const s=t.clone();return s.pixelType=this.outputPixelType,s.bandCount=1,"thematic"!==s.dataType&&(s.keyProperties=s.keyProperties?{...s.keyProperties,DataType:"thematic"}:{DataType:"thematic"}),this.rasterInfo=s,{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],On.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:Gn,json:{write:!0,name:"rasterFunctionArguments"}})],On.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],On.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)()],On.prototype,"isNoopProcess",void 0),On=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.TableFunction")],On);const Dn=On,En=new Map;function Vn(t,e){const{rasterFunctionArguments:s}=t;s&&(s.rasters||[s.raster,s.raster2]).forEach(t=>{t&&"number"!=typeof t&&("string"==typeof t?t.startsWith("http")&&(e.includes(t)||e.push(t)):"rasterFunctionArguments"in t&&Vn(t,e))})}function Un(t,e){e=e??{};try{if("function"in(t=(0,o.o8)(t))&&"arguments"in t&&t.arguments){const s=Jn(t,new Map,e);if(Qn(s),!s.renderingRule)throw new r.A("raster-function-helper","Unsupported raster function json.");t=s.renderingRule}if("rasterFunction"in t){const s=Kn(t=$n(t),e);return s.isRoot=!0,s}}catch{}throw new r.A("raster-function-helper","unsupported raster function json.")}function Ln(t){return!!(t&&"object"==typeof t&&t.rasterFunction&&t.rasterFunctionArguments)}function $n(t){const{rasterFunction:e,rasterFunctionArguments:s}=t,n={};for(const t in s){let e=s[t];const r=t.toLowerCase();if("rasters"===r&&Array.isArray(e))n.rasters=e.map(t=>Ln(t)?$n(t):t);else switch(Ln(e)&&(e=$n(e)),r){case"dra":n.dra=e;break;case"pspower":n.psPower=e;break;case"pszfactor":n.psZFactor=e;break;case"bandids":n.bandIds=e;break;default:n[t[0].toLowerCase()+t.slice(1)]=e}}return"Local"!==e||n.rasters?.length||(n.rasters=["$$"]),{...t,rasterFunctionArguments:n}}function Kn(t,e){const{rasterFunction:s,rasterFunctionArguments:n}=t,o=t.outputPixelType?.toLowerCase();if(null==s||!En.has(s))throw new r.A("raster-function-helper",`unsupported raster function: ${s}`);const i=En.get(s),a=("function"==typeof i.ctor?i.ctor:i.ctor.default).fromJSON({...t,outputPixelType:o}),{rasterArgumentNames:u}=a,l=[],c=function(t,e){return"rasters"===e[0]&&Array.isArray(t.rasters)?t.rasters:e.map(e=>t[e])}(n,u),p="rasters"===u[0]||u.length>1,h=[];for(let t=0;t<c.length;t++){const s=c[t];let n;null==s||"string"==typeof s&&s.startsWith("$")?l.push(e?.raster):"string"==typeof s?e[s]&&l.push(e[s]):"number"!=typeof s&&"rasterFunction"in s&&(n=Kn(s,e),p||(a.functionArguments[u[t]]=n),l.push(n)),p&&h.push(n??s)}if(p&&("rasters"===u[0]?a.functionArguments.rasters=h:u.forEach((t,e)=>{a.functionArguments[t]=h[e]})),e){a.sourceRasters=l;const t=e.raster?.url;t&&(a.mainPrimaryRasterId=t)}return a}function Wn(t,e){if(t&&e)for(const s in t){const n=t[s];n&&"object"==typeof n&&"type"in n&&("RasterFunctionTemplate"===n.type?Wn(n.arguments,e):"RasterFunctionVariable"===n.type&&null!=e[n.name]&&(n.value=e[n.name]))}}function Hn(t,e){if(!t||"object"!=typeof t)return t;const{value:s}=t;if(!s||"object"!=typeof s)return t.isDataset?"$$":s;if(Array.isArray(s))return 0===s.length?[]:s.map(t=>t&&"object"==typeof t&&"RasterFunctionVariable"===t.type?Hn(t,e):t);if("value"in s&&["number","string","boolean"].includes(typeof s.value))return s.value;if(t.isDataset&&"Scalar"!==s.type)return"$$";if(!("type"in s))return s;let n=s;switch(s.type){case"Scalar":n=s.value;break;case"AlgorithmicColorRamp":n=qn(s);break;case"MultiPartColorRamp":n={type:"multipart",colorRamps:s.ArrayOfColorRamp.map(qn)};break;case"ArgumentArray":if(s.elements?.length&&"RasterStatistics"!==s.elements[0].type){const t=[];for(let n=0;n<s.elements.length;n++){const o=s.elements[n],{type:i}=o;if(i)if("RasterFunctionTemplate"===i){const{renderingRule:s}=Jn(o,e);t.push(s),null!=o._object_id&&e.set(o._object_id,s)}else{if("RasterFunctionVariable"!==i)throw new r.A("raster-function-helper","unsupported raster function json.");{const s=Hn(o,e);t.push(s),null!=o._object_id&&e.set(o._object_id,s)}}else t.push(o)}n=t}else n=s.elements}return null!=s._object_id&&e.set(s._object_id,n),n}function qn(t){const e=t.algorithm??"esriHSVAlgorithm";let{FromColor:s,ToColor:r}=t;if(!Array.isArray(s)){const{r:t,g:e,b:r}=(0,n.$)({h:s.Hue,s:s.Saturation,v:s.Value});s=[t,e,r,s.AlphaValue]}if(!Array.isArray(r)){const{r:t,g:e,b:s}=(0,n.$)({h:r.Hue,s:r.Saturation,v:r.Value});r=[t,e,s,r.AlphaValue]}return{type:"algorithmic",algorithm:e,fromColor:s,toColor:r}}function Jn(t,e,s){s&&Wn(t,s);const n={renderingRule:{},templates:e};return Xn(t,n),n}function Xn(t,e){if(!t||!e.renderingRule)return;const{renderingRule:s,templates:n}=e,{function:r,arguments:o,_object_id:i}=t;if(!r||!o)return;null!=i&&n.set(i,s),s.rasterFunction=r.type.replace("Function",""),s.outputPixelType=r.pixelType;const a={};s.rasterFunctionArguments=a;for(const t in o){if("type"===t||"object_id"===t||"_object_ref_id"===t)continue;const e=o[t];e&&"object"==typeof e&&"type"in e&&("RasterFunctionTemplate"===e.type||"RasterFunctionVariable"===e.type)?("RasterFunctionVariable"===e.type?a[t]=Hn(e,n):(s.rasterFunctionArguments[t]={},Xn(e,{renderingRule:s.rasterFunctionArguments[t],templates:n})),null!=e._object_id&&n.set(e._object_id,a[t])):a[t]=e}switch(a.DEM&&!a.Raster&&(a.Raster=a.DEM,delete a.DEM),s.rasterFunction){case"Stretch":!function(t){t.Statistics?.length&&"object"==typeof t.Statistics&&(t.Statistics=t.Statistics.map(t=>[t.min,t.max,t.mean,t.standardDeviation])),null!=t.NumberOfStandardDeviation&&(t.NumberOfStandardDeviations=t.NumberOfStandardDeviation,delete t.NumberOfStandardDeviation)}(a);break;case"Colormap":!function(t){"randomcolorramp"===t.ColorRamp?.type?.toLowerCase()&&(delete t.ColorRamp,t.ColormapName="Random"),0===t.ColorSchemeType&&delete t.ColorRamp}(a);break;case"Convolution":!function(t){null!=t.ConvolutionType&&(t.Type=t.ConvolutionType,delete t.ConvolutionType)}(a);break;case"Mask":!function(t){t.NoDataValues?.length&&"string"==typeof t.NoDataValues[0]&&(t.NoDataValues=t.NoDataValues.filter(t=>""!==t).map(t=>Number(t)))}(a)}}function Qn(t){const{renderingRule:e,templates:s}=t;if("object"!=typeof e||!e?.rasterFunctionArguments||!s.size)return;const{rasterFunctionArguments:n}=e;for(const t in n){const e=n[t],o="_object_ref_id"===t?e:e&&"object"==typeof e&&"_object_ref_id"in e?e._object_ref_id:null;if(null!=o){if(!s.has(o))throw new r.A("raster-function-helper",`unsupported raster function json. _object_ref_id: ${o} does not exist`);const e=s.get(o);"_object_ref_id"!==t?n[t]=e:e&&"object"==typeof e&&Object.assign(n,e);continue}e&&"object"==typeof e&&(e.rasterFunctionArguments&&Qn({renderingRule:e,templates:s}),Array.isArray(e)&&e.forEach((t,n)=>{if(t&&"object"==typeof t)if(null!=t._object_ref_id){if(!s.has(t._object_ref_id))throw new r.A("raster-function-helper",`unsupported raster function json. _object_ref_id: ${e} does not exist`);const i=s.get(o);i&&"object"==typeof i?Object.assign(t,i):e[n]=i}else Qn({renderingRule:t,templates:s})}))}}En.set("Arithmetic",{desc:"Arithmetic Function",ctor:St,rasterArgumentNames:["rasters"]}),En.set("Aspect",{desc:"Aspect Function",ctor:Ot,rasterArgumentNames:["raster"]}),En.set("BandArithmetic",{desc:"Band Arithmetic Function",ctor:ne,rasterArgumentNames:["raster"]}),En.set("Colormap",{desc:"Colormap Function",ctor:Me,rasterArgumentNames:["raster"]}),En.set("ColormapToRGB",{desc:"ColormapToRGB Function",ctor:ke,rasterArgumentNames:["raster"]}),En.set("CompositeBand",{desc:"CompositeBand Function",ctor:ze,rasterArgumentNames:["rasters"]}),En.set("ComputeChange",{desc:"ComputeChange Function",ctor:$e,rasterArgumentNames:["rasters"]}),En.set("Convolution",{desc:"Convolution Function",ctor:is,rasterArgumentNames:["raster"]}),En.set("ContrastBrightness",{desc:"Contrast Brightness Function",ctor:Xe,rasterArgumentNames:["raster"]}),En.set("ExtractBand",{desc:"ExtractBand Function",ctor:ys,rasterArgumentNames:["raster"]}),En.set("Curvature",{desc:"Curvature Function",ctor:hs,rasterArgumentNames:["raster"]}),En.set("Hillshade",{desc:"Hillshade Function",ctor:Fs,rasterArgumentNames:["raster"]}),En.set("ShadedRelief",{desc:"ShadedRelief Function",ctor:sn,rasterArgumentNames:["raster"]}),En.set("Grayscale",{desc:"Grayscale Function",ctor:bs,rasterArgumentNames:["raster"]}),En.set("Clip",{desc:"Clip Function",ctor:me,rasterArgumentNames:["raster"]}),En.set("Local",{desc:"Local Function",ctor:js,rasterArgumentNames:["rasters"]}),En.set("Mask",{desc:"Mask Function",ctor:Es,rasterArgumentNames:["raster"]}),En.set("NDVI",{desc:"NDVI Function",ctor:Ks,rasterArgumentNames:["raster"]}),En.set("Remap",{desc:"Remap Function",ctor:Xs,rasterArgumentNames:["raster"]}),En.set("Slope",{desc:"Slope Function",ctor:ln,rasterArgumentNames:["raster"]}),En.set("SpectralConversion",{desc:"Spectral Conversion",ctor:dn,rasterArgumentNames:["raster"]}),En.set("Statistics",{desc:"Focal Statistics Function",ctor:Mn,rasterArgumentNames:["raster"]}),En.set("StatisticsHistogram",{desc:"Statistics Histogram Function",ctor:Rn,rasterArgumentNames:["raster"]}),En.set("Stretch",{desc:"Stretch Function",ctor:jn,rasterArgumentNames:["raster"]}),En.set("Table",{desc:"Attribute Table Function",ctor:Dn,rasterArgumentNames:["raster"]})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3202],{52106(e,t,r){r.d(t,{A:()=>C});var n,i,s=r(5482),o=r(37838),a=r(69540),l=r(51447),u=r(25482),p=r(53966),c=r(36708),d=r(24326),f=r(91429),y=r(12195),m=r(65864),h=r(50498),g=r(55156),w=r(60950),v=r(54339),b=r(94128),T=r(33910);function x(e){if(null==e)return null;const t={};for(const r in e){const n=e[r];n&&(t[r]=n.toJSON())}return 0!==Object.keys(t).length?t:null}let C=class extends((0,a.OU)(u.o)){static{n=b.Z}static{i=this}constructor(e){super(e),this[n]=!0,this.isAggregate=!1,this.layer=null,this.origin=null,this.sourceLayer=null,this._version=0,Object.defineProperty(this,"uid",{value:(0,d.c)(),configurable:!0}),Object.defineProperty(this,"_lastMeshTransform",{value:{},configurable:!0,writable:!0,enumerable:!1}),arguments.length>1&&(0,l.eF)(p.A.getLogger(this),"Graphic",{version:"4.30"})}initialize(){this._watchMeshGeometryChanges()}set aggregateGeometries(e){const t=this._get("aggregateGeometries");JSON.stringify(t)!==JSON.stringify(e)&&this._set("aggregateGeometries",e)}set attributes(e){const t=this._get("attributes");t!==e&&(this._set("attributes",e),this._notifyLayer("attributes",t,e))}set geometry(e){const t=this._get("geometry");t!==e&&(this._set("geometry",e),"mesh"!==e?.type&&this._notifyLayer("geometry",t,e))}set popupTemplate(e){const t=this._get("popupTemplate");t!==e&&(this._set("popupTemplate",e),this._notifyLayer("popupTemplate",t,e))}set symbol(e){const t=this._get("symbol");t!==e&&(this._set("symbol",e),this._notifyLayer("symbol",t,e))}get version(){return this._version}set visible(e){const t=this._get("visible");t!==e&&(this._set("visible",e),this._notifyLayer("visible",t,e))}cloneShallow(){return new i({aggregateGeometries:this.aggregateGeometries,attributes:this.attributes,geometry:this.geometry,isAggregate:this.isAggregate,layer:this.layer,popupTemplate:this.popupTemplate,sourceLayer:this.sourceLayer,symbol:this.symbol,visible:this.visible,origin:this.origin})}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;const t=(0,w.E_)(this.origin);if(t)return t.popupTemplate??(e?t.defaultPopupTemplate:null)??null;const r=this.origin&&"layer"in this.origin?this.origin.layer:null;for(const t of[r,this.sourceLayer,this.layer])if(t&&"object"==typeof t){if("popupTemplate"in t&&t.popupTemplate)return t.popupTemplate;if(e&&"defaultPopupTemplate"in t&&null!=t.defaultPopupTemplate)return t.defaultPopupTemplate}return null}getAttribute(e){return this.attributes?.[e]}setAttribute(e,t){if(this.attributes){const r=this.getAttribute(e);this.attributes[e]=t,this._notifyLayer("attributes",r,t,e)}else this.attributes={[e]:t}}getObjectId(){const e=(0,g.I)(this.origin);if(e)return(0,v.r)(this,e);const t=this.sourceLayer??this.layer;return t?(0,v.r)(this,t):null}getGlobalId(){const e=(0,g.I)(this.origin);if(e?.globalIdField)return this.getAttribute(e.globalIdField);const t=this.sourceLayer??this.layer;return t&&"globalIdField"in t&&t.globalIdField?this.getAttribute(t.globalIdField):null}toJSON(){return{aggregateGeometries:x(this.aggregateGeometries),geometry:null!=this.geometry?this.geometry.toJSON():null,symbol:null!=this.symbol?this.symbol.toJSON():null,attributes:(0,y.W)(this.attributes)?this.attributes.toJSON():{...this.attributes},popupTemplate:this.popupTemplate?.toJSON()??null}}notifyMeshTransformChanged(e={}){const{geometry:t}=this;if("mesh"===t?.type){const r={origin:t.origin,transform:t.transform};this._notifyLayer("origin-transform",r,r,e.action)}}_notifyLayer(e,t,r,n){if(this._version++,!this.layer||!("graphicChanged"in this.layer))return;const i={graphic:this,property:e,oldValue:t,newValue:r};"origin-transform"===e&&(i.action=n),"attributes"===e&&(i.attributeName=n),this.layer.graphicChanged(i)}_watchMeshGeometryChanges(){this.addHandles([(0,c.z7)(()=>"mesh"===this.geometry?.type&&this.geometry.vertexSpace.origin?{localMatrix:this.geometry.transform?.localMatrix,origin:this.geometry.vertexSpace.origin}:void 0,({localMatrix:e,origin:t})=>{this._lastMeshTransform.localMatrix===e&&this._lastMeshTransform.origin===t||(this._lastMeshTransform.localMatrix=e,this._lastMeshTransform.origin=t,this.notifyMeshTransformChanged())}),(0,c.z7)(()=>"mesh"===this.geometry?.type?{vertexAttributes:this.geometry.vertexAttributes}:void 0,()=>{const e=this.geometry;"mesh"===e?.type&&e.vertexSpace.origin?(this._lastMeshTransform.localMatrix=e.transform?.localMatrix,this._lastMeshTransform.origin=e.vertexSpace.origin):(this._lastMeshTransform.localMatrix=void 0,this._lastMeshTransform.origin=void 0),this._notifyLayer("geometry",this.geometry,this.geometry)},{equals:(e,t)=>e===t,sync:!0})])}};(0,s.Cg)([(0,f.MZ)({value:null,json:{read:function(e){if(!e)return null;const t={};for(const r in e){const n=(0,m.rS)(e[r]);n&&(t[r]=n)}return 0!==Object.keys(t).length?t:null}}})],C.prototype,"aggregateGeometries",null),(0,s.Cg)([(0,f.MZ)({value:null})],C.prototype,"attributes",null),(0,s.Cg)([(0,f.MZ)({value:null,types:h.yR,json:{read:m.rS}})],C.prototype,"geometry",null),(0,s.Cg)([(0,f.MZ)({type:Boolean})],C.prototype,"isAggregate",void 0),(0,s.Cg)([(0,f.MZ)({clonable:!1})],C.prototype,"layer",void 0),(0,s.Cg)([(0,f.MZ)({clonable:"reference"})],C.prototype,"origin",void 0),(0,s.Cg)([(0,f.MZ)({type:o.A,value:null})],C.prototype,"popupTemplate",null),(0,s.Cg)([(0,f.MZ)({clonable:"reference"})],C.prototype,"sourceLayer",void 0),(0,s.Cg)([(0,f.MZ)({value:null,types:T.Es})],C.prototype,"symbol",null),(0,s.Cg)([(0,f.MZ)({clonable:!1,json:{read:!1,write:!1}})],C.prototype,"_version",void 0),(0,s.Cg)([(0,f.MZ)({type:Boolean,value:!0})],C.prototype,"visible",null),C=i=(0,s.Cg)([(0,f.$K)("esri.Graphic")],C)},46140(e,t,r){r.d(t,{A:()=>i});var n=r(49186);class i{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}toString(){return`${this.major}.${this.minor}`}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new n.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new i(this.major,this.minor,this._context)}static parse(e,t=""){const[r,s]=e.split("."),o=/^\s*\d+\s*$/;if(!r?.match||!o.test(r))throw new n.A((t&&t+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e});if(!s?.match||!o.test(s))throw new n.A((t&&t+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e});const a=parseInt(r,10),l=parseInt(s,10);return new i(a,l,t)}}},6797(e,t,r){r.d(t,{Ui:()=>d});var n=r(69622),i=r(7762),s=r(88620);const o=new Set(["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"]);function a(e){return e instanceof n.A}function l(e){return e instanceof i.A?Object.keys(e.items):a(e)?(0,s.oY)(e).keys():e?Object.keys(e):[]}function u(e,t){return e instanceof i.A?e.items[t]:e[t]}function p(e){return e?e.declaredClass:null}function c(e,t){const r=e.diff;if(r&&"function"==typeof r)return r(e,t);const n=l(e),i=l(t);if(0===n.length&&0===i.length)return;if(!n.length||!i.length||function(e,t){return!(!Array.isArray(e)||!Array.isArray(t))&&e.length!==t.length}(e,t))return{type:"complete",oldValue:e,newValue:t};const s=i.filter(e=>!n.includes(e)),d=n.filter(e=>!i.includes(e)),f=n.filter(r=>i.includes(r)&&u(e,r)!==u(t,r)).concat(s,d).sort(),y=p(e);if(y&&o.has(y)&&f.length)return{type:"complete",oldValue:e,newValue:t};let m;const h=a(e)&&a(t);for(const n of f){const i=u(e,n),s=u(t,n);let o;if((h||"function"!=typeof i&&"function"!=typeof s)&&i!==s&&(null!=i||null!=s)){if(r&&r[n]&&"function"==typeof r[n])o=r[n]?.(i,s);else if(i instanceof Date&&s instanceof Date){if(i.getTime()===s.getTime())continue;o={type:"complete",oldValue:i,newValue:s}}else o="object"==typeof i&&"object"==typeof s&&p(i)===p(s)?c(i,s):{type:"complete",oldValue:i,newValue:s};null!=o&&(null!=m?m.diff[n]=o:m={type:"partial",diff:{[n]:o}})}}return m}function d(e,t){if("function"!=typeof e&&"function"!=typeof t&&(null!=e||null!=t))return null==e||null==t||"object"==typeof e&&"object"==typeof t&&p(e)!==p(t)?{type:"complete",oldValue:e,newValue:t}:c(e,t)}},67482(e,t,r){function n(e){return null!=a(e)||null!=o(e)}function i(e){return l.test(e)}function s(e){return a(e)??o(e)}function o(e){const t=new Date(e);return function(e,t){if(Number.isNaN(e.getTime()))return!1;let r=!0;if(p&&/\d+\W*$/.test(t)){const e=t.match(/[a-zA-Z]{2,}/);if(e){let t=!1,n=0;for(;!t&&n<=e.length;)t=!u.test(e[n]),n++;r=!t}}return r}(t,e)?Number.isNaN(t.getTime())?null:t.getTime()-6e4*t.getTimezoneOffset():null}function a(e){const t=l.exec(e);if(!t?.groups)return null;const r=t.groups,n=+r.year,i=+r.month-1,s=+r.day,o=+(r.hours??"0"),a=+(r.minutes??"0"),u=+(r.seconds??"0");if(o>23)return null;if(a>59)return null;if(u>59)return null;const p=r.ms??"0",c=p?+p.padEnd(3,"0").slice(0,3):0;let d;if(r.isUTC||!r.offsetSign)d=Date.UTC(n,i,s,o,a,u,c);else{const e=+r.offsetHours,t=+r.offsetMinutes;d=6e4*("+"===r.offsetSign?-1:1)*(60*e+t)+Date.UTC(n,i,s,o,a,u,c)}return Number.isNaN(d)?null:d}r.d(t,{Br:()=>i,Cq:()=>n,_U:()=>s});const l=/^(?:(?<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})))?$/,u=/^((jan(uary)?)|(feb(ruary)?)|(mar(ch)?)|(apr(il)?)|(may)|(jun(e)?)|(jul(y)?)|(aug(ust)?)|(sep(tember)?)|(oct(ober)?)|(nov(ember)?)|(dec(ember)?)|(am)|(pm)|(gmt)|(utc))$/i,p=!Number.isNaN(new Date("technology 10").getTime())},13069(e,t,r){r.d(t,{AG:()=>a,lk:()=>i,vD:()=>o,yS:()=>s});const n="randomUUID"in crypto;function i(){if(n)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function s(){return`{${i().toUpperCase()}}`}function o(){return`{${i()}}`}function a(e){const t=e.toUpperCase();return e.startsWith("{")?t:`{${t}}`}},83027(e,t,r){r.d(t,{h:()=>n});const n=r(29953).ho},159(e,t,r){r.d(t,{A:()=>u});var n,i=r(5482),s=r(69540),o=r(25482),a=r(91429),l=r(99157);let u=n=class extends((0,s.OU)(o.o)){constructor(e){super(e),this.steps=[]}getInverse(){const e=new n;for(let t=this.steps.length-1;t>=0;t--){const r=this.steps[t];e.steps.push(r.getInverse())}return e}};(0,i.Cg)([(0,a.MZ)({type:[l.A],nonNullable:!0,json:{name:"geoTransforms"}})],u.prototype,"steps",void 0),u=n=(0,i.Cg)([(0,a.$K)("esri.geometry.operators.support.GeographicTransformation")],u)},99157(e,t,r){r.d(t,{A:()=>l});var n,i=r(5482),s=r(69540),o=r(25482),a=r(91429);let l=n=class extends((0,s.OU)(o.o)){constructor(e){super(e),this.isInverse=!1,this.wkt=null,this.wkid=null}getInverse(){return new n({isInverse:!this.isInverse,wkid:this.wkid,wkt:this.wkt})}};(0,i.Cg)([(0,a.MZ)({json:{name:"transformForward",read:e=>!e,write:(e,t,r)=>{t[r]=!e}}})],l.prototype,"isInverse",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],l.prototype,"wkt",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],l.prototype,"wkid",void 0),l=n=(0,i.Cg)([(0,a.$K)("esri.geometry.operators.support.GeographicTransformationStep")],l)},9762(e,t,r){r.r(t),r.d(t,{projectBuffer:()=>i});var n=r(49208);function i(e,t,r,i,s,o,a=Math.floor(e.length/3)){const l=(0,n.jd)(t,s);if(null==l)return!1;if(l===n.pO){if(e===i&&r===o)return!0;const t=r+3*a;for(let n=r,s=o;n<t;n++,s++)i[s]=e[n]??0;return!0}const u=r+3*a;for(let t=r,n=o;t<u;t+=3,n+=3)l(e,t,i,n);return!0}},49208(e,t,r){r.d(t,{Tp:()=>c,jd:()=>p,pO:()=>f,w5:()=>u});var n=r(34727),i=r(86211),s=r(73941),o=r(79258),a=r(34403),l=r(21325);const u={2:{5:f,7:null,9:null,10:f,1:T,6:null,8:null,0:null,3:m,11:h,2:f,4:M},5:{5:f,7:null,9:null,10:f,1:T,6:null,8:null,0:null,3:m,11:h,2:f,4:M},7:{5:null,7:f,9:null,10:f,1:null,6:b,8:null,0:null,3:null,11:null,2:null,4:null},9:{5:null,7:null,9:f,10:f,1:null,6:null,8:v,0:null,3:null,11:null,2:null,4:null},3:{5:y,7:null,9:null,10:y,1:function(e,t,r,n){const i=e[t]/O,s=_-2*Math.atan(Math.exp(-e[t+1]/O)),o=O+(e[t+2]??0),a=Math.cos(s)*o;r[n]=Math.cos(i)*a,r[n+1]=Math.sin(i)*a,r[n+2]=Math.sin(s)*o},6:null,8:null,0:null,3:f,11:function(e,t,r,n){y(e,t,r,n),h(r,n,r,n)},2:y,4:function(e,t,r,n){y(e,t,r,n),M(r,n,r,n)}},4:{5:F,7:null,9:null,10:F,1:function(e,t,r,n){F(e,t,r,n),T(r,n,r,n)},6:null,8:null,0:null,3:function(e,t,r,n){F(e,t,r,n),m(r,n,r,n)},11:function(e,t,r,n){F(e,t,r,n),h(r,n,r,n)},2:F,4:f},1:{5:A,7:null,9:null,10:A,1:f,6:null,8:null,0:null,3:function(e,t,r,n){A(e,t,r,n),m(r,n,r,n)},11:function(e,t,r,n){A(e,t,r,n),h(r,n,r,n)},2:A,4:function(e,t,r,n){A(e,t,r,n),M(r,n,r,n)}},6:{5:null,7:S,9:null,10:S,1:null,6:f,8:null,0:null,3:null,11:null,2:null,4:null},8:{5:null,7:null,9:C,10:C,1:null,6:null,8:f,0:null,3:null,11:null,2:null,4:null},0:{5:null,7:null,9:null,10:null,1:null,6:null,8:null,0:f,3:null,11:null,2:null,4:null},10:{5:f,7:f,9:f,10:f,1:T,6:b,8:v,0:null,3:m,11:h,2:f,4:M},11:{5:g,7:null,9:null,10:g,1:function(e,t,r,n){g(e,t,r,n),T(r,n,r,n)},6:null,8:null,0:null,3:function(e,t,r,n){g(e,t,r,n),m(r,n,r,n)},11:f,2:g,4:function(e,t,r,n){g(e,t,r,n),M(r,n,r,n)}}};function p(e,t){return c(e,t)?.projector}function c(e,t){if(null==e||null==t)return null;if(I.source.spatialReference===e&&I.dest.spatialReference===t)return I;const r=d(e,I.source),n=d(t,I.dest);return 0===r&&0===n?(0,l.aI)(e,t)?I.projector=f:I.projector=null:I.projector=u[r][n],I}function d(e,t){return e?t.spatialReference===e?t.spatialReferenceId:(t.spatialReference=e,"metersPerUnit"in t&&(t.metersPerUnit=(0,i.GA)(e,1)),(0,s.jA)(e)?t.spatialReferenceId=1:(0,l.oT)(e)?t.spatialReferenceId=2:(0,l.K8)(e)?t.spatialReferenceId=3:(0,l.r1)(e)?t.spatialReferenceId=11:e.wkt===s.Ro.wkt?t.spatialReferenceId=4:4490===e.wkid?t.spatialReferenceId=5:e.wkt===s.FY.wkt?t.spatialReferenceId=6:e.wkt===s.LJ.wkt?t.spatialReferenceId=8:(0,s.q8)(e)?t.spatialReferenceId=7:(0,s.KQ)(e)?t.spatialReferenceId=9:t.spatialReferenceId=0):0}function f(e,t,r,n){e!==r&&(r[n++]=e[t++],r[n++]=e[t++],r[n]=e[t]??0)}function y(e,t,r,n){r[n]=P*(e[t]/O),r[n+1]=P*(_-2*Math.atan(Math.exp(-e[t+1]/O))),r[n+2]=e[t+2]??0}function m(e,t,r,i){!function(e,t,r,i,s){const o=.4999999*Math.PI,a=(0,n.qE)(R*e[t+1],-o,o),l=Math.sin(a);r[i++]=R*e[t]*s.radius,r[i++]=s.halfSemiMajorAxis*Math.log((1+l)/(1-l)),r[i]=e[t+2]??0}(e,t,r,i,o.$O)}function h(e,t,r,n){r[n]=e[t]*E,r[n+1]=e[t+1]*E,r[n+2]=e[t+2]??0}function g(e,t,r,n){r[n]=e[t]*j,r[n+1]=e[t+1]*j,r[n+2]=e[t+2]??0}function w(e,t,r,n,i){const s=i+(e[t+2]??0),o=R*e[t],a=R*e[t+1],l=Math.cos(a)*s;r[n]=Math.cos(o)*l,r[n+1]=Math.sin(o)*l,r[n+2]=Math.sin(a)*s}function v(e,t,r,n){w(e,t,r,n,o.Sw.radius)}function b(e,t,r,n){w(e,t,r,n,o.sH.radius)}function T(e,t,r,n){w(e,t,r,n,o.$O.radius)}function x(e,t,r,i,s){const o=e[t],a=e[t+1],l=e[t+2]??0,u=Math.sqrt(o*o+a*a+l*l),p=(0,n.YN)(l/(0===u?1:u)),c=Math.atan2(a,o);r[i++]=P*c,r[i++]=P*p,r[i]=u-s}function C(e,t,r,n){x(e,t,r,n,o.Sw.radius)}function S(e,t,r,n){x(e,t,r,n,o.sH.radius)}function A(e,t,r,n){x(e,t,r,n,o.$O.radius)}function M(e,t,r,n){!function(e,t,r,n,i){const s=R*e[t],o=R*e[t+1],a=e[t+2]??0,l=Math.sin(o),u=Math.cos(o),p=i.radius/Math.sqrt(1-i.eccentricitySquared*l*l);r[n++]=(p+a)*u*Math.cos(s),r[n++]=(p+a)*u*Math.sin(s),r[n++]=(p*(1-i.eccentricitySquared)+a)*l}(e,t,r,n,o.$O)}function F(e,t,r,n){const i=a.TP,s=e[t],l=e[t+1],u=e[t+2]??0;let p,c,d,f,y,m,h,g,w,v,b,T,x,C,S,A,M,F,I,R,_;p=Math.abs(u),c=s*s+l*l,d=Math.sqrt(c),f=c+u*u,y=Math.sqrt(f),R=Math.atan2(l,s),m=u*u/f,h=c/f,C=i.a2/y,S=i.a3-i.a4/y,h>.3?(g=p/y*(1+h*(i.a1+C+m*S)/y),I=Math.asin(g),v=g*g,w=Math.sqrt(1-v)):(w=d/y*(1-m*(i.a5-C-h*S)/y),I=Math.acos(w),v=1-w*w,g=Math.sqrt(v)),b=1-o.$O.eccentricitySquared*v,T=o.$O.radius/Math.sqrt(b),x=i.a6*T,C=d-T*w,S=p-x*g,M=w*C+g*S,A=w*S-g*C,F=A/(x/b+M),I+=F,_=M+A*F/2,u<0&&(I=-I),r[n++]=P*R,r[n++]=P*I,r[n]=_}const I={source:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},projector:f},R=(0,n.kU)(1),P=(0,n.KJ)(1),_=.5*Math.PI,O=o.$O.radius,E=O*Math.PI/180,j=180/(O*Math.PI)},91218(e,t,r){r.r(t),r.d(t,{canProjectWithoutEngine:()=>B,initializeProjection:()=>H,isEqualBaseGCS:()=>V,isLoaded:()=>O,isLoadedOrLoad:()=>E,isLoadedOrLoadFor:()=>j,load:()=>N,project:()=>k,projectAsync:()=>J,projectExtent:()=>ie,projectMany:()=>U,projectMultipoint:()=>Q,projectOrLoad:()=>G,projectOrLoadMany:()=>$,projectPoint:()=>W,projectPolygon:()=>re,projectPolyline:()=>ee,projectWithoutEngine:()=>Y,requiresLoad:()=>Z,test:()=>z,tryProject:()=>D,unload:()=>q});var n=r(49186),i=r(17676),s=r(62788),o=r(95488),a=r(51850),l=r(21276),u=r(73941),p=r(5443),c=r(91075),d=r(48526),f=r(86738),y=r(39829),m=r(82799),h=r(16930),g=r(98764),w=r(159),v=r(9762),b=r(49208);function T(e,t,r,n,i,s){return x[0]=e,x[1]=t,x[2]=r,(0,v.projectBuffer)(x,n,0,i,s,0)}const x=(0,a.vt)();var C=r(60408),S=r(21325),A=r(52006);let M=null,F=null,I=null,R=null,P={};const _=new o.I;function O(){return!!(F?.isLoaded()&&I?.isLoaded()&&R?.isLoaded())}function E(){return!!O()||((0,s.gc)(_),N(),!1)}function j(e,t){return!e||!t||B(e,t)||E()}function Z(e,t){return!B(e,t)&&!O()}async function N(e){null==M&&(M=Promise.all([r.e(3276).then(r.bind(r,83276)).then(e=>(F=e,F.load())),r.e(8377).then(r.bind(r,8377)).then(e=>(I=e,I.load())),r.e(2158).then(r.bind(r,12158)).then(e=>(R=e,R.load()))])),await M,(0,i.Te)(e),_.notify()}function k(e,t,r){return Array.isArray(e)?0===e.length?[]:((0,l.H)(e),U(e,e[0].spatialReference,t,r)):((0,l.f)(e),U([e],e.spatialReference,t,r)[0])}function U(e,t,r,n){if(null==t||null==r)return e;if(B(t,r,n))return e.map(e=>Y(e,t,r));if(null==n?.geographicTransformation&&(0,u.jA)(t))return U(e.map(e=>Y(e,t,h.A.WGS84)),h.A.WGS84,r,{zConversionDisabled:n?.zConversionDisabled});if(null==n?.geographicTransformation&&(0,u.jA)(r))return U(e,t,h.A.WGS84).map(e=>Y(e,h.A.WGS84,r));if(!O())throw new L;if(!n?.geographicTransformation)if(n?.extendedParams)n={...n,geographicTransformation:R.getTransformation(t,r,n.areaOfInterestExtent)||new w.A};else if(!n?.areaOfInterestExtent){const e=function(e,t){return[e.wkid?.toString()??"-1",e.wkt?.toString()??"",e.wkt2?.toString()??"",t.wkid?.toString()??"-1",t.wkt?.toString()??"",t.wkt2?.toString()??""].join()}(t,r);let i=P[e];i||(i=R.getTransformation(t,r)||new w.A,P[e]=i),n={geographicTransformation:i,zConversionDisabled:n?.zConversionDisabled}}return e[0].spatialReference||(e[0].spatialReference=t),e[0]instanceof c.A?F.executeMany(e,r,n):I.executeMany(e,r,n)}function D(e,t,r){try{return k(e,t,r)}catch(e){return null}}function G(e,t){const r=$([e],t);return null!=r.pending?{pending:r.pending,geometry:null}:null!=r.geometries?{pending:null,geometry:r.geometries[0]}:{pending:null,geometry:null}}function $(e,t,r){if(!O())for(const r of e)if(null!=r&&!(0,S.aI)(r.spatialReference,t)&&(0,S.fn)(r.spatialReference)&&(0,S.fn)(t)&&!B(r.spatialReference,t))return(0,s.gc)(_),{pending:N(),geometries:null};return{pending:null,geometries:e.map(e=>null==e?null:(0,S.aI)(e.spatialReference,t)?e:(0,S.fn)(e.spatialReference)&&(0,S.fn)(t)?k(e,t,r):null)}}class L extends n.A{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}function q(){M=null,F=null,I=null,R=null,P={}}const z={get loadPromise(){return M}};async function J(e,t,r){if((0,i.Te)(r),!e)return e;const n=$(Array.isArray(e)?e:[e],t,r);if(n.pending)return await n.pending,(0,i.Te)(r),J(e,t,r);const s=n.geometries??[];return Array.isArray(e)?s:s[0]}function B(e,t,r){return!(r?.areaOfInterestExtent||r?.extendedParams||r?.geographicTransformation)&&(!!(0,S.aI)(e,t)||(0,S.fn)(e)&&(0,S.fn)(t)&&!!(0,b.jd)(e,t))}function V(e,t){if((0,S.aI)(e,t))return!0;if(!(0,S.fn)(e)||!(0,S.fn)(t))return!1;const r=(0,S.oT)(e)||(0,S.K8)(e)||(0,S.x1)(e),n=(0,S.oT)(t)||(0,S.K8)(t)||(0,S.x1)(t);return r&&n}async function H(e,t,r,n){if(O())return(0,i.NO)(n);if(Array.isArray(e)){for(const{source:t,dest:r,options:i}of e)if(t&&r&&!B(t,r,i))return N(n)}else if(e&&t&&!B(e,t,r))return N(n);return(0,i.NO)(n)}function Y(e,t,r){return e?(0,C.fT)(e)?K(e,t,new f.A,r,0):(0,C.ZC)(e)?se(e,t,new p.A,r,0):(0,C.Bi)(e)?ne(e,t,new y.A,r,0):(0,C.Rg)(e)?te(e,t,new m.A,r,0):(0,C.U9)(e)?X(e,t,new d.A,r,0):null:null}function W(e,t,r=t.spatialReference,n=0){return null!=r&&null!=e.spatialReference&&null!=K(e,e.spatialReference,t,r,n)}function K(e,t,r,n,i){ue[0]=e.x,ue[1]=e.y;const s=e.z;return ue[2]=void 0!==s?s:i,(0,v.projectBuffer)(ue,t,0,ue,n,0)?(r.x=ue[0],r.y=ue[1],r.spatialReference=n,void 0!==s||(0,u.xP)(n)?(r.z=ue[2],r.hasZ=!0):(r.z=void 0,r.hasZ=!1),void 0===e.m?(r.m=void 0,r.hasM=!1):(r.m=e.m,r.hasM=!0),r):null}function Q(e,t,r=t.spatialReference,n=0){return null!=e.spatialReference&&null!=r&&null!=X(e,e.spatialReference,t,r,n)}function X(e,t,r,n,i){const{points:s,hasZ:o,hasM:a}=e,l=[],u=s.length,p=[];for(const e of s)p.push(e[0],e[1],o?e[2]:i);if(!(0,v.projectBuffer)(p,t,0,p,n,0,u))return null;const c=le(o,n);for(let e=0;e<u;++e){const t=3*e,r=p[t],n=p[t+1];c&&a?l.push([r,n,p[t+2],s[e][3]]):c?l.push([r,n,p[t+2]]):a?l.push([r,n,s[e][2]]):l.push([r,n])}return r.points=l,r.spatialReference=n,r.hasZ=o,r.hasM=a,r}function ee(e,t,r=t.spatialReference,n=0){return null!=e.spatialReference&&null!=r&&null!=te(e,e.spatialReference,t,r,n)}function te(e,t,r,n,i){const{curvePaths:s,paths:o,hasZ:a,hasM:l}=e;if(!(s?ae(s,a??!1,l??!1,t,r.curvePaths=[],n,i):oe(o,a??!1,l??!1,t,r.paths,n,i)))return null;const u=le(a,n);return r.spatialReference=n,r.hasZ=u,r.hasM=l,r}function re(e,t,r=t.spatialReference,n=0){return null!=e.spatialReference&&null!=r&&null!=ne(e,e.spatialReference,t,r,n)}function ne(e,t,r,n,i){const{curveRings:s,rings:o,hasZ:a,hasM:l}=e;return(s?ae(s,a??!1,l??!1,t,r.curveRings=[],n,i):oe(o,a??!1,l??!1,t,r.rings,n,i))?(r.spatialReference=n,r.hasZ=le(a,n),r.hasM=l,r):null}function ie(e,t,r=t.spatialReference,n=0){return null!=e.spatialReference&&null!=r&&null!=se(e,e.spatialReference,t,r,n)}function se(e,t,r,n,i){const{xmin:s,ymin:o,xmax:a,ymax:l,hasZ:u,hasM:p}=e;if(!T(s,o,u?e.zmin:i,t,ue,n))return null;const c=le(u,n);return r.xmin=ue[0],r.ymin=ue[1],c&&(r.zmin=ue[2]),T(a,l,u?e.zmax:i,t,ue,n)?(r.xmax=ue[0],r.ymax=ue[1],c&&(r.zmax=ue[2]),p&&(r.mmin=e.mmin,r.mmax=e.mmax),r.spatialReference=n,r):null}function oe(e,t,r,n,i,s,o=0){const a=new Array;for(const r of e)for(const e of r)a.push(e[0],e[1],t?e[2]:o);if(!(0,v.projectBuffer)(a,n,0,a,s,0))return!1;let l=0;i.length=0;const u=t?3:2,p=le(t,s);for(const t of e){const e=new Array;for(const n of t){const t=a.slice(l,l+=3);p||t.pop(),r&&t.push(n[u]),e.push(t)}i.push(e)}return!0}function ae(e,t,r,n,i,s,o=0){const a=new Array;for(const r of e)for(const e of r){if((0,A.FG)(e))return!1;if((0,A.aO)(e)){const[r,n]=e.c;a.push(r[0],r[1],t?r[2]:o,n[0],n[1],o);continue}if((0,A.n1)(e)){const[r,n,i]=e.b;a.push(r[0],r[1],t?r[2]:o,n[0],n[1],o,i[0],i[1],o);continue}const r=e;a.push(r[0],r[1],t?r[2]:o)}if(!(0,v.projectBuffer)(a,n,0,a,s,0))return!1;let l=0;i.length=0;const u=t?3:2,p=le(t,s);for(const t of e){const e=new Array;for(const n of t){const t=a.slice(l,l+=3);if(p||t.pop(),r&&t.push((0,A.yP)(n)[u]),(0,A.FG)(n))return!1;if((0,A.aO)(n)){const r=a[l++],n=a[l++];++l,e.push({c:[t,[r,n]]});continue}if((0,A.n1)(n)){const r=a[l++],n=a[l++];++l;const i=a[l++],s=a[l++];++l,e.push({b:[t,[r,n],[i,s]]});continue}e.push(t)}i.push(e)}return!0}function le(e,t){return e||(0,u.xP)(t)||(0,S.aI)(t,g.Y0)}const ue=(0,a.vt)()},98764(e,t,r){r.d(t,{GD:()=>o,Y0:()=>u,lO:()=>p});var n=r(73941),i=r(16930),s=r(21325);const o=new i.A(n.fv),a=new i.A(n.FY),l=new i.A(n.LJ),u=new i.A(n.Ro);function p(e){const t=c.get(e);if(t)return t;let r=o;if(e)if(e===a)r=a;else if(e===l)r=l;else{const t=e.wkid,n=e.latestWkid;if(null!=t||null!=n)(0,s.tl)(t)||(0,s.tl)(n)?r=a:((0,s.ZL)(t)||(0,s.ZL)(n))&&(r=l);else{const t=e.wkt2??e.wkt;if(t){const e=t.toUpperCase();e===d?r=a:e===f&&(r=l)}}}return c.set(e,r),r}const c=new Map,d=a.wkt.toUpperCase(),f=l.wkt.toUpperCase()},34403(e,t,r){r.d(t,{TP:()=>o});var n=r(79258);Math.PI;const i=n.$O.radius,s=n.$O.eccentricitySquared,o={a1:i*s,a2:i*s*i*s,a3:i*s*s/2,a4:i*s*i*s*2.5,a5:i*s+i*s*s/2,a6:1-s};n.$O.radius,n.$O.flattening,n.Sw.radius,n.Sw.flattening,n.sH.radius,n.sH.flattening,n.sH.radius},83960(e,t,r){r.d(t,{X_:()=>s,oW:()=>a,zx:()=>o});var n=r(34727),i=r(86211);function s(e,t){const r=t||e.extent,n=e.width,s=(0,i.GA)(r?.spatialReference);return r&&n?r.width/n*s*i.dy*96:0}function o(e,t,r){return function(e,t){return 0===t||(0,n.Sp)(e,t)||e<t}(e,t)&&function(e,t){return 0===t||(0,n.Sp)(e,t)||e>t}(e,r)}function a(e,t){return(0,n.Sp)(e,t)?0:(e||Number.POSITIVE_INFINITY)>(t||Number.POSITIVE_INFINITY)?1:-1}},55156(e,t,r){r.d(t,{I:()=>i,e:()=>n});const n=Symbol("idFieldsProviderSymbol");function i(e){return(t=e)&&n in t?e[n]:void 0;var t}},21901(e,t,r){r.r(t),r.d(t,{default:()=>se});var n=r(5482),i=r(37838),s=r(25728),o=r(93637),a=r(84952),l=r(91429),u=r(56507),p=r(5443),c=r(16930),d=r(50498),f=r(55156),y=r(60950),m=r(89808),h=r(99959);const g=Symbol("isWFSGraphicOrigin");var w;class v extends h.A{get[(w=g,y.ym)](){return this.layer}get[f.e](){return this.layer}get[m.Q](){return this.layer}constructor(e){super(),this[w]=!0,this.type="wfs",this.layer=e}get id(){return this.layer.id}}var b=r(4146),T=r(49186),x=r(44208),C=r(92474),S=r(53966),A=r(17676),M=r(83027),F=r(64714),I=r(34322),R=r(37745),P=r(22671),_=r(98623);let O=class extends C.x_{constructor(){super(...arguments),this._connection=null,this._workerHandler=null,this.capabilities=(0,F.f)(!1,!1),this.type="wfs",this.refresh=(0,A.sg)(async()=>{await this.load();const e={customParameters:this.layer.customParameters,maxRecordCount:this.layer.maxRecordCount,maxTotalRecordCount:this.layer.maxTotalRecordCount,maxPageCount:this.layer.maxPageCount},{extent:t}=await this._workerHandler.refresh(e);return t&&(this.sourceJSON.extent=t),{dataChanged:!0,updates:{extent:this.sourceJSON.extent}}})}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this._startWorker({signal:t})),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null,this._workerHandler=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,t={}){const r=await this.queryFeaturesJSON(e,t);return P.A.fromJSON(r)}async queryFeaturesJSON(e,t={}){return await this.load(t),this._workerHandler.queryFeatures(e?e.toJSON():void 0,t)}async queryFeatureCount(e,t={}){return await this.load(t),this._workerHandler.queryFeatureCount(e?e.toJSON():void 0,t)}async queryObjectIds(e,t={}){return await this.load(t),this._workerHandler.queryObjectIds(e?e.toJSON():void 0,t)}async queryExtent(e,t={}){await this.load(t);const r=await this._workerHandler.queryExtent(e?e.toJSON():void 0,t);return{count:r.count,extent:p.A.fromJSON(r.extent)}}async querySnapping(e,t={}){return await this.load(t),this._workerHandler.querySnapping(e,t)}async queryAttributeBins(e,t={}){await this.load(t);const r=await this._workerHandler.queryAttributeBins(e?.toJSON(),t);return R.A.fromJSON(r)}async _createLoadOptions(e){const{url:t,customParameters:r,name:n,namespaceUri:i,fields:s,geometryType:o,maxRecordCount:a,maxPageCount:l,maxTotalRecordCount:u,swapXY:p}=this.layer,c="defaults"===this.layer.originOf("spatialReference")?void 0:this.layer.spatialReference;if(!t)throw new T.A("wfs-layer:missing-url","WFSLayer must be created with a url");this.wfsCapabilities||(this.wfsCapabilities=await(0,I.Fu)(t,{customParameters:r,...e}));const f=["fields","geometryType","name","namespaceUri","swapXY"].some(e=>null==this.layer[e]),y=f?await(0,I.O8)(this.wfsCapabilities,n,i,{spatialReference:c,customParameters:r,signal:e?.signal}):{...(0,I.YW)(s??[]),geometryType:o,name:n,namespaceUri:i,spatialReference:c,swapXY:p},m=(0,I.mG)(this.wfsCapabilities.readFeatureTypes(),y.name,y.namespaceUri),h=d.gy.toJSON(y.geometryType),{operations:g}=this.wfsCapabilities,w=g.GetFeature.url,v=g.GetFeature.outputFormat;return{customParameters:r,featureType:m,fields:y.fields?.map(e=>e.toJSON())??[],geometryField:y.geometryField,geometryType:h,getFeatureUrl:w,getFeatureOutputFormat:v,maxRecordCount:a,maxPageCount:l,maxTotalRecordCount:u,objectIdField:y.objectIdField,spatialReference:y.spatialReference?.toJSON(),swapXY:!!y.swapXY}}async _startWorker(e){const[t,r]=await(0,A.Lx)([this._createLoadOptions(e),(0,M.h)("WFSSourceWorker",{...e,strategy:(0,x.A)("feature-layers-workers")?"dedicated":"local",registryTarget:this})]),n=t.error||r.error||null,i=r.value||null;if(n)throw i&&i.close(),n;const s=t.value;this._connection=r.value,this._workerHandler=this._connection.createInvokeProxy();const o=await this._workerHandler.load(s,e);for(const e of o.warnings)S.A.getLogger(this.layer).warn("#load()",`${e.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:e});this.sourceJSON={dateFieldsTimeReference:{timeZoneIANA:_.n$},extent:o.extent,fields:s.fields,geometryType:s.geometryType,objectIdField:s.objectIdField,geometryField:s.geometryField,drawingInfo:(0,F.F0)(s.geometryType),name:s.featureType.title,wfsInfo:{name:s.featureType.name,featureUrl:s.getFeatureUrl,maxFeatures:s.maxRecordCount,swapXY:s.swapXY,supportedSpatialReferences:s.featureType.supportedSpatialReferences,version:"2.0.0",wfsNamespace:s.featureType.namespaceUri}}}};(0,n.Cg)([(0,l.MZ)()],O.prototype,"capabilities",void 0),(0,n.Cg)([(0,l.MZ)({constructOnly:!0})],O.prototype,"layer",void 0),(0,n.Cg)([(0,l.MZ)()],O.prototype,"sourceJSON",void 0),(0,n.Cg)([(0,l.MZ)()],O.prototype,"type",void 0),(0,n.Cg)([(0,l.MZ)()],O.prototype,"wfsCapabilities",void 0),O=(0,n.Cg)([(0,l.$K)("esri.layers.graphics.sources.WFSSource")],O);var E,j=r(63074),Z=r(69208),N=r(6455),k=r(87718),U=r(56658),D=r(16131),G=r(32756),$=r(8303),L=r(54310),q=r(25036),z=r(82935),J=r(10873),B=r(15426),V=r(20437),H=r(17036),Y=r(30524),W=r(46499),K=r(39383),Q=r(41214),X=r(61956),ee=r(30291),te=r(56400),re=r(43937);const ne=(0,H.p)();let ie=E=class extends((0,G.fY)((0,N.FJ)((0,Z.d)((0,U.J)((0,k.F)((0,j.dM)((0,L.J)((0,q.j)((0,D.q)((0,$.A)((0,s.M)(b.A)))))))))))){static fromWFSLayerInfo(e){const{customParameters:t,fields:r,geometryField:n,geometryType:i,name:s,namespaceUri:o,objectIdField:a,spatialReference:l,swapXY:u,url:p,wfsCapabilities:c}=e;return new E({customParameters:t,fields:r,geometryField:n,geometryType:i,name:s,namespaceUri:o,objectIdField:a,spatialReference:l,swapXY:u,url:p,wfsCapabilities:c})}constructor(e){super(e),this.copyright=null,this.customParameters=null,this.dateFieldsTimeZone=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.featureUrl=void 0,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.graphicOrigin=new v(this),this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="WFS",this.maxRecordCount=3e3,this.maxPageCount=10,this.maxTotalRecordCount=2e5,this.mode=0,this.name=null,this.namespaceUri=null,this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new O({layer:this}),this.spatialReference=c.A.WGS84,this.spatialReferences=[4326],this.swapXY=void 0,this.title="WFS",this.type="wfs",this.url=null,this.useViewTime=!0,this.version=void 0}destroy(){this.source?.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WFS"]},e).then(()=>this.source.load(e)).then(()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),["objectIdField","fields","spatialReference","name","namespaceUri"].forEach(e=>this.revertToOrigin(e,"service")),(0,Y.yp)(this.renderer,this.fieldsIndex)})),Promise.resolve(this)}get capabilities(){return this.source?.capabilities}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}writeFields(e,t,r){const n=e.filter(e=>e.name!==I.i5);this.geometryField&&n.unshift(new V.A({name:this.geometryField,alias:this.geometryField,type:"geometry"})),(0,o.sM)(r,n.map(e=>e.toJSON()),t)}get parsedUrl(){return(0,a.An)(this.url)}set renderer(e){(0,Y.yp)(e,this.fieldsIndex),this._set("renderer",e)}get wfsCapabilities(){return this.source?.wfsCapabilities}set wfsCapabilities(e){this.source&&(this.source.wfsCapabilities=e)}createPopupTemplate(e){return(0,ee.tn)(this,e)}createQuery(){return new X.A({returnGeometry:!0,outFields:["*"],where:this.definitionExpression||"1=1"})}getFieldDomain(e,t){return this.getField(e)?.domain}getField(e){return this.fieldsIndex?.get(e)}queryFeatures(e,t){return this.load().then(()=>this.source.queryFeatures(X.A.from(e)||this.createQuery(),t)).then(e=>{if(e?.features)for(const t of e.features)t.layer=t.sourceLayer=this,t.origin=this.graphicOrigin;return e})}queryObjectIds(e,t){return this.load().then(()=>this.source.queryObjectIds(X.A.from(e)||this.createQuery(),t))}queryFeatureCount(e,t){return this.load().then(()=>this.source.queryFeatureCount(X.A.from(e)||this.createQuery(),t))}queryExtent(e,t){return this.load().then(()=>this.source.queryExtent(X.A.from(e)||this.createQuery(),t))}async queryAttributeBins(e,t){const{source:n,capabilities:i}=await this.load();(0,B.ZJ)(e,i,"WFSLayer");const s=await r.e(4575).then(r.bind(r,14575)),o=await n.queryAttributeBins(s.default.from(e),t);if(o.features)for(const e of o.features)e.layer=e.sourceLayer=this;return o}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh();return null!=t&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};(0,n.Cg)([(0,l.MZ)({readOnly:!0})],ie.prototype,"capabilities",null),(0,n.Cg)([(0,l.MZ)({type:String})],ie.prototype,"copyright",void 0),(0,n.Cg)([(0,l.MZ)({readOnly:!0})],ie.prototype,"createQueryVersion",null),(0,n.Cg)([(0,l.MZ)({json:{name:"wfsInfo.customParameters",write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0),ignoreOrigin:!0})}}})],ie.prototype,"customParameters",void 0),(0,n.Cg)([(0,l.MZ)((0,te.P6)("dateFieldsTimeReference"))],ie.prototype,"dateFieldsTimeZone",void 0),(0,n.Cg)([(0,l.MZ)({readOnly:!0})],ie.prototype,"defaultPopupTemplate",null),(0,n.Cg)([(0,l.MZ)({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],ie.prototype,"definitionExpression",void 0),(0,n.Cg)([(0,l.MZ)({type:String})],ie.prototype,"displayField",void 0),(0,n.Cg)([(0,l.MZ)(J.Yj)],ie.prototype,"elevationInfo",void 0),(0,n.Cg)([(0,l.MZ)({type:String,readOnly:!0,json:{name:"wfsInfo.featureUrl",write:{ignoreOrigin:!0,isRequired:!0}}})],ie.prototype,"featureUrl",void 0),(0,n.Cg)([(0,l.MZ)({type:[V.A],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],ie.prototype,"fields",void 0),(0,n.Cg)([(0,re.K)("fields")],ie.prototype,"writeFields",null),(0,n.Cg)([(0,l.MZ)(ne.fieldsIndex)],ie.prototype,"fieldsIndex",void 0),(0,n.Cg)([(0,l.MZ)({type:p.A,json:{name:"extent"}})],ie.prototype,"fullExtent",void 0),(0,n.Cg)([(0,l.MZ)()],ie.prototype,"geometryField",void 0),(0,n.Cg)([(0,l.MZ)({type:String,json:{read:{source:"layerDefinition.geometryType",reader:d.gy.read},write:{target:"layerDefinition.geometryType",writer:d.gy.write,ignoreOrigin:!0},origins:{service:{read:d.gy.read}}}})],ie.prototype,"geometryType",void 0),(0,n.Cg)([(0,l.MZ)({readOnly:!0,clonable:!1})],ie.prototype,"graphicOrigin",void 0),(0,n.Cg)([(0,l.MZ)({type:String})],ie.prototype,"id",void 0),(0,n.Cg)([(0,l.MZ)(J.kF)],ie.prototype,"labelsVisible",void 0),(0,n.Cg)([(0,l.MZ)({type:[W.A],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:K.w},write:!0}})],ie.prototype,"labelingInfo",void 0),(0,n.Cg)([(0,l.MZ)(J.fV)],ie.prototype,"legendEnabled",void 0),(0,n.Cg)([(0,l.MZ)({type:["show","hide"]})],ie.prototype,"listMode",void 0),(0,n.Cg)([(0,l.MZ)({type:String})],ie.prototype,"objectIdField",void 0),(0,n.Cg)([(0,l.MZ)({type:["WFS"]})],ie.prototype,"operationalLayerType",void 0),(0,n.Cg)([(0,l.MZ)({type:u.jz,json:{name:"wfsInfo.maxFeatures",write:{ignoreOrigin:!0,isRequired:!0}}})],ie.prototype,"maxRecordCount",void 0),(0,n.Cg)([(0,l.MZ)({type:u.jz})],ie.prototype,"maxPageCount",void 0),(0,n.Cg)([(0,l.MZ)({type:u.jz})],ie.prototype,"maxTotalRecordCount",void 0),(0,n.Cg)([(0,l.MZ)({type:[0],readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],ie.prototype,"mode",void 0),(0,n.Cg)([(0,l.MZ)({type:String,json:{name:"wfsInfo.name",write:{ignoreOrigin:!0,isRequired:!0}}})],ie.prototype,"name",void 0),(0,n.Cg)([(0,l.MZ)({type:String,json:{name:"wfsInfo.wfsNamespace",write:{ignoreOrigin:!0,isRequired:!0}}})],ie.prototype,"namespaceUri",void 0),(0,n.Cg)([(0,l.MZ)(J.Ih)],ie.prototype,"opacity",void 0),(0,n.Cg)([(0,l.MZ)(ne.outFields)],ie.prototype,"outFields",void 0),(0,n.Cg)([(0,l.MZ)({readOnly:!0})],ie.prototype,"parsedUrl",null),(0,n.Cg)([(0,l.MZ)(J.M6)],ie.prototype,"popupEnabled",void 0),(0,n.Cg)([(0,l.MZ)({type:i.A,json:{name:"popupInfo",write:!0}})],ie.prototype,"popupTemplate",void 0),(0,n.Cg)([(0,l.MZ)({types:Q.Hg,json:{origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:Q.XJ,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:{ignoreOrigin:!0}}})],ie.prototype,"renderer",null),(0,n.Cg)([(0,l.MZ)(J.PY)],ie.prototype,"screenSizePerspectiveEnabled",void 0),(0,n.Cg)([(0,l.MZ)({readOnly:!0})],ie.prototype,"source",void 0),(0,n.Cg)([(0,l.MZ)({type:c.A,json:{name:"layerDefinition.spatialReference",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"extent.spatialReference"}}}})],ie.prototype,"spatialReference",void 0),(0,n.Cg)([(0,l.MZ)({readOnly:!0,type:[u.jz],json:{name:"wfsInfo.supportedSpatialReferences",write:{ignoreOrigin:!0,isRequired:!0}}})],ie.prototype,"spatialReferences",void 0),(0,n.Cg)([(0,l.MZ)({type:Boolean,value:!1,json:{name:"wfsInfo.swapXY",write:{ignoreOrigin:!0,isRequired:!0}}})],ie.prototype,"swapXY",void 0),(0,n.Cg)([(0,l.MZ)({json:{write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"name"}}}})],ie.prototype,"title",void 0),(0,n.Cg)([(0,l.MZ)({json:{read:!1},readOnly:!0})],ie.prototype,"type",void 0),(0,n.Cg)([(0,l.MZ)(J.OZ)],ie.prototype,"url",void 0),(0,n.Cg)([(0,l.MZ)(z.B)],ie.prototype,"useViewTime",void 0),(0,n.Cg)([(0,l.MZ)({type:String,readOnly:!0,json:{name:"wfsInfo.version",write:{ignoreOrigin:!0,isRequired:!0}}})],ie.prototype,"version",void 0),(0,n.Cg)([(0,l.MZ)()],ie.prototype,"wfsCapabilities",null),ie=E=(0,n.Cg)([(0,l.$K)("esri.layers.WFSLayer")],ie);const se=ie},99352(e,t,r){r.d(t,{F:()=>n,P:()=>i});const n={supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!0,supportedSpatialAggregationStatistics:{envelope:!0,centroid:!0,convexHull:!0},supportsCentroid:!0,supportsCentroidOnDegeneratedQuantizedGeometry:!0,supportsCacheHint:!0,supportsCurrentUser:!1,supportsDegeneratedQuantizedGeometry:!1,supportsDistance:!0,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsPaginationOnAggregatedQueries:!1,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!0,supportsReturnMesh:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!0,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsFormatPBFWithCurves:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,maxUniqueIDCount:void 0,relativeTimeBinWindow:0,standardMaxRecordCount:void 0,standardMaxRecordCountNoGeometry:void 0,tileMaxRecordCount:void 0,supportsTrueCurve:!1},i={supportsDate:!0,supportsFixedInterval:!0,supportsAutoInterval:!0,supportsFixedBoundaries:!0,supportsStackBy:!0,supportsSplitBy:!0,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!0,supportedStatistics:{count:!0,sum:!0,avg:!0,var:!0,stddev:!0,min:!0,max:!0,percentileContinuous:!0,percentileDiscrete:!0,envelope:!0,centroid:!0,convexHull:!0},supportedNormalizationTypes:{field:!0,log:!0,naturalLog:!0,percentOfTotal:!0,squareRoot:!0}}},85113(e,t,r){r.d(t,{BM:()=>A,bd:()=>M,sO:()=>S,xD:()=>c});var n=r(67482),i=r(49186),s=r(21325),o=r(90708),a=r(43334),l=r(92722),u=r(30524);const p={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function c(e){return p[e]}function*d(e){switch(e.type){case"Feature":yield e;break;case"FeatureCollection":for(const t of e.features)t&&(yield t)}}function*f(e){if(e)switch(e.type){case"Point":yield e.coordinates;break;case"LineString":case"MultiPoint":yield*e.coordinates;break;case"MultiLineString":case"Polygon":for(const t of e.coordinates)yield*t;break;case"MultiPolygon":for(const t of e.coordinates)for(const e of t)yield*e}}function y(e){for(const t of e)if(t.length>2)return!0;return!1}function m(e){let t=0;for(let r=0;r<e.length;r++){const n=e[r],i=e[(r+1)%e.length];t+=n[0]*i[1]-i[0]*n[1]}return t<=0}function h(e){const t=e[0],r=e[e.length-1];t[0]===r[0]&&t[1]===r[1]&&t[2]===r[2]||e.push(t)}function g(e,t){const{coordinates:r,type:n}=e,i=t.hasZ??!1,s=!0;switch(n){case"Point":return new l.A([],[...r],i,!1);case"LineString":return(0,o.Ap)({paths:[r],hasZ:s},i,!1);case"MultiLineString":return(0,o.Ap)({paths:r,hasZ:s},i,!1);case"MultiPoint":return(0,o.PR)({points:r,hasZ:s},i,!1);case"Polygon":case"MultiPolygon":{const e=new l.A([],[],i,!1);for(const t of"Polygon"===n?[r]:r){w(e,t[0],i);for(let r=1;r<t.length;r++)v(e,t[r],i)}return e}}}function w(e,t,r){h(t),function(e){return!m(e)}(t)?T(e,t,r):b(e,t,r)}function v(e,t,r){h(t),function(e){return m(e)}(t)?T(e,t,r):b(e,t,r)}function b(e,t,r){for(const n of t)x(e,n,r);e.lengths.push(t.length)}function T(e,t,r){for(let n=t.length-1;n>=0;n--)x(e,t[n],r);e.lengths.push(t.length)}function x(e,[t,r,n],i){e.coords.push(t,r),i&&e.coords.push(n||0)}function C(e){switch(typeof e){case"string":return(0,n.Br)(e)?"esriFieldTypeDate":"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function S(e,t=4326){if(!e)throw new i.A("geojson-layer:empty","GeoJSON data is empty");if("Feature"!==e.type&&"FeatureCollection"!==e.type)throw new i.A("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:e});const{crs:r}=e;if(!r)return;const n="string"==typeof r?r:"name"===r.type?r.properties.name:"EPSG"===r.type?r.properties.code:null,o=(0,s.oT)({wkid:t})?new RegExp(".*(CRS84H?|4326)$","i"):new RegExp(`.*(${t})$`,"i");if(!n||!o.test(n))throw new i.A("geojson:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:r})}function A(e,t={}){const r=[],n=new Set,i=new Set;let s,o=!1,a=null,l=!1,{geometryType:p=null}=t;for(const t of d(e)){const{geometry:e,properties:d,id:m}=t;if((!e||(p||(p=c(e.type)),c(e.type)===p))&&(o||(o=y(f(e))),l||(l=null!=m,l&&(s=typeof m,d&&(a=Object.keys(d).filter(e=>d[e]===m)))),d&&a&&l&&null!=m&&(a.length>1?a=a.filter(e=>d[e]===m):1===a.length&&(a=d[a[0]]===m?a:[])),d))for(const e in d){if(n.has(e))continue;const t=C(d[e]);if("unknown"===t){i.add(e);continue}i.delete(e),n.add(e);const s=(0,u.rS)(e);s&&r.push({name:s,alias:e,type:t})}}const m=(0,u.rS)(1===a?.length&&a[0]||null)??void 0;if(m)for(const e of r)if(e.name===m&&(0,u.WA)(e)){e.type="esriFieldTypeOID";break}return{fields:r,geometryType:p,hasZ:o,objectIdFieldName:m,objectIdFieldType:s,unknownFields:Array.from(i)}}function M(e,t){return Array.from(function*(e,t={}){const{geometryType:r,objectIdField:n}=t;for(const i of e){const{geometry:e,properties:s,id:o}=i;if(e&&c(e.type)!==r)continue;const l=s||{};let u;n&&(u=l[n],null==o||u||(l[n]=u=o)),yield new a.Om(e&&g(e,t),l,null,u)}}(d(e),t))}},64714(e,t,r){r.d(t,{F0:()=>a,Vx:()=>p,e2:()=>d,f:()=>f});var n=r(44208),i=r(4718),s=r(99352),o=r(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 p(e,t){if((0,n.A)("esri-csp-restrictions"))return()=>({[t]:null,...e});try{let r=`this${c(t)} = null;`;for(const t in e)r+=`this${c(t)} = ${JSON.stringify(e[t])};`;const n=new Function(`\n return class AttributesClass$${u++} {\n constructor() {\n ${r};\n }\n }\n `)();return()=>new n}catch(r){return()=>({[t]:null,...e})}}function c(e){return l.test(e)?`.${e}`:`[${JSON.stringify(e)}]`}function d(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,i.o8)(e)}}]}function f(e,t){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:s.F,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins: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}}}},69208(e,t,r){r.d(t,{d:()=>s});var n=r(5482),i=r(91429);const s=e=>{const t=e;let r=class extends t{constructor(){super(...arguments),this.customParameters=null}};return(0,n.Cg)([(0,i.MZ)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],r.prototype,"customParameters",void 0),r=(0,n.Cg)([(0,i.$K)("esri.layers.mixins.CustomParametersMixin")],r),r}},6455(e,t,r){r.d(t,{FJ:()=>g,Dp:()=>w,KV:()=>v});var n=r(5482),i=r(93637),s=r(91429),o=r(89317),a=r(69540),l=r(7762),u=r(25482),p=r(83960),c=r(13069);const d={write:{overridePolicy:(e,t,r)=>({enabled:!r||"scale"===r.filterMode})}};let f=class extends((0,a.OU)(u.o)){constructor(e){super(e),this.id=(0,c.lk)(),this.maxScale=0,this.minScale=0,this.title="",this.where=null}};(0,n.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],f.prototype,"id",void 0),(0,n.Cg)([(0,s.MZ)({type:Number,json:d})],f.prototype,"maxScale",void 0),(0,n.Cg)([(0,s.MZ)({type:Number,json:d})],f.prototype,"minScale",void 0),(0,n.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],f.prototype,"title",void 0),(0,n.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],f.prototype,"where",void 0),f=(0,n.Cg)([(0,s.$K)("esri.layers.support.DisplayFilter")],f);var y=r(41560),m=r(43937);let h=class extends((0,a.OU)(u.o)){constructor(e){super(e),this.activeFilterId=null,this.filters=new(l.A.ofType(f)),this.mode="manual"}writeFilters(e,t,r,n){const i=e.toArray();"scale"===this.mode&&i.sort((e,t)=>{const r=(0,p.oW)(t.minScale,e.minScale),n=e.maxScale-t.maxScale;return 0===r?n:r}),t[r]=i.map(e=>e.toJSON(n))}write(e,t){return super.write(e,(0,y.mW)(this,t))}};(0,n.Cg)([(0,s.MZ)({type:String,json:{write:{overridePolicy:(e,t,r)=>({enabled:"manual"===r.filterMode,isRequired:!0})}}})],h.prototype,"activeFilterId",void 0),(0,n.Cg)([(0,s.MZ)({type:l.A.ofType(f),nonNullable:!0,json:{write:!0}})],h.prototype,"filters",void 0),(0,n.Cg)([(0,m.K)("filters")],h.prototype,"writeFilters",null),(0,n.Cg)([(0,s.MZ)({type:["manual","scale"],nonNullable:!0,json:{name:"filterMode",write:!0}})],h.prototype,"mode",void 0),h=(0,n.Cg)([(0,s.$K)("esri.layers.support.DisplayFilterInfo")],h);const g=e=>{const t=e;let r=class extends t{constructor(){super(...arguments),this.displayFilterEnabled=!0,this.displayFilterInfo=null}};return(0,n.Cg)([(0,s.MZ)(w)],r.prototype,"displayFilterEnabled",void 0),(0,n.Cg)([(0,s.MZ)(v)],r.prototype,"displayFilterInfo",void 0),r=(0,n.Cg)([(0,s.$K)("esri.layers.mixins.DisplayFilteredLayer")],r),r},w={type:Boolean,json:{name:"layerDefinition.disableDisplayFilter",read:{reader:e=>!e},write:{layerContainerTypes:o.K,writer(e,t,r){(0,i.sM)(r,!e,t)}},origins:{"web-scene":{write:!1,read:!1}}}},v={type:h,json:{name:"layerDefinition.displayFilterInfo",write:{enabled:!0,allowNull:!0,layerContainerTypes:o.K},origins:{"web-scene":{write:!1,read:!1}}}}},32756(e,t,r){r.d(t,{Rr:()=>a,fY:()=>u,ne:()=>l});var n=r(5482),i=r(93637),s=r(91429),o=r(91880);function a(e,t,r){if(!e)return null;const n=e.find(e=>!!e.field);if(!n)return null;const i=new o.A;return i.read(n,r),[i]}const l={type:[o.A],json:{origins:{"web-scene":{write:!1,read:!1}},name:"layerDefinition.orderBy",read:{reader:a},write:{writer:function(e,t,r,n){const s=e.find(e=>!!e.field);s&&(0,i.sM)(r,[s.toJSON()],t)}}}},u=e=>{const t=e;let r=class extends t{constructor(){super(...arguments),this.orderBy=null}};return(0,n.Cg)([(0,s.MZ)(l)],r.prototype,"orderBy",void 0),r=(0,n.Cg)([(0,s.$K)("esri.layers.mixins.OrderedLayer")],r),r}},8303(e,t,r){r.d(t,{A:()=>T});var n=r(5482),i=r(92602),s=r(70333),o=r(11254),a=r(60999),l=r(49186),u=r(53966),p=r(97768),c=r(17676),d=r(84952),f=r(91429),y=r(77548),m=r(20655),h=r(80812),g=r(41318),w=r(10407),v=r(36005),b=r(43937);const T=e=>{const t=e;let T=class extends t{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,p.pR)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}get portalItem(){return this._get("portalItem")}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new h.default({id:t.itemId,portal:r?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{const{load:n}=await r.e(1204).then(r.bind(r,41204));return(0,c.Te)(t),await n({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t)}catch(e){throw(0,c.zf)(e)||u.A.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch(e=>((0,c.QP)(e),!0)))}async setUserPrivileges(e,t){if(!i.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:r,fullEdit:n},content:{updateItem:i}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",n),this._set("userHasUpdateItemPrivileges",i)}catch(e){(0,c.QP)(e)}}async _fetchUserPrivileges(e,t){let r=this.portalItem;if(!e||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(t);const n=!s.id?.findCredential(this.url),i=e===r.id;if(i&&r.portal.user)return this._getUserPrivileges(r,n);let o,a;if(i)o=r.portal.url;else try{o=await(0,y.wI)(this.url,t)}catch(e){(0,c.QP)(e)}if(!o||!(0,d.b8)(o,r.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;a=await(s.id?.getCredential(`${o}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,c.QP)(e)}const l=!0,u=!1,p=!1;if(!a)return{features:{edit:l,fullEdit:u},content:{updateItem:p}};try{if(i?await r.reload():(r=new h.default({id:e,portal:{url:o}}),await r.load(t)),r.portal.user)return this._getUserPrivileges(r,n)}catch(e){(0,c.QP)(e)}return{features:{edit:l,fullEdit:u},content:{updateItem:p}}}_getUserPrivileges(e,t){const r=(0,w.It)(e);return t&&(r.features.edit=!0),r}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,c.QP)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?s.id?.findCredential(this.url):null;if(!t)return!0;const r=x.credential===t?x.user:await this._fetchEditingUser(e);return x.credential=t,x.user=r,null==r?.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const r=s.id?.findServerInfo(this.url??"");if(!r?.owningSystemUrl)return null;const n=`${r.owningSystemUrl}/sharing/rest`,i=m.A.getDefault();if(i&&i.loaded&&(0,d.S8)(i.restUrl)===(0,d.S8)(n))return i.user;const l=`${n}/community/self`,u=null!=e?e.signal:null,p=await(0,a.Ke)((0,o.A)(l,{authMode:"no-prompt",query:{f:"json"},signal:u}));return p.ok?g.A.fromJSON(p.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t?.portal,n=this.portalItem?.id&&(this.portalItem.portal||m.A.getDefault());return r&&n&&!(0,d.ut)(n.restUrl,r.restUrl)?(t.messages&&t.messages.push(new l.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,n.Cg)([(0,f.MZ)({type:h.default})],T.prototype,"portalItem",null),(0,n.Cg)([(0,v.w)("web-document","portalItem",["itemId"])],T.prototype,"readPortalItem",null),(0,n.Cg)([(0,b.K)("web-document","portalItem",{itemId:{type:String}})],T.prototype,"writePortalItem",null),(0,n.Cg)([(0,f.MZ)({clonable:!1})],T.prototype,"resourceReferences",void 0),(0,n.Cg)([(0,f.MZ)({type:Boolean,readOnly:!0})],T.prototype,"userHasEditingPrivileges",void 0),(0,n.Cg)([(0,f.MZ)({type:Boolean,readOnly:!0})],T.prototype,"userHasFullEditingPrivileges",void 0),(0,n.Cg)([(0,f.MZ)({type:Boolean,readOnly:!0})],T.prototype,"userHasUpdateItemPrivileges",void 0),T=(0,n.Cg)([(0,f.$K)("esri.layers.mixins.PortalLayer")],T),T},x={credential:null,user:null}},82935(e,t,r){r.d(t,{B:()=>d,e:()=>f});var n=r(5482),i=r(91429),s=r(89317),o=r(30524),a=r(96184),l=r(73133),u=r(79677),p=r(10184),c=r(36005);const d={type:Boolean,json:{read:{source:"timeAnimation"},write:{target:"timeAnimation",layerContainerTypes:s.K}}},f=e=>{const t=e;let r=class extends t{constructor(){super(...arguments),this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0}readOffset(e,t){const r=t.timeInfo.exportOptions;if(!r)return null;const n=r.timeOffset,i=l.j.fromJSON(r.timeOffsetUnits);return n&&i?new p.A({value:n,unit:i}):null}get timeInfo(){return this._get("timeInfo")}set timeInfo(e){(0,o.sv)(e,this.fieldsIndex),this._set("timeInfo",e)}};return(0,n.Cg)([(0,i.MZ)({type:u.A,json:{write:!1}})],r.prototype,"timeExtent",void 0),(0,n.Cg)([(0,i.MZ)({type:p.A})],r.prototype,"timeOffset",void 0),(0,n.Cg)([(0,c.w)("service","timeOffset",["timeInfo.exportOptions"])],r.prototype,"readOffset",null),(0,n.Cg)([(0,i.MZ)({value:null,type:a.A,json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],r.prototype,"timeInfo",null),(0,n.Cg)([(0,i.MZ)(d)],r.prototype,"useViewTime",void 0),r=(0,n.Cg)([(0,i.$K)("esri.layers.mixins.TemporalLayer")],r),r}},34322(e,t,r){r.d(t,{E:()=>Z,Fu:()=>x,O8:()=>I,UH:()=>D,YW:()=>R,i5:()=>v,mG:()=>F,x$:()=>E});var n=r(11254),i=r(49186),s=r(5479),o=r(84952),a=r(5443),l=r(91218),u=r(16930),p=r(21325),c=r(50498),d=r(85113),f=r(13043),y=r(60694),m=r(20437),h=r(30524);const g="xlink:href",w="2.0.0",v="__esri_wfs_id__",b="wfs-layer:feature-type-not-found",T="wfs-layer:unknown-geometry-type";async function x(e,t){const r=function(e){const t=N(e);(function(e){const t=e.firstElementChild?.getAttribute("version");if(t&&t!==w)throw new i.A("wfs-layer:unsupported-wfs-version",`Unsupported WFS version ${t}. Supported version: ${w}`)})(t),U(t);const r=t.firstElementChild,n=(0,s.PP)(function(e){return(0,f.i)(e,{FeatureTypeList:{FeatureType:e=>{const t={typeName:"undefined:undefined",name:"",title:"",description:"",extent:null,namespacePrefix:"",namespaceUri:"",defaultSpatialReference:4326,supportedSpatialReferences:[]},r=new Set;return(0,f.p)(e,{Name:e=>{const{name:r,prefix:n}=k(e.textContent);t.typeName=`${n}:${r}`,t.name=r,t.namespacePrefix=n,t.namespaceUri=e.lookupNamespaceURI(n)},Abstract:e=>{t.description=e.textContent},Title:e=>{t.title=e.textContent},WGS84BoundingBox:e=>{t.extent=a.A.fromJSON(function(e){let t,r,n,i;for(const s of e.children)switch(s.localName){case"LowerCorner":[t,r]=s.textContent.split(" ").map(e=>Number.parseFloat(e));break;case"UpperCorner":[n,i]=s.textContent.split(" ").map(e=>Number.parseFloat(e))}return{xmin:t,ymin:r,xmax:n,ymax:i,spatialReference:p.KK}}(e))},DefaultCRS:e=>{const n=M(e);n&&(t.defaultSpatialReference=n,r.add(n))},OtherCRS:e=>{const t=M(e);t&&r.add(t)}}),t.title||(t.title=t.name),r.add(4326),t.supportedSpatialReferences.push(...r),t}}})}(r));return{operations:A(r),get featureTypes(){return Array.from(n())},readFeatureTypes:n}}((await(0,n.A)(e,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"GetCapabilities",VERSION:w,...t?.customParameters},signal:t?.signal})).data);return function(e,t){(0,o.m3)(e)&&((0,o.FX)(e,t.operations.DescribeFeatureType.url,!0)&&(t.operations.DescribeFeatureType.url=(0,o.lM)(t.operations.DescribeFeatureType.url)),(0,o.FX)(e,t.operations.GetFeature.url,!0)&&(t.operations.GetFeature.url=(0,o.lM)(t.operations.GetFeature.url)))}(e,r),r}const C=["json","application/json; subtype=geojson; charset=utf-8","application/json; subtype=geojson","application/json","geojson","application/geo+json"];function S(e){for(const t of C){const r=e.findIndex(e=>e.toLowerCase()===t);if(r>=0)return e[r]}return null}function A(e){let t=!0;const r={GetCapabilities:{url:""},DescribeFeatureType:{url:""},GetFeature:{url:"",outputFormat:null,supportsPagination:!1}},n=[],s=[];if((0,f.p)(e,{OperationsMetadata:{Parameter:e=>{if("outputformat"===e.getAttribute("name")?.toLowerCase())return{AllowedValues:{Value:({textContent:e})=>{e&&n.push(e)}}}},Operation:e=>{switch(e.getAttribute("name")){case"GetCapabilities":return{DCP:{HTTP:{Get:e=>{r.GetCapabilities.url=e.getAttribute(g)}}}};case"DescribeFeatureType":return{DCP:{HTTP:{Get:e=>{r.DescribeFeatureType.url=e.getAttribute(g)}}}};case"GetFeature":return{DCP:{HTTP:{Get:e=>{r.GetFeature.url=e.getAttribute(g)}}},Parameter:e=>{if("outputformat"===e.getAttribute("name")?.toLowerCase())return{AllowedValues:{Value:({textContent:e})=>{e&&s.push(e)}}}}}}},Constraint:e=>{switch(e.getAttribute("name")){case"KVPEncoding":return{DefaultValue:e=>{t="true"===e.textContent.toLowerCase()}};case"ImplementsResultPaging":return{DefaultValue:e=>{r.GetFeature.supportsPagination="true"===e.textContent.toLowerCase()}}}}}}),r.GetFeature.outputFormat=S(s)??S(n),!t)throw new i.A("wfs-layer:kvp-encoding-not-supported","WFS service doesn't support key/value pair (KVP) encoding");if(null==r.GetFeature.outputFormat)throw new i.A("wfs-layer:geojson-not-supported","WFS service doesn't support GeoJSON output format");return r}function M(e){const t=parseInt(e.textContent?.match(/(?<wkid>\d+$)/i)?.groups?.wkid??"",10);if(!Number.isNaN(t))return t}function F(e,t,r){return(0,s.I6)(e,e=>r?e.name===t&&e.namespaceUri===r:e.typeName===t||e.name===t)}async function I(e,t,r,n={}){const{featureType:s,extent:o}=await async function(e,t,r,n={}){const s=e.readFeatureTypes(),o=t?F(s,t,r):s.next().value,{spatialReference:a=new u.A({wkid:o?.defaultSpatialReference})}=n;if(null==o)throw t?new i.A(b,`The type '${t}' could not be found in the service`):new i.A("wfs-layer:empty-service","The service is empty");let c=o.extent;if(c&&!(0,p.aI)(c.spatialReference,a))try{await(0,l.initializeProjection)(c.spatialReference,a,void 0,n),c=(0,l.project)(c,a)}catch{throw new i.A("wfs-layer:unsupported-spatial-reference","Projection not supported")}return{extent:c,spatialReference:a,featureType:o}}(e,t,r,n),{spatialReference:a}=D(e.operations.GetFeature.url,s,n.spatialReference),{fields:c,geometryType:d,swapXY:f,objectIdField:y,geometryField:m}=await async function(e,t,r,n={}){const{typeName:s}=t,[o,a]=await Promise.allSettled([_(e.operations.DescribeFeatureType.url,s,n),P(e,s,r,n)]),l=e=>new i.A("wfs-layer:getWFSLayerTypeInfo-error",`An error occurred while getting info about the feature type '${s}'`,{error:e});if("rejected"===o.status)throw l(o.reason);if("rejected"===a.status)throw l(a.reason);const{fields:u,errors:p}=o.value??{},c=o.value?.geometryType||a.value?.geometryType,d=a.value?.swapXY??!1;if(null==c)throw new i.A(T,`The geometry type could not be determined for type '${s}`,{typeName:s,geometryType:c,fields:u,errors:p});return{...R(u??[]),geometryType:c,swapXY:d}}(e,s,a,n);return{url:e.operations.GetCapabilities.url,name:s.name,namespaceUri:s.namespaceUri,fields:c,geometryField:m,geometryType:d,objectIdField:y,spatialReference:n.spatialReference??new u.A({wkid:s.defaultSpatialReference}),extent:o,swapXY:f,wfsCapabilities:e,customParameters:n.customParameters}}function R(e){const t=e.find(e=>"geometry"===e.type);let r=e.find(e=>"oid"===e.type);return e=e.filter(e=>"geometry"!==e.type),r||(r=new m.A({name:v,type:"oid",alias:v}),e.unshift(r)),{geometryField:t?.name??null,objectIdField:r.name,fields:e}}async function P(e,t,r,i={}){let s,o=!1;const[a,l]=await Promise.all([E(e.operations.GetFeature.url,t,r,e.operations.GetFeature.outputFormat,{...i,count:1}),(0,n.A)(e.operations.GetFeature.url,{responseType:"text",query:j(t,r,void 0,{...i,count:1}),signal:i?.signal})]),u="FeatureCollection"===a.type&&a.features[0]?.geometry;if(u){let e;switch(s=c.gy.fromJSON((0,d.xD)(u.type)),u.type){case"Point":e=u.coordinates;break;case"LineString":case"MultiPoint":e=u.coordinates[0];break;case"MultiLineString":case"Polygon":e=u.coordinates[0][0];break;case"MultiPolygon":e=u.coordinates[0][0][0]}const t=/<[^>]*pos[^>]*> *(-?\d+(?:\.\d+)?) (-?\d+(?:\.\d+)?)/.exec(l.data);if(t){const r=e[0].toFixed(3),n=e[1].toFixed(3),i=parseFloat(t[1]).toFixed(3);r===parseFloat(t[2]).toFixed(3)&&n===i&&(o=!0)}}return{geometryType:s,swapXY:o}}async function _(e,t,r){return function(e,t){const{name:r}=k(e),n=N(t);U(n);const o=(0,s.I6)((0,f.i)(n.firstElementChild,{element:e=>e}),e=>e.getAttribute("name")===r);if(null!=o){const e=o.getAttribute("type"),t=e?(0,s.I6)((0,f.i)(n.firstElementChild,{complexType:e=>e}),t=>t.getAttribute("name")===k(e).name):(0,s.I6)((0,f.i)(o,{complexType:e=>e}),()=>!0);if(t)return function(e){const t=[],r=[];let n;const s=(0,f.i)(e,{complexContent:{extension:{sequence:{element:e=>e}}}});for(const o of s){const s=o.getAttribute("name");if(!s)continue;let a,l;if(o.hasAttribute("type")?a=k(o.getAttribute("type")).name:(0,f.p)(o,{simpleType:{restriction:e=>(a=k(e.getAttribute("base")).name,{maxLength:e=>{l=+e.getAttribute("value")}})}}),!a)continue;const u="true"===o.getAttribute("nillable");let p=!1;switch(a.toLowerCase()){case"integer":case"nonpositiveinteger":case"negativeinteger":case"long":case"int":case"short":case"byte":case"nonnegativeinteger":case"unsignedlong":case"unsignedint":case"unsignedshort":case"unsignedbyte":case"positiveinteger":r.push(new m.A({name:s,alias:s,type:"integer",nullable:u,length:(0,h._b)("integer")}));break;case"float":case"double":case"decimal":r.push(new m.A({name:s,alias:s,type:"double",nullable:u,length:(0,h._b)("double")}));break;case"boolean":case"string":case"gyearmonth":case"gyear":case"gmonthday":case"gday":case"gmonth":case"anyuri":case"qname":case"notation":case"normalizedstring":case"token":case"language":case"idrefs":case"entities":case"nmtoken":case"nmtokens":case"name":case"ncname":case"id":case"idref":case"entity":case"duration":case"time":r.push(new m.A({name:s,alias:s,type:"string",nullable:u,length:l??(0,h._b)("string")}));break;case"datetime":case"date":r.push(new m.A({name:s,alias:s,type:"date",nullable:u,length:l??(0,h._b)("date")}));break;case"pointpropertytype":n="point",p=!0;break;case"multipointpropertytype":n="multipoint",p=!0;break;case"curvepropertytype":case"multicurvepropertytype":case"multilinestringpropertytype":n="polyline",p=!0;break;case"surfacepropertytype":case"multisurfacepropertytype":case"multipolygonpropertytype":n="polygon",p=!0;break;case"geometrypropertytype":case"multigeometrypropertytype":p=!0,t.push(new i.A(T,`geometry type '${a}' is not supported`,{type:(new XMLSerializer).serializeToString(e)}));break;default:t.push(new i.A("wfs-layer:unknown-field-type",`Unknown field type '${a}'`,{type:(new XMLSerializer).serializeToString(e)}))}p&&r.push(new m.A({name:s,alias:s,type:"geometry",nullable:u}))}for(const e of r)if("integer"===e.type&&!e.nullable&&O.has(e.name.toLowerCase())){e.type="oid";break}return{geometryType:n,fields:r,errors:t}}(t)}throw new i.A(b,`Type '${e}' not found in document`,{document:(new XMLSerializer).serializeToString(n)})}(t,(await(0,n.A)(e,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"DescribeFeatureType",VERSION:w,TYPENAME:t,TYPENAMES:t,...r?.customParameters},signal:r?.signal})).data)}const O=new Set(["objectid","fid"]);async function E(e,t,r,s,o){let{data:a}=await(0,n.A)(e,{responseType:"text",query:j(t,r,s,o),signal:o?.signal});a=a.replaceAll(/": +(-?\d+),(\d+)(,)?/g,'": $1.$2$3');try{return JSON.parse(a)}catch(e){throw new i.A("wfs-layer:malformed-json","Error while parsing the response",{response:a,error:e})}}function j(e,t,r,n){const i="number"==typeof t?t:t.wkid;return{SERVICE:"WFS",REQUEST:"GetFeature",VERSION:w,TYPENAMES:e,OUTPUTFORMAT:r,SRSNAME:"EPSG:"+i,STARTINDEX:n?.startIndex,COUNT:n?.count,...n?.customParameters}}async function Z(e,t,r){const i=await(0,n.A)(e,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"GetFeature",VERSION:w,TYPENAMES:t,RESULTTYPE:"hits",...r?.customParameters},signal:r?.signal}),s=/numberMatched=["'](?<numberMatched>\d+)["']/gi.exec(i.data);if(s?.groups)return+s.groups.numberMatched}function N(e){return(new DOMParser).parseFromString(e.trim(),"text/xml")}function k(e){const[t,r]=e.split(":");return{prefix:r?t:"",name:r??t}}function U(e){let t="",r="";if((0,f.p)(e.firstElementChild,{Exception:e=>(t=e.getAttribute("exceptionCode"),{ExceptionText:e=>{r=e.textContent}})}),t)throw new i.A(`wfs-layer:${t}`,r)}function D(e,t,r){const n={wkid:t.defaultSpatialReference},i=null!=r?.wkid?{wkid:r.wkid}:n;return{spatialReference:i,getFeatureSpatialReference:(0,y.Fi)(e)||i.wkid&&t.supportedSpatialReferences.includes(i.wkid)?{wkid:i.wkid}:{wkid:t.defaultSpatialReference}}}},13043(e,t,r){function n(e,t){if(e&&t)for(const r of e.children)if(r.localName in t){const e=t[r.localName];if("function"==typeof e){const t=e(r);t&&n(r,t)}else n(r,e)}}function*i(e,t){for(const r of e.children)if(r.localName in t){const e=t[r.localName];"function"==typeof e?yield e(r):yield*i(r,e)}}r.d(t,{i:()=>i,p:()=>n})},91880(e,t,r){r.d(t,{A:()=>u});var n,i=r(5482),s=r(66552),o=r(25482),a=r(91429);const l=new s.J({asc:"ascending",desc:"descending"});let u=class extends o.o{static{n=this}constructor(e){super(e),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new n({field:this.field,valueExpression:this.valueExpression,order:this.order})}};(0,i.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],u.prototype,"field",void 0),(0,i.Cg)([(0,a.MZ)({type:String,json:{write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],u.prototype,"valueExpression",void 0),(0,i.Cg)([(0,a.MZ)({type:l.apiValues,json:{type:l.jsonValues,read:l.read,write:l.write}})],u.prototype,"order",void 0),u=n=(0,i.Cg)([(0,a.$K)("esri.layers.support.OrderByInfo")],u)},96184(e,t,r){r.d(t,{A:()=>f});var n=r(5482),i=r(69540),s=r(25482),o=r(91429),a=r(79677),l=r(10184),u=r(56400),p=r(36005),c=r(43937);function d(e,t){return l.A.fromJSON({value:e,unit:t})}let f=class extends((0,i.OU)(s.o)){constructor(e){super(e),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeZone=null,this.trackIdField=null,this.useTime=!0,this.stops=null}readFullTimeExtent(e,t){return t.timeExtent&&Array.isArray(t.timeExtent)&&2===t.timeExtent.length?a.A.fromArray(t.timeExtent):null}writeFullTimeExtent(e,t){null!=e?.start&&null!=e.end?t.timeExtent=e.toArray():t.timeExtent=null}readInterval(e,t){return t.timeInterval&&t.timeIntervalUnits?d(t.timeInterval,t.timeIntervalUnits):t.defaultTimeInterval&&t.defaultTimeIntervalUnits?d(t.defaultTimeInterval,t.defaultTimeIntervalUnits):null}writeInterval(e,t){t.timeInterval=e?.toJSON().value??null,t.timeIntervalUnits=e?.toJSON().unit??null}};(0,n.Cg)([(0,o.MZ)({type:Boolean,json:{name:"exportOptions.timeDataCumulative",write:!0}})],f.prototype,"cumulative",void 0),(0,n.Cg)([(0,o.MZ)({type:String,json:{name:"endTimeField",write:{enabled:!0,allowNull:!0}}})],f.prototype,"endField",void 0),(0,n.Cg)([(0,o.MZ)({type:a.A,json:{write:{enabled:!0,allowNull:!0}}})],f.prototype,"fullTimeExtent",void 0),(0,n.Cg)([(0,p.w)("fullTimeExtent",["timeExtent"])],f.prototype,"readFullTimeExtent",null),(0,n.Cg)([(0,c.K)("fullTimeExtent")],f.prototype,"writeFullTimeExtent",null),(0,n.Cg)([(0,o.MZ)({type:Boolean,json:{write:!0}})],f.prototype,"hasLiveData",void 0),(0,n.Cg)([(0,o.MZ)({type:l.A,json:{write:{enabled:!0,allowNull:!0}}})],f.prototype,"interval",void 0),(0,n.Cg)([(0,p.w)("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],f.prototype,"readInterval",null),(0,n.Cg)([(0,c.K)("interval")],f.prototype,"writeInterval",null),(0,n.Cg)([(0,o.MZ)({type:String,json:{name:"startTimeField",write:{enabled:!0,allowNull:!0}}})],f.prototype,"startField",void 0),(0,n.Cg)([(0,o.MZ)((0,u.P6)("timeReference",!0))],f.prototype,"timeZone",void 0),(0,n.Cg)([(0,o.MZ)({type:String,json:{write:{enabled:!0,allowNull:!0}}})],f.prototype,"trackIdField",void 0),(0,n.Cg)([(0,o.MZ)({type:Boolean,json:{name:"exportOptions.useTime",write:!0}})],f.prototype,"useTime",void 0),(0,n.Cg)([(0,o.MZ)({type:[Date],json:{read:!1}})],f.prototype,"stops",void 0),f=(0,n.Cg)([(0,o.$K)("esri.layers.support.TimeInfo")],f)},41560(e,t,r){r.d(t,{Ch:()=>o,mW:()=>s});var n=r(34727),i=r(39516);function s(e,t){return{...t,filterMode:e.mode}}function o(e,t,r){const s=function(e){if("manual"===u(e))return null;const t=[Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY];for(const{minScale:r,maxScale:n}of e.filters)t[0]=Math.max(t[0],p(r)),t[1]=Math.min(t[1],c(n));return t}(e);if(s&&((0,n.gg)(t,s[0])||(0,n.ZH)(r,s[1])))return"";const o=Array.from(a(e,t,r)),l=function(e,t,r){if(0===e.length)return!0;const i=p(e.at(0)?.minScale),s=c(e.at(-1)?.maxScale);if((0,n.ZH)(i,t)||(0,n.gg)(s,r))return!0;for(let t=0;t<e.length-1;t++){const r=e[t],i=e[t+1];if((0,n.ZH)(p(i.minScale),c(r.maxScale)))return!0}return!1}(o,t,r)?"1=1":o.map(e=>e.where||"1=1").reduce((e,t)=>(0,i.IW)(e,t),"");return l&&"1=1"!==l?l:""}function*a(e,t,r){if("manual"===u(e)){const t=e.filters.find(t=>t.id===e.activeFilterId);t&&(yield t)}else{"object"==typeof t&&(t=t.scale);for(const n of e.filters)l(n.minScale,n.maxScale,t,r)&&(yield n)}}function l(e,t,r,i){return e=p(e),r=p(r),t=c(t),!(!(0,n.Sp)(r,e)&&(i??r)>e||(0,n.Hx)(t,r)||void 0!==i&&(0,n.Sp)(i,e))}function u(e){return"mode"in e?e.mode:e.filterMode}function p(e){return e||Number.POSITIVE_INFINITY}function c(e){return e||0}},17036(e,t,r){r.d(t,{p:()=>l});var n=r(44208),i=r(53966),s=r(20437),o=r(95466),a=r(30524);function l(){return{fields:{type:[s.A],value:null,set:function(e){if(e&&(0,n.A)("big-integer-warning-enabled")){const t=e.filter(e=>"big-integer"===e.type||"oid"===e.type&&(e.length||0)>=8);if(t.length){const e=t.map(e=>`'${e.name}'`).join(", ");i.A.getLogger(this).warn("#fields",`Layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}') references big-integer field(s): ${e}, support for which is experimental. Only integers less than ${Number.MAX_SAFE_INTEGER} (Number.MAX_SAFE_INTEGER) are supported.`)}}this._set("fields",e)}},fieldsIndex:{readOnly:!0,get(){return o.A.fromLayer(this)}},outFields:{type:[String],json:{read:!1},set:function(e){this._userOutFields=e,this.notifyChange("outFields")},get:function(){const e=this._userOutFields;if(!e?.length)return null;if(e.includes("*"))return["*"];if(!this.fields)return e;for(const t of e){const r=this.fieldsIndex?.has(t);r||i.A.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${t} found in outFields`,{layer:this,outFields:e})}return(0,a.DB)(this.fieldsIndex,e)}}}}},32730(e,t,r){r.d(t,{BI:()=>f,D3:()=>c,XJ:()=>d,lc:()=>p,mX:()=>m,rU:()=>y,tH:()=>b});var n=r(799);const i="__begin__",s="__end__",o=new RegExp(i,"ig"),a=new RegExp(s,"ig"),l=new RegExp("^"+i,"i"),u=new RegExp(s+"$","i");function p(e){return e.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function c(e){return e.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function d(e){const t={expression:"",type:"none"};return e.labelExpressionInfo?e.labelExpressionInfo.value?(t.expression=e.labelExpressionInfo.value,t.type="conventional"):e.labelExpressionInfo.expression&&(t.expression=e.labelExpressionInfo.expression,t.type="arcade"):null!=e.labelExpression&&(t.expression=p(e.labelExpression),t.type="conventional"),t}function f(e){const t=d(e);if(!t)return null;switch(t.type){case"conventional":return m(t.expression);case"arcade":return t.expression}return null}function y(e){const t=d(e);if(!t)return null;switch(t.type){case"conventional":return function(e){const t=e?.match(h);return t?.[1].trim()||null}(t.expression);case"arcade":return b(t.expression)}return null}function m(e){let t;return e?(t=(0,n.HC)(e,e=>i+'$feature["'+e+'"]'+s),t=l.test(t)?t.replace(l,""):'"'+t,t=u.test(t)?t.replace(u,""):t+'"',t=t.replaceAll(o,'" + ').replaceAll(a,' + "')):t='""',t}const h=/^\s*\{([^}]+)\}\s*$/i,g=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,w=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,v=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function b(e){if(!e)return null;let t=g.exec(e)||w.exec(e);return t?t[1]||t[3]:(t=v.exec(e),t?t[2]:null)}},10407(e,t,r){r.d(t,{It:()=>f,LG:()=>o,OM:()=>u,Sm:()=>p,Y:()=>a,bK:()=>l,mm:()=>d,sQ:()=>c});var n=r(91218),i=r(16930),s=r(28735);function o(e,t){if(!a(e,t)){const r=e.typeKeywords;r?r.push(t):e.typeKeywords=[t]}}function a(e,t){return!!e.typeKeywords?.includes(t)}function l(e){return a(e,d.HOSTED_SERVICE)}function u(e,t){const r=e.typeKeywords;if(r){const e=r.indexOf(t);e>-1&&r.splice(e,1)}}function p(e,t,r){r?o(e,t):u(e,t)}async function c(e){const t=e.clone().normalize();let r;if(t.length>1)for(const e of t)r?e.width>r.width&&(r=e):r=e;else r=t[0];return async function(e){const t=e.spatialReference;if(t.isWGS84)return e.clone();if(t.isWebMercator)return(0,s.ci)(e);const r=i.A.WGS84;return await(0,n.initializeProjection)(t,r),(0,n.project)(e,r)}(r)}const d={CHARTS:"Charts",DYNAMIC:"Dynamic",DEVELOPER_BASEMAP:"DeveloperBasemap",GROUP_LAYER_MAP:"Map",HOSTED_SERVICE:"Hosted Service",JSAPI:"ArcGIS API for JavaScript",LOCAL_SCENE:"ViewingMode-Local",METADATA:"Metadata",MULTI_LAYER:"Multilayer",ORIENTED_IMAGERY_LAYER:"OrientedImageryLayer",SINGLE_LAYER:"Singlelayer",SUBTYPE_GROUP_LAYER:"SubtypeGroupLayer",SUBTYPE_GROUP_TABLE:"SubtypeGroupTable",TABLE:"Table",TILED_IMAGERY:"Tiled Imagery"};function f(e){const{portal:t,isOrgItem:r,itemControl:n}=e,i=t.user?.privileges;let s=!i||i.includes("features:user:edit"),o=!!r&&!!i?.includes("features:user:fullEdit");const a="update"===n||"admin"===n;return a?o=s=!0:o&&(s=!0),{features:{edit:s,fullEdit:o},content:{updateItem:a}}}},73681(e,t,r){r.d(t,{n:()=>l});var n=r(49186),i=r(53966),s=r(46140),o=r(95466),a=r(55674);class l{static async from(e,t,r){const o=e.dictionary_version?s.A.parse(e.dictionary_version):null,p=new Set(e.itemsNames),c={};if(t)for(const e in t)c[e]=t[e];if(e.authoringInfo.configuration)for(const t of e.authoringInfo.configuration)c.hasOwnProperty(t.name)||(c[t.name]=t.value);const d=new Set(e.authoringInfo.symbol);for(const e of Object.keys(r))d.delete(e);d.size&&i.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("missing-fields: fieldMap entries for the following symbol fields are missing",{symbolFields:d});const f=await(0,a.xR)(e.expression,null,c);if(!f)throw new n.A("dictionary-renderer:expression-error","Unable to create dictionary renderer expression");const y=!o||!o.greaterEqual(4,0);y&&i.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("Dictionary script does not support native field types. Applying fallback",{version:o});const m=new u(r,y);return new l(y,p,f,m)}constructor(e,t,r,n){this._requiresFieldCoercionToString=e,this._itemNames=t,this._compiled=r,this._reader=n}get itemNames(){return this._itemNames}evaluate(e,t,r,n){try{return this._reader.bind(e,r,n),this._compiled.evaluate(this._reader,{$view:{scale:t}})}catch(e){i.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("arcade: dictionary script evaluation failed",{error:e})}return null}createDictionaryFieldsIndex(e){if(!this._requiresFieldCoercionToString)return new o.A(e);const t=e.map(e=>({...e,type:"esriFieldTypeString"}));return new o.A(t)}}class u extends a.Gj{constructor(e,t){super(),this._fieldMap=e,this._requiresFieldCoercionToString=t}_getField(e){const t=this._fieldMap[e]??e;return this._boundSchema.fieldsIndex.get(t)}field(e){if(!this._requiresFieldCoercionToString)return super.field(e,!1);const t=this._getField(e);return null==t||null==this._boundTarget.attributes[t.name]?"":""+this._boundTarget.attributes[t.name]}}},61760(e,t,r){r.d(t,{PU:()=>o,YW:()=>l,ex:()=>i,hv:()=>a,zp:()=>s}),r(34727);var n=r(90629);r(78955),r(91829);const i=2.4;function s(e){return(0,n.PN)(e*i)}function o(e){return(0,n.Lz)(e)/i}function a(e,t,r){const n=Math.sqrt(e**2+t**2)/r;return n>1?0:3/(Math.PI*r**2)*(1-n**2)**2}function l(e){return"function"==typeof e?e:e?t=>+t[e]:()=>1}},37745(e,t,r){r.d(t,{A:()=>d});var n,i=r(5482),s=r(52106),o=r(4718),a=r(91429);let l=class extends s.A{static{n=this}constructor(e){super(e),this.stackedAttributes=null}cloneShallow(){return new n(Object.assign({stackedAttributes:this.stackedAttributes},super.cloneShallow()))}toJSON(){return{...super.toJSON(),stackedAttributes:(0,o.o8)(this.stackedAttributes)}}};(0,i.Cg)([(0,a.MZ)()],l.prototype,"stackedAttributes",void 0),l=n=(0,i.Cg)([(0,a.$K)("esri.AttributeBinsGraphic")],l);var u=r(69540),p=r(22671),c=r(36005);let d=class extends((0,u.OU)(p.A)){constructor(e){super(e),this.features=[]}readFeatures(e,t){return this.readFeaturesWithClass(e,t,l)}};(0,i.Cg)([(0,a.MZ)({type:[l],json:{write:!0}})],d.prototype,"features",void 0),(0,i.Cg)([(0,c.w)("features")],d.prototype,"readFeatures",null),d=(0,i.Cg)([(0,a.$K)("esri.rest.support.AttributeBinsFeatureSet")],d)},22671(e,t,r){r.d(t,{A:()=>w});var n,i=r(5482),s=r(52106),o=r(66552),a=r(25482),l=r(4718),u=r(91429),p=r(16930),c=r(60408),d=r(65864),f=r(50498),y=r(20437),m=r(36005),h=r(43937);const g=new o.J({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let w=n=class extends a.o{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){return this.readFeaturesWithClass(e,t,s.A)}writeGeometryType(e,t,r,n){if(e)return void g.write(e,t,r,n);const{features:i}=this;if(i)for(const e of i)if(null!=e?.geometry)return void g.write(e.geometry.type,t,r,n)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,n=(0,d.rS)(e);return n&&!r&&t.spatialReference&&(n.spatialReference=p.A.fromJSON(t.spatialReference)),n}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new n(this.cloneProperties())}cloneProperties(){return(0,l.o8)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const n=t.features[r];if(n.geometry){const t=e?.[r];n.geometry=t?.toJSON()||n.geometry}}return t}quantize(e){const{scale:[t,r],translate:[n,i]}=e,s=this.features,o=this._getQuantizationFunction(this.geometryType,e=>Math.round((e-n)/t),e=>Math.round((i-e)/r));for(let e=0,t=s.length;e<t;e++)o?.(s[e].geometry)||(s.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[n,i],scale:[s,o]}=r;let a=null,l=null;if(this.hasZ&&null!=r?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=r;a=r=>r*t+e}if(this.hasM&&null!=r?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=r;l=r=>null==r?r:r*t+e}const u=this._getHydrationFunction(e,e=>e*s+n,e=>i-e*o,a,l);for(const{geometry:e}of t)null!=e&&u&&u(e);return this.transform=null,this}readFeaturesWithClass(e,t,r){const n=p.A.fromJSON(t.spatialReference),i=[];for(let t=0;t<e.length;t++){const s=e[t],o=r.fromJSON(s),a=s.geometry?.spatialReference;null==o.geometry||a||(o.geometry.spatialReference=n);const l=s.aggregateGeometries,u=o.aggregateGeometries;if(l&&null!=u)for(const e in u){const t=u[e],r=l[e],i=r?.spatialReference;null==t||i||(t.spatialReference=n)}i.push(o)}return i}_quantizePoints(e,t,r){let n,i;const s=[];for(let o=0,a=e.length;o<a;o++){const a=e[o];if(o>0){const e=t(a[0]),o=r(a[1]);e===n&&o===i||(s.push([e-n,o-i]),n=e,i=o)}else n=t(a[0]),i=r(a[1]),s.push([n,i])}return s.length>0?s:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const n=(0,c.Bi)(e)?e.rings:e.paths,i=[];for(let e=0,s=n.length;e<s;e++){const s=n[e],o=this._quantizePoints(s,t,r);o&&i.push(o)}return i.length>0?((0,c.Bi)(e)?e.rings=i:e.paths=i,e):null}:"multipoint"===e?e=>{const n=this._quantizePoints(e.points,t,r);return n&&n.length>0?(e.points=n,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r,n,i){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y),n&&(e.z=n(e.z))}:"polyline"===e||"polygon"===e?e=>{const s=(0,c.Bi)(e)?e.rings:e.paths;let o,a;for(let e=0,n=s.length;e<n;e++){const n=s[e];for(let e=0,i=n.length;e<i;e++){const i=n[e];e>0?(o+=i[0],a+=i[1]):(o=i[0],a=i[1]),i[0]=t(o),i[1]=r(a)}}if(n&&i)for(let e=0,t=s.length;e<t;e++){const t=s[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=n(r[2]),r[3]=i(r[3])}}else if(n)for(let e=0,t=s.length;e<t;e++){const t=s[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=n(r[2])}}else if(i)for(let e=0,t=s.length;e<t;e++){const t=s[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=i(r[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax),n&&null!=e.zmax&&null!=e.zmin&&(e.zmax=n(e.zmax),e.zmin=n(e.zmin)),i&&null!=e.mmax&&null!=e.mmin&&(e.mmax=i(e.mmax),e.mmin=i(e.mmin))}:"multipoint"===e?e=>{const s=e.points;let o,a;for(let e=0,n=s.length;e<n;e++){const n=s[e];e>0?(o+=n[0],a+=n[1]):(o=n[0],a=n[1]),n[0]=t(o),n[1]=r(a)}if(n&&i)for(let e=0,t=s.length;e<t;e++){const t=s[e];t[2]=n(t[2]),t[3]=i(t[3])}else if(n)for(let e=0,t=s.length;e<t;e++){const t=s[e];t[2]=n(t[2])}else if(i)for(let e=0,t=s.length;e<t;e++){const t=s[e];t[2]=i(t[2])}}:null}};(0,i.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],w.prototype,"displayFieldName",void 0),(0,i.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"exceededTransferLimit",void 0),(0,i.Cg)([(0,u.MZ)({type:[s.A],json:{write:!0}})],w.prototype,"features",void 0),(0,i.Cg)([(0,m.w)("features")],w.prototype,"readFeatures",null),(0,i.Cg)([(0,u.MZ)({type:[y.A],json:{write:!0}})],w.prototype,"fields",void 0),(0,i.Cg)([(0,u.MZ)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:g.read}}})],w.prototype,"geometryType",void 0),(0,i.Cg)([(0,h.K)("geometryType")],w.prototype,"writeGeometryType",null),(0,i.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"hasM",void 0),(0,i.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"hasZ",void 0),(0,i.Cg)([(0,u.MZ)({types:f.yR,json:{write:!0}})],w.prototype,"queryGeometry",void 0),(0,i.Cg)([(0,m.w)("queryGeometry")],w.prototype,"readQueryGeometry",null),(0,i.Cg)([(0,u.MZ)({type:p.A,json:{write:!0}})],w.prototype,"spatialReference",void 0),(0,i.Cg)([(0,h.K)("spatialReference")],w.prototype,"writeSpatialReference",null),(0,i.Cg)([(0,u.MZ)({json:{write:!0}})],w.prototype,"transform",void 0),w=n=(0,i.Cg)([(0,u.$K)("esri.rest.support.FeatureSet")],w),w.prototype.toJSON.isDefaultToJSON=!0},41366(e,t,r){r.d(t,{K:()=>c,Q:()=>l});var n=r(5482),i=r(66552),s=r(53966),o=r(91429),a=r(93223);const l=(0,i.O)()({naturalLog:"natural-log",squareRoot:"square-root",percentOfTotal:"percent-of-total",log:"log",field:"field"}),u="percent-of-total",p="field",c=e=>{const t=e;let r=class extends t{constructor(){super(...arguments),this.normalizationField=null,this.normalizationMaxValue=null,this.normalizationMinValue=null,this.normalizationTotal=null}get normalizationType(){let e=this._get("normalizationType");const t=!!this.normalizationField,r=null!=this.normalizationTotal;return t||r?(e=t&&p||r&&u||null,t&&r&&s.A.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==p&&e!==u||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}};return(0,n.Cg)([(0,o.MZ)({type:String,json:{name:"parameters.normalizationField",write:!0}})],r.prototype,"normalizationField",void 0),(0,n.Cg)([(0,o.MZ)({type:Number,json:{name:"parameters.normalizationMaxValue",write:!0}})],r.prototype,"normalizationMaxValue",void 0),(0,n.Cg)([(0,o.MZ)({type:Number,json:{name:"parameters.normalizationMinValue",write:!0}})],r.prototype,"normalizationMinValue",void 0),(0,n.Cg)([(0,o.MZ)({type:Number,json:{name:"parameters.normalizationTotal",write:!0}})],r.prototype,"normalizationTotal",void 0),(0,n.Cg)([(0,a.e)(l,{name:"parameters.normalizationType"})],r.prototype,"normalizationType",null),r=(0,n.Cg)([(0,o.$K)("esri.rest.support.NormalizationBinParametersMixin")],r),r}},55674(e,t,r){r.d(t,{Ad:()=>f,Gj:()=>h,QY:()=>d,lL:()=>g,xR:()=>y});var n=r(66131),i=r(49186),s=(r(44208),r(44729)),o=r(15032),a=r(65864),l=r(95466),u=r(43668),p=r(98623);const c=["geometry","scale","timeProperties"];function d(e,t){if(null!=t)for(const r of c)t.hasArcadeDependency(r)&&e.add(r);return e}function f(e,t){return m.create(e,t,null,["$feature","$view"])}function y(e,t,r){return m.create(e,t,r,["$feature","$view","$config"])}class m{static async create(e,t,r,n){const{arcade:s,Dictionary:o}=await(0,u.l)();let a;try{a=s.parseScript(e)}catch(t){throw new i.A("arcade-bad-expression","Failed to parse arcade script",{script:e,error:t})}const l=s.scriptUsesGeometryEngine(a);l&&await s.enableGeometrySupport(),await s.loadDependentModules(new Set,a,null,!1,l);const p={vars:n.reduce((e,t)=>({...e,[t]:null}),{}),spatialReference:t,useAsync:!1},c=s.compileScript(a,p);let d=null;null!=r&&(d=new o(r),d.immutable=!0);const f=new o;return f.immutable=!1,f.setField("scale",0),new m(e,s,a,c,t,f,d,o)}constructor(e,t,r,n,i,s,o,a){this.script=e,this._arcade=t,this._syntaxTree=r,this._compiled=n,this._spatialReference=i,this._viewDict=s,this._configDict=o,this._dictionaryCtor=a,this._dependencies=new Map,this._featureReader=new h,this._dependencies.set("geometry",t.scriptTouchesGeometry(this._syntaxTree)),this._dependencies.set("scale",this._arcade.referencesMember(this._syntaxTree,"scale")),this._dependencies.set("timeProperties",this._arcade.scriptUsesViewProperties(this._syntaxTree,["timeProperties"]))}evaluate(e,t){const r=t.$view?.timeZone;if(t.$view){let e;if(this._viewDict.setField("scale",t.$view.scale),null!=t.$view.timeProperties){const{currentStart:i,currentEnd:s}=t.$view.timeProperties;e=new this._dictionaryCtor({currentStart:null!=i?null!=r?n.lY.epochToArcadeDate(i,r):n.lY.unknownEpochToArcadeDate(i):void 0,currentEnd:null!=s?null!=r?n.lY.epochToArcadeDate(s,r):n.lY.unknownEpochToArcadeDate(s):void 0,startIncluded:!0,endIncluded:!0})}this._viewDict.setField("timeProperties",e)}return this._compiled({vars:{$view:this._viewDict,$config:this._configDict,$feature:e},spatialReference:this._spatialReference,timeZone:r})}repurposeFeature(e,t){return this._featureReader.bind(e,t,this._spatialReference),this._featureReader}references(e){return this._dependencies.get(e)??!1}}class h{constructor(){this._boundTarget=null,this._boundSchema={fields:null,fieldsIndex:null,spatialReference:null,get geometryType(){return null},get objectIdField(){return null}},this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}bind(e,t,r){const n=t??new l.A(g(e.attributes));this._boundTarget=e,this._boundSchema.fields=n.fields,this._boundSchema.fieldsIndex=n,this._boundSchema.spatialReference=r}_getField(e){return this._boundSchema.fieldsIndex.get(e)}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this._boundSchema.fieldsIndex.has(e)}geometry(){if("fromJSON"in this._boundTarget)return this._boundTarget.geometry;const e=(0,a.rS)(this._boundTarget.geometry);if(e){if(!this._boundSchema.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");e.spatialReference=this._boundSchema.spatialReference}return e}_hasGeometry(){return null!=this._boundTarget.geometry}isUnknownDateTimeField(e){return this._boundSchema.fieldsIndex.getTimeZone(e)===p.L5}field(e,t=!0){const r=this._getField(e);if(r){const t=this._boundTarget.attributes[r.name];if(null==t)return null;switch(r.type){case"date-only":case"esriFieldTypeDateOnly":return s.n.fromReader(t);case"time-only":case"esriFieldTypeTimeOnly":return o.k.fromReader(t);case"esriFieldTypeTimestampOffset":case"timestamp-offset":return n.lY.fromReaderAsTimeStampOffset(t);case"date":case"esriFieldTypeDate":return this.isUnknownDateTimeField(e)?n.lY.unknownEpochToArcadeDate(t):n.lY.epochToArcadeDate(t,this.contextTimeZone??p.qU);default:return t}}if(t)throw new Error(`Field ${e} does not exist`);return null}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this._boundSchema.fieldsIndex.fields.map(e=>e.name)}isEmpty(){return this._boundSchema.fields.length<=0&&!this._hasGeometry()}castToText(e=!1){return JSON.stringify(this._boundTarget)}gdbVersion(){return null}fullSchema(){return this._boundSchema}castAsJson(e=null){return{attributes:this._boundTarget.attributes,geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}}function g(e){const t=[];for(const r in e)t.push({name:r,alias:r,type:"string"==typeof e[r]?"esriFieldTypeString":"esriFieldTypeDouble"});return t}}}]);
|